From 0833b0676e63b96361d1878768de2e840d43c60b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 3 Nov 2022 18:05:06 +0100 Subject: [PATCH 001/155] upgrade mdx --- .../templates/classic-typescript/package.json | 2 +- .../templates/classic/package.json | 2 +- .../templates/facebook/package.json | 2 +- packages/docusaurus-mdx-loader/package.json | 2 +- packages/docusaurus-mdx-loader/src/deps.d.ts | 31 - packages/docusaurus-mdx-loader/src/loader.ts | 32 +- .../docusaurus-theme-classic/package.json | 2 +- .../src/theme/MDXContent/index.tsx | 1 + .../docusaurus-theme-mermaid/package.json | 1 - yarn.lock | 889 +++++++++++++++--- 10 files changed, 768 insertions(+), 196 deletions(-) delete mode 100644 packages/docusaurus-mdx-loader/src/deps.d.ts diff --git a/packages/create-docusaurus/templates/classic-typescript/package.json b/packages/create-docusaurus/templates/classic-typescript/package.json index b882d8a317e6..ac55da8b8cb7 100644 --- a/packages/create-docusaurus/templates/classic-typescript/package.json +++ b/packages/create-docusaurus/templates/classic-typescript/package.json @@ -17,7 +17,7 @@ "dependencies": { "@docusaurus/core": "^3.0.0-alpha.0", "@docusaurus/preset-classic": "^3.0.0-alpha.0", - "@mdx-js/react": "^1.6.22", + "@mdx-js/react": "^2.1.5", "clsx": "^1.2.1", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", diff --git a/packages/create-docusaurus/templates/classic/package.json b/packages/create-docusaurus/templates/classic/package.json index 8eca2aa4467f..d0a06d1bd55c 100644 --- a/packages/create-docusaurus/templates/classic/package.json +++ b/packages/create-docusaurus/templates/classic/package.json @@ -16,7 +16,7 @@ "dependencies": { "@docusaurus/core": "^3.0.0-alpha.0", "@docusaurus/preset-classic": "^3.0.0-alpha.0", - "@mdx-js/react": "^1.6.22", + "@mdx-js/react": "^2.1.5", "clsx": "^1.2.1", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", diff --git a/packages/create-docusaurus/templates/facebook/package.json b/packages/create-docusaurus/templates/facebook/package.json index c7d1963f0a96..1ff5b2154858 100644 --- a/packages/create-docusaurus/templates/facebook/package.json +++ b/packages/create-docusaurus/templates/facebook/package.json @@ -20,7 +20,7 @@ "dependencies": { "@docusaurus/core": "^3.0.0-alpha.0", "@docusaurus/preset-classic": "^3.0.0-alpha.0", - "@mdx-js/react": "^1.6.22", + "@mdx-js/react": "^2.1.5", "clsx": "^1.2.1", "react": "^17.0.2", "react-dom": "^17.0.2" diff --git a/packages/docusaurus-mdx-loader/package.json b/packages/docusaurus-mdx-loader/package.json index 6d4a223338ea..f58ea4d98487 100644 --- a/packages/docusaurus-mdx-loader/package.json +++ b/packages/docusaurus-mdx-loader/package.json @@ -22,7 +22,7 @@ "@babel/traverse": "^7.19.0", "@docusaurus/logger": "^3.0.0-alpha.0", "@docusaurus/utils": "^3.0.0-alpha.0", - "@mdx-js/mdx": "^1.6.22", + "@mdx-js/mdx": "^2.1.5", "escape-html": "^1.0.3", "file-loader": "^6.2.0", "fs-extra": "^10.1.0", diff --git a/packages/docusaurus-mdx-loader/src/deps.d.ts b/packages/docusaurus-mdx-loader/src/deps.d.ts deleted file mode 100644 index 7f8fb25a2fe0..000000000000 --- a/packages/docusaurus-mdx-loader/src/deps.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -// TODO Types provided by MDX 2.0 https://github.com/mdx-js/mdx/blob/main/packages/mdx/types/index.d.ts -declare module '@mdx-js/mdx' { - import type {Processor, Plugin} from 'unified'; - - type MDXPlugin = - // eslint-disable-next-line @typescript-eslint/no-explicit-any - [Plugin, any] | Plugin; - - type Options = { - filepath?: string; - skipExport?: boolean; - wrapExport?: string; - remarkPlugins?: MDXPlugin[]; - rehypePlugins?: MDXPlugin[]; - }; - - export function sync(content: string, options?: Options): string; - export function createMdxAstCompiler(options?: Options): Processor; - export function createCompiler(options?: Options): Processor; - export default function mdx( - content: string, - options?: Options, - ): Promise; -} diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 12ac0e192fda..29934cdc7f30 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -13,7 +13,6 @@ import { escapePath, getFileLoaderUtils, } from '@docusaurus/utils'; -import {createCompiler} from '@mdx-js/mdx'; import emoji from 'remark-emoji'; import stringifyObject from 'stringify-object'; @@ -24,12 +23,15 @@ import transformImage from './remark/transformImage'; import transformLinks from './remark/transformLinks'; import mermaid from './remark/mermaid'; -import transformAdmonitions from './remark/admonitions'; +// import transformAdmonitions from './remark/admonitions'; import type {MarkdownConfig} from '@docusaurus/types'; import type {LoaderContext} from 'webpack'; -import type {Processor, Plugin} from 'unified'; +import type {Processor, PluggableList} from 'unified'; import type {AdmonitionOptions} from './remark/admonitions'; +// @ts-expect-error: TODO +import type {ProcessorOptions} from '@mdx-js/mdx'; + const { loaders: {inlineMarkdownImageFileLoader}, } = getFileLoaderUtils(); @@ -43,6 +45,7 @@ const pragma = ` const DEFAULT_OPTIONS: MDXOptions = { admonitions: true, rehypePlugins: [], + // @ts-expect-error: todo remarkPlugins: [unwrapMdxCodeBlocks, emoji, headings, toc], beforeDefaultRemarkPlugins: [], beforeDefaultRehypePlugins: [], @@ -50,9 +53,7 @@ const DEFAULT_OPTIONS: MDXOptions = { const compilerCache = new Map(); -export type MDXPlugin = - // eslint-disable-next-line @typescript-eslint/no-explicit-any - [Plugin, any] | Plugin; +export type MDXPlugin = PluggableList; export type MDXOptions = { admonitions: boolean | Partial; @@ -143,12 +144,15 @@ function getAdmonitionsPlugins( admonitionsOption: MDXOptions['admonitions'], ): MDXPlugin[] { if (admonitionsOption) { + /* const plugin: MDXPlugin = admonitionsOption === true ? transformAdmonitions : [transformAdmonitions, admonitionsOption]; - return [plugin]; + // return [plugin]; TODO + */ } + return []; } @@ -160,6 +164,8 @@ export async function mdxLoader( const filePath = this.resourcePath; const reqOptions = this.getOptions(); + const {createProcessor} = await import('@mdx-js/mdx'); + const {frontMatter, content: contentWithTitle} = parseFrontMatter(fileString); const {content, contentTitle} = parseMarkdownContentTitle(contentWithTitle, { @@ -169,7 +175,8 @@ export async function mdxLoader( const hasFrontMatter = Object.keys(frontMatter).length > 0; if (!compilerCache.has(this.query)) { - const remarkPlugins: MDXPlugin[] = [ + // @ts-expect-error: TODO + const remarkPlugins: ProcessorOptions['remarkPlugins'] = [ ...(reqOptions.beforeDefaultRemarkPlugins ?? []), ...getAdmonitionsPlugins(reqOptions.admonitions ?? false), ...DEFAULT_OPTIONS.remarkPlugins, @@ -191,18 +198,21 @@ export async function mdxLoader( ...(reqOptions.remarkPlugins ?? []), ]; - const rehypePlugins: MDXPlugin[] = [ + // @ts-expect-error: TODO + const rehypePlugins: ProcessorOptions['rehypePlugins'] = [ ...(reqOptions.beforeDefaultRehypePlugins ?? []), ...DEFAULT_OPTIONS.rehypePlugins, ...(reqOptions.rehypePlugins ?? []), ]; - const options: Options = { + const options: ProcessorOptions = { ...reqOptions, remarkPlugins, rehypePlugins, }; - compilerCache.set(this.query, [createCompiler(options), options]); + + // @ts-expect-error: TODO + compilerCache.set(this.query, [createProcessor(options), options]); } const [compiler, options] = compilerCache.get(this.query)!; diff --git a/packages/docusaurus-theme-classic/package.json b/packages/docusaurus-theme-classic/package.json index 8ab3c25dde46..bf21876fd142 100644 --- a/packages/docusaurus-theme-classic/package.json +++ b/packages/docusaurus-theme-classic/package.json @@ -32,7 +32,7 @@ "@docusaurus/utils": "^3.0.0-alpha.0", "@docusaurus/utils-common": "^3.0.0-alpha.0", "@docusaurus/utils-validation": "^3.0.0-alpha.0", - "@mdx-js/react": "^1.6.22", + "@mdx-js/react": "^2.1.5", "clsx": "^1.2.1", "copy-text-to-clipboard": "^3.0.1", "infima": "0.2.0-alpha.42", diff --git a/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx b/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx index ad70107193db..68524f319599 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx @@ -6,6 +6,7 @@ */ import React from 'react'; +// @ts-expect-error: todo import {MDXProvider} from '@mdx-js/react'; import MDXComponents from '@theme/MDXComponents'; import type {Props} from '@theme/MDXContent'; diff --git a/packages/docusaurus-theme-mermaid/package.json b/packages/docusaurus-theme-mermaid/package.json index e42f81e712a7..bde31b31a3e5 100644 --- a/packages/docusaurus-theme-mermaid/package.json +++ b/packages/docusaurus-theme-mermaid/package.json @@ -38,7 +38,6 @@ "@docusaurus/theme-common": "^3.0.0-alpha.0", "@docusaurus/types": "^3.0.0-alpha.0", "@docusaurus/utils-validation": "^3.0.0-alpha.0", - "@mdx-js/react": "^1.6.22", "mermaid": "^9.1.1", "tslib": "^2.4.0" }, diff --git a/yarn.lock b/yarn.lock index 06a188194c6f..bf10d580d77e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -699,7 +699,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-object-rest-spread@7.8.3", "@babel/plugin-syntax-object-rest-spread@^7.8.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3": +"@babel/plugin-syntax-object-rest-spread@^7.8.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== @@ -2630,35 +2630,36 @@ stringify-entities "^3.0.1" stringify-object "^3.3.0" -"@mdx-js/mdx@^1.6.22": - version "1.6.22" - resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-1.6.22.tgz#8a723157bf90e78f17dc0f27995398e6c731f1ba" - integrity sha512-AMxuLxPz2j5/6TpF/XSdKpQP1NlG0z11dFOlq+2IP/lSgl11GY8ji6S/rgsViN/L0BDvHvUMruRb7ub+24LUYA== - dependencies: - "@babel/core" "7.12.9" - "@babel/plugin-syntax-jsx" "7.12.1" - "@babel/plugin-syntax-object-rest-spread" "7.8.3" - "@mdx-js/util" "1.6.22" - babel-plugin-apply-mdx-type-prop "1.6.22" - babel-plugin-extract-import-names "1.6.22" - camelcase-css "2.0.1" - detab "2.0.4" - hast-util-raw "6.0.1" - lodash.uniq "4.5.0" - mdast-util-to-hast "10.0.1" - remark-footnotes "2.0.0" - remark-mdx "1.6.22" - remark-parse "8.0.3" - remark-squeeze-paragraphs "4.0.0" - style-to-object "0.3.0" - unified "9.2.0" - unist-builder "2.0.3" - unist-util-visit "2.0.3" +"@mdx-js/mdx@^2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-2.1.5.tgz#577937349fd555154382c2f805f5f52834a64903" + integrity sha512-zEG0lt+Bl/r5U6e0TOS7qDbsXICtemfAPquxWFsMbdzrvlWaqMGemLl+sjVpqlyaaiCiGVQBSGdCk0t1qXjkQg== + dependencies: + "@types/estree-jsx" "^1.0.0" + "@types/mdx" "^2.0.0" + estree-util-build-jsx "^2.0.0" + estree-util-is-identifier-name "^2.0.0" + estree-util-to-js "^1.1.0" + estree-walker "^3.0.0" + hast-util-to-estree "^2.0.0" + markdown-extensions "^1.0.0" + periscopic "^3.0.0" + remark-mdx "^2.0.0" + remark-parse "^10.0.0" + remark-rehype "^10.0.0" + unified "^10.0.0" + unist-util-position-from-estree "^1.0.0" + unist-util-stringify-position "^3.0.0" + unist-util-visit "^4.0.0" + vfile "^5.0.0" -"@mdx-js/react@^1.6.22": - version "1.6.22" - resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.6.22.tgz#ae09b4744fddc74714ee9f9d6f17a66e77c43573" - integrity sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg== +"@mdx-js/react@^2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-2.1.5.tgz#8225a867dae6f845ae5b0ec15bb454c23be3f576" + integrity sha512-3Az1I6SAWA9R38rYjz5rXBrGKeZhq96CSSyQtqY+maPj8stBsoUH5pNcmIixuGkufYsh8F5+ka2CVPo2fycWZw== + dependencies: + "@types/mdx" "^2.0.0" + "@types/react" ">=16" "@mdx-js/util@1.6.22": version "1.6.22" @@ -3323,6 +3324,13 @@ resolved "https://registry.yarnpkg.com/@tsconfig/docusaurus/-/docusaurus-1.0.6.tgz#7305a7fa590decc0d5968500234e95fd68788978" integrity sha512-1QxDaP54hpzM6bq9E+yFEo4F9WbWHhsDe4vktZXF/iDlc9FqGr9qlg+3X/nuKQXx8QxHV7ue8NXFazzajsxFBA== +"@types/acorn@^4.0.0": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@types/acorn/-/acorn-4.0.6.tgz#d61ca5480300ac41a7d973dd5b84d0a591154a22" + integrity sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ== + dependencies: + "@types/estree" "*" + "@types/babel__core@^7.1.14": version "7.1.19" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" @@ -3430,6 +3438,13 @@ dependencies: "@types/node" "*" +"@types/debug@^4.0.0": + version "4.1.7" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.7.tgz#7cc0ea761509124709b8b2d1090d8f6c17aadb82" + integrity sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg== + dependencies: + "@types/ms" "*" + "@types/dedent@^0.7.0": version "0.7.0" resolved "https://registry.yarnpkg.com/@types/dedent/-/dedent-0.7.0.tgz#155f339ca404e6dd90b9ce46a3f78fd69ca9b050" @@ -3461,7 +3476,14 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*": +"@types/estree-jsx@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/estree-jsx/-/estree-jsx-1.0.0.tgz#7bfc979ab9f692b492017df42520f7f765e98df1" + integrity sha512-3qvGd0z8F2ENTGr/GG1yViqfiKmRfrXVx5sJyHGFu3z7m5g5utCQtGp/g29JnjflhtQJBv1WDQukHiT58xPcYQ== + dependencies: + "@types/estree" "*" + +"@types/estree@*", "@types/estree@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2" integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ== @@ -3659,6 +3681,11 @@ dependencies: "@types/react" "*" +"@types/mdx@^2.0.0": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/mdx/-/mdx-2.0.3.tgz#43fd32414f17fcbeced3578109a6edd877a2d96e" + integrity sha512-IgHxcT3RC8LzFLhKwP3gbMPeaK7BM9eBH46OdapPA7yvuIUJ8H6zHZV53J8hGZcTSnt95jANt+rTBNUUc22ACQ== + "@types/mermaid@^8.2.9": version "8.2.9" resolved "https://registry.yarnpkg.com/@types/mermaid/-/mermaid-8.2.9.tgz#1844505dcffcd47703e94628a6200583d35c2c76" @@ -3691,6 +3718,11 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== +"@types/ms@*": + version "0.7.31" + resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" + integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== + "@types/node@*", "@types/node@^18.7.16": version "18.7.16" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.16.tgz#0eb3cce1e37c79619943d2fd903919fc30850601" @@ -3814,10 +3846,10 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.18": - version "18.0.18" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.18.tgz#9f16f33d57bc5d9dca848d12c3572110ff9429ac" - integrity sha512-6hI08umYs6NaiHFEEGioXnxJ+oEhY3eRz8VCUaudZmGdtvPviCJB8mgaMxaDWAdPSYd4eFavrPk2QIolwbLYrg== +"@types/react@*", "@types/react@>=16", "@types/react@^18.0.18": + version "18.0.24" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.24.tgz#2f79ed5b27f08d05107aab45c17919754cc44c20" + integrity sha512-wRJWT6ouziGUy+9uX0aW4YOJxAY0bG6/AOk5AW5QSvZqI7dk6VBIbXvcVgIw/W5Jrl24f77df98GEKTJGOLx7Q== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -3955,7 +3987,7 @@ dependencies: source-map "^0.6.1" -"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3", "@types/unist@^2.0.6": +"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.6": version "2.0.6" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== @@ -4303,7 +4335,7 @@ acorn-import-assertions@^1.7.6: resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== -acorn-jsx@^5.0.1, acorn-jsx@^5.3.2: +acorn-jsx@^5.0.0, acorn-jsx@^5.0.1, acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== @@ -4328,10 +4360,10 @@ acorn@^7.1.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: - version "8.8.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" - integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== +acorn@^8.0.0, acorn@^8.0.4, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: + version "8.8.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" + integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== add-stream@^1.0.0: version "1.0.0" @@ -4660,6 +4692,11 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +astring@^1.8.0: + version "1.8.3" + resolved "https://registry.yarnpkg.com/astring/-/astring-1.8.3.tgz#1a0ae738c7cc558f8e5ddc8e3120636f5cebcb85" + integrity sha512-sRpyiNrx2dEYIMmUXprS8nlpRg2Drs8m9ElX9vVEXaCB4XEAJhKfs7IcX0IwShjuOAjLR6wzIrgoptz1n19i1A== + async@^3.2.3: version "3.2.4" resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" @@ -4744,14 +4781,6 @@ babel-loader@^8.2.5: make-dir "^3.1.0" schema-utils "^2.6.5" -babel-plugin-apply-mdx-type-prop@1.6.22: - version "1.6.22" - resolved "https://registry.yarnpkg.com/babel-plugin-apply-mdx-type-prop/-/babel-plugin-apply-mdx-type-prop-1.6.22.tgz#d216e8fd0de91de3f1478ef3231e05446bc8705b" - integrity sha512-VefL+8o+F/DfK24lPZMtJctrCVOfgbqLAGZSkxwhazQv4VxPg3Za/i40fu22KR2m8eEda+IfSOlPLUSIiLcnCQ== - dependencies: - "@babel/helper-plugin-utils" "7.10.4" - "@mdx-js/util" "1.6.22" - babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" @@ -4759,13 +4788,6 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" -babel-plugin-extract-import-names@1.6.22: - version "1.6.22" - resolved "https://registry.yarnpkg.com/babel-plugin-extract-import-names/-/babel-plugin-extract-import-names-1.6.22.tgz#de5f9a28eb12f3eb2578bf74472204e66d1a13dc" - integrity sha512-yJ9BsJaISua7d8zNT7oRG1ZLBJCIdZ4PZqmH8qa9N5AK01ifk3fnkc98AXhtzE7UkfCsEumvoQWgoYLhOnJ7jQ== - dependencies: - "@babel/helper-plugin-utils" "7.10.4" - babel-plugin-istanbul@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" @@ -5243,7 +5265,7 @@ camel-case@^4.1.2: pascal-case "^3.1.2" tslib "^2.0.3" -camelcase-css@2.0.1, camelcase-css@^2.0.1: +camelcase-css@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== @@ -5287,6 +5309,11 @@ ccount@^1.0.0: resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== +ccount@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" + integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== + chainsaw@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98" @@ -5337,21 +5364,41 @@ character-entities-html4@^1.0.0: resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.4.tgz#0e64b0a3753ddbf1fdc044c5fd01d0199a02e125" integrity sha512-HRcDxZuZqMx3/a+qrzxdBKBPUpxWEq9xw2OPZ3a/174ihfrQKVsFhqtthBInFy1zZ9GgZyFXOatNujm8M+El3g== +character-entities-html4@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b" + integrity sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA== + character-entities-legacy@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1" integrity sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA== +character-entities-legacy@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz#76bc83a90738901d7bc223a9e93759fdd560125b" + integrity sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ== + character-entities@^1.0.0: version "1.2.4" resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.4.tgz#e12c3939b7eaf4e5b15e7ad4c5e28e1d48c5b16b" integrity sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw== +character-entities@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.2.tgz#2d09c2e72cd9523076ccb21157dff66ad43fcc22" + integrity sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ== + character-reference-invalid@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg== +character-reference-invalid@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz#85c66b041e43b47210faf401278abf808ac45cb9" + integrity sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw== + chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" @@ -6861,7 +6908,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9: dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: +debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -6898,6 +6945,13 @@ decimal.js@^10.3.1: resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.0.tgz#97a7448873b01e92e5ff9117d89a7bca8e63e0fe" integrity sha512-Nv6ENEzyPQ6AItkGwLE2PGKinZZ9g59vSh2BeH6NqPu0OTKZ5ruJsVqh/orbAnqXc9pBbgXAIrc2EyaCj8NpGg== +decode-named-character-reference@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz#daabac9690874c394c81e4162a0304b35d824f0e" + integrity sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg== + dependencies: + character-entities "^2.0.0" + decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -7047,18 +7101,16 @@ deprecation@^2.0.0, deprecation@^2.3.1: resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== +dequal@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" + integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== + destroy@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== -detab@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.4.tgz#b927892069aff405fbb9a186fe97a44a92a94b43" - integrity sha512-8zdsQA5bIkoRECvCrNKPla84lyoR7DSAyf7p0YgXzBO9PDJx8KntPUay7NS6yp+KdxdVtiE5SpHKtbp2ZQyA9g== - dependencies: - repeat-string "^1.5.4" - detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" @@ -7113,6 +7165,11 @@ diff-sequences@^29.0.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.0.0.tgz#bae49972ef3933556bcb0800b72e8579d19d9e4f" integrity sha512-7Qe/zd1wxSDL4D/X/FPjOMB+ZMDt71W94KYaq05I2l0oQqgXgs7s4ftYYmV38gBSrPz2vcygxfs1xn0FT+rKNA== +diff@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" + integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -7736,11 +7793,54 @@ estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== +estree-util-attach-comments@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/estree-util-attach-comments/-/estree-util-attach-comments-2.1.0.tgz#47d69900588bcbc6bf58c3798803ec5f1f3008de" + integrity sha512-rJz6I4L0GaXYtHpoMScgDIwM0/Vwbu5shbMeER596rB2D1EWF6+Gj0e0UKzJPZrpoOc87+Q2kgVFHfjAymIqmw== + dependencies: + "@types/estree" "^1.0.0" + +estree-util-build-jsx@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/estree-util-build-jsx/-/estree-util-build-jsx-2.2.0.tgz#d4307bbeee28c14eb4d63b75c9aad28fa61d84f5" + integrity sha512-apsfRxF9uLrqosApvHVtYZjISPvTJ+lBiIydpC+9wE6cF6ssbhnjyQLqaIjgzGxvC2Hbmec1M7g91PoBayYoQQ== + dependencies: + "@types/estree-jsx" "^1.0.0" + estree-util-is-identifier-name "^2.0.0" + estree-walker "^3.0.0" + +estree-util-is-identifier-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/estree-util-is-identifier-name/-/estree-util-is-identifier-name-2.0.1.tgz#cf07867f42705892718d9d89eb2d85eaa8f0fcb5" + integrity sha512-rxZj1GkQhY4x1j/CSnybK9cGuMFQYFPLq0iNyopqf14aOVLFtMv7Esika+ObJWPWiOHuMOAHz3YkWoLYYRnzWQ== + +estree-util-to-js@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/estree-util-to-js/-/estree-util-to-js-1.1.0.tgz#3bd9bb86354063537cc3d81259be2f0d4c3af39f" + integrity sha512-490lbfCcpLk+ofK6HCgqDfYs4KAfq6QVvDw3+Bm1YoKRgiOjKiKYGAVQE1uwh7zVxBgWhqp4FDtp5SqunpUk1A== + dependencies: + "@types/estree-jsx" "^1.0.0" + astring "^1.8.0" + source-map "^0.7.0" + +estree-util-visit@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/estree-util-visit/-/estree-util-visit-1.2.0.tgz#aa0311a9c2f2aa56e9ae5e8b9d87eac14e4ec8f8" + integrity sha512-wdsoqhWueuJKsh5hqLw3j8lwFqNStm92VcwtAOAny8g/KS/l5Y8RISjR4k5W6skCj3Nirag/WUCMS0Nfy3sgsg== + dependencies: + "@types/estree-jsx" "^1.0.0" + "@types/unist" "^2.0.0" + estree-walker@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== +estree-walker@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-3.0.1.tgz#c2a9fb4a30232f5039b7c030b37ead691932debd" + integrity sha512-woY0RUD87WzMBUiZLx8NsYr23N5BKsOMZHhu2hoNRVh6NXGfoiT1KOL8G3UHlJAnEDGmfa5ubNA/AacfG+Kb0g== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -8773,19 +8873,6 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hast-to-hyperscript@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz#9b67fd188e4c81e8ad66f803855334173920218d" - integrity sha512-zQgLKqF+O2F72S1aa4y2ivxzSlko3MAvxkwG8ehGmNiqd98BIN3JM1rAJPmplEyLmGLO2QZYJtIneOSZ2YbJuA== - dependencies: - "@types/unist" "^2.0.3" - comma-separated-tokens "^1.0.0" - property-information "^5.3.0" - space-separated-tokens "^1.0.0" - style-to-object "^0.3.0" - unist-util-is "^4.0.0" - web-namespaces "^1.0.0" - hast-util-from-parse5@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz#554e34abdeea25ac76f5bd950a1f0180e0b3bc2a" @@ -8837,21 +8924,26 @@ hast-util-parse-selector@^3.0.0: dependencies: "@types/hast" "^2.0.0" -hast-util-raw@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/hast-util-raw/-/hast-util-raw-6.0.1.tgz#973b15930b7529a7b66984c98148b46526885977" - integrity sha512-ZMuiYA+UF7BXBtsTBNcLBF5HzXzkyE6MLzJnL605LKE8GJylNjGc4jjxazAHUtcwT5/CEt6afRKViYB4X66dig== +hast-util-to-estree@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/hast-util-to-estree/-/hast-util-to-estree-2.1.0.tgz#aeac70aad0102ae309570907b3f56a08231d5323" + integrity sha512-Vwch1etMRmm89xGgz+voWXvVHba2iiMdGMKmaMfYt35rbVtFDq8JNwwAIvi8zHMkO6Gvqo9oTMwJTmzVRfXh4g== dependencies: + "@types/estree" "^1.0.0" + "@types/estree-jsx" "^1.0.0" "@types/hast" "^2.0.0" - hast-util-from-parse5 "^6.0.0" - hast-util-to-parse5 "^6.0.0" - html-void-elements "^1.0.0" - parse5 "^6.0.0" - unist-util-position "^3.0.0" - vfile "^4.0.0" - web-namespaces "^1.0.0" - xtend "^4.0.0" - zwitch "^1.0.0" + "@types/unist" "^2.0.0" + comma-separated-tokens "^2.0.0" + estree-util-attach-comments "^2.0.0" + estree-util-is-identifier-name "^2.0.0" + hast-util-whitespace "^2.0.0" + mdast-util-mdx-expression "^1.0.0" + mdast-util-mdxjs-esm "^1.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" + style-to-object "^0.3.0" + unist-util-position "^4.0.0" + zwitch "^2.0.0" hast-util-to-html@^7.1.1: version "7.1.3" @@ -8869,17 +8961,6 @@ hast-util-to-html@^7.1.1: unist-util-is "^4.0.0" xtend "^4.0.0" -hast-util-to-parse5@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/hast-util-to-parse5/-/hast-util-to-parse5-6.0.0.tgz#1ec44650b631d72952066cea9b1445df699f8479" - integrity sha512-Lu5m6Lgm/fWuz8eWnrKezHtVY83JeRGaNQ2kn9aJgqaxvVkFCZQBEhgodZUDUvoodgyROHDb3r5IxAEdl6suJQ== - dependencies: - hast-to-hyperscript "^9.0.0" - property-information "^5.0.0" - web-namespaces "^1.0.0" - xtend "^4.0.0" - zwitch "^1.0.0" - hast-util-to-string@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/hast-util-to-string/-/hast-util-to-string-1.0.4.tgz#9b24c114866bdb9478927d7e9c36a485ac728378" @@ -8899,6 +8980,11 @@ hast-util-whitespace@^1.0.0: resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-1.0.4.tgz#e4fe77c4a9ae1cb2e6c25e02df0043d0164f6e41" integrity sha512-I5GTdSfhYfAPNztx2xJRQpG8cuDSNt599/7YUn7Gx/WxNMsG+a835k97TDkFgk123cwjfwINaZknkKkphx/f2A== +hast-util-whitespace@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-2.0.0.tgz#4fc1086467cc1ef5ba20673cb6b03cec3a970f1c" + integrity sha512-Pkw+xBHuV6xFeJprJe2BBEoDV+AvQySaz3pPDRUs5PNZEMQjpXJJueqrpcHIXxnWTcAGi/UOCgVShlkY6kLoqg== + hastscript@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640" @@ -9398,6 +9484,11 @@ is-alphabetical@1.0.4, is-alphabetical@^1.0.0: resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== +is-alphabetical@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-2.0.1.tgz#01072053ea7c1036df3c7d19a6daaec7f19e789b" + integrity sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ== + is-alphanumeric@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz#4a9cef71daf4c001c1d81d63d140cf53fd6889f4" @@ -9411,6 +9502,14 @@ is-alphanumerical@^1.0.0: is-alphabetical "^1.0.0" is-decimal "^1.0.0" +is-alphanumerical@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz#7c03fbe96e3e931113e57f964b0a368cc2dfd875" + integrity sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw== + dependencies: + is-alphabetical "^2.0.0" + is-decimal "^2.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -9498,6 +9597,11 @@ is-decimal@^1.0.0: resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5" integrity sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw== +is-decimal@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-2.0.1.tgz#9469d2dc190d0214fd87d78b78caecc0cc14eef7" + integrity sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A== + is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -9565,6 +9669,11 @@ is-hexadecimal@^1.0.0: resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw== +is-hexadecimal@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz#86b5bf668fca307498d319dfc03289d781a90027" + integrity sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg== + is-installed-globally@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" @@ -9679,6 +9788,13 @@ is-promise@^4.0.0: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-4.0.0.tgz#42ff9f84206c1991d26debf520dd5c01042dd2f3" integrity sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ== +is-reference@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-3.0.0.tgz#b1380c03d96ddf7089709781e3208fceb0c92cd6" + integrity sha512-Eo1W3wUoHWoCoVM4GVl/a+K0IgiqE5aIo4kJABFyMum1ZORlPkC+UC357sSQUL5w5QCE5kCC9upl75b7+7CY/Q== + dependencies: + "@types/estree" "*" + is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -10527,6 +10643,11 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +kleur@^4.0.3: + version "4.1.5" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780" + integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ== + klona@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.5.tgz#d166574d90076395d9963aa7a928fabb8d76afbc" @@ -10800,7 +10921,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== -lodash.uniq@4.5.0, lodash.uniq@^4.5.0: +lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== @@ -10833,6 +10954,11 @@ longest-streak@^2.0.1: resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4" integrity sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg== +longest-streak@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.0.1.tgz#c97315b7afa0e7d9525db9a5a2953651432bdc5d" + integrity sha512-cHlYSUpL2s7Fb3394mYxwTYj8niTaNHUCLr0qdiCXQfSjfuA7CKofpX2uSwEfFDQ0EB7JcnMnm+GjbqqoinYYg== + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -10969,6 +11095,11 @@ markdown-escapes@^1.0.0: resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== +markdown-extensions@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/markdown-extensions/-/markdown-extensions-1.1.1.tgz#fea03b539faeaee9b4ef02a3769b455b189f7fc3" + integrity sha512-WWC0ZuMzCyDHYCasEGs4IPvLyTGftYwh6wIEOULOF0HXcqZlhwRzrK0w2VUlxWA98xnvb/jszw4ZSkJ6ADpM6Q== + markdown-table@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b" @@ -10981,13 +11112,6 @@ mathml-tag-names@^2.1.3: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -mdast-squeeze-paragraphs@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-4.0.0.tgz#7c4c114679c3bee27ef10b58e2e015be79f1ef97" - integrity sha512-zxdPn69hkQ1rm4J+2Cs2j6wDEv7O17TfXTJ33tl/+JPIoEmtV9t2ZzBM5LPHE8QlHsmVD8t3vPKCyY3oH+H8MQ== - dependencies: - unist-util-remove "^2.0.0" - mdast-util-compact@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-2.0.1.tgz#cabc69a2f43103628326f35b1acf735d55c99490" @@ -11002,19 +11126,79 @@ mdast-util-definitions@^4.0.0: dependencies: unist-util-visit "^2.0.0" -mdast-util-to-hast@10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-10.0.1.tgz#0cfc82089494c52d46eb0e3edb7a4eb2aea021eb" - integrity sha512-BW3LM9SEMnjf4HXXVApZMt8gLQWVNXc3jryK0nJu/rOXPOnlkUjmdkDlmxMirpbU9ILncGFIwLH/ubnWBbcdgA== +mdast-util-definitions@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-5.1.1.tgz#2c1d684b28e53f84938bb06317944bee8efa79db" + integrity sha512-rQ+Gv7mHttxHOBx2dkF4HWTg+EE+UR78ptQWDylzPKaQuVGdG4HIoY3SrS/pCp80nZ04greFvXbVFHT+uf0JVQ== dependencies: "@types/mdast" "^3.0.0" "@types/unist" "^2.0.0" - mdast-util-definitions "^4.0.0" - mdurl "^1.0.0" - unist-builder "^2.0.0" - unist-util-generated "^1.0.0" - unist-util-position "^3.0.0" - unist-util-visit "^2.0.0" + unist-util-visit "^4.0.0" + +mdast-util-from-markdown@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-1.2.0.tgz#84df2924ccc6c995dec1e2368b2b208ad0a76268" + integrity sha512-iZJyyvKD1+K7QX1b5jXdE7Sc5dtoTry1vzV28UZZe8Z1xVnB/czKntJ7ZAkG0tANqRnBF6p3p7GpU1y19DTf2Q== + 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" + +mdast-util-mdx-expression@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mdast-util-mdx-expression/-/mdast-util-mdx-expression-1.3.1.tgz#2224cf0b5b150093704a3c225bd529d2de21f50f" + integrity sha512-TTb6cKyTA1RD+1su1iStZ5PAv3rFfOUKcoU5EstUpv/IZo63uDX03R8+jXjMEhcobXnNOiG6/ccekvVl4eV1zQ== + 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" + +mdast-util-mdx-jsx@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-2.1.0.tgz#029f5a9c38485dbb5cf482059557ee7d788f1947" + integrity sha512-KzgzfWMhdteDkrY4mQtyvTU5bc/W4ppxhe9SzelO6QUUiwLAM+Et2Dnjjprik74a336kHdo0zKm7Tp+n6FFeRg== + dependencies: + "@types/estree-jsx" "^1.0.0" + "@types/hast" "^2.0.0" + "@types/mdast" "^3.0.0" + ccount "^2.0.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" + +mdast-util-mdx@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-mdx/-/mdast-util-mdx-2.0.0.tgz#dd4f6c993cf27da32725e50a04874f595b7b63fb" + integrity sha512-M09lW0CcBT1VrJUaF/PYxemxxHa7SLDHdSn94Q9FhxjCQfuW7nMAWKWimTmA3OyDMSTH981NN1csW1X+HPSluw== + dependencies: + mdast-util-mdx-expression "^1.0.0" + mdast-util-mdx-jsx "^2.0.0" + mdast-util-mdxjs-esm "^1.0.0" + +mdast-util-mdxjs-esm@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-1.3.0.tgz#137345ef827169aeeeb6069277cd3e090830ce9a" + integrity sha512-7N5ihsOkAEGjFotIX9p/YPdl4TqUoMxL4ajNz7PbT89BqsdWJuBC9rvgt6wpbwTZqWWR0jKWqQbwsOWDBUZv4g== + 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" mdast-util-to-hast@^10.2.0: version "10.2.0" @@ -11030,11 +11214,44 @@ mdast-util-to-hast@^10.2.0: unist-util-position "^3.0.0" unist-util-visit "^2.0.0" +mdast-util-to-hast@^12.1.0: + version "12.2.4" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-12.2.4.tgz#34c1ef2b6cf01c27b3e3504e2c977c76f722e7e1" + integrity sha512-a21xoxSef1l8VhHxS1Dnyioz6grrJkoaCUgGzMD/7dWHvboYX3VW53esRUfB5tgTyz4Yos1n25SPcj35dJqmAg== + dependencies: + "@types/hast" "^2.0.0" + "@types/mdast" "^3.0.0" + mdast-util-definitions "^5.0.0" + micromark-util-sanitize-uri "^1.1.0" + trim-lines "^3.0.0" + unist-builder "^3.0.0" + unist-util-generated "^2.0.0" + unist-util-position "^4.0.0" + unist-util-visit "^4.0.0" + +mdast-util-to-markdown@^1.0.0, mdast-util-to-markdown@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-1.3.0.tgz#38b6cdc8dc417de642a469c4fc2abdf8c931bd1e" + integrity sha512-6tUSs4r+KK4JGTTiQ7FfHmVOaDrLQJPmpjD6wPMlHGUVXoG9Vjc3jIeP+uyBWRf8clwB2blM+W7+KrlMYQnftA== + dependencies: + "@types/mdast" "^3.0.0" + "@types/unist" "^2.0.0" + longest-streak "^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" + mdast-util-to-string@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz#b8cfe6a713e1091cb5b728fc48885a4767f8b97b" integrity sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w== +mdast-util-to-string@^3.0.0, mdast-util-to-string@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz#56c506d065fbf769515235e577b5a261552d56e9" + integrity sha512-n4Vypz/DZgwo0iMHLQL49dJzlp7YtAJP+N07MZHpjPf/5XJuHUWstviF4Mn2jEiR/GNmtnRRqnwsXExk3igfFA== + mdn-data@2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -11132,6 +11349,291 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== +micromark-core-commonmark@^1.0.0, micromark-core-commonmark@^1.0.1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-1.0.6.tgz#edff4c72e5993d93724a3c206970f5a15b0585ad" + integrity sha512-K+PkJTxqjFfSNkfAhp4GB+cZPfQd6dxtTXnf+RjZOV7T4EEXnvgzOcnp+eSTmpGk9d1S9sL6/lqrgSNn/s0HZA== + 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" + +micromark-extension-mdx-expression@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-1.0.3.tgz#cd3843573921bf55afcfff4ae0cd2e857a16dcfa" + integrity sha512-TjYtjEMszWze51NJCZmhv7MEBcgYRgb3tJeMAJ+HQCAaZHHRBaDCccqQzGizR/H4ODefP44wRTgOn2vE5I6nZA== + dependencies: + 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" + +micromark-extension-mdx-jsx@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-1.0.3.tgz#9f196be5f65eb09d2a49b237a7b3398bba2999be" + integrity sha512-VfA369RdqUISF0qGgv2FfV7gGjHDfn9+Qfiv5hEwpyr1xscRj/CiVRkU7rywGFCO7JwJ5L0e7CJz60lY52+qOA== + dependencies: + "@types/acorn" "^4.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" + +micromark-extension-mdx-md@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-mdx-md/-/micromark-extension-mdx-md-1.0.0.tgz#382f5df9ee3706dd120b51782a211f31f4760d22" + integrity sha512-xaRAMoSkKdqZXDAoSgp20Azm0aRQKGOl0RrS81yGu8Hr/JhMsBmfs4wR7m9kgVUIO36cMUQjNyiyDKPrsv8gOw== + dependencies: + micromark-util-types "^1.0.0" + +micromark-extension-mdxjs-esm@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-1.0.3.tgz#630d9dc9db2c2fd470cac8c1e7a824851267404d" + integrity sha512-2N13ol4KMoxb85rdDwTAC6uzs8lMX0zeqpcyx7FhS7PxXomOnLactu8WI8iBNXW8AVyea3KIJd/1CKnUmwrK9A== + dependencies: + 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" + +micromark-extension-mdxjs@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-extension-mdxjs/-/micromark-extension-mdxjs-1.0.0.tgz#772644e12fc8299a33e50f59c5aa15727f6689dd" + integrity sha512-TZZRZgeHvtgm+IhtgC2+uDMR7h8eTKF0QUX9YsgoL9+bADBpBY6SiLvWqnBlLbCEevITmTqmEuY3FoxMKVs1rQ== + 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" + +micromark-factory-destination@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-factory-destination/-/micromark-factory-destination-1.0.0.tgz#fef1cb59ad4997c496f887b6977aa3034a5a277e" + integrity sha512-eUBA7Rs1/xtTVun9TmV3gjfPz2wEwgK5R5xcbIM5ZYAtvGF6JkyaDsj0agx8urXnO31tEO6Ug83iVH3tdedLnw== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + +micromark-factory-label@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/micromark-factory-label/-/micromark-factory-label-1.0.2.tgz#6be2551fa8d13542fcbbac478258fb7a20047137" + integrity sha512-CTIwxlOnU7dEshXDQ+dsr2n+yxpP0+fn271pu0bwDIS8uqfFcumXpj5mLn3hSC8iw2MUr6Gx8EcKng1dD7i6hg== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" + +micromark-factory-mdx-expression@^1.0.0: + version "1.0.6" + resolved "https://registry.yarnpkg.com/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-1.0.6.tgz#917e17d16e6e9c2551f3a862e6a9ebdd22056476" + integrity sha512-WRQIc78FV7KrCfjsEf/sETopbYjElh3xAmNpLkd1ODPqxEngP42eVRGbiPEQWpRV27LzqW+XVTvQAMIIRLPnNA== + dependencies: + 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" + unist-util-position-from-estree "^1.0.0" + uvu "^0.5.0" + vfile-message "^3.0.0" + +micromark-factory-space@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-factory-space/-/micromark-factory-space-1.0.0.tgz#cebff49968f2b9616c0fcb239e96685cb9497633" + integrity sha512-qUmqs4kj9a5yBnk3JMLyjtWYN6Mzfcx8uJfi5XAveBniDevmZasdGBba5b4QsvRcAkmvGo5ACmSUmyGiKTLZew== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-types "^1.0.0" + +micromark-factory-title@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/micromark-factory-title/-/micromark-factory-title-1.0.2.tgz#7e09287c3748ff1693930f176e1c4a328382494f" + integrity sha512-zily+Nr4yFqgMGRKLpTVsNl5L4PMu485fGFDOQJQBl2NFpjGte1e86zC0da93wf97jrc4+2G2GQudFMHn3IX+A== + 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" + +micromark-factory-whitespace@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-factory-whitespace/-/micromark-factory-whitespace-1.0.0.tgz#e991e043ad376c1ba52f4e49858ce0794678621c" + integrity sha512-Qx7uEyahU1lt1RnsECBiuEbfr9INjQTGa6Err+gF3g0Tx4YEviPbqqGKNv/NrBaE7dVHdn1bVZKM/n5I/Bak7A== + 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" + +micromark-util-character@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-1.1.0.tgz#d97c54d5742a0d9611a68ca0cd4124331f264d86" + integrity sha512-agJ5B3unGNJ9rJvADMJ5ZiYjBRyDpzKAOk01Kpi1TKhlT1APx3XZk6eN7RtSz1erbWHC2L8T3xLZ81wdtGRZzg== + dependencies: + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + +micromark-util-chunked@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-chunked/-/micromark-util-chunked-1.0.0.tgz#5b40d83f3d53b84c4c6bce30ed4257e9a4c79d06" + integrity sha512-5e8xTis5tEZKgesfbQMKRCyzvffRRUX+lK/y+DvsMFdabAicPkkZV6gO+FEWi9RfuKKoxxPwNL+dFF0SMImc1g== + dependencies: + micromark-util-symbol "^1.0.0" + +micromark-util-classify-character@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-classify-character/-/micromark-util-classify-character-1.0.0.tgz#cbd7b447cb79ee6997dd274a46fc4eb806460a20" + integrity sha512-F8oW2KKrQRb3vS5ud5HIqBVkCqQi224Nm55o5wYLzY/9PwHGXC01tr3d7+TqHHz6zrKQ72Okwtvm/xQm6OVNZA== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + +micromark-util-combine-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.0.0.tgz#91418e1e74fb893e3628b8d496085639124ff3d5" + integrity sha512-J8H058vFBdo/6+AsjHp2NF7AJ02SZtWaVUjsayNFeAiydTxUwViQPxN0Hf8dp4FmCQi0UUFovFsEyRSUmFH3MA== + dependencies: + micromark-util-chunked "^1.0.0" + micromark-util-types "^1.0.0" + +micromark-util-decode-numeric-character-reference@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.0.0.tgz#dcc85f13b5bd93ff8d2868c3dba28039d490b946" + integrity sha512-OzO9AI5VUtrTD7KSdagf4MWgHMtET17Ua1fIpXTpuhclCqD8egFWo85GxSGvxgkGS74bEahvtM0WP0HjvV0e4w== + dependencies: + micromark-util-symbol "^1.0.0" + +micromark-util-decode-string@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/micromark-util-decode-string/-/micromark-util-decode-string-1.0.2.tgz#942252ab7a76dec2dbf089cc32505ee2bc3acf02" + integrity sha512-DLT5Ho02qr6QWVNYbRZ3RYOSSWWFuH3tJexd3dgN1odEuPNxCngTCXJum7+ViRAd9BbdxCvMToPOD/IvVhzG6Q== + 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" + +micromark-util-encode@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-encode/-/micromark-util-encode-1.0.1.tgz#2c1c22d3800870ad770ece5686ebca5920353383" + integrity sha512-U2s5YdnAYexjKDel31SVMPbfi+eF8y1U4pfiRW/Y8EFVCy/vgxk/2wWTxzcqE71LHtCuCzlBDRU2a5CQ5j+mQA== + +micromark-util-events-to-acorn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-1.2.0.tgz#65785cb77299d791bfefdc6a5213ab57ceead115" + integrity sha512-WWp3bf7xT9MppNuw3yPjpnOxa8cj5ACivEzXJKu0WwnjBYfzaBvIAT9KfeyI0Qkll+bfQtfftSwdgTH6QhTOKw== + dependencies: + "@types/acorn" "^4.0.0" + "@types/estree" "^1.0.0" + estree-util-visit "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" + vfile-location "^4.0.0" + vfile-message "^3.0.0" + +micromark-util-html-tag-name@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.1.0.tgz#eb227118befd51f48858e879b7a419fc0df20497" + integrity sha512-BKlClMmYROy9UiV03SwNmckkjn8QHVaWkqoAqzivabvdGcwNGMMMH/5szAnywmsTBUzDsU57/mFi0sp4BQO6dA== + +micromark-util-normalize-identifier@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.0.0.tgz#4a3539cb8db954bbec5203952bfe8cedadae7828" + integrity sha512-yg+zrL14bBTFrQ7n35CmByWUTFsgst5JhA4gJYoty4Dqzj4Z4Fr/DHekSS5aLfH9bdlfnSvKAWsAgJhIbogyBg== + dependencies: + micromark-util-symbol "^1.0.0" + +micromark-util-resolve-all@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/micromark-util-resolve-all/-/micromark-util-resolve-all-1.0.0.tgz#a7c363f49a0162e931960c44f3127ab58f031d88" + integrity sha512-CB/AGk98u50k42kvgaMM94wzBqozSzDDaonKU7P7jwQIuH2RU0TeBqGYJz2WY1UdihhjweivStrJ2JdkdEmcfw== + dependencies: + micromark-util-types "^1.0.0" + +micromark-util-sanitize-uri@^1.0.0, micromark-util-sanitize-uri@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.1.0.tgz#f12e07a85106b902645e0364feb07cf253a85aee" + integrity sha512-RoxtuSCX6sUNtxhbmsEFQfWzs8VN7cTctmBPvYivo98xb/kDEoTCtJQX5wyzIYEmk/lvNFTat4hL8oW0KndFpg== + dependencies: + micromark-util-character "^1.0.0" + micromark-util-encode "^1.0.0" + micromark-util-symbol "^1.0.0" + +micromark-util-subtokenize@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-1.0.2.tgz#ff6f1af6ac836f8bfdbf9b02f40431760ad89105" + integrity sha512-d90uqCnXp/cy4G881Ub4psE57Sf8YD0pim9QdjCRNjfas2M1u6Lbt+XZK9gnHL2XFhnozZiEdCa9CNfXSfQ6xA== + dependencies: + micromark-util-chunked "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" + +micromark-util-symbol@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-symbol/-/micromark-util-symbol-1.0.1.tgz#b90344db62042ce454f351cf0bebcc0a6da4920e" + integrity sha512-oKDEMK2u5qqAptasDAwWDXq0tG9AssVwAx3E9bBF3t/shRIGsWIRG+cGafs2p/SnDSOecnt6hZPCE2o6lHfFmQ== + +micromark-util-types@^1.0.0, micromark-util-types@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-1.0.2.tgz#f4220fdb319205812f99c40f8c87a9be83eded20" + integrity sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w== + +micromark@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/micromark/-/micromark-3.1.0.tgz#eeba0fe0ac1c9aaef675157b52c166f125e89f62" + integrity sha512-6Mj0yHLdUZjHnOPgr5xfWIMqMWS12zDN6iws9SLuSz76W8jTtAv24MN4/CL7gJrl5vtxGInkkqDv/JIoRsQOvA== + 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" + micromatch@^3.1.10: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -11407,6 +11909,11 @@ moment-mini@2.24.0: resolved "https://registry.yarnpkg.com/moment-mini/-/moment-mini-2.24.0.tgz#fa68d98f7fe93ae65bf1262f6abb5fb6983d8d18" integrity sha512-9ARkWHBs+6YJIvrIp0Ik5tyTTtP9PoV0Ssu2Ocq5y9v8+NOOpWiRshAp8c4rZVWTOe+157on/5G+zj5pwIQFEQ== +mri@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" + integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA== + mrmime@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.1.tgz#5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27" @@ -12233,6 +12740,20 @@ parse-entities@^2.0.0: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" +parse-entities@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-4.0.0.tgz#f67c856d4e3fe19b1a445c3fabe78dcdc1053eeb" + integrity sha512-5nk9Fn03x3rEhGaX1FU6IDwG/k+GxLXlFAkgrbM1asuAFl3BhdQWvASaIsmwWypRNcZKHPYnIuOSfIWEyEQnPQ== + dependencies: + "@types/unist" "^2.0.0" + character-entities "^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" + parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" @@ -12397,6 +12918,14 @@ pend@~1.2.0: resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== +periscopic@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/periscopic/-/periscopic-3.0.4.tgz#b3fbed0d1bc844976b977173ca2cd4a0ef4fa8d1" + integrity sha512-SFx68DxCv0Iyo6APZuw/AKewkkThGwssmU0QWtTlvov3VAtPX+QJ4CadwSaz8nrT5jPIuxdvJWB4PnD2KNDxQg== + dependencies: + estree-walker "^3.0.0" + is-reference "^3.0.0" + picocolors@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" @@ -12938,7 +13467,7 @@ prop-types@^15.0.0, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2, object-assign "^4.1.1" react-is "^16.13.1" -property-information@^5.0.0, property-information@^5.3.0, property-information@^5.5.0: +property-information@^5.0.0, property-information@^5.5.0: version "5.6.0" resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.6.0.tgz#61675545fb23002f245c6540ec46077d4da3ed69" integrity sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA== @@ -13662,17 +14191,12 @@ remark-emoji@^2.2.0: node-emoji "^1.10.0" unist-util-visit "^2.0.3" -remark-footnotes@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/remark-footnotes/-/remark-footnotes-2.0.0.tgz#9001c4c2ffebba55695d2dd80ffb8b82f7e6303f" - integrity sha512-3Clt8ZMH75Ayjp9q4CorNeyjwIxHFcTkaektplKGl2A1jNGEUey8cKL0ZC5vJwfcD5GFGsNLImLG/NGzWIzoMQ== - remark-math@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/remark-math/-/remark-math-3.0.1.tgz#85a02a15b15cad34b89a27244d4887b3a95185bb" integrity sha512-epT77R/HK0x7NqrWHdSV75uNLwn8g9qTyMqCRCDujL0vj/6T6+yhdrR7mjELWtkse+Fw02kijAaBuVcHBor1+Q== -remark-mdx@1.6.22, remark-mdx@^1.6.21: +remark-mdx@^1.6.21: version "1.6.22" resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-1.6.22.tgz#06a8dab07dcfdd57f3373af7f86bd0e992108bbd" integrity sha512-phMHBJgeV76uyFkH4rvzCftLfKCr2RZuF+/gmVcaKrpsihyzmhXjA0BEMDaPTXG5y8qZOKPVo83NAOX01LPnOQ== @@ -13686,6 +14210,14 @@ remark-mdx@1.6.22, remark-mdx@^1.6.21: remark-parse "8.0.3" unified "9.2.0" +remark-mdx@^2.0.0: + version "2.1.5" + resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-2.1.5.tgz#69b19ec42d30a289e0663c3fc7656ebdca0a8d8e" + integrity sha512-A8vw5s+BgOa968Irt8BO7DfWJTE0Fe7Ge3hX8zzDB1DnwMZTNdK6qF2IcFao+/7nzk1vSysKcFp+3ku4vhMpaQ== + dependencies: + mdast-util-mdx "^2.0.0" + micromark-extension-mdxjs "^1.0.0" + remark-parse@8.0.3, remark-parse@^8.0.0, remark-parse@^8.0.2: version "8.0.3" resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-8.0.3.tgz#9c62aa3b35b79a486454c690472906075f40c7e1" @@ -13708,6 +14240,25 @@ remark-parse@8.0.3, remark-parse@^8.0.0, remark-parse@^8.0.2: vfile-location "^3.0.0" xtend "^4.0.1" +remark-parse@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-10.0.1.tgz#6f60ae53edbf0cf38ea223fe643db64d112e0775" + integrity sha512-1fUyHr2jLsVOkhbvPRBJ5zTKZZyD6yZzYaWCS6BPBdQ8vEMBCH+9zNCDA6tET/zHCi/jLqjCWtlJZUPk+DbnFw== + dependencies: + "@types/mdast" "^3.0.0" + mdast-util-from-markdown "^1.0.0" + unified "^10.0.0" + +remark-rehype@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-10.1.0.tgz#32dc99d2034c27ecaf2e0150d22a6dcccd9a6279" + integrity sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw== + dependencies: + "@types/hast" "^2.0.0" + "@types/mdast" "^3.0.0" + mdast-util-to-hast "^12.1.0" + unified "^10.0.0" + remark-rehype@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-8.1.0.tgz#610509a043484c1e697437fa5eb3fd992617c945" @@ -13715,13 +14266,6 @@ remark-rehype@^8.1.0: dependencies: mdast-util-to-hast "^10.2.0" -remark-squeeze-paragraphs@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/remark-squeeze-paragraphs/-/remark-squeeze-paragraphs-4.0.0.tgz#76eb0e085295131c84748c8e43810159c5653ead" - integrity sha512-8qRqmL9F4nuLPIgl92XUuxI3pFxize+F1H0e/W3llTk0UsjJaj01+RrirkMw7P21RKe4X6goQhYRSvNWX+70Rw== - dependencies: - mdast-squeeze-paragraphs "^4.0.0" - remark-stringify@^8.0.0, remark-stringify@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-8.1.1.tgz#e2a9dc7a7bf44e46a155ec78996db896780d8ce5" @@ -13971,6 +14515,13 @@ rxjs@^7.5.4, rxjs@^7.5.5: dependencies: tslib "^2.1.0" +sade@^1.7.3: + version "1.8.1" + resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701" + integrity sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A== + dependencies: + mri "^1.1.0" + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -14505,7 +15056,7 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3: +source-map@^0.7.0, source-map@^0.7.3: version "0.7.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== @@ -14756,6 +15307,14 @@ stringify-entities@^3.0.0, stringify-entities@^3.0.1: character-entities-legacy "^1.0.0" xtend "^4.0.0" +stringify-entities@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-4.0.3.tgz#cfabd7039d22ad30f3cc435b0ca2c1574fc88ef8" + integrity sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g== + dependencies: + character-entities-html4 "^2.0.0" + character-entities-legacy "^3.0.0" + stringify-object@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" @@ -14840,7 +15399,7 @@ style-search@^0.1.0: resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902" integrity sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg== -style-to-object@0.3.0, style-to-object@^0.3.0: +style-to-object@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== @@ -15323,6 +15882,11 @@ treeverse@^2.0.0: resolved "https://registry.yarnpkg.com/treeverse/-/treeverse-2.0.0.tgz#036dcef04bc3fd79a9b79a68d4da03e882d8a9ca" integrity sha512-N5gJCkLu1aXccpOTtqV6ddSEi6ZmGkh3hjmbu1IjcavJK4qyOVQmi0myQKM7z5jVGmD68SJoliaVrMmVObhj6A== +trim-lines@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338" + integrity sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg== + trim-newlines@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" @@ -15611,11 +16175,18 @@ unique-string@^2.0.0: dependencies: crypto-random-string "^2.0.0" -unist-builder@2.0.3, unist-builder@^2.0.0, unist-builder@^2.0.3: +unist-builder@^2.0.0, unist-builder@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== +unist-builder@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-3.0.0.tgz#728baca4767c0e784e1e64bb44b5a5a753021a04" + integrity sha512-GFxmfEAa0vi9i5sd0R2kcrI9ks0r82NasRq5QHh2ysGngrc6GiqD5CDf1FjPenY4vApmFASBIIlk/jj5J5YbmQ== + dependencies: + "@types/unist" "^2.0.0" + unist-util-find-after@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/unist-util-find-after/-/unist-util-find-after-4.0.0.tgz#1101cebf5fed88ae3c6f3fa676e86fd5772a4f32" @@ -15629,6 +16200,11 @@ unist-util-generated@^1.0.0: resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b" integrity sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg== +unist-util-generated@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-2.0.0.tgz#86fafb77eb6ce9bfa6b663c3f5ad4f8e56a60113" + integrity sha512-TiWE6DVtVe7Ye2QxOVW9kqybs6cZexNwTwSMVgkfjEReqy/xwGpAXb99OxktoWwmL+Z+Epb0Dn8/GNDYP1wnUw== + unist-util-is@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797" @@ -15639,11 +16215,25 @@ unist-util-is@^5.0.0: resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-5.1.1.tgz#e8aece0b102fa9bc097b0fef8f870c496d4a6236" integrity sha512-F5CZ68eYzuSvJjGhCLPL3cYx45IxkqXSetCcRgUXtbcm50X2L9oOWQlfUfDdAf+6Pd27YDblBfdtmsThXmwpbQ== +unist-util-position-from-estree@^1.0.0, unist-util-position-from-estree@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unist-util-position-from-estree/-/unist-util-position-from-estree-1.1.1.tgz#96f4d543dfb0428edc01ebb928570b602d280c4c" + integrity sha512-xtoY50b5+7IH8tFbkw64gisG9tMSpxDjhX9TmaJJae/XuxQ9R/Kc8Nv1eOsf43Gt4KV/LkriMy9mptDr7XLcaw== + dependencies: + "@types/unist" "^2.0.0" + unist-util-position@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47" integrity sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA== +unist-util-position@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-4.0.3.tgz#5290547b014f6222dff95c48d5c3c13a88fadd07" + integrity sha512-p/5EMGIa1qwbXjA+QgcBXaPWjSnZfQ2Sc3yBEEfgPwsEmJd8Qh+DSk3LGnmOM4S1bY2C0AjmMnB8RuEYxpPwXQ== + dependencies: + "@types/unist" "^2.0.0" + unist-util-remove-position@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz#5d19ca79fdba712301999b2b73553ca8f3b352cc" @@ -15666,13 +16256,6 @@ unist-util-remove-position@^4.0.0: "@types/unist" "^2.0.0" unist-util-visit "^4.0.0" -unist-util-remove@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/unist-util-remove/-/unist-util-remove-2.1.0.tgz#b0b4738aa7ee445c402fda9328d604a02d010588" - integrity sha512-J8NYPyBm4baYLdCbjmf1bhPu45Cr1MWTm77qd9istEkzWpnN6O9tMsEbB2JhNnBCqGENRqEWomQ+He6au0B27Q== - dependencies: - unist-util-is "^4.0.0" - unist-util-stringify-position@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" @@ -15703,7 +16286,7 @@ unist-util-visit-parents@^5.1.1: "@types/unist" "^2.0.0" unist-util-is "^5.0.0" -unist-util-visit@2.0.3, unist-util-visit@^2.0.0, unist-util-visit@^2.0.3: +unist-util-visit@^2.0.0, unist-util-visit@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== @@ -15886,6 +16469,16 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +uvu@^0.5.0: + version "0.5.6" + resolved "https://registry.yarnpkg.com/uvu/-/uvu-0.5.6.tgz#2754ca20bcb0bb59b64e9985e84d2e81058502df" + integrity sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA== + dependencies: + dequal "^2.0.0" + diff "^5.0.0" + kleur "^4.0.3" + sade "^1.7.3" + v8-compile-cache@2.3.0, v8-compile-cache@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" @@ -16684,7 +17277,7 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -zwitch@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" - integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== +zwitch@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.2.tgz#91f8d0e901ffa3d66599756dde7f57b17c95dce1" + integrity sha512-JZxotl7SxAJH0j7dN4pxsTV6ZLXoLdGME+PsjkL/DaBrVryK9kTGq06GfKrwcSOqypP+fdXGoCHE36b99fWVoA== From 2c98f9186a3bcb71c5ff4380f53898d79ea0c516 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 3 Nov 2022 18:21:04 +0100 Subject: [PATCH 002/155] fix TOC? --- packages/docusaurus-mdx-loader/package.json | 1 + packages/docusaurus-mdx-loader/src/index.ts | 8 +- .../src/remark/toc/index.ts | 85 ++++++++++++++----- project-words.txt | 1 + yarn.lock | 7 ++ 5 files changed, 74 insertions(+), 28 deletions(-) diff --git a/packages/docusaurus-mdx-loader/package.json b/packages/docusaurus-mdx-loader/package.json index f58ea4d98487..f70b118ca69f 100644 --- a/packages/docusaurus-mdx-loader/package.json +++ b/packages/docusaurus-mdx-loader/package.json @@ -24,6 +24,7 @@ "@docusaurus/utils": "^3.0.0-alpha.0", "@mdx-js/mdx": "^2.1.5", "escape-html": "^1.0.3", + "estree-util-value-to-estree": "^1.3.0", "file-loader": "^6.2.0", "fs-extra": "^10.1.0", "image-size": "^1.0.2", diff --git a/packages/docusaurus-mdx-loader/src/index.ts b/packages/docusaurus-mdx-loader/src/index.ts index ad7887dcc77c..f242ebdcf3a0 100644 --- a/packages/docusaurus-mdx-loader/src/index.ts +++ b/packages/docusaurus-mdx-loader/src/index.ts @@ -7,13 +7,11 @@ import {mdxLoader} from './loader'; +import type {TOCItem as TOCItemImported} from './remark/toc'; + export default mdxLoader; -export type TOCItem = { - readonly value: string; - readonly id: string; - readonly level: number; -}; +export type TOCItem = TOCItemImported; export type LoadedMDXContent = { /** As verbatim declared in the MDX document. */ diff --git a/packages/docusaurus-mdx-loader/src/remark/toc/index.ts b/packages/docusaurus-mdx-loader/src/remark/toc/index.ts index 5e6c694dc339..1873da71e14c 100644 --- a/packages/docusaurus-mdx-loader/src/remark/toc/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/toc/index.ts @@ -10,26 +10,35 @@ import traverse from '@babel/traverse'; import stringifyObject from 'stringify-object'; import toString from 'mdast-util-to-string'; import visit from 'unist-util-visit'; +import {valueToEstree} from 'estree-util-value-to-estree'; // TODO upgrade to v2 ESM? import {toValue} from '../utils'; - import type {Identifier} from '@babel/types'; -import type {TOCItem} from '../..'; import type {Node, Parent} from 'unist'; import type {Heading, Literal} from 'mdast'; import type {Transformer} from 'unified'; +export type TOCItem = { + readonly value: string; + readonly id: string; + readonly level: number; +}; + const parseOptions: ParserOptions = { plugins: ['jsx'], sourceType: 'module', }; -const name = 'toc'; - -const isImport = (child: Node): child is Literal => child.type === 'import'; +const isImport = (child: any): child is Literal => + child.type === 'mdxjsEsm' && child.value.startsWith('import'); const hasImports = (index: number) => index > -1; -const isExport = (child: Node): child is Literal => child.type === 'export'; +const isExport = (child: any): child is Literal => + child.type === 'mdxjsEsm' && child.value.startsWith('export'); + +interface PluginOptions { + name?: string; +} -const isTarget = (child: Literal) => { +const isTarget = (child: Literal, name: string) => { let found = false; const ast = parse(child.value, parseOptions); traverse(ast, { @@ -42,24 +51,20 @@ const isTarget = (child: Literal) => { return found; }; -const getOrCreateExistingTargetIndex = (children: Node[]) => { +const getOrCreateExistingTargetIndex = (children: Node[], name: string) => { let importsIndex = -1; let targetIndex = -1; children.forEach((child, index) => { if (isImport(child)) { importsIndex = index; - } else if (isExport(child) && isTarget(child)) { + } else if (isExport(child) && isTarget(child, name)) { targetIndex = index; } }); if (targetIndex === -1) { - const target = { - default: false, - type: 'export', - value: `export const ${name} = [];`, - }; + const target = createExportNode(name, []); targetIndex = hasImports(importsIndex) ? importsIndex + 1 : 0; children.splice(targetIndex, 0, target); @@ -68,15 +73,17 @@ const getOrCreateExistingTargetIndex = (children: Node[]) => { return targetIndex; }; -export default function plugin(): Transformer { +export default function plugin(options: PluginOptions = {}): Transformer { + const name = options.name || 'toc'; + return (root) => { const headings: TOCItem[] = []; - visit(root, 'heading', (child: Heading, index, parent) => { + visit(root, 'heading', (child: Heading) => { const value = toString(child); - // depth: 1 headings are titles and not included in the TOC - if (parent !== root || !value || child.depth < 2) { + // depth:1 headings are titles and not included in the TOC + if (!value || child.depth < 2) { return; } @@ -87,12 +94,44 @@ export default function plugin(): Transformer { }); }); const {children} = root as Parent; - const targetIndex = getOrCreateExistingTargetIndex(children); + const targetIndex = getOrCreateExistingTargetIndex(children, name); - if (headings.length) { - children[targetIndex]!.value = `export const ${name} = ${stringifyObject( - headings, - )};`; + if (headings?.length) { + children[targetIndex] = createExportNode(name, headings); } }; } + +function createExportNode(name: string, object: any) { + return { + type: 'mdxjsEsm', + value: `export const ${name} = ${stringifyObject(object)}`, + data: { + estree: { + type: 'Program', + body: [ + { + type: 'ExportNamedDeclaration', + declaration: { + type: 'VariableDeclaration', + declarations: [ + { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name, + }, + init: valueToEstree(object), + }, + ], + kind: 'const', + }, + specifiers: [], + source: null, + }, + ], + sourceType: 'module', + }, + }, + }; +} diff --git a/project-words.txt b/project-words.txt index 254609dce57f..18e8604c30e7 100644 --- a/project-words.txt +++ b/project-words.txt @@ -177,6 +177,7 @@ mdast mdxa mdxast mdxhast +mdxjs metadatum metastring metrica diff --git a/yarn.lock b/yarn.lock index bf10d580d77e..3ed9c5b26edb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7823,6 +7823,13 @@ estree-util-to-js@^1.1.0: astring "^1.8.0" source-map "^0.7.0" +estree-util-value-to-estree@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/estree-util-value-to-estree/-/estree-util-value-to-estree-1.3.0.tgz#1d3125594b4d6680f666644491e7ac1745a3df49" + integrity sha512-Y+ughcF9jSUJvncXwqRageavjrNPAI+1M/L3BI3PyLp1nmgYTGUXU6t5z1Y7OWuThoDdhPME07bQU+d5LxdJqw== + dependencies: + is-plain-obj "^3.0.0" + estree-util-visit@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/estree-util-visit/-/estree-util-visit-1.2.0.tgz#aa0311a9c2f2aa56e9ae5e8b9d87eac14e4ec8f8" From 84544bd24ee4c18b5e5ea3f61bdff286f6fc2c85 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 3 Nov 2022 19:18:09 +0100 Subject: [PATCH 003/155] progress on mdx 2 upgrade, use dynamic imports for ESM packages site builds but no content :s --- packages/docusaurus-mdx-loader/package.json | 11 +- packages/docusaurus-mdx-loader/src/loader.ts | 6 +- .../src/remark/admonitions/index.ts | 2 +- .../src/remark/headings/index.ts | 7 +- .../src/remark/toc/__tests__/index.test.ts | 4 +- .../src/remark/toc/index.ts | 22 ++- .../transformImage/__tests__/index.test.ts | 4 +- .../transformLinks/__tests__/index.test.ts | 4 +- .../src/remark/transformLinks/index.ts | 8 +- .../__tests__/index.test.ts | 6 +- .../src/remark/utils/index.ts | 25 ++- yarn.lock | 176 ++++++++++++++++-- 12 files changed, 219 insertions(+), 56 deletions(-) diff --git a/packages/docusaurus-mdx-loader/package.json b/packages/docusaurus-mdx-loader/package.json index f70b118ca69f..eb345c77f2cf 100644 --- a/packages/docusaurus-mdx-loader/package.json +++ b/packages/docusaurus-mdx-loader/package.json @@ -24,11 +24,12 @@ "@docusaurus/utils": "^3.0.0-alpha.0", "@mdx-js/mdx": "^2.1.5", "escape-html": "^1.0.3", - "estree-util-value-to-estree": "^1.3.0", + "estree-util-value-to-estree": "^2.1.0", "file-loader": "^6.2.0", "fs-extra": "^10.1.0", "image-size": "^1.0.2", - "mdast-util-to-string": "^2.0.0", + "mdast-util-to-string": "^3.0.0", + "remark-gfm": "^1.0.0", "remark-emoji": "^2.2.0", "stringify-object": "^3.3.0", "tslib": "^2.4.0", @@ -45,12 +46,12 @@ "@types/stringify-object": "^3.3.1", "@types/unist": "^2.0.6", "rehype-stringify": "^8.0.0", - "remark": "^12.0.1", - "remark-mdx": "^1.6.21", + "remark": "^14.0.2", + "remark-mdx": "^2.1.5", "remark-rehype": "^8.1.0", "to-vfile": "^6.1.0", "unist-builder": "^2.0.3", - "unist-util-remove-position": "^3.0.0" + "unist-util-remove-position": "^2.0.0" }, "peerDependencies": { "react": "^16.8.4 || ^17.0.0", diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 29934cdc7f30..2312f76c53ce 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -14,6 +14,7 @@ import { getFileLoaderUtils, } from '@docusaurus/utils'; import emoji from 'remark-emoji'; + import stringifyObject from 'stringify-object'; import headings from './remark/headings'; @@ -26,6 +27,7 @@ import mermaid from './remark/mermaid'; // import transformAdmonitions from './remark/admonitions'; import type {MarkdownConfig} from '@docusaurus/types'; import type {LoaderContext} from 'webpack'; + import type {Processor, PluggableList} from 'unified'; import type {AdmonitionOptions} from './remark/admonitions'; @@ -45,7 +47,7 @@ const pragma = ` const DEFAULT_OPTIONS: MDXOptions = { admonitions: true, rehypePlugins: [], - // @ts-expect-error: todo + // @ts-expect-error: TODO remarkPlugins: [unwrapMdxCodeBlocks, emoji, headings, toc], beforeDefaultRemarkPlugins: [], beforeDefaultRehypePlugins: [], @@ -165,6 +167,7 @@ export async function mdxLoader( const reqOptions = this.getOptions(); const {createProcessor} = await import('@mdx-js/mdx'); + const gfm = await import('remark-gfm'); const {frontMatter, content: contentWithTitle} = parseFrontMatter(fileString); @@ -195,6 +198,7 @@ export async function mdxLoader( siteDir: reqOptions.siteDir, }, ], + gfm, ...(reqOptions.remarkPlugins ?? []), ]; diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts index 779ef71873d0..93dde68c9c73 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts @@ -162,7 +162,7 @@ const plugin: Plugin = function plugin( } // add tokenizer to parser after fenced code blocks - const Parser = this.Parser.prototype; + const Parser = this.Parser!.prototype; Parser.blockTokenizers.admonition = blockTokenizer; Parser.blockMethods.splice( Parser.blockMethods.indexOf('fencedCode') + 1, diff --git a/packages/docusaurus-mdx-loader/src/remark/headings/index.ts b/packages/docusaurus-mdx-loader/src/remark/headings/index.ts index 98aaa37f7552..e72954cbe0f6 100644 --- a/packages/docusaurus-mdx-loader/src/remark/headings/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/headings/index.ts @@ -9,12 +9,13 @@ import {parseMarkdownHeadingId, createSlugger} from '@docusaurus/utils'; import visit from 'unist-util-visit'; -import mdastToString from 'mdast-util-to-string'; import type {Transformer} from 'unified'; import type {Heading, Text} from 'mdast'; export default function plugin(): Transformer { - return (root) => { + return async (root) => { + const {toString} = await import('mdast-util-to-string'); + const slugs = createSlugger(); visit(root, 'heading', (headingNode: Heading) => { const data = headingNode.data ?? (headingNode.data = {}); @@ -29,7 +30,7 @@ export default function plugin(): Transformer { const headingTextNodes = headingNode.children.filter( ({type}) => !['html', 'jsx'].includes(type), ); - const heading = mdastToString( + const heading = toString( headingTextNodes.length > 0 ? headingTextNodes : headingNode, ); diff --git a/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/index.test.ts index 6df3e94e672b..004d4949fef4 100644 --- a/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/index.test.ts @@ -6,13 +6,13 @@ */ import path from 'path'; -import remark from 'remark'; -import mdx from 'remark-mdx'; import vfile from 'to-vfile'; import plugin from '../index'; import headings from '../../headings/index'; const processFixture = async (name: string) => { + const remark = (await import('remark')).default; + const mdx = (await import('remark-mdx')).default; const filePath = path.join(__dirname, '__fixtures__', `${name}.md`); const file = await vfile.read(filePath); const result = await remark() diff --git a/packages/docusaurus-mdx-loader/src/remark/toc/index.ts b/packages/docusaurus-mdx-loader/src/remark/toc/index.ts index 1873da71e14c..97681be2bd2a 100644 --- a/packages/docusaurus-mdx-loader/src/remark/toc/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/toc/index.ts @@ -8,9 +8,7 @@ import {parse, type ParserOptions} from '@babel/parser'; import traverse from '@babel/traverse'; import stringifyObject from 'stringify-object'; -import toString from 'mdast-util-to-string'; import visit from 'unist-util-visit'; -import {valueToEstree} from 'estree-util-value-to-estree'; // TODO upgrade to v2 ESM? import {toValue} from '../utils'; import type {Identifier} from '@babel/types'; import type {Node, Parent} from 'unist'; @@ -51,7 +49,10 @@ const isTarget = (child: Literal, name: string) => { return found; }; -const getOrCreateExistingTargetIndex = (children: Node[], name: string) => { +const getOrCreateExistingTargetIndex = async ( + children: Node[], + name: string, +) => { let importsIndex = -1; let targetIndex = -1; @@ -64,7 +65,7 @@ const getOrCreateExistingTargetIndex = (children: Node[], name: string) => { }); if (targetIndex === -1) { - const target = createExportNode(name, []); + const target = await createExportNode(name, []); targetIndex = hasImports(importsIndex) ? importsIndex + 1 : 0; children.splice(targetIndex, 0, target); @@ -76,7 +77,8 @@ const getOrCreateExistingTargetIndex = (children: Node[], name: string) => { export default function plugin(options: PluginOptions = {}): Transformer { const name = options.name || 'toc'; - return (root) => { + return async (root) => { + const {toString} = await import('mdast-util-to-string'); const headings: TOCItem[] = []; visit(root, 'heading', (child: Heading) => { @@ -88,21 +90,23 @@ export default function plugin(options: PluginOptions = {}): Transformer { } headings.push({ - value: toValue(child), + value: toValue(child, toString), id: child.data!.id as string, level: child.depth, }); }); const {children} = root as Parent; - const targetIndex = getOrCreateExistingTargetIndex(children, name); + const targetIndex = await getOrCreateExistingTargetIndex(children, name); if (headings?.length) { - children[targetIndex] = createExportNode(name, headings); + children[targetIndex] = await createExportNode(name, headings); } }; } -function createExportNode(name: string, object: any) { +async function createExportNode(name: string, object: any) { + const {valueToEstree} = await import('estree-util-value-to-estree'); + return { type: 'mdxjsEsm', value: `export const ${name} = ${stringifyObject(object)}`, diff --git a/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/index.test.ts index d25defc122e1..ce9779dabc48 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/index.test.ts @@ -7,8 +7,6 @@ import {jest} from '@jest/globals'; import path from 'path'; -import remark from 'remark'; -import mdx from 'remark-mdx'; import vfile from 'to-vfile'; import plugin, {type PluginOptions} from '../index'; import headings from '../../headings/index'; @@ -17,6 +15,8 @@ const processFixture = async ( name: string, options: Partial, ) => { + const remark = (await import('remark')).default; + const mdx = (await import('remark-mdx')).default; const filePath = path.join(__dirname, `__fixtures__/${name}.md`); const file = await vfile.read(filePath); const result = await remark() diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/index.test.ts index 181ddd4f7315..e960cc2c0c88 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/index.test.ts @@ -6,13 +6,13 @@ */ import path from 'path'; -import remark from 'remark'; -import mdx from 'remark-mdx'; import vfile from 'to-vfile'; import plugin from '..'; import transformImage, {type PluginOptions} from '../../transformImage'; const processFixture = async (name: string, options?: PluginOptions) => { + const remark = (await import('remark')).default; + const mdx = (await import('remark-mdx')).default; const siteDir = path.join(__dirname, `__fixtures__`); const staticDirs = [ path.join(siteDir, 'static'), diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts index 33602c0d26f4..55118f80d04e 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts @@ -40,11 +40,13 @@ type Target = [node: Link, index: number, parent: Parent]; /** * Transforms the link node to a JSX `` element with a `require()` call. */ -function toAssetRequireNode( +async function toAssetRequireNode( [node, index, parent]: Target, assetPath: string, filePath: string, ) { + const {toString} = await import('mdast-util-to-string'); + // require("assets/file.pdf") means requiring from a package called assets const relativeAssetPath = `./${posixPath( path.relative(path.dirname(filePath), assetPath), @@ -62,7 +64,7 @@ function toAssetRequireNode( }${inlineMarkdownLinkFileLoader}${ escapePath(relativeAssetPath) + search }').default${hash ? ` + '${hash}'` : ''}`; - const children = stringifyContent(node); + const children = stringifyContent(node, toString); const title = node.title ? ` title="${escapeHtml(node.title)}"` : ''; const jsxNode: Literal = { @@ -144,7 +146,7 @@ async function processLinkNode(target: Target, context: Context) { context, ); if (assetPath) { - toAssetRequireNode(target, assetPath, context.filePath); + await toAssetRequireNode(target, assetPath, context.filePath); } } diff --git a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/index.test.ts index 13fe031f5b84..32340947f565 100644 --- a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/index.test.ts @@ -6,18 +6,20 @@ */ import path from 'path'; -import remark from 'remark'; -import mdx from 'remark-mdx'; import vfile from 'to-vfile'; import plugin from '..'; const processFixture = async (name: string) => { + const remark = (await import('remark')).default; + const mdx = (await import('remark-mdx')).default; const file = await vfile.read(path.join(__dirname, '__fixtures__', name)); const result = await remark().use(mdx).use(plugin).process(file); return result.toString(); }; const processFixtureAST = async (name: string) => { + const remark = (await import('remark')).default; + const mdx = (await import('remark-mdx')).default; const file = await vfile.read(path.join(__dirname, '__fixtures__', name)); return remark().use(mdx).use(plugin).parse(file); }; diff --git a/packages/docusaurus-mdx-loader/src/remark/utils/index.ts b/packages/docusaurus-mdx-loader/src/remark/utils/index.ts index 3bf275085bf5..d15d445425dd 100644 --- a/packages/docusaurus-mdx-loader/src/remark/utils/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/utils/index.ts @@ -6,30 +6,37 @@ */ import escapeHtml from 'escape-html'; -import toString from 'mdast-util-to-string'; import type {Parent} from 'unist'; import type {PhrasingContent, Heading} from 'mdast'; -export function stringifyContent(node: Parent): string { - return (node.children as PhrasingContent[]).map(toValue).join(''); +export function stringifyContent( + node: Parent, + toString: (param: unknown) => string, // TODO weird but works): string { +): string { + return (node.children as PhrasingContent[]) + .map((item) => toValue(item, toString)) + .join(''); } -export function toValue(node: PhrasingContent | Heading): string { +export function toValue( + node: PhrasingContent | Heading, + toString: (param: unknown) => string, // TODO weird but works +): string { switch (node.type) { case 'text': return escapeHtml(node.value); case 'heading': - return stringifyContent(node); + return stringifyContent(node, toString); case 'inlineCode': return `${escapeHtml(node.value)}`; case 'emphasis': - return `${stringifyContent(node)}`; + return `${stringifyContent(node, toString)}`; case 'strong': - return `${stringifyContent(node)}`; + return `${stringifyContent(node, toString)}`; case 'delete': - return `${stringifyContent(node)}`; + return `${stringifyContent(node, toString)}`; case 'link': - return stringifyContent(node); + return stringifyContent(node, toString); default: return toString(node); } diff --git a/yarn.lock b/yarn.lock index 3ed9c5b26edb..ff24461427a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7823,12 +7823,13 @@ estree-util-to-js@^1.1.0: astring "^1.8.0" source-map "^0.7.0" -estree-util-value-to-estree@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/estree-util-value-to-estree/-/estree-util-value-to-estree-1.3.0.tgz#1d3125594b4d6680f666644491e7ac1745a3df49" - integrity sha512-Y+ughcF9jSUJvncXwqRageavjrNPAI+1M/L3BI3PyLp1nmgYTGUXU6t5z1Y7OWuThoDdhPME07bQU+d5LxdJqw== +estree-util-value-to-estree@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/estree-util-value-to-estree/-/estree-util-value-to-estree-2.1.0.tgz#a10cdb500ee002bec36e13f2cd8c7838e6347dbe" + integrity sha512-fcAWmZilY1+tEt7GSeLZoHDvp2NNgLkJznBRYkEpaholas41d+Y0zd/Acch7+qzZdxLtxLi+m04KjHFJSoMa6A== dependencies: - is-plain-obj "^3.0.0" + "@types/estree" "^1.0.0" + is-plain-obj "^4.0.0" estree-util-visit@^1.0.0: version "1.2.0" @@ -10956,7 +10957,7 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" -longest-streak@^2.0.1: +longest-streak@^2.0.0, longest-streak@^2.0.1: version "2.0.4" resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4" integrity sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg== @@ -11142,6 +11143,15 @@ mdast-util-definitions@^5.0.0: "@types/unist" "^2.0.0" unist-util-visit "^4.0.0" +mdast-util-find-and-replace@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-1.1.1.tgz#b7db1e873f96f66588c321f1363069abf607d1b5" + integrity sha512-9cKl33Y21lyckGzpSmEQnIDjEfeeWelN5s1kUW1LwdB0Fkuq2u+4GdqcGEygYxJE8GVqCl0741bYXHgamfWAZA== + dependencies: + escape-string-regexp "^4.0.0" + unist-util-is "^4.0.0" + unist-util-visit-parents "^3.0.0" + mdast-util-from-markdown@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-1.2.0.tgz#84df2924ccc6c995dec1e2368b2b208ad0a76268" @@ -11160,6 +11170,48 @@ mdast-util-from-markdown@^1.0.0: unist-util-stringify-position "^3.0.0" uvu "^0.5.0" +mdast-util-gfm-autolink-literal@^0.1.0: + version "0.1.3" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.3.tgz#9c4ff399c5ddd2ece40bd3b13e5447d84e385fb7" + integrity sha512-GjmLjWrXg1wqMIO9+ZsRik/s7PLwTaeCHVB7vRxUwLntZc8mzmTsLVr6HW1yLokcnhfURsn5zmSVdi3/xWWu1A== + dependencies: + ccount "^1.0.0" + mdast-util-find-and-replace "^1.1.0" + micromark "^2.11.3" + +mdast-util-gfm-strikethrough@^0.2.0: + version "0.2.3" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.3.tgz#45eea337b7fff0755a291844fbea79996c322890" + integrity sha512-5OQLXpt6qdbttcDG/UxYY7Yjj3e8P7X16LzvpX8pIQPYJ/C2Z1qFGMmcw+1PZMUM3Z8wt8NRfYTvCni93mgsgA== + dependencies: + mdast-util-to-markdown "^0.6.0" + +mdast-util-gfm-table@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.6.tgz#af05aeadc8e5ee004eeddfb324b2ad8c029b6ecf" + integrity sha512-j4yDxQ66AJSBwGkbpFEp9uG/LS1tZV3P33fN1gkyRB2LoRL+RR3f76m0HPHaby6F4Z5xr9Fv1URmATlRRUIpRQ== + dependencies: + markdown-table "^2.0.0" + mdast-util-to-markdown "~0.6.0" + +mdast-util-gfm-task-list-item@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.6.tgz#70c885e6b9f543ddd7e6b41f9703ee55b084af10" + integrity sha512-/d51FFIfPsSmCIRNp7E6pozM9z1GYPIkSy1urQ8s/o4TC22BZ7DqfHFWiqBD23bc7J3vV1Fc9O4QIHBlfuit8A== + dependencies: + mdast-util-to-markdown "~0.6.0" + +mdast-util-gfm@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-0.1.2.tgz#8ecddafe57d266540f6881f5c57ff19725bd351c" + integrity sha512-NNkhDx/qYcuOWB7xHUGWZYVXvjPFFd6afg6/e2g+SV4r9q5XUcCbV4Wfa3DLYIiD+xAEZc6K4MGaE/m0KDcPwQ== + dependencies: + mdast-util-gfm-autolink-literal "^0.1.0" + mdast-util-gfm-strikethrough "^0.2.0" + mdast-util-gfm-table "^0.1.0" + mdast-util-gfm-task-list-item "^0.1.0" + mdast-util-to-markdown "^0.6.1" + mdast-util-mdx-expression@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/mdast-util-mdx-expression/-/mdast-util-mdx-expression-1.3.1.tgz#2224cf0b5b150093704a3c225bd529d2de21f50f" @@ -11236,6 +11288,18 @@ mdast-util-to-hast@^12.1.0: unist-util-position "^4.0.0" unist-util-visit "^4.0.0" +mdast-util-to-markdown@^0.6.0, mdast-util-to-markdown@^0.6.1, mdast-util-to-markdown@~0.6.0: + version "0.6.5" + resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz#b33f67ca820d69e6cc527a93d4039249b504bebe" + integrity sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ== + dependencies: + "@types/unist" "^2.0.0" + longest-streak "^2.0.0" + mdast-util-to-string "^2.0.0" + parse-entities "^2.0.0" + repeat-string "^1.0.0" + zwitch "^1.0.0" + mdast-util-to-markdown@^1.0.0, mdast-util-to-markdown@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-1.3.0.tgz#38b6cdc8dc417de642a469c4fc2abdf8c931bd1e" @@ -11378,6 +11442,51 @@ micromark-core-commonmark@^1.0.0, micromark-core-commonmark@^1.0.1: micromark-util-types "^1.0.1" uvu "^0.5.0" +micromark-extension-gfm-autolink-literal@~0.5.0: + version "0.5.7" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.7.tgz#53866c1f0c7ef940ae7ca1f72c6faef8fed9f204" + integrity sha512-ePiDGH0/lhcngCe8FtH4ARFoxKTUelMp4L7Gg2pujYD5CSMb9PbblnyL+AAMud/SNMyusbS2XDSiPIRcQoNFAw== + dependencies: + micromark "~2.11.3" + +micromark-extension-gfm-strikethrough@~0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.5.tgz#96cb83356ff87bf31670eefb7ad7bba73e6514d1" + integrity sha512-PpOKlgokpQRwUesRwWEp+fHjGGkZEejj83k9gU5iXCbDG+XBA92BqnRKYJdfqfkrRcZRgGuPuXb7DaK/DmxOhw== + dependencies: + micromark "~2.11.0" + +micromark-extension-gfm-table@~0.4.0: + version "0.4.3" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.3.tgz#4d49f1ce0ca84996c853880b9446698947f1802b" + integrity sha512-hVGvESPq0fk6ALWtomcwmgLvH8ZSVpcPjzi0AjPclB9FsVRgMtGZkUcpE0zgjOCFAznKepF4z3hX8z6e3HODdA== + dependencies: + micromark "~2.11.0" + +micromark-extension-gfm-tagfilter@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-0.3.0.tgz#d9f26a65adee984c9ccdd7e182220493562841ad" + integrity sha512-9GU0xBatryXifL//FJH+tAZ6i240xQuFrSL7mYi8f4oZSbc+NvXjkrHemeYP0+L4ZUT+Ptz3b95zhUZnMtoi/Q== + +micromark-extension-gfm-task-list-item@~0.3.0: + version "0.3.3" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.3.tgz#d90c755f2533ed55a718129cee11257f136283b8" + integrity sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ== + dependencies: + micromark "~2.11.0" + +micromark-extension-gfm@^0.3.0: + version "0.3.3" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-0.3.3.tgz#36d1a4c089ca8bdfd978c9bd2bf1a0cb24e2acfe" + integrity sha512-oVN4zv5/tAIA+l3GbMi7lWeYpJ14oQyJ3uEim20ktYFAcfX1x3LNlFGGlmrZHt7u9YlKExmyJdDGaTt6cMSR/A== + dependencies: + micromark "~2.11.0" + micromark-extension-gfm-autolink-literal "~0.5.0" + micromark-extension-gfm-strikethrough "~0.6.5" + micromark-extension-gfm-table "~0.4.0" + micromark-extension-gfm-tagfilter "~0.3.0" + micromark-extension-gfm-task-list-item "~0.3.0" + micromark-extension-mdx-expression@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-1.0.3.tgz#cd3843573921bf55afcfff4ae0cd2e857a16dcfa" @@ -11618,6 +11727,14 @@ micromark-util-types@^1.0.0, micromark-util-types@^1.0.1: resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-1.0.2.tgz#f4220fdb319205812f99c40f8c87a9be83eded20" integrity sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w== +micromark@^2.11.3, micromark@~2.11.0, micromark@~2.11.3: + version "2.11.4" + resolved "https://registry.yarnpkg.com/micromark/-/micromark-2.11.4.tgz#d13436138eea826383e822449c9a5c50ee44665a" + integrity sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA== + dependencies: + debug "^4.0.0" + parse-entities "^2.0.0" + micromark@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/micromark/-/micromark-3.1.0.tgz#eeba0fe0ac1c9aaef675157b52c166f125e89f62" @@ -14198,6 +14315,14 @@ remark-emoji@^2.2.0: node-emoji "^1.10.0" unist-util-visit "^2.0.3" +remark-gfm@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-1.0.0.tgz#9213643001be3f277da6256464d56fd28c3b3c0d" + integrity sha512-KfexHJCiqvrdBZVbQ6RopMZGwaXz6wFJEfByIuEwGf0arvITHjiKKZ1dpXujjH9KZdm1//XJQwgfnJ3lmXaDPA== + dependencies: + mdast-util-gfm "^0.1.0" + micromark-extension-gfm "^0.3.0" + remark-math@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/remark-math/-/remark-math-3.0.1.tgz#85a02a15b15cad34b89a27244d4887b3a95185bb" @@ -14217,7 +14342,7 @@ remark-mdx@^1.6.21: remark-parse "8.0.3" unified "9.2.0" -remark-mdx@^2.0.0: +remark-mdx@^2.0.0, remark-mdx@^2.1.5: version "2.1.5" resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-2.1.5.tgz#69b19ec42d30a289e0663c3fc7656ebdca0a8d8e" integrity sha512-A8vw5s+BgOa968Irt8BO7DfWJTE0Fe7Ge3hX8zzDB1DnwMZTNdK6qF2IcFao+/7nzk1vSysKcFp+3ku4vhMpaQ== @@ -14273,6 +14398,15 @@ remark-rehype@^8.1.0: dependencies: mdast-util-to-hast "^10.2.0" +remark-stringify@^10.0.0: + version "10.0.2" + resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-10.0.2.tgz#50414a6983f5008eb9e72eed05f980582d1f69d7" + integrity sha512-6wV3pvbPvHkbNnWB0wdDvVFHOe1hBRAx1Q/5g/EpH4RppAII6J8Gnwe7VbHuXaoKIF6LAg6ExTel/+kNqSQ7lw== + dependencies: + "@types/mdast" "^3.0.0" + mdast-util-to-markdown "^1.0.0" + unified "^10.0.0" + remark-stringify@^8.0.0, remark-stringify@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-8.1.1.tgz#e2a9dc7a7bf44e46a155ec78996db896780d8ce5" @@ -14302,6 +14436,16 @@ remark@^12.0.1: remark-stringify "^8.0.0" unified "^9.0.0" +remark@^14.0.2: + version "14.0.2" + resolved "https://registry.yarnpkg.com/remark/-/remark-14.0.2.tgz#4a1833f7441a5c29e44b37bb1843fb820797b40f" + integrity sha512-A3ARm2V4BgiRXaUo5K0dRvJ1lbogrbXnhkJRmD0yw092/Yl0kOCZt1k9ZeElEwkZsWGsMumz6qL5MfNJH9nOBA== + dependencies: + "@types/mdast" "^3.0.0" + remark-parse "^10.0.0" + remark-stringify "^10.0.0" + unified "^10.0.0" + renderkid@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-3.0.0.tgz#5fd823e4d6951d37358ecc9a58b1f06836b6268a" @@ -16248,13 +16392,6 @@ unist-util-remove-position@^2.0.0: dependencies: unist-util-visit "^2.0.0" -unist-util-remove-position@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-3.0.0.tgz#4cd19e82c8e665f462b6acfcfd0a8353235a88e9" - integrity sha512-17kIOuolVuK16LMb9KyMJlqdfCtlfQY5FjY3Sdo9iC7F5wqdXhNjMq0PBvMpkVNNnAmHxXssUW+rZ9T2zbP0Rg== - dependencies: - unist-util-visit "^2.0.0" - unist-util-remove-position@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-4.0.1.tgz#d5b46a7304ac114c8d91990ece085ca7c2c135c8" @@ -16572,9 +16709,9 @@ vfile@^4.0.0: vfile-message "^2.0.0" vfile@^5.0.0: - version "5.3.4" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-5.3.4.tgz#bbb8c96b956693bbf70b2c67fdb5781dff769b93" - integrity sha512-KI+7cnst03KbEyN1+JE504zF5bJBZa+J+CrevLeyIMq0aPU681I2rQ5p4PlnQ6exFtWiUrg26QUdFMnAKR6PIw== + version "5.3.5" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-5.3.5.tgz#ec2e206b1414f561c85b7972bb1eeda8ab47ee61" + integrity sha512-U1ho2ga33eZ8y8pkbQLH54uKqGhFJ6GYIHnnG5AhRpAh3OWjkrRHKa/KogbmQn8We+c0KVV3rTOgR9V/WowbXQ== dependencies: "@types/unist" "^2.0.0" is-buffer "^2.0.0" @@ -17284,6 +17421,11 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== +zwitch@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" + integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== + zwitch@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.2.tgz#91f8d0e901ffa3d66599756dde7f57b17c95dce1" From 64f51022487389bd5d99a86075e301fc8ba6d65b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 4 Nov 2022 10:17:23 +0100 Subject: [PATCH 004/155] make subset of the site build with MDX 2 --- .eslintrc.js | 3 +- packages/docusaurus-mdx-loader/package.json | 2 +- packages/docusaurus-mdx-loader/src/loader.ts | 19 +- website/community/0-support.md | 8 +- website/community/1-team.mdx | 8 +- website/community/2-resources.md | 16 +- website/community/4-canary.md | 4 + website/community/5-release-process.md | 20 +- website/docusaurus.config.js | 34 ++- website/src/pages/versions.tsx | 12 + yarn.lock | 255 +++++++++++-------- 11 files changed, 233 insertions(+), 148 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index c76cc234dc9f..8f9fc0f7bedf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -372,7 +372,8 @@ module.exports = { // We don't provide any escape hatches for this rule. Rest siblings and // function placeholder params are always ignored, and any other unused // locals must be justified with a disable comment. - '@typescript-eslint/no-unused-vars': [ERROR, {ignoreRestSiblings: true}], + // TODO revert to error + add varsIgnorePattern _ prefix + '@typescript-eslint/no-unused-vars': [WARNING, {ignoreRestSiblings: true}], '@typescript-eslint/prefer-optional-chain': ERROR, '@docusaurus/no-untranslated-text': [ WARNING, diff --git a/packages/docusaurus-mdx-loader/package.json b/packages/docusaurus-mdx-loader/package.json index eb345c77f2cf..a26963b75814 100644 --- a/packages/docusaurus-mdx-loader/package.json +++ b/packages/docusaurus-mdx-loader/package.json @@ -29,7 +29,7 @@ "fs-extra": "^10.1.0", "image-size": "^1.0.2", "mdast-util-to-string": "^3.0.0", - "remark-gfm": "^1.0.0", + "remark-gfm": "^3.0.1", "remark-emoji": "^2.2.0", "stringify-object": "^3.3.0", "tslib": "^2.4.0", diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 2312f76c53ce..84addfd3f3f6 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -166,7 +166,7 @@ export async function mdxLoader( const filePath = this.resourcePath; const reqOptions = this.getOptions(); - const {createProcessor} = await import('@mdx-js/mdx'); + const {createProcessor, compile} = await import('@mdx-js/mdx'); const gfm = await import('remark-gfm'); const {frontMatter, content: contentWithTitle} = parseFrontMatter(fileString); @@ -213,6 +213,8 @@ export async function mdxLoader( ...reqOptions, remarkPlugins, rehypePlugins, + format: 'mdx', + providerImportSource: '@mdx-js/react', }; // @ts-expect-error: TODO @@ -225,12 +227,21 @@ export async function mdxLoader( try { result = await compiler .process({ - contents: content, - path: this.resourcePath, + value: content, + path: filePath, }) .then((res) => res.toString()); } catch (err) { - return callback(err as Error); + return callback( + new Error( + `MDX compilation failed for file ${filePath}\n${ + (err as Error).message + }`, + { + cause: err as Error, + }, + ), + ); } // MDX partials are MDX files starting with _ or in a folder starting with _ diff --git a/website/community/0-support.md b/website/community/0-support.md index fcfa72185292..7cd91a965e40 100644 --- a/website/community/0-support.md +++ b/website/community/0-support.md @@ -6,11 +6,11 @@ On this page we've listed some Docusaurus-related communities that you can be a Before participating in Docusaurus' communities, [please read our Code of Conduct](https://engineering.fb.com/codeofconduct/). We have adopted the [Contributor Covenant](https://www.contributor-covenant.org/) and we expect that all community members adhere to the guidelines within. -## Stack Overflow {#stack-overflow} +## Stack Overflow \{#stack-overflow} Stack Overflow is a popular forum to ask code-level questions or if you're stuck with a specific error. Read through the [existing questions](https://stackoverflow.com/questions/tagged/docusaurus) tagged with **docusaurus** or [ask your own](https://stackoverflow.com/questions/ask?tags=docusaurus)! -## Discussion forums {#discussion-forums} +## Discussion forums \{#discussion-forums} There are many online forums for discussion about best practices and application architecture as well as the future of Docusaurus. If you have an answerable code-level question, Stack Overflow is usually a better fit. @@ -19,10 +19,10 @@ There are many online forums for discussion about best practices and application - [#contributors](https://discord.gg/6g6ASPA) for contributing help - [Reddit's Docusaurus community](https://www.reddit.com/r/docusaurus/) -## Feature requests {#feature-requests} +## Feature requests \{#feature-requests} For new feature requests, you can create a post on our [feature requests board (Canny)](/feature-requests), which is a handy tool for road-mapping and allows for sorting by upvotes, which gives the core team a better indicator of what features are in high demand, as compared to GitHub issues which are harder to triage. Refrain from making a Pull Request for new features (especially large ones) as someone might already be working on it or will be part of our roadmap. Talk to us first! -## News {#news} +## News \{#news} For the latest news about Docusaurus, [follow **@docusaurus** on Twitter](https://twitter.com/docusaurus) and the [official Docusaurus blog](/blog) on this website. diff --git a/website/community/1-team.mdx b/website/community/1-team.mdx index 98bf339e27c2..26726899a839 100644 --- a/website/community/1-team.mdx +++ b/website/community/1-team.mdx @@ -6,7 +6,7 @@ import { StudentFellowsTeamRow, } from '@site/src/components/TeamProfileCards'; -## Active Team {#active-team} +## Active Team \{#active-team} The Docusaurus team works on the core functionality, plugins for the classic theme, as well as the Docusaurus documentation website. @@ -14,19 +14,19 @@ Current members of the Docusaurus team are listed in alphabetical order below. -## Honorary Alumni {#honorary-alumni} +## Honorary Alumni \{#honorary-alumni} Docusaurus would never be what it is today without the huge contributions from these folks who have moved on to bigger and greater things. -## Student Fellows {#student-fellows} +## Student Fellows \{#student-fellows} A handful of students have also worked on Docusaurus as part of their school term/internship and the [Major League Hacking Fellowship program](https://fellowship.mlh.io/), contributing amazing features such as plugin options validation, migration tooling, and a Bootstrap theme. -## Acknowledgements {#acknowledgements} +## Acknowledgements \{#acknowledgements} Docusaurus was originally created by Joel Marcey. Today, Docusaurus has a few hundred open source contributors. We’d like to recognize a few people who have made significant contributions to Docusaurus and its documentation in the past and have helped maintain them over the years: diff --git a/website/community/2-resources.md b/website/community/2-resources.md index 10d354017431..62b818e93f34 100644 --- a/website/community/2-resources.md +++ b/website/community/2-resources.md @@ -2,22 +2,22 @@ A curated list of interesting Docusaurus community projects. -## Videos {#videos} +## Videos \{#videos} - [F8 2019: Using Docusaurus to Create Open Source Websites](https://www.youtube.com/watch?v=QcGJsf6mgZE) -## Articles {#articles} +## Articles \{#articles} - [Awesome Docusaurus](https://github.com/webbertakken/awesome-docusaurus#readme) - Community curated list of Docusaurus resources. - [Live code editing in Docusaurus](https://dev.to/mrmuhammadali/live-code-editing-in-docusaurus-ux-at-its-best-2hj1) -## Showcase {#showcase} +## Showcase \{#showcase} See the showcase. -## Community plugins {#community-plugins} +## Community plugins \{#community-plugins} -### Search {#search} +### Search \{#search} - [docusaurus-plugin-lunr](https://github.com/daldridge/docusaurus-plugin-lunr) - Docusaurus v2 plugin to create a local search index for use with Lunr.js - [docusaurus-lunr-search](https://github.com/lelouch77/docusaurus-lunr-search) - Offline Search for Docusaurus v2 @@ -25,14 +25,14 @@ See the showcase - [@easyops-cn/docusaurus-search-local](https://github.com/easyops-cn/docusaurus-search-local) - Offline/local search for Docusaurus v2 (language of zh supported) - [docusaurus-theme-search-typesense](https://github.com/typesense/docusaurus-theme-search-typesense) - Docusaurus v2 plugin for [Typesense DocSearch](https://typesense.org/docs/latest/guide/docsearch.html). -### Integrations {#integrations} +### Integrations \{#integrations} - [docusaurus2-dotenv](https://github.com/jonnynabors/docusaurus2-dotenv) - A Docusaurus 2 plugin that supports dotenv and other environment variables - [posthog-docusaurus](https://github.com/PostHog/posthog-docusaurus) - Integrate [PostHog](https://posthog.com/) product analytics with Docusaurus v2 - [docusaurus-plugin-moesif](https://github.com/Moesif/docusaurus-plugin-moesif) - Adds [Moesif API Analytics](https://www.moesif.com/) to track user behavior and pinpoint where developers drop off in your activation funnel. - [docusaurus-plugin-yandex-metrica](https://github.com/sgromkov/docusaurus-plugin-yandex-metrica) - Adds [Yandex Metrika](https://metrika.yandex.ru/) counter for evaluating site traffic and analyzing user behavior. -### Features {#features} +### Features \{#features} - [docusaurus-theme-github-codeblock](https://github.com/saucelabs/docusaurus-theme-github-codeblock). A Docusaurus v2 plugin that supports referencing code examples from public GitHub repositories - [mr-pdf](https://github.com/kohheepeace/mr-pdf) - Generate documentation into PDF format, suitable for Docusaurus v1 and v2 (including beta versions) @@ -50,7 +50,7 @@ See the showcase - [docusaurus-openapi-docs](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs) - A Docusaurus v2 plugin and theme for generating interactive OpenAPI docs - [docusaurus-post-generator](https://github.com/moojing/docusaurus-post-generator) - A command line tool for user to add a blog/doc file quickly by command like `yarn gen-post new [template] [post_name]`. -## Enterprise usage {#enterprise-usage} +## Enterprise usage \{#enterprise-usage} - Facebook - Google diff --git a/website/community/4-canary.md b/website/community/4-canary.md index ae866c4d334e..24ffb2b3ffd0 100644 --- a/website/community/4-canary.md +++ b/website/community/4-canary.md @@ -1,3 +1,7 @@ +--- +draft: true +--- + # Canary releases ```mdx-code-block diff --git a/website/community/5-release-process.md b/website/community/5-release-process.md index 4c76f0e563da..267dfed877e7 100644 --- a/website/community/5-release-process.md +++ b/website/community/5-release-process.md @@ -8,7 +8,7 @@ This topic is particularly important for highly customized sites that may have d ::: -## Semantic versioning {#semantic-versioning} +## Semantic versioning \{#semantic-versioning} Docusaurus versioning is based on the `major.minor.patch` scheme and respects [Semantic Versioning](https://semver.org/). @@ -27,7 +27,7 @@ Releasing Docusaurus 2.0 took a very long time. From now on, Docusaurus will **r ::: -### Major versions {#major-versions} +### Major versions \{#major-versions} The `major` version number is incremented on **every breaking change**. @@ -42,7 +42,7 @@ Read our [public API surface](#public-api-surface) section to clearly understand ::: -### Minor versions {#minor-versions} +### Minor versions \{#minor-versions} The `minor` version number is incremented on every significant retro-compatible change. @@ -57,7 +57,7 @@ If you only use our [public API surface](#public-api-surface), you should be abl ::: -### Patch versions {#patch-versions} +### Patch versions \{#patch-versions} The `patch` version number is incremented on bugfixes releases. @@ -65,7 +65,7 @@ Whenever a new patch version is released, we publish: - an exhaustive changelog entry -## Versions {#versions} +## Versions \{#versions} ```mdx-code-block import { @@ -87,7 +87,7 @@ The branch is created just before releasing the first v ::: -### Stable version {#stable-version} +### Stable version \{#stable-version} The stable version (v, on ) is recommended for most Docusaurus users. @@ -101,7 +101,7 @@ It is recommended to upgrade within that time frame to the new stable version. ::: -### Next version {#next-version} +### Next version \{#next-version} The next version (v, on ) is the version the Docusaurus team is currently working on. @@ -129,7 +129,7 @@ At the `beta` and `rc` (release candidate) phases, we avoid introducing major br ::: -## Public API surface {#public-api-surface} +## Public API surface \{#public-api-surface} Docusaurus commits to respecting Semantic Versioning. This means that whenever changes occur in Docusaurus public APIs and break backward compatibility, we will increment the `major` version number. @@ -141,7 +141,7 @@ Docusaurus guarantees public API retro-compatibility across `minor` versions. Un We will outline what accounts as the public API surface. -### Core public API {#core-public-api} +### Core public API \{#core-public-api} ✅ Our public API includes: @@ -164,7 +164,7 @@ For non-theme APIs, any documented API is considered public (and will be stable) An API being "stable" means if you increment the patch or minor version of your Docusaurus installation without any other change, running `docusaurus start` or `docusaurus build` should not throw an error. -### Theming public API {#theming-public-api} +### Theming public API \{#theming-public-api} Docusaurus has a very flexible theming system: diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 6e00175fb995..cd090b361d49 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -115,7 +115,7 @@ const config = { markdown: { mermaid: true, }, - onBrokenLinks: 'throw', + onBrokenLinks: 'warn', onBrokenMarkdownLinks: 'warn', favicon: 'img/docusaurus.ico', customFields: { @@ -132,6 +132,7 @@ const config = { ], themes: ['live-codeblock', ...dogfoodingThemeInstances], plugins: [ + /* [ require.resolve('./src/plugins/changelog/index.js'), { @@ -155,6 +156,8 @@ const config = { }, }, ], + + */ [ 'content-docs', /** @type {import('@docusaurus/plugin-content-docs').Options} */ @@ -277,7 +280,7 @@ const config = { }, ], '@docusaurus/theme-mermaid', - ...dogfoodingPluginInstances, + // ...dogfoodingPluginInstances, ], presets: [ [ @@ -285,6 +288,9 @@ const config = { /** @type {import('@docusaurus/preset-classic').Options} */ ({ debug: true, // force debug plugin usage + docs: false, + blog: false, + /* docs: { // routeBasePath: '/', path: 'docs', @@ -328,6 +334,9 @@ const config = { }, }, }, + + */ + /* blog: { // routeBasePath: '/', path: 'blog', @@ -345,6 +354,8 @@ const config = { blogSidebarCount: 'ALL', blogSidebarTitle: 'All our posts', }, + + */ pages: { remarkPlugins: [npm2yarn], }, @@ -421,6 +432,7 @@ const config = { height: 32, }, items: [ + /* { type: 'doc', position: 'left', @@ -433,7 +445,9 @@ const config = { sidebarId: 'api', label: 'API', }, - {to: 'blog', label: 'Blog', position: 'left'}, + + */ + // {to: 'blog', label: 'Blog', position: 'left'}, {to: 'showcase', label: 'Showcase', position: 'left'}, { to: '/community/support', @@ -442,6 +456,7 @@ const config = { activeBaseRegex: `/community/`, }, // This item links to a draft doc: only displayed in dev + /* { type: 'doc', docId: 'index', @@ -496,6 +511,8 @@ const config = { }, ], }, + + */ { type: 'localeDropdown', position: 'right', @@ -625,19 +642,26 @@ async function createConfig() { const FeatureRequestsPlugin = ( await import('./src/plugins/featureRequests/FeatureRequestsPlugin.mjs') ).default; - const configTabs = (await import('./src/remark/configTabs.mjs')).default; + // const configTabs = (await import('./src/remark/configTabs.mjs')).default; const lightTheme = (await import('./src/utils/prismLight.mjs')).default; const darkTheme = (await import('./src/utils/prismDark.mjs')).default; - const katex = (await import('rehype-katex')).default; + // const katex = (await import('rehype-katex')).default; config.plugins?.push(FeatureRequestsPlugin); + /* // @ts-expect-error: we know it exists, right config.presets[0][1].docs.remarkPlugins.push(configTabs); + + */ // @ts-expect-error: we know it exists, right config.themeConfig.prism.theme = lightTheme; // @ts-expect-error: we know it exists, right config.themeConfig.prism.darkTheme = darkTheme; + + /* // @ts-expect-error: we know it exists, right config.presets[0][1].docs.rehypePlugins.push(katex); + + */ return config; } diff --git a/website/src/pages/versions.tsx b/website/src/pages/versions.tsx index 5e748d6571c4..e3475738a77e 100644 --- a/website/src/pages/versions.tsx +++ b/website/src/pages/versions.tsx @@ -36,6 +36,18 @@ function ReleaseNotesLabel() { } export default function Version(): JSX.Element { + // TODO + return ( + + Versions page disabled + + ); +} + +// TODO +function VersionOld(): JSX.Element { const { siteConfig: {organizationName, projectName}, } = useDocusaurusContext(); diff --git a/yarn.lock b/yarn.lock index ff24461427a9..0f6e3dc9e595 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7529,6 +7529,11 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +escape-string-regexp@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" + integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== + escodegen@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" @@ -10957,7 +10962,7 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" -longest-streak@^2.0.0, longest-streak@^2.0.1: +longest-streak@^2.0.1: version "2.0.4" resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4" integrity sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg== @@ -11115,6 +11120,11 @@ markdown-table@^2.0.0: dependencies: repeat-string "^1.0.0" +markdown-table@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-3.0.2.tgz#9b59eb2c1b22fe71954a65ff512887065a7bb57c" + integrity sha512-y8j3a5/DkJCmS5x4dMCQL+OR0+2EAq3DOtio1COSHsmW2BGXnNCK3v12hJt1LrUz5iZH5g0LmuYOjDdI+czghA== + mathml-tag-names@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" @@ -11143,14 +11153,14 @@ mdast-util-definitions@^5.0.0: "@types/unist" "^2.0.0" unist-util-visit "^4.0.0" -mdast-util-find-and-replace@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-1.1.1.tgz#b7db1e873f96f66588c321f1363069abf607d1b5" - integrity sha512-9cKl33Y21lyckGzpSmEQnIDjEfeeWelN5s1kUW1LwdB0Fkuq2u+4GdqcGEygYxJE8GVqCl0741bYXHgamfWAZA== +mdast-util-find-and-replace@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.1.tgz#249901ef43c5f41d6e8a8d446b3b63b17e592d7c" + integrity sha512-SobxkQXFAdd4b5WmEakmkVoh18icjQRxGy5OWTCzgsLRm1Fu/KCtwD1HIQSsmq5ZRjVH0Ehwg6/Fn3xIUk+nKw== dependencies: - escape-string-regexp "^4.0.0" - unist-util-is "^4.0.0" - unist-util-visit-parents "^3.0.0" + escape-string-regexp "^5.0.0" + unist-util-is "^5.0.0" + unist-util-visit-parents "^5.0.0" mdast-util-from-markdown@^1.0.0: version "1.2.0" @@ -11170,47 +11180,63 @@ mdast-util-from-markdown@^1.0.0: unist-util-stringify-position "^3.0.0" uvu "^0.5.0" -mdast-util-gfm-autolink-literal@^0.1.0: - version "0.1.3" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.3.tgz#9c4ff399c5ddd2ece40bd3b13e5447d84e385fb7" - integrity sha512-GjmLjWrXg1wqMIO9+ZsRik/s7PLwTaeCHVB7vRxUwLntZc8mzmTsLVr6HW1yLokcnhfURsn5zmSVdi3/xWWu1A== +mdast-util-gfm-autolink-literal@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.2.tgz#4032dcbaddaef7d4f2f3768ed830475bb22d3970" + integrity sha512-FzopkOd4xTTBeGXhXSBU0OCDDh5lUj2rd+HQqG92Ld+jL4lpUfgX2AT2OHAVP9aEeDKp7G92fuooSZcYJA3cRg== dependencies: - ccount "^1.0.0" - mdast-util-find-and-replace "^1.1.0" - micromark "^2.11.3" + "@types/mdast" "^3.0.0" + ccount "^2.0.0" + mdast-util-find-and-replace "^2.0.0" + micromark-util-character "^1.0.0" -mdast-util-gfm-strikethrough@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.3.tgz#45eea337b7fff0755a291844fbea79996c322890" - integrity sha512-5OQLXpt6qdbttcDG/UxYY7Yjj3e8P7X16LzvpX8pIQPYJ/C2Z1qFGMmcw+1PZMUM3Z8wt8NRfYTvCni93mgsgA== +mdast-util-gfm-footnote@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.1.tgz#11d2d40a1a673a399c459e467fa85e00223191fe" + integrity sha512-p+PrYlkw9DeCRkTVw1duWqPRHX6Ywh2BNKJQcZbCwAuP/59B0Lk9kakuAd7KbQprVO4GzdW8eS5++A9PUSqIyw== dependencies: - mdast-util-to-markdown "^0.6.0" + "@types/mdast" "^3.0.0" + mdast-util-to-markdown "^1.3.0" + micromark-util-normalize-identifier "^1.0.0" -mdast-util-gfm-table@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.6.tgz#af05aeadc8e5ee004eeddfb324b2ad8c029b6ecf" - integrity sha512-j4yDxQ66AJSBwGkbpFEp9uG/LS1tZV3P33fN1gkyRB2LoRL+RR3f76m0HPHaby6F4Z5xr9Fv1URmATlRRUIpRQ== +mdast-util-gfm-strikethrough@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.1.tgz#a4a74c36864ec6a6e3bbd31e1977f29beb475789" + integrity sha512-zKJbEPe+JP6EUv0mZ0tQUyLQOC+FADt0bARldONot/nefuISkaZFlmVK4tU6JgfyZGrky02m/I6PmehgAgZgqg== dependencies: - markdown-table "^2.0.0" - mdast-util-to-markdown "~0.6.0" + "@types/mdast" "^3.0.0" + mdast-util-to-markdown "^1.3.0" -mdast-util-gfm-task-list-item@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.6.tgz#70c885e6b9f543ddd7e6b41f9703ee55b084af10" - integrity sha512-/d51FFIfPsSmCIRNp7E6pozM9z1GYPIkSy1urQ8s/o4TC22BZ7DqfHFWiqBD23bc7J3vV1Fc9O4QIHBlfuit8A== +mdast-util-gfm-table@^1.0.0: + version "1.0.6" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.6.tgz#184e900979fe790745fc3dabf77a4114595fcd7f" + integrity sha512-uHR+fqFq3IvB3Rd4+kzXW8dmpxUhvgCQZep6KdjsLK4O6meK5dYZEayLtIxNus1XO3gfjfcIFe8a7L0HZRGgag== dependencies: - mdast-util-to-markdown "~0.6.0" + "@types/mdast" "^3.0.0" + markdown-table "^3.0.0" + mdast-util-from-markdown "^1.0.0" + mdast-util-to-markdown "^1.3.0" -mdast-util-gfm@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-0.1.2.tgz#8ecddafe57d266540f6881f5c57ff19725bd351c" - integrity sha512-NNkhDx/qYcuOWB7xHUGWZYVXvjPFFd6afg6/e2g+SV4r9q5XUcCbV4Wfa3DLYIiD+xAEZc6K4MGaE/m0KDcPwQ== +mdast-util-gfm-task-list-item@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.1.tgz#6f35f09c6e2bcbe88af62fdea02ac199cc802c5c" + integrity sha512-KZ4KLmPdABXOsfnM6JHUIjxEvcx2ulk656Z/4Balw071/5qgnhz+H1uGtf2zIGnrnvDC8xR4Fj9uKbjAFGNIeA== dependencies: - mdast-util-gfm-autolink-literal "^0.1.0" - mdast-util-gfm-strikethrough "^0.2.0" - mdast-util-gfm-table "^0.1.0" - mdast-util-gfm-task-list-item "^0.1.0" - mdast-util-to-markdown "^0.6.1" + "@types/mdast" "^3.0.0" + mdast-util-to-markdown "^1.3.0" + +mdast-util-gfm@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-2.0.1.tgz#16fcf70110ae689a06d77e8f4e346223b64a0ea6" + integrity sha512-42yHBbfWIFisaAfV1eixlabbsa6q7vHeSPY+cg+BBjX51M8xhgMacqH9g6TftB/9+YkcI0ooV4ncfrJslzm/RQ== + dependencies: + mdast-util-from-markdown "^1.0.0" + mdast-util-gfm-autolink-literal "^1.0.0" + mdast-util-gfm-footnote "^1.0.0" + mdast-util-gfm-strikethrough "^1.0.0" + mdast-util-gfm-table "^1.0.0" + mdast-util-gfm-task-list-item "^1.0.0" + mdast-util-to-markdown "^1.0.0" mdast-util-mdx-expression@^1.0.0: version "1.3.1" @@ -11288,18 +11314,6 @@ mdast-util-to-hast@^12.1.0: unist-util-position "^4.0.0" unist-util-visit "^4.0.0" -mdast-util-to-markdown@^0.6.0, mdast-util-to-markdown@^0.6.1, mdast-util-to-markdown@~0.6.0: - version "0.6.5" - resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz#b33f67ca820d69e6cc527a93d4039249b504bebe" - integrity sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ== - dependencies: - "@types/unist" "^2.0.0" - longest-streak "^2.0.0" - mdast-util-to-string "^2.0.0" - parse-entities "^2.0.0" - repeat-string "^1.0.0" - zwitch "^1.0.0" - mdast-util-to-markdown@^1.0.0, mdast-util-to-markdown@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-1.3.0.tgz#38b6cdc8dc417de642a469c4fc2abdf8c931bd1e" @@ -11313,11 +11327,6 @@ mdast-util-to-markdown@^1.0.0, mdast-util-to-markdown@^1.3.0: unist-util-visit "^4.0.0" zwitch "^2.0.0" -mdast-util-to-string@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz#b8cfe6a713e1091cb5b728fc48885a4767f8b97b" - integrity sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w== - mdast-util-to-string@^3.0.0, mdast-util-to-string@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz#56c506d065fbf769515235e577b5a261552d56e9" @@ -11442,50 +11451,85 @@ micromark-core-commonmark@^1.0.0, micromark-core-commonmark@^1.0.1: micromark-util-types "^1.0.1" uvu "^0.5.0" -micromark-extension-gfm-autolink-literal@~0.5.0: - version "0.5.7" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.7.tgz#53866c1f0c7ef940ae7ca1f72c6faef8fed9f204" - integrity sha512-ePiDGH0/lhcngCe8FtH4ARFoxKTUelMp4L7Gg2pujYD5CSMb9PbblnyL+AAMud/SNMyusbS2XDSiPIRcQoNFAw== +micromark-extension-gfm-autolink-literal@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.3.tgz#dc589f9c37eaff31a175bab49f12290edcf96058" + integrity sha512-i3dmvU0htawfWED8aHMMAzAVp/F0Z+0bPh3YrbTPPL1v4YAlCZpy5rBO5p0LPYiZo0zFVkoYh7vDU7yQSiCMjg== dependencies: - micromark "~2.11.3" + micromark-util-character "^1.0.0" + micromark-util-sanitize-uri "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" -micromark-extension-gfm-strikethrough@~0.6.5: - version "0.6.5" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.5.tgz#96cb83356ff87bf31670eefb7ad7bba73e6514d1" - integrity sha512-PpOKlgokpQRwUesRwWEp+fHjGGkZEejj83k9gU5iXCbDG+XBA92BqnRKYJdfqfkrRcZRgGuPuXb7DaK/DmxOhw== +micromark-extension-gfm-footnote@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.0.4.tgz#cbfd8873b983e820c494498c6dac0105920818d5" + integrity sha512-E/fmPmDqLiMUP8mLJ8NbJWJ4bTw6tS+FEQS8CcuDtZpILuOb2kjLqPEeAePF1djXROHXChM/wPJw0iS4kHCcIg== dependencies: - micromark "~2.11.0" + micromark-core-commonmark "^1.0.0" + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-normalize-identifier "^1.0.0" + micromark-util-sanitize-uri "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" -micromark-extension-gfm-table@~0.4.0: - version "0.4.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.3.tgz#4d49f1ce0ca84996c853880b9446698947f1802b" - integrity sha512-hVGvESPq0fk6ALWtomcwmgLvH8ZSVpcPjzi0AjPclB9FsVRgMtGZkUcpE0zgjOCFAznKepF4z3hX8z6e3HODdA== +micromark-extension-gfm-strikethrough@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.4.tgz#162232c284ffbedd8c74e59c1525bda217295e18" + integrity sha512-/vjHU/lalmjZCT5xt7CcHVJGq8sYRm80z24qAKXzaHzem/xsDYb2yLL+NNVbYvmpLx3O7SYPuGL5pzusL9CLIQ== dependencies: - micromark "~2.11.0" + micromark-util-chunked "^1.0.0" + micromark-util-classify-character "^1.0.0" + micromark-util-resolve-all "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" -micromark-extension-gfm-tagfilter@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-0.3.0.tgz#d9f26a65adee984c9ccdd7e182220493562841ad" - integrity sha512-9GU0xBatryXifL//FJH+tAZ6i240xQuFrSL7mYi8f4oZSbc+NvXjkrHemeYP0+L4ZUT+Ptz3b95zhUZnMtoi/Q== +micromark-extension-gfm-table@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.5.tgz#7b708b728f8dc4d95d486b9e7a2262f9cddbcbb4" + integrity sha512-xAZ8J1X9W9K3JTJTUL7G6wSKhp2ZYHrFk5qJgY/4B33scJzE2kpfRL6oiw/veJTbt7jiM/1rngLlOKPWr1G+vg== + 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" -micromark-extension-gfm-task-list-item@~0.3.0: - version "0.3.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.3.tgz#d90c755f2533ed55a718129cee11257f136283b8" - integrity sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ== +micromark-extension-gfm-tagfilter@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.1.tgz#fb2e303f7daf616db428bb6a26e18fda14a90a4d" + integrity sha512-Ty6psLAcAjboRa/UKUbbUcwjVAv5plxmpUTy2XC/3nJFL37eHej8jrHrRzkqcpipJliuBH30DTs7+3wqNcQUVA== dependencies: - micromark "~2.11.0" + micromark-util-types "^1.0.0" -micromark-extension-gfm@^0.3.0: - version "0.3.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-0.3.3.tgz#36d1a4c089ca8bdfd978c9bd2bf1a0cb24e2acfe" - integrity sha512-oVN4zv5/tAIA+l3GbMi7lWeYpJ14oQyJ3uEim20ktYFAcfX1x3LNlFGGlmrZHt7u9YlKExmyJdDGaTt6cMSR/A== +micromark-extension-gfm-task-list-item@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.3.tgz#7683641df5d4a09795f353574d7f7f66e47b7fc4" + integrity sha512-PpysK2S1Q/5VXi72IIapbi/jliaiOFzv7THH4amwXeYXLq3l1uo8/2Be0Ac1rEwK20MQEsGH2ltAZLNY2KI/0Q== dependencies: - micromark "~2.11.0" - micromark-extension-gfm-autolink-literal "~0.5.0" - micromark-extension-gfm-strikethrough "~0.6.5" - micromark-extension-gfm-table "~0.4.0" - micromark-extension-gfm-tagfilter "~0.3.0" - micromark-extension-gfm-task-list-item "~0.3.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" + +micromark-extension-gfm@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-2.0.1.tgz#40f3209216127a96297c54c67f5edc7ef2d1a2a2" + integrity sha512-p2sGjajLa0iYiGQdT0oelahRYtMWvLjy8J9LOCxzIQsllMCGLbsLW+Nc+N4vi02jcRJvedVJ68cjelKIO6bpDA== + dependencies: + micromark-extension-gfm-autolink-literal "^1.0.0" + micromark-extension-gfm-footnote "^1.0.0" + micromark-extension-gfm-strikethrough "^1.0.0" + micromark-extension-gfm-table "^1.0.0" + micromark-extension-gfm-tagfilter "^1.0.0" + micromark-extension-gfm-task-list-item "^1.0.0" + micromark-util-combine-extensions "^1.0.0" + micromark-util-types "^1.0.0" micromark-extension-mdx-expression@^1.0.0: version "1.0.3" @@ -11727,14 +11771,6 @@ micromark-util-types@^1.0.0, micromark-util-types@^1.0.1: resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-1.0.2.tgz#f4220fdb319205812f99c40f8c87a9be83eded20" integrity sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w== -micromark@^2.11.3, micromark@~2.11.0, micromark@~2.11.3: - version "2.11.4" - resolved "https://registry.yarnpkg.com/micromark/-/micromark-2.11.4.tgz#d13436138eea826383e822449c9a5c50ee44665a" - integrity sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA== - dependencies: - debug "^4.0.0" - parse-entities "^2.0.0" - micromark@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/micromark/-/micromark-3.1.0.tgz#eeba0fe0ac1c9aaef675157b52c166f125e89f62" @@ -14315,13 +14351,15 @@ remark-emoji@^2.2.0: node-emoji "^1.10.0" unist-util-visit "^2.0.3" -remark-gfm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-1.0.0.tgz#9213643001be3f277da6256464d56fd28c3b3c0d" - integrity sha512-KfexHJCiqvrdBZVbQ6RopMZGwaXz6wFJEfByIuEwGf0arvITHjiKKZ1dpXujjH9KZdm1//XJQwgfnJ3lmXaDPA== +remark-gfm@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-3.0.1.tgz#0b180f095e3036545e9dddac0e8df3fa5cfee54f" + integrity sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig== dependencies: - mdast-util-gfm "^0.1.0" - micromark-extension-gfm "^0.3.0" + "@types/mdast" "^3.0.0" + mdast-util-gfm "^2.0.0" + micromark-extension-gfm "^2.0.0" + unified "^10.0.0" remark-math@^3.0.1: version "3.0.1" @@ -16422,7 +16460,7 @@ unist-util-visit-parents@^3.0.0: "@types/unist" "^2.0.0" unist-util-is "^4.0.0" -unist-util-visit-parents@^5.1.1: +unist-util-visit-parents@^5.0.0, unist-util-visit-parents@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-5.1.1.tgz#868f353e6fce6bf8fa875b251b0f4fec3be709bb" integrity sha512-gks4baapT/kNRaWxuGkl5BIhoanZo7sC/cUT/JToSRNL1dYoXRFl75d++NkjYk4TAu2uv2Px+l8guMajogeuiw== @@ -17421,11 +17459,6 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -zwitch@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" - integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== - zwitch@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.2.tgz#91f8d0e901ffa3d66599756dde7f57b17c95dce1" From 5b19968242aa64e96ad59525480f0327b2ee5c3d Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 4 Nov 2022 10:25:57 +0100 Subject: [PATCH 005/155] netlify deploy quickfix --- website/testCSSOrder.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/testCSSOrder.mjs b/website/testCSSOrder.mjs index aaa9b5b4bb88..d47f1a14782f 100644 --- a/website/testCSSOrder.mjs +++ b/website/testCSSOrder.mjs @@ -42,7 +42,7 @@ const EXPECTED_CSS_MARKERS = [ // Test markers '.test-marker-site-custom-css-unique-rule', - '.test-marker-site-client-module', + // '.test-marker-site-client-module', // TODO re-enable '.test-marker-theme-layout', '.test-marker-site-index-page', From 1bf2e82ff476e5d08880bb773f0a67dfd6417223 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 4 Nov 2022 12:47:33 +0100 Subject: [PATCH 006/155] add _ to canary for now --- website/community/{4-canary.md => _4-canary.md} | 4 ---- 1 file changed, 4 deletions(-) rename website/community/{4-canary.md => _4-canary.md} (99%) diff --git a/website/community/4-canary.md b/website/community/_4-canary.md similarity index 99% rename from website/community/4-canary.md rename to website/community/_4-canary.md index 24ffb2b3ffd0..ae866c4d334e 100644 --- a/website/community/4-canary.md +++ b/website/community/_4-canary.md @@ -1,7 +1,3 @@ ---- -draft: true ---- - # Canary releases ```mdx-code-block From 83064b22970dc0cfe55d9568f02d73724eeeb17b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 4 Nov 2022 12:54:06 +0100 Subject: [PATCH 007/155] Add ability to escape heading anchor link syntax --- packages/docusaurus-mdx-loader/src/loader.ts | 12 +- .../src/__tests__/markdownUtils.test.ts | 135 ++++++++++++++++++ packages/docusaurus-utils/src/index.ts | 1 + .../docusaurus-utils/src/markdownUtils.ts | 17 +++ website/community/0-support.md | 8 +- website/community/1-team.mdx | 8 +- website/community/2-resources.md | 16 +-- website/community/5-release-process.md | 20 +-- 8 files changed, 188 insertions(+), 29 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 84addfd3f3f6..ec38eae9cd59 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -12,6 +12,7 @@ import { parseMarkdownContentTitle, escapePath, getFileLoaderUtils, + escapeMarkdownHeadingIds, } from '@docusaurus/utils'; import emoji from 'remark-emoji'; @@ -171,9 +172,14 @@ export async function mdxLoader( const {frontMatter, content: contentWithTitle} = parseFrontMatter(fileString); - const {content, contentTitle} = parseMarkdownContentTitle(contentWithTitle, { - removeContentTitle: reqOptions.removeContentTitle, - }); + const {content: contentUnescaped, contentTitle} = parseMarkdownContentTitle( + contentWithTitle, + { + removeContentTitle: reqOptions.removeContentTitle, + }, + ); + + const content = escapeMarkdownHeadingIds(contentUnescaped); const hasFrontMatter = Object.keys(frontMatter).length > 0; diff --git a/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts b/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts index 42df2a38d4f1..9acb4ca73b44 100644 --- a/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts +++ b/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts @@ -12,6 +12,7 @@ import { parseMarkdownString, parseMarkdownHeadingId, writeMarkdownHeadingId, + escapeMarkdownHeadingIds, } from '../markdownUtils'; describe('createExcerpt', () => { @@ -882,6 +883,140 @@ describe('parseMarkdownHeadingId', () => { }); }); +describe('escapeMarkdownHeadingIds', () => { + it('can escape simple heading id', () => { + expect(escapeMarkdownHeadingIds('# title 1 {#id-1}')).toBe( + '# title 1 \\{#id-1}', + ); + expect(escapeMarkdownHeadingIds('# title 1 {#id-1}')).toBe( + '# title 1 \\{#id-1}', + ); + expect(escapeMarkdownHeadingIds('# title 1{#id-1}')).toBe( + '# title 1\\{#id-1}', + ); + expect(escapeMarkdownHeadingIds('# title 1 \\{#id-1}')).toBe( + '# title 1 \\{#id-1}', + ); + expect(escapeMarkdownHeadingIds('# title 1\\{#id-1}')).toBe( + '# title 1\\{#id-1}', + ); + }); + + it('can escape level 1-6 heading ids', () => { + expect( + escapeMarkdownHeadingIds(dedent` + # title 1 {#id-1} + + ## title 2 {#id-2} + + ### title 3 {#id-3} + + #### title 4 {#id-4} + + ##### title 5 {#id-5} + + ###### title 6 {#id-6} + `), + ).toEqual(dedent` + # title 1 \{#id-1} + + ## title 2 \{#id-2} + + ### title 3 \{#id-3} + + #### title 4 \{#id-4} + + ##### title 5 \{#id-5} + + ###### title 6 \{#id-6} + `); + }); + + it('does not escape level 7 heading id', () => { + expect( + escapeMarkdownHeadingIds(dedent` + ####### title 7 {#id-7} + `), + ).toEqual(dedent` + ####### title 7 {#id-7} + `); + }); + + it('does not escape non-heading', () => { + expect( + escapeMarkdownHeadingIds(dedent` + some text {#non-id} + `), + ).toEqual(dedent` + some text {#non-id} + `); + }); + + it('real world', () => { + expect( + escapeMarkdownHeadingIds(dedent` + # Support + + Docusaurus has a community of thousands of developers. + + On this page we've listed some Docusaurus-related communities that you can be a part of; see the other pages in this section for additional online and in-person learning materials. + + Before participating in Docusaurus' communities, [please read our Code of Conduct](https://engineering.fb.com/codeofconduct/). We have adopted the [Contributor Covenant](https://www.contributor-covenant.org/) and we expect that all community members adhere to the guidelines within. + + ## Stack Overflow {#stack-overflow} + + Stack Overflow is a popular forum to ask code-level questions or if you're stuck with a specific error. Read through the [existing questions](https://stackoverflow.com/questions/tagged/docusaurus) tagged with **docusaurus** or [ask your own](https://stackoverflow.com/questions/ask?tags=docusaurus)! + + ## Discussion forums \{#discussion-forums} + + There are many online forums for discussion about best practices and application architecture as well as the future of Docusaurus. If you have an answerable code-level question, Stack Overflow is usually a better fit. + + - [Docusaurus online chat](https://discord.gg/docusaurus) + - [#help-and-questions](https://discord.gg/fwbcrQ3dHR) for user help + - [#contributors](https://discord.gg/6g6ASPA) for contributing help + - [Reddit's Docusaurus community](https://www.reddit.com/r/docusaurus/) + + ## Feature requests {#feature-requests} + + For new feature requests, you can create a post on our [feature requests board (Canny)](/feature-requests), which is a handy tool for road-mapping and allows for sorting by upvotes, which gives the core team a better indicator of what features are in high demand, as compared to GitHub issues which are harder to triage. Refrain from making a Pull Request for new features (especially large ones) as someone might already be working on it or will be part of our roadmap. Talk to us first! + + ## News {#news} + + For the latest news about Docusaurus, [follow **@docusaurus** on Twitter](https://twitter.com/docusaurus) and the [official Docusaurus blog](/blog) on this website. + `), + ).toEqual(dedent` + # Support + + Docusaurus has a community of thousands of developers. + + On this page we've listed some Docusaurus-related communities that you can be a part of; see the other pages in this section for additional online and in-person learning materials. + + Before participating in Docusaurus' communities, [please read our Code of Conduct](https://engineering.fb.com/codeofconduct/). We have adopted the [Contributor Covenant](https://www.contributor-covenant.org/) and we expect that all community members adhere to the guidelines within. + + ## Stack Overflow \{#stack-overflow} + + Stack Overflow is a popular forum to ask code-level questions or if you're stuck with a specific error. Read through the [existing questions](https://stackoverflow.com/questions/tagged/docusaurus) tagged with **docusaurus** or [ask your own](https://stackoverflow.com/questions/ask?tags=docusaurus)! + + ## Discussion forums \{#discussion-forums} + + There are many online forums for discussion about best practices and application architecture as well as the future of Docusaurus. If you have an answerable code-level question, Stack Overflow is usually a better fit. + + - [Docusaurus online chat](https://discord.gg/docusaurus) + - [#help-and-questions](https://discord.gg/fwbcrQ3dHR) for user help + - [#contributors](https://discord.gg/6g6ASPA) for contributing help + - [Reddit's Docusaurus community](https://www.reddit.com/r/docusaurus/) + + ## Feature requests \{#feature-requests} + + For new feature requests, you can create a post on our [feature requests board (Canny)](/feature-requests), which is a handy tool for road-mapping and allows for sorting by upvotes, which gives the core team a better indicator of what features are in high demand, as compared to GitHub issues which are harder to triage. Refrain from making a Pull Request for new features (especially large ones) as someone might already be working on it or will be part of our roadmap. Talk to us first! + + ## News \{#news} + + For the latest news about Docusaurus, [follow **@docusaurus** on Twitter](https://twitter.com/docusaurus) and the [official Docusaurus blog](/blog) on this website. + `); + }); +}); + describe('writeMarkdownHeadingId', () => { it('works for simple level-2 heading', () => { expect(writeMarkdownHeadingId('## ABC')).toBe('## ABC {#abc}'); diff --git a/packages/docusaurus-utils/src/index.ts b/packages/docusaurus-utils/src/index.ts index ba74f8d3d134..026a83f76681 100644 --- a/packages/docusaurus-utils/src/index.ts +++ b/packages/docusaurus-utils/src/index.ts @@ -66,6 +66,7 @@ export { } from './tags'; export { parseMarkdownHeadingId, + escapeMarkdownHeadingIds, createExcerpt, parseFrontMatter, parseMarkdownContentTitle, diff --git a/packages/docusaurus-utils/src/markdownUtils.ts b/packages/docusaurus-utils/src/markdownUtils.ts index 512a09bf916d..e0f67c4c3dcf 100644 --- a/packages/docusaurus-utils/src/markdownUtils.ts +++ b/packages/docusaurus-utils/src/markdownUtils.ts @@ -39,6 +39,23 @@ export function parseMarkdownHeadingId(heading: string): { return {text: heading, id: undefined}; } +/** + * MDX 2 requires escaping { with a \ so our anchor syntax need that now. + * See https://mdxjs.com/docs/troubleshooting-mdx/#could-not-parse-expression-with-acorn-error + */ +export function escapeMarkdownHeadingIds(content: string): string { + const markdownHeadingRegexp = /(?:^|\n)#{1,6}(?!#).*/g; + return content.replaceAll(markdownHeadingRegexp, (substring, ...args) => + // TODO probably not the most efficient impl... + ( + substring + .replace('{#', '\\{#') + // prevent duplicate escaping + .replace('\\\\{#', '\\{#') + ) + ); +} + // TODO: Find a better way to do so, possibly by compiling the Markdown content, // stripping out HTML tags and obtaining the first line. /** diff --git a/website/community/0-support.md b/website/community/0-support.md index 7cd91a965e40..fcfa72185292 100644 --- a/website/community/0-support.md +++ b/website/community/0-support.md @@ -6,11 +6,11 @@ On this page we've listed some Docusaurus-related communities that you can be a Before participating in Docusaurus' communities, [please read our Code of Conduct](https://engineering.fb.com/codeofconduct/). We have adopted the [Contributor Covenant](https://www.contributor-covenant.org/) and we expect that all community members adhere to the guidelines within. -## Stack Overflow \{#stack-overflow} +## Stack Overflow {#stack-overflow} Stack Overflow is a popular forum to ask code-level questions or if you're stuck with a specific error. Read through the [existing questions](https://stackoverflow.com/questions/tagged/docusaurus) tagged with **docusaurus** or [ask your own](https://stackoverflow.com/questions/ask?tags=docusaurus)! -## Discussion forums \{#discussion-forums} +## Discussion forums {#discussion-forums} There are many online forums for discussion about best practices and application architecture as well as the future of Docusaurus. If you have an answerable code-level question, Stack Overflow is usually a better fit. @@ -19,10 +19,10 @@ There are many online forums for discussion about best practices and application - [#contributors](https://discord.gg/6g6ASPA) for contributing help - [Reddit's Docusaurus community](https://www.reddit.com/r/docusaurus/) -## Feature requests \{#feature-requests} +## Feature requests {#feature-requests} For new feature requests, you can create a post on our [feature requests board (Canny)](/feature-requests), which is a handy tool for road-mapping and allows for sorting by upvotes, which gives the core team a better indicator of what features are in high demand, as compared to GitHub issues which are harder to triage. Refrain from making a Pull Request for new features (especially large ones) as someone might already be working on it or will be part of our roadmap. Talk to us first! -## News \{#news} +## News {#news} For the latest news about Docusaurus, [follow **@docusaurus** on Twitter](https://twitter.com/docusaurus) and the [official Docusaurus blog](/blog) on this website. diff --git a/website/community/1-team.mdx b/website/community/1-team.mdx index 26726899a839..98bf339e27c2 100644 --- a/website/community/1-team.mdx +++ b/website/community/1-team.mdx @@ -6,7 +6,7 @@ import { StudentFellowsTeamRow, } from '@site/src/components/TeamProfileCards'; -## Active Team \{#active-team} +## Active Team {#active-team} The Docusaurus team works on the core functionality, plugins for the classic theme, as well as the Docusaurus documentation website. @@ -14,19 +14,19 @@ Current members of the Docusaurus team are listed in alphabetical order below. -## Honorary Alumni \{#honorary-alumni} +## Honorary Alumni {#honorary-alumni} Docusaurus would never be what it is today without the huge contributions from these folks who have moved on to bigger and greater things. -## Student Fellows \{#student-fellows} +## Student Fellows {#student-fellows} A handful of students have also worked on Docusaurus as part of their school term/internship and the [Major League Hacking Fellowship program](https://fellowship.mlh.io/), contributing amazing features such as plugin options validation, migration tooling, and a Bootstrap theme. -## Acknowledgements \{#acknowledgements} +## Acknowledgements {#acknowledgements} Docusaurus was originally created by Joel Marcey. Today, Docusaurus has a few hundred open source contributors. We’d like to recognize a few people who have made significant contributions to Docusaurus and its documentation in the past and have helped maintain them over the years: diff --git a/website/community/2-resources.md b/website/community/2-resources.md index 62b818e93f34..10d354017431 100644 --- a/website/community/2-resources.md +++ b/website/community/2-resources.md @@ -2,22 +2,22 @@ A curated list of interesting Docusaurus community projects. -## Videos \{#videos} +## Videos {#videos} - [F8 2019: Using Docusaurus to Create Open Source Websites](https://www.youtube.com/watch?v=QcGJsf6mgZE) -## Articles \{#articles} +## Articles {#articles} - [Awesome Docusaurus](https://github.com/webbertakken/awesome-docusaurus#readme) - Community curated list of Docusaurus resources. - [Live code editing in Docusaurus](https://dev.to/mrmuhammadali/live-code-editing-in-docusaurus-ux-at-its-best-2hj1) -## Showcase \{#showcase} +## Showcase {#showcase} See the showcase. -## Community plugins \{#community-plugins} +## Community plugins {#community-plugins} -### Search \{#search} +### Search {#search} - [docusaurus-plugin-lunr](https://github.com/daldridge/docusaurus-plugin-lunr) - Docusaurus v2 plugin to create a local search index for use with Lunr.js - [docusaurus-lunr-search](https://github.com/lelouch77/docusaurus-lunr-search) - Offline Search for Docusaurus v2 @@ -25,14 +25,14 @@ See the showcase - [@easyops-cn/docusaurus-search-local](https://github.com/easyops-cn/docusaurus-search-local) - Offline/local search for Docusaurus v2 (language of zh supported) - [docusaurus-theme-search-typesense](https://github.com/typesense/docusaurus-theme-search-typesense) - Docusaurus v2 plugin for [Typesense DocSearch](https://typesense.org/docs/latest/guide/docsearch.html). -### Integrations \{#integrations} +### Integrations {#integrations} - [docusaurus2-dotenv](https://github.com/jonnynabors/docusaurus2-dotenv) - A Docusaurus 2 plugin that supports dotenv and other environment variables - [posthog-docusaurus](https://github.com/PostHog/posthog-docusaurus) - Integrate [PostHog](https://posthog.com/) product analytics with Docusaurus v2 - [docusaurus-plugin-moesif](https://github.com/Moesif/docusaurus-plugin-moesif) - Adds [Moesif API Analytics](https://www.moesif.com/) to track user behavior and pinpoint where developers drop off in your activation funnel. - [docusaurus-plugin-yandex-metrica](https://github.com/sgromkov/docusaurus-plugin-yandex-metrica) - Adds [Yandex Metrika](https://metrika.yandex.ru/) counter for evaluating site traffic and analyzing user behavior. -### Features \{#features} +### Features {#features} - [docusaurus-theme-github-codeblock](https://github.com/saucelabs/docusaurus-theme-github-codeblock). A Docusaurus v2 plugin that supports referencing code examples from public GitHub repositories - [mr-pdf](https://github.com/kohheepeace/mr-pdf) - Generate documentation into PDF format, suitable for Docusaurus v1 and v2 (including beta versions) @@ -50,7 +50,7 @@ See the showcase - [docusaurus-openapi-docs](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs) - A Docusaurus v2 plugin and theme for generating interactive OpenAPI docs - [docusaurus-post-generator](https://github.com/moojing/docusaurus-post-generator) - A command line tool for user to add a blog/doc file quickly by command like `yarn gen-post new [template] [post_name]`. -## Enterprise usage \{#enterprise-usage} +## Enterprise usage {#enterprise-usage} - Facebook - Google diff --git a/website/community/5-release-process.md b/website/community/5-release-process.md index 267dfed877e7..4c76f0e563da 100644 --- a/website/community/5-release-process.md +++ b/website/community/5-release-process.md @@ -8,7 +8,7 @@ This topic is particularly important for highly customized sites that may have d ::: -## Semantic versioning \{#semantic-versioning} +## Semantic versioning {#semantic-versioning} Docusaurus versioning is based on the `major.minor.patch` scheme and respects [Semantic Versioning](https://semver.org/). @@ -27,7 +27,7 @@ Releasing Docusaurus 2.0 took a very long time. From now on, Docusaurus will **r ::: -### Major versions \{#major-versions} +### Major versions {#major-versions} The `major` version number is incremented on **every breaking change**. @@ -42,7 +42,7 @@ Read our [public API surface](#public-api-surface) section to clearly understand ::: -### Minor versions \{#minor-versions} +### Minor versions {#minor-versions} The `minor` version number is incremented on every significant retro-compatible change. @@ -57,7 +57,7 @@ If you only use our [public API surface](#public-api-surface), you should be abl ::: -### Patch versions \{#patch-versions} +### Patch versions {#patch-versions} The `patch` version number is incremented on bugfixes releases. @@ -65,7 +65,7 @@ Whenever a new patch version is released, we publish: - an exhaustive changelog entry -## Versions \{#versions} +## Versions {#versions} ```mdx-code-block import { @@ -87,7 +87,7 @@ The branch is created just before releasing the first v ::: -### Stable version \{#stable-version} +### Stable version {#stable-version} The stable version (v, on ) is recommended for most Docusaurus users. @@ -101,7 +101,7 @@ It is recommended to upgrade within that time frame to the new stable version. ::: -### Next version \{#next-version} +### Next version {#next-version} The next version (v, on ) is the version the Docusaurus team is currently working on. @@ -129,7 +129,7 @@ At the `beta` and `rc` (release candidate) phases, we avoid introducing major br ::: -## Public API surface \{#public-api-surface} +## Public API surface {#public-api-surface} Docusaurus commits to respecting Semantic Versioning. This means that whenever changes occur in Docusaurus public APIs and break backward compatibility, we will increment the `major` version number. @@ -141,7 +141,7 @@ Docusaurus guarantees public API retro-compatibility across `minor` versions. Un We will outline what accounts as the public API surface. -### Core public API \{#core-public-api} +### Core public API {#core-public-api} ✅ Our public API includes: @@ -164,7 +164,7 @@ For non-theme APIs, any documented API is considered public (and will be stable) An API being "stable" means if you increment the patch or minor version of your Docusaurus installation without any other change, running `docusaurus start` or `docusaurus build` should not throw an error. -### Theming public API \{#theming-public-api} +### Theming public API {#theming-public-api} Docusaurus has a very flexible theming system: From 0f950381f471b6111bdf22d4e289121eba2160ab Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 4 Nov 2022 15:05:06 +0100 Subject: [PATCH 008/155] almost working unwrapMdxCodeBlocks --- packages/docusaurus-mdx-loader/src/loader.ts | 14 ++- .../src/remark/unwrapMdxCodeBlocks/index.ts | 2 + .../src/__tests__/markdownUtils.test.ts | 95 ++++++++++++++++++- packages/docusaurus-utils/src/index.ts | 1 + .../docusaurus-utils/src/markdownUtils.ts | 22 +++-- 5 files changed, 122 insertions(+), 12 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index ec38eae9cd59..6c6b262030da 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -13,6 +13,7 @@ import { escapePath, getFileLoaderUtils, escapeMarkdownHeadingIds, + unwrapMdxCodeBlocks, } from '@docusaurus/utils'; import emoji from 'remark-emoji'; @@ -20,7 +21,6 @@ import stringifyObject from 'stringify-object'; import headings from './remark/headings'; import toc from './remark/toc'; -import unwrapMdxCodeBlocks from './remark/unwrapMdxCodeBlocks'; import transformImage from './remark/transformImage'; import transformLinks from './remark/transformLinks'; import mermaid from './remark/mermaid'; @@ -49,7 +49,7 @@ const DEFAULT_OPTIONS: MDXOptions = { admonitions: true, rehypePlugins: [], // @ts-expect-error: TODO - remarkPlugins: [unwrapMdxCodeBlocks, emoji, headings, toc], + remarkPlugins: [emoji, headings, toc], beforeDefaultRemarkPlugins: [], beforeDefaultRehypePlugins: [], }; @@ -172,14 +172,20 @@ export async function mdxLoader( const {frontMatter, content: contentWithTitle} = parseFrontMatter(fileString); - const {content: contentUnescaped, contentTitle} = parseMarkdownContentTitle( + const {content: contentUnprocessed, contentTitle} = parseMarkdownContentTitle( contentWithTitle, { removeContentTitle: reqOptions.removeContentTitle, }, ); - const content = escapeMarkdownHeadingIds(contentUnescaped); + const content = escapeMarkdownHeadingIds( + unwrapMdxCodeBlocks(contentUnprocessed), + ); + + if (filePath.endsWith('website/community/4-canary.md')) { + console.log(content); + } const hasFrontMatter = Object.keys(frontMatter).length > 0; diff --git a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/index.ts b/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/index.ts index 07aee3daeb89..aa122ef1a91a 100644 --- a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/index.ts @@ -9,6 +9,8 @@ import visit from 'unist-util-visit'; import type {Transformer, Processor} from 'unified'; import type {Code, Parent} from 'mdast'; +// TODO to delete? Doesn't work with mdx 2 + // This plugin is mostly to help integrating Docusaurus with translation systems // that do not support well MDX embedded JSX syntax (like Crowdin). // We wrap the JSX syntax in code blocks so that translation tools don't mess up diff --git a/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts b/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts index 9acb4ca73b44..5866139b07a6 100644 --- a/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts +++ b/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts @@ -13,6 +13,7 @@ import { parseMarkdownHeadingId, writeMarkdownHeadingId, escapeMarkdownHeadingIds, + unwrapMdxCodeBlocks, } from '../markdownUtils'; describe('createExcerpt', () => { @@ -952,7 +953,7 @@ describe('escapeMarkdownHeadingIds', () => { `); }); - it('real world', () => { + it('works for realistic example', () => { expect( escapeMarkdownHeadingIds(dedent` # Support @@ -1017,6 +1018,98 @@ describe('escapeMarkdownHeadingIds', () => { }); }); +describe('unwrapMdxCodeBlocks', () => { + it('can unwrap a simple mdx code block', () => { + expect( + unwrapMdxCodeBlocks(dedent` + # Title + + \`\`\`mdx-code-block + import Comp, {User} from "@site/components/comp" + + + + + + export const age = 36 + \`\`\` + + text + `), + ).toEqual(dedent` + # Title + + import Comp, {User} from "@site/components/comp" + + + + + + export const age = 36 + + text + `); + }); + + it('works for realistic example', () => { + expect( + unwrapMdxCodeBlocks(dedent` + # Canary releases + + \`\`\`mdx-code-block + import { + VersionsProvider, + } from "@site/src/components/Versions"; + + + \`\`\` + + Docusaurus has a canary releases system. + + It permits you to **test new unreleased features** as soon as the pull requests are merged on the [next version](./5-release-process.md#next-version) of Docusaurus. + + It is a good way to **give feedback to maintainers**, ensuring the newly implemented feature works as intended. + + :::note + + Using a canary release in production might seem risky, but in practice, it's not. + + A canary release passes all automated tests and is used in production by the Docusaurus site itself. + + \`\`\`mdx-code-block + + \`\`\` + + Some extra text + `), + ).toEqual(dedent` + # Canary releases + + import { + VersionsProvider, + } from "@site/src/components/Versions"; + + + + Docusaurus has a canary releases system. + + It permits you to **test new unreleased features** as soon as the pull requests are merged on the [next version](./5-release-process.md#next-version) of Docusaurus. + + It is a good way to **give feedback to maintainers**, ensuring the newly implemented feature works as intended. + + :::note + + Using a canary release in production might seem risky, but in practice, it's not. + + A canary release passes all automated tests and is used in production by the Docusaurus site itself. + + + + Some extra text + `); + }); +}); + describe('writeMarkdownHeadingId', () => { it('works for simple level-2 heading', () => { expect(writeMarkdownHeadingId('## ABC')).toBe('## ABC {#abc}'); diff --git a/packages/docusaurus-utils/src/index.ts b/packages/docusaurus-utils/src/index.ts index 026a83f76681..7b5fa8f1f409 100644 --- a/packages/docusaurus-utils/src/index.ts +++ b/packages/docusaurus-utils/src/index.ts @@ -67,6 +67,7 @@ export { export { parseMarkdownHeadingId, escapeMarkdownHeadingIds, + unwrapMdxCodeBlocks, createExcerpt, parseFrontMatter, parseMarkdownContentTitle, diff --git a/packages/docusaurus-utils/src/markdownUtils.ts b/packages/docusaurus-utils/src/markdownUtils.ts index e0f67c4c3dcf..d878123530f9 100644 --- a/packages/docusaurus-utils/src/markdownUtils.ts +++ b/packages/docusaurus-utils/src/markdownUtils.ts @@ -45,17 +45,25 @@ export function parseMarkdownHeadingId(heading: string): { */ export function escapeMarkdownHeadingIds(content: string): string { const markdownHeadingRegexp = /(?:^|\n)#{1,6}(?!#).*/g; - return content.replaceAll(markdownHeadingRegexp, (substring, ...args) => + return content.replaceAll(markdownHeadingRegexp, (substring, ...args) => // TODO probably not the most efficient impl... - ( - substring - .replace('{#', '\\{#') - // prevent duplicate escaping - .replace('\\\\{#', '\\{#') - ) + substring + .replace('{#', '\\{#') + // prevent duplicate escaping + .replace('\\\\{#', '\\{#'), ); } +// TODO support other levels... +export function unwrapMdxCodeBlocks(content: string): string { + const markdownHeadingRegexp = + /(?:^|\n)```mdx-code-block\n(?.*?)\n```\n/gs; + return content.replaceAll(markdownHeadingRegexp, (substring, ...args) => { + const groups = args[3]; + return `\n${groups.children}\n`; + }); +} + // TODO: Find a better way to do so, possibly by compiling the Markdown content, // stripping out HTML tags and obtaining the first line. /** From a38aff7220b6eff04ddcd56c1fbb5e835de72f12 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 4 Nov 2022 17:10:41 +0100 Subject: [PATCH 009/155] add proper unwrapMdxCodeBlocks fn --- .../src/__tests__/markdownUtils.test.ts | 4 ---- .../docusaurus-utils/src/markdownUtils.ts | 20 ++++++++++++------- .../community/{_4-canary.md => 4-canary.md} | 0 3 files changed, 13 insertions(+), 11 deletions(-) rename website/community/{_4-canary.md => 4-canary.md} (100%) diff --git a/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts b/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts index 5866139b07a6..4bfd13a2dd21 100644 --- a/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts +++ b/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts @@ -1079,8 +1079,6 @@ describe('unwrapMdxCodeBlocks', () => { \`\`\`mdx-code-block \`\`\` - - Some extra text `), ).toEqual(dedent` # Canary releases @@ -1104,8 +1102,6 @@ describe('unwrapMdxCodeBlocks', () => { A canary release passes all automated tests and is used in production by the Docusaurus site itself. - - Some extra text `); }); }); diff --git a/packages/docusaurus-utils/src/markdownUtils.ts b/packages/docusaurus-utils/src/markdownUtils.ts index d878123530f9..28de6cb9a624 100644 --- a/packages/docusaurus-utils/src/markdownUtils.ts +++ b/packages/docusaurus-utils/src/markdownUtils.ts @@ -54,14 +54,20 @@ export function escapeMarkdownHeadingIds(content: string): string { ); } -// TODO support other levels... +// TODO support other levels? export function unwrapMdxCodeBlocks(content: string): string { - const markdownHeadingRegexp = - /(?:^|\n)```mdx-code-block\n(?.*?)\n```\n/gs; - return content.replaceAll(markdownHeadingRegexp, (substring, ...args) => { - const groups = args[3]; - return `\n${groups.children}\n`; - }); + const regexp3 = + /(?^|\n)```mdx-code-block\n(?.*?)\n```(?\n|$)/gs; + const regexp4 = + /(?^|\n)````mdx-code-block\n(?.*?)\n````(?\n|$)/gs; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const replacer = (substring: string, ...args: any[]) => { + const groups = args.at(-1); + return `${groups.begin}${groups.children}${groups.end}`; + }; + + return content.replaceAll(regexp3, replacer).replaceAll(regexp4, replacer); } // TODO: Find a better way to do so, possibly by compiling the Markdown content, diff --git a/website/community/_4-canary.md b/website/community/4-canary.md similarity index 100% rename from website/community/_4-canary.md rename to website/community/4-canary.md From 147985bf9a78585d0343bc51e9721afed5a80db8 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 4 Nov 2022 17:18:13 +0100 Subject: [PATCH 010/155] re-enable blog --- packages/docusaurus-mdx-loader/src/loader.ts | 2 +- website/docusaurus.config.js | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 6c6b262030da..0cc4d77610b9 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -183,7 +183,7 @@ export async function mdxLoader( unwrapMdxCodeBlocks(contentUnprocessed), ); - if (filePath.endsWith('website/community/4-canary.md')) { + if (filePath.endsWith('website/blog/releases/2.2/index.mdx')) { console.log(content); } diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index cd090b361d49..017df1b0b95a 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -289,7 +289,6 @@ const config = { ({ debug: true, // force debug plugin usage docs: false, - blog: false, /* docs: { // routeBasePath: '/', @@ -336,7 +335,7 @@ const config = { }, */ - /* + blog: { // routeBasePath: '/', path: 'blog', @@ -354,8 +353,6 @@ const config = { blogSidebarCount: 'ALL', blogSidebarTitle: 'All our posts', }, - - */ pages: { remarkPlugins: [npm2yarn], }, @@ -447,7 +444,7 @@ const config = { }, */ - // {to: 'blog', label: 'Blog', position: 'left'}, + {to: 'blog', label: 'Blog', position: 'left'}, {to: 'showcase', label: 'Showcase', position: 'left'}, { to: '/community/support', From 2ba0043c3352d6fa397950d314bf5782b18d4b5c Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 4 Nov 2022 17:23:25 +0100 Subject: [PATCH 011/155] remove before MDX compilation --- packages/docusaurus-mdx-loader/src/loader.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 0cc4d77610b9..af71b647ec5d 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -181,11 +181,15 @@ export async function mdxLoader( const content = escapeMarkdownHeadingIds( unwrapMdxCodeBlocks(contentUnprocessed), - ); + ) + // TODO MDX 2 doesn't like unescaped < + .replace('\n', ''); + /* if (filePath.endsWith('website/blog/releases/2.2/index.mdx')) { console.log(content); } + */ const hasFrontMatter = Object.keys(frontMatter).length > 0; From 55ef6b9eef935584355c14ff841fffe92c8fd71b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 4 Nov 2022 17:52:57 +0100 Subject: [PATCH 012/155] strip html comments --- packages/docusaurus-mdx-loader/src/loader.ts | 15 ++++++--------- .../_dogfooding/_pages tests/markdownPageTests.md | 4 ++-- website/docusaurus.config.js | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index af71b647ec5d..008dafeae7c3 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -182,14 +182,11 @@ export async function mdxLoader( const content = escapeMarkdownHeadingIds( unwrapMdxCodeBlocks(contentUnprocessed), ) - // TODO MDX 2 doesn't like unescaped < - .replace('\n', ''); - - /* - if (filePath.endsWith('website/blog/releases/2.2/index.mdx')) { - console.log(content); - } - */ + // TODO MDX 2 doesn't like our unescaped html comments < + .replace('', '') + .replace('', '') + .replace('', ''); + // TODO also check the escaped comments like \', '') - .replace('', '') - .replace('', ''); - // TODO also check the escaped comments like \\n\n'; + } + } + return '\n\n'; + } +} + +// node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +function containerPhrasing(parent, context, safeOptions) { + const indexStack = context.indexStack; + const children = parent.children || []; + const results = []; + let index2 = -1; + let before = safeOptions.before; + indexStack.push(-1); + let tracker = track(safeOptions); + while (++index2 < children.length) { + const child = children[index2]; + let after; + indexStack[indexStack.length - 1] = index2; + if (index2 + 1 < children.length) { + let handle = context.handle.handlers[children[index2 + 1].type]; + if (handle && handle.peek) handle = handle.peek; + after = handle + ? handle(children[index2 + 1], parent, context, { + before: '', + after: '', + ...tracker.current(), + }).charAt(0) + : ''; + } else { + after = safeOptions.after; + } + if ( + results.length > 0 && + (before === '\r' || before === '\n') && + child.type === 'html' + ) { + results[results.length - 1] = results[results.length - 1].replace( + /(\r?\n|\r)$/, + ' ', + ); + before = ' '; + tracker = track(safeOptions); + tracker.move(results.join('')); + } + results.push( + tracker.move( + context.handle(child, parent, context, { + ...tracker.current(), + before, + after, + }), + ), + ); + before = results[results.length - 1].slice(-1); + } + indexStack.pop(); + return results.join(''); +} + +// node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +var eol = /\r?\n|\r/g; +function indentLines(value, map) { + const result = []; + let start3 = 0; + let line = 0; + let match; + while ((match = eol.exec(value))) { + one3(value.slice(start3, match.index)); + result.push(match[0]); + start3 = match.index + match[0].length; + line++; + } + one3(value.slice(start3)); + return result.join(''); + function one3(value2) { + result.push(map(value2, line, !value2)); + } +} + +// node_modules/mdast-util-mdx-jsx/lib/index.js +function mdxJsxFromMarkdown() { + return { + canContainEols: ['mdxJsxTextElement'], + enter: { + mdxJsxFlowTag: enterMdxJsxTag, + mdxJsxFlowTagClosingMarker: enterMdxJsxTagClosingMarker, + mdxJsxFlowTagAttribute: enterMdxJsxTagAttribute, + mdxJsxFlowTagExpressionAttribute: enterMdxJsxTagExpressionAttribute, + mdxJsxFlowTagAttributeValueLiteral: buffer2, + mdxJsxFlowTagAttributeValueExpression: buffer2, + mdxJsxFlowTagSelfClosingMarker: enterMdxJsxTagSelfClosingMarker, + mdxJsxTextTag: enterMdxJsxTag, + mdxJsxTextTagClosingMarker: enterMdxJsxTagClosingMarker, + mdxJsxTextTagAttribute: enterMdxJsxTagAttribute, + mdxJsxTextTagExpressionAttribute: enterMdxJsxTagExpressionAttribute, + mdxJsxTextTagAttributeValueLiteral: buffer2, + mdxJsxTextTagAttributeValueExpression: buffer2, + mdxJsxTextTagSelfClosingMarker: enterMdxJsxTagSelfClosingMarker, + }, + exit: { + mdxJsxFlowTagClosingMarker: exitMdxJsxTagClosingMarker, + mdxJsxFlowTagNamePrimary: exitMdxJsxTagNamePrimary, + mdxJsxFlowTagNameMember: exitMdxJsxTagNameMember, + mdxJsxFlowTagNameLocal: exitMdxJsxTagNameLocal, + mdxJsxFlowTagExpressionAttribute: exitMdxJsxTagExpressionAttribute, + mdxJsxFlowTagExpressionAttributeValue: data2, + mdxJsxFlowTagAttributeNamePrimary: exitMdxJsxTagAttributeNamePrimary, + mdxJsxFlowTagAttributeNameLocal: exitMdxJsxTagAttributeNameLocal, + mdxJsxFlowTagAttributeValueLiteral: exitMdxJsxTagAttributeValueLiteral, + mdxJsxFlowTagAttributeValueLiteralValue: data2, + mdxJsxFlowTagAttributeValueExpression: + exitMdxJsxTagAttributeValueExpression, + mdxJsxFlowTagAttributeValueExpressionValue: data2, + mdxJsxFlowTagSelfClosingMarker: exitMdxJsxTagSelfClosingMarker, + mdxJsxFlowTag: exitMdxJsxTag, + mdxJsxTextTagClosingMarker: exitMdxJsxTagClosingMarker, + mdxJsxTextTagNamePrimary: exitMdxJsxTagNamePrimary, + mdxJsxTextTagNameMember: exitMdxJsxTagNameMember, + mdxJsxTextTagNameLocal: exitMdxJsxTagNameLocal, + mdxJsxTextTagExpressionAttribute: exitMdxJsxTagExpressionAttribute, + mdxJsxTextTagExpressionAttributeValue: data2, + mdxJsxTextTagAttributeNamePrimary: exitMdxJsxTagAttributeNamePrimary, + mdxJsxTextTagAttributeNameLocal: exitMdxJsxTagAttributeNameLocal, + mdxJsxTextTagAttributeValueLiteral: exitMdxJsxTagAttributeValueLiteral, + mdxJsxTextTagAttributeValueLiteralValue: data2, + mdxJsxTextTagAttributeValueExpression: + exitMdxJsxTagAttributeValueExpression, + mdxJsxTextTagAttributeValueExpressionValue: data2, + mdxJsxTextTagSelfClosingMarker: exitMdxJsxTagSelfClosingMarker, + mdxJsxTextTag: exitMdxJsxTag, + }, + }; + function buffer2() { + this.buffer(); + } + function data2(token) { + this.config.enter.data.call(this, token); + this.config.exit.data.call(this, token); + } + function enterMdxJsxTag(token) { + const tag = { + name: null, + attributes: [], + start: token.start, + end: token.end, + }; + if (!this.getData('mdxJsxTagStack')) this.setData('mdxJsxTagStack', []); + this.setData('mdxJsxTag', tag); + this.buffer(); + } + function enterMdxJsxTagClosingMarker(token) { + const stack = this.getData('mdxJsxTagStack'); + if (stack.length === 0) { + throw new VFileMessage( + 'Unexpected closing slash `/` in tag, expected an open tag first', + {start: token.start, end: token.end}, + 'mdast-util-mdx-jsx:unexpected-closing-slash', + ); + } + } + function enterMdxJsxTagAnyAttribute(token) { + const tag = this.getData('mdxJsxTag'); + if (tag.close) { + throw new VFileMessage( + 'Unexpected attribute in closing tag, expected the end of the tag', + {start: token.start, end: token.end}, + 'mdast-util-mdx-jsx:unexpected-attribute', + ); + } + } + function enterMdxJsxTagSelfClosingMarker(token) { + const tag = this.getData('mdxJsxTag'); + if (tag.close) { + throw new VFileMessage( + 'Unexpected self-closing slash `/` in closing tag, expected the end of the tag', + {start: token.start, end: token.end}, + 'mdast-util-mdx-jsx:unexpected-self-closing-slash', + ); + } + } + function exitMdxJsxTagClosingMarker() { + const tag = this.getData('mdxJsxTag'); + tag.close = true; + } + function exitMdxJsxTagNamePrimary(token) { + const tag = this.getData('mdxJsxTag'); + tag.name = this.sliceSerialize(token); + } + function exitMdxJsxTagNameMember(token) { + const tag = this.getData('mdxJsxTag'); + tag.name += '.' + this.sliceSerialize(token); + } + function exitMdxJsxTagNameLocal(token) { + const tag = this.getData('mdxJsxTag'); + tag.name += ':' + this.sliceSerialize(token); + } + function enterMdxJsxTagAttribute(token) { + const tag = this.getData('mdxJsxTag'); + enterMdxJsxTagAnyAttribute.call(this, token); + tag.attributes.push({type: 'mdxJsxAttribute', name: '', value: null}); + } + function enterMdxJsxTagExpressionAttribute(token) { + const tag = this.getData('mdxJsxTag'); + enterMdxJsxTagAnyAttribute.call(this, token); + tag.attributes.push({type: 'mdxJsxExpressionAttribute', value: ''}); + this.buffer(); + } + function exitMdxJsxTagExpressionAttribute(token) { + const tag = this.getData('mdxJsxTag'); + const tail = tag.attributes[tag.attributes.length - 1]; + const estree = token.estree; + tail.value = this.resume(); + if (estree) { + tail.data = {estree}; + } + } + function exitMdxJsxTagAttributeNamePrimary(token) { + const tag = this.getData('mdxJsxTag'); + const node = tag.attributes[tag.attributes.length - 1]; + node.name = this.sliceSerialize(token); + } + function exitMdxJsxTagAttributeNameLocal(token) { + const tag = this.getData('mdxJsxTag'); + const node = tag.attributes[tag.attributes.length - 1]; + node.name += ':' + this.sliceSerialize(token); + } + function exitMdxJsxTagAttributeValueLiteral() { + const tag = this.getData('mdxJsxTag'); + tag.attributes[tag.attributes.length - 1].value = parseEntities( + this.resume(), + {nonTerminated: false}, + ); + } + function exitMdxJsxTagAttributeValueExpression(token) { + const tag = this.getData('mdxJsxTag'); + const tail = tag.attributes[tag.attributes.length - 1]; + const node = {type: 'mdxJsxAttributeValueExpression', value: this.resume()}; + const estree = token.estree; + if (estree) { + node.data = {estree}; + } + tail.value = node; + } + function exitMdxJsxTagSelfClosingMarker() { + const tag = this.getData('mdxJsxTag'); + tag.selfClosing = true; + } + function exitMdxJsxTag(token) { + const tag = this.getData('mdxJsxTag'); + const stack = this.getData('mdxJsxTagStack'); + const tail = stack[stack.length - 1]; + if (tag.close && tail.name !== tag.name) { + throw new VFileMessage( + 'Unexpected closing tag `' + + serializeAbbreviatedTag(tag) + + '`, expected corresponding closing tag for `' + + serializeAbbreviatedTag(tail) + + '` (' + + stringifyPosition(tail) + + ')', + {start: token.start, end: token.end}, + 'mdast-util-mdx-jsx:end-tag-mismatch', + ); + } + this.resume(); + if (tag.close) { + stack.pop(); + } else { + this.enter( + { + type: + token.type === 'mdxJsxTextTag' + ? 'mdxJsxTextElement' + : 'mdxJsxFlowElement', + name: tag.name, + attributes: tag.attributes, + children: [], + }, + token, + onErrorRightIsTag, + ); + } + if (tag.selfClosing || tag.close) { + this.exit(token, onErrorLeftIsTag); + } else { + stack.push(tag); + } + } + function onErrorRightIsTag(closing, open) { + const tag = this.getData('mdxJsxTag'); + const place = closing ? ' before the end of `' + closing.type + '`' : ''; + const position3 = closing + ? {start: closing.start, end: closing.end} + : void 0; + throw new VFileMessage( + 'Expected a closing tag for `' + + serializeAbbreviatedTag(tag) + + '` (' + + stringifyPosition({start: open.start, end: open.end}) + + ')' + + place, + position3, + 'mdast-util-mdx-jsx:end-tag-mismatch', + ); + } + function onErrorLeftIsTag(a, b) { + const tag = this.getData('mdxJsxTag'); + throw new VFileMessage( + 'Expected the closing tag `' + + serializeAbbreviatedTag(tag) + + '` either after the end of `' + + b.type + + '` (' + + stringifyPosition(b.end) + + ') or another opening tag after the start of `' + + b.type + + '` (' + + stringifyPosition(b.start) + + ')', + {start: a.start, end: a.end}, + 'mdast-util-mdx-jsx:end-tag-mismatch', + ); + } + function serializeAbbreviatedTag(tag) { + return '<' + (tag.close ? '/' : '') + (tag.name || '') + '>'; + } +} +function mdxJsxToMarkdown(options = {}) { + const { + quote = '"', + quoteSmart, + tightSelfClosing, + printWidth = Number.POSITIVE_INFINITY, + } = options; + const alternative = quote === '"' ? "'" : '"'; + if (quote !== '"' && quote !== "'") { + throw new Error( + 'Cannot serialize attribute values with `' + + quote + + '` for `options.quote`, expected `"`, or `\'`', + ); + } + mdxElement.peek = peekElement; + return { + handlers: { + mdxJsxFlowElement: mdxElement, + mdxJsxTextElement: mdxElement, + }, + unsafe: [ + {character: '<', inConstruct: ['phrasing']}, + {atBreak: true, character: '<'}, + ], + fences: true, + resourceLink: true, + }; + function mdxElement(node, _, context, safeOptions) { + const tracker = track(safeOptions); + const selfClosing = + node.name && (!node.children || node.children.length === 0); + const exit2 = context.enter(node.type); + let index2 = -1; + const serializedAttributes = []; + let value = tracker.move('<' + (node.name || '')); + if (node.attributes && node.attributes.length > 0) { + if (!node.name) { + throw new Error('Cannot serialize fragment w/ attributes'); + } + while (++index2 < node.attributes.length) { + const attribute = node.attributes[index2]; + let result; + if (attribute.type === 'mdxJsxExpressionAttribute') { + result = '{' + (attribute.value || '') + '}'; + } else { + if (!attribute.name) { + throw new Error('Cannot serialize attribute w/o name'); + } + const value2 = attribute.value; + const left = attribute.name; + let right = ''; + if (value2 === void 0 || value2 === null) { + } else if (typeof value2 === 'object') { + right = '{' + (value2.value || '') + '}'; + } else { + const appliedQuote = + quoteSmart && ccount(value2, quote) > ccount(value2, alternative) + ? alternative + : quote; + right = + appliedQuote + + stringifyEntitiesLight(value2, {subset: [appliedQuote]}) + + appliedQuote; + } + result = left + (right ? '=' : '') + right; + } + serializedAttributes.push(result); + } + } + let attributesOnTheirOwnLine = false; + const attributesOnOneLine = serializedAttributes.join(' '); + if ( + node.type === 'mdxJsxFlowElement' && + (/\r?\n|\r/.test(attributesOnOneLine) || + tracker.current().now.column + + attributesOnOneLine.length + + (selfClosing ? (tightSelfClosing ? 2 : 3) : 1) > + printWidth) + ) { + attributesOnTheirOwnLine = true; + } + if (attributesOnTheirOwnLine) { + value += tracker.move( + '\n' + indentLines(serializedAttributes.join('\n'), map), + ); + } else if (attributesOnOneLine) { + value += tracker.move(' ' + attributesOnOneLine); + } + if (attributesOnTheirOwnLine) { + value += tracker.move('\n'); + } + if (selfClosing) { + value += tracker.move( + (tightSelfClosing || attributesOnTheirOwnLine ? '' : ' ') + '/', + ); + } + value += tracker.move('>'); + if (node.children && node.children.length > 0) { + if (node.type === 'mdxJsxFlowElement') { + tracker.shift(2); + value += tracker.move('\n'); + value += tracker.move( + indentLines(containerFlow(node, context, tracker.current()), map), + ); + value += tracker.move('\n'); + } else { + value += tracker.move( + containerPhrasing(node, context, { + ...tracker.current(), + before: '<', + after: '>', + }), + ); + } + } + if (!selfClosing) { + value += tracker.move(''); + } + exit2(); + return value; + } + function map(line, _, blank) { + return (blank ? '' : ' ') + line; + } + function peekElement() { + return '<'; + } +} + +// node_modules/mdast-util-mdxjs-esm/index.js +var mdxjsEsmFromMarkdown = { + enter: {mdxjsEsm: enterMdxjsEsm}, + exit: {mdxjsEsm: exitMdxjsEsm, mdxjsEsmData: exitMdxjsEsmData}, +}; +var mdxjsEsmToMarkdown = {handlers: {mdxjsEsm: handleMdxjsEsm}}; +function enterMdxjsEsm(token) { + this.enter({type: 'mdxjsEsm', value: ''}, token); + this.buffer(); +} +function exitMdxjsEsm(token) { + const value = this.resume(); + const node = this.exit(token); + const estree = token.estree; + node.value = value; + if (estree) { + node.data = {estree}; + } +} +function exitMdxjsEsmData(token) { + this.config.enter.data.call(this, token); + this.config.exit.data.call(this, token); +} +function handleMdxjsEsm(node) { + return node.value || ''; +} + +// node_modules/mdast-util-mdx/index.js +function mdxFromMarkdown() { + return [ + mdxExpressionFromMarkdown, + mdxJsxFromMarkdown(), + mdxjsEsmFromMarkdown, + ]; +} +function mdxToMarkdown(options) { + return { + extensions: [ + mdxExpressionToMarkdown, + mdxJsxToMarkdown(options), + mdxjsEsmToMarkdown, + ], + }; +} + +// node_modules/remark-mdx/index.js +function remarkMdx(options = {}) { + const data2 = this.data(); + add('micromarkExtensions', mdxjs(options)); + add('fromMarkdownExtensions', mdxFromMarkdown()); + add('toMarkdownExtensions', mdxToMarkdown(options)); + function add(field, value) { + const list3 = data2[field] ? data2[field] : (data2[field] = []); + list3.push(value); + } +} + +// node_modules/mdast-util-to-string/index.js +function toString2(node, options) { + var {includeImageAlt = true} = options || {}; + return one(node, includeImageAlt); +} +function one(node, includeImageAlt) { + return ( + (node && + typeof node === 'object' && + (node.value || + (includeImageAlt ? node.alt : '') || + ('children' in node && all(node.children, includeImageAlt)) || + (Array.isArray(node) && all(node, includeImageAlt)))) || + '' + ); +} +function all(values, includeImageAlt) { + var result = []; + var index2 = -1; + while (++index2 < values.length) { + result[index2] = one(values[index2], includeImageAlt); + } + return result.join(''); +} + +// node_modules/micromark/lib/initialize/content.js +var content2 = { + tokenize: initializeContent, +}; +function initializeContent(effects) { + const contentStart = effects.attempt( + this.parser.constructs.contentInitial, + afterContentStartConstruct, + paragraphInitial, + ); + let previous2; + return contentStart; + function afterContentStartConstruct(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter('lineEnding'); + effects.consume(code2); + effects.exit('lineEnding'); + return factorySpace(effects, contentStart, 'linePrefix'); + } + function paragraphInitial(code2) { + effects.enter('paragraph'); + return lineStart(code2); + } + function lineStart(code2) { + const token = effects.enter('chunkText', { + contentType: 'text', + previous: previous2, + }); + if (previous2) { + previous2.next = token; + } + previous2 = token; + return data2(code2); + } + function data2(code2) { + if (code2 === null) { + effects.exit('chunkText'); + effects.exit('paragraph'); + effects.consume(code2); + return; + } + if (markdownLineEnding(code2)) { + effects.consume(code2); + effects.exit('chunkText'); + return lineStart; + } + effects.consume(code2); + return data2; + } +} + +// node_modules/micromark/lib/initialize/document.js +var document = { + tokenize: initializeDocument, +}; +var containerConstruct = { + tokenize: tokenizeContainer, +}; +function initializeDocument(effects) { + const self2 = this; + const stack = []; + let continued = 0; + let childFlow; + let childToken; + let lineStartOffset; + return start3; + function start3(code2) { + if (continued < stack.length) { + const item = stack[continued]; + self2.containerState = item[1]; + return effects.attempt( + item[0].continuation, + documentContinue, + checkNewContainers, + )(code2); + } + return checkNewContainers(code2); + } + function documentContinue(code2) { + continued++; + if (self2.containerState._closeFlow) { + self2.containerState._closeFlow = void 0; + if (childFlow) { + closeFlow(); + } + const indexBeforeExits = self2.events.length; + let indexBeforeFlow = indexBeforeExits; + let point3; + while (indexBeforeFlow--) { + if ( + self2.events[indexBeforeFlow][0] === 'exit' && + self2.events[indexBeforeFlow][1].type === 'chunkFlow' + ) { + point3 = self2.events[indexBeforeFlow][1].end; + break; + } + } + exitContainers(continued); + let index2 = indexBeforeExits; + while (index2 < self2.events.length) { + self2.events[index2][1].end = Object.assign({}, point3); + index2++; + } + splice( + self2.events, + indexBeforeFlow + 1, + 0, + self2.events.slice(indexBeforeExits), + ); + self2.events.length = index2; + return checkNewContainers(code2); + } + return start3(code2); + } + function checkNewContainers(code2) { + if (continued === stack.length) { + if (!childFlow) { + return documentContinued(code2); + } + if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { + return flowStart(code2); + } + self2.interrupt = Boolean( + childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack, + ); + } + self2.containerState = {}; + return effects.check( + containerConstruct, + thereIsANewContainer, + thereIsNoNewContainer, + )(code2); + } + function thereIsANewContainer(code2) { + if (childFlow) closeFlow(); + exitContainers(continued); + return documentContinued(code2); + } + function thereIsNoNewContainer(code2) { + self2.parser.lazy[self2.now().line] = continued !== stack.length; + lineStartOffset = self2.now().offset; + return flowStart(code2); + } + function documentContinued(code2) { + self2.containerState = {}; + return effects.attempt( + containerConstruct, + containerContinue, + flowStart, + )(code2); + } + function containerContinue(code2) { + continued++; + stack.push([self2.currentConstruct, self2.containerState]); + return documentContinued(code2); + } + function flowStart(code2) { + if (code2 === null) { + if (childFlow) closeFlow(); + exitContainers(0); + effects.consume(code2); + return; + } + childFlow = childFlow || self2.parser.flow(self2.now()); + effects.enter('chunkFlow', { + contentType: 'flow', + previous: childToken, + _tokenizer: childFlow, + }); + return flowContinue(code2); + } + function flowContinue(code2) { + if (code2 === null) { + writeToChild(effects.exit('chunkFlow'), true); + exitContainers(0); + effects.consume(code2); + return; + } + if (markdownLineEnding(code2)) { + effects.consume(code2); + writeToChild(effects.exit('chunkFlow')); + continued = 0; + self2.interrupt = void 0; + return start3; + } + effects.consume(code2); + return flowContinue; + } + function writeToChild(token, eof) { + const stream = self2.sliceStream(token); + if (eof) stream.push(null); + token.previous = childToken; + if (childToken) childToken.next = token; + childToken = token; + childFlow.defineSkip(token.start); + childFlow.write(stream); + if (self2.parser.lazy[token.start.line]) { + let index2 = childFlow.events.length; + while (index2--) { + if ( + childFlow.events[index2][1].start.offset < lineStartOffset && + (!childFlow.events[index2][1].end || + childFlow.events[index2][1].end.offset > lineStartOffset) + ) { + return; + } + } + const indexBeforeExits = self2.events.length; + let indexBeforeFlow = indexBeforeExits; + let seen; + let point3; + while (indexBeforeFlow--) { + if ( + self2.events[indexBeforeFlow][0] === 'exit' && + self2.events[indexBeforeFlow][1].type === 'chunkFlow' + ) { + if (seen) { + point3 = self2.events[indexBeforeFlow][1].end; + break; + } + seen = true; + } + } + exitContainers(continued); + index2 = indexBeforeExits; + while (index2 < self2.events.length) { + self2.events[index2][1].end = Object.assign({}, point3); + index2++; + } + splice( + self2.events, + indexBeforeFlow + 1, + 0, + self2.events.slice(indexBeforeExits), + ); + self2.events.length = index2; + } + } + function exitContainers(size) { + let index2 = stack.length; + while (index2-- > size) { + const entry = stack[index2]; + self2.containerState = entry[1]; + entry[0].exit.call(self2, effects); + } + stack.length = size; + } + function closeFlow() { + childFlow.write([null]); + childToken = void 0; + childFlow = void 0; + self2.containerState._closeFlow = void 0; + } +} +function tokenizeContainer(effects, ok2, nok) { + return factorySpace( + effects, + effects.attempt(this.parser.constructs.document, ok2, nok), + 'linePrefix', + this.parser.constructs.disable.null.includes('codeIndented') ? void 0 : 4, + ); +} + +// node_modules/micromark/lib/initialize/flow.js +var flow = { + tokenize: initializeFlow, +}; +function initializeFlow(effects) { + const self2 = this; + const initial = effects.attempt( + blankLine, + atBlankEnding, + effects.attempt( + this.parser.constructs.flowInitial, + afterConstruct, + factorySpace( + effects, + effects.attempt( + this.parser.constructs.flow, + afterConstruct, + effects.attempt(content, afterConstruct), + ), + 'linePrefix', + ), + ), + ); + return initial; + function atBlankEnding(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter('lineEndingBlank'); + effects.consume(code2); + effects.exit('lineEndingBlank'); + self2.currentConstruct = void 0; + return initial; + } + function afterConstruct(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter('lineEnding'); + effects.consume(code2); + effects.exit('lineEnding'); + self2.currentConstruct = void 0; + return initial; + } +} + +// node_modules/micromark/lib/initialize/text.js +var resolver = { + resolveAll: createResolver(), +}; +var string = initializeFactory('string'); +var text = initializeFactory('text'); +function initializeFactory(field) { + return { + tokenize: initializeText, + resolveAll: createResolver( + field === 'text' ? resolveAllLineSuffixes : void 0, + ), + }; + function initializeText(effects) { + const self2 = this; + const constructs2 = this.parser.constructs[field]; + const text5 = effects.attempt(constructs2, start3, notText); + return start3; + function start3(code2) { + return atBreak(code2) ? text5(code2) : notText(code2); + } + function notText(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter('data'); + effects.consume(code2); + return data2; + } + function data2(code2) { + if (atBreak(code2)) { + effects.exit('data'); + return text5(code2); + } + effects.consume(code2); + return data2; + } + function atBreak(code2) { + if (code2 === null) { + return true; + } + const list3 = constructs2[code2]; + let index2 = -1; + if (list3) { + while (++index2 < list3.length) { + const item = list3[index2]; + if (!item.previous || item.previous.call(self2, self2.previous)) { + return true; + } + } + } + return false; + } + } +} +function createResolver(extraResolver) { + return resolveAllText; + function resolveAllText(events, context) { + let index2 = -1; + let enter; + while (++index2 <= events.length) { + if (enter === void 0) { + if (events[index2] && events[index2][1].type === 'data') { + enter = index2; + index2++; + } + } else if (!events[index2] || events[index2][1].type !== 'data') { + if (index2 !== enter + 2) { + events[enter][1].end = events[index2 - 1][1].end; + events.splice(enter + 2, index2 - enter - 2); + index2 = enter + 2; + } + enter = void 0; + } + } + return extraResolver ? extraResolver(events, context) : events; + } +} +function resolveAllLineSuffixes(events, context) { + let eventIndex = 0; + while (++eventIndex <= events.length) { + if ( + (eventIndex === events.length || + events[eventIndex][1].type === 'lineEnding') && + events[eventIndex - 1][1].type === 'data' + ) { + const data2 = events[eventIndex - 1][1]; + const chunks = context.sliceStream(data2); + let index2 = chunks.length; + let bufferIndex = -1; + let size = 0; + let tabs; + while (index2--) { + const chunk = chunks[index2]; + if (typeof chunk === 'string') { + bufferIndex = chunk.length; + while (chunk.charCodeAt(bufferIndex - 1) === 32) { + size++; + bufferIndex--; + } + if (bufferIndex) break; + bufferIndex = -1; + } else if (chunk === -2) { + tabs = true; + size++; + } else if (chunk === -1) { + } else { + index2++; + break; + } + } + if (size) { + const token = { + type: + eventIndex === events.length || tabs || size < 2 + ? 'lineSuffix' + : 'hardBreakTrailing', + start: { + line: data2.end.line, + column: data2.end.column - size, + offset: data2.end.offset - size, + _index: data2.start._index + index2, + _bufferIndex: index2 + ? bufferIndex + : data2.start._bufferIndex + bufferIndex, + }, + end: Object.assign({}, data2.end), + }; + data2.end = Object.assign({}, token.start); + if (data2.start.offset === data2.end.offset) { + Object.assign(data2, token); + } else { + events.splice( + eventIndex, + 0, + ['enter', token, context], + ['exit', token, context], + ); + eventIndex += 2; + } + } + eventIndex++; + } + } + return events; +} + +// node_modules/micromark/lib/create-tokenizer.js +function createTokenizer(parser, initialize, from) { + let point3 = Object.assign( + from + ? Object.assign({}, from) + : { + line: 1, + column: 1, + offset: 0, + }, + { + _index: 0, + _bufferIndex: -1, + }, + ); + const columnStart = {}; + const resolveAllConstructs = []; + let chunks = []; + let stack = []; + let consumed = true; + const effects = { + consume, + enter, + exit: exit2, + attempt: constructFactory(onsuccessfulconstruct), + check: constructFactory(onsuccessfulcheck), + interrupt: constructFactory(onsuccessfulcheck, { + interrupt: true, + }), + }; + const context = { + previous: null, + code: null, + containerState: {}, + events: [], + parser, + sliceStream, + sliceSerialize, + now, + defineSkip, + write, + }; + let state = initialize.tokenize.call(context, effects); + let expectedCode; + if (initialize.resolveAll) { + resolveAllConstructs.push(initialize); + } + return context; + function write(slice2) { + chunks = push(chunks, slice2); + main(); + if (chunks[chunks.length - 1] !== null) { + return []; + } + addResult(initialize, 0); + context.events = resolveAll(resolveAllConstructs, context.events, context); + return context.events; + } + function sliceSerialize(token, expandTabs) { + return serializeChunks(sliceStream(token), expandTabs); + } + function sliceStream(token) { + return sliceChunks(chunks, token); + } + function now() { + return Object.assign({}, point3); + } + function defineSkip(value) { + columnStart[value.line] = value.column; + accountForPotentialSkip(); + } + function main() { + let chunkIndex; + while (point3._index < chunks.length) { + const chunk = chunks[point3._index]; + if (typeof chunk === 'string') { + chunkIndex = point3._index; + if (point3._bufferIndex < 0) { + point3._bufferIndex = 0; + } + while ( + point3._index === chunkIndex && + point3._bufferIndex < chunk.length + ) { + go(chunk.charCodeAt(point3._bufferIndex)); + } + } else { + go(chunk); + } + } + } + function go(code2) { + consumed = void 0; + expectedCode = code2; + state = state(code2); + } + function consume(code2) { + if (markdownLineEnding(code2)) { + point3.line++; + point3.column = 1; + point3.offset += code2 === -3 ? 2 : 1; + accountForPotentialSkip(); + } else if (code2 !== -1) { + point3.column++; + point3.offset++; + } + if (point3._bufferIndex < 0) { + point3._index++; + } else { + point3._bufferIndex++; + if (point3._bufferIndex === chunks[point3._index].length) { + point3._bufferIndex = -1; + point3._index++; + } + } + context.previous = code2; + consumed = true; + } + function enter(type, fields) { + const token = fields || {}; + token.type = type; + token.start = now(); + context.events.push(['enter', token, context]); + stack.push(token); + return token; + } + function exit2(type) { + const token = stack.pop(); + token.end = now(); + context.events.push(['exit', token, context]); + return token; + } + function onsuccessfulconstruct(construct, info) { + addResult(construct, info.from); + } + function onsuccessfulcheck(_, info) { + info.restore(); + } + function constructFactory(onreturn, fields) { + return hook; + function hook(constructs2, returnState, bogusState) { + let listOfConstructs; + let constructIndex; + let currentConstruct; + let info; + return Array.isArray(constructs2) + ? handleListOfConstructs(constructs2) + : 'tokenize' in constructs2 + ? handleListOfConstructs([constructs2]) + : handleMapOfConstructs(constructs2); + function handleMapOfConstructs(map) { + return start3; + function start3(code2) { + const def = code2 !== null && map[code2]; + const all4 = code2 !== null && map.null; + const list3 = [ + ...(Array.isArray(def) ? def : def ? [def] : []), + ...(Array.isArray(all4) ? all4 : all4 ? [all4] : []), + ]; + return handleListOfConstructs(list3)(code2); + } + } + function handleListOfConstructs(list3) { + listOfConstructs = list3; + constructIndex = 0; + if (list3.length === 0) { + return bogusState; + } + return handleConstruct(list3[constructIndex]); + } + function handleConstruct(construct) { + return start3; + function start3(code2) { + info = store(); + currentConstruct = construct; + if (!construct.partial) { + context.currentConstruct = construct; + } + if ( + construct.name && + context.parser.constructs.disable.null.includes(construct.name) + ) { + return nok(code2); + } + return construct.tokenize.call( + fields ? Object.assign(Object.create(context), fields) : context, + effects, + ok2, + nok, + )(code2); + } + } + function ok2(code2) { + consumed = true; + onreturn(currentConstruct, info); + return returnState; + } + function nok(code2) { + consumed = true; + info.restore(); + if (++constructIndex < listOfConstructs.length) { + return handleConstruct(listOfConstructs[constructIndex]); + } + return bogusState; + } + } + } + function addResult(construct, from2) { + if (construct.resolveAll && !resolveAllConstructs.includes(construct)) { + resolveAllConstructs.push(construct); + } + if (construct.resolve) { + splice( + context.events, + from2, + context.events.length - from2, + construct.resolve(context.events.slice(from2), context), + ); + } + if (construct.resolveTo) { + context.events = construct.resolveTo(context.events, context); + } + } + function store() { + const startPoint = now(); + const startPrevious = context.previous; + const startCurrentConstruct = context.currentConstruct; + const startEventsIndex = context.events.length; + const startStack = Array.from(stack); + return { + restore, + from: startEventsIndex, + }; + function restore() { + point3 = startPoint; + context.previous = startPrevious; + context.currentConstruct = startCurrentConstruct; + context.events.length = startEventsIndex; + stack = startStack; + accountForPotentialSkip(); + } + } + function accountForPotentialSkip() { + if (point3.line in columnStart && point3.column < 2) { + point3.column = columnStart[point3.line]; + point3.offset += columnStart[point3.line] - 1; + } + } +} +function sliceChunks(chunks, token) { + const startIndex = token.start._index; + const startBufferIndex = token.start._bufferIndex; + const endIndex = token.end._index; + const endBufferIndex = token.end._bufferIndex; + let view; + if (startIndex === endIndex) { + view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]; + } else { + view = chunks.slice(startIndex, endIndex); + if (startBufferIndex > -1) { + view[0] = view[0].slice(startBufferIndex); + } + if (endBufferIndex > 0) { + view.push(chunks[endIndex].slice(0, endBufferIndex)); + } + } + return view; +} +function serializeChunks(chunks, expandTabs) { + let index2 = -1; + const result = []; + let atTab; + while (++index2 < chunks.length) { + const chunk = chunks[index2]; + let value; + if (typeof chunk === 'string') { + value = chunk; + } else + switch (chunk) { + case -5: { + value = '\r'; + break; + } + case -4: { + value = '\n'; + break; + } + case -3: { + value = '\r\n'; + break; + } + case -2: { + value = expandTabs ? ' ' : ' '; + break; + } + case -1: { + if (!expandTabs && atTab) continue; + value = ' '; + break; + } + default: { + value = String.fromCharCode(chunk); + } + } + atTab = chunk === -2; + result.push(value); + } + return result.join(''); +} + +// node_modules/micromark/lib/constructs.js +var constructs_exports = {}; +__export(constructs_exports, { + attentionMarkers: () => attentionMarkers, + contentInitial: () => contentInitial, + disable: () => disable, + document: () => document2, + flow: () => flow2, + flowInitial: () => flowInitial, + insideSpan: () => insideSpan, + string: () => string2, + text: () => text2, +}); +var document2 = { + [42]: list, + [43]: list, + [45]: list, + [48]: list, + [49]: list, + [50]: list, + [51]: list, + [52]: list, + [53]: list, + [54]: list, + [55]: list, + [56]: list, + [57]: list, + [62]: blockQuote, +}; +var contentInitial = { + [91]: definition, +}; +var flowInitial = { + [-2]: codeIndented, + [-1]: codeIndented, + [32]: codeIndented, +}; +var flow2 = { + [35]: headingAtx, + [42]: thematicBreak, + [45]: [setextUnderline, thematicBreak], + [60]: htmlFlow, + [61]: setextUnderline, + [95]: thematicBreak, + [96]: codeFenced, + [126]: codeFenced, +}; +var string2 = { + [38]: characterReference, + [92]: characterEscape, +}; +var text2 = { + [-5]: lineEnding, + [-4]: lineEnding, + [-3]: lineEnding, + [33]: labelStartImage, + [38]: characterReference, + [42]: attention, + [60]: [autolink, htmlText], + [91]: labelStartLink, + [92]: [hardBreakEscape, characterEscape], + [93]: labelEnd, + [95]: attention, + [96]: codeText, +}; +var insideSpan = { + null: [attention, resolver], +}; +var attentionMarkers = { + null: [42, 95], +}; +var disable = { + null: [], +}; + +// node_modules/micromark/lib/parse.js +function parse3(options = {}) { + const constructs2 = combineExtensions( + [constructs_exports].concat(options.extensions || []), + ); + const parser = { + defined: [], + lazy: {}, + constructs: constructs2, + content: create5(content2), + document: create5(document), + flow: create5(flow), + string: create5(string), + text: create5(text), + }; + return parser; + function create5(initial) { + return creator; + function creator(from) { + return createTokenizer(parser, initial, from); + } + } +} + +// node_modules/micromark/lib/preprocess.js +var search = /[\0\t\n\r]/g; +function preprocess() { + let column = 1; + let buffer2 = ''; + let start3 = true; + let atCarriageReturn; + return preprocessor; + function preprocessor(value, encoding, end) { + const chunks = []; + let match; + let next; + let startPosition; + let endPosition; + let code2; + value = buffer2 + value.toString(encoding); + startPosition = 0; + buffer2 = ''; + if (start3) { + if (value.charCodeAt(0) === 65279) { + startPosition++; + } + start3 = void 0; + } + while (startPosition < value.length) { + search.lastIndex = startPosition; + match = search.exec(value); + endPosition = + match && match.index !== void 0 ? match.index : value.length; + code2 = value.charCodeAt(endPosition); + if (!match) { + buffer2 = value.slice(startPosition); + break; + } + if (code2 === 10 && startPosition === endPosition && atCarriageReturn) { + chunks.push(-3); + atCarriageReturn = void 0; + } else { + if (atCarriageReturn) { + chunks.push(-5); + atCarriageReturn = void 0; + } + if (startPosition < endPosition) { + chunks.push(value.slice(startPosition, endPosition)); + column += endPosition - startPosition; + } + switch (code2) { + case 0: { + chunks.push(65533); + column++; + break; + } + case 9: { + next = Math.ceil(column / 4) * 4; + chunks.push(-2); + while (column++ < next) chunks.push(-1); + break; + } + case 10: { + chunks.push(-4); + column = 1; + break; + } + default: { + atCarriageReturn = true; + column = 1; + } + } + } + startPosition = endPosition + 1; + } + if (end) { + if (atCarriageReturn) chunks.push(-5); + if (buffer2) chunks.push(buffer2); + chunks.push(null); + } + return chunks; + } +} + +// node_modules/micromark/lib/postprocess.js +function postprocess(events) { + while (!subtokenize(events)) {} + return events; +} + +// node_modules/micromark-util-decode-numeric-character-reference/index.js +function decodeNumericCharacterReference(value, base2) { + const code2 = Number.parseInt(value, base2); + if ( + code2 < 9 || + code2 === 11 || + (code2 > 13 && code2 < 32) || + (code2 > 126 && code2 < 160) || + (code2 > 55295 && code2 < 57344) || + (code2 > 64975 && code2 < 65008) || + (code2 & 65535) === 65535 || + (code2 & 65535) === 65534 || + code2 > 1114111 + ) { + return '\uFFFD'; + } + return String.fromCharCode(code2); +} + +// node_modules/micromark-util-decode-string/index.js +var characterEscapeOrReference = + /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi; +function decodeString(value) { + return value.replace(characterEscapeOrReference, decode); +} +function decode($0, $1, $2) { + if ($1) { + return $1; + } + const head = $2.charCodeAt(0); + if (head === 35) { + const head2 = $2.charCodeAt(1); + const hex = head2 === 120 || head2 === 88; + return decodeNumericCharacterReference( + $2.slice(hex ? 2 : 1), + hex ? 16 : 10, + ); + } + return decodeNamedCharacterReference($2) || $0; +} + +// node_modules/mdast-util-from-markdown/lib/index.js +var own4 = {}.hasOwnProperty; +var fromMarkdown = function (value, encoding, options) { + if (typeof encoding !== 'string') { + options = encoding; + encoding = void 0; + } + return compiler(options)( + postprocess( + parse3(options).document().write(preprocess()(value, encoding, true)), + ), + ); +}; +function compiler(options = {}) { + const config = configure( + { + transforms: [], + canContainEols: [ + 'emphasis', + 'fragment', + 'heading', + 'paragraph', + 'strong', + ], + enter: { + autolink: opener(link2), + autolinkProtocol: onenterdata, + autolinkEmail: onenterdata, + atxHeading: opener(heading2), + blockQuote: opener(blockQuote2), + characterEscape: onenterdata, + characterReference: onenterdata, + codeFenced: opener(codeFlow), + codeFencedFenceInfo: buffer2, + codeFencedFenceMeta: buffer2, + codeIndented: opener(codeFlow, buffer2), + codeText: opener(codeText2, buffer2), + codeTextData: onenterdata, + data: onenterdata, + codeFlowValue: onenterdata, + definition: opener(definition2), + definitionDestinationString: buffer2, + definitionLabelString: buffer2, + definitionTitleString: buffer2, + emphasis: opener(emphasis2), + hardBreakEscape: opener(hardBreak2), + hardBreakTrailing: opener(hardBreak2), + htmlFlow: opener(html4, buffer2), + htmlFlowData: onenterdata, + htmlText: opener(html4, buffer2), + htmlTextData: onenterdata, + image: opener(image2), + label: buffer2, + link: opener(link2), + listItem: opener(listItem2), + listItemValue: onenterlistitemvalue, + listOrdered: opener(list3, onenterlistordered), + listUnordered: opener(list3), + paragraph: opener(paragraph2), + reference: onenterreference, + referenceString: buffer2, + resourceDestinationString: buffer2, + resourceTitleString: buffer2, + setextHeading: opener(heading2), + strong: opener(strong2), + thematicBreak: opener(thematicBreak3), + }, + exit: { + atxHeading: closer(), + atxHeadingSequence: onexitatxheadingsequence, + autolink: closer(), + autolinkEmail: onexitautolinkemail, + autolinkProtocol: onexitautolinkprotocol, + blockQuote: closer(), + characterEscapeValue: onexitdata, + characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, + characterReferenceMarkerNumeric: onexitcharacterreferencemarker, + characterReferenceValue: onexitcharacterreferencevalue, + codeFenced: closer(onexitcodefenced), + codeFencedFence: onexitcodefencedfence, + codeFencedFenceInfo: onexitcodefencedfenceinfo, + codeFencedFenceMeta: onexitcodefencedfencemeta, + codeFlowValue: onexitdata, + codeIndented: closer(onexitcodeindented), + codeText: closer(onexitcodetext), + codeTextData: onexitdata, + data: onexitdata, + definition: closer(), + definitionDestinationString: onexitdefinitiondestinationstring, + definitionLabelString: onexitdefinitionlabelstring, + definitionTitleString: onexitdefinitiontitlestring, + emphasis: closer(), + hardBreakEscape: closer(onexithardbreak), + hardBreakTrailing: closer(onexithardbreak), + htmlFlow: closer(onexithtmlflow), + htmlFlowData: onexitdata, + htmlText: closer(onexithtmltext), + htmlTextData: onexitdata, + image: closer(onexitimage), + label: onexitlabel, + labelText: onexitlabeltext, + lineEnding: onexitlineending, + link: closer(onexitlink), + listItem: closer(), + listOrdered: closer(), + listUnordered: closer(), + paragraph: closer(), + referenceString: onexitreferencestring, + resourceDestinationString: onexitresourcedestinationstring, + resourceTitleString: onexitresourcetitlestring, + resource: onexitresource, + setextHeading: closer(onexitsetextheading), + setextHeadingLineSequence: onexitsetextheadinglinesequence, + setextHeadingText: onexitsetextheadingtext, + strong: closer(), + thematicBreak: closer(), + }, + }, + options.mdastExtensions || [], + ); + const data2 = {}; + return compile2; + function compile2(events) { + let tree = { + type: 'root', + children: [], + }; + const stack = [tree]; + const tokenStack = []; + const listStack = []; + const context = { + stack, + tokenStack, + config, + enter, + exit: exit2, + buffer: buffer2, + resume, + setData, + getData, + }; + let index2 = -1; + while (++index2 < events.length) { + if ( + events[index2][1].type === 'listOrdered' || + events[index2][1].type === 'listUnordered' + ) { + if (events[index2][0] === 'enter') { + listStack.push(index2); + } else { + const tail = listStack.pop(); + index2 = prepareList(events, tail, index2); + } + } + } + index2 = -1; + while (++index2 < events.length) { + const handler = config[events[index2][0]]; + if (own4.call(handler, events[index2][1].type)) { + handler[events[index2][1].type].call( + Object.assign( + { + sliceSerialize: events[index2][2].sliceSerialize, + }, + context, + ), + events[index2][1], + ); + } + } + if (tokenStack.length > 0) { + const tail = tokenStack[tokenStack.length - 1]; + const handler = tail[1] || defaultOnError; + handler.call(context, void 0, tail[0]); + } + tree.position = { + start: point3( + events.length > 0 + ? events[0][1].start + : { + line: 1, + column: 1, + offset: 0, + }, + ), + end: point3( + events.length > 0 + ? events[events.length - 2][1].end + : { + line: 1, + column: 1, + offset: 0, + }, + ), + }; + index2 = -1; + while (++index2 < config.transforms.length) { + tree = config.transforms[index2](tree) || tree; + } + return tree; + } + function prepareList(events, start3, length) { + let index2 = start3 - 1; + let containerBalance = -1; + let listSpread = false; + let listItem3; + let lineIndex; + let firstBlankLineIndex; + let atMarker; + while (++index2 <= length) { + const event = events[index2]; + if ( + event[1].type === 'listUnordered' || + event[1].type === 'listOrdered' || + event[1].type === 'blockQuote' + ) { + if (event[0] === 'enter') { + containerBalance++; + } else { + containerBalance--; + } + atMarker = void 0; + } else if (event[1].type === 'lineEndingBlank') { + if (event[0] === 'enter') { + if ( + listItem3 && + !atMarker && + !containerBalance && + !firstBlankLineIndex + ) { + firstBlankLineIndex = index2; + } + atMarker = void 0; + } + } else if ( + event[1].type === 'linePrefix' || + event[1].type === 'listItemValue' || + event[1].type === 'listItemMarker' || + event[1].type === 'listItemPrefix' || + event[1].type === 'listItemPrefixWhitespace' + ) { + } else { + atMarker = void 0; + } + if ( + (!containerBalance && + event[0] === 'enter' && + event[1].type === 'listItemPrefix') || + (containerBalance === -1 && + event[0] === 'exit' && + (event[1].type === 'listUnordered' || + event[1].type === 'listOrdered')) + ) { + if (listItem3) { + let tailIndex = index2; + lineIndex = void 0; + while (tailIndex--) { + const tailEvent = events[tailIndex]; + if ( + tailEvent[1].type === 'lineEnding' || + tailEvent[1].type === 'lineEndingBlank' + ) { + if (tailEvent[0] === 'exit') continue; + if (lineIndex) { + events[lineIndex][1].type = 'lineEndingBlank'; + listSpread = true; + } + tailEvent[1].type = 'lineEnding'; + lineIndex = tailIndex; + } else if ( + tailEvent[1].type === 'linePrefix' || + tailEvent[1].type === 'blockQuotePrefix' || + tailEvent[1].type === 'blockQuotePrefixWhitespace' || + tailEvent[1].type === 'blockQuoteMarker' || + tailEvent[1].type === 'listItemIndent' + ) { + } else { + break; + } + } + if ( + firstBlankLineIndex && + (!lineIndex || firstBlankLineIndex < lineIndex) + ) { + listItem3._spread = true; + } + listItem3.end = Object.assign( + {}, + lineIndex ? events[lineIndex][1].start : event[1].end, + ); + events.splice(lineIndex || index2, 0, ['exit', listItem3, event[2]]); + index2++; + length++; + } + if (event[1].type === 'listItemPrefix') { + listItem3 = { + type: 'listItem', + _spread: false, + start: Object.assign({}, event[1].start), + }; + events.splice(index2, 0, ['enter', listItem3, event[2]]); + index2++; + length++; + firstBlankLineIndex = void 0; + atMarker = true; + } + } + } + events[start3][1]._spread = listSpread; + return length; + } + function setData(key, value) { + data2[key] = value; + } + function getData(key) { + return data2[key]; + } + function point3(d) { + return { + line: d.line, + column: d.column, + offset: d.offset, + }; + } + function opener(create5, and) { + return open; + function open(token) { + enter.call(this, create5(token), token); + if (and) and.call(this, token); + } + } + function buffer2() { + this.stack.push({ + type: 'fragment', + children: [], + }); + } + function enter(node, token, errorHandler) { + const parent = this.stack[this.stack.length - 1]; + parent.children.push(node); + this.stack.push(node); + this.tokenStack.push([token, errorHandler]); + node.position = { + start: point3(token.start), + }; + return node; + } + function closer(and) { + return close; + function close(token) { + if (and) and.call(this, token); + exit2.call(this, token); + } + } + function exit2(token, onExitError) { + const node = this.stack.pop(); + const open = this.tokenStack.pop(); + if (!open) { + throw new Error( + 'Cannot close `' + + token.type + + '` (' + + stringifyPosition({ + start: token.start, + end: token.end, + }) + + '): it\u2019s not open', + ); + } else if (open[0].type !== token.type) { + if (onExitError) { + onExitError.call(this, token, open[0]); + } else { + const handler = open[1] || defaultOnError; + handler.call(this, token, open[0]); + } + } + node.position.end = point3(token.end); + return node; + } + function resume() { + return toString2(this.stack.pop()); + } + function onenterlistordered() { + setData('expectingFirstListItemValue', true); + } + function onenterlistitemvalue(token) { + if (getData('expectingFirstListItemValue')) { + const ancestor = this.stack[this.stack.length - 2]; + ancestor.start = Number.parseInt(this.sliceSerialize(token), 10); + setData('expectingFirstListItemValue'); + } + } + function onexitcodefencedfenceinfo() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.lang = data3; + } + function onexitcodefencedfencemeta() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.meta = data3; + } + function onexitcodefencedfence() { + if (getData('flowCodeInside')) return; + this.buffer(); + setData('flowCodeInside', true); + } + function onexitcodefenced() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data3.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ''); + setData('flowCodeInside'); + } + function onexitcodeindented() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data3.replace(/(\r?\n|\r)$/g, ''); + } + function onexitdefinitionlabelstring(token) { + const label = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.label = label; + node.identifier = normalizeIdentifier( + this.sliceSerialize(token), + ).toLowerCase(); + } + function onexitdefinitiontitlestring() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.title = data3; + } + function onexitdefinitiondestinationstring() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.url = data3; + } + function onexitatxheadingsequence(token) { + const node = this.stack[this.stack.length - 1]; + if (!node.depth) { + const depth = this.sliceSerialize(token).length; + node.depth = depth; + } + } + function onexitsetextheadingtext() { + setData('setextHeadingSlurpLineEnding', true); + } + function onexitsetextheadinglinesequence(token) { + const node = this.stack[this.stack.length - 1]; + node.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2; + } + function onexitsetextheading() { + setData('setextHeadingSlurpLineEnding'); + } + function onenterdata(token) { + const parent = this.stack[this.stack.length - 1]; + let tail = parent.children[parent.children.length - 1]; + if (!tail || tail.type !== 'text') { + tail = text5(); + tail.position = { + start: point3(token.start), + }; + parent.children.push(tail); + } + this.stack.push(tail); + } + function onexitdata(token) { + const tail = this.stack.pop(); + tail.value += this.sliceSerialize(token); + tail.position.end = point3(token.end); + } + function onexitlineending(token) { + const context = this.stack[this.stack.length - 1]; + if (getData('atHardBreak')) { + const tail = context.children[context.children.length - 1]; + tail.position.end = point3(token.end); + setData('atHardBreak'); + return; + } + if ( + !getData('setextHeadingSlurpLineEnding') && + config.canContainEols.includes(context.type) + ) { + onenterdata.call(this, token); + onexitdata.call(this, token); + } + } + function onexithardbreak() { + setData('atHardBreak', true); + } + function onexithtmlflow() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data3; + } + function onexithtmltext() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data3; + } + function onexitcodetext() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data3; + } + function onexitlink() { + const context = this.stack[this.stack.length - 1]; + if (getData('inReference')) { + context.type += 'Reference'; + context.referenceType = getData('referenceType') || 'shortcut'; + delete context.url; + delete context.title; + } else { + delete context.identifier; + delete context.label; + } + setData('referenceType'); + } + function onexitimage() { + const context = this.stack[this.stack.length - 1]; + if (getData('inReference')) { + context.type += 'Reference'; + context.referenceType = getData('referenceType') || 'shortcut'; + delete context.url; + delete context.title; + } else { + delete context.identifier; + delete context.label; + } + setData('referenceType'); + } + function onexitlabeltext(token) { + const ancestor = this.stack[this.stack.length - 2]; + const string3 = this.sliceSerialize(token); + ancestor.label = decodeString(string3); + ancestor.identifier = normalizeIdentifier(string3).toLowerCase(); + } + function onexitlabel() { + const fragment = this.stack[this.stack.length - 1]; + const value = this.resume(); + const node = this.stack[this.stack.length - 1]; + setData('inReference', true); + if (node.type === 'link') { + node.children = fragment.children; + } else { + node.alt = value; + } + } + function onexitresourcedestinationstring() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.url = data3; + } + function onexitresourcetitlestring() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.title = data3; + } + function onexitresource() { + setData('inReference'); + } + function onenterreference() { + setData('referenceType', 'collapsed'); + } + function onexitreferencestring(token) { + const label = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.label = label; + node.identifier = normalizeIdentifier( + this.sliceSerialize(token), + ).toLowerCase(); + setData('referenceType', 'full'); + } + function onexitcharacterreferencemarker(token) { + setData('characterReferenceType', token.type); + } + function onexitcharacterreferencevalue(token) { + const data3 = this.sliceSerialize(token); + const type = getData('characterReferenceType'); + let value; + if (type) { + value = decodeNumericCharacterReference( + data3, + type === 'characterReferenceMarkerNumeric' ? 10 : 16, + ); + setData('characterReferenceType'); + } else { + value = decodeNamedCharacterReference(data3); + } + const tail = this.stack.pop(); + tail.value += value; + tail.position.end = point3(token.end); + } + function onexitautolinkprotocol(token) { + onexitdata.call(this, token); + const node = this.stack[this.stack.length - 1]; + node.url = this.sliceSerialize(token); + } + function onexitautolinkemail(token) { + onexitdata.call(this, token); + const node = this.stack[this.stack.length - 1]; + node.url = 'mailto:' + this.sliceSerialize(token); + } + function blockQuote2() { + return { + type: 'blockquote', + children: [], + }; + } + function codeFlow() { + return { + type: 'code', + lang: null, + meta: null, + value: '', + }; + } + function codeText2() { + return { + type: 'inlineCode', + value: '', + }; + } + function definition2() { + return { + type: 'definition', + identifier: '', + label: null, + title: null, + url: '', + }; + } + function emphasis2() { + return { + type: 'emphasis', + children: [], + }; + } + function heading2() { + return { + type: 'heading', + depth: void 0, + children: [], + }; + } + function hardBreak2() { + return { + type: 'break', + }; + } + function html4() { + return { + type: 'html', + value: '', + }; + } + function image2() { + return { + type: 'image', + title: null, + url: '', + alt: null, + }; + } + function link2() { + return { + type: 'link', + title: null, + url: '', + children: [], + }; + } + function list3(token) { + return { + type: 'list', + ordered: token.type === 'listOrdered', + start: null, + spread: token._spread, + children: [], + }; + } + function listItem2(token) { + return { + type: 'listItem', + spread: token._spread, + checked: null, + children: [], + }; + } + function paragraph2() { + return { + type: 'paragraph', + children: [], + }; + } + function strong2() { + return { + type: 'strong', + children: [], + }; + } + function text5() { + return { + type: 'text', + value: '', + }; + } + function thematicBreak3() { + return { + type: 'thematicBreak', + }; + } +} +function configure(combined, extensions) { + let index2 = -1; + while (++index2 < extensions.length) { + const value = extensions[index2]; + if (Array.isArray(value)) { + configure(combined, value); + } else { + extension(combined, value); + } + } + return combined; +} +function extension(combined, extension2) { + let key; + for (key in extension2) { + if (own4.call(extension2, key)) { + const list3 = key === 'canContainEols' || key === 'transforms'; + const maybe = own4.call(combined, key) ? combined[key] : void 0; + const left = maybe || (combined[key] = list3 ? [] : {}); + const right = extension2[key]; + if (right) { + if (list3) { + combined[key] = [...left, ...right]; + } else { + Object.assign(left, right); + } + } + } + } +} +function defaultOnError(left, right) { + if (left) { + throw new Error( + 'Cannot close `' + + left.type + + '` (' + + stringifyPosition({ + start: left.start, + end: left.end, + }) + + '): a different token (`' + + right.type + + '`, ' + + stringifyPosition({ + start: right.start, + end: right.end, + }) + + ') is open', + ); + } else { + throw new Error( + 'Cannot close document, a token (`' + + right.type + + '`, ' + + stringifyPosition({ + start: right.start, + end: right.end, + }) + + ') is still open', + ); + } +} + +// node_modules/@mdx-js/mdx/node_modules/remark-parse/lib/index.js +function remarkParse(options) { + const parser = (doc) => { + const settings = this.data('settings'); + return fromMarkdown( + doc, + Object.assign({}, settings, options, { + extensions: this.data('micromarkExtensions') || [], + mdastExtensions: this.data('fromMarkdownExtensions') || [], + }), + ); + }; + Object.assign(this, {Parser: parser}); +} + +// node_modules/@mdx-js/mdx/node_modules/remark-parse/index.js +var remark_parse_default = remarkParse; + +// node_modules/@mdx-js/mdx/node_modules/unist-builder/index.js +var u = function (type, props, value) { + var node = {type: String(type)}; + if ( + (value === void 0 || value === null) && + (typeof props === 'string' || Array.isArray(props)) + ) { + value = props; + } else { + Object.assign(node, props); + } + if (Array.isArray(value)) { + node.children = value; + } else if (value !== void 0 && value !== null) { + node.value = String(value); + } + return node; +}; + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/traverse.js +var own5 = {}.hasOwnProperty; +function unknown(h, node) { + const data2 = node.data || {}; + if ( + 'value' in node && + !( + own5.call(data2, 'hName') || + own5.call(data2, 'hProperties') || + own5.call(data2, 'hChildren') + ) + ) { + return h.augment(node, u('text', node.value)); + } + return h(node, 'div', all2(h, node)); +} +function one2(h, node, parent) { + const type = node && node.type; + let fn; + if (!type) { + throw new Error('Expected node, got `' + node + '`'); + } + if (own5.call(h.handlers, type)) { + fn = h.handlers[type]; + } else if (h.passThrough && h.passThrough.includes(type)) { + fn = returnNode; + } else { + fn = h.unknownHandler; + } + return (typeof fn === 'function' ? fn : unknown)(h, node, parent); +} +function returnNode(h, node) { + return 'children' in node ? {...node, children: all2(h, node)} : node; +} +function all2(h, parent) { + const values = []; + if ('children' in parent) { + const nodes = parent.children; + let index2 = -1; + while (++index2 < nodes.length) { + const result = one2(h, nodes[index2], parent); + if (result) { + if (index2 && nodes[index2 - 1].type === 'break') { + if (!Array.isArray(result) && result.type === 'text') { + result.value = result.value.replace(/^\s+/, ''); + } + if (!Array.isArray(result) && result.type === 'element') { + const head = result.children[0]; + if (head && head.type === 'text') { + head.value = head.value.replace(/^\s+/, ''); + } + } + } + if (Array.isArray(result)) { + values.push(...result); + } else { + values.push(result); + } + } + } + } + return values; +} + +// node_modules/unist-util-is/index.js +var convert = function (test) { + if (test === void 0 || test === null) { + return ok; + } + if (typeof test === 'string') { + return typeFactory(test); + } + if (typeof test === 'object') { + return Array.isArray(test) ? anyFactory(test) : propsFactory(test); + } + if (typeof test === 'function') { + return castFactory(test); + } + throw new Error('Expected function, string, or object as test'); +}; +function anyFactory(tests) { + const checks2 = []; + let index2 = -1; + while (++index2 < tests.length) { + checks2[index2] = convert(tests[index2]); + } + return castFactory(any); + function any(...parameters) { + let index3 = -1; + while (++index3 < checks2.length) { + if (checks2[index3].call(this, ...parameters)) return true; + } + return false; + } +} +function propsFactory(check) { + return castFactory(all4); + function all4(node) { + let key; + for (key in check) { + if (node[key] !== check[key]) return false; + } + return true; + } +} +function typeFactory(check) { + return castFactory(type); + function type(node) { + return node && node.type === check; + } +} +function castFactory(check) { + return assertion; + function assertion(...parameters) { + return Boolean(check.call(this, ...parameters)); + } +} +function ok() { + return true; +} + +// node_modules/unist-util-visit-parents/color.js +function color2(d) { + return '\x1B[33m' + d + '\x1B[39m'; +} + +// node_modules/unist-util-visit-parents/index.js +var CONTINUE2 = true; +var SKIP2 = 'skip'; +var EXIT2 = false; +var visitParents = function (tree, test, visitor, reverse) { + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor; + visitor = test; + test = null; + } + const is = convert(test); + const step = reverse ? -1 : 1; + factory2(tree, null, [])(); + function factory2(node, index2, parents) { + const value = typeof node === 'object' && node !== null ? node : {}; + let name2; + if (typeof value.type === 'string') { + name2 = + typeof value.tagName === 'string' + ? value.tagName + : typeof value.name === 'string' + ? value.name + : void 0; + Object.defineProperty(visit3, 'name', { + value: + 'node (' + + color2(value.type + (name2 ? '<' + name2 + '>' : '')) + + ')', + }); + } + return visit3; + function visit3() { + let result = []; + let subresult; + let offset2; + let grandparents; + if (!test || is(node, index2, parents[parents.length - 1] || null)) { + result = toResult2(visitor(node, parents)); + if (result[0] === EXIT2) { + return result; + } + } + if (node.children && result[0] !== SKIP2) { + offset2 = (reverse ? node.children.length : -1) + step; + grandparents = parents.concat(node); + while (offset2 > -1 && offset2 < node.children.length) { + subresult = factory2(node.children[offset2], offset2, grandparents)(); + if (subresult[0] === EXIT2) { + return subresult; + } + offset2 = + typeof subresult[1] === 'number' ? subresult[1] : offset2 + step; + } + } + return result; + } + } +}; +function toResult2(value) { + if (Array.isArray(value)) { + return value; + } + if (typeof value === 'number') { + return [CONTINUE2, value]; + } + return [value]; +} + +// node_modules/@mdx-js/mdx/node_modules/unist-util-visit/index.js +var visit2 = function (tree, test, visitor, reverse) { + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor; + visitor = test; + test = null; + } + visitParents(tree, test, overload, reverse); + function overload(node, parents) { + const parent = parents[parents.length - 1]; + return visitor(node, parent ? parent.children.indexOf(node) : null, parent); + } +}; + +// node_modules/unist-util-position/index.js +var pointStart = point2('start'); +var pointEnd = point2('end'); +function position2(node) { + return {start: pointStart(node), end: pointEnd(node)}; +} +function point2(type) { + return point3; + function point3(node) { + const point4 = (node && node.position && node.position[type]) || {}; + return { + line: point4.line || null, + column: point4.column || null, + offset: point4.offset > -1 ? point4.offset : null, + }; + } +} + +// node_modules/@mdx-js/mdx/node_modules/unist-util-generated/index.js +function generated(node) { + return ( + !node || + !node.position || + !node.position.start || + !node.position.start.line || + !node.position.start.column || + !node.position.end || + !node.position.end.line || + !node.position.end.column + ); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-definitions/index.js +var own6 = {}.hasOwnProperty; +function definitions(node) { + const cache = /* @__PURE__ */ Object.create(null); + if (!node || !node.type) { + throw new Error('mdast-util-definitions expected node'); + } + visit2(node, 'definition', (definition3) => { + const id = clean(definition3.identifier); + if (id && !own6.call(cache, id)) { + cache[id] = definition3; + } + }); + return definition2; + function definition2(identifier) { + const id = clean(identifier); + return id && own6.call(cache, id) ? cache[id] : null; + } +} +function clean(value) { + return String(value || '').toUpperCase(); +} + +// node_modules/micromark-util-sanitize-uri/index.js +function normalizeUri(value) { + const result = []; + let index2 = -1; + let start3 = 0; + let skip = 0; + while (++index2 < value.length) { + const code2 = value.charCodeAt(index2); + let replace = ''; + if ( + code2 === 37 && + asciiAlphanumeric(value.charCodeAt(index2 + 1)) && + asciiAlphanumeric(value.charCodeAt(index2 + 2)) + ) { + skip = 2; + } else if (code2 < 128) { + if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code2))) { + replace = String.fromCharCode(code2); + } + } else if (code2 > 55295 && code2 < 57344) { + const next = value.charCodeAt(index2 + 1); + if (code2 < 56320 && next > 56319 && next < 57344) { + replace = String.fromCharCode(code2, next); + skip = 1; + } else { + replace = '\uFFFD'; + } + } else { + replace = String.fromCharCode(code2); + } + if (replace) { + result.push(value.slice(start3, index2), encodeURIComponent(replace)); + start3 = index2 + skip + 1; + replace = ''; + } + if (skip) { + index2 += skip; + skip = 0; + } + } + return result.join('') + value.slice(start3); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/wrap.js +function wrap2(nodes, loose) { + const result = []; + let index2 = -1; + if (loose) { + result.push(u('text', '\n')); + } + while (++index2 < nodes.length) { + if (index2) result.push(u('text', '\n')); + result.push(nodes[index2]); + } + if (loose && nodes.length > 0) { + result.push(u('text', '\n')); + } + return result; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/footer.js +function footer(h) { + let index2 = -1; + const listItems = []; + while (++index2 < h.footnoteOrder.length) { + const def = h.footnoteById[h.footnoteOrder[index2].toUpperCase()]; + if (!def) { + continue; + } + const content3 = all2(h, def); + const id = String(def.identifier); + const safeId = normalizeUri(id.toLowerCase()); + let referenceIndex = 0; + const backReferences = []; + while (++referenceIndex <= h.footnoteCounts[id]) { + const backReference = { + type: 'element', + tagName: 'a', + properties: { + href: + '#' + + h.clobberPrefix + + 'fnref-' + + safeId + + (referenceIndex > 1 ? '-' + referenceIndex : ''), + dataFootnoteBackref: true, + className: ['data-footnote-backref'], + ariaLabel: h.footnoteBackLabel, + }, + children: [{type: 'text', value: '\u21A9'}], + }; + if (referenceIndex > 1) { + backReference.children.push({ + type: 'element', + tagName: 'sup', + children: [{type: 'text', value: String(referenceIndex)}], + }); + } + if (backReferences.length > 0) { + backReferences.push({type: 'text', value: ' '}); + } + backReferences.push(backReference); + } + const tail = content3[content3.length - 1]; + if (tail && tail.type === 'element' && tail.tagName === 'p') { + const tailTail = tail.children[tail.children.length - 1]; + if (tailTail && tailTail.type === 'text') { + tailTail.value += ' '; + } else { + tail.children.push({type: 'text', value: ' '}); + } + tail.children.push(...backReferences); + } else { + content3.push(...backReferences); + } + const listItem2 = { + type: 'element', + tagName: 'li', + properties: {id: h.clobberPrefix + 'fn-' + safeId}, + children: wrap2(content3, true), + }; + if (def.position) { + listItem2.position = def.position; + } + listItems.push(listItem2); + } + if (listItems.length === 0) { + return null; + } + return { + type: 'element', + tagName: 'section', + properties: {dataFootnotes: true, className: ['footnotes']}, + children: [ + { + type: 'element', + tagName: h.footnoteLabelTagName, + properties: { + ...JSON.parse(JSON.stringify(h.footnoteLabelProperties)), + id: 'footnote-label', + }, + children: [u('text', h.footnoteLabel)], + }, + {type: 'text', value: '\n'}, + { + type: 'element', + tagName: 'ol', + properties: {}, + children: wrap2(listItems, true), + }, + {type: 'text', value: '\n'}, + ], + }; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +function blockquote(h, node) { + return h(node, 'blockquote', wrap2(all2(h, node), true)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/break.js +function hardBreak(h, node) { + return [h(node, 'br'), u('text', '\n')]; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/code.js +function code(h, node) { + const value = node.value ? node.value + '\n' : ''; + const lang = node.lang && node.lang.match(/^[^ \t]+(?=[ \t]|$)/); + const props = {}; + if (lang) { + props.className = ['language-' + lang]; + } + const code2 = h(node, 'code', props, [u('text', value)]); + if (node.meta) { + code2.data = {meta: node.meta}; + } + return h(node.position, 'pre', [code2]); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/delete.js +function strikethrough(h, node) { + return h(node, 'del', all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +function emphasis(h, node) { + return h(node, 'em', all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +function footnoteReference(h, node) { + const id = String(node.identifier); + const safeId = normalizeUri(id.toLowerCase()); + const index2 = h.footnoteOrder.indexOf(id); + let counter; + if (index2 === -1) { + h.footnoteOrder.push(id); + h.footnoteCounts[id] = 1; + counter = h.footnoteOrder.length; + } else { + h.footnoteCounts[id]++; + counter = index2 + 1; + } + const reuseCounter = h.footnoteCounts[id]; + return h(node, 'sup', [ + h( + node.position, + 'a', + { + href: '#' + h.clobberPrefix + 'fn-' + safeId, + id: + h.clobberPrefix + + 'fnref-' + + safeId + + (reuseCounter > 1 ? '-' + reuseCounter : ''), + dataFootnoteRef: true, + ariaDescribedBy: 'footnote-label', + }, + [u('text', String(counter))], + ), + ]); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/footnote.js +function footnote(h, node) { + const footnoteById = h.footnoteById; + let no = 1; + while (no in footnoteById) no++; + const identifier = String(no); + footnoteById[identifier] = { + type: 'footnoteDefinition', + identifier, + children: [{type: 'paragraph', children: node.children}], + position: node.position, + }; + return footnoteReference(h, { + type: 'footnoteReference', + identifier, + position: node.position, + }); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/heading.js +function heading(h, node) { + return h(node, 'h' + node.depth, all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/html.js +function html(h, node) { + return h.dangerous ? h.augment(node, u('raw', node.value)) : null; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/revert.js +function revert(h, node) { + const subtype = node.referenceType; + let suffix = ']'; + if (subtype === 'collapsed') { + suffix += '[]'; + } else if (subtype === 'full') { + suffix += '[' + (node.label || node.identifier) + ']'; + } + if (node.type === 'imageReference') { + return u('text', '![' + node.alt + suffix); + } + const contents = all2(h, node); + const head = contents[0]; + if (head && head.type === 'text') { + head.value = '[' + head.value; + } else { + contents.unshift(u('text', '[')); + } + const tail = contents[contents.length - 1]; + if (tail && tail.type === 'text') { + tail.value += suffix; + } else { + contents.push(u('text', suffix)); + } + return contents; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +function imageReference(h, node) { + const def = h.definition(node.identifier); + if (!def) { + return revert(h, node); + } + const props = {src: normalizeUri(def.url || ''), alt: node.alt}; + if (def.title !== null && def.title !== void 0) { + props.title = def.title; + } + return h(node, 'img', props); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/image.js +function image(h, node) { + const props = {src: normalizeUri(node.url), alt: node.alt}; + if (node.title !== null && node.title !== void 0) { + props.title = node.title; + } + return h(node, 'img', props); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +function inlineCode(h, node) { + return h(node, 'code', [u('text', node.value.replace(/\r?\n|\r/g, ' '))]); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +function linkReference(h, node) { + const def = h.definition(node.identifier); + if (!def) { + return revert(h, node); + } + const props = {href: normalizeUri(def.url || '')}; + if (def.title !== null && def.title !== void 0) { + props.title = def.title; + } + return h(node, 'a', props, all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/link.js +function link(h, node) { + const props = {href: normalizeUri(node.url)}; + if (node.title !== null && node.title !== void 0) { + props.title = node.title; + } + return h(node, 'a', props, all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +function listItem(h, node, parent) { + const result = all2(h, node); + const loose = parent ? listLoose(parent) : listItemLoose(node); + const props = {}; + const wrapped = []; + if (typeof node.checked === 'boolean') { + let paragraph2; + if ( + result[0] && + result[0].type === 'element' && + result[0].tagName === 'p' + ) { + paragraph2 = result[0]; + } else { + paragraph2 = h(null, 'p', []); + result.unshift(paragraph2); + } + if (paragraph2.children.length > 0) { + paragraph2.children.unshift(u('text', ' ')); + } + paragraph2.children.unshift( + h(null, 'input', { + type: 'checkbox', + checked: node.checked, + disabled: true, + }), + ); + props.className = ['task-list-item']; + } + let index2 = -1; + while (++index2 < result.length) { + const child = result[index2]; + if ( + loose || + index2 !== 0 || + child.type !== 'element' || + child.tagName !== 'p' + ) { + wrapped.push(u('text', '\n')); + } + if (child.type === 'element' && child.tagName === 'p' && !loose) { + wrapped.push(...child.children); + } else { + wrapped.push(child); + } + } + const tail = result[result.length - 1]; + if (tail && (loose || !('tagName' in tail) || tail.tagName !== 'p')) { + wrapped.push(u('text', '\n')); + } + return h(node, 'li', props, wrapped); +} +function listLoose(node) { + let loose = node.spread; + const children = node.children; + let index2 = -1; + while (!loose && ++index2 < children.length) { + loose = listItemLoose(children[index2]); + } + return Boolean(loose); +} +function listItemLoose(node) { + const spread = node.spread; + return spread === void 0 || spread === null + ? node.children.length > 1 + : spread; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/list.js +function list2(h, node) { + const props = {}; + const name2 = node.ordered ? 'ol' : 'ul'; + const items = all2(h, node); + let index2 = -1; + if (typeof node.start === 'number' && node.start !== 1) { + props.start = node.start; + } + while (++index2 < items.length) { + const item = items[index2]; + if ( + item.type === 'element' && + item.tagName === 'li' && + item.properties && + Array.isArray(item.properties.className) && + item.properties.className.includes('task-list-item') + ) { + props.className = ['contains-task-list']; + break; + } + } + return h(node, name2, props, wrap2(items, true)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +function paragraph(h, node) { + return h(node, 'p', all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/root.js +function root(h, node) { + return h.augment(node, u('root', wrap2(all2(h, node)))); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/strong.js +function strong(h, node) { + return h(node, 'strong', all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/table.js +function table(h, node) { + const rows = node.children; + let index2 = -1; + const align = node.align || []; + const result = []; + while (++index2 < rows.length) { + const row = rows[index2].children; + const name2 = index2 === 0 ? 'th' : 'td'; + const out = []; + let cellIndex = -1; + const length = node.align ? align.length : row.length; + while (++cellIndex < length) { + const cell = row[cellIndex]; + out.push( + h(cell, name2, {align: align[cellIndex]}, cell ? all2(h, cell) : []), + ); + } + result[index2] = h(rows[index2], 'tr', wrap2(out, true)); + } + return h( + node, + 'table', + wrap2( + [h(result[0].position, 'thead', wrap2([result[0]], true))].concat( + result[1] + ? h( + { + start: pointStart(result[1]), + end: pointEnd(result[result.length - 1]), + }, + 'tbody', + wrap2(result.slice(1), true), + ) + : [], + ), + true, + ), + ); +} + +// node_modules/trim-lines/index.js +var tab = 9; +var space = 32; +function trimLines(value) { + const source = String(value); + const search2 = /\r?\n|\r/g; + let match = search2.exec(source); + let last = 0; + const lines = []; + while (match) { + lines.push( + trimLine(source.slice(last, match.index), last > 0, true), + match[0], + ); + last = match.index + match[0].length; + match = search2.exec(source); + } + lines.push(trimLine(source.slice(last), last > 0, false)); + return lines.join(''); +} +function trimLine(value, start3, end) { + let startIndex = 0; + let endIndex = value.length; + if (start3) { + let code2 = value.codePointAt(startIndex); + while (code2 === tab || code2 === space) { + startIndex++; + code2 = value.codePointAt(startIndex); + } + } + if (end) { + let code2 = value.codePointAt(endIndex - 1); + while (code2 === tab || code2 === space) { + endIndex--; + code2 = value.codePointAt(endIndex - 1); + } + } + return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/text.js +function text3(h, node) { + return h.augment(node, u('text', trimLines(String(node.value)))); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +function thematicBreak2(h, node) { + return h(node, 'hr'); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/index.js +var handlers = { + blockquote, + break: hardBreak, + code, + delete: strikethrough, + emphasis, + footnoteReference, + footnote, + heading, + html, + imageReference, + image, + inlineCode, + linkReference, + link, + listItem, + list: list2, + paragraph, + root, + strong, + table, + text: text3, + thematicBreak: thematicBreak2, + toml: ignore, + yaml: ignore, + definition: ignore, + footnoteDefinition: ignore, +}; +function ignore() { + return null; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/index.js +var own7 = {}.hasOwnProperty; +function factory(tree, options) { + const settings = options || {}; + const dangerous = settings.allowDangerousHtml || false; + const footnoteById = {}; + h.dangerous = dangerous; + h.clobberPrefix = + settings.clobberPrefix === void 0 || settings.clobberPrefix === null + ? 'user-content-' + : settings.clobberPrefix; + h.footnoteLabel = settings.footnoteLabel || 'Footnotes'; + h.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2'; + h.footnoteLabelProperties = settings.footnoteLabelProperties || { + className: ['sr-only'], + }; + h.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'; + h.definition = definitions(tree); + h.footnoteById = footnoteById; + h.footnoteOrder = []; + h.footnoteCounts = {}; + h.augment = augment; + h.handlers = {...handlers, ...settings.handlers}; + h.unknownHandler = settings.unknownHandler; + h.passThrough = settings.passThrough; + visit2(tree, 'footnoteDefinition', (definition2) => { + const id = String(definition2.identifier).toUpperCase(); + if (!own7.call(footnoteById, id)) { + footnoteById[id] = definition2; + } + }); + return h; + function augment(left, right) { + if (left && 'data' in left && left.data) { + const data2 = left.data; + if (data2.hName) { + if (right.type !== 'element') { + right = { + type: 'element', + tagName: '', + properties: {}, + children: [], + }; + } + right.tagName = data2.hName; + } + if (right.type === 'element' && data2.hProperties) { + right.properties = {...right.properties, ...data2.hProperties}; + } + if ('children' in right && right.children && data2.hChildren) { + right.children = data2.hChildren; + } + } + if (left) { + const ctx = 'type' in left ? left : {position: left}; + if (!generated(ctx)) { + right.position = {start: pointStart(ctx), end: pointEnd(ctx)}; + } + } + return right; + } + function h(node, tagName, props, children) { + if (Array.isArray(props)) { + children = props; + props = {}; + } + return augment(node, { + type: 'element', + tagName, + properties: props || {}, + children: children || [], + }); + } +} +function toHast(tree, options) { + const h = factory(tree, options); + const node = one2(h, tree, null); + const foot = footer(h); + if (foot) { + node.children.push(u('text', '\n'), foot); + } + return Array.isArray(node) ? {type: 'root', children: node} : node; +} + +// node_modules/@mdx-js/mdx/node_modules/remark-rehype/lib/index.js +var remarkRehype = function (destination, options) { + return destination && 'run' in destination + ? bridge(destination, options) + : mutate(destination || options); +}; +var lib_default = remarkRehype; +function bridge(destination, options) { + return (node, file, next) => { + destination.run(toHast(node, options), file, (error) => { + next(error); + }); + }; +} +function mutate(options) { + return (node) => toHast(node, options); +} + +// node_modules/estree-walker/src/walker.js +var WalkerBase = class { + constructor() { + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + this.context = { + skip: () => (this.should_skip = true), + remove: () => (this.should_remove = true), + replace: (node) => (this.replacement = node), + }; + } + replace(parent, prop, index2, node) { + if (parent) { + if (index2 !== null) { + parent[prop][index2] = node; + } else { + parent[prop] = node; + } + } + } + remove(parent, prop, index2) { + if (parent) { + if (index2 !== null) { + parent[prop].splice(index2, 1); + } else { + delete parent[prop]; + } + } + } +}; + +// node_modules/estree-walker/src/sync.js +var SyncWalker = class extends WalkerBase { + constructor(enter, leave) { + super(); + this.enter = enter; + this.leave = leave; + } + visit(node, parent, prop, index2) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + this.enter.call(this.context, node, parent, prop, index2); + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index2, node); + } + if (this.should_remove) { + this.remove(parent, prop, index2); + } + const skipped = this.should_skip; + const removed = this.should_remove; + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + if (skipped) return node; + if (removed) return null; + } + for (const key in node) { + const value = node[key]; + if (typeof value !== 'object') { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === 'string') { + if (!this.visit(value[i], node, key, i)) { + i--; + } + } + } + } else if (value !== null && typeof value.type === 'string') { + this.visit(value, node, key, null); + } + } + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + this.leave.call(this.context, node, parent, prop, index2); + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index2, node); + } + if (this.should_remove) { + this.remove(parent, prop, index2); + } + const removed = this.should_remove; + this.replacement = _replacement; + this.should_remove = _should_remove; + if (removed) return null; + } + } + return node; + } +}; + +// node_modules/estree-walker/src/index.js +function walk(ast, {enter, leave}) { + const instance = new SyncWalker(enter, leave); + return instance.visit(ast, null); +} + +// node_modules/estree-util-build-jsx/lib/index.js +var regex = /@(jsx|jsxFrag|jsxImportSource|jsxRuntime)\s+(\S+)/g; +function buildJsx(tree, options = {}) { + let automatic = options.runtime === 'automatic'; + const annotations = {}; + const imports = {}; + walk(tree, { + enter(node) { + if (node.type === 'Program') { + const comments = node.comments || []; + let index2 = -1; + while (++index2 < comments.length) { + regex.lastIndex = 0; + let match = regex.exec(comments[index2].value); + while (match) { + annotations[match[1]] = match[2]; + match = regex.exec(comments[index2].value); + } + } + if (annotations.jsxRuntime) { + if (annotations.jsxRuntime === 'automatic') { + automatic = true; + if (annotations.jsx) { + throw new Error('Unexpected `@jsx` pragma w/ automatic runtime'); + } + if (annotations.jsxFrag) { + throw new Error( + 'Unexpected `@jsxFrag` pragma w/ automatic runtime', + ); + } + } else if (annotations.jsxRuntime === 'classic') { + automatic = false; + if (annotations.jsxImportSource) { + throw new Error( + 'Unexpected `@jsxImportSource` w/ classic runtime', + ); + } + } else { + throw new Error( + 'Unexpected `jsxRuntime` `' + + annotations.jsxRuntime + + '`, expected `automatic` or `classic`', + ); + } + } + } + }, + leave(node) { + if (node.type === 'Program') { + const specifiers = []; + if (imports.fragment) { + specifiers.push({ + type: 'ImportSpecifier', + imported: {type: 'Identifier', name: 'Fragment'}, + local: {type: 'Identifier', name: '_Fragment'}, + }); + } + if (imports.jsx) { + specifiers.push({ + type: 'ImportSpecifier', + imported: {type: 'Identifier', name: 'jsx'}, + local: {type: 'Identifier', name: '_jsx'}, + }); + } + if (imports.jsxs) { + specifiers.push({ + type: 'ImportSpecifier', + imported: {type: 'Identifier', name: 'jsxs'}, + local: {type: 'Identifier', name: '_jsxs'}, + }); + } + if (imports.jsxDEV) { + specifiers.push({ + type: 'ImportSpecifier', + imported: {type: 'Identifier', name: 'jsxDEV'}, + local: {type: 'Identifier', name: '_jsxDEV'}, + }); + } + if (specifiers.length > 0) { + node.body.unshift({ + type: 'ImportDeclaration', + specifiers, + source: { + type: 'Literal', + value: + (annotations.jsxImportSource || + options.importSource || + 'react') + + (options.development ? '/jsx-dev-runtime' : '/jsx-runtime'), + }, + }); + } + } + if (node.type !== 'JSXElement' && node.type !== 'JSXFragment') { + return; + } + const children = []; + let index2 = -1; + while (++index2 < node.children.length) { + const child = node.children[index2]; + if (child.type === 'JSXExpressionContainer') { + if (child.expression.type !== 'JSXEmptyExpression') { + children.push(child.expression); + } + } else if (child.type === 'JSXText') { + const value = child.value + .replace(/\t/g, ' ') + .replace(/ *(\r?\n|\r) */g, '\n') + .replace(/\n+/g, '\n') + .replace(/\n+$/, '') + .replace(/\n/g, ' '); + if (value) { + children.push(create(child, {type: 'Literal', value})); + } + } else { + children.push(child); + } + } + let name2; + let fields = []; + const objects = []; + let parameters = []; + let key; + if (node.type === 'JSXElement') { + name2 = toIdentifier(node.openingElement.name); + if (name2.type === 'Identifier' && /^[a-z]/.test(name2.name)) { + name2 = create(name2, {type: 'Literal', value: name2.name}); + } + let spread; + const attributes = node.openingElement.attributes; + let index3 = -1; + while (++index3 < attributes.length) { + const attribute = attributes[index3]; + if (attribute.type === 'JSXSpreadAttribute') { + if (fields.length > 0) { + objects.push({type: 'ObjectExpression', properties: fields}); + fields = []; + } + objects.push(attribute.argument); + spread = true; + } else { + const prop = toProperty(attribute); + if ( + automatic && + prop.key.type === 'Identifier' && + prop.key.name === 'key' + ) { + if (spread) { + throw new Error( + 'Expected `key` to come before any spread expressions', + ); + } + key = prop.value; + } else { + fields.push(prop); + } + } + } + } else if (automatic) { + imports.fragment = true; + name2 = {type: 'Identifier', name: '_Fragment'}; + } else { + name2 = toMemberExpression( + annotations.jsxFrag || options.pragmaFrag || 'React.Fragment', + ); + } + if (automatic) { + if (children.length > 0) { + fields.push({ + type: 'Property', + key: {type: 'Identifier', name: 'children'}, + value: + children.length > 1 + ? {type: 'ArrayExpression', elements: children} + : children[0], + kind: 'init', + method: false, + shorthand: false, + computed: false, + }); + } + } else { + parameters = children; + } + if (fields.length > 0) { + objects.push({type: 'ObjectExpression', properties: fields}); + } + let props; + let callee; + if (objects.length > 1) { + if (objects[0].type !== 'ObjectExpression') { + objects.unshift({type: 'ObjectExpression', properties: []}); + } + props = { + type: 'CallExpression', + callee: toMemberExpression('Object.assign'), + arguments: objects, + optional: false, + }; + } else if (objects.length > 0) { + props = objects[0]; + } + if (automatic) { + parameters.push(props || {type: 'ObjectExpression', properties: []}); + if (key) { + parameters.push(key); + } else if (options.development) { + parameters.push({type: 'Identifier', name: 'undefined'}); + } + const isStaticChildren = children.length > 1; + if (options.development) { + imports.jsxDEV = true; + callee = { + type: 'Identifier', + name: '_jsxDEV', + }; + parameters.push({type: 'Literal', value: isStaticChildren}); + const source = { + type: 'ObjectExpression', + properties: [ + { + type: 'Property', + method: false, + shorthand: false, + computed: false, + kind: 'init', + key: {type: 'Identifier', name: 'fileName'}, + value: { + type: 'Literal', + value: options.filePath || '', + }, + }, + ], + }; + if (node.loc) { + source.properties.push( + { + type: 'Property', + method: false, + shorthand: false, + computed: false, + kind: 'init', + key: {type: 'Identifier', name: 'lineNumber'}, + value: {type: 'Literal', value: node.loc.start.line}, + }, + { + type: 'Property', + method: false, + shorthand: false, + computed: false, + kind: 'init', + key: {type: 'Identifier', name: 'columnNumber'}, + value: {type: 'Literal', value: node.loc.start.column + 1}, + }, + ); + } + parameters.push(source, {type: 'ThisExpression'}); + } else if (isStaticChildren) { + imports.jsxs = true; + callee = {type: 'Identifier', name: '_jsxs'}; + } else { + imports.jsx = true; + callee = {type: 'Identifier', name: '_jsx'}; + } + } else { + if (props || parameters.length > 0) { + parameters.unshift(props || {type: 'Literal', value: null}); + } + callee = toMemberExpression( + annotations.jsx || options.pragma || 'React.createElement', + ); + } + parameters.unshift(name2); + this.replace( + create(node, { + type: 'CallExpression', + callee, + arguments: parameters, + optional: false, + }), + ); + }, + }); + return tree; +} +function toProperty(node) { + let value; + if (node.value) { + if (node.value.type === 'JSXExpressionContainer') { + value = node.value.expression; + } else { + value = node.value; + delete value.raw; + } + } else { + value = {type: 'Literal', value: true}; + } + return create(node, { + type: 'Property', + key: toIdentifier(node.name), + value, + kind: 'init', + method: false, + shorthand: false, + computed: false, + }); +} +function toIdentifier(node) { + let replace; + if (node.type === 'JSXMemberExpression') { + const id = toIdentifier(node.property); + replace = { + type: 'MemberExpression', + object: toIdentifier(node.object), + property: id, + computed: id.type === 'Literal', + optional: false, + }; + } else if (node.type === 'JSXNamespacedName') { + replace = { + type: 'Literal', + value: node.namespace.name + ':' + node.name.name, + }; + } else { + replace = name(node.name) + ? {type: 'Identifier', name: node.name} + : {type: 'Literal', value: node.name}; + } + return create(node, replace); +} +function toMemberExpression(id) { + const identifiers = id.split('.'); + let index2 = -1; + let result; + while (++index2 < identifiers.length) { + const prop = name(identifiers[index2]) + ? {type: 'Identifier', name: identifiers[index2]} + : {type: 'Literal', value: identifiers[index2]}; + result = result + ? { + type: 'MemberExpression', + object: result, + property: prop, + computed: Boolean(index2 && prop.type === 'Literal'), + optional: false, + } + : prop; + } + return result; +} +function create(from, node) { + const fields = ['start', 'end', 'loc', 'range', 'comments']; + let index2 = -1; + while (++index2 < fields.length) { + const field = fields[index2]; + if (field in from) { + node[field] = from[field]; + } + } + return node; +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-create.js +function create2(template, node) { + const fields = ['start', 'end', 'loc', 'range', 'comments']; + let index2 = -1; + while (++index2 < fields.length) { + const field = fields[index2]; + if (field in template) { + node[field] = template[field]; + } + } + return node; +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-specifiers-to-declarations.js +function specifiersToDeclarations(specifiers, init) { + let index2 = -1; + const declarations = []; + const otherSpecifiers = []; + let importNamespaceSpecifier; + while (++index2 < specifiers.length) { + const specifier = specifiers[index2]; + if (specifier.type === 'ImportNamespaceSpecifier') { + importNamespaceSpecifier = specifier; + } else { + otherSpecifiers.push(specifier); + } + } + if (importNamespaceSpecifier) { + declarations.push( + create2(importNamespaceSpecifier, { + type: 'VariableDeclarator', + id: importNamespaceSpecifier.local, + init, + }), + ); + } + declarations.push({ + type: 'VariableDeclarator', + id: { + type: 'ObjectPattern', + properties: otherSpecifiers.map((specifier) => { + let key = + specifier.type === 'ImportSpecifier' + ? specifier.imported + : specifier.type === 'ExportSpecifier' + ? specifier.exported + : {type: 'Identifier', name: 'default'}; + let value = specifier.local; + if (specifier.type === 'ExportSpecifier') { + value = key; + key = specifier.local; + } + return create2(specifier, { + type: 'Property', + kind: 'init', + shorthand: key.name === value.name, + method: false, + computed: false, + key, + value, + }); + }), + }, + init: importNamespaceSpecifier + ? {type: 'Identifier', name: importNamespaceSpecifier.local.name} + : init, + }); + return declarations; +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-to-id-or-member-expression.js +var toIdOrMemberExpression = toIdOrMemberExpressionFactory( + 'Identifier', + 'MemberExpression', + name, +); +var toJsxIdOrMemberExpression = toIdOrMemberExpressionFactory( + 'JSXIdentifier', + 'JSXMemberExpression', + isJsxIdentifierName, +); +function toIdOrMemberExpressionFactory(idType, memberType, isIdentifier) { + return toIdOrMemberExpression2; + function toIdOrMemberExpression2(ids) { + let index2 = -1; + let object; + while (++index2 < ids.length) { + const name2 = ids[index2]; + const valid2 = typeof name2 === 'string' && isIdentifier(name2); + if (idType === 'JSXIdentifier' && !valid2) { + throw new Error('Cannot turn `' + name2 + '` into a JSX identifier'); + } + const id = valid2 + ? {type: idType, name: name2} + : {type: 'Literal', value: name2}; + object = object + ? { + type: memberType, + object, + property: id, + computed: id.type === 'Literal', + optional: false, + } + : id; + } + if (!object) throw new Error('Expected non-empty `ids` to be passed'); + if (object.type === 'Literal') + throw new Error('Expected identifier as left-most value'); + return object; + } +} +function isJsxIdentifierName(name2) { + let index2 = -1; + while (++index2 < name2.length) { + if (!(index2 ? jsxCont : start2)(name2.charCodeAt(index2))) return false; + } + return index2 > 0; +} +function jsxCont(code2) { + return code2 === 45 || cont2(code2); +} + +// node_modules/@mdx-js/mdx/lib/plugin/recma-jsx-build.js +function recmaJsxBuild(options = {}) { + const {outputFormat} = options; + return (tree) => { + buildJsx(tree); + if ( + outputFormat === 'function-body' && + tree.body[0] && + tree.body[0].type === 'ImportDeclaration' && + typeof tree.body[0].source.value === 'string' && + /\/jsx-runtime$/.test(tree.body[0].source.value) + ) { + tree.body[0] = { + type: 'VariableDeclaration', + kind: 'const', + declarations: specifiersToDeclarations( + tree.body[0].specifiers, + toIdOrMemberExpression(['arguments', 0]), + ), + }; + } + }; +} + +// node_modules/is-reference/src/index.js +function is_reference(node, parent) { + if (node.type === 'MemberExpression') { + return !node.computed && is_reference(node.object, node); + } + if (node.type === 'Identifier') { + if (!parent) return true; + switch (parent.type) { + case 'MemberExpression': + return parent.computed || node === parent.object; + case 'MethodDefinition': + return parent.computed; + case 'PropertyDefinition': + return parent.computed || node === parent.value; + case 'Property': + return parent.computed || node === parent.value; + case 'ExportSpecifier': + case 'ImportSpecifier': + return node === parent.local; + case 'LabeledStatement': + case 'BreakStatement': + case 'ContinueStatement': + return false; + default: + return true; + } + } + return false; +} + +// node_modules/periscopic/src/index.js +function analyze(expression) { + const map = /* @__PURE__ */ new WeakMap(); + const globals = /* @__PURE__ */ new Map(); + const scope = new Scope3(null, false); + const references = []; + let current_scope = scope; + walk(expression, { + enter(node, parent) { + switch (node.type) { + case 'Identifier': + if (is_reference(node, parent)) { + references.push([current_scope, node]); + } + break; + case 'ImportDeclaration': + node.specifiers.forEach((specifier) => { + current_scope.declarations.set(specifier.local.name, specifier); + }); + break; + case 'FunctionExpression': + case 'FunctionDeclaration': + case 'ArrowFunctionExpression': + if (node.type === 'FunctionDeclaration') { + if (node.id) { + current_scope.declarations.set(node.id.name, node); + } + map.set(node, (current_scope = new Scope3(current_scope, false))); + } else { + map.set(node, (current_scope = new Scope3(current_scope, false))); + if (node.type === 'FunctionExpression' && node.id) { + current_scope.declarations.set(node.id.name, node); + } + } + node.params.forEach((param) => { + extract_names(param).forEach((name2) => { + current_scope.declarations.set(name2, node); + }); + }); + break; + case 'ForStatement': + case 'ForInStatement': + case 'ForOfStatement': + map.set(node, (current_scope = new Scope3(current_scope, true))); + break; + case 'BlockStatement': + map.set(node, (current_scope = new Scope3(current_scope, true))); + break; + case 'ClassDeclaration': + case 'VariableDeclaration': + current_scope.add_declaration(node); + break; + case 'CatchClause': + map.set(node, (current_scope = new Scope3(current_scope, true))); + if (node.param) { + extract_names(node.param).forEach((name2) => { + current_scope.declarations.set(name2, node.param); + }); + } + break; + } + }, + leave(node) { + if (map.has(node)) { + current_scope = current_scope.parent; + } + }, + }); + for (let i = references.length - 1; i >= 0; --i) { + const [scope2, reference] = references[i]; + if (!scope2.references.has(reference.name)) { + add_reference(scope2, reference.name); + } + if (!scope2.find_owner(reference.name)) { + globals.set(reference.name, reference); + } + } + return {map, scope, globals}; +} +function add_reference(scope, name2) { + scope.references.add(name2); + if (scope.parent) add_reference(scope.parent, name2); +} +var Scope3 = class { + constructor(parent, block) { + this.parent = parent; + this.block = block; + this.declarations = /* @__PURE__ */ new Map(); + this.initialised_declarations = /* @__PURE__ */ new Set(); + this.references = /* @__PURE__ */ new Set(); + } + add_declaration(node) { + if (node.type === 'VariableDeclaration') { + if (node.kind === 'var' && this.block && this.parent) { + this.parent.add_declaration(node); + } else { + const handle_declarator = (declarator) => { + extract_names(declarator.id).forEach((name2) => { + this.declarations.set(name2, node); + if (declarator.init) this.initialised_declarations.add(name2); + }); + }; + node.declarations.forEach(handle_declarator); + } + } else if (node.id) { + this.declarations.set(node.id.name, node); + } + } + find_owner(name2) { + if (this.declarations.has(name2)) return this; + return this.parent && this.parent.find_owner(name2); + } + has(name2) { + return ( + this.declarations.has(name2) || (!!this.parent && this.parent.has(name2)) + ); + } +}; +function extract_names(param) { + return extract_identifiers(param).map((node) => node.name); +} +function extract_identifiers(param, nodes = []) { + switch (param.type) { + case 'Identifier': + nodes.push(param); + break; + case 'MemberExpression': + let object = param; + while (object.type === 'MemberExpression') { + object = object.object; + } + nodes.push(object); + break; + case 'ObjectPattern': + const handle_prop = (prop) => { + if (prop.type === 'RestElement') { + extract_identifiers(prop.argument, nodes); + } else { + extract_identifiers(prop.value, nodes); + } + }; + param.properties.forEach(handle_prop); + break; + case 'ArrayPattern': + const handle_element = (element2) => { + if (element2) extract_identifiers(element2, nodes); + }; + param.elements.forEach(handle_element); + break; + case 'RestElement': + extract_identifiers(param.argument, nodes); + break; + case 'AssignmentPattern': + extract_identifiers(param.left, nodes); + break; + } + return nodes; +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-declaration-to-expression.js +function declarationToExpression(declaration) { + if (declaration.type === 'FunctionDeclaration') { + return {...declaration, type: 'FunctionExpression'}; + } + if (declaration.type === 'ClassDeclaration') { + return {...declaration, type: 'ClassExpression'}; + } + throw new Error('Cannot turn `' + declaration.type + '` into an expression'); +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-is-declaration.js +function isDeclaration(node) { + const type = node && typeof node === 'object' && node.type; + return Boolean( + type === 'FunctionDeclaration' || + type === 'ClassDeclaration' || + type === 'VariableDeclaration', + ); +} + +// node_modules/@mdx-js/mdx/lib/plugin/recma-document.js +function recmaDocument(options = {}) { + const { + baseUrl, + useDynamicImport, + outputFormat = 'program', + pragma = 'React.createElement', + pragmaFrag = 'React.Fragment', + pragmaImportSource = 'react', + jsxImportSource = 'react', + jsxRuntime = 'automatic', + } = options; + return (tree, file) => { + const exportedIdentifiers = []; + const replacement = []; + const pragmas = []; + let exportAllCount = 0; + let layout; + let content3; + let child; + if (!tree.comments) tree.comments = []; + if (jsxRuntime) { + pragmas.push('@jsxRuntime ' + jsxRuntime); + } + if (jsxRuntime === 'automatic' && jsxImportSource) { + pragmas.push('@jsxImportSource ' + jsxImportSource); + } + if (jsxRuntime === 'classic' && pragma) { + pragmas.push('@jsx ' + pragma); + } + if (jsxRuntime === 'classic' && pragmaFrag) { + pragmas.push('@jsxFrag ' + pragmaFrag); + } + if (pragmas.length > 0) { + tree.comments.unshift({type: 'Block', value: pragmas.join(' ')}); + } + if (jsxRuntime === 'classic' && pragmaImportSource) { + if (!pragma) { + throw new Error( + 'Missing `pragma` in classic runtime with `pragmaImportSource`', + ); + } + handleEsm({ + type: 'ImportDeclaration', + specifiers: [ + { + type: 'ImportDefaultSpecifier', + local: {type: 'Identifier', name: pragma.split('.')[0]}, + }, + ], + source: {type: 'Literal', value: pragmaImportSource}, + }); + } + for (child of tree.body) { + if (child.type === 'ExportDefaultDeclaration') { + if (layout) { + file.fail( + 'Cannot specify multiple layouts (previous: ' + + stringifyPosition(positionFromEstree(layout)) + + ')', + positionFromEstree(child), + 'recma-document:duplicate-layout', + ); + } + layout = child; + replacement.push({ + type: 'VariableDeclaration', + kind: 'const', + declarations: [ + { + type: 'VariableDeclarator', + id: {type: 'Identifier', name: 'MDXLayout'}, + init: isDeclaration(child.declaration) + ? declarationToExpression(child.declaration) + : child.declaration, + }, + ], + }); + } else if (child.type === 'ExportNamedDeclaration' && child.source) { + const source = child.source; + child.specifiers = child.specifiers.filter((specifier) => { + if (specifier.exported.name === 'default') { + if (layout) { + file.fail( + 'Cannot specify multiple layouts (previous: ' + + stringifyPosition(positionFromEstree(layout)) + + ')', + positionFromEstree(child), + 'recma-document:duplicate-layout', + ); + } + layout = specifier; + handleEsm( + create2(specifier, { + type: 'ImportDeclaration', + specifiers: [ + specifier.local.name === 'default' + ? { + type: 'ImportDefaultSpecifier', + local: {type: 'Identifier', name: 'MDXLayout'}, + } + : create2(specifier.local, { + type: 'ImportSpecifier', + imported: specifier.local, + local: {type: 'Identifier', name: 'MDXLayout'}, + }), + ], + source: create2(source, {type: 'Literal', value: source.value}), + }), + ); + return false; + } + return true; + }); + if (child.specifiers.length > 0) { + handleExport(child); + } + } else if ( + child.type === 'ExportNamedDeclaration' || + child.type === 'ExportAllDeclaration' + ) { + handleExport(child); + } else if (child.type === 'ImportDeclaration') { + handleEsm(child); + } else if ( + child.type === 'ExpressionStatement' && + (child.expression.type === 'JSXFragment' || + child.expression.type === 'JSXElement') + ) { + content3 = true; + replacement.push( + ...createMdxContent(child.expression, Boolean(layout)), + ); + } else { + replacement.push(child); + } + } + if (!content3) { + replacement.push(...createMdxContent(void 0, Boolean(layout))); + } + exportedIdentifiers.push(['MDXContent', 'default']); + if (outputFormat === 'function-body') { + replacement.push({ + type: 'ReturnStatement', + argument: { + type: 'ObjectExpression', + properties: [ + ...Array.from({length: exportAllCount}).map((_, index2) => ({ + type: 'SpreadElement', + argument: {type: 'Identifier', name: '_exportAll' + (index2 + 1)}, + })), + ...exportedIdentifiers.map((d) => { + const prop = { + type: 'Property', + kind: 'init', + method: false, + computed: false, + shorthand: typeof d === 'string', + key: { + type: 'Identifier', + name: typeof d === 'string' ? d : d[1], + }, + value: { + type: 'Identifier', + name: typeof d === 'string' ? d : d[0], + }, + }; + return prop; + }), + ], + }, + }); + } else { + replacement.push({ + type: 'ExportDefaultDeclaration', + declaration: {type: 'Identifier', name: 'MDXContent'}, + }); + } + tree.body = replacement; + if (baseUrl) { + walk(tree, { + enter(_node) { + const node = _node; + if ( + node.type === 'MemberExpression' && + 'object' in node && + node.object.type === 'MetaProperty' && + node.property.type === 'Identifier' && + node.object.meta.name === 'import' && + node.object.property.name === 'meta' && + node.property.name === 'url' + ) { + const replacement2 = {type: 'Literal', value: baseUrl}; + this.replace(replacement2); + } + }, + }); + } + function handleExport(node) { + if (node.type === 'ExportNamedDeclaration') { + if (node.declaration) { + exportedIdentifiers.push( + ...analyze(node.declaration).scope.declarations.keys(), + ); + } + for (child of node.specifiers) { + exportedIdentifiers.push(child.exported.name); + } + } + handleEsm(node); + } + function handleEsm(node) { + if (baseUrl && node.source) { + let value = String(node.source.value); + try { + value = String(new URL(value)); + } catch { + if (/^\.{0,2}\//.test(value)) { + value = String(new URL(value, baseUrl)); + } + } + node.source = create2(node.source, {type: 'Literal', value}); + } + let replace; + let init; + if (outputFormat === 'function-body') { + if ( + node.type === 'ImportDeclaration' || + node.type === 'ExportAllDeclaration' || + (node.type === 'ExportNamedDeclaration' && node.source) + ) { + if (!useDynamicImport) { + file.fail( + 'Cannot use `import` or `export \u2026 from` in `evaluate` (outputting a function body) by default: please set `useDynamicImport: true` (and probably specify a `baseUrl`)', + positionFromEstree(node), + 'recma-document:invalid-esm-statement', + ); + } + if (!node.source) { + throw new Error('Expected `node.source` to be defined'); + } + init = { + type: 'AwaitExpression', + argument: create2(node, { + type: 'ImportExpression', + source: node.source, + }), + }; + if ( + (node.type === 'ImportDeclaration' || + node.type === 'ExportNamedDeclaration') && + node.specifiers.length === 0 + ) { + replace = {type: 'ExpressionStatement', expression: init}; + } else { + replace = { + type: 'VariableDeclaration', + kind: 'const', + declarations: + node.type === 'ExportAllDeclaration' + ? [ + { + type: 'VariableDeclarator', + id: { + type: 'Identifier', + name: '_exportAll' + ++exportAllCount, + }, + init, + }, + ] + : specifiersToDeclarations(node.specifiers, init), + }; + } + } else if (node.declaration) { + replace = node.declaration; + } else { + const declarators = node.specifiers + .filter( + (specifier) => specifier.local.name !== specifier.exported.name, + ) + .map((specifier) => ({ + type: 'VariableDeclarator', + id: specifier.exported, + init: specifier.local, + })); + if (declarators.length > 0) { + replace = { + type: 'VariableDeclaration', + kind: 'const', + declarations: declarators, + }; + } + } + } else { + replace = node; + } + if (replace) { + replacement.push(replace); + } + } + }; + function createMdxContent(content3, hasInternalLayout) { + const element2 = { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: {type: 'JSXIdentifier', name: 'MDXLayout'}, + attributes: [ + { + type: 'JSXSpreadAttribute', + argument: {type: 'Identifier', name: 'props'}, + }, + ], + selfClosing: false, + }, + closingElement: { + type: 'JSXClosingElement', + name: {type: 'JSXIdentifier', name: 'MDXLayout'}, + }, + children: [ + { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: {type: 'JSXIdentifier', name: '_createMdxContent'}, + attributes: [ + { + type: 'JSXSpreadAttribute', + argument: {type: 'Identifier', name: 'props'}, + }, + ], + selfClosing: true, + }, + closingElement: null, + children: [], + }, + ], + }; + let result = element2; + if (!hasInternalLayout) { + result = { + type: 'ConditionalExpression', + test: {type: 'Identifier', name: 'MDXLayout'}, + consequent: result, + alternate: { + type: 'CallExpression', + callee: {type: 'Identifier', name: '_createMdxContent'}, + arguments: [{type: 'Identifier', name: 'props'}], + optional: false, + }, + }; + } + let argument = content3 || {type: 'Literal', value: null}; + if ( + argument && + argument.type === 'JSXFragment' && + argument.children.length === 1 && + argument.children[0].type === 'JSXElement' + ) { + argument = argument.children[0]; + } + return [ + { + type: 'FunctionDeclaration', + id: {type: 'Identifier', name: '_createMdxContent'}, + params: [{type: 'Identifier', name: 'props'}], + body: { + type: 'BlockStatement', + body: [{type: 'ReturnStatement', argument}], + }, + }, + { + type: 'FunctionDeclaration', + id: {type: 'Identifier', name: 'MDXContent'}, + params: [ + { + type: 'AssignmentPattern', + left: {type: 'Identifier', name: 'props'}, + right: {type: 'ObjectExpression', properties: []}, + }, + ], + body: { + type: 'BlockStatement', + body: [ + { + type: 'ReturnStatement', + argument: result, + }, + ], + }, + }, + ]; + } +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-to-binary-addition.js +function toBinaryAddition(expressions) { + let index2 = -1; + let left; + while (++index2 < expressions.length) { + const right = expressions[index2]; + left = left + ? {type: 'BinaryExpression', left, operator: '+', right} + : right; + } + if (!left) throw new Error('Expected non-empty `expressions` to be passed'); + return left; +} + +// node_modules/@mdx-js/mdx/lib/plugin/recma-jsx-rewrite.js +var own8 = {}.hasOwnProperty; +function recmaJsxRewrite(options = {}) { + const { + development: development2, + providerImportSource, + outputFormat, + } = options; + return (tree, file) => { + const scopeInfo = analyze(tree); + const fnStack = []; + let importProvider; + let createErrorHelper; + let currentScope; + walk(tree, { + enter(_node) { + const node = _node; + const newScope = scopeInfo.map.get(node); + if ( + node.type === 'FunctionDeclaration' || + node.type === 'FunctionExpression' || + node.type === 'ArrowFunctionExpression' + ) { + fnStack.push({ + objects: [], + components: [], + tags: [], + references: {}, + idToInvalidComponentName: /* @__PURE__ */ new Map(), + node, + }); + if ( + isNamedFunction(node, 'MDXContent') && + newScope && + !inScope(newScope, 'MDXLayout') + ) { + fnStack[0].components.push('MDXLayout'); + } + } + const fnScope = fnStack[0]; + if ( + !fnScope || + (!isNamedFunction(fnScope.node, '_createMdxContent') && + !providerImportSource) + ) { + return; + } + if (newScope) { + newScope.node = node; + currentScope = newScope; + } + if (currentScope && node.type === 'JSXElement') { + let name2 = node.openingElement.name; + if (name2.type === 'JSXMemberExpression') { + const ids = []; + while (name2.type === 'JSXMemberExpression') { + ids.unshift(name2.property.name); + name2 = name2.object; + } + ids.unshift(name2.name); + const fullId = ids.join('.'); + const id = name2.name; + const isInScope = inScope(currentScope, id); + if (!own8.call(fnScope.references, fullId)) { + const parentScope = currentScope.parent; + if ( + !isInScope || + (parentScope && + parentScope.node.type === 'FunctionDeclaration' && + isNamedFunction(parentScope.node, '_createMdxContent')) + ) { + fnScope.references[fullId] = {node, component: true}; + } + } + if (!fnScope.objects.includes(id) && !isInScope) { + fnScope.objects.push(id); + } + } else if (name2.type === 'JSXNamespacedName') { + } else if (name(name2.name) && !/^[a-z]/.test(name2.name)) { + const id = name2.name; + if (!inScope(currentScope, id)) { + if (id !== 'MDXLayout' && !own8.call(fnScope.references, id)) { + fnScope.references[id] = {node, component: true}; + } + if (!fnScope.components.includes(id)) { + fnScope.components.push(id); + } + } + } else if (node.data && node.data._mdxExplicitJsx) { + } else { + const id = name2.name; + if (!fnScope.tags.includes(id)) { + fnScope.tags.push(id); + } + let jsxIdExpression = ['_components', id]; + if (name(id) === false) { + let invalidComponentName = + fnScope.idToInvalidComponentName.get(id); + if (invalidComponentName === void 0) { + invalidComponentName = `_component${fnScope.idToInvalidComponentName.size}`; + fnScope.idToInvalidComponentName.set(id, invalidComponentName); + } + jsxIdExpression = [invalidComponentName]; + } + node.openingElement.name = + toJsxIdOrMemberExpression(jsxIdExpression); + if (node.closingElement) { + node.closingElement.name = + toJsxIdOrMemberExpression(jsxIdExpression); + } + } + } + }, + leave(node) { + const defaults = []; + const actual = []; + const parameters = []; + const declarations = []; + if (currentScope && currentScope.node === node) { + currentScope = currentScope.parent; + } + if ( + node.type === 'FunctionDeclaration' || + node.type === 'FunctionExpression' || + node.type === 'ArrowFunctionExpression' + ) { + const fn = node; + const scope = fnStack[fnStack.length - 1]; + let name2; + for (name2 of scope.tags) { + defaults.push({ + type: 'Property', + kind: 'init', + key: name(name2) + ? {type: 'Identifier', name: name2} + : {type: 'Literal', value: name2}, + value: {type: 'Literal', value: name2}, + method: false, + shorthand: false, + computed: false, + }); + } + actual.push(...scope.components); + for (name2 of scope.objects) { + if (!actual.includes(name2)) { + actual.push(name2); + } + } + const statements = []; + if ( + defaults.length > 0 || + actual.length > 0 || + scope.idToInvalidComponentName.size > 0 + ) { + if (providerImportSource) { + importProvider = true; + parameters.push({ + type: 'CallExpression', + callee: {type: 'Identifier', name: '_provideComponents'}, + arguments: [], + optional: false, + }); + } + if ( + isNamedFunction(scope.node, 'MDXContent') || + isNamedFunction(scope.node, '_createMdxContent') + ) { + parameters.push(toIdOrMemberExpression(['props', 'components'])); + } + if (defaults.length > 0 || parameters.length > 1) { + parameters.unshift({ + type: 'ObjectExpression', + properties: defaults, + }); + } + let componentsInit = + parameters.length > 1 + ? { + type: 'CallExpression', + callee: toIdOrMemberExpression(['Object', 'assign']), + arguments: parameters, + optional: false, + } + : parameters[0].type === 'MemberExpression' + ? { + type: 'LogicalExpression', + operator: '||', + left: parameters[0], + right: {type: 'ObjectExpression', properties: []}, + } + : parameters[0]; + let componentsPattern; + if (actual.length > 0) { + componentsPattern = { + type: 'ObjectPattern', + properties: actual.map((name3) => ({ + type: 'Property', + kind: 'init', + key: { + type: 'Identifier', + name: name3 === 'MDXLayout' ? 'wrapper' : name3, + }, + value: {type: 'Identifier', name: name3}, + method: false, + shorthand: name3 !== 'MDXLayout', + computed: false, + })), + }; + } + if (scope.tags.length > 0) { + declarations.push({ + type: 'VariableDeclarator', + id: {type: 'Identifier', name: '_components'}, + init: componentsInit, + }); + componentsInit = {type: 'Identifier', name: '_components'}; + } + if (isNamedFunction(scope.node, '_createMdxContent')) { + for (const [ + id, + componentName, + ] of scope.idToInvalidComponentName) { + declarations.push({ + type: 'VariableDeclarator', + id: {type: 'Identifier', name: componentName}, + init: { + type: 'MemberExpression', + object: {type: 'Identifier', name: '_components'}, + property: {type: 'Literal', value: id}, + computed: true, + optional: false, + }, + }); + } + } + if (componentsPattern) { + declarations.push({ + type: 'VariableDeclarator', + id: componentsPattern, + init: componentsInit, + }); + } + if (declarations.length > 0) { + statements.push({ + type: 'VariableDeclaration', + kind: 'const', + declarations, + }); + } + } + let key; + for (key in scope.references) { + if (own8.call(scope.references, key)) { + const parts = key.split('.'); + let index3 = 0; + while (++index3 < parts.length) { + const partial = parts.slice(0, index3).join('.'); + if (!own8.call(scope.references, partial)) { + scope.references[partial] = { + node: scope.references[key].node, + component: false, + }; + } + } + } + } + const references = Object.keys(scope.references).sort(); + let index2 = -1; + while (++index2 < references.length) { + const id = references[index2]; + const info = scope.references[id]; + const place = stringifyPosition(positionFromEstree(info.node)); + const parameters2 = [ + {type: 'Literal', value: id}, + {type: 'Literal', value: info.component}, + ]; + createErrorHelper = true; + if (development2 && place !== '1:1-1:1') { + parameters2.push({type: 'Literal', value: place}); + } + statements.push({ + type: 'IfStatement', + test: { + type: 'UnaryExpression', + operator: '!', + prefix: true, + argument: toIdOrMemberExpression(id.split('.')), + }, + consequent: { + type: 'ExpressionStatement', + expression: { + type: 'CallExpression', + callee: {type: 'Identifier', name: '_missingMdxReference'}, + arguments: parameters2, + optional: false, + }, + }, + alternate: null, + }); + } + if (statements.length > 0) { + if (fn.body.type !== 'BlockStatement') { + fn.body = { + type: 'BlockStatement', + body: [{type: 'ReturnStatement', argument: fn.body}], + }; + } + fn.body.body.unshift(...statements); + } + fnStack.pop(); + } + }, + }); + if (importProvider && providerImportSource) { + tree.body.unshift( + createImportProvider(providerImportSource, outputFormat), + ); + } + if (createErrorHelper) { + const message = [ + {type: 'Literal', value: 'Expected '}, + { + type: 'ConditionalExpression', + test: {type: 'Identifier', name: 'component'}, + consequent: {type: 'Literal', value: 'component'}, + alternate: {type: 'Literal', value: 'object'}, + }, + {type: 'Literal', value: ' `'}, + {type: 'Identifier', name: 'id'}, + { + type: 'Literal', + value: + '` to be defined: you likely forgot to import, pass, or provide it.', + }, + ]; + const parameters = [ + {type: 'Identifier', name: 'id'}, + {type: 'Identifier', name: 'component'}, + ]; + if (development2) { + message.push({ + type: 'ConditionalExpression', + test: {type: 'Identifier', name: 'place'}, + consequent: toBinaryAddition([ + { + type: 'Literal', + value: '\nIt\u2019s referenced in your code at `', + }, + {type: 'Identifier', name: 'place'}, + { + type: 'Literal', + value: (file.path ? '` in `' + file.path : '') + '`', + }, + ]), + alternate: {type: 'Literal', value: ''}, + }); + parameters.push({type: 'Identifier', name: 'place'}); + } + tree.body.push({ + type: 'FunctionDeclaration', + id: {type: 'Identifier', name: '_missingMdxReference'}, + generator: false, + async: false, + params: parameters, + body: { + type: 'BlockStatement', + body: [ + { + type: 'ThrowStatement', + argument: { + type: 'NewExpression', + callee: {type: 'Identifier', name: 'Error'}, + arguments: [toBinaryAddition(message)], + }, + }, + ], + }, + }); + } + }; +} +function createImportProvider(providerImportSource, outputFormat) { + const specifiers = [ + { + type: 'ImportSpecifier', + imported: {type: 'Identifier', name: 'useMDXComponents'}, + local: {type: 'Identifier', name: '_provideComponents'}, + }, + ]; + return outputFormat === 'function-body' + ? { + type: 'VariableDeclaration', + kind: 'const', + declarations: specifiersToDeclarations( + specifiers, + toIdOrMemberExpression(['arguments', 0]), + ), + } + : { + type: 'ImportDeclaration', + specifiers, + source: {type: 'Literal', value: providerImportSource}, + }; +} +function isNamedFunction(node, name2) { + return Boolean(node && 'id' in node && node.id && node.id.name === name2); +} +function inScope(scope, id) { + let currentScope = scope; + while (currentScope) { + if (currentScope.declarations.has(id)) { + return true; + } + currentScope = currentScope.parent; + } + return false; +} + +// node_modules/astring/dist/astring.mjs +var {stringify} = JSON; +if (!String.prototype.repeat) { + throw new Error( + 'String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation', + ); +} +if (!String.prototype.endsWith) { + throw new Error( + 'String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation', + ); +} +var OPERATOR_PRECEDENCE = { + '||': 3, + '&&': 4, + '|': 5, + '??': 5, + '^': 6, + '&': 7, + '==': 8, + '!=': 8, + '===': 8, + '!==': 8, + '<': 9, + '>': 9, + '<=': 9, + '>=': 9, + in: 9, + instanceof: 9, + '<<': 10, + '>>': 10, + '>>>': 10, + '+': 11, + '-': 11, + '*': 12, + '%': 12, + '/': 12, + '**': 13, +}; +var NEEDS_PARENTHESES = 17; +var EXPRESSIONS_PRECEDENCE = { + ArrayExpression: 20, + TaggedTemplateExpression: 20, + ThisExpression: 20, + Identifier: 20, + PrivateIdentifier: 20, + Literal: 18, + TemplateLiteral: 20, + Super: 20, + SequenceExpression: 20, + MemberExpression: 19, + ChainExpression: 19, + CallExpression: 19, + NewExpression: 19, + ArrowFunctionExpression: NEEDS_PARENTHESES, + ClassExpression: NEEDS_PARENTHESES, + FunctionExpression: NEEDS_PARENTHESES, + ObjectExpression: NEEDS_PARENTHESES, + UpdateExpression: 16, + UnaryExpression: 15, + AwaitExpression: 15, + BinaryExpression: 14, + LogicalExpression: 13, + ConditionalExpression: 4, + AssignmentExpression: 3, + YieldExpression: 2, + RestElement: 1, +}; +function formatSequence(state, nodes) { + const {generator} = state; + state.write('('); + if (nodes != null && nodes.length > 0) { + generator[nodes[0].type](nodes[0], state); + const {length} = nodes; + for (let i = 1; i < length; i++) { + const param = nodes[i]; + state.write(', '); + generator[param.type](param, state); + } + } + state.write(')'); +} +function expressionNeedsParenthesis(state, node, parentNode, isRightHand) { + const nodePrecedence = state.expressionsPrecedence[node.type]; + if (nodePrecedence === NEEDS_PARENTHESES) { + return true; + } + const parentNodePrecedence = state.expressionsPrecedence[parentNode.type]; + if (nodePrecedence !== parentNodePrecedence) { + return ( + (!isRightHand && + nodePrecedence === 15 && + parentNodePrecedence === 14 && + parentNode.operator === '**') || + nodePrecedence < parentNodePrecedence + ); + } + if (nodePrecedence !== 13 && nodePrecedence !== 14) { + return false; + } + if (node.operator === '**' && parentNode.operator === '**') { + return !isRightHand; + } + if (isRightHand) { + return ( + OPERATOR_PRECEDENCE[node.operator] <= + OPERATOR_PRECEDENCE[parentNode.operator] + ); + } + return ( + OPERATOR_PRECEDENCE[node.operator] < + OPERATOR_PRECEDENCE[parentNode.operator] + ); +} +function formatExpression(state, node, parentNode, isRightHand) { + const {generator} = state; + if (expressionNeedsParenthesis(state, node, parentNode, isRightHand)) { + state.write('('); + generator[node.type](node, state); + state.write(')'); + } else { + generator[node.type](node, state); + } +} +function reindent(state, text5, indent, lineEnd) { + const lines = text5.split('\n'); + const end = lines.length - 1; + state.write(lines[0].trim()); + if (end > 0) { + state.write(lineEnd); + for (let i = 1; i < end; i++) { + state.write(indent + lines[i].trim() + lineEnd); + } + state.write(indent + lines[end].trim()); + } +} +function formatComments(state, comments, indent, lineEnd) { + const {length} = comments; + for (let i = 0; i < length; i++) { + const comment2 = comments[i]; + state.write(indent); + if (comment2.type[0] === 'L') { + state.write('// ' + comment2.value.trim() + '\n', comment2); + } else { + state.write('/*'); + reindent(state, comment2.value, indent, lineEnd); + state.write('*/' + lineEnd); + } + } +} +function hasCallExpression(node) { + let currentNode = node; + while (currentNode != null) { + const {type} = currentNode; + if (type[0] === 'C' && type[1] === 'a') { + return true; + } else if (type[0] === 'M' && type[1] === 'e' && type[2] === 'm') { + currentNode = currentNode.object; + } else { + return false; + } + } +} +function formatVariableDeclaration(state, node) { + const {generator} = state; + const {declarations} = node; + state.write(node.kind + ' '); + const {length} = declarations; + if (length > 0) { + generator.VariableDeclarator(declarations[0], state); + for (let i = 1; i < length; i++) { + state.write(', '); + generator.VariableDeclarator(declarations[i], state); + } + } +} +var ForInStatement; +var FunctionDeclaration; +var RestElement; +var BinaryExpression; +var ArrayExpression; +var BlockStatement; +var GENERATOR = { + Program(node, state) { + const indent = state.indent.repeat(state.indentLevel); + const {lineEnd, writeComments} = state; + if (writeComments && node.comments != null) { + formatComments(state, node.comments, indent, lineEnd); + } + const statements = node.body; + const {length} = statements; + for (let i = 0; i < length; i++) { + const statement = statements[i]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, indent, lineEnd); + } + state.write(indent); + this[statement.type](statement, state); + state.write(lineEnd); + } + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, indent, lineEnd); + } + }, + BlockStatement: (BlockStatement = function (node, state) { + const indent = state.indent.repeat(state.indentLevel++); + const {lineEnd, writeComments} = state; + const statementIndent = indent + state.indent; + state.write('{'); + const statements = node.body; + if (statements != null && statements.length > 0) { + state.write(lineEnd); + if (writeComments && node.comments != null) { + formatComments(state, node.comments, statementIndent, lineEnd); + } + const {length} = statements; + for (let i = 0; i < length; i++) { + const statement = statements[i]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, statementIndent, lineEnd); + } + state.write(statementIndent); + this[statement.type](statement, state); + state.write(lineEnd); + } + state.write(indent); + } else { + if (writeComments && node.comments != null) { + state.write(lineEnd); + formatComments(state, node.comments, statementIndent, lineEnd); + state.write(indent); + } + } + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, statementIndent, lineEnd); + } + state.write('}'); + state.indentLevel--; + }), + ClassBody: BlockStatement, + StaticBlock(node, state) { + state.write('static '); + this.BlockStatement(node, state); + }, + EmptyStatement(node, state) { + state.write(';'); + }, + ExpressionStatement(node, state) { + const precedence = state.expressionsPrecedence[node.expression.type]; + if ( + precedence === NEEDS_PARENTHESES || + (precedence === 3 && node.expression.left.type[0] === 'O') + ) { + state.write('('); + this[node.expression.type](node.expression, state); + state.write(')'); + } else { + this[node.expression.type](node.expression, state); + } + state.write(';'); + }, + IfStatement(node, state) { + state.write('if ('); + this[node.test.type](node.test, state); + state.write(') '); + this[node.consequent.type](node.consequent, state); + if (node.alternate != null) { + state.write(' else '); + this[node.alternate.type](node.alternate, state); + } + }, + LabeledStatement(node, state) { + this[node.label.type](node.label, state); + state.write(': '); + this[node.body.type](node.body, state); + }, + BreakStatement(node, state) { + state.write('break'); + if (node.label != null) { + state.write(' '); + this[node.label.type](node.label, state); + } + state.write(';'); + }, + ContinueStatement(node, state) { + state.write('continue'); + if (node.label != null) { + state.write(' '); + this[node.label.type](node.label, state); + } + state.write(';'); + }, + WithStatement(node, state) { + state.write('with ('); + this[node.object.type](node.object, state); + state.write(') '); + this[node.body.type](node.body, state); + }, + SwitchStatement(node, state) { + const indent = state.indent.repeat(state.indentLevel++); + const {lineEnd, writeComments} = state; + state.indentLevel++; + const caseIndent = indent + state.indent; + const statementIndent = caseIndent + state.indent; + state.write('switch ('); + this[node.discriminant.type](node.discriminant, state); + state.write(') {' + lineEnd); + const {cases: occurences} = node; + const {length: occurencesCount} = occurences; + for (let i = 0; i < occurencesCount; i++) { + const occurence = occurences[i]; + if (writeComments && occurence.comments != null) { + formatComments(state, occurence.comments, caseIndent, lineEnd); + } + if (occurence.test) { + state.write(caseIndent + 'case '); + this[occurence.test.type](occurence.test, state); + state.write(':' + lineEnd); + } else { + state.write(caseIndent + 'default:' + lineEnd); + } + const {consequent} = occurence; + const {length: consequentCount} = consequent; + for (let i2 = 0; i2 < consequentCount; i2++) { + const statement = consequent[i2]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, statementIndent, lineEnd); + } + state.write(statementIndent); + this[statement.type](statement, state); + state.write(lineEnd); + } + } + state.indentLevel -= 2; + state.write(indent + '}'); + }, + ReturnStatement(node, state) { + state.write('return'); + if (node.argument) { + state.write(' '); + this[node.argument.type](node.argument, state); + } + state.write(';'); + }, + ThrowStatement(node, state) { + state.write('throw '); + this[node.argument.type](node.argument, state); + state.write(';'); + }, + TryStatement(node, state) { + state.write('try '); + this[node.block.type](node.block, state); + if (node.handler) { + const {handler} = node; + if (handler.param == null) { + state.write(' catch '); + } else { + state.write(' catch ('); + this[handler.param.type](handler.param, state); + state.write(') '); + } + this[handler.body.type](handler.body, state); + } + if (node.finalizer) { + state.write(' finally '); + this[node.finalizer.type](node.finalizer, state); + } + }, + WhileStatement(node, state) { + state.write('while ('); + this[node.test.type](node.test, state); + state.write(') '); + this[node.body.type](node.body, state); + }, + DoWhileStatement(node, state) { + state.write('do '); + this[node.body.type](node.body, state); + state.write(' while ('); + this[node.test.type](node.test, state); + state.write(');'); + }, + ForStatement(node, state) { + state.write('for ('); + if (node.init != null) { + const {init} = node; + if (init.type[0] === 'V') { + formatVariableDeclaration(state, init); + } else { + this[init.type](init, state); + } + } + state.write('; '); + if (node.test) { + this[node.test.type](node.test, state); + } + state.write('; '); + if (node.update) { + this[node.update.type](node.update, state); + } + state.write(') '); + this[node.body.type](node.body, state); + }, + ForInStatement: (ForInStatement = function (node, state) { + state.write(`for ${node.await ? 'await ' : ''}(`); + const {left} = node; + if (left.type[0] === 'V') { + formatVariableDeclaration(state, left); + } else { + this[left.type](left, state); + } + state.write(node.type[3] === 'I' ? ' in ' : ' of '); + this[node.right.type](node.right, state); + state.write(') '); + this[node.body.type](node.body, state); + }), + ForOfStatement: ForInStatement, + DebuggerStatement(node, state) { + state.write('debugger;', node); + }, + FunctionDeclaration: (FunctionDeclaration = function (node, state) { + state.write( + (node.async ? 'async ' : '') + + (node.generator ? 'function* ' : 'function ') + + (node.id ? node.id.name : ''), + node, + ); + formatSequence(state, node.params); + state.write(' '); + this[node.body.type](node.body, state); + }), + FunctionExpression: FunctionDeclaration, + VariableDeclaration(node, state) { + formatVariableDeclaration(state, node); + state.write(';'); + }, + VariableDeclarator(node, state) { + this[node.id.type](node.id, state); + if (node.init != null) { + state.write(' = '); + this[node.init.type](node.init, state); + } + }, + ClassDeclaration(node, state) { + state.write('class ' + (node.id ? `${node.id.name} ` : ''), node); + if (node.superClass) { + state.write('extends '); + const {superClass} = node; + const {type} = superClass; + const precedence = state.expressionsPrecedence[type]; + if ( + (type[0] !== 'C' || type[1] !== 'l' || type[5] !== 'E') && + (precedence === NEEDS_PARENTHESES || + precedence < state.expressionsPrecedence.ClassExpression) + ) { + state.write('('); + this[node.superClass.type](superClass, state); + state.write(')'); + } else { + this[superClass.type](superClass, state); + } + state.write(' '); + } + this.ClassBody(node.body, state); + }, + ImportDeclaration(node, state) { + state.write('import '); + const {specifiers} = node; + const {length} = specifiers; + let i = 0; + if (length > 0) { + for (; i < length; ) { + if (i > 0) { + state.write(', '); + } + const specifier = specifiers[i]; + const type = specifier.type[6]; + if (type === 'D') { + state.write(specifier.local.name, specifier); + i++; + } else if (type === 'N') { + state.write('* as ' + specifier.local.name, specifier); + i++; + } else { + break; + } + } + if (i < length) { + state.write('{'); + for (;;) { + const specifier = specifiers[i]; + const {name: name2} = specifier.imported; + state.write(name2, specifier); + if (name2 !== specifier.local.name) { + state.write(' as ' + specifier.local.name); + } + if (++i < length) { + state.write(', '); + } else { + break; + } + } + state.write('}'); + } + state.write(' from '); + } + this.Literal(node.source, state); + state.write(';'); + }, + ImportExpression(node, state) { + state.write('import('); + this[node.source.type](node.source, state); + state.write(')'); + }, + ExportDefaultDeclaration(node, state) { + state.write('export default '); + this[node.declaration.type](node.declaration, state); + if ( + state.expressionsPrecedence[node.declaration.type] != null && + node.declaration.type[0] !== 'F' + ) { + state.write(';'); + } + }, + ExportNamedDeclaration(node, state) { + state.write('export '); + if (node.declaration) { + this[node.declaration.type](node.declaration, state); + } else { + state.write('{'); + const {specifiers} = node, + {length} = specifiers; + if (length > 0) { + for (let i = 0; ; ) { + const specifier = specifiers[i]; + const {name: name2} = specifier.local; + state.write(name2, specifier); + if (name2 !== specifier.exported.name) { + state.write(' as ' + specifier.exported.name); + } + if (++i < length) { + state.write(', '); + } else { + break; + } + } + } + state.write('}'); + if (node.source) { + state.write(' from '); + this.Literal(node.source, state); + } + state.write(';'); + } + }, + ExportAllDeclaration(node, state) { + if (node.exported != null) { + state.write('export * as ' + node.exported.name + ' from '); + } else { + state.write('export * from '); + } + this.Literal(node.source, state); + state.write(';'); + }, + MethodDefinition(node, state) { + if (node.static) { + state.write('static '); + } + const kind = node.kind[0]; + if (kind === 'g' || kind === 's') { + state.write(node.kind + ' '); + } + if (node.value.async) { + state.write('async '); + } + if (node.value.generator) { + state.write('*'); + } + if (node.computed) { + state.write('['); + this[node.key.type](node.key, state); + state.write(']'); + } else { + this[node.key.type](node.key, state); + } + formatSequence(state, node.value.params); + state.write(' '); + this[node.value.body.type](node.value.body, state); + }, + ClassExpression(node, state) { + this.ClassDeclaration(node, state); + }, + ArrowFunctionExpression(node, state) { + state.write(node.async ? 'async ' : '', node); + const {params} = node; + if (params != null) { + if (params.length === 1 && params[0].type[0] === 'I') { + state.write(params[0].name, params[0]); + } else { + formatSequence(state, node.params); + } + } + state.write(' => '); + if (node.body.type[0] === 'O') { + state.write('('); + this.ObjectExpression(node.body, state); + state.write(')'); + } else { + this[node.body.type](node.body, state); + } + }, + ThisExpression(node, state) { + state.write('this', node); + }, + Super(node, state) { + state.write('super', node); + }, + RestElement: (RestElement = function (node, state) { + state.write('...'); + this[node.argument.type](node.argument, state); + }), + SpreadElement: RestElement, + YieldExpression(node, state) { + state.write(node.delegate ? 'yield*' : 'yield'); + if (node.argument) { + state.write(' '); + this[node.argument.type](node.argument, state); + } + }, + AwaitExpression(node, state) { + state.write('await ', node); + formatExpression(state, node.argument, node); + }, + TemplateLiteral(node, state) { + const {quasis, expressions} = node; + state.write('`'); + const {length} = expressions; + for (let i = 0; i < length; i++) { + const expression = expressions[i]; + const quasi2 = quasis[i]; + state.write(quasi2.value.raw, quasi2); + state.write('${'); + this[expression.type](expression, state); + state.write('}'); + } + const quasi = quasis[quasis.length - 1]; + state.write(quasi.value.raw, quasi); + state.write('`'); + }, + TemplateElement(node, state) { + state.write(node.value.raw, node); + }, + TaggedTemplateExpression(node, state) { + formatExpression(state, node.tag, node); + this[node.quasi.type](node.quasi, state); + }, + ArrayExpression: (ArrayExpression = function (node, state) { + state.write('['); + if (node.elements.length > 0) { + const {elements} = node, + {length} = elements; + for (let i = 0; ; ) { + const element2 = elements[i]; + if (element2 != null) { + this[element2.type](element2, state); + } + if (++i < length) { + state.write(', '); + } else { + if (element2 == null) { + state.write(', '); + } + break; + } + } + } + state.write(']'); + }), + ArrayPattern: ArrayExpression, + ObjectExpression(node, state) { + const indent = state.indent.repeat(state.indentLevel++); + const {lineEnd, writeComments} = state; + const propertyIndent = indent + state.indent; + state.write('{'); + if (node.properties.length > 0) { + state.write(lineEnd); + if (writeComments && node.comments != null) { + formatComments(state, node.comments, propertyIndent, lineEnd); + } + const comma = ',' + lineEnd; + const {properties} = node, + {length} = properties; + for (let i = 0; ; ) { + const property = properties[i]; + if (writeComments && property.comments != null) { + formatComments(state, property.comments, propertyIndent, lineEnd); + } + state.write(propertyIndent); + this[property.type](property, state); + if (++i < length) { + state.write(comma); + } else { + break; + } + } + state.write(lineEnd); + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + } + state.write(indent + '}'); + } else if (writeComments) { + if (node.comments != null) { + state.write(lineEnd); + formatComments(state, node.comments, propertyIndent, lineEnd); + if (node.trailingComments != null) { + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + } + state.write(indent + '}'); + } else if (node.trailingComments != null) { + state.write(lineEnd); + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + state.write(indent + '}'); + } else { + state.write('}'); + } + } else { + state.write('}'); + } + state.indentLevel--; + }, + Property(node, state) { + if (node.method || node.kind[0] !== 'i') { + this.MethodDefinition(node, state); + } else { + if (!node.shorthand) { + if (node.computed) { + state.write('['); + this[node.key.type](node.key, state); + state.write(']'); + } else { + this[node.key.type](node.key, state); + } + state.write(': '); + } + this[node.value.type](node.value, state); + } + }, + PropertyDefinition(node, state) { + if (node.static) { + state.write('static '); + } + this[node.key.type](node.key, state); + if (node.value == null) { + return; + } + state.write(' = '); + this[node.value.type](node.value, state); + }, + ObjectPattern(node, state) { + state.write('{'); + if (node.properties.length > 0) { + const {properties} = node, + {length} = properties; + for (let i = 0; ; ) { + this[properties[i].type](properties[i], state); + if (++i < length) { + state.write(', '); + } else { + break; + } + } + } + state.write('}'); + }, + SequenceExpression(node, state) { + formatSequence(state, node.expressions); + }, + UnaryExpression(node, state) { + if (node.prefix) { + const { + operator, + argument, + argument: {type}, + } = node; + state.write(operator); + const needsParentheses = expressionNeedsParenthesis( + state, + argument, + node, + ); + if ( + !needsParentheses && + (operator.length > 1 || + (type[0] === 'U' && + (type[1] === 'n' || type[1] === 'p') && + argument.prefix && + argument.operator[0] === operator && + (operator === '+' || operator === '-'))) + ) { + state.write(' '); + } + if (needsParentheses) { + state.write(operator.length > 1 ? ' (' : '('); + this[type](argument, state); + state.write(')'); + } else { + this[type](argument, state); + } + } else { + this[node.argument.type](node.argument, state); + state.write(node.operator); + } + }, + UpdateExpression(node, state) { + if (node.prefix) { + state.write(node.operator); + this[node.argument.type](node.argument, state); + } else { + this[node.argument.type](node.argument, state); + state.write(node.operator); + } + }, + AssignmentExpression(node, state) { + this[node.left.type](node.left, state); + state.write(' ' + node.operator + ' '); + this[node.right.type](node.right, state); + }, + AssignmentPattern(node, state) { + this[node.left.type](node.left, state); + state.write(' = '); + this[node.right.type](node.right, state); + }, + BinaryExpression: (BinaryExpression = function (node, state) { + const isIn = node.operator === 'in'; + if (isIn) { + state.write('('); + } + formatExpression(state, node.left, node, false); + state.write(' ' + node.operator + ' '); + formatExpression(state, node.right, node, true); + if (isIn) { + state.write(')'); + } + }), + LogicalExpression: BinaryExpression, + ConditionalExpression(node, state) { + const {test} = node; + const precedence = state.expressionsPrecedence[test.type]; + if ( + precedence === NEEDS_PARENTHESES || + precedence <= state.expressionsPrecedence.ConditionalExpression + ) { + state.write('('); + this[test.type](test, state); + state.write(')'); + } else { + this[test.type](test, state); + } + state.write(' ? '); + this[node.consequent.type](node.consequent, state); + state.write(' : '); + this[node.alternate.type](node.alternate, state); + }, + NewExpression(node, state) { + state.write('new '); + const precedence = state.expressionsPrecedence[node.callee.type]; + if ( + precedence === NEEDS_PARENTHESES || + precedence < state.expressionsPrecedence.CallExpression || + hasCallExpression(node.callee) + ) { + state.write('('); + this[node.callee.type](node.callee, state); + state.write(')'); + } else { + this[node.callee.type](node.callee, state); + } + formatSequence(state, node['arguments']); + }, + CallExpression(node, state) { + const precedence = state.expressionsPrecedence[node.callee.type]; + if ( + precedence === NEEDS_PARENTHESES || + precedence < state.expressionsPrecedence.CallExpression + ) { + state.write('('); + this[node.callee.type](node.callee, state); + state.write(')'); + } else { + this[node.callee.type](node.callee, state); + } + if (node.optional) { + state.write('?.'); + } + formatSequence(state, node['arguments']); + }, + ChainExpression(node, state) { + this[node.expression.type](node.expression, state); + }, + MemberExpression(node, state) { + const precedence = state.expressionsPrecedence[node.object.type]; + if ( + precedence === NEEDS_PARENTHESES || + precedence < state.expressionsPrecedence.MemberExpression + ) { + state.write('('); + this[node.object.type](node.object, state); + state.write(')'); + } else { + this[node.object.type](node.object, state); + } + if (node.computed) { + if (node.optional) { + state.write('?.'); + } + state.write('['); + this[node.property.type](node.property, state); + state.write(']'); + } else { + if (node.optional) { + state.write('?.'); + } else { + state.write('.'); + } + this[node.property.type](node.property, state); + } + }, + MetaProperty(node, state) { + state.write(node.meta.name + '.' + node.property.name, node); + }, + Identifier(node, state) { + state.write(node.name, node); + }, + PrivateIdentifier(node, state) { + state.write(`#${node.name}`, node); + }, + Literal(node, state) { + if (node.raw != null) { + state.write(node.raw, node); + } else if (node.regex != null) { + this.RegExpLiteral(node, state); + } else if (node.bigint != null) { + state.write(node.bigint + 'n', node); + } else { + state.write(stringify(node.value), node); + } + }, + RegExpLiteral(node, state) { + const {regex: regex2} = node; + state.write(`/${regex2.pattern}/${regex2.flags}`, node); + }, +}; +var EMPTY_OBJECT = {}; +var State = class { + constructor(options) { + const setup = options == null ? EMPTY_OBJECT : options; + this.output = ''; + if (setup.output != null) { + this.output = setup.output; + this.write = this.writeToStream; + } else { + this.output = ''; + } + this.generator = setup.generator != null ? setup.generator : GENERATOR; + this.expressionsPrecedence = + setup.expressionsPrecedence != null + ? setup.expressionsPrecedence + : EXPRESSIONS_PRECEDENCE; + this.indent = setup.indent != null ? setup.indent : ' '; + this.lineEnd = setup.lineEnd != null ? setup.lineEnd : '\n'; + this.indentLevel = + setup.startingIndentLevel != null ? setup.startingIndentLevel : 0; + this.writeComments = setup.comments ? setup.comments : false; + if (setup.sourceMap != null) { + this.write = + setup.output == null ? this.writeAndMap : this.writeToStreamAndMap; + this.sourceMap = setup.sourceMap; + this.line = 1; + this.column = 0; + this.lineEndSize = this.lineEnd.split('\n').length - 1; + this.mapping = { + original: null, + generated: this, + name: void 0, + source: setup.sourceMap.file || setup.sourceMap._file, + }; + } + } + write(code2) { + this.output += code2; + } + writeToStream(code2) { + this.output.write(code2); + } + writeAndMap(code2, node) { + this.output += code2; + this.map(code2, node); + } + writeToStreamAndMap(code2, node) { + this.output.write(code2); + this.map(code2, node); + } + map(code2, node) { + if (node != null) { + const {type} = node; + if (type[0] === 'L' && type[2] === 'n') { + this.column = 0; + this.line++; + return; + } + if (node.loc != null) { + const {mapping} = this; + mapping.original = node.loc.start; + mapping.name = node.name; + this.sourceMap.addMapping(mapping); + } + if ( + (type[0] === 'T' && type[8] === 'E') || + (type[0] === 'L' && type[1] === 'i' && typeof node.value === 'string') + ) { + const {length: length2} = code2; + let {column, line} = this; + for (let i = 0; i < length2; i++) { + if (code2[i] === '\n') { + column = 0; + line++; + } else { + column++; + } + } + this.column = column; + this.line = line; + return; + } + } + const {length} = code2; + const {lineEnd} = this; + if (length > 0) { + if ( + this.lineEndSize > 0 && + (lineEnd.length === 1 + ? code2[length - 1] === lineEnd + : code2.endsWith(lineEnd)) + ) { + this.line += this.lineEndSize; + this.column = 0; + } else { + this.column += length; + } + } + } + toString() { + return this.output; + } +}; +function generate(node, options) { + const state = new State(options); + state.generator[node.type](node, state); + return state.output; +} + +// node_modules/estree-util-to-js/lib/index.js +var toJs = function (tree, options = {}) { + const {SourceMapGenerator, filePath, handlers: handlers2} = options; + const sourceMap = SourceMapGenerator + ? new SourceMapGenerator({file: filePath || '.js'}) + : void 0; + const value = generate(tree, { + comments: true, + generator: {...GENERATOR, ...handlers2}, + sourceMap, + }); + const map = sourceMap ? sourceMap.toJSON() : void 0; + return {value, map}; +}; + +// node_modules/estree-util-to-js/lib/jsx.js +var jsx = { + JSXAttribute, + JSXClosingElement, + JSXClosingFragment, + JSXElement, + JSXEmptyExpression, + JSXExpressionContainer, + JSXFragment, + JSXIdentifier, + JSXMemberExpression, + JSXNamespacedName, + JSXOpeningElement, + JSXOpeningFragment, + JSXSpreadAttribute, + JSXText, +}; +function JSXAttribute(node, state) { + this[node.name.type](node.name, state); + if (node.value !== void 0 && node.value !== null) { + state.write('='); + if (node.value.type === 'Literal') { + state.write( + '"' + encodeJsx(String(node.value.value)).replace(/"/g, '"') + '"', + node, + ); + } else { + this[node.value.type](node.value, state); + } + } +} +function JSXClosingElement(node, state) { + state.write(''); +} +function JSXClosingFragment(node, state) { + state.write('', node); +} +function JSXElement(node, state) { + let index2 = -1; + this[node.openingElement.type](node.openingElement, state); + if (node.children) { + while (++index2 < node.children.length) { + const child = node.children[index2]; + if (child.type === 'JSXSpreadChild') { + throw new Error('JSX spread children are not supported'); + } + this[child.type](child, state); + } + } + if (node.closingElement) { + this[node.closingElement.type](node.closingElement, state); + } +} +function JSXEmptyExpression() {} +function JSXExpressionContainer(node, state) { + state.write('{'); + this[node.expression.type](node.expression, state); + state.write('}'); +} +function JSXFragment(node, state) { + let index2 = -1; + this[node.openingFragment.type](node.openingFragment, state); + if (node.children) { + while (++index2 < node.children.length) { + const child = node.children[index2]; + if (child.type === 'JSXSpreadChild') { + throw new Error('JSX spread children are not supported'); + } + this[child.type](child, state); + } + } + this[node.closingFragment.type](node.closingFragment, state); +} +function JSXIdentifier(node, state) { + state.write(node.name, node); +} +function JSXMemberExpression(node, state) { + this[node.object.type](node.object, state); + state.write('.'); + this[node.property.type](node.property, state); +} +function JSXNamespacedName(node, state) { + this[node.namespace.type](node.namespace, state); + state.write(':'); + this[node.name.type](node.name, state); +} +function JSXOpeningElement(node, state) { + let index2 = -1; + state.write('<'); + this[node.name.type](node.name, state); + if (node.attributes) { + while (++index2 < node.attributes.length) { + state.write(' '); + this[node.attributes[index2].type](node.attributes[index2], state); + } + } + state.write(node.selfClosing ? ' />' : '>'); +} +function JSXOpeningFragment(node, state) { + state.write('<>', node); +} +function JSXSpreadAttribute(node, state) { + state.write('{'); + this.SpreadElement(node, state); + state.write('}'); +} +function JSXText(node, state) { + state.write( + encodeJsx(node.value).replace(/[<>{}]/g, ($0) => + $0 === '<' + ? '<' + : $0 === '>' + ? '>' + : $0 === '{' + ? '{' + : '}', + ), + node, + ); +} +function encodeJsx(value) { + return value.replace(/&(?=[#a-z])/gi, '&'); +} + +// node_modules/@mdx-js/mdx/lib/plugin/recma-stringify.js +function recmaStringify(options = {}) { + const {SourceMapGenerator} = options; + Object.assign(this, {Compiler: compiler2}); + function compiler2(tree, file) { + const result = SourceMapGenerator + ? toJs(tree, { + filePath: file.path || 'unknown.mdx', + SourceMapGenerator, + handlers: jsx, + }) + : toJs(tree, {handlers: jsx}); + file.map = result.map; + return result.value; + } +} + +// node_modules/hast-util-to-estree/node_modules/comma-separated-tokens/index.js +function stringify2(values, options) { + var settings = options || {}; + if (values[values.length - 1] === '') { + values = values.concat(''); + } + return values + .join( + (settings.padRight ? ' ' : '') + + ',' + + (settings.padLeft === false ? '' : ' '), + ) + .trim(); +} + +// node_modules/estree-util-attach-comments/index.js +var own9 = {}.hasOwnProperty; +function attachComments(tree, comments) { + const list3 = (comments || []).concat().sort(compare); + if (list3.length > 0) walk2(tree, {comments: list3, index: 0}); + return tree; +} +function walk2(node, state) { + if (state.index === state.comments.length) { + return; + } + const children = []; + const comments = []; + let key; + for (key in node) { + if (own9.call(node, key)) { + const value = node[key]; + if (value && typeof value === 'object' && key !== 'comments') { + if (Array.isArray(value)) { + let index3 = -1; + while (++index3 < value.length) { + if (value[index3] && typeof value[index3].type === 'string') { + children.push(value[index3]); + } + } + } else if (typeof value.type === 'string') { + children.push(value); + } + } + } + } + children.sort(compare); + comments.push(...slice(state, node, false, {leading: true, trailing: false})); + let index2 = -1; + while (++index2 < children.length) { + walk2(children[index2], state); + } + comments.push( + ...slice(state, node, true, { + leading: false, + trailing: children.length > 0, + }), + ); + if (comments.length > 0) { + node.comments = comments; + } +} +function slice(state, node, compareEnd, fields) { + const result = []; + while ( + state.comments[state.index] && + compare(state.comments[state.index], node, compareEnd) < 1 + ) { + result.push(Object.assign({}, state.comments[state.index++], fields)); + } + return result; +} +function compare(left, right, compareEnd) { + const field = compareEnd ? 'end' : 'start'; + if (left.range && right.range) { + return left.range[0] - right.range[compareEnd ? 1 : 0]; + } + if (left.loc && left.loc.start && right.loc && right.loc[field]) { + return ( + left.loc.start.line - right.loc[field].line || + left.loc.start.column - right.loc[field].column + ); + } + if ('start' in left && field in right) { + return left.start - right[field]; + } + return Number.NaN; +} + +// node_modules/hast-util-to-estree/node_modules/hast-util-whitespace/index.js +function whitespace(thing) { + var value = + thing && typeof thing === 'object' && thing.type === 'text' + ? thing.value || '' + : thing; + return typeof value === 'string' && value.replace(/[ \t\n\f\r]/g, '') === ''; +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/schema.js +var Schema = class { + constructor(property, normal, space2) { + this.property = property; + this.normal = normal; + if (space2) { + this.space = space2; + } + } +}; +Schema.prototype.property = {}; +Schema.prototype.normal = {}; +Schema.prototype.space = null; + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/merge.js +function merge(definitions2, space2) { + const property = {}; + const normal = {}; + let index2 = -1; + while (++index2 < definitions2.length) { + Object.assign(property, definitions2[index2].property); + Object.assign(normal, definitions2[index2].normal); + } + return new Schema(property, normal, space2); +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/normalize.js +function normalize(value) { + return value.toLowerCase(); +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/info.js +var Info = class { + constructor(property, attribute) { + this.property = property; + this.attribute = attribute; + } +}; +Info.prototype.space = null; +Info.prototype.boolean = false; +Info.prototype.booleanish = false; +Info.prototype.overloadedBoolean = false; +Info.prototype.number = false; +Info.prototype.commaSeparated = false; +Info.prototype.spaceSeparated = false; +Info.prototype.commaOrSpaceSeparated = false; +Info.prototype.mustUseProperty = false; +Info.prototype.defined = false; + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/types.js +var types_exports = {}; +__export(types_exports, { + boolean: () => boolean, + booleanish: () => booleanish, + commaOrSpaceSeparated: () => commaOrSpaceSeparated, + commaSeparated: () => commaSeparated, + number: () => number, + overloadedBoolean: () => overloadedBoolean, + spaceSeparated: () => spaceSeparated, +}); +var powers = 0; +var boolean = increment(); +var booleanish = increment(); +var overloadedBoolean = increment(); +var number = increment(); +var spaceSeparated = increment(); +var commaSeparated = increment(); +var commaOrSpaceSeparated = increment(); +function increment() { + return 2 ** ++powers; +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/defined-info.js +var checks = Object.keys(types_exports); +var DefinedInfo = class extends Info { + constructor(property, attribute, mask, space2) { + let index2 = -1; + super(property, attribute); + mark(this, 'space', space2); + if (typeof mask === 'number') { + while (++index2 < checks.length) { + const check = checks[index2]; + mark( + this, + checks[index2], + (mask & types_exports[check]) === types_exports[check], + ); + } + } + } +}; +DefinedInfo.prototype.defined = true; +function mark(values, key, value) { + if (value) { + values[key] = value; + } +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/create.js +var own10 = {}.hasOwnProperty; +function create3(definition2) { + const property = {}; + const normal = {}; + let prop; + for (prop in definition2.properties) { + if (own10.call(definition2.properties, prop)) { + const value = definition2.properties[prop]; + const info = new DefinedInfo( + prop, + definition2.transform(definition2.attributes || {}, prop), + value, + definition2.space, + ); + if ( + definition2.mustUseProperty && + definition2.mustUseProperty.includes(prop) + ) { + info.mustUseProperty = true; + } + property[prop] = info; + normal[normalize(prop)] = prop; + normal[normalize(info.attribute)] = prop; + } + } + return new Schema(property, normal, definition2.space); +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/xlink.js +var xlink = create3({ + space: 'xlink', + transform(_, prop) { + return 'xlink:' + prop.slice(5).toLowerCase(); + }, + properties: { + xLinkActuate: null, + xLinkArcRole: null, + xLinkHref: null, + xLinkRole: null, + xLinkShow: null, + xLinkTitle: null, + xLinkType: null, + }, +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/xml.js +var xml = create3({ + space: 'xml', + transform(_, prop) { + return 'xml:' + prop.slice(3).toLowerCase(); + }, + properties: {xmlLang: null, xmlBase: null, xmlSpace: null}, +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/case-sensitive-transform.js +function caseSensitiveTransform(attributes, attribute) { + return attribute in attributes ? attributes[attribute] : attribute; +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/case-insensitive-transform.js +function caseInsensitiveTransform(attributes, property) { + return caseSensitiveTransform(attributes, property.toLowerCase()); +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/xmlns.js +var xmlns = create3({ + space: 'xmlns', + attributes: {xmlnsxlink: 'xmlns:xlink'}, + transform: caseInsensitiveTransform, + properties: {xmlns: null, xmlnsXLink: null}, +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/aria.js +var aria = create3({ + transform(_, prop) { + return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase(); + }, + properties: { + ariaActiveDescendant: null, + ariaAtomic: booleanish, + ariaAutoComplete: null, + ariaBusy: booleanish, + ariaChecked: booleanish, + ariaColCount: number, + ariaColIndex: number, + ariaColSpan: number, + ariaControls: spaceSeparated, + ariaCurrent: null, + ariaDescribedBy: spaceSeparated, + ariaDetails: null, + ariaDisabled: booleanish, + ariaDropEffect: spaceSeparated, + ariaErrorMessage: null, + ariaExpanded: booleanish, + ariaFlowTo: spaceSeparated, + ariaGrabbed: booleanish, + ariaHasPopup: null, + ariaHidden: booleanish, + ariaInvalid: null, + ariaKeyShortcuts: null, + ariaLabel: null, + ariaLabelledBy: spaceSeparated, + ariaLevel: number, + ariaLive: null, + ariaModal: booleanish, + ariaMultiLine: booleanish, + ariaMultiSelectable: booleanish, + ariaOrientation: null, + ariaOwns: spaceSeparated, + ariaPlaceholder: null, + ariaPosInSet: number, + ariaPressed: booleanish, + ariaReadOnly: booleanish, + ariaRelevant: null, + ariaRequired: booleanish, + ariaRoleDescription: spaceSeparated, + ariaRowCount: number, + ariaRowIndex: number, + ariaRowSpan: number, + ariaSelected: booleanish, + ariaSetSize: number, + ariaSort: null, + ariaValueMax: number, + ariaValueMin: number, + ariaValueNow: number, + ariaValueText: null, + role: null, + }, +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/html.js +var html2 = create3({ + space: 'html', + attributes: { + acceptcharset: 'accept-charset', + classname: 'class', + htmlfor: 'for', + httpequiv: 'http-equiv', + }, + transform: caseInsensitiveTransform, + mustUseProperty: ['checked', 'multiple', 'muted', 'selected'], + properties: { + abbr: null, + accept: commaSeparated, + acceptCharset: spaceSeparated, + accessKey: spaceSeparated, + action: null, + allow: null, + allowFullScreen: boolean, + allowPaymentRequest: boolean, + allowUserMedia: boolean, + alt: null, + as: null, + async: boolean, + autoCapitalize: null, + autoComplete: spaceSeparated, + autoFocus: boolean, + autoPlay: boolean, + capture: boolean, + charSet: null, + checked: boolean, + cite: null, + className: spaceSeparated, + cols: number, + colSpan: null, + content: null, + contentEditable: booleanish, + controls: boolean, + controlsList: spaceSeparated, + coords: number | commaSeparated, + crossOrigin: null, + data: null, + dateTime: null, + decoding: null, + default: boolean, + defer: boolean, + dir: null, + dirName: null, + disabled: boolean, + download: overloadedBoolean, + draggable: booleanish, + encType: null, + enterKeyHint: null, + form: null, + formAction: null, + formEncType: null, + formMethod: null, + formNoValidate: boolean, + formTarget: null, + headers: spaceSeparated, + height: number, + hidden: boolean, + high: number, + href: null, + hrefLang: null, + htmlFor: spaceSeparated, + httpEquiv: spaceSeparated, + id: null, + imageSizes: null, + imageSrcSet: null, + inputMode: null, + integrity: null, + is: null, + isMap: boolean, + itemId: null, + itemProp: spaceSeparated, + itemRef: spaceSeparated, + itemScope: boolean, + itemType: spaceSeparated, + kind: null, + label: null, + lang: null, + language: null, + list: null, + loading: null, + loop: boolean, + low: number, + manifest: null, + max: null, + maxLength: number, + media: null, + method: null, + min: null, + minLength: number, + multiple: boolean, + muted: boolean, + name: null, + nonce: null, + noModule: boolean, + noValidate: boolean, + onAbort: null, + onAfterPrint: null, + onAuxClick: null, + onBeforePrint: null, + onBeforeUnload: null, + onBlur: null, + onCancel: null, + onCanPlay: null, + onCanPlayThrough: null, + onChange: null, + onClick: null, + onClose: null, + onContextLost: null, + onContextMenu: null, + onContextRestored: null, + onCopy: null, + onCueChange: null, + onCut: null, + onDblClick: null, + onDrag: null, + onDragEnd: null, + onDragEnter: null, + onDragExit: null, + onDragLeave: null, + onDragOver: null, + onDragStart: null, + onDrop: null, + onDurationChange: null, + onEmptied: null, + onEnded: null, + onError: null, + onFocus: null, + onFormData: null, + onHashChange: null, + onInput: null, + onInvalid: null, + onKeyDown: null, + onKeyPress: null, + onKeyUp: null, + onLanguageChange: null, + onLoad: null, + onLoadedData: null, + onLoadedMetadata: null, + onLoadEnd: null, + onLoadStart: null, + onMessage: null, + onMessageError: null, + onMouseDown: null, + onMouseEnter: null, + onMouseLeave: null, + onMouseMove: null, + onMouseOut: null, + onMouseOver: null, + onMouseUp: null, + onOffline: null, + onOnline: null, + onPageHide: null, + onPageShow: null, + onPaste: null, + onPause: null, + onPlay: null, + onPlaying: null, + onPopState: null, + onProgress: null, + onRateChange: null, + onRejectionHandled: null, + onReset: null, + onResize: null, + onScroll: null, + onSecurityPolicyViolation: null, + onSeeked: null, + onSeeking: null, + onSelect: null, + onSlotChange: null, + onStalled: null, + onStorage: null, + onSubmit: null, + onSuspend: null, + onTimeUpdate: null, + onToggle: null, + onUnhandledRejection: null, + onUnload: null, + onVolumeChange: null, + onWaiting: null, + onWheel: null, + open: boolean, + optimum: number, + pattern: null, + ping: spaceSeparated, + placeholder: null, + playsInline: boolean, + poster: null, + preload: null, + readOnly: boolean, + referrerPolicy: null, + rel: spaceSeparated, + required: boolean, + reversed: boolean, + rows: number, + rowSpan: number, + sandbox: spaceSeparated, + scope: null, + scoped: boolean, + seamless: boolean, + selected: boolean, + shape: null, + size: number, + sizes: null, + slot: null, + span: number, + spellCheck: booleanish, + src: null, + srcDoc: null, + srcLang: null, + srcSet: null, + start: number, + step: null, + style: null, + tabIndex: number, + target: null, + title: null, + translate: null, + type: null, + typeMustMatch: boolean, + useMap: null, + value: booleanish, + width: number, + wrap: null, + align: null, + aLink: null, + archive: spaceSeparated, + axis: null, + background: null, + bgColor: null, + border: number, + borderColor: null, + bottomMargin: number, + cellPadding: null, + cellSpacing: null, + char: null, + charOff: null, + classId: null, + clear: null, + code: null, + codeBase: null, + codeType: null, + color: null, + compact: boolean, + declare: boolean, + event: null, + face: null, + frame: null, + frameBorder: null, + hSpace: number, + leftMargin: number, + link: null, + longDesc: null, + lowSrc: null, + marginHeight: number, + marginWidth: number, + noResize: boolean, + noHref: boolean, + noShade: boolean, + noWrap: boolean, + object: null, + profile: null, + prompt: null, + rev: null, + rightMargin: number, + rules: null, + scheme: null, + scrolling: booleanish, + standby: null, + summary: null, + text: null, + topMargin: number, + valueType: null, + version: null, + vAlign: null, + vLink: null, + vSpace: number, + allowTransparency: null, + autoCorrect: null, + autoSave: null, + disablePictureInPicture: boolean, + disableRemotePlayback: boolean, + prefix: null, + property: null, + results: number, + security: null, + unselectable: null, + }, +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/svg.js +var svg = create3({ + space: 'svg', + attributes: { + accentHeight: 'accent-height', + alignmentBaseline: 'alignment-baseline', + arabicForm: 'arabic-form', + baselineShift: 'baseline-shift', + capHeight: 'cap-height', + className: 'class', + clipPath: 'clip-path', + clipRule: 'clip-rule', + colorInterpolation: 'color-interpolation', + colorInterpolationFilters: 'color-interpolation-filters', + colorProfile: 'color-profile', + colorRendering: 'color-rendering', + crossOrigin: 'crossorigin', + dataType: 'datatype', + dominantBaseline: 'dominant-baseline', + enableBackground: 'enable-background', + fillOpacity: 'fill-opacity', + fillRule: 'fill-rule', + floodColor: 'flood-color', + floodOpacity: 'flood-opacity', + fontFamily: 'font-family', + fontSize: 'font-size', + fontSizeAdjust: 'font-size-adjust', + fontStretch: 'font-stretch', + fontStyle: 'font-style', + fontVariant: 'font-variant', + fontWeight: 'font-weight', + glyphName: 'glyph-name', + glyphOrientationHorizontal: 'glyph-orientation-horizontal', + glyphOrientationVertical: 'glyph-orientation-vertical', + hrefLang: 'hreflang', + horizAdvX: 'horiz-adv-x', + horizOriginX: 'horiz-origin-x', + horizOriginY: 'horiz-origin-y', + imageRendering: 'image-rendering', + letterSpacing: 'letter-spacing', + lightingColor: 'lighting-color', + markerEnd: 'marker-end', + markerMid: 'marker-mid', + markerStart: 'marker-start', + navDown: 'nav-down', + navDownLeft: 'nav-down-left', + navDownRight: 'nav-down-right', + navLeft: 'nav-left', + navNext: 'nav-next', + navPrev: 'nav-prev', + navRight: 'nav-right', + navUp: 'nav-up', + navUpLeft: 'nav-up-left', + navUpRight: 'nav-up-right', + onAbort: 'onabort', + onActivate: 'onactivate', + onAfterPrint: 'onafterprint', + onBeforePrint: 'onbeforeprint', + onBegin: 'onbegin', + onCancel: 'oncancel', + onCanPlay: 'oncanplay', + onCanPlayThrough: 'oncanplaythrough', + onChange: 'onchange', + onClick: 'onclick', + onClose: 'onclose', + onCopy: 'oncopy', + onCueChange: 'oncuechange', + onCut: 'oncut', + onDblClick: 'ondblclick', + onDrag: 'ondrag', + onDragEnd: 'ondragend', + onDragEnter: 'ondragenter', + onDragExit: 'ondragexit', + onDragLeave: 'ondragleave', + onDragOver: 'ondragover', + onDragStart: 'ondragstart', + onDrop: 'ondrop', + onDurationChange: 'ondurationchange', + onEmptied: 'onemptied', + onEnd: 'onend', + onEnded: 'onended', + onError: 'onerror', + onFocus: 'onfocus', + onFocusIn: 'onfocusin', + onFocusOut: 'onfocusout', + onHashChange: 'onhashchange', + onInput: 'oninput', + onInvalid: 'oninvalid', + onKeyDown: 'onkeydown', + onKeyPress: 'onkeypress', + onKeyUp: 'onkeyup', + onLoad: 'onload', + onLoadedData: 'onloadeddata', + onLoadedMetadata: 'onloadedmetadata', + onLoadStart: 'onloadstart', + onMessage: 'onmessage', + onMouseDown: 'onmousedown', + onMouseEnter: 'onmouseenter', + onMouseLeave: 'onmouseleave', + onMouseMove: 'onmousemove', + onMouseOut: 'onmouseout', + onMouseOver: 'onmouseover', + onMouseUp: 'onmouseup', + onMouseWheel: 'onmousewheel', + onOffline: 'onoffline', + onOnline: 'ononline', + onPageHide: 'onpagehide', + onPageShow: 'onpageshow', + onPaste: 'onpaste', + onPause: 'onpause', + onPlay: 'onplay', + onPlaying: 'onplaying', + onPopState: 'onpopstate', + onProgress: 'onprogress', + onRateChange: 'onratechange', + onRepeat: 'onrepeat', + onReset: 'onreset', + onResize: 'onresize', + onScroll: 'onscroll', + onSeeked: 'onseeked', + onSeeking: 'onseeking', + onSelect: 'onselect', + onShow: 'onshow', + onStalled: 'onstalled', + onStorage: 'onstorage', + onSubmit: 'onsubmit', + onSuspend: 'onsuspend', + onTimeUpdate: 'ontimeupdate', + onToggle: 'ontoggle', + onUnload: 'onunload', + onVolumeChange: 'onvolumechange', + onWaiting: 'onwaiting', + onZoom: 'onzoom', + overlinePosition: 'overline-position', + overlineThickness: 'overline-thickness', + paintOrder: 'paint-order', + panose1: 'panose-1', + pointerEvents: 'pointer-events', + referrerPolicy: 'referrerpolicy', + renderingIntent: 'rendering-intent', + shapeRendering: 'shape-rendering', + stopColor: 'stop-color', + stopOpacity: 'stop-opacity', + strikethroughPosition: 'strikethrough-position', + strikethroughThickness: 'strikethrough-thickness', + strokeDashArray: 'stroke-dasharray', + strokeDashOffset: 'stroke-dashoffset', + strokeLineCap: 'stroke-linecap', + strokeLineJoin: 'stroke-linejoin', + strokeMiterLimit: 'stroke-miterlimit', + strokeOpacity: 'stroke-opacity', + strokeWidth: 'stroke-width', + tabIndex: 'tabindex', + textAnchor: 'text-anchor', + textDecoration: 'text-decoration', + textRendering: 'text-rendering', + typeOf: 'typeof', + underlinePosition: 'underline-position', + underlineThickness: 'underline-thickness', + unicodeBidi: 'unicode-bidi', + unicodeRange: 'unicode-range', + unitsPerEm: 'units-per-em', + vAlphabetic: 'v-alphabetic', + vHanging: 'v-hanging', + vIdeographic: 'v-ideographic', + vMathematical: 'v-mathematical', + vectorEffect: 'vector-effect', + vertAdvY: 'vert-adv-y', + vertOriginX: 'vert-origin-x', + vertOriginY: 'vert-origin-y', + wordSpacing: 'word-spacing', + writingMode: 'writing-mode', + xHeight: 'x-height', + playbackOrder: 'playbackorder', + timelineBegin: 'timelinebegin', + }, + transform: caseSensitiveTransform, + properties: { + about: commaOrSpaceSeparated, + accentHeight: number, + accumulate: null, + additive: null, + alignmentBaseline: null, + alphabetic: number, + amplitude: number, + arabicForm: null, + ascent: number, + attributeName: null, + attributeType: null, + azimuth: number, + bandwidth: null, + baselineShift: null, + baseFrequency: null, + baseProfile: null, + bbox: null, + begin: null, + bias: number, + by: null, + calcMode: null, + capHeight: number, + className: spaceSeparated, + clip: null, + clipPath: null, + clipPathUnits: null, + clipRule: null, + color: null, + colorInterpolation: null, + colorInterpolationFilters: null, + colorProfile: null, + colorRendering: null, + content: null, + contentScriptType: null, + contentStyleType: null, + crossOrigin: null, + cursor: null, + cx: null, + cy: null, + d: null, + dataType: null, + defaultAction: null, + descent: number, + diffuseConstant: number, + direction: null, + display: null, + dur: null, + divisor: number, + dominantBaseline: null, + download: boolean, + dx: null, + dy: null, + edgeMode: null, + editable: null, + elevation: number, + enableBackground: null, + end: null, + event: null, + exponent: number, + externalResourcesRequired: null, + fill: null, + fillOpacity: number, + fillRule: null, + filter: null, + filterRes: null, + filterUnits: null, + floodColor: null, + floodOpacity: null, + focusable: null, + focusHighlight: null, + fontFamily: null, + fontSize: null, + fontSizeAdjust: null, + fontStretch: null, + fontStyle: null, + fontVariant: null, + fontWeight: null, + format: null, + fr: null, + from: null, + fx: null, + fy: null, + g1: commaSeparated, + g2: commaSeparated, + glyphName: commaSeparated, + glyphOrientationHorizontal: null, + glyphOrientationVertical: null, + glyphRef: null, + gradientTransform: null, + gradientUnits: null, + handler: null, + hanging: number, + hatchContentUnits: null, + hatchUnits: null, + height: null, + href: null, + hrefLang: null, + horizAdvX: number, + horizOriginX: number, + horizOriginY: number, + id: null, + ideographic: number, + imageRendering: null, + initialVisibility: null, + in: null, + in2: null, + intercept: number, + k: number, + k1: number, + k2: number, + k3: number, + k4: number, + kernelMatrix: commaOrSpaceSeparated, + kernelUnitLength: null, + keyPoints: null, + keySplines: null, + keyTimes: null, + kerning: null, + lang: null, + lengthAdjust: null, + letterSpacing: null, + lightingColor: null, + limitingConeAngle: number, + local: null, + markerEnd: null, + markerMid: null, + markerStart: null, + markerHeight: null, + markerUnits: null, + markerWidth: null, + mask: null, + maskContentUnits: null, + maskUnits: null, + mathematical: null, + max: null, + media: null, + mediaCharacterEncoding: null, + mediaContentEncodings: null, + mediaSize: number, + mediaTime: null, + method: null, + min: null, + mode: null, + name: null, + navDown: null, + navDownLeft: null, + navDownRight: null, + navLeft: null, + navNext: null, + navPrev: null, + navRight: null, + navUp: null, + navUpLeft: null, + navUpRight: null, + numOctaves: null, + observer: null, + offset: null, + onAbort: null, + onActivate: null, + onAfterPrint: null, + onBeforePrint: null, + onBegin: null, + onCancel: null, + onCanPlay: null, + onCanPlayThrough: null, + onChange: null, + onClick: null, + onClose: null, + onCopy: null, + onCueChange: null, + onCut: null, + onDblClick: null, + onDrag: null, + onDragEnd: null, + onDragEnter: null, + onDragExit: null, + onDragLeave: null, + onDragOver: null, + onDragStart: null, + onDrop: null, + onDurationChange: null, + onEmptied: null, + onEnd: null, + onEnded: null, + onError: null, + onFocus: null, + onFocusIn: null, + onFocusOut: null, + onHashChange: null, + onInput: null, + onInvalid: null, + onKeyDown: null, + onKeyPress: null, + onKeyUp: null, + onLoad: null, + onLoadedData: null, + onLoadedMetadata: null, + onLoadStart: null, + onMessage: null, + onMouseDown: null, + onMouseEnter: null, + onMouseLeave: null, + onMouseMove: null, + onMouseOut: null, + onMouseOver: null, + onMouseUp: null, + onMouseWheel: null, + onOffline: null, + onOnline: null, + onPageHide: null, + onPageShow: null, + onPaste: null, + onPause: null, + onPlay: null, + onPlaying: null, + onPopState: null, + onProgress: null, + onRateChange: null, + onRepeat: null, + onReset: null, + onResize: null, + onScroll: null, + onSeeked: null, + onSeeking: null, + onSelect: null, + onShow: null, + onStalled: null, + onStorage: null, + onSubmit: null, + onSuspend: null, + onTimeUpdate: null, + onToggle: null, + onUnload: null, + onVolumeChange: null, + onWaiting: null, + onZoom: null, + opacity: null, + operator: null, + order: null, + orient: null, + orientation: null, + origin: null, + overflow: null, + overlay: null, + overlinePosition: number, + overlineThickness: number, + paintOrder: null, + panose1: null, + path: null, + pathLength: number, + patternContentUnits: null, + patternTransform: null, + patternUnits: null, + phase: null, + ping: spaceSeparated, + pitch: null, + playbackOrder: null, + pointerEvents: null, + points: null, + pointsAtX: number, + pointsAtY: number, + pointsAtZ: number, + preserveAlpha: null, + preserveAspectRatio: null, + primitiveUnits: null, + propagate: null, + property: commaOrSpaceSeparated, + r: null, + radius: null, + referrerPolicy: null, + refX: null, + refY: null, + rel: commaOrSpaceSeparated, + rev: commaOrSpaceSeparated, + renderingIntent: null, + repeatCount: null, + repeatDur: null, + requiredExtensions: commaOrSpaceSeparated, + requiredFeatures: commaOrSpaceSeparated, + requiredFonts: commaOrSpaceSeparated, + requiredFormats: commaOrSpaceSeparated, + resource: null, + restart: null, + result: null, + rotate: null, + rx: null, + ry: null, + scale: null, + seed: null, + shapeRendering: null, + side: null, + slope: null, + snapshotTime: null, + specularConstant: number, + specularExponent: number, + spreadMethod: null, + spacing: null, + startOffset: null, + stdDeviation: null, + stemh: null, + stemv: null, + stitchTiles: null, + stopColor: null, + stopOpacity: null, + strikethroughPosition: number, + strikethroughThickness: number, + string: null, + stroke: null, + strokeDashArray: commaOrSpaceSeparated, + strokeDashOffset: null, + strokeLineCap: null, + strokeLineJoin: null, + strokeMiterLimit: number, + strokeOpacity: number, + strokeWidth: null, + style: null, + surfaceScale: number, + syncBehavior: null, + syncBehaviorDefault: null, + syncMaster: null, + syncTolerance: null, + syncToleranceDefault: null, + systemLanguage: commaOrSpaceSeparated, + tabIndex: number, + tableValues: null, + target: null, + targetX: number, + targetY: number, + textAnchor: null, + textDecoration: null, + textRendering: null, + textLength: null, + timelineBegin: null, + title: null, + transformBehavior: null, + type: null, + typeOf: commaOrSpaceSeparated, + to: null, + transform: null, + u1: null, + u2: null, + underlinePosition: number, + underlineThickness: number, + unicode: null, + unicodeBidi: null, + unicodeRange: null, + unitsPerEm: number, + values: null, + vAlphabetic: number, + vMathematical: number, + vectorEffect: null, + vHanging: number, + vIdeographic: number, + version: null, + vertAdvY: number, + vertOriginX: number, + vertOriginY: number, + viewBox: null, + viewTarget: null, + visibility: null, + width: null, + widths: null, + wordSpacing: null, + writingMode: null, + x: null, + x1: null, + x2: null, + xChannelSelector: null, + xHeight: number, + y: null, + y1: null, + y2: null, + yChannelSelector: null, + z: null, + zoomAndPan: null, + }, +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/find.js +var valid = /^data[-\w.:]+$/i; +var dash = /-[a-z]/g; +var cap = /[A-Z]/g; +function find(schema, value) { + const normal = normalize(value); + let prop = value; + let Type = Info; + if (normal in schema.normal) { + return schema.property[schema.normal[normal]]; + } + if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) { + if (value.charAt(4) === '-') { + const rest = value.slice(5).replace(dash, camelcase); + prop = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1); + } else { + const rest = value.slice(4); + if (!dash.test(rest)) { + let dashes = rest.replace(cap, kebab); + if (dashes.charAt(0) !== '-') { + dashes = '-' + dashes; + } + value = 'data' + dashes; + } + } + Type = DefinedInfo; + } + return new Type(prop, value); +} +function kebab($0) { + return '-' + $0.toLowerCase(); +} +function camelcase($0) { + return $0.charAt(1).toUpperCase(); +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/hast-to-react.js +var hastToReact = { + classId: 'classID', + dataType: 'datatype', + itemId: 'itemID', + strokeDashArray: 'strokeDasharray', + strokeDashOffset: 'strokeDashoffset', + strokeLineCap: 'strokeLinecap', + strokeLineJoin: 'strokeLinejoin', + strokeMiterLimit: 'strokeMiterlimit', + typeOf: 'typeof', + xLinkActuate: 'xlinkActuate', + xLinkArcRole: 'xlinkArcrole', + xLinkHref: 'xlinkHref', + xLinkRole: 'xlinkRole', + xLinkShow: 'xlinkShow', + xLinkTitle: 'xlinkTitle', + xLinkType: 'xlinkType', + xmlnsXLink: 'xmlnsXlink', +}; + +// node_modules/hast-util-to-estree/node_modules/property-information/index.js +var html3 = merge([xml, xlink, xmlns, aria, html2], 'html'); +var svg2 = merge([xml, xlink, xmlns, aria, svg], 'svg'); + +// node_modules/hast-util-to-estree/node_modules/space-separated-tokens/index.js +function stringify3(values) { + return values.join(' ').trim(); +} + +// node_modules/hast-util-to-estree/lib/index.js +var import_style_to_object = __toESM(require_style_to_object(), 1); + +// node_modules/zwitch/index.js +var own11 = {}.hasOwnProperty; +function zwitch(key, options) { + var settings = options || {}; + function one3(value) { + var fn = one3.invalid; + var handlers2 = one3.handlers; + if (value && own11.call(value, key)) { + fn = own11.call(handlers2, value[key]) + ? handlers2[value[key]] + : one3.unknown; + } + if (fn) { + return fn.apply(this, arguments); + } + } + one3.handlers = settings.handlers || {}; + one3.invalid = settings.invalid; + one3.unknown = settings.unknown; + return one3; +} + +// node_modules/hast-util-to-estree/lib/index.js +var toReact = hastToReact; +var own12 = {}.hasOwnProperty; +var tableElements = /* @__PURE__ */ new Set([ + 'table', + 'thead', + 'tbody', + 'tfoot', + 'tr', + 'th', + 'td', +]); +function toEstree(tree, options = {}) { + const context = { + schema: options.space === 'svg' ? svg2 : html3, + comments: [], + esm: [], + handle: zwitch('type', { + invalid, + unknown: unknown2, + handlers: Object.assign( + {}, + { + comment, + doctype: ignore2, + element, + mdxjsEsm: mdxjsEsm2, + mdxFlowExpression: mdxExpression2, + mdxJsxFlowElement: mdxJsxElement, + mdxJsxTextElement: mdxJsxElement, + mdxTextExpression: mdxExpression2, + root: root2, + text: text4, + }, + options.handlers, + ), + }), + }; + let result = context.handle(tree, context); + const body = context.esm; + if (result) { + if (result.type !== 'JSXFragment' && result.type !== 'JSXElement') { + result = create4(tree, { + type: 'JSXFragment', + openingFragment: {type: 'JSXOpeningFragment'}, + closingFragment: {type: 'JSXClosingFragment'}, + children: [result], + }); + } + body.push(create4(tree, {type: 'ExpressionStatement', expression: result})); + } + return create4(tree, { + type: 'Program', + body, + sourceType: 'module', + comments: context.comments, + }); +} +function invalid(value) { + throw new Error('Cannot handle value `' + value + '`, expected node'); +} +function unknown2(node) { + throw new Error('Cannot handle unknown node `' + node.type + '`'); +} +function ignore2() {} +function comment(node, context) { + const esnode = inherit(node, {type: 'Block', value: node.value}); + context.comments.push(esnode); + return create4(node, { + type: 'JSXExpressionContainer', + expression: create4(node, { + type: 'JSXEmptyExpression', + comments: [Object.assign({}, esnode, {leading: false, trailing: true})], + }), + }); +} +function element(node, context) { + const parentSchema = context.schema; + let schema = parentSchema; + const props = node.properties || {}; + if (parentSchema.space === 'html' && node.tagName.toLowerCase() === 'svg') { + schema = svg2; + context.schema = schema; + } + const children = all3(node, context); + const attributes = []; + let prop; + for (prop in props) { + if (own12.call(props, prop)) { + let value = props[prop]; + const info = find(schema, prop); + let attributeValue; + if ( + value === void 0 || + value === null || + (typeof value === 'number' && Number.isNaN(value)) || + value === false || + (!value && info.boolean) + ) { + continue; + } + prop = info.space + ? toReact[info.property] || info.property + : info.attribute; + if (Array.isArray(value)) { + value = info.commaSeparated ? stringify2(value) : stringify3(value); + } + if (prop === 'style') { + const styleValue = + typeof value === 'string' ? parseStyle(value, node.tagName) : value; + const cssProperties = []; + let cssProp; + for (cssProp in styleValue) { + if (own12.call(styleValue, cssProp)) { + cssProperties.push({ + type: 'Property', + method: false, + shorthand: false, + computed: false, + key: {type: 'Identifier', name: cssProp}, + value: {type: 'Literal', value: String(styleValue[cssProp])}, + kind: 'init', + }); + } + } + attributeValue = { + type: 'JSXExpressionContainer', + expression: {type: 'ObjectExpression', properties: cssProperties}, + }; + } else if (value === true) { + attributeValue = null; + } else { + attributeValue = {type: 'Literal', value: String(value)}; + } + if (jsxIdentifierName(prop)) { + attributes.push({ + type: 'JSXAttribute', + name: {type: 'JSXIdentifier', name: prop}, + value: attributeValue, + }); + } else { + attributes.push({ + type: 'JSXSpreadAttribute', + argument: { + type: 'ObjectExpression', + properties: [ + { + type: 'Property', + method: false, + shorthand: false, + computed: false, + key: {type: 'Literal', value: String(prop)}, + value: attributeValue || {type: 'Literal', value: true}, + kind: 'init', + }, + ], + }, + }); + } + } + } + context.schema = parentSchema; + return inherit(node, { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + attributes, + name: createJsxName(node.tagName), + selfClosing: children.length === 0, + }, + closingElement: + children.length > 0 + ? {type: 'JSXClosingElement', name: createJsxName(node.tagName)} + : null, + children, + }); +} +function mdxjsEsm2(node, context) { + const estree = node.data && node.data.estree; + const comments = (estree && estree.comments) || []; + if (estree) { + context.comments.push(...comments); + attachComments(estree, comments); + context.esm.push(...estree.body); + } +} +function mdxExpression2(node, context) { + const estree = node.data && node.data.estree; + const comments = (estree && estree.comments) || []; + let expression; + if (estree) { + context.comments.push(...comments); + attachComments(estree, estree.comments); + expression = + (estree.body[0] && + estree.body[0].type === 'ExpressionStatement' && + estree.body[0].expression) || + void 0; + } + return inherit(node, { + type: 'JSXExpressionContainer', + expression: expression || create4(node, {type: 'JSXEmptyExpression'}), + }); +} +function mdxJsxElement(node, context) { + const parentSchema = context.schema; + let schema = parentSchema; + const attrs = node.attributes || []; + let index2 = -1; + if ( + node.name && + parentSchema.space === 'html' && + node.name.toLowerCase() === 'svg' + ) { + schema = svg2; + context.schema = schema; + } + const children = all3(node, context); + const attributes = []; + while (++index2 < attrs.length) { + const attr = attrs[index2]; + const value = attr.value; + let attributeValue; + if (attr.type === 'mdxJsxAttribute') { + if (value === void 0 || value === null) { + attributeValue = null; + } else if (typeof value === 'object') { + const estree = value.data && value.data.estree; + const comments = (estree && estree.comments) || []; + let expression; + if (estree) { + context.comments.push(...comments); + attachComments(estree, estree.comments); + expression = + (estree.body[0] && + estree.body[0].type === 'ExpressionStatement' && + estree.body[0].expression) || + void 0; + } + attributeValue = inherit(value, { + type: 'JSXExpressionContainer', + expression: expression || {type: 'JSXEmptyExpression'}, + }); + } else { + attributeValue = {type: 'Literal', value: String(value)}; + } + attributes.push( + inherit(attr, { + type: 'JSXAttribute', + name: createJsxName(attr.name, true), + value: attributeValue, + }), + ); + } else { + const estree = attr.data && attr.data.estree; + const comments = (estree && estree.comments) || []; + let argumentValue; + if (estree) { + context.comments.push(...comments); + attachComments(estree, estree.comments); + argumentValue = + (estree.body[0] && + estree.body[0].type === 'ExpressionStatement' && + estree.body[0].expression && + estree.body[0].expression.type === 'ObjectExpression' && + estree.body[0].expression.properties && + estree.body[0].expression.properties[0] && + estree.body[0].expression.properties[0].type === 'SpreadElement' && + estree.body[0].expression.properties[0].argument) || + void 0; + } + attributes.push( + inherit(attr, { + type: 'JSXSpreadAttribute', + argument: argumentValue || {type: 'ObjectExpression', properties: []}, + }), + ); + } + } + context.schema = parentSchema; + return inherit( + node, + node.name + ? { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + attributes, + name: createJsxName(node.name), + selfClosing: children.length === 0, + }, + closingElement: + children.length > 0 + ? {type: 'JSXClosingElement', name: createJsxName(node.name)} + : null, + children, + } + : { + type: 'JSXFragment', + openingFragment: {type: 'JSXOpeningFragment'}, + closingFragment: {type: 'JSXClosingFragment'}, + children, + }, + ); +} +function root2(node, context) { + const children = all3(node, context); + const cleanChildren = []; + let index2 = -1; + let queue; + while (++index2 < children.length) { + const child = children[index2]; + if ( + child.type === 'JSXExpressionContainer' && + child.expression.type === 'Literal' && + whitespace(child.expression.value) + ) { + if (queue) queue.push(child); + } else { + if (queue) cleanChildren.push(...queue); + cleanChildren.push(child); + queue = []; + } + } + return inherit(node, { + type: 'JSXFragment', + openingFragment: {type: 'JSXOpeningFragment'}, + closingFragment: {type: 'JSXClosingFragment'}, + children: cleanChildren, + }); +} +function text4(node) { + const value = String(node.value || ''); + if (!value) return; + return create4(node, { + type: 'JSXExpressionContainer', + expression: inherit(node, {type: 'Literal', value}), + }); +} +function all3(parent, context) { + const children = parent.children || []; + let index2 = -1; + const results = []; + const ignoreLineBreak = + context.schema.space === 'html' && + parent.type === 'element' && + tableElements.has(parent.tagName.toLowerCase()); + while (++index2 < children.length) { + const child = children[index2]; + if (ignoreLineBreak && child.type === 'text' && child.value === '\n') { + continue; + } + const result = context.handle(child, context); + if (Array.isArray(result)) { + results.push(...result); + } else if (result) { + results.push(result); + } + } + return results; +} +function inherit(hast, esnode) { + const left = hast.data; + let right; + let key; + create4(hast, esnode); + if (left) { + for (key in left) { + if (own12.call(left, key) && key !== 'estree') { + if (!right) right = {}; + right[key] = left[key]; + } + } + if (right) { + esnode.data = right; + } + } + return esnode; +} +function create4(hast, esnode) { + const p = position2(hast); + if (p.start.line && p.start.offset !== void 0 && p.end.offset !== void 0) { + esnode.start = p.start.offset; + esnode.end = p.end.offset; + esnode.loc = { + start: {line: p.start.line, column: p.start.column - 1}, + end: {line: p.end.line, column: p.end.column - 1}, + }; + esnode.range = [p.start.offset, p.end.offset]; + } + return esnode; +} +var createJsxName = function (name2, attribute) { + if (!attribute && name2.includes('.')) { + const parts = name2.split('.'); + let part = parts.shift(); + let node = {type: 'JSXIdentifier', name: part}; + while ((part = parts.shift())) { + node = { + type: 'JSXMemberExpression', + object: node, + property: {type: 'JSXIdentifier', name: part}, + }; + } + return node; + } + if (name2.includes(':')) { + const parts = name2.split(':'); + return { + type: 'JSXNamespacedName', + namespace: {type: 'JSXIdentifier', name: parts[0]}, + name: {type: 'JSXIdentifier', name: parts[1]}, + }; + } + return {type: 'JSXIdentifier', name: name2}; +}; +function parseStyle(value, tagName) { + const result = {}; + try { + (0, import_style_to_object.default)(value, iterator); + } catch (error) { + const exception = error; + exception.message = + tagName + '[style]' + exception.message.slice('undefined'.length); + throw error; + } + return result; + function iterator(name2, value2) { + if (name2.slice(0, 4) === '-ms-') name2 = 'ms-' + name2.slice(4); + result[name2.replace(/-([a-z])/g, styleReplacer)] = value2; + } +} +function styleReplacer(_, $1) { + return $1.toUpperCase(); +} +function jsxIdentifierName(name2) { + let index2 = -1; + while (++index2 < name2.length) { + if (!(index2 ? cont3 : start2)(name2.charCodeAt(index2))) return false; + } + return index2 > 0; + function cont3(code2) { + return cont2(code2) || code2 === 45; + } +} + +// node_modules/@mdx-js/mdx/lib/plugin/rehype-recma.js +function rehypeRecma() { + return (tree) => toEstree(tree); +} + +// node_modules/@mdx-js/mdx/lib/plugin/rehype-remove-raw.js +function rehypeRemoveRaw() { + return (tree) => { + visit2(tree, 'raw', (_, index2, parent) => { + if (parent && typeof index2 === 'number') { + parent.children.splice(index2, 1); + return index2; + } + }); + }; +} + +// node_modules/@mdx-js/mdx/lib/plugin/remark-mark-and-unravel.js +function remarkMarkAndUnravel() { + return (tree) => { + visit2(tree, (node, index2, parent_) => { + const parent = parent_; + let offset2 = -1; + let all4 = true; + let oneOrMore; + if (parent && typeof index2 === 'number' && node.type === 'paragraph') { + const children = node.children; + while (++offset2 < children.length) { + const child = children[offset2]; + if ( + child.type === 'mdxJsxTextElement' || + child.type === 'mdxTextExpression' + ) { + oneOrMore = true; + } else if ( + child.type === 'text' && + /^[\t\r\n ]+$/.test(String(child.value)) + ) { + } else { + all4 = false; + break; + } + } + if (all4 && oneOrMore) { + offset2 = -1; + while (++offset2 < children.length) { + const child = children[offset2]; + if (child.type === 'mdxJsxTextElement') { + child.type = 'mdxJsxFlowElement'; + } + if (child.type === 'mdxTextExpression') { + child.type = 'mdxFlowExpression'; + } + } + parent.children.splice(index2, 1, ...children); + return index2; + } + } + if ( + node.type === 'mdxJsxFlowElement' || + node.type === 'mdxJsxTextElement' + ) { + const data2 = node.data || (node.data = {}); + data2._mdxExplicitJsx = true; + } + }); + }; +} + +// node_modules/@mdx-js/mdx/lib/node-types.js +var nodeTypes = [ + 'mdxFlowExpression', + 'mdxJsxFlowElement', + 'mdxJsxTextElement', + 'mdxTextExpression', + 'mdxjsEsm', +]; + +// node_modules/@mdx-js/mdx/lib/condition.js +var import_process2 = __toESM(require('process'), 1); +var development = import_process2.default.env.NODE_ENV === 'development'; + +// node_modules/@mdx-js/mdx/lib/core.js +var removedOptions = [ + 'filepath', + 'compilers', + 'hastPlugins', + 'mdPlugins', + 'skipExport', + 'wrapExport', +]; +function createProcessor(options = {}) { + const { + development: development2 = development, + jsx: jsx2, + format, + outputFormat, + providerImportSource, + recmaPlugins, + rehypePlugins, + remarkPlugins, + remarkRehypeOptions = {}, + SourceMapGenerator, + ...rest + } = options; + let index2 = -1; + while (++index2 < removedOptions.length) { + const key = removedOptions[index2]; + if (key in options) { + throw new Error( + '`options.' + + key + + '` is no longer supported. Please see for more information', + ); + } + } + if (format === 'detect') { + throw new Error( + "Incorrect `format: 'detect'`: `createProcessor` can support either `md` or `mdx`; it does not support detecting the format", + ); + } + const pipeline = unified().use(remark_parse_default); + if (format !== 'md') { + pipeline.use(remarkMdx); + } + pipeline + .use(remarkMarkAndUnravel) + .use(remarkPlugins || []) + .use(lib_default, { + ...remarkRehypeOptions, + allowDangerousHtml: true, + passThrough: [...(remarkRehypeOptions.passThrough || []), ...nodeTypes], + }) + .use(rehypePlugins || []); + if (format === 'md') { + pipeline.use(rehypeRemoveRaw); + } + pipeline + .use(rehypeRecma) + .use(recmaDocument, {...rest, outputFormat}) + .use(recmaJsxRewrite, { + development: development2, + providerImportSource, + outputFormat, + }); + if (!jsx2) { + pipeline.use(recmaJsxBuild, {outputFormat}); + } + pipeline.use(recmaStringify, {SourceMapGenerator}).use(recmaPlugins || []); + return pipeline; +} + +// node_modules/@mdx-js/mdx/lib/util/extnames.js +var import_markdown_extensions = __toESM(require_markdown_extensions2(), 1); +var md = import_markdown_extensions.default.map((d) => '.' + d); + +// node_modules/@mdx-js/mdx/lib/util/resolve-file-and-options.js +function resolveFileAndOptions(vfileCompatible, options) { + const file = looksLikeAVFile2(vfileCompatible) + ? vfileCompatible + : new VFile(vfileCompatible); + const {format, ...rest} = options || {}; + return { + file, + options: { + format: + format === 'md' || format === 'mdx' + ? format + : file.extname && (rest.mdExtensions || md).includes(file.extname) + ? 'md' + : 'mdx', + ...rest, + }, + }; +} +function looksLikeAVFile2(value) { + return Boolean( + value && + typeof value === 'object' && + 'message' in value && + 'messages' in value, + ); +} + +// node_modules/@mdx-js/mdx/lib/compile.js +function compile(vfileCompatible, compileOptions) { + const {file, options} = resolveFileAndOptions( + vfileCompatible, + compileOptions, + ); + return createProcessor(options).process(file); +} +function compileSync(vfileCompatible, compileOptions) { + const {file, options} = resolveFileAndOptions( + vfileCompatible, + compileOptions, + ); + return createProcessor(options).processSync(file); +} + +// node_modules/@mdx-js/mdx/lib/run.js +var AsyncFunction = Object.getPrototypeOf(run).constructor; +async function run(file, options) { + return new AsyncFunction(String(file))(options); +} +function runSync(file, options) { + return new Function(String(file))(options); +} + +// node_modules/@mdx-js/mdx/lib/util/resolve-evaluate-options.js +function resolveEvaluateOptions(options) { + const {Fragment, jsx: jsx2, jsxs, useMDXComponents, ...rest} = options || {}; + if (!Fragment) throw new Error('Expected `Fragment` given to `evaluate`'); + if (!jsx2) throw new Error('Expected `jsx` given to `evaluate`'); + if (!jsxs) throw new Error('Expected `jsxs` given to `evaluate`'); + return { + compiletime: { + ...rest, + outputFormat: 'function-body', + providerImportSource: useMDXComponents ? '#' : void 0, + }, + runtime: {Fragment, jsx: jsx2, jsxs, useMDXComponents}, + }; +} + +// node_modules/@mdx-js/mdx/lib/evaluate.js +async function evaluate(vfileCompatible, evaluateOptions) { + const {compiletime, runtime} = resolveEvaluateOptions(evaluateOptions); + return run(await compile(vfileCompatible, compiletime), runtime); +} +function evaluateSync(vfileCompatible, evaluateOptions) { + const {compiletime, runtime} = resolveEvaluateOptions(evaluateOptions); + return runSync(compileSync(vfileCompatible, compiletime), runtime); +} +// Annotate the CommonJS export names for ESM import in node: +0 && + (module.exports = { + compile, + compileSync, + createProcessor, + evaluate, + evaluateSync, + nodeTypes, + run, + runSync, + // Added manually! + mdastUtilToString: toString2, + }); +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts index 39236a1537b4..c0f6c78f3907 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts @@ -7,7 +7,7 @@ import visit from 'unist-util-visit'; import npmToYarn from 'npm-to-yarn'; -import type {Code, Content, Literal} from 'mdast'; +import type {Code, Literal} from 'mdast'; import type {Plugin} from 'unified'; import type {Node, Parent} from 'unist'; @@ -19,33 +19,67 @@ type PluginOptions = { const convertNpmToYarn = (npmCode: string) => npmToYarn(npmCode, 'yarn'); const transformNode = (node: Code, isSync: boolean) => { - const groupIdProp = isSync ? ' groupId="npm2yarn"' : ''; + const groupIdProp = isSync + ? { + type: 'mdxJsxAttribute', + name: 'groupId', + value: 'npm2yarn', + } + : undefined; + const npmCode = node.value; const yarnCode = convertNpmToYarn(node.value); return [ { - type: 'jsx', - value: `\n`, - }, - { - type: node.type, - lang: node.lang, - value: npmCode, - }, - { - type: 'jsx', - value: '\n', - }, - { - type: node.type, - lang: node.lang, - value: yarnCode, - }, - { - type: 'jsx', - value: '\n', + type: 'mdxJsxFlowElement', + name: 'Tabs', + attributes: [groupIdProp].filter(Boolean), + children: [ + { + type: 'mdxJsxFlowElement', + name: 'TabItem', + attributes: [ + { + type: 'mdxJsxAttribute', + name: 'value', + value: 'npm', + }, + ], + children: [ + { + type: node.type, + lang: node.lang, + value: npmCode, + }, + ], + }, + + { + type: 'mdxJsxFlowElement', + name: 'TabItem', + attributes: [ + { + type: 'mdxJsxAttribute', + name: 'value', + value: 'yarn', + }, + { + type: 'mdxJsxAttribute', + name: 'label', + value: 'Yarn', + }, + ], + children: [ + { + type: node.type, + lang: node.lang, + value: yarnCode, + }, + ], + }, + ], }, - ] as Content[]; + ] as any[]; }; const isImport = (node: Node): node is Literal => node.type === 'import'; @@ -53,17 +87,59 @@ const isParent = (node: Node): node is Parent => Array.isArray((node as Parent).children); const matchNode = (node: Node): node is Code => node.type === 'code' && (node as Code).meta === 'npm2yarn'; -const nodeForImport: Literal = { - type: 'import', - value: - "import Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';", -}; + +function createImportNode() { + return { + type: 'mdxjsEsm', + value: + "import Tabs from '@theme/Tabs'\nimport TabItem from '@theme/TabItem'", + data: { + estree: { + type: 'Program', + body: [ + { + type: 'ImportDeclaration', + specifiers: [ + { + type: 'ImportDefaultSpecifier', + local: {type: 'Identifier', name: 'Tabs'}, + }, + ], + source: { + type: 'Literal', + value: '@theme/Tabs', + raw: "'@theme/Tabs'", + }, + }, + { + type: 'ImportDeclaration', + specifiers: [ + { + type: 'ImportDefaultSpecifier', + local: {type: 'Identifier', name: 'TabItem'}, + }, + ], + source: { + type: 'Literal', + value: '@theme/TabItem', + raw: "'@theme/TabItem'", + }, + }, + ], + sourceType: 'module', + }, + }, + }; +} const plugin: Plugin<[PluginOptions?]> = (options = {}) => { const {sync = false} = options; return (root) => { let transformed = false as boolean; let alreadyImported = false as boolean; + + console.log('root', root); + visit(root, (node: Node) => { if (isImport(node) && node.value.includes('@theme/Tabs')) { alreadyImported = true; @@ -84,8 +160,10 @@ const plugin: Plugin<[PluginOptions?]> = (options = {}) => { } }); if (transformed && !alreadyImported) { - (root as Parent).children.unshift(nodeForImport); + (root as Parent).children.unshift(createImportNode()); } + + console.log('result', {transformed, alreadyImported}, root); }; }; diff --git a/yarn.lock b/yarn.lock index d6d7ccb9c623..5470804c1dc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -159,28 +159,6 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.0.tgz#2a592fd89bacb1fcde68de31bee4f2f2dacb0e86" integrity sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw== -"@babel/core@7.12.9": - version "7.12.9" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" - integrity sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.5" - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helpers" "^7.12.5" - "@babel/parser" "^7.12.7" - "@babel/template" "^7.12.7" - "@babel/traverse" "^7.12.9" - "@babel/types" "^7.12.7" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.1" - json5 "^2.1.2" - lodash "^4.17.19" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - "@babel/core@^7.11.1", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.13.16", "@babel/core@^7.18.5", "@babel/core@^7.19.0": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.0.tgz#d2f5f4f2033c00de8096be3c9f45772563e150c3" @@ -211,7 +189,7 @@ eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.12.5", "@babel/generator@^7.19.0", "@babel/generator@^7.7.2": +"@babel/generator@^7.19.0", "@babel/generator@^7.7.2": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.0.tgz#785596c06425e59334df2ccee63ab166b738419a" integrity sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg== @@ -319,7 +297,7 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.0": +"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.0": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz#309b230f04e22c58c6a2c0c0c7e50b216d350c30" integrity sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ== @@ -340,11 +318,6 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-plugin-utils@7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" - integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== - "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf" @@ -417,7 +390,7 @@ "@babel/traverse" "^7.19.0" "@babel/types" "^7.19.0" -"@babel/helpers@^7.12.5", "@babel/helpers@^7.19.0": +"@babel/helpers@^7.19.0": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.19.0.tgz#f30534657faf246ae96551d88dd31e9d1fa1fc18" integrity sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg== @@ -435,7 +408,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.7", "@babel/parser@^7.13.16", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.19.0": +"@babel/parser@^7.1.0", "@babel/parser@^7.13.16", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.19.0": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.0.tgz#497fcafb1d5b61376959c1c338745ef0577aa02c" integrity sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw== @@ -531,15 +504,6 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz#def9bd03cea0f9b72283dac0ec22d289c7691069" - integrity sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.0" - "@babel/plugin-transform-parameters" "^7.12.1" - "@babel/plugin-proposal-object-rest-spread@^7.18.9": version "7.18.9" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.9.tgz#f9434f6beb2c8cae9dfcf97d2a5941bbbf9ad4e7" @@ -664,13 +628,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz#9d9d357cc818aa7ae7935917c1257f67677a0926" - integrity sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-jsx@^7.18.6", "@babel/plugin-syntax-jsx@^7.7.2": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" @@ -699,7 +656,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-object-rest-spread@^7.8.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3": +"@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== @@ -922,7 +879,7 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/helper-replace-supers" "^7.18.6" -"@babel/plugin-transform-parameters@^7.12.1", "@babel/plugin-transform-parameters@^7.18.8": +"@babel/plugin-transform-parameters@^7.18.8": version "7.18.8" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.18.8.tgz#ee9f1a0ce6d78af58d0956a9378ea3427cccb48a" integrity sha512-ivfbE3X2Ss+Fj8nnXvKJS6sjRG4gzwPMsP+taZC+ZzEGjAYlvENixmt1sZ5Ca6tWls+BlKSGKPJ6OOXvXCbkFg== @@ -1211,7 +1168,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.12.7", "@babel/template@^7.18.10", "@babel/template@^7.3.3": +"@babel/template@^7.18.10", "@babel/template@^7.3.3": version "7.18.10" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== @@ -1220,7 +1177,7 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.12.9", "@babel/traverse@^7.18.9", "@babel/traverse@^7.19.0", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.18.9", "@babel/traverse@^7.19.0", "@babel/traverse@^7.7.2": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.0.tgz#eb9c561c7360005c592cc645abafe0c3c4548eed" integrity sha512-4pKpFRDh+utd2mbRC8JLnlsMUii3PMHjpL6a0SZ4NMZy7YFP9aXORxEhdMVOc9CpWtDF09IkciQLEhK7Ml7gRA== @@ -1236,7 +1193,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.7", "@babel/types@^7.18.10", "@babel/types@^7.18.4", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.4", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.0.tgz#75f21d73d73dc0351f3368d28db73465f4814600" integrity sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA== @@ -2661,11 +2618,6 @@ "@types/mdx" "^2.0.0" "@types/react" ">=16" -"@mdx-js/util@1.6.22": - version "1.6.22" - resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" - integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== - "@netlify/functions@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@netlify/functions/-/functions-1.2.0.tgz#0acce06db94113d2a42253930c45cb69ab97c530" @@ -8462,7 +8414,7 @@ gensequence@^3.1.1: resolved "https://registry.yarnpkg.com/gensequence/-/gensequence-3.1.1.tgz#95c1afc7c0680f92942c17f2d6f83f3d26ea97af" integrity sha512-ys3h0hiteRwmY6BsvSttPmkhC0vEQHPJduANBRtH/dlDPZ0UBIb/dXy80IcckXyuQ6LKg+PloRqvGER9IS7F7g== -gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: +gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== @@ -9492,7 +9444,7 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-alphabetical@1.0.4, is-alphabetical@^1.0.0: +is-alphabetical@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== @@ -10939,7 +10891,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== -lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21: +lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -14410,20 +14362,6 @@ remark-math@^3.0.1: resolved "https://registry.yarnpkg.com/remark-math/-/remark-math-3.0.1.tgz#85a02a15b15cad34b89a27244d4887b3a95185bb" integrity sha512-epT77R/HK0x7NqrWHdSV75uNLwn8g9qTyMqCRCDujL0vj/6T6+yhdrR7mjELWtkse+Fw02kijAaBuVcHBor1+Q== -remark-mdx@^1.6.21: - version "1.6.22" - resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-1.6.22.tgz#06a8dab07dcfdd57f3373af7f86bd0e992108bbd" - integrity sha512-phMHBJgeV76uyFkH4rvzCftLfKCr2RZuF+/gmVcaKrpsihyzmhXjA0BEMDaPTXG5y8qZOKPVo83NAOX01LPnOQ== - dependencies: - "@babel/core" "7.12.9" - "@babel/helper-plugin-utils" "7.10.4" - "@babel/plugin-proposal-object-rest-spread" "7.12.1" - "@babel/plugin-syntax-jsx" "7.12.1" - "@mdx-js/util" "1.6.22" - is-alphabetical "1.0.4" - remark-parse "8.0.3" - unified "9.2.0" - remark-mdx@^2.0.0, remark-mdx@^2.1.5: version "2.1.5" resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-2.1.5.tgz#69b19ec42d30a289e0663c3fc7656ebdca0a8d8e" @@ -14432,7 +14370,16 @@ remark-mdx@^2.0.0, remark-mdx@^2.1.5: mdast-util-mdx "^2.0.0" micromark-extension-mdxjs "^1.0.0" -remark-parse@8.0.3, remark-parse@^8.0.0, remark-parse@^8.0.2: +remark-parse@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-10.0.1.tgz#6f60ae53edbf0cf38ea223fe643db64d112e0775" + integrity sha512-1fUyHr2jLsVOkhbvPRBJ5zTKZZyD6yZzYaWCS6BPBdQ8vEMBCH+9zNCDA6tET/zHCi/jLqjCWtlJZUPk+DbnFw== + dependencies: + "@types/mdast" "^3.0.0" + mdast-util-from-markdown "^1.0.0" + unified "^10.0.0" + +remark-parse@^8.0.2: version "8.0.3" resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-8.0.3.tgz#9c62aa3b35b79a486454c690472906075f40c7e1" integrity sha512-E1K9+QLGgggHxCQtLt++uXltxEprmWzNfg+MxpfHsZlrddKzZ/hZyWHDbK3/Ap8HJQqYJRXP+jHczdL6q6i85Q== @@ -14454,15 +14401,6 @@ remark-parse@8.0.3, remark-parse@^8.0.0, remark-parse@^8.0.2: vfile-location "^3.0.0" xtend "^4.0.1" -remark-parse@^10.0.0: - version "10.0.1" - resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-10.0.1.tgz#6f60ae53edbf0cf38ea223fe643db64d112e0775" - integrity sha512-1fUyHr2jLsVOkhbvPRBJ5zTKZZyD6yZzYaWCS6BPBdQ8vEMBCH+9zNCDA6tET/zHCi/jLqjCWtlJZUPk+DbnFw== - dependencies: - "@types/mdast" "^3.0.0" - mdast-util-from-markdown "^1.0.0" - unified "^10.0.0" - remark-rehype@^10.0.0: version "10.1.0" resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-10.1.0.tgz#32dc99d2034c27ecaf2e0150d22a6dcccd9a6279" @@ -14489,7 +14427,7 @@ remark-stringify@^10.0.0: mdast-util-to-markdown "^1.0.0" unified "^10.0.0" -remark-stringify@^8.0.0, remark-stringify@^8.1.0: +remark-stringify@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-8.1.1.tgz#e2a9dc7a7bf44e46a155ec78996db896780d8ce5" integrity sha512-q4EyPZT3PcA3Eq7vPpT6bIdokXzFGp9i85igjmhRyXWmPs0Y6/d2FYwUNotKAWyLch7g0ASZJn/KHHcHZQ163A== @@ -14509,15 +14447,6 @@ remark-stringify@^8.0.0, remark-stringify@^8.1.0: unherit "^1.0.4" xtend "^4.0.1" -remark@^12.0.1: - version "12.0.1" - resolved "https://registry.yarnpkg.com/remark/-/remark-12.0.1.tgz#f1ddf68db7be71ca2bad0a33cd3678b86b9c709f" - integrity sha512-gS7HDonkdIaHmmP/+shCPejCEEW+liMp/t/QwmF0Xt47Rpuhl32lLtDV1uKWvGoq+kxr5jSgg5oAIpGuyULjUw== - dependencies: - remark-parse "^8.0.0" - remark-stringify "^8.0.0" - unified "^9.0.0" - remark@^14.0.2: version "14.0.2" resolved "https://registry.yarnpkg.com/remark/-/remark-14.0.2.tgz#4a1833f7441a5c29e44b37bb1843fb820797b40f" @@ -14608,7 +14537,7 @@ resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.3.2: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -14870,7 +14799,7 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -15279,7 +15208,7 @@ source-map-url@^0.4.0: resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== -source-map@^0.5.0, source-map@^0.5.6: +source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== @@ -16326,18 +16255,6 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz#0a36cb9a585c4f6abd51ad1deddb285c165297c8" integrity sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ== -unified@9.2.0: - version "9.2.0" - resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.0.tgz#67a62c627c40589edebbf60f53edfd4d822027f8" - integrity sha512-vx2Z0vY+a3YoTj8+pttM3tiJHCwY5UFbYdiWrwBEbHmK8pvsPj2rtAX2BFfgXen8T39CJWblWRDT4L5WGXtDdg== - dependencies: - bail "^1.0.0" - extend "^3.0.0" - is-buffer "^2.0.0" - is-plain-obj "^2.0.0" - trough "^1.0.0" - vfile "^4.0.0" - unified@^10.0.0: version "10.1.2" resolved "https://registry.yarnpkg.com/unified/-/unified-10.1.2.tgz#b1d64e55dafe1f0b98bb6c719881103ecf6c86df" @@ -16351,7 +16268,7 @@ unified@^10.0.0: trough "^2.0.0" vfile "^5.0.0" -unified@^9.0.0, unified@^9.2.2: +unified@^9.2.2: version "9.2.2" resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.2.tgz#67649a1abfc3ab85d2969502902775eb03146975" integrity sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ== From d37814648456b8c9c7421dc20d0ec6e8d0a5413c Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Wed, 30 Nov 2022 19:04:53 +0100 Subject: [PATCH 031/155] better mdx Jest vendoring setup --- .cspell.json | 2 +- .eslintignore | 2 +- .prettierignore | 2 ++ .stylelintignore | 2 ++ jest.config.mjs | 5 +++++ .../mdxCjs.js => jest/vendor/@mdx-js__mdx@2.1.5.js | 0 .../src/__tests__/index.test.ts | 6 ++---- packages/docusaurus-remark-plugin-npm2yarn/src/index.ts | 4 ++-- 8 files changed, 15 insertions(+), 8 deletions(-) rename packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/mdxCjs.js => jest/vendor/@mdx-js__mdx@2.1.5.js (100%) diff --git a/.cspell.json b/.cspell.json index 1764d92e3eaf..2b8b28cb0635 100644 --- a/.cspell.json +++ b/.cspell.json @@ -32,7 +32,7 @@ "*.docx", "versioned_docs", "*.min.*", - "mdxCjs.js" + "jest/vendor" ], "ignoreRegExpList": ["Email", "Urls", "#[\\w-]*"] } diff --git a/.eslintignore b/.eslintignore index a9fbb237a5e9..6765ad31bac3 100644 --- a/.eslintignore +++ b/.eslintignore @@ -21,4 +21,4 @@ packages/create-docusaurus/templates/facebook website/_dogfooding/_swizzle_theme_tests -mdxCjs.js +jest/vendor diff --git a/.prettierignore b/.prettierignore index 5bfdf4925c04..3b1599c327f3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -23,3 +23,5 @@ website/static/katex/katex.min.css website/changelog/_swizzle_theme_tests website/_dogfooding/_swizzle_theme_tests + +jest/vendor diff --git a/.stylelintignore b/.stylelintignore index 15db7860ba7a..9b97556a56cd 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -13,3 +13,5 @@ packages/docusaurus-*/lib/* packages/create-docusaurus/lib/* packages/create-docusaurus/templates/ website/static/katex/katex.min.css + +jest/vendor diff --git a/jest.config.mjs b/jest.config.mjs index dd2e9f3146e0..34030783ee3d 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -80,6 +80,11 @@ export default { '@docusaurus/plugin-content-docs/src/client/index.ts', '@testing-utils/(.*)': '/jest/utils/$1.ts', + + // MDX packages are ESM-only and it is a pain to use in Jest + // So we use them in Jest tests as CJS versions + // see https://mdxjs.com/docs/troubleshooting-mdx/#problems-integrating-mdx + '@mdx-js/mdx': '/jest/vendor/@mdx-js__mdx@2.1.5.js', }, snapshotSerializers: [ '/jest/snapshotPathNormalizer.ts', diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/mdxCjs.js b/jest/vendor/@mdx-js__mdx@2.1.5.js similarity index 100% rename from packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/mdxCjs.js rename to jest/vendor/@mdx-js__mdx@2.1.5.js diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts index 52f7939e1b89..c17b79374acf 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts @@ -12,11 +12,9 @@ import vfile from 'to-vfile'; import dedent from 'dedent'; import npm2yarn from '../index'; -import * as mdx from './mdxCjs'; - -console.log({mdx}); - const process = async (content: any, options?: {sync?: boolean}) => { + const mdx = await import('@mdx-js/mdx'); + const result = await mdx.compile(content, { remarkPlugins: [[npm2yarn, options]], format: 'mdx', diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts index c0f6c78f3907..39b4eb83f1db 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts @@ -138,7 +138,7 @@ const plugin: Plugin<[PluginOptions?]> = (options = {}) => { let transformed = false as boolean; let alreadyImported = false as boolean; - console.log('root', root); + // console.log('root', root); visit(root, (node: Node) => { if (isImport(node) && node.value.includes('@theme/Tabs')) { @@ -163,7 +163,7 @@ const plugin: Plugin<[PluginOptions?]> = (options = {}) => { (root as Parent).children.unshift(createImportNode()); } - console.log('result', {transformed, alreadyImported}, root); + // console.log('result', {transformed, alreadyImported}, root); }; }; From bba54bd0c0379c1afb9e7f3cc03462efc30eed2b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Wed, 30 Nov 2022 19:35:56 +0100 Subject: [PATCH 032/155] update safe snapshots --- jest.config.mjs | 3 +- jest/vendor/@mdx-js__mdx@2.1.5.js | 29464 ---------------- jest/vendor/remark-mdx@2.1.5.js | 14938 ++++++++ jest/vendor/remark@14.0.2.js | 8908 +++++ .../__snapshots__/index.test.ts.snap | 136 +- .../src/__tests__/index.test.ts | 42 +- 6 files changed, 23918 insertions(+), 29573 deletions(-) delete mode 100644 jest/vendor/@mdx-js__mdx@2.1.5.js create mode 100644 jest/vendor/remark-mdx@2.1.5.js create mode 100644 jest/vendor/remark@14.0.2.js diff --git a/jest.config.mjs b/jest.config.mjs index 34030783ee3d..968d8f5000ac 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -84,7 +84,8 @@ export default { // MDX packages are ESM-only and it is a pain to use in Jest // So we use them in Jest tests as CJS versions // see https://mdxjs.com/docs/troubleshooting-mdx/#problems-integrating-mdx - '@mdx-js/mdx': '/jest/vendor/@mdx-js__mdx@2.1.5.js', + '^remark$': '/jest/vendor/remark@14.0.2.js', + '^remark-mdx$': '/jest/vendor/remark-mdx@2.1.5.js', }, snapshotSerializers: [ '/jest/snapshotPathNormalizer.ts', diff --git a/jest/vendor/@mdx-js__mdx@2.1.5.js b/jest/vendor/@mdx-js__mdx@2.1.5.js deleted file mode 100644 index f89c90a86cce..000000000000 --- a/jest/vendor/@mdx-js__mdx@2.1.5.js +++ /dev/null @@ -1,29464 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => - function __require() { - return ( - mod || - (0, cb[__getOwnPropNames(cb)[0]])((mod = {exports: {}}).exports, mod), - mod.exports - ); - }; -var __export = (target, all4) => { - for (var name2 in all4) - __defProp(target, name2, {get: all4[name2], enumerable: true}); -}; -var __copyProps = (to, from, except, desc) => { - if ((from && typeof from === 'object') || typeof from === 'function') { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { - get: () => from[key], - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable, - }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => ( - (target = mod != null ? __create(__getProtoOf(mod)) : {}), - __copyProps( - isNodeMode || !mod || !mod.__esModule - ? __defProp(target, 'default', {value: mod, enumerable: true}) - : target, - mod, - ) -); -var __toCommonJS = (mod) => - __copyProps(__defProp({}, '__esModule', {value: true}), mod); - -// node_modules/is-buffer/index.js -var require_is_buffer = __commonJS({ - 'node_modules/is-buffer/index.js'(exports, module2) { - module2.exports = function isBuffer2(obj) { - return ( - obj != null && - obj.constructor != null && - typeof obj.constructor.isBuffer === 'function' && - obj.constructor.isBuffer(obj) - ); - }; - }, -}); - -// node_modules/extend/index.js -var require_extend = __commonJS({ - 'node_modules/extend/index.js'(exports, module2) { - 'use strict'; - var hasOwn2 = Object.prototype.hasOwnProperty; - var toStr = Object.prototype.toString; - var defineProperty = Object.defineProperty; - var gOPD = Object.getOwnPropertyDescriptor; - var isArray2 = function isArray3(arr) { - if (typeof Array.isArray === 'function') { - return Array.isArray(arr); - } - return toStr.call(arr) === '[object Array]'; - }; - var isPlainObject2 = function isPlainObject3(obj) { - if (!obj || toStr.call(obj) !== '[object Object]') { - return false; - } - var hasOwnConstructor = hasOwn2.call(obj, 'constructor'); - var hasIsPrototypeOf = - obj.constructor && - obj.constructor.prototype && - hasOwn2.call(obj.constructor.prototype, 'isPrototypeOf'); - if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { - return false; - } - var key; - for (key in obj) { - } - return typeof key === 'undefined' || hasOwn2.call(obj, key); - }; - var setProperty = function setProperty2(target, options) { - if (defineProperty && options.name === '__proto__') { - defineProperty(target, options.name, { - enumerable: true, - configurable: true, - value: options.newValue, - writable: true, - }); - } else { - target[options.name] = options.newValue; - } - }; - var getProperty = function getProperty2(obj, name2) { - if (name2 === '__proto__') { - if (!hasOwn2.call(obj, name2)) { - return void 0; - } else if (gOPD) { - return gOPD(obj, name2).value; - } - } - return obj[name2]; - }; - module2.exports = function extend3() { - var options, name2, src, copy, copyIsArray, clone; - var target = arguments[0]; - var i = 1; - var length = arguments.length; - var deep = false; - if (typeof target === 'boolean') { - deep = target; - target = arguments[1] || {}; - i = 2; - } - if ( - target == null || - (typeof target !== 'object' && typeof target !== 'function') - ) { - target = {}; - } - for (; i < length; ++i) { - options = arguments[i]; - if (options != null) { - for (name2 in options) { - src = getProperty(target, name2); - copy = getProperty(options, name2); - if (target !== copy) { - if ( - deep && - copy && - (isPlainObject2(copy) || (copyIsArray = isArray2(copy))) - ) { - if (copyIsArray) { - copyIsArray = false; - clone = src && isArray2(src) ? src : []; - } else { - clone = src && isPlainObject2(src) ? src : {}; - } - setProperty(target, { - name: name2, - newValue: extend3(deep, clone, copy), - }); - } else if (typeof copy !== 'undefined') { - setProperty(target, {name: name2, newValue: copy}); - } - } - } - } - } - return target; - }; - }, -}); - -// node_modules/acorn-jsx/xhtml.js -var require_xhtml = __commonJS({ - 'node_modules/acorn-jsx/xhtml.js'(exports, module2) { - module2.exports = { - quot: '"', - amp: '&', - apos: "'", - lt: '<', - gt: '>', - nbsp: '\xA0', - iexcl: '\xA1', - cent: '\xA2', - pound: '\xA3', - curren: '\xA4', - yen: '\xA5', - brvbar: '\xA6', - sect: '\xA7', - uml: '\xA8', - copy: '\xA9', - ordf: '\xAA', - laquo: '\xAB', - not: '\xAC', - shy: '\xAD', - reg: '\xAE', - macr: '\xAF', - deg: '\xB0', - plusmn: '\xB1', - sup2: '\xB2', - sup3: '\xB3', - acute: '\xB4', - micro: '\xB5', - para: '\xB6', - middot: '\xB7', - cedil: '\xB8', - sup1: '\xB9', - ordm: '\xBA', - raquo: '\xBB', - frac14: '\xBC', - frac12: '\xBD', - frac34: '\xBE', - iquest: '\xBF', - Agrave: '\xC0', - Aacute: '\xC1', - Acirc: '\xC2', - Atilde: '\xC3', - Auml: '\xC4', - Aring: '\xC5', - AElig: '\xC6', - Ccedil: '\xC7', - Egrave: '\xC8', - Eacute: '\xC9', - Ecirc: '\xCA', - Euml: '\xCB', - Igrave: '\xCC', - Iacute: '\xCD', - Icirc: '\xCE', - Iuml: '\xCF', - ETH: '\xD0', - Ntilde: '\xD1', - Ograve: '\xD2', - Oacute: '\xD3', - Ocirc: '\xD4', - Otilde: '\xD5', - Ouml: '\xD6', - times: '\xD7', - Oslash: '\xD8', - Ugrave: '\xD9', - Uacute: '\xDA', - Ucirc: '\xDB', - Uuml: '\xDC', - Yacute: '\xDD', - THORN: '\xDE', - szlig: '\xDF', - agrave: '\xE0', - aacute: '\xE1', - acirc: '\xE2', - atilde: '\xE3', - auml: '\xE4', - aring: '\xE5', - aelig: '\xE6', - ccedil: '\xE7', - egrave: '\xE8', - eacute: '\xE9', - ecirc: '\xEA', - euml: '\xEB', - igrave: '\xEC', - iacute: '\xED', - icirc: '\xEE', - iuml: '\xEF', - eth: '\xF0', - ntilde: '\xF1', - ograve: '\xF2', - oacute: '\xF3', - ocirc: '\xF4', - otilde: '\xF5', - ouml: '\xF6', - divide: '\xF7', - oslash: '\xF8', - ugrave: '\xF9', - uacute: '\xFA', - ucirc: '\xFB', - uuml: '\xFC', - yacute: '\xFD', - thorn: '\xFE', - yuml: '\xFF', - OElig: '\u0152', - oelig: '\u0153', - Scaron: '\u0160', - scaron: '\u0161', - Yuml: '\u0178', - fnof: '\u0192', - circ: '\u02C6', - tilde: '\u02DC', - Alpha: '\u0391', - Beta: '\u0392', - Gamma: '\u0393', - Delta: '\u0394', - Epsilon: '\u0395', - Zeta: '\u0396', - Eta: '\u0397', - Theta: '\u0398', - Iota: '\u0399', - Kappa: '\u039A', - Lambda: '\u039B', - Mu: '\u039C', - Nu: '\u039D', - Xi: '\u039E', - Omicron: '\u039F', - Pi: '\u03A0', - Rho: '\u03A1', - Sigma: '\u03A3', - Tau: '\u03A4', - Upsilon: '\u03A5', - Phi: '\u03A6', - Chi: '\u03A7', - Psi: '\u03A8', - Omega: '\u03A9', - alpha: '\u03B1', - beta: '\u03B2', - gamma: '\u03B3', - delta: '\u03B4', - epsilon: '\u03B5', - zeta: '\u03B6', - eta: '\u03B7', - theta: '\u03B8', - iota: '\u03B9', - kappa: '\u03BA', - lambda: '\u03BB', - mu: '\u03BC', - nu: '\u03BD', - xi: '\u03BE', - omicron: '\u03BF', - pi: '\u03C0', - rho: '\u03C1', - sigmaf: '\u03C2', - sigma: '\u03C3', - tau: '\u03C4', - upsilon: '\u03C5', - phi: '\u03C6', - chi: '\u03C7', - psi: '\u03C8', - omega: '\u03C9', - thetasym: '\u03D1', - upsih: '\u03D2', - piv: '\u03D6', - ensp: '\u2002', - emsp: '\u2003', - thinsp: '\u2009', - zwnj: '\u200C', - zwj: '\u200D', - lrm: '\u200E', - rlm: '\u200F', - ndash: '\u2013', - mdash: '\u2014', - lsquo: '\u2018', - rsquo: '\u2019', - sbquo: '\u201A', - ldquo: '\u201C', - rdquo: '\u201D', - bdquo: '\u201E', - dagger: '\u2020', - Dagger: '\u2021', - bull: '\u2022', - hellip: '\u2026', - permil: '\u2030', - prime: '\u2032', - Prime: '\u2033', - lsaquo: '\u2039', - rsaquo: '\u203A', - oline: '\u203E', - frasl: '\u2044', - euro: '\u20AC', - image: '\u2111', - weierp: '\u2118', - real: '\u211C', - trade: '\u2122', - alefsym: '\u2135', - larr: '\u2190', - uarr: '\u2191', - rarr: '\u2192', - darr: '\u2193', - harr: '\u2194', - crarr: '\u21B5', - lArr: '\u21D0', - uArr: '\u21D1', - rArr: '\u21D2', - dArr: '\u21D3', - hArr: '\u21D4', - forall: '\u2200', - part: '\u2202', - exist: '\u2203', - empty: '\u2205', - nabla: '\u2207', - isin: '\u2208', - notin: '\u2209', - ni: '\u220B', - prod: '\u220F', - sum: '\u2211', - minus: '\u2212', - lowast: '\u2217', - radic: '\u221A', - prop: '\u221D', - infin: '\u221E', - ang: '\u2220', - and: '\u2227', - or: '\u2228', - cap: '\u2229', - cup: '\u222A', - int: '\u222B', - there4: '\u2234', - sim: '\u223C', - cong: '\u2245', - asymp: '\u2248', - ne: '\u2260', - equiv: '\u2261', - le: '\u2264', - ge: '\u2265', - sub: '\u2282', - sup: '\u2283', - nsub: '\u2284', - sube: '\u2286', - supe: '\u2287', - oplus: '\u2295', - otimes: '\u2297', - perp: '\u22A5', - sdot: '\u22C5', - lceil: '\u2308', - rceil: '\u2309', - lfloor: '\u230A', - rfloor: '\u230B', - lang: '\u2329', - rang: '\u232A', - loz: '\u25CA', - spades: '\u2660', - clubs: '\u2663', - hearts: '\u2665', - diams: '\u2666', - }; - }, -}); - -// node_modules/acorn/dist/acorn.js -var require_acorn = __commonJS({ - 'node_modules/acorn/dist/acorn.js'(exports, module2) { - (function (global, factory2) { - typeof exports === 'object' && typeof module2 !== 'undefined' - ? factory2(exports) - : typeof define === 'function' && define.amd - ? define(['exports'], factory2) - : ((global = - typeof globalThis !== 'undefined' ? globalThis : global || self), - factory2((global.acorn = {}))); - })(exports, function (exports2) { - 'use strict'; - var astralIdentifierCodes2 = [ - 509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, - 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, - 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, - 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, - 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, - 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, - 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, - 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, - 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, - 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, - 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, - 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, - 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, - 4759, 9, 787719, 239, - ]; - var astralIdentifierStartCodes2 = [ - 0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, - 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, - 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, - 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, - 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, - 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, - 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, - 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, - 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, - 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, - 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, - 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, - 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, - 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, - 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, - 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, - 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, - 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, - 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, - 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, - 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, - 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, - 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, - 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, - 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, - 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, - 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, - 541, 1507, 4938, - ]; - var nonASCIIidentifierChars2 = - '\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F'; - var nonASCIIidentifierStartChars2 = - '\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC'; - var reservedWords2 = { - 3: 'abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile', - 5: 'class enum extends super const export import', - 6: 'enum', - strict: - 'implements interface let package private protected public static yield', - strictBind: 'eval arguments', - }; - var ecma5AndLessKeywords2 = - 'break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this'; - var keywords$12 = { - 5: ecma5AndLessKeywords2, - '5module': ecma5AndLessKeywords2 + ' export import', - 6: ecma5AndLessKeywords2 + ' const class extends export import super', - }; - var keywordRelationalOperator2 = /^in(stanceof)?$/; - var nonASCIIidentifierStart2 = new RegExp( - '[' + nonASCIIidentifierStartChars2 + ']', - ); - var nonASCIIidentifier2 = new RegExp( - '[' + nonASCIIidentifierStartChars2 + nonASCIIidentifierChars2 + ']', - ); - function isInAstralSet2(code2, set) { - var pos = 65536; - for (var i2 = 0; i2 < set.length; i2 += 2) { - pos += set[i2]; - if (pos > code2) { - return false; - } - pos += set[i2 + 1]; - if (pos >= code2) { - return true; - } - } - } - function isIdentifierStart2(code2, astral) { - if (code2 < 65) { - return code2 === 36; - } - if (code2 < 91) { - return true; - } - if (code2 < 97) { - return code2 === 95; - } - if (code2 < 123) { - return true; - } - if (code2 <= 65535) { - return ( - code2 >= 170 && - nonASCIIidentifierStart2.test(String.fromCharCode(code2)) - ); - } - if (astral === false) { - return false; - } - return isInAstralSet2(code2, astralIdentifierStartCodes2); - } - function isIdentifierChar2(code2, astral) { - if (code2 < 48) { - return code2 === 36; - } - if (code2 < 58) { - return true; - } - if (code2 < 65) { - return false; - } - if (code2 < 91) { - return true; - } - if (code2 < 97) { - return code2 === 95; - } - if (code2 < 123) { - return true; - } - if (code2 <= 65535) { - return ( - code2 >= 170 && nonASCIIidentifier2.test(String.fromCharCode(code2)) - ); - } - if (astral === false) { - return false; - } - return ( - isInAstralSet2(code2, astralIdentifierStartCodes2) || - isInAstralSet2(code2, astralIdentifierCodes2) - ); - } - var TokenType3 = function TokenType4(label, conf) { - if (conf === void 0) conf = {}; - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop || null; - this.updateContext = null; - }; - function binop2(name2, prec) { - return new TokenType3(name2, {beforeExpr: true, binop: prec}); - } - var beforeExpr2 = {beforeExpr: true}, - startsExpr2 = {startsExpr: true}; - var keywords2 = {}; - function kw2(name2, options) { - if (options === void 0) options = {}; - options.keyword = name2; - return (keywords2[name2] = new TokenType3(name2, options)); - } - var types$12 = { - num: new TokenType3('num', startsExpr2), - regexp: new TokenType3('regexp', startsExpr2), - string: new TokenType3('string', startsExpr2), - name: new TokenType3('name', startsExpr2), - privateId: new TokenType3('privateId', startsExpr2), - eof: new TokenType3('eof'), - bracketL: new TokenType3('[', {beforeExpr: true, startsExpr: true}), - bracketR: new TokenType3(']'), - braceL: new TokenType3('{', {beforeExpr: true, startsExpr: true}), - braceR: new TokenType3('}'), - parenL: new TokenType3('(', {beforeExpr: true, startsExpr: true}), - parenR: new TokenType3(')'), - comma: new TokenType3(',', beforeExpr2), - semi: new TokenType3(';', beforeExpr2), - colon: new TokenType3(':', beforeExpr2), - dot: new TokenType3('.'), - question: new TokenType3('?', beforeExpr2), - questionDot: new TokenType3('?.'), - arrow: new TokenType3('=>', beforeExpr2), - template: new TokenType3('template'), - invalidTemplate: new TokenType3('invalidTemplate'), - ellipsis: new TokenType3('...', beforeExpr2), - backQuote: new TokenType3('`', startsExpr2), - dollarBraceL: new TokenType3('${', { - beforeExpr: true, - startsExpr: true, - }), - eq: new TokenType3('=', {beforeExpr: true, isAssign: true}), - assign: new TokenType3('_=', {beforeExpr: true, isAssign: true}), - incDec: new TokenType3('++/--', { - prefix: true, - postfix: true, - startsExpr: true, - }), - prefix: new TokenType3('!/~', { - beforeExpr: true, - prefix: true, - startsExpr: true, - }), - logicalOR: binop2('||', 1), - logicalAND: binop2('&&', 2), - bitwiseOR: binop2('|', 3), - bitwiseXOR: binop2('^', 4), - bitwiseAND: binop2('&', 5), - equality: binop2('==/!=/===/!==', 6), - relational: binop2('/<=/>=', 7), - bitShift: binop2('<>/>>>', 8), - plusMin: new TokenType3('+/-', { - beforeExpr: true, - binop: 9, - prefix: true, - startsExpr: true, - }), - modulo: binop2('%', 10), - star: binop2('*', 10), - slash: binop2('/', 10), - starstar: new TokenType3('**', {beforeExpr: true}), - coalesce: binop2('??', 1), - _break: kw2('break'), - _case: kw2('case', beforeExpr2), - _catch: kw2('catch'), - _continue: kw2('continue'), - _debugger: kw2('debugger'), - _default: kw2('default', beforeExpr2), - _do: kw2('do', {isLoop: true, beforeExpr: true}), - _else: kw2('else', beforeExpr2), - _finally: kw2('finally'), - _for: kw2('for', {isLoop: true}), - _function: kw2('function', startsExpr2), - _if: kw2('if'), - _return: kw2('return', beforeExpr2), - _switch: kw2('switch'), - _throw: kw2('throw', beforeExpr2), - _try: kw2('try'), - _var: kw2('var'), - _const: kw2('const'), - _while: kw2('while', {isLoop: true}), - _with: kw2('with'), - _new: kw2('new', {beforeExpr: true, startsExpr: true}), - _this: kw2('this', startsExpr2), - _super: kw2('super', startsExpr2), - _class: kw2('class', startsExpr2), - _extends: kw2('extends', beforeExpr2), - _export: kw2('export'), - _import: kw2('import', startsExpr2), - _null: kw2('null', startsExpr2), - _true: kw2('true', startsExpr2), - _false: kw2('false', startsExpr2), - _in: kw2('in', {beforeExpr: true, binop: 7}), - _instanceof: kw2('instanceof', {beforeExpr: true, binop: 7}), - _typeof: kw2('typeof', { - beforeExpr: true, - prefix: true, - startsExpr: true, - }), - _void: kw2('void', {beforeExpr: true, prefix: true, startsExpr: true}), - _delete: kw2('delete', { - beforeExpr: true, - prefix: true, - startsExpr: true, - }), - }; - var lineBreak2 = /\r\n?|\n|\u2028|\u2029/; - var lineBreakG2 = new RegExp(lineBreak2.source, 'g'); - function isNewLine2(code2) { - return code2 === 10 || code2 === 13 || code2 === 8232 || code2 === 8233; - } - function nextLineBreak2(code2, from, end) { - if (end === void 0) end = code2.length; - for (var i2 = from; i2 < end; i2++) { - var next = code2.charCodeAt(i2); - if (isNewLine2(next)) { - return i2 < end - 1 && - next === 13 && - code2.charCodeAt(i2 + 1) === 10 - ? i2 + 2 - : i2 + 1; - } - } - return -1; - } - var nonASCIIwhitespace2 = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; - var skipWhiteSpace2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; - var ref2 = Object.prototype; - var hasOwnProperty3 = ref2.hasOwnProperty; - var toString3 = ref2.toString; - var hasOwn2 = - Object.hasOwn || - function (obj, propName) { - return hasOwnProperty3.call(obj, propName); - }; - var isArray2 = - Array.isArray || - function (obj) { - return toString3.call(obj) === '[object Array]'; - }; - function wordsRegexp2(words) { - return new RegExp('^(?:' + words.replace(/ /g, '|') + ')$'); - } - function codePointToString2(code2) { - if (code2 <= 65535) { - return String.fromCharCode(code2); - } - code2 -= 65536; - return String.fromCharCode( - (code2 >> 10) + 55296, - (code2 & 1023) + 56320, - ); - } - var loneSurrogate2 = - /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; - var Position3 = function Position4(line, col) { - this.line = line; - this.column = col; - }; - Position3.prototype.offset = function offset2(n) { - return new Position3(this.line, this.column + n); - }; - var SourceLocation3 = function SourceLocation4(p, start3, end) { - this.start = start3; - this.end = end; - if (p.sourceFile !== null) { - this.source = p.sourceFile; - } - }; - function getLineInfo2(input, offset2) { - for (var line = 1, cur = 0; ; ) { - var nextBreak = nextLineBreak2(input, cur, offset2); - if (nextBreak < 0) { - return new Position3(line, offset2 - cur); - } - ++line; - cur = nextBreak; - } - } - var defaultOptions2 = { - ecmaVersion: null, - sourceType: 'script', - onInsertedSemicolon: null, - onTrailingComma: null, - allowReserved: null, - allowReturnOutsideFunction: false, - allowImportExportEverywhere: false, - allowAwaitOutsideFunction: null, - allowSuperOutsideMethod: null, - allowHashBang: false, - locations: false, - onToken: null, - onComment: null, - ranges: false, - program: null, - sourceFile: null, - directSourceFile: null, - preserveParens: false, - }; - var warnedAboutEcmaVersion2 = false; - function getOptions2(opts) { - var options = {}; - for (var opt in defaultOptions2) { - options[opt] = - opts && hasOwn2(opts, opt) ? opts[opt] : defaultOptions2[opt]; - } - if (options.ecmaVersion === 'latest') { - options.ecmaVersion = 1e8; - } else if (options.ecmaVersion == null) { - if ( - !warnedAboutEcmaVersion2 && - typeof console === 'object' && - console.warn - ) { - warnedAboutEcmaVersion2 = true; - console.warn( - 'Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.', - ); - } - options.ecmaVersion = 11; - } else if (options.ecmaVersion >= 2015) { - options.ecmaVersion -= 2009; - } - if (options.allowReserved == null) { - options.allowReserved = options.ecmaVersion < 5; - } - if (opts.allowHashBang == null) { - options.allowHashBang = options.ecmaVersion >= 14; - } - if (isArray2(options.onToken)) { - var tokens = options.onToken; - options.onToken = function (token) { - return tokens.push(token); - }; - } - if (isArray2(options.onComment)) { - options.onComment = pushComment2(options, options.onComment); - } - return options; - } - function pushComment2(options, array) { - return function (block, text5, start3, end, startLoc, endLoc) { - var comment2 = { - type: block ? 'Block' : 'Line', - value: text5, - start: start3, - end, - }; - if (options.locations) { - comment2.loc = new SourceLocation3(this, startLoc, endLoc); - } - if (options.ranges) { - comment2.range = [start3, end]; - } - array.push(comment2); - }; - } - var SCOPE_TOP2 = 1, - SCOPE_FUNCTION2 = 2, - SCOPE_ASYNC2 = 4, - SCOPE_GENERATOR2 = 8, - SCOPE_ARROW2 = 16, - SCOPE_SIMPLE_CATCH2 = 32, - SCOPE_SUPER2 = 64, - SCOPE_DIRECT_SUPER2 = 128, - SCOPE_CLASS_STATIC_BLOCK2 = 256, - SCOPE_VAR2 = SCOPE_TOP2 | SCOPE_FUNCTION2 | SCOPE_CLASS_STATIC_BLOCK2; - function functionFlags2(async, generator) { - return ( - SCOPE_FUNCTION2 | - (async ? SCOPE_ASYNC2 : 0) | - (generator ? SCOPE_GENERATOR2 : 0) - ); - } - var BIND_NONE2 = 0, - BIND_VAR2 = 1, - BIND_LEXICAL2 = 2, - BIND_FUNCTION2 = 3, - BIND_SIMPLE_CATCH2 = 4, - BIND_OUTSIDE2 = 5; - var Parser3 = function Parser4(options, input, startPos) { - this.options = options = getOptions2(options); - this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp2( - keywords$12[ - options.ecmaVersion >= 6 - ? 6 - : options.sourceType === 'module' - ? '5module' - : 5 - ], - ); - var reserved = ''; - if (options.allowReserved !== true) { - reserved = - reservedWords2[ - options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3 - ]; - if (options.sourceType === 'module') { - reserved += ' await'; - } - } - this.reservedWords = wordsRegexp2(reserved); - var reservedStrict = - (reserved ? reserved + ' ' : '') + reservedWords2.strict; - this.reservedWordsStrict = wordsRegexp2(reservedStrict); - this.reservedWordsStrictBind = wordsRegexp2( - reservedStrict + ' ' + reservedWords2.strictBind, - ); - this.input = String(input); - this.containsEsc = false; - if (startPos) { - this.pos = startPos; - this.lineStart = this.input.lastIndexOf('\n', startPos - 1) + 1; - this.curLine = this.input - .slice(0, this.lineStart) - .split(lineBreak2).length; - } else { - this.pos = this.lineStart = 0; - this.curLine = 1; - } - this.type = types$12.eof; - this.value = null; - this.start = this.end = this.pos; - this.startLoc = this.endLoc = this.curPosition(); - this.lastTokEndLoc = this.lastTokStartLoc = null; - this.lastTokStart = this.lastTokEnd = this.pos; - this.context = this.initialContext(); - this.exprAllowed = true; - this.inModule = options.sourceType === 'module'; - this.strict = this.inModule || this.strictDirective(this.pos); - this.potentialArrowAt = -1; - this.potentialArrowInForAwait = false; - this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; - this.labels = []; - this.undefinedExports = /* @__PURE__ */ Object.create(null); - if ( - this.pos === 0 && - options.allowHashBang && - this.input.slice(0, 2) === '#!' - ) { - this.skipLineComment(2); - } - this.scopeStack = []; - this.enterScope(SCOPE_TOP2); - this.regexpState = null; - this.privateNameStack = []; - }; - var prototypeAccessors2 = { - inFunction: {configurable: true}, - inGenerator: {configurable: true}, - inAsync: {configurable: true}, - canAwait: {configurable: true}, - allowSuper: {configurable: true}, - allowDirectSuper: {configurable: true}, - treatFunctionsAsVar: {configurable: true}, - allowNewDotTarget: {configurable: true}, - inClassStaticBlock: {configurable: true}, - }; - Parser3.prototype.parse = function parse5() { - var node = this.options.program || this.startNode(); - this.nextToken(); - return this.parseTopLevel(node); - }; - prototypeAccessors2.inFunction.get = function () { - return (this.currentVarScope().flags & SCOPE_FUNCTION2) > 0; - }; - prototypeAccessors2.inGenerator.get = function () { - return ( - (this.currentVarScope().flags & SCOPE_GENERATOR2) > 0 && - !this.currentVarScope().inClassFieldInit - ); - }; - prototypeAccessors2.inAsync.get = function () { - return ( - (this.currentVarScope().flags & SCOPE_ASYNC2) > 0 && - !this.currentVarScope().inClassFieldInit - ); - }; - prototypeAccessors2.canAwait.get = function () { - for (var i2 = this.scopeStack.length - 1; i2 >= 0; i2--) { - var scope = this.scopeStack[i2]; - if ( - scope.inClassFieldInit || - scope.flags & SCOPE_CLASS_STATIC_BLOCK2 - ) { - return false; - } - if (scope.flags & SCOPE_FUNCTION2) { - return (scope.flags & SCOPE_ASYNC2) > 0; - } - } - return ( - (this.inModule && this.options.ecmaVersion >= 13) || - this.options.allowAwaitOutsideFunction - ); - }; - prototypeAccessors2.allowSuper.get = function () { - var ref3 = this.currentThisScope(); - var flags = ref3.flags; - var inClassFieldInit = ref3.inClassFieldInit; - return ( - (flags & SCOPE_SUPER2) > 0 || - inClassFieldInit || - this.options.allowSuperOutsideMethod - ); - }; - prototypeAccessors2.allowDirectSuper.get = function () { - return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER2) > 0; - }; - prototypeAccessors2.treatFunctionsAsVar.get = function () { - return this.treatFunctionsAsVarInScope(this.currentScope()); - }; - prototypeAccessors2.allowNewDotTarget.get = function () { - var ref3 = this.currentThisScope(); - var flags = ref3.flags; - var inClassFieldInit = ref3.inClassFieldInit; - return ( - (flags & (SCOPE_FUNCTION2 | SCOPE_CLASS_STATIC_BLOCK2)) > 0 || - inClassFieldInit - ); - }; - prototypeAccessors2.inClassStaticBlock.get = function () { - return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK2) > 0; - }; - Parser3.extend = function extend3() { - var plugins = [], - len = arguments.length; - while (len--) plugins[len] = arguments[len]; - var cls = this; - for (var i2 = 0; i2 < plugins.length; i2++) { - cls = plugins[i2](cls); - } - return cls; - }; - Parser3.parse = function parse5(input, options) { - return new this(options, input).parse(); - }; - Parser3.parseExpressionAt = function parseExpressionAt3( - input, - pos, - options, - ) { - var parser = new this(options, input, pos); - parser.nextToken(); - return parser.parseExpression(); - }; - Parser3.tokenizer = function tokenizer3(input, options) { - return new this(options, input); - }; - Object.defineProperties(Parser3.prototype, prototypeAccessors2); - var pp$92 = Parser3.prototype; - var literal2 = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; - pp$92.strictDirective = function (start3) { - if (this.options.ecmaVersion < 5) { - return false; - } - for (;;) { - skipWhiteSpace2.lastIndex = start3; - start3 += skipWhiteSpace2.exec(this.input)[0].length; - var match = literal2.exec(this.input.slice(start3)); - if (!match) { - return false; - } - if ((match[1] || match[2]) === 'use strict') { - skipWhiteSpace2.lastIndex = start3 + match[0].length; - var spaceAfter = skipWhiteSpace2.exec(this.input), - end = spaceAfter.index + spaceAfter[0].length; - var next = this.input.charAt(end); - return ( - next === ';' || - next === '}' || - (lineBreak2.test(spaceAfter[0]) && - !( - /[(`.[+\-/*%<>=,?^&]/.test(next) || - (next === '!' && this.input.charAt(end + 1) === '=') - )) - ); - } - start3 += match[0].length; - skipWhiteSpace2.lastIndex = start3; - start3 += skipWhiteSpace2.exec(this.input)[0].length; - if (this.input[start3] === ';') { - start3++; - } - } - }; - pp$92.eat = function (type) { - if (this.type === type) { - this.next(); - return true; - } else { - return false; - } - }; - pp$92.isContextual = function (name2) { - return ( - this.type === types$12.name && - this.value === name2 && - !this.containsEsc - ); - }; - pp$92.eatContextual = function (name2) { - if (!this.isContextual(name2)) { - return false; - } - this.next(); - return true; - }; - pp$92.expectContextual = function (name2) { - if (!this.eatContextual(name2)) { - this.unexpected(); - } - }; - pp$92.canInsertSemicolon = function () { - return ( - this.type === types$12.eof || - this.type === types$12.braceR || - lineBreak2.test(this.input.slice(this.lastTokEnd, this.start)) - ); - }; - pp$92.insertSemicolon = function () { - if (this.canInsertSemicolon()) { - if (this.options.onInsertedSemicolon) { - this.options.onInsertedSemicolon( - this.lastTokEnd, - this.lastTokEndLoc, - ); - } - return true; - } - }; - pp$92.semicolon = function () { - if (!this.eat(types$12.semi) && !this.insertSemicolon()) { - this.unexpected(); - } - }; - pp$92.afterTrailingComma = function (tokType, notNext) { - if (this.type === tokType) { - if (this.options.onTrailingComma) { - this.options.onTrailingComma( - this.lastTokStart, - this.lastTokStartLoc, - ); - } - if (!notNext) { - this.next(); - } - return true; - } - }; - pp$92.expect = function (type) { - this.eat(type) || this.unexpected(); - }; - pp$92.unexpected = function (pos) { - this.raise(pos != null ? pos : this.start, 'Unexpected token'); - }; - var DestructuringErrors3 = function DestructuringErrors4() { - this.shorthandAssign = - this.trailingComma = - this.parenthesizedAssign = - this.parenthesizedBind = - this.doubleProto = - -1; - }; - pp$92.checkPatternErrors = function (refDestructuringErrors, isAssign) { - if (!refDestructuringErrors) { - return; - } - if (refDestructuringErrors.trailingComma > -1) { - this.raiseRecoverable( - refDestructuringErrors.trailingComma, - 'Comma is not permitted after the rest element', - ); - } - var parens = isAssign - ? refDestructuringErrors.parenthesizedAssign - : refDestructuringErrors.parenthesizedBind; - if (parens > -1) { - this.raiseRecoverable( - parens, - isAssign ? 'Assigning to rvalue' : 'Parenthesized pattern', - ); - } - }; - pp$92.checkExpressionErrors = function ( - refDestructuringErrors, - andThrow, - ) { - if (!refDestructuringErrors) { - return false; - } - var shorthandAssign = refDestructuringErrors.shorthandAssign; - var doubleProto = refDestructuringErrors.doubleProto; - if (!andThrow) { - return shorthandAssign >= 0 || doubleProto >= 0; - } - if (shorthandAssign >= 0) { - this.raise( - shorthandAssign, - 'Shorthand property assignments are valid only in destructuring patterns', - ); - } - if (doubleProto >= 0) { - this.raiseRecoverable( - doubleProto, - 'Redefinition of __proto__ property', - ); - } - }; - pp$92.checkYieldAwaitInDefaultParams = function () { - if ( - this.yieldPos && - (!this.awaitPos || this.yieldPos < this.awaitPos) - ) { - this.raise( - this.yieldPos, - 'Yield expression cannot be a default value', - ); - } - if (this.awaitPos) { - this.raise( - this.awaitPos, - 'Await expression cannot be a default value', - ); - } - }; - pp$92.isSimpleAssignTarget = function (expr) { - if (expr.type === 'ParenthesizedExpression') { - return this.isSimpleAssignTarget(expr.expression); - } - return expr.type === 'Identifier' || expr.type === 'MemberExpression'; - }; - var pp$82 = Parser3.prototype; - pp$82.parseTopLevel = function (node) { - var exports3 = /* @__PURE__ */ Object.create(null); - if (!node.body) { - node.body = []; - } - while (this.type !== types$12.eof) { - var stmt = this.parseStatement(null, true, exports3); - node.body.push(stmt); - } - if (this.inModule) { - for ( - var i2 = 0, list4 = Object.keys(this.undefinedExports); - i2 < list4.length; - i2 += 1 - ) { - var name2 = list4[i2]; - this.raiseRecoverable( - this.undefinedExports[name2].start, - "Export '" + name2 + "' is not defined", - ); - } - } - this.adaptDirectivePrologue(node.body); - this.next(); - node.sourceType = this.options.sourceType; - return this.finishNode(node, 'Program'); - }; - var loopLabel2 = {kind: 'loop'}, - switchLabel2 = {kind: 'switch'}; - pp$82.isLet = function (context) { - if (this.options.ecmaVersion < 6 || !this.isContextual('let')) { - return false; - } - skipWhiteSpace2.lastIndex = this.pos; - var skip = skipWhiteSpace2.exec(this.input); - var next = this.pos + skip[0].length, - nextCh = this.input.charCodeAt(next); - if ( - nextCh === 91 || - nextCh === 92 || - (nextCh > 55295 && nextCh < 56320) - ) { - return true; - } - if (context) { - return false; - } - if (nextCh === 123) { - return true; - } - if (isIdentifierStart2(nextCh, true)) { - var pos = next + 1; - while ( - isIdentifierChar2((nextCh = this.input.charCodeAt(pos)), true) - ) { - ++pos; - } - if (nextCh === 92 || (nextCh > 55295 && nextCh < 56320)) { - return true; - } - var ident = this.input.slice(next, pos); - if (!keywordRelationalOperator2.test(ident)) { - return true; - } - } - return false; - }; - pp$82.isAsyncFunction = function () { - if (this.options.ecmaVersion < 8 || !this.isContextual('async')) { - return false; - } - skipWhiteSpace2.lastIndex = this.pos; - var skip = skipWhiteSpace2.exec(this.input); - var next = this.pos + skip[0].length, - after; - return ( - !lineBreak2.test(this.input.slice(this.pos, next)) && - this.input.slice(next, next + 8) === 'function' && - (next + 8 === this.input.length || - !( - isIdentifierChar2((after = this.input.charCodeAt(next + 8))) || - (after > 55295 && after < 56320) - )) - ); - }; - pp$82.parseStatement = function (context, topLevel, exports3) { - var starttype = this.type, - node = this.startNode(), - kind; - if (this.isLet(context)) { - starttype = types$12._var; - kind = 'let'; - } - switch (starttype) { - case types$12._break: - case types$12._continue: - return this.parseBreakContinueStatement(node, starttype.keyword); - case types$12._debugger: - return this.parseDebuggerStatement(node); - case types$12._do: - return this.parseDoStatement(node); - case types$12._for: - return this.parseForStatement(node); - case types$12._function: - if ( - context && - (this.strict || (context !== 'if' && context !== 'label')) && - this.options.ecmaVersion >= 6 - ) { - this.unexpected(); - } - return this.parseFunctionStatement(node, false, !context); - case types$12._class: - if (context) { - this.unexpected(); - } - return this.parseClass(node, true); - case types$12._if: - return this.parseIfStatement(node); - case types$12._return: - return this.parseReturnStatement(node); - case types$12._switch: - return this.parseSwitchStatement(node); - case types$12._throw: - return this.parseThrowStatement(node); - case types$12._try: - return this.parseTryStatement(node); - case types$12._const: - case types$12._var: - kind = kind || this.value; - if (context && kind !== 'var') { - this.unexpected(); - } - return this.parseVarStatement(node, kind); - case types$12._while: - return this.parseWhileStatement(node); - case types$12._with: - return this.parseWithStatement(node); - case types$12.braceL: - return this.parseBlock(true, node); - case types$12.semi: - return this.parseEmptyStatement(node); - case types$12._export: - case types$12._import: - if ( - this.options.ecmaVersion > 10 && - starttype === types$12._import - ) { - skipWhiteSpace2.lastIndex = this.pos; - var skip = skipWhiteSpace2.exec(this.input); - var next = this.pos + skip[0].length, - nextCh = this.input.charCodeAt(next); - if (nextCh === 40 || nextCh === 46) { - return this.parseExpressionStatement( - node, - this.parseExpression(), - ); - } - } - if (!this.options.allowImportExportEverywhere) { - if (!topLevel) { - this.raise( - this.start, - "'import' and 'export' may only appear at the top level", - ); - } - if (!this.inModule) { - this.raise( - this.start, - "'import' and 'export' may appear only with 'sourceType: module'", - ); - } - } - return starttype === types$12._import - ? this.parseImport(node) - : this.parseExport(node, exports3); - default: - if (this.isAsyncFunction()) { - if (context) { - this.unexpected(); - } - this.next(); - return this.parseFunctionStatement(node, true, !context); - } - var maybeName = this.value, - expr = this.parseExpression(); - if ( - starttype === types$12.name && - expr.type === 'Identifier' && - this.eat(types$12.colon) - ) { - return this.parseLabeledStatement(node, maybeName, expr, context); - } else { - return this.parseExpressionStatement(node, expr); - } - } - }; - pp$82.parseBreakContinueStatement = function (node, keyword) { - var isBreak = keyword === 'break'; - this.next(); - if (this.eat(types$12.semi) || this.insertSemicolon()) { - node.label = null; - } else if (this.type !== types$12.name) { - this.unexpected(); - } else { - node.label = this.parseIdent(); - this.semicolon(); - } - var i2 = 0; - for (; i2 < this.labels.length; ++i2) { - var lab = this.labels[i2]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === 'loop')) { - break; - } - if (node.label && isBreak) { - break; - } - } - } - if (i2 === this.labels.length) { - this.raise(node.start, 'Unsyntactic ' + keyword); - } - return this.finishNode( - node, - isBreak ? 'BreakStatement' : 'ContinueStatement', - ); - }; - pp$82.parseDebuggerStatement = function (node) { - this.next(); - this.semicolon(); - return this.finishNode(node, 'DebuggerStatement'); - }; - pp$82.parseDoStatement = function (node) { - this.next(); - this.labels.push(loopLabel2); - node.body = this.parseStatement('do'); - this.labels.pop(); - this.expect(types$12._while); - node.test = this.parseParenExpression(); - if (this.options.ecmaVersion >= 6) { - this.eat(types$12.semi); - } else { - this.semicolon(); - } - return this.finishNode(node, 'DoWhileStatement'); - }; - pp$82.parseForStatement = function (node) { - this.next(); - var awaitAt = - this.options.ecmaVersion >= 9 && - this.canAwait && - this.eatContextual('await') - ? this.lastTokStart - : -1; - this.labels.push(loopLabel2); - this.enterScope(0); - this.expect(types$12.parenL); - if (this.type === types$12.semi) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - return this.parseFor(node, null); - } - var isLet = this.isLet(); - if ( - this.type === types$12._var || - this.type === types$12._const || - isLet - ) { - var init$1 = this.startNode(), - kind = isLet ? 'let' : this.value; - this.next(); - this.parseVar(init$1, true, kind); - this.finishNode(init$1, 'VariableDeclaration'); - if ( - (this.type === types$12._in || - (this.options.ecmaVersion >= 6 && this.isContextual('of'))) && - init$1.declarations.length === 1 - ) { - if (this.options.ecmaVersion >= 9) { - if (this.type === types$12._in) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - } else { - node.await = awaitAt > -1; - } - } - return this.parseForIn(node, init$1); - } - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - return this.parseFor(node, init$1); - } - var startsWithLet = this.isContextual('let'), - isForOf = false; - var refDestructuringErrors = new DestructuringErrors3(); - var init = this.parseExpression( - awaitAt > -1 ? 'await' : true, - refDestructuringErrors, - ); - if ( - this.type === types$12._in || - (isForOf = this.options.ecmaVersion >= 6 && this.isContextual('of')) - ) { - if (this.options.ecmaVersion >= 9) { - if (this.type === types$12._in) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - } else { - node.await = awaitAt > -1; - } - } - if (startsWithLet && isForOf) { - this.raise( - init.start, - "The left-hand side of a for-of loop may not start with 'let'.", - ); - } - this.toAssignable(init, false, refDestructuringErrors); - this.checkLValPattern(init); - return this.parseForIn(node, init); - } else { - this.checkExpressionErrors(refDestructuringErrors, true); - } - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - return this.parseFor(node, init); - }; - pp$82.parseFunctionStatement = function ( - node, - isAsync, - declarationPosition, - ) { - this.next(); - return this.parseFunction( - node, - FUNC_STATEMENT2 | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT2), - false, - isAsync, - ); - }; - pp$82.parseIfStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - node.consequent = this.parseStatement('if'); - node.alternate = this.eat(types$12._else) - ? this.parseStatement('if') - : null; - return this.finishNode(node, 'IfStatement'); - }; - pp$82.parseReturnStatement = function (node) { - if (!this.inFunction && !this.options.allowReturnOutsideFunction) { - this.raise(this.start, "'return' outside of function"); - } - this.next(); - if (this.eat(types$12.semi) || this.insertSemicolon()) { - node.argument = null; - } else { - node.argument = this.parseExpression(); - this.semicolon(); - } - return this.finishNode(node, 'ReturnStatement'); - }; - pp$82.parseSwitchStatement = function (node) { - this.next(); - node.discriminant = this.parseParenExpression(); - node.cases = []; - this.expect(types$12.braceL); - this.labels.push(switchLabel2); - this.enterScope(0); - var cur; - for (var sawDefault = false; this.type !== types$12.braceR; ) { - if (this.type === types$12._case || this.type === types$12._default) { - var isCase = this.type === types$12._case; - if (cur) { - this.finishNode(cur, 'SwitchCase'); - } - node.cases.push((cur = this.startNode())); - cur.consequent = []; - this.next(); - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) { - this.raiseRecoverable( - this.lastTokStart, - 'Multiple default clauses', - ); - } - sawDefault = true; - cur.test = null; - } - this.expect(types$12.colon); - } else { - if (!cur) { - this.unexpected(); - } - cur.consequent.push(this.parseStatement(null)); - } - } - this.exitScope(); - if (cur) { - this.finishNode(cur, 'SwitchCase'); - } - this.next(); - this.labels.pop(); - return this.finishNode(node, 'SwitchStatement'); - }; - pp$82.parseThrowStatement = function (node) { - this.next(); - if (lineBreak2.test(this.input.slice(this.lastTokEnd, this.start))) { - this.raise(this.lastTokEnd, 'Illegal newline after throw'); - } - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, 'ThrowStatement'); - }; - var empty$12 = []; - pp$82.parseTryStatement = function (node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - if (this.type === types$12._catch) { - var clause = this.startNode(); - this.next(); - if (this.eat(types$12.parenL)) { - clause.param = this.parseBindingAtom(); - var simple = clause.param.type === 'Identifier'; - this.enterScope(simple ? SCOPE_SIMPLE_CATCH2 : 0); - this.checkLValPattern( - clause.param, - simple ? BIND_SIMPLE_CATCH2 : BIND_LEXICAL2, - ); - this.expect(types$12.parenR); - } else { - if (this.options.ecmaVersion < 10) { - this.unexpected(); - } - clause.param = null; - this.enterScope(0); - } - clause.body = this.parseBlock(false); - this.exitScope(); - node.handler = this.finishNode(clause, 'CatchClause'); - } - node.finalizer = this.eat(types$12._finally) ? this.parseBlock() : null; - if (!node.handler && !node.finalizer) { - this.raise(node.start, 'Missing catch or finally clause'); - } - return this.finishNode(node, 'TryStatement'); - }; - pp$82.parseVarStatement = function (node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, 'VariableDeclaration'); - }; - pp$82.parseWhileStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - this.labels.push(loopLabel2); - node.body = this.parseStatement('while'); - this.labels.pop(); - return this.finishNode(node, 'WhileStatement'); - }; - pp$82.parseWithStatement = function (node) { - if (this.strict) { - this.raise(this.start, "'with' in strict mode"); - } - this.next(); - node.object = this.parseParenExpression(); - node.body = this.parseStatement('with'); - return this.finishNode(node, 'WithStatement'); - }; - pp$82.parseEmptyStatement = function (node) { - this.next(); - return this.finishNode(node, 'EmptyStatement'); - }; - pp$82.parseLabeledStatement = function (node, maybeName, expr, context) { - for (var i$1 = 0, list4 = this.labels; i$1 < list4.length; i$1 += 1) { - var label = list4[i$1]; - if (label.name === maybeName) { - this.raise( - expr.start, - "Label '" + maybeName + "' is already declared", - ); - } - } - var kind = this.type.isLoop - ? 'loop' - : this.type === types$12._switch - ? 'switch' - : null; - for (var i2 = this.labels.length - 1; i2 >= 0; i2--) { - var label$1 = this.labels[i2]; - if (label$1.statementStart === node.start) { - label$1.statementStart = this.start; - label$1.kind = kind; - } else { - break; - } - } - this.labels.push({name: maybeName, kind, statementStart: this.start}); - node.body = this.parseStatement( - context - ? context.indexOf('label') === -1 - ? context + 'label' - : context - : 'label', - ); - this.labels.pop(); - node.label = expr; - return this.finishNode(node, 'LabeledStatement'); - }; - pp$82.parseExpressionStatement = function (node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, 'ExpressionStatement'); - }; - pp$82.parseBlock = function (createNewLexicalScope, node, exitStrict) { - if (createNewLexicalScope === void 0) createNewLexicalScope = true; - if (node === void 0) node = this.startNode(); - node.body = []; - this.expect(types$12.braceL); - if (createNewLexicalScope) { - this.enterScope(0); - } - while (this.type !== types$12.braceR) { - var stmt = this.parseStatement(null); - node.body.push(stmt); - } - if (exitStrict) { - this.strict = false; - } - this.next(); - if (createNewLexicalScope) { - this.exitScope(); - } - return this.finishNode(node, 'BlockStatement'); - }; - pp$82.parseFor = function (node, init) { - node.init = init; - this.expect(types$12.semi); - node.test = this.type === types$12.semi ? null : this.parseExpression(); - this.expect(types$12.semi); - node.update = - this.type === types$12.parenR ? null : this.parseExpression(); - this.expect(types$12.parenR); - node.body = this.parseStatement('for'); - this.exitScope(); - this.labels.pop(); - return this.finishNode(node, 'ForStatement'); - }; - pp$82.parseForIn = function (node, init) { - var isForIn = this.type === types$12._in; - this.next(); - if ( - init.type === 'VariableDeclaration' && - init.declarations[0].init != null && - (!isForIn || - this.options.ecmaVersion < 8 || - this.strict || - init.kind !== 'var' || - init.declarations[0].id.type !== 'Identifier') - ) { - this.raise( - init.start, - (isForIn ? 'for-in' : 'for-of') + - ' loop variable declaration may not have an initializer', - ); - } - node.left = init; - node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); - this.expect(types$12.parenR); - node.body = this.parseStatement('for'); - this.exitScope(); - this.labels.pop(); - return this.finishNode( - node, - isForIn ? 'ForInStatement' : 'ForOfStatement', - ); - }; - pp$82.parseVar = function (node, isFor, kind) { - node.declarations = []; - node.kind = kind; - for (;;) { - var decl = this.startNode(); - this.parseVarId(decl, kind); - if (this.eat(types$12.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else if ( - kind === 'const' && - !( - this.type === types$12._in || - (this.options.ecmaVersion >= 6 && this.isContextual('of')) - ) - ) { - this.unexpected(); - } else if ( - decl.id.type !== 'Identifier' && - !(isFor && (this.type === types$12._in || this.isContextual('of'))) - ) { - this.raise( - this.lastTokEnd, - 'Complex binding patterns require an initialization value', - ); - } else { - decl.init = null; - } - node.declarations.push(this.finishNode(decl, 'VariableDeclarator')); - if (!this.eat(types$12.comma)) { - break; - } - } - return node; - }; - pp$82.parseVarId = function (decl, kind) { - decl.id = this.parseBindingAtom(); - this.checkLValPattern( - decl.id, - kind === 'var' ? BIND_VAR2 : BIND_LEXICAL2, - false, - ); - }; - var FUNC_STATEMENT2 = 1, - FUNC_HANGING_STATEMENT2 = 2, - FUNC_NULLABLE_ID2 = 4; - pp$82.parseFunction = function ( - node, - statement, - allowExpressionBody, - isAsync, - forInit, - ) { - this.initFunction(node); - if ( - this.options.ecmaVersion >= 9 || - (this.options.ecmaVersion >= 6 && !isAsync) - ) { - if ( - this.type === types$12.star && - statement & FUNC_HANGING_STATEMENT2 - ) { - this.unexpected(); - } - node.generator = this.eat(types$12.star); - } - if (this.options.ecmaVersion >= 8) { - node.async = !!isAsync; - } - if (statement & FUNC_STATEMENT2) { - node.id = - statement & FUNC_NULLABLE_ID2 && this.type !== types$12.name - ? null - : this.parseIdent(); - if (node.id && !(statement & FUNC_HANGING_STATEMENT2)) { - this.checkLValSimple( - node.id, - this.strict || node.generator || node.async - ? this.treatFunctionsAsVar - ? BIND_VAR2 - : BIND_LEXICAL2 - : BIND_FUNCTION2, - ); - } - } - var oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope(functionFlags2(node.async, node.generator)); - if (!(statement & FUNC_STATEMENT2)) { - node.id = this.type === types$12.name ? this.parseIdent() : null; - } - this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody, false, forInit); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode( - node, - statement & FUNC_STATEMENT2 - ? 'FunctionDeclaration' - : 'FunctionExpression', - ); - }; - pp$82.parseFunctionParams = function (node) { - this.expect(types$12.parenL); - node.params = this.parseBindingList( - types$12.parenR, - false, - this.options.ecmaVersion >= 8, - ); - this.checkYieldAwaitInDefaultParams(); - }; - pp$82.parseClass = function (node, isStatement) { - this.next(); - var oldStrict = this.strict; - this.strict = true; - this.parseClassId(node, isStatement); - this.parseClassSuper(node); - var privateNameMap = this.enterClassBody(); - var classBody = this.startNode(); - var hadConstructor = false; - classBody.body = []; - this.expect(types$12.braceL); - while (this.type !== types$12.braceR) { - var element2 = this.parseClassElement(node.superClass !== null); - if (element2) { - classBody.body.push(element2); - if ( - element2.type === 'MethodDefinition' && - element2.kind === 'constructor' - ) { - if (hadConstructor) { - this.raise( - element2.start, - 'Duplicate constructor in the same class', - ); - } - hadConstructor = true; - } else if ( - element2.key && - element2.key.type === 'PrivateIdentifier' && - isPrivateNameConflicted2(privateNameMap, element2) - ) { - this.raiseRecoverable( - element2.key.start, - "Identifier '#" + - element2.key.name + - "' has already been declared", - ); - } - } - } - this.strict = oldStrict; - this.next(); - node.body = this.finishNode(classBody, 'ClassBody'); - this.exitClassBody(); - return this.finishNode( - node, - isStatement ? 'ClassDeclaration' : 'ClassExpression', - ); - }; - pp$82.parseClassElement = function (constructorAllowsSuper) { - if (this.eat(types$12.semi)) { - return null; - } - var ecmaVersion2 = this.options.ecmaVersion; - var node = this.startNode(); - var keyName = ''; - var isGenerator = false; - var isAsync = false; - var kind = 'method'; - var isStatic = false; - if (this.eatContextual('static')) { - if (ecmaVersion2 >= 13 && this.eat(types$12.braceL)) { - this.parseClassStaticBlock(node); - return node; - } - if (this.isClassElementNameStart() || this.type === types$12.star) { - isStatic = true; - } else { - keyName = 'static'; - } - } - node.static = isStatic; - if (!keyName && ecmaVersion2 >= 8 && this.eatContextual('async')) { - if ( - (this.isClassElementNameStart() || this.type === types$12.star) && - !this.canInsertSemicolon() - ) { - isAsync = true; - } else { - keyName = 'async'; - } - } - if ( - !keyName && - (ecmaVersion2 >= 9 || !isAsync) && - this.eat(types$12.star) - ) { - isGenerator = true; - } - if (!keyName && !isAsync && !isGenerator) { - var lastValue = this.value; - if (this.eatContextual('get') || this.eatContextual('set')) { - if (this.isClassElementNameStart()) { - kind = lastValue; - } else { - keyName = lastValue; - } - } - } - if (keyName) { - node.computed = false; - node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); - node.key.name = keyName; - this.finishNode(node.key, 'Identifier'); - } else { - this.parseClassElementName(node); - } - if ( - ecmaVersion2 < 13 || - this.type === types$12.parenL || - kind !== 'method' || - isGenerator || - isAsync - ) { - var isConstructor = - !node.static && checkKeyName2(node, 'constructor'); - var allowsDirectSuper = isConstructor && constructorAllowsSuper; - if (isConstructor && kind !== 'method') { - this.raise( - node.key.start, - "Constructor can't have get/set modifier", - ); - } - node.kind = isConstructor ? 'constructor' : kind; - this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); - } else { - this.parseClassField(node); - } - return node; - }; - pp$82.isClassElementNameStart = function () { - return ( - this.type === types$12.name || - this.type === types$12.privateId || - this.type === types$12.num || - this.type === types$12.string || - this.type === types$12.bracketL || - this.type.keyword - ); - }; - pp$82.parseClassElementName = function (element2) { - if (this.type === types$12.privateId) { - if (this.value === 'constructor') { - this.raise( - this.start, - "Classes can't have an element named '#constructor'", - ); - } - element2.computed = false; - element2.key = this.parsePrivateIdent(); - } else { - this.parsePropertyName(element2); - } - }; - pp$82.parseClassMethod = function ( - method, - isGenerator, - isAsync, - allowsDirectSuper, - ) { - var key = method.key; - if (method.kind === 'constructor') { - if (isGenerator) { - this.raise(key.start, "Constructor can't be a generator"); - } - if (isAsync) { - this.raise(key.start, "Constructor can't be an async method"); - } - } else if (method.static && checkKeyName2(method, 'prototype')) { - this.raise( - key.start, - 'Classes may not have a static property named prototype', - ); - } - var value = (method.value = this.parseMethod( - isGenerator, - isAsync, - allowsDirectSuper, - )); - if (method.kind === 'get' && value.params.length !== 0) { - this.raiseRecoverable(value.start, 'getter should have no params'); - } - if (method.kind === 'set' && value.params.length !== 1) { - this.raiseRecoverable( - value.start, - 'setter should have exactly one param', - ); - } - if (method.kind === 'set' && value.params[0].type === 'RestElement') { - this.raiseRecoverable( - value.params[0].start, - 'Setter cannot use rest params', - ); - } - return this.finishNode(method, 'MethodDefinition'); - }; - pp$82.parseClassField = function (field) { - if (checkKeyName2(field, 'constructor')) { - this.raise( - field.key.start, - "Classes can't have a field named 'constructor'", - ); - } else if (field.static && checkKeyName2(field, 'prototype')) { - this.raise( - field.key.start, - "Classes can't have a static field named 'prototype'", - ); - } - if (this.eat(types$12.eq)) { - var scope = this.currentThisScope(); - var inClassFieldInit = scope.inClassFieldInit; - scope.inClassFieldInit = true; - field.value = this.parseMaybeAssign(); - scope.inClassFieldInit = inClassFieldInit; - } else { - field.value = null; - } - this.semicolon(); - return this.finishNode(field, 'PropertyDefinition'); - }; - pp$82.parseClassStaticBlock = function (node) { - node.body = []; - var oldLabels = this.labels; - this.labels = []; - this.enterScope(SCOPE_CLASS_STATIC_BLOCK2 | SCOPE_SUPER2); - while (this.type !== types$12.braceR) { - var stmt = this.parseStatement(null); - node.body.push(stmt); - } - this.next(); - this.exitScope(); - this.labels = oldLabels; - return this.finishNode(node, 'StaticBlock'); - }; - pp$82.parseClassId = function (node, isStatement) { - if (this.type === types$12.name) { - node.id = this.parseIdent(); - if (isStatement) { - this.checkLValSimple(node.id, BIND_LEXICAL2, false); - } - } else { - if (isStatement === true) { - this.unexpected(); - } - node.id = null; - } - }; - pp$82.parseClassSuper = function (node) { - node.superClass = this.eat(types$12._extends) - ? this.parseExprSubscripts(false) - : null; - }; - pp$82.enterClassBody = function () { - var element2 = { - declared: /* @__PURE__ */ Object.create(null), - used: [], - }; - this.privateNameStack.push(element2); - return element2.declared; - }; - pp$82.exitClassBody = function () { - var ref3 = this.privateNameStack.pop(); - var declared = ref3.declared; - var used = ref3.used; - var len = this.privateNameStack.length; - var parent = len === 0 ? null : this.privateNameStack[len - 1]; - for (var i2 = 0; i2 < used.length; ++i2) { - var id = used[i2]; - if (!hasOwn2(declared, id.name)) { - if (parent) { - parent.used.push(id); - } else { - this.raiseRecoverable( - id.start, - "Private field '#" + - id.name + - "' must be declared in an enclosing class", - ); - } - } - } - }; - function isPrivateNameConflicted2(privateNameMap, element2) { - var name2 = element2.key.name; - var curr = privateNameMap[name2]; - var next = 'true'; - if ( - element2.type === 'MethodDefinition' && - (element2.kind === 'get' || element2.kind === 'set') - ) { - next = (element2.static ? 's' : 'i') + element2.kind; - } - if ( - (curr === 'iget' && next === 'iset') || - (curr === 'iset' && next === 'iget') || - (curr === 'sget' && next === 'sset') || - (curr === 'sset' && next === 'sget') - ) { - privateNameMap[name2] = 'true'; - return false; - } else if (!curr) { - privateNameMap[name2] = next; - return false; - } else { - return true; - } - } - function checkKeyName2(node, name2) { - var computed = node.computed; - var key = node.key; - return ( - !computed && - ((key.type === 'Identifier' && key.name === name2) || - (key.type === 'Literal' && key.value === name2)) - ); - } - pp$82.parseExport = function (node, exports3) { - this.next(); - if (this.eat(types$12.star)) { - if (this.options.ecmaVersion >= 11) { - if (this.eatContextual('as')) { - node.exported = this.parseModuleExportName(); - this.checkExport(exports3, node.exported, this.lastTokStart); - } else { - node.exported = null; - } - } - this.expectContextual('from'); - if (this.type !== types$12.string) { - this.unexpected(); - } - node.source = this.parseExprAtom(); - this.semicolon(); - return this.finishNode(node, 'ExportAllDeclaration'); - } - if (this.eat(types$12._default)) { - this.checkExport(exports3, 'default', this.lastTokStart); - var isAsync; - if ( - this.type === types$12._function || - (isAsync = this.isAsyncFunction()) - ) { - var fNode = this.startNode(); - this.next(); - if (isAsync) { - this.next(); - } - node.declaration = this.parseFunction( - fNode, - FUNC_STATEMENT2 | FUNC_NULLABLE_ID2, - false, - isAsync, - ); - } else if (this.type === types$12._class) { - var cNode = this.startNode(); - node.declaration = this.parseClass(cNode, 'nullableID'); - } else { - node.declaration = this.parseMaybeAssign(); - this.semicolon(); - } - return this.finishNode(node, 'ExportDefaultDeclaration'); - } - if (this.shouldParseExportStatement()) { - node.declaration = this.parseStatement(null); - if (node.declaration.type === 'VariableDeclaration') { - this.checkVariableExport(exports3, node.declaration.declarations); - } else { - this.checkExport( - exports3, - node.declaration.id, - node.declaration.id.start, - ); - } - node.specifiers = []; - node.source = null; - } else { - node.declaration = null; - node.specifiers = this.parseExportSpecifiers(exports3); - if (this.eatContextual('from')) { - if (this.type !== types$12.string) { - this.unexpected(); - } - node.source = this.parseExprAtom(); - } else { - for ( - var i2 = 0, list4 = node.specifiers; - i2 < list4.length; - i2 += 1 - ) { - var spec = list4[i2]; - this.checkUnreserved(spec.local); - this.checkLocalExport(spec.local); - if (spec.local.type === 'Literal') { - this.raise( - spec.local.start, - 'A string literal cannot be used as an exported binding without `from`.', - ); - } - } - node.source = null; - } - this.semicolon(); - } - return this.finishNode(node, 'ExportNamedDeclaration'); - }; - pp$82.checkExport = function (exports3, name2, pos) { - if (!exports3) { - return; - } - if (typeof name2 !== 'string') { - name2 = name2.type === 'Identifier' ? name2.name : name2.value; - } - if (hasOwn2(exports3, name2)) { - this.raiseRecoverable(pos, "Duplicate export '" + name2 + "'"); - } - exports3[name2] = true; - }; - pp$82.checkPatternExport = function (exports3, pat) { - var type = pat.type; - if (type === 'Identifier') { - this.checkExport(exports3, pat, pat.start); - } else if (type === 'ObjectPattern') { - for (var i2 = 0, list4 = pat.properties; i2 < list4.length; i2 += 1) { - var prop = list4[i2]; - this.checkPatternExport(exports3, prop); - } - } else if (type === 'ArrayPattern') { - for ( - var i$1 = 0, list$1 = pat.elements; - i$1 < list$1.length; - i$1 += 1 - ) { - var elt = list$1[i$1]; - if (elt) { - this.checkPatternExport(exports3, elt); - } - } - } else if (type === 'Property') { - this.checkPatternExport(exports3, pat.value); - } else if (type === 'AssignmentPattern') { - this.checkPatternExport(exports3, pat.left); - } else if (type === 'RestElement') { - this.checkPatternExport(exports3, pat.argument); - } else if (type === 'ParenthesizedExpression') { - this.checkPatternExport(exports3, pat.expression); - } - }; - pp$82.checkVariableExport = function (exports3, decls) { - if (!exports3) { - return; - } - for (var i2 = 0, list4 = decls; i2 < list4.length; i2 += 1) { - var decl = list4[i2]; - this.checkPatternExport(exports3, decl.id); - } - }; - pp$82.shouldParseExportStatement = function () { - return ( - this.type.keyword === 'var' || - this.type.keyword === 'const' || - this.type.keyword === 'class' || - this.type.keyword === 'function' || - this.isLet() || - this.isAsyncFunction() - ); - }; - pp$82.parseExportSpecifiers = function (exports3) { - var nodes = [], - first = true; - this.expect(types$12.braceL); - while (!this.eat(types$12.braceR)) { - if (!first) { - this.expect(types$12.comma); - if (this.afterTrailingComma(types$12.braceR)) { - break; - } - } else { - first = false; - } - var node = this.startNode(); - node.local = this.parseModuleExportName(); - node.exported = this.eatContextual('as') - ? this.parseModuleExportName() - : node.local; - this.checkExport(exports3, node.exported, node.exported.start); - nodes.push(this.finishNode(node, 'ExportSpecifier')); - } - return nodes; - }; - pp$82.parseImport = function (node) { - this.next(); - if (this.type === types$12.string) { - node.specifiers = empty$12; - node.source = this.parseExprAtom(); - } else { - node.specifiers = this.parseImportSpecifiers(); - this.expectContextual('from'); - node.source = - this.type === types$12.string - ? this.parseExprAtom() - : this.unexpected(); - } - this.semicolon(); - return this.finishNode(node, 'ImportDeclaration'); - }; - pp$82.parseImportSpecifiers = function () { - var nodes = [], - first = true; - if (this.type === types$12.name) { - var node = this.startNode(); - node.local = this.parseIdent(); - this.checkLValSimple(node.local, BIND_LEXICAL2); - nodes.push(this.finishNode(node, 'ImportDefaultSpecifier')); - if (!this.eat(types$12.comma)) { - return nodes; - } - } - if (this.type === types$12.star) { - var node$1 = this.startNode(); - this.next(); - this.expectContextual('as'); - node$1.local = this.parseIdent(); - this.checkLValSimple(node$1.local, BIND_LEXICAL2); - nodes.push(this.finishNode(node$1, 'ImportNamespaceSpecifier')); - return nodes; - } - this.expect(types$12.braceL); - while (!this.eat(types$12.braceR)) { - if (!first) { - this.expect(types$12.comma); - if (this.afterTrailingComma(types$12.braceR)) { - break; - } - } else { - first = false; - } - var node$2 = this.startNode(); - node$2.imported = this.parseModuleExportName(); - if (this.eatContextual('as')) { - node$2.local = this.parseIdent(); - } else { - this.checkUnreserved(node$2.imported); - node$2.local = node$2.imported; - } - this.checkLValSimple(node$2.local, BIND_LEXICAL2); - nodes.push(this.finishNode(node$2, 'ImportSpecifier')); - } - return nodes; - }; - pp$82.parseModuleExportName = function () { - if (this.options.ecmaVersion >= 13 && this.type === types$12.string) { - var stringLiteral = this.parseLiteral(this.value); - if (loneSurrogate2.test(stringLiteral.value)) { - this.raise( - stringLiteral.start, - 'An export name cannot include a lone surrogate.', - ); - } - return stringLiteral; - } - return this.parseIdent(true); - }; - pp$82.adaptDirectivePrologue = function (statements) { - for ( - var i2 = 0; - i2 < statements.length && this.isDirectiveCandidate(statements[i2]); - ++i2 - ) { - statements[i2].directive = statements[i2].expression.raw.slice(1, -1); - } - }; - pp$82.isDirectiveCandidate = function (statement) { - return ( - this.options.ecmaVersion >= 5 && - statement.type === 'ExpressionStatement' && - statement.expression.type === 'Literal' && - typeof statement.expression.value === 'string' && - (this.input[statement.start] === '"' || - this.input[statement.start] === "'") - ); - }; - var pp$72 = Parser3.prototype; - pp$72.toAssignable = function (node, isBinding, refDestructuringErrors) { - if (this.options.ecmaVersion >= 6 && node) { - switch (node.type) { - case 'Identifier': - if (this.inAsync && node.name === 'await') { - this.raise( - node.start, - "Cannot use 'await' as identifier inside an async function", - ); - } - break; - case 'ObjectPattern': - case 'ArrayPattern': - case 'AssignmentPattern': - case 'RestElement': - break; - case 'ObjectExpression': - node.type = 'ObjectPattern'; - if (refDestructuringErrors) { - this.checkPatternErrors(refDestructuringErrors, true); - } - for ( - var i2 = 0, list4 = node.properties; - i2 < list4.length; - i2 += 1 - ) { - var prop = list4[i2]; - this.toAssignable(prop, isBinding); - if ( - prop.type === 'RestElement' && - (prop.argument.type === 'ArrayPattern' || - prop.argument.type === 'ObjectPattern') - ) { - this.raise(prop.argument.start, 'Unexpected token'); - } - } - break; - case 'Property': - if (node.kind !== 'init') { - this.raise( - node.key.start, - "Object pattern can't contain getter or setter", - ); - } - this.toAssignable(node.value, isBinding); - break; - case 'ArrayExpression': - node.type = 'ArrayPattern'; - if (refDestructuringErrors) { - this.checkPatternErrors(refDestructuringErrors, true); - } - this.toAssignableList(node.elements, isBinding); - break; - case 'SpreadElement': - node.type = 'RestElement'; - this.toAssignable(node.argument, isBinding); - if (node.argument.type === 'AssignmentPattern') { - this.raise( - node.argument.start, - 'Rest elements cannot have a default value', - ); - } - break; - case 'AssignmentExpression': - if (node.operator !== '=') { - this.raise( - node.left.end, - "Only '=' operator can be used for specifying default value.", - ); - } - node.type = 'AssignmentPattern'; - delete node.operator; - this.toAssignable(node.left, isBinding); - break; - case 'ParenthesizedExpression': - this.toAssignable( - node.expression, - isBinding, - refDestructuringErrors, - ); - break; - case 'ChainExpression': - this.raiseRecoverable( - node.start, - 'Optional chaining cannot appear in left-hand side', - ); - break; - case 'MemberExpression': - if (!isBinding) { - break; - } - default: - this.raise(node.start, 'Assigning to rvalue'); - } - } else if (refDestructuringErrors) { - this.checkPatternErrors(refDestructuringErrors, true); - } - return node; - }; - pp$72.toAssignableList = function (exprList, isBinding) { - var end = exprList.length; - for (var i2 = 0; i2 < end; i2++) { - var elt = exprList[i2]; - if (elt) { - this.toAssignable(elt, isBinding); - } - } - if (end) { - var last = exprList[end - 1]; - if ( - this.options.ecmaVersion === 6 && - isBinding && - last && - last.type === 'RestElement' && - last.argument.type !== 'Identifier' - ) { - this.unexpected(last.argument.start); - } - } - return exprList; - }; - pp$72.parseSpread = function (refDestructuringErrors) { - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(false, refDestructuringErrors); - return this.finishNode(node, 'SpreadElement'); - }; - pp$72.parseRestBinding = function () { - var node = this.startNode(); - this.next(); - if (this.options.ecmaVersion === 6 && this.type !== types$12.name) { - this.unexpected(); - } - node.argument = this.parseBindingAtom(); - return this.finishNode(node, 'RestElement'); - }; - pp$72.parseBindingAtom = function () { - if (this.options.ecmaVersion >= 6) { - switch (this.type) { - case types$12.bracketL: - var node = this.startNode(); - this.next(); - node.elements = this.parseBindingList( - types$12.bracketR, - true, - true, - ); - return this.finishNode(node, 'ArrayPattern'); - case types$12.braceL: - return this.parseObj(true); - } - } - return this.parseIdent(); - }; - pp$72.parseBindingList = function ( - close, - allowEmpty, - allowTrailingComma, - ) { - var elts = [], - first = true; - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(types$12.comma); - } - if (allowEmpty && this.type === types$12.comma) { - elts.push(null); - } else if (allowTrailingComma && this.afterTrailingComma(close)) { - break; - } else if (this.type === types$12.ellipsis) { - var rest = this.parseRestBinding(); - this.parseBindingListItem(rest); - elts.push(rest); - if (this.type === types$12.comma) { - this.raise( - this.start, - 'Comma is not permitted after the rest element', - ); - } - this.expect(close); - break; - } else { - var elem = this.parseMaybeDefault(this.start, this.startLoc); - this.parseBindingListItem(elem); - elts.push(elem); - } - } - return elts; - }; - pp$72.parseBindingListItem = function (param) { - return param; - }; - pp$72.parseMaybeDefault = function (startPos, startLoc, left) { - left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(types$12.eq)) { - return left; - } - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.right = this.parseMaybeAssign(); - return this.finishNode(node, 'AssignmentPattern'); - }; - pp$72.checkLValSimple = function (expr, bindingType, checkClashes) { - if (bindingType === void 0) bindingType = BIND_NONE2; - var isBind = bindingType !== BIND_NONE2; - switch (expr.type) { - case 'Identifier': - if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { - this.raiseRecoverable( - expr.start, - (isBind ? 'Binding ' : 'Assigning to ') + - expr.name + - ' in strict mode', - ); - } - if (isBind) { - if (bindingType === BIND_LEXICAL2 && expr.name === 'let') { - this.raiseRecoverable( - expr.start, - 'let is disallowed as a lexically bound name', - ); - } - if (checkClashes) { - if (hasOwn2(checkClashes, expr.name)) { - this.raiseRecoverable(expr.start, 'Argument name clash'); - } - checkClashes[expr.name] = true; - } - if (bindingType !== BIND_OUTSIDE2) { - this.declareName(expr.name, bindingType, expr.start); - } - } - break; - case 'ChainExpression': - this.raiseRecoverable( - expr.start, - 'Optional chaining cannot appear in left-hand side', - ); - break; - case 'MemberExpression': - if (isBind) { - this.raiseRecoverable(expr.start, 'Binding member expression'); - } - break; - case 'ParenthesizedExpression': - if (isBind) { - this.raiseRecoverable( - expr.start, - 'Binding parenthesized expression', - ); - } - return this.checkLValSimple( - expr.expression, - bindingType, - checkClashes, - ); - default: - this.raise( - expr.start, - (isBind ? 'Binding' : 'Assigning to') + ' rvalue', - ); - } - }; - pp$72.checkLValPattern = function (expr, bindingType, checkClashes) { - if (bindingType === void 0) bindingType = BIND_NONE2; - switch (expr.type) { - case 'ObjectPattern': - for ( - var i2 = 0, list4 = expr.properties; - i2 < list4.length; - i2 += 1 - ) { - var prop = list4[i2]; - this.checkLValInnerPattern(prop, bindingType, checkClashes); - } - break; - case 'ArrayPattern': - for ( - var i$1 = 0, list$1 = expr.elements; - i$1 < list$1.length; - i$1 += 1 - ) { - var elem = list$1[i$1]; - if (elem) { - this.checkLValInnerPattern(elem, bindingType, checkClashes); - } - } - break; - default: - this.checkLValSimple(expr, bindingType, checkClashes); - } - }; - pp$72.checkLValInnerPattern = function (expr, bindingType, checkClashes) { - if (bindingType === void 0) bindingType = BIND_NONE2; - switch (expr.type) { - case 'Property': - this.checkLValInnerPattern(expr.value, bindingType, checkClashes); - break; - case 'AssignmentPattern': - this.checkLValPattern(expr.left, bindingType, checkClashes); - break; - case 'RestElement': - this.checkLValPattern(expr.argument, bindingType, checkClashes); - break; - default: - this.checkLValPattern(expr, bindingType, checkClashes); - } - }; - var TokContext3 = function TokContext4( - token, - isExpr, - preserveSpace, - override, - generator, - ) { - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; - this.generator = !!generator; - }; - var types2 = { - b_stat: new TokContext3('{', false), - b_expr: new TokContext3('{', true), - b_tmpl: new TokContext3('${', false), - p_stat: new TokContext3('(', false), - p_expr: new TokContext3('(', true), - q_tmpl: new TokContext3('`', true, true, function (p) { - return p.tryReadTemplateToken(); - }), - f_stat: new TokContext3('function', false), - f_expr: new TokContext3('function', true), - f_expr_gen: new TokContext3('function', true, false, null, true), - f_gen: new TokContext3('function', false, false, null, true), - }; - var pp$62 = Parser3.prototype; - pp$62.initialContext = function () { - return [types2.b_stat]; - }; - pp$62.curContext = function () { - return this.context[this.context.length - 1]; - }; - pp$62.braceIsBlock = function (prevType) { - var parent = this.curContext(); - if (parent === types2.f_expr || parent === types2.f_stat) { - return true; - } - if ( - prevType === types$12.colon && - (parent === types2.b_stat || parent === types2.b_expr) - ) { - return !parent.isExpr; - } - if ( - prevType === types$12._return || - (prevType === types$12.name && this.exprAllowed) - ) { - return lineBreak2.test(this.input.slice(this.lastTokEnd, this.start)); - } - if ( - prevType === types$12._else || - prevType === types$12.semi || - prevType === types$12.eof || - prevType === types$12.parenR || - prevType === types$12.arrow - ) { - return true; - } - if (prevType === types$12.braceL) { - return parent === types2.b_stat; - } - if ( - prevType === types$12._var || - prevType === types$12._const || - prevType === types$12.name - ) { - return false; - } - return !this.exprAllowed; - }; - pp$62.inGeneratorContext = function () { - for (var i2 = this.context.length - 1; i2 >= 1; i2--) { - var context = this.context[i2]; - if (context.token === 'function') { - return context.generator; - } - } - return false; - }; - pp$62.updateContext = function (prevType) { - var update, - type = this.type; - if (type.keyword && prevType === types$12.dot) { - this.exprAllowed = false; - } else if ((update = type.updateContext)) { - update.call(this, prevType); - } else { - this.exprAllowed = type.beforeExpr; - } - }; - pp$62.overrideContext = function (tokenCtx) { - if (this.curContext() !== tokenCtx) { - this.context[this.context.length - 1] = tokenCtx; - } - }; - types$12.parenR.updateContext = types$12.braceR.updateContext = - function () { - if (this.context.length === 1) { - this.exprAllowed = true; - return; - } - var out = this.context.pop(); - if (out === types2.b_stat && this.curContext().token === 'function') { - out = this.context.pop(); - } - this.exprAllowed = !out.isExpr; - }; - types$12.braceL.updateContext = function (prevType) { - this.context.push( - this.braceIsBlock(prevType) ? types2.b_stat : types2.b_expr, - ); - this.exprAllowed = true; - }; - types$12.dollarBraceL.updateContext = function () { - this.context.push(types2.b_tmpl); - this.exprAllowed = true; - }; - types$12.parenL.updateContext = function (prevType) { - var statementParens = - prevType === types$12._if || - prevType === types$12._for || - prevType === types$12._with || - prevType === types$12._while; - this.context.push(statementParens ? types2.p_stat : types2.p_expr); - this.exprAllowed = true; - }; - types$12.incDec.updateContext = function () {}; - types$12._function.updateContext = types$12._class.updateContext = - function (prevType) { - if ( - prevType.beforeExpr && - prevType !== types$12._else && - !( - prevType === types$12.semi && this.curContext() !== types2.p_stat - ) && - !( - prevType === types$12._return && - lineBreak2.test(this.input.slice(this.lastTokEnd, this.start)) - ) && - !( - (prevType === types$12.colon || prevType === types$12.braceL) && - this.curContext() === types2.b_stat - ) - ) { - this.context.push(types2.f_expr); - } else { - this.context.push(types2.f_stat); - } - this.exprAllowed = false; - }; - types$12.backQuote.updateContext = function () { - if (this.curContext() === types2.q_tmpl) { - this.context.pop(); - } else { - this.context.push(types2.q_tmpl); - } - this.exprAllowed = false; - }; - types$12.star.updateContext = function (prevType) { - if (prevType === types$12._function) { - var index2 = this.context.length - 1; - if (this.context[index2] === types2.f_expr) { - this.context[index2] = types2.f_expr_gen; - } else { - this.context[index2] = types2.f_gen; - } - } - this.exprAllowed = true; - }; - types$12.name.updateContext = function (prevType) { - var allowed = false; - if (this.options.ecmaVersion >= 6 && prevType !== types$12.dot) { - if ( - (this.value === 'of' && !this.exprAllowed) || - (this.value === 'yield' && this.inGeneratorContext()) - ) { - allowed = true; - } - } - this.exprAllowed = allowed; - }; - var pp$52 = Parser3.prototype; - pp$52.checkPropClash = function (prop, propHash, refDestructuringErrors) { - if (this.options.ecmaVersion >= 9 && prop.type === 'SpreadElement') { - return; - } - if ( - this.options.ecmaVersion >= 6 && - (prop.computed || prop.method || prop.shorthand) - ) { - return; - } - var key = prop.key; - var name2; - switch (key.type) { - case 'Identifier': - name2 = key.name; - break; - case 'Literal': - name2 = String(key.value); - break; - default: - return; - } - var kind = prop.kind; - if (this.options.ecmaVersion >= 6) { - if (name2 === '__proto__' && kind === 'init') { - if (propHash.proto) { - if (refDestructuringErrors) { - if (refDestructuringErrors.doubleProto < 0) { - refDestructuringErrors.doubleProto = key.start; - } - } else { - this.raiseRecoverable( - key.start, - 'Redefinition of __proto__ property', - ); - } - } - propHash.proto = true; - } - return; - } - name2 = '$' + name2; - var other = propHash[name2]; - if (other) { - var redefinition; - if (kind === 'init') { - redefinition = - (this.strict && other.init) || other.get || other.set; - } else { - redefinition = other.init || other[kind]; - } - if (redefinition) { - this.raiseRecoverable(key.start, 'Redefinition of property'); - } - } else { - other = propHash[name2] = { - init: false, - get: false, - set: false, - }; - } - other[kind] = true; - }; - pp$52.parseExpression = function (forInit, refDestructuringErrors) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); - if (this.type === types$12.comma) { - var node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - while (this.eat(types$12.comma)) { - node.expressions.push( - this.parseMaybeAssign(forInit, refDestructuringErrors), - ); - } - return this.finishNode(node, 'SequenceExpression'); - } - return expr; - }; - pp$52.parseMaybeAssign = function ( - forInit, - refDestructuringErrors, - afterLeftParse, - ) { - if (this.isContextual('yield')) { - if (this.inGenerator) { - return this.parseYield(forInit); - } else { - this.exprAllowed = false; - } - } - var ownDestructuringErrors = false, - oldParenAssign = -1, - oldTrailingComma = -1, - oldDoubleProto = -1; - if (refDestructuringErrors) { - oldParenAssign = refDestructuringErrors.parenthesizedAssign; - oldTrailingComma = refDestructuringErrors.trailingComma; - oldDoubleProto = refDestructuringErrors.doubleProto; - refDestructuringErrors.parenthesizedAssign = - refDestructuringErrors.trailingComma = -1; - } else { - refDestructuringErrors = new DestructuringErrors3(); - ownDestructuringErrors = true; - } - var startPos = this.start, - startLoc = this.startLoc; - if (this.type === types$12.parenL || this.type === types$12.name) { - this.potentialArrowAt = this.start; - this.potentialArrowInForAwait = forInit === 'await'; - } - var left = this.parseMaybeConditional(forInit, refDestructuringErrors); - if (afterLeftParse) { - left = afterLeftParse.call(this, left, startPos, startLoc); - } - if (this.type.isAssign) { - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.value; - if (this.type === types$12.eq) { - left = this.toAssignable(left, false, refDestructuringErrors); - } - if (!ownDestructuringErrors) { - refDestructuringErrors.parenthesizedAssign = - refDestructuringErrors.trailingComma = - refDestructuringErrors.doubleProto = - -1; - } - if (refDestructuringErrors.shorthandAssign >= left.start) { - refDestructuringErrors.shorthandAssign = -1; - } - if (this.type === types$12.eq) { - this.checkLValPattern(left); - } else { - this.checkLValSimple(left); - } - node.left = left; - this.next(); - node.right = this.parseMaybeAssign(forInit); - if (oldDoubleProto > -1) { - refDestructuringErrors.doubleProto = oldDoubleProto; - } - return this.finishNode(node, 'AssignmentExpression'); - } else { - if (ownDestructuringErrors) { - this.checkExpressionErrors(refDestructuringErrors, true); - } - } - if (oldParenAssign > -1) { - refDestructuringErrors.parenthesizedAssign = oldParenAssign; - } - if (oldTrailingComma > -1) { - refDestructuringErrors.trailingComma = oldTrailingComma; - } - return left; - }; - pp$52.parseMaybeConditional = function (forInit, refDestructuringErrors) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseExprOps(forInit, refDestructuringErrors); - if (this.checkExpressionErrors(refDestructuringErrors)) { - return expr; - } - if (this.eat(types$12.question)) { - var node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(types$12.colon); - node.alternate = this.parseMaybeAssign(forInit); - return this.finishNode(node, 'ConditionalExpression'); - } - return expr; - }; - pp$52.parseExprOps = function (forInit, refDestructuringErrors) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseMaybeUnary( - refDestructuringErrors, - false, - false, - forInit, - ); - if (this.checkExpressionErrors(refDestructuringErrors)) { - return expr; - } - return expr.start === startPos && - expr.type === 'ArrowFunctionExpression' - ? expr - : this.parseExprOp(expr, startPos, startLoc, -1, forInit); - }; - pp$52.parseExprOp = function ( - left, - leftStartPos, - leftStartLoc, - minPrec, - forInit, - ) { - var prec = this.type.binop; - if (prec != null && (!forInit || this.type !== types$12._in)) { - if (prec > minPrec) { - var logical = - this.type === types$12.logicalOR || - this.type === types$12.logicalAND; - var coalesce = this.type === types$12.coalesce; - if (coalesce) { - prec = types$12.logicalAND.binop; - } - var op = this.value; - this.next(); - var startPos = this.start, - startLoc = this.startLoc; - var right = this.parseExprOp( - this.parseMaybeUnary(null, false, false, forInit), - startPos, - startLoc, - prec, - forInit, - ); - var node = this.buildBinary( - leftStartPos, - leftStartLoc, - left, - right, - op, - logical || coalesce, - ); - if ( - (logical && this.type === types$12.coalesce) || - (coalesce && - (this.type === types$12.logicalOR || - this.type === types$12.logicalAND)) - ) { - this.raiseRecoverable( - this.start, - 'Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses', - ); - } - return this.parseExprOp( - node, - leftStartPos, - leftStartLoc, - minPrec, - forInit, - ); - } - } - return left; - }; - pp$52.buildBinary = function ( - startPos, - startLoc, - left, - right, - op, - logical, - ) { - if (right.type === 'PrivateIdentifier') { - this.raise( - right.start, - 'Private identifier can only be left side of binary expression', - ); - } - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.operator = op; - node.right = right; - return this.finishNode( - node, - logical ? 'LogicalExpression' : 'BinaryExpression', - ); - }; - pp$52.parseMaybeUnary = function ( - refDestructuringErrors, - sawUnary, - incDec, - forInit, - ) { - var startPos = this.start, - startLoc = this.startLoc, - expr; - if (this.isContextual('await') && this.canAwait) { - expr = this.parseAwait(forInit); - sawUnary = true; - } else if (this.type.prefix) { - var node = this.startNode(), - update = this.type === types$12.incDec; - node.operator = this.value; - node.prefix = true; - this.next(); - node.argument = this.parseMaybeUnary(null, true, update, forInit); - this.checkExpressionErrors(refDestructuringErrors, true); - if (update) { - this.checkLValSimple(node.argument); - } else if ( - this.strict && - node.operator === 'delete' && - node.argument.type === 'Identifier' - ) { - this.raiseRecoverable( - node.start, - 'Deleting local variable in strict mode', - ); - } else if ( - node.operator === 'delete' && - isPrivateFieldAccess2(node.argument) - ) { - this.raiseRecoverable( - node.start, - 'Private fields can not be deleted', - ); - } else { - sawUnary = true; - } - expr = this.finishNode( - node, - update ? 'UpdateExpression' : 'UnaryExpression', - ); - } else if (!sawUnary && this.type === types$12.privateId) { - if (forInit || this.privateNameStack.length === 0) { - this.unexpected(); - } - expr = this.parsePrivateIdent(); - if (this.type !== types$12._in) { - this.unexpected(); - } - } else { - expr = this.parseExprSubscripts(refDestructuringErrors, forInit); - if (this.checkExpressionErrors(refDestructuringErrors)) { - return expr; - } - while (this.type.postfix && !this.canInsertSemicolon()) { - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.operator = this.value; - node$1.prefix = false; - node$1.argument = expr; - this.checkLValSimple(expr); - this.next(); - expr = this.finishNode(node$1, 'UpdateExpression'); - } - } - if (!incDec && this.eat(types$12.starstar)) { - if (sawUnary) { - this.unexpected(this.lastTokStart); - } else { - return this.buildBinary( - startPos, - startLoc, - expr, - this.parseMaybeUnary(null, false, false, forInit), - '**', - false, - ); - } - } else { - return expr; - } - }; - function isPrivateFieldAccess2(node) { - return ( - (node.type === 'MemberExpression' && - node.property.type === 'PrivateIdentifier') || - (node.type === 'ChainExpression' && - isPrivateFieldAccess2(node.expression)) - ); - } - pp$52.parseExprSubscripts = function (refDestructuringErrors, forInit) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseExprAtom(refDestructuringErrors, forInit); - if ( - expr.type === 'ArrowFunctionExpression' && - this.input.slice(this.lastTokStart, this.lastTokEnd) !== ')' - ) { - return expr; - } - var result = this.parseSubscripts( - expr, - startPos, - startLoc, - false, - forInit, - ); - if (refDestructuringErrors && result.type === 'MemberExpression') { - if (refDestructuringErrors.parenthesizedAssign >= result.start) { - refDestructuringErrors.parenthesizedAssign = -1; - } - if (refDestructuringErrors.parenthesizedBind >= result.start) { - refDestructuringErrors.parenthesizedBind = -1; - } - if (refDestructuringErrors.trailingComma >= result.start) { - refDestructuringErrors.trailingComma = -1; - } - } - return result; - }; - pp$52.parseSubscripts = function ( - base2, - startPos, - startLoc, - noCalls, - forInit, - ) { - var maybeAsyncArrow = - this.options.ecmaVersion >= 8 && - base2.type === 'Identifier' && - base2.name === 'async' && - this.lastTokEnd === base2.end && - !this.canInsertSemicolon() && - base2.end - base2.start === 5 && - this.potentialArrowAt === base2.start; - var optionalChained = false; - while (true) { - var element2 = this.parseSubscript( - base2, - startPos, - startLoc, - noCalls, - maybeAsyncArrow, - optionalChained, - forInit, - ); - if (element2.optional) { - optionalChained = true; - } - if ( - element2 === base2 || - element2.type === 'ArrowFunctionExpression' - ) { - if (optionalChained) { - var chainNode = this.startNodeAt(startPos, startLoc); - chainNode.expression = element2; - element2 = this.finishNode(chainNode, 'ChainExpression'); - } - return element2; - } - base2 = element2; - } - }; - pp$52.parseSubscript = function ( - base2, - startPos, - startLoc, - noCalls, - maybeAsyncArrow, - optionalChained, - forInit, - ) { - var optionalSupported = this.options.ecmaVersion >= 11; - var optional = optionalSupported && this.eat(types$12.questionDot); - if (noCalls && optional) { - this.raise( - this.lastTokStart, - 'Optional chaining cannot appear in the callee of new expressions', - ); - } - var computed = this.eat(types$12.bracketL); - if ( - computed || - (optional && - this.type !== types$12.parenL && - this.type !== types$12.backQuote) || - this.eat(types$12.dot) - ) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base2; - if (computed) { - node.property = this.parseExpression(); - this.expect(types$12.bracketR); - } else if ( - this.type === types$12.privateId && - base2.type !== 'Super' - ) { - node.property = this.parsePrivateIdent(); - } else { - node.property = this.parseIdent( - this.options.allowReserved !== 'never', - ); - } - node.computed = !!computed; - if (optionalSupported) { - node.optional = optional; - } - base2 = this.finishNode(node, 'MemberExpression'); - } else if (!noCalls && this.eat(types$12.parenL)) { - var refDestructuringErrors = new DestructuringErrors3(), - oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - var exprList = this.parseExprList( - types$12.parenR, - this.options.ecmaVersion >= 8, - false, - refDestructuringErrors, - ); - if ( - maybeAsyncArrow && - !optional && - !this.canInsertSemicolon() && - this.eat(types$12.arrow) - ) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - if (this.awaitIdentPos > 0) { - this.raise( - this.awaitIdentPos, - "Cannot use 'await' as identifier inside an async function", - ); - } - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.parseArrowExpression( - this.startNodeAt(startPos, startLoc), - exprList, - true, - forInit, - ); - } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.callee = base2; - node$1.arguments = exprList; - if (optionalSupported) { - node$1.optional = optional; - } - base2 = this.finishNode(node$1, 'CallExpression'); - } else if (this.type === types$12.backQuote) { - if (optional || optionalChained) { - this.raise( - this.start, - 'Optional chaining cannot appear in the tag of tagged template expressions', - ); - } - var node$2 = this.startNodeAt(startPos, startLoc); - node$2.tag = base2; - node$2.quasi = this.parseTemplate({isTagged: true}); - base2 = this.finishNode(node$2, 'TaggedTemplateExpression'); - } - return base2; - }; - pp$52.parseExprAtom = function (refDestructuringErrors, forInit) { - if (this.type === types$12.slash) { - this.readRegexp(); - } - var node, - canBeArrow = this.potentialArrowAt === this.start; - switch (this.type) { - case types$12._super: - if (!this.allowSuper) { - this.raise(this.start, "'super' keyword outside a method"); - } - node = this.startNode(); - this.next(); - if (this.type === types$12.parenL && !this.allowDirectSuper) { - this.raise( - node.start, - 'super() call outside constructor of a subclass', - ); - } - if ( - this.type !== types$12.dot && - this.type !== types$12.bracketL && - this.type !== types$12.parenL - ) { - this.unexpected(); - } - return this.finishNode(node, 'Super'); - case types$12._this: - node = this.startNode(); - this.next(); - return this.finishNode(node, 'ThisExpression'); - case types$12.name: - var startPos = this.start, - startLoc = this.startLoc, - containsEsc = this.containsEsc; - var id = this.parseIdent(false); - if ( - this.options.ecmaVersion >= 8 && - !containsEsc && - id.name === 'async' && - !this.canInsertSemicolon() && - this.eat(types$12._function) - ) { - this.overrideContext(types2.f_expr); - return this.parseFunction( - this.startNodeAt(startPos, startLoc), - 0, - false, - true, - forInit, - ); - } - if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(types$12.arrow)) { - return this.parseArrowExpression( - this.startNodeAt(startPos, startLoc), - [id], - false, - forInit, - ); - } - if ( - this.options.ecmaVersion >= 8 && - id.name === 'async' && - this.type === types$12.name && - !containsEsc && - (!this.potentialArrowInForAwait || - this.value !== 'of' || - this.containsEsc) - ) { - id = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(types$12.arrow)) { - this.unexpected(); - } - return this.parseArrowExpression( - this.startNodeAt(startPos, startLoc), - [id], - true, - forInit, - ); - } - } - return id; - case types$12.regexp: - var value = this.value; - node = this.parseLiteral(value.value); - node.regex = {pattern: value.pattern, flags: value.flags}; - return node; - case types$12.num: - case types$12.string: - return this.parseLiteral(this.value); - case types$12._null: - case types$12._true: - case types$12._false: - node = this.startNode(); - node.value = - this.type === types$12._null - ? null - : this.type === types$12._true; - node.raw = this.type.keyword; - this.next(); - return this.finishNode(node, 'Literal'); - case types$12.parenL: - var start3 = this.start, - expr = this.parseParenAndDistinguishExpression( - canBeArrow, - forInit, - ); - if (refDestructuringErrors) { - if ( - refDestructuringErrors.parenthesizedAssign < 0 && - !this.isSimpleAssignTarget(expr) - ) { - refDestructuringErrors.parenthesizedAssign = start3; - } - if (refDestructuringErrors.parenthesizedBind < 0) { - refDestructuringErrors.parenthesizedBind = start3; - } - } - return expr; - case types$12.bracketL: - node = this.startNode(); - this.next(); - node.elements = this.parseExprList( - types$12.bracketR, - true, - true, - refDestructuringErrors, - ); - return this.finishNode(node, 'ArrayExpression'); - case types$12.braceL: - this.overrideContext(types2.b_expr); - return this.parseObj(false, refDestructuringErrors); - case types$12._function: - node = this.startNode(); - this.next(); - return this.parseFunction(node, 0); - case types$12._class: - return this.parseClass(this.startNode(), false); - case types$12._new: - return this.parseNew(); - case types$12.backQuote: - return this.parseTemplate(); - case types$12._import: - if (this.options.ecmaVersion >= 11) { - return this.parseExprImport(); - } else { - return this.unexpected(); - } - default: - this.unexpected(); - } - }; - pp$52.parseExprImport = function () { - var node = this.startNode(); - if (this.containsEsc) { - this.raiseRecoverable( - this.start, - 'Escape sequence in keyword import', - ); - } - var meta = this.parseIdent(true); - switch (this.type) { - case types$12.parenL: - return this.parseDynamicImport(node); - case types$12.dot: - node.meta = meta; - return this.parseImportMeta(node); - default: - this.unexpected(); - } - }; - pp$52.parseDynamicImport = function (node) { - this.next(); - node.source = this.parseMaybeAssign(); - if (!this.eat(types$12.parenR)) { - var errorPos = this.start; - if (this.eat(types$12.comma) && this.eat(types$12.parenR)) { - this.raiseRecoverable( - errorPos, - 'Trailing comma is not allowed in import()', - ); - } else { - this.unexpected(errorPos); - } - } - return this.finishNode(node, 'ImportExpression'); - }; - pp$52.parseImportMeta = function (node) { - this.next(); - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - if (node.property.name !== 'meta') { - this.raiseRecoverable( - node.property.start, - "The only valid meta property for import is 'import.meta'", - ); - } - if (containsEsc) { - this.raiseRecoverable( - node.start, - "'import.meta' must not contain escaped characters", - ); - } - if ( - this.options.sourceType !== 'module' && - !this.options.allowImportExportEverywhere - ) { - this.raiseRecoverable( - node.start, - "Cannot use 'import.meta' outside a module", - ); - } - return this.finishNode(node, 'MetaProperty'); - }; - pp$52.parseLiteral = function (value) { - var node = this.startNode(); - node.value = value; - node.raw = this.input.slice(this.start, this.end); - if (node.raw.charCodeAt(node.raw.length - 1) === 110) { - node.bigint = node.raw.slice(0, -1).replace(/_/g, ''); - } - this.next(); - return this.finishNode(node, 'Literal'); - }; - pp$52.parseParenExpression = function () { - this.expect(types$12.parenL); - var val = this.parseExpression(); - this.expect(types$12.parenR); - return val; - }; - pp$52.parseParenAndDistinguishExpression = function ( - canBeArrow, - forInit, - ) { - var startPos = this.start, - startLoc = this.startLoc, - val, - allowTrailingComma = this.options.ecmaVersion >= 8; - if (this.options.ecmaVersion >= 6) { - this.next(); - var innerStartPos = this.start, - innerStartLoc = this.startLoc; - var exprList = [], - first = true, - lastIsComma = false; - var refDestructuringErrors = new DestructuringErrors3(), - oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - spreadStart; - this.yieldPos = 0; - this.awaitPos = 0; - while (this.type !== types$12.parenR) { - first ? (first = false) : this.expect(types$12.comma); - if ( - allowTrailingComma && - this.afterTrailingComma(types$12.parenR, true) - ) { - lastIsComma = true; - break; - } else if (this.type === types$12.ellipsis) { - spreadStart = this.start; - exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === types$12.comma) { - this.raise( - this.start, - 'Comma is not permitted after the rest element', - ); - } - break; - } else { - exprList.push( - this.parseMaybeAssign( - false, - refDestructuringErrors, - this.parseParenItem, - ), - ); - } - } - var innerEndPos = this.lastTokEnd, - innerEndLoc = this.lastTokEndLoc; - this.expect(types$12.parenR); - if ( - canBeArrow && - !this.canInsertSemicolon() && - this.eat(types$12.arrow) - ) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - return this.parseParenArrowList( - startPos, - startLoc, - exprList, - forInit, - ); - } - if (!exprList.length || lastIsComma) { - this.unexpected(this.lastTokStart); - } - if (spreadStart) { - this.unexpected(spreadStart); - } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.finishNodeAt( - val, - 'SequenceExpression', - innerEndPos, - innerEndLoc, - ); - } else { - val = exprList[0]; - } - } else { - val = this.parseParenExpression(); - } - if (this.options.preserveParens) { - var par = this.startNodeAt(startPos, startLoc); - par.expression = val; - return this.finishNode(par, 'ParenthesizedExpression'); - } else { - return val; - } - }; - pp$52.parseParenItem = function (item) { - return item; - }; - pp$52.parseParenArrowList = function ( - startPos, - startLoc, - exprList, - forInit, - ) { - return this.parseArrowExpression( - this.startNodeAt(startPos, startLoc), - exprList, - false, - forInit, - ); - }; - var empty3 = []; - pp$52.parseNew = function () { - if (this.containsEsc) { - this.raiseRecoverable(this.start, 'Escape sequence in keyword new'); - } - var node = this.startNode(); - var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(types$12.dot)) { - node.meta = meta; - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - if (node.property.name !== 'target') { - this.raiseRecoverable( - node.property.start, - "The only valid meta property for new is 'new.target'", - ); - } - if (containsEsc) { - this.raiseRecoverable( - node.start, - "'new.target' must not contain escaped characters", - ); - } - if (!this.allowNewDotTarget) { - this.raiseRecoverable( - node.start, - "'new.target' can only be used in functions and class static block", - ); - } - return this.finishNode(node, 'MetaProperty'); - } - var startPos = this.start, - startLoc = this.startLoc, - isImport = this.type === types$12._import; - node.callee = this.parseSubscripts( - this.parseExprAtom(), - startPos, - startLoc, - true, - false, - ); - if (isImport && node.callee.type === 'ImportExpression') { - this.raise(startPos, 'Cannot use new with import()'); - } - if (this.eat(types$12.parenL)) { - node.arguments = this.parseExprList( - types$12.parenR, - this.options.ecmaVersion >= 8, - false, - ); - } else { - node.arguments = empty3; - } - return this.finishNode(node, 'NewExpression'); - }; - pp$52.parseTemplateElement = function (ref3) { - var isTagged = ref3.isTagged; - var elem = this.startNode(); - if (this.type === types$12.invalidTemplate) { - if (!isTagged) { - this.raiseRecoverable( - this.start, - 'Bad escape sequence in untagged template literal', - ); - } - elem.value = { - raw: this.value, - cooked: null, - }; - } else { - elem.value = { - raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, '\n'), - cooked: this.value, - }; - } - this.next(); - elem.tail = this.type === types$12.backQuote; - return this.finishNode(elem, 'TemplateElement'); - }; - pp$52.parseTemplate = function (ref3) { - if (ref3 === void 0) ref3 = {}; - var isTagged = ref3.isTagged; - if (isTagged === void 0) isTagged = false; - var node = this.startNode(); - this.next(); - node.expressions = []; - var curElt = this.parseTemplateElement({isTagged}); - node.quasis = [curElt]; - while (!curElt.tail) { - if (this.type === types$12.eof) { - this.raise(this.pos, 'Unterminated template literal'); - } - this.expect(types$12.dollarBraceL); - node.expressions.push(this.parseExpression()); - this.expect(types$12.braceR); - node.quasis.push((curElt = this.parseTemplateElement({isTagged}))); - } - this.next(); - return this.finishNode(node, 'TemplateLiteral'); - }; - pp$52.isAsyncProp = function (prop) { - return ( - !prop.computed && - prop.key.type === 'Identifier' && - prop.key.name === 'async' && - (this.type === types$12.name || - this.type === types$12.num || - this.type === types$12.string || - this.type === types$12.bracketL || - this.type.keyword || - (this.options.ecmaVersion >= 9 && this.type === types$12.star)) && - !lineBreak2.test(this.input.slice(this.lastTokEnd, this.start)) - ); - }; - pp$52.parseObj = function (isPattern, refDestructuringErrors) { - var node = this.startNode(), - first = true, - propHash = {}; - node.properties = []; - this.next(); - while (!this.eat(types$12.braceR)) { - if (!first) { - this.expect(types$12.comma); - if ( - this.options.ecmaVersion >= 5 && - this.afterTrailingComma(types$12.braceR) - ) { - break; - } - } else { - first = false; - } - var prop = this.parseProperty(isPattern, refDestructuringErrors); - if (!isPattern) { - this.checkPropClash(prop, propHash, refDestructuringErrors); - } - node.properties.push(prop); - } - return this.finishNode( - node, - isPattern ? 'ObjectPattern' : 'ObjectExpression', - ); - }; - pp$52.parseProperty = function (isPattern, refDestructuringErrors) { - var prop = this.startNode(), - isGenerator, - isAsync, - startPos, - startLoc; - if (this.options.ecmaVersion >= 9 && this.eat(types$12.ellipsis)) { - if (isPattern) { - prop.argument = this.parseIdent(false); - if (this.type === types$12.comma) { - this.raise( - this.start, - 'Comma is not permitted after the rest element', - ); - } - return this.finishNode(prop, 'RestElement'); - } - prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); - if ( - this.type === types$12.comma && - refDestructuringErrors && - refDestructuringErrors.trailingComma < 0 - ) { - refDestructuringErrors.trailingComma = this.start; - } - return this.finishNode(prop, 'SpreadElement'); - } - if (this.options.ecmaVersion >= 6) { - prop.method = false; - prop.shorthand = false; - if (isPattern || refDestructuringErrors) { - startPos = this.start; - startLoc = this.startLoc; - } - if (!isPattern) { - isGenerator = this.eat(types$12.star); - } - } - var containsEsc = this.containsEsc; - this.parsePropertyName(prop); - if ( - !isPattern && - !containsEsc && - this.options.ecmaVersion >= 8 && - !isGenerator && - this.isAsyncProp(prop) - ) { - isAsync = true; - isGenerator = - this.options.ecmaVersion >= 9 && this.eat(types$12.star); - this.parsePropertyName(prop, refDestructuringErrors); - } else { - isAsync = false; - } - this.parsePropertyValue( - prop, - isPattern, - isGenerator, - isAsync, - startPos, - startLoc, - refDestructuringErrors, - containsEsc, - ); - return this.finishNode(prop, 'Property'); - }; - pp$52.parsePropertyValue = function ( - prop, - isPattern, - isGenerator, - isAsync, - startPos, - startLoc, - refDestructuringErrors, - containsEsc, - ) { - if ((isGenerator || isAsync) && this.type === types$12.colon) { - this.unexpected(); - } - if (this.eat(types$12.colon)) { - prop.value = isPattern - ? this.parseMaybeDefault(this.start, this.startLoc) - : this.parseMaybeAssign(false, refDestructuringErrors); - prop.kind = 'init'; - } else if ( - this.options.ecmaVersion >= 6 && - this.type === types$12.parenL - ) { - if (isPattern) { - this.unexpected(); - } - prop.kind = 'init'; - prop.method = true; - prop.value = this.parseMethod(isGenerator, isAsync); - } else if ( - !isPattern && - !containsEsc && - this.options.ecmaVersion >= 5 && - !prop.computed && - prop.key.type === 'Identifier' && - (prop.key.name === 'get' || prop.key.name === 'set') && - this.type !== types$12.comma && - this.type !== types$12.braceR && - this.type !== types$12.eq - ) { - if (isGenerator || isAsync) { - this.unexpected(); - } - prop.kind = prop.key.name; - this.parsePropertyName(prop); - prop.value = this.parseMethod(false); - var paramCount = prop.kind === 'get' ? 0 : 1; - if (prop.value.params.length !== paramCount) { - var start3 = prop.value.start; - if (prop.kind === 'get') { - this.raiseRecoverable(start3, 'getter should have no params'); - } else { - this.raiseRecoverable( - start3, - 'setter should have exactly one param', - ); - } - } else { - if ( - prop.kind === 'set' && - prop.value.params[0].type === 'RestElement' - ) { - this.raiseRecoverable( - prop.value.params[0].start, - 'Setter cannot use rest params', - ); - } - } - } else if ( - this.options.ecmaVersion >= 6 && - !prop.computed && - prop.key.type === 'Identifier' - ) { - if (isGenerator || isAsync) { - this.unexpected(); - } - this.checkUnreserved(prop.key); - if (prop.key.name === 'await' && !this.awaitIdentPos) { - this.awaitIdentPos = startPos; - } - prop.kind = 'init'; - if (isPattern) { - prop.value = this.parseMaybeDefault( - startPos, - startLoc, - this.copyNode(prop.key), - ); - } else if (this.type === types$12.eq && refDestructuringErrors) { - if (refDestructuringErrors.shorthandAssign < 0) { - refDestructuringErrors.shorthandAssign = this.start; - } - prop.value = this.parseMaybeDefault( - startPos, - startLoc, - this.copyNode(prop.key), - ); - } else { - prop.value = this.copyNode(prop.key); - } - prop.shorthand = true; - } else { - this.unexpected(); - } - }; - pp$52.parsePropertyName = function (prop) { - if (this.options.ecmaVersion >= 6) { - if (this.eat(types$12.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(types$12.bracketR); - return prop.key; - } else { - prop.computed = false; - } - } - return (prop.key = - this.type === types$12.num || this.type === types$12.string - ? this.parseExprAtom() - : this.parseIdent(this.options.allowReserved !== 'never')); - }; - pp$52.initFunction = function (node) { - node.id = null; - if (this.options.ecmaVersion >= 6) { - node.generator = node.expression = false; - } - if (this.options.ecmaVersion >= 8) { - node.async = false; - } - }; - pp$52.parseMethod = function (isGenerator, isAsync, allowDirectSuper) { - var node = this.startNode(), - oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; - this.initFunction(node); - if (this.options.ecmaVersion >= 6) { - node.generator = isGenerator; - } - if (this.options.ecmaVersion >= 8) { - node.async = !!isAsync; - } - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope( - functionFlags2(isAsync, node.generator) | - SCOPE_SUPER2 | - (allowDirectSuper ? SCOPE_DIRECT_SUPER2 : 0), - ); - this.expect(types$12.parenL); - node.params = this.parseBindingList( - types$12.parenR, - false, - this.options.ecmaVersion >= 8, - ); - this.checkYieldAwaitInDefaultParams(); - this.parseFunctionBody(node, false, true, false); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, 'FunctionExpression'); - }; - pp$52.parseArrowExpression = function (node, params, isAsync, forInit) { - var oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; - this.enterScope(functionFlags2(isAsync, false) | SCOPE_ARROW2); - this.initFunction(node); - if (this.options.ecmaVersion >= 8) { - node.async = !!isAsync; - } - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true, false, forInit); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, 'ArrowFunctionExpression'); - }; - pp$52.parseFunctionBody = function ( - node, - isArrowFunction, - isMethod, - forInit, - ) { - var isExpression = isArrowFunction && this.type !== types$12.braceL; - var oldStrict = this.strict, - useStrict = false; - if (isExpression) { - node.body = this.parseMaybeAssign(forInit); - node.expression = true; - this.checkParams(node, false); - } else { - var nonSimple = - this.options.ecmaVersion >= 7 && - !this.isSimpleParamList(node.params); - if (!oldStrict || nonSimple) { - useStrict = this.strictDirective(this.end); - if (useStrict && nonSimple) { - this.raiseRecoverable( - node.start, - "Illegal 'use strict' directive in function with non-simple parameter list", - ); - } - } - var oldLabels = this.labels; - this.labels = []; - if (useStrict) { - this.strict = true; - } - this.checkParams( - node, - !oldStrict && - !useStrict && - !isArrowFunction && - !isMethod && - this.isSimpleParamList(node.params), - ); - if (this.strict && node.id) { - this.checkLValSimple(node.id, BIND_OUTSIDE2); - } - node.body = this.parseBlock(false, void 0, useStrict && !oldStrict); - node.expression = false; - this.adaptDirectivePrologue(node.body.body); - this.labels = oldLabels; - } - this.exitScope(); - }; - pp$52.isSimpleParamList = function (params) { - for (var i2 = 0, list4 = params; i2 < list4.length; i2 += 1) { - var param = list4[i2]; - if (param.type !== 'Identifier') { - return false; - } - } - return true; - }; - pp$52.checkParams = function (node, allowDuplicates) { - var nameHash = /* @__PURE__ */ Object.create(null); - for (var i2 = 0, list4 = node.params; i2 < list4.length; i2 += 1) { - var param = list4[i2]; - this.checkLValInnerPattern( - param, - BIND_VAR2, - allowDuplicates ? null : nameHash, - ); - } - }; - pp$52.parseExprList = function ( - close, - allowTrailingComma, - allowEmpty, - refDestructuringErrors, - ) { - var elts = [], - first = true; - while (!this.eat(close)) { - if (!first) { - this.expect(types$12.comma); - if (allowTrailingComma && this.afterTrailingComma(close)) { - break; - } - } else { - first = false; - } - var elt = void 0; - if (allowEmpty && this.type === types$12.comma) { - elt = null; - } else if (this.type === types$12.ellipsis) { - elt = this.parseSpread(refDestructuringErrors); - if ( - refDestructuringErrors && - this.type === types$12.comma && - refDestructuringErrors.trailingComma < 0 - ) { - refDestructuringErrors.trailingComma = this.start; - } - } else { - elt = this.parseMaybeAssign(false, refDestructuringErrors); - } - elts.push(elt); - } - return elts; - }; - pp$52.checkUnreserved = function (ref3) { - var start3 = ref3.start; - var end = ref3.end; - var name2 = ref3.name; - if (this.inGenerator && name2 === 'yield') { - this.raiseRecoverable( - start3, - "Cannot use 'yield' as identifier inside a generator", - ); - } - if (this.inAsync && name2 === 'await') { - this.raiseRecoverable( - start3, - "Cannot use 'await' as identifier inside an async function", - ); - } - if (this.currentThisScope().inClassFieldInit && name2 === 'arguments') { - this.raiseRecoverable( - start3, - "Cannot use 'arguments' in class field initializer", - ); - } - if ( - this.inClassStaticBlock && - (name2 === 'arguments' || name2 === 'await') - ) { - this.raise( - start3, - 'Cannot use ' + name2 + ' in class static initialization block', - ); - } - if (this.keywords.test(name2)) { - this.raise(start3, "Unexpected keyword '" + name2 + "'"); - } - if ( - this.options.ecmaVersion < 6 && - this.input.slice(start3, end).indexOf('\\') !== -1 - ) { - return; - } - var re = this.strict ? this.reservedWordsStrict : this.reservedWords; - if (re.test(name2)) { - if (!this.inAsync && name2 === 'await') { - this.raiseRecoverable( - start3, - "Cannot use keyword 'await' outside an async function", - ); - } - this.raiseRecoverable( - start3, - "The keyword '" + name2 + "' is reserved", - ); - } - }; - pp$52.parseIdent = function (liberal, isBinding) { - var node = this.startNode(); - if (this.type === types$12.name) { - node.name = this.value; - } else if (this.type.keyword) { - node.name = this.type.keyword; - if ( - (node.name === 'class' || node.name === 'function') && - (this.lastTokEnd !== this.lastTokStart + 1 || - this.input.charCodeAt(this.lastTokStart) !== 46) - ) { - this.context.pop(); - } - } else { - this.unexpected(); - } - this.next(!!liberal); - this.finishNode(node, 'Identifier'); - if (!liberal) { - this.checkUnreserved(node); - if (node.name === 'await' && !this.awaitIdentPos) { - this.awaitIdentPos = node.start; - } - } - return node; - }; - pp$52.parsePrivateIdent = function () { - var node = this.startNode(); - if (this.type === types$12.privateId) { - node.name = this.value; - } else { - this.unexpected(); - } - this.next(); - this.finishNode(node, 'PrivateIdentifier'); - if (this.privateNameStack.length === 0) { - this.raise( - node.start, - "Private field '#" + - node.name + - "' must be declared in an enclosing class", - ); - } else { - this.privateNameStack[this.privateNameStack.length - 1].used.push( - node, - ); - } - return node; - }; - pp$52.parseYield = function (forInit) { - if (!this.yieldPos) { - this.yieldPos = this.start; - } - var node = this.startNode(); - this.next(); - if ( - this.type === types$12.semi || - this.canInsertSemicolon() || - (this.type !== types$12.star && !this.type.startsExpr) - ) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(types$12.star); - node.argument = this.parseMaybeAssign(forInit); - } - return this.finishNode(node, 'YieldExpression'); - }; - pp$52.parseAwait = function (forInit) { - if (!this.awaitPos) { - this.awaitPos = this.start; - } - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeUnary(null, true, false, forInit); - return this.finishNode(node, 'AwaitExpression'); - }; - var pp$42 = Parser3.prototype; - pp$42.raise = function (pos, message) { - var loc = getLineInfo2(this.input, pos); - message += ' (' + loc.line + ':' + loc.column + ')'; - var err = new SyntaxError(message); - err.pos = pos; - err.loc = loc; - err.raisedAt = this.pos; - throw err; - }; - pp$42.raiseRecoverable = pp$42.raise; - pp$42.curPosition = function () { - if (this.options.locations) { - return new Position3(this.curLine, this.pos - this.lineStart); - } - }; - var pp$32 = Parser3.prototype; - var Scope4 = function Scope5(flags) { - this.flags = flags; - this.var = []; - this.lexical = []; - this.functions = []; - this.inClassFieldInit = false; - }; - pp$32.enterScope = function (flags) { - this.scopeStack.push(new Scope4(flags)); - }; - pp$32.exitScope = function () { - this.scopeStack.pop(); - }; - pp$32.treatFunctionsAsVarInScope = function (scope) { - return ( - scope.flags & SCOPE_FUNCTION2 || - (!this.inModule && scope.flags & SCOPE_TOP2) - ); - }; - pp$32.declareName = function (name2, bindingType, pos) { - var redeclared = false; - if (bindingType === BIND_LEXICAL2) { - var scope = this.currentScope(); - redeclared = - scope.lexical.indexOf(name2) > -1 || - scope.functions.indexOf(name2) > -1 || - scope.var.indexOf(name2) > -1; - scope.lexical.push(name2); - if (this.inModule && scope.flags & SCOPE_TOP2) { - delete this.undefinedExports[name2]; - } - } else if (bindingType === BIND_SIMPLE_CATCH2) { - var scope$1 = this.currentScope(); - scope$1.lexical.push(name2); - } else if (bindingType === BIND_FUNCTION2) { - var scope$2 = this.currentScope(); - if (this.treatFunctionsAsVar) { - redeclared = scope$2.lexical.indexOf(name2) > -1; - } else { - redeclared = - scope$2.lexical.indexOf(name2) > -1 || - scope$2.var.indexOf(name2) > -1; - } - scope$2.functions.push(name2); - } else { - for (var i2 = this.scopeStack.length - 1; i2 >= 0; --i2) { - var scope$3 = this.scopeStack[i2]; - if ( - (scope$3.lexical.indexOf(name2) > -1 && - !( - scope$3.flags & SCOPE_SIMPLE_CATCH2 && - scope$3.lexical[0] === name2 - )) || - (!this.treatFunctionsAsVarInScope(scope$3) && - scope$3.functions.indexOf(name2) > -1) - ) { - redeclared = true; - break; - } - scope$3.var.push(name2); - if (this.inModule && scope$3.flags & SCOPE_TOP2) { - delete this.undefinedExports[name2]; - } - if (scope$3.flags & SCOPE_VAR2) { - break; - } - } - } - if (redeclared) { - this.raiseRecoverable( - pos, - "Identifier '" + name2 + "' has already been declared", - ); - } - }; - pp$32.checkLocalExport = function (id) { - if ( - this.scopeStack[0].lexical.indexOf(id.name) === -1 && - this.scopeStack[0].var.indexOf(id.name) === -1 - ) { - this.undefinedExports[id.name] = id; - } - }; - pp$32.currentScope = function () { - return this.scopeStack[this.scopeStack.length - 1]; - }; - pp$32.currentVarScope = function () { - for (var i2 = this.scopeStack.length - 1; ; i2--) { - var scope = this.scopeStack[i2]; - if (scope.flags & SCOPE_VAR2) { - return scope; - } - } - }; - pp$32.currentThisScope = function () { - for (var i2 = this.scopeStack.length - 1; ; i2--) { - var scope = this.scopeStack[i2]; - if (scope.flags & SCOPE_VAR2 && !(scope.flags & SCOPE_ARROW2)) { - return scope; - } - } - }; - var Node3 = function Node4(parser, pos, loc) { - this.type = ''; - this.start = pos; - this.end = 0; - if (parser.options.locations) { - this.loc = new SourceLocation3(parser, loc); - } - if (parser.options.directSourceFile) { - this.sourceFile = parser.options.directSourceFile; - } - if (parser.options.ranges) { - this.range = [pos, 0]; - } - }; - var pp$22 = Parser3.prototype; - pp$22.startNode = function () { - return new Node3(this, this.start, this.startLoc); - }; - pp$22.startNodeAt = function (pos, loc) { - return new Node3(this, pos, loc); - }; - function finishNodeAt2(node, type, pos, loc) { - node.type = type; - node.end = pos; - if (this.options.locations) { - node.loc.end = loc; - } - if (this.options.ranges) { - node.range[1] = pos; - } - return node; - } - pp$22.finishNode = function (node, type) { - return finishNodeAt2.call( - this, - node, - type, - this.lastTokEnd, - this.lastTokEndLoc, - ); - }; - pp$22.finishNodeAt = function (node, type, pos, loc) { - return finishNodeAt2.call(this, node, type, pos, loc); - }; - pp$22.copyNode = function (node) { - var newNode = new Node3(this, node.start, this.startLoc); - for (var prop in node) { - newNode[prop] = node[prop]; - } - return newNode; - }; - var ecma9BinaryProperties2 = - 'ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS'; - var ecma10BinaryProperties2 = - ecma9BinaryProperties2 + ' Extended_Pictographic'; - var ecma11BinaryProperties2 = ecma10BinaryProperties2; - var ecma12BinaryProperties2 = - ecma11BinaryProperties2 + ' EBase EComp EMod EPres ExtPict'; - var ecma13BinaryProperties2 = ecma12BinaryProperties2; - var unicodeBinaryProperties2 = { - 9: ecma9BinaryProperties2, - 10: ecma10BinaryProperties2, - 11: ecma11BinaryProperties2, - 12: ecma12BinaryProperties2, - 13: ecma13BinaryProperties2, - }; - var unicodeGeneralCategoryValues2 = - 'Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu'; - var ecma9ScriptValues2 = - 'Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb'; - var ecma10ScriptValues2 = - ecma9ScriptValues2 + - ' Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd'; - var ecma11ScriptValues2 = - ecma10ScriptValues2 + - ' Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho'; - var ecma12ScriptValues2 = - ecma11ScriptValues2 + - ' Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi'; - var ecma13ScriptValues2 = - ecma12ScriptValues2 + - ' Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith'; - var unicodeScriptValues2 = { - 9: ecma9ScriptValues2, - 10: ecma10ScriptValues2, - 11: ecma11ScriptValues2, - 12: ecma12ScriptValues2, - 13: ecma13ScriptValues2, - }; - var data2 = {}; - function buildUnicodeData2(ecmaVersion2) { - var d = (data2[ecmaVersion2] = { - binary: wordsRegexp2( - unicodeBinaryProperties2[ecmaVersion2] + - ' ' + - unicodeGeneralCategoryValues2, - ), - nonBinary: { - General_Category: wordsRegexp2(unicodeGeneralCategoryValues2), - Script: wordsRegexp2(unicodeScriptValues2[ecmaVersion2]), - }, - }); - d.nonBinary.Script_Extensions = d.nonBinary.Script; - d.nonBinary.gc = d.nonBinary.General_Category; - d.nonBinary.sc = d.nonBinary.Script; - d.nonBinary.scx = d.nonBinary.Script_Extensions; - } - for (var i = 0, list3 = [9, 10, 11, 12, 13]; i < list3.length; i += 1) { - var ecmaVersion = list3[i]; - buildUnicodeData2(ecmaVersion); - } - var pp$12 = Parser3.prototype; - var RegExpValidationState3 = function RegExpValidationState4(parser) { - this.parser = parser; - this.validFlags = - 'gim' + - (parser.options.ecmaVersion >= 6 ? 'uy' : '') + - (parser.options.ecmaVersion >= 9 ? 's' : '') + - (parser.options.ecmaVersion >= 13 ? 'd' : ''); - this.unicodeProperties = - data2[ - parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion - ]; - this.source = ''; - this.flags = ''; - this.start = 0; - this.switchU = false; - this.switchN = false; - this.pos = 0; - this.lastIntValue = 0; - this.lastStringValue = ''; - this.lastAssertionIsQuantifiable = false; - this.numCapturingParens = 0; - this.maxBackReference = 0; - this.groupNames = []; - this.backReferenceNames = []; - }; - RegExpValidationState3.prototype.reset = function reset2( - start3, - pattern, - flags, - ) { - var unicode = flags.indexOf('u') !== -1; - this.start = start3 | 0; - this.source = pattern + ''; - this.flags = flags; - this.switchU = unicode && this.parser.options.ecmaVersion >= 6; - this.switchN = unicode && this.parser.options.ecmaVersion >= 9; - }; - RegExpValidationState3.prototype.raise = function raise2(message) { - this.parser.raiseRecoverable( - this.start, - 'Invalid regular expression: /' + this.source + '/: ' + message, - ); - }; - RegExpValidationState3.prototype.at = function at2(i2, forceU) { - if (forceU === void 0) forceU = false; - var s = this.source; - var l = s.length; - if (i2 >= l) { - return -1; - } - var c = s.charCodeAt(i2); - if ( - !(forceU || this.switchU) || - c <= 55295 || - c >= 57344 || - i2 + 1 >= l - ) { - return c; - } - var next = s.charCodeAt(i2 + 1); - return next >= 56320 && next <= 57343 ? (c << 10) + next - 56613888 : c; - }; - RegExpValidationState3.prototype.nextIndex = function nextIndex2( - i2, - forceU, - ) { - if (forceU === void 0) forceU = false; - var s = this.source; - var l = s.length; - if (i2 >= l) { - return l; - } - var c = s.charCodeAt(i2), - next; - if ( - !(forceU || this.switchU) || - c <= 55295 || - c >= 57344 || - i2 + 1 >= l || - (next = s.charCodeAt(i2 + 1)) < 56320 || - next > 57343 - ) { - return i2 + 1; - } - return i2 + 2; - }; - RegExpValidationState3.prototype.current = function current2(forceU) { - if (forceU === void 0) forceU = false; - return this.at(this.pos, forceU); - }; - RegExpValidationState3.prototype.lookahead = function lookahead2(forceU) { - if (forceU === void 0) forceU = false; - return this.at(this.nextIndex(this.pos, forceU), forceU); - }; - RegExpValidationState3.prototype.advance = function advance2(forceU) { - if (forceU === void 0) forceU = false; - this.pos = this.nextIndex(this.pos, forceU); - }; - RegExpValidationState3.prototype.eat = function eat2(ch, forceU) { - if (forceU === void 0) forceU = false; - if (this.current(forceU) === ch) { - this.advance(forceU); - return true; - } - return false; - }; - pp$12.validateRegExpFlags = function (state) { - var validFlags = state.validFlags; - var flags = state.flags; - for (var i2 = 0; i2 < flags.length; i2++) { - var flag = flags.charAt(i2); - if (validFlags.indexOf(flag) === -1) { - this.raise(state.start, 'Invalid regular expression flag'); - } - if (flags.indexOf(flag, i2 + 1) > -1) { - this.raise(state.start, 'Duplicate regular expression flag'); - } - } - }; - pp$12.validateRegExpPattern = function (state) { - this.regexp_pattern(state); - if ( - !state.switchN && - this.options.ecmaVersion >= 9 && - state.groupNames.length > 0 - ) { - state.switchN = true; - this.regexp_pattern(state); - } - }; - pp$12.regexp_pattern = function (state) { - state.pos = 0; - state.lastIntValue = 0; - state.lastStringValue = ''; - state.lastAssertionIsQuantifiable = false; - state.numCapturingParens = 0; - state.maxBackReference = 0; - state.groupNames.length = 0; - state.backReferenceNames.length = 0; - this.regexp_disjunction(state); - if (state.pos !== state.source.length) { - if (state.eat(41)) { - state.raise("Unmatched ')'"); - } - if (state.eat(93) || state.eat(125)) { - state.raise('Lone quantifier brackets'); - } - } - if (state.maxBackReference > state.numCapturingParens) { - state.raise('Invalid escape'); - } - for ( - var i2 = 0, list4 = state.backReferenceNames; - i2 < list4.length; - i2 += 1 - ) { - var name2 = list4[i2]; - if (state.groupNames.indexOf(name2) === -1) { - state.raise('Invalid named capture referenced'); - } - } - }; - pp$12.regexp_disjunction = function (state) { - this.regexp_alternative(state); - while (state.eat(124)) { - this.regexp_alternative(state); - } - if (this.regexp_eatQuantifier(state, true)) { - state.raise('Nothing to repeat'); - } - if (state.eat(123)) { - state.raise('Lone quantifier brackets'); - } - }; - pp$12.regexp_alternative = function (state) { - while (state.pos < state.source.length && this.regexp_eatTerm(state)) {} - }; - pp$12.regexp_eatTerm = function (state) { - if (this.regexp_eatAssertion(state)) { - if ( - state.lastAssertionIsQuantifiable && - this.regexp_eatQuantifier(state) - ) { - if (state.switchU) { - state.raise('Invalid quantifier'); - } - } - return true; - } - if ( - state.switchU - ? this.regexp_eatAtom(state) - : this.regexp_eatExtendedAtom(state) - ) { - this.regexp_eatQuantifier(state); - return true; - } - return false; - }; - pp$12.regexp_eatAssertion = function (state) { - var start3 = state.pos; - state.lastAssertionIsQuantifiable = false; - if (state.eat(94) || state.eat(36)) { - return true; - } - if (state.eat(92)) { - if (state.eat(66) || state.eat(98)) { - return true; - } - state.pos = start3; - } - if (state.eat(40) && state.eat(63)) { - var lookbehind = false; - if (this.options.ecmaVersion >= 9) { - lookbehind = state.eat(60); - } - if (state.eat(61) || state.eat(33)) { - this.regexp_disjunction(state); - if (!state.eat(41)) { - state.raise('Unterminated group'); - } - state.lastAssertionIsQuantifiable = !lookbehind; - return true; - } - } - state.pos = start3; - return false; - }; - pp$12.regexp_eatQuantifier = function (state, noError) { - if (noError === void 0) noError = false; - if (this.regexp_eatQuantifierPrefix(state, noError)) { - state.eat(63); - return true; - } - return false; - }; - pp$12.regexp_eatQuantifierPrefix = function (state, noError) { - return ( - state.eat(42) || - state.eat(43) || - state.eat(63) || - this.regexp_eatBracedQuantifier(state, noError) - ); - }; - pp$12.regexp_eatBracedQuantifier = function (state, noError) { - var start3 = state.pos; - if (state.eat(123)) { - var min = 0, - max = -1; - if (this.regexp_eatDecimalDigits(state)) { - min = state.lastIntValue; - if (state.eat(44) && this.regexp_eatDecimalDigits(state)) { - max = state.lastIntValue; - } - if (state.eat(125)) { - if (max !== -1 && max < min && !noError) { - state.raise('numbers out of order in {} quantifier'); - } - return true; - } - } - if (state.switchU && !noError) { - state.raise('Incomplete quantifier'); - } - state.pos = start3; - } - return false; - }; - pp$12.regexp_eatAtom = function (state) { - return ( - this.regexp_eatPatternCharacters(state) || - state.eat(46) || - this.regexp_eatReverseSolidusAtomEscape(state) || - this.regexp_eatCharacterClass(state) || - this.regexp_eatUncapturingGroup(state) || - this.regexp_eatCapturingGroup(state) - ); - }; - pp$12.regexp_eatReverseSolidusAtomEscape = function (state) { - var start3 = state.pos; - if (state.eat(92)) { - if (this.regexp_eatAtomEscape(state)) { - return true; - } - state.pos = start3; - } - return false; - }; - pp$12.regexp_eatUncapturingGroup = function (state) { - var start3 = state.pos; - if (state.eat(40)) { - if (state.eat(63) && state.eat(58)) { - this.regexp_disjunction(state); - if (state.eat(41)) { - return true; - } - state.raise('Unterminated group'); - } - state.pos = start3; - } - return false; - }; - pp$12.regexp_eatCapturingGroup = function (state) { - if (state.eat(40)) { - if (this.options.ecmaVersion >= 9) { - this.regexp_groupSpecifier(state); - } else if (state.current() === 63) { - state.raise('Invalid group'); - } - this.regexp_disjunction(state); - if (state.eat(41)) { - state.numCapturingParens += 1; - return true; - } - state.raise('Unterminated group'); - } - return false; - }; - pp$12.regexp_eatExtendedAtom = function (state) { - return ( - state.eat(46) || - this.regexp_eatReverseSolidusAtomEscape(state) || - this.regexp_eatCharacterClass(state) || - this.regexp_eatUncapturingGroup(state) || - this.regexp_eatCapturingGroup(state) || - this.regexp_eatInvalidBracedQuantifier(state) || - this.regexp_eatExtendedPatternCharacter(state) - ); - }; - pp$12.regexp_eatInvalidBracedQuantifier = function (state) { - if (this.regexp_eatBracedQuantifier(state, true)) { - state.raise('Nothing to repeat'); - } - return false; - }; - pp$12.regexp_eatSyntaxCharacter = function (state) { - var ch = state.current(); - if (isSyntaxCharacter2(ch)) { - state.lastIntValue = ch; - state.advance(); - return true; - } - return false; - }; - function isSyntaxCharacter2(ch) { - return ( - ch === 36 || - (ch >= 40 && ch <= 43) || - ch === 46 || - ch === 63 || - (ch >= 91 && ch <= 94) || - (ch >= 123 && ch <= 125) - ); - } - pp$12.regexp_eatPatternCharacters = function (state) { - var start3 = state.pos; - var ch = 0; - while ((ch = state.current()) !== -1 && !isSyntaxCharacter2(ch)) { - state.advance(); - } - return state.pos !== start3; - }; - pp$12.regexp_eatExtendedPatternCharacter = function (state) { - var ch = state.current(); - if ( - ch !== -1 && - ch !== 36 && - !(ch >= 40 && ch <= 43) && - ch !== 46 && - ch !== 63 && - ch !== 91 && - ch !== 94 && - ch !== 124 - ) { - state.advance(); - return true; - } - return false; - }; - pp$12.regexp_groupSpecifier = function (state) { - if (state.eat(63)) { - if (this.regexp_eatGroupName(state)) { - if (state.groupNames.indexOf(state.lastStringValue) !== -1) { - state.raise('Duplicate capture group name'); - } - state.groupNames.push(state.lastStringValue); - return; - } - state.raise('Invalid group'); - } - }; - pp$12.regexp_eatGroupName = function (state) { - state.lastStringValue = ''; - if (state.eat(60)) { - if (this.regexp_eatRegExpIdentifierName(state) && state.eat(62)) { - return true; - } - state.raise('Invalid capture group name'); - } - return false; - }; - pp$12.regexp_eatRegExpIdentifierName = function (state) { - state.lastStringValue = ''; - if (this.regexp_eatRegExpIdentifierStart(state)) { - state.lastStringValue += codePointToString2(state.lastIntValue); - while (this.regexp_eatRegExpIdentifierPart(state)) { - state.lastStringValue += codePointToString2(state.lastIntValue); - } - return true; - } - return false; - }; - pp$12.regexp_eatRegExpIdentifierStart = function (state) { - var start3 = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); - if ( - ch === 92 && - this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU) - ) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierStart2(ch)) { - state.lastIntValue = ch; - return true; - } - state.pos = start3; - return false; - }; - function isRegExpIdentifierStart2(ch) { - return isIdentifierStart2(ch, true) || ch === 36 || ch === 95; - } - pp$12.regexp_eatRegExpIdentifierPart = function (state) { - var start3 = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); - if ( - ch === 92 && - this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU) - ) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierPart2(ch)) { - state.lastIntValue = ch; - return true; - } - state.pos = start3; - return false; - }; - function isRegExpIdentifierPart2(ch) { - return ( - isIdentifierChar2(ch, true) || - ch === 36 || - ch === 95 || - ch === 8204 || - ch === 8205 - ); - } - pp$12.regexp_eatAtomEscape = function (state) { - if ( - this.regexp_eatBackReference(state) || - this.regexp_eatCharacterClassEscape(state) || - this.regexp_eatCharacterEscape(state) || - (state.switchN && this.regexp_eatKGroupName(state)) - ) { - return true; - } - if (state.switchU) { - if (state.current() === 99) { - state.raise('Invalid unicode escape'); - } - state.raise('Invalid escape'); - } - return false; - }; - pp$12.regexp_eatBackReference = function (state) { - var start3 = state.pos; - if (this.regexp_eatDecimalEscape(state)) { - var n = state.lastIntValue; - if (state.switchU) { - if (n > state.maxBackReference) { - state.maxBackReference = n; - } - return true; - } - if (n <= state.numCapturingParens) { - return true; - } - state.pos = start3; - } - return false; - }; - pp$12.regexp_eatKGroupName = function (state) { - if (state.eat(107)) { - if (this.regexp_eatGroupName(state)) { - state.backReferenceNames.push(state.lastStringValue); - return true; - } - state.raise('Invalid named reference'); - } - return false; - }; - pp$12.regexp_eatCharacterEscape = function (state) { - return ( - this.regexp_eatControlEscape(state) || - this.regexp_eatCControlLetter(state) || - this.regexp_eatZero(state) || - this.regexp_eatHexEscapeSequence(state) || - this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || - (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || - this.regexp_eatIdentityEscape(state) - ); - }; - pp$12.regexp_eatCControlLetter = function (state) { - var start3 = state.pos; - if (state.eat(99)) { - if (this.regexp_eatControlLetter(state)) { - return true; - } - state.pos = start3; - } - return false; - }; - pp$12.regexp_eatZero = function (state) { - if (state.current() === 48 && !isDecimalDigit2(state.lookahead())) { - state.lastIntValue = 0; - state.advance(); - return true; - } - return false; - }; - pp$12.regexp_eatControlEscape = function (state) { - var ch = state.current(); - if (ch === 116) { - state.lastIntValue = 9; - state.advance(); - return true; - } - if (ch === 110) { - state.lastIntValue = 10; - state.advance(); - return true; - } - if (ch === 118) { - state.lastIntValue = 11; - state.advance(); - return true; - } - if (ch === 102) { - state.lastIntValue = 12; - state.advance(); - return true; - } - if (ch === 114) { - state.lastIntValue = 13; - state.advance(); - return true; - } - return false; - }; - pp$12.regexp_eatControlLetter = function (state) { - var ch = state.current(); - if (isControlLetter2(ch)) { - state.lastIntValue = ch % 32; - state.advance(); - return true; - } - return false; - }; - function isControlLetter2(ch) { - return (ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122); - } - pp$12.regexp_eatRegExpUnicodeEscapeSequence = function (state, forceU) { - if (forceU === void 0) forceU = false; - var start3 = state.pos; - var switchU = forceU || state.switchU; - if (state.eat(117)) { - if (this.regexp_eatFixedHexDigits(state, 4)) { - var lead = state.lastIntValue; - if (switchU && lead >= 55296 && lead <= 56319) { - var leadSurrogateEnd = state.pos; - if ( - state.eat(92) && - state.eat(117) && - this.regexp_eatFixedHexDigits(state, 4) - ) { - var trail = state.lastIntValue; - if (trail >= 56320 && trail <= 57343) { - state.lastIntValue = - (lead - 55296) * 1024 + (trail - 56320) + 65536; - return true; - } - } - state.pos = leadSurrogateEnd; - state.lastIntValue = lead; - } - return true; - } - if ( - switchU && - state.eat(123) && - this.regexp_eatHexDigits(state) && - state.eat(125) && - isValidUnicode2(state.lastIntValue) - ) { - return true; - } - if (switchU) { - state.raise('Invalid unicode escape'); - } - state.pos = start3; - } - return false; - }; - function isValidUnicode2(ch) { - return ch >= 0 && ch <= 1114111; - } - pp$12.regexp_eatIdentityEscape = function (state) { - if (state.switchU) { - if (this.regexp_eatSyntaxCharacter(state)) { - return true; - } - if (state.eat(47)) { - state.lastIntValue = 47; - return true; - } - return false; - } - var ch = state.current(); - if (ch !== 99 && (!state.switchN || ch !== 107)) { - state.lastIntValue = ch; - state.advance(); - return true; - } - return false; - }; - pp$12.regexp_eatDecimalEscape = function (state) { - state.lastIntValue = 0; - var ch = state.current(); - if (ch >= 49 && ch <= 57) { - do { - state.lastIntValue = 10 * state.lastIntValue + (ch - 48); - state.advance(); - } while ((ch = state.current()) >= 48 && ch <= 57); - return true; - } - return false; - }; - pp$12.regexp_eatCharacterClassEscape = function (state) { - var ch = state.current(); - if (isCharacterClassEscape2(ch)) { - state.lastIntValue = -1; - state.advance(); - return true; - } - if ( - state.switchU && - this.options.ecmaVersion >= 9 && - (ch === 80 || ch === 112) - ) { - state.lastIntValue = -1; - state.advance(); - if ( - state.eat(123) && - this.regexp_eatUnicodePropertyValueExpression(state) && - state.eat(125) - ) { - return true; - } - state.raise('Invalid property name'); - } - return false; - }; - function isCharacterClassEscape2(ch) { - return ( - ch === 100 || - ch === 68 || - ch === 115 || - ch === 83 || - ch === 119 || - ch === 87 - ); - } - pp$12.regexp_eatUnicodePropertyValueExpression = function (state) { - var start3 = state.pos; - if (this.regexp_eatUnicodePropertyName(state) && state.eat(61)) { - var name2 = state.lastStringValue; - if (this.regexp_eatUnicodePropertyValue(state)) { - var value = state.lastStringValue; - this.regexp_validateUnicodePropertyNameAndValue( - state, - name2, - value, - ); - return true; - } - } - state.pos = start3; - if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { - var nameOrValue = state.lastStringValue; - this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); - return true; - } - return false; - }; - pp$12.regexp_validateUnicodePropertyNameAndValue = function ( - state, - name2, - value, - ) { - if (!hasOwn2(state.unicodeProperties.nonBinary, name2)) { - state.raise('Invalid property name'); - } - if (!state.unicodeProperties.nonBinary[name2].test(value)) { - state.raise('Invalid property value'); - } - }; - pp$12.regexp_validateUnicodePropertyNameOrValue = function ( - state, - nameOrValue, - ) { - if (!state.unicodeProperties.binary.test(nameOrValue)) { - state.raise('Invalid property name'); - } - }; - pp$12.regexp_eatUnicodePropertyName = function (state) { - var ch = 0; - state.lastStringValue = ''; - while (isUnicodePropertyNameCharacter2((ch = state.current()))) { - state.lastStringValue += codePointToString2(ch); - state.advance(); - } - return state.lastStringValue !== ''; - }; - function isUnicodePropertyNameCharacter2(ch) { - return isControlLetter2(ch) || ch === 95; - } - pp$12.regexp_eatUnicodePropertyValue = function (state) { - var ch = 0; - state.lastStringValue = ''; - while (isUnicodePropertyValueCharacter2((ch = state.current()))) { - state.lastStringValue += codePointToString2(ch); - state.advance(); - } - return state.lastStringValue !== ''; - }; - function isUnicodePropertyValueCharacter2(ch) { - return isUnicodePropertyNameCharacter2(ch) || isDecimalDigit2(ch); - } - pp$12.regexp_eatLoneUnicodePropertyNameOrValue = function (state) { - return this.regexp_eatUnicodePropertyValue(state); - }; - pp$12.regexp_eatCharacterClass = function (state) { - if (state.eat(91)) { - state.eat(94); - this.regexp_classRanges(state); - if (state.eat(93)) { - return true; - } - state.raise('Unterminated character class'); - } - return false; - }; - pp$12.regexp_classRanges = function (state) { - while (this.regexp_eatClassAtom(state)) { - var left = state.lastIntValue; - if (state.eat(45) && this.regexp_eatClassAtom(state)) { - var right = state.lastIntValue; - if (state.switchU && (left === -1 || right === -1)) { - state.raise('Invalid character class'); - } - if (left !== -1 && right !== -1 && left > right) { - state.raise('Range out of order in character class'); - } - } - } - }; - pp$12.regexp_eatClassAtom = function (state) { - var start3 = state.pos; - if (state.eat(92)) { - if (this.regexp_eatClassEscape(state)) { - return true; - } - if (state.switchU) { - var ch$1 = state.current(); - if (ch$1 === 99 || isOctalDigit2(ch$1)) { - state.raise('Invalid class escape'); - } - state.raise('Invalid escape'); - } - state.pos = start3; - } - var ch = state.current(); - if (ch !== 93) { - state.lastIntValue = ch; - state.advance(); - return true; - } - return false; - }; - pp$12.regexp_eatClassEscape = function (state) { - var start3 = state.pos; - if (state.eat(98)) { - state.lastIntValue = 8; - return true; - } - if (state.switchU && state.eat(45)) { - state.lastIntValue = 45; - return true; - } - if (!state.switchU && state.eat(99)) { - if (this.regexp_eatClassControlLetter(state)) { - return true; - } - state.pos = start3; - } - return ( - this.regexp_eatCharacterClassEscape(state) || - this.regexp_eatCharacterEscape(state) - ); - }; - pp$12.regexp_eatClassControlLetter = function (state) { - var ch = state.current(); - if (isDecimalDigit2(ch) || ch === 95) { - state.lastIntValue = ch % 32; - state.advance(); - return true; - } - return false; - }; - pp$12.regexp_eatHexEscapeSequence = function (state) { - var start3 = state.pos; - if (state.eat(120)) { - if (this.regexp_eatFixedHexDigits(state, 2)) { - return true; - } - if (state.switchU) { - state.raise('Invalid escape'); - } - state.pos = start3; - } - return false; - }; - pp$12.regexp_eatDecimalDigits = function (state) { - var start3 = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isDecimalDigit2((ch = state.current()))) { - state.lastIntValue = 10 * state.lastIntValue + (ch - 48); - state.advance(); - } - return state.pos !== start3; - }; - function isDecimalDigit2(ch) { - return ch >= 48 && ch <= 57; - } - pp$12.regexp_eatHexDigits = function (state) { - var start3 = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isHexDigit2((ch = state.current()))) { - state.lastIntValue = 16 * state.lastIntValue + hexToInt2(ch); - state.advance(); - } - return state.pos !== start3; - }; - function isHexDigit2(ch) { - return ( - (ch >= 48 && ch <= 57) || - (ch >= 65 && ch <= 70) || - (ch >= 97 && ch <= 102) - ); - } - function hexToInt2(ch) { - if (ch >= 65 && ch <= 70) { - return 10 + (ch - 65); - } - if (ch >= 97 && ch <= 102) { - return 10 + (ch - 97); - } - return ch - 48; - } - pp$12.regexp_eatLegacyOctalEscapeSequence = function (state) { - if (this.regexp_eatOctalDigit(state)) { - var n1 = state.lastIntValue; - if (this.regexp_eatOctalDigit(state)) { - var n2 = state.lastIntValue; - if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { - state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; - } else { - state.lastIntValue = n1 * 8 + n2; - } - } else { - state.lastIntValue = n1; - } - return true; - } - return false; - }; - pp$12.regexp_eatOctalDigit = function (state) { - var ch = state.current(); - if (isOctalDigit2(ch)) { - state.lastIntValue = ch - 48; - state.advance(); - return true; - } - state.lastIntValue = 0; - return false; - }; - function isOctalDigit2(ch) { - return ch >= 48 && ch <= 55; - } - pp$12.regexp_eatFixedHexDigits = function (state, length) { - var start3 = state.pos; - state.lastIntValue = 0; - for (var i2 = 0; i2 < length; ++i2) { - var ch = state.current(); - if (!isHexDigit2(ch)) { - state.pos = start3; - return false; - } - state.lastIntValue = 16 * state.lastIntValue + hexToInt2(ch); - state.advance(); - } - return true; - }; - var Token3 = function Token4(p) { - this.type = p.type; - this.value = p.value; - this.start = p.start; - this.end = p.end; - if (p.options.locations) { - this.loc = new SourceLocation3(p, p.startLoc, p.endLoc); - } - if (p.options.ranges) { - this.range = [p.start, p.end]; - } - }; - var pp2 = Parser3.prototype; - pp2.next = function (ignoreEscapeSequenceInKeyword) { - if ( - !ignoreEscapeSequenceInKeyword && - this.type.keyword && - this.containsEsc - ) { - this.raiseRecoverable( - this.start, - 'Escape sequence in keyword ' + this.type.keyword, - ); - } - if (this.options.onToken) { - this.options.onToken(new Token3(this)); - } - this.lastTokEnd = this.end; - this.lastTokStart = this.start; - this.lastTokEndLoc = this.endLoc; - this.lastTokStartLoc = this.startLoc; - this.nextToken(); - }; - pp2.getToken = function () { - this.next(); - return new Token3(this); - }; - if (typeof Symbol !== 'undefined') { - pp2[Symbol.iterator] = function () { - var this$1$1 = this; - return { - next: function () { - var token = this$1$1.getToken(); - return { - done: token.type === types$12.eof, - value: token, - }; - }, - }; - }; - } - pp2.nextToken = function () { - var curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) { - this.skipSpace(); - } - this.start = this.pos; - if (this.options.locations) { - this.startLoc = this.curPosition(); - } - if (this.pos >= this.input.length) { - return this.finishToken(types$12.eof); - } - if (curContext.override) { - return curContext.override(this); - } else { - this.readToken(this.fullCharCodeAtPos()); - } - }; - pp2.readToken = function (code2) { - if ( - isIdentifierStart2(code2, this.options.ecmaVersion >= 6) || - code2 === 92 - ) { - return this.readWord(); - } - return this.getTokenFromCode(code2); - }; - pp2.fullCharCodeAtPos = function () { - var code2 = this.input.charCodeAt(this.pos); - if (code2 <= 55295 || code2 >= 56320) { - return code2; - } - var next = this.input.charCodeAt(this.pos + 1); - return next <= 56319 || next >= 57344 - ? code2 - : (code2 << 10) + next - 56613888; - }; - pp2.skipBlockComment = function () { - var startLoc = this.options.onComment && this.curPosition(); - var start3 = this.pos, - end = this.input.indexOf('*/', (this.pos += 2)); - if (end === -1) { - this.raise(this.pos - 2, 'Unterminated comment'); - } - this.pos = end + 2; - if (this.options.locations) { - for ( - var nextBreak = void 0, pos = start3; - (nextBreak = nextLineBreak2(this.input, pos, this.pos)) > -1; - - ) { - ++this.curLine; - pos = this.lineStart = nextBreak; - } - } - if (this.options.onComment) { - this.options.onComment( - true, - this.input.slice(start3 + 2, end), - start3, - this.pos, - startLoc, - this.curPosition(), - ); - } - }; - pp2.skipLineComment = function (startSkip) { - var start3 = this.pos; - var startLoc = this.options.onComment && this.curPosition(); - var ch = this.input.charCodeAt((this.pos += startSkip)); - while (this.pos < this.input.length && !isNewLine2(ch)) { - ch = this.input.charCodeAt(++this.pos); - } - if (this.options.onComment) { - this.options.onComment( - false, - this.input.slice(start3 + startSkip, this.pos), - start3, - this.pos, - startLoc, - this.curPosition(), - ); - } - }; - pp2.skipSpace = function () { - loop: while (this.pos < this.input.length) { - var ch = this.input.charCodeAt(this.pos); - switch (ch) { - case 32: - case 160: - ++this.pos; - break; - case 13: - if (this.input.charCodeAt(this.pos + 1) === 10) { - ++this.pos; - } - case 10: - case 8232: - case 8233: - ++this.pos; - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - break; - case 47: - switch (this.input.charCodeAt(this.pos + 1)) { - case 42: - this.skipBlockComment(); - break; - case 47: - this.skipLineComment(2); - break; - default: - break loop; - } - break; - default: - if ( - (ch > 8 && ch < 14) || - (ch >= 5760 && - nonASCIIwhitespace2.test(String.fromCharCode(ch))) - ) { - ++this.pos; - } else { - break loop; - } - } - } - }; - pp2.finishToken = function (type, val) { - this.end = this.pos; - if (this.options.locations) { - this.endLoc = this.curPosition(); - } - var prevType = this.type; - this.type = type; - this.value = val; - this.updateContext(prevType); - }; - pp2.readToken_dot = function () { - var next = this.input.charCodeAt(this.pos + 1); - if (next >= 48 && next <= 57) { - return this.readNumber(true); - } - var next2 = this.input.charCodeAt(this.pos + 2); - if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { - this.pos += 3; - return this.finishToken(types$12.ellipsis); - } else { - ++this.pos; - return this.finishToken(types$12.dot); - } - }; - pp2.readToken_slash = function () { - var next = this.input.charCodeAt(this.pos + 1); - if (this.exprAllowed) { - ++this.pos; - return this.readRegexp(); - } - if (next === 61) { - return this.finishOp(types$12.assign, 2); - } - return this.finishOp(types$12.slash, 1); - }; - pp2.readToken_mult_modulo_exp = function (code2) { - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - var tokentype = code2 === 42 ? types$12.star : types$12.modulo; - if (this.options.ecmaVersion >= 7 && code2 === 42 && next === 42) { - ++size; - tokentype = types$12.starstar; - next = this.input.charCodeAt(this.pos + 2); - } - if (next === 61) { - return this.finishOp(types$12.assign, size + 1); - } - return this.finishOp(tokentype, size); - }; - pp2.readToken_pipe_amp = function (code2) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === code2) { - if (this.options.ecmaVersion >= 12) { - var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 === 61) { - return this.finishOp(types$12.assign, 3); - } - } - return this.finishOp( - code2 === 124 ? types$12.logicalOR : types$12.logicalAND, - 2, - ); - } - if (next === 61) { - return this.finishOp(types$12.assign, 2); - } - return this.finishOp( - code2 === 124 ? types$12.bitwiseOR : types$12.bitwiseAND, - 1, - ); - }; - pp2.readToken_caret = function () { - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { - return this.finishOp(types$12.assign, 2); - } - return this.finishOp(types$12.bitwiseXOR, 1); - }; - pp2.readToken_plus_min = function (code2) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === code2) { - if ( - next === 45 && - !this.inModule && - this.input.charCodeAt(this.pos + 2) === 62 && - (this.lastTokEnd === 0 || - lineBreak2.test(this.input.slice(this.lastTokEnd, this.pos))) - ) { - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken(); - } - return this.finishOp(types$12.incDec, 2); - } - if (next === 61) { - return this.finishOp(types$12.assign, 2); - } - return this.finishOp(types$12.plusMin, 1); - }; - pp2.readToken_lt_gt = function (code2) { - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code2) { - size = - code2 === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { - return this.finishOp(types$12.assign, size + 1); - } - return this.finishOp(types$12.bitShift, size); - } - if ( - next === 33 && - code2 === 60 && - !this.inModule && - this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45 - ) { - this.skipLineComment(4); - this.skipSpace(); - return this.nextToken(); - } - if (next === 61) { - size = 2; - } - return this.finishOp(types$12.relational, size); - }; - pp2.readToken_eq_excl = function (code2) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { - return this.finishOp( - types$12.equality, - this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2, - ); - } - if (code2 === 61 && next === 62 && this.options.ecmaVersion >= 6) { - this.pos += 2; - return this.finishToken(types$12.arrow); - } - return this.finishOp(code2 === 61 ? types$12.eq : types$12.prefix, 1); - }; - pp2.readToken_question = function () { - var ecmaVersion2 = this.options.ecmaVersion; - if (ecmaVersion2 >= 11) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === 46) { - var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 < 48 || next2 > 57) { - return this.finishOp(types$12.questionDot, 2); - } - } - if (next === 63) { - if (ecmaVersion2 >= 12) { - var next2$1 = this.input.charCodeAt(this.pos + 2); - if (next2$1 === 61) { - return this.finishOp(types$12.assign, 3); - } - } - return this.finishOp(types$12.coalesce, 2); - } - } - return this.finishOp(types$12.question, 1); - }; - pp2.readToken_numberSign = function () { - var ecmaVersion2 = this.options.ecmaVersion; - var code2 = 35; - if (ecmaVersion2 >= 13) { - ++this.pos; - code2 = this.fullCharCodeAtPos(); - if (isIdentifierStart2(code2, true) || code2 === 92) { - return this.finishToken(types$12.privateId, this.readWord1()); - } - } - this.raise( - this.pos, - "Unexpected character '" + codePointToString2(code2) + "'", - ); - }; - pp2.getTokenFromCode = function (code2) { - switch (code2) { - case 46: - return this.readToken_dot(); - case 40: - ++this.pos; - return this.finishToken(types$12.parenL); - case 41: - ++this.pos; - return this.finishToken(types$12.parenR); - case 59: - ++this.pos; - return this.finishToken(types$12.semi); - case 44: - ++this.pos; - return this.finishToken(types$12.comma); - case 91: - ++this.pos; - return this.finishToken(types$12.bracketL); - case 93: - ++this.pos; - return this.finishToken(types$12.bracketR); - case 123: - ++this.pos; - return this.finishToken(types$12.braceL); - case 125: - ++this.pos; - return this.finishToken(types$12.braceR); - case 58: - ++this.pos; - return this.finishToken(types$12.colon); - case 96: - if (this.options.ecmaVersion < 6) { - break; - } - ++this.pos; - return this.finishToken(types$12.backQuote); - case 48: - var next = this.input.charCodeAt(this.pos + 1); - if (next === 120 || next === 88) { - return this.readRadixNumber(16); - } - if (this.options.ecmaVersion >= 6) { - if (next === 111 || next === 79) { - return this.readRadixNumber(8); - } - if (next === 98 || next === 66) { - return this.readRadixNumber(2); - } - } - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - return this.readNumber(false); - case 34: - case 39: - return this.readString(code2); - case 47: - return this.readToken_slash(); - case 37: - case 42: - return this.readToken_mult_modulo_exp(code2); - case 124: - case 38: - return this.readToken_pipe_amp(code2); - case 94: - return this.readToken_caret(); - case 43: - case 45: - return this.readToken_plus_min(code2); - case 60: - case 62: - return this.readToken_lt_gt(code2); - case 61: - case 33: - return this.readToken_eq_excl(code2); - case 63: - return this.readToken_question(); - case 126: - return this.finishOp(types$12.prefix, 1); - case 35: - return this.readToken_numberSign(); - } - this.raise( - this.pos, - "Unexpected character '" + codePointToString2(code2) + "'", - ); - }; - pp2.finishOp = function (type, size) { - var str = this.input.slice(this.pos, this.pos + size); - this.pos += size; - return this.finishToken(type, str); - }; - pp2.readRegexp = function () { - var escaped, - inClass, - start3 = this.pos; - for (;;) { - if (this.pos >= this.input.length) { - this.raise(start3, 'Unterminated regular expression'); - } - var ch = this.input.charAt(this.pos); - if (lineBreak2.test(ch)) { - this.raise(start3, 'Unterminated regular expression'); - } - if (!escaped) { - if (ch === '[') { - inClass = true; - } else if (ch === ']' && inClass) { - inClass = false; - } else if (ch === '/' && !inClass) { - break; - } - escaped = ch === '\\'; - } else { - escaped = false; - } - ++this.pos; - } - var pattern = this.input.slice(start3, this.pos); - ++this.pos; - var flagsStart = this.pos; - var flags = this.readWord1(); - if (this.containsEsc) { - this.unexpected(flagsStart); - } - var state = - this.regexpState || - (this.regexpState = new RegExpValidationState3(this)); - state.reset(start3, pattern, flags); - this.validateRegExpFlags(state); - this.validateRegExpPattern(state); - var value = null; - try { - value = new RegExp(pattern, flags); - } catch (e) {} - return this.finishToken(types$12.regexp, {pattern, flags, value}); - }; - pp2.readInt = function (radix, len, maybeLegacyOctalNumericLiteral) { - var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; - var isLegacyOctalNumericLiteral = - maybeLegacyOctalNumericLiteral && - this.input.charCodeAt(this.pos) === 48; - var start3 = this.pos, - total = 0, - lastCode = 0; - for ( - var i2 = 0, e = len == null ? Infinity : len; - i2 < e; - ++i2, ++this.pos - ) { - var code2 = this.input.charCodeAt(this.pos), - val = void 0; - if (allowSeparators && code2 === 95) { - if (isLegacyOctalNumericLiteral) { - this.raiseRecoverable( - this.pos, - 'Numeric separator is not allowed in legacy octal numeric literals', - ); - } - if (lastCode === 95) { - this.raiseRecoverable( - this.pos, - 'Numeric separator must be exactly one underscore', - ); - } - if (i2 === 0) { - this.raiseRecoverable( - this.pos, - 'Numeric separator is not allowed at the first of digits', - ); - } - lastCode = code2; - continue; - } - if (code2 >= 97) { - val = code2 - 97 + 10; - } else if (code2 >= 65) { - val = code2 - 65 + 10; - } else if (code2 >= 48 && code2 <= 57) { - val = code2 - 48; - } else { - val = Infinity; - } - if (val >= radix) { - break; - } - lastCode = code2; - total = total * radix + val; - } - if (allowSeparators && lastCode === 95) { - this.raiseRecoverable( - this.pos - 1, - 'Numeric separator is not allowed at the last of digits', - ); - } - if (this.pos === start3 || (len != null && this.pos - start3 !== len)) { - return null; - } - return total; - }; - function stringToNumber2(str, isLegacyOctalNumericLiteral) { - if (isLegacyOctalNumericLiteral) { - return parseInt(str, 8); - } - return parseFloat(str.replace(/_/g, '')); - } - function stringToBigInt2(str) { - if (typeof BigInt !== 'function') { - return null; - } - return BigInt(str.replace(/_/g, '')); - } - pp2.readRadixNumber = function (radix) { - var start3 = this.pos; - this.pos += 2; - var val = this.readInt(radix); - if (val == null) { - this.raise(this.start + 2, 'Expected number in radix ' + radix); - } - if ( - this.options.ecmaVersion >= 11 && - this.input.charCodeAt(this.pos) === 110 - ) { - val = stringToBigInt2(this.input.slice(start3, this.pos)); - ++this.pos; - } else if (isIdentifierStart2(this.fullCharCodeAtPos())) { - this.raise(this.pos, 'Identifier directly after number'); - } - return this.finishToken(types$12.num, val); - }; - pp2.readNumber = function (startsWithDot) { - var start3 = this.pos; - if (!startsWithDot && this.readInt(10, void 0, true) === null) { - this.raise(start3, 'Invalid number'); - } - var octal = - this.pos - start3 >= 2 && this.input.charCodeAt(start3) === 48; - if (octal && this.strict) { - this.raise(start3, 'Invalid number'); - } - var next = this.input.charCodeAt(this.pos); - if ( - !octal && - !startsWithDot && - this.options.ecmaVersion >= 11 && - next === 110 - ) { - var val$1 = stringToBigInt2(this.input.slice(start3, this.pos)); - ++this.pos; - if (isIdentifierStart2(this.fullCharCodeAtPos())) { - this.raise(this.pos, 'Identifier directly after number'); - } - return this.finishToken(types$12.num, val$1); - } - if (octal && /[89]/.test(this.input.slice(start3, this.pos))) { - octal = false; - } - if (next === 46 && !octal) { - ++this.pos; - this.readInt(10); - next = this.input.charCodeAt(this.pos); - } - if ((next === 69 || next === 101) && !octal) { - next = this.input.charCodeAt(++this.pos); - if (next === 43 || next === 45) { - ++this.pos; - } - if (this.readInt(10) === null) { - this.raise(start3, 'Invalid number'); - } - } - if (isIdentifierStart2(this.fullCharCodeAtPos())) { - this.raise(this.pos, 'Identifier directly after number'); - } - var val = stringToNumber2(this.input.slice(start3, this.pos), octal); - return this.finishToken(types$12.num, val); - }; - pp2.readCodePoint = function () { - var ch = this.input.charCodeAt(this.pos), - code2; - if (ch === 123) { - if (this.options.ecmaVersion < 6) { - this.unexpected(); - } - var codePos = ++this.pos; - code2 = this.readHexChar( - this.input.indexOf('}', this.pos) - this.pos, - ); - ++this.pos; - if (code2 > 1114111) { - this.invalidStringToken(codePos, 'Code point out of bounds'); - } - } else { - code2 = this.readHexChar(4); - } - return code2; - }; - pp2.readString = function (quote) { - var out = '', - chunkStart = ++this.pos; - for (;;) { - if (this.pos >= this.input.length) { - this.raise(this.start, 'Unterminated string constant'); - } - var ch = this.input.charCodeAt(this.pos); - if (ch === quote) { - break; - } - if (ch === 92) { - out += this.input.slice(chunkStart, this.pos); - out += this.readEscapedChar(false); - chunkStart = this.pos; - } else if (ch === 8232 || ch === 8233) { - if (this.options.ecmaVersion < 10) { - this.raise(this.start, 'Unterminated string constant'); - } - ++this.pos; - if (this.options.locations) { - this.curLine++; - this.lineStart = this.pos; - } - } else { - if (isNewLine2(ch)) { - this.raise(this.start, 'Unterminated string constant'); - } - ++this.pos; - } - } - out += this.input.slice(chunkStart, this.pos++); - return this.finishToken(types$12.string, out); - }; - var INVALID_TEMPLATE_ESCAPE_ERROR2 = {}; - pp2.tryReadTemplateToken = function () { - this.inTemplateElement = true; - try { - this.readTmplToken(); - } catch (err) { - if (err === INVALID_TEMPLATE_ESCAPE_ERROR2) { - this.readInvalidTemplateToken(); - } else { - throw err; - } - } - this.inTemplateElement = false; - }; - pp2.invalidStringToken = function (position3, message) { - if (this.inTemplateElement && this.options.ecmaVersion >= 9) { - throw INVALID_TEMPLATE_ESCAPE_ERROR2; - } else { - this.raise(position3, message); - } - }; - pp2.readTmplToken = function () { - var out = '', - chunkStart = this.pos; - for (;;) { - if (this.pos >= this.input.length) { - this.raise(this.start, 'Unterminated template'); - } - var ch = this.input.charCodeAt(this.pos); - if ( - ch === 96 || - (ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) - ) { - if ( - this.pos === this.start && - (this.type === types$12.template || - this.type === types$12.invalidTemplate) - ) { - if (ch === 36) { - this.pos += 2; - return this.finishToken(types$12.dollarBraceL); - } else { - ++this.pos; - return this.finishToken(types$12.backQuote); - } - } - out += this.input.slice(chunkStart, this.pos); - return this.finishToken(types$12.template, out); - } - if (ch === 92) { - out += this.input.slice(chunkStart, this.pos); - out += this.readEscapedChar(true); - chunkStart = this.pos; - } else if (isNewLine2(ch)) { - out += this.input.slice(chunkStart, this.pos); - ++this.pos; - switch (ch) { - case 13: - if (this.input.charCodeAt(this.pos) === 10) { - ++this.pos; - } - case 10: - out += '\n'; - break; - default: - out += String.fromCharCode(ch); - break; - } - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - chunkStart = this.pos; - } else { - ++this.pos; - } - } - }; - pp2.readInvalidTemplateToken = function () { - for (; this.pos < this.input.length; this.pos++) { - switch (this.input[this.pos]) { - case '\\': - ++this.pos; - break; - case '$': - if (this.input[this.pos + 1] !== '{') { - break; - } - case '`': - return this.finishToken( - types$12.invalidTemplate, - this.input.slice(this.start, this.pos), - ); - } - } - this.raise(this.start, 'Unterminated template'); - }; - pp2.readEscapedChar = function (inTemplate) { - var ch = this.input.charCodeAt(++this.pos); - ++this.pos; - switch (ch) { - case 110: - return '\n'; - case 114: - return '\r'; - case 120: - return String.fromCharCode(this.readHexChar(2)); - case 117: - return codePointToString2(this.readCodePoint()); - case 116: - return ' '; - case 98: - return '\b'; - case 118: - return '\v'; - case 102: - return '\f'; - case 13: - if (this.input.charCodeAt(this.pos) === 10) { - ++this.pos; - } - case 10: - if (this.options.locations) { - this.lineStart = this.pos; - ++this.curLine; - } - return ''; - case 56: - case 57: - if (this.strict) { - this.invalidStringToken(this.pos - 1, 'Invalid escape sequence'); - } - if (inTemplate) { - var codePos = this.pos - 1; - this.invalidStringToken( - codePos, - 'Invalid escape sequence in template string', - ); - return null; - } - default: - if (ch >= 48 && ch <= 55) { - var octalStr = this.input - .substr(this.pos - 1, 3) - .match(/^[0-7]+/)[0]; - var octal = parseInt(octalStr, 8); - if (octal > 255) { - octalStr = octalStr.slice(0, -1); - octal = parseInt(octalStr, 8); - } - this.pos += octalStr.length - 1; - ch = this.input.charCodeAt(this.pos); - if ( - (octalStr !== '0' || ch === 56 || ch === 57) && - (this.strict || inTemplate) - ) { - this.invalidStringToken( - this.pos - 1 - octalStr.length, - inTemplate - ? 'Octal literal in template string' - : 'Octal literal in strict mode', - ); - } - return String.fromCharCode(octal); - } - if (isNewLine2(ch)) { - return ''; - } - return String.fromCharCode(ch); - } - }; - pp2.readHexChar = function (len) { - var codePos = this.pos; - var n = this.readInt(16, len); - if (n === null) { - this.invalidStringToken(codePos, 'Bad character escape sequence'); - } - return n; - }; - pp2.readWord1 = function () { - this.containsEsc = false; - var word = '', - first = true, - chunkStart = this.pos; - var astral = this.options.ecmaVersion >= 6; - while (this.pos < this.input.length) { - var ch = this.fullCharCodeAtPos(); - if (isIdentifierChar2(ch, astral)) { - this.pos += ch <= 65535 ? 1 : 2; - } else if (ch === 92) { - this.containsEsc = true; - word += this.input.slice(chunkStart, this.pos); - var escStart = this.pos; - if (this.input.charCodeAt(++this.pos) !== 117) { - this.invalidStringToken( - this.pos, - 'Expecting Unicode escape sequence \\uXXXX', - ); - } - ++this.pos; - var esc = this.readCodePoint(); - if ( - !(first ? isIdentifierStart2 : isIdentifierChar2)(esc, astral) - ) { - this.invalidStringToken(escStart, 'Invalid Unicode escape'); - } - word += codePointToString2(esc); - chunkStart = this.pos; - } else { - break; - } - first = false; - } - return word + this.input.slice(chunkStart, this.pos); - }; - pp2.readWord = function () { - var word = this.readWord1(); - var type = types$12.name; - if (this.keywords.test(word)) { - type = keywords2[word]; - } - return this.finishToken(type, word); - }; - var version2 = '8.8.1'; - Parser3.acorn = { - Parser: Parser3, - version: version2, - defaultOptions: defaultOptions2, - Position: Position3, - SourceLocation: SourceLocation3, - getLineInfo: getLineInfo2, - Node: Node3, - TokenType: TokenType3, - tokTypes: types$12, - keywordTypes: keywords2, - TokContext: TokContext3, - tokContexts: types2, - isIdentifierChar: isIdentifierChar2, - isIdentifierStart: isIdentifierStart2, - Token: Token3, - isNewLine: isNewLine2, - lineBreak: lineBreak2, - lineBreakG: lineBreakG2, - nonASCIIwhitespace: nonASCIIwhitespace2, - }; - function parse4(input, options) { - return Parser3.parse(input, options); - } - function parseExpressionAt2(input, pos, options) { - return Parser3.parseExpressionAt(input, pos, options); - } - function tokenizer2(input, options) { - return Parser3.tokenizer(input, options); - } - exports2.Node = Node3; - exports2.Parser = Parser3; - exports2.Position = Position3; - exports2.SourceLocation = SourceLocation3; - exports2.TokContext = TokContext3; - exports2.Token = Token3; - exports2.TokenType = TokenType3; - exports2.defaultOptions = defaultOptions2; - exports2.getLineInfo = getLineInfo2; - exports2.isIdentifierChar = isIdentifierChar2; - exports2.isIdentifierStart = isIdentifierStart2; - exports2.isNewLine = isNewLine2; - exports2.keywordTypes = keywords2; - exports2.lineBreak = lineBreak2; - exports2.lineBreakG = lineBreakG2; - exports2.nonASCIIwhitespace = nonASCIIwhitespace2; - exports2.parse = parse4; - exports2.parseExpressionAt = parseExpressionAt2; - exports2.tokContexts = types2; - exports2.tokTypes = types$12; - exports2.tokenizer = tokenizer2; - exports2.version = version2; - Object.defineProperty(exports2, '__esModule', {value: true}); - }); - }, -}); - -// node_modules/acorn-jsx/index.js -var require_acorn_jsx = __commonJS({ - 'node_modules/acorn-jsx/index.js'(exports, module2) { - 'use strict'; - var XHTMLEntities = require_xhtml(); - var hexNumber = /^[\da-fA-F]+$/; - var decimalNumber = /^\d+$/; - var acornJsxMap = /* @__PURE__ */ new WeakMap(); - function getJsxTokens(acorn) { - acorn = acorn.Parser.acorn || acorn; - let acornJsx2 = acornJsxMap.get(acorn); - if (!acornJsx2) { - const tt = acorn.tokTypes; - const TokContext3 = acorn.TokContext; - const TokenType3 = acorn.TokenType; - const tc_oTag = new TokContext3('...', true, true); - const tokContexts = { - tc_oTag, - tc_cTag, - tc_expr, - }; - const tokTypes = { - jsxName: new TokenType3('jsxName'), - jsxText: new TokenType3('jsxText', {beforeExpr: true}), - jsxTagStart: new TokenType3('jsxTagStart', {startsExpr: true}), - jsxTagEnd: new TokenType3('jsxTagEnd'), - }; - tokTypes.jsxTagStart.updateContext = function () { - this.context.push(tc_expr); - this.context.push(tc_oTag); - this.exprAllowed = false; - }; - tokTypes.jsxTagEnd.updateContext = function (prevType) { - let out = this.context.pop(); - if ((out === tc_oTag && prevType === tt.slash) || out === tc_cTag) { - this.context.pop(); - this.exprAllowed = this.curContext() === tc_expr; - } else { - this.exprAllowed = true; - } - }; - acornJsx2 = {tokContexts, tokTypes}; - acornJsxMap.set(acorn, acornJsx2); - } - return acornJsx2; - } - function getQualifiedJSXName(object) { - if (!object) return object; - if (object.type === 'JSXIdentifier') return object.name; - if (object.type === 'JSXNamespacedName') - return object.namespace.name + ':' + object.name.name; - if (object.type === 'JSXMemberExpression') - return ( - getQualifiedJSXName(object.object) + - '.' + - getQualifiedJSXName(object.property) - ); - } - module2.exports = function (options) { - options = options || {}; - return function (Parser3) { - return plugin( - { - allowNamespaces: options.allowNamespaces !== false, - allowNamespacedObjects: !!options.allowNamespacedObjects, - }, - Parser3, - ); - }; - }; - Object.defineProperty(module2.exports, 'tokTypes', { - get: function get_tokTypes() { - return getJsxTokens(require_acorn()).tokTypes; - }, - configurable: true, - enumerable: true, - }); - function plugin(options, Parser3) { - const acorn = Parser3.acorn || require_acorn(); - const acornJsx2 = getJsxTokens(acorn); - const tt = acorn.tokTypes; - const tok = acornJsx2.tokTypes; - const tokContexts = acorn.tokContexts; - const tc_oTag = acornJsx2.tokContexts.tc_oTag; - const tc_cTag = acornJsx2.tokContexts.tc_cTag; - const tc_expr = acornJsx2.tokContexts.tc_expr; - const isNewLine2 = acorn.isNewLine; - const isIdentifierStart2 = acorn.isIdentifierStart; - const isIdentifierChar2 = acorn.isIdentifierChar; - return class extends Parser3 { - static get acornJsx() { - return acornJsx2; - } - jsx_readToken() { - let out = '', - chunkStart = this.pos; - for (;;) { - if (this.pos >= this.input.length) - this.raise(this.start, 'Unterminated JSX contents'); - let ch = this.input.charCodeAt(this.pos); - switch (ch) { - case 60: - case 123: - if (this.pos === this.start) { - if (ch === 60 && this.exprAllowed) { - ++this.pos; - return this.finishToken(tok.jsxTagStart); - } - return this.getTokenFromCode(ch); - } - out += this.input.slice(chunkStart, this.pos); - return this.finishToken(tok.jsxText, out); - case 38: - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readEntity(); - chunkStart = this.pos; - break; - case 62: - case 125: - this.raise( - this.pos, - 'Unexpected token `' + - this.input[this.pos] + - '`. Did you mean `' + - (ch === 62 ? '>' : '}') + - '` or `{"' + - this.input[this.pos] + - '"}`?', - ); - default: - if (isNewLine2(ch)) { - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readNewLine(true); - chunkStart = this.pos; - } else { - ++this.pos; - } - } - } - } - jsx_readNewLine(normalizeCRLF) { - let ch = this.input.charCodeAt(this.pos); - let out; - ++this.pos; - if (ch === 13 && this.input.charCodeAt(this.pos) === 10) { - ++this.pos; - out = normalizeCRLF ? '\n' : '\r\n'; - } else { - out = String.fromCharCode(ch); - } - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - return out; - } - jsx_readString(quote) { - let out = '', - chunkStart = ++this.pos; - for (;;) { - if (this.pos >= this.input.length) - this.raise(this.start, 'Unterminated string constant'); - let ch = this.input.charCodeAt(this.pos); - if (ch === quote) break; - if (ch === 38) { - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readEntity(); - chunkStart = this.pos; - } else if (isNewLine2(ch)) { - out += this.input.slice(chunkStart, this.pos); - out += this.jsx_readNewLine(false); - chunkStart = this.pos; - } else { - ++this.pos; - } - } - out += this.input.slice(chunkStart, this.pos++); - return this.finishToken(tt.string, out); - } - jsx_readEntity() { - let str = '', - count = 0, - entity; - let ch = this.input[this.pos]; - if (ch !== '&') - this.raise(this.pos, 'Entity must start with an ampersand'); - let startPos = ++this.pos; - while (this.pos < this.input.length && count++ < 10) { - ch = this.input[this.pos++]; - if (ch === ';') { - if (str[0] === '#') { - if (str[1] === 'x') { - str = str.substr(2); - if (hexNumber.test(str)) - entity = String.fromCharCode(parseInt(str, 16)); - } else { - str = str.substr(1); - if (decimalNumber.test(str)) - entity = String.fromCharCode(parseInt(str, 10)); - } - } else { - entity = XHTMLEntities[str]; - } - break; - } - str += ch; - } - if (!entity) { - this.pos = startPos; - return '&'; - } - return entity; - } - jsx_readWord() { - let ch, - start3 = this.pos; - do { - ch = this.input.charCodeAt(++this.pos); - } while (isIdentifierChar2(ch) || ch === 45); - return this.finishToken( - tok.jsxName, - this.input.slice(start3, this.pos), - ); - } - jsx_parseIdentifier() { - let node = this.startNode(); - if (this.type === tok.jsxName) node.name = this.value; - else if (this.type.keyword) node.name = this.type.keyword; - else this.unexpected(); - this.next(); - return this.finishNode(node, 'JSXIdentifier'); - } - jsx_parseNamespacedName() { - let startPos = this.start, - startLoc = this.startLoc; - let name2 = this.jsx_parseIdentifier(); - if (!options.allowNamespaces || !this.eat(tt.colon)) return name2; - var node = this.startNodeAt(startPos, startLoc); - node.namespace = name2; - node.name = this.jsx_parseIdentifier(); - return this.finishNode(node, 'JSXNamespacedName'); - } - jsx_parseElementName() { - if (this.type === tok.jsxTagEnd) return ''; - let startPos = this.start, - startLoc = this.startLoc; - let node = this.jsx_parseNamespacedName(); - if ( - this.type === tt.dot && - node.type === 'JSXNamespacedName' && - !options.allowNamespacedObjects - ) { - this.unexpected(); - } - while (this.eat(tt.dot)) { - let newNode = this.startNodeAt(startPos, startLoc); - newNode.object = node; - newNode.property = this.jsx_parseIdentifier(); - node = this.finishNode(newNode, 'JSXMemberExpression'); - } - return node; - } - jsx_parseAttributeValue() { - switch (this.type) { - case tt.braceL: - let node = this.jsx_parseExpressionContainer(); - if (node.expression.type === 'JSXEmptyExpression') - this.raise( - node.start, - 'JSX attributes must only be assigned a non-empty expression', - ); - return node; - case tok.jsxTagStart: - case tt.string: - return this.parseExprAtom(); - default: - this.raise( - this.start, - 'JSX value should be either an expression or a quoted JSX text', - ); - } - } - jsx_parseEmptyExpression() { - let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc); - return this.finishNodeAt( - node, - 'JSXEmptyExpression', - this.start, - this.startLoc, - ); - } - jsx_parseExpressionContainer() { - let node = this.startNode(); - this.next(); - node.expression = - this.type === tt.braceR - ? this.jsx_parseEmptyExpression() - : this.parseExpression(); - this.expect(tt.braceR); - return this.finishNode(node, 'JSXExpressionContainer'); - } - jsx_parseAttribute() { - let node = this.startNode(); - if (this.eat(tt.braceL)) { - this.expect(tt.ellipsis); - node.argument = this.parseMaybeAssign(); - this.expect(tt.braceR); - return this.finishNode(node, 'JSXSpreadAttribute'); - } - node.name = this.jsx_parseNamespacedName(); - node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null; - return this.finishNode(node, 'JSXAttribute'); - } - jsx_parseOpeningElementAt(startPos, startLoc) { - let node = this.startNodeAt(startPos, startLoc); - node.attributes = []; - let nodeName = this.jsx_parseElementName(); - if (nodeName) node.name = nodeName; - while (this.type !== tt.slash && this.type !== tok.jsxTagEnd) - node.attributes.push(this.jsx_parseAttribute()); - node.selfClosing = this.eat(tt.slash); - this.expect(tok.jsxTagEnd); - return this.finishNode( - node, - nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment', - ); - } - jsx_parseClosingElementAt(startPos, startLoc) { - let node = this.startNodeAt(startPos, startLoc); - let nodeName = this.jsx_parseElementName(); - if (nodeName) node.name = nodeName; - this.expect(tok.jsxTagEnd); - return this.finishNode( - node, - nodeName ? 'JSXClosingElement' : 'JSXClosingFragment', - ); - } - jsx_parseElementAt(startPos, startLoc) { - let node = this.startNodeAt(startPos, startLoc); - let children = []; - let openingElement = this.jsx_parseOpeningElementAt( - startPos, - startLoc, - ); - let closingElement = null; - if (!openingElement.selfClosing) { - contents: for (;;) { - switch (this.type) { - case tok.jsxTagStart: - startPos = this.start; - startLoc = this.startLoc; - this.next(); - if (this.eat(tt.slash)) { - closingElement = this.jsx_parseClosingElementAt( - startPos, - startLoc, - ); - break contents; - } - children.push(this.jsx_parseElementAt(startPos, startLoc)); - break; - case tok.jsxText: - children.push(this.parseExprAtom()); - break; - case tt.braceL: - children.push(this.jsx_parseExpressionContainer()); - break; - default: - this.unexpected(); - } - } - if ( - getQualifiedJSXName(closingElement.name) !== - getQualifiedJSXName(openingElement.name) - ) { - this.raise( - closingElement.start, - 'Expected corresponding JSX closing tag for <' + - getQualifiedJSXName(openingElement.name) + - '>', - ); - } - } - let fragmentOrElement = openingElement.name ? 'Element' : 'Fragment'; - node['opening' + fragmentOrElement] = openingElement; - node['closing' + fragmentOrElement] = closingElement; - node.children = children; - if (this.type === tt.relational && this.value === '<') { - this.raise( - this.start, - 'Adjacent JSX elements must be wrapped in an enclosing tag', - ); - } - return this.finishNode(node, 'JSX' + fragmentOrElement); - } - jsx_parseText() { - let node = this.parseLiteral(this.value); - node.type = 'JSXText'; - return node; - } - jsx_parseElement() { - let startPos = this.start, - startLoc = this.startLoc; - this.next(); - return this.jsx_parseElementAt(startPos, startLoc); - } - parseExprAtom(refShortHandDefaultPos) { - if (this.type === tok.jsxText) return this.jsx_parseText(); - else if (this.type === tok.jsxTagStart) - return this.jsx_parseElement(); - else return super.parseExprAtom(refShortHandDefaultPos); - } - readToken(code2) { - let context = this.curContext(); - if (context === tc_expr) return this.jsx_readToken(); - if (context === tc_oTag || context === tc_cTag) { - if (isIdentifierStart2(code2)) return this.jsx_readWord(); - if (code2 == 62) { - ++this.pos; - return this.finishToken(tok.jsxTagEnd); - } - if ((code2 === 34 || code2 === 39) && context == tc_oTag) - return this.jsx_readString(code2); - } - if ( - code2 === 60 && - this.exprAllowed && - this.input.charCodeAt(this.pos + 1) !== 33 - ) { - ++this.pos; - return this.finishToken(tok.jsxTagStart); - } - return super.readToken(code2); - } - updateContext(prevType) { - if (this.type == tt.braceL) { - var curContext = this.curContext(); - if (curContext == tc_oTag) this.context.push(tokContexts.b_expr); - else if (curContext == tc_expr) - this.context.push(tokContexts.b_tmpl); - else super.updateContext(prevType); - this.exprAllowed = true; - } else if (this.type === tt.slash && prevType === tok.jsxTagStart) { - this.context.length -= 2; - this.context.push(tc_cTag); - this.exprAllowed = false; - } else { - return super.updateContext(prevType); - } - } - }; - } - }, -}); - -// node_modules/inline-style-parser/index.js -var require_inline_style_parser = __commonJS({ - 'node_modules/inline-style-parser/index.js'(exports, module2) { - var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; - var NEWLINE_REGEX = /\n/g; - var WHITESPACE_REGEX = /^\s*/; - var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/; - var COLON_REGEX = /^:\s*/; - var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/; - var SEMICOLON_REGEX = /^[;\s]*/; - var TRIM_REGEX = /^\s+|\s+$/g; - var NEWLINE = '\n'; - var FORWARD_SLASH = '/'; - var ASTERISK = '*'; - var EMPTY_STRING = ''; - var TYPE_COMMENT = 'comment'; - var TYPE_DECLARATION = 'declaration'; - module2.exports = function (style2, options) { - if (typeof style2 !== 'string') { - throw new TypeError('First argument must be a string'); - } - if (!style2) return []; - options = options || {}; - var lineno = 1; - var column = 1; - function updatePosition(str) { - var lines = str.match(NEWLINE_REGEX); - if (lines) lineno += lines.length; - var i = str.lastIndexOf(NEWLINE); - column = ~i ? str.length - i : column + str.length; - } - function position3() { - var start3 = {line: lineno, column}; - return function (node) { - node.position = new Position3(start3); - whitespace2(); - return node; - }; - } - function Position3(start3) { - this.start = start3; - this.end = {line: lineno, column}; - this.source = options.source; - } - Position3.prototype.content = style2; - var errorsList = []; - function error(msg) { - var err = new Error( - options.source + ':' + lineno + ':' + column + ': ' + msg, - ); - err.reason = msg; - err.filename = options.source; - err.line = lineno; - err.column = column; - err.source = style2; - if (options.silent) { - errorsList.push(err); - } else { - throw err; - } - } - function match(re) { - var m = re.exec(style2); - if (!m) return; - var str = m[0]; - updatePosition(str); - style2 = style2.slice(str.length); - return m; - } - function whitespace2() { - match(WHITESPACE_REGEX); - } - function comments(rules) { - var c; - rules = rules || []; - while ((c = comment2())) { - if (c !== false) { - rules.push(c); - } - } - return rules; - } - function comment2() { - var pos = position3(); - if (FORWARD_SLASH != style2.charAt(0) || ASTERISK != style2.charAt(1)) - return; - var i = 2; - while ( - EMPTY_STRING != style2.charAt(i) && - (ASTERISK != style2.charAt(i) || - FORWARD_SLASH != style2.charAt(i + 1)) - ) { - ++i; - } - i += 2; - if (EMPTY_STRING === style2.charAt(i - 1)) { - return error('End of comment missing'); - } - var str = style2.slice(2, i - 2); - column += 2; - updatePosition(str); - style2 = style2.slice(i); - column += 2; - return pos({ - type: TYPE_COMMENT, - comment: str, - }); - } - function declaration() { - var pos = position3(); - var prop = match(PROPERTY_REGEX); - if (!prop) return; - comment2(); - if (!match(COLON_REGEX)) return error("property missing ':'"); - var val = match(VALUE_REGEX); - var ret = pos({ - type: TYPE_DECLARATION, - property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)), - value: val - ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) - : EMPTY_STRING, - }); - match(SEMICOLON_REGEX); - return ret; - } - function declarations() { - var decls = []; - comments(decls); - var decl; - while ((decl = declaration())) { - if (decl !== false) { - decls.push(decl); - comments(decls); - } - } - return decls; - } - whitespace2(); - return declarations(); - }; - function trim(str) { - return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING; - } - }, -}); - -// node_modules/style-to-object/index.js -var require_style_to_object = __commonJS({ - 'node_modules/style-to-object/index.js'(exports, module2) { - var parse4 = require_inline_style_parser(); - function StyleToObject(style2, iterator) { - var output = null; - if (!style2 || typeof style2 !== 'string') { - return output; - } - var declaration; - var declarations = parse4(style2); - var hasIterator = typeof iterator === 'function'; - var property; - var value; - for (var i = 0, len = declarations.length; i < len; i++) { - declaration = declarations[i]; - property = declaration.property; - value = declaration.value; - if (hasIterator) { - iterator(property, value, declaration); - } else if (value) { - output || (output = {}); - output[property] = value; - } - } - return output; - } - module2.exports = StyleToObject; - }, -}); - -// node_modules/markdown-extensions/markdown-extensions.json -var require_markdown_extensions = __commonJS({ - 'node_modules/markdown-extensions/markdown-extensions.json'( - exports, - module2, - ) { - module2.exports = [ - 'md', - 'markdown', - 'mdown', - 'mkdn', - 'mkd', - 'mdwn', - 'mkdown', - 'ron', - ]; - }, -}); - -// node_modules/markdown-extensions/index.js -var require_markdown_extensions2 = __commonJS({ - 'node_modules/markdown-extensions/index.js'(exports, module2) { - 'use strict'; - module2.exports = require_markdown_extensions(); - }, -}); - -// node_modules/@mdx-js/mdx/index.js -var mdx_exports = {}; -__export(mdx_exports, { - compile: () => compile, - compileSync: () => compileSync, - createProcessor: () => createProcessor, - evaluate: () => evaluate, - evaluateSync: () => evaluateSync, - nodeTypes: () => nodeTypes, - run: () => run, - runSync: () => runSync, - // Added manually! - mdastUtilToString: () => toString2, -}); -module.exports = __toCommonJS(mdx_exports); - -// node_modules/@mdx-js/mdx/node_modules/bail/index.js -function bail(error) { - if (error) { - throw error; - } -} - -// node_modules/@mdx-js/mdx/node_modules/unified/lib/index.js -var import_is_buffer2 = __toESM(require_is_buffer(), 1); -var import_extend = __toESM(require_extend(), 1); - -// node_modules/@mdx-js/mdx/node_modules/is-plain-obj/index.js -function isPlainObject(value) { - if (typeof value !== 'object' || value === null) { - return false; - } - const prototype = Object.getPrototypeOf(value); - return ( - (prototype === null || - prototype === Object.prototype || - Object.getPrototypeOf(prototype) === null) && - !(Symbol.toStringTag in value) && - !(Symbol.iterator in value) - ); -} - -// node_modules/@mdx-js/mdx/node_modules/trough/index.js -function trough() { - const fns = []; - const pipeline = {run: run2, use}; - return pipeline; - function run2(...values) { - let middlewareIndex = -1; - const callback = values.pop(); - if (typeof callback !== 'function') { - throw new TypeError( - 'Expected function as last argument, not ' + callback, - ); - } - next(null, ...values); - function next(error, ...output) { - const fn = fns[++middlewareIndex]; - let index2 = -1; - if (error) { - callback(error); - return; - } - while (++index2 < values.length) { - if (output[index2] === null || output[index2] === void 0) { - output[index2] = values[index2]; - } - } - values = output; - if (fn) { - wrap(fn, next)(...output); - } else { - callback(null, ...output); - } - } - } - function use(middelware) { - if (typeof middelware !== 'function') { - throw new TypeError( - 'Expected `middelware` to be a function, not ' + middelware, - ); - } - fns.push(middelware); - return pipeline; - } -} -function wrap(middleware, callback) { - let called; - return wrapped; - function wrapped(...parameters) { - const fnExpectsCallback = middleware.length > parameters.length; - let result; - if (fnExpectsCallback) { - parameters.push(done); - } - try { - result = middleware.apply(this, parameters); - } catch (error) { - const exception = error; - if (fnExpectsCallback && called) { - throw exception; - } - return done(exception); - } - if (!fnExpectsCallback) { - if (result instanceof Promise) { - result.then(then, done); - } else if (result instanceof Error) { - done(result); - } else { - then(result); - } - } - } - function done(error, ...output) { - if (!called) { - called = true; - callback(error, ...output); - } - } - function then(value) { - done(null, value); - } -} - -// node_modules/vfile/lib/index.js -var import_is_buffer = __toESM(require_is_buffer(), 1); - -// node_modules/unist-util-stringify-position/index.js -function stringifyPosition(value) { - if (!value || typeof value !== 'object') { - return ''; - } - if ('position' in value || 'type' in value) { - return position(value.position); - } - if ('start' in value || 'end' in value) { - return position(value); - } - if ('line' in value || 'column' in value) { - return point(value); - } - return ''; -} -function point(point3) { - return index(point3 && point3.line) + ':' + index(point3 && point3.column); -} -function position(pos) { - return point(pos && pos.start) + '-' + point(pos && pos.end); -} -function index(value) { - return value && typeof value === 'number' ? value : 1; -} - -// node_modules/vfile-message/index.js -var VFileMessage = class extends Error { - constructor(reason, place, origin) { - const parts = [null, null]; - let position3 = { - start: {line: null, column: null}, - end: {line: null, column: null}, - }; - super(); - if (typeof place === 'string') { - origin = place; - place = void 0; - } - if (typeof origin === 'string') { - const index2 = origin.indexOf(':'); - if (index2 === -1) { - parts[1] = origin; - } else { - parts[0] = origin.slice(0, index2); - parts[1] = origin.slice(index2 + 1); - } - } - if (place) { - if ('type' in place || 'position' in place) { - if (place.position) { - position3 = place.position; - } - } else if ('start' in place || 'end' in place) { - position3 = place; - } else if ('line' in place || 'column' in place) { - position3.start = place; - } - } - this.name = stringifyPosition(place) || '1:1'; - this.message = typeof reason === 'object' ? reason.message : reason; - this.stack = typeof reason === 'object' ? reason.stack : ''; - this.reason = this.message; - this.fatal; - this.line = position3.start.line; - this.column = position3.start.column; - this.source = parts[0]; - this.ruleId = parts[1]; - this.position = position3; - this.actual; - this.expected; - this.file; - this.url; - this.note; - } -}; -VFileMessage.prototype.file = ''; -VFileMessage.prototype.name = ''; -VFileMessage.prototype.reason = ''; -VFileMessage.prototype.message = ''; -VFileMessage.prototype.stack = ''; -VFileMessage.prototype.fatal = null; -VFileMessage.prototype.column = null; -VFileMessage.prototype.line = null; -VFileMessage.prototype.source = null; -VFileMessage.prototype.ruleId = null; -VFileMessage.prototype.position = null; - -// node_modules/vfile/lib/minpath.js -var import_path = __toESM(require('path'), 1); - -// node_modules/vfile/lib/minproc.js -var import_process = __toESM(require('process'), 1); - -// node_modules/vfile/lib/minurl.js -var import_url = require('url'); - -// node_modules/vfile/lib/minurl.shared.js -function isUrl(fileURLOrPath) { - return ( - fileURLOrPath !== null && - typeof fileURLOrPath === 'object' && - fileURLOrPath.href && - fileURLOrPath.origin - ); -} - -// node_modules/vfile/lib/index.js -var order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname']; -var VFile = class { - constructor(value) { - let options; - if (!value) { - options = {}; - } else if ( - typeof value === 'string' || - (0, import_is_buffer.default)(value) - ) { - options = {value}; - } else if (isUrl(value)) { - options = {path: value}; - } else { - options = value; - } - this.data = {}; - this.messages = []; - this.history = []; - this.cwd = import_process.default.cwd(); - this.value; - this.stored; - this.result; - this.map; - let index2 = -1; - while (++index2 < order.length) { - const prop2 = order[index2]; - if (prop2 in options && options[prop2] !== void 0) { - this[prop2] = - prop2 === 'history' ? [...options[prop2]] : options[prop2]; - } - } - let prop; - for (prop in options) { - if (!order.includes(prop)) this[prop] = options[prop]; - } - } - get path() { - return this.history[this.history.length - 1]; - } - set path(path) { - if (isUrl(path)) { - path = (0, import_url.fileURLToPath)(path); - } - assertNonEmpty(path, 'path'); - if (this.path !== path) { - this.history.push(path); - } - } - get dirname() { - return typeof this.path === 'string' - ? import_path.default.dirname(this.path) - : void 0; - } - set dirname(dirname) { - assertPath(this.basename, 'dirname'); - this.path = import_path.default.join(dirname || '', this.basename); - } - get basename() { - return typeof this.path === 'string' - ? import_path.default.basename(this.path) - : void 0; - } - set basename(basename) { - assertNonEmpty(basename, 'basename'); - assertPart(basename, 'basename'); - this.path = import_path.default.join(this.dirname || '', basename); - } - get extname() { - return typeof this.path === 'string' - ? import_path.default.extname(this.path) - : void 0; - } - set extname(extname) { - assertPart(extname, 'extname'); - assertPath(this.dirname, 'extname'); - if (extname) { - if (extname.charCodeAt(0) !== 46) { - throw new Error('`extname` must start with `.`'); - } - if (extname.includes('.', 1)) { - throw new Error('`extname` cannot contain multiple dots'); - } - } - this.path = import_path.default.join( - this.dirname, - this.stem + (extname || ''), - ); - } - get stem() { - return typeof this.path === 'string' - ? import_path.default.basename(this.path, this.extname) - : void 0; - } - set stem(stem) { - assertNonEmpty(stem, 'stem'); - assertPart(stem, 'stem'); - this.path = import_path.default.join( - this.dirname || '', - stem + (this.extname || ''), - ); - } - toString(encoding) { - return (this.value || '').toString(encoding); - } - message(reason, place, origin) { - const message = new VFileMessage(reason, place, origin); - if (this.path) { - message.name = this.path + ':' + message.name; - message.file = this.path; - } - message.fatal = false; - this.messages.push(message); - return message; - } - info(reason, place, origin) { - const message = this.message(reason, place, origin); - message.fatal = null; - return message; - } - fail(reason, place, origin) { - const message = this.message(reason, place, origin); - message.fatal = true; - throw message; - } -}; -function assertPart(part, name2) { - if (part && part.includes(import_path.default.sep)) { - throw new Error( - '`' + - name2 + - '` cannot be a path: did not expect `' + - import_path.default.sep + - '`', - ); - } -} -function assertNonEmpty(part, name2) { - if (!part) { - throw new Error('`' + name2 + '` cannot be empty'); - } -} -function assertPath(path, name2) { - if (!path) { - throw new Error('Setting `' + name2 + '` requires `path` to be set too'); - } -} - -// node_modules/@mdx-js/mdx/node_modules/unified/lib/index.js -var unified = base().freeze(); -var own = {}.hasOwnProperty; -function base() { - const transformers = trough(); - const attachers = []; - let namespace = {}; - let frozen; - let freezeIndex = -1; - processor.data = data2; - processor.Parser = void 0; - processor.Compiler = void 0; - processor.freeze = freeze; - processor.attachers = attachers; - processor.use = use; - processor.parse = parse4; - processor.stringify = stringify4; - processor.run = run2; - processor.runSync = runSync2; - processor.process = process2; - processor.processSync = processSync; - return processor; - function processor() { - const destination = base(); - let index2 = -1; - while (++index2 < attachers.length) { - destination.use(...attachers[index2]); - } - destination.data((0, import_extend.default)(true, {}, namespace)); - return destination; - } - function data2(key, value) { - if (typeof key === 'string') { - if (arguments.length === 2) { - assertUnfrozen('data', frozen); - namespace[key] = value; - return processor; - } - return (own.call(namespace, key) && namespace[key]) || null; - } - if (key) { - assertUnfrozen('data', frozen); - namespace = key; - return processor; - } - return namespace; - } - function freeze() { - if (frozen) { - return processor; - } - while (++freezeIndex < attachers.length) { - const [attacher, ...options] = attachers[freezeIndex]; - if (options[0] === false) { - continue; - } - if (options[0] === true) { - options[0] = void 0; - } - const transformer = attacher.call(processor, ...options); - if (typeof transformer === 'function') { - transformers.use(transformer); - } - } - frozen = true; - freezeIndex = Number.POSITIVE_INFINITY; - return processor; - } - function use(value, ...options) { - let settings; - assertUnfrozen('use', frozen); - if (value === null || value === void 0) { - } else if (typeof value === 'function') { - addPlugin(value, ...options); - } else if (typeof value === 'object') { - if (Array.isArray(value)) { - addList(value); - } else { - addPreset(value); - } - } else { - throw new TypeError('Expected usable value, not `' + value + '`'); - } - if (settings) { - namespace.settings = Object.assign(namespace.settings || {}, settings); - } - return processor; - function add(value2) { - if (typeof value2 === 'function') { - addPlugin(value2); - } else if (typeof value2 === 'object') { - if (Array.isArray(value2)) { - const [plugin, ...options2] = value2; - addPlugin(plugin, ...options2); - } else { - addPreset(value2); - } - } else { - throw new TypeError('Expected usable value, not `' + value2 + '`'); - } - } - function addPreset(result) { - addList(result.plugins); - if (result.settings) { - settings = Object.assign(settings || {}, result.settings); - } - } - function addList(plugins) { - let index2 = -1; - if (plugins === null || plugins === void 0) { - } else if (Array.isArray(plugins)) { - while (++index2 < plugins.length) { - const thing = plugins[index2]; - add(thing); - } - } else { - throw new TypeError( - 'Expected a list of plugins, not `' + plugins + '`', - ); - } - } - function addPlugin(plugin, value2) { - let index2 = -1; - let entry; - while (++index2 < attachers.length) { - if (attachers[index2][0] === plugin) { - entry = attachers[index2]; - break; - } - } - if (entry) { - if (isPlainObject(entry[1]) && isPlainObject(value2)) { - value2 = (0, import_extend.default)(true, entry[1], value2); - } - entry[1] = value2; - } else { - attachers.push([...arguments]); - } - } - } - function parse4(doc) { - processor.freeze(); - const file = vfile(doc); - const Parser3 = processor.Parser; - assertParser('parse', Parser3); - if (newable(Parser3, 'parse')) { - return new Parser3(String(file), file).parse(); - } - return Parser3(String(file), file); - } - function stringify4(node, doc) { - processor.freeze(); - const file = vfile(doc); - const Compiler = processor.Compiler; - assertCompiler('stringify', Compiler); - assertNode(node); - if (newable(Compiler, 'compile')) { - return new Compiler(node, file).compile(); - } - return Compiler(node, file); - } - function run2(node, doc, callback) { - assertNode(node); - processor.freeze(); - if (!callback && typeof doc === 'function') { - callback = doc; - doc = void 0; - } - if (!callback) { - return new Promise(executor); - } - executor(null, callback); - function executor(resolve, reject) { - transformers.run(node, vfile(doc), done); - function done(error, tree, file) { - tree = tree || node; - if (error) { - reject(error); - } else if (resolve) { - resolve(tree); - } else { - callback(null, tree, file); - } - } - } - } - function runSync2(node, file) { - let result; - let complete; - processor.run(node, file, done); - assertDone('runSync', 'run', complete); - return result; - function done(error, tree) { - bail(error); - result = tree; - complete = true; - } - } - function process2(doc, callback) { - processor.freeze(); - assertParser('process', processor.Parser); - assertCompiler('process', processor.Compiler); - if (!callback) { - return new Promise(executor); - } - executor(null, callback); - function executor(resolve, reject) { - const file = vfile(doc); - processor.run(processor.parse(file), file, (error, tree, file2) => { - if (error || !tree || !file2) { - done(error); - } else { - const result = processor.stringify(tree, file2); - if (result === void 0 || result === null) { - } else if (looksLikeAVFileValue(result)) { - file2.value = result; - } else { - file2.result = result; - } - done(error, file2); - } - }); - function done(error, file2) { - if (error || !file2) { - reject(error); - } else if (resolve) { - resolve(file2); - } else { - callback(null, file2); - } - } - } - } - function processSync(doc) { - let complete; - processor.freeze(); - assertParser('processSync', processor.Parser); - assertCompiler('processSync', processor.Compiler); - const file = vfile(doc); - processor.process(file, done); - assertDone('processSync', 'process', complete); - return file; - function done(error) { - complete = true; - bail(error); - } - } -} -function newable(value, name2) { - return ( - typeof value === 'function' && - value.prototype && - (keys(value.prototype) || name2 in value.prototype) - ); -} -function keys(value) { - let key; - for (key in value) { - if (own.call(value, key)) { - return true; - } - } - return false; -} -function assertParser(name2, value) { - if (typeof value !== 'function') { - throw new TypeError('Cannot `' + name2 + '` without `Parser`'); - } -} -function assertCompiler(name2, value) { - if (typeof value !== 'function') { - throw new TypeError('Cannot `' + name2 + '` without `Compiler`'); - } -} -function assertUnfrozen(name2, frozen) { - if (frozen) { - throw new Error( - 'Cannot call `' + - name2 + - '` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.', - ); - } -} -function assertNode(node) { - if (!isPlainObject(node) || typeof node.type !== 'string') { - throw new TypeError('Expected node, got `' + node + '`'); - } -} -function assertDone(name2, asyncName, complete) { - if (!complete) { - throw new Error( - '`' + name2 + '` finished async. Use `' + asyncName + '` instead', - ); - } -} -function vfile(value) { - return looksLikeAVFile(value) ? value : new VFile(value); -} -function looksLikeAVFile(value) { - return Boolean( - value && - typeof value === 'object' && - 'message' in value && - 'messages' in value, - ); -} -function looksLikeAVFileValue(value) { - return typeof value === 'string' || (0, import_is_buffer2.default)(value); -} - -// node_modules/acorn/dist/acorn.mjs -var astralIdentifierCodes = [ - 509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, - 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, - 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, - 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, - 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, - 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, - 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, - 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, - 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, - 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, - 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, - 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, - 9, 787719, 239, -]; -var astralIdentifierStartCodes = [ - 0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, - 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, - 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, - 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, - 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, - 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, - 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, - 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, - 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, - 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, - 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, - 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, - 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, - 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, - 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, - 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, - 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, - 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, - 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, - 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, - 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, - 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, - 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, - 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, - 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, - 4938, -]; -var nonASCIIidentifierChars = - '\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F'; -var nonASCIIidentifierStartChars = - '\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC'; -var reservedWords = { - 3: 'abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile', - 5: 'class enum extends super const export import', - 6: 'enum', - strict: - 'implements interface let package private protected public static yield', - strictBind: 'eval arguments', -}; -var ecma5AndLessKeywords = - 'break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this'; -var keywords$1 = { - 5: ecma5AndLessKeywords, - '5module': ecma5AndLessKeywords + ' export import', - 6: ecma5AndLessKeywords + ' const class extends export import super', -}; -var keywordRelationalOperator = /^in(stanceof)?$/; -var nonASCIIidentifierStart = new RegExp( - '[' + nonASCIIidentifierStartChars + ']', -); -var nonASCIIidentifier = new RegExp( - '[' + nonASCIIidentifierStartChars + nonASCIIidentifierChars + ']', -); -function isInAstralSet(code2, set) { - var pos = 65536; - for (var i = 0; i < set.length; i += 2) { - pos += set[i]; - if (pos > code2) { - return false; - } - pos += set[i + 1]; - if (pos >= code2) { - return true; - } - } -} -function isIdentifierStart(code2, astral) { - if (code2 < 65) { - return code2 === 36; - } - if (code2 < 91) { - return true; - } - if (code2 < 97) { - return code2 === 95; - } - if (code2 < 123) { - return true; - } - if (code2 <= 65535) { - return ( - code2 >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code2)) - ); - } - if (astral === false) { - return false; - } - return isInAstralSet(code2, astralIdentifierStartCodes); -} -function isIdentifierChar(code2, astral) { - if (code2 < 48) { - return code2 === 36; - } - if (code2 < 58) { - return true; - } - if (code2 < 65) { - return false; - } - if (code2 < 91) { - return true; - } - if (code2 < 97) { - return code2 === 95; - } - if (code2 < 123) { - return true; - } - if (code2 <= 65535) { - return code2 >= 170 && nonASCIIidentifier.test(String.fromCharCode(code2)); - } - if (astral === false) { - return false; - } - return ( - isInAstralSet(code2, astralIdentifierStartCodes) || - isInAstralSet(code2, astralIdentifierCodes) - ); -} -var TokenType = function TokenType2(label, conf) { - if (conf === void 0) conf = {}; - this.label = label; - this.keyword = conf.keyword; - this.beforeExpr = !!conf.beforeExpr; - this.startsExpr = !!conf.startsExpr; - this.isLoop = !!conf.isLoop; - this.isAssign = !!conf.isAssign; - this.prefix = !!conf.prefix; - this.postfix = !!conf.postfix; - this.binop = conf.binop || null; - this.updateContext = null; -}; -function binop(name2, prec) { - return new TokenType(name2, {beforeExpr: true, binop: prec}); -} -var beforeExpr = {beforeExpr: true}; -var startsExpr = {startsExpr: true}; -var keywords = {}; -function kw(name2, options) { - if (options === void 0) options = {}; - options.keyword = name2; - return (keywords[name2] = new TokenType(name2, options)); -} -var types$1 = { - num: new TokenType('num', startsExpr), - regexp: new TokenType('regexp', startsExpr), - string: new TokenType('string', startsExpr), - name: new TokenType('name', startsExpr), - privateId: new TokenType('privateId', startsExpr), - eof: new TokenType('eof'), - bracketL: new TokenType('[', {beforeExpr: true, startsExpr: true}), - bracketR: new TokenType(']'), - braceL: new TokenType('{', {beforeExpr: true, startsExpr: true}), - braceR: new TokenType('}'), - parenL: new TokenType('(', {beforeExpr: true, startsExpr: true}), - parenR: new TokenType(')'), - comma: new TokenType(',', beforeExpr), - semi: new TokenType(';', beforeExpr), - colon: new TokenType(':', beforeExpr), - dot: new TokenType('.'), - question: new TokenType('?', beforeExpr), - questionDot: new TokenType('?.'), - arrow: new TokenType('=>', beforeExpr), - template: new TokenType('template'), - invalidTemplate: new TokenType('invalidTemplate'), - ellipsis: new TokenType('...', beforeExpr), - backQuote: new TokenType('`', startsExpr), - dollarBraceL: new TokenType('${', {beforeExpr: true, startsExpr: true}), - eq: new TokenType('=', {beforeExpr: true, isAssign: true}), - assign: new TokenType('_=', {beforeExpr: true, isAssign: true}), - incDec: new TokenType('++/--', { - prefix: true, - postfix: true, - startsExpr: true, - }), - prefix: new TokenType('!/~', { - beforeExpr: true, - prefix: true, - startsExpr: true, - }), - logicalOR: binop('||', 1), - logicalAND: binop('&&', 2), - bitwiseOR: binop('|', 3), - bitwiseXOR: binop('^', 4), - bitwiseAND: binop('&', 5), - equality: binop('==/!=/===/!==', 6), - relational: binop('/<=/>=', 7), - bitShift: binop('<>/>>>', 8), - plusMin: new TokenType('+/-', { - beforeExpr: true, - binop: 9, - prefix: true, - startsExpr: true, - }), - modulo: binop('%', 10), - star: binop('*', 10), - slash: binop('/', 10), - starstar: new TokenType('**', {beforeExpr: true}), - coalesce: binop('??', 1), - _break: kw('break'), - _case: kw('case', beforeExpr), - _catch: kw('catch'), - _continue: kw('continue'), - _debugger: kw('debugger'), - _default: kw('default', beforeExpr), - _do: kw('do', {isLoop: true, beforeExpr: true}), - _else: kw('else', beforeExpr), - _finally: kw('finally'), - _for: kw('for', {isLoop: true}), - _function: kw('function', startsExpr), - _if: kw('if'), - _return: kw('return', beforeExpr), - _switch: kw('switch'), - _throw: kw('throw', beforeExpr), - _try: kw('try'), - _var: kw('var'), - _const: kw('const'), - _while: kw('while', {isLoop: true}), - _with: kw('with'), - _new: kw('new', {beforeExpr: true, startsExpr: true}), - _this: kw('this', startsExpr), - _super: kw('super', startsExpr), - _class: kw('class', startsExpr), - _extends: kw('extends', beforeExpr), - _export: kw('export'), - _import: kw('import', startsExpr), - _null: kw('null', startsExpr), - _true: kw('true', startsExpr), - _false: kw('false', startsExpr), - _in: kw('in', {beforeExpr: true, binop: 7}), - _instanceof: kw('instanceof', {beforeExpr: true, binop: 7}), - _typeof: kw('typeof', {beforeExpr: true, prefix: true, startsExpr: true}), - _void: kw('void', {beforeExpr: true, prefix: true, startsExpr: true}), - _delete: kw('delete', {beforeExpr: true, prefix: true, startsExpr: true}), -}; -var lineBreak = /\r\n?|\n|\u2028|\u2029/; -var lineBreakG = new RegExp(lineBreak.source, 'g'); -function isNewLine(code2) { - return code2 === 10 || code2 === 13 || code2 === 8232 || code2 === 8233; -} -function nextLineBreak(code2, from, end) { - if (end === void 0) end = code2.length; - for (var i = from; i < end; i++) { - var next = code2.charCodeAt(i); - if (isNewLine(next)) { - return i < end - 1 && next === 13 && code2.charCodeAt(i + 1) === 10 - ? i + 2 - : i + 1; - } - } - return -1; -} -var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; -var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; -var ref = Object.prototype; -var hasOwnProperty = ref.hasOwnProperty; -var toString = ref.toString; -var hasOwn = - Object.hasOwn || - function (obj, propName) { - return hasOwnProperty.call(obj, propName); - }; -var isArray = - Array.isArray || - function (obj) { - return toString.call(obj) === '[object Array]'; - }; -function wordsRegexp(words) { - return new RegExp('^(?:' + words.replace(/ /g, '|') + ')$'); -} -function codePointToString(code2) { - if (code2 <= 65535) { - return String.fromCharCode(code2); - } - code2 -= 65536; - return String.fromCharCode((code2 >> 10) + 55296, (code2 & 1023) + 56320); -} -var loneSurrogate = - /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; -var Position = function Position2(line, col) { - this.line = line; - this.column = col; -}; -Position.prototype.offset = function offset(n) { - return new Position(this.line, this.column + n); -}; -var SourceLocation = function SourceLocation2(p, start3, end) { - this.start = start3; - this.end = end; - if (p.sourceFile !== null) { - this.source = p.sourceFile; - } -}; -function getLineInfo(input, offset2) { - for (var line = 1, cur = 0; ; ) { - var nextBreak = nextLineBreak(input, cur, offset2); - if (nextBreak < 0) { - return new Position(line, offset2 - cur); - } - ++line; - cur = nextBreak; - } -} -var defaultOptions = { - ecmaVersion: null, - sourceType: 'script', - onInsertedSemicolon: null, - onTrailingComma: null, - allowReserved: null, - allowReturnOutsideFunction: false, - allowImportExportEverywhere: false, - allowAwaitOutsideFunction: null, - allowSuperOutsideMethod: null, - allowHashBang: false, - locations: false, - onToken: null, - onComment: null, - ranges: false, - program: null, - sourceFile: null, - directSourceFile: null, - preserveParens: false, -}; -var warnedAboutEcmaVersion = false; -function getOptions(opts) { - var options = {}; - for (var opt in defaultOptions) { - options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; - } - if (options.ecmaVersion === 'latest') { - options.ecmaVersion = 1e8; - } else if (options.ecmaVersion == null) { - if ( - !warnedAboutEcmaVersion && - typeof console === 'object' && - console.warn - ) { - warnedAboutEcmaVersion = true; - console.warn( - 'Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.', - ); - } - options.ecmaVersion = 11; - } else if (options.ecmaVersion >= 2015) { - options.ecmaVersion -= 2009; - } - if (options.allowReserved == null) { - options.allowReserved = options.ecmaVersion < 5; - } - if (opts.allowHashBang == null) { - options.allowHashBang = options.ecmaVersion >= 14; - } - if (isArray(options.onToken)) { - var tokens = options.onToken; - options.onToken = function (token) { - return tokens.push(token); - }; - } - if (isArray(options.onComment)) { - options.onComment = pushComment(options, options.onComment); - } - return options; -} -function pushComment(options, array) { - return function (block, text5, start3, end, startLoc, endLoc) { - var comment2 = { - type: block ? 'Block' : 'Line', - value: text5, - start: start3, - end, - }; - if (options.locations) { - comment2.loc = new SourceLocation(this, startLoc, endLoc); - } - if (options.ranges) { - comment2.range = [start3, end]; - } - array.push(comment2); - }; -} -var SCOPE_TOP = 1; -var SCOPE_FUNCTION = 2; -var SCOPE_ASYNC = 4; -var SCOPE_GENERATOR = 8; -var SCOPE_ARROW = 16; -var SCOPE_SIMPLE_CATCH = 32; -var SCOPE_SUPER = 64; -var SCOPE_DIRECT_SUPER = 128; -var SCOPE_CLASS_STATIC_BLOCK = 256; -var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; -function functionFlags(async, generator) { - return ( - SCOPE_FUNCTION | - (async ? SCOPE_ASYNC : 0) | - (generator ? SCOPE_GENERATOR : 0) - ); -} -var BIND_NONE = 0; -var BIND_VAR = 1; -var BIND_LEXICAL = 2; -var BIND_FUNCTION = 3; -var BIND_SIMPLE_CATCH = 4; -var BIND_OUTSIDE = 5; -var Parser = function Parser2(options, input, startPos) { - this.options = options = getOptions(options); - this.sourceFile = options.sourceFile; - this.keywords = wordsRegexp( - keywords$1[ - options.ecmaVersion >= 6 - ? 6 - : options.sourceType === 'module' - ? '5module' - : 5 - ], - ); - var reserved = ''; - if (options.allowReserved !== true) { - reserved = - reservedWords[ - options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3 - ]; - if (options.sourceType === 'module') { - reserved += ' await'; - } - } - this.reservedWords = wordsRegexp(reserved); - var reservedStrict = (reserved ? reserved + ' ' : '') + reservedWords.strict; - this.reservedWordsStrict = wordsRegexp(reservedStrict); - this.reservedWordsStrictBind = wordsRegexp( - reservedStrict + ' ' + reservedWords.strictBind, - ); - this.input = String(input); - this.containsEsc = false; - if (startPos) { - this.pos = startPos; - this.lineStart = this.input.lastIndexOf('\n', startPos - 1) + 1; - this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; - } else { - this.pos = this.lineStart = 0; - this.curLine = 1; - } - this.type = types$1.eof; - this.value = null; - this.start = this.end = this.pos; - this.startLoc = this.endLoc = this.curPosition(); - this.lastTokEndLoc = this.lastTokStartLoc = null; - this.lastTokStart = this.lastTokEnd = this.pos; - this.context = this.initialContext(); - this.exprAllowed = true; - this.inModule = options.sourceType === 'module'; - this.strict = this.inModule || this.strictDirective(this.pos); - this.potentialArrowAt = -1; - this.potentialArrowInForAwait = false; - this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; - this.labels = []; - this.undefinedExports = /* @__PURE__ */ Object.create(null); - if ( - this.pos === 0 && - options.allowHashBang && - this.input.slice(0, 2) === '#!' - ) { - this.skipLineComment(2); - } - this.scopeStack = []; - this.enterScope(SCOPE_TOP); - this.regexpState = null; - this.privateNameStack = []; -}; -var prototypeAccessors = { - inFunction: {configurable: true}, - inGenerator: {configurable: true}, - inAsync: {configurable: true}, - canAwait: {configurable: true}, - allowSuper: {configurable: true}, - allowDirectSuper: {configurable: true}, - treatFunctionsAsVar: {configurable: true}, - allowNewDotTarget: {configurable: true}, - inClassStaticBlock: {configurable: true}, -}; -Parser.prototype.parse = function parse() { - var node = this.options.program || this.startNode(); - this.nextToken(); - return this.parseTopLevel(node); -}; -prototypeAccessors.inFunction.get = function () { - return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0; -}; -prototypeAccessors.inGenerator.get = function () { - return ( - (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && - !this.currentVarScope().inClassFieldInit - ); -}; -prototypeAccessors.inAsync.get = function () { - return ( - (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && - !this.currentVarScope().inClassFieldInit - ); -}; -prototypeAccessors.canAwait.get = function () { - for (var i = this.scopeStack.length - 1; i >= 0; i--) { - var scope = this.scopeStack[i]; - if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { - return false; - } - if (scope.flags & SCOPE_FUNCTION) { - return (scope.flags & SCOPE_ASYNC) > 0; - } - } - return ( - (this.inModule && this.options.ecmaVersion >= 13) || - this.options.allowAwaitOutsideFunction - ); -}; -prototypeAccessors.allowSuper.get = function () { - var ref2 = this.currentThisScope(); - var flags = ref2.flags; - var inClassFieldInit = ref2.inClassFieldInit; - return ( - (flags & SCOPE_SUPER) > 0 || - inClassFieldInit || - this.options.allowSuperOutsideMethod - ); -}; -prototypeAccessors.allowDirectSuper.get = function () { - return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0; -}; -prototypeAccessors.treatFunctionsAsVar.get = function () { - return this.treatFunctionsAsVarInScope(this.currentScope()); -}; -prototypeAccessors.allowNewDotTarget.get = function () { - var ref2 = this.currentThisScope(); - var flags = ref2.flags; - var inClassFieldInit = ref2.inClassFieldInit; - return ( - (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || - inClassFieldInit - ); -}; -prototypeAccessors.inClassStaticBlock.get = function () { - return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0; -}; -Parser.extend = function extend2() { - var plugins = [], - len = arguments.length; - while (len--) plugins[len] = arguments[len]; - var cls = this; - for (var i = 0; i < plugins.length; i++) { - cls = plugins[i](cls); - } - return cls; -}; -Parser.parse = function parse2(input, options) { - return new this(options, input).parse(); -}; -Parser.parseExpressionAt = function parseExpressionAt(input, pos, options) { - var parser = new this(options, input, pos); - parser.nextToken(); - return parser.parseExpression(); -}; -Parser.tokenizer = function tokenizer(input, options) { - return new this(options, input); -}; -Object.defineProperties(Parser.prototype, prototypeAccessors); -var pp$9 = Parser.prototype; -var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; -pp$9.strictDirective = function (start3) { - if (this.options.ecmaVersion < 5) { - return false; - } - for (;;) { - skipWhiteSpace.lastIndex = start3; - start3 += skipWhiteSpace.exec(this.input)[0].length; - var match = literal.exec(this.input.slice(start3)); - if (!match) { - return false; - } - if ((match[1] || match[2]) === 'use strict') { - skipWhiteSpace.lastIndex = start3 + match[0].length; - var spaceAfter = skipWhiteSpace.exec(this.input), - end = spaceAfter.index + spaceAfter[0].length; - var next = this.input.charAt(end); - return ( - next === ';' || - next === '}' || - (lineBreak.test(spaceAfter[0]) && - !( - /[(`.[+\-/*%<>=,?^&]/.test(next) || - (next === '!' && this.input.charAt(end + 1) === '=') - )) - ); - } - start3 += match[0].length; - skipWhiteSpace.lastIndex = start3; - start3 += skipWhiteSpace.exec(this.input)[0].length; - if (this.input[start3] === ';') { - start3++; - } - } -}; -pp$9.eat = function (type) { - if (this.type === type) { - this.next(); - return true; - } else { - return false; - } -}; -pp$9.isContextual = function (name2) { - return ( - this.type === types$1.name && this.value === name2 && !this.containsEsc - ); -}; -pp$9.eatContextual = function (name2) { - if (!this.isContextual(name2)) { - return false; - } - this.next(); - return true; -}; -pp$9.expectContextual = function (name2) { - if (!this.eatContextual(name2)) { - this.unexpected(); - } -}; -pp$9.canInsertSemicolon = function () { - return ( - this.type === types$1.eof || - this.type === types$1.braceR || - lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) - ); -}; -pp$9.insertSemicolon = function () { - if (this.canInsertSemicolon()) { - if (this.options.onInsertedSemicolon) { - this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); - } - return true; - } -}; -pp$9.semicolon = function () { - if (!this.eat(types$1.semi) && !this.insertSemicolon()) { - this.unexpected(); - } -}; -pp$9.afterTrailingComma = function (tokType, notNext) { - if (this.type === tokType) { - if (this.options.onTrailingComma) { - this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); - } - if (!notNext) { - this.next(); - } - return true; - } -}; -pp$9.expect = function (type) { - this.eat(type) || this.unexpected(); -}; -pp$9.unexpected = function (pos) { - this.raise(pos != null ? pos : this.start, 'Unexpected token'); -}; -var DestructuringErrors = function DestructuringErrors2() { - this.shorthandAssign = - this.trailingComma = - this.parenthesizedAssign = - this.parenthesizedBind = - this.doubleProto = - -1; -}; -pp$9.checkPatternErrors = function (refDestructuringErrors, isAssign) { - if (!refDestructuringErrors) { - return; - } - if (refDestructuringErrors.trailingComma > -1) { - this.raiseRecoverable( - refDestructuringErrors.trailingComma, - 'Comma is not permitted after the rest element', - ); - } - var parens = isAssign - ? refDestructuringErrors.parenthesizedAssign - : refDestructuringErrors.parenthesizedBind; - if (parens > -1) { - this.raiseRecoverable( - parens, - isAssign ? 'Assigning to rvalue' : 'Parenthesized pattern', - ); - } -}; -pp$9.checkExpressionErrors = function (refDestructuringErrors, andThrow) { - if (!refDestructuringErrors) { - return false; - } - var shorthandAssign = refDestructuringErrors.shorthandAssign; - var doubleProto = refDestructuringErrors.doubleProto; - if (!andThrow) { - return shorthandAssign >= 0 || doubleProto >= 0; - } - if (shorthandAssign >= 0) { - this.raise( - shorthandAssign, - 'Shorthand property assignments are valid only in destructuring patterns', - ); - } - if (doubleProto >= 0) { - this.raiseRecoverable(doubleProto, 'Redefinition of __proto__ property'); - } -}; -pp$9.checkYieldAwaitInDefaultParams = function () { - if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { - this.raise(this.yieldPos, 'Yield expression cannot be a default value'); - } - if (this.awaitPos) { - this.raise(this.awaitPos, 'Await expression cannot be a default value'); - } -}; -pp$9.isSimpleAssignTarget = function (expr) { - if (expr.type === 'ParenthesizedExpression') { - return this.isSimpleAssignTarget(expr.expression); - } - return expr.type === 'Identifier' || expr.type === 'MemberExpression'; -}; -var pp$8 = Parser.prototype; -pp$8.parseTopLevel = function (node) { - var exports = /* @__PURE__ */ Object.create(null); - if (!node.body) { - node.body = []; - } - while (this.type !== types$1.eof) { - var stmt = this.parseStatement(null, true, exports); - node.body.push(stmt); - } - if (this.inModule) { - for ( - var i = 0, list3 = Object.keys(this.undefinedExports); - i < list3.length; - i += 1 - ) { - var name2 = list3[i]; - this.raiseRecoverable( - this.undefinedExports[name2].start, - "Export '" + name2 + "' is not defined", - ); - } - } - this.adaptDirectivePrologue(node.body); - this.next(); - node.sourceType = this.options.sourceType; - return this.finishNode(node, 'Program'); -}; -var loopLabel = {kind: 'loop'}; -var switchLabel = {kind: 'switch'}; -pp$8.isLet = function (context) { - if (this.options.ecmaVersion < 6 || !this.isContextual('let')) { - return false; - } - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, - nextCh = this.input.charCodeAt(next); - if (nextCh === 91 || nextCh === 92 || (nextCh > 55295 && nextCh < 56320)) { - return true; - } - if (context) { - return false; - } - if (nextCh === 123) { - return true; - } - if (isIdentifierStart(nextCh, true)) { - var pos = next + 1; - while (isIdentifierChar((nextCh = this.input.charCodeAt(pos)), true)) { - ++pos; - } - if (nextCh === 92 || (nextCh > 55295 && nextCh < 56320)) { - return true; - } - var ident = this.input.slice(next, pos); - if (!keywordRelationalOperator.test(ident)) { - return true; - } - } - return false; -}; -pp$8.isAsyncFunction = function () { - if (this.options.ecmaVersion < 8 || !this.isContextual('async')) { - return false; - } - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, - after; - return ( - !lineBreak.test(this.input.slice(this.pos, next)) && - this.input.slice(next, next + 8) === 'function' && - (next + 8 === this.input.length || - !( - isIdentifierChar((after = this.input.charCodeAt(next + 8))) || - (after > 55295 && after < 56320) - )) - ); -}; -pp$8.parseStatement = function (context, topLevel, exports) { - var starttype = this.type, - node = this.startNode(), - kind; - if (this.isLet(context)) { - starttype = types$1._var; - kind = 'let'; - } - switch (starttype) { - case types$1._break: - case types$1._continue: - return this.parseBreakContinueStatement(node, starttype.keyword); - case types$1._debugger: - return this.parseDebuggerStatement(node); - case types$1._do: - return this.parseDoStatement(node); - case types$1._for: - return this.parseForStatement(node); - case types$1._function: - if ( - context && - (this.strict || (context !== 'if' && context !== 'label')) && - this.options.ecmaVersion >= 6 - ) { - this.unexpected(); - } - return this.parseFunctionStatement(node, false, !context); - case types$1._class: - if (context) { - this.unexpected(); - } - return this.parseClass(node, true); - case types$1._if: - return this.parseIfStatement(node); - case types$1._return: - return this.parseReturnStatement(node); - case types$1._switch: - return this.parseSwitchStatement(node); - case types$1._throw: - return this.parseThrowStatement(node); - case types$1._try: - return this.parseTryStatement(node); - case types$1._const: - case types$1._var: - kind = kind || this.value; - if (context && kind !== 'var') { - this.unexpected(); - } - return this.parseVarStatement(node, kind); - case types$1._while: - return this.parseWhileStatement(node); - case types$1._with: - return this.parseWithStatement(node); - case types$1.braceL: - return this.parseBlock(true, node); - case types$1.semi: - return this.parseEmptyStatement(node); - case types$1._export: - case types$1._import: - if (this.options.ecmaVersion > 10 && starttype === types$1._import) { - skipWhiteSpace.lastIndex = this.pos; - var skip = skipWhiteSpace.exec(this.input); - var next = this.pos + skip[0].length, - nextCh = this.input.charCodeAt(next); - if (nextCh === 40 || nextCh === 46) { - return this.parseExpressionStatement(node, this.parseExpression()); - } - } - if (!this.options.allowImportExportEverywhere) { - if (!topLevel) { - this.raise( - this.start, - "'import' and 'export' may only appear at the top level", - ); - } - if (!this.inModule) { - this.raise( - this.start, - "'import' and 'export' may appear only with 'sourceType: module'", - ); - } - } - return starttype === types$1._import - ? this.parseImport(node) - : this.parseExport(node, exports); - default: - if (this.isAsyncFunction()) { - if (context) { - this.unexpected(); - } - this.next(); - return this.parseFunctionStatement(node, true, !context); - } - var maybeName = this.value, - expr = this.parseExpression(); - if ( - starttype === types$1.name && - expr.type === 'Identifier' && - this.eat(types$1.colon) - ) { - return this.parseLabeledStatement(node, maybeName, expr, context); - } else { - return this.parseExpressionStatement(node, expr); - } - } -}; -pp$8.parseBreakContinueStatement = function (node, keyword) { - var isBreak = keyword === 'break'; - this.next(); - if (this.eat(types$1.semi) || this.insertSemicolon()) { - node.label = null; - } else if (this.type !== types$1.name) { - this.unexpected(); - } else { - node.label = this.parseIdent(); - this.semicolon(); - } - var i = 0; - for (; i < this.labels.length; ++i) { - var lab = this.labels[i]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === 'loop')) { - break; - } - if (node.label && isBreak) { - break; - } - } - } - if (i === this.labels.length) { - this.raise(node.start, 'Unsyntactic ' + keyword); - } - return this.finishNode( - node, - isBreak ? 'BreakStatement' : 'ContinueStatement', - ); -}; -pp$8.parseDebuggerStatement = function (node) { - this.next(); - this.semicolon(); - return this.finishNode(node, 'DebuggerStatement'); -}; -pp$8.parseDoStatement = function (node) { - this.next(); - this.labels.push(loopLabel); - node.body = this.parseStatement('do'); - this.labels.pop(); - this.expect(types$1._while); - node.test = this.parseParenExpression(); - if (this.options.ecmaVersion >= 6) { - this.eat(types$1.semi); - } else { - this.semicolon(); - } - return this.finishNode(node, 'DoWhileStatement'); -}; -pp$8.parseForStatement = function (node) { - this.next(); - var awaitAt = - this.options.ecmaVersion >= 9 && - this.canAwait && - this.eatContextual('await') - ? this.lastTokStart - : -1; - this.labels.push(loopLabel); - this.enterScope(0); - this.expect(types$1.parenL); - if (this.type === types$1.semi) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - return this.parseFor(node, null); - } - var isLet = this.isLet(); - if (this.type === types$1._var || this.type === types$1._const || isLet) { - var init$1 = this.startNode(), - kind = isLet ? 'let' : this.value; - this.next(); - this.parseVar(init$1, true, kind); - this.finishNode(init$1, 'VariableDeclaration'); - if ( - (this.type === types$1._in || - (this.options.ecmaVersion >= 6 && this.isContextual('of'))) && - init$1.declarations.length === 1 - ) { - if (this.options.ecmaVersion >= 9) { - if (this.type === types$1._in) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - } else { - node.await = awaitAt > -1; - } - } - return this.parseForIn(node, init$1); - } - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - return this.parseFor(node, init$1); - } - var startsWithLet = this.isContextual('let'), - isForOf = false; - var refDestructuringErrors = new DestructuringErrors(); - var init = this.parseExpression( - awaitAt > -1 ? 'await' : true, - refDestructuringErrors, - ); - if ( - this.type === types$1._in || - (isForOf = this.options.ecmaVersion >= 6 && this.isContextual('of')) - ) { - if (this.options.ecmaVersion >= 9) { - if (this.type === types$1._in) { - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - } else { - node.await = awaitAt > -1; - } - } - if (startsWithLet && isForOf) { - this.raise( - init.start, - "The left-hand side of a for-of loop may not start with 'let'.", - ); - } - this.toAssignable(init, false, refDestructuringErrors); - this.checkLValPattern(init); - return this.parseForIn(node, init); - } else { - this.checkExpressionErrors(refDestructuringErrors, true); - } - if (awaitAt > -1) { - this.unexpected(awaitAt); - } - return this.parseFor(node, init); -}; -pp$8.parseFunctionStatement = function (node, isAsync, declarationPosition) { - this.next(); - return this.parseFunction( - node, - FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), - false, - isAsync, - ); -}; -pp$8.parseIfStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - node.consequent = this.parseStatement('if'); - node.alternate = this.eat(types$1._else) ? this.parseStatement('if') : null; - return this.finishNode(node, 'IfStatement'); -}; -pp$8.parseReturnStatement = function (node) { - if (!this.inFunction && !this.options.allowReturnOutsideFunction) { - this.raise(this.start, "'return' outside of function"); - } - this.next(); - if (this.eat(types$1.semi) || this.insertSemicolon()) { - node.argument = null; - } else { - node.argument = this.parseExpression(); - this.semicolon(); - } - return this.finishNode(node, 'ReturnStatement'); -}; -pp$8.parseSwitchStatement = function (node) { - this.next(); - node.discriminant = this.parseParenExpression(); - node.cases = []; - this.expect(types$1.braceL); - this.labels.push(switchLabel); - this.enterScope(0); - var cur; - for (var sawDefault = false; this.type !== types$1.braceR; ) { - if (this.type === types$1._case || this.type === types$1._default) { - var isCase = this.type === types$1._case; - if (cur) { - this.finishNode(cur, 'SwitchCase'); - } - node.cases.push((cur = this.startNode())); - cur.consequent = []; - this.next(); - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) { - this.raiseRecoverable(this.lastTokStart, 'Multiple default clauses'); - } - sawDefault = true; - cur.test = null; - } - this.expect(types$1.colon); - } else { - if (!cur) { - this.unexpected(); - } - cur.consequent.push(this.parseStatement(null)); - } - } - this.exitScope(); - if (cur) { - this.finishNode(cur, 'SwitchCase'); - } - this.next(); - this.labels.pop(); - return this.finishNode(node, 'SwitchStatement'); -}; -pp$8.parseThrowStatement = function (node) { - this.next(); - if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { - this.raise(this.lastTokEnd, 'Illegal newline after throw'); - } - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, 'ThrowStatement'); -}; -var empty$1 = []; -pp$8.parseTryStatement = function (node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - if (this.type === types$1._catch) { - var clause = this.startNode(); - this.next(); - if (this.eat(types$1.parenL)) { - clause.param = this.parseBindingAtom(); - var simple = clause.param.type === 'Identifier'; - this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); - this.checkLValPattern( - clause.param, - simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL, - ); - this.expect(types$1.parenR); - } else { - if (this.options.ecmaVersion < 10) { - this.unexpected(); - } - clause.param = null; - this.enterScope(0); - } - clause.body = this.parseBlock(false); - this.exitScope(); - node.handler = this.finishNode(clause, 'CatchClause'); - } - node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; - if (!node.handler && !node.finalizer) { - this.raise(node.start, 'Missing catch or finally clause'); - } - return this.finishNode(node, 'TryStatement'); -}; -pp$8.parseVarStatement = function (node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, 'VariableDeclaration'); -}; -pp$8.parseWhileStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - this.labels.push(loopLabel); - node.body = this.parseStatement('while'); - this.labels.pop(); - return this.finishNode(node, 'WhileStatement'); -}; -pp$8.parseWithStatement = function (node) { - if (this.strict) { - this.raise(this.start, "'with' in strict mode"); - } - this.next(); - node.object = this.parseParenExpression(); - node.body = this.parseStatement('with'); - return this.finishNode(node, 'WithStatement'); -}; -pp$8.parseEmptyStatement = function (node) { - this.next(); - return this.finishNode(node, 'EmptyStatement'); -}; -pp$8.parseLabeledStatement = function (node, maybeName, expr, context) { - for (var i$1 = 0, list3 = this.labels; i$1 < list3.length; i$1 += 1) { - var label = list3[i$1]; - if (label.name === maybeName) { - this.raise(expr.start, "Label '" + maybeName + "' is already declared"); - } - } - var kind = this.type.isLoop - ? 'loop' - : this.type === types$1._switch - ? 'switch' - : null; - for (var i = this.labels.length - 1; i >= 0; i--) { - var label$1 = this.labels[i]; - if (label$1.statementStart === node.start) { - label$1.statementStart = this.start; - label$1.kind = kind; - } else { - break; - } - } - this.labels.push({name: maybeName, kind, statementStart: this.start}); - node.body = this.parseStatement( - context - ? context.indexOf('label') === -1 - ? context + 'label' - : context - : 'label', - ); - this.labels.pop(); - node.label = expr; - return this.finishNode(node, 'LabeledStatement'); -}; -pp$8.parseExpressionStatement = function (node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, 'ExpressionStatement'); -}; -pp$8.parseBlock = function (createNewLexicalScope, node, exitStrict) { - if (createNewLexicalScope === void 0) createNewLexicalScope = true; - if (node === void 0) node = this.startNode(); - node.body = []; - this.expect(types$1.braceL); - if (createNewLexicalScope) { - this.enterScope(0); - } - while (this.type !== types$1.braceR) { - var stmt = this.parseStatement(null); - node.body.push(stmt); - } - if (exitStrict) { - this.strict = false; - } - this.next(); - if (createNewLexicalScope) { - this.exitScope(); - } - return this.finishNode(node, 'BlockStatement'); -}; -pp$8.parseFor = function (node, init) { - node.init = init; - this.expect(types$1.semi); - node.test = this.type === types$1.semi ? null : this.parseExpression(); - this.expect(types$1.semi); - node.update = this.type === types$1.parenR ? null : this.parseExpression(); - this.expect(types$1.parenR); - node.body = this.parseStatement('for'); - this.exitScope(); - this.labels.pop(); - return this.finishNode(node, 'ForStatement'); -}; -pp$8.parseForIn = function (node, init) { - var isForIn = this.type === types$1._in; - this.next(); - if ( - init.type === 'VariableDeclaration' && - init.declarations[0].init != null && - (!isForIn || - this.options.ecmaVersion < 8 || - this.strict || - init.kind !== 'var' || - init.declarations[0].id.type !== 'Identifier') - ) { - this.raise( - init.start, - (isForIn ? 'for-in' : 'for-of') + - ' loop variable declaration may not have an initializer', - ); - } - node.left = init; - node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); - this.expect(types$1.parenR); - node.body = this.parseStatement('for'); - this.exitScope(); - this.labels.pop(); - return this.finishNode(node, isForIn ? 'ForInStatement' : 'ForOfStatement'); -}; -pp$8.parseVar = function (node, isFor, kind) { - node.declarations = []; - node.kind = kind; - for (;;) { - var decl = this.startNode(); - this.parseVarId(decl, kind); - if (this.eat(types$1.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else if ( - kind === 'const' && - !( - this.type === types$1._in || - (this.options.ecmaVersion >= 6 && this.isContextual('of')) - ) - ) { - this.unexpected(); - } else if ( - decl.id.type !== 'Identifier' && - !(isFor && (this.type === types$1._in || this.isContextual('of'))) - ) { - this.raise( - this.lastTokEnd, - 'Complex binding patterns require an initialization value', - ); - } else { - decl.init = null; - } - node.declarations.push(this.finishNode(decl, 'VariableDeclarator')); - if (!this.eat(types$1.comma)) { - break; - } - } - return node; -}; -pp$8.parseVarId = function (decl, kind) { - decl.id = this.parseBindingAtom(); - this.checkLValPattern( - decl.id, - kind === 'var' ? BIND_VAR : BIND_LEXICAL, - false, - ); -}; -var FUNC_STATEMENT = 1; -var FUNC_HANGING_STATEMENT = 2; -var FUNC_NULLABLE_ID = 4; -pp$8.parseFunction = function ( - node, - statement, - allowExpressionBody, - isAsync, - forInit, -) { - this.initFunction(node); - if ( - this.options.ecmaVersion >= 9 || - (this.options.ecmaVersion >= 6 && !isAsync) - ) { - if (this.type === types$1.star && statement & FUNC_HANGING_STATEMENT) { - this.unexpected(); - } - node.generator = this.eat(types$1.star); - } - if (this.options.ecmaVersion >= 8) { - node.async = !!isAsync; - } - if (statement & FUNC_STATEMENT) { - node.id = - statement & FUNC_NULLABLE_ID && this.type !== types$1.name - ? null - : this.parseIdent(); - if (node.id && !(statement & FUNC_HANGING_STATEMENT)) { - this.checkLValSimple( - node.id, - this.strict || node.generator || node.async - ? this.treatFunctionsAsVar - ? BIND_VAR - : BIND_LEXICAL - : BIND_FUNCTION, - ); - } - } - var oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope(functionFlags(node.async, node.generator)); - if (!(statement & FUNC_STATEMENT)) { - node.id = this.type === types$1.name ? this.parseIdent() : null; - } - this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody, false, forInit); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode( - node, - statement & FUNC_STATEMENT ? 'FunctionDeclaration' : 'FunctionExpression', - ); -}; -pp$8.parseFunctionParams = function (node) { - this.expect(types$1.parenL); - node.params = this.parseBindingList( - types$1.parenR, - false, - this.options.ecmaVersion >= 8, - ); - this.checkYieldAwaitInDefaultParams(); -}; -pp$8.parseClass = function (node, isStatement) { - this.next(); - var oldStrict = this.strict; - this.strict = true; - this.parseClassId(node, isStatement); - this.parseClassSuper(node); - var privateNameMap = this.enterClassBody(); - var classBody = this.startNode(); - var hadConstructor = false; - classBody.body = []; - this.expect(types$1.braceL); - while (this.type !== types$1.braceR) { - var element2 = this.parseClassElement(node.superClass !== null); - if (element2) { - classBody.body.push(element2); - if ( - element2.type === 'MethodDefinition' && - element2.kind === 'constructor' - ) { - if (hadConstructor) { - this.raise(element2.start, 'Duplicate constructor in the same class'); - } - hadConstructor = true; - } else if ( - element2.key && - element2.key.type === 'PrivateIdentifier' && - isPrivateNameConflicted(privateNameMap, element2) - ) { - this.raiseRecoverable( - element2.key.start, - "Identifier '#" + element2.key.name + "' has already been declared", - ); - } - } - } - this.strict = oldStrict; - this.next(); - node.body = this.finishNode(classBody, 'ClassBody'); - this.exitClassBody(); - return this.finishNode( - node, - isStatement ? 'ClassDeclaration' : 'ClassExpression', - ); -}; -pp$8.parseClassElement = function (constructorAllowsSuper) { - if (this.eat(types$1.semi)) { - return null; - } - var ecmaVersion = this.options.ecmaVersion; - var node = this.startNode(); - var keyName = ''; - var isGenerator = false; - var isAsync = false; - var kind = 'method'; - var isStatic = false; - if (this.eatContextual('static')) { - if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { - this.parseClassStaticBlock(node); - return node; - } - if (this.isClassElementNameStart() || this.type === types$1.star) { - isStatic = true; - } else { - keyName = 'static'; - } - } - node.static = isStatic; - if (!keyName && ecmaVersion >= 8 && this.eatContextual('async')) { - if ( - (this.isClassElementNameStart() || this.type === types$1.star) && - !this.canInsertSemicolon() - ) { - isAsync = true; - } else { - keyName = 'async'; - } - } - if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { - isGenerator = true; - } - if (!keyName && !isAsync && !isGenerator) { - var lastValue = this.value; - if (this.eatContextual('get') || this.eatContextual('set')) { - if (this.isClassElementNameStart()) { - kind = lastValue; - } else { - keyName = lastValue; - } - } - } - if (keyName) { - node.computed = false; - node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); - node.key.name = keyName; - this.finishNode(node.key, 'Identifier'); - } else { - this.parseClassElementName(node); - } - if ( - ecmaVersion < 13 || - this.type === types$1.parenL || - kind !== 'method' || - isGenerator || - isAsync - ) { - var isConstructor = !node.static && checkKeyName(node, 'constructor'); - var allowsDirectSuper = isConstructor && constructorAllowsSuper; - if (isConstructor && kind !== 'method') { - this.raise(node.key.start, "Constructor can't have get/set modifier"); - } - node.kind = isConstructor ? 'constructor' : kind; - this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); - } else { - this.parseClassField(node); - } - return node; -}; -pp$8.isClassElementNameStart = function () { - return ( - this.type === types$1.name || - this.type === types$1.privateId || - this.type === types$1.num || - this.type === types$1.string || - this.type === types$1.bracketL || - this.type.keyword - ); -}; -pp$8.parseClassElementName = function (element2) { - if (this.type === types$1.privateId) { - if (this.value === 'constructor') { - this.raise( - this.start, - "Classes can't have an element named '#constructor'", - ); - } - element2.computed = false; - element2.key = this.parsePrivateIdent(); - } else { - this.parsePropertyName(element2); - } -}; -pp$8.parseClassMethod = function ( - method, - isGenerator, - isAsync, - allowsDirectSuper, -) { - var key = method.key; - if (method.kind === 'constructor') { - if (isGenerator) { - this.raise(key.start, "Constructor can't be a generator"); - } - if (isAsync) { - this.raise(key.start, "Constructor can't be an async method"); - } - } else if (method.static && checkKeyName(method, 'prototype')) { - this.raise( - key.start, - 'Classes may not have a static property named prototype', - ); - } - var value = (method.value = this.parseMethod( - isGenerator, - isAsync, - allowsDirectSuper, - )); - if (method.kind === 'get' && value.params.length !== 0) { - this.raiseRecoverable(value.start, 'getter should have no params'); - } - if (method.kind === 'set' && value.params.length !== 1) { - this.raiseRecoverable(value.start, 'setter should have exactly one param'); - } - if (method.kind === 'set' && value.params[0].type === 'RestElement') { - this.raiseRecoverable( - value.params[0].start, - 'Setter cannot use rest params', - ); - } - return this.finishNode(method, 'MethodDefinition'); -}; -pp$8.parseClassField = function (field) { - if (checkKeyName(field, 'constructor')) { - this.raise( - field.key.start, - "Classes can't have a field named 'constructor'", - ); - } else if (field.static && checkKeyName(field, 'prototype')) { - this.raise( - field.key.start, - "Classes can't have a static field named 'prototype'", - ); - } - if (this.eat(types$1.eq)) { - var scope = this.currentThisScope(); - var inClassFieldInit = scope.inClassFieldInit; - scope.inClassFieldInit = true; - field.value = this.parseMaybeAssign(); - scope.inClassFieldInit = inClassFieldInit; - } else { - field.value = null; - } - this.semicolon(); - return this.finishNode(field, 'PropertyDefinition'); -}; -pp$8.parseClassStaticBlock = function (node) { - node.body = []; - var oldLabels = this.labels; - this.labels = []; - this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); - while (this.type !== types$1.braceR) { - var stmt = this.parseStatement(null); - node.body.push(stmt); - } - this.next(); - this.exitScope(); - this.labels = oldLabels; - return this.finishNode(node, 'StaticBlock'); -}; -pp$8.parseClassId = function (node, isStatement) { - if (this.type === types$1.name) { - node.id = this.parseIdent(); - if (isStatement) { - this.checkLValSimple(node.id, BIND_LEXICAL, false); - } - } else { - if (isStatement === true) { - this.unexpected(); - } - node.id = null; - } -}; -pp$8.parseClassSuper = function (node) { - node.superClass = this.eat(types$1._extends) - ? this.parseExprSubscripts(false) - : null; -}; -pp$8.enterClassBody = function () { - var element2 = {declared: /* @__PURE__ */ Object.create(null), used: []}; - this.privateNameStack.push(element2); - return element2.declared; -}; -pp$8.exitClassBody = function () { - var ref2 = this.privateNameStack.pop(); - var declared = ref2.declared; - var used = ref2.used; - var len = this.privateNameStack.length; - var parent = len === 0 ? null : this.privateNameStack[len - 1]; - for (var i = 0; i < used.length; ++i) { - var id = used[i]; - if (!hasOwn(declared, id.name)) { - if (parent) { - parent.used.push(id); - } else { - this.raiseRecoverable( - id.start, - "Private field '#" + - id.name + - "' must be declared in an enclosing class", - ); - } - } - } -}; -function isPrivateNameConflicted(privateNameMap, element2) { - var name2 = element2.key.name; - var curr = privateNameMap[name2]; - var next = 'true'; - if ( - element2.type === 'MethodDefinition' && - (element2.kind === 'get' || element2.kind === 'set') - ) { - next = (element2.static ? 's' : 'i') + element2.kind; - } - if ( - (curr === 'iget' && next === 'iset') || - (curr === 'iset' && next === 'iget') || - (curr === 'sget' && next === 'sset') || - (curr === 'sset' && next === 'sget') - ) { - privateNameMap[name2] = 'true'; - return false; - } else if (!curr) { - privateNameMap[name2] = next; - return false; - } else { - return true; - } -} -function checkKeyName(node, name2) { - var computed = node.computed; - var key = node.key; - return ( - !computed && - ((key.type === 'Identifier' && key.name === name2) || - (key.type === 'Literal' && key.value === name2)) - ); -} -pp$8.parseExport = function (node, exports) { - this.next(); - if (this.eat(types$1.star)) { - if (this.options.ecmaVersion >= 11) { - if (this.eatContextual('as')) { - node.exported = this.parseModuleExportName(); - this.checkExport(exports, node.exported, this.lastTokStart); - } else { - node.exported = null; - } - } - this.expectContextual('from'); - if (this.type !== types$1.string) { - this.unexpected(); - } - node.source = this.parseExprAtom(); - this.semicolon(); - return this.finishNode(node, 'ExportAllDeclaration'); - } - if (this.eat(types$1._default)) { - this.checkExport(exports, 'default', this.lastTokStart); - var isAsync; - if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { - var fNode = this.startNode(); - this.next(); - if (isAsync) { - this.next(); - } - node.declaration = this.parseFunction( - fNode, - FUNC_STATEMENT | FUNC_NULLABLE_ID, - false, - isAsync, - ); - } else if (this.type === types$1._class) { - var cNode = this.startNode(); - node.declaration = this.parseClass(cNode, 'nullableID'); - } else { - node.declaration = this.parseMaybeAssign(); - this.semicolon(); - } - return this.finishNode(node, 'ExportDefaultDeclaration'); - } - if (this.shouldParseExportStatement()) { - node.declaration = this.parseStatement(null); - if (node.declaration.type === 'VariableDeclaration') { - this.checkVariableExport(exports, node.declaration.declarations); - } else { - this.checkExport(exports, node.declaration.id, node.declaration.id.start); - } - node.specifiers = []; - node.source = null; - } else { - node.declaration = null; - node.specifiers = this.parseExportSpecifiers(exports); - if (this.eatContextual('from')) { - if (this.type !== types$1.string) { - this.unexpected(); - } - node.source = this.parseExprAtom(); - } else { - for (var i = 0, list3 = node.specifiers; i < list3.length; i += 1) { - var spec = list3[i]; - this.checkUnreserved(spec.local); - this.checkLocalExport(spec.local); - if (spec.local.type === 'Literal') { - this.raise( - spec.local.start, - 'A string literal cannot be used as an exported binding without `from`.', - ); - } - } - node.source = null; - } - this.semicolon(); - } - return this.finishNode(node, 'ExportNamedDeclaration'); -}; -pp$8.checkExport = function (exports, name2, pos) { - if (!exports) { - return; - } - if (typeof name2 !== 'string') { - name2 = name2.type === 'Identifier' ? name2.name : name2.value; - } - if (hasOwn(exports, name2)) { - this.raiseRecoverable(pos, "Duplicate export '" + name2 + "'"); - } - exports[name2] = true; -}; -pp$8.checkPatternExport = function (exports, pat) { - var type = pat.type; - if (type === 'Identifier') { - this.checkExport(exports, pat, pat.start); - } else if (type === 'ObjectPattern') { - for (var i = 0, list3 = pat.properties; i < list3.length; i += 1) { - var prop = list3[i]; - this.checkPatternExport(exports, prop); - } - } else if (type === 'ArrayPattern') { - for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { - var elt = list$1[i$1]; - if (elt) { - this.checkPatternExport(exports, elt); - } - } - } else if (type === 'Property') { - this.checkPatternExport(exports, pat.value); - } else if (type === 'AssignmentPattern') { - this.checkPatternExport(exports, pat.left); - } else if (type === 'RestElement') { - this.checkPatternExport(exports, pat.argument); - } else if (type === 'ParenthesizedExpression') { - this.checkPatternExport(exports, pat.expression); - } -}; -pp$8.checkVariableExport = function (exports, decls) { - if (!exports) { - return; - } - for (var i = 0, list3 = decls; i < list3.length; i += 1) { - var decl = list3[i]; - this.checkPatternExport(exports, decl.id); - } -}; -pp$8.shouldParseExportStatement = function () { - return ( - this.type.keyword === 'var' || - this.type.keyword === 'const' || - this.type.keyword === 'class' || - this.type.keyword === 'function' || - this.isLet() || - this.isAsyncFunction() - ); -}; -pp$8.parseExportSpecifiers = function (exports) { - var nodes = [], - first = true; - this.expect(types$1.braceL); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.afterTrailingComma(types$1.braceR)) { - break; - } - } else { - first = false; - } - var node = this.startNode(); - node.local = this.parseModuleExportName(); - node.exported = this.eatContextual('as') - ? this.parseModuleExportName() - : node.local; - this.checkExport(exports, node.exported, node.exported.start); - nodes.push(this.finishNode(node, 'ExportSpecifier')); - } - return nodes; -}; -pp$8.parseImport = function (node) { - this.next(); - if (this.type === types$1.string) { - node.specifiers = empty$1; - node.source = this.parseExprAtom(); - } else { - node.specifiers = this.parseImportSpecifiers(); - this.expectContextual('from'); - node.source = - this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); - } - this.semicolon(); - return this.finishNode(node, 'ImportDeclaration'); -}; -pp$8.parseImportSpecifiers = function () { - var nodes = [], - first = true; - if (this.type === types$1.name) { - var node = this.startNode(); - node.local = this.parseIdent(); - this.checkLValSimple(node.local, BIND_LEXICAL); - nodes.push(this.finishNode(node, 'ImportDefaultSpecifier')); - if (!this.eat(types$1.comma)) { - return nodes; - } - } - if (this.type === types$1.star) { - var node$1 = this.startNode(); - this.next(); - this.expectContextual('as'); - node$1.local = this.parseIdent(); - this.checkLValSimple(node$1.local, BIND_LEXICAL); - nodes.push(this.finishNode(node$1, 'ImportNamespaceSpecifier')); - return nodes; - } - this.expect(types$1.braceL); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if (this.afterTrailingComma(types$1.braceR)) { - break; - } - } else { - first = false; - } - var node$2 = this.startNode(); - node$2.imported = this.parseModuleExportName(); - if (this.eatContextual('as')) { - node$2.local = this.parseIdent(); - } else { - this.checkUnreserved(node$2.imported); - node$2.local = node$2.imported; - } - this.checkLValSimple(node$2.local, BIND_LEXICAL); - nodes.push(this.finishNode(node$2, 'ImportSpecifier')); - } - return nodes; -}; -pp$8.parseModuleExportName = function () { - if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { - var stringLiteral = this.parseLiteral(this.value); - if (loneSurrogate.test(stringLiteral.value)) { - this.raise( - stringLiteral.start, - 'An export name cannot include a lone surrogate.', - ); - } - return stringLiteral; - } - return this.parseIdent(true); -}; -pp$8.adaptDirectivePrologue = function (statements) { - for ( - var i = 0; - i < statements.length && this.isDirectiveCandidate(statements[i]); - ++i - ) { - statements[i].directive = statements[i].expression.raw.slice(1, -1); - } -}; -pp$8.isDirectiveCandidate = function (statement) { - return ( - this.options.ecmaVersion >= 5 && - statement.type === 'ExpressionStatement' && - statement.expression.type === 'Literal' && - typeof statement.expression.value === 'string' && - (this.input[statement.start] === '"' || this.input[statement.start] === "'") - ); -}; -var pp$7 = Parser.prototype; -pp$7.toAssignable = function (node, isBinding, refDestructuringErrors) { - if (this.options.ecmaVersion >= 6 && node) { - switch (node.type) { - case 'Identifier': - if (this.inAsync && node.name === 'await') { - this.raise( - node.start, - "Cannot use 'await' as identifier inside an async function", - ); - } - break; - case 'ObjectPattern': - case 'ArrayPattern': - case 'AssignmentPattern': - case 'RestElement': - break; - case 'ObjectExpression': - node.type = 'ObjectPattern'; - if (refDestructuringErrors) { - this.checkPatternErrors(refDestructuringErrors, true); - } - for (var i = 0, list3 = node.properties; i < list3.length; i += 1) { - var prop = list3[i]; - this.toAssignable(prop, isBinding); - if ( - prop.type === 'RestElement' && - (prop.argument.type === 'ArrayPattern' || - prop.argument.type === 'ObjectPattern') - ) { - this.raise(prop.argument.start, 'Unexpected token'); - } - } - break; - case 'Property': - if (node.kind !== 'init') { - this.raise( - node.key.start, - "Object pattern can't contain getter or setter", - ); - } - this.toAssignable(node.value, isBinding); - break; - case 'ArrayExpression': - node.type = 'ArrayPattern'; - if (refDestructuringErrors) { - this.checkPatternErrors(refDestructuringErrors, true); - } - this.toAssignableList(node.elements, isBinding); - break; - case 'SpreadElement': - node.type = 'RestElement'; - this.toAssignable(node.argument, isBinding); - if (node.argument.type === 'AssignmentPattern') { - this.raise( - node.argument.start, - 'Rest elements cannot have a default value', - ); - } - break; - case 'AssignmentExpression': - if (node.operator !== '=') { - this.raise( - node.left.end, - "Only '=' operator can be used for specifying default value.", - ); - } - node.type = 'AssignmentPattern'; - delete node.operator; - this.toAssignable(node.left, isBinding); - break; - case 'ParenthesizedExpression': - this.toAssignable(node.expression, isBinding, refDestructuringErrors); - break; - case 'ChainExpression': - this.raiseRecoverable( - node.start, - 'Optional chaining cannot appear in left-hand side', - ); - break; - case 'MemberExpression': - if (!isBinding) { - break; - } - default: - this.raise(node.start, 'Assigning to rvalue'); - } - } else if (refDestructuringErrors) { - this.checkPatternErrors(refDestructuringErrors, true); - } - return node; -}; -pp$7.toAssignableList = function (exprList, isBinding) { - var end = exprList.length; - for (var i = 0; i < end; i++) { - var elt = exprList[i]; - if (elt) { - this.toAssignable(elt, isBinding); - } - } - if (end) { - var last = exprList[end - 1]; - if ( - this.options.ecmaVersion === 6 && - isBinding && - last && - last.type === 'RestElement' && - last.argument.type !== 'Identifier' - ) { - this.unexpected(last.argument.start); - } - } - return exprList; -}; -pp$7.parseSpread = function (refDestructuringErrors) { - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(false, refDestructuringErrors); - return this.finishNode(node, 'SpreadElement'); -}; -pp$7.parseRestBinding = function () { - var node = this.startNode(); - this.next(); - if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { - this.unexpected(); - } - node.argument = this.parseBindingAtom(); - return this.finishNode(node, 'RestElement'); -}; -pp$7.parseBindingAtom = function () { - if (this.options.ecmaVersion >= 6) { - switch (this.type) { - case types$1.bracketL: - var node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(types$1.bracketR, true, true); - return this.finishNode(node, 'ArrayPattern'); - case types$1.braceL: - return this.parseObj(true); - } - } - return this.parseIdent(); -}; -pp$7.parseBindingList = function (close, allowEmpty, allowTrailingComma) { - var elts = [], - first = true; - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(types$1.comma); - } - if (allowEmpty && this.type === types$1.comma) { - elts.push(null); - } else if (allowTrailingComma && this.afterTrailingComma(close)) { - break; - } else if (this.type === types$1.ellipsis) { - var rest = this.parseRestBinding(); - this.parseBindingListItem(rest); - elts.push(rest); - if (this.type === types$1.comma) { - this.raise(this.start, 'Comma is not permitted after the rest element'); - } - this.expect(close); - break; - } else { - var elem = this.parseMaybeDefault(this.start, this.startLoc); - this.parseBindingListItem(elem); - elts.push(elem); - } - } - return elts; -}; -pp$7.parseBindingListItem = function (param) { - return param; -}; -pp$7.parseMaybeDefault = function (startPos, startLoc, left) { - left = left || this.parseBindingAtom(); - if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { - return left; - } - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.right = this.parseMaybeAssign(); - return this.finishNode(node, 'AssignmentPattern'); -}; -pp$7.checkLValSimple = function (expr, bindingType, checkClashes) { - if (bindingType === void 0) bindingType = BIND_NONE; - var isBind = bindingType !== BIND_NONE; - switch (expr.type) { - case 'Identifier': - if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { - this.raiseRecoverable( - expr.start, - (isBind ? 'Binding ' : 'Assigning to ') + - expr.name + - ' in strict mode', - ); - } - if (isBind) { - if (bindingType === BIND_LEXICAL && expr.name === 'let') { - this.raiseRecoverable( - expr.start, - 'let is disallowed as a lexically bound name', - ); - } - if (checkClashes) { - if (hasOwn(checkClashes, expr.name)) { - this.raiseRecoverable(expr.start, 'Argument name clash'); - } - checkClashes[expr.name] = true; - } - if (bindingType !== BIND_OUTSIDE) { - this.declareName(expr.name, bindingType, expr.start); - } - } - break; - case 'ChainExpression': - this.raiseRecoverable( - expr.start, - 'Optional chaining cannot appear in left-hand side', - ); - break; - case 'MemberExpression': - if (isBind) { - this.raiseRecoverable(expr.start, 'Binding member expression'); - } - break; - case 'ParenthesizedExpression': - if (isBind) { - this.raiseRecoverable(expr.start, 'Binding parenthesized expression'); - } - return this.checkLValSimple(expr.expression, bindingType, checkClashes); - default: - this.raise(expr.start, (isBind ? 'Binding' : 'Assigning to') + ' rvalue'); - } -}; -pp$7.checkLValPattern = function (expr, bindingType, checkClashes) { - if (bindingType === void 0) bindingType = BIND_NONE; - switch (expr.type) { - case 'ObjectPattern': - for (var i = 0, list3 = expr.properties; i < list3.length; i += 1) { - var prop = list3[i]; - this.checkLValInnerPattern(prop, bindingType, checkClashes); - } - break; - case 'ArrayPattern': - for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { - var elem = list$1[i$1]; - if (elem) { - this.checkLValInnerPattern(elem, bindingType, checkClashes); - } - } - break; - default: - this.checkLValSimple(expr, bindingType, checkClashes); - } -}; -pp$7.checkLValInnerPattern = function (expr, bindingType, checkClashes) { - if (bindingType === void 0) bindingType = BIND_NONE; - switch (expr.type) { - case 'Property': - this.checkLValInnerPattern(expr.value, bindingType, checkClashes); - break; - case 'AssignmentPattern': - this.checkLValPattern(expr.left, bindingType, checkClashes); - break; - case 'RestElement': - this.checkLValPattern(expr.argument, bindingType, checkClashes); - break; - default: - this.checkLValPattern(expr, bindingType, checkClashes); - } -}; -var TokContext = function TokContext2( - token, - isExpr, - preserveSpace, - override, - generator, -) { - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; - this.generator = !!generator; -}; -var types = { - b_stat: new TokContext('{', false), - b_expr: new TokContext('{', true), - b_tmpl: new TokContext('${', false), - p_stat: new TokContext('(', false), - p_expr: new TokContext('(', true), - q_tmpl: new TokContext('`', true, true, function (p) { - return p.tryReadTemplateToken(); - }), - f_stat: new TokContext('function', false), - f_expr: new TokContext('function', true), - f_expr_gen: new TokContext('function', true, false, null, true), - f_gen: new TokContext('function', false, false, null, true), -}; -var pp$6 = Parser.prototype; -pp$6.initialContext = function () { - return [types.b_stat]; -}; -pp$6.curContext = function () { - return this.context[this.context.length - 1]; -}; -pp$6.braceIsBlock = function (prevType) { - var parent = this.curContext(); - if (parent === types.f_expr || parent === types.f_stat) { - return true; - } - if ( - prevType === types$1.colon && - (parent === types.b_stat || parent === types.b_expr) - ) { - return !parent.isExpr; - } - if ( - prevType === types$1._return || - (prevType === types$1.name && this.exprAllowed) - ) { - return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); - } - if ( - prevType === types$1._else || - prevType === types$1.semi || - prevType === types$1.eof || - prevType === types$1.parenR || - prevType === types$1.arrow - ) { - return true; - } - if (prevType === types$1.braceL) { - return parent === types.b_stat; - } - if ( - prevType === types$1._var || - prevType === types$1._const || - prevType === types$1.name - ) { - return false; - } - return !this.exprAllowed; -}; -pp$6.inGeneratorContext = function () { - for (var i = this.context.length - 1; i >= 1; i--) { - var context = this.context[i]; - if (context.token === 'function') { - return context.generator; - } - } - return false; -}; -pp$6.updateContext = function (prevType) { - var update, - type = this.type; - if (type.keyword && prevType === types$1.dot) { - this.exprAllowed = false; - } else if ((update = type.updateContext)) { - update.call(this, prevType); - } else { - this.exprAllowed = type.beforeExpr; - } -}; -pp$6.overrideContext = function (tokenCtx) { - if (this.curContext() !== tokenCtx) { - this.context[this.context.length - 1] = tokenCtx; - } -}; -types$1.parenR.updateContext = types$1.braceR.updateContext = function () { - if (this.context.length === 1) { - this.exprAllowed = true; - return; - } - var out = this.context.pop(); - if (out === types.b_stat && this.curContext().token === 'function') { - out = this.context.pop(); - } - this.exprAllowed = !out.isExpr; -}; -types$1.braceL.updateContext = function (prevType) { - this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); - this.exprAllowed = true; -}; -types$1.dollarBraceL.updateContext = function () { - this.context.push(types.b_tmpl); - this.exprAllowed = true; -}; -types$1.parenL.updateContext = function (prevType) { - var statementParens = - prevType === types$1._if || - prevType === types$1._for || - prevType === types$1._with || - prevType === types$1._while; - this.context.push(statementParens ? types.p_stat : types.p_expr); - this.exprAllowed = true; -}; -types$1.incDec.updateContext = function () {}; -types$1._function.updateContext = types$1._class.updateContext = function ( - prevType, -) { - if ( - prevType.beforeExpr && - prevType !== types$1._else && - !(prevType === types$1.semi && this.curContext() !== types.p_stat) && - !( - prevType === types$1._return && - lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) - ) && - !( - (prevType === types$1.colon || prevType === types$1.braceL) && - this.curContext() === types.b_stat - ) - ) { - this.context.push(types.f_expr); - } else { - this.context.push(types.f_stat); - } - this.exprAllowed = false; -}; -types$1.backQuote.updateContext = function () { - if (this.curContext() === types.q_tmpl) { - this.context.pop(); - } else { - this.context.push(types.q_tmpl); - } - this.exprAllowed = false; -}; -types$1.star.updateContext = function (prevType) { - if (prevType === types$1._function) { - var index2 = this.context.length - 1; - if (this.context[index2] === types.f_expr) { - this.context[index2] = types.f_expr_gen; - } else { - this.context[index2] = types.f_gen; - } - } - this.exprAllowed = true; -}; -types$1.name.updateContext = function (prevType) { - var allowed = false; - if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { - if ( - (this.value === 'of' && !this.exprAllowed) || - (this.value === 'yield' && this.inGeneratorContext()) - ) { - allowed = true; - } - } - this.exprAllowed = allowed; -}; -var pp$5 = Parser.prototype; -pp$5.checkPropClash = function (prop, propHash, refDestructuringErrors) { - if (this.options.ecmaVersion >= 9 && prop.type === 'SpreadElement') { - return; - } - if ( - this.options.ecmaVersion >= 6 && - (prop.computed || prop.method || prop.shorthand) - ) { - return; - } - var key = prop.key; - var name2; - switch (key.type) { - case 'Identifier': - name2 = key.name; - break; - case 'Literal': - name2 = String(key.value); - break; - default: - return; - } - var kind = prop.kind; - if (this.options.ecmaVersion >= 6) { - if (name2 === '__proto__' && kind === 'init') { - if (propHash.proto) { - if (refDestructuringErrors) { - if (refDestructuringErrors.doubleProto < 0) { - refDestructuringErrors.doubleProto = key.start; - } - } else { - this.raiseRecoverable( - key.start, - 'Redefinition of __proto__ property', - ); - } - } - propHash.proto = true; - } - return; - } - name2 = '$' + name2; - var other = propHash[name2]; - if (other) { - var redefinition; - if (kind === 'init') { - redefinition = (this.strict && other.init) || other.get || other.set; - } else { - redefinition = other.init || other[kind]; - } - if (redefinition) { - this.raiseRecoverable(key.start, 'Redefinition of property'); - } - } else { - other = propHash[name2] = { - init: false, - get: false, - set: false, - }; - } - other[kind] = true; -}; -pp$5.parseExpression = function (forInit, refDestructuringErrors) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); - if (this.type === types$1.comma) { - var node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - while (this.eat(types$1.comma)) { - node.expressions.push( - this.parseMaybeAssign(forInit, refDestructuringErrors), - ); - } - return this.finishNode(node, 'SequenceExpression'); - } - return expr; -}; -pp$5.parseMaybeAssign = function ( - forInit, - refDestructuringErrors, - afterLeftParse, -) { - if (this.isContextual('yield')) { - if (this.inGenerator) { - return this.parseYield(forInit); - } else { - this.exprAllowed = false; - } - } - var ownDestructuringErrors = false, - oldParenAssign = -1, - oldTrailingComma = -1, - oldDoubleProto = -1; - if (refDestructuringErrors) { - oldParenAssign = refDestructuringErrors.parenthesizedAssign; - oldTrailingComma = refDestructuringErrors.trailingComma; - oldDoubleProto = refDestructuringErrors.doubleProto; - refDestructuringErrors.parenthesizedAssign = - refDestructuringErrors.trailingComma = -1; - } else { - refDestructuringErrors = new DestructuringErrors(); - ownDestructuringErrors = true; - } - var startPos = this.start, - startLoc = this.startLoc; - if (this.type === types$1.parenL || this.type === types$1.name) { - this.potentialArrowAt = this.start; - this.potentialArrowInForAwait = forInit === 'await'; - } - var left = this.parseMaybeConditional(forInit, refDestructuringErrors); - if (afterLeftParse) { - left = afterLeftParse.call(this, left, startPos, startLoc); - } - if (this.type.isAssign) { - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.value; - if (this.type === types$1.eq) { - left = this.toAssignable(left, false, refDestructuringErrors); - } - if (!ownDestructuringErrors) { - refDestructuringErrors.parenthesizedAssign = - refDestructuringErrors.trailingComma = - refDestructuringErrors.doubleProto = - -1; - } - if (refDestructuringErrors.shorthandAssign >= left.start) { - refDestructuringErrors.shorthandAssign = -1; - } - if (this.type === types$1.eq) { - this.checkLValPattern(left); - } else { - this.checkLValSimple(left); - } - node.left = left; - this.next(); - node.right = this.parseMaybeAssign(forInit); - if (oldDoubleProto > -1) { - refDestructuringErrors.doubleProto = oldDoubleProto; - } - return this.finishNode(node, 'AssignmentExpression'); - } else { - if (ownDestructuringErrors) { - this.checkExpressionErrors(refDestructuringErrors, true); - } - } - if (oldParenAssign > -1) { - refDestructuringErrors.parenthesizedAssign = oldParenAssign; - } - if (oldTrailingComma > -1) { - refDestructuringErrors.trailingComma = oldTrailingComma; - } - return left; -}; -pp$5.parseMaybeConditional = function (forInit, refDestructuringErrors) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseExprOps(forInit, refDestructuringErrors); - if (this.checkExpressionErrors(refDestructuringErrors)) { - return expr; - } - if (this.eat(types$1.question)) { - var node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(types$1.colon); - node.alternate = this.parseMaybeAssign(forInit); - return this.finishNode(node, 'ConditionalExpression'); - } - return expr; -}; -pp$5.parseExprOps = function (forInit, refDestructuringErrors) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseMaybeUnary( - refDestructuringErrors, - false, - false, - forInit, - ); - if (this.checkExpressionErrors(refDestructuringErrors)) { - return expr; - } - return expr.start === startPos && expr.type === 'ArrowFunctionExpression' - ? expr - : this.parseExprOp(expr, startPos, startLoc, -1, forInit); -}; -pp$5.parseExprOp = function ( - left, - leftStartPos, - leftStartLoc, - minPrec, - forInit, -) { - var prec = this.type.binop; - if (prec != null && (!forInit || this.type !== types$1._in)) { - if (prec > minPrec) { - var logical = - this.type === types$1.logicalOR || this.type === types$1.logicalAND; - var coalesce = this.type === types$1.coalesce; - if (coalesce) { - prec = types$1.logicalAND.binop; - } - var op = this.value; - this.next(); - var startPos = this.start, - startLoc = this.startLoc; - var right = this.parseExprOp( - this.parseMaybeUnary(null, false, false, forInit), - startPos, - startLoc, - prec, - forInit, - ); - var node = this.buildBinary( - leftStartPos, - leftStartLoc, - left, - right, - op, - logical || coalesce, - ); - if ( - (logical && this.type === types$1.coalesce) || - (coalesce && - (this.type === types$1.logicalOR || this.type === types$1.logicalAND)) - ) { - this.raiseRecoverable( - this.start, - 'Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses', - ); - } - return this.parseExprOp( - node, - leftStartPos, - leftStartLoc, - minPrec, - forInit, - ); - } - } - return left; -}; -pp$5.buildBinary = function (startPos, startLoc, left, right, op, logical) { - if (right.type === 'PrivateIdentifier') { - this.raise( - right.start, - 'Private identifier can only be left side of binary expression', - ); - } - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.operator = op; - node.right = right; - return this.finishNode( - node, - logical ? 'LogicalExpression' : 'BinaryExpression', - ); -}; -pp$5.parseMaybeUnary = function ( - refDestructuringErrors, - sawUnary, - incDec, - forInit, -) { - var startPos = this.start, - startLoc = this.startLoc, - expr; - if (this.isContextual('await') && this.canAwait) { - expr = this.parseAwait(forInit); - sawUnary = true; - } else if (this.type.prefix) { - var node = this.startNode(), - update = this.type === types$1.incDec; - node.operator = this.value; - node.prefix = true; - this.next(); - node.argument = this.parseMaybeUnary(null, true, update, forInit); - this.checkExpressionErrors(refDestructuringErrors, true); - if (update) { - this.checkLValSimple(node.argument); - } else if ( - this.strict && - node.operator === 'delete' && - node.argument.type === 'Identifier' - ) { - this.raiseRecoverable( - node.start, - 'Deleting local variable in strict mode', - ); - } else if ( - node.operator === 'delete' && - isPrivateFieldAccess(node.argument) - ) { - this.raiseRecoverable(node.start, 'Private fields can not be deleted'); - } else { - sawUnary = true; - } - expr = this.finishNode( - node, - update ? 'UpdateExpression' : 'UnaryExpression', - ); - } else if (!sawUnary && this.type === types$1.privateId) { - if (forInit || this.privateNameStack.length === 0) { - this.unexpected(); - } - expr = this.parsePrivateIdent(); - if (this.type !== types$1._in) { - this.unexpected(); - } - } else { - expr = this.parseExprSubscripts(refDestructuringErrors, forInit); - if (this.checkExpressionErrors(refDestructuringErrors)) { - return expr; - } - while (this.type.postfix && !this.canInsertSemicolon()) { - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.operator = this.value; - node$1.prefix = false; - node$1.argument = expr; - this.checkLValSimple(expr); - this.next(); - expr = this.finishNode(node$1, 'UpdateExpression'); - } - } - if (!incDec && this.eat(types$1.starstar)) { - if (sawUnary) { - this.unexpected(this.lastTokStart); - } else { - return this.buildBinary( - startPos, - startLoc, - expr, - this.parseMaybeUnary(null, false, false, forInit), - '**', - false, - ); - } - } else { - return expr; - } -}; -function isPrivateFieldAccess(node) { - return ( - (node.type === 'MemberExpression' && - node.property.type === 'PrivateIdentifier') || - (node.type === 'ChainExpression' && isPrivateFieldAccess(node.expression)) - ); -} -pp$5.parseExprSubscripts = function (refDestructuringErrors, forInit) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseExprAtom(refDestructuringErrors, forInit); - if ( - expr.type === 'ArrowFunctionExpression' && - this.input.slice(this.lastTokStart, this.lastTokEnd) !== ')' - ) { - return expr; - } - var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); - if (refDestructuringErrors && result.type === 'MemberExpression') { - if (refDestructuringErrors.parenthesizedAssign >= result.start) { - refDestructuringErrors.parenthesizedAssign = -1; - } - if (refDestructuringErrors.parenthesizedBind >= result.start) { - refDestructuringErrors.parenthesizedBind = -1; - } - if (refDestructuringErrors.trailingComma >= result.start) { - refDestructuringErrors.trailingComma = -1; - } - } - return result; -}; -pp$5.parseSubscripts = function (base2, startPos, startLoc, noCalls, forInit) { - var maybeAsyncArrow = - this.options.ecmaVersion >= 8 && - base2.type === 'Identifier' && - base2.name === 'async' && - this.lastTokEnd === base2.end && - !this.canInsertSemicolon() && - base2.end - base2.start === 5 && - this.potentialArrowAt === base2.start; - var optionalChained = false; - while (true) { - var element2 = this.parseSubscript( - base2, - startPos, - startLoc, - noCalls, - maybeAsyncArrow, - optionalChained, - forInit, - ); - if (element2.optional) { - optionalChained = true; - } - if (element2 === base2 || element2.type === 'ArrowFunctionExpression') { - if (optionalChained) { - var chainNode = this.startNodeAt(startPos, startLoc); - chainNode.expression = element2; - element2 = this.finishNode(chainNode, 'ChainExpression'); - } - return element2; - } - base2 = element2; - } -}; -pp$5.parseSubscript = function ( - base2, - startPos, - startLoc, - noCalls, - maybeAsyncArrow, - optionalChained, - forInit, -) { - var optionalSupported = this.options.ecmaVersion >= 11; - var optional = optionalSupported && this.eat(types$1.questionDot); - if (noCalls && optional) { - this.raise( - this.lastTokStart, - 'Optional chaining cannot appear in the callee of new expressions', - ); - } - var computed = this.eat(types$1.bracketL); - if ( - computed || - (optional && - this.type !== types$1.parenL && - this.type !== types$1.backQuote) || - this.eat(types$1.dot) - ) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base2; - if (computed) { - node.property = this.parseExpression(); - this.expect(types$1.bracketR); - } else if (this.type === types$1.privateId && base2.type !== 'Super') { - node.property = this.parsePrivateIdent(); - } else { - node.property = this.parseIdent(this.options.allowReserved !== 'never'); - } - node.computed = !!computed; - if (optionalSupported) { - node.optional = optional; - } - base2 = this.finishNode(node, 'MemberExpression'); - } else if (!noCalls && this.eat(types$1.parenL)) { - var refDestructuringErrors = new DestructuringErrors(), - oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - var exprList = this.parseExprList( - types$1.parenR, - this.options.ecmaVersion >= 8, - false, - refDestructuringErrors, - ); - if ( - maybeAsyncArrow && - !optional && - !this.canInsertSemicolon() && - this.eat(types$1.arrow) - ) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - if (this.awaitIdentPos > 0) { - this.raise( - this.awaitIdentPos, - "Cannot use 'await' as identifier inside an async function", - ); - } - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.parseArrowExpression( - this.startNodeAt(startPos, startLoc), - exprList, - true, - forInit, - ); - } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; - var node$1 = this.startNodeAt(startPos, startLoc); - node$1.callee = base2; - node$1.arguments = exprList; - if (optionalSupported) { - node$1.optional = optional; - } - base2 = this.finishNode(node$1, 'CallExpression'); - } else if (this.type === types$1.backQuote) { - if (optional || optionalChained) { - this.raise( - this.start, - 'Optional chaining cannot appear in the tag of tagged template expressions', - ); - } - var node$2 = this.startNodeAt(startPos, startLoc); - node$2.tag = base2; - node$2.quasi = this.parseTemplate({isTagged: true}); - base2 = this.finishNode(node$2, 'TaggedTemplateExpression'); - } - return base2; -}; -pp$5.parseExprAtom = function (refDestructuringErrors, forInit) { - if (this.type === types$1.slash) { - this.readRegexp(); - } - var node, - canBeArrow = this.potentialArrowAt === this.start; - switch (this.type) { - case types$1._super: - if (!this.allowSuper) { - this.raise(this.start, "'super' keyword outside a method"); - } - node = this.startNode(); - this.next(); - if (this.type === types$1.parenL && !this.allowDirectSuper) { - this.raise( - node.start, - 'super() call outside constructor of a subclass', - ); - } - if ( - this.type !== types$1.dot && - this.type !== types$1.bracketL && - this.type !== types$1.parenL - ) { - this.unexpected(); - } - return this.finishNode(node, 'Super'); - case types$1._this: - node = this.startNode(); - this.next(); - return this.finishNode(node, 'ThisExpression'); - case types$1.name: - var startPos = this.start, - startLoc = this.startLoc, - containsEsc = this.containsEsc; - var id = this.parseIdent(false); - if ( - this.options.ecmaVersion >= 8 && - !containsEsc && - id.name === 'async' && - !this.canInsertSemicolon() && - this.eat(types$1._function) - ) { - this.overrideContext(types.f_expr); - return this.parseFunction( - this.startNodeAt(startPos, startLoc), - 0, - false, - true, - forInit, - ); - } - if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(types$1.arrow)) { - return this.parseArrowExpression( - this.startNodeAt(startPos, startLoc), - [id], - false, - forInit, - ); - } - if ( - this.options.ecmaVersion >= 8 && - id.name === 'async' && - this.type === types$1.name && - !containsEsc && - (!this.potentialArrowInForAwait || - this.value !== 'of' || - this.containsEsc) - ) { - id = this.parseIdent(false); - if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) { - this.unexpected(); - } - return this.parseArrowExpression( - this.startNodeAt(startPos, startLoc), - [id], - true, - forInit, - ); - } - } - return id; - case types$1.regexp: - var value = this.value; - node = this.parseLiteral(value.value); - node.regex = {pattern: value.pattern, flags: value.flags}; - return node; - case types$1.num: - case types$1.string: - return this.parseLiteral(this.value); - case types$1._null: - case types$1._true: - case types$1._false: - node = this.startNode(); - node.value = - this.type === types$1._null ? null : this.type === types$1._true; - node.raw = this.type.keyword; - this.next(); - return this.finishNode(node, 'Literal'); - case types$1.parenL: - var start3 = this.start, - expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); - if (refDestructuringErrors) { - if ( - refDestructuringErrors.parenthesizedAssign < 0 && - !this.isSimpleAssignTarget(expr) - ) { - refDestructuringErrors.parenthesizedAssign = start3; - } - if (refDestructuringErrors.parenthesizedBind < 0) { - refDestructuringErrors.parenthesizedBind = start3; - } - } - return expr; - case types$1.bracketL: - node = this.startNode(); - this.next(); - node.elements = this.parseExprList( - types$1.bracketR, - true, - true, - refDestructuringErrors, - ); - return this.finishNode(node, 'ArrayExpression'); - case types$1.braceL: - this.overrideContext(types.b_expr); - return this.parseObj(false, refDestructuringErrors); - case types$1._function: - node = this.startNode(); - this.next(); - return this.parseFunction(node, 0); - case types$1._class: - return this.parseClass(this.startNode(), false); - case types$1._new: - return this.parseNew(); - case types$1.backQuote: - return this.parseTemplate(); - case types$1._import: - if (this.options.ecmaVersion >= 11) { - return this.parseExprImport(); - } else { - return this.unexpected(); - } - default: - this.unexpected(); - } -}; -pp$5.parseExprImport = function () { - var node = this.startNode(); - if (this.containsEsc) { - this.raiseRecoverable(this.start, 'Escape sequence in keyword import'); - } - var meta = this.parseIdent(true); - switch (this.type) { - case types$1.parenL: - return this.parseDynamicImport(node); - case types$1.dot: - node.meta = meta; - return this.parseImportMeta(node); - default: - this.unexpected(); - } -}; -pp$5.parseDynamicImport = function (node) { - this.next(); - node.source = this.parseMaybeAssign(); - if (!this.eat(types$1.parenR)) { - var errorPos = this.start; - if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { - this.raiseRecoverable( - errorPos, - 'Trailing comma is not allowed in import()', - ); - } else { - this.unexpected(errorPos); - } - } - return this.finishNode(node, 'ImportExpression'); -}; -pp$5.parseImportMeta = function (node) { - this.next(); - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - if (node.property.name !== 'meta') { - this.raiseRecoverable( - node.property.start, - "The only valid meta property for import is 'import.meta'", - ); - } - if (containsEsc) { - this.raiseRecoverable( - node.start, - "'import.meta' must not contain escaped characters", - ); - } - if ( - this.options.sourceType !== 'module' && - !this.options.allowImportExportEverywhere - ) { - this.raiseRecoverable( - node.start, - "Cannot use 'import.meta' outside a module", - ); - } - return this.finishNode(node, 'MetaProperty'); -}; -pp$5.parseLiteral = function (value) { - var node = this.startNode(); - node.value = value; - node.raw = this.input.slice(this.start, this.end); - if (node.raw.charCodeAt(node.raw.length - 1) === 110) { - node.bigint = node.raw.slice(0, -1).replace(/_/g, ''); - } - this.next(); - return this.finishNode(node, 'Literal'); -}; -pp$5.parseParenExpression = function () { - this.expect(types$1.parenL); - var val = this.parseExpression(); - this.expect(types$1.parenR); - return val; -}; -pp$5.parseParenAndDistinguishExpression = function (canBeArrow, forInit) { - var startPos = this.start, - startLoc = this.startLoc, - val, - allowTrailingComma = this.options.ecmaVersion >= 8; - if (this.options.ecmaVersion >= 6) { - this.next(); - var innerStartPos = this.start, - innerStartLoc = this.startLoc; - var exprList = [], - first = true, - lastIsComma = false; - var refDestructuringErrors = new DestructuringErrors(), - oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - spreadStart; - this.yieldPos = 0; - this.awaitPos = 0; - while (this.type !== types$1.parenR) { - first ? (first = false) : this.expect(types$1.comma); - if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { - lastIsComma = true; - break; - } else if (this.type === types$1.ellipsis) { - spreadStart = this.start; - exprList.push(this.parseParenItem(this.parseRestBinding())); - if (this.type === types$1.comma) { - this.raise( - this.start, - 'Comma is not permitted after the rest element', - ); - } - break; - } else { - exprList.push( - this.parseMaybeAssign( - false, - refDestructuringErrors, - this.parseParenItem, - ), - ); - } - } - var innerEndPos = this.lastTokEnd, - innerEndLoc = this.lastTokEndLoc; - this.expect(types$1.parenR); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { - this.checkPatternErrors(refDestructuringErrors, false); - this.checkYieldAwaitInDefaultParams(); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - return this.parseParenArrowList(startPos, startLoc, exprList, forInit); - } - if (!exprList.length || lastIsComma) { - this.unexpected(this.lastTokStart); - } - if (spreadStart) { - this.unexpected(spreadStart); - } - this.checkExpressionErrors(refDestructuringErrors, true); - this.yieldPos = oldYieldPos || this.yieldPos; - this.awaitPos = oldAwaitPos || this.awaitPos; - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.finishNodeAt(val, 'SequenceExpression', innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } - } else { - val = this.parseParenExpression(); - } - if (this.options.preserveParens) { - var par = this.startNodeAt(startPos, startLoc); - par.expression = val; - return this.finishNode(par, 'ParenthesizedExpression'); - } else { - return val; - } -}; -pp$5.parseParenItem = function (item) { - return item; -}; -pp$5.parseParenArrowList = function (startPos, startLoc, exprList, forInit) { - return this.parseArrowExpression( - this.startNodeAt(startPos, startLoc), - exprList, - false, - forInit, - ); -}; -var empty = []; -pp$5.parseNew = function () { - if (this.containsEsc) { - this.raiseRecoverable(this.start, 'Escape sequence in keyword new'); - } - var node = this.startNode(); - var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { - node.meta = meta; - var containsEsc = this.containsEsc; - node.property = this.parseIdent(true); - if (node.property.name !== 'target') { - this.raiseRecoverable( - node.property.start, - "The only valid meta property for new is 'new.target'", - ); - } - if (containsEsc) { - this.raiseRecoverable( - node.start, - "'new.target' must not contain escaped characters", - ); - } - if (!this.allowNewDotTarget) { - this.raiseRecoverable( - node.start, - "'new.target' can only be used in functions and class static block", - ); - } - return this.finishNode(node, 'MetaProperty'); - } - var startPos = this.start, - startLoc = this.startLoc, - isImport = this.type === types$1._import; - node.callee = this.parseSubscripts( - this.parseExprAtom(), - startPos, - startLoc, - true, - false, - ); - if (isImport && node.callee.type === 'ImportExpression') { - this.raise(startPos, 'Cannot use new with import()'); - } - if (this.eat(types$1.parenL)) { - node.arguments = this.parseExprList( - types$1.parenR, - this.options.ecmaVersion >= 8, - false, - ); - } else { - node.arguments = empty; - } - return this.finishNode(node, 'NewExpression'); -}; -pp$5.parseTemplateElement = function (ref2) { - var isTagged = ref2.isTagged; - var elem = this.startNode(); - if (this.type === types$1.invalidTemplate) { - if (!isTagged) { - this.raiseRecoverable( - this.start, - 'Bad escape sequence in untagged template literal', - ); - } - elem.value = { - raw: this.value, - cooked: null, - }; - } else { - elem.value = { - raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, '\n'), - cooked: this.value, - }; - } - this.next(); - elem.tail = this.type === types$1.backQuote; - return this.finishNode(elem, 'TemplateElement'); -}; -pp$5.parseTemplate = function (ref2) { - if (ref2 === void 0) ref2 = {}; - var isTagged = ref2.isTagged; - if (isTagged === void 0) isTagged = false; - var node = this.startNode(); - this.next(); - node.expressions = []; - var curElt = this.parseTemplateElement({isTagged}); - node.quasis = [curElt]; - while (!curElt.tail) { - if (this.type === types$1.eof) { - this.raise(this.pos, 'Unterminated template literal'); - } - this.expect(types$1.dollarBraceL); - node.expressions.push(this.parseExpression()); - this.expect(types$1.braceR); - node.quasis.push((curElt = this.parseTemplateElement({isTagged}))); - } - this.next(); - return this.finishNode(node, 'TemplateLiteral'); -}; -pp$5.isAsyncProp = function (prop) { - return ( - !prop.computed && - prop.key.type === 'Identifier' && - prop.key.name === 'async' && - (this.type === types$1.name || - this.type === types$1.num || - this.type === types$1.string || - this.type === types$1.bracketL || - this.type.keyword || - (this.options.ecmaVersion >= 9 && this.type === types$1.star)) && - !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) - ); -}; -pp$5.parseObj = function (isPattern, refDestructuringErrors) { - var node = this.startNode(), - first = true, - propHash = {}; - node.properties = []; - this.next(); - while (!this.eat(types$1.braceR)) { - if (!first) { - this.expect(types$1.comma); - if ( - this.options.ecmaVersion >= 5 && - this.afterTrailingComma(types$1.braceR) - ) { - break; - } - } else { - first = false; - } - var prop = this.parseProperty(isPattern, refDestructuringErrors); - if (!isPattern) { - this.checkPropClash(prop, propHash, refDestructuringErrors); - } - node.properties.push(prop); - } - return this.finishNode( - node, - isPattern ? 'ObjectPattern' : 'ObjectExpression', - ); -}; -pp$5.parseProperty = function (isPattern, refDestructuringErrors) { - var prop = this.startNode(), - isGenerator, - isAsync, - startPos, - startLoc; - if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { - if (isPattern) { - prop.argument = this.parseIdent(false); - if (this.type === types$1.comma) { - this.raise(this.start, 'Comma is not permitted after the rest element'); - } - return this.finishNode(prop, 'RestElement'); - } - prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); - if ( - this.type === types$1.comma && - refDestructuringErrors && - refDestructuringErrors.trailingComma < 0 - ) { - refDestructuringErrors.trailingComma = this.start; - } - return this.finishNode(prop, 'SpreadElement'); - } - if (this.options.ecmaVersion >= 6) { - prop.method = false; - prop.shorthand = false; - if (isPattern || refDestructuringErrors) { - startPos = this.start; - startLoc = this.startLoc; - } - if (!isPattern) { - isGenerator = this.eat(types$1.star); - } - } - var containsEsc = this.containsEsc; - this.parsePropertyName(prop); - if ( - !isPattern && - !containsEsc && - this.options.ecmaVersion >= 8 && - !isGenerator && - this.isAsyncProp(prop) - ) { - isAsync = true; - isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); - this.parsePropertyName(prop, refDestructuringErrors); - } else { - isAsync = false; - } - this.parsePropertyValue( - prop, - isPattern, - isGenerator, - isAsync, - startPos, - startLoc, - refDestructuringErrors, - containsEsc, - ); - return this.finishNode(prop, 'Property'); -}; -pp$5.parsePropertyValue = function ( - prop, - isPattern, - isGenerator, - isAsync, - startPos, - startLoc, - refDestructuringErrors, - containsEsc, -) { - if ((isGenerator || isAsync) && this.type === types$1.colon) { - this.unexpected(); - } - if (this.eat(types$1.colon)) { - prop.value = isPattern - ? this.parseMaybeDefault(this.start, this.startLoc) - : this.parseMaybeAssign(false, refDestructuringErrors); - prop.kind = 'init'; - } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { - if (isPattern) { - this.unexpected(); - } - prop.kind = 'init'; - prop.method = true; - prop.value = this.parseMethod(isGenerator, isAsync); - } else if ( - !isPattern && - !containsEsc && - this.options.ecmaVersion >= 5 && - !prop.computed && - prop.key.type === 'Identifier' && - (prop.key.name === 'get' || prop.key.name === 'set') && - this.type !== types$1.comma && - this.type !== types$1.braceR && - this.type !== types$1.eq - ) { - if (isGenerator || isAsync) { - this.unexpected(); - } - prop.kind = prop.key.name; - this.parsePropertyName(prop); - prop.value = this.parseMethod(false); - var paramCount = prop.kind === 'get' ? 0 : 1; - if (prop.value.params.length !== paramCount) { - var start3 = prop.value.start; - if (prop.kind === 'get') { - this.raiseRecoverable(start3, 'getter should have no params'); - } else { - this.raiseRecoverable(start3, 'setter should have exactly one param'); - } - } else { - if (prop.kind === 'set' && prop.value.params[0].type === 'RestElement') { - this.raiseRecoverable( - prop.value.params[0].start, - 'Setter cannot use rest params', - ); - } - } - } else if ( - this.options.ecmaVersion >= 6 && - !prop.computed && - prop.key.type === 'Identifier' - ) { - if (isGenerator || isAsync) { - this.unexpected(); - } - this.checkUnreserved(prop.key); - if (prop.key.name === 'await' && !this.awaitIdentPos) { - this.awaitIdentPos = startPos; - } - prop.kind = 'init'; - if (isPattern) { - prop.value = this.parseMaybeDefault( - startPos, - startLoc, - this.copyNode(prop.key), - ); - } else if (this.type === types$1.eq && refDestructuringErrors) { - if (refDestructuringErrors.shorthandAssign < 0) { - refDestructuringErrors.shorthandAssign = this.start; - } - prop.value = this.parseMaybeDefault( - startPos, - startLoc, - this.copyNode(prop.key), - ); - } else { - prop.value = this.copyNode(prop.key); - } - prop.shorthand = true; - } else { - this.unexpected(); - } -}; -pp$5.parsePropertyName = function (prop) { - if (this.options.ecmaVersion >= 6) { - if (this.eat(types$1.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(types$1.bracketR); - return prop.key; - } else { - prop.computed = false; - } - } - return (prop.key = - this.type === types$1.num || this.type === types$1.string - ? this.parseExprAtom() - : this.parseIdent(this.options.allowReserved !== 'never')); -}; -pp$5.initFunction = function (node) { - node.id = null; - if (this.options.ecmaVersion >= 6) { - node.generator = node.expression = false; - } - if (this.options.ecmaVersion >= 8) { - node.async = false; - } -}; -pp$5.parseMethod = function (isGenerator, isAsync, allowDirectSuper) { - var node = this.startNode(), - oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; - this.initFunction(node); - if (this.options.ecmaVersion >= 6) { - node.generator = isGenerator; - } - if (this.options.ecmaVersion >= 8) { - node.async = !!isAsync; - } - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - this.enterScope( - functionFlags(isAsync, node.generator) | - SCOPE_SUPER | - (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0), - ); - this.expect(types$1.parenL); - node.params = this.parseBindingList( - types$1.parenR, - false, - this.options.ecmaVersion >= 8, - ); - this.checkYieldAwaitInDefaultParams(); - this.parseFunctionBody(node, false, true, false); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, 'FunctionExpression'); -}; -pp$5.parseArrowExpression = function (node, params, isAsync, forInit) { - var oldYieldPos = this.yieldPos, - oldAwaitPos = this.awaitPos, - oldAwaitIdentPos = this.awaitIdentPos; - this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); - this.initFunction(node); - if (this.options.ecmaVersion >= 8) { - node.async = !!isAsync; - } - this.yieldPos = 0; - this.awaitPos = 0; - this.awaitIdentPos = 0; - node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true, false, forInit); - this.yieldPos = oldYieldPos; - this.awaitPos = oldAwaitPos; - this.awaitIdentPos = oldAwaitIdentPos; - return this.finishNode(node, 'ArrowFunctionExpression'); -}; -pp$5.parseFunctionBody = function (node, isArrowFunction, isMethod, forInit) { - var isExpression = isArrowFunction && this.type !== types$1.braceL; - var oldStrict = this.strict, - useStrict = false; - if (isExpression) { - node.body = this.parseMaybeAssign(forInit); - node.expression = true; - this.checkParams(node, false); - } else { - var nonSimple = - this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); - if (!oldStrict || nonSimple) { - useStrict = this.strictDirective(this.end); - if (useStrict && nonSimple) { - this.raiseRecoverable( - node.start, - "Illegal 'use strict' directive in function with non-simple parameter list", - ); - } - } - var oldLabels = this.labels; - this.labels = []; - if (useStrict) { - this.strict = true; - } - this.checkParams( - node, - !oldStrict && - !useStrict && - !isArrowFunction && - !isMethod && - this.isSimpleParamList(node.params), - ); - if (this.strict && node.id) { - this.checkLValSimple(node.id, BIND_OUTSIDE); - } - node.body = this.parseBlock(false, void 0, useStrict && !oldStrict); - node.expression = false; - this.adaptDirectivePrologue(node.body.body); - this.labels = oldLabels; - } - this.exitScope(); -}; -pp$5.isSimpleParamList = function (params) { - for (var i = 0, list3 = params; i < list3.length; i += 1) { - var param = list3[i]; - if (param.type !== 'Identifier') { - return false; - } - } - return true; -}; -pp$5.checkParams = function (node, allowDuplicates) { - var nameHash = /* @__PURE__ */ Object.create(null); - for (var i = 0, list3 = node.params; i < list3.length; i += 1) { - var param = list3[i]; - this.checkLValInnerPattern( - param, - BIND_VAR, - allowDuplicates ? null : nameHash, - ); - } -}; -pp$5.parseExprList = function ( - close, - allowTrailingComma, - allowEmpty, - refDestructuringErrors, -) { - var elts = [], - first = true; - while (!this.eat(close)) { - if (!first) { - this.expect(types$1.comma); - if (allowTrailingComma && this.afterTrailingComma(close)) { - break; - } - } else { - first = false; - } - var elt = void 0; - if (allowEmpty && this.type === types$1.comma) { - elt = null; - } else if (this.type === types$1.ellipsis) { - elt = this.parseSpread(refDestructuringErrors); - if ( - refDestructuringErrors && - this.type === types$1.comma && - refDestructuringErrors.trailingComma < 0 - ) { - refDestructuringErrors.trailingComma = this.start; - } - } else { - elt = this.parseMaybeAssign(false, refDestructuringErrors); - } - elts.push(elt); - } - return elts; -}; -pp$5.checkUnreserved = function (ref2) { - var start3 = ref2.start; - var end = ref2.end; - var name2 = ref2.name; - if (this.inGenerator && name2 === 'yield') { - this.raiseRecoverable( - start3, - "Cannot use 'yield' as identifier inside a generator", - ); - } - if (this.inAsync && name2 === 'await') { - this.raiseRecoverable( - start3, - "Cannot use 'await' as identifier inside an async function", - ); - } - if (this.currentThisScope().inClassFieldInit && name2 === 'arguments') { - this.raiseRecoverable( - start3, - "Cannot use 'arguments' in class field initializer", - ); - } - if (this.inClassStaticBlock && (name2 === 'arguments' || name2 === 'await')) { - this.raise( - start3, - 'Cannot use ' + name2 + ' in class static initialization block', - ); - } - if (this.keywords.test(name2)) { - this.raise(start3, "Unexpected keyword '" + name2 + "'"); - } - if ( - this.options.ecmaVersion < 6 && - this.input.slice(start3, end).indexOf('\\') !== -1 - ) { - return; - } - var re = this.strict ? this.reservedWordsStrict : this.reservedWords; - if (re.test(name2)) { - if (!this.inAsync && name2 === 'await') { - this.raiseRecoverable( - start3, - "Cannot use keyword 'await' outside an async function", - ); - } - this.raiseRecoverable(start3, "The keyword '" + name2 + "' is reserved"); - } -}; -pp$5.parseIdent = function (liberal, isBinding) { - var node = this.startNode(); - if (this.type === types$1.name) { - node.name = this.value; - } else if (this.type.keyword) { - node.name = this.type.keyword; - if ( - (node.name === 'class' || node.name === 'function') && - (this.lastTokEnd !== this.lastTokStart + 1 || - this.input.charCodeAt(this.lastTokStart) !== 46) - ) { - this.context.pop(); - } - } else { - this.unexpected(); - } - this.next(!!liberal); - this.finishNode(node, 'Identifier'); - if (!liberal) { - this.checkUnreserved(node); - if (node.name === 'await' && !this.awaitIdentPos) { - this.awaitIdentPos = node.start; - } - } - return node; -}; -pp$5.parsePrivateIdent = function () { - var node = this.startNode(); - if (this.type === types$1.privateId) { - node.name = this.value; - } else { - this.unexpected(); - } - this.next(); - this.finishNode(node, 'PrivateIdentifier'); - if (this.privateNameStack.length === 0) { - this.raise( - node.start, - "Private field '#" + - node.name + - "' must be declared in an enclosing class", - ); - } else { - this.privateNameStack[this.privateNameStack.length - 1].used.push(node); - } - return node; -}; -pp$5.parseYield = function (forInit) { - if (!this.yieldPos) { - this.yieldPos = this.start; - } - var node = this.startNode(); - this.next(); - if ( - this.type === types$1.semi || - this.canInsertSemicolon() || - (this.type !== types$1.star && !this.type.startsExpr) - ) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(types$1.star); - node.argument = this.parseMaybeAssign(forInit); - } - return this.finishNode(node, 'YieldExpression'); -}; -pp$5.parseAwait = function (forInit) { - if (!this.awaitPos) { - this.awaitPos = this.start; - } - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeUnary(null, true, false, forInit); - return this.finishNode(node, 'AwaitExpression'); -}; -var pp$4 = Parser.prototype; -pp$4.raise = function (pos, message) { - var loc = getLineInfo(this.input, pos); - message += ' (' + loc.line + ':' + loc.column + ')'; - var err = new SyntaxError(message); - err.pos = pos; - err.loc = loc; - err.raisedAt = this.pos; - throw err; -}; -pp$4.raiseRecoverable = pp$4.raise; -pp$4.curPosition = function () { - if (this.options.locations) { - return new Position(this.curLine, this.pos - this.lineStart); - } -}; -var pp$3 = Parser.prototype; -var Scope = function Scope2(flags) { - this.flags = flags; - this.var = []; - this.lexical = []; - this.functions = []; - this.inClassFieldInit = false; -}; -pp$3.enterScope = function (flags) { - this.scopeStack.push(new Scope(flags)); -}; -pp$3.exitScope = function () { - this.scopeStack.pop(); -}; -pp$3.treatFunctionsAsVarInScope = function (scope) { - return ( - scope.flags & SCOPE_FUNCTION || (!this.inModule && scope.flags & SCOPE_TOP) - ); -}; -pp$3.declareName = function (name2, bindingType, pos) { - var redeclared = false; - if (bindingType === BIND_LEXICAL) { - var scope = this.currentScope(); - redeclared = - scope.lexical.indexOf(name2) > -1 || - scope.functions.indexOf(name2) > -1 || - scope.var.indexOf(name2) > -1; - scope.lexical.push(name2); - if (this.inModule && scope.flags & SCOPE_TOP) { - delete this.undefinedExports[name2]; - } - } else if (bindingType === BIND_SIMPLE_CATCH) { - var scope$1 = this.currentScope(); - scope$1.lexical.push(name2); - } else if (bindingType === BIND_FUNCTION) { - var scope$2 = this.currentScope(); - if (this.treatFunctionsAsVar) { - redeclared = scope$2.lexical.indexOf(name2) > -1; - } else { - redeclared = - scope$2.lexical.indexOf(name2) > -1 || scope$2.var.indexOf(name2) > -1; - } - scope$2.functions.push(name2); - } else { - for (var i = this.scopeStack.length - 1; i >= 0; --i) { - var scope$3 = this.scopeStack[i]; - if ( - (scope$3.lexical.indexOf(name2) > -1 && - !( - scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name2 - )) || - (!this.treatFunctionsAsVarInScope(scope$3) && - scope$3.functions.indexOf(name2) > -1) - ) { - redeclared = true; - break; - } - scope$3.var.push(name2); - if (this.inModule && scope$3.flags & SCOPE_TOP) { - delete this.undefinedExports[name2]; - } - if (scope$3.flags & SCOPE_VAR) { - break; - } - } - } - if (redeclared) { - this.raiseRecoverable( - pos, - "Identifier '" + name2 + "' has already been declared", - ); - } -}; -pp$3.checkLocalExport = function (id) { - if ( - this.scopeStack[0].lexical.indexOf(id.name) === -1 && - this.scopeStack[0].var.indexOf(id.name) === -1 - ) { - this.undefinedExports[id.name] = id; - } -}; -pp$3.currentScope = function () { - return this.scopeStack[this.scopeStack.length - 1]; -}; -pp$3.currentVarScope = function () { - for (var i = this.scopeStack.length - 1; ; i--) { - var scope = this.scopeStack[i]; - if (scope.flags & SCOPE_VAR) { - return scope; - } - } -}; -pp$3.currentThisScope = function () { - for (var i = this.scopeStack.length - 1; ; i--) { - var scope = this.scopeStack[i]; - if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { - return scope; - } - } -}; -var Node = function Node2(parser, pos, loc) { - this.type = ''; - this.start = pos; - this.end = 0; - if (parser.options.locations) { - this.loc = new SourceLocation(parser, loc); - } - if (parser.options.directSourceFile) { - this.sourceFile = parser.options.directSourceFile; - } - if (parser.options.ranges) { - this.range = [pos, 0]; - } -}; -var pp$2 = Parser.prototype; -pp$2.startNode = function () { - return new Node(this, this.start, this.startLoc); -}; -pp$2.startNodeAt = function (pos, loc) { - return new Node(this, pos, loc); -}; -function finishNodeAt(node, type, pos, loc) { - node.type = type; - node.end = pos; - if (this.options.locations) { - node.loc.end = loc; - } - if (this.options.ranges) { - node.range[1] = pos; - } - return node; -} -pp$2.finishNode = function (node, type) { - return finishNodeAt.call( - this, - node, - type, - this.lastTokEnd, - this.lastTokEndLoc, - ); -}; -pp$2.finishNodeAt = function (node, type, pos, loc) { - return finishNodeAt.call(this, node, type, pos, loc); -}; -pp$2.copyNode = function (node) { - var newNode = new Node(this, node.start, this.startLoc); - for (var prop in node) { - newNode[prop] = node[prop]; - } - return newNode; -}; -var ecma9BinaryProperties = - 'ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS'; -var ecma10BinaryProperties = ecma9BinaryProperties + ' Extended_Pictographic'; -var ecma11BinaryProperties = ecma10BinaryProperties; -var ecma12BinaryProperties = - ecma11BinaryProperties + ' EBase EComp EMod EPres ExtPict'; -var ecma13BinaryProperties = ecma12BinaryProperties; -var unicodeBinaryProperties = { - 9: ecma9BinaryProperties, - 10: ecma10BinaryProperties, - 11: ecma11BinaryProperties, - 12: ecma12BinaryProperties, - 13: ecma13BinaryProperties, -}; -var unicodeGeneralCategoryValues = - 'Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu'; -var ecma9ScriptValues = - 'Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb'; -var ecma10ScriptValues = - ecma9ScriptValues + - ' Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd'; -var ecma11ScriptValues = - ecma10ScriptValues + - ' Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho'; -var ecma12ScriptValues = - ecma11ScriptValues + - ' Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi'; -var ecma13ScriptValues = - ecma12ScriptValues + - ' Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith'; -var unicodeScriptValues = { - 9: ecma9ScriptValues, - 10: ecma10ScriptValues, - 11: ecma11ScriptValues, - 12: ecma12ScriptValues, - 13: ecma13ScriptValues, -}; -var data = {}; -function buildUnicodeData(ecmaVersion) { - var d = (data[ecmaVersion] = { - binary: wordsRegexp( - unicodeBinaryProperties[ecmaVersion] + ' ' + unicodeGeneralCategoryValues, - ), - nonBinary: { - General_Category: wordsRegexp(unicodeGeneralCategoryValues), - Script: wordsRegexp(unicodeScriptValues[ecmaVersion]), - }, - }); - d.nonBinary.Script_Extensions = d.nonBinary.Script; - d.nonBinary.gc = d.nonBinary.General_Category; - d.nonBinary.sc = d.nonBinary.Script; - d.nonBinary.scx = d.nonBinary.Script_Extensions; -} -for (i = 0, list3 = [9, 10, 11, 12, 13]; i < list3.length; i += 1) { - ecmaVersion = list3[i]; - buildUnicodeData(ecmaVersion); -} -var ecmaVersion; -var i; -var list3; -var pp$1 = Parser.prototype; -var RegExpValidationState = function RegExpValidationState2(parser) { - this.parser = parser; - this.validFlags = - 'gim' + - (parser.options.ecmaVersion >= 6 ? 'uy' : '') + - (parser.options.ecmaVersion >= 9 ? 's' : '') + - (parser.options.ecmaVersion >= 13 ? 'd' : ''); - this.unicodeProperties = - data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; - this.source = ''; - this.flags = ''; - this.start = 0; - this.switchU = false; - this.switchN = false; - this.pos = 0; - this.lastIntValue = 0; - this.lastStringValue = ''; - this.lastAssertionIsQuantifiable = false; - this.numCapturingParens = 0; - this.maxBackReference = 0; - this.groupNames = []; - this.backReferenceNames = []; -}; -RegExpValidationState.prototype.reset = function reset(start3, pattern, flags) { - var unicode = flags.indexOf('u') !== -1; - this.start = start3 | 0; - this.source = pattern + ''; - this.flags = flags; - this.switchU = unicode && this.parser.options.ecmaVersion >= 6; - this.switchN = unicode && this.parser.options.ecmaVersion >= 9; -}; -RegExpValidationState.prototype.raise = function raise(message) { - this.parser.raiseRecoverable( - this.start, - 'Invalid regular expression: /' + this.source + '/: ' + message, - ); -}; -RegExpValidationState.prototype.at = function at(i, forceU) { - if (forceU === void 0) forceU = false; - var s = this.source; - var l = s.length; - if (i >= l) { - return -1; - } - var c = s.charCodeAt(i); - if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l) { - return c; - } - var next = s.charCodeAt(i + 1); - return next >= 56320 && next <= 57343 ? (c << 10) + next - 56613888 : c; -}; -RegExpValidationState.prototype.nextIndex = function nextIndex(i, forceU) { - if (forceU === void 0) forceU = false; - var s = this.source; - var l = s.length; - if (i >= l) { - return l; - } - var c = s.charCodeAt(i), - next; - if ( - !(forceU || this.switchU) || - c <= 55295 || - c >= 57344 || - i + 1 >= l || - (next = s.charCodeAt(i + 1)) < 56320 || - next > 57343 - ) { - return i + 1; - } - return i + 2; -}; -RegExpValidationState.prototype.current = function current(forceU) { - if (forceU === void 0) forceU = false; - return this.at(this.pos, forceU); -}; -RegExpValidationState.prototype.lookahead = function lookahead(forceU) { - if (forceU === void 0) forceU = false; - return this.at(this.nextIndex(this.pos, forceU), forceU); -}; -RegExpValidationState.prototype.advance = function advance(forceU) { - if (forceU === void 0) forceU = false; - this.pos = this.nextIndex(this.pos, forceU); -}; -RegExpValidationState.prototype.eat = function eat(ch, forceU) { - if (forceU === void 0) forceU = false; - if (this.current(forceU) === ch) { - this.advance(forceU); - return true; - } - return false; -}; -pp$1.validateRegExpFlags = function (state) { - var validFlags = state.validFlags; - var flags = state.flags; - for (var i = 0; i < flags.length; i++) { - var flag = flags.charAt(i); - if (validFlags.indexOf(flag) === -1) { - this.raise(state.start, 'Invalid regular expression flag'); - } - if (flags.indexOf(flag, i + 1) > -1) { - this.raise(state.start, 'Duplicate regular expression flag'); - } - } -}; -pp$1.validateRegExpPattern = function (state) { - this.regexp_pattern(state); - if ( - !state.switchN && - this.options.ecmaVersion >= 9 && - state.groupNames.length > 0 - ) { - state.switchN = true; - this.regexp_pattern(state); - } -}; -pp$1.regexp_pattern = function (state) { - state.pos = 0; - state.lastIntValue = 0; - state.lastStringValue = ''; - state.lastAssertionIsQuantifiable = false; - state.numCapturingParens = 0; - state.maxBackReference = 0; - state.groupNames.length = 0; - state.backReferenceNames.length = 0; - this.regexp_disjunction(state); - if (state.pos !== state.source.length) { - if (state.eat(41)) { - state.raise("Unmatched ')'"); - } - if (state.eat(93) || state.eat(125)) { - state.raise('Lone quantifier brackets'); - } - } - if (state.maxBackReference > state.numCapturingParens) { - state.raise('Invalid escape'); - } - for (var i = 0, list3 = state.backReferenceNames; i < list3.length; i += 1) { - var name2 = list3[i]; - if (state.groupNames.indexOf(name2) === -1) { - state.raise('Invalid named capture referenced'); - } - } -}; -pp$1.regexp_disjunction = function (state) { - this.regexp_alternative(state); - while (state.eat(124)) { - this.regexp_alternative(state); - } - if (this.regexp_eatQuantifier(state, true)) { - state.raise('Nothing to repeat'); - } - if (state.eat(123)) { - state.raise('Lone quantifier brackets'); - } -}; -pp$1.regexp_alternative = function (state) { - while (state.pos < state.source.length && this.regexp_eatTerm(state)) {} -}; -pp$1.regexp_eatTerm = function (state) { - if (this.regexp_eatAssertion(state)) { - if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { - if (state.switchU) { - state.raise('Invalid quantifier'); - } - } - return true; - } - if ( - state.switchU - ? this.regexp_eatAtom(state) - : this.regexp_eatExtendedAtom(state) - ) { - this.regexp_eatQuantifier(state); - return true; - } - return false; -}; -pp$1.regexp_eatAssertion = function (state) { - var start3 = state.pos; - state.lastAssertionIsQuantifiable = false; - if (state.eat(94) || state.eat(36)) { - return true; - } - if (state.eat(92)) { - if (state.eat(66) || state.eat(98)) { - return true; - } - state.pos = start3; - } - if (state.eat(40) && state.eat(63)) { - var lookbehind = false; - if (this.options.ecmaVersion >= 9) { - lookbehind = state.eat(60); - } - if (state.eat(61) || state.eat(33)) { - this.regexp_disjunction(state); - if (!state.eat(41)) { - state.raise('Unterminated group'); - } - state.lastAssertionIsQuantifiable = !lookbehind; - return true; - } - } - state.pos = start3; - return false; -}; -pp$1.regexp_eatQuantifier = function (state, noError) { - if (noError === void 0) noError = false; - if (this.regexp_eatQuantifierPrefix(state, noError)) { - state.eat(63); - return true; - } - return false; -}; -pp$1.regexp_eatQuantifierPrefix = function (state, noError) { - return ( - state.eat(42) || - state.eat(43) || - state.eat(63) || - this.regexp_eatBracedQuantifier(state, noError) - ); -}; -pp$1.regexp_eatBracedQuantifier = function (state, noError) { - var start3 = state.pos; - if (state.eat(123)) { - var min = 0, - max = -1; - if (this.regexp_eatDecimalDigits(state)) { - min = state.lastIntValue; - if (state.eat(44) && this.regexp_eatDecimalDigits(state)) { - max = state.lastIntValue; - } - if (state.eat(125)) { - if (max !== -1 && max < min && !noError) { - state.raise('numbers out of order in {} quantifier'); - } - return true; - } - } - if (state.switchU && !noError) { - state.raise('Incomplete quantifier'); - } - state.pos = start3; - } - return false; -}; -pp$1.regexp_eatAtom = function (state) { - return ( - this.regexp_eatPatternCharacters(state) || - state.eat(46) || - this.regexp_eatReverseSolidusAtomEscape(state) || - this.regexp_eatCharacterClass(state) || - this.regexp_eatUncapturingGroup(state) || - this.regexp_eatCapturingGroup(state) - ); -}; -pp$1.regexp_eatReverseSolidusAtomEscape = function (state) { - var start3 = state.pos; - if (state.eat(92)) { - if (this.regexp_eatAtomEscape(state)) { - return true; - } - state.pos = start3; - } - return false; -}; -pp$1.regexp_eatUncapturingGroup = function (state) { - var start3 = state.pos; - if (state.eat(40)) { - if (state.eat(63) && state.eat(58)) { - this.regexp_disjunction(state); - if (state.eat(41)) { - return true; - } - state.raise('Unterminated group'); - } - state.pos = start3; - } - return false; -}; -pp$1.regexp_eatCapturingGroup = function (state) { - if (state.eat(40)) { - if (this.options.ecmaVersion >= 9) { - this.regexp_groupSpecifier(state); - } else if (state.current() === 63) { - state.raise('Invalid group'); - } - this.regexp_disjunction(state); - if (state.eat(41)) { - state.numCapturingParens += 1; - return true; - } - state.raise('Unterminated group'); - } - return false; -}; -pp$1.regexp_eatExtendedAtom = function (state) { - return ( - state.eat(46) || - this.regexp_eatReverseSolidusAtomEscape(state) || - this.regexp_eatCharacterClass(state) || - this.regexp_eatUncapturingGroup(state) || - this.regexp_eatCapturingGroup(state) || - this.regexp_eatInvalidBracedQuantifier(state) || - this.regexp_eatExtendedPatternCharacter(state) - ); -}; -pp$1.regexp_eatInvalidBracedQuantifier = function (state) { - if (this.regexp_eatBracedQuantifier(state, true)) { - state.raise('Nothing to repeat'); - } - return false; -}; -pp$1.regexp_eatSyntaxCharacter = function (state) { - var ch = state.current(); - if (isSyntaxCharacter(ch)) { - state.lastIntValue = ch; - state.advance(); - return true; - } - return false; -}; -function isSyntaxCharacter(ch) { - return ( - ch === 36 || - (ch >= 40 && ch <= 43) || - ch === 46 || - ch === 63 || - (ch >= 91 && ch <= 94) || - (ch >= 123 && ch <= 125) - ); -} -pp$1.regexp_eatPatternCharacters = function (state) { - var start3 = state.pos; - var ch = 0; - while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { - state.advance(); - } - return state.pos !== start3; -}; -pp$1.regexp_eatExtendedPatternCharacter = function (state) { - var ch = state.current(); - if ( - ch !== -1 && - ch !== 36 && - !(ch >= 40 && ch <= 43) && - ch !== 46 && - ch !== 63 && - ch !== 91 && - ch !== 94 && - ch !== 124 - ) { - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_groupSpecifier = function (state) { - if (state.eat(63)) { - if (this.regexp_eatGroupName(state)) { - if (state.groupNames.indexOf(state.lastStringValue) !== -1) { - state.raise('Duplicate capture group name'); - } - state.groupNames.push(state.lastStringValue); - return; - } - state.raise('Invalid group'); - } -}; -pp$1.regexp_eatGroupName = function (state) { - state.lastStringValue = ''; - if (state.eat(60)) { - if (this.regexp_eatRegExpIdentifierName(state) && state.eat(62)) { - return true; - } - state.raise('Invalid capture group name'); - } - return false; -}; -pp$1.regexp_eatRegExpIdentifierName = function (state) { - state.lastStringValue = ''; - if (this.regexp_eatRegExpIdentifierStart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); - while (this.regexp_eatRegExpIdentifierPart(state)) { - state.lastStringValue += codePointToString(state.lastIntValue); - } - return true; - } - return false; -}; -pp$1.regexp_eatRegExpIdentifierStart = function (state) { - var start3 = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); - if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierStart(ch)) { - state.lastIntValue = ch; - return true; - } - state.pos = start3; - return false; -}; -function isRegExpIdentifierStart(ch) { - return isIdentifierStart(ch, true) || ch === 36 || ch === 95; -} -pp$1.regexp_eatRegExpIdentifierPart = function (state) { - var start3 = state.pos; - var forceU = this.options.ecmaVersion >= 11; - var ch = state.current(forceU); - state.advance(forceU); - if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { - ch = state.lastIntValue; - } - if (isRegExpIdentifierPart(ch)) { - state.lastIntValue = ch; - return true; - } - state.pos = start3; - return false; -}; -function isRegExpIdentifierPart(ch) { - return ( - isIdentifierChar(ch, true) || - ch === 36 || - ch === 95 || - ch === 8204 || - ch === 8205 - ); -} -pp$1.regexp_eatAtomEscape = function (state) { - if ( - this.regexp_eatBackReference(state) || - this.regexp_eatCharacterClassEscape(state) || - this.regexp_eatCharacterEscape(state) || - (state.switchN && this.regexp_eatKGroupName(state)) - ) { - return true; - } - if (state.switchU) { - if (state.current() === 99) { - state.raise('Invalid unicode escape'); - } - state.raise('Invalid escape'); - } - return false; -}; -pp$1.regexp_eatBackReference = function (state) { - var start3 = state.pos; - if (this.regexp_eatDecimalEscape(state)) { - var n = state.lastIntValue; - if (state.switchU) { - if (n > state.maxBackReference) { - state.maxBackReference = n; - } - return true; - } - if (n <= state.numCapturingParens) { - return true; - } - state.pos = start3; - } - return false; -}; -pp$1.regexp_eatKGroupName = function (state) { - if (state.eat(107)) { - if (this.regexp_eatGroupName(state)) { - state.backReferenceNames.push(state.lastStringValue); - return true; - } - state.raise('Invalid named reference'); - } - return false; -}; -pp$1.regexp_eatCharacterEscape = function (state) { - return ( - this.regexp_eatControlEscape(state) || - this.regexp_eatCControlLetter(state) || - this.regexp_eatZero(state) || - this.regexp_eatHexEscapeSequence(state) || - this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || - (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || - this.regexp_eatIdentityEscape(state) - ); -}; -pp$1.regexp_eatCControlLetter = function (state) { - var start3 = state.pos; - if (state.eat(99)) { - if (this.regexp_eatControlLetter(state)) { - return true; - } - state.pos = start3; - } - return false; -}; -pp$1.regexp_eatZero = function (state) { - if (state.current() === 48 && !isDecimalDigit(state.lookahead())) { - state.lastIntValue = 0; - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_eatControlEscape = function (state) { - var ch = state.current(); - if (ch === 116) { - state.lastIntValue = 9; - state.advance(); - return true; - } - if (ch === 110) { - state.lastIntValue = 10; - state.advance(); - return true; - } - if (ch === 118) { - state.lastIntValue = 11; - state.advance(); - return true; - } - if (ch === 102) { - state.lastIntValue = 12; - state.advance(); - return true; - } - if (ch === 114) { - state.lastIntValue = 13; - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_eatControlLetter = function (state) { - var ch = state.current(); - if (isControlLetter(ch)) { - state.lastIntValue = ch % 32; - state.advance(); - return true; - } - return false; -}; -function isControlLetter(ch) { - return (ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122); -} -pp$1.regexp_eatRegExpUnicodeEscapeSequence = function (state, forceU) { - if (forceU === void 0) forceU = false; - var start3 = state.pos; - var switchU = forceU || state.switchU; - if (state.eat(117)) { - if (this.regexp_eatFixedHexDigits(state, 4)) { - var lead = state.lastIntValue; - if (switchU && lead >= 55296 && lead <= 56319) { - var leadSurrogateEnd = state.pos; - if ( - state.eat(92) && - state.eat(117) && - this.regexp_eatFixedHexDigits(state, 4) - ) { - var trail = state.lastIntValue; - if (trail >= 56320 && trail <= 57343) { - state.lastIntValue = - (lead - 55296) * 1024 + (trail - 56320) + 65536; - return true; - } - } - state.pos = leadSurrogateEnd; - state.lastIntValue = lead; - } - return true; - } - if ( - switchU && - state.eat(123) && - this.regexp_eatHexDigits(state) && - state.eat(125) && - isValidUnicode(state.lastIntValue) - ) { - return true; - } - if (switchU) { - state.raise('Invalid unicode escape'); - } - state.pos = start3; - } - return false; -}; -function isValidUnicode(ch) { - return ch >= 0 && ch <= 1114111; -} -pp$1.regexp_eatIdentityEscape = function (state) { - if (state.switchU) { - if (this.regexp_eatSyntaxCharacter(state)) { - return true; - } - if (state.eat(47)) { - state.lastIntValue = 47; - return true; - } - return false; - } - var ch = state.current(); - if (ch !== 99 && (!state.switchN || ch !== 107)) { - state.lastIntValue = ch; - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_eatDecimalEscape = function (state) { - state.lastIntValue = 0; - var ch = state.current(); - if (ch >= 49 && ch <= 57) { - do { - state.lastIntValue = 10 * state.lastIntValue + (ch - 48); - state.advance(); - } while ((ch = state.current()) >= 48 && ch <= 57); - return true; - } - return false; -}; -pp$1.regexp_eatCharacterClassEscape = function (state) { - var ch = state.current(); - if (isCharacterClassEscape(ch)) { - state.lastIntValue = -1; - state.advance(); - return true; - } - if ( - state.switchU && - this.options.ecmaVersion >= 9 && - (ch === 80 || ch === 112) - ) { - state.lastIntValue = -1; - state.advance(); - if ( - state.eat(123) && - this.regexp_eatUnicodePropertyValueExpression(state) && - state.eat(125) - ) { - return true; - } - state.raise('Invalid property name'); - } - return false; -}; -function isCharacterClassEscape(ch) { - return ( - ch === 100 || - ch === 68 || - ch === 115 || - ch === 83 || - ch === 119 || - ch === 87 - ); -} -pp$1.regexp_eatUnicodePropertyValueExpression = function (state) { - var start3 = state.pos; - if (this.regexp_eatUnicodePropertyName(state) && state.eat(61)) { - var name2 = state.lastStringValue; - if (this.regexp_eatUnicodePropertyValue(state)) { - var value = state.lastStringValue; - this.regexp_validateUnicodePropertyNameAndValue(state, name2, value); - return true; - } - } - state.pos = start3; - if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { - var nameOrValue = state.lastStringValue; - this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); - return true; - } - return false; -}; -pp$1.regexp_validateUnicodePropertyNameAndValue = function ( - state, - name2, - value, -) { - if (!hasOwn(state.unicodeProperties.nonBinary, name2)) { - state.raise('Invalid property name'); - } - if (!state.unicodeProperties.nonBinary[name2].test(value)) { - state.raise('Invalid property value'); - } -}; -pp$1.regexp_validateUnicodePropertyNameOrValue = function (state, nameOrValue) { - if (!state.unicodeProperties.binary.test(nameOrValue)) { - state.raise('Invalid property name'); - } -}; -pp$1.regexp_eatUnicodePropertyName = function (state) { - var ch = 0; - state.lastStringValue = ''; - while (isUnicodePropertyNameCharacter((ch = state.current()))) { - state.lastStringValue += codePointToString(ch); - state.advance(); - } - return state.lastStringValue !== ''; -}; -function isUnicodePropertyNameCharacter(ch) { - return isControlLetter(ch) || ch === 95; -} -pp$1.regexp_eatUnicodePropertyValue = function (state) { - var ch = 0; - state.lastStringValue = ''; - while (isUnicodePropertyValueCharacter((ch = state.current()))) { - state.lastStringValue += codePointToString(ch); - state.advance(); - } - return state.lastStringValue !== ''; -}; -function isUnicodePropertyValueCharacter(ch) { - return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch); -} -pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function (state) { - return this.regexp_eatUnicodePropertyValue(state); -}; -pp$1.regexp_eatCharacterClass = function (state) { - if (state.eat(91)) { - state.eat(94); - this.regexp_classRanges(state); - if (state.eat(93)) { - return true; - } - state.raise('Unterminated character class'); - } - return false; -}; -pp$1.regexp_classRanges = function (state) { - while (this.regexp_eatClassAtom(state)) { - var left = state.lastIntValue; - if (state.eat(45) && this.regexp_eatClassAtom(state)) { - var right = state.lastIntValue; - if (state.switchU && (left === -1 || right === -1)) { - state.raise('Invalid character class'); - } - if (left !== -1 && right !== -1 && left > right) { - state.raise('Range out of order in character class'); - } - } - } -}; -pp$1.regexp_eatClassAtom = function (state) { - var start3 = state.pos; - if (state.eat(92)) { - if (this.regexp_eatClassEscape(state)) { - return true; - } - if (state.switchU) { - var ch$1 = state.current(); - if (ch$1 === 99 || isOctalDigit(ch$1)) { - state.raise('Invalid class escape'); - } - state.raise('Invalid escape'); - } - state.pos = start3; - } - var ch = state.current(); - if (ch !== 93) { - state.lastIntValue = ch; - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_eatClassEscape = function (state) { - var start3 = state.pos; - if (state.eat(98)) { - state.lastIntValue = 8; - return true; - } - if (state.switchU && state.eat(45)) { - state.lastIntValue = 45; - return true; - } - if (!state.switchU && state.eat(99)) { - if (this.regexp_eatClassControlLetter(state)) { - return true; - } - state.pos = start3; - } - return ( - this.regexp_eatCharacterClassEscape(state) || - this.regexp_eatCharacterEscape(state) - ); -}; -pp$1.regexp_eatClassControlLetter = function (state) { - var ch = state.current(); - if (isDecimalDigit(ch) || ch === 95) { - state.lastIntValue = ch % 32; - state.advance(); - return true; - } - return false; -}; -pp$1.regexp_eatHexEscapeSequence = function (state) { - var start3 = state.pos; - if (state.eat(120)) { - if (this.regexp_eatFixedHexDigits(state, 2)) { - return true; - } - if (state.switchU) { - state.raise('Invalid escape'); - } - state.pos = start3; - } - return false; -}; -pp$1.regexp_eatDecimalDigits = function (state) { - var start3 = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isDecimalDigit((ch = state.current()))) { - state.lastIntValue = 10 * state.lastIntValue + (ch - 48); - state.advance(); - } - return state.pos !== start3; -}; -function isDecimalDigit(ch) { - return ch >= 48 && ch <= 57; -} -pp$1.regexp_eatHexDigits = function (state) { - var start3 = state.pos; - var ch = 0; - state.lastIntValue = 0; - while (isHexDigit((ch = state.current()))) { - state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); - state.advance(); - } - return state.pos !== start3; -}; -function isHexDigit(ch) { - return ( - (ch >= 48 && ch <= 57) || (ch >= 65 && ch <= 70) || (ch >= 97 && ch <= 102) - ); -} -function hexToInt(ch) { - if (ch >= 65 && ch <= 70) { - return 10 + (ch - 65); - } - if (ch >= 97 && ch <= 102) { - return 10 + (ch - 97); - } - return ch - 48; -} -pp$1.regexp_eatLegacyOctalEscapeSequence = function (state) { - if (this.regexp_eatOctalDigit(state)) { - var n1 = state.lastIntValue; - if (this.regexp_eatOctalDigit(state)) { - var n2 = state.lastIntValue; - if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { - state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; - } else { - state.lastIntValue = n1 * 8 + n2; - } - } else { - state.lastIntValue = n1; - } - return true; - } - return false; -}; -pp$1.regexp_eatOctalDigit = function (state) { - var ch = state.current(); - if (isOctalDigit(ch)) { - state.lastIntValue = ch - 48; - state.advance(); - return true; - } - state.lastIntValue = 0; - return false; -}; -function isOctalDigit(ch) { - return ch >= 48 && ch <= 55; -} -pp$1.regexp_eatFixedHexDigits = function (state, length) { - var start3 = state.pos; - state.lastIntValue = 0; - for (var i = 0; i < length; ++i) { - var ch = state.current(); - if (!isHexDigit(ch)) { - state.pos = start3; - return false; - } - state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); - state.advance(); - } - return true; -}; -var Token = function Token2(p) { - this.type = p.type; - this.value = p.value; - this.start = p.start; - this.end = p.end; - if (p.options.locations) { - this.loc = new SourceLocation(p, p.startLoc, p.endLoc); - } - if (p.options.ranges) { - this.range = [p.start, p.end]; - } -}; -var pp = Parser.prototype; -pp.next = function (ignoreEscapeSequenceInKeyword) { - if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { - this.raiseRecoverable( - this.start, - 'Escape sequence in keyword ' + this.type.keyword, - ); - } - if (this.options.onToken) { - this.options.onToken(new Token(this)); - } - this.lastTokEnd = this.end; - this.lastTokStart = this.start; - this.lastTokEndLoc = this.endLoc; - this.lastTokStartLoc = this.startLoc; - this.nextToken(); -}; -pp.getToken = function () { - this.next(); - return new Token(this); -}; -if (typeof Symbol !== 'undefined') { - pp[Symbol.iterator] = function () { - var this$1$1 = this; - return { - next: function () { - var token = this$1$1.getToken(); - return { - done: token.type === types$1.eof, - value: token, - }; - }, - }; - }; -} -pp.nextToken = function () { - var curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) { - this.skipSpace(); - } - this.start = this.pos; - if (this.options.locations) { - this.startLoc = this.curPosition(); - } - if (this.pos >= this.input.length) { - return this.finishToken(types$1.eof); - } - if (curContext.override) { - return curContext.override(this); - } else { - this.readToken(this.fullCharCodeAtPos()); - } -}; -pp.readToken = function (code2) { - if (isIdentifierStart(code2, this.options.ecmaVersion >= 6) || code2 === 92) { - return this.readWord(); - } - return this.getTokenFromCode(code2); -}; -pp.fullCharCodeAtPos = function () { - var code2 = this.input.charCodeAt(this.pos); - if (code2 <= 55295 || code2 >= 56320) { - return code2; - } - var next = this.input.charCodeAt(this.pos + 1); - return next <= 56319 || next >= 57344 - ? code2 - : (code2 << 10) + next - 56613888; -}; -pp.skipBlockComment = function () { - var startLoc = this.options.onComment && this.curPosition(); - var start3 = this.pos, - end = this.input.indexOf('*/', (this.pos += 2)); - if (end === -1) { - this.raise(this.pos - 2, 'Unterminated comment'); - } - this.pos = end + 2; - if (this.options.locations) { - for ( - var nextBreak = void 0, pos = start3; - (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1; - - ) { - ++this.curLine; - pos = this.lineStart = nextBreak; - } - } - if (this.options.onComment) { - this.options.onComment( - true, - this.input.slice(start3 + 2, end), - start3, - this.pos, - startLoc, - this.curPosition(), - ); - } -}; -pp.skipLineComment = function (startSkip) { - var start3 = this.pos; - var startLoc = this.options.onComment && this.curPosition(); - var ch = this.input.charCodeAt((this.pos += startSkip)); - while (this.pos < this.input.length && !isNewLine(ch)) { - ch = this.input.charCodeAt(++this.pos); - } - if (this.options.onComment) { - this.options.onComment( - false, - this.input.slice(start3 + startSkip, this.pos), - start3, - this.pos, - startLoc, - this.curPosition(), - ); - } -}; -pp.skipSpace = function () { - loop: while (this.pos < this.input.length) { - var ch = this.input.charCodeAt(this.pos); - switch (ch) { - case 32: - case 160: - ++this.pos; - break; - case 13: - if (this.input.charCodeAt(this.pos + 1) === 10) { - ++this.pos; - } - case 10: - case 8232: - case 8233: - ++this.pos; - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - break; - case 47: - switch (this.input.charCodeAt(this.pos + 1)) { - case 42: - this.skipBlockComment(); - break; - case 47: - this.skipLineComment(2); - break; - default: - break loop; - } - break; - default: - if ( - (ch > 8 && ch < 14) || - (ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) - ) { - ++this.pos; - } else { - break loop; - } - } - } -}; -pp.finishToken = function (type, val) { - this.end = this.pos; - if (this.options.locations) { - this.endLoc = this.curPosition(); - } - var prevType = this.type; - this.type = type; - this.value = val; - this.updateContext(prevType); -}; -pp.readToken_dot = function () { - var next = this.input.charCodeAt(this.pos + 1); - if (next >= 48 && next <= 57) { - return this.readNumber(true); - } - var next2 = this.input.charCodeAt(this.pos + 2); - if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { - this.pos += 3; - return this.finishToken(types$1.ellipsis); - } else { - ++this.pos; - return this.finishToken(types$1.dot); - } -}; -pp.readToken_slash = function () { - var next = this.input.charCodeAt(this.pos + 1); - if (this.exprAllowed) { - ++this.pos; - return this.readRegexp(); - } - if (next === 61) { - return this.finishOp(types$1.assign, 2); - } - return this.finishOp(types$1.slash, 1); -}; -pp.readToken_mult_modulo_exp = function (code2) { - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - var tokentype = code2 === 42 ? types$1.star : types$1.modulo; - if (this.options.ecmaVersion >= 7 && code2 === 42 && next === 42) { - ++size; - tokentype = types$1.starstar; - next = this.input.charCodeAt(this.pos + 2); - } - if (next === 61) { - return this.finishOp(types$1.assign, size + 1); - } - return this.finishOp(tokentype, size); -}; -pp.readToken_pipe_amp = function (code2) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === code2) { - if (this.options.ecmaVersion >= 12) { - var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 === 61) { - return this.finishOp(types$1.assign, 3); - } - } - return this.finishOp( - code2 === 124 ? types$1.logicalOR : types$1.logicalAND, - 2, - ); - } - if (next === 61) { - return this.finishOp(types$1.assign, 2); - } - return this.finishOp( - code2 === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, - 1, - ); -}; -pp.readToken_caret = function () { - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { - return this.finishOp(types$1.assign, 2); - } - return this.finishOp(types$1.bitwiseXOR, 1); -}; -pp.readToken_plus_min = function (code2) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === code2) { - if ( - next === 45 && - !this.inModule && - this.input.charCodeAt(this.pos + 2) === 62 && - (this.lastTokEnd === 0 || - lineBreak.test(this.input.slice(this.lastTokEnd, this.pos))) - ) { - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken(); - } - return this.finishOp(types$1.incDec, 2); - } - if (next === 61) { - return this.finishOp(types$1.assign, 2); - } - return this.finishOp(types$1.plusMin, 1); -}; -pp.readToken_lt_gt = function (code2) { - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code2) { - size = code2 === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) { - return this.finishOp(types$1.assign, size + 1); - } - return this.finishOp(types$1.bitShift, size); - } - if ( - next === 33 && - code2 === 60 && - !this.inModule && - this.input.charCodeAt(this.pos + 2) === 45 && - this.input.charCodeAt(this.pos + 3) === 45 - ) { - this.skipLineComment(4); - this.skipSpace(); - return this.nextToken(); - } - if (next === 61) { - size = 2; - } - return this.finishOp(types$1.relational, size); -}; -pp.readToken_eq_excl = function (code2) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) { - return this.finishOp( - types$1.equality, - this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2, - ); - } - if (code2 === 61 && next === 62 && this.options.ecmaVersion >= 6) { - this.pos += 2; - return this.finishToken(types$1.arrow); - } - return this.finishOp(code2 === 61 ? types$1.eq : types$1.prefix, 1); -}; -pp.readToken_question = function () { - var ecmaVersion = this.options.ecmaVersion; - if (ecmaVersion >= 11) { - var next = this.input.charCodeAt(this.pos + 1); - if (next === 46) { - var next2 = this.input.charCodeAt(this.pos + 2); - if (next2 < 48 || next2 > 57) { - return this.finishOp(types$1.questionDot, 2); - } - } - if (next === 63) { - if (ecmaVersion >= 12) { - var next2$1 = this.input.charCodeAt(this.pos + 2); - if (next2$1 === 61) { - return this.finishOp(types$1.assign, 3); - } - } - return this.finishOp(types$1.coalesce, 2); - } - } - return this.finishOp(types$1.question, 1); -}; -pp.readToken_numberSign = function () { - var ecmaVersion = this.options.ecmaVersion; - var code2 = 35; - if (ecmaVersion >= 13) { - ++this.pos; - code2 = this.fullCharCodeAtPos(); - if (isIdentifierStart(code2, true) || code2 === 92) { - return this.finishToken(types$1.privateId, this.readWord1()); - } - } - this.raise( - this.pos, - "Unexpected character '" + codePointToString(code2) + "'", - ); -}; -pp.getTokenFromCode = function (code2) { - switch (code2) { - case 46: - return this.readToken_dot(); - case 40: - ++this.pos; - return this.finishToken(types$1.parenL); - case 41: - ++this.pos; - return this.finishToken(types$1.parenR); - case 59: - ++this.pos; - return this.finishToken(types$1.semi); - case 44: - ++this.pos; - return this.finishToken(types$1.comma); - case 91: - ++this.pos; - return this.finishToken(types$1.bracketL); - case 93: - ++this.pos; - return this.finishToken(types$1.bracketR); - case 123: - ++this.pos; - return this.finishToken(types$1.braceL); - case 125: - ++this.pos; - return this.finishToken(types$1.braceR); - case 58: - ++this.pos; - return this.finishToken(types$1.colon); - case 96: - if (this.options.ecmaVersion < 6) { - break; - } - ++this.pos; - return this.finishToken(types$1.backQuote); - case 48: - var next = this.input.charCodeAt(this.pos + 1); - if (next === 120 || next === 88) { - return this.readRadixNumber(16); - } - if (this.options.ecmaVersion >= 6) { - if (next === 111 || next === 79) { - return this.readRadixNumber(8); - } - if (next === 98 || next === 66) { - return this.readRadixNumber(2); - } - } - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - return this.readNumber(false); - case 34: - case 39: - return this.readString(code2); - case 47: - return this.readToken_slash(); - case 37: - case 42: - return this.readToken_mult_modulo_exp(code2); - case 124: - case 38: - return this.readToken_pipe_amp(code2); - case 94: - return this.readToken_caret(); - case 43: - case 45: - return this.readToken_plus_min(code2); - case 60: - case 62: - return this.readToken_lt_gt(code2); - case 61: - case 33: - return this.readToken_eq_excl(code2); - case 63: - return this.readToken_question(); - case 126: - return this.finishOp(types$1.prefix, 1); - case 35: - return this.readToken_numberSign(); - } - this.raise( - this.pos, - "Unexpected character '" + codePointToString(code2) + "'", - ); -}; -pp.finishOp = function (type, size) { - var str = this.input.slice(this.pos, this.pos + size); - this.pos += size; - return this.finishToken(type, str); -}; -pp.readRegexp = function () { - var escaped, - inClass, - start3 = this.pos; - for (;;) { - if (this.pos >= this.input.length) { - this.raise(start3, 'Unterminated regular expression'); - } - var ch = this.input.charAt(this.pos); - if (lineBreak.test(ch)) { - this.raise(start3, 'Unterminated regular expression'); - } - if (!escaped) { - if (ch === '[') { - inClass = true; - } else if (ch === ']' && inClass) { - inClass = false; - } else if (ch === '/' && !inClass) { - break; - } - escaped = ch === '\\'; - } else { - escaped = false; - } - ++this.pos; - } - var pattern = this.input.slice(start3, this.pos); - ++this.pos; - var flagsStart = this.pos; - var flags = this.readWord1(); - if (this.containsEsc) { - this.unexpected(flagsStart); - } - var state = - this.regexpState || (this.regexpState = new RegExpValidationState(this)); - state.reset(start3, pattern, flags); - this.validateRegExpFlags(state); - this.validateRegExpPattern(state); - var value = null; - try { - value = new RegExp(pattern, flags); - } catch (e) {} - return this.finishToken(types$1.regexp, {pattern, flags, value}); -}; -pp.readInt = function (radix, len, maybeLegacyOctalNumericLiteral) { - var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; - var isLegacyOctalNumericLiteral = - maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; - var start3 = this.pos, - total = 0, - lastCode = 0; - for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) { - var code2 = this.input.charCodeAt(this.pos), - val = void 0; - if (allowSeparators && code2 === 95) { - if (isLegacyOctalNumericLiteral) { - this.raiseRecoverable( - this.pos, - 'Numeric separator is not allowed in legacy octal numeric literals', - ); - } - if (lastCode === 95) { - this.raiseRecoverable( - this.pos, - 'Numeric separator must be exactly one underscore', - ); - } - if (i === 0) { - this.raiseRecoverable( - this.pos, - 'Numeric separator is not allowed at the first of digits', - ); - } - lastCode = code2; - continue; - } - if (code2 >= 97) { - val = code2 - 97 + 10; - } else if (code2 >= 65) { - val = code2 - 65 + 10; - } else if (code2 >= 48 && code2 <= 57) { - val = code2 - 48; - } else { - val = Infinity; - } - if (val >= radix) { - break; - } - lastCode = code2; - total = total * radix + val; - } - if (allowSeparators && lastCode === 95) { - this.raiseRecoverable( - this.pos - 1, - 'Numeric separator is not allowed at the last of digits', - ); - } - if (this.pos === start3 || (len != null && this.pos - start3 !== len)) { - return null; - } - return total; -}; -function stringToNumber(str, isLegacyOctalNumericLiteral) { - if (isLegacyOctalNumericLiteral) { - return parseInt(str, 8); - } - return parseFloat(str.replace(/_/g, '')); -} -function stringToBigInt(str) { - if (typeof BigInt !== 'function') { - return null; - } - return BigInt(str.replace(/_/g, '')); -} -pp.readRadixNumber = function (radix) { - var start3 = this.pos; - this.pos += 2; - var val = this.readInt(radix); - if (val == null) { - this.raise(this.start + 2, 'Expected number in radix ' + radix); - } - if ( - this.options.ecmaVersion >= 11 && - this.input.charCodeAt(this.pos) === 110 - ) { - val = stringToBigInt(this.input.slice(start3, this.pos)); - ++this.pos; - } else if (isIdentifierStart(this.fullCharCodeAtPos())) { - this.raise(this.pos, 'Identifier directly after number'); - } - return this.finishToken(types$1.num, val); -}; -pp.readNumber = function (startsWithDot) { - var start3 = this.pos; - if (!startsWithDot && this.readInt(10, void 0, true) === null) { - this.raise(start3, 'Invalid number'); - } - var octal = this.pos - start3 >= 2 && this.input.charCodeAt(start3) === 48; - if (octal && this.strict) { - this.raise(start3, 'Invalid number'); - } - var next = this.input.charCodeAt(this.pos); - if ( - !octal && - !startsWithDot && - this.options.ecmaVersion >= 11 && - next === 110 - ) { - var val$1 = stringToBigInt(this.input.slice(start3, this.pos)); - ++this.pos; - if (isIdentifierStart(this.fullCharCodeAtPos())) { - this.raise(this.pos, 'Identifier directly after number'); - } - return this.finishToken(types$1.num, val$1); - } - if (octal && /[89]/.test(this.input.slice(start3, this.pos))) { - octal = false; - } - if (next === 46 && !octal) { - ++this.pos; - this.readInt(10); - next = this.input.charCodeAt(this.pos); - } - if ((next === 69 || next === 101) && !octal) { - next = this.input.charCodeAt(++this.pos); - if (next === 43 || next === 45) { - ++this.pos; - } - if (this.readInt(10) === null) { - this.raise(start3, 'Invalid number'); - } - } - if (isIdentifierStart(this.fullCharCodeAtPos())) { - this.raise(this.pos, 'Identifier directly after number'); - } - var val = stringToNumber(this.input.slice(start3, this.pos), octal); - return this.finishToken(types$1.num, val); -}; -pp.readCodePoint = function () { - var ch = this.input.charCodeAt(this.pos), - code2; - if (ch === 123) { - if (this.options.ecmaVersion < 6) { - this.unexpected(); - } - var codePos = ++this.pos; - code2 = this.readHexChar(this.input.indexOf('}', this.pos) - this.pos); - ++this.pos; - if (code2 > 1114111) { - this.invalidStringToken(codePos, 'Code point out of bounds'); - } - } else { - code2 = this.readHexChar(4); - } - return code2; -}; -pp.readString = function (quote) { - var out = '', - chunkStart = ++this.pos; - for (;;) { - if (this.pos >= this.input.length) { - this.raise(this.start, 'Unterminated string constant'); - } - var ch = this.input.charCodeAt(this.pos); - if (ch === quote) { - break; - } - if (ch === 92) { - out += this.input.slice(chunkStart, this.pos); - out += this.readEscapedChar(false); - chunkStart = this.pos; - } else if (ch === 8232 || ch === 8233) { - if (this.options.ecmaVersion < 10) { - this.raise(this.start, 'Unterminated string constant'); - } - ++this.pos; - if (this.options.locations) { - this.curLine++; - this.lineStart = this.pos; - } - } else { - if (isNewLine(ch)) { - this.raise(this.start, 'Unterminated string constant'); - } - ++this.pos; - } - } - out += this.input.slice(chunkStart, this.pos++); - return this.finishToken(types$1.string, out); -}; -var INVALID_TEMPLATE_ESCAPE_ERROR = {}; -pp.tryReadTemplateToken = function () { - this.inTemplateElement = true; - try { - this.readTmplToken(); - } catch (err) { - if (err === INVALID_TEMPLATE_ESCAPE_ERROR) { - this.readInvalidTemplateToken(); - } else { - throw err; - } - } - this.inTemplateElement = false; -}; -pp.invalidStringToken = function (position3, message) { - if (this.inTemplateElement && this.options.ecmaVersion >= 9) { - throw INVALID_TEMPLATE_ESCAPE_ERROR; - } else { - this.raise(position3, message); - } -}; -pp.readTmplToken = function () { - var out = '', - chunkStart = this.pos; - for (;;) { - if (this.pos >= this.input.length) { - this.raise(this.start, 'Unterminated template'); - } - var ch = this.input.charCodeAt(this.pos); - if ( - ch === 96 || - (ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) - ) { - if ( - this.pos === this.start && - (this.type === types$1.template || - this.type === types$1.invalidTemplate) - ) { - if (ch === 36) { - this.pos += 2; - return this.finishToken(types$1.dollarBraceL); - } else { - ++this.pos; - return this.finishToken(types$1.backQuote); - } - } - out += this.input.slice(chunkStart, this.pos); - return this.finishToken(types$1.template, out); - } - if (ch === 92) { - out += this.input.slice(chunkStart, this.pos); - out += this.readEscapedChar(true); - chunkStart = this.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.pos); - ++this.pos; - switch (ch) { - case 13: - if (this.input.charCodeAt(this.pos) === 10) { - ++this.pos; - } - case 10: - out += '\n'; - break; - default: - out += String.fromCharCode(ch); - break; - } - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - chunkStart = this.pos; - } else { - ++this.pos; - } - } -}; -pp.readInvalidTemplateToken = function () { - for (; this.pos < this.input.length; this.pos++) { - switch (this.input[this.pos]) { - case '\\': - ++this.pos; - break; - case '$': - if (this.input[this.pos + 1] !== '{') { - break; - } - case '`': - return this.finishToken( - types$1.invalidTemplate, - this.input.slice(this.start, this.pos), - ); - } - } - this.raise(this.start, 'Unterminated template'); -}; -pp.readEscapedChar = function (inTemplate) { - var ch = this.input.charCodeAt(++this.pos); - ++this.pos; - switch (ch) { - case 110: - return '\n'; - case 114: - return '\r'; - case 120: - return String.fromCharCode(this.readHexChar(2)); - case 117: - return codePointToString(this.readCodePoint()); - case 116: - return ' '; - case 98: - return '\b'; - case 118: - return '\v'; - case 102: - return '\f'; - case 13: - if (this.input.charCodeAt(this.pos) === 10) { - ++this.pos; - } - case 10: - if (this.options.locations) { - this.lineStart = this.pos; - ++this.curLine; - } - return ''; - case 56: - case 57: - if (this.strict) { - this.invalidStringToken(this.pos - 1, 'Invalid escape sequence'); - } - if (inTemplate) { - var codePos = this.pos - 1; - this.invalidStringToken( - codePos, - 'Invalid escape sequence in template string', - ); - return null; - } - default: - if (ch >= 48 && ch <= 55) { - var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]; - var octal = parseInt(octalStr, 8); - if (octal > 255) { - octalStr = octalStr.slice(0, -1); - octal = parseInt(octalStr, 8); - } - this.pos += octalStr.length - 1; - ch = this.input.charCodeAt(this.pos); - if ( - (octalStr !== '0' || ch === 56 || ch === 57) && - (this.strict || inTemplate) - ) { - this.invalidStringToken( - this.pos - 1 - octalStr.length, - inTemplate - ? 'Octal literal in template string' - : 'Octal literal in strict mode', - ); - } - return String.fromCharCode(octal); - } - if (isNewLine(ch)) { - return ''; - } - return String.fromCharCode(ch); - } -}; -pp.readHexChar = function (len) { - var codePos = this.pos; - var n = this.readInt(16, len); - if (n === null) { - this.invalidStringToken(codePos, 'Bad character escape sequence'); - } - return n; -}; -pp.readWord1 = function () { - this.containsEsc = false; - var word = '', - first = true, - chunkStart = this.pos; - var astral = this.options.ecmaVersion >= 6; - while (this.pos < this.input.length) { - var ch = this.fullCharCodeAtPos(); - if (isIdentifierChar(ch, astral)) { - this.pos += ch <= 65535 ? 1 : 2; - } else if (ch === 92) { - this.containsEsc = true; - word += this.input.slice(chunkStart, this.pos); - var escStart = this.pos; - if (this.input.charCodeAt(++this.pos) !== 117) { - this.invalidStringToken( - this.pos, - 'Expecting Unicode escape sequence \\uXXXX', - ); - } - ++this.pos; - var esc = this.readCodePoint(); - if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { - this.invalidStringToken(escStart, 'Invalid Unicode escape'); - } - word += codePointToString(esc); - chunkStart = this.pos; - } else { - break; - } - first = false; - } - return word + this.input.slice(chunkStart, this.pos); -}; -pp.readWord = function () { - var word = this.readWord1(); - var type = types$1.name; - if (this.keywords.test(word)) { - type = keywords[word]; - } - return this.finishToken(type, word); -}; -var version = '8.8.1'; -Parser.acorn = { - Parser, - version, - defaultOptions, - Position, - SourceLocation, - getLineInfo, - Node, - TokenType, - tokTypes: types$1, - keywordTypes: keywords, - TokContext, - tokContexts: types, - isIdentifierChar, - isIdentifierStart, - Token, - isNewLine, - lineBreak, - lineBreakG, - nonASCIIwhitespace, -}; - -// node_modules/micromark-extension-mdxjs/index.js -var import_acorn_jsx = __toESM(require_acorn_jsx(), 1); - -// node_modules/micromark-util-chunked/index.js -function splice(list3, start3, remove, items) { - const end = list3.length; - let chunkStart = 0; - let parameters; - if (start3 < 0) { - start3 = -start3 > end ? 0 : end + start3; - } else { - start3 = start3 > end ? end : start3; - } - remove = remove > 0 ? remove : 0; - if (items.length < 1e4) { - parameters = Array.from(items); - parameters.unshift(start3, remove); - [].splice.apply(list3, parameters); - } else { - if (remove) [].splice.apply(list3, [start3, remove]); - while (chunkStart < items.length) { - parameters = items.slice(chunkStart, chunkStart + 1e4); - parameters.unshift(start3, 0); - [].splice.apply(list3, parameters); - chunkStart += 1e4; - start3 += 1e4; - } - } -} -function push(list3, items) { - if (list3.length > 0) { - splice(list3, list3.length, 0, items); - return list3; - } - return items; -} - -// node_modules/micromark-util-combine-extensions/index.js -var hasOwnProperty2 = {}.hasOwnProperty; -function combineExtensions(extensions) { - const all4 = {}; - let index2 = -1; - while (++index2 < extensions.length) { - syntaxExtension(all4, extensions[index2]); - } - return all4; -} -function syntaxExtension(all4, extension2) { - let hook; - for (hook in extension2) { - const maybe = hasOwnProperty2.call(all4, hook) ? all4[hook] : void 0; - const left = maybe || (all4[hook] = {}); - const right = extension2[hook]; - let code2; - for (code2 in right) { - if (!hasOwnProperty2.call(left, code2)) left[code2] = []; - const value = right[code2]; - constructs( - left[code2], - Array.isArray(value) ? value : value ? [value] : [], - ); - } - } -} -function constructs(existing, list3) { - let index2 = -1; - const before = []; - while (++index2 < list3.length) { - (list3[index2].add === 'after' ? existing : before).push(list3[index2]); - } - splice(existing, 0, 0, before); -} - -// node_modules/micromark-util-character/lib/unicode-punctuation-regex.js -var unicodePunctuationRegex = - /[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/; - -// node_modules/micromark-util-character/index.js -var asciiAlpha = regexCheck(/[A-Za-z]/); -var asciiDigit = regexCheck(/\d/); -var asciiHexDigit = regexCheck(/[\dA-Fa-f]/); -var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/); -var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/); -var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/); -function asciiControl(code2) { - return code2 !== null && (code2 < 32 || code2 === 127); -} -function markdownLineEndingOrSpace(code2) { - return code2 !== null && (code2 < 0 || code2 === 32); -} -function markdownLineEnding(code2) { - return code2 !== null && code2 < -2; -} -function markdownSpace(code2) { - return code2 === -2 || code2 === -1 || code2 === 32; -} -var unicodeWhitespace = regexCheck(/\s/); -var unicodePunctuation = regexCheck(unicodePunctuationRegex); -function regexCheck(regex2) { - return check; - function check(code2) { - return code2 !== null && regex2.test(String.fromCharCode(code2)); - } -} - -// node_modules/micromark-factory-space/index.js -function factorySpace(effects, ok2, type, max) { - const limit = max ? max - 1 : Number.POSITIVE_INFINITY; - let size = 0; - return start3; - function start3(code2) { - if (markdownSpace(code2)) { - effects.enter(type); - return prefix(code2); - } - return ok2(code2); - } - function prefix(code2) { - if (markdownSpace(code2) && size++ < limit) { - effects.consume(code2); - return prefix; - } - effects.exit(type); - return ok2(code2); - } -} - -// node_modules/unist-util-position-from-estree/index.js -function positionFromEstree(value) { - const node = value || {}; - const loc = node.loc || {}; - const range = node.range || [0, 0]; - const startOffset = range[0] || node.start; - const endOffset = range[1] || node.end; - return { - start: { - line: - loc.start && typeof loc.start.line === 'number' && loc.start.line > -1 - ? loc.start.line - : void 0, - column: - loc.start && - typeof loc.start.column === 'number' && - loc.start.column > -1 - ? loc.start.column + 1 - : void 0, - offset: - typeof startOffset === 'number' && startOffset > -1 - ? startOffset - : void 0, - }, - end: { - line: - loc.end && typeof loc.end.line === 'number' && loc.end.line > -1 - ? loc.end.line - : void 0, - column: - loc.end && typeof loc.end.column === 'number' && loc.end.column > -1 - ? loc.end.column + 1 - : void 0, - offset: - typeof endOffset === 'number' && endOffset > -1 ? endOffset : void 0, - }, - }; -} - -// node_modules/estree-util-visit/color.js -function color(d) { - return '\x1B[33m' + d + '\x1B[39m'; -} - -// node_modules/estree-util-visit/index.js -var own2 = {}.hasOwnProperty; -var CONTINUE = Symbol('continue'); -var SKIP = Symbol('skip'); -var EXIT = Symbol('exit'); -function visit(tree, visitor) { - let enter; - let leave; - if (typeof visitor === 'function') { - enter = visitor; - } else if (visitor && typeof visitor === 'object') { - enter = visitor.enter; - leave = visitor.leave; - } - build(tree, null, null, [])(); - function build(node, key, index2, parents) { - if (nodelike(node)) { - visit3.displayName = 'node (' + color(node.type) + ')'; - } - return visit3; - function visit3() { - const result = enter ? toResult(enter(node, key, index2, parents)) : []; - if (result[0] === EXIT) { - return result; - } - if (result[0] !== SKIP) { - let cKey; - for (cKey in node) { - if ( - own2.call(node, cKey) && - node[cKey] && - typeof node[cKey] === 'object' && - cKey !== 'data' && - cKey !== 'position' - ) { - const value = node[cKey]; - const grandparents = parents.concat(node); - if (Array.isArray(value)) { - let cIndex = 0; - while (cIndex > -1 && cIndex < value.length) { - const subvalue = value[cIndex]; - if (nodelike(subvalue)) { - const subresult = build( - subvalue, - cKey, - cIndex, - grandparents, - )(); - if (subresult[0] === EXIT) return subresult; - cIndex = - typeof subresult[1] === 'number' - ? subresult[1] - : cIndex + 1; - } else { - cIndex++; - } - } - } else if (nodelike(value)) { - const subresult = build(value, cKey, null, grandparents)(); - if (subresult[0] === EXIT) return subresult; - } - } - } - } - return leave ? toResult(leave(node, key, index2, parents)) : result; - } - } -} -function toResult(value) { - if (Array.isArray(value)) { - return value; - } - if (typeof value === 'number') { - return [CONTINUE, value]; - } - return [value]; -} -function nodelike(value) { - return Boolean( - value && - typeof value === 'object' && - typeof value.type === 'string' && - value.type.length > 0, - ); -} - -// node_modules/micromark-util-events-to-acorn/node_modules/vfile-location/index.js -function location(file) { - var value = String(file); - var indices = []; - var search2 = /\r?\n|\r/g; - while (search2.test(value)) { - indices.push(search2.lastIndex); - } - indices.push(value.length + 1); - return {toPoint, toOffset}; - function toPoint(offset2) { - var index2 = -1; - if (offset2 > -1 && offset2 < indices[indices.length - 1]) { - while (++index2 < indices.length) { - if (indices[index2] > offset2) { - return { - line: index2 + 1, - column: offset2 - (indices[index2 - 1] || 0) + 1, - offset: offset2, - }; - } - } - } - return {line: void 0, column: void 0, offset: void 0}; - } - function toOffset(point3) { - var line = point3 && point3.line; - var column = point3 && point3.column; - var offset2; - if ( - typeof line === 'number' && - typeof column === 'number' && - !Number.isNaN(line) && - !Number.isNaN(column) && - line - 1 in indices - ) { - offset2 = (indices[line - 2] || 0) + column - 1 || 0; - } - return offset2 > -1 && offset2 < indices[indices.length - 1] ? offset2 : -1; - } -} - -// node_modules/micromark-util-events-to-acorn/index.js -function eventsToAcorn(events, options) { - const {prefix = '', suffix = ''} = options; - const acornOptions = Object.assign({}, options.acornOptions); - const comments = []; - const tokens = []; - const onComment = acornOptions.onComment; - const onToken = acornOptions.onToken; - const acornConfig = Object.assign({}, acornOptions, { - onComment: comments, - onToken: onToken ? tokens : void 0, - preserveParens: true, - }); - const chunks = []; - const lines = {}; - let index2 = -1; - let swallow = false; - let estree; - let exception; - let startLine; - if (options.start) { - startLine = options.start.line; - lines[startLine] = options.start; - } - while (++index2 < events.length) { - const [kind, token, context] = events[index2]; - if (kind === 'exit') { - chunks.push(context.sliceSerialize(token)); - setPoint(token.start); - setPoint(token.end); - } - } - const source = chunks.join(''); - const value = prefix + source + suffix; - const isEmptyExpression = options.expression && empty2(source); - const place = location(source); - if (isEmptyExpression && !options.allowEmpty) { - throw new VFileMessage( - 'Unexpected empty expression', - parseOffsetToUnistPoint(0), - 'micromark-extension-mdx-expression:unexpected-empty-expression', - ); - } - try { - estree = - options.expression && !isEmptyExpression - ? options.acorn.parseExpressionAt(value, 0, acornConfig) - : options.acorn.parse(value, acornConfig); - } catch (error_) { - const error = error_; - const point3 = parseOffsetToUnistPoint(error.pos); - error.message = String(error.message).replace(/ \(\d+:\d+\)$/, ''); - error.pos = point3.offset; - error.loc = { - line: point3.line, - column: point3.column - 1, - }; - exception = error; - swallow = - error.raisedAt >= prefix.length + source.length || - error.message === 'Unterminated comment'; - } - if (estree && options.expression && !isEmptyExpression) { - if (empty2(value.slice(estree.end, value.length - suffix.length))) { - estree = { - type: 'Program', - start: 0, - end: prefix.length + source.length, - body: [ - { - type: 'ExpressionStatement', - expression: estree, - start: 0, - end: prefix.length + source.length, - }, - ], - sourceType: 'module', - comments: [], - }; - } else { - const point3 = parseOffsetToUnistPoint(estree.end); - exception = new Error('Unexpected content after expression'); - exception.pos = point3.offset; - exception.loc = { - line: point3.line, - column: point3.column - 1, - }; - estree = void 0; - } - } - if (estree) { - estree.comments = comments; - visit(estree, (esnode, field, index3, parents) => { - let context = parents[parents.length - 1]; - let prop = field; - if (esnode.type === 'ParenthesizedExpression' && context && prop) { - if (typeof index3 === 'number') { - context = context[prop]; - prop = index3; - } - context[prop] = esnode.expression; - } - fixPosition(esnode); - }); - if (Array.isArray(onComment)) { - onComment.push(...comments); - } else if (typeof onComment === 'function') { - for (const comment2 of comments) { - onComment( - comment2.type === 'Block', - comment2.value, - comment2.start, - comment2.end, - comment2.loc.start, - comment2.loc.end, - ); - } - } - for (const token of tokens) { - fixPosition(token); - if (Array.isArray(onToken)) { - onToken.push(token); - } else { - onToken(token); - } - } - } - return { - estree, - error: exception, - swallow, - }; - function fixPosition(nodeOrToken) { - const pointStart2 = parseOffsetToUnistPoint(nodeOrToken.start); - const pointEnd2 = parseOffsetToUnistPoint(nodeOrToken.end); - nodeOrToken.start = pointStart2.offset; - nodeOrToken.end = pointEnd2.offset; - nodeOrToken.loc = { - start: { - line: pointStart2.line, - column: pointStart2.column - 1, - offset: pointStart2.offset, - }, - end: { - line: pointEnd2.line, - column: pointEnd2.column - 1, - offset: pointEnd2.offset, - }, - }; - nodeOrToken.range = [nodeOrToken.start, nodeOrToken.end]; - } - function parseOffsetToUnistPoint(acornOffset) { - let sourceOffset = acornOffset - prefix.length; - if (sourceOffset < 0) { - sourceOffset = 0; - } else if (sourceOffset > source.length) { - sourceOffset = source.length; - } - const pointInSource = place.toPoint(sourceOffset); - const line = startLine + (pointInSource.line - 1); - const column = lines[line].column + (pointInSource.column - 1); - const offset2 = lines[line].offset + (pointInSource.column - 1); - return { - line, - column, - offset: offset2, - }; - } - function setPoint(point3) { - if (!startLine || point3.line < startLine) { - startLine = point3.line; - } - if (!(point3.line in lines) || lines[point3.line].offset > point3.offset) { - lines[point3.line] = point3; - } - } -} -function empty2(value) { - return /^\s*$/.test( - value - .replace(/\/\*[\s\S]*?\*\//g, '') - .replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g, ''), - ); -} - -// node_modules/micromark-factory-mdx-expression/index.js -function factoryMdxExpression( - effects, - ok2, - type, - markerType, - chunkType, - acorn, - acornOptions, - addResult, - spread, - allowEmpty, - allowLazy, - startColumn, -) { - const self2 = this; - const eventStart = this.events.length + 3; - const tail = this.events[this.events.length - 1]; - const initialPrefix = - tail && tail[1].type === 'linePrefix' - ? tail[2].sliceSerialize(tail[1], true).length - : 0; - const prefixExpressionIndent = initialPrefix ? initialPrefix + 1 : 0; - let balance = 1; - let startPosition; - let lastCrash; - return start3; - function start3(code2) { - effects.enter(type); - effects.enter(markerType); - effects.consume(code2); - effects.exit(markerType); - startPosition = self2.now(); - return atBreak; - } - function atBreak(code2) { - if (code2 === null) { - throw ( - lastCrash || - new VFileMessage( - 'Unexpected end of file in expression, expected a corresponding closing brace for `{`', - self2.now(), - 'micromark-extension-mdx-expression:unexpected-eof', - ) - ); - } - if (code2 === 125) { - return atClosingBrace(code2); - } - if (markdownLineEnding(code2)) { - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - const prefixTagIndent = startColumn - ? startColumn + 4 - self2.now().column - : 0; - const indent = Math.max(prefixExpressionIndent, prefixTagIndent); - return indent - ? factorySpace(effects, atBreak, 'linePrefix', indent) - : atBreak; - } - const now = self2.now(); - if ( - now.line !== startPosition.line && - !allowLazy && - self2.parser.lazy[now.line] - ) { - throw new VFileMessage( - 'Unexpected end of file in expression, expected a corresponding closing brace for `{`', - self2.now(), - 'micromark-extension-mdx-expression:unexpected-eof', - ); - } - effects.enter(chunkType); - return inside(code2); - } - function inside(code2) { - if (code2 === null || code2 === 125 || markdownLineEnding(code2)) { - effects.exit(chunkType); - return atBreak(code2); - } - if (code2 === 123 && !acorn) { - effects.consume(code2); - balance++; - return inside; - } - effects.consume(code2); - return inside; - } - function atClosingBrace(code2) { - balance--; - if (!acorn) { - if (balance) { - effects.enter(chunkType); - effects.consume(code2); - return inside; - } - effects.enter(markerType); - effects.consume(code2); - effects.exit(markerType); - effects.exit(type); - return ok2; - } - const result = eventsToAcorn(self2.events.slice(eventStart), { - acorn, - acornOptions, - start: startPosition, - expression: true, - allowEmpty, - prefix: spread ? '({' : '', - suffix: spread ? '})' : '', - }); - const estree = result.estree; - if (spread && estree) { - const head = estree.body[0]; - if ( - head.type !== 'ExpressionStatement' || - head.expression.type !== 'ObjectExpression' - ) { - throw new VFileMessage( - 'Unexpected `' + - head.type + - '` in code: expected an object spread (`{...spread}`)', - positionFromEstree(head).start, - 'micromark-extension-mdx-expression:non-spread', - ); - } else if (head.expression.properties[1]) { - throw new VFileMessage( - 'Unexpected extra content in spread: only a single spread is supported', - positionFromEstree(head.expression.properties[1]).start, - 'micromark-extension-mdx-expression:spread-extra', - ); - } else if ( - head.expression.properties[0] && - head.expression.properties[0].type !== 'SpreadElement' - ) { - throw new VFileMessage( - 'Unexpected `' + - head.expression.properties[0].type + - '` in code: only spread elements are supported', - positionFromEstree(head.expression.properties[0]).start, - 'micromark-extension-mdx-expression:non-spread', - ); - } - } - if (result.error) { - lastCrash = new VFileMessage( - 'Could not parse expression with acorn: ' + result.error.message, - { - line: result.error.loc.line, - column: result.error.loc.column + 1, - offset: result.error.pos, - }, - 'micromark-extension-mdx-expression:acorn', - ); - if (code2 !== null && result.swallow) { - effects.enter(chunkType); - effects.consume(code2); - return inside; - } - throw lastCrash; - } - effects.enter(markerType); - effects.consume(code2); - effects.exit(markerType); - Object.assign( - effects.exit(type), - addResult - ? { - estree, - } - : void 0, - ); - return ok2; - } -} - -// node_modules/micromark-extension-mdx-expression/lib/syntax.js -function mdxExpression(options = {}) { - const addResult = options.addResult; - const acorn = options.acorn; - const spread = options.spread; - let allowEmpty = options.allowEmpty; - let acornOptions; - if (allowEmpty === null || allowEmpty === void 0) { - allowEmpty = true; - } - if (acorn) { - if (!acorn.parseExpressionAt) { - throw new Error( - 'Expected a proper `acorn` instance passed in as `options.acorn`', - ); - } - acornOptions = Object.assign( - { - ecmaVersion: 2020, - sourceType: 'module', - }, - options.acornOptions, - ); - } else if (options.acornOptions || options.addResult) { - throw new Error( - 'Expected an `acorn` instance passed in as `options.acorn`', - ); - } - return { - flow: { - [123]: { - tokenize: tokenizeFlowExpression, - concrete: true, - }, - }, - text: { - [123]: { - tokenize: tokenizeTextExpression, - }, - }, - }; - function tokenizeFlowExpression(effects, ok2, nok) { - const self2 = this; - return start3; - function start3(code2) { - return factoryMdxExpression.call( - self2, - effects, - factorySpace(effects, after, 'whitespace'), - 'mdxFlowExpression', - 'mdxFlowExpressionMarker', - 'mdxFlowExpressionChunk', - acorn, - acornOptions, - addResult, - spread, - allowEmpty, - )(code2); - } - function after(code2) { - return code2 === null || markdownLineEnding(code2) - ? ok2(code2) - : nok(code2); - } - } - function tokenizeTextExpression(effects, ok2) { - const self2 = this; - return start3; - function start3(code2) { - return factoryMdxExpression.call( - self2, - effects, - ok2, - 'mdxTextExpression', - 'mdxTextExpressionMarker', - 'mdxTextExpressionChunk', - acorn, - acornOptions, - addResult, - spread, - allowEmpty, - true, - )(code2); - } - } -} - -// node_modules/estree-util-is-identifier-name/regex.js -var start = - /[$A-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/; -var cont = - /[\d\u00B7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF\u1AC0\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F]/; - -// node_modules/estree-util-is-identifier-name/index.js -function start2(code2) { - return start.test(String.fromCharCode(code2)); -} -function cont2(code2) { - const character = String.fromCharCode(code2); - return start.test(character) || cont.test(character); -} -function name(name2) { - let index2 = -1; - while (++index2 < name2.length) { - if (!(index2 ? cont2 : start2)(name2.charCodeAt(index2))) return false; - } - return index2 > 0; -} - -// node_modules/micromark-extension-mdx-jsx/lib/factory-tag.js -var lazyLineEnd = { - tokenize: tokenizeLazyLineEnd, - partial: true, -}; -function factoryTag( - effects, - ok2, - nok, - acorn, - acornOptions, - addResult, - allowLazy, - tagType, - tagMarkerType, - tagClosingMarkerType, - tagSelfClosingMarker, - tagNameType, - tagNamePrimaryType, - tagNameMemberMarkerType, - tagNameMemberType, - tagNamePrefixMarkerType, - tagNameLocalType, - tagExpressionAttributeType, - tagExpressionAttributeMarkerType, - tagExpressionAttributeValueType, - tagAttributeType, - tagAttributeNameType, - tagAttributeNamePrimaryType, - tagAttributeNamePrefixMarkerType, - tagAttributeNameLocalType, - tagAttributeInitializerMarkerType, - tagAttributeValueLiteralType, - tagAttributeValueLiteralMarkerType, - tagAttributeValueLiteralValueType, - tagAttributeValueExpressionType, - tagAttributeValueExpressionMarkerType, - tagAttributeValueExpressionValueType, -) { - const self2 = this; - let returnState; - let marker; - let startPoint; - return start3; - function start3(code2) { - startPoint = self2.now(); - effects.enter(tagType); - effects.enter(tagMarkerType); - effects.consume(code2); - effects.exit(tagMarkerType); - return afterStart; - } - function afterStart(code2) { - if (markdownLineEnding(code2) || markdownSpace(code2)) { - return nok(code2); - } - returnState = beforeName; - return optionalEsWhitespace(code2); - } - function beforeName(code2) { - if (code2 === 47) { - effects.enter(tagClosingMarkerType); - effects.consume(code2); - effects.exit(tagClosingMarkerType); - returnState = beforeClosingTagName; - return optionalEsWhitespace; - } - if (code2 === 62) { - return tagEnd(code2); - } - if (code2 !== null && start2(code2)) { - effects.enter(tagNameType); - effects.enter(tagNamePrimaryType); - effects.consume(code2); - return primaryName; - } - crash( - code2, - 'before name', - 'a character that can start a name, such as a letter, `$`, or `_`' + - (code2 === 33 - ? ' (note: to create a comment in MDX, use `{/* text */}`)' - : ''), - ); - } - function beforeClosingTagName(code2) { - if (code2 === 62) { - return tagEnd(code2); - } - if (code2 !== null && start2(code2)) { - effects.enter(tagNameType); - effects.enter(tagNamePrimaryType); - effects.consume(code2); - return primaryName; - } - crash( - code2, - 'before name', - 'a character that can start a name, such as a letter, `$`, or `_`' + - (code2 === 42 || code2 === 47 - ? ' (note: JS comments in JSX tags are not supported in MDX)' - : ''), - ); - } - function primaryName(code2) { - if (code2 === 45 || (code2 !== null && cont2(code2))) { - effects.consume(code2); - return primaryName; - } - if ( - code2 === 46 || - code2 === 47 || - code2 === 58 || - code2 === 62 || - code2 === 123 || - markdownLineEndingOrSpace(code2) || - unicodeWhitespace(code2) - ) { - effects.exit(tagNamePrimaryType); - returnState = afterPrimaryName; - return optionalEsWhitespace(code2); - } - crash( - code2, - 'in name', - 'a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag' + - (code2 === 64 - ? ' (note: to create a link in MDX, use `[text](url)`)' - : ''), - ); - } - function afterPrimaryName(code2) { - if (code2 === 46) { - effects.enter(tagNameMemberMarkerType); - effects.consume(code2); - effects.exit(tagNameMemberMarkerType); - returnState = beforeMemberName; - return optionalEsWhitespace; - } - if (code2 === 58) { - effects.enter(tagNamePrefixMarkerType); - effects.consume(code2); - effects.exit(tagNamePrefixMarkerType); - returnState = beforeLocalName; - return optionalEsWhitespace; - } - if ( - code2 === 47 || - code2 === 62 || - code2 === 123 || - (code2 !== null && start2(code2)) - ) { - effects.exit(tagNameType); - return beforeAttribute(code2); - } - crash( - code2, - 'after name', - 'a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag', - ); - } - function beforeMemberName(code2) { - if (code2 !== null && start2(code2)) { - effects.enter(tagNameMemberType); - effects.consume(code2); - return memberName; - } - crash( - code2, - 'before member name', - 'a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag', - ); - } - function memberName(code2) { - if (code2 === 45 || (code2 !== null && cont2(code2))) { - effects.consume(code2); - return memberName; - } - if ( - code2 === 46 || - code2 === 47 || - code2 === 62 || - code2 === 123 || - markdownLineEndingOrSpace(code2) || - unicodeWhitespace(code2) - ) { - effects.exit(tagNameMemberType); - returnState = afterMemberName; - return optionalEsWhitespace(code2); - } - crash( - code2, - 'in member name', - 'a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag' + - (code2 === 64 - ? ' (note: to create a link in MDX, use `[text](url)`)' - : ''), - ); - } - function afterMemberName(code2) { - if (code2 === 46) { - effects.enter(tagNameMemberMarkerType); - effects.consume(code2); - effects.exit(tagNameMemberMarkerType); - returnState = beforeMemberName; - return optionalEsWhitespace; - } - if ( - code2 === 47 || - code2 === 62 || - code2 === 123 || - (code2 !== null && start2(code2)) - ) { - effects.exit(tagNameType); - return beforeAttribute(code2); - } - crash( - code2, - 'after member name', - 'a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag', - ); - } - function beforeLocalName(code2) { - if (code2 !== null && start2(code2)) { - effects.enter(tagNameLocalType); - effects.consume(code2); - return localName; - } - crash( - code2, - 'before local name', - 'a character that can start a name, such as a letter, `$`, or `_`' + - (code2 === 43 || (code2 !== null && code2 > 46 && code2 < 58) - ? ' (note: to create a link in MDX, use `[text](url)`)' - : ''), - ); - } - function localName(code2) { - if (code2 === 45 || (code2 !== null && cont2(code2))) { - effects.consume(code2); - return localName; - } - if ( - code2 === 47 || - code2 === 62 || - code2 === 123 || - markdownLineEndingOrSpace(code2) || - unicodeWhitespace(code2) - ) { - effects.exit(tagNameLocalType); - returnState = afterLocalName; - return optionalEsWhitespace(code2); - } - crash( - code2, - 'in local name', - 'a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag', - ); - } - function afterLocalName(code2) { - if ( - code2 === 47 || - code2 === 62 || - code2 === 123 || - (code2 !== null && start2(code2)) - ) { - effects.exit(tagNameType); - return beforeAttribute(code2); - } - crash( - code2, - 'after local name', - 'a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag', - ); - } - function beforeAttribute(code2) { - if (code2 === 47) { - effects.enter(tagSelfClosingMarker); - effects.consume(code2); - effects.exit(tagSelfClosingMarker); - returnState = selfClosing; - return optionalEsWhitespace; - } - if (code2 === 62) { - return tagEnd(code2); - } - if (code2 === 123) { - return factoryMdxExpression.call( - self2, - effects, - afterAttributeExpression, - tagExpressionAttributeType, - tagExpressionAttributeMarkerType, - tagExpressionAttributeValueType, - acorn, - acornOptions, - addResult, - true, - false, - allowLazy, - startPoint.column, - )(code2); - } - if (code2 !== null && start2(code2)) { - effects.enter(tagAttributeType); - effects.enter(tagAttributeNameType); - effects.enter(tagAttributeNamePrimaryType); - effects.consume(code2); - return attributePrimaryName; - } - crash( - code2, - 'before attribute name', - 'a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag', - ); - } - function afterAttributeExpression(code2) { - returnState = beforeAttribute; - return optionalEsWhitespace(code2); - } - function attributePrimaryName(code2) { - if (code2 === 45 || (code2 !== null && cont2(code2))) { - effects.consume(code2); - return attributePrimaryName; - } - if ( - code2 === 47 || - code2 === 58 || - code2 === 61 || - code2 === 62 || - code2 === 123 || - markdownLineEndingOrSpace(code2) || - unicodeWhitespace(code2) - ) { - effects.exit(tagAttributeNamePrimaryType); - returnState = afterAttributePrimaryName; - return optionalEsWhitespace(code2); - } - crash( - code2, - 'in attribute name', - 'an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag', - ); - } - function afterAttributePrimaryName(code2) { - if (code2 === 58) { - effects.enter(tagAttributeNamePrefixMarkerType); - effects.consume(code2); - effects.exit(tagAttributeNamePrefixMarkerType); - returnState = beforeAttributeLocalName; - return optionalEsWhitespace; - } - if (code2 === 61) { - effects.exit(tagAttributeNameType); - effects.enter(tagAttributeInitializerMarkerType); - effects.consume(code2); - effects.exit(tagAttributeInitializerMarkerType); - returnState = beforeAttributeValue; - return optionalEsWhitespace; - } - if ( - code2 === 47 || - code2 === 62 || - code2 === 123 || - markdownLineEndingOrSpace(code2) || - unicodeWhitespace(code2) || - (code2 !== null && start2(code2)) - ) { - effects.exit(tagAttributeNameType); - effects.exit(tagAttributeType); - returnState = beforeAttribute; - return optionalEsWhitespace(code2); - } - crash( - code2, - 'after attribute name', - 'a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag', - ); - } - function beforeAttributeLocalName(code2) { - if (code2 !== null && start2(code2)) { - effects.enter(tagAttributeNameLocalType); - effects.consume(code2); - return attributeLocalName; - } - crash( - code2, - 'before local attribute name', - 'a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag', - ); - } - function attributeLocalName(code2) { - if (code2 === 45 || (code2 !== null && cont2(code2))) { - effects.consume(code2); - return attributeLocalName; - } - if ( - code2 === 47 || - code2 === 61 || - code2 === 62 || - code2 === 123 || - markdownLineEndingOrSpace(code2) || - unicodeWhitespace(code2) - ) { - effects.exit(tagAttributeNameLocalType); - effects.exit(tagAttributeNameType); - returnState = afterAttributeLocalName; - return optionalEsWhitespace(code2); - } - crash( - code2, - 'in local attribute name', - 'an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag', - ); - } - function afterAttributeLocalName(code2) { - if (code2 === 61) { - effects.enter(tagAttributeInitializerMarkerType); - effects.consume(code2); - effects.exit(tagAttributeInitializerMarkerType); - returnState = beforeAttributeValue; - return optionalEsWhitespace; - } - if ( - code2 === 47 || - code2 === 62 || - code2 === 123 || - (code2 !== null && start2(code2)) - ) { - effects.exit(tagAttributeType); - return beforeAttribute(code2); - } - crash( - code2, - 'after local attribute name', - 'a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag', - ); - } - function beforeAttributeValue(code2) { - if (code2 === 34 || code2 === 39) { - effects.enter(tagAttributeValueLiteralType); - effects.enter(tagAttributeValueLiteralMarkerType); - effects.consume(code2); - effects.exit(tagAttributeValueLiteralMarkerType); - marker = code2; - return attributeValueQuotedStart; - } - if (code2 === 123) { - return factoryMdxExpression.call( - self2, - effects, - afterAttributeValueExpression, - tagAttributeValueExpressionType, - tagAttributeValueExpressionMarkerType, - tagAttributeValueExpressionValueType, - acorn, - acornOptions, - addResult, - false, - false, - allowLazy, - startPoint.column, - )(code2); - } - crash( - code2, - 'before attribute value', - 'a character that can start an attribute value, such as `"`, `\'`, or `{`' + - (code2 === 60 - ? ' (note: to use an element or fragment as a prop value in MDX, use `{}`)' - : ''), - ); - } - function afterAttributeValueExpression(code2) { - effects.exit(tagAttributeType); - returnState = beforeAttribute; - return optionalEsWhitespace(code2); - } - function attributeValueQuotedStart(code2) { - if (code2 === null) { - crash( - code2, - 'in attribute value', - 'a corresponding closing quote `' + String.fromCharCode(marker) + '`', - ); - } - if (code2 === marker) { - effects.enter(tagAttributeValueLiteralMarkerType); - effects.consume(code2); - effects.exit(tagAttributeValueLiteralMarkerType); - effects.exit(tagAttributeValueLiteralType); - effects.exit(tagAttributeType); - marker = void 0; - returnState = beforeAttribute; - return optionalEsWhitespace; - } - if (markdownLineEnding(code2)) { - returnState = attributeValueQuotedStart; - return optionalEsWhitespace(code2); - } - effects.enter(tagAttributeValueLiteralValueType); - return attributeValueQuoted(code2); - } - function attributeValueQuoted(code2) { - if (code2 === null || code2 === marker || markdownLineEnding(code2)) { - effects.exit(tagAttributeValueLiteralValueType); - return attributeValueQuotedStart(code2); - } - effects.consume(code2); - return attributeValueQuoted; - } - function selfClosing(code2) { - if (code2 === 62) { - return tagEnd(code2); - } - crash( - code2, - 'after self-closing slash', - '`>` to end the tag' + - (code2 === 42 || code2 === 47 - ? ' (note: JS comments in JSX tags are not supported in MDX)' - : ''), - ); - } - function tagEnd(code2) { - effects.enter(tagMarkerType); - effects.consume(code2); - effects.exit(tagMarkerType); - effects.exit(tagType); - return ok2; - } - function optionalEsWhitespace(code2) { - if (markdownLineEnding(code2)) { - if (allowLazy) { - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - return factorySpace(effects, optionalEsWhitespace, 'linePrefix', 4); - } - return effects.attempt( - lazyLineEnd, - factorySpace(effects, optionalEsWhitespace, 'linePrefix', 4), - crashEol, - )(code2); - } - if (markdownSpace(code2) || unicodeWhitespace(code2)) { - effects.enter('esWhitespace'); - return optionalEsWhitespaceContinue(code2); - } - return returnState(code2); - } - function optionalEsWhitespaceContinue(code2) { - if ( - markdownLineEnding(code2) || - !(markdownSpace(code2) || unicodeWhitespace(code2)) - ) { - effects.exit('esWhitespace'); - return optionalEsWhitespace(code2); - } - effects.consume(code2); - return optionalEsWhitespaceContinue; - } - function crashEol() { - throw new VFileMessage( - 'Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc', - self2.now(), - 'micromark-extension-mdx-jsx:unexpected-eof', - ); - } - function crash(code2, at2, expect) { - throw new VFileMessage( - 'Unexpected ' + - (code2 === null - ? 'end of file' - : 'character `' + - (code2 === 96 ? '` ` `' : String.fromCharCode(code2)) + - '` (' + - serializeCharCode(code2) + - ')') + - ' ' + - at2 + - ', expected ' + - expect, - self2.now(), - 'micromark-extension-mdx-jsx:unexpected-' + - (code2 === null ? 'eof' : 'character'), - ); - } -} -function tokenizeLazyLineEnd(effects, ok2, nok) { - const self2 = this; - return start3; - function start3(code2) { - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - return lineStart; - } - function lineStart(code2) { - return self2.parser.lazy[self2.now().line] ? nok(code2) : ok2(code2); - } -} -function serializeCharCode(code2) { - return 'U+' + code2.toString(16).toUpperCase().padStart(4, '0'); -} - -// node_modules/micromark-extension-mdx-jsx/lib/jsx-text.js -function jsxText(acorn, acornOptions, addResult) { - return { - tokenize: tokenizeJsxText, - }; - function tokenizeJsxText(effects, ok2, nok) { - return factoryTag.call( - this, - effects, - ok2, - nok, - acorn, - acornOptions, - addResult, - true, - 'mdxJsxTextTag', - 'mdxJsxTextTagMarker', - 'mdxJsxTextTagClosingMarker', - 'mdxJsxTextTagSelfClosingMarker', - 'mdxJsxTextTagName', - 'mdxJsxTextTagNamePrimary', - 'mdxJsxTextTagNameMemberMarker', - 'mdxJsxTextTagNameMember', - 'mdxJsxTextTagNamePrefixMarker', - 'mdxJsxTextTagNameLocal', - 'mdxJsxTextTagExpressionAttribute', - 'mdxJsxTextTagExpressionAttributeMarker', - 'mdxJsxTextTagExpressionAttributeValue', - 'mdxJsxTextTagAttribute', - 'mdxJsxTextTagAttributeName', - 'mdxJsxTextTagAttributeNamePrimary', - 'mdxJsxTextTagAttributeNamePrefixMarker', - 'mdxJsxTextTagAttributeNameLocal', - 'mdxJsxTextTagAttributeInitializerMarker', - 'mdxJsxTextTagAttributeValueLiteral', - 'mdxJsxTextTagAttributeValueLiteralMarker', - 'mdxJsxTextTagAttributeValueLiteralValue', - 'mdxJsxTextTagAttributeValueExpression', - 'mdxJsxTextTagAttributeValueExpressionMarker', - 'mdxJsxTextTagAttributeValueExpressionValue', - ); - } -} - -// node_modules/micromark-extension-mdx-jsx/lib/jsx-flow.js -function jsxFlow(acorn, acornOptions, addResult) { - return { - tokenize: tokenizeJsxFlow, - concrete: true, - }; - function tokenizeJsxFlow(effects, ok2, nok) { - const self2 = this; - return start3; - function start3(code2) { - return factoryTag.call( - self2, - effects, - factorySpace(effects, after, 'whitespace'), - nok, - acorn, - acornOptions, - addResult, - false, - 'mdxJsxFlowTag', - 'mdxJsxFlowTagMarker', - 'mdxJsxFlowTagClosingMarker', - 'mdxJsxFlowTagSelfClosingMarker', - 'mdxJsxFlowTagName', - 'mdxJsxFlowTagNamePrimary', - 'mdxJsxFlowTagNameMemberMarker', - 'mdxJsxFlowTagNameMember', - 'mdxJsxFlowTagNamePrefixMarker', - 'mdxJsxFlowTagNameLocal', - 'mdxJsxFlowTagExpressionAttribute', - 'mdxJsxFlowTagExpressionAttributeMarker', - 'mdxJsxFlowTagExpressionAttributeValue', - 'mdxJsxFlowTagAttribute', - 'mdxJsxFlowTagAttributeName', - 'mdxJsxFlowTagAttributeNamePrimary', - 'mdxJsxFlowTagAttributeNamePrefixMarker', - 'mdxJsxFlowTagAttributeNameLocal', - 'mdxJsxFlowTagAttributeInitializerMarker', - 'mdxJsxFlowTagAttributeValueLiteral', - 'mdxJsxFlowTagAttributeValueLiteralMarker', - 'mdxJsxFlowTagAttributeValueLiteralValue', - 'mdxJsxFlowTagAttributeValueExpression', - 'mdxJsxFlowTagAttributeValueExpressionMarker', - 'mdxJsxFlowTagAttributeValueExpressionValue', - )(code2); - } - function after(code2) { - return code2 === 60 - ? start3(code2) - : code2 === null || markdownLineEnding(code2) - ? ok2(code2) - : nok(code2); - } - } -} - -// node_modules/micromark-extension-mdx-jsx/lib/syntax.js -function mdxJsx(options = {}) { - const acorn = options.acorn; - let acornOptions; - if (acorn) { - if (!acorn.parse || !acorn.parseExpressionAt) { - throw new Error( - 'Expected a proper `acorn` instance passed in as `options.acorn`', - ); - } - acornOptions = Object.assign( - { - ecmaVersion: 2020, - sourceType: 'module', - }, - options.acornOptions, - { - locations: true, - }, - ); - } else if (options.acornOptions || options.addResult) { - throw new Error( - 'Expected an `acorn` instance passed in as `options.acorn`', - ); - } - return { - flow: { - [60]: jsxFlow(acorn, acornOptions, options.addResult), - }, - text: { - [60]: jsxText(acorn, acornOptions, options.addResult), - }, - }; -} - -// node_modules/micromark-extension-mdx-md/index.js -var mdxMd = { - disable: {null: ['autolink', 'codeIndented', 'htmlFlow', 'htmlText']}, -}; - -// node_modules/micromark-util-classify-character/index.js -function classifyCharacter(code2) { - if ( - code2 === null || - markdownLineEndingOrSpace(code2) || - unicodeWhitespace(code2) - ) { - return 1; - } - if (unicodePunctuation(code2)) { - return 2; - } -} - -// node_modules/micromark-util-resolve-all/index.js -function resolveAll(constructs2, events, context) { - const called = []; - let index2 = -1; - while (++index2 < constructs2.length) { - const resolve = constructs2[index2].resolveAll; - if (resolve && !called.includes(resolve)) { - events = resolve(events, context); - called.push(resolve); - } - } - return events; -} - -// node_modules/micromark-core-commonmark/lib/attention.js -var attention = { - name: 'attention', - tokenize: tokenizeAttention, - resolveAll: resolveAllAttention, -}; -function resolveAllAttention(events, context) { - let index2 = -1; - let open; - let group; - let text5; - let openingSequence; - let closingSequence; - let use; - let nextEvents; - let offset2; - while (++index2 < events.length) { - if ( - events[index2][0] === 'enter' && - events[index2][1].type === 'attentionSequence' && - events[index2][1]._close - ) { - open = index2; - while (open--) { - if ( - events[open][0] === 'exit' && - events[open][1].type === 'attentionSequence' && - events[open][1]._open && - context.sliceSerialize(events[open][1]).charCodeAt(0) === - context.sliceSerialize(events[index2][1]).charCodeAt(0) - ) { - if ( - (events[open][1]._close || events[index2][1]._open) && - (events[index2][1].end.offset - events[index2][1].start.offset) % - 3 && - !( - (events[open][1].end.offset - - events[open][1].start.offset + - events[index2][1].end.offset - - events[index2][1].start.offset) % - 3 - ) - ) { - continue; - } - use = - events[open][1].end.offset - events[open][1].start.offset > 1 && - events[index2][1].end.offset - events[index2][1].start.offset > 1 - ? 2 - : 1; - const start3 = Object.assign({}, events[open][1].end); - const end = Object.assign({}, events[index2][1].start); - movePoint(start3, -use); - movePoint(end, use); - openingSequence = { - type: use > 1 ? 'strongSequence' : 'emphasisSequence', - start: start3, - end: Object.assign({}, events[open][1].end), - }; - closingSequence = { - type: use > 1 ? 'strongSequence' : 'emphasisSequence', - start: Object.assign({}, events[index2][1].start), - end, - }; - text5 = { - type: use > 1 ? 'strongText' : 'emphasisText', - start: Object.assign({}, events[open][1].end), - end: Object.assign({}, events[index2][1].start), - }; - group = { - type: use > 1 ? 'strong' : 'emphasis', - start: Object.assign({}, openingSequence.start), - end: Object.assign({}, closingSequence.end), - }; - events[open][1].end = Object.assign({}, openingSequence.start); - events[index2][1].start = Object.assign({}, closingSequence.end); - nextEvents = []; - if (events[open][1].end.offset - events[open][1].start.offset) { - nextEvents = push(nextEvents, [ - ['enter', events[open][1], context], - ['exit', events[open][1], context], - ]); - } - nextEvents = push(nextEvents, [ - ['enter', group, context], - ['enter', openingSequence, context], - ['exit', openingSequence, context], - ['enter', text5, context], - ]); - nextEvents = push( - nextEvents, - resolveAll( - context.parser.constructs.insideSpan.null, - events.slice(open + 1, index2), - context, - ), - ); - nextEvents = push(nextEvents, [ - ['exit', text5, context], - ['enter', closingSequence, context], - ['exit', closingSequence, context], - ['exit', group, context], - ]); - if (events[index2][1].end.offset - events[index2][1].start.offset) { - offset2 = 2; - nextEvents = push(nextEvents, [ - ['enter', events[index2][1], context], - ['exit', events[index2][1], context], - ]); - } else { - offset2 = 0; - } - splice(events, open - 1, index2 - open + 3, nextEvents); - index2 = open + nextEvents.length - offset2 - 2; - break; - } - } - } - } - index2 = -1; - while (++index2 < events.length) { - if (events[index2][1].type === 'attentionSequence') { - events[index2][1].type = 'data'; - } - } - return events; -} -function tokenizeAttention(effects, ok2) { - const attentionMarkers2 = this.parser.constructs.attentionMarkers.null; - const previous2 = this.previous; - const before = classifyCharacter(previous2); - let marker; - return start3; - function start3(code2) { - effects.enter('attentionSequence'); - marker = code2; - return sequence(code2); - } - function sequence(code2) { - if (code2 === marker) { - effects.consume(code2); - return sequence; - } - const token = effects.exit('attentionSequence'); - const after = classifyCharacter(code2); - const open = - !after || (after === 2 && before) || attentionMarkers2.includes(code2); - const close = - !before || - (before === 2 && after) || - attentionMarkers2.includes(previous2); - token._open = Boolean(marker === 42 ? open : open && (before || !close)); - token._close = Boolean(marker === 42 ? close : close && (after || !open)); - return ok2(code2); - } -} -function movePoint(point3, offset2) { - point3.column += offset2; - point3.offset += offset2; - point3._bufferIndex += offset2; -} - -// node_modules/micromark-core-commonmark/lib/autolink.js -var autolink = { - name: 'autolink', - tokenize: tokenizeAutolink, -}; -function tokenizeAutolink(effects, ok2, nok) { - let size = 1; - return start3; - function start3(code2) { - effects.enter('autolink'); - effects.enter('autolinkMarker'); - effects.consume(code2); - effects.exit('autolinkMarker'); - effects.enter('autolinkProtocol'); - return open; - } - function open(code2) { - if (asciiAlpha(code2)) { - effects.consume(code2); - return schemeOrEmailAtext; - } - return asciiAtext(code2) ? emailAtext(code2) : nok(code2); - } - function schemeOrEmailAtext(code2) { - return code2 === 43 || - code2 === 45 || - code2 === 46 || - asciiAlphanumeric(code2) - ? schemeInsideOrEmailAtext(code2) - : emailAtext(code2); - } - function schemeInsideOrEmailAtext(code2) { - if (code2 === 58) { - effects.consume(code2); - return urlInside; - } - if ( - (code2 === 43 || - code2 === 45 || - code2 === 46 || - asciiAlphanumeric(code2)) && - size++ < 32 - ) { - effects.consume(code2); - return schemeInsideOrEmailAtext; - } - return emailAtext(code2); - } - function urlInside(code2) { - if (code2 === 62) { - effects.exit('autolinkProtocol'); - return end(code2); - } - if (code2 === null || code2 === 32 || code2 === 60 || asciiControl(code2)) { - return nok(code2); - } - effects.consume(code2); - return urlInside; - } - function emailAtext(code2) { - if (code2 === 64) { - effects.consume(code2); - size = 0; - return emailAtSignOrDot; - } - if (asciiAtext(code2)) { - effects.consume(code2); - return emailAtext; - } - return nok(code2); - } - function emailAtSignOrDot(code2) { - return asciiAlphanumeric(code2) ? emailLabel(code2) : nok(code2); - } - function emailLabel(code2) { - if (code2 === 46) { - effects.consume(code2); - size = 0; - return emailAtSignOrDot; - } - if (code2 === 62) { - effects.exit('autolinkProtocol').type = 'autolinkEmail'; - return end(code2); - } - return emailValue(code2); - } - function emailValue(code2) { - if ((code2 === 45 || asciiAlphanumeric(code2)) && size++ < 63) { - effects.consume(code2); - return code2 === 45 ? emailValue : emailLabel; - } - return nok(code2); - } - function end(code2) { - effects.enter('autolinkMarker'); - effects.consume(code2); - effects.exit('autolinkMarker'); - effects.exit('autolink'); - return ok2; - } -} - -// node_modules/micromark-core-commonmark/lib/blank-line.js -var blankLine = { - tokenize: tokenizeBlankLine, - partial: true, -}; -function tokenizeBlankLine(effects, ok2, nok) { - return factorySpace(effects, afterWhitespace, 'linePrefix'); - function afterWhitespace(code2) { - return code2 === null || markdownLineEnding(code2) - ? ok2(code2) - : nok(code2); - } -} - -// node_modules/micromark-core-commonmark/lib/block-quote.js -var blockQuote = { - name: 'blockQuote', - tokenize: tokenizeBlockQuoteStart, - continuation: { - tokenize: tokenizeBlockQuoteContinuation, - }, - exit, -}; -function tokenizeBlockQuoteStart(effects, ok2, nok) { - const self2 = this; - return start3; - function start3(code2) { - if (code2 === 62) { - const state = self2.containerState; - if (!state.open) { - effects.enter('blockQuote', { - _container: true, - }); - state.open = true; - } - effects.enter('blockQuotePrefix'); - effects.enter('blockQuoteMarker'); - effects.consume(code2); - effects.exit('blockQuoteMarker'); - return after; - } - return nok(code2); - } - function after(code2) { - if (markdownSpace(code2)) { - effects.enter('blockQuotePrefixWhitespace'); - effects.consume(code2); - effects.exit('blockQuotePrefixWhitespace'); - effects.exit('blockQuotePrefix'); - return ok2; - } - effects.exit('blockQuotePrefix'); - return ok2(code2); - } -} -function tokenizeBlockQuoteContinuation(effects, ok2, nok) { - return factorySpace( - effects, - effects.attempt(blockQuote, ok2, nok), - 'linePrefix', - this.parser.constructs.disable.null.includes('codeIndented') ? void 0 : 4, - ); -} -function exit(effects) { - effects.exit('blockQuote'); -} - -// node_modules/micromark-core-commonmark/lib/character-escape.js -var characterEscape = { - name: 'characterEscape', - tokenize: tokenizeCharacterEscape, -}; -function tokenizeCharacterEscape(effects, ok2, nok) { - return start3; - function start3(code2) { - effects.enter('characterEscape'); - effects.enter('escapeMarker'); - effects.consume(code2); - effects.exit('escapeMarker'); - return open; - } - function open(code2) { - if (asciiPunctuation(code2)) { - effects.enter('characterEscapeValue'); - effects.consume(code2); - effects.exit('characterEscapeValue'); - effects.exit('characterEscape'); - return ok2; - } - return nok(code2); - } -} - -// node_modules/character-entities/index.js -var characterEntities = { - AElig: '\xC6', - AMP: '&', - Aacute: '\xC1', - Abreve: '\u0102', - Acirc: '\xC2', - Acy: '\u0410', - Afr: '\u{1D504}', - Agrave: '\xC0', - Alpha: '\u0391', - Amacr: '\u0100', - And: '\u2A53', - Aogon: '\u0104', - Aopf: '\u{1D538}', - ApplyFunction: '\u2061', - Aring: '\xC5', - Ascr: '\u{1D49C}', - Assign: '\u2254', - Atilde: '\xC3', - Auml: '\xC4', - Backslash: '\u2216', - Barv: '\u2AE7', - Barwed: '\u2306', - Bcy: '\u0411', - Because: '\u2235', - Bernoullis: '\u212C', - Beta: '\u0392', - Bfr: '\u{1D505}', - Bopf: '\u{1D539}', - Breve: '\u02D8', - Bscr: '\u212C', - Bumpeq: '\u224E', - CHcy: '\u0427', - COPY: '\xA9', - Cacute: '\u0106', - Cap: '\u22D2', - CapitalDifferentialD: '\u2145', - Cayleys: '\u212D', - Ccaron: '\u010C', - Ccedil: '\xC7', - Ccirc: '\u0108', - Cconint: '\u2230', - Cdot: '\u010A', - Cedilla: '\xB8', - CenterDot: '\xB7', - Cfr: '\u212D', - Chi: '\u03A7', - CircleDot: '\u2299', - CircleMinus: '\u2296', - CirclePlus: '\u2295', - CircleTimes: '\u2297', - ClockwiseContourIntegral: '\u2232', - CloseCurlyDoubleQuote: '\u201D', - CloseCurlyQuote: '\u2019', - Colon: '\u2237', - Colone: '\u2A74', - Congruent: '\u2261', - Conint: '\u222F', - ContourIntegral: '\u222E', - Copf: '\u2102', - Coproduct: '\u2210', - CounterClockwiseContourIntegral: '\u2233', - Cross: '\u2A2F', - Cscr: '\u{1D49E}', - Cup: '\u22D3', - CupCap: '\u224D', - DD: '\u2145', - DDotrahd: '\u2911', - DJcy: '\u0402', - DScy: '\u0405', - DZcy: '\u040F', - Dagger: '\u2021', - Darr: '\u21A1', - Dashv: '\u2AE4', - Dcaron: '\u010E', - Dcy: '\u0414', - Del: '\u2207', - Delta: '\u0394', - Dfr: '\u{1D507}', - DiacriticalAcute: '\xB4', - DiacriticalDot: '\u02D9', - DiacriticalDoubleAcute: '\u02DD', - DiacriticalGrave: '`', - DiacriticalTilde: '\u02DC', - Diamond: '\u22C4', - DifferentialD: '\u2146', - Dopf: '\u{1D53B}', - Dot: '\xA8', - DotDot: '\u20DC', - DotEqual: '\u2250', - DoubleContourIntegral: '\u222F', - DoubleDot: '\xA8', - DoubleDownArrow: '\u21D3', - DoubleLeftArrow: '\u21D0', - DoubleLeftRightArrow: '\u21D4', - DoubleLeftTee: '\u2AE4', - DoubleLongLeftArrow: '\u27F8', - DoubleLongLeftRightArrow: '\u27FA', - DoubleLongRightArrow: '\u27F9', - DoubleRightArrow: '\u21D2', - DoubleRightTee: '\u22A8', - DoubleUpArrow: '\u21D1', - DoubleUpDownArrow: '\u21D5', - DoubleVerticalBar: '\u2225', - DownArrow: '\u2193', - DownArrowBar: '\u2913', - DownArrowUpArrow: '\u21F5', - DownBreve: '\u0311', - DownLeftRightVector: '\u2950', - DownLeftTeeVector: '\u295E', - DownLeftVector: '\u21BD', - DownLeftVectorBar: '\u2956', - DownRightTeeVector: '\u295F', - DownRightVector: '\u21C1', - DownRightVectorBar: '\u2957', - DownTee: '\u22A4', - DownTeeArrow: '\u21A7', - Downarrow: '\u21D3', - Dscr: '\u{1D49F}', - Dstrok: '\u0110', - ENG: '\u014A', - ETH: '\xD0', - Eacute: '\xC9', - Ecaron: '\u011A', - Ecirc: '\xCA', - Ecy: '\u042D', - Edot: '\u0116', - Efr: '\u{1D508}', - Egrave: '\xC8', - Element: '\u2208', - Emacr: '\u0112', - EmptySmallSquare: '\u25FB', - EmptyVerySmallSquare: '\u25AB', - Eogon: '\u0118', - Eopf: '\u{1D53C}', - Epsilon: '\u0395', - Equal: '\u2A75', - EqualTilde: '\u2242', - Equilibrium: '\u21CC', - Escr: '\u2130', - Esim: '\u2A73', - Eta: '\u0397', - Euml: '\xCB', - Exists: '\u2203', - ExponentialE: '\u2147', - Fcy: '\u0424', - Ffr: '\u{1D509}', - FilledSmallSquare: '\u25FC', - FilledVerySmallSquare: '\u25AA', - Fopf: '\u{1D53D}', - ForAll: '\u2200', - Fouriertrf: '\u2131', - Fscr: '\u2131', - GJcy: '\u0403', - GT: '>', - Gamma: '\u0393', - Gammad: '\u03DC', - Gbreve: '\u011E', - Gcedil: '\u0122', - Gcirc: '\u011C', - Gcy: '\u0413', - Gdot: '\u0120', - Gfr: '\u{1D50A}', - Gg: '\u22D9', - Gopf: '\u{1D53E}', - GreaterEqual: '\u2265', - GreaterEqualLess: '\u22DB', - GreaterFullEqual: '\u2267', - GreaterGreater: '\u2AA2', - GreaterLess: '\u2277', - GreaterSlantEqual: '\u2A7E', - GreaterTilde: '\u2273', - Gscr: '\u{1D4A2}', - Gt: '\u226B', - HARDcy: '\u042A', - Hacek: '\u02C7', - Hat: '^', - Hcirc: '\u0124', - Hfr: '\u210C', - HilbertSpace: '\u210B', - Hopf: '\u210D', - HorizontalLine: '\u2500', - Hscr: '\u210B', - Hstrok: '\u0126', - HumpDownHump: '\u224E', - HumpEqual: '\u224F', - IEcy: '\u0415', - IJlig: '\u0132', - IOcy: '\u0401', - Iacute: '\xCD', - Icirc: '\xCE', - Icy: '\u0418', - Idot: '\u0130', - Ifr: '\u2111', - Igrave: '\xCC', - Im: '\u2111', - Imacr: '\u012A', - ImaginaryI: '\u2148', - Implies: '\u21D2', - Int: '\u222C', - Integral: '\u222B', - Intersection: '\u22C2', - InvisibleComma: '\u2063', - InvisibleTimes: '\u2062', - Iogon: '\u012E', - Iopf: '\u{1D540}', - Iota: '\u0399', - Iscr: '\u2110', - Itilde: '\u0128', - Iukcy: '\u0406', - Iuml: '\xCF', - Jcirc: '\u0134', - Jcy: '\u0419', - Jfr: '\u{1D50D}', - Jopf: '\u{1D541}', - Jscr: '\u{1D4A5}', - Jsercy: '\u0408', - Jukcy: '\u0404', - KHcy: '\u0425', - KJcy: '\u040C', - Kappa: '\u039A', - Kcedil: '\u0136', - Kcy: '\u041A', - Kfr: '\u{1D50E}', - Kopf: '\u{1D542}', - Kscr: '\u{1D4A6}', - LJcy: '\u0409', - LT: '<', - Lacute: '\u0139', - Lambda: '\u039B', - Lang: '\u27EA', - Laplacetrf: '\u2112', - Larr: '\u219E', - Lcaron: '\u013D', - Lcedil: '\u013B', - Lcy: '\u041B', - LeftAngleBracket: '\u27E8', - LeftArrow: '\u2190', - LeftArrowBar: '\u21E4', - LeftArrowRightArrow: '\u21C6', - LeftCeiling: '\u2308', - LeftDoubleBracket: '\u27E6', - LeftDownTeeVector: '\u2961', - LeftDownVector: '\u21C3', - LeftDownVectorBar: '\u2959', - LeftFloor: '\u230A', - LeftRightArrow: '\u2194', - LeftRightVector: '\u294E', - LeftTee: '\u22A3', - LeftTeeArrow: '\u21A4', - LeftTeeVector: '\u295A', - LeftTriangle: '\u22B2', - LeftTriangleBar: '\u29CF', - LeftTriangleEqual: '\u22B4', - LeftUpDownVector: '\u2951', - LeftUpTeeVector: '\u2960', - LeftUpVector: '\u21BF', - LeftUpVectorBar: '\u2958', - LeftVector: '\u21BC', - LeftVectorBar: '\u2952', - Leftarrow: '\u21D0', - Leftrightarrow: '\u21D4', - LessEqualGreater: '\u22DA', - LessFullEqual: '\u2266', - LessGreater: '\u2276', - LessLess: '\u2AA1', - LessSlantEqual: '\u2A7D', - LessTilde: '\u2272', - Lfr: '\u{1D50F}', - Ll: '\u22D8', - Lleftarrow: '\u21DA', - Lmidot: '\u013F', - LongLeftArrow: '\u27F5', - LongLeftRightArrow: '\u27F7', - LongRightArrow: '\u27F6', - Longleftarrow: '\u27F8', - Longleftrightarrow: '\u27FA', - Longrightarrow: '\u27F9', - Lopf: '\u{1D543}', - LowerLeftArrow: '\u2199', - LowerRightArrow: '\u2198', - Lscr: '\u2112', - Lsh: '\u21B0', - Lstrok: '\u0141', - Lt: '\u226A', - Map: '\u2905', - Mcy: '\u041C', - MediumSpace: '\u205F', - Mellintrf: '\u2133', - Mfr: '\u{1D510}', - MinusPlus: '\u2213', - Mopf: '\u{1D544}', - Mscr: '\u2133', - Mu: '\u039C', - NJcy: '\u040A', - Nacute: '\u0143', - Ncaron: '\u0147', - Ncedil: '\u0145', - Ncy: '\u041D', - NegativeMediumSpace: '\u200B', - NegativeThickSpace: '\u200B', - NegativeThinSpace: '\u200B', - NegativeVeryThinSpace: '\u200B', - NestedGreaterGreater: '\u226B', - NestedLessLess: '\u226A', - NewLine: '\n', - Nfr: '\u{1D511}', - NoBreak: '\u2060', - NonBreakingSpace: '\xA0', - Nopf: '\u2115', - Not: '\u2AEC', - NotCongruent: '\u2262', - NotCupCap: '\u226D', - NotDoubleVerticalBar: '\u2226', - NotElement: '\u2209', - NotEqual: '\u2260', - NotEqualTilde: '\u2242\u0338', - NotExists: '\u2204', - NotGreater: '\u226F', - NotGreaterEqual: '\u2271', - NotGreaterFullEqual: '\u2267\u0338', - NotGreaterGreater: '\u226B\u0338', - NotGreaterLess: '\u2279', - NotGreaterSlantEqual: '\u2A7E\u0338', - NotGreaterTilde: '\u2275', - NotHumpDownHump: '\u224E\u0338', - NotHumpEqual: '\u224F\u0338', - NotLeftTriangle: '\u22EA', - NotLeftTriangleBar: '\u29CF\u0338', - NotLeftTriangleEqual: '\u22EC', - NotLess: '\u226E', - NotLessEqual: '\u2270', - NotLessGreater: '\u2278', - NotLessLess: '\u226A\u0338', - NotLessSlantEqual: '\u2A7D\u0338', - NotLessTilde: '\u2274', - NotNestedGreaterGreater: '\u2AA2\u0338', - NotNestedLessLess: '\u2AA1\u0338', - NotPrecedes: '\u2280', - NotPrecedesEqual: '\u2AAF\u0338', - NotPrecedesSlantEqual: '\u22E0', - NotReverseElement: '\u220C', - NotRightTriangle: '\u22EB', - NotRightTriangleBar: '\u29D0\u0338', - NotRightTriangleEqual: '\u22ED', - NotSquareSubset: '\u228F\u0338', - NotSquareSubsetEqual: '\u22E2', - NotSquareSuperset: '\u2290\u0338', - NotSquareSupersetEqual: '\u22E3', - NotSubset: '\u2282\u20D2', - NotSubsetEqual: '\u2288', - NotSucceeds: '\u2281', - NotSucceedsEqual: '\u2AB0\u0338', - NotSucceedsSlantEqual: '\u22E1', - NotSucceedsTilde: '\u227F\u0338', - NotSuperset: '\u2283\u20D2', - NotSupersetEqual: '\u2289', - NotTilde: '\u2241', - NotTildeEqual: '\u2244', - NotTildeFullEqual: '\u2247', - NotTildeTilde: '\u2249', - NotVerticalBar: '\u2224', - Nscr: '\u{1D4A9}', - Ntilde: '\xD1', - Nu: '\u039D', - OElig: '\u0152', - Oacute: '\xD3', - Ocirc: '\xD4', - Ocy: '\u041E', - Odblac: '\u0150', - Ofr: '\u{1D512}', - Ograve: '\xD2', - Omacr: '\u014C', - Omega: '\u03A9', - Omicron: '\u039F', - Oopf: '\u{1D546}', - OpenCurlyDoubleQuote: '\u201C', - OpenCurlyQuote: '\u2018', - Or: '\u2A54', - Oscr: '\u{1D4AA}', - Oslash: '\xD8', - Otilde: '\xD5', - Otimes: '\u2A37', - Ouml: '\xD6', - OverBar: '\u203E', - OverBrace: '\u23DE', - OverBracket: '\u23B4', - OverParenthesis: '\u23DC', - PartialD: '\u2202', - Pcy: '\u041F', - Pfr: '\u{1D513}', - Phi: '\u03A6', - Pi: '\u03A0', - PlusMinus: '\xB1', - Poincareplane: '\u210C', - Popf: '\u2119', - Pr: '\u2ABB', - Precedes: '\u227A', - PrecedesEqual: '\u2AAF', - PrecedesSlantEqual: '\u227C', - PrecedesTilde: '\u227E', - Prime: '\u2033', - Product: '\u220F', - Proportion: '\u2237', - Proportional: '\u221D', - Pscr: '\u{1D4AB}', - Psi: '\u03A8', - QUOT: '"', - Qfr: '\u{1D514}', - Qopf: '\u211A', - Qscr: '\u{1D4AC}', - RBarr: '\u2910', - REG: '\xAE', - Racute: '\u0154', - Rang: '\u27EB', - Rarr: '\u21A0', - Rarrtl: '\u2916', - Rcaron: '\u0158', - Rcedil: '\u0156', - Rcy: '\u0420', - Re: '\u211C', - ReverseElement: '\u220B', - ReverseEquilibrium: '\u21CB', - ReverseUpEquilibrium: '\u296F', - Rfr: '\u211C', - Rho: '\u03A1', - RightAngleBracket: '\u27E9', - RightArrow: '\u2192', - RightArrowBar: '\u21E5', - RightArrowLeftArrow: '\u21C4', - RightCeiling: '\u2309', - RightDoubleBracket: '\u27E7', - RightDownTeeVector: '\u295D', - RightDownVector: '\u21C2', - RightDownVectorBar: '\u2955', - RightFloor: '\u230B', - RightTee: '\u22A2', - RightTeeArrow: '\u21A6', - RightTeeVector: '\u295B', - RightTriangle: '\u22B3', - RightTriangleBar: '\u29D0', - RightTriangleEqual: '\u22B5', - RightUpDownVector: '\u294F', - RightUpTeeVector: '\u295C', - RightUpVector: '\u21BE', - RightUpVectorBar: '\u2954', - RightVector: '\u21C0', - RightVectorBar: '\u2953', - Rightarrow: '\u21D2', - Ropf: '\u211D', - RoundImplies: '\u2970', - Rrightarrow: '\u21DB', - Rscr: '\u211B', - Rsh: '\u21B1', - RuleDelayed: '\u29F4', - SHCHcy: '\u0429', - SHcy: '\u0428', - SOFTcy: '\u042C', - Sacute: '\u015A', - Sc: '\u2ABC', - Scaron: '\u0160', - Scedil: '\u015E', - Scirc: '\u015C', - Scy: '\u0421', - Sfr: '\u{1D516}', - ShortDownArrow: '\u2193', - ShortLeftArrow: '\u2190', - ShortRightArrow: '\u2192', - ShortUpArrow: '\u2191', - Sigma: '\u03A3', - SmallCircle: '\u2218', - Sopf: '\u{1D54A}', - Sqrt: '\u221A', - Square: '\u25A1', - SquareIntersection: '\u2293', - SquareSubset: '\u228F', - SquareSubsetEqual: '\u2291', - SquareSuperset: '\u2290', - SquareSupersetEqual: '\u2292', - SquareUnion: '\u2294', - Sscr: '\u{1D4AE}', - Star: '\u22C6', - Sub: '\u22D0', - Subset: '\u22D0', - SubsetEqual: '\u2286', - Succeeds: '\u227B', - SucceedsEqual: '\u2AB0', - SucceedsSlantEqual: '\u227D', - SucceedsTilde: '\u227F', - SuchThat: '\u220B', - Sum: '\u2211', - Sup: '\u22D1', - Superset: '\u2283', - SupersetEqual: '\u2287', - Supset: '\u22D1', - THORN: '\xDE', - TRADE: '\u2122', - TSHcy: '\u040B', - TScy: '\u0426', - Tab: ' ', - Tau: '\u03A4', - Tcaron: '\u0164', - Tcedil: '\u0162', - Tcy: '\u0422', - Tfr: '\u{1D517}', - Therefore: '\u2234', - Theta: '\u0398', - ThickSpace: '\u205F\u200A', - ThinSpace: '\u2009', - Tilde: '\u223C', - TildeEqual: '\u2243', - TildeFullEqual: '\u2245', - TildeTilde: '\u2248', - Topf: '\u{1D54B}', - TripleDot: '\u20DB', - Tscr: '\u{1D4AF}', - Tstrok: '\u0166', - Uacute: '\xDA', - Uarr: '\u219F', - Uarrocir: '\u2949', - Ubrcy: '\u040E', - Ubreve: '\u016C', - Ucirc: '\xDB', - Ucy: '\u0423', - Udblac: '\u0170', - Ufr: '\u{1D518}', - Ugrave: '\xD9', - Umacr: '\u016A', - UnderBar: '_', - UnderBrace: '\u23DF', - UnderBracket: '\u23B5', - UnderParenthesis: '\u23DD', - Union: '\u22C3', - UnionPlus: '\u228E', - Uogon: '\u0172', - Uopf: '\u{1D54C}', - UpArrow: '\u2191', - UpArrowBar: '\u2912', - UpArrowDownArrow: '\u21C5', - UpDownArrow: '\u2195', - UpEquilibrium: '\u296E', - UpTee: '\u22A5', - UpTeeArrow: '\u21A5', - Uparrow: '\u21D1', - Updownarrow: '\u21D5', - UpperLeftArrow: '\u2196', - UpperRightArrow: '\u2197', - Upsi: '\u03D2', - Upsilon: '\u03A5', - Uring: '\u016E', - Uscr: '\u{1D4B0}', - Utilde: '\u0168', - Uuml: '\xDC', - VDash: '\u22AB', - Vbar: '\u2AEB', - Vcy: '\u0412', - Vdash: '\u22A9', - Vdashl: '\u2AE6', - Vee: '\u22C1', - Verbar: '\u2016', - Vert: '\u2016', - VerticalBar: '\u2223', - VerticalLine: '|', - VerticalSeparator: '\u2758', - VerticalTilde: '\u2240', - VeryThinSpace: '\u200A', - Vfr: '\u{1D519}', - Vopf: '\u{1D54D}', - Vscr: '\u{1D4B1}', - Vvdash: '\u22AA', - Wcirc: '\u0174', - Wedge: '\u22C0', - Wfr: '\u{1D51A}', - Wopf: '\u{1D54E}', - Wscr: '\u{1D4B2}', - Xfr: '\u{1D51B}', - Xi: '\u039E', - Xopf: '\u{1D54F}', - Xscr: '\u{1D4B3}', - YAcy: '\u042F', - YIcy: '\u0407', - YUcy: '\u042E', - Yacute: '\xDD', - Ycirc: '\u0176', - Ycy: '\u042B', - Yfr: '\u{1D51C}', - Yopf: '\u{1D550}', - Yscr: '\u{1D4B4}', - Yuml: '\u0178', - ZHcy: '\u0416', - Zacute: '\u0179', - Zcaron: '\u017D', - Zcy: '\u0417', - Zdot: '\u017B', - ZeroWidthSpace: '\u200B', - Zeta: '\u0396', - Zfr: '\u2128', - Zopf: '\u2124', - Zscr: '\u{1D4B5}', - aacute: '\xE1', - abreve: '\u0103', - ac: '\u223E', - acE: '\u223E\u0333', - acd: '\u223F', - acirc: '\xE2', - acute: '\xB4', - acy: '\u0430', - aelig: '\xE6', - af: '\u2061', - afr: '\u{1D51E}', - agrave: '\xE0', - alefsym: '\u2135', - aleph: '\u2135', - alpha: '\u03B1', - amacr: '\u0101', - amalg: '\u2A3F', - amp: '&', - and: '\u2227', - andand: '\u2A55', - andd: '\u2A5C', - andslope: '\u2A58', - andv: '\u2A5A', - ang: '\u2220', - ange: '\u29A4', - angle: '\u2220', - angmsd: '\u2221', - angmsdaa: '\u29A8', - angmsdab: '\u29A9', - angmsdac: '\u29AA', - angmsdad: '\u29AB', - angmsdae: '\u29AC', - angmsdaf: '\u29AD', - angmsdag: '\u29AE', - angmsdah: '\u29AF', - angrt: '\u221F', - angrtvb: '\u22BE', - angrtvbd: '\u299D', - angsph: '\u2222', - angst: '\xC5', - angzarr: '\u237C', - aogon: '\u0105', - aopf: '\u{1D552}', - ap: '\u2248', - apE: '\u2A70', - apacir: '\u2A6F', - ape: '\u224A', - apid: '\u224B', - apos: "'", - approx: '\u2248', - approxeq: '\u224A', - aring: '\xE5', - ascr: '\u{1D4B6}', - ast: '*', - asymp: '\u2248', - asympeq: '\u224D', - atilde: '\xE3', - auml: '\xE4', - awconint: '\u2233', - awint: '\u2A11', - bNot: '\u2AED', - backcong: '\u224C', - backepsilon: '\u03F6', - backprime: '\u2035', - backsim: '\u223D', - backsimeq: '\u22CD', - barvee: '\u22BD', - barwed: '\u2305', - barwedge: '\u2305', - bbrk: '\u23B5', - bbrktbrk: '\u23B6', - bcong: '\u224C', - bcy: '\u0431', - bdquo: '\u201E', - becaus: '\u2235', - because: '\u2235', - bemptyv: '\u29B0', - bepsi: '\u03F6', - bernou: '\u212C', - beta: '\u03B2', - beth: '\u2136', - between: '\u226C', - bfr: '\u{1D51F}', - bigcap: '\u22C2', - bigcirc: '\u25EF', - bigcup: '\u22C3', - bigodot: '\u2A00', - bigoplus: '\u2A01', - bigotimes: '\u2A02', - bigsqcup: '\u2A06', - bigstar: '\u2605', - bigtriangledown: '\u25BD', - bigtriangleup: '\u25B3', - biguplus: '\u2A04', - bigvee: '\u22C1', - bigwedge: '\u22C0', - bkarow: '\u290D', - blacklozenge: '\u29EB', - blacksquare: '\u25AA', - blacktriangle: '\u25B4', - blacktriangledown: '\u25BE', - blacktriangleleft: '\u25C2', - blacktriangleright: '\u25B8', - blank: '\u2423', - blk12: '\u2592', - blk14: '\u2591', - blk34: '\u2593', - block: '\u2588', - bne: '=\u20E5', - bnequiv: '\u2261\u20E5', - bnot: '\u2310', - bopf: '\u{1D553}', - bot: '\u22A5', - bottom: '\u22A5', - bowtie: '\u22C8', - boxDL: '\u2557', - boxDR: '\u2554', - boxDl: '\u2556', - boxDr: '\u2553', - boxH: '\u2550', - boxHD: '\u2566', - boxHU: '\u2569', - boxHd: '\u2564', - boxHu: '\u2567', - boxUL: '\u255D', - boxUR: '\u255A', - boxUl: '\u255C', - boxUr: '\u2559', - boxV: '\u2551', - boxVH: '\u256C', - boxVL: '\u2563', - boxVR: '\u2560', - boxVh: '\u256B', - boxVl: '\u2562', - boxVr: '\u255F', - boxbox: '\u29C9', - boxdL: '\u2555', - boxdR: '\u2552', - boxdl: '\u2510', - boxdr: '\u250C', - boxh: '\u2500', - boxhD: '\u2565', - boxhU: '\u2568', - boxhd: '\u252C', - boxhu: '\u2534', - boxminus: '\u229F', - boxplus: '\u229E', - boxtimes: '\u22A0', - boxuL: '\u255B', - boxuR: '\u2558', - boxul: '\u2518', - boxur: '\u2514', - boxv: '\u2502', - boxvH: '\u256A', - boxvL: '\u2561', - boxvR: '\u255E', - boxvh: '\u253C', - boxvl: '\u2524', - boxvr: '\u251C', - bprime: '\u2035', - breve: '\u02D8', - brvbar: '\xA6', - bscr: '\u{1D4B7}', - bsemi: '\u204F', - bsim: '\u223D', - bsime: '\u22CD', - bsol: '\\', - bsolb: '\u29C5', - bsolhsub: '\u27C8', - bull: '\u2022', - bullet: '\u2022', - bump: '\u224E', - bumpE: '\u2AAE', - bumpe: '\u224F', - bumpeq: '\u224F', - cacute: '\u0107', - cap: '\u2229', - capand: '\u2A44', - capbrcup: '\u2A49', - capcap: '\u2A4B', - capcup: '\u2A47', - capdot: '\u2A40', - caps: '\u2229\uFE00', - caret: '\u2041', - caron: '\u02C7', - ccaps: '\u2A4D', - ccaron: '\u010D', - ccedil: '\xE7', - ccirc: '\u0109', - ccups: '\u2A4C', - ccupssm: '\u2A50', - cdot: '\u010B', - cedil: '\xB8', - cemptyv: '\u29B2', - cent: '\xA2', - centerdot: '\xB7', - cfr: '\u{1D520}', - chcy: '\u0447', - check: '\u2713', - checkmark: '\u2713', - chi: '\u03C7', - cir: '\u25CB', - cirE: '\u29C3', - circ: '\u02C6', - circeq: '\u2257', - circlearrowleft: '\u21BA', - circlearrowright: '\u21BB', - circledR: '\xAE', - circledS: '\u24C8', - circledast: '\u229B', - circledcirc: '\u229A', - circleddash: '\u229D', - cire: '\u2257', - cirfnint: '\u2A10', - cirmid: '\u2AEF', - cirscir: '\u29C2', - clubs: '\u2663', - clubsuit: '\u2663', - colon: ':', - colone: '\u2254', - coloneq: '\u2254', - comma: ',', - commat: '@', - comp: '\u2201', - compfn: '\u2218', - complement: '\u2201', - complexes: '\u2102', - cong: '\u2245', - congdot: '\u2A6D', - conint: '\u222E', - copf: '\u{1D554}', - coprod: '\u2210', - copy: '\xA9', - copysr: '\u2117', - crarr: '\u21B5', - cross: '\u2717', - cscr: '\u{1D4B8}', - csub: '\u2ACF', - csube: '\u2AD1', - csup: '\u2AD0', - csupe: '\u2AD2', - ctdot: '\u22EF', - cudarrl: '\u2938', - cudarrr: '\u2935', - cuepr: '\u22DE', - cuesc: '\u22DF', - cularr: '\u21B6', - cularrp: '\u293D', - cup: '\u222A', - cupbrcap: '\u2A48', - cupcap: '\u2A46', - cupcup: '\u2A4A', - cupdot: '\u228D', - cupor: '\u2A45', - cups: '\u222A\uFE00', - curarr: '\u21B7', - curarrm: '\u293C', - curlyeqprec: '\u22DE', - curlyeqsucc: '\u22DF', - curlyvee: '\u22CE', - curlywedge: '\u22CF', - curren: '\xA4', - curvearrowleft: '\u21B6', - curvearrowright: '\u21B7', - cuvee: '\u22CE', - cuwed: '\u22CF', - cwconint: '\u2232', - cwint: '\u2231', - cylcty: '\u232D', - dArr: '\u21D3', - dHar: '\u2965', - dagger: '\u2020', - daleth: '\u2138', - darr: '\u2193', - dash: '\u2010', - dashv: '\u22A3', - dbkarow: '\u290F', - dblac: '\u02DD', - dcaron: '\u010F', - dcy: '\u0434', - dd: '\u2146', - ddagger: '\u2021', - ddarr: '\u21CA', - ddotseq: '\u2A77', - deg: '\xB0', - delta: '\u03B4', - demptyv: '\u29B1', - dfisht: '\u297F', - dfr: '\u{1D521}', - dharl: '\u21C3', - dharr: '\u21C2', - diam: '\u22C4', - diamond: '\u22C4', - diamondsuit: '\u2666', - diams: '\u2666', - die: '\xA8', - digamma: '\u03DD', - disin: '\u22F2', - div: '\xF7', - divide: '\xF7', - divideontimes: '\u22C7', - divonx: '\u22C7', - djcy: '\u0452', - dlcorn: '\u231E', - dlcrop: '\u230D', - dollar: '$', - dopf: '\u{1D555}', - dot: '\u02D9', - doteq: '\u2250', - doteqdot: '\u2251', - dotminus: '\u2238', - dotplus: '\u2214', - dotsquare: '\u22A1', - doublebarwedge: '\u2306', - downarrow: '\u2193', - downdownarrows: '\u21CA', - downharpoonleft: '\u21C3', - downharpoonright: '\u21C2', - drbkarow: '\u2910', - drcorn: '\u231F', - drcrop: '\u230C', - dscr: '\u{1D4B9}', - dscy: '\u0455', - dsol: '\u29F6', - dstrok: '\u0111', - dtdot: '\u22F1', - dtri: '\u25BF', - dtrif: '\u25BE', - duarr: '\u21F5', - duhar: '\u296F', - dwangle: '\u29A6', - dzcy: '\u045F', - dzigrarr: '\u27FF', - eDDot: '\u2A77', - eDot: '\u2251', - eacute: '\xE9', - easter: '\u2A6E', - ecaron: '\u011B', - ecir: '\u2256', - ecirc: '\xEA', - ecolon: '\u2255', - ecy: '\u044D', - edot: '\u0117', - ee: '\u2147', - efDot: '\u2252', - efr: '\u{1D522}', - eg: '\u2A9A', - egrave: '\xE8', - egs: '\u2A96', - egsdot: '\u2A98', - el: '\u2A99', - elinters: '\u23E7', - ell: '\u2113', - els: '\u2A95', - elsdot: '\u2A97', - emacr: '\u0113', - empty: '\u2205', - emptyset: '\u2205', - emptyv: '\u2205', - emsp13: '\u2004', - emsp14: '\u2005', - emsp: '\u2003', - eng: '\u014B', - ensp: '\u2002', - eogon: '\u0119', - eopf: '\u{1D556}', - epar: '\u22D5', - eparsl: '\u29E3', - eplus: '\u2A71', - epsi: '\u03B5', - epsilon: '\u03B5', - epsiv: '\u03F5', - eqcirc: '\u2256', - eqcolon: '\u2255', - eqsim: '\u2242', - eqslantgtr: '\u2A96', - eqslantless: '\u2A95', - equals: '=', - equest: '\u225F', - equiv: '\u2261', - equivDD: '\u2A78', - eqvparsl: '\u29E5', - erDot: '\u2253', - erarr: '\u2971', - escr: '\u212F', - esdot: '\u2250', - esim: '\u2242', - eta: '\u03B7', - eth: '\xF0', - euml: '\xEB', - euro: '\u20AC', - excl: '!', - exist: '\u2203', - expectation: '\u2130', - exponentiale: '\u2147', - fallingdotseq: '\u2252', - fcy: '\u0444', - female: '\u2640', - ffilig: '\uFB03', - fflig: '\uFB00', - ffllig: '\uFB04', - ffr: '\u{1D523}', - filig: '\uFB01', - fjlig: 'fj', - flat: '\u266D', - fllig: '\uFB02', - fltns: '\u25B1', - fnof: '\u0192', - fopf: '\u{1D557}', - forall: '\u2200', - fork: '\u22D4', - forkv: '\u2AD9', - fpartint: '\u2A0D', - frac12: '\xBD', - frac13: '\u2153', - frac14: '\xBC', - frac15: '\u2155', - frac16: '\u2159', - frac18: '\u215B', - frac23: '\u2154', - frac25: '\u2156', - frac34: '\xBE', - frac35: '\u2157', - frac38: '\u215C', - frac45: '\u2158', - frac56: '\u215A', - frac58: '\u215D', - frac78: '\u215E', - frasl: '\u2044', - frown: '\u2322', - fscr: '\u{1D4BB}', - gE: '\u2267', - gEl: '\u2A8C', - gacute: '\u01F5', - gamma: '\u03B3', - gammad: '\u03DD', - gap: '\u2A86', - gbreve: '\u011F', - gcirc: '\u011D', - gcy: '\u0433', - gdot: '\u0121', - ge: '\u2265', - gel: '\u22DB', - geq: '\u2265', - geqq: '\u2267', - geqslant: '\u2A7E', - ges: '\u2A7E', - gescc: '\u2AA9', - gesdot: '\u2A80', - gesdoto: '\u2A82', - gesdotol: '\u2A84', - gesl: '\u22DB\uFE00', - gesles: '\u2A94', - gfr: '\u{1D524}', - gg: '\u226B', - ggg: '\u22D9', - gimel: '\u2137', - gjcy: '\u0453', - gl: '\u2277', - glE: '\u2A92', - gla: '\u2AA5', - glj: '\u2AA4', - gnE: '\u2269', - gnap: '\u2A8A', - gnapprox: '\u2A8A', - gne: '\u2A88', - gneq: '\u2A88', - gneqq: '\u2269', - gnsim: '\u22E7', - gopf: '\u{1D558}', - grave: '`', - gscr: '\u210A', - gsim: '\u2273', - gsime: '\u2A8E', - gsiml: '\u2A90', - gt: '>', - gtcc: '\u2AA7', - gtcir: '\u2A7A', - gtdot: '\u22D7', - gtlPar: '\u2995', - gtquest: '\u2A7C', - gtrapprox: '\u2A86', - gtrarr: '\u2978', - gtrdot: '\u22D7', - gtreqless: '\u22DB', - gtreqqless: '\u2A8C', - gtrless: '\u2277', - gtrsim: '\u2273', - gvertneqq: '\u2269\uFE00', - gvnE: '\u2269\uFE00', - hArr: '\u21D4', - hairsp: '\u200A', - half: '\xBD', - hamilt: '\u210B', - hardcy: '\u044A', - harr: '\u2194', - harrcir: '\u2948', - harrw: '\u21AD', - hbar: '\u210F', - hcirc: '\u0125', - hearts: '\u2665', - heartsuit: '\u2665', - hellip: '\u2026', - hercon: '\u22B9', - hfr: '\u{1D525}', - hksearow: '\u2925', - hkswarow: '\u2926', - hoarr: '\u21FF', - homtht: '\u223B', - hookleftarrow: '\u21A9', - hookrightarrow: '\u21AA', - hopf: '\u{1D559}', - horbar: '\u2015', - hscr: '\u{1D4BD}', - hslash: '\u210F', - hstrok: '\u0127', - hybull: '\u2043', - hyphen: '\u2010', - iacute: '\xED', - ic: '\u2063', - icirc: '\xEE', - icy: '\u0438', - iecy: '\u0435', - iexcl: '\xA1', - iff: '\u21D4', - ifr: '\u{1D526}', - igrave: '\xEC', - ii: '\u2148', - iiiint: '\u2A0C', - iiint: '\u222D', - iinfin: '\u29DC', - iiota: '\u2129', - ijlig: '\u0133', - imacr: '\u012B', - image: '\u2111', - imagline: '\u2110', - imagpart: '\u2111', - imath: '\u0131', - imof: '\u22B7', - imped: '\u01B5', - in: '\u2208', - incare: '\u2105', - infin: '\u221E', - infintie: '\u29DD', - inodot: '\u0131', - int: '\u222B', - intcal: '\u22BA', - integers: '\u2124', - intercal: '\u22BA', - intlarhk: '\u2A17', - intprod: '\u2A3C', - iocy: '\u0451', - iogon: '\u012F', - iopf: '\u{1D55A}', - iota: '\u03B9', - iprod: '\u2A3C', - iquest: '\xBF', - iscr: '\u{1D4BE}', - isin: '\u2208', - isinE: '\u22F9', - isindot: '\u22F5', - isins: '\u22F4', - isinsv: '\u22F3', - isinv: '\u2208', - it: '\u2062', - itilde: '\u0129', - iukcy: '\u0456', - iuml: '\xEF', - jcirc: '\u0135', - jcy: '\u0439', - jfr: '\u{1D527}', - jmath: '\u0237', - jopf: '\u{1D55B}', - jscr: '\u{1D4BF}', - jsercy: '\u0458', - jukcy: '\u0454', - kappa: '\u03BA', - kappav: '\u03F0', - kcedil: '\u0137', - kcy: '\u043A', - kfr: '\u{1D528}', - kgreen: '\u0138', - khcy: '\u0445', - kjcy: '\u045C', - kopf: '\u{1D55C}', - kscr: '\u{1D4C0}', - lAarr: '\u21DA', - lArr: '\u21D0', - lAtail: '\u291B', - lBarr: '\u290E', - lE: '\u2266', - lEg: '\u2A8B', - lHar: '\u2962', - lacute: '\u013A', - laemptyv: '\u29B4', - lagran: '\u2112', - lambda: '\u03BB', - lang: '\u27E8', - langd: '\u2991', - langle: '\u27E8', - lap: '\u2A85', - laquo: '\xAB', - larr: '\u2190', - larrb: '\u21E4', - larrbfs: '\u291F', - larrfs: '\u291D', - larrhk: '\u21A9', - larrlp: '\u21AB', - larrpl: '\u2939', - larrsim: '\u2973', - larrtl: '\u21A2', - lat: '\u2AAB', - latail: '\u2919', - late: '\u2AAD', - lates: '\u2AAD\uFE00', - lbarr: '\u290C', - lbbrk: '\u2772', - lbrace: '{', - lbrack: '[', - lbrke: '\u298B', - lbrksld: '\u298F', - lbrkslu: '\u298D', - lcaron: '\u013E', - lcedil: '\u013C', - lceil: '\u2308', - lcub: '{', - lcy: '\u043B', - ldca: '\u2936', - ldquo: '\u201C', - ldquor: '\u201E', - ldrdhar: '\u2967', - ldrushar: '\u294B', - ldsh: '\u21B2', - le: '\u2264', - leftarrow: '\u2190', - leftarrowtail: '\u21A2', - leftharpoondown: '\u21BD', - leftharpoonup: '\u21BC', - leftleftarrows: '\u21C7', - leftrightarrow: '\u2194', - leftrightarrows: '\u21C6', - leftrightharpoons: '\u21CB', - leftrightsquigarrow: '\u21AD', - leftthreetimes: '\u22CB', - leg: '\u22DA', - leq: '\u2264', - leqq: '\u2266', - leqslant: '\u2A7D', - les: '\u2A7D', - lescc: '\u2AA8', - lesdot: '\u2A7F', - lesdoto: '\u2A81', - lesdotor: '\u2A83', - lesg: '\u22DA\uFE00', - lesges: '\u2A93', - lessapprox: '\u2A85', - lessdot: '\u22D6', - lesseqgtr: '\u22DA', - lesseqqgtr: '\u2A8B', - lessgtr: '\u2276', - lesssim: '\u2272', - lfisht: '\u297C', - lfloor: '\u230A', - lfr: '\u{1D529}', - lg: '\u2276', - lgE: '\u2A91', - lhard: '\u21BD', - lharu: '\u21BC', - lharul: '\u296A', - lhblk: '\u2584', - ljcy: '\u0459', - ll: '\u226A', - llarr: '\u21C7', - llcorner: '\u231E', - llhard: '\u296B', - lltri: '\u25FA', - lmidot: '\u0140', - lmoust: '\u23B0', - lmoustache: '\u23B0', - lnE: '\u2268', - lnap: '\u2A89', - lnapprox: '\u2A89', - lne: '\u2A87', - lneq: '\u2A87', - lneqq: '\u2268', - lnsim: '\u22E6', - loang: '\u27EC', - loarr: '\u21FD', - lobrk: '\u27E6', - longleftarrow: '\u27F5', - longleftrightarrow: '\u27F7', - longmapsto: '\u27FC', - longrightarrow: '\u27F6', - looparrowleft: '\u21AB', - looparrowright: '\u21AC', - lopar: '\u2985', - lopf: '\u{1D55D}', - loplus: '\u2A2D', - lotimes: '\u2A34', - lowast: '\u2217', - lowbar: '_', - loz: '\u25CA', - lozenge: '\u25CA', - lozf: '\u29EB', - lpar: '(', - lparlt: '\u2993', - lrarr: '\u21C6', - lrcorner: '\u231F', - lrhar: '\u21CB', - lrhard: '\u296D', - lrm: '\u200E', - lrtri: '\u22BF', - lsaquo: '\u2039', - lscr: '\u{1D4C1}', - lsh: '\u21B0', - lsim: '\u2272', - lsime: '\u2A8D', - lsimg: '\u2A8F', - lsqb: '[', - lsquo: '\u2018', - lsquor: '\u201A', - lstrok: '\u0142', - lt: '<', - ltcc: '\u2AA6', - ltcir: '\u2A79', - ltdot: '\u22D6', - lthree: '\u22CB', - ltimes: '\u22C9', - ltlarr: '\u2976', - ltquest: '\u2A7B', - ltrPar: '\u2996', - ltri: '\u25C3', - ltrie: '\u22B4', - ltrif: '\u25C2', - lurdshar: '\u294A', - luruhar: '\u2966', - lvertneqq: '\u2268\uFE00', - lvnE: '\u2268\uFE00', - mDDot: '\u223A', - macr: '\xAF', - male: '\u2642', - malt: '\u2720', - maltese: '\u2720', - map: '\u21A6', - mapsto: '\u21A6', - mapstodown: '\u21A7', - mapstoleft: '\u21A4', - mapstoup: '\u21A5', - marker: '\u25AE', - mcomma: '\u2A29', - mcy: '\u043C', - mdash: '\u2014', - measuredangle: '\u2221', - mfr: '\u{1D52A}', - mho: '\u2127', - micro: '\xB5', - mid: '\u2223', - midast: '*', - midcir: '\u2AF0', - middot: '\xB7', - minus: '\u2212', - minusb: '\u229F', - minusd: '\u2238', - minusdu: '\u2A2A', - mlcp: '\u2ADB', - mldr: '\u2026', - mnplus: '\u2213', - models: '\u22A7', - mopf: '\u{1D55E}', - mp: '\u2213', - mscr: '\u{1D4C2}', - mstpos: '\u223E', - mu: '\u03BC', - multimap: '\u22B8', - mumap: '\u22B8', - nGg: '\u22D9\u0338', - nGt: '\u226B\u20D2', - nGtv: '\u226B\u0338', - nLeftarrow: '\u21CD', - nLeftrightarrow: '\u21CE', - nLl: '\u22D8\u0338', - nLt: '\u226A\u20D2', - nLtv: '\u226A\u0338', - nRightarrow: '\u21CF', - nVDash: '\u22AF', - nVdash: '\u22AE', - nabla: '\u2207', - nacute: '\u0144', - nang: '\u2220\u20D2', - nap: '\u2249', - napE: '\u2A70\u0338', - napid: '\u224B\u0338', - napos: '\u0149', - napprox: '\u2249', - natur: '\u266E', - natural: '\u266E', - naturals: '\u2115', - nbsp: '\xA0', - nbump: '\u224E\u0338', - nbumpe: '\u224F\u0338', - ncap: '\u2A43', - ncaron: '\u0148', - ncedil: '\u0146', - ncong: '\u2247', - ncongdot: '\u2A6D\u0338', - ncup: '\u2A42', - ncy: '\u043D', - ndash: '\u2013', - ne: '\u2260', - neArr: '\u21D7', - nearhk: '\u2924', - nearr: '\u2197', - nearrow: '\u2197', - nedot: '\u2250\u0338', - nequiv: '\u2262', - nesear: '\u2928', - nesim: '\u2242\u0338', - nexist: '\u2204', - nexists: '\u2204', - nfr: '\u{1D52B}', - ngE: '\u2267\u0338', - nge: '\u2271', - ngeq: '\u2271', - ngeqq: '\u2267\u0338', - ngeqslant: '\u2A7E\u0338', - nges: '\u2A7E\u0338', - ngsim: '\u2275', - ngt: '\u226F', - ngtr: '\u226F', - nhArr: '\u21CE', - nharr: '\u21AE', - nhpar: '\u2AF2', - ni: '\u220B', - nis: '\u22FC', - nisd: '\u22FA', - niv: '\u220B', - njcy: '\u045A', - nlArr: '\u21CD', - nlE: '\u2266\u0338', - nlarr: '\u219A', - nldr: '\u2025', - nle: '\u2270', - nleftarrow: '\u219A', - nleftrightarrow: '\u21AE', - nleq: '\u2270', - nleqq: '\u2266\u0338', - nleqslant: '\u2A7D\u0338', - nles: '\u2A7D\u0338', - nless: '\u226E', - nlsim: '\u2274', - nlt: '\u226E', - nltri: '\u22EA', - nltrie: '\u22EC', - nmid: '\u2224', - nopf: '\u{1D55F}', - not: '\xAC', - notin: '\u2209', - notinE: '\u22F9\u0338', - notindot: '\u22F5\u0338', - notinva: '\u2209', - notinvb: '\u22F7', - notinvc: '\u22F6', - notni: '\u220C', - notniva: '\u220C', - notnivb: '\u22FE', - notnivc: '\u22FD', - npar: '\u2226', - nparallel: '\u2226', - nparsl: '\u2AFD\u20E5', - npart: '\u2202\u0338', - npolint: '\u2A14', - npr: '\u2280', - nprcue: '\u22E0', - npre: '\u2AAF\u0338', - nprec: '\u2280', - npreceq: '\u2AAF\u0338', - nrArr: '\u21CF', - nrarr: '\u219B', - nrarrc: '\u2933\u0338', - nrarrw: '\u219D\u0338', - nrightarrow: '\u219B', - nrtri: '\u22EB', - nrtrie: '\u22ED', - nsc: '\u2281', - nsccue: '\u22E1', - nsce: '\u2AB0\u0338', - nscr: '\u{1D4C3}', - nshortmid: '\u2224', - nshortparallel: '\u2226', - nsim: '\u2241', - nsime: '\u2244', - nsimeq: '\u2244', - nsmid: '\u2224', - nspar: '\u2226', - nsqsube: '\u22E2', - nsqsupe: '\u22E3', - nsub: '\u2284', - nsubE: '\u2AC5\u0338', - nsube: '\u2288', - nsubset: '\u2282\u20D2', - nsubseteq: '\u2288', - nsubseteqq: '\u2AC5\u0338', - nsucc: '\u2281', - nsucceq: '\u2AB0\u0338', - nsup: '\u2285', - nsupE: '\u2AC6\u0338', - nsupe: '\u2289', - nsupset: '\u2283\u20D2', - nsupseteq: '\u2289', - nsupseteqq: '\u2AC6\u0338', - ntgl: '\u2279', - ntilde: '\xF1', - ntlg: '\u2278', - ntriangleleft: '\u22EA', - ntrianglelefteq: '\u22EC', - ntriangleright: '\u22EB', - ntrianglerighteq: '\u22ED', - nu: '\u03BD', - num: '#', - numero: '\u2116', - numsp: '\u2007', - nvDash: '\u22AD', - nvHarr: '\u2904', - nvap: '\u224D\u20D2', - nvdash: '\u22AC', - nvge: '\u2265\u20D2', - nvgt: '>\u20D2', - nvinfin: '\u29DE', - nvlArr: '\u2902', - nvle: '\u2264\u20D2', - nvlt: '<\u20D2', - nvltrie: '\u22B4\u20D2', - nvrArr: '\u2903', - nvrtrie: '\u22B5\u20D2', - nvsim: '\u223C\u20D2', - nwArr: '\u21D6', - nwarhk: '\u2923', - nwarr: '\u2196', - nwarrow: '\u2196', - nwnear: '\u2927', - oS: '\u24C8', - oacute: '\xF3', - oast: '\u229B', - ocir: '\u229A', - ocirc: '\xF4', - ocy: '\u043E', - odash: '\u229D', - odblac: '\u0151', - odiv: '\u2A38', - odot: '\u2299', - odsold: '\u29BC', - oelig: '\u0153', - ofcir: '\u29BF', - ofr: '\u{1D52C}', - ogon: '\u02DB', - ograve: '\xF2', - ogt: '\u29C1', - ohbar: '\u29B5', - ohm: '\u03A9', - oint: '\u222E', - olarr: '\u21BA', - olcir: '\u29BE', - olcross: '\u29BB', - oline: '\u203E', - olt: '\u29C0', - omacr: '\u014D', - omega: '\u03C9', - omicron: '\u03BF', - omid: '\u29B6', - ominus: '\u2296', - oopf: '\u{1D560}', - opar: '\u29B7', - operp: '\u29B9', - oplus: '\u2295', - or: '\u2228', - orarr: '\u21BB', - ord: '\u2A5D', - order: '\u2134', - orderof: '\u2134', - ordf: '\xAA', - ordm: '\xBA', - origof: '\u22B6', - oror: '\u2A56', - orslope: '\u2A57', - orv: '\u2A5B', - oscr: '\u2134', - oslash: '\xF8', - osol: '\u2298', - otilde: '\xF5', - otimes: '\u2297', - otimesas: '\u2A36', - ouml: '\xF6', - ovbar: '\u233D', - par: '\u2225', - para: '\xB6', - parallel: '\u2225', - parsim: '\u2AF3', - parsl: '\u2AFD', - part: '\u2202', - pcy: '\u043F', - percnt: '%', - period: '.', - permil: '\u2030', - perp: '\u22A5', - pertenk: '\u2031', - pfr: '\u{1D52D}', - phi: '\u03C6', - phiv: '\u03D5', - phmmat: '\u2133', - phone: '\u260E', - pi: '\u03C0', - pitchfork: '\u22D4', - piv: '\u03D6', - planck: '\u210F', - planckh: '\u210E', - plankv: '\u210F', - plus: '+', - plusacir: '\u2A23', - plusb: '\u229E', - pluscir: '\u2A22', - plusdo: '\u2214', - plusdu: '\u2A25', - pluse: '\u2A72', - plusmn: '\xB1', - plussim: '\u2A26', - plustwo: '\u2A27', - pm: '\xB1', - pointint: '\u2A15', - popf: '\u{1D561}', - pound: '\xA3', - pr: '\u227A', - prE: '\u2AB3', - prap: '\u2AB7', - prcue: '\u227C', - pre: '\u2AAF', - prec: '\u227A', - precapprox: '\u2AB7', - preccurlyeq: '\u227C', - preceq: '\u2AAF', - precnapprox: '\u2AB9', - precneqq: '\u2AB5', - precnsim: '\u22E8', - precsim: '\u227E', - prime: '\u2032', - primes: '\u2119', - prnE: '\u2AB5', - prnap: '\u2AB9', - prnsim: '\u22E8', - prod: '\u220F', - profalar: '\u232E', - profline: '\u2312', - profsurf: '\u2313', - prop: '\u221D', - propto: '\u221D', - prsim: '\u227E', - prurel: '\u22B0', - pscr: '\u{1D4C5}', - psi: '\u03C8', - puncsp: '\u2008', - qfr: '\u{1D52E}', - qint: '\u2A0C', - qopf: '\u{1D562}', - qprime: '\u2057', - qscr: '\u{1D4C6}', - quaternions: '\u210D', - quatint: '\u2A16', - quest: '?', - questeq: '\u225F', - quot: '"', - rAarr: '\u21DB', - rArr: '\u21D2', - rAtail: '\u291C', - rBarr: '\u290F', - rHar: '\u2964', - race: '\u223D\u0331', - racute: '\u0155', - radic: '\u221A', - raemptyv: '\u29B3', - rang: '\u27E9', - rangd: '\u2992', - range: '\u29A5', - rangle: '\u27E9', - raquo: '\xBB', - rarr: '\u2192', - rarrap: '\u2975', - rarrb: '\u21E5', - rarrbfs: '\u2920', - rarrc: '\u2933', - rarrfs: '\u291E', - rarrhk: '\u21AA', - rarrlp: '\u21AC', - rarrpl: '\u2945', - rarrsim: '\u2974', - rarrtl: '\u21A3', - rarrw: '\u219D', - ratail: '\u291A', - ratio: '\u2236', - rationals: '\u211A', - rbarr: '\u290D', - rbbrk: '\u2773', - rbrace: '}', - rbrack: ']', - rbrke: '\u298C', - rbrksld: '\u298E', - rbrkslu: '\u2990', - rcaron: '\u0159', - rcedil: '\u0157', - rceil: '\u2309', - rcub: '}', - rcy: '\u0440', - rdca: '\u2937', - rdldhar: '\u2969', - rdquo: '\u201D', - rdquor: '\u201D', - rdsh: '\u21B3', - real: '\u211C', - realine: '\u211B', - realpart: '\u211C', - reals: '\u211D', - rect: '\u25AD', - reg: '\xAE', - rfisht: '\u297D', - rfloor: '\u230B', - rfr: '\u{1D52F}', - rhard: '\u21C1', - rharu: '\u21C0', - rharul: '\u296C', - rho: '\u03C1', - rhov: '\u03F1', - rightarrow: '\u2192', - rightarrowtail: '\u21A3', - rightharpoondown: '\u21C1', - rightharpoonup: '\u21C0', - rightleftarrows: '\u21C4', - rightleftharpoons: '\u21CC', - rightrightarrows: '\u21C9', - rightsquigarrow: '\u219D', - rightthreetimes: '\u22CC', - ring: '\u02DA', - risingdotseq: '\u2253', - rlarr: '\u21C4', - rlhar: '\u21CC', - rlm: '\u200F', - rmoust: '\u23B1', - rmoustache: '\u23B1', - rnmid: '\u2AEE', - roang: '\u27ED', - roarr: '\u21FE', - robrk: '\u27E7', - ropar: '\u2986', - ropf: '\u{1D563}', - roplus: '\u2A2E', - rotimes: '\u2A35', - rpar: ')', - rpargt: '\u2994', - rppolint: '\u2A12', - rrarr: '\u21C9', - rsaquo: '\u203A', - rscr: '\u{1D4C7}', - rsh: '\u21B1', - rsqb: ']', - rsquo: '\u2019', - rsquor: '\u2019', - rthree: '\u22CC', - rtimes: '\u22CA', - rtri: '\u25B9', - rtrie: '\u22B5', - rtrif: '\u25B8', - rtriltri: '\u29CE', - ruluhar: '\u2968', - rx: '\u211E', - sacute: '\u015B', - sbquo: '\u201A', - sc: '\u227B', - scE: '\u2AB4', - scap: '\u2AB8', - scaron: '\u0161', - sccue: '\u227D', - sce: '\u2AB0', - scedil: '\u015F', - scirc: '\u015D', - scnE: '\u2AB6', - scnap: '\u2ABA', - scnsim: '\u22E9', - scpolint: '\u2A13', - scsim: '\u227F', - scy: '\u0441', - sdot: '\u22C5', - sdotb: '\u22A1', - sdote: '\u2A66', - seArr: '\u21D8', - searhk: '\u2925', - searr: '\u2198', - searrow: '\u2198', - sect: '\xA7', - semi: ';', - seswar: '\u2929', - setminus: '\u2216', - setmn: '\u2216', - sext: '\u2736', - sfr: '\u{1D530}', - sfrown: '\u2322', - sharp: '\u266F', - shchcy: '\u0449', - shcy: '\u0448', - shortmid: '\u2223', - shortparallel: '\u2225', - shy: '\xAD', - sigma: '\u03C3', - sigmaf: '\u03C2', - sigmav: '\u03C2', - sim: '\u223C', - simdot: '\u2A6A', - sime: '\u2243', - simeq: '\u2243', - simg: '\u2A9E', - simgE: '\u2AA0', - siml: '\u2A9D', - simlE: '\u2A9F', - simne: '\u2246', - simplus: '\u2A24', - simrarr: '\u2972', - slarr: '\u2190', - smallsetminus: '\u2216', - smashp: '\u2A33', - smeparsl: '\u29E4', - smid: '\u2223', - smile: '\u2323', - smt: '\u2AAA', - smte: '\u2AAC', - smtes: '\u2AAC\uFE00', - softcy: '\u044C', - sol: '/', - solb: '\u29C4', - solbar: '\u233F', - sopf: '\u{1D564}', - spades: '\u2660', - spadesuit: '\u2660', - spar: '\u2225', - sqcap: '\u2293', - sqcaps: '\u2293\uFE00', - sqcup: '\u2294', - sqcups: '\u2294\uFE00', - sqsub: '\u228F', - sqsube: '\u2291', - sqsubset: '\u228F', - sqsubseteq: '\u2291', - sqsup: '\u2290', - sqsupe: '\u2292', - sqsupset: '\u2290', - sqsupseteq: '\u2292', - squ: '\u25A1', - square: '\u25A1', - squarf: '\u25AA', - squf: '\u25AA', - srarr: '\u2192', - sscr: '\u{1D4C8}', - ssetmn: '\u2216', - ssmile: '\u2323', - sstarf: '\u22C6', - star: '\u2606', - starf: '\u2605', - straightepsilon: '\u03F5', - straightphi: '\u03D5', - strns: '\xAF', - sub: '\u2282', - subE: '\u2AC5', - subdot: '\u2ABD', - sube: '\u2286', - subedot: '\u2AC3', - submult: '\u2AC1', - subnE: '\u2ACB', - subne: '\u228A', - subplus: '\u2ABF', - subrarr: '\u2979', - subset: '\u2282', - subseteq: '\u2286', - subseteqq: '\u2AC5', - subsetneq: '\u228A', - subsetneqq: '\u2ACB', - subsim: '\u2AC7', - subsub: '\u2AD5', - subsup: '\u2AD3', - succ: '\u227B', - succapprox: '\u2AB8', - succcurlyeq: '\u227D', - succeq: '\u2AB0', - succnapprox: '\u2ABA', - succneqq: '\u2AB6', - succnsim: '\u22E9', - succsim: '\u227F', - sum: '\u2211', - sung: '\u266A', - sup1: '\xB9', - sup2: '\xB2', - sup3: '\xB3', - sup: '\u2283', - supE: '\u2AC6', - supdot: '\u2ABE', - supdsub: '\u2AD8', - supe: '\u2287', - supedot: '\u2AC4', - suphsol: '\u27C9', - suphsub: '\u2AD7', - suplarr: '\u297B', - supmult: '\u2AC2', - supnE: '\u2ACC', - supne: '\u228B', - supplus: '\u2AC0', - supset: '\u2283', - supseteq: '\u2287', - supseteqq: '\u2AC6', - supsetneq: '\u228B', - supsetneqq: '\u2ACC', - supsim: '\u2AC8', - supsub: '\u2AD4', - supsup: '\u2AD6', - swArr: '\u21D9', - swarhk: '\u2926', - swarr: '\u2199', - swarrow: '\u2199', - swnwar: '\u292A', - szlig: '\xDF', - target: '\u2316', - tau: '\u03C4', - tbrk: '\u23B4', - tcaron: '\u0165', - tcedil: '\u0163', - tcy: '\u0442', - tdot: '\u20DB', - telrec: '\u2315', - tfr: '\u{1D531}', - there4: '\u2234', - therefore: '\u2234', - theta: '\u03B8', - thetasym: '\u03D1', - thetav: '\u03D1', - thickapprox: '\u2248', - thicksim: '\u223C', - thinsp: '\u2009', - thkap: '\u2248', - thksim: '\u223C', - thorn: '\xFE', - tilde: '\u02DC', - times: '\xD7', - timesb: '\u22A0', - timesbar: '\u2A31', - timesd: '\u2A30', - tint: '\u222D', - toea: '\u2928', - top: '\u22A4', - topbot: '\u2336', - topcir: '\u2AF1', - topf: '\u{1D565}', - topfork: '\u2ADA', - tosa: '\u2929', - tprime: '\u2034', - trade: '\u2122', - triangle: '\u25B5', - triangledown: '\u25BF', - triangleleft: '\u25C3', - trianglelefteq: '\u22B4', - triangleq: '\u225C', - triangleright: '\u25B9', - trianglerighteq: '\u22B5', - tridot: '\u25EC', - trie: '\u225C', - triminus: '\u2A3A', - triplus: '\u2A39', - trisb: '\u29CD', - tritime: '\u2A3B', - trpezium: '\u23E2', - tscr: '\u{1D4C9}', - tscy: '\u0446', - tshcy: '\u045B', - tstrok: '\u0167', - twixt: '\u226C', - twoheadleftarrow: '\u219E', - twoheadrightarrow: '\u21A0', - uArr: '\u21D1', - uHar: '\u2963', - uacute: '\xFA', - uarr: '\u2191', - ubrcy: '\u045E', - ubreve: '\u016D', - ucirc: '\xFB', - ucy: '\u0443', - udarr: '\u21C5', - udblac: '\u0171', - udhar: '\u296E', - ufisht: '\u297E', - ufr: '\u{1D532}', - ugrave: '\xF9', - uharl: '\u21BF', - uharr: '\u21BE', - uhblk: '\u2580', - ulcorn: '\u231C', - ulcorner: '\u231C', - ulcrop: '\u230F', - ultri: '\u25F8', - umacr: '\u016B', - uml: '\xA8', - uogon: '\u0173', - uopf: '\u{1D566}', - uparrow: '\u2191', - updownarrow: '\u2195', - upharpoonleft: '\u21BF', - upharpoonright: '\u21BE', - uplus: '\u228E', - upsi: '\u03C5', - upsih: '\u03D2', - upsilon: '\u03C5', - upuparrows: '\u21C8', - urcorn: '\u231D', - urcorner: '\u231D', - urcrop: '\u230E', - uring: '\u016F', - urtri: '\u25F9', - uscr: '\u{1D4CA}', - utdot: '\u22F0', - utilde: '\u0169', - utri: '\u25B5', - utrif: '\u25B4', - uuarr: '\u21C8', - uuml: '\xFC', - uwangle: '\u29A7', - vArr: '\u21D5', - vBar: '\u2AE8', - vBarv: '\u2AE9', - vDash: '\u22A8', - vangrt: '\u299C', - varepsilon: '\u03F5', - varkappa: '\u03F0', - varnothing: '\u2205', - varphi: '\u03D5', - varpi: '\u03D6', - varpropto: '\u221D', - varr: '\u2195', - varrho: '\u03F1', - varsigma: '\u03C2', - varsubsetneq: '\u228A\uFE00', - varsubsetneqq: '\u2ACB\uFE00', - varsupsetneq: '\u228B\uFE00', - varsupsetneqq: '\u2ACC\uFE00', - vartheta: '\u03D1', - vartriangleleft: '\u22B2', - vartriangleright: '\u22B3', - vcy: '\u0432', - vdash: '\u22A2', - vee: '\u2228', - veebar: '\u22BB', - veeeq: '\u225A', - vellip: '\u22EE', - verbar: '|', - vert: '|', - vfr: '\u{1D533}', - vltri: '\u22B2', - vnsub: '\u2282\u20D2', - vnsup: '\u2283\u20D2', - vopf: '\u{1D567}', - vprop: '\u221D', - vrtri: '\u22B3', - vscr: '\u{1D4CB}', - vsubnE: '\u2ACB\uFE00', - vsubne: '\u228A\uFE00', - vsupnE: '\u2ACC\uFE00', - vsupne: '\u228B\uFE00', - vzigzag: '\u299A', - wcirc: '\u0175', - wedbar: '\u2A5F', - wedge: '\u2227', - wedgeq: '\u2259', - weierp: '\u2118', - wfr: '\u{1D534}', - wopf: '\u{1D568}', - wp: '\u2118', - wr: '\u2240', - wreath: '\u2240', - wscr: '\u{1D4CC}', - xcap: '\u22C2', - xcirc: '\u25EF', - xcup: '\u22C3', - xdtri: '\u25BD', - xfr: '\u{1D535}', - xhArr: '\u27FA', - xharr: '\u27F7', - xi: '\u03BE', - xlArr: '\u27F8', - xlarr: '\u27F5', - xmap: '\u27FC', - xnis: '\u22FB', - xodot: '\u2A00', - xopf: '\u{1D569}', - xoplus: '\u2A01', - xotime: '\u2A02', - xrArr: '\u27F9', - xrarr: '\u27F6', - xscr: '\u{1D4CD}', - xsqcup: '\u2A06', - xuplus: '\u2A04', - xutri: '\u25B3', - xvee: '\u22C1', - xwedge: '\u22C0', - yacute: '\xFD', - yacy: '\u044F', - ycirc: '\u0177', - ycy: '\u044B', - yen: '\xA5', - yfr: '\u{1D536}', - yicy: '\u0457', - yopf: '\u{1D56A}', - yscr: '\u{1D4CE}', - yucy: '\u044E', - yuml: '\xFF', - zacute: '\u017A', - zcaron: '\u017E', - zcy: '\u0437', - zdot: '\u017C', - zeetrf: '\u2128', - zeta: '\u03B6', - zfr: '\u{1D537}', - zhcy: '\u0436', - zigrarr: '\u21DD', - zopf: '\u{1D56B}', - zscr: '\u{1D4CF}', - zwj: '\u200D', - zwnj: '\u200C', -}; - -// node_modules/decode-named-character-reference/index.js -var own3 = {}.hasOwnProperty; -function decodeNamedCharacterReference(value) { - return own3.call(characterEntities, value) ? characterEntities[value] : false; -} - -// node_modules/micromark-core-commonmark/lib/character-reference.js -var characterReference = { - name: 'characterReference', - tokenize: tokenizeCharacterReference, -}; -function tokenizeCharacterReference(effects, ok2, nok) { - const self2 = this; - let size = 0; - let max; - let test; - return start3; - function start3(code2) { - effects.enter('characterReference'); - effects.enter('characterReferenceMarker'); - effects.consume(code2); - effects.exit('characterReferenceMarker'); - return open; - } - function open(code2) { - if (code2 === 35) { - effects.enter('characterReferenceMarkerNumeric'); - effects.consume(code2); - effects.exit('characterReferenceMarkerNumeric'); - return numeric; - } - effects.enter('characterReferenceValue'); - max = 31; - test = asciiAlphanumeric; - return value(code2); - } - function numeric(code2) { - if (code2 === 88 || code2 === 120) { - effects.enter('characterReferenceMarkerHexadecimal'); - effects.consume(code2); - effects.exit('characterReferenceMarkerHexadecimal'); - effects.enter('characterReferenceValue'); - max = 6; - test = asciiHexDigit; - return value; - } - effects.enter('characterReferenceValue'); - max = 7; - test = asciiDigit; - return value(code2); - } - function value(code2) { - let token; - if (code2 === 59 && size) { - token = effects.exit('characterReferenceValue'); - if ( - test === asciiAlphanumeric && - !decodeNamedCharacterReference(self2.sliceSerialize(token)) - ) { - return nok(code2); - } - effects.enter('characterReferenceMarker'); - effects.consume(code2); - effects.exit('characterReferenceMarker'); - effects.exit('characterReference'); - return ok2; - } - if (test(code2) && size++ < max) { - effects.consume(code2); - return value; - } - return nok(code2); - } -} - -// node_modules/micromark-core-commonmark/lib/code-fenced.js -var codeFenced = { - name: 'codeFenced', - tokenize: tokenizeCodeFenced, - concrete: true, -}; -function tokenizeCodeFenced(effects, ok2, nok) { - const self2 = this; - const closingFenceConstruct = { - tokenize: tokenizeClosingFence, - partial: true, - }; - const nonLazyLine = { - tokenize: tokenizeNonLazyLine, - partial: true, - }; - const tail = this.events[this.events.length - 1]; - const initialPrefix = - tail && tail[1].type === 'linePrefix' - ? tail[2].sliceSerialize(tail[1], true).length - : 0; - let sizeOpen = 0; - let marker; - return start3; - function start3(code2) { - effects.enter('codeFenced'); - effects.enter('codeFencedFence'); - effects.enter('codeFencedFenceSequence'); - marker = code2; - return sequenceOpen(code2); - } - function sequenceOpen(code2) { - if (code2 === marker) { - effects.consume(code2); - sizeOpen++; - return sequenceOpen; - } - effects.exit('codeFencedFenceSequence'); - return sizeOpen < 3 - ? nok(code2) - : factorySpace(effects, infoOpen, 'whitespace')(code2); - } - function infoOpen(code2) { - if (code2 === null || markdownLineEnding(code2)) { - return openAfter(code2); - } - effects.enter('codeFencedFenceInfo'); - effects.enter('chunkString', { - contentType: 'string', - }); - return info(code2); - } - function info(code2) { - if (code2 === null || markdownLineEndingOrSpace(code2)) { - effects.exit('chunkString'); - effects.exit('codeFencedFenceInfo'); - return factorySpace(effects, infoAfter, 'whitespace')(code2); - } - if (code2 === 96 && code2 === marker) return nok(code2); - effects.consume(code2); - return info; - } - function infoAfter(code2) { - if (code2 === null || markdownLineEnding(code2)) { - return openAfter(code2); - } - effects.enter('codeFencedFenceMeta'); - effects.enter('chunkString', { - contentType: 'string', - }); - return meta(code2); - } - function meta(code2) { - if (code2 === null || markdownLineEnding(code2)) { - effects.exit('chunkString'); - effects.exit('codeFencedFenceMeta'); - return openAfter(code2); - } - if (code2 === 96 && code2 === marker) return nok(code2); - effects.consume(code2); - return meta; - } - function openAfter(code2) { - effects.exit('codeFencedFence'); - return self2.interrupt ? ok2(code2) : contentStart(code2); - } - function contentStart(code2) { - if (code2 === null) { - return after(code2); - } - if (markdownLineEnding(code2)) { - return effects.attempt( - nonLazyLine, - effects.attempt( - closingFenceConstruct, - after, - initialPrefix - ? factorySpace( - effects, - contentStart, - 'linePrefix', - initialPrefix + 1, - ) - : contentStart, - ), - after, - )(code2); - } - effects.enter('codeFlowValue'); - return contentContinue(code2); - } - function contentContinue(code2) { - if (code2 === null || markdownLineEnding(code2)) { - effects.exit('codeFlowValue'); - return contentStart(code2); - } - effects.consume(code2); - return contentContinue; - } - function after(code2) { - effects.exit('codeFenced'); - return ok2(code2); - } - function tokenizeNonLazyLine(effects2, ok3, nok2) { - const self3 = this; - return start4; - function start4(code2) { - effects2.enter('lineEnding'); - effects2.consume(code2); - effects2.exit('lineEnding'); - return lineStart; - } - function lineStart(code2) { - return self3.parser.lazy[self3.now().line] ? nok2(code2) : ok3(code2); - } - } - function tokenizeClosingFence(effects2, ok3, nok2) { - let size = 0; - return factorySpace( - effects2, - closingSequenceStart, - 'linePrefix', - this.parser.constructs.disable.null.includes('codeIndented') ? void 0 : 4, - ); - function closingSequenceStart(code2) { - effects2.enter('codeFencedFence'); - effects2.enter('codeFencedFenceSequence'); - return closingSequence(code2); - } - function closingSequence(code2) { - if (code2 === marker) { - effects2.consume(code2); - size++; - return closingSequence; - } - if (size < sizeOpen) return nok2(code2); - effects2.exit('codeFencedFenceSequence'); - return factorySpace(effects2, closingSequenceEnd, 'whitespace')(code2); - } - function closingSequenceEnd(code2) { - if (code2 === null || markdownLineEnding(code2)) { - effects2.exit('codeFencedFence'); - return ok3(code2); - } - return nok2(code2); - } - } -} - -// node_modules/micromark-core-commonmark/lib/code-indented.js -var codeIndented = { - name: 'codeIndented', - tokenize: tokenizeCodeIndented, -}; -var indentedContent = { - tokenize: tokenizeIndentedContent, - partial: true, -}; -function tokenizeCodeIndented(effects, ok2, nok) { - const self2 = this; - return start3; - function start3(code2) { - effects.enter('codeIndented'); - return factorySpace(effects, afterStartPrefix, 'linePrefix', 4 + 1)(code2); - } - function afterStartPrefix(code2) { - const tail = self2.events[self2.events.length - 1]; - return tail && - tail[1].type === 'linePrefix' && - tail[2].sliceSerialize(tail[1], true).length >= 4 - ? afterPrefix(code2) - : nok(code2); - } - function afterPrefix(code2) { - if (code2 === null) { - return after(code2); - } - if (markdownLineEnding(code2)) { - return effects.attempt(indentedContent, afterPrefix, after)(code2); - } - effects.enter('codeFlowValue'); - return content3(code2); - } - function content3(code2) { - if (code2 === null || markdownLineEnding(code2)) { - effects.exit('codeFlowValue'); - return afterPrefix(code2); - } - effects.consume(code2); - return content3; - } - function after(code2) { - effects.exit('codeIndented'); - return ok2(code2); - } -} -function tokenizeIndentedContent(effects, ok2, nok) { - const self2 = this; - return start3; - function start3(code2) { - if (self2.parser.lazy[self2.now().line]) { - return nok(code2); - } - if (markdownLineEnding(code2)) { - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - return start3; - } - return factorySpace(effects, afterPrefix, 'linePrefix', 4 + 1)(code2); - } - function afterPrefix(code2) { - const tail = self2.events[self2.events.length - 1]; - return tail && - tail[1].type === 'linePrefix' && - tail[2].sliceSerialize(tail[1], true).length >= 4 - ? ok2(code2) - : markdownLineEnding(code2) - ? start3(code2) - : nok(code2); - } -} - -// node_modules/micromark-core-commonmark/lib/code-text.js -var codeText = { - name: 'codeText', - tokenize: tokenizeCodeText, - resolve: resolveCodeText, - previous, -}; -function resolveCodeText(events) { - let tailExitIndex = events.length - 4; - let headEnterIndex = 3; - let index2; - let enter; - if ( - (events[headEnterIndex][1].type === 'lineEnding' || - events[headEnterIndex][1].type === 'space') && - (events[tailExitIndex][1].type === 'lineEnding' || - events[tailExitIndex][1].type === 'space') - ) { - index2 = headEnterIndex; - while (++index2 < tailExitIndex) { - if (events[index2][1].type === 'codeTextData') { - events[headEnterIndex][1].type = 'codeTextPadding'; - events[tailExitIndex][1].type = 'codeTextPadding'; - headEnterIndex += 2; - tailExitIndex -= 2; - break; - } - } - } - index2 = headEnterIndex - 1; - tailExitIndex++; - while (++index2 <= tailExitIndex) { - if (enter === void 0) { - if (index2 !== tailExitIndex && events[index2][1].type !== 'lineEnding') { - enter = index2; - } - } else if ( - index2 === tailExitIndex || - events[index2][1].type === 'lineEnding' - ) { - events[enter][1].type = 'codeTextData'; - if (index2 !== enter + 2) { - events[enter][1].end = events[index2 - 1][1].end; - events.splice(enter + 2, index2 - enter - 2); - tailExitIndex -= index2 - enter - 2; - index2 = enter + 2; - } - enter = void 0; - } - } - return events; -} -function previous(code2) { - return ( - code2 !== 96 || - this.events[this.events.length - 1][1].type === 'characterEscape' - ); -} -function tokenizeCodeText(effects, ok2, nok) { - const self2 = this; - let sizeOpen = 0; - let size; - let token; - return start3; - function start3(code2) { - effects.enter('codeText'); - effects.enter('codeTextSequence'); - return openingSequence(code2); - } - function openingSequence(code2) { - if (code2 === 96) { - effects.consume(code2); - sizeOpen++; - return openingSequence; - } - effects.exit('codeTextSequence'); - return gap(code2); - } - function gap(code2) { - if (code2 === null) { - return nok(code2); - } - if (code2 === 96) { - token = effects.enter('codeTextSequence'); - size = 0; - return closingSequence(code2); - } - if (code2 === 32) { - effects.enter('space'); - effects.consume(code2); - effects.exit('space'); - return gap; - } - if (markdownLineEnding(code2)) { - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - return gap; - } - effects.enter('codeTextData'); - return data2(code2); - } - function data2(code2) { - if ( - code2 === null || - code2 === 32 || - code2 === 96 || - markdownLineEnding(code2) - ) { - effects.exit('codeTextData'); - return gap(code2); - } - effects.consume(code2); - return data2; - } - function closingSequence(code2) { - if (code2 === 96) { - effects.consume(code2); - size++; - return closingSequence; - } - if (size === sizeOpen) { - effects.exit('codeTextSequence'); - effects.exit('codeText'); - return ok2(code2); - } - token.type = 'codeTextData'; - return data2(code2); - } -} - -// node_modules/micromark-util-subtokenize/index.js -function subtokenize(events) { - const jumps = {}; - let index2 = -1; - let event; - let lineIndex; - let otherIndex; - let otherEvent; - let parameters; - let subevents; - let more; - while (++index2 < events.length) { - while (index2 in jumps) { - index2 = jumps[index2]; - } - event = events[index2]; - if ( - index2 && - event[1].type === 'chunkFlow' && - events[index2 - 1][1].type === 'listItemPrefix' - ) { - subevents = event[1]._tokenizer.events; - otherIndex = 0; - if ( - otherIndex < subevents.length && - subevents[otherIndex][1].type === 'lineEndingBlank' - ) { - otherIndex += 2; - } - if ( - otherIndex < subevents.length && - subevents[otherIndex][1].type === 'content' - ) { - while (++otherIndex < subevents.length) { - if (subevents[otherIndex][1].type === 'content') { - break; - } - if (subevents[otherIndex][1].type === 'chunkText') { - subevents[otherIndex][1]._isInFirstContentOfListItem = true; - otherIndex++; - } - } - } - } - if (event[0] === 'enter') { - if (event[1].contentType) { - Object.assign(jumps, subcontent(events, index2)); - index2 = jumps[index2]; - more = true; - } - } else if (event[1]._container) { - otherIndex = index2; - lineIndex = void 0; - while (otherIndex--) { - otherEvent = events[otherIndex]; - if ( - otherEvent[1].type === 'lineEnding' || - otherEvent[1].type === 'lineEndingBlank' - ) { - if (otherEvent[0] === 'enter') { - if (lineIndex) { - events[lineIndex][1].type = 'lineEndingBlank'; - } - otherEvent[1].type = 'lineEnding'; - lineIndex = otherIndex; - } - } else { - break; - } - } - if (lineIndex) { - event[1].end = Object.assign({}, events[lineIndex][1].start); - parameters = events.slice(lineIndex, index2); - parameters.unshift(event); - splice(events, lineIndex, index2 - lineIndex + 1, parameters); - } - } - } - return !more; -} -function subcontent(events, eventIndex) { - const token = events[eventIndex][1]; - const context = events[eventIndex][2]; - let startPosition = eventIndex - 1; - const startPositions = []; - const tokenizer2 = - token._tokenizer || context.parser[token.contentType](token.start); - const childEvents = tokenizer2.events; - const jumps = []; - const gaps = {}; - let stream; - let previous2; - let index2 = -1; - let current2 = token; - let adjust = 0; - let start3 = 0; - const breaks = [start3]; - while (current2) { - while (events[++startPosition][1] !== current2) {} - startPositions.push(startPosition); - if (!current2._tokenizer) { - stream = context.sliceStream(current2); - if (!current2.next) { - stream.push(null); - } - if (previous2) { - tokenizer2.defineSkip(current2.start); - } - if (current2._isInFirstContentOfListItem) { - tokenizer2._gfmTasklistFirstContentOfListItem = true; - } - tokenizer2.write(stream); - if (current2._isInFirstContentOfListItem) { - tokenizer2._gfmTasklistFirstContentOfListItem = void 0; - } - } - previous2 = current2; - current2 = current2.next; - } - current2 = token; - while (++index2 < childEvents.length) { - if ( - childEvents[index2][0] === 'exit' && - childEvents[index2 - 1][0] === 'enter' && - childEvents[index2][1].type === childEvents[index2 - 1][1].type && - childEvents[index2][1].start.line !== childEvents[index2][1].end.line - ) { - start3 = index2 + 1; - breaks.push(start3); - current2._tokenizer = void 0; - current2.previous = void 0; - current2 = current2.next; - } - } - tokenizer2.events = []; - if (current2) { - current2._tokenizer = void 0; - current2.previous = void 0; - } else { - breaks.pop(); - } - index2 = breaks.length; - while (index2--) { - const slice2 = childEvents.slice(breaks[index2], breaks[index2 + 1]); - const start4 = startPositions.pop(); - jumps.unshift([start4, start4 + slice2.length - 1]); - splice(events, start4, 2, slice2); - } - index2 = -1; - while (++index2 < jumps.length) { - gaps[adjust + jumps[index2][0]] = adjust + jumps[index2][1]; - adjust += jumps[index2][1] - jumps[index2][0] - 1; - } - return gaps; -} - -// node_modules/micromark-core-commonmark/lib/content.js -var content = { - tokenize: tokenizeContent, - resolve: resolveContent, -}; -var continuationConstruct = { - tokenize: tokenizeContinuation, - partial: true, -}; -function resolveContent(events) { - subtokenize(events); - return events; -} -function tokenizeContent(effects, ok2) { - let previous2; - return start3; - function start3(code2) { - effects.enter('content'); - previous2 = effects.enter('chunkContent', { - contentType: 'content', - }); - return data2(code2); - } - function data2(code2) { - if (code2 === null) { - return contentEnd(code2); - } - if (markdownLineEnding(code2)) { - return effects.check( - continuationConstruct, - contentContinue, - contentEnd, - )(code2); - } - effects.consume(code2); - return data2; - } - function contentEnd(code2) { - effects.exit('chunkContent'); - effects.exit('content'); - return ok2(code2); - } - function contentContinue(code2) { - effects.consume(code2); - effects.exit('chunkContent'); - previous2.next = effects.enter('chunkContent', { - contentType: 'content', - previous: previous2, - }); - previous2 = previous2.next; - return data2; - } -} -function tokenizeContinuation(effects, ok2, nok) { - const self2 = this; - return startLookahead; - function startLookahead(code2) { - effects.exit('chunkContent'); - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - return factorySpace(effects, prefixed, 'linePrefix'); - } - function prefixed(code2) { - if (code2 === null || markdownLineEnding(code2)) { - return nok(code2); - } - const tail = self2.events[self2.events.length - 1]; - if ( - !self2.parser.constructs.disable.null.includes('codeIndented') && - tail && - tail[1].type === 'linePrefix' && - tail[2].sliceSerialize(tail[1], true).length >= 4 - ) { - return ok2(code2); - } - return effects.interrupt(self2.parser.constructs.flow, nok, ok2)(code2); - } -} - -// node_modules/micromark-factory-destination/index.js -function factoryDestination( - effects, - ok2, - nok, - type, - literalType, - literalMarkerType, - rawType, - stringType, - max, -) { - const limit = max || Number.POSITIVE_INFINITY; - let balance = 0; - return start3; - function start3(code2) { - if (code2 === 60) { - effects.enter(type); - effects.enter(literalType); - effects.enter(literalMarkerType); - effects.consume(code2); - effects.exit(literalMarkerType); - return destinationEnclosedBefore; - } - if (code2 === null || code2 === 41 || asciiControl(code2)) { - return nok(code2); - } - effects.enter(type); - effects.enter(rawType); - effects.enter(stringType); - effects.enter('chunkString', { - contentType: 'string', - }); - return destinationRaw(code2); - } - function destinationEnclosedBefore(code2) { - if (code2 === 62) { - effects.enter(literalMarkerType); - effects.consume(code2); - effects.exit(literalMarkerType); - effects.exit(literalType); - effects.exit(type); - return ok2; - } - effects.enter(stringType); - effects.enter('chunkString', { - contentType: 'string', - }); - return destinationEnclosed(code2); - } - function destinationEnclosed(code2) { - if (code2 === 62) { - effects.exit('chunkString'); - effects.exit(stringType); - return destinationEnclosedBefore(code2); - } - if (code2 === null || code2 === 60 || markdownLineEnding(code2)) { - return nok(code2); - } - effects.consume(code2); - return code2 === 92 ? destinationEnclosedEscape : destinationEnclosed; - } - function destinationEnclosedEscape(code2) { - if (code2 === 60 || code2 === 62 || code2 === 92) { - effects.consume(code2); - return destinationEnclosed; - } - return destinationEnclosed(code2); - } - function destinationRaw(code2) { - if (code2 === 40) { - if (++balance > limit) return nok(code2); - effects.consume(code2); - return destinationRaw; - } - if (code2 === 41) { - if (!balance--) { - effects.exit('chunkString'); - effects.exit(stringType); - effects.exit(rawType); - effects.exit(type); - return ok2(code2); - } - effects.consume(code2); - return destinationRaw; - } - if (code2 === null || markdownLineEndingOrSpace(code2)) { - if (balance) return nok(code2); - effects.exit('chunkString'); - effects.exit(stringType); - effects.exit(rawType); - effects.exit(type); - return ok2(code2); - } - if (asciiControl(code2)) return nok(code2); - effects.consume(code2); - return code2 === 92 ? destinationRawEscape : destinationRaw; - } - function destinationRawEscape(code2) { - if (code2 === 40 || code2 === 41 || code2 === 92) { - effects.consume(code2); - return destinationRaw; - } - return destinationRaw(code2); - } -} - -// node_modules/micromark-factory-label/index.js -function factoryLabel(effects, ok2, nok, type, markerType, stringType) { - const self2 = this; - let size = 0; - let data2; - return start3; - function start3(code2) { - effects.enter(type); - effects.enter(markerType); - effects.consume(code2); - effects.exit(markerType); - effects.enter(stringType); - return atBreak; - } - function atBreak(code2) { - if ( - code2 === null || - code2 === 91 || - (code2 === 93 && !data2) || - (code2 === 94 && - !size && - '_hiddenFootnoteSupport' in self2.parser.constructs) || - size > 999 - ) { - return nok(code2); - } - if (code2 === 93) { - effects.exit(stringType); - effects.enter(markerType); - effects.consume(code2); - effects.exit(markerType); - effects.exit(type); - return ok2; - } - if (markdownLineEnding(code2)) { - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - return atBreak; - } - effects.enter('chunkString', { - contentType: 'string', - }); - return label(code2); - } - function label(code2) { - if ( - code2 === null || - code2 === 91 || - code2 === 93 || - markdownLineEnding(code2) || - size++ > 999 - ) { - effects.exit('chunkString'); - return atBreak(code2); - } - effects.consume(code2); - data2 = data2 || !markdownSpace(code2); - return code2 === 92 ? labelEscape : label; - } - function labelEscape(code2) { - if (code2 === 91 || code2 === 92 || code2 === 93) { - effects.consume(code2); - size++; - return label; - } - return label(code2); - } -} - -// node_modules/micromark-factory-title/index.js -function factoryTitle(effects, ok2, nok, type, markerType, stringType) { - let marker; - return start3; - function start3(code2) { - effects.enter(type); - effects.enter(markerType); - effects.consume(code2); - effects.exit(markerType); - marker = code2 === 40 ? 41 : code2; - return atFirstTitleBreak; - } - function atFirstTitleBreak(code2) { - if (code2 === marker) { - effects.enter(markerType); - effects.consume(code2); - effects.exit(markerType); - effects.exit(type); - return ok2; - } - effects.enter(stringType); - return atTitleBreak(code2); - } - function atTitleBreak(code2) { - if (code2 === marker) { - effects.exit(stringType); - return atFirstTitleBreak(marker); - } - if (code2 === null) { - return nok(code2); - } - if (markdownLineEnding(code2)) { - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - return factorySpace(effects, atTitleBreak, 'linePrefix'); - } - effects.enter('chunkString', { - contentType: 'string', - }); - return title(code2); - } - function title(code2) { - if (code2 === marker || code2 === null || markdownLineEnding(code2)) { - effects.exit('chunkString'); - return atTitleBreak(code2); - } - effects.consume(code2); - return code2 === 92 ? titleEscape : title; - } - function titleEscape(code2) { - if (code2 === marker || code2 === 92) { - effects.consume(code2); - return title; - } - return title(code2); - } -} - -// node_modules/micromark-factory-whitespace/index.js -function factoryWhitespace(effects, ok2) { - let seen; - return start3; - function start3(code2) { - if (markdownLineEnding(code2)) { - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - seen = true; - return start3; - } - if (markdownSpace(code2)) { - return factorySpace( - effects, - start3, - seen ? 'linePrefix' : 'lineSuffix', - )(code2); - } - return ok2(code2); - } -} - -// node_modules/micromark-util-normalize-identifier/index.js -function normalizeIdentifier(value) { - return value - .replace(/[\t\n\r ]+/g, ' ') - .replace(/^ | $/g, '') - .toLowerCase() - .toUpperCase(); -} - -// node_modules/micromark-core-commonmark/lib/definition.js -var definition = { - name: 'definition', - tokenize: tokenizeDefinition, -}; -var titleConstruct = { - tokenize: tokenizeTitle, - partial: true, -}; -function tokenizeDefinition(effects, ok2, nok) { - const self2 = this; - let identifier; - return start3; - function start3(code2) { - effects.enter('definition'); - return factoryLabel.call( - self2, - effects, - labelAfter, - nok, - 'definitionLabel', - 'definitionLabelMarker', - 'definitionLabelString', - )(code2); - } - function labelAfter(code2) { - identifier = normalizeIdentifier( - self2 - .sliceSerialize(self2.events[self2.events.length - 1][1]) - .slice(1, -1), - ); - if (code2 === 58) { - effects.enter('definitionMarker'); - effects.consume(code2); - effects.exit('definitionMarker'); - return factoryWhitespace( - effects, - factoryDestination( - effects, - effects.attempt( - titleConstruct, - factorySpace(effects, after, 'whitespace'), - factorySpace(effects, after, 'whitespace'), - ), - nok, - 'definitionDestination', - 'definitionDestinationLiteral', - 'definitionDestinationLiteralMarker', - 'definitionDestinationRaw', - 'definitionDestinationString', - ), - ); - } - return nok(code2); - } - function after(code2) { - if (code2 === null || markdownLineEnding(code2)) { - effects.exit('definition'); - if (!self2.parser.defined.includes(identifier)) { - self2.parser.defined.push(identifier); - } - return ok2(code2); - } - return nok(code2); - } -} -function tokenizeTitle(effects, ok2, nok) { - return start3; - function start3(code2) { - return markdownLineEndingOrSpace(code2) - ? factoryWhitespace(effects, before)(code2) - : nok(code2); - } - function before(code2) { - if (code2 === 34 || code2 === 39 || code2 === 40) { - return factoryTitle( - effects, - factorySpace(effects, after, 'whitespace'), - nok, - 'definitionTitle', - 'definitionTitleMarker', - 'definitionTitleString', - )(code2); - } - return nok(code2); - } - function after(code2) { - return code2 === null || markdownLineEnding(code2) - ? ok2(code2) - : nok(code2); - } -} - -// node_modules/micromark-core-commonmark/lib/hard-break-escape.js -var hardBreakEscape = { - name: 'hardBreakEscape', - tokenize: tokenizeHardBreakEscape, -}; -function tokenizeHardBreakEscape(effects, ok2, nok) { - return start3; - function start3(code2) { - effects.enter('hardBreakEscape'); - effects.enter('escapeMarker'); - effects.consume(code2); - return open; - } - function open(code2) { - if (markdownLineEnding(code2)) { - effects.exit('escapeMarker'); - effects.exit('hardBreakEscape'); - return ok2(code2); - } - return nok(code2); - } -} - -// node_modules/micromark-core-commonmark/lib/heading-atx.js -var headingAtx = { - name: 'headingAtx', - tokenize: tokenizeHeadingAtx, - resolve: resolveHeadingAtx, -}; -function resolveHeadingAtx(events, context) { - let contentEnd = events.length - 2; - let contentStart = 3; - let content3; - let text5; - if (events[contentStart][1].type === 'whitespace') { - contentStart += 2; - } - if ( - contentEnd - 2 > contentStart && - events[contentEnd][1].type === 'whitespace' - ) { - contentEnd -= 2; - } - if ( - events[contentEnd][1].type === 'atxHeadingSequence' && - (contentStart === contentEnd - 1 || - (contentEnd - 4 > contentStart && - events[contentEnd - 2][1].type === 'whitespace')) - ) { - contentEnd -= contentStart + 1 === contentEnd ? 2 : 4; - } - if (contentEnd > contentStart) { - content3 = { - type: 'atxHeadingText', - start: events[contentStart][1].start, - end: events[contentEnd][1].end, - }; - text5 = { - type: 'chunkText', - start: events[contentStart][1].start, - end: events[contentEnd][1].end, - contentType: 'text', - }; - splice(events, contentStart, contentEnd - contentStart + 1, [ - ['enter', content3, context], - ['enter', text5, context], - ['exit', text5, context], - ['exit', content3, context], - ]); - } - return events; -} -function tokenizeHeadingAtx(effects, ok2, nok) { - const self2 = this; - let size = 0; - return start3; - function start3(code2) { - effects.enter('atxHeading'); - effects.enter('atxHeadingSequence'); - return fenceOpenInside(code2); - } - function fenceOpenInside(code2) { - if (code2 === 35 && size++ < 6) { - effects.consume(code2); - return fenceOpenInside; - } - if (code2 === null || markdownLineEndingOrSpace(code2)) { - effects.exit('atxHeadingSequence'); - return self2.interrupt ? ok2(code2) : headingBreak(code2); - } - return nok(code2); - } - function headingBreak(code2) { - if (code2 === 35) { - effects.enter('atxHeadingSequence'); - return sequence(code2); - } - if (code2 === null || markdownLineEnding(code2)) { - effects.exit('atxHeading'); - return ok2(code2); - } - if (markdownSpace(code2)) { - return factorySpace(effects, headingBreak, 'whitespace')(code2); - } - effects.enter('atxHeadingText'); - return data2(code2); - } - function sequence(code2) { - if (code2 === 35) { - effects.consume(code2); - return sequence; - } - effects.exit('atxHeadingSequence'); - return headingBreak(code2); - } - function data2(code2) { - if (code2 === null || code2 === 35 || markdownLineEndingOrSpace(code2)) { - effects.exit('atxHeadingText'); - return headingBreak(code2); - } - effects.consume(code2); - return data2; - } -} - -// node_modules/micromark-util-html-tag-name/index.js -var htmlBlockNames = [ - 'address', - 'article', - 'aside', - 'base', - 'basefont', - 'blockquote', - 'body', - 'caption', - 'center', - 'col', - 'colgroup', - 'dd', - 'details', - 'dialog', - 'dir', - 'div', - 'dl', - 'dt', - 'fieldset', - 'figcaption', - 'figure', - 'footer', - 'form', - 'frame', - 'frameset', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'head', - 'header', - 'hr', - 'html', - 'iframe', - 'legend', - 'li', - 'link', - 'main', - 'menu', - 'menuitem', - 'nav', - 'noframes', - 'ol', - 'optgroup', - 'option', - 'p', - 'param', - 'section', - 'summary', - 'table', - 'tbody', - 'td', - 'tfoot', - 'th', - 'thead', - 'title', - 'tr', - 'track', - 'ul', -]; -var htmlRawNames = ['pre', 'script', 'style', 'textarea']; - -// node_modules/micromark-core-commonmark/lib/html-flow.js -var htmlFlow = { - name: 'htmlFlow', - tokenize: tokenizeHtmlFlow, - resolveTo: resolveToHtmlFlow, - concrete: true, -}; -var nextBlankConstruct = { - tokenize: tokenizeNextBlank, - partial: true, -}; -function resolveToHtmlFlow(events) { - let index2 = events.length; - while (index2--) { - if ( - events[index2][0] === 'enter' && - events[index2][1].type === 'htmlFlow' - ) { - break; - } - } - if (index2 > 1 && events[index2 - 2][1].type === 'linePrefix') { - events[index2][1].start = events[index2 - 2][1].start; - events[index2 + 1][1].start = events[index2 - 2][1].start; - events.splice(index2 - 2, 2); - } - return events; -} -function tokenizeHtmlFlow(effects, ok2, nok) { - const self2 = this; - let kind; - let startTag; - let buffer2; - let index2; - let marker; - return start3; - function start3(code2) { - effects.enter('htmlFlow'); - effects.enter('htmlFlowData'); - effects.consume(code2); - return open; - } - function open(code2) { - if (code2 === 33) { - effects.consume(code2); - return declarationStart; - } - if (code2 === 47) { - effects.consume(code2); - return tagCloseStart; - } - if (code2 === 63) { - effects.consume(code2); - kind = 3; - return self2.interrupt ? ok2 : continuationDeclarationInside; - } - if (asciiAlpha(code2)) { - effects.consume(code2); - buffer2 = String.fromCharCode(code2); - startTag = true; - return tagName; - } - return nok(code2); - } - function declarationStart(code2) { - if (code2 === 45) { - effects.consume(code2); - kind = 2; - return commentOpenInside; - } - if (code2 === 91) { - effects.consume(code2); - kind = 5; - buffer2 = 'CDATA['; - index2 = 0; - return cdataOpenInside; - } - if (asciiAlpha(code2)) { - effects.consume(code2); - kind = 4; - return self2.interrupt ? ok2 : continuationDeclarationInside; - } - return nok(code2); - } - function commentOpenInside(code2) { - if (code2 === 45) { - effects.consume(code2); - return self2.interrupt ? ok2 : continuationDeclarationInside; - } - return nok(code2); - } - function cdataOpenInside(code2) { - if (code2 === buffer2.charCodeAt(index2++)) { - effects.consume(code2); - return index2 === buffer2.length - ? self2.interrupt - ? ok2 - : continuation - : cdataOpenInside; - } - return nok(code2); - } - function tagCloseStart(code2) { - if (asciiAlpha(code2)) { - effects.consume(code2); - buffer2 = String.fromCharCode(code2); - return tagName; - } - return nok(code2); - } - function tagName(code2) { - if ( - code2 === null || - code2 === 47 || - code2 === 62 || - markdownLineEndingOrSpace(code2) - ) { - if ( - code2 !== 47 && - startTag && - htmlRawNames.includes(buffer2.toLowerCase()) - ) { - kind = 1; - return self2.interrupt ? ok2(code2) : continuation(code2); - } - if (htmlBlockNames.includes(buffer2.toLowerCase())) { - kind = 6; - if (code2 === 47) { - effects.consume(code2); - return basicSelfClosing; - } - return self2.interrupt ? ok2(code2) : continuation(code2); - } - kind = 7; - return self2.interrupt && !self2.parser.lazy[self2.now().line] - ? nok(code2) - : startTag - ? completeAttributeNameBefore(code2) - : completeClosingTagAfter(code2); - } - if (code2 === 45 || asciiAlphanumeric(code2)) { - effects.consume(code2); - buffer2 += String.fromCharCode(code2); - return tagName; - } - return nok(code2); - } - function basicSelfClosing(code2) { - if (code2 === 62) { - effects.consume(code2); - return self2.interrupt ? ok2 : continuation; - } - return nok(code2); - } - function completeClosingTagAfter(code2) { - if (markdownSpace(code2)) { - effects.consume(code2); - return completeClosingTagAfter; - } - return completeEnd(code2); - } - function completeAttributeNameBefore(code2) { - if (code2 === 47) { - effects.consume(code2); - return completeEnd; - } - if (code2 === 58 || code2 === 95 || asciiAlpha(code2)) { - effects.consume(code2); - return completeAttributeName; - } - if (markdownSpace(code2)) { - effects.consume(code2); - return completeAttributeNameBefore; - } - return completeEnd(code2); - } - function completeAttributeName(code2) { - if ( - code2 === 45 || - code2 === 46 || - code2 === 58 || - code2 === 95 || - asciiAlphanumeric(code2) - ) { - effects.consume(code2); - return completeAttributeName; - } - return completeAttributeNameAfter(code2); - } - function completeAttributeNameAfter(code2) { - if (code2 === 61) { - effects.consume(code2); - return completeAttributeValueBefore; - } - if (markdownSpace(code2)) { - effects.consume(code2); - return completeAttributeNameAfter; - } - return completeAttributeNameBefore(code2); - } - function completeAttributeValueBefore(code2) { - if ( - code2 === null || - code2 === 60 || - code2 === 61 || - code2 === 62 || - code2 === 96 - ) { - return nok(code2); - } - if (code2 === 34 || code2 === 39) { - effects.consume(code2); - marker = code2; - return completeAttributeValueQuoted; - } - if (markdownSpace(code2)) { - effects.consume(code2); - return completeAttributeValueBefore; - } - marker = null; - return completeAttributeValueUnquoted(code2); - } - function completeAttributeValueQuoted(code2) { - if (code2 === null || markdownLineEnding(code2)) { - return nok(code2); - } - if (code2 === marker) { - effects.consume(code2); - return completeAttributeValueQuotedAfter; - } - effects.consume(code2); - return completeAttributeValueQuoted; - } - function completeAttributeValueUnquoted(code2) { - if ( - code2 === null || - code2 === 34 || - code2 === 39 || - code2 === 60 || - code2 === 61 || - code2 === 62 || - code2 === 96 || - markdownLineEndingOrSpace(code2) - ) { - return completeAttributeNameAfter(code2); - } - effects.consume(code2); - return completeAttributeValueUnquoted; - } - function completeAttributeValueQuotedAfter(code2) { - if (code2 === 47 || code2 === 62 || markdownSpace(code2)) { - return completeAttributeNameBefore(code2); - } - return nok(code2); - } - function completeEnd(code2) { - if (code2 === 62) { - effects.consume(code2); - return completeAfter; - } - return nok(code2); - } - function completeAfter(code2) { - if (markdownSpace(code2)) { - effects.consume(code2); - return completeAfter; - } - return code2 === null || markdownLineEnding(code2) - ? continuation(code2) - : nok(code2); - } - function continuation(code2) { - if (code2 === 45 && kind === 2) { - effects.consume(code2); - return continuationCommentInside; - } - if (code2 === 60 && kind === 1) { - effects.consume(code2); - return continuationRawTagOpen; - } - if (code2 === 62 && kind === 4) { - effects.consume(code2); - return continuationClose; - } - if (code2 === 63 && kind === 3) { - effects.consume(code2); - return continuationDeclarationInside; - } - if (code2 === 93 && kind === 5) { - effects.consume(code2); - return continuationCharacterDataInside; - } - if (markdownLineEnding(code2) && (kind === 6 || kind === 7)) { - return effects.check( - nextBlankConstruct, - continuationClose, - continuationAtLineEnding, - )(code2); - } - if (code2 === null || markdownLineEnding(code2)) { - return continuationAtLineEnding(code2); - } - effects.consume(code2); - return continuation; - } - function continuationAtLineEnding(code2) { - effects.exit('htmlFlowData'); - return htmlContinueStart(code2); - } - function htmlContinueStart(code2) { - if (code2 === null) { - return done(code2); - } - if (markdownLineEnding(code2)) { - return effects.attempt( - { - tokenize: htmlLineEnd, - partial: true, - }, - htmlContinueStart, - done, - )(code2); - } - effects.enter('htmlFlowData'); - return continuation(code2); - } - function htmlLineEnd(effects2, ok3, nok2) { - return start4; - function start4(code2) { - effects2.enter('lineEnding'); - effects2.consume(code2); - effects2.exit('lineEnding'); - return lineStart; - } - function lineStart(code2) { - return self2.parser.lazy[self2.now().line] ? nok2(code2) : ok3(code2); - } - } - function continuationCommentInside(code2) { - if (code2 === 45) { - effects.consume(code2); - return continuationDeclarationInside; - } - return continuation(code2); - } - function continuationRawTagOpen(code2) { - if (code2 === 47) { - effects.consume(code2); - buffer2 = ''; - return continuationRawEndTag; - } - return continuation(code2); - } - function continuationRawEndTag(code2) { - if (code2 === 62 && htmlRawNames.includes(buffer2.toLowerCase())) { - effects.consume(code2); - return continuationClose; - } - if (asciiAlpha(code2) && buffer2.length < 8) { - effects.consume(code2); - buffer2 += String.fromCharCode(code2); - return continuationRawEndTag; - } - return continuation(code2); - } - function continuationCharacterDataInside(code2) { - if (code2 === 93) { - effects.consume(code2); - return continuationDeclarationInside; - } - return continuation(code2); - } - function continuationDeclarationInside(code2) { - if (code2 === 62) { - effects.consume(code2); - return continuationClose; - } - if (code2 === 45 && kind === 2) { - effects.consume(code2); - return continuationDeclarationInside; - } - return continuation(code2); - } - function continuationClose(code2) { - if (code2 === null || markdownLineEnding(code2)) { - effects.exit('htmlFlowData'); - return done(code2); - } - effects.consume(code2); - return continuationClose; - } - function done(code2) { - effects.exit('htmlFlow'); - return ok2(code2); - } -} -function tokenizeNextBlank(effects, ok2, nok) { - return start3; - function start3(code2) { - effects.exit('htmlFlowData'); - effects.enter('lineEndingBlank'); - effects.consume(code2); - effects.exit('lineEndingBlank'); - return effects.attempt(blankLine, ok2, nok); - } -} - -// node_modules/micromark-core-commonmark/lib/html-text.js -var htmlText = { - name: 'htmlText', - tokenize: tokenizeHtmlText, -}; -function tokenizeHtmlText(effects, ok2, nok) { - const self2 = this; - let marker; - let buffer2; - let index2; - let returnState; - return start3; - function start3(code2) { - effects.enter('htmlText'); - effects.enter('htmlTextData'); - effects.consume(code2); - return open; - } - function open(code2) { - if (code2 === 33) { - effects.consume(code2); - return declarationOpen; - } - if (code2 === 47) { - effects.consume(code2); - return tagCloseStart; - } - if (code2 === 63) { - effects.consume(code2); - return instruction; - } - if (asciiAlpha(code2)) { - effects.consume(code2); - return tagOpen; - } - return nok(code2); - } - function declarationOpen(code2) { - if (code2 === 45) { - effects.consume(code2); - return commentOpen; - } - if (code2 === 91) { - effects.consume(code2); - buffer2 = 'CDATA['; - index2 = 0; - return cdataOpen; - } - if (asciiAlpha(code2)) { - effects.consume(code2); - return declaration; - } - return nok(code2); - } - function commentOpen(code2) { - if (code2 === 45) { - effects.consume(code2); - return commentStart; - } - return nok(code2); - } - function commentStart(code2) { - if (code2 === null || code2 === 62) { - return nok(code2); - } - if (code2 === 45) { - effects.consume(code2); - return commentStartDash; - } - return comment2(code2); - } - function commentStartDash(code2) { - if (code2 === null || code2 === 62) { - return nok(code2); - } - return comment2(code2); - } - function comment2(code2) { - if (code2 === null) { - return nok(code2); - } - if (code2 === 45) { - effects.consume(code2); - return commentClose; - } - if (markdownLineEnding(code2)) { - returnState = comment2; - return atLineEnding(code2); - } - effects.consume(code2); - return comment2; - } - function commentClose(code2) { - if (code2 === 45) { - effects.consume(code2); - return end; - } - return comment2(code2); - } - function cdataOpen(code2) { - if (code2 === buffer2.charCodeAt(index2++)) { - effects.consume(code2); - return index2 === buffer2.length ? cdata : cdataOpen; - } - return nok(code2); - } - function cdata(code2) { - if (code2 === null) { - return nok(code2); - } - if (code2 === 93) { - effects.consume(code2); - return cdataClose; - } - if (markdownLineEnding(code2)) { - returnState = cdata; - return atLineEnding(code2); - } - effects.consume(code2); - return cdata; - } - function cdataClose(code2) { - if (code2 === 93) { - effects.consume(code2); - return cdataEnd; - } - return cdata(code2); - } - function cdataEnd(code2) { - if (code2 === 62) { - return end(code2); - } - if (code2 === 93) { - effects.consume(code2); - return cdataEnd; - } - return cdata(code2); - } - function declaration(code2) { - if (code2 === null || code2 === 62) { - return end(code2); - } - if (markdownLineEnding(code2)) { - returnState = declaration; - return atLineEnding(code2); - } - effects.consume(code2); - return declaration; - } - function instruction(code2) { - if (code2 === null) { - return nok(code2); - } - if (code2 === 63) { - effects.consume(code2); - return instructionClose; - } - if (markdownLineEnding(code2)) { - returnState = instruction; - return atLineEnding(code2); - } - effects.consume(code2); - return instruction; - } - function instructionClose(code2) { - return code2 === 62 ? end(code2) : instruction(code2); - } - function tagCloseStart(code2) { - if (asciiAlpha(code2)) { - effects.consume(code2); - return tagClose; - } - return nok(code2); - } - function tagClose(code2) { - if (code2 === 45 || asciiAlphanumeric(code2)) { - effects.consume(code2); - return tagClose; - } - return tagCloseBetween(code2); - } - function tagCloseBetween(code2) { - if (markdownLineEnding(code2)) { - returnState = tagCloseBetween; - return atLineEnding(code2); - } - if (markdownSpace(code2)) { - effects.consume(code2); - return tagCloseBetween; - } - return end(code2); - } - function tagOpen(code2) { - if (code2 === 45 || asciiAlphanumeric(code2)) { - effects.consume(code2); - return tagOpen; - } - if (code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) { - return tagOpenBetween(code2); - } - return nok(code2); - } - function tagOpenBetween(code2) { - if (code2 === 47) { - effects.consume(code2); - return end; - } - if (code2 === 58 || code2 === 95 || asciiAlpha(code2)) { - effects.consume(code2); - return tagOpenAttributeName; - } - if (markdownLineEnding(code2)) { - returnState = tagOpenBetween; - return atLineEnding(code2); - } - if (markdownSpace(code2)) { - effects.consume(code2); - return tagOpenBetween; - } - return end(code2); - } - function tagOpenAttributeName(code2) { - if ( - code2 === 45 || - code2 === 46 || - code2 === 58 || - code2 === 95 || - asciiAlphanumeric(code2) - ) { - effects.consume(code2); - return tagOpenAttributeName; - } - return tagOpenAttributeNameAfter(code2); - } - function tagOpenAttributeNameAfter(code2) { - if (code2 === 61) { - effects.consume(code2); - return tagOpenAttributeValueBefore; - } - if (markdownLineEnding(code2)) { - returnState = tagOpenAttributeNameAfter; - return atLineEnding(code2); - } - if (markdownSpace(code2)) { - effects.consume(code2); - return tagOpenAttributeNameAfter; - } - return tagOpenBetween(code2); - } - function tagOpenAttributeValueBefore(code2) { - if ( - code2 === null || - code2 === 60 || - code2 === 61 || - code2 === 62 || - code2 === 96 - ) { - return nok(code2); - } - if (code2 === 34 || code2 === 39) { - effects.consume(code2); - marker = code2; - return tagOpenAttributeValueQuoted; - } - if (markdownLineEnding(code2)) { - returnState = tagOpenAttributeValueBefore; - return atLineEnding(code2); - } - if (markdownSpace(code2)) { - effects.consume(code2); - return tagOpenAttributeValueBefore; - } - effects.consume(code2); - marker = void 0; - return tagOpenAttributeValueUnquoted; - } - function tagOpenAttributeValueQuoted(code2) { - if (code2 === marker) { - effects.consume(code2); - return tagOpenAttributeValueQuotedAfter; - } - if (code2 === null) { - return nok(code2); - } - if (markdownLineEnding(code2)) { - returnState = tagOpenAttributeValueQuoted; - return atLineEnding(code2); - } - effects.consume(code2); - return tagOpenAttributeValueQuoted; - } - function tagOpenAttributeValueQuotedAfter(code2) { - if (code2 === 62 || code2 === 47 || markdownLineEndingOrSpace(code2)) { - return tagOpenBetween(code2); - } - return nok(code2); - } - function tagOpenAttributeValueUnquoted(code2) { - if ( - code2 === null || - code2 === 34 || - code2 === 39 || - code2 === 60 || - code2 === 61 || - code2 === 96 - ) { - return nok(code2); - } - if (code2 === 62 || markdownLineEndingOrSpace(code2)) { - return tagOpenBetween(code2); - } - effects.consume(code2); - return tagOpenAttributeValueUnquoted; - } - function atLineEnding(code2) { - effects.exit('htmlTextData'); - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - return factorySpace( - effects, - afterPrefix, - 'linePrefix', - self2.parser.constructs.disable.null.includes('codeIndented') - ? void 0 - : 4, - ); - } - function afterPrefix(code2) { - effects.enter('htmlTextData'); - return returnState(code2); - } - function end(code2) { - if (code2 === 62) { - effects.consume(code2); - effects.exit('htmlTextData'); - effects.exit('htmlText'); - return ok2; - } - return nok(code2); - } -} - -// node_modules/micromark-core-commonmark/lib/label-end.js -var labelEnd = { - name: 'labelEnd', - tokenize: tokenizeLabelEnd, - resolveTo: resolveToLabelEnd, - resolveAll: resolveAllLabelEnd, -}; -var resourceConstruct = { - tokenize: tokenizeResource, -}; -var fullReferenceConstruct = { - tokenize: tokenizeFullReference, -}; -var collapsedReferenceConstruct = { - tokenize: tokenizeCollapsedReference, -}; -function resolveAllLabelEnd(events) { - let index2 = -1; - let token; - while (++index2 < events.length) { - token = events[index2][1]; - if ( - token.type === 'labelImage' || - token.type === 'labelLink' || - token.type === 'labelEnd' - ) { - events.splice(index2 + 1, token.type === 'labelImage' ? 4 : 2); - token.type = 'data'; - index2++; - } - } - return events; -} -function resolveToLabelEnd(events, context) { - let index2 = events.length; - let offset2 = 0; - let token; - let open; - let close; - let media; - while (index2--) { - token = events[index2][1]; - if (open) { - if ( - token.type === 'link' || - (token.type === 'labelLink' && token._inactive) - ) { - break; - } - if (events[index2][0] === 'enter' && token.type === 'labelLink') { - token._inactive = true; - } - } else if (close) { - if ( - events[index2][0] === 'enter' && - (token.type === 'labelImage' || token.type === 'labelLink') && - !token._balanced - ) { - open = index2; - if (token.type !== 'labelLink') { - offset2 = 2; - break; - } - } - } else if (token.type === 'labelEnd') { - close = index2; - } - } - const group = { - type: events[open][1].type === 'labelLink' ? 'link' : 'image', - start: Object.assign({}, events[open][1].start), - end: Object.assign({}, events[events.length - 1][1].end), - }; - const label = { - type: 'label', - start: Object.assign({}, events[open][1].start), - end: Object.assign({}, events[close][1].end), - }; - const text5 = { - type: 'labelText', - start: Object.assign({}, events[open + offset2 + 2][1].end), - end: Object.assign({}, events[close - 2][1].start), - }; - media = [ - ['enter', group, context], - ['enter', label, context], - ]; - media = push(media, events.slice(open + 1, open + offset2 + 3)); - media = push(media, [['enter', text5, context]]); - media = push( - media, - resolveAll( - context.parser.constructs.insideSpan.null, - events.slice(open + offset2 + 4, close - 3), - context, - ), - ); - media = push(media, [ - ['exit', text5, context], - events[close - 2], - events[close - 1], - ['exit', label, context], - ]); - media = push(media, events.slice(close + 1)); - media = push(media, [['exit', group, context]]); - splice(events, open, events.length, media); - return events; -} -function tokenizeLabelEnd(effects, ok2, nok) { - const self2 = this; - let index2 = self2.events.length; - let labelStart; - let defined; - while (index2--) { - if ( - (self2.events[index2][1].type === 'labelImage' || - self2.events[index2][1].type === 'labelLink') && - !self2.events[index2][1]._balanced - ) { - labelStart = self2.events[index2][1]; - break; - } - } - return start3; - function start3(code2) { - if (!labelStart) { - return nok(code2); - } - if (labelStart._inactive) return balanced(code2); - defined = self2.parser.defined.includes( - normalizeIdentifier( - self2.sliceSerialize({ - start: labelStart.end, - end: self2.now(), - }), - ), - ); - effects.enter('labelEnd'); - effects.enter('labelMarker'); - effects.consume(code2); - effects.exit('labelMarker'); - effects.exit('labelEnd'); - return afterLabelEnd; - } - function afterLabelEnd(code2) { - if (code2 === 40) { - return effects.attempt( - resourceConstruct, - ok2, - defined ? ok2 : balanced, - )(code2); - } - if (code2 === 91) { - return effects.attempt( - fullReferenceConstruct, - ok2, - defined - ? effects.attempt(collapsedReferenceConstruct, ok2, balanced) - : balanced, - )(code2); - } - return defined ? ok2(code2) : balanced(code2); - } - function balanced(code2) { - labelStart._balanced = true; - return nok(code2); - } -} -function tokenizeResource(effects, ok2, nok) { - return start3; - function start3(code2) { - effects.enter('resource'); - effects.enter('resourceMarker'); - effects.consume(code2); - effects.exit('resourceMarker'); - return factoryWhitespace(effects, open); - } - function open(code2) { - if (code2 === 41) { - return end(code2); - } - return factoryDestination( - effects, - destinationAfter, - nok, - 'resourceDestination', - 'resourceDestinationLiteral', - 'resourceDestinationLiteralMarker', - 'resourceDestinationRaw', - 'resourceDestinationString', - 32, - )(code2); - } - function destinationAfter(code2) { - return markdownLineEndingOrSpace(code2) - ? factoryWhitespace(effects, between)(code2) - : end(code2); - } - function between(code2) { - if (code2 === 34 || code2 === 39 || code2 === 40) { - return factoryTitle( - effects, - factoryWhitespace(effects, end), - nok, - 'resourceTitle', - 'resourceTitleMarker', - 'resourceTitleString', - )(code2); - } - return end(code2); - } - function end(code2) { - if (code2 === 41) { - effects.enter('resourceMarker'); - effects.consume(code2); - effects.exit('resourceMarker'); - effects.exit('resource'); - return ok2; - } - return nok(code2); - } -} -function tokenizeFullReference(effects, ok2, nok) { - const self2 = this; - return start3; - function start3(code2) { - return factoryLabel.call( - self2, - effects, - afterLabel, - nok, - 'reference', - 'referenceMarker', - 'referenceString', - )(code2); - } - function afterLabel(code2) { - return self2.parser.defined.includes( - normalizeIdentifier( - self2 - .sliceSerialize(self2.events[self2.events.length - 1][1]) - .slice(1, -1), - ), - ) - ? ok2(code2) - : nok(code2); - } -} -function tokenizeCollapsedReference(effects, ok2, nok) { - return start3; - function start3(code2) { - effects.enter('reference'); - effects.enter('referenceMarker'); - effects.consume(code2); - effects.exit('referenceMarker'); - return open; - } - function open(code2) { - if (code2 === 93) { - effects.enter('referenceMarker'); - effects.consume(code2); - effects.exit('referenceMarker'); - effects.exit('reference'); - return ok2; - } - return nok(code2); - } -} - -// node_modules/micromark-core-commonmark/lib/label-start-image.js -var labelStartImage = { - name: 'labelStartImage', - tokenize: tokenizeLabelStartImage, - resolveAll: labelEnd.resolveAll, -}; -function tokenizeLabelStartImage(effects, ok2, nok) { - const self2 = this; - return start3; - function start3(code2) { - effects.enter('labelImage'); - effects.enter('labelImageMarker'); - effects.consume(code2); - effects.exit('labelImageMarker'); - return open; - } - function open(code2) { - if (code2 === 91) { - effects.enter('labelMarker'); - effects.consume(code2); - effects.exit('labelMarker'); - effects.exit('labelImage'); - return after; - } - return nok(code2); - } - function after(code2) { - return code2 === 94 && '_hiddenFootnoteSupport' in self2.parser.constructs - ? nok(code2) - : ok2(code2); - } -} - -// node_modules/micromark-core-commonmark/lib/label-start-link.js -var labelStartLink = { - name: 'labelStartLink', - tokenize: tokenizeLabelStartLink, - resolveAll: labelEnd.resolveAll, -}; -function tokenizeLabelStartLink(effects, ok2, nok) { - const self2 = this; - return start3; - function start3(code2) { - effects.enter('labelLink'); - effects.enter('labelMarker'); - effects.consume(code2); - effects.exit('labelMarker'); - effects.exit('labelLink'); - return after; - } - function after(code2) { - return code2 === 94 && '_hiddenFootnoteSupport' in self2.parser.constructs - ? nok(code2) - : ok2(code2); - } -} - -// node_modules/micromark-core-commonmark/lib/line-ending.js -var lineEnding = { - name: 'lineEnding', - tokenize: tokenizeLineEnding, -}; -function tokenizeLineEnding(effects, ok2) { - return start3; - function start3(code2) { - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - return factorySpace(effects, ok2, 'linePrefix'); - } -} - -// node_modules/micromark-core-commonmark/lib/thematic-break.js -var thematicBreak = { - name: 'thematicBreak', - tokenize: tokenizeThematicBreak, -}; -function tokenizeThematicBreak(effects, ok2, nok) { - let size = 0; - let marker; - return start3; - function start3(code2) { - effects.enter('thematicBreak'); - marker = code2; - return atBreak(code2); - } - function atBreak(code2) { - if (code2 === marker) { - effects.enter('thematicBreakSequence'); - return sequence(code2); - } - if (markdownSpace(code2)) { - return factorySpace(effects, atBreak, 'whitespace')(code2); - } - if (size < 3 || (code2 !== null && !markdownLineEnding(code2))) { - return nok(code2); - } - effects.exit('thematicBreak'); - return ok2(code2); - } - function sequence(code2) { - if (code2 === marker) { - effects.consume(code2); - size++; - return sequence; - } - effects.exit('thematicBreakSequence'); - return atBreak(code2); - } -} - -// node_modules/micromark-core-commonmark/lib/list.js -var list = { - name: 'list', - tokenize: tokenizeListStart, - continuation: { - tokenize: tokenizeListContinuation, - }, - exit: tokenizeListEnd, -}; -var listItemPrefixWhitespaceConstruct = { - tokenize: tokenizeListItemPrefixWhitespace, - partial: true, -}; -var indentConstruct = { - tokenize: tokenizeIndent, - partial: true, -}; -function tokenizeListStart(effects, ok2, nok) { - const self2 = this; - const tail = self2.events[self2.events.length - 1]; - let initialSize = - tail && tail[1].type === 'linePrefix' - ? tail[2].sliceSerialize(tail[1], true).length - : 0; - let size = 0; - return start3; - function start3(code2) { - const kind = - self2.containerState.type || - (code2 === 42 || code2 === 43 || code2 === 45 - ? 'listUnordered' - : 'listOrdered'); - if ( - kind === 'listUnordered' - ? !self2.containerState.marker || code2 === self2.containerState.marker - : asciiDigit(code2) - ) { - if (!self2.containerState.type) { - self2.containerState.type = kind; - effects.enter(kind, { - _container: true, - }); - } - if (kind === 'listUnordered') { - effects.enter('listItemPrefix'); - return code2 === 42 || code2 === 45 - ? effects.check(thematicBreak, nok, atMarker)(code2) - : atMarker(code2); - } - if (!self2.interrupt || code2 === 49) { - effects.enter('listItemPrefix'); - effects.enter('listItemValue'); - return inside(code2); - } - } - return nok(code2); - } - function inside(code2) { - if (asciiDigit(code2) && ++size < 10) { - effects.consume(code2); - return inside; - } - if ( - (!self2.interrupt || size < 2) && - (self2.containerState.marker - ? code2 === self2.containerState.marker - : code2 === 41 || code2 === 46) - ) { - effects.exit('listItemValue'); - return atMarker(code2); - } - return nok(code2); - } - function atMarker(code2) { - effects.enter('listItemMarker'); - effects.consume(code2); - effects.exit('listItemMarker'); - self2.containerState.marker = self2.containerState.marker || code2; - return effects.check( - blankLine, - self2.interrupt ? nok : onBlank, - effects.attempt( - listItemPrefixWhitespaceConstruct, - endOfPrefix, - otherPrefix, - ), - ); - } - function onBlank(code2) { - self2.containerState.initialBlankLine = true; - initialSize++; - return endOfPrefix(code2); - } - function otherPrefix(code2) { - if (markdownSpace(code2)) { - effects.enter('listItemPrefixWhitespace'); - effects.consume(code2); - effects.exit('listItemPrefixWhitespace'); - return endOfPrefix; - } - return nok(code2); - } - function endOfPrefix(code2) { - self2.containerState.size = - initialSize + - self2.sliceSerialize(effects.exit('listItemPrefix'), true).length; - return ok2(code2); - } -} -function tokenizeListContinuation(effects, ok2, nok) { - const self2 = this; - self2.containerState._closeFlow = void 0; - return effects.check(blankLine, onBlank, notBlank); - function onBlank(code2) { - self2.containerState.furtherBlankLines = - self2.containerState.furtherBlankLines || - self2.containerState.initialBlankLine; - return factorySpace( - effects, - ok2, - 'listItemIndent', - self2.containerState.size + 1, - )(code2); - } - function notBlank(code2) { - if (self2.containerState.furtherBlankLines || !markdownSpace(code2)) { - self2.containerState.furtherBlankLines = void 0; - self2.containerState.initialBlankLine = void 0; - return notInCurrentItem(code2); - } - self2.containerState.furtherBlankLines = void 0; - self2.containerState.initialBlankLine = void 0; - return effects.attempt(indentConstruct, ok2, notInCurrentItem)(code2); - } - function notInCurrentItem(code2) { - self2.containerState._closeFlow = true; - self2.interrupt = void 0; - return factorySpace( - effects, - effects.attempt(list, ok2, nok), - 'linePrefix', - self2.parser.constructs.disable.null.includes('codeIndented') - ? void 0 - : 4, - )(code2); - } -} -function tokenizeIndent(effects, ok2, nok) { - const self2 = this; - return factorySpace( - effects, - afterPrefix, - 'listItemIndent', - self2.containerState.size + 1, - ); - function afterPrefix(code2) { - const tail = self2.events[self2.events.length - 1]; - return tail && - tail[1].type === 'listItemIndent' && - tail[2].sliceSerialize(tail[1], true).length === self2.containerState.size - ? ok2(code2) - : nok(code2); - } -} -function tokenizeListEnd(effects) { - effects.exit(this.containerState.type); -} -function tokenizeListItemPrefixWhitespace(effects, ok2, nok) { - const self2 = this; - return factorySpace( - effects, - afterPrefix, - 'listItemPrefixWhitespace', - self2.parser.constructs.disable.null.includes('codeIndented') - ? void 0 - : 4 + 1, - ); - function afterPrefix(code2) { - const tail = self2.events[self2.events.length - 1]; - return !markdownSpace(code2) && - tail && - tail[1].type === 'listItemPrefixWhitespace' - ? ok2(code2) - : nok(code2); - } -} - -// node_modules/micromark-core-commonmark/lib/setext-underline.js -var setextUnderline = { - name: 'setextUnderline', - tokenize: tokenizeSetextUnderline, - resolveTo: resolveToSetextUnderline, -}; -function resolveToSetextUnderline(events, context) { - let index2 = events.length; - let content3; - let text5; - let definition2; - while (index2--) { - if (events[index2][0] === 'enter') { - if (events[index2][1].type === 'content') { - content3 = index2; - break; - } - if (events[index2][1].type === 'paragraph') { - text5 = index2; - } - } else { - if (events[index2][1].type === 'content') { - events.splice(index2, 1); - } - if (!definition2 && events[index2][1].type === 'definition') { - definition2 = index2; - } - } - } - const heading2 = { - type: 'setextHeading', - start: Object.assign({}, events[text5][1].start), - end: Object.assign({}, events[events.length - 1][1].end), - }; - events[text5][1].type = 'setextHeadingText'; - if (definition2) { - events.splice(text5, 0, ['enter', heading2, context]); - events.splice(definition2 + 1, 0, ['exit', events[content3][1], context]); - events[content3][1].end = Object.assign({}, events[definition2][1].end); - } else { - events[content3][1] = heading2; - } - events.push(['exit', heading2, context]); - return events; -} -function tokenizeSetextUnderline(effects, ok2, nok) { - const self2 = this; - let index2 = self2.events.length; - let marker; - let paragraph2; - while (index2--) { - if ( - self2.events[index2][1].type !== 'lineEnding' && - self2.events[index2][1].type !== 'linePrefix' && - self2.events[index2][1].type !== 'content' - ) { - paragraph2 = self2.events[index2][1].type === 'paragraph'; - break; - } - } - return start3; - function start3(code2) { - if ( - !self2.parser.lazy[self2.now().line] && - (self2.interrupt || paragraph2) - ) { - effects.enter('setextHeadingLine'); - effects.enter('setextHeadingLineSequence'); - marker = code2; - return closingSequence(code2); - } - return nok(code2); - } - function closingSequence(code2) { - if (code2 === marker) { - effects.consume(code2); - return closingSequence; - } - effects.exit('setextHeadingLineSequence'); - return factorySpace(effects, closingSequenceEnd, 'lineSuffix')(code2); - } - function closingSequenceEnd(code2) { - if (code2 === null || markdownLineEnding(code2)) { - effects.exit('setextHeadingLine'); - return ok2(code2); - } - return nok(code2); - } -} - -// node_modules/micromark-extension-mdxjs-esm/lib/syntax.js -var nextBlankConstruct2 = { - tokenize: tokenizeNextBlank2, - partial: true, -}; -var allowedAcornTypes = /* @__PURE__ */ new Set([ - 'ExportAllDeclaration', - 'ExportDefaultDeclaration', - 'ExportNamedDeclaration', - 'ImportDeclaration', -]); -function mdxjsEsm(options) { - const exportImportConstruct = { - tokenize: tokenizeExportImport, - concrete: true, - }; - if (!options || !options.acorn || !options.acorn.parse) { - throw new Error( - 'Expected an `acorn` instance passed in as `options.acorn`', - ); - } - const acorn = options.acorn; - const acornOptions = Object.assign( - { - ecmaVersion: 2020, - sourceType: 'module', - }, - options.acornOptions, - ); - return { - flow: { - [101]: exportImportConstruct, - [105]: exportImportConstruct, - }, - }; - function tokenizeExportImport(effects, ok2, nok) { - const self2 = this; - const definedModuleSpecifiers = - self2.parser.definedModuleSpecifiers || - (self2.parser.definedModuleSpecifiers = []); - const eventStart = this.events.length + 1; - let index2 = 0; - let buffer2; - return self2.interrupt ? nok : start3; - function start3(code2) { - if (self2.now().column > 1) return nok(code2); - buffer2 = code2 === 101 ? 'export' : 'import'; - effects.enter('mdxjsEsm'); - effects.enter('mdxjsEsmData'); - return keyword(code2); - } - function keyword(code2) { - if (code2 === buffer2.charCodeAt(index2++)) { - effects.consume(code2); - return index2 === buffer2.length ? after : keyword; - } - return nok(code2); - } - function after(code2) { - if (unicodeWhitespace(code2)) { - effects.consume(code2); - return rest; - } - return nok(code2); - } - function rest(code2) { - if (code2 === null) { - return atEndOfData(code2); - } - if (markdownLineEnding(code2)) { - return effects.check(nextBlankConstruct2, atEndOfData, atEol)(code2); - } - effects.consume(code2); - return rest; - } - function atEol(code2) { - effects.exit('mdxjsEsmData'); - return lineStart(code2); - } - function lineStart(code2) { - if (markdownLineEnding(code2)) { - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - return lineStart; - } - if (code2 === null) { - return atEnd(code2); - } - effects.enter('mdxjsEsmData'); - return rest(code2); - } - function atEndOfData(code2) { - effects.exit('mdxjsEsmData'); - return atEnd(code2); - } - function atEnd(code2) { - let index3 = -1; - const result = eventsToAcorn(self2.events.slice(eventStart), { - acorn, - acornOptions, - prefix: - definedModuleSpecifiers.length > 0 - ? 'var ' + definedModuleSpecifiers.join(',') + '\n' - : '', - }); - if (code2 !== null && result.swallow) { - return lineStart(code2); - } - if (result.error) { - throw new VFileMessage( - 'Could not parse import/exports with acorn: ' + String(result.error), - { - line: result.error.loc.line, - column: result.error.loc.column + 1, - offset: result.error.pos, - }, - 'micromark-extension-mdxjs-esm:acorn', - ); - } - if (definedModuleSpecifiers.length > 0) { - result.estree.body.shift(); - } - while (++index3 < result.estree.body.length) { - const node = result.estree.body[index3]; - if (!allowedAcornTypes.has(node.type)) { - throw new VFileMessage( - 'Unexpected `' + - node.type + - '` in code: only import/exports are supported', - positionFromEstree(node), - 'micromark-extension-mdxjs-esm:non-esm', - ); - } - if (node.type === 'ImportDeclaration' && !self2.interrupt) { - let index4 = -1; - while (++index4 < node.specifiers.length) { - definedModuleSpecifiers.push(node.specifiers[index4].local.name); - } - } - } - Object.assign( - effects.exit('mdxjsEsm'), - options.addResult - ? { - estree: result.estree, - } - : void 0, - ); - return ok2(code2); - } - } -} -function tokenizeNextBlank2(effects, ok2, nok) { - return start3; - function start3(code2) { - effects.exit('mdxjsEsmData'); - effects.enter('lineEndingBlank'); - effects.consume(code2); - effects.exit('lineEndingBlank'); - return effects.attempt(blankLine, ok2, nok); - } -} - -// node_modules/micromark-extension-mdxjs/index.js -function mdxjs(options) { - const settings = Object.assign( - { - acorn: Parser.extend((0, import_acorn_jsx.default)()), - acornOptions: {ecmaVersion: 2020, sourceType: 'module'}, - addResult: true, - }, - options, - ); - return combineExtensions([ - mdxjsEsm(settings), - mdxExpression(settings), - mdxJsx(settings), - mdxMd, - ]); -} - -// node_modules/mdast-util-mdx-expression/index.js -var mdxExpressionFromMarkdown = { - enter: { - mdxFlowExpression: enterMdxFlowExpression, - mdxTextExpression: enterMdxTextExpression, - }, - exit: { - mdxFlowExpression: exitMdxExpression, - mdxFlowExpressionChunk: exitMdxExpressionData, - mdxTextExpression: exitMdxExpression, - mdxTextExpressionChunk: exitMdxExpressionData, - }, -}; -var mdxExpressionToMarkdown = { - handlers: { - mdxFlowExpression: handleMdxExpression, - mdxTextExpression: handleMdxExpression, - }, - unsafe: [ - {character: '{', inConstruct: ['phrasing']}, - {atBreak: true, character: '{'}, - ], -}; -function enterMdxFlowExpression(token) { - this.enter({type: 'mdxFlowExpression', value: ''}, token); - this.buffer(); -} -function enterMdxTextExpression(token) { - this.enter({type: 'mdxTextExpression', value: ''}, token); - this.buffer(); -} -function exitMdxExpression(token) { - const value = this.resume(); - const estree = token.estree; - const node = this.exit(token); - node.value = value; - if (estree) { - node.data = {estree}; - } -} -function exitMdxExpressionData(token) { - this.config.enter.data.call(this, token); - this.config.exit.data.call(this, token); -} -function handleMdxExpression(node) { - const value = node.value || ''; - return '{' + value + '}'; -} - -// node_modules/mdast-util-mdx-jsx/node_modules/ccount/index.js -function ccount(value, character) { - const source = String(value); - if (typeof character !== 'string') { - throw new TypeError('Expected character'); - } - let count = 0; - let index2 = source.indexOf(character); - while (index2 !== -1) { - count++; - index2 = source.indexOf(character, index2 + character.length); - } - return count; -} - -// node_modules/parse-entities/node_modules/character-entities-legacy/index.js -var characterEntitiesLegacy = [ - 'AElig', - 'AMP', - 'Aacute', - 'Acirc', - 'Agrave', - 'Aring', - 'Atilde', - 'Auml', - 'COPY', - 'Ccedil', - 'ETH', - 'Eacute', - 'Ecirc', - 'Egrave', - 'Euml', - 'GT', - 'Iacute', - 'Icirc', - 'Igrave', - 'Iuml', - 'LT', - 'Ntilde', - 'Oacute', - 'Ocirc', - 'Ograve', - 'Oslash', - 'Otilde', - 'Ouml', - 'QUOT', - 'REG', - 'THORN', - 'Uacute', - 'Ucirc', - 'Ugrave', - 'Uuml', - 'Yacute', - 'aacute', - 'acirc', - 'acute', - 'aelig', - 'agrave', - 'amp', - 'aring', - 'atilde', - 'auml', - 'brvbar', - 'ccedil', - 'cedil', - 'cent', - 'copy', - 'curren', - 'deg', - 'divide', - 'eacute', - 'ecirc', - 'egrave', - 'eth', - 'euml', - 'frac12', - 'frac14', - 'frac34', - 'gt', - 'iacute', - 'icirc', - 'iexcl', - 'igrave', - 'iquest', - 'iuml', - 'laquo', - 'lt', - 'macr', - 'micro', - 'middot', - 'nbsp', - 'not', - 'ntilde', - 'oacute', - 'ocirc', - 'ograve', - 'ordf', - 'ordm', - 'oslash', - 'otilde', - 'ouml', - 'para', - 'plusmn', - 'pound', - 'quot', - 'raquo', - 'reg', - 'sect', - 'shy', - 'sup1', - 'sup2', - 'sup3', - 'szlig', - 'thorn', - 'times', - 'uacute', - 'ucirc', - 'ugrave', - 'uml', - 'uuml', - 'yacute', - 'yen', - 'yuml', -]; - -// node_modules/character-reference-invalid/index.js -var characterReferenceInvalid = { - 0: '\uFFFD', - 128: '\u20AC', - 130: '\u201A', - 131: '\u0192', - 132: '\u201E', - 133: '\u2026', - 134: '\u2020', - 135: '\u2021', - 136: '\u02C6', - 137: '\u2030', - 138: '\u0160', - 139: '\u2039', - 140: '\u0152', - 142: '\u017D', - 145: '\u2018', - 146: '\u2019', - 147: '\u201C', - 148: '\u201D', - 149: '\u2022', - 150: '\u2013', - 151: '\u2014', - 152: '\u02DC', - 153: '\u2122', - 154: '\u0161', - 155: '\u203A', - 156: '\u0153', - 158: '\u017E', - 159: '\u0178', -}; - -// node_modules/parse-entities/node_modules/is-decimal/index.js -function isDecimal(character) { - const code2 = - typeof character === 'string' ? character.charCodeAt(0) : character; - return code2 >= 48 && code2 <= 57; -} - -// node_modules/is-hexadecimal/index.js -function isHexadecimal(character) { - const code2 = - typeof character === 'string' ? character.charCodeAt(0) : character; - return ( - (code2 >= 97 && code2 <= 102) || - (code2 >= 65 && code2 <= 70) || - (code2 >= 48 && code2 <= 57) - ); -} - -// node_modules/is-alphanumerical/node_modules/is-alphabetical/index.js -function isAlphabetical(character) { - const code2 = - typeof character === 'string' ? character.charCodeAt(0) : character; - return (code2 >= 97 && code2 <= 122) || (code2 >= 65 && code2 <= 90); -} - -// node_modules/is-alphanumerical/node_modules/is-decimal/index.js -function isDecimal2(character) { - const code2 = - typeof character === 'string' ? character.charCodeAt(0) : character; - return code2 >= 48 && code2 <= 57; -} - -// node_modules/is-alphanumerical/index.js -function isAlphanumerical(character) { - return isAlphabetical(character) || isDecimal2(character); -} - -// node_modules/parse-entities/lib/index.js -var fromCharCode = String.fromCharCode; -var messages = [ - '', - 'Named character references must be terminated by a semicolon', - 'Numeric character references must be terminated by a semicolon', - 'Named character references cannot be empty', - 'Numeric character references cannot be empty', - 'Named character references must be known', - 'Numeric character references cannot be disallowed', - 'Numeric character references cannot be outside the permissible Unicode range', -]; -function parseEntities(value, options = {}) { - const additional = - typeof options.additional === 'string' - ? options.additional.charCodeAt(0) - : options.additional; - const result = []; - let index2 = 0; - let lines = -1; - let queue = ''; - let point3; - let indent; - if (options.position) { - if ('start' in options.position || 'indent' in options.position) { - indent = options.position.indent; - point3 = options.position.start; - } else { - point3 = options.position; - } - } - let line = (point3 ? point3.line : 0) || 1; - let column = (point3 ? point3.column : 0) || 1; - let previous2 = now(); - let character; - index2--; - while (++index2 <= value.length) { - if (character === 10) { - column = (indent ? indent[lines] : 0) || 1; - } - character = value.charCodeAt(index2); - if (character === 38) { - const following = value.charCodeAt(index2 + 1); - if ( - following === 9 || - following === 10 || - following === 12 || - following === 32 || - following === 38 || - following === 60 || - Number.isNaN(following) || - (additional && following === additional) - ) { - queue += fromCharCode(character); - column++; - continue; - } - const start3 = index2 + 1; - let begin = start3; - let end = start3; - let type; - if (following === 35) { - end = ++begin; - const following2 = value.charCodeAt(end); - if (following2 === 88 || following2 === 120) { - type = 'hexadecimal'; - end = ++begin; - } else { - type = 'decimal'; - } - } else { - type = 'named'; - } - let characterReferenceCharacters = ''; - let characterReference2 = ''; - let characters = ''; - const test = - type === 'named' - ? isAlphanumerical - : type === 'decimal' - ? isDecimal - : isHexadecimal; - end--; - while (++end <= value.length) { - const following2 = value.charCodeAt(end); - if (!test(following2)) { - break; - } - characters += fromCharCode(following2); - if (type === 'named' && characterEntitiesLegacy.includes(characters)) { - characterReferenceCharacters = characters; - characterReference2 = decodeNamedCharacterReference(characters); - } - } - let terminated = value.charCodeAt(end) === 59; - if (terminated) { - end++; - const namedReference = - type === 'named' ? decodeNamedCharacterReference(characters) : false; - if (namedReference) { - characterReferenceCharacters = characters; - characterReference2 = namedReference; - } - } - let diff = 1 + end - start3; - let reference = ''; - if (!terminated && options.nonTerminated === false) { - } else if (!characters) { - if (type !== 'named') { - warning(4, diff); - } - } else if (type === 'named') { - if (terminated && !characterReference2) { - warning(5, 1); - } else { - if (characterReferenceCharacters !== characters) { - end = begin + characterReferenceCharacters.length; - diff = 1 + end - begin; - terminated = false; - } - if (!terminated) { - const reason = characterReferenceCharacters ? 1 : 3; - if (options.attribute) { - const following2 = value.charCodeAt(end); - if (following2 === 61) { - warning(reason, diff); - characterReference2 = ''; - } else if (isAlphanumerical(following2)) { - characterReference2 = ''; - } else { - warning(reason, diff); - } - } else { - warning(reason, diff); - } - } - } - reference = characterReference2; - } else { - if (!terminated) { - warning(2, diff); - } - let referenceCode = Number.parseInt( - characters, - type === 'hexadecimal' ? 16 : 10, - ); - if (prohibited(referenceCode)) { - warning(7, diff); - reference = fromCharCode(65533); - } else if (referenceCode in characterReferenceInvalid) { - warning(6, diff); - reference = characterReferenceInvalid[referenceCode]; - } else { - let output = ''; - if (disallowed(referenceCode)) { - warning(6, diff); - } - if (referenceCode > 65535) { - referenceCode -= 65536; - output += fromCharCode((referenceCode >>> (10 & 1023)) | 55296); - referenceCode = 56320 | (referenceCode & 1023); - } - reference = output + fromCharCode(referenceCode); - } - } - if (reference) { - flush(); - previous2 = now(); - index2 = end - 1; - column += end - start3 + 1; - result.push(reference); - const next = now(); - next.offset++; - if (options.reference) { - options.reference.call( - options.referenceContext, - reference, - {start: previous2, end: next}, - value.slice(start3 - 1, end), - ); - } - previous2 = next; - } else { - characters = value.slice(start3 - 1, end); - queue += characters; - column += characters.length; - index2 = end - 1; - } - } else { - if (character === 10) { - line++; - lines++; - column = 0; - } - if (Number.isNaN(character)) { - flush(); - } else { - queue += fromCharCode(character); - column++; - } - } - } - return result.join(''); - function now() { - return { - line, - column, - offset: index2 + ((point3 ? point3.offset : 0) || 0), - }; - } - function warning(code2, offset2) { - let position3; - if (options.warning) { - position3 = now(); - position3.column += offset2; - position3.offset += offset2; - options.warning.call( - options.warningContext, - messages[code2], - position3, - code2, - ); - } - } - function flush() { - if (queue) { - result.push(queue); - if (options.text) { - options.text.call(options.textContext, queue, { - start: previous2, - end: now(), - }); - } - queue = ''; - } - } -} -function prohibited(code2) { - return (code2 >= 55296 && code2 <= 57343) || code2 > 1114111; -} -function disallowed(code2) { - return ( - (code2 >= 1 && code2 <= 8) || - code2 === 11 || - (code2 >= 13 && code2 <= 31) || - (code2 >= 127 && code2 <= 159) || - (code2 >= 64976 && code2 <= 65007) || - (code2 & 65535) === 65535 || - (code2 & 65535) === 65534 - ); -} - -// node_modules/mdast-util-mdx-jsx/node_modules/stringify-entities/lib/core.js -function core(value, options) { - value = value.replace( - options.subset ? charactersToExpression(options.subset) : /["&'<>`]/g, - basic, - ); - if (options.subset || options.escapeOnly) { - return value; - } - return value - .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, surrogate) - .replace( - /[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g, - basic, - ); - function surrogate(pair, index2, all4) { - return options.format( - (pair.charCodeAt(0) - 55296) * 1024 + pair.charCodeAt(1) - 56320 + 65536, - all4.charCodeAt(index2 + 2), - options, - ); - } - function basic(character, index2, all4) { - return options.format( - character.charCodeAt(0), - all4.charCodeAt(index2 + 1), - options, - ); - } -} -function charactersToExpression(subset) { - const groups = []; - let index2 = -1; - while (++index2 < subset.length) { - groups.push(subset[index2].replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')); - } - return new RegExp('(?:' + groups.join('|') + ')', 'g'); -} - -// node_modules/mdast-util-mdx-jsx/node_modules/stringify-entities/lib/util/format-basic.js -function formatBasic(code2) { - return '&#x' + code2.toString(16).toUpperCase() + ';'; -} - -// node_modules/mdast-util-mdx-jsx/node_modules/stringify-entities/lib/index.js -function stringifyEntitiesLight(value, options) { - return core(value, Object.assign({format: formatBasic}, options)); -} - -// node_modules/mdast-util-to-markdown/lib/util/track.js -function track(options_) { - const options = options_ || {}; - const now = options.now || {}; - let lineShift = options.lineShift || 0; - let line = now.line || 1; - let column = now.column || 1; - return {move, current: current2, shift}; - function current2() { - return {now: {line, column}, lineShift}; - } - function shift(value) { - lineShift += value; - } - function move(value = '') { - const chunks = value.split(/\r?\n|\r/g); - const tail = chunks[chunks.length - 1]; - line += chunks.length - 1; - column = - chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift; - return value; - } -} - -// node_modules/mdast-util-to-markdown/lib/util/container-flow.js -function containerFlow(parent, context, safeOptions) { - const indexStack = context.indexStack; - const children = parent.children || []; - const tracker = track(safeOptions); - const results = []; - let index2 = -1; - indexStack.push(-1); - while (++index2 < children.length) { - const child = children[index2]; - indexStack[indexStack.length - 1] = index2; - results.push( - tracker.move( - context.handle(child, parent, context, { - before: '\n', - after: '\n', - ...tracker.current(), - }), - ), - ); - if (child.type !== 'list') { - context.bulletLastUsed = void 0; - } - if (index2 < children.length - 1) { - results.push(tracker.move(between(child, children[index2 + 1]))); - } - } - indexStack.pop(); - return results.join(''); - function between(left, right) { - let index3 = context.join.length; - while (index3--) { - const result = context.join[index3](left, right, parent, context); - if (result === true || result === 1) { - break; - } - if (typeof result === 'number') { - return '\n'.repeat(1 + result); - } - if (result === false) { - return '\n\n\n\n'; - } - } - return '\n\n'; - } -} - -// node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js -function containerPhrasing(parent, context, safeOptions) { - const indexStack = context.indexStack; - const children = parent.children || []; - const results = []; - let index2 = -1; - let before = safeOptions.before; - indexStack.push(-1); - let tracker = track(safeOptions); - while (++index2 < children.length) { - const child = children[index2]; - let after; - indexStack[indexStack.length - 1] = index2; - if (index2 + 1 < children.length) { - let handle = context.handle.handlers[children[index2 + 1].type]; - if (handle && handle.peek) handle = handle.peek; - after = handle - ? handle(children[index2 + 1], parent, context, { - before: '', - after: '', - ...tracker.current(), - }).charAt(0) - : ''; - } else { - after = safeOptions.after; - } - if ( - results.length > 0 && - (before === '\r' || before === '\n') && - child.type === 'html' - ) { - results[results.length - 1] = results[results.length - 1].replace( - /(\r?\n|\r)$/, - ' ', - ); - before = ' '; - tracker = track(safeOptions); - tracker.move(results.join('')); - } - results.push( - tracker.move( - context.handle(child, parent, context, { - ...tracker.current(), - before, - after, - }), - ), - ); - before = results[results.length - 1].slice(-1); - } - indexStack.pop(); - return results.join(''); -} - -// node_modules/mdast-util-to-markdown/lib/util/indent-lines.js -var eol = /\r?\n|\r/g; -function indentLines(value, map) { - const result = []; - let start3 = 0; - let line = 0; - let match; - while ((match = eol.exec(value))) { - one3(value.slice(start3, match.index)); - result.push(match[0]); - start3 = match.index + match[0].length; - line++; - } - one3(value.slice(start3)); - return result.join(''); - function one3(value2) { - result.push(map(value2, line, !value2)); - } -} - -// node_modules/mdast-util-mdx-jsx/lib/index.js -function mdxJsxFromMarkdown() { - return { - canContainEols: ['mdxJsxTextElement'], - enter: { - mdxJsxFlowTag: enterMdxJsxTag, - mdxJsxFlowTagClosingMarker: enterMdxJsxTagClosingMarker, - mdxJsxFlowTagAttribute: enterMdxJsxTagAttribute, - mdxJsxFlowTagExpressionAttribute: enterMdxJsxTagExpressionAttribute, - mdxJsxFlowTagAttributeValueLiteral: buffer2, - mdxJsxFlowTagAttributeValueExpression: buffer2, - mdxJsxFlowTagSelfClosingMarker: enterMdxJsxTagSelfClosingMarker, - mdxJsxTextTag: enterMdxJsxTag, - mdxJsxTextTagClosingMarker: enterMdxJsxTagClosingMarker, - mdxJsxTextTagAttribute: enterMdxJsxTagAttribute, - mdxJsxTextTagExpressionAttribute: enterMdxJsxTagExpressionAttribute, - mdxJsxTextTagAttributeValueLiteral: buffer2, - mdxJsxTextTagAttributeValueExpression: buffer2, - mdxJsxTextTagSelfClosingMarker: enterMdxJsxTagSelfClosingMarker, - }, - exit: { - mdxJsxFlowTagClosingMarker: exitMdxJsxTagClosingMarker, - mdxJsxFlowTagNamePrimary: exitMdxJsxTagNamePrimary, - mdxJsxFlowTagNameMember: exitMdxJsxTagNameMember, - mdxJsxFlowTagNameLocal: exitMdxJsxTagNameLocal, - mdxJsxFlowTagExpressionAttribute: exitMdxJsxTagExpressionAttribute, - mdxJsxFlowTagExpressionAttributeValue: data2, - mdxJsxFlowTagAttributeNamePrimary: exitMdxJsxTagAttributeNamePrimary, - mdxJsxFlowTagAttributeNameLocal: exitMdxJsxTagAttributeNameLocal, - mdxJsxFlowTagAttributeValueLiteral: exitMdxJsxTagAttributeValueLiteral, - mdxJsxFlowTagAttributeValueLiteralValue: data2, - mdxJsxFlowTagAttributeValueExpression: - exitMdxJsxTagAttributeValueExpression, - mdxJsxFlowTagAttributeValueExpressionValue: data2, - mdxJsxFlowTagSelfClosingMarker: exitMdxJsxTagSelfClosingMarker, - mdxJsxFlowTag: exitMdxJsxTag, - mdxJsxTextTagClosingMarker: exitMdxJsxTagClosingMarker, - mdxJsxTextTagNamePrimary: exitMdxJsxTagNamePrimary, - mdxJsxTextTagNameMember: exitMdxJsxTagNameMember, - mdxJsxTextTagNameLocal: exitMdxJsxTagNameLocal, - mdxJsxTextTagExpressionAttribute: exitMdxJsxTagExpressionAttribute, - mdxJsxTextTagExpressionAttributeValue: data2, - mdxJsxTextTagAttributeNamePrimary: exitMdxJsxTagAttributeNamePrimary, - mdxJsxTextTagAttributeNameLocal: exitMdxJsxTagAttributeNameLocal, - mdxJsxTextTagAttributeValueLiteral: exitMdxJsxTagAttributeValueLiteral, - mdxJsxTextTagAttributeValueLiteralValue: data2, - mdxJsxTextTagAttributeValueExpression: - exitMdxJsxTagAttributeValueExpression, - mdxJsxTextTagAttributeValueExpressionValue: data2, - mdxJsxTextTagSelfClosingMarker: exitMdxJsxTagSelfClosingMarker, - mdxJsxTextTag: exitMdxJsxTag, - }, - }; - function buffer2() { - this.buffer(); - } - function data2(token) { - this.config.enter.data.call(this, token); - this.config.exit.data.call(this, token); - } - function enterMdxJsxTag(token) { - const tag = { - name: null, - attributes: [], - start: token.start, - end: token.end, - }; - if (!this.getData('mdxJsxTagStack')) this.setData('mdxJsxTagStack', []); - this.setData('mdxJsxTag', tag); - this.buffer(); - } - function enterMdxJsxTagClosingMarker(token) { - const stack = this.getData('mdxJsxTagStack'); - if (stack.length === 0) { - throw new VFileMessage( - 'Unexpected closing slash `/` in tag, expected an open tag first', - {start: token.start, end: token.end}, - 'mdast-util-mdx-jsx:unexpected-closing-slash', - ); - } - } - function enterMdxJsxTagAnyAttribute(token) { - const tag = this.getData('mdxJsxTag'); - if (tag.close) { - throw new VFileMessage( - 'Unexpected attribute in closing tag, expected the end of the tag', - {start: token.start, end: token.end}, - 'mdast-util-mdx-jsx:unexpected-attribute', - ); - } - } - function enterMdxJsxTagSelfClosingMarker(token) { - const tag = this.getData('mdxJsxTag'); - if (tag.close) { - throw new VFileMessage( - 'Unexpected self-closing slash `/` in closing tag, expected the end of the tag', - {start: token.start, end: token.end}, - 'mdast-util-mdx-jsx:unexpected-self-closing-slash', - ); - } - } - function exitMdxJsxTagClosingMarker() { - const tag = this.getData('mdxJsxTag'); - tag.close = true; - } - function exitMdxJsxTagNamePrimary(token) { - const tag = this.getData('mdxJsxTag'); - tag.name = this.sliceSerialize(token); - } - function exitMdxJsxTagNameMember(token) { - const tag = this.getData('mdxJsxTag'); - tag.name += '.' + this.sliceSerialize(token); - } - function exitMdxJsxTagNameLocal(token) { - const tag = this.getData('mdxJsxTag'); - tag.name += ':' + this.sliceSerialize(token); - } - function enterMdxJsxTagAttribute(token) { - const tag = this.getData('mdxJsxTag'); - enterMdxJsxTagAnyAttribute.call(this, token); - tag.attributes.push({type: 'mdxJsxAttribute', name: '', value: null}); - } - function enterMdxJsxTagExpressionAttribute(token) { - const tag = this.getData('mdxJsxTag'); - enterMdxJsxTagAnyAttribute.call(this, token); - tag.attributes.push({type: 'mdxJsxExpressionAttribute', value: ''}); - this.buffer(); - } - function exitMdxJsxTagExpressionAttribute(token) { - const tag = this.getData('mdxJsxTag'); - const tail = tag.attributes[tag.attributes.length - 1]; - const estree = token.estree; - tail.value = this.resume(); - if (estree) { - tail.data = {estree}; - } - } - function exitMdxJsxTagAttributeNamePrimary(token) { - const tag = this.getData('mdxJsxTag'); - const node = tag.attributes[tag.attributes.length - 1]; - node.name = this.sliceSerialize(token); - } - function exitMdxJsxTagAttributeNameLocal(token) { - const tag = this.getData('mdxJsxTag'); - const node = tag.attributes[tag.attributes.length - 1]; - node.name += ':' + this.sliceSerialize(token); - } - function exitMdxJsxTagAttributeValueLiteral() { - const tag = this.getData('mdxJsxTag'); - tag.attributes[tag.attributes.length - 1].value = parseEntities( - this.resume(), - {nonTerminated: false}, - ); - } - function exitMdxJsxTagAttributeValueExpression(token) { - const tag = this.getData('mdxJsxTag'); - const tail = tag.attributes[tag.attributes.length - 1]; - const node = {type: 'mdxJsxAttributeValueExpression', value: this.resume()}; - const estree = token.estree; - if (estree) { - node.data = {estree}; - } - tail.value = node; - } - function exitMdxJsxTagSelfClosingMarker() { - const tag = this.getData('mdxJsxTag'); - tag.selfClosing = true; - } - function exitMdxJsxTag(token) { - const tag = this.getData('mdxJsxTag'); - const stack = this.getData('mdxJsxTagStack'); - const tail = stack[stack.length - 1]; - if (tag.close && tail.name !== tag.name) { - throw new VFileMessage( - 'Unexpected closing tag `' + - serializeAbbreviatedTag(tag) + - '`, expected corresponding closing tag for `' + - serializeAbbreviatedTag(tail) + - '` (' + - stringifyPosition(tail) + - ')', - {start: token.start, end: token.end}, - 'mdast-util-mdx-jsx:end-tag-mismatch', - ); - } - this.resume(); - if (tag.close) { - stack.pop(); - } else { - this.enter( - { - type: - token.type === 'mdxJsxTextTag' - ? 'mdxJsxTextElement' - : 'mdxJsxFlowElement', - name: tag.name, - attributes: tag.attributes, - children: [], - }, - token, - onErrorRightIsTag, - ); - } - if (tag.selfClosing || tag.close) { - this.exit(token, onErrorLeftIsTag); - } else { - stack.push(tag); - } - } - function onErrorRightIsTag(closing, open) { - const tag = this.getData('mdxJsxTag'); - const place = closing ? ' before the end of `' + closing.type + '`' : ''; - const position3 = closing - ? {start: closing.start, end: closing.end} - : void 0; - throw new VFileMessage( - 'Expected a closing tag for `' + - serializeAbbreviatedTag(tag) + - '` (' + - stringifyPosition({start: open.start, end: open.end}) + - ')' + - place, - position3, - 'mdast-util-mdx-jsx:end-tag-mismatch', - ); - } - function onErrorLeftIsTag(a, b) { - const tag = this.getData('mdxJsxTag'); - throw new VFileMessage( - 'Expected the closing tag `' + - serializeAbbreviatedTag(tag) + - '` either after the end of `' + - b.type + - '` (' + - stringifyPosition(b.end) + - ') or another opening tag after the start of `' + - b.type + - '` (' + - stringifyPosition(b.start) + - ')', - {start: a.start, end: a.end}, - 'mdast-util-mdx-jsx:end-tag-mismatch', - ); - } - function serializeAbbreviatedTag(tag) { - return '<' + (tag.close ? '/' : '') + (tag.name || '') + '>'; - } -} -function mdxJsxToMarkdown(options = {}) { - const { - quote = '"', - quoteSmart, - tightSelfClosing, - printWidth = Number.POSITIVE_INFINITY, - } = options; - const alternative = quote === '"' ? "'" : '"'; - if (quote !== '"' && quote !== "'") { - throw new Error( - 'Cannot serialize attribute values with `' + - quote + - '` for `options.quote`, expected `"`, or `\'`', - ); - } - mdxElement.peek = peekElement; - return { - handlers: { - mdxJsxFlowElement: mdxElement, - mdxJsxTextElement: mdxElement, - }, - unsafe: [ - {character: '<', inConstruct: ['phrasing']}, - {atBreak: true, character: '<'}, - ], - fences: true, - resourceLink: true, - }; - function mdxElement(node, _, context, safeOptions) { - const tracker = track(safeOptions); - const selfClosing = - node.name && (!node.children || node.children.length === 0); - const exit2 = context.enter(node.type); - let index2 = -1; - const serializedAttributes = []; - let value = tracker.move('<' + (node.name || '')); - if (node.attributes && node.attributes.length > 0) { - if (!node.name) { - throw new Error('Cannot serialize fragment w/ attributes'); - } - while (++index2 < node.attributes.length) { - const attribute = node.attributes[index2]; - let result; - if (attribute.type === 'mdxJsxExpressionAttribute') { - result = '{' + (attribute.value || '') + '}'; - } else { - if (!attribute.name) { - throw new Error('Cannot serialize attribute w/o name'); - } - const value2 = attribute.value; - const left = attribute.name; - let right = ''; - if (value2 === void 0 || value2 === null) { - } else if (typeof value2 === 'object') { - right = '{' + (value2.value || '') + '}'; - } else { - const appliedQuote = - quoteSmart && ccount(value2, quote) > ccount(value2, alternative) - ? alternative - : quote; - right = - appliedQuote + - stringifyEntitiesLight(value2, {subset: [appliedQuote]}) + - appliedQuote; - } - result = left + (right ? '=' : '') + right; - } - serializedAttributes.push(result); - } - } - let attributesOnTheirOwnLine = false; - const attributesOnOneLine = serializedAttributes.join(' '); - if ( - node.type === 'mdxJsxFlowElement' && - (/\r?\n|\r/.test(attributesOnOneLine) || - tracker.current().now.column + - attributesOnOneLine.length + - (selfClosing ? (tightSelfClosing ? 2 : 3) : 1) > - printWidth) - ) { - attributesOnTheirOwnLine = true; - } - if (attributesOnTheirOwnLine) { - value += tracker.move( - '\n' + indentLines(serializedAttributes.join('\n'), map), - ); - } else if (attributesOnOneLine) { - value += tracker.move(' ' + attributesOnOneLine); - } - if (attributesOnTheirOwnLine) { - value += tracker.move('\n'); - } - if (selfClosing) { - value += tracker.move( - (tightSelfClosing || attributesOnTheirOwnLine ? '' : ' ') + '/', - ); - } - value += tracker.move('>'); - if (node.children && node.children.length > 0) { - if (node.type === 'mdxJsxFlowElement') { - tracker.shift(2); - value += tracker.move('\n'); - value += tracker.move( - indentLines(containerFlow(node, context, tracker.current()), map), - ); - value += tracker.move('\n'); - } else { - value += tracker.move( - containerPhrasing(node, context, { - ...tracker.current(), - before: '<', - after: '>', - }), - ); - } - } - if (!selfClosing) { - value += tracker.move(''); - } - exit2(); - return value; - } - function map(line, _, blank) { - return (blank ? '' : ' ') + line; - } - function peekElement() { - return '<'; - } -} - -// node_modules/mdast-util-mdxjs-esm/index.js -var mdxjsEsmFromMarkdown = { - enter: {mdxjsEsm: enterMdxjsEsm}, - exit: {mdxjsEsm: exitMdxjsEsm, mdxjsEsmData: exitMdxjsEsmData}, -}; -var mdxjsEsmToMarkdown = {handlers: {mdxjsEsm: handleMdxjsEsm}}; -function enterMdxjsEsm(token) { - this.enter({type: 'mdxjsEsm', value: ''}, token); - this.buffer(); -} -function exitMdxjsEsm(token) { - const value = this.resume(); - const node = this.exit(token); - const estree = token.estree; - node.value = value; - if (estree) { - node.data = {estree}; - } -} -function exitMdxjsEsmData(token) { - this.config.enter.data.call(this, token); - this.config.exit.data.call(this, token); -} -function handleMdxjsEsm(node) { - return node.value || ''; -} - -// node_modules/mdast-util-mdx/index.js -function mdxFromMarkdown() { - return [ - mdxExpressionFromMarkdown, - mdxJsxFromMarkdown(), - mdxjsEsmFromMarkdown, - ]; -} -function mdxToMarkdown(options) { - return { - extensions: [ - mdxExpressionToMarkdown, - mdxJsxToMarkdown(options), - mdxjsEsmToMarkdown, - ], - }; -} - -// node_modules/remark-mdx/index.js -function remarkMdx(options = {}) { - const data2 = this.data(); - add('micromarkExtensions', mdxjs(options)); - add('fromMarkdownExtensions', mdxFromMarkdown()); - add('toMarkdownExtensions', mdxToMarkdown(options)); - function add(field, value) { - const list3 = data2[field] ? data2[field] : (data2[field] = []); - list3.push(value); - } -} - -// node_modules/mdast-util-to-string/index.js -function toString2(node, options) { - var {includeImageAlt = true} = options || {}; - return one(node, includeImageAlt); -} -function one(node, includeImageAlt) { - return ( - (node && - typeof node === 'object' && - (node.value || - (includeImageAlt ? node.alt : '') || - ('children' in node && all(node.children, includeImageAlt)) || - (Array.isArray(node) && all(node, includeImageAlt)))) || - '' - ); -} -function all(values, includeImageAlt) { - var result = []; - var index2 = -1; - while (++index2 < values.length) { - result[index2] = one(values[index2], includeImageAlt); - } - return result.join(''); -} - -// node_modules/micromark/lib/initialize/content.js -var content2 = { - tokenize: initializeContent, -}; -function initializeContent(effects) { - const contentStart = effects.attempt( - this.parser.constructs.contentInitial, - afterContentStartConstruct, - paragraphInitial, - ); - let previous2; - return contentStart; - function afterContentStartConstruct(code2) { - if (code2 === null) { - effects.consume(code2); - return; - } - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - return factorySpace(effects, contentStart, 'linePrefix'); - } - function paragraphInitial(code2) { - effects.enter('paragraph'); - return lineStart(code2); - } - function lineStart(code2) { - const token = effects.enter('chunkText', { - contentType: 'text', - previous: previous2, - }); - if (previous2) { - previous2.next = token; - } - previous2 = token; - return data2(code2); - } - function data2(code2) { - if (code2 === null) { - effects.exit('chunkText'); - effects.exit('paragraph'); - effects.consume(code2); - return; - } - if (markdownLineEnding(code2)) { - effects.consume(code2); - effects.exit('chunkText'); - return lineStart; - } - effects.consume(code2); - return data2; - } -} - -// node_modules/micromark/lib/initialize/document.js -var document = { - tokenize: initializeDocument, -}; -var containerConstruct = { - tokenize: tokenizeContainer, -}; -function initializeDocument(effects) { - const self2 = this; - const stack = []; - let continued = 0; - let childFlow; - let childToken; - let lineStartOffset; - return start3; - function start3(code2) { - if (continued < stack.length) { - const item = stack[continued]; - self2.containerState = item[1]; - return effects.attempt( - item[0].continuation, - documentContinue, - checkNewContainers, - )(code2); - } - return checkNewContainers(code2); - } - function documentContinue(code2) { - continued++; - if (self2.containerState._closeFlow) { - self2.containerState._closeFlow = void 0; - if (childFlow) { - closeFlow(); - } - const indexBeforeExits = self2.events.length; - let indexBeforeFlow = indexBeforeExits; - let point3; - while (indexBeforeFlow--) { - if ( - self2.events[indexBeforeFlow][0] === 'exit' && - self2.events[indexBeforeFlow][1].type === 'chunkFlow' - ) { - point3 = self2.events[indexBeforeFlow][1].end; - break; - } - } - exitContainers(continued); - let index2 = indexBeforeExits; - while (index2 < self2.events.length) { - self2.events[index2][1].end = Object.assign({}, point3); - index2++; - } - splice( - self2.events, - indexBeforeFlow + 1, - 0, - self2.events.slice(indexBeforeExits), - ); - self2.events.length = index2; - return checkNewContainers(code2); - } - return start3(code2); - } - function checkNewContainers(code2) { - if (continued === stack.length) { - if (!childFlow) { - return documentContinued(code2); - } - if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { - return flowStart(code2); - } - self2.interrupt = Boolean( - childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack, - ); - } - self2.containerState = {}; - return effects.check( - containerConstruct, - thereIsANewContainer, - thereIsNoNewContainer, - )(code2); - } - function thereIsANewContainer(code2) { - if (childFlow) closeFlow(); - exitContainers(continued); - return documentContinued(code2); - } - function thereIsNoNewContainer(code2) { - self2.parser.lazy[self2.now().line] = continued !== stack.length; - lineStartOffset = self2.now().offset; - return flowStart(code2); - } - function documentContinued(code2) { - self2.containerState = {}; - return effects.attempt( - containerConstruct, - containerContinue, - flowStart, - )(code2); - } - function containerContinue(code2) { - continued++; - stack.push([self2.currentConstruct, self2.containerState]); - return documentContinued(code2); - } - function flowStart(code2) { - if (code2 === null) { - if (childFlow) closeFlow(); - exitContainers(0); - effects.consume(code2); - return; - } - childFlow = childFlow || self2.parser.flow(self2.now()); - effects.enter('chunkFlow', { - contentType: 'flow', - previous: childToken, - _tokenizer: childFlow, - }); - return flowContinue(code2); - } - function flowContinue(code2) { - if (code2 === null) { - writeToChild(effects.exit('chunkFlow'), true); - exitContainers(0); - effects.consume(code2); - return; - } - if (markdownLineEnding(code2)) { - effects.consume(code2); - writeToChild(effects.exit('chunkFlow')); - continued = 0; - self2.interrupt = void 0; - return start3; - } - effects.consume(code2); - return flowContinue; - } - function writeToChild(token, eof) { - const stream = self2.sliceStream(token); - if (eof) stream.push(null); - token.previous = childToken; - if (childToken) childToken.next = token; - childToken = token; - childFlow.defineSkip(token.start); - childFlow.write(stream); - if (self2.parser.lazy[token.start.line]) { - let index2 = childFlow.events.length; - while (index2--) { - if ( - childFlow.events[index2][1].start.offset < lineStartOffset && - (!childFlow.events[index2][1].end || - childFlow.events[index2][1].end.offset > lineStartOffset) - ) { - return; - } - } - const indexBeforeExits = self2.events.length; - let indexBeforeFlow = indexBeforeExits; - let seen; - let point3; - while (indexBeforeFlow--) { - if ( - self2.events[indexBeforeFlow][0] === 'exit' && - self2.events[indexBeforeFlow][1].type === 'chunkFlow' - ) { - if (seen) { - point3 = self2.events[indexBeforeFlow][1].end; - break; - } - seen = true; - } - } - exitContainers(continued); - index2 = indexBeforeExits; - while (index2 < self2.events.length) { - self2.events[index2][1].end = Object.assign({}, point3); - index2++; - } - splice( - self2.events, - indexBeforeFlow + 1, - 0, - self2.events.slice(indexBeforeExits), - ); - self2.events.length = index2; - } - } - function exitContainers(size) { - let index2 = stack.length; - while (index2-- > size) { - const entry = stack[index2]; - self2.containerState = entry[1]; - entry[0].exit.call(self2, effects); - } - stack.length = size; - } - function closeFlow() { - childFlow.write([null]); - childToken = void 0; - childFlow = void 0; - self2.containerState._closeFlow = void 0; - } -} -function tokenizeContainer(effects, ok2, nok) { - return factorySpace( - effects, - effects.attempt(this.parser.constructs.document, ok2, nok), - 'linePrefix', - this.parser.constructs.disable.null.includes('codeIndented') ? void 0 : 4, - ); -} - -// node_modules/micromark/lib/initialize/flow.js -var flow = { - tokenize: initializeFlow, -}; -function initializeFlow(effects) { - const self2 = this; - const initial = effects.attempt( - blankLine, - atBlankEnding, - effects.attempt( - this.parser.constructs.flowInitial, - afterConstruct, - factorySpace( - effects, - effects.attempt( - this.parser.constructs.flow, - afterConstruct, - effects.attempt(content, afterConstruct), - ), - 'linePrefix', - ), - ), - ); - return initial; - function atBlankEnding(code2) { - if (code2 === null) { - effects.consume(code2); - return; - } - effects.enter('lineEndingBlank'); - effects.consume(code2); - effects.exit('lineEndingBlank'); - self2.currentConstruct = void 0; - return initial; - } - function afterConstruct(code2) { - if (code2 === null) { - effects.consume(code2); - return; - } - effects.enter('lineEnding'); - effects.consume(code2); - effects.exit('lineEnding'); - self2.currentConstruct = void 0; - return initial; - } -} - -// node_modules/micromark/lib/initialize/text.js -var resolver = { - resolveAll: createResolver(), -}; -var string = initializeFactory('string'); -var text = initializeFactory('text'); -function initializeFactory(field) { - return { - tokenize: initializeText, - resolveAll: createResolver( - field === 'text' ? resolveAllLineSuffixes : void 0, - ), - }; - function initializeText(effects) { - const self2 = this; - const constructs2 = this.parser.constructs[field]; - const text5 = effects.attempt(constructs2, start3, notText); - return start3; - function start3(code2) { - return atBreak(code2) ? text5(code2) : notText(code2); - } - function notText(code2) { - if (code2 === null) { - effects.consume(code2); - return; - } - effects.enter('data'); - effects.consume(code2); - return data2; - } - function data2(code2) { - if (atBreak(code2)) { - effects.exit('data'); - return text5(code2); - } - effects.consume(code2); - return data2; - } - function atBreak(code2) { - if (code2 === null) { - return true; - } - const list3 = constructs2[code2]; - let index2 = -1; - if (list3) { - while (++index2 < list3.length) { - const item = list3[index2]; - if (!item.previous || item.previous.call(self2, self2.previous)) { - return true; - } - } - } - return false; - } - } -} -function createResolver(extraResolver) { - return resolveAllText; - function resolveAllText(events, context) { - let index2 = -1; - let enter; - while (++index2 <= events.length) { - if (enter === void 0) { - if (events[index2] && events[index2][1].type === 'data') { - enter = index2; - index2++; - } - } else if (!events[index2] || events[index2][1].type !== 'data') { - if (index2 !== enter + 2) { - events[enter][1].end = events[index2 - 1][1].end; - events.splice(enter + 2, index2 - enter - 2); - index2 = enter + 2; - } - enter = void 0; - } - } - return extraResolver ? extraResolver(events, context) : events; - } -} -function resolveAllLineSuffixes(events, context) { - let eventIndex = 0; - while (++eventIndex <= events.length) { - if ( - (eventIndex === events.length || - events[eventIndex][1].type === 'lineEnding') && - events[eventIndex - 1][1].type === 'data' - ) { - const data2 = events[eventIndex - 1][1]; - const chunks = context.sliceStream(data2); - let index2 = chunks.length; - let bufferIndex = -1; - let size = 0; - let tabs; - while (index2--) { - const chunk = chunks[index2]; - if (typeof chunk === 'string') { - bufferIndex = chunk.length; - while (chunk.charCodeAt(bufferIndex - 1) === 32) { - size++; - bufferIndex--; - } - if (bufferIndex) break; - bufferIndex = -1; - } else if (chunk === -2) { - tabs = true; - size++; - } else if (chunk === -1) { - } else { - index2++; - break; - } - } - if (size) { - const token = { - type: - eventIndex === events.length || tabs || size < 2 - ? 'lineSuffix' - : 'hardBreakTrailing', - start: { - line: data2.end.line, - column: data2.end.column - size, - offset: data2.end.offset - size, - _index: data2.start._index + index2, - _bufferIndex: index2 - ? bufferIndex - : data2.start._bufferIndex + bufferIndex, - }, - end: Object.assign({}, data2.end), - }; - data2.end = Object.assign({}, token.start); - if (data2.start.offset === data2.end.offset) { - Object.assign(data2, token); - } else { - events.splice( - eventIndex, - 0, - ['enter', token, context], - ['exit', token, context], - ); - eventIndex += 2; - } - } - eventIndex++; - } - } - return events; -} - -// node_modules/micromark/lib/create-tokenizer.js -function createTokenizer(parser, initialize, from) { - let point3 = Object.assign( - from - ? Object.assign({}, from) - : { - line: 1, - column: 1, - offset: 0, - }, - { - _index: 0, - _bufferIndex: -1, - }, - ); - const columnStart = {}; - const resolveAllConstructs = []; - let chunks = []; - let stack = []; - let consumed = true; - const effects = { - consume, - enter, - exit: exit2, - attempt: constructFactory(onsuccessfulconstruct), - check: constructFactory(onsuccessfulcheck), - interrupt: constructFactory(onsuccessfulcheck, { - interrupt: true, - }), - }; - const context = { - previous: null, - code: null, - containerState: {}, - events: [], - parser, - sliceStream, - sliceSerialize, - now, - defineSkip, - write, - }; - let state = initialize.tokenize.call(context, effects); - let expectedCode; - if (initialize.resolveAll) { - resolveAllConstructs.push(initialize); - } - return context; - function write(slice2) { - chunks = push(chunks, slice2); - main(); - if (chunks[chunks.length - 1] !== null) { - return []; - } - addResult(initialize, 0); - context.events = resolveAll(resolveAllConstructs, context.events, context); - return context.events; - } - function sliceSerialize(token, expandTabs) { - return serializeChunks(sliceStream(token), expandTabs); - } - function sliceStream(token) { - return sliceChunks(chunks, token); - } - function now() { - return Object.assign({}, point3); - } - function defineSkip(value) { - columnStart[value.line] = value.column; - accountForPotentialSkip(); - } - function main() { - let chunkIndex; - while (point3._index < chunks.length) { - const chunk = chunks[point3._index]; - if (typeof chunk === 'string') { - chunkIndex = point3._index; - if (point3._bufferIndex < 0) { - point3._bufferIndex = 0; - } - while ( - point3._index === chunkIndex && - point3._bufferIndex < chunk.length - ) { - go(chunk.charCodeAt(point3._bufferIndex)); - } - } else { - go(chunk); - } - } - } - function go(code2) { - consumed = void 0; - expectedCode = code2; - state = state(code2); - } - function consume(code2) { - if (markdownLineEnding(code2)) { - point3.line++; - point3.column = 1; - point3.offset += code2 === -3 ? 2 : 1; - accountForPotentialSkip(); - } else if (code2 !== -1) { - point3.column++; - point3.offset++; - } - if (point3._bufferIndex < 0) { - point3._index++; - } else { - point3._bufferIndex++; - if (point3._bufferIndex === chunks[point3._index].length) { - point3._bufferIndex = -1; - point3._index++; - } - } - context.previous = code2; - consumed = true; - } - function enter(type, fields) { - const token = fields || {}; - token.type = type; - token.start = now(); - context.events.push(['enter', token, context]); - stack.push(token); - return token; - } - function exit2(type) { - const token = stack.pop(); - token.end = now(); - context.events.push(['exit', token, context]); - return token; - } - function onsuccessfulconstruct(construct, info) { - addResult(construct, info.from); - } - function onsuccessfulcheck(_, info) { - info.restore(); - } - function constructFactory(onreturn, fields) { - return hook; - function hook(constructs2, returnState, bogusState) { - let listOfConstructs; - let constructIndex; - let currentConstruct; - let info; - return Array.isArray(constructs2) - ? handleListOfConstructs(constructs2) - : 'tokenize' in constructs2 - ? handleListOfConstructs([constructs2]) - : handleMapOfConstructs(constructs2); - function handleMapOfConstructs(map) { - return start3; - function start3(code2) { - const def = code2 !== null && map[code2]; - const all4 = code2 !== null && map.null; - const list3 = [ - ...(Array.isArray(def) ? def : def ? [def] : []), - ...(Array.isArray(all4) ? all4 : all4 ? [all4] : []), - ]; - return handleListOfConstructs(list3)(code2); - } - } - function handleListOfConstructs(list3) { - listOfConstructs = list3; - constructIndex = 0; - if (list3.length === 0) { - return bogusState; - } - return handleConstruct(list3[constructIndex]); - } - function handleConstruct(construct) { - return start3; - function start3(code2) { - info = store(); - currentConstruct = construct; - if (!construct.partial) { - context.currentConstruct = construct; - } - if ( - construct.name && - context.parser.constructs.disable.null.includes(construct.name) - ) { - return nok(code2); - } - return construct.tokenize.call( - fields ? Object.assign(Object.create(context), fields) : context, - effects, - ok2, - nok, - )(code2); - } - } - function ok2(code2) { - consumed = true; - onreturn(currentConstruct, info); - return returnState; - } - function nok(code2) { - consumed = true; - info.restore(); - if (++constructIndex < listOfConstructs.length) { - return handleConstruct(listOfConstructs[constructIndex]); - } - return bogusState; - } - } - } - function addResult(construct, from2) { - if (construct.resolveAll && !resolveAllConstructs.includes(construct)) { - resolveAllConstructs.push(construct); - } - if (construct.resolve) { - splice( - context.events, - from2, - context.events.length - from2, - construct.resolve(context.events.slice(from2), context), - ); - } - if (construct.resolveTo) { - context.events = construct.resolveTo(context.events, context); - } - } - function store() { - const startPoint = now(); - const startPrevious = context.previous; - const startCurrentConstruct = context.currentConstruct; - const startEventsIndex = context.events.length; - const startStack = Array.from(stack); - return { - restore, - from: startEventsIndex, - }; - function restore() { - point3 = startPoint; - context.previous = startPrevious; - context.currentConstruct = startCurrentConstruct; - context.events.length = startEventsIndex; - stack = startStack; - accountForPotentialSkip(); - } - } - function accountForPotentialSkip() { - if (point3.line in columnStart && point3.column < 2) { - point3.column = columnStart[point3.line]; - point3.offset += columnStart[point3.line] - 1; - } - } -} -function sliceChunks(chunks, token) { - const startIndex = token.start._index; - const startBufferIndex = token.start._bufferIndex; - const endIndex = token.end._index; - const endBufferIndex = token.end._bufferIndex; - let view; - if (startIndex === endIndex) { - view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]; - } else { - view = chunks.slice(startIndex, endIndex); - if (startBufferIndex > -1) { - view[0] = view[0].slice(startBufferIndex); - } - if (endBufferIndex > 0) { - view.push(chunks[endIndex].slice(0, endBufferIndex)); - } - } - return view; -} -function serializeChunks(chunks, expandTabs) { - let index2 = -1; - const result = []; - let atTab; - while (++index2 < chunks.length) { - const chunk = chunks[index2]; - let value; - if (typeof chunk === 'string') { - value = chunk; - } else - switch (chunk) { - case -5: { - value = '\r'; - break; - } - case -4: { - value = '\n'; - break; - } - case -3: { - value = '\r\n'; - break; - } - case -2: { - value = expandTabs ? ' ' : ' '; - break; - } - case -1: { - if (!expandTabs && atTab) continue; - value = ' '; - break; - } - default: { - value = String.fromCharCode(chunk); - } - } - atTab = chunk === -2; - result.push(value); - } - return result.join(''); -} - -// node_modules/micromark/lib/constructs.js -var constructs_exports = {}; -__export(constructs_exports, { - attentionMarkers: () => attentionMarkers, - contentInitial: () => contentInitial, - disable: () => disable, - document: () => document2, - flow: () => flow2, - flowInitial: () => flowInitial, - insideSpan: () => insideSpan, - string: () => string2, - text: () => text2, -}); -var document2 = { - [42]: list, - [43]: list, - [45]: list, - [48]: list, - [49]: list, - [50]: list, - [51]: list, - [52]: list, - [53]: list, - [54]: list, - [55]: list, - [56]: list, - [57]: list, - [62]: blockQuote, -}; -var contentInitial = { - [91]: definition, -}; -var flowInitial = { - [-2]: codeIndented, - [-1]: codeIndented, - [32]: codeIndented, -}; -var flow2 = { - [35]: headingAtx, - [42]: thematicBreak, - [45]: [setextUnderline, thematicBreak], - [60]: htmlFlow, - [61]: setextUnderline, - [95]: thematicBreak, - [96]: codeFenced, - [126]: codeFenced, -}; -var string2 = { - [38]: characterReference, - [92]: characterEscape, -}; -var text2 = { - [-5]: lineEnding, - [-4]: lineEnding, - [-3]: lineEnding, - [33]: labelStartImage, - [38]: characterReference, - [42]: attention, - [60]: [autolink, htmlText], - [91]: labelStartLink, - [92]: [hardBreakEscape, characterEscape], - [93]: labelEnd, - [95]: attention, - [96]: codeText, -}; -var insideSpan = { - null: [attention, resolver], -}; -var attentionMarkers = { - null: [42, 95], -}; -var disable = { - null: [], -}; - -// node_modules/micromark/lib/parse.js -function parse3(options = {}) { - const constructs2 = combineExtensions( - [constructs_exports].concat(options.extensions || []), - ); - const parser = { - defined: [], - lazy: {}, - constructs: constructs2, - content: create5(content2), - document: create5(document), - flow: create5(flow), - string: create5(string), - text: create5(text), - }; - return parser; - function create5(initial) { - return creator; - function creator(from) { - return createTokenizer(parser, initial, from); - } - } -} - -// node_modules/micromark/lib/preprocess.js -var search = /[\0\t\n\r]/g; -function preprocess() { - let column = 1; - let buffer2 = ''; - let start3 = true; - let atCarriageReturn; - return preprocessor; - function preprocessor(value, encoding, end) { - const chunks = []; - let match; - let next; - let startPosition; - let endPosition; - let code2; - value = buffer2 + value.toString(encoding); - startPosition = 0; - buffer2 = ''; - if (start3) { - if (value.charCodeAt(0) === 65279) { - startPosition++; - } - start3 = void 0; - } - while (startPosition < value.length) { - search.lastIndex = startPosition; - match = search.exec(value); - endPosition = - match && match.index !== void 0 ? match.index : value.length; - code2 = value.charCodeAt(endPosition); - if (!match) { - buffer2 = value.slice(startPosition); - break; - } - if (code2 === 10 && startPosition === endPosition && atCarriageReturn) { - chunks.push(-3); - atCarriageReturn = void 0; - } else { - if (atCarriageReturn) { - chunks.push(-5); - atCarriageReturn = void 0; - } - if (startPosition < endPosition) { - chunks.push(value.slice(startPosition, endPosition)); - column += endPosition - startPosition; - } - switch (code2) { - case 0: { - chunks.push(65533); - column++; - break; - } - case 9: { - next = Math.ceil(column / 4) * 4; - chunks.push(-2); - while (column++ < next) chunks.push(-1); - break; - } - case 10: { - chunks.push(-4); - column = 1; - break; - } - default: { - atCarriageReturn = true; - column = 1; - } - } - } - startPosition = endPosition + 1; - } - if (end) { - if (atCarriageReturn) chunks.push(-5); - if (buffer2) chunks.push(buffer2); - chunks.push(null); - } - return chunks; - } -} - -// node_modules/micromark/lib/postprocess.js -function postprocess(events) { - while (!subtokenize(events)) {} - return events; -} - -// node_modules/micromark-util-decode-numeric-character-reference/index.js -function decodeNumericCharacterReference(value, base2) { - const code2 = Number.parseInt(value, base2); - if ( - code2 < 9 || - code2 === 11 || - (code2 > 13 && code2 < 32) || - (code2 > 126 && code2 < 160) || - (code2 > 55295 && code2 < 57344) || - (code2 > 64975 && code2 < 65008) || - (code2 & 65535) === 65535 || - (code2 & 65535) === 65534 || - code2 > 1114111 - ) { - return '\uFFFD'; - } - return String.fromCharCode(code2); -} - -// node_modules/micromark-util-decode-string/index.js -var characterEscapeOrReference = - /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi; -function decodeString(value) { - return value.replace(characterEscapeOrReference, decode); -} -function decode($0, $1, $2) { - if ($1) { - return $1; - } - const head = $2.charCodeAt(0); - if (head === 35) { - const head2 = $2.charCodeAt(1); - const hex = head2 === 120 || head2 === 88; - return decodeNumericCharacterReference( - $2.slice(hex ? 2 : 1), - hex ? 16 : 10, - ); - } - return decodeNamedCharacterReference($2) || $0; -} - -// node_modules/mdast-util-from-markdown/lib/index.js -var own4 = {}.hasOwnProperty; -var fromMarkdown = function (value, encoding, options) { - if (typeof encoding !== 'string') { - options = encoding; - encoding = void 0; - } - return compiler(options)( - postprocess( - parse3(options).document().write(preprocess()(value, encoding, true)), - ), - ); -}; -function compiler(options = {}) { - const config = configure( - { - transforms: [], - canContainEols: [ - 'emphasis', - 'fragment', - 'heading', - 'paragraph', - 'strong', - ], - enter: { - autolink: opener(link2), - autolinkProtocol: onenterdata, - autolinkEmail: onenterdata, - atxHeading: opener(heading2), - blockQuote: opener(blockQuote2), - characterEscape: onenterdata, - characterReference: onenterdata, - codeFenced: opener(codeFlow), - codeFencedFenceInfo: buffer2, - codeFencedFenceMeta: buffer2, - codeIndented: opener(codeFlow, buffer2), - codeText: opener(codeText2, buffer2), - codeTextData: onenterdata, - data: onenterdata, - codeFlowValue: onenterdata, - definition: opener(definition2), - definitionDestinationString: buffer2, - definitionLabelString: buffer2, - definitionTitleString: buffer2, - emphasis: opener(emphasis2), - hardBreakEscape: opener(hardBreak2), - hardBreakTrailing: opener(hardBreak2), - htmlFlow: opener(html4, buffer2), - htmlFlowData: onenterdata, - htmlText: opener(html4, buffer2), - htmlTextData: onenterdata, - image: opener(image2), - label: buffer2, - link: opener(link2), - listItem: opener(listItem2), - listItemValue: onenterlistitemvalue, - listOrdered: opener(list3, onenterlistordered), - listUnordered: opener(list3), - paragraph: opener(paragraph2), - reference: onenterreference, - referenceString: buffer2, - resourceDestinationString: buffer2, - resourceTitleString: buffer2, - setextHeading: opener(heading2), - strong: opener(strong2), - thematicBreak: opener(thematicBreak3), - }, - exit: { - atxHeading: closer(), - atxHeadingSequence: onexitatxheadingsequence, - autolink: closer(), - autolinkEmail: onexitautolinkemail, - autolinkProtocol: onexitautolinkprotocol, - blockQuote: closer(), - characterEscapeValue: onexitdata, - characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, - characterReferenceMarkerNumeric: onexitcharacterreferencemarker, - characterReferenceValue: onexitcharacterreferencevalue, - codeFenced: closer(onexitcodefenced), - codeFencedFence: onexitcodefencedfence, - codeFencedFenceInfo: onexitcodefencedfenceinfo, - codeFencedFenceMeta: onexitcodefencedfencemeta, - codeFlowValue: onexitdata, - codeIndented: closer(onexitcodeindented), - codeText: closer(onexitcodetext), - codeTextData: onexitdata, - data: onexitdata, - definition: closer(), - definitionDestinationString: onexitdefinitiondestinationstring, - definitionLabelString: onexitdefinitionlabelstring, - definitionTitleString: onexitdefinitiontitlestring, - emphasis: closer(), - hardBreakEscape: closer(onexithardbreak), - hardBreakTrailing: closer(onexithardbreak), - htmlFlow: closer(onexithtmlflow), - htmlFlowData: onexitdata, - htmlText: closer(onexithtmltext), - htmlTextData: onexitdata, - image: closer(onexitimage), - label: onexitlabel, - labelText: onexitlabeltext, - lineEnding: onexitlineending, - link: closer(onexitlink), - listItem: closer(), - listOrdered: closer(), - listUnordered: closer(), - paragraph: closer(), - referenceString: onexitreferencestring, - resourceDestinationString: onexitresourcedestinationstring, - resourceTitleString: onexitresourcetitlestring, - resource: onexitresource, - setextHeading: closer(onexitsetextheading), - setextHeadingLineSequence: onexitsetextheadinglinesequence, - setextHeadingText: onexitsetextheadingtext, - strong: closer(), - thematicBreak: closer(), - }, - }, - options.mdastExtensions || [], - ); - const data2 = {}; - return compile2; - function compile2(events) { - let tree = { - type: 'root', - children: [], - }; - const stack = [tree]; - const tokenStack = []; - const listStack = []; - const context = { - stack, - tokenStack, - config, - enter, - exit: exit2, - buffer: buffer2, - resume, - setData, - getData, - }; - let index2 = -1; - while (++index2 < events.length) { - if ( - events[index2][1].type === 'listOrdered' || - events[index2][1].type === 'listUnordered' - ) { - if (events[index2][0] === 'enter') { - listStack.push(index2); - } else { - const tail = listStack.pop(); - index2 = prepareList(events, tail, index2); - } - } - } - index2 = -1; - while (++index2 < events.length) { - const handler = config[events[index2][0]]; - if (own4.call(handler, events[index2][1].type)) { - handler[events[index2][1].type].call( - Object.assign( - { - sliceSerialize: events[index2][2].sliceSerialize, - }, - context, - ), - events[index2][1], - ); - } - } - if (tokenStack.length > 0) { - const tail = tokenStack[tokenStack.length - 1]; - const handler = tail[1] || defaultOnError; - handler.call(context, void 0, tail[0]); - } - tree.position = { - start: point3( - events.length > 0 - ? events[0][1].start - : { - line: 1, - column: 1, - offset: 0, - }, - ), - end: point3( - events.length > 0 - ? events[events.length - 2][1].end - : { - line: 1, - column: 1, - offset: 0, - }, - ), - }; - index2 = -1; - while (++index2 < config.transforms.length) { - tree = config.transforms[index2](tree) || tree; - } - return tree; - } - function prepareList(events, start3, length) { - let index2 = start3 - 1; - let containerBalance = -1; - let listSpread = false; - let listItem3; - let lineIndex; - let firstBlankLineIndex; - let atMarker; - while (++index2 <= length) { - const event = events[index2]; - if ( - event[1].type === 'listUnordered' || - event[1].type === 'listOrdered' || - event[1].type === 'blockQuote' - ) { - if (event[0] === 'enter') { - containerBalance++; - } else { - containerBalance--; - } - atMarker = void 0; - } else if (event[1].type === 'lineEndingBlank') { - if (event[0] === 'enter') { - if ( - listItem3 && - !atMarker && - !containerBalance && - !firstBlankLineIndex - ) { - firstBlankLineIndex = index2; - } - atMarker = void 0; - } - } else if ( - event[1].type === 'linePrefix' || - event[1].type === 'listItemValue' || - event[1].type === 'listItemMarker' || - event[1].type === 'listItemPrefix' || - event[1].type === 'listItemPrefixWhitespace' - ) { - } else { - atMarker = void 0; - } - if ( - (!containerBalance && - event[0] === 'enter' && - event[1].type === 'listItemPrefix') || - (containerBalance === -1 && - event[0] === 'exit' && - (event[1].type === 'listUnordered' || - event[1].type === 'listOrdered')) - ) { - if (listItem3) { - let tailIndex = index2; - lineIndex = void 0; - while (tailIndex--) { - const tailEvent = events[tailIndex]; - if ( - tailEvent[1].type === 'lineEnding' || - tailEvent[1].type === 'lineEndingBlank' - ) { - if (tailEvent[0] === 'exit') continue; - if (lineIndex) { - events[lineIndex][1].type = 'lineEndingBlank'; - listSpread = true; - } - tailEvent[1].type = 'lineEnding'; - lineIndex = tailIndex; - } else if ( - tailEvent[1].type === 'linePrefix' || - tailEvent[1].type === 'blockQuotePrefix' || - tailEvent[1].type === 'blockQuotePrefixWhitespace' || - tailEvent[1].type === 'blockQuoteMarker' || - tailEvent[1].type === 'listItemIndent' - ) { - } else { - break; - } - } - if ( - firstBlankLineIndex && - (!lineIndex || firstBlankLineIndex < lineIndex) - ) { - listItem3._spread = true; - } - listItem3.end = Object.assign( - {}, - lineIndex ? events[lineIndex][1].start : event[1].end, - ); - events.splice(lineIndex || index2, 0, ['exit', listItem3, event[2]]); - index2++; - length++; - } - if (event[1].type === 'listItemPrefix') { - listItem3 = { - type: 'listItem', - _spread: false, - start: Object.assign({}, event[1].start), - }; - events.splice(index2, 0, ['enter', listItem3, event[2]]); - index2++; - length++; - firstBlankLineIndex = void 0; - atMarker = true; - } - } - } - events[start3][1]._spread = listSpread; - return length; - } - function setData(key, value) { - data2[key] = value; - } - function getData(key) { - return data2[key]; - } - function point3(d) { - return { - line: d.line, - column: d.column, - offset: d.offset, - }; - } - function opener(create5, and) { - return open; - function open(token) { - enter.call(this, create5(token), token); - if (and) and.call(this, token); - } - } - function buffer2() { - this.stack.push({ - type: 'fragment', - children: [], - }); - } - function enter(node, token, errorHandler) { - const parent = this.stack[this.stack.length - 1]; - parent.children.push(node); - this.stack.push(node); - this.tokenStack.push([token, errorHandler]); - node.position = { - start: point3(token.start), - }; - return node; - } - function closer(and) { - return close; - function close(token) { - if (and) and.call(this, token); - exit2.call(this, token); - } - } - function exit2(token, onExitError) { - const node = this.stack.pop(); - const open = this.tokenStack.pop(); - if (!open) { - throw new Error( - 'Cannot close `' + - token.type + - '` (' + - stringifyPosition({ - start: token.start, - end: token.end, - }) + - '): it\u2019s not open', - ); - } else if (open[0].type !== token.type) { - if (onExitError) { - onExitError.call(this, token, open[0]); - } else { - const handler = open[1] || defaultOnError; - handler.call(this, token, open[0]); - } - } - node.position.end = point3(token.end); - return node; - } - function resume() { - return toString2(this.stack.pop()); - } - function onenterlistordered() { - setData('expectingFirstListItemValue', true); - } - function onenterlistitemvalue(token) { - if (getData('expectingFirstListItemValue')) { - const ancestor = this.stack[this.stack.length - 2]; - ancestor.start = Number.parseInt(this.sliceSerialize(token), 10); - setData('expectingFirstListItemValue'); - } - } - function onexitcodefencedfenceinfo() { - const data3 = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.lang = data3; - } - function onexitcodefencedfencemeta() { - const data3 = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.meta = data3; - } - function onexitcodefencedfence() { - if (getData('flowCodeInside')) return; - this.buffer(); - setData('flowCodeInside', true); - } - function onexitcodefenced() { - const data3 = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.value = data3.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ''); - setData('flowCodeInside'); - } - function onexitcodeindented() { - const data3 = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.value = data3.replace(/(\r?\n|\r)$/g, ''); - } - function onexitdefinitionlabelstring(token) { - const label = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.label = label; - node.identifier = normalizeIdentifier( - this.sliceSerialize(token), - ).toLowerCase(); - } - function onexitdefinitiontitlestring() { - const data3 = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.title = data3; - } - function onexitdefinitiondestinationstring() { - const data3 = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.url = data3; - } - function onexitatxheadingsequence(token) { - const node = this.stack[this.stack.length - 1]; - if (!node.depth) { - const depth = this.sliceSerialize(token).length; - node.depth = depth; - } - } - function onexitsetextheadingtext() { - setData('setextHeadingSlurpLineEnding', true); - } - function onexitsetextheadinglinesequence(token) { - const node = this.stack[this.stack.length - 1]; - node.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2; - } - function onexitsetextheading() { - setData('setextHeadingSlurpLineEnding'); - } - function onenterdata(token) { - const parent = this.stack[this.stack.length - 1]; - let tail = parent.children[parent.children.length - 1]; - if (!tail || tail.type !== 'text') { - tail = text5(); - tail.position = { - start: point3(token.start), - }; - parent.children.push(tail); - } - this.stack.push(tail); - } - function onexitdata(token) { - const tail = this.stack.pop(); - tail.value += this.sliceSerialize(token); - tail.position.end = point3(token.end); - } - function onexitlineending(token) { - const context = this.stack[this.stack.length - 1]; - if (getData('atHardBreak')) { - const tail = context.children[context.children.length - 1]; - tail.position.end = point3(token.end); - setData('atHardBreak'); - return; - } - if ( - !getData('setextHeadingSlurpLineEnding') && - config.canContainEols.includes(context.type) - ) { - onenterdata.call(this, token); - onexitdata.call(this, token); - } - } - function onexithardbreak() { - setData('atHardBreak', true); - } - function onexithtmlflow() { - const data3 = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.value = data3; - } - function onexithtmltext() { - const data3 = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.value = data3; - } - function onexitcodetext() { - const data3 = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.value = data3; - } - function onexitlink() { - const context = this.stack[this.stack.length - 1]; - if (getData('inReference')) { - context.type += 'Reference'; - context.referenceType = getData('referenceType') || 'shortcut'; - delete context.url; - delete context.title; - } else { - delete context.identifier; - delete context.label; - } - setData('referenceType'); - } - function onexitimage() { - const context = this.stack[this.stack.length - 1]; - if (getData('inReference')) { - context.type += 'Reference'; - context.referenceType = getData('referenceType') || 'shortcut'; - delete context.url; - delete context.title; - } else { - delete context.identifier; - delete context.label; - } - setData('referenceType'); - } - function onexitlabeltext(token) { - const ancestor = this.stack[this.stack.length - 2]; - const string3 = this.sliceSerialize(token); - ancestor.label = decodeString(string3); - ancestor.identifier = normalizeIdentifier(string3).toLowerCase(); - } - function onexitlabel() { - const fragment = this.stack[this.stack.length - 1]; - const value = this.resume(); - const node = this.stack[this.stack.length - 1]; - setData('inReference', true); - if (node.type === 'link') { - node.children = fragment.children; - } else { - node.alt = value; - } - } - function onexitresourcedestinationstring() { - const data3 = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.url = data3; - } - function onexitresourcetitlestring() { - const data3 = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.title = data3; - } - function onexitresource() { - setData('inReference'); - } - function onenterreference() { - setData('referenceType', 'collapsed'); - } - function onexitreferencestring(token) { - const label = this.resume(); - const node = this.stack[this.stack.length - 1]; - node.label = label; - node.identifier = normalizeIdentifier( - this.sliceSerialize(token), - ).toLowerCase(); - setData('referenceType', 'full'); - } - function onexitcharacterreferencemarker(token) { - setData('characterReferenceType', token.type); - } - function onexitcharacterreferencevalue(token) { - const data3 = this.sliceSerialize(token); - const type = getData('characterReferenceType'); - let value; - if (type) { - value = decodeNumericCharacterReference( - data3, - type === 'characterReferenceMarkerNumeric' ? 10 : 16, - ); - setData('characterReferenceType'); - } else { - value = decodeNamedCharacterReference(data3); - } - const tail = this.stack.pop(); - tail.value += value; - tail.position.end = point3(token.end); - } - function onexitautolinkprotocol(token) { - onexitdata.call(this, token); - const node = this.stack[this.stack.length - 1]; - node.url = this.sliceSerialize(token); - } - function onexitautolinkemail(token) { - onexitdata.call(this, token); - const node = this.stack[this.stack.length - 1]; - node.url = 'mailto:' + this.sliceSerialize(token); - } - function blockQuote2() { - return { - type: 'blockquote', - children: [], - }; - } - function codeFlow() { - return { - type: 'code', - lang: null, - meta: null, - value: '', - }; - } - function codeText2() { - return { - type: 'inlineCode', - value: '', - }; - } - function definition2() { - return { - type: 'definition', - identifier: '', - label: null, - title: null, - url: '', - }; - } - function emphasis2() { - return { - type: 'emphasis', - children: [], - }; - } - function heading2() { - return { - type: 'heading', - depth: void 0, - children: [], - }; - } - function hardBreak2() { - return { - type: 'break', - }; - } - function html4() { - return { - type: 'html', - value: '', - }; - } - function image2() { - return { - type: 'image', - title: null, - url: '', - alt: null, - }; - } - function link2() { - return { - type: 'link', - title: null, - url: '', - children: [], - }; - } - function list3(token) { - return { - type: 'list', - ordered: token.type === 'listOrdered', - start: null, - spread: token._spread, - children: [], - }; - } - function listItem2(token) { - return { - type: 'listItem', - spread: token._spread, - checked: null, - children: [], - }; - } - function paragraph2() { - return { - type: 'paragraph', - children: [], - }; - } - function strong2() { - return { - type: 'strong', - children: [], - }; - } - function text5() { - return { - type: 'text', - value: '', - }; - } - function thematicBreak3() { - return { - type: 'thematicBreak', - }; - } -} -function configure(combined, extensions) { - let index2 = -1; - while (++index2 < extensions.length) { - const value = extensions[index2]; - if (Array.isArray(value)) { - configure(combined, value); - } else { - extension(combined, value); - } - } - return combined; -} -function extension(combined, extension2) { - let key; - for (key in extension2) { - if (own4.call(extension2, key)) { - const list3 = key === 'canContainEols' || key === 'transforms'; - const maybe = own4.call(combined, key) ? combined[key] : void 0; - const left = maybe || (combined[key] = list3 ? [] : {}); - const right = extension2[key]; - if (right) { - if (list3) { - combined[key] = [...left, ...right]; - } else { - Object.assign(left, right); - } - } - } - } -} -function defaultOnError(left, right) { - if (left) { - throw new Error( - 'Cannot close `' + - left.type + - '` (' + - stringifyPosition({ - start: left.start, - end: left.end, - }) + - '): a different token (`' + - right.type + - '`, ' + - stringifyPosition({ - start: right.start, - end: right.end, - }) + - ') is open', - ); - } else { - throw new Error( - 'Cannot close document, a token (`' + - right.type + - '`, ' + - stringifyPosition({ - start: right.start, - end: right.end, - }) + - ') is still open', - ); - } -} - -// node_modules/@mdx-js/mdx/node_modules/remark-parse/lib/index.js -function remarkParse(options) { - const parser = (doc) => { - const settings = this.data('settings'); - return fromMarkdown( - doc, - Object.assign({}, settings, options, { - extensions: this.data('micromarkExtensions') || [], - mdastExtensions: this.data('fromMarkdownExtensions') || [], - }), - ); - }; - Object.assign(this, {Parser: parser}); -} - -// node_modules/@mdx-js/mdx/node_modules/remark-parse/index.js -var remark_parse_default = remarkParse; - -// node_modules/@mdx-js/mdx/node_modules/unist-builder/index.js -var u = function (type, props, value) { - var node = {type: String(type)}; - if ( - (value === void 0 || value === null) && - (typeof props === 'string' || Array.isArray(props)) - ) { - value = props; - } else { - Object.assign(node, props); - } - if (Array.isArray(value)) { - node.children = value; - } else if (value !== void 0 && value !== null) { - node.value = String(value); - } - return node; -}; - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/traverse.js -var own5 = {}.hasOwnProperty; -function unknown(h, node) { - const data2 = node.data || {}; - if ( - 'value' in node && - !( - own5.call(data2, 'hName') || - own5.call(data2, 'hProperties') || - own5.call(data2, 'hChildren') - ) - ) { - return h.augment(node, u('text', node.value)); - } - return h(node, 'div', all2(h, node)); -} -function one2(h, node, parent) { - const type = node && node.type; - let fn; - if (!type) { - throw new Error('Expected node, got `' + node + '`'); - } - if (own5.call(h.handlers, type)) { - fn = h.handlers[type]; - } else if (h.passThrough && h.passThrough.includes(type)) { - fn = returnNode; - } else { - fn = h.unknownHandler; - } - return (typeof fn === 'function' ? fn : unknown)(h, node, parent); -} -function returnNode(h, node) { - return 'children' in node ? {...node, children: all2(h, node)} : node; -} -function all2(h, parent) { - const values = []; - if ('children' in parent) { - const nodes = parent.children; - let index2 = -1; - while (++index2 < nodes.length) { - const result = one2(h, nodes[index2], parent); - if (result) { - if (index2 && nodes[index2 - 1].type === 'break') { - if (!Array.isArray(result) && result.type === 'text') { - result.value = result.value.replace(/^\s+/, ''); - } - if (!Array.isArray(result) && result.type === 'element') { - const head = result.children[0]; - if (head && head.type === 'text') { - head.value = head.value.replace(/^\s+/, ''); - } - } - } - if (Array.isArray(result)) { - values.push(...result); - } else { - values.push(result); - } - } - } - } - return values; -} - -// node_modules/unist-util-is/index.js -var convert = function (test) { - if (test === void 0 || test === null) { - return ok; - } - if (typeof test === 'string') { - return typeFactory(test); - } - if (typeof test === 'object') { - return Array.isArray(test) ? anyFactory(test) : propsFactory(test); - } - if (typeof test === 'function') { - return castFactory(test); - } - throw new Error('Expected function, string, or object as test'); -}; -function anyFactory(tests) { - const checks2 = []; - let index2 = -1; - while (++index2 < tests.length) { - checks2[index2] = convert(tests[index2]); - } - return castFactory(any); - function any(...parameters) { - let index3 = -1; - while (++index3 < checks2.length) { - if (checks2[index3].call(this, ...parameters)) return true; - } - return false; - } -} -function propsFactory(check) { - return castFactory(all4); - function all4(node) { - let key; - for (key in check) { - if (node[key] !== check[key]) return false; - } - return true; - } -} -function typeFactory(check) { - return castFactory(type); - function type(node) { - return node && node.type === check; - } -} -function castFactory(check) { - return assertion; - function assertion(...parameters) { - return Boolean(check.call(this, ...parameters)); - } -} -function ok() { - return true; -} - -// node_modules/unist-util-visit-parents/color.js -function color2(d) { - return '\x1B[33m' + d + '\x1B[39m'; -} - -// node_modules/unist-util-visit-parents/index.js -var CONTINUE2 = true; -var SKIP2 = 'skip'; -var EXIT2 = false; -var visitParents = function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - const is = convert(test); - const step = reverse ? -1 : 1; - factory2(tree, null, [])(); - function factory2(node, index2, parents) { - const value = typeof node === 'object' && node !== null ? node : {}; - let name2; - if (typeof value.type === 'string') { - name2 = - typeof value.tagName === 'string' - ? value.tagName - : typeof value.name === 'string' - ? value.name - : void 0; - Object.defineProperty(visit3, 'name', { - value: - 'node (' + - color2(value.type + (name2 ? '<' + name2 + '>' : '')) + - ')', - }); - } - return visit3; - function visit3() { - let result = []; - let subresult; - let offset2; - let grandparents; - if (!test || is(node, index2, parents[parents.length - 1] || null)) { - result = toResult2(visitor(node, parents)); - if (result[0] === EXIT2) { - return result; - } - } - if (node.children && result[0] !== SKIP2) { - offset2 = (reverse ? node.children.length : -1) + step; - grandparents = parents.concat(node); - while (offset2 > -1 && offset2 < node.children.length) { - subresult = factory2(node.children[offset2], offset2, grandparents)(); - if (subresult[0] === EXIT2) { - return subresult; - } - offset2 = - typeof subresult[1] === 'number' ? subresult[1] : offset2 + step; - } - } - return result; - } - } -}; -function toResult2(value) { - if (Array.isArray(value)) { - return value; - } - if (typeof value === 'number') { - return [CONTINUE2, value]; - } - return [value]; -} - -// node_modules/@mdx-js/mdx/node_modules/unist-util-visit/index.js -var visit2 = function (tree, test, visitor, reverse) { - if (typeof test === 'function' && typeof visitor !== 'function') { - reverse = visitor; - visitor = test; - test = null; - } - visitParents(tree, test, overload, reverse); - function overload(node, parents) { - const parent = parents[parents.length - 1]; - return visitor(node, parent ? parent.children.indexOf(node) : null, parent); - } -}; - -// node_modules/unist-util-position/index.js -var pointStart = point2('start'); -var pointEnd = point2('end'); -function position2(node) { - return {start: pointStart(node), end: pointEnd(node)}; -} -function point2(type) { - return point3; - function point3(node) { - const point4 = (node && node.position && node.position[type]) || {}; - return { - line: point4.line || null, - column: point4.column || null, - offset: point4.offset > -1 ? point4.offset : null, - }; - } -} - -// node_modules/@mdx-js/mdx/node_modules/unist-util-generated/index.js -function generated(node) { - return ( - !node || - !node.position || - !node.position.start || - !node.position.start.line || - !node.position.start.column || - !node.position.end || - !node.position.end.line || - !node.position.end.column - ); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-definitions/index.js -var own6 = {}.hasOwnProperty; -function definitions(node) { - const cache = /* @__PURE__ */ Object.create(null); - if (!node || !node.type) { - throw new Error('mdast-util-definitions expected node'); - } - visit2(node, 'definition', (definition3) => { - const id = clean(definition3.identifier); - if (id && !own6.call(cache, id)) { - cache[id] = definition3; - } - }); - return definition2; - function definition2(identifier) { - const id = clean(identifier); - return id && own6.call(cache, id) ? cache[id] : null; - } -} -function clean(value) { - return String(value || '').toUpperCase(); -} - -// node_modules/micromark-util-sanitize-uri/index.js -function normalizeUri(value) { - const result = []; - let index2 = -1; - let start3 = 0; - let skip = 0; - while (++index2 < value.length) { - const code2 = value.charCodeAt(index2); - let replace = ''; - if ( - code2 === 37 && - asciiAlphanumeric(value.charCodeAt(index2 + 1)) && - asciiAlphanumeric(value.charCodeAt(index2 + 2)) - ) { - skip = 2; - } else if (code2 < 128) { - if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code2))) { - replace = String.fromCharCode(code2); - } - } else if (code2 > 55295 && code2 < 57344) { - const next = value.charCodeAt(index2 + 1); - if (code2 < 56320 && next > 56319 && next < 57344) { - replace = String.fromCharCode(code2, next); - skip = 1; - } else { - replace = '\uFFFD'; - } - } else { - replace = String.fromCharCode(code2); - } - if (replace) { - result.push(value.slice(start3, index2), encodeURIComponent(replace)); - start3 = index2 + skip + 1; - replace = ''; - } - if (skip) { - index2 += skip; - skip = 0; - } - } - return result.join('') + value.slice(start3); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/wrap.js -function wrap2(nodes, loose) { - const result = []; - let index2 = -1; - if (loose) { - result.push(u('text', '\n')); - } - while (++index2 < nodes.length) { - if (index2) result.push(u('text', '\n')); - result.push(nodes[index2]); - } - if (loose && nodes.length > 0) { - result.push(u('text', '\n')); - } - return result; -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/footer.js -function footer(h) { - let index2 = -1; - const listItems = []; - while (++index2 < h.footnoteOrder.length) { - const def = h.footnoteById[h.footnoteOrder[index2].toUpperCase()]; - if (!def) { - continue; - } - const content3 = all2(h, def); - const id = String(def.identifier); - const safeId = normalizeUri(id.toLowerCase()); - let referenceIndex = 0; - const backReferences = []; - while (++referenceIndex <= h.footnoteCounts[id]) { - const backReference = { - type: 'element', - tagName: 'a', - properties: { - href: - '#' + - h.clobberPrefix + - 'fnref-' + - safeId + - (referenceIndex > 1 ? '-' + referenceIndex : ''), - dataFootnoteBackref: true, - className: ['data-footnote-backref'], - ariaLabel: h.footnoteBackLabel, - }, - children: [{type: 'text', value: '\u21A9'}], - }; - if (referenceIndex > 1) { - backReference.children.push({ - type: 'element', - tagName: 'sup', - children: [{type: 'text', value: String(referenceIndex)}], - }); - } - if (backReferences.length > 0) { - backReferences.push({type: 'text', value: ' '}); - } - backReferences.push(backReference); - } - const tail = content3[content3.length - 1]; - if (tail && tail.type === 'element' && tail.tagName === 'p') { - const tailTail = tail.children[tail.children.length - 1]; - if (tailTail && tailTail.type === 'text') { - tailTail.value += ' '; - } else { - tail.children.push({type: 'text', value: ' '}); - } - tail.children.push(...backReferences); - } else { - content3.push(...backReferences); - } - const listItem2 = { - type: 'element', - tagName: 'li', - properties: {id: h.clobberPrefix + 'fn-' + safeId}, - children: wrap2(content3, true), - }; - if (def.position) { - listItem2.position = def.position; - } - listItems.push(listItem2); - } - if (listItems.length === 0) { - return null; - } - return { - type: 'element', - tagName: 'section', - properties: {dataFootnotes: true, className: ['footnotes']}, - children: [ - { - type: 'element', - tagName: h.footnoteLabelTagName, - properties: { - ...JSON.parse(JSON.stringify(h.footnoteLabelProperties)), - id: 'footnote-label', - }, - children: [u('text', h.footnoteLabel)], - }, - {type: 'text', value: '\n'}, - { - type: 'element', - tagName: 'ol', - properties: {}, - children: wrap2(listItems, true), - }, - {type: 'text', value: '\n'}, - ], - }; -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js -function blockquote(h, node) { - return h(node, 'blockquote', wrap2(all2(h, node), true)); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/break.js -function hardBreak(h, node) { - return [h(node, 'br'), u('text', '\n')]; -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/code.js -function code(h, node) { - const value = node.value ? node.value + '\n' : ''; - const lang = node.lang && node.lang.match(/^[^ \t]+(?=[ \t]|$)/); - const props = {}; - if (lang) { - props.className = ['language-' + lang]; - } - const code2 = h(node, 'code', props, [u('text', value)]); - if (node.meta) { - code2.data = {meta: node.meta}; - } - return h(node.position, 'pre', [code2]); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/delete.js -function strikethrough(h, node) { - return h(node, 'del', all2(h, node)); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js -function emphasis(h, node) { - return h(node, 'em', all2(h, node)); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js -function footnoteReference(h, node) { - const id = String(node.identifier); - const safeId = normalizeUri(id.toLowerCase()); - const index2 = h.footnoteOrder.indexOf(id); - let counter; - if (index2 === -1) { - h.footnoteOrder.push(id); - h.footnoteCounts[id] = 1; - counter = h.footnoteOrder.length; - } else { - h.footnoteCounts[id]++; - counter = index2 + 1; - } - const reuseCounter = h.footnoteCounts[id]; - return h(node, 'sup', [ - h( - node.position, - 'a', - { - href: '#' + h.clobberPrefix + 'fn-' + safeId, - id: - h.clobberPrefix + - 'fnref-' + - safeId + - (reuseCounter > 1 ? '-' + reuseCounter : ''), - dataFootnoteRef: true, - ariaDescribedBy: 'footnote-label', - }, - [u('text', String(counter))], - ), - ]); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/footnote.js -function footnote(h, node) { - const footnoteById = h.footnoteById; - let no = 1; - while (no in footnoteById) no++; - const identifier = String(no); - footnoteById[identifier] = { - type: 'footnoteDefinition', - identifier, - children: [{type: 'paragraph', children: node.children}], - position: node.position, - }; - return footnoteReference(h, { - type: 'footnoteReference', - identifier, - position: node.position, - }); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/heading.js -function heading(h, node) { - return h(node, 'h' + node.depth, all2(h, node)); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/html.js -function html(h, node) { - return h.dangerous ? h.augment(node, u('raw', node.value)) : null; -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/revert.js -function revert(h, node) { - const subtype = node.referenceType; - let suffix = ']'; - if (subtype === 'collapsed') { - suffix += '[]'; - } else if (subtype === 'full') { - suffix += '[' + (node.label || node.identifier) + ']'; - } - if (node.type === 'imageReference') { - return u('text', '![' + node.alt + suffix); - } - const contents = all2(h, node); - const head = contents[0]; - if (head && head.type === 'text') { - head.value = '[' + head.value; - } else { - contents.unshift(u('text', '[')); - } - const tail = contents[contents.length - 1]; - if (tail && tail.type === 'text') { - tail.value += suffix; - } else { - contents.push(u('text', suffix)); - } - return contents; -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js -function imageReference(h, node) { - const def = h.definition(node.identifier); - if (!def) { - return revert(h, node); - } - const props = {src: normalizeUri(def.url || ''), alt: node.alt}; - if (def.title !== null && def.title !== void 0) { - props.title = def.title; - } - return h(node, 'img', props); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/image.js -function image(h, node) { - const props = {src: normalizeUri(node.url), alt: node.alt}; - if (node.title !== null && node.title !== void 0) { - props.title = node.title; - } - return h(node, 'img', props); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js -function inlineCode(h, node) { - return h(node, 'code', [u('text', node.value.replace(/\r?\n|\r/g, ' '))]); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js -function linkReference(h, node) { - const def = h.definition(node.identifier); - if (!def) { - return revert(h, node); - } - const props = {href: normalizeUri(def.url || '')}; - if (def.title !== null && def.title !== void 0) { - props.title = def.title; - } - return h(node, 'a', props, all2(h, node)); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/link.js -function link(h, node) { - const props = {href: normalizeUri(node.url)}; - if (node.title !== null && node.title !== void 0) { - props.title = node.title; - } - return h(node, 'a', props, all2(h, node)); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/list-item.js -function listItem(h, node, parent) { - const result = all2(h, node); - const loose = parent ? listLoose(parent) : listItemLoose(node); - const props = {}; - const wrapped = []; - if (typeof node.checked === 'boolean') { - let paragraph2; - if ( - result[0] && - result[0].type === 'element' && - result[0].tagName === 'p' - ) { - paragraph2 = result[0]; - } else { - paragraph2 = h(null, 'p', []); - result.unshift(paragraph2); - } - if (paragraph2.children.length > 0) { - paragraph2.children.unshift(u('text', ' ')); - } - paragraph2.children.unshift( - h(null, 'input', { - type: 'checkbox', - checked: node.checked, - disabled: true, - }), - ); - props.className = ['task-list-item']; - } - let index2 = -1; - while (++index2 < result.length) { - const child = result[index2]; - if ( - loose || - index2 !== 0 || - child.type !== 'element' || - child.tagName !== 'p' - ) { - wrapped.push(u('text', '\n')); - } - if (child.type === 'element' && child.tagName === 'p' && !loose) { - wrapped.push(...child.children); - } else { - wrapped.push(child); - } - } - const tail = result[result.length - 1]; - if (tail && (loose || !('tagName' in tail) || tail.tagName !== 'p')) { - wrapped.push(u('text', '\n')); - } - return h(node, 'li', props, wrapped); -} -function listLoose(node) { - let loose = node.spread; - const children = node.children; - let index2 = -1; - while (!loose && ++index2 < children.length) { - loose = listItemLoose(children[index2]); - } - return Boolean(loose); -} -function listItemLoose(node) { - const spread = node.spread; - return spread === void 0 || spread === null - ? node.children.length > 1 - : spread; -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/list.js -function list2(h, node) { - const props = {}; - const name2 = node.ordered ? 'ol' : 'ul'; - const items = all2(h, node); - let index2 = -1; - if (typeof node.start === 'number' && node.start !== 1) { - props.start = node.start; - } - while (++index2 < items.length) { - const item = items[index2]; - if ( - item.type === 'element' && - item.tagName === 'li' && - item.properties && - Array.isArray(item.properties.className) && - item.properties.className.includes('task-list-item') - ) { - props.className = ['contains-task-list']; - break; - } - } - return h(node, name2, props, wrap2(items, true)); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js -function paragraph(h, node) { - return h(node, 'p', all2(h, node)); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/root.js -function root(h, node) { - return h.augment(node, u('root', wrap2(all2(h, node)))); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/strong.js -function strong(h, node) { - return h(node, 'strong', all2(h, node)); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/table.js -function table(h, node) { - const rows = node.children; - let index2 = -1; - const align = node.align || []; - const result = []; - while (++index2 < rows.length) { - const row = rows[index2].children; - const name2 = index2 === 0 ? 'th' : 'td'; - const out = []; - let cellIndex = -1; - const length = node.align ? align.length : row.length; - while (++cellIndex < length) { - const cell = row[cellIndex]; - out.push( - h(cell, name2, {align: align[cellIndex]}, cell ? all2(h, cell) : []), - ); - } - result[index2] = h(rows[index2], 'tr', wrap2(out, true)); - } - return h( - node, - 'table', - wrap2( - [h(result[0].position, 'thead', wrap2([result[0]], true))].concat( - result[1] - ? h( - { - start: pointStart(result[1]), - end: pointEnd(result[result.length - 1]), - }, - 'tbody', - wrap2(result.slice(1), true), - ) - : [], - ), - true, - ), - ); -} - -// node_modules/trim-lines/index.js -var tab = 9; -var space = 32; -function trimLines(value) { - const source = String(value); - const search2 = /\r?\n|\r/g; - let match = search2.exec(source); - let last = 0; - const lines = []; - while (match) { - lines.push( - trimLine(source.slice(last, match.index), last > 0, true), - match[0], - ); - last = match.index + match[0].length; - match = search2.exec(source); - } - lines.push(trimLine(source.slice(last), last > 0, false)); - return lines.join(''); -} -function trimLine(value, start3, end) { - let startIndex = 0; - let endIndex = value.length; - if (start3) { - let code2 = value.codePointAt(startIndex); - while (code2 === tab || code2 === space) { - startIndex++; - code2 = value.codePointAt(startIndex); - } - } - if (end) { - let code2 = value.codePointAt(endIndex - 1); - while (code2 === tab || code2 === space) { - endIndex--; - code2 = value.codePointAt(endIndex - 1); - } - } - return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''; -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/text.js -function text3(h, node) { - return h.augment(node, u('text', trimLines(String(node.value)))); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js -function thematicBreak2(h, node) { - return h(node, 'hr'); -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/index.js -var handlers = { - blockquote, - break: hardBreak, - code, - delete: strikethrough, - emphasis, - footnoteReference, - footnote, - heading, - html, - imageReference, - image, - inlineCode, - linkReference, - link, - listItem, - list: list2, - paragraph, - root, - strong, - table, - text: text3, - thematicBreak: thematicBreak2, - toml: ignore, - yaml: ignore, - definition: ignore, - footnoteDefinition: ignore, -}; -function ignore() { - return null; -} - -// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/index.js -var own7 = {}.hasOwnProperty; -function factory(tree, options) { - const settings = options || {}; - const dangerous = settings.allowDangerousHtml || false; - const footnoteById = {}; - h.dangerous = dangerous; - h.clobberPrefix = - settings.clobberPrefix === void 0 || settings.clobberPrefix === null - ? 'user-content-' - : settings.clobberPrefix; - h.footnoteLabel = settings.footnoteLabel || 'Footnotes'; - h.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2'; - h.footnoteLabelProperties = settings.footnoteLabelProperties || { - className: ['sr-only'], - }; - h.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content'; - h.definition = definitions(tree); - h.footnoteById = footnoteById; - h.footnoteOrder = []; - h.footnoteCounts = {}; - h.augment = augment; - h.handlers = {...handlers, ...settings.handlers}; - h.unknownHandler = settings.unknownHandler; - h.passThrough = settings.passThrough; - visit2(tree, 'footnoteDefinition', (definition2) => { - const id = String(definition2.identifier).toUpperCase(); - if (!own7.call(footnoteById, id)) { - footnoteById[id] = definition2; - } - }); - return h; - function augment(left, right) { - if (left && 'data' in left && left.data) { - const data2 = left.data; - if (data2.hName) { - if (right.type !== 'element') { - right = { - type: 'element', - tagName: '', - properties: {}, - children: [], - }; - } - right.tagName = data2.hName; - } - if (right.type === 'element' && data2.hProperties) { - right.properties = {...right.properties, ...data2.hProperties}; - } - if ('children' in right && right.children && data2.hChildren) { - right.children = data2.hChildren; - } - } - if (left) { - const ctx = 'type' in left ? left : {position: left}; - if (!generated(ctx)) { - right.position = {start: pointStart(ctx), end: pointEnd(ctx)}; - } - } - return right; - } - function h(node, tagName, props, children) { - if (Array.isArray(props)) { - children = props; - props = {}; - } - return augment(node, { - type: 'element', - tagName, - properties: props || {}, - children: children || [], - }); - } -} -function toHast(tree, options) { - const h = factory(tree, options); - const node = one2(h, tree, null); - const foot = footer(h); - if (foot) { - node.children.push(u('text', '\n'), foot); - } - return Array.isArray(node) ? {type: 'root', children: node} : node; -} - -// node_modules/@mdx-js/mdx/node_modules/remark-rehype/lib/index.js -var remarkRehype = function (destination, options) { - return destination && 'run' in destination - ? bridge(destination, options) - : mutate(destination || options); -}; -var lib_default = remarkRehype; -function bridge(destination, options) { - return (node, file, next) => { - destination.run(toHast(node, options), file, (error) => { - next(error); - }); - }; -} -function mutate(options) { - return (node) => toHast(node, options); -} - -// node_modules/estree-walker/src/walker.js -var WalkerBase = class { - constructor() { - this.should_skip = false; - this.should_remove = false; - this.replacement = null; - this.context = { - skip: () => (this.should_skip = true), - remove: () => (this.should_remove = true), - replace: (node) => (this.replacement = node), - }; - } - replace(parent, prop, index2, node) { - if (parent) { - if (index2 !== null) { - parent[prop][index2] = node; - } else { - parent[prop] = node; - } - } - } - remove(parent, prop, index2) { - if (parent) { - if (index2 !== null) { - parent[prop].splice(index2, 1); - } else { - delete parent[prop]; - } - } - } -}; - -// node_modules/estree-walker/src/sync.js -var SyncWalker = class extends WalkerBase { - constructor(enter, leave) { - super(); - this.enter = enter; - this.leave = leave; - } - visit(node, parent, prop, index2) { - if (node) { - if (this.enter) { - const _should_skip = this.should_skip; - const _should_remove = this.should_remove; - const _replacement = this.replacement; - this.should_skip = false; - this.should_remove = false; - this.replacement = null; - this.enter.call(this.context, node, parent, prop, index2); - if (this.replacement) { - node = this.replacement; - this.replace(parent, prop, index2, node); - } - if (this.should_remove) { - this.remove(parent, prop, index2); - } - const skipped = this.should_skip; - const removed = this.should_remove; - this.should_skip = _should_skip; - this.should_remove = _should_remove; - this.replacement = _replacement; - if (skipped) return node; - if (removed) return null; - } - for (const key in node) { - const value = node[key]; - if (typeof value !== 'object') { - continue; - } else if (Array.isArray(value)) { - for (let i = 0; i < value.length; i += 1) { - if (value[i] !== null && typeof value[i].type === 'string') { - if (!this.visit(value[i], node, key, i)) { - i--; - } - } - } - } else if (value !== null && typeof value.type === 'string') { - this.visit(value, node, key, null); - } - } - if (this.leave) { - const _replacement = this.replacement; - const _should_remove = this.should_remove; - this.replacement = null; - this.should_remove = false; - this.leave.call(this.context, node, parent, prop, index2); - if (this.replacement) { - node = this.replacement; - this.replace(parent, prop, index2, node); - } - if (this.should_remove) { - this.remove(parent, prop, index2); - } - const removed = this.should_remove; - this.replacement = _replacement; - this.should_remove = _should_remove; - if (removed) return null; - } - } - return node; - } -}; - -// node_modules/estree-walker/src/index.js -function walk(ast, {enter, leave}) { - const instance = new SyncWalker(enter, leave); - return instance.visit(ast, null); -} - -// node_modules/estree-util-build-jsx/lib/index.js -var regex = /@(jsx|jsxFrag|jsxImportSource|jsxRuntime)\s+(\S+)/g; -function buildJsx(tree, options = {}) { - let automatic = options.runtime === 'automatic'; - const annotations = {}; - const imports = {}; - walk(tree, { - enter(node) { - if (node.type === 'Program') { - const comments = node.comments || []; - let index2 = -1; - while (++index2 < comments.length) { - regex.lastIndex = 0; - let match = regex.exec(comments[index2].value); - while (match) { - annotations[match[1]] = match[2]; - match = regex.exec(comments[index2].value); - } - } - if (annotations.jsxRuntime) { - if (annotations.jsxRuntime === 'automatic') { - automatic = true; - if (annotations.jsx) { - throw new Error('Unexpected `@jsx` pragma w/ automatic runtime'); - } - if (annotations.jsxFrag) { - throw new Error( - 'Unexpected `@jsxFrag` pragma w/ automatic runtime', - ); - } - } else if (annotations.jsxRuntime === 'classic') { - automatic = false; - if (annotations.jsxImportSource) { - throw new Error( - 'Unexpected `@jsxImportSource` w/ classic runtime', - ); - } - } else { - throw new Error( - 'Unexpected `jsxRuntime` `' + - annotations.jsxRuntime + - '`, expected `automatic` or `classic`', - ); - } - } - } - }, - leave(node) { - if (node.type === 'Program') { - const specifiers = []; - if (imports.fragment) { - specifiers.push({ - type: 'ImportSpecifier', - imported: {type: 'Identifier', name: 'Fragment'}, - local: {type: 'Identifier', name: '_Fragment'}, - }); - } - if (imports.jsx) { - specifiers.push({ - type: 'ImportSpecifier', - imported: {type: 'Identifier', name: 'jsx'}, - local: {type: 'Identifier', name: '_jsx'}, - }); - } - if (imports.jsxs) { - specifiers.push({ - type: 'ImportSpecifier', - imported: {type: 'Identifier', name: 'jsxs'}, - local: {type: 'Identifier', name: '_jsxs'}, - }); - } - if (imports.jsxDEV) { - specifiers.push({ - type: 'ImportSpecifier', - imported: {type: 'Identifier', name: 'jsxDEV'}, - local: {type: 'Identifier', name: '_jsxDEV'}, - }); - } - if (specifiers.length > 0) { - node.body.unshift({ - type: 'ImportDeclaration', - specifiers, - source: { - type: 'Literal', - value: - (annotations.jsxImportSource || - options.importSource || - 'react') + - (options.development ? '/jsx-dev-runtime' : '/jsx-runtime'), - }, - }); - } - } - if (node.type !== 'JSXElement' && node.type !== 'JSXFragment') { - return; - } - const children = []; - let index2 = -1; - while (++index2 < node.children.length) { - const child = node.children[index2]; - if (child.type === 'JSXExpressionContainer') { - if (child.expression.type !== 'JSXEmptyExpression') { - children.push(child.expression); - } - } else if (child.type === 'JSXText') { - const value = child.value - .replace(/\t/g, ' ') - .replace(/ *(\r?\n|\r) */g, '\n') - .replace(/\n+/g, '\n') - .replace(/\n+$/, '') - .replace(/\n/g, ' '); - if (value) { - children.push(create(child, {type: 'Literal', value})); - } - } else { - children.push(child); - } - } - let name2; - let fields = []; - const objects = []; - let parameters = []; - let key; - if (node.type === 'JSXElement') { - name2 = toIdentifier(node.openingElement.name); - if (name2.type === 'Identifier' && /^[a-z]/.test(name2.name)) { - name2 = create(name2, {type: 'Literal', value: name2.name}); - } - let spread; - const attributes = node.openingElement.attributes; - let index3 = -1; - while (++index3 < attributes.length) { - const attribute = attributes[index3]; - if (attribute.type === 'JSXSpreadAttribute') { - if (fields.length > 0) { - objects.push({type: 'ObjectExpression', properties: fields}); - fields = []; - } - objects.push(attribute.argument); - spread = true; - } else { - const prop = toProperty(attribute); - if ( - automatic && - prop.key.type === 'Identifier' && - prop.key.name === 'key' - ) { - if (spread) { - throw new Error( - 'Expected `key` to come before any spread expressions', - ); - } - key = prop.value; - } else { - fields.push(prop); - } - } - } - } else if (automatic) { - imports.fragment = true; - name2 = {type: 'Identifier', name: '_Fragment'}; - } else { - name2 = toMemberExpression( - annotations.jsxFrag || options.pragmaFrag || 'React.Fragment', - ); - } - if (automatic) { - if (children.length > 0) { - fields.push({ - type: 'Property', - key: {type: 'Identifier', name: 'children'}, - value: - children.length > 1 - ? {type: 'ArrayExpression', elements: children} - : children[0], - kind: 'init', - method: false, - shorthand: false, - computed: false, - }); - } - } else { - parameters = children; - } - if (fields.length > 0) { - objects.push({type: 'ObjectExpression', properties: fields}); - } - let props; - let callee; - if (objects.length > 1) { - if (objects[0].type !== 'ObjectExpression') { - objects.unshift({type: 'ObjectExpression', properties: []}); - } - props = { - type: 'CallExpression', - callee: toMemberExpression('Object.assign'), - arguments: objects, - optional: false, - }; - } else if (objects.length > 0) { - props = objects[0]; - } - if (automatic) { - parameters.push(props || {type: 'ObjectExpression', properties: []}); - if (key) { - parameters.push(key); - } else if (options.development) { - parameters.push({type: 'Identifier', name: 'undefined'}); - } - const isStaticChildren = children.length > 1; - if (options.development) { - imports.jsxDEV = true; - callee = { - type: 'Identifier', - name: '_jsxDEV', - }; - parameters.push({type: 'Literal', value: isStaticChildren}); - const source = { - type: 'ObjectExpression', - properties: [ - { - type: 'Property', - method: false, - shorthand: false, - computed: false, - kind: 'init', - key: {type: 'Identifier', name: 'fileName'}, - value: { - type: 'Literal', - value: options.filePath || '', - }, - }, - ], - }; - if (node.loc) { - source.properties.push( - { - type: 'Property', - method: false, - shorthand: false, - computed: false, - kind: 'init', - key: {type: 'Identifier', name: 'lineNumber'}, - value: {type: 'Literal', value: node.loc.start.line}, - }, - { - type: 'Property', - method: false, - shorthand: false, - computed: false, - kind: 'init', - key: {type: 'Identifier', name: 'columnNumber'}, - value: {type: 'Literal', value: node.loc.start.column + 1}, - }, - ); - } - parameters.push(source, {type: 'ThisExpression'}); - } else if (isStaticChildren) { - imports.jsxs = true; - callee = {type: 'Identifier', name: '_jsxs'}; - } else { - imports.jsx = true; - callee = {type: 'Identifier', name: '_jsx'}; - } - } else { - if (props || parameters.length > 0) { - parameters.unshift(props || {type: 'Literal', value: null}); - } - callee = toMemberExpression( - annotations.jsx || options.pragma || 'React.createElement', - ); - } - parameters.unshift(name2); - this.replace( - create(node, { - type: 'CallExpression', - callee, - arguments: parameters, - optional: false, - }), - ); - }, - }); - return tree; -} -function toProperty(node) { - let value; - if (node.value) { - if (node.value.type === 'JSXExpressionContainer') { - value = node.value.expression; - } else { - value = node.value; - delete value.raw; - } - } else { - value = {type: 'Literal', value: true}; - } - return create(node, { - type: 'Property', - key: toIdentifier(node.name), - value, - kind: 'init', - method: false, - shorthand: false, - computed: false, - }); -} -function toIdentifier(node) { - let replace; - if (node.type === 'JSXMemberExpression') { - const id = toIdentifier(node.property); - replace = { - type: 'MemberExpression', - object: toIdentifier(node.object), - property: id, - computed: id.type === 'Literal', - optional: false, - }; - } else if (node.type === 'JSXNamespacedName') { - replace = { - type: 'Literal', - value: node.namespace.name + ':' + node.name.name, - }; - } else { - replace = name(node.name) - ? {type: 'Identifier', name: node.name} - : {type: 'Literal', value: node.name}; - } - return create(node, replace); -} -function toMemberExpression(id) { - const identifiers = id.split('.'); - let index2 = -1; - let result; - while (++index2 < identifiers.length) { - const prop = name(identifiers[index2]) - ? {type: 'Identifier', name: identifiers[index2]} - : {type: 'Literal', value: identifiers[index2]}; - result = result - ? { - type: 'MemberExpression', - object: result, - property: prop, - computed: Boolean(index2 && prop.type === 'Literal'), - optional: false, - } - : prop; - } - return result; -} -function create(from, node) { - const fields = ['start', 'end', 'loc', 'range', 'comments']; - let index2 = -1; - while (++index2 < fields.length) { - const field = fields[index2]; - if (field in from) { - node[field] = from[field]; - } - } - return node; -} - -// node_modules/@mdx-js/mdx/lib/util/estree-util-create.js -function create2(template, node) { - const fields = ['start', 'end', 'loc', 'range', 'comments']; - let index2 = -1; - while (++index2 < fields.length) { - const field = fields[index2]; - if (field in template) { - node[field] = template[field]; - } - } - return node; -} - -// node_modules/@mdx-js/mdx/lib/util/estree-util-specifiers-to-declarations.js -function specifiersToDeclarations(specifiers, init) { - let index2 = -1; - const declarations = []; - const otherSpecifiers = []; - let importNamespaceSpecifier; - while (++index2 < specifiers.length) { - const specifier = specifiers[index2]; - if (specifier.type === 'ImportNamespaceSpecifier') { - importNamespaceSpecifier = specifier; - } else { - otherSpecifiers.push(specifier); - } - } - if (importNamespaceSpecifier) { - declarations.push( - create2(importNamespaceSpecifier, { - type: 'VariableDeclarator', - id: importNamespaceSpecifier.local, - init, - }), - ); - } - declarations.push({ - type: 'VariableDeclarator', - id: { - type: 'ObjectPattern', - properties: otherSpecifiers.map((specifier) => { - let key = - specifier.type === 'ImportSpecifier' - ? specifier.imported - : specifier.type === 'ExportSpecifier' - ? specifier.exported - : {type: 'Identifier', name: 'default'}; - let value = specifier.local; - if (specifier.type === 'ExportSpecifier') { - value = key; - key = specifier.local; - } - return create2(specifier, { - type: 'Property', - kind: 'init', - shorthand: key.name === value.name, - method: false, - computed: false, - key, - value, - }); - }), - }, - init: importNamespaceSpecifier - ? {type: 'Identifier', name: importNamespaceSpecifier.local.name} - : init, - }); - return declarations; -} - -// node_modules/@mdx-js/mdx/lib/util/estree-util-to-id-or-member-expression.js -var toIdOrMemberExpression = toIdOrMemberExpressionFactory( - 'Identifier', - 'MemberExpression', - name, -); -var toJsxIdOrMemberExpression = toIdOrMemberExpressionFactory( - 'JSXIdentifier', - 'JSXMemberExpression', - isJsxIdentifierName, -); -function toIdOrMemberExpressionFactory(idType, memberType, isIdentifier) { - return toIdOrMemberExpression2; - function toIdOrMemberExpression2(ids) { - let index2 = -1; - let object; - while (++index2 < ids.length) { - const name2 = ids[index2]; - const valid2 = typeof name2 === 'string' && isIdentifier(name2); - if (idType === 'JSXIdentifier' && !valid2) { - throw new Error('Cannot turn `' + name2 + '` into a JSX identifier'); - } - const id = valid2 - ? {type: idType, name: name2} - : {type: 'Literal', value: name2}; - object = object - ? { - type: memberType, - object, - property: id, - computed: id.type === 'Literal', - optional: false, - } - : id; - } - if (!object) throw new Error('Expected non-empty `ids` to be passed'); - if (object.type === 'Literal') - throw new Error('Expected identifier as left-most value'); - return object; - } -} -function isJsxIdentifierName(name2) { - let index2 = -1; - while (++index2 < name2.length) { - if (!(index2 ? jsxCont : start2)(name2.charCodeAt(index2))) return false; - } - return index2 > 0; -} -function jsxCont(code2) { - return code2 === 45 || cont2(code2); -} - -// node_modules/@mdx-js/mdx/lib/plugin/recma-jsx-build.js -function recmaJsxBuild(options = {}) { - const {outputFormat} = options; - return (tree) => { - buildJsx(tree); - if ( - outputFormat === 'function-body' && - tree.body[0] && - tree.body[0].type === 'ImportDeclaration' && - typeof tree.body[0].source.value === 'string' && - /\/jsx-runtime$/.test(tree.body[0].source.value) - ) { - tree.body[0] = { - type: 'VariableDeclaration', - kind: 'const', - declarations: specifiersToDeclarations( - tree.body[0].specifiers, - toIdOrMemberExpression(['arguments', 0]), - ), - }; - } - }; -} - -// node_modules/is-reference/src/index.js -function is_reference(node, parent) { - if (node.type === 'MemberExpression') { - return !node.computed && is_reference(node.object, node); - } - if (node.type === 'Identifier') { - if (!parent) return true; - switch (parent.type) { - case 'MemberExpression': - return parent.computed || node === parent.object; - case 'MethodDefinition': - return parent.computed; - case 'PropertyDefinition': - return parent.computed || node === parent.value; - case 'Property': - return parent.computed || node === parent.value; - case 'ExportSpecifier': - case 'ImportSpecifier': - return node === parent.local; - case 'LabeledStatement': - case 'BreakStatement': - case 'ContinueStatement': - return false; - default: - return true; - } - } - return false; -} - -// node_modules/periscopic/src/index.js -function analyze(expression) { - const map = /* @__PURE__ */ new WeakMap(); - const globals = /* @__PURE__ */ new Map(); - const scope = new Scope3(null, false); - const references = []; - let current_scope = scope; - walk(expression, { - enter(node, parent) { - switch (node.type) { - case 'Identifier': - if (is_reference(node, parent)) { - references.push([current_scope, node]); - } - break; - case 'ImportDeclaration': - node.specifiers.forEach((specifier) => { - current_scope.declarations.set(specifier.local.name, specifier); - }); - break; - case 'FunctionExpression': - case 'FunctionDeclaration': - case 'ArrowFunctionExpression': - if (node.type === 'FunctionDeclaration') { - if (node.id) { - current_scope.declarations.set(node.id.name, node); - } - map.set(node, (current_scope = new Scope3(current_scope, false))); - } else { - map.set(node, (current_scope = new Scope3(current_scope, false))); - if (node.type === 'FunctionExpression' && node.id) { - current_scope.declarations.set(node.id.name, node); - } - } - node.params.forEach((param) => { - extract_names(param).forEach((name2) => { - current_scope.declarations.set(name2, node); - }); - }); - break; - case 'ForStatement': - case 'ForInStatement': - case 'ForOfStatement': - map.set(node, (current_scope = new Scope3(current_scope, true))); - break; - case 'BlockStatement': - map.set(node, (current_scope = new Scope3(current_scope, true))); - break; - case 'ClassDeclaration': - case 'VariableDeclaration': - current_scope.add_declaration(node); - break; - case 'CatchClause': - map.set(node, (current_scope = new Scope3(current_scope, true))); - if (node.param) { - extract_names(node.param).forEach((name2) => { - current_scope.declarations.set(name2, node.param); - }); - } - break; - } - }, - leave(node) { - if (map.has(node)) { - current_scope = current_scope.parent; - } - }, - }); - for (let i = references.length - 1; i >= 0; --i) { - const [scope2, reference] = references[i]; - if (!scope2.references.has(reference.name)) { - add_reference(scope2, reference.name); - } - if (!scope2.find_owner(reference.name)) { - globals.set(reference.name, reference); - } - } - return {map, scope, globals}; -} -function add_reference(scope, name2) { - scope.references.add(name2); - if (scope.parent) add_reference(scope.parent, name2); -} -var Scope3 = class { - constructor(parent, block) { - this.parent = parent; - this.block = block; - this.declarations = /* @__PURE__ */ new Map(); - this.initialised_declarations = /* @__PURE__ */ new Set(); - this.references = /* @__PURE__ */ new Set(); - } - add_declaration(node) { - if (node.type === 'VariableDeclaration') { - if (node.kind === 'var' && this.block && this.parent) { - this.parent.add_declaration(node); - } else { - const handle_declarator = (declarator) => { - extract_names(declarator.id).forEach((name2) => { - this.declarations.set(name2, node); - if (declarator.init) this.initialised_declarations.add(name2); - }); - }; - node.declarations.forEach(handle_declarator); - } - } else if (node.id) { - this.declarations.set(node.id.name, node); - } - } - find_owner(name2) { - if (this.declarations.has(name2)) return this; - return this.parent && this.parent.find_owner(name2); - } - has(name2) { - return ( - this.declarations.has(name2) || (!!this.parent && this.parent.has(name2)) - ); - } -}; -function extract_names(param) { - return extract_identifiers(param).map((node) => node.name); -} -function extract_identifiers(param, nodes = []) { - switch (param.type) { - case 'Identifier': - nodes.push(param); - break; - case 'MemberExpression': - let object = param; - while (object.type === 'MemberExpression') { - object = object.object; - } - nodes.push(object); - break; - case 'ObjectPattern': - const handle_prop = (prop) => { - if (prop.type === 'RestElement') { - extract_identifiers(prop.argument, nodes); - } else { - extract_identifiers(prop.value, nodes); - } - }; - param.properties.forEach(handle_prop); - break; - case 'ArrayPattern': - const handle_element = (element2) => { - if (element2) extract_identifiers(element2, nodes); - }; - param.elements.forEach(handle_element); - break; - case 'RestElement': - extract_identifiers(param.argument, nodes); - break; - case 'AssignmentPattern': - extract_identifiers(param.left, nodes); - break; - } - return nodes; -} - -// node_modules/@mdx-js/mdx/lib/util/estree-util-declaration-to-expression.js -function declarationToExpression(declaration) { - if (declaration.type === 'FunctionDeclaration') { - return {...declaration, type: 'FunctionExpression'}; - } - if (declaration.type === 'ClassDeclaration') { - return {...declaration, type: 'ClassExpression'}; - } - throw new Error('Cannot turn `' + declaration.type + '` into an expression'); -} - -// node_modules/@mdx-js/mdx/lib/util/estree-util-is-declaration.js -function isDeclaration(node) { - const type = node && typeof node === 'object' && node.type; - return Boolean( - type === 'FunctionDeclaration' || - type === 'ClassDeclaration' || - type === 'VariableDeclaration', - ); -} - -// node_modules/@mdx-js/mdx/lib/plugin/recma-document.js -function recmaDocument(options = {}) { - const { - baseUrl, - useDynamicImport, - outputFormat = 'program', - pragma = 'React.createElement', - pragmaFrag = 'React.Fragment', - pragmaImportSource = 'react', - jsxImportSource = 'react', - jsxRuntime = 'automatic', - } = options; - return (tree, file) => { - const exportedIdentifiers = []; - const replacement = []; - const pragmas = []; - let exportAllCount = 0; - let layout; - let content3; - let child; - if (!tree.comments) tree.comments = []; - if (jsxRuntime) { - pragmas.push('@jsxRuntime ' + jsxRuntime); - } - if (jsxRuntime === 'automatic' && jsxImportSource) { - pragmas.push('@jsxImportSource ' + jsxImportSource); - } - if (jsxRuntime === 'classic' && pragma) { - pragmas.push('@jsx ' + pragma); - } - if (jsxRuntime === 'classic' && pragmaFrag) { - pragmas.push('@jsxFrag ' + pragmaFrag); - } - if (pragmas.length > 0) { - tree.comments.unshift({type: 'Block', value: pragmas.join(' ')}); - } - if (jsxRuntime === 'classic' && pragmaImportSource) { - if (!pragma) { - throw new Error( - 'Missing `pragma` in classic runtime with `pragmaImportSource`', - ); - } - handleEsm({ - type: 'ImportDeclaration', - specifiers: [ - { - type: 'ImportDefaultSpecifier', - local: {type: 'Identifier', name: pragma.split('.')[0]}, - }, - ], - source: {type: 'Literal', value: pragmaImportSource}, - }); - } - for (child of tree.body) { - if (child.type === 'ExportDefaultDeclaration') { - if (layout) { - file.fail( - 'Cannot specify multiple layouts (previous: ' + - stringifyPosition(positionFromEstree(layout)) + - ')', - positionFromEstree(child), - 'recma-document:duplicate-layout', - ); - } - layout = child; - replacement.push({ - type: 'VariableDeclaration', - kind: 'const', - declarations: [ - { - type: 'VariableDeclarator', - id: {type: 'Identifier', name: 'MDXLayout'}, - init: isDeclaration(child.declaration) - ? declarationToExpression(child.declaration) - : child.declaration, - }, - ], - }); - } else if (child.type === 'ExportNamedDeclaration' && child.source) { - const source = child.source; - child.specifiers = child.specifiers.filter((specifier) => { - if (specifier.exported.name === 'default') { - if (layout) { - file.fail( - 'Cannot specify multiple layouts (previous: ' + - stringifyPosition(positionFromEstree(layout)) + - ')', - positionFromEstree(child), - 'recma-document:duplicate-layout', - ); - } - layout = specifier; - handleEsm( - create2(specifier, { - type: 'ImportDeclaration', - specifiers: [ - specifier.local.name === 'default' - ? { - type: 'ImportDefaultSpecifier', - local: {type: 'Identifier', name: 'MDXLayout'}, - } - : create2(specifier.local, { - type: 'ImportSpecifier', - imported: specifier.local, - local: {type: 'Identifier', name: 'MDXLayout'}, - }), - ], - source: create2(source, {type: 'Literal', value: source.value}), - }), - ); - return false; - } - return true; - }); - if (child.specifiers.length > 0) { - handleExport(child); - } - } else if ( - child.type === 'ExportNamedDeclaration' || - child.type === 'ExportAllDeclaration' - ) { - handleExport(child); - } else if (child.type === 'ImportDeclaration') { - handleEsm(child); - } else if ( - child.type === 'ExpressionStatement' && - (child.expression.type === 'JSXFragment' || - child.expression.type === 'JSXElement') - ) { - content3 = true; - replacement.push( - ...createMdxContent(child.expression, Boolean(layout)), - ); - } else { - replacement.push(child); - } - } - if (!content3) { - replacement.push(...createMdxContent(void 0, Boolean(layout))); - } - exportedIdentifiers.push(['MDXContent', 'default']); - if (outputFormat === 'function-body') { - replacement.push({ - type: 'ReturnStatement', - argument: { - type: 'ObjectExpression', - properties: [ - ...Array.from({length: exportAllCount}).map((_, index2) => ({ - type: 'SpreadElement', - argument: {type: 'Identifier', name: '_exportAll' + (index2 + 1)}, - })), - ...exportedIdentifiers.map((d) => { - const prop = { - type: 'Property', - kind: 'init', - method: false, - computed: false, - shorthand: typeof d === 'string', - key: { - type: 'Identifier', - name: typeof d === 'string' ? d : d[1], - }, - value: { - type: 'Identifier', - name: typeof d === 'string' ? d : d[0], - }, - }; - return prop; - }), - ], - }, - }); - } else { - replacement.push({ - type: 'ExportDefaultDeclaration', - declaration: {type: 'Identifier', name: 'MDXContent'}, - }); - } - tree.body = replacement; - if (baseUrl) { - walk(tree, { - enter(_node) { - const node = _node; - if ( - node.type === 'MemberExpression' && - 'object' in node && - node.object.type === 'MetaProperty' && - node.property.type === 'Identifier' && - node.object.meta.name === 'import' && - node.object.property.name === 'meta' && - node.property.name === 'url' - ) { - const replacement2 = {type: 'Literal', value: baseUrl}; - this.replace(replacement2); - } - }, - }); - } - function handleExport(node) { - if (node.type === 'ExportNamedDeclaration') { - if (node.declaration) { - exportedIdentifiers.push( - ...analyze(node.declaration).scope.declarations.keys(), - ); - } - for (child of node.specifiers) { - exportedIdentifiers.push(child.exported.name); - } - } - handleEsm(node); - } - function handleEsm(node) { - if (baseUrl && node.source) { - let value = String(node.source.value); - try { - value = String(new URL(value)); - } catch { - if (/^\.{0,2}\//.test(value)) { - value = String(new URL(value, baseUrl)); - } - } - node.source = create2(node.source, {type: 'Literal', value}); - } - let replace; - let init; - if (outputFormat === 'function-body') { - if ( - node.type === 'ImportDeclaration' || - node.type === 'ExportAllDeclaration' || - (node.type === 'ExportNamedDeclaration' && node.source) - ) { - if (!useDynamicImport) { - file.fail( - 'Cannot use `import` or `export \u2026 from` in `evaluate` (outputting a function body) by default: please set `useDynamicImport: true` (and probably specify a `baseUrl`)', - positionFromEstree(node), - 'recma-document:invalid-esm-statement', - ); - } - if (!node.source) { - throw new Error('Expected `node.source` to be defined'); - } - init = { - type: 'AwaitExpression', - argument: create2(node, { - type: 'ImportExpression', - source: node.source, - }), - }; - if ( - (node.type === 'ImportDeclaration' || - node.type === 'ExportNamedDeclaration') && - node.specifiers.length === 0 - ) { - replace = {type: 'ExpressionStatement', expression: init}; - } else { - replace = { - type: 'VariableDeclaration', - kind: 'const', - declarations: - node.type === 'ExportAllDeclaration' - ? [ - { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: '_exportAll' + ++exportAllCount, - }, - init, - }, - ] - : specifiersToDeclarations(node.specifiers, init), - }; - } - } else if (node.declaration) { - replace = node.declaration; - } else { - const declarators = node.specifiers - .filter( - (specifier) => specifier.local.name !== specifier.exported.name, - ) - .map((specifier) => ({ - type: 'VariableDeclarator', - id: specifier.exported, - init: specifier.local, - })); - if (declarators.length > 0) { - replace = { - type: 'VariableDeclaration', - kind: 'const', - declarations: declarators, - }; - } - } - } else { - replace = node; - } - if (replace) { - replacement.push(replace); - } - } - }; - function createMdxContent(content3, hasInternalLayout) { - const element2 = { - type: 'JSXElement', - openingElement: { - type: 'JSXOpeningElement', - name: {type: 'JSXIdentifier', name: 'MDXLayout'}, - attributes: [ - { - type: 'JSXSpreadAttribute', - argument: {type: 'Identifier', name: 'props'}, - }, - ], - selfClosing: false, - }, - closingElement: { - type: 'JSXClosingElement', - name: {type: 'JSXIdentifier', name: 'MDXLayout'}, - }, - children: [ - { - type: 'JSXElement', - openingElement: { - type: 'JSXOpeningElement', - name: {type: 'JSXIdentifier', name: '_createMdxContent'}, - attributes: [ - { - type: 'JSXSpreadAttribute', - argument: {type: 'Identifier', name: 'props'}, - }, - ], - selfClosing: true, - }, - closingElement: null, - children: [], - }, - ], - }; - let result = element2; - if (!hasInternalLayout) { - result = { - type: 'ConditionalExpression', - test: {type: 'Identifier', name: 'MDXLayout'}, - consequent: result, - alternate: { - type: 'CallExpression', - callee: {type: 'Identifier', name: '_createMdxContent'}, - arguments: [{type: 'Identifier', name: 'props'}], - optional: false, - }, - }; - } - let argument = content3 || {type: 'Literal', value: null}; - if ( - argument && - argument.type === 'JSXFragment' && - argument.children.length === 1 && - argument.children[0].type === 'JSXElement' - ) { - argument = argument.children[0]; - } - return [ - { - type: 'FunctionDeclaration', - id: {type: 'Identifier', name: '_createMdxContent'}, - params: [{type: 'Identifier', name: 'props'}], - body: { - type: 'BlockStatement', - body: [{type: 'ReturnStatement', argument}], - }, - }, - { - type: 'FunctionDeclaration', - id: {type: 'Identifier', name: 'MDXContent'}, - params: [ - { - type: 'AssignmentPattern', - left: {type: 'Identifier', name: 'props'}, - right: {type: 'ObjectExpression', properties: []}, - }, - ], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: result, - }, - ], - }, - }, - ]; - } -} - -// node_modules/@mdx-js/mdx/lib/util/estree-util-to-binary-addition.js -function toBinaryAddition(expressions) { - let index2 = -1; - let left; - while (++index2 < expressions.length) { - const right = expressions[index2]; - left = left - ? {type: 'BinaryExpression', left, operator: '+', right} - : right; - } - if (!left) throw new Error('Expected non-empty `expressions` to be passed'); - return left; -} - -// node_modules/@mdx-js/mdx/lib/plugin/recma-jsx-rewrite.js -var own8 = {}.hasOwnProperty; -function recmaJsxRewrite(options = {}) { - const { - development: development2, - providerImportSource, - outputFormat, - } = options; - return (tree, file) => { - const scopeInfo = analyze(tree); - const fnStack = []; - let importProvider; - let createErrorHelper; - let currentScope; - walk(tree, { - enter(_node) { - const node = _node; - const newScope = scopeInfo.map.get(node); - if ( - node.type === 'FunctionDeclaration' || - node.type === 'FunctionExpression' || - node.type === 'ArrowFunctionExpression' - ) { - fnStack.push({ - objects: [], - components: [], - tags: [], - references: {}, - idToInvalidComponentName: /* @__PURE__ */ new Map(), - node, - }); - if ( - isNamedFunction(node, 'MDXContent') && - newScope && - !inScope(newScope, 'MDXLayout') - ) { - fnStack[0].components.push('MDXLayout'); - } - } - const fnScope = fnStack[0]; - if ( - !fnScope || - (!isNamedFunction(fnScope.node, '_createMdxContent') && - !providerImportSource) - ) { - return; - } - if (newScope) { - newScope.node = node; - currentScope = newScope; - } - if (currentScope && node.type === 'JSXElement') { - let name2 = node.openingElement.name; - if (name2.type === 'JSXMemberExpression') { - const ids = []; - while (name2.type === 'JSXMemberExpression') { - ids.unshift(name2.property.name); - name2 = name2.object; - } - ids.unshift(name2.name); - const fullId = ids.join('.'); - const id = name2.name; - const isInScope = inScope(currentScope, id); - if (!own8.call(fnScope.references, fullId)) { - const parentScope = currentScope.parent; - if ( - !isInScope || - (parentScope && - parentScope.node.type === 'FunctionDeclaration' && - isNamedFunction(parentScope.node, '_createMdxContent')) - ) { - fnScope.references[fullId] = {node, component: true}; - } - } - if (!fnScope.objects.includes(id) && !isInScope) { - fnScope.objects.push(id); - } - } else if (name2.type === 'JSXNamespacedName') { - } else if (name(name2.name) && !/^[a-z]/.test(name2.name)) { - const id = name2.name; - if (!inScope(currentScope, id)) { - if (id !== 'MDXLayout' && !own8.call(fnScope.references, id)) { - fnScope.references[id] = {node, component: true}; - } - if (!fnScope.components.includes(id)) { - fnScope.components.push(id); - } - } - } else if (node.data && node.data._mdxExplicitJsx) { - } else { - const id = name2.name; - if (!fnScope.tags.includes(id)) { - fnScope.tags.push(id); - } - let jsxIdExpression = ['_components', id]; - if (name(id) === false) { - let invalidComponentName = - fnScope.idToInvalidComponentName.get(id); - if (invalidComponentName === void 0) { - invalidComponentName = `_component${fnScope.idToInvalidComponentName.size}`; - fnScope.idToInvalidComponentName.set(id, invalidComponentName); - } - jsxIdExpression = [invalidComponentName]; - } - node.openingElement.name = - toJsxIdOrMemberExpression(jsxIdExpression); - if (node.closingElement) { - node.closingElement.name = - toJsxIdOrMemberExpression(jsxIdExpression); - } - } - } - }, - leave(node) { - const defaults = []; - const actual = []; - const parameters = []; - const declarations = []; - if (currentScope && currentScope.node === node) { - currentScope = currentScope.parent; - } - if ( - node.type === 'FunctionDeclaration' || - node.type === 'FunctionExpression' || - node.type === 'ArrowFunctionExpression' - ) { - const fn = node; - const scope = fnStack[fnStack.length - 1]; - let name2; - for (name2 of scope.tags) { - defaults.push({ - type: 'Property', - kind: 'init', - key: name(name2) - ? {type: 'Identifier', name: name2} - : {type: 'Literal', value: name2}, - value: {type: 'Literal', value: name2}, - method: false, - shorthand: false, - computed: false, - }); - } - actual.push(...scope.components); - for (name2 of scope.objects) { - if (!actual.includes(name2)) { - actual.push(name2); - } - } - const statements = []; - if ( - defaults.length > 0 || - actual.length > 0 || - scope.idToInvalidComponentName.size > 0 - ) { - if (providerImportSource) { - importProvider = true; - parameters.push({ - type: 'CallExpression', - callee: {type: 'Identifier', name: '_provideComponents'}, - arguments: [], - optional: false, - }); - } - if ( - isNamedFunction(scope.node, 'MDXContent') || - isNamedFunction(scope.node, '_createMdxContent') - ) { - parameters.push(toIdOrMemberExpression(['props', 'components'])); - } - if (defaults.length > 0 || parameters.length > 1) { - parameters.unshift({ - type: 'ObjectExpression', - properties: defaults, - }); - } - let componentsInit = - parameters.length > 1 - ? { - type: 'CallExpression', - callee: toIdOrMemberExpression(['Object', 'assign']), - arguments: parameters, - optional: false, - } - : parameters[0].type === 'MemberExpression' - ? { - type: 'LogicalExpression', - operator: '||', - left: parameters[0], - right: {type: 'ObjectExpression', properties: []}, - } - : parameters[0]; - let componentsPattern; - if (actual.length > 0) { - componentsPattern = { - type: 'ObjectPattern', - properties: actual.map((name3) => ({ - type: 'Property', - kind: 'init', - key: { - type: 'Identifier', - name: name3 === 'MDXLayout' ? 'wrapper' : name3, - }, - value: {type: 'Identifier', name: name3}, - method: false, - shorthand: name3 !== 'MDXLayout', - computed: false, - })), - }; - } - if (scope.tags.length > 0) { - declarations.push({ - type: 'VariableDeclarator', - id: {type: 'Identifier', name: '_components'}, - init: componentsInit, - }); - componentsInit = {type: 'Identifier', name: '_components'}; - } - if (isNamedFunction(scope.node, '_createMdxContent')) { - for (const [ - id, - componentName, - ] of scope.idToInvalidComponentName) { - declarations.push({ - type: 'VariableDeclarator', - id: {type: 'Identifier', name: componentName}, - init: { - type: 'MemberExpression', - object: {type: 'Identifier', name: '_components'}, - property: {type: 'Literal', value: id}, - computed: true, - optional: false, - }, - }); - } - } - if (componentsPattern) { - declarations.push({ - type: 'VariableDeclarator', - id: componentsPattern, - init: componentsInit, - }); - } - if (declarations.length > 0) { - statements.push({ - type: 'VariableDeclaration', - kind: 'const', - declarations, - }); - } - } - let key; - for (key in scope.references) { - if (own8.call(scope.references, key)) { - const parts = key.split('.'); - let index3 = 0; - while (++index3 < parts.length) { - const partial = parts.slice(0, index3).join('.'); - if (!own8.call(scope.references, partial)) { - scope.references[partial] = { - node: scope.references[key].node, - component: false, - }; - } - } - } - } - const references = Object.keys(scope.references).sort(); - let index2 = -1; - while (++index2 < references.length) { - const id = references[index2]; - const info = scope.references[id]; - const place = stringifyPosition(positionFromEstree(info.node)); - const parameters2 = [ - {type: 'Literal', value: id}, - {type: 'Literal', value: info.component}, - ]; - createErrorHelper = true; - if (development2 && place !== '1:1-1:1') { - parameters2.push({type: 'Literal', value: place}); - } - statements.push({ - type: 'IfStatement', - test: { - type: 'UnaryExpression', - operator: '!', - prefix: true, - argument: toIdOrMemberExpression(id.split('.')), - }, - consequent: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: {type: 'Identifier', name: '_missingMdxReference'}, - arguments: parameters2, - optional: false, - }, - }, - alternate: null, - }); - } - if (statements.length > 0) { - if (fn.body.type !== 'BlockStatement') { - fn.body = { - type: 'BlockStatement', - body: [{type: 'ReturnStatement', argument: fn.body}], - }; - } - fn.body.body.unshift(...statements); - } - fnStack.pop(); - } - }, - }); - if (importProvider && providerImportSource) { - tree.body.unshift( - createImportProvider(providerImportSource, outputFormat), - ); - } - if (createErrorHelper) { - const message = [ - {type: 'Literal', value: 'Expected '}, - { - type: 'ConditionalExpression', - test: {type: 'Identifier', name: 'component'}, - consequent: {type: 'Literal', value: 'component'}, - alternate: {type: 'Literal', value: 'object'}, - }, - {type: 'Literal', value: ' `'}, - {type: 'Identifier', name: 'id'}, - { - type: 'Literal', - value: - '` to be defined: you likely forgot to import, pass, or provide it.', - }, - ]; - const parameters = [ - {type: 'Identifier', name: 'id'}, - {type: 'Identifier', name: 'component'}, - ]; - if (development2) { - message.push({ - type: 'ConditionalExpression', - test: {type: 'Identifier', name: 'place'}, - consequent: toBinaryAddition([ - { - type: 'Literal', - value: '\nIt\u2019s referenced in your code at `', - }, - {type: 'Identifier', name: 'place'}, - { - type: 'Literal', - value: (file.path ? '` in `' + file.path : '') + '`', - }, - ]), - alternate: {type: 'Literal', value: ''}, - }); - parameters.push({type: 'Identifier', name: 'place'}); - } - tree.body.push({ - type: 'FunctionDeclaration', - id: {type: 'Identifier', name: '_missingMdxReference'}, - generator: false, - async: false, - params: parameters, - body: { - type: 'BlockStatement', - body: [ - { - type: 'ThrowStatement', - argument: { - type: 'NewExpression', - callee: {type: 'Identifier', name: 'Error'}, - arguments: [toBinaryAddition(message)], - }, - }, - ], - }, - }); - } - }; -} -function createImportProvider(providerImportSource, outputFormat) { - const specifiers = [ - { - type: 'ImportSpecifier', - imported: {type: 'Identifier', name: 'useMDXComponents'}, - local: {type: 'Identifier', name: '_provideComponents'}, - }, - ]; - return outputFormat === 'function-body' - ? { - type: 'VariableDeclaration', - kind: 'const', - declarations: specifiersToDeclarations( - specifiers, - toIdOrMemberExpression(['arguments', 0]), - ), - } - : { - type: 'ImportDeclaration', - specifiers, - source: {type: 'Literal', value: providerImportSource}, - }; -} -function isNamedFunction(node, name2) { - return Boolean(node && 'id' in node && node.id && node.id.name === name2); -} -function inScope(scope, id) { - let currentScope = scope; - while (currentScope) { - if (currentScope.declarations.has(id)) { - return true; - } - currentScope = currentScope.parent; - } - return false; -} - -// node_modules/astring/dist/astring.mjs -var {stringify} = JSON; -if (!String.prototype.repeat) { - throw new Error( - 'String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation', - ); -} -if (!String.prototype.endsWith) { - throw new Error( - 'String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation', - ); -} -var OPERATOR_PRECEDENCE = { - '||': 3, - '&&': 4, - '|': 5, - '??': 5, - '^': 6, - '&': 7, - '==': 8, - '!=': 8, - '===': 8, - '!==': 8, - '<': 9, - '>': 9, - '<=': 9, - '>=': 9, - in: 9, - instanceof: 9, - '<<': 10, - '>>': 10, - '>>>': 10, - '+': 11, - '-': 11, - '*': 12, - '%': 12, - '/': 12, - '**': 13, -}; -var NEEDS_PARENTHESES = 17; -var EXPRESSIONS_PRECEDENCE = { - ArrayExpression: 20, - TaggedTemplateExpression: 20, - ThisExpression: 20, - Identifier: 20, - PrivateIdentifier: 20, - Literal: 18, - TemplateLiteral: 20, - Super: 20, - SequenceExpression: 20, - MemberExpression: 19, - ChainExpression: 19, - CallExpression: 19, - NewExpression: 19, - ArrowFunctionExpression: NEEDS_PARENTHESES, - ClassExpression: NEEDS_PARENTHESES, - FunctionExpression: NEEDS_PARENTHESES, - ObjectExpression: NEEDS_PARENTHESES, - UpdateExpression: 16, - UnaryExpression: 15, - AwaitExpression: 15, - BinaryExpression: 14, - LogicalExpression: 13, - ConditionalExpression: 4, - AssignmentExpression: 3, - YieldExpression: 2, - RestElement: 1, -}; -function formatSequence(state, nodes) { - const {generator} = state; - state.write('('); - if (nodes != null && nodes.length > 0) { - generator[nodes[0].type](nodes[0], state); - const {length} = nodes; - for (let i = 1; i < length; i++) { - const param = nodes[i]; - state.write(', '); - generator[param.type](param, state); - } - } - state.write(')'); -} -function expressionNeedsParenthesis(state, node, parentNode, isRightHand) { - const nodePrecedence = state.expressionsPrecedence[node.type]; - if (nodePrecedence === NEEDS_PARENTHESES) { - return true; - } - const parentNodePrecedence = state.expressionsPrecedence[parentNode.type]; - if (nodePrecedence !== parentNodePrecedence) { - return ( - (!isRightHand && - nodePrecedence === 15 && - parentNodePrecedence === 14 && - parentNode.operator === '**') || - nodePrecedence < parentNodePrecedence - ); - } - if (nodePrecedence !== 13 && nodePrecedence !== 14) { - return false; - } - if (node.operator === '**' && parentNode.operator === '**') { - return !isRightHand; - } - if (isRightHand) { - return ( - OPERATOR_PRECEDENCE[node.operator] <= - OPERATOR_PRECEDENCE[parentNode.operator] - ); - } - return ( - OPERATOR_PRECEDENCE[node.operator] < - OPERATOR_PRECEDENCE[parentNode.operator] - ); -} -function formatExpression(state, node, parentNode, isRightHand) { - const {generator} = state; - if (expressionNeedsParenthesis(state, node, parentNode, isRightHand)) { - state.write('('); - generator[node.type](node, state); - state.write(')'); - } else { - generator[node.type](node, state); - } -} -function reindent(state, text5, indent, lineEnd) { - const lines = text5.split('\n'); - const end = lines.length - 1; - state.write(lines[0].trim()); - if (end > 0) { - state.write(lineEnd); - for (let i = 1; i < end; i++) { - state.write(indent + lines[i].trim() + lineEnd); - } - state.write(indent + lines[end].trim()); - } -} -function formatComments(state, comments, indent, lineEnd) { - const {length} = comments; - for (let i = 0; i < length; i++) { - const comment2 = comments[i]; - state.write(indent); - if (comment2.type[0] === 'L') { - state.write('// ' + comment2.value.trim() + '\n', comment2); - } else { - state.write('/*'); - reindent(state, comment2.value, indent, lineEnd); - state.write('*/' + lineEnd); - } - } -} -function hasCallExpression(node) { - let currentNode = node; - while (currentNode != null) { - const {type} = currentNode; - if (type[0] === 'C' && type[1] === 'a') { - return true; - } else if (type[0] === 'M' && type[1] === 'e' && type[2] === 'm') { - currentNode = currentNode.object; - } else { - return false; - } - } -} -function formatVariableDeclaration(state, node) { - const {generator} = state; - const {declarations} = node; - state.write(node.kind + ' '); - const {length} = declarations; - if (length > 0) { - generator.VariableDeclarator(declarations[0], state); - for (let i = 1; i < length; i++) { - state.write(', '); - generator.VariableDeclarator(declarations[i], state); - } - } -} -var ForInStatement; -var FunctionDeclaration; -var RestElement; -var BinaryExpression; -var ArrayExpression; -var BlockStatement; -var GENERATOR = { - Program(node, state) { - const indent = state.indent.repeat(state.indentLevel); - const {lineEnd, writeComments} = state; - if (writeComments && node.comments != null) { - formatComments(state, node.comments, indent, lineEnd); - } - const statements = node.body; - const {length} = statements; - for (let i = 0; i < length; i++) { - const statement = statements[i]; - if (writeComments && statement.comments != null) { - formatComments(state, statement.comments, indent, lineEnd); - } - state.write(indent); - this[statement.type](statement, state); - state.write(lineEnd); - } - if (writeComments && node.trailingComments != null) { - formatComments(state, node.trailingComments, indent, lineEnd); - } - }, - BlockStatement: (BlockStatement = function (node, state) { - const indent = state.indent.repeat(state.indentLevel++); - const {lineEnd, writeComments} = state; - const statementIndent = indent + state.indent; - state.write('{'); - const statements = node.body; - if (statements != null && statements.length > 0) { - state.write(lineEnd); - if (writeComments && node.comments != null) { - formatComments(state, node.comments, statementIndent, lineEnd); - } - const {length} = statements; - for (let i = 0; i < length; i++) { - const statement = statements[i]; - if (writeComments && statement.comments != null) { - formatComments(state, statement.comments, statementIndent, lineEnd); - } - state.write(statementIndent); - this[statement.type](statement, state); - state.write(lineEnd); - } - state.write(indent); - } else { - if (writeComments && node.comments != null) { - state.write(lineEnd); - formatComments(state, node.comments, statementIndent, lineEnd); - state.write(indent); - } - } - if (writeComments && node.trailingComments != null) { - formatComments(state, node.trailingComments, statementIndent, lineEnd); - } - state.write('}'); - state.indentLevel--; - }), - ClassBody: BlockStatement, - StaticBlock(node, state) { - state.write('static '); - this.BlockStatement(node, state); - }, - EmptyStatement(node, state) { - state.write(';'); - }, - ExpressionStatement(node, state) { - const precedence = state.expressionsPrecedence[node.expression.type]; - if ( - precedence === NEEDS_PARENTHESES || - (precedence === 3 && node.expression.left.type[0] === 'O') - ) { - state.write('('); - this[node.expression.type](node.expression, state); - state.write(')'); - } else { - this[node.expression.type](node.expression, state); - } - state.write(';'); - }, - IfStatement(node, state) { - state.write('if ('); - this[node.test.type](node.test, state); - state.write(') '); - this[node.consequent.type](node.consequent, state); - if (node.alternate != null) { - state.write(' else '); - this[node.alternate.type](node.alternate, state); - } - }, - LabeledStatement(node, state) { - this[node.label.type](node.label, state); - state.write(': '); - this[node.body.type](node.body, state); - }, - BreakStatement(node, state) { - state.write('break'); - if (node.label != null) { - state.write(' '); - this[node.label.type](node.label, state); - } - state.write(';'); - }, - ContinueStatement(node, state) { - state.write('continue'); - if (node.label != null) { - state.write(' '); - this[node.label.type](node.label, state); - } - state.write(';'); - }, - WithStatement(node, state) { - state.write('with ('); - this[node.object.type](node.object, state); - state.write(') '); - this[node.body.type](node.body, state); - }, - SwitchStatement(node, state) { - const indent = state.indent.repeat(state.indentLevel++); - const {lineEnd, writeComments} = state; - state.indentLevel++; - const caseIndent = indent + state.indent; - const statementIndent = caseIndent + state.indent; - state.write('switch ('); - this[node.discriminant.type](node.discriminant, state); - state.write(') {' + lineEnd); - const {cases: occurences} = node; - const {length: occurencesCount} = occurences; - for (let i = 0; i < occurencesCount; i++) { - const occurence = occurences[i]; - if (writeComments && occurence.comments != null) { - formatComments(state, occurence.comments, caseIndent, lineEnd); - } - if (occurence.test) { - state.write(caseIndent + 'case '); - this[occurence.test.type](occurence.test, state); - state.write(':' + lineEnd); - } else { - state.write(caseIndent + 'default:' + lineEnd); - } - const {consequent} = occurence; - const {length: consequentCount} = consequent; - for (let i2 = 0; i2 < consequentCount; i2++) { - const statement = consequent[i2]; - if (writeComments && statement.comments != null) { - formatComments(state, statement.comments, statementIndent, lineEnd); - } - state.write(statementIndent); - this[statement.type](statement, state); - state.write(lineEnd); - } - } - state.indentLevel -= 2; - state.write(indent + '}'); - }, - ReturnStatement(node, state) { - state.write('return'); - if (node.argument) { - state.write(' '); - this[node.argument.type](node.argument, state); - } - state.write(';'); - }, - ThrowStatement(node, state) { - state.write('throw '); - this[node.argument.type](node.argument, state); - state.write(';'); - }, - TryStatement(node, state) { - state.write('try '); - this[node.block.type](node.block, state); - if (node.handler) { - const {handler} = node; - if (handler.param == null) { - state.write(' catch '); - } else { - state.write(' catch ('); - this[handler.param.type](handler.param, state); - state.write(') '); - } - this[handler.body.type](handler.body, state); - } - if (node.finalizer) { - state.write(' finally '); - this[node.finalizer.type](node.finalizer, state); - } - }, - WhileStatement(node, state) { - state.write('while ('); - this[node.test.type](node.test, state); - state.write(') '); - this[node.body.type](node.body, state); - }, - DoWhileStatement(node, state) { - state.write('do '); - this[node.body.type](node.body, state); - state.write(' while ('); - this[node.test.type](node.test, state); - state.write(');'); - }, - ForStatement(node, state) { - state.write('for ('); - if (node.init != null) { - const {init} = node; - if (init.type[0] === 'V') { - formatVariableDeclaration(state, init); - } else { - this[init.type](init, state); - } - } - state.write('; '); - if (node.test) { - this[node.test.type](node.test, state); - } - state.write('; '); - if (node.update) { - this[node.update.type](node.update, state); - } - state.write(') '); - this[node.body.type](node.body, state); - }, - ForInStatement: (ForInStatement = function (node, state) { - state.write(`for ${node.await ? 'await ' : ''}(`); - const {left} = node; - if (left.type[0] === 'V') { - formatVariableDeclaration(state, left); - } else { - this[left.type](left, state); - } - state.write(node.type[3] === 'I' ? ' in ' : ' of '); - this[node.right.type](node.right, state); - state.write(') '); - this[node.body.type](node.body, state); - }), - ForOfStatement: ForInStatement, - DebuggerStatement(node, state) { - state.write('debugger;', node); - }, - FunctionDeclaration: (FunctionDeclaration = function (node, state) { - state.write( - (node.async ? 'async ' : '') + - (node.generator ? 'function* ' : 'function ') + - (node.id ? node.id.name : ''), - node, - ); - formatSequence(state, node.params); - state.write(' '); - this[node.body.type](node.body, state); - }), - FunctionExpression: FunctionDeclaration, - VariableDeclaration(node, state) { - formatVariableDeclaration(state, node); - state.write(';'); - }, - VariableDeclarator(node, state) { - this[node.id.type](node.id, state); - if (node.init != null) { - state.write(' = '); - this[node.init.type](node.init, state); - } - }, - ClassDeclaration(node, state) { - state.write('class ' + (node.id ? `${node.id.name} ` : ''), node); - if (node.superClass) { - state.write('extends '); - const {superClass} = node; - const {type} = superClass; - const precedence = state.expressionsPrecedence[type]; - if ( - (type[0] !== 'C' || type[1] !== 'l' || type[5] !== 'E') && - (precedence === NEEDS_PARENTHESES || - precedence < state.expressionsPrecedence.ClassExpression) - ) { - state.write('('); - this[node.superClass.type](superClass, state); - state.write(')'); - } else { - this[superClass.type](superClass, state); - } - state.write(' '); - } - this.ClassBody(node.body, state); - }, - ImportDeclaration(node, state) { - state.write('import '); - const {specifiers} = node; - const {length} = specifiers; - let i = 0; - if (length > 0) { - for (; i < length; ) { - if (i > 0) { - state.write(', '); - } - const specifier = specifiers[i]; - const type = specifier.type[6]; - if (type === 'D') { - state.write(specifier.local.name, specifier); - i++; - } else if (type === 'N') { - state.write('* as ' + specifier.local.name, specifier); - i++; - } else { - break; - } - } - if (i < length) { - state.write('{'); - for (;;) { - const specifier = specifiers[i]; - const {name: name2} = specifier.imported; - state.write(name2, specifier); - if (name2 !== specifier.local.name) { - state.write(' as ' + specifier.local.name); - } - if (++i < length) { - state.write(', '); - } else { - break; - } - } - state.write('}'); - } - state.write(' from '); - } - this.Literal(node.source, state); - state.write(';'); - }, - ImportExpression(node, state) { - state.write('import('); - this[node.source.type](node.source, state); - state.write(')'); - }, - ExportDefaultDeclaration(node, state) { - state.write('export default '); - this[node.declaration.type](node.declaration, state); - if ( - state.expressionsPrecedence[node.declaration.type] != null && - node.declaration.type[0] !== 'F' - ) { - state.write(';'); - } - }, - ExportNamedDeclaration(node, state) { - state.write('export '); - if (node.declaration) { - this[node.declaration.type](node.declaration, state); - } else { - state.write('{'); - const {specifiers} = node, - {length} = specifiers; - if (length > 0) { - for (let i = 0; ; ) { - const specifier = specifiers[i]; - const {name: name2} = specifier.local; - state.write(name2, specifier); - if (name2 !== specifier.exported.name) { - state.write(' as ' + specifier.exported.name); - } - if (++i < length) { - state.write(', '); - } else { - break; - } - } - } - state.write('}'); - if (node.source) { - state.write(' from '); - this.Literal(node.source, state); - } - state.write(';'); - } - }, - ExportAllDeclaration(node, state) { - if (node.exported != null) { - state.write('export * as ' + node.exported.name + ' from '); - } else { - state.write('export * from '); - } - this.Literal(node.source, state); - state.write(';'); - }, - MethodDefinition(node, state) { - if (node.static) { - state.write('static '); - } - const kind = node.kind[0]; - if (kind === 'g' || kind === 's') { - state.write(node.kind + ' '); - } - if (node.value.async) { - state.write('async '); - } - if (node.value.generator) { - state.write('*'); - } - if (node.computed) { - state.write('['); - this[node.key.type](node.key, state); - state.write(']'); - } else { - this[node.key.type](node.key, state); - } - formatSequence(state, node.value.params); - state.write(' '); - this[node.value.body.type](node.value.body, state); - }, - ClassExpression(node, state) { - this.ClassDeclaration(node, state); - }, - ArrowFunctionExpression(node, state) { - state.write(node.async ? 'async ' : '', node); - const {params} = node; - if (params != null) { - if (params.length === 1 && params[0].type[0] === 'I') { - state.write(params[0].name, params[0]); - } else { - formatSequence(state, node.params); - } - } - state.write(' => '); - if (node.body.type[0] === 'O') { - state.write('('); - this.ObjectExpression(node.body, state); - state.write(')'); - } else { - this[node.body.type](node.body, state); - } - }, - ThisExpression(node, state) { - state.write('this', node); - }, - Super(node, state) { - state.write('super', node); - }, - RestElement: (RestElement = function (node, state) { - state.write('...'); - this[node.argument.type](node.argument, state); - }), - SpreadElement: RestElement, - YieldExpression(node, state) { - state.write(node.delegate ? 'yield*' : 'yield'); - if (node.argument) { - state.write(' '); - this[node.argument.type](node.argument, state); - } - }, - AwaitExpression(node, state) { - state.write('await ', node); - formatExpression(state, node.argument, node); - }, - TemplateLiteral(node, state) { - const {quasis, expressions} = node; - state.write('`'); - const {length} = expressions; - for (let i = 0; i < length; i++) { - const expression = expressions[i]; - const quasi2 = quasis[i]; - state.write(quasi2.value.raw, quasi2); - state.write('${'); - this[expression.type](expression, state); - state.write('}'); - } - const quasi = quasis[quasis.length - 1]; - state.write(quasi.value.raw, quasi); - state.write('`'); - }, - TemplateElement(node, state) { - state.write(node.value.raw, node); - }, - TaggedTemplateExpression(node, state) { - formatExpression(state, node.tag, node); - this[node.quasi.type](node.quasi, state); - }, - ArrayExpression: (ArrayExpression = function (node, state) { - state.write('['); - if (node.elements.length > 0) { - const {elements} = node, - {length} = elements; - for (let i = 0; ; ) { - const element2 = elements[i]; - if (element2 != null) { - this[element2.type](element2, state); - } - if (++i < length) { - state.write(', '); - } else { - if (element2 == null) { - state.write(', '); - } - break; - } - } - } - state.write(']'); - }), - ArrayPattern: ArrayExpression, - ObjectExpression(node, state) { - const indent = state.indent.repeat(state.indentLevel++); - const {lineEnd, writeComments} = state; - const propertyIndent = indent + state.indent; - state.write('{'); - if (node.properties.length > 0) { - state.write(lineEnd); - if (writeComments && node.comments != null) { - formatComments(state, node.comments, propertyIndent, lineEnd); - } - const comma = ',' + lineEnd; - const {properties} = node, - {length} = properties; - for (let i = 0; ; ) { - const property = properties[i]; - if (writeComments && property.comments != null) { - formatComments(state, property.comments, propertyIndent, lineEnd); - } - state.write(propertyIndent); - this[property.type](property, state); - if (++i < length) { - state.write(comma); - } else { - break; - } - } - state.write(lineEnd); - if (writeComments && node.trailingComments != null) { - formatComments(state, node.trailingComments, propertyIndent, lineEnd); - } - state.write(indent + '}'); - } else if (writeComments) { - if (node.comments != null) { - state.write(lineEnd); - formatComments(state, node.comments, propertyIndent, lineEnd); - if (node.trailingComments != null) { - formatComments(state, node.trailingComments, propertyIndent, lineEnd); - } - state.write(indent + '}'); - } else if (node.trailingComments != null) { - state.write(lineEnd); - formatComments(state, node.trailingComments, propertyIndent, lineEnd); - state.write(indent + '}'); - } else { - state.write('}'); - } - } else { - state.write('}'); - } - state.indentLevel--; - }, - Property(node, state) { - if (node.method || node.kind[0] !== 'i') { - this.MethodDefinition(node, state); - } else { - if (!node.shorthand) { - if (node.computed) { - state.write('['); - this[node.key.type](node.key, state); - state.write(']'); - } else { - this[node.key.type](node.key, state); - } - state.write(': '); - } - this[node.value.type](node.value, state); - } - }, - PropertyDefinition(node, state) { - if (node.static) { - state.write('static '); - } - this[node.key.type](node.key, state); - if (node.value == null) { - return; - } - state.write(' = '); - this[node.value.type](node.value, state); - }, - ObjectPattern(node, state) { - state.write('{'); - if (node.properties.length > 0) { - const {properties} = node, - {length} = properties; - for (let i = 0; ; ) { - this[properties[i].type](properties[i], state); - if (++i < length) { - state.write(', '); - } else { - break; - } - } - } - state.write('}'); - }, - SequenceExpression(node, state) { - formatSequence(state, node.expressions); - }, - UnaryExpression(node, state) { - if (node.prefix) { - const { - operator, - argument, - argument: {type}, - } = node; - state.write(operator); - const needsParentheses = expressionNeedsParenthesis( - state, - argument, - node, - ); - if ( - !needsParentheses && - (operator.length > 1 || - (type[0] === 'U' && - (type[1] === 'n' || type[1] === 'p') && - argument.prefix && - argument.operator[0] === operator && - (operator === '+' || operator === '-'))) - ) { - state.write(' '); - } - if (needsParentheses) { - state.write(operator.length > 1 ? ' (' : '('); - this[type](argument, state); - state.write(')'); - } else { - this[type](argument, state); - } - } else { - this[node.argument.type](node.argument, state); - state.write(node.operator); - } - }, - UpdateExpression(node, state) { - if (node.prefix) { - state.write(node.operator); - this[node.argument.type](node.argument, state); - } else { - this[node.argument.type](node.argument, state); - state.write(node.operator); - } - }, - AssignmentExpression(node, state) { - this[node.left.type](node.left, state); - state.write(' ' + node.operator + ' '); - this[node.right.type](node.right, state); - }, - AssignmentPattern(node, state) { - this[node.left.type](node.left, state); - state.write(' = '); - this[node.right.type](node.right, state); - }, - BinaryExpression: (BinaryExpression = function (node, state) { - const isIn = node.operator === 'in'; - if (isIn) { - state.write('('); - } - formatExpression(state, node.left, node, false); - state.write(' ' + node.operator + ' '); - formatExpression(state, node.right, node, true); - if (isIn) { - state.write(')'); - } - }), - LogicalExpression: BinaryExpression, - ConditionalExpression(node, state) { - const {test} = node; - const precedence = state.expressionsPrecedence[test.type]; - if ( - precedence === NEEDS_PARENTHESES || - precedence <= state.expressionsPrecedence.ConditionalExpression - ) { - state.write('('); - this[test.type](test, state); - state.write(')'); - } else { - this[test.type](test, state); - } - state.write(' ? '); - this[node.consequent.type](node.consequent, state); - state.write(' : '); - this[node.alternate.type](node.alternate, state); - }, - NewExpression(node, state) { - state.write('new '); - const precedence = state.expressionsPrecedence[node.callee.type]; - if ( - precedence === NEEDS_PARENTHESES || - precedence < state.expressionsPrecedence.CallExpression || - hasCallExpression(node.callee) - ) { - state.write('('); - this[node.callee.type](node.callee, state); - state.write(')'); - } else { - this[node.callee.type](node.callee, state); - } - formatSequence(state, node['arguments']); - }, - CallExpression(node, state) { - const precedence = state.expressionsPrecedence[node.callee.type]; - if ( - precedence === NEEDS_PARENTHESES || - precedence < state.expressionsPrecedence.CallExpression - ) { - state.write('('); - this[node.callee.type](node.callee, state); - state.write(')'); - } else { - this[node.callee.type](node.callee, state); - } - if (node.optional) { - state.write('?.'); - } - formatSequence(state, node['arguments']); - }, - ChainExpression(node, state) { - this[node.expression.type](node.expression, state); - }, - MemberExpression(node, state) { - const precedence = state.expressionsPrecedence[node.object.type]; - if ( - precedence === NEEDS_PARENTHESES || - precedence < state.expressionsPrecedence.MemberExpression - ) { - state.write('('); - this[node.object.type](node.object, state); - state.write(')'); - } else { - this[node.object.type](node.object, state); - } - if (node.computed) { - if (node.optional) { - state.write('?.'); - } - state.write('['); - this[node.property.type](node.property, state); - state.write(']'); - } else { - if (node.optional) { - state.write('?.'); - } else { - state.write('.'); - } - this[node.property.type](node.property, state); - } - }, - MetaProperty(node, state) { - state.write(node.meta.name + '.' + node.property.name, node); - }, - Identifier(node, state) { - state.write(node.name, node); - }, - PrivateIdentifier(node, state) { - state.write(`#${node.name}`, node); - }, - Literal(node, state) { - if (node.raw != null) { - state.write(node.raw, node); - } else if (node.regex != null) { - this.RegExpLiteral(node, state); - } else if (node.bigint != null) { - state.write(node.bigint + 'n', node); - } else { - state.write(stringify(node.value), node); - } - }, - RegExpLiteral(node, state) { - const {regex: regex2} = node; - state.write(`/${regex2.pattern}/${regex2.flags}`, node); - }, -}; -var EMPTY_OBJECT = {}; -var State = class { - constructor(options) { - const setup = options == null ? EMPTY_OBJECT : options; - this.output = ''; - if (setup.output != null) { - this.output = setup.output; - this.write = this.writeToStream; - } else { - this.output = ''; - } - this.generator = setup.generator != null ? setup.generator : GENERATOR; - this.expressionsPrecedence = - setup.expressionsPrecedence != null - ? setup.expressionsPrecedence - : EXPRESSIONS_PRECEDENCE; - this.indent = setup.indent != null ? setup.indent : ' '; - this.lineEnd = setup.lineEnd != null ? setup.lineEnd : '\n'; - this.indentLevel = - setup.startingIndentLevel != null ? setup.startingIndentLevel : 0; - this.writeComments = setup.comments ? setup.comments : false; - if (setup.sourceMap != null) { - this.write = - setup.output == null ? this.writeAndMap : this.writeToStreamAndMap; - this.sourceMap = setup.sourceMap; - this.line = 1; - this.column = 0; - this.lineEndSize = this.lineEnd.split('\n').length - 1; - this.mapping = { - original: null, - generated: this, - name: void 0, - source: setup.sourceMap.file || setup.sourceMap._file, - }; - } - } - write(code2) { - this.output += code2; - } - writeToStream(code2) { - this.output.write(code2); - } - writeAndMap(code2, node) { - this.output += code2; - this.map(code2, node); - } - writeToStreamAndMap(code2, node) { - this.output.write(code2); - this.map(code2, node); - } - map(code2, node) { - if (node != null) { - const {type} = node; - if (type[0] === 'L' && type[2] === 'n') { - this.column = 0; - this.line++; - return; - } - if (node.loc != null) { - const {mapping} = this; - mapping.original = node.loc.start; - mapping.name = node.name; - this.sourceMap.addMapping(mapping); - } - if ( - (type[0] === 'T' && type[8] === 'E') || - (type[0] === 'L' && type[1] === 'i' && typeof node.value === 'string') - ) { - const {length: length2} = code2; - let {column, line} = this; - for (let i = 0; i < length2; i++) { - if (code2[i] === '\n') { - column = 0; - line++; - } else { - column++; - } - } - this.column = column; - this.line = line; - return; - } - } - const {length} = code2; - const {lineEnd} = this; - if (length > 0) { - if ( - this.lineEndSize > 0 && - (lineEnd.length === 1 - ? code2[length - 1] === lineEnd - : code2.endsWith(lineEnd)) - ) { - this.line += this.lineEndSize; - this.column = 0; - } else { - this.column += length; - } - } - } - toString() { - return this.output; - } -}; -function generate(node, options) { - const state = new State(options); - state.generator[node.type](node, state); - return state.output; -} - -// node_modules/estree-util-to-js/lib/index.js -var toJs = function (tree, options = {}) { - const {SourceMapGenerator, filePath, handlers: handlers2} = options; - const sourceMap = SourceMapGenerator - ? new SourceMapGenerator({file: filePath || '.js'}) - : void 0; - const value = generate(tree, { - comments: true, - generator: {...GENERATOR, ...handlers2}, - sourceMap, - }); - const map = sourceMap ? sourceMap.toJSON() : void 0; - return {value, map}; -}; - -// node_modules/estree-util-to-js/lib/jsx.js -var jsx = { - JSXAttribute, - JSXClosingElement, - JSXClosingFragment, - JSXElement, - JSXEmptyExpression, - JSXExpressionContainer, - JSXFragment, - JSXIdentifier, - JSXMemberExpression, - JSXNamespacedName, - JSXOpeningElement, - JSXOpeningFragment, - JSXSpreadAttribute, - JSXText, -}; -function JSXAttribute(node, state) { - this[node.name.type](node.name, state); - if (node.value !== void 0 && node.value !== null) { - state.write('='); - if (node.value.type === 'Literal') { - state.write( - '"' + encodeJsx(String(node.value.value)).replace(/"/g, '"') + '"', - node, - ); - } else { - this[node.value.type](node.value, state); - } - } -} -function JSXClosingElement(node, state) { - state.write(''); -} -function JSXClosingFragment(node, state) { - state.write('', node); -} -function JSXElement(node, state) { - let index2 = -1; - this[node.openingElement.type](node.openingElement, state); - if (node.children) { - while (++index2 < node.children.length) { - const child = node.children[index2]; - if (child.type === 'JSXSpreadChild') { - throw new Error('JSX spread children are not supported'); - } - this[child.type](child, state); - } - } - if (node.closingElement) { - this[node.closingElement.type](node.closingElement, state); - } -} -function JSXEmptyExpression() {} -function JSXExpressionContainer(node, state) { - state.write('{'); - this[node.expression.type](node.expression, state); - state.write('}'); -} -function JSXFragment(node, state) { - let index2 = -1; - this[node.openingFragment.type](node.openingFragment, state); - if (node.children) { - while (++index2 < node.children.length) { - const child = node.children[index2]; - if (child.type === 'JSXSpreadChild') { - throw new Error('JSX spread children are not supported'); - } - this[child.type](child, state); - } - } - this[node.closingFragment.type](node.closingFragment, state); -} -function JSXIdentifier(node, state) { - state.write(node.name, node); -} -function JSXMemberExpression(node, state) { - this[node.object.type](node.object, state); - state.write('.'); - this[node.property.type](node.property, state); -} -function JSXNamespacedName(node, state) { - this[node.namespace.type](node.namespace, state); - state.write(':'); - this[node.name.type](node.name, state); -} -function JSXOpeningElement(node, state) { - let index2 = -1; - state.write('<'); - this[node.name.type](node.name, state); - if (node.attributes) { - while (++index2 < node.attributes.length) { - state.write(' '); - this[node.attributes[index2].type](node.attributes[index2], state); - } - } - state.write(node.selfClosing ? ' />' : '>'); -} -function JSXOpeningFragment(node, state) { - state.write('<>', node); -} -function JSXSpreadAttribute(node, state) { - state.write('{'); - this.SpreadElement(node, state); - state.write('}'); -} -function JSXText(node, state) { - state.write( - encodeJsx(node.value).replace(/[<>{}]/g, ($0) => - $0 === '<' - ? '<' - : $0 === '>' - ? '>' - : $0 === '{' - ? '{' - : '}', - ), - node, - ); -} -function encodeJsx(value) { - return value.replace(/&(?=[#a-z])/gi, '&'); -} - -// node_modules/@mdx-js/mdx/lib/plugin/recma-stringify.js -function recmaStringify(options = {}) { - const {SourceMapGenerator} = options; - Object.assign(this, {Compiler: compiler2}); - function compiler2(tree, file) { - const result = SourceMapGenerator - ? toJs(tree, { - filePath: file.path || 'unknown.mdx', - SourceMapGenerator, - handlers: jsx, - }) - : toJs(tree, {handlers: jsx}); - file.map = result.map; - return result.value; - } -} - -// node_modules/hast-util-to-estree/node_modules/comma-separated-tokens/index.js -function stringify2(values, options) { - var settings = options || {}; - if (values[values.length - 1] === '') { - values = values.concat(''); - } - return values - .join( - (settings.padRight ? ' ' : '') + - ',' + - (settings.padLeft === false ? '' : ' '), - ) - .trim(); -} - -// node_modules/estree-util-attach-comments/index.js -var own9 = {}.hasOwnProperty; -function attachComments(tree, comments) { - const list3 = (comments || []).concat().sort(compare); - if (list3.length > 0) walk2(tree, {comments: list3, index: 0}); - return tree; -} -function walk2(node, state) { - if (state.index === state.comments.length) { - return; - } - const children = []; - const comments = []; - let key; - for (key in node) { - if (own9.call(node, key)) { - const value = node[key]; - if (value && typeof value === 'object' && key !== 'comments') { - if (Array.isArray(value)) { - let index3 = -1; - while (++index3 < value.length) { - if (value[index3] && typeof value[index3].type === 'string') { - children.push(value[index3]); - } - } - } else if (typeof value.type === 'string') { - children.push(value); - } - } - } - } - children.sort(compare); - comments.push(...slice(state, node, false, {leading: true, trailing: false})); - let index2 = -1; - while (++index2 < children.length) { - walk2(children[index2], state); - } - comments.push( - ...slice(state, node, true, { - leading: false, - trailing: children.length > 0, - }), - ); - if (comments.length > 0) { - node.comments = comments; - } -} -function slice(state, node, compareEnd, fields) { - const result = []; - while ( - state.comments[state.index] && - compare(state.comments[state.index], node, compareEnd) < 1 - ) { - result.push(Object.assign({}, state.comments[state.index++], fields)); - } - return result; -} -function compare(left, right, compareEnd) { - const field = compareEnd ? 'end' : 'start'; - if (left.range && right.range) { - return left.range[0] - right.range[compareEnd ? 1 : 0]; - } - if (left.loc && left.loc.start && right.loc && right.loc[field]) { - return ( - left.loc.start.line - right.loc[field].line || - left.loc.start.column - right.loc[field].column - ); - } - if ('start' in left && field in right) { - return left.start - right[field]; - } - return Number.NaN; -} - -// node_modules/hast-util-to-estree/node_modules/hast-util-whitespace/index.js -function whitespace(thing) { - var value = - thing && typeof thing === 'object' && thing.type === 'text' - ? thing.value || '' - : thing; - return typeof value === 'string' && value.replace(/[ \t\n\f\r]/g, '') === ''; -} - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/schema.js -var Schema = class { - constructor(property, normal, space2) { - this.property = property; - this.normal = normal; - if (space2) { - this.space = space2; - } - } -}; -Schema.prototype.property = {}; -Schema.prototype.normal = {}; -Schema.prototype.space = null; - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/merge.js -function merge(definitions2, space2) { - const property = {}; - const normal = {}; - let index2 = -1; - while (++index2 < definitions2.length) { - Object.assign(property, definitions2[index2].property); - Object.assign(normal, definitions2[index2].normal); - } - return new Schema(property, normal, space2); -} - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/normalize.js -function normalize(value) { - return value.toLowerCase(); -} - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/info.js -var Info = class { - constructor(property, attribute) { - this.property = property; - this.attribute = attribute; - } -}; -Info.prototype.space = null; -Info.prototype.boolean = false; -Info.prototype.booleanish = false; -Info.prototype.overloadedBoolean = false; -Info.prototype.number = false; -Info.prototype.commaSeparated = false; -Info.prototype.spaceSeparated = false; -Info.prototype.commaOrSpaceSeparated = false; -Info.prototype.mustUseProperty = false; -Info.prototype.defined = false; - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/types.js -var types_exports = {}; -__export(types_exports, { - boolean: () => boolean, - booleanish: () => booleanish, - commaOrSpaceSeparated: () => commaOrSpaceSeparated, - commaSeparated: () => commaSeparated, - number: () => number, - overloadedBoolean: () => overloadedBoolean, - spaceSeparated: () => spaceSeparated, -}); -var powers = 0; -var boolean = increment(); -var booleanish = increment(); -var overloadedBoolean = increment(); -var number = increment(); -var spaceSeparated = increment(); -var commaSeparated = increment(); -var commaOrSpaceSeparated = increment(); -function increment() { - return 2 ** ++powers; -} - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/defined-info.js -var checks = Object.keys(types_exports); -var DefinedInfo = class extends Info { - constructor(property, attribute, mask, space2) { - let index2 = -1; - super(property, attribute); - mark(this, 'space', space2); - if (typeof mask === 'number') { - while (++index2 < checks.length) { - const check = checks[index2]; - mark( - this, - checks[index2], - (mask & types_exports[check]) === types_exports[check], - ); - } - } - } -}; -DefinedInfo.prototype.defined = true; -function mark(values, key, value) { - if (value) { - values[key] = value; - } -} - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/create.js -var own10 = {}.hasOwnProperty; -function create3(definition2) { - const property = {}; - const normal = {}; - let prop; - for (prop in definition2.properties) { - if (own10.call(definition2.properties, prop)) { - const value = definition2.properties[prop]; - const info = new DefinedInfo( - prop, - definition2.transform(definition2.attributes || {}, prop), - value, - definition2.space, - ); - if ( - definition2.mustUseProperty && - definition2.mustUseProperty.includes(prop) - ) { - info.mustUseProperty = true; - } - property[prop] = info; - normal[normalize(prop)] = prop; - normal[normalize(info.attribute)] = prop; - } - } - return new Schema(property, normal, definition2.space); -} - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/xlink.js -var xlink = create3({ - space: 'xlink', - transform(_, prop) { - return 'xlink:' + prop.slice(5).toLowerCase(); - }, - properties: { - xLinkActuate: null, - xLinkArcRole: null, - xLinkHref: null, - xLinkRole: null, - xLinkShow: null, - xLinkTitle: null, - xLinkType: null, - }, -}); - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/xml.js -var xml = create3({ - space: 'xml', - transform(_, prop) { - return 'xml:' + prop.slice(3).toLowerCase(); - }, - properties: {xmlLang: null, xmlBase: null, xmlSpace: null}, -}); - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/case-sensitive-transform.js -function caseSensitiveTransform(attributes, attribute) { - return attribute in attributes ? attributes[attribute] : attribute; -} - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/case-insensitive-transform.js -function caseInsensitiveTransform(attributes, property) { - return caseSensitiveTransform(attributes, property.toLowerCase()); -} - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/xmlns.js -var xmlns = create3({ - space: 'xmlns', - attributes: {xmlnsxlink: 'xmlns:xlink'}, - transform: caseInsensitiveTransform, - properties: {xmlns: null, xmlnsXLink: null}, -}); - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/aria.js -var aria = create3({ - transform(_, prop) { - return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase(); - }, - properties: { - ariaActiveDescendant: null, - ariaAtomic: booleanish, - ariaAutoComplete: null, - ariaBusy: booleanish, - ariaChecked: booleanish, - ariaColCount: number, - ariaColIndex: number, - ariaColSpan: number, - ariaControls: spaceSeparated, - ariaCurrent: null, - ariaDescribedBy: spaceSeparated, - ariaDetails: null, - ariaDisabled: booleanish, - ariaDropEffect: spaceSeparated, - ariaErrorMessage: null, - ariaExpanded: booleanish, - ariaFlowTo: spaceSeparated, - ariaGrabbed: booleanish, - ariaHasPopup: null, - ariaHidden: booleanish, - ariaInvalid: null, - ariaKeyShortcuts: null, - ariaLabel: null, - ariaLabelledBy: spaceSeparated, - ariaLevel: number, - ariaLive: null, - ariaModal: booleanish, - ariaMultiLine: booleanish, - ariaMultiSelectable: booleanish, - ariaOrientation: null, - ariaOwns: spaceSeparated, - ariaPlaceholder: null, - ariaPosInSet: number, - ariaPressed: booleanish, - ariaReadOnly: booleanish, - ariaRelevant: null, - ariaRequired: booleanish, - ariaRoleDescription: spaceSeparated, - ariaRowCount: number, - ariaRowIndex: number, - ariaRowSpan: number, - ariaSelected: booleanish, - ariaSetSize: number, - ariaSort: null, - ariaValueMax: number, - ariaValueMin: number, - ariaValueNow: number, - ariaValueText: null, - role: null, - }, -}); - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/html.js -var html2 = create3({ - space: 'html', - attributes: { - acceptcharset: 'accept-charset', - classname: 'class', - htmlfor: 'for', - httpequiv: 'http-equiv', - }, - transform: caseInsensitiveTransform, - mustUseProperty: ['checked', 'multiple', 'muted', 'selected'], - properties: { - abbr: null, - accept: commaSeparated, - acceptCharset: spaceSeparated, - accessKey: spaceSeparated, - action: null, - allow: null, - allowFullScreen: boolean, - allowPaymentRequest: boolean, - allowUserMedia: boolean, - alt: null, - as: null, - async: boolean, - autoCapitalize: null, - autoComplete: spaceSeparated, - autoFocus: boolean, - autoPlay: boolean, - capture: boolean, - charSet: null, - checked: boolean, - cite: null, - className: spaceSeparated, - cols: number, - colSpan: null, - content: null, - contentEditable: booleanish, - controls: boolean, - controlsList: spaceSeparated, - coords: number | commaSeparated, - crossOrigin: null, - data: null, - dateTime: null, - decoding: null, - default: boolean, - defer: boolean, - dir: null, - dirName: null, - disabled: boolean, - download: overloadedBoolean, - draggable: booleanish, - encType: null, - enterKeyHint: null, - form: null, - formAction: null, - formEncType: null, - formMethod: null, - formNoValidate: boolean, - formTarget: null, - headers: spaceSeparated, - height: number, - hidden: boolean, - high: number, - href: null, - hrefLang: null, - htmlFor: spaceSeparated, - httpEquiv: spaceSeparated, - id: null, - imageSizes: null, - imageSrcSet: null, - inputMode: null, - integrity: null, - is: null, - isMap: boolean, - itemId: null, - itemProp: spaceSeparated, - itemRef: spaceSeparated, - itemScope: boolean, - itemType: spaceSeparated, - kind: null, - label: null, - lang: null, - language: null, - list: null, - loading: null, - loop: boolean, - low: number, - manifest: null, - max: null, - maxLength: number, - media: null, - method: null, - min: null, - minLength: number, - multiple: boolean, - muted: boolean, - name: null, - nonce: null, - noModule: boolean, - noValidate: boolean, - onAbort: null, - onAfterPrint: null, - onAuxClick: null, - onBeforePrint: null, - onBeforeUnload: null, - onBlur: null, - onCancel: null, - onCanPlay: null, - onCanPlayThrough: null, - onChange: null, - onClick: null, - onClose: null, - onContextLost: null, - onContextMenu: null, - onContextRestored: null, - onCopy: null, - onCueChange: null, - onCut: null, - onDblClick: null, - onDrag: null, - onDragEnd: null, - onDragEnter: null, - onDragExit: null, - onDragLeave: null, - onDragOver: null, - onDragStart: null, - onDrop: null, - onDurationChange: null, - onEmptied: null, - onEnded: null, - onError: null, - onFocus: null, - onFormData: null, - onHashChange: null, - onInput: null, - onInvalid: null, - onKeyDown: null, - onKeyPress: null, - onKeyUp: null, - onLanguageChange: null, - onLoad: null, - onLoadedData: null, - onLoadedMetadata: null, - onLoadEnd: null, - onLoadStart: null, - onMessage: null, - onMessageError: null, - onMouseDown: null, - onMouseEnter: null, - onMouseLeave: null, - onMouseMove: null, - onMouseOut: null, - onMouseOver: null, - onMouseUp: null, - onOffline: null, - onOnline: null, - onPageHide: null, - onPageShow: null, - onPaste: null, - onPause: null, - onPlay: null, - onPlaying: null, - onPopState: null, - onProgress: null, - onRateChange: null, - onRejectionHandled: null, - onReset: null, - onResize: null, - onScroll: null, - onSecurityPolicyViolation: null, - onSeeked: null, - onSeeking: null, - onSelect: null, - onSlotChange: null, - onStalled: null, - onStorage: null, - onSubmit: null, - onSuspend: null, - onTimeUpdate: null, - onToggle: null, - onUnhandledRejection: null, - onUnload: null, - onVolumeChange: null, - onWaiting: null, - onWheel: null, - open: boolean, - optimum: number, - pattern: null, - ping: spaceSeparated, - placeholder: null, - playsInline: boolean, - poster: null, - preload: null, - readOnly: boolean, - referrerPolicy: null, - rel: spaceSeparated, - required: boolean, - reversed: boolean, - rows: number, - rowSpan: number, - sandbox: spaceSeparated, - scope: null, - scoped: boolean, - seamless: boolean, - selected: boolean, - shape: null, - size: number, - sizes: null, - slot: null, - span: number, - spellCheck: booleanish, - src: null, - srcDoc: null, - srcLang: null, - srcSet: null, - start: number, - step: null, - style: null, - tabIndex: number, - target: null, - title: null, - translate: null, - type: null, - typeMustMatch: boolean, - useMap: null, - value: booleanish, - width: number, - wrap: null, - align: null, - aLink: null, - archive: spaceSeparated, - axis: null, - background: null, - bgColor: null, - border: number, - borderColor: null, - bottomMargin: number, - cellPadding: null, - cellSpacing: null, - char: null, - charOff: null, - classId: null, - clear: null, - code: null, - codeBase: null, - codeType: null, - color: null, - compact: boolean, - declare: boolean, - event: null, - face: null, - frame: null, - frameBorder: null, - hSpace: number, - leftMargin: number, - link: null, - longDesc: null, - lowSrc: null, - marginHeight: number, - marginWidth: number, - noResize: boolean, - noHref: boolean, - noShade: boolean, - noWrap: boolean, - object: null, - profile: null, - prompt: null, - rev: null, - rightMargin: number, - rules: null, - scheme: null, - scrolling: booleanish, - standby: null, - summary: null, - text: null, - topMargin: number, - valueType: null, - version: null, - vAlign: null, - vLink: null, - vSpace: number, - allowTransparency: null, - autoCorrect: null, - autoSave: null, - disablePictureInPicture: boolean, - disableRemotePlayback: boolean, - prefix: null, - property: null, - results: number, - security: null, - unselectable: null, - }, -}); - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/svg.js -var svg = create3({ - space: 'svg', - attributes: { - accentHeight: 'accent-height', - alignmentBaseline: 'alignment-baseline', - arabicForm: 'arabic-form', - baselineShift: 'baseline-shift', - capHeight: 'cap-height', - className: 'class', - clipPath: 'clip-path', - clipRule: 'clip-rule', - colorInterpolation: 'color-interpolation', - colorInterpolationFilters: 'color-interpolation-filters', - colorProfile: 'color-profile', - colorRendering: 'color-rendering', - crossOrigin: 'crossorigin', - dataType: 'datatype', - dominantBaseline: 'dominant-baseline', - enableBackground: 'enable-background', - fillOpacity: 'fill-opacity', - fillRule: 'fill-rule', - floodColor: 'flood-color', - floodOpacity: 'flood-opacity', - fontFamily: 'font-family', - fontSize: 'font-size', - fontSizeAdjust: 'font-size-adjust', - fontStretch: 'font-stretch', - fontStyle: 'font-style', - fontVariant: 'font-variant', - fontWeight: 'font-weight', - glyphName: 'glyph-name', - glyphOrientationHorizontal: 'glyph-orientation-horizontal', - glyphOrientationVertical: 'glyph-orientation-vertical', - hrefLang: 'hreflang', - horizAdvX: 'horiz-adv-x', - horizOriginX: 'horiz-origin-x', - horizOriginY: 'horiz-origin-y', - imageRendering: 'image-rendering', - letterSpacing: 'letter-spacing', - lightingColor: 'lighting-color', - markerEnd: 'marker-end', - markerMid: 'marker-mid', - markerStart: 'marker-start', - navDown: 'nav-down', - navDownLeft: 'nav-down-left', - navDownRight: 'nav-down-right', - navLeft: 'nav-left', - navNext: 'nav-next', - navPrev: 'nav-prev', - navRight: 'nav-right', - navUp: 'nav-up', - navUpLeft: 'nav-up-left', - navUpRight: 'nav-up-right', - onAbort: 'onabort', - onActivate: 'onactivate', - onAfterPrint: 'onafterprint', - onBeforePrint: 'onbeforeprint', - onBegin: 'onbegin', - onCancel: 'oncancel', - onCanPlay: 'oncanplay', - onCanPlayThrough: 'oncanplaythrough', - onChange: 'onchange', - onClick: 'onclick', - onClose: 'onclose', - onCopy: 'oncopy', - onCueChange: 'oncuechange', - onCut: 'oncut', - onDblClick: 'ondblclick', - onDrag: 'ondrag', - onDragEnd: 'ondragend', - onDragEnter: 'ondragenter', - onDragExit: 'ondragexit', - onDragLeave: 'ondragleave', - onDragOver: 'ondragover', - onDragStart: 'ondragstart', - onDrop: 'ondrop', - onDurationChange: 'ondurationchange', - onEmptied: 'onemptied', - onEnd: 'onend', - onEnded: 'onended', - onError: 'onerror', - onFocus: 'onfocus', - onFocusIn: 'onfocusin', - onFocusOut: 'onfocusout', - onHashChange: 'onhashchange', - onInput: 'oninput', - onInvalid: 'oninvalid', - onKeyDown: 'onkeydown', - onKeyPress: 'onkeypress', - onKeyUp: 'onkeyup', - onLoad: 'onload', - onLoadedData: 'onloadeddata', - onLoadedMetadata: 'onloadedmetadata', - onLoadStart: 'onloadstart', - onMessage: 'onmessage', - onMouseDown: 'onmousedown', - onMouseEnter: 'onmouseenter', - onMouseLeave: 'onmouseleave', - onMouseMove: 'onmousemove', - onMouseOut: 'onmouseout', - onMouseOver: 'onmouseover', - onMouseUp: 'onmouseup', - onMouseWheel: 'onmousewheel', - onOffline: 'onoffline', - onOnline: 'ononline', - onPageHide: 'onpagehide', - onPageShow: 'onpageshow', - onPaste: 'onpaste', - onPause: 'onpause', - onPlay: 'onplay', - onPlaying: 'onplaying', - onPopState: 'onpopstate', - onProgress: 'onprogress', - onRateChange: 'onratechange', - onRepeat: 'onrepeat', - onReset: 'onreset', - onResize: 'onresize', - onScroll: 'onscroll', - onSeeked: 'onseeked', - onSeeking: 'onseeking', - onSelect: 'onselect', - onShow: 'onshow', - onStalled: 'onstalled', - onStorage: 'onstorage', - onSubmit: 'onsubmit', - onSuspend: 'onsuspend', - onTimeUpdate: 'ontimeupdate', - onToggle: 'ontoggle', - onUnload: 'onunload', - onVolumeChange: 'onvolumechange', - onWaiting: 'onwaiting', - onZoom: 'onzoom', - overlinePosition: 'overline-position', - overlineThickness: 'overline-thickness', - paintOrder: 'paint-order', - panose1: 'panose-1', - pointerEvents: 'pointer-events', - referrerPolicy: 'referrerpolicy', - renderingIntent: 'rendering-intent', - shapeRendering: 'shape-rendering', - stopColor: 'stop-color', - stopOpacity: 'stop-opacity', - strikethroughPosition: 'strikethrough-position', - strikethroughThickness: 'strikethrough-thickness', - strokeDashArray: 'stroke-dasharray', - strokeDashOffset: 'stroke-dashoffset', - strokeLineCap: 'stroke-linecap', - strokeLineJoin: 'stroke-linejoin', - strokeMiterLimit: 'stroke-miterlimit', - strokeOpacity: 'stroke-opacity', - strokeWidth: 'stroke-width', - tabIndex: 'tabindex', - textAnchor: 'text-anchor', - textDecoration: 'text-decoration', - textRendering: 'text-rendering', - typeOf: 'typeof', - underlinePosition: 'underline-position', - underlineThickness: 'underline-thickness', - unicodeBidi: 'unicode-bidi', - unicodeRange: 'unicode-range', - unitsPerEm: 'units-per-em', - vAlphabetic: 'v-alphabetic', - vHanging: 'v-hanging', - vIdeographic: 'v-ideographic', - vMathematical: 'v-mathematical', - vectorEffect: 'vector-effect', - vertAdvY: 'vert-adv-y', - vertOriginX: 'vert-origin-x', - vertOriginY: 'vert-origin-y', - wordSpacing: 'word-spacing', - writingMode: 'writing-mode', - xHeight: 'x-height', - playbackOrder: 'playbackorder', - timelineBegin: 'timelinebegin', - }, - transform: caseSensitiveTransform, - properties: { - about: commaOrSpaceSeparated, - accentHeight: number, - accumulate: null, - additive: null, - alignmentBaseline: null, - alphabetic: number, - amplitude: number, - arabicForm: null, - ascent: number, - attributeName: null, - attributeType: null, - azimuth: number, - bandwidth: null, - baselineShift: null, - baseFrequency: null, - baseProfile: null, - bbox: null, - begin: null, - bias: number, - by: null, - calcMode: null, - capHeight: number, - className: spaceSeparated, - clip: null, - clipPath: null, - clipPathUnits: null, - clipRule: null, - color: null, - colorInterpolation: null, - colorInterpolationFilters: null, - colorProfile: null, - colorRendering: null, - content: null, - contentScriptType: null, - contentStyleType: null, - crossOrigin: null, - cursor: null, - cx: null, - cy: null, - d: null, - dataType: null, - defaultAction: null, - descent: number, - diffuseConstant: number, - direction: null, - display: null, - dur: null, - divisor: number, - dominantBaseline: null, - download: boolean, - dx: null, - dy: null, - edgeMode: null, - editable: null, - elevation: number, - enableBackground: null, - end: null, - event: null, - exponent: number, - externalResourcesRequired: null, - fill: null, - fillOpacity: number, - fillRule: null, - filter: null, - filterRes: null, - filterUnits: null, - floodColor: null, - floodOpacity: null, - focusable: null, - focusHighlight: null, - fontFamily: null, - fontSize: null, - fontSizeAdjust: null, - fontStretch: null, - fontStyle: null, - fontVariant: null, - fontWeight: null, - format: null, - fr: null, - from: null, - fx: null, - fy: null, - g1: commaSeparated, - g2: commaSeparated, - glyphName: commaSeparated, - glyphOrientationHorizontal: null, - glyphOrientationVertical: null, - glyphRef: null, - gradientTransform: null, - gradientUnits: null, - handler: null, - hanging: number, - hatchContentUnits: null, - hatchUnits: null, - height: null, - href: null, - hrefLang: null, - horizAdvX: number, - horizOriginX: number, - horizOriginY: number, - id: null, - ideographic: number, - imageRendering: null, - initialVisibility: null, - in: null, - in2: null, - intercept: number, - k: number, - k1: number, - k2: number, - k3: number, - k4: number, - kernelMatrix: commaOrSpaceSeparated, - kernelUnitLength: null, - keyPoints: null, - keySplines: null, - keyTimes: null, - kerning: null, - lang: null, - lengthAdjust: null, - letterSpacing: null, - lightingColor: null, - limitingConeAngle: number, - local: null, - markerEnd: null, - markerMid: null, - markerStart: null, - markerHeight: null, - markerUnits: null, - markerWidth: null, - mask: null, - maskContentUnits: null, - maskUnits: null, - mathematical: null, - max: null, - media: null, - mediaCharacterEncoding: null, - mediaContentEncodings: null, - mediaSize: number, - mediaTime: null, - method: null, - min: null, - mode: null, - name: null, - navDown: null, - navDownLeft: null, - navDownRight: null, - navLeft: null, - navNext: null, - navPrev: null, - navRight: null, - navUp: null, - navUpLeft: null, - navUpRight: null, - numOctaves: null, - observer: null, - offset: null, - onAbort: null, - onActivate: null, - onAfterPrint: null, - onBeforePrint: null, - onBegin: null, - onCancel: null, - onCanPlay: null, - onCanPlayThrough: null, - onChange: null, - onClick: null, - onClose: null, - onCopy: null, - onCueChange: null, - onCut: null, - onDblClick: null, - onDrag: null, - onDragEnd: null, - onDragEnter: null, - onDragExit: null, - onDragLeave: null, - onDragOver: null, - onDragStart: null, - onDrop: null, - onDurationChange: null, - onEmptied: null, - onEnd: null, - onEnded: null, - onError: null, - onFocus: null, - onFocusIn: null, - onFocusOut: null, - onHashChange: null, - onInput: null, - onInvalid: null, - onKeyDown: null, - onKeyPress: null, - onKeyUp: null, - onLoad: null, - onLoadedData: null, - onLoadedMetadata: null, - onLoadStart: null, - onMessage: null, - onMouseDown: null, - onMouseEnter: null, - onMouseLeave: null, - onMouseMove: null, - onMouseOut: null, - onMouseOver: null, - onMouseUp: null, - onMouseWheel: null, - onOffline: null, - onOnline: null, - onPageHide: null, - onPageShow: null, - onPaste: null, - onPause: null, - onPlay: null, - onPlaying: null, - onPopState: null, - onProgress: null, - onRateChange: null, - onRepeat: null, - onReset: null, - onResize: null, - onScroll: null, - onSeeked: null, - onSeeking: null, - onSelect: null, - onShow: null, - onStalled: null, - onStorage: null, - onSubmit: null, - onSuspend: null, - onTimeUpdate: null, - onToggle: null, - onUnload: null, - onVolumeChange: null, - onWaiting: null, - onZoom: null, - opacity: null, - operator: null, - order: null, - orient: null, - orientation: null, - origin: null, - overflow: null, - overlay: null, - overlinePosition: number, - overlineThickness: number, - paintOrder: null, - panose1: null, - path: null, - pathLength: number, - patternContentUnits: null, - patternTransform: null, - patternUnits: null, - phase: null, - ping: spaceSeparated, - pitch: null, - playbackOrder: null, - pointerEvents: null, - points: null, - pointsAtX: number, - pointsAtY: number, - pointsAtZ: number, - preserveAlpha: null, - preserveAspectRatio: null, - primitiveUnits: null, - propagate: null, - property: commaOrSpaceSeparated, - r: null, - radius: null, - referrerPolicy: null, - refX: null, - refY: null, - rel: commaOrSpaceSeparated, - rev: commaOrSpaceSeparated, - renderingIntent: null, - repeatCount: null, - repeatDur: null, - requiredExtensions: commaOrSpaceSeparated, - requiredFeatures: commaOrSpaceSeparated, - requiredFonts: commaOrSpaceSeparated, - requiredFormats: commaOrSpaceSeparated, - resource: null, - restart: null, - result: null, - rotate: null, - rx: null, - ry: null, - scale: null, - seed: null, - shapeRendering: null, - side: null, - slope: null, - snapshotTime: null, - specularConstant: number, - specularExponent: number, - spreadMethod: null, - spacing: null, - startOffset: null, - stdDeviation: null, - stemh: null, - stemv: null, - stitchTiles: null, - stopColor: null, - stopOpacity: null, - strikethroughPosition: number, - strikethroughThickness: number, - string: null, - stroke: null, - strokeDashArray: commaOrSpaceSeparated, - strokeDashOffset: null, - strokeLineCap: null, - strokeLineJoin: null, - strokeMiterLimit: number, - strokeOpacity: number, - strokeWidth: null, - style: null, - surfaceScale: number, - syncBehavior: null, - syncBehaviorDefault: null, - syncMaster: null, - syncTolerance: null, - syncToleranceDefault: null, - systemLanguage: commaOrSpaceSeparated, - tabIndex: number, - tableValues: null, - target: null, - targetX: number, - targetY: number, - textAnchor: null, - textDecoration: null, - textRendering: null, - textLength: null, - timelineBegin: null, - title: null, - transformBehavior: null, - type: null, - typeOf: commaOrSpaceSeparated, - to: null, - transform: null, - u1: null, - u2: null, - underlinePosition: number, - underlineThickness: number, - unicode: null, - unicodeBidi: null, - unicodeRange: null, - unitsPerEm: number, - values: null, - vAlphabetic: number, - vMathematical: number, - vectorEffect: null, - vHanging: number, - vIdeographic: number, - version: null, - vertAdvY: number, - vertOriginX: number, - vertOriginY: number, - viewBox: null, - viewTarget: null, - visibility: null, - width: null, - widths: null, - wordSpacing: null, - writingMode: null, - x: null, - x1: null, - x2: null, - xChannelSelector: null, - xHeight: number, - y: null, - y1: null, - y2: null, - yChannelSelector: null, - z: null, - zoomAndPan: null, - }, -}); - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/find.js -var valid = /^data[-\w.:]+$/i; -var dash = /-[a-z]/g; -var cap = /[A-Z]/g; -function find(schema, value) { - const normal = normalize(value); - let prop = value; - let Type = Info; - if (normal in schema.normal) { - return schema.property[schema.normal[normal]]; - } - if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) { - if (value.charAt(4) === '-') { - const rest = value.slice(5).replace(dash, camelcase); - prop = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1); - } else { - const rest = value.slice(4); - if (!dash.test(rest)) { - let dashes = rest.replace(cap, kebab); - if (dashes.charAt(0) !== '-') { - dashes = '-' + dashes; - } - value = 'data' + dashes; - } - } - Type = DefinedInfo; - } - return new Type(prop, value); -} -function kebab($0) { - return '-' + $0.toLowerCase(); -} -function camelcase($0) { - return $0.charAt(1).toUpperCase(); -} - -// node_modules/hast-util-to-estree/node_modules/property-information/lib/hast-to-react.js -var hastToReact = { - classId: 'classID', - dataType: 'datatype', - itemId: 'itemID', - strokeDashArray: 'strokeDasharray', - strokeDashOffset: 'strokeDashoffset', - strokeLineCap: 'strokeLinecap', - strokeLineJoin: 'strokeLinejoin', - strokeMiterLimit: 'strokeMiterlimit', - typeOf: 'typeof', - xLinkActuate: 'xlinkActuate', - xLinkArcRole: 'xlinkArcrole', - xLinkHref: 'xlinkHref', - xLinkRole: 'xlinkRole', - xLinkShow: 'xlinkShow', - xLinkTitle: 'xlinkTitle', - xLinkType: 'xlinkType', - xmlnsXLink: 'xmlnsXlink', -}; - -// node_modules/hast-util-to-estree/node_modules/property-information/index.js -var html3 = merge([xml, xlink, xmlns, aria, html2], 'html'); -var svg2 = merge([xml, xlink, xmlns, aria, svg], 'svg'); - -// node_modules/hast-util-to-estree/node_modules/space-separated-tokens/index.js -function stringify3(values) { - return values.join(' ').trim(); -} - -// node_modules/hast-util-to-estree/lib/index.js -var import_style_to_object = __toESM(require_style_to_object(), 1); - -// node_modules/zwitch/index.js -var own11 = {}.hasOwnProperty; -function zwitch(key, options) { - var settings = options || {}; - function one3(value) { - var fn = one3.invalid; - var handlers2 = one3.handlers; - if (value && own11.call(value, key)) { - fn = own11.call(handlers2, value[key]) - ? handlers2[value[key]] - : one3.unknown; - } - if (fn) { - return fn.apply(this, arguments); - } - } - one3.handlers = settings.handlers || {}; - one3.invalid = settings.invalid; - one3.unknown = settings.unknown; - return one3; -} - -// node_modules/hast-util-to-estree/lib/index.js -var toReact = hastToReact; -var own12 = {}.hasOwnProperty; -var tableElements = /* @__PURE__ */ new Set([ - 'table', - 'thead', - 'tbody', - 'tfoot', - 'tr', - 'th', - 'td', -]); -function toEstree(tree, options = {}) { - const context = { - schema: options.space === 'svg' ? svg2 : html3, - comments: [], - esm: [], - handle: zwitch('type', { - invalid, - unknown: unknown2, - handlers: Object.assign( - {}, - { - comment, - doctype: ignore2, - element, - mdxjsEsm: mdxjsEsm2, - mdxFlowExpression: mdxExpression2, - mdxJsxFlowElement: mdxJsxElement, - mdxJsxTextElement: mdxJsxElement, - mdxTextExpression: mdxExpression2, - root: root2, - text: text4, - }, - options.handlers, - ), - }), - }; - let result = context.handle(tree, context); - const body = context.esm; - if (result) { - if (result.type !== 'JSXFragment' && result.type !== 'JSXElement') { - result = create4(tree, { - type: 'JSXFragment', - openingFragment: {type: 'JSXOpeningFragment'}, - closingFragment: {type: 'JSXClosingFragment'}, - children: [result], - }); - } - body.push(create4(tree, {type: 'ExpressionStatement', expression: result})); - } - return create4(tree, { - type: 'Program', - body, - sourceType: 'module', - comments: context.comments, - }); -} -function invalid(value) { - throw new Error('Cannot handle value `' + value + '`, expected node'); -} -function unknown2(node) { - throw new Error('Cannot handle unknown node `' + node.type + '`'); -} -function ignore2() {} -function comment(node, context) { - const esnode = inherit(node, {type: 'Block', value: node.value}); - context.comments.push(esnode); - return create4(node, { - type: 'JSXExpressionContainer', - expression: create4(node, { - type: 'JSXEmptyExpression', - comments: [Object.assign({}, esnode, {leading: false, trailing: true})], - }), - }); -} -function element(node, context) { - const parentSchema = context.schema; - let schema = parentSchema; - const props = node.properties || {}; - if (parentSchema.space === 'html' && node.tagName.toLowerCase() === 'svg') { - schema = svg2; - context.schema = schema; - } - const children = all3(node, context); - const attributes = []; - let prop; - for (prop in props) { - if (own12.call(props, prop)) { - let value = props[prop]; - const info = find(schema, prop); - let attributeValue; - if ( - value === void 0 || - value === null || - (typeof value === 'number' && Number.isNaN(value)) || - value === false || - (!value && info.boolean) - ) { - continue; - } - prop = info.space - ? toReact[info.property] || info.property - : info.attribute; - if (Array.isArray(value)) { - value = info.commaSeparated ? stringify2(value) : stringify3(value); - } - if (prop === 'style') { - const styleValue = - typeof value === 'string' ? parseStyle(value, node.tagName) : value; - const cssProperties = []; - let cssProp; - for (cssProp in styleValue) { - if (own12.call(styleValue, cssProp)) { - cssProperties.push({ - type: 'Property', - method: false, - shorthand: false, - computed: false, - key: {type: 'Identifier', name: cssProp}, - value: {type: 'Literal', value: String(styleValue[cssProp])}, - kind: 'init', - }); - } - } - attributeValue = { - type: 'JSXExpressionContainer', - expression: {type: 'ObjectExpression', properties: cssProperties}, - }; - } else if (value === true) { - attributeValue = null; - } else { - attributeValue = {type: 'Literal', value: String(value)}; - } - if (jsxIdentifierName(prop)) { - attributes.push({ - type: 'JSXAttribute', - name: {type: 'JSXIdentifier', name: prop}, - value: attributeValue, - }); - } else { - attributes.push({ - type: 'JSXSpreadAttribute', - argument: { - type: 'ObjectExpression', - properties: [ - { - type: 'Property', - method: false, - shorthand: false, - computed: false, - key: {type: 'Literal', value: String(prop)}, - value: attributeValue || {type: 'Literal', value: true}, - kind: 'init', - }, - ], - }, - }); - } - } - } - context.schema = parentSchema; - return inherit(node, { - type: 'JSXElement', - openingElement: { - type: 'JSXOpeningElement', - attributes, - name: createJsxName(node.tagName), - selfClosing: children.length === 0, - }, - closingElement: - children.length > 0 - ? {type: 'JSXClosingElement', name: createJsxName(node.tagName)} - : null, - children, - }); -} -function mdxjsEsm2(node, context) { - const estree = node.data && node.data.estree; - const comments = (estree && estree.comments) || []; - if (estree) { - context.comments.push(...comments); - attachComments(estree, comments); - context.esm.push(...estree.body); - } -} -function mdxExpression2(node, context) { - const estree = node.data && node.data.estree; - const comments = (estree && estree.comments) || []; - let expression; - if (estree) { - context.comments.push(...comments); - attachComments(estree, estree.comments); - expression = - (estree.body[0] && - estree.body[0].type === 'ExpressionStatement' && - estree.body[0].expression) || - void 0; - } - return inherit(node, { - type: 'JSXExpressionContainer', - expression: expression || create4(node, {type: 'JSXEmptyExpression'}), - }); -} -function mdxJsxElement(node, context) { - const parentSchema = context.schema; - let schema = parentSchema; - const attrs = node.attributes || []; - let index2 = -1; - if ( - node.name && - parentSchema.space === 'html' && - node.name.toLowerCase() === 'svg' - ) { - schema = svg2; - context.schema = schema; - } - const children = all3(node, context); - const attributes = []; - while (++index2 < attrs.length) { - const attr = attrs[index2]; - const value = attr.value; - let attributeValue; - if (attr.type === 'mdxJsxAttribute') { - if (value === void 0 || value === null) { - attributeValue = null; - } else if (typeof value === 'object') { - const estree = value.data && value.data.estree; - const comments = (estree && estree.comments) || []; - let expression; - if (estree) { - context.comments.push(...comments); - attachComments(estree, estree.comments); - expression = - (estree.body[0] && - estree.body[0].type === 'ExpressionStatement' && - estree.body[0].expression) || - void 0; - } - attributeValue = inherit(value, { - type: 'JSXExpressionContainer', - expression: expression || {type: 'JSXEmptyExpression'}, - }); - } else { - attributeValue = {type: 'Literal', value: String(value)}; - } - attributes.push( - inherit(attr, { - type: 'JSXAttribute', - name: createJsxName(attr.name, true), - value: attributeValue, - }), - ); - } else { - const estree = attr.data && attr.data.estree; - const comments = (estree && estree.comments) || []; - let argumentValue; - if (estree) { - context.comments.push(...comments); - attachComments(estree, estree.comments); - argumentValue = - (estree.body[0] && - estree.body[0].type === 'ExpressionStatement' && - estree.body[0].expression && - estree.body[0].expression.type === 'ObjectExpression' && - estree.body[0].expression.properties && - estree.body[0].expression.properties[0] && - estree.body[0].expression.properties[0].type === 'SpreadElement' && - estree.body[0].expression.properties[0].argument) || - void 0; - } - attributes.push( - inherit(attr, { - type: 'JSXSpreadAttribute', - argument: argumentValue || {type: 'ObjectExpression', properties: []}, - }), - ); - } - } - context.schema = parentSchema; - return inherit( - node, - node.name - ? { - type: 'JSXElement', - openingElement: { - type: 'JSXOpeningElement', - attributes, - name: createJsxName(node.name), - selfClosing: children.length === 0, - }, - closingElement: - children.length > 0 - ? {type: 'JSXClosingElement', name: createJsxName(node.name)} - : null, - children, - } - : { - type: 'JSXFragment', - openingFragment: {type: 'JSXOpeningFragment'}, - closingFragment: {type: 'JSXClosingFragment'}, - children, - }, - ); -} -function root2(node, context) { - const children = all3(node, context); - const cleanChildren = []; - let index2 = -1; - let queue; - while (++index2 < children.length) { - const child = children[index2]; - if ( - child.type === 'JSXExpressionContainer' && - child.expression.type === 'Literal' && - whitespace(child.expression.value) - ) { - if (queue) queue.push(child); - } else { - if (queue) cleanChildren.push(...queue); - cleanChildren.push(child); - queue = []; - } - } - return inherit(node, { - type: 'JSXFragment', - openingFragment: {type: 'JSXOpeningFragment'}, - closingFragment: {type: 'JSXClosingFragment'}, - children: cleanChildren, - }); -} -function text4(node) { - const value = String(node.value || ''); - if (!value) return; - return create4(node, { - type: 'JSXExpressionContainer', - expression: inherit(node, {type: 'Literal', value}), - }); -} -function all3(parent, context) { - const children = parent.children || []; - let index2 = -1; - const results = []; - const ignoreLineBreak = - context.schema.space === 'html' && - parent.type === 'element' && - tableElements.has(parent.tagName.toLowerCase()); - while (++index2 < children.length) { - const child = children[index2]; - if (ignoreLineBreak && child.type === 'text' && child.value === '\n') { - continue; - } - const result = context.handle(child, context); - if (Array.isArray(result)) { - results.push(...result); - } else if (result) { - results.push(result); - } - } - return results; -} -function inherit(hast, esnode) { - const left = hast.data; - let right; - let key; - create4(hast, esnode); - if (left) { - for (key in left) { - if (own12.call(left, key) && key !== 'estree') { - if (!right) right = {}; - right[key] = left[key]; - } - } - if (right) { - esnode.data = right; - } - } - return esnode; -} -function create4(hast, esnode) { - const p = position2(hast); - if (p.start.line && p.start.offset !== void 0 && p.end.offset !== void 0) { - esnode.start = p.start.offset; - esnode.end = p.end.offset; - esnode.loc = { - start: {line: p.start.line, column: p.start.column - 1}, - end: {line: p.end.line, column: p.end.column - 1}, - }; - esnode.range = [p.start.offset, p.end.offset]; - } - return esnode; -} -var createJsxName = function (name2, attribute) { - if (!attribute && name2.includes('.')) { - const parts = name2.split('.'); - let part = parts.shift(); - let node = {type: 'JSXIdentifier', name: part}; - while ((part = parts.shift())) { - node = { - type: 'JSXMemberExpression', - object: node, - property: {type: 'JSXIdentifier', name: part}, - }; - } - return node; - } - if (name2.includes(':')) { - const parts = name2.split(':'); - return { - type: 'JSXNamespacedName', - namespace: {type: 'JSXIdentifier', name: parts[0]}, - name: {type: 'JSXIdentifier', name: parts[1]}, - }; - } - return {type: 'JSXIdentifier', name: name2}; -}; -function parseStyle(value, tagName) { - const result = {}; - try { - (0, import_style_to_object.default)(value, iterator); - } catch (error) { - const exception = error; - exception.message = - tagName + '[style]' + exception.message.slice('undefined'.length); - throw error; - } - return result; - function iterator(name2, value2) { - if (name2.slice(0, 4) === '-ms-') name2 = 'ms-' + name2.slice(4); - result[name2.replace(/-([a-z])/g, styleReplacer)] = value2; - } -} -function styleReplacer(_, $1) { - return $1.toUpperCase(); -} -function jsxIdentifierName(name2) { - let index2 = -1; - while (++index2 < name2.length) { - if (!(index2 ? cont3 : start2)(name2.charCodeAt(index2))) return false; - } - return index2 > 0; - function cont3(code2) { - return cont2(code2) || code2 === 45; - } -} - -// node_modules/@mdx-js/mdx/lib/plugin/rehype-recma.js -function rehypeRecma() { - return (tree) => toEstree(tree); -} - -// node_modules/@mdx-js/mdx/lib/plugin/rehype-remove-raw.js -function rehypeRemoveRaw() { - return (tree) => { - visit2(tree, 'raw', (_, index2, parent) => { - if (parent && typeof index2 === 'number') { - parent.children.splice(index2, 1); - return index2; - } - }); - }; -} - -// node_modules/@mdx-js/mdx/lib/plugin/remark-mark-and-unravel.js -function remarkMarkAndUnravel() { - return (tree) => { - visit2(tree, (node, index2, parent_) => { - const parent = parent_; - let offset2 = -1; - let all4 = true; - let oneOrMore; - if (parent && typeof index2 === 'number' && node.type === 'paragraph') { - const children = node.children; - while (++offset2 < children.length) { - const child = children[offset2]; - if ( - child.type === 'mdxJsxTextElement' || - child.type === 'mdxTextExpression' - ) { - oneOrMore = true; - } else if ( - child.type === 'text' && - /^[\t\r\n ]+$/.test(String(child.value)) - ) { - } else { - all4 = false; - break; - } - } - if (all4 && oneOrMore) { - offset2 = -1; - while (++offset2 < children.length) { - const child = children[offset2]; - if (child.type === 'mdxJsxTextElement') { - child.type = 'mdxJsxFlowElement'; - } - if (child.type === 'mdxTextExpression') { - child.type = 'mdxFlowExpression'; - } - } - parent.children.splice(index2, 1, ...children); - return index2; - } - } - if ( - node.type === 'mdxJsxFlowElement' || - node.type === 'mdxJsxTextElement' - ) { - const data2 = node.data || (node.data = {}); - data2._mdxExplicitJsx = true; - } - }); - }; -} - -// node_modules/@mdx-js/mdx/lib/node-types.js -var nodeTypes = [ - 'mdxFlowExpression', - 'mdxJsxFlowElement', - 'mdxJsxTextElement', - 'mdxTextExpression', - 'mdxjsEsm', -]; - -// node_modules/@mdx-js/mdx/lib/condition.js -var import_process2 = __toESM(require('process'), 1); -var development = import_process2.default.env.NODE_ENV === 'development'; - -// node_modules/@mdx-js/mdx/lib/core.js -var removedOptions = [ - 'filepath', - 'compilers', - 'hastPlugins', - 'mdPlugins', - 'skipExport', - 'wrapExport', -]; -function createProcessor(options = {}) { - const { - development: development2 = development, - jsx: jsx2, - format, - outputFormat, - providerImportSource, - recmaPlugins, - rehypePlugins, - remarkPlugins, - remarkRehypeOptions = {}, - SourceMapGenerator, - ...rest - } = options; - let index2 = -1; - while (++index2 < removedOptions.length) { - const key = removedOptions[index2]; - if (key in options) { - throw new Error( - '`options.' + - key + - '` is no longer supported. Please see for more information', - ); - } - } - if (format === 'detect') { - throw new Error( - "Incorrect `format: 'detect'`: `createProcessor` can support either `md` or `mdx`; it does not support detecting the format", - ); - } - const pipeline = unified().use(remark_parse_default); - if (format !== 'md') { - pipeline.use(remarkMdx); - } - pipeline - .use(remarkMarkAndUnravel) - .use(remarkPlugins || []) - .use(lib_default, { - ...remarkRehypeOptions, - allowDangerousHtml: true, - passThrough: [...(remarkRehypeOptions.passThrough || []), ...nodeTypes], - }) - .use(rehypePlugins || []); - if (format === 'md') { - pipeline.use(rehypeRemoveRaw); - } - pipeline - .use(rehypeRecma) - .use(recmaDocument, {...rest, outputFormat}) - .use(recmaJsxRewrite, { - development: development2, - providerImportSource, - outputFormat, - }); - if (!jsx2) { - pipeline.use(recmaJsxBuild, {outputFormat}); - } - pipeline.use(recmaStringify, {SourceMapGenerator}).use(recmaPlugins || []); - return pipeline; -} - -// node_modules/@mdx-js/mdx/lib/util/extnames.js -var import_markdown_extensions = __toESM(require_markdown_extensions2(), 1); -var md = import_markdown_extensions.default.map((d) => '.' + d); - -// node_modules/@mdx-js/mdx/lib/util/resolve-file-and-options.js -function resolveFileAndOptions(vfileCompatible, options) { - const file = looksLikeAVFile2(vfileCompatible) - ? vfileCompatible - : new VFile(vfileCompatible); - const {format, ...rest} = options || {}; - return { - file, - options: { - format: - format === 'md' || format === 'mdx' - ? format - : file.extname && (rest.mdExtensions || md).includes(file.extname) - ? 'md' - : 'mdx', - ...rest, - }, - }; -} -function looksLikeAVFile2(value) { - return Boolean( - value && - typeof value === 'object' && - 'message' in value && - 'messages' in value, - ); -} - -// node_modules/@mdx-js/mdx/lib/compile.js -function compile(vfileCompatible, compileOptions) { - const {file, options} = resolveFileAndOptions( - vfileCompatible, - compileOptions, - ); - return createProcessor(options).process(file); -} -function compileSync(vfileCompatible, compileOptions) { - const {file, options} = resolveFileAndOptions( - vfileCompatible, - compileOptions, - ); - return createProcessor(options).processSync(file); -} - -// node_modules/@mdx-js/mdx/lib/run.js -var AsyncFunction = Object.getPrototypeOf(run).constructor; -async function run(file, options) { - return new AsyncFunction(String(file))(options); -} -function runSync(file, options) { - return new Function(String(file))(options); -} - -// node_modules/@mdx-js/mdx/lib/util/resolve-evaluate-options.js -function resolveEvaluateOptions(options) { - const {Fragment, jsx: jsx2, jsxs, useMDXComponents, ...rest} = options || {}; - if (!Fragment) throw new Error('Expected `Fragment` given to `evaluate`'); - if (!jsx2) throw new Error('Expected `jsx` given to `evaluate`'); - if (!jsxs) throw new Error('Expected `jsxs` given to `evaluate`'); - return { - compiletime: { - ...rest, - outputFormat: 'function-body', - providerImportSource: useMDXComponents ? '#' : void 0, - }, - runtime: {Fragment, jsx: jsx2, jsxs, useMDXComponents}, - }; -} - -// node_modules/@mdx-js/mdx/lib/evaluate.js -async function evaluate(vfileCompatible, evaluateOptions) { - const {compiletime, runtime} = resolveEvaluateOptions(evaluateOptions); - return run(await compile(vfileCompatible, compiletime), runtime); -} -function evaluateSync(vfileCompatible, evaluateOptions) { - const {compiletime, runtime} = resolveEvaluateOptions(evaluateOptions); - return runSync(compileSync(vfileCompatible, compiletime), runtime); -} -// Annotate the CommonJS export names for ESM import in node: -0 && - (module.exports = { - compile, - compileSync, - createProcessor, - evaluate, - evaluateSync, - nodeTypes, - run, - runSync, - // Added manually! - mdastUtilToString: toString2, - }); -/*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */ diff --git a/jest/vendor/remark-mdx@2.1.5.js b/jest/vendor/remark-mdx@2.1.5.js new file mode 100644 index 000000000000..357deffc0ab3 --- /dev/null +++ b/jest/vendor/remark-mdx@2.1.5.js @@ -0,0 +1,14938 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/acorn-jsx/xhtml.js +var require_xhtml = __commonJS({ + "node_modules/acorn-jsx/xhtml.js"(exports, module2) { + module2.exports = { + quot: '"', + amp: "&", + apos: "'", + lt: "<", + gt: ">", + nbsp: "\xA0", + iexcl: "\xA1", + cent: "\xA2", + pound: "\xA3", + curren: "\xA4", + yen: "\xA5", + brvbar: "\xA6", + sect: "\xA7", + uml: "\xA8", + copy: "\xA9", + ordf: "\xAA", + laquo: "\xAB", + not: "\xAC", + shy: "\xAD", + reg: "\xAE", + macr: "\xAF", + deg: "\xB0", + plusmn: "\xB1", + sup2: "\xB2", + sup3: "\xB3", + acute: "\xB4", + micro: "\xB5", + para: "\xB6", + middot: "\xB7", + cedil: "\xB8", + sup1: "\xB9", + ordm: "\xBA", + raquo: "\xBB", + frac14: "\xBC", + frac12: "\xBD", + frac34: "\xBE", + iquest: "\xBF", + Agrave: "\xC0", + Aacute: "\xC1", + Acirc: "\xC2", + Atilde: "\xC3", + Auml: "\xC4", + Aring: "\xC5", + AElig: "\xC6", + Ccedil: "\xC7", + Egrave: "\xC8", + Eacute: "\xC9", + Ecirc: "\xCA", + Euml: "\xCB", + Igrave: "\xCC", + Iacute: "\xCD", + Icirc: "\xCE", + Iuml: "\xCF", + ETH: "\xD0", + Ntilde: "\xD1", + Ograve: "\xD2", + Oacute: "\xD3", + Ocirc: "\xD4", + Otilde: "\xD5", + Ouml: "\xD6", + times: "\xD7", + Oslash: "\xD8", + Ugrave: "\xD9", + Uacute: "\xDA", + Ucirc: "\xDB", + Uuml: "\xDC", + Yacute: "\xDD", + THORN: "\xDE", + szlig: "\xDF", + agrave: "\xE0", + aacute: "\xE1", + acirc: "\xE2", + atilde: "\xE3", + auml: "\xE4", + aring: "\xE5", + aelig: "\xE6", + ccedil: "\xE7", + egrave: "\xE8", + eacute: "\xE9", + ecirc: "\xEA", + euml: "\xEB", + igrave: "\xEC", + iacute: "\xED", + icirc: "\xEE", + iuml: "\xEF", + eth: "\xF0", + ntilde: "\xF1", + ograve: "\xF2", + oacute: "\xF3", + ocirc: "\xF4", + otilde: "\xF5", + ouml: "\xF6", + divide: "\xF7", + oslash: "\xF8", + ugrave: "\xF9", + uacute: "\xFA", + ucirc: "\xFB", + uuml: "\xFC", + yacute: "\xFD", + thorn: "\xFE", + yuml: "\xFF", + OElig: "\u0152", + oelig: "\u0153", + Scaron: "\u0160", + scaron: "\u0161", + Yuml: "\u0178", + fnof: "\u0192", + circ: "\u02C6", + tilde: "\u02DC", + Alpha: "\u0391", + Beta: "\u0392", + Gamma: "\u0393", + Delta: "\u0394", + Epsilon: "\u0395", + Zeta: "\u0396", + Eta: "\u0397", + Theta: "\u0398", + Iota: "\u0399", + Kappa: "\u039A", + Lambda: "\u039B", + Mu: "\u039C", + Nu: "\u039D", + Xi: "\u039E", + Omicron: "\u039F", + Pi: "\u03A0", + Rho: "\u03A1", + Sigma: "\u03A3", + Tau: "\u03A4", + Upsilon: "\u03A5", + Phi: "\u03A6", + Chi: "\u03A7", + Psi: "\u03A8", + Omega: "\u03A9", + alpha: "\u03B1", + beta: "\u03B2", + gamma: "\u03B3", + delta: "\u03B4", + epsilon: "\u03B5", + zeta: "\u03B6", + eta: "\u03B7", + theta: "\u03B8", + iota: "\u03B9", + kappa: "\u03BA", + lambda: "\u03BB", + mu: "\u03BC", + nu: "\u03BD", + xi: "\u03BE", + omicron: "\u03BF", + pi: "\u03C0", + rho: "\u03C1", + sigmaf: "\u03C2", + sigma: "\u03C3", + tau: "\u03C4", + upsilon: "\u03C5", + phi: "\u03C6", + chi: "\u03C7", + psi: "\u03C8", + omega: "\u03C9", + thetasym: "\u03D1", + upsih: "\u03D2", + piv: "\u03D6", + ensp: "\u2002", + emsp: "\u2003", + thinsp: "\u2009", + zwnj: "\u200C", + zwj: "\u200D", + lrm: "\u200E", + rlm: "\u200F", + ndash: "\u2013", + mdash: "\u2014", + lsquo: "\u2018", + rsquo: "\u2019", + sbquo: "\u201A", + ldquo: "\u201C", + rdquo: "\u201D", + bdquo: "\u201E", + dagger: "\u2020", + Dagger: "\u2021", + bull: "\u2022", + hellip: "\u2026", + permil: "\u2030", + prime: "\u2032", + Prime: "\u2033", + lsaquo: "\u2039", + rsaquo: "\u203A", + oline: "\u203E", + frasl: "\u2044", + euro: "\u20AC", + image: "\u2111", + weierp: "\u2118", + real: "\u211C", + trade: "\u2122", + alefsym: "\u2135", + larr: "\u2190", + uarr: "\u2191", + rarr: "\u2192", + darr: "\u2193", + harr: "\u2194", + crarr: "\u21B5", + lArr: "\u21D0", + uArr: "\u21D1", + rArr: "\u21D2", + dArr: "\u21D3", + hArr: "\u21D4", + forall: "\u2200", + part: "\u2202", + exist: "\u2203", + empty: "\u2205", + nabla: "\u2207", + isin: "\u2208", + notin: "\u2209", + ni: "\u220B", + prod: "\u220F", + sum: "\u2211", + minus: "\u2212", + lowast: "\u2217", + radic: "\u221A", + prop: "\u221D", + infin: "\u221E", + ang: "\u2220", + and: "\u2227", + or: "\u2228", + cap: "\u2229", + cup: "\u222A", + "int": "\u222B", + there4: "\u2234", + sim: "\u223C", + cong: "\u2245", + asymp: "\u2248", + ne: "\u2260", + equiv: "\u2261", + le: "\u2264", + ge: "\u2265", + sub: "\u2282", + sup: "\u2283", + nsub: "\u2284", + sube: "\u2286", + supe: "\u2287", + oplus: "\u2295", + otimes: "\u2297", + perp: "\u22A5", + sdot: "\u22C5", + lceil: "\u2308", + rceil: "\u2309", + lfloor: "\u230A", + rfloor: "\u230B", + lang: "\u2329", + rang: "\u232A", + loz: "\u25CA", + spades: "\u2660", + clubs: "\u2663", + hearts: "\u2665", + diams: "\u2666" + }; + } +}); + +// node_modules/acorn/dist/acorn.js +var require_acorn = __commonJS({ + "node_modules/acorn/dist/acorn.js"(exports, module2) { + (function(global, factory) { + typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.acorn = {})); + })(exports, function(exports2) { + "use strict"; + var astralIdentifierCodes2 = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + var astralIdentifierStartCodes2 = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; + var nonASCIIidentifierChars2 = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F"; + var nonASCIIidentifierStartChars2 = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC"; + var reservedWords2 = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" + }; + var ecma5AndLessKeywords2 = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; + var keywords$12 = { + 5: ecma5AndLessKeywords2, + "5module": ecma5AndLessKeywords2 + " export import", + 6: ecma5AndLessKeywords2 + " const class extends export import super" + }; + var keywordRelationalOperator2 = /^in(stanceof)?$/; + var nonASCIIidentifierStart2 = new RegExp("[" + nonASCIIidentifierStartChars2 + "]"); + var nonASCIIidentifier2 = new RegExp("[" + nonASCIIidentifierStartChars2 + nonASCIIidentifierChars2 + "]"); + function isInAstralSet2(code, set) { + var pos = 65536; + for (var i2 = 0; i2 < set.length; i2 += 2) { + pos += set[i2]; + if (pos > code) { + return false; + } + pos += set[i2 + 1]; + if (pos >= code) { + return true; + } + } + } + function isIdentifierStart2(code, astral) { + if (code < 65) { + return code === 36; + } + if (code < 91) { + return true; + } + if (code < 97) { + return code === 95; + } + if (code < 123) { + return true; + } + if (code <= 65535) { + return code >= 170 && nonASCIIidentifierStart2.test(String.fromCharCode(code)); + } + if (astral === false) { + return false; + } + return isInAstralSet2(code, astralIdentifierStartCodes2); + } + function isIdentifierChar2(code, astral) { + if (code < 48) { + return code === 36; + } + if (code < 58) { + return true; + } + if (code < 65) { + return false; + } + if (code < 91) { + return true; + } + if (code < 97) { + return code === 95; + } + if (code < 123) { + return true; + } + if (code <= 65535) { + return code >= 170 && nonASCIIidentifier2.test(String.fromCharCode(code)); + } + if (astral === false) { + return false; + } + return isInAstralSet2(code, astralIdentifierStartCodes2) || isInAstralSet2(code, astralIdentifierCodes2); + } + var TokenType3 = function TokenType4(label, conf) { + if (conf === void 0) + conf = {}; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; + }; + function binop2(name, prec) { + return new TokenType3(name, { beforeExpr: true, binop: prec }); + } + var beforeExpr2 = { beforeExpr: true }, startsExpr2 = { startsExpr: true }; + var keywords2 = {}; + function kw2(name, options) { + if (options === void 0) + options = {}; + options.keyword = name; + return keywords2[name] = new TokenType3(name, options); + } + var types$12 = { + num: new TokenType3("num", startsExpr2), + regexp: new TokenType3("regexp", startsExpr2), + string: new TokenType3("string", startsExpr2), + name: new TokenType3("name", startsExpr2), + privateId: new TokenType3("privateId", startsExpr2), + eof: new TokenType3("eof"), + bracketL: new TokenType3("[", { beforeExpr: true, startsExpr: true }), + bracketR: new TokenType3("]"), + braceL: new TokenType3("{", { beforeExpr: true, startsExpr: true }), + braceR: new TokenType3("}"), + parenL: new TokenType3("(", { beforeExpr: true, startsExpr: true }), + parenR: new TokenType3(")"), + comma: new TokenType3(",", beforeExpr2), + semi: new TokenType3(";", beforeExpr2), + colon: new TokenType3(":", beforeExpr2), + dot: new TokenType3("."), + question: new TokenType3("?", beforeExpr2), + questionDot: new TokenType3("?."), + arrow: new TokenType3("=>", beforeExpr2), + template: new TokenType3("template"), + invalidTemplate: new TokenType3("invalidTemplate"), + ellipsis: new TokenType3("...", beforeExpr2), + backQuote: new TokenType3("`", startsExpr2), + dollarBraceL: new TokenType3("${", { beforeExpr: true, startsExpr: true }), + eq: new TokenType3("=", { beforeExpr: true, isAssign: true }), + assign: new TokenType3("_=", { beforeExpr: true, isAssign: true }), + incDec: new TokenType3("++/--", { prefix: true, postfix: true, startsExpr: true }), + prefix: new TokenType3("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), + logicalOR: binop2("||", 1), + logicalAND: binop2("&&", 2), + bitwiseOR: binop2("|", 3), + bitwiseXOR: binop2("^", 4), + bitwiseAND: binop2("&", 5), + equality: binop2("==/!=/===/!==", 6), + relational: binop2("/<=/>=", 7), + bitShift: binop2("<>/>>>", 8), + plusMin: new TokenType3("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), + modulo: binop2("%", 10), + star: binop2("*", 10), + slash: binop2("/", 10), + starstar: new TokenType3("**", { beforeExpr: true }), + coalesce: binop2("??", 1), + _break: kw2("break"), + _case: kw2("case", beforeExpr2), + _catch: kw2("catch"), + _continue: kw2("continue"), + _debugger: kw2("debugger"), + _default: kw2("default", beforeExpr2), + _do: kw2("do", { isLoop: true, beforeExpr: true }), + _else: kw2("else", beforeExpr2), + _finally: kw2("finally"), + _for: kw2("for", { isLoop: true }), + _function: kw2("function", startsExpr2), + _if: kw2("if"), + _return: kw2("return", beforeExpr2), + _switch: kw2("switch"), + _throw: kw2("throw", beforeExpr2), + _try: kw2("try"), + _var: kw2("var"), + _const: kw2("const"), + _while: kw2("while", { isLoop: true }), + _with: kw2("with"), + _new: kw2("new", { beforeExpr: true, startsExpr: true }), + _this: kw2("this", startsExpr2), + _super: kw2("super", startsExpr2), + _class: kw2("class", startsExpr2), + _extends: kw2("extends", beforeExpr2), + _export: kw2("export"), + _import: kw2("import", startsExpr2), + _null: kw2("null", startsExpr2), + _true: kw2("true", startsExpr2), + _false: kw2("false", startsExpr2), + _in: kw2("in", { beforeExpr: true, binop: 7 }), + _instanceof: kw2("instanceof", { beforeExpr: true, binop: 7 }), + _typeof: kw2("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), + _void: kw2("void", { beforeExpr: true, prefix: true, startsExpr: true }), + _delete: kw2("delete", { beforeExpr: true, prefix: true, startsExpr: true }) + }; + var lineBreak2 = /\r\n?|\n|\u2028|\u2029/; + var lineBreakG2 = new RegExp(lineBreak2.source, "g"); + function isNewLine2(code) { + return code === 10 || code === 13 || code === 8232 || code === 8233; + } + function nextLineBreak2(code, from, end) { + if (end === void 0) + end = code.length; + for (var i2 = from; i2 < end; i2++) { + var next = code.charCodeAt(i2); + if (isNewLine2(next)) { + return i2 < end - 1 && next === 13 && code.charCodeAt(i2 + 1) === 10 ? i2 + 2 : i2 + 1; + } + } + return -1; + } + var nonASCIIwhitespace2 = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + var skipWhiteSpace2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; + var ref2 = Object.prototype; + var hasOwnProperty3 = ref2.hasOwnProperty; + var toString2 = ref2.toString; + var hasOwn2 = Object.hasOwn || function(obj, propName) { + return hasOwnProperty3.call(obj, propName); + }; + var isArray2 = Array.isArray || function(obj) { + return toString2.call(obj) === "[object Array]"; + }; + function wordsRegexp2(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"); + } + function codePointToString2(code) { + if (code <= 65535) { + return String.fromCharCode(code); + } + code -= 65536; + return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320); + } + var loneSurrogate2 = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; + var Position3 = function Position4(line, col) { + this.line = line; + this.column = col; + }; + Position3.prototype.offset = function offset2(n) { + return new Position3(this.line, this.column + n); + }; + var SourceLocation3 = function SourceLocation4(p, start3, end) { + this.start = start3; + this.end = end; + if (p.sourceFile !== null) { + this.source = p.sourceFile; + } + }; + function getLineInfo2(input, offset2) { + for (var line = 1, cur = 0; ; ) { + var nextBreak = nextLineBreak2(input, cur, offset2); + if (nextBreak < 0) { + return new Position3(line, offset2 - cur); + } + ++line; + cur = nextBreak; + } + } + var defaultOptions2 = { + ecmaVersion: null, + sourceType: "script", + onInsertedSemicolon: null, + onTrailingComma: null, + allowReserved: null, + allowReturnOutsideFunction: false, + allowImportExportEverywhere: false, + allowAwaitOutsideFunction: null, + allowSuperOutsideMethod: null, + allowHashBang: false, + locations: false, + onToken: null, + onComment: null, + ranges: false, + program: null, + sourceFile: null, + directSourceFile: null, + preserveParens: false + }; + var warnedAboutEcmaVersion2 = false; + function getOptions2(opts) { + var options = {}; + for (var opt in defaultOptions2) { + options[opt] = opts && hasOwn2(opts, opt) ? opts[opt] : defaultOptions2[opt]; + } + if (options.ecmaVersion === "latest") { + options.ecmaVersion = 1e8; + } else if (options.ecmaVersion == null) { + if (!warnedAboutEcmaVersion2 && typeof console === "object" && console.warn) { + warnedAboutEcmaVersion2 = true; + console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); + } + options.ecmaVersion = 11; + } else if (options.ecmaVersion >= 2015) { + options.ecmaVersion -= 2009; + } + if (options.allowReserved == null) { + options.allowReserved = options.ecmaVersion < 5; + } + if (opts.allowHashBang == null) { + options.allowHashBang = options.ecmaVersion >= 14; + } + if (isArray2(options.onToken)) { + var tokens = options.onToken; + options.onToken = function(token) { + return tokens.push(token); + }; + } + if (isArray2(options.onComment)) { + options.onComment = pushComment2(options, options.onComment); + } + return options; + } + function pushComment2(options, array) { + return function(block, text, start3, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text, + start: start3, + end + }; + if (options.locations) { + comment.loc = new SourceLocation3(this, startLoc, endLoc); + } + if (options.ranges) { + comment.range = [start3, end]; + } + array.push(comment); + }; + } + var SCOPE_TOP2 = 1, SCOPE_FUNCTION2 = 2, SCOPE_ASYNC2 = 4, SCOPE_GENERATOR2 = 8, SCOPE_ARROW2 = 16, SCOPE_SIMPLE_CATCH2 = 32, SCOPE_SUPER2 = 64, SCOPE_DIRECT_SUPER2 = 128, SCOPE_CLASS_STATIC_BLOCK2 = 256, SCOPE_VAR2 = SCOPE_TOP2 | SCOPE_FUNCTION2 | SCOPE_CLASS_STATIC_BLOCK2; + function functionFlags2(async, generator) { + return SCOPE_FUNCTION2 | (async ? SCOPE_ASYNC2 : 0) | (generator ? SCOPE_GENERATOR2 : 0); + } + var BIND_NONE2 = 0, BIND_VAR2 = 1, BIND_LEXICAL2 = 2, BIND_FUNCTION2 = 3, BIND_SIMPLE_CATCH2 = 4, BIND_OUTSIDE2 = 5; + var Parser3 = function Parser4(options, input, startPos) { + this.options = options = getOptions2(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp2(keywords$12[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + var reserved = ""; + if (options.allowReserved !== true) { + reserved = reservedWords2[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; + if (options.sourceType === "module") { + reserved += " await"; + } + } + this.reservedWords = wordsRegexp2(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords2.strict; + this.reservedWordsStrict = wordsRegexp2(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp2(reservedStrict + " " + reservedWords2.strictBind); + this.input = String(input); + this.containsEsc = false; + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak2).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + this.type = types$12.eof; + this.value = null; + this.start = this.end = this.pos; + this.startLoc = this.endLoc = this.curPosition(); + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + this.context = this.initialContext(); + this.exprAllowed = true; + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + this.potentialArrowAt = -1; + this.potentialArrowInForAwait = false; + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + this.labels = []; + this.undefinedExports = /* @__PURE__ */ Object.create(null); + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") { + this.skipLineComment(2); + } + this.scopeStack = []; + this.enterScope(SCOPE_TOP2); + this.regexpState = null; + this.privateNameStack = []; + }; + var prototypeAccessors2 = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } }; + Parser3.prototype.parse = function parse4() { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node); + }; + prototypeAccessors2.inFunction.get = function() { + return (this.currentVarScope().flags & SCOPE_FUNCTION2) > 0; + }; + prototypeAccessors2.inGenerator.get = function() { + return (this.currentVarScope().flags & SCOPE_GENERATOR2) > 0 && !this.currentVarScope().inClassFieldInit; + }; + prototypeAccessors2.inAsync.get = function() { + return (this.currentVarScope().flags & SCOPE_ASYNC2) > 0 && !this.currentVarScope().inClassFieldInit; + }; + prototypeAccessors2.canAwait.get = function() { + for (var i2 = this.scopeStack.length - 1; i2 >= 0; i2--) { + var scope = this.scopeStack[i2]; + if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK2) { + return false; + } + if (scope.flags & SCOPE_FUNCTION2) { + return (scope.flags & SCOPE_ASYNC2) > 0; + } + } + return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction; + }; + prototypeAccessors2.allowSuper.get = function() { + var ref3 = this.currentThisScope(); + var flags = ref3.flags; + var inClassFieldInit = ref3.inClassFieldInit; + return (flags & SCOPE_SUPER2) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod; + }; + prototypeAccessors2.allowDirectSuper.get = function() { + return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER2) > 0; + }; + prototypeAccessors2.treatFunctionsAsVar.get = function() { + return this.treatFunctionsAsVarInScope(this.currentScope()); + }; + prototypeAccessors2.allowNewDotTarget.get = function() { + var ref3 = this.currentThisScope(); + var flags = ref3.flags; + var inClassFieldInit = ref3.inClassFieldInit; + return (flags & (SCOPE_FUNCTION2 | SCOPE_CLASS_STATIC_BLOCK2)) > 0 || inClassFieldInit; + }; + prototypeAccessors2.inClassStaticBlock.get = function() { + return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK2) > 0; + }; + Parser3.extend = function extend2() { + var plugins = [], len = arguments.length; + while (len--) + plugins[len] = arguments[len]; + var cls = this; + for (var i2 = 0; i2 < plugins.length; i2++) { + cls = plugins[i2](cls); + } + return cls; + }; + Parser3.parse = function parse4(input, options) { + return new this(options, input).parse(); + }; + Parser3.parseExpressionAt = function parseExpressionAt3(input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression(); + }; + Parser3.tokenizer = function tokenizer3(input, options) { + return new this(options, input); + }; + Object.defineProperties(Parser3.prototype, prototypeAccessors2); + var pp$92 = Parser3.prototype; + var literal2 = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; + pp$92.strictDirective = function(start3) { + if (this.options.ecmaVersion < 5) { + return false; + } + for (; ; ) { + skipWhiteSpace2.lastIndex = start3; + start3 += skipWhiteSpace2.exec(this.input)[0].length; + var match = literal2.exec(this.input.slice(start3)); + if (!match) { + return false; + } + if ((match[1] || match[2]) === "use strict") { + skipWhiteSpace2.lastIndex = start3 + match[0].length; + var spaceAfter = skipWhiteSpace2.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; + var next = this.input.charAt(end); + return next === ";" || next === "}" || lineBreak2.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="); + } + start3 += match[0].length; + skipWhiteSpace2.lastIndex = start3; + start3 += skipWhiteSpace2.exec(this.input)[0].length; + if (this.input[start3] === ";") { + start3++; + } + } + }; + pp$92.eat = function(type) { + if (this.type === type) { + this.next(); + return true; + } else { + return false; + } + }; + pp$92.isContextual = function(name) { + return this.type === types$12.name && this.value === name && !this.containsEsc; + }; + pp$92.eatContextual = function(name) { + if (!this.isContextual(name)) { + return false; + } + this.next(); + return true; + }; + pp$92.expectContextual = function(name) { + if (!this.eatContextual(name)) { + this.unexpected(); + } + }; + pp$92.canInsertSemicolon = function() { + return this.type === types$12.eof || this.type === types$12.braceR || lineBreak2.test(this.input.slice(this.lastTokEnd, this.start)); + }; + pp$92.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) { + this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); + } + return true; + } + }; + pp$92.semicolon = function() { + if (!this.eat(types$12.semi) && !this.insertSemicolon()) { + this.unexpected(); + } + }; + pp$92.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) { + this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); + } + if (!notNext) { + this.next(); + } + return true; + } + }; + pp$92.expect = function(type) { + this.eat(type) || this.unexpected(); + }; + pp$92.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); + }; + var DestructuringErrors3 = function DestructuringErrors4() { + this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; + }; + pp$92.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { + return; + } + if (refDestructuringErrors.trailingComma > -1) { + this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); + } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { + this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); + } + }; + pp$92.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { + return false; + } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { + return shorthandAssign >= 0 || doubleProto >= 0; + } + if (shorthandAssign >= 0) { + this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); + } + if (doubleProto >= 0) { + this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); + } + }; + pp$92.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { + this.raise(this.yieldPos, "Yield expression cannot be a default value"); + } + if (this.awaitPos) { + this.raise(this.awaitPos, "Await expression cannot be a default value"); + } + }; + pp$92.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") { + return this.isSimpleAssignTarget(expr.expression); + } + return expr.type === "Identifier" || expr.type === "MemberExpression"; + }; + var pp$82 = Parser3.prototype; + pp$82.parseTopLevel = function(node) { + var exports3 = /* @__PURE__ */ Object.create(null); + if (!node.body) { + node.body = []; + } + while (this.type !== types$12.eof) { + var stmt = this.parseStatement(null, true, exports3); + node.body.push(stmt); + } + if (this.inModule) { + for (var i2 = 0, list2 = Object.keys(this.undefinedExports); i2 < list2.length; i2 += 1) { + var name = list2[i2]; + this.raiseRecoverable(this.undefinedExports[name].start, "Export '" + name + "' is not defined"); + } + } + this.adaptDirectivePrologue(node.body); + this.next(); + node.sourceType = this.options.sourceType; + return this.finishNode(node, "Program"); + }; + var loopLabel2 = { kind: "loop" }, switchLabel2 = { kind: "switch" }; + pp$82.isLet = function(context) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { + return false; + } + skipWhiteSpace2.lastIndex = this.pos; + var skip = skipWhiteSpace2.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 91 || nextCh === 92 || nextCh > 55295 && nextCh < 56320) { + return true; + } + if (context) { + return false; + } + if (nextCh === 123) { + return true; + } + if (isIdentifierStart2(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar2(nextCh = this.input.charCodeAt(pos), true)) { + ++pos; + } + if (nextCh === 92 || nextCh > 55295 && nextCh < 56320) { + return true; + } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator2.test(ident)) { + return true; + } + } + return false; + }; + pp$82.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { + return false; + } + skipWhiteSpace2.lastIndex = this.pos; + var skip = skipWhiteSpace2.exec(this.input); + var next = this.pos + skip[0].length, after; + return !lineBreak2.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar2(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320)); + }; + pp$82.parseStatement = function(context, topLevel, exports3) { + var starttype = this.type, node = this.startNode(), kind; + if (this.isLet(context)) { + starttype = types$12._var; + kind = "let"; + } + switch (starttype) { + case types$12._break: + case types$12._continue: + return this.parseBreakContinueStatement(node, starttype.keyword); + case types$12._debugger: + return this.parseDebuggerStatement(node); + case types$12._do: + return this.parseDoStatement(node); + case types$12._for: + return this.parseForStatement(node); + case types$12._function: + if (context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6) { + this.unexpected(); + } + return this.parseFunctionStatement(node, false, !context); + case types$12._class: + if (context) { + this.unexpected(); + } + return this.parseClass(node, true); + case types$12._if: + return this.parseIfStatement(node); + case types$12._return: + return this.parseReturnStatement(node); + case types$12._switch: + return this.parseSwitchStatement(node); + case types$12._throw: + return this.parseThrowStatement(node); + case types$12._try: + return this.parseTryStatement(node); + case types$12._const: + case types$12._var: + kind = kind || this.value; + if (context && kind !== "var") { + this.unexpected(); + } + return this.parseVarStatement(node, kind); + case types$12._while: + return this.parseWhileStatement(node); + case types$12._with: + return this.parseWithStatement(node); + case types$12.braceL: + return this.parseBlock(true, node); + case types$12.semi: + return this.parseEmptyStatement(node); + case types$12._export: + case types$12._import: + if (this.options.ecmaVersion > 10 && starttype === types$12._import) { + skipWhiteSpace2.lastIndex = this.pos; + var skip = skipWhiteSpace2.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 40 || nextCh === 46) { + return this.parseExpressionStatement(node, this.parseExpression()); + } + } + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) { + this.raise(this.start, "'import' and 'export' may only appear at the top level"); + } + if (!this.inModule) { + this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); + } + } + return starttype === types$12._import ? this.parseImport(node) : this.parseExport(node, exports3); + default: + if (this.isAsyncFunction()) { + if (context) { + this.unexpected(); + } + this.next(); + return this.parseFunctionStatement(node, true, !context); + } + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types$12.name && expr.type === "Identifier" && this.eat(types$12.colon)) { + return this.parseLabeledStatement(node, maybeName, expr, context); + } else { + return this.parseExpressionStatement(node, expr); + } + } + }; + pp$82.parseBreakContinueStatement = function(node, keyword) { + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types$12.semi) || this.insertSemicolon()) { + node.label = null; + } else if (this.type !== types$12.name) { + this.unexpected(); + } else { + node.label = this.parseIdent(); + this.semicolon(); + } + var i2 = 0; + for (; i2 < this.labels.length; ++i2) { + var lab = this.labels[i2]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { + break; + } + if (node.label && isBreak) { + break; + } + } + } + if (i2 === this.labels.length) { + this.raise(node.start, "Unsyntactic " + keyword); + } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); + }; + pp$82.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); + }; + pp$82.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel2); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types$12._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) { + this.eat(types$12.semi); + } else { + this.semicolon(); + } + return this.finishNode(node, "DoWhileStatement"); + }; + pp$82.parseForStatement = function(node) { + this.next(); + var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1; + this.labels.push(loopLabel2); + this.enterScope(0); + this.expect(types$12.parenL); + if (this.type === types$12.semi) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, null); + } + var isLet = this.isLet(); + if (this.type === types$12._var || this.type === types$12._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types$12._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$12._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + return this.parseForIn(node, init$1); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init$1); + } + var startsWithLet = this.isContextual("let"), isForOf = false; + var refDestructuringErrors = new DestructuringErrors3(); + var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); + if (this.type === types$12._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$12._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + if (startsWithLet && isForOf) { + this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLValPattern(init); + return this.parseForIn(node, init); + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); + }; + pp$82.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT2 | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT2), false, isAsync); + }; + pp$82.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types$12._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement"); + }; + pp$82.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) { + this.raise(this.start, "'return' outside of function"); + } + this.next(); + if (this.eat(types$12.semi) || this.insertSemicolon()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } + return this.finishNode(node, "ReturnStatement"); + }; + pp$82.parseSwitchStatement = function(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types$12.braceL); + this.labels.push(switchLabel2); + this.enterScope(0); + var cur; + for (var sawDefault = false; this.type !== types$12.braceR; ) { + if (this.type === types$12._case || this.type === types$12._default) { + var isCase = this.type === types$12._case; + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { + this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); + } + sawDefault = true; + cur.test = null; + } + this.expect(types$12.colon); + } else { + if (!cur) { + this.unexpected(); + } + cur.consequent.push(this.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + this.next(); + this.labels.pop(); + return this.finishNode(node, "SwitchStatement"); + }; + pp$82.parseThrowStatement = function(node) { + this.next(); + if (lineBreak2.test(this.input.slice(this.lastTokEnd, this.start))) { + this.raise(this.lastTokEnd, "Illegal newline after throw"); + } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); + }; + var empty$12 = []; + pp$82.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types$12._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types$12.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH2 : 0); + this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH2 : BIND_LEXICAL2); + this.expect(types$12.parenR); + } else { + if (this.options.ecmaVersion < 10) { + this.unexpected(); + } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types$12._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) { + this.raise(node.start, "Missing catch or finally clause"); + } + return this.finishNode(node, "TryStatement"); + }; + pp$82.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); + }; + pp$82.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel2); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement"); + }; + pp$82.parseWithStatement = function(node) { + if (this.strict) { + this.raise(this.start, "'with' in strict mode"); + } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement"); + }; + pp$82.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); + }; + pp$82.parseLabeledStatement = function(node, maybeName, expr, context) { + for (var i$1 = 0, list2 = this.labels; i$1 < list2.length; i$1 += 1) { + var label = list2[i$1]; + if (label.name === maybeName) { + this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } + } + var kind = this.type.isLoop ? "loop" : this.type === types$12._switch ? "switch" : null; + for (var i2 = this.labels.length - 1; i2 >= 0; i2--) { + var label$1 = this.labels[i2]; + if (label$1.statementStart === node.start) { + label$1.statementStart = this.start; + label$1.kind = kind; + } else { + break; + } + } + this.labels.push({ name: maybeName, kind, statementStart: this.start }); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); + }; + pp$82.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); + }; + pp$82.parseBlock = function(createNewLexicalScope, node, exitStrict) { + if (createNewLexicalScope === void 0) + createNewLexicalScope = true; + if (node === void 0) + node = this.startNode(); + node.body = []; + this.expect(types$12.braceL); + if (createNewLexicalScope) { + this.enterScope(0); + } + while (this.type !== types$12.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + if (exitStrict) { + this.strict = false; + } + this.next(); + if (createNewLexicalScope) { + this.exitScope(); + } + return this.finishNode(node, "BlockStatement"); + }; + pp$82.parseFor = function(node, init) { + node.init = init; + this.expect(types$12.semi); + node.test = this.type === types$12.semi ? null : this.parseExpression(); + this.expect(types$12.semi); + node.update = this.type === types$12.parenR ? null : this.parseExpression(); + this.expect(types$12.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement"); + }; + pp$82.parseForIn = function(node, init) { + var isForIn = this.type === types$12._in; + this.next(); + if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { + this.raise( + init.start, + (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer" + ); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types$12.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); + }; + pp$82.parseVar = function(node, isFor, kind) { + node.declarations = []; + node.kind = kind; + for (; ; ) { + var decl = this.startNode(); + this.parseVarId(decl, kind); + if (this.eat(types$12.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this.type === types$12._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$12._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(types$12.comma)) { + break; + } + } + return node; + }; + pp$82.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR2 : BIND_LEXICAL2, false); + }; + var FUNC_STATEMENT2 = 1, FUNC_HANGING_STATEMENT2 = 2, FUNC_NULLABLE_ID2 = 4; + pp$82.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { + if (this.type === types$12.star && statement & FUNC_HANGING_STATEMENT2) { + this.unexpected(); + } + node.generator = this.eat(types$12.star); + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + if (statement & FUNC_STATEMENT2) { + node.id = statement & FUNC_NULLABLE_ID2 && this.type !== types$12.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT2)) { + this.checkLValSimple(node.id, this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? BIND_VAR2 : BIND_LEXICAL2 : BIND_FUNCTION2); + } + } + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags2(node.async, node.generator)); + if (!(statement & FUNC_STATEMENT2)) { + node.id = this.type === types$12.name ? this.parseIdent() : null; + } + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, statement & FUNC_STATEMENT2 ? "FunctionDeclaration" : "FunctionExpression"); + }; + pp$82.parseFunctionParams = function(node) { + this.expect(types$12.parenL); + node.params = this.parseBindingList(types$12.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + }; + pp$82.parseClass = function(node, isStatement) { + this.next(); + var oldStrict = this.strict; + this.strict = true; + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var privateNameMap = this.enterClassBody(); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types$12.braceL); + while (this.type !== types$12.braceR) { + var element = this.parseClassElement(node.superClass !== null); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { + this.raise(element.start, "Duplicate constructor in the same class"); + } + hadConstructor = true; + } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted2(privateNameMap, element)) { + this.raiseRecoverable(element.key.start, "Identifier '#" + element.key.name + "' has already been declared"); + } + } + } + this.strict = oldStrict; + this.next(); + node.body = this.finishNode(classBody, "ClassBody"); + this.exitClassBody(); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); + }; + pp$82.parseClassElement = function(constructorAllowsSuper) { + if (this.eat(types$12.semi)) { + return null; + } + var ecmaVersion2 = this.options.ecmaVersion; + var node = this.startNode(); + var keyName = ""; + var isGenerator = false; + var isAsync = false; + var kind = "method"; + var isStatic = false; + if (this.eatContextual("static")) { + if (ecmaVersion2 >= 13 && this.eat(types$12.braceL)) { + this.parseClassStaticBlock(node); + return node; + } + if (this.isClassElementNameStart() || this.type === types$12.star) { + isStatic = true; + } else { + keyName = "static"; + } + } + node.static = isStatic; + if (!keyName && ecmaVersion2 >= 8 && this.eatContextual("async")) { + if ((this.isClassElementNameStart() || this.type === types$12.star) && !this.canInsertSemicolon()) { + isAsync = true; + } else { + keyName = "async"; + } + } + if (!keyName && (ecmaVersion2 >= 9 || !isAsync) && this.eat(types$12.star)) { + isGenerator = true; + } + if (!keyName && !isAsync && !isGenerator) { + var lastValue = this.value; + if (this.eatContextual("get") || this.eatContextual("set")) { + if (this.isClassElementNameStart()) { + kind = lastValue; + } else { + keyName = lastValue; + } + } + } + if (keyName) { + node.computed = false; + node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); + node.key.name = keyName; + this.finishNode(node.key, "Identifier"); + } else { + this.parseClassElementName(node); + } + if (ecmaVersion2 < 13 || this.type === types$12.parenL || kind !== "method" || isGenerator || isAsync) { + var isConstructor = !node.static && checkKeyName2(node, "constructor"); + var allowsDirectSuper = isConstructor && constructorAllowsSuper; + if (isConstructor && kind !== "method") { + this.raise(node.key.start, "Constructor can't have get/set modifier"); + } + node.kind = isConstructor ? "constructor" : kind; + this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); + } else { + this.parseClassField(node); + } + return node; + }; + pp$82.isClassElementNameStart = function() { + return this.type === types$12.name || this.type === types$12.privateId || this.type === types$12.num || this.type === types$12.string || this.type === types$12.bracketL || this.type.keyword; + }; + pp$82.parseClassElementName = function(element) { + if (this.type === types$12.privateId) { + if (this.value === "constructor") { + this.raise(this.start, "Classes can't have an element named '#constructor'"); + } + element.computed = false; + element.key = this.parsePrivateIdent(); + } else { + this.parsePropertyName(element); + } + }; + pp$82.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + var key = method.key; + if (method.kind === "constructor") { + if (isGenerator) { + this.raise(key.start, "Constructor can't be a generator"); + } + if (isAsync) { + this.raise(key.start, "Constructor can't be an async method"); + } + } else if (method.static && checkKeyName2(method, "prototype")) { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + if (method.kind === "get" && value.params.length !== 0) { + this.raiseRecoverable(value.start, "getter should have no params"); + } + if (method.kind === "set" && value.params.length !== 1) { + this.raiseRecoverable(value.start, "setter should have exactly one param"); + } + if (method.kind === "set" && value.params[0].type === "RestElement") { + this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); + } + return this.finishNode(method, "MethodDefinition"); + }; + pp$82.parseClassField = function(field) { + if (checkKeyName2(field, "constructor")) { + this.raise(field.key.start, "Classes can't have a field named 'constructor'"); + } else if (field.static && checkKeyName2(field, "prototype")) { + this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); + } + if (this.eat(types$12.eq)) { + var scope = this.currentThisScope(); + var inClassFieldInit = scope.inClassFieldInit; + scope.inClassFieldInit = true; + field.value = this.parseMaybeAssign(); + scope.inClassFieldInit = inClassFieldInit; + } else { + field.value = null; + } + this.semicolon(); + return this.finishNode(field, "PropertyDefinition"); + }; + pp$82.parseClassStaticBlock = function(node) { + node.body = []; + var oldLabels = this.labels; + this.labels = []; + this.enterScope(SCOPE_CLASS_STATIC_BLOCK2 | SCOPE_SUPER2); + while (this.type !== types$12.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + this.next(); + this.exitScope(); + this.labels = oldLabels; + return this.finishNode(node, "StaticBlock"); + }; + pp$82.parseClassId = function(node, isStatement) { + if (this.type === types$12.name) { + node.id = this.parseIdent(); + if (isStatement) { + this.checkLValSimple(node.id, BIND_LEXICAL2, false); + } + } else { + if (isStatement === true) { + this.unexpected(); + } + node.id = null; + } + }; + pp$82.parseClassSuper = function(node) { + node.superClass = this.eat(types$12._extends) ? this.parseExprSubscripts(false) : null; + }; + pp$82.enterClassBody = function() { + var element = { declared: /* @__PURE__ */ Object.create(null), used: [] }; + this.privateNameStack.push(element); + return element.declared; + }; + pp$82.exitClassBody = function() { + var ref3 = this.privateNameStack.pop(); + var declared = ref3.declared; + var used = ref3.used; + var len = this.privateNameStack.length; + var parent = len === 0 ? null : this.privateNameStack[len - 1]; + for (var i2 = 0; i2 < used.length; ++i2) { + var id = used[i2]; + if (!hasOwn2(declared, id.name)) { + if (parent) { + parent.used.push(id); + } else { + this.raiseRecoverable(id.start, "Private field '#" + id.name + "' must be declared in an enclosing class"); + } + } + } + }; + function isPrivateNameConflicted2(privateNameMap, element) { + var name = element.key.name; + var curr = privateNameMap[name]; + var next = "true"; + if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { + next = (element.static ? "s" : "i") + element.kind; + } + if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") { + privateNameMap[name] = "true"; + return false; + } else if (!curr) { + privateNameMap[name] = next; + return false; + } else { + return true; + } + } + function checkKeyName2(node, name) { + var computed = node.computed; + var key = node.key; + return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name); + } + pp$82.parseExport = function(node, exports3) { + this.next(); + if (this.eat(types$12.star)) { + if (this.options.ecmaVersion >= 11) { + if (this.eatContextual("as")) { + node.exported = this.parseModuleExportName(); + this.checkExport(exports3, node.exported, this.lastTokStart); + } else { + node.exported = null; + } + } + this.expectContextual("from"); + if (this.type !== types$12.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration"); + } + if (this.eat(types$12._default)) { + this.checkExport(exports3, "default", this.lastTokStart); + var isAsync; + if (this.type === types$12._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { + this.next(); + } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT2 | FUNC_NULLABLE_ID2, false, isAsync); + } else if (this.type === types$12._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration"); + } + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") { + this.checkVariableExport(exports3, node.declaration.declarations); + } else { + this.checkExport(exports3, node.declaration.id, node.declaration.id.start); + } + node.specifiers = []; + node.source = null; + } else { + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports3); + if (this.eatContextual("from")) { + if (this.type !== types$12.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + } else { + for (var i2 = 0, list2 = node.specifiers; i2 < list2.length; i2 += 1) { + var spec = list2[i2]; + this.checkUnreserved(spec.local); + this.checkLocalExport(spec.local); + if (spec.local.type === "Literal") { + this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); + } + } + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration"); + }; + pp$82.checkExport = function(exports3, name, pos) { + if (!exports3) { + return; + } + if (typeof name !== "string") { + name = name.type === "Identifier" ? name.name : name.value; + } + if (hasOwn2(exports3, name)) { + this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); + } + exports3[name] = true; + }; + pp$82.checkPatternExport = function(exports3, pat) { + var type = pat.type; + if (type === "Identifier") { + this.checkExport(exports3, pat, pat.start); + } else if (type === "ObjectPattern") { + for (var i2 = 0, list2 = pat.properties; i2 < list2.length; i2 += 1) { + var prop = list2[i2]; + this.checkPatternExport(exports3, prop); + } + } else if (type === "ArrayPattern") { + for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + if (elt) { + this.checkPatternExport(exports3, elt); + } + } + } else if (type === "Property") { + this.checkPatternExport(exports3, pat.value); + } else if (type === "AssignmentPattern") { + this.checkPatternExport(exports3, pat.left); + } else if (type === "RestElement") { + this.checkPatternExport(exports3, pat.argument); + } else if (type === "ParenthesizedExpression") { + this.checkPatternExport(exports3, pat.expression); + } + }; + pp$82.checkVariableExport = function(exports3, decls) { + if (!exports3) { + return; + } + for (var i2 = 0, list2 = decls; i2 < list2.length; i2 += 1) { + var decl = list2[i2]; + this.checkPatternExport(exports3, decl.id); + } + }; + pp$82.shouldParseExportStatement = function() { + return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction(); + }; + pp$82.parseExportSpecifiers = function(exports3) { + var nodes = [], first = true; + this.expect(types$12.braceL); + while (!this.eat(types$12.braceR)) { + if (!first) { + this.expect(types$12.comma); + if (this.afterTrailingComma(types$12.braceR)) { + break; + } + } else { + first = false; + } + var node = this.startNode(); + node.local = this.parseModuleExportName(); + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports3, + node.exported, + node.exported.start + ); + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + return nodes; + }; + pp$82.parseImport = function(node) { + this.next(); + if (this.type === types$12.string) { + node.specifiers = empty$12; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types$12.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + }; + pp$82.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types$12.name) { + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLValSimple(node.local, BIND_LEXICAL2); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types$12.comma)) { + return nodes; + } + } + if (this.type === types$12.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLValSimple(node$1.local, BIND_LEXICAL2); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes; + } + this.expect(types$12.braceL); + while (!this.eat(types$12.braceR)) { + if (!first) { + this.expect(types$12.comma); + if (this.afterTrailingComma(types$12.braceR)) { + break; + } + } else { + first = false; + } + var node$2 = this.startNode(); + node$2.imported = this.parseModuleExportName(); + if (this.eatContextual("as")) { + node$2.local = this.parseIdent(); + } else { + this.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this.checkLValSimple(node$2.local, BIND_LEXICAL2); + nodes.push(this.finishNode(node$2, "ImportSpecifier")); + } + return nodes; + }; + pp$82.parseModuleExportName = function() { + if (this.options.ecmaVersion >= 13 && this.type === types$12.string) { + var stringLiteral = this.parseLiteral(this.value); + if (loneSurrogate2.test(stringLiteral.value)) { + this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); + } + return stringLiteral; + } + return this.parseIdent(true); + }; + pp$82.adaptDirectivePrologue = function(statements) { + for (var i2 = 0; i2 < statements.length && this.isDirectiveCandidate(statements[i2]); ++i2) { + statements[i2].directive = statements[i2].expression.raw.slice(1, -1); + } + }; + pp$82.isDirectiveCandidate = function(statement) { + return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && (this.input[statement.start] === '"' || this.input[statement.start] === "'"); + }; + var pp$72 = Parser3.prototype; + pp$72.toAssignable = function(node, isBinding, refDestructuringErrors) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") { + this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); + } + break; + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + break; + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + for (var i2 = 0, list2 = node.properties; i2 < list2.length; i2 += 1) { + var prop = list2[i2]; + this.toAssignable(prop, isBinding); + if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) { + this.raise(prop.argument.start, "Unexpected token"); + } + } + break; + case "Property": + if (node.kind !== "init") { + this.raise(node.key.start, "Object pattern can't contain getter or setter"); + } + this.toAssignable(node.value, isBinding); + break; + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + this.toAssignableList(node.elements, isBinding); + break; + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") { + this.raise(node.argument.start, "Rest elements cannot have a default value"); + } + break; + case "AssignmentExpression": + if (node.operator !== "=") { + this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); + } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + break; + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break; + case "ChainExpression": + this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (!isBinding) { + break; + } + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + return node; + }; + pp$72.toAssignableList = function(exprList, isBinding) { + var end = exprList.length; + for (var i2 = 0; i2 < end; i2++) { + var elt = exprList[i2]; + if (elt) { + this.toAssignable(elt, isBinding); + } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") { + this.unexpected(last.argument.start); + } + } + return exprList; + }; + pp$72.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement"); + }; + pp$72.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + if (this.options.ecmaVersion === 6 && this.type !== types$12.name) { + this.unexpected(); + } + node.argument = this.parseBindingAtom(); + return this.finishNode(node, "RestElement"); + }; + pp$72.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types$12.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types$12.bracketR, true, true); + return this.finishNode(node, "ArrayPattern"); + case types$12.braceL: + return this.parseObj(true); + } + } + return this.parseIdent(); + }; + pp$72.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(types$12.comma); + } + if (allowEmpty && this.type === types$12.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } else if (this.type === types$12.ellipsis) { + var rest = this.parseRestBinding(); + this.parseBindingListItem(rest); + elts.push(rest); + if (this.type === types$12.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + this.expect(close); + break; + } else { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts; + }; + pp$72.parseBindingListItem = function(param) { + return param; + }; + pp$72.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types$12.eq)) { + return left; + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern"); + }; + pp$72.checkLValSimple = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE2; + var isBind = bindingType !== BIND_NONE2; + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { + this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); + } + if (isBind) { + if (bindingType === BIND_LEXICAL2 && expr.name === "let") { + this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); + } + if (checkClashes) { + if (hasOwn2(checkClashes, expr.name)) { + this.raiseRecoverable(expr.start, "Argument name clash"); + } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_OUTSIDE2) { + this.declareName(expr.name, bindingType, expr.start); + } + } + break; + case "ChainExpression": + this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding member expression"); + } + break; + case "ParenthesizedExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding parenthesized expression"); + } + return this.checkLValSimple(expr.expression, bindingType, checkClashes); + default: + this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); + } + }; + pp$72.checkLValPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE2; + switch (expr.type) { + case "ObjectPattern": + for (var i2 = 0, list2 = expr.properties; i2 < list2.length; i2 += 1) { + var prop = list2[i2]; + this.checkLValInnerPattern(prop, bindingType, checkClashes); + } + break; + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + if (elem) { + this.checkLValInnerPattern(elem, bindingType, checkClashes); + } + } + break; + default: + this.checkLValSimple(expr, bindingType, checkClashes); + } + }; + pp$72.checkLValInnerPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE2; + switch (expr.type) { + case "Property": + this.checkLValInnerPattern(expr.value, bindingType, checkClashes); + break; + case "AssignmentPattern": + this.checkLValPattern(expr.left, bindingType, checkClashes); + break; + case "RestElement": + this.checkLValPattern(expr.argument, bindingType, checkClashes); + break; + default: + this.checkLValPattern(expr, bindingType, checkClashes); + } + }; + var TokContext3 = function TokContext4(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; + }; + var types2 = { + b_stat: new TokContext3("{", false), + b_expr: new TokContext3("{", true), + b_tmpl: new TokContext3("${", false), + p_stat: new TokContext3("(", false), + p_expr: new TokContext3("(", true), + q_tmpl: new TokContext3("`", true, true, function(p) { + return p.tryReadTemplateToken(); + }), + f_stat: new TokContext3("function", false), + f_expr: new TokContext3("function", true), + f_expr_gen: new TokContext3("function", true, false, null, true), + f_gen: new TokContext3("function", false, false, null, true) + }; + var pp$62 = Parser3.prototype; + pp$62.initialContext = function() { + return [types2.b_stat]; + }; + pp$62.curContext = function() { + return this.context[this.context.length - 1]; + }; + pp$62.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types2.f_expr || parent === types2.f_stat) { + return true; + } + if (prevType === types$12.colon && (parent === types2.b_stat || parent === types2.b_expr)) { + return !parent.isExpr; + } + if (prevType === types$12._return || prevType === types$12.name && this.exprAllowed) { + return lineBreak2.test(this.input.slice(this.lastTokEnd, this.start)); + } + if (prevType === types$12._else || prevType === types$12.semi || prevType === types$12.eof || prevType === types$12.parenR || prevType === types$12.arrow) { + return true; + } + if (prevType === types$12.braceL) { + return parent === types2.b_stat; + } + if (prevType === types$12._var || prevType === types$12._const || prevType === types$12.name) { + return false; + } + return !this.exprAllowed; + }; + pp$62.inGeneratorContext = function() { + for (var i2 = this.context.length - 1; i2 >= 1; i2--) { + var context = this.context[i2]; + if (context.token === "function") { + return context.generator; + } + } + return false; + }; + pp$62.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types$12.dot) { + this.exprAllowed = false; + } else if (update = type.updateContext) { + update.call(this, prevType); + } else { + this.exprAllowed = type.beforeExpr; + } + }; + pp$62.overrideContext = function(tokenCtx) { + if (this.curContext() !== tokenCtx) { + this.context[this.context.length - 1] = tokenCtx; + } + }; + types$12.parenR.updateContext = types$12.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return; + } + var out = this.context.pop(); + if (out === types2.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; + }; + types$12.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types2.b_stat : types2.b_expr); + this.exprAllowed = true; + }; + types$12.dollarBraceL.updateContext = function() { + this.context.push(types2.b_tmpl); + this.exprAllowed = true; + }; + types$12.parenL.updateContext = function(prevType) { + var statementParens = prevType === types$12._if || prevType === types$12._for || prevType === types$12._with || prevType === types$12._while; + this.context.push(statementParens ? types2.p_stat : types2.p_expr); + this.exprAllowed = true; + }; + types$12.incDec.updateContext = function() { + }; + types$12._function.updateContext = types$12._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types$12._else && !(prevType === types$12.semi && this.curContext() !== types2.p_stat) && !(prevType === types$12._return && lineBreak2.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types$12.colon || prevType === types$12.braceL) && this.curContext() === types2.b_stat)) { + this.context.push(types2.f_expr); + } else { + this.context.push(types2.f_stat); + } + this.exprAllowed = false; + }; + types$12.backQuote.updateContext = function() { + if (this.curContext() === types2.q_tmpl) { + this.context.pop(); + } else { + this.context.push(types2.q_tmpl); + } + this.exprAllowed = false; + }; + types$12.star.updateContext = function(prevType) { + if (prevType === types$12._function) { + var index2 = this.context.length - 1; + if (this.context[index2] === types2.f_expr) { + this.context[index2] = types2.f_expr_gen; + } else { + this.context[index2] = types2.f_gen; + } + } + this.exprAllowed = true; + }; + types$12.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types$12.dot) { + if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { + allowed = true; + } + } + this.exprAllowed = allowed; + }; + var pp$52 = Parser3.prototype; + pp$52.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { + return; + } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) { + return; + } + var key = prop.key; + var name; + switch (key.type) { + case "Identifier": + name = key.name; + break; + case "Literal": + name = String(key.value); + break; + default: + return; + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors) { + if (refDestructuringErrors.doubleProto < 0) { + refDestructuringErrors.doubleProto = key.start; + } + } else { + this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); + } + } + propHash.proto = true; + } + return; + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) { + this.raiseRecoverable(key.start, "Redefinition of property"); + } + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; + }; + pp$52.parseExpression = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); + if (this.type === types$12.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types$12.comma)) { + node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); + } + return this.finishNode(node, "SequenceExpression"); + } + return expr; + }; + pp$52.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { + return this.parseYield(forInit); + } else { + this.exprAllowed = false; + } + } + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors3(); + ownDestructuringErrors = true; + } + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types$12.parenL || this.type === types$12.name) { + this.potentialArrowAt = this.start; + this.potentialArrowInForAwait = forInit === "await"; + } + var left = this.parseMaybeConditional(forInit, refDestructuringErrors); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startPos, startLoc); + } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + if (this.type === types$12.eq) { + left = this.toAssignable(left, false, refDestructuringErrors); + } + if (!ownDestructuringErrors) { + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; + } + if (refDestructuringErrors.shorthandAssign >= left.start) { + refDestructuringErrors.shorthandAssign = -1; + } + if (this.type === types$12.eq) { + this.checkLValPattern(left); + } else { + this.checkLValSimple(left); + } + node.left = left; + this.next(); + node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) { + refDestructuringErrors.doubleProto = oldDoubleProto; + } + return this.finishNode(node, "AssignmentExpression"); + } else { + if (ownDestructuringErrors) { + this.checkExpressionErrors(refDestructuringErrors, true); + } + } + if (oldParenAssign > -1) { + refDestructuringErrors.parenthesizedAssign = oldParenAssign; + } + if (oldTrailingComma > -1) { + refDestructuringErrors.trailingComma = oldTrailingComma; + } + return left; + }; + pp$52.parseMaybeConditional = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(forInit, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + if (this.eat(types$12.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types$12.colon); + node.alternate = this.parseMaybeAssign(forInit); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; + }; + pp$52.parseExprOps = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit); + }; + pp$52.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { + var prec = this.type.binop; + if (prec != null && (!forInit || this.type !== types$12._in)) { + if (prec > minPrec) { + var logical = this.type === types$12.logicalOR || this.type === types$12.logicalAND; + var coalesce = this.type === types$12.coalesce; + if (coalesce) { + prec = types$12.logicalAND.binop; + } + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); + if (logical && this.type === types$12.coalesce || coalesce && (this.type === types$12.logicalOR || this.type === types$12.logicalAND)) { + this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); + } + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit); + } + } + return left; + }; + pp$52.buildBinary = function(startPos, startLoc, left, right, op, logical) { + if (right.type === "PrivateIdentifier") { + this.raise(right.start, "Private identifier can only be left side of binary expression"); + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression"); + }; + pp$52.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && this.canAwait) { + expr = this.parseAwait(forInit); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types$12.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true, update, forInit); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { + this.checkLValSimple(node.argument); + } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { + this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); + } else if (node.operator === "delete" && isPrivateFieldAccess2(node.argument)) { + this.raiseRecoverable(node.start, "Private fields can not be deleted"); + } else { + sawUnary = true; + } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else if (!sawUnary && this.type === types$12.privateId) { + if (forInit || this.privateNameStack.length === 0) { + this.unexpected(); + } + expr = this.parsePrivateIdent(); + if (this.type !== types$12._in) { + this.unexpected(); + } + } else { + expr = this.parseExprSubscripts(refDestructuringErrors, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.operator = this.value; + node$1.prefix = false; + node$1.argument = expr; + this.checkLValSimple(expr); + this.next(); + expr = this.finishNode(node$1, "UpdateExpression"); + } + } + if (!incDec && this.eat(types$12.starstar)) { + if (sawUnary) { + this.unexpected(this.lastTokStart); + } else { + return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false); + } + } else { + return expr; + } + }; + function isPrivateFieldAccess2(node) { + return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess2(node.expression); + } + pp$52.parseExprSubscripts = function(refDestructuringErrors, forInit) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors, forInit); + if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") { + return expr; + } + var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { + refDestructuringErrors.parenthesizedAssign = -1; + } + if (refDestructuringErrors.parenthesizedBind >= result.start) { + refDestructuringErrors.parenthesizedBind = -1; + } + if (refDestructuringErrors.trailingComma >= result.start) { + refDestructuringErrors.trailingComma = -1; + } + } + return result; + }; + pp$52.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.potentialArrowAt === base.start; + var optionalChained = false; + while (true) { + var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); + if (element.optional) { + optionalChained = true; + } + if (element === base || element.type === "ArrowFunctionExpression") { + if (optionalChained) { + var chainNode = this.startNodeAt(startPos, startLoc); + chainNode.expression = element; + element = this.finishNode(chainNode, "ChainExpression"); + } + return element; + } + base = element; + } + }; + pp$52.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { + var optionalSupported = this.options.ecmaVersion >= 11; + var optional = optionalSupported && this.eat(types$12.questionDot); + if (noCalls && optional) { + this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); + } + var computed = this.eat(types$12.bracketL); + if (computed || optional && this.type !== types$12.parenL && this.type !== types$12.backQuote || this.eat(types$12.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + if (computed) { + node.property = this.parseExpression(); + this.expect(types$12.bracketR); + } else if (this.type === types$12.privateId && base.type !== "Super") { + node.property = this.parsePrivateIdent(); + } else { + node.property = this.parseIdent(this.options.allowReserved !== "never"); + } + node.computed = !!computed; + if (optionalSupported) { + node.optional = optional; + } + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types$12.parenL)) { + var refDestructuringErrors = new DestructuringErrors3(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types$12.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$12.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) { + this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); + } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + if (optionalSupported) { + node$1.optional = optional; + } + base = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types$12.backQuote) { + if (optional || optionalChained) { + this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); + } + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this.parseTemplate({ isTagged: true }); + base = this.finishNode(node$2, "TaggedTemplateExpression"); + } + return base; + }; + pp$52.parseExprAtom = function(refDestructuringErrors, forInit) { + if (this.type === types$12.slash) { + this.readRegexp(); + } + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types$12._super: + if (!this.allowSuper) { + this.raise(this.start, "'super' keyword outside a method"); + } + node = this.startNode(); + this.next(); + if (this.type === types$12.parenL && !this.allowDirectSuper) { + this.raise(node.start, "super() call outside constructor of a subclass"); + } + if (this.type !== types$12.dot && this.type !== types$12.bracketL && this.type !== types$12.parenL) { + this.unexpected(); + } + return this.finishNode(node, "Super"); + case types$12._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); + case types$12.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$12._function)) { + this.overrideContext(types2.f_expr); + return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit); + } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types$12.arrow)) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit); + } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$12.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types$12.arrow)) { + this.unexpected(); + } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit); + } + } + return id; + case types$12.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = { pattern: value.pattern, flags: value.flags }; + return node; + case types$12.num: + case types$12.string: + return this.parseLiteral(this.value); + case types$12._null: + case types$12._true: + case types$12._false: + node = this.startNode(); + node.value = this.type === types$12._null ? null : this.type === types$12._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal"); + case types$12.parenL: + var start3 = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { + refDestructuringErrors.parenthesizedAssign = start3; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = start3; + } + } + return expr; + case types$12.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types$12.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression"); + case types$12.braceL: + this.overrideContext(types2.b_expr); + return this.parseObj(false, refDestructuringErrors); + case types$12._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0); + case types$12._class: + return this.parseClass(this.startNode(), false); + case types$12._new: + return this.parseNew(); + case types$12.backQuote: + return this.parseTemplate(); + case types$12._import: + if (this.options.ecmaVersion >= 11) { + return this.parseExprImport(); + } else { + return this.unexpected(); + } + default: + this.unexpected(); + } + }; + pp$52.parseExprImport = function() { + var node = this.startNode(); + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword import"); + } + var meta = this.parseIdent(true); + switch (this.type) { + case types$12.parenL: + return this.parseDynamicImport(node); + case types$12.dot: + node.meta = meta; + return this.parseImportMeta(node); + default: + this.unexpected(); + } + }; + pp$52.parseDynamicImport = function(node) { + this.next(); + node.source = this.parseMaybeAssign(); + if (!this.eat(types$12.parenR)) { + var errorPos = this.start; + if (this.eat(types$12.comma) && this.eat(types$12.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); + } + } + return this.finishNode(node, "ImportExpression"); + }; + pp$52.parseImportMeta = function(node) { + this.next(); + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "meta") { + this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); + } + if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) { + this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); + } + return this.finishNode(node, "MetaProperty"); + }; + pp$52.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { + node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); + } + this.next(); + return this.finishNode(node, "Literal"); + }; + pp$52.parseParenExpression = function() { + this.expect(types$12.parenL); + var val = this.parseExpression(); + this.expect(types$12.parenR); + return val; + }; + pp$52.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors3(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + while (this.type !== types$12.parenR) { + first ? first = false : this.expect(types$12.comma); + if (allowTrailingComma && this.afterTrailingComma(types$12.parenR, true)) { + lastIsComma = true; + break; + } else if (this.type === types$12.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === types$12.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + break; + } else { + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); + } + } + var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; + this.expect(types$12.parenR); + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$12.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList, forInit); + } + if (!exprList.length || lastIsComma) { + this.unexpected(this.lastTokStart); + } + if (spreadStart) { + this.unexpected(spreadStart); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression"); + } else { + return val; + } + }; + pp$52.parseParenItem = function(item) { + return item; + }; + pp$52.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit); + }; + var empty3 = []; + pp$52.parseNew = function() { + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword new"); + } + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types$12.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target") { + this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); + } + if (!this.allowNewDotTarget) { + this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); + } + return this.finishNode(node, "MetaProperty"); + } + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$12._import; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); + if (isImport && node.callee.type === "ImportExpression") { + this.raise(startPos, "Cannot use new with import()"); + } + if (this.eat(types$12.parenL)) { + node.arguments = this.parseExprList(types$12.parenR, this.options.ecmaVersion >= 8, false); + } else { + node.arguments = empty3; + } + return this.finishNode(node, "NewExpression"); + }; + pp$52.parseTemplateElement = function(ref3) { + var isTagged = ref3.isTagged; + var elem = this.startNode(); + if (this.type === types$12.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types$12.backQuote; + return this.finishNode(elem, "TemplateElement"); + }; + pp$52.parseTemplate = function(ref3) { + if (ref3 === void 0) + ref3 = {}; + var isTagged = ref3.isTagged; + if (isTagged === void 0) + isTagged = false; + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({ isTagged }); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === types$12.eof) { + this.raise(this.pos, "Unterminated template literal"); + } + this.expect(types$12.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(types$12.braceR); + node.quasis.push(curElt = this.parseTemplateElement({ isTagged })); + } + this.next(); + return this.finishNode(node, "TemplateLiteral"); + }; + pp$52.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types$12.name || this.type === types$12.num || this.type === types$12.string || this.type === types$12.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types$12.star) && !lineBreak2.test(this.input.slice(this.lastTokEnd, this.start)); + }; + pp$52.parseObj = function(isPattern, refDestructuringErrors) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types$12.braceR)) { + if (!first) { + this.expect(types$12.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$12.braceR)) { + break; + } + } else { + first = false; + } + var prop = this.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { + this.checkPropClash(prop, propHash, refDestructuringErrors); + } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); + }; + pp$52.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types$12.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types$12.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement"); + } + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + if (this.type === types$12.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + return this.finishNode(prop, "SpreadElement"); + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) { + isGenerator = this.eat(types$12.star); + } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$12.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property"); + }; + pp$52.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types$12.colon) { + this.unexpected(); + } + if (this.eat(types$12.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types$12.parenL) { + if (isPattern) { + this.unexpected(); + } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types$12.comma && this.type !== types$12.braceR && this.type !== types$12.eq)) { + if (isGenerator || isAsync) { + this.unexpected(); + } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start3 = prop.value.start; + if (prop.kind === "get") { + this.raiseRecoverable(start3, "getter should have no params"); + } else { + this.raiseRecoverable(start3, "setter should have exactly one param"); + } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { + this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); + } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { + this.unexpected(); + } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = startPos; + } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else if (this.type === types$12.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) { + refDestructuringErrors.shorthandAssign = this.start; + } + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else { + prop.value = this.copyNode(prop.key); + } + prop.shorthand = true; + } else { + this.unexpected(); + } + }; + pp$52.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types$12.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types$12.bracketR); + return prop.key; + } else { + prop.computed = false; + } + } + return prop.key = this.type === types$12.num || this.type === types$12.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"); + }; + pp$52.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { + node.generator = node.expression = false; + } + if (this.options.ecmaVersion >= 8) { + node.async = false; + } + }; + pp$52.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.initFunction(node); + if (this.options.ecmaVersion >= 6) { + node.generator = isGenerator; + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags2(isAsync, node.generator) | SCOPE_SUPER2 | (allowDirectSuper ? SCOPE_DIRECT_SUPER2 : 0)); + this.expect(types$12.parenL); + node.params = this.parseBindingList(types$12.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true, false); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression"); + }; + pp$52.parseArrowExpression = function(node, params, isAsync, forInit) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.enterScope(functionFlags2(isAsync, false) | SCOPE_ARROW2); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression"); + }; + pp$52.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { + var isExpression = isArrowFunction && this.type !== types$12.braceL; + var oldStrict = this.strict, useStrict = false; + if (isExpression) { + node.body = this.parseMaybeAssign(forInit); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + if (useStrict && nonSimple) { + this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); + } + } + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { + this.strict = true; + } + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + if (this.strict && node.id) { + this.checkLValSimple(node.id, BIND_OUTSIDE2); + } + node.body = this.parseBlock(false, void 0, useStrict && !oldStrict); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); + }; + pp$52.isSimpleParamList = function(params) { + for (var i2 = 0, list2 = params; i2 < list2.length; i2 += 1) { + var param = list2[i2]; + if (param.type !== "Identifier") { + return false; + } + } + return true; + }; + pp$52.checkParams = function(node, allowDuplicates) { + var nameHash = /* @__PURE__ */ Object.create(null); + for (var i2 = 0, list2 = node.params; i2 < list2.length; i2 += 1) { + var param = list2[i2]; + this.checkLValInnerPattern(param, BIND_VAR2, allowDuplicates ? null : nameHash); + } + }; + pp$52.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(types$12.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } + } else { + first = false; + } + var elt = void 0; + if (allowEmpty && this.type === types$12.comma) { + elt = null; + } else if (this.type === types$12.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this.type === types$12.comma && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts; + }; + pp$52.checkUnreserved = function(ref3) { + var start3 = ref3.start; + var end = ref3.end; + var name = ref3.name; + if (this.inGenerator && name === "yield") { + this.raiseRecoverable(start3, "Cannot use 'yield' as identifier inside a generator"); + } + if (this.inAsync && name === "await") { + this.raiseRecoverable(start3, "Cannot use 'await' as identifier inside an async function"); + } + if (this.currentThisScope().inClassFieldInit && name === "arguments") { + this.raiseRecoverable(start3, "Cannot use 'arguments' in class field initializer"); + } + if (this.inClassStaticBlock && (name === "arguments" || name === "await")) { + this.raise(start3, "Cannot use " + name + " in class static initialization block"); + } + if (this.keywords.test(name)) { + this.raise(start3, "Unexpected keyword '" + name + "'"); + } + if (this.options.ecmaVersion < 6 && this.input.slice(start3, end).indexOf("\\") !== -1) { + return; + } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") { + this.raiseRecoverable(start3, "Cannot use keyword 'await' outside an async function"); + } + this.raiseRecoverable(start3, "The keyword '" + name + "' is reserved"); + } + }; + pp$52.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (this.type === types$12.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(!!liberal); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = node.start; + } + } + return node; + }; + pp$52.parsePrivateIdent = function() { + var node = this.startNode(); + if (this.type === types$12.privateId) { + node.name = this.value; + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "PrivateIdentifier"); + if (this.privateNameStack.length === 0) { + this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class"); + } else { + this.privateNameStack[this.privateNameStack.length - 1].used.push(node); + } + return node; + }; + pp$52.parseYield = function(forInit) { + if (!this.yieldPos) { + this.yieldPos = this.start; + } + var node = this.startNode(); + this.next(); + if (this.type === types$12.semi || this.canInsertSemicolon() || this.type !== types$12.star && !this.type.startsExpr) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types$12.star); + node.argument = this.parseMaybeAssign(forInit); + } + return this.finishNode(node, "YieldExpression"); + }; + pp$52.parseAwait = function(forInit) { + if (!this.awaitPos) { + this.awaitPos = this.start; + } + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true, false, forInit); + return this.finishNode(node, "AwaitExpression"); + }; + var pp$42 = Parser3.prototype; + pp$42.raise = function(pos, message) { + var loc = getLineInfo2(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; + err.loc = loc; + err.raisedAt = this.pos; + throw err; + }; + pp$42.raiseRecoverable = pp$42.raise; + pp$42.curPosition = function() { + if (this.options.locations) { + return new Position3(this.curLine, this.pos - this.lineStart); + } + }; + var pp$32 = Parser3.prototype; + var Scope3 = function Scope4(flags) { + this.flags = flags; + this.var = []; + this.lexical = []; + this.functions = []; + this.inClassFieldInit = false; + }; + pp$32.enterScope = function(flags) { + this.scopeStack.push(new Scope3(flags)); + }; + pp$32.exitScope = function() { + this.scopeStack.pop(); + }; + pp$32.treatFunctionsAsVarInScope = function(scope) { + return scope.flags & SCOPE_FUNCTION2 || !this.inModule && scope.flags & SCOPE_TOP2; + }; + pp$32.declareName = function(name, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL2) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + if (this.inModule && scope.flags & SCOPE_TOP2) { + delete this.undefinedExports[name]; + } + } else if (bindingType === BIND_SIMPLE_CATCH2) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION2) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) { + redeclared = scope$2.lexical.indexOf(name) > -1; + } else { + redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; + } + scope$2.functions.push(name); + } else { + for (var i2 = this.scopeStack.length - 1; i2 >= 0; --i2) { + var scope$3 = this.scopeStack[i2]; + if (scope$3.lexical.indexOf(name) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH2 && scope$3.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { + redeclared = true; + break; + } + scope$3.var.push(name); + if (this.inModule && scope$3.flags & SCOPE_TOP2) { + delete this.undefinedExports[name]; + } + if (scope$3.flags & SCOPE_VAR2) { + break; + } + } + } + if (redeclared) { + this.raiseRecoverable(pos, "Identifier '" + name + "' has already been declared"); + } + }; + pp$32.checkLocalExport = function(id) { + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } + }; + pp$32.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1]; + }; + pp$32.currentVarScope = function() { + for (var i2 = this.scopeStack.length - 1; ; i2--) { + var scope = this.scopeStack[i2]; + if (scope.flags & SCOPE_VAR2) { + return scope; + } + } + }; + pp$32.currentThisScope = function() { + for (var i2 = this.scopeStack.length - 1; ; i2--) { + var scope = this.scopeStack[i2]; + if (scope.flags & SCOPE_VAR2 && !(scope.flags & SCOPE_ARROW2)) { + return scope; + } + } + }; + var Node3 = function Node4(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) { + this.loc = new SourceLocation3(parser, loc); + } + if (parser.options.directSourceFile) { + this.sourceFile = parser.options.directSourceFile; + } + if (parser.options.ranges) { + this.range = [pos, 0]; + } + }; + var pp$22 = Parser3.prototype; + pp$22.startNode = function() { + return new Node3(this, this.start, this.startLoc); + }; + pp$22.startNodeAt = function(pos, loc) { + return new Node3(this, pos, loc); + }; + function finishNodeAt2(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) { + node.loc.end = loc; + } + if (this.options.ranges) { + node.range[1] = pos; + } + return node; + } + pp$22.finishNode = function(node, type) { + return finishNodeAt2.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc); + }; + pp$22.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt2.call(this, node, type, pos, loc); + }; + pp$22.copyNode = function(node) { + var newNode = new Node3(this, node.start, this.startLoc); + for (var prop in node) { + newNode[prop] = node[prop]; + } + return newNode; + }; + var ecma9BinaryProperties2 = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; + var ecma10BinaryProperties2 = ecma9BinaryProperties2 + " Extended_Pictographic"; + var ecma11BinaryProperties2 = ecma10BinaryProperties2; + var ecma12BinaryProperties2 = ecma11BinaryProperties2 + " EBase EComp EMod EPres ExtPict"; + var ecma13BinaryProperties2 = ecma12BinaryProperties2; + var unicodeBinaryProperties2 = { + 9: ecma9BinaryProperties2, + 10: ecma10BinaryProperties2, + 11: ecma11BinaryProperties2, + 12: ecma12BinaryProperties2, + 13: ecma13BinaryProperties2 + }; + var unicodeGeneralCategoryValues2 = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; + var ecma9ScriptValues2 = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var ecma10ScriptValues2 = ecma9ScriptValues2 + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; + var ecma11ScriptValues2 = ecma10ScriptValues2 + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; + var ecma12ScriptValues2 = ecma11ScriptValues2 + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; + var ecma13ScriptValues2 = ecma12ScriptValues2 + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; + var unicodeScriptValues2 = { + 9: ecma9ScriptValues2, + 10: ecma10ScriptValues2, + 11: ecma11ScriptValues2, + 12: ecma12ScriptValues2, + 13: ecma13ScriptValues2 + }; + var data2 = {}; + function buildUnicodeData2(ecmaVersion2) { + var d = data2[ecmaVersion2] = { + binary: wordsRegexp2(unicodeBinaryProperties2[ecmaVersion2] + " " + unicodeGeneralCategoryValues2), + nonBinary: { + General_Category: wordsRegexp2(unicodeGeneralCategoryValues2), + Script: wordsRegexp2(unicodeScriptValues2[ecmaVersion2]) + } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; + } + for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) { + var ecmaVersion = list[i]; + buildUnicodeData2(ecmaVersion); + } + var pp$12 = Parser3.prototype; + var RegExpValidationState3 = function RegExpValidationState4(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); + this.unicodeProperties = data2[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; + }; + RegExpValidationState3.prototype.reset = function reset2(start3, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start3 | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; + }; + RegExpValidationState3.prototype.raise = function raise2(message) { + this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message); + }; + RegExpValidationState3.prototype.at = function at2(i2, forceU) { + if (forceU === void 0) + forceU = false; + var s = this.source; + var l = s.length; + if (i2 >= l) { + return -1; + } + var c = s.charCodeAt(i2); + if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i2 + 1 >= l) { + return c; + } + var next = s.charCodeAt(i2 + 1); + return next >= 56320 && next <= 57343 ? (c << 10) + next - 56613888 : c; + }; + RegExpValidationState3.prototype.nextIndex = function nextIndex2(i2, forceU) { + if (forceU === void 0) + forceU = false; + var s = this.source; + var l = s.length; + if (i2 >= l) { + return l; + } + var c = s.charCodeAt(i2), next; + if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i2 + 1 >= l || (next = s.charCodeAt(i2 + 1)) < 56320 || next > 57343) { + return i2 + 1; + } + return i2 + 2; + }; + RegExpValidationState3.prototype.current = function current2(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.pos, forceU); + }; + RegExpValidationState3.prototype.lookahead = function lookahead2(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.nextIndex(this.pos, forceU), forceU); + }; + RegExpValidationState3.prototype.advance = function advance2(forceU) { + if (forceU === void 0) + forceU = false; + this.pos = this.nextIndex(this.pos, forceU); + }; + RegExpValidationState3.prototype.eat = function eat2(ch, forceU) { + if (forceU === void 0) + forceU = false; + if (this.current(forceU) === ch) { + this.advance(forceU); + return true; + } + return false; + }; + pp$12.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; + for (var i2 = 0; i2 < flags.length; i2++) { + var flag = flags.charAt(i2); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i2 + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + } + }; + pp$12.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } + }; + pp$12.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + this.regexp_disjunction(state); + if (state.pos !== state.source.length) { + if (state.eat(41)) { + state.raise("Unmatched ')'"); + } + if (state.eat(93) || state.eat(125)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i2 = 0, list2 = state.backReferenceNames; i2 < list2.length; i2 += 1) { + var name = list2[i2]; + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } + }; + pp$12.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat(124)) { + this.regexp_alternative(state); + } + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(123)) { + state.raise("Lone quantifier brackets"); + } + }; + pp$12.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) { + } + }; + pp$12.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true; + } + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true; + } + return false; + }; + pp$12.regexp_eatAssertion = function(state) { + var start3 = state.pos; + state.lastAssertionIsQuantifiable = false; + if (state.eat(94) || state.eat(36)) { + return true; + } + if (state.eat(92)) { + if (state.eat(66) || state.eat(98)) { + return true; + } + state.pos = start3; + } + if (state.eat(40) && state.eat(63)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(60); + } + if (state.eat(61) || state.eat(33)) { + this.regexp_disjunction(state); + if (!state.eat(41)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true; + } + } + state.pos = start3; + return false; + }; + pp$12.regexp_eatQuantifier = function(state, noError) { + if (noError === void 0) + noError = false; + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(63); + return true; + } + return false; + }; + pp$12.regexp_eatQuantifierPrefix = function(state, noError) { + return state.eat(42) || state.eat(43) || state.eat(63) || this.regexp_eatBracedQuantifier(state, noError); + }; + pp$12.regexp_eatBracedQuantifier = function(state, noError) { + var start3 = state.pos; + if (state.eat(123)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(44) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(125)) { + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true; + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatAtom = function(state) { + return this.regexp_eatPatternCharacters(state) || state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state); + }; + pp$12.regexp_eatReverseSolidusAtomEscape = function(state) { + var start3 = state.pos; + if (state.eat(92)) { + if (this.regexp_eatAtomEscape(state)) { + return true; + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatUncapturingGroup = function(state) { + var start3 = state.pos; + if (state.eat(40)) { + if (state.eat(63) && state.eat(58)) { + this.regexp_disjunction(state); + if (state.eat(41)) { + return true; + } + state.raise("Unterminated group"); + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatCapturingGroup = function(state) { + if (state.eat(40)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 63) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(41)) { + state.numCapturingParens += 1; + return true; + } + state.raise("Unterminated group"); + } + return false; + }; + pp$12.regexp_eatExtendedAtom = function(state) { + return state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state); + }; + pp$12.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false; + }; + pp$12.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter2(ch)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; + }; + function isSyntaxCharacter2(ch) { + return ch === 36 || ch >= 40 && ch <= 43 || ch === 46 || ch === 63 || ch >= 91 && ch <= 94 || ch >= 123 && ch <= 125; + } + pp$12.regexp_eatPatternCharacters = function(state) { + var start3 = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter2(ch)) { + state.advance(); + } + return state.pos !== start3; + }; + pp$12.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if (ch !== -1 && ch !== 36 && !(ch >= 40 && ch <= 43) && ch !== 46 && ch !== 63 && ch !== 91 && ch !== 94 && ch !== 124) { + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_groupSpecifier = function(state) { + if (state.eat(63)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return; + } + state.raise("Invalid group"); + } + }; + pp$12.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(60)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(62)) { + return true; + } + state.raise("Invalid capture group name"); + } + return false; + }; + pp$12.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString2(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString2(state.lastIntValue); + } + return true; + } + return false; + }; + pp$12.regexp_eatRegExpIdentifierStart = function(state) { + var start3 = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart2(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start3; + return false; + }; + function isRegExpIdentifierStart2(ch) { + return isIdentifierStart2(ch, true) || ch === 36 || ch === 95; + } + pp$12.regexp_eatRegExpIdentifierPart = function(state) { + var start3 = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart2(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start3; + return false; + }; + function isRegExpIdentifierPart2(ch) { + return isIdentifierChar2(ch, true) || ch === 36 || ch === 95 || ch === 8204 || ch === 8205; + } + pp$12.regexp_eatAtomEscape = function(state) { + if (this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || state.switchN && this.regexp_eatKGroupName(state)) { + return true; + } + if (state.switchU) { + if (state.current() === 99) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false; + }; + pp$12.regexp_eatBackReference = function(state) { + var start3 = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true; + } + if (n <= state.numCapturingParens) { + return true; + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatKGroupName = function(state) { + if (state.eat(107)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true; + } + state.raise("Invalid named reference"); + } + return false; + }; + pp$12.regexp_eatCharacterEscape = function(state) { + return this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || !state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state) || this.regexp_eatIdentityEscape(state); + }; + pp$12.regexp_eatCControlLetter = function(state) { + var start3 = state.pos; + if (state.eat(99)) { + if (this.regexp_eatControlLetter(state)) { + return true; + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatZero = function(state) { + if (state.current() === 48 && !isDecimalDigit2(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 116) { + state.lastIntValue = 9; + state.advance(); + return true; + } + if (ch === 110) { + state.lastIntValue = 10; + state.advance(); + return true; + } + if (ch === 118) { + state.lastIntValue = 11; + state.advance(); + return true; + } + if (ch === 102) { + state.lastIntValue = 12; + state.advance(); + return true; + } + if (ch === 114) { + state.lastIntValue = 13; + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter2(ch)) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; + }; + function isControlLetter2(ch) { + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122; + } + pp$12.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + if (forceU === void 0) + forceU = false; + var start3 = state.pos; + var switchU = forceU || state.switchU; + if (state.eat(117)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (switchU && lead >= 55296 && lead <= 56319) { + var leadSurrogateEnd = state.pos; + if (state.eat(92) && state.eat(117) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 56320 && trail <= 57343) { + state.lastIntValue = (lead - 55296) * 1024 + (trail - 56320) + 65536; + return true; + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true; + } + if (switchU && state.eat(123) && this.regexp_eatHexDigits(state) && state.eat(125) && isValidUnicode2(state.lastIntValue)) { + return true; + } + if (switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start3; + } + return false; + }; + function isValidUnicode2(ch) { + return ch >= 0 && ch <= 1114111; + } + pp$12.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true; + } + if (state.eat(47)) { + state.lastIntValue = 47; + return true; + } + return false; + } + var ch = state.current(); + if (ch !== 99 && (!state.switchN || ch !== 107)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 49 && ch <= 57) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } while ((ch = state.current()) >= 48 && ch <= 57); + return true; + } + return false; + }; + pp$12.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + if (isCharacterClassEscape2(ch)) { + state.lastIntValue = -1; + state.advance(); + return true; + } + if (state.switchU && this.options.ecmaVersion >= 9 && (ch === 80 || ch === 112)) { + state.lastIntValue = -1; + state.advance(); + if (state.eat(123) && this.regexp_eatUnicodePropertyValueExpression(state) && state.eat(125)) { + return true; + } + state.raise("Invalid property name"); + } + return false; + }; + function isCharacterClassEscape2(ch) { + return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87; + } + pp$12.regexp_eatUnicodePropertyValueExpression = function(state) { + var start3 = state.pos; + if (this.regexp_eatUnicodePropertyName(state) && state.eat(61)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true; + } + } + state.pos = start3; + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true; + } + return false; + }; + pp$12.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!hasOwn2(state.unicodeProperties.nonBinary, name)) { + state.raise("Invalid property name"); + } + if (!state.unicodeProperties.nonBinary[name].test(value)) { + state.raise("Invalid property value"); + } + }; + pp$12.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (!state.unicodeProperties.binary.test(nameOrValue)) { + state.raise("Invalid property name"); + } + }; + pp$12.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter2(ch = state.current())) { + state.lastStringValue += codePointToString2(ch); + state.advance(); + } + return state.lastStringValue !== ""; + }; + function isUnicodePropertyNameCharacter2(ch) { + return isControlLetter2(ch) || ch === 95; + } + pp$12.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter2(ch = state.current())) { + state.lastStringValue += codePointToString2(ch); + state.advance(); + } + return state.lastStringValue !== ""; + }; + function isUnicodePropertyValueCharacter2(ch) { + return isUnicodePropertyNameCharacter2(ch) || isDecimalDigit2(ch); + } + pp$12.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state); + }; + pp$12.regexp_eatCharacterClass = function(state) { + if (state.eat(91)) { + state.eat(94); + this.regexp_classRanges(state); + if (state.eat(93)) { + return true; + } + state.raise("Unterminated character class"); + } + return false; + }; + pp$12.regexp_classRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(45) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } + }; + pp$12.regexp_eatClassAtom = function(state) { + var start3 = state.pos; + if (state.eat(92)) { + if (this.regexp_eatClassEscape(state)) { + return true; + } + if (state.switchU) { + var ch$1 = state.current(); + if (ch$1 === 99 || isOctalDigit2(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start3; + } + var ch = state.current(); + if (ch !== 93) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_eatClassEscape = function(state) { + var start3 = state.pos; + if (state.eat(98)) { + state.lastIntValue = 8; + return true; + } + if (state.switchU && state.eat(45)) { + state.lastIntValue = 45; + return true; + } + if (!state.switchU && state.eat(99)) { + if (this.regexp_eatClassControlLetter(state)) { + return true; + } + state.pos = start3; + } + return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state); + }; + pp$12.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit2(ch) || ch === 95) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_eatHexEscapeSequence = function(state) { + var start3 = state.pos; + if (state.eat(120)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true; + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatDecimalDigits = function(state) { + var start3 = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit2(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } + return state.pos !== start3; + }; + function isDecimalDigit2(ch) { + return ch >= 48 && ch <= 57; + } + pp$12.regexp_eatHexDigits = function(state) { + var start3 = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit2(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt2(ch); + state.advance(); + } + return state.pos !== start3; + }; + function isHexDigit2(ch) { + return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102; + } + function hexToInt2(ch) { + if (ch >= 65 && ch <= 70) { + return 10 + (ch - 65); + } + if (ch >= 97 && ch <= 102) { + return 10 + (ch - 97); + } + return ch - 48; + } + pp$12.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true; + } + return false; + }; + pp$12.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit2(ch)) { + state.lastIntValue = ch - 48; + state.advance(); + return true; + } + state.lastIntValue = 0; + return false; + }; + function isOctalDigit2(ch) { + return ch >= 48 && ch <= 55; + } + pp$12.regexp_eatFixedHexDigits = function(state, length) { + var start3 = state.pos; + state.lastIntValue = 0; + for (var i2 = 0; i2 < length; ++i2) { + var ch = state.current(); + if (!isHexDigit2(ch)) { + state.pos = start3; + return false; + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt2(ch); + state.advance(); + } + return true; + }; + var Token3 = function Token4(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) { + this.loc = new SourceLocation3(p, p.startLoc, p.endLoc); + } + if (p.options.ranges) { + this.range = [p.start, p.end]; + } + }; + var pp2 = Parser3.prototype; + pp2.next = function(ignoreEscapeSequenceInKeyword) { + if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); + } + if (this.options.onToken) { + this.options.onToken(new Token3(this)); + } + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); + }; + pp2.getToken = function() { + this.next(); + return new Token3(this); + }; + if (typeof Symbol !== "undefined") { + pp2[Symbol.iterator] = function() { + var this$1$1 = this; + return { + next: function() { + var token = this$1$1.getToken(); + return { + done: token.type === types$12.eof, + value: token + }; + } + }; + }; + } + pp2.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { + this.skipSpace(); + } + this.start = this.pos; + if (this.options.locations) { + this.startLoc = this.curPosition(); + } + if (this.pos >= this.input.length) { + return this.finishToken(types$12.eof); + } + if (curContext.override) { + return curContext.override(this); + } else { + this.readToken(this.fullCharCodeAtPos()); + } + }; + pp2.readToken = function(code) { + if (isIdentifierStart2(code, this.options.ecmaVersion >= 6) || code === 92) { + return this.readWord(); + } + return this.getTokenFromCode(code); + }; + pp2.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 55295 || code >= 56320) { + return code; + } + var next = this.input.charCodeAt(this.pos + 1); + return next <= 56319 || next >= 57344 ? code : (code << 10) + next - 56613888; + }; + pp2.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start3 = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { + this.raise(this.pos - 2, "Unterminated comment"); + } + this.pos = end + 2; + if (this.options.locations) { + for (var nextBreak = void 0, pos = start3; (nextBreak = nextLineBreak2(this.input, pos, this.pos)) > -1; ) { + ++this.curLine; + pos = this.lineStart = nextBreak; + } + } + if (this.options.onComment) { + this.options.onComment( + true, + this.input.slice(start3 + 2, end), + start3, + this.pos, + startLoc, + this.curPosition() + ); + } + }; + pp2.skipLineComment = function(startSkip) { + var start3 = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine2(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) { + this.options.onComment( + false, + this.input.slice(start3 + startSkip, this.pos), + start3, + this.pos, + startLoc, + this.curPosition() + ); + } + }; + pp2.skipSpace = function() { + loop: + while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: + case 160: + ++this.pos; + break; + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10: + case 8232: + case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break; + case 47: + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: + this.skipBlockComment(); + break; + case 47: + this.skipLineComment(2); + break; + default: + break loop; + } + break; + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace2.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop; + } + } + } + }; + pp2.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { + this.endLoc = this.curPosition(); + } + var prevType = this.type; + this.type = type; + this.value = val; + this.updateContext(prevType); + }; + pp2.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { + return this.readNumber(true); + } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { + this.pos += 3; + return this.finishToken(types$12.ellipsis); + } else { + ++this.pos; + return this.finishToken(types$12.dot); + } + }; + pp2.readToken_slash = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { + ++this.pos; + return this.readRegexp(); + } + if (next === 61) { + return this.finishOp(types$12.assign, 2); + } + return this.finishOp(types$12.slash, 1); + }; + pp2.readToken_mult_modulo_exp = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types$12.star : types$12.modulo; + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size; + tokentype = types$12.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + if (next === 61) { + return this.finishOp(types$12.assign, size + 1); + } + return this.finishOp(tokentype, size); + }; + pp2.readToken_pipe_amp = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (this.options.ecmaVersion >= 12) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 === 61) { + return this.finishOp(types$12.assign, 3); + } + } + return this.finishOp(code === 124 ? types$12.logicalOR : types$12.logicalAND, 2); + } + if (next === 61) { + return this.finishOp(types$12.assign, 2); + } + return this.finishOp(code === 124 ? types$12.bitwiseOR : types$12.bitwiseAND, 1); + }; + pp2.readToken_caret = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$12.assign, 2); + } + return this.finishOp(types$12.bitwiseXOR, 1); + }; + pp2.readToken_plus_min = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak2.test(this.input.slice(this.lastTokEnd, this.pos)))) { + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + return this.finishOp(types$12.incDec, 2); + } + if (next === 61) { + return this.finishOp(types$12.assign, 2); + } + return this.finishOp(types$12.plusMin, 1); + }; + pp2.readToken_lt_gt = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { + return this.finishOp(types$12.assign, size + 1); + } + return this.finishOp(types$12.bitShift, size); + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { + this.skipLineComment(4); + this.skipSpace(); + return this.nextToken(); + } + if (next === 61) { + size = 2; + } + return this.finishOp(types$12.relational, size); + }; + pp2.readToken_eq_excl = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$12.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2); + } + if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { + this.pos += 2; + return this.finishToken(types$12.arrow); + } + return this.finishOp(code === 61 ? types$12.eq : types$12.prefix, 1); + }; + pp2.readToken_question = function() { + var ecmaVersion2 = this.options.ecmaVersion; + if (ecmaVersion2 >= 11) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 46) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 < 48 || next2 > 57) { + return this.finishOp(types$12.questionDot, 2); + } + } + if (next === 63) { + if (ecmaVersion2 >= 12) { + var next2$1 = this.input.charCodeAt(this.pos + 2); + if (next2$1 === 61) { + return this.finishOp(types$12.assign, 3); + } + } + return this.finishOp(types$12.coalesce, 2); + } + } + return this.finishOp(types$12.question, 1); + }; + pp2.readToken_numberSign = function() { + var ecmaVersion2 = this.options.ecmaVersion; + var code = 35; + if (ecmaVersion2 >= 13) { + ++this.pos; + code = this.fullCharCodeAtPos(); + if (isIdentifierStart2(code, true) || code === 92) { + return this.finishToken(types$12.privateId, this.readWord1()); + } + } + this.raise(this.pos, "Unexpected character '" + codePointToString2(code) + "'"); + }; + pp2.getTokenFromCode = function(code) { + switch (code) { + case 46: + return this.readToken_dot(); + case 40: + ++this.pos; + return this.finishToken(types$12.parenL); + case 41: + ++this.pos; + return this.finishToken(types$12.parenR); + case 59: + ++this.pos; + return this.finishToken(types$12.semi); + case 44: + ++this.pos; + return this.finishToken(types$12.comma); + case 91: + ++this.pos; + return this.finishToken(types$12.bracketL); + case 93: + ++this.pos; + return this.finishToken(types$12.bracketR); + case 123: + ++this.pos; + return this.finishToken(types$12.braceL); + case 125: + ++this.pos; + return this.finishToken(types$12.braceR); + case 58: + ++this.pos; + return this.finishToken(types$12.colon); + case 96: + if (this.options.ecmaVersion < 6) { + break; + } + ++this.pos; + return this.finishToken(types$12.backQuote); + case 48: + var next = this.input.charCodeAt(this.pos + 1); + if (next === 120 || next === 88) { + return this.readRadixNumber(16); + } + if (this.options.ecmaVersion >= 6) { + if (next === 111 || next === 79) { + return this.readRadixNumber(8); + } + if (next === 98 || next === 66) { + return this.readRadixNumber(2); + } + } + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return this.readNumber(false); + case 34: + case 39: + return this.readString(code); + case 47: + return this.readToken_slash(); + case 37: + case 42: + return this.readToken_mult_modulo_exp(code); + case 124: + case 38: + return this.readToken_pipe_amp(code); + case 94: + return this.readToken_caret(); + case 43: + case 45: + return this.readToken_plus_min(code); + case 60: + case 62: + return this.readToken_lt_gt(code); + case 61: + case 33: + return this.readToken_eq_excl(code); + case 63: + return this.readToken_question(); + case 126: + return this.finishOp(types$12.prefix, 1); + case 35: + return this.readToken_numberSign(); + } + this.raise(this.pos, "Unexpected character '" + codePointToString2(code) + "'"); + }; + pp2.finishOp = function(type, size) { + var str = this.input.slice(this.pos, this.pos + size); + this.pos += size; + return this.finishToken(type, str); + }; + pp2.readRegexp = function() { + var escaped, inClass, start3 = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(start3, "Unterminated regular expression"); + } + var ch = this.input.charAt(this.pos); + if (lineBreak2.test(ch)) { + this.raise(start3, "Unterminated regular expression"); + } + if (!escaped) { + if (ch === "[") { + inClass = true; + } else if (ch === "]" && inClass) { + inClass = false; + } else if (ch === "/" && !inClass) { + break; + } + escaped = ch === "\\"; + } else { + escaped = false; + } + ++this.pos; + } + var pattern = this.input.slice(start3, this.pos); + ++this.pos; + var flagsStart = this.pos; + var flags = this.readWord1(); + if (this.containsEsc) { + this.unexpected(flagsStart); + } + var state = this.regexpState || (this.regexpState = new RegExpValidationState3(this)); + state.reset(start3, pattern, flags); + this.validateRegExpFlags(state); + this.validateRegExpPattern(state); + var value = null; + try { + value = new RegExp(pattern, flags); + } catch (e) { + } + return this.finishToken(types$12.regexp, { pattern, flags, value }); + }; + pp2.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { + var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; + var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; + var start3 = this.pos, total = 0, lastCode = 0; + for (var i2 = 0, e = len == null ? Infinity : len; i2 < e; ++i2, ++this.pos) { + var code = this.input.charCodeAt(this.pos), val = void 0; + if (allowSeparators && code === 95) { + if (isLegacyOctalNumericLiteral) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); + } + if (lastCode === 95) { + this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); + } + if (i2 === 0) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); + } + lastCode = code; + continue; + } + if (code >= 97) { + val = code - 97 + 10; + } else if (code >= 65) { + val = code - 65 + 10; + } else if (code >= 48 && code <= 57) { + val = code - 48; + } else { + val = Infinity; + } + if (val >= radix) { + break; + } + lastCode = code; + total = total * radix + val; + } + if (allowSeparators && lastCode === 95) { + this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); + } + if (this.pos === start3 || len != null && this.pos - start3 !== len) { + return null; + } + return total; + }; + function stringToNumber2(str, isLegacyOctalNumericLiteral) { + if (isLegacyOctalNumericLiteral) { + return parseInt(str, 8); + } + return parseFloat(str.replace(/_/g, "")); + } + function stringToBigInt2(str) { + if (typeof BigInt !== "function") { + return null; + } + return BigInt(str.replace(/_/g, "")); + } + pp2.readRadixNumber = function(radix) { + var start3 = this.pos; + this.pos += 2; + var val = this.readInt(radix); + if (val == null) { + this.raise(this.start + 2, "Expected number in radix " + radix); + } + if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) { + val = stringToBigInt2(this.input.slice(start3, this.pos)); + ++this.pos; + } else if (isIdentifierStart2(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$12.num, val); + }; + pp2.readNumber = function(startsWithDot) { + var start3 = this.pos; + if (!startsWithDot && this.readInt(10, void 0, true) === null) { + this.raise(start3, "Invalid number"); + } + var octal = this.pos - start3 >= 2 && this.input.charCodeAt(start3) === 48; + if (octal && this.strict) { + this.raise(start3, "Invalid number"); + } + var next = this.input.charCodeAt(this.pos); + if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) { + var val$1 = stringToBigInt2(this.input.slice(start3, this.pos)); + ++this.pos; + if (isIdentifierStart2(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$12.num, val$1); + } + if (octal && /[89]/.test(this.input.slice(start3, this.pos))) { + octal = false; + } + if (next === 46 && !octal) { + ++this.pos; + this.readInt(10); + next = this.input.charCodeAt(this.pos); + } + if ((next === 69 || next === 101) && !octal) { + next = this.input.charCodeAt(++this.pos); + if (next === 43 || next === 45) { + ++this.pos; + } + if (this.readInt(10) === null) { + this.raise(start3, "Invalid number"); + } + } + if (isIdentifierStart2(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + var val = stringToNumber2(this.input.slice(start3, this.pos), octal); + return this.finishToken(types$12.num, val); + }; + pp2.readCodePoint = function() { + var ch = this.input.charCodeAt(this.pos), code; + if (ch === 123) { + if (this.options.ecmaVersion < 6) { + this.unexpected(); + } + var codePos = ++this.pos; + code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos); + ++this.pos; + if (code > 1114111) { + this.invalidStringToken(codePos, "Code point out of bounds"); + } + } else { + code = this.readHexChar(4); + } + return code; + }; + pp2.readString = function(quote) { + var out = "", chunkStart = ++this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated string constant"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === quote) { + break; + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(false); + chunkStart = this.pos; + } else if (ch === 8232 || ch === 8233) { + if (this.options.ecmaVersion < 10) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + if (this.options.locations) { + this.curLine++; + this.lineStart = this.pos; + } + } else { + if (isNewLine2(ch)) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(types$12.string, out); + }; + var INVALID_TEMPLATE_ESCAPE_ERROR2 = {}; + pp2.tryReadTemplateToken = function() { + this.inTemplateElement = true; + try { + this.readTmplToken(); + } catch (err) { + if (err === INVALID_TEMPLATE_ESCAPE_ERROR2) { + this.readInvalidTemplateToken(); + } else { + throw err; + } + } + this.inTemplateElement = false; + }; + pp2.invalidStringToken = function(position2, message) { + if (this.inTemplateElement && this.options.ecmaVersion >= 9) { + throw INVALID_TEMPLATE_ESCAPE_ERROR2; + } else { + this.raise(position2, message); + } + }; + pp2.readTmplToken = function() { + var out = "", chunkStart = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated template"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { + if (this.pos === this.start && (this.type === types$12.template || this.type === types$12.invalidTemplate)) { + if (ch === 36) { + this.pos += 2; + return this.finishToken(types$12.dollarBraceL); + } else { + ++this.pos; + return this.finishToken(types$12.backQuote); + } + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(types$12.template, out); + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(true); + chunkStart = this.pos; + } else if (isNewLine2(ch)) { + out += this.input.slice(chunkStart, this.pos); + ++this.pos; + switch (ch) { + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + out += "\n"; + break; + default: + out += String.fromCharCode(ch); + break; + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + chunkStart = this.pos; + } else { + ++this.pos; + } + } + }; + pp2.readInvalidTemplateToken = function() { + for (; this.pos < this.input.length; this.pos++) { + switch (this.input[this.pos]) { + case "\\": + ++this.pos; + break; + case "$": + if (this.input[this.pos + 1] !== "{") { + break; + } + case "`": + return this.finishToken(types$12.invalidTemplate, this.input.slice(this.start, this.pos)); + } + } + this.raise(this.start, "Unterminated template"); + }; + pp2.readEscapedChar = function(inTemplate) { + var ch = this.input.charCodeAt(++this.pos); + ++this.pos; + switch (ch) { + case 110: + return "\n"; + case 114: + return "\r"; + case 120: + return String.fromCharCode(this.readHexChar(2)); + case 117: + return codePointToString2(this.readCodePoint()); + case 116: + return " "; + case 98: + return "\b"; + case 118: + return "\v"; + case 102: + return "\f"; + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + if (this.options.locations) { + this.lineStart = this.pos; + ++this.curLine; + } + return ""; + case 56: + case 57: + if (this.strict) { + this.invalidStringToken( + this.pos - 1, + "Invalid escape sequence" + ); + } + if (inTemplate) { + var codePos = this.pos - 1; + this.invalidStringToken( + codePos, + "Invalid escape sequence in template string" + ); + return null; + } + default: + if (ch >= 48 && ch <= 55) { + var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]; + var octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + this.pos += octalStr.length - 1; + ch = this.input.charCodeAt(this.pos); + if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) { + this.invalidStringToken( + this.pos - 1 - octalStr.length, + inTemplate ? "Octal literal in template string" : "Octal literal in strict mode" + ); + } + return String.fromCharCode(octal); + } + if (isNewLine2(ch)) { + return ""; + } + return String.fromCharCode(ch); + } + }; + pp2.readHexChar = function(len) { + var codePos = this.pos; + var n = this.readInt(16, len); + if (n === null) { + this.invalidStringToken(codePos, "Bad character escape sequence"); + } + return n; + }; + pp2.readWord1 = function() { + this.containsEsc = false; + var word = "", first = true, chunkStart = this.pos; + var astral = this.options.ecmaVersion >= 6; + while (this.pos < this.input.length) { + var ch = this.fullCharCodeAtPos(); + if (isIdentifierChar2(ch, astral)) { + this.pos += ch <= 65535 ? 1 : 2; + } else if (ch === 92) { + this.containsEsc = true; + word += this.input.slice(chunkStart, this.pos); + var escStart = this.pos; + if (this.input.charCodeAt(++this.pos) !== 117) { + this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); + } + ++this.pos; + var esc = this.readCodePoint(); + if (!(first ? isIdentifierStart2 : isIdentifierChar2)(esc, astral)) { + this.invalidStringToken(escStart, "Invalid Unicode escape"); + } + word += codePointToString2(esc); + chunkStart = this.pos; + } else { + break; + } + first = false; + } + return word + this.input.slice(chunkStart, this.pos); + }; + pp2.readWord = function() { + var word = this.readWord1(); + var type = types$12.name; + if (this.keywords.test(word)) { + type = keywords2[word]; + } + return this.finishToken(type, word); + }; + var version2 = "8.8.1"; + Parser3.acorn = { + Parser: Parser3, + version: version2, + defaultOptions: defaultOptions2, + Position: Position3, + SourceLocation: SourceLocation3, + getLineInfo: getLineInfo2, + Node: Node3, + TokenType: TokenType3, + tokTypes: types$12, + keywordTypes: keywords2, + TokContext: TokContext3, + tokContexts: types2, + isIdentifierChar: isIdentifierChar2, + isIdentifierStart: isIdentifierStart2, + Token: Token3, + isNewLine: isNewLine2, + lineBreak: lineBreak2, + lineBreakG: lineBreakG2, + nonASCIIwhitespace: nonASCIIwhitespace2 + }; + function parse3(input, options) { + return Parser3.parse(input, options); + } + function parseExpressionAt2(input, pos, options) { + return Parser3.parseExpressionAt(input, pos, options); + } + function tokenizer2(input, options) { + return Parser3.tokenizer(input, options); + } + exports2.Node = Node3; + exports2.Parser = Parser3; + exports2.Position = Position3; + exports2.SourceLocation = SourceLocation3; + exports2.TokContext = TokContext3; + exports2.Token = Token3; + exports2.TokenType = TokenType3; + exports2.defaultOptions = defaultOptions2; + exports2.getLineInfo = getLineInfo2; + exports2.isIdentifierChar = isIdentifierChar2; + exports2.isIdentifierStart = isIdentifierStart2; + exports2.isNewLine = isNewLine2; + exports2.keywordTypes = keywords2; + exports2.lineBreak = lineBreak2; + exports2.lineBreakG = lineBreakG2; + exports2.nonASCIIwhitespace = nonASCIIwhitespace2; + exports2.parse = parse3; + exports2.parseExpressionAt = parseExpressionAt2; + exports2.tokContexts = types2; + exports2.tokTypes = types$12; + exports2.tokenizer = tokenizer2; + exports2.version = version2; + Object.defineProperty(exports2, "__esModule", { value: true }); + }); + } +}); + +// node_modules/acorn-jsx/index.js +var require_acorn_jsx = __commonJS({ + "node_modules/acorn-jsx/index.js"(exports, module2) { + "use strict"; + var XHTMLEntities = require_xhtml(); + var hexNumber = /^[\da-fA-F]+$/; + var decimalNumber = /^\d+$/; + var acornJsxMap = /* @__PURE__ */ new WeakMap(); + function getJsxTokens(acorn) { + acorn = acorn.Parser.acorn || acorn; + let acornJsx2 = acornJsxMap.get(acorn); + if (!acornJsx2) { + const tt = acorn.tokTypes; + const TokContext3 = acorn.TokContext; + const TokenType3 = acorn.TokenType; + const tc_oTag = new TokContext3("...", true, true); + const tokContexts = { + tc_oTag, + tc_cTag, + tc_expr + }; + const tokTypes = { + jsxName: new TokenType3("jsxName"), + jsxText: new TokenType3("jsxText", { beforeExpr: true }), + jsxTagStart: new TokenType3("jsxTagStart", { startsExpr: true }), + jsxTagEnd: new TokenType3("jsxTagEnd") + }; + tokTypes.jsxTagStart.updateContext = function() { + this.context.push(tc_expr); + this.context.push(tc_oTag); + this.exprAllowed = false; + }; + tokTypes.jsxTagEnd.updateContext = function(prevType) { + let out = this.context.pop(); + if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) { + this.context.pop(); + this.exprAllowed = this.curContext() === tc_expr; + } else { + this.exprAllowed = true; + } + }; + acornJsx2 = { tokContexts, tokTypes }; + acornJsxMap.set(acorn, acornJsx2); + } + return acornJsx2; + } + function getQualifiedJSXName(object) { + if (!object) + return object; + if (object.type === "JSXIdentifier") + return object.name; + if (object.type === "JSXNamespacedName") + return object.namespace.name + ":" + object.name.name; + if (object.type === "JSXMemberExpression") + return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); + } + module2.exports = function(options) { + options = options || {}; + return function(Parser3) { + return plugin({ + allowNamespaces: options.allowNamespaces !== false, + allowNamespacedObjects: !!options.allowNamespacedObjects + }, Parser3); + }; + }; + Object.defineProperty(module2.exports, "tokTypes", { + get: function get_tokTypes() { + return getJsxTokens(require_acorn()).tokTypes; + }, + configurable: true, + enumerable: true + }); + function plugin(options, Parser3) { + const acorn = Parser3.acorn || require_acorn(); + const acornJsx2 = getJsxTokens(acorn); + const tt = acorn.tokTypes; + const tok = acornJsx2.tokTypes; + const tokContexts = acorn.tokContexts; + const tc_oTag = acornJsx2.tokContexts.tc_oTag; + const tc_cTag = acornJsx2.tokContexts.tc_cTag; + const tc_expr = acornJsx2.tokContexts.tc_expr; + const isNewLine2 = acorn.isNewLine; + const isIdentifierStart2 = acorn.isIdentifierStart; + const isIdentifierChar2 = acorn.isIdentifierChar; + return class extends Parser3 { + static get acornJsx() { + return acornJsx2; + } + jsx_readToken() { + let out = "", chunkStart = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) + this.raise(this.start, "Unterminated JSX contents"); + let ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 60: + case 123: + if (this.pos === this.start) { + if (ch === 60 && this.exprAllowed) { + ++this.pos; + return this.finishToken(tok.jsxTagStart); + } + return this.getTokenFromCode(ch); + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(tok.jsxText, out); + case 38: + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + break; + case 62: + case 125: + this.raise( + this.pos, + "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" + (ch === 62 ? ">" : "}") + '` or `{"' + this.input[this.pos] + '"}`?' + ); + default: + if (isNewLine2(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(true); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + } + } + jsx_readNewLine(normalizeCRLF) { + let ch = this.input.charCodeAt(this.pos); + let out; + ++this.pos; + if (ch === 13 && this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + out = normalizeCRLF ? "\n" : "\r\n"; + } else { + out = String.fromCharCode(ch); + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + return out; + } + jsx_readString(quote) { + let out = "", chunkStart = ++this.pos; + for (; ; ) { + if (this.pos >= this.input.length) + this.raise(this.start, "Unterminated string constant"); + let ch = this.input.charCodeAt(this.pos); + if (ch === quote) + break; + if (ch === 38) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + } else if (isNewLine2(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(false); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(tt.string, out); + } + jsx_readEntity() { + let str = "", count = 0, entity; + let ch = this.input[this.pos]; + if (ch !== "&") + this.raise(this.pos, "Entity must start with an ampersand"); + let startPos = ++this.pos; + while (this.pos < this.input.length && count++ < 10) { + ch = this.input[this.pos++]; + if (ch === ";") { + if (str[0] === "#") { + if (str[1] === "x") { + str = str.substr(2); + if (hexNumber.test(str)) + entity = String.fromCharCode(parseInt(str, 16)); + } else { + str = str.substr(1); + if (decimalNumber.test(str)) + entity = String.fromCharCode(parseInt(str, 10)); + } + } else { + entity = XHTMLEntities[str]; + } + break; + } + str += ch; + } + if (!entity) { + this.pos = startPos; + return "&"; + } + return entity; + } + jsx_readWord() { + let ch, start3 = this.pos; + do { + ch = this.input.charCodeAt(++this.pos); + } while (isIdentifierChar2(ch) || ch === 45); + return this.finishToken(tok.jsxName, this.input.slice(start3, this.pos)); + } + jsx_parseIdentifier() { + let node = this.startNode(); + if (this.type === tok.jsxName) + node.name = this.value; + else if (this.type.keyword) + node.name = this.type.keyword; + else + this.unexpected(); + this.next(); + return this.finishNode(node, "JSXIdentifier"); + } + jsx_parseNamespacedName() { + let startPos = this.start, startLoc = this.startLoc; + let name = this.jsx_parseIdentifier(); + if (!options.allowNamespaces || !this.eat(tt.colon)) + return name; + var node = this.startNodeAt(startPos, startLoc); + node.namespace = name; + node.name = this.jsx_parseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); + } + jsx_parseElementName() { + if (this.type === tok.jsxTagEnd) + return ""; + let startPos = this.start, startLoc = this.startLoc; + let node = this.jsx_parseNamespacedName(); + if (this.type === tt.dot && node.type === "JSXNamespacedName" && !options.allowNamespacedObjects) { + this.unexpected(); + } + while (this.eat(tt.dot)) { + let newNode = this.startNodeAt(startPos, startLoc); + newNode.object = node; + newNode.property = this.jsx_parseIdentifier(); + node = this.finishNode(newNode, "JSXMemberExpression"); + } + return node; + } + jsx_parseAttributeValue() { + switch (this.type) { + case tt.braceL: + let node = this.jsx_parseExpressionContainer(); + if (node.expression.type === "JSXEmptyExpression") + this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); + return node; + case tok.jsxTagStart: + case tt.string: + return this.parseExprAtom(); + default: + this.raise(this.start, "JSX value should be either an expression or a quoted JSX text"); + } + } + jsx_parseEmptyExpression() { + let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc); + return this.finishNodeAt(node, "JSXEmptyExpression", this.start, this.startLoc); + } + jsx_parseExpressionContainer() { + let node = this.startNode(); + this.next(); + node.expression = this.type === tt.braceR ? this.jsx_parseEmptyExpression() : this.parseExpression(); + this.expect(tt.braceR); + return this.finishNode(node, "JSXExpressionContainer"); + } + jsx_parseAttribute() { + let node = this.startNode(); + if (this.eat(tt.braceL)) { + this.expect(tt.ellipsis); + node.argument = this.parseMaybeAssign(); + this.expect(tt.braceR); + return this.finishNode(node, "JSXSpreadAttribute"); + } + node.name = this.jsx_parseNamespacedName(); + node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null; + return this.finishNode(node, "JSXAttribute"); + } + jsx_parseOpeningElementAt(startPos, startLoc) { + let node = this.startNodeAt(startPos, startLoc); + node.attributes = []; + let nodeName = this.jsx_parseElementName(); + if (nodeName) + node.name = nodeName; + while (this.type !== tt.slash && this.type !== tok.jsxTagEnd) + node.attributes.push(this.jsx_parseAttribute()); + node.selfClosing = this.eat(tt.slash); + this.expect(tok.jsxTagEnd); + return this.finishNode(node, nodeName ? "JSXOpeningElement" : "JSXOpeningFragment"); + } + jsx_parseClosingElementAt(startPos, startLoc) { + let node = this.startNodeAt(startPos, startLoc); + let nodeName = this.jsx_parseElementName(); + if (nodeName) + node.name = nodeName; + this.expect(tok.jsxTagEnd); + return this.finishNode(node, nodeName ? "JSXClosingElement" : "JSXClosingFragment"); + } + jsx_parseElementAt(startPos, startLoc) { + let node = this.startNodeAt(startPos, startLoc); + let children = []; + let openingElement = this.jsx_parseOpeningElementAt(startPos, startLoc); + let closingElement = null; + if (!openingElement.selfClosing) { + contents: + for (; ; ) { + switch (this.type) { + case tok.jsxTagStart: + startPos = this.start; + startLoc = this.startLoc; + this.next(); + if (this.eat(tt.slash)) { + closingElement = this.jsx_parseClosingElementAt(startPos, startLoc); + break contents; + } + children.push(this.jsx_parseElementAt(startPos, startLoc)); + break; + case tok.jsxText: + children.push(this.parseExprAtom()); + break; + case tt.braceL: + children.push(this.jsx_parseExpressionContainer()); + break; + default: + this.unexpected(); + } + } + if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { + this.raise( + closingElement.start, + "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">" + ); + } + } + let fragmentOrElement = openingElement.name ? "Element" : "Fragment"; + node["opening" + fragmentOrElement] = openingElement; + node["closing" + fragmentOrElement] = closingElement; + node.children = children; + if (this.type === tt.relational && this.value === "<") { + this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); + } + return this.finishNode(node, "JSX" + fragmentOrElement); + } + jsx_parseText() { + let node = this.parseLiteral(this.value); + node.type = "JSXText"; + return node; + } + jsx_parseElement() { + let startPos = this.start, startLoc = this.startLoc; + this.next(); + return this.jsx_parseElementAt(startPos, startLoc); + } + parseExprAtom(refShortHandDefaultPos) { + if (this.type === tok.jsxText) + return this.jsx_parseText(); + else if (this.type === tok.jsxTagStart) + return this.jsx_parseElement(); + else + return super.parseExprAtom(refShortHandDefaultPos); + } + readToken(code) { + let context = this.curContext(); + if (context === tc_expr) + return this.jsx_readToken(); + if (context === tc_oTag || context === tc_cTag) { + if (isIdentifierStart2(code)) + return this.jsx_readWord(); + if (code == 62) { + ++this.pos; + return this.finishToken(tok.jsxTagEnd); + } + if ((code === 34 || code === 39) && context == tc_oTag) + return this.jsx_readString(code); + } + if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) { + ++this.pos; + return this.finishToken(tok.jsxTagStart); + } + return super.readToken(code); + } + updateContext(prevType) { + if (this.type == tt.braceL) { + var curContext = this.curContext(); + if (curContext == tc_oTag) + this.context.push(tokContexts.b_expr); + else if (curContext == tc_expr) + this.context.push(tokContexts.b_tmpl); + else + super.updateContext(prevType); + this.exprAllowed = true; + } else if (this.type === tt.slash && prevType === tok.jsxTagStart) { + this.context.length -= 2; + this.context.push(tc_cTag); + this.exprAllowed = false; + } else { + return super.updateContext(prevType); + } + } + }; + } + } +}); + +// node_modules/remark-mdx/index.js +var remark_mdx_exports = {}; +__export(remark_mdx_exports, { + default: () => remarkMdx +}); +module.exports = __toCommonJS(remark_mdx_exports); + +// node_modules/acorn/dist/acorn.mjs +var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; +var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; +var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F"; +var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC"; +var reservedWords = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" +}; +var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; +var keywords$1 = { + 5: ecma5AndLessKeywords, + "5module": ecma5AndLessKeywords + " export import", + 6: ecma5AndLessKeywords + " const class extends export import super" +}; +var keywordRelationalOperator = /^in(stanceof)?$/; +var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +function isInAstralSet(code, set) { + var pos = 65536; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) { + return false; + } + pos += set[i + 1]; + if (pos >= code) { + return true; + } + } +} +function isIdentifierStart(code, astral) { + if (code < 65) { + return code === 36; + } + if (code < 91) { + return true; + } + if (code < 97) { + return code === 95; + } + if (code < 123) { + return true; + } + if (code <= 65535) { + return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + if (astral === false) { + return false; + } + return isInAstralSet(code, astralIdentifierStartCodes); +} +function isIdentifierChar(code, astral) { + if (code < 48) { + return code === 36; + } + if (code < 58) { + return true; + } + if (code < 65) { + return false; + } + if (code < 91) { + return true; + } + if (code < 97) { + return code === 95; + } + if (code < 123) { + return true; + } + if (code <= 65535) { + return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code)); + } + if (astral === false) { + return false; + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} +var TokenType = function TokenType2(label, conf) { + if (conf === void 0) + conf = {}; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; +}; +function binop(name, prec) { + return new TokenType(name, { beforeExpr: true, binop: prec }); +} +var beforeExpr = { beforeExpr: true }; +var startsExpr = { startsExpr: true }; +var keywords = {}; +function kw(name, options) { + if (options === void 0) + options = {}; + options.keyword = name; + return keywords[name] = new TokenType(name, options); +} +var types$1 = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + privateId: new TokenType("privateId", startsExpr), + eof: new TokenType("eof"), + bracketL: new TokenType("[", { beforeExpr: true, startsExpr: true }), + bracketR: new TokenType("]"), + braceL: new TokenType("{", { beforeExpr: true, startsExpr: true }), + braceR: new TokenType("}"), + parenL: new TokenType("(", { beforeExpr: true, startsExpr: true }), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + questionDot: new TokenType("?."), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", { beforeExpr: true, startsExpr: true }), + eq: new TokenType("=", { beforeExpr: true, isAssign: true }), + assign: new TokenType("_=", { beforeExpr: true, isAssign: true }), + incDec: new TokenType("++/--", { prefix: true, postfix: true, startsExpr: true }), + prefix: new TokenType("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", { beforeExpr: true }), + coalesce: binop("??", 1), + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", { isLoop: true, beforeExpr: true }), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", { isLoop: true }), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", { isLoop: true }), + _with: kw("with"), + _new: kw("new", { beforeExpr: true, startsExpr: true }), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import", startsExpr), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", { beforeExpr: true, binop: 7 }), + _instanceof: kw("instanceof", { beforeExpr: true, binop: 7 }), + _typeof: kw("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), + _void: kw("void", { beforeExpr: true, prefix: true, startsExpr: true }), + _delete: kw("delete", { beforeExpr: true, prefix: true, startsExpr: true }) +}; +var lineBreak = /\r\n?|\n|\u2028|\u2029/; +var lineBreakG = new RegExp(lineBreak.source, "g"); +function isNewLine(code) { + return code === 10 || code === 13 || code === 8232 || code === 8233; +} +function nextLineBreak(code, from, end) { + if (end === void 0) + end = code.length; + for (var i = from; i < end; i++) { + var next = code.charCodeAt(i); + if (isNewLine(next)) { + return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1; + } + } + return -1; +} +var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; +var ref = Object.prototype; +var hasOwnProperty = ref.hasOwnProperty; +var toString = ref.toString; +var hasOwn = Object.hasOwn || function(obj, propName) { + return hasOwnProperty.call(obj, propName); +}; +var isArray = Array.isArray || function(obj) { + return toString.call(obj) === "[object Array]"; +}; +function wordsRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"); +} +function codePointToString(code) { + if (code <= 65535) { + return String.fromCharCode(code); + } + code -= 65536; + return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320); +} +var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; +var Position = function Position2(line, col) { + this.line = line; + this.column = col; +}; +Position.prototype.offset = function offset(n) { + return new Position(this.line, this.column + n); +}; +var SourceLocation = function SourceLocation2(p, start3, end) { + this.start = start3; + this.end = end; + if (p.sourceFile !== null) { + this.source = p.sourceFile; + } +}; +function getLineInfo(input, offset2) { + for (var line = 1, cur = 0; ; ) { + var nextBreak = nextLineBreak(input, cur, offset2); + if (nextBreak < 0) { + return new Position(line, offset2 - cur); + } + ++line; + cur = nextBreak; + } +} +var defaultOptions = { + ecmaVersion: null, + sourceType: "script", + onInsertedSemicolon: null, + onTrailingComma: null, + allowReserved: null, + allowReturnOutsideFunction: false, + allowImportExportEverywhere: false, + allowAwaitOutsideFunction: null, + allowSuperOutsideMethod: null, + allowHashBang: false, + locations: false, + onToken: null, + onComment: null, + ranges: false, + program: null, + sourceFile: null, + directSourceFile: null, + preserveParens: false +}; +var warnedAboutEcmaVersion = false; +function getOptions(opts) { + var options = {}; + for (var opt in defaultOptions) { + options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; + } + if (options.ecmaVersion === "latest") { + options.ecmaVersion = 1e8; + } else if (options.ecmaVersion == null) { + if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) { + warnedAboutEcmaVersion = true; + console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); + } + options.ecmaVersion = 11; + } else if (options.ecmaVersion >= 2015) { + options.ecmaVersion -= 2009; + } + if (options.allowReserved == null) { + options.allowReserved = options.ecmaVersion < 5; + } + if (opts.allowHashBang == null) { + options.allowHashBang = options.ecmaVersion >= 14; + } + if (isArray(options.onToken)) { + var tokens = options.onToken; + options.onToken = function(token) { + return tokens.push(token); + }; + } + if (isArray(options.onComment)) { + options.onComment = pushComment(options, options.onComment); + } + return options; +} +function pushComment(options, array) { + return function(block, text, start3, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text, + start: start3, + end + }; + if (options.locations) { + comment.loc = new SourceLocation(this, startLoc, endLoc); + } + if (options.ranges) { + comment.range = [start3, end]; + } + array.push(comment); + }; +} +var SCOPE_TOP = 1; +var SCOPE_FUNCTION = 2; +var SCOPE_ASYNC = 4; +var SCOPE_GENERATOR = 8; +var SCOPE_ARROW = 16; +var SCOPE_SIMPLE_CATCH = 32; +var SCOPE_SUPER = 64; +var SCOPE_DIRECT_SUPER = 128; +var SCOPE_CLASS_STATIC_BLOCK = 256; +var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; +function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0); +} +var BIND_NONE = 0; +var BIND_VAR = 1; +var BIND_LEXICAL = 2; +var BIND_FUNCTION = 3; +var BIND_SIMPLE_CATCH = 4; +var BIND_OUTSIDE = 5; +var Parser = function Parser2(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + var reserved = ""; + if (options.allowReserved !== true) { + reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; + if (options.sourceType === "module") { + reserved += " await"; + } + } + this.reservedWords = wordsRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = wordsRegexp(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); + this.containsEsc = false; + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + this.type = types$1.eof; + this.value = null; + this.start = this.end = this.pos; + this.startLoc = this.endLoc = this.curPosition(); + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + this.context = this.initialContext(); + this.exprAllowed = true; + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + this.potentialArrowAt = -1; + this.potentialArrowInForAwait = false; + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + this.labels = []; + this.undefinedExports = /* @__PURE__ */ Object.create(null); + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") { + this.skipLineComment(2); + } + this.scopeStack = []; + this.enterScope(SCOPE_TOP); + this.regexpState = null; + this.privateNameStack = []; +}; +var prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } }; +Parser.prototype.parse = function parse() { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node); +}; +prototypeAccessors.inFunction.get = function() { + return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0; +}; +prototypeAccessors.inGenerator.get = function() { + return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit; +}; +prototypeAccessors.inAsync.get = function() { + return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit; +}; +prototypeAccessors.canAwait.get = function() { + for (var i = this.scopeStack.length - 1; i >= 0; i--) { + var scope = this.scopeStack[i]; + if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { + return false; + } + if (scope.flags & SCOPE_FUNCTION) { + return (scope.flags & SCOPE_ASYNC) > 0; + } + } + return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction; +}; +prototypeAccessors.allowSuper.get = function() { + var ref2 = this.currentThisScope(); + var flags = ref2.flags; + var inClassFieldInit = ref2.inClassFieldInit; + return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod; +}; +prototypeAccessors.allowDirectSuper.get = function() { + return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0; +}; +prototypeAccessors.treatFunctionsAsVar.get = function() { + return this.treatFunctionsAsVarInScope(this.currentScope()); +}; +prototypeAccessors.allowNewDotTarget.get = function() { + var ref2 = this.currentThisScope(); + var flags = ref2.flags; + var inClassFieldInit = ref2.inClassFieldInit; + return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit; +}; +prototypeAccessors.inClassStaticBlock.get = function() { + return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0; +}; +Parser.extend = function extend() { + var plugins = [], len = arguments.length; + while (len--) + plugins[len] = arguments[len]; + var cls = this; + for (var i = 0; i < plugins.length; i++) { + cls = plugins[i](cls); + } + return cls; +}; +Parser.parse = function parse2(input, options) { + return new this(options, input).parse(); +}; +Parser.parseExpressionAt = function parseExpressionAt(input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression(); +}; +Parser.tokenizer = function tokenizer(input, options) { + return new this(options, input); +}; +Object.defineProperties(Parser.prototype, prototypeAccessors); +var pp$9 = Parser.prototype; +var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; +pp$9.strictDirective = function(start3) { + if (this.options.ecmaVersion < 5) { + return false; + } + for (; ; ) { + skipWhiteSpace.lastIndex = start3; + start3 += skipWhiteSpace.exec(this.input)[0].length; + var match = literal.exec(this.input.slice(start3)); + if (!match) { + return false; + } + if ((match[1] || match[2]) === "use strict") { + skipWhiteSpace.lastIndex = start3 + match[0].length; + var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; + var next = this.input.charAt(end); + return next === ";" || next === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="); + } + start3 += match[0].length; + skipWhiteSpace.lastIndex = start3; + start3 += skipWhiteSpace.exec(this.input)[0].length; + if (this.input[start3] === ";") { + start3++; + } + } +}; +pp$9.eat = function(type) { + if (this.type === type) { + this.next(); + return true; + } else { + return false; + } +}; +pp$9.isContextual = function(name) { + return this.type === types$1.name && this.value === name && !this.containsEsc; +}; +pp$9.eatContextual = function(name) { + if (!this.isContextual(name)) { + return false; + } + this.next(); + return true; +}; +pp$9.expectContextual = function(name) { + if (!this.eatContextual(name)) { + this.unexpected(); + } +}; +pp$9.canInsertSemicolon = function() { + return this.type === types$1.eof || this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); +}; +pp$9.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) { + this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); + } + return true; + } +}; +pp$9.semicolon = function() { + if (!this.eat(types$1.semi) && !this.insertSemicolon()) { + this.unexpected(); + } +}; +pp$9.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) { + this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); + } + if (!notNext) { + this.next(); + } + return true; + } +}; +pp$9.expect = function(type) { + this.eat(type) || this.unexpected(); +}; +pp$9.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); +}; +var DestructuringErrors = function DestructuringErrors2() { + this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; +}; +pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { + return; + } + if (refDestructuringErrors.trailingComma > -1) { + this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); + } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { + this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); + } +}; +pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { + return false; + } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { + return shorthandAssign >= 0 || doubleProto >= 0; + } + if (shorthandAssign >= 0) { + this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); + } + if (doubleProto >= 0) { + this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); + } +}; +pp$9.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { + this.raise(this.yieldPos, "Yield expression cannot be a default value"); + } + if (this.awaitPos) { + this.raise(this.awaitPos, "Await expression cannot be a default value"); + } +}; +pp$9.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") { + return this.isSimpleAssignTarget(expr.expression); + } + return expr.type === "Identifier" || expr.type === "MemberExpression"; +}; +var pp$8 = Parser.prototype; +pp$8.parseTopLevel = function(node) { + var exports = /* @__PURE__ */ Object.create(null); + if (!node.body) { + node.body = []; + } + while (this.type !== types$1.eof) { + var stmt = this.parseStatement(null, true, exports); + node.body.push(stmt); + } + if (this.inModule) { + for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) { + var name = list[i]; + this.raiseRecoverable(this.undefinedExports[name].start, "Export '" + name + "' is not defined"); + } + } + this.adaptDirectivePrologue(node.body); + this.next(); + node.sourceType = this.options.sourceType; + return this.finishNode(node, "Program"); +}; +var loopLabel = { kind: "loop" }; +var switchLabel = { kind: "switch" }; +pp$8.isLet = function(context) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { + return false; + } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 91 || nextCh === 92 || nextCh > 55295 && nextCh < 56320) { + return true; + } + if (context) { + return false; + } + if (nextCh === 123) { + return true; + } + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { + ++pos; + } + if (nextCh === 92 || nextCh > 55295 && nextCh < 56320) { + return true; + } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { + return true; + } + } + return false; +}; +pp$8.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { + return false; + } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, after; + return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320)); +}; +pp$8.parseStatement = function(context, topLevel, exports) { + var starttype = this.type, node = this.startNode(), kind; + if (this.isLet(context)) { + starttype = types$1._var; + kind = "let"; + } + switch (starttype) { + case types$1._break: + case types$1._continue: + return this.parseBreakContinueStatement(node, starttype.keyword); + case types$1._debugger: + return this.parseDebuggerStatement(node); + case types$1._do: + return this.parseDoStatement(node); + case types$1._for: + return this.parseForStatement(node); + case types$1._function: + if (context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6) { + this.unexpected(); + } + return this.parseFunctionStatement(node, false, !context); + case types$1._class: + if (context) { + this.unexpected(); + } + return this.parseClass(node, true); + case types$1._if: + return this.parseIfStatement(node); + case types$1._return: + return this.parseReturnStatement(node); + case types$1._switch: + return this.parseSwitchStatement(node); + case types$1._throw: + return this.parseThrowStatement(node); + case types$1._try: + return this.parseTryStatement(node); + case types$1._const: + case types$1._var: + kind = kind || this.value; + if (context && kind !== "var") { + this.unexpected(); + } + return this.parseVarStatement(node, kind); + case types$1._while: + return this.parseWhileStatement(node); + case types$1._with: + return this.parseWithStatement(node); + case types$1.braceL: + return this.parseBlock(true, node); + case types$1.semi: + return this.parseEmptyStatement(node); + case types$1._export: + case types$1._import: + if (this.options.ecmaVersion > 10 && starttype === types$1._import) { + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 40 || nextCh === 46) { + return this.parseExpressionStatement(node, this.parseExpression()); + } + } + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) { + this.raise(this.start, "'import' and 'export' may only appear at the top level"); + } + if (!this.inModule) { + this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); + } + } + return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports); + default: + if (this.isAsyncFunction()) { + if (context) { + this.unexpected(); + } + this.next(); + return this.parseFunctionStatement(node, true, !context); + } + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) { + return this.parseLabeledStatement(node, maybeName, expr, context); + } else { + return this.parseExpressionStatement(node, expr); + } + } +}; +pp$8.parseBreakContinueStatement = function(node, keyword) { + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types$1.semi) || this.insertSemicolon()) { + node.label = null; + } else if (this.type !== types$1.name) { + this.unexpected(); + } else { + node.label = this.parseIdent(); + this.semicolon(); + } + var i = 0; + for (; i < this.labels.length; ++i) { + var lab = this.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { + break; + } + if (node.label && isBreak) { + break; + } + } + } + if (i === this.labels.length) { + this.raise(node.start, "Unsyntactic " + keyword); + } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); +}; +pp$8.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); +}; +pp$8.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types$1._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) { + this.eat(types$1.semi); + } else { + this.semicolon(); + } + return this.finishNode(node, "DoWhileStatement"); +}; +pp$8.parseForStatement = function(node) { + this.next(); + var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterScope(0); + this.expect(types$1.parenL); + if (this.type === types$1.semi) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, null); + } + var isLet = this.isLet(); + if (this.type === types$1._var || this.type === types$1._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$1._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + return this.parseForIn(node, init$1); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init$1); + } + var startsWithLet = this.isContextual("let"), isForOf = false; + var refDestructuringErrors = new DestructuringErrors(); + var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); + if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$1._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + if (startsWithLet && isForOf) { + this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLValPattern(init); + return this.parseForIn(node, init); + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); +}; +pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync); +}; +pp$8.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement"); +}; +pp$8.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) { + this.raise(this.start, "'return' outside of function"); + } + this.next(); + if (this.eat(types$1.semi) || this.insertSemicolon()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } + return this.finishNode(node, "ReturnStatement"); +}; +pp$8.parseSwitchStatement = function(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types$1.braceL); + this.labels.push(switchLabel); + this.enterScope(0); + var cur; + for (var sawDefault = false; this.type !== types$1.braceR; ) { + if (this.type === types$1._case || this.type === types$1._default) { + var isCase = this.type === types$1._case; + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { + this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); + } + sawDefault = true; + cur.test = null; + } + this.expect(types$1.colon); + } else { + if (!cur) { + this.unexpected(); + } + cur.consequent.push(this.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + this.next(); + this.labels.pop(); + return this.finishNode(node, "SwitchStatement"); +}; +pp$8.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { + this.raise(this.lastTokEnd, "Illegal newline after throw"); + } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); +}; +var empty$1 = []; +pp$8.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types$1._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types$1.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types$1.parenR); + } else { + if (this.options.ecmaVersion < 10) { + this.unexpected(); + } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) { + this.raise(node.start, "Missing catch or finally clause"); + } + return this.finishNode(node, "TryStatement"); +}; +pp$8.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); +}; +pp$8.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement"); +}; +pp$8.parseWithStatement = function(node) { + if (this.strict) { + this.raise(this.start, "'with' in strict mode"); + } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement"); +}; +pp$8.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); +}; +pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { + for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) { + var label = list[i$1]; + if (label.name === maybeName) { + this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } + } + var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label$1 = this.labels[i]; + if (label$1.statementStart === node.start) { + label$1.statementStart = this.start; + label$1.kind = kind; + } else { + break; + } + } + this.labels.push({ name: maybeName, kind, statementStart: this.start }); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); +}; +pp$8.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); +}; +pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { + if (createNewLexicalScope === void 0) + createNewLexicalScope = true; + if (node === void 0) + node = this.startNode(); + node.body = []; + this.expect(types$1.braceL); + if (createNewLexicalScope) { + this.enterScope(0); + } + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + if (exitStrict) { + this.strict = false; + } + this.next(); + if (createNewLexicalScope) { + this.exitScope(); + } + return this.finishNode(node, "BlockStatement"); +}; +pp$8.parseFor = function(node, init) { + node.init = init; + this.expect(types$1.semi); + node.test = this.type === types$1.semi ? null : this.parseExpression(); + this.expect(types$1.semi); + node.update = this.type === types$1.parenR ? null : this.parseExpression(); + this.expect(types$1.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement"); +}; +pp$8.parseForIn = function(node, init) { + var isForIn = this.type === types$1._in; + this.next(); + if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { + this.raise( + init.start, + (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer" + ); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types$1.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); +}; +pp$8.parseVar = function(node, isFor, kind) { + node.declarations = []; + node.kind = kind; + for (; ; ) { + var decl = this.startNode(); + this.parseVarId(decl, kind); + if (this.eat(types$1.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(types$1.comma)) { + break; + } + } + return node; +}; +pp$8.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); +}; +var FUNC_STATEMENT = 1; +var FUNC_HANGING_STATEMENT = 2; +var FUNC_NULLABLE_ID = 4; +pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { + if (this.type === types$1.star && statement & FUNC_HANGING_STATEMENT) { + this.unexpected(); + } + node.generator = this.eat(types$1.star); + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + if (statement & FUNC_STATEMENT) { + node.id = statement & FUNC_NULLABLE_ID && this.type !== types$1.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) { + this.checkLValSimple(node.id, this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); + } + } + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); + if (!(statement & FUNC_STATEMENT)) { + node.id = this.type === types$1.name ? this.parseIdent() : null; + } + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, statement & FUNC_STATEMENT ? "FunctionDeclaration" : "FunctionExpression"); +}; +pp$8.parseFunctionParams = function(node) { + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); +}; +pp$8.parseClass = function(node, isStatement) { + this.next(); + var oldStrict = this.strict; + this.strict = true; + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var privateNameMap = this.enterClassBody(); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types$1.braceL); + while (this.type !== types$1.braceR) { + var element = this.parseClassElement(node.superClass !== null); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { + this.raise(element.start, "Duplicate constructor in the same class"); + } + hadConstructor = true; + } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) { + this.raiseRecoverable(element.key.start, "Identifier '#" + element.key.name + "' has already been declared"); + } + } + } + this.strict = oldStrict; + this.next(); + node.body = this.finishNode(classBody, "ClassBody"); + this.exitClassBody(); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); +}; +pp$8.parseClassElement = function(constructorAllowsSuper) { + if (this.eat(types$1.semi)) { + return null; + } + var ecmaVersion = this.options.ecmaVersion; + var node = this.startNode(); + var keyName = ""; + var isGenerator = false; + var isAsync = false; + var kind = "method"; + var isStatic = false; + if (this.eatContextual("static")) { + if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { + this.parseClassStaticBlock(node); + return node; + } + if (this.isClassElementNameStart() || this.type === types$1.star) { + isStatic = true; + } else { + keyName = "static"; + } + } + node.static = isStatic; + if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { + if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { + isAsync = true; + } else { + keyName = "async"; + } + } + if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { + isGenerator = true; + } + if (!keyName && !isAsync && !isGenerator) { + var lastValue = this.value; + if (this.eatContextual("get") || this.eatContextual("set")) { + if (this.isClassElementNameStart()) { + kind = lastValue; + } else { + keyName = lastValue; + } + } + } + if (keyName) { + node.computed = false; + node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); + node.key.name = keyName; + this.finishNode(node.key, "Identifier"); + } else { + this.parseClassElementName(node); + } + if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { + var isConstructor = !node.static && checkKeyName(node, "constructor"); + var allowsDirectSuper = isConstructor && constructorAllowsSuper; + if (isConstructor && kind !== "method") { + this.raise(node.key.start, "Constructor can't have get/set modifier"); + } + node.kind = isConstructor ? "constructor" : kind; + this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); + } else { + this.parseClassField(node); + } + return node; +}; +pp$8.isClassElementNameStart = function() { + return this.type === types$1.name || this.type === types$1.privateId || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword; +}; +pp$8.parseClassElementName = function(element) { + if (this.type === types$1.privateId) { + if (this.value === "constructor") { + this.raise(this.start, "Classes can't have an element named '#constructor'"); + } + element.computed = false; + element.key = this.parsePrivateIdent(); + } else { + this.parsePropertyName(element); + } +}; +pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + var key = method.key; + if (method.kind === "constructor") { + if (isGenerator) { + this.raise(key.start, "Constructor can't be a generator"); + } + if (isAsync) { + this.raise(key.start, "Constructor can't be an async method"); + } + } else if (method.static && checkKeyName(method, "prototype")) { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + if (method.kind === "get" && value.params.length !== 0) { + this.raiseRecoverable(value.start, "getter should have no params"); + } + if (method.kind === "set" && value.params.length !== 1) { + this.raiseRecoverable(value.start, "setter should have exactly one param"); + } + if (method.kind === "set" && value.params[0].type === "RestElement") { + this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); + } + return this.finishNode(method, "MethodDefinition"); +}; +pp$8.parseClassField = function(field) { + if (checkKeyName(field, "constructor")) { + this.raise(field.key.start, "Classes can't have a field named 'constructor'"); + } else if (field.static && checkKeyName(field, "prototype")) { + this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); + } + if (this.eat(types$1.eq)) { + var scope = this.currentThisScope(); + var inClassFieldInit = scope.inClassFieldInit; + scope.inClassFieldInit = true; + field.value = this.parseMaybeAssign(); + scope.inClassFieldInit = inClassFieldInit; + } else { + field.value = null; + } + this.semicolon(); + return this.finishNode(field, "PropertyDefinition"); +}; +pp$8.parseClassStaticBlock = function(node) { + node.body = []; + var oldLabels = this.labels; + this.labels = []; + this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + this.next(); + this.exitScope(); + this.labels = oldLabels; + return this.finishNode(node, "StaticBlock"); +}; +pp$8.parseClassId = function(node, isStatement) { + if (this.type === types$1.name) { + node.id = this.parseIdent(); + if (isStatement) { + this.checkLValSimple(node.id, BIND_LEXICAL, false); + } + } else { + if (isStatement === true) { + this.unexpected(); + } + node.id = null; + } +}; +pp$8.parseClassSuper = function(node) { + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null; +}; +pp$8.enterClassBody = function() { + var element = { declared: /* @__PURE__ */ Object.create(null), used: [] }; + this.privateNameStack.push(element); + return element.declared; +}; +pp$8.exitClassBody = function() { + var ref2 = this.privateNameStack.pop(); + var declared = ref2.declared; + var used = ref2.used; + var len = this.privateNameStack.length; + var parent = len === 0 ? null : this.privateNameStack[len - 1]; + for (var i = 0; i < used.length; ++i) { + var id = used[i]; + if (!hasOwn(declared, id.name)) { + if (parent) { + parent.used.push(id); + } else { + this.raiseRecoverable(id.start, "Private field '#" + id.name + "' must be declared in an enclosing class"); + } + } + } +}; +function isPrivateNameConflicted(privateNameMap, element) { + var name = element.key.name; + var curr = privateNameMap[name]; + var next = "true"; + if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { + next = (element.static ? "s" : "i") + element.kind; + } + if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") { + privateNameMap[name] = "true"; + return false; + } else if (!curr) { + privateNameMap[name] = next; + return false; + } else { + return true; + } +} +function checkKeyName(node, name) { + var computed = node.computed; + var key = node.key; + return !computed && (key.type === "Identifier" && key.name === name || key.type === "Literal" && key.value === name); +} +pp$8.parseExport = function(node, exports) { + this.next(); + if (this.eat(types$1.star)) { + if (this.options.ecmaVersion >= 11) { + if (this.eatContextual("as")) { + node.exported = this.parseModuleExportName(); + this.checkExport(exports, node.exported, this.lastTokStart); + } else { + node.exported = null; + } + } + this.expectContextual("from"); + if (this.type !== types$1.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration"); + } + if (this.eat(types$1._default)) { + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { + this.next(); + } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); + } else if (this.type === types$1._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration"); + } + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") { + this.checkVariableExport(exports, node.declaration.declarations); + } else { + this.checkExport(exports, node.declaration.id, node.declaration.id.start); + } + node.specifiers = []; + node.source = null; + } else { + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== types$1.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + } else { + for (var i = 0, list = node.specifiers; i < list.length; i += 1) { + var spec = list[i]; + this.checkUnreserved(spec.local); + this.checkLocalExport(spec.local); + if (spec.local.type === "Literal") { + this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); + } + } + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration"); +}; +pp$8.checkExport = function(exports, name, pos) { + if (!exports) { + return; + } + if (typeof name !== "string") { + name = name.type === "Identifier" ? name.name : name.value; + } + if (hasOwn(exports, name)) { + this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); + } + exports[name] = true; +}; +pp$8.checkPatternExport = function(exports, pat) { + var type = pat.type; + if (type === "Identifier") { + this.checkExport(exports, pat, pat.start); + } else if (type === "ObjectPattern") { + for (var i = 0, list = pat.properties; i < list.length; i += 1) { + var prop = list[i]; + this.checkPatternExport(exports, prop); + } + } else if (type === "ArrayPattern") { + for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + if (elt) { + this.checkPatternExport(exports, elt); + } + } + } else if (type === "Property") { + this.checkPatternExport(exports, pat.value); + } else if (type === "AssignmentPattern") { + this.checkPatternExport(exports, pat.left); + } else if (type === "RestElement") { + this.checkPatternExport(exports, pat.argument); + } else if (type === "ParenthesizedExpression") { + this.checkPatternExport(exports, pat.expression); + } +}; +pp$8.checkVariableExport = function(exports, decls) { + if (!exports) { + return; + } + for (var i = 0, list = decls; i < list.length; i += 1) { + var decl = list[i]; + this.checkPatternExport(exports, decl.id); + } +}; +pp$8.shouldParseExportStatement = function() { + return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction(); +}; +pp$8.parseExportSpecifiers = function(exports) { + var nodes = [], first = true; + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + var node = this.startNode(); + node.local = this.parseModuleExportName(); + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports, + node.exported, + node.exported.start + ); + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + return nodes; +}; +pp$8.parseImport = function(node) { + this.next(); + if (this.type === types$1.string) { + node.specifiers = empty$1; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); +}; +pp$8.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types$1.name) { + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLValSimple(node.local, BIND_LEXICAL); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types$1.comma)) { + return nodes; + } + } + if (this.type === types$1.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLValSimple(node$1.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes; + } + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + var node$2 = this.startNode(); + node$2.imported = this.parseModuleExportName(); + if (this.eatContextual("as")) { + node$2.local = this.parseIdent(); + } else { + this.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this.checkLValSimple(node$2.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$2, "ImportSpecifier")); + } + return nodes; +}; +pp$8.parseModuleExportName = function() { + if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { + var stringLiteral = this.parseLiteral(this.value); + if (loneSurrogate.test(stringLiteral.value)) { + this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); + } + return stringLiteral; + } + return this.parseIdent(true); +}; +pp$8.adaptDirectivePrologue = function(statements) { + for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { + statements[i].directive = statements[i].expression.raw.slice(1, -1); + } +}; +pp$8.isDirectiveCandidate = function(statement) { + return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && (this.input[statement.start] === '"' || this.input[statement.start] === "'"); +}; +var pp$7 = Parser.prototype; +pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") { + this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); + } + break; + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + break; + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + this.toAssignable(prop, isBinding); + if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) { + this.raise(prop.argument.start, "Unexpected token"); + } + } + break; + case "Property": + if (node.kind !== "init") { + this.raise(node.key.start, "Object pattern can't contain getter or setter"); + } + this.toAssignable(node.value, isBinding); + break; + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + this.toAssignableList(node.elements, isBinding); + break; + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") { + this.raise(node.argument.start, "Rest elements cannot have a default value"); + } + break; + case "AssignmentExpression": + if (node.operator !== "=") { + this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); + } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + break; + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break; + case "ChainExpression": + this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (!isBinding) { + break; + } + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + return node; +}; +pp$7.toAssignableList = function(exprList, isBinding) { + var end = exprList.length; + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) { + this.toAssignable(elt, isBinding); + } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") { + this.unexpected(last.argument.start); + } + } + return exprList; +}; +pp$7.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement"); +}; +pp$7.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { + this.unexpected(); + } + node.argument = this.parseBindingAtom(); + return this.finishNode(node, "RestElement"); +}; +pp$7.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types$1.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types$1.bracketR, true, true); + return this.finishNode(node, "ArrayPattern"); + case types$1.braceL: + return this.parseObj(true); + } + } + return this.parseIdent(); +}; +pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(types$1.comma); + } + if (allowEmpty && this.type === types$1.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } else if (this.type === types$1.ellipsis) { + var rest = this.parseRestBinding(); + this.parseBindingListItem(rest); + elts.push(rest); + if (this.type === types$1.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + this.expect(close); + break; + } else { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts; +}; +pp$7.parseBindingListItem = function(param) { + return param; +}; +pp$7.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { + return left; + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern"); +}; +pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + var isBind = bindingType !== BIND_NONE; + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { + this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); + } + if (isBind) { + if (bindingType === BIND_LEXICAL && expr.name === "let") { + this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); + } + if (checkClashes) { + if (hasOwn(checkClashes, expr.name)) { + this.raiseRecoverable(expr.start, "Argument name clash"); + } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_OUTSIDE) { + this.declareName(expr.name, bindingType, expr.start); + } + } + break; + case "ChainExpression": + this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding member expression"); + } + break; + case "ParenthesizedExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding parenthesized expression"); + } + return this.checkLValSimple(expr.expression, bindingType, checkClashes); + default: + this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); + } +}; +pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + switch (expr.type) { + case "ObjectPattern": + for (var i = 0, list = expr.properties; i < list.length; i += 1) { + var prop = list[i]; + this.checkLValInnerPattern(prop, bindingType, checkClashes); + } + break; + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + if (elem) { + this.checkLValInnerPattern(elem, bindingType, checkClashes); + } + } + break; + default: + this.checkLValSimple(expr, bindingType, checkClashes); + } +}; +pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + switch (expr.type) { + case "Property": + this.checkLValInnerPattern(expr.value, bindingType, checkClashes); + break; + case "AssignmentPattern": + this.checkLValPattern(expr.left, bindingType, checkClashes); + break; + case "RestElement": + this.checkLValPattern(expr.argument, bindingType, checkClashes); + break; + default: + this.checkLValPattern(expr, bindingType, checkClashes); + } +}; +var TokContext = function TokContext2(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; +}; +var types = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function(p) { + return p.tryReadTemplateToken(); + }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) +}; +var pp$6 = Parser.prototype; +pp$6.initialContext = function() { + return [types.b_stat]; +}; +pp$6.curContext = function() { + return this.context[this.context.length - 1]; +}; +pp$6.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types.f_expr || parent === types.f_stat) { + return true; + } + if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) { + return !parent.isExpr; + } + if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) { + return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); + } + if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) { + return true; + } + if (prevType === types$1.braceL) { + return parent === types.b_stat; + } + if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) { + return false; + } + return !this.exprAllowed; +}; +pp$6.inGeneratorContext = function() { + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this.context[i]; + if (context.token === "function") { + return context.generator; + } + } + return false; +}; +pp$6.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types$1.dot) { + this.exprAllowed = false; + } else if (update = type.updateContext) { + update.call(this, prevType); + } else { + this.exprAllowed = type.beforeExpr; + } +}; +pp$6.overrideContext = function(tokenCtx) { + if (this.curContext() !== tokenCtx) { + this.context[this.context.length - 1] = tokenCtx; + } +}; +types$1.parenR.updateContext = types$1.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return; + } + var out = this.context.pop(); + if (out === types.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; +}; +types$1.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); + this.exprAllowed = true; +}; +types$1.dollarBraceL.updateContext = function() { + this.context.push(types.b_tmpl); + this.exprAllowed = true; +}; +types$1.parenL.updateContext = function(prevType) { + var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; + this.context.push(statementParens ? types.p_stat : types.p_expr); + this.exprAllowed = true; +}; +types$1.incDec.updateContext = function() { +}; +types$1._function.updateContext = types$1._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types$1._else && !(prevType === types$1.semi && this.curContext() !== types.p_stat) && !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) { + this.context.push(types.f_expr); + } else { + this.context.push(types.f_stat); + } + this.exprAllowed = false; +}; +types$1.backQuote.updateContext = function() { + if (this.curContext() === types.q_tmpl) { + this.context.pop(); + } else { + this.context.push(types.q_tmpl); + } + this.exprAllowed = false; +}; +types$1.star.updateContext = function(prevType) { + if (prevType === types$1._function) { + var index2 = this.context.length - 1; + if (this.context[index2] === types.f_expr) { + this.context[index2] = types.f_expr_gen; + } else { + this.context[index2] = types.f_gen; + } + } + this.exprAllowed = true; +}; +types$1.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { + if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { + allowed = true; + } + } + this.exprAllowed = allowed; +}; +var pp$5 = Parser.prototype; +pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { + return; + } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) { + return; + } + var key = prop.key; + var name; + switch (key.type) { + case "Identifier": + name = key.name; + break; + case "Literal": + name = String(key.value); + break; + default: + return; + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors) { + if (refDestructuringErrors.doubleProto < 0) { + refDestructuringErrors.doubleProto = key.start; + } + } else { + this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); + } + } + propHash.proto = true; + } + return; + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) { + this.raiseRecoverable(key.start, "Redefinition of property"); + } + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; +}; +pp$5.parseExpression = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); + if (this.type === types$1.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types$1.comma)) { + node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); + } + return this.finishNode(node, "SequenceExpression"); + } + return expr; +}; +pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { + return this.parseYield(forInit); + } else { + this.exprAllowed = false; + } + } + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors(); + ownDestructuringErrors = true; + } + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types$1.parenL || this.type === types$1.name) { + this.potentialArrowAt = this.start; + this.potentialArrowInForAwait = forInit === "await"; + } + var left = this.parseMaybeConditional(forInit, refDestructuringErrors); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startPos, startLoc); + } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + if (this.type === types$1.eq) { + left = this.toAssignable(left, false, refDestructuringErrors); + } + if (!ownDestructuringErrors) { + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; + } + if (refDestructuringErrors.shorthandAssign >= left.start) { + refDestructuringErrors.shorthandAssign = -1; + } + if (this.type === types$1.eq) { + this.checkLValPattern(left); + } else { + this.checkLValSimple(left); + } + node.left = left; + this.next(); + node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) { + refDestructuringErrors.doubleProto = oldDoubleProto; + } + return this.finishNode(node, "AssignmentExpression"); + } else { + if (ownDestructuringErrors) { + this.checkExpressionErrors(refDestructuringErrors, true); + } + } + if (oldParenAssign > -1) { + refDestructuringErrors.parenthesizedAssign = oldParenAssign; + } + if (oldTrailingComma > -1) { + refDestructuringErrors.trailingComma = oldTrailingComma; + } + return left; +}; +pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(forInit, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + if (this.eat(types$1.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types$1.colon); + node.alternate = this.parseMaybeAssign(forInit); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; +}; +pp$5.parseExprOps = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit); +}; +pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { + var prec = this.type.binop; + if (prec != null && (!forInit || this.type !== types$1._in)) { + if (prec > minPrec) { + var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; + var coalesce = this.type === types$1.coalesce; + if (coalesce) { + prec = types$1.logicalAND.binop; + } + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); + if (logical && this.type === types$1.coalesce || coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND)) { + this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); + } + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit); + } + } + return left; +}; +pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { + if (right.type === "PrivateIdentifier") { + this.raise(right.start, "Private identifier can only be left side of binary expression"); + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression"); +}; +pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && this.canAwait) { + expr = this.parseAwait(forInit); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types$1.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true, update, forInit); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { + this.checkLValSimple(node.argument); + } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { + this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); + } else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) { + this.raiseRecoverable(node.start, "Private fields can not be deleted"); + } else { + sawUnary = true; + } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else if (!sawUnary && this.type === types$1.privateId) { + if (forInit || this.privateNameStack.length === 0) { + this.unexpected(); + } + expr = this.parsePrivateIdent(); + if (this.type !== types$1._in) { + this.unexpected(); + } + } else { + expr = this.parseExprSubscripts(refDestructuringErrors, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.operator = this.value; + node$1.prefix = false; + node$1.argument = expr; + this.checkLValSimple(expr); + this.next(); + expr = this.finishNode(node$1, "UpdateExpression"); + } + } + if (!incDec && this.eat(types$1.starstar)) { + if (sawUnary) { + this.unexpected(this.lastTokStart); + } else { + return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false); + } + } else { + return expr; + } +}; +function isPrivateFieldAccess(node) { + return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression); +} +pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors, forInit); + if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") { + return expr; + } + var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { + refDestructuringErrors.parenthesizedAssign = -1; + } + if (refDestructuringErrors.parenthesizedBind >= result.start) { + refDestructuringErrors.parenthesizedBind = -1; + } + if (refDestructuringErrors.trailingComma >= result.start) { + refDestructuringErrors.trailingComma = -1; + } + } + return result; +}; +pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.potentialArrowAt === base.start; + var optionalChained = false; + while (true) { + var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); + if (element.optional) { + optionalChained = true; + } + if (element === base || element.type === "ArrowFunctionExpression") { + if (optionalChained) { + var chainNode = this.startNodeAt(startPos, startLoc); + chainNode.expression = element; + element = this.finishNode(chainNode, "ChainExpression"); + } + return element; + } + base = element; + } +}; +pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { + var optionalSupported = this.options.ecmaVersion >= 11; + var optional = optionalSupported && this.eat(types$1.questionDot); + if (noCalls && optional) { + this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); + } + var computed = this.eat(types$1.bracketL); + if (computed || optional && this.type !== types$1.parenL && this.type !== types$1.backQuote || this.eat(types$1.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + if (computed) { + node.property = this.parseExpression(); + this.expect(types$1.bracketR); + } else if (this.type === types$1.privateId && base.type !== "Super") { + node.property = this.parsePrivateIdent(); + } else { + node.property = this.parseIdent(this.options.allowReserved !== "never"); + } + node.computed = !!computed; + if (optionalSupported) { + node.optional = optional; + } + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types$1.parenL)) { + var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) { + this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); + } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + if (optionalSupported) { + node$1.optional = optional; + } + base = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types$1.backQuote) { + if (optional || optionalChained) { + this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); + } + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this.parseTemplate({ isTagged: true }); + base = this.finishNode(node$2, "TaggedTemplateExpression"); + } + return base; +}; +pp$5.parseExprAtom = function(refDestructuringErrors, forInit) { + if (this.type === types$1.slash) { + this.readRegexp(); + } + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types$1._super: + if (!this.allowSuper) { + this.raise(this.start, "'super' keyword outside a method"); + } + node = this.startNode(); + this.next(); + if (this.type === types$1.parenL && !this.allowDirectSuper) { + this.raise(node.start, "super() call outside constructor of a subclass"); + } + if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) { + this.unexpected(); + } + return this.finishNode(node, "Super"); + case types$1._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); + case types$1.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { + this.overrideContext(types.f_expr); + return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit); + } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types$1.arrow)) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit); + } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) { + this.unexpected(); + } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit); + } + } + return id; + case types$1.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = { pattern: value.pattern, flags: value.flags }; + return node; + case types$1.num: + case types$1.string: + return this.parseLiteral(this.value); + case types$1._null: + case types$1._true: + case types$1._false: + node = this.startNode(); + node.value = this.type === types$1._null ? null : this.type === types$1._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal"); + case types$1.parenL: + var start3 = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { + refDestructuringErrors.parenthesizedAssign = start3; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = start3; + } + } + return expr; + case types$1.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression"); + case types$1.braceL: + this.overrideContext(types.b_expr); + return this.parseObj(false, refDestructuringErrors); + case types$1._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0); + case types$1._class: + return this.parseClass(this.startNode(), false); + case types$1._new: + return this.parseNew(); + case types$1.backQuote: + return this.parseTemplate(); + case types$1._import: + if (this.options.ecmaVersion >= 11) { + return this.parseExprImport(); + } else { + return this.unexpected(); + } + default: + this.unexpected(); + } +}; +pp$5.parseExprImport = function() { + var node = this.startNode(); + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword import"); + } + var meta = this.parseIdent(true); + switch (this.type) { + case types$1.parenL: + return this.parseDynamicImport(node); + case types$1.dot: + node.meta = meta; + return this.parseImportMeta(node); + default: + this.unexpected(); + } +}; +pp$5.parseDynamicImport = function(node) { + this.next(); + node.source = this.parseMaybeAssign(); + if (!this.eat(types$1.parenR)) { + var errorPos = this.start; + if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); + } + } + return this.finishNode(node, "ImportExpression"); +}; +pp$5.parseImportMeta = function(node) { + this.next(); + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "meta") { + this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); + } + if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) { + this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); + } + return this.finishNode(node, "MetaProperty"); +}; +pp$5.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { + node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); + } + this.next(); + return this.finishNode(node, "Literal"); +}; +pp$5.parseParenExpression = function() { + this.expect(types$1.parenL); + var val = this.parseExpression(); + this.expect(types$1.parenR); + return val; +}; +pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + while (this.type !== types$1.parenR) { + first ? first = false : this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { + lastIsComma = true; + break; + } else if (this.type === types$1.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === types$1.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + break; + } else { + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); + } + } + var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; + this.expect(types$1.parenR); + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList, forInit); + } + if (!exprList.length || lastIsComma) { + this.unexpected(this.lastTokStart); + } + if (spreadStart) { + this.unexpected(spreadStart); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression"); + } else { + return val; + } +}; +pp$5.parseParenItem = function(item) { + return item; +}; +pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit); +}; +var empty = []; +pp$5.parseNew = function() { + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword new"); + } + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target") { + this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); + } + if (!this.allowNewDotTarget) { + this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); + } + return this.finishNode(node, "MetaProperty"); + } + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); + if (isImport && node.callee.type === "ImportExpression") { + this.raise(startPos, "Cannot use new with import()"); + } + if (this.eat(types$1.parenL)) { + node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); + } else { + node.arguments = empty; + } + return this.finishNode(node, "NewExpression"); +}; +pp$5.parseTemplateElement = function(ref2) { + var isTagged = ref2.isTagged; + var elem = this.startNode(); + if (this.type === types$1.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types$1.backQuote; + return this.finishNode(elem, "TemplateElement"); +}; +pp$5.parseTemplate = function(ref2) { + if (ref2 === void 0) + ref2 = {}; + var isTagged = ref2.isTagged; + if (isTagged === void 0) + isTagged = false; + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({ isTagged }); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === types$1.eof) { + this.raise(this.pos, "Unterminated template literal"); + } + this.expect(types$1.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(types$1.braceR); + node.quasis.push(curElt = this.parseTemplateElement({ isTagged })); + } + this.next(); + return this.finishNode(node, "TemplateLiteral"); +}; +pp$5.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types$1.star) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); +}; +pp$5.parseObj = function(isPattern, refDestructuringErrors) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + var prop = this.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { + this.checkPropClash(prop, propHash, refDestructuringErrors); + } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); +}; +pp$5.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types$1.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement"); + } + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + return this.finishNode(prop, "SpreadElement"); + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) { + isGenerator = this.eat(types$1.star); + } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property"); +}; +pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types$1.colon) { + this.unexpected(); + } + if (this.eat(types$1.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { + if (isPattern) { + this.unexpected(); + } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { + if (isGenerator || isAsync) { + this.unexpected(); + } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start3 = prop.value.start; + if (prop.kind === "get") { + this.raiseRecoverable(start3, "getter should have no params"); + } else { + this.raiseRecoverable(start3, "setter should have exactly one param"); + } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { + this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); + } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { + this.unexpected(); + } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = startPos; + } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else if (this.type === types$1.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) { + refDestructuringErrors.shorthandAssign = this.start; + } + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else { + prop.value = this.copyNode(prop.key); + } + prop.shorthand = true; + } else { + this.unexpected(); + } +}; +pp$5.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types$1.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types$1.bracketR); + return prop.key; + } else { + prop.computed = false; + } + } + return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"); +}; +pp$5.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { + node.generator = node.expression = false; + } + if (this.options.ecmaVersion >= 8) { + node.async = false; + } +}; +pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.initFunction(node); + if (this.options.ecmaVersion >= 6) { + node.generator = isGenerator; + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true, false); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression"); +}; +pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression"); +}; +pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { + var isExpression = isArrowFunction && this.type !== types$1.braceL; + var oldStrict = this.strict, useStrict = false; + if (isExpression) { + node.body = this.parseMaybeAssign(forInit); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + if (useStrict && nonSimple) { + this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); + } + } + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { + this.strict = true; + } + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + if (this.strict && node.id) { + this.checkLValSimple(node.id, BIND_OUTSIDE); + } + node.body = this.parseBlock(false, void 0, useStrict && !oldStrict); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); +}; +pp$5.isSimpleParamList = function(params) { + for (var i = 0, list = params; i < list.length; i += 1) { + var param = list[i]; + if (param.type !== "Identifier") { + return false; + } + } + return true; +}; +pp$5.checkParams = function(node, allowDuplicates) { + var nameHash = /* @__PURE__ */ Object.create(null); + for (var i = 0, list = node.params; i < list.length; i += 1) { + var param = list[i]; + this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); + } +}; +pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } + } else { + first = false; + } + var elt = void 0; + if (allowEmpty && this.type === types$1.comma) { + elt = null; + } else if (this.type === types$1.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts; +}; +pp$5.checkUnreserved = function(ref2) { + var start3 = ref2.start; + var end = ref2.end; + var name = ref2.name; + if (this.inGenerator && name === "yield") { + this.raiseRecoverable(start3, "Cannot use 'yield' as identifier inside a generator"); + } + if (this.inAsync && name === "await") { + this.raiseRecoverable(start3, "Cannot use 'await' as identifier inside an async function"); + } + if (this.currentThisScope().inClassFieldInit && name === "arguments") { + this.raiseRecoverable(start3, "Cannot use 'arguments' in class field initializer"); + } + if (this.inClassStaticBlock && (name === "arguments" || name === "await")) { + this.raise(start3, "Cannot use " + name + " in class static initialization block"); + } + if (this.keywords.test(name)) { + this.raise(start3, "Unexpected keyword '" + name + "'"); + } + if (this.options.ecmaVersion < 6 && this.input.slice(start3, end).indexOf("\\") !== -1) { + return; + } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") { + this.raiseRecoverable(start3, "Cannot use keyword 'await' outside an async function"); + } + this.raiseRecoverable(start3, "The keyword '" + name + "' is reserved"); + } +}; +pp$5.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (this.type === types$1.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(!!liberal); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = node.start; + } + } + return node; +}; +pp$5.parsePrivateIdent = function() { + var node = this.startNode(); + if (this.type === types$1.privateId) { + node.name = this.value; + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "PrivateIdentifier"); + if (this.privateNameStack.length === 0) { + this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class"); + } else { + this.privateNameStack[this.privateNameStack.length - 1].used.push(node); + } + return node; +}; +pp$5.parseYield = function(forInit) { + if (!this.yieldPos) { + this.yieldPos = this.start; + } + var node = this.startNode(); + this.next(); + if (this.type === types$1.semi || this.canInsertSemicolon() || this.type !== types$1.star && !this.type.startsExpr) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types$1.star); + node.argument = this.parseMaybeAssign(forInit); + } + return this.finishNode(node, "YieldExpression"); +}; +pp$5.parseAwait = function(forInit) { + if (!this.awaitPos) { + this.awaitPos = this.start; + } + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true, false, forInit); + return this.finishNode(node, "AwaitExpression"); +}; +var pp$4 = Parser.prototype; +pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; + err.loc = loc; + err.raisedAt = this.pos; + throw err; +}; +pp$4.raiseRecoverable = pp$4.raise; +pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart); + } +}; +var pp$3 = Parser.prototype; +var Scope = function Scope2(flags) { + this.flags = flags; + this.var = []; + this.lexical = []; + this.functions = []; + this.inClassFieldInit = false; +}; +pp$3.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); +}; +pp$3.exitScope = function() { + this.scopeStack.pop(); +}; +pp$3.treatFunctionsAsVarInScope = function(scope) { + return scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_TOP; +}; +pp$3.declareName = function(name, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + if (this.inModule && scope.flags & SCOPE_TOP) { + delete this.undefinedExports[name]; + } + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) { + redeclared = scope$2.lexical.indexOf(name) > -1; + } else { + redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; + } + scope$2.functions.push(name); + } else { + for (var i = this.scopeStack.length - 1; i >= 0; --i) { + var scope$3 = this.scopeStack[i]; + if (scope$3.lexical.indexOf(name) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { + redeclared = true; + break; + } + scope$3.var.push(name); + if (this.inModule && scope$3.flags & SCOPE_TOP) { + delete this.undefinedExports[name]; + } + if (scope$3.flags & SCOPE_VAR) { + break; + } + } + } + if (redeclared) { + this.raiseRecoverable(pos, "Identifier '" + name + "' has already been declared"); + } +}; +pp$3.checkLocalExport = function(id) { + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } +}; +pp$3.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1]; +}; +pp$3.currentVarScope = function() { + for (var i = this.scopeStack.length - 1; ; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { + return scope; + } + } +}; +pp$3.currentThisScope = function() { + for (var i = this.scopeStack.length - 1; ; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { + return scope; + } + } +}; +var Node = function Node2(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) { + this.loc = new SourceLocation(parser, loc); + } + if (parser.options.directSourceFile) { + this.sourceFile = parser.options.directSourceFile; + } + if (parser.options.ranges) { + this.range = [pos, 0]; + } +}; +var pp$2 = Parser.prototype; +pp$2.startNode = function() { + return new Node(this, this.start, this.startLoc); +}; +pp$2.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc); +}; +function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) { + node.loc.end = loc; + } + if (this.options.ranges) { + node.range[1] = pos; + } + return node; +} +pp$2.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc); +}; +pp$2.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc); +}; +pp$2.copyNode = function(node) { + var newNode = new Node(this, node.start, this.startLoc); + for (var prop in node) { + newNode[prop] = node[prop]; + } + return newNode; +}; +var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; +var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; +var ecma11BinaryProperties = ecma10BinaryProperties; +var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; +var ecma13BinaryProperties = ecma12BinaryProperties; +var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma10BinaryProperties, + 11: ecma11BinaryProperties, + 12: ecma12BinaryProperties, + 13: ecma13BinaryProperties +}; +var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; +var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; +var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; +var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; +var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; +var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; +var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma10ScriptValues, + 11: ecma11ScriptValues, + 12: ecma12ScriptValues, + 13: ecma13ScriptValues +}; +var data = {}; +function buildUnicodeData(ecmaVersion) { + var d = data[ecmaVersion] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) + } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; +} +for (i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) { + ecmaVersion = list[i]; + buildUnicodeData(ecmaVersion); +} +var ecmaVersion; +var i; +var list; +var pp$1 = Parser.prototype; +var RegExpValidationState = function RegExpValidationState2(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; +}; +RegExpValidationState.prototype.reset = function reset(start3, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start3 | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; +}; +RegExpValidationState.prototype.raise = function raise(message) { + this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message); +}; +RegExpValidationState.prototype.at = function at(i, forceU) { + if (forceU === void 0) + forceU = false; + var s = this.source; + var l = s.length; + if (i >= l) { + return -1; + } + var c = s.charCodeAt(i); + if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l) { + return c; + } + var next = s.charCodeAt(i + 1); + return next >= 56320 && next <= 57343 ? (c << 10) + next - 56613888 : c; +}; +RegExpValidationState.prototype.nextIndex = function nextIndex(i, forceU) { + if (forceU === void 0) + forceU = false; + var s = this.source; + var l = s.length; + if (i >= l) { + return l; + } + var c = s.charCodeAt(i), next; + if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l || (next = s.charCodeAt(i + 1)) < 56320 || next > 57343) { + return i + 1; + } + return i + 2; +}; +RegExpValidationState.prototype.current = function current(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.pos, forceU); +}; +RegExpValidationState.prototype.lookahead = function lookahead(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.nextIndex(this.pos, forceU), forceU); +}; +RegExpValidationState.prototype.advance = function advance(forceU) { + if (forceU === void 0) + forceU = false; + this.pos = this.nextIndex(this.pos, forceU); +}; +RegExpValidationState.prototype.eat = function eat(ch, forceU) { + if (forceU === void 0) + forceU = false; + if (this.current(forceU) === ch) { + this.advance(forceU); + return true; + } + return false; +}; +pp$1.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + } +}; +pp$1.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } +}; +pp$1.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + this.regexp_disjunction(state); + if (state.pos !== state.source.length) { + if (state.eat(41)) { + state.raise("Unmatched ')'"); + } + if (state.eat(93) || state.eat(125)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { + var name = list[i]; + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } +}; +pp$1.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat(124)) { + this.regexp_alternative(state); + } + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(123)) { + state.raise("Lone quantifier brackets"); + } +}; +pp$1.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) { + } +}; +pp$1.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true; + } + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true; + } + return false; +}; +pp$1.regexp_eatAssertion = function(state) { + var start3 = state.pos; + state.lastAssertionIsQuantifiable = false; + if (state.eat(94) || state.eat(36)) { + return true; + } + if (state.eat(92)) { + if (state.eat(66) || state.eat(98)) { + return true; + } + state.pos = start3; + } + if (state.eat(40) && state.eat(63)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(60); + } + if (state.eat(61) || state.eat(33)) { + this.regexp_disjunction(state); + if (!state.eat(41)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true; + } + } + state.pos = start3; + return false; +}; +pp$1.regexp_eatQuantifier = function(state, noError) { + if (noError === void 0) + noError = false; + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(63); + return true; + } + return false; +}; +pp$1.regexp_eatQuantifierPrefix = function(state, noError) { + return state.eat(42) || state.eat(43) || state.eat(63) || this.regexp_eatBracedQuantifier(state, noError); +}; +pp$1.regexp_eatBracedQuantifier = function(state, noError) { + var start3 = state.pos; + if (state.eat(123)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(44) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(125)) { + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true; + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatAtom = function(state) { + return this.regexp_eatPatternCharacters(state) || state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state); +}; +pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { + var start3 = state.pos; + if (state.eat(92)) { + if (this.regexp_eatAtomEscape(state)) { + return true; + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatUncapturingGroup = function(state) { + var start3 = state.pos; + if (state.eat(40)) { + if (state.eat(63) && state.eat(58)) { + this.regexp_disjunction(state); + if (state.eat(41)) { + return true; + } + state.raise("Unterminated group"); + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatCapturingGroup = function(state) { + if (state.eat(40)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 63) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(41)) { + state.numCapturingParens += 1; + return true; + } + state.raise("Unterminated group"); + } + return false; +}; +pp$1.regexp_eatExtendedAtom = function(state) { + return state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state); +}; +pp$1.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false; +}; +pp$1.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; +}; +function isSyntaxCharacter(ch) { + return ch === 36 || ch >= 40 && ch <= 43 || ch === 46 || ch === 63 || ch >= 91 && ch <= 94 || ch >= 123 && ch <= 125; +} +pp$1.regexp_eatPatternCharacters = function(state) { + var start3 = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start3; +}; +pp$1.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if (ch !== -1 && ch !== 36 && !(ch >= 40 && ch <= 43) && ch !== 46 && ch !== 63 && ch !== 91 && ch !== 94 && ch !== 124) { + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_groupSpecifier = function(state) { + if (state.eat(63)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return; + } + state.raise("Invalid group"); + } +}; +pp$1.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(60)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(62)) { + return true; + } + state.raise("Invalid capture group name"); + } + return false; +}; +pp$1.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + } + return true; + } + return false; +}; +pp$1.regexp_eatRegExpIdentifierStart = function(state) { + var start3 = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start3; + return false; +}; +function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 36 || ch === 95; +} +pp$1.regexp_eatRegExpIdentifierPart = function(state) { + var start3 = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start3; + return false; +}; +function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 36 || ch === 95 || ch === 8204 || ch === 8205; +} +pp$1.regexp_eatAtomEscape = function(state) { + if (this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || state.switchN && this.regexp_eatKGroupName(state)) { + return true; + } + if (state.switchU) { + if (state.current() === 99) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false; +}; +pp$1.regexp_eatBackReference = function(state) { + var start3 = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true; + } + if (n <= state.numCapturingParens) { + return true; + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatKGroupName = function(state) { + if (state.eat(107)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true; + } + state.raise("Invalid named reference"); + } + return false; +}; +pp$1.regexp_eatCharacterEscape = function(state) { + return this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || !state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state) || this.regexp_eatIdentityEscape(state); +}; +pp$1.regexp_eatCControlLetter = function(state) { + var start3 = state.pos; + if (state.eat(99)) { + if (this.regexp_eatControlLetter(state)) { + return true; + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatZero = function(state) { + if (state.current() === 48 && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 116) { + state.lastIntValue = 9; + state.advance(); + return true; + } + if (ch === 110) { + state.lastIntValue = 10; + state.advance(); + return true; + } + if (ch === 118) { + state.lastIntValue = 11; + state.advance(); + return true; + } + if (ch === 102) { + state.lastIntValue = 12; + state.advance(); + return true; + } + if (ch === 114) { + state.lastIntValue = 13; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; +}; +function isControlLetter(ch) { + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122; +} +pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + if (forceU === void 0) + forceU = false; + var start3 = state.pos; + var switchU = forceU || state.switchU; + if (state.eat(117)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (switchU && lead >= 55296 && lead <= 56319) { + var leadSurrogateEnd = state.pos; + if (state.eat(92) && state.eat(117) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 56320 && trail <= 57343) { + state.lastIntValue = (lead - 55296) * 1024 + (trail - 56320) + 65536; + return true; + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true; + } + if (switchU && state.eat(123) && this.regexp_eatHexDigits(state) && state.eat(125) && isValidUnicode(state.lastIntValue)) { + return true; + } + if (switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start3; + } + return false; +}; +function isValidUnicode(ch) { + return ch >= 0 && ch <= 1114111; +} +pp$1.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true; + } + if (state.eat(47)) { + state.lastIntValue = 47; + return true; + } + return false; + } + var ch = state.current(); + if (ch !== 99 && (!state.switchN || ch !== 107)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 49 && ch <= 57) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } while ((ch = state.current()) >= 48 && ch <= 57); + return true; + } + return false; +}; +pp$1.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true; + } + if (state.switchU && this.options.ecmaVersion >= 9 && (ch === 80 || ch === 112)) { + state.lastIntValue = -1; + state.advance(); + if (state.eat(123) && this.regexp_eatUnicodePropertyValueExpression(state) && state.eat(125)) { + return true; + } + state.raise("Invalid property name"); + } + return false; +}; +function isCharacterClassEscape(ch) { + return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87; +} +pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { + var start3 = state.pos; + if (this.regexp_eatUnicodePropertyName(state) && state.eat(61)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true; + } + } + state.pos = start3; + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true; + } + return false; +}; +pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!hasOwn(state.unicodeProperties.nonBinary, name)) { + state.raise("Invalid property name"); + } + if (!state.unicodeProperties.nonBinary[name].test(value)) { + state.raise("Invalid property value"); + } +}; +pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (!state.unicodeProperties.binary.test(nameOrValue)) { + state.raise("Invalid property name"); + } +}; +pp$1.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== ""; +}; +function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 95; +} +pp$1.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== ""; +}; +function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch); +} +pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state); +}; +pp$1.regexp_eatCharacterClass = function(state) { + if (state.eat(91)) { + state.eat(94); + this.regexp_classRanges(state); + if (state.eat(93)) { + return true; + } + state.raise("Unterminated character class"); + } + return false; +}; +pp$1.regexp_classRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(45) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } +}; +pp$1.regexp_eatClassAtom = function(state) { + var start3 = state.pos; + if (state.eat(92)) { + if (this.regexp_eatClassEscape(state)) { + return true; + } + if (state.switchU) { + var ch$1 = state.current(); + if (ch$1 === 99 || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start3; + } + var ch = state.current(); + if (ch !== 93) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatClassEscape = function(state) { + var start3 = state.pos; + if (state.eat(98)) { + state.lastIntValue = 8; + return true; + } + if (state.switchU && state.eat(45)) { + state.lastIntValue = 45; + return true; + } + if (!state.switchU && state.eat(99)) { + if (this.regexp_eatClassControlLetter(state)) { + return true; + } + state.pos = start3; + } + return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state); +}; +pp$1.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 95) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatHexEscapeSequence = function(state) { + var start3 = state.pos; + if (state.eat(120)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true; + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatDecimalDigits = function(state) { + var start3 = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } + return state.pos !== start3; +}; +function isDecimalDigit(ch) { + return ch >= 48 && ch <= 57; +} +pp$1.regexp_eatHexDigits = function(state) { + var start3 = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start3; +}; +function isHexDigit(ch) { + return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102; +} +function hexToInt(ch) { + if (ch >= 65 && ch <= 70) { + return 10 + (ch - 65); + } + if (ch >= 97 && ch <= 102) { + return 10 + (ch - 97); + } + return ch - 48; +} +pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true; + } + return false; +}; +pp$1.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 48; + state.advance(); + return true; + } + state.lastIntValue = 0; + return false; +}; +function isOctalDigit(ch) { + return ch >= 48 && ch <= 55; +} +pp$1.regexp_eatFixedHexDigits = function(state, length) { + var start3 = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start3; + return false; + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true; +}; +var Token = function Token2(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) { + this.loc = new SourceLocation(p, p.startLoc, p.endLoc); + } + if (p.options.ranges) { + this.range = [p.start, p.end]; + } +}; +var pp = Parser.prototype; +pp.next = function(ignoreEscapeSequenceInKeyword) { + if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); + } + if (this.options.onToken) { + this.options.onToken(new Token(this)); + } + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); +}; +pp.getToken = function() { + this.next(); + return new Token(this); +}; +if (typeof Symbol !== "undefined") { + pp[Symbol.iterator] = function() { + var this$1$1 = this; + return { + next: function() { + var token = this$1$1.getToken(); + return { + done: token.type === types$1.eof, + value: token + }; + } + }; + }; +} +pp.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { + this.skipSpace(); + } + this.start = this.pos; + if (this.options.locations) { + this.startLoc = this.curPosition(); + } + if (this.pos >= this.input.length) { + return this.finishToken(types$1.eof); + } + if (curContext.override) { + return curContext.override(this); + } else { + this.readToken(this.fullCharCodeAtPos()); + } +}; +pp.readToken = function(code) { + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92) { + return this.readWord(); + } + return this.getTokenFromCode(code); +}; +pp.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 55295 || code >= 56320) { + return code; + } + var next = this.input.charCodeAt(this.pos + 1); + return next <= 56319 || next >= 57344 ? code : (code << 10) + next - 56613888; +}; +pp.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start3 = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { + this.raise(this.pos - 2, "Unterminated comment"); + } + this.pos = end + 2; + if (this.options.locations) { + for (var nextBreak = void 0, pos = start3; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1; ) { + ++this.curLine; + pos = this.lineStart = nextBreak; + } + } + if (this.options.onComment) { + this.options.onComment( + true, + this.input.slice(start3 + 2, end), + start3, + this.pos, + startLoc, + this.curPosition() + ); + } +}; +pp.skipLineComment = function(startSkip) { + var start3 = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) { + this.options.onComment( + false, + this.input.slice(start3 + startSkip, this.pos), + start3, + this.pos, + startLoc, + this.curPosition() + ); + } +}; +pp.skipSpace = function() { + loop: + while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: + case 160: + ++this.pos; + break; + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10: + case 8232: + case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break; + case 47: + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: + this.skipBlockComment(); + break; + case 47: + this.skipLineComment(2); + break; + default: + break loop; + } + break; + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop; + } + } + } +}; +pp.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { + this.endLoc = this.curPosition(); + } + var prevType = this.type; + this.type = type; + this.value = val; + this.updateContext(prevType); +}; +pp.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { + return this.readNumber(true); + } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { + this.pos += 3; + return this.finishToken(types$1.ellipsis); + } else { + ++this.pos; + return this.finishToken(types$1.dot); + } +}; +pp.readToken_slash = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { + ++this.pos; + return this.readRegexp(); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.slash, 1); +}; +pp.readToken_mult_modulo_exp = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types$1.star : types$1.modulo; + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size; + tokentype = types$1.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, size + 1); + } + return this.finishOp(tokentype, size); +}; +pp.readToken_pipe_amp = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (this.options.ecmaVersion >= 12) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 === 61) { + return this.finishOp(types$1.assign, 3); + } + } + return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1); +}; +pp.readToken_caret = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.bitwiseXOR, 1); +}; +pp.readToken_plus_min = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + return this.finishOp(types$1.incDec, 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.plusMin, 1); +}; +pp.readToken_lt_gt = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { + return this.finishOp(types$1.assign, size + 1); + } + return this.finishOp(types$1.bitShift, size); + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { + this.skipLineComment(4); + this.skipSpace(); + return this.nextToken(); + } + if (next === 61) { + size = 2; + } + return this.finishOp(types$1.relational, size); +}; +pp.readToken_eq_excl = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2); + } + if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { + this.pos += 2; + return this.finishToken(types$1.arrow); + } + return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1); +}; +pp.readToken_question = function() { + var ecmaVersion = this.options.ecmaVersion; + if (ecmaVersion >= 11) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 46) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 < 48 || next2 > 57) { + return this.finishOp(types$1.questionDot, 2); + } + } + if (next === 63) { + if (ecmaVersion >= 12) { + var next2$1 = this.input.charCodeAt(this.pos + 2); + if (next2$1 === 61) { + return this.finishOp(types$1.assign, 3); + } + } + return this.finishOp(types$1.coalesce, 2); + } + } + return this.finishOp(types$1.question, 1); +}; +pp.readToken_numberSign = function() { + var ecmaVersion = this.options.ecmaVersion; + var code = 35; + if (ecmaVersion >= 13) { + ++this.pos; + code = this.fullCharCodeAtPos(); + if (isIdentifierStart(code, true) || code === 92) { + return this.finishToken(types$1.privateId, this.readWord1()); + } + } + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); +}; +pp.getTokenFromCode = function(code) { + switch (code) { + case 46: + return this.readToken_dot(); + case 40: + ++this.pos; + return this.finishToken(types$1.parenL); + case 41: + ++this.pos; + return this.finishToken(types$1.parenR); + case 59: + ++this.pos; + return this.finishToken(types$1.semi); + case 44: + ++this.pos; + return this.finishToken(types$1.comma); + case 91: + ++this.pos; + return this.finishToken(types$1.bracketL); + case 93: + ++this.pos; + return this.finishToken(types$1.bracketR); + case 123: + ++this.pos; + return this.finishToken(types$1.braceL); + case 125: + ++this.pos; + return this.finishToken(types$1.braceR); + case 58: + ++this.pos; + return this.finishToken(types$1.colon); + case 96: + if (this.options.ecmaVersion < 6) { + break; + } + ++this.pos; + return this.finishToken(types$1.backQuote); + case 48: + var next = this.input.charCodeAt(this.pos + 1); + if (next === 120 || next === 88) { + return this.readRadixNumber(16); + } + if (this.options.ecmaVersion >= 6) { + if (next === 111 || next === 79) { + return this.readRadixNumber(8); + } + if (next === 98 || next === 66) { + return this.readRadixNumber(2); + } + } + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return this.readNumber(false); + case 34: + case 39: + return this.readString(code); + case 47: + return this.readToken_slash(); + case 37: + case 42: + return this.readToken_mult_modulo_exp(code); + case 124: + case 38: + return this.readToken_pipe_amp(code); + case 94: + return this.readToken_caret(); + case 43: + case 45: + return this.readToken_plus_min(code); + case 60: + case 62: + return this.readToken_lt_gt(code); + case 61: + case 33: + return this.readToken_eq_excl(code); + case 63: + return this.readToken_question(); + case 126: + return this.finishOp(types$1.prefix, 1); + case 35: + return this.readToken_numberSign(); + } + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); +}; +pp.finishOp = function(type, size) { + var str = this.input.slice(this.pos, this.pos + size); + this.pos += size; + return this.finishToken(type, str); +}; +pp.readRegexp = function() { + var escaped, inClass, start3 = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(start3, "Unterminated regular expression"); + } + var ch = this.input.charAt(this.pos); + if (lineBreak.test(ch)) { + this.raise(start3, "Unterminated regular expression"); + } + if (!escaped) { + if (ch === "[") { + inClass = true; + } else if (ch === "]" && inClass) { + inClass = false; + } else if (ch === "/" && !inClass) { + break; + } + escaped = ch === "\\"; + } else { + escaped = false; + } + ++this.pos; + } + var pattern = this.input.slice(start3, this.pos); + ++this.pos; + var flagsStart = this.pos; + var flags = this.readWord1(); + if (this.containsEsc) { + this.unexpected(flagsStart); + } + var state = this.regexpState || (this.regexpState = new RegExpValidationState(this)); + state.reset(start3, pattern, flags); + this.validateRegExpFlags(state); + this.validateRegExpPattern(state); + var value = null; + try { + value = new RegExp(pattern, flags); + } catch (e) { + } + return this.finishToken(types$1.regexp, { pattern, flags, value }); +}; +pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { + var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; + var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; + var start3 = this.pos, total = 0, lastCode = 0; + for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) { + var code = this.input.charCodeAt(this.pos), val = void 0; + if (allowSeparators && code === 95) { + if (isLegacyOctalNumericLiteral) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); + } + if (lastCode === 95) { + this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); + } + if (i === 0) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); + } + lastCode = code; + continue; + } + if (code >= 97) { + val = code - 97 + 10; + } else if (code >= 65) { + val = code - 65 + 10; + } else if (code >= 48 && code <= 57) { + val = code - 48; + } else { + val = Infinity; + } + if (val >= radix) { + break; + } + lastCode = code; + total = total * radix + val; + } + if (allowSeparators && lastCode === 95) { + this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); + } + if (this.pos === start3 || len != null && this.pos - start3 !== len) { + return null; + } + return total; +}; +function stringToNumber(str, isLegacyOctalNumericLiteral) { + if (isLegacyOctalNumericLiteral) { + return parseInt(str, 8); + } + return parseFloat(str.replace(/_/g, "")); +} +function stringToBigInt(str) { + if (typeof BigInt !== "function") { + return null; + } + return BigInt(str.replace(/_/g, "")); +} +pp.readRadixNumber = function(radix) { + var start3 = this.pos; + this.pos += 2; + var val = this.readInt(radix); + if (val == null) { + this.raise(this.start + 2, "Expected number in radix " + radix); + } + if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) { + val = stringToBigInt(this.input.slice(start3, this.pos)); + ++this.pos; + } else if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$1.num, val); +}; +pp.readNumber = function(startsWithDot) { + var start3 = this.pos; + if (!startsWithDot && this.readInt(10, void 0, true) === null) { + this.raise(start3, "Invalid number"); + } + var octal = this.pos - start3 >= 2 && this.input.charCodeAt(start3) === 48; + if (octal && this.strict) { + this.raise(start3, "Invalid number"); + } + var next = this.input.charCodeAt(this.pos); + if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) { + var val$1 = stringToBigInt(this.input.slice(start3, this.pos)); + ++this.pos; + if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$1.num, val$1); + } + if (octal && /[89]/.test(this.input.slice(start3, this.pos))) { + octal = false; + } + if (next === 46 && !octal) { + ++this.pos; + this.readInt(10); + next = this.input.charCodeAt(this.pos); + } + if ((next === 69 || next === 101) && !octal) { + next = this.input.charCodeAt(++this.pos); + if (next === 43 || next === 45) { + ++this.pos; + } + if (this.readInt(10) === null) { + this.raise(start3, "Invalid number"); + } + } + if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + var val = stringToNumber(this.input.slice(start3, this.pos), octal); + return this.finishToken(types$1.num, val); +}; +pp.readCodePoint = function() { + var ch = this.input.charCodeAt(this.pos), code; + if (ch === 123) { + if (this.options.ecmaVersion < 6) { + this.unexpected(); + } + var codePos = ++this.pos; + code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos); + ++this.pos; + if (code > 1114111) { + this.invalidStringToken(codePos, "Code point out of bounds"); + } + } else { + code = this.readHexChar(4); + } + return code; +}; +pp.readString = function(quote) { + var out = "", chunkStart = ++this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated string constant"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === quote) { + break; + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(false); + chunkStart = this.pos; + } else if (ch === 8232 || ch === 8233) { + if (this.options.ecmaVersion < 10) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + if (this.options.locations) { + this.curLine++; + this.lineStart = this.pos; + } + } else { + if (isNewLine(ch)) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(types$1.string, out); +}; +var INVALID_TEMPLATE_ESCAPE_ERROR = {}; +pp.tryReadTemplateToken = function() { + this.inTemplateElement = true; + try { + this.readTmplToken(); + } catch (err) { + if (err === INVALID_TEMPLATE_ESCAPE_ERROR) { + this.readInvalidTemplateToken(); + } else { + throw err; + } + } + this.inTemplateElement = false; +}; +pp.invalidStringToken = function(position2, message) { + if (this.inTemplateElement && this.options.ecmaVersion >= 9) { + throw INVALID_TEMPLATE_ESCAPE_ERROR; + } else { + this.raise(position2, message); + } +}; +pp.readTmplToken = function() { + var out = "", chunkStart = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated template"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { + if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { + if (ch === 36) { + this.pos += 2; + return this.finishToken(types$1.dollarBraceL); + } else { + ++this.pos; + return this.finishToken(types$1.backQuote); + } + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(types$1.template, out); + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(true); + chunkStart = this.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + ++this.pos; + switch (ch) { + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + out += "\n"; + break; + default: + out += String.fromCharCode(ch); + break; + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + chunkStart = this.pos; + } else { + ++this.pos; + } + } +}; +pp.readInvalidTemplateToken = function() { + for (; this.pos < this.input.length; this.pos++) { + switch (this.input[this.pos]) { + case "\\": + ++this.pos; + break; + case "$": + if (this.input[this.pos + 1] !== "{") { + break; + } + case "`": + return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)); + } + } + this.raise(this.start, "Unterminated template"); +}; +pp.readEscapedChar = function(inTemplate) { + var ch = this.input.charCodeAt(++this.pos); + ++this.pos; + switch (ch) { + case 110: + return "\n"; + case 114: + return "\r"; + case 120: + return String.fromCharCode(this.readHexChar(2)); + case 117: + return codePointToString(this.readCodePoint()); + case 116: + return " "; + case 98: + return "\b"; + case 118: + return "\v"; + case 102: + return "\f"; + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + if (this.options.locations) { + this.lineStart = this.pos; + ++this.curLine; + } + return ""; + case 56: + case 57: + if (this.strict) { + this.invalidStringToken( + this.pos - 1, + "Invalid escape sequence" + ); + } + if (inTemplate) { + var codePos = this.pos - 1; + this.invalidStringToken( + codePos, + "Invalid escape sequence in template string" + ); + return null; + } + default: + if (ch >= 48 && ch <= 55) { + var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]; + var octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + this.pos += octalStr.length - 1; + ch = this.input.charCodeAt(this.pos); + if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) { + this.invalidStringToken( + this.pos - 1 - octalStr.length, + inTemplate ? "Octal literal in template string" : "Octal literal in strict mode" + ); + } + return String.fromCharCode(octal); + } + if (isNewLine(ch)) { + return ""; + } + return String.fromCharCode(ch); + } +}; +pp.readHexChar = function(len) { + var codePos = this.pos; + var n = this.readInt(16, len); + if (n === null) { + this.invalidStringToken(codePos, "Bad character escape sequence"); + } + return n; +}; +pp.readWord1 = function() { + this.containsEsc = false; + var word = "", first = true, chunkStart = this.pos; + var astral = this.options.ecmaVersion >= 6; + while (this.pos < this.input.length) { + var ch = this.fullCharCodeAtPos(); + if (isIdentifierChar(ch, astral)) { + this.pos += ch <= 65535 ? 1 : 2; + } else if (ch === 92) { + this.containsEsc = true; + word += this.input.slice(chunkStart, this.pos); + var escStart = this.pos; + if (this.input.charCodeAt(++this.pos) !== 117) { + this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); + } + ++this.pos; + var esc = this.readCodePoint(); + if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { + this.invalidStringToken(escStart, "Invalid Unicode escape"); + } + word += codePointToString(esc); + chunkStart = this.pos; + } else { + break; + } + first = false; + } + return word + this.input.slice(chunkStart, this.pos); +}; +pp.readWord = function() { + var word = this.readWord1(); + var type = types$1.name; + if (this.keywords.test(word)) { + type = keywords[word]; + } + return this.finishToken(type, word); +}; +var version = "8.8.1"; +Parser.acorn = { + Parser, + version, + defaultOptions, + Position, + SourceLocation, + getLineInfo, + Node, + TokenType, + tokTypes: types$1, + keywordTypes: keywords, + TokContext, + tokContexts: types, + isIdentifierChar, + isIdentifierStart, + Token, + isNewLine, + lineBreak, + lineBreakG, + nonASCIIwhitespace +}; + +// node_modules/micromark-extension-mdxjs/index.js +var import_acorn_jsx = __toESM(require_acorn_jsx(), 1); + +// node_modules/micromark-util-chunked/index.js +function splice(list, start3, remove, items) { + const end = list.length; + let chunkStart = 0; + let parameters; + if (start3 < 0) { + start3 = -start3 > end ? 0 : end + start3; + } else { + start3 = start3 > end ? end : start3; + } + remove = remove > 0 ? remove : 0; + if (items.length < 1e4) { + parameters = Array.from(items); + parameters.unshift(start3, remove); + [].splice.apply(list, parameters); + } else { + if (remove) + [].splice.apply(list, [start3, remove]); + while (chunkStart < items.length) { + parameters = items.slice(chunkStart, chunkStart + 1e4); + parameters.unshift(start3, 0); + [].splice.apply(list, parameters); + chunkStart += 1e4; + start3 += 1e4; + } + } +} + +// node_modules/micromark-util-combine-extensions/index.js +var hasOwnProperty2 = {}.hasOwnProperty; +function combineExtensions(extensions) { + const all = {}; + let index2 = -1; + while (++index2 < extensions.length) { + syntaxExtension(all, extensions[index2]); + } + return all; +} +function syntaxExtension(all, extension) { + let hook; + for (hook in extension) { + const maybe = hasOwnProperty2.call(all, hook) ? all[hook] : void 0; + const left = maybe || (all[hook] = {}); + const right = extension[hook]; + let code; + for (code in right) { + if (!hasOwnProperty2.call(left, code)) + left[code] = []; + const value = right[code]; + constructs( + left[code], + Array.isArray(value) ? value : value ? [value] : [] + ); + } + } +} +function constructs(existing, list) { + let index2 = -1; + const before = []; + while (++index2 < list.length) { + ; + (list[index2].add === "after" ? existing : before).push(list[index2]); + } + splice(existing, 0, 0, before); +} + +// node_modules/micromark-util-character/lib/unicode-punctuation-regex.js +var unicodePunctuationRegex = /[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/; + +// node_modules/micromark-util-character/index.js +var asciiAlpha = regexCheck(/[A-Za-z]/); +var asciiDigit = regexCheck(/\d/); +var asciiHexDigit = regexCheck(/[\dA-Fa-f]/); +var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/); +var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/); +var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/); +function markdownLineEndingOrSpace(code) { + return code !== null && (code < 0 || code === 32); +} +function markdownLineEnding(code) { + return code !== null && code < -2; +} +function markdownSpace(code) { + return code === -2 || code === -1 || code === 32; +} +var unicodeWhitespace = regexCheck(/\s/); +var unicodePunctuation = regexCheck(unicodePunctuationRegex); +function regexCheck(regex) { + return check; + function check(code) { + return code !== null && regex.test(String.fromCharCode(code)); + } +} + +// node_modules/micromark-factory-space/index.js +function factorySpace(effects, ok, type, max) { + const limit = max ? max - 1 : Number.POSITIVE_INFINITY; + let size = 0; + return start3; + function start3(code) { + if (markdownSpace(code)) { + effects.enter(type); + return prefix(code); + } + return ok(code); + } + function prefix(code) { + if (markdownSpace(code) && size++ < limit) { + effects.consume(code); + return prefix; + } + effects.exit(type); + return ok(code); + } +} + +// node_modules/unist-util-position-from-estree/index.js +function positionFromEstree(value) { + const node = value || {}; + const loc = node.loc || {}; + const range = node.range || [0, 0]; + const startOffset = range[0] || node.start; + const endOffset = range[1] || node.end; + return { + start: { + line: loc.start && typeof loc.start.line === "number" && loc.start.line > -1 ? loc.start.line : void 0, + column: loc.start && typeof loc.start.column === "number" && loc.start.column > -1 ? loc.start.column + 1 : void 0, + offset: typeof startOffset === "number" && startOffset > -1 ? startOffset : void 0 + }, + end: { + line: loc.end && typeof loc.end.line === "number" && loc.end.line > -1 ? loc.end.line : void 0, + column: loc.end && typeof loc.end.column === "number" && loc.end.column > -1 ? loc.end.column + 1 : void 0, + offset: typeof endOffset === "number" && endOffset > -1 ? endOffset : void 0 + } + }; +} + +// node_modules/unist-util-stringify-position/index.js +function stringifyPosition(value) { + if (!value || typeof value !== "object") { + return ""; + } + if ("position" in value || "type" in value) { + return position(value.position); + } + if ("start" in value || "end" in value) { + return position(value); + } + if ("line" in value || "column" in value) { + return point(value); + } + return ""; +} +function point(point2) { + return index(point2 && point2.line) + ":" + index(point2 && point2.column); +} +function position(pos) { + return point(pos && pos.start) + "-" + point(pos && pos.end); +} +function index(value) { + return value && typeof value === "number" ? value : 1; +} + +// node_modules/vfile-message/index.js +var VFileMessage = class extends Error { + constructor(reason, place, origin) { + const parts = [null, null]; + let position2 = { + start: { line: null, column: null }, + end: { line: null, column: null } + }; + super(); + if (typeof place === "string") { + origin = place; + place = void 0; + } + if (typeof origin === "string") { + const index2 = origin.indexOf(":"); + if (index2 === -1) { + parts[1] = origin; + } else { + parts[0] = origin.slice(0, index2); + parts[1] = origin.slice(index2 + 1); + } + } + if (place) { + if ("type" in place || "position" in place) { + if (place.position) { + position2 = place.position; + } + } else if ("start" in place || "end" in place) { + position2 = place; + } else if ("line" in place || "column" in place) { + position2.start = place; + } + } + this.name = stringifyPosition(place) || "1:1"; + this.message = typeof reason === "object" ? reason.message : reason; + this.stack = typeof reason === "object" ? reason.stack : ""; + this.reason = this.message; + this.fatal; + this.line = position2.start.line; + this.column = position2.start.column; + this.source = parts[0]; + this.ruleId = parts[1]; + this.position = position2; + this.actual; + this.expected; + this.file; + this.url; + this.note; + } +}; +VFileMessage.prototype.file = ""; +VFileMessage.prototype.name = ""; +VFileMessage.prototype.reason = ""; +VFileMessage.prototype.message = ""; +VFileMessage.prototype.stack = ""; +VFileMessage.prototype.fatal = null; +VFileMessage.prototype.column = null; +VFileMessage.prototype.line = null; +VFileMessage.prototype.source = null; +VFileMessage.prototype.ruleId = null; +VFileMessage.prototype.position = null; + +// node_modules/estree-util-visit/color.js +function color(d) { + return "\x1B[33m" + d + "\x1B[39m"; +} + +// node_modules/estree-util-visit/index.js +var own = {}.hasOwnProperty; +var CONTINUE = Symbol("continue"); +var SKIP = Symbol("skip"); +var EXIT = Symbol("exit"); +function visit(tree, visitor) { + let enter; + let leave; + if (typeof visitor === "function") { + enter = visitor; + } else if (visitor && typeof visitor === "object") { + enter = visitor.enter; + leave = visitor.leave; + } + build(tree, null, null, [])(); + function build(node, key, index2, parents) { + if (nodelike(node)) { + visit2.displayName = "node (" + color(node.type) + ")"; + } + return visit2; + function visit2() { + const result = enter ? toResult(enter(node, key, index2, parents)) : []; + if (result[0] === EXIT) { + return result; + } + if (result[0] !== SKIP) { + let cKey; + for (cKey in node) { + if (own.call(node, cKey) && node[cKey] && typeof node[cKey] === "object" && cKey !== "data" && cKey !== "position") { + const value = node[cKey]; + const grandparents = parents.concat(node); + if (Array.isArray(value)) { + let cIndex = 0; + while (cIndex > -1 && cIndex < value.length) { + const subvalue = value[cIndex]; + if (nodelike(subvalue)) { + const subresult = build( + subvalue, + cKey, + cIndex, + grandparents + )(); + if (subresult[0] === EXIT) + return subresult; + cIndex = typeof subresult[1] === "number" ? subresult[1] : cIndex + 1; + } else { + cIndex++; + } + } + } else if (nodelike(value)) { + const subresult = build(value, cKey, null, grandparents)(); + if (subresult[0] === EXIT) + return subresult; + } + } + } + } + return leave ? toResult(leave(node, key, index2, parents)) : result; + } + } +} +function toResult(value) { + if (Array.isArray(value)) { + return value; + } + if (typeof value === "number") { + return [CONTINUE, value]; + } + return [value]; +} +function nodelike(value) { + return Boolean( + value && typeof value === "object" && typeof value.type === "string" && value.type.length > 0 + ); +} + +// node_modules/micromark-util-events-to-acorn/node_modules/vfile-location/index.js +function location(file) { + var value = String(file); + var indices = []; + var search = /\r?\n|\r/g; + while (search.test(value)) { + indices.push(search.lastIndex); + } + indices.push(value.length + 1); + return { toPoint, toOffset }; + function toPoint(offset2) { + var index2 = -1; + if (offset2 > -1 && offset2 < indices[indices.length - 1]) { + while (++index2 < indices.length) { + if (indices[index2] > offset2) { + return { + line: index2 + 1, + column: offset2 - (indices[index2 - 1] || 0) + 1, + offset: offset2 + }; + } + } + } + return { line: void 0, column: void 0, offset: void 0 }; + } + function toOffset(point2) { + var line = point2 && point2.line; + var column = point2 && point2.column; + var offset2; + if (typeof line === "number" && typeof column === "number" && !Number.isNaN(line) && !Number.isNaN(column) && line - 1 in indices) { + offset2 = (indices[line - 2] || 0) + column - 1 || 0; + } + return offset2 > -1 && offset2 < indices[indices.length - 1] ? offset2 : -1; + } +} + +// node_modules/micromark-util-events-to-acorn/index.js +function eventsToAcorn(events, options) { + const { prefix = "", suffix = "" } = options; + const acornOptions = Object.assign({}, options.acornOptions); + const comments = []; + const tokens = []; + const onComment = acornOptions.onComment; + const onToken = acornOptions.onToken; + const acornConfig = Object.assign({}, acornOptions, { + onComment: comments, + onToken: onToken ? tokens : void 0, + preserveParens: true + }); + const chunks = []; + const lines = {}; + let index2 = -1; + let swallow = false; + let estree; + let exception; + let startLine; + if (options.start) { + startLine = options.start.line; + lines[startLine] = options.start; + } + while (++index2 < events.length) { + const [kind, token, context] = events[index2]; + if (kind === "exit") { + chunks.push(context.sliceSerialize(token)); + setPoint(token.start); + setPoint(token.end); + } + } + const source = chunks.join(""); + const value = prefix + source + suffix; + const isEmptyExpression = options.expression && empty2(source); + const place = location(source); + if (isEmptyExpression && !options.allowEmpty) { + throw new VFileMessage( + "Unexpected empty expression", + parseOffsetToUnistPoint(0), + "micromark-extension-mdx-expression:unexpected-empty-expression" + ); + } + try { + estree = options.expression && !isEmptyExpression ? options.acorn.parseExpressionAt(value, 0, acornConfig) : options.acorn.parse(value, acornConfig); + } catch (error_) { + const error = error_; + const point2 = parseOffsetToUnistPoint(error.pos); + error.message = String(error.message).replace(/ \(\d+:\d+\)$/, ""); + error.pos = point2.offset; + error.loc = { + line: point2.line, + column: point2.column - 1 + }; + exception = error; + swallow = error.raisedAt >= prefix.length + source.length || error.message === "Unterminated comment"; + } + if (estree && options.expression && !isEmptyExpression) { + if (empty2(value.slice(estree.end, value.length - suffix.length))) { + estree = { + type: "Program", + start: 0, + end: prefix.length + source.length, + body: [ + { + type: "ExpressionStatement", + expression: estree, + start: 0, + end: prefix.length + source.length + } + ], + sourceType: "module", + comments: [] + }; + } else { + const point2 = parseOffsetToUnistPoint(estree.end); + exception = new Error("Unexpected content after expression"); + exception.pos = point2.offset; + exception.loc = { + line: point2.line, + column: point2.column - 1 + }; + estree = void 0; + } + } + if (estree) { + estree.comments = comments; + visit(estree, (esnode, field, index3, parents) => { + let context = parents[parents.length - 1]; + let prop = field; + if (esnode.type === "ParenthesizedExpression" && context && prop) { + if (typeof index3 === "number") { + context = context[prop]; + prop = index3; + } + context[prop] = esnode.expression; + } + fixPosition(esnode); + }); + if (Array.isArray(onComment)) { + onComment.push(...comments); + } else if (typeof onComment === "function") { + for (const comment of comments) { + onComment( + comment.type === "Block", + comment.value, + comment.start, + comment.end, + comment.loc.start, + comment.loc.end + ); + } + } + for (const token of tokens) { + fixPosition(token); + if (Array.isArray(onToken)) { + onToken.push(token); + } else { + onToken(token); + } + } + } + return { + estree, + error: exception, + swallow + }; + function fixPosition(nodeOrToken) { + const pointStart = parseOffsetToUnistPoint(nodeOrToken.start); + const pointEnd = parseOffsetToUnistPoint(nodeOrToken.end); + nodeOrToken.start = pointStart.offset; + nodeOrToken.end = pointEnd.offset; + nodeOrToken.loc = { + start: { + line: pointStart.line, + column: pointStart.column - 1, + offset: pointStart.offset + }, + end: { + line: pointEnd.line, + column: pointEnd.column - 1, + offset: pointEnd.offset + } + }; + nodeOrToken.range = [nodeOrToken.start, nodeOrToken.end]; + } + function parseOffsetToUnistPoint(acornOffset) { + let sourceOffset = acornOffset - prefix.length; + if (sourceOffset < 0) { + sourceOffset = 0; + } else if (sourceOffset > source.length) { + sourceOffset = source.length; + } + const pointInSource = place.toPoint(sourceOffset); + const line = startLine + (pointInSource.line - 1); + const column = lines[line].column + (pointInSource.column - 1); + const offset2 = lines[line].offset + (pointInSource.column - 1); + return { + line, + column, + offset: offset2 + }; + } + function setPoint(point2) { + if (!startLine || point2.line < startLine) { + startLine = point2.line; + } + if (!(point2.line in lines) || lines[point2.line].offset > point2.offset) { + lines[point2.line] = point2; + } + } +} +function empty2(value) { + return /^\s*$/.test( + value.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g, "") + ); +} + +// node_modules/micromark-factory-mdx-expression/index.js +function factoryMdxExpression(effects, ok, type, markerType, chunkType, acorn, acornOptions, addResult, spread, allowEmpty, allowLazy, startColumn) { + const self2 = this; + const eventStart = this.events.length + 3; + const tail = this.events[this.events.length - 1]; + const initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; + const prefixExpressionIndent = initialPrefix ? initialPrefix + 1 : 0; + let balance = 1; + let startPosition; + let lastCrash; + return start3; + function start3(code) { + effects.enter(type); + effects.enter(markerType); + effects.consume(code); + effects.exit(markerType); + startPosition = self2.now(); + return atBreak; + } + function atBreak(code) { + if (code === null) { + throw lastCrash || new VFileMessage( + "Unexpected end of file in expression, expected a corresponding closing brace for `{`", + self2.now(), + "micromark-extension-mdx-expression:unexpected-eof" + ); + } + if (code === 125) { + return atClosingBrace(code); + } + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + const prefixTagIndent = startColumn ? startColumn + 4 - self2.now().column : 0; + const indent = Math.max(prefixExpressionIndent, prefixTagIndent); + return indent ? factorySpace(effects, atBreak, "linePrefix", indent) : atBreak; + } + const now = self2.now(); + if (now.line !== startPosition.line && !allowLazy && self2.parser.lazy[now.line]) { + throw new VFileMessage( + "Unexpected end of file in expression, expected a corresponding closing brace for `{`", + self2.now(), + "micromark-extension-mdx-expression:unexpected-eof" + ); + } + effects.enter(chunkType); + return inside(code); + } + function inside(code) { + if (code === null || code === 125 || markdownLineEnding(code)) { + effects.exit(chunkType); + return atBreak(code); + } + if (code === 123 && !acorn) { + effects.consume(code); + balance++; + return inside; + } + effects.consume(code); + return inside; + } + function atClosingBrace(code) { + balance--; + if (!acorn) { + if (balance) { + effects.enter(chunkType); + effects.consume(code); + return inside; + } + effects.enter(markerType); + effects.consume(code); + effects.exit(markerType); + effects.exit(type); + return ok; + } + const result = eventsToAcorn(self2.events.slice(eventStart), { + acorn, + acornOptions, + start: startPosition, + expression: true, + allowEmpty, + prefix: spread ? "({" : "", + suffix: spread ? "})" : "" + }); + const estree = result.estree; + if (spread && estree) { + const head = estree.body[0]; + if (head.type !== "ExpressionStatement" || head.expression.type !== "ObjectExpression") { + throw new VFileMessage( + "Unexpected `" + head.type + "` in code: expected an object spread (`{...spread}`)", + positionFromEstree(head).start, + "micromark-extension-mdx-expression:non-spread" + ); + } else if (head.expression.properties[1]) { + throw new VFileMessage( + "Unexpected extra content in spread: only a single spread is supported", + positionFromEstree(head.expression.properties[1]).start, + "micromark-extension-mdx-expression:spread-extra" + ); + } else if (head.expression.properties[0] && head.expression.properties[0].type !== "SpreadElement") { + throw new VFileMessage( + "Unexpected `" + head.expression.properties[0].type + "` in code: only spread elements are supported", + positionFromEstree(head.expression.properties[0]).start, + "micromark-extension-mdx-expression:non-spread" + ); + } + } + if (result.error) { + lastCrash = new VFileMessage( + "Could not parse expression with acorn: " + result.error.message, + { + line: result.error.loc.line, + column: result.error.loc.column + 1, + offset: result.error.pos + }, + "micromark-extension-mdx-expression:acorn" + ); + if (code !== null && result.swallow) { + effects.enter(chunkType); + effects.consume(code); + return inside; + } + throw lastCrash; + } + effects.enter(markerType); + effects.consume(code); + effects.exit(markerType); + Object.assign( + effects.exit(type), + addResult ? { + estree + } : void 0 + ); + return ok; + } +} + +// node_modules/micromark-extension-mdx-expression/lib/syntax.js +function mdxExpression(options = {}) { + const addResult = options.addResult; + const acorn = options.acorn; + const spread = options.spread; + let allowEmpty = options.allowEmpty; + let acornOptions; + if (allowEmpty === null || allowEmpty === void 0) { + allowEmpty = true; + } + if (acorn) { + if (!acorn.parseExpressionAt) { + throw new Error( + "Expected a proper `acorn` instance passed in as `options.acorn`" + ); + } + acornOptions = Object.assign( + { + ecmaVersion: 2020, + sourceType: "module" + }, + options.acornOptions + ); + } else if (options.acornOptions || options.addResult) { + throw new Error("Expected an `acorn` instance passed in as `options.acorn`"); + } + return { + flow: { + [123]: { + tokenize: tokenizeFlowExpression, + concrete: true + } + }, + text: { + [123]: { + tokenize: tokenizeTextExpression + } + } + }; + function tokenizeFlowExpression(effects, ok, nok) { + const self2 = this; + return start3; + function start3(code) { + return factoryMdxExpression.call( + self2, + effects, + factorySpace(effects, after, "whitespace"), + "mdxFlowExpression", + "mdxFlowExpressionMarker", + "mdxFlowExpressionChunk", + acorn, + acornOptions, + addResult, + spread, + allowEmpty + )(code); + } + function after(code) { + return code === null || markdownLineEnding(code) ? ok(code) : nok(code); + } + } + function tokenizeTextExpression(effects, ok) { + const self2 = this; + return start3; + function start3(code) { + return factoryMdxExpression.call( + self2, + effects, + ok, + "mdxTextExpression", + "mdxTextExpressionMarker", + "mdxTextExpressionChunk", + acorn, + acornOptions, + addResult, + spread, + allowEmpty, + true + )(code); + } + } +} + +// node_modules/estree-util-is-identifier-name/regex.js +var start = /[$A-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/; +var cont = /[\d\u00B7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF\u1AC0\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F]/; + +// node_modules/estree-util-is-identifier-name/index.js +function start2(code) { + return start.test(String.fromCharCode(code)); +} +function cont2(code) { + const character = String.fromCharCode(code); + return start.test(character) || cont.test(character); +} + +// node_modules/micromark-extension-mdx-jsx/lib/factory-tag.js +var lazyLineEnd = { + tokenize: tokenizeLazyLineEnd, + partial: true +}; +function factoryTag(effects, ok, nok, acorn, acornOptions, addResult, allowLazy, tagType, tagMarkerType, tagClosingMarkerType, tagSelfClosingMarker, tagNameType, tagNamePrimaryType, tagNameMemberMarkerType, tagNameMemberType, tagNamePrefixMarkerType, tagNameLocalType, tagExpressionAttributeType, tagExpressionAttributeMarkerType, tagExpressionAttributeValueType, tagAttributeType, tagAttributeNameType, tagAttributeNamePrimaryType, tagAttributeNamePrefixMarkerType, tagAttributeNameLocalType, tagAttributeInitializerMarkerType, tagAttributeValueLiteralType, tagAttributeValueLiteralMarkerType, tagAttributeValueLiteralValueType, tagAttributeValueExpressionType, tagAttributeValueExpressionMarkerType, tagAttributeValueExpressionValueType) { + const self2 = this; + let returnState; + let marker; + let startPoint; + return start3; + function start3(code) { + startPoint = self2.now(); + effects.enter(tagType); + effects.enter(tagMarkerType); + effects.consume(code); + effects.exit(tagMarkerType); + return afterStart; + } + function afterStart(code) { + if (markdownLineEnding(code) || markdownSpace(code)) { + return nok(code); + } + returnState = beforeName; + return optionalEsWhitespace(code); + } + function beforeName(code) { + if (code === 47) { + effects.enter(tagClosingMarkerType); + effects.consume(code); + effects.exit(tagClosingMarkerType); + returnState = beforeClosingTagName; + return optionalEsWhitespace; + } + if (code === 62) { + return tagEnd(code); + } + if (code !== null && start2(code)) { + effects.enter(tagNameType); + effects.enter(tagNamePrimaryType); + effects.consume(code); + return primaryName; + } + crash( + code, + "before name", + "a character that can start a name, such as a letter, `$`, or `_`" + (code === 33 ? " (note: to create a comment in MDX, use `{/* text */}`)" : "") + ); + } + function beforeClosingTagName(code) { + if (code === 62) { + return tagEnd(code); + } + if (code !== null && start2(code)) { + effects.enter(tagNameType); + effects.enter(tagNamePrimaryType); + effects.consume(code); + return primaryName; + } + crash( + code, + "before name", + "a character that can start a name, such as a letter, `$`, or `_`" + (code === 42 || code === 47 ? " (note: JS comments in JSX tags are not supported in MDX)" : "") + ); + } + function primaryName(code) { + if (code === 45 || code !== null && cont2(code)) { + effects.consume(code); + return primaryName; + } + if (code === 46 || code === 47 || code === 58 || code === 62 || code === 123 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) { + effects.exit(tagNamePrimaryType); + returnState = afterPrimaryName; + return optionalEsWhitespace(code); + } + crash( + code, + "in name", + "a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag" + (code === 64 ? " (note: to create a link in MDX, use `[text](url)`)" : "") + ); + } + function afterPrimaryName(code) { + if (code === 46) { + effects.enter(tagNameMemberMarkerType); + effects.consume(code); + effects.exit(tagNameMemberMarkerType); + returnState = beforeMemberName; + return optionalEsWhitespace; + } + if (code === 58) { + effects.enter(tagNamePrefixMarkerType); + effects.consume(code); + effects.exit(tagNamePrefixMarkerType); + returnState = beforeLocalName; + return optionalEsWhitespace; + } + if (code === 47 || code === 62 || code === 123 || code !== null && start2(code)) { + effects.exit(tagNameType); + return beforeAttribute(code); + } + crash( + code, + "after name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function beforeMemberName(code) { + if (code !== null && start2(code)) { + effects.enter(tagNameMemberType); + effects.consume(code); + return memberName; + } + crash( + code, + "before member name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function memberName(code) { + if (code === 45 || code !== null && cont2(code)) { + effects.consume(code); + return memberName; + } + if (code === 46 || code === 47 || code === 62 || code === 123 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) { + effects.exit(tagNameMemberType); + returnState = afterMemberName; + return optionalEsWhitespace(code); + } + crash( + code, + "in member name", + "a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag" + (code === 64 ? " (note: to create a link in MDX, use `[text](url)`)" : "") + ); + } + function afterMemberName(code) { + if (code === 46) { + effects.enter(tagNameMemberMarkerType); + effects.consume(code); + effects.exit(tagNameMemberMarkerType); + returnState = beforeMemberName; + return optionalEsWhitespace; + } + if (code === 47 || code === 62 || code === 123 || code !== null && start2(code)) { + effects.exit(tagNameType); + return beforeAttribute(code); + } + crash( + code, + "after member name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function beforeLocalName(code) { + if (code !== null && start2(code)) { + effects.enter(tagNameLocalType); + effects.consume(code); + return localName; + } + crash( + code, + "before local name", + "a character that can start a name, such as a letter, `$`, or `_`" + (code === 43 || code !== null && code > 46 && code < 58 ? " (note: to create a link in MDX, use `[text](url)`)" : "") + ); + } + function localName(code) { + if (code === 45 || code !== null && cont2(code)) { + effects.consume(code); + return localName; + } + if (code === 47 || code === 62 || code === 123 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) { + effects.exit(tagNameLocalType); + returnState = afterLocalName; + return optionalEsWhitespace(code); + } + crash( + code, + "in local name", + "a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function afterLocalName(code) { + if (code === 47 || code === 62 || code === 123 || code !== null && start2(code)) { + effects.exit(tagNameType); + return beforeAttribute(code); + } + crash( + code, + "after local name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function beforeAttribute(code) { + if (code === 47) { + effects.enter(tagSelfClosingMarker); + effects.consume(code); + effects.exit(tagSelfClosingMarker); + returnState = selfClosing; + return optionalEsWhitespace; + } + if (code === 62) { + return tagEnd(code); + } + if (code === 123) { + return factoryMdxExpression.call( + self2, + effects, + afterAttributeExpression, + tagExpressionAttributeType, + tagExpressionAttributeMarkerType, + tagExpressionAttributeValueType, + acorn, + acornOptions, + addResult, + true, + false, + allowLazy, + startPoint.column + )(code); + } + if (code !== null && start2(code)) { + effects.enter(tagAttributeType); + effects.enter(tagAttributeNameType); + effects.enter(tagAttributeNamePrimaryType); + effects.consume(code); + return attributePrimaryName; + } + crash( + code, + "before attribute name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function afterAttributeExpression(code) { + returnState = beforeAttribute; + return optionalEsWhitespace(code); + } + function attributePrimaryName(code) { + if (code === 45 || code !== null && cont2(code)) { + effects.consume(code); + return attributePrimaryName; + } + if (code === 47 || code === 58 || code === 61 || code === 62 || code === 123 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) { + effects.exit(tagAttributeNamePrimaryType); + returnState = afterAttributePrimaryName; + return optionalEsWhitespace(code); + } + crash( + code, + "in attribute name", + "an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag" + ); + } + function afterAttributePrimaryName(code) { + if (code === 58) { + effects.enter(tagAttributeNamePrefixMarkerType); + effects.consume(code); + effects.exit(tagAttributeNamePrefixMarkerType); + returnState = beforeAttributeLocalName; + return optionalEsWhitespace; + } + if (code === 61) { + effects.exit(tagAttributeNameType); + effects.enter(tagAttributeInitializerMarkerType); + effects.consume(code); + effects.exit(tagAttributeInitializerMarkerType); + returnState = beforeAttributeValue; + return optionalEsWhitespace; + } + if (code === 47 || code === 62 || code === 123 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || code !== null && start2(code)) { + effects.exit(tagAttributeNameType); + effects.exit(tagAttributeType); + returnState = beforeAttribute; + return optionalEsWhitespace(code); + } + crash( + code, + "after attribute name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag" + ); + } + function beforeAttributeLocalName(code) { + if (code !== null && start2(code)) { + effects.enter(tagAttributeNameLocalType); + effects.consume(code); + return attributeLocalName; + } + crash( + code, + "before local attribute name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag" + ); + } + function attributeLocalName(code) { + if (code === 45 || code !== null && cont2(code)) { + effects.consume(code); + return attributeLocalName; + } + if (code === 47 || code === 61 || code === 62 || code === 123 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) { + effects.exit(tagAttributeNameLocalType); + effects.exit(tagAttributeNameType); + returnState = afterAttributeLocalName; + return optionalEsWhitespace(code); + } + crash( + code, + "in local attribute name", + "an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag" + ); + } + function afterAttributeLocalName(code) { + if (code === 61) { + effects.enter(tagAttributeInitializerMarkerType); + effects.consume(code); + effects.exit(tagAttributeInitializerMarkerType); + returnState = beforeAttributeValue; + return optionalEsWhitespace; + } + if (code === 47 || code === 62 || code === 123 || code !== null && start2(code)) { + effects.exit(tagAttributeType); + return beforeAttribute(code); + } + crash( + code, + "after local attribute name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag" + ); + } + function beforeAttributeValue(code) { + if (code === 34 || code === 39) { + effects.enter(tagAttributeValueLiteralType); + effects.enter(tagAttributeValueLiteralMarkerType); + effects.consume(code); + effects.exit(tagAttributeValueLiteralMarkerType); + marker = code; + return attributeValueQuotedStart; + } + if (code === 123) { + return factoryMdxExpression.call( + self2, + effects, + afterAttributeValueExpression, + tagAttributeValueExpressionType, + tagAttributeValueExpressionMarkerType, + tagAttributeValueExpressionValueType, + acorn, + acornOptions, + addResult, + false, + false, + allowLazy, + startPoint.column + )(code); + } + crash( + code, + "before attribute value", + "a character that can start an attribute value, such as `\"`, `'`, or `{`" + (code === 60 ? " (note: to use an element or fragment as a prop value in MDX, use `{}`)" : "") + ); + } + function afterAttributeValueExpression(code) { + effects.exit(tagAttributeType); + returnState = beforeAttribute; + return optionalEsWhitespace(code); + } + function attributeValueQuotedStart(code) { + if (code === null) { + crash( + code, + "in attribute value", + "a corresponding closing quote `" + String.fromCharCode(marker) + "`" + ); + } + if (code === marker) { + effects.enter(tagAttributeValueLiteralMarkerType); + effects.consume(code); + effects.exit(tagAttributeValueLiteralMarkerType); + effects.exit(tagAttributeValueLiteralType); + effects.exit(tagAttributeType); + marker = void 0; + returnState = beforeAttribute; + return optionalEsWhitespace; + } + if (markdownLineEnding(code)) { + returnState = attributeValueQuotedStart; + return optionalEsWhitespace(code); + } + effects.enter(tagAttributeValueLiteralValueType); + return attributeValueQuoted(code); + } + function attributeValueQuoted(code) { + if (code === null || code === marker || markdownLineEnding(code)) { + effects.exit(tagAttributeValueLiteralValueType); + return attributeValueQuotedStart(code); + } + effects.consume(code); + return attributeValueQuoted; + } + function selfClosing(code) { + if (code === 62) { + return tagEnd(code); + } + crash( + code, + "after self-closing slash", + "`>` to end the tag" + (code === 42 || code === 47 ? " (note: JS comments in JSX tags are not supported in MDX)" : "") + ); + } + function tagEnd(code) { + effects.enter(tagMarkerType); + effects.consume(code); + effects.exit(tagMarkerType); + effects.exit(tagType); + return ok; + } + function optionalEsWhitespace(code) { + if (markdownLineEnding(code)) { + if (allowLazy) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return factorySpace(effects, optionalEsWhitespace, "linePrefix", 4); + } + return effects.attempt( + lazyLineEnd, + factorySpace(effects, optionalEsWhitespace, "linePrefix", 4), + crashEol + )(code); + } + if (markdownSpace(code) || unicodeWhitespace(code)) { + effects.enter("esWhitespace"); + return optionalEsWhitespaceContinue(code); + } + return returnState(code); + } + function optionalEsWhitespaceContinue(code) { + if (markdownLineEnding(code) || !(markdownSpace(code) || unicodeWhitespace(code))) { + effects.exit("esWhitespace"); + return optionalEsWhitespace(code); + } + effects.consume(code); + return optionalEsWhitespaceContinue; + } + function crashEol() { + throw new VFileMessage( + "Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", + self2.now(), + "micromark-extension-mdx-jsx:unexpected-eof" + ); + } + function crash(code, at2, expect) { + throw new VFileMessage( + "Unexpected " + (code === null ? "end of file" : "character `" + (code === 96 ? "` ` `" : String.fromCharCode(code)) + "` (" + serializeCharCode(code) + ")") + " " + at2 + ", expected " + expect, + self2.now(), + "micromark-extension-mdx-jsx:unexpected-" + (code === null ? "eof" : "character") + ); + } +} +function tokenizeLazyLineEnd(effects, ok, nok) { + const self2 = this; + return start3; + function start3(code) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return lineStart; + } + function lineStart(code) { + return self2.parser.lazy[self2.now().line] ? nok(code) : ok(code); + } +} +function serializeCharCode(code) { + return "U+" + code.toString(16).toUpperCase().padStart(4, "0"); +} + +// node_modules/micromark-extension-mdx-jsx/lib/jsx-text.js +function jsxText(acorn, acornOptions, addResult) { + return { + tokenize: tokenizeJsxText + }; + function tokenizeJsxText(effects, ok, nok) { + return factoryTag.call( + this, + effects, + ok, + nok, + acorn, + acornOptions, + addResult, + true, + "mdxJsxTextTag", + "mdxJsxTextTagMarker", + "mdxJsxTextTagClosingMarker", + "mdxJsxTextTagSelfClosingMarker", + "mdxJsxTextTagName", + "mdxJsxTextTagNamePrimary", + "mdxJsxTextTagNameMemberMarker", + "mdxJsxTextTagNameMember", + "mdxJsxTextTagNamePrefixMarker", + "mdxJsxTextTagNameLocal", + "mdxJsxTextTagExpressionAttribute", + "mdxJsxTextTagExpressionAttributeMarker", + "mdxJsxTextTagExpressionAttributeValue", + "mdxJsxTextTagAttribute", + "mdxJsxTextTagAttributeName", + "mdxJsxTextTagAttributeNamePrimary", + "mdxJsxTextTagAttributeNamePrefixMarker", + "mdxJsxTextTagAttributeNameLocal", + "mdxJsxTextTagAttributeInitializerMarker", + "mdxJsxTextTagAttributeValueLiteral", + "mdxJsxTextTagAttributeValueLiteralMarker", + "mdxJsxTextTagAttributeValueLiteralValue", + "mdxJsxTextTagAttributeValueExpression", + "mdxJsxTextTagAttributeValueExpressionMarker", + "mdxJsxTextTagAttributeValueExpressionValue" + ); + } +} + +// node_modules/micromark-extension-mdx-jsx/lib/jsx-flow.js +function jsxFlow(acorn, acornOptions, addResult) { + return { + tokenize: tokenizeJsxFlow, + concrete: true + }; + function tokenizeJsxFlow(effects, ok, nok) { + const self2 = this; + return start3; + function start3(code) { + return factoryTag.call( + self2, + effects, + factorySpace(effects, after, "whitespace"), + nok, + acorn, + acornOptions, + addResult, + false, + "mdxJsxFlowTag", + "mdxJsxFlowTagMarker", + "mdxJsxFlowTagClosingMarker", + "mdxJsxFlowTagSelfClosingMarker", + "mdxJsxFlowTagName", + "mdxJsxFlowTagNamePrimary", + "mdxJsxFlowTagNameMemberMarker", + "mdxJsxFlowTagNameMember", + "mdxJsxFlowTagNamePrefixMarker", + "mdxJsxFlowTagNameLocal", + "mdxJsxFlowTagExpressionAttribute", + "mdxJsxFlowTagExpressionAttributeMarker", + "mdxJsxFlowTagExpressionAttributeValue", + "mdxJsxFlowTagAttribute", + "mdxJsxFlowTagAttributeName", + "mdxJsxFlowTagAttributeNamePrimary", + "mdxJsxFlowTagAttributeNamePrefixMarker", + "mdxJsxFlowTagAttributeNameLocal", + "mdxJsxFlowTagAttributeInitializerMarker", + "mdxJsxFlowTagAttributeValueLiteral", + "mdxJsxFlowTagAttributeValueLiteralMarker", + "mdxJsxFlowTagAttributeValueLiteralValue", + "mdxJsxFlowTagAttributeValueExpression", + "mdxJsxFlowTagAttributeValueExpressionMarker", + "mdxJsxFlowTagAttributeValueExpressionValue" + )(code); + } + function after(code) { + return code === 60 ? start3(code) : code === null || markdownLineEnding(code) ? ok(code) : nok(code); + } + } +} + +// node_modules/micromark-extension-mdx-jsx/lib/syntax.js +function mdxJsx(options = {}) { + const acorn = options.acorn; + let acornOptions; + if (acorn) { + if (!acorn.parse || !acorn.parseExpressionAt) { + throw new Error( + "Expected a proper `acorn` instance passed in as `options.acorn`" + ); + } + acornOptions = Object.assign( + { + ecmaVersion: 2020, + sourceType: "module" + }, + options.acornOptions, + { + locations: true + } + ); + } else if (options.acornOptions || options.addResult) { + throw new Error("Expected an `acorn` instance passed in as `options.acorn`"); + } + return { + flow: { + [60]: jsxFlow(acorn, acornOptions, options.addResult) + }, + text: { + [60]: jsxText(acorn, acornOptions, options.addResult) + } + }; +} + +// node_modules/micromark-extension-mdx-md/index.js +var mdxMd = { + disable: { null: ["autolink", "codeIndented", "htmlFlow", "htmlText"] } +}; + +// node_modules/micromark-core-commonmark/lib/blank-line.js +var blankLine = { + tokenize: tokenizeBlankLine, + partial: true +}; +function tokenizeBlankLine(effects, ok, nok) { + return factorySpace(effects, afterWhitespace, "linePrefix"); + function afterWhitespace(code) { + return code === null || markdownLineEnding(code) ? ok(code) : nok(code); + } +} + +// node_modules/character-entities/index.js +var characterEntities = { + AElig: "\xC6", + AMP: "&", + Aacute: "\xC1", + Abreve: "\u0102", + Acirc: "\xC2", + Acy: "\u0410", + Afr: "\u{1D504}", + Agrave: "\xC0", + Alpha: "\u0391", + Amacr: "\u0100", + And: "\u2A53", + Aogon: "\u0104", + Aopf: "\u{1D538}", + ApplyFunction: "\u2061", + Aring: "\xC5", + Ascr: "\u{1D49C}", + Assign: "\u2254", + Atilde: "\xC3", + Auml: "\xC4", + Backslash: "\u2216", + Barv: "\u2AE7", + Barwed: "\u2306", + Bcy: "\u0411", + Because: "\u2235", + Bernoullis: "\u212C", + Beta: "\u0392", + Bfr: "\u{1D505}", + Bopf: "\u{1D539}", + Breve: "\u02D8", + Bscr: "\u212C", + Bumpeq: "\u224E", + CHcy: "\u0427", + COPY: "\xA9", + Cacute: "\u0106", + Cap: "\u22D2", + CapitalDifferentialD: "\u2145", + Cayleys: "\u212D", + Ccaron: "\u010C", + Ccedil: "\xC7", + Ccirc: "\u0108", + Cconint: "\u2230", + Cdot: "\u010A", + Cedilla: "\xB8", + CenterDot: "\xB7", + Cfr: "\u212D", + Chi: "\u03A7", + CircleDot: "\u2299", + CircleMinus: "\u2296", + CirclePlus: "\u2295", + CircleTimes: "\u2297", + ClockwiseContourIntegral: "\u2232", + CloseCurlyDoubleQuote: "\u201D", + CloseCurlyQuote: "\u2019", + Colon: "\u2237", + Colone: "\u2A74", + Congruent: "\u2261", + Conint: "\u222F", + ContourIntegral: "\u222E", + Copf: "\u2102", + Coproduct: "\u2210", + CounterClockwiseContourIntegral: "\u2233", + Cross: "\u2A2F", + Cscr: "\u{1D49E}", + Cup: "\u22D3", + CupCap: "\u224D", + DD: "\u2145", + DDotrahd: "\u2911", + DJcy: "\u0402", + DScy: "\u0405", + DZcy: "\u040F", + Dagger: "\u2021", + Darr: "\u21A1", + Dashv: "\u2AE4", + Dcaron: "\u010E", + Dcy: "\u0414", + Del: "\u2207", + Delta: "\u0394", + Dfr: "\u{1D507}", + DiacriticalAcute: "\xB4", + DiacriticalDot: "\u02D9", + DiacriticalDoubleAcute: "\u02DD", + DiacriticalGrave: "`", + DiacriticalTilde: "\u02DC", + Diamond: "\u22C4", + DifferentialD: "\u2146", + Dopf: "\u{1D53B}", + Dot: "\xA8", + DotDot: "\u20DC", + DotEqual: "\u2250", + DoubleContourIntegral: "\u222F", + DoubleDot: "\xA8", + DoubleDownArrow: "\u21D3", + DoubleLeftArrow: "\u21D0", + DoubleLeftRightArrow: "\u21D4", + DoubleLeftTee: "\u2AE4", + DoubleLongLeftArrow: "\u27F8", + DoubleLongLeftRightArrow: "\u27FA", + DoubleLongRightArrow: "\u27F9", + DoubleRightArrow: "\u21D2", + DoubleRightTee: "\u22A8", + DoubleUpArrow: "\u21D1", + DoubleUpDownArrow: "\u21D5", + DoubleVerticalBar: "\u2225", + DownArrow: "\u2193", + DownArrowBar: "\u2913", + DownArrowUpArrow: "\u21F5", + DownBreve: "\u0311", + DownLeftRightVector: "\u2950", + DownLeftTeeVector: "\u295E", + DownLeftVector: "\u21BD", + DownLeftVectorBar: "\u2956", + DownRightTeeVector: "\u295F", + DownRightVector: "\u21C1", + DownRightVectorBar: "\u2957", + DownTee: "\u22A4", + DownTeeArrow: "\u21A7", + Downarrow: "\u21D3", + Dscr: "\u{1D49F}", + Dstrok: "\u0110", + ENG: "\u014A", + ETH: "\xD0", + Eacute: "\xC9", + Ecaron: "\u011A", + Ecirc: "\xCA", + Ecy: "\u042D", + Edot: "\u0116", + Efr: "\u{1D508}", + Egrave: "\xC8", + Element: "\u2208", + Emacr: "\u0112", + EmptySmallSquare: "\u25FB", + EmptyVerySmallSquare: "\u25AB", + Eogon: "\u0118", + Eopf: "\u{1D53C}", + Epsilon: "\u0395", + Equal: "\u2A75", + EqualTilde: "\u2242", + Equilibrium: "\u21CC", + Escr: "\u2130", + Esim: "\u2A73", + Eta: "\u0397", + Euml: "\xCB", + Exists: "\u2203", + ExponentialE: "\u2147", + Fcy: "\u0424", + Ffr: "\u{1D509}", + FilledSmallSquare: "\u25FC", + FilledVerySmallSquare: "\u25AA", + Fopf: "\u{1D53D}", + ForAll: "\u2200", + Fouriertrf: "\u2131", + Fscr: "\u2131", + GJcy: "\u0403", + GT: ">", + Gamma: "\u0393", + Gammad: "\u03DC", + Gbreve: "\u011E", + Gcedil: "\u0122", + Gcirc: "\u011C", + Gcy: "\u0413", + Gdot: "\u0120", + Gfr: "\u{1D50A}", + Gg: "\u22D9", + Gopf: "\u{1D53E}", + GreaterEqual: "\u2265", + GreaterEqualLess: "\u22DB", + GreaterFullEqual: "\u2267", + GreaterGreater: "\u2AA2", + GreaterLess: "\u2277", + GreaterSlantEqual: "\u2A7E", + GreaterTilde: "\u2273", + Gscr: "\u{1D4A2}", + Gt: "\u226B", + HARDcy: "\u042A", + Hacek: "\u02C7", + Hat: "^", + Hcirc: "\u0124", + Hfr: "\u210C", + HilbertSpace: "\u210B", + Hopf: "\u210D", + HorizontalLine: "\u2500", + Hscr: "\u210B", + Hstrok: "\u0126", + HumpDownHump: "\u224E", + HumpEqual: "\u224F", + IEcy: "\u0415", + IJlig: "\u0132", + IOcy: "\u0401", + Iacute: "\xCD", + Icirc: "\xCE", + Icy: "\u0418", + Idot: "\u0130", + Ifr: "\u2111", + Igrave: "\xCC", + Im: "\u2111", + Imacr: "\u012A", + ImaginaryI: "\u2148", + Implies: "\u21D2", + Int: "\u222C", + Integral: "\u222B", + Intersection: "\u22C2", + InvisibleComma: "\u2063", + InvisibleTimes: "\u2062", + Iogon: "\u012E", + Iopf: "\u{1D540}", + Iota: "\u0399", + Iscr: "\u2110", + Itilde: "\u0128", + Iukcy: "\u0406", + Iuml: "\xCF", + Jcirc: "\u0134", + Jcy: "\u0419", + Jfr: "\u{1D50D}", + Jopf: "\u{1D541}", + Jscr: "\u{1D4A5}", + Jsercy: "\u0408", + Jukcy: "\u0404", + KHcy: "\u0425", + KJcy: "\u040C", + Kappa: "\u039A", + Kcedil: "\u0136", + Kcy: "\u041A", + Kfr: "\u{1D50E}", + Kopf: "\u{1D542}", + Kscr: "\u{1D4A6}", + LJcy: "\u0409", + LT: "<", + Lacute: "\u0139", + Lambda: "\u039B", + Lang: "\u27EA", + Laplacetrf: "\u2112", + Larr: "\u219E", + Lcaron: "\u013D", + Lcedil: "\u013B", + Lcy: "\u041B", + LeftAngleBracket: "\u27E8", + LeftArrow: "\u2190", + LeftArrowBar: "\u21E4", + LeftArrowRightArrow: "\u21C6", + LeftCeiling: "\u2308", + LeftDoubleBracket: "\u27E6", + LeftDownTeeVector: "\u2961", + LeftDownVector: "\u21C3", + LeftDownVectorBar: "\u2959", + LeftFloor: "\u230A", + LeftRightArrow: "\u2194", + LeftRightVector: "\u294E", + LeftTee: "\u22A3", + LeftTeeArrow: "\u21A4", + LeftTeeVector: "\u295A", + LeftTriangle: "\u22B2", + LeftTriangleBar: "\u29CF", + LeftTriangleEqual: "\u22B4", + LeftUpDownVector: "\u2951", + LeftUpTeeVector: "\u2960", + LeftUpVector: "\u21BF", + LeftUpVectorBar: "\u2958", + LeftVector: "\u21BC", + LeftVectorBar: "\u2952", + Leftarrow: "\u21D0", + Leftrightarrow: "\u21D4", + LessEqualGreater: "\u22DA", + LessFullEqual: "\u2266", + LessGreater: "\u2276", + LessLess: "\u2AA1", + LessSlantEqual: "\u2A7D", + LessTilde: "\u2272", + Lfr: "\u{1D50F}", + Ll: "\u22D8", + Lleftarrow: "\u21DA", + Lmidot: "\u013F", + LongLeftArrow: "\u27F5", + LongLeftRightArrow: "\u27F7", + LongRightArrow: "\u27F6", + Longleftarrow: "\u27F8", + Longleftrightarrow: "\u27FA", + Longrightarrow: "\u27F9", + Lopf: "\u{1D543}", + LowerLeftArrow: "\u2199", + LowerRightArrow: "\u2198", + Lscr: "\u2112", + Lsh: "\u21B0", + Lstrok: "\u0141", + Lt: "\u226A", + Map: "\u2905", + Mcy: "\u041C", + MediumSpace: "\u205F", + Mellintrf: "\u2133", + Mfr: "\u{1D510}", + MinusPlus: "\u2213", + Mopf: "\u{1D544}", + Mscr: "\u2133", + Mu: "\u039C", + NJcy: "\u040A", + Nacute: "\u0143", + Ncaron: "\u0147", + Ncedil: "\u0145", + Ncy: "\u041D", + NegativeMediumSpace: "\u200B", + NegativeThickSpace: "\u200B", + NegativeThinSpace: "\u200B", + NegativeVeryThinSpace: "\u200B", + NestedGreaterGreater: "\u226B", + NestedLessLess: "\u226A", + NewLine: "\n", + Nfr: "\u{1D511}", + NoBreak: "\u2060", + NonBreakingSpace: "\xA0", + Nopf: "\u2115", + Not: "\u2AEC", + NotCongruent: "\u2262", + NotCupCap: "\u226D", + NotDoubleVerticalBar: "\u2226", + NotElement: "\u2209", + NotEqual: "\u2260", + NotEqualTilde: "\u2242\u0338", + NotExists: "\u2204", + NotGreater: "\u226F", + NotGreaterEqual: "\u2271", + NotGreaterFullEqual: "\u2267\u0338", + NotGreaterGreater: "\u226B\u0338", + NotGreaterLess: "\u2279", + NotGreaterSlantEqual: "\u2A7E\u0338", + NotGreaterTilde: "\u2275", + NotHumpDownHump: "\u224E\u0338", + NotHumpEqual: "\u224F\u0338", + NotLeftTriangle: "\u22EA", + NotLeftTriangleBar: "\u29CF\u0338", + NotLeftTriangleEqual: "\u22EC", + NotLess: "\u226E", + NotLessEqual: "\u2270", + NotLessGreater: "\u2278", + NotLessLess: "\u226A\u0338", + NotLessSlantEqual: "\u2A7D\u0338", + NotLessTilde: "\u2274", + NotNestedGreaterGreater: "\u2AA2\u0338", + NotNestedLessLess: "\u2AA1\u0338", + NotPrecedes: "\u2280", + NotPrecedesEqual: "\u2AAF\u0338", + NotPrecedesSlantEqual: "\u22E0", + NotReverseElement: "\u220C", + NotRightTriangle: "\u22EB", + NotRightTriangleBar: "\u29D0\u0338", + NotRightTriangleEqual: "\u22ED", + NotSquareSubset: "\u228F\u0338", + NotSquareSubsetEqual: "\u22E2", + NotSquareSuperset: "\u2290\u0338", + NotSquareSupersetEqual: "\u22E3", + NotSubset: "\u2282\u20D2", + NotSubsetEqual: "\u2288", + NotSucceeds: "\u2281", + NotSucceedsEqual: "\u2AB0\u0338", + NotSucceedsSlantEqual: "\u22E1", + NotSucceedsTilde: "\u227F\u0338", + NotSuperset: "\u2283\u20D2", + NotSupersetEqual: "\u2289", + NotTilde: "\u2241", + NotTildeEqual: "\u2244", + NotTildeFullEqual: "\u2247", + NotTildeTilde: "\u2249", + NotVerticalBar: "\u2224", + Nscr: "\u{1D4A9}", + Ntilde: "\xD1", + Nu: "\u039D", + OElig: "\u0152", + Oacute: "\xD3", + Ocirc: "\xD4", + Ocy: "\u041E", + Odblac: "\u0150", + Ofr: "\u{1D512}", + Ograve: "\xD2", + Omacr: "\u014C", + Omega: "\u03A9", + Omicron: "\u039F", + Oopf: "\u{1D546}", + OpenCurlyDoubleQuote: "\u201C", + OpenCurlyQuote: "\u2018", + Or: "\u2A54", + Oscr: "\u{1D4AA}", + Oslash: "\xD8", + Otilde: "\xD5", + Otimes: "\u2A37", + Ouml: "\xD6", + OverBar: "\u203E", + OverBrace: "\u23DE", + OverBracket: "\u23B4", + OverParenthesis: "\u23DC", + PartialD: "\u2202", + Pcy: "\u041F", + Pfr: "\u{1D513}", + Phi: "\u03A6", + Pi: "\u03A0", + PlusMinus: "\xB1", + Poincareplane: "\u210C", + Popf: "\u2119", + Pr: "\u2ABB", + Precedes: "\u227A", + PrecedesEqual: "\u2AAF", + PrecedesSlantEqual: "\u227C", + PrecedesTilde: "\u227E", + Prime: "\u2033", + Product: "\u220F", + Proportion: "\u2237", + Proportional: "\u221D", + Pscr: "\u{1D4AB}", + Psi: "\u03A8", + QUOT: '"', + Qfr: "\u{1D514}", + Qopf: "\u211A", + Qscr: "\u{1D4AC}", + RBarr: "\u2910", + REG: "\xAE", + Racute: "\u0154", + Rang: "\u27EB", + Rarr: "\u21A0", + Rarrtl: "\u2916", + Rcaron: "\u0158", + Rcedil: "\u0156", + Rcy: "\u0420", + Re: "\u211C", + ReverseElement: "\u220B", + ReverseEquilibrium: "\u21CB", + ReverseUpEquilibrium: "\u296F", + Rfr: "\u211C", + Rho: "\u03A1", + RightAngleBracket: "\u27E9", + RightArrow: "\u2192", + RightArrowBar: "\u21E5", + RightArrowLeftArrow: "\u21C4", + RightCeiling: "\u2309", + RightDoubleBracket: "\u27E7", + RightDownTeeVector: "\u295D", + RightDownVector: "\u21C2", + RightDownVectorBar: "\u2955", + RightFloor: "\u230B", + RightTee: "\u22A2", + RightTeeArrow: "\u21A6", + RightTeeVector: "\u295B", + RightTriangle: "\u22B3", + RightTriangleBar: "\u29D0", + RightTriangleEqual: "\u22B5", + RightUpDownVector: "\u294F", + RightUpTeeVector: "\u295C", + RightUpVector: "\u21BE", + RightUpVectorBar: "\u2954", + RightVector: "\u21C0", + RightVectorBar: "\u2953", + Rightarrow: "\u21D2", + Ropf: "\u211D", + RoundImplies: "\u2970", + Rrightarrow: "\u21DB", + Rscr: "\u211B", + Rsh: "\u21B1", + RuleDelayed: "\u29F4", + SHCHcy: "\u0429", + SHcy: "\u0428", + SOFTcy: "\u042C", + Sacute: "\u015A", + Sc: "\u2ABC", + Scaron: "\u0160", + Scedil: "\u015E", + Scirc: "\u015C", + Scy: "\u0421", + Sfr: "\u{1D516}", + ShortDownArrow: "\u2193", + ShortLeftArrow: "\u2190", + ShortRightArrow: "\u2192", + ShortUpArrow: "\u2191", + Sigma: "\u03A3", + SmallCircle: "\u2218", + Sopf: "\u{1D54A}", + Sqrt: "\u221A", + Square: "\u25A1", + SquareIntersection: "\u2293", + SquareSubset: "\u228F", + SquareSubsetEqual: "\u2291", + SquareSuperset: "\u2290", + SquareSupersetEqual: "\u2292", + SquareUnion: "\u2294", + Sscr: "\u{1D4AE}", + Star: "\u22C6", + Sub: "\u22D0", + Subset: "\u22D0", + SubsetEqual: "\u2286", + Succeeds: "\u227B", + SucceedsEqual: "\u2AB0", + SucceedsSlantEqual: "\u227D", + SucceedsTilde: "\u227F", + SuchThat: "\u220B", + Sum: "\u2211", + Sup: "\u22D1", + Superset: "\u2283", + SupersetEqual: "\u2287", + Supset: "\u22D1", + THORN: "\xDE", + TRADE: "\u2122", + TSHcy: "\u040B", + TScy: "\u0426", + Tab: " ", + Tau: "\u03A4", + Tcaron: "\u0164", + Tcedil: "\u0162", + Tcy: "\u0422", + Tfr: "\u{1D517}", + Therefore: "\u2234", + Theta: "\u0398", + ThickSpace: "\u205F\u200A", + ThinSpace: "\u2009", + Tilde: "\u223C", + TildeEqual: "\u2243", + TildeFullEqual: "\u2245", + TildeTilde: "\u2248", + Topf: "\u{1D54B}", + TripleDot: "\u20DB", + Tscr: "\u{1D4AF}", + Tstrok: "\u0166", + Uacute: "\xDA", + Uarr: "\u219F", + Uarrocir: "\u2949", + Ubrcy: "\u040E", + Ubreve: "\u016C", + Ucirc: "\xDB", + Ucy: "\u0423", + Udblac: "\u0170", + Ufr: "\u{1D518}", + Ugrave: "\xD9", + Umacr: "\u016A", + UnderBar: "_", + UnderBrace: "\u23DF", + UnderBracket: "\u23B5", + UnderParenthesis: "\u23DD", + Union: "\u22C3", + UnionPlus: "\u228E", + Uogon: "\u0172", + Uopf: "\u{1D54C}", + UpArrow: "\u2191", + UpArrowBar: "\u2912", + UpArrowDownArrow: "\u21C5", + UpDownArrow: "\u2195", + UpEquilibrium: "\u296E", + UpTee: "\u22A5", + UpTeeArrow: "\u21A5", + Uparrow: "\u21D1", + Updownarrow: "\u21D5", + UpperLeftArrow: "\u2196", + UpperRightArrow: "\u2197", + Upsi: "\u03D2", + Upsilon: "\u03A5", + Uring: "\u016E", + Uscr: "\u{1D4B0}", + Utilde: "\u0168", + Uuml: "\xDC", + VDash: "\u22AB", + Vbar: "\u2AEB", + Vcy: "\u0412", + Vdash: "\u22A9", + Vdashl: "\u2AE6", + Vee: "\u22C1", + Verbar: "\u2016", + Vert: "\u2016", + VerticalBar: "\u2223", + VerticalLine: "|", + VerticalSeparator: "\u2758", + VerticalTilde: "\u2240", + VeryThinSpace: "\u200A", + Vfr: "\u{1D519}", + Vopf: "\u{1D54D}", + Vscr: "\u{1D4B1}", + Vvdash: "\u22AA", + Wcirc: "\u0174", + Wedge: "\u22C0", + Wfr: "\u{1D51A}", + Wopf: "\u{1D54E}", + Wscr: "\u{1D4B2}", + Xfr: "\u{1D51B}", + Xi: "\u039E", + Xopf: "\u{1D54F}", + Xscr: "\u{1D4B3}", + YAcy: "\u042F", + YIcy: "\u0407", + YUcy: "\u042E", + Yacute: "\xDD", + Ycirc: "\u0176", + Ycy: "\u042B", + Yfr: "\u{1D51C}", + Yopf: "\u{1D550}", + Yscr: "\u{1D4B4}", + Yuml: "\u0178", + ZHcy: "\u0416", + Zacute: "\u0179", + Zcaron: "\u017D", + Zcy: "\u0417", + Zdot: "\u017B", + ZeroWidthSpace: "\u200B", + Zeta: "\u0396", + Zfr: "\u2128", + Zopf: "\u2124", + Zscr: "\u{1D4B5}", + aacute: "\xE1", + abreve: "\u0103", + ac: "\u223E", + acE: "\u223E\u0333", + acd: "\u223F", + acirc: "\xE2", + acute: "\xB4", + acy: "\u0430", + aelig: "\xE6", + af: "\u2061", + afr: "\u{1D51E}", + agrave: "\xE0", + alefsym: "\u2135", + aleph: "\u2135", + alpha: "\u03B1", + amacr: "\u0101", + amalg: "\u2A3F", + amp: "&", + and: "\u2227", + andand: "\u2A55", + andd: "\u2A5C", + andslope: "\u2A58", + andv: "\u2A5A", + ang: "\u2220", + ange: "\u29A4", + angle: "\u2220", + angmsd: "\u2221", + angmsdaa: "\u29A8", + angmsdab: "\u29A9", + angmsdac: "\u29AA", + angmsdad: "\u29AB", + angmsdae: "\u29AC", + angmsdaf: "\u29AD", + angmsdag: "\u29AE", + angmsdah: "\u29AF", + angrt: "\u221F", + angrtvb: "\u22BE", + angrtvbd: "\u299D", + angsph: "\u2222", + angst: "\xC5", + angzarr: "\u237C", + aogon: "\u0105", + aopf: "\u{1D552}", + ap: "\u2248", + apE: "\u2A70", + apacir: "\u2A6F", + ape: "\u224A", + apid: "\u224B", + apos: "'", + approx: "\u2248", + approxeq: "\u224A", + aring: "\xE5", + ascr: "\u{1D4B6}", + ast: "*", + asymp: "\u2248", + asympeq: "\u224D", + atilde: "\xE3", + auml: "\xE4", + awconint: "\u2233", + awint: "\u2A11", + bNot: "\u2AED", + backcong: "\u224C", + backepsilon: "\u03F6", + backprime: "\u2035", + backsim: "\u223D", + backsimeq: "\u22CD", + barvee: "\u22BD", + barwed: "\u2305", + barwedge: "\u2305", + bbrk: "\u23B5", + bbrktbrk: "\u23B6", + bcong: "\u224C", + bcy: "\u0431", + bdquo: "\u201E", + becaus: "\u2235", + because: "\u2235", + bemptyv: "\u29B0", + bepsi: "\u03F6", + bernou: "\u212C", + beta: "\u03B2", + beth: "\u2136", + between: "\u226C", + bfr: "\u{1D51F}", + bigcap: "\u22C2", + bigcirc: "\u25EF", + bigcup: "\u22C3", + bigodot: "\u2A00", + bigoplus: "\u2A01", + bigotimes: "\u2A02", + bigsqcup: "\u2A06", + bigstar: "\u2605", + bigtriangledown: "\u25BD", + bigtriangleup: "\u25B3", + biguplus: "\u2A04", + bigvee: "\u22C1", + bigwedge: "\u22C0", + bkarow: "\u290D", + blacklozenge: "\u29EB", + blacksquare: "\u25AA", + blacktriangle: "\u25B4", + blacktriangledown: "\u25BE", + blacktriangleleft: "\u25C2", + blacktriangleright: "\u25B8", + blank: "\u2423", + blk12: "\u2592", + blk14: "\u2591", + blk34: "\u2593", + block: "\u2588", + bne: "=\u20E5", + bnequiv: "\u2261\u20E5", + bnot: "\u2310", + bopf: "\u{1D553}", + bot: "\u22A5", + bottom: "\u22A5", + bowtie: "\u22C8", + boxDL: "\u2557", + boxDR: "\u2554", + boxDl: "\u2556", + boxDr: "\u2553", + boxH: "\u2550", + boxHD: "\u2566", + boxHU: "\u2569", + boxHd: "\u2564", + boxHu: "\u2567", + boxUL: "\u255D", + boxUR: "\u255A", + boxUl: "\u255C", + boxUr: "\u2559", + boxV: "\u2551", + boxVH: "\u256C", + boxVL: "\u2563", + boxVR: "\u2560", + boxVh: "\u256B", + boxVl: "\u2562", + boxVr: "\u255F", + boxbox: "\u29C9", + boxdL: "\u2555", + boxdR: "\u2552", + boxdl: "\u2510", + boxdr: "\u250C", + boxh: "\u2500", + boxhD: "\u2565", + boxhU: "\u2568", + boxhd: "\u252C", + boxhu: "\u2534", + boxminus: "\u229F", + boxplus: "\u229E", + boxtimes: "\u22A0", + boxuL: "\u255B", + boxuR: "\u2558", + boxul: "\u2518", + boxur: "\u2514", + boxv: "\u2502", + boxvH: "\u256A", + boxvL: "\u2561", + boxvR: "\u255E", + boxvh: "\u253C", + boxvl: "\u2524", + boxvr: "\u251C", + bprime: "\u2035", + breve: "\u02D8", + brvbar: "\xA6", + bscr: "\u{1D4B7}", + bsemi: "\u204F", + bsim: "\u223D", + bsime: "\u22CD", + bsol: "\\", + bsolb: "\u29C5", + bsolhsub: "\u27C8", + bull: "\u2022", + bullet: "\u2022", + bump: "\u224E", + bumpE: "\u2AAE", + bumpe: "\u224F", + bumpeq: "\u224F", + cacute: "\u0107", + cap: "\u2229", + capand: "\u2A44", + capbrcup: "\u2A49", + capcap: "\u2A4B", + capcup: "\u2A47", + capdot: "\u2A40", + caps: "\u2229\uFE00", + caret: "\u2041", + caron: "\u02C7", + ccaps: "\u2A4D", + ccaron: "\u010D", + ccedil: "\xE7", + ccirc: "\u0109", + ccups: "\u2A4C", + ccupssm: "\u2A50", + cdot: "\u010B", + cedil: "\xB8", + cemptyv: "\u29B2", + cent: "\xA2", + centerdot: "\xB7", + cfr: "\u{1D520}", + chcy: "\u0447", + check: "\u2713", + checkmark: "\u2713", + chi: "\u03C7", + cir: "\u25CB", + cirE: "\u29C3", + circ: "\u02C6", + circeq: "\u2257", + circlearrowleft: "\u21BA", + circlearrowright: "\u21BB", + circledR: "\xAE", + circledS: "\u24C8", + circledast: "\u229B", + circledcirc: "\u229A", + circleddash: "\u229D", + cire: "\u2257", + cirfnint: "\u2A10", + cirmid: "\u2AEF", + cirscir: "\u29C2", + clubs: "\u2663", + clubsuit: "\u2663", + colon: ":", + colone: "\u2254", + coloneq: "\u2254", + comma: ",", + commat: "@", + comp: "\u2201", + compfn: "\u2218", + complement: "\u2201", + complexes: "\u2102", + cong: "\u2245", + congdot: "\u2A6D", + conint: "\u222E", + copf: "\u{1D554}", + coprod: "\u2210", + copy: "\xA9", + copysr: "\u2117", + crarr: "\u21B5", + cross: "\u2717", + cscr: "\u{1D4B8}", + csub: "\u2ACF", + csube: "\u2AD1", + csup: "\u2AD0", + csupe: "\u2AD2", + ctdot: "\u22EF", + cudarrl: "\u2938", + cudarrr: "\u2935", + cuepr: "\u22DE", + cuesc: "\u22DF", + cularr: "\u21B6", + cularrp: "\u293D", + cup: "\u222A", + cupbrcap: "\u2A48", + cupcap: "\u2A46", + cupcup: "\u2A4A", + cupdot: "\u228D", + cupor: "\u2A45", + cups: "\u222A\uFE00", + curarr: "\u21B7", + curarrm: "\u293C", + curlyeqprec: "\u22DE", + curlyeqsucc: "\u22DF", + curlyvee: "\u22CE", + curlywedge: "\u22CF", + curren: "\xA4", + curvearrowleft: "\u21B6", + curvearrowright: "\u21B7", + cuvee: "\u22CE", + cuwed: "\u22CF", + cwconint: "\u2232", + cwint: "\u2231", + cylcty: "\u232D", + dArr: "\u21D3", + dHar: "\u2965", + dagger: "\u2020", + daleth: "\u2138", + darr: "\u2193", + dash: "\u2010", + dashv: "\u22A3", + dbkarow: "\u290F", + dblac: "\u02DD", + dcaron: "\u010F", + dcy: "\u0434", + dd: "\u2146", + ddagger: "\u2021", + ddarr: "\u21CA", + ddotseq: "\u2A77", + deg: "\xB0", + delta: "\u03B4", + demptyv: "\u29B1", + dfisht: "\u297F", + dfr: "\u{1D521}", + dharl: "\u21C3", + dharr: "\u21C2", + diam: "\u22C4", + diamond: "\u22C4", + diamondsuit: "\u2666", + diams: "\u2666", + die: "\xA8", + digamma: "\u03DD", + disin: "\u22F2", + div: "\xF7", + divide: "\xF7", + divideontimes: "\u22C7", + divonx: "\u22C7", + djcy: "\u0452", + dlcorn: "\u231E", + dlcrop: "\u230D", + dollar: "$", + dopf: "\u{1D555}", + dot: "\u02D9", + doteq: "\u2250", + doteqdot: "\u2251", + dotminus: "\u2238", + dotplus: "\u2214", + dotsquare: "\u22A1", + doublebarwedge: "\u2306", + downarrow: "\u2193", + downdownarrows: "\u21CA", + downharpoonleft: "\u21C3", + downharpoonright: "\u21C2", + drbkarow: "\u2910", + drcorn: "\u231F", + drcrop: "\u230C", + dscr: "\u{1D4B9}", + dscy: "\u0455", + dsol: "\u29F6", + dstrok: "\u0111", + dtdot: "\u22F1", + dtri: "\u25BF", + dtrif: "\u25BE", + duarr: "\u21F5", + duhar: "\u296F", + dwangle: "\u29A6", + dzcy: "\u045F", + dzigrarr: "\u27FF", + eDDot: "\u2A77", + eDot: "\u2251", + eacute: "\xE9", + easter: "\u2A6E", + ecaron: "\u011B", + ecir: "\u2256", + ecirc: "\xEA", + ecolon: "\u2255", + ecy: "\u044D", + edot: "\u0117", + ee: "\u2147", + efDot: "\u2252", + efr: "\u{1D522}", + eg: "\u2A9A", + egrave: "\xE8", + egs: "\u2A96", + egsdot: "\u2A98", + el: "\u2A99", + elinters: "\u23E7", + ell: "\u2113", + els: "\u2A95", + elsdot: "\u2A97", + emacr: "\u0113", + empty: "\u2205", + emptyset: "\u2205", + emptyv: "\u2205", + emsp13: "\u2004", + emsp14: "\u2005", + emsp: "\u2003", + eng: "\u014B", + ensp: "\u2002", + eogon: "\u0119", + eopf: "\u{1D556}", + epar: "\u22D5", + eparsl: "\u29E3", + eplus: "\u2A71", + epsi: "\u03B5", + epsilon: "\u03B5", + epsiv: "\u03F5", + eqcirc: "\u2256", + eqcolon: "\u2255", + eqsim: "\u2242", + eqslantgtr: "\u2A96", + eqslantless: "\u2A95", + equals: "=", + equest: "\u225F", + equiv: "\u2261", + equivDD: "\u2A78", + eqvparsl: "\u29E5", + erDot: "\u2253", + erarr: "\u2971", + escr: "\u212F", + esdot: "\u2250", + esim: "\u2242", + eta: "\u03B7", + eth: "\xF0", + euml: "\xEB", + euro: "\u20AC", + excl: "!", + exist: "\u2203", + expectation: "\u2130", + exponentiale: "\u2147", + fallingdotseq: "\u2252", + fcy: "\u0444", + female: "\u2640", + ffilig: "\uFB03", + fflig: "\uFB00", + ffllig: "\uFB04", + ffr: "\u{1D523}", + filig: "\uFB01", + fjlig: "fj", + flat: "\u266D", + fllig: "\uFB02", + fltns: "\u25B1", + fnof: "\u0192", + fopf: "\u{1D557}", + forall: "\u2200", + fork: "\u22D4", + forkv: "\u2AD9", + fpartint: "\u2A0D", + frac12: "\xBD", + frac13: "\u2153", + frac14: "\xBC", + frac15: "\u2155", + frac16: "\u2159", + frac18: "\u215B", + frac23: "\u2154", + frac25: "\u2156", + frac34: "\xBE", + frac35: "\u2157", + frac38: "\u215C", + frac45: "\u2158", + frac56: "\u215A", + frac58: "\u215D", + frac78: "\u215E", + frasl: "\u2044", + frown: "\u2322", + fscr: "\u{1D4BB}", + gE: "\u2267", + gEl: "\u2A8C", + gacute: "\u01F5", + gamma: "\u03B3", + gammad: "\u03DD", + gap: "\u2A86", + gbreve: "\u011F", + gcirc: "\u011D", + gcy: "\u0433", + gdot: "\u0121", + ge: "\u2265", + gel: "\u22DB", + geq: "\u2265", + geqq: "\u2267", + geqslant: "\u2A7E", + ges: "\u2A7E", + gescc: "\u2AA9", + gesdot: "\u2A80", + gesdoto: "\u2A82", + gesdotol: "\u2A84", + gesl: "\u22DB\uFE00", + gesles: "\u2A94", + gfr: "\u{1D524}", + gg: "\u226B", + ggg: "\u22D9", + gimel: "\u2137", + gjcy: "\u0453", + gl: "\u2277", + glE: "\u2A92", + gla: "\u2AA5", + glj: "\u2AA4", + gnE: "\u2269", + gnap: "\u2A8A", + gnapprox: "\u2A8A", + gne: "\u2A88", + gneq: "\u2A88", + gneqq: "\u2269", + gnsim: "\u22E7", + gopf: "\u{1D558}", + grave: "`", + gscr: "\u210A", + gsim: "\u2273", + gsime: "\u2A8E", + gsiml: "\u2A90", + gt: ">", + gtcc: "\u2AA7", + gtcir: "\u2A7A", + gtdot: "\u22D7", + gtlPar: "\u2995", + gtquest: "\u2A7C", + gtrapprox: "\u2A86", + gtrarr: "\u2978", + gtrdot: "\u22D7", + gtreqless: "\u22DB", + gtreqqless: "\u2A8C", + gtrless: "\u2277", + gtrsim: "\u2273", + gvertneqq: "\u2269\uFE00", + gvnE: "\u2269\uFE00", + hArr: "\u21D4", + hairsp: "\u200A", + half: "\xBD", + hamilt: "\u210B", + hardcy: "\u044A", + harr: "\u2194", + harrcir: "\u2948", + harrw: "\u21AD", + hbar: "\u210F", + hcirc: "\u0125", + hearts: "\u2665", + heartsuit: "\u2665", + hellip: "\u2026", + hercon: "\u22B9", + hfr: "\u{1D525}", + hksearow: "\u2925", + hkswarow: "\u2926", + hoarr: "\u21FF", + homtht: "\u223B", + hookleftarrow: "\u21A9", + hookrightarrow: "\u21AA", + hopf: "\u{1D559}", + horbar: "\u2015", + hscr: "\u{1D4BD}", + hslash: "\u210F", + hstrok: "\u0127", + hybull: "\u2043", + hyphen: "\u2010", + iacute: "\xED", + ic: "\u2063", + icirc: "\xEE", + icy: "\u0438", + iecy: "\u0435", + iexcl: "\xA1", + iff: "\u21D4", + ifr: "\u{1D526}", + igrave: "\xEC", + ii: "\u2148", + iiiint: "\u2A0C", + iiint: "\u222D", + iinfin: "\u29DC", + iiota: "\u2129", + ijlig: "\u0133", + imacr: "\u012B", + image: "\u2111", + imagline: "\u2110", + imagpart: "\u2111", + imath: "\u0131", + imof: "\u22B7", + imped: "\u01B5", + in: "\u2208", + incare: "\u2105", + infin: "\u221E", + infintie: "\u29DD", + inodot: "\u0131", + int: "\u222B", + intcal: "\u22BA", + integers: "\u2124", + intercal: "\u22BA", + intlarhk: "\u2A17", + intprod: "\u2A3C", + iocy: "\u0451", + iogon: "\u012F", + iopf: "\u{1D55A}", + iota: "\u03B9", + iprod: "\u2A3C", + iquest: "\xBF", + iscr: "\u{1D4BE}", + isin: "\u2208", + isinE: "\u22F9", + isindot: "\u22F5", + isins: "\u22F4", + isinsv: "\u22F3", + isinv: "\u2208", + it: "\u2062", + itilde: "\u0129", + iukcy: "\u0456", + iuml: "\xEF", + jcirc: "\u0135", + jcy: "\u0439", + jfr: "\u{1D527}", + jmath: "\u0237", + jopf: "\u{1D55B}", + jscr: "\u{1D4BF}", + jsercy: "\u0458", + jukcy: "\u0454", + kappa: "\u03BA", + kappav: "\u03F0", + kcedil: "\u0137", + kcy: "\u043A", + kfr: "\u{1D528}", + kgreen: "\u0138", + khcy: "\u0445", + kjcy: "\u045C", + kopf: "\u{1D55C}", + kscr: "\u{1D4C0}", + lAarr: "\u21DA", + lArr: "\u21D0", + lAtail: "\u291B", + lBarr: "\u290E", + lE: "\u2266", + lEg: "\u2A8B", + lHar: "\u2962", + lacute: "\u013A", + laemptyv: "\u29B4", + lagran: "\u2112", + lambda: "\u03BB", + lang: "\u27E8", + langd: "\u2991", + langle: "\u27E8", + lap: "\u2A85", + laquo: "\xAB", + larr: "\u2190", + larrb: "\u21E4", + larrbfs: "\u291F", + larrfs: "\u291D", + larrhk: "\u21A9", + larrlp: "\u21AB", + larrpl: "\u2939", + larrsim: "\u2973", + larrtl: "\u21A2", + lat: "\u2AAB", + latail: "\u2919", + late: "\u2AAD", + lates: "\u2AAD\uFE00", + lbarr: "\u290C", + lbbrk: "\u2772", + lbrace: "{", + lbrack: "[", + lbrke: "\u298B", + lbrksld: "\u298F", + lbrkslu: "\u298D", + lcaron: "\u013E", + lcedil: "\u013C", + lceil: "\u2308", + lcub: "{", + lcy: "\u043B", + ldca: "\u2936", + ldquo: "\u201C", + ldquor: "\u201E", + ldrdhar: "\u2967", + ldrushar: "\u294B", + ldsh: "\u21B2", + le: "\u2264", + leftarrow: "\u2190", + leftarrowtail: "\u21A2", + leftharpoondown: "\u21BD", + leftharpoonup: "\u21BC", + leftleftarrows: "\u21C7", + leftrightarrow: "\u2194", + leftrightarrows: "\u21C6", + leftrightharpoons: "\u21CB", + leftrightsquigarrow: "\u21AD", + leftthreetimes: "\u22CB", + leg: "\u22DA", + leq: "\u2264", + leqq: "\u2266", + leqslant: "\u2A7D", + les: "\u2A7D", + lescc: "\u2AA8", + lesdot: "\u2A7F", + lesdoto: "\u2A81", + lesdotor: "\u2A83", + lesg: "\u22DA\uFE00", + lesges: "\u2A93", + lessapprox: "\u2A85", + lessdot: "\u22D6", + lesseqgtr: "\u22DA", + lesseqqgtr: "\u2A8B", + lessgtr: "\u2276", + lesssim: "\u2272", + lfisht: "\u297C", + lfloor: "\u230A", + lfr: "\u{1D529}", + lg: "\u2276", + lgE: "\u2A91", + lhard: "\u21BD", + lharu: "\u21BC", + lharul: "\u296A", + lhblk: "\u2584", + ljcy: "\u0459", + ll: "\u226A", + llarr: "\u21C7", + llcorner: "\u231E", + llhard: "\u296B", + lltri: "\u25FA", + lmidot: "\u0140", + lmoust: "\u23B0", + lmoustache: "\u23B0", + lnE: "\u2268", + lnap: "\u2A89", + lnapprox: "\u2A89", + lne: "\u2A87", + lneq: "\u2A87", + lneqq: "\u2268", + lnsim: "\u22E6", + loang: "\u27EC", + loarr: "\u21FD", + lobrk: "\u27E6", + longleftarrow: "\u27F5", + longleftrightarrow: "\u27F7", + longmapsto: "\u27FC", + longrightarrow: "\u27F6", + looparrowleft: "\u21AB", + looparrowright: "\u21AC", + lopar: "\u2985", + lopf: "\u{1D55D}", + loplus: "\u2A2D", + lotimes: "\u2A34", + lowast: "\u2217", + lowbar: "_", + loz: "\u25CA", + lozenge: "\u25CA", + lozf: "\u29EB", + lpar: "(", + lparlt: "\u2993", + lrarr: "\u21C6", + lrcorner: "\u231F", + lrhar: "\u21CB", + lrhard: "\u296D", + lrm: "\u200E", + lrtri: "\u22BF", + lsaquo: "\u2039", + lscr: "\u{1D4C1}", + lsh: "\u21B0", + lsim: "\u2272", + lsime: "\u2A8D", + lsimg: "\u2A8F", + lsqb: "[", + lsquo: "\u2018", + lsquor: "\u201A", + lstrok: "\u0142", + lt: "<", + ltcc: "\u2AA6", + ltcir: "\u2A79", + ltdot: "\u22D6", + lthree: "\u22CB", + ltimes: "\u22C9", + ltlarr: "\u2976", + ltquest: "\u2A7B", + ltrPar: "\u2996", + ltri: "\u25C3", + ltrie: "\u22B4", + ltrif: "\u25C2", + lurdshar: "\u294A", + luruhar: "\u2966", + lvertneqq: "\u2268\uFE00", + lvnE: "\u2268\uFE00", + mDDot: "\u223A", + macr: "\xAF", + male: "\u2642", + malt: "\u2720", + maltese: "\u2720", + map: "\u21A6", + mapsto: "\u21A6", + mapstodown: "\u21A7", + mapstoleft: "\u21A4", + mapstoup: "\u21A5", + marker: "\u25AE", + mcomma: "\u2A29", + mcy: "\u043C", + mdash: "\u2014", + measuredangle: "\u2221", + mfr: "\u{1D52A}", + mho: "\u2127", + micro: "\xB5", + mid: "\u2223", + midast: "*", + midcir: "\u2AF0", + middot: "\xB7", + minus: "\u2212", + minusb: "\u229F", + minusd: "\u2238", + minusdu: "\u2A2A", + mlcp: "\u2ADB", + mldr: "\u2026", + mnplus: "\u2213", + models: "\u22A7", + mopf: "\u{1D55E}", + mp: "\u2213", + mscr: "\u{1D4C2}", + mstpos: "\u223E", + mu: "\u03BC", + multimap: "\u22B8", + mumap: "\u22B8", + nGg: "\u22D9\u0338", + nGt: "\u226B\u20D2", + nGtv: "\u226B\u0338", + nLeftarrow: "\u21CD", + nLeftrightarrow: "\u21CE", + nLl: "\u22D8\u0338", + nLt: "\u226A\u20D2", + nLtv: "\u226A\u0338", + nRightarrow: "\u21CF", + nVDash: "\u22AF", + nVdash: "\u22AE", + nabla: "\u2207", + nacute: "\u0144", + nang: "\u2220\u20D2", + nap: "\u2249", + napE: "\u2A70\u0338", + napid: "\u224B\u0338", + napos: "\u0149", + napprox: "\u2249", + natur: "\u266E", + natural: "\u266E", + naturals: "\u2115", + nbsp: "\xA0", + nbump: "\u224E\u0338", + nbumpe: "\u224F\u0338", + ncap: "\u2A43", + ncaron: "\u0148", + ncedil: "\u0146", + ncong: "\u2247", + ncongdot: "\u2A6D\u0338", + ncup: "\u2A42", + ncy: "\u043D", + ndash: "\u2013", + ne: "\u2260", + neArr: "\u21D7", + nearhk: "\u2924", + nearr: "\u2197", + nearrow: "\u2197", + nedot: "\u2250\u0338", + nequiv: "\u2262", + nesear: "\u2928", + nesim: "\u2242\u0338", + nexist: "\u2204", + nexists: "\u2204", + nfr: "\u{1D52B}", + ngE: "\u2267\u0338", + nge: "\u2271", + ngeq: "\u2271", + ngeqq: "\u2267\u0338", + ngeqslant: "\u2A7E\u0338", + nges: "\u2A7E\u0338", + ngsim: "\u2275", + ngt: "\u226F", + ngtr: "\u226F", + nhArr: "\u21CE", + nharr: "\u21AE", + nhpar: "\u2AF2", + ni: "\u220B", + nis: "\u22FC", + nisd: "\u22FA", + niv: "\u220B", + njcy: "\u045A", + nlArr: "\u21CD", + nlE: "\u2266\u0338", + nlarr: "\u219A", + nldr: "\u2025", + nle: "\u2270", + nleftarrow: "\u219A", + nleftrightarrow: "\u21AE", + nleq: "\u2270", + nleqq: "\u2266\u0338", + nleqslant: "\u2A7D\u0338", + nles: "\u2A7D\u0338", + nless: "\u226E", + nlsim: "\u2274", + nlt: "\u226E", + nltri: "\u22EA", + nltrie: "\u22EC", + nmid: "\u2224", + nopf: "\u{1D55F}", + not: "\xAC", + notin: "\u2209", + notinE: "\u22F9\u0338", + notindot: "\u22F5\u0338", + notinva: "\u2209", + notinvb: "\u22F7", + notinvc: "\u22F6", + notni: "\u220C", + notniva: "\u220C", + notnivb: "\u22FE", + notnivc: "\u22FD", + npar: "\u2226", + nparallel: "\u2226", + nparsl: "\u2AFD\u20E5", + npart: "\u2202\u0338", + npolint: "\u2A14", + npr: "\u2280", + nprcue: "\u22E0", + npre: "\u2AAF\u0338", + nprec: "\u2280", + npreceq: "\u2AAF\u0338", + nrArr: "\u21CF", + nrarr: "\u219B", + nrarrc: "\u2933\u0338", + nrarrw: "\u219D\u0338", + nrightarrow: "\u219B", + nrtri: "\u22EB", + nrtrie: "\u22ED", + nsc: "\u2281", + nsccue: "\u22E1", + nsce: "\u2AB0\u0338", + nscr: "\u{1D4C3}", + nshortmid: "\u2224", + nshortparallel: "\u2226", + nsim: "\u2241", + nsime: "\u2244", + nsimeq: "\u2244", + nsmid: "\u2224", + nspar: "\u2226", + nsqsube: "\u22E2", + nsqsupe: "\u22E3", + nsub: "\u2284", + nsubE: "\u2AC5\u0338", + nsube: "\u2288", + nsubset: "\u2282\u20D2", + nsubseteq: "\u2288", + nsubseteqq: "\u2AC5\u0338", + nsucc: "\u2281", + nsucceq: "\u2AB0\u0338", + nsup: "\u2285", + nsupE: "\u2AC6\u0338", + nsupe: "\u2289", + nsupset: "\u2283\u20D2", + nsupseteq: "\u2289", + nsupseteqq: "\u2AC6\u0338", + ntgl: "\u2279", + ntilde: "\xF1", + ntlg: "\u2278", + ntriangleleft: "\u22EA", + ntrianglelefteq: "\u22EC", + ntriangleright: "\u22EB", + ntrianglerighteq: "\u22ED", + nu: "\u03BD", + num: "#", + numero: "\u2116", + numsp: "\u2007", + nvDash: "\u22AD", + nvHarr: "\u2904", + nvap: "\u224D\u20D2", + nvdash: "\u22AC", + nvge: "\u2265\u20D2", + nvgt: ">\u20D2", + nvinfin: "\u29DE", + nvlArr: "\u2902", + nvle: "\u2264\u20D2", + nvlt: "<\u20D2", + nvltrie: "\u22B4\u20D2", + nvrArr: "\u2903", + nvrtrie: "\u22B5\u20D2", + nvsim: "\u223C\u20D2", + nwArr: "\u21D6", + nwarhk: "\u2923", + nwarr: "\u2196", + nwarrow: "\u2196", + nwnear: "\u2927", + oS: "\u24C8", + oacute: "\xF3", + oast: "\u229B", + ocir: "\u229A", + ocirc: "\xF4", + ocy: "\u043E", + odash: "\u229D", + odblac: "\u0151", + odiv: "\u2A38", + odot: "\u2299", + odsold: "\u29BC", + oelig: "\u0153", + ofcir: "\u29BF", + ofr: "\u{1D52C}", + ogon: "\u02DB", + ograve: "\xF2", + ogt: "\u29C1", + ohbar: "\u29B5", + ohm: "\u03A9", + oint: "\u222E", + olarr: "\u21BA", + olcir: "\u29BE", + olcross: "\u29BB", + oline: "\u203E", + olt: "\u29C0", + omacr: "\u014D", + omega: "\u03C9", + omicron: "\u03BF", + omid: "\u29B6", + ominus: "\u2296", + oopf: "\u{1D560}", + opar: "\u29B7", + operp: "\u29B9", + oplus: "\u2295", + or: "\u2228", + orarr: "\u21BB", + ord: "\u2A5D", + order: "\u2134", + orderof: "\u2134", + ordf: "\xAA", + ordm: "\xBA", + origof: "\u22B6", + oror: "\u2A56", + orslope: "\u2A57", + orv: "\u2A5B", + oscr: "\u2134", + oslash: "\xF8", + osol: "\u2298", + otilde: "\xF5", + otimes: "\u2297", + otimesas: "\u2A36", + ouml: "\xF6", + ovbar: "\u233D", + par: "\u2225", + para: "\xB6", + parallel: "\u2225", + parsim: "\u2AF3", + parsl: "\u2AFD", + part: "\u2202", + pcy: "\u043F", + percnt: "%", + period: ".", + permil: "\u2030", + perp: "\u22A5", + pertenk: "\u2031", + pfr: "\u{1D52D}", + phi: "\u03C6", + phiv: "\u03D5", + phmmat: "\u2133", + phone: "\u260E", + pi: "\u03C0", + pitchfork: "\u22D4", + piv: "\u03D6", + planck: "\u210F", + planckh: "\u210E", + plankv: "\u210F", + plus: "+", + plusacir: "\u2A23", + plusb: "\u229E", + pluscir: "\u2A22", + plusdo: "\u2214", + plusdu: "\u2A25", + pluse: "\u2A72", + plusmn: "\xB1", + plussim: "\u2A26", + plustwo: "\u2A27", + pm: "\xB1", + pointint: "\u2A15", + popf: "\u{1D561}", + pound: "\xA3", + pr: "\u227A", + prE: "\u2AB3", + prap: "\u2AB7", + prcue: "\u227C", + pre: "\u2AAF", + prec: "\u227A", + precapprox: "\u2AB7", + preccurlyeq: "\u227C", + preceq: "\u2AAF", + precnapprox: "\u2AB9", + precneqq: "\u2AB5", + precnsim: "\u22E8", + precsim: "\u227E", + prime: "\u2032", + primes: "\u2119", + prnE: "\u2AB5", + prnap: "\u2AB9", + prnsim: "\u22E8", + prod: "\u220F", + profalar: "\u232E", + profline: "\u2312", + profsurf: "\u2313", + prop: "\u221D", + propto: "\u221D", + prsim: "\u227E", + prurel: "\u22B0", + pscr: "\u{1D4C5}", + psi: "\u03C8", + puncsp: "\u2008", + qfr: "\u{1D52E}", + qint: "\u2A0C", + qopf: "\u{1D562}", + qprime: "\u2057", + qscr: "\u{1D4C6}", + quaternions: "\u210D", + quatint: "\u2A16", + quest: "?", + questeq: "\u225F", + quot: '"', + rAarr: "\u21DB", + rArr: "\u21D2", + rAtail: "\u291C", + rBarr: "\u290F", + rHar: "\u2964", + race: "\u223D\u0331", + racute: "\u0155", + radic: "\u221A", + raemptyv: "\u29B3", + rang: "\u27E9", + rangd: "\u2992", + range: "\u29A5", + rangle: "\u27E9", + raquo: "\xBB", + rarr: "\u2192", + rarrap: "\u2975", + rarrb: "\u21E5", + rarrbfs: "\u2920", + rarrc: "\u2933", + rarrfs: "\u291E", + rarrhk: "\u21AA", + rarrlp: "\u21AC", + rarrpl: "\u2945", + rarrsim: "\u2974", + rarrtl: "\u21A3", + rarrw: "\u219D", + ratail: "\u291A", + ratio: "\u2236", + rationals: "\u211A", + rbarr: "\u290D", + rbbrk: "\u2773", + rbrace: "}", + rbrack: "]", + rbrke: "\u298C", + rbrksld: "\u298E", + rbrkslu: "\u2990", + rcaron: "\u0159", + rcedil: "\u0157", + rceil: "\u2309", + rcub: "}", + rcy: "\u0440", + rdca: "\u2937", + rdldhar: "\u2969", + rdquo: "\u201D", + rdquor: "\u201D", + rdsh: "\u21B3", + real: "\u211C", + realine: "\u211B", + realpart: "\u211C", + reals: "\u211D", + rect: "\u25AD", + reg: "\xAE", + rfisht: "\u297D", + rfloor: "\u230B", + rfr: "\u{1D52F}", + rhard: "\u21C1", + rharu: "\u21C0", + rharul: "\u296C", + rho: "\u03C1", + rhov: "\u03F1", + rightarrow: "\u2192", + rightarrowtail: "\u21A3", + rightharpoondown: "\u21C1", + rightharpoonup: "\u21C0", + rightleftarrows: "\u21C4", + rightleftharpoons: "\u21CC", + rightrightarrows: "\u21C9", + rightsquigarrow: "\u219D", + rightthreetimes: "\u22CC", + ring: "\u02DA", + risingdotseq: "\u2253", + rlarr: "\u21C4", + rlhar: "\u21CC", + rlm: "\u200F", + rmoust: "\u23B1", + rmoustache: "\u23B1", + rnmid: "\u2AEE", + roang: "\u27ED", + roarr: "\u21FE", + robrk: "\u27E7", + ropar: "\u2986", + ropf: "\u{1D563}", + roplus: "\u2A2E", + rotimes: "\u2A35", + rpar: ")", + rpargt: "\u2994", + rppolint: "\u2A12", + rrarr: "\u21C9", + rsaquo: "\u203A", + rscr: "\u{1D4C7}", + rsh: "\u21B1", + rsqb: "]", + rsquo: "\u2019", + rsquor: "\u2019", + rthree: "\u22CC", + rtimes: "\u22CA", + rtri: "\u25B9", + rtrie: "\u22B5", + rtrif: "\u25B8", + rtriltri: "\u29CE", + ruluhar: "\u2968", + rx: "\u211E", + sacute: "\u015B", + sbquo: "\u201A", + sc: "\u227B", + scE: "\u2AB4", + scap: "\u2AB8", + scaron: "\u0161", + sccue: "\u227D", + sce: "\u2AB0", + scedil: "\u015F", + scirc: "\u015D", + scnE: "\u2AB6", + scnap: "\u2ABA", + scnsim: "\u22E9", + scpolint: "\u2A13", + scsim: "\u227F", + scy: "\u0441", + sdot: "\u22C5", + sdotb: "\u22A1", + sdote: "\u2A66", + seArr: "\u21D8", + searhk: "\u2925", + searr: "\u2198", + searrow: "\u2198", + sect: "\xA7", + semi: ";", + seswar: "\u2929", + setminus: "\u2216", + setmn: "\u2216", + sext: "\u2736", + sfr: "\u{1D530}", + sfrown: "\u2322", + sharp: "\u266F", + shchcy: "\u0449", + shcy: "\u0448", + shortmid: "\u2223", + shortparallel: "\u2225", + shy: "\xAD", + sigma: "\u03C3", + sigmaf: "\u03C2", + sigmav: "\u03C2", + sim: "\u223C", + simdot: "\u2A6A", + sime: "\u2243", + simeq: "\u2243", + simg: "\u2A9E", + simgE: "\u2AA0", + siml: "\u2A9D", + simlE: "\u2A9F", + simne: "\u2246", + simplus: "\u2A24", + simrarr: "\u2972", + slarr: "\u2190", + smallsetminus: "\u2216", + smashp: "\u2A33", + smeparsl: "\u29E4", + smid: "\u2223", + smile: "\u2323", + smt: "\u2AAA", + smte: "\u2AAC", + smtes: "\u2AAC\uFE00", + softcy: "\u044C", + sol: "/", + solb: "\u29C4", + solbar: "\u233F", + sopf: "\u{1D564}", + spades: "\u2660", + spadesuit: "\u2660", + spar: "\u2225", + sqcap: "\u2293", + sqcaps: "\u2293\uFE00", + sqcup: "\u2294", + sqcups: "\u2294\uFE00", + sqsub: "\u228F", + sqsube: "\u2291", + sqsubset: "\u228F", + sqsubseteq: "\u2291", + sqsup: "\u2290", + sqsupe: "\u2292", + sqsupset: "\u2290", + sqsupseteq: "\u2292", + squ: "\u25A1", + square: "\u25A1", + squarf: "\u25AA", + squf: "\u25AA", + srarr: "\u2192", + sscr: "\u{1D4C8}", + ssetmn: "\u2216", + ssmile: "\u2323", + sstarf: "\u22C6", + star: "\u2606", + starf: "\u2605", + straightepsilon: "\u03F5", + straightphi: "\u03D5", + strns: "\xAF", + sub: "\u2282", + subE: "\u2AC5", + subdot: "\u2ABD", + sube: "\u2286", + subedot: "\u2AC3", + submult: "\u2AC1", + subnE: "\u2ACB", + subne: "\u228A", + subplus: "\u2ABF", + subrarr: "\u2979", + subset: "\u2282", + subseteq: "\u2286", + subseteqq: "\u2AC5", + subsetneq: "\u228A", + subsetneqq: "\u2ACB", + subsim: "\u2AC7", + subsub: "\u2AD5", + subsup: "\u2AD3", + succ: "\u227B", + succapprox: "\u2AB8", + succcurlyeq: "\u227D", + succeq: "\u2AB0", + succnapprox: "\u2ABA", + succneqq: "\u2AB6", + succnsim: "\u22E9", + succsim: "\u227F", + sum: "\u2211", + sung: "\u266A", + sup1: "\xB9", + sup2: "\xB2", + sup3: "\xB3", + sup: "\u2283", + supE: "\u2AC6", + supdot: "\u2ABE", + supdsub: "\u2AD8", + supe: "\u2287", + supedot: "\u2AC4", + suphsol: "\u27C9", + suphsub: "\u2AD7", + suplarr: "\u297B", + supmult: "\u2AC2", + supnE: "\u2ACC", + supne: "\u228B", + supplus: "\u2AC0", + supset: "\u2283", + supseteq: "\u2287", + supseteqq: "\u2AC6", + supsetneq: "\u228B", + supsetneqq: "\u2ACC", + supsim: "\u2AC8", + supsub: "\u2AD4", + supsup: "\u2AD6", + swArr: "\u21D9", + swarhk: "\u2926", + swarr: "\u2199", + swarrow: "\u2199", + swnwar: "\u292A", + szlig: "\xDF", + target: "\u2316", + tau: "\u03C4", + tbrk: "\u23B4", + tcaron: "\u0165", + tcedil: "\u0163", + tcy: "\u0442", + tdot: "\u20DB", + telrec: "\u2315", + tfr: "\u{1D531}", + there4: "\u2234", + therefore: "\u2234", + theta: "\u03B8", + thetasym: "\u03D1", + thetav: "\u03D1", + thickapprox: "\u2248", + thicksim: "\u223C", + thinsp: "\u2009", + thkap: "\u2248", + thksim: "\u223C", + thorn: "\xFE", + tilde: "\u02DC", + times: "\xD7", + timesb: "\u22A0", + timesbar: "\u2A31", + timesd: "\u2A30", + tint: "\u222D", + toea: "\u2928", + top: "\u22A4", + topbot: "\u2336", + topcir: "\u2AF1", + topf: "\u{1D565}", + topfork: "\u2ADA", + tosa: "\u2929", + tprime: "\u2034", + trade: "\u2122", + triangle: "\u25B5", + triangledown: "\u25BF", + triangleleft: "\u25C3", + trianglelefteq: "\u22B4", + triangleq: "\u225C", + triangleright: "\u25B9", + trianglerighteq: "\u22B5", + tridot: "\u25EC", + trie: "\u225C", + triminus: "\u2A3A", + triplus: "\u2A39", + trisb: "\u29CD", + tritime: "\u2A3B", + trpezium: "\u23E2", + tscr: "\u{1D4C9}", + tscy: "\u0446", + tshcy: "\u045B", + tstrok: "\u0167", + twixt: "\u226C", + twoheadleftarrow: "\u219E", + twoheadrightarrow: "\u21A0", + uArr: "\u21D1", + uHar: "\u2963", + uacute: "\xFA", + uarr: "\u2191", + ubrcy: "\u045E", + ubreve: "\u016D", + ucirc: "\xFB", + ucy: "\u0443", + udarr: "\u21C5", + udblac: "\u0171", + udhar: "\u296E", + ufisht: "\u297E", + ufr: "\u{1D532}", + ugrave: "\xF9", + uharl: "\u21BF", + uharr: "\u21BE", + uhblk: "\u2580", + ulcorn: "\u231C", + ulcorner: "\u231C", + ulcrop: "\u230F", + ultri: "\u25F8", + umacr: "\u016B", + uml: "\xA8", + uogon: "\u0173", + uopf: "\u{1D566}", + uparrow: "\u2191", + updownarrow: "\u2195", + upharpoonleft: "\u21BF", + upharpoonright: "\u21BE", + uplus: "\u228E", + upsi: "\u03C5", + upsih: "\u03D2", + upsilon: "\u03C5", + upuparrows: "\u21C8", + urcorn: "\u231D", + urcorner: "\u231D", + urcrop: "\u230E", + uring: "\u016F", + urtri: "\u25F9", + uscr: "\u{1D4CA}", + utdot: "\u22F0", + utilde: "\u0169", + utri: "\u25B5", + utrif: "\u25B4", + uuarr: "\u21C8", + uuml: "\xFC", + uwangle: "\u29A7", + vArr: "\u21D5", + vBar: "\u2AE8", + vBarv: "\u2AE9", + vDash: "\u22A8", + vangrt: "\u299C", + varepsilon: "\u03F5", + varkappa: "\u03F0", + varnothing: "\u2205", + varphi: "\u03D5", + varpi: "\u03D6", + varpropto: "\u221D", + varr: "\u2195", + varrho: "\u03F1", + varsigma: "\u03C2", + varsubsetneq: "\u228A\uFE00", + varsubsetneqq: "\u2ACB\uFE00", + varsupsetneq: "\u228B\uFE00", + varsupsetneqq: "\u2ACC\uFE00", + vartheta: "\u03D1", + vartriangleleft: "\u22B2", + vartriangleright: "\u22B3", + vcy: "\u0432", + vdash: "\u22A2", + vee: "\u2228", + veebar: "\u22BB", + veeeq: "\u225A", + vellip: "\u22EE", + verbar: "|", + vert: "|", + vfr: "\u{1D533}", + vltri: "\u22B2", + vnsub: "\u2282\u20D2", + vnsup: "\u2283\u20D2", + vopf: "\u{1D567}", + vprop: "\u221D", + vrtri: "\u22B3", + vscr: "\u{1D4CB}", + vsubnE: "\u2ACB\uFE00", + vsubne: "\u228A\uFE00", + vsupnE: "\u2ACC\uFE00", + vsupne: "\u228B\uFE00", + vzigzag: "\u299A", + wcirc: "\u0175", + wedbar: "\u2A5F", + wedge: "\u2227", + wedgeq: "\u2259", + weierp: "\u2118", + wfr: "\u{1D534}", + wopf: "\u{1D568}", + wp: "\u2118", + wr: "\u2240", + wreath: "\u2240", + wscr: "\u{1D4CC}", + xcap: "\u22C2", + xcirc: "\u25EF", + xcup: "\u22C3", + xdtri: "\u25BD", + xfr: "\u{1D535}", + xhArr: "\u27FA", + xharr: "\u27F7", + xi: "\u03BE", + xlArr: "\u27F8", + xlarr: "\u27F5", + xmap: "\u27FC", + xnis: "\u22FB", + xodot: "\u2A00", + xopf: "\u{1D569}", + xoplus: "\u2A01", + xotime: "\u2A02", + xrArr: "\u27F9", + xrarr: "\u27F6", + xscr: "\u{1D4CD}", + xsqcup: "\u2A06", + xuplus: "\u2A04", + xutri: "\u25B3", + xvee: "\u22C1", + xwedge: "\u22C0", + yacute: "\xFD", + yacy: "\u044F", + ycirc: "\u0177", + ycy: "\u044B", + yen: "\xA5", + yfr: "\u{1D536}", + yicy: "\u0457", + yopf: "\u{1D56A}", + yscr: "\u{1D4CE}", + yucy: "\u044E", + yuml: "\xFF", + zacute: "\u017A", + zcaron: "\u017E", + zcy: "\u0437", + zdot: "\u017C", + zeetrf: "\u2128", + zeta: "\u03B6", + zfr: "\u{1D537}", + zhcy: "\u0436", + zigrarr: "\u21DD", + zopf: "\u{1D56B}", + zscr: "\u{1D4CF}", + zwj: "\u200D", + zwnj: "\u200C" +}; + +// node_modules/decode-named-character-reference/index.js +var own2 = {}.hasOwnProperty; +function decodeNamedCharacterReference(value) { + return own2.call(characterEntities, value) ? characterEntities[value] : false; +} + +// node_modules/micromark-extension-mdxjs-esm/lib/syntax.js +var nextBlankConstruct = { + tokenize: tokenizeNextBlank, + partial: true +}; +var allowedAcornTypes = /* @__PURE__ */ new Set([ + "ExportAllDeclaration", + "ExportDefaultDeclaration", + "ExportNamedDeclaration", + "ImportDeclaration" +]); +function mdxjsEsm(options) { + const exportImportConstruct = { + tokenize: tokenizeExportImport, + concrete: true + }; + if (!options || !options.acorn || !options.acorn.parse) { + throw new Error("Expected an `acorn` instance passed in as `options.acorn`"); + } + const acorn = options.acorn; + const acornOptions = Object.assign( + { + ecmaVersion: 2020, + sourceType: "module" + }, + options.acornOptions + ); + return { + flow: { + [101]: exportImportConstruct, + [105]: exportImportConstruct + } + }; + function tokenizeExportImport(effects, ok, nok) { + const self2 = this; + const definedModuleSpecifiers = self2.parser.definedModuleSpecifiers || (self2.parser.definedModuleSpecifiers = []); + const eventStart = this.events.length + 1; + let index2 = 0; + let buffer; + return self2.interrupt ? nok : start3; + function start3(code) { + if (self2.now().column > 1) + return nok(code); + buffer = code === 101 ? "export" : "import"; + effects.enter("mdxjsEsm"); + effects.enter("mdxjsEsmData"); + return keyword(code); + } + function keyword(code) { + if (code === buffer.charCodeAt(index2++)) { + effects.consume(code); + return index2 === buffer.length ? after : keyword; + } + return nok(code); + } + function after(code) { + if (unicodeWhitespace(code)) { + effects.consume(code); + return rest; + } + return nok(code); + } + function rest(code) { + if (code === null) { + return atEndOfData(code); + } + if (markdownLineEnding(code)) { + return effects.check(nextBlankConstruct, atEndOfData, atEol)(code); + } + effects.consume(code); + return rest; + } + function atEol(code) { + effects.exit("mdxjsEsmData"); + return lineStart(code); + } + function lineStart(code) { + if (markdownLineEnding(code)) { + effects.enter("lineEnding"); + effects.consume(code); + effects.exit("lineEnding"); + return lineStart; + } + if (code === null) { + return atEnd(code); + } + effects.enter("mdxjsEsmData"); + return rest(code); + } + function atEndOfData(code) { + effects.exit("mdxjsEsmData"); + return atEnd(code); + } + function atEnd(code) { + let index3 = -1; + const result = eventsToAcorn(self2.events.slice(eventStart), { + acorn, + acornOptions, + prefix: definedModuleSpecifiers.length > 0 ? "var " + definedModuleSpecifiers.join(",") + "\n" : "" + }); + if (code !== null && result.swallow) { + return lineStart(code); + } + if (result.error) { + throw new VFileMessage( + "Could not parse import/exports with acorn: " + String(result.error), + { + line: result.error.loc.line, + column: result.error.loc.column + 1, + offset: result.error.pos + }, + "micromark-extension-mdxjs-esm:acorn" + ); + } + if (definedModuleSpecifiers.length > 0) { + result.estree.body.shift(); + } + while (++index3 < result.estree.body.length) { + const node = result.estree.body[index3]; + if (!allowedAcornTypes.has(node.type)) { + throw new VFileMessage( + "Unexpected `" + node.type + "` in code: only import/exports are supported", + positionFromEstree(node), + "micromark-extension-mdxjs-esm:non-esm" + ); + } + if (node.type === "ImportDeclaration" && !self2.interrupt) { + let index4 = -1; + while (++index4 < node.specifiers.length) { + definedModuleSpecifiers.push(node.specifiers[index4].local.name); + } + } + } + Object.assign( + effects.exit("mdxjsEsm"), + options.addResult ? { + estree: result.estree + } : void 0 + ); + return ok(code); + } + } +} +function tokenizeNextBlank(effects, ok, nok) { + return start3; + function start3(code) { + effects.exit("mdxjsEsmData"); + effects.enter("lineEndingBlank"); + effects.consume(code); + effects.exit("lineEndingBlank"); + return effects.attempt(blankLine, ok, nok); + } +} + +// node_modules/micromark-extension-mdxjs/index.js +function mdxjs(options) { + const settings = Object.assign( + { + acorn: Parser.extend((0, import_acorn_jsx.default)()), + acornOptions: { ecmaVersion: 2020, sourceType: "module" }, + addResult: true + }, + options + ); + return combineExtensions([ + mdxjsEsm(settings), + mdxExpression(settings), + mdxJsx(settings), + mdxMd + ]); +} + +// node_modules/mdast-util-mdx-expression/index.js +var mdxExpressionFromMarkdown = { + enter: { + mdxFlowExpression: enterMdxFlowExpression, + mdxTextExpression: enterMdxTextExpression + }, + exit: { + mdxFlowExpression: exitMdxExpression, + mdxFlowExpressionChunk: exitMdxExpressionData, + mdxTextExpression: exitMdxExpression, + mdxTextExpressionChunk: exitMdxExpressionData + } +}; +var mdxExpressionToMarkdown = { + handlers: { + mdxFlowExpression: handleMdxExpression, + mdxTextExpression: handleMdxExpression + }, + unsafe: [ + { character: "{", inConstruct: ["phrasing"] }, + { atBreak: true, character: "{" } + ] +}; +function enterMdxFlowExpression(token) { + this.enter({ type: "mdxFlowExpression", value: "" }, token); + this.buffer(); +} +function enterMdxTextExpression(token) { + this.enter({ type: "mdxTextExpression", value: "" }, token); + this.buffer(); +} +function exitMdxExpression(token) { + const value = this.resume(); + const estree = token.estree; + const node = this.exit(token); + node.value = value; + if (estree) { + node.data = { estree }; + } +} +function exitMdxExpressionData(token) { + this.config.enter.data.call(this, token); + this.config.exit.data.call(this, token); +} +function handleMdxExpression(node) { + const value = node.value || ""; + return "{" + value + "}"; +} + +// node_modules/mdast-util-mdx-jsx/node_modules/ccount/index.js +function ccount(value, character) { + const source = String(value); + if (typeof character !== "string") { + throw new TypeError("Expected character"); + } + let count = 0; + let index2 = source.indexOf(character); + while (index2 !== -1) { + count++; + index2 = source.indexOf(character, index2 + character.length); + } + return count; +} + +// node_modules/parse-entities/node_modules/character-entities-legacy/index.js +var characterEntitiesLegacy = [ + "AElig", + "AMP", + "Aacute", + "Acirc", + "Agrave", + "Aring", + "Atilde", + "Auml", + "COPY", + "Ccedil", + "ETH", + "Eacute", + "Ecirc", + "Egrave", + "Euml", + "GT", + "Iacute", + "Icirc", + "Igrave", + "Iuml", + "LT", + "Ntilde", + "Oacute", + "Ocirc", + "Ograve", + "Oslash", + "Otilde", + "Ouml", + "QUOT", + "REG", + "THORN", + "Uacute", + "Ucirc", + "Ugrave", + "Uuml", + "Yacute", + "aacute", + "acirc", + "acute", + "aelig", + "agrave", + "amp", + "aring", + "atilde", + "auml", + "brvbar", + "ccedil", + "cedil", + "cent", + "copy", + "curren", + "deg", + "divide", + "eacute", + "ecirc", + "egrave", + "eth", + "euml", + "frac12", + "frac14", + "frac34", + "gt", + "iacute", + "icirc", + "iexcl", + "igrave", + "iquest", + "iuml", + "laquo", + "lt", + "macr", + "micro", + "middot", + "nbsp", + "not", + "ntilde", + "oacute", + "ocirc", + "ograve", + "ordf", + "ordm", + "oslash", + "otilde", + "ouml", + "para", + "plusmn", + "pound", + "quot", + "raquo", + "reg", + "sect", + "shy", + "sup1", + "sup2", + "sup3", + "szlig", + "thorn", + "times", + "uacute", + "ucirc", + "ugrave", + "uml", + "uuml", + "yacute", + "yen", + "yuml" +]; + +// node_modules/character-reference-invalid/index.js +var characterReferenceInvalid = { + 0: "\uFFFD", + 128: "\u20AC", + 130: "\u201A", + 131: "\u0192", + 132: "\u201E", + 133: "\u2026", + 134: "\u2020", + 135: "\u2021", + 136: "\u02C6", + 137: "\u2030", + 138: "\u0160", + 139: "\u2039", + 140: "\u0152", + 142: "\u017D", + 145: "\u2018", + 146: "\u2019", + 147: "\u201C", + 148: "\u201D", + 149: "\u2022", + 150: "\u2013", + 151: "\u2014", + 152: "\u02DC", + 153: "\u2122", + 154: "\u0161", + 155: "\u203A", + 156: "\u0153", + 158: "\u017E", + 159: "\u0178" +}; + +// node_modules/parse-entities/node_modules/is-decimal/index.js +function isDecimal(character) { + const code = typeof character === "string" ? character.charCodeAt(0) : character; + return code >= 48 && code <= 57; +} + +// node_modules/is-hexadecimal/index.js +function isHexadecimal(character) { + const code = typeof character === "string" ? character.charCodeAt(0) : character; + return code >= 97 && code <= 102 || code >= 65 && code <= 70 || code >= 48 && code <= 57; +} + +// node_modules/is-alphanumerical/node_modules/is-alphabetical/index.js +function isAlphabetical(character) { + const code = typeof character === "string" ? character.charCodeAt(0) : character; + return code >= 97 && code <= 122 || code >= 65 && code <= 90; +} + +// node_modules/is-alphanumerical/node_modules/is-decimal/index.js +function isDecimal2(character) { + const code = typeof character === "string" ? character.charCodeAt(0) : character; + return code >= 48 && code <= 57; +} + +// node_modules/is-alphanumerical/index.js +function isAlphanumerical(character) { + return isAlphabetical(character) || isDecimal2(character); +} + +// node_modules/parse-entities/lib/index.js +var fromCharCode = String.fromCharCode; +var messages = [ + "", + "Named character references must be terminated by a semicolon", + "Numeric character references must be terminated by a semicolon", + "Named character references cannot be empty", + "Numeric character references cannot be empty", + "Named character references must be known", + "Numeric character references cannot be disallowed", + "Numeric character references cannot be outside the permissible Unicode range" +]; +function parseEntities(value, options = {}) { + const additional = typeof options.additional === "string" ? options.additional.charCodeAt(0) : options.additional; + const result = []; + let index2 = 0; + let lines = -1; + let queue = ""; + let point2; + let indent; + if (options.position) { + if ("start" in options.position || "indent" in options.position) { + indent = options.position.indent; + point2 = options.position.start; + } else { + point2 = options.position; + } + } + let line = (point2 ? point2.line : 0) || 1; + let column = (point2 ? point2.column : 0) || 1; + let previous = now(); + let character; + index2--; + while (++index2 <= value.length) { + if (character === 10) { + column = (indent ? indent[lines] : 0) || 1; + } + character = value.charCodeAt(index2); + if (character === 38) { + const following = value.charCodeAt(index2 + 1); + if (following === 9 || following === 10 || following === 12 || following === 32 || following === 38 || following === 60 || Number.isNaN(following) || additional && following === additional) { + queue += fromCharCode(character); + column++; + continue; + } + const start3 = index2 + 1; + let begin = start3; + let end = start3; + let type; + if (following === 35) { + end = ++begin; + const following2 = value.charCodeAt(end); + if (following2 === 88 || following2 === 120) { + type = "hexadecimal"; + end = ++begin; + } else { + type = "decimal"; + } + } else { + type = "named"; + } + let characterReferenceCharacters = ""; + let characterReference = ""; + let characters = ""; + const test = type === "named" ? isAlphanumerical : type === "decimal" ? isDecimal : isHexadecimal; + end--; + while (++end <= value.length) { + const following2 = value.charCodeAt(end); + if (!test(following2)) { + break; + } + characters += fromCharCode(following2); + if (type === "named" && characterEntitiesLegacy.includes(characters)) { + characterReferenceCharacters = characters; + characterReference = decodeNamedCharacterReference(characters); + } + } + let terminated = value.charCodeAt(end) === 59; + if (terminated) { + end++; + const namedReference = type === "named" ? decodeNamedCharacterReference(characters) : false; + if (namedReference) { + characterReferenceCharacters = characters; + characterReference = namedReference; + } + } + let diff = 1 + end - start3; + let reference = ""; + if (!terminated && options.nonTerminated === false) { + } else if (!characters) { + if (type !== "named") { + warning(4, diff); + } + } else if (type === "named") { + if (terminated && !characterReference) { + warning(5, 1); + } else { + if (characterReferenceCharacters !== characters) { + end = begin + characterReferenceCharacters.length; + diff = 1 + end - begin; + terminated = false; + } + if (!terminated) { + const reason = characterReferenceCharacters ? 1 : 3; + if (options.attribute) { + const following2 = value.charCodeAt(end); + if (following2 === 61) { + warning(reason, diff); + characterReference = ""; + } else if (isAlphanumerical(following2)) { + characterReference = ""; + } else { + warning(reason, diff); + } + } else { + warning(reason, diff); + } + } + } + reference = characterReference; + } else { + if (!terminated) { + warning(2, diff); + } + let referenceCode = Number.parseInt( + characters, + type === "hexadecimal" ? 16 : 10 + ); + if (prohibited(referenceCode)) { + warning(7, diff); + reference = fromCharCode(65533); + } else if (referenceCode in characterReferenceInvalid) { + warning(6, diff); + reference = characterReferenceInvalid[referenceCode]; + } else { + let output = ""; + if (disallowed(referenceCode)) { + warning(6, diff); + } + if (referenceCode > 65535) { + referenceCode -= 65536; + output += fromCharCode(referenceCode >>> (10 & 1023) | 55296); + referenceCode = 56320 | referenceCode & 1023; + } + reference = output + fromCharCode(referenceCode); + } + } + if (reference) { + flush(); + previous = now(); + index2 = end - 1; + column += end - start3 + 1; + result.push(reference); + const next = now(); + next.offset++; + if (options.reference) { + options.reference.call( + options.referenceContext, + reference, + { start: previous, end: next }, + value.slice(start3 - 1, end) + ); + } + previous = next; + } else { + characters = value.slice(start3 - 1, end); + queue += characters; + column += characters.length; + index2 = end - 1; + } + } else { + if (character === 10) { + line++; + lines++; + column = 0; + } + if (Number.isNaN(character)) { + flush(); + } else { + queue += fromCharCode(character); + column++; + } + } + } + return result.join(""); + function now() { + return { + line, + column, + offset: index2 + ((point2 ? point2.offset : 0) || 0) + }; + } + function warning(code, offset2) { + let position2; + if (options.warning) { + position2 = now(); + position2.column += offset2; + position2.offset += offset2; + options.warning.call( + options.warningContext, + messages[code], + position2, + code + ); + } + } + function flush() { + if (queue) { + result.push(queue); + if (options.text) { + options.text.call(options.textContext, queue, { + start: previous, + end: now() + }); + } + queue = ""; + } + } +} +function prohibited(code) { + return code >= 55296 && code <= 57343 || code > 1114111; +} +function disallowed(code) { + return code >= 1 && code <= 8 || code === 11 || code >= 13 && code <= 31 || code >= 127 && code <= 159 || code >= 64976 && code <= 65007 || (code & 65535) === 65535 || (code & 65535) === 65534; +} + +// node_modules/mdast-util-mdx-jsx/node_modules/stringify-entities/lib/core.js +function core(value, options) { + value = value.replace( + options.subset ? charactersToExpression(options.subset) : /["&'<>`]/g, + basic + ); + if (options.subset || options.escapeOnly) { + return value; + } + return value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, surrogate).replace( + /[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g, + basic + ); + function surrogate(pair, index2, all) { + return options.format( + (pair.charCodeAt(0) - 55296) * 1024 + pair.charCodeAt(1) - 56320 + 65536, + all.charCodeAt(index2 + 2), + options + ); + } + function basic(character, index2, all) { + return options.format( + character.charCodeAt(0), + all.charCodeAt(index2 + 1), + options + ); + } +} +function charactersToExpression(subset) { + const groups = []; + let index2 = -1; + while (++index2 < subset.length) { + groups.push(subset[index2].replace(/[|\\{}()[\]^$+*?.]/g, "\\$&")); + } + return new RegExp("(?:" + groups.join("|") + ")", "g"); +} + +// node_modules/mdast-util-mdx-jsx/node_modules/stringify-entities/lib/util/format-basic.js +function formatBasic(code) { + return "&#x" + code.toString(16).toUpperCase() + ";"; +} + +// node_modules/mdast-util-mdx-jsx/node_modules/stringify-entities/lib/index.js +function stringifyEntitiesLight(value, options) { + return core(value, Object.assign({ format: formatBasic }, options)); +} + +// node_modules/mdast-util-to-markdown/lib/util/track.js +function track(options_) { + const options = options_ || {}; + const now = options.now || {}; + let lineShift = options.lineShift || 0; + let line = now.line || 1; + let column = now.column || 1; + return { move, current: current2, shift }; + function current2() { + return { now: { line, column }, lineShift }; + } + function shift(value) { + lineShift += value; + } + function move(value = "") { + const chunks = value.split(/\r?\n|\r/g); + const tail = chunks[chunks.length - 1]; + line += chunks.length - 1; + column = chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift; + return value; + } +} + +// node_modules/mdast-util-to-markdown/lib/util/container-flow.js +function containerFlow(parent, context, safeOptions) { + const indexStack = context.indexStack; + const children = parent.children || []; + const tracker = track(safeOptions); + const results = []; + let index2 = -1; + indexStack.push(-1); + while (++index2 < children.length) { + const child = children[index2]; + indexStack[indexStack.length - 1] = index2; + results.push( + tracker.move( + context.handle(child, parent, context, { + before: "\n", + after: "\n", + ...tracker.current() + }) + ) + ); + if (child.type !== "list") { + context.bulletLastUsed = void 0; + } + if (index2 < children.length - 1) { + results.push(tracker.move(between(child, children[index2 + 1]))); + } + } + indexStack.pop(); + return results.join(""); + function between(left, right) { + let index3 = context.join.length; + while (index3--) { + const result = context.join[index3](left, right, parent, context); + if (result === true || result === 1) { + break; + } + if (typeof result === "number") { + return "\n".repeat(1 + result); + } + if (result === false) { + return "\n\n\n\n"; + } + } + return "\n\n"; + } +} + +// node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +function containerPhrasing(parent, context, safeOptions) { + const indexStack = context.indexStack; + const children = parent.children || []; + const results = []; + let index2 = -1; + let before = safeOptions.before; + indexStack.push(-1); + let tracker = track(safeOptions); + while (++index2 < children.length) { + const child = children[index2]; + let after; + indexStack[indexStack.length - 1] = index2; + if (index2 + 1 < children.length) { + let handle = context.handle.handlers[children[index2 + 1].type]; + if (handle && handle.peek) + handle = handle.peek; + after = handle ? handle(children[index2 + 1], parent, context, { + before: "", + after: "", + ...tracker.current() + }).charAt(0) : ""; + } else { + after = safeOptions.after; + } + if (results.length > 0 && (before === "\r" || before === "\n") && child.type === "html") { + results[results.length - 1] = results[results.length - 1].replace( + /(\r?\n|\r)$/, + " " + ); + before = " "; + tracker = track(safeOptions); + tracker.move(results.join("")); + } + results.push( + tracker.move( + context.handle(child, parent, context, { + ...tracker.current(), + before, + after + }) + ) + ); + before = results[results.length - 1].slice(-1); + } + indexStack.pop(); + return results.join(""); +} + +// node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +var eol = /\r?\n|\r/g; +function indentLines(value, map) { + const result = []; + let start3 = 0; + let line = 0; + let match; + while (match = eol.exec(value)) { + one(value.slice(start3, match.index)); + result.push(match[0]); + start3 = match.index + match[0].length; + line++; + } + one(value.slice(start3)); + return result.join(""); + function one(value2) { + result.push(map(value2, line, !value2)); + } +} + +// node_modules/mdast-util-mdx-jsx/lib/index.js +function mdxJsxFromMarkdown() { + return { + canContainEols: ["mdxJsxTextElement"], + enter: { + mdxJsxFlowTag: enterMdxJsxTag, + mdxJsxFlowTagClosingMarker: enterMdxJsxTagClosingMarker, + mdxJsxFlowTagAttribute: enterMdxJsxTagAttribute, + mdxJsxFlowTagExpressionAttribute: enterMdxJsxTagExpressionAttribute, + mdxJsxFlowTagAttributeValueLiteral: buffer, + mdxJsxFlowTagAttributeValueExpression: buffer, + mdxJsxFlowTagSelfClosingMarker: enterMdxJsxTagSelfClosingMarker, + mdxJsxTextTag: enterMdxJsxTag, + mdxJsxTextTagClosingMarker: enterMdxJsxTagClosingMarker, + mdxJsxTextTagAttribute: enterMdxJsxTagAttribute, + mdxJsxTextTagExpressionAttribute: enterMdxJsxTagExpressionAttribute, + mdxJsxTextTagAttributeValueLiteral: buffer, + mdxJsxTextTagAttributeValueExpression: buffer, + mdxJsxTextTagSelfClosingMarker: enterMdxJsxTagSelfClosingMarker + }, + exit: { + mdxJsxFlowTagClosingMarker: exitMdxJsxTagClosingMarker, + mdxJsxFlowTagNamePrimary: exitMdxJsxTagNamePrimary, + mdxJsxFlowTagNameMember: exitMdxJsxTagNameMember, + mdxJsxFlowTagNameLocal: exitMdxJsxTagNameLocal, + mdxJsxFlowTagExpressionAttribute: exitMdxJsxTagExpressionAttribute, + mdxJsxFlowTagExpressionAttributeValue: data2, + mdxJsxFlowTagAttributeNamePrimary: exitMdxJsxTagAttributeNamePrimary, + mdxJsxFlowTagAttributeNameLocal: exitMdxJsxTagAttributeNameLocal, + mdxJsxFlowTagAttributeValueLiteral: exitMdxJsxTagAttributeValueLiteral, + mdxJsxFlowTagAttributeValueLiteralValue: data2, + mdxJsxFlowTagAttributeValueExpression: exitMdxJsxTagAttributeValueExpression, + mdxJsxFlowTagAttributeValueExpressionValue: data2, + mdxJsxFlowTagSelfClosingMarker: exitMdxJsxTagSelfClosingMarker, + mdxJsxFlowTag: exitMdxJsxTag, + mdxJsxTextTagClosingMarker: exitMdxJsxTagClosingMarker, + mdxJsxTextTagNamePrimary: exitMdxJsxTagNamePrimary, + mdxJsxTextTagNameMember: exitMdxJsxTagNameMember, + mdxJsxTextTagNameLocal: exitMdxJsxTagNameLocal, + mdxJsxTextTagExpressionAttribute: exitMdxJsxTagExpressionAttribute, + mdxJsxTextTagExpressionAttributeValue: data2, + mdxJsxTextTagAttributeNamePrimary: exitMdxJsxTagAttributeNamePrimary, + mdxJsxTextTagAttributeNameLocal: exitMdxJsxTagAttributeNameLocal, + mdxJsxTextTagAttributeValueLiteral: exitMdxJsxTagAttributeValueLiteral, + mdxJsxTextTagAttributeValueLiteralValue: data2, + mdxJsxTextTagAttributeValueExpression: exitMdxJsxTagAttributeValueExpression, + mdxJsxTextTagAttributeValueExpressionValue: data2, + mdxJsxTextTagSelfClosingMarker: exitMdxJsxTagSelfClosingMarker, + mdxJsxTextTag: exitMdxJsxTag + } + }; + function buffer() { + this.buffer(); + } + function data2(token) { + this.config.enter.data.call(this, token); + this.config.exit.data.call(this, token); + } + function enterMdxJsxTag(token) { + const tag = { name: null, attributes: [], start: token.start, end: token.end }; + if (!this.getData("mdxJsxTagStack")) + this.setData("mdxJsxTagStack", []); + this.setData("mdxJsxTag", tag); + this.buffer(); + } + function enterMdxJsxTagClosingMarker(token) { + const stack = this.getData("mdxJsxTagStack"); + if (stack.length === 0) { + throw new VFileMessage( + "Unexpected closing slash `/` in tag, expected an open tag first", + { start: token.start, end: token.end }, + "mdast-util-mdx-jsx:unexpected-closing-slash" + ); + } + } + function enterMdxJsxTagAnyAttribute(token) { + const tag = this.getData("mdxJsxTag"); + if (tag.close) { + throw new VFileMessage( + "Unexpected attribute in closing tag, expected the end of the tag", + { start: token.start, end: token.end }, + "mdast-util-mdx-jsx:unexpected-attribute" + ); + } + } + function enterMdxJsxTagSelfClosingMarker(token) { + const tag = this.getData("mdxJsxTag"); + if (tag.close) { + throw new VFileMessage( + "Unexpected self-closing slash `/` in closing tag, expected the end of the tag", + { start: token.start, end: token.end }, + "mdast-util-mdx-jsx:unexpected-self-closing-slash" + ); + } + } + function exitMdxJsxTagClosingMarker() { + const tag = this.getData("mdxJsxTag"); + tag.close = true; + } + function exitMdxJsxTagNamePrimary(token) { + const tag = this.getData("mdxJsxTag"); + tag.name = this.sliceSerialize(token); + } + function exitMdxJsxTagNameMember(token) { + const tag = this.getData("mdxJsxTag"); + tag.name += "." + this.sliceSerialize(token); + } + function exitMdxJsxTagNameLocal(token) { + const tag = this.getData("mdxJsxTag"); + tag.name += ":" + this.sliceSerialize(token); + } + function enterMdxJsxTagAttribute(token) { + const tag = this.getData("mdxJsxTag"); + enterMdxJsxTagAnyAttribute.call(this, token); + tag.attributes.push({ type: "mdxJsxAttribute", name: "", value: null }); + } + function enterMdxJsxTagExpressionAttribute(token) { + const tag = this.getData("mdxJsxTag"); + enterMdxJsxTagAnyAttribute.call(this, token); + tag.attributes.push({ type: "mdxJsxExpressionAttribute", value: "" }); + this.buffer(); + } + function exitMdxJsxTagExpressionAttribute(token) { + const tag = this.getData("mdxJsxTag"); + const tail = tag.attributes[tag.attributes.length - 1]; + const estree = token.estree; + tail.value = this.resume(); + if (estree) { + tail.data = { estree }; + } + } + function exitMdxJsxTagAttributeNamePrimary(token) { + const tag = this.getData("mdxJsxTag"); + const node = tag.attributes[tag.attributes.length - 1]; + node.name = this.sliceSerialize(token); + } + function exitMdxJsxTagAttributeNameLocal(token) { + const tag = this.getData("mdxJsxTag"); + const node = tag.attributes[tag.attributes.length - 1]; + node.name += ":" + this.sliceSerialize(token); + } + function exitMdxJsxTagAttributeValueLiteral() { + const tag = this.getData("mdxJsxTag"); + tag.attributes[tag.attributes.length - 1].value = parseEntities( + this.resume(), + { nonTerminated: false } + ); + } + function exitMdxJsxTagAttributeValueExpression(token) { + const tag = this.getData("mdxJsxTag"); + const tail = tag.attributes[tag.attributes.length - 1]; + const node = { type: "mdxJsxAttributeValueExpression", value: this.resume() }; + const estree = token.estree; + if (estree) { + node.data = { estree }; + } + tail.value = node; + } + function exitMdxJsxTagSelfClosingMarker() { + const tag = this.getData("mdxJsxTag"); + tag.selfClosing = true; + } + function exitMdxJsxTag(token) { + const tag = this.getData("mdxJsxTag"); + const stack = this.getData("mdxJsxTagStack"); + const tail = stack[stack.length - 1]; + if (tag.close && tail.name !== tag.name) { + throw new VFileMessage( + "Unexpected closing tag `" + serializeAbbreviatedTag(tag) + "`, expected corresponding closing tag for `" + serializeAbbreviatedTag(tail) + "` (" + stringifyPosition(tail) + ")", + { start: token.start, end: token.end }, + "mdast-util-mdx-jsx:end-tag-mismatch" + ); + } + this.resume(); + if (tag.close) { + stack.pop(); + } else { + this.enter( + { + type: token.type === "mdxJsxTextTag" ? "mdxJsxTextElement" : "mdxJsxFlowElement", + name: tag.name, + attributes: tag.attributes, + children: [] + }, + token, + onErrorRightIsTag + ); + } + if (tag.selfClosing || tag.close) { + this.exit(token, onErrorLeftIsTag); + } else { + stack.push(tag); + } + } + function onErrorRightIsTag(closing, open) { + const tag = this.getData("mdxJsxTag"); + const place = closing ? " before the end of `" + closing.type + "`" : ""; + const position2 = closing ? { start: closing.start, end: closing.end } : void 0; + throw new VFileMessage( + "Expected a closing tag for `" + serializeAbbreviatedTag(tag) + "` (" + stringifyPosition({ start: open.start, end: open.end }) + ")" + place, + position2, + "mdast-util-mdx-jsx:end-tag-mismatch" + ); + } + function onErrorLeftIsTag(a, b) { + const tag = this.getData("mdxJsxTag"); + throw new VFileMessage( + "Expected the closing tag `" + serializeAbbreviatedTag(tag) + "` either after the end of `" + b.type + "` (" + stringifyPosition(b.end) + ") or another opening tag after the start of `" + b.type + "` (" + stringifyPosition(b.start) + ")", + { start: a.start, end: a.end }, + "mdast-util-mdx-jsx:end-tag-mismatch" + ); + } + function serializeAbbreviatedTag(tag) { + return "<" + (tag.close ? "/" : "") + (tag.name || "") + ">"; + } +} +function mdxJsxToMarkdown(options = {}) { + const { + quote = '"', + quoteSmart, + tightSelfClosing, + printWidth = Number.POSITIVE_INFINITY + } = options; + const alternative = quote === '"' ? "'" : '"'; + if (quote !== '"' && quote !== "'") { + throw new Error( + "Cannot serialize attribute values with `" + quote + "` for `options.quote`, expected `\"`, or `'`" + ); + } + mdxElement.peek = peekElement; + return { + handlers: { + mdxJsxFlowElement: mdxElement, + mdxJsxTextElement: mdxElement + }, + unsafe: [ + { character: "<", inConstruct: ["phrasing"] }, + { atBreak: true, character: "<" } + ], + fences: true, + resourceLink: true + }; + function mdxElement(node, _, context, safeOptions) { + const tracker = track(safeOptions); + const selfClosing = node.name && (!node.children || node.children.length === 0); + const exit = context.enter(node.type); + let index2 = -1; + const serializedAttributes = []; + let value = tracker.move("<" + (node.name || "")); + if (node.attributes && node.attributes.length > 0) { + if (!node.name) { + throw new Error("Cannot serialize fragment w/ attributes"); + } + while (++index2 < node.attributes.length) { + const attribute = node.attributes[index2]; + let result; + if (attribute.type === "mdxJsxExpressionAttribute") { + result = "{" + (attribute.value || "") + "}"; + } else { + if (!attribute.name) { + throw new Error("Cannot serialize attribute w/o name"); + } + const value2 = attribute.value; + const left = attribute.name; + let right = ""; + if (value2 === void 0 || value2 === null) { + } else if (typeof value2 === "object") { + right = "{" + (value2.value || "") + "}"; + } else { + const appliedQuote = quoteSmart && ccount(value2, quote) > ccount(value2, alternative) ? alternative : quote; + right = appliedQuote + stringifyEntitiesLight(value2, { subset: [appliedQuote] }) + appliedQuote; + } + result = left + (right ? "=" : "") + right; + } + serializedAttributes.push(result); + } + } + let attributesOnTheirOwnLine = false; + const attributesOnOneLine = serializedAttributes.join(" "); + if (node.type === "mdxJsxFlowElement" && (/\r?\n|\r/.test(attributesOnOneLine) || tracker.current().now.column + attributesOnOneLine.length + (selfClosing ? tightSelfClosing ? 2 : 3 : 1) > printWidth)) { + attributesOnTheirOwnLine = true; + } + if (attributesOnTheirOwnLine) { + value += tracker.move( + "\n" + indentLines(serializedAttributes.join("\n"), map) + ); + } else if (attributesOnOneLine) { + value += tracker.move(" " + attributesOnOneLine); + } + if (attributesOnTheirOwnLine) { + value += tracker.move("\n"); + } + if (selfClosing) { + value += tracker.move( + (tightSelfClosing || attributesOnTheirOwnLine ? "" : " ") + "/" + ); + } + value += tracker.move(">"); + if (node.children && node.children.length > 0) { + if (node.type === "mdxJsxFlowElement") { + tracker.shift(2); + value += tracker.move("\n"); + value += tracker.move( + indentLines(containerFlow(node, context, tracker.current()), map) + ); + value += tracker.move("\n"); + } else { + value += tracker.move( + containerPhrasing(node, context, { + ...tracker.current(), + before: "<", + after: ">" + }) + ); + } + } + if (!selfClosing) { + value += tracker.move(""); + } + exit(); + return value; + } + function map(line, _, blank) { + return (blank ? "" : " ") + line; + } + function peekElement() { + return "<"; + } +} + +// node_modules/mdast-util-mdxjs-esm/index.js +var mdxjsEsmFromMarkdown = { + enter: { mdxjsEsm: enterMdxjsEsm }, + exit: { mdxjsEsm: exitMdxjsEsm, mdxjsEsmData: exitMdxjsEsmData } +}; +var mdxjsEsmToMarkdown = { handlers: { mdxjsEsm: handleMdxjsEsm } }; +function enterMdxjsEsm(token) { + this.enter({ type: "mdxjsEsm", value: "" }, token); + this.buffer(); +} +function exitMdxjsEsm(token) { + const value = this.resume(); + const node = this.exit(token); + const estree = token.estree; + node.value = value; + if (estree) { + node.data = { estree }; + } +} +function exitMdxjsEsmData(token) { + this.config.enter.data.call(this, token); + this.config.exit.data.call(this, token); +} +function handleMdxjsEsm(node) { + return node.value || ""; +} + +// node_modules/mdast-util-mdx/index.js +function mdxFromMarkdown() { + return [mdxExpressionFromMarkdown, mdxJsxFromMarkdown(), mdxjsEsmFromMarkdown]; +} +function mdxToMarkdown(options) { + return { + extensions: [ + mdxExpressionToMarkdown, + mdxJsxToMarkdown(options), + mdxjsEsmToMarkdown + ] + }; +} + +// node_modules/remark-mdx/index.js +function remarkMdx(options = {}) { + const data2 = this.data(); + add("micromarkExtensions", mdxjs(options)); + add("fromMarkdownExtensions", mdxFromMarkdown()); + add("toMarkdownExtensions", mdxToMarkdown(options)); + function add(field, value) { + const list = data2[field] ? data2[field] : data2[field] = []; + list.push(value); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = {}); diff --git a/jest/vendor/remark@14.0.2.js b/jest/vendor/remark@14.0.2.js new file mode 100644 index 000000000000..026f2b701984 --- /dev/null +++ b/jest/vendor/remark@14.0.2.js @@ -0,0 +1,8908 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all2) => { + for (var name in all2) + __defProp(target, name, { get: all2[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/is-buffer/index.js +var require_is_buffer = __commonJS({ + "node_modules/is-buffer/index.js"(exports, module2) { + module2.exports = function isBuffer2(obj) { + return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj); + }; + } +}); + +// node_modules/extend/index.js +var require_extend = __commonJS({ + "node_modules/extend/index.js"(exports, module2) { + "use strict"; + var hasOwn = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + var defineProperty = Object.defineProperty; + var gOPD = Object.getOwnPropertyDescriptor; + var isArray = function isArray2(arr) { + if (typeof Array.isArray === "function") { + return Array.isArray(arr); + } + return toStr.call(arr) === "[object Array]"; + }; + var isPlainObject2 = function isPlainObject3(obj) { + if (!obj || toStr.call(obj) !== "[object Object]") { + return false; + } + var hasOwnConstructor = hasOwn.call(obj, "constructor"); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf"); + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + var key; + for (key in obj) { + } + return typeof key === "undefined" || hasOwn.call(obj, key); + }; + var setProperty = function setProperty2(target, options) { + if (defineProperty && options.name === "__proto__") { + defineProperty(target, options.name, { + enumerable: true, + configurable: true, + value: options.newValue, + writable: true + }); + } else { + target[options.name] = options.newValue; + } + }; + var getProperty = function getProperty2(obj, name) { + if (name === "__proto__") { + if (!hasOwn.call(obj, name)) { + return void 0; + } else if (gOPD) { + return gOPD(obj, name).value; + } + } + return obj[name]; + }; + module2.exports = function extend2() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + if (typeof target === "boolean") { + deep = target; + target = arguments[1] || {}; + i = 2; + } + if (target == null || typeof target !== "object" && typeof target !== "function") { + target = {}; + } + for (; i < length; ++i) { + options = arguments[i]; + if (options != null) { + for (name in options) { + src = getProperty(target, name); + copy = getProperty(options, name); + if (target !== copy) { + if (deep && copy && (isPlainObject2(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject2(src) ? src : {}; + } + setProperty(target, { name, newValue: extend2(deep, clone, copy) }); + } else if (typeof copy !== "undefined") { + setProperty(target, { name, newValue: copy }); + } + } + } + } + } + return target; + }; + } +}); + +// node_modules/remark/index.js +var remark_exports = {}; +__export(remark_exports, { + remark: () => remark1402 +}); +module.exports = __toCommonJS(remark_exports); + +// node_modules/remark/node_modules/bail/index.js +function bail(error) { + if (error) { + throw error; + } +} + +// node_modules/remark/node_modules/unified/lib/index.js +var import_is_buffer2 = __toESM(require_is_buffer(), 1); +var import_extend = __toESM(require_extend(), 1); + +// node_modules/remark/node_modules/is-plain-obj/index.js +function isPlainObject(value) { + if (typeof value !== "object" || value === null) { + return false; + } + const prototype = Object.getPrototypeOf(value); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); +} + +// node_modules/remark/node_modules/trough/index.js +function trough() { + const fns = []; + const pipeline = { run, use }; + return pipeline; + function run(...values) { + let middlewareIndex = -1; + const callback = values.pop(); + if (typeof callback !== "function") { + throw new TypeError("Expected function as last argument, not " + callback); + } + next(null, ...values); + function next(error, ...output) { + const fn = fns[++middlewareIndex]; + let index2 = -1; + if (error) { + callback(error); + return; + } + while (++index2 < values.length) { + if (output[index2] === null || output[index2] === void 0) { + output[index2] = values[index2]; + } + } + values = output; + if (fn) { + wrap(fn, next)(...output); + } else { + callback(null, ...output); + } + } + } + function use(middelware) { + if (typeof middelware !== "function") { + throw new TypeError( + "Expected `middelware` to be a function, not " + middelware + ); + } + fns.push(middelware); + return pipeline; + } +} +function wrap(middleware, callback) { + let called; + return wrapped; + function wrapped(...parameters) { + const fnExpectsCallback = middleware.length > parameters.length; + let result; + if (fnExpectsCallback) { + parameters.push(done); + } + try { + result = middleware.apply(this, parameters); + } catch (error) { + const exception = error; + if (fnExpectsCallback && called) { + throw exception; + } + return done(exception); + } + if (!fnExpectsCallback) { + if (result instanceof Promise) { + result.then(then, done); + } else if (result instanceof Error) { + done(result); + } else { + then(result); + } + } + } + function done(error, ...output) { + if (!called) { + called = true; + callback(error, ...output); + } + } + function then(value) { + done(null, value); + } +} + +// node_modules/vfile/lib/index.js +var import_is_buffer = __toESM(require_is_buffer(), 1); + +// node_modules/unist-util-stringify-position/index.js +function stringifyPosition(value) { + if (!value || typeof value !== "object") { + return ""; + } + if ("position" in value || "type" in value) { + return position(value.position); + } + if ("start" in value || "end" in value) { + return position(value); + } + if ("line" in value || "column" in value) { + return point(value); + } + return ""; +} +function point(point2) { + return index(point2 && point2.line) + ":" + index(point2 && point2.column); +} +function position(pos) { + return point(pos && pos.start) + "-" + point(pos && pos.end); +} +function index(value) { + return value && typeof value === "number" ? value : 1; +} + +// node_modules/vfile-message/index.js +var VFileMessage = class extends Error { + constructor(reason, place, origin) { + const parts = [null, null]; + let position2 = { + start: { line: null, column: null }, + end: { line: null, column: null } + }; + super(); + if (typeof place === "string") { + origin = place; + place = void 0; + } + if (typeof origin === "string") { + const index2 = origin.indexOf(":"); + if (index2 === -1) { + parts[1] = origin; + } else { + parts[0] = origin.slice(0, index2); + parts[1] = origin.slice(index2 + 1); + } + } + if (place) { + if ("type" in place || "position" in place) { + if (place.position) { + position2 = place.position; + } + } else if ("start" in place || "end" in place) { + position2 = place; + } else if ("line" in place || "column" in place) { + position2.start = place; + } + } + this.name = stringifyPosition(place) || "1:1"; + this.message = typeof reason === "object" ? reason.message : reason; + this.stack = typeof reason === "object" ? reason.stack : ""; + this.reason = this.message; + this.fatal; + this.line = position2.start.line; + this.column = position2.start.column; + this.source = parts[0]; + this.ruleId = parts[1]; + this.position = position2; + this.actual; + this.expected; + this.file; + this.url; + this.note; + } +}; +VFileMessage.prototype.file = ""; +VFileMessage.prototype.name = ""; +VFileMessage.prototype.reason = ""; +VFileMessage.prototype.message = ""; +VFileMessage.prototype.stack = ""; +VFileMessage.prototype.fatal = null; +VFileMessage.prototype.column = null; +VFileMessage.prototype.line = null; +VFileMessage.prototype.source = null; +VFileMessage.prototype.ruleId = null; +VFileMessage.prototype.position = null; + +// node_modules/vfile/lib/minpath.js +var import_path = __toESM(require("path"), 1); + +// node_modules/vfile/lib/minproc.js +var import_process = __toESM(require("process"), 1); + +// node_modules/vfile/lib/minurl.js +var import_url = require("url"); + +// node_modules/vfile/lib/minurl.shared.js +function isUrl(fileURLOrPath) { + return fileURLOrPath !== null && typeof fileURLOrPath === "object" && fileURLOrPath.href && fileURLOrPath.origin; +} + +// node_modules/vfile/lib/index.js +var order = ["history", "path", "basename", "stem", "extname", "dirname"]; +var VFile = class { + constructor(value) { + let options; + if (!value) { + options = {}; + } else if (typeof value === "string" || (0, import_is_buffer.default)(value)) { + options = { value }; + } else if (isUrl(value)) { + options = { path: value }; + } else { + options = value; + } + this.data = {}; + this.messages = []; + this.history = []; + this.cwd = import_process.default.cwd(); + this.value; + this.stored; + this.result; + this.map; + let index2 = -1; + while (++index2 < order.length) { + const prop2 = order[index2]; + if (prop2 in options && options[prop2] !== void 0) { + this[prop2] = prop2 === "history" ? [...options[prop2]] : options[prop2]; + } + } + let prop; + for (prop in options) { + if (!order.includes(prop)) + this[prop] = options[prop]; + } + } + get path() { + return this.history[this.history.length - 1]; + } + set path(path) { + if (isUrl(path)) { + path = (0, import_url.fileURLToPath)(path); + } + assertNonEmpty(path, "path"); + if (this.path !== path) { + this.history.push(path); + } + } + get dirname() { + return typeof this.path === "string" ? import_path.default.dirname(this.path) : void 0; + } + set dirname(dirname) { + assertPath(this.basename, "dirname"); + this.path = import_path.default.join(dirname || "", this.basename); + } + get basename() { + return typeof this.path === "string" ? import_path.default.basename(this.path) : void 0; + } + set basename(basename) { + assertNonEmpty(basename, "basename"); + assertPart(basename, "basename"); + this.path = import_path.default.join(this.dirname || "", basename); + } + get extname() { + return typeof this.path === "string" ? import_path.default.extname(this.path) : void 0; + } + set extname(extname) { + assertPart(extname, "extname"); + assertPath(this.dirname, "extname"); + if (extname) { + if (extname.charCodeAt(0) !== 46) { + throw new Error("`extname` must start with `.`"); + } + if (extname.includes(".", 1)) { + throw new Error("`extname` cannot contain multiple dots"); + } + } + this.path = import_path.default.join(this.dirname, this.stem + (extname || "")); + } + get stem() { + return typeof this.path === "string" ? import_path.default.basename(this.path, this.extname) : void 0; + } + set stem(stem) { + assertNonEmpty(stem, "stem"); + assertPart(stem, "stem"); + this.path = import_path.default.join(this.dirname || "", stem + (this.extname || "")); + } + toString(encoding) { + return (this.value || "").toString(encoding); + } + message(reason, place, origin) { + const message = new VFileMessage(reason, place, origin); + if (this.path) { + message.name = this.path + ":" + message.name; + message.file = this.path; + } + message.fatal = false; + this.messages.push(message); + return message; + } + info(reason, place, origin) { + const message = this.message(reason, place, origin); + message.fatal = null; + return message; + } + fail(reason, place, origin) { + const message = this.message(reason, place, origin); + message.fatal = true; + throw message; + } +}; +function assertPart(part, name) { + if (part && part.includes(import_path.default.sep)) { + throw new Error( + "`" + name + "` cannot be a path: did not expect `" + import_path.default.sep + "`" + ); + } +} +function assertNonEmpty(part, name) { + if (!part) { + throw new Error("`" + name + "` cannot be empty"); + } +} +function assertPath(path, name) { + if (!path) { + throw new Error("Setting `" + name + "` requires `path` to be set too"); + } +} + +// node_modules/remark/node_modules/unified/lib/index.js +var unified = base().freeze(); +var own = {}.hasOwnProperty; +function base() { + const transformers = trough(); + const attachers = []; + let namespace = {}; + let frozen; + let freezeIndex = -1; + processor.data = data; + processor.Parser = void 0; + processor.Compiler = void 0; + processor.freeze = freeze; + processor.attachers = attachers; + processor.use = use; + processor.parse = parse2; + processor.stringify = stringify; + processor.run = run; + processor.runSync = runSync; + processor.process = process; + processor.processSync = processSync; + return processor; + function processor() { + const destination = base(); + let index2 = -1; + while (++index2 < attachers.length) { + destination.use(...attachers[index2]); + } + destination.data((0, import_extend.default)(true, {}, namespace)); + return destination; + } + function data(key, value) { + if (typeof key === "string") { + if (arguments.length === 2) { + assertUnfrozen("data", frozen); + namespace[key] = value; + return processor; + } + return own.call(namespace, key) && namespace[key] || null; + } + if (key) { + assertUnfrozen("data", frozen); + namespace = key; + return processor; + } + return namespace; + } + function freeze() { + if (frozen) { + return processor; + } + while (++freezeIndex < attachers.length) { + const [attacher, ...options] = attachers[freezeIndex]; + if (options[0] === false) { + continue; + } + if (options[0] === true) { + options[0] = void 0; + } + const transformer = attacher.call(processor, ...options); + if (typeof transformer === "function") { + transformers.use(transformer); + } + } + frozen = true; + freezeIndex = Number.POSITIVE_INFINITY; + return processor; + } + function use(value, ...options) { + let settings; + assertUnfrozen("use", frozen); + if (value === null || value === void 0) { + } else if (typeof value === "function") { + addPlugin(value, ...options); + } else if (typeof value === "object") { + if (Array.isArray(value)) { + addList(value); + } else { + addPreset(value); + } + } else { + throw new TypeError("Expected usable value, not `" + value + "`"); + } + if (settings) { + namespace.settings = Object.assign(namespace.settings || {}, settings); + } + return processor; + function add(value2) { + if (typeof value2 === "function") { + addPlugin(value2); + } else if (typeof value2 === "object") { + if (Array.isArray(value2)) { + const [plugin, ...options2] = value2; + addPlugin(plugin, ...options2); + } else { + addPreset(value2); + } + } else { + throw new TypeError("Expected usable value, not `" + value2 + "`"); + } + } + function addPreset(result) { + addList(result.plugins); + if (result.settings) { + settings = Object.assign(settings || {}, result.settings); + } + } + function addList(plugins) { + let index2 = -1; + if (plugins === null || plugins === void 0) { + } else if (Array.isArray(plugins)) { + while (++index2 < plugins.length) { + const thing = plugins[index2]; + add(thing); + } + } else { + throw new TypeError("Expected a list of plugins, not `" + plugins + "`"); + } + } + function addPlugin(plugin, value2) { + let index2 = -1; + let entry; + while (++index2 < attachers.length) { + if (attachers[index2][0] === plugin) { + entry = attachers[index2]; + break; + } + } + if (entry) { + if (isPlainObject(entry[1]) && isPlainObject(value2)) { + value2 = (0, import_extend.default)(true, entry[1], value2); + } + entry[1] = value2; + } else { + attachers.push([...arguments]); + } + } + } + function parse2(doc) { + processor.freeze(); + const file = vfile(doc); + const Parser = processor.Parser; + assertParser("parse", Parser); + if (newable(Parser, "parse")) { + return new Parser(String(file), file).parse(); + } + return Parser(String(file), file); + } + function stringify(node, doc) { + processor.freeze(); + const file = vfile(doc); + const Compiler = processor.Compiler; + assertCompiler("stringify", Compiler); + assertNode(node); + if (newable(Compiler, "compile")) { + return new Compiler(node, file).compile(); + } + return Compiler(node, file); + } + function run(node, doc, callback) { + assertNode(node); + processor.freeze(); + if (!callback && typeof doc === "function") { + callback = doc; + doc = void 0; + } + if (!callback) { + return new Promise(executor); + } + executor(null, callback); + function executor(resolve, reject) { + transformers.run(node, vfile(doc), done); + function done(error, tree, file) { + tree = tree || node; + if (error) { + reject(error); + } else if (resolve) { + resolve(tree); + } else { + callback(null, tree, file); + } + } + } + } + function runSync(node, file) { + let result; + let complete; + processor.run(node, file, done); + assertDone("runSync", "run", complete); + return result; + function done(error, tree) { + bail(error); + result = tree; + complete = true; + } + } + function process(doc, callback) { + processor.freeze(); + assertParser("process", processor.Parser); + assertCompiler("process", processor.Compiler); + if (!callback) { + return new Promise(executor); + } + executor(null, callback); + function executor(resolve, reject) { + const file = vfile(doc); + processor.run(processor.parse(file), file, (error, tree, file2) => { + if (error || !tree || !file2) { + done(error); + } else { + const result = processor.stringify(tree, file2); + if (result === void 0 || result === null) { + } else if (looksLikeAVFileValue(result)) { + file2.value = result; + } else { + file2.result = result; + } + done(error, file2); + } + }); + function done(error, file2) { + if (error || !file2) { + reject(error); + } else if (resolve) { + resolve(file2); + } else { + callback(null, file2); + } + } + } + } + function processSync(doc) { + let complete; + processor.freeze(); + assertParser("processSync", processor.Parser); + assertCompiler("processSync", processor.Compiler); + const file = vfile(doc); + processor.process(file, done); + assertDone("processSync", "process", complete); + return file; + function done(error) { + complete = true; + bail(error); + } + } +} +function newable(value, name) { + return typeof value === "function" && value.prototype && (keys(value.prototype) || name in value.prototype); +} +function keys(value) { + let key; + for (key in value) { + if (own.call(value, key)) { + return true; + } + } + return false; +} +function assertParser(name, value) { + if (typeof value !== "function") { + throw new TypeError("Cannot `" + name + "` without `Parser`"); + } +} +function assertCompiler(name, value) { + if (typeof value !== "function") { + throw new TypeError("Cannot `" + name + "` without `Compiler`"); + } +} +function assertUnfrozen(name, frozen) { + if (frozen) { + throw new Error( + "Cannot call `" + name + "` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`." + ); + } +} +function assertNode(node) { + if (!isPlainObject(node) || typeof node.type !== "string") { + throw new TypeError("Expected node, got `" + node + "`"); + } +} +function assertDone(name, asyncName, complete) { + if (!complete) { + throw new Error( + "`" + name + "` finished async. Use `" + asyncName + "` instead" + ); + } +} +function vfile(value) { + return looksLikeAVFile(value) ? value : new VFile(value); +} +function looksLikeAVFile(value) { + return Boolean( + value && typeof value === "object" && "message" in value && "messages" in value + ); +} +function looksLikeAVFileValue(value) { + return typeof value === "string" || (0, import_is_buffer2.default)(value); +} + +// node_modules/mdast-util-to-string/index.js +function toString(node, options) { + var { includeImageAlt = true } = options || {}; + return one(node, includeImageAlt); +} +function one(node, includeImageAlt) { + return node && typeof node === "object" && (node.value || (includeImageAlt ? node.alt : "") || "children" in node && all(node.children, includeImageAlt) || Array.isArray(node) && all(node, includeImageAlt)) || ""; +} +function all(values, includeImageAlt) { + var result = []; + var index2 = -1; + while (++index2 < values.length) { + result[index2] = one(values[index2], includeImageAlt); + } + return result.join(""); +} + +// node_modules/micromark-util-chunked/index.js +function splice(list3, start, remove, items) { + const end = list3.length; + let chunkStart = 0; + let parameters; + if (start < 0) { + start = -start > end ? 0 : end + start; + } else { + start = start > end ? end : start; + } + remove = remove > 0 ? remove : 0; + if (items.length < 1e4) { + parameters = Array.from(items); + parameters.unshift(start, remove); + [].splice.apply(list3, parameters); + } else { + if (remove) + [].splice.apply(list3, [start, remove]); + while (chunkStart < items.length) { + parameters = items.slice(chunkStart, chunkStart + 1e4); + parameters.unshift(start, 0); + [].splice.apply(list3, parameters); + chunkStart += 1e4; + start += 1e4; + } + } +} +function push(list3, items) { + if (list3.length > 0) { + splice(list3, list3.length, 0, items); + return list3; + } + return items; +} + +// node_modules/micromark-util-combine-extensions/index.js +var hasOwnProperty = {}.hasOwnProperty; +function combineExtensions(extensions) { + const all2 = {}; + let index2 = -1; + while (++index2 < extensions.length) { + syntaxExtension(all2, extensions[index2]); + } + return all2; +} +function syntaxExtension(all2, extension2) { + let hook; + for (hook in extension2) { + const maybe = hasOwnProperty.call(all2, hook) ? all2[hook] : void 0; + const left = maybe || (all2[hook] = {}); + const right = extension2[hook]; + let code2; + for (code2 in right) { + if (!hasOwnProperty.call(left, code2)) + left[code2] = []; + const value = right[code2]; + constructs( + left[code2], + Array.isArray(value) ? value : value ? [value] : [] + ); + } + } +} +function constructs(existing, list3) { + let index2 = -1; + const before = []; + while (++index2 < list3.length) { + ; + (list3[index2].add === "after" ? existing : before).push(list3[index2]); + } + splice(existing, 0, 0, before); +} + +// node_modules/micromark-util-character/lib/unicode-punctuation-regex.js +var unicodePunctuationRegex = /[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/; + +// node_modules/micromark-util-character/index.js +var asciiAlpha = regexCheck(/[A-Za-z]/); +var asciiDigit = regexCheck(/\d/); +var asciiHexDigit = regexCheck(/[\dA-Fa-f]/); +var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/); +var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/); +var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/); +function asciiControl(code2) { + return code2 !== null && (code2 < 32 || code2 === 127); +} +function markdownLineEndingOrSpace(code2) { + return code2 !== null && (code2 < 0 || code2 === 32); +} +function markdownLineEnding(code2) { + return code2 !== null && code2 < -2; +} +function markdownSpace(code2) { + return code2 === -2 || code2 === -1 || code2 === 32; +} +var unicodeWhitespace = regexCheck(/\s/); +var unicodePunctuation = regexCheck(unicodePunctuationRegex); +function regexCheck(regex) { + return check; + function check(code2) { + return code2 !== null && regex.test(String.fromCharCode(code2)); + } +} + +// node_modules/micromark-factory-space/index.js +function factorySpace(effects, ok2, type, max) { + const limit = max ? max - 1 : Number.POSITIVE_INFINITY; + let size = 0; + return start; + function start(code2) { + if (markdownSpace(code2)) { + effects.enter(type); + return prefix(code2); + } + return ok2(code2); + } + function prefix(code2) { + if (markdownSpace(code2) && size++ < limit) { + effects.consume(code2); + return prefix; + } + effects.exit(type); + return ok2(code2); + } +} + +// node_modules/micromark/lib/initialize/content.js +var content = { + tokenize: initializeContent +}; +function initializeContent(effects) { + const contentStart = effects.attempt( + this.parser.constructs.contentInitial, + afterContentStartConstruct, + paragraphInitial + ); + let previous2; + return contentStart; + function afterContentStartConstruct(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return factorySpace(effects, contentStart, "linePrefix"); + } + function paragraphInitial(code2) { + effects.enter("paragraph"); + return lineStart(code2); + } + function lineStart(code2) { + const token = effects.enter("chunkText", { + contentType: "text", + previous: previous2 + }); + if (previous2) { + previous2.next = token; + } + previous2 = token; + return data(code2); + } + function data(code2) { + if (code2 === null) { + effects.exit("chunkText"); + effects.exit("paragraph"); + effects.consume(code2); + return; + } + if (markdownLineEnding(code2)) { + effects.consume(code2); + effects.exit("chunkText"); + return lineStart; + } + effects.consume(code2); + return data; + } +} + +// node_modules/micromark/lib/initialize/document.js +var document = { + tokenize: initializeDocument +}; +var containerConstruct = { + tokenize: tokenizeContainer +}; +function initializeDocument(effects) { + const self = this; + const stack = []; + let continued = 0; + let childFlow; + let childToken; + let lineStartOffset; + return start; + function start(code2) { + if (continued < stack.length) { + const item = stack[continued]; + self.containerState = item[1]; + return effects.attempt( + item[0].continuation, + documentContinue, + checkNewContainers + )(code2); + } + return checkNewContainers(code2); + } + function documentContinue(code2) { + continued++; + if (self.containerState._closeFlow) { + self.containerState._closeFlow = void 0; + if (childFlow) { + closeFlow(); + } + const indexBeforeExits = self.events.length; + let indexBeforeFlow = indexBeforeExits; + let point2; + while (indexBeforeFlow--) { + if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") { + point2 = self.events[indexBeforeFlow][1].end; + break; + } + } + exitContainers(continued); + let index2 = indexBeforeExits; + while (index2 < self.events.length) { + self.events[index2][1].end = Object.assign({}, point2); + index2++; + } + splice( + self.events, + indexBeforeFlow + 1, + 0, + self.events.slice(indexBeforeExits) + ); + self.events.length = index2; + return checkNewContainers(code2); + } + return start(code2); + } + function checkNewContainers(code2) { + if (continued === stack.length) { + if (!childFlow) { + return documentContinued(code2); + } + if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { + return flowStart(code2); + } + self.interrupt = Boolean( + childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack + ); + } + self.containerState = {}; + return effects.check( + containerConstruct, + thereIsANewContainer, + thereIsNoNewContainer + )(code2); + } + function thereIsANewContainer(code2) { + if (childFlow) + closeFlow(); + exitContainers(continued); + return documentContinued(code2); + } + function thereIsNoNewContainer(code2) { + self.parser.lazy[self.now().line] = continued !== stack.length; + lineStartOffset = self.now().offset; + return flowStart(code2); + } + function documentContinued(code2) { + self.containerState = {}; + return effects.attempt( + containerConstruct, + containerContinue, + flowStart + )(code2); + } + function containerContinue(code2) { + continued++; + stack.push([self.currentConstruct, self.containerState]); + return documentContinued(code2); + } + function flowStart(code2) { + if (code2 === null) { + if (childFlow) + closeFlow(); + exitContainers(0); + effects.consume(code2); + return; + } + childFlow = childFlow || self.parser.flow(self.now()); + effects.enter("chunkFlow", { + contentType: "flow", + previous: childToken, + _tokenizer: childFlow + }); + return flowContinue(code2); + } + function flowContinue(code2) { + if (code2 === null) { + writeToChild(effects.exit("chunkFlow"), true); + exitContainers(0); + effects.consume(code2); + return; + } + if (markdownLineEnding(code2)) { + effects.consume(code2); + writeToChild(effects.exit("chunkFlow")); + continued = 0; + self.interrupt = void 0; + return start; + } + effects.consume(code2); + return flowContinue; + } + function writeToChild(token, eof) { + const stream = self.sliceStream(token); + if (eof) + stream.push(null); + token.previous = childToken; + if (childToken) + childToken.next = token; + childToken = token; + childFlow.defineSkip(token.start); + childFlow.write(stream); + if (self.parser.lazy[token.start.line]) { + let index2 = childFlow.events.length; + while (index2--) { + if (childFlow.events[index2][1].start.offset < lineStartOffset && (!childFlow.events[index2][1].end || childFlow.events[index2][1].end.offset > lineStartOffset)) { + return; + } + } + const indexBeforeExits = self.events.length; + let indexBeforeFlow = indexBeforeExits; + let seen; + let point2; + while (indexBeforeFlow--) { + if (self.events[indexBeforeFlow][0] === "exit" && self.events[indexBeforeFlow][1].type === "chunkFlow") { + if (seen) { + point2 = self.events[indexBeforeFlow][1].end; + break; + } + seen = true; + } + } + exitContainers(continued); + index2 = indexBeforeExits; + while (index2 < self.events.length) { + self.events[index2][1].end = Object.assign({}, point2); + index2++; + } + splice( + self.events, + indexBeforeFlow + 1, + 0, + self.events.slice(indexBeforeExits) + ); + self.events.length = index2; + } + } + function exitContainers(size) { + let index2 = stack.length; + while (index2-- > size) { + const entry = stack[index2]; + self.containerState = entry[1]; + entry[0].exit.call(self, effects); + } + stack.length = size; + } + function closeFlow() { + childFlow.write([null]); + childToken = void 0; + childFlow = void 0; + self.containerState._closeFlow = void 0; + } +} +function tokenizeContainer(effects, ok2, nok) { + return factorySpace( + effects, + effects.attempt(this.parser.constructs.document, ok2, nok), + "linePrefix", + this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + ); +} + +// node_modules/micromark-util-classify-character/index.js +function classifyCharacter(code2) { + if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) { + return 1; + } + if (unicodePunctuation(code2)) { + return 2; + } +} + +// node_modules/micromark-util-resolve-all/index.js +function resolveAll(constructs2, events, context) { + const called = []; + let index2 = -1; + while (++index2 < constructs2.length) { + const resolve = constructs2[index2].resolveAll; + if (resolve && !called.includes(resolve)) { + events = resolve(events, context); + called.push(resolve); + } + } + return events; +} + +// node_modules/micromark-core-commonmark/lib/attention.js +var attention = { + name: "attention", + tokenize: tokenizeAttention, + resolveAll: resolveAllAttention +}; +function resolveAllAttention(events, context) { + let index2 = -1; + let open; + let group; + let text4; + let openingSequence; + let closingSequence; + let use; + let nextEvents; + let offset; + while (++index2 < events.length) { + if (events[index2][0] === "enter" && events[index2][1].type === "attentionSequence" && events[index2][1]._close) { + open = index2; + while (open--) { + if (events[open][0] === "exit" && events[open][1].type === "attentionSequence" && events[open][1]._open && context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index2][1]).charCodeAt(0)) { + if ((events[open][1]._close || events[index2][1]._open) && (events[index2][1].end.offset - events[index2][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index2][1].end.offset - events[index2][1].start.offset) % 3)) { + continue; + } + use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index2][1].end.offset - events[index2][1].start.offset > 1 ? 2 : 1; + const start = Object.assign({}, events[open][1].end); + const end = Object.assign({}, events[index2][1].start); + movePoint(start, -use); + movePoint(end, use); + openingSequence = { + type: use > 1 ? "strongSequence" : "emphasisSequence", + start, + end: Object.assign({}, events[open][1].end) + }; + closingSequence = { + type: use > 1 ? "strongSequence" : "emphasisSequence", + start: Object.assign({}, events[index2][1].start), + end + }; + text4 = { + type: use > 1 ? "strongText" : "emphasisText", + start: Object.assign({}, events[open][1].end), + end: Object.assign({}, events[index2][1].start) + }; + group = { + type: use > 1 ? "strong" : "emphasis", + start: Object.assign({}, openingSequence.start), + end: Object.assign({}, closingSequence.end) + }; + events[open][1].end = Object.assign({}, openingSequence.start); + events[index2][1].start = Object.assign({}, closingSequence.end); + nextEvents = []; + if (events[open][1].end.offset - events[open][1].start.offset) { + nextEvents = push(nextEvents, [ + ["enter", events[open][1], context], + ["exit", events[open][1], context] + ]); + } + nextEvents = push(nextEvents, [ + ["enter", group, context], + ["enter", openingSequence, context], + ["exit", openingSequence, context], + ["enter", text4, context] + ]); + nextEvents = push( + nextEvents, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + 1, index2), + context + ) + ); + nextEvents = push(nextEvents, [ + ["exit", text4, context], + ["enter", closingSequence, context], + ["exit", closingSequence, context], + ["exit", group, context] + ]); + if (events[index2][1].end.offset - events[index2][1].start.offset) { + offset = 2; + nextEvents = push(nextEvents, [ + ["enter", events[index2][1], context], + ["exit", events[index2][1], context] + ]); + } else { + offset = 0; + } + splice(events, open - 1, index2 - open + 3, nextEvents); + index2 = open + nextEvents.length - offset - 2; + break; + } + } + } + } + index2 = -1; + while (++index2 < events.length) { + if (events[index2][1].type === "attentionSequence") { + events[index2][1].type = "data"; + } + } + return events; +} +function tokenizeAttention(effects, ok2) { + const attentionMarkers2 = this.parser.constructs.attentionMarkers.null; + const previous2 = this.previous; + const before = classifyCharacter(previous2); + let marker; + return start; + function start(code2) { + effects.enter("attentionSequence"); + marker = code2; + return sequence(code2); + } + function sequence(code2) { + if (code2 === marker) { + effects.consume(code2); + return sequence; + } + const token = effects.exit("attentionSequence"); + const after = classifyCharacter(code2); + const open = !after || after === 2 && before || attentionMarkers2.includes(code2); + const close = !before || before === 2 && after || attentionMarkers2.includes(previous2); + token._open = Boolean(marker === 42 ? open : open && (before || !close)); + token._close = Boolean(marker === 42 ? close : close && (after || !open)); + return ok2(code2); + } +} +function movePoint(point2, offset) { + point2.column += offset; + point2.offset += offset; + point2._bufferIndex += offset; +} + +// node_modules/micromark-core-commonmark/lib/autolink.js +var autolink = { + name: "autolink", + tokenize: tokenizeAutolink +}; +function tokenizeAutolink(effects, ok2, nok) { + let size = 1; + return start; + function start(code2) { + effects.enter("autolink"); + effects.enter("autolinkMarker"); + effects.consume(code2); + effects.exit("autolinkMarker"); + effects.enter("autolinkProtocol"); + return open; + } + function open(code2) { + if (asciiAlpha(code2)) { + effects.consume(code2); + return schemeOrEmailAtext; + } + return asciiAtext(code2) ? emailAtext(code2) : nok(code2); + } + function schemeOrEmailAtext(code2) { + return code2 === 43 || code2 === 45 || code2 === 46 || asciiAlphanumeric(code2) ? schemeInsideOrEmailAtext(code2) : emailAtext(code2); + } + function schemeInsideOrEmailAtext(code2) { + if (code2 === 58) { + effects.consume(code2); + return urlInside; + } + if ((code2 === 43 || code2 === 45 || code2 === 46 || asciiAlphanumeric(code2)) && size++ < 32) { + effects.consume(code2); + return schemeInsideOrEmailAtext; + } + return emailAtext(code2); + } + function urlInside(code2) { + if (code2 === 62) { + effects.exit("autolinkProtocol"); + return end(code2); + } + if (code2 === null || code2 === 32 || code2 === 60 || asciiControl(code2)) { + return nok(code2); + } + effects.consume(code2); + return urlInside; + } + function emailAtext(code2) { + if (code2 === 64) { + effects.consume(code2); + size = 0; + return emailAtSignOrDot; + } + if (asciiAtext(code2)) { + effects.consume(code2); + return emailAtext; + } + return nok(code2); + } + function emailAtSignOrDot(code2) { + return asciiAlphanumeric(code2) ? emailLabel(code2) : nok(code2); + } + function emailLabel(code2) { + if (code2 === 46) { + effects.consume(code2); + size = 0; + return emailAtSignOrDot; + } + if (code2 === 62) { + effects.exit("autolinkProtocol").type = "autolinkEmail"; + return end(code2); + } + return emailValue(code2); + } + function emailValue(code2) { + if ((code2 === 45 || asciiAlphanumeric(code2)) && size++ < 63) { + effects.consume(code2); + return code2 === 45 ? emailValue : emailLabel; + } + return nok(code2); + } + function end(code2) { + effects.enter("autolinkMarker"); + effects.consume(code2); + effects.exit("autolinkMarker"); + effects.exit("autolink"); + return ok2; + } +} + +// node_modules/micromark-core-commonmark/lib/blank-line.js +var blankLine = { + tokenize: tokenizeBlankLine, + partial: true +}; +function tokenizeBlankLine(effects, ok2, nok) { + return factorySpace(effects, afterWhitespace, "linePrefix"); + function afterWhitespace(code2) { + return code2 === null || markdownLineEnding(code2) ? ok2(code2) : nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/block-quote.js +var blockQuote = { + name: "blockQuote", + tokenize: tokenizeBlockQuoteStart, + continuation: { + tokenize: tokenizeBlockQuoteContinuation + }, + exit +}; +function tokenizeBlockQuoteStart(effects, ok2, nok) { + const self = this; + return start; + function start(code2) { + if (code2 === 62) { + const state = self.containerState; + if (!state.open) { + effects.enter("blockQuote", { + _container: true + }); + state.open = true; + } + effects.enter("blockQuotePrefix"); + effects.enter("blockQuoteMarker"); + effects.consume(code2); + effects.exit("blockQuoteMarker"); + return after; + } + return nok(code2); + } + function after(code2) { + if (markdownSpace(code2)) { + effects.enter("blockQuotePrefixWhitespace"); + effects.consume(code2); + effects.exit("blockQuotePrefixWhitespace"); + effects.exit("blockQuotePrefix"); + return ok2; + } + effects.exit("blockQuotePrefix"); + return ok2(code2); + } +} +function tokenizeBlockQuoteContinuation(effects, ok2, nok) { + return factorySpace( + effects, + effects.attempt(blockQuote, ok2, nok), + "linePrefix", + this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + ); +} +function exit(effects) { + effects.exit("blockQuote"); +} + +// node_modules/micromark-core-commonmark/lib/character-escape.js +var characterEscape = { + name: "characterEscape", + tokenize: tokenizeCharacterEscape +}; +function tokenizeCharacterEscape(effects, ok2, nok) { + return start; + function start(code2) { + effects.enter("characterEscape"); + effects.enter("escapeMarker"); + effects.consume(code2); + effects.exit("escapeMarker"); + return open; + } + function open(code2) { + if (asciiPunctuation(code2)) { + effects.enter("characterEscapeValue"); + effects.consume(code2); + effects.exit("characterEscapeValue"); + effects.exit("characterEscape"); + return ok2; + } + return nok(code2); + } +} + +// node_modules/character-entities/index.js +var characterEntities = { + AElig: "\xC6", + AMP: "&", + Aacute: "\xC1", + Abreve: "\u0102", + Acirc: "\xC2", + Acy: "\u0410", + Afr: "\u{1D504}", + Agrave: "\xC0", + Alpha: "\u0391", + Amacr: "\u0100", + And: "\u2A53", + Aogon: "\u0104", + Aopf: "\u{1D538}", + ApplyFunction: "\u2061", + Aring: "\xC5", + Ascr: "\u{1D49C}", + Assign: "\u2254", + Atilde: "\xC3", + Auml: "\xC4", + Backslash: "\u2216", + Barv: "\u2AE7", + Barwed: "\u2306", + Bcy: "\u0411", + Because: "\u2235", + Bernoullis: "\u212C", + Beta: "\u0392", + Bfr: "\u{1D505}", + Bopf: "\u{1D539}", + Breve: "\u02D8", + Bscr: "\u212C", + Bumpeq: "\u224E", + CHcy: "\u0427", + COPY: "\xA9", + Cacute: "\u0106", + Cap: "\u22D2", + CapitalDifferentialD: "\u2145", + Cayleys: "\u212D", + Ccaron: "\u010C", + Ccedil: "\xC7", + Ccirc: "\u0108", + Cconint: "\u2230", + Cdot: "\u010A", + Cedilla: "\xB8", + CenterDot: "\xB7", + Cfr: "\u212D", + Chi: "\u03A7", + CircleDot: "\u2299", + CircleMinus: "\u2296", + CirclePlus: "\u2295", + CircleTimes: "\u2297", + ClockwiseContourIntegral: "\u2232", + CloseCurlyDoubleQuote: "\u201D", + CloseCurlyQuote: "\u2019", + Colon: "\u2237", + Colone: "\u2A74", + Congruent: "\u2261", + Conint: "\u222F", + ContourIntegral: "\u222E", + Copf: "\u2102", + Coproduct: "\u2210", + CounterClockwiseContourIntegral: "\u2233", + Cross: "\u2A2F", + Cscr: "\u{1D49E}", + Cup: "\u22D3", + CupCap: "\u224D", + DD: "\u2145", + DDotrahd: "\u2911", + DJcy: "\u0402", + DScy: "\u0405", + DZcy: "\u040F", + Dagger: "\u2021", + Darr: "\u21A1", + Dashv: "\u2AE4", + Dcaron: "\u010E", + Dcy: "\u0414", + Del: "\u2207", + Delta: "\u0394", + Dfr: "\u{1D507}", + DiacriticalAcute: "\xB4", + DiacriticalDot: "\u02D9", + DiacriticalDoubleAcute: "\u02DD", + DiacriticalGrave: "`", + DiacriticalTilde: "\u02DC", + Diamond: "\u22C4", + DifferentialD: "\u2146", + Dopf: "\u{1D53B}", + Dot: "\xA8", + DotDot: "\u20DC", + DotEqual: "\u2250", + DoubleContourIntegral: "\u222F", + DoubleDot: "\xA8", + DoubleDownArrow: "\u21D3", + DoubleLeftArrow: "\u21D0", + DoubleLeftRightArrow: "\u21D4", + DoubleLeftTee: "\u2AE4", + DoubleLongLeftArrow: "\u27F8", + DoubleLongLeftRightArrow: "\u27FA", + DoubleLongRightArrow: "\u27F9", + DoubleRightArrow: "\u21D2", + DoubleRightTee: "\u22A8", + DoubleUpArrow: "\u21D1", + DoubleUpDownArrow: "\u21D5", + DoubleVerticalBar: "\u2225", + DownArrow: "\u2193", + DownArrowBar: "\u2913", + DownArrowUpArrow: "\u21F5", + DownBreve: "\u0311", + DownLeftRightVector: "\u2950", + DownLeftTeeVector: "\u295E", + DownLeftVector: "\u21BD", + DownLeftVectorBar: "\u2956", + DownRightTeeVector: "\u295F", + DownRightVector: "\u21C1", + DownRightVectorBar: "\u2957", + DownTee: "\u22A4", + DownTeeArrow: "\u21A7", + Downarrow: "\u21D3", + Dscr: "\u{1D49F}", + Dstrok: "\u0110", + ENG: "\u014A", + ETH: "\xD0", + Eacute: "\xC9", + Ecaron: "\u011A", + Ecirc: "\xCA", + Ecy: "\u042D", + Edot: "\u0116", + Efr: "\u{1D508}", + Egrave: "\xC8", + Element: "\u2208", + Emacr: "\u0112", + EmptySmallSquare: "\u25FB", + EmptyVerySmallSquare: "\u25AB", + Eogon: "\u0118", + Eopf: "\u{1D53C}", + Epsilon: "\u0395", + Equal: "\u2A75", + EqualTilde: "\u2242", + Equilibrium: "\u21CC", + Escr: "\u2130", + Esim: "\u2A73", + Eta: "\u0397", + Euml: "\xCB", + Exists: "\u2203", + ExponentialE: "\u2147", + Fcy: "\u0424", + Ffr: "\u{1D509}", + FilledSmallSquare: "\u25FC", + FilledVerySmallSquare: "\u25AA", + Fopf: "\u{1D53D}", + ForAll: "\u2200", + Fouriertrf: "\u2131", + Fscr: "\u2131", + GJcy: "\u0403", + GT: ">", + Gamma: "\u0393", + Gammad: "\u03DC", + Gbreve: "\u011E", + Gcedil: "\u0122", + Gcirc: "\u011C", + Gcy: "\u0413", + Gdot: "\u0120", + Gfr: "\u{1D50A}", + Gg: "\u22D9", + Gopf: "\u{1D53E}", + GreaterEqual: "\u2265", + GreaterEqualLess: "\u22DB", + GreaterFullEqual: "\u2267", + GreaterGreater: "\u2AA2", + GreaterLess: "\u2277", + GreaterSlantEqual: "\u2A7E", + GreaterTilde: "\u2273", + Gscr: "\u{1D4A2}", + Gt: "\u226B", + HARDcy: "\u042A", + Hacek: "\u02C7", + Hat: "^", + Hcirc: "\u0124", + Hfr: "\u210C", + HilbertSpace: "\u210B", + Hopf: "\u210D", + HorizontalLine: "\u2500", + Hscr: "\u210B", + Hstrok: "\u0126", + HumpDownHump: "\u224E", + HumpEqual: "\u224F", + IEcy: "\u0415", + IJlig: "\u0132", + IOcy: "\u0401", + Iacute: "\xCD", + Icirc: "\xCE", + Icy: "\u0418", + Idot: "\u0130", + Ifr: "\u2111", + Igrave: "\xCC", + Im: "\u2111", + Imacr: "\u012A", + ImaginaryI: "\u2148", + Implies: "\u21D2", + Int: "\u222C", + Integral: "\u222B", + Intersection: "\u22C2", + InvisibleComma: "\u2063", + InvisibleTimes: "\u2062", + Iogon: "\u012E", + Iopf: "\u{1D540}", + Iota: "\u0399", + Iscr: "\u2110", + Itilde: "\u0128", + Iukcy: "\u0406", + Iuml: "\xCF", + Jcirc: "\u0134", + Jcy: "\u0419", + Jfr: "\u{1D50D}", + Jopf: "\u{1D541}", + Jscr: "\u{1D4A5}", + Jsercy: "\u0408", + Jukcy: "\u0404", + KHcy: "\u0425", + KJcy: "\u040C", + Kappa: "\u039A", + Kcedil: "\u0136", + Kcy: "\u041A", + Kfr: "\u{1D50E}", + Kopf: "\u{1D542}", + Kscr: "\u{1D4A6}", + LJcy: "\u0409", + LT: "<", + Lacute: "\u0139", + Lambda: "\u039B", + Lang: "\u27EA", + Laplacetrf: "\u2112", + Larr: "\u219E", + Lcaron: "\u013D", + Lcedil: "\u013B", + Lcy: "\u041B", + LeftAngleBracket: "\u27E8", + LeftArrow: "\u2190", + LeftArrowBar: "\u21E4", + LeftArrowRightArrow: "\u21C6", + LeftCeiling: "\u2308", + LeftDoubleBracket: "\u27E6", + LeftDownTeeVector: "\u2961", + LeftDownVector: "\u21C3", + LeftDownVectorBar: "\u2959", + LeftFloor: "\u230A", + LeftRightArrow: "\u2194", + LeftRightVector: "\u294E", + LeftTee: "\u22A3", + LeftTeeArrow: "\u21A4", + LeftTeeVector: "\u295A", + LeftTriangle: "\u22B2", + LeftTriangleBar: "\u29CF", + LeftTriangleEqual: "\u22B4", + LeftUpDownVector: "\u2951", + LeftUpTeeVector: "\u2960", + LeftUpVector: "\u21BF", + LeftUpVectorBar: "\u2958", + LeftVector: "\u21BC", + LeftVectorBar: "\u2952", + Leftarrow: "\u21D0", + Leftrightarrow: "\u21D4", + LessEqualGreater: "\u22DA", + LessFullEqual: "\u2266", + LessGreater: "\u2276", + LessLess: "\u2AA1", + LessSlantEqual: "\u2A7D", + LessTilde: "\u2272", + Lfr: "\u{1D50F}", + Ll: "\u22D8", + Lleftarrow: "\u21DA", + Lmidot: "\u013F", + LongLeftArrow: "\u27F5", + LongLeftRightArrow: "\u27F7", + LongRightArrow: "\u27F6", + Longleftarrow: "\u27F8", + Longleftrightarrow: "\u27FA", + Longrightarrow: "\u27F9", + Lopf: "\u{1D543}", + LowerLeftArrow: "\u2199", + LowerRightArrow: "\u2198", + Lscr: "\u2112", + Lsh: "\u21B0", + Lstrok: "\u0141", + Lt: "\u226A", + Map: "\u2905", + Mcy: "\u041C", + MediumSpace: "\u205F", + Mellintrf: "\u2133", + Mfr: "\u{1D510}", + MinusPlus: "\u2213", + Mopf: "\u{1D544}", + Mscr: "\u2133", + Mu: "\u039C", + NJcy: "\u040A", + Nacute: "\u0143", + Ncaron: "\u0147", + Ncedil: "\u0145", + Ncy: "\u041D", + NegativeMediumSpace: "\u200B", + NegativeThickSpace: "\u200B", + NegativeThinSpace: "\u200B", + NegativeVeryThinSpace: "\u200B", + NestedGreaterGreater: "\u226B", + NestedLessLess: "\u226A", + NewLine: "\n", + Nfr: "\u{1D511}", + NoBreak: "\u2060", + NonBreakingSpace: "\xA0", + Nopf: "\u2115", + Not: "\u2AEC", + NotCongruent: "\u2262", + NotCupCap: "\u226D", + NotDoubleVerticalBar: "\u2226", + NotElement: "\u2209", + NotEqual: "\u2260", + NotEqualTilde: "\u2242\u0338", + NotExists: "\u2204", + NotGreater: "\u226F", + NotGreaterEqual: "\u2271", + NotGreaterFullEqual: "\u2267\u0338", + NotGreaterGreater: "\u226B\u0338", + NotGreaterLess: "\u2279", + NotGreaterSlantEqual: "\u2A7E\u0338", + NotGreaterTilde: "\u2275", + NotHumpDownHump: "\u224E\u0338", + NotHumpEqual: "\u224F\u0338", + NotLeftTriangle: "\u22EA", + NotLeftTriangleBar: "\u29CF\u0338", + NotLeftTriangleEqual: "\u22EC", + NotLess: "\u226E", + NotLessEqual: "\u2270", + NotLessGreater: "\u2278", + NotLessLess: "\u226A\u0338", + NotLessSlantEqual: "\u2A7D\u0338", + NotLessTilde: "\u2274", + NotNestedGreaterGreater: "\u2AA2\u0338", + NotNestedLessLess: "\u2AA1\u0338", + NotPrecedes: "\u2280", + NotPrecedesEqual: "\u2AAF\u0338", + NotPrecedesSlantEqual: "\u22E0", + NotReverseElement: "\u220C", + NotRightTriangle: "\u22EB", + NotRightTriangleBar: "\u29D0\u0338", + NotRightTriangleEqual: "\u22ED", + NotSquareSubset: "\u228F\u0338", + NotSquareSubsetEqual: "\u22E2", + NotSquareSuperset: "\u2290\u0338", + NotSquareSupersetEqual: "\u22E3", + NotSubset: "\u2282\u20D2", + NotSubsetEqual: "\u2288", + NotSucceeds: "\u2281", + NotSucceedsEqual: "\u2AB0\u0338", + NotSucceedsSlantEqual: "\u22E1", + NotSucceedsTilde: "\u227F\u0338", + NotSuperset: "\u2283\u20D2", + NotSupersetEqual: "\u2289", + NotTilde: "\u2241", + NotTildeEqual: "\u2244", + NotTildeFullEqual: "\u2247", + NotTildeTilde: "\u2249", + NotVerticalBar: "\u2224", + Nscr: "\u{1D4A9}", + Ntilde: "\xD1", + Nu: "\u039D", + OElig: "\u0152", + Oacute: "\xD3", + Ocirc: "\xD4", + Ocy: "\u041E", + Odblac: "\u0150", + Ofr: "\u{1D512}", + Ograve: "\xD2", + Omacr: "\u014C", + Omega: "\u03A9", + Omicron: "\u039F", + Oopf: "\u{1D546}", + OpenCurlyDoubleQuote: "\u201C", + OpenCurlyQuote: "\u2018", + Or: "\u2A54", + Oscr: "\u{1D4AA}", + Oslash: "\xD8", + Otilde: "\xD5", + Otimes: "\u2A37", + Ouml: "\xD6", + OverBar: "\u203E", + OverBrace: "\u23DE", + OverBracket: "\u23B4", + OverParenthesis: "\u23DC", + PartialD: "\u2202", + Pcy: "\u041F", + Pfr: "\u{1D513}", + Phi: "\u03A6", + Pi: "\u03A0", + PlusMinus: "\xB1", + Poincareplane: "\u210C", + Popf: "\u2119", + Pr: "\u2ABB", + Precedes: "\u227A", + PrecedesEqual: "\u2AAF", + PrecedesSlantEqual: "\u227C", + PrecedesTilde: "\u227E", + Prime: "\u2033", + Product: "\u220F", + Proportion: "\u2237", + Proportional: "\u221D", + Pscr: "\u{1D4AB}", + Psi: "\u03A8", + QUOT: '"', + Qfr: "\u{1D514}", + Qopf: "\u211A", + Qscr: "\u{1D4AC}", + RBarr: "\u2910", + REG: "\xAE", + Racute: "\u0154", + Rang: "\u27EB", + Rarr: "\u21A0", + Rarrtl: "\u2916", + Rcaron: "\u0158", + Rcedil: "\u0156", + Rcy: "\u0420", + Re: "\u211C", + ReverseElement: "\u220B", + ReverseEquilibrium: "\u21CB", + ReverseUpEquilibrium: "\u296F", + Rfr: "\u211C", + Rho: "\u03A1", + RightAngleBracket: "\u27E9", + RightArrow: "\u2192", + RightArrowBar: "\u21E5", + RightArrowLeftArrow: "\u21C4", + RightCeiling: "\u2309", + RightDoubleBracket: "\u27E7", + RightDownTeeVector: "\u295D", + RightDownVector: "\u21C2", + RightDownVectorBar: "\u2955", + RightFloor: "\u230B", + RightTee: "\u22A2", + RightTeeArrow: "\u21A6", + RightTeeVector: "\u295B", + RightTriangle: "\u22B3", + RightTriangleBar: "\u29D0", + RightTriangleEqual: "\u22B5", + RightUpDownVector: "\u294F", + RightUpTeeVector: "\u295C", + RightUpVector: "\u21BE", + RightUpVectorBar: "\u2954", + RightVector: "\u21C0", + RightVectorBar: "\u2953", + Rightarrow: "\u21D2", + Ropf: "\u211D", + RoundImplies: "\u2970", + Rrightarrow: "\u21DB", + Rscr: "\u211B", + Rsh: "\u21B1", + RuleDelayed: "\u29F4", + SHCHcy: "\u0429", + SHcy: "\u0428", + SOFTcy: "\u042C", + Sacute: "\u015A", + Sc: "\u2ABC", + Scaron: "\u0160", + Scedil: "\u015E", + Scirc: "\u015C", + Scy: "\u0421", + Sfr: "\u{1D516}", + ShortDownArrow: "\u2193", + ShortLeftArrow: "\u2190", + ShortRightArrow: "\u2192", + ShortUpArrow: "\u2191", + Sigma: "\u03A3", + SmallCircle: "\u2218", + Sopf: "\u{1D54A}", + Sqrt: "\u221A", + Square: "\u25A1", + SquareIntersection: "\u2293", + SquareSubset: "\u228F", + SquareSubsetEqual: "\u2291", + SquareSuperset: "\u2290", + SquareSupersetEqual: "\u2292", + SquareUnion: "\u2294", + Sscr: "\u{1D4AE}", + Star: "\u22C6", + Sub: "\u22D0", + Subset: "\u22D0", + SubsetEqual: "\u2286", + Succeeds: "\u227B", + SucceedsEqual: "\u2AB0", + SucceedsSlantEqual: "\u227D", + SucceedsTilde: "\u227F", + SuchThat: "\u220B", + Sum: "\u2211", + Sup: "\u22D1", + Superset: "\u2283", + SupersetEqual: "\u2287", + Supset: "\u22D1", + THORN: "\xDE", + TRADE: "\u2122", + TSHcy: "\u040B", + TScy: "\u0426", + Tab: " ", + Tau: "\u03A4", + Tcaron: "\u0164", + Tcedil: "\u0162", + Tcy: "\u0422", + Tfr: "\u{1D517}", + Therefore: "\u2234", + Theta: "\u0398", + ThickSpace: "\u205F\u200A", + ThinSpace: "\u2009", + Tilde: "\u223C", + TildeEqual: "\u2243", + TildeFullEqual: "\u2245", + TildeTilde: "\u2248", + Topf: "\u{1D54B}", + TripleDot: "\u20DB", + Tscr: "\u{1D4AF}", + Tstrok: "\u0166", + Uacute: "\xDA", + Uarr: "\u219F", + Uarrocir: "\u2949", + Ubrcy: "\u040E", + Ubreve: "\u016C", + Ucirc: "\xDB", + Ucy: "\u0423", + Udblac: "\u0170", + Ufr: "\u{1D518}", + Ugrave: "\xD9", + Umacr: "\u016A", + UnderBar: "_", + UnderBrace: "\u23DF", + UnderBracket: "\u23B5", + UnderParenthesis: "\u23DD", + Union: "\u22C3", + UnionPlus: "\u228E", + Uogon: "\u0172", + Uopf: "\u{1D54C}", + UpArrow: "\u2191", + UpArrowBar: "\u2912", + UpArrowDownArrow: "\u21C5", + UpDownArrow: "\u2195", + UpEquilibrium: "\u296E", + UpTee: "\u22A5", + UpTeeArrow: "\u21A5", + Uparrow: "\u21D1", + Updownarrow: "\u21D5", + UpperLeftArrow: "\u2196", + UpperRightArrow: "\u2197", + Upsi: "\u03D2", + Upsilon: "\u03A5", + Uring: "\u016E", + Uscr: "\u{1D4B0}", + Utilde: "\u0168", + Uuml: "\xDC", + VDash: "\u22AB", + Vbar: "\u2AEB", + Vcy: "\u0412", + Vdash: "\u22A9", + Vdashl: "\u2AE6", + Vee: "\u22C1", + Verbar: "\u2016", + Vert: "\u2016", + VerticalBar: "\u2223", + VerticalLine: "|", + VerticalSeparator: "\u2758", + VerticalTilde: "\u2240", + VeryThinSpace: "\u200A", + Vfr: "\u{1D519}", + Vopf: "\u{1D54D}", + Vscr: "\u{1D4B1}", + Vvdash: "\u22AA", + Wcirc: "\u0174", + Wedge: "\u22C0", + Wfr: "\u{1D51A}", + Wopf: "\u{1D54E}", + Wscr: "\u{1D4B2}", + Xfr: "\u{1D51B}", + Xi: "\u039E", + Xopf: "\u{1D54F}", + Xscr: "\u{1D4B3}", + YAcy: "\u042F", + YIcy: "\u0407", + YUcy: "\u042E", + Yacute: "\xDD", + Ycirc: "\u0176", + Ycy: "\u042B", + Yfr: "\u{1D51C}", + Yopf: "\u{1D550}", + Yscr: "\u{1D4B4}", + Yuml: "\u0178", + ZHcy: "\u0416", + Zacute: "\u0179", + Zcaron: "\u017D", + Zcy: "\u0417", + Zdot: "\u017B", + ZeroWidthSpace: "\u200B", + Zeta: "\u0396", + Zfr: "\u2128", + Zopf: "\u2124", + Zscr: "\u{1D4B5}", + aacute: "\xE1", + abreve: "\u0103", + ac: "\u223E", + acE: "\u223E\u0333", + acd: "\u223F", + acirc: "\xE2", + acute: "\xB4", + acy: "\u0430", + aelig: "\xE6", + af: "\u2061", + afr: "\u{1D51E}", + agrave: "\xE0", + alefsym: "\u2135", + aleph: "\u2135", + alpha: "\u03B1", + amacr: "\u0101", + amalg: "\u2A3F", + amp: "&", + and: "\u2227", + andand: "\u2A55", + andd: "\u2A5C", + andslope: "\u2A58", + andv: "\u2A5A", + ang: "\u2220", + ange: "\u29A4", + angle: "\u2220", + angmsd: "\u2221", + angmsdaa: "\u29A8", + angmsdab: "\u29A9", + angmsdac: "\u29AA", + angmsdad: "\u29AB", + angmsdae: "\u29AC", + angmsdaf: "\u29AD", + angmsdag: "\u29AE", + angmsdah: "\u29AF", + angrt: "\u221F", + angrtvb: "\u22BE", + angrtvbd: "\u299D", + angsph: "\u2222", + angst: "\xC5", + angzarr: "\u237C", + aogon: "\u0105", + aopf: "\u{1D552}", + ap: "\u2248", + apE: "\u2A70", + apacir: "\u2A6F", + ape: "\u224A", + apid: "\u224B", + apos: "'", + approx: "\u2248", + approxeq: "\u224A", + aring: "\xE5", + ascr: "\u{1D4B6}", + ast: "*", + asymp: "\u2248", + asympeq: "\u224D", + atilde: "\xE3", + auml: "\xE4", + awconint: "\u2233", + awint: "\u2A11", + bNot: "\u2AED", + backcong: "\u224C", + backepsilon: "\u03F6", + backprime: "\u2035", + backsim: "\u223D", + backsimeq: "\u22CD", + barvee: "\u22BD", + barwed: "\u2305", + barwedge: "\u2305", + bbrk: "\u23B5", + bbrktbrk: "\u23B6", + bcong: "\u224C", + bcy: "\u0431", + bdquo: "\u201E", + becaus: "\u2235", + because: "\u2235", + bemptyv: "\u29B0", + bepsi: "\u03F6", + bernou: "\u212C", + beta: "\u03B2", + beth: "\u2136", + between: "\u226C", + bfr: "\u{1D51F}", + bigcap: "\u22C2", + bigcirc: "\u25EF", + bigcup: "\u22C3", + bigodot: "\u2A00", + bigoplus: "\u2A01", + bigotimes: "\u2A02", + bigsqcup: "\u2A06", + bigstar: "\u2605", + bigtriangledown: "\u25BD", + bigtriangleup: "\u25B3", + biguplus: "\u2A04", + bigvee: "\u22C1", + bigwedge: "\u22C0", + bkarow: "\u290D", + blacklozenge: "\u29EB", + blacksquare: "\u25AA", + blacktriangle: "\u25B4", + blacktriangledown: "\u25BE", + blacktriangleleft: "\u25C2", + blacktriangleright: "\u25B8", + blank: "\u2423", + blk12: "\u2592", + blk14: "\u2591", + blk34: "\u2593", + block: "\u2588", + bne: "=\u20E5", + bnequiv: "\u2261\u20E5", + bnot: "\u2310", + bopf: "\u{1D553}", + bot: "\u22A5", + bottom: "\u22A5", + bowtie: "\u22C8", + boxDL: "\u2557", + boxDR: "\u2554", + boxDl: "\u2556", + boxDr: "\u2553", + boxH: "\u2550", + boxHD: "\u2566", + boxHU: "\u2569", + boxHd: "\u2564", + boxHu: "\u2567", + boxUL: "\u255D", + boxUR: "\u255A", + boxUl: "\u255C", + boxUr: "\u2559", + boxV: "\u2551", + boxVH: "\u256C", + boxVL: "\u2563", + boxVR: "\u2560", + boxVh: "\u256B", + boxVl: "\u2562", + boxVr: "\u255F", + boxbox: "\u29C9", + boxdL: "\u2555", + boxdR: "\u2552", + boxdl: "\u2510", + boxdr: "\u250C", + boxh: "\u2500", + boxhD: "\u2565", + boxhU: "\u2568", + boxhd: "\u252C", + boxhu: "\u2534", + boxminus: "\u229F", + boxplus: "\u229E", + boxtimes: "\u22A0", + boxuL: "\u255B", + boxuR: "\u2558", + boxul: "\u2518", + boxur: "\u2514", + boxv: "\u2502", + boxvH: "\u256A", + boxvL: "\u2561", + boxvR: "\u255E", + boxvh: "\u253C", + boxvl: "\u2524", + boxvr: "\u251C", + bprime: "\u2035", + breve: "\u02D8", + brvbar: "\xA6", + bscr: "\u{1D4B7}", + bsemi: "\u204F", + bsim: "\u223D", + bsime: "\u22CD", + bsol: "\\", + bsolb: "\u29C5", + bsolhsub: "\u27C8", + bull: "\u2022", + bullet: "\u2022", + bump: "\u224E", + bumpE: "\u2AAE", + bumpe: "\u224F", + bumpeq: "\u224F", + cacute: "\u0107", + cap: "\u2229", + capand: "\u2A44", + capbrcup: "\u2A49", + capcap: "\u2A4B", + capcup: "\u2A47", + capdot: "\u2A40", + caps: "\u2229\uFE00", + caret: "\u2041", + caron: "\u02C7", + ccaps: "\u2A4D", + ccaron: "\u010D", + ccedil: "\xE7", + ccirc: "\u0109", + ccups: "\u2A4C", + ccupssm: "\u2A50", + cdot: "\u010B", + cedil: "\xB8", + cemptyv: "\u29B2", + cent: "\xA2", + centerdot: "\xB7", + cfr: "\u{1D520}", + chcy: "\u0447", + check: "\u2713", + checkmark: "\u2713", + chi: "\u03C7", + cir: "\u25CB", + cirE: "\u29C3", + circ: "\u02C6", + circeq: "\u2257", + circlearrowleft: "\u21BA", + circlearrowright: "\u21BB", + circledR: "\xAE", + circledS: "\u24C8", + circledast: "\u229B", + circledcirc: "\u229A", + circleddash: "\u229D", + cire: "\u2257", + cirfnint: "\u2A10", + cirmid: "\u2AEF", + cirscir: "\u29C2", + clubs: "\u2663", + clubsuit: "\u2663", + colon: ":", + colone: "\u2254", + coloneq: "\u2254", + comma: ",", + commat: "@", + comp: "\u2201", + compfn: "\u2218", + complement: "\u2201", + complexes: "\u2102", + cong: "\u2245", + congdot: "\u2A6D", + conint: "\u222E", + copf: "\u{1D554}", + coprod: "\u2210", + copy: "\xA9", + copysr: "\u2117", + crarr: "\u21B5", + cross: "\u2717", + cscr: "\u{1D4B8}", + csub: "\u2ACF", + csube: "\u2AD1", + csup: "\u2AD0", + csupe: "\u2AD2", + ctdot: "\u22EF", + cudarrl: "\u2938", + cudarrr: "\u2935", + cuepr: "\u22DE", + cuesc: "\u22DF", + cularr: "\u21B6", + cularrp: "\u293D", + cup: "\u222A", + cupbrcap: "\u2A48", + cupcap: "\u2A46", + cupcup: "\u2A4A", + cupdot: "\u228D", + cupor: "\u2A45", + cups: "\u222A\uFE00", + curarr: "\u21B7", + curarrm: "\u293C", + curlyeqprec: "\u22DE", + curlyeqsucc: "\u22DF", + curlyvee: "\u22CE", + curlywedge: "\u22CF", + curren: "\xA4", + curvearrowleft: "\u21B6", + curvearrowright: "\u21B7", + cuvee: "\u22CE", + cuwed: "\u22CF", + cwconint: "\u2232", + cwint: "\u2231", + cylcty: "\u232D", + dArr: "\u21D3", + dHar: "\u2965", + dagger: "\u2020", + daleth: "\u2138", + darr: "\u2193", + dash: "\u2010", + dashv: "\u22A3", + dbkarow: "\u290F", + dblac: "\u02DD", + dcaron: "\u010F", + dcy: "\u0434", + dd: "\u2146", + ddagger: "\u2021", + ddarr: "\u21CA", + ddotseq: "\u2A77", + deg: "\xB0", + delta: "\u03B4", + demptyv: "\u29B1", + dfisht: "\u297F", + dfr: "\u{1D521}", + dharl: "\u21C3", + dharr: "\u21C2", + diam: "\u22C4", + diamond: "\u22C4", + diamondsuit: "\u2666", + diams: "\u2666", + die: "\xA8", + digamma: "\u03DD", + disin: "\u22F2", + div: "\xF7", + divide: "\xF7", + divideontimes: "\u22C7", + divonx: "\u22C7", + djcy: "\u0452", + dlcorn: "\u231E", + dlcrop: "\u230D", + dollar: "$", + dopf: "\u{1D555}", + dot: "\u02D9", + doteq: "\u2250", + doteqdot: "\u2251", + dotminus: "\u2238", + dotplus: "\u2214", + dotsquare: "\u22A1", + doublebarwedge: "\u2306", + downarrow: "\u2193", + downdownarrows: "\u21CA", + downharpoonleft: "\u21C3", + downharpoonright: "\u21C2", + drbkarow: "\u2910", + drcorn: "\u231F", + drcrop: "\u230C", + dscr: "\u{1D4B9}", + dscy: "\u0455", + dsol: "\u29F6", + dstrok: "\u0111", + dtdot: "\u22F1", + dtri: "\u25BF", + dtrif: "\u25BE", + duarr: "\u21F5", + duhar: "\u296F", + dwangle: "\u29A6", + dzcy: "\u045F", + dzigrarr: "\u27FF", + eDDot: "\u2A77", + eDot: "\u2251", + eacute: "\xE9", + easter: "\u2A6E", + ecaron: "\u011B", + ecir: "\u2256", + ecirc: "\xEA", + ecolon: "\u2255", + ecy: "\u044D", + edot: "\u0117", + ee: "\u2147", + efDot: "\u2252", + efr: "\u{1D522}", + eg: "\u2A9A", + egrave: "\xE8", + egs: "\u2A96", + egsdot: "\u2A98", + el: "\u2A99", + elinters: "\u23E7", + ell: "\u2113", + els: "\u2A95", + elsdot: "\u2A97", + emacr: "\u0113", + empty: "\u2205", + emptyset: "\u2205", + emptyv: "\u2205", + emsp13: "\u2004", + emsp14: "\u2005", + emsp: "\u2003", + eng: "\u014B", + ensp: "\u2002", + eogon: "\u0119", + eopf: "\u{1D556}", + epar: "\u22D5", + eparsl: "\u29E3", + eplus: "\u2A71", + epsi: "\u03B5", + epsilon: "\u03B5", + epsiv: "\u03F5", + eqcirc: "\u2256", + eqcolon: "\u2255", + eqsim: "\u2242", + eqslantgtr: "\u2A96", + eqslantless: "\u2A95", + equals: "=", + equest: "\u225F", + equiv: "\u2261", + equivDD: "\u2A78", + eqvparsl: "\u29E5", + erDot: "\u2253", + erarr: "\u2971", + escr: "\u212F", + esdot: "\u2250", + esim: "\u2242", + eta: "\u03B7", + eth: "\xF0", + euml: "\xEB", + euro: "\u20AC", + excl: "!", + exist: "\u2203", + expectation: "\u2130", + exponentiale: "\u2147", + fallingdotseq: "\u2252", + fcy: "\u0444", + female: "\u2640", + ffilig: "\uFB03", + fflig: "\uFB00", + ffllig: "\uFB04", + ffr: "\u{1D523}", + filig: "\uFB01", + fjlig: "fj", + flat: "\u266D", + fllig: "\uFB02", + fltns: "\u25B1", + fnof: "\u0192", + fopf: "\u{1D557}", + forall: "\u2200", + fork: "\u22D4", + forkv: "\u2AD9", + fpartint: "\u2A0D", + frac12: "\xBD", + frac13: "\u2153", + frac14: "\xBC", + frac15: "\u2155", + frac16: "\u2159", + frac18: "\u215B", + frac23: "\u2154", + frac25: "\u2156", + frac34: "\xBE", + frac35: "\u2157", + frac38: "\u215C", + frac45: "\u2158", + frac56: "\u215A", + frac58: "\u215D", + frac78: "\u215E", + frasl: "\u2044", + frown: "\u2322", + fscr: "\u{1D4BB}", + gE: "\u2267", + gEl: "\u2A8C", + gacute: "\u01F5", + gamma: "\u03B3", + gammad: "\u03DD", + gap: "\u2A86", + gbreve: "\u011F", + gcirc: "\u011D", + gcy: "\u0433", + gdot: "\u0121", + ge: "\u2265", + gel: "\u22DB", + geq: "\u2265", + geqq: "\u2267", + geqslant: "\u2A7E", + ges: "\u2A7E", + gescc: "\u2AA9", + gesdot: "\u2A80", + gesdoto: "\u2A82", + gesdotol: "\u2A84", + gesl: "\u22DB\uFE00", + gesles: "\u2A94", + gfr: "\u{1D524}", + gg: "\u226B", + ggg: "\u22D9", + gimel: "\u2137", + gjcy: "\u0453", + gl: "\u2277", + glE: "\u2A92", + gla: "\u2AA5", + glj: "\u2AA4", + gnE: "\u2269", + gnap: "\u2A8A", + gnapprox: "\u2A8A", + gne: "\u2A88", + gneq: "\u2A88", + gneqq: "\u2269", + gnsim: "\u22E7", + gopf: "\u{1D558}", + grave: "`", + gscr: "\u210A", + gsim: "\u2273", + gsime: "\u2A8E", + gsiml: "\u2A90", + gt: ">", + gtcc: "\u2AA7", + gtcir: "\u2A7A", + gtdot: "\u22D7", + gtlPar: "\u2995", + gtquest: "\u2A7C", + gtrapprox: "\u2A86", + gtrarr: "\u2978", + gtrdot: "\u22D7", + gtreqless: "\u22DB", + gtreqqless: "\u2A8C", + gtrless: "\u2277", + gtrsim: "\u2273", + gvertneqq: "\u2269\uFE00", + gvnE: "\u2269\uFE00", + hArr: "\u21D4", + hairsp: "\u200A", + half: "\xBD", + hamilt: "\u210B", + hardcy: "\u044A", + harr: "\u2194", + harrcir: "\u2948", + harrw: "\u21AD", + hbar: "\u210F", + hcirc: "\u0125", + hearts: "\u2665", + heartsuit: "\u2665", + hellip: "\u2026", + hercon: "\u22B9", + hfr: "\u{1D525}", + hksearow: "\u2925", + hkswarow: "\u2926", + hoarr: "\u21FF", + homtht: "\u223B", + hookleftarrow: "\u21A9", + hookrightarrow: "\u21AA", + hopf: "\u{1D559}", + horbar: "\u2015", + hscr: "\u{1D4BD}", + hslash: "\u210F", + hstrok: "\u0127", + hybull: "\u2043", + hyphen: "\u2010", + iacute: "\xED", + ic: "\u2063", + icirc: "\xEE", + icy: "\u0438", + iecy: "\u0435", + iexcl: "\xA1", + iff: "\u21D4", + ifr: "\u{1D526}", + igrave: "\xEC", + ii: "\u2148", + iiiint: "\u2A0C", + iiint: "\u222D", + iinfin: "\u29DC", + iiota: "\u2129", + ijlig: "\u0133", + imacr: "\u012B", + image: "\u2111", + imagline: "\u2110", + imagpart: "\u2111", + imath: "\u0131", + imof: "\u22B7", + imped: "\u01B5", + in: "\u2208", + incare: "\u2105", + infin: "\u221E", + infintie: "\u29DD", + inodot: "\u0131", + int: "\u222B", + intcal: "\u22BA", + integers: "\u2124", + intercal: "\u22BA", + intlarhk: "\u2A17", + intprod: "\u2A3C", + iocy: "\u0451", + iogon: "\u012F", + iopf: "\u{1D55A}", + iota: "\u03B9", + iprod: "\u2A3C", + iquest: "\xBF", + iscr: "\u{1D4BE}", + isin: "\u2208", + isinE: "\u22F9", + isindot: "\u22F5", + isins: "\u22F4", + isinsv: "\u22F3", + isinv: "\u2208", + it: "\u2062", + itilde: "\u0129", + iukcy: "\u0456", + iuml: "\xEF", + jcirc: "\u0135", + jcy: "\u0439", + jfr: "\u{1D527}", + jmath: "\u0237", + jopf: "\u{1D55B}", + jscr: "\u{1D4BF}", + jsercy: "\u0458", + jukcy: "\u0454", + kappa: "\u03BA", + kappav: "\u03F0", + kcedil: "\u0137", + kcy: "\u043A", + kfr: "\u{1D528}", + kgreen: "\u0138", + khcy: "\u0445", + kjcy: "\u045C", + kopf: "\u{1D55C}", + kscr: "\u{1D4C0}", + lAarr: "\u21DA", + lArr: "\u21D0", + lAtail: "\u291B", + lBarr: "\u290E", + lE: "\u2266", + lEg: "\u2A8B", + lHar: "\u2962", + lacute: "\u013A", + laemptyv: "\u29B4", + lagran: "\u2112", + lambda: "\u03BB", + lang: "\u27E8", + langd: "\u2991", + langle: "\u27E8", + lap: "\u2A85", + laquo: "\xAB", + larr: "\u2190", + larrb: "\u21E4", + larrbfs: "\u291F", + larrfs: "\u291D", + larrhk: "\u21A9", + larrlp: "\u21AB", + larrpl: "\u2939", + larrsim: "\u2973", + larrtl: "\u21A2", + lat: "\u2AAB", + latail: "\u2919", + late: "\u2AAD", + lates: "\u2AAD\uFE00", + lbarr: "\u290C", + lbbrk: "\u2772", + lbrace: "{", + lbrack: "[", + lbrke: "\u298B", + lbrksld: "\u298F", + lbrkslu: "\u298D", + lcaron: "\u013E", + lcedil: "\u013C", + lceil: "\u2308", + lcub: "{", + lcy: "\u043B", + ldca: "\u2936", + ldquo: "\u201C", + ldquor: "\u201E", + ldrdhar: "\u2967", + ldrushar: "\u294B", + ldsh: "\u21B2", + le: "\u2264", + leftarrow: "\u2190", + leftarrowtail: "\u21A2", + leftharpoondown: "\u21BD", + leftharpoonup: "\u21BC", + leftleftarrows: "\u21C7", + leftrightarrow: "\u2194", + leftrightarrows: "\u21C6", + leftrightharpoons: "\u21CB", + leftrightsquigarrow: "\u21AD", + leftthreetimes: "\u22CB", + leg: "\u22DA", + leq: "\u2264", + leqq: "\u2266", + leqslant: "\u2A7D", + les: "\u2A7D", + lescc: "\u2AA8", + lesdot: "\u2A7F", + lesdoto: "\u2A81", + lesdotor: "\u2A83", + lesg: "\u22DA\uFE00", + lesges: "\u2A93", + lessapprox: "\u2A85", + lessdot: "\u22D6", + lesseqgtr: "\u22DA", + lesseqqgtr: "\u2A8B", + lessgtr: "\u2276", + lesssim: "\u2272", + lfisht: "\u297C", + lfloor: "\u230A", + lfr: "\u{1D529}", + lg: "\u2276", + lgE: "\u2A91", + lhard: "\u21BD", + lharu: "\u21BC", + lharul: "\u296A", + lhblk: "\u2584", + ljcy: "\u0459", + ll: "\u226A", + llarr: "\u21C7", + llcorner: "\u231E", + llhard: "\u296B", + lltri: "\u25FA", + lmidot: "\u0140", + lmoust: "\u23B0", + lmoustache: "\u23B0", + lnE: "\u2268", + lnap: "\u2A89", + lnapprox: "\u2A89", + lne: "\u2A87", + lneq: "\u2A87", + lneqq: "\u2268", + lnsim: "\u22E6", + loang: "\u27EC", + loarr: "\u21FD", + lobrk: "\u27E6", + longleftarrow: "\u27F5", + longleftrightarrow: "\u27F7", + longmapsto: "\u27FC", + longrightarrow: "\u27F6", + looparrowleft: "\u21AB", + looparrowright: "\u21AC", + lopar: "\u2985", + lopf: "\u{1D55D}", + loplus: "\u2A2D", + lotimes: "\u2A34", + lowast: "\u2217", + lowbar: "_", + loz: "\u25CA", + lozenge: "\u25CA", + lozf: "\u29EB", + lpar: "(", + lparlt: "\u2993", + lrarr: "\u21C6", + lrcorner: "\u231F", + lrhar: "\u21CB", + lrhard: "\u296D", + lrm: "\u200E", + lrtri: "\u22BF", + lsaquo: "\u2039", + lscr: "\u{1D4C1}", + lsh: "\u21B0", + lsim: "\u2272", + lsime: "\u2A8D", + lsimg: "\u2A8F", + lsqb: "[", + lsquo: "\u2018", + lsquor: "\u201A", + lstrok: "\u0142", + lt: "<", + ltcc: "\u2AA6", + ltcir: "\u2A79", + ltdot: "\u22D6", + lthree: "\u22CB", + ltimes: "\u22C9", + ltlarr: "\u2976", + ltquest: "\u2A7B", + ltrPar: "\u2996", + ltri: "\u25C3", + ltrie: "\u22B4", + ltrif: "\u25C2", + lurdshar: "\u294A", + luruhar: "\u2966", + lvertneqq: "\u2268\uFE00", + lvnE: "\u2268\uFE00", + mDDot: "\u223A", + macr: "\xAF", + male: "\u2642", + malt: "\u2720", + maltese: "\u2720", + map: "\u21A6", + mapsto: "\u21A6", + mapstodown: "\u21A7", + mapstoleft: "\u21A4", + mapstoup: "\u21A5", + marker: "\u25AE", + mcomma: "\u2A29", + mcy: "\u043C", + mdash: "\u2014", + measuredangle: "\u2221", + mfr: "\u{1D52A}", + mho: "\u2127", + micro: "\xB5", + mid: "\u2223", + midast: "*", + midcir: "\u2AF0", + middot: "\xB7", + minus: "\u2212", + minusb: "\u229F", + minusd: "\u2238", + minusdu: "\u2A2A", + mlcp: "\u2ADB", + mldr: "\u2026", + mnplus: "\u2213", + models: "\u22A7", + mopf: "\u{1D55E}", + mp: "\u2213", + mscr: "\u{1D4C2}", + mstpos: "\u223E", + mu: "\u03BC", + multimap: "\u22B8", + mumap: "\u22B8", + nGg: "\u22D9\u0338", + nGt: "\u226B\u20D2", + nGtv: "\u226B\u0338", + nLeftarrow: "\u21CD", + nLeftrightarrow: "\u21CE", + nLl: "\u22D8\u0338", + nLt: "\u226A\u20D2", + nLtv: "\u226A\u0338", + nRightarrow: "\u21CF", + nVDash: "\u22AF", + nVdash: "\u22AE", + nabla: "\u2207", + nacute: "\u0144", + nang: "\u2220\u20D2", + nap: "\u2249", + napE: "\u2A70\u0338", + napid: "\u224B\u0338", + napos: "\u0149", + napprox: "\u2249", + natur: "\u266E", + natural: "\u266E", + naturals: "\u2115", + nbsp: "\xA0", + nbump: "\u224E\u0338", + nbumpe: "\u224F\u0338", + ncap: "\u2A43", + ncaron: "\u0148", + ncedil: "\u0146", + ncong: "\u2247", + ncongdot: "\u2A6D\u0338", + ncup: "\u2A42", + ncy: "\u043D", + ndash: "\u2013", + ne: "\u2260", + neArr: "\u21D7", + nearhk: "\u2924", + nearr: "\u2197", + nearrow: "\u2197", + nedot: "\u2250\u0338", + nequiv: "\u2262", + nesear: "\u2928", + nesim: "\u2242\u0338", + nexist: "\u2204", + nexists: "\u2204", + nfr: "\u{1D52B}", + ngE: "\u2267\u0338", + nge: "\u2271", + ngeq: "\u2271", + ngeqq: "\u2267\u0338", + ngeqslant: "\u2A7E\u0338", + nges: "\u2A7E\u0338", + ngsim: "\u2275", + ngt: "\u226F", + ngtr: "\u226F", + nhArr: "\u21CE", + nharr: "\u21AE", + nhpar: "\u2AF2", + ni: "\u220B", + nis: "\u22FC", + nisd: "\u22FA", + niv: "\u220B", + njcy: "\u045A", + nlArr: "\u21CD", + nlE: "\u2266\u0338", + nlarr: "\u219A", + nldr: "\u2025", + nle: "\u2270", + nleftarrow: "\u219A", + nleftrightarrow: "\u21AE", + nleq: "\u2270", + nleqq: "\u2266\u0338", + nleqslant: "\u2A7D\u0338", + nles: "\u2A7D\u0338", + nless: "\u226E", + nlsim: "\u2274", + nlt: "\u226E", + nltri: "\u22EA", + nltrie: "\u22EC", + nmid: "\u2224", + nopf: "\u{1D55F}", + not: "\xAC", + notin: "\u2209", + notinE: "\u22F9\u0338", + notindot: "\u22F5\u0338", + notinva: "\u2209", + notinvb: "\u22F7", + notinvc: "\u22F6", + notni: "\u220C", + notniva: "\u220C", + notnivb: "\u22FE", + notnivc: "\u22FD", + npar: "\u2226", + nparallel: "\u2226", + nparsl: "\u2AFD\u20E5", + npart: "\u2202\u0338", + npolint: "\u2A14", + npr: "\u2280", + nprcue: "\u22E0", + npre: "\u2AAF\u0338", + nprec: "\u2280", + npreceq: "\u2AAF\u0338", + nrArr: "\u21CF", + nrarr: "\u219B", + nrarrc: "\u2933\u0338", + nrarrw: "\u219D\u0338", + nrightarrow: "\u219B", + nrtri: "\u22EB", + nrtrie: "\u22ED", + nsc: "\u2281", + nsccue: "\u22E1", + nsce: "\u2AB0\u0338", + nscr: "\u{1D4C3}", + nshortmid: "\u2224", + nshortparallel: "\u2226", + nsim: "\u2241", + nsime: "\u2244", + nsimeq: "\u2244", + nsmid: "\u2224", + nspar: "\u2226", + nsqsube: "\u22E2", + nsqsupe: "\u22E3", + nsub: "\u2284", + nsubE: "\u2AC5\u0338", + nsube: "\u2288", + nsubset: "\u2282\u20D2", + nsubseteq: "\u2288", + nsubseteqq: "\u2AC5\u0338", + nsucc: "\u2281", + nsucceq: "\u2AB0\u0338", + nsup: "\u2285", + nsupE: "\u2AC6\u0338", + nsupe: "\u2289", + nsupset: "\u2283\u20D2", + nsupseteq: "\u2289", + nsupseteqq: "\u2AC6\u0338", + ntgl: "\u2279", + ntilde: "\xF1", + ntlg: "\u2278", + ntriangleleft: "\u22EA", + ntrianglelefteq: "\u22EC", + ntriangleright: "\u22EB", + ntrianglerighteq: "\u22ED", + nu: "\u03BD", + num: "#", + numero: "\u2116", + numsp: "\u2007", + nvDash: "\u22AD", + nvHarr: "\u2904", + nvap: "\u224D\u20D2", + nvdash: "\u22AC", + nvge: "\u2265\u20D2", + nvgt: ">\u20D2", + nvinfin: "\u29DE", + nvlArr: "\u2902", + nvle: "\u2264\u20D2", + nvlt: "<\u20D2", + nvltrie: "\u22B4\u20D2", + nvrArr: "\u2903", + nvrtrie: "\u22B5\u20D2", + nvsim: "\u223C\u20D2", + nwArr: "\u21D6", + nwarhk: "\u2923", + nwarr: "\u2196", + nwarrow: "\u2196", + nwnear: "\u2927", + oS: "\u24C8", + oacute: "\xF3", + oast: "\u229B", + ocir: "\u229A", + ocirc: "\xF4", + ocy: "\u043E", + odash: "\u229D", + odblac: "\u0151", + odiv: "\u2A38", + odot: "\u2299", + odsold: "\u29BC", + oelig: "\u0153", + ofcir: "\u29BF", + ofr: "\u{1D52C}", + ogon: "\u02DB", + ograve: "\xF2", + ogt: "\u29C1", + ohbar: "\u29B5", + ohm: "\u03A9", + oint: "\u222E", + olarr: "\u21BA", + olcir: "\u29BE", + olcross: "\u29BB", + oline: "\u203E", + olt: "\u29C0", + omacr: "\u014D", + omega: "\u03C9", + omicron: "\u03BF", + omid: "\u29B6", + ominus: "\u2296", + oopf: "\u{1D560}", + opar: "\u29B7", + operp: "\u29B9", + oplus: "\u2295", + or: "\u2228", + orarr: "\u21BB", + ord: "\u2A5D", + order: "\u2134", + orderof: "\u2134", + ordf: "\xAA", + ordm: "\xBA", + origof: "\u22B6", + oror: "\u2A56", + orslope: "\u2A57", + orv: "\u2A5B", + oscr: "\u2134", + oslash: "\xF8", + osol: "\u2298", + otilde: "\xF5", + otimes: "\u2297", + otimesas: "\u2A36", + ouml: "\xF6", + ovbar: "\u233D", + par: "\u2225", + para: "\xB6", + parallel: "\u2225", + parsim: "\u2AF3", + parsl: "\u2AFD", + part: "\u2202", + pcy: "\u043F", + percnt: "%", + period: ".", + permil: "\u2030", + perp: "\u22A5", + pertenk: "\u2031", + pfr: "\u{1D52D}", + phi: "\u03C6", + phiv: "\u03D5", + phmmat: "\u2133", + phone: "\u260E", + pi: "\u03C0", + pitchfork: "\u22D4", + piv: "\u03D6", + planck: "\u210F", + planckh: "\u210E", + plankv: "\u210F", + plus: "+", + plusacir: "\u2A23", + plusb: "\u229E", + pluscir: "\u2A22", + plusdo: "\u2214", + plusdu: "\u2A25", + pluse: "\u2A72", + plusmn: "\xB1", + plussim: "\u2A26", + plustwo: "\u2A27", + pm: "\xB1", + pointint: "\u2A15", + popf: "\u{1D561}", + pound: "\xA3", + pr: "\u227A", + prE: "\u2AB3", + prap: "\u2AB7", + prcue: "\u227C", + pre: "\u2AAF", + prec: "\u227A", + precapprox: "\u2AB7", + preccurlyeq: "\u227C", + preceq: "\u2AAF", + precnapprox: "\u2AB9", + precneqq: "\u2AB5", + precnsim: "\u22E8", + precsim: "\u227E", + prime: "\u2032", + primes: "\u2119", + prnE: "\u2AB5", + prnap: "\u2AB9", + prnsim: "\u22E8", + prod: "\u220F", + profalar: "\u232E", + profline: "\u2312", + profsurf: "\u2313", + prop: "\u221D", + propto: "\u221D", + prsim: "\u227E", + prurel: "\u22B0", + pscr: "\u{1D4C5}", + psi: "\u03C8", + puncsp: "\u2008", + qfr: "\u{1D52E}", + qint: "\u2A0C", + qopf: "\u{1D562}", + qprime: "\u2057", + qscr: "\u{1D4C6}", + quaternions: "\u210D", + quatint: "\u2A16", + quest: "?", + questeq: "\u225F", + quot: '"', + rAarr: "\u21DB", + rArr: "\u21D2", + rAtail: "\u291C", + rBarr: "\u290F", + rHar: "\u2964", + race: "\u223D\u0331", + racute: "\u0155", + radic: "\u221A", + raemptyv: "\u29B3", + rang: "\u27E9", + rangd: "\u2992", + range: "\u29A5", + rangle: "\u27E9", + raquo: "\xBB", + rarr: "\u2192", + rarrap: "\u2975", + rarrb: "\u21E5", + rarrbfs: "\u2920", + rarrc: "\u2933", + rarrfs: "\u291E", + rarrhk: "\u21AA", + rarrlp: "\u21AC", + rarrpl: "\u2945", + rarrsim: "\u2974", + rarrtl: "\u21A3", + rarrw: "\u219D", + ratail: "\u291A", + ratio: "\u2236", + rationals: "\u211A", + rbarr: "\u290D", + rbbrk: "\u2773", + rbrace: "}", + rbrack: "]", + rbrke: "\u298C", + rbrksld: "\u298E", + rbrkslu: "\u2990", + rcaron: "\u0159", + rcedil: "\u0157", + rceil: "\u2309", + rcub: "}", + rcy: "\u0440", + rdca: "\u2937", + rdldhar: "\u2969", + rdquo: "\u201D", + rdquor: "\u201D", + rdsh: "\u21B3", + real: "\u211C", + realine: "\u211B", + realpart: "\u211C", + reals: "\u211D", + rect: "\u25AD", + reg: "\xAE", + rfisht: "\u297D", + rfloor: "\u230B", + rfr: "\u{1D52F}", + rhard: "\u21C1", + rharu: "\u21C0", + rharul: "\u296C", + rho: "\u03C1", + rhov: "\u03F1", + rightarrow: "\u2192", + rightarrowtail: "\u21A3", + rightharpoondown: "\u21C1", + rightharpoonup: "\u21C0", + rightleftarrows: "\u21C4", + rightleftharpoons: "\u21CC", + rightrightarrows: "\u21C9", + rightsquigarrow: "\u219D", + rightthreetimes: "\u22CC", + ring: "\u02DA", + risingdotseq: "\u2253", + rlarr: "\u21C4", + rlhar: "\u21CC", + rlm: "\u200F", + rmoust: "\u23B1", + rmoustache: "\u23B1", + rnmid: "\u2AEE", + roang: "\u27ED", + roarr: "\u21FE", + robrk: "\u27E7", + ropar: "\u2986", + ropf: "\u{1D563}", + roplus: "\u2A2E", + rotimes: "\u2A35", + rpar: ")", + rpargt: "\u2994", + rppolint: "\u2A12", + rrarr: "\u21C9", + rsaquo: "\u203A", + rscr: "\u{1D4C7}", + rsh: "\u21B1", + rsqb: "]", + rsquo: "\u2019", + rsquor: "\u2019", + rthree: "\u22CC", + rtimes: "\u22CA", + rtri: "\u25B9", + rtrie: "\u22B5", + rtrif: "\u25B8", + rtriltri: "\u29CE", + ruluhar: "\u2968", + rx: "\u211E", + sacute: "\u015B", + sbquo: "\u201A", + sc: "\u227B", + scE: "\u2AB4", + scap: "\u2AB8", + scaron: "\u0161", + sccue: "\u227D", + sce: "\u2AB0", + scedil: "\u015F", + scirc: "\u015D", + scnE: "\u2AB6", + scnap: "\u2ABA", + scnsim: "\u22E9", + scpolint: "\u2A13", + scsim: "\u227F", + scy: "\u0441", + sdot: "\u22C5", + sdotb: "\u22A1", + sdote: "\u2A66", + seArr: "\u21D8", + searhk: "\u2925", + searr: "\u2198", + searrow: "\u2198", + sect: "\xA7", + semi: ";", + seswar: "\u2929", + setminus: "\u2216", + setmn: "\u2216", + sext: "\u2736", + sfr: "\u{1D530}", + sfrown: "\u2322", + sharp: "\u266F", + shchcy: "\u0449", + shcy: "\u0448", + shortmid: "\u2223", + shortparallel: "\u2225", + shy: "\xAD", + sigma: "\u03C3", + sigmaf: "\u03C2", + sigmav: "\u03C2", + sim: "\u223C", + simdot: "\u2A6A", + sime: "\u2243", + simeq: "\u2243", + simg: "\u2A9E", + simgE: "\u2AA0", + siml: "\u2A9D", + simlE: "\u2A9F", + simne: "\u2246", + simplus: "\u2A24", + simrarr: "\u2972", + slarr: "\u2190", + smallsetminus: "\u2216", + smashp: "\u2A33", + smeparsl: "\u29E4", + smid: "\u2223", + smile: "\u2323", + smt: "\u2AAA", + smte: "\u2AAC", + smtes: "\u2AAC\uFE00", + softcy: "\u044C", + sol: "/", + solb: "\u29C4", + solbar: "\u233F", + sopf: "\u{1D564}", + spades: "\u2660", + spadesuit: "\u2660", + spar: "\u2225", + sqcap: "\u2293", + sqcaps: "\u2293\uFE00", + sqcup: "\u2294", + sqcups: "\u2294\uFE00", + sqsub: "\u228F", + sqsube: "\u2291", + sqsubset: "\u228F", + sqsubseteq: "\u2291", + sqsup: "\u2290", + sqsupe: "\u2292", + sqsupset: "\u2290", + sqsupseteq: "\u2292", + squ: "\u25A1", + square: "\u25A1", + squarf: "\u25AA", + squf: "\u25AA", + srarr: "\u2192", + sscr: "\u{1D4C8}", + ssetmn: "\u2216", + ssmile: "\u2323", + sstarf: "\u22C6", + star: "\u2606", + starf: "\u2605", + straightepsilon: "\u03F5", + straightphi: "\u03D5", + strns: "\xAF", + sub: "\u2282", + subE: "\u2AC5", + subdot: "\u2ABD", + sube: "\u2286", + subedot: "\u2AC3", + submult: "\u2AC1", + subnE: "\u2ACB", + subne: "\u228A", + subplus: "\u2ABF", + subrarr: "\u2979", + subset: "\u2282", + subseteq: "\u2286", + subseteqq: "\u2AC5", + subsetneq: "\u228A", + subsetneqq: "\u2ACB", + subsim: "\u2AC7", + subsub: "\u2AD5", + subsup: "\u2AD3", + succ: "\u227B", + succapprox: "\u2AB8", + succcurlyeq: "\u227D", + succeq: "\u2AB0", + succnapprox: "\u2ABA", + succneqq: "\u2AB6", + succnsim: "\u22E9", + succsim: "\u227F", + sum: "\u2211", + sung: "\u266A", + sup1: "\xB9", + sup2: "\xB2", + sup3: "\xB3", + sup: "\u2283", + supE: "\u2AC6", + supdot: "\u2ABE", + supdsub: "\u2AD8", + supe: "\u2287", + supedot: "\u2AC4", + suphsol: "\u27C9", + suphsub: "\u2AD7", + suplarr: "\u297B", + supmult: "\u2AC2", + supnE: "\u2ACC", + supne: "\u228B", + supplus: "\u2AC0", + supset: "\u2283", + supseteq: "\u2287", + supseteqq: "\u2AC6", + supsetneq: "\u228B", + supsetneqq: "\u2ACC", + supsim: "\u2AC8", + supsub: "\u2AD4", + supsup: "\u2AD6", + swArr: "\u21D9", + swarhk: "\u2926", + swarr: "\u2199", + swarrow: "\u2199", + swnwar: "\u292A", + szlig: "\xDF", + target: "\u2316", + tau: "\u03C4", + tbrk: "\u23B4", + tcaron: "\u0165", + tcedil: "\u0163", + tcy: "\u0442", + tdot: "\u20DB", + telrec: "\u2315", + tfr: "\u{1D531}", + there4: "\u2234", + therefore: "\u2234", + theta: "\u03B8", + thetasym: "\u03D1", + thetav: "\u03D1", + thickapprox: "\u2248", + thicksim: "\u223C", + thinsp: "\u2009", + thkap: "\u2248", + thksim: "\u223C", + thorn: "\xFE", + tilde: "\u02DC", + times: "\xD7", + timesb: "\u22A0", + timesbar: "\u2A31", + timesd: "\u2A30", + tint: "\u222D", + toea: "\u2928", + top: "\u22A4", + topbot: "\u2336", + topcir: "\u2AF1", + topf: "\u{1D565}", + topfork: "\u2ADA", + tosa: "\u2929", + tprime: "\u2034", + trade: "\u2122", + triangle: "\u25B5", + triangledown: "\u25BF", + triangleleft: "\u25C3", + trianglelefteq: "\u22B4", + triangleq: "\u225C", + triangleright: "\u25B9", + trianglerighteq: "\u22B5", + tridot: "\u25EC", + trie: "\u225C", + triminus: "\u2A3A", + triplus: "\u2A39", + trisb: "\u29CD", + tritime: "\u2A3B", + trpezium: "\u23E2", + tscr: "\u{1D4C9}", + tscy: "\u0446", + tshcy: "\u045B", + tstrok: "\u0167", + twixt: "\u226C", + twoheadleftarrow: "\u219E", + twoheadrightarrow: "\u21A0", + uArr: "\u21D1", + uHar: "\u2963", + uacute: "\xFA", + uarr: "\u2191", + ubrcy: "\u045E", + ubreve: "\u016D", + ucirc: "\xFB", + ucy: "\u0443", + udarr: "\u21C5", + udblac: "\u0171", + udhar: "\u296E", + ufisht: "\u297E", + ufr: "\u{1D532}", + ugrave: "\xF9", + uharl: "\u21BF", + uharr: "\u21BE", + uhblk: "\u2580", + ulcorn: "\u231C", + ulcorner: "\u231C", + ulcrop: "\u230F", + ultri: "\u25F8", + umacr: "\u016B", + uml: "\xA8", + uogon: "\u0173", + uopf: "\u{1D566}", + uparrow: "\u2191", + updownarrow: "\u2195", + upharpoonleft: "\u21BF", + upharpoonright: "\u21BE", + uplus: "\u228E", + upsi: "\u03C5", + upsih: "\u03D2", + upsilon: "\u03C5", + upuparrows: "\u21C8", + urcorn: "\u231D", + urcorner: "\u231D", + urcrop: "\u230E", + uring: "\u016F", + urtri: "\u25F9", + uscr: "\u{1D4CA}", + utdot: "\u22F0", + utilde: "\u0169", + utri: "\u25B5", + utrif: "\u25B4", + uuarr: "\u21C8", + uuml: "\xFC", + uwangle: "\u29A7", + vArr: "\u21D5", + vBar: "\u2AE8", + vBarv: "\u2AE9", + vDash: "\u22A8", + vangrt: "\u299C", + varepsilon: "\u03F5", + varkappa: "\u03F0", + varnothing: "\u2205", + varphi: "\u03D5", + varpi: "\u03D6", + varpropto: "\u221D", + varr: "\u2195", + varrho: "\u03F1", + varsigma: "\u03C2", + varsubsetneq: "\u228A\uFE00", + varsubsetneqq: "\u2ACB\uFE00", + varsupsetneq: "\u228B\uFE00", + varsupsetneqq: "\u2ACC\uFE00", + vartheta: "\u03D1", + vartriangleleft: "\u22B2", + vartriangleright: "\u22B3", + vcy: "\u0432", + vdash: "\u22A2", + vee: "\u2228", + veebar: "\u22BB", + veeeq: "\u225A", + vellip: "\u22EE", + verbar: "|", + vert: "|", + vfr: "\u{1D533}", + vltri: "\u22B2", + vnsub: "\u2282\u20D2", + vnsup: "\u2283\u20D2", + vopf: "\u{1D567}", + vprop: "\u221D", + vrtri: "\u22B3", + vscr: "\u{1D4CB}", + vsubnE: "\u2ACB\uFE00", + vsubne: "\u228A\uFE00", + vsupnE: "\u2ACC\uFE00", + vsupne: "\u228B\uFE00", + vzigzag: "\u299A", + wcirc: "\u0175", + wedbar: "\u2A5F", + wedge: "\u2227", + wedgeq: "\u2259", + weierp: "\u2118", + wfr: "\u{1D534}", + wopf: "\u{1D568}", + wp: "\u2118", + wr: "\u2240", + wreath: "\u2240", + wscr: "\u{1D4CC}", + xcap: "\u22C2", + xcirc: "\u25EF", + xcup: "\u22C3", + xdtri: "\u25BD", + xfr: "\u{1D535}", + xhArr: "\u27FA", + xharr: "\u27F7", + xi: "\u03BE", + xlArr: "\u27F8", + xlarr: "\u27F5", + xmap: "\u27FC", + xnis: "\u22FB", + xodot: "\u2A00", + xopf: "\u{1D569}", + xoplus: "\u2A01", + xotime: "\u2A02", + xrArr: "\u27F9", + xrarr: "\u27F6", + xscr: "\u{1D4CD}", + xsqcup: "\u2A06", + xuplus: "\u2A04", + xutri: "\u25B3", + xvee: "\u22C1", + xwedge: "\u22C0", + yacute: "\xFD", + yacy: "\u044F", + ycirc: "\u0177", + ycy: "\u044B", + yen: "\xA5", + yfr: "\u{1D536}", + yicy: "\u0457", + yopf: "\u{1D56A}", + yscr: "\u{1D4CE}", + yucy: "\u044E", + yuml: "\xFF", + zacute: "\u017A", + zcaron: "\u017E", + zcy: "\u0437", + zdot: "\u017C", + zeetrf: "\u2128", + zeta: "\u03B6", + zfr: "\u{1D537}", + zhcy: "\u0436", + zigrarr: "\u21DD", + zopf: "\u{1D56B}", + zscr: "\u{1D4CF}", + zwj: "\u200D", + zwnj: "\u200C" +}; + +// node_modules/decode-named-character-reference/index.js +var own2 = {}.hasOwnProperty; +function decodeNamedCharacterReference(value) { + return own2.call(characterEntities, value) ? characterEntities[value] : false; +} + +// node_modules/micromark-core-commonmark/lib/character-reference.js +var characterReference = { + name: "characterReference", + tokenize: tokenizeCharacterReference +}; +function tokenizeCharacterReference(effects, ok2, nok) { + const self = this; + let size = 0; + let max; + let test; + return start; + function start(code2) { + effects.enter("characterReference"); + effects.enter("characterReferenceMarker"); + effects.consume(code2); + effects.exit("characterReferenceMarker"); + return open; + } + function open(code2) { + if (code2 === 35) { + effects.enter("characterReferenceMarkerNumeric"); + effects.consume(code2); + effects.exit("characterReferenceMarkerNumeric"); + return numeric; + } + effects.enter("characterReferenceValue"); + max = 31; + test = asciiAlphanumeric; + return value(code2); + } + function numeric(code2) { + if (code2 === 88 || code2 === 120) { + effects.enter("characterReferenceMarkerHexadecimal"); + effects.consume(code2); + effects.exit("characterReferenceMarkerHexadecimal"); + effects.enter("characterReferenceValue"); + max = 6; + test = asciiHexDigit; + return value; + } + effects.enter("characterReferenceValue"); + max = 7; + test = asciiDigit; + return value(code2); + } + function value(code2) { + let token; + if (code2 === 59 && size) { + token = effects.exit("characterReferenceValue"); + if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self.sliceSerialize(token))) { + return nok(code2); + } + effects.enter("characterReferenceMarker"); + effects.consume(code2); + effects.exit("characterReferenceMarker"); + effects.exit("characterReference"); + return ok2; + } + if (test(code2) && size++ < max) { + effects.consume(code2); + return value; + } + return nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/code-fenced.js +var codeFenced = { + name: "codeFenced", + tokenize: tokenizeCodeFenced, + concrete: true +}; +function tokenizeCodeFenced(effects, ok2, nok) { + const self = this; + const closingFenceConstruct = { + tokenize: tokenizeClosingFence, + partial: true + }; + const nonLazyLine = { + tokenize: tokenizeNonLazyLine, + partial: true + }; + const tail = this.events[this.events.length - 1]; + const initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; + let sizeOpen = 0; + let marker; + return start; + function start(code2) { + effects.enter("codeFenced"); + effects.enter("codeFencedFence"); + effects.enter("codeFencedFenceSequence"); + marker = code2; + return sequenceOpen(code2); + } + function sequenceOpen(code2) { + if (code2 === marker) { + effects.consume(code2); + sizeOpen++; + return sequenceOpen; + } + effects.exit("codeFencedFenceSequence"); + return sizeOpen < 3 ? nok(code2) : factorySpace(effects, infoOpen, "whitespace")(code2); + } + function infoOpen(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return openAfter(code2); + } + effects.enter("codeFencedFenceInfo"); + effects.enter("chunkString", { + contentType: "string" + }); + return info(code2); + } + function info(code2) { + if (code2 === null || markdownLineEndingOrSpace(code2)) { + effects.exit("chunkString"); + effects.exit("codeFencedFenceInfo"); + return factorySpace(effects, infoAfter, "whitespace")(code2); + } + if (code2 === 96 && code2 === marker) + return nok(code2); + effects.consume(code2); + return info; + } + function infoAfter(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return openAfter(code2); + } + effects.enter("codeFencedFenceMeta"); + effects.enter("chunkString", { + contentType: "string" + }); + return meta(code2); + } + function meta(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("chunkString"); + effects.exit("codeFencedFenceMeta"); + return openAfter(code2); + } + if (code2 === 96 && code2 === marker) + return nok(code2); + effects.consume(code2); + return meta; + } + function openAfter(code2) { + effects.exit("codeFencedFence"); + return self.interrupt ? ok2(code2) : contentStart(code2); + } + function contentStart(code2) { + if (code2 === null) { + return after(code2); + } + if (markdownLineEnding(code2)) { + return effects.attempt( + nonLazyLine, + effects.attempt( + closingFenceConstruct, + after, + initialPrefix ? factorySpace( + effects, + contentStart, + "linePrefix", + initialPrefix + 1 + ) : contentStart + ), + after + )(code2); + } + effects.enter("codeFlowValue"); + return contentContinue(code2); + } + function contentContinue(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("codeFlowValue"); + return contentStart(code2); + } + effects.consume(code2); + return contentContinue; + } + function after(code2) { + effects.exit("codeFenced"); + return ok2(code2); + } + function tokenizeNonLazyLine(effects2, ok3, nok2) { + const self2 = this; + return start2; + function start2(code2) { + effects2.enter("lineEnding"); + effects2.consume(code2); + effects2.exit("lineEnding"); + return lineStart; + } + function lineStart(code2) { + return self2.parser.lazy[self2.now().line] ? nok2(code2) : ok3(code2); + } + } + function tokenizeClosingFence(effects2, ok3, nok2) { + let size = 0; + return factorySpace( + effects2, + closingSequenceStart, + "linePrefix", + this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + ); + function closingSequenceStart(code2) { + effects2.enter("codeFencedFence"); + effects2.enter("codeFencedFenceSequence"); + return closingSequence(code2); + } + function closingSequence(code2) { + if (code2 === marker) { + effects2.consume(code2); + size++; + return closingSequence; + } + if (size < sizeOpen) + return nok2(code2); + effects2.exit("codeFencedFenceSequence"); + return factorySpace(effects2, closingSequenceEnd, "whitespace")(code2); + } + function closingSequenceEnd(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects2.exit("codeFencedFence"); + return ok3(code2); + } + return nok2(code2); + } + } +} + +// node_modules/micromark-core-commonmark/lib/code-indented.js +var codeIndented = { + name: "codeIndented", + tokenize: tokenizeCodeIndented +}; +var indentedContent = { + tokenize: tokenizeIndentedContent, + partial: true +}; +function tokenizeCodeIndented(effects, ok2, nok) { + const self = this; + return start; + function start(code2) { + effects.enter("codeIndented"); + return factorySpace(effects, afterStartPrefix, "linePrefix", 4 + 1)(code2); + } + function afterStartPrefix(code2) { + const tail = self.events[self.events.length - 1]; + return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? afterPrefix(code2) : nok(code2); + } + function afterPrefix(code2) { + if (code2 === null) { + return after(code2); + } + if (markdownLineEnding(code2)) { + return effects.attempt(indentedContent, afterPrefix, after)(code2); + } + effects.enter("codeFlowValue"); + return content3(code2); + } + function content3(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("codeFlowValue"); + return afterPrefix(code2); + } + effects.consume(code2); + return content3; + } + function after(code2) { + effects.exit("codeIndented"); + return ok2(code2); + } +} +function tokenizeIndentedContent(effects, ok2, nok) { + const self = this; + return start; + function start(code2) { + if (self.parser.lazy[self.now().line]) { + return nok(code2); + } + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return start; + } + return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code2); + } + function afterPrefix(code2) { + const tail = self.events[self.events.length - 1]; + return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok2(code2) : markdownLineEnding(code2) ? start(code2) : nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/code-text.js +var codeText = { + name: "codeText", + tokenize: tokenizeCodeText, + resolve: resolveCodeText, + previous +}; +function resolveCodeText(events) { + let tailExitIndex = events.length - 4; + let headEnterIndex = 3; + let index2; + let enter; + if ((events[headEnterIndex][1].type === "lineEnding" || events[headEnterIndex][1].type === "space") && (events[tailExitIndex][1].type === "lineEnding" || events[tailExitIndex][1].type === "space")) { + index2 = headEnterIndex; + while (++index2 < tailExitIndex) { + if (events[index2][1].type === "codeTextData") { + events[headEnterIndex][1].type = "codeTextPadding"; + events[tailExitIndex][1].type = "codeTextPadding"; + headEnterIndex += 2; + tailExitIndex -= 2; + break; + } + } + } + index2 = headEnterIndex - 1; + tailExitIndex++; + while (++index2 <= tailExitIndex) { + if (enter === void 0) { + if (index2 !== tailExitIndex && events[index2][1].type !== "lineEnding") { + enter = index2; + } + } else if (index2 === tailExitIndex || events[index2][1].type === "lineEnding") { + events[enter][1].type = "codeTextData"; + if (index2 !== enter + 2) { + events[enter][1].end = events[index2 - 1][1].end; + events.splice(enter + 2, index2 - enter - 2); + tailExitIndex -= index2 - enter - 2; + index2 = enter + 2; + } + enter = void 0; + } + } + return events; +} +function previous(code2) { + return code2 !== 96 || this.events[this.events.length - 1][1].type === "characterEscape"; +} +function tokenizeCodeText(effects, ok2, nok) { + const self = this; + let sizeOpen = 0; + let size; + let token; + return start; + function start(code2) { + effects.enter("codeText"); + effects.enter("codeTextSequence"); + return openingSequence(code2); + } + function openingSequence(code2) { + if (code2 === 96) { + effects.consume(code2); + sizeOpen++; + return openingSequence; + } + effects.exit("codeTextSequence"); + return gap(code2); + } + function gap(code2) { + if (code2 === null) { + return nok(code2); + } + if (code2 === 96) { + token = effects.enter("codeTextSequence"); + size = 0; + return closingSequence(code2); + } + if (code2 === 32) { + effects.enter("space"); + effects.consume(code2); + effects.exit("space"); + return gap; + } + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return gap; + } + effects.enter("codeTextData"); + return data(code2); + } + function data(code2) { + if (code2 === null || code2 === 32 || code2 === 96 || markdownLineEnding(code2)) { + effects.exit("codeTextData"); + return gap(code2); + } + effects.consume(code2); + return data; + } + function closingSequence(code2) { + if (code2 === 96) { + effects.consume(code2); + size++; + return closingSequence; + } + if (size === sizeOpen) { + effects.exit("codeTextSequence"); + effects.exit("codeText"); + return ok2(code2); + } + token.type = "codeTextData"; + return data(code2); + } +} + +// node_modules/micromark-util-subtokenize/index.js +function subtokenize(events) { + const jumps = {}; + let index2 = -1; + let event; + let lineIndex; + let otherIndex; + let otherEvent; + let parameters; + let subevents; + let more; + while (++index2 < events.length) { + while (index2 in jumps) { + index2 = jumps[index2]; + } + event = events[index2]; + if (index2 && event[1].type === "chunkFlow" && events[index2 - 1][1].type === "listItemPrefix") { + subevents = event[1]._tokenizer.events; + otherIndex = 0; + if (otherIndex < subevents.length && subevents[otherIndex][1].type === "lineEndingBlank") { + otherIndex += 2; + } + if (otherIndex < subevents.length && subevents[otherIndex][1].type === "content") { + while (++otherIndex < subevents.length) { + if (subevents[otherIndex][1].type === "content") { + break; + } + if (subevents[otherIndex][1].type === "chunkText") { + subevents[otherIndex][1]._isInFirstContentOfListItem = true; + otherIndex++; + } + } + } + } + if (event[0] === "enter") { + if (event[1].contentType) { + Object.assign(jumps, subcontent(events, index2)); + index2 = jumps[index2]; + more = true; + } + } else if (event[1]._container) { + otherIndex = index2; + lineIndex = void 0; + while (otherIndex--) { + otherEvent = events[otherIndex]; + if (otherEvent[1].type === "lineEnding" || otherEvent[1].type === "lineEndingBlank") { + if (otherEvent[0] === "enter") { + if (lineIndex) { + events[lineIndex][1].type = "lineEndingBlank"; + } + otherEvent[1].type = "lineEnding"; + lineIndex = otherIndex; + } + } else { + break; + } + } + if (lineIndex) { + event[1].end = Object.assign({}, events[lineIndex][1].start); + parameters = events.slice(lineIndex, index2); + parameters.unshift(event); + splice(events, lineIndex, index2 - lineIndex + 1, parameters); + } + } + } + return !more; +} +function subcontent(events, eventIndex) { + const token = events[eventIndex][1]; + const context = events[eventIndex][2]; + let startPosition = eventIndex - 1; + const startPositions = []; + const tokenizer = token._tokenizer || context.parser[token.contentType](token.start); + const childEvents = tokenizer.events; + const jumps = []; + const gaps = {}; + let stream; + let previous2; + let index2 = -1; + let current = token; + let adjust = 0; + let start = 0; + const breaks = [start]; + while (current) { + while (events[++startPosition][1] !== current) { + } + startPositions.push(startPosition); + if (!current._tokenizer) { + stream = context.sliceStream(current); + if (!current.next) { + stream.push(null); + } + if (previous2) { + tokenizer.defineSkip(current.start); + } + if (current._isInFirstContentOfListItem) { + tokenizer._gfmTasklistFirstContentOfListItem = true; + } + tokenizer.write(stream); + if (current._isInFirstContentOfListItem) { + tokenizer._gfmTasklistFirstContentOfListItem = void 0; + } + } + previous2 = current; + current = current.next; + } + current = token; + while (++index2 < childEvents.length) { + if (childEvents[index2][0] === "exit" && childEvents[index2 - 1][0] === "enter" && childEvents[index2][1].type === childEvents[index2 - 1][1].type && childEvents[index2][1].start.line !== childEvents[index2][1].end.line) { + start = index2 + 1; + breaks.push(start); + current._tokenizer = void 0; + current.previous = void 0; + current = current.next; + } + } + tokenizer.events = []; + if (current) { + current._tokenizer = void 0; + current.previous = void 0; + } else { + breaks.pop(); + } + index2 = breaks.length; + while (index2--) { + const slice = childEvents.slice(breaks[index2], breaks[index2 + 1]); + const start2 = startPositions.pop(); + jumps.unshift([start2, start2 + slice.length - 1]); + splice(events, start2, 2, slice); + } + index2 = -1; + while (++index2 < jumps.length) { + gaps[adjust + jumps[index2][0]] = adjust + jumps[index2][1]; + adjust += jumps[index2][1] - jumps[index2][0] - 1; + } + return gaps; +} + +// node_modules/micromark-core-commonmark/lib/content.js +var content2 = { + tokenize: tokenizeContent, + resolve: resolveContent +}; +var continuationConstruct = { + tokenize: tokenizeContinuation, + partial: true +}; +function resolveContent(events) { + subtokenize(events); + return events; +} +function tokenizeContent(effects, ok2) { + let previous2; + return start; + function start(code2) { + effects.enter("content"); + previous2 = effects.enter("chunkContent", { + contentType: "content" + }); + return data(code2); + } + function data(code2) { + if (code2 === null) { + return contentEnd(code2); + } + if (markdownLineEnding(code2)) { + return effects.check( + continuationConstruct, + contentContinue, + contentEnd + )(code2); + } + effects.consume(code2); + return data; + } + function contentEnd(code2) { + effects.exit("chunkContent"); + effects.exit("content"); + return ok2(code2); + } + function contentContinue(code2) { + effects.consume(code2); + effects.exit("chunkContent"); + previous2.next = effects.enter("chunkContent", { + contentType: "content", + previous: previous2 + }); + previous2 = previous2.next; + return data; + } +} +function tokenizeContinuation(effects, ok2, nok) { + const self = this; + return startLookahead; + function startLookahead(code2) { + effects.exit("chunkContent"); + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return factorySpace(effects, prefixed, "linePrefix"); + } + function prefixed(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return nok(code2); + } + const tail = self.events[self.events.length - 1]; + if (!self.parser.constructs.disable.null.includes("codeIndented") && tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4) { + return ok2(code2); + } + return effects.interrupt(self.parser.constructs.flow, nok, ok2)(code2); + } +} + +// node_modules/micromark-factory-destination/index.js +function factoryDestination(effects, ok2, nok, type, literalType, literalMarkerType, rawType, stringType, max) { + const limit = max || Number.POSITIVE_INFINITY; + let balance = 0; + return start; + function start(code2) { + if (code2 === 60) { + effects.enter(type); + effects.enter(literalType); + effects.enter(literalMarkerType); + effects.consume(code2); + effects.exit(literalMarkerType); + return destinationEnclosedBefore; + } + if (code2 === null || code2 === 41 || asciiControl(code2)) { + return nok(code2); + } + effects.enter(type); + effects.enter(rawType); + effects.enter(stringType); + effects.enter("chunkString", { + contentType: "string" + }); + return destinationRaw(code2); + } + function destinationEnclosedBefore(code2) { + if (code2 === 62) { + effects.enter(literalMarkerType); + effects.consume(code2); + effects.exit(literalMarkerType); + effects.exit(literalType); + effects.exit(type); + return ok2; + } + effects.enter(stringType); + effects.enter("chunkString", { + contentType: "string" + }); + return destinationEnclosed(code2); + } + function destinationEnclosed(code2) { + if (code2 === 62) { + effects.exit("chunkString"); + effects.exit(stringType); + return destinationEnclosedBefore(code2); + } + if (code2 === null || code2 === 60 || markdownLineEnding(code2)) { + return nok(code2); + } + effects.consume(code2); + return code2 === 92 ? destinationEnclosedEscape : destinationEnclosed; + } + function destinationEnclosedEscape(code2) { + if (code2 === 60 || code2 === 62 || code2 === 92) { + effects.consume(code2); + return destinationEnclosed; + } + return destinationEnclosed(code2); + } + function destinationRaw(code2) { + if (code2 === 40) { + if (++balance > limit) + return nok(code2); + effects.consume(code2); + return destinationRaw; + } + if (code2 === 41) { + if (!balance--) { + effects.exit("chunkString"); + effects.exit(stringType); + effects.exit(rawType); + effects.exit(type); + return ok2(code2); + } + effects.consume(code2); + return destinationRaw; + } + if (code2 === null || markdownLineEndingOrSpace(code2)) { + if (balance) + return nok(code2); + effects.exit("chunkString"); + effects.exit(stringType); + effects.exit(rawType); + effects.exit(type); + return ok2(code2); + } + if (asciiControl(code2)) + return nok(code2); + effects.consume(code2); + return code2 === 92 ? destinationRawEscape : destinationRaw; + } + function destinationRawEscape(code2) { + if (code2 === 40 || code2 === 41 || code2 === 92) { + effects.consume(code2); + return destinationRaw; + } + return destinationRaw(code2); + } +} + +// node_modules/micromark-factory-label/index.js +function factoryLabel(effects, ok2, nok, type, markerType, stringType) { + const self = this; + let size = 0; + let data; + return start; + function start(code2) { + effects.enter(type); + effects.enter(markerType); + effects.consume(code2); + effects.exit(markerType); + effects.enter(stringType); + return atBreak; + } + function atBreak(code2) { + if (code2 === null || code2 === 91 || code2 === 93 && !data || code2 === 94 && !size && "_hiddenFootnoteSupport" in self.parser.constructs || size > 999) { + return nok(code2); + } + if (code2 === 93) { + effects.exit(stringType); + effects.enter(markerType); + effects.consume(code2); + effects.exit(markerType); + effects.exit(type); + return ok2; + } + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return atBreak; + } + effects.enter("chunkString", { + contentType: "string" + }); + return label(code2); + } + function label(code2) { + if (code2 === null || code2 === 91 || code2 === 93 || markdownLineEnding(code2) || size++ > 999) { + effects.exit("chunkString"); + return atBreak(code2); + } + effects.consume(code2); + data = data || !markdownSpace(code2); + return code2 === 92 ? labelEscape : label; + } + function labelEscape(code2) { + if (code2 === 91 || code2 === 92 || code2 === 93) { + effects.consume(code2); + size++; + return label; + } + return label(code2); + } +} + +// node_modules/micromark-factory-title/index.js +function factoryTitle(effects, ok2, nok, type, markerType, stringType) { + let marker; + return start; + function start(code2) { + effects.enter(type); + effects.enter(markerType); + effects.consume(code2); + effects.exit(markerType); + marker = code2 === 40 ? 41 : code2; + return atFirstTitleBreak; + } + function atFirstTitleBreak(code2) { + if (code2 === marker) { + effects.enter(markerType); + effects.consume(code2); + effects.exit(markerType); + effects.exit(type); + return ok2; + } + effects.enter(stringType); + return atTitleBreak(code2); + } + function atTitleBreak(code2) { + if (code2 === marker) { + effects.exit(stringType); + return atFirstTitleBreak(marker); + } + if (code2 === null) { + return nok(code2); + } + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return factorySpace(effects, atTitleBreak, "linePrefix"); + } + effects.enter("chunkString", { + contentType: "string" + }); + return title(code2); + } + function title(code2) { + if (code2 === marker || code2 === null || markdownLineEnding(code2)) { + effects.exit("chunkString"); + return atTitleBreak(code2); + } + effects.consume(code2); + return code2 === 92 ? titleEscape : title; + } + function titleEscape(code2) { + if (code2 === marker || code2 === 92) { + effects.consume(code2); + return title; + } + return title(code2); + } +} + +// node_modules/micromark-factory-whitespace/index.js +function factoryWhitespace(effects, ok2) { + let seen; + return start; + function start(code2) { + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + seen = true; + return start; + } + if (markdownSpace(code2)) { + return factorySpace( + effects, + start, + seen ? "linePrefix" : "lineSuffix" + )(code2); + } + return ok2(code2); + } +} + +// node_modules/micromark-util-normalize-identifier/index.js +function normalizeIdentifier(value) { + return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase(); +} + +// node_modules/micromark-core-commonmark/lib/definition.js +var definition = { + name: "definition", + tokenize: tokenizeDefinition +}; +var titleConstruct = { + tokenize: tokenizeTitle, + partial: true +}; +function tokenizeDefinition(effects, ok2, nok) { + const self = this; + let identifier; + return start; + function start(code2) { + effects.enter("definition"); + return factoryLabel.call( + self, + effects, + labelAfter, + nok, + "definitionLabel", + "definitionLabelMarker", + "definitionLabelString" + )(code2); + } + function labelAfter(code2) { + identifier = normalizeIdentifier( + self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) + ); + if (code2 === 58) { + effects.enter("definitionMarker"); + effects.consume(code2); + effects.exit("definitionMarker"); + return factoryWhitespace( + effects, + factoryDestination( + effects, + effects.attempt( + titleConstruct, + factorySpace(effects, after, "whitespace"), + factorySpace(effects, after, "whitespace") + ), + nok, + "definitionDestination", + "definitionDestinationLiteral", + "definitionDestinationLiteralMarker", + "definitionDestinationRaw", + "definitionDestinationString" + ) + ); + } + return nok(code2); + } + function after(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("definition"); + if (!self.parser.defined.includes(identifier)) { + self.parser.defined.push(identifier); + } + return ok2(code2); + } + return nok(code2); + } +} +function tokenizeTitle(effects, ok2, nok) { + return start; + function start(code2) { + return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, before)(code2) : nok(code2); + } + function before(code2) { + if (code2 === 34 || code2 === 39 || code2 === 40) { + return factoryTitle( + effects, + factorySpace(effects, after, "whitespace"), + nok, + "definitionTitle", + "definitionTitleMarker", + "definitionTitleString" + )(code2); + } + return nok(code2); + } + function after(code2) { + return code2 === null || markdownLineEnding(code2) ? ok2(code2) : nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/hard-break-escape.js +var hardBreakEscape = { + name: "hardBreakEscape", + tokenize: tokenizeHardBreakEscape +}; +function tokenizeHardBreakEscape(effects, ok2, nok) { + return start; + function start(code2) { + effects.enter("hardBreakEscape"); + effects.enter("escapeMarker"); + effects.consume(code2); + return open; + } + function open(code2) { + if (markdownLineEnding(code2)) { + effects.exit("escapeMarker"); + effects.exit("hardBreakEscape"); + return ok2(code2); + } + return nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/heading-atx.js +var headingAtx = { + name: "headingAtx", + tokenize: tokenizeHeadingAtx, + resolve: resolveHeadingAtx +}; +function resolveHeadingAtx(events, context) { + let contentEnd = events.length - 2; + let contentStart = 3; + let content3; + let text4; + if (events[contentStart][1].type === "whitespace") { + contentStart += 2; + } + if (contentEnd - 2 > contentStart && events[contentEnd][1].type === "whitespace") { + contentEnd -= 2; + } + if (events[contentEnd][1].type === "atxHeadingSequence" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === "whitespace")) { + contentEnd -= contentStart + 1 === contentEnd ? 2 : 4; + } + if (contentEnd > contentStart) { + content3 = { + type: "atxHeadingText", + start: events[contentStart][1].start, + end: events[contentEnd][1].end + }; + text4 = { + type: "chunkText", + start: events[contentStart][1].start, + end: events[contentEnd][1].end, + contentType: "text" + }; + splice(events, contentStart, contentEnd - contentStart + 1, [ + ["enter", content3, context], + ["enter", text4, context], + ["exit", text4, context], + ["exit", content3, context] + ]); + } + return events; +} +function tokenizeHeadingAtx(effects, ok2, nok) { + const self = this; + let size = 0; + return start; + function start(code2) { + effects.enter("atxHeading"); + effects.enter("atxHeadingSequence"); + return fenceOpenInside(code2); + } + function fenceOpenInside(code2) { + if (code2 === 35 && size++ < 6) { + effects.consume(code2); + return fenceOpenInside; + } + if (code2 === null || markdownLineEndingOrSpace(code2)) { + effects.exit("atxHeadingSequence"); + return self.interrupt ? ok2(code2) : headingBreak(code2); + } + return nok(code2); + } + function headingBreak(code2) { + if (code2 === 35) { + effects.enter("atxHeadingSequence"); + return sequence(code2); + } + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("atxHeading"); + return ok2(code2); + } + if (markdownSpace(code2)) { + return factorySpace(effects, headingBreak, "whitespace")(code2); + } + effects.enter("atxHeadingText"); + return data(code2); + } + function sequence(code2) { + if (code2 === 35) { + effects.consume(code2); + return sequence; + } + effects.exit("atxHeadingSequence"); + return headingBreak(code2); + } + function data(code2) { + if (code2 === null || code2 === 35 || markdownLineEndingOrSpace(code2)) { + effects.exit("atxHeadingText"); + return headingBreak(code2); + } + effects.consume(code2); + return data; + } +} + +// node_modules/micromark-util-html-tag-name/index.js +var htmlBlockNames = [ + "address", + "article", + "aside", + "base", + "basefont", + "blockquote", + "body", + "caption", + "center", + "col", + "colgroup", + "dd", + "details", + "dialog", + "dir", + "div", + "dl", + "dt", + "fieldset", + "figcaption", + "figure", + "footer", + "form", + "frame", + "frameset", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hr", + "html", + "iframe", + "legend", + "li", + "link", + "main", + "menu", + "menuitem", + "nav", + "noframes", + "ol", + "optgroup", + "option", + "p", + "param", + "section", + "summary", + "table", + "tbody", + "td", + "tfoot", + "th", + "thead", + "title", + "tr", + "track", + "ul" +]; +var htmlRawNames = ["pre", "script", "style", "textarea"]; + +// node_modules/micromark-core-commonmark/lib/html-flow.js +var htmlFlow = { + name: "htmlFlow", + tokenize: tokenizeHtmlFlow, + resolveTo: resolveToHtmlFlow, + concrete: true +}; +var nextBlankConstruct = { + tokenize: tokenizeNextBlank, + partial: true +}; +function resolveToHtmlFlow(events) { + let index2 = events.length; + while (index2--) { + if (events[index2][0] === "enter" && events[index2][1].type === "htmlFlow") { + break; + } + } + if (index2 > 1 && events[index2 - 2][1].type === "linePrefix") { + events[index2][1].start = events[index2 - 2][1].start; + events[index2 + 1][1].start = events[index2 - 2][1].start; + events.splice(index2 - 2, 2); + } + return events; +} +function tokenizeHtmlFlow(effects, ok2, nok) { + const self = this; + let kind; + let startTag; + let buffer2; + let index2; + let marker; + return start; + function start(code2) { + effects.enter("htmlFlow"); + effects.enter("htmlFlowData"); + effects.consume(code2); + return open; + } + function open(code2) { + if (code2 === 33) { + effects.consume(code2); + return declarationStart; + } + if (code2 === 47) { + effects.consume(code2); + return tagCloseStart; + } + if (code2 === 63) { + effects.consume(code2); + kind = 3; + return self.interrupt ? ok2 : continuationDeclarationInside; + } + if (asciiAlpha(code2)) { + effects.consume(code2); + buffer2 = String.fromCharCode(code2); + startTag = true; + return tagName; + } + return nok(code2); + } + function declarationStart(code2) { + if (code2 === 45) { + effects.consume(code2); + kind = 2; + return commentOpenInside; + } + if (code2 === 91) { + effects.consume(code2); + kind = 5; + buffer2 = "CDATA["; + index2 = 0; + return cdataOpenInside; + } + if (asciiAlpha(code2)) { + effects.consume(code2); + kind = 4; + return self.interrupt ? ok2 : continuationDeclarationInside; + } + return nok(code2); + } + function commentOpenInside(code2) { + if (code2 === 45) { + effects.consume(code2); + return self.interrupt ? ok2 : continuationDeclarationInside; + } + return nok(code2); + } + function cdataOpenInside(code2) { + if (code2 === buffer2.charCodeAt(index2++)) { + effects.consume(code2); + return index2 === buffer2.length ? self.interrupt ? ok2 : continuation : cdataOpenInside; + } + return nok(code2); + } + function tagCloseStart(code2) { + if (asciiAlpha(code2)) { + effects.consume(code2); + buffer2 = String.fromCharCode(code2); + return tagName; + } + return nok(code2); + } + function tagName(code2) { + if (code2 === null || code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) { + if (code2 !== 47 && startTag && htmlRawNames.includes(buffer2.toLowerCase())) { + kind = 1; + return self.interrupt ? ok2(code2) : continuation(code2); + } + if (htmlBlockNames.includes(buffer2.toLowerCase())) { + kind = 6; + if (code2 === 47) { + effects.consume(code2); + return basicSelfClosing; + } + return self.interrupt ? ok2(code2) : continuation(code2); + } + kind = 7; + return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code2) : startTag ? completeAttributeNameBefore(code2) : completeClosingTagAfter(code2); + } + if (code2 === 45 || asciiAlphanumeric(code2)) { + effects.consume(code2); + buffer2 += String.fromCharCode(code2); + return tagName; + } + return nok(code2); + } + function basicSelfClosing(code2) { + if (code2 === 62) { + effects.consume(code2); + return self.interrupt ? ok2 : continuation; + } + return nok(code2); + } + function completeClosingTagAfter(code2) { + if (markdownSpace(code2)) { + effects.consume(code2); + return completeClosingTagAfter; + } + return completeEnd(code2); + } + function completeAttributeNameBefore(code2) { + if (code2 === 47) { + effects.consume(code2); + return completeEnd; + } + if (code2 === 58 || code2 === 95 || asciiAlpha(code2)) { + effects.consume(code2); + return completeAttributeName; + } + if (markdownSpace(code2)) { + effects.consume(code2); + return completeAttributeNameBefore; + } + return completeEnd(code2); + } + function completeAttributeName(code2) { + if (code2 === 45 || code2 === 46 || code2 === 58 || code2 === 95 || asciiAlphanumeric(code2)) { + effects.consume(code2); + return completeAttributeName; + } + return completeAttributeNameAfter(code2); + } + function completeAttributeNameAfter(code2) { + if (code2 === 61) { + effects.consume(code2); + return completeAttributeValueBefore; + } + if (markdownSpace(code2)) { + effects.consume(code2); + return completeAttributeNameAfter; + } + return completeAttributeNameBefore(code2); + } + function completeAttributeValueBefore(code2) { + if (code2 === null || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96) { + return nok(code2); + } + if (code2 === 34 || code2 === 39) { + effects.consume(code2); + marker = code2; + return completeAttributeValueQuoted; + } + if (markdownSpace(code2)) { + effects.consume(code2); + return completeAttributeValueBefore; + } + marker = null; + return completeAttributeValueUnquoted(code2); + } + function completeAttributeValueQuoted(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return nok(code2); + } + if (code2 === marker) { + effects.consume(code2); + return completeAttributeValueQuotedAfter; + } + effects.consume(code2); + return completeAttributeValueQuoted; + } + function completeAttributeValueUnquoted(code2) { + if (code2 === null || code2 === 34 || code2 === 39 || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96 || markdownLineEndingOrSpace(code2)) { + return completeAttributeNameAfter(code2); + } + effects.consume(code2); + return completeAttributeValueUnquoted; + } + function completeAttributeValueQuotedAfter(code2) { + if (code2 === 47 || code2 === 62 || markdownSpace(code2)) { + return completeAttributeNameBefore(code2); + } + return nok(code2); + } + function completeEnd(code2) { + if (code2 === 62) { + effects.consume(code2); + return completeAfter; + } + return nok(code2); + } + function completeAfter(code2) { + if (markdownSpace(code2)) { + effects.consume(code2); + return completeAfter; + } + return code2 === null || markdownLineEnding(code2) ? continuation(code2) : nok(code2); + } + function continuation(code2) { + if (code2 === 45 && kind === 2) { + effects.consume(code2); + return continuationCommentInside; + } + if (code2 === 60 && kind === 1) { + effects.consume(code2); + return continuationRawTagOpen; + } + if (code2 === 62 && kind === 4) { + effects.consume(code2); + return continuationClose; + } + if (code2 === 63 && kind === 3) { + effects.consume(code2); + return continuationDeclarationInside; + } + if (code2 === 93 && kind === 5) { + effects.consume(code2); + return continuationCharacterDataInside; + } + if (markdownLineEnding(code2) && (kind === 6 || kind === 7)) { + return effects.check( + nextBlankConstruct, + continuationClose, + continuationAtLineEnding + )(code2); + } + if (code2 === null || markdownLineEnding(code2)) { + return continuationAtLineEnding(code2); + } + effects.consume(code2); + return continuation; + } + function continuationAtLineEnding(code2) { + effects.exit("htmlFlowData"); + return htmlContinueStart(code2); + } + function htmlContinueStart(code2) { + if (code2 === null) { + return done(code2); + } + if (markdownLineEnding(code2)) { + return effects.attempt( + { + tokenize: htmlLineEnd, + partial: true + }, + htmlContinueStart, + done + )(code2); + } + effects.enter("htmlFlowData"); + return continuation(code2); + } + function htmlLineEnd(effects2, ok3, nok2) { + return start2; + function start2(code2) { + effects2.enter("lineEnding"); + effects2.consume(code2); + effects2.exit("lineEnding"); + return lineStart; + } + function lineStart(code2) { + return self.parser.lazy[self.now().line] ? nok2(code2) : ok3(code2); + } + } + function continuationCommentInside(code2) { + if (code2 === 45) { + effects.consume(code2); + return continuationDeclarationInside; + } + return continuation(code2); + } + function continuationRawTagOpen(code2) { + if (code2 === 47) { + effects.consume(code2); + buffer2 = ""; + return continuationRawEndTag; + } + return continuation(code2); + } + function continuationRawEndTag(code2) { + if (code2 === 62 && htmlRawNames.includes(buffer2.toLowerCase())) { + effects.consume(code2); + return continuationClose; + } + if (asciiAlpha(code2) && buffer2.length < 8) { + effects.consume(code2); + buffer2 += String.fromCharCode(code2); + return continuationRawEndTag; + } + return continuation(code2); + } + function continuationCharacterDataInside(code2) { + if (code2 === 93) { + effects.consume(code2); + return continuationDeclarationInside; + } + return continuation(code2); + } + function continuationDeclarationInside(code2) { + if (code2 === 62) { + effects.consume(code2); + return continuationClose; + } + if (code2 === 45 && kind === 2) { + effects.consume(code2); + return continuationDeclarationInside; + } + return continuation(code2); + } + function continuationClose(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("htmlFlowData"); + return done(code2); + } + effects.consume(code2); + return continuationClose; + } + function done(code2) { + effects.exit("htmlFlow"); + return ok2(code2); + } +} +function tokenizeNextBlank(effects, ok2, nok) { + return start; + function start(code2) { + effects.exit("htmlFlowData"); + effects.enter("lineEndingBlank"); + effects.consume(code2); + effects.exit("lineEndingBlank"); + return effects.attempt(blankLine, ok2, nok); + } +} + +// node_modules/micromark-core-commonmark/lib/html-text.js +var htmlText = { + name: "htmlText", + tokenize: tokenizeHtmlText +}; +function tokenizeHtmlText(effects, ok2, nok) { + const self = this; + let marker; + let buffer2; + let index2; + let returnState; + return start; + function start(code2) { + effects.enter("htmlText"); + effects.enter("htmlTextData"); + effects.consume(code2); + return open; + } + function open(code2) { + if (code2 === 33) { + effects.consume(code2); + return declarationOpen; + } + if (code2 === 47) { + effects.consume(code2); + return tagCloseStart; + } + if (code2 === 63) { + effects.consume(code2); + return instruction; + } + if (asciiAlpha(code2)) { + effects.consume(code2); + return tagOpen; + } + return nok(code2); + } + function declarationOpen(code2) { + if (code2 === 45) { + effects.consume(code2); + return commentOpen; + } + if (code2 === 91) { + effects.consume(code2); + buffer2 = "CDATA["; + index2 = 0; + return cdataOpen; + } + if (asciiAlpha(code2)) { + effects.consume(code2); + return declaration; + } + return nok(code2); + } + function commentOpen(code2) { + if (code2 === 45) { + effects.consume(code2); + return commentStart; + } + return nok(code2); + } + function commentStart(code2) { + if (code2 === null || code2 === 62) { + return nok(code2); + } + if (code2 === 45) { + effects.consume(code2); + return commentStartDash; + } + return comment(code2); + } + function commentStartDash(code2) { + if (code2 === null || code2 === 62) { + return nok(code2); + } + return comment(code2); + } + function comment(code2) { + if (code2 === null) { + return nok(code2); + } + if (code2 === 45) { + effects.consume(code2); + return commentClose; + } + if (markdownLineEnding(code2)) { + returnState = comment; + return atLineEnding(code2); + } + effects.consume(code2); + return comment; + } + function commentClose(code2) { + if (code2 === 45) { + effects.consume(code2); + return end; + } + return comment(code2); + } + function cdataOpen(code2) { + if (code2 === buffer2.charCodeAt(index2++)) { + effects.consume(code2); + return index2 === buffer2.length ? cdata : cdataOpen; + } + return nok(code2); + } + function cdata(code2) { + if (code2 === null) { + return nok(code2); + } + if (code2 === 93) { + effects.consume(code2); + return cdataClose; + } + if (markdownLineEnding(code2)) { + returnState = cdata; + return atLineEnding(code2); + } + effects.consume(code2); + return cdata; + } + function cdataClose(code2) { + if (code2 === 93) { + effects.consume(code2); + return cdataEnd; + } + return cdata(code2); + } + function cdataEnd(code2) { + if (code2 === 62) { + return end(code2); + } + if (code2 === 93) { + effects.consume(code2); + return cdataEnd; + } + return cdata(code2); + } + function declaration(code2) { + if (code2 === null || code2 === 62) { + return end(code2); + } + if (markdownLineEnding(code2)) { + returnState = declaration; + return atLineEnding(code2); + } + effects.consume(code2); + return declaration; + } + function instruction(code2) { + if (code2 === null) { + return nok(code2); + } + if (code2 === 63) { + effects.consume(code2); + return instructionClose; + } + if (markdownLineEnding(code2)) { + returnState = instruction; + return atLineEnding(code2); + } + effects.consume(code2); + return instruction; + } + function instructionClose(code2) { + return code2 === 62 ? end(code2) : instruction(code2); + } + function tagCloseStart(code2) { + if (asciiAlpha(code2)) { + effects.consume(code2); + return tagClose; + } + return nok(code2); + } + function tagClose(code2) { + if (code2 === 45 || asciiAlphanumeric(code2)) { + effects.consume(code2); + return tagClose; + } + return tagCloseBetween(code2); + } + function tagCloseBetween(code2) { + if (markdownLineEnding(code2)) { + returnState = tagCloseBetween; + return atLineEnding(code2); + } + if (markdownSpace(code2)) { + effects.consume(code2); + return tagCloseBetween; + } + return end(code2); + } + function tagOpen(code2) { + if (code2 === 45 || asciiAlphanumeric(code2)) { + effects.consume(code2); + return tagOpen; + } + if (code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) { + return tagOpenBetween(code2); + } + return nok(code2); + } + function tagOpenBetween(code2) { + if (code2 === 47) { + effects.consume(code2); + return end; + } + if (code2 === 58 || code2 === 95 || asciiAlpha(code2)) { + effects.consume(code2); + return tagOpenAttributeName; + } + if (markdownLineEnding(code2)) { + returnState = tagOpenBetween; + return atLineEnding(code2); + } + if (markdownSpace(code2)) { + effects.consume(code2); + return tagOpenBetween; + } + return end(code2); + } + function tagOpenAttributeName(code2) { + if (code2 === 45 || code2 === 46 || code2 === 58 || code2 === 95 || asciiAlphanumeric(code2)) { + effects.consume(code2); + return tagOpenAttributeName; + } + return tagOpenAttributeNameAfter(code2); + } + function tagOpenAttributeNameAfter(code2) { + if (code2 === 61) { + effects.consume(code2); + return tagOpenAttributeValueBefore; + } + if (markdownLineEnding(code2)) { + returnState = tagOpenAttributeNameAfter; + return atLineEnding(code2); + } + if (markdownSpace(code2)) { + effects.consume(code2); + return tagOpenAttributeNameAfter; + } + return tagOpenBetween(code2); + } + function tagOpenAttributeValueBefore(code2) { + if (code2 === null || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96) { + return nok(code2); + } + if (code2 === 34 || code2 === 39) { + effects.consume(code2); + marker = code2; + return tagOpenAttributeValueQuoted; + } + if (markdownLineEnding(code2)) { + returnState = tagOpenAttributeValueBefore; + return atLineEnding(code2); + } + if (markdownSpace(code2)) { + effects.consume(code2); + return tagOpenAttributeValueBefore; + } + effects.consume(code2); + marker = void 0; + return tagOpenAttributeValueUnquoted; + } + function tagOpenAttributeValueQuoted(code2) { + if (code2 === marker) { + effects.consume(code2); + return tagOpenAttributeValueQuotedAfter; + } + if (code2 === null) { + return nok(code2); + } + if (markdownLineEnding(code2)) { + returnState = tagOpenAttributeValueQuoted; + return atLineEnding(code2); + } + effects.consume(code2); + return tagOpenAttributeValueQuoted; + } + function tagOpenAttributeValueQuotedAfter(code2) { + if (code2 === 62 || code2 === 47 || markdownLineEndingOrSpace(code2)) { + return tagOpenBetween(code2); + } + return nok(code2); + } + function tagOpenAttributeValueUnquoted(code2) { + if (code2 === null || code2 === 34 || code2 === 39 || code2 === 60 || code2 === 61 || code2 === 96) { + return nok(code2); + } + if (code2 === 62 || markdownLineEndingOrSpace(code2)) { + return tagOpenBetween(code2); + } + effects.consume(code2); + return tagOpenAttributeValueUnquoted; + } + function atLineEnding(code2) { + effects.exit("htmlTextData"); + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return factorySpace( + effects, + afterPrefix, + "linePrefix", + self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + ); + } + function afterPrefix(code2) { + effects.enter("htmlTextData"); + return returnState(code2); + } + function end(code2) { + if (code2 === 62) { + effects.consume(code2); + effects.exit("htmlTextData"); + effects.exit("htmlText"); + return ok2; + } + return nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/label-end.js +var labelEnd = { + name: "labelEnd", + tokenize: tokenizeLabelEnd, + resolveTo: resolveToLabelEnd, + resolveAll: resolveAllLabelEnd +}; +var resourceConstruct = { + tokenize: tokenizeResource +}; +var fullReferenceConstruct = { + tokenize: tokenizeFullReference +}; +var collapsedReferenceConstruct = { + tokenize: tokenizeCollapsedReference +}; +function resolveAllLabelEnd(events) { + let index2 = -1; + let token; + while (++index2 < events.length) { + token = events[index2][1]; + if (token.type === "labelImage" || token.type === "labelLink" || token.type === "labelEnd") { + events.splice(index2 + 1, token.type === "labelImage" ? 4 : 2); + token.type = "data"; + index2++; + } + } + return events; +} +function resolveToLabelEnd(events, context) { + let index2 = events.length; + let offset = 0; + let token; + let open; + let close; + let media; + while (index2--) { + token = events[index2][1]; + if (open) { + if (token.type === "link" || token.type === "labelLink" && token._inactive) { + break; + } + if (events[index2][0] === "enter" && token.type === "labelLink") { + token._inactive = true; + } + } else if (close) { + if (events[index2][0] === "enter" && (token.type === "labelImage" || token.type === "labelLink") && !token._balanced) { + open = index2; + if (token.type !== "labelLink") { + offset = 2; + break; + } + } + } else if (token.type === "labelEnd") { + close = index2; + } + } + const group = { + type: events[open][1].type === "labelLink" ? "link" : "image", + start: Object.assign({}, events[open][1].start), + end: Object.assign({}, events[events.length - 1][1].end) + }; + const label = { + type: "label", + start: Object.assign({}, events[open][1].start), + end: Object.assign({}, events[close][1].end) + }; + const text4 = { + type: "labelText", + start: Object.assign({}, events[open + offset + 2][1].end), + end: Object.assign({}, events[close - 2][1].start) + }; + media = [ + ["enter", group, context], + ["enter", label, context] + ]; + media = push(media, events.slice(open + 1, open + offset + 3)); + media = push(media, [["enter", text4, context]]); + media = push( + media, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + offset + 4, close - 3), + context + ) + ); + media = push(media, [ + ["exit", text4, context], + events[close - 2], + events[close - 1], + ["exit", label, context] + ]); + media = push(media, events.slice(close + 1)); + media = push(media, [["exit", group, context]]); + splice(events, open, events.length, media); + return events; +} +function tokenizeLabelEnd(effects, ok2, nok) { + const self = this; + let index2 = self.events.length; + let labelStart; + let defined; + while (index2--) { + if ((self.events[index2][1].type === "labelImage" || self.events[index2][1].type === "labelLink") && !self.events[index2][1]._balanced) { + labelStart = self.events[index2][1]; + break; + } + } + return start; + function start(code2) { + if (!labelStart) { + return nok(code2); + } + if (labelStart._inactive) + return balanced(code2); + defined = self.parser.defined.includes( + normalizeIdentifier( + self.sliceSerialize({ + start: labelStart.end, + end: self.now() + }) + ) + ); + effects.enter("labelEnd"); + effects.enter("labelMarker"); + effects.consume(code2); + effects.exit("labelMarker"); + effects.exit("labelEnd"); + return afterLabelEnd; + } + function afterLabelEnd(code2) { + if (code2 === 40) { + return effects.attempt( + resourceConstruct, + ok2, + defined ? ok2 : balanced + )(code2); + } + if (code2 === 91) { + return effects.attempt( + fullReferenceConstruct, + ok2, + defined ? effects.attempt(collapsedReferenceConstruct, ok2, balanced) : balanced + )(code2); + } + return defined ? ok2(code2) : balanced(code2); + } + function balanced(code2) { + labelStart._balanced = true; + return nok(code2); + } +} +function tokenizeResource(effects, ok2, nok) { + return start; + function start(code2) { + effects.enter("resource"); + effects.enter("resourceMarker"); + effects.consume(code2); + effects.exit("resourceMarker"); + return factoryWhitespace(effects, open); + } + function open(code2) { + if (code2 === 41) { + return end(code2); + } + return factoryDestination( + effects, + destinationAfter, + nok, + "resourceDestination", + "resourceDestinationLiteral", + "resourceDestinationLiteralMarker", + "resourceDestinationRaw", + "resourceDestinationString", + 32 + )(code2); + } + function destinationAfter(code2) { + return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, between)(code2) : end(code2); + } + function between(code2) { + if (code2 === 34 || code2 === 39 || code2 === 40) { + return factoryTitle( + effects, + factoryWhitespace(effects, end), + nok, + "resourceTitle", + "resourceTitleMarker", + "resourceTitleString" + )(code2); + } + return end(code2); + } + function end(code2) { + if (code2 === 41) { + effects.enter("resourceMarker"); + effects.consume(code2); + effects.exit("resourceMarker"); + effects.exit("resource"); + return ok2; + } + return nok(code2); + } +} +function tokenizeFullReference(effects, ok2, nok) { + const self = this; + return start; + function start(code2) { + return factoryLabel.call( + self, + effects, + afterLabel, + nok, + "reference", + "referenceMarker", + "referenceString" + )(code2); + } + function afterLabel(code2) { + return self.parser.defined.includes( + normalizeIdentifier( + self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) + ) + ) ? ok2(code2) : nok(code2); + } +} +function tokenizeCollapsedReference(effects, ok2, nok) { + return start; + function start(code2) { + effects.enter("reference"); + effects.enter("referenceMarker"); + effects.consume(code2); + effects.exit("referenceMarker"); + return open; + } + function open(code2) { + if (code2 === 93) { + effects.enter("referenceMarker"); + effects.consume(code2); + effects.exit("referenceMarker"); + effects.exit("reference"); + return ok2; + } + return nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/label-start-image.js +var labelStartImage = { + name: "labelStartImage", + tokenize: tokenizeLabelStartImage, + resolveAll: labelEnd.resolveAll +}; +function tokenizeLabelStartImage(effects, ok2, nok) { + const self = this; + return start; + function start(code2) { + effects.enter("labelImage"); + effects.enter("labelImageMarker"); + effects.consume(code2); + effects.exit("labelImageMarker"); + return open; + } + function open(code2) { + if (code2 === 91) { + effects.enter("labelMarker"); + effects.consume(code2); + effects.exit("labelMarker"); + effects.exit("labelImage"); + return after; + } + return nok(code2); + } + function after(code2) { + return code2 === 94 && "_hiddenFootnoteSupport" in self.parser.constructs ? nok(code2) : ok2(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/label-start-link.js +var labelStartLink = { + name: "labelStartLink", + tokenize: tokenizeLabelStartLink, + resolveAll: labelEnd.resolveAll +}; +function tokenizeLabelStartLink(effects, ok2, nok) { + const self = this; + return start; + function start(code2) { + effects.enter("labelLink"); + effects.enter("labelMarker"); + effects.consume(code2); + effects.exit("labelMarker"); + effects.exit("labelLink"); + return after; + } + function after(code2) { + return code2 === 94 && "_hiddenFootnoteSupport" in self.parser.constructs ? nok(code2) : ok2(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/line-ending.js +var lineEnding = { + name: "lineEnding", + tokenize: tokenizeLineEnding +}; +function tokenizeLineEnding(effects, ok2) { + return start; + function start(code2) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return factorySpace(effects, ok2, "linePrefix"); + } +} + +// node_modules/micromark-core-commonmark/lib/thematic-break.js +var thematicBreak = { + name: "thematicBreak", + tokenize: tokenizeThematicBreak +}; +function tokenizeThematicBreak(effects, ok2, nok) { + let size = 0; + let marker; + return start; + function start(code2) { + effects.enter("thematicBreak"); + marker = code2; + return atBreak(code2); + } + function atBreak(code2) { + if (code2 === marker) { + effects.enter("thematicBreakSequence"); + return sequence(code2); + } + if (markdownSpace(code2)) { + return factorySpace(effects, atBreak, "whitespace")(code2); + } + if (size < 3 || code2 !== null && !markdownLineEnding(code2)) { + return nok(code2); + } + effects.exit("thematicBreak"); + return ok2(code2); + } + function sequence(code2) { + if (code2 === marker) { + effects.consume(code2); + size++; + return sequence; + } + effects.exit("thematicBreakSequence"); + return atBreak(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/list.js +var list = { + name: "list", + tokenize: tokenizeListStart, + continuation: { + tokenize: tokenizeListContinuation + }, + exit: tokenizeListEnd +}; +var listItemPrefixWhitespaceConstruct = { + tokenize: tokenizeListItemPrefixWhitespace, + partial: true +}; +var indentConstruct = { + tokenize: tokenizeIndent, + partial: true +}; +function tokenizeListStart(effects, ok2, nok) { + const self = this; + const tail = self.events[self.events.length - 1]; + let initialSize = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; + let size = 0; + return start; + function start(code2) { + const kind = self.containerState.type || (code2 === 42 || code2 === 43 || code2 === 45 ? "listUnordered" : "listOrdered"); + if (kind === "listUnordered" ? !self.containerState.marker || code2 === self.containerState.marker : asciiDigit(code2)) { + if (!self.containerState.type) { + self.containerState.type = kind; + effects.enter(kind, { + _container: true + }); + } + if (kind === "listUnordered") { + effects.enter("listItemPrefix"); + return code2 === 42 || code2 === 45 ? effects.check(thematicBreak, nok, atMarker)(code2) : atMarker(code2); + } + if (!self.interrupt || code2 === 49) { + effects.enter("listItemPrefix"); + effects.enter("listItemValue"); + return inside(code2); + } + } + return nok(code2); + } + function inside(code2) { + if (asciiDigit(code2) && ++size < 10) { + effects.consume(code2); + return inside; + } + if ((!self.interrupt || size < 2) && (self.containerState.marker ? code2 === self.containerState.marker : code2 === 41 || code2 === 46)) { + effects.exit("listItemValue"); + return atMarker(code2); + } + return nok(code2); + } + function atMarker(code2) { + effects.enter("listItemMarker"); + effects.consume(code2); + effects.exit("listItemMarker"); + self.containerState.marker = self.containerState.marker || code2; + return effects.check( + blankLine, + self.interrupt ? nok : onBlank, + effects.attempt( + listItemPrefixWhitespaceConstruct, + endOfPrefix, + otherPrefix + ) + ); + } + function onBlank(code2) { + self.containerState.initialBlankLine = true; + initialSize++; + return endOfPrefix(code2); + } + function otherPrefix(code2) { + if (markdownSpace(code2)) { + effects.enter("listItemPrefixWhitespace"); + effects.consume(code2); + effects.exit("listItemPrefixWhitespace"); + return endOfPrefix; + } + return nok(code2); + } + function endOfPrefix(code2) { + self.containerState.size = initialSize + self.sliceSerialize(effects.exit("listItemPrefix"), true).length; + return ok2(code2); + } +} +function tokenizeListContinuation(effects, ok2, nok) { + const self = this; + self.containerState._closeFlow = void 0; + return effects.check(blankLine, onBlank, notBlank); + function onBlank(code2) { + self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine; + return factorySpace( + effects, + ok2, + "listItemIndent", + self.containerState.size + 1 + )(code2); + } + function notBlank(code2) { + if (self.containerState.furtherBlankLines || !markdownSpace(code2)) { + self.containerState.furtherBlankLines = void 0; + self.containerState.initialBlankLine = void 0; + return notInCurrentItem(code2); + } + self.containerState.furtherBlankLines = void 0; + self.containerState.initialBlankLine = void 0; + return effects.attempt(indentConstruct, ok2, notInCurrentItem)(code2); + } + function notInCurrentItem(code2) { + self.containerState._closeFlow = true; + self.interrupt = void 0; + return factorySpace( + effects, + effects.attempt(list, ok2, nok), + "linePrefix", + self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + )(code2); + } +} +function tokenizeIndent(effects, ok2, nok) { + const self = this; + return factorySpace( + effects, + afterPrefix, + "listItemIndent", + self.containerState.size + 1 + ); + function afterPrefix(code2) { + const tail = self.events[self.events.length - 1]; + return tail && tail[1].type === "listItemIndent" && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok2(code2) : nok(code2); + } +} +function tokenizeListEnd(effects) { + effects.exit(this.containerState.type); +} +function tokenizeListItemPrefixWhitespace(effects, ok2, nok) { + const self = this; + return factorySpace( + effects, + afterPrefix, + "listItemPrefixWhitespace", + self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + 1 + ); + function afterPrefix(code2) { + const tail = self.events[self.events.length - 1]; + return !markdownSpace(code2) && tail && tail[1].type === "listItemPrefixWhitespace" ? ok2(code2) : nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/setext-underline.js +var setextUnderline = { + name: "setextUnderline", + tokenize: tokenizeSetextUnderline, + resolveTo: resolveToSetextUnderline +}; +function resolveToSetextUnderline(events, context) { + let index2 = events.length; + let content3; + let text4; + let definition3; + while (index2--) { + if (events[index2][0] === "enter") { + if (events[index2][1].type === "content") { + content3 = index2; + break; + } + if (events[index2][1].type === "paragraph") { + text4 = index2; + } + } else { + if (events[index2][1].type === "content") { + events.splice(index2, 1); + } + if (!definition3 && events[index2][1].type === "definition") { + definition3 = index2; + } + } + } + const heading2 = { + type: "setextHeading", + start: Object.assign({}, events[text4][1].start), + end: Object.assign({}, events[events.length - 1][1].end) + }; + events[text4][1].type = "setextHeadingText"; + if (definition3) { + events.splice(text4, 0, ["enter", heading2, context]); + events.splice(definition3 + 1, 0, ["exit", events[content3][1], context]); + events[content3][1].end = Object.assign({}, events[definition3][1].end); + } else { + events[content3][1] = heading2; + } + events.push(["exit", heading2, context]); + return events; +} +function tokenizeSetextUnderline(effects, ok2, nok) { + const self = this; + let index2 = self.events.length; + let marker; + let paragraph2; + while (index2--) { + if (self.events[index2][1].type !== "lineEnding" && self.events[index2][1].type !== "linePrefix" && self.events[index2][1].type !== "content") { + paragraph2 = self.events[index2][1].type === "paragraph"; + break; + } + } + return start; + function start(code2) { + if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph2)) { + effects.enter("setextHeadingLine"); + effects.enter("setextHeadingLineSequence"); + marker = code2; + return closingSequence(code2); + } + return nok(code2); + } + function closingSequence(code2) { + if (code2 === marker) { + effects.consume(code2); + return closingSequence; + } + effects.exit("setextHeadingLineSequence"); + return factorySpace(effects, closingSequenceEnd, "lineSuffix")(code2); + } + function closingSequenceEnd(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("setextHeadingLine"); + return ok2(code2); + } + return nok(code2); + } +} + +// node_modules/micromark/lib/initialize/flow.js +var flow = { + tokenize: initializeFlow +}; +function initializeFlow(effects) { + const self = this; + const initial = effects.attempt( + blankLine, + atBlankEnding, + effects.attempt( + this.parser.constructs.flowInitial, + afterConstruct, + factorySpace( + effects, + effects.attempt( + this.parser.constructs.flow, + afterConstruct, + effects.attempt(content2, afterConstruct) + ), + "linePrefix" + ) + ) + ); + return initial; + function atBlankEnding(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter("lineEndingBlank"); + effects.consume(code2); + effects.exit("lineEndingBlank"); + self.currentConstruct = void 0; + return initial; + } + function afterConstruct(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + self.currentConstruct = void 0; + return initial; + } +} + +// node_modules/micromark/lib/initialize/text.js +var resolver = { + resolveAll: createResolver() +}; +var string = initializeFactory("string"); +var text = initializeFactory("text"); +function initializeFactory(field) { + return { + tokenize: initializeText, + resolveAll: createResolver( + field === "text" ? resolveAllLineSuffixes : void 0 + ) + }; + function initializeText(effects) { + const self = this; + const constructs2 = this.parser.constructs[field]; + const text4 = effects.attempt(constructs2, start, notText); + return start; + function start(code2) { + return atBreak(code2) ? text4(code2) : notText(code2); + } + function notText(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter("data"); + effects.consume(code2); + return data; + } + function data(code2) { + if (atBreak(code2)) { + effects.exit("data"); + return text4(code2); + } + effects.consume(code2); + return data; + } + function atBreak(code2) { + if (code2 === null) { + return true; + } + const list3 = constructs2[code2]; + let index2 = -1; + if (list3) { + while (++index2 < list3.length) { + const item = list3[index2]; + if (!item.previous || item.previous.call(self, self.previous)) { + return true; + } + } + } + return false; + } + } +} +function createResolver(extraResolver) { + return resolveAllText; + function resolveAllText(events, context) { + let index2 = -1; + let enter; + while (++index2 <= events.length) { + if (enter === void 0) { + if (events[index2] && events[index2][1].type === "data") { + enter = index2; + index2++; + } + } else if (!events[index2] || events[index2][1].type !== "data") { + if (index2 !== enter + 2) { + events[enter][1].end = events[index2 - 1][1].end; + events.splice(enter + 2, index2 - enter - 2); + index2 = enter + 2; + } + enter = void 0; + } + } + return extraResolver ? extraResolver(events, context) : events; + } +} +function resolveAllLineSuffixes(events, context) { + let eventIndex = 0; + while (++eventIndex <= events.length) { + if ((eventIndex === events.length || events[eventIndex][1].type === "lineEnding") && events[eventIndex - 1][1].type === "data") { + const data = events[eventIndex - 1][1]; + const chunks = context.sliceStream(data); + let index2 = chunks.length; + let bufferIndex = -1; + let size = 0; + let tabs; + while (index2--) { + const chunk = chunks[index2]; + if (typeof chunk === "string") { + bufferIndex = chunk.length; + while (chunk.charCodeAt(bufferIndex - 1) === 32) { + size++; + bufferIndex--; + } + if (bufferIndex) + break; + bufferIndex = -1; + } else if (chunk === -2) { + tabs = true; + size++; + } else if (chunk === -1) { + } else { + index2++; + break; + } + } + if (size) { + const token = { + type: eventIndex === events.length || tabs || size < 2 ? "lineSuffix" : "hardBreakTrailing", + start: { + line: data.end.line, + column: data.end.column - size, + offset: data.end.offset - size, + _index: data.start._index + index2, + _bufferIndex: index2 ? bufferIndex : data.start._bufferIndex + bufferIndex + }, + end: Object.assign({}, data.end) + }; + data.end = Object.assign({}, token.start); + if (data.start.offset === data.end.offset) { + Object.assign(data, token); + } else { + events.splice( + eventIndex, + 0, + ["enter", token, context], + ["exit", token, context] + ); + eventIndex += 2; + } + } + eventIndex++; + } + } + return events; +} + +// node_modules/micromark/lib/create-tokenizer.js +function createTokenizer(parser, initialize, from) { + let point2 = Object.assign( + from ? Object.assign({}, from) : { + line: 1, + column: 1, + offset: 0 + }, + { + _index: 0, + _bufferIndex: -1 + } + ); + const columnStart = {}; + const resolveAllConstructs = []; + let chunks = []; + let stack = []; + let consumed = true; + const effects = { + consume, + enter, + exit: exit2, + attempt: constructFactory(onsuccessfulconstruct), + check: constructFactory(onsuccessfulcheck), + interrupt: constructFactory(onsuccessfulcheck, { + interrupt: true + }) + }; + const context = { + previous: null, + code: null, + containerState: {}, + events: [], + parser, + sliceStream, + sliceSerialize, + now, + defineSkip, + write + }; + let state = initialize.tokenize.call(context, effects); + let expectedCode; + if (initialize.resolveAll) { + resolveAllConstructs.push(initialize); + } + return context; + function write(slice) { + chunks = push(chunks, slice); + main(); + if (chunks[chunks.length - 1] !== null) { + return []; + } + addResult(initialize, 0); + context.events = resolveAll(resolveAllConstructs, context.events, context); + return context.events; + } + function sliceSerialize(token, expandTabs) { + return serializeChunks(sliceStream(token), expandTabs); + } + function sliceStream(token) { + return sliceChunks(chunks, token); + } + function now() { + return Object.assign({}, point2); + } + function defineSkip(value) { + columnStart[value.line] = value.column; + accountForPotentialSkip(); + } + function main() { + let chunkIndex; + while (point2._index < chunks.length) { + const chunk = chunks[point2._index]; + if (typeof chunk === "string") { + chunkIndex = point2._index; + if (point2._bufferIndex < 0) { + point2._bufferIndex = 0; + } + while (point2._index === chunkIndex && point2._bufferIndex < chunk.length) { + go(chunk.charCodeAt(point2._bufferIndex)); + } + } else { + go(chunk); + } + } + } + function go(code2) { + consumed = void 0; + expectedCode = code2; + state = state(code2); + } + function consume(code2) { + if (markdownLineEnding(code2)) { + point2.line++; + point2.column = 1; + point2.offset += code2 === -3 ? 2 : 1; + accountForPotentialSkip(); + } else if (code2 !== -1) { + point2.column++; + point2.offset++; + } + if (point2._bufferIndex < 0) { + point2._index++; + } else { + point2._bufferIndex++; + if (point2._bufferIndex === chunks[point2._index].length) { + point2._bufferIndex = -1; + point2._index++; + } + } + context.previous = code2; + consumed = true; + } + function enter(type, fields) { + const token = fields || {}; + token.type = type; + token.start = now(); + context.events.push(["enter", token, context]); + stack.push(token); + return token; + } + function exit2(type) { + const token = stack.pop(); + token.end = now(); + context.events.push(["exit", token, context]); + return token; + } + function onsuccessfulconstruct(construct, info) { + addResult(construct, info.from); + } + function onsuccessfulcheck(_, info) { + info.restore(); + } + function constructFactory(onreturn, fields) { + return hook; + function hook(constructs2, returnState, bogusState) { + let listOfConstructs; + let constructIndex; + let currentConstruct; + let info; + return Array.isArray(constructs2) ? handleListOfConstructs(constructs2) : "tokenize" in constructs2 ? handleListOfConstructs([constructs2]) : handleMapOfConstructs(constructs2); + function handleMapOfConstructs(map3) { + return start; + function start(code2) { + const def = code2 !== null && map3[code2]; + const all2 = code2 !== null && map3.null; + const list3 = [ + ...Array.isArray(def) ? def : def ? [def] : [], + ...Array.isArray(all2) ? all2 : all2 ? [all2] : [] + ]; + return handleListOfConstructs(list3)(code2); + } + } + function handleListOfConstructs(list3) { + listOfConstructs = list3; + constructIndex = 0; + if (list3.length === 0) { + return bogusState; + } + return handleConstruct(list3[constructIndex]); + } + function handleConstruct(construct) { + return start; + function start(code2) { + info = store(); + currentConstruct = construct; + if (!construct.partial) { + context.currentConstruct = construct; + } + if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) { + return nok(code2); + } + return construct.tokenize.call( + fields ? Object.assign(Object.create(context), fields) : context, + effects, + ok2, + nok + )(code2); + } + } + function ok2(code2) { + consumed = true; + onreturn(currentConstruct, info); + return returnState; + } + function nok(code2) { + consumed = true; + info.restore(); + if (++constructIndex < listOfConstructs.length) { + return handleConstruct(listOfConstructs[constructIndex]); + } + return bogusState; + } + } + } + function addResult(construct, from2) { + if (construct.resolveAll && !resolveAllConstructs.includes(construct)) { + resolveAllConstructs.push(construct); + } + if (construct.resolve) { + splice( + context.events, + from2, + context.events.length - from2, + construct.resolve(context.events.slice(from2), context) + ); + } + if (construct.resolveTo) { + context.events = construct.resolveTo(context.events, context); + } + } + function store() { + const startPoint = now(); + const startPrevious = context.previous; + const startCurrentConstruct = context.currentConstruct; + const startEventsIndex = context.events.length; + const startStack = Array.from(stack); + return { + restore, + from: startEventsIndex + }; + function restore() { + point2 = startPoint; + context.previous = startPrevious; + context.currentConstruct = startCurrentConstruct; + context.events.length = startEventsIndex; + stack = startStack; + accountForPotentialSkip(); + } + } + function accountForPotentialSkip() { + if (point2.line in columnStart && point2.column < 2) { + point2.column = columnStart[point2.line]; + point2.offset += columnStart[point2.line] - 1; + } + } +} +function sliceChunks(chunks, token) { + const startIndex = token.start._index; + const startBufferIndex = token.start._bufferIndex; + const endIndex = token.end._index; + const endBufferIndex = token.end._bufferIndex; + let view; + if (startIndex === endIndex) { + view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]; + } else { + view = chunks.slice(startIndex, endIndex); + if (startBufferIndex > -1) { + view[0] = view[0].slice(startBufferIndex); + } + if (endBufferIndex > 0) { + view.push(chunks[endIndex].slice(0, endBufferIndex)); + } + } + return view; +} +function serializeChunks(chunks, expandTabs) { + let index2 = -1; + const result = []; + let atTab; + while (++index2 < chunks.length) { + const chunk = chunks[index2]; + let value; + if (typeof chunk === "string") { + value = chunk; + } else + switch (chunk) { + case -5: { + value = "\r"; + break; + } + case -4: { + value = "\n"; + break; + } + case -3: { + value = "\r\n"; + break; + } + case -2: { + value = expandTabs ? " " : " "; + break; + } + case -1: { + if (!expandTabs && atTab) + continue; + value = " "; + break; + } + default: { + value = String.fromCharCode(chunk); + } + } + atTab = chunk === -2; + result.push(value); + } + return result.join(""); +} + +// node_modules/micromark/lib/constructs.js +var constructs_exports = {}; +__export(constructs_exports, { + attentionMarkers: () => attentionMarkers, + contentInitial: () => contentInitial, + disable: () => disable, + document: () => document2, + flow: () => flow2, + flowInitial: () => flowInitial, + insideSpan: () => insideSpan, + string: () => string2, + text: () => text2 +}); +var document2 = { + [42]: list, + [43]: list, + [45]: list, + [48]: list, + [49]: list, + [50]: list, + [51]: list, + [52]: list, + [53]: list, + [54]: list, + [55]: list, + [56]: list, + [57]: list, + [62]: blockQuote +}; +var contentInitial = { + [91]: definition +}; +var flowInitial = { + [-2]: codeIndented, + [-1]: codeIndented, + [32]: codeIndented +}; +var flow2 = { + [35]: headingAtx, + [42]: thematicBreak, + [45]: [setextUnderline, thematicBreak], + [60]: htmlFlow, + [61]: setextUnderline, + [95]: thematicBreak, + [96]: codeFenced, + [126]: codeFenced +}; +var string2 = { + [38]: characterReference, + [92]: characterEscape +}; +var text2 = { + [-5]: lineEnding, + [-4]: lineEnding, + [-3]: lineEnding, + [33]: labelStartImage, + [38]: characterReference, + [42]: attention, + [60]: [autolink, htmlText], + [91]: labelStartLink, + [92]: [hardBreakEscape, characterEscape], + [93]: labelEnd, + [95]: attention, + [96]: codeText +}; +var insideSpan = { + null: [attention, resolver] +}; +var attentionMarkers = { + null: [42, 95] +}; +var disable = { + null: [] +}; + +// node_modules/micromark/lib/parse.js +function parse(options = {}) { + const constructs2 = combineExtensions( + [constructs_exports].concat(options.extensions || []) + ); + const parser = { + defined: [], + lazy: {}, + constructs: constructs2, + content: create(content), + document: create(document), + flow: create(flow), + string: create(string), + text: create(text) + }; + return parser; + function create(initial) { + return creator; + function creator(from) { + return createTokenizer(parser, initial, from); + } + } +} + +// node_modules/micromark/lib/preprocess.js +var search = /[\0\t\n\r]/g; +function preprocess() { + let column = 1; + let buffer2 = ""; + let start = true; + let atCarriageReturn; + return preprocessor; + function preprocessor(value, encoding, end) { + const chunks = []; + let match; + let next; + let startPosition; + let endPosition; + let code2; + value = buffer2 + value.toString(encoding); + startPosition = 0; + buffer2 = ""; + if (start) { + if (value.charCodeAt(0) === 65279) { + startPosition++; + } + start = void 0; + } + while (startPosition < value.length) { + search.lastIndex = startPosition; + match = search.exec(value); + endPosition = match && match.index !== void 0 ? match.index : value.length; + code2 = value.charCodeAt(endPosition); + if (!match) { + buffer2 = value.slice(startPosition); + break; + } + if (code2 === 10 && startPosition === endPosition && atCarriageReturn) { + chunks.push(-3); + atCarriageReturn = void 0; + } else { + if (atCarriageReturn) { + chunks.push(-5); + atCarriageReturn = void 0; + } + if (startPosition < endPosition) { + chunks.push(value.slice(startPosition, endPosition)); + column += endPosition - startPosition; + } + switch (code2) { + case 0: { + chunks.push(65533); + column++; + break; + } + case 9: { + next = Math.ceil(column / 4) * 4; + chunks.push(-2); + while (column++ < next) + chunks.push(-1); + break; + } + case 10: { + chunks.push(-4); + column = 1; + break; + } + default: { + atCarriageReturn = true; + column = 1; + } + } + } + startPosition = endPosition + 1; + } + if (end) { + if (atCarriageReturn) + chunks.push(-5); + if (buffer2) + chunks.push(buffer2); + chunks.push(null); + } + return chunks; + } +} + +// node_modules/micromark/lib/postprocess.js +function postprocess(events) { + while (!subtokenize(events)) { + } + return events; +} + +// node_modules/micromark-util-decode-numeric-character-reference/index.js +function decodeNumericCharacterReference(value, base2) { + const code2 = Number.parseInt(value, base2); + if (code2 < 9 || code2 === 11 || code2 > 13 && code2 < 32 || code2 > 126 && code2 < 160 || code2 > 55295 && code2 < 57344 || code2 > 64975 && code2 < 65008 || (code2 & 65535) === 65535 || (code2 & 65535) === 65534 || code2 > 1114111) { + return "\uFFFD"; + } + return String.fromCharCode(code2); +} + +// node_modules/micromark-util-decode-string/index.js +var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi; +function decodeString(value) { + return value.replace(characterEscapeOrReference, decode); +} +function decode($0, $1, $2) { + if ($1) { + return $1; + } + const head = $2.charCodeAt(0); + if (head === 35) { + const head2 = $2.charCodeAt(1); + const hex = head2 === 120 || head2 === 88; + return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10); + } + return decodeNamedCharacterReference($2) || $0; +} + +// node_modules/mdast-util-from-markdown/lib/index.js +var own3 = {}.hasOwnProperty; +var fromMarkdown = function(value, encoding, options) { + if (typeof encoding !== "string") { + options = encoding; + encoding = void 0; + } + return compiler(options)( + postprocess( + parse(options).document().write(preprocess()(value, encoding, true)) + ) + ); +}; +function compiler(options = {}) { + const config = configure( + { + transforms: [], + canContainEols: [ + "emphasis", + "fragment", + "heading", + "paragraph", + "strong" + ], + enter: { + autolink: opener(link2), + autolinkProtocol: onenterdata, + autolinkEmail: onenterdata, + atxHeading: opener(heading2), + blockQuote: opener(blockQuote2), + characterEscape: onenterdata, + characterReference: onenterdata, + codeFenced: opener(codeFlow), + codeFencedFenceInfo: buffer2, + codeFencedFenceMeta: buffer2, + codeIndented: opener(codeFlow, buffer2), + codeText: opener(codeText2, buffer2), + codeTextData: onenterdata, + data: onenterdata, + codeFlowValue: onenterdata, + definition: opener(definition3), + definitionDestinationString: buffer2, + definitionLabelString: buffer2, + definitionTitleString: buffer2, + emphasis: opener(emphasis2), + hardBreakEscape: opener(hardBreak2), + hardBreakTrailing: opener(hardBreak2), + htmlFlow: opener(html2, buffer2), + htmlFlowData: onenterdata, + htmlText: opener(html2, buffer2), + htmlTextData: onenterdata, + image: opener(image2), + label: buffer2, + link: opener(link2), + listItem: opener(listItem2), + listItemValue: onenterlistitemvalue, + listOrdered: opener(list3, onenterlistordered), + listUnordered: opener(list3), + paragraph: opener(paragraph2), + reference: onenterreference, + referenceString: buffer2, + resourceDestinationString: buffer2, + resourceTitleString: buffer2, + setextHeading: opener(heading2), + strong: opener(strong2), + thematicBreak: opener(thematicBreak3) + }, + exit: { + atxHeading: closer(), + atxHeadingSequence: onexitatxheadingsequence, + autolink: closer(), + autolinkEmail: onexitautolinkemail, + autolinkProtocol: onexitautolinkprotocol, + blockQuote: closer(), + characterEscapeValue: onexitdata, + characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, + characterReferenceMarkerNumeric: onexitcharacterreferencemarker, + characterReferenceValue: onexitcharacterreferencevalue, + codeFenced: closer(onexitcodefenced), + codeFencedFence: onexitcodefencedfence, + codeFencedFenceInfo: onexitcodefencedfenceinfo, + codeFencedFenceMeta: onexitcodefencedfencemeta, + codeFlowValue: onexitdata, + codeIndented: closer(onexitcodeindented), + codeText: closer(onexitcodetext), + codeTextData: onexitdata, + data: onexitdata, + definition: closer(), + definitionDestinationString: onexitdefinitiondestinationstring, + definitionLabelString: onexitdefinitionlabelstring, + definitionTitleString: onexitdefinitiontitlestring, + emphasis: closer(), + hardBreakEscape: closer(onexithardbreak), + hardBreakTrailing: closer(onexithardbreak), + htmlFlow: closer(onexithtmlflow), + htmlFlowData: onexitdata, + htmlText: closer(onexithtmltext), + htmlTextData: onexitdata, + image: closer(onexitimage), + label: onexitlabel, + labelText: onexitlabeltext, + lineEnding: onexitlineending, + link: closer(onexitlink), + listItem: closer(), + listOrdered: closer(), + listUnordered: closer(), + paragraph: closer(), + referenceString: onexitreferencestring, + resourceDestinationString: onexitresourcedestinationstring, + resourceTitleString: onexitresourcetitlestring, + resource: onexitresource, + setextHeading: closer(onexitsetextheading), + setextHeadingLineSequence: onexitsetextheadinglinesequence, + setextHeadingText: onexitsetextheadingtext, + strong: closer(), + thematicBreak: closer() + } + }, + options.mdastExtensions || [] + ); + const data = {}; + return compile; + function compile(events) { + let tree = { + type: "root", + children: [] + }; + const stack = [tree]; + const tokenStack = []; + const listStack = []; + const context = { + stack, + tokenStack, + config, + enter, + exit: exit2, + buffer: buffer2, + resume, + setData, + getData + }; + let index2 = -1; + while (++index2 < events.length) { + if (events[index2][1].type === "listOrdered" || events[index2][1].type === "listUnordered") { + if (events[index2][0] === "enter") { + listStack.push(index2); + } else { + const tail = listStack.pop(); + index2 = prepareList(events, tail, index2); + } + } + } + index2 = -1; + while (++index2 < events.length) { + const handler = config[events[index2][0]]; + if (own3.call(handler, events[index2][1].type)) { + handler[events[index2][1].type].call( + Object.assign( + { + sliceSerialize: events[index2][2].sliceSerialize + }, + context + ), + events[index2][1] + ); + } + } + if (tokenStack.length > 0) { + const tail = tokenStack[tokenStack.length - 1]; + const handler = tail[1] || defaultOnError; + handler.call(context, void 0, tail[0]); + } + tree.position = { + start: point2( + events.length > 0 ? events[0][1].start : { + line: 1, + column: 1, + offset: 0 + } + ), + end: point2( + events.length > 0 ? events[events.length - 2][1].end : { + line: 1, + column: 1, + offset: 0 + } + ) + }; + index2 = -1; + while (++index2 < config.transforms.length) { + tree = config.transforms[index2](tree) || tree; + } + return tree; + } + function prepareList(events, start, length) { + let index2 = start - 1; + let containerBalance = -1; + let listSpread = false; + let listItem3; + let lineIndex; + let firstBlankLineIndex; + let atMarker; + while (++index2 <= length) { + const event = events[index2]; + if (event[1].type === "listUnordered" || event[1].type === "listOrdered" || event[1].type === "blockQuote") { + if (event[0] === "enter") { + containerBalance++; + } else { + containerBalance--; + } + atMarker = void 0; + } else if (event[1].type === "lineEndingBlank") { + if (event[0] === "enter") { + if (listItem3 && !atMarker && !containerBalance && !firstBlankLineIndex) { + firstBlankLineIndex = index2; + } + atMarker = void 0; + } + } else if (event[1].type === "linePrefix" || event[1].type === "listItemValue" || event[1].type === "listItemMarker" || event[1].type === "listItemPrefix" || event[1].type === "listItemPrefixWhitespace") { + } else { + atMarker = void 0; + } + if (!containerBalance && event[0] === "enter" && event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === "exit" && (event[1].type === "listUnordered" || event[1].type === "listOrdered")) { + if (listItem3) { + let tailIndex = index2; + lineIndex = void 0; + while (tailIndex--) { + const tailEvent = events[tailIndex]; + if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") { + if (tailEvent[0] === "exit") + continue; + if (lineIndex) { + events[lineIndex][1].type = "lineEndingBlank"; + listSpread = true; + } + tailEvent[1].type = "lineEnding"; + lineIndex = tailIndex; + } else if (tailEvent[1].type === "linePrefix" || tailEvent[1].type === "blockQuotePrefix" || tailEvent[1].type === "blockQuotePrefixWhitespace" || tailEvent[1].type === "blockQuoteMarker" || tailEvent[1].type === "listItemIndent") { + } else { + break; + } + } + if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) { + listItem3._spread = true; + } + listItem3.end = Object.assign( + {}, + lineIndex ? events[lineIndex][1].start : event[1].end + ); + events.splice(lineIndex || index2, 0, ["exit", listItem3, event[2]]); + index2++; + length++; + } + if (event[1].type === "listItemPrefix") { + listItem3 = { + type: "listItem", + _spread: false, + start: Object.assign({}, event[1].start) + }; + events.splice(index2, 0, ["enter", listItem3, event[2]]); + index2++; + length++; + firstBlankLineIndex = void 0; + atMarker = true; + } + } + } + events[start][1]._spread = listSpread; + return length; + } + function setData(key, value) { + data[key] = value; + } + function getData(key) { + return data[key]; + } + function point2(d) { + return { + line: d.line, + column: d.column, + offset: d.offset + }; + } + function opener(create, and) { + return open; + function open(token) { + enter.call(this, create(token), token); + if (and) + and.call(this, token); + } + } + function buffer2() { + this.stack.push({ + type: "fragment", + children: [] + }); + } + function enter(node, token, errorHandler) { + const parent = this.stack[this.stack.length - 1]; + parent.children.push(node); + this.stack.push(node); + this.tokenStack.push([token, errorHandler]); + node.position = { + start: point2(token.start) + }; + return node; + } + function closer(and) { + return close; + function close(token) { + if (and) + and.call(this, token); + exit2.call(this, token); + } + } + function exit2(token, onExitError) { + const node = this.stack.pop(); + const open = this.tokenStack.pop(); + if (!open) { + throw new Error( + "Cannot close `" + token.type + "` (" + stringifyPosition({ + start: token.start, + end: token.end + }) + "): it\u2019s not open" + ); + } else if (open[0].type !== token.type) { + if (onExitError) { + onExitError.call(this, token, open[0]); + } else { + const handler = open[1] || defaultOnError; + handler.call(this, token, open[0]); + } + } + node.position.end = point2(token.end); + return node; + } + function resume() { + return toString(this.stack.pop()); + } + function onenterlistordered() { + setData("expectingFirstListItemValue", true); + } + function onenterlistitemvalue(token) { + if (getData("expectingFirstListItemValue")) { + const ancestor = this.stack[this.stack.length - 2]; + ancestor.start = Number.parseInt(this.sliceSerialize(token), 10); + setData("expectingFirstListItemValue"); + } + } + function onexitcodefencedfenceinfo() { + const data2 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.lang = data2; + } + function onexitcodefencedfencemeta() { + const data2 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.meta = data2; + } + function onexitcodefencedfence() { + if (getData("flowCodeInside")) + return; + this.buffer(); + setData("flowCodeInside", true); + } + function onexitcodefenced() { + const data2 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data2.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""); + setData("flowCodeInside"); + } + function onexitcodeindented() { + const data2 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data2.replace(/(\r?\n|\r)$/g, ""); + } + function onexitdefinitionlabelstring(token) { + const label = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.label = label; + node.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase(); + } + function onexitdefinitiontitlestring() { + const data2 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.title = data2; + } + function onexitdefinitiondestinationstring() { + const data2 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.url = data2; + } + function onexitatxheadingsequence(token) { + const node = this.stack[this.stack.length - 1]; + if (!node.depth) { + const depth = this.sliceSerialize(token).length; + node.depth = depth; + } + } + function onexitsetextheadingtext() { + setData("setextHeadingSlurpLineEnding", true); + } + function onexitsetextheadinglinesequence(token) { + const node = this.stack[this.stack.length - 1]; + node.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2; + } + function onexitsetextheading() { + setData("setextHeadingSlurpLineEnding"); + } + function onenterdata(token) { + const parent = this.stack[this.stack.length - 1]; + let tail = parent.children[parent.children.length - 1]; + if (!tail || tail.type !== "text") { + tail = text4(); + tail.position = { + start: point2(token.start) + }; + parent.children.push(tail); + } + this.stack.push(tail); + } + function onexitdata(token) { + const tail = this.stack.pop(); + tail.value += this.sliceSerialize(token); + tail.position.end = point2(token.end); + } + function onexitlineending(token) { + const context = this.stack[this.stack.length - 1]; + if (getData("atHardBreak")) { + const tail = context.children[context.children.length - 1]; + tail.position.end = point2(token.end); + setData("atHardBreak"); + return; + } + if (!getData("setextHeadingSlurpLineEnding") && config.canContainEols.includes(context.type)) { + onenterdata.call(this, token); + onexitdata.call(this, token); + } + } + function onexithardbreak() { + setData("atHardBreak", true); + } + function onexithtmlflow() { + const data2 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data2; + } + function onexithtmltext() { + const data2 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data2; + } + function onexitcodetext() { + const data2 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data2; + } + function onexitlink() { + const context = this.stack[this.stack.length - 1]; + if (getData("inReference")) { + context.type += "Reference"; + context.referenceType = getData("referenceType") || "shortcut"; + delete context.url; + delete context.title; + } else { + delete context.identifier; + delete context.label; + } + setData("referenceType"); + } + function onexitimage() { + const context = this.stack[this.stack.length - 1]; + if (getData("inReference")) { + context.type += "Reference"; + context.referenceType = getData("referenceType") || "shortcut"; + delete context.url; + delete context.title; + } else { + delete context.identifier; + delete context.label; + } + setData("referenceType"); + } + function onexitlabeltext(token) { + const ancestor = this.stack[this.stack.length - 2]; + const string3 = this.sliceSerialize(token); + ancestor.label = decodeString(string3); + ancestor.identifier = normalizeIdentifier(string3).toLowerCase(); + } + function onexitlabel() { + const fragment = this.stack[this.stack.length - 1]; + const value = this.resume(); + const node = this.stack[this.stack.length - 1]; + setData("inReference", true); + if (node.type === "link") { + node.children = fragment.children; + } else { + node.alt = value; + } + } + function onexitresourcedestinationstring() { + const data2 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.url = data2; + } + function onexitresourcetitlestring() { + const data2 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.title = data2; + } + function onexitresource() { + setData("inReference"); + } + function onenterreference() { + setData("referenceType", "collapsed"); + } + function onexitreferencestring(token) { + const label = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.label = label; + node.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase(); + setData("referenceType", "full"); + } + function onexitcharacterreferencemarker(token) { + setData("characterReferenceType", token.type); + } + function onexitcharacterreferencevalue(token) { + const data2 = this.sliceSerialize(token); + const type = getData("characterReferenceType"); + let value; + if (type) { + value = decodeNumericCharacterReference( + data2, + type === "characterReferenceMarkerNumeric" ? 10 : 16 + ); + setData("characterReferenceType"); + } else { + value = decodeNamedCharacterReference(data2); + } + const tail = this.stack.pop(); + tail.value += value; + tail.position.end = point2(token.end); + } + function onexitautolinkprotocol(token) { + onexitdata.call(this, token); + const node = this.stack[this.stack.length - 1]; + node.url = this.sliceSerialize(token); + } + function onexitautolinkemail(token) { + onexitdata.call(this, token); + const node = this.stack[this.stack.length - 1]; + node.url = "mailto:" + this.sliceSerialize(token); + } + function blockQuote2() { + return { + type: "blockquote", + children: [] + }; + } + function codeFlow() { + return { + type: "code", + lang: null, + meta: null, + value: "" + }; + } + function codeText2() { + return { + type: "inlineCode", + value: "" + }; + } + function definition3() { + return { + type: "definition", + identifier: "", + label: null, + title: null, + url: "" + }; + } + function emphasis2() { + return { + type: "emphasis", + children: [] + }; + } + function heading2() { + return { + type: "heading", + depth: void 0, + children: [] + }; + } + function hardBreak2() { + return { + type: "break" + }; + } + function html2() { + return { + type: "html", + value: "" + }; + } + function image2() { + return { + type: "image", + title: null, + url: "", + alt: null + }; + } + function link2() { + return { + type: "link", + title: null, + url: "", + children: [] + }; + } + function list3(token) { + return { + type: "list", + ordered: token.type === "listOrdered", + start: null, + spread: token._spread, + children: [] + }; + } + function listItem2(token) { + return { + type: "listItem", + spread: token._spread, + checked: null, + children: [] + }; + } + function paragraph2() { + return { + type: "paragraph", + children: [] + }; + } + function strong2() { + return { + type: "strong", + children: [] + }; + } + function text4() { + return { + type: "text", + value: "" + }; + } + function thematicBreak3() { + return { + type: "thematicBreak" + }; + } +} +function configure(combined, extensions) { + let index2 = -1; + while (++index2 < extensions.length) { + const value = extensions[index2]; + if (Array.isArray(value)) { + configure(combined, value); + } else { + extension(combined, value); + } + } + return combined; +} +function extension(combined, extension2) { + let key; + for (key in extension2) { + if (own3.call(extension2, key)) { + const list3 = key === "canContainEols" || key === "transforms"; + const maybe = own3.call(combined, key) ? combined[key] : void 0; + const left = maybe || (combined[key] = list3 ? [] : {}); + const right = extension2[key]; + if (right) { + if (list3) { + combined[key] = [...left, ...right]; + } else { + Object.assign(left, right); + } + } + } + } +} +function defaultOnError(left, right) { + if (left) { + throw new Error( + "Cannot close `" + left.type + "` (" + stringifyPosition({ + start: left.start, + end: left.end + }) + "): a different token (`" + right.type + "`, " + stringifyPosition({ + start: right.start, + end: right.end + }) + ") is open" + ); + } else { + throw new Error( + "Cannot close document, a token (`" + right.type + "`, " + stringifyPosition({ + start: right.start, + end: right.end + }) + ") is still open" + ); + } +} + +// node_modules/remark/node_modules/remark-parse/lib/index.js +function remarkParse(options) { + const parser = (doc) => { + const settings = this.data("settings"); + return fromMarkdown( + doc, + Object.assign({}, settings, options, { + extensions: this.data("micromarkExtensions") || [], + mdastExtensions: this.data("fromMarkdownExtensions") || [] + }) + ); + }; + Object.assign(this, { Parser: parser }); +} + +// node_modules/remark/node_modules/remark-parse/index.js +var remark_parse_default = remarkParse; + +// node_modules/zwitch/index.js +var own4 = {}.hasOwnProperty; +function zwitch(key, options) { + var settings = options || {}; + function one2(value) { + var fn = one2.invalid; + var handlers = one2.handlers; + if (value && own4.call(value, key)) { + fn = own4.call(handlers, value[key]) ? handlers[value[key]] : one2.unknown; + } + if (fn) { + return fn.apply(this, arguments); + } + } + one2.handlers = settings.handlers || {}; + one2.invalid = settings.invalid; + one2.unknown = settings.unknown; + return one2; +} + +// node_modules/mdast-util-to-markdown/lib/configure.js +function configure2(base2, extension2) { + let index2 = -1; + let key; + if (extension2.extensions) { + while (++index2 < extension2.extensions.length) { + configure2(base2, extension2.extensions[index2]); + } + } + for (key in extension2) { + if (key === "extensions") { + } else if (key === "unsafe" || key === "join") { + base2[key] = [...base2[key] || [], ...extension2[key] || []]; + } else if (key === "handlers") { + base2[key] = Object.assign(base2[key], extension2[key] || {}); + } else { + base2.options[key] = extension2[key]; + } + } + return base2; +} + +// node_modules/mdast-util-to-markdown/lib/util/track.js +function track(options_) { + const options = options_ || {}; + const now = options.now || {}; + let lineShift = options.lineShift || 0; + let line = now.line || 1; + let column = now.column || 1; + return { move, current, shift }; + function current() { + return { now: { line, column }, lineShift }; + } + function shift(value) { + lineShift += value; + } + function move(value = "") { + const chunks = value.split(/\r?\n|\r/g); + const tail = chunks[chunks.length - 1]; + line += chunks.length - 1; + column = chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift; + return value; + } +} + +// node_modules/mdast-util-to-markdown/lib/util/container-flow.js +function containerFlow(parent, context, safeOptions) { + const indexStack = context.indexStack; + const children = parent.children || []; + const tracker = track(safeOptions); + const results = []; + let index2 = -1; + indexStack.push(-1); + while (++index2 < children.length) { + const child = children[index2]; + indexStack[indexStack.length - 1] = index2; + results.push( + tracker.move( + context.handle(child, parent, context, { + before: "\n", + after: "\n", + ...tracker.current() + }) + ) + ); + if (child.type !== "list") { + context.bulletLastUsed = void 0; + } + if (index2 < children.length - 1) { + results.push(tracker.move(between(child, children[index2 + 1]))); + } + } + indexStack.pop(); + return results.join(""); + function between(left, right) { + let index3 = context.join.length; + while (index3--) { + const result = context.join[index3](left, right, parent, context); + if (result === true || result === 1) { + break; + } + if (typeof result === "number") { + return "\n".repeat(1 + result); + } + if (result === false) { + return "\n\n\n\n"; + } + } + return "\n\n"; + } +} + +// node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +var eol = /\r?\n|\r/g; +function indentLines(value, map3) { + const result = []; + let start = 0; + let line = 0; + let match; + while (match = eol.exec(value)) { + one2(value.slice(start, match.index)); + result.push(match[0]); + start = match.index + match[0].length; + line++; + } + one2(value.slice(start)); + return result.join(""); + function one2(value2) { + result.push(map3(value2, line, !value2)); + } +} + +// node_modules/mdast-util-to-markdown/lib/handle/blockquote.js +function blockquote(node, _, context, safeOptions) { + const exit2 = context.enter("blockquote"); + const tracker = track(safeOptions); + tracker.move("> "); + tracker.shift(2); + const value = indentLines( + containerFlow(node, context, tracker.current()), + map + ); + exit2(); + return value; +} +function map(line, _, blank) { + return ">" + (blank ? "" : " ") + line; +} + +// node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js +function patternInScope(stack, pattern) { + return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false); +} +function listInScope(stack, list3, none) { + if (!list3) { + return none; + } + if (typeof list3 === "string") { + list3 = [list3]; + } + let index2 = -1; + while (++index2 < list3.length) { + if (stack.includes(list3[index2])) { + return true; + } + } + return false; +} + +// node_modules/mdast-util-to-markdown/lib/handle/break.js +function hardBreak(_, _1, context, safe2) { + let index2 = -1; + while (++index2 < context.unsafe.length) { + if (context.unsafe[index2].character === "\n" && patternInScope(context.stack, context.unsafe[index2])) { + return /[ \t]/.test(safe2.before) ? "" : " "; + } + } + return "\\\n"; +} + +// node_modules/mdast-util-to-markdown/node_modules/longest-streak/index.js +function longestStreak(value, character) { + const source = String(value); + let index2 = source.indexOf(character); + let expected = index2; + let count = 0; + let max = 0; + if (typeof character !== "string" || character.length !== 1) { + throw new Error("Expected character"); + } + while (index2 !== -1) { + if (index2 === expected) { + if (++count > max) { + max = count; + } + } else { + count = 1; + } + expected = index2 + 1; + index2 = source.indexOf(character, expected); + } + return max; +} + +// node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js +function formatCodeAsIndented(node, context) { + return Boolean( + !context.options.fences && node.value && !node.lang && /[^ \r\n]/.test(node.value) && !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(node.value) + ); +} + +// node_modules/mdast-util-to-markdown/lib/util/check-fence.js +function checkFence(context) { + const marker = context.options.fence || "`"; + if (marker !== "`" && marker !== "~") { + throw new Error( + "Cannot serialize code with `" + marker + "` for `options.fence`, expected `` ` `` or `~`" + ); + } + return marker; +} + +// node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js +function patternCompile(pattern) { + if (!pattern._compiled) { + const before = (pattern.atBreak ? "[\\r\\n][\\t ]*" : "") + (pattern.before ? "(?:" + pattern.before + ")" : ""); + pattern._compiled = new RegExp( + (before ? "(" + before + ")" : "") + (/[|\\{}()[\]^$+*?.-]/.test(pattern.character) ? "\\" : "") + pattern.character + (pattern.after ? "(?:" + pattern.after + ")" : ""), + "g" + ); + } + return pattern._compiled; +} + +// node_modules/mdast-util-to-markdown/lib/util/safe.js +function safe(context, input, config) { + const value = (config.before || "") + (input || "") + (config.after || ""); + const positions = []; + const result = []; + const infos = {}; + let index2 = -1; + while (++index2 < context.unsafe.length) { + const pattern = context.unsafe[index2]; + if (!patternInScope(context.stack, pattern)) { + continue; + } + const expression = patternCompile(pattern); + let match; + while (match = expression.exec(value)) { + const before = "before" in pattern || Boolean(pattern.atBreak); + const after = "after" in pattern; + const position2 = match.index + (before ? match[1].length : 0); + if (positions.includes(position2)) { + if (infos[position2].before && !before) { + infos[position2].before = false; + } + if (infos[position2].after && !after) { + infos[position2].after = false; + } + } else { + positions.push(position2); + infos[position2] = { before, after }; + } + } + } + positions.sort(numerical); + let start = config.before ? config.before.length : 0; + const end = value.length - (config.after ? config.after.length : 0); + index2 = -1; + while (++index2 < positions.length) { + const position2 = positions[index2]; + if (position2 < start || position2 >= end) { + continue; + } + if (position2 + 1 < end && positions[index2 + 1] === position2 + 1 && infos[position2].after && !infos[position2 + 1].before && !infos[position2 + 1].after || positions[index2 - 1] === position2 - 1 && infos[position2].before && !infos[position2 - 1].before && !infos[position2 - 1].after) { + continue; + } + if (start !== position2) { + result.push(escapeBackslashes(value.slice(start, position2), "\\")); + } + start = position2; + if (/[!-/:-@[-`{-~]/.test(value.charAt(position2)) && (!config.encode || !config.encode.includes(value.charAt(position2)))) { + result.push("\\"); + } else { + result.push( + "&#x" + value.charCodeAt(position2).toString(16).toUpperCase() + ";" + ); + start++; + } + } + result.push(escapeBackslashes(value.slice(start, end), config.after)); + return result.join(""); +} +function numerical(a, b) { + return a - b; +} +function escapeBackslashes(value, after) { + const expression = /\\(?=[!-/:-@[-`{-~])/g; + const positions = []; + const results = []; + const whole = value + after; + let index2 = -1; + let start = 0; + let match; + while (match = expression.exec(whole)) { + positions.push(match.index); + } + while (++index2 < positions.length) { + if (start !== positions[index2]) { + results.push(value.slice(start, positions[index2])); + } + results.push("\\"); + start = positions[index2]; + } + results.push(value.slice(start)); + return results.join(""); +} + +// node_modules/mdast-util-to-markdown/lib/handle/code.js +function code(node, _, context, safeOptions) { + const marker = checkFence(context); + const raw = node.value || ""; + const suffix = marker === "`" ? "GraveAccent" : "Tilde"; + if (formatCodeAsIndented(node, context)) { + const exit3 = context.enter("codeIndented"); + const value2 = indentLines(raw, map2); + exit3(); + return value2; + } + const tracker = track(safeOptions); + const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3)); + const exit2 = context.enter("codeFenced"); + let value = tracker.move(sequence); + if (node.lang) { + const subexit = context.enter("codeFencedLang" + suffix); + value += tracker.move( + safe(context, node.lang, { + before: value, + after: " ", + encode: ["`"], + ...tracker.current() + }) + ); + subexit(); + } + if (node.lang && node.meta) { + const subexit = context.enter("codeFencedMeta" + suffix); + value += tracker.move(" "); + value += tracker.move( + safe(context, node.meta, { + before: value, + after: "\n", + encode: ["`"], + ...tracker.current() + }) + ); + subexit(); + } + value += tracker.move("\n"); + if (raw) { + value += tracker.move(raw + "\n"); + } + value += tracker.move(sequence); + exit2(); + return value; +} +function map2(line, _, blank) { + return (blank ? "" : " ") + line; +} + +// node_modules/mdast-util-to-markdown/lib/util/association.js +function association(node) { + if (node.label || !node.identifier) { + return node.label || ""; + } + return decodeString(node.identifier); +} + +// node_modules/mdast-util-to-markdown/lib/util/check-quote.js +function checkQuote(context) { + const marker = context.options.quote || '"'; + if (marker !== '"' && marker !== "'") { + throw new Error( + "Cannot serialize title with `" + marker + "` for `options.quote`, expected `\"`, or `'`" + ); + } + return marker; +} + +// node_modules/mdast-util-to-markdown/lib/handle/definition.js +function definition2(node, _, context, safeOptions) { + const quote = checkQuote(context); + const suffix = quote === '"' ? "Quote" : "Apostrophe"; + const exit2 = context.enter("definition"); + let subexit = context.enter("label"); + const tracker = track(safeOptions); + let value = tracker.move("["); + value += tracker.move( + safe(context, association(node), { + before: value, + after: "]", + ...tracker.current() + }) + ); + value += tracker.move("]: "); + subexit(); + if (!node.url || /[\0- \u007F]/.test(node.url)) { + subexit = context.enter("destinationLiteral"); + value += tracker.move("<"); + value += tracker.move( + safe(context, node.url, { before: value, after: ">", ...tracker.current() }) + ); + value += tracker.move(">"); + } else { + subexit = context.enter("destinationRaw"); + value += tracker.move( + safe(context, node.url, { + before: value, + after: node.title ? " " : "\n", + ...tracker.current() + }) + ); + } + subexit(); + if (node.title) { + subexit = context.enter("title" + suffix); + value += tracker.move(" " + quote); + value += tracker.move( + safe(context, node.title, { + before: value, + after: quote, + ...tracker.current() + }) + ); + value += tracker.move(quote); + subexit(); + } + exit2(); + return value; +} + +// node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js +function checkEmphasis(context) { + const marker = context.options.emphasis || "*"; + if (marker !== "*" && marker !== "_") { + throw new Error( + "Cannot serialize emphasis with `" + marker + "` for `options.emphasis`, expected `*`, or `_`" + ); + } + return marker; +} + +// node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +function containerPhrasing(parent, context, safeOptions) { + const indexStack = context.indexStack; + const children = parent.children || []; + const results = []; + let index2 = -1; + let before = safeOptions.before; + indexStack.push(-1); + let tracker = track(safeOptions); + while (++index2 < children.length) { + const child = children[index2]; + let after; + indexStack[indexStack.length - 1] = index2; + if (index2 + 1 < children.length) { + let handle2 = context.handle.handlers[children[index2 + 1].type]; + if (handle2 && handle2.peek) + handle2 = handle2.peek; + after = handle2 ? handle2(children[index2 + 1], parent, context, { + before: "", + after: "", + ...tracker.current() + }).charAt(0) : ""; + } else { + after = safeOptions.after; + } + if (results.length > 0 && (before === "\r" || before === "\n") && child.type === "html") { + results[results.length - 1] = results[results.length - 1].replace( + /(\r?\n|\r)$/, + " " + ); + before = " "; + tracker = track(safeOptions); + tracker.move(results.join("")); + } + results.push( + tracker.move( + context.handle(child, parent, context, { + ...tracker.current(), + before, + after + }) + ) + ); + before = results[results.length - 1].slice(-1); + } + indexStack.pop(); + return results.join(""); +} + +// node_modules/mdast-util-to-markdown/lib/handle/emphasis.js +emphasis.peek = emphasisPeek; +function emphasis(node, _, context, safeOptions) { + const marker = checkEmphasis(context); + const exit2 = context.enter("emphasis"); + const tracker = track(safeOptions); + let value = tracker.move(marker); + value += tracker.move( + containerPhrasing(node, context, { + before: value, + after: marker, + ...tracker.current() + }) + ); + value += tracker.move(marker); + exit2(); + return value; +} +function emphasisPeek(_, _1, context) { + return context.options.emphasis || "*"; +} + +// node_modules/unist-util-is/index.js +var convert = function(test) { + if (test === void 0 || test === null) { + return ok; + } + if (typeof test === "string") { + return typeFactory(test); + } + if (typeof test === "object") { + return Array.isArray(test) ? anyFactory(test) : propsFactory(test); + } + if (typeof test === "function") { + return castFactory(test); + } + throw new Error("Expected function, string, or object as test"); +}; +function anyFactory(tests) { + const checks = []; + let index2 = -1; + while (++index2 < tests.length) { + checks[index2] = convert(tests[index2]); + } + return castFactory(any); + function any(...parameters) { + let index3 = -1; + while (++index3 < checks.length) { + if (checks[index3].call(this, ...parameters)) + return true; + } + return false; + } +} +function propsFactory(check) { + return castFactory(all2); + function all2(node) { + let key; + for (key in check) { + if (node[key] !== check[key]) + return false; + } + return true; + } +} +function typeFactory(check) { + return castFactory(type); + function type(node) { + return node && node.type === check; + } +} +function castFactory(check) { + return assertion; + function assertion(...parameters) { + return Boolean(check.call(this, ...parameters)); + } +} +function ok() { + return true; +} + +// node_modules/unist-util-visit-parents/color.js +function color(d) { + return "\x1B[33m" + d + "\x1B[39m"; +} + +// node_modules/unist-util-visit-parents/index.js +var CONTINUE = true; +var SKIP = "skip"; +var EXIT = false; +var visitParents = function(tree, test, visitor, reverse) { + if (typeof test === "function" && typeof visitor !== "function") { + reverse = visitor; + visitor = test; + test = null; + } + const is = convert(test); + const step = reverse ? -1 : 1; + factory(tree, null, [])(); + function factory(node, index2, parents) { + const value = typeof node === "object" && node !== null ? node : {}; + let name; + if (typeof value.type === "string") { + name = typeof value.tagName === "string" ? value.tagName : typeof value.name === "string" ? value.name : void 0; + Object.defineProperty(visit2, "name", { + value: "node (" + color(value.type + (name ? "<" + name + ">" : "")) + ")" + }); + } + return visit2; + function visit2() { + let result = []; + let subresult; + let offset; + let grandparents; + if (!test || is(node, index2, parents[parents.length - 1] || null)) { + result = toResult(visitor(node, parents)); + if (result[0] === EXIT) { + return result; + } + } + if (node.children && result[0] !== SKIP) { + offset = (reverse ? node.children.length : -1) + step; + grandparents = parents.concat(node); + while (offset > -1 && offset < node.children.length) { + subresult = factory(node.children[offset], offset, grandparents)(); + if (subresult[0] === EXIT) { + return subresult; + } + offset = typeof subresult[1] === "number" ? subresult[1] : offset + step; + } + } + return result; + } + } +}; +function toResult(value) { + if (Array.isArray(value)) { + return value; + } + if (typeof value === "number") { + return [CONTINUE, value]; + } + return [value]; +} + +// node_modules/mdast-util-to-markdown/node_modules/unist-util-visit/index.js +var visit = function(tree, test, visitor, reverse) { + if (typeof test === "function" && typeof visitor !== "function") { + reverse = visitor; + visitor = test; + test = null; + } + visitParents(tree, test, overload, reverse); + function overload(node, parents) { + const parent = parents[parents.length - 1]; + return visitor( + node, + parent ? parent.children.indexOf(node) : null, + parent + ); + } +}; + +// node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +function formatHeadingAsSetext(node, context) { + let literalWithBreak = false; + visit(node, (node2) => { + if ("value" in node2 && /\r?\n|\r/.test(node2.value) || node2.type === "break") { + literalWithBreak = true; + return EXIT; + } + }); + return Boolean( + (!node.depth || node.depth < 3) && toString(node) && (context.options.setext || literalWithBreak) + ); +} + +// node_modules/mdast-util-to-markdown/lib/handle/heading.js +function heading(node, _, context, safeOptions) { + const rank = Math.max(Math.min(6, node.depth || 1), 1); + const tracker = track(safeOptions); + if (formatHeadingAsSetext(node, context)) { + const exit3 = context.enter("headingSetext"); + const subexit2 = context.enter("phrasing"); + const value2 = containerPhrasing(node, context, { + ...tracker.current(), + before: "\n", + after: "\n" + }); + subexit2(); + exit3(); + return value2 + "\n" + (rank === 1 ? "=" : "-").repeat( + value2.length - (Math.max(value2.lastIndexOf("\r"), value2.lastIndexOf("\n")) + 1) + ); + } + const sequence = "#".repeat(rank); + const exit2 = context.enter("headingAtx"); + const subexit = context.enter("phrasing"); + tracker.move(sequence + " "); + let value = containerPhrasing(node, context, { + before: "# ", + after: "\n", + ...tracker.current() + }); + if (/^[\t ]/.test(value)) { + value = "&#x" + value.charCodeAt(0).toString(16).toUpperCase() + ";" + value.slice(1); + } + value = value ? sequence + " " + value : sequence; + if (context.options.closeAtx) { + value += " " + sequence; + } + subexit(); + exit2(); + return value; +} + +// node_modules/mdast-util-to-markdown/lib/handle/html.js +html.peek = htmlPeek; +function html(node) { + return node.value || ""; +} +function htmlPeek() { + return "<"; +} + +// node_modules/mdast-util-to-markdown/lib/handle/image.js +image.peek = imagePeek; +function image(node, _, context, safeOptions) { + const quote = checkQuote(context); + const suffix = quote === '"' ? "Quote" : "Apostrophe"; + const exit2 = context.enter("image"); + let subexit = context.enter("label"); + const tracker = track(safeOptions); + let value = tracker.move("!["); + value += tracker.move( + safe(context, node.alt, { before: value, after: "]", ...tracker.current() }) + ); + value += tracker.move("]("); + subexit(); + if (!node.url && node.title || /[\0- \u007F]/.test(node.url)) { + subexit = context.enter("destinationLiteral"); + value += tracker.move("<"); + value += tracker.move( + safe(context, node.url, { before: value, after: ">", ...tracker.current() }) + ); + value += tracker.move(">"); + } else { + subexit = context.enter("destinationRaw"); + value += tracker.move( + safe(context, node.url, { + before: value, + after: node.title ? " " : ")", + ...tracker.current() + }) + ); + } + subexit(); + if (node.title) { + subexit = context.enter("title" + suffix); + value += tracker.move(" " + quote); + value += tracker.move( + safe(context, node.title, { + before: value, + after: quote, + ...tracker.current() + }) + ); + value += tracker.move(quote); + subexit(); + } + value += tracker.move(")"); + exit2(); + return value; +} +function imagePeek() { + return "!"; +} + +// node_modules/mdast-util-to-markdown/lib/handle/image-reference.js +imageReference.peek = imageReferencePeek; +function imageReference(node, _, context, safeOptions) { + const type = node.referenceType; + const exit2 = context.enter("imageReference"); + let subexit = context.enter("label"); + const tracker = track(safeOptions); + let value = tracker.move("!["); + const alt = safe(context, node.alt, { + before: value, + after: "]", + ...tracker.current() + }); + value += tracker.move(alt + "]["); + subexit(); + const stack = context.stack; + context.stack = []; + subexit = context.enter("reference"); + const reference = safe(context, association(node), { + before: value, + after: "]", + ...tracker.current() + }); + subexit(); + context.stack = stack; + exit2(); + if (type === "full" || !alt || alt !== reference) { + value += tracker.move(reference + "]"); + } else if (type === "shortcut") { + value = value.slice(0, -1); + } else { + value += tracker.move("]"); + } + return value; +} +function imageReferencePeek() { + return "!"; +} + +// node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +inlineCode.peek = inlineCodePeek; +function inlineCode(node, _, context) { + let value = node.value || ""; + let sequence = "`"; + let index2 = -1; + while (new RegExp("(^|[^`])" + sequence + "([^`]|$)").test(value)) { + sequence += "`"; + } + if (/[^ \r\n]/.test(value) && (/^[ \r\n]/.test(value) && /[ \r\n]$/.test(value) || /^`|`$/.test(value))) { + value = " " + value + " "; + } + while (++index2 < context.unsafe.length) { + const pattern = context.unsafe[index2]; + const expression = patternCompile(pattern); + let match; + if (!pattern.atBreak) + continue; + while (match = expression.exec(value)) { + let position2 = match.index; + if (value.charCodeAt(position2) === 10 && value.charCodeAt(position2 - 1) === 13) { + position2--; + } + value = value.slice(0, position2) + " " + value.slice(match.index + 1); + } + } + return sequence + value + sequence; +} +function inlineCodePeek() { + return "`"; +} + +// node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +function formatLinkAsAutolink(node, context) { + const raw = toString(node); + return Boolean( + !context.options.resourceLink && node.url && !node.title && node.children && node.children.length === 1 && node.children[0].type === "text" && (raw === node.url || "mailto:" + raw === node.url) && /^[a-z][a-z+.-]+:/i.test(node.url) && !/[\0- <>\u007F]/.test(node.url) + ); +} + +// node_modules/mdast-util-to-markdown/lib/handle/link.js +link.peek = linkPeek; +function link(node, _, context, safeOptions) { + const quote = checkQuote(context); + const suffix = quote === '"' ? "Quote" : "Apostrophe"; + const tracker = track(safeOptions); + let exit2; + let subexit; + if (formatLinkAsAutolink(node, context)) { + const stack = context.stack; + context.stack = []; + exit2 = context.enter("autolink"); + let value2 = tracker.move("<"); + value2 += tracker.move( + containerPhrasing(node, context, { + before: value2, + after: ">", + ...tracker.current() + }) + ); + value2 += tracker.move(">"); + exit2(); + context.stack = stack; + return value2; + } + exit2 = context.enter("link"); + subexit = context.enter("label"); + let value = tracker.move("["); + value += tracker.move( + containerPhrasing(node, context, { + before: value, + after: "](", + ...tracker.current() + }) + ); + value += tracker.move("]("); + subexit(); + if (!node.url && node.title || /[\0- \u007F]/.test(node.url)) { + subexit = context.enter("destinationLiteral"); + value += tracker.move("<"); + value += tracker.move( + safe(context, node.url, { before: value, after: ">", ...tracker.current() }) + ); + value += tracker.move(">"); + } else { + subexit = context.enter("destinationRaw"); + value += tracker.move( + safe(context, node.url, { + before: value, + after: node.title ? " " : ")", + ...tracker.current() + }) + ); + } + subexit(); + if (node.title) { + subexit = context.enter("title" + suffix); + value += tracker.move(" " + quote); + value += tracker.move( + safe(context, node.title, { + before: value, + after: quote, + ...tracker.current() + }) + ); + value += tracker.move(quote); + subexit(); + } + value += tracker.move(")"); + exit2(); + return value; +} +function linkPeek(node, _, context) { + return formatLinkAsAutolink(node, context) ? "<" : "["; +} + +// node_modules/mdast-util-to-markdown/lib/handle/link-reference.js +linkReference.peek = linkReferencePeek; +function linkReference(node, _, context, safeOptions) { + const type = node.referenceType; + const exit2 = context.enter("linkReference"); + let subexit = context.enter("label"); + const tracker = track(safeOptions); + let value = tracker.move("["); + const text4 = containerPhrasing(node, context, { + before: value, + after: "]", + ...tracker.current() + }); + value += tracker.move(text4 + "]["); + subexit(); + const stack = context.stack; + context.stack = []; + subexit = context.enter("reference"); + const reference = safe(context, association(node), { + before: value, + after: "]", + ...tracker.current() + }); + subexit(); + context.stack = stack; + exit2(); + if (type === "full" || !text4 || text4 !== reference) { + value += tracker.move(reference + "]"); + } else if (type === "shortcut") { + value = value.slice(0, -1); + } else { + value += tracker.move("]"); + } + return value; +} +function linkReferencePeek() { + return "["; +} + +// node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +function checkBullet(context) { + const marker = context.options.bullet || "*"; + if (marker !== "*" && marker !== "+" && marker !== "-") { + throw new Error( + "Cannot serialize items with `" + marker + "` for `options.bullet`, expected `*`, `+`, or `-`" + ); + } + return marker; +} + +// node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js +function checkBulletOther(context) { + const bullet = checkBullet(context); + const bulletOther = context.options.bulletOther; + if (!bulletOther) { + return bullet === "*" ? "-" : "*"; + } + if (bulletOther !== "*" && bulletOther !== "+" && bulletOther !== "-") { + throw new Error( + "Cannot serialize items with `" + bulletOther + "` for `options.bulletOther`, expected `*`, `+`, or `-`" + ); + } + if (bulletOther === bullet) { + throw new Error( + "Expected `bullet` (`" + bullet + "`) and `bulletOther` (`" + bulletOther + "`) to be different" + ); + } + return bulletOther; +} + +// node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +function checkBulletOrdered(context) { + const marker = context.options.bulletOrdered || "."; + if (marker !== "." && marker !== ")") { + throw new Error( + "Cannot serialize items with `" + marker + "` for `options.bulletOrdered`, expected `.` or `)`" + ); + } + return marker; +} + +// node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered-other.js +function checkBulletOrderedOther(context) { + const bulletOrdered = checkBulletOrdered(context); + const bulletOrderedOther = context.options.bulletOrderedOther; + if (!bulletOrderedOther) { + return bulletOrdered === "." ? ")" : "."; + } + if (bulletOrderedOther !== "." && bulletOrderedOther !== ")") { + throw new Error( + "Cannot serialize items with `" + bulletOrderedOther + "` for `options.bulletOrderedOther`, expected `*`, `+`, or `-`" + ); + } + if (bulletOrderedOther === bulletOrdered) { + throw new Error( + "Expected `bulletOrdered` (`" + bulletOrdered + "`) and `bulletOrderedOther` (`" + bulletOrderedOther + "`) to be different" + ); + } + return bulletOrderedOther; +} + +// node_modules/mdast-util-to-markdown/lib/util/check-rule.js +function checkRule(context) { + const marker = context.options.rule || "*"; + if (marker !== "*" && marker !== "-" && marker !== "_") { + throw new Error( + "Cannot serialize rules with `" + marker + "` for `options.rule`, expected `*`, `-`, or `_`" + ); + } + return marker; +} + +// node_modules/mdast-util-to-markdown/lib/handle/list.js +function list2(node, parent, context, safeOptions) { + const exit2 = context.enter("list"); + const bulletCurrent = context.bulletCurrent; + let bullet = node.ordered ? checkBulletOrdered(context) : checkBullet(context); + const bulletOther = node.ordered ? checkBulletOrderedOther(context) : checkBulletOther(context); + const bulletLastUsed = context.bulletLastUsed; + let useDifferentMarker = false; + if (parent && (node.ordered ? context.options.bulletOrderedOther : context.options.bulletOther) && bulletLastUsed && bullet === bulletLastUsed) { + useDifferentMarker = true; + } + if (!node.ordered) { + const firstListItem = node.children ? node.children[0] : void 0; + if ((bullet === "*" || bullet === "-") && firstListItem && (!firstListItem.children || !firstListItem.children[0]) && context.stack[context.stack.length - 1] === "list" && context.stack[context.stack.length - 2] === "listItem" && context.stack[context.stack.length - 3] === "list" && context.stack[context.stack.length - 4] === "listItem" && context.indexStack[context.indexStack.length - 1] === 0 && context.indexStack[context.indexStack.length - 2] === 0 && context.indexStack[context.indexStack.length - 3] === 0) { + useDifferentMarker = true; + } + if (checkRule(context) === bullet && firstListItem) { + let index2 = -1; + while (++index2 < node.children.length) { + const item = node.children[index2]; + if (item && item.type === "listItem" && item.children && item.children[0] && item.children[0].type === "thematicBreak") { + useDifferentMarker = true; + break; + } + } + } + } + if (useDifferentMarker) { + bullet = bulletOther; + } + context.bulletCurrent = bullet; + const value = containerFlow(node, context, safeOptions); + context.bulletLastUsed = bullet; + context.bulletCurrent = bulletCurrent; + exit2(); + return value; +} + +// node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +function checkListItemIndent(context) { + const style = context.options.listItemIndent || "tab"; + if (style === 1 || style === "1") { + return "one"; + } + if (style !== "tab" && style !== "one" && style !== "mixed") { + throw new Error( + "Cannot serialize items with `" + style + "` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`" + ); + } + return style; +} + +// node_modules/mdast-util-to-markdown/lib/handle/list-item.js +function listItem(node, parent, context, safeOptions) { + const listItemIndent = checkListItemIndent(context); + let bullet = context.bulletCurrent || checkBullet(context); + if (parent && parent.type === "list" && parent.ordered) { + bullet = (typeof parent.start === "number" && parent.start > -1 ? parent.start : 1) + (context.options.incrementListMarker === false ? 0 : parent.children.indexOf(node)) + bullet; + } + let size = bullet.length + 1; + if (listItemIndent === "tab" || listItemIndent === "mixed" && (parent && parent.type === "list" && parent.spread || node.spread)) { + size = Math.ceil(size / 4) * 4; + } + const tracker = track(safeOptions); + tracker.move(bullet + " ".repeat(size - bullet.length)); + tracker.shift(size); + const exit2 = context.enter("listItem"); + const value = indentLines( + containerFlow(node, context, tracker.current()), + map3 + ); + exit2(); + return value; + function map3(line, index2, blank) { + if (index2) { + return (blank ? "" : " ".repeat(size)) + line; + } + return (blank ? bullet : bullet + " ".repeat(size - bullet.length)) + line; + } +} + +// node_modules/mdast-util-to-markdown/lib/handle/paragraph.js +function paragraph(node, _, context, safeOptions) { + const exit2 = context.enter("paragraph"); + const subexit = context.enter("phrasing"); + const value = containerPhrasing(node, context, safeOptions); + subexit(); + exit2(); + return value; +} + +// node_modules/mdast-util-to-markdown/lib/handle/root.js +function root(node, _, context, safeOptions) { + return containerFlow(node, context, safeOptions); +} + +// node_modules/mdast-util-to-markdown/lib/util/check-strong.js +function checkStrong(context) { + const marker = context.options.strong || "*"; + if (marker !== "*" && marker !== "_") { + throw new Error( + "Cannot serialize strong with `" + marker + "` for `options.strong`, expected `*`, or `_`" + ); + } + return marker; +} + +// node_modules/mdast-util-to-markdown/lib/handle/strong.js +strong.peek = strongPeek; +function strong(node, _, context, safeOptions) { + const marker = checkStrong(context); + const exit2 = context.enter("strong"); + const tracker = track(safeOptions); + let value = tracker.move(marker + marker); + value += tracker.move( + containerPhrasing(node, context, { + before: value, + after: marker, + ...tracker.current() + }) + ); + value += tracker.move(marker + marker); + exit2(); + return value; +} +function strongPeek(_, _1, context) { + return context.options.strong || "*"; +} + +// node_modules/mdast-util-to-markdown/lib/handle/text.js +function text3(node, _, context, safeOptions) { + return safe(context, node.value, safeOptions); +} + +// node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js +function checkRuleRepetition(context) { + const repetition = context.options.ruleRepetition || 3; + if (repetition < 3) { + throw new Error( + "Cannot serialize rules with repetition `" + repetition + "` for `options.ruleRepetition`, expected `3` or more" + ); + } + return repetition; +} + +// node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js +function thematicBreak2(_, _1, context) { + const value = (checkRule(context) + (context.options.ruleSpaces ? " " : "")).repeat(checkRuleRepetition(context)); + return context.options.ruleSpaces ? value.slice(0, -1) : value; +} + +// node_modules/mdast-util-to-markdown/lib/handle/index.js +var handle = { + blockquote, + break: hardBreak, + code, + definition: definition2, + emphasis, + hardBreak, + heading, + html, + image, + imageReference, + inlineCode, + link, + linkReference, + list: list2, + listItem, + paragraph, + root, + strong, + text: text3, + thematicBreak: thematicBreak2 +}; + +// node_modules/mdast-util-to-markdown/lib/join.js +var join = [joinDefaults]; +function joinDefaults(left, right, parent, context) { + if (right.type === "code" && formatCodeAsIndented(right, context) && (left.type === "list" || left.type === right.type && formatCodeAsIndented(left, context))) { + return false; + } + if (left.type === "list" && left.type === right.type && Boolean(left.ordered) === Boolean(right.ordered) && !(left.ordered ? context.options.bulletOrderedOther : context.options.bulletOther)) { + return false; + } + if ("spread" in parent && typeof parent.spread === "boolean") { + if (left.type === "paragraph" && (left.type === right.type || right.type === "definition" || right.type === "heading" && formatHeadingAsSetext(right, context))) { + return; + } + return parent.spread ? 1 : 0; + } +} + +// node_modules/mdast-util-to-markdown/lib/unsafe.js +var fullPhrasingSpans = [ + "autolink", + "destinationLiteral", + "destinationRaw", + "reference", + "titleQuote", + "titleApostrophe" +]; +var unsafe = [ + { character: " ", after: "[\\r\\n]", inConstruct: "phrasing" }, + { character: " ", before: "[\\r\\n]", inConstruct: "phrasing" }, + { + character: " ", + inConstruct: ["codeFencedLangGraveAccent", "codeFencedLangTilde"] + }, + { + character: "\r", + inConstruct: [ + "codeFencedLangGraveAccent", + "codeFencedLangTilde", + "codeFencedMetaGraveAccent", + "codeFencedMetaTilde", + "destinationLiteral", + "headingAtx" + ] + }, + { + character: "\n", + inConstruct: [ + "codeFencedLangGraveAccent", + "codeFencedLangTilde", + "codeFencedMetaGraveAccent", + "codeFencedMetaTilde", + "destinationLiteral", + "headingAtx" + ] + }, + { character: " ", after: "[\\r\\n]", inConstruct: "phrasing" }, + { character: " ", before: "[\\r\\n]", inConstruct: "phrasing" }, + { + character: " ", + inConstruct: ["codeFencedLangGraveAccent", "codeFencedLangTilde"] + }, + { + character: "!", + after: "\\[", + inConstruct: "phrasing", + notInConstruct: fullPhrasingSpans + }, + { character: '"', inConstruct: "titleQuote" }, + { atBreak: true, character: "#" }, + { character: "#", inConstruct: "headingAtx", after: "(?:[\r\n]|$)" }, + { character: "&", after: "[#A-Za-z]", inConstruct: "phrasing" }, + { character: "'", inConstruct: "titleApostrophe" }, + { character: "(", inConstruct: "destinationRaw" }, + { + before: "\\]", + character: "(", + inConstruct: "phrasing", + notInConstruct: fullPhrasingSpans + }, + { atBreak: true, before: "\\d+", character: ")" }, + { character: ")", inConstruct: "destinationRaw" }, + { atBreak: true, character: "*" }, + { character: "*", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans }, + { atBreak: true, character: "+" }, + { atBreak: true, character: "-" }, + { atBreak: true, before: "\\d+", character: ".", after: "(?:[ \r\n]|$)" }, + { atBreak: true, character: "<", after: "[!/?A-Za-z]" }, + { + character: "<", + after: "[!/?A-Za-z]", + inConstruct: "phrasing", + notInConstruct: fullPhrasingSpans + }, + { character: "<", inConstruct: "destinationLiteral" }, + { atBreak: true, character: "=" }, + { atBreak: true, character: ">" }, + { character: ">", inConstruct: "destinationLiteral" }, + { atBreak: true, character: "[" }, + { character: "[", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans }, + { character: "[", inConstruct: ["label", "reference"] }, + { character: "\\", after: "[\\r\\n]", inConstruct: "phrasing" }, + { character: "]", inConstruct: ["label", "reference"] }, + { atBreak: true, character: "_" }, + { character: "_", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans }, + { atBreak: true, character: "`" }, + { + character: "`", + inConstruct: ["codeFencedLangGraveAccent", "codeFencedMetaGraveAccent"] + }, + { character: "`", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans }, + { atBreak: true, character: "~" } +]; + +// node_modules/mdast-util-to-markdown/lib/index.js +function toMarkdown(tree, options = {}) { + const context = { + enter, + stack: [], + unsafe: [], + join: [], + handlers: {}, + options: {}, + indexStack: [] + }; + configure2(context, { unsafe, join, handlers: handle }); + configure2(context, options); + if (context.options.tightDefinitions) { + configure2(context, { join: [joinDefinition] }); + } + context.handle = zwitch("type", { + invalid, + unknown, + handlers: context.handlers + }); + let result = context.handle(tree, null, context, { + before: "\n", + after: "\n", + now: { line: 1, column: 1 }, + lineShift: 0 + }); + if (result && result.charCodeAt(result.length - 1) !== 10 && result.charCodeAt(result.length - 1) !== 13) { + result += "\n"; + } + return result; + function enter(name) { + context.stack.push(name); + return exit2; + function exit2() { + context.stack.pop(); + } + } +} +function invalid(value) { + throw new Error("Cannot handle value `" + value + "`, expected node"); +} +function unknown(node) { + throw new Error("Cannot handle unknown node `" + node.type + "`"); +} +function joinDefinition(left, right) { + if (left.type === "definition" && left.type === right.type) { + return 0; + } +} + +// node_modules/remark/node_modules/remark-stringify/lib/index.js +function remarkStringify(options) { + const compiler2 = (tree) => { + const settings = this.data("settings"); + return toMarkdown( + tree, + Object.assign({}, settings, options, { + extensions: this.data("toMarkdownExtensions") || [] + }) + ); + }; + Object.assign(this, { Compiler: compiler2 }); +} + +// node_modules/remark/node_modules/remark-stringify/index.js +var remark_stringify_default = remarkStringify; + +// node_modules/remark/index.js +var remark1402 = unified().use(remark_parse_default).use(remark_stringify_default).freeze(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + remark: remark1402 +}); +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap index 605f731488d3..2314d2dddfe3 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap @@ -64,127 +64,69 @@ npm install --save docusaurus-plugin-name `; exports[`npm2yarn plugin works on installation file 1`] = ` -"import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; +"import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' - - -\`\`\`bash - $ npm install --global docusaurus -\`\`\` - - - - -\`\`\`bash - $ yarn add --global docusaurus -\`\`\` - - + + \`\`\`bash + $ npm install --global docusaurus + \`\`\` + + + + \`\`\`bash + $ yarn add --global docusaurus + \`\`\` + " `; exports[`npm2yarn plugin works on plugin file 1`] = ` -"import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; +"import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' ## Installing a plugin A plugin is usually a npm package, so you install them like other npm packages using npm. - - -\`\`\`bash -npm install --save docusaurus-plugin-name -\`\`\` - - - - -\`\`\`bash -yarn add docusaurus-plugin-name -\`\`\` - - + + \`\`\`bash + npm install --save docusaurus-plugin-name + \`\`\` + + + + \`\`\`bash + yarn add docusaurus-plugin-name + \`\`\` + " `; -exports[`npm2yarn plugin works with simple md 1`] = ` -"/*@jsxRuntime automatic @jsxImportSource react*/ -import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime"; -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; -function _createMdxContent(props) { - const _components = Object.assign({ - h1: "h1", - p: "p", - pre: "pre", - code: "code" - }, props.components); - return _jsxs(_Fragment, { - children: [_jsx(_components.h1, { - children: "Title" - }), "/n", _jsx(_components.p, { - children: "Hey" - }), "/n", _jsxs(Tabs, { - children: [_jsx(TabItem, { - value: "npm", - children: _jsx(_components.pre, { - children: _jsx(_components.code, { - className: "language-bash", - children: "npm install test/n" - }) - }) - }), _jsx(TabItem, { - value: "yarn", - label: "Yarn", - children: _jsx(_components.pre, { - children: _jsx(_components.code, { - className: "language-bash", - children: "yarn add test/n" - }) - }) - })] - })] - }); -} -function MDXContent(props = {}) { - const {wrapper: MDXLayout} = props.components || ({}); - return MDXLayout ? _jsx(MDXLayout, Object.assign({}, props, { - children: _jsx(_createMdxContent, props) - })) : _createMdxContent(props); -} -export default MDXContent; -" -`; - exports[`npm2yarn plugin works with sync option 1`] = ` -"import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; +"import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' ## Installing a plugin A plugin is usually a npm package, so you install them like other npm packages using npm. - - -\`\`\`bash -npm install --save docusaurus-plugin-name -\`\`\` - - - - -\`\`\`bash -yarn add docusaurus-plugin-name -\`\`\` - - + + \`\`\`bash + npm install --save docusaurus-plugin-name + \`\`\` + + + + \`\`\`bash + yarn add docusaurus-plugin-name + \`\`\` + " `; diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts index c17b79374acf..f44d8b48cd49 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts @@ -13,18 +13,16 @@ import dedent from 'dedent'; import npm2yarn from '../index'; const process = async (content: any, options?: {sync?: boolean}) => { - const mdx = await import('@mdx-js/mdx'); + // const mdx = await import('@mdx-js/mdx'); + const {remark} = await import('remark'); + const mdx = (await import('remark-mdx')).default; - const result = await mdx.compile(content, { - remarkPlugins: [[npm2yarn, options]], - format: 'mdx', - }); - - console.log('result', result); - console.log('result str', result.toString()); - console.log('result str2', mdx.mdastUtilToString(result)); + const result = await remark() + .use(mdx) + .use(npm2yarn, options) + .process(content); - return result.toString(); + return result.value; }; const processFixture = async (name: string, options?: {sync?: boolean}) => { @@ -46,7 +44,29 @@ describe('npm2yarn plugin', () => { `); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot(` + "import Tabs from '@theme/Tabs' + import TabItem from '@theme/TabItem' + + # Title + + Hey + + + + \`\`\`bash + npm install test + \`\`\` + + + + \`\`\`bash + yarn add test + \`\`\` + + + " + `); }); it('works on installation file', async () => { From c14bf34feff3c2f657bbc09a90eb1e9966843d5d Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 1 Dec 2022 12:25:39 +0100 Subject: [PATCH 033/155] make npm2yarn work + unit tests + update snapshots --- .../src/__tests__/__fixtures__/multiple.md | 21 ++++ .../__snapshots__/index.test.ts.snap | 98 ++++++++++++++----- .../src/__tests__/index.test.ts | 6 ++ .../src/index.ts | 21 ++-- 4 files changed, 114 insertions(+), 32 deletions(-) create mode 100644 packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__fixtures__/multiple.md diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__fixtures__/multiple.md b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__fixtures__/multiple.md new file mode 100644 index 000000000000..4649d8b47177 --- /dev/null +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__fixtures__/multiple.md @@ -0,0 +1,21 @@ +# Title + +```bash npm2yarn + $ npm install --global docusaurus +``` + +
+ ```bash npm2yarn + npm install + ``` +
+ +```bash +echo "no npm2yarn here" +``` + +## Subtitle + +```bash npm2yarn +yarn add @docusaurus/core +``` diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap index 2314d2dddfe3..6123a0f9da9e 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap @@ -1,45 +1,97 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`npm2yarn plugin does not re-import tabs components when already imported above 1`] = ` -"import Tabs from '@theme/Tabs'; +exports[`npm2yarn plugin does not re-import tabs components real-world multiple npm2yarn usage 1`] = ` +"import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' -import TabItem from '@theme/TabItem'; +# Title - + + \`\`\`bash + $ npm install --global docusaurus + \`\`\` + -\`\`\`bash - $ npm install --global docusaurus -\`\`\` + + \`\`\`bash + $ yarn add --global docusaurus + \`\`\` + + - - +
+ + + \`\`\`bash + npm install + \`\`\` + + + + \`\`\`bash + yarn install + \`\`\` + + +
\`\`\`bash - $ yarn add --global docusaurus +echo "no npm2yarn here" \`\`\` -
+## Subtitle + + + + \`\`\`bash + yarn add @docusaurus/core + \`\`\` + + + + \`\`\`bash + yarn add @docusaurus/core + \`\`\` + " `; -exports[`npm2yarn plugin does not re-import tabs components when already imported below 1`] = ` -" - +exports[`npm2yarn plugin does not re-import tabs components when already imported above 1`] = ` +"import Tabs from '@theme/Tabs'; -\`\`\`bash - $ npm install --global docusaurus -\`\`\` +import TabItem from '@theme/TabItem'; - - + + + \`\`\`bash + $ npm install --global docusaurus + \`\`\` + -\`\`\`bash - $ yarn add --global docusaurus -\`\`\` + + \`\`\`bash + $ yarn add --global docusaurus + \`\`\` + + +" +`; + +exports[`npm2yarn plugin does not re-import tabs components when already imported below 1`] = ` +" + + \`\`\`bash + $ npm install --global docusaurus + \`\`\` + - + + \`\`\`bash + $ yarn add --global docusaurus + \`\`\` + import Tabs from '@theme/Tabs'; diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts index f44d8b48cd49..5dca97a4b20a 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts @@ -104,4 +104,10 @@ describe('npm2yarn plugin', () => { expect(result).toMatchSnapshot(); }); + + it('does not re-import tabs components real-world multiple npm2yarn usage', async () => { + const result = await processFixture('multiple'); + + expect(result).toMatchSnapshot(); + }); }); diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts index 39b4eb83f1db..f2227512c57d 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts @@ -82,10 +82,15 @@ const transformNode = (node: Code, isSync: boolean) => { ] as any[]; }; -const isImport = (node: Node): node is Literal => node.type === 'import'; +const isMdxEsmLiteral = (node: Node): node is Literal => + node.type === 'mdxjsEsm'; +// TODO legacy approximation, good-enough for now but not 100% accurate +const isTabsImport = (node: Node): boolean => + isMdxEsmLiteral(node) && node.value.includes('@theme/Tabs'); + const isParent = (node: Node): node is Parent => Array.isArray((node as Parent).children); -const matchNode = (node: Node): node is Code => +const isNpm2Yarn = (node: Node): node is Code => node.type === 'code' && (node as Code).meta === 'npm2yarn'; function createImportNode() { @@ -134,21 +139,20 @@ function createImportNode() { const plugin: Plugin<[PluginOptions?]> = (options = {}) => { const {sync = false} = options; - return (root) => { + return (root, p) => { let transformed = false as boolean; let alreadyImported = false as boolean; - // console.log('root', root); - visit(root, (node: Node) => { - if (isImport(node) && node.value.includes('@theme/Tabs')) { + if (isTabsImport(node)) { alreadyImported = true; } + if (isParent(node)) { let index = 0; while (index < node.children.length) { const child = node.children[index]!; - if (matchNode(child)) { + if (isNpm2Yarn(child)) { const result = transformNode(child, sync); node.children.splice(index, 1, ...result); index += result.length; @@ -159,11 +163,10 @@ const plugin: Plugin<[PluginOptions?]> = (options = {}) => { } } }); + if (transformed && !alreadyImported) { (root as Parent).children.unshift(createImportNode()); } - - // console.log('result', {transformed, alreadyImported}, root); }; }; From aedb12f35da53f57df9fabbe9b9f9f36e50cc6a7 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 1 Dec 2022 14:21:18 +0100 Subject: [PATCH 034/155] some PR cleanup --- .../__snapshots__/index.test.ts.snap | 24 ++++++++++++++ .../src/__tests__/index.test.ts | 31 ++----------------- website/src/theme/MDXComponents.tsx | 7 ----- website/testCSSOrder.mjs | 2 +- 4 files changed, 28 insertions(+), 36 deletions(-) diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap index 6123a0f9da9e..f8f5d748ea70 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap @@ -159,6 +159,30 @@ A plugin is usually a npm package, so you install them like other npm packages u " `; +exports[`npm2yarn plugin works with simplest md 1`] = ` +"import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +# Title + +Hey + + + + \`\`\`bash + npm install test + \`\`\` + + + + \`\`\`bash + yarn add test + \`\`\` + + +" +`; + exports[`npm2yarn plugin works with sync option 1`] = ` "import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts index 5dca97a4b20a..36e086b10c74 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts @@ -7,15 +7,12 @@ import path from 'path'; import vfile from 'to-vfile'; -// import mdx from 'remark-mdx'; -// import remark from 'remark'; import dedent from 'dedent'; import npm2yarn from '../index'; const process = async (content: any, options?: {sync?: boolean}) => { - // const mdx = await import('@mdx-js/mdx'); const {remark} = await import('remark'); - const mdx = (await import('remark-mdx')).default; + const {default: mdx} = await import('remark-mdx'); const result = await remark() .use(mdx) @@ -32,7 +29,7 @@ const processFixture = async (name: string, options?: {sync?: boolean}) => { }; describe('npm2yarn plugin', () => { - it('works with simple md', async () => { + it('works with simplest md', async () => { const result = await process(dedent` # Title @@ -44,29 +41,7 @@ describe('npm2yarn plugin', () => { `); - expect(result).toMatchInlineSnapshot(` - "import Tabs from '@theme/Tabs' - import TabItem from '@theme/TabItem' - - # Title - - Hey - - - - \`\`\`bash - npm install test - \`\`\` - - - - \`\`\`bash - yarn add test - \`\`\` - - - " - `); + expect(result).toMatchSnapshot(); }); it('works on installation file', async () => { diff --git a/website/src/theme/MDXComponents.tsx b/website/src/theme/MDXComponents.tsx index 71e2f5ad55bc..079cec7487ec 100644 --- a/website/src/theme/MDXComponents.tsx +++ b/website/src/theme/MDXComponents.tsx @@ -9,15 +9,8 @@ import MDXComponents from '@theme-original/MDXComponents'; import Highlight from '@site/src/components/Highlight'; import TweetQuote from '@site/src/components/TweetQuote'; -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - export default { ...MDXComponents, highlight: Highlight, TweetQuote, - - // TODO to remove, temporary - Tabs, - TabItem, }; diff --git a/website/testCSSOrder.mjs b/website/testCSSOrder.mjs index d47f1a14782f..aaa9b5b4bb88 100644 --- a/website/testCSSOrder.mjs +++ b/website/testCSSOrder.mjs @@ -42,7 +42,7 @@ const EXPECTED_CSS_MARKERS = [ // Test markers '.test-marker-site-custom-css-unique-rule', - // '.test-marker-site-client-module', // TODO re-enable + '.test-marker-site-client-module', '.test-marker-theme-layout', '.test-marker-site-index-page', From 5cff7dfbf7c38f6edc19e6cfd5fffc7df5592fc2 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 1 Dec 2022 14:55:22 +0100 Subject: [PATCH 035/155] fix math/katex --- .../markdown-features-math-equations.mdx | 8 ++-- website/docusaurus.config.js | 23 +++++----- website/package.json | 2 +- yarn.lock | 42 +++++++++++++++++-- 4 files changed, 54 insertions(+), 21 deletions(-) diff --git a/website/docs/guides/markdown-features/markdown-features-math-equations.mdx b/website/docs/guides/markdown-features/markdown-features-math-equations.mdx index e26440855c93..3c550037f113 100644 --- a/website/docs/guides/markdown-features/markdown-features-math-equations.mdx +++ b/website/docs/guides/markdown-features/markdown-features-math-equations.mdx @@ -27,7 +27,7 @@ $f$ is continuous at $x$, $F$ is differentiable at $x$ with $F'(x)=f(x)$. Let $f\colon[a,b] \to \R$ be Riemann integrable. Let $F\colon[a,b]\to\R$ be $F(x)= -\int_\{a}^\{x} f(t)\,dt$. Then $F$ is continuous, and at all $x$ such that $f$ is continuous at $x$, $F$ is differentiable at $x$ with $F'(x)=f(x)$. +\int_{a}^{x} f(t)\,dt$. Then $F$ is continuous, and at all $x$ such that $f$ is continuous at $x$, $F$ is differentiable at $x$ with $F'(x)=f(x)$. @@ -44,7 +44,7 @@ $$ $$ -I = \int_0^\{2\pi} \sin(x)\,dx +I = \int_0^{2\pi} \sin(x)\,dx $$ @@ -54,13 +54,15 @@ $$ To enable KaTeX, you need to install `remark-math` and `rehype-katex` plugins. ```bash npm2yarn -npm install --save remark-math@3 rehype-katex@5 hast-util-is-element@1.1.0 +npm install --save remark-math rehype-katex hast-util-is-element@1.1.0 ``` :::caution Use the exact same versions. The latest versions are incompatible with Docusaurus 2. +TODO update this doc after MDX 2 migration + ::: Import the plugins in `docusaurus.config.js`: diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index ebc2f528f7dc..ca72b5126ef7 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -7,7 +7,6 @@ // @ts-check const path = require('path'); -const math = require('remark-math'); const npm2yarn = require('@docusaurus/remark-plugin-npm2yarn'); const versions = require('./versions.json'); const VersionsArchived = require('./versionsArchived.json'); @@ -307,7 +306,7 @@ const config = { }, showLastUpdateAuthor: true, showLastUpdateTime: true, - remarkPlugins: [math, [npm2yarn, {sync: true}]], + remarkPlugins: [[npm2yarn, {sync: true}]], rehypePlugins: [], disableVersioning: isVersioningDisabled, lastVersion: @@ -626,26 +625,24 @@ async function createConfig() { const FeatureRequestsPlugin = ( await import('./src/plugins/featureRequests/FeatureRequestsPlugin.mjs') ).default; - // const configTabs = (await import('./src/remark/configTabs.mjs')).default; + const configTabs = (await import('./src/remark/configTabs.mjs')).default; const lightTheme = (await import('./src/utils/prismLight.mjs')).default; const darkTheme = (await import('./src/utils/prismDark.mjs')).default; - // const katex = (await import('rehype-katex')).default; + const katex = (await import('rehype-katex')).default; + const math = (await import('remark-math')).default; + config.plugins?.push(FeatureRequestsPlugin); - /* + // @ts-expect-error: we know it exists, right - config.presets[0][1].docs.remarkPlugins.push(configTabs); + const docsPluginOptions = config.presets[0][1].docs; + docsPluginOptions.remarkPlugins.push(math); + docsPluginOptions.remarkPlugins.push(configTabs); + docsPluginOptions.rehypePlugins.push(katex); - */ // @ts-expect-error: we know it exists, right config.themeConfig.prism.theme = lightTheme; // @ts-expect-error: we know it exists, right config.themeConfig.prism.darkTheme = darkTheme; - - /* - // @ts-expect-error: we know it exists, right - config.presets[0][1].docs.rehypePlugins.push(katex); - - */ return config; } diff --git a/website/package.json b/website/package.json index 6879abdb7c9e..816e4a33dfdc 100644 --- a/website/package.json +++ b/website/package.json @@ -63,7 +63,7 @@ "react-medium-image-zoom": "^5.0.2", "react-popper": "^2.3.0", "rehype-katex": "^6.0.2", - "remark-math": "^3.0.1", + "remark-math": "^5.1.1", "swc-loader": "^0.2.3", "unist-util-visit": "^2.0.3", "webpack": "^5.74.0", diff --git a/yarn.lock b/yarn.lock index 5470804c1dc1..9df9fba028f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10555,6 +10555,13 @@ just-diff@^5.0.1: resolved "https://registry.yarnpkg.com/just-diff/-/just-diff-5.1.1.tgz#8da6414342a5ed6d02ccd64f5586cbbed3146202" integrity sha512-u8HXJ3HlNrTzY7zrYYKjNEfBlyjqhdBkoyTVdjtn7p02RJD5NvR8rIClzeGA7t+UYP1/7eAkWNLU0+P3QrEqKQ== +katex@^0.13.0: + version "0.13.24" + resolved "https://registry.yarnpkg.com/katex/-/katex-0.13.24.tgz#fe55455eb455698cb24b911a353d16a3c855d905" + integrity sha512-jZxYuKCma3VS5UuxOx/rFV1QyGSl3Uy/i0kTJF3HgQ5xMinCQVF8Zd4bMY/9aI9b9A2pjIBOsjSSm68ykTAr8w== + dependencies: + commander "^8.0.0" + katex@^0.15.0: version "0.15.6" resolved "https://registry.yarnpkg.com/katex/-/katex-0.15.6.tgz#c4e2f6ced2ac4de1ef6f737fe7c67d3026baa0e5" @@ -11202,6 +11209,15 @@ mdast-util-gfm@^2.0.0: mdast-util-gfm-task-list-item "^1.0.0" mdast-util-to-markdown "^1.0.0" +mdast-util-math@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-math/-/mdast-util-math-2.0.1.tgz#141b8e7e43731d2a7423c5eb8c0335c05d257ad2" + integrity sha512-ZZtjyRwobsiVg4bY0Q5CzAZztpbjRIA7ZlMMb0PNkwTXOnJTUoHvzBhVG95LIuek5Mlj1l2P+jBvWviqW7G+0A== + dependencies: + "@types/mdast" "^3.0.0" + longest-streak "^3.0.0" + mdast-util-to-markdown "^1.3.0" + mdast-util-mdx-expression@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/mdast-util-mdx-expression/-/mdast-util-mdx-expression-1.3.1.tgz#2224cf0b5b150093704a3c225bd529d2de21f50f" @@ -11512,6 +11528,19 @@ micromark-extension-gfm@^2.0.0: micromark-util-combine-extensions "^1.0.0" micromark-util-types "^1.0.0" +micromark-extension-math@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/micromark-extension-math/-/micromark-extension-math-2.0.2.tgz#bb7d28b907b17f1813dd3d0df2a6df6bb1a4d0e1" + integrity sha512-cFv2B/E4pFPBBFuGgLHkkNiFAIQv08iDgPH2HCuR2z3AUgMLecES5Cq7AVtwOtZeRrbA80QgMUk8VVW0Z+D2FA== + dependencies: + "@types/katex" "^0.11.0" + katex "^0.13.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" + micromark-extension-mdx-expression@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-1.0.3.tgz#cd3843573921bf55afcfff4ae0cd2e857a16dcfa" @@ -14357,10 +14386,15 @@ remark-gfm@^3.0.1: micromark-extension-gfm "^2.0.0" unified "^10.0.0" -remark-math@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/remark-math/-/remark-math-3.0.1.tgz#85a02a15b15cad34b89a27244d4887b3a95185bb" - integrity sha512-epT77R/HK0x7NqrWHdSV75uNLwn8g9qTyMqCRCDujL0vj/6T6+yhdrR7mjELWtkse+Fw02kijAaBuVcHBor1+Q== +remark-math@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/remark-math/-/remark-math-5.1.1.tgz#459e798d978d4ca032e745af0bac81ddcdf94964" + integrity sha512-cE5T2R/xLVtfFI4cCePtiRn+e6jKMtFDR3P8V3qpv8wpKjwvHoBA4eJzvX+nVrnlNy0911bdGmuspCSwetfYHw== + dependencies: + "@types/mdast" "^3.0.0" + mdast-util-math "^2.0.0" + micromark-extension-math "^2.0.0" + unified "^10.0.0" remark-mdx@^2.0.0, remark-mdx@^2.1.5: version "2.1.5" From b404d0ca2737478061a58320bdaf29d14e0ea3ad Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 1 Dec 2022 14:57:03 +0100 Subject: [PATCH 036/155] useless diff line break --- website/docusaurus.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index ca72b5126ef7..bd78ee2df728 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -154,7 +154,6 @@ const config = { }, }, ], - [ 'content-docs', /** @type {import('@docusaurus/plugin-content-docs').Options} */ From 47ec62693e565c20a2ae451705259e7f75094e0e Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 1 Dec 2022 15:36:44 +0100 Subject: [PATCH 037/155] fix remark configTabs plugin --- website/docusaurus.config.js | 2 +- website/src/remark/configTabs.mjs | 71 +++++++++++++++++++++++-------- 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index bd78ee2df728..261076223d21 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -635,7 +635,7 @@ async function createConfig() { // @ts-expect-error: we know it exists, right const docsPluginOptions = config.presets[0][1].docs; docsPluginOptions.remarkPlugins.push(math); - docsPluginOptions.remarkPlugins.push(configTabs); + docsPluginOptions.remarkPlugins.unshift(configTabs); docsPluginOptions.rehypePlugins.push(katex); // @ts-expect-error: we know it exists, right diff --git a/website/src/remark/configTabs.mjs b/website/src/remark/configTabs.mjs index 7b893cf92480..52a73c2e38b8 100644 --- a/website/src/remark/configTabs.mjs +++ b/website/src/remark/configTabs.mjs @@ -36,26 +36,61 @@ export default function plugin() { .replace(pluginMeta, '') .trim() .replace(/^.*?= /, '') - .replace(/;$/, '') - // eslint-disable-next-line prefer-named-capture-group - .replace(/([`$\\])/g, '\\$1'); + .replace(/;$/, ''); + + // .replace(/([`$\\])/g, '\\$1'); - parent.children.splice( - index, - 1, - { - type: 'import', - value: `import ConfigTabs from "@site/src/components/ConfigTabs";`, + const importNode = { + type: 'mdxjsEsm', + value: 'import ConfigTabs from "@site/src/components/ConfigTabs"', + data: { + estree: { + type: 'Program', + body: [ + { + type: 'ImportDeclaration', + specifiers: [ + { + type: 'ImportDefaultSpecifier', + local: {type: 'Identifier', name: 'ConfigTabs'}, + }, + ], + source: { + type: 'Literal', + value: '@site/src/components/ConfigTabs', + raw: "'@site/src/components/ConfigTabs'", + }, + }, + ], + sourceType: 'module', + }, }, - { - type: 'jsx', - value: ``, - }, - ); + }; + + const jsxNode = { + type: 'mdxJsxFlowElement', + name: 'ConfigTabs', + attributes: [ + { + type: 'mdxJsxAttribute', + name: 'pluginName', + value: pluginName.trim(), + }, + { + type: 'mdxJsxAttribute', + name: 'presetOptionName', + value: presetOptionName.trim(), + }, + { + type: 'mdxJsxAttribute', + name: 'code', + value: config, + }, + ], + children: [], + }; + + parent.children.splice(index, 1, importNode, jsxNode); }); }; return transformer; From 6a6782260f7552630104be66a24afbdc33119c3e Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 1 Dec 2022 15:37:47 +0100 Subject: [PATCH 038/155] remove useless escaping line --- website/src/remark/configTabs.mjs | 2 -- 1 file changed, 2 deletions(-) diff --git a/website/src/remark/configTabs.mjs b/website/src/remark/configTabs.mjs index 52a73c2e38b8..14eb7ad9f531 100644 --- a/website/src/remark/configTabs.mjs +++ b/website/src/remark/configTabs.mjs @@ -37,8 +37,6 @@ export default function plugin() { .trim() .replace(/^.*?= /, '') .replace(/;$/, ''); - - // .replace(/([`$\\])/g, '\\$1'); const importNode = { type: 'mdxjsEsm', From 174621e6a6f16eecd0f4e3095da72e1388c6b2e7 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 1 Dec 2022 16:18:10 +0100 Subject: [PATCH 039/155] Fix remark GFM import + APITable --- packages/docusaurus-mdx-loader/src/loader.ts | 32 +++++++++++++++++--- website/src/components/APITable/index.tsx | 5 +-- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 61d3deb86e2a..6641d8cabd58 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -163,6 +163,11 @@ function getAdmonitionsPlugins( return []; } +function isDebugFile(filePath: string): boolean { + // return filePath.endsWith('plugin-sitemap.md'); + return false; +} + export async function mdxLoader( this: LoaderContext, fileString: string, @@ -171,8 +176,8 @@ export async function mdxLoader( const filePath = this.resourcePath; const reqOptions = this.getOptions(); - const {createProcessor, compile} = await import('@mdx-js/mdx'); - const gfm = await import('remark-gfm'); + const {createProcessor} = await import('@mdx-js/mdx'); + const {default: gfm} = await import('remark-gfm'); const {frontMatter, content: contentWithTitle} = parseFrontMatter(fileString); @@ -197,11 +202,19 @@ export async function mdxLoader( const content = preprocessContent(contentUnprocessed); - /* - if (filePath.endsWith('markdownPageTests.md')) { + if (isDebugFile(filePath)) { + console.log('\n\n\n'); + console.log('contentUnprocessed'); + console.log('\n\n\n'); + console.log(contentUnprocessed); + console.log('\n\n\n'); + console.log('############################################################'); + console.log('\n\n\n'); + console.log('content'); + console.log('\n\n\n'); console.log(content); + console.log('\n\n\n'); } - */ const hasFrontMatter = Object.keys(frontMatter).length > 0; @@ -280,6 +293,15 @@ export async function mdxLoader( ); } + if (isDebugFile(filePath)) { + console.log('############################################################'); + console.log('\n\n\n'); + console.log('result'); + console.log('\n\n\n'); + console.log(result); + console.log('\n\n\n'); + } + // MDX partials are MDX files starting with _ or in a folder starting with _ // Partial are not expected to have associated metadata files or front matter const isMDXPartial = options.isMDXPartial?.(filePath); diff --git a/website/src/components/APITable/index.tsx b/website/src/components/APITable/index.tsx index 7785075d715f..b6a73d2862cf 100644 --- a/website/src/components/APITable/index.tsx +++ b/website/src/components/APITable/index.tsx @@ -54,10 +54,7 @@ function APITableRow( history.push(anchor); } }}> - { - // TODO fix this - children.props?.children - } + {children.props.children} ); } From 0bb3d8490e7ac95325e433566bfc88de334e7550 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 1 Dec 2022 17:17:29 +0100 Subject: [PATCH 040/155] apply codeCompatPlugin last --- packages/docusaurus-mdx-loader/src/loader.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 6641d8cabd58..d814017a10e5 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -241,10 +241,14 @@ export async function mdxLoader( }, ], gfm, - codeCompatPlugin, ...(reqOptions.remarkPlugins ?? []), ]; + // codeCompatPlugin needs to be applied last after user-provided plugins + // (after npm2yarn for example) + // @ts-expect-error: TODO + remarkPlugins.push(codeCompatPlugin); + // @ts-expect-error: TODO const rehypePlugins: ProcessorOptions['rehypePlugins'] = [ ...(reqOptions.beforeDefaultRehypePlugins ?? []), From bf358c9d0d8f9f65475e331268586351ca0d6689 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 1 Dec 2022 17:25:28 +0100 Subject: [PATCH 041/155] add dogfood for remark-emoji --- website/_dogfooding/_pages tests/markdownPageTests.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/_dogfooding/_pages tests/markdownPageTests.md b/website/_dogfooding/_pages tests/markdownPageTests.md index fb79613b0e1a..6ad2c07df2c2 100644 --- a/website/_dogfooding/_pages tests/markdownPageTests.md +++ b/website/_dogfooding/_pages tests/markdownPageTests.md @@ -232,6 +232,10 @@ Can be arbitrarily nested: - [ ] Task - [ ] Task +## Emojis + +Emojis in this text will be replaced with [remark-emoji](https://www.npmjs.com/package/remark-emoji): :dog: :+1: + ## Admonitions :::caution Interpolated `title` with a From bcd7a1b037b51be682cb122b0a018e30f6cd20d9 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 1 Dec 2022 18:19:26 +0100 Subject: [PATCH 042/155] fix weird ts --- packages/docusaurus-remark-plugin-npm2yarn/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts index f2227512c57d..715d31b1156b 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts @@ -140,8 +140,8 @@ function createImportNode() { const plugin: Plugin<[PluginOptions?]> = (options = {}) => { const {sync = false} = options; return (root, p) => { - let transformed = false as boolean; - let alreadyImported = false as boolean; + let transformed = false; + let alreadyImported = false; visit(root, (node: Node) => { if (isTabsImport(node)) { From 4c0400a436adcebc2b2dd626b483316b54fe0052 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 11:23:27 +0100 Subject: [PATCH 043/155] unsuccessful attempt to use mdxJsxFlowElement for admonition --- .../src/remark/admonitions/index.ts | 172 +++++++++++++++--- 1 file changed, 143 insertions(+), 29 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts index 87350a5004c6..4956ddc5eec7 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts @@ -57,6 +57,85 @@ export function normalizeAdmonitionOptions( return options; } +/* +const isMdxEsmLiteral = (node: Node): node is Literal => + node.type === 'mdxjsEsm'; +// TODO good-enough approximation, but not 100% accurate +const isAdmonitionImport = (node: Node): boolean => + isMdxEsmLiteral(node) && node.value.includes('@theme/Admonition'); + +function createImportNode() { + return { + type: 'mdxjsEsm', + value: "import Admonition from '@theme/Admonition'", + data: { + estree: { + type: 'Program', + body: [ + { + type: 'ImportDeclaration', + specifiers: [ + { + type: 'ImportDefaultSpecifier', + local: {type: 'Identifier', name: 'Admonition'}, + }, + ], + source: { + type: 'Literal', + value: '@theme/Admonition', + raw: "'@theme/Admonition'", + }, + }, + ], + sourceType: 'module', + }, + }, + }; +} + +function createAdmonitionNode({ + directive, + title, + children, +}: { + directive: ContainerDirective; + title: unknown; + children: unknown; +}) { + return { + type: 'mdxJsxFlowElement', + name: 'Admonition', + attributes: [ + { + type: 'mdxJsxAttribute', + name: 'type', + value: directive.name, + }, + { + type: 'mdxJsxAttribute', + name: 'title', + value: { + type: 'mdxJsxAttributeValueExpression', + // TODO this is the complex part I couldn't solve :/ + value: mdHastToValueExpression(title), + }, + }, + ], + children, + }; +} + */ + +function extractDirectiveLabel(directive: ContainerDirective) { + const hasDirectiveLabel = + directive.children?.[0].data?.directiveLabel === true; + if (hasDirectiveLabel) { + const [directiveLabel, ...children] = directive.children; + return {directiveLabel, children}; + } + return {directiveLabel: undefined, children: directive.children}; +} + // This string value does not matter much // It is ignored because nodes are using hName/hProperties coming from HAST // const admonitionNodeType = 'admonitionHTML'; @@ -70,38 +149,73 @@ const plugin: Plugin = function plugin( // See also: // https://talk.commonmark.org/t/generic-directives-plugins-syntax/444 // https://github.com/remarkjs/remark-directive - return async (tree, file) => { - const {h} = await import('hastscript'); - - visit(tree, 'containerDirective', (directive: ContainerDirective) => { - const isAdmonition = keywords.includes(directive.name); - - if (!isAdmonition) { - return; + return async (root) => { + /* + let transformed = false; + let alreadyImported = false; + */ + + visit(root, (node) => { + /* + if (isAdmonitionImport(node)) { + alreadyImported = true; } - - const data = directive.data || (directive.data = {}); - const tagName = 'admonition'; - - const hasDirectiveLabel = - directive.children?.[0].data?.directiveLabel === true; - - // TODO this is our old MDX v1 workaround - // in v2 we should transform the whole directive to mdxJsxFlowElement - if (hasDirectiveLabel) { - const directiveLabel = directive.children[0]; - directiveLabel.data.hName = 'mdxAdmonitionTitle'; - directiveLabel.data.hProperties = directiveLabel.data.hProperties ?? {}; - directiveLabel.data.hProperties.mdxType = 'mdxAdmonitionTitle'; + */ + + if (node.type === 'containerDirective') { + // transformed = true; + + const directive = node as ContainerDirective; + const isAdmonition = keywords.includes(directive.name); + + if (!isAdmonition) { + return; + } + + const {directiveLabel, children} = extractDirectiveLabel(directive); + + /* + // :::tip{title="my title} overrides :::tip[my title] + const title = directive.attributes?.title ?? directiveLabel?.children; + + const admonitionNode = createAdmonitionNode({ + directive, + title, + children, + }); + + parent!.children.splice(index, 1, admonitionNode); + + */ + + // TODO in MDX v2 we should transform the whole directive to + // mdxJsxFlowElement instead of using hast + directive.data ??= {}; + directive.data.hName = 'admonition'; + directive.data.hProperties = { + ...directive.attributes, + type: directive.name, + title: directive.attributes?.title, + }; + + // TODO legacy MDX v1 workaround + // Because it wasn't possible to inject JSX elements as props in v1 + // in v2 we should transform the whole directive to mdxJsxFlowElement + // not so easy :/ + if (directiveLabel) { + directiveLabel.data.hName = 'mdxAdmonitionTitle'; + directiveLabel.data.hProperties = + directiveLabel.data.hProperties ?? {}; + directiveLabel.data.hProperties.mdxType = 'mdxAdmonitionTitle'; + } } - - data.hName = tagName; - data.hProperties = h(tagName, { - ...directive.attributes, - type: directive.name, - title: directive.attributes?.title, - }).properties; }); + + /* + if (transformed && !alreadyImported) { + (root as Parent).children.unshift(createImportNode()); + } + */ }; }; From 1f20c7bc825114d186a3fc2ccba559d0c45de694 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 12:10:25 +0100 Subject: [PATCH 044/155] extract md preprocessor --- packages/docusaurus-mdx-loader/src/loader.ts | 22 +++----------- .../docusaurus-mdx-loader/src/preprocessor.ts | 29 +++++++++++++++++++ 2 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 packages/docusaurus-mdx-loader/src/preprocessor.ts diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index d814017a10e5..a075d8b4320c 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -12,14 +12,10 @@ import { parseMarkdownContentTitle, escapePath, getFileLoaderUtils, - escapeMarkdownHeadingIds, - unwrapMdxCodeBlocks, } from '@docusaurus/utils'; import emoji from 'remark-emoji'; - import stringifyObject from 'stringify-object'; - -import {admonitionTitleToDirectiveLabel} from '@docusaurus/utils/lib/markdownUtils'; +import preprocessor from './preprocessor'; import headings from './remark/headings'; import toc from './remark/toc'; import transformImage from './remark/transformImage'; @@ -188,19 +184,9 @@ export async function mdxLoader( }, ); - function preprocessContent(md: string): string { - md = unwrapMdxCodeBlocks(md); - md = escapeMarkdownHeadingIds(md); - if (reqOptions.admonitions) { - const {keywords} = normalizeAdmonitionOptions(reqOptions.admonitions); - md = admonitionTitleToDirectiveLabel(md, keywords); - } - // TODO MDX 2 doesn't like our unescaped html comments < - md = md.replaceAll('\n\n"; + } + } + return "\n\n"; + } +} + +// node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +function containerPhrasing(parent, context, safeOptions) { + const indexStack = context.indexStack; + const children = parent.children || []; + const results = []; + let index = -1; + let before = safeOptions.before; + indexStack.push(-1); + let tracker = track(safeOptions); + while (++index < children.length) { + const child = children[index]; + let after; + indexStack[indexStack.length - 1] = index; + if (index + 1 < children.length) { + let handle = context.handle.handlers[children[index + 1].type]; + if (handle && handle.peek) + handle = handle.peek; + after = handle ? handle(children[index + 1], parent, context, { + before: "", + after: "", + ...tracker.current() + }).charAt(0) : ""; + } else { + after = safeOptions.after; + } + if (results.length > 0 && (before === "\r" || before === "\n") && child.type === "html") { + results[results.length - 1] = results[results.length - 1].replace( + /(\r?\n|\r)$/, + " " + ); + before = " "; + tracker = track(safeOptions); + tracker.move(results.join("")); + } + results.push( + tracker.move( + context.handle(child, parent, context, { + ...tracker.current(), + before, + after + }) + ) + ); + before = results[results.length - 1].slice(-1); + } + indexStack.pop(); + return results.join(""); +} + +// node_modules/mdast-util-to-markdown/lib/util/check-quote.js +function checkQuote(context) { + const marker = context.options.quote || '"'; + if (marker !== '"' && marker !== "'") { + throw new Error( + "Cannot serialize title with `" + marker + "` for `options.quote`, expected `\"`, or `'`" + ); + } + return marker; +} + +// node_modules/mdast-util-directive/index.js +var own2 = {}.hasOwnProperty; +var shortcut = /^[^\t\n\r "#'.<=>`}]+$/; +handleDirective.peek = peekDirective; +var directiveFromMarkdown = { + canContainEols: ["textDirective"], + enter: { + directiveContainer: enterContainer, + directiveContainerAttributes: enterAttributes, + directiveContainerLabel: enterContainerLabel, + directiveLeaf: enterLeaf, + directiveLeafAttributes: enterAttributes, + directiveText: enterText, + directiveTextAttributes: enterAttributes + }, + exit: { + directiveContainer: exit, + directiveContainerAttributeClassValue: exitAttributeClassValue, + directiveContainerAttributeIdValue: exitAttributeIdValue, + directiveContainerAttributeName: exitAttributeName, + directiveContainerAttributeValue: exitAttributeValue, + directiveContainerAttributes: exitAttributes, + directiveContainerLabel: exitContainerLabel, + directiveContainerName: exitName, + directiveLeaf: exit, + directiveLeafAttributeClassValue: exitAttributeClassValue, + directiveLeafAttributeIdValue: exitAttributeIdValue, + directiveLeafAttributeName: exitAttributeName, + directiveLeafAttributeValue: exitAttributeValue, + directiveLeafAttributes: exitAttributes, + directiveLeafName: exitName, + directiveText: exit, + directiveTextAttributeClassValue: exitAttributeClassValue, + directiveTextAttributeIdValue: exitAttributeIdValue, + directiveTextAttributeName: exitAttributeName, + directiveTextAttributeValue: exitAttributeValue, + directiveTextAttributes: exitAttributes, + directiveTextName: exitName + } +}; +var directiveToMarkdown = { + unsafe: [ + { + character: "\r", + inConstruct: ["leafDirectiveLabel", "containerDirectiveLabel"] + }, + { + character: "\n", + inConstruct: ["leafDirectiveLabel", "containerDirectiveLabel"] + }, + { + before: "[^:]", + character: ":", + after: "[A-Za-z]", + inConstruct: ["phrasing"] + }, + { atBreak: true, character: ":", after: ":" } + ], + handlers: { + containerDirective: handleDirective, + leafDirective: handleDirective, + textDirective: handleDirective + } +}; +function enterContainer(token) { + enter.call(this, "containerDirective", token); +} +function enterLeaf(token) { + enter.call(this, "leafDirective", token); +} +function enterText(token) { + enter.call(this, "textDirective", token); +} +function enter(type, token) { + this.enter({ type, name: "", attributes: {}, children: [] }, token); +} +function exitName(token) { + const node = this.stack[this.stack.length - 1]; + node.name = this.sliceSerialize(token); +} +function enterContainerLabel(token) { + this.enter( + { type: "paragraph", data: { directiveLabel: true }, children: [] }, + token + ); +} +function exitContainerLabel(token) { + this.exit(token); +} +function enterAttributes() { + this.setData("directiveAttributes", []); + this.buffer(); +} +function exitAttributeIdValue(token) { + const list = this.getData("directiveAttributes"); + list.push([ + "id", + parseEntities(this.sliceSerialize(token), { + attribute: true + }) + ]); +} +function exitAttributeClassValue(token) { + const list = this.getData("directiveAttributes"); + list.push([ + "class", + parseEntities(this.sliceSerialize(token), { + attribute: true + }) + ]); +} +function exitAttributeValue(token) { + const list = this.getData("directiveAttributes"); + list[list.length - 1][1] = parseEntities(this.sliceSerialize(token), { + attribute: true + }); +} +function exitAttributeName(token) { + const list = this.getData("directiveAttributes"); + list.push([this.sliceSerialize(token), ""]); +} +function exitAttributes() { + const list = this.getData("directiveAttributes"); + const cleaned = {}; + let index = -1; + while (++index < list.length) { + const attribute = list[index]; + if (attribute[0] === "class" && cleaned.class) { + cleaned.class += " " + attribute[1]; + } else { + cleaned[attribute[0]] = attribute[1]; + } + } + this.setData("directiveAttributes"); + this.resume(); + const node = this.stack[this.stack.length - 1]; + node.attributes = cleaned; +} +function exit(token) { + this.exit(token); +} +function handleDirective(node, _, context, safeOptions) { + const tracker = track(safeOptions); + const sequence = fence(node); + const exit2 = context.enter(node.type); + let value = tracker.move(sequence + (node.name || "")); + let label4 = node; + if (node.type === "containerDirective") { + const head = (node.children || [])[0]; + label4 = inlineDirectiveLabel(head) ? head : void 0; + } + if (label4 && label4.children && label4.children.length > 0) { + const exit3 = context.enter("label"); + const subexit = context.enter(node.type + "Label"); + value += tracker.move("["); + value += tracker.move( + containerPhrasing(label4, context, { + ...tracker.current(), + before: value, + after: "]" + }) + ); + value += tracker.move("]"); + subexit(); + exit3(); + } + value += tracker.move(attributes4(node, context)); + if (node.type === "containerDirective") { + const head = (node.children || [])[0]; + let shallow = node; + if (inlineDirectiveLabel(head)) { + shallow = Object.assign({}, node, { children: node.children.slice(1) }); + } + if (shallow && shallow.children && shallow.children.length > 0) { + value += tracker.move("\n"); + value += tracker.move(containerFlow(shallow, context, tracker.current())); + } + value += tracker.move("\n" + sequence); + } + exit2(); + return value; +} +function peekDirective() { + return ":"; +} +function attributes4(node, context) { + const quote = checkQuote(context); + const subset = node.type === "textDirective" ? [quote] : [quote, "\n", "\r"]; + const attrs = node.attributes || {}; + const values = []; + let classesFull; + let classes; + let id; + let key; + for (key in attrs) { + if (own2.call(attrs, key) && attrs[key] !== void 0 && attrs[key] !== null) { + const value = String(attrs[key]); + if (key === "id") { + id = shortcut.test(value) ? "#" + value : quoted("id", value); + } else if (key === "class") { + const list = value.split(/[\t\n\r ]+/g); + const classesFullList = []; + const classesList = []; + let index = -1; + while (++index < list.length) { + ; + (shortcut.test(list[index]) ? classesList : classesFullList).push( + list[index] + ); + } + classesFull = classesFullList.length > 0 ? quoted("class", classesFullList.join(" ")) : ""; + classes = classesList.length > 0 ? "." + classesList.join(".") : ""; + } else { + values.push(quoted(key, value)); + } + } + } + if (classesFull) { + values.unshift(classesFull); + } + if (classes) { + values.unshift(classes); + } + if (id) { + values.unshift(id); + } + return values.length > 0 ? "{" + values.join(" ") + "}" : ""; + function quoted(key2, value) { + return key2 + (value ? "=" + quote + stringifyEntitiesLight(value, { subset }) + quote : ""); + } +} +function inlineDirectiveLabel(node) { + return Boolean( + node && node.type === "paragraph" && node.data && node.data.directiveLabel + ); +} +function fence(node) { + let size = 0; + if (node.type === "containerDirective") { + visitParents(node, "containerDirective", onvisit); + size += 3; + } else if (node.type === "leafDirective") { + size = 2; + } else { + size = 1; + } + return ":".repeat(size); + function onvisit(_, parents) { + let index = parents.length; + let nesting = 0; + while (index--) { + if (parents[index].type === "containerDirective") { + nesting++; + } + } + if (nesting > size) + size = nesting; + } +} + +// node_modules/remark-directive/index.js +function remarkDirective201() { + const data = this.data(); + add("micromarkExtensions", directive()); + add("fromMarkdownExtensions", directiveFromMarkdown); + add("toMarkdownExtensions", directiveToMarkdown); + function add(field, value) { + const list = data[field] ? data[field] : data[field] = []; + list.push(value); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = {}); diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/__snapshots__/index.test.ts.snap index b5597e9fb008..c19b192babb0 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/__snapshots__/index.test.ts.snap @@ -22,25 +22,9 @@ exports[`admonitions remark plugin base 1`] = `

++++

" `; -exports[`admonitions remark plugin custom tag 1`] = ` -"

The blog feature enables you to deploy in no time a full-featured blog.

-

:::info Sample Title

-

Check the Blog Plugin API Reference documentation for an exhaustive list of options.

-

:::

-

Initial setup {#initial-setup}

-

To set up your site's blog, start by creating a blog directory.

-

:::tip

-

Use the Fast Track to understand Docusaurus in 5 minutes ⏱!

-

Use docusaurus.new to test Docusaurus immediately in your browser!

-

:::

-

Admonition with different syntax

" -`; - exports[`admonitions remark plugin default behavior for custom keyword 1`] = ` "

The blog feature enables you to deploy in no time a full-featured blog.

-

:::info Sample Title

-

Check the Blog Plugin API Reference documentation for an exhaustive list of options.

-

:::

+

Sample Title

Check the Blog Plugin API Reference documentation for an exhaustive list of options.

Initial setup {#initial-setup}

To set up your site's blog, start by creating a blog directory.

Use the Fast Track to understand Docusaurus in 5 minutes ⏱!

Use docusaurus.new to test Docusaurus immediately in your browser!

@@ -61,9 +45,7 @@ exports[`admonitions remark plugin nesting 1`] = ` exports[`admonitions remark plugin replace custom keyword 1`] = ` "

The blog feature enables you to deploy in no time a full-featured blog.

-

:::info Sample Title

-

Check the Blog Plugin API Reference documentation for an exhaustive list of options.

-

:::

+

Sample Title

Check the Blog Plugin API Reference documentation for an exhaustive list of options.

Initial setup {#initial-setup}

To set up your site's blog, start by creating a blog directory.

Use the Fast Track to understand Docusaurus in 5 minutes ⏱!

Use docusaurus.new to test Docusaurus immediately in your browser!

diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts index 7e469ceaaa22..2f0df3dd542f 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts @@ -6,26 +6,44 @@ */ import path from 'path'; -import remark from 'remark'; import remark2rehype from 'remark-rehype'; import stringify from 'rehype-stringify'; - import vfile from 'to-vfile'; -import plugin from '../index'; +import preprocessor from '../../../preprocessor'; +import plugin, {DefaultAdmonitionOptions} from '../index'; import type {AdmonitionOptions} from '../index'; const processFixture = async ( name: string, options?: Partial, ) => { + const {remark} = await import('remark'); + const {default: directives} = await import('remark-directive'); + const filePath = path.join(__dirname, '__fixtures__', `${name}.md`); const file = await vfile.read(filePath); + const fileContentPreprocessed = preprocessor(file.toString(), { + admonitions: DefaultAdmonitionOptions, + }); + /* + // TODO we shouldn't use rehype in these tests + // this requires to re-implement admonitions with mdxJsxFlowElement + const {default: mdx} = await import('remark-mdx'); const result = await remark() + .use(directives) + .use(plugin) + .use(mdx) + .process(fileContentPreprocessed); + return result.value; + */ + + const result = await remark() + .use(directives) .use(plugin, options) .use(remark2rehype) .use(stringify) - .process(file); + .process(fileContentPreprocessed); return result.toString(); }; @@ -33,7 +51,7 @@ const processFixture = async ( describe('admonitions remark plugin', () => { it('base', async () => { const result = await processFixture('base'); - expect(result).toMatchSnapshot(); + await expect(result).toMatchSnapshot(); }); it('default behavior for custom keyword', async () => { @@ -60,13 +78,6 @@ describe('admonitions remark plugin', () => { expect(result).toMatchSnapshot(); }); - it('custom tag', async () => { - const result = await processFixture('base', { - tag: '++++', - }); - expect(result).toMatchSnapshot(); - }); - it('interpolation', async () => { const result = await processFixture('interpolation'); expect(result).toMatchSnapshot(); diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts index 4956ddc5eec7..7717aa5e6139 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts @@ -9,6 +9,8 @@ import type {Transformer, Processor, Plugin} from 'unified'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {ContainerDirective} from 'mdast-util-directive'; +import type {Node} from 'unist'; +import type {Parent} from 'mdast'; // TODO not ideal option shape // First let upgrade to MDX 2.0 @@ -21,7 +23,7 @@ export type AdmonitionOptions = { }; export const DefaultAdmonitionOptions: AdmonitionOptions = { - tag: ':::', + tag: ':::', // TODO remove this, breaking change keywords: [ 'secondary', 'info', @@ -96,11 +98,11 @@ function createImportNode() { function createAdmonitionNode({ directive, title, - children, + contentNodes, }: { directive: ContainerDirective; title: unknown; - children: unknown; + contentNodes: unknown; }) { return { type: 'mdxJsxFlowElement', @@ -117,23 +119,38 @@ function createAdmonitionNode({ value: { type: 'mdxJsxAttributeValueExpression', // TODO this is the complex part I couldn't solve :/ - value: mdHastToValueExpression(title), + value: mdastToValueExpression(title), }, }, ], - children, + children: contentNodes, }; } */ -function extractDirectiveLabel(directive: ContainerDirective) { +type DirectiveLabel = Parent; + +function parseDirective(directive: ContainerDirective): { + directiveLabel: DirectiveLabel | undefined; + contentNodes: Node[]; +} { const hasDirectiveLabel = directive.children?.[0].data?.directiveLabel === true; if (hasDirectiveLabel) { - const [directiveLabel, ...children] = directive.children; - return {directiveLabel, children}; + const [directiveLabel, ...contentNodes] = directive.children; + return {directiveLabel, contentNodes}; } - return {directiveLabel: undefined, children: directive.children}; + return {directiveLabel: undefined, contentNodes: directive.children}; +} + +function getTextOnlyTitle(directiveLabel: DirectiveLabel): string | undefined { + const isTextOnlyTitle = + directiveLabel?.children?.length === 1 && + directiveLabel?.children?.[0]?.type === 'text'; + return isTextOnlyTitle + ? // @ts-expect-error: todo type + (directiveLabel?.children?.[0].value as string) + : undefined; } // This string value does not matter much @@ -172,41 +189,49 @@ const plugin: Plugin = function plugin( return; } - const {directiveLabel, children} = extractDirectiveLabel(directive); + const {directiveLabel, contentNodes} = parseDirective(directive); /* // :::tip{title="my title} overrides :::tip[my title] const title = directive.attributes?.title ?? directiveLabel?.children; - const admonitionNode = createAdmonitionNode({ directive, title, - children, + contentNodes, }); - parent!.children.splice(index, 1, admonitionNode); - */ + const textOnlyTitle = + directive.attributes?.title ?? + (directiveLabel ? getTextOnlyTitle(directiveLabel) : undefined); + + // Transform the mdast directive node to a hast admonition node + // See https://github.com/syntax-tree/mdast-util-to-hast#fields-on-nodes // TODO in MDX v2 we should transform the whole directive to // mdxJsxFlowElement instead of using hast - directive.data ??= {}; - directive.data.hName = 'admonition'; - directive.data.hProperties = { - ...directive.attributes, - type: directive.name, - title: directive.attributes?.title, + directive.data = { + hName: 'admonition', + hProperties: { + ...(textOnlyTitle && {title: textOnlyTitle}), + type: directive.name, + }, }; + directive.children = contentNodes; // TODO legacy MDX v1 workaround - // Because it wasn't possible to inject JSX elements as props in v1 - // in v2 we should transform the whole directive to mdxJsxFlowElement - // not so easy :/ - if (directiveLabel) { - directiveLabel.data.hName = 'mdxAdmonitionTitle'; - directiveLabel.data.hProperties = - directiveLabel.data.hProperties ?? {}; - directiveLabel.data.hProperties.mdxType = 'mdxAdmonitionTitle'; + // v1: not possible to inject complex JSX elements as props + // v2: now possible: use a mdxJsxFlowElement element + if (directiveLabel && !textOnlyTitle) { + const complexTitleNode = { + type: 'mdxAdmonitionTitle', + data: { + hName: 'mdxAdmonitionTitle', + hProperties: {}, + }, + children: directiveLabel.children, + }; + directive.children.unshift(complexTitleNode); } } }); diff --git a/packages/docusaurus-utils/src/index.ts b/packages/docusaurus-utils/src/index.ts index 7b5fa8f1f409..74c71591785e 100644 --- a/packages/docusaurus-utils/src/index.ts +++ b/packages/docusaurus-utils/src/index.ts @@ -68,6 +68,7 @@ export { parseMarkdownHeadingId, escapeMarkdownHeadingIds, unwrapMdxCodeBlocks, + admonitionTitleToDirectiveLabel, createExcerpt, parseFrontMatter, parseMarkdownContentTitle, From e9c406e2c92387f570489471bee3672047dd0b89 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 12:30:03 +0100 Subject: [PATCH 046/155] move containerDirective comment --- .../docusaurus-mdx-loader/src/remark/admonitions/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts index 7717aa5e6139..0690cf7c386e 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts @@ -163,9 +163,6 @@ const plugin: Plugin = function plugin( ): Transformer { const {keywords} = normalizeAdmonitionOptions(optionsInput); - // See also: - // https://talk.commonmark.org/t/generic-directives-plugins-syntax/444 - // https://github.com/remarkjs/remark-directive return async (root) => { /* let transformed = false; @@ -179,6 +176,9 @@ const plugin: Plugin = function plugin( } */ + // See also: + // https://talk.commonmark.org/t/generic-directives-plugins-syntax/444 + // https://github.com/remarkjs/remark-directive if (node.type === 'containerDirective') { // transformed = true; From 73efc9420115e8fb191006a26f2c631a4bda1b2f Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 12:45:50 +0100 Subject: [PATCH 047/155] vendor mdast-util-to-string@3.1.0.js --- jest.config.mjs | 2 ++ jest/vendor/mdast-util-to-string@3.1.0.js | 43 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 jest/vendor/mdast-util-to-string@3.1.0.js diff --git a/jest.config.mjs b/jest.config.mjs index 0ed8445f841a..693fe12a8868 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -87,6 +87,8 @@ export default { '^remark$': '/jest/vendor/remark@14.0.2.js', '^remark-mdx$': '/jest/vendor/remark-mdx@2.1.5.js', '^remark-directive$': '/jest/vendor/remark-directive@2.0.1.js', + '^mdast-util-to-string$': + '/jest/vendor/mdast-util-to-string@3.1.0.js', }, snapshotSerializers: [ '/jest/snapshotPathNormalizer.ts', diff --git a/jest/vendor/mdast-util-to-string@3.1.0.js b/jest/vendor/mdast-util-to-string@3.1.0.js new file mode 100644 index 000000000000..e3048f5ff184 --- /dev/null +++ b/jest/vendor/mdast-util-to-string@3.1.0.js @@ -0,0 +1,43 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all2) => { + for (var name in all2) + __defProp(target, name, { get: all2[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/mdast-util-to-string/index.js +var mdast_util_to_string_exports = {}; +__export(mdast_util_to_string_exports, { + toString: () => toString +}); +module.exports = __toCommonJS(mdast_util_to_string_exports); +function toString(node, options) { + var { includeImageAlt = true } = options || {}; + return one(node, includeImageAlt); +} +function one(node, includeImageAlt) { + return node && typeof node === "object" && (node.value || (includeImageAlt ? node.alt : "") || "children" in node && all(node.children, includeImageAlt) || Array.isArray(node) && all(node, includeImageAlt)) || ""; +} +function all(values, includeImageAlt) { + var result = []; + var index = -1; + while (++index < values.length) { + result[index] = one(values[index], includeImageAlt); + } + return result.join(""); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + toString +}); From abf8e9cafbd92675f0ff3bd299bb96f915cdd914 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 14:57:15 +0100 Subject: [PATCH 048/155] fix transformImage --- .../__snapshots__/index.test.ts.snap | 26 +++++++++---------- .../transformImage/__tests__/index.test.ts | 9 +++---- .../src/remark/transformImage/index.ts | 22 +++++++--------- .../src/remark/utils/index.ts | 2 +- 4 files changed, 27 insertions(+), 32 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__snapshots__/index.test.ts.snap index 8366a7b23e19..2cf64ba7288c 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__snapshots__/index.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`transformImage plugin does not choke on invalid image 1`] = ` -"{"invalid/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/invalid.png").default} /> +"invalid image/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/invalid.png").default} /> " `; @@ -21,27 +21,27 @@ exports[`transformImage plugin transform md images to 1`] = ` /node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} width="200" height="200" /> -{"img"}/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} width="200" height="200" /> +img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} width="200" height="200" /> -{"img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static2/img2.png").default} width="256" height="82" /> +img from second static folder/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static2/img2.png").default} width="256" height="82" /> -{"img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static2/img2.png").default} width="256" height="82" /> +img from second static folder/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static2/img2.png").default} width="256" height="82" /> -{"img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static2/img2 copy.png").default} width="256" height="82" /> +img with URL encoded chars/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static2/img2 copy.png").default} width="256" height="82" /> -{"img"}/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} title="Title" width="200" height="200" /> {"img"}/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} width="200" height="200" /> +img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} title="Title" width="200" height="200" /> img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} width="200" height="200" /> -{"img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} title="'Quoted' title" width="200" height="200" /> +!/[img with "quotes"]/(./static/img.png ''Quoted' title') -{"site/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} width="200" height="200" /> +site alias/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} width="200" height="200" /> -{"img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default + '#light'} width="200" height="200" /> -{"img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default + '#dark'} width="200" height="200" /> +img with hash/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default + '#light'} width="200" height="200" /> +img with hash/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default + '#dark'} width="200" height="200" /> -{"img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png?w=10").default} width="200" height="200" /> -{"img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png?w=10&h=10").default} width="200" height="200" /> +img with query/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png?w=10").default} width="200" height="200" /> +img with query/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png?w=10&h=10").default} width="200" height="200" /> -{"img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png?w=10&h=10").default + '#light'} width="200" height="200" /> +img with both/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png?w=10&h=10").default + '#light'} width="200" height="200" /> ## Heading diff --git a/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/index.test.ts index ce9779dabc48..f491fd7ac365 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/index.test.ts @@ -9,23 +9,22 @@ import {jest} from '@jest/globals'; import path from 'path'; import vfile from 'to-vfile'; import plugin, {type PluginOptions} from '../index'; -import headings from '../../headings/index'; const processFixture = async ( name: string, options: Partial, ) => { - const remark = (await import('remark')).default; - const mdx = (await import('remark-mdx')).default; + const {remark} = await import('remark'); + const {default: mdx} = await import('remark-mdx'); const filePath = path.join(__dirname, `__fixtures__/${name}.md`); const file = await vfile.read(filePath); + const result = await remark() - .use(headings) .use(mdx) .use(plugin, {siteDir: __dirname, staticDirs: [], ...options}) .process(file); - return result.toString(); + return result.value; }; const staticDirs = [ diff --git a/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts index c3bebfda76d6..aea08ad1b025 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts @@ -63,17 +63,6 @@ async function toImageRequireNode( const requireString = `${inlineMarkdownImageFileLoader}${ escapePath(relativeImagePath) + search }`; - attributes.push({ - type: 'mdxJsxAttribute', - name: 'src', - value: assetRequireAttributeValue(requireString, hash), - }); - - attributes.push({ - type: 'mdxJsxAttribute', - name: 'loading', - value: 'lazy', - }); if (node.alt) { attributes.push({ type: 'mdxJsxAttribute', @@ -81,6 +70,13 @@ async function toImageRequireNode( value: escapeHtml(node.alt), }); } + + attributes.push({ + type: 'mdxJsxAttribute', + name: 'src', + value: assetRequireAttributeValue(requireString, hash), + }); + if (node.title) { attributes.push({ type: 'mdxJsxAttribute', @@ -95,14 +91,14 @@ async function toImageRequireNode( attributes.push({ type: 'mdxJsxAttribute', name: 'width', - value: size.width, + value: String(size.width), }); } if (size.height) { attributes.push({ type: 'mdxJsxAttribute', name: 'height', - value: size.height, + value: String(size.height), }); } } catch (err) { diff --git a/packages/docusaurus-mdx-loader/src/remark/utils/index.ts b/packages/docusaurus-mdx-loader/src/remark/utils/index.ts index f79f19d540ef..ef24c7847344 100644 --- a/packages/docusaurus-mdx-loader/src/remark/utils/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/utils/index.ts @@ -48,7 +48,7 @@ export function assetRequireAttributeValue( ) { return { type: 'mdxJsxAttributeValueExpression', - value: `require("${requireString}").default + '${hash}'`, + value: `require("${requireString}").default${hash && ` + '${hash}'`}`, data: { estree: { type: 'Program', From 02f48b1b20cec6dc3787576dceb554f1f659a6f7 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 15:28:55 +0100 Subject: [PATCH 049/155] fix transformLinks + tests --- .../__snapshots__/index.test.ts.snap | 66 ++++++++++++++----- .../transformLinks/__tests__/index.test.ts | 6 +- .../src/remark/transformLinks/index.ts | 12 ++-- 3 files changed, 60 insertions(+), 24 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap index 2e6d8d8648a4..b6b1afde86a4 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap @@ -12,15 +12,23 @@ exports[`transformAsset plugin pathname protocol 1`] = ` exports[`transformAsset plugin transform md links to 1`] = ` "[asset](https://example.com/asset.pdf) -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf').default}> +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default} /> -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf').default}>asset +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default}> + asset + -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset (2).pdf').default}>asset with URL encoded chars +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset (2).pdf").default}> + asset with URL encoded chars + -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf').default + '#page=2'}>asset with hash +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default + '#page=2'}> + asset with hash + -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf').default} title="Title">asset +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default} title="Title"> + asset + [page](noUrl.md) @@ -34,24 +42,52 @@ exports[`transformAsset plugin transform md links to 1`] = ` [assets](/github/!file-loader!/assets.pdf) -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf').default}>asset +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default}> + asset + -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static2/asset2.pdf').default}>asset2 +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static2/asset2.pdf").default}> + asset2 + -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf').default}>staticAsset.pdf +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}> + staticAsset.pdf + -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf').default}>@site/static/staticAsset.pdf +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}> + @site/static/staticAsset.pdf + -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf').default + '#page=2'} title="Title">@site/static/staticAsset.pdf +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default + '#page=2'} title="Title"> + @site/static/staticAsset.pdf + -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf').default}>Just staticAsset.pdf, and /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf').default}>awesome staticAsset 2.pdf 'It is really "AWESOME"', but also /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf').default}>coded staticAsset 3.pdf +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}> + Just staticAsset.pdf +, and /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}> + **awesome** -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAssetImage.png').default}>{"Clickable/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/staticAssetImage.png").default} width="200" height="200" /> + staticAsset 2.pdf 'It is really "AWESOME"' +, but also /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}> + coded -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf').default}>Stylized link to asset file + \`staticAsset 3.pdf\` + -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./data.json').default}>JSON +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAssetImage.png").default}> + Clickable Docusaurus logo/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/staticAssetImage.png").default} width="200" height="200" /> + -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/static-json.json').default}>static JSON +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default}> + Stylized link to asset file + + +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./data.json").default}> + JSON + + +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/static-json.json").default}> + static JSON + " `; diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/index.test.ts index e960cc2c0c88..346c46e599e8 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/index.test.ts @@ -11,8 +11,8 @@ import plugin from '..'; import transformImage, {type PluginOptions} from '../../transformImage'; const processFixture = async (name: string, options?: PluginOptions) => { - const remark = (await import('remark')).default; - const mdx = (await import('remark-mdx')).default; + const {remark} = await import('remark'); + const {default: mdx} = await import('remark-mdx'); const siteDir = path.join(__dirname, `__fixtures__`); const staticDirs = [ path.join(siteDir, 'static'), @@ -29,7 +29,7 @@ const processFixture = async (name: string, options?: PluginOptions) => { }) .process(file); - return result.toString(); + return result.value; }; describe('transformAsset plugin', () => { diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts index ada7ba536cef..0c51d70bb5d5 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts @@ -73,14 +73,14 @@ async function toAssetRequireNode( attributes.push({ type: 'mdxJsxAttribute', - name: 'href', - value: assetRequireAttributeValue(requireString, hash), + name: 'target', + value: '_blank', }); attributes.push({ type: 'mdxJsxAttribute', - name: 'target', - value: '_blank', + name: 'href', + value: assetRequireAttributeValue(requireString, hash), }); if (node.title) { @@ -91,7 +91,7 @@ async function toAssetRequireNode( }); } - const children = stringifyContent(node, toString); + const {children} = node; Object.keys(jsxNode).forEach( (key) => delete jsxNode[key as keyof typeof jsxNode], @@ -100,7 +100,7 @@ async function toAssetRequireNode( jsxNode.type = 'mdxJsxFlowElement'; jsxNode.name = 'a'; jsxNode.attributes = attributes; - jsxNode.children = [{type: 'text', value: children}]; + jsxNode.children = children; } async function ensureAssetFileExist(assetPath: string, sourceFilePath: string) { From 0bf628cdd0b051aaa2cf54525dbf1e3cc4ff3235 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 15:41:11 +0100 Subject: [PATCH 050/155] vendor estree-util-value-to-estree@2.1.0.js --- jest.config.mjs | 2 + .../estree-util-value-to-estree@2.1.0.js | 151 ++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 jest/vendor/estree-util-value-to-estree@2.1.0.js diff --git a/jest.config.mjs b/jest.config.mjs index 693fe12a8868..9e436f01eeac 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -87,6 +87,8 @@ export default { '^remark$': '/jest/vendor/remark@14.0.2.js', '^remark-mdx$': '/jest/vendor/remark-mdx@2.1.5.js', '^remark-directive$': '/jest/vendor/remark-directive@2.0.1.js', + '^estree-util-value-to-estree$': + '/jest/vendor/estree-util-value-to-estree@2.1.0.js', '^mdast-util-to-string$': '/jest/vendor/mdast-util-to-string@3.1.0.js', }, diff --git a/jest/vendor/estree-util-value-to-estree@2.1.0.js b/jest/vendor/estree-util-value-to-estree@2.1.0.js new file mode 100644 index 000000000000..6e1d32d08871 --- /dev/null +++ b/jest/vendor/estree-util-value-to-estree@2.1.0.js @@ -0,0 +1,151 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/estree-util-value-to-estree/index.js +var estree_util_value_to_estree_exports = {}; +__export(estree_util_value_to_estree_exports, { + valueToEstree: () => valueToEstree +}); +module.exports = __toCommonJS(estree_util_value_to_estree_exports); + +// node_modules/estree-util-value-to-estree/node_modules/is-plain-obj/index.js +function isPlainObject(value) { + if (typeof value !== "object" || value === null) { + return false; + } + const prototype = Object.getPrototypeOf(value); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); +} + +// node_modules/estree-util-value-to-estree/index.js +function valueToEstree(value, options = {}) { + if (value === void 0 || value === Number.POSITIVE_INFINITY || Number.isNaN(value)) { + return { type: "Identifier", name: String(value) }; + } + if (value == null || typeof value === "string" || typeof value === "boolean") { + return { type: "Literal", value }; + } + if (typeof value === "bigint") { + return value >= 0 ? { type: "Literal", value, bigint: String(value) } : { + type: "UnaryExpression", + operator: "-", + prefix: true, + argument: valueToEstree(-value, options) + }; + } + if (typeof value === "number") { + return value >= 0 ? { type: "Literal", value } : { + type: "UnaryExpression", + operator: "-", + prefix: true, + argument: valueToEstree(-value, options) + }; + } + if (typeof value === "symbol") { + if (value.description && value === Symbol.for(value.description)) { + return { + type: "CallExpression", + optional: false, + callee: { + type: "MemberExpression", + computed: false, + optional: false, + object: { type: "Identifier", name: "Symbol" }, + property: { type: "Identifier", name: "for" } + }, + arguments: [valueToEstree(value.description, options)] + }; + } + throw new TypeError(`Only global symbols are supported, got: ${String(value)}`); + } + if (Array.isArray(value)) { + const elements = []; + for (let i = 0; i < value.length; i += 1) { + elements.push(i in value ? valueToEstree(value[i], options) : null); + } + return { type: "ArrayExpression", elements }; + } + if (value instanceof Boolean || value instanceof Number || value instanceof String) { + return { + type: "NewExpression", + callee: { type: "Identifier", name: value.constructor.name }, + arguments: [valueToEstree(value.valueOf())] + }; + } + if (value instanceof RegExp) { + return { + type: "Literal", + value, + regex: { pattern: value.source, flags: value.flags } + }; + } + if (value instanceof Date) { + return { + type: "NewExpression", + callee: { type: "Identifier", name: "Date" }, + arguments: [valueToEstree(value.getTime(), options)] + }; + } + if (typeof Buffer !== "undefined" && Buffer.isBuffer(value)) { + return { + type: "CallExpression", + optional: false, + callee: { + type: "MemberExpression", + computed: false, + optional: false, + object: { type: "Identifier", name: "Buffer" }, + property: { type: "Identifier", name: "from" } + }, + arguments: [valueToEstree([...value])] + }; + } + if (value instanceof BigInt64Array || value instanceof BigUint64Array || value instanceof Float32Array || value instanceof Float64Array || value instanceof Int8Array || value instanceof Int16Array || value instanceof Int32Array || value instanceof Map || value instanceof Set || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Uint16Array || value instanceof Uint32Array) { + return { + type: "NewExpression", + callee: { type: "Identifier", name: value.constructor.name }, + arguments: [valueToEstree([...value], options)] + }; + } + if (value instanceof URL || value instanceof URLSearchParams) { + return { + type: "NewExpression", + callee: { type: "Identifier", name: value.constructor.name }, + arguments: [valueToEstree(String(value), options)] + }; + } + if (options.instanceAsObject || isPlainObject(value)) { + return { + type: "ObjectExpression", + properties: Reflect.ownKeys(value).map((key) => ({ + type: "Property", + method: false, + shorthand: false, + computed: typeof key !== "string", + kind: "init", + key: valueToEstree(key, options), + value: valueToEstree(value[key], options) + })) + }; + } + throw new TypeError(`Unsupported value: ${String(value)}`); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + valueToEstree +}); From 6ccc4375d206f53266815ff72e926f64ec0438ae Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 15:41:33 +0100 Subject: [PATCH 051/155] useless import --- .../docusaurus-mdx-loader/src/remark/transformLinks/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts index 0c51d70bb5d5..eb2d5c1ca241 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts @@ -17,7 +17,7 @@ import { } from '@docusaurus/utils'; import visit from 'unist-util-visit'; import escapeHtml from 'escape-html'; -import {assetRequireAttributeValue, stringifyContent} from '../utils'; +import {assetRequireAttributeValue} from '../utils'; import type {Transformer} from 'unified'; import type {Parent} from 'unist'; import type {Link, Literal} from 'mdast'; From 1d4d1033f71a49fddfbe063362c9e8d5789bac4b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 16:13:25 +0100 Subject: [PATCH 052/155] vendor remark-gfm@3.0.1.js --- jest.config.mjs | 1 + jest/vendor/remark-gfm@3.0.1.js | 4907 +++++++++++++++++++++++++++++++ 2 files changed, 4908 insertions(+) create mode 100644 jest/vendor/remark-gfm@3.0.1.js diff --git a/jest.config.mjs b/jest.config.mjs index 9e436f01eeac..8e2ed294da73 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -87,6 +87,7 @@ export default { '^remark$': '/jest/vendor/remark@14.0.2.js', '^remark-mdx$': '/jest/vendor/remark-mdx@2.1.5.js', '^remark-directive$': '/jest/vendor/remark-directive@2.0.1.js', + '^remark-gfm$': '/jest/vendor/remark-gfm@3.0.1.js', '^estree-util-value-to-estree$': '/jest/vendor/estree-util-value-to-estree@2.1.0.js', '^mdast-util-to-string$': diff --git a/jest/vendor/remark-gfm@3.0.1.js b/jest/vendor/remark-gfm@3.0.1.js new file mode 100644 index 000000000000..2a9d8c58dda0 --- /dev/null +++ b/jest/vendor/remark-gfm@3.0.1.js @@ -0,0 +1,4907 @@ +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/remark-gfm/index.js +var remark_gfm_exports = {}; +__export(remark_gfm_exports, { + default: () => remarkGfm +}); +module.exports = __toCommonJS(remark_gfm_exports); + +// node_modules/micromark-util-chunked/index.js +function splice(list, start, remove, items) { + const end = list.length; + let chunkStart = 0; + let parameters; + if (start < 0) { + start = -start > end ? 0 : end + start; + } else { + start = start > end ? end : start; + } + remove = remove > 0 ? remove : 0; + if (items.length < 1e4) { + parameters = Array.from(items); + parameters.unshift(start, remove); + [].splice.apply(list, parameters); + } else { + if (remove) + [].splice.apply(list, [start, remove]); + while (chunkStart < items.length) { + parameters = items.slice(chunkStart, chunkStart + 1e4); + parameters.unshift(start, 0); + [].splice.apply(list, parameters); + chunkStart += 1e4; + start += 1e4; + } + } +} + +// node_modules/micromark-util-combine-extensions/index.js +var hasOwnProperty = {}.hasOwnProperty; +function combineExtensions(extensions) { + const all = {}; + let index = -1; + while (++index < extensions.length) { + syntaxExtension(all, extensions[index]); + } + return all; +} +function syntaxExtension(all, extension) { + let hook; + for (hook in extension) { + const maybe = hasOwnProperty.call(all, hook) ? all[hook] : void 0; + const left = maybe || (all[hook] = {}); + const right = extension[hook]; + let code2; + for (code2 in right) { + if (!hasOwnProperty.call(left, code2)) + left[code2] = []; + const value = right[code2]; + constructs( + left[code2], + Array.isArray(value) ? value : value ? [value] : [] + ); + } + } +} +function constructs(existing, list) { + let index = -1; + const before = []; + while (++index < list.length) { + ; + (list[index].add === "after" ? existing : before).push(list[index]); + } + splice(existing, 0, 0, before); +} + +// node_modules/micromark-util-character/lib/unicode-punctuation-regex.js +var unicodePunctuationRegex = /[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/; + +// node_modules/micromark-util-character/index.js +var asciiAlpha = regexCheck(/[A-Za-z]/); +var asciiDigit = regexCheck(/\d/); +var asciiHexDigit = regexCheck(/[\dA-Fa-f]/); +var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/); +var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/); +var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/); +function asciiControl(code2) { + return code2 !== null && (code2 < 32 || code2 === 127); +} +function markdownLineEndingOrSpace(code2) { + return code2 !== null && (code2 < 0 || code2 === 32); +} +function markdownLineEnding(code2) { + return code2 !== null && code2 < -2; +} +function markdownSpace(code2) { + return code2 === -2 || code2 === -1 || code2 === 32; +} +var unicodeWhitespace = regexCheck(/\s/); +var unicodePunctuation = regexCheck(unicodePunctuationRegex); +function regexCheck(regex) { + return check; + function check(code2) { + return code2 !== null && regex.test(String.fromCharCode(code2)); + } +} + +// node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js +var www = { + tokenize: tokenizeWww, + partial: true +}; +var domain = { + tokenize: tokenizeDomain, + partial: true +}; +var path = { + tokenize: tokenizePath, + partial: true +}; +var punctuation = { + tokenize: tokenizePunctuation, + partial: true +}; +var namedCharacterReference = { + tokenize: tokenizeNamedCharacterReference, + partial: true +}; +var wwwAutolink = { + tokenize: tokenizeWwwAutolink, + previous: previousWww +}; +var httpAutolink = { + tokenize: tokenizeHttpAutolink, + previous: previousHttp +}; +var emailAutolink = { + tokenize: tokenizeEmailAutolink, + previous: previousEmail +}; +var text = {}; +var gfmAutolinkLiteral = { + text +}; +var code = 48; +while (code < 123) { + text[code] = emailAutolink; + code++; + if (code === 58) + code = 65; + else if (code === 91) + code = 97; +} +text[43] = emailAutolink; +text[45] = emailAutolink; +text[46] = emailAutolink; +text[95] = emailAutolink; +text[72] = [emailAutolink, httpAutolink]; +text[104] = [emailAutolink, httpAutolink]; +text[87] = [emailAutolink, wwwAutolink]; +text[119] = [emailAutolink, wwwAutolink]; +function tokenizeEmailAutolink(effects, ok2, nok) { + const self = this; + let hasDot; + let hasDigitInLastSegment; + return start; + function start(code2) { + if (!gfmAtext(code2) || !previousEmail(self.previous) || previousUnbalanced(self.events)) { + return nok(code2); + } + effects.enter("literalAutolink"); + effects.enter("literalAutolinkEmail"); + return atext(code2); + } + function atext(code2) { + if (gfmAtext(code2)) { + effects.consume(code2); + return atext; + } + if (code2 === 64) { + effects.consume(code2); + return label; + } + return nok(code2); + } + function label(code2) { + if (code2 === 46) { + return effects.check(punctuation, done, dotContinuation)(code2); + } + if (code2 === 45 || code2 === 95) { + return effects.check(punctuation, nok, dashOrUnderscoreContinuation)(code2); + } + if (asciiAlphanumeric(code2)) { + if (!hasDigitInLastSegment && asciiDigit(code2)) { + hasDigitInLastSegment = true; + } + effects.consume(code2); + return label; + } + return done(code2); + } + function dotContinuation(code2) { + effects.consume(code2); + hasDot = true; + hasDigitInLastSegment = void 0; + return label; + } + function dashOrUnderscoreContinuation(code2) { + effects.consume(code2); + return afterDashOrUnderscore; + } + function afterDashOrUnderscore(code2) { + if (code2 === 46) { + return effects.check(punctuation, nok, dotContinuation)(code2); + } + return label(code2); + } + function done(code2) { + if (hasDot && !hasDigitInLastSegment) { + effects.exit("literalAutolinkEmail"); + effects.exit("literalAutolink"); + return ok2(code2); + } + return nok(code2); + } +} +function tokenizeWwwAutolink(effects, ok2, nok) { + const self = this; + return start; + function start(code2) { + if (code2 !== 87 && code2 !== 119 || !previousWww(self.previous) || previousUnbalanced(self.events)) { + return nok(code2); + } + effects.enter("literalAutolink"); + effects.enter("literalAutolinkWww"); + return effects.check( + www, + effects.attempt(domain, effects.attempt(path, done), nok), + nok + )(code2); + } + function done(code2) { + effects.exit("literalAutolinkWww"); + effects.exit("literalAutolink"); + return ok2(code2); + } +} +function tokenizeHttpAutolink(effects, ok2, nok) { + const self = this; + return start; + function start(code2) { + if (code2 !== 72 && code2 !== 104 || !previousHttp(self.previous) || previousUnbalanced(self.events)) { + return nok(code2); + } + effects.enter("literalAutolink"); + effects.enter("literalAutolinkHttp"); + effects.consume(code2); + return t1; + } + function t1(code2) { + if (code2 === 84 || code2 === 116) { + effects.consume(code2); + return t2; + } + return nok(code2); + } + function t2(code2) { + if (code2 === 84 || code2 === 116) { + effects.consume(code2); + return p; + } + return nok(code2); + } + function p(code2) { + if (code2 === 80 || code2 === 112) { + effects.consume(code2); + return s; + } + return nok(code2); + } + function s(code2) { + if (code2 === 83 || code2 === 115) { + effects.consume(code2); + return colon; + } + return colon(code2); + } + function colon(code2) { + if (code2 === 58) { + effects.consume(code2); + return slash1; + } + return nok(code2); + } + function slash1(code2) { + if (code2 === 47) { + effects.consume(code2); + return slash2; + } + return nok(code2); + } + function slash2(code2) { + if (code2 === 47) { + effects.consume(code2); + return after; + } + return nok(code2); + } + function after(code2) { + return code2 === null || asciiControl(code2) || unicodeWhitespace(code2) || unicodePunctuation(code2) ? nok(code2) : effects.attempt(domain, effects.attempt(path, done), nok)(code2); + } + function done(code2) { + effects.exit("literalAutolinkHttp"); + effects.exit("literalAutolink"); + return ok2(code2); + } +} +function tokenizeWww(effects, ok2, nok) { + return start; + function start(code2) { + effects.consume(code2); + return w2; + } + function w2(code2) { + if (code2 === 87 || code2 === 119) { + effects.consume(code2); + return w3; + } + return nok(code2); + } + function w3(code2) { + if (code2 === 87 || code2 === 119) { + effects.consume(code2); + return dot; + } + return nok(code2); + } + function dot(code2) { + if (code2 === 46) { + effects.consume(code2); + return after; + } + return nok(code2); + } + function after(code2) { + return code2 === null || markdownLineEnding(code2) ? nok(code2) : ok2(code2); + } +} +function tokenizeDomain(effects, ok2, nok) { + let hasUnderscoreInLastSegment; + let hasUnderscoreInLastLastSegment; + return domain2; + function domain2(code2) { + if (code2 === 38) { + return effects.check( + namedCharacterReference, + done, + punctuationContinuation + )(code2); + } + if (code2 === 46 || code2 === 95) { + return effects.check(punctuation, done, punctuationContinuation)(code2); + } + if (code2 === null || asciiControl(code2) || unicodeWhitespace(code2) || code2 !== 45 && unicodePunctuation(code2)) { + return done(code2); + } + effects.consume(code2); + return domain2; + } + function punctuationContinuation(code2) { + if (code2 === 46) { + hasUnderscoreInLastLastSegment = hasUnderscoreInLastSegment; + hasUnderscoreInLastSegment = void 0; + effects.consume(code2); + return domain2; + } + if (code2 === 95) + hasUnderscoreInLastSegment = true; + effects.consume(code2); + return domain2; + } + function done(code2) { + if (!hasUnderscoreInLastLastSegment && !hasUnderscoreInLastSegment) { + return ok2(code2); + } + return nok(code2); + } +} +function tokenizePath(effects, ok2) { + let balance = 0; + return inPath; + function inPath(code2) { + if (code2 === 38) { + return effects.check( + namedCharacterReference, + ok2, + continuedPunctuation + )(code2); + } + if (code2 === 40) { + balance++; + } + if (code2 === 41) { + return effects.check( + punctuation, + parenAtPathEnd, + continuedPunctuation + )(code2); + } + if (pathEnd(code2)) { + return ok2(code2); + } + if (trailingPunctuation(code2)) { + return effects.check(punctuation, ok2, continuedPunctuation)(code2); + } + effects.consume(code2); + return inPath; + } + function continuedPunctuation(code2) { + effects.consume(code2); + return inPath; + } + function parenAtPathEnd(code2) { + balance--; + return balance < 0 ? ok2(code2) : continuedPunctuation(code2); + } +} +function tokenizeNamedCharacterReference(effects, ok2, nok) { + return start; + function start(code2) { + effects.consume(code2); + return inside; + } + function inside(code2) { + if (asciiAlpha(code2)) { + effects.consume(code2); + return inside; + } + if (code2 === 59) { + effects.consume(code2); + return after; + } + return nok(code2); + } + function after(code2) { + return pathEnd(code2) ? ok2(code2) : nok(code2); + } +} +function tokenizePunctuation(effects, ok2, nok) { + return start; + function start(code2) { + effects.consume(code2); + return after; + } + function after(code2) { + if (trailingPunctuation(code2)) { + effects.consume(code2); + return after; + } + return pathEnd(code2) ? ok2(code2) : nok(code2); + } +} +function trailingPunctuation(code2) { + return code2 === 33 || code2 === 34 || code2 === 39 || code2 === 41 || code2 === 42 || code2 === 44 || code2 === 46 || code2 === 58 || code2 === 59 || code2 === 60 || code2 === 63 || code2 === 95 || code2 === 126; +} +function pathEnd(code2) { + return code2 === null || code2 === 60 || markdownLineEndingOrSpace(code2); +} +function gfmAtext(code2) { + return code2 === 43 || code2 === 45 || code2 === 46 || code2 === 95 || asciiAlphanumeric(code2); +} +function previousWww(code2) { + return code2 === null || code2 === 40 || code2 === 42 || code2 === 95 || code2 === 126 || markdownLineEndingOrSpace(code2); +} +function previousHttp(code2) { + return code2 === null || !asciiAlpha(code2); +} +function previousEmail(code2) { + return code2 !== 47 && previousHttp(code2); +} +function previousUnbalanced(events) { + let index = events.length; + let result = false; + while (index--) { + const token = events[index][1]; + if ((token.type === "labelLink" || token.type === "labelImage") && !token._balanced) { + result = true; + break; + } + if (token._gfmAutolinkLiteralWalkedInto) { + result = false; + break; + } + } + if (events.length > 0 && !result) { + events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true; + } + return result; +} + +// node_modules/micromark-util-classify-character/index.js +function classifyCharacter(code2) { + if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) { + return 1; + } + if (unicodePunctuation(code2)) { + return 2; + } +} + +// node_modules/micromark-util-resolve-all/index.js +function resolveAll(constructs2, events, context) { + const called = []; + let index = -1; + while (++index < constructs2.length) { + const resolve = constructs2[index].resolveAll; + if (resolve && !called.includes(resolve)) { + events = resolve(events, context); + called.push(resolve); + } + } + return events; +} + +// node_modules/micromark-factory-space/index.js +function factorySpace(effects, ok2, type, max) { + const limit = max ? max - 1 : Number.POSITIVE_INFINITY; + let size = 0; + return start; + function start(code2) { + if (markdownSpace(code2)) { + effects.enter(type); + return prefix(code2); + } + return ok2(code2); + } + function prefix(code2) { + if (markdownSpace(code2) && size++ < limit) { + effects.consume(code2); + return prefix; + } + effects.exit(type); + return ok2(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/blank-line.js +var blankLine = { + tokenize: tokenizeBlankLine, + partial: true +}; +function tokenizeBlankLine(effects, ok2, nok) { + return factorySpace(effects, afterWhitespace, "linePrefix"); + function afterWhitespace(code2) { + return code2 === null || markdownLineEnding(code2) ? ok2(code2) : nok(code2); + } +} + +// node_modules/character-entities/index.js +var characterEntities = { + AElig: "\xC6", + AMP: "&", + Aacute: "\xC1", + Abreve: "\u0102", + Acirc: "\xC2", + Acy: "\u0410", + Afr: "\u{1D504}", + Agrave: "\xC0", + Alpha: "\u0391", + Amacr: "\u0100", + And: "\u2A53", + Aogon: "\u0104", + Aopf: "\u{1D538}", + ApplyFunction: "\u2061", + Aring: "\xC5", + Ascr: "\u{1D49C}", + Assign: "\u2254", + Atilde: "\xC3", + Auml: "\xC4", + Backslash: "\u2216", + Barv: "\u2AE7", + Barwed: "\u2306", + Bcy: "\u0411", + Because: "\u2235", + Bernoullis: "\u212C", + Beta: "\u0392", + Bfr: "\u{1D505}", + Bopf: "\u{1D539}", + Breve: "\u02D8", + Bscr: "\u212C", + Bumpeq: "\u224E", + CHcy: "\u0427", + COPY: "\xA9", + Cacute: "\u0106", + Cap: "\u22D2", + CapitalDifferentialD: "\u2145", + Cayleys: "\u212D", + Ccaron: "\u010C", + Ccedil: "\xC7", + Ccirc: "\u0108", + Cconint: "\u2230", + Cdot: "\u010A", + Cedilla: "\xB8", + CenterDot: "\xB7", + Cfr: "\u212D", + Chi: "\u03A7", + CircleDot: "\u2299", + CircleMinus: "\u2296", + CirclePlus: "\u2295", + CircleTimes: "\u2297", + ClockwiseContourIntegral: "\u2232", + CloseCurlyDoubleQuote: "\u201D", + CloseCurlyQuote: "\u2019", + Colon: "\u2237", + Colone: "\u2A74", + Congruent: "\u2261", + Conint: "\u222F", + ContourIntegral: "\u222E", + Copf: "\u2102", + Coproduct: "\u2210", + CounterClockwiseContourIntegral: "\u2233", + Cross: "\u2A2F", + Cscr: "\u{1D49E}", + Cup: "\u22D3", + CupCap: "\u224D", + DD: "\u2145", + DDotrahd: "\u2911", + DJcy: "\u0402", + DScy: "\u0405", + DZcy: "\u040F", + Dagger: "\u2021", + Darr: "\u21A1", + Dashv: "\u2AE4", + Dcaron: "\u010E", + Dcy: "\u0414", + Del: "\u2207", + Delta: "\u0394", + Dfr: "\u{1D507}", + DiacriticalAcute: "\xB4", + DiacriticalDot: "\u02D9", + DiacriticalDoubleAcute: "\u02DD", + DiacriticalGrave: "`", + DiacriticalTilde: "\u02DC", + Diamond: "\u22C4", + DifferentialD: "\u2146", + Dopf: "\u{1D53B}", + Dot: "\xA8", + DotDot: "\u20DC", + DotEqual: "\u2250", + DoubleContourIntegral: "\u222F", + DoubleDot: "\xA8", + DoubleDownArrow: "\u21D3", + DoubleLeftArrow: "\u21D0", + DoubleLeftRightArrow: "\u21D4", + DoubleLeftTee: "\u2AE4", + DoubleLongLeftArrow: "\u27F8", + DoubleLongLeftRightArrow: "\u27FA", + DoubleLongRightArrow: "\u27F9", + DoubleRightArrow: "\u21D2", + DoubleRightTee: "\u22A8", + DoubleUpArrow: "\u21D1", + DoubleUpDownArrow: "\u21D5", + DoubleVerticalBar: "\u2225", + DownArrow: "\u2193", + DownArrowBar: "\u2913", + DownArrowUpArrow: "\u21F5", + DownBreve: "\u0311", + DownLeftRightVector: "\u2950", + DownLeftTeeVector: "\u295E", + DownLeftVector: "\u21BD", + DownLeftVectorBar: "\u2956", + DownRightTeeVector: "\u295F", + DownRightVector: "\u21C1", + DownRightVectorBar: "\u2957", + DownTee: "\u22A4", + DownTeeArrow: "\u21A7", + Downarrow: "\u21D3", + Dscr: "\u{1D49F}", + Dstrok: "\u0110", + ENG: "\u014A", + ETH: "\xD0", + Eacute: "\xC9", + Ecaron: "\u011A", + Ecirc: "\xCA", + Ecy: "\u042D", + Edot: "\u0116", + Efr: "\u{1D508}", + Egrave: "\xC8", + Element: "\u2208", + Emacr: "\u0112", + EmptySmallSquare: "\u25FB", + EmptyVerySmallSquare: "\u25AB", + Eogon: "\u0118", + Eopf: "\u{1D53C}", + Epsilon: "\u0395", + Equal: "\u2A75", + EqualTilde: "\u2242", + Equilibrium: "\u21CC", + Escr: "\u2130", + Esim: "\u2A73", + Eta: "\u0397", + Euml: "\xCB", + Exists: "\u2203", + ExponentialE: "\u2147", + Fcy: "\u0424", + Ffr: "\u{1D509}", + FilledSmallSquare: "\u25FC", + FilledVerySmallSquare: "\u25AA", + Fopf: "\u{1D53D}", + ForAll: "\u2200", + Fouriertrf: "\u2131", + Fscr: "\u2131", + GJcy: "\u0403", + GT: ">", + Gamma: "\u0393", + Gammad: "\u03DC", + Gbreve: "\u011E", + Gcedil: "\u0122", + Gcirc: "\u011C", + Gcy: "\u0413", + Gdot: "\u0120", + Gfr: "\u{1D50A}", + Gg: "\u22D9", + Gopf: "\u{1D53E}", + GreaterEqual: "\u2265", + GreaterEqualLess: "\u22DB", + GreaterFullEqual: "\u2267", + GreaterGreater: "\u2AA2", + GreaterLess: "\u2277", + GreaterSlantEqual: "\u2A7E", + GreaterTilde: "\u2273", + Gscr: "\u{1D4A2}", + Gt: "\u226B", + HARDcy: "\u042A", + Hacek: "\u02C7", + Hat: "^", + Hcirc: "\u0124", + Hfr: "\u210C", + HilbertSpace: "\u210B", + Hopf: "\u210D", + HorizontalLine: "\u2500", + Hscr: "\u210B", + Hstrok: "\u0126", + HumpDownHump: "\u224E", + HumpEqual: "\u224F", + IEcy: "\u0415", + IJlig: "\u0132", + IOcy: "\u0401", + Iacute: "\xCD", + Icirc: "\xCE", + Icy: "\u0418", + Idot: "\u0130", + Ifr: "\u2111", + Igrave: "\xCC", + Im: "\u2111", + Imacr: "\u012A", + ImaginaryI: "\u2148", + Implies: "\u21D2", + Int: "\u222C", + Integral: "\u222B", + Intersection: "\u22C2", + InvisibleComma: "\u2063", + InvisibleTimes: "\u2062", + Iogon: "\u012E", + Iopf: "\u{1D540}", + Iota: "\u0399", + Iscr: "\u2110", + Itilde: "\u0128", + Iukcy: "\u0406", + Iuml: "\xCF", + Jcirc: "\u0134", + Jcy: "\u0419", + Jfr: "\u{1D50D}", + Jopf: "\u{1D541}", + Jscr: "\u{1D4A5}", + Jsercy: "\u0408", + Jukcy: "\u0404", + KHcy: "\u0425", + KJcy: "\u040C", + Kappa: "\u039A", + Kcedil: "\u0136", + Kcy: "\u041A", + Kfr: "\u{1D50E}", + Kopf: "\u{1D542}", + Kscr: "\u{1D4A6}", + LJcy: "\u0409", + LT: "<", + Lacute: "\u0139", + Lambda: "\u039B", + Lang: "\u27EA", + Laplacetrf: "\u2112", + Larr: "\u219E", + Lcaron: "\u013D", + Lcedil: "\u013B", + Lcy: "\u041B", + LeftAngleBracket: "\u27E8", + LeftArrow: "\u2190", + LeftArrowBar: "\u21E4", + LeftArrowRightArrow: "\u21C6", + LeftCeiling: "\u2308", + LeftDoubleBracket: "\u27E6", + LeftDownTeeVector: "\u2961", + LeftDownVector: "\u21C3", + LeftDownVectorBar: "\u2959", + LeftFloor: "\u230A", + LeftRightArrow: "\u2194", + LeftRightVector: "\u294E", + LeftTee: "\u22A3", + LeftTeeArrow: "\u21A4", + LeftTeeVector: "\u295A", + LeftTriangle: "\u22B2", + LeftTriangleBar: "\u29CF", + LeftTriangleEqual: "\u22B4", + LeftUpDownVector: "\u2951", + LeftUpTeeVector: "\u2960", + LeftUpVector: "\u21BF", + LeftUpVectorBar: "\u2958", + LeftVector: "\u21BC", + LeftVectorBar: "\u2952", + Leftarrow: "\u21D0", + Leftrightarrow: "\u21D4", + LessEqualGreater: "\u22DA", + LessFullEqual: "\u2266", + LessGreater: "\u2276", + LessLess: "\u2AA1", + LessSlantEqual: "\u2A7D", + LessTilde: "\u2272", + Lfr: "\u{1D50F}", + Ll: "\u22D8", + Lleftarrow: "\u21DA", + Lmidot: "\u013F", + LongLeftArrow: "\u27F5", + LongLeftRightArrow: "\u27F7", + LongRightArrow: "\u27F6", + Longleftarrow: "\u27F8", + Longleftrightarrow: "\u27FA", + Longrightarrow: "\u27F9", + Lopf: "\u{1D543}", + LowerLeftArrow: "\u2199", + LowerRightArrow: "\u2198", + Lscr: "\u2112", + Lsh: "\u21B0", + Lstrok: "\u0141", + Lt: "\u226A", + Map: "\u2905", + Mcy: "\u041C", + MediumSpace: "\u205F", + Mellintrf: "\u2133", + Mfr: "\u{1D510}", + MinusPlus: "\u2213", + Mopf: "\u{1D544}", + Mscr: "\u2133", + Mu: "\u039C", + NJcy: "\u040A", + Nacute: "\u0143", + Ncaron: "\u0147", + Ncedil: "\u0145", + Ncy: "\u041D", + NegativeMediumSpace: "\u200B", + NegativeThickSpace: "\u200B", + NegativeThinSpace: "\u200B", + NegativeVeryThinSpace: "\u200B", + NestedGreaterGreater: "\u226B", + NestedLessLess: "\u226A", + NewLine: "\n", + Nfr: "\u{1D511}", + NoBreak: "\u2060", + NonBreakingSpace: "\xA0", + Nopf: "\u2115", + Not: "\u2AEC", + NotCongruent: "\u2262", + NotCupCap: "\u226D", + NotDoubleVerticalBar: "\u2226", + NotElement: "\u2209", + NotEqual: "\u2260", + NotEqualTilde: "\u2242\u0338", + NotExists: "\u2204", + NotGreater: "\u226F", + NotGreaterEqual: "\u2271", + NotGreaterFullEqual: "\u2267\u0338", + NotGreaterGreater: "\u226B\u0338", + NotGreaterLess: "\u2279", + NotGreaterSlantEqual: "\u2A7E\u0338", + NotGreaterTilde: "\u2275", + NotHumpDownHump: "\u224E\u0338", + NotHumpEqual: "\u224F\u0338", + NotLeftTriangle: "\u22EA", + NotLeftTriangleBar: "\u29CF\u0338", + NotLeftTriangleEqual: "\u22EC", + NotLess: "\u226E", + NotLessEqual: "\u2270", + NotLessGreater: "\u2278", + NotLessLess: "\u226A\u0338", + NotLessSlantEqual: "\u2A7D\u0338", + NotLessTilde: "\u2274", + NotNestedGreaterGreater: "\u2AA2\u0338", + NotNestedLessLess: "\u2AA1\u0338", + NotPrecedes: "\u2280", + NotPrecedesEqual: "\u2AAF\u0338", + NotPrecedesSlantEqual: "\u22E0", + NotReverseElement: "\u220C", + NotRightTriangle: "\u22EB", + NotRightTriangleBar: "\u29D0\u0338", + NotRightTriangleEqual: "\u22ED", + NotSquareSubset: "\u228F\u0338", + NotSquareSubsetEqual: "\u22E2", + NotSquareSuperset: "\u2290\u0338", + NotSquareSupersetEqual: "\u22E3", + NotSubset: "\u2282\u20D2", + NotSubsetEqual: "\u2288", + NotSucceeds: "\u2281", + NotSucceedsEqual: "\u2AB0\u0338", + NotSucceedsSlantEqual: "\u22E1", + NotSucceedsTilde: "\u227F\u0338", + NotSuperset: "\u2283\u20D2", + NotSupersetEqual: "\u2289", + NotTilde: "\u2241", + NotTildeEqual: "\u2244", + NotTildeFullEqual: "\u2247", + NotTildeTilde: "\u2249", + NotVerticalBar: "\u2224", + Nscr: "\u{1D4A9}", + Ntilde: "\xD1", + Nu: "\u039D", + OElig: "\u0152", + Oacute: "\xD3", + Ocirc: "\xD4", + Ocy: "\u041E", + Odblac: "\u0150", + Ofr: "\u{1D512}", + Ograve: "\xD2", + Omacr: "\u014C", + Omega: "\u03A9", + Omicron: "\u039F", + Oopf: "\u{1D546}", + OpenCurlyDoubleQuote: "\u201C", + OpenCurlyQuote: "\u2018", + Or: "\u2A54", + Oscr: "\u{1D4AA}", + Oslash: "\xD8", + Otilde: "\xD5", + Otimes: "\u2A37", + Ouml: "\xD6", + OverBar: "\u203E", + OverBrace: "\u23DE", + OverBracket: "\u23B4", + OverParenthesis: "\u23DC", + PartialD: "\u2202", + Pcy: "\u041F", + Pfr: "\u{1D513}", + Phi: "\u03A6", + Pi: "\u03A0", + PlusMinus: "\xB1", + Poincareplane: "\u210C", + Popf: "\u2119", + Pr: "\u2ABB", + Precedes: "\u227A", + PrecedesEqual: "\u2AAF", + PrecedesSlantEqual: "\u227C", + PrecedesTilde: "\u227E", + Prime: "\u2033", + Product: "\u220F", + Proportion: "\u2237", + Proportional: "\u221D", + Pscr: "\u{1D4AB}", + Psi: "\u03A8", + QUOT: '"', + Qfr: "\u{1D514}", + Qopf: "\u211A", + Qscr: "\u{1D4AC}", + RBarr: "\u2910", + REG: "\xAE", + Racute: "\u0154", + Rang: "\u27EB", + Rarr: "\u21A0", + Rarrtl: "\u2916", + Rcaron: "\u0158", + Rcedil: "\u0156", + Rcy: "\u0420", + Re: "\u211C", + ReverseElement: "\u220B", + ReverseEquilibrium: "\u21CB", + ReverseUpEquilibrium: "\u296F", + Rfr: "\u211C", + Rho: "\u03A1", + RightAngleBracket: "\u27E9", + RightArrow: "\u2192", + RightArrowBar: "\u21E5", + RightArrowLeftArrow: "\u21C4", + RightCeiling: "\u2309", + RightDoubleBracket: "\u27E7", + RightDownTeeVector: "\u295D", + RightDownVector: "\u21C2", + RightDownVectorBar: "\u2955", + RightFloor: "\u230B", + RightTee: "\u22A2", + RightTeeArrow: "\u21A6", + RightTeeVector: "\u295B", + RightTriangle: "\u22B3", + RightTriangleBar: "\u29D0", + RightTriangleEqual: "\u22B5", + RightUpDownVector: "\u294F", + RightUpTeeVector: "\u295C", + RightUpVector: "\u21BE", + RightUpVectorBar: "\u2954", + RightVector: "\u21C0", + RightVectorBar: "\u2953", + Rightarrow: "\u21D2", + Ropf: "\u211D", + RoundImplies: "\u2970", + Rrightarrow: "\u21DB", + Rscr: "\u211B", + Rsh: "\u21B1", + RuleDelayed: "\u29F4", + SHCHcy: "\u0429", + SHcy: "\u0428", + SOFTcy: "\u042C", + Sacute: "\u015A", + Sc: "\u2ABC", + Scaron: "\u0160", + Scedil: "\u015E", + Scirc: "\u015C", + Scy: "\u0421", + Sfr: "\u{1D516}", + ShortDownArrow: "\u2193", + ShortLeftArrow: "\u2190", + ShortRightArrow: "\u2192", + ShortUpArrow: "\u2191", + Sigma: "\u03A3", + SmallCircle: "\u2218", + Sopf: "\u{1D54A}", + Sqrt: "\u221A", + Square: "\u25A1", + SquareIntersection: "\u2293", + SquareSubset: "\u228F", + SquareSubsetEqual: "\u2291", + SquareSuperset: "\u2290", + SquareSupersetEqual: "\u2292", + SquareUnion: "\u2294", + Sscr: "\u{1D4AE}", + Star: "\u22C6", + Sub: "\u22D0", + Subset: "\u22D0", + SubsetEqual: "\u2286", + Succeeds: "\u227B", + SucceedsEqual: "\u2AB0", + SucceedsSlantEqual: "\u227D", + SucceedsTilde: "\u227F", + SuchThat: "\u220B", + Sum: "\u2211", + Sup: "\u22D1", + Superset: "\u2283", + SupersetEqual: "\u2287", + Supset: "\u22D1", + THORN: "\xDE", + TRADE: "\u2122", + TSHcy: "\u040B", + TScy: "\u0426", + Tab: " ", + Tau: "\u03A4", + Tcaron: "\u0164", + Tcedil: "\u0162", + Tcy: "\u0422", + Tfr: "\u{1D517}", + Therefore: "\u2234", + Theta: "\u0398", + ThickSpace: "\u205F\u200A", + ThinSpace: "\u2009", + Tilde: "\u223C", + TildeEqual: "\u2243", + TildeFullEqual: "\u2245", + TildeTilde: "\u2248", + Topf: "\u{1D54B}", + TripleDot: "\u20DB", + Tscr: "\u{1D4AF}", + Tstrok: "\u0166", + Uacute: "\xDA", + Uarr: "\u219F", + Uarrocir: "\u2949", + Ubrcy: "\u040E", + Ubreve: "\u016C", + Ucirc: "\xDB", + Ucy: "\u0423", + Udblac: "\u0170", + Ufr: "\u{1D518}", + Ugrave: "\xD9", + Umacr: "\u016A", + UnderBar: "_", + UnderBrace: "\u23DF", + UnderBracket: "\u23B5", + UnderParenthesis: "\u23DD", + Union: "\u22C3", + UnionPlus: "\u228E", + Uogon: "\u0172", + Uopf: "\u{1D54C}", + UpArrow: "\u2191", + UpArrowBar: "\u2912", + UpArrowDownArrow: "\u21C5", + UpDownArrow: "\u2195", + UpEquilibrium: "\u296E", + UpTee: "\u22A5", + UpTeeArrow: "\u21A5", + Uparrow: "\u21D1", + Updownarrow: "\u21D5", + UpperLeftArrow: "\u2196", + UpperRightArrow: "\u2197", + Upsi: "\u03D2", + Upsilon: "\u03A5", + Uring: "\u016E", + Uscr: "\u{1D4B0}", + Utilde: "\u0168", + Uuml: "\xDC", + VDash: "\u22AB", + Vbar: "\u2AEB", + Vcy: "\u0412", + Vdash: "\u22A9", + Vdashl: "\u2AE6", + Vee: "\u22C1", + Verbar: "\u2016", + Vert: "\u2016", + VerticalBar: "\u2223", + VerticalLine: "|", + VerticalSeparator: "\u2758", + VerticalTilde: "\u2240", + VeryThinSpace: "\u200A", + Vfr: "\u{1D519}", + Vopf: "\u{1D54D}", + Vscr: "\u{1D4B1}", + Vvdash: "\u22AA", + Wcirc: "\u0174", + Wedge: "\u22C0", + Wfr: "\u{1D51A}", + Wopf: "\u{1D54E}", + Wscr: "\u{1D4B2}", + Xfr: "\u{1D51B}", + Xi: "\u039E", + Xopf: "\u{1D54F}", + Xscr: "\u{1D4B3}", + YAcy: "\u042F", + YIcy: "\u0407", + YUcy: "\u042E", + Yacute: "\xDD", + Ycirc: "\u0176", + Ycy: "\u042B", + Yfr: "\u{1D51C}", + Yopf: "\u{1D550}", + Yscr: "\u{1D4B4}", + Yuml: "\u0178", + ZHcy: "\u0416", + Zacute: "\u0179", + Zcaron: "\u017D", + Zcy: "\u0417", + Zdot: "\u017B", + ZeroWidthSpace: "\u200B", + Zeta: "\u0396", + Zfr: "\u2128", + Zopf: "\u2124", + Zscr: "\u{1D4B5}", + aacute: "\xE1", + abreve: "\u0103", + ac: "\u223E", + acE: "\u223E\u0333", + acd: "\u223F", + acirc: "\xE2", + acute: "\xB4", + acy: "\u0430", + aelig: "\xE6", + af: "\u2061", + afr: "\u{1D51E}", + agrave: "\xE0", + alefsym: "\u2135", + aleph: "\u2135", + alpha: "\u03B1", + amacr: "\u0101", + amalg: "\u2A3F", + amp: "&", + and: "\u2227", + andand: "\u2A55", + andd: "\u2A5C", + andslope: "\u2A58", + andv: "\u2A5A", + ang: "\u2220", + ange: "\u29A4", + angle: "\u2220", + angmsd: "\u2221", + angmsdaa: "\u29A8", + angmsdab: "\u29A9", + angmsdac: "\u29AA", + angmsdad: "\u29AB", + angmsdae: "\u29AC", + angmsdaf: "\u29AD", + angmsdag: "\u29AE", + angmsdah: "\u29AF", + angrt: "\u221F", + angrtvb: "\u22BE", + angrtvbd: "\u299D", + angsph: "\u2222", + angst: "\xC5", + angzarr: "\u237C", + aogon: "\u0105", + aopf: "\u{1D552}", + ap: "\u2248", + apE: "\u2A70", + apacir: "\u2A6F", + ape: "\u224A", + apid: "\u224B", + apos: "'", + approx: "\u2248", + approxeq: "\u224A", + aring: "\xE5", + ascr: "\u{1D4B6}", + ast: "*", + asymp: "\u2248", + asympeq: "\u224D", + atilde: "\xE3", + auml: "\xE4", + awconint: "\u2233", + awint: "\u2A11", + bNot: "\u2AED", + backcong: "\u224C", + backepsilon: "\u03F6", + backprime: "\u2035", + backsim: "\u223D", + backsimeq: "\u22CD", + barvee: "\u22BD", + barwed: "\u2305", + barwedge: "\u2305", + bbrk: "\u23B5", + bbrktbrk: "\u23B6", + bcong: "\u224C", + bcy: "\u0431", + bdquo: "\u201E", + becaus: "\u2235", + because: "\u2235", + bemptyv: "\u29B0", + bepsi: "\u03F6", + bernou: "\u212C", + beta: "\u03B2", + beth: "\u2136", + between: "\u226C", + bfr: "\u{1D51F}", + bigcap: "\u22C2", + bigcirc: "\u25EF", + bigcup: "\u22C3", + bigodot: "\u2A00", + bigoplus: "\u2A01", + bigotimes: "\u2A02", + bigsqcup: "\u2A06", + bigstar: "\u2605", + bigtriangledown: "\u25BD", + bigtriangleup: "\u25B3", + biguplus: "\u2A04", + bigvee: "\u22C1", + bigwedge: "\u22C0", + bkarow: "\u290D", + blacklozenge: "\u29EB", + blacksquare: "\u25AA", + blacktriangle: "\u25B4", + blacktriangledown: "\u25BE", + blacktriangleleft: "\u25C2", + blacktriangleright: "\u25B8", + blank: "\u2423", + blk12: "\u2592", + blk14: "\u2591", + blk34: "\u2593", + block: "\u2588", + bne: "=\u20E5", + bnequiv: "\u2261\u20E5", + bnot: "\u2310", + bopf: "\u{1D553}", + bot: "\u22A5", + bottom: "\u22A5", + bowtie: "\u22C8", + boxDL: "\u2557", + boxDR: "\u2554", + boxDl: "\u2556", + boxDr: "\u2553", + boxH: "\u2550", + boxHD: "\u2566", + boxHU: "\u2569", + boxHd: "\u2564", + boxHu: "\u2567", + boxUL: "\u255D", + boxUR: "\u255A", + boxUl: "\u255C", + boxUr: "\u2559", + boxV: "\u2551", + boxVH: "\u256C", + boxVL: "\u2563", + boxVR: "\u2560", + boxVh: "\u256B", + boxVl: "\u2562", + boxVr: "\u255F", + boxbox: "\u29C9", + boxdL: "\u2555", + boxdR: "\u2552", + boxdl: "\u2510", + boxdr: "\u250C", + boxh: "\u2500", + boxhD: "\u2565", + boxhU: "\u2568", + boxhd: "\u252C", + boxhu: "\u2534", + boxminus: "\u229F", + boxplus: "\u229E", + boxtimes: "\u22A0", + boxuL: "\u255B", + boxuR: "\u2558", + boxul: "\u2518", + boxur: "\u2514", + boxv: "\u2502", + boxvH: "\u256A", + boxvL: "\u2561", + boxvR: "\u255E", + boxvh: "\u253C", + boxvl: "\u2524", + boxvr: "\u251C", + bprime: "\u2035", + breve: "\u02D8", + brvbar: "\xA6", + bscr: "\u{1D4B7}", + bsemi: "\u204F", + bsim: "\u223D", + bsime: "\u22CD", + bsol: "\\", + bsolb: "\u29C5", + bsolhsub: "\u27C8", + bull: "\u2022", + bullet: "\u2022", + bump: "\u224E", + bumpE: "\u2AAE", + bumpe: "\u224F", + bumpeq: "\u224F", + cacute: "\u0107", + cap: "\u2229", + capand: "\u2A44", + capbrcup: "\u2A49", + capcap: "\u2A4B", + capcup: "\u2A47", + capdot: "\u2A40", + caps: "\u2229\uFE00", + caret: "\u2041", + caron: "\u02C7", + ccaps: "\u2A4D", + ccaron: "\u010D", + ccedil: "\xE7", + ccirc: "\u0109", + ccups: "\u2A4C", + ccupssm: "\u2A50", + cdot: "\u010B", + cedil: "\xB8", + cemptyv: "\u29B2", + cent: "\xA2", + centerdot: "\xB7", + cfr: "\u{1D520}", + chcy: "\u0447", + check: "\u2713", + checkmark: "\u2713", + chi: "\u03C7", + cir: "\u25CB", + cirE: "\u29C3", + circ: "\u02C6", + circeq: "\u2257", + circlearrowleft: "\u21BA", + circlearrowright: "\u21BB", + circledR: "\xAE", + circledS: "\u24C8", + circledast: "\u229B", + circledcirc: "\u229A", + circleddash: "\u229D", + cire: "\u2257", + cirfnint: "\u2A10", + cirmid: "\u2AEF", + cirscir: "\u29C2", + clubs: "\u2663", + clubsuit: "\u2663", + colon: ":", + colone: "\u2254", + coloneq: "\u2254", + comma: ",", + commat: "@", + comp: "\u2201", + compfn: "\u2218", + complement: "\u2201", + complexes: "\u2102", + cong: "\u2245", + congdot: "\u2A6D", + conint: "\u222E", + copf: "\u{1D554}", + coprod: "\u2210", + copy: "\xA9", + copysr: "\u2117", + crarr: "\u21B5", + cross: "\u2717", + cscr: "\u{1D4B8}", + csub: "\u2ACF", + csube: "\u2AD1", + csup: "\u2AD0", + csupe: "\u2AD2", + ctdot: "\u22EF", + cudarrl: "\u2938", + cudarrr: "\u2935", + cuepr: "\u22DE", + cuesc: "\u22DF", + cularr: "\u21B6", + cularrp: "\u293D", + cup: "\u222A", + cupbrcap: "\u2A48", + cupcap: "\u2A46", + cupcup: "\u2A4A", + cupdot: "\u228D", + cupor: "\u2A45", + cups: "\u222A\uFE00", + curarr: "\u21B7", + curarrm: "\u293C", + curlyeqprec: "\u22DE", + curlyeqsucc: "\u22DF", + curlyvee: "\u22CE", + curlywedge: "\u22CF", + curren: "\xA4", + curvearrowleft: "\u21B6", + curvearrowright: "\u21B7", + cuvee: "\u22CE", + cuwed: "\u22CF", + cwconint: "\u2232", + cwint: "\u2231", + cylcty: "\u232D", + dArr: "\u21D3", + dHar: "\u2965", + dagger: "\u2020", + daleth: "\u2138", + darr: "\u2193", + dash: "\u2010", + dashv: "\u22A3", + dbkarow: "\u290F", + dblac: "\u02DD", + dcaron: "\u010F", + dcy: "\u0434", + dd: "\u2146", + ddagger: "\u2021", + ddarr: "\u21CA", + ddotseq: "\u2A77", + deg: "\xB0", + delta: "\u03B4", + demptyv: "\u29B1", + dfisht: "\u297F", + dfr: "\u{1D521}", + dharl: "\u21C3", + dharr: "\u21C2", + diam: "\u22C4", + diamond: "\u22C4", + diamondsuit: "\u2666", + diams: "\u2666", + die: "\xA8", + digamma: "\u03DD", + disin: "\u22F2", + div: "\xF7", + divide: "\xF7", + divideontimes: "\u22C7", + divonx: "\u22C7", + djcy: "\u0452", + dlcorn: "\u231E", + dlcrop: "\u230D", + dollar: "$", + dopf: "\u{1D555}", + dot: "\u02D9", + doteq: "\u2250", + doteqdot: "\u2251", + dotminus: "\u2238", + dotplus: "\u2214", + dotsquare: "\u22A1", + doublebarwedge: "\u2306", + downarrow: "\u2193", + downdownarrows: "\u21CA", + downharpoonleft: "\u21C3", + downharpoonright: "\u21C2", + drbkarow: "\u2910", + drcorn: "\u231F", + drcrop: "\u230C", + dscr: "\u{1D4B9}", + dscy: "\u0455", + dsol: "\u29F6", + dstrok: "\u0111", + dtdot: "\u22F1", + dtri: "\u25BF", + dtrif: "\u25BE", + duarr: "\u21F5", + duhar: "\u296F", + dwangle: "\u29A6", + dzcy: "\u045F", + dzigrarr: "\u27FF", + eDDot: "\u2A77", + eDot: "\u2251", + eacute: "\xE9", + easter: "\u2A6E", + ecaron: "\u011B", + ecir: "\u2256", + ecirc: "\xEA", + ecolon: "\u2255", + ecy: "\u044D", + edot: "\u0117", + ee: "\u2147", + efDot: "\u2252", + efr: "\u{1D522}", + eg: "\u2A9A", + egrave: "\xE8", + egs: "\u2A96", + egsdot: "\u2A98", + el: "\u2A99", + elinters: "\u23E7", + ell: "\u2113", + els: "\u2A95", + elsdot: "\u2A97", + emacr: "\u0113", + empty: "\u2205", + emptyset: "\u2205", + emptyv: "\u2205", + emsp13: "\u2004", + emsp14: "\u2005", + emsp: "\u2003", + eng: "\u014B", + ensp: "\u2002", + eogon: "\u0119", + eopf: "\u{1D556}", + epar: "\u22D5", + eparsl: "\u29E3", + eplus: "\u2A71", + epsi: "\u03B5", + epsilon: "\u03B5", + epsiv: "\u03F5", + eqcirc: "\u2256", + eqcolon: "\u2255", + eqsim: "\u2242", + eqslantgtr: "\u2A96", + eqslantless: "\u2A95", + equals: "=", + equest: "\u225F", + equiv: "\u2261", + equivDD: "\u2A78", + eqvparsl: "\u29E5", + erDot: "\u2253", + erarr: "\u2971", + escr: "\u212F", + esdot: "\u2250", + esim: "\u2242", + eta: "\u03B7", + eth: "\xF0", + euml: "\xEB", + euro: "\u20AC", + excl: "!", + exist: "\u2203", + expectation: "\u2130", + exponentiale: "\u2147", + fallingdotseq: "\u2252", + fcy: "\u0444", + female: "\u2640", + ffilig: "\uFB03", + fflig: "\uFB00", + ffllig: "\uFB04", + ffr: "\u{1D523}", + filig: "\uFB01", + fjlig: "fj", + flat: "\u266D", + fllig: "\uFB02", + fltns: "\u25B1", + fnof: "\u0192", + fopf: "\u{1D557}", + forall: "\u2200", + fork: "\u22D4", + forkv: "\u2AD9", + fpartint: "\u2A0D", + frac12: "\xBD", + frac13: "\u2153", + frac14: "\xBC", + frac15: "\u2155", + frac16: "\u2159", + frac18: "\u215B", + frac23: "\u2154", + frac25: "\u2156", + frac34: "\xBE", + frac35: "\u2157", + frac38: "\u215C", + frac45: "\u2158", + frac56: "\u215A", + frac58: "\u215D", + frac78: "\u215E", + frasl: "\u2044", + frown: "\u2322", + fscr: "\u{1D4BB}", + gE: "\u2267", + gEl: "\u2A8C", + gacute: "\u01F5", + gamma: "\u03B3", + gammad: "\u03DD", + gap: "\u2A86", + gbreve: "\u011F", + gcirc: "\u011D", + gcy: "\u0433", + gdot: "\u0121", + ge: "\u2265", + gel: "\u22DB", + geq: "\u2265", + geqq: "\u2267", + geqslant: "\u2A7E", + ges: "\u2A7E", + gescc: "\u2AA9", + gesdot: "\u2A80", + gesdoto: "\u2A82", + gesdotol: "\u2A84", + gesl: "\u22DB\uFE00", + gesles: "\u2A94", + gfr: "\u{1D524}", + gg: "\u226B", + ggg: "\u22D9", + gimel: "\u2137", + gjcy: "\u0453", + gl: "\u2277", + glE: "\u2A92", + gla: "\u2AA5", + glj: "\u2AA4", + gnE: "\u2269", + gnap: "\u2A8A", + gnapprox: "\u2A8A", + gne: "\u2A88", + gneq: "\u2A88", + gneqq: "\u2269", + gnsim: "\u22E7", + gopf: "\u{1D558}", + grave: "`", + gscr: "\u210A", + gsim: "\u2273", + gsime: "\u2A8E", + gsiml: "\u2A90", + gt: ">", + gtcc: "\u2AA7", + gtcir: "\u2A7A", + gtdot: "\u22D7", + gtlPar: "\u2995", + gtquest: "\u2A7C", + gtrapprox: "\u2A86", + gtrarr: "\u2978", + gtrdot: "\u22D7", + gtreqless: "\u22DB", + gtreqqless: "\u2A8C", + gtrless: "\u2277", + gtrsim: "\u2273", + gvertneqq: "\u2269\uFE00", + gvnE: "\u2269\uFE00", + hArr: "\u21D4", + hairsp: "\u200A", + half: "\xBD", + hamilt: "\u210B", + hardcy: "\u044A", + harr: "\u2194", + harrcir: "\u2948", + harrw: "\u21AD", + hbar: "\u210F", + hcirc: "\u0125", + hearts: "\u2665", + heartsuit: "\u2665", + hellip: "\u2026", + hercon: "\u22B9", + hfr: "\u{1D525}", + hksearow: "\u2925", + hkswarow: "\u2926", + hoarr: "\u21FF", + homtht: "\u223B", + hookleftarrow: "\u21A9", + hookrightarrow: "\u21AA", + hopf: "\u{1D559}", + horbar: "\u2015", + hscr: "\u{1D4BD}", + hslash: "\u210F", + hstrok: "\u0127", + hybull: "\u2043", + hyphen: "\u2010", + iacute: "\xED", + ic: "\u2063", + icirc: "\xEE", + icy: "\u0438", + iecy: "\u0435", + iexcl: "\xA1", + iff: "\u21D4", + ifr: "\u{1D526}", + igrave: "\xEC", + ii: "\u2148", + iiiint: "\u2A0C", + iiint: "\u222D", + iinfin: "\u29DC", + iiota: "\u2129", + ijlig: "\u0133", + imacr: "\u012B", + image: "\u2111", + imagline: "\u2110", + imagpart: "\u2111", + imath: "\u0131", + imof: "\u22B7", + imped: "\u01B5", + in: "\u2208", + incare: "\u2105", + infin: "\u221E", + infintie: "\u29DD", + inodot: "\u0131", + int: "\u222B", + intcal: "\u22BA", + integers: "\u2124", + intercal: "\u22BA", + intlarhk: "\u2A17", + intprod: "\u2A3C", + iocy: "\u0451", + iogon: "\u012F", + iopf: "\u{1D55A}", + iota: "\u03B9", + iprod: "\u2A3C", + iquest: "\xBF", + iscr: "\u{1D4BE}", + isin: "\u2208", + isinE: "\u22F9", + isindot: "\u22F5", + isins: "\u22F4", + isinsv: "\u22F3", + isinv: "\u2208", + it: "\u2062", + itilde: "\u0129", + iukcy: "\u0456", + iuml: "\xEF", + jcirc: "\u0135", + jcy: "\u0439", + jfr: "\u{1D527}", + jmath: "\u0237", + jopf: "\u{1D55B}", + jscr: "\u{1D4BF}", + jsercy: "\u0458", + jukcy: "\u0454", + kappa: "\u03BA", + kappav: "\u03F0", + kcedil: "\u0137", + kcy: "\u043A", + kfr: "\u{1D528}", + kgreen: "\u0138", + khcy: "\u0445", + kjcy: "\u045C", + kopf: "\u{1D55C}", + kscr: "\u{1D4C0}", + lAarr: "\u21DA", + lArr: "\u21D0", + lAtail: "\u291B", + lBarr: "\u290E", + lE: "\u2266", + lEg: "\u2A8B", + lHar: "\u2962", + lacute: "\u013A", + laemptyv: "\u29B4", + lagran: "\u2112", + lambda: "\u03BB", + lang: "\u27E8", + langd: "\u2991", + langle: "\u27E8", + lap: "\u2A85", + laquo: "\xAB", + larr: "\u2190", + larrb: "\u21E4", + larrbfs: "\u291F", + larrfs: "\u291D", + larrhk: "\u21A9", + larrlp: "\u21AB", + larrpl: "\u2939", + larrsim: "\u2973", + larrtl: "\u21A2", + lat: "\u2AAB", + latail: "\u2919", + late: "\u2AAD", + lates: "\u2AAD\uFE00", + lbarr: "\u290C", + lbbrk: "\u2772", + lbrace: "{", + lbrack: "[", + lbrke: "\u298B", + lbrksld: "\u298F", + lbrkslu: "\u298D", + lcaron: "\u013E", + lcedil: "\u013C", + lceil: "\u2308", + lcub: "{", + lcy: "\u043B", + ldca: "\u2936", + ldquo: "\u201C", + ldquor: "\u201E", + ldrdhar: "\u2967", + ldrushar: "\u294B", + ldsh: "\u21B2", + le: "\u2264", + leftarrow: "\u2190", + leftarrowtail: "\u21A2", + leftharpoondown: "\u21BD", + leftharpoonup: "\u21BC", + leftleftarrows: "\u21C7", + leftrightarrow: "\u2194", + leftrightarrows: "\u21C6", + leftrightharpoons: "\u21CB", + leftrightsquigarrow: "\u21AD", + leftthreetimes: "\u22CB", + leg: "\u22DA", + leq: "\u2264", + leqq: "\u2266", + leqslant: "\u2A7D", + les: "\u2A7D", + lescc: "\u2AA8", + lesdot: "\u2A7F", + lesdoto: "\u2A81", + lesdotor: "\u2A83", + lesg: "\u22DA\uFE00", + lesges: "\u2A93", + lessapprox: "\u2A85", + lessdot: "\u22D6", + lesseqgtr: "\u22DA", + lesseqqgtr: "\u2A8B", + lessgtr: "\u2276", + lesssim: "\u2272", + lfisht: "\u297C", + lfloor: "\u230A", + lfr: "\u{1D529}", + lg: "\u2276", + lgE: "\u2A91", + lhard: "\u21BD", + lharu: "\u21BC", + lharul: "\u296A", + lhblk: "\u2584", + ljcy: "\u0459", + ll: "\u226A", + llarr: "\u21C7", + llcorner: "\u231E", + llhard: "\u296B", + lltri: "\u25FA", + lmidot: "\u0140", + lmoust: "\u23B0", + lmoustache: "\u23B0", + lnE: "\u2268", + lnap: "\u2A89", + lnapprox: "\u2A89", + lne: "\u2A87", + lneq: "\u2A87", + lneqq: "\u2268", + lnsim: "\u22E6", + loang: "\u27EC", + loarr: "\u21FD", + lobrk: "\u27E6", + longleftarrow: "\u27F5", + longleftrightarrow: "\u27F7", + longmapsto: "\u27FC", + longrightarrow: "\u27F6", + looparrowleft: "\u21AB", + looparrowright: "\u21AC", + lopar: "\u2985", + lopf: "\u{1D55D}", + loplus: "\u2A2D", + lotimes: "\u2A34", + lowast: "\u2217", + lowbar: "_", + loz: "\u25CA", + lozenge: "\u25CA", + lozf: "\u29EB", + lpar: "(", + lparlt: "\u2993", + lrarr: "\u21C6", + lrcorner: "\u231F", + lrhar: "\u21CB", + lrhard: "\u296D", + lrm: "\u200E", + lrtri: "\u22BF", + lsaquo: "\u2039", + lscr: "\u{1D4C1}", + lsh: "\u21B0", + lsim: "\u2272", + lsime: "\u2A8D", + lsimg: "\u2A8F", + lsqb: "[", + lsquo: "\u2018", + lsquor: "\u201A", + lstrok: "\u0142", + lt: "<", + ltcc: "\u2AA6", + ltcir: "\u2A79", + ltdot: "\u22D6", + lthree: "\u22CB", + ltimes: "\u22C9", + ltlarr: "\u2976", + ltquest: "\u2A7B", + ltrPar: "\u2996", + ltri: "\u25C3", + ltrie: "\u22B4", + ltrif: "\u25C2", + lurdshar: "\u294A", + luruhar: "\u2966", + lvertneqq: "\u2268\uFE00", + lvnE: "\u2268\uFE00", + mDDot: "\u223A", + macr: "\xAF", + male: "\u2642", + malt: "\u2720", + maltese: "\u2720", + map: "\u21A6", + mapsto: "\u21A6", + mapstodown: "\u21A7", + mapstoleft: "\u21A4", + mapstoup: "\u21A5", + marker: "\u25AE", + mcomma: "\u2A29", + mcy: "\u043C", + mdash: "\u2014", + measuredangle: "\u2221", + mfr: "\u{1D52A}", + mho: "\u2127", + micro: "\xB5", + mid: "\u2223", + midast: "*", + midcir: "\u2AF0", + middot: "\xB7", + minus: "\u2212", + minusb: "\u229F", + minusd: "\u2238", + minusdu: "\u2A2A", + mlcp: "\u2ADB", + mldr: "\u2026", + mnplus: "\u2213", + models: "\u22A7", + mopf: "\u{1D55E}", + mp: "\u2213", + mscr: "\u{1D4C2}", + mstpos: "\u223E", + mu: "\u03BC", + multimap: "\u22B8", + mumap: "\u22B8", + nGg: "\u22D9\u0338", + nGt: "\u226B\u20D2", + nGtv: "\u226B\u0338", + nLeftarrow: "\u21CD", + nLeftrightarrow: "\u21CE", + nLl: "\u22D8\u0338", + nLt: "\u226A\u20D2", + nLtv: "\u226A\u0338", + nRightarrow: "\u21CF", + nVDash: "\u22AF", + nVdash: "\u22AE", + nabla: "\u2207", + nacute: "\u0144", + nang: "\u2220\u20D2", + nap: "\u2249", + napE: "\u2A70\u0338", + napid: "\u224B\u0338", + napos: "\u0149", + napprox: "\u2249", + natur: "\u266E", + natural: "\u266E", + naturals: "\u2115", + nbsp: "\xA0", + nbump: "\u224E\u0338", + nbumpe: "\u224F\u0338", + ncap: "\u2A43", + ncaron: "\u0148", + ncedil: "\u0146", + ncong: "\u2247", + ncongdot: "\u2A6D\u0338", + ncup: "\u2A42", + ncy: "\u043D", + ndash: "\u2013", + ne: "\u2260", + neArr: "\u21D7", + nearhk: "\u2924", + nearr: "\u2197", + nearrow: "\u2197", + nedot: "\u2250\u0338", + nequiv: "\u2262", + nesear: "\u2928", + nesim: "\u2242\u0338", + nexist: "\u2204", + nexists: "\u2204", + nfr: "\u{1D52B}", + ngE: "\u2267\u0338", + nge: "\u2271", + ngeq: "\u2271", + ngeqq: "\u2267\u0338", + ngeqslant: "\u2A7E\u0338", + nges: "\u2A7E\u0338", + ngsim: "\u2275", + ngt: "\u226F", + ngtr: "\u226F", + nhArr: "\u21CE", + nharr: "\u21AE", + nhpar: "\u2AF2", + ni: "\u220B", + nis: "\u22FC", + nisd: "\u22FA", + niv: "\u220B", + njcy: "\u045A", + nlArr: "\u21CD", + nlE: "\u2266\u0338", + nlarr: "\u219A", + nldr: "\u2025", + nle: "\u2270", + nleftarrow: "\u219A", + nleftrightarrow: "\u21AE", + nleq: "\u2270", + nleqq: "\u2266\u0338", + nleqslant: "\u2A7D\u0338", + nles: "\u2A7D\u0338", + nless: "\u226E", + nlsim: "\u2274", + nlt: "\u226E", + nltri: "\u22EA", + nltrie: "\u22EC", + nmid: "\u2224", + nopf: "\u{1D55F}", + not: "\xAC", + notin: "\u2209", + notinE: "\u22F9\u0338", + notindot: "\u22F5\u0338", + notinva: "\u2209", + notinvb: "\u22F7", + notinvc: "\u22F6", + notni: "\u220C", + notniva: "\u220C", + notnivb: "\u22FE", + notnivc: "\u22FD", + npar: "\u2226", + nparallel: "\u2226", + nparsl: "\u2AFD\u20E5", + npart: "\u2202\u0338", + npolint: "\u2A14", + npr: "\u2280", + nprcue: "\u22E0", + npre: "\u2AAF\u0338", + nprec: "\u2280", + npreceq: "\u2AAF\u0338", + nrArr: "\u21CF", + nrarr: "\u219B", + nrarrc: "\u2933\u0338", + nrarrw: "\u219D\u0338", + nrightarrow: "\u219B", + nrtri: "\u22EB", + nrtrie: "\u22ED", + nsc: "\u2281", + nsccue: "\u22E1", + nsce: "\u2AB0\u0338", + nscr: "\u{1D4C3}", + nshortmid: "\u2224", + nshortparallel: "\u2226", + nsim: "\u2241", + nsime: "\u2244", + nsimeq: "\u2244", + nsmid: "\u2224", + nspar: "\u2226", + nsqsube: "\u22E2", + nsqsupe: "\u22E3", + nsub: "\u2284", + nsubE: "\u2AC5\u0338", + nsube: "\u2288", + nsubset: "\u2282\u20D2", + nsubseteq: "\u2288", + nsubseteqq: "\u2AC5\u0338", + nsucc: "\u2281", + nsucceq: "\u2AB0\u0338", + nsup: "\u2285", + nsupE: "\u2AC6\u0338", + nsupe: "\u2289", + nsupset: "\u2283\u20D2", + nsupseteq: "\u2289", + nsupseteqq: "\u2AC6\u0338", + ntgl: "\u2279", + ntilde: "\xF1", + ntlg: "\u2278", + ntriangleleft: "\u22EA", + ntrianglelefteq: "\u22EC", + ntriangleright: "\u22EB", + ntrianglerighteq: "\u22ED", + nu: "\u03BD", + num: "#", + numero: "\u2116", + numsp: "\u2007", + nvDash: "\u22AD", + nvHarr: "\u2904", + nvap: "\u224D\u20D2", + nvdash: "\u22AC", + nvge: "\u2265\u20D2", + nvgt: ">\u20D2", + nvinfin: "\u29DE", + nvlArr: "\u2902", + nvle: "\u2264\u20D2", + nvlt: "<\u20D2", + nvltrie: "\u22B4\u20D2", + nvrArr: "\u2903", + nvrtrie: "\u22B5\u20D2", + nvsim: "\u223C\u20D2", + nwArr: "\u21D6", + nwarhk: "\u2923", + nwarr: "\u2196", + nwarrow: "\u2196", + nwnear: "\u2927", + oS: "\u24C8", + oacute: "\xF3", + oast: "\u229B", + ocir: "\u229A", + ocirc: "\xF4", + ocy: "\u043E", + odash: "\u229D", + odblac: "\u0151", + odiv: "\u2A38", + odot: "\u2299", + odsold: "\u29BC", + oelig: "\u0153", + ofcir: "\u29BF", + ofr: "\u{1D52C}", + ogon: "\u02DB", + ograve: "\xF2", + ogt: "\u29C1", + ohbar: "\u29B5", + ohm: "\u03A9", + oint: "\u222E", + olarr: "\u21BA", + olcir: "\u29BE", + olcross: "\u29BB", + oline: "\u203E", + olt: "\u29C0", + omacr: "\u014D", + omega: "\u03C9", + omicron: "\u03BF", + omid: "\u29B6", + ominus: "\u2296", + oopf: "\u{1D560}", + opar: "\u29B7", + operp: "\u29B9", + oplus: "\u2295", + or: "\u2228", + orarr: "\u21BB", + ord: "\u2A5D", + order: "\u2134", + orderof: "\u2134", + ordf: "\xAA", + ordm: "\xBA", + origof: "\u22B6", + oror: "\u2A56", + orslope: "\u2A57", + orv: "\u2A5B", + oscr: "\u2134", + oslash: "\xF8", + osol: "\u2298", + otilde: "\xF5", + otimes: "\u2297", + otimesas: "\u2A36", + ouml: "\xF6", + ovbar: "\u233D", + par: "\u2225", + para: "\xB6", + parallel: "\u2225", + parsim: "\u2AF3", + parsl: "\u2AFD", + part: "\u2202", + pcy: "\u043F", + percnt: "%", + period: ".", + permil: "\u2030", + perp: "\u22A5", + pertenk: "\u2031", + pfr: "\u{1D52D}", + phi: "\u03C6", + phiv: "\u03D5", + phmmat: "\u2133", + phone: "\u260E", + pi: "\u03C0", + pitchfork: "\u22D4", + piv: "\u03D6", + planck: "\u210F", + planckh: "\u210E", + plankv: "\u210F", + plus: "+", + plusacir: "\u2A23", + plusb: "\u229E", + pluscir: "\u2A22", + plusdo: "\u2214", + plusdu: "\u2A25", + pluse: "\u2A72", + plusmn: "\xB1", + plussim: "\u2A26", + plustwo: "\u2A27", + pm: "\xB1", + pointint: "\u2A15", + popf: "\u{1D561}", + pound: "\xA3", + pr: "\u227A", + prE: "\u2AB3", + prap: "\u2AB7", + prcue: "\u227C", + pre: "\u2AAF", + prec: "\u227A", + precapprox: "\u2AB7", + preccurlyeq: "\u227C", + preceq: "\u2AAF", + precnapprox: "\u2AB9", + precneqq: "\u2AB5", + precnsim: "\u22E8", + precsim: "\u227E", + prime: "\u2032", + primes: "\u2119", + prnE: "\u2AB5", + prnap: "\u2AB9", + prnsim: "\u22E8", + prod: "\u220F", + profalar: "\u232E", + profline: "\u2312", + profsurf: "\u2313", + prop: "\u221D", + propto: "\u221D", + prsim: "\u227E", + prurel: "\u22B0", + pscr: "\u{1D4C5}", + psi: "\u03C8", + puncsp: "\u2008", + qfr: "\u{1D52E}", + qint: "\u2A0C", + qopf: "\u{1D562}", + qprime: "\u2057", + qscr: "\u{1D4C6}", + quaternions: "\u210D", + quatint: "\u2A16", + quest: "?", + questeq: "\u225F", + quot: '"', + rAarr: "\u21DB", + rArr: "\u21D2", + rAtail: "\u291C", + rBarr: "\u290F", + rHar: "\u2964", + race: "\u223D\u0331", + racute: "\u0155", + radic: "\u221A", + raemptyv: "\u29B3", + rang: "\u27E9", + rangd: "\u2992", + range: "\u29A5", + rangle: "\u27E9", + raquo: "\xBB", + rarr: "\u2192", + rarrap: "\u2975", + rarrb: "\u21E5", + rarrbfs: "\u2920", + rarrc: "\u2933", + rarrfs: "\u291E", + rarrhk: "\u21AA", + rarrlp: "\u21AC", + rarrpl: "\u2945", + rarrsim: "\u2974", + rarrtl: "\u21A3", + rarrw: "\u219D", + ratail: "\u291A", + ratio: "\u2236", + rationals: "\u211A", + rbarr: "\u290D", + rbbrk: "\u2773", + rbrace: "}", + rbrack: "]", + rbrke: "\u298C", + rbrksld: "\u298E", + rbrkslu: "\u2990", + rcaron: "\u0159", + rcedil: "\u0157", + rceil: "\u2309", + rcub: "}", + rcy: "\u0440", + rdca: "\u2937", + rdldhar: "\u2969", + rdquo: "\u201D", + rdquor: "\u201D", + rdsh: "\u21B3", + real: "\u211C", + realine: "\u211B", + realpart: "\u211C", + reals: "\u211D", + rect: "\u25AD", + reg: "\xAE", + rfisht: "\u297D", + rfloor: "\u230B", + rfr: "\u{1D52F}", + rhard: "\u21C1", + rharu: "\u21C0", + rharul: "\u296C", + rho: "\u03C1", + rhov: "\u03F1", + rightarrow: "\u2192", + rightarrowtail: "\u21A3", + rightharpoondown: "\u21C1", + rightharpoonup: "\u21C0", + rightleftarrows: "\u21C4", + rightleftharpoons: "\u21CC", + rightrightarrows: "\u21C9", + rightsquigarrow: "\u219D", + rightthreetimes: "\u22CC", + ring: "\u02DA", + risingdotseq: "\u2253", + rlarr: "\u21C4", + rlhar: "\u21CC", + rlm: "\u200F", + rmoust: "\u23B1", + rmoustache: "\u23B1", + rnmid: "\u2AEE", + roang: "\u27ED", + roarr: "\u21FE", + robrk: "\u27E7", + ropar: "\u2986", + ropf: "\u{1D563}", + roplus: "\u2A2E", + rotimes: "\u2A35", + rpar: ")", + rpargt: "\u2994", + rppolint: "\u2A12", + rrarr: "\u21C9", + rsaquo: "\u203A", + rscr: "\u{1D4C7}", + rsh: "\u21B1", + rsqb: "]", + rsquo: "\u2019", + rsquor: "\u2019", + rthree: "\u22CC", + rtimes: "\u22CA", + rtri: "\u25B9", + rtrie: "\u22B5", + rtrif: "\u25B8", + rtriltri: "\u29CE", + ruluhar: "\u2968", + rx: "\u211E", + sacute: "\u015B", + sbquo: "\u201A", + sc: "\u227B", + scE: "\u2AB4", + scap: "\u2AB8", + scaron: "\u0161", + sccue: "\u227D", + sce: "\u2AB0", + scedil: "\u015F", + scirc: "\u015D", + scnE: "\u2AB6", + scnap: "\u2ABA", + scnsim: "\u22E9", + scpolint: "\u2A13", + scsim: "\u227F", + scy: "\u0441", + sdot: "\u22C5", + sdotb: "\u22A1", + sdote: "\u2A66", + seArr: "\u21D8", + searhk: "\u2925", + searr: "\u2198", + searrow: "\u2198", + sect: "\xA7", + semi: ";", + seswar: "\u2929", + setminus: "\u2216", + setmn: "\u2216", + sext: "\u2736", + sfr: "\u{1D530}", + sfrown: "\u2322", + sharp: "\u266F", + shchcy: "\u0449", + shcy: "\u0448", + shortmid: "\u2223", + shortparallel: "\u2225", + shy: "\xAD", + sigma: "\u03C3", + sigmaf: "\u03C2", + sigmav: "\u03C2", + sim: "\u223C", + simdot: "\u2A6A", + sime: "\u2243", + simeq: "\u2243", + simg: "\u2A9E", + simgE: "\u2AA0", + siml: "\u2A9D", + simlE: "\u2A9F", + simne: "\u2246", + simplus: "\u2A24", + simrarr: "\u2972", + slarr: "\u2190", + smallsetminus: "\u2216", + smashp: "\u2A33", + smeparsl: "\u29E4", + smid: "\u2223", + smile: "\u2323", + smt: "\u2AAA", + smte: "\u2AAC", + smtes: "\u2AAC\uFE00", + softcy: "\u044C", + sol: "/", + solb: "\u29C4", + solbar: "\u233F", + sopf: "\u{1D564}", + spades: "\u2660", + spadesuit: "\u2660", + spar: "\u2225", + sqcap: "\u2293", + sqcaps: "\u2293\uFE00", + sqcup: "\u2294", + sqcups: "\u2294\uFE00", + sqsub: "\u228F", + sqsube: "\u2291", + sqsubset: "\u228F", + sqsubseteq: "\u2291", + sqsup: "\u2290", + sqsupe: "\u2292", + sqsupset: "\u2290", + sqsupseteq: "\u2292", + squ: "\u25A1", + square: "\u25A1", + squarf: "\u25AA", + squf: "\u25AA", + srarr: "\u2192", + sscr: "\u{1D4C8}", + ssetmn: "\u2216", + ssmile: "\u2323", + sstarf: "\u22C6", + star: "\u2606", + starf: "\u2605", + straightepsilon: "\u03F5", + straightphi: "\u03D5", + strns: "\xAF", + sub: "\u2282", + subE: "\u2AC5", + subdot: "\u2ABD", + sube: "\u2286", + subedot: "\u2AC3", + submult: "\u2AC1", + subnE: "\u2ACB", + subne: "\u228A", + subplus: "\u2ABF", + subrarr: "\u2979", + subset: "\u2282", + subseteq: "\u2286", + subseteqq: "\u2AC5", + subsetneq: "\u228A", + subsetneqq: "\u2ACB", + subsim: "\u2AC7", + subsub: "\u2AD5", + subsup: "\u2AD3", + succ: "\u227B", + succapprox: "\u2AB8", + succcurlyeq: "\u227D", + succeq: "\u2AB0", + succnapprox: "\u2ABA", + succneqq: "\u2AB6", + succnsim: "\u22E9", + succsim: "\u227F", + sum: "\u2211", + sung: "\u266A", + sup1: "\xB9", + sup2: "\xB2", + sup3: "\xB3", + sup: "\u2283", + supE: "\u2AC6", + supdot: "\u2ABE", + supdsub: "\u2AD8", + supe: "\u2287", + supedot: "\u2AC4", + suphsol: "\u27C9", + suphsub: "\u2AD7", + suplarr: "\u297B", + supmult: "\u2AC2", + supnE: "\u2ACC", + supne: "\u228B", + supplus: "\u2AC0", + supset: "\u2283", + supseteq: "\u2287", + supseteqq: "\u2AC6", + supsetneq: "\u228B", + supsetneqq: "\u2ACC", + supsim: "\u2AC8", + supsub: "\u2AD4", + supsup: "\u2AD6", + swArr: "\u21D9", + swarhk: "\u2926", + swarr: "\u2199", + swarrow: "\u2199", + swnwar: "\u292A", + szlig: "\xDF", + target: "\u2316", + tau: "\u03C4", + tbrk: "\u23B4", + tcaron: "\u0165", + tcedil: "\u0163", + tcy: "\u0442", + tdot: "\u20DB", + telrec: "\u2315", + tfr: "\u{1D531}", + there4: "\u2234", + therefore: "\u2234", + theta: "\u03B8", + thetasym: "\u03D1", + thetav: "\u03D1", + thickapprox: "\u2248", + thicksim: "\u223C", + thinsp: "\u2009", + thkap: "\u2248", + thksim: "\u223C", + thorn: "\xFE", + tilde: "\u02DC", + times: "\xD7", + timesb: "\u22A0", + timesbar: "\u2A31", + timesd: "\u2A30", + tint: "\u222D", + toea: "\u2928", + top: "\u22A4", + topbot: "\u2336", + topcir: "\u2AF1", + topf: "\u{1D565}", + topfork: "\u2ADA", + tosa: "\u2929", + tprime: "\u2034", + trade: "\u2122", + triangle: "\u25B5", + triangledown: "\u25BF", + triangleleft: "\u25C3", + trianglelefteq: "\u22B4", + triangleq: "\u225C", + triangleright: "\u25B9", + trianglerighteq: "\u22B5", + tridot: "\u25EC", + trie: "\u225C", + triminus: "\u2A3A", + triplus: "\u2A39", + trisb: "\u29CD", + tritime: "\u2A3B", + trpezium: "\u23E2", + tscr: "\u{1D4C9}", + tscy: "\u0446", + tshcy: "\u045B", + tstrok: "\u0167", + twixt: "\u226C", + twoheadleftarrow: "\u219E", + twoheadrightarrow: "\u21A0", + uArr: "\u21D1", + uHar: "\u2963", + uacute: "\xFA", + uarr: "\u2191", + ubrcy: "\u045E", + ubreve: "\u016D", + ucirc: "\xFB", + ucy: "\u0443", + udarr: "\u21C5", + udblac: "\u0171", + udhar: "\u296E", + ufisht: "\u297E", + ufr: "\u{1D532}", + ugrave: "\xF9", + uharl: "\u21BF", + uharr: "\u21BE", + uhblk: "\u2580", + ulcorn: "\u231C", + ulcorner: "\u231C", + ulcrop: "\u230F", + ultri: "\u25F8", + umacr: "\u016B", + uml: "\xA8", + uogon: "\u0173", + uopf: "\u{1D566}", + uparrow: "\u2191", + updownarrow: "\u2195", + upharpoonleft: "\u21BF", + upharpoonright: "\u21BE", + uplus: "\u228E", + upsi: "\u03C5", + upsih: "\u03D2", + upsilon: "\u03C5", + upuparrows: "\u21C8", + urcorn: "\u231D", + urcorner: "\u231D", + urcrop: "\u230E", + uring: "\u016F", + urtri: "\u25F9", + uscr: "\u{1D4CA}", + utdot: "\u22F0", + utilde: "\u0169", + utri: "\u25B5", + utrif: "\u25B4", + uuarr: "\u21C8", + uuml: "\xFC", + uwangle: "\u29A7", + vArr: "\u21D5", + vBar: "\u2AE8", + vBarv: "\u2AE9", + vDash: "\u22A8", + vangrt: "\u299C", + varepsilon: "\u03F5", + varkappa: "\u03F0", + varnothing: "\u2205", + varphi: "\u03D5", + varpi: "\u03D6", + varpropto: "\u221D", + varr: "\u2195", + varrho: "\u03F1", + varsigma: "\u03C2", + varsubsetneq: "\u228A\uFE00", + varsubsetneqq: "\u2ACB\uFE00", + varsupsetneq: "\u228B\uFE00", + varsupsetneqq: "\u2ACC\uFE00", + vartheta: "\u03D1", + vartriangleleft: "\u22B2", + vartriangleright: "\u22B3", + vcy: "\u0432", + vdash: "\u22A2", + vee: "\u2228", + veebar: "\u22BB", + veeeq: "\u225A", + vellip: "\u22EE", + verbar: "|", + vert: "|", + vfr: "\u{1D533}", + vltri: "\u22B2", + vnsub: "\u2282\u20D2", + vnsup: "\u2283\u20D2", + vopf: "\u{1D567}", + vprop: "\u221D", + vrtri: "\u22B3", + vscr: "\u{1D4CB}", + vsubnE: "\u2ACB\uFE00", + vsubne: "\u228A\uFE00", + vsupnE: "\u2ACC\uFE00", + vsupne: "\u228B\uFE00", + vzigzag: "\u299A", + wcirc: "\u0175", + wedbar: "\u2A5F", + wedge: "\u2227", + wedgeq: "\u2259", + weierp: "\u2118", + wfr: "\u{1D534}", + wopf: "\u{1D568}", + wp: "\u2118", + wr: "\u2240", + wreath: "\u2240", + wscr: "\u{1D4CC}", + xcap: "\u22C2", + xcirc: "\u25EF", + xcup: "\u22C3", + xdtri: "\u25BD", + xfr: "\u{1D535}", + xhArr: "\u27FA", + xharr: "\u27F7", + xi: "\u03BE", + xlArr: "\u27F8", + xlarr: "\u27F5", + xmap: "\u27FC", + xnis: "\u22FB", + xodot: "\u2A00", + xopf: "\u{1D569}", + xoplus: "\u2A01", + xotime: "\u2A02", + xrArr: "\u27F9", + xrarr: "\u27F6", + xscr: "\u{1D4CD}", + xsqcup: "\u2A06", + xuplus: "\u2A04", + xutri: "\u25B3", + xvee: "\u22C1", + xwedge: "\u22C0", + yacute: "\xFD", + yacy: "\u044F", + ycirc: "\u0177", + ycy: "\u044B", + yen: "\xA5", + yfr: "\u{1D536}", + yicy: "\u0457", + yopf: "\u{1D56A}", + yscr: "\u{1D4CE}", + yucy: "\u044E", + yuml: "\xFF", + zacute: "\u017A", + zcaron: "\u017E", + zcy: "\u0437", + zdot: "\u017C", + zeetrf: "\u2128", + zeta: "\u03B6", + zfr: "\u{1D537}", + zhcy: "\u0436", + zigrarr: "\u21DD", + zopf: "\u{1D56B}", + zscr: "\u{1D4CF}", + zwj: "\u200D", + zwnj: "\u200C" +}; + +// node_modules/decode-named-character-reference/index.js +var own = {}.hasOwnProperty; +function decodeNamedCharacterReference(value) { + return own.call(characterEntities, value) ? characterEntities[value] : false; +} + +// node_modules/micromark-util-normalize-identifier/index.js +function normalizeIdentifier(value) { + return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase(); +} + +// node_modules/micromark-extension-gfm-footnote/lib/syntax.js +var indent = { + tokenize: tokenizeIndent, + partial: true +}; +function gfmFootnote() { + return { + document: { + [91]: { + tokenize: tokenizeDefinitionStart, + continuation: { + tokenize: tokenizeDefinitionContinuation + }, + exit: gfmFootnoteDefinitionEnd + } + }, + text: { + [91]: { + tokenize: tokenizeGfmFootnoteCall + }, + [93]: { + add: "after", + tokenize: tokenizePotentialGfmFootnoteCall, + resolveTo: resolveToPotentialGfmFootnoteCall + } + } + }; +} +function tokenizePotentialGfmFootnoteCall(effects, ok2, nok) { + const self = this; + let index = self.events.length; + const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []); + let labelStart; + while (index--) { + const token = self.events[index][1]; + if (token.type === "labelImage") { + labelStart = token; + break; + } + if (token.type === "gfmFootnoteCall" || token.type === "labelLink" || token.type === "label" || token.type === "image" || token.type === "link") { + break; + } + } + return start; + function start(code2) { + if (!labelStart || !labelStart._balanced) { + return nok(code2); + } + const id = normalizeIdentifier( + self.sliceSerialize({ + start: labelStart.end, + end: self.now() + }) + ); + if (id.charCodeAt(0) !== 94 || !defined.includes(id.slice(1))) { + return nok(code2); + } + effects.enter("gfmFootnoteCallLabelMarker"); + effects.consume(code2); + effects.exit("gfmFootnoteCallLabelMarker"); + return ok2(code2); + } +} +function resolveToPotentialGfmFootnoteCall(events, context) { + let index = events.length; + let labelStart; + while (index--) { + if (events[index][1].type === "labelImage" && events[index][0] === "enter") { + labelStart = events[index][1]; + break; + } + } + events[index + 1][1].type = "data"; + events[index + 3][1].type = "gfmFootnoteCallLabelMarker"; + const call = { + type: "gfmFootnoteCall", + start: Object.assign({}, events[index + 3][1].start), + end: Object.assign({}, events[events.length - 1][1].end) + }; + const marker = { + type: "gfmFootnoteCallMarker", + start: Object.assign({}, events[index + 3][1].end), + end: Object.assign({}, events[index + 3][1].end) + }; + marker.end.column++; + marker.end.offset++; + marker.end._bufferIndex++; + const string = { + type: "gfmFootnoteCallString", + start: Object.assign({}, marker.end), + end: Object.assign({}, events[events.length - 1][1].start) + }; + const chunk = { + type: "chunkString", + contentType: "string", + start: Object.assign({}, string.start), + end: Object.assign({}, string.end) + }; + const replacement = [ + events[index + 1], + events[index + 2], + ["enter", call, context], + events[index + 3], + events[index + 4], + ["enter", marker, context], + ["exit", marker, context], + ["enter", string, context], + ["enter", chunk, context], + ["exit", chunk, context], + ["exit", string, context], + events[events.length - 2], + events[events.length - 1], + ["exit", call, context] + ]; + events.splice(index, events.length - index + 1, ...replacement); + return events; +} +function tokenizeGfmFootnoteCall(effects, ok2, nok) { + const self = this; + const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []); + let size = 0; + let data; + return start; + function start(code2) { + effects.enter("gfmFootnoteCall"); + effects.enter("gfmFootnoteCallLabelMarker"); + effects.consume(code2); + effects.exit("gfmFootnoteCallLabelMarker"); + return callStart; + } + function callStart(code2) { + if (code2 !== 94) + return nok(code2); + effects.enter("gfmFootnoteCallMarker"); + effects.consume(code2); + effects.exit("gfmFootnoteCallMarker"); + effects.enter("gfmFootnoteCallString"); + effects.enter("chunkString").contentType = "string"; + return callData; + } + function callData(code2) { + let token; + if (code2 === null || code2 === 91 || size++ > 999) { + return nok(code2); + } + if (code2 === 93) { + if (!data) { + return nok(code2); + } + effects.exit("chunkString"); + token = effects.exit("gfmFootnoteCallString"); + return defined.includes(normalizeIdentifier(self.sliceSerialize(token))) ? end(code2) : nok(code2); + } + effects.consume(code2); + if (!markdownLineEndingOrSpace(code2)) { + data = true; + } + return code2 === 92 ? callEscape : callData; + } + function callEscape(code2) { + if (code2 === 91 || code2 === 92 || code2 === 93) { + effects.consume(code2); + size++; + return callData; + } + return callData(code2); + } + function end(code2) { + effects.enter("gfmFootnoteCallLabelMarker"); + effects.consume(code2); + effects.exit("gfmFootnoteCallLabelMarker"); + effects.exit("gfmFootnoteCall"); + return ok2; + } +} +function tokenizeDefinitionStart(effects, ok2, nok) { + const self = this; + const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []); + let identifier; + let size = 0; + let data; + return start; + function start(code2) { + effects.enter("gfmFootnoteDefinition")._container = true; + effects.enter("gfmFootnoteDefinitionLabel"); + effects.enter("gfmFootnoteDefinitionLabelMarker"); + effects.consume(code2); + effects.exit("gfmFootnoteDefinitionLabelMarker"); + return labelStart; + } + function labelStart(code2) { + if (code2 === 94) { + effects.enter("gfmFootnoteDefinitionMarker"); + effects.consume(code2); + effects.exit("gfmFootnoteDefinitionMarker"); + effects.enter("gfmFootnoteDefinitionLabelString"); + return atBreak; + } + return nok(code2); + } + function atBreak(code2) { + let token; + if (code2 === null || code2 === 91 || size > 999) { + return nok(code2); + } + if (code2 === 93) { + if (!data) { + return nok(code2); + } + token = effects.exit("gfmFootnoteDefinitionLabelString"); + identifier = normalizeIdentifier(self.sliceSerialize(token)); + effects.enter("gfmFootnoteDefinitionLabelMarker"); + effects.consume(code2); + effects.exit("gfmFootnoteDefinitionLabelMarker"); + effects.exit("gfmFootnoteDefinitionLabel"); + return labelAfter; + } + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + size++; + return atBreak; + } + effects.enter("chunkString").contentType = "string"; + return label(code2); + } + function label(code2) { + if (code2 === null || markdownLineEnding(code2) || code2 === 91 || code2 === 93 || size > 999) { + effects.exit("chunkString"); + return atBreak(code2); + } + if (!markdownLineEndingOrSpace(code2)) { + data = true; + } + size++; + effects.consume(code2); + return code2 === 92 ? labelEscape : label; + } + function labelEscape(code2) { + if (code2 === 91 || code2 === 92 || code2 === 93) { + effects.consume(code2); + size++; + return label; + } + return label(code2); + } + function labelAfter(code2) { + if (code2 === 58) { + effects.enter("definitionMarker"); + effects.consume(code2); + effects.exit("definitionMarker"); + return factorySpace(effects, done, "gfmFootnoteDefinitionWhitespace"); + } + return nok(code2); + } + function done(code2) { + if (!defined.includes(identifier)) { + defined.push(identifier); + } + return ok2(code2); + } +} +function tokenizeDefinitionContinuation(effects, ok2, nok) { + return effects.check(blankLine, ok2, effects.attempt(indent, ok2, nok)); +} +function gfmFootnoteDefinitionEnd(effects) { + effects.exit("gfmFootnoteDefinition"); +} +function tokenizeIndent(effects, ok2, nok) { + const self = this; + return factorySpace( + effects, + afterPrefix, + "gfmFootnoteDefinitionIndent", + 4 + 1 + ); + function afterPrefix(code2) { + const tail = self.events[self.events.length - 1]; + return tail && tail[1].type === "gfmFootnoteDefinitionIndent" && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok2(code2) : nok(code2); + } +} + +// node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js +function gfmStrikethrough(options = {}) { + let single = options.singleTilde; + const tokenizer = { + tokenize: tokenizeStrikethrough, + resolveAll: resolveAllStrikethrough + }; + if (single === null || single === void 0) { + single = true; + } + return { + text: { + [126]: tokenizer + }, + insideSpan: { + null: [tokenizer] + }, + attentionMarkers: { + null: [126] + } + }; + function resolveAllStrikethrough(events, context) { + let index = -1; + while (++index < events.length) { + if (events[index][0] === "enter" && events[index][1].type === "strikethroughSequenceTemporary" && events[index][1]._close) { + let open = index; + while (open--) { + if (events[open][0] === "exit" && events[open][1].type === "strikethroughSequenceTemporary" && events[open][1]._open && events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) { + events[index][1].type = "strikethroughSequence"; + events[open][1].type = "strikethroughSequence"; + const strikethrough = { + type: "strikethrough", + start: Object.assign({}, events[open][1].start), + end: Object.assign({}, events[index][1].end) + }; + const text2 = { + type: "strikethroughText", + start: Object.assign({}, events[open][1].end), + end: Object.assign({}, events[index][1].start) + }; + const nextEvents = [ + ["enter", strikethrough, context], + ["enter", events[open][1], context], + ["exit", events[open][1], context], + ["enter", text2, context] + ]; + splice( + nextEvents, + nextEvents.length, + 0, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + 1, index), + context + ) + ); + splice(nextEvents, nextEvents.length, 0, [ + ["exit", text2, context], + ["enter", events[index][1], context], + ["exit", events[index][1], context], + ["exit", strikethrough, context] + ]); + splice(events, open - 1, index - open + 3, nextEvents); + index = open + nextEvents.length - 2; + break; + } + } + } + } + index = -1; + while (++index < events.length) { + if (events[index][1].type === "strikethroughSequenceTemporary") { + events[index][1].type = "data"; + } + } + return events; + } + function tokenizeStrikethrough(effects, ok2, nok) { + const previous2 = this.previous; + const events = this.events; + let size = 0; + return start; + function start(code2) { + if (previous2 === 126 && events[events.length - 1][1].type !== "characterEscape") { + return nok(code2); + } + effects.enter("strikethroughSequenceTemporary"); + return more(code2); + } + function more(code2) { + const before = classifyCharacter(previous2); + if (code2 === 126) { + if (size > 1) + return nok(code2); + effects.consume(code2); + size++; + return more; + } + if (size < 2 && !single) + return nok(code2); + const token = effects.exit("strikethroughSequenceTemporary"); + const after = classifyCharacter(code2); + token._open = !after || after === 2 && Boolean(before); + token._close = !before || before === 2 && Boolean(after); + return ok2(code2); + } + } +} + +// node_modules/micromark-extension-gfm-table/lib/syntax.js +var gfmTable = { + flow: { + null: { + tokenize: tokenizeTable, + resolve: resolveTable + } + } +}; +var nextPrefixedOrBlank = { + tokenize: tokenizeNextPrefixedOrBlank, + partial: true +}; +function resolveTable(events, context) { + let index = -1; + let inHead; + let inDelimiterRow; + let inRow; + let contentStart; + let contentEnd; + let cellStart; + let seenCellInRow; + while (++index < events.length) { + const token = events[index][1]; + if (inRow) { + if (token.type === "temporaryTableCellContent") { + contentStart = contentStart || index; + contentEnd = index; + } + if ((token.type === "tableCellDivider" || token.type === "tableRow") && contentEnd) { + const content = { + type: "tableContent", + start: events[contentStart][1].start, + end: events[contentEnd][1].end + }; + const text2 = { + type: "chunkText", + start: content.start, + end: content.end, + contentType: "text" + }; + events.splice( + contentStart, + contentEnd - contentStart + 1, + ["enter", content, context], + ["enter", text2, context], + ["exit", text2, context], + ["exit", content, context] + ); + index -= contentEnd - contentStart - 3; + contentStart = void 0; + contentEnd = void 0; + } + } + if (events[index][0] === "exit" && cellStart !== void 0 && cellStart + (seenCellInRow ? 0 : 1) < index && (token.type === "tableCellDivider" || token.type === "tableRow" && (cellStart + 3 < index || events[cellStart][1].type !== "whitespace"))) { + const cell = { + type: inDelimiterRow ? "tableDelimiter" : inHead ? "tableHeader" : "tableData", + start: events[cellStart][1].start, + end: events[index][1].end + }; + events.splice(index + (token.type === "tableCellDivider" ? 1 : 0), 0, [ + "exit", + cell, + context + ]); + events.splice(cellStart, 0, ["enter", cell, context]); + index += 2; + cellStart = index + 1; + seenCellInRow = true; + } + if (token.type === "tableRow") { + inRow = events[index][0] === "enter"; + if (inRow) { + cellStart = index + 1; + seenCellInRow = false; + } + } + if (token.type === "tableDelimiterRow") { + inDelimiterRow = events[index][0] === "enter"; + if (inDelimiterRow) { + cellStart = index + 1; + seenCellInRow = false; + } + } + if (token.type === "tableHead") { + inHead = events[index][0] === "enter"; + } + } + return events; +} +function tokenizeTable(effects, ok2, nok) { + const self = this; + const align = []; + let tableHeaderCount = 0; + let seenDelimiter; + let hasDash; + return start; + function start(code2) { + effects.enter("table")._align = align; + effects.enter("tableHead"); + effects.enter("tableRow"); + if (code2 === 124) { + return cellDividerHead(code2); + } + tableHeaderCount++; + effects.enter("temporaryTableCellContent"); + return inCellContentHead(code2); + } + function cellDividerHead(code2) { + effects.enter("tableCellDivider"); + effects.consume(code2); + effects.exit("tableCellDivider"); + seenDelimiter = true; + return cellBreakHead; + } + function cellBreakHead(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return atRowEndHead(code2); + } + if (markdownSpace(code2)) { + effects.enter("whitespace"); + effects.consume(code2); + return inWhitespaceHead; + } + if (seenDelimiter) { + seenDelimiter = void 0; + tableHeaderCount++; + } + if (code2 === 124) { + return cellDividerHead(code2); + } + effects.enter("temporaryTableCellContent"); + return inCellContentHead(code2); + } + function inWhitespaceHead(code2) { + if (markdownSpace(code2)) { + effects.consume(code2); + return inWhitespaceHead; + } + effects.exit("whitespace"); + return cellBreakHead(code2); + } + function inCellContentHead(code2) { + if (code2 === null || code2 === 124 || markdownLineEndingOrSpace(code2)) { + effects.exit("temporaryTableCellContent"); + return cellBreakHead(code2); + } + effects.consume(code2); + return code2 === 92 ? inCellContentEscapeHead : inCellContentHead; + } + function inCellContentEscapeHead(code2) { + if (code2 === 92 || code2 === 124) { + effects.consume(code2); + return inCellContentHead; + } + return inCellContentHead(code2); + } + function atRowEndHead(code2) { + if (code2 === null) { + return nok(code2); + } + effects.exit("tableRow"); + effects.exit("tableHead"); + const originalInterrupt = self.interrupt; + self.interrupt = true; + return effects.attempt( + { + tokenize: tokenizeRowEnd, + partial: true + }, + function(code3) { + self.interrupt = originalInterrupt; + effects.enter("tableDelimiterRow"); + return atDelimiterRowBreak(code3); + }, + function(code3) { + self.interrupt = originalInterrupt; + return nok(code3); + } + )(code2); + } + function atDelimiterRowBreak(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return rowEndDelimiter(code2); + } + if (markdownSpace(code2)) { + effects.enter("whitespace"); + effects.consume(code2); + return inWhitespaceDelimiter; + } + if (code2 === 45) { + effects.enter("tableDelimiterFiller"); + effects.consume(code2); + hasDash = true; + align.push("none"); + return inFillerDelimiter; + } + if (code2 === 58) { + effects.enter("tableDelimiterAlignment"); + effects.consume(code2); + effects.exit("tableDelimiterAlignment"); + align.push("left"); + return afterLeftAlignment; + } + if (code2 === 124) { + effects.enter("tableCellDivider"); + effects.consume(code2); + effects.exit("tableCellDivider"); + return atDelimiterRowBreak; + } + return nok(code2); + } + function inWhitespaceDelimiter(code2) { + if (markdownSpace(code2)) { + effects.consume(code2); + return inWhitespaceDelimiter; + } + effects.exit("whitespace"); + return atDelimiterRowBreak(code2); + } + function inFillerDelimiter(code2) { + if (code2 === 45) { + effects.consume(code2); + return inFillerDelimiter; + } + effects.exit("tableDelimiterFiller"); + if (code2 === 58) { + effects.enter("tableDelimiterAlignment"); + effects.consume(code2); + effects.exit("tableDelimiterAlignment"); + align[align.length - 1] = align[align.length - 1] === "left" ? "center" : "right"; + return afterRightAlignment; + } + return atDelimiterRowBreak(code2); + } + function afterLeftAlignment(code2) { + if (code2 === 45) { + effects.enter("tableDelimiterFiller"); + effects.consume(code2); + hasDash = true; + return inFillerDelimiter; + } + return nok(code2); + } + function afterRightAlignment(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return rowEndDelimiter(code2); + } + if (markdownSpace(code2)) { + effects.enter("whitespace"); + effects.consume(code2); + return inWhitespaceDelimiter; + } + if (code2 === 124) { + effects.enter("tableCellDivider"); + effects.consume(code2); + effects.exit("tableCellDivider"); + return atDelimiterRowBreak; + } + return nok(code2); + } + function rowEndDelimiter(code2) { + effects.exit("tableDelimiterRow"); + if (!hasDash || tableHeaderCount !== align.length) { + return nok(code2); + } + if (code2 === null) { + return tableClose(code2); + } + return effects.check( + nextPrefixedOrBlank, + tableClose, + effects.attempt( + { + tokenize: tokenizeRowEnd, + partial: true + }, + factorySpace(effects, bodyStart, "linePrefix", 4), + tableClose + ) + )(code2); + } + function tableClose(code2) { + effects.exit("table"); + return ok2(code2); + } + function bodyStart(code2) { + effects.enter("tableBody"); + return rowStartBody(code2); + } + function rowStartBody(code2) { + effects.enter("tableRow"); + if (code2 === 124) { + return cellDividerBody(code2); + } + effects.enter("temporaryTableCellContent"); + return inCellContentBody(code2); + } + function cellDividerBody(code2) { + effects.enter("tableCellDivider"); + effects.consume(code2); + effects.exit("tableCellDivider"); + return cellBreakBody; + } + function cellBreakBody(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return atRowEndBody(code2); + } + if (markdownSpace(code2)) { + effects.enter("whitespace"); + effects.consume(code2); + return inWhitespaceBody; + } + if (code2 === 124) { + return cellDividerBody(code2); + } + effects.enter("temporaryTableCellContent"); + return inCellContentBody(code2); + } + function inWhitespaceBody(code2) { + if (markdownSpace(code2)) { + effects.consume(code2); + return inWhitespaceBody; + } + effects.exit("whitespace"); + return cellBreakBody(code2); + } + function inCellContentBody(code2) { + if (code2 === null || code2 === 124 || markdownLineEndingOrSpace(code2)) { + effects.exit("temporaryTableCellContent"); + return cellBreakBody(code2); + } + effects.consume(code2); + return code2 === 92 ? inCellContentEscapeBody : inCellContentBody; + } + function inCellContentEscapeBody(code2) { + if (code2 === 92 || code2 === 124) { + effects.consume(code2); + return inCellContentBody; + } + return inCellContentBody(code2); + } + function atRowEndBody(code2) { + effects.exit("tableRow"); + if (code2 === null) { + return tableBodyClose(code2); + } + return effects.check( + nextPrefixedOrBlank, + tableBodyClose, + effects.attempt( + { + tokenize: tokenizeRowEnd, + partial: true + }, + factorySpace(effects, rowStartBody, "linePrefix", 4), + tableBodyClose + ) + )(code2); + } + function tableBodyClose(code2) { + effects.exit("tableBody"); + return tableClose(code2); + } + function tokenizeRowEnd(effects2, ok3, nok2) { + return start2; + function start2(code2) { + effects2.enter("lineEnding"); + effects2.consume(code2); + effects2.exit("lineEnding"); + return factorySpace(effects2, prefixed, "linePrefix"); + } + function prefixed(code2) { + if (self.parser.lazy[self.now().line] || code2 === null || markdownLineEnding(code2)) { + return nok2(code2); + } + const tail = self.events[self.events.length - 1]; + if (!self.parser.constructs.disable.null.includes("codeIndented") && tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4) { + return nok2(code2); + } + self._gfmTableDynamicInterruptHack = true; + return effects2.check( + self.parser.constructs.flow, + function(code3) { + self._gfmTableDynamicInterruptHack = false; + return nok2(code3); + }, + function(code3) { + self._gfmTableDynamicInterruptHack = false; + return ok3(code3); + } + )(code2); + } + } +} +function tokenizeNextPrefixedOrBlank(effects, ok2, nok) { + let size = 0; + return start; + function start(code2) { + effects.enter("check"); + effects.consume(code2); + return whitespace; + } + function whitespace(code2) { + if (code2 === -1 || code2 === 32) { + effects.consume(code2); + size++; + return size === 4 ? ok2 : whitespace; + } + if (code2 === null || markdownLineEndingOrSpace(code2)) { + return ok2(code2); + } + return nok(code2); + } +} + +// node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js +var tasklistCheck = { + tokenize: tokenizeTasklistCheck +}; +var gfmTaskListItem = { + text: { + [91]: tasklistCheck + } +}; +function tokenizeTasklistCheck(effects, ok2, nok) { + const self = this; + return open; + function open(code2) { + if (self.previous !== null || !self._gfmTasklistFirstContentOfListItem) { + return nok(code2); + } + effects.enter("taskListCheck"); + effects.enter("taskListCheckMarker"); + effects.consume(code2); + effects.exit("taskListCheckMarker"); + return inside; + } + function inside(code2) { + if (markdownLineEndingOrSpace(code2)) { + effects.enter("taskListCheckValueUnchecked"); + effects.consume(code2); + effects.exit("taskListCheckValueUnchecked"); + return close; + } + if (code2 === 88 || code2 === 120) { + effects.enter("taskListCheckValueChecked"); + effects.consume(code2); + effects.exit("taskListCheckValueChecked"); + return close; + } + return nok(code2); + } + function close(code2) { + if (code2 === 93) { + effects.enter("taskListCheckMarker"); + effects.consume(code2); + effects.exit("taskListCheckMarker"); + effects.exit("taskListCheck"); + return effects.check( + { + tokenize: spaceThenNonSpace + }, + ok2, + nok + ); + } + return nok(code2); + } +} +function spaceThenNonSpace(effects, ok2, nok) { + const self = this; + return factorySpace(effects, after, "whitespace"); + function after(code2) { + const tail = self.events[self.events.length - 1]; + return (tail && tail[1].type === "whitespace" || markdownLineEnding(code2)) && code2 !== null ? ok2(code2) : nok(code2); + } +} + +// node_modules/micromark-extension-gfm/index.js +function gfm(options) { + return combineExtensions([ + gfmAutolinkLiteral, + gfmFootnote(), + gfmStrikethrough(options), + gfmTable, + gfmTaskListItem + ]); +} + +// node_modules/mdast-util-gfm-autolink-literal/node_modules/ccount/index.js +function ccount(value, character) { + const source = String(value); + if (typeof character !== "string") { + throw new TypeError("Expected character"); + } + let count = 0; + let index = source.indexOf(character); + while (index !== -1) { + count++; + index = source.indexOf(character, index + character.length); + } + return count; +} + +// node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js +function escapeStringRegexp(string) { + if (typeof string !== "string") { + throw new TypeError("Expected a string"); + } + return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} + +// node_modules/unist-util-is/index.js +var convert = function(test) { + if (test === void 0 || test === null) { + return ok; + } + if (typeof test === "string") { + return typeFactory(test); + } + if (typeof test === "object") { + return Array.isArray(test) ? anyFactory(test) : propsFactory(test); + } + if (typeof test === "function") { + return castFactory(test); + } + throw new Error("Expected function, string, or object as test"); +}; +function anyFactory(tests) { + const checks = []; + let index = -1; + while (++index < tests.length) { + checks[index] = convert(tests[index]); + } + return castFactory(any); + function any(...parameters) { + let index2 = -1; + while (++index2 < checks.length) { + if (checks[index2].call(this, ...parameters)) + return true; + } + return false; + } +} +function propsFactory(check) { + return castFactory(all); + function all(node) { + let key; + for (key in check) { + if (node[key] !== check[key]) + return false; + } + return true; + } +} +function typeFactory(check) { + return castFactory(type); + function type(node) { + return node && node.type === check; + } +} +function castFactory(check) { + return assertion; + function assertion(...parameters) { + return Boolean(check.call(this, ...parameters)); + } +} +function ok() { + return true; +} + +// node_modules/unist-util-visit-parents/color.js +function color(d) { + return "\x1B[33m" + d + "\x1B[39m"; +} + +// node_modules/unist-util-visit-parents/index.js +var CONTINUE = true; +var SKIP = "skip"; +var EXIT = false; +var visitParents = function(tree, test, visitor, reverse) { + if (typeof test === "function" && typeof visitor !== "function") { + reverse = visitor; + visitor = test; + test = null; + } + const is = convert(test); + const step = reverse ? -1 : 1; + factory(tree, null, [])(); + function factory(node, index, parents) { + const value = typeof node === "object" && node !== null ? node : {}; + let name; + if (typeof value.type === "string") { + name = typeof value.tagName === "string" ? value.tagName : typeof value.name === "string" ? value.name : void 0; + Object.defineProperty(visit, "name", { + value: "node (" + color(value.type + (name ? "<" + name + ">" : "")) + ")" + }); + } + return visit; + function visit() { + let result = []; + let subresult; + let offset; + let grandparents; + if (!test || is(node, index, parents[parents.length - 1] || null)) { + result = toResult(visitor(node, parents)); + if (result[0] === EXIT) { + return result; + } + } + if (node.children && result[0] !== SKIP) { + offset = (reverse ? node.children.length : -1) + step; + grandparents = parents.concat(node); + while (offset > -1 && offset < node.children.length) { + subresult = factory(node.children[offset], offset, grandparents)(); + if (subresult[0] === EXIT) { + return subresult; + } + offset = typeof subresult[1] === "number" ? subresult[1] : offset + step; + } + } + return result; + } + } +}; +function toResult(value) { + if (Array.isArray(value)) { + return value; + } + if (typeof value === "number") { + return [CONTINUE, value]; + } + return [value]; +} + +// node_modules/mdast-util-find-and-replace/lib/index.js +var own2 = {}.hasOwnProperty; +var findAndReplace = function(tree, find, replace2, options) { + let settings; + let schema; + if (typeof find === "string" || find instanceof RegExp) { + schema = [[find, replace2]]; + settings = options; + } else { + schema = find; + settings = replace2; + } + if (!settings) { + settings = {}; + } + const ignored = convert(settings.ignore || []); + const pairs = toPairs(schema); + let pairIndex = -1; + while (++pairIndex < pairs.length) { + visitParents(tree, "text", visitor); + } + return tree; + function visitor(node, parents) { + let index = -1; + let grandparent; + while (++index < parents.length) { + const parent = parents[index]; + if (ignored( + parent, + grandparent ? grandparent.children.indexOf(parent) : void 0, + grandparent + )) { + return; + } + grandparent = parent; + } + if (grandparent) { + return handler(node, parents); + } + } + function handler(node, parents) { + const parent = parents[parents.length - 1]; + const find2 = pairs[pairIndex][0]; + const replace3 = pairs[pairIndex][1]; + let start = 0; + const index = parent.children.indexOf(node); + let change = false; + let nodes = []; + let position; + find2.lastIndex = 0; + let match = find2.exec(node.value); + while (match) { + position = match.index; + const matchObject = { + index: match.index, + input: match.input, + stack: [...parents, node] + }; + let value = replace3(...match, matchObject); + if (typeof value === "string") { + value = value.length > 0 ? { type: "text", value } : void 0; + } + if (value !== false) { + if (start !== position) { + nodes.push({ + type: "text", + value: node.value.slice(start, position) + }); + } + if (Array.isArray(value)) { + nodes.push(...value); + } else if (value) { + nodes.push(value); + } + start = position + match[0].length; + change = true; + } + if (!find2.global) { + break; + } + match = find2.exec(node.value); + } + if (change) { + if (start < node.value.length) { + nodes.push({ type: "text", value: node.value.slice(start) }); + } + parent.children.splice(index, 1, ...nodes); + } else { + nodes = [node]; + } + return index + nodes.length; + } +}; +function toPairs(schema) { + const result = []; + if (typeof schema !== "object") { + throw new TypeError("Expected array or object as schema"); + } + if (Array.isArray(schema)) { + let index = -1; + while (++index < schema.length) { + result.push([ + toExpression(schema[index][0]), + toFunction(schema[index][1]) + ]); + } + } else { + let key; + for (key in schema) { + if (own2.call(schema, key)) { + result.push([toExpression(key), toFunction(schema[key])]); + } + } + } + return result; +} +function toExpression(find) { + return typeof find === "string" ? new RegExp(escapeStringRegexp(find), "g") : find; +} +function toFunction(replace2) { + return typeof replace2 === "function" ? replace2 : () => replace2; +} + +// node_modules/mdast-util-gfm-autolink-literal/index.js +var inConstruct = "phrasing"; +var notInConstruct = ["autolink", "link", "image", "label"]; +var gfmAutolinkLiteralFromMarkdown = { + transforms: [transformGfmAutolinkLiterals], + enter: { + literalAutolink: enterLiteralAutolink, + literalAutolinkEmail: enterLiteralAutolinkValue, + literalAutolinkHttp: enterLiteralAutolinkValue, + literalAutolinkWww: enterLiteralAutolinkValue + }, + exit: { + literalAutolink: exitLiteralAutolink, + literalAutolinkEmail: exitLiteralAutolinkEmail, + literalAutolinkHttp: exitLiteralAutolinkHttp, + literalAutolinkWww: exitLiteralAutolinkWww + } +}; +var gfmAutolinkLiteralToMarkdown = { + unsafe: [ + { + character: "@", + before: "[+\\-.\\w]", + after: "[\\-.\\w]", + inConstruct, + notInConstruct + }, + { + character: ".", + before: "[Ww]", + after: "[\\-.\\w]", + inConstruct, + notInConstruct + }, + { character: ":", before: "[ps]", after: "\\/", inConstruct, notInConstruct } + ] +}; +function enterLiteralAutolink(token) { + this.enter({ type: "link", title: null, url: "", children: [] }, token); +} +function enterLiteralAutolinkValue(token) { + this.config.enter.autolinkProtocol.call(this, token); +} +function exitLiteralAutolinkHttp(token) { + this.config.exit.autolinkProtocol.call(this, token); +} +function exitLiteralAutolinkWww(token) { + this.config.exit.data.call(this, token); + const node = this.stack[this.stack.length - 1]; + node.url = "http://" + this.sliceSerialize(token); +} +function exitLiteralAutolinkEmail(token) { + this.config.exit.autolinkEmail.call(this, token); +} +function exitLiteralAutolink(token) { + this.exit(token); +} +function transformGfmAutolinkLiterals(tree) { + findAndReplace( + tree, + [ + [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, findUrl], + [/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g, findEmail] + ], + { ignore: ["link", "linkReference"] } + ); +} +function findUrl(_, protocol, domain2, path2, match) { + let prefix = ""; + if (!previous(match)) { + return false; + } + if (/^w/i.test(protocol)) { + domain2 = protocol + domain2; + protocol = ""; + prefix = "http://"; + } + if (!isCorrectDomain(domain2)) { + return false; + } + const parts = splitUrl(domain2 + path2); + if (!parts[0]) + return false; + const result = { + type: "link", + title: null, + url: prefix + protocol + parts[0], + children: [{ type: "text", value: protocol + parts[0] }] + }; + if (parts[1]) { + return [result, { type: "text", value: parts[1] }]; + } + return result; +} +function findEmail(_, atext, label, match) { + if (!previous(match, true) || /[_-\d]$/.test(label)) { + return false; + } + return { + type: "link", + title: null, + url: "mailto:" + atext + "@" + label, + children: [{ type: "text", value: atext + "@" + label }] + }; +} +function isCorrectDomain(domain2) { + const parts = domain2.split("."); + if (parts.length < 2 || parts[parts.length - 1] && (/_/.test(parts[parts.length - 1]) || !/[a-zA-Z\d]/.test(parts[parts.length - 1])) || parts[parts.length - 2] && (/_/.test(parts[parts.length - 2]) || !/[a-zA-Z\d]/.test(parts[parts.length - 2]))) { + return false; + } + return true; +} +function splitUrl(url) { + const trailExec = /[!"&'),.:;<>?\]}]+$/.exec(url); + let closingParenIndex; + let openingParens; + let closingParens; + let trail; + if (trailExec) { + url = url.slice(0, trailExec.index); + trail = trailExec[0]; + closingParenIndex = trail.indexOf(")"); + openingParens = ccount(url, "("); + closingParens = ccount(url, ")"); + while (closingParenIndex !== -1 && openingParens > closingParens) { + url += trail.slice(0, closingParenIndex + 1); + trail = trail.slice(closingParenIndex + 1); + closingParenIndex = trail.indexOf(")"); + closingParens++; + } + } + return [url, trail]; +} +function previous(match, email) { + const code2 = match.input.charCodeAt(match.index - 1); + return (match.index === 0 || unicodeWhitespace(code2) || unicodePunctuation(code2)) && (!email || code2 !== 47); +} + +// node_modules/micromark-util-decode-numeric-character-reference/index.js +function decodeNumericCharacterReference(value, base) { + const code2 = Number.parseInt(value, base); + if (code2 < 9 || code2 === 11 || code2 > 13 && code2 < 32 || code2 > 126 && code2 < 160 || code2 > 55295 && code2 < 57344 || code2 > 64975 && code2 < 65008 || (code2 & 65535) === 65535 || (code2 & 65535) === 65534 || code2 > 1114111) { + return "\uFFFD"; + } + return String.fromCharCode(code2); +} + +// node_modules/micromark-util-decode-string/index.js +var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi; +function decodeString(value) { + return value.replace(characterEscapeOrReference, decode); +} +function decode($0, $1, $2) { + if ($1) { + return $1; + } + const head = $2.charCodeAt(0); + if (head === 35) { + const head2 = $2.charCodeAt(1); + const hex = head2 === 120 || head2 === 88; + return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10); + } + return decodeNamedCharacterReference($2) || $0; +} + +// node_modules/mdast-util-to-markdown/lib/util/association.js +function association(node) { + if (node.label || !node.identifier) { + return node.label || ""; + } + return decodeString(node.identifier); +} + +// node_modules/mdast-util-to-markdown/lib/util/track.js +function track(options_) { + const options = options_ || {}; + const now = options.now || {}; + let lineShift = options.lineShift || 0; + let line = now.line || 1; + let column = now.column || 1; + return { move, current, shift }; + function current() { + return { now: { line, column }, lineShift }; + } + function shift(value) { + lineShift += value; + } + function move(value = "") { + const chunks = value.split(/\r?\n|\r/g); + const tail = chunks[chunks.length - 1]; + line += chunks.length - 1; + column = chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift; + return value; + } +} + +// node_modules/mdast-util-to-markdown/lib/util/container-flow.js +function containerFlow(parent, context, safeOptions) { + const indexStack = context.indexStack; + const children = parent.children || []; + const tracker = track(safeOptions); + const results = []; + let index = -1; + indexStack.push(-1); + while (++index < children.length) { + const child = children[index]; + indexStack[indexStack.length - 1] = index; + results.push( + tracker.move( + context.handle(child, parent, context, { + before: "\n", + after: "\n", + ...tracker.current() + }) + ) + ); + if (child.type !== "list") { + context.bulletLastUsed = void 0; + } + if (index < children.length - 1) { + results.push(tracker.move(between(child, children[index + 1]))); + } + } + indexStack.pop(); + return results.join(""); + function between(left, right) { + let index2 = context.join.length; + while (index2--) { + const result = context.join[index2](left, right, parent, context); + if (result === true || result === 1) { + break; + } + if (typeof result === "number") { + return "\n".repeat(1 + result); + } + if (result === false) { + return "\n\n\n\n"; + } + } + return "\n\n"; + } +} + +// node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +var eol = /\r?\n|\r/g; +function indentLines(value, map) { + const result = []; + let start = 0; + let line = 0; + let match; + while (match = eol.exec(value)) { + one(value.slice(start, match.index)); + result.push(match[0]); + start = match.index + match[0].length; + line++; + } + one(value.slice(start)); + return result.join(""); + function one(value2) { + result.push(map(value2, line, !value2)); + } +} + +// node_modules/mdast-util-to-markdown/lib/util/pattern-compile.js +function patternCompile(pattern) { + if (!pattern._compiled) { + const before = (pattern.atBreak ? "[\\r\\n][\\t ]*" : "") + (pattern.before ? "(?:" + pattern.before + ")" : ""); + pattern._compiled = new RegExp( + (before ? "(" + before + ")" : "") + (/[|\\{}()[\]^$+*?.-]/.test(pattern.character) ? "\\" : "") + pattern.character + (pattern.after ? "(?:" + pattern.after + ")" : ""), + "g" + ); + } + return pattern._compiled; +} + +// node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js +function patternInScope(stack, pattern) { + return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false); +} +function listInScope(stack, list, none) { + if (!list) { + return none; + } + if (typeof list === "string") { + list = [list]; + } + let index = -1; + while (++index < list.length) { + if (stack.includes(list[index])) { + return true; + } + } + return false; +} + +// node_modules/mdast-util-to-markdown/lib/util/safe.js +function safe(context, input, config) { + const value = (config.before || "") + (input || "") + (config.after || ""); + const positions = []; + const result = []; + const infos = {}; + let index = -1; + while (++index < context.unsafe.length) { + const pattern = context.unsafe[index]; + if (!patternInScope(context.stack, pattern)) { + continue; + } + const expression = patternCompile(pattern); + let match; + while (match = expression.exec(value)) { + const before = "before" in pattern || Boolean(pattern.atBreak); + const after = "after" in pattern; + const position = match.index + (before ? match[1].length : 0); + if (positions.includes(position)) { + if (infos[position].before && !before) { + infos[position].before = false; + } + if (infos[position].after && !after) { + infos[position].after = false; + } + } else { + positions.push(position); + infos[position] = { before, after }; + } + } + } + positions.sort(numerical); + let start = config.before ? config.before.length : 0; + const end = value.length - (config.after ? config.after.length : 0); + index = -1; + while (++index < positions.length) { + const position = positions[index]; + if (position < start || position >= end) { + continue; + } + if (position + 1 < end && positions[index + 1] === position + 1 && infos[position].after && !infos[position + 1].before && !infos[position + 1].after || positions[index - 1] === position - 1 && infos[position].before && !infos[position - 1].before && !infos[position - 1].after) { + continue; + } + if (start !== position) { + result.push(escapeBackslashes(value.slice(start, position), "\\")); + } + start = position; + if (/[!-/:-@[-`{-~]/.test(value.charAt(position)) && (!config.encode || !config.encode.includes(value.charAt(position)))) { + result.push("\\"); + } else { + result.push( + "&#x" + value.charCodeAt(position).toString(16).toUpperCase() + ";" + ); + start++; + } + } + result.push(escapeBackslashes(value.slice(start, end), config.after)); + return result.join(""); +} +function numerical(a, b) { + return a - b; +} +function escapeBackslashes(value, after) { + const expression = /\\(?=[!-/:-@[-`{-~])/g; + const positions = []; + const results = []; + const whole = value + after; + let index = -1; + let start = 0; + let match; + while (match = expression.exec(whole)) { + positions.push(match.index); + } + while (++index < positions.length) { + if (start !== positions[index]) { + results.push(value.slice(start, positions[index])); + } + results.push("\\"); + start = positions[index]; + } + results.push(value.slice(start)); + return results.join(""); +} + +// node_modules/mdast-util-gfm-footnote/index.js +function gfmFootnoteFromMarkdown() { + return { + enter: { + gfmFootnoteDefinition: enterFootnoteDefinition, + gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString, + gfmFootnoteCall: enterFootnoteCall, + gfmFootnoteCallString: enterFootnoteCallString + }, + exit: { + gfmFootnoteDefinition: exitFootnoteDefinition, + gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString, + gfmFootnoteCall: exitFootnoteCall, + gfmFootnoteCallString: exitFootnoteCallString + } + }; + function enterFootnoteDefinition(token) { + this.enter( + { type: "footnoteDefinition", identifier: "", label: "", children: [] }, + token + ); + } + function enterFootnoteDefinitionLabelString() { + this.buffer(); + } + function exitFootnoteDefinitionLabelString(token) { + const label = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.label = label; + node.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase(); + } + function exitFootnoteDefinition(token) { + this.exit(token); + } + function enterFootnoteCall(token) { + this.enter({ type: "footnoteReference", identifier: "", label: "" }, token); + } + function enterFootnoteCallString() { + this.buffer(); + } + function exitFootnoteCallString(token) { + const label = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.label = label; + node.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase(); + } + function exitFootnoteCall(token) { + this.exit(token); + } +} +function gfmFootnoteToMarkdown() { + footnoteReference.peek = footnoteReferencePeek; + return { + unsafe: [{ character: "[", inConstruct: ["phrasing", "label", "reference"] }], + handlers: { footnoteDefinition, footnoteReference } + }; + function footnoteReference(node, _, context, safeOptions) { + const tracker = track(safeOptions); + let value = tracker.move("[^"); + const exit2 = context.enter("footnoteReference"); + const subexit = context.enter("reference"); + value += tracker.move( + safe(context, association(node), { + ...tracker.current(), + before: value, + after: "]" + }) + ); + subexit(); + exit2(); + value += tracker.move("]"); + return value; + } + function footnoteReferencePeek() { + return "["; + } + function footnoteDefinition(node, _, context, safeOptions) { + const tracker = track(safeOptions); + let value = tracker.move("[^"); + const exit2 = context.enter("footnoteDefinition"); + const subexit = context.enter("label"); + value += tracker.move( + safe(context, association(node), { + ...tracker.current(), + before: value, + after: "]" + }) + ); + subexit(); + value += tracker.move( + "]:" + (node.children && node.children.length > 0 ? " " : "") + ); + tracker.shift(4); + value += tracker.move( + indentLines(containerFlow(node, context, tracker.current()), map) + ); + exit2(); + return value; + function map(line, index, blank) { + if (index) { + return (blank ? "" : " ") + line; + } + return line; + } + } +} + +// node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +function containerPhrasing(parent, context, safeOptions) { + const indexStack = context.indexStack; + const children = parent.children || []; + const results = []; + let index = -1; + let before = safeOptions.before; + indexStack.push(-1); + let tracker = track(safeOptions); + while (++index < children.length) { + const child = children[index]; + let after; + indexStack[indexStack.length - 1] = index; + if (index + 1 < children.length) { + let handle = context.handle.handlers[children[index + 1].type]; + if (handle && handle.peek) + handle = handle.peek; + after = handle ? handle(children[index + 1], parent, context, { + before: "", + after: "", + ...tracker.current() + }).charAt(0) : ""; + } else { + after = safeOptions.after; + } + if (results.length > 0 && (before === "\r" || before === "\n") && child.type === "html") { + results[results.length - 1] = results[results.length - 1].replace( + /(\r?\n|\r)$/, + " " + ); + before = " "; + tracker = track(safeOptions); + tracker.move(results.join("")); + } + results.push( + tracker.move( + context.handle(child, parent, context, { + ...tracker.current(), + before, + after + }) + ) + ); + before = results[results.length - 1].slice(-1); + } + indexStack.pop(); + return results.join(""); +} + +// node_modules/mdast-util-gfm-strikethrough/index.js +var gfmStrikethroughFromMarkdown = { + canContainEols: ["delete"], + enter: { strikethrough: enterStrikethrough }, + exit: { strikethrough: exitStrikethrough } +}; +var gfmStrikethroughToMarkdown = { + unsafe: [{ character: "~", inConstruct: "phrasing" }], + handlers: { delete: handleDelete } +}; +handleDelete.peek = peekDelete; +function enterStrikethrough(token) { + this.enter({ type: "delete", children: [] }, token); +} +function exitStrikethrough(token) { + this.exit(token); +} +function handleDelete(node, _, context, safeOptions) { + const tracker = track(safeOptions); + const exit2 = context.enter("emphasis"); + let value = tracker.move("~~"); + value += containerPhrasing(node, context, { + ...tracker.current(), + before: value, + after: "~" + }); + value += tracker.move("~~"); + exit2(); + return value; +} +function peekDelete() { + return "~"; +} + +// node_modules/mdast-util-to-markdown/lib/handle/inline-code.js +inlineCode.peek = inlineCodePeek; +function inlineCode(node, _, context) { + let value = node.value || ""; + let sequence = "`"; + let index = -1; + while (new RegExp("(^|[^`])" + sequence + "([^`]|$)").test(value)) { + sequence += "`"; + } + if (/[^ \r\n]/.test(value) && (/^[ \r\n]/.test(value) && /[ \r\n]$/.test(value) || /^`|`$/.test(value))) { + value = " " + value + " "; + } + while (++index < context.unsafe.length) { + const pattern = context.unsafe[index]; + const expression = patternCompile(pattern); + let match; + if (!pattern.atBreak) + continue; + while (match = expression.exec(value)) { + let position = match.index; + if (value.charCodeAt(position) === 10 && value.charCodeAt(position - 1) === 13) { + position--; + } + value = value.slice(0, position) + " " + value.slice(match.index + 1); + } + } + return sequence + value + sequence; +} +function inlineCodePeek() { + return "`"; +} + +// node_modules/mdast-util-gfm-table/node_modules/markdown-table/index.js +function markdownTable(table, options = {}) { + const align = (options.align || []).concat(); + const stringLength = options.stringLength || defaultStringLength; + const alignments = []; + const cellMatrix = []; + const sizeMatrix = []; + const longestCellByColumn = []; + let mostCellsPerRow = 0; + let rowIndex = -1; + while (++rowIndex < table.length) { + const row2 = []; + const sizes2 = []; + let columnIndex2 = -1; + if (table[rowIndex].length > mostCellsPerRow) { + mostCellsPerRow = table[rowIndex].length; + } + while (++columnIndex2 < table[rowIndex].length) { + const cell = serialize(table[rowIndex][columnIndex2]); + if (options.alignDelimiters !== false) { + const size = stringLength(cell); + sizes2[columnIndex2] = size; + if (longestCellByColumn[columnIndex2] === void 0 || size > longestCellByColumn[columnIndex2]) { + longestCellByColumn[columnIndex2] = size; + } + } + row2.push(cell); + } + cellMatrix[rowIndex] = row2; + sizeMatrix[rowIndex] = sizes2; + } + let columnIndex = -1; + if (typeof align === "object" && "length" in align) { + while (++columnIndex < mostCellsPerRow) { + alignments[columnIndex] = toAlignment(align[columnIndex]); + } + } else { + const code2 = toAlignment(align); + while (++columnIndex < mostCellsPerRow) { + alignments[columnIndex] = code2; + } + } + columnIndex = -1; + const row = []; + const sizes = []; + while (++columnIndex < mostCellsPerRow) { + const code2 = alignments[columnIndex]; + let before = ""; + let after = ""; + if (code2 === 99) { + before = ":"; + after = ":"; + } else if (code2 === 108) { + before = ":"; + } else if (code2 === 114) { + after = ":"; + } + let size = options.alignDelimiters === false ? 1 : Math.max( + 1, + longestCellByColumn[columnIndex] - before.length - after.length + ); + const cell = before + "-".repeat(size) + after; + if (options.alignDelimiters !== false) { + size = before.length + size + after.length; + if (size > longestCellByColumn[columnIndex]) { + longestCellByColumn[columnIndex] = size; + } + sizes[columnIndex] = size; + } + row[columnIndex] = cell; + } + cellMatrix.splice(1, 0, row); + sizeMatrix.splice(1, 0, sizes); + rowIndex = -1; + const lines = []; + while (++rowIndex < cellMatrix.length) { + const row2 = cellMatrix[rowIndex]; + const sizes2 = sizeMatrix[rowIndex]; + columnIndex = -1; + const line = []; + while (++columnIndex < mostCellsPerRow) { + const cell = row2[columnIndex] || ""; + let before = ""; + let after = ""; + if (options.alignDelimiters !== false) { + const size = longestCellByColumn[columnIndex] - (sizes2[columnIndex] || 0); + const code2 = alignments[columnIndex]; + if (code2 === 114) { + before = " ".repeat(size); + } else if (code2 === 99) { + if (size % 2) { + before = " ".repeat(size / 2 + 0.5); + after = " ".repeat(size / 2 - 0.5); + } else { + before = " ".repeat(size / 2); + after = before; + } + } else { + after = " ".repeat(size); + } + } + if (options.delimiterStart !== false && !columnIndex) { + line.push("|"); + } + if (options.padding !== false && !(options.alignDelimiters === false && cell === "") && (options.delimiterStart !== false || columnIndex)) { + line.push(" "); + } + if (options.alignDelimiters !== false) { + line.push(before); + } + line.push(cell); + if (options.alignDelimiters !== false) { + line.push(after); + } + if (options.padding !== false) { + line.push(" "); + } + if (options.delimiterEnd !== false || columnIndex !== mostCellsPerRow - 1) { + line.push("|"); + } + } + lines.push( + options.delimiterEnd === false ? line.join("").replace(/ +$/, "") : line.join("") + ); + } + return lines.join("\n"); +} +function serialize(value) { + return value === null || value === void 0 ? "" : String(value); +} +function defaultStringLength(value) { + return value.length; +} +function toAlignment(value) { + const code2 = typeof value === "string" ? value.codePointAt(0) : 0; + return code2 === 67 || code2 === 99 ? 99 : code2 === 76 || code2 === 108 ? 108 : code2 === 82 || code2 === 114 ? 114 : 0; +} + +// node_modules/mdast-util-gfm-table/lib/index.js +var gfmTableFromMarkdown = { + enter: { + table: enterTable, + tableData: enterCell, + tableHeader: enterCell, + tableRow: enterRow + }, + exit: { + codeText: exitCodeText, + table: exitTable, + tableData: exit, + tableHeader: exit, + tableRow: exit + } +}; +function enterTable(token) { + const align = token._align; + this.enter( + { + type: "table", + align: align.map((d) => d === "none" ? null : d), + children: [] + }, + token + ); + this.setData("inTable", true); +} +function exitTable(token) { + this.exit(token); + this.setData("inTable"); +} +function enterRow(token) { + this.enter({ type: "tableRow", children: [] }, token); +} +function exit(token) { + this.exit(token); +} +function enterCell(token) { + this.enter({ type: "tableCell", children: [] }, token); +} +function exitCodeText(token) { + let value = this.resume(); + if (this.getData("inTable")) { + value = value.replace(/\\([\\|])/g, replace); + } + const node = this.stack[this.stack.length - 1]; + node.value = value; + this.exit(token); +} +function replace($0, $1) { + return $1 === "|" ? $1 : $0; +} +function gfmTableToMarkdown(options) { + const settings = options || {}; + const padding = settings.tableCellPadding; + const alignDelimiters = settings.tablePipeAlign; + const stringLength = settings.stringLength; + const around = padding ? " " : "|"; + return { + unsafe: [ + { character: "\r", inConstruct: "tableCell" }, + { character: "\n", inConstruct: "tableCell" }, + { atBreak: true, character: "|", after: "[ :-]" }, + { character: "|", inConstruct: "tableCell" }, + { atBreak: true, character: ":", after: "-" }, + { atBreak: true, character: "-", after: "[:|-]" } + ], + handlers: { + table: handleTable, + tableRow: handleTableRow, + tableCell: handleTableCell, + inlineCode: inlineCodeWithTable + } + }; + function handleTable(node, _, context, safeOptions) { + return serializeData( + handleTableAsData(node, context, safeOptions), + node.align + ); + } + function handleTableRow(node, _, context, safeOptions) { + const row = handleTableRowAsData(node, context, safeOptions); + const value = serializeData([row]); + return value.slice(0, value.indexOf("\n")); + } + function handleTableCell(node, _, context, safeOptions) { + const exit2 = context.enter("tableCell"); + const subexit = context.enter("phrasing"); + const value = containerPhrasing(node, context, { + ...safeOptions, + before: around, + after: around + }); + subexit(); + exit2(); + return value; + } + function serializeData(matrix, align) { + return markdownTable(matrix, { + align, + alignDelimiters, + padding, + stringLength + }); + } + function handleTableAsData(node, context, safeOptions) { + const children = node.children; + let index = -1; + const result = []; + const subexit = context.enter("table"); + while (++index < children.length) { + result[index] = handleTableRowAsData( + children[index], + context, + safeOptions + ); + } + subexit(); + return result; + } + function handleTableRowAsData(node, context, safeOptions) { + const children = node.children; + let index = -1; + const result = []; + const subexit = context.enter("tableRow"); + while (++index < children.length) { + result[index] = handleTableCell( + children[index], + node, + context, + safeOptions + ); + } + subexit(); + return result; + } + function inlineCodeWithTable(node, parent, context) { + let value = inlineCode(node, parent, context); + if (context.stack.includes("tableCell")) { + value = value.replace(/\|/g, "\\$&"); + } + return value; + } +} + +// node_modules/mdast-util-to-markdown/lib/util/check-bullet.js +function checkBullet(context) { + const marker = context.options.bullet || "*"; + if (marker !== "*" && marker !== "+" && marker !== "-") { + throw new Error( + "Cannot serialize items with `" + marker + "` for `options.bullet`, expected `*`, `+`, or `-`" + ); + } + return marker; +} + +// node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js +function checkListItemIndent(context) { + const style = context.options.listItemIndent || "tab"; + if (style === 1 || style === "1") { + return "one"; + } + if (style !== "tab" && style !== "one" && style !== "mixed") { + throw new Error( + "Cannot serialize items with `" + style + "` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`" + ); + } + return style; +} + +// node_modules/mdast-util-to-markdown/lib/handle/list-item.js +function listItem(node, parent, context, safeOptions) { + const listItemIndent = checkListItemIndent(context); + let bullet = context.bulletCurrent || checkBullet(context); + if (parent && parent.type === "list" && parent.ordered) { + bullet = (typeof parent.start === "number" && parent.start > -1 ? parent.start : 1) + (context.options.incrementListMarker === false ? 0 : parent.children.indexOf(node)) + bullet; + } + let size = bullet.length + 1; + if (listItemIndent === "tab" || listItemIndent === "mixed" && (parent && parent.type === "list" && parent.spread || node.spread)) { + size = Math.ceil(size / 4) * 4; + } + const tracker = track(safeOptions); + tracker.move(bullet + " ".repeat(size - bullet.length)); + tracker.shift(size); + const exit2 = context.enter("listItem"); + const value = indentLines( + containerFlow(node, context, tracker.current()), + map + ); + exit2(); + return value; + function map(line, index, blank) { + if (index) { + return (blank ? "" : " ".repeat(size)) + line; + } + return (blank ? bullet : bullet + " ".repeat(size - bullet.length)) + line; + } +} + +// node_modules/mdast-util-gfm-task-list-item/index.js +var gfmTaskListItemFromMarkdown = { + exit: { + taskListCheckValueChecked: exitCheck, + taskListCheckValueUnchecked: exitCheck, + paragraph: exitParagraphWithTaskListItem + } +}; +var gfmTaskListItemToMarkdown = { + unsafe: [{ atBreak: true, character: "-", after: "[:|-]" }], + handlers: { listItem: listItemWithTaskListItem } +}; +function exitCheck(token) { + const node = this.stack[this.stack.length - 2]; + node.checked = token.type === "taskListCheckValueChecked"; +} +function exitParagraphWithTaskListItem(token) { + const parent = this.stack[this.stack.length - 2]; + const node = this.stack[this.stack.length - 1]; + const siblings = parent.children; + const head = node.children[0]; + let index = -1; + let firstParaghraph; + if (parent && parent.type === "listItem" && typeof parent.checked === "boolean" && head && head.type === "text") { + while (++index < siblings.length) { + const sibling = siblings[index]; + if (sibling.type === "paragraph") { + firstParaghraph = sibling; + break; + } + } + if (firstParaghraph === node) { + head.value = head.value.slice(1); + if (head.value.length === 0) { + node.children.shift(); + } else if (node.position && head.position && typeof head.position.start.offset === "number") { + head.position.start.column++; + head.position.start.offset++; + node.position.start = Object.assign({}, head.position.start); + } + } + } + this.exit(token); +} +function listItemWithTaskListItem(node, parent, context, safeOptions) { + const head = node.children[0]; + const checkable = typeof node.checked === "boolean" && head && head.type === "paragraph"; + const checkbox = "[" + (node.checked ? "x" : " ") + "] "; + const tracker = track(safeOptions); + if (checkable) { + tracker.move(checkbox); + } + let value = listItem(node, parent, context, { + ...safeOptions, + ...tracker.current() + }); + if (checkable) { + value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check); + } + return value; + function check($0) { + return $0 + checkbox; + } +} + +// node_modules/mdast-util-gfm/lib/index.js +function gfmFromMarkdown() { + return [ + gfmAutolinkLiteralFromMarkdown, + gfmFootnoteFromMarkdown(), + gfmStrikethroughFromMarkdown, + gfmTableFromMarkdown, + gfmTaskListItemFromMarkdown + ]; +} +function gfmToMarkdown(options) { + return { + extensions: [ + gfmAutolinkLiteralToMarkdown, + gfmFootnoteToMarkdown(), + gfmStrikethroughToMarkdown, + gfmTableToMarkdown(options), + gfmTaskListItemToMarkdown + ] + }; +} + +// node_modules/remark-gfm/index.js +function remarkGfm(options = {}) { + const data = this.data(); + add("micromarkExtensions", gfm(options)); + add("fromMarkdownExtensions", gfmFromMarkdown()); + add("toMarkdownExtensions", gfmToMarkdown(options)); + function add(field, value) { + const list = data[field] ? data[field] : data[field] = []; + list.push(value); + } +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = {}); From 80cbd0ff1e9536ecbcd0b187ef4b09f769a2a356 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 16:16:35 +0100 Subject: [PATCH 053/155] fix TOC tests --- .../__tests__/__snapshots__/index.test.ts.snap | 18 +++++++++--------- .../src/remark/toc/__tests__/index.test.ts | 9 ++++++--- .../src/remark/utils/index.ts | 4 ++++ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/__snapshots__/index.test.ts.snap index ba71805a2ab5..8af155e2c96d 100644 --- a/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/__snapshots__/index.test.ts.snap @@ -45,7 +45,7 @@ exports[`toc remark plugin escapes inline code 1`] = ` id: 'divitestidiv-1', level: 2 } -]; +] ## \`\` @@ -78,7 +78,7 @@ exports[`toc remark plugin exports even with existing name 1`] = ` id: 'avengers', level: 3 } -]; +] ## Thanos @@ -89,11 +89,11 @@ exports[`toc remark plugin exports even with existing name 1`] = ` `; exports[`toc remark plugin handles empty headings 1`] = ` -"export const toc = []; +"export const toc = [] # Ignore this -## +## ## ![](an-image.svg) " @@ -120,7 +120,7 @@ export const toc = [ id: 'again', level: 3 } -]; +] ## Title @@ -133,7 +133,7 @@ Content. `; exports[`toc remark plugin outputs empty array for no TOC 1`] = ` -"export const toc = []; +"export const toc = [] foo @@ -172,9 +172,9 @@ exports[`toc remark plugin works on non text phrasing content 1`] = ` id: 'inlinecode', level: 2 } -]; +] -## _Emphasis_ +## *Emphasis* ### **Importance** @@ -208,7 +208,7 @@ exports[`toc remark plugin works on text content 1`] = ` id: 'i--unicode', level: 2 } -]; +] ### Endi diff --git a/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/index.test.ts index 004d4949fef4..0468feea1d40 100644 --- a/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/toc/__tests__/index.test.ts @@ -11,17 +11,20 @@ import plugin from '../index'; import headings from '../../headings/index'; const processFixture = async (name: string) => { - const remark = (await import('remark')).default; - const mdx = (await import('remark-mdx')).default; + const {remark} = await import('remark'); + const {default: gfm} = await import('remark-gfm'); + const {default: mdx} = await import('remark-mdx'); + const filePath = path.join(__dirname, '__fixtures__', `${name}.md`); const file = await vfile.read(filePath); const result = await remark() .use(headings) + .use(gfm) .use(mdx) .use(plugin) .process(file); - return result.toString(); + return result.value; }; describe('toc remark plugin', () => { diff --git a/packages/docusaurus-mdx-loader/src/remark/utils/index.ts b/packages/docusaurus-mdx-loader/src/remark/utils/index.ts index ef24c7847344..6f907ba8e4df 100644 --- a/packages/docusaurus-mdx-loader/src/remark/utils/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/utils/index.ts @@ -23,6 +23,10 @@ export function toValue( toString: (param: unknown) => string, // TODO weird but works ): string { switch (node.type) { + // @ts-expect-error: todo types + case 'mdxJsxTextElement': + const tag = (node as any).name; + return `<${tag}>${stringifyContent(node, toString)}`; case 'text': return escapeHtml(node.value); case 'heading': From f8ad8ac9935d9dc783d23a526557a5afb4aaef50 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 16:27:10 +0100 Subject: [PATCH 054/155] fix remark headings tests --- .../remark/headings/__tests__/index.test.ts | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/headings/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/headings/__tests__/index.test.ts index 47a31c836fc8..f43a90601d3a 100644 --- a/packages/docusaurus-mdx-loader/src/remark/headings/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/headings/__tests__/index.test.ts @@ -7,18 +7,18 @@ /* Based on remark-slug (https://github.com/remarkjs/remark-slug) and gatsby-remark-autolink-headers (https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-remark-autolink-headers) */ -import remark from 'remark'; import u from 'unist-builder'; import removePosition from 'unist-util-remove-position'; -import toString from 'mdast-util-to-string'; +import {toString} from 'mdast-util-to-string'; import visit from 'unist-util-visit'; import slug from '../index'; import type {Plugin} from 'unified'; import type {Parent} from 'unist'; -function process(doc: string, plugins: Plugin[] = []) { - const processor = remark().use({plugins: [...plugins, slug]}); - return removePosition(processor.runSync(processor.parse(doc)), true); +async function process(doc: string, plugins: Plugin[] = []) { + const {remark} = await import('remark'); + const processor = await remark().use({plugins: [...plugins, slug]}); + return removePosition(await processor.run(processor.parse(doc)), true); } function heading(label: string | null, id: string) { @@ -30,8 +30,8 @@ function heading(label: string | null, id: string) { } describe('headings remark plugin', () => { - it('patches `id`s and `data.hProperties.id', () => { - const result = process('# Normal\n\n## Table of Contents\n\n# Baz\n'); + it('patches `id`s and `data.hProperties.id', async () => { + const result = await process('# Normal\n\n## Table of Contents\n\n# Baz\n'); const expected = u('root', [ u( 'heading', @@ -57,8 +57,8 @@ describe('headings remark plugin', () => { expect(result).toEqual(expected); }); - it('does not overwrite `data` on headings', () => { - const result = process('# Normal\n', [ + it('does not overwrite `data` on headings', async () => { + const result = await process('# Normal\n', [ () => (root) => { (root as Parent).children[0]!.data = {foo: 'bar'}; }, @@ -77,8 +77,8 @@ describe('headings remark plugin', () => { expect(result).toEqual(expected); }); - it('does not overwrite `data.hProperties` on headings', () => { - const result = process('# Normal\n', [ + it('does not overwrite `data.hProperties` on headings', async () => { + const result = await process('# Normal\n', [ () => (root) => { (root as Parent).children[0]!.data = { hProperties: {className: ['foo']}, @@ -99,8 +99,8 @@ describe('headings remark plugin', () => { expect(result).toEqual(expected); }); - it('generates `id`s and `hProperties.id`s, based on `hProperties.id` if they exist', () => { - const result = process( + it('generates `id`s and `hProperties.id`s, based on `hProperties.id` if they exist', async () => { + const result = await process( [ '## Something', '## Something here', @@ -152,8 +152,8 @@ describe('headings remark plugin', () => { expect(result).toEqual(expected); }); - it('creates GitHub-style headings ids', () => { - const result = process( + it('creates GitHub-style headings ids', async () => { + const result = await process( [ '## I ♥ unicode', '', @@ -223,8 +223,10 @@ describe('headings remark plugin', () => { expect(result).toEqual(expected); }); - it('generates id from only text contents of headings if they contains HTML tags', () => { - const result = process('# Normal\n'); + it('generates id from only text contents of headings if they contains HTML tags', async () => { + const result = await process( + '# Normal\n', + ); const expected = u('root', [ u( 'heading', @@ -243,8 +245,8 @@ describe('headings remark plugin', () => { expect(result).toEqual(expected); }); - it('creates custom headings ids', () => { - const result = process(` + it('creates custom headings ids', async () => { + const result = await process(` # Heading One {#custom_h1} ## Heading Two {#custom-heading-two} From 557d3d0cc882563e336c4e59a20457e01fadae66 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 16:30:22 +0100 Subject: [PATCH 055/155] delete older unwrapMdxCodeBlocks impl --- .../__fixtures__/has-mdx-code-blocks.mdx | 95 -- .../__snapshots__/index.test.ts.snap | 819 ------------------ .../__tests__/index.test.ts | 38 - .../src/remark/unwrapMdxCodeBlocks/index.ts | 35 - 4 files changed, 987 deletions(-) delete mode 100644 packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__fixtures__/has-mdx-code-blocks.mdx delete mode 100644 packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__snapshots__/index.test.ts.snap delete mode 100644 packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/index.test.ts delete mode 100644 packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/index.ts diff --git a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__fixtures__/has-mdx-code-blocks.mdx b/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__fixtures__/has-mdx-code-blocks.mdx deleted file mode 100644 index bf3ea16967f8..000000000000 --- a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__fixtures__/has-mdx-code-blocks.mdx +++ /dev/null @@ -1,95 +0,0 @@ -# MDX code blocks test document - -## Some basic markdown - -text - -[link](https://facebook.com) - -**bold** - -![image](https://facebook.com/favicon.ico) - -## Some basic MDX - -import XYZ from 'xyz'; - - - Test - - -## Some basic MDX code block - -```mdx-code-block -import Avatar from 'avatar'; - - -
Sebastien Lorber
-
-``` - -## Some complex MDX with nested code blocks - - - - -```bash -GIT_USER= yarn deploy -``` - - - - - ```batch - cmd /C "set "GIT_USER=" && yarn deploy" - ``` - - - - -```powershell -cmd /C 'set "GIT_USER=" && yarn deploy' -``` - - - - -## Some complex MDX code block with nested code blocks - -````mdx-code-block - - - -```bash -GIT_USER= yarn deploy -``` - - - - -```batch -cmd /C "set "GIT_USER=" && yarn deploy" -``` - - - - -```powershell -cmd /C 'set "GIT_USER=" && yarn deploy' -``` - - - -```` diff --git a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__snapshots__/index.test.ts.snap deleted file mode 100644 index 9b8ed7b0ada3..000000000000 --- a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/__snapshots__/index.test.ts.snap +++ /dev/null @@ -1,819 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`unwrapMdxCodeBlocks remark plugin unwraps the mdx code blocks 1`] = ` -"# MDX code blocks test document - -## Some basic markdown - -text - -[link](https://facebook.com) - -**bold** - -![image](https://facebook.com/favicon.ico) - -## Some basic MDX - -import XYZ from 'xyz'; - - - Test - - -## Some basic MDX code block - -import Avatar from 'avatar'; - - -
Sebastien Lorber
-
- -## Some complex MDX with nested code blocks - - - - -\`\`\`bash -GIT_USER= yarn deploy -\`\`\` - - - - - \`\`\`batch - cmd /C "set "GIT_USER=" && yarn deploy" - \`\`\` - - - - -\`\`\`powershell -cmd /C 'set "GIT_USER=" && yarn deploy' -\`\`\` - - - - -## Some complex MDX code block with nested code blocks - - - - -\`\`\`bash -GIT_USER= yarn deploy -\`\`\` - - - - -\`\`\`batch -cmd /C "set "GIT_USER=" && yarn deploy" -\`\`\` - - - - -\`\`\`powershell -cmd /C 'set "GIT_USER=" && yarn deploy' -\`\`\` - - - -" -`; - -exports[`unwrapMdxCodeBlocks remark plugin unwraps the mdx code blocks AST 1`] = ` -{ - "children": [ - { - "children": [ - { - "position": Position { - "end": { - "column": 32, - "line": 1, - "offset": 31, - }, - "indent": [], - "start": { - "column": 3, - "line": 1, - "offset": 2, - }, - }, - "type": "text", - "value": "MDX code blocks test document", - }, - ], - "depth": 1, - "position": Position { - "end": { - "column": 32, - "line": 1, - "offset": 31, - }, - "indent": [], - "start": { - "column": 1, - "line": 1, - "offset": 0, - }, - }, - "type": "heading", - }, - { - "children": [ - { - "position": Position { - "end": { - "column": 23, - "line": 3, - "offset": 55, - }, - "indent": [], - "start": { - "column": 4, - "line": 3, - "offset": 36, - }, - }, - "type": "text", - "value": "Some basic markdown", - }, - ], - "depth": 2, - "position": Position { - "end": { - "column": 23, - "line": 3, - "offset": 55, - }, - "indent": [], - "start": { - "column": 1, - "line": 3, - "offset": 33, - }, - }, - "type": "heading", - }, - { - "children": [ - { - "position": Position { - "end": { - "column": 5, - "line": 5, - "offset": 61, - }, - "indent": [], - "start": { - "column": 1, - "line": 5, - "offset": 57, - }, - }, - "type": "text", - "value": "text", - }, - ], - "position": Position { - "end": { - "column": 5, - "line": 5, - "offset": 61, - }, - "indent": [], - "start": { - "column": 1, - "line": 5, - "offset": 57, - }, - }, - "type": "paragraph", - }, - { - "children": [ - { - "children": [ - { - "position": Position { - "end": { - "column": 6, - "line": 7, - "offset": 68, - }, - "indent": [], - "start": { - "column": 2, - "line": 7, - "offset": 64, - }, - }, - "type": "text", - "value": "link", - }, - ], - "position": Position { - "end": { - "column": 29, - "line": 7, - "offset": 91, - }, - "indent": [], - "start": { - "column": 1, - "line": 7, - "offset": 63, - }, - }, - "title": null, - "type": "link", - "url": "https://facebook.com", - }, - ], - "position": Position { - "end": { - "column": 29, - "line": 7, - "offset": 91, - }, - "indent": [], - "start": { - "column": 1, - "line": 7, - "offset": 63, - }, - }, - "type": "paragraph", - }, - { - "children": [ - { - "children": [ - { - "position": Position { - "end": { - "column": 7, - "line": 9, - "offset": 99, - }, - "indent": [], - "start": { - "column": 3, - "line": 9, - "offset": 95, - }, - }, - "type": "text", - "value": "bold", - }, - ], - "position": Position { - "end": { - "column": 9, - "line": 9, - "offset": 101, - }, - "indent": [], - "start": { - "column": 1, - "line": 9, - "offset": 93, - }, - }, - "type": "strong", - }, - ], - "position": Position { - "end": { - "column": 9, - "line": 9, - "offset": 101, - }, - "indent": [], - "start": { - "column": 1, - "line": 9, - "offset": 93, - }, - }, - "type": "paragraph", - }, - { - "children": [ - { - "alt": "image", - "position": Position { - "end": { - "column": 43, - "line": 11, - "offset": 145, - }, - "indent": [], - "start": { - "column": 1, - "line": 11, - "offset": 103, - }, - }, - "title": null, - "type": "image", - "url": "https://facebook.com/favicon.ico", - }, - ], - "position": Position { - "end": { - "column": 43, - "line": 11, - "offset": 145, - }, - "indent": [], - "start": { - "column": 1, - "line": 11, - "offset": 103, - }, - }, - "type": "paragraph", - }, - { - "children": [ - { - "position": Position { - "end": { - "column": 18, - "line": 13, - "offset": 164, - }, - "indent": [], - "start": { - "column": 4, - "line": 13, - "offset": 150, - }, - }, - "type": "text", - "value": "Some basic MDX", - }, - ], - "depth": 2, - "position": Position { - "end": { - "column": 18, - "line": 13, - "offset": 164, - }, - "indent": [], - "start": { - "column": 1, - "line": 13, - "offset": 147, - }, - }, - "type": "heading", - }, - { - "position": Position { - "end": { - "column": 23, - "line": 15, - "offset": 188, - }, - "indent": [], - "start": { - "column": 1, - "line": 15, - "offset": 166, - }, - }, - "type": "import", - "value": "import XYZ from 'xyz';", - }, - { - "position": Position { - "end": { - "column": 7, - "line": 19, - "offset": 287, - }, - "indent": [ - 1, - 1, - ], - "start": { - "column": 1, - "line": 17, - "offset": 190, - }, - }, - "type": "jsx", - "value": " - Test -", - }, - { - "children": [ - { - "position": Position { - "end": { - "column": 29, - "line": 21, - "offset": 317, - }, - "indent": [], - "start": { - "column": 4, - "line": 21, - "offset": 292, - }, - }, - "type": "text", - "value": "Some basic MDX code block", - }, - ], - "depth": 2, - "position": Position { - "end": { - "column": 29, - "line": 21, - "offset": 317, - }, - "indent": [], - "start": { - "column": 1, - "line": 21, - "offset": 289, - }, - }, - "type": "heading", - }, - { - "lang": "mdx-code-block", - "meta": null, - "position": Position { - "end": { - "column": 4, - "line": 29, - "offset": 442, - }, - "indent": [ - 1, - 1, - 1, - 1, - 1, - 1, - ], - "start": { - "column": 1, - "line": 23, - "offset": 319, - }, - }, - "type": "code", - "value": "import Avatar from 'avatar'; - - -
Sebastien Lorber
-
", - }, - { - "children": [ - { - "position": Position { - "end": { - "column": 44, - "line": 31, - "offset": 487, - }, - "indent": [], - "start": { - "column": 4, - "line": 31, - "offset": 447, - }, - }, - "type": "text", - "value": "Some complex MDX with nested code blocks", - }, - ], - "depth": 2, - "position": Position { - "end": { - "column": 44, - "line": 31, - "offset": 487, - }, - "indent": [], - "start": { - "column": 1, - "line": 31, - "offset": 444, - }, - }, - "type": "heading", - }, - { - "position": Position { - "end": { - "column": 25, - "line": 40, - "offset": 688, - }, - "indent": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - ], - "start": { - "column": 1, - "line": 33, - "offset": 489, - }, - }, - "type": "jsx", - "value": " - ", - }, - { - "lang": "bash", - "meta": null, - "position": Position { - "end": { - "column": 4, - "line": 44, - "offset": 740, - }, - "indent": [ - 1, - 1, - ], - "start": { - "column": 1, - "line": 42, - "offset": 690, - }, - }, - "type": "code", - "value": "GIT_USER= yarn deploy", - }, - { - "position": Position { - "end": { - "column": 28, - "line": 47, - "offset": 782, - }, - "indent": [ - 1, - ], - "start": { - "column": 1, - "line": 46, - "offset": 742, - }, - }, - "type": "jsx", - "value": " - ", - }, - { - "lang": null, - "meta": null, - "position": Position { - "end": { - "column": 8, - "line": 51, - "offset": 865, - }, - "indent": [ - 1, - 1, - ], - "start": { - "column": 1, - "line": 49, - "offset": 784, - }, - }, - "type": "code", - "value": "\`\`\`batch -cmd /C "set "GIT_USER=" && yarn deploy" -\`\`\`", - }, - { - "position": Position { - "end": { - "column": 31, - "line": 54, - "offset": 910, - }, - "indent": [ - 1, - ], - "start": { - "column": 1, - "line": 53, - "offset": 867, - }, - }, - "type": "jsx", - "value": " - ", - }, - { - "lang": "powershell", - "meta": null, - "position": Position { - "end": { - "column": 4, - "line": 58, - "offset": 986, - }, - "indent": [ - 1, - 1, - ], - "start": { - "column": 1, - "line": 56, - "offset": 912, - }, - }, - "type": "code", - "value": "cmd /C 'set "GIT_USER=" && yarn deploy'", - }, - { - "position": Position { - "end": { - "column": 8, - "line": 61, - "offset": 1008, - }, - "indent": [ - 1, - ], - "start": { - "column": 1, - "line": 60, - "offset": 988, - }, - }, - "type": "jsx", - "value": " -", - }, - { - "children": [ - { - "position": Position { - "end": { - "column": 55, - "line": 63, - "offset": 1064, - }, - "indent": [], - "start": { - "column": 4, - "line": 63, - "offset": 1013, - }, - }, - "type": "text", - "value": "Some complex MDX code block with nested code blocks", - }, - ], - "depth": 2, - "position": Position { - "end": { - "column": 55, - "line": 63, - "offset": 1064, - }, - "indent": [], - "start": { - "column": 1, - "line": 63, - "offset": 1010, - }, - }, - "type": "heading", - }, - { - "lang": "mdx-code-block", - "meta": null, - "position": Position { - "end": { - "column": 5, - "line": 95, - "offset": 1585, - }, - "indent": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - ], - "start": { - "column": 1, - "line": 65, - "offset": 1066, - }, - }, - "type": "code", - "value": " - - -\`\`\`bash -GIT_USER= yarn deploy -\`\`\` - - - - -\`\`\`batch -cmd /C "set "GIT_USER=" && yarn deploy" -\`\`\` - - - - -\`\`\`powershell -cmd /C 'set "GIT_USER=" && yarn deploy' -\`\`\` - - -", - }, - ], - "position": { - "end": { - "column": 1, - "line": 96, - "offset": 1586, - }, - "start": { - "column": 1, - "line": 1, - "offset": 0, - }, - }, - "type": "root", -} -`; diff --git a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/index.test.ts deleted file mode 100644 index 32340947f565..000000000000 --- a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/__tests__/index.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import path from 'path'; -import vfile from 'to-vfile'; -import plugin from '..'; - -const processFixture = async (name: string) => { - const remark = (await import('remark')).default; - const mdx = (await import('remark-mdx')).default; - const file = await vfile.read(path.join(__dirname, '__fixtures__', name)); - const result = await remark().use(mdx).use(plugin).process(file); - return result.toString(); -}; - -const processFixtureAST = async (name: string) => { - const remark = (await import('remark')).default; - const mdx = (await import('remark-mdx')).default; - const file = await vfile.read(path.join(__dirname, '__fixtures__', name)); - return remark().use(mdx).use(plugin).parse(file); -}; - -describe('unwrapMdxCodeBlocks remark plugin', () => { - it('unwraps the mdx code blocks', async () => { - const result = await processFixture('has-mdx-code-blocks.mdx'); - expect(result).toMatchSnapshot(); - }); - - // The AST output should be parsed correctly or the MDX loader won't work! - it('unwraps the mdx code blocks AST', async () => { - const result = await processFixtureAST('has-mdx-code-blocks.mdx'); - expect(result).toMatchSnapshot(); - }); -}); diff --git a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/index.ts b/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/index.ts deleted file mode 100644 index aa122ef1a91a..000000000000 --- a/packages/docusaurus-mdx-loader/src/remark/unwrapMdxCodeBlocks/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import visit from 'unist-util-visit'; -import type {Transformer, Processor} from 'unified'; -import type {Code, Parent} from 'mdast'; - -// TODO to delete? Doesn't work with mdx 2 - -// This plugin is mostly to help integrating Docusaurus with translation systems -// that do not support well MDX embedded JSX syntax (like Crowdin). -// We wrap the JSX syntax in code blocks so that translation tools don't mess up -// with the markup, but the JSX inside such code blocks should still be -// evaluated as JSX -// See https://github.com/facebook/docusaurus/pull/4278 -export default function plugin(this: Processor): Transformer { - return (root) => { - visit(root, 'code', (node: Code, index, parent) => { - if (node.lang === 'mdx-code-block') { - const newChildren = (this.parse(node.value) as Parent).children; - - // Replace the mdx code block by its content, parsed - parent!.children.splice( - parent!.children.indexOf(node), - 1, - ...newChildren, - ); - } - }); - }; -} From 033e4d8ded7a02ceb487ac9d511a8fd0b74b4382 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 17:02:29 +0100 Subject: [PATCH 056/155] fix mermaid tests --- .../admonitions/__tests__/index.test.ts | 2 +- .../__snapshots__/index.test.ts.snap | 51 ------------------- .../remark/mermaid/__tests__/index.test.ts | 47 ++++++++++++----- .../src/remark/mermaid/index.ts | 1 + 4 files changed, 36 insertions(+), 65 deletions(-) delete mode 100644 packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/__snapshots__/index.test.ts.snap diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts index 2f0df3dd542f..d84aa91cf685 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts @@ -45,7 +45,7 @@ const processFixture = async ( .use(stringify) .process(fileContentPreprocessed); - return result.toString(); + return result.value; }; describe('admonitions remark plugin', () => { diff --git a/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/__snapshots__/index.test.ts.snap deleted file mode 100644 index 157f963ccdb3..000000000000 --- a/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/__snapshots__/index.test.ts.snap +++ /dev/null @@ -1,51 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`mermaid remark plugin does nothing if there's no mermaid code block 1`] = ` -" - - -const layoutProps = { - -}; -const MDXLayout = "wrapper" -export default function MDXContent({ - components, - ...props -}) { - return -

{\`Heading 1\`}

-

{\`No Mermaid diagram :(\`}

-
{\`this is not mermaid
-\`}
-
; -} - -; -MDXContent.isMDXComponent = true;" -`; - -exports[`mermaid remark plugin works for basic mermaid code blocks 1`] = ` -" - - -const layoutProps = { - -}; -const MDXLayout = "wrapper" -export default function MDXContent({ - components, - ...props -}) { - return -

{\`Heading 1\`}

- B;/n A-->C;/n B-->D;/n C-->D;" - }}> -
; -} - -; -MDXContent.isMDXComponent = true;" -`; diff --git a/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/index.test.ts index e61272955427..e7902cbfba0a 100644 --- a/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/index.test.ts @@ -5,19 +5,28 @@ * LICENSE file in the root directory of this source tree. */ -import {createCompiler} from '@mdx-js/mdx'; +import remark2rehype from 'remark-rehype'; +import stringify from 'rehype-stringify'; import mermaid from '..'; -describe('mermaid remark plugin', () => { - function createTestCompiler() { - return createCompiler({ - remarkPlugins: [mermaid], - }); - } +async function process(content: string) { + const {remark} = await import('remark'); + + const {default: mdx} = await import('remark-mdx'); + // const result = await remark().use(mermaid).use(mdx).process(content); + + const result = await remark() + .use(mermaid) + .use(remark2rehype) + .use(stringify) + .process(content); + return result.value; +} + +describe('mermaid remark plugin', () => { it("does nothing if there's no mermaid code block", async () => { - const mdxCompiler = createTestCompiler(); - const result = await mdxCompiler.process( + const result = await process( `# Heading 1 No Mermaid diagram :( @@ -27,12 +36,17 @@ this is not mermaid \`\`\` `, ); - expect(result.contents).toMatchSnapshot(); + + expect(result).toMatchInlineSnapshot(` + "

Heading 1

+

No Mermaid diagram :(

+
this is not mermaid
+      
" + `); }); it('works for basic mermaid code blocks', async () => { - const mdxCompiler = createTestCompiler(); - const result = await mdxCompiler.process(`# Heading 1 + const result = await process(`# Heading 1 \`\`\`mermaid graph TD; @@ -41,6 +55,13 @@ graph TD; B-->D; C-->D; \`\`\``); - expect(result.contents).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot(` + "

Heading 1

+ " + `); }); }); diff --git a/packages/docusaurus-mdx-loader/src/remark/mermaid/index.ts b/packages/docusaurus-mdx-loader/src/remark/mermaid/index.ts index d0b6232cdfad..3f71a8780bef 100644 --- a/packages/docusaurus-mdx-loader/src/remark/mermaid/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/mermaid/index.ts @@ -17,6 +17,7 @@ export default function plugin(): Transformer { return (root) => { visit(root, 'code', (node: Code, index, parent) => { if (node.lang === 'mermaid') { + // TODO migrate to mdxJsxFlowElement? cf admonitions parent!.children.splice(index, 1, { type: 'mermaidCodeBlock', data: { From 48f76f8f9aee7e8ff4ff4228c20d9849860eac32 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 17:03:31 +0100 Subject: [PATCH 057/155] comment --- .../src/remark/mermaid/__tests__/index.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/index.test.ts index e7902cbfba0a..30e0c3531163 100644 --- a/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/mermaid/__tests__/index.test.ts @@ -12,7 +12,7 @@ import mermaid from '..'; async function process(content: string) { const {remark} = await import('remark'); - const {default: mdx} = await import('remark-mdx'); + // const {default: mdx} = await import('remark-mdx'); // const result = await remark().use(mermaid).use(mdx).process(content); const result = await remark() From 8b9c7b0ea0b9efb6e83de6befcba92267b9f6c8f Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 17:19:33 +0100 Subject: [PATCH 058/155] vendor @mdx-js/mdx --- jest.config.mjs | 1 + jest/vendor/@mdx-js__mdx@2.1.5.js | 25696 ++++++++++++++++++++++++++++ 2 files changed, 25697 insertions(+) create mode 100644 jest/vendor/@mdx-js__mdx@2.1.5.js diff --git a/jest.config.mjs b/jest.config.mjs index 8e2ed294da73..9aa02bf47b94 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -84,6 +84,7 @@ export default { // MDX packages are ESM-only and it is a pain to use in Jest // So we use them in Jest tests as CJS versions // see https://mdxjs.com/docs/troubleshooting-mdx/#problems-integrating-mdx + '^@mdx-js/mdx$': '/jest/vendor/@mdx-js__mdx@2.1.5.js', '^remark$': '/jest/vendor/remark@14.0.2.js', '^remark-mdx$': '/jest/vendor/remark-mdx@2.1.5.js', '^remark-directive$': '/jest/vendor/remark-directive@2.0.1.js', diff --git a/jest/vendor/@mdx-js__mdx@2.1.5.js b/jest/vendor/@mdx-js__mdx@2.1.5.js new file mode 100644 index 000000000000..123a38c66fbe --- /dev/null +++ b/jest/vendor/@mdx-js__mdx@2.1.5.js @@ -0,0 +1,25696 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all4) => { + for (var name2 in all4) + __defProp(target, name2, { get: all4[name2], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/is-buffer/index.js +var require_is_buffer = __commonJS({ + "node_modules/is-buffer/index.js"(exports, module2) { + module2.exports = function isBuffer2(obj) { + return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj); + }; + } +}); + +// node_modules/extend/index.js +var require_extend = __commonJS({ + "node_modules/extend/index.js"(exports, module2) { + "use strict"; + var hasOwn2 = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + var defineProperty = Object.defineProperty; + var gOPD = Object.getOwnPropertyDescriptor; + var isArray2 = function isArray3(arr) { + if (typeof Array.isArray === "function") { + return Array.isArray(arr); + } + return toStr.call(arr) === "[object Array]"; + }; + var isPlainObject2 = function isPlainObject3(obj) { + if (!obj || toStr.call(obj) !== "[object Object]") { + return false; + } + var hasOwnConstructor = hasOwn2.call(obj, "constructor"); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn2.call(obj.constructor.prototype, "isPrototypeOf"); + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + var key; + for (key in obj) { + } + return typeof key === "undefined" || hasOwn2.call(obj, key); + }; + var setProperty = function setProperty2(target, options) { + if (defineProperty && options.name === "__proto__") { + defineProperty(target, options.name, { + enumerable: true, + configurable: true, + value: options.newValue, + writable: true + }); + } else { + target[options.name] = options.newValue; + } + }; + var getProperty = function getProperty2(obj, name2) { + if (name2 === "__proto__") { + if (!hasOwn2.call(obj, name2)) { + return void 0; + } else if (gOPD) { + return gOPD(obj, name2).value; + } + } + return obj[name2]; + }; + module2.exports = function extend3() { + var options, name2, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + if (typeof target === "boolean") { + deep = target; + target = arguments[1] || {}; + i = 2; + } + if (target == null || typeof target !== "object" && typeof target !== "function") { + target = {}; + } + for (; i < length; ++i) { + options = arguments[i]; + if (options != null) { + for (name2 in options) { + src = getProperty(target, name2); + copy = getProperty(options, name2); + if (target !== copy) { + if (deep && copy && (isPlainObject2(copy) || (copyIsArray = isArray2(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray2(src) ? src : []; + } else { + clone = src && isPlainObject2(src) ? src : {}; + } + setProperty(target, { name: name2, newValue: extend3(deep, clone, copy) }); + } else if (typeof copy !== "undefined") { + setProperty(target, { name: name2, newValue: copy }); + } + } + } + } + } + return target; + }; + } +}); + +// node_modules/acorn-jsx/xhtml.js +var require_xhtml = __commonJS({ + "node_modules/acorn-jsx/xhtml.js"(exports, module2) { + module2.exports = { + quot: '"', + amp: "&", + apos: "'", + lt: "<", + gt: ">", + nbsp: "\xA0", + iexcl: "\xA1", + cent: "\xA2", + pound: "\xA3", + curren: "\xA4", + yen: "\xA5", + brvbar: "\xA6", + sect: "\xA7", + uml: "\xA8", + copy: "\xA9", + ordf: "\xAA", + laquo: "\xAB", + not: "\xAC", + shy: "\xAD", + reg: "\xAE", + macr: "\xAF", + deg: "\xB0", + plusmn: "\xB1", + sup2: "\xB2", + sup3: "\xB3", + acute: "\xB4", + micro: "\xB5", + para: "\xB6", + middot: "\xB7", + cedil: "\xB8", + sup1: "\xB9", + ordm: "\xBA", + raquo: "\xBB", + frac14: "\xBC", + frac12: "\xBD", + frac34: "\xBE", + iquest: "\xBF", + Agrave: "\xC0", + Aacute: "\xC1", + Acirc: "\xC2", + Atilde: "\xC3", + Auml: "\xC4", + Aring: "\xC5", + AElig: "\xC6", + Ccedil: "\xC7", + Egrave: "\xC8", + Eacute: "\xC9", + Ecirc: "\xCA", + Euml: "\xCB", + Igrave: "\xCC", + Iacute: "\xCD", + Icirc: "\xCE", + Iuml: "\xCF", + ETH: "\xD0", + Ntilde: "\xD1", + Ograve: "\xD2", + Oacute: "\xD3", + Ocirc: "\xD4", + Otilde: "\xD5", + Ouml: "\xD6", + times: "\xD7", + Oslash: "\xD8", + Ugrave: "\xD9", + Uacute: "\xDA", + Ucirc: "\xDB", + Uuml: "\xDC", + Yacute: "\xDD", + THORN: "\xDE", + szlig: "\xDF", + agrave: "\xE0", + aacute: "\xE1", + acirc: "\xE2", + atilde: "\xE3", + auml: "\xE4", + aring: "\xE5", + aelig: "\xE6", + ccedil: "\xE7", + egrave: "\xE8", + eacute: "\xE9", + ecirc: "\xEA", + euml: "\xEB", + igrave: "\xEC", + iacute: "\xED", + icirc: "\xEE", + iuml: "\xEF", + eth: "\xF0", + ntilde: "\xF1", + ograve: "\xF2", + oacute: "\xF3", + ocirc: "\xF4", + otilde: "\xF5", + ouml: "\xF6", + divide: "\xF7", + oslash: "\xF8", + ugrave: "\xF9", + uacute: "\xFA", + ucirc: "\xFB", + uuml: "\xFC", + yacute: "\xFD", + thorn: "\xFE", + yuml: "\xFF", + OElig: "\u0152", + oelig: "\u0153", + Scaron: "\u0160", + scaron: "\u0161", + Yuml: "\u0178", + fnof: "\u0192", + circ: "\u02C6", + tilde: "\u02DC", + Alpha: "\u0391", + Beta: "\u0392", + Gamma: "\u0393", + Delta: "\u0394", + Epsilon: "\u0395", + Zeta: "\u0396", + Eta: "\u0397", + Theta: "\u0398", + Iota: "\u0399", + Kappa: "\u039A", + Lambda: "\u039B", + Mu: "\u039C", + Nu: "\u039D", + Xi: "\u039E", + Omicron: "\u039F", + Pi: "\u03A0", + Rho: "\u03A1", + Sigma: "\u03A3", + Tau: "\u03A4", + Upsilon: "\u03A5", + Phi: "\u03A6", + Chi: "\u03A7", + Psi: "\u03A8", + Omega: "\u03A9", + alpha: "\u03B1", + beta: "\u03B2", + gamma: "\u03B3", + delta: "\u03B4", + epsilon: "\u03B5", + zeta: "\u03B6", + eta: "\u03B7", + theta: "\u03B8", + iota: "\u03B9", + kappa: "\u03BA", + lambda: "\u03BB", + mu: "\u03BC", + nu: "\u03BD", + xi: "\u03BE", + omicron: "\u03BF", + pi: "\u03C0", + rho: "\u03C1", + sigmaf: "\u03C2", + sigma: "\u03C3", + tau: "\u03C4", + upsilon: "\u03C5", + phi: "\u03C6", + chi: "\u03C7", + psi: "\u03C8", + omega: "\u03C9", + thetasym: "\u03D1", + upsih: "\u03D2", + piv: "\u03D6", + ensp: "\u2002", + emsp: "\u2003", + thinsp: "\u2009", + zwnj: "\u200C", + zwj: "\u200D", + lrm: "\u200E", + rlm: "\u200F", + ndash: "\u2013", + mdash: "\u2014", + lsquo: "\u2018", + rsquo: "\u2019", + sbquo: "\u201A", + ldquo: "\u201C", + rdquo: "\u201D", + bdquo: "\u201E", + dagger: "\u2020", + Dagger: "\u2021", + bull: "\u2022", + hellip: "\u2026", + permil: "\u2030", + prime: "\u2032", + Prime: "\u2033", + lsaquo: "\u2039", + rsaquo: "\u203A", + oline: "\u203E", + frasl: "\u2044", + euro: "\u20AC", + image: "\u2111", + weierp: "\u2118", + real: "\u211C", + trade: "\u2122", + alefsym: "\u2135", + larr: "\u2190", + uarr: "\u2191", + rarr: "\u2192", + darr: "\u2193", + harr: "\u2194", + crarr: "\u21B5", + lArr: "\u21D0", + uArr: "\u21D1", + rArr: "\u21D2", + dArr: "\u21D3", + hArr: "\u21D4", + forall: "\u2200", + part: "\u2202", + exist: "\u2203", + empty: "\u2205", + nabla: "\u2207", + isin: "\u2208", + notin: "\u2209", + ni: "\u220B", + prod: "\u220F", + sum: "\u2211", + minus: "\u2212", + lowast: "\u2217", + radic: "\u221A", + prop: "\u221D", + infin: "\u221E", + ang: "\u2220", + and: "\u2227", + or: "\u2228", + cap: "\u2229", + cup: "\u222A", + "int": "\u222B", + there4: "\u2234", + sim: "\u223C", + cong: "\u2245", + asymp: "\u2248", + ne: "\u2260", + equiv: "\u2261", + le: "\u2264", + ge: "\u2265", + sub: "\u2282", + sup: "\u2283", + nsub: "\u2284", + sube: "\u2286", + supe: "\u2287", + oplus: "\u2295", + otimes: "\u2297", + perp: "\u22A5", + sdot: "\u22C5", + lceil: "\u2308", + rceil: "\u2309", + lfloor: "\u230A", + rfloor: "\u230B", + lang: "\u2329", + rang: "\u232A", + loz: "\u25CA", + spades: "\u2660", + clubs: "\u2663", + hearts: "\u2665", + diams: "\u2666" + }; + } +}); + +// node_modules/acorn/dist/acorn.js +var require_acorn = __commonJS({ + "node_modules/acorn/dist/acorn.js"(exports, module2) { + (function(global, factory2) { + typeof exports === "object" && typeof module2 !== "undefined" ? factory2(exports) : typeof define === "function" && define.amd ? define(["exports"], factory2) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory2(global.acorn = {})); + })(exports, function(exports2) { + "use strict"; + var astralIdentifierCodes2 = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + var astralIdentifierStartCodes2 = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; + var nonASCIIidentifierChars2 = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F"; + var nonASCIIidentifierStartChars2 = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC"; + var reservedWords2 = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" + }; + var ecma5AndLessKeywords2 = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; + var keywords$12 = { + 5: ecma5AndLessKeywords2, + "5module": ecma5AndLessKeywords2 + " export import", + 6: ecma5AndLessKeywords2 + " const class extends export import super" + }; + var keywordRelationalOperator2 = /^in(stanceof)?$/; + var nonASCIIidentifierStart2 = new RegExp("[" + nonASCIIidentifierStartChars2 + "]"); + var nonASCIIidentifier2 = new RegExp("[" + nonASCIIidentifierStartChars2 + nonASCIIidentifierChars2 + "]"); + function isInAstralSet2(code2, set) { + var pos = 65536; + for (var i2 = 0; i2 < set.length; i2 += 2) { + pos += set[i2]; + if (pos > code2) { + return false; + } + pos += set[i2 + 1]; + if (pos >= code2) { + return true; + } + } + } + function isIdentifierStart2(code2, astral) { + if (code2 < 65) { + return code2 === 36; + } + if (code2 < 91) { + return true; + } + if (code2 < 97) { + return code2 === 95; + } + if (code2 < 123) { + return true; + } + if (code2 <= 65535) { + return code2 >= 170 && nonASCIIidentifierStart2.test(String.fromCharCode(code2)); + } + if (astral === false) { + return false; + } + return isInAstralSet2(code2, astralIdentifierStartCodes2); + } + function isIdentifierChar2(code2, astral) { + if (code2 < 48) { + return code2 === 36; + } + if (code2 < 58) { + return true; + } + if (code2 < 65) { + return false; + } + if (code2 < 91) { + return true; + } + if (code2 < 97) { + return code2 === 95; + } + if (code2 < 123) { + return true; + } + if (code2 <= 65535) { + return code2 >= 170 && nonASCIIidentifier2.test(String.fromCharCode(code2)); + } + if (astral === false) { + return false; + } + return isInAstralSet2(code2, astralIdentifierStartCodes2) || isInAstralSet2(code2, astralIdentifierCodes2); + } + var TokenType3 = function TokenType4(label, conf) { + if (conf === void 0) + conf = {}; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; + }; + function binop2(name2, prec) { + return new TokenType3(name2, { beforeExpr: true, binop: prec }); + } + var beforeExpr2 = { beforeExpr: true }, startsExpr2 = { startsExpr: true }; + var keywords2 = {}; + function kw2(name2, options) { + if (options === void 0) + options = {}; + options.keyword = name2; + return keywords2[name2] = new TokenType3(name2, options); + } + var types$12 = { + num: new TokenType3("num", startsExpr2), + regexp: new TokenType3("regexp", startsExpr2), + string: new TokenType3("string", startsExpr2), + name: new TokenType3("name", startsExpr2), + privateId: new TokenType3("privateId", startsExpr2), + eof: new TokenType3("eof"), + bracketL: new TokenType3("[", { beforeExpr: true, startsExpr: true }), + bracketR: new TokenType3("]"), + braceL: new TokenType3("{", { beforeExpr: true, startsExpr: true }), + braceR: new TokenType3("}"), + parenL: new TokenType3("(", { beforeExpr: true, startsExpr: true }), + parenR: new TokenType3(")"), + comma: new TokenType3(",", beforeExpr2), + semi: new TokenType3(";", beforeExpr2), + colon: new TokenType3(":", beforeExpr2), + dot: new TokenType3("."), + question: new TokenType3("?", beforeExpr2), + questionDot: new TokenType3("?."), + arrow: new TokenType3("=>", beforeExpr2), + template: new TokenType3("template"), + invalidTemplate: new TokenType3("invalidTemplate"), + ellipsis: new TokenType3("...", beforeExpr2), + backQuote: new TokenType3("`", startsExpr2), + dollarBraceL: new TokenType3("${", { beforeExpr: true, startsExpr: true }), + eq: new TokenType3("=", { beforeExpr: true, isAssign: true }), + assign: new TokenType3("_=", { beforeExpr: true, isAssign: true }), + incDec: new TokenType3("++/--", { prefix: true, postfix: true, startsExpr: true }), + prefix: new TokenType3("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), + logicalOR: binop2("||", 1), + logicalAND: binop2("&&", 2), + bitwiseOR: binop2("|", 3), + bitwiseXOR: binop2("^", 4), + bitwiseAND: binop2("&", 5), + equality: binop2("==/!=/===/!==", 6), + relational: binop2("/<=/>=", 7), + bitShift: binop2("<>/>>>", 8), + plusMin: new TokenType3("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), + modulo: binop2("%", 10), + star: binop2("*", 10), + slash: binop2("/", 10), + starstar: new TokenType3("**", { beforeExpr: true }), + coalesce: binop2("??", 1), + _break: kw2("break"), + _case: kw2("case", beforeExpr2), + _catch: kw2("catch"), + _continue: kw2("continue"), + _debugger: kw2("debugger"), + _default: kw2("default", beforeExpr2), + _do: kw2("do", { isLoop: true, beforeExpr: true }), + _else: kw2("else", beforeExpr2), + _finally: kw2("finally"), + _for: kw2("for", { isLoop: true }), + _function: kw2("function", startsExpr2), + _if: kw2("if"), + _return: kw2("return", beforeExpr2), + _switch: kw2("switch"), + _throw: kw2("throw", beforeExpr2), + _try: kw2("try"), + _var: kw2("var"), + _const: kw2("const"), + _while: kw2("while", { isLoop: true }), + _with: kw2("with"), + _new: kw2("new", { beforeExpr: true, startsExpr: true }), + _this: kw2("this", startsExpr2), + _super: kw2("super", startsExpr2), + _class: kw2("class", startsExpr2), + _extends: kw2("extends", beforeExpr2), + _export: kw2("export"), + _import: kw2("import", startsExpr2), + _null: kw2("null", startsExpr2), + _true: kw2("true", startsExpr2), + _false: kw2("false", startsExpr2), + _in: kw2("in", { beforeExpr: true, binop: 7 }), + _instanceof: kw2("instanceof", { beforeExpr: true, binop: 7 }), + _typeof: kw2("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), + _void: kw2("void", { beforeExpr: true, prefix: true, startsExpr: true }), + _delete: kw2("delete", { beforeExpr: true, prefix: true, startsExpr: true }) + }; + var lineBreak2 = /\r\n?|\n|\u2028|\u2029/; + var lineBreakG2 = new RegExp(lineBreak2.source, "g"); + function isNewLine2(code2) { + return code2 === 10 || code2 === 13 || code2 === 8232 || code2 === 8233; + } + function nextLineBreak2(code2, from, end) { + if (end === void 0) + end = code2.length; + for (var i2 = from; i2 < end; i2++) { + var next = code2.charCodeAt(i2); + if (isNewLine2(next)) { + return i2 < end - 1 && next === 13 && code2.charCodeAt(i2 + 1) === 10 ? i2 + 2 : i2 + 1; + } + } + return -1; + } + var nonASCIIwhitespace2 = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + var skipWhiteSpace2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; + var ref2 = Object.prototype; + var hasOwnProperty3 = ref2.hasOwnProperty; + var toString3 = ref2.toString; + var hasOwn2 = Object.hasOwn || function(obj, propName) { + return hasOwnProperty3.call(obj, propName); + }; + var isArray2 = Array.isArray || function(obj) { + return toString3.call(obj) === "[object Array]"; + }; + function wordsRegexp2(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"); + } + function codePointToString2(code2) { + if (code2 <= 65535) { + return String.fromCharCode(code2); + } + code2 -= 65536; + return String.fromCharCode((code2 >> 10) + 55296, (code2 & 1023) + 56320); + } + var loneSurrogate2 = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; + var Position3 = function Position4(line, col) { + this.line = line; + this.column = col; + }; + Position3.prototype.offset = function offset2(n) { + return new Position3(this.line, this.column + n); + }; + var SourceLocation3 = function SourceLocation4(p, start3, end) { + this.start = start3; + this.end = end; + if (p.sourceFile !== null) { + this.source = p.sourceFile; + } + }; + function getLineInfo2(input, offset2) { + for (var line = 1, cur = 0; ; ) { + var nextBreak = nextLineBreak2(input, cur, offset2); + if (nextBreak < 0) { + return new Position3(line, offset2 - cur); + } + ++line; + cur = nextBreak; + } + } + var defaultOptions2 = { + ecmaVersion: null, + sourceType: "script", + onInsertedSemicolon: null, + onTrailingComma: null, + allowReserved: null, + allowReturnOutsideFunction: false, + allowImportExportEverywhere: false, + allowAwaitOutsideFunction: null, + allowSuperOutsideMethod: null, + allowHashBang: false, + locations: false, + onToken: null, + onComment: null, + ranges: false, + program: null, + sourceFile: null, + directSourceFile: null, + preserveParens: false + }; + var warnedAboutEcmaVersion2 = false; + function getOptions2(opts) { + var options = {}; + for (var opt in defaultOptions2) { + options[opt] = opts && hasOwn2(opts, opt) ? opts[opt] : defaultOptions2[opt]; + } + if (options.ecmaVersion === "latest") { + options.ecmaVersion = 1e8; + } else if (options.ecmaVersion == null) { + if (!warnedAboutEcmaVersion2 && typeof console === "object" && console.warn) { + warnedAboutEcmaVersion2 = true; + console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); + } + options.ecmaVersion = 11; + } else if (options.ecmaVersion >= 2015) { + options.ecmaVersion -= 2009; + } + if (options.allowReserved == null) { + options.allowReserved = options.ecmaVersion < 5; + } + if (opts.allowHashBang == null) { + options.allowHashBang = options.ecmaVersion >= 14; + } + if (isArray2(options.onToken)) { + var tokens = options.onToken; + options.onToken = function(token) { + return tokens.push(token); + }; + } + if (isArray2(options.onComment)) { + options.onComment = pushComment2(options, options.onComment); + } + return options; + } + function pushComment2(options, array) { + return function(block, text5, start3, end, startLoc, endLoc) { + var comment2 = { + type: block ? "Block" : "Line", + value: text5, + start: start3, + end + }; + if (options.locations) { + comment2.loc = new SourceLocation3(this, startLoc, endLoc); + } + if (options.ranges) { + comment2.range = [start3, end]; + } + array.push(comment2); + }; + } + var SCOPE_TOP2 = 1, SCOPE_FUNCTION2 = 2, SCOPE_ASYNC2 = 4, SCOPE_GENERATOR2 = 8, SCOPE_ARROW2 = 16, SCOPE_SIMPLE_CATCH2 = 32, SCOPE_SUPER2 = 64, SCOPE_DIRECT_SUPER2 = 128, SCOPE_CLASS_STATIC_BLOCK2 = 256, SCOPE_VAR2 = SCOPE_TOP2 | SCOPE_FUNCTION2 | SCOPE_CLASS_STATIC_BLOCK2; + function functionFlags2(async, generator) { + return SCOPE_FUNCTION2 | (async ? SCOPE_ASYNC2 : 0) | (generator ? SCOPE_GENERATOR2 : 0); + } + var BIND_NONE2 = 0, BIND_VAR2 = 1, BIND_LEXICAL2 = 2, BIND_FUNCTION2 = 3, BIND_SIMPLE_CATCH2 = 4, BIND_OUTSIDE2 = 5; + var Parser3 = function Parser4(options, input, startPos) { + this.options = options = getOptions2(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp2(keywords$12[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + var reserved = ""; + if (options.allowReserved !== true) { + reserved = reservedWords2[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; + if (options.sourceType === "module") { + reserved += " await"; + } + } + this.reservedWords = wordsRegexp2(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords2.strict; + this.reservedWordsStrict = wordsRegexp2(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp2(reservedStrict + " " + reservedWords2.strictBind); + this.input = String(input); + this.containsEsc = false; + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak2).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + this.type = types$12.eof; + this.value = null; + this.start = this.end = this.pos; + this.startLoc = this.endLoc = this.curPosition(); + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + this.context = this.initialContext(); + this.exprAllowed = true; + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + this.potentialArrowAt = -1; + this.potentialArrowInForAwait = false; + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + this.labels = []; + this.undefinedExports = /* @__PURE__ */ Object.create(null); + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") { + this.skipLineComment(2); + } + this.scopeStack = []; + this.enterScope(SCOPE_TOP2); + this.regexpState = null; + this.privateNameStack = []; + }; + var prototypeAccessors2 = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } }; + Parser3.prototype.parse = function parse5() { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node); + }; + prototypeAccessors2.inFunction.get = function() { + return (this.currentVarScope().flags & SCOPE_FUNCTION2) > 0; + }; + prototypeAccessors2.inGenerator.get = function() { + return (this.currentVarScope().flags & SCOPE_GENERATOR2) > 0 && !this.currentVarScope().inClassFieldInit; + }; + prototypeAccessors2.inAsync.get = function() { + return (this.currentVarScope().flags & SCOPE_ASYNC2) > 0 && !this.currentVarScope().inClassFieldInit; + }; + prototypeAccessors2.canAwait.get = function() { + for (var i2 = this.scopeStack.length - 1; i2 >= 0; i2--) { + var scope = this.scopeStack[i2]; + if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK2) { + return false; + } + if (scope.flags & SCOPE_FUNCTION2) { + return (scope.flags & SCOPE_ASYNC2) > 0; + } + } + return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction; + }; + prototypeAccessors2.allowSuper.get = function() { + var ref3 = this.currentThisScope(); + var flags = ref3.flags; + var inClassFieldInit = ref3.inClassFieldInit; + return (flags & SCOPE_SUPER2) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod; + }; + prototypeAccessors2.allowDirectSuper.get = function() { + return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER2) > 0; + }; + prototypeAccessors2.treatFunctionsAsVar.get = function() { + return this.treatFunctionsAsVarInScope(this.currentScope()); + }; + prototypeAccessors2.allowNewDotTarget.get = function() { + var ref3 = this.currentThisScope(); + var flags = ref3.flags; + var inClassFieldInit = ref3.inClassFieldInit; + return (flags & (SCOPE_FUNCTION2 | SCOPE_CLASS_STATIC_BLOCK2)) > 0 || inClassFieldInit; + }; + prototypeAccessors2.inClassStaticBlock.get = function() { + return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK2) > 0; + }; + Parser3.extend = function extend3() { + var plugins = [], len = arguments.length; + while (len--) + plugins[len] = arguments[len]; + var cls = this; + for (var i2 = 0; i2 < plugins.length; i2++) { + cls = plugins[i2](cls); + } + return cls; + }; + Parser3.parse = function parse5(input, options) { + return new this(options, input).parse(); + }; + Parser3.parseExpressionAt = function parseExpressionAt3(input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression(); + }; + Parser3.tokenizer = function tokenizer3(input, options) { + return new this(options, input); + }; + Object.defineProperties(Parser3.prototype, prototypeAccessors2); + var pp$92 = Parser3.prototype; + var literal2 = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; + pp$92.strictDirective = function(start3) { + if (this.options.ecmaVersion < 5) { + return false; + } + for (; ; ) { + skipWhiteSpace2.lastIndex = start3; + start3 += skipWhiteSpace2.exec(this.input)[0].length; + var match = literal2.exec(this.input.slice(start3)); + if (!match) { + return false; + } + if ((match[1] || match[2]) === "use strict") { + skipWhiteSpace2.lastIndex = start3 + match[0].length; + var spaceAfter = skipWhiteSpace2.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; + var next = this.input.charAt(end); + return next === ";" || next === "}" || lineBreak2.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="); + } + start3 += match[0].length; + skipWhiteSpace2.lastIndex = start3; + start3 += skipWhiteSpace2.exec(this.input)[0].length; + if (this.input[start3] === ";") { + start3++; + } + } + }; + pp$92.eat = function(type) { + if (this.type === type) { + this.next(); + return true; + } else { + return false; + } + }; + pp$92.isContextual = function(name2) { + return this.type === types$12.name && this.value === name2 && !this.containsEsc; + }; + pp$92.eatContextual = function(name2) { + if (!this.isContextual(name2)) { + return false; + } + this.next(); + return true; + }; + pp$92.expectContextual = function(name2) { + if (!this.eatContextual(name2)) { + this.unexpected(); + } + }; + pp$92.canInsertSemicolon = function() { + return this.type === types$12.eof || this.type === types$12.braceR || lineBreak2.test(this.input.slice(this.lastTokEnd, this.start)); + }; + pp$92.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) { + this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); + } + return true; + } + }; + pp$92.semicolon = function() { + if (!this.eat(types$12.semi) && !this.insertSemicolon()) { + this.unexpected(); + } + }; + pp$92.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) { + this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); + } + if (!notNext) { + this.next(); + } + return true; + } + }; + pp$92.expect = function(type) { + this.eat(type) || this.unexpected(); + }; + pp$92.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); + }; + var DestructuringErrors3 = function DestructuringErrors4() { + this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; + }; + pp$92.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { + return; + } + if (refDestructuringErrors.trailingComma > -1) { + this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); + } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { + this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); + } + }; + pp$92.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { + return false; + } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { + return shorthandAssign >= 0 || doubleProto >= 0; + } + if (shorthandAssign >= 0) { + this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); + } + if (doubleProto >= 0) { + this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); + } + }; + pp$92.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { + this.raise(this.yieldPos, "Yield expression cannot be a default value"); + } + if (this.awaitPos) { + this.raise(this.awaitPos, "Await expression cannot be a default value"); + } + }; + pp$92.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") { + return this.isSimpleAssignTarget(expr.expression); + } + return expr.type === "Identifier" || expr.type === "MemberExpression"; + }; + var pp$82 = Parser3.prototype; + pp$82.parseTopLevel = function(node) { + var exports3 = /* @__PURE__ */ Object.create(null); + if (!node.body) { + node.body = []; + } + while (this.type !== types$12.eof) { + var stmt = this.parseStatement(null, true, exports3); + node.body.push(stmt); + } + if (this.inModule) { + for (var i2 = 0, list4 = Object.keys(this.undefinedExports); i2 < list4.length; i2 += 1) { + var name2 = list4[i2]; + this.raiseRecoverable(this.undefinedExports[name2].start, "Export '" + name2 + "' is not defined"); + } + } + this.adaptDirectivePrologue(node.body); + this.next(); + node.sourceType = this.options.sourceType; + return this.finishNode(node, "Program"); + }; + var loopLabel2 = { kind: "loop" }, switchLabel2 = { kind: "switch" }; + pp$82.isLet = function(context) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { + return false; + } + skipWhiteSpace2.lastIndex = this.pos; + var skip = skipWhiteSpace2.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 91 || nextCh === 92 || nextCh > 55295 && nextCh < 56320) { + return true; + } + if (context) { + return false; + } + if (nextCh === 123) { + return true; + } + if (isIdentifierStart2(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar2(nextCh = this.input.charCodeAt(pos), true)) { + ++pos; + } + if (nextCh === 92 || nextCh > 55295 && nextCh < 56320) { + return true; + } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator2.test(ident)) { + return true; + } + } + return false; + }; + pp$82.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { + return false; + } + skipWhiteSpace2.lastIndex = this.pos; + var skip = skipWhiteSpace2.exec(this.input); + var next = this.pos + skip[0].length, after; + return !lineBreak2.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar2(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320)); + }; + pp$82.parseStatement = function(context, topLevel, exports3) { + var starttype = this.type, node = this.startNode(), kind; + if (this.isLet(context)) { + starttype = types$12._var; + kind = "let"; + } + switch (starttype) { + case types$12._break: + case types$12._continue: + return this.parseBreakContinueStatement(node, starttype.keyword); + case types$12._debugger: + return this.parseDebuggerStatement(node); + case types$12._do: + return this.parseDoStatement(node); + case types$12._for: + return this.parseForStatement(node); + case types$12._function: + if (context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6) { + this.unexpected(); + } + return this.parseFunctionStatement(node, false, !context); + case types$12._class: + if (context) { + this.unexpected(); + } + return this.parseClass(node, true); + case types$12._if: + return this.parseIfStatement(node); + case types$12._return: + return this.parseReturnStatement(node); + case types$12._switch: + return this.parseSwitchStatement(node); + case types$12._throw: + return this.parseThrowStatement(node); + case types$12._try: + return this.parseTryStatement(node); + case types$12._const: + case types$12._var: + kind = kind || this.value; + if (context && kind !== "var") { + this.unexpected(); + } + return this.parseVarStatement(node, kind); + case types$12._while: + return this.parseWhileStatement(node); + case types$12._with: + return this.parseWithStatement(node); + case types$12.braceL: + return this.parseBlock(true, node); + case types$12.semi: + return this.parseEmptyStatement(node); + case types$12._export: + case types$12._import: + if (this.options.ecmaVersion > 10 && starttype === types$12._import) { + skipWhiteSpace2.lastIndex = this.pos; + var skip = skipWhiteSpace2.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 40 || nextCh === 46) { + return this.parseExpressionStatement(node, this.parseExpression()); + } + } + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) { + this.raise(this.start, "'import' and 'export' may only appear at the top level"); + } + if (!this.inModule) { + this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); + } + } + return starttype === types$12._import ? this.parseImport(node) : this.parseExport(node, exports3); + default: + if (this.isAsyncFunction()) { + if (context) { + this.unexpected(); + } + this.next(); + return this.parseFunctionStatement(node, true, !context); + } + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types$12.name && expr.type === "Identifier" && this.eat(types$12.colon)) { + return this.parseLabeledStatement(node, maybeName, expr, context); + } else { + return this.parseExpressionStatement(node, expr); + } + } + }; + pp$82.parseBreakContinueStatement = function(node, keyword) { + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types$12.semi) || this.insertSemicolon()) { + node.label = null; + } else if (this.type !== types$12.name) { + this.unexpected(); + } else { + node.label = this.parseIdent(); + this.semicolon(); + } + var i2 = 0; + for (; i2 < this.labels.length; ++i2) { + var lab = this.labels[i2]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { + break; + } + if (node.label && isBreak) { + break; + } + } + } + if (i2 === this.labels.length) { + this.raise(node.start, "Unsyntactic " + keyword); + } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); + }; + pp$82.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); + }; + pp$82.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel2); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types$12._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) { + this.eat(types$12.semi); + } else { + this.semicolon(); + } + return this.finishNode(node, "DoWhileStatement"); + }; + pp$82.parseForStatement = function(node) { + this.next(); + var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1; + this.labels.push(loopLabel2); + this.enterScope(0); + this.expect(types$12.parenL); + if (this.type === types$12.semi) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, null); + } + var isLet = this.isLet(); + if (this.type === types$12._var || this.type === types$12._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types$12._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$12._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + return this.parseForIn(node, init$1); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init$1); + } + var startsWithLet = this.isContextual("let"), isForOf = false; + var refDestructuringErrors = new DestructuringErrors3(); + var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); + if (this.type === types$12._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$12._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + if (startsWithLet && isForOf) { + this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLValPattern(init); + return this.parseForIn(node, init); + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); + }; + pp$82.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT2 | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT2), false, isAsync); + }; + pp$82.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types$12._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement"); + }; + pp$82.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) { + this.raise(this.start, "'return' outside of function"); + } + this.next(); + if (this.eat(types$12.semi) || this.insertSemicolon()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } + return this.finishNode(node, "ReturnStatement"); + }; + pp$82.parseSwitchStatement = function(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types$12.braceL); + this.labels.push(switchLabel2); + this.enterScope(0); + var cur; + for (var sawDefault = false; this.type !== types$12.braceR; ) { + if (this.type === types$12._case || this.type === types$12._default) { + var isCase = this.type === types$12._case; + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { + this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); + } + sawDefault = true; + cur.test = null; + } + this.expect(types$12.colon); + } else { + if (!cur) { + this.unexpected(); + } + cur.consequent.push(this.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + this.next(); + this.labels.pop(); + return this.finishNode(node, "SwitchStatement"); + }; + pp$82.parseThrowStatement = function(node) { + this.next(); + if (lineBreak2.test(this.input.slice(this.lastTokEnd, this.start))) { + this.raise(this.lastTokEnd, "Illegal newline after throw"); + } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); + }; + var empty$12 = []; + pp$82.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types$12._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types$12.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH2 : 0); + this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH2 : BIND_LEXICAL2); + this.expect(types$12.parenR); + } else { + if (this.options.ecmaVersion < 10) { + this.unexpected(); + } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types$12._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) { + this.raise(node.start, "Missing catch or finally clause"); + } + return this.finishNode(node, "TryStatement"); + }; + pp$82.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); + }; + pp$82.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel2); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement"); + }; + pp$82.parseWithStatement = function(node) { + if (this.strict) { + this.raise(this.start, "'with' in strict mode"); + } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement"); + }; + pp$82.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); + }; + pp$82.parseLabeledStatement = function(node, maybeName, expr, context) { + for (var i$1 = 0, list4 = this.labels; i$1 < list4.length; i$1 += 1) { + var label = list4[i$1]; + if (label.name === maybeName) { + this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } + } + var kind = this.type.isLoop ? "loop" : this.type === types$12._switch ? "switch" : null; + for (var i2 = this.labels.length - 1; i2 >= 0; i2--) { + var label$1 = this.labels[i2]; + if (label$1.statementStart === node.start) { + label$1.statementStart = this.start; + label$1.kind = kind; + } else { + break; + } + } + this.labels.push({ name: maybeName, kind, statementStart: this.start }); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); + }; + pp$82.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); + }; + pp$82.parseBlock = function(createNewLexicalScope, node, exitStrict) { + if (createNewLexicalScope === void 0) + createNewLexicalScope = true; + if (node === void 0) + node = this.startNode(); + node.body = []; + this.expect(types$12.braceL); + if (createNewLexicalScope) { + this.enterScope(0); + } + while (this.type !== types$12.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + if (exitStrict) { + this.strict = false; + } + this.next(); + if (createNewLexicalScope) { + this.exitScope(); + } + return this.finishNode(node, "BlockStatement"); + }; + pp$82.parseFor = function(node, init) { + node.init = init; + this.expect(types$12.semi); + node.test = this.type === types$12.semi ? null : this.parseExpression(); + this.expect(types$12.semi); + node.update = this.type === types$12.parenR ? null : this.parseExpression(); + this.expect(types$12.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement"); + }; + pp$82.parseForIn = function(node, init) { + var isForIn = this.type === types$12._in; + this.next(); + if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { + this.raise( + init.start, + (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer" + ); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types$12.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); + }; + pp$82.parseVar = function(node, isFor, kind) { + node.declarations = []; + node.kind = kind; + for (; ; ) { + var decl = this.startNode(); + this.parseVarId(decl, kind); + if (this.eat(types$12.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this.type === types$12._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$12._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(types$12.comma)) { + break; + } + } + return node; + }; + pp$82.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR2 : BIND_LEXICAL2, false); + }; + var FUNC_STATEMENT2 = 1, FUNC_HANGING_STATEMENT2 = 2, FUNC_NULLABLE_ID2 = 4; + pp$82.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { + if (this.type === types$12.star && statement & FUNC_HANGING_STATEMENT2) { + this.unexpected(); + } + node.generator = this.eat(types$12.star); + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + if (statement & FUNC_STATEMENT2) { + node.id = statement & FUNC_NULLABLE_ID2 && this.type !== types$12.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT2)) { + this.checkLValSimple(node.id, this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? BIND_VAR2 : BIND_LEXICAL2 : BIND_FUNCTION2); + } + } + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags2(node.async, node.generator)); + if (!(statement & FUNC_STATEMENT2)) { + node.id = this.type === types$12.name ? this.parseIdent() : null; + } + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, statement & FUNC_STATEMENT2 ? "FunctionDeclaration" : "FunctionExpression"); + }; + pp$82.parseFunctionParams = function(node) { + this.expect(types$12.parenL); + node.params = this.parseBindingList(types$12.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + }; + pp$82.parseClass = function(node, isStatement) { + this.next(); + var oldStrict = this.strict; + this.strict = true; + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var privateNameMap = this.enterClassBody(); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types$12.braceL); + while (this.type !== types$12.braceR) { + var element2 = this.parseClassElement(node.superClass !== null); + if (element2) { + classBody.body.push(element2); + if (element2.type === "MethodDefinition" && element2.kind === "constructor") { + if (hadConstructor) { + this.raise(element2.start, "Duplicate constructor in the same class"); + } + hadConstructor = true; + } else if (element2.key && element2.key.type === "PrivateIdentifier" && isPrivateNameConflicted2(privateNameMap, element2)) { + this.raiseRecoverable(element2.key.start, "Identifier '#" + element2.key.name + "' has already been declared"); + } + } + } + this.strict = oldStrict; + this.next(); + node.body = this.finishNode(classBody, "ClassBody"); + this.exitClassBody(); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); + }; + pp$82.parseClassElement = function(constructorAllowsSuper) { + if (this.eat(types$12.semi)) { + return null; + } + var ecmaVersion2 = this.options.ecmaVersion; + var node = this.startNode(); + var keyName = ""; + var isGenerator = false; + var isAsync = false; + var kind = "method"; + var isStatic = false; + if (this.eatContextual("static")) { + if (ecmaVersion2 >= 13 && this.eat(types$12.braceL)) { + this.parseClassStaticBlock(node); + return node; + } + if (this.isClassElementNameStart() || this.type === types$12.star) { + isStatic = true; + } else { + keyName = "static"; + } + } + node.static = isStatic; + if (!keyName && ecmaVersion2 >= 8 && this.eatContextual("async")) { + if ((this.isClassElementNameStart() || this.type === types$12.star) && !this.canInsertSemicolon()) { + isAsync = true; + } else { + keyName = "async"; + } + } + if (!keyName && (ecmaVersion2 >= 9 || !isAsync) && this.eat(types$12.star)) { + isGenerator = true; + } + if (!keyName && !isAsync && !isGenerator) { + var lastValue = this.value; + if (this.eatContextual("get") || this.eatContextual("set")) { + if (this.isClassElementNameStart()) { + kind = lastValue; + } else { + keyName = lastValue; + } + } + } + if (keyName) { + node.computed = false; + node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); + node.key.name = keyName; + this.finishNode(node.key, "Identifier"); + } else { + this.parseClassElementName(node); + } + if (ecmaVersion2 < 13 || this.type === types$12.parenL || kind !== "method" || isGenerator || isAsync) { + var isConstructor = !node.static && checkKeyName2(node, "constructor"); + var allowsDirectSuper = isConstructor && constructorAllowsSuper; + if (isConstructor && kind !== "method") { + this.raise(node.key.start, "Constructor can't have get/set modifier"); + } + node.kind = isConstructor ? "constructor" : kind; + this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); + } else { + this.parseClassField(node); + } + return node; + }; + pp$82.isClassElementNameStart = function() { + return this.type === types$12.name || this.type === types$12.privateId || this.type === types$12.num || this.type === types$12.string || this.type === types$12.bracketL || this.type.keyword; + }; + pp$82.parseClassElementName = function(element2) { + if (this.type === types$12.privateId) { + if (this.value === "constructor") { + this.raise(this.start, "Classes can't have an element named '#constructor'"); + } + element2.computed = false; + element2.key = this.parsePrivateIdent(); + } else { + this.parsePropertyName(element2); + } + }; + pp$82.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + var key = method.key; + if (method.kind === "constructor") { + if (isGenerator) { + this.raise(key.start, "Constructor can't be a generator"); + } + if (isAsync) { + this.raise(key.start, "Constructor can't be an async method"); + } + } else if (method.static && checkKeyName2(method, "prototype")) { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + if (method.kind === "get" && value.params.length !== 0) { + this.raiseRecoverable(value.start, "getter should have no params"); + } + if (method.kind === "set" && value.params.length !== 1) { + this.raiseRecoverable(value.start, "setter should have exactly one param"); + } + if (method.kind === "set" && value.params[0].type === "RestElement") { + this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); + } + return this.finishNode(method, "MethodDefinition"); + }; + pp$82.parseClassField = function(field) { + if (checkKeyName2(field, "constructor")) { + this.raise(field.key.start, "Classes can't have a field named 'constructor'"); + } else if (field.static && checkKeyName2(field, "prototype")) { + this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); + } + if (this.eat(types$12.eq)) { + var scope = this.currentThisScope(); + var inClassFieldInit = scope.inClassFieldInit; + scope.inClassFieldInit = true; + field.value = this.parseMaybeAssign(); + scope.inClassFieldInit = inClassFieldInit; + } else { + field.value = null; + } + this.semicolon(); + return this.finishNode(field, "PropertyDefinition"); + }; + pp$82.parseClassStaticBlock = function(node) { + node.body = []; + var oldLabels = this.labels; + this.labels = []; + this.enterScope(SCOPE_CLASS_STATIC_BLOCK2 | SCOPE_SUPER2); + while (this.type !== types$12.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + this.next(); + this.exitScope(); + this.labels = oldLabels; + return this.finishNode(node, "StaticBlock"); + }; + pp$82.parseClassId = function(node, isStatement) { + if (this.type === types$12.name) { + node.id = this.parseIdent(); + if (isStatement) { + this.checkLValSimple(node.id, BIND_LEXICAL2, false); + } + } else { + if (isStatement === true) { + this.unexpected(); + } + node.id = null; + } + }; + pp$82.parseClassSuper = function(node) { + node.superClass = this.eat(types$12._extends) ? this.parseExprSubscripts(false) : null; + }; + pp$82.enterClassBody = function() { + var element2 = { declared: /* @__PURE__ */ Object.create(null), used: [] }; + this.privateNameStack.push(element2); + return element2.declared; + }; + pp$82.exitClassBody = function() { + var ref3 = this.privateNameStack.pop(); + var declared = ref3.declared; + var used = ref3.used; + var len = this.privateNameStack.length; + var parent = len === 0 ? null : this.privateNameStack[len - 1]; + for (var i2 = 0; i2 < used.length; ++i2) { + var id = used[i2]; + if (!hasOwn2(declared, id.name)) { + if (parent) { + parent.used.push(id); + } else { + this.raiseRecoverable(id.start, "Private field '#" + id.name + "' must be declared in an enclosing class"); + } + } + } + }; + function isPrivateNameConflicted2(privateNameMap, element2) { + var name2 = element2.key.name; + var curr = privateNameMap[name2]; + var next = "true"; + if (element2.type === "MethodDefinition" && (element2.kind === "get" || element2.kind === "set")) { + next = (element2.static ? "s" : "i") + element2.kind; + } + if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") { + privateNameMap[name2] = "true"; + return false; + } else if (!curr) { + privateNameMap[name2] = next; + return false; + } else { + return true; + } + } + function checkKeyName2(node, name2) { + var computed = node.computed; + var key = node.key; + return !computed && (key.type === "Identifier" && key.name === name2 || key.type === "Literal" && key.value === name2); + } + pp$82.parseExport = function(node, exports3) { + this.next(); + if (this.eat(types$12.star)) { + if (this.options.ecmaVersion >= 11) { + if (this.eatContextual("as")) { + node.exported = this.parseModuleExportName(); + this.checkExport(exports3, node.exported, this.lastTokStart); + } else { + node.exported = null; + } + } + this.expectContextual("from"); + if (this.type !== types$12.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration"); + } + if (this.eat(types$12._default)) { + this.checkExport(exports3, "default", this.lastTokStart); + var isAsync; + if (this.type === types$12._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { + this.next(); + } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT2 | FUNC_NULLABLE_ID2, false, isAsync); + } else if (this.type === types$12._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration"); + } + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") { + this.checkVariableExport(exports3, node.declaration.declarations); + } else { + this.checkExport(exports3, node.declaration.id, node.declaration.id.start); + } + node.specifiers = []; + node.source = null; + } else { + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports3); + if (this.eatContextual("from")) { + if (this.type !== types$12.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + } else { + for (var i2 = 0, list4 = node.specifiers; i2 < list4.length; i2 += 1) { + var spec = list4[i2]; + this.checkUnreserved(spec.local); + this.checkLocalExport(spec.local); + if (spec.local.type === "Literal") { + this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); + } + } + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration"); + }; + pp$82.checkExport = function(exports3, name2, pos) { + if (!exports3) { + return; + } + if (typeof name2 !== "string") { + name2 = name2.type === "Identifier" ? name2.name : name2.value; + } + if (hasOwn2(exports3, name2)) { + this.raiseRecoverable(pos, "Duplicate export '" + name2 + "'"); + } + exports3[name2] = true; + }; + pp$82.checkPatternExport = function(exports3, pat) { + var type = pat.type; + if (type === "Identifier") { + this.checkExport(exports3, pat, pat.start); + } else if (type === "ObjectPattern") { + for (var i2 = 0, list4 = pat.properties; i2 < list4.length; i2 += 1) { + var prop = list4[i2]; + this.checkPatternExport(exports3, prop); + } + } else if (type === "ArrayPattern") { + for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + if (elt) { + this.checkPatternExport(exports3, elt); + } + } + } else if (type === "Property") { + this.checkPatternExport(exports3, pat.value); + } else if (type === "AssignmentPattern") { + this.checkPatternExport(exports3, pat.left); + } else if (type === "RestElement") { + this.checkPatternExport(exports3, pat.argument); + } else if (type === "ParenthesizedExpression") { + this.checkPatternExport(exports3, pat.expression); + } + }; + pp$82.checkVariableExport = function(exports3, decls) { + if (!exports3) { + return; + } + for (var i2 = 0, list4 = decls; i2 < list4.length; i2 += 1) { + var decl = list4[i2]; + this.checkPatternExport(exports3, decl.id); + } + }; + pp$82.shouldParseExportStatement = function() { + return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction(); + }; + pp$82.parseExportSpecifiers = function(exports3) { + var nodes = [], first = true; + this.expect(types$12.braceL); + while (!this.eat(types$12.braceR)) { + if (!first) { + this.expect(types$12.comma); + if (this.afterTrailingComma(types$12.braceR)) { + break; + } + } else { + first = false; + } + var node = this.startNode(); + node.local = this.parseModuleExportName(); + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports3, + node.exported, + node.exported.start + ); + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + return nodes; + }; + pp$82.parseImport = function(node) { + this.next(); + if (this.type === types$12.string) { + node.specifiers = empty$12; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types$12.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + }; + pp$82.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types$12.name) { + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLValSimple(node.local, BIND_LEXICAL2); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types$12.comma)) { + return nodes; + } + } + if (this.type === types$12.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLValSimple(node$1.local, BIND_LEXICAL2); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes; + } + this.expect(types$12.braceL); + while (!this.eat(types$12.braceR)) { + if (!first) { + this.expect(types$12.comma); + if (this.afterTrailingComma(types$12.braceR)) { + break; + } + } else { + first = false; + } + var node$2 = this.startNode(); + node$2.imported = this.parseModuleExportName(); + if (this.eatContextual("as")) { + node$2.local = this.parseIdent(); + } else { + this.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this.checkLValSimple(node$2.local, BIND_LEXICAL2); + nodes.push(this.finishNode(node$2, "ImportSpecifier")); + } + return nodes; + }; + pp$82.parseModuleExportName = function() { + if (this.options.ecmaVersion >= 13 && this.type === types$12.string) { + var stringLiteral = this.parseLiteral(this.value); + if (loneSurrogate2.test(stringLiteral.value)) { + this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); + } + return stringLiteral; + } + return this.parseIdent(true); + }; + pp$82.adaptDirectivePrologue = function(statements) { + for (var i2 = 0; i2 < statements.length && this.isDirectiveCandidate(statements[i2]); ++i2) { + statements[i2].directive = statements[i2].expression.raw.slice(1, -1); + } + }; + pp$82.isDirectiveCandidate = function(statement) { + return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && (this.input[statement.start] === '"' || this.input[statement.start] === "'"); + }; + var pp$72 = Parser3.prototype; + pp$72.toAssignable = function(node, isBinding, refDestructuringErrors) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") { + this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); + } + break; + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + break; + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + for (var i2 = 0, list4 = node.properties; i2 < list4.length; i2 += 1) { + var prop = list4[i2]; + this.toAssignable(prop, isBinding); + if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) { + this.raise(prop.argument.start, "Unexpected token"); + } + } + break; + case "Property": + if (node.kind !== "init") { + this.raise(node.key.start, "Object pattern can't contain getter or setter"); + } + this.toAssignable(node.value, isBinding); + break; + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + this.toAssignableList(node.elements, isBinding); + break; + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") { + this.raise(node.argument.start, "Rest elements cannot have a default value"); + } + break; + case "AssignmentExpression": + if (node.operator !== "=") { + this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); + } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + break; + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break; + case "ChainExpression": + this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (!isBinding) { + break; + } + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + return node; + }; + pp$72.toAssignableList = function(exprList, isBinding) { + var end = exprList.length; + for (var i2 = 0; i2 < end; i2++) { + var elt = exprList[i2]; + if (elt) { + this.toAssignable(elt, isBinding); + } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") { + this.unexpected(last.argument.start); + } + } + return exprList; + }; + pp$72.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement"); + }; + pp$72.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + if (this.options.ecmaVersion === 6 && this.type !== types$12.name) { + this.unexpected(); + } + node.argument = this.parseBindingAtom(); + return this.finishNode(node, "RestElement"); + }; + pp$72.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types$12.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types$12.bracketR, true, true); + return this.finishNode(node, "ArrayPattern"); + case types$12.braceL: + return this.parseObj(true); + } + } + return this.parseIdent(); + }; + pp$72.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(types$12.comma); + } + if (allowEmpty && this.type === types$12.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } else if (this.type === types$12.ellipsis) { + var rest = this.parseRestBinding(); + this.parseBindingListItem(rest); + elts.push(rest); + if (this.type === types$12.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + this.expect(close); + break; + } else { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts; + }; + pp$72.parseBindingListItem = function(param) { + return param; + }; + pp$72.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types$12.eq)) { + return left; + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern"); + }; + pp$72.checkLValSimple = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE2; + var isBind = bindingType !== BIND_NONE2; + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { + this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); + } + if (isBind) { + if (bindingType === BIND_LEXICAL2 && expr.name === "let") { + this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); + } + if (checkClashes) { + if (hasOwn2(checkClashes, expr.name)) { + this.raiseRecoverable(expr.start, "Argument name clash"); + } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_OUTSIDE2) { + this.declareName(expr.name, bindingType, expr.start); + } + } + break; + case "ChainExpression": + this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding member expression"); + } + break; + case "ParenthesizedExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding parenthesized expression"); + } + return this.checkLValSimple(expr.expression, bindingType, checkClashes); + default: + this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); + } + }; + pp$72.checkLValPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE2; + switch (expr.type) { + case "ObjectPattern": + for (var i2 = 0, list4 = expr.properties; i2 < list4.length; i2 += 1) { + var prop = list4[i2]; + this.checkLValInnerPattern(prop, bindingType, checkClashes); + } + break; + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + if (elem) { + this.checkLValInnerPattern(elem, bindingType, checkClashes); + } + } + break; + default: + this.checkLValSimple(expr, bindingType, checkClashes); + } + }; + pp$72.checkLValInnerPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE2; + switch (expr.type) { + case "Property": + this.checkLValInnerPattern(expr.value, bindingType, checkClashes); + break; + case "AssignmentPattern": + this.checkLValPattern(expr.left, bindingType, checkClashes); + break; + case "RestElement": + this.checkLValPattern(expr.argument, bindingType, checkClashes); + break; + default: + this.checkLValPattern(expr, bindingType, checkClashes); + } + }; + var TokContext3 = function TokContext4(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; + }; + var types2 = { + b_stat: new TokContext3("{", false), + b_expr: new TokContext3("{", true), + b_tmpl: new TokContext3("${", false), + p_stat: new TokContext3("(", false), + p_expr: new TokContext3("(", true), + q_tmpl: new TokContext3("`", true, true, function(p) { + return p.tryReadTemplateToken(); + }), + f_stat: new TokContext3("function", false), + f_expr: new TokContext3("function", true), + f_expr_gen: new TokContext3("function", true, false, null, true), + f_gen: new TokContext3("function", false, false, null, true) + }; + var pp$62 = Parser3.prototype; + pp$62.initialContext = function() { + return [types2.b_stat]; + }; + pp$62.curContext = function() { + return this.context[this.context.length - 1]; + }; + pp$62.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types2.f_expr || parent === types2.f_stat) { + return true; + } + if (prevType === types$12.colon && (parent === types2.b_stat || parent === types2.b_expr)) { + return !parent.isExpr; + } + if (prevType === types$12._return || prevType === types$12.name && this.exprAllowed) { + return lineBreak2.test(this.input.slice(this.lastTokEnd, this.start)); + } + if (prevType === types$12._else || prevType === types$12.semi || prevType === types$12.eof || prevType === types$12.parenR || prevType === types$12.arrow) { + return true; + } + if (prevType === types$12.braceL) { + return parent === types2.b_stat; + } + if (prevType === types$12._var || prevType === types$12._const || prevType === types$12.name) { + return false; + } + return !this.exprAllowed; + }; + pp$62.inGeneratorContext = function() { + for (var i2 = this.context.length - 1; i2 >= 1; i2--) { + var context = this.context[i2]; + if (context.token === "function") { + return context.generator; + } + } + return false; + }; + pp$62.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types$12.dot) { + this.exprAllowed = false; + } else if (update = type.updateContext) { + update.call(this, prevType); + } else { + this.exprAllowed = type.beforeExpr; + } + }; + pp$62.overrideContext = function(tokenCtx) { + if (this.curContext() !== tokenCtx) { + this.context[this.context.length - 1] = tokenCtx; + } + }; + types$12.parenR.updateContext = types$12.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return; + } + var out = this.context.pop(); + if (out === types2.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; + }; + types$12.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types2.b_stat : types2.b_expr); + this.exprAllowed = true; + }; + types$12.dollarBraceL.updateContext = function() { + this.context.push(types2.b_tmpl); + this.exprAllowed = true; + }; + types$12.parenL.updateContext = function(prevType) { + var statementParens = prevType === types$12._if || prevType === types$12._for || prevType === types$12._with || prevType === types$12._while; + this.context.push(statementParens ? types2.p_stat : types2.p_expr); + this.exprAllowed = true; + }; + types$12.incDec.updateContext = function() { + }; + types$12._function.updateContext = types$12._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types$12._else && !(prevType === types$12.semi && this.curContext() !== types2.p_stat) && !(prevType === types$12._return && lineBreak2.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types$12.colon || prevType === types$12.braceL) && this.curContext() === types2.b_stat)) { + this.context.push(types2.f_expr); + } else { + this.context.push(types2.f_stat); + } + this.exprAllowed = false; + }; + types$12.backQuote.updateContext = function() { + if (this.curContext() === types2.q_tmpl) { + this.context.pop(); + } else { + this.context.push(types2.q_tmpl); + } + this.exprAllowed = false; + }; + types$12.star.updateContext = function(prevType) { + if (prevType === types$12._function) { + var index2 = this.context.length - 1; + if (this.context[index2] === types2.f_expr) { + this.context[index2] = types2.f_expr_gen; + } else { + this.context[index2] = types2.f_gen; + } + } + this.exprAllowed = true; + }; + types$12.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types$12.dot) { + if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { + allowed = true; + } + } + this.exprAllowed = allowed; + }; + var pp$52 = Parser3.prototype; + pp$52.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { + return; + } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) { + return; + } + var key = prop.key; + var name2; + switch (key.type) { + case "Identifier": + name2 = key.name; + break; + case "Literal": + name2 = String(key.value); + break; + default: + return; + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name2 === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors) { + if (refDestructuringErrors.doubleProto < 0) { + refDestructuringErrors.doubleProto = key.start; + } + } else { + this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); + } + } + propHash.proto = true; + } + return; + } + name2 = "$" + name2; + var other = propHash[name2]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) { + this.raiseRecoverable(key.start, "Redefinition of property"); + } + } else { + other = propHash[name2] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; + }; + pp$52.parseExpression = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); + if (this.type === types$12.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types$12.comma)) { + node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); + } + return this.finishNode(node, "SequenceExpression"); + } + return expr; + }; + pp$52.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { + return this.parseYield(forInit); + } else { + this.exprAllowed = false; + } + } + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors3(); + ownDestructuringErrors = true; + } + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types$12.parenL || this.type === types$12.name) { + this.potentialArrowAt = this.start; + this.potentialArrowInForAwait = forInit === "await"; + } + var left = this.parseMaybeConditional(forInit, refDestructuringErrors); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startPos, startLoc); + } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + if (this.type === types$12.eq) { + left = this.toAssignable(left, false, refDestructuringErrors); + } + if (!ownDestructuringErrors) { + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; + } + if (refDestructuringErrors.shorthandAssign >= left.start) { + refDestructuringErrors.shorthandAssign = -1; + } + if (this.type === types$12.eq) { + this.checkLValPattern(left); + } else { + this.checkLValSimple(left); + } + node.left = left; + this.next(); + node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) { + refDestructuringErrors.doubleProto = oldDoubleProto; + } + return this.finishNode(node, "AssignmentExpression"); + } else { + if (ownDestructuringErrors) { + this.checkExpressionErrors(refDestructuringErrors, true); + } + } + if (oldParenAssign > -1) { + refDestructuringErrors.parenthesizedAssign = oldParenAssign; + } + if (oldTrailingComma > -1) { + refDestructuringErrors.trailingComma = oldTrailingComma; + } + return left; + }; + pp$52.parseMaybeConditional = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(forInit, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + if (this.eat(types$12.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types$12.colon); + node.alternate = this.parseMaybeAssign(forInit); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; + }; + pp$52.parseExprOps = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit); + }; + pp$52.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { + var prec = this.type.binop; + if (prec != null && (!forInit || this.type !== types$12._in)) { + if (prec > minPrec) { + var logical = this.type === types$12.logicalOR || this.type === types$12.logicalAND; + var coalesce = this.type === types$12.coalesce; + if (coalesce) { + prec = types$12.logicalAND.binop; + } + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); + if (logical && this.type === types$12.coalesce || coalesce && (this.type === types$12.logicalOR || this.type === types$12.logicalAND)) { + this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); + } + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit); + } + } + return left; + }; + pp$52.buildBinary = function(startPos, startLoc, left, right, op, logical) { + if (right.type === "PrivateIdentifier") { + this.raise(right.start, "Private identifier can only be left side of binary expression"); + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression"); + }; + pp$52.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && this.canAwait) { + expr = this.parseAwait(forInit); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types$12.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true, update, forInit); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { + this.checkLValSimple(node.argument); + } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { + this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); + } else if (node.operator === "delete" && isPrivateFieldAccess2(node.argument)) { + this.raiseRecoverable(node.start, "Private fields can not be deleted"); + } else { + sawUnary = true; + } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else if (!sawUnary && this.type === types$12.privateId) { + if (forInit || this.privateNameStack.length === 0) { + this.unexpected(); + } + expr = this.parsePrivateIdent(); + if (this.type !== types$12._in) { + this.unexpected(); + } + } else { + expr = this.parseExprSubscripts(refDestructuringErrors, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.operator = this.value; + node$1.prefix = false; + node$1.argument = expr; + this.checkLValSimple(expr); + this.next(); + expr = this.finishNode(node$1, "UpdateExpression"); + } + } + if (!incDec && this.eat(types$12.starstar)) { + if (sawUnary) { + this.unexpected(this.lastTokStart); + } else { + return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false); + } + } else { + return expr; + } + }; + function isPrivateFieldAccess2(node) { + return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess2(node.expression); + } + pp$52.parseExprSubscripts = function(refDestructuringErrors, forInit) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors, forInit); + if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") { + return expr; + } + var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { + refDestructuringErrors.parenthesizedAssign = -1; + } + if (refDestructuringErrors.parenthesizedBind >= result.start) { + refDestructuringErrors.parenthesizedBind = -1; + } + if (refDestructuringErrors.trailingComma >= result.start) { + refDestructuringErrors.trailingComma = -1; + } + } + return result; + }; + pp$52.parseSubscripts = function(base2, startPos, startLoc, noCalls, forInit) { + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base2.type === "Identifier" && base2.name === "async" && this.lastTokEnd === base2.end && !this.canInsertSemicolon() && base2.end - base2.start === 5 && this.potentialArrowAt === base2.start; + var optionalChained = false; + while (true) { + var element2 = this.parseSubscript(base2, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); + if (element2.optional) { + optionalChained = true; + } + if (element2 === base2 || element2.type === "ArrowFunctionExpression") { + if (optionalChained) { + var chainNode = this.startNodeAt(startPos, startLoc); + chainNode.expression = element2; + element2 = this.finishNode(chainNode, "ChainExpression"); + } + return element2; + } + base2 = element2; + } + }; + pp$52.parseSubscript = function(base2, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { + var optionalSupported = this.options.ecmaVersion >= 11; + var optional = optionalSupported && this.eat(types$12.questionDot); + if (noCalls && optional) { + this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); + } + var computed = this.eat(types$12.bracketL); + if (computed || optional && this.type !== types$12.parenL && this.type !== types$12.backQuote || this.eat(types$12.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base2; + if (computed) { + node.property = this.parseExpression(); + this.expect(types$12.bracketR); + } else if (this.type === types$12.privateId && base2.type !== "Super") { + node.property = this.parsePrivateIdent(); + } else { + node.property = this.parseIdent(this.options.allowReserved !== "never"); + } + node.computed = !!computed; + if (optionalSupported) { + node.optional = optional; + } + base2 = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types$12.parenL)) { + var refDestructuringErrors = new DestructuringErrors3(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types$12.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$12.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) { + this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); + } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base2; + node$1.arguments = exprList; + if (optionalSupported) { + node$1.optional = optional; + } + base2 = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types$12.backQuote) { + if (optional || optionalChained) { + this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); + } + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base2; + node$2.quasi = this.parseTemplate({ isTagged: true }); + base2 = this.finishNode(node$2, "TaggedTemplateExpression"); + } + return base2; + }; + pp$52.parseExprAtom = function(refDestructuringErrors, forInit) { + if (this.type === types$12.slash) { + this.readRegexp(); + } + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types$12._super: + if (!this.allowSuper) { + this.raise(this.start, "'super' keyword outside a method"); + } + node = this.startNode(); + this.next(); + if (this.type === types$12.parenL && !this.allowDirectSuper) { + this.raise(node.start, "super() call outside constructor of a subclass"); + } + if (this.type !== types$12.dot && this.type !== types$12.bracketL && this.type !== types$12.parenL) { + this.unexpected(); + } + return this.finishNode(node, "Super"); + case types$12._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); + case types$12.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$12._function)) { + this.overrideContext(types2.f_expr); + return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit); + } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types$12.arrow)) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit); + } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$12.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types$12.arrow)) { + this.unexpected(); + } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit); + } + } + return id; + case types$12.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = { pattern: value.pattern, flags: value.flags }; + return node; + case types$12.num: + case types$12.string: + return this.parseLiteral(this.value); + case types$12._null: + case types$12._true: + case types$12._false: + node = this.startNode(); + node.value = this.type === types$12._null ? null : this.type === types$12._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal"); + case types$12.parenL: + var start3 = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { + refDestructuringErrors.parenthesizedAssign = start3; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = start3; + } + } + return expr; + case types$12.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types$12.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression"); + case types$12.braceL: + this.overrideContext(types2.b_expr); + return this.parseObj(false, refDestructuringErrors); + case types$12._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0); + case types$12._class: + return this.parseClass(this.startNode(), false); + case types$12._new: + return this.parseNew(); + case types$12.backQuote: + return this.parseTemplate(); + case types$12._import: + if (this.options.ecmaVersion >= 11) { + return this.parseExprImport(); + } else { + return this.unexpected(); + } + default: + this.unexpected(); + } + }; + pp$52.parseExprImport = function() { + var node = this.startNode(); + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword import"); + } + var meta = this.parseIdent(true); + switch (this.type) { + case types$12.parenL: + return this.parseDynamicImport(node); + case types$12.dot: + node.meta = meta; + return this.parseImportMeta(node); + default: + this.unexpected(); + } + }; + pp$52.parseDynamicImport = function(node) { + this.next(); + node.source = this.parseMaybeAssign(); + if (!this.eat(types$12.parenR)) { + var errorPos = this.start; + if (this.eat(types$12.comma) && this.eat(types$12.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); + } + } + return this.finishNode(node, "ImportExpression"); + }; + pp$52.parseImportMeta = function(node) { + this.next(); + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "meta") { + this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); + } + if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) { + this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); + } + return this.finishNode(node, "MetaProperty"); + }; + pp$52.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { + node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); + } + this.next(); + return this.finishNode(node, "Literal"); + }; + pp$52.parseParenExpression = function() { + this.expect(types$12.parenL); + var val = this.parseExpression(); + this.expect(types$12.parenR); + return val; + }; + pp$52.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors3(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + while (this.type !== types$12.parenR) { + first ? first = false : this.expect(types$12.comma); + if (allowTrailingComma && this.afterTrailingComma(types$12.parenR, true)) { + lastIsComma = true; + break; + } else if (this.type === types$12.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === types$12.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + break; + } else { + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); + } + } + var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; + this.expect(types$12.parenR); + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$12.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList, forInit); + } + if (!exprList.length || lastIsComma) { + this.unexpected(this.lastTokStart); + } + if (spreadStart) { + this.unexpected(spreadStart); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression"); + } else { + return val; + } + }; + pp$52.parseParenItem = function(item) { + return item; + }; + pp$52.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit); + }; + var empty3 = []; + pp$52.parseNew = function() { + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword new"); + } + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types$12.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target") { + this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); + } + if (!this.allowNewDotTarget) { + this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); + } + return this.finishNode(node, "MetaProperty"); + } + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$12._import; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); + if (isImport && node.callee.type === "ImportExpression") { + this.raise(startPos, "Cannot use new with import()"); + } + if (this.eat(types$12.parenL)) { + node.arguments = this.parseExprList(types$12.parenR, this.options.ecmaVersion >= 8, false); + } else { + node.arguments = empty3; + } + return this.finishNode(node, "NewExpression"); + }; + pp$52.parseTemplateElement = function(ref3) { + var isTagged = ref3.isTagged; + var elem = this.startNode(); + if (this.type === types$12.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types$12.backQuote; + return this.finishNode(elem, "TemplateElement"); + }; + pp$52.parseTemplate = function(ref3) { + if (ref3 === void 0) + ref3 = {}; + var isTagged = ref3.isTagged; + if (isTagged === void 0) + isTagged = false; + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({ isTagged }); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === types$12.eof) { + this.raise(this.pos, "Unterminated template literal"); + } + this.expect(types$12.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(types$12.braceR); + node.quasis.push(curElt = this.parseTemplateElement({ isTagged })); + } + this.next(); + return this.finishNode(node, "TemplateLiteral"); + }; + pp$52.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types$12.name || this.type === types$12.num || this.type === types$12.string || this.type === types$12.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types$12.star) && !lineBreak2.test(this.input.slice(this.lastTokEnd, this.start)); + }; + pp$52.parseObj = function(isPattern, refDestructuringErrors) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types$12.braceR)) { + if (!first) { + this.expect(types$12.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$12.braceR)) { + break; + } + } else { + first = false; + } + var prop = this.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { + this.checkPropClash(prop, propHash, refDestructuringErrors); + } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); + }; + pp$52.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types$12.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types$12.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement"); + } + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + if (this.type === types$12.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + return this.finishNode(prop, "SpreadElement"); + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) { + isGenerator = this.eat(types$12.star); + } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$12.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property"); + }; + pp$52.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types$12.colon) { + this.unexpected(); + } + if (this.eat(types$12.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types$12.parenL) { + if (isPattern) { + this.unexpected(); + } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types$12.comma && this.type !== types$12.braceR && this.type !== types$12.eq)) { + if (isGenerator || isAsync) { + this.unexpected(); + } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start3 = prop.value.start; + if (prop.kind === "get") { + this.raiseRecoverable(start3, "getter should have no params"); + } else { + this.raiseRecoverable(start3, "setter should have exactly one param"); + } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { + this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); + } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { + this.unexpected(); + } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = startPos; + } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else if (this.type === types$12.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) { + refDestructuringErrors.shorthandAssign = this.start; + } + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else { + prop.value = this.copyNode(prop.key); + } + prop.shorthand = true; + } else { + this.unexpected(); + } + }; + pp$52.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types$12.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types$12.bracketR); + return prop.key; + } else { + prop.computed = false; + } + } + return prop.key = this.type === types$12.num || this.type === types$12.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"); + }; + pp$52.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { + node.generator = node.expression = false; + } + if (this.options.ecmaVersion >= 8) { + node.async = false; + } + }; + pp$52.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.initFunction(node); + if (this.options.ecmaVersion >= 6) { + node.generator = isGenerator; + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags2(isAsync, node.generator) | SCOPE_SUPER2 | (allowDirectSuper ? SCOPE_DIRECT_SUPER2 : 0)); + this.expect(types$12.parenL); + node.params = this.parseBindingList(types$12.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true, false); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression"); + }; + pp$52.parseArrowExpression = function(node, params, isAsync, forInit) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.enterScope(functionFlags2(isAsync, false) | SCOPE_ARROW2); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression"); + }; + pp$52.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { + var isExpression = isArrowFunction && this.type !== types$12.braceL; + var oldStrict = this.strict, useStrict = false; + if (isExpression) { + node.body = this.parseMaybeAssign(forInit); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + if (useStrict && nonSimple) { + this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); + } + } + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { + this.strict = true; + } + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + if (this.strict && node.id) { + this.checkLValSimple(node.id, BIND_OUTSIDE2); + } + node.body = this.parseBlock(false, void 0, useStrict && !oldStrict); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); + }; + pp$52.isSimpleParamList = function(params) { + for (var i2 = 0, list4 = params; i2 < list4.length; i2 += 1) { + var param = list4[i2]; + if (param.type !== "Identifier") { + return false; + } + } + return true; + }; + pp$52.checkParams = function(node, allowDuplicates) { + var nameHash = /* @__PURE__ */ Object.create(null); + for (var i2 = 0, list4 = node.params; i2 < list4.length; i2 += 1) { + var param = list4[i2]; + this.checkLValInnerPattern(param, BIND_VAR2, allowDuplicates ? null : nameHash); + } + }; + pp$52.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(types$12.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } + } else { + first = false; + } + var elt = void 0; + if (allowEmpty && this.type === types$12.comma) { + elt = null; + } else if (this.type === types$12.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this.type === types$12.comma && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts; + }; + pp$52.checkUnreserved = function(ref3) { + var start3 = ref3.start; + var end = ref3.end; + var name2 = ref3.name; + if (this.inGenerator && name2 === "yield") { + this.raiseRecoverable(start3, "Cannot use 'yield' as identifier inside a generator"); + } + if (this.inAsync && name2 === "await") { + this.raiseRecoverable(start3, "Cannot use 'await' as identifier inside an async function"); + } + if (this.currentThisScope().inClassFieldInit && name2 === "arguments") { + this.raiseRecoverable(start3, "Cannot use 'arguments' in class field initializer"); + } + if (this.inClassStaticBlock && (name2 === "arguments" || name2 === "await")) { + this.raise(start3, "Cannot use " + name2 + " in class static initialization block"); + } + if (this.keywords.test(name2)) { + this.raise(start3, "Unexpected keyword '" + name2 + "'"); + } + if (this.options.ecmaVersion < 6 && this.input.slice(start3, end).indexOf("\\") !== -1) { + return; + } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name2)) { + if (!this.inAsync && name2 === "await") { + this.raiseRecoverable(start3, "Cannot use keyword 'await' outside an async function"); + } + this.raiseRecoverable(start3, "The keyword '" + name2 + "' is reserved"); + } + }; + pp$52.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (this.type === types$12.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(!!liberal); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = node.start; + } + } + return node; + }; + pp$52.parsePrivateIdent = function() { + var node = this.startNode(); + if (this.type === types$12.privateId) { + node.name = this.value; + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "PrivateIdentifier"); + if (this.privateNameStack.length === 0) { + this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class"); + } else { + this.privateNameStack[this.privateNameStack.length - 1].used.push(node); + } + return node; + }; + pp$52.parseYield = function(forInit) { + if (!this.yieldPos) { + this.yieldPos = this.start; + } + var node = this.startNode(); + this.next(); + if (this.type === types$12.semi || this.canInsertSemicolon() || this.type !== types$12.star && !this.type.startsExpr) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types$12.star); + node.argument = this.parseMaybeAssign(forInit); + } + return this.finishNode(node, "YieldExpression"); + }; + pp$52.parseAwait = function(forInit) { + if (!this.awaitPos) { + this.awaitPos = this.start; + } + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true, false, forInit); + return this.finishNode(node, "AwaitExpression"); + }; + var pp$42 = Parser3.prototype; + pp$42.raise = function(pos, message) { + var loc = getLineInfo2(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; + err.loc = loc; + err.raisedAt = this.pos; + throw err; + }; + pp$42.raiseRecoverable = pp$42.raise; + pp$42.curPosition = function() { + if (this.options.locations) { + return new Position3(this.curLine, this.pos - this.lineStart); + } + }; + var pp$32 = Parser3.prototype; + var Scope4 = function Scope5(flags) { + this.flags = flags; + this.var = []; + this.lexical = []; + this.functions = []; + this.inClassFieldInit = false; + }; + pp$32.enterScope = function(flags) { + this.scopeStack.push(new Scope4(flags)); + }; + pp$32.exitScope = function() { + this.scopeStack.pop(); + }; + pp$32.treatFunctionsAsVarInScope = function(scope) { + return scope.flags & SCOPE_FUNCTION2 || !this.inModule && scope.flags & SCOPE_TOP2; + }; + pp$32.declareName = function(name2, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL2) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name2) > -1 || scope.functions.indexOf(name2) > -1 || scope.var.indexOf(name2) > -1; + scope.lexical.push(name2); + if (this.inModule && scope.flags & SCOPE_TOP2) { + delete this.undefinedExports[name2]; + } + } else if (bindingType === BIND_SIMPLE_CATCH2) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name2); + } else if (bindingType === BIND_FUNCTION2) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) { + redeclared = scope$2.lexical.indexOf(name2) > -1; + } else { + redeclared = scope$2.lexical.indexOf(name2) > -1 || scope$2.var.indexOf(name2) > -1; + } + scope$2.functions.push(name2); + } else { + for (var i2 = this.scopeStack.length - 1; i2 >= 0; --i2) { + var scope$3 = this.scopeStack[i2]; + if (scope$3.lexical.indexOf(name2) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH2 && scope$3.lexical[0] === name2) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name2) > -1) { + redeclared = true; + break; + } + scope$3.var.push(name2); + if (this.inModule && scope$3.flags & SCOPE_TOP2) { + delete this.undefinedExports[name2]; + } + if (scope$3.flags & SCOPE_VAR2) { + break; + } + } + } + if (redeclared) { + this.raiseRecoverable(pos, "Identifier '" + name2 + "' has already been declared"); + } + }; + pp$32.checkLocalExport = function(id) { + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } + }; + pp$32.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1]; + }; + pp$32.currentVarScope = function() { + for (var i2 = this.scopeStack.length - 1; ; i2--) { + var scope = this.scopeStack[i2]; + if (scope.flags & SCOPE_VAR2) { + return scope; + } + } + }; + pp$32.currentThisScope = function() { + for (var i2 = this.scopeStack.length - 1; ; i2--) { + var scope = this.scopeStack[i2]; + if (scope.flags & SCOPE_VAR2 && !(scope.flags & SCOPE_ARROW2)) { + return scope; + } + } + }; + var Node3 = function Node4(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) { + this.loc = new SourceLocation3(parser, loc); + } + if (parser.options.directSourceFile) { + this.sourceFile = parser.options.directSourceFile; + } + if (parser.options.ranges) { + this.range = [pos, 0]; + } + }; + var pp$22 = Parser3.prototype; + pp$22.startNode = function() { + return new Node3(this, this.start, this.startLoc); + }; + pp$22.startNodeAt = function(pos, loc) { + return new Node3(this, pos, loc); + }; + function finishNodeAt2(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) { + node.loc.end = loc; + } + if (this.options.ranges) { + node.range[1] = pos; + } + return node; + } + pp$22.finishNode = function(node, type) { + return finishNodeAt2.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc); + }; + pp$22.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt2.call(this, node, type, pos, loc); + }; + pp$22.copyNode = function(node) { + var newNode = new Node3(this, node.start, this.startLoc); + for (var prop in node) { + newNode[prop] = node[prop]; + } + return newNode; + }; + var ecma9BinaryProperties2 = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; + var ecma10BinaryProperties2 = ecma9BinaryProperties2 + " Extended_Pictographic"; + var ecma11BinaryProperties2 = ecma10BinaryProperties2; + var ecma12BinaryProperties2 = ecma11BinaryProperties2 + " EBase EComp EMod EPres ExtPict"; + var ecma13BinaryProperties2 = ecma12BinaryProperties2; + var unicodeBinaryProperties2 = { + 9: ecma9BinaryProperties2, + 10: ecma10BinaryProperties2, + 11: ecma11BinaryProperties2, + 12: ecma12BinaryProperties2, + 13: ecma13BinaryProperties2 + }; + var unicodeGeneralCategoryValues2 = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; + var ecma9ScriptValues2 = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var ecma10ScriptValues2 = ecma9ScriptValues2 + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; + var ecma11ScriptValues2 = ecma10ScriptValues2 + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; + var ecma12ScriptValues2 = ecma11ScriptValues2 + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; + var ecma13ScriptValues2 = ecma12ScriptValues2 + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; + var unicodeScriptValues2 = { + 9: ecma9ScriptValues2, + 10: ecma10ScriptValues2, + 11: ecma11ScriptValues2, + 12: ecma12ScriptValues2, + 13: ecma13ScriptValues2 + }; + var data2 = {}; + function buildUnicodeData2(ecmaVersion2) { + var d = data2[ecmaVersion2] = { + binary: wordsRegexp2(unicodeBinaryProperties2[ecmaVersion2] + " " + unicodeGeneralCategoryValues2), + nonBinary: { + General_Category: wordsRegexp2(unicodeGeneralCategoryValues2), + Script: wordsRegexp2(unicodeScriptValues2[ecmaVersion2]) + } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; + } + for (var i = 0, list3 = [9, 10, 11, 12, 13]; i < list3.length; i += 1) { + var ecmaVersion = list3[i]; + buildUnicodeData2(ecmaVersion); + } + var pp$12 = Parser3.prototype; + var RegExpValidationState3 = function RegExpValidationState4(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); + this.unicodeProperties = data2[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; + }; + RegExpValidationState3.prototype.reset = function reset2(start3, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start3 | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; + }; + RegExpValidationState3.prototype.raise = function raise2(message) { + this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message); + }; + RegExpValidationState3.prototype.at = function at2(i2, forceU) { + if (forceU === void 0) + forceU = false; + var s = this.source; + var l = s.length; + if (i2 >= l) { + return -1; + } + var c = s.charCodeAt(i2); + if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i2 + 1 >= l) { + return c; + } + var next = s.charCodeAt(i2 + 1); + return next >= 56320 && next <= 57343 ? (c << 10) + next - 56613888 : c; + }; + RegExpValidationState3.prototype.nextIndex = function nextIndex2(i2, forceU) { + if (forceU === void 0) + forceU = false; + var s = this.source; + var l = s.length; + if (i2 >= l) { + return l; + } + var c = s.charCodeAt(i2), next; + if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i2 + 1 >= l || (next = s.charCodeAt(i2 + 1)) < 56320 || next > 57343) { + return i2 + 1; + } + return i2 + 2; + }; + RegExpValidationState3.prototype.current = function current2(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.pos, forceU); + }; + RegExpValidationState3.prototype.lookahead = function lookahead2(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.nextIndex(this.pos, forceU), forceU); + }; + RegExpValidationState3.prototype.advance = function advance2(forceU) { + if (forceU === void 0) + forceU = false; + this.pos = this.nextIndex(this.pos, forceU); + }; + RegExpValidationState3.prototype.eat = function eat2(ch, forceU) { + if (forceU === void 0) + forceU = false; + if (this.current(forceU) === ch) { + this.advance(forceU); + return true; + } + return false; + }; + pp$12.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; + for (var i2 = 0; i2 < flags.length; i2++) { + var flag = flags.charAt(i2); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i2 + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + } + }; + pp$12.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } + }; + pp$12.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + this.regexp_disjunction(state); + if (state.pos !== state.source.length) { + if (state.eat(41)) { + state.raise("Unmatched ')'"); + } + if (state.eat(93) || state.eat(125)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i2 = 0, list4 = state.backReferenceNames; i2 < list4.length; i2 += 1) { + var name2 = list4[i2]; + if (state.groupNames.indexOf(name2) === -1) { + state.raise("Invalid named capture referenced"); + } + } + }; + pp$12.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat(124)) { + this.regexp_alternative(state); + } + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(123)) { + state.raise("Lone quantifier brackets"); + } + }; + pp$12.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) { + } + }; + pp$12.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true; + } + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true; + } + return false; + }; + pp$12.regexp_eatAssertion = function(state) { + var start3 = state.pos; + state.lastAssertionIsQuantifiable = false; + if (state.eat(94) || state.eat(36)) { + return true; + } + if (state.eat(92)) { + if (state.eat(66) || state.eat(98)) { + return true; + } + state.pos = start3; + } + if (state.eat(40) && state.eat(63)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(60); + } + if (state.eat(61) || state.eat(33)) { + this.regexp_disjunction(state); + if (!state.eat(41)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true; + } + } + state.pos = start3; + return false; + }; + pp$12.regexp_eatQuantifier = function(state, noError) { + if (noError === void 0) + noError = false; + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(63); + return true; + } + return false; + }; + pp$12.regexp_eatQuantifierPrefix = function(state, noError) { + return state.eat(42) || state.eat(43) || state.eat(63) || this.regexp_eatBracedQuantifier(state, noError); + }; + pp$12.regexp_eatBracedQuantifier = function(state, noError) { + var start3 = state.pos; + if (state.eat(123)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(44) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(125)) { + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true; + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatAtom = function(state) { + return this.regexp_eatPatternCharacters(state) || state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state); + }; + pp$12.regexp_eatReverseSolidusAtomEscape = function(state) { + var start3 = state.pos; + if (state.eat(92)) { + if (this.regexp_eatAtomEscape(state)) { + return true; + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatUncapturingGroup = function(state) { + var start3 = state.pos; + if (state.eat(40)) { + if (state.eat(63) && state.eat(58)) { + this.regexp_disjunction(state); + if (state.eat(41)) { + return true; + } + state.raise("Unterminated group"); + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatCapturingGroup = function(state) { + if (state.eat(40)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 63) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(41)) { + state.numCapturingParens += 1; + return true; + } + state.raise("Unterminated group"); + } + return false; + }; + pp$12.regexp_eatExtendedAtom = function(state) { + return state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state); + }; + pp$12.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false; + }; + pp$12.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter2(ch)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; + }; + function isSyntaxCharacter2(ch) { + return ch === 36 || ch >= 40 && ch <= 43 || ch === 46 || ch === 63 || ch >= 91 && ch <= 94 || ch >= 123 && ch <= 125; + } + pp$12.regexp_eatPatternCharacters = function(state) { + var start3 = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter2(ch)) { + state.advance(); + } + return state.pos !== start3; + }; + pp$12.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if (ch !== -1 && ch !== 36 && !(ch >= 40 && ch <= 43) && ch !== 46 && ch !== 63 && ch !== 91 && ch !== 94 && ch !== 124) { + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_groupSpecifier = function(state) { + if (state.eat(63)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return; + } + state.raise("Invalid group"); + } + }; + pp$12.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(60)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(62)) { + return true; + } + state.raise("Invalid capture group name"); + } + return false; + }; + pp$12.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString2(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString2(state.lastIntValue); + } + return true; + } + return false; + }; + pp$12.regexp_eatRegExpIdentifierStart = function(state) { + var start3 = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart2(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start3; + return false; + }; + function isRegExpIdentifierStart2(ch) { + return isIdentifierStart2(ch, true) || ch === 36 || ch === 95; + } + pp$12.regexp_eatRegExpIdentifierPart = function(state) { + var start3 = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart2(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start3; + return false; + }; + function isRegExpIdentifierPart2(ch) { + return isIdentifierChar2(ch, true) || ch === 36 || ch === 95 || ch === 8204 || ch === 8205; + } + pp$12.regexp_eatAtomEscape = function(state) { + if (this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || state.switchN && this.regexp_eatKGroupName(state)) { + return true; + } + if (state.switchU) { + if (state.current() === 99) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false; + }; + pp$12.regexp_eatBackReference = function(state) { + var start3 = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true; + } + if (n <= state.numCapturingParens) { + return true; + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatKGroupName = function(state) { + if (state.eat(107)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true; + } + state.raise("Invalid named reference"); + } + return false; + }; + pp$12.regexp_eatCharacterEscape = function(state) { + return this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || !state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state) || this.regexp_eatIdentityEscape(state); + }; + pp$12.regexp_eatCControlLetter = function(state) { + var start3 = state.pos; + if (state.eat(99)) { + if (this.regexp_eatControlLetter(state)) { + return true; + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatZero = function(state) { + if (state.current() === 48 && !isDecimalDigit2(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 116) { + state.lastIntValue = 9; + state.advance(); + return true; + } + if (ch === 110) { + state.lastIntValue = 10; + state.advance(); + return true; + } + if (ch === 118) { + state.lastIntValue = 11; + state.advance(); + return true; + } + if (ch === 102) { + state.lastIntValue = 12; + state.advance(); + return true; + } + if (ch === 114) { + state.lastIntValue = 13; + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter2(ch)) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; + }; + function isControlLetter2(ch) { + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122; + } + pp$12.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + if (forceU === void 0) + forceU = false; + var start3 = state.pos; + var switchU = forceU || state.switchU; + if (state.eat(117)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (switchU && lead >= 55296 && lead <= 56319) { + var leadSurrogateEnd = state.pos; + if (state.eat(92) && state.eat(117) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 56320 && trail <= 57343) { + state.lastIntValue = (lead - 55296) * 1024 + (trail - 56320) + 65536; + return true; + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true; + } + if (switchU && state.eat(123) && this.regexp_eatHexDigits(state) && state.eat(125) && isValidUnicode2(state.lastIntValue)) { + return true; + } + if (switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start3; + } + return false; + }; + function isValidUnicode2(ch) { + return ch >= 0 && ch <= 1114111; + } + pp$12.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true; + } + if (state.eat(47)) { + state.lastIntValue = 47; + return true; + } + return false; + } + var ch = state.current(); + if (ch !== 99 && (!state.switchN || ch !== 107)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 49 && ch <= 57) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } while ((ch = state.current()) >= 48 && ch <= 57); + return true; + } + return false; + }; + pp$12.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + if (isCharacterClassEscape2(ch)) { + state.lastIntValue = -1; + state.advance(); + return true; + } + if (state.switchU && this.options.ecmaVersion >= 9 && (ch === 80 || ch === 112)) { + state.lastIntValue = -1; + state.advance(); + if (state.eat(123) && this.regexp_eatUnicodePropertyValueExpression(state) && state.eat(125)) { + return true; + } + state.raise("Invalid property name"); + } + return false; + }; + function isCharacterClassEscape2(ch) { + return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87; + } + pp$12.regexp_eatUnicodePropertyValueExpression = function(state) { + var start3 = state.pos; + if (this.regexp_eatUnicodePropertyName(state) && state.eat(61)) { + var name2 = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name2, value); + return true; + } + } + state.pos = start3; + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true; + } + return false; + }; + pp$12.regexp_validateUnicodePropertyNameAndValue = function(state, name2, value) { + if (!hasOwn2(state.unicodeProperties.nonBinary, name2)) { + state.raise("Invalid property name"); + } + if (!state.unicodeProperties.nonBinary[name2].test(value)) { + state.raise("Invalid property value"); + } + }; + pp$12.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (!state.unicodeProperties.binary.test(nameOrValue)) { + state.raise("Invalid property name"); + } + }; + pp$12.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter2(ch = state.current())) { + state.lastStringValue += codePointToString2(ch); + state.advance(); + } + return state.lastStringValue !== ""; + }; + function isUnicodePropertyNameCharacter2(ch) { + return isControlLetter2(ch) || ch === 95; + } + pp$12.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter2(ch = state.current())) { + state.lastStringValue += codePointToString2(ch); + state.advance(); + } + return state.lastStringValue !== ""; + }; + function isUnicodePropertyValueCharacter2(ch) { + return isUnicodePropertyNameCharacter2(ch) || isDecimalDigit2(ch); + } + pp$12.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state); + }; + pp$12.regexp_eatCharacterClass = function(state) { + if (state.eat(91)) { + state.eat(94); + this.regexp_classRanges(state); + if (state.eat(93)) { + return true; + } + state.raise("Unterminated character class"); + } + return false; + }; + pp$12.regexp_classRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(45) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } + }; + pp$12.regexp_eatClassAtom = function(state) { + var start3 = state.pos; + if (state.eat(92)) { + if (this.regexp_eatClassEscape(state)) { + return true; + } + if (state.switchU) { + var ch$1 = state.current(); + if (ch$1 === 99 || isOctalDigit2(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start3; + } + var ch = state.current(); + if (ch !== 93) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_eatClassEscape = function(state) { + var start3 = state.pos; + if (state.eat(98)) { + state.lastIntValue = 8; + return true; + } + if (state.switchU && state.eat(45)) { + state.lastIntValue = 45; + return true; + } + if (!state.switchU && state.eat(99)) { + if (this.regexp_eatClassControlLetter(state)) { + return true; + } + state.pos = start3; + } + return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state); + }; + pp$12.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit2(ch) || ch === 95) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; + }; + pp$12.regexp_eatHexEscapeSequence = function(state) { + var start3 = state.pos; + if (state.eat(120)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true; + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start3; + } + return false; + }; + pp$12.regexp_eatDecimalDigits = function(state) { + var start3 = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit2(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } + return state.pos !== start3; + }; + function isDecimalDigit2(ch) { + return ch >= 48 && ch <= 57; + } + pp$12.regexp_eatHexDigits = function(state) { + var start3 = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit2(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt2(ch); + state.advance(); + } + return state.pos !== start3; + }; + function isHexDigit2(ch) { + return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102; + } + function hexToInt2(ch) { + if (ch >= 65 && ch <= 70) { + return 10 + (ch - 65); + } + if (ch >= 97 && ch <= 102) { + return 10 + (ch - 97); + } + return ch - 48; + } + pp$12.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true; + } + return false; + }; + pp$12.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit2(ch)) { + state.lastIntValue = ch - 48; + state.advance(); + return true; + } + state.lastIntValue = 0; + return false; + }; + function isOctalDigit2(ch) { + return ch >= 48 && ch <= 55; + } + pp$12.regexp_eatFixedHexDigits = function(state, length) { + var start3 = state.pos; + state.lastIntValue = 0; + for (var i2 = 0; i2 < length; ++i2) { + var ch = state.current(); + if (!isHexDigit2(ch)) { + state.pos = start3; + return false; + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt2(ch); + state.advance(); + } + return true; + }; + var Token3 = function Token4(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) { + this.loc = new SourceLocation3(p, p.startLoc, p.endLoc); + } + if (p.options.ranges) { + this.range = [p.start, p.end]; + } + }; + var pp2 = Parser3.prototype; + pp2.next = function(ignoreEscapeSequenceInKeyword) { + if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); + } + if (this.options.onToken) { + this.options.onToken(new Token3(this)); + } + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); + }; + pp2.getToken = function() { + this.next(); + return new Token3(this); + }; + if (typeof Symbol !== "undefined") { + pp2[Symbol.iterator] = function() { + var this$1$1 = this; + return { + next: function() { + var token = this$1$1.getToken(); + return { + done: token.type === types$12.eof, + value: token + }; + } + }; + }; + } + pp2.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { + this.skipSpace(); + } + this.start = this.pos; + if (this.options.locations) { + this.startLoc = this.curPosition(); + } + if (this.pos >= this.input.length) { + return this.finishToken(types$12.eof); + } + if (curContext.override) { + return curContext.override(this); + } else { + this.readToken(this.fullCharCodeAtPos()); + } + }; + pp2.readToken = function(code2) { + if (isIdentifierStart2(code2, this.options.ecmaVersion >= 6) || code2 === 92) { + return this.readWord(); + } + return this.getTokenFromCode(code2); + }; + pp2.fullCharCodeAtPos = function() { + var code2 = this.input.charCodeAt(this.pos); + if (code2 <= 55295 || code2 >= 56320) { + return code2; + } + var next = this.input.charCodeAt(this.pos + 1); + return next <= 56319 || next >= 57344 ? code2 : (code2 << 10) + next - 56613888; + }; + pp2.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start3 = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { + this.raise(this.pos - 2, "Unterminated comment"); + } + this.pos = end + 2; + if (this.options.locations) { + for (var nextBreak = void 0, pos = start3; (nextBreak = nextLineBreak2(this.input, pos, this.pos)) > -1; ) { + ++this.curLine; + pos = this.lineStart = nextBreak; + } + } + if (this.options.onComment) { + this.options.onComment( + true, + this.input.slice(start3 + 2, end), + start3, + this.pos, + startLoc, + this.curPosition() + ); + } + }; + pp2.skipLineComment = function(startSkip) { + var start3 = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine2(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) { + this.options.onComment( + false, + this.input.slice(start3 + startSkip, this.pos), + start3, + this.pos, + startLoc, + this.curPosition() + ); + } + }; + pp2.skipSpace = function() { + loop: + while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: + case 160: + ++this.pos; + break; + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10: + case 8232: + case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break; + case 47: + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: + this.skipBlockComment(); + break; + case 47: + this.skipLineComment(2); + break; + default: + break loop; + } + break; + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace2.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop; + } + } + } + }; + pp2.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { + this.endLoc = this.curPosition(); + } + var prevType = this.type; + this.type = type; + this.value = val; + this.updateContext(prevType); + }; + pp2.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { + return this.readNumber(true); + } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { + this.pos += 3; + return this.finishToken(types$12.ellipsis); + } else { + ++this.pos; + return this.finishToken(types$12.dot); + } + }; + pp2.readToken_slash = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { + ++this.pos; + return this.readRegexp(); + } + if (next === 61) { + return this.finishOp(types$12.assign, 2); + } + return this.finishOp(types$12.slash, 1); + }; + pp2.readToken_mult_modulo_exp = function(code2) { + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code2 === 42 ? types$12.star : types$12.modulo; + if (this.options.ecmaVersion >= 7 && code2 === 42 && next === 42) { + ++size; + tokentype = types$12.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + if (next === 61) { + return this.finishOp(types$12.assign, size + 1); + } + return this.finishOp(tokentype, size); + }; + pp2.readToken_pipe_amp = function(code2) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code2) { + if (this.options.ecmaVersion >= 12) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 === 61) { + return this.finishOp(types$12.assign, 3); + } + } + return this.finishOp(code2 === 124 ? types$12.logicalOR : types$12.logicalAND, 2); + } + if (next === 61) { + return this.finishOp(types$12.assign, 2); + } + return this.finishOp(code2 === 124 ? types$12.bitwiseOR : types$12.bitwiseAND, 1); + }; + pp2.readToken_caret = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$12.assign, 2); + } + return this.finishOp(types$12.bitwiseXOR, 1); + }; + pp2.readToken_plus_min = function(code2) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code2) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak2.test(this.input.slice(this.lastTokEnd, this.pos)))) { + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + return this.finishOp(types$12.incDec, 2); + } + if (next === 61) { + return this.finishOp(types$12.assign, 2); + } + return this.finishOp(types$12.plusMin, 1); + }; + pp2.readToken_lt_gt = function(code2) { + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code2) { + size = code2 === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { + return this.finishOp(types$12.assign, size + 1); + } + return this.finishOp(types$12.bitShift, size); + } + if (next === 33 && code2 === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { + this.skipLineComment(4); + this.skipSpace(); + return this.nextToken(); + } + if (next === 61) { + size = 2; + } + return this.finishOp(types$12.relational, size); + }; + pp2.readToken_eq_excl = function(code2) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$12.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2); + } + if (code2 === 61 && next === 62 && this.options.ecmaVersion >= 6) { + this.pos += 2; + return this.finishToken(types$12.arrow); + } + return this.finishOp(code2 === 61 ? types$12.eq : types$12.prefix, 1); + }; + pp2.readToken_question = function() { + var ecmaVersion2 = this.options.ecmaVersion; + if (ecmaVersion2 >= 11) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 46) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 < 48 || next2 > 57) { + return this.finishOp(types$12.questionDot, 2); + } + } + if (next === 63) { + if (ecmaVersion2 >= 12) { + var next2$1 = this.input.charCodeAt(this.pos + 2); + if (next2$1 === 61) { + return this.finishOp(types$12.assign, 3); + } + } + return this.finishOp(types$12.coalesce, 2); + } + } + return this.finishOp(types$12.question, 1); + }; + pp2.readToken_numberSign = function() { + var ecmaVersion2 = this.options.ecmaVersion; + var code2 = 35; + if (ecmaVersion2 >= 13) { + ++this.pos; + code2 = this.fullCharCodeAtPos(); + if (isIdentifierStart2(code2, true) || code2 === 92) { + return this.finishToken(types$12.privateId, this.readWord1()); + } + } + this.raise(this.pos, "Unexpected character '" + codePointToString2(code2) + "'"); + }; + pp2.getTokenFromCode = function(code2) { + switch (code2) { + case 46: + return this.readToken_dot(); + case 40: + ++this.pos; + return this.finishToken(types$12.parenL); + case 41: + ++this.pos; + return this.finishToken(types$12.parenR); + case 59: + ++this.pos; + return this.finishToken(types$12.semi); + case 44: + ++this.pos; + return this.finishToken(types$12.comma); + case 91: + ++this.pos; + return this.finishToken(types$12.bracketL); + case 93: + ++this.pos; + return this.finishToken(types$12.bracketR); + case 123: + ++this.pos; + return this.finishToken(types$12.braceL); + case 125: + ++this.pos; + return this.finishToken(types$12.braceR); + case 58: + ++this.pos; + return this.finishToken(types$12.colon); + case 96: + if (this.options.ecmaVersion < 6) { + break; + } + ++this.pos; + return this.finishToken(types$12.backQuote); + case 48: + var next = this.input.charCodeAt(this.pos + 1); + if (next === 120 || next === 88) { + return this.readRadixNumber(16); + } + if (this.options.ecmaVersion >= 6) { + if (next === 111 || next === 79) { + return this.readRadixNumber(8); + } + if (next === 98 || next === 66) { + return this.readRadixNumber(2); + } + } + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return this.readNumber(false); + case 34: + case 39: + return this.readString(code2); + case 47: + return this.readToken_slash(); + case 37: + case 42: + return this.readToken_mult_modulo_exp(code2); + case 124: + case 38: + return this.readToken_pipe_amp(code2); + case 94: + return this.readToken_caret(); + case 43: + case 45: + return this.readToken_plus_min(code2); + case 60: + case 62: + return this.readToken_lt_gt(code2); + case 61: + case 33: + return this.readToken_eq_excl(code2); + case 63: + return this.readToken_question(); + case 126: + return this.finishOp(types$12.prefix, 1); + case 35: + return this.readToken_numberSign(); + } + this.raise(this.pos, "Unexpected character '" + codePointToString2(code2) + "'"); + }; + pp2.finishOp = function(type, size) { + var str = this.input.slice(this.pos, this.pos + size); + this.pos += size; + return this.finishToken(type, str); + }; + pp2.readRegexp = function() { + var escaped, inClass, start3 = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(start3, "Unterminated regular expression"); + } + var ch = this.input.charAt(this.pos); + if (lineBreak2.test(ch)) { + this.raise(start3, "Unterminated regular expression"); + } + if (!escaped) { + if (ch === "[") { + inClass = true; + } else if (ch === "]" && inClass) { + inClass = false; + } else if (ch === "/" && !inClass) { + break; + } + escaped = ch === "\\"; + } else { + escaped = false; + } + ++this.pos; + } + var pattern = this.input.slice(start3, this.pos); + ++this.pos; + var flagsStart = this.pos; + var flags = this.readWord1(); + if (this.containsEsc) { + this.unexpected(flagsStart); + } + var state = this.regexpState || (this.regexpState = new RegExpValidationState3(this)); + state.reset(start3, pattern, flags); + this.validateRegExpFlags(state); + this.validateRegExpPattern(state); + var value = null; + try { + value = new RegExp(pattern, flags); + } catch (e) { + } + return this.finishToken(types$12.regexp, { pattern, flags, value }); + }; + pp2.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { + var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; + var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; + var start3 = this.pos, total = 0, lastCode = 0; + for (var i2 = 0, e = len == null ? Infinity : len; i2 < e; ++i2, ++this.pos) { + var code2 = this.input.charCodeAt(this.pos), val = void 0; + if (allowSeparators && code2 === 95) { + if (isLegacyOctalNumericLiteral) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); + } + if (lastCode === 95) { + this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); + } + if (i2 === 0) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); + } + lastCode = code2; + continue; + } + if (code2 >= 97) { + val = code2 - 97 + 10; + } else if (code2 >= 65) { + val = code2 - 65 + 10; + } else if (code2 >= 48 && code2 <= 57) { + val = code2 - 48; + } else { + val = Infinity; + } + if (val >= radix) { + break; + } + lastCode = code2; + total = total * radix + val; + } + if (allowSeparators && lastCode === 95) { + this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); + } + if (this.pos === start3 || len != null && this.pos - start3 !== len) { + return null; + } + return total; + }; + function stringToNumber2(str, isLegacyOctalNumericLiteral) { + if (isLegacyOctalNumericLiteral) { + return parseInt(str, 8); + } + return parseFloat(str.replace(/_/g, "")); + } + function stringToBigInt2(str) { + if (typeof BigInt !== "function") { + return null; + } + return BigInt(str.replace(/_/g, "")); + } + pp2.readRadixNumber = function(radix) { + var start3 = this.pos; + this.pos += 2; + var val = this.readInt(radix); + if (val == null) { + this.raise(this.start + 2, "Expected number in radix " + radix); + } + if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) { + val = stringToBigInt2(this.input.slice(start3, this.pos)); + ++this.pos; + } else if (isIdentifierStart2(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$12.num, val); + }; + pp2.readNumber = function(startsWithDot) { + var start3 = this.pos; + if (!startsWithDot && this.readInt(10, void 0, true) === null) { + this.raise(start3, "Invalid number"); + } + var octal = this.pos - start3 >= 2 && this.input.charCodeAt(start3) === 48; + if (octal && this.strict) { + this.raise(start3, "Invalid number"); + } + var next = this.input.charCodeAt(this.pos); + if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) { + var val$1 = stringToBigInt2(this.input.slice(start3, this.pos)); + ++this.pos; + if (isIdentifierStart2(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$12.num, val$1); + } + if (octal && /[89]/.test(this.input.slice(start3, this.pos))) { + octal = false; + } + if (next === 46 && !octal) { + ++this.pos; + this.readInt(10); + next = this.input.charCodeAt(this.pos); + } + if ((next === 69 || next === 101) && !octal) { + next = this.input.charCodeAt(++this.pos); + if (next === 43 || next === 45) { + ++this.pos; + } + if (this.readInt(10) === null) { + this.raise(start3, "Invalid number"); + } + } + if (isIdentifierStart2(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + var val = stringToNumber2(this.input.slice(start3, this.pos), octal); + return this.finishToken(types$12.num, val); + }; + pp2.readCodePoint = function() { + var ch = this.input.charCodeAt(this.pos), code2; + if (ch === 123) { + if (this.options.ecmaVersion < 6) { + this.unexpected(); + } + var codePos = ++this.pos; + code2 = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos); + ++this.pos; + if (code2 > 1114111) { + this.invalidStringToken(codePos, "Code point out of bounds"); + } + } else { + code2 = this.readHexChar(4); + } + return code2; + }; + pp2.readString = function(quote) { + var out = "", chunkStart = ++this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated string constant"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === quote) { + break; + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(false); + chunkStart = this.pos; + } else if (ch === 8232 || ch === 8233) { + if (this.options.ecmaVersion < 10) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + if (this.options.locations) { + this.curLine++; + this.lineStart = this.pos; + } + } else { + if (isNewLine2(ch)) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(types$12.string, out); + }; + var INVALID_TEMPLATE_ESCAPE_ERROR2 = {}; + pp2.tryReadTemplateToken = function() { + this.inTemplateElement = true; + try { + this.readTmplToken(); + } catch (err) { + if (err === INVALID_TEMPLATE_ESCAPE_ERROR2) { + this.readInvalidTemplateToken(); + } else { + throw err; + } + } + this.inTemplateElement = false; + }; + pp2.invalidStringToken = function(position3, message) { + if (this.inTemplateElement && this.options.ecmaVersion >= 9) { + throw INVALID_TEMPLATE_ESCAPE_ERROR2; + } else { + this.raise(position3, message); + } + }; + pp2.readTmplToken = function() { + var out = "", chunkStart = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated template"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { + if (this.pos === this.start && (this.type === types$12.template || this.type === types$12.invalidTemplate)) { + if (ch === 36) { + this.pos += 2; + return this.finishToken(types$12.dollarBraceL); + } else { + ++this.pos; + return this.finishToken(types$12.backQuote); + } + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(types$12.template, out); + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(true); + chunkStart = this.pos; + } else if (isNewLine2(ch)) { + out += this.input.slice(chunkStart, this.pos); + ++this.pos; + switch (ch) { + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + out += "\n"; + break; + default: + out += String.fromCharCode(ch); + break; + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + chunkStart = this.pos; + } else { + ++this.pos; + } + } + }; + pp2.readInvalidTemplateToken = function() { + for (; this.pos < this.input.length; this.pos++) { + switch (this.input[this.pos]) { + case "\\": + ++this.pos; + break; + case "$": + if (this.input[this.pos + 1] !== "{") { + break; + } + case "`": + return this.finishToken(types$12.invalidTemplate, this.input.slice(this.start, this.pos)); + } + } + this.raise(this.start, "Unterminated template"); + }; + pp2.readEscapedChar = function(inTemplate) { + var ch = this.input.charCodeAt(++this.pos); + ++this.pos; + switch (ch) { + case 110: + return "\n"; + case 114: + return "\r"; + case 120: + return String.fromCharCode(this.readHexChar(2)); + case 117: + return codePointToString2(this.readCodePoint()); + case 116: + return " "; + case 98: + return "\b"; + case 118: + return "\v"; + case 102: + return "\f"; + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + if (this.options.locations) { + this.lineStart = this.pos; + ++this.curLine; + } + return ""; + case 56: + case 57: + if (this.strict) { + this.invalidStringToken( + this.pos - 1, + "Invalid escape sequence" + ); + } + if (inTemplate) { + var codePos = this.pos - 1; + this.invalidStringToken( + codePos, + "Invalid escape sequence in template string" + ); + return null; + } + default: + if (ch >= 48 && ch <= 55) { + var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]; + var octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + this.pos += octalStr.length - 1; + ch = this.input.charCodeAt(this.pos); + if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) { + this.invalidStringToken( + this.pos - 1 - octalStr.length, + inTemplate ? "Octal literal in template string" : "Octal literal in strict mode" + ); + } + return String.fromCharCode(octal); + } + if (isNewLine2(ch)) { + return ""; + } + return String.fromCharCode(ch); + } + }; + pp2.readHexChar = function(len) { + var codePos = this.pos; + var n = this.readInt(16, len); + if (n === null) { + this.invalidStringToken(codePos, "Bad character escape sequence"); + } + return n; + }; + pp2.readWord1 = function() { + this.containsEsc = false; + var word = "", first = true, chunkStart = this.pos; + var astral = this.options.ecmaVersion >= 6; + while (this.pos < this.input.length) { + var ch = this.fullCharCodeAtPos(); + if (isIdentifierChar2(ch, astral)) { + this.pos += ch <= 65535 ? 1 : 2; + } else if (ch === 92) { + this.containsEsc = true; + word += this.input.slice(chunkStart, this.pos); + var escStart = this.pos; + if (this.input.charCodeAt(++this.pos) !== 117) { + this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); + } + ++this.pos; + var esc = this.readCodePoint(); + if (!(first ? isIdentifierStart2 : isIdentifierChar2)(esc, astral)) { + this.invalidStringToken(escStart, "Invalid Unicode escape"); + } + word += codePointToString2(esc); + chunkStart = this.pos; + } else { + break; + } + first = false; + } + return word + this.input.slice(chunkStart, this.pos); + }; + pp2.readWord = function() { + var word = this.readWord1(); + var type = types$12.name; + if (this.keywords.test(word)) { + type = keywords2[word]; + } + return this.finishToken(type, word); + }; + var version2 = "8.8.1"; + Parser3.acorn = { + Parser: Parser3, + version: version2, + defaultOptions: defaultOptions2, + Position: Position3, + SourceLocation: SourceLocation3, + getLineInfo: getLineInfo2, + Node: Node3, + TokenType: TokenType3, + tokTypes: types$12, + keywordTypes: keywords2, + TokContext: TokContext3, + tokContexts: types2, + isIdentifierChar: isIdentifierChar2, + isIdentifierStart: isIdentifierStart2, + Token: Token3, + isNewLine: isNewLine2, + lineBreak: lineBreak2, + lineBreakG: lineBreakG2, + nonASCIIwhitespace: nonASCIIwhitespace2 + }; + function parse4(input, options) { + return Parser3.parse(input, options); + } + function parseExpressionAt2(input, pos, options) { + return Parser3.parseExpressionAt(input, pos, options); + } + function tokenizer2(input, options) { + return Parser3.tokenizer(input, options); + } + exports2.Node = Node3; + exports2.Parser = Parser3; + exports2.Position = Position3; + exports2.SourceLocation = SourceLocation3; + exports2.TokContext = TokContext3; + exports2.Token = Token3; + exports2.TokenType = TokenType3; + exports2.defaultOptions = defaultOptions2; + exports2.getLineInfo = getLineInfo2; + exports2.isIdentifierChar = isIdentifierChar2; + exports2.isIdentifierStart = isIdentifierStart2; + exports2.isNewLine = isNewLine2; + exports2.keywordTypes = keywords2; + exports2.lineBreak = lineBreak2; + exports2.lineBreakG = lineBreakG2; + exports2.nonASCIIwhitespace = nonASCIIwhitespace2; + exports2.parse = parse4; + exports2.parseExpressionAt = parseExpressionAt2; + exports2.tokContexts = types2; + exports2.tokTypes = types$12; + exports2.tokenizer = tokenizer2; + exports2.version = version2; + Object.defineProperty(exports2, "__esModule", { value: true }); + }); + } +}); + +// node_modules/acorn-jsx/index.js +var require_acorn_jsx = __commonJS({ + "node_modules/acorn-jsx/index.js"(exports, module2) { + "use strict"; + var XHTMLEntities = require_xhtml(); + var hexNumber = /^[\da-fA-F]+$/; + var decimalNumber = /^\d+$/; + var acornJsxMap = /* @__PURE__ */ new WeakMap(); + function getJsxTokens(acorn) { + acorn = acorn.Parser.acorn || acorn; + let acornJsx2 = acornJsxMap.get(acorn); + if (!acornJsx2) { + const tt = acorn.tokTypes; + const TokContext3 = acorn.TokContext; + const TokenType3 = acorn.TokenType; + const tc_oTag = new TokContext3("...", true, true); + const tokContexts = { + tc_oTag, + tc_cTag, + tc_expr + }; + const tokTypes = { + jsxName: new TokenType3("jsxName"), + jsxText: new TokenType3("jsxText", { beforeExpr: true }), + jsxTagStart: new TokenType3("jsxTagStart", { startsExpr: true }), + jsxTagEnd: new TokenType3("jsxTagEnd") + }; + tokTypes.jsxTagStart.updateContext = function() { + this.context.push(tc_expr); + this.context.push(tc_oTag); + this.exprAllowed = false; + }; + tokTypes.jsxTagEnd.updateContext = function(prevType) { + let out = this.context.pop(); + if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) { + this.context.pop(); + this.exprAllowed = this.curContext() === tc_expr; + } else { + this.exprAllowed = true; + } + }; + acornJsx2 = { tokContexts, tokTypes }; + acornJsxMap.set(acorn, acornJsx2); + } + return acornJsx2; + } + function getQualifiedJSXName(object) { + if (!object) + return object; + if (object.type === "JSXIdentifier") + return object.name; + if (object.type === "JSXNamespacedName") + return object.namespace.name + ":" + object.name.name; + if (object.type === "JSXMemberExpression") + return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); + } + module2.exports = function(options) { + options = options || {}; + return function(Parser3) { + return plugin({ + allowNamespaces: options.allowNamespaces !== false, + allowNamespacedObjects: !!options.allowNamespacedObjects + }, Parser3); + }; + }; + Object.defineProperty(module2.exports, "tokTypes", { + get: function get_tokTypes() { + return getJsxTokens(require_acorn()).tokTypes; + }, + configurable: true, + enumerable: true + }); + function plugin(options, Parser3) { + const acorn = Parser3.acorn || require_acorn(); + const acornJsx2 = getJsxTokens(acorn); + const tt = acorn.tokTypes; + const tok = acornJsx2.tokTypes; + const tokContexts = acorn.tokContexts; + const tc_oTag = acornJsx2.tokContexts.tc_oTag; + const tc_cTag = acornJsx2.tokContexts.tc_cTag; + const tc_expr = acornJsx2.tokContexts.tc_expr; + const isNewLine2 = acorn.isNewLine; + const isIdentifierStart2 = acorn.isIdentifierStart; + const isIdentifierChar2 = acorn.isIdentifierChar; + return class extends Parser3 { + static get acornJsx() { + return acornJsx2; + } + jsx_readToken() { + let out = "", chunkStart = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) + this.raise(this.start, "Unterminated JSX contents"); + let ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 60: + case 123: + if (this.pos === this.start) { + if (ch === 60 && this.exprAllowed) { + ++this.pos; + return this.finishToken(tok.jsxTagStart); + } + return this.getTokenFromCode(ch); + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(tok.jsxText, out); + case 38: + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + break; + case 62: + case 125: + this.raise( + this.pos, + "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" + (ch === 62 ? ">" : "}") + '` or `{"' + this.input[this.pos] + '"}`?' + ); + default: + if (isNewLine2(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(true); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + } + } + jsx_readNewLine(normalizeCRLF) { + let ch = this.input.charCodeAt(this.pos); + let out; + ++this.pos; + if (ch === 13 && this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + out = normalizeCRLF ? "\n" : "\r\n"; + } else { + out = String.fromCharCode(ch); + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + return out; + } + jsx_readString(quote) { + let out = "", chunkStart = ++this.pos; + for (; ; ) { + if (this.pos >= this.input.length) + this.raise(this.start, "Unterminated string constant"); + let ch = this.input.charCodeAt(this.pos); + if (ch === quote) + break; + if (ch === 38) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readEntity(); + chunkStart = this.pos; + } else if (isNewLine2(ch)) { + out += this.input.slice(chunkStart, this.pos); + out += this.jsx_readNewLine(false); + chunkStart = this.pos; + } else { + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(tt.string, out); + } + jsx_readEntity() { + let str = "", count = 0, entity; + let ch = this.input[this.pos]; + if (ch !== "&") + this.raise(this.pos, "Entity must start with an ampersand"); + let startPos = ++this.pos; + while (this.pos < this.input.length && count++ < 10) { + ch = this.input[this.pos++]; + if (ch === ";") { + if (str[0] === "#") { + if (str[1] === "x") { + str = str.substr(2); + if (hexNumber.test(str)) + entity = String.fromCharCode(parseInt(str, 16)); + } else { + str = str.substr(1); + if (decimalNumber.test(str)) + entity = String.fromCharCode(parseInt(str, 10)); + } + } else { + entity = XHTMLEntities[str]; + } + break; + } + str += ch; + } + if (!entity) { + this.pos = startPos; + return "&"; + } + return entity; + } + jsx_readWord() { + let ch, start3 = this.pos; + do { + ch = this.input.charCodeAt(++this.pos); + } while (isIdentifierChar2(ch) || ch === 45); + return this.finishToken(tok.jsxName, this.input.slice(start3, this.pos)); + } + jsx_parseIdentifier() { + let node = this.startNode(); + if (this.type === tok.jsxName) + node.name = this.value; + else if (this.type.keyword) + node.name = this.type.keyword; + else + this.unexpected(); + this.next(); + return this.finishNode(node, "JSXIdentifier"); + } + jsx_parseNamespacedName() { + let startPos = this.start, startLoc = this.startLoc; + let name2 = this.jsx_parseIdentifier(); + if (!options.allowNamespaces || !this.eat(tt.colon)) + return name2; + var node = this.startNodeAt(startPos, startLoc); + node.namespace = name2; + node.name = this.jsx_parseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); + } + jsx_parseElementName() { + if (this.type === tok.jsxTagEnd) + return ""; + let startPos = this.start, startLoc = this.startLoc; + let node = this.jsx_parseNamespacedName(); + if (this.type === tt.dot && node.type === "JSXNamespacedName" && !options.allowNamespacedObjects) { + this.unexpected(); + } + while (this.eat(tt.dot)) { + let newNode = this.startNodeAt(startPos, startLoc); + newNode.object = node; + newNode.property = this.jsx_parseIdentifier(); + node = this.finishNode(newNode, "JSXMemberExpression"); + } + return node; + } + jsx_parseAttributeValue() { + switch (this.type) { + case tt.braceL: + let node = this.jsx_parseExpressionContainer(); + if (node.expression.type === "JSXEmptyExpression") + this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); + return node; + case tok.jsxTagStart: + case tt.string: + return this.parseExprAtom(); + default: + this.raise(this.start, "JSX value should be either an expression or a quoted JSX text"); + } + } + jsx_parseEmptyExpression() { + let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc); + return this.finishNodeAt(node, "JSXEmptyExpression", this.start, this.startLoc); + } + jsx_parseExpressionContainer() { + let node = this.startNode(); + this.next(); + node.expression = this.type === tt.braceR ? this.jsx_parseEmptyExpression() : this.parseExpression(); + this.expect(tt.braceR); + return this.finishNode(node, "JSXExpressionContainer"); + } + jsx_parseAttribute() { + let node = this.startNode(); + if (this.eat(tt.braceL)) { + this.expect(tt.ellipsis); + node.argument = this.parseMaybeAssign(); + this.expect(tt.braceR); + return this.finishNode(node, "JSXSpreadAttribute"); + } + node.name = this.jsx_parseNamespacedName(); + node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null; + return this.finishNode(node, "JSXAttribute"); + } + jsx_parseOpeningElementAt(startPos, startLoc) { + let node = this.startNodeAt(startPos, startLoc); + node.attributes = []; + let nodeName = this.jsx_parseElementName(); + if (nodeName) + node.name = nodeName; + while (this.type !== tt.slash && this.type !== tok.jsxTagEnd) + node.attributes.push(this.jsx_parseAttribute()); + node.selfClosing = this.eat(tt.slash); + this.expect(tok.jsxTagEnd); + return this.finishNode(node, nodeName ? "JSXOpeningElement" : "JSXOpeningFragment"); + } + jsx_parseClosingElementAt(startPos, startLoc) { + let node = this.startNodeAt(startPos, startLoc); + let nodeName = this.jsx_parseElementName(); + if (nodeName) + node.name = nodeName; + this.expect(tok.jsxTagEnd); + return this.finishNode(node, nodeName ? "JSXClosingElement" : "JSXClosingFragment"); + } + jsx_parseElementAt(startPos, startLoc) { + let node = this.startNodeAt(startPos, startLoc); + let children = []; + let openingElement = this.jsx_parseOpeningElementAt(startPos, startLoc); + let closingElement = null; + if (!openingElement.selfClosing) { + contents: + for (; ; ) { + switch (this.type) { + case tok.jsxTagStart: + startPos = this.start; + startLoc = this.startLoc; + this.next(); + if (this.eat(tt.slash)) { + closingElement = this.jsx_parseClosingElementAt(startPos, startLoc); + break contents; + } + children.push(this.jsx_parseElementAt(startPos, startLoc)); + break; + case tok.jsxText: + children.push(this.parseExprAtom()); + break; + case tt.braceL: + children.push(this.jsx_parseExpressionContainer()); + break; + default: + this.unexpected(); + } + } + if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { + this.raise( + closingElement.start, + "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">" + ); + } + } + let fragmentOrElement = openingElement.name ? "Element" : "Fragment"; + node["opening" + fragmentOrElement] = openingElement; + node["closing" + fragmentOrElement] = closingElement; + node.children = children; + if (this.type === tt.relational && this.value === "<") { + this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); + } + return this.finishNode(node, "JSX" + fragmentOrElement); + } + jsx_parseText() { + let node = this.parseLiteral(this.value); + node.type = "JSXText"; + return node; + } + jsx_parseElement() { + let startPos = this.start, startLoc = this.startLoc; + this.next(); + return this.jsx_parseElementAt(startPos, startLoc); + } + parseExprAtom(refShortHandDefaultPos) { + if (this.type === tok.jsxText) + return this.jsx_parseText(); + else if (this.type === tok.jsxTagStart) + return this.jsx_parseElement(); + else + return super.parseExprAtom(refShortHandDefaultPos); + } + readToken(code2) { + let context = this.curContext(); + if (context === tc_expr) + return this.jsx_readToken(); + if (context === tc_oTag || context === tc_cTag) { + if (isIdentifierStart2(code2)) + return this.jsx_readWord(); + if (code2 == 62) { + ++this.pos; + return this.finishToken(tok.jsxTagEnd); + } + if ((code2 === 34 || code2 === 39) && context == tc_oTag) + return this.jsx_readString(code2); + } + if (code2 === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) { + ++this.pos; + return this.finishToken(tok.jsxTagStart); + } + return super.readToken(code2); + } + updateContext(prevType) { + if (this.type == tt.braceL) { + var curContext = this.curContext(); + if (curContext == tc_oTag) + this.context.push(tokContexts.b_expr); + else if (curContext == tc_expr) + this.context.push(tokContexts.b_tmpl); + else + super.updateContext(prevType); + this.exprAllowed = true; + } else if (this.type === tt.slash && prevType === tok.jsxTagStart) { + this.context.length -= 2; + this.context.push(tc_cTag); + this.exprAllowed = false; + } else { + return super.updateContext(prevType); + } + } + }; + } + } +}); + +// node_modules/inline-style-parser/index.js +var require_inline_style_parser = __commonJS({ + "node_modules/inline-style-parser/index.js"(exports, module2) { + var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; + var NEWLINE_REGEX = /\n/g; + var WHITESPACE_REGEX = /^\s*/; + var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/; + var COLON_REGEX = /^:\s*/; + var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/; + var SEMICOLON_REGEX = /^[;\s]*/; + var TRIM_REGEX = /^\s+|\s+$/g; + var NEWLINE = "\n"; + var FORWARD_SLASH = "/"; + var ASTERISK = "*"; + var EMPTY_STRING = ""; + var TYPE_COMMENT = "comment"; + var TYPE_DECLARATION = "declaration"; + module2.exports = function(style2, options) { + if (typeof style2 !== "string") { + throw new TypeError("First argument must be a string"); + } + if (!style2) + return []; + options = options || {}; + var lineno = 1; + var column = 1; + function updatePosition(str) { + var lines = str.match(NEWLINE_REGEX); + if (lines) + lineno += lines.length; + var i = str.lastIndexOf(NEWLINE); + column = ~i ? str.length - i : column + str.length; + } + function position3() { + var start3 = { line: lineno, column }; + return function(node) { + node.position = new Position3(start3); + whitespace2(); + return node; + }; + } + function Position3(start3) { + this.start = start3; + this.end = { line: lineno, column }; + this.source = options.source; + } + Position3.prototype.content = style2; + var errorsList = []; + function error(msg) { + var err = new Error( + options.source + ":" + lineno + ":" + column + ": " + msg + ); + err.reason = msg; + err.filename = options.source; + err.line = lineno; + err.column = column; + err.source = style2; + if (options.silent) { + errorsList.push(err); + } else { + throw err; + } + } + function match(re) { + var m = re.exec(style2); + if (!m) + return; + var str = m[0]; + updatePosition(str); + style2 = style2.slice(str.length); + return m; + } + function whitespace2() { + match(WHITESPACE_REGEX); + } + function comments(rules) { + var c; + rules = rules || []; + while (c = comment2()) { + if (c !== false) { + rules.push(c); + } + } + return rules; + } + function comment2() { + var pos = position3(); + if (FORWARD_SLASH != style2.charAt(0) || ASTERISK != style2.charAt(1)) + return; + var i = 2; + while (EMPTY_STRING != style2.charAt(i) && (ASTERISK != style2.charAt(i) || FORWARD_SLASH != style2.charAt(i + 1))) { + ++i; + } + i += 2; + if (EMPTY_STRING === style2.charAt(i - 1)) { + return error("End of comment missing"); + } + var str = style2.slice(2, i - 2); + column += 2; + updatePosition(str); + style2 = style2.slice(i); + column += 2; + return pos({ + type: TYPE_COMMENT, + comment: str + }); + } + function declaration() { + var pos = position3(); + var prop = match(PROPERTY_REGEX); + if (!prop) + return; + comment2(); + if (!match(COLON_REGEX)) + return error("property missing ':'"); + var val = match(VALUE_REGEX); + var ret = pos({ + type: TYPE_DECLARATION, + property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)), + value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING + }); + match(SEMICOLON_REGEX); + return ret; + } + function declarations() { + var decls = []; + comments(decls); + var decl; + while (decl = declaration()) { + if (decl !== false) { + decls.push(decl); + comments(decls); + } + } + return decls; + } + whitespace2(); + return declarations(); + }; + function trim(str) { + return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING; + } + } +}); + +// node_modules/style-to-object/index.js +var require_style_to_object = __commonJS({ + "node_modules/style-to-object/index.js"(exports, module2) { + var parse4 = require_inline_style_parser(); + function StyleToObject(style2, iterator) { + var output = null; + if (!style2 || typeof style2 !== "string") { + return output; + } + var declaration; + var declarations = parse4(style2); + var hasIterator = typeof iterator === "function"; + var property; + var value; + for (var i = 0, len = declarations.length; i < len; i++) { + declaration = declarations[i]; + property = declaration.property; + value = declaration.value; + if (hasIterator) { + iterator(property, value, declaration); + } else if (value) { + output || (output = {}); + output[property] = value; + } + } + return output; + } + module2.exports = StyleToObject; + } +}); + +// node_modules/markdown-extensions/markdown-extensions.json +var require_markdown_extensions = __commonJS({ + "node_modules/markdown-extensions/markdown-extensions.json"(exports, module2) { + module2.exports = [ + "md", + "markdown", + "mdown", + "mkdn", + "mkd", + "mdwn", + "mkdown", + "ron" + ]; + } +}); + +// node_modules/markdown-extensions/index.js +var require_markdown_extensions2 = __commonJS({ + "node_modules/markdown-extensions/index.js"(exports, module2) { + "use strict"; + module2.exports = require_markdown_extensions(); + } +}); + +// node_modules/@mdx-js/mdx/index.js +var mdx_exports = {}; +__export(mdx_exports, { + compile: () => compile, + compileSync: () => compileSync, + createProcessor: () => createProcessor, + evaluate: () => evaluate, + evaluateSync: () => evaluateSync, + nodeTypes: () => nodeTypes, + run: () => run, + runSync: () => runSync +}); +module.exports = __toCommonJS(mdx_exports); + +// node_modules/@mdx-js/mdx/node_modules/bail/index.js +function bail(error) { + if (error) { + throw error; + } +} + +// node_modules/@mdx-js/mdx/node_modules/unified/lib/index.js +var import_is_buffer2 = __toESM(require_is_buffer(), 1); +var import_extend = __toESM(require_extend(), 1); + +// node_modules/@mdx-js/mdx/node_modules/is-plain-obj/index.js +function isPlainObject(value) { + if (typeof value !== "object" || value === null) { + return false; + } + const prototype = Object.getPrototypeOf(value); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); +} + +// node_modules/@mdx-js/mdx/node_modules/trough/index.js +function trough() { + const fns = []; + const pipeline = { run: run2, use }; + return pipeline; + function run2(...values) { + let middlewareIndex = -1; + const callback = values.pop(); + if (typeof callback !== "function") { + throw new TypeError("Expected function as last argument, not " + callback); + } + next(null, ...values); + function next(error, ...output) { + const fn = fns[++middlewareIndex]; + let index2 = -1; + if (error) { + callback(error); + return; + } + while (++index2 < values.length) { + if (output[index2] === null || output[index2] === void 0) { + output[index2] = values[index2]; + } + } + values = output; + if (fn) { + wrap(fn, next)(...output); + } else { + callback(null, ...output); + } + } + } + function use(middelware) { + if (typeof middelware !== "function") { + throw new TypeError( + "Expected `middelware` to be a function, not " + middelware + ); + } + fns.push(middelware); + return pipeline; + } +} +function wrap(middleware, callback) { + let called; + return wrapped; + function wrapped(...parameters) { + const fnExpectsCallback = middleware.length > parameters.length; + let result; + if (fnExpectsCallback) { + parameters.push(done); + } + try { + result = middleware.apply(this, parameters); + } catch (error) { + const exception = error; + if (fnExpectsCallback && called) { + throw exception; + } + return done(exception); + } + if (!fnExpectsCallback) { + if (result instanceof Promise) { + result.then(then, done); + } else if (result instanceof Error) { + done(result); + } else { + then(result); + } + } + } + function done(error, ...output) { + if (!called) { + called = true; + callback(error, ...output); + } + } + function then(value) { + done(null, value); + } +} + +// node_modules/vfile/lib/index.js +var import_is_buffer = __toESM(require_is_buffer(), 1); + +// node_modules/unist-util-stringify-position/index.js +function stringifyPosition(value) { + if (!value || typeof value !== "object") { + return ""; + } + if ("position" in value || "type" in value) { + return position(value.position); + } + if ("start" in value || "end" in value) { + return position(value); + } + if ("line" in value || "column" in value) { + return point(value); + } + return ""; +} +function point(point3) { + return index(point3 && point3.line) + ":" + index(point3 && point3.column); +} +function position(pos) { + return point(pos && pos.start) + "-" + point(pos && pos.end); +} +function index(value) { + return value && typeof value === "number" ? value : 1; +} + +// node_modules/vfile-message/index.js +var VFileMessage = class extends Error { + constructor(reason, place, origin) { + const parts = [null, null]; + let position3 = { + start: { line: null, column: null }, + end: { line: null, column: null } + }; + super(); + if (typeof place === "string") { + origin = place; + place = void 0; + } + if (typeof origin === "string") { + const index2 = origin.indexOf(":"); + if (index2 === -1) { + parts[1] = origin; + } else { + parts[0] = origin.slice(0, index2); + parts[1] = origin.slice(index2 + 1); + } + } + if (place) { + if ("type" in place || "position" in place) { + if (place.position) { + position3 = place.position; + } + } else if ("start" in place || "end" in place) { + position3 = place; + } else if ("line" in place || "column" in place) { + position3.start = place; + } + } + this.name = stringifyPosition(place) || "1:1"; + this.message = typeof reason === "object" ? reason.message : reason; + this.stack = typeof reason === "object" ? reason.stack : ""; + this.reason = this.message; + this.fatal; + this.line = position3.start.line; + this.column = position3.start.column; + this.source = parts[0]; + this.ruleId = parts[1]; + this.position = position3; + this.actual; + this.expected; + this.file; + this.url; + this.note; + } +}; +VFileMessage.prototype.file = ""; +VFileMessage.prototype.name = ""; +VFileMessage.prototype.reason = ""; +VFileMessage.prototype.message = ""; +VFileMessage.prototype.stack = ""; +VFileMessage.prototype.fatal = null; +VFileMessage.prototype.column = null; +VFileMessage.prototype.line = null; +VFileMessage.prototype.source = null; +VFileMessage.prototype.ruleId = null; +VFileMessage.prototype.position = null; + +// node_modules/vfile/lib/minpath.js +var import_path = __toESM(require("path"), 1); + +// node_modules/vfile/lib/minproc.js +var import_process = __toESM(require("process"), 1); + +// node_modules/vfile/lib/minurl.js +var import_url = require("url"); + +// node_modules/vfile/lib/minurl.shared.js +function isUrl(fileURLOrPath) { + return fileURLOrPath !== null && typeof fileURLOrPath === "object" && fileURLOrPath.href && fileURLOrPath.origin; +} + +// node_modules/vfile/lib/index.js +var order = ["history", "path", "basename", "stem", "extname", "dirname"]; +var VFile = class { + constructor(value) { + let options; + if (!value) { + options = {}; + } else if (typeof value === "string" || (0, import_is_buffer.default)(value)) { + options = { value }; + } else if (isUrl(value)) { + options = { path: value }; + } else { + options = value; + } + this.data = {}; + this.messages = []; + this.history = []; + this.cwd = import_process.default.cwd(); + this.value; + this.stored; + this.result; + this.map; + let index2 = -1; + while (++index2 < order.length) { + const prop2 = order[index2]; + if (prop2 in options && options[prop2] !== void 0) { + this[prop2] = prop2 === "history" ? [...options[prop2]] : options[prop2]; + } + } + let prop; + for (prop in options) { + if (!order.includes(prop)) + this[prop] = options[prop]; + } + } + get path() { + return this.history[this.history.length - 1]; + } + set path(path) { + if (isUrl(path)) { + path = (0, import_url.fileURLToPath)(path); + } + assertNonEmpty(path, "path"); + if (this.path !== path) { + this.history.push(path); + } + } + get dirname() { + return typeof this.path === "string" ? import_path.default.dirname(this.path) : void 0; + } + set dirname(dirname) { + assertPath(this.basename, "dirname"); + this.path = import_path.default.join(dirname || "", this.basename); + } + get basename() { + return typeof this.path === "string" ? import_path.default.basename(this.path) : void 0; + } + set basename(basename) { + assertNonEmpty(basename, "basename"); + assertPart(basename, "basename"); + this.path = import_path.default.join(this.dirname || "", basename); + } + get extname() { + return typeof this.path === "string" ? import_path.default.extname(this.path) : void 0; + } + set extname(extname) { + assertPart(extname, "extname"); + assertPath(this.dirname, "extname"); + if (extname) { + if (extname.charCodeAt(0) !== 46) { + throw new Error("`extname` must start with `.`"); + } + if (extname.includes(".", 1)) { + throw new Error("`extname` cannot contain multiple dots"); + } + } + this.path = import_path.default.join(this.dirname, this.stem + (extname || "")); + } + get stem() { + return typeof this.path === "string" ? import_path.default.basename(this.path, this.extname) : void 0; + } + set stem(stem) { + assertNonEmpty(stem, "stem"); + assertPart(stem, "stem"); + this.path = import_path.default.join(this.dirname || "", stem + (this.extname || "")); + } + toString(encoding) { + return (this.value || "").toString(encoding); + } + message(reason, place, origin) { + const message = new VFileMessage(reason, place, origin); + if (this.path) { + message.name = this.path + ":" + message.name; + message.file = this.path; + } + message.fatal = false; + this.messages.push(message); + return message; + } + info(reason, place, origin) { + const message = this.message(reason, place, origin); + message.fatal = null; + return message; + } + fail(reason, place, origin) { + const message = this.message(reason, place, origin); + message.fatal = true; + throw message; + } +}; +function assertPart(part, name2) { + if (part && part.includes(import_path.default.sep)) { + throw new Error( + "`" + name2 + "` cannot be a path: did not expect `" + import_path.default.sep + "`" + ); + } +} +function assertNonEmpty(part, name2) { + if (!part) { + throw new Error("`" + name2 + "` cannot be empty"); + } +} +function assertPath(path, name2) { + if (!path) { + throw new Error("Setting `" + name2 + "` requires `path` to be set too"); + } +} + +// node_modules/@mdx-js/mdx/node_modules/unified/lib/index.js +var unified = base().freeze(); +var own = {}.hasOwnProperty; +function base() { + const transformers = trough(); + const attachers = []; + let namespace = {}; + let frozen; + let freezeIndex = -1; + processor.data = data2; + processor.Parser = void 0; + processor.Compiler = void 0; + processor.freeze = freeze; + processor.attachers = attachers; + processor.use = use; + processor.parse = parse4; + processor.stringify = stringify4; + processor.run = run2; + processor.runSync = runSync2; + processor.process = process2; + processor.processSync = processSync; + return processor; + function processor() { + const destination = base(); + let index2 = -1; + while (++index2 < attachers.length) { + destination.use(...attachers[index2]); + } + destination.data((0, import_extend.default)(true, {}, namespace)); + return destination; + } + function data2(key, value) { + if (typeof key === "string") { + if (arguments.length === 2) { + assertUnfrozen("data", frozen); + namespace[key] = value; + return processor; + } + return own.call(namespace, key) && namespace[key] || null; + } + if (key) { + assertUnfrozen("data", frozen); + namespace = key; + return processor; + } + return namespace; + } + function freeze() { + if (frozen) { + return processor; + } + while (++freezeIndex < attachers.length) { + const [attacher, ...options] = attachers[freezeIndex]; + if (options[0] === false) { + continue; + } + if (options[0] === true) { + options[0] = void 0; + } + const transformer = attacher.call(processor, ...options); + if (typeof transformer === "function") { + transformers.use(transformer); + } + } + frozen = true; + freezeIndex = Number.POSITIVE_INFINITY; + return processor; + } + function use(value, ...options) { + let settings; + assertUnfrozen("use", frozen); + if (value === null || value === void 0) { + } else if (typeof value === "function") { + addPlugin(value, ...options); + } else if (typeof value === "object") { + if (Array.isArray(value)) { + addList(value); + } else { + addPreset(value); + } + } else { + throw new TypeError("Expected usable value, not `" + value + "`"); + } + if (settings) { + namespace.settings = Object.assign(namespace.settings || {}, settings); + } + return processor; + function add(value2) { + if (typeof value2 === "function") { + addPlugin(value2); + } else if (typeof value2 === "object") { + if (Array.isArray(value2)) { + const [plugin, ...options2] = value2; + addPlugin(plugin, ...options2); + } else { + addPreset(value2); + } + } else { + throw new TypeError("Expected usable value, not `" + value2 + "`"); + } + } + function addPreset(result) { + addList(result.plugins); + if (result.settings) { + settings = Object.assign(settings || {}, result.settings); + } + } + function addList(plugins) { + let index2 = -1; + if (plugins === null || plugins === void 0) { + } else if (Array.isArray(plugins)) { + while (++index2 < plugins.length) { + const thing = plugins[index2]; + add(thing); + } + } else { + throw new TypeError("Expected a list of plugins, not `" + plugins + "`"); + } + } + function addPlugin(plugin, value2) { + let index2 = -1; + let entry; + while (++index2 < attachers.length) { + if (attachers[index2][0] === plugin) { + entry = attachers[index2]; + break; + } + } + if (entry) { + if (isPlainObject(entry[1]) && isPlainObject(value2)) { + value2 = (0, import_extend.default)(true, entry[1], value2); + } + entry[1] = value2; + } else { + attachers.push([...arguments]); + } + } + } + function parse4(doc) { + processor.freeze(); + const file = vfile(doc); + const Parser3 = processor.Parser; + assertParser("parse", Parser3); + if (newable(Parser3, "parse")) { + return new Parser3(String(file), file).parse(); + } + return Parser3(String(file), file); + } + function stringify4(node, doc) { + processor.freeze(); + const file = vfile(doc); + const Compiler = processor.Compiler; + assertCompiler("stringify", Compiler); + assertNode(node); + if (newable(Compiler, "compile")) { + return new Compiler(node, file).compile(); + } + return Compiler(node, file); + } + function run2(node, doc, callback) { + assertNode(node); + processor.freeze(); + if (!callback && typeof doc === "function") { + callback = doc; + doc = void 0; + } + if (!callback) { + return new Promise(executor); + } + executor(null, callback); + function executor(resolve, reject) { + transformers.run(node, vfile(doc), done); + function done(error, tree, file) { + tree = tree || node; + if (error) { + reject(error); + } else if (resolve) { + resolve(tree); + } else { + callback(null, tree, file); + } + } + } + } + function runSync2(node, file) { + let result; + let complete; + processor.run(node, file, done); + assertDone("runSync", "run", complete); + return result; + function done(error, tree) { + bail(error); + result = tree; + complete = true; + } + } + function process2(doc, callback) { + processor.freeze(); + assertParser("process", processor.Parser); + assertCompiler("process", processor.Compiler); + if (!callback) { + return new Promise(executor); + } + executor(null, callback); + function executor(resolve, reject) { + const file = vfile(doc); + processor.run(processor.parse(file), file, (error, tree, file2) => { + if (error || !tree || !file2) { + done(error); + } else { + const result = processor.stringify(tree, file2); + if (result === void 0 || result === null) { + } else if (looksLikeAVFileValue(result)) { + file2.value = result; + } else { + file2.result = result; + } + done(error, file2); + } + }); + function done(error, file2) { + if (error || !file2) { + reject(error); + } else if (resolve) { + resolve(file2); + } else { + callback(null, file2); + } + } + } + } + function processSync(doc) { + let complete; + processor.freeze(); + assertParser("processSync", processor.Parser); + assertCompiler("processSync", processor.Compiler); + const file = vfile(doc); + processor.process(file, done); + assertDone("processSync", "process", complete); + return file; + function done(error) { + complete = true; + bail(error); + } + } +} +function newable(value, name2) { + return typeof value === "function" && value.prototype && (keys(value.prototype) || name2 in value.prototype); +} +function keys(value) { + let key; + for (key in value) { + if (own.call(value, key)) { + return true; + } + } + return false; +} +function assertParser(name2, value) { + if (typeof value !== "function") { + throw new TypeError("Cannot `" + name2 + "` without `Parser`"); + } +} +function assertCompiler(name2, value) { + if (typeof value !== "function") { + throw new TypeError("Cannot `" + name2 + "` without `Compiler`"); + } +} +function assertUnfrozen(name2, frozen) { + if (frozen) { + throw new Error( + "Cannot call `" + name2 + "` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`." + ); + } +} +function assertNode(node) { + if (!isPlainObject(node) || typeof node.type !== "string") { + throw new TypeError("Expected node, got `" + node + "`"); + } +} +function assertDone(name2, asyncName, complete) { + if (!complete) { + throw new Error( + "`" + name2 + "` finished async. Use `" + asyncName + "` instead" + ); + } +} +function vfile(value) { + return looksLikeAVFile(value) ? value : new VFile(value); +} +function looksLikeAVFile(value) { + return Boolean( + value && typeof value === "object" && "message" in value && "messages" in value + ); +} +function looksLikeAVFileValue(value) { + return typeof value === "string" || (0, import_is_buffer2.default)(value); +} + +// node_modules/acorn/dist/acorn.mjs +var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; +var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; +var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F"; +var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC"; +var reservedWords = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" +}; +var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; +var keywords$1 = { + 5: ecma5AndLessKeywords, + "5module": ecma5AndLessKeywords + " export import", + 6: ecma5AndLessKeywords + " const class extends export import super" +}; +var keywordRelationalOperator = /^in(stanceof)?$/; +var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +function isInAstralSet(code2, set) { + var pos = 65536; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code2) { + return false; + } + pos += set[i + 1]; + if (pos >= code2) { + return true; + } + } +} +function isIdentifierStart(code2, astral) { + if (code2 < 65) { + return code2 === 36; + } + if (code2 < 91) { + return true; + } + if (code2 < 97) { + return code2 === 95; + } + if (code2 < 123) { + return true; + } + if (code2 <= 65535) { + return code2 >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code2)); + } + if (astral === false) { + return false; + } + return isInAstralSet(code2, astralIdentifierStartCodes); +} +function isIdentifierChar(code2, astral) { + if (code2 < 48) { + return code2 === 36; + } + if (code2 < 58) { + return true; + } + if (code2 < 65) { + return false; + } + if (code2 < 91) { + return true; + } + if (code2 < 97) { + return code2 === 95; + } + if (code2 < 123) { + return true; + } + if (code2 <= 65535) { + return code2 >= 170 && nonASCIIidentifier.test(String.fromCharCode(code2)); + } + if (astral === false) { + return false; + } + return isInAstralSet(code2, astralIdentifierStartCodes) || isInAstralSet(code2, astralIdentifierCodes); +} +var TokenType = function TokenType2(label, conf) { + if (conf === void 0) + conf = {}; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; +}; +function binop(name2, prec) { + return new TokenType(name2, { beforeExpr: true, binop: prec }); +} +var beforeExpr = { beforeExpr: true }; +var startsExpr = { startsExpr: true }; +var keywords = {}; +function kw(name2, options) { + if (options === void 0) + options = {}; + options.keyword = name2; + return keywords[name2] = new TokenType(name2, options); +} +var types$1 = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + privateId: new TokenType("privateId", startsExpr), + eof: new TokenType("eof"), + bracketL: new TokenType("[", { beforeExpr: true, startsExpr: true }), + bracketR: new TokenType("]"), + braceL: new TokenType("{", { beforeExpr: true, startsExpr: true }), + braceR: new TokenType("}"), + parenL: new TokenType("(", { beforeExpr: true, startsExpr: true }), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + questionDot: new TokenType("?."), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", { beforeExpr: true, startsExpr: true }), + eq: new TokenType("=", { beforeExpr: true, isAssign: true }), + assign: new TokenType("_=", { beforeExpr: true, isAssign: true }), + incDec: new TokenType("++/--", { prefix: true, postfix: true, startsExpr: true }), + prefix: new TokenType("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", { beforeExpr: true }), + coalesce: binop("??", 1), + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", { isLoop: true, beforeExpr: true }), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", { isLoop: true }), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", { isLoop: true }), + _with: kw("with"), + _new: kw("new", { beforeExpr: true, startsExpr: true }), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import", startsExpr), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", { beforeExpr: true, binop: 7 }), + _instanceof: kw("instanceof", { beforeExpr: true, binop: 7 }), + _typeof: kw("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), + _void: kw("void", { beforeExpr: true, prefix: true, startsExpr: true }), + _delete: kw("delete", { beforeExpr: true, prefix: true, startsExpr: true }) +}; +var lineBreak = /\r\n?|\n|\u2028|\u2029/; +var lineBreakG = new RegExp(lineBreak.source, "g"); +function isNewLine(code2) { + return code2 === 10 || code2 === 13 || code2 === 8232 || code2 === 8233; +} +function nextLineBreak(code2, from, end) { + if (end === void 0) + end = code2.length; + for (var i = from; i < end; i++) { + var next = code2.charCodeAt(i); + if (isNewLine(next)) { + return i < end - 1 && next === 13 && code2.charCodeAt(i + 1) === 10 ? i + 2 : i + 1; + } + } + return -1; +} +var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; +var ref = Object.prototype; +var hasOwnProperty = ref.hasOwnProperty; +var toString = ref.toString; +var hasOwn = Object.hasOwn || function(obj, propName) { + return hasOwnProperty.call(obj, propName); +}; +var isArray = Array.isArray || function(obj) { + return toString.call(obj) === "[object Array]"; +}; +function wordsRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"); +} +function codePointToString(code2) { + if (code2 <= 65535) { + return String.fromCharCode(code2); + } + code2 -= 65536; + return String.fromCharCode((code2 >> 10) + 55296, (code2 & 1023) + 56320); +} +var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; +var Position = function Position2(line, col) { + this.line = line; + this.column = col; +}; +Position.prototype.offset = function offset(n) { + return new Position(this.line, this.column + n); +}; +var SourceLocation = function SourceLocation2(p, start3, end) { + this.start = start3; + this.end = end; + if (p.sourceFile !== null) { + this.source = p.sourceFile; + } +}; +function getLineInfo(input, offset2) { + for (var line = 1, cur = 0; ; ) { + var nextBreak = nextLineBreak(input, cur, offset2); + if (nextBreak < 0) { + return new Position(line, offset2 - cur); + } + ++line; + cur = nextBreak; + } +} +var defaultOptions = { + ecmaVersion: null, + sourceType: "script", + onInsertedSemicolon: null, + onTrailingComma: null, + allowReserved: null, + allowReturnOutsideFunction: false, + allowImportExportEverywhere: false, + allowAwaitOutsideFunction: null, + allowSuperOutsideMethod: null, + allowHashBang: false, + locations: false, + onToken: null, + onComment: null, + ranges: false, + program: null, + sourceFile: null, + directSourceFile: null, + preserveParens: false +}; +var warnedAboutEcmaVersion = false; +function getOptions(opts) { + var options = {}; + for (var opt in defaultOptions) { + options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; + } + if (options.ecmaVersion === "latest") { + options.ecmaVersion = 1e8; + } else if (options.ecmaVersion == null) { + if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) { + warnedAboutEcmaVersion = true; + console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); + } + options.ecmaVersion = 11; + } else if (options.ecmaVersion >= 2015) { + options.ecmaVersion -= 2009; + } + if (options.allowReserved == null) { + options.allowReserved = options.ecmaVersion < 5; + } + if (opts.allowHashBang == null) { + options.allowHashBang = options.ecmaVersion >= 14; + } + if (isArray(options.onToken)) { + var tokens = options.onToken; + options.onToken = function(token) { + return tokens.push(token); + }; + } + if (isArray(options.onComment)) { + options.onComment = pushComment(options, options.onComment); + } + return options; +} +function pushComment(options, array) { + return function(block, text5, start3, end, startLoc, endLoc) { + var comment2 = { + type: block ? "Block" : "Line", + value: text5, + start: start3, + end + }; + if (options.locations) { + comment2.loc = new SourceLocation(this, startLoc, endLoc); + } + if (options.ranges) { + comment2.range = [start3, end]; + } + array.push(comment2); + }; +} +var SCOPE_TOP = 1; +var SCOPE_FUNCTION = 2; +var SCOPE_ASYNC = 4; +var SCOPE_GENERATOR = 8; +var SCOPE_ARROW = 16; +var SCOPE_SIMPLE_CATCH = 32; +var SCOPE_SUPER = 64; +var SCOPE_DIRECT_SUPER = 128; +var SCOPE_CLASS_STATIC_BLOCK = 256; +var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; +function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0); +} +var BIND_NONE = 0; +var BIND_VAR = 1; +var BIND_LEXICAL = 2; +var BIND_FUNCTION = 3; +var BIND_SIMPLE_CATCH = 4; +var BIND_OUTSIDE = 5; +var Parser = function Parser2(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + var reserved = ""; + if (options.allowReserved !== true) { + reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; + if (options.sourceType === "module") { + reserved += " await"; + } + } + this.reservedWords = wordsRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = wordsRegexp(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); + this.containsEsc = false; + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + this.type = types$1.eof; + this.value = null; + this.start = this.end = this.pos; + this.startLoc = this.endLoc = this.curPosition(); + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + this.context = this.initialContext(); + this.exprAllowed = true; + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + this.potentialArrowAt = -1; + this.potentialArrowInForAwait = false; + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + this.labels = []; + this.undefinedExports = /* @__PURE__ */ Object.create(null); + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") { + this.skipLineComment(2); + } + this.scopeStack = []; + this.enterScope(SCOPE_TOP); + this.regexpState = null; + this.privateNameStack = []; +}; +var prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } }; +Parser.prototype.parse = function parse() { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node); +}; +prototypeAccessors.inFunction.get = function() { + return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0; +}; +prototypeAccessors.inGenerator.get = function() { + return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit; +}; +prototypeAccessors.inAsync.get = function() { + return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit; +}; +prototypeAccessors.canAwait.get = function() { + for (var i = this.scopeStack.length - 1; i >= 0; i--) { + var scope = this.scopeStack[i]; + if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { + return false; + } + if (scope.flags & SCOPE_FUNCTION) { + return (scope.flags & SCOPE_ASYNC) > 0; + } + } + return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction; +}; +prototypeAccessors.allowSuper.get = function() { + var ref2 = this.currentThisScope(); + var flags = ref2.flags; + var inClassFieldInit = ref2.inClassFieldInit; + return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod; +}; +prototypeAccessors.allowDirectSuper.get = function() { + return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0; +}; +prototypeAccessors.treatFunctionsAsVar.get = function() { + return this.treatFunctionsAsVarInScope(this.currentScope()); +}; +prototypeAccessors.allowNewDotTarget.get = function() { + var ref2 = this.currentThisScope(); + var flags = ref2.flags; + var inClassFieldInit = ref2.inClassFieldInit; + return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit; +}; +prototypeAccessors.inClassStaticBlock.get = function() { + return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0; +}; +Parser.extend = function extend2() { + var plugins = [], len = arguments.length; + while (len--) + plugins[len] = arguments[len]; + var cls = this; + for (var i = 0; i < plugins.length; i++) { + cls = plugins[i](cls); + } + return cls; +}; +Parser.parse = function parse2(input, options) { + return new this(options, input).parse(); +}; +Parser.parseExpressionAt = function parseExpressionAt(input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression(); +}; +Parser.tokenizer = function tokenizer(input, options) { + return new this(options, input); +}; +Object.defineProperties(Parser.prototype, prototypeAccessors); +var pp$9 = Parser.prototype; +var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; +pp$9.strictDirective = function(start3) { + if (this.options.ecmaVersion < 5) { + return false; + } + for (; ; ) { + skipWhiteSpace.lastIndex = start3; + start3 += skipWhiteSpace.exec(this.input)[0].length; + var match = literal.exec(this.input.slice(start3)); + if (!match) { + return false; + } + if ((match[1] || match[2]) === "use strict") { + skipWhiteSpace.lastIndex = start3 + match[0].length; + var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; + var next = this.input.charAt(end); + return next === ";" || next === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="); + } + start3 += match[0].length; + skipWhiteSpace.lastIndex = start3; + start3 += skipWhiteSpace.exec(this.input)[0].length; + if (this.input[start3] === ";") { + start3++; + } + } +}; +pp$9.eat = function(type) { + if (this.type === type) { + this.next(); + return true; + } else { + return false; + } +}; +pp$9.isContextual = function(name2) { + return this.type === types$1.name && this.value === name2 && !this.containsEsc; +}; +pp$9.eatContextual = function(name2) { + if (!this.isContextual(name2)) { + return false; + } + this.next(); + return true; +}; +pp$9.expectContextual = function(name2) { + if (!this.eatContextual(name2)) { + this.unexpected(); + } +}; +pp$9.canInsertSemicolon = function() { + return this.type === types$1.eof || this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); +}; +pp$9.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) { + this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); + } + return true; + } +}; +pp$9.semicolon = function() { + if (!this.eat(types$1.semi) && !this.insertSemicolon()) { + this.unexpected(); + } +}; +pp$9.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) { + this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); + } + if (!notNext) { + this.next(); + } + return true; + } +}; +pp$9.expect = function(type) { + this.eat(type) || this.unexpected(); +}; +pp$9.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); +}; +var DestructuringErrors = function DestructuringErrors2() { + this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; +}; +pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { + return; + } + if (refDestructuringErrors.trailingComma > -1) { + this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); + } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { + this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); + } +}; +pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { + return false; + } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { + return shorthandAssign >= 0 || doubleProto >= 0; + } + if (shorthandAssign >= 0) { + this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); + } + if (doubleProto >= 0) { + this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); + } +}; +pp$9.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { + this.raise(this.yieldPos, "Yield expression cannot be a default value"); + } + if (this.awaitPos) { + this.raise(this.awaitPos, "Await expression cannot be a default value"); + } +}; +pp$9.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") { + return this.isSimpleAssignTarget(expr.expression); + } + return expr.type === "Identifier" || expr.type === "MemberExpression"; +}; +var pp$8 = Parser.prototype; +pp$8.parseTopLevel = function(node) { + var exports = /* @__PURE__ */ Object.create(null); + if (!node.body) { + node.body = []; + } + while (this.type !== types$1.eof) { + var stmt = this.parseStatement(null, true, exports); + node.body.push(stmt); + } + if (this.inModule) { + for (var i = 0, list3 = Object.keys(this.undefinedExports); i < list3.length; i += 1) { + var name2 = list3[i]; + this.raiseRecoverable(this.undefinedExports[name2].start, "Export '" + name2 + "' is not defined"); + } + } + this.adaptDirectivePrologue(node.body); + this.next(); + node.sourceType = this.options.sourceType; + return this.finishNode(node, "Program"); +}; +var loopLabel = { kind: "loop" }; +var switchLabel = { kind: "switch" }; +pp$8.isLet = function(context) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { + return false; + } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 91 || nextCh === 92 || nextCh > 55295 && nextCh < 56320) { + return true; + } + if (context) { + return false; + } + if (nextCh === 123) { + return true; + } + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { + ++pos; + } + if (nextCh === 92 || nextCh > 55295 && nextCh < 56320) { + return true; + } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { + return true; + } + } + return false; +}; +pp$8.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { + return false; + } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, after; + return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320)); +}; +pp$8.parseStatement = function(context, topLevel, exports) { + var starttype = this.type, node = this.startNode(), kind; + if (this.isLet(context)) { + starttype = types$1._var; + kind = "let"; + } + switch (starttype) { + case types$1._break: + case types$1._continue: + return this.parseBreakContinueStatement(node, starttype.keyword); + case types$1._debugger: + return this.parseDebuggerStatement(node); + case types$1._do: + return this.parseDoStatement(node); + case types$1._for: + return this.parseForStatement(node); + case types$1._function: + if (context && (this.strict || context !== "if" && context !== "label") && this.options.ecmaVersion >= 6) { + this.unexpected(); + } + return this.parseFunctionStatement(node, false, !context); + case types$1._class: + if (context) { + this.unexpected(); + } + return this.parseClass(node, true); + case types$1._if: + return this.parseIfStatement(node); + case types$1._return: + return this.parseReturnStatement(node); + case types$1._switch: + return this.parseSwitchStatement(node); + case types$1._throw: + return this.parseThrowStatement(node); + case types$1._try: + return this.parseTryStatement(node); + case types$1._const: + case types$1._var: + kind = kind || this.value; + if (context && kind !== "var") { + this.unexpected(); + } + return this.parseVarStatement(node, kind); + case types$1._while: + return this.parseWhileStatement(node); + case types$1._with: + return this.parseWithStatement(node); + case types$1.braceL: + return this.parseBlock(true, node); + case types$1.semi: + return this.parseEmptyStatement(node); + case types$1._export: + case types$1._import: + if (this.options.ecmaVersion > 10 && starttype === types$1._import) { + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 40 || nextCh === 46) { + return this.parseExpressionStatement(node, this.parseExpression()); + } + } + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) { + this.raise(this.start, "'import' and 'export' may only appear at the top level"); + } + if (!this.inModule) { + this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); + } + } + return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports); + default: + if (this.isAsyncFunction()) { + if (context) { + this.unexpected(); + } + this.next(); + return this.parseFunctionStatement(node, true, !context); + } + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) { + return this.parseLabeledStatement(node, maybeName, expr, context); + } else { + return this.parseExpressionStatement(node, expr); + } + } +}; +pp$8.parseBreakContinueStatement = function(node, keyword) { + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types$1.semi) || this.insertSemicolon()) { + node.label = null; + } else if (this.type !== types$1.name) { + this.unexpected(); + } else { + node.label = this.parseIdent(); + this.semicolon(); + } + var i = 0; + for (; i < this.labels.length; ++i) { + var lab = this.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { + break; + } + if (node.label && isBreak) { + break; + } + } + } + if (i === this.labels.length) { + this.raise(node.start, "Unsyntactic " + keyword); + } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); +}; +pp$8.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); +}; +pp$8.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types$1._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) { + this.eat(types$1.semi); + } else { + this.semicolon(); + } + return this.finishNode(node, "DoWhileStatement"); +}; +pp$8.parseForStatement = function(node) { + this.next(); + var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterScope(0); + this.expect(types$1.parenL); + if (this.type === types$1.semi) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, null); + } + var isLet = this.isLet(); + if (this.type === types$1._var || this.type === types$1._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$1._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + return this.parseForIn(node, init$1); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init$1); + } + var startsWithLet = this.isContextual("let"), isForOf = false; + var refDestructuringErrors = new DestructuringErrors(); + var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); + if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$1._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + if (startsWithLet && isForOf) { + this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLValPattern(init); + return this.parseForIn(node, init); + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); +}; +pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync); +}; +pp$8.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement"); +}; +pp$8.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) { + this.raise(this.start, "'return' outside of function"); + } + this.next(); + if (this.eat(types$1.semi) || this.insertSemicolon()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } + return this.finishNode(node, "ReturnStatement"); +}; +pp$8.parseSwitchStatement = function(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types$1.braceL); + this.labels.push(switchLabel); + this.enterScope(0); + var cur; + for (var sawDefault = false; this.type !== types$1.braceR; ) { + if (this.type === types$1._case || this.type === types$1._default) { + var isCase = this.type === types$1._case; + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { + this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); + } + sawDefault = true; + cur.test = null; + } + this.expect(types$1.colon); + } else { + if (!cur) { + this.unexpected(); + } + cur.consequent.push(this.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + this.next(); + this.labels.pop(); + return this.finishNode(node, "SwitchStatement"); +}; +pp$8.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { + this.raise(this.lastTokEnd, "Illegal newline after throw"); + } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); +}; +var empty$1 = []; +pp$8.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types$1._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types$1.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types$1.parenR); + } else { + if (this.options.ecmaVersion < 10) { + this.unexpected(); + } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) { + this.raise(node.start, "Missing catch or finally clause"); + } + return this.finishNode(node, "TryStatement"); +}; +pp$8.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); +}; +pp$8.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement"); +}; +pp$8.parseWithStatement = function(node) { + if (this.strict) { + this.raise(this.start, "'with' in strict mode"); + } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement"); +}; +pp$8.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); +}; +pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { + for (var i$1 = 0, list3 = this.labels; i$1 < list3.length; i$1 += 1) { + var label = list3[i$1]; + if (label.name === maybeName) { + this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } + } + var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label$1 = this.labels[i]; + if (label$1.statementStart === node.start) { + label$1.statementStart = this.start; + label$1.kind = kind; + } else { + break; + } + } + this.labels.push({ name: maybeName, kind, statementStart: this.start }); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); +}; +pp$8.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); +}; +pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { + if (createNewLexicalScope === void 0) + createNewLexicalScope = true; + if (node === void 0) + node = this.startNode(); + node.body = []; + this.expect(types$1.braceL); + if (createNewLexicalScope) { + this.enterScope(0); + } + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + if (exitStrict) { + this.strict = false; + } + this.next(); + if (createNewLexicalScope) { + this.exitScope(); + } + return this.finishNode(node, "BlockStatement"); +}; +pp$8.parseFor = function(node, init) { + node.init = init; + this.expect(types$1.semi); + node.test = this.type === types$1.semi ? null : this.parseExpression(); + this.expect(types$1.semi); + node.update = this.type === types$1.parenR ? null : this.parseExpression(); + this.expect(types$1.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement"); +}; +pp$8.parseForIn = function(node, init) { + var isForIn = this.type === types$1._in; + this.next(); + if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { + this.raise( + init.start, + (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer" + ); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types$1.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); +}; +pp$8.parseVar = function(node, isFor, kind) { + node.declarations = []; + node.kind = kind; + for (; ; ) { + var decl = this.startNode(); + this.parseVarId(decl, kind); + if (this.eat(types$1.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(types$1.comma)) { + break; + } + } + return node; +}; +pp$8.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); +}; +var FUNC_STATEMENT = 1; +var FUNC_HANGING_STATEMENT = 2; +var FUNC_NULLABLE_ID = 4; +pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { + if (this.type === types$1.star && statement & FUNC_HANGING_STATEMENT) { + this.unexpected(); + } + node.generator = this.eat(types$1.star); + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + if (statement & FUNC_STATEMENT) { + node.id = statement & FUNC_NULLABLE_ID && this.type !== types$1.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) { + this.checkLValSimple(node.id, this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); + } + } + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); + if (!(statement & FUNC_STATEMENT)) { + node.id = this.type === types$1.name ? this.parseIdent() : null; + } + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, statement & FUNC_STATEMENT ? "FunctionDeclaration" : "FunctionExpression"); +}; +pp$8.parseFunctionParams = function(node) { + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); +}; +pp$8.parseClass = function(node, isStatement) { + this.next(); + var oldStrict = this.strict; + this.strict = true; + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var privateNameMap = this.enterClassBody(); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types$1.braceL); + while (this.type !== types$1.braceR) { + var element2 = this.parseClassElement(node.superClass !== null); + if (element2) { + classBody.body.push(element2); + if (element2.type === "MethodDefinition" && element2.kind === "constructor") { + if (hadConstructor) { + this.raise(element2.start, "Duplicate constructor in the same class"); + } + hadConstructor = true; + } else if (element2.key && element2.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element2)) { + this.raiseRecoverable(element2.key.start, "Identifier '#" + element2.key.name + "' has already been declared"); + } + } + } + this.strict = oldStrict; + this.next(); + node.body = this.finishNode(classBody, "ClassBody"); + this.exitClassBody(); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); +}; +pp$8.parseClassElement = function(constructorAllowsSuper) { + if (this.eat(types$1.semi)) { + return null; + } + var ecmaVersion = this.options.ecmaVersion; + var node = this.startNode(); + var keyName = ""; + var isGenerator = false; + var isAsync = false; + var kind = "method"; + var isStatic = false; + if (this.eatContextual("static")) { + if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { + this.parseClassStaticBlock(node); + return node; + } + if (this.isClassElementNameStart() || this.type === types$1.star) { + isStatic = true; + } else { + keyName = "static"; + } + } + node.static = isStatic; + if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { + if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { + isAsync = true; + } else { + keyName = "async"; + } + } + if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { + isGenerator = true; + } + if (!keyName && !isAsync && !isGenerator) { + var lastValue = this.value; + if (this.eatContextual("get") || this.eatContextual("set")) { + if (this.isClassElementNameStart()) { + kind = lastValue; + } else { + keyName = lastValue; + } + } + } + if (keyName) { + node.computed = false; + node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); + node.key.name = keyName; + this.finishNode(node.key, "Identifier"); + } else { + this.parseClassElementName(node); + } + if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { + var isConstructor = !node.static && checkKeyName(node, "constructor"); + var allowsDirectSuper = isConstructor && constructorAllowsSuper; + if (isConstructor && kind !== "method") { + this.raise(node.key.start, "Constructor can't have get/set modifier"); + } + node.kind = isConstructor ? "constructor" : kind; + this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper); + } else { + this.parseClassField(node); + } + return node; +}; +pp$8.isClassElementNameStart = function() { + return this.type === types$1.name || this.type === types$1.privateId || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword; +}; +pp$8.parseClassElementName = function(element2) { + if (this.type === types$1.privateId) { + if (this.value === "constructor") { + this.raise(this.start, "Classes can't have an element named '#constructor'"); + } + element2.computed = false; + element2.key = this.parsePrivateIdent(); + } else { + this.parsePropertyName(element2); + } +}; +pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + var key = method.key; + if (method.kind === "constructor") { + if (isGenerator) { + this.raise(key.start, "Constructor can't be a generator"); + } + if (isAsync) { + this.raise(key.start, "Constructor can't be an async method"); + } + } else if (method.static && checkKeyName(method, "prototype")) { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + if (method.kind === "get" && value.params.length !== 0) { + this.raiseRecoverable(value.start, "getter should have no params"); + } + if (method.kind === "set" && value.params.length !== 1) { + this.raiseRecoverable(value.start, "setter should have exactly one param"); + } + if (method.kind === "set" && value.params[0].type === "RestElement") { + this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); + } + return this.finishNode(method, "MethodDefinition"); +}; +pp$8.parseClassField = function(field) { + if (checkKeyName(field, "constructor")) { + this.raise(field.key.start, "Classes can't have a field named 'constructor'"); + } else if (field.static && checkKeyName(field, "prototype")) { + this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); + } + if (this.eat(types$1.eq)) { + var scope = this.currentThisScope(); + var inClassFieldInit = scope.inClassFieldInit; + scope.inClassFieldInit = true; + field.value = this.parseMaybeAssign(); + scope.inClassFieldInit = inClassFieldInit; + } else { + field.value = null; + } + this.semicolon(); + return this.finishNode(field, "PropertyDefinition"); +}; +pp$8.parseClassStaticBlock = function(node) { + node.body = []; + var oldLabels = this.labels; + this.labels = []; + this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + this.next(); + this.exitScope(); + this.labels = oldLabels; + return this.finishNode(node, "StaticBlock"); +}; +pp$8.parseClassId = function(node, isStatement) { + if (this.type === types$1.name) { + node.id = this.parseIdent(); + if (isStatement) { + this.checkLValSimple(node.id, BIND_LEXICAL, false); + } + } else { + if (isStatement === true) { + this.unexpected(); + } + node.id = null; + } +}; +pp$8.parseClassSuper = function(node) { + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null; +}; +pp$8.enterClassBody = function() { + var element2 = { declared: /* @__PURE__ */ Object.create(null), used: [] }; + this.privateNameStack.push(element2); + return element2.declared; +}; +pp$8.exitClassBody = function() { + var ref2 = this.privateNameStack.pop(); + var declared = ref2.declared; + var used = ref2.used; + var len = this.privateNameStack.length; + var parent = len === 0 ? null : this.privateNameStack[len - 1]; + for (var i = 0; i < used.length; ++i) { + var id = used[i]; + if (!hasOwn(declared, id.name)) { + if (parent) { + parent.used.push(id); + } else { + this.raiseRecoverable(id.start, "Private field '#" + id.name + "' must be declared in an enclosing class"); + } + } + } +}; +function isPrivateNameConflicted(privateNameMap, element2) { + var name2 = element2.key.name; + var curr = privateNameMap[name2]; + var next = "true"; + if (element2.type === "MethodDefinition" && (element2.kind === "get" || element2.kind === "set")) { + next = (element2.static ? "s" : "i") + element2.kind; + } + if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") { + privateNameMap[name2] = "true"; + return false; + } else if (!curr) { + privateNameMap[name2] = next; + return false; + } else { + return true; + } +} +function checkKeyName(node, name2) { + var computed = node.computed; + var key = node.key; + return !computed && (key.type === "Identifier" && key.name === name2 || key.type === "Literal" && key.value === name2); +} +pp$8.parseExport = function(node, exports) { + this.next(); + if (this.eat(types$1.star)) { + if (this.options.ecmaVersion >= 11) { + if (this.eatContextual("as")) { + node.exported = this.parseModuleExportName(); + this.checkExport(exports, node.exported, this.lastTokStart); + } else { + node.exported = null; + } + } + this.expectContextual("from"); + if (this.type !== types$1.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration"); + } + if (this.eat(types$1._default)) { + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { + this.next(); + } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); + } else if (this.type === types$1._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration"); + } + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") { + this.checkVariableExport(exports, node.declaration.declarations); + } else { + this.checkExport(exports, node.declaration.id, node.declaration.id.start); + } + node.specifiers = []; + node.source = null; + } else { + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== types$1.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + } else { + for (var i = 0, list3 = node.specifiers; i < list3.length; i += 1) { + var spec = list3[i]; + this.checkUnreserved(spec.local); + this.checkLocalExport(spec.local); + if (spec.local.type === "Literal") { + this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); + } + } + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration"); +}; +pp$8.checkExport = function(exports, name2, pos) { + if (!exports) { + return; + } + if (typeof name2 !== "string") { + name2 = name2.type === "Identifier" ? name2.name : name2.value; + } + if (hasOwn(exports, name2)) { + this.raiseRecoverable(pos, "Duplicate export '" + name2 + "'"); + } + exports[name2] = true; +}; +pp$8.checkPatternExport = function(exports, pat) { + var type = pat.type; + if (type === "Identifier") { + this.checkExport(exports, pat, pat.start); + } else if (type === "ObjectPattern") { + for (var i = 0, list3 = pat.properties; i < list3.length; i += 1) { + var prop = list3[i]; + this.checkPatternExport(exports, prop); + } + } else if (type === "ArrayPattern") { + for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + if (elt) { + this.checkPatternExport(exports, elt); + } + } + } else if (type === "Property") { + this.checkPatternExport(exports, pat.value); + } else if (type === "AssignmentPattern") { + this.checkPatternExport(exports, pat.left); + } else if (type === "RestElement") { + this.checkPatternExport(exports, pat.argument); + } else if (type === "ParenthesizedExpression") { + this.checkPatternExport(exports, pat.expression); + } +}; +pp$8.checkVariableExport = function(exports, decls) { + if (!exports) { + return; + } + for (var i = 0, list3 = decls; i < list3.length; i += 1) { + var decl = list3[i]; + this.checkPatternExport(exports, decl.id); + } +}; +pp$8.shouldParseExportStatement = function() { + return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction(); +}; +pp$8.parseExportSpecifiers = function(exports) { + var nodes = [], first = true; + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + var node = this.startNode(); + node.local = this.parseModuleExportName(); + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports, + node.exported, + node.exported.start + ); + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + return nodes; +}; +pp$8.parseImport = function(node) { + this.next(); + if (this.type === types$1.string) { + node.specifiers = empty$1; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); +}; +pp$8.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types$1.name) { + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLValSimple(node.local, BIND_LEXICAL); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types$1.comma)) { + return nodes; + } + } + if (this.type === types$1.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLValSimple(node$1.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes; + } + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + var node$2 = this.startNode(); + node$2.imported = this.parseModuleExportName(); + if (this.eatContextual("as")) { + node$2.local = this.parseIdent(); + } else { + this.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this.checkLValSimple(node$2.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$2, "ImportSpecifier")); + } + return nodes; +}; +pp$8.parseModuleExportName = function() { + if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { + var stringLiteral = this.parseLiteral(this.value); + if (loneSurrogate.test(stringLiteral.value)) { + this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); + } + return stringLiteral; + } + return this.parseIdent(true); +}; +pp$8.adaptDirectivePrologue = function(statements) { + for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { + statements[i].directive = statements[i].expression.raw.slice(1, -1); + } +}; +pp$8.isDirectiveCandidate = function(statement) { + return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && (this.input[statement.start] === '"' || this.input[statement.start] === "'"); +}; +var pp$7 = Parser.prototype; +pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") { + this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); + } + break; + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + break; + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + for (var i = 0, list3 = node.properties; i < list3.length; i += 1) { + var prop = list3[i]; + this.toAssignable(prop, isBinding); + if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) { + this.raise(prop.argument.start, "Unexpected token"); + } + } + break; + case "Property": + if (node.kind !== "init") { + this.raise(node.key.start, "Object pattern can't contain getter or setter"); + } + this.toAssignable(node.value, isBinding); + break; + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + this.toAssignableList(node.elements, isBinding); + break; + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") { + this.raise(node.argument.start, "Rest elements cannot have a default value"); + } + break; + case "AssignmentExpression": + if (node.operator !== "=") { + this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); + } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + break; + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break; + case "ChainExpression": + this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (!isBinding) { + break; + } + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + return node; +}; +pp$7.toAssignableList = function(exprList, isBinding) { + var end = exprList.length; + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) { + this.toAssignable(elt, isBinding); + } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") { + this.unexpected(last.argument.start); + } + } + return exprList; +}; +pp$7.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement"); +}; +pp$7.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { + this.unexpected(); + } + node.argument = this.parseBindingAtom(); + return this.finishNode(node, "RestElement"); +}; +pp$7.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types$1.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types$1.bracketR, true, true); + return this.finishNode(node, "ArrayPattern"); + case types$1.braceL: + return this.parseObj(true); + } + } + return this.parseIdent(); +}; +pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(types$1.comma); + } + if (allowEmpty && this.type === types$1.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } else if (this.type === types$1.ellipsis) { + var rest = this.parseRestBinding(); + this.parseBindingListItem(rest); + elts.push(rest); + if (this.type === types$1.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + this.expect(close); + break; + } else { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts; +}; +pp$7.parseBindingListItem = function(param) { + return param; +}; +pp$7.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { + return left; + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern"); +}; +pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + var isBind = bindingType !== BIND_NONE; + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { + this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); + } + if (isBind) { + if (bindingType === BIND_LEXICAL && expr.name === "let") { + this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); + } + if (checkClashes) { + if (hasOwn(checkClashes, expr.name)) { + this.raiseRecoverable(expr.start, "Argument name clash"); + } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_OUTSIDE) { + this.declareName(expr.name, bindingType, expr.start); + } + } + break; + case "ChainExpression": + this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding member expression"); + } + break; + case "ParenthesizedExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding parenthesized expression"); + } + return this.checkLValSimple(expr.expression, bindingType, checkClashes); + default: + this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); + } +}; +pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + switch (expr.type) { + case "ObjectPattern": + for (var i = 0, list3 = expr.properties; i < list3.length; i += 1) { + var prop = list3[i]; + this.checkLValInnerPattern(prop, bindingType, checkClashes); + } + break; + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + if (elem) { + this.checkLValInnerPattern(elem, bindingType, checkClashes); + } + } + break; + default: + this.checkLValSimple(expr, bindingType, checkClashes); + } +}; +pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + switch (expr.type) { + case "Property": + this.checkLValInnerPattern(expr.value, bindingType, checkClashes); + break; + case "AssignmentPattern": + this.checkLValPattern(expr.left, bindingType, checkClashes); + break; + case "RestElement": + this.checkLValPattern(expr.argument, bindingType, checkClashes); + break; + default: + this.checkLValPattern(expr, bindingType, checkClashes); + } +}; +var TokContext = function TokContext2(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; +}; +var types = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function(p) { + return p.tryReadTemplateToken(); + }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) +}; +var pp$6 = Parser.prototype; +pp$6.initialContext = function() { + return [types.b_stat]; +}; +pp$6.curContext = function() { + return this.context[this.context.length - 1]; +}; +pp$6.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types.f_expr || parent === types.f_stat) { + return true; + } + if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) { + return !parent.isExpr; + } + if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) { + return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); + } + if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) { + return true; + } + if (prevType === types$1.braceL) { + return parent === types.b_stat; + } + if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) { + return false; + } + return !this.exprAllowed; +}; +pp$6.inGeneratorContext = function() { + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this.context[i]; + if (context.token === "function") { + return context.generator; + } + } + return false; +}; +pp$6.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types$1.dot) { + this.exprAllowed = false; + } else if (update = type.updateContext) { + update.call(this, prevType); + } else { + this.exprAllowed = type.beforeExpr; + } +}; +pp$6.overrideContext = function(tokenCtx) { + if (this.curContext() !== tokenCtx) { + this.context[this.context.length - 1] = tokenCtx; + } +}; +types$1.parenR.updateContext = types$1.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return; + } + var out = this.context.pop(); + if (out === types.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; +}; +types$1.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); + this.exprAllowed = true; +}; +types$1.dollarBraceL.updateContext = function() { + this.context.push(types.b_tmpl); + this.exprAllowed = true; +}; +types$1.parenL.updateContext = function(prevType) { + var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; + this.context.push(statementParens ? types.p_stat : types.p_expr); + this.exprAllowed = true; +}; +types$1.incDec.updateContext = function() { +}; +types$1._function.updateContext = types$1._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types$1._else && !(prevType === types$1.semi && this.curContext() !== types.p_stat) && !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) { + this.context.push(types.f_expr); + } else { + this.context.push(types.f_stat); + } + this.exprAllowed = false; +}; +types$1.backQuote.updateContext = function() { + if (this.curContext() === types.q_tmpl) { + this.context.pop(); + } else { + this.context.push(types.q_tmpl); + } + this.exprAllowed = false; +}; +types$1.star.updateContext = function(prevType) { + if (prevType === types$1._function) { + var index2 = this.context.length - 1; + if (this.context[index2] === types.f_expr) { + this.context[index2] = types.f_expr_gen; + } else { + this.context[index2] = types.f_gen; + } + } + this.exprAllowed = true; +}; +types$1.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { + if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { + allowed = true; + } + } + this.exprAllowed = allowed; +}; +var pp$5 = Parser.prototype; +pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { + return; + } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) { + return; + } + var key = prop.key; + var name2; + switch (key.type) { + case "Identifier": + name2 = key.name; + break; + case "Literal": + name2 = String(key.value); + break; + default: + return; + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name2 === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors) { + if (refDestructuringErrors.doubleProto < 0) { + refDestructuringErrors.doubleProto = key.start; + } + } else { + this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); + } + } + propHash.proto = true; + } + return; + } + name2 = "$" + name2; + var other = propHash[name2]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) { + this.raiseRecoverable(key.start, "Redefinition of property"); + } + } else { + other = propHash[name2] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; +}; +pp$5.parseExpression = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); + if (this.type === types$1.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types$1.comma)) { + node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); + } + return this.finishNode(node, "SequenceExpression"); + } + return expr; +}; +pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { + return this.parseYield(forInit); + } else { + this.exprAllowed = false; + } + } + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors(); + ownDestructuringErrors = true; + } + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types$1.parenL || this.type === types$1.name) { + this.potentialArrowAt = this.start; + this.potentialArrowInForAwait = forInit === "await"; + } + var left = this.parseMaybeConditional(forInit, refDestructuringErrors); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startPos, startLoc); + } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + if (this.type === types$1.eq) { + left = this.toAssignable(left, false, refDestructuringErrors); + } + if (!ownDestructuringErrors) { + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; + } + if (refDestructuringErrors.shorthandAssign >= left.start) { + refDestructuringErrors.shorthandAssign = -1; + } + if (this.type === types$1.eq) { + this.checkLValPattern(left); + } else { + this.checkLValSimple(left); + } + node.left = left; + this.next(); + node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) { + refDestructuringErrors.doubleProto = oldDoubleProto; + } + return this.finishNode(node, "AssignmentExpression"); + } else { + if (ownDestructuringErrors) { + this.checkExpressionErrors(refDestructuringErrors, true); + } + } + if (oldParenAssign > -1) { + refDestructuringErrors.parenthesizedAssign = oldParenAssign; + } + if (oldTrailingComma > -1) { + refDestructuringErrors.trailingComma = oldTrailingComma; + } + return left; +}; +pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(forInit, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + if (this.eat(types$1.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types$1.colon); + node.alternate = this.parseMaybeAssign(forInit); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; +}; +pp$5.parseExprOps = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit); +}; +pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { + var prec = this.type.binop; + if (prec != null && (!forInit || this.type !== types$1._in)) { + if (prec > minPrec) { + var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; + var coalesce = this.type === types$1.coalesce; + if (coalesce) { + prec = types$1.logicalAND.binop; + } + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); + if (logical && this.type === types$1.coalesce || coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND)) { + this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); + } + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit); + } + } + return left; +}; +pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { + if (right.type === "PrivateIdentifier") { + this.raise(right.start, "Private identifier can only be left side of binary expression"); + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression"); +}; +pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && this.canAwait) { + expr = this.parseAwait(forInit); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types$1.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true, update, forInit); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { + this.checkLValSimple(node.argument); + } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { + this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); + } else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) { + this.raiseRecoverable(node.start, "Private fields can not be deleted"); + } else { + sawUnary = true; + } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else if (!sawUnary && this.type === types$1.privateId) { + if (forInit || this.privateNameStack.length === 0) { + this.unexpected(); + } + expr = this.parsePrivateIdent(); + if (this.type !== types$1._in) { + this.unexpected(); + } + } else { + expr = this.parseExprSubscripts(refDestructuringErrors, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.operator = this.value; + node$1.prefix = false; + node$1.argument = expr; + this.checkLValSimple(expr); + this.next(); + expr = this.finishNode(node$1, "UpdateExpression"); + } + } + if (!incDec && this.eat(types$1.starstar)) { + if (sawUnary) { + this.unexpected(this.lastTokStart); + } else { + return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false); + } + } else { + return expr; + } +}; +function isPrivateFieldAccess(node) { + return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression); +} +pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors, forInit); + if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") { + return expr; + } + var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { + refDestructuringErrors.parenthesizedAssign = -1; + } + if (refDestructuringErrors.parenthesizedBind >= result.start) { + refDestructuringErrors.parenthesizedBind = -1; + } + if (refDestructuringErrors.trailingComma >= result.start) { + refDestructuringErrors.trailingComma = -1; + } + } + return result; +}; +pp$5.parseSubscripts = function(base2, startPos, startLoc, noCalls, forInit) { + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base2.type === "Identifier" && base2.name === "async" && this.lastTokEnd === base2.end && !this.canInsertSemicolon() && base2.end - base2.start === 5 && this.potentialArrowAt === base2.start; + var optionalChained = false; + while (true) { + var element2 = this.parseSubscript(base2, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); + if (element2.optional) { + optionalChained = true; + } + if (element2 === base2 || element2.type === "ArrowFunctionExpression") { + if (optionalChained) { + var chainNode = this.startNodeAt(startPos, startLoc); + chainNode.expression = element2; + element2 = this.finishNode(chainNode, "ChainExpression"); + } + return element2; + } + base2 = element2; + } +}; +pp$5.parseSubscript = function(base2, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { + var optionalSupported = this.options.ecmaVersion >= 11; + var optional = optionalSupported && this.eat(types$1.questionDot); + if (noCalls && optional) { + this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); + } + var computed = this.eat(types$1.bracketL); + if (computed || optional && this.type !== types$1.parenL && this.type !== types$1.backQuote || this.eat(types$1.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base2; + if (computed) { + node.property = this.parseExpression(); + this.expect(types$1.bracketR); + } else if (this.type === types$1.privateId && base2.type !== "Super") { + node.property = this.parsePrivateIdent(); + } else { + node.property = this.parseIdent(this.options.allowReserved !== "never"); + } + node.computed = !!computed; + if (optionalSupported) { + node.optional = optional; + } + base2 = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types$1.parenL)) { + var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) { + this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); + } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base2; + node$1.arguments = exprList; + if (optionalSupported) { + node$1.optional = optional; + } + base2 = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types$1.backQuote) { + if (optional || optionalChained) { + this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); + } + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base2; + node$2.quasi = this.parseTemplate({ isTagged: true }); + base2 = this.finishNode(node$2, "TaggedTemplateExpression"); + } + return base2; +}; +pp$5.parseExprAtom = function(refDestructuringErrors, forInit) { + if (this.type === types$1.slash) { + this.readRegexp(); + } + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types$1._super: + if (!this.allowSuper) { + this.raise(this.start, "'super' keyword outside a method"); + } + node = this.startNode(); + this.next(); + if (this.type === types$1.parenL && !this.allowDirectSuper) { + this.raise(node.start, "super() call outside constructor of a subclass"); + } + if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) { + this.unexpected(); + } + return this.finishNode(node, "Super"); + case types$1._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); + case types$1.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { + this.overrideContext(types.f_expr); + return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit); + } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types$1.arrow)) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit); + } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) { + this.unexpected(); + } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit); + } + } + return id; + case types$1.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = { pattern: value.pattern, flags: value.flags }; + return node; + case types$1.num: + case types$1.string: + return this.parseLiteral(this.value); + case types$1._null: + case types$1._true: + case types$1._false: + node = this.startNode(); + node.value = this.type === types$1._null ? null : this.type === types$1._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal"); + case types$1.parenL: + var start3 = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { + refDestructuringErrors.parenthesizedAssign = start3; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = start3; + } + } + return expr; + case types$1.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression"); + case types$1.braceL: + this.overrideContext(types.b_expr); + return this.parseObj(false, refDestructuringErrors); + case types$1._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0); + case types$1._class: + return this.parseClass(this.startNode(), false); + case types$1._new: + return this.parseNew(); + case types$1.backQuote: + return this.parseTemplate(); + case types$1._import: + if (this.options.ecmaVersion >= 11) { + return this.parseExprImport(); + } else { + return this.unexpected(); + } + default: + this.unexpected(); + } +}; +pp$5.parseExprImport = function() { + var node = this.startNode(); + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword import"); + } + var meta = this.parseIdent(true); + switch (this.type) { + case types$1.parenL: + return this.parseDynamicImport(node); + case types$1.dot: + node.meta = meta; + return this.parseImportMeta(node); + default: + this.unexpected(); + } +}; +pp$5.parseDynamicImport = function(node) { + this.next(); + node.source = this.parseMaybeAssign(); + if (!this.eat(types$1.parenR)) { + var errorPos = this.start; + if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); + } + } + return this.finishNode(node, "ImportExpression"); +}; +pp$5.parseImportMeta = function(node) { + this.next(); + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "meta") { + this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); + } + if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) { + this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); + } + return this.finishNode(node, "MetaProperty"); +}; +pp$5.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { + node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); + } + this.next(); + return this.finishNode(node, "Literal"); +}; +pp$5.parseParenExpression = function() { + this.expect(types$1.parenL); + var val = this.parseExpression(); + this.expect(types$1.parenR); + return val; +}; +pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + while (this.type !== types$1.parenR) { + first ? first = false : this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { + lastIsComma = true; + break; + } else if (this.type === types$1.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === types$1.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + break; + } else { + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); + } + } + var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; + this.expect(types$1.parenR); + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList, forInit); + } + if (!exprList.length || lastIsComma) { + this.unexpected(this.lastTokStart); + } + if (spreadStart) { + this.unexpected(spreadStart); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression"); + } else { + return val; + } +}; +pp$5.parseParenItem = function(item) { + return item; +}; +pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit); +}; +var empty = []; +pp$5.parseNew = function() { + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword new"); + } + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target") { + this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); + } + if (!this.allowNewDotTarget) { + this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); + } + return this.finishNode(node, "MetaProperty"); + } + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); + if (isImport && node.callee.type === "ImportExpression") { + this.raise(startPos, "Cannot use new with import()"); + } + if (this.eat(types$1.parenL)) { + node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); + } else { + node.arguments = empty; + } + return this.finishNode(node, "NewExpression"); +}; +pp$5.parseTemplateElement = function(ref2) { + var isTagged = ref2.isTagged; + var elem = this.startNode(); + if (this.type === types$1.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types$1.backQuote; + return this.finishNode(elem, "TemplateElement"); +}; +pp$5.parseTemplate = function(ref2) { + if (ref2 === void 0) + ref2 = {}; + var isTagged = ref2.isTagged; + if (isTagged === void 0) + isTagged = false; + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({ isTagged }); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === types$1.eof) { + this.raise(this.pos, "Unterminated template literal"); + } + this.expect(types$1.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(types$1.braceR); + node.quasis.push(curElt = this.parseTemplateElement({ isTagged })); + } + this.next(); + return this.finishNode(node, "TemplateLiteral"); +}; +pp$5.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types$1.star) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); +}; +pp$5.parseObj = function(isPattern, refDestructuringErrors) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + var prop = this.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { + this.checkPropClash(prop, propHash, refDestructuringErrors); + } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); +}; +pp$5.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types$1.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement"); + } + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + return this.finishNode(prop, "SpreadElement"); + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) { + isGenerator = this.eat(types$1.star); + } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property"); +}; +pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types$1.colon) { + this.unexpected(); + } + if (this.eat(types$1.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { + if (isPattern) { + this.unexpected(); + } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { + if (isGenerator || isAsync) { + this.unexpected(); + } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start3 = prop.value.start; + if (prop.kind === "get") { + this.raiseRecoverable(start3, "getter should have no params"); + } else { + this.raiseRecoverable(start3, "setter should have exactly one param"); + } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { + this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); + } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { + this.unexpected(); + } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = startPos; + } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else if (this.type === types$1.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) { + refDestructuringErrors.shorthandAssign = this.start; + } + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else { + prop.value = this.copyNode(prop.key); + } + prop.shorthand = true; + } else { + this.unexpected(); + } +}; +pp$5.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types$1.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types$1.bracketR); + return prop.key; + } else { + prop.computed = false; + } + } + return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"); +}; +pp$5.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { + node.generator = node.expression = false; + } + if (this.options.ecmaVersion >= 8) { + node.async = false; + } +}; +pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.initFunction(node); + if (this.options.ecmaVersion >= 6) { + node.generator = isGenerator; + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true, false); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression"); +}; +pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression"); +}; +pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { + var isExpression = isArrowFunction && this.type !== types$1.braceL; + var oldStrict = this.strict, useStrict = false; + if (isExpression) { + node.body = this.parseMaybeAssign(forInit); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + if (useStrict && nonSimple) { + this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); + } + } + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { + this.strict = true; + } + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + if (this.strict && node.id) { + this.checkLValSimple(node.id, BIND_OUTSIDE); + } + node.body = this.parseBlock(false, void 0, useStrict && !oldStrict); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); +}; +pp$5.isSimpleParamList = function(params) { + for (var i = 0, list3 = params; i < list3.length; i += 1) { + var param = list3[i]; + if (param.type !== "Identifier") { + return false; + } + } + return true; +}; +pp$5.checkParams = function(node, allowDuplicates) { + var nameHash = /* @__PURE__ */ Object.create(null); + for (var i = 0, list3 = node.params; i < list3.length; i += 1) { + var param = list3[i]; + this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); + } +}; +pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } + } else { + first = false; + } + var elt = void 0; + if (allowEmpty && this.type === types$1.comma) { + elt = null; + } else if (this.type === types$1.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts; +}; +pp$5.checkUnreserved = function(ref2) { + var start3 = ref2.start; + var end = ref2.end; + var name2 = ref2.name; + if (this.inGenerator && name2 === "yield") { + this.raiseRecoverable(start3, "Cannot use 'yield' as identifier inside a generator"); + } + if (this.inAsync && name2 === "await") { + this.raiseRecoverable(start3, "Cannot use 'await' as identifier inside an async function"); + } + if (this.currentThisScope().inClassFieldInit && name2 === "arguments") { + this.raiseRecoverable(start3, "Cannot use 'arguments' in class field initializer"); + } + if (this.inClassStaticBlock && (name2 === "arguments" || name2 === "await")) { + this.raise(start3, "Cannot use " + name2 + " in class static initialization block"); + } + if (this.keywords.test(name2)) { + this.raise(start3, "Unexpected keyword '" + name2 + "'"); + } + if (this.options.ecmaVersion < 6 && this.input.slice(start3, end).indexOf("\\") !== -1) { + return; + } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name2)) { + if (!this.inAsync && name2 === "await") { + this.raiseRecoverable(start3, "Cannot use keyword 'await' outside an async function"); + } + this.raiseRecoverable(start3, "The keyword '" + name2 + "' is reserved"); + } +}; +pp$5.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (this.type === types$1.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(!!liberal); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = node.start; + } + } + return node; +}; +pp$5.parsePrivateIdent = function() { + var node = this.startNode(); + if (this.type === types$1.privateId) { + node.name = this.value; + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "PrivateIdentifier"); + if (this.privateNameStack.length === 0) { + this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class"); + } else { + this.privateNameStack[this.privateNameStack.length - 1].used.push(node); + } + return node; +}; +pp$5.parseYield = function(forInit) { + if (!this.yieldPos) { + this.yieldPos = this.start; + } + var node = this.startNode(); + this.next(); + if (this.type === types$1.semi || this.canInsertSemicolon() || this.type !== types$1.star && !this.type.startsExpr) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types$1.star); + node.argument = this.parseMaybeAssign(forInit); + } + return this.finishNode(node, "YieldExpression"); +}; +pp$5.parseAwait = function(forInit) { + if (!this.awaitPos) { + this.awaitPos = this.start; + } + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true, false, forInit); + return this.finishNode(node, "AwaitExpression"); +}; +var pp$4 = Parser.prototype; +pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; + err.loc = loc; + err.raisedAt = this.pos; + throw err; +}; +pp$4.raiseRecoverable = pp$4.raise; +pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart); + } +}; +var pp$3 = Parser.prototype; +var Scope = function Scope2(flags) { + this.flags = flags; + this.var = []; + this.lexical = []; + this.functions = []; + this.inClassFieldInit = false; +}; +pp$3.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); +}; +pp$3.exitScope = function() { + this.scopeStack.pop(); +}; +pp$3.treatFunctionsAsVarInScope = function(scope) { + return scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_TOP; +}; +pp$3.declareName = function(name2, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name2) > -1 || scope.functions.indexOf(name2) > -1 || scope.var.indexOf(name2) > -1; + scope.lexical.push(name2); + if (this.inModule && scope.flags & SCOPE_TOP) { + delete this.undefinedExports[name2]; + } + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name2); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) { + redeclared = scope$2.lexical.indexOf(name2) > -1; + } else { + redeclared = scope$2.lexical.indexOf(name2) > -1 || scope$2.var.indexOf(name2) > -1; + } + scope$2.functions.push(name2); + } else { + for (var i = this.scopeStack.length - 1; i >= 0; --i) { + var scope$3 = this.scopeStack[i]; + if (scope$3.lexical.indexOf(name2) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name2) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name2) > -1) { + redeclared = true; + break; + } + scope$3.var.push(name2); + if (this.inModule && scope$3.flags & SCOPE_TOP) { + delete this.undefinedExports[name2]; + } + if (scope$3.flags & SCOPE_VAR) { + break; + } + } + } + if (redeclared) { + this.raiseRecoverable(pos, "Identifier '" + name2 + "' has already been declared"); + } +}; +pp$3.checkLocalExport = function(id) { + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } +}; +pp$3.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1]; +}; +pp$3.currentVarScope = function() { + for (var i = this.scopeStack.length - 1; ; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { + return scope; + } + } +}; +pp$3.currentThisScope = function() { + for (var i = this.scopeStack.length - 1; ; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { + return scope; + } + } +}; +var Node = function Node2(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) { + this.loc = new SourceLocation(parser, loc); + } + if (parser.options.directSourceFile) { + this.sourceFile = parser.options.directSourceFile; + } + if (parser.options.ranges) { + this.range = [pos, 0]; + } +}; +var pp$2 = Parser.prototype; +pp$2.startNode = function() { + return new Node(this, this.start, this.startLoc); +}; +pp$2.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc); +}; +function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) { + node.loc.end = loc; + } + if (this.options.ranges) { + node.range[1] = pos; + } + return node; +} +pp$2.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc); +}; +pp$2.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc); +}; +pp$2.copyNode = function(node) { + var newNode = new Node(this, node.start, this.startLoc); + for (var prop in node) { + newNode[prop] = node[prop]; + } + return newNode; +}; +var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; +var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; +var ecma11BinaryProperties = ecma10BinaryProperties; +var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; +var ecma13BinaryProperties = ecma12BinaryProperties; +var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma10BinaryProperties, + 11: ecma11BinaryProperties, + 12: ecma12BinaryProperties, + 13: ecma13BinaryProperties +}; +var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; +var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; +var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; +var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; +var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; +var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; +var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma10ScriptValues, + 11: ecma11ScriptValues, + 12: ecma12ScriptValues, + 13: ecma13ScriptValues +}; +var data = {}; +function buildUnicodeData(ecmaVersion) { + var d = data[ecmaVersion] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) + } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; +} +for (i = 0, list3 = [9, 10, 11, 12, 13]; i < list3.length; i += 1) { + ecmaVersion = list3[i]; + buildUnicodeData(ecmaVersion); +} +var ecmaVersion; +var i; +var list3; +var pp$1 = Parser.prototype; +var RegExpValidationState = function RegExpValidationState2(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; +}; +RegExpValidationState.prototype.reset = function reset(start3, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start3 | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; +}; +RegExpValidationState.prototype.raise = function raise(message) { + this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message); +}; +RegExpValidationState.prototype.at = function at(i, forceU) { + if (forceU === void 0) + forceU = false; + var s = this.source; + var l = s.length; + if (i >= l) { + return -1; + } + var c = s.charCodeAt(i); + if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l) { + return c; + } + var next = s.charCodeAt(i + 1); + return next >= 56320 && next <= 57343 ? (c << 10) + next - 56613888 : c; +}; +RegExpValidationState.prototype.nextIndex = function nextIndex(i, forceU) { + if (forceU === void 0) + forceU = false; + var s = this.source; + var l = s.length; + if (i >= l) { + return l; + } + var c = s.charCodeAt(i), next; + if (!(forceU || this.switchU) || c <= 55295 || c >= 57344 || i + 1 >= l || (next = s.charCodeAt(i + 1)) < 56320 || next > 57343) { + return i + 1; + } + return i + 2; +}; +RegExpValidationState.prototype.current = function current(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.pos, forceU); +}; +RegExpValidationState.prototype.lookahead = function lookahead(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.nextIndex(this.pos, forceU), forceU); +}; +RegExpValidationState.prototype.advance = function advance(forceU) { + if (forceU === void 0) + forceU = false; + this.pos = this.nextIndex(this.pos, forceU); +}; +RegExpValidationState.prototype.eat = function eat(ch, forceU) { + if (forceU === void 0) + forceU = false; + if (this.current(forceU) === ch) { + this.advance(forceU); + return true; + } + return false; +}; +pp$1.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + } +}; +pp$1.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } +}; +pp$1.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + this.regexp_disjunction(state); + if (state.pos !== state.source.length) { + if (state.eat(41)) { + state.raise("Unmatched ')'"); + } + if (state.eat(93) || state.eat(125)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i = 0, list3 = state.backReferenceNames; i < list3.length; i += 1) { + var name2 = list3[i]; + if (state.groupNames.indexOf(name2) === -1) { + state.raise("Invalid named capture referenced"); + } + } +}; +pp$1.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat(124)) { + this.regexp_alternative(state); + } + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(123)) { + state.raise("Lone quantifier brackets"); + } +}; +pp$1.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) { + } +}; +pp$1.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true; + } + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true; + } + return false; +}; +pp$1.regexp_eatAssertion = function(state) { + var start3 = state.pos; + state.lastAssertionIsQuantifiable = false; + if (state.eat(94) || state.eat(36)) { + return true; + } + if (state.eat(92)) { + if (state.eat(66) || state.eat(98)) { + return true; + } + state.pos = start3; + } + if (state.eat(40) && state.eat(63)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(60); + } + if (state.eat(61) || state.eat(33)) { + this.regexp_disjunction(state); + if (!state.eat(41)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true; + } + } + state.pos = start3; + return false; +}; +pp$1.regexp_eatQuantifier = function(state, noError) { + if (noError === void 0) + noError = false; + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(63); + return true; + } + return false; +}; +pp$1.regexp_eatQuantifierPrefix = function(state, noError) { + return state.eat(42) || state.eat(43) || state.eat(63) || this.regexp_eatBracedQuantifier(state, noError); +}; +pp$1.regexp_eatBracedQuantifier = function(state, noError) { + var start3 = state.pos; + if (state.eat(123)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(44) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(125)) { + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true; + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatAtom = function(state) { + return this.regexp_eatPatternCharacters(state) || state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state); +}; +pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { + var start3 = state.pos; + if (state.eat(92)) { + if (this.regexp_eatAtomEscape(state)) { + return true; + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatUncapturingGroup = function(state) { + var start3 = state.pos; + if (state.eat(40)) { + if (state.eat(63) && state.eat(58)) { + this.regexp_disjunction(state); + if (state.eat(41)) { + return true; + } + state.raise("Unterminated group"); + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatCapturingGroup = function(state) { + if (state.eat(40)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 63) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(41)) { + state.numCapturingParens += 1; + return true; + } + state.raise("Unterminated group"); + } + return false; +}; +pp$1.regexp_eatExtendedAtom = function(state) { + return state.eat(46) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state); +}; +pp$1.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false; +}; +pp$1.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; +}; +function isSyntaxCharacter(ch) { + return ch === 36 || ch >= 40 && ch <= 43 || ch === 46 || ch === 63 || ch >= 91 && ch <= 94 || ch >= 123 && ch <= 125; +} +pp$1.regexp_eatPatternCharacters = function(state) { + var start3 = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start3; +}; +pp$1.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if (ch !== -1 && ch !== 36 && !(ch >= 40 && ch <= 43) && ch !== 46 && ch !== 63 && ch !== 91 && ch !== 94 && ch !== 124) { + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_groupSpecifier = function(state) { + if (state.eat(63)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return; + } + state.raise("Invalid group"); + } +}; +pp$1.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(60)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(62)) { + return true; + } + state.raise("Invalid capture group name"); + } + return false; +}; +pp$1.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + } + return true; + } + return false; +}; +pp$1.regexp_eatRegExpIdentifierStart = function(state) { + var start3 = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start3; + return false; +}; +function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 36 || ch === 95; +} +pp$1.regexp_eatRegExpIdentifierPart = function(state) { + var start3 = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start3; + return false; +}; +function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 36 || ch === 95 || ch === 8204 || ch === 8205; +} +pp$1.regexp_eatAtomEscape = function(state) { + if (this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || state.switchN && this.regexp_eatKGroupName(state)) { + return true; + } + if (state.switchU) { + if (state.current() === 99) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false; +}; +pp$1.regexp_eatBackReference = function(state) { + var start3 = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true; + } + if (n <= state.numCapturingParens) { + return true; + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatKGroupName = function(state) { + if (state.eat(107)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true; + } + state.raise("Invalid named reference"); + } + return false; +}; +pp$1.regexp_eatCharacterEscape = function(state) { + return this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || !state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state) || this.regexp_eatIdentityEscape(state); +}; +pp$1.regexp_eatCControlLetter = function(state) { + var start3 = state.pos; + if (state.eat(99)) { + if (this.regexp_eatControlLetter(state)) { + return true; + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatZero = function(state) { + if (state.current() === 48 && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 116) { + state.lastIntValue = 9; + state.advance(); + return true; + } + if (ch === 110) { + state.lastIntValue = 10; + state.advance(); + return true; + } + if (ch === 118) { + state.lastIntValue = 11; + state.advance(); + return true; + } + if (ch === 102) { + state.lastIntValue = 12; + state.advance(); + return true; + } + if (ch === 114) { + state.lastIntValue = 13; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; +}; +function isControlLetter(ch) { + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122; +} +pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + if (forceU === void 0) + forceU = false; + var start3 = state.pos; + var switchU = forceU || state.switchU; + if (state.eat(117)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (switchU && lead >= 55296 && lead <= 56319) { + var leadSurrogateEnd = state.pos; + if (state.eat(92) && state.eat(117) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 56320 && trail <= 57343) { + state.lastIntValue = (lead - 55296) * 1024 + (trail - 56320) + 65536; + return true; + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true; + } + if (switchU && state.eat(123) && this.regexp_eatHexDigits(state) && state.eat(125) && isValidUnicode(state.lastIntValue)) { + return true; + } + if (switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start3; + } + return false; +}; +function isValidUnicode(ch) { + return ch >= 0 && ch <= 1114111; +} +pp$1.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true; + } + if (state.eat(47)) { + state.lastIntValue = 47; + return true; + } + return false; + } + var ch = state.current(); + if (ch !== 99 && (!state.switchN || ch !== 107)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 49 && ch <= 57) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } while ((ch = state.current()) >= 48 && ch <= 57); + return true; + } + return false; +}; +pp$1.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true; + } + if (state.switchU && this.options.ecmaVersion >= 9 && (ch === 80 || ch === 112)) { + state.lastIntValue = -1; + state.advance(); + if (state.eat(123) && this.regexp_eatUnicodePropertyValueExpression(state) && state.eat(125)) { + return true; + } + state.raise("Invalid property name"); + } + return false; +}; +function isCharacterClassEscape(ch) { + return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87; +} +pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { + var start3 = state.pos; + if (this.regexp_eatUnicodePropertyName(state) && state.eat(61)) { + var name2 = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name2, value); + return true; + } + } + state.pos = start3; + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true; + } + return false; +}; +pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name2, value) { + if (!hasOwn(state.unicodeProperties.nonBinary, name2)) { + state.raise("Invalid property name"); + } + if (!state.unicodeProperties.nonBinary[name2].test(value)) { + state.raise("Invalid property value"); + } +}; +pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (!state.unicodeProperties.binary.test(nameOrValue)) { + state.raise("Invalid property name"); + } +}; +pp$1.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== ""; +}; +function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 95; +} +pp$1.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== ""; +}; +function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch); +} +pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state); +}; +pp$1.regexp_eatCharacterClass = function(state) { + if (state.eat(91)) { + state.eat(94); + this.regexp_classRanges(state); + if (state.eat(93)) { + return true; + } + state.raise("Unterminated character class"); + } + return false; +}; +pp$1.regexp_classRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(45) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } +}; +pp$1.regexp_eatClassAtom = function(state) { + var start3 = state.pos; + if (state.eat(92)) { + if (this.regexp_eatClassEscape(state)) { + return true; + } + if (state.switchU) { + var ch$1 = state.current(); + if (ch$1 === 99 || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start3; + } + var ch = state.current(); + if (ch !== 93) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatClassEscape = function(state) { + var start3 = state.pos; + if (state.eat(98)) { + state.lastIntValue = 8; + return true; + } + if (state.switchU && state.eat(45)) { + state.lastIntValue = 45; + return true; + } + if (!state.switchU && state.eat(99)) { + if (this.regexp_eatClassControlLetter(state)) { + return true; + } + state.pos = start3; + } + return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state); +}; +pp$1.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 95) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; +}; +pp$1.regexp_eatHexEscapeSequence = function(state) { + var start3 = state.pos; + if (state.eat(120)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true; + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start3; + } + return false; +}; +pp$1.regexp_eatDecimalDigits = function(state) { + var start3 = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } + return state.pos !== start3; +}; +function isDecimalDigit(ch) { + return ch >= 48 && ch <= 57; +} +pp$1.regexp_eatHexDigits = function(state) { + var start3 = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start3; +}; +function isHexDigit(ch) { + return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102; +} +function hexToInt(ch) { + if (ch >= 65 && ch <= 70) { + return 10 + (ch - 65); + } + if (ch >= 97 && ch <= 102) { + return 10 + (ch - 97); + } + return ch - 48; +} +pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true; + } + return false; +}; +pp$1.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 48; + state.advance(); + return true; + } + state.lastIntValue = 0; + return false; +}; +function isOctalDigit(ch) { + return ch >= 48 && ch <= 55; +} +pp$1.regexp_eatFixedHexDigits = function(state, length) { + var start3 = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start3; + return false; + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true; +}; +var Token = function Token2(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) { + this.loc = new SourceLocation(p, p.startLoc, p.endLoc); + } + if (p.options.ranges) { + this.range = [p.start, p.end]; + } +}; +var pp = Parser.prototype; +pp.next = function(ignoreEscapeSequenceInKeyword) { + if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); + } + if (this.options.onToken) { + this.options.onToken(new Token(this)); + } + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); +}; +pp.getToken = function() { + this.next(); + return new Token(this); +}; +if (typeof Symbol !== "undefined") { + pp[Symbol.iterator] = function() { + var this$1$1 = this; + return { + next: function() { + var token = this$1$1.getToken(); + return { + done: token.type === types$1.eof, + value: token + }; + } + }; + }; +} +pp.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { + this.skipSpace(); + } + this.start = this.pos; + if (this.options.locations) { + this.startLoc = this.curPosition(); + } + if (this.pos >= this.input.length) { + return this.finishToken(types$1.eof); + } + if (curContext.override) { + return curContext.override(this); + } else { + this.readToken(this.fullCharCodeAtPos()); + } +}; +pp.readToken = function(code2) { + if (isIdentifierStart(code2, this.options.ecmaVersion >= 6) || code2 === 92) { + return this.readWord(); + } + return this.getTokenFromCode(code2); +}; +pp.fullCharCodeAtPos = function() { + var code2 = this.input.charCodeAt(this.pos); + if (code2 <= 55295 || code2 >= 56320) { + return code2; + } + var next = this.input.charCodeAt(this.pos + 1); + return next <= 56319 || next >= 57344 ? code2 : (code2 << 10) + next - 56613888; +}; +pp.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start3 = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { + this.raise(this.pos - 2, "Unterminated comment"); + } + this.pos = end + 2; + if (this.options.locations) { + for (var nextBreak = void 0, pos = start3; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1; ) { + ++this.curLine; + pos = this.lineStart = nextBreak; + } + } + if (this.options.onComment) { + this.options.onComment( + true, + this.input.slice(start3 + 2, end), + start3, + this.pos, + startLoc, + this.curPosition() + ); + } +}; +pp.skipLineComment = function(startSkip) { + var start3 = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) { + this.options.onComment( + false, + this.input.slice(start3 + startSkip, this.pos), + start3, + this.pos, + startLoc, + this.curPosition() + ); + } +}; +pp.skipSpace = function() { + loop: + while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: + case 160: + ++this.pos; + break; + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10: + case 8232: + case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break; + case 47: + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: + this.skipBlockComment(); + break; + case 47: + this.skipLineComment(2); + break; + default: + break loop; + } + break; + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop; + } + } + } +}; +pp.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { + this.endLoc = this.curPosition(); + } + var prevType = this.type; + this.type = type; + this.value = val; + this.updateContext(prevType); +}; +pp.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { + return this.readNumber(true); + } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { + this.pos += 3; + return this.finishToken(types$1.ellipsis); + } else { + ++this.pos; + return this.finishToken(types$1.dot); + } +}; +pp.readToken_slash = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { + ++this.pos; + return this.readRegexp(); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.slash, 1); +}; +pp.readToken_mult_modulo_exp = function(code2) { + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code2 === 42 ? types$1.star : types$1.modulo; + if (this.options.ecmaVersion >= 7 && code2 === 42 && next === 42) { + ++size; + tokentype = types$1.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, size + 1); + } + return this.finishOp(tokentype, size); +}; +pp.readToken_pipe_amp = function(code2) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code2) { + if (this.options.ecmaVersion >= 12) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 === 61) { + return this.finishOp(types$1.assign, 3); + } + } + return this.finishOp(code2 === 124 ? types$1.logicalOR : types$1.logicalAND, 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(code2 === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1); +}; +pp.readToken_caret = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.bitwiseXOR, 1); +}; +pp.readToken_plus_min = function(code2) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code2) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + return this.finishOp(types$1.incDec, 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.plusMin, 1); +}; +pp.readToken_lt_gt = function(code2) { + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code2) { + size = code2 === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { + return this.finishOp(types$1.assign, size + 1); + } + return this.finishOp(types$1.bitShift, size); + } + if (next === 33 && code2 === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { + this.skipLineComment(4); + this.skipSpace(); + return this.nextToken(); + } + if (next === 61) { + size = 2; + } + return this.finishOp(types$1.relational, size); +}; +pp.readToken_eq_excl = function(code2) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2); + } + if (code2 === 61 && next === 62 && this.options.ecmaVersion >= 6) { + this.pos += 2; + return this.finishToken(types$1.arrow); + } + return this.finishOp(code2 === 61 ? types$1.eq : types$1.prefix, 1); +}; +pp.readToken_question = function() { + var ecmaVersion = this.options.ecmaVersion; + if (ecmaVersion >= 11) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 46) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 < 48 || next2 > 57) { + return this.finishOp(types$1.questionDot, 2); + } + } + if (next === 63) { + if (ecmaVersion >= 12) { + var next2$1 = this.input.charCodeAt(this.pos + 2); + if (next2$1 === 61) { + return this.finishOp(types$1.assign, 3); + } + } + return this.finishOp(types$1.coalesce, 2); + } + } + return this.finishOp(types$1.question, 1); +}; +pp.readToken_numberSign = function() { + var ecmaVersion = this.options.ecmaVersion; + var code2 = 35; + if (ecmaVersion >= 13) { + ++this.pos; + code2 = this.fullCharCodeAtPos(); + if (isIdentifierStart(code2, true) || code2 === 92) { + return this.finishToken(types$1.privateId, this.readWord1()); + } + } + this.raise(this.pos, "Unexpected character '" + codePointToString(code2) + "'"); +}; +pp.getTokenFromCode = function(code2) { + switch (code2) { + case 46: + return this.readToken_dot(); + case 40: + ++this.pos; + return this.finishToken(types$1.parenL); + case 41: + ++this.pos; + return this.finishToken(types$1.parenR); + case 59: + ++this.pos; + return this.finishToken(types$1.semi); + case 44: + ++this.pos; + return this.finishToken(types$1.comma); + case 91: + ++this.pos; + return this.finishToken(types$1.bracketL); + case 93: + ++this.pos; + return this.finishToken(types$1.bracketR); + case 123: + ++this.pos; + return this.finishToken(types$1.braceL); + case 125: + ++this.pos; + return this.finishToken(types$1.braceR); + case 58: + ++this.pos; + return this.finishToken(types$1.colon); + case 96: + if (this.options.ecmaVersion < 6) { + break; + } + ++this.pos; + return this.finishToken(types$1.backQuote); + case 48: + var next = this.input.charCodeAt(this.pos + 1); + if (next === 120 || next === 88) { + return this.readRadixNumber(16); + } + if (this.options.ecmaVersion >= 6) { + if (next === 111 || next === 79) { + return this.readRadixNumber(8); + } + if (next === 98 || next === 66) { + return this.readRadixNumber(2); + } + } + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return this.readNumber(false); + case 34: + case 39: + return this.readString(code2); + case 47: + return this.readToken_slash(); + case 37: + case 42: + return this.readToken_mult_modulo_exp(code2); + case 124: + case 38: + return this.readToken_pipe_amp(code2); + case 94: + return this.readToken_caret(); + case 43: + case 45: + return this.readToken_plus_min(code2); + case 60: + case 62: + return this.readToken_lt_gt(code2); + case 61: + case 33: + return this.readToken_eq_excl(code2); + case 63: + return this.readToken_question(); + case 126: + return this.finishOp(types$1.prefix, 1); + case 35: + return this.readToken_numberSign(); + } + this.raise(this.pos, "Unexpected character '" + codePointToString(code2) + "'"); +}; +pp.finishOp = function(type, size) { + var str = this.input.slice(this.pos, this.pos + size); + this.pos += size; + return this.finishToken(type, str); +}; +pp.readRegexp = function() { + var escaped, inClass, start3 = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(start3, "Unterminated regular expression"); + } + var ch = this.input.charAt(this.pos); + if (lineBreak.test(ch)) { + this.raise(start3, "Unterminated regular expression"); + } + if (!escaped) { + if (ch === "[") { + inClass = true; + } else if (ch === "]" && inClass) { + inClass = false; + } else if (ch === "/" && !inClass) { + break; + } + escaped = ch === "\\"; + } else { + escaped = false; + } + ++this.pos; + } + var pattern = this.input.slice(start3, this.pos); + ++this.pos; + var flagsStart = this.pos; + var flags = this.readWord1(); + if (this.containsEsc) { + this.unexpected(flagsStart); + } + var state = this.regexpState || (this.regexpState = new RegExpValidationState(this)); + state.reset(start3, pattern, flags); + this.validateRegExpFlags(state); + this.validateRegExpPattern(state); + var value = null; + try { + value = new RegExp(pattern, flags); + } catch (e) { + } + return this.finishToken(types$1.regexp, { pattern, flags, value }); +}; +pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { + var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; + var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; + var start3 = this.pos, total = 0, lastCode = 0; + for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) { + var code2 = this.input.charCodeAt(this.pos), val = void 0; + if (allowSeparators && code2 === 95) { + if (isLegacyOctalNumericLiteral) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); + } + if (lastCode === 95) { + this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); + } + if (i === 0) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); + } + lastCode = code2; + continue; + } + if (code2 >= 97) { + val = code2 - 97 + 10; + } else if (code2 >= 65) { + val = code2 - 65 + 10; + } else if (code2 >= 48 && code2 <= 57) { + val = code2 - 48; + } else { + val = Infinity; + } + if (val >= radix) { + break; + } + lastCode = code2; + total = total * radix + val; + } + if (allowSeparators && lastCode === 95) { + this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); + } + if (this.pos === start3 || len != null && this.pos - start3 !== len) { + return null; + } + return total; +}; +function stringToNumber(str, isLegacyOctalNumericLiteral) { + if (isLegacyOctalNumericLiteral) { + return parseInt(str, 8); + } + return parseFloat(str.replace(/_/g, "")); +} +function stringToBigInt(str) { + if (typeof BigInt !== "function") { + return null; + } + return BigInt(str.replace(/_/g, "")); +} +pp.readRadixNumber = function(radix) { + var start3 = this.pos; + this.pos += 2; + var val = this.readInt(radix); + if (val == null) { + this.raise(this.start + 2, "Expected number in radix " + radix); + } + if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) { + val = stringToBigInt(this.input.slice(start3, this.pos)); + ++this.pos; + } else if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$1.num, val); +}; +pp.readNumber = function(startsWithDot) { + var start3 = this.pos; + if (!startsWithDot && this.readInt(10, void 0, true) === null) { + this.raise(start3, "Invalid number"); + } + var octal = this.pos - start3 >= 2 && this.input.charCodeAt(start3) === 48; + if (octal && this.strict) { + this.raise(start3, "Invalid number"); + } + var next = this.input.charCodeAt(this.pos); + if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) { + var val$1 = stringToBigInt(this.input.slice(start3, this.pos)); + ++this.pos; + if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$1.num, val$1); + } + if (octal && /[89]/.test(this.input.slice(start3, this.pos))) { + octal = false; + } + if (next === 46 && !octal) { + ++this.pos; + this.readInt(10); + next = this.input.charCodeAt(this.pos); + } + if ((next === 69 || next === 101) && !octal) { + next = this.input.charCodeAt(++this.pos); + if (next === 43 || next === 45) { + ++this.pos; + } + if (this.readInt(10) === null) { + this.raise(start3, "Invalid number"); + } + } + if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + var val = stringToNumber(this.input.slice(start3, this.pos), octal); + return this.finishToken(types$1.num, val); +}; +pp.readCodePoint = function() { + var ch = this.input.charCodeAt(this.pos), code2; + if (ch === 123) { + if (this.options.ecmaVersion < 6) { + this.unexpected(); + } + var codePos = ++this.pos; + code2 = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos); + ++this.pos; + if (code2 > 1114111) { + this.invalidStringToken(codePos, "Code point out of bounds"); + } + } else { + code2 = this.readHexChar(4); + } + return code2; +}; +pp.readString = function(quote) { + var out = "", chunkStart = ++this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated string constant"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === quote) { + break; + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(false); + chunkStart = this.pos; + } else if (ch === 8232 || ch === 8233) { + if (this.options.ecmaVersion < 10) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + if (this.options.locations) { + this.curLine++; + this.lineStart = this.pos; + } + } else { + if (isNewLine(ch)) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(types$1.string, out); +}; +var INVALID_TEMPLATE_ESCAPE_ERROR = {}; +pp.tryReadTemplateToken = function() { + this.inTemplateElement = true; + try { + this.readTmplToken(); + } catch (err) { + if (err === INVALID_TEMPLATE_ESCAPE_ERROR) { + this.readInvalidTemplateToken(); + } else { + throw err; + } + } + this.inTemplateElement = false; +}; +pp.invalidStringToken = function(position3, message) { + if (this.inTemplateElement && this.options.ecmaVersion >= 9) { + throw INVALID_TEMPLATE_ESCAPE_ERROR; + } else { + this.raise(position3, message); + } +}; +pp.readTmplToken = function() { + var out = "", chunkStart = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated template"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { + if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { + if (ch === 36) { + this.pos += 2; + return this.finishToken(types$1.dollarBraceL); + } else { + ++this.pos; + return this.finishToken(types$1.backQuote); + } + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(types$1.template, out); + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(true); + chunkStart = this.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + ++this.pos; + switch (ch) { + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + out += "\n"; + break; + default: + out += String.fromCharCode(ch); + break; + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + chunkStart = this.pos; + } else { + ++this.pos; + } + } +}; +pp.readInvalidTemplateToken = function() { + for (; this.pos < this.input.length; this.pos++) { + switch (this.input[this.pos]) { + case "\\": + ++this.pos; + break; + case "$": + if (this.input[this.pos + 1] !== "{") { + break; + } + case "`": + return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)); + } + } + this.raise(this.start, "Unterminated template"); +}; +pp.readEscapedChar = function(inTemplate) { + var ch = this.input.charCodeAt(++this.pos); + ++this.pos; + switch (ch) { + case 110: + return "\n"; + case 114: + return "\r"; + case 120: + return String.fromCharCode(this.readHexChar(2)); + case 117: + return codePointToString(this.readCodePoint()); + case 116: + return " "; + case 98: + return "\b"; + case 118: + return "\v"; + case 102: + return "\f"; + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + if (this.options.locations) { + this.lineStart = this.pos; + ++this.curLine; + } + return ""; + case 56: + case 57: + if (this.strict) { + this.invalidStringToken( + this.pos - 1, + "Invalid escape sequence" + ); + } + if (inTemplate) { + var codePos = this.pos - 1; + this.invalidStringToken( + codePos, + "Invalid escape sequence in template string" + ); + return null; + } + default: + if (ch >= 48 && ch <= 55) { + var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]; + var octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + this.pos += octalStr.length - 1; + ch = this.input.charCodeAt(this.pos); + if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) { + this.invalidStringToken( + this.pos - 1 - octalStr.length, + inTemplate ? "Octal literal in template string" : "Octal literal in strict mode" + ); + } + return String.fromCharCode(octal); + } + if (isNewLine(ch)) { + return ""; + } + return String.fromCharCode(ch); + } +}; +pp.readHexChar = function(len) { + var codePos = this.pos; + var n = this.readInt(16, len); + if (n === null) { + this.invalidStringToken(codePos, "Bad character escape sequence"); + } + return n; +}; +pp.readWord1 = function() { + this.containsEsc = false; + var word = "", first = true, chunkStart = this.pos; + var astral = this.options.ecmaVersion >= 6; + while (this.pos < this.input.length) { + var ch = this.fullCharCodeAtPos(); + if (isIdentifierChar(ch, astral)) { + this.pos += ch <= 65535 ? 1 : 2; + } else if (ch === 92) { + this.containsEsc = true; + word += this.input.slice(chunkStart, this.pos); + var escStart = this.pos; + if (this.input.charCodeAt(++this.pos) !== 117) { + this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); + } + ++this.pos; + var esc = this.readCodePoint(); + if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { + this.invalidStringToken(escStart, "Invalid Unicode escape"); + } + word += codePointToString(esc); + chunkStart = this.pos; + } else { + break; + } + first = false; + } + return word + this.input.slice(chunkStart, this.pos); +}; +pp.readWord = function() { + var word = this.readWord1(); + var type = types$1.name; + if (this.keywords.test(word)) { + type = keywords[word]; + } + return this.finishToken(type, word); +}; +var version = "8.8.1"; +Parser.acorn = { + Parser, + version, + defaultOptions, + Position, + SourceLocation, + getLineInfo, + Node, + TokenType, + tokTypes: types$1, + keywordTypes: keywords, + TokContext, + tokContexts: types, + isIdentifierChar, + isIdentifierStart, + Token, + isNewLine, + lineBreak, + lineBreakG, + nonASCIIwhitespace +}; + +// node_modules/micromark-extension-mdxjs/index.js +var import_acorn_jsx = __toESM(require_acorn_jsx(), 1); + +// node_modules/micromark-util-chunked/index.js +function splice(list3, start3, remove, items) { + const end = list3.length; + let chunkStart = 0; + let parameters; + if (start3 < 0) { + start3 = -start3 > end ? 0 : end + start3; + } else { + start3 = start3 > end ? end : start3; + } + remove = remove > 0 ? remove : 0; + if (items.length < 1e4) { + parameters = Array.from(items); + parameters.unshift(start3, remove); + [].splice.apply(list3, parameters); + } else { + if (remove) + [].splice.apply(list3, [start3, remove]); + while (chunkStart < items.length) { + parameters = items.slice(chunkStart, chunkStart + 1e4); + parameters.unshift(start3, 0); + [].splice.apply(list3, parameters); + chunkStart += 1e4; + start3 += 1e4; + } + } +} +function push(list3, items) { + if (list3.length > 0) { + splice(list3, list3.length, 0, items); + return list3; + } + return items; +} + +// node_modules/micromark-util-combine-extensions/index.js +var hasOwnProperty2 = {}.hasOwnProperty; +function combineExtensions(extensions) { + const all4 = {}; + let index2 = -1; + while (++index2 < extensions.length) { + syntaxExtension(all4, extensions[index2]); + } + return all4; +} +function syntaxExtension(all4, extension2) { + let hook; + for (hook in extension2) { + const maybe = hasOwnProperty2.call(all4, hook) ? all4[hook] : void 0; + const left = maybe || (all4[hook] = {}); + const right = extension2[hook]; + let code2; + for (code2 in right) { + if (!hasOwnProperty2.call(left, code2)) + left[code2] = []; + const value = right[code2]; + constructs( + left[code2], + Array.isArray(value) ? value : value ? [value] : [] + ); + } + } +} +function constructs(existing, list3) { + let index2 = -1; + const before = []; + while (++index2 < list3.length) { + ; + (list3[index2].add === "after" ? existing : before).push(list3[index2]); + } + splice(existing, 0, 0, before); +} + +// node_modules/micromark-util-character/lib/unicode-punctuation-regex.js +var unicodePunctuationRegex = /[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/; + +// node_modules/micromark-util-character/index.js +var asciiAlpha = regexCheck(/[A-Za-z]/); +var asciiDigit = regexCheck(/\d/); +var asciiHexDigit = regexCheck(/[\dA-Fa-f]/); +var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/); +var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/); +var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/); +function asciiControl(code2) { + return code2 !== null && (code2 < 32 || code2 === 127); +} +function markdownLineEndingOrSpace(code2) { + return code2 !== null && (code2 < 0 || code2 === 32); +} +function markdownLineEnding(code2) { + return code2 !== null && code2 < -2; +} +function markdownSpace(code2) { + return code2 === -2 || code2 === -1 || code2 === 32; +} +var unicodeWhitespace = regexCheck(/\s/); +var unicodePunctuation = regexCheck(unicodePunctuationRegex); +function regexCheck(regex2) { + return check; + function check(code2) { + return code2 !== null && regex2.test(String.fromCharCode(code2)); + } +} + +// node_modules/micromark-factory-space/index.js +function factorySpace(effects, ok2, type, max) { + const limit = max ? max - 1 : Number.POSITIVE_INFINITY; + let size = 0; + return start3; + function start3(code2) { + if (markdownSpace(code2)) { + effects.enter(type); + return prefix(code2); + } + return ok2(code2); + } + function prefix(code2) { + if (markdownSpace(code2) && size++ < limit) { + effects.consume(code2); + return prefix; + } + effects.exit(type); + return ok2(code2); + } +} + +// node_modules/unist-util-position-from-estree/index.js +function positionFromEstree(value) { + const node = value || {}; + const loc = node.loc || {}; + const range = node.range || [0, 0]; + const startOffset = range[0] || node.start; + const endOffset = range[1] || node.end; + return { + start: { + line: loc.start && typeof loc.start.line === "number" && loc.start.line > -1 ? loc.start.line : void 0, + column: loc.start && typeof loc.start.column === "number" && loc.start.column > -1 ? loc.start.column + 1 : void 0, + offset: typeof startOffset === "number" && startOffset > -1 ? startOffset : void 0 + }, + end: { + line: loc.end && typeof loc.end.line === "number" && loc.end.line > -1 ? loc.end.line : void 0, + column: loc.end && typeof loc.end.column === "number" && loc.end.column > -1 ? loc.end.column + 1 : void 0, + offset: typeof endOffset === "number" && endOffset > -1 ? endOffset : void 0 + } + }; +} + +// node_modules/estree-util-visit/color.js +function color(d) { + return "\x1B[33m" + d + "\x1B[39m"; +} + +// node_modules/estree-util-visit/index.js +var own2 = {}.hasOwnProperty; +var CONTINUE = Symbol("continue"); +var SKIP = Symbol("skip"); +var EXIT = Symbol("exit"); +function visit(tree, visitor) { + let enter; + let leave; + if (typeof visitor === "function") { + enter = visitor; + } else if (visitor && typeof visitor === "object") { + enter = visitor.enter; + leave = visitor.leave; + } + build(tree, null, null, [])(); + function build(node, key, index2, parents) { + if (nodelike(node)) { + visit3.displayName = "node (" + color(node.type) + ")"; + } + return visit3; + function visit3() { + const result = enter ? toResult(enter(node, key, index2, parents)) : []; + if (result[0] === EXIT) { + return result; + } + if (result[0] !== SKIP) { + let cKey; + for (cKey in node) { + if (own2.call(node, cKey) && node[cKey] && typeof node[cKey] === "object" && cKey !== "data" && cKey !== "position") { + const value = node[cKey]; + const grandparents = parents.concat(node); + if (Array.isArray(value)) { + let cIndex = 0; + while (cIndex > -1 && cIndex < value.length) { + const subvalue = value[cIndex]; + if (nodelike(subvalue)) { + const subresult = build( + subvalue, + cKey, + cIndex, + grandparents + )(); + if (subresult[0] === EXIT) + return subresult; + cIndex = typeof subresult[1] === "number" ? subresult[1] : cIndex + 1; + } else { + cIndex++; + } + } + } else if (nodelike(value)) { + const subresult = build(value, cKey, null, grandparents)(); + if (subresult[0] === EXIT) + return subresult; + } + } + } + } + return leave ? toResult(leave(node, key, index2, parents)) : result; + } + } +} +function toResult(value) { + if (Array.isArray(value)) { + return value; + } + if (typeof value === "number") { + return [CONTINUE, value]; + } + return [value]; +} +function nodelike(value) { + return Boolean( + value && typeof value === "object" && typeof value.type === "string" && value.type.length > 0 + ); +} + +// node_modules/micromark-util-events-to-acorn/node_modules/vfile-location/index.js +function location(file) { + var value = String(file); + var indices = []; + var search2 = /\r?\n|\r/g; + while (search2.test(value)) { + indices.push(search2.lastIndex); + } + indices.push(value.length + 1); + return { toPoint, toOffset }; + function toPoint(offset2) { + var index2 = -1; + if (offset2 > -1 && offset2 < indices[indices.length - 1]) { + while (++index2 < indices.length) { + if (indices[index2] > offset2) { + return { + line: index2 + 1, + column: offset2 - (indices[index2 - 1] || 0) + 1, + offset: offset2 + }; + } + } + } + return { line: void 0, column: void 0, offset: void 0 }; + } + function toOffset(point3) { + var line = point3 && point3.line; + var column = point3 && point3.column; + var offset2; + if (typeof line === "number" && typeof column === "number" && !Number.isNaN(line) && !Number.isNaN(column) && line - 1 in indices) { + offset2 = (indices[line - 2] || 0) + column - 1 || 0; + } + return offset2 > -1 && offset2 < indices[indices.length - 1] ? offset2 : -1; + } +} + +// node_modules/micromark-util-events-to-acorn/index.js +function eventsToAcorn(events, options) { + const { prefix = "", suffix = "" } = options; + const acornOptions = Object.assign({}, options.acornOptions); + const comments = []; + const tokens = []; + const onComment = acornOptions.onComment; + const onToken = acornOptions.onToken; + const acornConfig = Object.assign({}, acornOptions, { + onComment: comments, + onToken: onToken ? tokens : void 0, + preserveParens: true + }); + const chunks = []; + const lines = {}; + let index2 = -1; + let swallow = false; + let estree; + let exception; + let startLine; + if (options.start) { + startLine = options.start.line; + lines[startLine] = options.start; + } + while (++index2 < events.length) { + const [kind, token, context] = events[index2]; + if (kind === "exit") { + chunks.push(context.sliceSerialize(token)); + setPoint(token.start); + setPoint(token.end); + } + } + const source = chunks.join(""); + const value = prefix + source + suffix; + const isEmptyExpression = options.expression && empty2(source); + const place = location(source); + if (isEmptyExpression && !options.allowEmpty) { + throw new VFileMessage( + "Unexpected empty expression", + parseOffsetToUnistPoint(0), + "micromark-extension-mdx-expression:unexpected-empty-expression" + ); + } + try { + estree = options.expression && !isEmptyExpression ? options.acorn.parseExpressionAt(value, 0, acornConfig) : options.acorn.parse(value, acornConfig); + } catch (error_) { + const error = error_; + const point3 = parseOffsetToUnistPoint(error.pos); + error.message = String(error.message).replace(/ \(\d+:\d+\)$/, ""); + error.pos = point3.offset; + error.loc = { + line: point3.line, + column: point3.column - 1 + }; + exception = error; + swallow = error.raisedAt >= prefix.length + source.length || error.message === "Unterminated comment"; + } + if (estree && options.expression && !isEmptyExpression) { + if (empty2(value.slice(estree.end, value.length - suffix.length))) { + estree = { + type: "Program", + start: 0, + end: prefix.length + source.length, + body: [ + { + type: "ExpressionStatement", + expression: estree, + start: 0, + end: prefix.length + source.length + } + ], + sourceType: "module", + comments: [] + }; + } else { + const point3 = parseOffsetToUnistPoint(estree.end); + exception = new Error("Unexpected content after expression"); + exception.pos = point3.offset; + exception.loc = { + line: point3.line, + column: point3.column - 1 + }; + estree = void 0; + } + } + if (estree) { + estree.comments = comments; + visit(estree, (esnode, field, index3, parents) => { + let context = parents[parents.length - 1]; + let prop = field; + if (esnode.type === "ParenthesizedExpression" && context && prop) { + if (typeof index3 === "number") { + context = context[prop]; + prop = index3; + } + context[prop] = esnode.expression; + } + fixPosition(esnode); + }); + if (Array.isArray(onComment)) { + onComment.push(...comments); + } else if (typeof onComment === "function") { + for (const comment2 of comments) { + onComment( + comment2.type === "Block", + comment2.value, + comment2.start, + comment2.end, + comment2.loc.start, + comment2.loc.end + ); + } + } + for (const token of tokens) { + fixPosition(token); + if (Array.isArray(onToken)) { + onToken.push(token); + } else { + onToken(token); + } + } + } + return { + estree, + error: exception, + swallow + }; + function fixPosition(nodeOrToken) { + const pointStart2 = parseOffsetToUnistPoint(nodeOrToken.start); + const pointEnd2 = parseOffsetToUnistPoint(nodeOrToken.end); + nodeOrToken.start = pointStart2.offset; + nodeOrToken.end = pointEnd2.offset; + nodeOrToken.loc = { + start: { + line: pointStart2.line, + column: pointStart2.column - 1, + offset: pointStart2.offset + }, + end: { + line: pointEnd2.line, + column: pointEnd2.column - 1, + offset: pointEnd2.offset + } + }; + nodeOrToken.range = [nodeOrToken.start, nodeOrToken.end]; + } + function parseOffsetToUnistPoint(acornOffset) { + let sourceOffset = acornOffset - prefix.length; + if (sourceOffset < 0) { + sourceOffset = 0; + } else if (sourceOffset > source.length) { + sourceOffset = source.length; + } + const pointInSource = place.toPoint(sourceOffset); + const line = startLine + (pointInSource.line - 1); + const column = lines[line].column + (pointInSource.column - 1); + const offset2 = lines[line].offset + (pointInSource.column - 1); + return { + line, + column, + offset: offset2 + }; + } + function setPoint(point3) { + if (!startLine || point3.line < startLine) { + startLine = point3.line; + } + if (!(point3.line in lines) || lines[point3.line].offset > point3.offset) { + lines[point3.line] = point3; + } + } +} +function empty2(value) { + return /^\s*$/.test( + value.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g, "") + ); +} + +// node_modules/micromark-factory-mdx-expression/index.js +function factoryMdxExpression(effects, ok2, type, markerType, chunkType, acorn, acornOptions, addResult, spread, allowEmpty, allowLazy, startColumn) { + const self2 = this; + const eventStart = this.events.length + 3; + const tail = this.events[this.events.length - 1]; + const initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; + const prefixExpressionIndent = initialPrefix ? initialPrefix + 1 : 0; + let balance = 1; + let startPosition; + let lastCrash; + return start3; + function start3(code2) { + effects.enter(type); + effects.enter(markerType); + effects.consume(code2); + effects.exit(markerType); + startPosition = self2.now(); + return atBreak; + } + function atBreak(code2) { + if (code2 === null) { + throw lastCrash || new VFileMessage( + "Unexpected end of file in expression, expected a corresponding closing brace for `{`", + self2.now(), + "micromark-extension-mdx-expression:unexpected-eof" + ); + } + if (code2 === 125) { + return atClosingBrace(code2); + } + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + const prefixTagIndent = startColumn ? startColumn + 4 - self2.now().column : 0; + const indent = Math.max(prefixExpressionIndent, prefixTagIndent); + return indent ? factorySpace(effects, atBreak, "linePrefix", indent) : atBreak; + } + const now = self2.now(); + if (now.line !== startPosition.line && !allowLazy && self2.parser.lazy[now.line]) { + throw new VFileMessage( + "Unexpected end of file in expression, expected a corresponding closing brace for `{`", + self2.now(), + "micromark-extension-mdx-expression:unexpected-eof" + ); + } + effects.enter(chunkType); + return inside(code2); + } + function inside(code2) { + if (code2 === null || code2 === 125 || markdownLineEnding(code2)) { + effects.exit(chunkType); + return atBreak(code2); + } + if (code2 === 123 && !acorn) { + effects.consume(code2); + balance++; + return inside; + } + effects.consume(code2); + return inside; + } + function atClosingBrace(code2) { + balance--; + if (!acorn) { + if (balance) { + effects.enter(chunkType); + effects.consume(code2); + return inside; + } + effects.enter(markerType); + effects.consume(code2); + effects.exit(markerType); + effects.exit(type); + return ok2; + } + const result = eventsToAcorn(self2.events.slice(eventStart), { + acorn, + acornOptions, + start: startPosition, + expression: true, + allowEmpty, + prefix: spread ? "({" : "", + suffix: spread ? "})" : "" + }); + const estree = result.estree; + if (spread && estree) { + const head = estree.body[0]; + if (head.type !== "ExpressionStatement" || head.expression.type !== "ObjectExpression") { + throw new VFileMessage( + "Unexpected `" + head.type + "` in code: expected an object spread (`{...spread}`)", + positionFromEstree(head).start, + "micromark-extension-mdx-expression:non-spread" + ); + } else if (head.expression.properties[1]) { + throw new VFileMessage( + "Unexpected extra content in spread: only a single spread is supported", + positionFromEstree(head.expression.properties[1]).start, + "micromark-extension-mdx-expression:spread-extra" + ); + } else if (head.expression.properties[0] && head.expression.properties[0].type !== "SpreadElement") { + throw new VFileMessage( + "Unexpected `" + head.expression.properties[0].type + "` in code: only spread elements are supported", + positionFromEstree(head.expression.properties[0]).start, + "micromark-extension-mdx-expression:non-spread" + ); + } + } + if (result.error) { + lastCrash = new VFileMessage( + "Could not parse expression with acorn: " + result.error.message, + { + line: result.error.loc.line, + column: result.error.loc.column + 1, + offset: result.error.pos + }, + "micromark-extension-mdx-expression:acorn" + ); + if (code2 !== null && result.swallow) { + effects.enter(chunkType); + effects.consume(code2); + return inside; + } + throw lastCrash; + } + effects.enter(markerType); + effects.consume(code2); + effects.exit(markerType); + Object.assign( + effects.exit(type), + addResult ? { + estree + } : void 0 + ); + return ok2; + } +} + +// node_modules/micromark-extension-mdx-expression/lib/syntax.js +function mdxExpression(options = {}) { + const addResult = options.addResult; + const acorn = options.acorn; + const spread = options.spread; + let allowEmpty = options.allowEmpty; + let acornOptions; + if (allowEmpty === null || allowEmpty === void 0) { + allowEmpty = true; + } + if (acorn) { + if (!acorn.parseExpressionAt) { + throw new Error( + "Expected a proper `acorn` instance passed in as `options.acorn`" + ); + } + acornOptions = Object.assign( + { + ecmaVersion: 2020, + sourceType: "module" + }, + options.acornOptions + ); + } else if (options.acornOptions || options.addResult) { + throw new Error("Expected an `acorn` instance passed in as `options.acorn`"); + } + return { + flow: { + [123]: { + tokenize: tokenizeFlowExpression, + concrete: true + } + }, + text: { + [123]: { + tokenize: tokenizeTextExpression + } + } + }; + function tokenizeFlowExpression(effects, ok2, nok) { + const self2 = this; + return start3; + function start3(code2) { + return factoryMdxExpression.call( + self2, + effects, + factorySpace(effects, after, "whitespace"), + "mdxFlowExpression", + "mdxFlowExpressionMarker", + "mdxFlowExpressionChunk", + acorn, + acornOptions, + addResult, + spread, + allowEmpty + )(code2); + } + function after(code2) { + return code2 === null || markdownLineEnding(code2) ? ok2(code2) : nok(code2); + } + } + function tokenizeTextExpression(effects, ok2) { + const self2 = this; + return start3; + function start3(code2) { + return factoryMdxExpression.call( + self2, + effects, + ok2, + "mdxTextExpression", + "mdxTextExpressionMarker", + "mdxTextExpressionChunk", + acorn, + acornOptions, + addResult, + spread, + allowEmpty, + true + )(code2); + } + } +} + +// node_modules/estree-util-is-identifier-name/regex.js +var start = /[$A-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/; +var cont = /[\d\u00B7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF\u1AC0\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F]/; + +// node_modules/estree-util-is-identifier-name/index.js +function start2(code2) { + return start.test(String.fromCharCode(code2)); +} +function cont2(code2) { + const character = String.fromCharCode(code2); + return start.test(character) || cont.test(character); +} +function name(name2) { + let index2 = -1; + while (++index2 < name2.length) { + if (!(index2 ? cont2 : start2)(name2.charCodeAt(index2))) + return false; + } + return index2 > 0; +} + +// node_modules/micromark-extension-mdx-jsx/lib/factory-tag.js +var lazyLineEnd = { + tokenize: tokenizeLazyLineEnd, + partial: true +}; +function factoryTag(effects, ok2, nok, acorn, acornOptions, addResult, allowLazy, tagType, tagMarkerType, tagClosingMarkerType, tagSelfClosingMarker, tagNameType, tagNamePrimaryType, tagNameMemberMarkerType, tagNameMemberType, tagNamePrefixMarkerType, tagNameLocalType, tagExpressionAttributeType, tagExpressionAttributeMarkerType, tagExpressionAttributeValueType, tagAttributeType, tagAttributeNameType, tagAttributeNamePrimaryType, tagAttributeNamePrefixMarkerType, tagAttributeNameLocalType, tagAttributeInitializerMarkerType, tagAttributeValueLiteralType, tagAttributeValueLiteralMarkerType, tagAttributeValueLiteralValueType, tagAttributeValueExpressionType, tagAttributeValueExpressionMarkerType, tagAttributeValueExpressionValueType) { + const self2 = this; + let returnState; + let marker; + let startPoint; + return start3; + function start3(code2) { + startPoint = self2.now(); + effects.enter(tagType); + effects.enter(tagMarkerType); + effects.consume(code2); + effects.exit(tagMarkerType); + return afterStart; + } + function afterStart(code2) { + if (markdownLineEnding(code2) || markdownSpace(code2)) { + return nok(code2); + } + returnState = beforeName; + return optionalEsWhitespace(code2); + } + function beforeName(code2) { + if (code2 === 47) { + effects.enter(tagClosingMarkerType); + effects.consume(code2); + effects.exit(tagClosingMarkerType); + returnState = beforeClosingTagName; + return optionalEsWhitespace; + } + if (code2 === 62) { + return tagEnd(code2); + } + if (code2 !== null && start2(code2)) { + effects.enter(tagNameType); + effects.enter(tagNamePrimaryType); + effects.consume(code2); + return primaryName; + } + crash( + code2, + "before name", + "a character that can start a name, such as a letter, `$`, or `_`" + (code2 === 33 ? " (note: to create a comment in MDX, use `{/* text */}`)" : "") + ); + } + function beforeClosingTagName(code2) { + if (code2 === 62) { + return tagEnd(code2); + } + if (code2 !== null && start2(code2)) { + effects.enter(tagNameType); + effects.enter(tagNamePrimaryType); + effects.consume(code2); + return primaryName; + } + crash( + code2, + "before name", + "a character that can start a name, such as a letter, `$`, or `_`" + (code2 === 42 || code2 === 47 ? " (note: JS comments in JSX tags are not supported in MDX)" : "") + ); + } + function primaryName(code2) { + if (code2 === 45 || code2 !== null && cont2(code2)) { + effects.consume(code2); + return primaryName; + } + if (code2 === 46 || code2 === 47 || code2 === 58 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) { + effects.exit(tagNamePrimaryType); + returnState = afterPrimaryName; + return optionalEsWhitespace(code2); + } + crash( + code2, + "in name", + "a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag" + (code2 === 64 ? " (note: to create a link in MDX, use `[text](url)`)" : "") + ); + } + function afterPrimaryName(code2) { + if (code2 === 46) { + effects.enter(tagNameMemberMarkerType); + effects.consume(code2); + effects.exit(tagNameMemberMarkerType); + returnState = beforeMemberName; + return optionalEsWhitespace; + } + if (code2 === 58) { + effects.enter(tagNamePrefixMarkerType); + effects.consume(code2); + effects.exit(tagNamePrefixMarkerType); + returnState = beforeLocalName; + return optionalEsWhitespace; + } + if (code2 === 47 || code2 === 62 || code2 === 123 || code2 !== null && start2(code2)) { + effects.exit(tagNameType); + return beforeAttribute(code2); + } + crash( + code2, + "after name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function beforeMemberName(code2) { + if (code2 !== null && start2(code2)) { + effects.enter(tagNameMemberType); + effects.consume(code2); + return memberName; + } + crash( + code2, + "before member name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function memberName(code2) { + if (code2 === 45 || code2 !== null && cont2(code2)) { + effects.consume(code2); + return memberName; + } + if (code2 === 46 || code2 === 47 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) { + effects.exit(tagNameMemberType); + returnState = afterMemberName; + return optionalEsWhitespace(code2); + } + crash( + code2, + "in member name", + "a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag" + (code2 === 64 ? " (note: to create a link in MDX, use `[text](url)`)" : "") + ); + } + function afterMemberName(code2) { + if (code2 === 46) { + effects.enter(tagNameMemberMarkerType); + effects.consume(code2); + effects.exit(tagNameMemberMarkerType); + returnState = beforeMemberName; + return optionalEsWhitespace; + } + if (code2 === 47 || code2 === 62 || code2 === 123 || code2 !== null && start2(code2)) { + effects.exit(tagNameType); + return beforeAttribute(code2); + } + crash( + code2, + "after member name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function beforeLocalName(code2) { + if (code2 !== null && start2(code2)) { + effects.enter(tagNameLocalType); + effects.consume(code2); + return localName; + } + crash( + code2, + "before local name", + "a character that can start a name, such as a letter, `$`, or `_`" + (code2 === 43 || code2 !== null && code2 > 46 && code2 < 58 ? " (note: to create a link in MDX, use `[text](url)`)" : "") + ); + } + function localName(code2) { + if (code2 === 45 || code2 !== null && cont2(code2)) { + effects.consume(code2); + return localName; + } + if (code2 === 47 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) { + effects.exit(tagNameLocalType); + returnState = afterLocalName; + return optionalEsWhitespace(code2); + } + crash( + code2, + "in local name", + "a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function afterLocalName(code2) { + if (code2 === 47 || code2 === 62 || code2 === 123 || code2 !== null && start2(code2)) { + effects.exit(tagNameType); + return beforeAttribute(code2); + } + crash( + code2, + "after local name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function beforeAttribute(code2) { + if (code2 === 47) { + effects.enter(tagSelfClosingMarker); + effects.consume(code2); + effects.exit(tagSelfClosingMarker); + returnState = selfClosing; + return optionalEsWhitespace; + } + if (code2 === 62) { + return tagEnd(code2); + } + if (code2 === 123) { + return factoryMdxExpression.call( + self2, + effects, + afterAttributeExpression, + tagExpressionAttributeType, + tagExpressionAttributeMarkerType, + tagExpressionAttributeValueType, + acorn, + acornOptions, + addResult, + true, + false, + allowLazy, + startPoint.column + )(code2); + } + if (code2 !== null && start2(code2)) { + effects.enter(tagAttributeType); + effects.enter(tagAttributeNameType); + effects.enter(tagAttributeNamePrimaryType); + effects.consume(code2); + return attributePrimaryName; + } + crash( + code2, + "before attribute name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag" + ); + } + function afterAttributeExpression(code2) { + returnState = beforeAttribute; + return optionalEsWhitespace(code2); + } + function attributePrimaryName(code2) { + if (code2 === 45 || code2 !== null && cont2(code2)) { + effects.consume(code2); + return attributePrimaryName; + } + if (code2 === 47 || code2 === 58 || code2 === 61 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) { + effects.exit(tagAttributeNamePrimaryType); + returnState = afterAttributePrimaryName; + return optionalEsWhitespace(code2); + } + crash( + code2, + "in attribute name", + "an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag" + ); + } + function afterAttributePrimaryName(code2) { + if (code2 === 58) { + effects.enter(tagAttributeNamePrefixMarkerType); + effects.consume(code2); + effects.exit(tagAttributeNamePrefixMarkerType); + returnState = beforeAttributeLocalName; + return optionalEsWhitespace; + } + if (code2 === 61) { + effects.exit(tagAttributeNameType); + effects.enter(tagAttributeInitializerMarkerType); + effects.consume(code2); + effects.exit(tagAttributeInitializerMarkerType); + returnState = beforeAttributeValue; + return optionalEsWhitespace; + } + if (code2 === 47 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2) || code2 !== null && start2(code2)) { + effects.exit(tagAttributeNameType); + effects.exit(tagAttributeType); + returnState = beforeAttribute; + return optionalEsWhitespace(code2); + } + crash( + code2, + "after attribute name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag" + ); + } + function beforeAttributeLocalName(code2) { + if (code2 !== null && start2(code2)) { + effects.enter(tagAttributeNameLocalType); + effects.consume(code2); + return attributeLocalName; + } + crash( + code2, + "before local attribute name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag" + ); + } + function attributeLocalName(code2) { + if (code2 === 45 || code2 !== null && cont2(code2)) { + effects.consume(code2); + return attributeLocalName; + } + if (code2 === 47 || code2 === 61 || code2 === 62 || code2 === 123 || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) { + effects.exit(tagAttributeNameLocalType); + effects.exit(tagAttributeNameType); + returnState = afterAttributeLocalName; + return optionalEsWhitespace(code2); + } + crash( + code2, + "in local attribute name", + "an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag" + ); + } + function afterAttributeLocalName(code2) { + if (code2 === 61) { + effects.enter(tagAttributeInitializerMarkerType); + effects.consume(code2); + effects.exit(tagAttributeInitializerMarkerType); + returnState = beforeAttributeValue; + return optionalEsWhitespace; + } + if (code2 === 47 || code2 === 62 || code2 === 123 || code2 !== null && start2(code2)) { + effects.exit(tagAttributeType); + return beforeAttribute(code2); + } + crash( + code2, + "after local attribute name", + "a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag" + ); + } + function beforeAttributeValue(code2) { + if (code2 === 34 || code2 === 39) { + effects.enter(tagAttributeValueLiteralType); + effects.enter(tagAttributeValueLiteralMarkerType); + effects.consume(code2); + effects.exit(tagAttributeValueLiteralMarkerType); + marker = code2; + return attributeValueQuotedStart; + } + if (code2 === 123) { + return factoryMdxExpression.call( + self2, + effects, + afterAttributeValueExpression, + tagAttributeValueExpressionType, + tagAttributeValueExpressionMarkerType, + tagAttributeValueExpressionValueType, + acorn, + acornOptions, + addResult, + false, + false, + allowLazy, + startPoint.column + )(code2); + } + crash( + code2, + "before attribute value", + "a character that can start an attribute value, such as `\"`, `'`, or `{`" + (code2 === 60 ? " (note: to use an element or fragment as a prop value in MDX, use `{}`)" : "") + ); + } + function afterAttributeValueExpression(code2) { + effects.exit(tagAttributeType); + returnState = beforeAttribute; + return optionalEsWhitespace(code2); + } + function attributeValueQuotedStart(code2) { + if (code2 === null) { + crash( + code2, + "in attribute value", + "a corresponding closing quote `" + String.fromCharCode(marker) + "`" + ); + } + if (code2 === marker) { + effects.enter(tagAttributeValueLiteralMarkerType); + effects.consume(code2); + effects.exit(tagAttributeValueLiteralMarkerType); + effects.exit(tagAttributeValueLiteralType); + effects.exit(tagAttributeType); + marker = void 0; + returnState = beforeAttribute; + return optionalEsWhitespace; + } + if (markdownLineEnding(code2)) { + returnState = attributeValueQuotedStart; + return optionalEsWhitespace(code2); + } + effects.enter(tagAttributeValueLiteralValueType); + return attributeValueQuoted(code2); + } + function attributeValueQuoted(code2) { + if (code2 === null || code2 === marker || markdownLineEnding(code2)) { + effects.exit(tagAttributeValueLiteralValueType); + return attributeValueQuotedStart(code2); + } + effects.consume(code2); + return attributeValueQuoted; + } + function selfClosing(code2) { + if (code2 === 62) { + return tagEnd(code2); + } + crash( + code2, + "after self-closing slash", + "`>` to end the tag" + (code2 === 42 || code2 === 47 ? " (note: JS comments in JSX tags are not supported in MDX)" : "") + ); + } + function tagEnd(code2) { + effects.enter(tagMarkerType); + effects.consume(code2); + effects.exit(tagMarkerType); + effects.exit(tagType); + return ok2; + } + function optionalEsWhitespace(code2) { + if (markdownLineEnding(code2)) { + if (allowLazy) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return factorySpace(effects, optionalEsWhitespace, "linePrefix", 4); + } + return effects.attempt( + lazyLineEnd, + factorySpace(effects, optionalEsWhitespace, "linePrefix", 4), + crashEol + )(code2); + } + if (markdownSpace(code2) || unicodeWhitespace(code2)) { + effects.enter("esWhitespace"); + return optionalEsWhitespaceContinue(code2); + } + return returnState(code2); + } + function optionalEsWhitespaceContinue(code2) { + if (markdownLineEnding(code2) || !(markdownSpace(code2) || unicodeWhitespace(code2))) { + effects.exit("esWhitespace"); + return optionalEsWhitespace(code2); + } + effects.consume(code2); + return optionalEsWhitespaceContinue; + } + function crashEol() { + throw new VFileMessage( + "Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc", + self2.now(), + "micromark-extension-mdx-jsx:unexpected-eof" + ); + } + function crash(code2, at2, expect) { + throw new VFileMessage( + "Unexpected " + (code2 === null ? "end of file" : "character `" + (code2 === 96 ? "` ` `" : String.fromCharCode(code2)) + "` (" + serializeCharCode(code2) + ")") + " " + at2 + ", expected " + expect, + self2.now(), + "micromark-extension-mdx-jsx:unexpected-" + (code2 === null ? "eof" : "character") + ); + } +} +function tokenizeLazyLineEnd(effects, ok2, nok) { + const self2 = this; + return start3; + function start3(code2) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return lineStart; + } + function lineStart(code2) { + return self2.parser.lazy[self2.now().line] ? nok(code2) : ok2(code2); + } +} +function serializeCharCode(code2) { + return "U+" + code2.toString(16).toUpperCase().padStart(4, "0"); +} + +// node_modules/micromark-extension-mdx-jsx/lib/jsx-text.js +function jsxText(acorn, acornOptions, addResult) { + return { + tokenize: tokenizeJsxText + }; + function tokenizeJsxText(effects, ok2, nok) { + return factoryTag.call( + this, + effects, + ok2, + nok, + acorn, + acornOptions, + addResult, + true, + "mdxJsxTextTag", + "mdxJsxTextTagMarker", + "mdxJsxTextTagClosingMarker", + "mdxJsxTextTagSelfClosingMarker", + "mdxJsxTextTagName", + "mdxJsxTextTagNamePrimary", + "mdxJsxTextTagNameMemberMarker", + "mdxJsxTextTagNameMember", + "mdxJsxTextTagNamePrefixMarker", + "mdxJsxTextTagNameLocal", + "mdxJsxTextTagExpressionAttribute", + "mdxJsxTextTagExpressionAttributeMarker", + "mdxJsxTextTagExpressionAttributeValue", + "mdxJsxTextTagAttribute", + "mdxJsxTextTagAttributeName", + "mdxJsxTextTagAttributeNamePrimary", + "mdxJsxTextTagAttributeNamePrefixMarker", + "mdxJsxTextTagAttributeNameLocal", + "mdxJsxTextTagAttributeInitializerMarker", + "mdxJsxTextTagAttributeValueLiteral", + "mdxJsxTextTagAttributeValueLiteralMarker", + "mdxJsxTextTagAttributeValueLiteralValue", + "mdxJsxTextTagAttributeValueExpression", + "mdxJsxTextTagAttributeValueExpressionMarker", + "mdxJsxTextTagAttributeValueExpressionValue" + ); + } +} + +// node_modules/micromark-extension-mdx-jsx/lib/jsx-flow.js +function jsxFlow(acorn, acornOptions, addResult) { + return { + tokenize: tokenizeJsxFlow, + concrete: true + }; + function tokenizeJsxFlow(effects, ok2, nok) { + const self2 = this; + return start3; + function start3(code2) { + return factoryTag.call( + self2, + effects, + factorySpace(effects, after, "whitespace"), + nok, + acorn, + acornOptions, + addResult, + false, + "mdxJsxFlowTag", + "mdxJsxFlowTagMarker", + "mdxJsxFlowTagClosingMarker", + "mdxJsxFlowTagSelfClosingMarker", + "mdxJsxFlowTagName", + "mdxJsxFlowTagNamePrimary", + "mdxJsxFlowTagNameMemberMarker", + "mdxJsxFlowTagNameMember", + "mdxJsxFlowTagNamePrefixMarker", + "mdxJsxFlowTagNameLocal", + "mdxJsxFlowTagExpressionAttribute", + "mdxJsxFlowTagExpressionAttributeMarker", + "mdxJsxFlowTagExpressionAttributeValue", + "mdxJsxFlowTagAttribute", + "mdxJsxFlowTagAttributeName", + "mdxJsxFlowTagAttributeNamePrimary", + "mdxJsxFlowTagAttributeNamePrefixMarker", + "mdxJsxFlowTagAttributeNameLocal", + "mdxJsxFlowTagAttributeInitializerMarker", + "mdxJsxFlowTagAttributeValueLiteral", + "mdxJsxFlowTagAttributeValueLiteralMarker", + "mdxJsxFlowTagAttributeValueLiteralValue", + "mdxJsxFlowTagAttributeValueExpression", + "mdxJsxFlowTagAttributeValueExpressionMarker", + "mdxJsxFlowTagAttributeValueExpressionValue" + )(code2); + } + function after(code2) { + return code2 === 60 ? start3(code2) : code2 === null || markdownLineEnding(code2) ? ok2(code2) : nok(code2); + } + } +} + +// node_modules/micromark-extension-mdx-jsx/lib/syntax.js +function mdxJsx(options = {}) { + const acorn = options.acorn; + let acornOptions; + if (acorn) { + if (!acorn.parse || !acorn.parseExpressionAt) { + throw new Error( + "Expected a proper `acorn` instance passed in as `options.acorn`" + ); + } + acornOptions = Object.assign( + { + ecmaVersion: 2020, + sourceType: "module" + }, + options.acornOptions, + { + locations: true + } + ); + } else if (options.acornOptions || options.addResult) { + throw new Error("Expected an `acorn` instance passed in as `options.acorn`"); + } + return { + flow: { + [60]: jsxFlow(acorn, acornOptions, options.addResult) + }, + text: { + [60]: jsxText(acorn, acornOptions, options.addResult) + } + }; +} + +// node_modules/micromark-extension-mdx-md/index.js +var mdxMd = { + disable: { null: ["autolink", "codeIndented", "htmlFlow", "htmlText"] } +}; + +// node_modules/micromark-util-classify-character/index.js +function classifyCharacter(code2) { + if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) { + return 1; + } + if (unicodePunctuation(code2)) { + return 2; + } +} + +// node_modules/micromark-util-resolve-all/index.js +function resolveAll(constructs2, events, context) { + const called = []; + let index2 = -1; + while (++index2 < constructs2.length) { + const resolve = constructs2[index2].resolveAll; + if (resolve && !called.includes(resolve)) { + events = resolve(events, context); + called.push(resolve); + } + } + return events; +} + +// node_modules/micromark-core-commonmark/lib/attention.js +var attention = { + name: "attention", + tokenize: tokenizeAttention, + resolveAll: resolveAllAttention +}; +function resolveAllAttention(events, context) { + let index2 = -1; + let open; + let group; + let text5; + let openingSequence; + let closingSequence; + let use; + let nextEvents; + let offset2; + while (++index2 < events.length) { + if (events[index2][0] === "enter" && events[index2][1].type === "attentionSequence" && events[index2][1]._close) { + open = index2; + while (open--) { + if (events[open][0] === "exit" && events[open][1].type === "attentionSequence" && events[open][1]._open && context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index2][1]).charCodeAt(0)) { + if ((events[open][1]._close || events[index2][1]._open) && (events[index2][1].end.offset - events[index2][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index2][1].end.offset - events[index2][1].start.offset) % 3)) { + continue; + } + use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index2][1].end.offset - events[index2][1].start.offset > 1 ? 2 : 1; + const start3 = Object.assign({}, events[open][1].end); + const end = Object.assign({}, events[index2][1].start); + movePoint(start3, -use); + movePoint(end, use); + openingSequence = { + type: use > 1 ? "strongSequence" : "emphasisSequence", + start: start3, + end: Object.assign({}, events[open][1].end) + }; + closingSequence = { + type: use > 1 ? "strongSequence" : "emphasisSequence", + start: Object.assign({}, events[index2][1].start), + end + }; + text5 = { + type: use > 1 ? "strongText" : "emphasisText", + start: Object.assign({}, events[open][1].end), + end: Object.assign({}, events[index2][1].start) + }; + group = { + type: use > 1 ? "strong" : "emphasis", + start: Object.assign({}, openingSequence.start), + end: Object.assign({}, closingSequence.end) + }; + events[open][1].end = Object.assign({}, openingSequence.start); + events[index2][1].start = Object.assign({}, closingSequence.end); + nextEvents = []; + if (events[open][1].end.offset - events[open][1].start.offset) { + nextEvents = push(nextEvents, [ + ["enter", events[open][1], context], + ["exit", events[open][1], context] + ]); + } + nextEvents = push(nextEvents, [ + ["enter", group, context], + ["enter", openingSequence, context], + ["exit", openingSequence, context], + ["enter", text5, context] + ]); + nextEvents = push( + nextEvents, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + 1, index2), + context + ) + ); + nextEvents = push(nextEvents, [ + ["exit", text5, context], + ["enter", closingSequence, context], + ["exit", closingSequence, context], + ["exit", group, context] + ]); + if (events[index2][1].end.offset - events[index2][1].start.offset) { + offset2 = 2; + nextEvents = push(nextEvents, [ + ["enter", events[index2][1], context], + ["exit", events[index2][1], context] + ]); + } else { + offset2 = 0; + } + splice(events, open - 1, index2 - open + 3, nextEvents); + index2 = open + nextEvents.length - offset2 - 2; + break; + } + } + } + } + index2 = -1; + while (++index2 < events.length) { + if (events[index2][1].type === "attentionSequence") { + events[index2][1].type = "data"; + } + } + return events; +} +function tokenizeAttention(effects, ok2) { + const attentionMarkers2 = this.parser.constructs.attentionMarkers.null; + const previous2 = this.previous; + const before = classifyCharacter(previous2); + let marker; + return start3; + function start3(code2) { + effects.enter("attentionSequence"); + marker = code2; + return sequence(code2); + } + function sequence(code2) { + if (code2 === marker) { + effects.consume(code2); + return sequence; + } + const token = effects.exit("attentionSequence"); + const after = classifyCharacter(code2); + const open = !after || after === 2 && before || attentionMarkers2.includes(code2); + const close = !before || before === 2 && after || attentionMarkers2.includes(previous2); + token._open = Boolean(marker === 42 ? open : open && (before || !close)); + token._close = Boolean(marker === 42 ? close : close && (after || !open)); + return ok2(code2); + } +} +function movePoint(point3, offset2) { + point3.column += offset2; + point3.offset += offset2; + point3._bufferIndex += offset2; +} + +// node_modules/micromark-core-commonmark/lib/autolink.js +var autolink = { + name: "autolink", + tokenize: tokenizeAutolink +}; +function tokenizeAutolink(effects, ok2, nok) { + let size = 1; + return start3; + function start3(code2) { + effects.enter("autolink"); + effects.enter("autolinkMarker"); + effects.consume(code2); + effects.exit("autolinkMarker"); + effects.enter("autolinkProtocol"); + return open; + } + function open(code2) { + if (asciiAlpha(code2)) { + effects.consume(code2); + return schemeOrEmailAtext; + } + return asciiAtext(code2) ? emailAtext(code2) : nok(code2); + } + function schemeOrEmailAtext(code2) { + return code2 === 43 || code2 === 45 || code2 === 46 || asciiAlphanumeric(code2) ? schemeInsideOrEmailAtext(code2) : emailAtext(code2); + } + function schemeInsideOrEmailAtext(code2) { + if (code2 === 58) { + effects.consume(code2); + return urlInside; + } + if ((code2 === 43 || code2 === 45 || code2 === 46 || asciiAlphanumeric(code2)) && size++ < 32) { + effects.consume(code2); + return schemeInsideOrEmailAtext; + } + return emailAtext(code2); + } + function urlInside(code2) { + if (code2 === 62) { + effects.exit("autolinkProtocol"); + return end(code2); + } + if (code2 === null || code2 === 32 || code2 === 60 || asciiControl(code2)) { + return nok(code2); + } + effects.consume(code2); + return urlInside; + } + function emailAtext(code2) { + if (code2 === 64) { + effects.consume(code2); + size = 0; + return emailAtSignOrDot; + } + if (asciiAtext(code2)) { + effects.consume(code2); + return emailAtext; + } + return nok(code2); + } + function emailAtSignOrDot(code2) { + return asciiAlphanumeric(code2) ? emailLabel(code2) : nok(code2); + } + function emailLabel(code2) { + if (code2 === 46) { + effects.consume(code2); + size = 0; + return emailAtSignOrDot; + } + if (code2 === 62) { + effects.exit("autolinkProtocol").type = "autolinkEmail"; + return end(code2); + } + return emailValue(code2); + } + function emailValue(code2) { + if ((code2 === 45 || asciiAlphanumeric(code2)) && size++ < 63) { + effects.consume(code2); + return code2 === 45 ? emailValue : emailLabel; + } + return nok(code2); + } + function end(code2) { + effects.enter("autolinkMarker"); + effects.consume(code2); + effects.exit("autolinkMarker"); + effects.exit("autolink"); + return ok2; + } +} + +// node_modules/micromark-core-commonmark/lib/blank-line.js +var blankLine = { + tokenize: tokenizeBlankLine, + partial: true +}; +function tokenizeBlankLine(effects, ok2, nok) { + return factorySpace(effects, afterWhitespace, "linePrefix"); + function afterWhitespace(code2) { + return code2 === null || markdownLineEnding(code2) ? ok2(code2) : nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/block-quote.js +var blockQuote = { + name: "blockQuote", + tokenize: tokenizeBlockQuoteStart, + continuation: { + tokenize: tokenizeBlockQuoteContinuation + }, + exit +}; +function tokenizeBlockQuoteStart(effects, ok2, nok) { + const self2 = this; + return start3; + function start3(code2) { + if (code2 === 62) { + const state = self2.containerState; + if (!state.open) { + effects.enter("blockQuote", { + _container: true + }); + state.open = true; + } + effects.enter("blockQuotePrefix"); + effects.enter("blockQuoteMarker"); + effects.consume(code2); + effects.exit("blockQuoteMarker"); + return after; + } + return nok(code2); + } + function after(code2) { + if (markdownSpace(code2)) { + effects.enter("blockQuotePrefixWhitespace"); + effects.consume(code2); + effects.exit("blockQuotePrefixWhitespace"); + effects.exit("blockQuotePrefix"); + return ok2; + } + effects.exit("blockQuotePrefix"); + return ok2(code2); + } +} +function tokenizeBlockQuoteContinuation(effects, ok2, nok) { + return factorySpace( + effects, + effects.attempt(blockQuote, ok2, nok), + "linePrefix", + this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + ); +} +function exit(effects) { + effects.exit("blockQuote"); +} + +// node_modules/micromark-core-commonmark/lib/character-escape.js +var characterEscape = { + name: "characterEscape", + tokenize: tokenizeCharacterEscape +}; +function tokenizeCharacterEscape(effects, ok2, nok) { + return start3; + function start3(code2) { + effects.enter("characterEscape"); + effects.enter("escapeMarker"); + effects.consume(code2); + effects.exit("escapeMarker"); + return open; + } + function open(code2) { + if (asciiPunctuation(code2)) { + effects.enter("characterEscapeValue"); + effects.consume(code2); + effects.exit("characterEscapeValue"); + effects.exit("characterEscape"); + return ok2; + } + return nok(code2); + } +} + +// node_modules/character-entities/index.js +var characterEntities = { + AElig: "\xC6", + AMP: "&", + Aacute: "\xC1", + Abreve: "\u0102", + Acirc: "\xC2", + Acy: "\u0410", + Afr: "\u{1D504}", + Agrave: "\xC0", + Alpha: "\u0391", + Amacr: "\u0100", + And: "\u2A53", + Aogon: "\u0104", + Aopf: "\u{1D538}", + ApplyFunction: "\u2061", + Aring: "\xC5", + Ascr: "\u{1D49C}", + Assign: "\u2254", + Atilde: "\xC3", + Auml: "\xC4", + Backslash: "\u2216", + Barv: "\u2AE7", + Barwed: "\u2306", + Bcy: "\u0411", + Because: "\u2235", + Bernoullis: "\u212C", + Beta: "\u0392", + Bfr: "\u{1D505}", + Bopf: "\u{1D539}", + Breve: "\u02D8", + Bscr: "\u212C", + Bumpeq: "\u224E", + CHcy: "\u0427", + COPY: "\xA9", + Cacute: "\u0106", + Cap: "\u22D2", + CapitalDifferentialD: "\u2145", + Cayleys: "\u212D", + Ccaron: "\u010C", + Ccedil: "\xC7", + Ccirc: "\u0108", + Cconint: "\u2230", + Cdot: "\u010A", + Cedilla: "\xB8", + CenterDot: "\xB7", + Cfr: "\u212D", + Chi: "\u03A7", + CircleDot: "\u2299", + CircleMinus: "\u2296", + CirclePlus: "\u2295", + CircleTimes: "\u2297", + ClockwiseContourIntegral: "\u2232", + CloseCurlyDoubleQuote: "\u201D", + CloseCurlyQuote: "\u2019", + Colon: "\u2237", + Colone: "\u2A74", + Congruent: "\u2261", + Conint: "\u222F", + ContourIntegral: "\u222E", + Copf: "\u2102", + Coproduct: "\u2210", + CounterClockwiseContourIntegral: "\u2233", + Cross: "\u2A2F", + Cscr: "\u{1D49E}", + Cup: "\u22D3", + CupCap: "\u224D", + DD: "\u2145", + DDotrahd: "\u2911", + DJcy: "\u0402", + DScy: "\u0405", + DZcy: "\u040F", + Dagger: "\u2021", + Darr: "\u21A1", + Dashv: "\u2AE4", + Dcaron: "\u010E", + Dcy: "\u0414", + Del: "\u2207", + Delta: "\u0394", + Dfr: "\u{1D507}", + DiacriticalAcute: "\xB4", + DiacriticalDot: "\u02D9", + DiacriticalDoubleAcute: "\u02DD", + DiacriticalGrave: "`", + DiacriticalTilde: "\u02DC", + Diamond: "\u22C4", + DifferentialD: "\u2146", + Dopf: "\u{1D53B}", + Dot: "\xA8", + DotDot: "\u20DC", + DotEqual: "\u2250", + DoubleContourIntegral: "\u222F", + DoubleDot: "\xA8", + DoubleDownArrow: "\u21D3", + DoubleLeftArrow: "\u21D0", + DoubleLeftRightArrow: "\u21D4", + DoubleLeftTee: "\u2AE4", + DoubleLongLeftArrow: "\u27F8", + DoubleLongLeftRightArrow: "\u27FA", + DoubleLongRightArrow: "\u27F9", + DoubleRightArrow: "\u21D2", + DoubleRightTee: "\u22A8", + DoubleUpArrow: "\u21D1", + DoubleUpDownArrow: "\u21D5", + DoubleVerticalBar: "\u2225", + DownArrow: "\u2193", + DownArrowBar: "\u2913", + DownArrowUpArrow: "\u21F5", + DownBreve: "\u0311", + DownLeftRightVector: "\u2950", + DownLeftTeeVector: "\u295E", + DownLeftVector: "\u21BD", + DownLeftVectorBar: "\u2956", + DownRightTeeVector: "\u295F", + DownRightVector: "\u21C1", + DownRightVectorBar: "\u2957", + DownTee: "\u22A4", + DownTeeArrow: "\u21A7", + Downarrow: "\u21D3", + Dscr: "\u{1D49F}", + Dstrok: "\u0110", + ENG: "\u014A", + ETH: "\xD0", + Eacute: "\xC9", + Ecaron: "\u011A", + Ecirc: "\xCA", + Ecy: "\u042D", + Edot: "\u0116", + Efr: "\u{1D508}", + Egrave: "\xC8", + Element: "\u2208", + Emacr: "\u0112", + EmptySmallSquare: "\u25FB", + EmptyVerySmallSquare: "\u25AB", + Eogon: "\u0118", + Eopf: "\u{1D53C}", + Epsilon: "\u0395", + Equal: "\u2A75", + EqualTilde: "\u2242", + Equilibrium: "\u21CC", + Escr: "\u2130", + Esim: "\u2A73", + Eta: "\u0397", + Euml: "\xCB", + Exists: "\u2203", + ExponentialE: "\u2147", + Fcy: "\u0424", + Ffr: "\u{1D509}", + FilledSmallSquare: "\u25FC", + FilledVerySmallSquare: "\u25AA", + Fopf: "\u{1D53D}", + ForAll: "\u2200", + Fouriertrf: "\u2131", + Fscr: "\u2131", + GJcy: "\u0403", + GT: ">", + Gamma: "\u0393", + Gammad: "\u03DC", + Gbreve: "\u011E", + Gcedil: "\u0122", + Gcirc: "\u011C", + Gcy: "\u0413", + Gdot: "\u0120", + Gfr: "\u{1D50A}", + Gg: "\u22D9", + Gopf: "\u{1D53E}", + GreaterEqual: "\u2265", + GreaterEqualLess: "\u22DB", + GreaterFullEqual: "\u2267", + GreaterGreater: "\u2AA2", + GreaterLess: "\u2277", + GreaterSlantEqual: "\u2A7E", + GreaterTilde: "\u2273", + Gscr: "\u{1D4A2}", + Gt: "\u226B", + HARDcy: "\u042A", + Hacek: "\u02C7", + Hat: "^", + Hcirc: "\u0124", + Hfr: "\u210C", + HilbertSpace: "\u210B", + Hopf: "\u210D", + HorizontalLine: "\u2500", + Hscr: "\u210B", + Hstrok: "\u0126", + HumpDownHump: "\u224E", + HumpEqual: "\u224F", + IEcy: "\u0415", + IJlig: "\u0132", + IOcy: "\u0401", + Iacute: "\xCD", + Icirc: "\xCE", + Icy: "\u0418", + Idot: "\u0130", + Ifr: "\u2111", + Igrave: "\xCC", + Im: "\u2111", + Imacr: "\u012A", + ImaginaryI: "\u2148", + Implies: "\u21D2", + Int: "\u222C", + Integral: "\u222B", + Intersection: "\u22C2", + InvisibleComma: "\u2063", + InvisibleTimes: "\u2062", + Iogon: "\u012E", + Iopf: "\u{1D540}", + Iota: "\u0399", + Iscr: "\u2110", + Itilde: "\u0128", + Iukcy: "\u0406", + Iuml: "\xCF", + Jcirc: "\u0134", + Jcy: "\u0419", + Jfr: "\u{1D50D}", + Jopf: "\u{1D541}", + Jscr: "\u{1D4A5}", + Jsercy: "\u0408", + Jukcy: "\u0404", + KHcy: "\u0425", + KJcy: "\u040C", + Kappa: "\u039A", + Kcedil: "\u0136", + Kcy: "\u041A", + Kfr: "\u{1D50E}", + Kopf: "\u{1D542}", + Kscr: "\u{1D4A6}", + LJcy: "\u0409", + LT: "<", + Lacute: "\u0139", + Lambda: "\u039B", + Lang: "\u27EA", + Laplacetrf: "\u2112", + Larr: "\u219E", + Lcaron: "\u013D", + Lcedil: "\u013B", + Lcy: "\u041B", + LeftAngleBracket: "\u27E8", + LeftArrow: "\u2190", + LeftArrowBar: "\u21E4", + LeftArrowRightArrow: "\u21C6", + LeftCeiling: "\u2308", + LeftDoubleBracket: "\u27E6", + LeftDownTeeVector: "\u2961", + LeftDownVector: "\u21C3", + LeftDownVectorBar: "\u2959", + LeftFloor: "\u230A", + LeftRightArrow: "\u2194", + LeftRightVector: "\u294E", + LeftTee: "\u22A3", + LeftTeeArrow: "\u21A4", + LeftTeeVector: "\u295A", + LeftTriangle: "\u22B2", + LeftTriangleBar: "\u29CF", + LeftTriangleEqual: "\u22B4", + LeftUpDownVector: "\u2951", + LeftUpTeeVector: "\u2960", + LeftUpVector: "\u21BF", + LeftUpVectorBar: "\u2958", + LeftVector: "\u21BC", + LeftVectorBar: "\u2952", + Leftarrow: "\u21D0", + Leftrightarrow: "\u21D4", + LessEqualGreater: "\u22DA", + LessFullEqual: "\u2266", + LessGreater: "\u2276", + LessLess: "\u2AA1", + LessSlantEqual: "\u2A7D", + LessTilde: "\u2272", + Lfr: "\u{1D50F}", + Ll: "\u22D8", + Lleftarrow: "\u21DA", + Lmidot: "\u013F", + LongLeftArrow: "\u27F5", + LongLeftRightArrow: "\u27F7", + LongRightArrow: "\u27F6", + Longleftarrow: "\u27F8", + Longleftrightarrow: "\u27FA", + Longrightarrow: "\u27F9", + Lopf: "\u{1D543}", + LowerLeftArrow: "\u2199", + LowerRightArrow: "\u2198", + Lscr: "\u2112", + Lsh: "\u21B0", + Lstrok: "\u0141", + Lt: "\u226A", + Map: "\u2905", + Mcy: "\u041C", + MediumSpace: "\u205F", + Mellintrf: "\u2133", + Mfr: "\u{1D510}", + MinusPlus: "\u2213", + Mopf: "\u{1D544}", + Mscr: "\u2133", + Mu: "\u039C", + NJcy: "\u040A", + Nacute: "\u0143", + Ncaron: "\u0147", + Ncedil: "\u0145", + Ncy: "\u041D", + NegativeMediumSpace: "\u200B", + NegativeThickSpace: "\u200B", + NegativeThinSpace: "\u200B", + NegativeVeryThinSpace: "\u200B", + NestedGreaterGreater: "\u226B", + NestedLessLess: "\u226A", + NewLine: "\n", + Nfr: "\u{1D511}", + NoBreak: "\u2060", + NonBreakingSpace: "\xA0", + Nopf: "\u2115", + Not: "\u2AEC", + NotCongruent: "\u2262", + NotCupCap: "\u226D", + NotDoubleVerticalBar: "\u2226", + NotElement: "\u2209", + NotEqual: "\u2260", + NotEqualTilde: "\u2242\u0338", + NotExists: "\u2204", + NotGreater: "\u226F", + NotGreaterEqual: "\u2271", + NotGreaterFullEqual: "\u2267\u0338", + NotGreaterGreater: "\u226B\u0338", + NotGreaterLess: "\u2279", + NotGreaterSlantEqual: "\u2A7E\u0338", + NotGreaterTilde: "\u2275", + NotHumpDownHump: "\u224E\u0338", + NotHumpEqual: "\u224F\u0338", + NotLeftTriangle: "\u22EA", + NotLeftTriangleBar: "\u29CF\u0338", + NotLeftTriangleEqual: "\u22EC", + NotLess: "\u226E", + NotLessEqual: "\u2270", + NotLessGreater: "\u2278", + NotLessLess: "\u226A\u0338", + NotLessSlantEqual: "\u2A7D\u0338", + NotLessTilde: "\u2274", + NotNestedGreaterGreater: "\u2AA2\u0338", + NotNestedLessLess: "\u2AA1\u0338", + NotPrecedes: "\u2280", + NotPrecedesEqual: "\u2AAF\u0338", + NotPrecedesSlantEqual: "\u22E0", + NotReverseElement: "\u220C", + NotRightTriangle: "\u22EB", + NotRightTriangleBar: "\u29D0\u0338", + NotRightTriangleEqual: "\u22ED", + NotSquareSubset: "\u228F\u0338", + NotSquareSubsetEqual: "\u22E2", + NotSquareSuperset: "\u2290\u0338", + NotSquareSupersetEqual: "\u22E3", + NotSubset: "\u2282\u20D2", + NotSubsetEqual: "\u2288", + NotSucceeds: "\u2281", + NotSucceedsEqual: "\u2AB0\u0338", + NotSucceedsSlantEqual: "\u22E1", + NotSucceedsTilde: "\u227F\u0338", + NotSuperset: "\u2283\u20D2", + NotSupersetEqual: "\u2289", + NotTilde: "\u2241", + NotTildeEqual: "\u2244", + NotTildeFullEqual: "\u2247", + NotTildeTilde: "\u2249", + NotVerticalBar: "\u2224", + Nscr: "\u{1D4A9}", + Ntilde: "\xD1", + Nu: "\u039D", + OElig: "\u0152", + Oacute: "\xD3", + Ocirc: "\xD4", + Ocy: "\u041E", + Odblac: "\u0150", + Ofr: "\u{1D512}", + Ograve: "\xD2", + Omacr: "\u014C", + Omega: "\u03A9", + Omicron: "\u039F", + Oopf: "\u{1D546}", + OpenCurlyDoubleQuote: "\u201C", + OpenCurlyQuote: "\u2018", + Or: "\u2A54", + Oscr: "\u{1D4AA}", + Oslash: "\xD8", + Otilde: "\xD5", + Otimes: "\u2A37", + Ouml: "\xD6", + OverBar: "\u203E", + OverBrace: "\u23DE", + OverBracket: "\u23B4", + OverParenthesis: "\u23DC", + PartialD: "\u2202", + Pcy: "\u041F", + Pfr: "\u{1D513}", + Phi: "\u03A6", + Pi: "\u03A0", + PlusMinus: "\xB1", + Poincareplane: "\u210C", + Popf: "\u2119", + Pr: "\u2ABB", + Precedes: "\u227A", + PrecedesEqual: "\u2AAF", + PrecedesSlantEqual: "\u227C", + PrecedesTilde: "\u227E", + Prime: "\u2033", + Product: "\u220F", + Proportion: "\u2237", + Proportional: "\u221D", + Pscr: "\u{1D4AB}", + Psi: "\u03A8", + QUOT: '"', + Qfr: "\u{1D514}", + Qopf: "\u211A", + Qscr: "\u{1D4AC}", + RBarr: "\u2910", + REG: "\xAE", + Racute: "\u0154", + Rang: "\u27EB", + Rarr: "\u21A0", + Rarrtl: "\u2916", + Rcaron: "\u0158", + Rcedil: "\u0156", + Rcy: "\u0420", + Re: "\u211C", + ReverseElement: "\u220B", + ReverseEquilibrium: "\u21CB", + ReverseUpEquilibrium: "\u296F", + Rfr: "\u211C", + Rho: "\u03A1", + RightAngleBracket: "\u27E9", + RightArrow: "\u2192", + RightArrowBar: "\u21E5", + RightArrowLeftArrow: "\u21C4", + RightCeiling: "\u2309", + RightDoubleBracket: "\u27E7", + RightDownTeeVector: "\u295D", + RightDownVector: "\u21C2", + RightDownVectorBar: "\u2955", + RightFloor: "\u230B", + RightTee: "\u22A2", + RightTeeArrow: "\u21A6", + RightTeeVector: "\u295B", + RightTriangle: "\u22B3", + RightTriangleBar: "\u29D0", + RightTriangleEqual: "\u22B5", + RightUpDownVector: "\u294F", + RightUpTeeVector: "\u295C", + RightUpVector: "\u21BE", + RightUpVectorBar: "\u2954", + RightVector: "\u21C0", + RightVectorBar: "\u2953", + Rightarrow: "\u21D2", + Ropf: "\u211D", + RoundImplies: "\u2970", + Rrightarrow: "\u21DB", + Rscr: "\u211B", + Rsh: "\u21B1", + RuleDelayed: "\u29F4", + SHCHcy: "\u0429", + SHcy: "\u0428", + SOFTcy: "\u042C", + Sacute: "\u015A", + Sc: "\u2ABC", + Scaron: "\u0160", + Scedil: "\u015E", + Scirc: "\u015C", + Scy: "\u0421", + Sfr: "\u{1D516}", + ShortDownArrow: "\u2193", + ShortLeftArrow: "\u2190", + ShortRightArrow: "\u2192", + ShortUpArrow: "\u2191", + Sigma: "\u03A3", + SmallCircle: "\u2218", + Sopf: "\u{1D54A}", + Sqrt: "\u221A", + Square: "\u25A1", + SquareIntersection: "\u2293", + SquareSubset: "\u228F", + SquareSubsetEqual: "\u2291", + SquareSuperset: "\u2290", + SquareSupersetEqual: "\u2292", + SquareUnion: "\u2294", + Sscr: "\u{1D4AE}", + Star: "\u22C6", + Sub: "\u22D0", + Subset: "\u22D0", + SubsetEqual: "\u2286", + Succeeds: "\u227B", + SucceedsEqual: "\u2AB0", + SucceedsSlantEqual: "\u227D", + SucceedsTilde: "\u227F", + SuchThat: "\u220B", + Sum: "\u2211", + Sup: "\u22D1", + Superset: "\u2283", + SupersetEqual: "\u2287", + Supset: "\u22D1", + THORN: "\xDE", + TRADE: "\u2122", + TSHcy: "\u040B", + TScy: "\u0426", + Tab: " ", + Tau: "\u03A4", + Tcaron: "\u0164", + Tcedil: "\u0162", + Tcy: "\u0422", + Tfr: "\u{1D517}", + Therefore: "\u2234", + Theta: "\u0398", + ThickSpace: "\u205F\u200A", + ThinSpace: "\u2009", + Tilde: "\u223C", + TildeEqual: "\u2243", + TildeFullEqual: "\u2245", + TildeTilde: "\u2248", + Topf: "\u{1D54B}", + TripleDot: "\u20DB", + Tscr: "\u{1D4AF}", + Tstrok: "\u0166", + Uacute: "\xDA", + Uarr: "\u219F", + Uarrocir: "\u2949", + Ubrcy: "\u040E", + Ubreve: "\u016C", + Ucirc: "\xDB", + Ucy: "\u0423", + Udblac: "\u0170", + Ufr: "\u{1D518}", + Ugrave: "\xD9", + Umacr: "\u016A", + UnderBar: "_", + UnderBrace: "\u23DF", + UnderBracket: "\u23B5", + UnderParenthesis: "\u23DD", + Union: "\u22C3", + UnionPlus: "\u228E", + Uogon: "\u0172", + Uopf: "\u{1D54C}", + UpArrow: "\u2191", + UpArrowBar: "\u2912", + UpArrowDownArrow: "\u21C5", + UpDownArrow: "\u2195", + UpEquilibrium: "\u296E", + UpTee: "\u22A5", + UpTeeArrow: "\u21A5", + Uparrow: "\u21D1", + Updownarrow: "\u21D5", + UpperLeftArrow: "\u2196", + UpperRightArrow: "\u2197", + Upsi: "\u03D2", + Upsilon: "\u03A5", + Uring: "\u016E", + Uscr: "\u{1D4B0}", + Utilde: "\u0168", + Uuml: "\xDC", + VDash: "\u22AB", + Vbar: "\u2AEB", + Vcy: "\u0412", + Vdash: "\u22A9", + Vdashl: "\u2AE6", + Vee: "\u22C1", + Verbar: "\u2016", + Vert: "\u2016", + VerticalBar: "\u2223", + VerticalLine: "|", + VerticalSeparator: "\u2758", + VerticalTilde: "\u2240", + VeryThinSpace: "\u200A", + Vfr: "\u{1D519}", + Vopf: "\u{1D54D}", + Vscr: "\u{1D4B1}", + Vvdash: "\u22AA", + Wcirc: "\u0174", + Wedge: "\u22C0", + Wfr: "\u{1D51A}", + Wopf: "\u{1D54E}", + Wscr: "\u{1D4B2}", + Xfr: "\u{1D51B}", + Xi: "\u039E", + Xopf: "\u{1D54F}", + Xscr: "\u{1D4B3}", + YAcy: "\u042F", + YIcy: "\u0407", + YUcy: "\u042E", + Yacute: "\xDD", + Ycirc: "\u0176", + Ycy: "\u042B", + Yfr: "\u{1D51C}", + Yopf: "\u{1D550}", + Yscr: "\u{1D4B4}", + Yuml: "\u0178", + ZHcy: "\u0416", + Zacute: "\u0179", + Zcaron: "\u017D", + Zcy: "\u0417", + Zdot: "\u017B", + ZeroWidthSpace: "\u200B", + Zeta: "\u0396", + Zfr: "\u2128", + Zopf: "\u2124", + Zscr: "\u{1D4B5}", + aacute: "\xE1", + abreve: "\u0103", + ac: "\u223E", + acE: "\u223E\u0333", + acd: "\u223F", + acirc: "\xE2", + acute: "\xB4", + acy: "\u0430", + aelig: "\xE6", + af: "\u2061", + afr: "\u{1D51E}", + agrave: "\xE0", + alefsym: "\u2135", + aleph: "\u2135", + alpha: "\u03B1", + amacr: "\u0101", + amalg: "\u2A3F", + amp: "&", + and: "\u2227", + andand: "\u2A55", + andd: "\u2A5C", + andslope: "\u2A58", + andv: "\u2A5A", + ang: "\u2220", + ange: "\u29A4", + angle: "\u2220", + angmsd: "\u2221", + angmsdaa: "\u29A8", + angmsdab: "\u29A9", + angmsdac: "\u29AA", + angmsdad: "\u29AB", + angmsdae: "\u29AC", + angmsdaf: "\u29AD", + angmsdag: "\u29AE", + angmsdah: "\u29AF", + angrt: "\u221F", + angrtvb: "\u22BE", + angrtvbd: "\u299D", + angsph: "\u2222", + angst: "\xC5", + angzarr: "\u237C", + aogon: "\u0105", + aopf: "\u{1D552}", + ap: "\u2248", + apE: "\u2A70", + apacir: "\u2A6F", + ape: "\u224A", + apid: "\u224B", + apos: "'", + approx: "\u2248", + approxeq: "\u224A", + aring: "\xE5", + ascr: "\u{1D4B6}", + ast: "*", + asymp: "\u2248", + asympeq: "\u224D", + atilde: "\xE3", + auml: "\xE4", + awconint: "\u2233", + awint: "\u2A11", + bNot: "\u2AED", + backcong: "\u224C", + backepsilon: "\u03F6", + backprime: "\u2035", + backsim: "\u223D", + backsimeq: "\u22CD", + barvee: "\u22BD", + barwed: "\u2305", + barwedge: "\u2305", + bbrk: "\u23B5", + bbrktbrk: "\u23B6", + bcong: "\u224C", + bcy: "\u0431", + bdquo: "\u201E", + becaus: "\u2235", + because: "\u2235", + bemptyv: "\u29B0", + bepsi: "\u03F6", + bernou: "\u212C", + beta: "\u03B2", + beth: "\u2136", + between: "\u226C", + bfr: "\u{1D51F}", + bigcap: "\u22C2", + bigcirc: "\u25EF", + bigcup: "\u22C3", + bigodot: "\u2A00", + bigoplus: "\u2A01", + bigotimes: "\u2A02", + bigsqcup: "\u2A06", + bigstar: "\u2605", + bigtriangledown: "\u25BD", + bigtriangleup: "\u25B3", + biguplus: "\u2A04", + bigvee: "\u22C1", + bigwedge: "\u22C0", + bkarow: "\u290D", + blacklozenge: "\u29EB", + blacksquare: "\u25AA", + blacktriangle: "\u25B4", + blacktriangledown: "\u25BE", + blacktriangleleft: "\u25C2", + blacktriangleright: "\u25B8", + blank: "\u2423", + blk12: "\u2592", + blk14: "\u2591", + blk34: "\u2593", + block: "\u2588", + bne: "=\u20E5", + bnequiv: "\u2261\u20E5", + bnot: "\u2310", + bopf: "\u{1D553}", + bot: "\u22A5", + bottom: "\u22A5", + bowtie: "\u22C8", + boxDL: "\u2557", + boxDR: "\u2554", + boxDl: "\u2556", + boxDr: "\u2553", + boxH: "\u2550", + boxHD: "\u2566", + boxHU: "\u2569", + boxHd: "\u2564", + boxHu: "\u2567", + boxUL: "\u255D", + boxUR: "\u255A", + boxUl: "\u255C", + boxUr: "\u2559", + boxV: "\u2551", + boxVH: "\u256C", + boxVL: "\u2563", + boxVR: "\u2560", + boxVh: "\u256B", + boxVl: "\u2562", + boxVr: "\u255F", + boxbox: "\u29C9", + boxdL: "\u2555", + boxdR: "\u2552", + boxdl: "\u2510", + boxdr: "\u250C", + boxh: "\u2500", + boxhD: "\u2565", + boxhU: "\u2568", + boxhd: "\u252C", + boxhu: "\u2534", + boxminus: "\u229F", + boxplus: "\u229E", + boxtimes: "\u22A0", + boxuL: "\u255B", + boxuR: "\u2558", + boxul: "\u2518", + boxur: "\u2514", + boxv: "\u2502", + boxvH: "\u256A", + boxvL: "\u2561", + boxvR: "\u255E", + boxvh: "\u253C", + boxvl: "\u2524", + boxvr: "\u251C", + bprime: "\u2035", + breve: "\u02D8", + brvbar: "\xA6", + bscr: "\u{1D4B7}", + bsemi: "\u204F", + bsim: "\u223D", + bsime: "\u22CD", + bsol: "\\", + bsolb: "\u29C5", + bsolhsub: "\u27C8", + bull: "\u2022", + bullet: "\u2022", + bump: "\u224E", + bumpE: "\u2AAE", + bumpe: "\u224F", + bumpeq: "\u224F", + cacute: "\u0107", + cap: "\u2229", + capand: "\u2A44", + capbrcup: "\u2A49", + capcap: "\u2A4B", + capcup: "\u2A47", + capdot: "\u2A40", + caps: "\u2229\uFE00", + caret: "\u2041", + caron: "\u02C7", + ccaps: "\u2A4D", + ccaron: "\u010D", + ccedil: "\xE7", + ccirc: "\u0109", + ccups: "\u2A4C", + ccupssm: "\u2A50", + cdot: "\u010B", + cedil: "\xB8", + cemptyv: "\u29B2", + cent: "\xA2", + centerdot: "\xB7", + cfr: "\u{1D520}", + chcy: "\u0447", + check: "\u2713", + checkmark: "\u2713", + chi: "\u03C7", + cir: "\u25CB", + cirE: "\u29C3", + circ: "\u02C6", + circeq: "\u2257", + circlearrowleft: "\u21BA", + circlearrowright: "\u21BB", + circledR: "\xAE", + circledS: "\u24C8", + circledast: "\u229B", + circledcirc: "\u229A", + circleddash: "\u229D", + cire: "\u2257", + cirfnint: "\u2A10", + cirmid: "\u2AEF", + cirscir: "\u29C2", + clubs: "\u2663", + clubsuit: "\u2663", + colon: ":", + colone: "\u2254", + coloneq: "\u2254", + comma: ",", + commat: "@", + comp: "\u2201", + compfn: "\u2218", + complement: "\u2201", + complexes: "\u2102", + cong: "\u2245", + congdot: "\u2A6D", + conint: "\u222E", + copf: "\u{1D554}", + coprod: "\u2210", + copy: "\xA9", + copysr: "\u2117", + crarr: "\u21B5", + cross: "\u2717", + cscr: "\u{1D4B8}", + csub: "\u2ACF", + csube: "\u2AD1", + csup: "\u2AD0", + csupe: "\u2AD2", + ctdot: "\u22EF", + cudarrl: "\u2938", + cudarrr: "\u2935", + cuepr: "\u22DE", + cuesc: "\u22DF", + cularr: "\u21B6", + cularrp: "\u293D", + cup: "\u222A", + cupbrcap: "\u2A48", + cupcap: "\u2A46", + cupcup: "\u2A4A", + cupdot: "\u228D", + cupor: "\u2A45", + cups: "\u222A\uFE00", + curarr: "\u21B7", + curarrm: "\u293C", + curlyeqprec: "\u22DE", + curlyeqsucc: "\u22DF", + curlyvee: "\u22CE", + curlywedge: "\u22CF", + curren: "\xA4", + curvearrowleft: "\u21B6", + curvearrowright: "\u21B7", + cuvee: "\u22CE", + cuwed: "\u22CF", + cwconint: "\u2232", + cwint: "\u2231", + cylcty: "\u232D", + dArr: "\u21D3", + dHar: "\u2965", + dagger: "\u2020", + daleth: "\u2138", + darr: "\u2193", + dash: "\u2010", + dashv: "\u22A3", + dbkarow: "\u290F", + dblac: "\u02DD", + dcaron: "\u010F", + dcy: "\u0434", + dd: "\u2146", + ddagger: "\u2021", + ddarr: "\u21CA", + ddotseq: "\u2A77", + deg: "\xB0", + delta: "\u03B4", + demptyv: "\u29B1", + dfisht: "\u297F", + dfr: "\u{1D521}", + dharl: "\u21C3", + dharr: "\u21C2", + diam: "\u22C4", + diamond: "\u22C4", + diamondsuit: "\u2666", + diams: "\u2666", + die: "\xA8", + digamma: "\u03DD", + disin: "\u22F2", + div: "\xF7", + divide: "\xF7", + divideontimes: "\u22C7", + divonx: "\u22C7", + djcy: "\u0452", + dlcorn: "\u231E", + dlcrop: "\u230D", + dollar: "$", + dopf: "\u{1D555}", + dot: "\u02D9", + doteq: "\u2250", + doteqdot: "\u2251", + dotminus: "\u2238", + dotplus: "\u2214", + dotsquare: "\u22A1", + doublebarwedge: "\u2306", + downarrow: "\u2193", + downdownarrows: "\u21CA", + downharpoonleft: "\u21C3", + downharpoonright: "\u21C2", + drbkarow: "\u2910", + drcorn: "\u231F", + drcrop: "\u230C", + dscr: "\u{1D4B9}", + dscy: "\u0455", + dsol: "\u29F6", + dstrok: "\u0111", + dtdot: "\u22F1", + dtri: "\u25BF", + dtrif: "\u25BE", + duarr: "\u21F5", + duhar: "\u296F", + dwangle: "\u29A6", + dzcy: "\u045F", + dzigrarr: "\u27FF", + eDDot: "\u2A77", + eDot: "\u2251", + eacute: "\xE9", + easter: "\u2A6E", + ecaron: "\u011B", + ecir: "\u2256", + ecirc: "\xEA", + ecolon: "\u2255", + ecy: "\u044D", + edot: "\u0117", + ee: "\u2147", + efDot: "\u2252", + efr: "\u{1D522}", + eg: "\u2A9A", + egrave: "\xE8", + egs: "\u2A96", + egsdot: "\u2A98", + el: "\u2A99", + elinters: "\u23E7", + ell: "\u2113", + els: "\u2A95", + elsdot: "\u2A97", + emacr: "\u0113", + empty: "\u2205", + emptyset: "\u2205", + emptyv: "\u2205", + emsp13: "\u2004", + emsp14: "\u2005", + emsp: "\u2003", + eng: "\u014B", + ensp: "\u2002", + eogon: "\u0119", + eopf: "\u{1D556}", + epar: "\u22D5", + eparsl: "\u29E3", + eplus: "\u2A71", + epsi: "\u03B5", + epsilon: "\u03B5", + epsiv: "\u03F5", + eqcirc: "\u2256", + eqcolon: "\u2255", + eqsim: "\u2242", + eqslantgtr: "\u2A96", + eqslantless: "\u2A95", + equals: "=", + equest: "\u225F", + equiv: "\u2261", + equivDD: "\u2A78", + eqvparsl: "\u29E5", + erDot: "\u2253", + erarr: "\u2971", + escr: "\u212F", + esdot: "\u2250", + esim: "\u2242", + eta: "\u03B7", + eth: "\xF0", + euml: "\xEB", + euro: "\u20AC", + excl: "!", + exist: "\u2203", + expectation: "\u2130", + exponentiale: "\u2147", + fallingdotseq: "\u2252", + fcy: "\u0444", + female: "\u2640", + ffilig: "\uFB03", + fflig: "\uFB00", + ffllig: "\uFB04", + ffr: "\u{1D523}", + filig: "\uFB01", + fjlig: "fj", + flat: "\u266D", + fllig: "\uFB02", + fltns: "\u25B1", + fnof: "\u0192", + fopf: "\u{1D557}", + forall: "\u2200", + fork: "\u22D4", + forkv: "\u2AD9", + fpartint: "\u2A0D", + frac12: "\xBD", + frac13: "\u2153", + frac14: "\xBC", + frac15: "\u2155", + frac16: "\u2159", + frac18: "\u215B", + frac23: "\u2154", + frac25: "\u2156", + frac34: "\xBE", + frac35: "\u2157", + frac38: "\u215C", + frac45: "\u2158", + frac56: "\u215A", + frac58: "\u215D", + frac78: "\u215E", + frasl: "\u2044", + frown: "\u2322", + fscr: "\u{1D4BB}", + gE: "\u2267", + gEl: "\u2A8C", + gacute: "\u01F5", + gamma: "\u03B3", + gammad: "\u03DD", + gap: "\u2A86", + gbreve: "\u011F", + gcirc: "\u011D", + gcy: "\u0433", + gdot: "\u0121", + ge: "\u2265", + gel: "\u22DB", + geq: "\u2265", + geqq: "\u2267", + geqslant: "\u2A7E", + ges: "\u2A7E", + gescc: "\u2AA9", + gesdot: "\u2A80", + gesdoto: "\u2A82", + gesdotol: "\u2A84", + gesl: "\u22DB\uFE00", + gesles: "\u2A94", + gfr: "\u{1D524}", + gg: "\u226B", + ggg: "\u22D9", + gimel: "\u2137", + gjcy: "\u0453", + gl: "\u2277", + glE: "\u2A92", + gla: "\u2AA5", + glj: "\u2AA4", + gnE: "\u2269", + gnap: "\u2A8A", + gnapprox: "\u2A8A", + gne: "\u2A88", + gneq: "\u2A88", + gneqq: "\u2269", + gnsim: "\u22E7", + gopf: "\u{1D558}", + grave: "`", + gscr: "\u210A", + gsim: "\u2273", + gsime: "\u2A8E", + gsiml: "\u2A90", + gt: ">", + gtcc: "\u2AA7", + gtcir: "\u2A7A", + gtdot: "\u22D7", + gtlPar: "\u2995", + gtquest: "\u2A7C", + gtrapprox: "\u2A86", + gtrarr: "\u2978", + gtrdot: "\u22D7", + gtreqless: "\u22DB", + gtreqqless: "\u2A8C", + gtrless: "\u2277", + gtrsim: "\u2273", + gvertneqq: "\u2269\uFE00", + gvnE: "\u2269\uFE00", + hArr: "\u21D4", + hairsp: "\u200A", + half: "\xBD", + hamilt: "\u210B", + hardcy: "\u044A", + harr: "\u2194", + harrcir: "\u2948", + harrw: "\u21AD", + hbar: "\u210F", + hcirc: "\u0125", + hearts: "\u2665", + heartsuit: "\u2665", + hellip: "\u2026", + hercon: "\u22B9", + hfr: "\u{1D525}", + hksearow: "\u2925", + hkswarow: "\u2926", + hoarr: "\u21FF", + homtht: "\u223B", + hookleftarrow: "\u21A9", + hookrightarrow: "\u21AA", + hopf: "\u{1D559}", + horbar: "\u2015", + hscr: "\u{1D4BD}", + hslash: "\u210F", + hstrok: "\u0127", + hybull: "\u2043", + hyphen: "\u2010", + iacute: "\xED", + ic: "\u2063", + icirc: "\xEE", + icy: "\u0438", + iecy: "\u0435", + iexcl: "\xA1", + iff: "\u21D4", + ifr: "\u{1D526}", + igrave: "\xEC", + ii: "\u2148", + iiiint: "\u2A0C", + iiint: "\u222D", + iinfin: "\u29DC", + iiota: "\u2129", + ijlig: "\u0133", + imacr: "\u012B", + image: "\u2111", + imagline: "\u2110", + imagpart: "\u2111", + imath: "\u0131", + imof: "\u22B7", + imped: "\u01B5", + in: "\u2208", + incare: "\u2105", + infin: "\u221E", + infintie: "\u29DD", + inodot: "\u0131", + int: "\u222B", + intcal: "\u22BA", + integers: "\u2124", + intercal: "\u22BA", + intlarhk: "\u2A17", + intprod: "\u2A3C", + iocy: "\u0451", + iogon: "\u012F", + iopf: "\u{1D55A}", + iota: "\u03B9", + iprod: "\u2A3C", + iquest: "\xBF", + iscr: "\u{1D4BE}", + isin: "\u2208", + isinE: "\u22F9", + isindot: "\u22F5", + isins: "\u22F4", + isinsv: "\u22F3", + isinv: "\u2208", + it: "\u2062", + itilde: "\u0129", + iukcy: "\u0456", + iuml: "\xEF", + jcirc: "\u0135", + jcy: "\u0439", + jfr: "\u{1D527}", + jmath: "\u0237", + jopf: "\u{1D55B}", + jscr: "\u{1D4BF}", + jsercy: "\u0458", + jukcy: "\u0454", + kappa: "\u03BA", + kappav: "\u03F0", + kcedil: "\u0137", + kcy: "\u043A", + kfr: "\u{1D528}", + kgreen: "\u0138", + khcy: "\u0445", + kjcy: "\u045C", + kopf: "\u{1D55C}", + kscr: "\u{1D4C0}", + lAarr: "\u21DA", + lArr: "\u21D0", + lAtail: "\u291B", + lBarr: "\u290E", + lE: "\u2266", + lEg: "\u2A8B", + lHar: "\u2962", + lacute: "\u013A", + laemptyv: "\u29B4", + lagran: "\u2112", + lambda: "\u03BB", + lang: "\u27E8", + langd: "\u2991", + langle: "\u27E8", + lap: "\u2A85", + laquo: "\xAB", + larr: "\u2190", + larrb: "\u21E4", + larrbfs: "\u291F", + larrfs: "\u291D", + larrhk: "\u21A9", + larrlp: "\u21AB", + larrpl: "\u2939", + larrsim: "\u2973", + larrtl: "\u21A2", + lat: "\u2AAB", + latail: "\u2919", + late: "\u2AAD", + lates: "\u2AAD\uFE00", + lbarr: "\u290C", + lbbrk: "\u2772", + lbrace: "{", + lbrack: "[", + lbrke: "\u298B", + lbrksld: "\u298F", + lbrkslu: "\u298D", + lcaron: "\u013E", + lcedil: "\u013C", + lceil: "\u2308", + lcub: "{", + lcy: "\u043B", + ldca: "\u2936", + ldquo: "\u201C", + ldquor: "\u201E", + ldrdhar: "\u2967", + ldrushar: "\u294B", + ldsh: "\u21B2", + le: "\u2264", + leftarrow: "\u2190", + leftarrowtail: "\u21A2", + leftharpoondown: "\u21BD", + leftharpoonup: "\u21BC", + leftleftarrows: "\u21C7", + leftrightarrow: "\u2194", + leftrightarrows: "\u21C6", + leftrightharpoons: "\u21CB", + leftrightsquigarrow: "\u21AD", + leftthreetimes: "\u22CB", + leg: "\u22DA", + leq: "\u2264", + leqq: "\u2266", + leqslant: "\u2A7D", + les: "\u2A7D", + lescc: "\u2AA8", + lesdot: "\u2A7F", + lesdoto: "\u2A81", + lesdotor: "\u2A83", + lesg: "\u22DA\uFE00", + lesges: "\u2A93", + lessapprox: "\u2A85", + lessdot: "\u22D6", + lesseqgtr: "\u22DA", + lesseqqgtr: "\u2A8B", + lessgtr: "\u2276", + lesssim: "\u2272", + lfisht: "\u297C", + lfloor: "\u230A", + lfr: "\u{1D529}", + lg: "\u2276", + lgE: "\u2A91", + lhard: "\u21BD", + lharu: "\u21BC", + lharul: "\u296A", + lhblk: "\u2584", + ljcy: "\u0459", + ll: "\u226A", + llarr: "\u21C7", + llcorner: "\u231E", + llhard: "\u296B", + lltri: "\u25FA", + lmidot: "\u0140", + lmoust: "\u23B0", + lmoustache: "\u23B0", + lnE: "\u2268", + lnap: "\u2A89", + lnapprox: "\u2A89", + lne: "\u2A87", + lneq: "\u2A87", + lneqq: "\u2268", + lnsim: "\u22E6", + loang: "\u27EC", + loarr: "\u21FD", + lobrk: "\u27E6", + longleftarrow: "\u27F5", + longleftrightarrow: "\u27F7", + longmapsto: "\u27FC", + longrightarrow: "\u27F6", + looparrowleft: "\u21AB", + looparrowright: "\u21AC", + lopar: "\u2985", + lopf: "\u{1D55D}", + loplus: "\u2A2D", + lotimes: "\u2A34", + lowast: "\u2217", + lowbar: "_", + loz: "\u25CA", + lozenge: "\u25CA", + lozf: "\u29EB", + lpar: "(", + lparlt: "\u2993", + lrarr: "\u21C6", + lrcorner: "\u231F", + lrhar: "\u21CB", + lrhard: "\u296D", + lrm: "\u200E", + lrtri: "\u22BF", + lsaquo: "\u2039", + lscr: "\u{1D4C1}", + lsh: "\u21B0", + lsim: "\u2272", + lsime: "\u2A8D", + lsimg: "\u2A8F", + lsqb: "[", + lsquo: "\u2018", + lsquor: "\u201A", + lstrok: "\u0142", + lt: "<", + ltcc: "\u2AA6", + ltcir: "\u2A79", + ltdot: "\u22D6", + lthree: "\u22CB", + ltimes: "\u22C9", + ltlarr: "\u2976", + ltquest: "\u2A7B", + ltrPar: "\u2996", + ltri: "\u25C3", + ltrie: "\u22B4", + ltrif: "\u25C2", + lurdshar: "\u294A", + luruhar: "\u2966", + lvertneqq: "\u2268\uFE00", + lvnE: "\u2268\uFE00", + mDDot: "\u223A", + macr: "\xAF", + male: "\u2642", + malt: "\u2720", + maltese: "\u2720", + map: "\u21A6", + mapsto: "\u21A6", + mapstodown: "\u21A7", + mapstoleft: "\u21A4", + mapstoup: "\u21A5", + marker: "\u25AE", + mcomma: "\u2A29", + mcy: "\u043C", + mdash: "\u2014", + measuredangle: "\u2221", + mfr: "\u{1D52A}", + mho: "\u2127", + micro: "\xB5", + mid: "\u2223", + midast: "*", + midcir: "\u2AF0", + middot: "\xB7", + minus: "\u2212", + minusb: "\u229F", + minusd: "\u2238", + minusdu: "\u2A2A", + mlcp: "\u2ADB", + mldr: "\u2026", + mnplus: "\u2213", + models: "\u22A7", + mopf: "\u{1D55E}", + mp: "\u2213", + mscr: "\u{1D4C2}", + mstpos: "\u223E", + mu: "\u03BC", + multimap: "\u22B8", + mumap: "\u22B8", + nGg: "\u22D9\u0338", + nGt: "\u226B\u20D2", + nGtv: "\u226B\u0338", + nLeftarrow: "\u21CD", + nLeftrightarrow: "\u21CE", + nLl: "\u22D8\u0338", + nLt: "\u226A\u20D2", + nLtv: "\u226A\u0338", + nRightarrow: "\u21CF", + nVDash: "\u22AF", + nVdash: "\u22AE", + nabla: "\u2207", + nacute: "\u0144", + nang: "\u2220\u20D2", + nap: "\u2249", + napE: "\u2A70\u0338", + napid: "\u224B\u0338", + napos: "\u0149", + napprox: "\u2249", + natur: "\u266E", + natural: "\u266E", + naturals: "\u2115", + nbsp: "\xA0", + nbump: "\u224E\u0338", + nbumpe: "\u224F\u0338", + ncap: "\u2A43", + ncaron: "\u0148", + ncedil: "\u0146", + ncong: "\u2247", + ncongdot: "\u2A6D\u0338", + ncup: "\u2A42", + ncy: "\u043D", + ndash: "\u2013", + ne: "\u2260", + neArr: "\u21D7", + nearhk: "\u2924", + nearr: "\u2197", + nearrow: "\u2197", + nedot: "\u2250\u0338", + nequiv: "\u2262", + nesear: "\u2928", + nesim: "\u2242\u0338", + nexist: "\u2204", + nexists: "\u2204", + nfr: "\u{1D52B}", + ngE: "\u2267\u0338", + nge: "\u2271", + ngeq: "\u2271", + ngeqq: "\u2267\u0338", + ngeqslant: "\u2A7E\u0338", + nges: "\u2A7E\u0338", + ngsim: "\u2275", + ngt: "\u226F", + ngtr: "\u226F", + nhArr: "\u21CE", + nharr: "\u21AE", + nhpar: "\u2AF2", + ni: "\u220B", + nis: "\u22FC", + nisd: "\u22FA", + niv: "\u220B", + njcy: "\u045A", + nlArr: "\u21CD", + nlE: "\u2266\u0338", + nlarr: "\u219A", + nldr: "\u2025", + nle: "\u2270", + nleftarrow: "\u219A", + nleftrightarrow: "\u21AE", + nleq: "\u2270", + nleqq: "\u2266\u0338", + nleqslant: "\u2A7D\u0338", + nles: "\u2A7D\u0338", + nless: "\u226E", + nlsim: "\u2274", + nlt: "\u226E", + nltri: "\u22EA", + nltrie: "\u22EC", + nmid: "\u2224", + nopf: "\u{1D55F}", + not: "\xAC", + notin: "\u2209", + notinE: "\u22F9\u0338", + notindot: "\u22F5\u0338", + notinva: "\u2209", + notinvb: "\u22F7", + notinvc: "\u22F6", + notni: "\u220C", + notniva: "\u220C", + notnivb: "\u22FE", + notnivc: "\u22FD", + npar: "\u2226", + nparallel: "\u2226", + nparsl: "\u2AFD\u20E5", + npart: "\u2202\u0338", + npolint: "\u2A14", + npr: "\u2280", + nprcue: "\u22E0", + npre: "\u2AAF\u0338", + nprec: "\u2280", + npreceq: "\u2AAF\u0338", + nrArr: "\u21CF", + nrarr: "\u219B", + nrarrc: "\u2933\u0338", + nrarrw: "\u219D\u0338", + nrightarrow: "\u219B", + nrtri: "\u22EB", + nrtrie: "\u22ED", + nsc: "\u2281", + nsccue: "\u22E1", + nsce: "\u2AB0\u0338", + nscr: "\u{1D4C3}", + nshortmid: "\u2224", + nshortparallel: "\u2226", + nsim: "\u2241", + nsime: "\u2244", + nsimeq: "\u2244", + nsmid: "\u2224", + nspar: "\u2226", + nsqsube: "\u22E2", + nsqsupe: "\u22E3", + nsub: "\u2284", + nsubE: "\u2AC5\u0338", + nsube: "\u2288", + nsubset: "\u2282\u20D2", + nsubseteq: "\u2288", + nsubseteqq: "\u2AC5\u0338", + nsucc: "\u2281", + nsucceq: "\u2AB0\u0338", + nsup: "\u2285", + nsupE: "\u2AC6\u0338", + nsupe: "\u2289", + nsupset: "\u2283\u20D2", + nsupseteq: "\u2289", + nsupseteqq: "\u2AC6\u0338", + ntgl: "\u2279", + ntilde: "\xF1", + ntlg: "\u2278", + ntriangleleft: "\u22EA", + ntrianglelefteq: "\u22EC", + ntriangleright: "\u22EB", + ntrianglerighteq: "\u22ED", + nu: "\u03BD", + num: "#", + numero: "\u2116", + numsp: "\u2007", + nvDash: "\u22AD", + nvHarr: "\u2904", + nvap: "\u224D\u20D2", + nvdash: "\u22AC", + nvge: "\u2265\u20D2", + nvgt: ">\u20D2", + nvinfin: "\u29DE", + nvlArr: "\u2902", + nvle: "\u2264\u20D2", + nvlt: "<\u20D2", + nvltrie: "\u22B4\u20D2", + nvrArr: "\u2903", + nvrtrie: "\u22B5\u20D2", + nvsim: "\u223C\u20D2", + nwArr: "\u21D6", + nwarhk: "\u2923", + nwarr: "\u2196", + nwarrow: "\u2196", + nwnear: "\u2927", + oS: "\u24C8", + oacute: "\xF3", + oast: "\u229B", + ocir: "\u229A", + ocirc: "\xF4", + ocy: "\u043E", + odash: "\u229D", + odblac: "\u0151", + odiv: "\u2A38", + odot: "\u2299", + odsold: "\u29BC", + oelig: "\u0153", + ofcir: "\u29BF", + ofr: "\u{1D52C}", + ogon: "\u02DB", + ograve: "\xF2", + ogt: "\u29C1", + ohbar: "\u29B5", + ohm: "\u03A9", + oint: "\u222E", + olarr: "\u21BA", + olcir: "\u29BE", + olcross: "\u29BB", + oline: "\u203E", + olt: "\u29C0", + omacr: "\u014D", + omega: "\u03C9", + omicron: "\u03BF", + omid: "\u29B6", + ominus: "\u2296", + oopf: "\u{1D560}", + opar: "\u29B7", + operp: "\u29B9", + oplus: "\u2295", + or: "\u2228", + orarr: "\u21BB", + ord: "\u2A5D", + order: "\u2134", + orderof: "\u2134", + ordf: "\xAA", + ordm: "\xBA", + origof: "\u22B6", + oror: "\u2A56", + orslope: "\u2A57", + orv: "\u2A5B", + oscr: "\u2134", + oslash: "\xF8", + osol: "\u2298", + otilde: "\xF5", + otimes: "\u2297", + otimesas: "\u2A36", + ouml: "\xF6", + ovbar: "\u233D", + par: "\u2225", + para: "\xB6", + parallel: "\u2225", + parsim: "\u2AF3", + parsl: "\u2AFD", + part: "\u2202", + pcy: "\u043F", + percnt: "%", + period: ".", + permil: "\u2030", + perp: "\u22A5", + pertenk: "\u2031", + pfr: "\u{1D52D}", + phi: "\u03C6", + phiv: "\u03D5", + phmmat: "\u2133", + phone: "\u260E", + pi: "\u03C0", + pitchfork: "\u22D4", + piv: "\u03D6", + planck: "\u210F", + planckh: "\u210E", + plankv: "\u210F", + plus: "+", + plusacir: "\u2A23", + plusb: "\u229E", + pluscir: "\u2A22", + plusdo: "\u2214", + plusdu: "\u2A25", + pluse: "\u2A72", + plusmn: "\xB1", + plussim: "\u2A26", + plustwo: "\u2A27", + pm: "\xB1", + pointint: "\u2A15", + popf: "\u{1D561}", + pound: "\xA3", + pr: "\u227A", + prE: "\u2AB3", + prap: "\u2AB7", + prcue: "\u227C", + pre: "\u2AAF", + prec: "\u227A", + precapprox: "\u2AB7", + preccurlyeq: "\u227C", + preceq: "\u2AAF", + precnapprox: "\u2AB9", + precneqq: "\u2AB5", + precnsim: "\u22E8", + precsim: "\u227E", + prime: "\u2032", + primes: "\u2119", + prnE: "\u2AB5", + prnap: "\u2AB9", + prnsim: "\u22E8", + prod: "\u220F", + profalar: "\u232E", + profline: "\u2312", + profsurf: "\u2313", + prop: "\u221D", + propto: "\u221D", + prsim: "\u227E", + prurel: "\u22B0", + pscr: "\u{1D4C5}", + psi: "\u03C8", + puncsp: "\u2008", + qfr: "\u{1D52E}", + qint: "\u2A0C", + qopf: "\u{1D562}", + qprime: "\u2057", + qscr: "\u{1D4C6}", + quaternions: "\u210D", + quatint: "\u2A16", + quest: "?", + questeq: "\u225F", + quot: '"', + rAarr: "\u21DB", + rArr: "\u21D2", + rAtail: "\u291C", + rBarr: "\u290F", + rHar: "\u2964", + race: "\u223D\u0331", + racute: "\u0155", + radic: "\u221A", + raemptyv: "\u29B3", + rang: "\u27E9", + rangd: "\u2992", + range: "\u29A5", + rangle: "\u27E9", + raquo: "\xBB", + rarr: "\u2192", + rarrap: "\u2975", + rarrb: "\u21E5", + rarrbfs: "\u2920", + rarrc: "\u2933", + rarrfs: "\u291E", + rarrhk: "\u21AA", + rarrlp: "\u21AC", + rarrpl: "\u2945", + rarrsim: "\u2974", + rarrtl: "\u21A3", + rarrw: "\u219D", + ratail: "\u291A", + ratio: "\u2236", + rationals: "\u211A", + rbarr: "\u290D", + rbbrk: "\u2773", + rbrace: "}", + rbrack: "]", + rbrke: "\u298C", + rbrksld: "\u298E", + rbrkslu: "\u2990", + rcaron: "\u0159", + rcedil: "\u0157", + rceil: "\u2309", + rcub: "}", + rcy: "\u0440", + rdca: "\u2937", + rdldhar: "\u2969", + rdquo: "\u201D", + rdquor: "\u201D", + rdsh: "\u21B3", + real: "\u211C", + realine: "\u211B", + realpart: "\u211C", + reals: "\u211D", + rect: "\u25AD", + reg: "\xAE", + rfisht: "\u297D", + rfloor: "\u230B", + rfr: "\u{1D52F}", + rhard: "\u21C1", + rharu: "\u21C0", + rharul: "\u296C", + rho: "\u03C1", + rhov: "\u03F1", + rightarrow: "\u2192", + rightarrowtail: "\u21A3", + rightharpoondown: "\u21C1", + rightharpoonup: "\u21C0", + rightleftarrows: "\u21C4", + rightleftharpoons: "\u21CC", + rightrightarrows: "\u21C9", + rightsquigarrow: "\u219D", + rightthreetimes: "\u22CC", + ring: "\u02DA", + risingdotseq: "\u2253", + rlarr: "\u21C4", + rlhar: "\u21CC", + rlm: "\u200F", + rmoust: "\u23B1", + rmoustache: "\u23B1", + rnmid: "\u2AEE", + roang: "\u27ED", + roarr: "\u21FE", + robrk: "\u27E7", + ropar: "\u2986", + ropf: "\u{1D563}", + roplus: "\u2A2E", + rotimes: "\u2A35", + rpar: ")", + rpargt: "\u2994", + rppolint: "\u2A12", + rrarr: "\u21C9", + rsaquo: "\u203A", + rscr: "\u{1D4C7}", + rsh: "\u21B1", + rsqb: "]", + rsquo: "\u2019", + rsquor: "\u2019", + rthree: "\u22CC", + rtimes: "\u22CA", + rtri: "\u25B9", + rtrie: "\u22B5", + rtrif: "\u25B8", + rtriltri: "\u29CE", + ruluhar: "\u2968", + rx: "\u211E", + sacute: "\u015B", + sbquo: "\u201A", + sc: "\u227B", + scE: "\u2AB4", + scap: "\u2AB8", + scaron: "\u0161", + sccue: "\u227D", + sce: "\u2AB0", + scedil: "\u015F", + scirc: "\u015D", + scnE: "\u2AB6", + scnap: "\u2ABA", + scnsim: "\u22E9", + scpolint: "\u2A13", + scsim: "\u227F", + scy: "\u0441", + sdot: "\u22C5", + sdotb: "\u22A1", + sdote: "\u2A66", + seArr: "\u21D8", + searhk: "\u2925", + searr: "\u2198", + searrow: "\u2198", + sect: "\xA7", + semi: ";", + seswar: "\u2929", + setminus: "\u2216", + setmn: "\u2216", + sext: "\u2736", + sfr: "\u{1D530}", + sfrown: "\u2322", + sharp: "\u266F", + shchcy: "\u0449", + shcy: "\u0448", + shortmid: "\u2223", + shortparallel: "\u2225", + shy: "\xAD", + sigma: "\u03C3", + sigmaf: "\u03C2", + sigmav: "\u03C2", + sim: "\u223C", + simdot: "\u2A6A", + sime: "\u2243", + simeq: "\u2243", + simg: "\u2A9E", + simgE: "\u2AA0", + siml: "\u2A9D", + simlE: "\u2A9F", + simne: "\u2246", + simplus: "\u2A24", + simrarr: "\u2972", + slarr: "\u2190", + smallsetminus: "\u2216", + smashp: "\u2A33", + smeparsl: "\u29E4", + smid: "\u2223", + smile: "\u2323", + smt: "\u2AAA", + smte: "\u2AAC", + smtes: "\u2AAC\uFE00", + softcy: "\u044C", + sol: "/", + solb: "\u29C4", + solbar: "\u233F", + sopf: "\u{1D564}", + spades: "\u2660", + spadesuit: "\u2660", + spar: "\u2225", + sqcap: "\u2293", + sqcaps: "\u2293\uFE00", + sqcup: "\u2294", + sqcups: "\u2294\uFE00", + sqsub: "\u228F", + sqsube: "\u2291", + sqsubset: "\u228F", + sqsubseteq: "\u2291", + sqsup: "\u2290", + sqsupe: "\u2292", + sqsupset: "\u2290", + sqsupseteq: "\u2292", + squ: "\u25A1", + square: "\u25A1", + squarf: "\u25AA", + squf: "\u25AA", + srarr: "\u2192", + sscr: "\u{1D4C8}", + ssetmn: "\u2216", + ssmile: "\u2323", + sstarf: "\u22C6", + star: "\u2606", + starf: "\u2605", + straightepsilon: "\u03F5", + straightphi: "\u03D5", + strns: "\xAF", + sub: "\u2282", + subE: "\u2AC5", + subdot: "\u2ABD", + sube: "\u2286", + subedot: "\u2AC3", + submult: "\u2AC1", + subnE: "\u2ACB", + subne: "\u228A", + subplus: "\u2ABF", + subrarr: "\u2979", + subset: "\u2282", + subseteq: "\u2286", + subseteqq: "\u2AC5", + subsetneq: "\u228A", + subsetneqq: "\u2ACB", + subsim: "\u2AC7", + subsub: "\u2AD5", + subsup: "\u2AD3", + succ: "\u227B", + succapprox: "\u2AB8", + succcurlyeq: "\u227D", + succeq: "\u2AB0", + succnapprox: "\u2ABA", + succneqq: "\u2AB6", + succnsim: "\u22E9", + succsim: "\u227F", + sum: "\u2211", + sung: "\u266A", + sup1: "\xB9", + sup2: "\xB2", + sup3: "\xB3", + sup: "\u2283", + supE: "\u2AC6", + supdot: "\u2ABE", + supdsub: "\u2AD8", + supe: "\u2287", + supedot: "\u2AC4", + suphsol: "\u27C9", + suphsub: "\u2AD7", + suplarr: "\u297B", + supmult: "\u2AC2", + supnE: "\u2ACC", + supne: "\u228B", + supplus: "\u2AC0", + supset: "\u2283", + supseteq: "\u2287", + supseteqq: "\u2AC6", + supsetneq: "\u228B", + supsetneqq: "\u2ACC", + supsim: "\u2AC8", + supsub: "\u2AD4", + supsup: "\u2AD6", + swArr: "\u21D9", + swarhk: "\u2926", + swarr: "\u2199", + swarrow: "\u2199", + swnwar: "\u292A", + szlig: "\xDF", + target: "\u2316", + tau: "\u03C4", + tbrk: "\u23B4", + tcaron: "\u0165", + tcedil: "\u0163", + tcy: "\u0442", + tdot: "\u20DB", + telrec: "\u2315", + tfr: "\u{1D531}", + there4: "\u2234", + therefore: "\u2234", + theta: "\u03B8", + thetasym: "\u03D1", + thetav: "\u03D1", + thickapprox: "\u2248", + thicksim: "\u223C", + thinsp: "\u2009", + thkap: "\u2248", + thksim: "\u223C", + thorn: "\xFE", + tilde: "\u02DC", + times: "\xD7", + timesb: "\u22A0", + timesbar: "\u2A31", + timesd: "\u2A30", + tint: "\u222D", + toea: "\u2928", + top: "\u22A4", + topbot: "\u2336", + topcir: "\u2AF1", + topf: "\u{1D565}", + topfork: "\u2ADA", + tosa: "\u2929", + tprime: "\u2034", + trade: "\u2122", + triangle: "\u25B5", + triangledown: "\u25BF", + triangleleft: "\u25C3", + trianglelefteq: "\u22B4", + triangleq: "\u225C", + triangleright: "\u25B9", + trianglerighteq: "\u22B5", + tridot: "\u25EC", + trie: "\u225C", + triminus: "\u2A3A", + triplus: "\u2A39", + trisb: "\u29CD", + tritime: "\u2A3B", + trpezium: "\u23E2", + tscr: "\u{1D4C9}", + tscy: "\u0446", + tshcy: "\u045B", + tstrok: "\u0167", + twixt: "\u226C", + twoheadleftarrow: "\u219E", + twoheadrightarrow: "\u21A0", + uArr: "\u21D1", + uHar: "\u2963", + uacute: "\xFA", + uarr: "\u2191", + ubrcy: "\u045E", + ubreve: "\u016D", + ucirc: "\xFB", + ucy: "\u0443", + udarr: "\u21C5", + udblac: "\u0171", + udhar: "\u296E", + ufisht: "\u297E", + ufr: "\u{1D532}", + ugrave: "\xF9", + uharl: "\u21BF", + uharr: "\u21BE", + uhblk: "\u2580", + ulcorn: "\u231C", + ulcorner: "\u231C", + ulcrop: "\u230F", + ultri: "\u25F8", + umacr: "\u016B", + uml: "\xA8", + uogon: "\u0173", + uopf: "\u{1D566}", + uparrow: "\u2191", + updownarrow: "\u2195", + upharpoonleft: "\u21BF", + upharpoonright: "\u21BE", + uplus: "\u228E", + upsi: "\u03C5", + upsih: "\u03D2", + upsilon: "\u03C5", + upuparrows: "\u21C8", + urcorn: "\u231D", + urcorner: "\u231D", + urcrop: "\u230E", + uring: "\u016F", + urtri: "\u25F9", + uscr: "\u{1D4CA}", + utdot: "\u22F0", + utilde: "\u0169", + utri: "\u25B5", + utrif: "\u25B4", + uuarr: "\u21C8", + uuml: "\xFC", + uwangle: "\u29A7", + vArr: "\u21D5", + vBar: "\u2AE8", + vBarv: "\u2AE9", + vDash: "\u22A8", + vangrt: "\u299C", + varepsilon: "\u03F5", + varkappa: "\u03F0", + varnothing: "\u2205", + varphi: "\u03D5", + varpi: "\u03D6", + varpropto: "\u221D", + varr: "\u2195", + varrho: "\u03F1", + varsigma: "\u03C2", + varsubsetneq: "\u228A\uFE00", + varsubsetneqq: "\u2ACB\uFE00", + varsupsetneq: "\u228B\uFE00", + varsupsetneqq: "\u2ACC\uFE00", + vartheta: "\u03D1", + vartriangleleft: "\u22B2", + vartriangleright: "\u22B3", + vcy: "\u0432", + vdash: "\u22A2", + vee: "\u2228", + veebar: "\u22BB", + veeeq: "\u225A", + vellip: "\u22EE", + verbar: "|", + vert: "|", + vfr: "\u{1D533}", + vltri: "\u22B2", + vnsub: "\u2282\u20D2", + vnsup: "\u2283\u20D2", + vopf: "\u{1D567}", + vprop: "\u221D", + vrtri: "\u22B3", + vscr: "\u{1D4CB}", + vsubnE: "\u2ACB\uFE00", + vsubne: "\u228A\uFE00", + vsupnE: "\u2ACC\uFE00", + vsupne: "\u228B\uFE00", + vzigzag: "\u299A", + wcirc: "\u0175", + wedbar: "\u2A5F", + wedge: "\u2227", + wedgeq: "\u2259", + weierp: "\u2118", + wfr: "\u{1D534}", + wopf: "\u{1D568}", + wp: "\u2118", + wr: "\u2240", + wreath: "\u2240", + wscr: "\u{1D4CC}", + xcap: "\u22C2", + xcirc: "\u25EF", + xcup: "\u22C3", + xdtri: "\u25BD", + xfr: "\u{1D535}", + xhArr: "\u27FA", + xharr: "\u27F7", + xi: "\u03BE", + xlArr: "\u27F8", + xlarr: "\u27F5", + xmap: "\u27FC", + xnis: "\u22FB", + xodot: "\u2A00", + xopf: "\u{1D569}", + xoplus: "\u2A01", + xotime: "\u2A02", + xrArr: "\u27F9", + xrarr: "\u27F6", + xscr: "\u{1D4CD}", + xsqcup: "\u2A06", + xuplus: "\u2A04", + xutri: "\u25B3", + xvee: "\u22C1", + xwedge: "\u22C0", + yacute: "\xFD", + yacy: "\u044F", + ycirc: "\u0177", + ycy: "\u044B", + yen: "\xA5", + yfr: "\u{1D536}", + yicy: "\u0457", + yopf: "\u{1D56A}", + yscr: "\u{1D4CE}", + yucy: "\u044E", + yuml: "\xFF", + zacute: "\u017A", + zcaron: "\u017E", + zcy: "\u0437", + zdot: "\u017C", + zeetrf: "\u2128", + zeta: "\u03B6", + zfr: "\u{1D537}", + zhcy: "\u0436", + zigrarr: "\u21DD", + zopf: "\u{1D56B}", + zscr: "\u{1D4CF}", + zwj: "\u200D", + zwnj: "\u200C" +}; + +// node_modules/decode-named-character-reference/index.js +var own3 = {}.hasOwnProperty; +function decodeNamedCharacterReference(value) { + return own3.call(characterEntities, value) ? characterEntities[value] : false; +} + +// node_modules/micromark-core-commonmark/lib/character-reference.js +var characterReference = { + name: "characterReference", + tokenize: tokenizeCharacterReference +}; +function tokenizeCharacterReference(effects, ok2, nok) { + const self2 = this; + let size = 0; + let max; + let test; + return start3; + function start3(code2) { + effects.enter("characterReference"); + effects.enter("characterReferenceMarker"); + effects.consume(code2); + effects.exit("characterReferenceMarker"); + return open; + } + function open(code2) { + if (code2 === 35) { + effects.enter("characterReferenceMarkerNumeric"); + effects.consume(code2); + effects.exit("characterReferenceMarkerNumeric"); + return numeric; + } + effects.enter("characterReferenceValue"); + max = 31; + test = asciiAlphanumeric; + return value(code2); + } + function numeric(code2) { + if (code2 === 88 || code2 === 120) { + effects.enter("characterReferenceMarkerHexadecimal"); + effects.consume(code2); + effects.exit("characterReferenceMarkerHexadecimal"); + effects.enter("characterReferenceValue"); + max = 6; + test = asciiHexDigit; + return value; + } + effects.enter("characterReferenceValue"); + max = 7; + test = asciiDigit; + return value(code2); + } + function value(code2) { + let token; + if (code2 === 59 && size) { + token = effects.exit("characterReferenceValue"); + if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self2.sliceSerialize(token))) { + return nok(code2); + } + effects.enter("characterReferenceMarker"); + effects.consume(code2); + effects.exit("characterReferenceMarker"); + effects.exit("characterReference"); + return ok2; + } + if (test(code2) && size++ < max) { + effects.consume(code2); + return value; + } + return nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/code-fenced.js +var codeFenced = { + name: "codeFenced", + tokenize: tokenizeCodeFenced, + concrete: true +}; +function tokenizeCodeFenced(effects, ok2, nok) { + const self2 = this; + const closingFenceConstruct = { + tokenize: tokenizeClosingFence, + partial: true + }; + const nonLazyLine = { + tokenize: tokenizeNonLazyLine, + partial: true + }; + const tail = this.events[this.events.length - 1]; + const initialPrefix = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; + let sizeOpen = 0; + let marker; + return start3; + function start3(code2) { + effects.enter("codeFenced"); + effects.enter("codeFencedFence"); + effects.enter("codeFencedFenceSequence"); + marker = code2; + return sequenceOpen(code2); + } + function sequenceOpen(code2) { + if (code2 === marker) { + effects.consume(code2); + sizeOpen++; + return sequenceOpen; + } + effects.exit("codeFencedFenceSequence"); + return sizeOpen < 3 ? nok(code2) : factorySpace(effects, infoOpen, "whitespace")(code2); + } + function infoOpen(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return openAfter(code2); + } + effects.enter("codeFencedFenceInfo"); + effects.enter("chunkString", { + contentType: "string" + }); + return info(code2); + } + function info(code2) { + if (code2 === null || markdownLineEndingOrSpace(code2)) { + effects.exit("chunkString"); + effects.exit("codeFencedFenceInfo"); + return factorySpace(effects, infoAfter, "whitespace")(code2); + } + if (code2 === 96 && code2 === marker) + return nok(code2); + effects.consume(code2); + return info; + } + function infoAfter(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return openAfter(code2); + } + effects.enter("codeFencedFenceMeta"); + effects.enter("chunkString", { + contentType: "string" + }); + return meta(code2); + } + function meta(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("chunkString"); + effects.exit("codeFencedFenceMeta"); + return openAfter(code2); + } + if (code2 === 96 && code2 === marker) + return nok(code2); + effects.consume(code2); + return meta; + } + function openAfter(code2) { + effects.exit("codeFencedFence"); + return self2.interrupt ? ok2(code2) : contentStart(code2); + } + function contentStart(code2) { + if (code2 === null) { + return after(code2); + } + if (markdownLineEnding(code2)) { + return effects.attempt( + nonLazyLine, + effects.attempt( + closingFenceConstruct, + after, + initialPrefix ? factorySpace( + effects, + contentStart, + "linePrefix", + initialPrefix + 1 + ) : contentStart + ), + after + )(code2); + } + effects.enter("codeFlowValue"); + return contentContinue(code2); + } + function contentContinue(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("codeFlowValue"); + return contentStart(code2); + } + effects.consume(code2); + return contentContinue; + } + function after(code2) { + effects.exit("codeFenced"); + return ok2(code2); + } + function tokenizeNonLazyLine(effects2, ok3, nok2) { + const self3 = this; + return start4; + function start4(code2) { + effects2.enter("lineEnding"); + effects2.consume(code2); + effects2.exit("lineEnding"); + return lineStart; + } + function lineStart(code2) { + return self3.parser.lazy[self3.now().line] ? nok2(code2) : ok3(code2); + } + } + function tokenizeClosingFence(effects2, ok3, nok2) { + let size = 0; + return factorySpace( + effects2, + closingSequenceStart, + "linePrefix", + this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + ); + function closingSequenceStart(code2) { + effects2.enter("codeFencedFence"); + effects2.enter("codeFencedFenceSequence"); + return closingSequence(code2); + } + function closingSequence(code2) { + if (code2 === marker) { + effects2.consume(code2); + size++; + return closingSequence; + } + if (size < sizeOpen) + return nok2(code2); + effects2.exit("codeFencedFenceSequence"); + return factorySpace(effects2, closingSequenceEnd, "whitespace")(code2); + } + function closingSequenceEnd(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects2.exit("codeFencedFence"); + return ok3(code2); + } + return nok2(code2); + } + } +} + +// node_modules/micromark-core-commonmark/lib/code-indented.js +var codeIndented = { + name: "codeIndented", + tokenize: tokenizeCodeIndented +}; +var indentedContent = { + tokenize: tokenizeIndentedContent, + partial: true +}; +function tokenizeCodeIndented(effects, ok2, nok) { + const self2 = this; + return start3; + function start3(code2) { + effects.enter("codeIndented"); + return factorySpace(effects, afterStartPrefix, "linePrefix", 4 + 1)(code2); + } + function afterStartPrefix(code2) { + const tail = self2.events[self2.events.length - 1]; + return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? afterPrefix(code2) : nok(code2); + } + function afterPrefix(code2) { + if (code2 === null) { + return after(code2); + } + if (markdownLineEnding(code2)) { + return effects.attempt(indentedContent, afterPrefix, after)(code2); + } + effects.enter("codeFlowValue"); + return content3(code2); + } + function content3(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("codeFlowValue"); + return afterPrefix(code2); + } + effects.consume(code2); + return content3; + } + function after(code2) { + effects.exit("codeIndented"); + return ok2(code2); + } +} +function tokenizeIndentedContent(effects, ok2, nok) { + const self2 = this; + return start3; + function start3(code2) { + if (self2.parser.lazy[self2.now().line]) { + return nok(code2); + } + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return start3; + } + return factorySpace(effects, afterPrefix, "linePrefix", 4 + 1)(code2); + } + function afterPrefix(code2) { + const tail = self2.events[self2.events.length - 1]; + return tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok2(code2) : markdownLineEnding(code2) ? start3(code2) : nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/code-text.js +var codeText = { + name: "codeText", + tokenize: tokenizeCodeText, + resolve: resolveCodeText, + previous +}; +function resolveCodeText(events) { + let tailExitIndex = events.length - 4; + let headEnterIndex = 3; + let index2; + let enter; + if ((events[headEnterIndex][1].type === "lineEnding" || events[headEnterIndex][1].type === "space") && (events[tailExitIndex][1].type === "lineEnding" || events[tailExitIndex][1].type === "space")) { + index2 = headEnterIndex; + while (++index2 < tailExitIndex) { + if (events[index2][1].type === "codeTextData") { + events[headEnterIndex][1].type = "codeTextPadding"; + events[tailExitIndex][1].type = "codeTextPadding"; + headEnterIndex += 2; + tailExitIndex -= 2; + break; + } + } + } + index2 = headEnterIndex - 1; + tailExitIndex++; + while (++index2 <= tailExitIndex) { + if (enter === void 0) { + if (index2 !== tailExitIndex && events[index2][1].type !== "lineEnding") { + enter = index2; + } + } else if (index2 === tailExitIndex || events[index2][1].type === "lineEnding") { + events[enter][1].type = "codeTextData"; + if (index2 !== enter + 2) { + events[enter][1].end = events[index2 - 1][1].end; + events.splice(enter + 2, index2 - enter - 2); + tailExitIndex -= index2 - enter - 2; + index2 = enter + 2; + } + enter = void 0; + } + } + return events; +} +function previous(code2) { + return code2 !== 96 || this.events[this.events.length - 1][1].type === "characterEscape"; +} +function tokenizeCodeText(effects, ok2, nok) { + const self2 = this; + let sizeOpen = 0; + let size; + let token; + return start3; + function start3(code2) { + effects.enter("codeText"); + effects.enter("codeTextSequence"); + return openingSequence(code2); + } + function openingSequence(code2) { + if (code2 === 96) { + effects.consume(code2); + sizeOpen++; + return openingSequence; + } + effects.exit("codeTextSequence"); + return gap(code2); + } + function gap(code2) { + if (code2 === null) { + return nok(code2); + } + if (code2 === 96) { + token = effects.enter("codeTextSequence"); + size = 0; + return closingSequence(code2); + } + if (code2 === 32) { + effects.enter("space"); + effects.consume(code2); + effects.exit("space"); + return gap; + } + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return gap; + } + effects.enter("codeTextData"); + return data2(code2); + } + function data2(code2) { + if (code2 === null || code2 === 32 || code2 === 96 || markdownLineEnding(code2)) { + effects.exit("codeTextData"); + return gap(code2); + } + effects.consume(code2); + return data2; + } + function closingSequence(code2) { + if (code2 === 96) { + effects.consume(code2); + size++; + return closingSequence; + } + if (size === sizeOpen) { + effects.exit("codeTextSequence"); + effects.exit("codeText"); + return ok2(code2); + } + token.type = "codeTextData"; + return data2(code2); + } +} + +// node_modules/micromark-util-subtokenize/index.js +function subtokenize(events) { + const jumps = {}; + let index2 = -1; + let event; + let lineIndex; + let otherIndex; + let otherEvent; + let parameters; + let subevents; + let more; + while (++index2 < events.length) { + while (index2 in jumps) { + index2 = jumps[index2]; + } + event = events[index2]; + if (index2 && event[1].type === "chunkFlow" && events[index2 - 1][1].type === "listItemPrefix") { + subevents = event[1]._tokenizer.events; + otherIndex = 0; + if (otherIndex < subevents.length && subevents[otherIndex][1].type === "lineEndingBlank") { + otherIndex += 2; + } + if (otherIndex < subevents.length && subevents[otherIndex][1].type === "content") { + while (++otherIndex < subevents.length) { + if (subevents[otherIndex][1].type === "content") { + break; + } + if (subevents[otherIndex][1].type === "chunkText") { + subevents[otherIndex][1]._isInFirstContentOfListItem = true; + otherIndex++; + } + } + } + } + if (event[0] === "enter") { + if (event[1].contentType) { + Object.assign(jumps, subcontent(events, index2)); + index2 = jumps[index2]; + more = true; + } + } else if (event[1]._container) { + otherIndex = index2; + lineIndex = void 0; + while (otherIndex--) { + otherEvent = events[otherIndex]; + if (otherEvent[1].type === "lineEnding" || otherEvent[1].type === "lineEndingBlank") { + if (otherEvent[0] === "enter") { + if (lineIndex) { + events[lineIndex][1].type = "lineEndingBlank"; + } + otherEvent[1].type = "lineEnding"; + lineIndex = otherIndex; + } + } else { + break; + } + } + if (lineIndex) { + event[1].end = Object.assign({}, events[lineIndex][1].start); + parameters = events.slice(lineIndex, index2); + parameters.unshift(event); + splice(events, lineIndex, index2 - lineIndex + 1, parameters); + } + } + } + return !more; +} +function subcontent(events, eventIndex) { + const token = events[eventIndex][1]; + const context = events[eventIndex][2]; + let startPosition = eventIndex - 1; + const startPositions = []; + const tokenizer2 = token._tokenizer || context.parser[token.contentType](token.start); + const childEvents = tokenizer2.events; + const jumps = []; + const gaps = {}; + let stream; + let previous2; + let index2 = -1; + let current2 = token; + let adjust = 0; + let start3 = 0; + const breaks = [start3]; + while (current2) { + while (events[++startPosition][1] !== current2) { + } + startPositions.push(startPosition); + if (!current2._tokenizer) { + stream = context.sliceStream(current2); + if (!current2.next) { + stream.push(null); + } + if (previous2) { + tokenizer2.defineSkip(current2.start); + } + if (current2._isInFirstContentOfListItem) { + tokenizer2._gfmTasklistFirstContentOfListItem = true; + } + tokenizer2.write(stream); + if (current2._isInFirstContentOfListItem) { + tokenizer2._gfmTasklistFirstContentOfListItem = void 0; + } + } + previous2 = current2; + current2 = current2.next; + } + current2 = token; + while (++index2 < childEvents.length) { + if (childEvents[index2][0] === "exit" && childEvents[index2 - 1][0] === "enter" && childEvents[index2][1].type === childEvents[index2 - 1][1].type && childEvents[index2][1].start.line !== childEvents[index2][1].end.line) { + start3 = index2 + 1; + breaks.push(start3); + current2._tokenizer = void 0; + current2.previous = void 0; + current2 = current2.next; + } + } + tokenizer2.events = []; + if (current2) { + current2._tokenizer = void 0; + current2.previous = void 0; + } else { + breaks.pop(); + } + index2 = breaks.length; + while (index2--) { + const slice2 = childEvents.slice(breaks[index2], breaks[index2 + 1]); + const start4 = startPositions.pop(); + jumps.unshift([start4, start4 + slice2.length - 1]); + splice(events, start4, 2, slice2); + } + index2 = -1; + while (++index2 < jumps.length) { + gaps[adjust + jumps[index2][0]] = adjust + jumps[index2][1]; + adjust += jumps[index2][1] - jumps[index2][0] - 1; + } + return gaps; +} + +// node_modules/micromark-core-commonmark/lib/content.js +var content = { + tokenize: tokenizeContent, + resolve: resolveContent +}; +var continuationConstruct = { + tokenize: tokenizeContinuation, + partial: true +}; +function resolveContent(events) { + subtokenize(events); + return events; +} +function tokenizeContent(effects, ok2) { + let previous2; + return start3; + function start3(code2) { + effects.enter("content"); + previous2 = effects.enter("chunkContent", { + contentType: "content" + }); + return data2(code2); + } + function data2(code2) { + if (code2 === null) { + return contentEnd(code2); + } + if (markdownLineEnding(code2)) { + return effects.check( + continuationConstruct, + contentContinue, + contentEnd + )(code2); + } + effects.consume(code2); + return data2; + } + function contentEnd(code2) { + effects.exit("chunkContent"); + effects.exit("content"); + return ok2(code2); + } + function contentContinue(code2) { + effects.consume(code2); + effects.exit("chunkContent"); + previous2.next = effects.enter("chunkContent", { + contentType: "content", + previous: previous2 + }); + previous2 = previous2.next; + return data2; + } +} +function tokenizeContinuation(effects, ok2, nok) { + const self2 = this; + return startLookahead; + function startLookahead(code2) { + effects.exit("chunkContent"); + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return factorySpace(effects, prefixed, "linePrefix"); + } + function prefixed(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return nok(code2); + } + const tail = self2.events[self2.events.length - 1]; + if (!self2.parser.constructs.disable.null.includes("codeIndented") && tail && tail[1].type === "linePrefix" && tail[2].sliceSerialize(tail[1], true).length >= 4) { + return ok2(code2); + } + return effects.interrupt(self2.parser.constructs.flow, nok, ok2)(code2); + } +} + +// node_modules/micromark-factory-destination/index.js +function factoryDestination(effects, ok2, nok, type, literalType, literalMarkerType, rawType, stringType, max) { + const limit = max || Number.POSITIVE_INFINITY; + let balance = 0; + return start3; + function start3(code2) { + if (code2 === 60) { + effects.enter(type); + effects.enter(literalType); + effects.enter(literalMarkerType); + effects.consume(code2); + effects.exit(literalMarkerType); + return destinationEnclosedBefore; + } + if (code2 === null || code2 === 41 || asciiControl(code2)) { + return nok(code2); + } + effects.enter(type); + effects.enter(rawType); + effects.enter(stringType); + effects.enter("chunkString", { + contentType: "string" + }); + return destinationRaw(code2); + } + function destinationEnclosedBefore(code2) { + if (code2 === 62) { + effects.enter(literalMarkerType); + effects.consume(code2); + effects.exit(literalMarkerType); + effects.exit(literalType); + effects.exit(type); + return ok2; + } + effects.enter(stringType); + effects.enter("chunkString", { + contentType: "string" + }); + return destinationEnclosed(code2); + } + function destinationEnclosed(code2) { + if (code2 === 62) { + effects.exit("chunkString"); + effects.exit(stringType); + return destinationEnclosedBefore(code2); + } + if (code2 === null || code2 === 60 || markdownLineEnding(code2)) { + return nok(code2); + } + effects.consume(code2); + return code2 === 92 ? destinationEnclosedEscape : destinationEnclosed; + } + function destinationEnclosedEscape(code2) { + if (code2 === 60 || code2 === 62 || code2 === 92) { + effects.consume(code2); + return destinationEnclosed; + } + return destinationEnclosed(code2); + } + function destinationRaw(code2) { + if (code2 === 40) { + if (++balance > limit) + return nok(code2); + effects.consume(code2); + return destinationRaw; + } + if (code2 === 41) { + if (!balance--) { + effects.exit("chunkString"); + effects.exit(stringType); + effects.exit(rawType); + effects.exit(type); + return ok2(code2); + } + effects.consume(code2); + return destinationRaw; + } + if (code2 === null || markdownLineEndingOrSpace(code2)) { + if (balance) + return nok(code2); + effects.exit("chunkString"); + effects.exit(stringType); + effects.exit(rawType); + effects.exit(type); + return ok2(code2); + } + if (asciiControl(code2)) + return nok(code2); + effects.consume(code2); + return code2 === 92 ? destinationRawEscape : destinationRaw; + } + function destinationRawEscape(code2) { + if (code2 === 40 || code2 === 41 || code2 === 92) { + effects.consume(code2); + return destinationRaw; + } + return destinationRaw(code2); + } +} + +// node_modules/micromark-factory-label/index.js +function factoryLabel(effects, ok2, nok, type, markerType, stringType) { + const self2 = this; + let size = 0; + let data2; + return start3; + function start3(code2) { + effects.enter(type); + effects.enter(markerType); + effects.consume(code2); + effects.exit(markerType); + effects.enter(stringType); + return atBreak; + } + function atBreak(code2) { + if (code2 === null || code2 === 91 || code2 === 93 && !data2 || code2 === 94 && !size && "_hiddenFootnoteSupport" in self2.parser.constructs || size > 999) { + return nok(code2); + } + if (code2 === 93) { + effects.exit(stringType); + effects.enter(markerType); + effects.consume(code2); + effects.exit(markerType); + effects.exit(type); + return ok2; + } + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return atBreak; + } + effects.enter("chunkString", { + contentType: "string" + }); + return label(code2); + } + function label(code2) { + if (code2 === null || code2 === 91 || code2 === 93 || markdownLineEnding(code2) || size++ > 999) { + effects.exit("chunkString"); + return atBreak(code2); + } + effects.consume(code2); + data2 = data2 || !markdownSpace(code2); + return code2 === 92 ? labelEscape : label; + } + function labelEscape(code2) { + if (code2 === 91 || code2 === 92 || code2 === 93) { + effects.consume(code2); + size++; + return label; + } + return label(code2); + } +} + +// node_modules/micromark-factory-title/index.js +function factoryTitle(effects, ok2, nok, type, markerType, stringType) { + let marker; + return start3; + function start3(code2) { + effects.enter(type); + effects.enter(markerType); + effects.consume(code2); + effects.exit(markerType); + marker = code2 === 40 ? 41 : code2; + return atFirstTitleBreak; + } + function atFirstTitleBreak(code2) { + if (code2 === marker) { + effects.enter(markerType); + effects.consume(code2); + effects.exit(markerType); + effects.exit(type); + return ok2; + } + effects.enter(stringType); + return atTitleBreak(code2); + } + function atTitleBreak(code2) { + if (code2 === marker) { + effects.exit(stringType); + return atFirstTitleBreak(marker); + } + if (code2 === null) { + return nok(code2); + } + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return factorySpace(effects, atTitleBreak, "linePrefix"); + } + effects.enter("chunkString", { + contentType: "string" + }); + return title(code2); + } + function title(code2) { + if (code2 === marker || code2 === null || markdownLineEnding(code2)) { + effects.exit("chunkString"); + return atTitleBreak(code2); + } + effects.consume(code2); + return code2 === 92 ? titleEscape : title; + } + function titleEscape(code2) { + if (code2 === marker || code2 === 92) { + effects.consume(code2); + return title; + } + return title(code2); + } +} + +// node_modules/micromark-factory-whitespace/index.js +function factoryWhitespace(effects, ok2) { + let seen; + return start3; + function start3(code2) { + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + seen = true; + return start3; + } + if (markdownSpace(code2)) { + return factorySpace( + effects, + start3, + seen ? "linePrefix" : "lineSuffix" + )(code2); + } + return ok2(code2); + } +} + +// node_modules/micromark-util-normalize-identifier/index.js +function normalizeIdentifier(value) { + return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase(); +} + +// node_modules/micromark-core-commonmark/lib/definition.js +var definition = { + name: "definition", + tokenize: tokenizeDefinition +}; +var titleConstruct = { + tokenize: tokenizeTitle, + partial: true +}; +function tokenizeDefinition(effects, ok2, nok) { + const self2 = this; + let identifier; + return start3; + function start3(code2) { + effects.enter("definition"); + return factoryLabel.call( + self2, + effects, + labelAfter, + nok, + "definitionLabel", + "definitionLabelMarker", + "definitionLabelString" + )(code2); + } + function labelAfter(code2) { + identifier = normalizeIdentifier( + self2.sliceSerialize(self2.events[self2.events.length - 1][1]).slice(1, -1) + ); + if (code2 === 58) { + effects.enter("definitionMarker"); + effects.consume(code2); + effects.exit("definitionMarker"); + return factoryWhitespace( + effects, + factoryDestination( + effects, + effects.attempt( + titleConstruct, + factorySpace(effects, after, "whitespace"), + factorySpace(effects, after, "whitespace") + ), + nok, + "definitionDestination", + "definitionDestinationLiteral", + "definitionDestinationLiteralMarker", + "definitionDestinationRaw", + "definitionDestinationString" + ) + ); + } + return nok(code2); + } + function after(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("definition"); + if (!self2.parser.defined.includes(identifier)) { + self2.parser.defined.push(identifier); + } + return ok2(code2); + } + return nok(code2); + } +} +function tokenizeTitle(effects, ok2, nok) { + return start3; + function start3(code2) { + return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, before)(code2) : nok(code2); + } + function before(code2) { + if (code2 === 34 || code2 === 39 || code2 === 40) { + return factoryTitle( + effects, + factorySpace(effects, after, "whitespace"), + nok, + "definitionTitle", + "definitionTitleMarker", + "definitionTitleString" + )(code2); + } + return nok(code2); + } + function after(code2) { + return code2 === null || markdownLineEnding(code2) ? ok2(code2) : nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/hard-break-escape.js +var hardBreakEscape = { + name: "hardBreakEscape", + tokenize: tokenizeHardBreakEscape +}; +function tokenizeHardBreakEscape(effects, ok2, nok) { + return start3; + function start3(code2) { + effects.enter("hardBreakEscape"); + effects.enter("escapeMarker"); + effects.consume(code2); + return open; + } + function open(code2) { + if (markdownLineEnding(code2)) { + effects.exit("escapeMarker"); + effects.exit("hardBreakEscape"); + return ok2(code2); + } + return nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/heading-atx.js +var headingAtx = { + name: "headingAtx", + tokenize: tokenizeHeadingAtx, + resolve: resolveHeadingAtx +}; +function resolveHeadingAtx(events, context) { + let contentEnd = events.length - 2; + let contentStart = 3; + let content3; + let text5; + if (events[contentStart][1].type === "whitespace") { + contentStart += 2; + } + if (contentEnd - 2 > contentStart && events[contentEnd][1].type === "whitespace") { + contentEnd -= 2; + } + if (events[contentEnd][1].type === "atxHeadingSequence" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === "whitespace")) { + contentEnd -= contentStart + 1 === contentEnd ? 2 : 4; + } + if (contentEnd > contentStart) { + content3 = { + type: "atxHeadingText", + start: events[contentStart][1].start, + end: events[contentEnd][1].end + }; + text5 = { + type: "chunkText", + start: events[contentStart][1].start, + end: events[contentEnd][1].end, + contentType: "text" + }; + splice(events, contentStart, contentEnd - contentStart + 1, [ + ["enter", content3, context], + ["enter", text5, context], + ["exit", text5, context], + ["exit", content3, context] + ]); + } + return events; +} +function tokenizeHeadingAtx(effects, ok2, nok) { + const self2 = this; + let size = 0; + return start3; + function start3(code2) { + effects.enter("atxHeading"); + effects.enter("atxHeadingSequence"); + return fenceOpenInside(code2); + } + function fenceOpenInside(code2) { + if (code2 === 35 && size++ < 6) { + effects.consume(code2); + return fenceOpenInside; + } + if (code2 === null || markdownLineEndingOrSpace(code2)) { + effects.exit("atxHeadingSequence"); + return self2.interrupt ? ok2(code2) : headingBreak(code2); + } + return nok(code2); + } + function headingBreak(code2) { + if (code2 === 35) { + effects.enter("atxHeadingSequence"); + return sequence(code2); + } + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("atxHeading"); + return ok2(code2); + } + if (markdownSpace(code2)) { + return factorySpace(effects, headingBreak, "whitespace")(code2); + } + effects.enter("atxHeadingText"); + return data2(code2); + } + function sequence(code2) { + if (code2 === 35) { + effects.consume(code2); + return sequence; + } + effects.exit("atxHeadingSequence"); + return headingBreak(code2); + } + function data2(code2) { + if (code2 === null || code2 === 35 || markdownLineEndingOrSpace(code2)) { + effects.exit("atxHeadingText"); + return headingBreak(code2); + } + effects.consume(code2); + return data2; + } +} + +// node_modules/micromark-util-html-tag-name/index.js +var htmlBlockNames = [ + "address", + "article", + "aside", + "base", + "basefont", + "blockquote", + "body", + "caption", + "center", + "col", + "colgroup", + "dd", + "details", + "dialog", + "dir", + "div", + "dl", + "dt", + "fieldset", + "figcaption", + "figure", + "footer", + "form", + "frame", + "frameset", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hr", + "html", + "iframe", + "legend", + "li", + "link", + "main", + "menu", + "menuitem", + "nav", + "noframes", + "ol", + "optgroup", + "option", + "p", + "param", + "section", + "summary", + "table", + "tbody", + "td", + "tfoot", + "th", + "thead", + "title", + "tr", + "track", + "ul" +]; +var htmlRawNames = ["pre", "script", "style", "textarea"]; + +// node_modules/micromark-core-commonmark/lib/html-flow.js +var htmlFlow = { + name: "htmlFlow", + tokenize: tokenizeHtmlFlow, + resolveTo: resolveToHtmlFlow, + concrete: true +}; +var nextBlankConstruct = { + tokenize: tokenizeNextBlank, + partial: true +}; +function resolveToHtmlFlow(events) { + let index2 = events.length; + while (index2--) { + if (events[index2][0] === "enter" && events[index2][1].type === "htmlFlow") { + break; + } + } + if (index2 > 1 && events[index2 - 2][1].type === "linePrefix") { + events[index2][1].start = events[index2 - 2][1].start; + events[index2 + 1][1].start = events[index2 - 2][1].start; + events.splice(index2 - 2, 2); + } + return events; +} +function tokenizeHtmlFlow(effects, ok2, nok) { + const self2 = this; + let kind; + let startTag; + let buffer2; + let index2; + let marker; + return start3; + function start3(code2) { + effects.enter("htmlFlow"); + effects.enter("htmlFlowData"); + effects.consume(code2); + return open; + } + function open(code2) { + if (code2 === 33) { + effects.consume(code2); + return declarationStart; + } + if (code2 === 47) { + effects.consume(code2); + return tagCloseStart; + } + if (code2 === 63) { + effects.consume(code2); + kind = 3; + return self2.interrupt ? ok2 : continuationDeclarationInside; + } + if (asciiAlpha(code2)) { + effects.consume(code2); + buffer2 = String.fromCharCode(code2); + startTag = true; + return tagName; + } + return nok(code2); + } + function declarationStart(code2) { + if (code2 === 45) { + effects.consume(code2); + kind = 2; + return commentOpenInside; + } + if (code2 === 91) { + effects.consume(code2); + kind = 5; + buffer2 = "CDATA["; + index2 = 0; + return cdataOpenInside; + } + if (asciiAlpha(code2)) { + effects.consume(code2); + kind = 4; + return self2.interrupt ? ok2 : continuationDeclarationInside; + } + return nok(code2); + } + function commentOpenInside(code2) { + if (code2 === 45) { + effects.consume(code2); + return self2.interrupt ? ok2 : continuationDeclarationInside; + } + return nok(code2); + } + function cdataOpenInside(code2) { + if (code2 === buffer2.charCodeAt(index2++)) { + effects.consume(code2); + return index2 === buffer2.length ? self2.interrupt ? ok2 : continuation : cdataOpenInside; + } + return nok(code2); + } + function tagCloseStart(code2) { + if (asciiAlpha(code2)) { + effects.consume(code2); + buffer2 = String.fromCharCode(code2); + return tagName; + } + return nok(code2); + } + function tagName(code2) { + if (code2 === null || code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) { + if (code2 !== 47 && startTag && htmlRawNames.includes(buffer2.toLowerCase())) { + kind = 1; + return self2.interrupt ? ok2(code2) : continuation(code2); + } + if (htmlBlockNames.includes(buffer2.toLowerCase())) { + kind = 6; + if (code2 === 47) { + effects.consume(code2); + return basicSelfClosing; + } + return self2.interrupt ? ok2(code2) : continuation(code2); + } + kind = 7; + return self2.interrupt && !self2.parser.lazy[self2.now().line] ? nok(code2) : startTag ? completeAttributeNameBefore(code2) : completeClosingTagAfter(code2); + } + if (code2 === 45 || asciiAlphanumeric(code2)) { + effects.consume(code2); + buffer2 += String.fromCharCode(code2); + return tagName; + } + return nok(code2); + } + function basicSelfClosing(code2) { + if (code2 === 62) { + effects.consume(code2); + return self2.interrupt ? ok2 : continuation; + } + return nok(code2); + } + function completeClosingTagAfter(code2) { + if (markdownSpace(code2)) { + effects.consume(code2); + return completeClosingTagAfter; + } + return completeEnd(code2); + } + function completeAttributeNameBefore(code2) { + if (code2 === 47) { + effects.consume(code2); + return completeEnd; + } + if (code2 === 58 || code2 === 95 || asciiAlpha(code2)) { + effects.consume(code2); + return completeAttributeName; + } + if (markdownSpace(code2)) { + effects.consume(code2); + return completeAttributeNameBefore; + } + return completeEnd(code2); + } + function completeAttributeName(code2) { + if (code2 === 45 || code2 === 46 || code2 === 58 || code2 === 95 || asciiAlphanumeric(code2)) { + effects.consume(code2); + return completeAttributeName; + } + return completeAttributeNameAfter(code2); + } + function completeAttributeNameAfter(code2) { + if (code2 === 61) { + effects.consume(code2); + return completeAttributeValueBefore; + } + if (markdownSpace(code2)) { + effects.consume(code2); + return completeAttributeNameAfter; + } + return completeAttributeNameBefore(code2); + } + function completeAttributeValueBefore(code2) { + if (code2 === null || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96) { + return nok(code2); + } + if (code2 === 34 || code2 === 39) { + effects.consume(code2); + marker = code2; + return completeAttributeValueQuoted; + } + if (markdownSpace(code2)) { + effects.consume(code2); + return completeAttributeValueBefore; + } + marker = null; + return completeAttributeValueUnquoted(code2); + } + function completeAttributeValueQuoted(code2) { + if (code2 === null || markdownLineEnding(code2)) { + return nok(code2); + } + if (code2 === marker) { + effects.consume(code2); + return completeAttributeValueQuotedAfter; + } + effects.consume(code2); + return completeAttributeValueQuoted; + } + function completeAttributeValueUnquoted(code2) { + if (code2 === null || code2 === 34 || code2 === 39 || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96 || markdownLineEndingOrSpace(code2)) { + return completeAttributeNameAfter(code2); + } + effects.consume(code2); + return completeAttributeValueUnquoted; + } + function completeAttributeValueQuotedAfter(code2) { + if (code2 === 47 || code2 === 62 || markdownSpace(code2)) { + return completeAttributeNameBefore(code2); + } + return nok(code2); + } + function completeEnd(code2) { + if (code2 === 62) { + effects.consume(code2); + return completeAfter; + } + return nok(code2); + } + function completeAfter(code2) { + if (markdownSpace(code2)) { + effects.consume(code2); + return completeAfter; + } + return code2 === null || markdownLineEnding(code2) ? continuation(code2) : nok(code2); + } + function continuation(code2) { + if (code2 === 45 && kind === 2) { + effects.consume(code2); + return continuationCommentInside; + } + if (code2 === 60 && kind === 1) { + effects.consume(code2); + return continuationRawTagOpen; + } + if (code2 === 62 && kind === 4) { + effects.consume(code2); + return continuationClose; + } + if (code2 === 63 && kind === 3) { + effects.consume(code2); + return continuationDeclarationInside; + } + if (code2 === 93 && kind === 5) { + effects.consume(code2); + return continuationCharacterDataInside; + } + if (markdownLineEnding(code2) && (kind === 6 || kind === 7)) { + return effects.check( + nextBlankConstruct, + continuationClose, + continuationAtLineEnding + )(code2); + } + if (code2 === null || markdownLineEnding(code2)) { + return continuationAtLineEnding(code2); + } + effects.consume(code2); + return continuation; + } + function continuationAtLineEnding(code2) { + effects.exit("htmlFlowData"); + return htmlContinueStart(code2); + } + function htmlContinueStart(code2) { + if (code2 === null) { + return done(code2); + } + if (markdownLineEnding(code2)) { + return effects.attempt( + { + tokenize: htmlLineEnd, + partial: true + }, + htmlContinueStart, + done + )(code2); + } + effects.enter("htmlFlowData"); + return continuation(code2); + } + function htmlLineEnd(effects2, ok3, nok2) { + return start4; + function start4(code2) { + effects2.enter("lineEnding"); + effects2.consume(code2); + effects2.exit("lineEnding"); + return lineStart; + } + function lineStart(code2) { + return self2.parser.lazy[self2.now().line] ? nok2(code2) : ok3(code2); + } + } + function continuationCommentInside(code2) { + if (code2 === 45) { + effects.consume(code2); + return continuationDeclarationInside; + } + return continuation(code2); + } + function continuationRawTagOpen(code2) { + if (code2 === 47) { + effects.consume(code2); + buffer2 = ""; + return continuationRawEndTag; + } + return continuation(code2); + } + function continuationRawEndTag(code2) { + if (code2 === 62 && htmlRawNames.includes(buffer2.toLowerCase())) { + effects.consume(code2); + return continuationClose; + } + if (asciiAlpha(code2) && buffer2.length < 8) { + effects.consume(code2); + buffer2 += String.fromCharCode(code2); + return continuationRawEndTag; + } + return continuation(code2); + } + function continuationCharacterDataInside(code2) { + if (code2 === 93) { + effects.consume(code2); + return continuationDeclarationInside; + } + return continuation(code2); + } + function continuationDeclarationInside(code2) { + if (code2 === 62) { + effects.consume(code2); + return continuationClose; + } + if (code2 === 45 && kind === 2) { + effects.consume(code2); + return continuationDeclarationInside; + } + return continuation(code2); + } + function continuationClose(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("htmlFlowData"); + return done(code2); + } + effects.consume(code2); + return continuationClose; + } + function done(code2) { + effects.exit("htmlFlow"); + return ok2(code2); + } +} +function tokenizeNextBlank(effects, ok2, nok) { + return start3; + function start3(code2) { + effects.exit("htmlFlowData"); + effects.enter("lineEndingBlank"); + effects.consume(code2); + effects.exit("lineEndingBlank"); + return effects.attempt(blankLine, ok2, nok); + } +} + +// node_modules/micromark-core-commonmark/lib/html-text.js +var htmlText = { + name: "htmlText", + tokenize: tokenizeHtmlText +}; +function tokenizeHtmlText(effects, ok2, nok) { + const self2 = this; + let marker; + let buffer2; + let index2; + let returnState; + return start3; + function start3(code2) { + effects.enter("htmlText"); + effects.enter("htmlTextData"); + effects.consume(code2); + return open; + } + function open(code2) { + if (code2 === 33) { + effects.consume(code2); + return declarationOpen; + } + if (code2 === 47) { + effects.consume(code2); + return tagCloseStart; + } + if (code2 === 63) { + effects.consume(code2); + return instruction; + } + if (asciiAlpha(code2)) { + effects.consume(code2); + return tagOpen; + } + return nok(code2); + } + function declarationOpen(code2) { + if (code2 === 45) { + effects.consume(code2); + return commentOpen; + } + if (code2 === 91) { + effects.consume(code2); + buffer2 = "CDATA["; + index2 = 0; + return cdataOpen; + } + if (asciiAlpha(code2)) { + effects.consume(code2); + return declaration; + } + return nok(code2); + } + function commentOpen(code2) { + if (code2 === 45) { + effects.consume(code2); + return commentStart; + } + return nok(code2); + } + function commentStart(code2) { + if (code2 === null || code2 === 62) { + return nok(code2); + } + if (code2 === 45) { + effects.consume(code2); + return commentStartDash; + } + return comment2(code2); + } + function commentStartDash(code2) { + if (code2 === null || code2 === 62) { + return nok(code2); + } + return comment2(code2); + } + function comment2(code2) { + if (code2 === null) { + return nok(code2); + } + if (code2 === 45) { + effects.consume(code2); + return commentClose; + } + if (markdownLineEnding(code2)) { + returnState = comment2; + return atLineEnding(code2); + } + effects.consume(code2); + return comment2; + } + function commentClose(code2) { + if (code2 === 45) { + effects.consume(code2); + return end; + } + return comment2(code2); + } + function cdataOpen(code2) { + if (code2 === buffer2.charCodeAt(index2++)) { + effects.consume(code2); + return index2 === buffer2.length ? cdata : cdataOpen; + } + return nok(code2); + } + function cdata(code2) { + if (code2 === null) { + return nok(code2); + } + if (code2 === 93) { + effects.consume(code2); + return cdataClose; + } + if (markdownLineEnding(code2)) { + returnState = cdata; + return atLineEnding(code2); + } + effects.consume(code2); + return cdata; + } + function cdataClose(code2) { + if (code2 === 93) { + effects.consume(code2); + return cdataEnd; + } + return cdata(code2); + } + function cdataEnd(code2) { + if (code2 === 62) { + return end(code2); + } + if (code2 === 93) { + effects.consume(code2); + return cdataEnd; + } + return cdata(code2); + } + function declaration(code2) { + if (code2 === null || code2 === 62) { + return end(code2); + } + if (markdownLineEnding(code2)) { + returnState = declaration; + return atLineEnding(code2); + } + effects.consume(code2); + return declaration; + } + function instruction(code2) { + if (code2 === null) { + return nok(code2); + } + if (code2 === 63) { + effects.consume(code2); + return instructionClose; + } + if (markdownLineEnding(code2)) { + returnState = instruction; + return atLineEnding(code2); + } + effects.consume(code2); + return instruction; + } + function instructionClose(code2) { + return code2 === 62 ? end(code2) : instruction(code2); + } + function tagCloseStart(code2) { + if (asciiAlpha(code2)) { + effects.consume(code2); + return tagClose; + } + return nok(code2); + } + function tagClose(code2) { + if (code2 === 45 || asciiAlphanumeric(code2)) { + effects.consume(code2); + return tagClose; + } + return tagCloseBetween(code2); + } + function tagCloseBetween(code2) { + if (markdownLineEnding(code2)) { + returnState = tagCloseBetween; + return atLineEnding(code2); + } + if (markdownSpace(code2)) { + effects.consume(code2); + return tagCloseBetween; + } + return end(code2); + } + function tagOpen(code2) { + if (code2 === 45 || asciiAlphanumeric(code2)) { + effects.consume(code2); + return tagOpen; + } + if (code2 === 47 || code2 === 62 || markdownLineEndingOrSpace(code2)) { + return tagOpenBetween(code2); + } + return nok(code2); + } + function tagOpenBetween(code2) { + if (code2 === 47) { + effects.consume(code2); + return end; + } + if (code2 === 58 || code2 === 95 || asciiAlpha(code2)) { + effects.consume(code2); + return tagOpenAttributeName; + } + if (markdownLineEnding(code2)) { + returnState = tagOpenBetween; + return atLineEnding(code2); + } + if (markdownSpace(code2)) { + effects.consume(code2); + return tagOpenBetween; + } + return end(code2); + } + function tagOpenAttributeName(code2) { + if (code2 === 45 || code2 === 46 || code2 === 58 || code2 === 95 || asciiAlphanumeric(code2)) { + effects.consume(code2); + return tagOpenAttributeName; + } + return tagOpenAttributeNameAfter(code2); + } + function tagOpenAttributeNameAfter(code2) { + if (code2 === 61) { + effects.consume(code2); + return tagOpenAttributeValueBefore; + } + if (markdownLineEnding(code2)) { + returnState = tagOpenAttributeNameAfter; + return atLineEnding(code2); + } + if (markdownSpace(code2)) { + effects.consume(code2); + return tagOpenAttributeNameAfter; + } + return tagOpenBetween(code2); + } + function tagOpenAttributeValueBefore(code2) { + if (code2 === null || code2 === 60 || code2 === 61 || code2 === 62 || code2 === 96) { + return nok(code2); + } + if (code2 === 34 || code2 === 39) { + effects.consume(code2); + marker = code2; + return tagOpenAttributeValueQuoted; + } + if (markdownLineEnding(code2)) { + returnState = tagOpenAttributeValueBefore; + return atLineEnding(code2); + } + if (markdownSpace(code2)) { + effects.consume(code2); + return tagOpenAttributeValueBefore; + } + effects.consume(code2); + marker = void 0; + return tagOpenAttributeValueUnquoted; + } + function tagOpenAttributeValueQuoted(code2) { + if (code2 === marker) { + effects.consume(code2); + return tagOpenAttributeValueQuotedAfter; + } + if (code2 === null) { + return nok(code2); + } + if (markdownLineEnding(code2)) { + returnState = tagOpenAttributeValueQuoted; + return atLineEnding(code2); + } + effects.consume(code2); + return tagOpenAttributeValueQuoted; + } + function tagOpenAttributeValueQuotedAfter(code2) { + if (code2 === 62 || code2 === 47 || markdownLineEndingOrSpace(code2)) { + return tagOpenBetween(code2); + } + return nok(code2); + } + function tagOpenAttributeValueUnquoted(code2) { + if (code2 === null || code2 === 34 || code2 === 39 || code2 === 60 || code2 === 61 || code2 === 96) { + return nok(code2); + } + if (code2 === 62 || markdownLineEndingOrSpace(code2)) { + return tagOpenBetween(code2); + } + effects.consume(code2); + return tagOpenAttributeValueUnquoted; + } + function atLineEnding(code2) { + effects.exit("htmlTextData"); + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return factorySpace( + effects, + afterPrefix, + "linePrefix", + self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + ); + } + function afterPrefix(code2) { + effects.enter("htmlTextData"); + return returnState(code2); + } + function end(code2) { + if (code2 === 62) { + effects.consume(code2); + effects.exit("htmlTextData"); + effects.exit("htmlText"); + return ok2; + } + return nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/label-end.js +var labelEnd = { + name: "labelEnd", + tokenize: tokenizeLabelEnd, + resolveTo: resolveToLabelEnd, + resolveAll: resolveAllLabelEnd +}; +var resourceConstruct = { + tokenize: tokenizeResource +}; +var fullReferenceConstruct = { + tokenize: tokenizeFullReference +}; +var collapsedReferenceConstruct = { + tokenize: tokenizeCollapsedReference +}; +function resolveAllLabelEnd(events) { + let index2 = -1; + let token; + while (++index2 < events.length) { + token = events[index2][1]; + if (token.type === "labelImage" || token.type === "labelLink" || token.type === "labelEnd") { + events.splice(index2 + 1, token.type === "labelImage" ? 4 : 2); + token.type = "data"; + index2++; + } + } + return events; +} +function resolveToLabelEnd(events, context) { + let index2 = events.length; + let offset2 = 0; + let token; + let open; + let close; + let media; + while (index2--) { + token = events[index2][1]; + if (open) { + if (token.type === "link" || token.type === "labelLink" && token._inactive) { + break; + } + if (events[index2][0] === "enter" && token.type === "labelLink") { + token._inactive = true; + } + } else if (close) { + if (events[index2][0] === "enter" && (token.type === "labelImage" || token.type === "labelLink") && !token._balanced) { + open = index2; + if (token.type !== "labelLink") { + offset2 = 2; + break; + } + } + } else if (token.type === "labelEnd") { + close = index2; + } + } + const group = { + type: events[open][1].type === "labelLink" ? "link" : "image", + start: Object.assign({}, events[open][1].start), + end: Object.assign({}, events[events.length - 1][1].end) + }; + const label = { + type: "label", + start: Object.assign({}, events[open][1].start), + end: Object.assign({}, events[close][1].end) + }; + const text5 = { + type: "labelText", + start: Object.assign({}, events[open + offset2 + 2][1].end), + end: Object.assign({}, events[close - 2][1].start) + }; + media = [ + ["enter", group, context], + ["enter", label, context] + ]; + media = push(media, events.slice(open + 1, open + offset2 + 3)); + media = push(media, [["enter", text5, context]]); + media = push( + media, + resolveAll( + context.parser.constructs.insideSpan.null, + events.slice(open + offset2 + 4, close - 3), + context + ) + ); + media = push(media, [ + ["exit", text5, context], + events[close - 2], + events[close - 1], + ["exit", label, context] + ]); + media = push(media, events.slice(close + 1)); + media = push(media, [["exit", group, context]]); + splice(events, open, events.length, media); + return events; +} +function tokenizeLabelEnd(effects, ok2, nok) { + const self2 = this; + let index2 = self2.events.length; + let labelStart; + let defined; + while (index2--) { + if ((self2.events[index2][1].type === "labelImage" || self2.events[index2][1].type === "labelLink") && !self2.events[index2][1]._balanced) { + labelStart = self2.events[index2][1]; + break; + } + } + return start3; + function start3(code2) { + if (!labelStart) { + return nok(code2); + } + if (labelStart._inactive) + return balanced(code2); + defined = self2.parser.defined.includes( + normalizeIdentifier( + self2.sliceSerialize({ + start: labelStart.end, + end: self2.now() + }) + ) + ); + effects.enter("labelEnd"); + effects.enter("labelMarker"); + effects.consume(code2); + effects.exit("labelMarker"); + effects.exit("labelEnd"); + return afterLabelEnd; + } + function afterLabelEnd(code2) { + if (code2 === 40) { + return effects.attempt( + resourceConstruct, + ok2, + defined ? ok2 : balanced + )(code2); + } + if (code2 === 91) { + return effects.attempt( + fullReferenceConstruct, + ok2, + defined ? effects.attempt(collapsedReferenceConstruct, ok2, balanced) : balanced + )(code2); + } + return defined ? ok2(code2) : balanced(code2); + } + function balanced(code2) { + labelStart._balanced = true; + return nok(code2); + } +} +function tokenizeResource(effects, ok2, nok) { + return start3; + function start3(code2) { + effects.enter("resource"); + effects.enter("resourceMarker"); + effects.consume(code2); + effects.exit("resourceMarker"); + return factoryWhitespace(effects, open); + } + function open(code2) { + if (code2 === 41) { + return end(code2); + } + return factoryDestination( + effects, + destinationAfter, + nok, + "resourceDestination", + "resourceDestinationLiteral", + "resourceDestinationLiteralMarker", + "resourceDestinationRaw", + "resourceDestinationString", + 32 + )(code2); + } + function destinationAfter(code2) { + return markdownLineEndingOrSpace(code2) ? factoryWhitespace(effects, between)(code2) : end(code2); + } + function between(code2) { + if (code2 === 34 || code2 === 39 || code2 === 40) { + return factoryTitle( + effects, + factoryWhitespace(effects, end), + nok, + "resourceTitle", + "resourceTitleMarker", + "resourceTitleString" + )(code2); + } + return end(code2); + } + function end(code2) { + if (code2 === 41) { + effects.enter("resourceMarker"); + effects.consume(code2); + effects.exit("resourceMarker"); + effects.exit("resource"); + return ok2; + } + return nok(code2); + } +} +function tokenizeFullReference(effects, ok2, nok) { + const self2 = this; + return start3; + function start3(code2) { + return factoryLabel.call( + self2, + effects, + afterLabel, + nok, + "reference", + "referenceMarker", + "referenceString" + )(code2); + } + function afterLabel(code2) { + return self2.parser.defined.includes( + normalizeIdentifier( + self2.sliceSerialize(self2.events[self2.events.length - 1][1]).slice(1, -1) + ) + ) ? ok2(code2) : nok(code2); + } +} +function tokenizeCollapsedReference(effects, ok2, nok) { + return start3; + function start3(code2) { + effects.enter("reference"); + effects.enter("referenceMarker"); + effects.consume(code2); + effects.exit("referenceMarker"); + return open; + } + function open(code2) { + if (code2 === 93) { + effects.enter("referenceMarker"); + effects.consume(code2); + effects.exit("referenceMarker"); + effects.exit("reference"); + return ok2; + } + return nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/label-start-image.js +var labelStartImage = { + name: "labelStartImage", + tokenize: tokenizeLabelStartImage, + resolveAll: labelEnd.resolveAll +}; +function tokenizeLabelStartImage(effects, ok2, nok) { + const self2 = this; + return start3; + function start3(code2) { + effects.enter("labelImage"); + effects.enter("labelImageMarker"); + effects.consume(code2); + effects.exit("labelImageMarker"); + return open; + } + function open(code2) { + if (code2 === 91) { + effects.enter("labelMarker"); + effects.consume(code2); + effects.exit("labelMarker"); + effects.exit("labelImage"); + return after; + } + return nok(code2); + } + function after(code2) { + return code2 === 94 && "_hiddenFootnoteSupport" in self2.parser.constructs ? nok(code2) : ok2(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/label-start-link.js +var labelStartLink = { + name: "labelStartLink", + tokenize: tokenizeLabelStartLink, + resolveAll: labelEnd.resolveAll +}; +function tokenizeLabelStartLink(effects, ok2, nok) { + const self2 = this; + return start3; + function start3(code2) { + effects.enter("labelLink"); + effects.enter("labelMarker"); + effects.consume(code2); + effects.exit("labelMarker"); + effects.exit("labelLink"); + return after; + } + function after(code2) { + return code2 === 94 && "_hiddenFootnoteSupport" in self2.parser.constructs ? nok(code2) : ok2(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/line-ending.js +var lineEnding = { + name: "lineEnding", + tokenize: tokenizeLineEnding +}; +function tokenizeLineEnding(effects, ok2) { + return start3; + function start3(code2) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return factorySpace(effects, ok2, "linePrefix"); + } +} + +// node_modules/micromark-core-commonmark/lib/thematic-break.js +var thematicBreak = { + name: "thematicBreak", + tokenize: tokenizeThematicBreak +}; +function tokenizeThematicBreak(effects, ok2, nok) { + let size = 0; + let marker; + return start3; + function start3(code2) { + effects.enter("thematicBreak"); + marker = code2; + return atBreak(code2); + } + function atBreak(code2) { + if (code2 === marker) { + effects.enter("thematicBreakSequence"); + return sequence(code2); + } + if (markdownSpace(code2)) { + return factorySpace(effects, atBreak, "whitespace")(code2); + } + if (size < 3 || code2 !== null && !markdownLineEnding(code2)) { + return nok(code2); + } + effects.exit("thematicBreak"); + return ok2(code2); + } + function sequence(code2) { + if (code2 === marker) { + effects.consume(code2); + size++; + return sequence; + } + effects.exit("thematicBreakSequence"); + return atBreak(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/list.js +var list = { + name: "list", + tokenize: tokenizeListStart, + continuation: { + tokenize: tokenizeListContinuation + }, + exit: tokenizeListEnd +}; +var listItemPrefixWhitespaceConstruct = { + tokenize: tokenizeListItemPrefixWhitespace, + partial: true +}; +var indentConstruct = { + tokenize: tokenizeIndent, + partial: true +}; +function tokenizeListStart(effects, ok2, nok) { + const self2 = this; + const tail = self2.events[self2.events.length - 1]; + let initialSize = tail && tail[1].type === "linePrefix" ? tail[2].sliceSerialize(tail[1], true).length : 0; + let size = 0; + return start3; + function start3(code2) { + const kind = self2.containerState.type || (code2 === 42 || code2 === 43 || code2 === 45 ? "listUnordered" : "listOrdered"); + if (kind === "listUnordered" ? !self2.containerState.marker || code2 === self2.containerState.marker : asciiDigit(code2)) { + if (!self2.containerState.type) { + self2.containerState.type = kind; + effects.enter(kind, { + _container: true + }); + } + if (kind === "listUnordered") { + effects.enter("listItemPrefix"); + return code2 === 42 || code2 === 45 ? effects.check(thematicBreak, nok, atMarker)(code2) : atMarker(code2); + } + if (!self2.interrupt || code2 === 49) { + effects.enter("listItemPrefix"); + effects.enter("listItemValue"); + return inside(code2); + } + } + return nok(code2); + } + function inside(code2) { + if (asciiDigit(code2) && ++size < 10) { + effects.consume(code2); + return inside; + } + if ((!self2.interrupt || size < 2) && (self2.containerState.marker ? code2 === self2.containerState.marker : code2 === 41 || code2 === 46)) { + effects.exit("listItemValue"); + return atMarker(code2); + } + return nok(code2); + } + function atMarker(code2) { + effects.enter("listItemMarker"); + effects.consume(code2); + effects.exit("listItemMarker"); + self2.containerState.marker = self2.containerState.marker || code2; + return effects.check( + blankLine, + self2.interrupt ? nok : onBlank, + effects.attempt( + listItemPrefixWhitespaceConstruct, + endOfPrefix, + otherPrefix + ) + ); + } + function onBlank(code2) { + self2.containerState.initialBlankLine = true; + initialSize++; + return endOfPrefix(code2); + } + function otherPrefix(code2) { + if (markdownSpace(code2)) { + effects.enter("listItemPrefixWhitespace"); + effects.consume(code2); + effects.exit("listItemPrefixWhitespace"); + return endOfPrefix; + } + return nok(code2); + } + function endOfPrefix(code2) { + self2.containerState.size = initialSize + self2.sliceSerialize(effects.exit("listItemPrefix"), true).length; + return ok2(code2); + } +} +function tokenizeListContinuation(effects, ok2, nok) { + const self2 = this; + self2.containerState._closeFlow = void 0; + return effects.check(blankLine, onBlank, notBlank); + function onBlank(code2) { + self2.containerState.furtherBlankLines = self2.containerState.furtherBlankLines || self2.containerState.initialBlankLine; + return factorySpace( + effects, + ok2, + "listItemIndent", + self2.containerState.size + 1 + )(code2); + } + function notBlank(code2) { + if (self2.containerState.furtherBlankLines || !markdownSpace(code2)) { + self2.containerState.furtherBlankLines = void 0; + self2.containerState.initialBlankLine = void 0; + return notInCurrentItem(code2); + } + self2.containerState.furtherBlankLines = void 0; + self2.containerState.initialBlankLine = void 0; + return effects.attempt(indentConstruct, ok2, notInCurrentItem)(code2); + } + function notInCurrentItem(code2) { + self2.containerState._closeFlow = true; + self2.interrupt = void 0; + return factorySpace( + effects, + effects.attempt(list, ok2, nok), + "linePrefix", + self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + )(code2); + } +} +function tokenizeIndent(effects, ok2, nok) { + const self2 = this; + return factorySpace( + effects, + afterPrefix, + "listItemIndent", + self2.containerState.size + 1 + ); + function afterPrefix(code2) { + const tail = self2.events[self2.events.length - 1]; + return tail && tail[1].type === "listItemIndent" && tail[2].sliceSerialize(tail[1], true).length === self2.containerState.size ? ok2(code2) : nok(code2); + } +} +function tokenizeListEnd(effects) { + effects.exit(this.containerState.type); +} +function tokenizeListItemPrefixWhitespace(effects, ok2, nok) { + const self2 = this; + return factorySpace( + effects, + afterPrefix, + "listItemPrefixWhitespace", + self2.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + 1 + ); + function afterPrefix(code2) { + const tail = self2.events[self2.events.length - 1]; + return !markdownSpace(code2) && tail && tail[1].type === "listItemPrefixWhitespace" ? ok2(code2) : nok(code2); + } +} + +// node_modules/micromark-core-commonmark/lib/setext-underline.js +var setextUnderline = { + name: "setextUnderline", + tokenize: tokenizeSetextUnderline, + resolveTo: resolveToSetextUnderline +}; +function resolveToSetextUnderline(events, context) { + let index2 = events.length; + let content3; + let text5; + let definition2; + while (index2--) { + if (events[index2][0] === "enter") { + if (events[index2][1].type === "content") { + content3 = index2; + break; + } + if (events[index2][1].type === "paragraph") { + text5 = index2; + } + } else { + if (events[index2][1].type === "content") { + events.splice(index2, 1); + } + if (!definition2 && events[index2][1].type === "definition") { + definition2 = index2; + } + } + } + const heading2 = { + type: "setextHeading", + start: Object.assign({}, events[text5][1].start), + end: Object.assign({}, events[events.length - 1][1].end) + }; + events[text5][1].type = "setextHeadingText"; + if (definition2) { + events.splice(text5, 0, ["enter", heading2, context]); + events.splice(definition2 + 1, 0, ["exit", events[content3][1], context]); + events[content3][1].end = Object.assign({}, events[definition2][1].end); + } else { + events[content3][1] = heading2; + } + events.push(["exit", heading2, context]); + return events; +} +function tokenizeSetextUnderline(effects, ok2, nok) { + const self2 = this; + let index2 = self2.events.length; + let marker; + let paragraph2; + while (index2--) { + if (self2.events[index2][1].type !== "lineEnding" && self2.events[index2][1].type !== "linePrefix" && self2.events[index2][1].type !== "content") { + paragraph2 = self2.events[index2][1].type === "paragraph"; + break; + } + } + return start3; + function start3(code2) { + if (!self2.parser.lazy[self2.now().line] && (self2.interrupt || paragraph2)) { + effects.enter("setextHeadingLine"); + effects.enter("setextHeadingLineSequence"); + marker = code2; + return closingSequence(code2); + } + return nok(code2); + } + function closingSequence(code2) { + if (code2 === marker) { + effects.consume(code2); + return closingSequence; + } + effects.exit("setextHeadingLineSequence"); + return factorySpace(effects, closingSequenceEnd, "lineSuffix")(code2); + } + function closingSequenceEnd(code2) { + if (code2 === null || markdownLineEnding(code2)) { + effects.exit("setextHeadingLine"); + return ok2(code2); + } + return nok(code2); + } +} + +// node_modules/micromark-extension-mdxjs-esm/lib/syntax.js +var nextBlankConstruct2 = { + tokenize: tokenizeNextBlank2, + partial: true +}; +var allowedAcornTypes = /* @__PURE__ */ new Set([ + "ExportAllDeclaration", + "ExportDefaultDeclaration", + "ExportNamedDeclaration", + "ImportDeclaration" +]); +function mdxjsEsm(options) { + const exportImportConstruct = { + tokenize: tokenizeExportImport, + concrete: true + }; + if (!options || !options.acorn || !options.acorn.parse) { + throw new Error("Expected an `acorn` instance passed in as `options.acorn`"); + } + const acorn = options.acorn; + const acornOptions = Object.assign( + { + ecmaVersion: 2020, + sourceType: "module" + }, + options.acornOptions + ); + return { + flow: { + [101]: exportImportConstruct, + [105]: exportImportConstruct + } + }; + function tokenizeExportImport(effects, ok2, nok) { + const self2 = this; + const definedModuleSpecifiers = self2.parser.definedModuleSpecifiers || (self2.parser.definedModuleSpecifiers = []); + const eventStart = this.events.length + 1; + let index2 = 0; + let buffer2; + return self2.interrupt ? nok : start3; + function start3(code2) { + if (self2.now().column > 1) + return nok(code2); + buffer2 = code2 === 101 ? "export" : "import"; + effects.enter("mdxjsEsm"); + effects.enter("mdxjsEsmData"); + return keyword(code2); + } + function keyword(code2) { + if (code2 === buffer2.charCodeAt(index2++)) { + effects.consume(code2); + return index2 === buffer2.length ? after : keyword; + } + return nok(code2); + } + function after(code2) { + if (unicodeWhitespace(code2)) { + effects.consume(code2); + return rest; + } + return nok(code2); + } + function rest(code2) { + if (code2 === null) { + return atEndOfData(code2); + } + if (markdownLineEnding(code2)) { + return effects.check(nextBlankConstruct2, atEndOfData, atEol)(code2); + } + effects.consume(code2); + return rest; + } + function atEol(code2) { + effects.exit("mdxjsEsmData"); + return lineStart(code2); + } + function lineStart(code2) { + if (markdownLineEnding(code2)) { + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return lineStart; + } + if (code2 === null) { + return atEnd(code2); + } + effects.enter("mdxjsEsmData"); + return rest(code2); + } + function atEndOfData(code2) { + effects.exit("mdxjsEsmData"); + return atEnd(code2); + } + function atEnd(code2) { + let index3 = -1; + const result = eventsToAcorn(self2.events.slice(eventStart), { + acorn, + acornOptions, + prefix: definedModuleSpecifiers.length > 0 ? "var " + definedModuleSpecifiers.join(",") + "\n" : "" + }); + if (code2 !== null && result.swallow) { + return lineStart(code2); + } + if (result.error) { + throw new VFileMessage( + "Could not parse import/exports with acorn: " + String(result.error), + { + line: result.error.loc.line, + column: result.error.loc.column + 1, + offset: result.error.pos + }, + "micromark-extension-mdxjs-esm:acorn" + ); + } + if (definedModuleSpecifiers.length > 0) { + result.estree.body.shift(); + } + while (++index3 < result.estree.body.length) { + const node = result.estree.body[index3]; + if (!allowedAcornTypes.has(node.type)) { + throw new VFileMessage( + "Unexpected `" + node.type + "` in code: only import/exports are supported", + positionFromEstree(node), + "micromark-extension-mdxjs-esm:non-esm" + ); + } + if (node.type === "ImportDeclaration" && !self2.interrupt) { + let index4 = -1; + while (++index4 < node.specifiers.length) { + definedModuleSpecifiers.push(node.specifiers[index4].local.name); + } + } + } + Object.assign( + effects.exit("mdxjsEsm"), + options.addResult ? { + estree: result.estree + } : void 0 + ); + return ok2(code2); + } + } +} +function tokenizeNextBlank2(effects, ok2, nok) { + return start3; + function start3(code2) { + effects.exit("mdxjsEsmData"); + effects.enter("lineEndingBlank"); + effects.consume(code2); + effects.exit("lineEndingBlank"); + return effects.attempt(blankLine, ok2, nok); + } +} + +// node_modules/micromark-extension-mdxjs/index.js +function mdxjs(options) { + const settings = Object.assign( + { + acorn: Parser.extend((0, import_acorn_jsx.default)()), + acornOptions: { ecmaVersion: 2020, sourceType: "module" }, + addResult: true + }, + options + ); + return combineExtensions([ + mdxjsEsm(settings), + mdxExpression(settings), + mdxJsx(settings), + mdxMd + ]); +} + +// node_modules/mdast-util-mdx-expression/index.js +var mdxExpressionFromMarkdown = { + enter: { + mdxFlowExpression: enterMdxFlowExpression, + mdxTextExpression: enterMdxTextExpression + }, + exit: { + mdxFlowExpression: exitMdxExpression, + mdxFlowExpressionChunk: exitMdxExpressionData, + mdxTextExpression: exitMdxExpression, + mdxTextExpressionChunk: exitMdxExpressionData + } +}; +var mdxExpressionToMarkdown = { + handlers: { + mdxFlowExpression: handleMdxExpression, + mdxTextExpression: handleMdxExpression + }, + unsafe: [ + { character: "{", inConstruct: ["phrasing"] }, + { atBreak: true, character: "{" } + ] +}; +function enterMdxFlowExpression(token) { + this.enter({ type: "mdxFlowExpression", value: "" }, token); + this.buffer(); +} +function enterMdxTextExpression(token) { + this.enter({ type: "mdxTextExpression", value: "" }, token); + this.buffer(); +} +function exitMdxExpression(token) { + const value = this.resume(); + const estree = token.estree; + const node = this.exit(token); + node.value = value; + if (estree) { + node.data = { estree }; + } +} +function exitMdxExpressionData(token) { + this.config.enter.data.call(this, token); + this.config.exit.data.call(this, token); +} +function handleMdxExpression(node) { + const value = node.value || ""; + return "{" + value + "}"; +} + +// node_modules/mdast-util-mdx-jsx/node_modules/ccount/index.js +function ccount(value, character) { + const source = String(value); + if (typeof character !== "string") { + throw new TypeError("Expected character"); + } + let count = 0; + let index2 = source.indexOf(character); + while (index2 !== -1) { + count++; + index2 = source.indexOf(character, index2 + character.length); + } + return count; +} + +// node_modules/parse-entities/node_modules/character-entities-legacy/index.js +var characterEntitiesLegacy = [ + "AElig", + "AMP", + "Aacute", + "Acirc", + "Agrave", + "Aring", + "Atilde", + "Auml", + "COPY", + "Ccedil", + "ETH", + "Eacute", + "Ecirc", + "Egrave", + "Euml", + "GT", + "Iacute", + "Icirc", + "Igrave", + "Iuml", + "LT", + "Ntilde", + "Oacute", + "Ocirc", + "Ograve", + "Oslash", + "Otilde", + "Ouml", + "QUOT", + "REG", + "THORN", + "Uacute", + "Ucirc", + "Ugrave", + "Uuml", + "Yacute", + "aacute", + "acirc", + "acute", + "aelig", + "agrave", + "amp", + "aring", + "atilde", + "auml", + "brvbar", + "ccedil", + "cedil", + "cent", + "copy", + "curren", + "deg", + "divide", + "eacute", + "ecirc", + "egrave", + "eth", + "euml", + "frac12", + "frac14", + "frac34", + "gt", + "iacute", + "icirc", + "iexcl", + "igrave", + "iquest", + "iuml", + "laquo", + "lt", + "macr", + "micro", + "middot", + "nbsp", + "not", + "ntilde", + "oacute", + "ocirc", + "ograve", + "ordf", + "ordm", + "oslash", + "otilde", + "ouml", + "para", + "plusmn", + "pound", + "quot", + "raquo", + "reg", + "sect", + "shy", + "sup1", + "sup2", + "sup3", + "szlig", + "thorn", + "times", + "uacute", + "ucirc", + "ugrave", + "uml", + "uuml", + "yacute", + "yen", + "yuml" +]; + +// node_modules/character-reference-invalid/index.js +var characterReferenceInvalid = { + 0: "\uFFFD", + 128: "\u20AC", + 130: "\u201A", + 131: "\u0192", + 132: "\u201E", + 133: "\u2026", + 134: "\u2020", + 135: "\u2021", + 136: "\u02C6", + 137: "\u2030", + 138: "\u0160", + 139: "\u2039", + 140: "\u0152", + 142: "\u017D", + 145: "\u2018", + 146: "\u2019", + 147: "\u201C", + 148: "\u201D", + 149: "\u2022", + 150: "\u2013", + 151: "\u2014", + 152: "\u02DC", + 153: "\u2122", + 154: "\u0161", + 155: "\u203A", + 156: "\u0153", + 158: "\u017E", + 159: "\u0178" +}; + +// node_modules/parse-entities/node_modules/is-decimal/index.js +function isDecimal(character) { + const code2 = typeof character === "string" ? character.charCodeAt(0) : character; + return code2 >= 48 && code2 <= 57; +} + +// node_modules/is-hexadecimal/index.js +function isHexadecimal(character) { + const code2 = typeof character === "string" ? character.charCodeAt(0) : character; + return code2 >= 97 && code2 <= 102 || code2 >= 65 && code2 <= 70 || code2 >= 48 && code2 <= 57; +} + +// node_modules/is-alphanumerical/node_modules/is-alphabetical/index.js +function isAlphabetical(character) { + const code2 = typeof character === "string" ? character.charCodeAt(0) : character; + return code2 >= 97 && code2 <= 122 || code2 >= 65 && code2 <= 90; +} + +// node_modules/is-alphanumerical/node_modules/is-decimal/index.js +function isDecimal2(character) { + const code2 = typeof character === "string" ? character.charCodeAt(0) : character; + return code2 >= 48 && code2 <= 57; +} + +// node_modules/is-alphanumerical/index.js +function isAlphanumerical(character) { + return isAlphabetical(character) || isDecimal2(character); +} + +// node_modules/parse-entities/lib/index.js +var fromCharCode = String.fromCharCode; +var messages = [ + "", + "Named character references must be terminated by a semicolon", + "Numeric character references must be terminated by a semicolon", + "Named character references cannot be empty", + "Numeric character references cannot be empty", + "Named character references must be known", + "Numeric character references cannot be disallowed", + "Numeric character references cannot be outside the permissible Unicode range" +]; +function parseEntities(value, options = {}) { + const additional = typeof options.additional === "string" ? options.additional.charCodeAt(0) : options.additional; + const result = []; + let index2 = 0; + let lines = -1; + let queue = ""; + let point3; + let indent; + if (options.position) { + if ("start" in options.position || "indent" in options.position) { + indent = options.position.indent; + point3 = options.position.start; + } else { + point3 = options.position; + } + } + let line = (point3 ? point3.line : 0) || 1; + let column = (point3 ? point3.column : 0) || 1; + let previous2 = now(); + let character; + index2--; + while (++index2 <= value.length) { + if (character === 10) { + column = (indent ? indent[lines] : 0) || 1; + } + character = value.charCodeAt(index2); + if (character === 38) { + const following = value.charCodeAt(index2 + 1); + if (following === 9 || following === 10 || following === 12 || following === 32 || following === 38 || following === 60 || Number.isNaN(following) || additional && following === additional) { + queue += fromCharCode(character); + column++; + continue; + } + const start3 = index2 + 1; + let begin = start3; + let end = start3; + let type; + if (following === 35) { + end = ++begin; + const following2 = value.charCodeAt(end); + if (following2 === 88 || following2 === 120) { + type = "hexadecimal"; + end = ++begin; + } else { + type = "decimal"; + } + } else { + type = "named"; + } + let characterReferenceCharacters = ""; + let characterReference2 = ""; + let characters = ""; + const test = type === "named" ? isAlphanumerical : type === "decimal" ? isDecimal : isHexadecimal; + end--; + while (++end <= value.length) { + const following2 = value.charCodeAt(end); + if (!test(following2)) { + break; + } + characters += fromCharCode(following2); + if (type === "named" && characterEntitiesLegacy.includes(characters)) { + characterReferenceCharacters = characters; + characterReference2 = decodeNamedCharacterReference(characters); + } + } + let terminated = value.charCodeAt(end) === 59; + if (terminated) { + end++; + const namedReference = type === "named" ? decodeNamedCharacterReference(characters) : false; + if (namedReference) { + characterReferenceCharacters = characters; + characterReference2 = namedReference; + } + } + let diff = 1 + end - start3; + let reference = ""; + if (!terminated && options.nonTerminated === false) { + } else if (!characters) { + if (type !== "named") { + warning(4, diff); + } + } else if (type === "named") { + if (terminated && !characterReference2) { + warning(5, 1); + } else { + if (characterReferenceCharacters !== characters) { + end = begin + characterReferenceCharacters.length; + diff = 1 + end - begin; + terminated = false; + } + if (!terminated) { + const reason = characterReferenceCharacters ? 1 : 3; + if (options.attribute) { + const following2 = value.charCodeAt(end); + if (following2 === 61) { + warning(reason, diff); + characterReference2 = ""; + } else if (isAlphanumerical(following2)) { + characterReference2 = ""; + } else { + warning(reason, diff); + } + } else { + warning(reason, diff); + } + } + } + reference = characterReference2; + } else { + if (!terminated) { + warning(2, diff); + } + let referenceCode = Number.parseInt( + characters, + type === "hexadecimal" ? 16 : 10 + ); + if (prohibited(referenceCode)) { + warning(7, diff); + reference = fromCharCode(65533); + } else if (referenceCode in characterReferenceInvalid) { + warning(6, diff); + reference = characterReferenceInvalid[referenceCode]; + } else { + let output = ""; + if (disallowed(referenceCode)) { + warning(6, diff); + } + if (referenceCode > 65535) { + referenceCode -= 65536; + output += fromCharCode(referenceCode >>> (10 & 1023) | 55296); + referenceCode = 56320 | referenceCode & 1023; + } + reference = output + fromCharCode(referenceCode); + } + } + if (reference) { + flush(); + previous2 = now(); + index2 = end - 1; + column += end - start3 + 1; + result.push(reference); + const next = now(); + next.offset++; + if (options.reference) { + options.reference.call( + options.referenceContext, + reference, + { start: previous2, end: next }, + value.slice(start3 - 1, end) + ); + } + previous2 = next; + } else { + characters = value.slice(start3 - 1, end); + queue += characters; + column += characters.length; + index2 = end - 1; + } + } else { + if (character === 10) { + line++; + lines++; + column = 0; + } + if (Number.isNaN(character)) { + flush(); + } else { + queue += fromCharCode(character); + column++; + } + } + } + return result.join(""); + function now() { + return { + line, + column, + offset: index2 + ((point3 ? point3.offset : 0) || 0) + }; + } + function warning(code2, offset2) { + let position3; + if (options.warning) { + position3 = now(); + position3.column += offset2; + position3.offset += offset2; + options.warning.call( + options.warningContext, + messages[code2], + position3, + code2 + ); + } + } + function flush() { + if (queue) { + result.push(queue); + if (options.text) { + options.text.call(options.textContext, queue, { + start: previous2, + end: now() + }); + } + queue = ""; + } + } +} +function prohibited(code2) { + return code2 >= 55296 && code2 <= 57343 || code2 > 1114111; +} +function disallowed(code2) { + return code2 >= 1 && code2 <= 8 || code2 === 11 || code2 >= 13 && code2 <= 31 || code2 >= 127 && code2 <= 159 || code2 >= 64976 && code2 <= 65007 || (code2 & 65535) === 65535 || (code2 & 65535) === 65534; +} + +// node_modules/mdast-util-mdx-jsx/node_modules/stringify-entities/lib/core.js +function core(value, options) { + value = value.replace( + options.subset ? charactersToExpression(options.subset) : /["&'<>`]/g, + basic + ); + if (options.subset || options.escapeOnly) { + return value; + } + return value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, surrogate).replace( + /[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g, + basic + ); + function surrogate(pair, index2, all4) { + return options.format( + (pair.charCodeAt(0) - 55296) * 1024 + pair.charCodeAt(1) - 56320 + 65536, + all4.charCodeAt(index2 + 2), + options + ); + } + function basic(character, index2, all4) { + return options.format( + character.charCodeAt(0), + all4.charCodeAt(index2 + 1), + options + ); + } +} +function charactersToExpression(subset) { + const groups = []; + let index2 = -1; + while (++index2 < subset.length) { + groups.push(subset[index2].replace(/[|\\{}()[\]^$+*?.]/g, "\\$&")); + } + return new RegExp("(?:" + groups.join("|") + ")", "g"); +} + +// node_modules/mdast-util-mdx-jsx/node_modules/stringify-entities/lib/util/format-basic.js +function formatBasic(code2) { + return "&#x" + code2.toString(16).toUpperCase() + ";"; +} + +// node_modules/mdast-util-mdx-jsx/node_modules/stringify-entities/lib/index.js +function stringifyEntitiesLight(value, options) { + return core(value, Object.assign({ format: formatBasic }, options)); +} + +// node_modules/mdast-util-to-markdown/lib/util/track.js +function track(options_) { + const options = options_ || {}; + const now = options.now || {}; + let lineShift = options.lineShift || 0; + let line = now.line || 1; + let column = now.column || 1; + return { move, current: current2, shift }; + function current2() { + return { now: { line, column }, lineShift }; + } + function shift(value) { + lineShift += value; + } + function move(value = "") { + const chunks = value.split(/\r?\n|\r/g); + const tail = chunks[chunks.length - 1]; + line += chunks.length - 1; + column = chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift; + return value; + } +} + +// node_modules/mdast-util-to-markdown/lib/util/container-flow.js +function containerFlow(parent, context, safeOptions) { + const indexStack = context.indexStack; + const children = parent.children || []; + const tracker = track(safeOptions); + const results = []; + let index2 = -1; + indexStack.push(-1); + while (++index2 < children.length) { + const child = children[index2]; + indexStack[indexStack.length - 1] = index2; + results.push( + tracker.move( + context.handle(child, parent, context, { + before: "\n", + after: "\n", + ...tracker.current() + }) + ) + ); + if (child.type !== "list") { + context.bulletLastUsed = void 0; + } + if (index2 < children.length - 1) { + results.push(tracker.move(between(child, children[index2 + 1]))); + } + } + indexStack.pop(); + return results.join(""); + function between(left, right) { + let index3 = context.join.length; + while (index3--) { + const result = context.join[index3](left, right, parent, context); + if (result === true || result === 1) { + break; + } + if (typeof result === "number") { + return "\n".repeat(1 + result); + } + if (result === false) { + return "\n\n\n\n"; + } + } + return "\n\n"; + } +} + +// node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js +function containerPhrasing(parent, context, safeOptions) { + const indexStack = context.indexStack; + const children = parent.children || []; + const results = []; + let index2 = -1; + let before = safeOptions.before; + indexStack.push(-1); + let tracker = track(safeOptions); + while (++index2 < children.length) { + const child = children[index2]; + let after; + indexStack[indexStack.length - 1] = index2; + if (index2 + 1 < children.length) { + let handle = context.handle.handlers[children[index2 + 1].type]; + if (handle && handle.peek) + handle = handle.peek; + after = handle ? handle(children[index2 + 1], parent, context, { + before: "", + after: "", + ...tracker.current() + }).charAt(0) : ""; + } else { + after = safeOptions.after; + } + if (results.length > 0 && (before === "\r" || before === "\n") && child.type === "html") { + results[results.length - 1] = results[results.length - 1].replace( + /(\r?\n|\r)$/, + " " + ); + before = " "; + tracker = track(safeOptions); + tracker.move(results.join("")); + } + results.push( + tracker.move( + context.handle(child, parent, context, { + ...tracker.current(), + before, + after + }) + ) + ); + before = results[results.length - 1].slice(-1); + } + indexStack.pop(); + return results.join(""); +} + +// node_modules/mdast-util-to-markdown/lib/util/indent-lines.js +var eol = /\r?\n|\r/g; +function indentLines(value, map) { + const result = []; + let start3 = 0; + let line = 0; + let match; + while (match = eol.exec(value)) { + one3(value.slice(start3, match.index)); + result.push(match[0]); + start3 = match.index + match[0].length; + line++; + } + one3(value.slice(start3)); + return result.join(""); + function one3(value2) { + result.push(map(value2, line, !value2)); + } +} + +// node_modules/mdast-util-mdx-jsx/lib/index.js +function mdxJsxFromMarkdown() { + return { + canContainEols: ["mdxJsxTextElement"], + enter: { + mdxJsxFlowTag: enterMdxJsxTag, + mdxJsxFlowTagClosingMarker: enterMdxJsxTagClosingMarker, + mdxJsxFlowTagAttribute: enterMdxJsxTagAttribute, + mdxJsxFlowTagExpressionAttribute: enterMdxJsxTagExpressionAttribute, + mdxJsxFlowTagAttributeValueLiteral: buffer2, + mdxJsxFlowTagAttributeValueExpression: buffer2, + mdxJsxFlowTagSelfClosingMarker: enterMdxJsxTagSelfClosingMarker, + mdxJsxTextTag: enterMdxJsxTag, + mdxJsxTextTagClosingMarker: enterMdxJsxTagClosingMarker, + mdxJsxTextTagAttribute: enterMdxJsxTagAttribute, + mdxJsxTextTagExpressionAttribute: enterMdxJsxTagExpressionAttribute, + mdxJsxTextTagAttributeValueLiteral: buffer2, + mdxJsxTextTagAttributeValueExpression: buffer2, + mdxJsxTextTagSelfClosingMarker: enterMdxJsxTagSelfClosingMarker + }, + exit: { + mdxJsxFlowTagClosingMarker: exitMdxJsxTagClosingMarker, + mdxJsxFlowTagNamePrimary: exitMdxJsxTagNamePrimary, + mdxJsxFlowTagNameMember: exitMdxJsxTagNameMember, + mdxJsxFlowTagNameLocal: exitMdxJsxTagNameLocal, + mdxJsxFlowTagExpressionAttribute: exitMdxJsxTagExpressionAttribute, + mdxJsxFlowTagExpressionAttributeValue: data2, + mdxJsxFlowTagAttributeNamePrimary: exitMdxJsxTagAttributeNamePrimary, + mdxJsxFlowTagAttributeNameLocal: exitMdxJsxTagAttributeNameLocal, + mdxJsxFlowTagAttributeValueLiteral: exitMdxJsxTagAttributeValueLiteral, + mdxJsxFlowTagAttributeValueLiteralValue: data2, + mdxJsxFlowTagAttributeValueExpression: exitMdxJsxTagAttributeValueExpression, + mdxJsxFlowTagAttributeValueExpressionValue: data2, + mdxJsxFlowTagSelfClosingMarker: exitMdxJsxTagSelfClosingMarker, + mdxJsxFlowTag: exitMdxJsxTag, + mdxJsxTextTagClosingMarker: exitMdxJsxTagClosingMarker, + mdxJsxTextTagNamePrimary: exitMdxJsxTagNamePrimary, + mdxJsxTextTagNameMember: exitMdxJsxTagNameMember, + mdxJsxTextTagNameLocal: exitMdxJsxTagNameLocal, + mdxJsxTextTagExpressionAttribute: exitMdxJsxTagExpressionAttribute, + mdxJsxTextTagExpressionAttributeValue: data2, + mdxJsxTextTagAttributeNamePrimary: exitMdxJsxTagAttributeNamePrimary, + mdxJsxTextTagAttributeNameLocal: exitMdxJsxTagAttributeNameLocal, + mdxJsxTextTagAttributeValueLiteral: exitMdxJsxTagAttributeValueLiteral, + mdxJsxTextTagAttributeValueLiteralValue: data2, + mdxJsxTextTagAttributeValueExpression: exitMdxJsxTagAttributeValueExpression, + mdxJsxTextTagAttributeValueExpressionValue: data2, + mdxJsxTextTagSelfClosingMarker: exitMdxJsxTagSelfClosingMarker, + mdxJsxTextTag: exitMdxJsxTag + } + }; + function buffer2() { + this.buffer(); + } + function data2(token) { + this.config.enter.data.call(this, token); + this.config.exit.data.call(this, token); + } + function enterMdxJsxTag(token) { + const tag = { name: null, attributes: [], start: token.start, end: token.end }; + if (!this.getData("mdxJsxTagStack")) + this.setData("mdxJsxTagStack", []); + this.setData("mdxJsxTag", tag); + this.buffer(); + } + function enterMdxJsxTagClosingMarker(token) { + const stack = this.getData("mdxJsxTagStack"); + if (stack.length === 0) { + throw new VFileMessage( + "Unexpected closing slash `/` in tag, expected an open tag first", + { start: token.start, end: token.end }, + "mdast-util-mdx-jsx:unexpected-closing-slash" + ); + } + } + function enterMdxJsxTagAnyAttribute(token) { + const tag = this.getData("mdxJsxTag"); + if (tag.close) { + throw new VFileMessage( + "Unexpected attribute in closing tag, expected the end of the tag", + { start: token.start, end: token.end }, + "mdast-util-mdx-jsx:unexpected-attribute" + ); + } + } + function enterMdxJsxTagSelfClosingMarker(token) { + const tag = this.getData("mdxJsxTag"); + if (tag.close) { + throw new VFileMessage( + "Unexpected self-closing slash `/` in closing tag, expected the end of the tag", + { start: token.start, end: token.end }, + "mdast-util-mdx-jsx:unexpected-self-closing-slash" + ); + } + } + function exitMdxJsxTagClosingMarker() { + const tag = this.getData("mdxJsxTag"); + tag.close = true; + } + function exitMdxJsxTagNamePrimary(token) { + const tag = this.getData("mdxJsxTag"); + tag.name = this.sliceSerialize(token); + } + function exitMdxJsxTagNameMember(token) { + const tag = this.getData("mdxJsxTag"); + tag.name += "." + this.sliceSerialize(token); + } + function exitMdxJsxTagNameLocal(token) { + const tag = this.getData("mdxJsxTag"); + tag.name += ":" + this.sliceSerialize(token); + } + function enterMdxJsxTagAttribute(token) { + const tag = this.getData("mdxJsxTag"); + enterMdxJsxTagAnyAttribute.call(this, token); + tag.attributes.push({ type: "mdxJsxAttribute", name: "", value: null }); + } + function enterMdxJsxTagExpressionAttribute(token) { + const tag = this.getData("mdxJsxTag"); + enterMdxJsxTagAnyAttribute.call(this, token); + tag.attributes.push({ type: "mdxJsxExpressionAttribute", value: "" }); + this.buffer(); + } + function exitMdxJsxTagExpressionAttribute(token) { + const tag = this.getData("mdxJsxTag"); + const tail = tag.attributes[tag.attributes.length - 1]; + const estree = token.estree; + tail.value = this.resume(); + if (estree) { + tail.data = { estree }; + } + } + function exitMdxJsxTagAttributeNamePrimary(token) { + const tag = this.getData("mdxJsxTag"); + const node = tag.attributes[tag.attributes.length - 1]; + node.name = this.sliceSerialize(token); + } + function exitMdxJsxTagAttributeNameLocal(token) { + const tag = this.getData("mdxJsxTag"); + const node = tag.attributes[tag.attributes.length - 1]; + node.name += ":" + this.sliceSerialize(token); + } + function exitMdxJsxTagAttributeValueLiteral() { + const tag = this.getData("mdxJsxTag"); + tag.attributes[tag.attributes.length - 1].value = parseEntities( + this.resume(), + { nonTerminated: false } + ); + } + function exitMdxJsxTagAttributeValueExpression(token) { + const tag = this.getData("mdxJsxTag"); + const tail = tag.attributes[tag.attributes.length - 1]; + const node = { type: "mdxJsxAttributeValueExpression", value: this.resume() }; + const estree = token.estree; + if (estree) { + node.data = { estree }; + } + tail.value = node; + } + function exitMdxJsxTagSelfClosingMarker() { + const tag = this.getData("mdxJsxTag"); + tag.selfClosing = true; + } + function exitMdxJsxTag(token) { + const tag = this.getData("mdxJsxTag"); + const stack = this.getData("mdxJsxTagStack"); + const tail = stack[stack.length - 1]; + if (tag.close && tail.name !== tag.name) { + throw new VFileMessage( + "Unexpected closing tag `" + serializeAbbreviatedTag(tag) + "`, expected corresponding closing tag for `" + serializeAbbreviatedTag(tail) + "` (" + stringifyPosition(tail) + ")", + { start: token.start, end: token.end }, + "mdast-util-mdx-jsx:end-tag-mismatch" + ); + } + this.resume(); + if (tag.close) { + stack.pop(); + } else { + this.enter( + { + type: token.type === "mdxJsxTextTag" ? "mdxJsxTextElement" : "mdxJsxFlowElement", + name: tag.name, + attributes: tag.attributes, + children: [] + }, + token, + onErrorRightIsTag + ); + } + if (tag.selfClosing || tag.close) { + this.exit(token, onErrorLeftIsTag); + } else { + stack.push(tag); + } + } + function onErrorRightIsTag(closing, open) { + const tag = this.getData("mdxJsxTag"); + const place = closing ? " before the end of `" + closing.type + "`" : ""; + const position3 = closing ? { start: closing.start, end: closing.end } : void 0; + throw new VFileMessage( + "Expected a closing tag for `" + serializeAbbreviatedTag(tag) + "` (" + stringifyPosition({ start: open.start, end: open.end }) + ")" + place, + position3, + "mdast-util-mdx-jsx:end-tag-mismatch" + ); + } + function onErrorLeftIsTag(a, b) { + const tag = this.getData("mdxJsxTag"); + throw new VFileMessage( + "Expected the closing tag `" + serializeAbbreviatedTag(tag) + "` either after the end of `" + b.type + "` (" + stringifyPosition(b.end) + ") or another opening tag after the start of `" + b.type + "` (" + stringifyPosition(b.start) + ")", + { start: a.start, end: a.end }, + "mdast-util-mdx-jsx:end-tag-mismatch" + ); + } + function serializeAbbreviatedTag(tag) { + return "<" + (tag.close ? "/" : "") + (tag.name || "") + ">"; + } +} +function mdxJsxToMarkdown(options = {}) { + const { + quote = '"', + quoteSmart, + tightSelfClosing, + printWidth = Number.POSITIVE_INFINITY + } = options; + const alternative = quote === '"' ? "'" : '"'; + if (quote !== '"' && quote !== "'") { + throw new Error( + "Cannot serialize attribute values with `" + quote + "` for `options.quote`, expected `\"`, or `'`" + ); + } + mdxElement.peek = peekElement; + return { + handlers: { + mdxJsxFlowElement: mdxElement, + mdxJsxTextElement: mdxElement + }, + unsafe: [ + { character: "<", inConstruct: ["phrasing"] }, + { atBreak: true, character: "<" } + ], + fences: true, + resourceLink: true + }; + function mdxElement(node, _, context, safeOptions) { + const tracker = track(safeOptions); + const selfClosing = node.name && (!node.children || node.children.length === 0); + const exit2 = context.enter(node.type); + let index2 = -1; + const serializedAttributes = []; + let value = tracker.move("<" + (node.name || "")); + if (node.attributes && node.attributes.length > 0) { + if (!node.name) { + throw new Error("Cannot serialize fragment w/ attributes"); + } + while (++index2 < node.attributes.length) { + const attribute = node.attributes[index2]; + let result; + if (attribute.type === "mdxJsxExpressionAttribute") { + result = "{" + (attribute.value || "") + "}"; + } else { + if (!attribute.name) { + throw new Error("Cannot serialize attribute w/o name"); + } + const value2 = attribute.value; + const left = attribute.name; + let right = ""; + if (value2 === void 0 || value2 === null) { + } else if (typeof value2 === "object") { + right = "{" + (value2.value || "") + "}"; + } else { + const appliedQuote = quoteSmart && ccount(value2, quote) > ccount(value2, alternative) ? alternative : quote; + right = appliedQuote + stringifyEntitiesLight(value2, { subset: [appliedQuote] }) + appliedQuote; + } + result = left + (right ? "=" : "") + right; + } + serializedAttributes.push(result); + } + } + let attributesOnTheirOwnLine = false; + const attributesOnOneLine = serializedAttributes.join(" "); + if (node.type === "mdxJsxFlowElement" && (/\r?\n|\r/.test(attributesOnOneLine) || tracker.current().now.column + attributesOnOneLine.length + (selfClosing ? tightSelfClosing ? 2 : 3 : 1) > printWidth)) { + attributesOnTheirOwnLine = true; + } + if (attributesOnTheirOwnLine) { + value += tracker.move( + "\n" + indentLines(serializedAttributes.join("\n"), map) + ); + } else if (attributesOnOneLine) { + value += tracker.move(" " + attributesOnOneLine); + } + if (attributesOnTheirOwnLine) { + value += tracker.move("\n"); + } + if (selfClosing) { + value += tracker.move( + (tightSelfClosing || attributesOnTheirOwnLine ? "" : " ") + "/" + ); + } + value += tracker.move(">"); + if (node.children && node.children.length > 0) { + if (node.type === "mdxJsxFlowElement") { + tracker.shift(2); + value += tracker.move("\n"); + value += tracker.move( + indentLines(containerFlow(node, context, tracker.current()), map) + ); + value += tracker.move("\n"); + } else { + value += tracker.move( + containerPhrasing(node, context, { + ...tracker.current(), + before: "<", + after: ">" + }) + ); + } + } + if (!selfClosing) { + value += tracker.move(""); + } + exit2(); + return value; + } + function map(line, _, blank) { + return (blank ? "" : " ") + line; + } + function peekElement() { + return "<"; + } +} + +// node_modules/mdast-util-mdxjs-esm/index.js +var mdxjsEsmFromMarkdown = { + enter: { mdxjsEsm: enterMdxjsEsm }, + exit: { mdxjsEsm: exitMdxjsEsm, mdxjsEsmData: exitMdxjsEsmData } +}; +var mdxjsEsmToMarkdown = { handlers: { mdxjsEsm: handleMdxjsEsm } }; +function enterMdxjsEsm(token) { + this.enter({ type: "mdxjsEsm", value: "" }, token); + this.buffer(); +} +function exitMdxjsEsm(token) { + const value = this.resume(); + const node = this.exit(token); + const estree = token.estree; + node.value = value; + if (estree) { + node.data = { estree }; + } +} +function exitMdxjsEsmData(token) { + this.config.enter.data.call(this, token); + this.config.exit.data.call(this, token); +} +function handleMdxjsEsm(node) { + return node.value || ""; +} + +// node_modules/mdast-util-mdx/index.js +function mdxFromMarkdown() { + return [mdxExpressionFromMarkdown, mdxJsxFromMarkdown(), mdxjsEsmFromMarkdown]; +} +function mdxToMarkdown(options) { + return { + extensions: [ + mdxExpressionToMarkdown, + mdxJsxToMarkdown(options), + mdxjsEsmToMarkdown + ] + }; +} + +// node_modules/remark-mdx/index.js +function remarkMdx(options = {}) { + const data2 = this.data(); + add("micromarkExtensions", mdxjs(options)); + add("fromMarkdownExtensions", mdxFromMarkdown()); + add("toMarkdownExtensions", mdxToMarkdown(options)); + function add(field, value) { + const list3 = data2[field] ? data2[field] : data2[field] = []; + list3.push(value); + } +} + +// node_modules/mdast-util-to-string/index.js +function toString2(node, options) { + var { includeImageAlt = true } = options || {}; + return one(node, includeImageAlt); +} +function one(node, includeImageAlt) { + return node && typeof node === "object" && (node.value || (includeImageAlt ? node.alt : "") || "children" in node && all(node.children, includeImageAlt) || Array.isArray(node) && all(node, includeImageAlt)) || ""; +} +function all(values, includeImageAlt) { + var result = []; + var index2 = -1; + while (++index2 < values.length) { + result[index2] = one(values[index2], includeImageAlt); + } + return result.join(""); +} + +// node_modules/micromark/lib/initialize/content.js +var content2 = { + tokenize: initializeContent +}; +function initializeContent(effects) { + const contentStart = effects.attempt( + this.parser.constructs.contentInitial, + afterContentStartConstruct, + paragraphInitial + ); + let previous2; + return contentStart; + function afterContentStartConstruct(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + return factorySpace(effects, contentStart, "linePrefix"); + } + function paragraphInitial(code2) { + effects.enter("paragraph"); + return lineStart(code2); + } + function lineStart(code2) { + const token = effects.enter("chunkText", { + contentType: "text", + previous: previous2 + }); + if (previous2) { + previous2.next = token; + } + previous2 = token; + return data2(code2); + } + function data2(code2) { + if (code2 === null) { + effects.exit("chunkText"); + effects.exit("paragraph"); + effects.consume(code2); + return; + } + if (markdownLineEnding(code2)) { + effects.consume(code2); + effects.exit("chunkText"); + return lineStart; + } + effects.consume(code2); + return data2; + } +} + +// node_modules/micromark/lib/initialize/document.js +var document = { + tokenize: initializeDocument +}; +var containerConstruct = { + tokenize: tokenizeContainer +}; +function initializeDocument(effects) { + const self2 = this; + const stack = []; + let continued = 0; + let childFlow; + let childToken; + let lineStartOffset; + return start3; + function start3(code2) { + if (continued < stack.length) { + const item = stack[continued]; + self2.containerState = item[1]; + return effects.attempt( + item[0].continuation, + documentContinue, + checkNewContainers + )(code2); + } + return checkNewContainers(code2); + } + function documentContinue(code2) { + continued++; + if (self2.containerState._closeFlow) { + self2.containerState._closeFlow = void 0; + if (childFlow) { + closeFlow(); + } + const indexBeforeExits = self2.events.length; + let indexBeforeFlow = indexBeforeExits; + let point3; + while (indexBeforeFlow--) { + if (self2.events[indexBeforeFlow][0] === "exit" && self2.events[indexBeforeFlow][1].type === "chunkFlow") { + point3 = self2.events[indexBeforeFlow][1].end; + break; + } + } + exitContainers(continued); + let index2 = indexBeforeExits; + while (index2 < self2.events.length) { + self2.events[index2][1].end = Object.assign({}, point3); + index2++; + } + splice( + self2.events, + indexBeforeFlow + 1, + 0, + self2.events.slice(indexBeforeExits) + ); + self2.events.length = index2; + return checkNewContainers(code2); + } + return start3(code2); + } + function checkNewContainers(code2) { + if (continued === stack.length) { + if (!childFlow) { + return documentContinued(code2); + } + if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { + return flowStart(code2); + } + self2.interrupt = Boolean( + childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack + ); + } + self2.containerState = {}; + return effects.check( + containerConstruct, + thereIsANewContainer, + thereIsNoNewContainer + )(code2); + } + function thereIsANewContainer(code2) { + if (childFlow) + closeFlow(); + exitContainers(continued); + return documentContinued(code2); + } + function thereIsNoNewContainer(code2) { + self2.parser.lazy[self2.now().line] = continued !== stack.length; + lineStartOffset = self2.now().offset; + return flowStart(code2); + } + function documentContinued(code2) { + self2.containerState = {}; + return effects.attempt( + containerConstruct, + containerContinue, + flowStart + )(code2); + } + function containerContinue(code2) { + continued++; + stack.push([self2.currentConstruct, self2.containerState]); + return documentContinued(code2); + } + function flowStart(code2) { + if (code2 === null) { + if (childFlow) + closeFlow(); + exitContainers(0); + effects.consume(code2); + return; + } + childFlow = childFlow || self2.parser.flow(self2.now()); + effects.enter("chunkFlow", { + contentType: "flow", + previous: childToken, + _tokenizer: childFlow + }); + return flowContinue(code2); + } + function flowContinue(code2) { + if (code2 === null) { + writeToChild(effects.exit("chunkFlow"), true); + exitContainers(0); + effects.consume(code2); + return; + } + if (markdownLineEnding(code2)) { + effects.consume(code2); + writeToChild(effects.exit("chunkFlow")); + continued = 0; + self2.interrupt = void 0; + return start3; + } + effects.consume(code2); + return flowContinue; + } + function writeToChild(token, eof) { + const stream = self2.sliceStream(token); + if (eof) + stream.push(null); + token.previous = childToken; + if (childToken) + childToken.next = token; + childToken = token; + childFlow.defineSkip(token.start); + childFlow.write(stream); + if (self2.parser.lazy[token.start.line]) { + let index2 = childFlow.events.length; + while (index2--) { + if (childFlow.events[index2][1].start.offset < lineStartOffset && (!childFlow.events[index2][1].end || childFlow.events[index2][1].end.offset > lineStartOffset)) { + return; + } + } + const indexBeforeExits = self2.events.length; + let indexBeforeFlow = indexBeforeExits; + let seen; + let point3; + while (indexBeforeFlow--) { + if (self2.events[indexBeforeFlow][0] === "exit" && self2.events[indexBeforeFlow][1].type === "chunkFlow") { + if (seen) { + point3 = self2.events[indexBeforeFlow][1].end; + break; + } + seen = true; + } + } + exitContainers(continued); + index2 = indexBeforeExits; + while (index2 < self2.events.length) { + self2.events[index2][1].end = Object.assign({}, point3); + index2++; + } + splice( + self2.events, + indexBeforeFlow + 1, + 0, + self2.events.slice(indexBeforeExits) + ); + self2.events.length = index2; + } + } + function exitContainers(size) { + let index2 = stack.length; + while (index2-- > size) { + const entry = stack[index2]; + self2.containerState = entry[1]; + entry[0].exit.call(self2, effects); + } + stack.length = size; + } + function closeFlow() { + childFlow.write([null]); + childToken = void 0; + childFlow = void 0; + self2.containerState._closeFlow = void 0; + } +} +function tokenizeContainer(effects, ok2, nok) { + return factorySpace( + effects, + effects.attempt(this.parser.constructs.document, ok2, nok), + "linePrefix", + this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4 + ); +} + +// node_modules/micromark/lib/initialize/flow.js +var flow = { + tokenize: initializeFlow +}; +function initializeFlow(effects) { + const self2 = this; + const initial = effects.attempt( + blankLine, + atBlankEnding, + effects.attempt( + this.parser.constructs.flowInitial, + afterConstruct, + factorySpace( + effects, + effects.attempt( + this.parser.constructs.flow, + afterConstruct, + effects.attempt(content, afterConstruct) + ), + "linePrefix" + ) + ) + ); + return initial; + function atBlankEnding(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter("lineEndingBlank"); + effects.consume(code2); + effects.exit("lineEndingBlank"); + self2.currentConstruct = void 0; + return initial; + } + function afterConstruct(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter("lineEnding"); + effects.consume(code2); + effects.exit("lineEnding"); + self2.currentConstruct = void 0; + return initial; + } +} + +// node_modules/micromark/lib/initialize/text.js +var resolver = { + resolveAll: createResolver() +}; +var string = initializeFactory("string"); +var text = initializeFactory("text"); +function initializeFactory(field) { + return { + tokenize: initializeText, + resolveAll: createResolver( + field === "text" ? resolveAllLineSuffixes : void 0 + ) + }; + function initializeText(effects) { + const self2 = this; + const constructs2 = this.parser.constructs[field]; + const text5 = effects.attempt(constructs2, start3, notText); + return start3; + function start3(code2) { + return atBreak(code2) ? text5(code2) : notText(code2); + } + function notText(code2) { + if (code2 === null) { + effects.consume(code2); + return; + } + effects.enter("data"); + effects.consume(code2); + return data2; + } + function data2(code2) { + if (atBreak(code2)) { + effects.exit("data"); + return text5(code2); + } + effects.consume(code2); + return data2; + } + function atBreak(code2) { + if (code2 === null) { + return true; + } + const list3 = constructs2[code2]; + let index2 = -1; + if (list3) { + while (++index2 < list3.length) { + const item = list3[index2]; + if (!item.previous || item.previous.call(self2, self2.previous)) { + return true; + } + } + } + return false; + } + } +} +function createResolver(extraResolver) { + return resolveAllText; + function resolveAllText(events, context) { + let index2 = -1; + let enter; + while (++index2 <= events.length) { + if (enter === void 0) { + if (events[index2] && events[index2][1].type === "data") { + enter = index2; + index2++; + } + } else if (!events[index2] || events[index2][1].type !== "data") { + if (index2 !== enter + 2) { + events[enter][1].end = events[index2 - 1][1].end; + events.splice(enter + 2, index2 - enter - 2); + index2 = enter + 2; + } + enter = void 0; + } + } + return extraResolver ? extraResolver(events, context) : events; + } +} +function resolveAllLineSuffixes(events, context) { + let eventIndex = 0; + while (++eventIndex <= events.length) { + if ((eventIndex === events.length || events[eventIndex][1].type === "lineEnding") && events[eventIndex - 1][1].type === "data") { + const data2 = events[eventIndex - 1][1]; + const chunks = context.sliceStream(data2); + let index2 = chunks.length; + let bufferIndex = -1; + let size = 0; + let tabs; + while (index2--) { + const chunk = chunks[index2]; + if (typeof chunk === "string") { + bufferIndex = chunk.length; + while (chunk.charCodeAt(bufferIndex - 1) === 32) { + size++; + bufferIndex--; + } + if (bufferIndex) + break; + bufferIndex = -1; + } else if (chunk === -2) { + tabs = true; + size++; + } else if (chunk === -1) { + } else { + index2++; + break; + } + } + if (size) { + const token = { + type: eventIndex === events.length || tabs || size < 2 ? "lineSuffix" : "hardBreakTrailing", + start: { + line: data2.end.line, + column: data2.end.column - size, + offset: data2.end.offset - size, + _index: data2.start._index + index2, + _bufferIndex: index2 ? bufferIndex : data2.start._bufferIndex + bufferIndex + }, + end: Object.assign({}, data2.end) + }; + data2.end = Object.assign({}, token.start); + if (data2.start.offset === data2.end.offset) { + Object.assign(data2, token); + } else { + events.splice( + eventIndex, + 0, + ["enter", token, context], + ["exit", token, context] + ); + eventIndex += 2; + } + } + eventIndex++; + } + } + return events; +} + +// node_modules/micromark/lib/create-tokenizer.js +function createTokenizer(parser, initialize, from) { + let point3 = Object.assign( + from ? Object.assign({}, from) : { + line: 1, + column: 1, + offset: 0 + }, + { + _index: 0, + _bufferIndex: -1 + } + ); + const columnStart = {}; + const resolveAllConstructs = []; + let chunks = []; + let stack = []; + let consumed = true; + const effects = { + consume, + enter, + exit: exit2, + attempt: constructFactory(onsuccessfulconstruct), + check: constructFactory(onsuccessfulcheck), + interrupt: constructFactory(onsuccessfulcheck, { + interrupt: true + }) + }; + const context = { + previous: null, + code: null, + containerState: {}, + events: [], + parser, + sliceStream, + sliceSerialize, + now, + defineSkip, + write + }; + let state = initialize.tokenize.call(context, effects); + let expectedCode; + if (initialize.resolveAll) { + resolveAllConstructs.push(initialize); + } + return context; + function write(slice2) { + chunks = push(chunks, slice2); + main(); + if (chunks[chunks.length - 1] !== null) { + return []; + } + addResult(initialize, 0); + context.events = resolveAll(resolveAllConstructs, context.events, context); + return context.events; + } + function sliceSerialize(token, expandTabs) { + return serializeChunks(sliceStream(token), expandTabs); + } + function sliceStream(token) { + return sliceChunks(chunks, token); + } + function now() { + return Object.assign({}, point3); + } + function defineSkip(value) { + columnStart[value.line] = value.column; + accountForPotentialSkip(); + } + function main() { + let chunkIndex; + while (point3._index < chunks.length) { + const chunk = chunks[point3._index]; + if (typeof chunk === "string") { + chunkIndex = point3._index; + if (point3._bufferIndex < 0) { + point3._bufferIndex = 0; + } + while (point3._index === chunkIndex && point3._bufferIndex < chunk.length) { + go(chunk.charCodeAt(point3._bufferIndex)); + } + } else { + go(chunk); + } + } + } + function go(code2) { + consumed = void 0; + expectedCode = code2; + state = state(code2); + } + function consume(code2) { + if (markdownLineEnding(code2)) { + point3.line++; + point3.column = 1; + point3.offset += code2 === -3 ? 2 : 1; + accountForPotentialSkip(); + } else if (code2 !== -1) { + point3.column++; + point3.offset++; + } + if (point3._bufferIndex < 0) { + point3._index++; + } else { + point3._bufferIndex++; + if (point3._bufferIndex === chunks[point3._index].length) { + point3._bufferIndex = -1; + point3._index++; + } + } + context.previous = code2; + consumed = true; + } + function enter(type, fields) { + const token = fields || {}; + token.type = type; + token.start = now(); + context.events.push(["enter", token, context]); + stack.push(token); + return token; + } + function exit2(type) { + const token = stack.pop(); + token.end = now(); + context.events.push(["exit", token, context]); + return token; + } + function onsuccessfulconstruct(construct, info) { + addResult(construct, info.from); + } + function onsuccessfulcheck(_, info) { + info.restore(); + } + function constructFactory(onreturn, fields) { + return hook; + function hook(constructs2, returnState, bogusState) { + let listOfConstructs; + let constructIndex; + let currentConstruct; + let info; + return Array.isArray(constructs2) ? handleListOfConstructs(constructs2) : "tokenize" in constructs2 ? handleListOfConstructs([constructs2]) : handleMapOfConstructs(constructs2); + function handleMapOfConstructs(map) { + return start3; + function start3(code2) { + const def = code2 !== null && map[code2]; + const all4 = code2 !== null && map.null; + const list3 = [ + ...Array.isArray(def) ? def : def ? [def] : [], + ...Array.isArray(all4) ? all4 : all4 ? [all4] : [] + ]; + return handleListOfConstructs(list3)(code2); + } + } + function handleListOfConstructs(list3) { + listOfConstructs = list3; + constructIndex = 0; + if (list3.length === 0) { + return bogusState; + } + return handleConstruct(list3[constructIndex]); + } + function handleConstruct(construct) { + return start3; + function start3(code2) { + info = store(); + currentConstruct = construct; + if (!construct.partial) { + context.currentConstruct = construct; + } + if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) { + return nok(code2); + } + return construct.tokenize.call( + fields ? Object.assign(Object.create(context), fields) : context, + effects, + ok2, + nok + )(code2); + } + } + function ok2(code2) { + consumed = true; + onreturn(currentConstruct, info); + return returnState; + } + function nok(code2) { + consumed = true; + info.restore(); + if (++constructIndex < listOfConstructs.length) { + return handleConstruct(listOfConstructs[constructIndex]); + } + return bogusState; + } + } + } + function addResult(construct, from2) { + if (construct.resolveAll && !resolveAllConstructs.includes(construct)) { + resolveAllConstructs.push(construct); + } + if (construct.resolve) { + splice( + context.events, + from2, + context.events.length - from2, + construct.resolve(context.events.slice(from2), context) + ); + } + if (construct.resolveTo) { + context.events = construct.resolveTo(context.events, context); + } + } + function store() { + const startPoint = now(); + const startPrevious = context.previous; + const startCurrentConstruct = context.currentConstruct; + const startEventsIndex = context.events.length; + const startStack = Array.from(stack); + return { + restore, + from: startEventsIndex + }; + function restore() { + point3 = startPoint; + context.previous = startPrevious; + context.currentConstruct = startCurrentConstruct; + context.events.length = startEventsIndex; + stack = startStack; + accountForPotentialSkip(); + } + } + function accountForPotentialSkip() { + if (point3.line in columnStart && point3.column < 2) { + point3.column = columnStart[point3.line]; + point3.offset += columnStart[point3.line] - 1; + } + } +} +function sliceChunks(chunks, token) { + const startIndex = token.start._index; + const startBufferIndex = token.start._bufferIndex; + const endIndex = token.end._index; + const endBufferIndex = token.end._bufferIndex; + let view; + if (startIndex === endIndex) { + view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]; + } else { + view = chunks.slice(startIndex, endIndex); + if (startBufferIndex > -1) { + view[0] = view[0].slice(startBufferIndex); + } + if (endBufferIndex > 0) { + view.push(chunks[endIndex].slice(0, endBufferIndex)); + } + } + return view; +} +function serializeChunks(chunks, expandTabs) { + let index2 = -1; + const result = []; + let atTab; + while (++index2 < chunks.length) { + const chunk = chunks[index2]; + let value; + if (typeof chunk === "string") { + value = chunk; + } else + switch (chunk) { + case -5: { + value = "\r"; + break; + } + case -4: { + value = "\n"; + break; + } + case -3: { + value = "\r\n"; + break; + } + case -2: { + value = expandTabs ? " " : " "; + break; + } + case -1: { + if (!expandTabs && atTab) + continue; + value = " "; + break; + } + default: { + value = String.fromCharCode(chunk); + } + } + atTab = chunk === -2; + result.push(value); + } + return result.join(""); +} + +// node_modules/micromark/lib/constructs.js +var constructs_exports = {}; +__export(constructs_exports, { + attentionMarkers: () => attentionMarkers, + contentInitial: () => contentInitial, + disable: () => disable, + document: () => document2, + flow: () => flow2, + flowInitial: () => flowInitial, + insideSpan: () => insideSpan, + string: () => string2, + text: () => text2 +}); +var document2 = { + [42]: list, + [43]: list, + [45]: list, + [48]: list, + [49]: list, + [50]: list, + [51]: list, + [52]: list, + [53]: list, + [54]: list, + [55]: list, + [56]: list, + [57]: list, + [62]: blockQuote +}; +var contentInitial = { + [91]: definition +}; +var flowInitial = { + [-2]: codeIndented, + [-1]: codeIndented, + [32]: codeIndented +}; +var flow2 = { + [35]: headingAtx, + [42]: thematicBreak, + [45]: [setextUnderline, thematicBreak], + [60]: htmlFlow, + [61]: setextUnderline, + [95]: thematicBreak, + [96]: codeFenced, + [126]: codeFenced +}; +var string2 = { + [38]: characterReference, + [92]: characterEscape +}; +var text2 = { + [-5]: lineEnding, + [-4]: lineEnding, + [-3]: lineEnding, + [33]: labelStartImage, + [38]: characterReference, + [42]: attention, + [60]: [autolink, htmlText], + [91]: labelStartLink, + [92]: [hardBreakEscape, characterEscape], + [93]: labelEnd, + [95]: attention, + [96]: codeText +}; +var insideSpan = { + null: [attention, resolver] +}; +var attentionMarkers = { + null: [42, 95] +}; +var disable = { + null: [] +}; + +// node_modules/micromark/lib/parse.js +function parse3(options = {}) { + const constructs2 = combineExtensions( + [constructs_exports].concat(options.extensions || []) + ); + const parser = { + defined: [], + lazy: {}, + constructs: constructs2, + content: create5(content2), + document: create5(document), + flow: create5(flow), + string: create5(string), + text: create5(text) + }; + return parser; + function create5(initial) { + return creator; + function creator(from) { + return createTokenizer(parser, initial, from); + } + } +} + +// node_modules/micromark/lib/preprocess.js +var search = /[\0\t\n\r]/g; +function preprocess() { + let column = 1; + let buffer2 = ""; + let start3 = true; + let atCarriageReturn; + return preprocessor; + function preprocessor(value, encoding, end) { + const chunks = []; + let match; + let next; + let startPosition; + let endPosition; + let code2; + value = buffer2 + value.toString(encoding); + startPosition = 0; + buffer2 = ""; + if (start3) { + if (value.charCodeAt(0) === 65279) { + startPosition++; + } + start3 = void 0; + } + while (startPosition < value.length) { + search.lastIndex = startPosition; + match = search.exec(value); + endPosition = match && match.index !== void 0 ? match.index : value.length; + code2 = value.charCodeAt(endPosition); + if (!match) { + buffer2 = value.slice(startPosition); + break; + } + if (code2 === 10 && startPosition === endPosition && atCarriageReturn) { + chunks.push(-3); + atCarriageReturn = void 0; + } else { + if (atCarriageReturn) { + chunks.push(-5); + atCarriageReturn = void 0; + } + if (startPosition < endPosition) { + chunks.push(value.slice(startPosition, endPosition)); + column += endPosition - startPosition; + } + switch (code2) { + case 0: { + chunks.push(65533); + column++; + break; + } + case 9: { + next = Math.ceil(column / 4) * 4; + chunks.push(-2); + while (column++ < next) + chunks.push(-1); + break; + } + case 10: { + chunks.push(-4); + column = 1; + break; + } + default: { + atCarriageReturn = true; + column = 1; + } + } + } + startPosition = endPosition + 1; + } + if (end) { + if (atCarriageReturn) + chunks.push(-5); + if (buffer2) + chunks.push(buffer2); + chunks.push(null); + } + return chunks; + } +} + +// node_modules/micromark/lib/postprocess.js +function postprocess(events) { + while (!subtokenize(events)) { + } + return events; +} + +// node_modules/micromark-util-decode-numeric-character-reference/index.js +function decodeNumericCharacterReference(value, base2) { + const code2 = Number.parseInt(value, base2); + if (code2 < 9 || code2 === 11 || code2 > 13 && code2 < 32 || code2 > 126 && code2 < 160 || code2 > 55295 && code2 < 57344 || code2 > 64975 && code2 < 65008 || (code2 & 65535) === 65535 || (code2 & 65535) === 65534 || code2 > 1114111) { + return "\uFFFD"; + } + return String.fromCharCode(code2); +} + +// node_modules/micromark-util-decode-string/index.js +var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi; +function decodeString(value) { + return value.replace(characterEscapeOrReference, decode); +} +function decode($0, $1, $2) { + if ($1) { + return $1; + } + const head = $2.charCodeAt(0); + if (head === 35) { + const head2 = $2.charCodeAt(1); + const hex = head2 === 120 || head2 === 88; + return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10); + } + return decodeNamedCharacterReference($2) || $0; +} + +// node_modules/mdast-util-from-markdown/lib/index.js +var own4 = {}.hasOwnProperty; +var fromMarkdown = function(value, encoding, options) { + if (typeof encoding !== "string") { + options = encoding; + encoding = void 0; + } + return compiler(options)( + postprocess( + parse3(options).document().write(preprocess()(value, encoding, true)) + ) + ); +}; +function compiler(options = {}) { + const config = configure( + { + transforms: [], + canContainEols: [ + "emphasis", + "fragment", + "heading", + "paragraph", + "strong" + ], + enter: { + autolink: opener(link2), + autolinkProtocol: onenterdata, + autolinkEmail: onenterdata, + atxHeading: opener(heading2), + blockQuote: opener(blockQuote2), + characterEscape: onenterdata, + characterReference: onenterdata, + codeFenced: opener(codeFlow), + codeFencedFenceInfo: buffer2, + codeFencedFenceMeta: buffer2, + codeIndented: opener(codeFlow, buffer2), + codeText: opener(codeText2, buffer2), + codeTextData: onenterdata, + data: onenterdata, + codeFlowValue: onenterdata, + definition: opener(definition2), + definitionDestinationString: buffer2, + definitionLabelString: buffer2, + definitionTitleString: buffer2, + emphasis: opener(emphasis2), + hardBreakEscape: opener(hardBreak2), + hardBreakTrailing: opener(hardBreak2), + htmlFlow: opener(html4, buffer2), + htmlFlowData: onenterdata, + htmlText: opener(html4, buffer2), + htmlTextData: onenterdata, + image: opener(image2), + label: buffer2, + link: opener(link2), + listItem: opener(listItem2), + listItemValue: onenterlistitemvalue, + listOrdered: opener(list3, onenterlistordered), + listUnordered: opener(list3), + paragraph: opener(paragraph2), + reference: onenterreference, + referenceString: buffer2, + resourceDestinationString: buffer2, + resourceTitleString: buffer2, + setextHeading: opener(heading2), + strong: opener(strong2), + thematicBreak: opener(thematicBreak3) + }, + exit: { + atxHeading: closer(), + atxHeadingSequence: onexitatxheadingsequence, + autolink: closer(), + autolinkEmail: onexitautolinkemail, + autolinkProtocol: onexitautolinkprotocol, + blockQuote: closer(), + characterEscapeValue: onexitdata, + characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, + characterReferenceMarkerNumeric: onexitcharacterreferencemarker, + characterReferenceValue: onexitcharacterreferencevalue, + codeFenced: closer(onexitcodefenced), + codeFencedFence: onexitcodefencedfence, + codeFencedFenceInfo: onexitcodefencedfenceinfo, + codeFencedFenceMeta: onexitcodefencedfencemeta, + codeFlowValue: onexitdata, + codeIndented: closer(onexitcodeindented), + codeText: closer(onexitcodetext), + codeTextData: onexitdata, + data: onexitdata, + definition: closer(), + definitionDestinationString: onexitdefinitiondestinationstring, + definitionLabelString: onexitdefinitionlabelstring, + definitionTitleString: onexitdefinitiontitlestring, + emphasis: closer(), + hardBreakEscape: closer(onexithardbreak), + hardBreakTrailing: closer(onexithardbreak), + htmlFlow: closer(onexithtmlflow), + htmlFlowData: onexitdata, + htmlText: closer(onexithtmltext), + htmlTextData: onexitdata, + image: closer(onexitimage), + label: onexitlabel, + labelText: onexitlabeltext, + lineEnding: onexitlineending, + link: closer(onexitlink), + listItem: closer(), + listOrdered: closer(), + listUnordered: closer(), + paragraph: closer(), + referenceString: onexitreferencestring, + resourceDestinationString: onexitresourcedestinationstring, + resourceTitleString: onexitresourcetitlestring, + resource: onexitresource, + setextHeading: closer(onexitsetextheading), + setextHeadingLineSequence: onexitsetextheadinglinesequence, + setextHeadingText: onexitsetextheadingtext, + strong: closer(), + thematicBreak: closer() + } + }, + options.mdastExtensions || [] + ); + const data2 = {}; + return compile2; + function compile2(events) { + let tree = { + type: "root", + children: [] + }; + const stack = [tree]; + const tokenStack = []; + const listStack = []; + const context = { + stack, + tokenStack, + config, + enter, + exit: exit2, + buffer: buffer2, + resume, + setData, + getData + }; + let index2 = -1; + while (++index2 < events.length) { + if (events[index2][1].type === "listOrdered" || events[index2][1].type === "listUnordered") { + if (events[index2][0] === "enter") { + listStack.push(index2); + } else { + const tail = listStack.pop(); + index2 = prepareList(events, tail, index2); + } + } + } + index2 = -1; + while (++index2 < events.length) { + const handler = config[events[index2][0]]; + if (own4.call(handler, events[index2][1].type)) { + handler[events[index2][1].type].call( + Object.assign( + { + sliceSerialize: events[index2][2].sliceSerialize + }, + context + ), + events[index2][1] + ); + } + } + if (tokenStack.length > 0) { + const tail = tokenStack[tokenStack.length - 1]; + const handler = tail[1] || defaultOnError; + handler.call(context, void 0, tail[0]); + } + tree.position = { + start: point3( + events.length > 0 ? events[0][1].start : { + line: 1, + column: 1, + offset: 0 + } + ), + end: point3( + events.length > 0 ? events[events.length - 2][1].end : { + line: 1, + column: 1, + offset: 0 + } + ) + }; + index2 = -1; + while (++index2 < config.transforms.length) { + tree = config.transforms[index2](tree) || tree; + } + return tree; + } + function prepareList(events, start3, length) { + let index2 = start3 - 1; + let containerBalance = -1; + let listSpread = false; + let listItem3; + let lineIndex; + let firstBlankLineIndex; + let atMarker; + while (++index2 <= length) { + const event = events[index2]; + if (event[1].type === "listUnordered" || event[1].type === "listOrdered" || event[1].type === "blockQuote") { + if (event[0] === "enter") { + containerBalance++; + } else { + containerBalance--; + } + atMarker = void 0; + } else if (event[1].type === "lineEndingBlank") { + if (event[0] === "enter") { + if (listItem3 && !atMarker && !containerBalance && !firstBlankLineIndex) { + firstBlankLineIndex = index2; + } + atMarker = void 0; + } + } else if (event[1].type === "linePrefix" || event[1].type === "listItemValue" || event[1].type === "listItemMarker" || event[1].type === "listItemPrefix" || event[1].type === "listItemPrefixWhitespace") { + } else { + atMarker = void 0; + } + if (!containerBalance && event[0] === "enter" && event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === "exit" && (event[1].type === "listUnordered" || event[1].type === "listOrdered")) { + if (listItem3) { + let tailIndex = index2; + lineIndex = void 0; + while (tailIndex--) { + const tailEvent = events[tailIndex]; + if (tailEvent[1].type === "lineEnding" || tailEvent[1].type === "lineEndingBlank") { + if (tailEvent[0] === "exit") + continue; + if (lineIndex) { + events[lineIndex][1].type = "lineEndingBlank"; + listSpread = true; + } + tailEvent[1].type = "lineEnding"; + lineIndex = tailIndex; + } else if (tailEvent[1].type === "linePrefix" || tailEvent[1].type === "blockQuotePrefix" || tailEvent[1].type === "blockQuotePrefixWhitespace" || tailEvent[1].type === "blockQuoteMarker" || tailEvent[1].type === "listItemIndent") { + } else { + break; + } + } + if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) { + listItem3._spread = true; + } + listItem3.end = Object.assign( + {}, + lineIndex ? events[lineIndex][1].start : event[1].end + ); + events.splice(lineIndex || index2, 0, ["exit", listItem3, event[2]]); + index2++; + length++; + } + if (event[1].type === "listItemPrefix") { + listItem3 = { + type: "listItem", + _spread: false, + start: Object.assign({}, event[1].start) + }; + events.splice(index2, 0, ["enter", listItem3, event[2]]); + index2++; + length++; + firstBlankLineIndex = void 0; + atMarker = true; + } + } + } + events[start3][1]._spread = listSpread; + return length; + } + function setData(key, value) { + data2[key] = value; + } + function getData(key) { + return data2[key]; + } + function point3(d) { + return { + line: d.line, + column: d.column, + offset: d.offset + }; + } + function opener(create5, and) { + return open; + function open(token) { + enter.call(this, create5(token), token); + if (and) + and.call(this, token); + } + } + function buffer2() { + this.stack.push({ + type: "fragment", + children: [] + }); + } + function enter(node, token, errorHandler) { + const parent = this.stack[this.stack.length - 1]; + parent.children.push(node); + this.stack.push(node); + this.tokenStack.push([token, errorHandler]); + node.position = { + start: point3(token.start) + }; + return node; + } + function closer(and) { + return close; + function close(token) { + if (and) + and.call(this, token); + exit2.call(this, token); + } + } + function exit2(token, onExitError) { + const node = this.stack.pop(); + const open = this.tokenStack.pop(); + if (!open) { + throw new Error( + "Cannot close `" + token.type + "` (" + stringifyPosition({ + start: token.start, + end: token.end + }) + "): it\u2019s not open" + ); + } else if (open[0].type !== token.type) { + if (onExitError) { + onExitError.call(this, token, open[0]); + } else { + const handler = open[1] || defaultOnError; + handler.call(this, token, open[0]); + } + } + node.position.end = point3(token.end); + return node; + } + function resume() { + return toString2(this.stack.pop()); + } + function onenterlistordered() { + setData("expectingFirstListItemValue", true); + } + function onenterlistitemvalue(token) { + if (getData("expectingFirstListItemValue")) { + const ancestor = this.stack[this.stack.length - 2]; + ancestor.start = Number.parseInt(this.sliceSerialize(token), 10); + setData("expectingFirstListItemValue"); + } + } + function onexitcodefencedfenceinfo() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.lang = data3; + } + function onexitcodefencedfencemeta() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.meta = data3; + } + function onexitcodefencedfence() { + if (getData("flowCodeInside")) + return; + this.buffer(); + setData("flowCodeInside", true); + } + function onexitcodefenced() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data3.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""); + setData("flowCodeInside"); + } + function onexitcodeindented() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data3.replace(/(\r?\n|\r)$/g, ""); + } + function onexitdefinitionlabelstring(token) { + const label = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.label = label; + node.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase(); + } + function onexitdefinitiontitlestring() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.title = data3; + } + function onexitdefinitiondestinationstring() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.url = data3; + } + function onexitatxheadingsequence(token) { + const node = this.stack[this.stack.length - 1]; + if (!node.depth) { + const depth = this.sliceSerialize(token).length; + node.depth = depth; + } + } + function onexitsetextheadingtext() { + setData("setextHeadingSlurpLineEnding", true); + } + function onexitsetextheadinglinesequence(token) { + const node = this.stack[this.stack.length - 1]; + node.depth = this.sliceSerialize(token).charCodeAt(0) === 61 ? 1 : 2; + } + function onexitsetextheading() { + setData("setextHeadingSlurpLineEnding"); + } + function onenterdata(token) { + const parent = this.stack[this.stack.length - 1]; + let tail = parent.children[parent.children.length - 1]; + if (!tail || tail.type !== "text") { + tail = text5(); + tail.position = { + start: point3(token.start) + }; + parent.children.push(tail); + } + this.stack.push(tail); + } + function onexitdata(token) { + const tail = this.stack.pop(); + tail.value += this.sliceSerialize(token); + tail.position.end = point3(token.end); + } + function onexitlineending(token) { + const context = this.stack[this.stack.length - 1]; + if (getData("atHardBreak")) { + const tail = context.children[context.children.length - 1]; + tail.position.end = point3(token.end); + setData("atHardBreak"); + return; + } + if (!getData("setextHeadingSlurpLineEnding") && config.canContainEols.includes(context.type)) { + onenterdata.call(this, token); + onexitdata.call(this, token); + } + } + function onexithardbreak() { + setData("atHardBreak", true); + } + function onexithtmlflow() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data3; + } + function onexithtmltext() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data3; + } + function onexitcodetext() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.value = data3; + } + function onexitlink() { + const context = this.stack[this.stack.length - 1]; + if (getData("inReference")) { + context.type += "Reference"; + context.referenceType = getData("referenceType") || "shortcut"; + delete context.url; + delete context.title; + } else { + delete context.identifier; + delete context.label; + } + setData("referenceType"); + } + function onexitimage() { + const context = this.stack[this.stack.length - 1]; + if (getData("inReference")) { + context.type += "Reference"; + context.referenceType = getData("referenceType") || "shortcut"; + delete context.url; + delete context.title; + } else { + delete context.identifier; + delete context.label; + } + setData("referenceType"); + } + function onexitlabeltext(token) { + const ancestor = this.stack[this.stack.length - 2]; + const string3 = this.sliceSerialize(token); + ancestor.label = decodeString(string3); + ancestor.identifier = normalizeIdentifier(string3).toLowerCase(); + } + function onexitlabel() { + const fragment = this.stack[this.stack.length - 1]; + const value = this.resume(); + const node = this.stack[this.stack.length - 1]; + setData("inReference", true); + if (node.type === "link") { + node.children = fragment.children; + } else { + node.alt = value; + } + } + function onexitresourcedestinationstring() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.url = data3; + } + function onexitresourcetitlestring() { + const data3 = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.title = data3; + } + function onexitresource() { + setData("inReference"); + } + function onenterreference() { + setData("referenceType", "collapsed"); + } + function onexitreferencestring(token) { + const label = this.resume(); + const node = this.stack[this.stack.length - 1]; + node.label = label; + node.identifier = normalizeIdentifier( + this.sliceSerialize(token) + ).toLowerCase(); + setData("referenceType", "full"); + } + function onexitcharacterreferencemarker(token) { + setData("characterReferenceType", token.type); + } + function onexitcharacterreferencevalue(token) { + const data3 = this.sliceSerialize(token); + const type = getData("characterReferenceType"); + let value; + if (type) { + value = decodeNumericCharacterReference( + data3, + type === "characterReferenceMarkerNumeric" ? 10 : 16 + ); + setData("characterReferenceType"); + } else { + value = decodeNamedCharacterReference(data3); + } + const tail = this.stack.pop(); + tail.value += value; + tail.position.end = point3(token.end); + } + function onexitautolinkprotocol(token) { + onexitdata.call(this, token); + const node = this.stack[this.stack.length - 1]; + node.url = this.sliceSerialize(token); + } + function onexitautolinkemail(token) { + onexitdata.call(this, token); + const node = this.stack[this.stack.length - 1]; + node.url = "mailto:" + this.sliceSerialize(token); + } + function blockQuote2() { + return { + type: "blockquote", + children: [] + }; + } + function codeFlow() { + return { + type: "code", + lang: null, + meta: null, + value: "" + }; + } + function codeText2() { + return { + type: "inlineCode", + value: "" + }; + } + function definition2() { + return { + type: "definition", + identifier: "", + label: null, + title: null, + url: "" + }; + } + function emphasis2() { + return { + type: "emphasis", + children: [] + }; + } + function heading2() { + return { + type: "heading", + depth: void 0, + children: [] + }; + } + function hardBreak2() { + return { + type: "break" + }; + } + function html4() { + return { + type: "html", + value: "" + }; + } + function image2() { + return { + type: "image", + title: null, + url: "", + alt: null + }; + } + function link2() { + return { + type: "link", + title: null, + url: "", + children: [] + }; + } + function list3(token) { + return { + type: "list", + ordered: token.type === "listOrdered", + start: null, + spread: token._spread, + children: [] + }; + } + function listItem2(token) { + return { + type: "listItem", + spread: token._spread, + checked: null, + children: [] + }; + } + function paragraph2() { + return { + type: "paragraph", + children: [] + }; + } + function strong2() { + return { + type: "strong", + children: [] + }; + } + function text5() { + return { + type: "text", + value: "" + }; + } + function thematicBreak3() { + return { + type: "thematicBreak" + }; + } +} +function configure(combined, extensions) { + let index2 = -1; + while (++index2 < extensions.length) { + const value = extensions[index2]; + if (Array.isArray(value)) { + configure(combined, value); + } else { + extension(combined, value); + } + } + return combined; +} +function extension(combined, extension2) { + let key; + for (key in extension2) { + if (own4.call(extension2, key)) { + const list3 = key === "canContainEols" || key === "transforms"; + const maybe = own4.call(combined, key) ? combined[key] : void 0; + const left = maybe || (combined[key] = list3 ? [] : {}); + const right = extension2[key]; + if (right) { + if (list3) { + combined[key] = [...left, ...right]; + } else { + Object.assign(left, right); + } + } + } + } +} +function defaultOnError(left, right) { + if (left) { + throw new Error( + "Cannot close `" + left.type + "` (" + stringifyPosition({ + start: left.start, + end: left.end + }) + "): a different token (`" + right.type + "`, " + stringifyPosition({ + start: right.start, + end: right.end + }) + ") is open" + ); + } else { + throw new Error( + "Cannot close document, a token (`" + right.type + "`, " + stringifyPosition({ + start: right.start, + end: right.end + }) + ") is still open" + ); + } +} + +// node_modules/@mdx-js/mdx/node_modules/remark-parse/lib/index.js +function remarkParse(options) { + const parser = (doc) => { + const settings = this.data("settings"); + return fromMarkdown( + doc, + Object.assign({}, settings, options, { + extensions: this.data("micromarkExtensions") || [], + mdastExtensions: this.data("fromMarkdownExtensions") || [] + }) + ); + }; + Object.assign(this, { Parser: parser }); +} + +// node_modules/@mdx-js/mdx/node_modules/remark-parse/index.js +var remark_parse_default = remarkParse; + +// node_modules/@mdx-js/mdx/node_modules/unist-builder/index.js +var u = function(type, props, value) { + var node = { type: String(type) }; + if ((value === void 0 || value === null) && (typeof props === "string" || Array.isArray(props))) { + value = props; + } else { + Object.assign(node, props); + } + if (Array.isArray(value)) { + node.children = value; + } else if (value !== void 0 && value !== null) { + node.value = String(value); + } + return node; +}; + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/traverse.js +var own5 = {}.hasOwnProperty; +function unknown(h, node) { + const data2 = node.data || {}; + if ("value" in node && !(own5.call(data2, "hName") || own5.call(data2, "hProperties") || own5.call(data2, "hChildren"))) { + return h.augment(node, u("text", node.value)); + } + return h(node, "div", all2(h, node)); +} +function one2(h, node, parent) { + const type = node && node.type; + let fn; + if (!type) { + throw new Error("Expected node, got `" + node + "`"); + } + if (own5.call(h.handlers, type)) { + fn = h.handlers[type]; + } else if (h.passThrough && h.passThrough.includes(type)) { + fn = returnNode; + } else { + fn = h.unknownHandler; + } + return (typeof fn === "function" ? fn : unknown)(h, node, parent); +} +function returnNode(h, node) { + return "children" in node ? { ...node, children: all2(h, node) } : node; +} +function all2(h, parent) { + const values = []; + if ("children" in parent) { + const nodes = parent.children; + let index2 = -1; + while (++index2 < nodes.length) { + const result = one2(h, nodes[index2], parent); + if (result) { + if (index2 && nodes[index2 - 1].type === "break") { + if (!Array.isArray(result) && result.type === "text") { + result.value = result.value.replace(/^\s+/, ""); + } + if (!Array.isArray(result) && result.type === "element") { + const head = result.children[0]; + if (head && head.type === "text") { + head.value = head.value.replace(/^\s+/, ""); + } + } + } + if (Array.isArray(result)) { + values.push(...result); + } else { + values.push(result); + } + } + } + } + return values; +} + +// node_modules/unist-util-is/index.js +var convert = function(test) { + if (test === void 0 || test === null) { + return ok; + } + if (typeof test === "string") { + return typeFactory(test); + } + if (typeof test === "object") { + return Array.isArray(test) ? anyFactory(test) : propsFactory(test); + } + if (typeof test === "function") { + return castFactory(test); + } + throw new Error("Expected function, string, or object as test"); +}; +function anyFactory(tests) { + const checks2 = []; + let index2 = -1; + while (++index2 < tests.length) { + checks2[index2] = convert(tests[index2]); + } + return castFactory(any); + function any(...parameters) { + let index3 = -1; + while (++index3 < checks2.length) { + if (checks2[index3].call(this, ...parameters)) + return true; + } + return false; + } +} +function propsFactory(check) { + return castFactory(all4); + function all4(node) { + let key; + for (key in check) { + if (node[key] !== check[key]) + return false; + } + return true; + } +} +function typeFactory(check) { + return castFactory(type); + function type(node) { + return node && node.type === check; + } +} +function castFactory(check) { + return assertion; + function assertion(...parameters) { + return Boolean(check.call(this, ...parameters)); + } +} +function ok() { + return true; +} + +// node_modules/unist-util-visit-parents/color.js +function color2(d) { + return "\x1B[33m" + d + "\x1B[39m"; +} + +// node_modules/unist-util-visit-parents/index.js +var CONTINUE2 = true; +var SKIP2 = "skip"; +var EXIT2 = false; +var visitParents = function(tree, test, visitor, reverse) { + if (typeof test === "function" && typeof visitor !== "function") { + reverse = visitor; + visitor = test; + test = null; + } + const is = convert(test); + const step = reverse ? -1 : 1; + factory2(tree, null, [])(); + function factory2(node, index2, parents) { + const value = typeof node === "object" && node !== null ? node : {}; + let name2; + if (typeof value.type === "string") { + name2 = typeof value.tagName === "string" ? value.tagName : typeof value.name === "string" ? value.name : void 0; + Object.defineProperty(visit3, "name", { + value: "node (" + color2(value.type + (name2 ? "<" + name2 + ">" : "")) + ")" + }); + } + return visit3; + function visit3() { + let result = []; + let subresult; + let offset2; + let grandparents; + if (!test || is(node, index2, parents[parents.length - 1] || null)) { + result = toResult2(visitor(node, parents)); + if (result[0] === EXIT2) { + return result; + } + } + if (node.children && result[0] !== SKIP2) { + offset2 = (reverse ? node.children.length : -1) + step; + grandparents = parents.concat(node); + while (offset2 > -1 && offset2 < node.children.length) { + subresult = factory2(node.children[offset2], offset2, grandparents)(); + if (subresult[0] === EXIT2) { + return subresult; + } + offset2 = typeof subresult[1] === "number" ? subresult[1] : offset2 + step; + } + } + return result; + } + } +}; +function toResult2(value) { + if (Array.isArray(value)) { + return value; + } + if (typeof value === "number") { + return [CONTINUE2, value]; + } + return [value]; +} + +// node_modules/@mdx-js/mdx/node_modules/unist-util-visit/index.js +var visit2 = function(tree, test, visitor, reverse) { + if (typeof test === "function" && typeof visitor !== "function") { + reverse = visitor; + visitor = test; + test = null; + } + visitParents(tree, test, overload, reverse); + function overload(node, parents) { + const parent = parents[parents.length - 1]; + return visitor( + node, + parent ? parent.children.indexOf(node) : null, + parent + ); + } +}; + +// node_modules/unist-util-position/index.js +var pointStart = point2("start"); +var pointEnd = point2("end"); +function position2(node) { + return { start: pointStart(node), end: pointEnd(node) }; +} +function point2(type) { + return point3; + function point3(node) { + const point4 = node && node.position && node.position[type] || {}; + return { + line: point4.line || null, + column: point4.column || null, + offset: point4.offset > -1 ? point4.offset : null + }; + } +} + +// node_modules/@mdx-js/mdx/node_modules/unist-util-generated/index.js +function generated(node) { + return !node || !node.position || !node.position.start || !node.position.start.line || !node.position.start.column || !node.position.end || !node.position.end.line || !node.position.end.column; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-definitions/index.js +var own6 = {}.hasOwnProperty; +function definitions(node) { + const cache = /* @__PURE__ */ Object.create(null); + if (!node || !node.type) { + throw new Error("mdast-util-definitions expected node"); + } + visit2(node, "definition", (definition3) => { + const id = clean(definition3.identifier); + if (id && !own6.call(cache, id)) { + cache[id] = definition3; + } + }); + return definition2; + function definition2(identifier) { + const id = clean(identifier); + return id && own6.call(cache, id) ? cache[id] : null; + } +} +function clean(value) { + return String(value || "").toUpperCase(); +} + +// node_modules/micromark-util-sanitize-uri/index.js +function normalizeUri(value) { + const result = []; + let index2 = -1; + let start3 = 0; + let skip = 0; + while (++index2 < value.length) { + const code2 = value.charCodeAt(index2); + let replace = ""; + if (code2 === 37 && asciiAlphanumeric(value.charCodeAt(index2 + 1)) && asciiAlphanumeric(value.charCodeAt(index2 + 2))) { + skip = 2; + } else if (code2 < 128) { + if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code2))) { + replace = String.fromCharCode(code2); + } + } else if (code2 > 55295 && code2 < 57344) { + const next = value.charCodeAt(index2 + 1); + if (code2 < 56320 && next > 56319 && next < 57344) { + replace = String.fromCharCode(code2, next); + skip = 1; + } else { + replace = "\uFFFD"; + } + } else { + replace = String.fromCharCode(code2); + } + if (replace) { + result.push(value.slice(start3, index2), encodeURIComponent(replace)); + start3 = index2 + skip + 1; + replace = ""; + } + if (skip) { + index2 += skip; + skip = 0; + } + } + return result.join("") + value.slice(start3); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/wrap.js +function wrap2(nodes, loose) { + const result = []; + let index2 = -1; + if (loose) { + result.push(u("text", "\n")); + } + while (++index2 < nodes.length) { + if (index2) + result.push(u("text", "\n")); + result.push(nodes[index2]); + } + if (loose && nodes.length > 0) { + result.push(u("text", "\n")); + } + return result; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/footer.js +function footer(h) { + let index2 = -1; + const listItems = []; + while (++index2 < h.footnoteOrder.length) { + const def = h.footnoteById[h.footnoteOrder[index2].toUpperCase()]; + if (!def) { + continue; + } + const content3 = all2(h, def); + const id = String(def.identifier); + const safeId = normalizeUri(id.toLowerCase()); + let referenceIndex = 0; + const backReferences = []; + while (++referenceIndex <= h.footnoteCounts[id]) { + const backReference = { + type: "element", + tagName: "a", + properties: { + href: "#" + h.clobberPrefix + "fnref-" + safeId + (referenceIndex > 1 ? "-" + referenceIndex : ""), + dataFootnoteBackref: true, + className: ["data-footnote-backref"], + ariaLabel: h.footnoteBackLabel + }, + children: [{ type: "text", value: "\u21A9" }] + }; + if (referenceIndex > 1) { + backReference.children.push({ + type: "element", + tagName: "sup", + children: [{ type: "text", value: String(referenceIndex) }] + }); + } + if (backReferences.length > 0) { + backReferences.push({ type: "text", value: " " }); + } + backReferences.push(backReference); + } + const tail = content3[content3.length - 1]; + if (tail && tail.type === "element" && tail.tagName === "p") { + const tailTail = tail.children[tail.children.length - 1]; + if (tailTail && tailTail.type === "text") { + tailTail.value += " "; + } else { + tail.children.push({ type: "text", value: " " }); + } + tail.children.push(...backReferences); + } else { + content3.push(...backReferences); + } + const listItem2 = { + type: "element", + tagName: "li", + properties: { id: h.clobberPrefix + "fn-" + safeId }, + children: wrap2(content3, true) + }; + if (def.position) { + listItem2.position = def.position; + } + listItems.push(listItem2); + } + if (listItems.length === 0) { + return null; + } + return { + type: "element", + tagName: "section", + properties: { dataFootnotes: true, className: ["footnotes"] }, + children: [ + { + type: "element", + tagName: h.footnoteLabelTagName, + properties: { + ...JSON.parse(JSON.stringify(h.footnoteLabelProperties)), + id: "footnote-label" + }, + children: [u("text", h.footnoteLabel)] + }, + { type: "text", value: "\n" }, + { + type: "element", + tagName: "ol", + properties: {}, + children: wrap2(listItems, true) + }, + { type: "text", value: "\n" } + ] + }; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +function blockquote(h, node) { + return h(node, "blockquote", wrap2(all2(h, node), true)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/break.js +function hardBreak(h, node) { + return [h(node, "br"), u("text", "\n")]; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/code.js +function code(h, node) { + const value = node.value ? node.value + "\n" : ""; + const lang = node.lang && node.lang.match(/^[^ \t]+(?=[ \t]|$)/); + const props = {}; + if (lang) { + props.className = ["language-" + lang]; + } + const code2 = h(node, "code", props, [u("text", value)]); + if (node.meta) { + code2.data = { meta: node.meta }; + } + return h(node.position, "pre", [code2]); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/delete.js +function strikethrough(h, node) { + return h(node, "del", all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +function emphasis(h, node) { + return h(node, "em", all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +function footnoteReference(h, node) { + const id = String(node.identifier); + const safeId = normalizeUri(id.toLowerCase()); + const index2 = h.footnoteOrder.indexOf(id); + let counter; + if (index2 === -1) { + h.footnoteOrder.push(id); + h.footnoteCounts[id] = 1; + counter = h.footnoteOrder.length; + } else { + h.footnoteCounts[id]++; + counter = index2 + 1; + } + const reuseCounter = h.footnoteCounts[id]; + return h(node, "sup", [ + h( + node.position, + "a", + { + href: "#" + h.clobberPrefix + "fn-" + safeId, + id: h.clobberPrefix + "fnref-" + safeId + (reuseCounter > 1 ? "-" + reuseCounter : ""), + dataFootnoteRef: true, + ariaDescribedBy: "footnote-label" + }, + [u("text", String(counter))] + ) + ]); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/footnote.js +function footnote(h, node) { + const footnoteById = h.footnoteById; + let no = 1; + while (no in footnoteById) + no++; + const identifier = String(no); + footnoteById[identifier] = { + type: "footnoteDefinition", + identifier, + children: [{ type: "paragraph", children: node.children }], + position: node.position + }; + return footnoteReference(h, { + type: "footnoteReference", + identifier, + position: node.position + }); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/heading.js +function heading(h, node) { + return h(node, "h" + node.depth, all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/html.js +function html(h, node) { + return h.dangerous ? h.augment(node, u("raw", node.value)) : null; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/revert.js +function revert(h, node) { + const subtype = node.referenceType; + let suffix = "]"; + if (subtype === "collapsed") { + suffix += "[]"; + } else if (subtype === "full") { + suffix += "[" + (node.label || node.identifier) + "]"; + } + if (node.type === "imageReference") { + return u("text", "![" + node.alt + suffix); + } + const contents = all2(h, node); + const head = contents[0]; + if (head && head.type === "text") { + head.value = "[" + head.value; + } else { + contents.unshift(u("text", "[")); + } + const tail = contents[contents.length - 1]; + if (tail && tail.type === "text") { + tail.value += suffix; + } else { + contents.push(u("text", suffix)); + } + return contents; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +function imageReference(h, node) { + const def = h.definition(node.identifier); + if (!def) { + return revert(h, node); + } + const props = { src: normalizeUri(def.url || ""), alt: node.alt }; + if (def.title !== null && def.title !== void 0) { + props.title = def.title; + } + return h(node, "img", props); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/image.js +function image(h, node) { + const props = { src: normalizeUri(node.url), alt: node.alt }; + if (node.title !== null && node.title !== void 0) { + props.title = node.title; + } + return h(node, "img", props); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +function inlineCode(h, node) { + return h(node, "code", [u("text", node.value.replace(/\r?\n|\r/g, " "))]); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +function linkReference(h, node) { + const def = h.definition(node.identifier); + if (!def) { + return revert(h, node); + } + const props = { href: normalizeUri(def.url || "") }; + if (def.title !== null && def.title !== void 0) { + props.title = def.title; + } + return h(node, "a", props, all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/link.js +function link(h, node) { + const props = { href: normalizeUri(node.url) }; + if (node.title !== null && node.title !== void 0) { + props.title = node.title; + } + return h(node, "a", props, all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +function listItem(h, node, parent) { + const result = all2(h, node); + const loose = parent ? listLoose(parent) : listItemLoose(node); + const props = {}; + const wrapped = []; + if (typeof node.checked === "boolean") { + let paragraph2; + if (result[0] && result[0].type === "element" && result[0].tagName === "p") { + paragraph2 = result[0]; + } else { + paragraph2 = h(null, "p", []); + result.unshift(paragraph2); + } + if (paragraph2.children.length > 0) { + paragraph2.children.unshift(u("text", " ")); + } + paragraph2.children.unshift( + h(null, "input", { + type: "checkbox", + checked: node.checked, + disabled: true + }) + ); + props.className = ["task-list-item"]; + } + let index2 = -1; + while (++index2 < result.length) { + const child = result[index2]; + if (loose || index2 !== 0 || child.type !== "element" || child.tagName !== "p") { + wrapped.push(u("text", "\n")); + } + if (child.type === "element" && child.tagName === "p" && !loose) { + wrapped.push(...child.children); + } else { + wrapped.push(child); + } + } + const tail = result[result.length - 1]; + if (tail && (loose || !("tagName" in tail) || tail.tagName !== "p")) { + wrapped.push(u("text", "\n")); + } + return h(node, "li", props, wrapped); +} +function listLoose(node) { + let loose = node.spread; + const children = node.children; + let index2 = -1; + while (!loose && ++index2 < children.length) { + loose = listItemLoose(children[index2]); + } + return Boolean(loose); +} +function listItemLoose(node) { + const spread = node.spread; + return spread === void 0 || spread === null ? node.children.length > 1 : spread; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/list.js +function list2(h, node) { + const props = {}; + const name2 = node.ordered ? "ol" : "ul"; + const items = all2(h, node); + let index2 = -1; + if (typeof node.start === "number" && node.start !== 1) { + props.start = node.start; + } + while (++index2 < items.length) { + const item = items[index2]; + if (item.type === "element" && item.tagName === "li" && item.properties && Array.isArray(item.properties.className) && item.properties.className.includes("task-list-item")) { + props.className = ["contains-task-list"]; + break; + } + } + return h(node, name2, props, wrap2(items, true)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +function paragraph(h, node) { + return h(node, "p", all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/root.js +function root(h, node) { + return h.augment(node, u("root", wrap2(all2(h, node)))); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/strong.js +function strong(h, node) { + return h(node, "strong", all2(h, node)); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/table.js +function table(h, node) { + const rows = node.children; + let index2 = -1; + const align = node.align || []; + const result = []; + while (++index2 < rows.length) { + const row = rows[index2].children; + const name2 = index2 === 0 ? "th" : "td"; + const out = []; + let cellIndex = -1; + const length = node.align ? align.length : row.length; + while (++cellIndex < length) { + const cell = row[cellIndex]; + out.push( + h(cell, name2, { align: align[cellIndex] }, cell ? all2(h, cell) : []) + ); + } + result[index2] = h(rows[index2], "tr", wrap2(out, true)); + } + return h( + node, + "table", + wrap2( + [h(result[0].position, "thead", wrap2([result[0]], true))].concat( + result[1] ? h( + { + start: pointStart(result[1]), + end: pointEnd(result[result.length - 1]) + }, + "tbody", + wrap2(result.slice(1), true) + ) : [] + ), + true + ) + ); +} + +// node_modules/trim-lines/index.js +var tab = 9; +var space = 32; +function trimLines(value) { + const source = String(value); + const search2 = /\r?\n|\r/g; + let match = search2.exec(source); + let last = 0; + const lines = []; + while (match) { + lines.push( + trimLine(source.slice(last, match.index), last > 0, true), + match[0] + ); + last = match.index + match[0].length; + match = search2.exec(source); + } + lines.push(trimLine(source.slice(last), last > 0, false)); + return lines.join(""); +} +function trimLine(value, start3, end) { + let startIndex = 0; + let endIndex = value.length; + if (start3) { + let code2 = value.codePointAt(startIndex); + while (code2 === tab || code2 === space) { + startIndex++; + code2 = value.codePointAt(startIndex); + } + } + if (end) { + let code2 = value.codePointAt(endIndex - 1); + while (code2 === tab || code2 === space) { + endIndex--; + code2 = value.codePointAt(endIndex - 1); + } + } + return endIndex > startIndex ? value.slice(startIndex, endIndex) : ""; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/text.js +function text3(h, node) { + return h.augment(node, u("text", trimLines(String(node.value)))); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +function thematicBreak2(h, node) { + return h(node, "hr"); +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/handlers/index.js +var handlers = { + blockquote, + break: hardBreak, + code, + delete: strikethrough, + emphasis, + footnoteReference, + footnote, + heading, + html, + imageReference, + image, + inlineCode, + linkReference, + link, + listItem, + list: list2, + paragraph, + root, + strong, + table, + text: text3, + thematicBreak: thematicBreak2, + toml: ignore, + yaml: ignore, + definition: ignore, + footnoteDefinition: ignore +}; +function ignore() { + return null; +} + +// node_modules/@mdx-js/mdx/node_modules/mdast-util-to-hast/lib/index.js +var own7 = {}.hasOwnProperty; +function factory(tree, options) { + const settings = options || {}; + const dangerous = settings.allowDangerousHtml || false; + const footnoteById = {}; + h.dangerous = dangerous; + h.clobberPrefix = settings.clobberPrefix === void 0 || settings.clobberPrefix === null ? "user-content-" : settings.clobberPrefix; + h.footnoteLabel = settings.footnoteLabel || "Footnotes"; + h.footnoteLabelTagName = settings.footnoteLabelTagName || "h2"; + h.footnoteLabelProperties = settings.footnoteLabelProperties || { + className: ["sr-only"] + }; + h.footnoteBackLabel = settings.footnoteBackLabel || "Back to content"; + h.definition = definitions(tree); + h.footnoteById = footnoteById; + h.footnoteOrder = []; + h.footnoteCounts = {}; + h.augment = augment; + h.handlers = { ...handlers, ...settings.handlers }; + h.unknownHandler = settings.unknownHandler; + h.passThrough = settings.passThrough; + visit2(tree, "footnoteDefinition", (definition2) => { + const id = String(definition2.identifier).toUpperCase(); + if (!own7.call(footnoteById, id)) { + footnoteById[id] = definition2; + } + }); + return h; + function augment(left, right) { + if (left && "data" in left && left.data) { + const data2 = left.data; + if (data2.hName) { + if (right.type !== "element") { + right = { + type: "element", + tagName: "", + properties: {}, + children: [] + }; + } + right.tagName = data2.hName; + } + if (right.type === "element" && data2.hProperties) { + right.properties = { ...right.properties, ...data2.hProperties }; + } + if ("children" in right && right.children && data2.hChildren) { + right.children = data2.hChildren; + } + } + if (left) { + const ctx = "type" in left ? left : { position: left }; + if (!generated(ctx)) { + right.position = { start: pointStart(ctx), end: pointEnd(ctx) }; + } + } + return right; + } + function h(node, tagName, props, children) { + if (Array.isArray(props)) { + children = props; + props = {}; + } + return augment(node, { + type: "element", + tagName, + properties: props || {}, + children: children || [] + }); + } +} +function toHast(tree, options) { + const h = factory(tree, options); + const node = one2(h, tree, null); + const foot = footer(h); + if (foot) { + node.children.push(u("text", "\n"), foot); + } + return Array.isArray(node) ? { type: "root", children: node } : node; +} + +// node_modules/@mdx-js/mdx/node_modules/remark-rehype/lib/index.js +var remarkRehype = function(destination, options) { + return destination && "run" in destination ? bridge(destination, options) : mutate(destination || options); +}; +var lib_default = remarkRehype; +function bridge(destination, options) { + return (node, file, next) => { + destination.run(toHast(node, options), file, (error) => { + next(error); + }); + }; +} +function mutate(options) { + return (node) => toHast(node, options); +} + +// node_modules/estree-walker/src/walker.js +var WalkerBase = class { + constructor() { + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + this.context = { + skip: () => this.should_skip = true, + remove: () => this.should_remove = true, + replace: (node) => this.replacement = node + }; + } + replace(parent, prop, index2, node) { + if (parent) { + if (index2 !== null) { + parent[prop][index2] = node; + } else { + parent[prop] = node; + } + } + } + remove(parent, prop, index2) { + if (parent) { + if (index2 !== null) { + parent[prop].splice(index2, 1); + } else { + delete parent[prop]; + } + } + } +}; + +// node_modules/estree-walker/src/sync.js +var SyncWalker = class extends WalkerBase { + constructor(enter, leave) { + super(); + this.enter = enter; + this.leave = leave; + } + visit(node, parent, prop, index2) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + this.enter.call(this.context, node, parent, prop, index2); + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index2, node); + } + if (this.should_remove) { + this.remove(parent, prop, index2); + } + const skipped = this.should_skip; + const removed = this.should_remove; + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + if (skipped) + return node; + if (removed) + return null; + } + for (const key in node) { + const value = node[key]; + if (typeof value !== "object") { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === "string") { + if (!this.visit(value[i], node, key, i)) { + i--; + } + } + } + } else if (value !== null && typeof value.type === "string") { + this.visit(value, node, key, null); + } + } + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + this.leave.call(this.context, node, parent, prop, index2); + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index2, node); + } + if (this.should_remove) { + this.remove(parent, prop, index2); + } + const removed = this.should_remove; + this.replacement = _replacement; + this.should_remove = _should_remove; + if (removed) + return null; + } + } + return node; + } +}; + +// node_modules/estree-walker/src/index.js +function walk(ast, { enter, leave }) { + const instance = new SyncWalker(enter, leave); + return instance.visit(ast, null); +} + +// node_modules/estree-util-build-jsx/lib/index.js +var regex = /@(jsx|jsxFrag|jsxImportSource|jsxRuntime)\s+(\S+)/g; +function buildJsx(tree, options = {}) { + let automatic = options.runtime === "automatic"; + const annotations = {}; + const imports = {}; + walk(tree, { + enter(node) { + if (node.type === "Program") { + const comments = node.comments || []; + let index2 = -1; + while (++index2 < comments.length) { + regex.lastIndex = 0; + let match = regex.exec(comments[index2].value); + while (match) { + annotations[match[1]] = match[2]; + match = regex.exec(comments[index2].value); + } + } + if (annotations.jsxRuntime) { + if (annotations.jsxRuntime === "automatic") { + automatic = true; + if (annotations.jsx) { + throw new Error("Unexpected `@jsx` pragma w/ automatic runtime"); + } + if (annotations.jsxFrag) { + throw new Error( + "Unexpected `@jsxFrag` pragma w/ automatic runtime" + ); + } + } else if (annotations.jsxRuntime === "classic") { + automatic = false; + if (annotations.jsxImportSource) { + throw new Error( + "Unexpected `@jsxImportSource` w/ classic runtime" + ); + } + } else { + throw new Error( + "Unexpected `jsxRuntime` `" + annotations.jsxRuntime + "`, expected `automatic` or `classic`" + ); + } + } + } + }, + leave(node) { + if (node.type === "Program") { + const specifiers = []; + if (imports.fragment) { + specifiers.push({ + type: "ImportSpecifier", + imported: { type: "Identifier", name: "Fragment" }, + local: { type: "Identifier", name: "_Fragment" } + }); + } + if (imports.jsx) { + specifiers.push({ + type: "ImportSpecifier", + imported: { type: "Identifier", name: "jsx" }, + local: { type: "Identifier", name: "_jsx" } + }); + } + if (imports.jsxs) { + specifiers.push({ + type: "ImportSpecifier", + imported: { type: "Identifier", name: "jsxs" }, + local: { type: "Identifier", name: "_jsxs" } + }); + } + if (imports.jsxDEV) { + specifiers.push({ + type: "ImportSpecifier", + imported: { type: "Identifier", name: "jsxDEV" }, + local: { type: "Identifier", name: "_jsxDEV" } + }); + } + if (specifiers.length > 0) { + node.body.unshift({ + type: "ImportDeclaration", + specifiers, + source: { + type: "Literal", + value: (annotations.jsxImportSource || options.importSource || "react") + (options.development ? "/jsx-dev-runtime" : "/jsx-runtime") + } + }); + } + } + if (node.type !== "JSXElement" && node.type !== "JSXFragment") { + return; + } + const children = []; + let index2 = -1; + while (++index2 < node.children.length) { + const child = node.children[index2]; + if (child.type === "JSXExpressionContainer") { + if (child.expression.type !== "JSXEmptyExpression") { + children.push(child.expression); + } + } else if (child.type === "JSXText") { + const value = child.value.replace(/\t/g, " ").replace(/ *(\r?\n|\r) */g, "\n").replace(/\n+/g, "\n").replace(/\n+$/, "").replace(/\n/g, " "); + if (value) { + children.push(create(child, { type: "Literal", value })); + } + } else { + children.push(child); + } + } + let name2; + let fields = []; + const objects = []; + let parameters = []; + let key; + if (node.type === "JSXElement") { + name2 = toIdentifier(node.openingElement.name); + if (name2.type === "Identifier" && /^[a-z]/.test(name2.name)) { + name2 = create(name2, { type: "Literal", value: name2.name }); + } + let spread; + const attributes = node.openingElement.attributes; + let index3 = -1; + while (++index3 < attributes.length) { + const attribute = attributes[index3]; + if (attribute.type === "JSXSpreadAttribute") { + if (fields.length > 0) { + objects.push({ type: "ObjectExpression", properties: fields }); + fields = []; + } + objects.push(attribute.argument); + spread = true; + } else { + const prop = toProperty(attribute); + if (automatic && prop.key.type === "Identifier" && prop.key.name === "key") { + if (spread) { + throw new Error( + "Expected `key` to come before any spread expressions" + ); + } + key = prop.value; + } else { + fields.push(prop); + } + } + } + } else if (automatic) { + imports.fragment = true; + name2 = { type: "Identifier", name: "_Fragment" }; + } else { + name2 = toMemberExpression( + annotations.jsxFrag || options.pragmaFrag || "React.Fragment" + ); + } + if (automatic) { + if (children.length > 0) { + fields.push({ + type: "Property", + key: { type: "Identifier", name: "children" }, + value: children.length > 1 ? { type: "ArrayExpression", elements: children } : children[0], + kind: "init", + method: false, + shorthand: false, + computed: false + }); + } + } else { + parameters = children; + } + if (fields.length > 0) { + objects.push({ type: "ObjectExpression", properties: fields }); + } + let props; + let callee; + if (objects.length > 1) { + if (objects[0].type !== "ObjectExpression") { + objects.unshift({ type: "ObjectExpression", properties: [] }); + } + props = { + type: "CallExpression", + callee: toMemberExpression("Object.assign"), + arguments: objects, + optional: false + }; + } else if (objects.length > 0) { + props = objects[0]; + } + if (automatic) { + parameters.push(props || { type: "ObjectExpression", properties: [] }); + if (key) { + parameters.push(key); + } else if (options.development) { + parameters.push({ type: "Identifier", name: "undefined" }); + } + const isStaticChildren = children.length > 1; + if (options.development) { + imports.jsxDEV = true; + callee = { + type: "Identifier", + name: "_jsxDEV" + }; + parameters.push({ type: "Literal", value: isStaticChildren }); + const source = { + type: "ObjectExpression", + properties: [ + { + type: "Property", + method: false, + shorthand: false, + computed: false, + kind: "init", + key: { type: "Identifier", name: "fileName" }, + value: { + type: "Literal", + value: options.filePath || "" + } + } + ] + }; + if (node.loc) { + source.properties.push( + { + type: "Property", + method: false, + shorthand: false, + computed: false, + kind: "init", + key: { type: "Identifier", name: "lineNumber" }, + value: { type: "Literal", value: node.loc.start.line } + }, + { + type: "Property", + method: false, + shorthand: false, + computed: false, + kind: "init", + key: { type: "Identifier", name: "columnNumber" }, + value: { type: "Literal", value: node.loc.start.column + 1 } + } + ); + } + parameters.push(source, { type: "ThisExpression" }); + } else if (isStaticChildren) { + imports.jsxs = true; + callee = { type: "Identifier", name: "_jsxs" }; + } else { + imports.jsx = true; + callee = { type: "Identifier", name: "_jsx" }; + } + } else { + if (props || parameters.length > 0) { + parameters.unshift(props || { type: "Literal", value: null }); + } + callee = toMemberExpression( + annotations.jsx || options.pragma || "React.createElement" + ); + } + parameters.unshift(name2); + this.replace( + create(node, { + type: "CallExpression", + callee, + arguments: parameters, + optional: false + }) + ); + } + }); + return tree; +} +function toProperty(node) { + let value; + if (node.value) { + if (node.value.type === "JSXExpressionContainer") { + value = node.value.expression; + } else { + value = node.value; + delete value.raw; + } + } else { + value = { type: "Literal", value: true }; + } + return create(node, { + type: "Property", + key: toIdentifier(node.name), + value, + kind: "init", + method: false, + shorthand: false, + computed: false + }); +} +function toIdentifier(node) { + let replace; + if (node.type === "JSXMemberExpression") { + const id = toIdentifier(node.property); + replace = { + type: "MemberExpression", + object: toIdentifier(node.object), + property: id, + computed: id.type === "Literal", + optional: false + }; + } else if (node.type === "JSXNamespacedName") { + replace = { + type: "Literal", + value: node.namespace.name + ":" + node.name.name + }; + } else { + replace = name(node.name) ? { type: "Identifier", name: node.name } : { type: "Literal", value: node.name }; + } + return create(node, replace); +} +function toMemberExpression(id) { + const identifiers = id.split("."); + let index2 = -1; + let result; + while (++index2 < identifiers.length) { + const prop = name(identifiers[index2]) ? { type: "Identifier", name: identifiers[index2] } : { type: "Literal", value: identifiers[index2] }; + result = result ? { + type: "MemberExpression", + object: result, + property: prop, + computed: Boolean(index2 && prop.type === "Literal"), + optional: false + } : prop; + } + return result; +} +function create(from, node) { + const fields = ["start", "end", "loc", "range", "comments"]; + let index2 = -1; + while (++index2 < fields.length) { + const field = fields[index2]; + if (field in from) { + node[field] = from[field]; + } + } + return node; +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-create.js +function create2(template, node) { + const fields = ["start", "end", "loc", "range", "comments"]; + let index2 = -1; + while (++index2 < fields.length) { + const field = fields[index2]; + if (field in template) { + node[field] = template[field]; + } + } + return node; +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-specifiers-to-declarations.js +function specifiersToDeclarations(specifiers, init) { + let index2 = -1; + const declarations = []; + const otherSpecifiers = []; + let importNamespaceSpecifier; + while (++index2 < specifiers.length) { + const specifier = specifiers[index2]; + if (specifier.type === "ImportNamespaceSpecifier") { + importNamespaceSpecifier = specifier; + } else { + otherSpecifiers.push(specifier); + } + } + if (importNamespaceSpecifier) { + declarations.push( + create2(importNamespaceSpecifier, { + type: "VariableDeclarator", + id: importNamespaceSpecifier.local, + init + }) + ); + } + declarations.push({ + type: "VariableDeclarator", + id: { + type: "ObjectPattern", + properties: otherSpecifiers.map((specifier) => { + let key = specifier.type === "ImportSpecifier" ? specifier.imported : specifier.type === "ExportSpecifier" ? specifier.exported : { type: "Identifier", name: "default" }; + let value = specifier.local; + if (specifier.type === "ExportSpecifier") { + value = key; + key = specifier.local; + } + return create2(specifier, { + type: "Property", + kind: "init", + shorthand: key.name === value.name, + method: false, + computed: false, + key, + value + }); + }) + }, + init: importNamespaceSpecifier ? { type: "Identifier", name: importNamespaceSpecifier.local.name } : init + }); + return declarations; +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-to-id-or-member-expression.js +var toIdOrMemberExpression = toIdOrMemberExpressionFactory( + "Identifier", + "MemberExpression", + name +); +var toJsxIdOrMemberExpression = toIdOrMemberExpressionFactory( + "JSXIdentifier", + "JSXMemberExpression", + isJsxIdentifierName +); +function toIdOrMemberExpressionFactory(idType, memberType, isIdentifier) { + return toIdOrMemberExpression2; + function toIdOrMemberExpression2(ids) { + let index2 = -1; + let object; + while (++index2 < ids.length) { + const name2 = ids[index2]; + const valid2 = typeof name2 === "string" && isIdentifier(name2); + if (idType === "JSXIdentifier" && !valid2) { + throw new Error("Cannot turn `" + name2 + "` into a JSX identifier"); + } + const id = valid2 ? { type: idType, name: name2 } : { type: "Literal", value: name2 }; + object = object ? { + type: memberType, + object, + property: id, + computed: id.type === "Literal", + optional: false + } : id; + } + if (!object) + throw new Error("Expected non-empty `ids` to be passed"); + if (object.type === "Literal") + throw new Error("Expected identifier as left-most value"); + return object; + } +} +function isJsxIdentifierName(name2) { + let index2 = -1; + while (++index2 < name2.length) { + if (!(index2 ? jsxCont : start2)(name2.charCodeAt(index2))) + return false; + } + return index2 > 0; +} +function jsxCont(code2) { + return code2 === 45 || cont2(code2); +} + +// node_modules/@mdx-js/mdx/lib/plugin/recma-jsx-build.js +function recmaJsxBuild(options = {}) { + const { outputFormat } = options; + return (tree) => { + buildJsx(tree); + if (outputFormat === "function-body" && tree.body[0] && tree.body[0].type === "ImportDeclaration" && typeof tree.body[0].source.value === "string" && /\/jsx-runtime$/.test(tree.body[0].source.value)) { + tree.body[0] = { + type: "VariableDeclaration", + kind: "const", + declarations: specifiersToDeclarations( + tree.body[0].specifiers, + toIdOrMemberExpression(["arguments", 0]) + ) + }; + } + }; +} + +// node_modules/is-reference/src/index.js +function is_reference(node, parent) { + if (node.type === "MemberExpression") { + return !node.computed && is_reference(node.object, node); + } + if (node.type === "Identifier") { + if (!parent) + return true; + switch (parent.type) { + case "MemberExpression": + return parent.computed || node === parent.object; + case "MethodDefinition": + return parent.computed; + case "PropertyDefinition": + return parent.computed || node === parent.value; + case "Property": + return parent.computed || node === parent.value; + case "ExportSpecifier": + case "ImportSpecifier": + return node === parent.local; + case "LabeledStatement": + case "BreakStatement": + case "ContinueStatement": + return false; + default: + return true; + } + } + return false; +} + +// node_modules/periscopic/src/index.js +function analyze(expression) { + const map = /* @__PURE__ */ new WeakMap(); + const globals = /* @__PURE__ */ new Map(); + const scope = new Scope3(null, false); + const references = []; + let current_scope = scope; + walk(expression, { + enter(node, parent) { + switch (node.type) { + case "Identifier": + if (is_reference(node, parent)) { + references.push([current_scope, node]); + } + break; + case "ImportDeclaration": + node.specifiers.forEach((specifier) => { + current_scope.declarations.set(specifier.local.name, specifier); + }); + break; + case "FunctionExpression": + case "FunctionDeclaration": + case "ArrowFunctionExpression": + if (node.type === "FunctionDeclaration") { + if (node.id) { + current_scope.declarations.set(node.id.name, node); + } + map.set(node, current_scope = new Scope3(current_scope, false)); + } else { + map.set(node, current_scope = new Scope3(current_scope, false)); + if (node.type === "FunctionExpression" && node.id) { + current_scope.declarations.set(node.id.name, node); + } + } + node.params.forEach((param) => { + extract_names(param).forEach((name2) => { + current_scope.declarations.set(name2, node); + }); + }); + break; + case "ForStatement": + case "ForInStatement": + case "ForOfStatement": + map.set(node, current_scope = new Scope3(current_scope, true)); + break; + case "BlockStatement": + map.set(node, current_scope = new Scope3(current_scope, true)); + break; + case "ClassDeclaration": + case "VariableDeclaration": + current_scope.add_declaration(node); + break; + case "CatchClause": + map.set(node, current_scope = new Scope3(current_scope, true)); + if (node.param) { + extract_names(node.param).forEach((name2) => { + current_scope.declarations.set(name2, node.param); + }); + } + break; + } + }, + leave(node) { + if (map.has(node)) { + current_scope = current_scope.parent; + } + } + }); + for (let i = references.length - 1; i >= 0; --i) { + const [scope2, reference] = references[i]; + if (!scope2.references.has(reference.name)) { + add_reference(scope2, reference.name); + } + if (!scope2.find_owner(reference.name)) { + globals.set(reference.name, reference); + } + } + return { map, scope, globals }; +} +function add_reference(scope, name2) { + scope.references.add(name2); + if (scope.parent) + add_reference(scope.parent, name2); +} +var Scope3 = class { + constructor(parent, block) { + this.parent = parent; + this.block = block; + this.declarations = /* @__PURE__ */ new Map(); + this.initialised_declarations = /* @__PURE__ */ new Set(); + this.references = /* @__PURE__ */ new Set(); + } + add_declaration(node) { + if (node.type === "VariableDeclaration") { + if (node.kind === "var" && this.block && this.parent) { + this.parent.add_declaration(node); + } else { + const handle_declarator = (declarator) => { + extract_names(declarator.id).forEach((name2) => { + this.declarations.set(name2, node); + if (declarator.init) + this.initialised_declarations.add(name2); + }); + ; + }; + node.declarations.forEach(handle_declarator); + } + } else if (node.id) { + this.declarations.set(node.id.name, node); + } + } + find_owner(name2) { + if (this.declarations.has(name2)) + return this; + return this.parent && this.parent.find_owner(name2); + } + has(name2) { + return this.declarations.has(name2) || !!this.parent && this.parent.has(name2); + } +}; +function extract_names(param) { + return extract_identifiers(param).map((node) => node.name); +} +function extract_identifiers(param, nodes = []) { + switch (param.type) { + case "Identifier": + nodes.push(param); + break; + case "MemberExpression": + let object = param; + while (object.type === "MemberExpression") { + object = object.object; + } + nodes.push(object); + break; + case "ObjectPattern": + const handle_prop = (prop) => { + if (prop.type === "RestElement") { + extract_identifiers(prop.argument, nodes); + } else { + extract_identifiers(prop.value, nodes); + } + }; + param.properties.forEach(handle_prop); + break; + case "ArrayPattern": + const handle_element = (element2) => { + if (element2) + extract_identifiers(element2, nodes); + }; + param.elements.forEach(handle_element); + break; + case "RestElement": + extract_identifiers(param.argument, nodes); + break; + case "AssignmentPattern": + extract_identifiers(param.left, nodes); + break; + } + return nodes; +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-declaration-to-expression.js +function declarationToExpression(declaration) { + if (declaration.type === "FunctionDeclaration") { + return { ...declaration, type: "FunctionExpression" }; + } + if (declaration.type === "ClassDeclaration") { + return { ...declaration, type: "ClassExpression" }; + } + throw new Error("Cannot turn `" + declaration.type + "` into an expression"); +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-is-declaration.js +function isDeclaration(node) { + const type = node && typeof node === "object" && node.type; + return Boolean( + type === "FunctionDeclaration" || type === "ClassDeclaration" || type === "VariableDeclaration" + ); +} + +// node_modules/@mdx-js/mdx/lib/plugin/recma-document.js +function recmaDocument(options = {}) { + const { + baseUrl, + useDynamicImport, + outputFormat = "program", + pragma = "React.createElement", + pragmaFrag = "React.Fragment", + pragmaImportSource = "react", + jsxImportSource = "react", + jsxRuntime = "automatic" + } = options; + return (tree, file) => { + const exportedIdentifiers = []; + const replacement = []; + const pragmas = []; + let exportAllCount = 0; + let layout; + let content3; + let child; + if (!tree.comments) + tree.comments = []; + if (jsxRuntime) { + pragmas.push("@jsxRuntime " + jsxRuntime); + } + if (jsxRuntime === "automatic" && jsxImportSource) { + pragmas.push("@jsxImportSource " + jsxImportSource); + } + if (jsxRuntime === "classic" && pragma) { + pragmas.push("@jsx " + pragma); + } + if (jsxRuntime === "classic" && pragmaFrag) { + pragmas.push("@jsxFrag " + pragmaFrag); + } + if (pragmas.length > 0) { + tree.comments.unshift({ type: "Block", value: pragmas.join(" ") }); + } + if (jsxRuntime === "classic" && pragmaImportSource) { + if (!pragma) { + throw new Error( + "Missing `pragma` in classic runtime with `pragmaImportSource`" + ); + } + handleEsm({ + type: "ImportDeclaration", + specifiers: [ + { + type: "ImportDefaultSpecifier", + local: { type: "Identifier", name: pragma.split(".")[0] } + } + ], + source: { type: "Literal", value: pragmaImportSource } + }); + } + for (child of tree.body) { + if (child.type === "ExportDefaultDeclaration") { + if (layout) { + file.fail( + "Cannot specify multiple layouts (previous: " + stringifyPosition(positionFromEstree(layout)) + ")", + positionFromEstree(child), + "recma-document:duplicate-layout" + ); + } + layout = child; + replacement.push({ + type: "VariableDeclaration", + kind: "const", + declarations: [ + { + type: "VariableDeclarator", + id: { type: "Identifier", name: "MDXLayout" }, + init: isDeclaration(child.declaration) ? declarationToExpression(child.declaration) : child.declaration + } + ] + }); + } else if (child.type === "ExportNamedDeclaration" && child.source) { + const source = child.source; + child.specifiers = child.specifiers.filter((specifier) => { + if (specifier.exported.name === "default") { + if (layout) { + file.fail( + "Cannot specify multiple layouts (previous: " + stringifyPosition(positionFromEstree(layout)) + ")", + positionFromEstree(child), + "recma-document:duplicate-layout" + ); + } + layout = specifier; + handleEsm( + create2(specifier, { + type: "ImportDeclaration", + specifiers: [ + specifier.local.name === "default" ? { + type: "ImportDefaultSpecifier", + local: { type: "Identifier", name: "MDXLayout" } + } : create2(specifier.local, { + type: "ImportSpecifier", + imported: specifier.local, + local: { type: "Identifier", name: "MDXLayout" } + }) + ], + source: create2(source, { type: "Literal", value: source.value }) + }) + ); + return false; + } + return true; + }); + if (child.specifiers.length > 0) { + handleExport(child); + } + } else if (child.type === "ExportNamedDeclaration" || child.type === "ExportAllDeclaration") { + handleExport(child); + } else if (child.type === "ImportDeclaration") { + handleEsm(child); + } else if (child.type === "ExpressionStatement" && (child.expression.type === "JSXFragment" || child.expression.type === "JSXElement")) { + content3 = true; + replacement.push(...createMdxContent(child.expression, Boolean(layout))); + } else { + replacement.push(child); + } + } + if (!content3) { + replacement.push(...createMdxContent(void 0, Boolean(layout))); + } + exportedIdentifiers.push(["MDXContent", "default"]); + if (outputFormat === "function-body") { + replacement.push({ + type: "ReturnStatement", + argument: { + type: "ObjectExpression", + properties: [ + ...Array.from({ length: exportAllCount }).map( + (_, index2) => ({ + type: "SpreadElement", + argument: { type: "Identifier", name: "_exportAll" + (index2 + 1) } + }) + ), + ...exportedIdentifiers.map((d) => { + const prop = { + type: "Property", + kind: "init", + method: false, + computed: false, + shorthand: typeof d === "string", + key: { + type: "Identifier", + name: typeof d === "string" ? d : d[1] + }, + value: { + type: "Identifier", + name: typeof d === "string" ? d : d[0] + } + }; + return prop; + }) + ] + } + }); + } else { + replacement.push({ + type: "ExportDefaultDeclaration", + declaration: { type: "Identifier", name: "MDXContent" } + }); + } + tree.body = replacement; + if (baseUrl) { + walk(tree, { + enter(_node) { + const node = _node; + if (node.type === "MemberExpression" && "object" in node && node.object.type === "MetaProperty" && node.property.type === "Identifier" && node.object.meta.name === "import" && node.object.property.name === "meta" && node.property.name === "url") { + const replacement2 = { type: "Literal", value: baseUrl }; + this.replace(replacement2); + } + } + }); + } + function handleExport(node) { + if (node.type === "ExportNamedDeclaration") { + if (node.declaration) { + exportedIdentifiers.push( + ...analyze(node.declaration).scope.declarations.keys() + ); + } + for (child of node.specifiers) { + exportedIdentifiers.push(child.exported.name); + } + } + handleEsm(node); + } + function handleEsm(node) { + if (baseUrl && node.source) { + let value = String(node.source.value); + try { + value = String(new URL(value)); + } catch { + if (/^\.{0,2}\//.test(value)) { + value = String(new URL(value, baseUrl)); + } + } + node.source = create2(node.source, { type: "Literal", value }); + } + let replace; + let init; + if (outputFormat === "function-body") { + if (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration" && node.source) { + if (!useDynamicImport) { + file.fail( + "Cannot use `import` or `export \u2026 from` in `evaluate` (outputting a function body) by default: please set `useDynamicImport: true` (and probably specify a `baseUrl`)", + positionFromEstree(node), + "recma-document:invalid-esm-statement" + ); + } + if (!node.source) { + throw new Error("Expected `node.source` to be defined"); + } + init = { + type: "AwaitExpression", + argument: create2(node, { + type: "ImportExpression", + source: node.source + }) + }; + if ((node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration") && node.specifiers.length === 0) { + replace = { type: "ExpressionStatement", expression: init }; + } else { + replace = { + type: "VariableDeclaration", + kind: "const", + declarations: node.type === "ExportAllDeclaration" ? [ + { + type: "VariableDeclarator", + id: { + type: "Identifier", + name: "_exportAll" + ++exportAllCount + }, + init + } + ] : specifiersToDeclarations(node.specifiers, init) + }; + } + } else if (node.declaration) { + replace = node.declaration; + } else { + const declarators = node.specifiers.filter( + (specifier) => specifier.local.name !== specifier.exported.name + ).map((specifier) => ({ + type: "VariableDeclarator", + id: specifier.exported, + init: specifier.local + })); + if (declarators.length > 0) { + replace = { + type: "VariableDeclaration", + kind: "const", + declarations: declarators + }; + } + } + } else { + replace = node; + } + if (replace) { + replacement.push(replace); + } + } + }; + function createMdxContent(content3, hasInternalLayout) { + const element2 = { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + name: { type: "JSXIdentifier", name: "MDXLayout" }, + attributes: [ + { + type: "JSXSpreadAttribute", + argument: { type: "Identifier", name: "props" } + } + ], + selfClosing: false + }, + closingElement: { + type: "JSXClosingElement", + name: { type: "JSXIdentifier", name: "MDXLayout" } + }, + children: [ + { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + name: { type: "JSXIdentifier", name: "_createMdxContent" }, + attributes: [ + { + type: "JSXSpreadAttribute", + argument: { type: "Identifier", name: "props" } + } + ], + selfClosing: true + }, + closingElement: null, + children: [] + } + ] + }; + let result = element2; + if (!hasInternalLayout) { + result = { + type: "ConditionalExpression", + test: { type: "Identifier", name: "MDXLayout" }, + consequent: result, + alternate: { + type: "CallExpression", + callee: { type: "Identifier", name: "_createMdxContent" }, + arguments: [{ type: "Identifier", name: "props" }], + optional: false + } + }; + } + let argument = content3 || { type: "Literal", value: null }; + if (argument && argument.type === "JSXFragment" && argument.children.length === 1 && argument.children[0].type === "JSXElement") { + argument = argument.children[0]; + } + return [ + { + type: "FunctionDeclaration", + id: { type: "Identifier", name: "_createMdxContent" }, + params: [{ type: "Identifier", name: "props" }], + body: { + type: "BlockStatement", + body: [{ type: "ReturnStatement", argument }] + } + }, + { + type: "FunctionDeclaration", + id: { type: "Identifier", name: "MDXContent" }, + params: [ + { + type: "AssignmentPattern", + left: { type: "Identifier", name: "props" }, + right: { type: "ObjectExpression", properties: [] } + } + ], + body: { + type: "BlockStatement", + body: [ + { + type: "ReturnStatement", + argument: result + } + ] + } + } + ]; + } +} + +// node_modules/@mdx-js/mdx/lib/util/estree-util-to-binary-addition.js +function toBinaryAddition(expressions) { + let index2 = -1; + let left; + while (++index2 < expressions.length) { + const right = expressions[index2]; + left = left ? { type: "BinaryExpression", left, operator: "+", right } : right; + } + if (!left) + throw new Error("Expected non-empty `expressions` to be passed"); + return left; +} + +// node_modules/@mdx-js/mdx/lib/plugin/recma-jsx-rewrite.js +var own8 = {}.hasOwnProperty; +function recmaJsxRewrite(options = {}) { + const { development: development2, providerImportSource, outputFormat } = options; + return (tree, file) => { + const scopeInfo = analyze(tree); + const fnStack = []; + let importProvider; + let createErrorHelper; + let currentScope; + walk(tree, { + enter(_node) { + const node = _node; + const newScope = scopeInfo.map.get(node); + if (node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") { + fnStack.push({ + objects: [], + components: [], + tags: [], + references: {}, + idToInvalidComponentName: /* @__PURE__ */ new Map(), + node + }); + if (isNamedFunction(node, "MDXContent") && newScope && !inScope(newScope, "MDXLayout")) { + fnStack[0].components.push("MDXLayout"); + } + } + const fnScope = fnStack[0]; + if (!fnScope || !isNamedFunction(fnScope.node, "_createMdxContent") && !providerImportSource) { + return; + } + if (newScope) { + newScope.node = node; + currentScope = newScope; + } + if (currentScope && node.type === "JSXElement") { + let name2 = node.openingElement.name; + if (name2.type === "JSXMemberExpression") { + const ids = []; + while (name2.type === "JSXMemberExpression") { + ids.unshift(name2.property.name); + name2 = name2.object; + } + ids.unshift(name2.name); + const fullId = ids.join("."); + const id = name2.name; + const isInScope = inScope(currentScope, id); + if (!own8.call(fnScope.references, fullId)) { + const parentScope = currentScope.parent; + if (!isInScope || parentScope && parentScope.node.type === "FunctionDeclaration" && isNamedFunction(parentScope.node, "_createMdxContent")) { + fnScope.references[fullId] = { node, component: true }; + } + } + if (!fnScope.objects.includes(id) && !isInScope) { + fnScope.objects.push(id); + } + } else if (name2.type === "JSXNamespacedName") { + } else if (name(name2.name) && !/^[a-z]/.test(name2.name)) { + const id = name2.name; + if (!inScope(currentScope, id)) { + if (id !== "MDXLayout" && !own8.call(fnScope.references, id)) { + fnScope.references[id] = { node, component: true }; + } + if (!fnScope.components.includes(id)) { + fnScope.components.push(id); + } + } + } else if (node.data && node.data._mdxExplicitJsx) { + } else { + const id = name2.name; + if (!fnScope.tags.includes(id)) { + fnScope.tags.push(id); + } + let jsxIdExpression = ["_components", id]; + if (name(id) === false) { + let invalidComponentName = fnScope.idToInvalidComponentName.get(id); + if (invalidComponentName === void 0) { + invalidComponentName = `_component${fnScope.idToInvalidComponentName.size}`; + fnScope.idToInvalidComponentName.set(id, invalidComponentName); + } + jsxIdExpression = [invalidComponentName]; + } + node.openingElement.name = toJsxIdOrMemberExpression(jsxIdExpression); + if (node.closingElement) { + node.closingElement.name = toJsxIdOrMemberExpression(jsxIdExpression); + } + } + } + }, + leave(node) { + const defaults = []; + const actual = []; + const parameters = []; + const declarations = []; + if (currentScope && currentScope.node === node) { + currentScope = currentScope.parent; + } + if (node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") { + const fn = node; + const scope = fnStack[fnStack.length - 1]; + let name2; + for (name2 of scope.tags) { + defaults.push({ + type: "Property", + kind: "init", + key: name(name2) ? { type: "Identifier", name: name2 } : { type: "Literal", value: name2 }, + value: { type: "Literal", value: name2 }, + method: false, + shorthand: false, + computed: false + }); + } + actual.push(...scope.components); + for (name2 of scope.objects) { + if (!actual.includes(name2)) { + actual.push(name2); + } + } + const statements = []; + if (defaults.length > 0 || actual.length > 0 || scope.idToInvalidComponentName.size > 0) { + if (providerImportSource) { + importProvider = true; + parameters.push({ + type: "CallExpression", + callee: { type: "Identifier", name: "_provideComponents" }, + arguments: [], + optional: false + }); + } + if (isNamedFunction(scope.node, "MDXContent") || isNamedFunction(scope.node, "_createMdxContent")) { + parameters.push(toIdOrMemberExpression(["props", "components"])); + } + if (defaults.length > 0 || parameters.length > 1) { + parameters.unshift({ + type: "ObjectExpression", + properties: defaults + }); + } + let componentsInit = parameters.length > 1 ? { + type: "CallExpression", + callee: toIdOrMemberExpression(["Object", "assign"]), + arguments: parameters, + optional: false + } : parameters[0].type === "MemberExpression" ? { + type: "LogicalExpression", + operator: "||", + left: parameters[0], + right: { type: "ObjectExpression", properties: [] } + } : parameters[0]; + let componentsPattern; + if (actual.length > 0) { + componentsPattern = { + type: "ObjectPattern", + properties: actual.map((name3) => ({ + type: "Property", + kind: "init", + key: { + type: "Identifier", + name: name3 === "MDXLayout" ? "wrapper" : name3 + }, + value: { type: "Identifier", name: name3 }, + method: false, + shorthand: name3 !== "MDXLayout", + computed: false + })) + }; + } + if (scope.tags.length > 0) { + declarations.push({ + type: "VariableDeclarator", + id: { type: "Identifier", name: "_components" }, + init: componentsInit + }); + componentsInit = { type: "Identifier", name: "_components" }; + } + if (isNamedFunction(scope.node, "_createMdxContent")) { + for (const [ + id, + componentName + ] of scope.idToInvalidComponentName) { + declarations.push({ + type: "VariableDeclarator", + id: { type: "Identifier", name: componentName }, + init: { + type: "MemberExpression", + object: { type: "Identifier", name: "_components" }, + property: { type: "Literal", value: id }, + computed: true, + optional: false + } + }); + } + } + if (componentsPattern) { + declarations.push({ + type: "VariableDeclarator", + id: componentsPattern, + init: componentsInit + }); + } + if (declarations.length > 0) { + statements.push({ + type: "VariableDeclaration", + kind: "const", + declarations + }); + } + } + let key; + for (key in scope.references) { + if (own8.call(scope.references, key)) { + const parts = key.split("."); + let index3 = 0; + while (++index3 < parts.length) { + const partial = parts.slice(0, index3).join("."); + if (!own8.call(scope.references, partial)) { + scope.references[partial] = { + node: scope.references[key].node, + component: false + }; + } + } + } + } + const references = Object.keys(scope.references).sort(); + let index2 = -1; + while (++index2 < references.length) { + const id = references[index2]; + const info = scope.references[id]; + const place = stringifyPosition(positionFromEstree(info.node)); + const parameters2 = [ + { type: "Literal", value: id }, + { type: "Literal", value: info.component } + ]; + createErrorHelper = true; + if (development2 && place !== "1:1-1:1") { + parameters2.push({ type: "Literal", value: place }); + } + statements.push({ + type: "IfStatement", + test: { + type: "UnaryExpression", + operator: "!", + prefix: true, + argument: toIdOrMemberExpression(id.split(".")) + }, + consequent: { + type: "ExpressionStatement", + expression: { + type: "CallExpression", + callee: { type: "Identifier", name: "_missingMdxReference" }, + arguments: parameters2, + optional: false + } + }, + alternate: null + }); + } + if (statements.length > 0) { + if (fn.body.type !== "BlockStatement") { + fn.body = { + type: "BlockStatement", + body: [{ type: "ReturnStatement", argument: fn.body }] + }; + } + fn.body.body.unshift(...statements); + } + fnStack.pop(); + } + } + }); + if (importProvider && providerImportSource) { + tree.body.unshift( + createImportProvider(providerImportSource, outputFormat) + ); + } + if (createErrorHelper) { + const message = [ + { type: "Literal", value: "Expected " }, + { + type: "ConditionalExpression", + test: { type: "Identifier", name: "component" }, + consequent: { type: "Literal", value: "component" }, + alternate: { type: "Literal", value: "object" } + }, + { type: "Literal", value: " `" }, + { type: "Identifier", name: "id" }, + { + type: "Literal", + value: "` to be defined: you likely forgot to import, pass, or provide it." + } + ]; + const parameters = [ + { type: "Identifier", name: "id" }, + { type: "Identifier", name: "component" } + ]; + if (development2) { + message.push({ + type: "ConditionalExpression", + test: { type: "Identifier", name: "place" }, + consequent: toBinaryAddition([ + { type: "Literal", value: "\nIt\u2019s referenced in your code at `" }, + { type: "Identifier", name: "place" }, + { + type: "Literal", + value: (file.path ? "` in `" + file.path : "") + "`" + } + ]), + alternate: { type: "Literal", value: "" } + }); + parameters.push({ type: "Identifier", name: "place" }); + } + tree.body.push({ + type: "FunctionDeclaration", + id: { type: "Identifier", name: "_missingMdxReference" }, + generator: false, + async: false, + params: parameters, + body: { + type: "BlockStatement", + body: [ + { + type: "ThrowStatement", + argument: { + type: "NewExpression", + callee: { type: "Identifier", name: "Error" }, + arguments: [toBinaryAddition(message)] + } + } + ] + } + }); + } + }; +} +function createImportProvider(providerImportSource, outputFormat) { + const specifiers = [ + { + type: "ImportSpecifier", + imported: { type: "Identifier", name: "useMDXComponents" }, + local: { type: "Identifier", name: "_provideComponents" } + } + ]; + return outputFormat === "function-body" ? { + type: "VariableDeclaration", + kind: "const", + declarations: specifiersToDeclarations( + specifiers, + toIdOrMemberExpression(["arguments", 0]) + ) + } : { + type: "ImportDeclaration", + specifiers, + source: { type: "Literal", value: providerImportSource } + }; +} +function isNamedFunction(node, name2) { + return Boolean(node && "id" in node && node.id && node.id.name === name2); +} +function inScope(scope, id) { + let currentScope = scope; + while (currentScope) { + if (currentScope.declarations.has(id)) { + return true; + } + currentScope = currentScope.parent; + } + return false; +} + +// node_modules/astring/dist/astring.mjs +var { stringify } = JSON; +if (!String.prototype.repeat) { + throw new Error( + "String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation" + ); +} +if (!String.prototype.endsWith) { + throw new Error( + "String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation" + ); +} +var OPERATOR_PRECEDENCE = { + "||": 3, + "&&": 4, + "|": 5, + "??": 5, + "^": 6, + "&": 7, + "==": 8, + "!=": 8, + "===": 8, + "!==": 8, + "<": 9, + ">": 9, + "<=": 9, + ">=": 9, + in: 9, + instanceof: 9, + "<<": 10, + ">>": 10, + ">>>": 10, + "+": 11, + "-": 11, + "*": 12, + "%": 12, + "/": 12, + "**": 13 +}; +var NEEDS_PARENTHESES = 17; +var EXPRESSIONS_PRECEDENCE = { + ArrayExpression: 20, + TaggedTemplateExpression: 20, + ThisExpression: 20, + Identifier: 20, + PrivateIdentifier: 20, + Literal: 18, + TemplateLiteral: 20, + Super: 20, + SequenceExpression: 20, + MemberExpression: 19, + ChainExpression: 19, + CallExpression: 19, + NewExpression: 19, + ArrowFunctionExpression: NEEDS_PARENTHESES, + ClassExpression: NEEDS_PARENTHESES, + FunctionExpression: NEEDS_PARENTHESES, + ObjectExpression: NEEDS_PARENTHESES, + UpdateExpression: 16, + UnaryExpression: 15, + AwaitExpression: 15, + BinaryExpression: 14, + LogicalExpression: 13, + ConditionalExpression: 4, + AssignmentExpression: 3, + YieldExpression: 2, + RestElement: 1 +}; +function formatSequence(state, nodes) { + const { generator } = state; + state.write("("); + if (nodes != null && nodes.length > 0) { + generator[nodes[0].type](nodes[0], state); + const { length } = nodes; + for (let i = 1; i < length; i++) { + const param = nodes[i]; + state.write(", "); + generator[param.type](param, state); + } + } + state.write(")"); +} +function expressionNeedsParenthesis(state, node, parentNode, isRightHand) { + const nodePrecedence = state.expressionsPrecedence[node.type]; + if (nodePrecedence === NEEDS_PARENTHESES) { + return true; + } + const parentNodePrecedence = state.expressionsPrecedence[parentNode.type]; + if (nodePrecedence !== parentNodePrecedence) { + return !isRightHand && nodePrecedence === 15 && parentNodePrecedence === 14 && parentNode.operator === "**" || nodePrecedence < parentNodePrecedence; + } + if (nodePrecedence !== 13 && nodePrecedence !== 14) { + return false; + } + if (node.operator === "**" && parentNode.operator === "**") { + return !isRightHand; + } + if (isRightHand) { + return OPERATOR_PRECEDENCE[node.operator] <= OPERATOR_PRECEDENCE[parentNode.operator]; + } + return OPERATOR_PRECEDENCE[node.operator] < OPERATOR_PRECEDENCE[parentNode.operator]; +} +function formatExpression(state, node, parentNode, isRightHand) { + const { generator } = state; + if (expressionNeedsParenthesis(state, node, parentNode, isRightHand)) { + state.write("("); + generator[node.type](node, state); + state.write(")"); + } else { + generator[node.type](node, state); + } +} +function reindent(state, text5, indent, lineEnd) { + const lines = text5.split("\n"); + const end = lines.length - 1; + state.write(lines[0].trim()); + if (end > 0) { + state.write(lineEnd); + for (let i = 1; i < end; i++) { + state.write(indent + lines[i].trim() + lineEnd); + } + state.write(indent + lines[end].trim()); + } +} +function formatComments(state, comments, indent, lineEnd) { + const { length } = comments; + for (let i = 0; i < length; i++) { + const comment2 = comments[i]; + state.write(indent); + if (comment2.type[0] === "L") { + state.write("// " + comment2.value.trim() + "\n", comment2); + } else { + state.write("/*"); + reindent(state, comment2.value, indent, lineEnd); + state.write("*/" + lineEnd); + } + } +} +function hasCallExpression(node) { + let currentNode = node; + while (currentNode != null) { + const { type } = currentNode; + if (type[0] === "C" && type[1] === "a") { + return true; + } else if (type[0] === "M" && type[1] === "e" && type[2] === "m") { + currentNode = currentNode.object; + } else { + return false; + } + } +} +function formatVariableDeclaration(state, node) { + const { generator } = state; + const { declarations } = node; + state.write(node.kind + " "); + const { length } = declarations; + if (length > 0) { + generator.VariableDeclarator(declarations[0], state); + for (let i = 1; i < length; i++) { + state.write(", "); + generator.VariableDeclarator(declarations[i], state); + } + } +} +var ForInStatement; +var FunctionDeclaration; +var RestElement; +var BinaryExpression; +var ArrayExpression; +var BlockStatement; +var GENERATOR = { + Program(node, state) { + const indent = state.indent.repeat(state.indentLevel); + const { lineEnd, writeComments } = state; + if (writeComments && node.comments != null) { + formatComments(state, node.comments, indent, lineEnd); + } + const statements = node.body; + const { length } = statements; + for (let i = 0; i < length; i++) { + const statement = statements[i]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, indent, lineEnd); + } + state.write(indent); + this[statement.type](statement, state); + state.write(lineEnd); + } + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, indent, lineEnd); + } + }, + BlockStatement: BlockStatement = function(node, state) { + const indent = state.indent.repeat(state.indentLevel++); + const { lineEnd, writeComments } = state; + const statementIndent = indent + state.indent; + state.write("{"); + const statements = node.body; + if (statements != null && statements.length > 0) { + state.write(lineEnd); + if (writeComments && node.comments != null) { + formatComments(state, node.comments, statementIndent, lineEnd); + } + const { length } = statements; + for (let i = 0; i < length; i++) { + const statement = statements[i]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, statementIndent, lineEnd); + } + state.write(statementIndent); + this[statement.type](statement, state); + state.write(lineEnd); + } + state.write(indent); + } else { + if (writeComments && node.comments != null) { + state.write(lineEnd); + formatComments(state, node.comments, statementIndent, lineEnd); + state.write(indent); + } + } + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, statementIndent, lineEnd); + } + state.write("}"); + state.indentLevel--; + }, + ClassBody: BlockStatement, + StaticBlock(node, state) { + state.write("static "); + this.BlockStatement(node, state); + }, + EmptyStatement(node, state) { + state.write(";"); + }, + ExpressionStatement(node, state) { + const precedence = state.expressionsPrecedence[node.expression.type]; + if (precedence === NEEDS_PARENTHESES || precedence === 3 && node.expression.left.type[0] === "O") { + state.write("("); + this[node.expression.type](node.expression, state); + state.write(")"); + } else { + this[node.expression.type](node.expression, state); + } + state.write(";"); + }, + IfStatement(node, state) { + state.write("if ("); + this[node.test.type](node.test, state); + state.write(") "); + this[node.consequent.type](node.consequent, state); + if (node.alternate != null) { + state.write(" else "); + this[node.alternate.type](node.alternate, state); + } + }, + LabeledStatement(node, state) { + this[node.label.type](node.label, state); + state.write(": "); + this[node.body.type](node.body, state); + }, + BreakStatement(node, state) { + state.write("break"); + if (node.label != null) { + state.write(" "); + this[node.label.type](node.label, state); + } + state.write(";"); + }, + ContinueStatement(node, state) { + state.write("continue"); + if (node.label != null) { + state.write(" "); + this[node.label.type](node.label, state); + } + state.write(";"); + }, + WithStatement(node, state) { + state.write("with ("); + this[node.object.type](node.object, state); + state.write(") "); + this[node.body.type](node.body, state); + }, + SwitchStatement(node, state) { + const indent = state.indent.repeat(state.indentLevel++); + const { lineEnd, writeComments } = state; + state.indentLevel++; + const caseIndent = indent + state.indent; + const statementIndent = caseIndent + state.indent; + state.write("switch ("); + this[node.discriminant.type](node.discriminant, state); + state.write(") {" + lineEnd); + const { cases: occurences } = node; + const { length: occurencesCount } = occurences; + for (let i = 0; i < occurencesCount; i++) { + const occurence = occurences[i]; + if (writeComments && occurence.comments != null) { + formatComments(state, occurence.comments, caseIndent, lineEnd); + } + if (occurence.test) { + state.write(caseIndent + "case "); + this[occurence.test.type](occurence.test, state); + state.write(":" + lineEnd); + } else { + state.write(caseIndent + "default:" + lineEnd); + } + const { consequent } = occurence; + const { length: consequentCount } = consequent; + for (let i2 = 0; i2 < consequentCount; i2++) { + const statement = consequent[i2]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, statementIndent, lineEnd); + } + state.write(statementIndent); + this[statement.type](statement, state); + state.write(lineEnd); + } + } + state.indentLevel -= 2; + state.write(indent + "}"); + }, + ReturnStatement(node, state) { + state.write("return"); + if (node.argument) { + state.write(" "); + this[node.argument.type](node.argument, state); + } + state.write(";"); + }, + ThrowStatement(node, state) { + state.write("throw "); + this[node.argument.type](node.argument, state); + state.write(";"); + }, + TryStatement(node, state) { + state.write("try "); + this[node.block.type](node.block, state); + if (node.handler) { + const { handler } = node; + if (handler.param == null) { + state.write(" catch "); + } else { + state.write(" catch ("); + this[handler.param.type](handler.param, state); + state.write(") "); + } + this[handler.body.type](handler.body, state); + } + if (node.finalizer) { + state.write(" finally "); + this[node.finalizer.type](node.finalizer, state); + } + }, + WhileStatement(node, state) { + state.write("while ("); + this[node.test.type](node.test, state); + state.write(") "); + this[node.body.type](node.body, state); + }, + DoWhileStatement(node, state) { + state.write("do "); + this[node.body.type](node.body, state); + state.write(" while ("); + this[node.test.type](node.test, state); + state.write(");"); + }, + ForStatement(node, state) { + state.write("for ("); + if (node.init != null) { + const { init } = node; + if (init.type[0] === "V") { + formatVariableDeclaration(state, init); + } else { + this[init.type](init, state); + } + } + state.write("; "); + if (node.test) { + this[node.test.type](node.test, state); + } + state.write("; "); + if (node.update) { + this[node.update.type](node.update, state); + } + state.write(") "); + this[node.body.type](node.body, state); + }, + ForInStatement: ForInStatement = function(node, state) { + state.write(`for ${node.await ? "await " : ""}(`); + const { left } = node; + if (left.type[0] === "V") { + formatVariableDeclaration(state, left); + } else { + this[left.type](left, state); + } + state.write(node.type[3] === "I" ? " in " : " of "); + this[node.right.type](node.right, state); + state.write(") "); + this[node.body.type](node.body, state); + }, + ForOfStatement: ForInStatement, + DebuggerStatement(node, state) { + state.write("debugger;", node); + }, + FunctionDeclaration: FunctionDeclaration = function(node, state) { + state.write( + (node.async ? "async " : "") + (node.generator ? "function* " : "function ") + (node.id ? node.id.name : ""), + node + ); + formatSequence(state, node.params); + state.write(" "); + this[node.body.type](node.body, state); + }, + FunctionExpression: FunctionDeclaration, + VariableDeclaration(node, state) { + formatVariableDeclaration(state, node); + state.write(";"); + }, + VariableDeclarator(node, state) { + this[node.id.type](node.id, state); + if (node.init != null) { + state.write(" = "); + this[node.init.type](node.init, state); + } + }, + ClassDeclaration(node, state) { + state.write("class " + (node.id ? `${node.id.name} ` : ""), node); + if (node.superClass) { + state.write("extends "); + const { superClass } = node; + const { type } = superClass; + const precedence = state.expressionsPrecedence[type]; + if ((type[0] !== "C" || type[1] !== "l" || type[5] !== "E") && (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.ClassExpression)) { + state.write("("); + this[node.superClass.type](superClass, state); + state.write(")"); + } else { + this[superClass.type](superClass, state); + } + state.write(" "); + } + this.ClassBody(node.body, state); + }, + ImportDeclaration(node, state) { + state.write("import "); + const { specifiers } = node; + const { length } = specifiers; + let i = 0; + if (length > 0) { + for (; i < length; ) { + if (i > 0) { + state.write(", "); + } + const specifier = specifiers[i]; + const type = specifier.type[6]; + if (type === "D") { + state.write(specifier.local.name, specifier); + i++; + } else if (type === "N") { + state.write("* as " + specifier.local.name, specifier); + i++; + } else { + break; + } + } + if (i < length) { + state.write("{"); + for (; ; ) { + const specifier = specifiers[i]; + const { name: name2 } = specifier.imported; + state.write(name2, specifier); + if (name2 !== specifier.local.name) { + state.write(" as " + specifier.local.name); + } + if (++i < length) { + state.write(", "); + } else { + break; + } + } + state.write("}"); + } + state.write(" from "); + } + this.Literal(node.source, state); + state.write(";"); + }, + ImportExpression(node, state) { + state.write("import("); + this[node.source.type](node.source, state); + state.write(")"); + }, + ExportDefaultDeclaration(node, state) { + state.write("export default "); + this[node.declaration.type](node.declaration, state); + if (state.expressionsPrecedence[node.declaration.type] != null && node.declaration.type[0] !== "F") { + state.write(";"); + } + }, + ExportNamedDeclaration(node, state) { + state.write("export "); + if (node.declaration) { + this[node.declaration.type](node.declaration, state); + } else { + state.write("{"); + const { specifiers } = node, { length } = specifiers; + if (length > 0) { + for (let i = 0; ; ) { + const specifier = specifiers[i]; + const { name: name2 } = specifier.local; + state.write(name2, specifier); + if (name2 !== specifier.exported.name) { + state.write(" as " + specifier.exported.name); + } + if (++i < length) { + state.write(", "); + } else { + break; + } + } + } + state.write("}"); + if (node.source) { + state.write(" from "); + this.Literal(node.source, state); + } + state.write(";"); + } + }, + ExportAllDeclaration(node, state) { + if (node.exported != null) { + state.write("export * as " + node.exported.name + " from "); + } else { + state.write("export * from "); + } + this.Literal(node.source, state); + state.write(";"); + }, + MethodDefinition(node, state) { + if (node.static) { + state.write("static "); + } + const kind = node.kind[0]; + if (kind === "g" || kind === "s") { + state.write(node.kind + " "); + } + if (node.value.async) { + state.write("async "); + } + if (node.value.generator) { + state.write("*"); + } + if (node.computed) { + state.write("["); + this[node.key.type](node.key, state); + state.write("]"); + } else { + this[node.key.type](node.key, state); + } + formatSequence(state, node.value.params); + state.write(" "); + this[node.value.body.type](node.value.body, state); + }, + ClassExpression(node, state) { + this.ClassDeclaration(node, state); + }, + ArrowFunctionExpression(node, state) { + state.write(node.async ? "async " : "", node); + const { params } = node; + if (params != null) { + if (params.length === 1 && params[0].type[0] === "I") { + state.write(params[0].name, params[0]); + } else { + formatSequence(state, node.params); + } + } + state.write(" => "); + if (node.body.type[0] === "O") { + state.write("("); + this.ObjectExpression(node.body, state); + state.write(")"); + } else { + this[node.body.type](node.body, state); + } + }, + ThisExpression(node, state) { + state.write("this", node); + }, + Super(node, state) { + state.write("super", node); + }, + RestElement: RestElement = function(node, state) { + state.write("..."); + this[node.argument.type](node.argument, state); + }, + SpreadElement: RestElement, + YieldExpression(node, state) { + state.write(node.delegate ? "yield*" : "yield"); + if (node.argument) { + state.write(" "); + this[node.argument.type](node.argument, state); + } + }, + AwaitExpression(node, state) { + state.write("await ", node); + formatExpression(state, node.argument, node); + }, + TemplateLiteral(node, state) { + const { quasis, expressions } = node; + state.write("`"); + const { length } = expressions; + for (let i = 0; i < length; i++) { + const expression = expressions[i]; + const quasi2 = quasis[i]; + state.write(quasi2.value.raw, quasi2); + state.write("${"); + this[expression.type](expression, state); + state.write("}"); + } + const quasi = quasis[quasis.length - 1]; + state.write(quasi.value.raw, quasi); + state.write("`"); + }, + TemplateElement(node, state) { + state.write(node.value.raw, node); + }, + TaggedTemplateExpression(node, state) { + formatExpression(state, node.tag, node); + this[node.quasi.type](node.quasi, state); + }, + ArrayExpression: ArrayExpression = function(node, state) { + state.write("["); + if (node.elements.length > 0) { + const { elements } = node, { length } = elements; + for (let i = 0; ; ) { + const element2 = elements[i]; + if (element2 != null) { + this[element2.type](element2, state); + } + if (++i < length) { + state.write(", "); + } else { + if (element2 == null) { + state.write(", "); + } + break; + } + } + } + state.write("]"); + }, + ArrayPattern: ArrayExpression, + ObjectExpression(node, state) { + const indent = state.indent.repeat(state.indentLevel++); + const { lineEnd, writeComments } = state; + const propertyIndent = indent + state.indent; + state.write("{"); + if (node.properties.length > 0) { + state.write(lineEnd); + if (writeComments && node.comments != null) { + formatComments(state, node.comments, propertyIndent, lineEnd); + } + const comma = "," + lineEnd; + const { properties } = node, { length } = properties; + for (let i = 0; ; ) { + const property = properties[i]; + if (writeComments && property.comments != null) { + formatComments(state, property.comments, propertyIndent, lineEnd); + } + state.write(propertyIndent); + this[property.type](property, state); + if (++i < length) { + state.write(comma); + } else { + break; + } + } + state.write(lineEnd); + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + } + state.write(indent + "}"); + } else if (writeComments) { + if (node.comments != null) { + state.write(lineEnd); + formatComments(state, node.comments, propertyIndent, lineEnd); + if (node.trailingComments != null) { + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + } + state.write(indent + "}"); + } else if (node.trailingComments != null) { + state.write(lineEnd); + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + state.write(indent + "}"); + } else { + state.write("}"); + } + } else { + state.write("}"); + } + state.indentLevel--; + }, + Property(node, state) { + if (node.method || node.kind[0] !== "i") { + this.MethodDefinition(node, state); + } else { + if (!node.shorthand) { + if (node.computed) { + state.write("["); + this[node.key.type](node.key, state); + state.write("]"); + } else { + this[node.key.type](node.key, state); + } + state.write(": "); + } + this[node.value.type](node.value, state); + } + }, + PropertyDefinition(node, state) { + if (node.static) { + state.write("static "); + } + this[node.key.type](node.key, state); + if (node.value == null) { + return; + } + state.write(" = "); + this[node.value.type](node.value, state); + }, + ObjectPattern(node, state) { + state.write("{"); + if (node.properties.length > 0) { + const { properties } = node, { length } = properties; + for (let i = 0; ; ) { + this[properties[i].type](properties[i], state); + if (++i < length) { + state.write(", "); + } else { + break; + } + } + } + state.write("}"); + }, + SequenceExpression(node, state) { + formatSequence(state, node.expressions); + }, + UnaryExpression(node, state) { + if (node.prefix) { + const { + operator, + argument, + argument: { type } + } = node; + state.write(operator); + const needsParentheses = expressionNeedsParenthesis(state, argument, node); + if (!needsParentheses && (operator.length > 1 || type[0] === "U" && (type[1] === "n" || type[1] === "p") && argument.prefix && argument.operator[0] === operator && (operator === "+" || operator === "-"))) { + state.write(" "); + } + if (needsParentheses) { + state.write(operator.length > 1 ? " (" : "("); + this[type](argument, state); + state.write(")"); + } else { + this[type](argument, state); + } + } else { + this[node.argument.type](node.argument, state); + state.write(node.operator); + } + }, + UpdateExpression(node, state) { + if (node.prefix) { + state.write(node.operator); + this[node.argument.type](node.argument, state); + } else { + this[node.argument.type](node.argument, state); + state.write(node.operator); + } + }, + AssignmentExpression(node, state) { + this[node.left.type](node.left, state); + state.write(" " + node.operator + " "); + this[node.right.type](node.right, state); + }, + AssignmentPattern(node, state) { + this[node.left.type](node.left, state); + state.write(" = "); + this[node.right.type](node.right, state); + }, + BinaryExpression: BinaryExpression = function(node, state) { + const isIn = node.operator === "in"; + if (isIn) { + state.write("("); + } + formatExpression(state, node.left, node, false); + state.write(" " + node.operator + " "); + formatExpression(state, node.right, node, true); + if (isIn) { + state.write(")"); + } + }, + LogicalExpression: BinaryExpression, + ConditionalExpression(node, state) { + const { test } = node; + const precedence = state.expressionsPrecedence[test.type]; + if (precedence === NEEDS_PARENTHESES || precedence <= state.expressionsPrecedence.ConditionalExpression) { + state.write("("); + this[test.type](test, state); + state.write(")"); + } else { + this[test.type](test, state); + } + state.write(" ? "); + this[node.consequent.type](node.consequent, state); + state.write(" : "); + this[node.alternate.type](node.alternate, state); + }, + NewExpression(node, state) { + state.write("new "); + const precedence = state.expressionsPrecedence[node.callee.type]; + if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.CallExpression || hasCallExpression(node.callee)) { + state.write("("); + this[node.callee.type](node.callee, state); + state.write(")"); + } else { + this[node.callee.type](node.callee, state); + } + formatSequence(state, node["arguments"]); + }, + CallExpression(node, state) { + const precedence = state.expressionsPrecedence[node.callee.type]; + if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.CallExpression) { + state.write("("); + this[node.callee.type](node.callee, state); + state.write(")"); + } else { + this[node.callee.type](node.callee, state); + } + if (node.optional) { + state.write("?."); + } + formatSequence(state, node["arguments"]); + }, + ChainExpression(node, state) { + this[node.expression.type](node.expression, state); + }, + MemberExpression(node, state) { + const precedence = state.expressionsPrecedence[node.object.type]; + if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.MemberExpression) { + state.write("("); + this[node.object.type](node.object, state); + state.write(")"); + } else { + this[node.object.type](node.object, state); + } + if (node.computed) { + if (node.optional) { + state.write("?."); + } + state.write("["); + this[node.property.type](node.property, state); + state.write("]"); + } else { + if (node.optional) { + state.write("?."); + } else { + state.write("."); + } + this[node.property.type](node.property, state); + } + }, + MetaProperty(node, state) { + state.write(node.meta.name + "." + node.property.name, node); + }, + Identifier(node, state) { + state.write(node.name, node); + }, + PrivateIdentifier(node, state) { + state.write(`#${node.name}`, node); + }, + Literal(node, state) { + if (node.raw != null) { + state.write(node.raw, node); + } else if (node.regex != null) { + this.RegExpLiteral(node, state); + } else if (node.bigint != null) { + state.write(node.bigint + "n", node); + } else { + state.write(stringify(node.value), node); + } + }, + RegExpLiteral(node, state) { + const { regex: regex2 } = node; + state.write(`/${regex2.pattern}/${regex2.flags}`, node); + } +}; +var EMPTY_OBJECT = {}; +var State = class { + constructor(options) { + const setup = options == null ? EMPTY_OBJECT : options; + this.output = ""; + if (setup.output != null) { + this.output = setup.output; + this.write = this.writeToStream; + } else { + this.output = ""; + } + this.generator = setup.generator != null ? setup.generator : GENERATOR; + this.expressionsPrecedence = setup.expressionsPrecedence != null ? setup.expressionsPrecedence : EXPRESSIONS_PRECEDENCE; + this.indent = setup.indent != null ? setup.indent : " "; + this.lineEnd = setup.lineEnd != null ? setup.lineEnd : "\n"; + this.indentLevel = setup.startingIndentLevel != null ? setup.startingIndentLevel : 0; + this.writeComments = setup.comments ? setup.comments : false; + if (setup.sourceMap != null) { + this.write = setup.output == null ? this.writeAndMap : this.writeToStreamAndMap; + this.sourceMap = setup.sourceMap; + this.line = 1; + this.column = 0; + this.lineEndSize = this.lineEnd.split("\n").length - 1; + this.mapping = { + original: null, + generated: this, + name: void 0, + source: setup.sourceMap.file || setup.sourceMap._file + }; + } + } + write(code2) { + this.output += code2; + } + writeToStream(code2) { + this.output.write(code2); + } + writeAndMap(code2, node) { + this.output += code2; + this.map(code2, node); + } + writeToStreamAndMap(code2, node) { + this.output.write(code2); + this.map(code2, node); + } + map(code2, node) { + if (node != null) { + const { type } = node; + if (type[0] === "L" && type[2] === "n") { + this.column = 0; + this.line++; + return; + } + if (node.loc != null) { + const { mapping } = this; + mapping.original = node.loc.start; + mapping.name = node.name; + this.sourceMap.addMapping(mapping); + } + if (type[0] === "T" && type[8] === "E" || type[0] === "L" && type[1] === "i" && typeof node.value === "string") { + const { length: length2 } = code2; + let { column, line } = this; + for (let i = 0; i < length2; i++) { + if (code2[i] === "\n") { + column = 0; + line++; + } else { + column++; + } + } + this.column = column; + this.line = line; + return; + } + } + const { length } = code2; + const { lineEnd } = this; + if (length > 0) { + if (this.lineEndSize > 0 && (lineEnd.length === 1 ? code2[length - 1] === lineEnd : code2.endsWith(lineEnd))) { + this.line += this.lineEndSize; + this.column = 0; + } else { + this.column += length; + } + } + } + toString() { + return this.output; + } +}; +function generate(node, options) { + const state = new State(options); + state.generator[node.type](node, state); + return state.output; +} + +// node_modules/estree-util-to-js/lib/index.js +var toJs = function(tree, options = {}) { + const { SourceMapGenerator, filePath, handlers: handlers2 } = options; + const sourceMap = SourceMapGenerator ? new SourceMapGenerator({ file: filePath || ".js" }) : void 0; + const value = generate(tree, { + comments: true, + generator: { ...GENERATOR, ...handlers2 }, + sourceMap + }); + const map = sourceMap ? sourceMap.toJSON() : void 0; + return { value, map }; +}; + +// node_modules/estree-util-to-js/lib/jsx.js +var jsx = { + JSXAttribute, + JSXClosingElement, + JSXClosingFragment, + JSXElement, + JSXEmptyExpression, + JSXExpressionContainer, + JSXFragment, + JSXIdentifier, + JSXMemberExpression, + JSXNamespacedName, + JSXOpeningElement, + JSXOpeningFragment, + JSXSpreadAttribute, + JSXText +}; +function JSXAttribute(node, state) { + this[node.name.type](node.name, state); + if (node.value !== void 0 && node.value !== null) { + state.write("="); + if (node.value.type === "Literal") { + state.write( + '"' + encodeJsx(String(node.value.value)).replace(/"/g, """) + '"', + node + ); + } else { + this[node.value.type](node.value, state); + } + } +} +function JSXClosingElement(node, state) { + state.write(""); +} +function JSXClosingFragment(node, state) { + state.write("", node); +} +function JSXElement(node, state) { + let index2 = -1; + this[node.openingElement.type](node.openingElement, state); + if (node.children) { + while (++index2 < node.children.length) { + const child = node.children[index2]; + if (child.type === "JSXSpreadChild") { + throw new Error("JSX spread children are not supported"); + } + this[child.type](child, state); + } + } + if (node.closingElement) { + this[node.closingElement.type](node.closingElement, state); + } +} +function JSXEmptyExpression() { +} +function JSXExpressionContainer(node, state) { + state.write("{"); + this[node.expression.type](node.expression, state); + state.write("}"); +} +function JSXFragment(node, state) { + let index2 = -1; + this[node.openingFragment.type](node.openingFragment, state); + if (node.children) { + while (++index2 < node.children.length) { + const child = node.children[index2]; + if (child.type === "JSXSpreadChild") { + throw new Error("JSX spread children are not supported"); + } + this[child.type](child, state); + } + } + this[node.closingFragment.type](node.closingFragment, state); +} +function JSXIdentifier(node, state) { + state.write(node.name, node); +} +function JSXMemberExpression(node, state) { + this[node.object.type](node.object, state); + state.write("."); + this[node.property.type](node.property, state); +} +function JSXNamespacedName(node, state) { + this[node.namespace.type](node.namespace, state); + state.write(":"); + this[node.name.type](node.name, state); +} +function JSXOpeningElement(node, state) { + let index2 = -1; + state.write("<"); + this[node.name.type](node.name, state); + if (node.attributes) { + while (++index2 < node.attributes.length) { + state.write(" "); + this[node.attributes[index2].type](node.attributes[index2], state); + } + } + state.write(node.selfClosing ? " />" : ">"); +} +function JSXOpeningFragment(node, state) { + state.write("<>", node); +} +function JSXSpreadAttribute(node, state) { + state.write("{"); + this.SpreadElement(node, state); + state.write("}"); +} +function JSXText(node, state) { + state.write( + encodeJsx(node.value).replace( + /[<>{}]/g, + ($0) => $0 === "<" ? "<" : $0 === ">" ? ">" : $0 === "{" ? "{" : "}" + ), + node + ); +} +function encodeJsx(value) { + return value.replace(/&(?=[#a-z])/gi, "&"); +} + +// node_modules/@mdx-js/mdx/lib/plugin/recma-stringify.js +function recmaStringify(options = {}) { + const { SourceMapGenerator } = options; + Object.assign(this, { Compiler: compiler2 }); + function compiler2(tree, file) { + const result = SourceMapGenerator ? toJs(tree, { + filePath: file.path || "unknown.mdx", + SourceMapGenerator, + handlers: jsx + }) : toJs(tree, { handlers: jsx }); + file.map = result.map; + return result.value; + } +} + +// node_modules/hast-util-to-estree/node_modules/comma-separated-tokens/index.js +function stringify2(values, options) { + var settings = options || {}; + if (values[values.length - 1] === "") { + values = values.concat(""); + } + return values.join( + (settings.padRight ? " " : "") + "," + (settings.padLeft === false ? "" : " ") + ).trim(); +} + +// node_modules/estree-util-attach-comments/index.js +var own9 = {}.hasOwnProperty; +function attachComments(tree, comments) { + const list3 = (comments || []).concat().sort(compare); + if (list3.length > 0) + walk2(tree, { comments: list3, index: 0 }); + return tree; +} +function walk2(node, state) { + if (state.index === state.comments.length) { + return; + } + const children = []; + const comments = []; + let key; + for (key in node) { + if (own9.call(node, key)) { + const value = node[key]; + if (value && typeof value === "object" && key !== "comments") { + if (Array.isArray(value)) { + let index3 = -1; + while (++index3 < value.length) { + if (value[index3] && typeof value[index3].type === "string") { + children.push(value[index3]); + } + } + } else if (typeof value.type === "string") { + children.push(value); + } + } + } + } + children.sort(compare); + comments.push(...slice(state, node, false, { leading: true, trailing: false })); + let index2 = -1; + while (++index2 < children.length) { + walk2(children[index2], state); + } + comments.push( + ...slice(state, node, true, { + leading: false, + trailing: children.length > 0 + }) + ); + if (comments.length > 0) { + node.comments = comments; + } +} +function slice(state, node, compareEnd, fields) { + const result = []; + while (state.comments[state.index] && compare(state.comments[state.index], node, compareEnd) < 1) { + result.push(Object.assign({}, state.comments[state.index++], fields)); + } + return result; +} +function compare(left, right, compareEnd) { + const field = compareEnd ? "end" : "start"; + if (left.range && right.range) { + return left.range[0] - right.range[compareEnd ? 1 : 0]; + } + if (left.loc && left.loc.start && right.loc && right.loc[field]) { + return left.loc.start.line - right.loc[field].line || left.loc.start.column - right.loc[field].column; + } + if ("start" in left && field in right) { + return left.start - right[field]; + } + return Number.NaN; +} + +// node_modules/hast-util-to-estree/node_modules/hast-util-whitespace/index.js +function whitespace(thing) { + var value = thing && typeof thing === "object" && thing.type === "text" ? thing.value || "" : thing; + return typeof value === "string" && value.replace(/[ \t\n\f\r]/g, "") === ""; +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/schema.js +var Schema = class { + constructor(property, normal, space2) { + this.property = property; + this.normal = normal; + if (space2) { + this.space = space2; + } + } +}; +Schema.prototype.property = {}; +Schema.prototype.normal = {}; +Schema.prototype.space = null; + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/merge.js +function merge(definitions2, space2) { + const property = {}; + const normal = {}; + let index2 = -1; + while (++index2 < definitions2.length) { + Object.assign(property, definitions2[index2].property); + Object.assign(normal, definitions2[index2].normal); + } + return new Schema(property, normal, space2); +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/normalize.js +function normalize(value) { + return value.toLowerCase(); +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/info.js +var Info = class { + constructor(property, attribute) { + this.property = property; + this.attribute = attribute; + } +}; +Info.prototype.space = null; +Info.prototype.boolean = false; +Info.prototype.booleanish = false; +Info.prototype.overloadedBoolean = false; +Info.prototype.number = false; +Info.prototype.commaSeparated = false; +Info.prototype.spaceSeparated = false; +Info.prototype.commaOrSpaceSeparated = false; +Info.prototype.mustUseProperty = false; +Info.prototype.defined = false; + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/types.js +var types_exports = {}; +__export(types_exports, { + boolean: () => boolean, + booleanish: () => booleanish, + commaOrSpaceSeparated: () => commaOrSpaceSeparated, + commaSeparated: () => commaSeparated, + number: () => number, + overloadedBoolean: () => overloadedBoolean, + spaceSeparated: () => spaceSeparated +}); +var powers = 0; +var boolean = increment(); +var booleanish = increment(); +var overloadedBoolean = increment(); +var number = increment(); +var spaceSeparated = increment(); +var commaSeparated = increment(); +var commaOrSpaceSeparated = increment(); +function increment() { + return 2 ** ++powers; +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/defined-info.js +var checks = Object.keys(types_exports); +var DefinedInfo = class extends Info { + constructor(property, attribute, mask, space2) { + let index2 = -1; + super(property, attribute); + mark(this, "space", space2); + if (typeof mask === "number") { + while (++index2 < checks.length) { + const check = checks[index2]; + mark(this, checks[index2], (mask & types_exports[check]) === types_exports[check]); + } + } + } +}; +DefinedInfo.prototype.defined = true; +function mark(values, key, value) { + if (value) { + values[key] = value; + } +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/create.js +var own10 = {}.hasOwnProperty; +function create3(definition2) { + const property = {}; + const normal = {}; + let prop; + for (prop in definition2.properties) { + if (own10.call(definition2.properties, prop)) { + const value = definition2.properties[prop]; + const info = new DefinedInfo( + prop, + definition2.transform(definition2.attributes || {}, prop), + value, + definition2.space + ); + if (definition2.mustUseProperty && definition2.mustUseProperty.includes(prop)) { + info.mustUseProperty = true; + } + property[prop] = info; + normal[normalize(prop)] = prop; + normal[normalize(info.attribute)] = prop; + } + } + return new Schema(property, normal, definition2.space); +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/xlink.js +var xlink = create3({ + space: "xlink", + transform(_, prop) { + return "xlink:" + prop.slice(5).toLowerCase(); + }, + properties: { + xLinkActuate: null, + xLinkArcRole: null, + xLinkHref: null, + xLinkRole: null, + xLinkShow: null, + xLinkTitle: null, + xLinkType: null + } +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/xml.js +var xml = create3({ + space: "xml", + transform(_, prop) { + return "xml:" + prop.slice(3).toLowerCase(); + }, + properties: { xmlLang: null, xmlBase: null, xmlSpace: null } +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/case-sensitive-transform.js +function caseSensitiveTransform(attributes, attribute) { + return attribute in attributes ? attributes[attribute] : attribute; +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/util/case-insensitive-transform.js +function caseInsensitiveTransform(attributes, property) { + return caseSensitiveTransform(attributes, property.toLowerCase()); +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/xmlns.js +var xmlns = create3({ + space: "xmlns", + attributes: { xmlnsxlink: "xmlns:xlink" }, + transform: caseInsensitiveTransform, + properties: { xmlns: null, xmlnsXLink: null } +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/aria.js +var aria = create3({ + transform(_, prop) { + return prop === "role" ? prop : "aria-" + prop.slice(4).toLowerCase(); + }, + properties: { + ariaActiveDescendant: null, + ariaAtomic: booleanish, + ariaAutoComplete: null, + ariaBusy: booleanish, + ariaChecked: booleanish, + ariaColCount: number, + ariaColIndex: number, + ariaColSpan: number, + ariaControls: spaceSeparated, + ariaCurrent: null, + ariaDescribedBy: spaceSeparated, + ariaDetails: null, + ariaDisabled: booleanish, + ariaDropEffect: spaceSeparated, + ariaErrorMessage: null, + ariaExpanded: booleanish, + ariaFlowTo: spaceSeparated, + ariaGrabbed: booleanish, + ariaHasPopup: null, + ariaHidden: booleanish, + ariaInvalid: null, + ariaKeyShortcuts: null, + ariaLabel: null, + ariaLabelledBy: spaceSeparated, + ariaLevel: number, + ariaLive: null, + ariaModal: booleanish, + ariaMultiLine: booleanish, + ariaMultiSelectable: booleanish, + ariaOrientation: null, + ariaOwns: spaceSeparated, + ariaPlaceholder: null, + ariaPosInSet: number, + ariaPressed: booleanish, + ariaReadOnly: booleanish, + ariaRelevant: null, + ariaRequired: booleanish, + ariaRoleDescription: spaceSeparated, + ariaRowCount: number, + ariaRowIndex: number, + ariaRowSpan: number, + ariaSelected: booleanish, + ariaSetSize: number, + ariaSort: null, + ariaValueMax: number, + ariaValueMin: number, + ariaValueNow: number, + ariaValueText: null, + role: null + } +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/html.js +var html2 = create3({ + space: "html", + attributes: { + acceptcharset: "accept-charset", + classname: "class", + htmlfor: "for", + httpequiv: "http-equiv" + }, + transform: caseInsensitiveTransform, + mustUseProperty: ["checked", "multiple", "muted", "selected"], + properties: { + abbr: null, + accept: commaSeparated, + acceptCharset: spaceSeparated, + accessKey: spaceSeparated, + action: null, + allow: null, + allowFullScreen: boolean, + allowPaymentRequest: boolean, + allowUserMedia: boolean, + alt: null, + as: null, + async: boolean, + autoCapitalize: null, + autoComplete: spaceSeparated, + autoFocus: boolean, + autoPlay: boolean, + capture: boolean, + charSet: null, + checked: boolean, + cite: null, + className: spaceSeparated, + cols: number, + colSpan: null, + content: null, + contentEditable: booleanish, + controls: boolean, + controlsList: spaceSeparated, + coords: number | commaSeparated, + crossOrigin: null, + data: null, + dateTime: null, + decoding: null, + default: boolean, + defer: boolean, + dir: null, + dirName: null, + disabled: boolean, + download: overloadedBoolean, + draggable: booleanish, + encType: null, + enterKeyHint: null, + form: null, + formAction: null, + formEncType: null, + formMethod: null, + formNoValidate: boolean, + formTarget: null, + headers: spaceSeparated, + height: number, + hidden: boolean, + high: number, + href: null, + hrefLang: null, + htmlFor: spaceSeparated, + httpEquiv: spaceSeparated, + id: null, + imageSizes: null, + imageSrcSet: null, + inputMode: null, + integrity: null, + is: null, + isMap: boolean, + itemId: null, + itemProp: spaceSeparated, + itemRef: spaceSeparated, + itemScope: boolean, + itemType: spaceSeparated, + kind: null, + label: null, + lang: null, + language: null, + list: null, + loading: null, + loop: boolean, + low: number, + manifest: null, + max: null, + maxLength: number, + media: null, + method: null, + min: null, + minLength: number, + multiple: boolean, + muted: boolean, + name: null, + nonce: null, + noModule: boolean, + noValidate: boolean, + onAbort: null, + onAfterPrint: null, + onAuxClick: null, + onBeforePrint: null, + onBeforeUnload: null, + onBlur: null, + onCancel: null, + onCanPlay: null, + onCanPlayThrough: null, + onChange: null, + onClick: null, + onClose: null, + onContextLost: null, + onContextMenu: null, + onContextRestored: null, + onCopy: null, + onCueChange: null, + onCut: null, + onDblClick: null, + onDrag: null, + onDragEnd: null, + onDragEnter: null, + onDragExit: null, + onDragLeave: null, + onDragOver: null, + onDragStart: null, + onDrop: null, + onDurationChange: null, + onEmptied: null, + onEnded: null, + onError: null, + onFocus: null, + onFormData: null, + onHashChange: null, + onInput: null, + onInvalid: null, + onKeyDown: null, + onKeyPress: null, + onKeyUp: null, + onLanguageChange: null, + onLoad: null, + onLoadedData: null, + onLoadedMetadata: null, + onLoadEnd: null, + onLoadStart: null, + onMessage: null, + onMessageError: null, + onMouseDown: null, + onMouseEnter: null, + onMouseLeave: null, + onMouseMove: null, + onMouseOut: null, + onMouseOver: null, + onMouseUp: null, + onOffline: null, + onOnline: null, + onPageHide: null, + onPageShow: null, + onPaste: null, + onPause: null, + onPlay: null, + onPlaying: null, + onPopState: null, + onProgress: null, + onRateChange: null, + onRejectionHandled: null, + onReset: null, + onResize: null, + onScroll: null, + onSecurityPolicyViolation: null, + onSeeked: null, + onSeeking: null, + onSelect: null, + onSlotChange: null, + onStalled: null, + onStorage: null, + onSubmit: null, + onSuspend: null, + onTimeUpdate: null, + onToggle: null, + onUnhandledRejection: null, + onUnload: null, + onVolumeChange: null, + onWaiting: null, + onWheel: null, + open: boolean, + optimum: number, + pattern: null, + ping: spaceSeparated, + placeholder: null, + playsInline: boolean, + poster: null, + preload: null, + readOnly: boolean, + referrerPolicy: null, + rel: spaceSeparated, + required: boolean, + reversed: boolean, + rows: number, + rowSpan: number, + sandbox: spaceSeparated, + scope: null, + scoped: boolean, + seamless: boolean, + selected: boolean, + shape: null, + size: number, + sizes: null, + slot: null, + span: number, + spellCheck: booleanish, + src: null, + srcDoc: null, + srcLang: null, + srcSet: null, + start: number, + step: null, + style: null, + tabIndex: number, + target: null, + title: null, + translate: null, + type: null, + typeMustMatch: boolean, + useMap: null, + value: booleanish, + width: number, + wrap: null, + align: null, + aLink: null, + archive: spaceSeparated, + axis: null, + background: null, + bgColor: null, + border: number, + borderColor: null, + bottomMargin: number, + cellPadding: null, + cellSpacing: null, + char: null, + charOff: null, + classId: null, + clear: null, + code: null, + codeBase: null, + codeType: null, + color: null, + compact: boolean, + declare: boolean, + event: null, + face: null, + frame: null, + frameBorder: null, + hSpace: number, + leftMargin: number, + link: null, + longDesc: null, + lowSrc: null, + marginHeight: number, + marginWidth: number, + noResize: boolean, + noHref: boolean, + noShade: boolean, + noWrap: boolean, + object: null, + profile: null, + prompt: null, + rev: null, + rightMargin: number, + rules: null, + scheme: null, + scrolling: booleanish, + standby: null, + summary: null, + text: null, + topMargin: number, + valueType: null, + version: null, + vAlign: null, + vLink: null, + vSpace: number, + allowTransparency: null, + autoCorrect: null, + autoSave: null, + disablePictureInPicture: boolean, + disableRemotePlayback: boolean, + prefix: null, + property: null, + results: number, + security: null, + unselectable: null + } +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/svg.js +var svg = create3({ + space: "svg", + attributes: { + accentHeight: "accent-height", + alignmentBaseline: "alignment-baseline", + arabicForm: "arabic-form", + baselineShift: "baseline-shift", + capHeight: "cap-height", + className: "class", + clipPath: "clip-path", + clipRule: "clip-rule", + colorInterpolation: "color-interpolation", + colorInterpolationFilters: "color-interpolation-filters", + colorProfile: "color-profile", + colorRendering: "color-rendering", + crossOrigin: "crossorigin", + dataType: "datatype", + dominantBaseline: "dominant-baseline", + enableBackground: "enable-background", + fillOpacity: "fill-opacity", + fillRule: "fill-rule", + floodColor: "flood-color", + floodOpacity: "flood-opacity", + fontFamily: "font-family", + fontSize: "font-size", + fontSizeAdjust: "font-size-adjust", + fontStretch: "font-stretch", + fontStyle: "font-style", + fontVariant: "font-variant", + fontWeight: "font-weight", + glyphName: "glyph-name", + glyphOrientationHorizontal: "glyph-orientation-horizontal", + glyphOrientationVertical: "glyph-orientation-vertical", + hrefLang: "hreflang", + horizAdvX: "horiz-adv-x", + horizOriginX: "horiz-origin-x", + horizOriginY: "horiz-origin-y", + imageRendering: "image-rendering", + letterSpacing: "letter-spacing", + lightingColor: "lighting-color", + markerEnd: "marker-end", + markerMid: "marker-mid", + markerStart: "marker-start", + navDown: "nav-down", + navDownLeft: "nav-down-left", + navDownRight: "nav-down-right", + navLeft: "nav-left", + navNext: "nav-next", + navPrev: "nav-prev", + navRight: "nav-right", + navUp: "nav-up", + navUpLeft: "nav-up-left", + navUpRight: "nav-up-right", + onAbort: "onabort", + onActivate: "onactivate", + onAfterPrint: "onafterprint", + onBeforePrint: "onbeforeprint", + onBegin: "onbegin", + onCancel: "oncancel", + onCanPlay: "oncanplay", + onCanPlayThrough: "oncanplaythrough", + onChange: "onchange", + onClick: "onclick", + onClose: "onclose", + onCopy: "oncopy", + onCueChange: "oncuechange", + onCut: "oncut", + onDblClick: "ondblclick", + onDrag: "ondrag", + onDragEnd: "ondragend", + onDragEnter: "ondragenter", + onDragExit: "ondragexit", + onDragLeave: "ondragleave", + onDragOver: "ondragover", + onDragStart: "ondragstart", + onDrop: "ondrop", + onDurationChange: "ondurationchange", + onEmptied: "onemptied", + onEnd: "onend", + onEnded: "onended", + onError: "onerror", + onFocus: "onfocus", + onFocusIn: "onfocusin", + onFocusOut: "onfocusout", + onHashChange: "onhashchange", + onInput: "oninput", + onInvalid: "oninvalid", + onKeyDown: "onkeydown", + onKeyPress: "onkeypress", + onKeyUp: "onkeyup", + onLoad: "onload", + onLoadedData: "onloadeddata", + onLoadedMetadata: "onloadedmetadata", + onLoadStart: "onloadstart", + onMessage: "onmessage", + onMouseDown: "onmousedown", + onMouseEnter: "onmouseenter", + onMouseLeave: "onmouseleave", + onMouseMove: "onmousemove", + onMouseOut: "onmouseout", + onMouseOver: "onmouseover", + onMouseUp: "onmouseup", + onMouseWheel: "onmousewheel", + onOffline: "onoffline", + onOnline: "ononline", + onPageHide: "onpagehide", + onPageShow: "onpageshow", + onPaste: "onpaste", + onPause: "onpause", + onPlay: "onplay", + onPlaying: "onplaying", + onPopState: "onpopstate", + onProgress: "onprogress", + onRateChange: "onratechange", + onRepeat: "onrepeat", + onReset: "onreset", + onResize: "onresize", + onScroll: "onscroll", + onSeeked: "onseeked", + onSeeking: "onseeking", + onSelect: "onselect", + onShow: "onshow", + onStalled: "onstalled", + onStorage: "onstorage", + onSubmit: "onsubmit", + onSuspend: "onsuspend", + onTimeUpdate: "ontimeupdate", + onToggle: "ontoggle", + onUnload: "onunload", + onVolumeChange: "onvolumechange", + onWaiting: "onwaiting", + onZoom: "onzoom", + overlinePosition: "overline-position", + overlineThickness: "overline-thickness", + paintOrder: "paint-order", + panose1: "panose-1", + pointerEvents: "pointer-events", + referrerPolicy: "referrerpolicy", + renderingIntent: "rendering-intent", + shapeRendering: "shape-rendering", + stopColor: "stop-color", + stopOpacity: "stop-opacity", + strikethroughPosition: "strikethrough-position", + strikethroughThickness: "strikethrough-thickness", + strokeDashArray: "stroke-dasharray", + strokeDashOffset: "stroke-dashoffset", + strokeLineCap: "stroke-linecap", + strokeLineJoin: "stroke-linejoin", + strokeMiterLimit: "stroke-miterlimit", + strokeOpacity: "stroke-opacity", + strokeWidth: "stroke-width", + tabIndex: "tabindex", + textAnchor: "text-anchor", + textDecoration: "text-decoration", + textRendering: "text-rendering", + typeOf: "typeof", + underlinePosition: "underline-position", + underlineThickness: "underline-thickness", + unicodeBidi: "unicode-bidi", + unicodeRange: "unicode-range", + unitsPerEm: "units-per-em", + vAlphabetic: "v-alphabetic", + vHanging: "v-hanging", + vIdeographic: "v-ideographic", + vMathematical: "v-mathematical", + vectorEffect: "vector-effect", + vertAdvY: "vert-adv-y", + vertOriginX: "vert-origin-x", + vertOriginY: "vert-origin-y", + wordSpacing: "word-spacing", + writingMode: "writing-mode", + xHeight: "x-height", + playbackOrder: "playbackorder", + timelineBegin: "timelinebegin" + }, + transform: caseSensitiveTransform, + properties: { + about: commaOrSpaceSeparated, + accentHeight: number, + accumulate: null, + additive: null, + alignmentBaseline: null, + alphabetic: number, + amplitude: number, + arabicForm: null, + ascent: number, + attributeName: null, + attributeType: null, + azimuth: number, + bandwidth: null, + baselineShift: null, + baseFrequency: null, + baseProfile: null, + bbox: null, + begin: null, + bias: number, + by: null, + calcMode: null, + capHeight: number, + className: spaceSeparated, + clip: null, + clipPath: null, + clipPathUnits: null, + clipRule: null, + color: null, + colorInterpolation: null, + colorInterpolationFilters: null, + colorProfile: null, + colorRendering: null, + content: null, + contentScriptType: null, + contentStyleType: null, + crossOrigin: null, + cursor: null, + cx: null, + cy: null, + d: null, + dataType: null, + defaultAction: null, + descent: number, + diffuseConstant: number, + direction: null, + display: null, + dur: null, + divisor: number, + dominantBaseline: null, + download: boolean, + dx: null, + dy: null, + edgeMode: null, + editable: null, + elevation: number, + enableBackground: null, + end: null, + event: null, + exponent: number, + externalResourcesRequired: null, + fill: null, + fillOpacity: number, + fillRule: null, + filter: null, + filterRes: null, + filterUnits: null, + floodColor: null, + floodOpacity: null, + focusable: null, + focusHighlight: null, + fontFamily: null, + fontSize: null, + fontSizeAdjust: null, + fontStretch: null, + fontStyle: null, + fontVariant: null, + fontWeight: null, + format: null, + fr: null, + from: null, + fx: null, + fy: null, + g1: commaSeparated, + g2: commaSeparated, + glyphName: commaSeparated, + glyphOrientationHorizontal: null, + glyphOrientationVertical: null, + glyphRef: null, + gradientTransform: null, + gradientUnits: null, + handler: null, + hanging: number, + hatchContentUnits: null, + hatchUnits: null, + height: null, + href: null, + hrefLang: null, + horizAdvX: number, + horizOriginX: number, + horizOriginY: number, + id: null, + ideographic: number, + imageRendering: null, + initialVisibility: null, + in: null, + in2: null, + intercept: number, + k: number, + k1: number, + k2: number, + k3: number, + k4: number, + kernelMatrix: commaOrSpaceSeparated, + kernelUnitLength: null, + keyPoints: null, + keySplines: null, + keyTimes: null, + kerning: null, + lang: null, + lengthAdjust: null, + letterSpacing: null, + lightingColor: null, + limitingConeAngle: number, + local: null, + markerEnd: null, + markerMid: null, + markerStart: null, + markerHeight: null, + markerUnits: null, + markerWidth: null, + mask: null, + maskContentUnits: null, + maskUnits: null, + mathematical: null, + max: null, + media: null, + mediaCharacterEncoding: null, + mediaContentEncodings: null, + mediaSize: number, + mediaTime: null, + method: null, + min: null, + mode: null, + name: null, + navDown: null, + navDownLeft: null, + navDownRight: null, + navLeft: null, + navNext: null, + navPrev: null, + navRight: null, + navUp: null, + navUpLeft: null, + navUpRight: null, + numOctaves: null, + observer: null, + offset: null, + onAbort: null, + onActivate: null, + onAfterPrint: null, + onBeforePrint: null, + onBegin: null, + onCancel: null, + onCanPlay: null, + onCanPlayThrough: null, + onChange: null, + onClick: null, + onClose: null, + onCopy: null, + onCueChange: null, + onCut: null, + onDblClick: null, + onDrag: null, + onDragEnd: null, + onDragEnter: null, + onDragExit: null, + onDragLeave: null, + onDragOver: null, + onDragStart: null, + onDrop: null, + onDurationChange: null, + onEmptied: null, + onEnd: null, + onEnded: null, + onError: null, + onFocus: null, + onFocusIn: null, + onFocusOut: null, + onHashChange: null, + onInput: null, + onInvalid: null, + onKeyDown: null, + onKeyPress: null, + onKeyUp: null, + onLoad: null, + onLoadedData: null, + onLoadedMetadata: null, + onLoadStart: null, + onMessage: null, + onMouseDown: null, + onMouseEnter: null, + onMouseLeave: null, + onMouseMove: null, + onMouseOut: null, + onMouseOver: null, + onMouseUp: null, + onMouseWheel: null, + onOffline: null, + onOnline: null, + onPageHide: null, + onPageShow: null, + onPaste: null, + onPause: null, + onPlay: null, + onPlaying: null, + onPopState: null, + onProgress: null, + onRateChange: null, + onRepeat: null, + onReset: null, + onResize: null, + onScroll: null, + onSeeked: null, + onSeeking: null, + onSelect: null, + onShow: null, + onStalled: null, + onStorage: null, + onSubmit: null, + onSuspend: null, + onTimeUpdate: null, + onToggle: null, + onUnload: null, + onVolumeChange: null, + onWaiting: null, + onZoom: null, + opacity: null, + operator: null, + order: null, + orient: null, + orientation: null, + origin: null, + overflow: null, + overlay: null, + overlinePosition: number, + overlineThickness: number, + paintOrder: null, + panose1: null, + path: null, + pathLength: number, + patternContentUnits: null, + patternTransform: null, + patternUnits: null, + phase: null, + ping: spaceSeparated, + pitch: null, + playbackOrder: null, + pointerEvents: null, + points: null, + pointsAtX: number, + pointsAtY: number, + pointsAtZ: number, + preserveAlpha: null, + preserveAspectRatio: null, + primitiveUnits: null, + propagate: null, + property: commaOrSpaceSeparated, + r: null, + radius: null, + referrerPolicy: null, + refX: null, + refY: null, + rel: commaOrSpaceSeparated, + rev: commaOrSpaceSeparated, + renderingIntent: null, + repeatCount: null, + repeatDur: null, + requiredExtensions: commaOrSpaceSeparated, + requiredFeatures: commaOrSpaceSeparated, + requiredFonts: commaOrSpaceSeparated, + requiredFormats: commaOrSpaceSeparated, + resource: null, + restart: null, + result: null, + rotate: null, + rx: null, + ry: null, + scale: null, + seed: null, + shapeRendering: null, + side: null, + slope: null, + snapshotTime: null, + specularConstant: number, + specularExponent: number, + spreadMethod: null, + spacing: null, + startOffset: null, + stdDeviation: null, + stemh: null, + stemv: null, + stitchTiles: null, + stopColor: null, + stopOpacity: null, + strikethroughPosition: number, + strikethroughThickness: number, + string: null, + stroke: null, + strokeDashArray: commaOrSpaceSeparated, + strokeDashOffset: null, + strokeLineCap: null, + strokeLineJoin: null, + strokeMiterLimit: number, + strokeOpacity: number, + strokeWidth: null, + style: null, + surfaceScale: number, + syncBehavior: null, + syncBehaviorDefault: null, + syncMaster: null, + syncTolerance: null, + syncToleranceDefault: null, + systemLanguage: commaOrSpaceSeparated, + tabIndex: number, + tableValues: null, + target: null, + targetX: number, + targetY: number, + textAnchor: null, + textDecoration: null, + textRendering: null, + textLength: null, + timelineBegin: null, + title: null, + transformBehavior: null, + type: null, + typeOf: commaOrSpaceSeparated, + to: null, + transform: null, + u1: null, + u2: null, + underlinePosition: number, + underlineThickness: number, + unicode: null, + unicodeBidi: null, + unicodeRange: null, + unitsPerEm: number, + values: null, + vAlphabetic: number, + vMathematical: number, + vectorEffect: null, + vHanging: number, + vIdeographic: number, + version: null, + vertAdvY: number, + vertOriginX: number, + vertOriginY: number, + viewBox: null, + viewTarget: null, + visibility: null, + width: null, + widths: null, + wordSpacing: null, + writingMode: null, + x: null, + x1: null, + x2: null, + xChannelSelector: null, + xHeight: number, + y: null, + y1: null, + y2: null, + yChannelSelector: null, + z: null, + zoomAndPan: null + } +}); + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/find.js +var valid = /^data[-\w.:]+$/i; +var dash = /-[a-z]/g; +var cap = /[A-Z]/g; +function find(schema, value) { + const normal = normalize(value); + let prop = value; + let Type = Info; + if (normal in schema.normal) { + return schema.property[schema.normal[normal]]; + } + if (normal.length > 4 && normal.slice(0, 4) === "data" && valid.test(value)) { + if (value.charAt(4) === "-") { + const rest = value.slice(5).replace(dash, camelcase); + prop = "data" + rest.charAt(0).toUpperCase() + rest.slice(1); + } else { + const rest = value.slice(4); + if (!dash.test(rest)) { + let dashes = rest.replace(cap, kebab); + if (dashes.charAt(0) !== "-") { + dashes = "-" + dashes; + } + value = "data" + dashes; + } + } + Type = DefinedInfo; + } + return new Type(prop, value); +} +function kebab($0) { + return "-" + $0.toLowerCase(); +} +function camelcase($0) { + return $0.charAt(1).toUpperCase(); +} + +// node_modules/hast-util-to-estree/node_modules/property-information/lib/hast-to-react.js +var hastToReact = { + classId: "classID", + dataType: "datatype", + itemId: "itemID", + strokeDashArray: "strokeDasharray", + strokeDashOffset: "strokeDashoffset", + strokeLineCap: "strokeLinecap", + strokeLineJoin: "strokeLinejoin", + strokeMiterLimit: "strokeMiterlimit", + typeOf: "typeof", + xLinkActuate: "xlinkActuate", + xLinkArcRole: "xlinkArcrole", + xLinkHref: "xlinkHref", + xLinkRole: "xlinkRole", + xLinkShow: "xlinkShow", + xLinkTitle: "xlinkTitle", + xLinkType: "xlinkType", + xmlnsXLink: "xmlnsXlink" +}; + +// node_modules/hast-util-to-estree/node_modules/property-information/index.js +var html3 = merge([xml, xlink, xmlns, aria, html2], "html"); +var svg2 = merge([xml, xlink, xmlns, aria, svg], "svg"); + +// node_modules/hast-util-to-estree/node_modules/space-separated-tokens/index.js +function stringify3(values) { + return values.join(" ").trim(); +} + +// node_modules/hast-util-to-estree/lib/index.js +var import_style_to_object = __toESM(require_style_to_object(), 1); + +// node_modules/zwitch/index.js +var own11 = {}.hasOwnProperty; +function zwitch(key, options) { + var settings = options || {}; + function one3(value) { + var fn = one3.invalid; + var handlers2 = one3.handlers; + if (value && own11.call(value, key)) { + fn = own11.call(handlers2, value[key]) ? handlers2[value[key]] : one3.unknown; + } + if (fn) { + return fn.apply(this, arguments); + } + } + one3.handlers = settings.handlers || {}; + one3.invalid = settings.invalid; + one3.unknown = settings.unknown; + return one3; +} + +// node_modules/hast-util-to-estree/lib/index.js +var toReact = hastToReact; +var own12 = {}.hasOwnProperty; +var tableElements = /* @__PURE__ */ new Set([ + "table", + "thead", + "tbody", + "tfoot", + "tr", + "th", + "td" +]); +function toEstree(tree, options = {}) { + const context = { + schema: options.space === "svg" ? svg2 : html3, + comments: [], + esm: [], + handle: zwitch("type", { + invalid, + unknown: unknown2, + handlers: Object.assign( + {}, + { + comment, + doctype: ignore2, + element, + mdxjsEsm: mdxjsEsm2, + mdxFlowExpression: mdxExpression2, + mdxJsxFlowElement: mdxJsxElement, + mdxJsxTextElement: mdxJsxElement, + mdxTextExpression: mdxExpression2, + root: root2, + text: text4 + }, + options.handlers + ) + }) + }; + let result = context.handle(tree, context); + const body = context.esm; + if (result) { + if (result.type !== "JSXFragment" && result.type !== "JSXElement") { + result = create4(tree, { + type: "JSXFragment", + openingFragment: { type: "JSXOpeningFragment" }, + closingFragment: { type: "JSXClosingFragment" }, + children: [result] + }); + } + body.push(create4(tree, { type: "ExpressionStatement", expression: result })); + } + return create4(tree, { + type: "Program", + body, + sourceType: "module", + comments: context.comments + }); +} +function invalid(value) { + throw new Error("Cannot handle value `" + value + "`, expected node"); +} +function unknown2(node) { + throw new Error("Cannot handle unknown node `" + node.type + "`"); +} +function ignore2() { +} +function comment(node, context) { + const esnode = inherit(node, { type: "Block", value: node.value }); + context.comments.push(esnode); + return create4(node, { + type: "JSXExpressionContainer", + expression: create4(node, { + type: "JSXEmptyExpression", + comments: [Object.assign({}, esnode, { leading: false, trailing: true })] + }) + }); +} +function element(node, context) { + const parentSchema = context.schema; + let schema = parentSchema; + const props = node.properties || {}; + if (parentSchema.space === "html" && node.tagName.toLowerCase() === "svg") { + schema = svg2; + context.schema = schema; + } + const children = all3(node, context); + const attributes = []; + let prop; + for (prop in props) { + if (own12.call(props, prop)) { + let value = props[prop]; + const info = find(schema, prop); + let attributeValue; + if (value === void 0 || value === null || typeof value === "number" && Number.isNaN(value) || value === false || !value && info.boolean) { + continue; + } + prop = info.space ? toReact[info.property] || info.property : info.attribute; + if (Array.isArray(value)) { + value = info.commaSeparated ? stringify2(value) : stringify3(value); + } + if (prop === "style") { + const styleValue = typeof value === "string" ? parseStyle(value, node.tagName) : value; + const cssProperties = []; + let cssProp; + for (cssProp in styleValue) { + if (own12.call(styleValue, cssProp)) { + cssProperties.push({ + type: "Property", + method: false, + shorthand: false, + computed: false, + key: { type: "Identifier", name: cssProp }, + value: { type: "Literal", value: String(styleValue[cssProp]) }, + kind: "init" + }); + } + } + attributeValue = { + type: "JSXExpressionContainer", + expression: { type: "ObjectExpression", properties: cssProperties } + }; + } else if (value === true) { + attributeValue = null; + } else { + attributeValue = { type: "Literal", value: String(value) }; + } + if (jsxIdentifierName(prop)) { + attributes.push({ + type: "JSXAttribute", + name: { type: "JSXIdentifier", name: prop }, + value: attributeValue + }); + } else { + attributes.push({ + type: "JSXSpreadAttribute", + argument: { + type: "ObjectExpression", + properties: [ + { + type: "Property", + method: false, + shorthand: false, + computed: false, + key: { type: "Literal", value: String(prop) }, + value: attributeValue || { type: "Literal", value: true }, + kind: "init" + } + ] + } + }); + } + } + } + context.schema = parentSchema; + return inherit(node, { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + attributes, + name: createJsxName(node.tagName), + selfClosing: children.length === 0 + }, + closingElement: children.length > 0 ? { type: "JSXClosingElement", name: createJsxName(node.tagName) } : null, + children + }); +} +function mdxjsEsm2(node, context) { + const estree = node.data && node.data.estree; + const comments = estree && estree.comments || []; + if (estree) { + context.comments.push(...comments); + attachComments(estree, comments); + context.esm.push(...estree.body); + } +} +function mdxExpression2(node, context) { + const estree = node.data && node.data.estree; + const comments = estree && estree.comments || []; + let expression; + if (estree) { + context.comments.push(...comments); + attachComments(estree, estree.comments); + expression = estree.body[0] && estree.body[0].type === "ExpressionStatement" && estree.body[0].expression || void 0; + } + return inherit(node, { + type: "JSXExpressionContainer", + expression: expression || create4(node, { type: "JSXEmptyExpression" }) + }); +} +function mdxJsxElement(node, context) { + const parentSchema = context.schema; + let schema = parentSchema; + const attrs = node.attributes || []; + let index2 = -1; + if (node.name && parentSchema.space === "html" && node.name.toLowerCase() === "svg") { + schema = svg2; + context.schema = schema; + } + const children = all3(node, context); + const attributes = []; + while (++index2 < attrs.length) { + const attr = attrs[index2]; + const value = attr.value; + let attributeValue; + if (attr.type === "mdxJsxAttribute") { + if (value === void 0 || value === null) { + attributeValue = null; + } else if (typeof value === "object") { + const estree = value.data && value.data.estree; + const comments = estree && estree.comments || []; + let expression; + if (estree) { + context.comments.push(...comments); + attachComments(estree, estree.comments); + expression = estree.body[0] && estree.body[0].type === "ExpressionStatement" && estree.body[0].expression || void 0; + } + attributeValue = inherit(value, { + type: "JSXExpressionContainer", + expression: expression || { type: "JSXEmptyExpression" } + }); + } else { + attributeValue = { type: "Literal", value: String(value) }; + } + attributes.push( + inherit(attr, { + type: "JSXAttribute", + name: createJsxName(attr.name, true), + value: attributeValue + }) + ); + } else { + const estree = attr.data && attr.data.estree; + const comments = estree && estree.comments || []; + let argumentValue; + if (estree) { + context.comments.push(...comments); + attachComments(estree, estree.comments); + argumentValue = estree.body[0] && estree.body[0].type === "ExpressionStatement" && estree.body[0].expression && estree.body[0].expression.type === "ObjectExpression" && estree.body[0].expression.properties && estree.body[0].expression.properties[0] && estree.body[0].expression.properties[0].type === "SpreadElement" && estree.body[0].expression.properties[0].argument || void 0; + } + attributes.push( + inherit(attr, { + type: "JSXSpreadAttribute", + argument: argumentValue || { type: "ObjectExpression", properties: [] } + }) + ); + } + } + context.schema = parentSchema; + return inherit( + node, + node.name ? { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + attributes, + name: createJsxName(node.name), + selfClosing: children.length === 0 + }, + closingElement: children.length > 0 ? { type: "JSXClosingElement", name: createJsxName(node.name) } : null, + children + } : { + type: "JSXFragment", + openingFragment: { type: "JSXOpeningFragment" }, + closingFragment: { type: "JSXClosingFragment" }, + children + } + ); +} +function root2(node, context) { + const children = all3(node, context); + const cleanChildren = []; + let index2 = -1; + let queue; + while (++index2 < children.length) { + const child = children[index2]; + if (child.type === "JSXExpressionContainer" && child.expression.type === "Literal" && whitespace(child.expression.value)) { + if (queue) + queue.push(child); + } else { + if (queue) + cleanChildren.push(...queue); + cleanChildren.push(child); + queue = []; + } + } + return inherit(node, { + type: "JSXFragment", + openingFragment: { type: "JSXOpeningFragment" }, + closingFragment: { type: "JSXClosingFragment" }, + children: cleanChildren + }); +} +function text4(node) { + const value = String(node.value || ""); + if (!value) + return; + return create4(node, { + type: "JSXExpressionContainer", + expression: inherit(node, { type: "Literal", value }) + }); +} +function all3(parent, context) { + const children = parent.children || []; + let index2 = -1; + const results = []; + const ignoreLineBreak = context.schema.space === "html" && parent.type === "element" && tableElements.has(parent.tagName.toLowerCase()); + while (++index2 < children.length) { + const child = children[index2]; + if (ignoreLineBreak && child.type === "text" && child.value === "\n") { + continue; + } + const result = context.handle(child, context); + if (Array.isArray(result)) { + results.push(...result); + } else if (result) { + results.push(result); + } + } + return results; +} +function inherit(hast, esnode) { + const left = hast.data; + let right; + let key; + create4(hast, esnode); + if (left) { + for (key in left) { + if (own12.call(left, key) && key !== "estree") { + if (!right) + right = {}; + right[key] = left[key]; + } + } + if (right) { + esnode.data = right; + } + } + return esnode; +} +function create4(hast, esnode) { + const p = position2(hast); + if (p.start.line && p.start.offset !== void 0 && p.end.offset !== void 0) { + esnode.start = p.start.offset; + esnode.end = p.end.offset; + esnode.loc = { + start: { line: p.start.line, column: p.start.column - 1 }, + end: { line: p.end.line, column: p.end.column - 1 } + }; + esnode.range = [p.start.offset, p.end.offset]; + } + return esnode; +} +var createJsxName = function(name2, attribute) { + if (!attribute && name2.includes(".")) { + const parts = name2.split("."); + let part = parts.shift(); + let node = { type: "JSXIdentifier", name: part }; + while (part = parts.shift()) { + node = { + type: "JSXMemberExpression", + object: node, + property: { type: "JSXIdentifier", name: part } + }; + } + return node; + } + if (name2.includes(":")) { + const parts = name2.split(":"); + return { + type: "JSXNamespacedName", + namespace: { type: "JSXIdentifier", name: parts[0] }, + name: { type: "JSXIdentifier", name: parts[1] } + }; + } + return { type: "JSXIdentifier", name: name2 }; +}; +function parseStyle(value, tagName) { + const result = {}; + try { + (0, import_style_to_object.default)(value, iterator); + } catch (error) { + const exception = error; + exception.message = tagName + "[style]" + exception.message.slice("undefined".length); + throw error; + } + return result; + function iterator(name2, value2) { + if (name2.slice(0, 4) === "-ms-") + name2 = "ms-" + name2.slice(4); + result[name2.replace(/-([a-z])/g, styleReplacer)] = value2; + } +} +function styleReplacer(_, $1) { + return $1.toUpperCase(); +} +function jsxIdentifierName(name2) { + let index2 = -1; + while (++index2 < name2.length) { + if (!(index2 ? cont3 : start2)(name2.charCodeAt(index2))) + return false; + } + return index2 > 0; + function cont3(code2) { + return cont2(code2) || code2 === 45; + } +} + +// node_modules/@mdx-js/mdx/lib/plugin/rehype-recma.js +function rehypeRecma() { + return (tree) => toEstree(tree); +} + +// node_modules/@mdx-js/mdx/lib/plugin/rehype-remove-raw.js +function rehypeRemoveRaw() { + return (tree) => { + visit2(tree, "raw", (_, index2, parent) => { + if (parent && typeof index2 === "number") { + parent.children.splice(index2, 1); + return index2; + } + }); + }; +} + +// node_modules/@mdx-js/mdx/lib/plugin/remark-mark-and-unravel.js +function remarkMarkAndUnravel() { + return (tree) => { + visit2(tree, (node, index2, parent_) => { + const parent = parent_; + let offset2 = -1; + let all4 = true; + let oneOrMore; + if (parent && typeof index2 === "number" && node.type === "paragraph") { + const children = node.children; + while (++offset2 < children.length) { + const child = children[offset2]; + if (child.type === "mdxJsxTextElement" || child.type === "mdxTextExpression") { + oneOrMore = true; + } else if (child.type === "text" && /^[\t\r\n ]+$/.test(String(child.value))) { + } else { + all4 = false; + break; + } + } + if (all4 && oneOrMore) { + offset2 = -1; + while (++offset2 < children.length) { + const child = children[offset2]; + if (child.type === "mdxJsxTextElement") { + child.type = "mdxJsxFlowElement"; + } + if (child.type === "mdxTextExpression") { + child.type = "mdxFlowExpression"; + } + } + parent.children.splice(index2, 1, ...children); + return index2; + } + } + if (node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement") { + const data2 = node.data || (node.data = {}); + data2._mdxExplicitJsx = true; + } + }); + }; +} + +// node_modules/@mdx-js/mdx/lib/node-types.js +var nodeTypes = [ + "mdxFlowExpression", + "mdxJsxFlowElement", + "mdxJsxTextElement", + "mdxTextExpression", + "mdxjsEsm" +]; + +// node_modules/@mdx-js/mdx/lib/condition.js +var import_process2 = __toESM(require("process"), 1); +var development = import_process2.default.env.NODE_ENV === "development"; + +// node_modules/@mdx-js/mdx/lib/core.js +var removedOptions = [ + "filepath", + "compilers", + "hastPlugins", + "mdPlugins", + "skipExport", + "wrapExport" +]; +function createProcessor(options = {}) { + const { + development: development2 = development, + jsx: jsx2, + format, + outputFormat, + providerImportSource, + recmaPlugins, + rehypePlugins, + remarkPlugins, + remarkRehypeOptions = {}, + SourceMapGenerator, + ...rest + } = options; + let index2 = -1; + while (++index2 < removedOptions.length) { + const key = removedOptions[index2]; + if (key in options) { + throw new Error( + "`options." + key + "` is no longer supported. Please see for more information" + ); + } + } + if (format === "detect") { + throw new Error( + "Incorrect `format: 'detect'`: `createProcessor` can support either `md` or `mdx`; it does not support detecting the format" + ); + } + const pipeline = unified().use(remark_parse_default); + if (format !== "md") { + pipeline.use(remarkMdx); + } + pipeline.use(remarkMarkAndUnravel).use(remarkPlugins || []).use(lib_default, { + ...remarkRehypeOptions, + allowDangerousHtml: true, + passThrough: [...remarkRehypeOptions.passThrough || [], ...nodeTypes] + }).use(rehypePlugins || []); + if (format === "md") { + pipeline.use(rehypeRemoveRaw); + } + pipeline.use(rehypeRecma).use(recmaDocument, { ...rest, outputFormat }).use(recmaJsxRewrite, { development: development2, providerImportSource, outputFormat }); + if (!jsx2) { + pipeline.use(recmaJsxBuild, { outputFormat }); + } + pipeline.use(recmaStringify, { SourceMapGenerator }).use(recmaPlugins || []); + return pipeline; +} + +// node_modules/@mdx-js/mdx/lib/util/extnames.js +var import_markdown_extensions = __toESM(require_markdown_extensions2(), 1); +var md = import_markdown_extensions.default.map((d) => "." + d); + +// node_modules/@mdx-js/mdx/lib/util/resolve-file-and-options.js +function resolveFileAndOptions(vfileCompatible, options) { + const file = looksLikeAVFile2(vfileCompatible) ? vfileCompatible : new VFile(vfileCompatible); + const { format, ...rest } = options || {}; + return { + file, + options: { + format: format === "md" || format === "mdx" ? format : file.extname && (rest.mdExtensions || md).includes(file.extname) ? "md" : "mdx", + ...rest + } + }; +} +function looksLikeAVFile2(value) { + return Boolean( + value && typeof value === "object" && "message" in value && "messages" in value + ); +} + +// node_modules/@mdx-js/mdx/lib/compile.js +function compile(vfileCompatible, compileOptions) { + const { file, options } = resolveFileAndOptions(vfileCompatible, compileOptions); + return createProcessor(options).process(file); +} +function compileSync(vfileCompatible, compileOptions) { + const { file, options } = resolveFileAndOptions(vfileCompatible, compileOptions); + return createProcessor(options).processSync(file); +} + +// node_modules/@mdx-js/mdx/lib/run.js +var AsyncFunction = Object.getPrototypeOf(run).constructor; +async function run(file, options) { + return new AsyncFunction(String(file))(options); +} +function runSync(file, options) { + return new Function(String(file))(options); +} + +// node_modules/@mdx-js/mdx/lib/util/resolve-evaluate-options.js +function resolveEvaluateOptions(options) { + const { Fragment, jsx: jsx2, jsxs, useMDXComponents, ...rest } = options || {}; + if (!Fragment) + throw new Error("Expected `Fragment` given to `evaluate`"); + if (!jsx2) + throw new Error("Expected `jsx` given to `evaluate`"); + if (!jsxs) + throw new Error("Expected `jsxs` given to `evaluate`"); + return { + compiletime: { + ...rest, + outputFormat: "function-body", + providerImportSource: useMDXComponents ? "#" : void 0 + }, + runtime: { Fragment, jsx: jsx2, jsxs, useMDXComponents } + }; +} + +// node_modules/@mdx-js/mdx/lib/evaluate.js +async function evaluate(vfileCompatible, evaluateOptions) { + const { compiletime, runtime } = resolveEvaluateOptions(evaluateOptions); + return run(await compile(vfileCompatible, compiletime), runtime); +} +function evaluateSync(vfileCompatible, evaluateOptions) { + const { compiletime, runtime } = resolveEvaluateOptions(evaluateOptions); + return runSync(compileSync(vfileCompatible, compiletime), runtime); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + compile, + compileSync, + createProcessor, + evaluate, + evaluateSync, + nodeTypes, + run, + runSync +}); +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ From 99758d36d842d0af1d281c0ae3ef21285952ba0f Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 17:36:14 +0100 Subject: [PATCH 059/155] fix footnoteIDFixer tests --- .../footnoteIDFixer.test.ts.snap | 157 +++++++++++------- .../remark/__tests__/footnoteIDFixer.test.ts | 18 +- 2 files changed, 107 insertions(+), 68 deletions(-) diff --git a/packages/docusaurus-plugin-content-blog/src/remark/__tests__/__snapshots__/footnoteIDFixer.test.ts.snap b/packages/docusaurus-plugin-content-blog/src/remark/__tests__/__snapshots__/footnoteIDFixer.test.ts.snap index cbf3583335c9..e97d5b3a0341 100644 --- a/packages/docusaurus-plugin-content-blog/src/remark/__tests__/__snapshots__/footnoteIDFixer.test.ts.snap +++ b/packages/docusaurus-plugin-content-blog/src/remark/__tests__/__snapshots__/footnoteIDFixer.test.ts.snap @@ -1,66 +1,101 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`footnoteIDFixer remark plugin appends a hash to each footnote def/ref 1`] = ` -"/* @jsxRuntime classic */ -/* @jsx mdx */ - - - -const layoutProps = { - -}; -const MDXLayout = "wrapper" -export default function MDXContent({ - components, - ...props -}) { - return -

{\`foo\`}{\`1\`}

-

{\`bar\`}{\`2\`}

-

{\`baz\`}{\`3\`}

-
-
-
    -
  1. {\`foo\`}{\`↩\`}
  2. -
  3. {\`foo\`}{\`↩\`}
  4. -
  5. {\`foo\`}{\`↩\`}
  6. -
-
-
; +"/*@jsxRuntime automatic @jsxImportSource react*/ +import {Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs} from "react/jsx-runtime"; +function _createMdxContent(props) { + const _components = Object.assign({ + p: "p", + sup: "sup", + a: "a", + section: "section", + h2: "h2", + ol: "ol", + li: "li" + }, props.components); + return _jsxs(_Fragment, { + children: [_jsxs(_components.p, { + children: ["foo", _jsx(_components.sup, { + children: _jsx(_components.a, { + href: "#user-content-fn-1-[HASH]", + id: "user-content-fnref-1-[HASH]", + "data-footnote-ref": true, + "aria-describedby": "footnote-label", + children: "1" + }) + })] + }), "/n", _jsxs(_components.p, { + children: ["bar", _jsx(_components.sup, { + children: _jsx(_components.a, { + href: "#user-content-fn-2-[HASH]", + id: "user-content-fnref-2-[HASH]", + "data-footnote-ref": true, + "aria-describedby": "footnote-label", + children: "2" + }) + })] + }), "/n", _jsxs(_components.p, { + children: ["baz", _jsx(_components.sup, { + children: _jsx(_components.a, { + href: "#user-content-fn-3-[HASH]", + id: "user-content-fnref-3-[HASH]", + "data-footnote-ref": true, + "aria-describedby": "footnote-label", + children: "3" + }) + })] + }), "/n", _jsxs(_components.section, { + "data-footnotes": true, + className: "footnotes", + children: [_jsx(_components.h2, { + className: "sr-only", + id: "footnote-label", + children: "Footnotes" + }), "/n", _jsxs(_components.ol, { + children: ["/n", _jsxs(_components.li, { + id: "user-content-fn-1-[HASH]", + children: ["/n", _jsxs(_components.p, { + children: ["foo ", _jsx(_components.a, { + href: "#user-content-fnref-1-[HASH]", + "data-footnote-backref": true, + className: "data-footnote-backref", + "aria-label": "Back to content", + children: "↩" + })] + }), "/n"] + }), "/n", _jsxs(_components.li, { + id: "user-content-fn-2-[HASH]", + children: ["/n", _jsxs(_components.p, { + children: ["foo ", _jsx(_components.a, { + href: "#user-content-fnref-2-[HASH]", + "data-footnote-backref": true, + className: "data-footnote-backref", + "aria-label": "Back to content", + children: "↩" + })] + }), "/n"] + }), "/n", _jsxs(_components.li, { + id: "user-content-fn-3-[HASH]", + children: ["/n", _jsxs(_components.p, { + children: ["foo ", _jsx(_components.a, { + href: "#user-content-fnref-3-[HASH]", + "data-footnote-backref": true, + className: "data-footnote-backref", + "aria-label": "Back to content", + children: "↩" + })] + }), "/n"] + }), "/n"] + }), "/n"] + })] + }); } - -; -MDXContent.isMDXComponent = true;" +function MDXContent(props = {}) { + const {wrapper: MDXLayout} = props.components || ({}); + return MDXLayout ? _jsx(MDXLayout, Object.assign({}, props, { + children: _jsx(_createMdxContent, props) + })) : _createMdxContent(props); +} +export default MDXContent; +" `; diff --git a/packages/docusaurus-plugin-content-blog/src/remark/__tests__/footnoteIDFixer.test.ts b/packages/docusaurus-plugin-content-blog/src/remark/__tests__/footnoteIDFixer.test.ts index 1c757047444b..b8c6cdf8e0ba 100644 --- a/packages/docusaurus-plugin-content-blog/src/remark/__tests__/footnoteIDFixer.test.ts +++ b/packages/docusaurus-plugin-content-blog/src/remark/__tests__/footnoteIDFixer.test.ts @@ -5,20 +5,24 @@ * LICENSE file in the root directory of this source tree. */ -import fs from 'fs-extra'; import path from 'path'; +import vfile from 'to-vfile'; + import {simpleHash} from '@docusaurus/utils'; -import mdx from '@mdx-js/mdx'; import footnoteIDFixer from '../footnoteIDFixer'; const processFixture = async (name: string) => { - const filepath = path.join(__dirname, `__fixtures__/${name}.md`); - const result = await mdx(await fs.readFile(filepath, 'utf8'), { - filepath, - remarkPlugins: [footnoteIDFixer], + const mdx = await import('@mdx-js/mdx'); + const {default: gfm} = await import('remark-gfm'); + + const filePath = path.join(__dirname, `__fixtures__/${name}.md`); + const file = await vfile.read(filePath); + + const result = await mdx.compile(file, { + remarkPlugins: [gfm, footnoteIDFixer], }); - return result.toString(); + return result.value; }; describe('footnoteIDFixer remark plugin', () => { From 77582800bed6148d90a742234a55804f8c311bff Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 18:25:56 +0100 Subject: [PATCH 060/155] useless comment --- packages/docusaurus-mdx-loader/src/loader.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index a075d8b4320c..b7e0b69be5bc 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -22,9 +22,7 @@ import transformImage from './remark/transformImage'; import transformLinks from './remark/transformLinks'; import mermaid from './remark/mermaid'; -import transformAdmonitions, { - normalizeAdmonitionOptions, -} from './remark/admonitions'; +import transformAdmonitions from './remark/admonitions'; import codeCompatPlugin from './remark/mdx1Compat/codeCompatPlugin'; import type {MarkdownConfig} from '@docusaurus/types'; import type {LoaderContext} from 'webpack'; From a361694b87aaaf893cf3f141d12bb0e60bbc2c14 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 18:38:37 +0100 Subject: [PATCH 061/155] TS errors workaround? --- website/docusaurus.config.js | 2 ++ website/tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 261076223d21..b96b9947a7b2 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -156,6 +156,7 @@ const config = { ], [ 'content-docs', + // @ts-expect-error: todo fix npm2yarn plugin /** @type {import('@docusaurus/plugin-content-docs').Options} */ ({ id: 'community', @@ -281,6 +282,7 @@ const config = { presets: [ [ 'classic', + // @ts-expect-error: todo fix npm2yarn plugin /** @type {import('@docusaurus/preset-classic').Options} */ ({ debug: true, // force debug plugin usage diff --git a/website/tsconfig.json b/website/tsconfig.json index 0fcd0946a271..67aee6fffb90 100644 --- a/website/tsconfig.json +++ b/website/tsconfig.json @@ -34,7 +34,7 @@ // with our declaration files (mostly names that are forgotten to be // imported, invalid semantics...). Because we don't have end-to-end type // tests, removing this would make things much harder to catch. - "skipLibCheck": false, + "skipLibCheck": true, // TODO revert to false!!! "types": ["jest"] }, "exclude": ["src/sw.js"] From 9b46551b46ca573fb37f3f63234ed58551ef54c2 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 2 Dec 2022 19:09:17 +0100 Subject: [PATCH 062/155] re-add all site versions --- website/docusaurus.config.js | 2 +- website/src/pages/versions.tsx | 12 ------------ .../version-2.0.1/api/plugins/plugin-pwa.md | 2 +- website/versioned_docs/version-2.0.1/introduction.md | 1 - .../version-2.1.0/api/plugins/plugin-pwa.md | 2 +- website/versioned_docs/version-2.1.0/introduction.md | 1 - .../version-2.2.0/api/plugins/plugin-pwa.md | 2 +- website/versioned_docs/version-2.2.0/introduction.md | 1 - website/versions.json | 4 +++- 9 files changed, 7 insertions(+), 20 deletions(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index b96b9947a7b2..f4ccc0f38ee9 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -114,7 +114,7 @@ const config = { markdown: { mermaid: true, }, - onBrokenLinks: 'warn', + onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', favicon: 'img/docusaurus.ico', customFields: { diff --git a/website/src/pages/versions.tsx b/website/src/pages/versions.tsx index e3475738a77e..5e748d6571c4 100644 --- a/website/src/pages/versions.tsx +++ b/website/src/pages/versions.tsx @@ -36,18 +36,6 @@ function ReleaseNotesLabel() { } export default function Version(): JSX.Element { - // TODO - return ( - - Versions page disabled - - ); -} - -// TODO -function VersionOld(): JSX.Element { const { siteConfig: {organizationName, projectName}, } = useDocusaurusContext(); diff --git a/website/versioned_docs/version-2.0.1/api/plugins/plugin-pwa.md b/website/versioned_docs/version-2.0.1/api/plugins/plugin-pwa.md index 5efe356b112e..b92024a8c9d9 100644 --- a/website/versioned_docs/version-2.0.1/api/plugins/plugin-pwa.md +++ b/website/versioned_docs/version-2.0.1/api/plugins/plugin-pwa.md @@ -120,7 +120,7 @@ Strategies used to turn the offline mode on: - `appInstalled`: activates for users having installed the site as an app (not 100% reliable) - `standalone`: activates for users running the app as standalone (often the case once a PWA is installed) - `queryString`: activates if queryString contains `offlineMode=true` (convenient for PWA debugging) -- `mobile`: activates for mobile users (width <= 996px) +- `mobile`: activates for mobile users (width \<= 996px) - `saveData`: activates for users with `navigator.connection.saveData === true` - `always`: activates for all users diff --git a/website/versioned_docs/version-2.0.1/introduction.md b/website/versioned_docs/version-2.0.1/introduction.md index 4a0cc82d600b..75a33698f460 100644 --- a/website/versioned_docs/version-2.0.1/introduction.md +++ b/website/versioned_docs/version-2.0.1/introduction.md @@ -55,7 +55,6 @@ import LiteYouTubeEmbed from 'react-lite-youtube-embed';
Date: Sun, 4 Dec 2022 19:36:51 +0100 Subject: [PATCH 063/155] fix docs --- .../version-2.0.1/api/plugins/plugin-content-blog.md | 2 +- .../versioned_docs/version-2.0.1/api/themes/theme-classic.md | 2 ++ .../version-2.1.0/api/plugins/plugin-content-blog.md | 2 +- .../versioned_docs/version-2.1.0/api/themes/theme-classic.md | 2 ++ .../version-2.2.0/api/plugins/plugin-content-blog.md | 2 +- .../versioned_docs/version-2.2.0/api/themes/theme-classic.md | 2 ++ 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/website/versioned_docs/version-2.0.1/api/plugins/plugin-content-blog.md b/website/versioned_docs/version-2.0.1/api/plugins/plugin-content-blog.md index 696b4102858d..dc7466f24fd7 100644 --- a/website/versioned_docs/version-2.0.1/api/plugins/plugin-content-blog.md +++ b/website/versioned_docs/version-2.0.1/api/plugins/plugin-content-blog.md @@ -68,7 +68,7 @@ Accepted fields: | `feedOptions` | _See below_ | `{type: ['rss', 'atom']}` | Blog feed. | | `feedOptions.type` | FeedType \| FeedType[] \| 'all' \| null | **Required** | Type of feed to be generated. Use `null` to disable generation. | | `feedOptions.title` | `string` | `siteConfig.title` | Title of the feed. | -| `feedOptions.description` | `string` | \`${siteConfig.title} Blog\` | Description of the feed. | +| `feedOptions.description` | `string` | \`$\{siteConfig.title} Blog\` | Description of the feed. | | `feedOptions.copyright` | `string` | `undefined` | Copyright message. | | `feedOptions.language` | `string` (See [documentation](http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes) for possible values) | `undefined` | Language metadata of the feed. | | `sortPosts` | 'descending' \| 'ascending' | `'descending'` | Governs the direction of blog post sorting. | diff --git a/website/versioned_docs/version-2.0.1/api/themes/theme-classic.md b/website/versioned_docs/version-2.0.1/api/themes/theme-classic.md index cba54b875aeb..15e4351bcffb 100644 --- a/website/versioned_docs/version-2.0.1/api/themes/theme-classic.md +++ b/website/versioned_docs/version-2.0.1/api/themes/theme-classic.md @@ -3,6 +3,8 @@ sidebar_position: 2 slug: /api/themes/@docusaurus/theme-classic --- +import APITable from '@site/src/components/APITable'; + # 📦 theme-classic The classic theme for Docusaurus. diff --git a/website/versioned_docs/version-2.1.0/api/plugins/plugin-content-blog.md b/website/versioned_docs/version-2.1.0/api/plugins/plugin-content-blog.md index 696b4102858d..dc7466f24fd7 100644 --- a/website/versioned_docs/version-2.1.0/api/plugins/plugin-content-blog.md +++ b/website/versioned_docs/version-2.1.0/api/plugins/plugin-content-blog.md @@ -68,7 +68,7 @@ Accepted fields: | `feedOptions` | _See below_ | `{type: ['rss', 'atom']}` | Blog feed. | | `feedOptions.type` | FeedType \| FeedType[] \| 'all' \| null | **Required** | Type of feed to be generated. Use `null` to disable generation. | | `feedOptions.title` | `string` | `siteConfig.title` | Title of the feed. | -| `feedOptions.description` | `string` | \`${siteConfig.title} Blog\` | Description of the feed. | +| `feedOptions.description` | `string` | \`$\{siteConfig.title} Blog\` | Description of the feed. | | `feedOptions.copyright` | `string` | `undefined` | Copyright message. | | `feedOptions.language` | `string` (See [documentation](http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes) for possible values) | `undefined` | Language metadata of the feed. | | `sortPosts` | 'descending' \| 'ascending' | `'descending'` | Governs the direction of blog post sorting. | diff --git a/website/versioned_docs/version-2.1.0/api/themes/theme-classic.md b/website/versioned_docs/version-2.1.0/api/themes/theme-classic.md index cba54b875aeb..15e4351bcffb 100644 --- a/website/versioned_docs/version-2.1.0/api/themes/theme-classic.md +++ b/website/versioned_docs/version-2.1.0/api/themes/theme-classic.md @@ -3,6 +3,8 @@ sidebar_position: 2 slug: /api/themes/@docusaurus/theme-classic --- +import APITable from '@site/src/components/APITable'; + # 📦 theme-classic The classic theme for Docusaurus. diff --git a/website/versioned_docs/version-2.2.0/api/plugins/plugin-content-blog.md b/website/versioned_docs/version-2.2.0/api/plugins/plugin-content-blog.md index 696b4102858d..dc7466f24fd7 100644 --- a/website/versioned_docs/version-2.2.0/api/plugins/plugin-content-blog.md +++ b/website/versioned_docs/version-2.2.0/api/plugins/plugin-content-blog.md @@ -68,7 +68,7 @@ Accepted fields: | `feedOptions` | _See below_ | `{type: ['rss', 'atom']}` | Blog feed. | | `feedOptions.type` | FeedType \| FeedType[] \| 'all' \| null | **Required** | Type of feed to be generated. Use `null` to disable generation. | | `feedOptions.title` | `string` | `siteConfig.title` | Title of the feed. | -| `feedOptions.description` | `string` | \`${siteConfig.title} Blog\` | Description of the feed. | +| `feedOptions.description` | `string` | \`$\{siteConfig.title} Blog\` | Description of the feed. | | `feedOptions.copyright` | `string` | `undefined` | Copyright message. | | `feedOptions.language` | `string` (See [documentation](http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes) for possible values) | `undefined` | Language metadata of the feed. | | `sortPosts` | 'descending' \| 'ascending' | `'descending'` | Governs the direction of blog post sorting. | diff --git a/website/versioned_docs/version-2.2.0/api/themes/theme-classic.md b/website/versioned_docs/version-2.2.0/api/themes/theme-classic.md index cba54b875aeb..15e4351bcffb 100644 --- a/website/versioned_docs/version-2.2.0/api/themes/theme-classic.md +++ b/website/versioned_docs/version-2.2.0/api/themes/theme-classic.md @@ -3,6 +3,8 @@ sidebar_position: 2 slug: /api/themes/@docusaurus/theme-classic --- +import APITable from '@site/src/components/APITable'; + # 📦 theme-classic The classic theme for Docusaurus. From 99ef4091cf80d6e99838e18bc4c5263a982b440b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Wed, 7 Dec 2022 18:25:41 +0100 Subject: [PATCH 064/155] ensure markdown config and throw error if missing --- packages/docusaurus-mdx-loader/src/loader.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index b00272e94fd5..8a49288212ea 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -162,6 +162,17 @@ function isDebugFile(filePath: string): boolean { return false; } +// TODO temporary, remove this after v3.1? +// Some plugin authors use our mdx-loader, despite it not being public API +// see https://github.com/facebook/docusaurus/issues/8298 +function ensureMarkdownConfig(reqOptions: Options) { + if (!reqOptions.markdownConfig) { + throw new Error( + 'Docusaurus v3+ requires MDX loader options.markdownConfig - plugin authors using the MDX loader should make sure to provide that option', + ); + } +} + export async function mdxLoader( this: LoaderContext, fileString: string, @@ -169,6 +180,7 @@ export async function mdxLoader( const callback = this.async(); const filePath = this.resourcePath; const reqOptions = this.getOptions(); + ensureMarkdownConfig(reqOptions); const {createProcessor} = await import('@mdx-js/mdx'); const {default: gfm} = await import('remark-gfm'); @@ -209,7 +221,7 @@ export async function mdxLoader( (await import('remark-directive')).default, ...getAdmonitionsPlugins(reqOptions.admonitions ?? false), ...DEFAULT_OPTIONS.remarkPlugins, - ...(reqOptions.markdownConfig?.mermaid ? [mermaid] : []), + ...(reqOptions.markdownConfig.mermaid ? [mermaid] : []), [ transformImage, { From d4642adc6dd99f7f364da2d858b9babcfc694e2c Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 15 Dec 2022 16:12:43 +0100 Subject: [PATCH 065/155] add admonitions in tabs test case --- ...downPageTests.md => markdownPageTests.mdx} | 44 ++++++++++++++++--- 1 file changed, 38 insertions(+), 6 deletions(-) rename website/_dogfooding/_pages tests/{markdownPageTests.md => markdownPageTests.mdx} (83%) diff --git a/website/_dogfooding/_pages tests/markdownPageTests.md b/website/_dogfooding/_pages tests/markdownPageTests.mdx similarity index 83% rename from website/_dogfooding/_pages tests/markdownPageTests.md rename to website/_dogfooding/_pages tests/markdownPageTests.mdx index 6ad2c07df2c2..11d44429fb02 100644 --- a/website/_dogfooding/_pages tests/markdownPageTests.md +++ b/website/_dogfooding/_pages tests/markdownPageTests.mdx @@ -34,7 +34,17 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -This is an apple 🍎This is an orange 🍊This is a banana 🍌 + + This is an apple 🍎 + This is an orange 🍊 + This is a banana 🍌 + ## Comments @@ -58,7 +68,7 @@ My comment ## Import code block from source code file -import MyComponent from "@site/src/pages/examples/\_myComponent" +import MyComponent from '@site/src/pages/examples/_myComponent'; import BrowserWindow from '@site/src/components/BrowserWindow'; @@ -74,7 +84,7 @@ import MyComponent from './myComponent'; - + @@ -88,9 +98,9 @@ import MyComponentSource from '!!raw-loader!./myComponent'; {MyComponentSource}; ``` -import CodeBlock from "@theme/CodeBlock" +import CodeBlock from '@theme/CodeBlock'; -import MyComponentSource from '!!raw-loader!@site/src/pages/examples/\_myComponent'; +import MyComponentSource from '!!raw-loader!@site/src/pages/examples/_myComponent'; @@ -276,4 +286,26 @@ hey ::::: -after admonition +::::tip[Use tabs in admonitions] + +:::info[Admonition nested] + +test + +::: + + + + +:::note[Admonition in tab] + +test + +::: + + + This is an orange 🍊 + This is a banana 🍌 + + +:::: From fbd8fa3e8eb3c69907e2ee6968fe5d6054ae8eae Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 15 Dec 2022 17:17:07 +0100 Subject: [PATCH 066/155] add ability to provide custom mdx format with frontMatter --- packages/docusaurus-mdx-loader/package.json | 1 + .../src/__tests__/frontMatter.test.ts | 93 +++++++++++++++++++ .../docusaurus-mdx-loader/src/frontMatter.ts | 29 ++++++ packages/docusaurus-mdx-loader/src/loader.ts | 12 +-- .../src/validationUtils.ts | 5 +- 5 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 packages/docusaurus-mdx-loader/src/__tests__/frontMatter.test.ts create mode 100644 packages/docusaurus-mdx-loader/src/frontMatter.ts diff --git a/packages/docusaurus-mdx-loader/package.json b/packages/docusaurus-mdx-loader/package.json index 12044e1de12c..577b6e22fab0 100644 --- a/packages/docusaurus-mdx-loader/package.json +++ b/packages/docusaurus-mdx-loader/package.json @@ -22,6 +22,7 @@ "@babel/traverse": "^7.19.0", "@docusaurus/logger": "^3.0.0-alpha.0", "@docusaurus/utils": "^3.0.0-alpha.0", + "@docusaurus/utils-validation": "^3.0.0-alpha.0", "@mdx-js/mdx": "^2.1.5", "escape-html": "^1.0.3", "estree-util-value-to-estree": "^2.1.0", diff --git a/packages/docusaurus-mdx-loader/src/__tests__/frontMatter.test.ts b/packages/docusaurus-mdx-loader/src/__tests__/frontMatter.test.ts new file mode 100644 index 000000000000..e344f236cead --- /dev/null +++ b/packages/docusaurus-mdx-loader/src/__tests__/frontMatter.test.ts @@ -0,0 +1,93 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import escapeStringRegexp from 'escape-string-regexp'; +import { + validateMDXFrontMatter, + DefaultMDXFrontMatter, + type MDXFrontMatter, +} from '../frontMatter'; + +function testField(params: { + prefix: string; + validFrontMatters: MDXFrontMatter[]; + convertibleFrontMatter?: [ + ConvertibleFrontMatter: {[key: string]: unknown}, + ConvertedFrontMatter: MDXFrontMatter, + ][]; + invalidFrontMatters?: [ + InvalidFrontMatter: {[key: string]: unknown}, + ErrorMessage: string, + ][]; +}) { + // eslint-disable-next-line jest/require-top-level-describe + test(`[${params.prefix}] accept valid values`, () => { + params.validFrontMatters.forEach((frontMatter) => { + expect(validateMDXFrontMatter(frontMatter)).toEqual(frontMatter); + }); + }); + + // eslint-disable-next-line jest/require-top-level-describe + test(`[${params.prefix}] convert valid values`, () => { + params.convertibleFrontMatter?.forEach( + ([convertibleFrontMatter, convertedFrontMatter]) => { + expect(validateMDXFrontMatter(convertibleFrontMatter)).toEqual( + convertedFrontMatter, + ); + }, + ); + }); + + // eslint-disable-next-line jest/require-top-level-describe + test(`[${params.prefix}] throw error for values`, () => { + params.invalidFrontMatters?.forEach(([frontMatter, message]) => { + try { + validateMDXFrontMatter(frontMatter); + throw new Error( + `MDX front matter is expected to be rejected, but was accepted successfully:\n ${JSON.stringify( + frontMatter, + null, + 2, + )}`, + ); + } catch (err) { + // eslint-disable-next-line jest/no-conditional-expect + expect((err as Error).message).toMatch( + new RegExp(escapeStringRegexp(message)), + ); + } + }); + }); +} + +describe('MDX front matter schema', () => { + it('accepts empty object', () => { + const frontMatter: Partial = {}; + expect(validateMDXFrontMatter(frontMatter)).toEqual(DefaultMDXFrontMatter); + }); + + it('accepts undefined object', () => { + expect(validateMDXFrontMatter(undefined)).toEqual(DefaultMDXFrontMatter); + }); + + it('rejects unknown field', () => { + const frontMatter = {abc: '1'}; + expect(() => + validateMDXFrontMatter(frontMatter), + ).toThrowErrorMatchingInlineSnapshot(`""abc" is not allowed"`); + }); +}); + +describe('validateDocFrontMatter format', () => { + testField({ + prefix: 'format', + validFrontMatters: [{format: 'md'}, {format: 'mdx'}], + invalidFrontMatters: [ + [{format: 'xdm'}, '"format" must be one of [md, mdx]'], + ], + }); +}); diff --git a/packages/docusaurus-mdx-loader/src/frontMatter.ts b/packages/docusaurus-mdx-loader/src/frontMatter.ts new file mode 100644 index 000000000000..05ef5f15e621 --- /dev/null +++ b/packages/docusaurus-mdx-loader/src/frontMatter.ts @@ -0,0 +1,29 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import { + JoiFrontMatter as Joi, + validateFrontMatter, +} from '@docusaurus/utils-validation'; + +export type MDXFrontMatter = { + format: 'md' | 'mdx'; +}; + +export const DefaultMDXFrontMatter: MDXFrontMatter = { + format: 'mdx', // TODO later => move to undefined (using file extension) +}; + +const MDXFrontMatterSchema = Joi.object({ + format: Joi.string().equal('md', 'mdx').default(DefaultMDXFrontMatter.format), +}).default(DefaultMDXFrontMatter); + +export function validateMDXFrontMatter(frontMatter: unknown): MDXFrontMatter { + return validateFrontMatter(frontMatter, MDXFrontMatterSchema, { + allowUnknown: false, + }); +} diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 8a49288212ea..e69119b2014e 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -15,15 +15,17 @@ import { } from '@docusaurus/utils'; import emoji from 'remark-emoji'; import stringifyObject from 'stringify-object'; +import {Simulate} from 'react-dom/test-utils'; import preprocessor from './preprocessor'; import headings from './remark/headings'; import toc from './remark/toc'; import transformImage from './remark/transformImage'; import transformLinks from './remark/transformLinks'; import mermaid from './remark/mermaid'; - import transformAdmonitions from './remark/admonitions'; import codeCompatPlugin from './remark/mdx1Compat/codeCompatPlugin'; +import {validateMDXFrontMatter} from './frontMatter'; + import type {MarkdownConfig} from '@docusaurus/types'; import type {LoaderContext} from 'webpack'; @@ -32,6 +34,7 @@ import type {AdmonitionOptions} from './remark/admonitions'; // @ts-expect-error: TODO import type {ProcessorOptions} from '@mdx-js/mdx'; +import load = Simulate.load; const { loaders: {inlineMarkdownImageFileLoader}, @@ -186,6 +189,7 @@ export async function mdxLoader( const {default: gfm} = await import('remark-gfm'); const {frontMatter, content: contentWithTitle} = parseFrontMatter(fileString); + const mdxFrontMatter = validateMDXFrontMatter(frontMatter.mdx); const {content: contentUnprocessed, contentTitle} = parseMarkdownContentTitle( contentWithTitle, @@ -256,14 +260,10 @@ export async function mdxLoader( ...reqOptions, remarkPlugins, rehypePlugins, - format: (frontMatter.format as any) ?? 'mdx', // TODO provide ability to use 'md' with frontMatter? + format: mdxFrontMatter.format, providerImportSource: '@mdx-js/react', }; - if (frontMatter.format) { - console.log('format', frontMatter.format); - } - // @ts-expect-error: TODO compilerCache.set(this.query, [createProcessor(options), options]); } diff --git a/packages/docusaurus-utils-validation/src/validationUtils.ts b/packages/docusaurus-utils-validation/src/validationUtils.ts index 5d87c1a5e8e4..6b3a891571fd 100644 --- a/packages/docusaurus-utils-validation/src/validationUtils.ts +++ b/packages/docusaurus-utils-validation/src/validationUtils.ts @@ -8,6 +8,7 @@ import logger from '@docusaurus/logger'; import Yaml from 'js-yaml'; import {PluginIdSchema} from './validationSchemas'; +import type {ValidationOptions} from 'joi'; import type Joi from './Joi'; /** Print warnings returned from Joi validation. */ @@ -77,13 +78,15 @@ export function normalizeThemeConfig( * Validate front matter with better error message */ export function validateFrontMatter( - frontMatter: {[key: string]: unknown}, + frontMatter: unknown, schema: Joi.ObjectSchema, + options?: ValidationOptions, ): T { const {value, error, warning} = schema.validate(frontMatter, { convert: true, allowUnknown: true, abortEarly: false, + ...options, }); printWarning(warning); From ce2f472e4b1314394086cc24c16d081bfe21861b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 15 Dec 2022 17:17:33 +0100 Subject: [PATCH 067/155] changelog: revert mdx2 changes + use format: 'md' --- CHANGELOG.md | 18 +++++++++--------- website/src/plugins/changelog/index.js | 2 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eeca8692b4b4..c63055d58c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -569,7 +569,7 @@ Bad npm publish, please use 2.0.1 - `create-docusaurus`, `docusaurus-theme-classic` - [#7176](https://github.com/facebook/docusaurus/pull/7176) refactor: customize code block line highlight color via CSS var ([@lex111](https://github.com/lex111)) - `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-types`, `docusaurus-utils-validation`, `docusaurus-utils` - - [#7117](https://github.com/facebook/docusaurus/pull/7117) refactor(content-blog,docs): unify handling of tags ([@Josh-Cena](https://github.com/Josh-Cena)) + - [#7117](https://github.com/facebook/docusaurus/pull/7117) refactor(content-{blog,docs}): unify handling of tags ([@Josh-Cena](https://github.com/Josh-Cena)) - `docusaurus-mdx-loader`, `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-plugin-content-pages`, `docusaurus-theme-classic`, `docusaurus-theme-live-codeblock` - [#7027](https://github.com/facebook/docusaurus/pull/7027) refactor(content-docs): deduplicate types, JSDoc for some APIs ([@Josh-Cena](https://github.com/Josh-Cena)) @@ -837,10 +837,10 @@ Bad npm publish, please use 2.0.1 - `docusaurus-theme-classic` - [#6989](https://github.com/facebook/docusaurus/pull/6989) refactor: extract MDX components ([@slorber](https://github.com/slorber)) - `docusaurus-module-type-aliases`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-search-algolia`, `docusaurus` - - [#6925](https://github.com/facebook/docusaurus/pull/6925) refactor(theme-classic,common): refactor site/page/search metadata + apply className on html element ([@slorber](https://github.com/slorber)) + - [#6925](https://github.com/facebook/docusaurus/pull/6925) refactor(theme-{classic,common}): refactor site/page/search metadata + apply className on html element ([@slorber](https://github.com/slorber)) - `docusaurus-theme-classic`, `docusaurus-theme-common` - - [#6895](https://github.com/facebook/docusaurus/pull/6895) refactor(theme-(classic,common): split navbar into smaller components + cleanup + swizzle config ([@slorber](https://github.com/slorber)) - - [#6930](https://github.com/facebook/docusaurus/pull/6930) refactor(theme-classic,common): refactor ColorModeToggle + useColorMode() hook ([@lex111](https://github.com/lex111)) + - [#6895](https://github.com/facebook/docusaurus/pull/6895) refactor(theme-{classic,common}): split navbar into smaller components + cleanup + swizzle config ([@slorber](https://github.com/slorber)) + - [#6930](https://github.com/facebook/docusaurus/pull/6930) refactor(theme-{classic,common}): refactor ColorModeToggle + useColorMode() hook ([@lex111](https://github.com/lex111)) #### :bug: Bug Fix @@ -895,10 +895,10 @@ Bad npm publish, please use 2.0.1 - `docusaurus-plugin-content-blog`, `docusaurus-plugin-content-docs`, `docusaurus-utils` - [#6937](https://github.com/facebook/docusaurus/pull/6937) fix(content-docs): warn when files are not tracked ([@felipecrs](https://github.com/felipecrs)) - `docusaurus-module-type-aliases`, `docusaurus-theme-classic`, `docusaurus-theme-common`, `docusaurus-theme-search-algolia`, `docusaurus` - - [#6925](https://github.com/facebook/docusaurus/pull/6925) refactor(theme-(classic,common)): refactor site/page/search metadata + apply className on html element ([@slorber](https://github.com/slorber)) + - [#6925](https://github.com/facebook/docusaurus/pull/6925) refactor(theme-{classic,common}): refactor site/page/search metadata + apply className on html element ([@slorber](https://github.com/slorber)) - `docusaurus-theme-classic`, `docusaurus-theme-common` - - [#6895](https://github.com/facebook/docusaurus/pull/6895) refactor(theme-(classic,common)): split navbar into smaller components + cleanup + swizzle config ([@slorber](https://github.com/slorber)) - - [#6930](https://github.com/facebook/docusaurus/pull/6930) refactor(theme-(classic,common)): refactor ColorModeToggle + useColorMode() hook ([@lex111](https://github.com/lex111)) + - [#6895](https://github.com/facebook/docusaurus/pull/6895) refactor(theme-{classic,common}): split navbar into smaller components + cleanup + swizzle config ([@slorber](https://github.com/slorber)) + - [#6930](https://github.com/facebook/docusaurus/pull/6930) refactor(theme-{classic,common}): refactor ColorModeToggle + useColorMode() hook ([@lex111](https://github.com/lex111)) - [#6894](https://github.com/facebook/docusaurus/pull/6894) refactor(theme-classic): split theme footer into smaller components + swizzle config ([@slorber](https://github.com/slorber)) - `docusaurus-types`, `docusaurus` - [#6929](https://github.com/facebook/docusaurus/pull/6929) refactor(core): minor routes type improvement ([@Josh-Cena](https://github.com/Josh-Cena)) @@ -2426,7 +2426,7 @@ Bad npm publish, use beta.13 instead - [#5460](https://github.com/facebook/docusaurus/pull/5460) feat: infima 33 + navbar-sidebar close button ([@slorber](https://github.com/slorber)) - [#5442](https://github.com/facebook/docusaurus/pull/5442) feat(theme-classic): allow passing tab label and default value through TabItem ([@Josh-Cena](https://github.com/Josh-Cena)) - `docusaurus-plugin-content-docs`, `docusaurus-theme-classic` - - [#5454](https://github.com/facebook/docusaurus/pull/5454) feat: new docs options: versions.(badge,classNameà ([@slorber](https://github.com/slorber)) + - [#5454](https://github.com/facebook/docusaurus/pull/5454) feat: new docs options: versions.{badge,className} ([@slorber](https://github.com/slorber)) #### :bug: Bug Fix @@ -4589,7 +4589,7 @@ Failed release #### :rocket: New Feature - `docusaurus-plugin-content-docs`, `docusaurus-theme-classic` - - [#3357](https://github.com/facebook/docusaurus/pull/3357) feat(v2): docs version configuration: lastVersion, version.(path,label) ([@slorber](https://github.com/slorber)) + - [#3357](https://github.com/facebook/docusaurus/pull/3357) feat(v2): docs version configuration: lastVersion, version.{path,label} ([@slorber](https://github.com/slorber)) - [#3328](https://github.com/facebook/docusaurus/pull/3328) feat(v2): Provide docs plugin theme typing ([@SamChou19815](https://github.com/SamChou19815)) - `docusaurus-theme-classic` - [#3356](https://github.com/facebook/docusaurus/pull/3356) feat(v2): Provide type definitions for remaining theme-classic components ([@SamChou19815](https://github.com/SamChou19815)) diff --git a/website/src/plugins/changelog/index.js b/website/src/plugins/changelog/index.js index 0b686271694f..0ac153f0dd43 100644 --- a/website/src/plugins/changelog/index.js +++ b/website/src/plugins/changelog/index.js @@ -67,6 +67,8 @@ function processSection(section) { return { title: title.replace(/ \(.*\)/, ''), content: `--- +mdx: + format: mdx date: ${`${date}T${hour}:00`}${ authors ? ` From 26e6d9ddbe8e597d80c6d8fcbb561c4dd1b48115 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 15 Dec 2022 17:17:59 +0100 Subject: [PATCH 068/155] changelog: use format: 'md' --- website/src/plugins/changelog/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/plugins/changelog/index.js b/website/src/plugins/changelog/index.js index 0ac153f0dd43..c0b294fc1186 100644 --- a/website/src/plugins/changelog/index.js +++ b/website/src/plugins/changelog/index.js @@ -68,7 +68,7 @@ function processSection(section) { title: title.replace(/ \(.*\)/, ''), content: `--- mdx: - format: mdx + format: md date: ${`${date}T${hour}:00`}${ authors ? ` From d29c50ab911bf65e534b78870537bc263fd4a156 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 15 Dec 2022 18:39:07 +0100 Subject: [PATCH 069/155] fix extractMDXAdmonitionTitle bug --- .../src/utils/admonitionUtils.tsx | 11 ++++------- .../_dogfooding/_pages tests/markdownPageTests.mdx | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/docusaurus-theme-common/src/utils/admonitionUtils.tsx b/packages/docusaurus-theme-common/src/utils/admonitionUtils.tsx index cb5ab70f45c8..f9a979deaa61 100644 --- a/packages/docusaurus-theme-common/src/utils/admonitionUtils.tsx +++ b/packages/docusaurus-theme-common/src/utils/admonitionUtils.tsx @@ -14,16 +14,13 @@ function extractMDXAdmonitionTitle(children: ReactNode): { rest: ReactNode; } { const items = React.Children.toArray(children); - const mdxAdmonitionTitleChildren = items.find( - (item) => - React.isValidElement(item) && - (item.props as {mdxType: string} | null)?.mdxType === - 'mdxAdmonitionTitle', + const mdxAdmonitionTitleWrapper = items.find( + (item) => React.isValidElement(item) && item.type === 'mdxAdmonitionTitle', ) as JSX.Element | undefined; - const rest = items.filter((item) => item !== mdxAdmonitionTitleChildren); + const rest = items.filter((item) => item !== mdxAdmonitionTitleWrapper); - const mdxAdmonitionTitle = mdxAdmonitionTitleChildren?.props.children; + const mdxAdmonitionTitle = mdxAdmonitionTitleWrapper?.props.children; return { mdxAdmonitionTitle, diff --git a/website/_dogfooding/_pages tests/markdownPageTests.mdx b/website/_dogfooding/_pages tests/markdownPageTests.mdx index 11d44429fb02..9508a1eaf68e 100644 --- a/website/_dogfooding/_pages tests/markdownPageTests.mdx +++ b/website/_dogfooding/_pages tests/markdownPageTests.mdx @@ -248,13 +248,13 @@ Emojis in this text will be replaced with [remark-emoji](https://www.npmjs.com/p ## Admonitions -:::caution Interpolated `title` with a +:::caution Interpolated `title` with a (old syntax) Admonition body ::: -:::caution[Interpolated `title` with a ] +:::caution[Interpolated `title` with a (directive label syntax)] Admonition body From 274c3b89fd846a0359802b8fb2739955661f37e6 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 15 Dec 2022 19:34:27 +0100 Subject: [PATCH 070/155] fix details/summary --- packages/docusaurus-mdx-loader/src/loader.ts | 2 + .../remark/details/__tests__/index.test.ts | 76 +++++++++++++++++++ .../src/remark/details/index.ts | 24 ++++++ .../src/theme/MDXComponents/Details.tsx | 3 +- .../src/theme/MDXComponents/index.tsx | 1 + .../src/components/Details/styles.module.css | 6 +- .../markdown-features-intro.mdx | 8 +- 7 files changed, 111 insertions(+), 9 deletions(-) create mode 100644 packages/docusaurus-mdx-loader/src/remark/details/__tests__/index.test.ts create mode 100644 packages/docusaurus-mdx-loader/src/remark/details/index.ts diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index e69119b2014e..7ab7a28136ac 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -21,6 +21,7 @@ import headings from './remark/headings'; import toc from './remark/toc'; import transformImage from './remark/transformImage'; import transformLinks from './remark/transformLinks'; +import details from './remark/details'; import mermaid from './remark/mermaid'; import transformAdmonitions from './remark/admonitions'; import codeCompatPlugin from './remark/mdx1Compat/codeCompatPlugin'; @@ -225,6 +226,7 @@ export async function mdxLoader( (await import('remark-directive')).default, ...getAdmonitionsPlugins(reqOptions.admonitions ?? false), ...DEFAULT_OPTIONS.remarkPlugins, + details, ...(reqOptions.markdownConfig.mermaid ? [mermaid] : []), [ transformImage, diff --git a/packages/docusaurus-mdx-loader/src/remark/details/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/details/__tests__/index.test.ts new file mode 100644 index 000000000000..5d429cbad032 --- /dev/null +++ b/packages/docusaurus-mdx-loader/src/remark/details/__tests__/index.test.ts @@ -0,0 +1,76 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import details from '..'; + +async function process(content: string) { + const {remark} = await import('remark'); + + const {default: mdx} = await import('remark-mdx'); + + const result = await remark().use(mdx).use(details).process(content); + + return result.value; +} + +describe('details remark plugin', () => { + it("does nothing if there's no details", async () => { + const input = `# Heading 1 + +Some content +`; + const result = await process(input); + expect(result).toEqual(result); + }); + + it('works for basic mermaid code blocks', async () => { + const input = `# Details element example + +
+ Toggle me! +
+
This is the detailed content
+
+
+ + Nested toggle! Some surprise inside... + +
+ 😲😲😲😲😲 +
+
+
+
`; + + const result = await process(input); + + expect(result).toMatchInlineSnapshot(` + "# Details element example + +
+ Toggle me! + +
+
This is the detailed content
+ +
+ +
+ + Nested toggle! Some surprise inside... + + +
+ 😲😲😲😲😲 +
+
+
+
+ " + `); + }); +}); diff --git a/packages/docusaurus-mdx-loader/src/remark/details/index.ts b/packages/docusaurus-mdx-loader/src/remark/details/index.ts new file mode 100644 index 000000000000..628358c9bca1 --- /dev/null +++ b/packages/docusaurus-mdx-loader/src/remark/details/index.ts @@ -0,0 +1,24 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import visit from 'unist-util-visit'; +import type {Transformer} from 'unified'; + +// @ts-expect-error: ES support... +import type {MdxJsxFlowElement} from 'mdast-util-mdx'; + +// Transform
to
+// MDX 2 doesn't allow to substitute html elements with the provider anymore +export default function plugin(): Transformer { + return (root) => { + visit(root, 'mdxJsxFlowElement', (node: MdxJsxFlowElement) => { + if (node.name === 'details') { + node.name = 'Details'; + } + }); + }; +} diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Details.tsx b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Details.tsx index 08ddaf1a1fee..9b90d4cafb2c 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Details.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Details.tsx @@ -15,8 +15,7 @@ export default function MDXDetails(props: Props): JSX.Element { // Details theme component const summary = items.find( (item): item is ReactElement> => - React.isValidElement(item) && - (item.props as {mdxType: string} | null)?.mdxType === 'summary', + React.isValidElement(item) && item.type === 'summary', ); const children = <>{items.filter((item) => item !== summary)}; diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx b/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx index 13931951950a..3b436669d59f 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx @@ -25,6 +25,7 @@ const MDXComponents: MDXComponentsObject = { a: MDXA, pre: MDXPre, details: MDXDetails, + Details: MDXDetails, ul: MDXUl, img: MDXImg, h1: (props) => , diff --git a/packages/docusaurus-theme-common/src/components/Details/styles.module.css b/packages/docusaurus-theme-common/src/components/Details/styles.module.css index b5c1400cec74..11863a0f3dbe 100644 --- a/packages/docusaurus-theme-common/src/components/Details/styles.module.css +++ b/packages/docusaurus-theme-common/src/components/Details/styles.module.css @@ -57,6 +57,10 @@ CSS variables, meant to be overridden by final theme padding-top: 1rem; } -.collapsibleContent > *:last-child { +.collapsibleContent p:last-child { + margin-bottom: 0; +} + +.details > summary > p:last-child { margin-bottom: 0; } diff --git a/website/docs/guides/markdown-features/markdown-features-intro.mdx b/website/docs/guides/markdown-features/markdown-features-intro.mdx index 7b56a3765057..30212e50042f 100644 --- a/website/docs/guides/markdown-features/markdown-features-intro.mdx +++ b/website/docs/guides/markdown-features/markdown-features-intro.mdx @@ -106,9 +106,7 @@ Markdown can embed HTML elements, and [`details`](https://developer.mozilla.org/ Nested toggle! Some surprise inside... -
- 😲😲😲😲😲 -
+
😲😲😲😲😲
@@ -128,9 +126,7 @@ Markdown can embed HTML elements, and [`details`](https://developer.mozilla.org/ Nested toggle! Some surprise inside... -
- 😲😲😲😲😲 -
+
😲😲😲😲😲
From 59448c1444963d0a1e0ffeaa489cfe88fd2c230d Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 16 Dec 2022 17:13:03 +0100 Subject: [PATCH 071/155] add deps --- packages/docusaurus-mdx-loader/package.json | 1 + packages/docusaurus-mdx-loader/src/remark/utils/index.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/docusaurus-mdx-loader/package.json b/packages/docusaurus-mdx-loader/package.json index 577b6e22fab0..f079cb6155b5 100644 --- a/packages/docusaurus-mdx-loader/package.json +++ b/packages/docusaurus-mdx-loader/package.json @@ -31,6 +31,7 @@ "hastscript": "^7.1.0", "image-size": "^1.0.2", "mdast-util-to-string": "^3.0.0", + "mdast-util-mdx": "^2.0.0", "remark-gfm": "^3.0.1", "remark-directive": "^2.0.1", "remark-emoji": "^2.2.0", diff --git a/packages/docusaurus-mdx-loader/src/remark/utils/index.ts b/packages/docusaurus-mdx-loader/src/remark/utils/index.ts index 6f907ba8e4df..81fb1f0baf36 100644 --- a/packages/docusaurus-mdx-loader/src/remark/utils/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/utils/index.ts @@ -23,10 +23,10 @@ export function toValue( toString: (param: unknown) => string, // TODO weird but works ): string { switch (node.type) { - // @ts-expect-error: todo types - case 'mdxJsxTextElement': - const tag = (node as any).name; + case 'mdxJsxTextElement': { + const tag = node.name; return `<${tag}>${stringifyContent(node, toString)}`; + } case 'text': return escapeHtml(node.value); case 'heading': From 8c2b93d63bf3efda28a87789a8dd55fedf88fbd9 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 16 Dec 2022 17:36:36 +0100 Subject: [PATCH 072/155] Fix support --- packages/docusaurus-mdx-loader/src/loader.ts | 2 + .../remark/details/__tests__/index.test.ts | 2 +- .../src/remark/head/__tests__/index.test.ts | 76 +++++++++++++++++++ .../src/remark/head/index.ts | 24 ++++++ .../src/theme-classic.d.ts | 14 +--- .../src/theme/MDXComponents/Head.tsx | 29 ------- .../src/theme/MDXComponents/index.tsx | 7 +- 7 files changed, 109 insertions(+), 45 deletions(-) create mode 100644 packages/docusaurus-mdx-loader/src/remark/head/__tests__/index.test.ts create mode 100644 packages/docusaurus-mdx-loader/src/remark/head/index.ts delete mode 100644 packages/docusaurus-theme-classic/src/theme/MDXComponents/Head.tsx diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 7ab7a28136ac..4553b7464e2e 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -22,6 +22,7 @@ import toc from './remark/toc'; import transformImage from './remark/transformImage'; import transformLinks from './remark/transformLinks'; import details from './remark/details'; +import head from './remark/head'; import mermaid from './remark/mermaid'; import transformAdmonitions from './remark/admonitions'; import codeCompatPlugin from './remark/mdx1Compat/codeCompatPlugin'; @@ -227,6 +228,7 @@ export async function mdxLoader( ...getAdmonitionsPlugins(reqOptions.admonitions ?? false), ...DEFAULT_OPTIONS.remarkPlugins, details, + head, ...(reqOptions.markdownConfig.mermaid ? [mermaid] : []), [ transformImage, diff --git a/packages/docusaurus-mdx-loader/src/remark/details/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/details/__tests__/index.test.ts index 5d429cbad032..7badfeda361c 100644 --- a/packages/docusaurus-mdx-loader/src/remark/details/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/details/__tests__/index.test.ts @@ -27,7 +27,7 @@ Some content expect(result).toEqual(result); }); - it('works for basic mermaid code blocks', async () => { + it('can convert details', async () => { const input = `# Details element example
diff --git a/packages/docusaurus-mdx-loader/src/remark/head/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/head/__tests__/index.test.ts new file mode 100644 index 000000000000..5bf4450525dc --- /dev/null +++ b/packages/docusaurus-mdx-loader/src/remark/head/__tests__/index.test.ts @@ -0,0 +1,76 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import head from '..'; + +async function process(content: string) { + const {remark} = await import('remark'); + + const {default: mdx} = await import('remark-mdx'); + + const result = await remark().use(mdx).use(head).process(content); + + return result.value; +} + +describe('head remark plugin', () => { + it("does nothing if there's no details", async () => { + const input = `# Heading + + + + + Head Metadata customized title! + + + + + +Some content +`; + const result = await process(input); + expect(result).toEqual(result); + }); + + it('can convert head', async () => { + const input = `# Heading + + + + + Head Metadata customized title! + + + + + +Some content;`; + + const result = await process(input); + + expect(result).toMatchInlineSnapshot(` + "# Heading + + + + + + + Head Metadata customized title! + + + + + + + + + Some content; + " + `); + }); +}); diff --git a/packages/docusaurus-mdx-loader/src/remark/head/index.ts b/packages/docusaurus-mdx-loader/src/remark/head/index.ts new file mode 100644 index 000000000000..109a9c129953 --- /dev/null +++ b/packages/docusaurus-mdx-loader/src/remark/head/index.ts @@ -0,0 +1,24 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import visit from 'unist-util-visit'; +import type {Transformer} from 'unified'; + +// @ts-expect-error: ES support... +import type {MdxJsxFlowElement} from 'mdast-util-mdx'; + +// Transform to +// MDX 2 doesn't allow to substitute html elements with the provider anymore +export default function plugin(): Transformer { + return (root) => { + visit(root, 'mdxJsxFlowElement', (node: MdxJsxFlowElement) => { + if (node.name === 'head') { + node.name = 'Head'; + } + }); + }; +} diff --git a/packages/docusaurus-theme-classic/src/theme-classic.d.ts b/packages/docusaurus-theme-classic/src/theme-classic.d.ts index 2a3588ef3791..cac0afcb2ab3 100644 --- a/packages/docusaurus-theme-classic/src/theme-classic.d.ts +++ b/packages/docusaurus-theme-classic/src/theme-classic.d.ts @@ -861,14 +861,6 @@ declare module '@theme/MDXComponents/Img' { export default function MDXImg(props: Props): JSX.Element; } -declare module '@theme/MDXComponents/Head' { - import type {ComponentProps} from 'react'; - - export interface Props extends ComponentProps<'head'> {} - - export default function MDXHead(props: Props): JSX.Element; -} - declare module '@theme/MDXComponents/Heading' { import type {ComponentProps} from 'react'; import type Heading from '@theme/Heading'; @@ -889,7 +881,6 @@ declare module '@theme/MDXComponents/Pre' { declare module '@theme/MDXComponents' { import type {ComponentType, ComponentProps} from 'react'; - import type MDXHead from '@theme/MDXComponents/Head'; import type MDXCode from '@theme/MDXComponents/Code'; import type MDXA from '@theme/MDXComponents/A'; import type MDXPre from '@theme/MDXComponents/Pre'; @@ -898,13 +889,14 @@ declare module '@theme/MDXComponents' { import type MDXImg from '@theme/MDXComponents/Img'; import type Admonition from '@theme/Admonition'; import type Mermaid from '@theme/Mermaid'; + import type Head from '@docusaurus/Head'; export type MDXComponentsObject = { - readonly head: typeof MDXHead; + readonly Head: typeof Head; + readonly Details: typeof MDXDetails; readonly code: typeof MDXCode; readonly a: typeof MDXA; readonly pre: typeof MDXPre; - readonly details: typeof MDXDetails; readonly ul: typeof MDXUl; readonly img: typeof MDXImg; readonly h1: (props: ComponentProps<'h1'>) => JSX.Element; diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Head.tsx b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Head.tsx deleted file mode 100644 index 3b8924c0ed6d..000000000000 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Head.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import React, {type ReactElement} from 'react'; -import Head, {type Props as HeadProps} from '@docusaurus/Head'; -import type {Props} from '@theme/MDXComponents/Head'; - -// MDX elements are wrapped through the MDX pragma. In some cases (notably usage -// with Head/Helmet) we need to unwrap those elements. -function unwrapMDXElement( - element: ReactElement<{mdxType?: string; originalType?: string} | undefined>, -) { - if (element.props?.mdxType && element.props.originalType) { - const {mdxType, originalType, ...newProps} = element.props; - return React.createElement(element.props.originalType, newProps); - } - return element; -} - -export default function MDXHead(props: Props): JSX.Element { - const unwrappedChildren = React.Children.map(props.children, (child) => - React.isValidElement(child) ? unwrapMDXElement(child) : child, - ); - return {unwrappedChildren}; -} diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx b/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx index 3b436669d59f..777ddb708b6b 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXComponents/index.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import MDXHead from '@theme/MDXComponents/Head'; +import Head from '@docusaurus/Head'; import MDXCode from '@theme/MDXComponents/Code'; import MDXA from '@theme/MDXComponents/A'; import MDXPre from '@theme/MDXComponents/Pre'; @@ -20,12 +20,11 @@ import Mermaid from '@theme/Mermaid'; import type {MDXComponentsObject} from '@theme/MDXComponents'; const MDXComponents: MDXComponentsObject = { - head: MDXHead, + Head, + Details: MDXDetails, code: MDXCode, a: MDXA, pre: MDXPre, - details: MDXDetails, - Details: MDXDetails, ul: MDXUl, img: MDXImg, h1: (props) => , From 599ecd454c96a2a7f0ad7fffd56a02ca629b9fc0 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Wed, 21 Dec 2022 19:15:07 +0100 Subject: [PATCH 073/155] update truncate marker regexp --- packages/docusaurus-plugin-content-blog/src/options.ts | 2 +- website/blog/2022-08-01-announcing-docusaurus-2.0/index.mdx | 2 +- website/blog/releases/2.2/index.mdx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/docusaurus-plugin-content-blog/src/options.ts b/packages/docusaurus-plugin-content-blog/src/options.ts index 804169f73392..1ba778841555 100644 --- a/packages/docusaurus-plugin-content-blog/src/options.ts +++ b/packages/docusaurus-plugin-content-blog/src/options.ts @@ -26,7 +26,7 @@ export const DEFAULT_OPTIONS: PluginOptions = { beforeDefaultRehypePlugins: [], beforeDefaultRemarkPlugins: [], admonitions: true, - truncateMarker: //, + truncateMarker: /|\{\/\*\s*truncate\s*\*\/\}/, rehypePlugins: [], remarkPlugins: [], showReadingTime: true, diff --git a/website/blog/2022-08-01-announcing-docusaurus-2.0/index.mdx b/website/blog/2022-08-01-announcing-docusaurus-2.0/index.mdx index ff246238fa80..2cf983bdb2c1 100644 --- a/website/blog/2022-08-01-announcing-docusaurus-2.0/index.mdx +++ b/website/blog/2022-08-01-announcing-docusaurus-2.0/index.mdx @@ -32,7 +32,7 @@ After **4 years of work, [75 alphas](https://github.com/facebook/docusaurus/rele ![social-card image](./img/social-card.png) - +{/* truncate */} :::info We are on [ProductHunt](https://www.producthunt.com/posts/docusaurus-2-0) and [Hacker News](https://news.ycombinator.com/item?id=32303052)! diff --git a/website/blog/releases/2.2/index.mdx b/website/blog/releases/2.2/index.mdx index ccae084d6590..f1ec204d6442 100644 --- a/website/blog/releases/2.2/index.mdx +++ b/website/blog/releases/2.2/index.mdx @@ -12,7 +12,7 @@ The upgrade should be easy: as explained in our [release process documentation]( ![Docusaurus 2.2 social card](./img/social-card.png) - +{/* truncate */} ## Highlights From e6d06ccd3de4a7c04bf5b479f56d3be7fc7f9f50 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 5 Jan 2023 19:03:32 +0100 Subject: [PATCH 074/155] fix merge issue --- website/docs/api/misc/eslint-plugin/no-html-links.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/api/misc/eslint-plugin/no-html-links.mdx b/website/docs/api/misc/eslint-plugin/no-html-links.mdx index 8ea552c0d280..fbf9b0658556 100644 --- a/website/docs/api/misc/eslint-plugin/no-html-links.mdx +++ b/website/docs/api/misc/eslint-plugin/no-html-links.mdx @@ -4,6 +4,8 @@ slug: /api/misc/@docusaurus/eslint-plugin/no-html-links # no-html-links +import APITable from '@site/src/components/APITable'; + Ensure that the Docusaurus [``](../../../docusaurus-core.mdx#link) component is used instead of `` tags. The `` component has prefetching and preloading built-in. It also does build-time broken link detection, and helps Docusaurus understand your site's structure better. From 2703af735f01315f632cf58bb2ae72f21d82d20e Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 5 Jan 2023 19:22:31 +0100 Subject: [PATCH 075/155] fix after refactor --- .../src/theme/Tabs/index.tsx | 6 ++-- .../docusaurus-theme-common/src/internal.ts | 2 +- .../src/utils/tabsUtils.tsx | 32 ++++++++++--------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/Tabs/index.tsx b/packages/docusaurus-theme-classic/src/theme/Tabs/index.tsx index 59103c8d0714..55173684f55d 100644 --- a/packages/docusaurus-theme-classic/src/theme/Tabs/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/Tabs/index.tsx @@ -10,6 +10,7 @@ import clsx from 'clsx'; import { useScrollPositionBlocker, useTabs, + sanitizeTabsChildren, } from '@docusaurus/theme-common/internal'; import useIsBrowser from '@docusaurus/useIsBrowser'; import type {Props} from '@theme/Tabs'; @@ -148,7 +149,8 @@ export default function Tabs(props: Props): JSX.Element { // Remount tabs after hydration // Temporary fix for https://github.com/facebook/docusaurus/issues/5653 key={String(isBrowser)} - {...props} - /> + {...props}> + {sanitizeTabsChildren(props.children)} + ); } diff --git a/packages/docusaurus-theme-common/src/internal.ts b/packages/docusaurus-theme-common/src/internal.ts index 4298d3e985c9..f86d8b0d0545 100644 --- a/packages/docusaurus-theme-common/src/internal.ts +++ b/packages/docusaurus-theme-common/src/internal.ts @@ -42,7 +42,7 @@ export { useAnnouncementBar, } from './contexts/announcementBar'; -export {useTabs} from './utils/tabsUtils'; +export {useTabs, sanitizeTabsChildren} from './utils/tabsUtils'; export type {TabValue, TabsProps, TabItemProps} from './utils/tabsUtils'; export {useNavbarMobileSidebar} from './contexts/navbarMobileSidebar'; diff --git a/packages/docusaurus-theme-common/src/utils/tabsUtils.tsx b/packages/docusaurus-theme-common/src/utils/tabsUtils.tsx index 403e023ef45d..4ab1cc4aff7c 100644 --- a/packages/docusaurus-theme-common/src/utils/tabsUtils.tsx +++ b/packages/docusaurus-theme-common/src/utils/tabsUtils.tsx @@ -58,24 +58,26 @@ function isTabItem( return 'value' in comp.props; } -function ensureValidChildren(children: TabsProps['children']) { - return React.Children.map(children, (child) => { - if (isValidElement(child) && isTabItem(child)) { - return child; - } - // child.type.name will give non-sensical values in prod because of - // minification, but we assume it won't throw in prod. - throw new Error( - `Docusaurus error: Bad child <${ - // @ts-expect-error: guarding against unexpected cases - typeof child.type === 'string' ? child.type : child.type.name - }>: all children of the component should be , and every should have a unique "value" prop.`, - ); - }); +export function sanitizeTabsChildren(children: TabsProps['children']) { + return React.Children.toArray(children) + .filter((child) => child !== '\n') + .map((child) => { + if (isValidElement(child) && isTabItem(child)) { + return child; + } + // child.type.name will give non-sensical values in prod because of + // minification, but we assume it won't throw in prod. + throw new Error( + `Docusaurus error: Bad child <${ + // @ts-expect-error: guarding against unexpected cases + typeof child.type === 'string' ? child.type : child.type.name + }>: all children of the component should be , and every should have a unique "value" prop.`, + ); + }); } function extractChildrenTabValues(children: TabsProps['children']): TabValue[] { - return ensureValidChildren(children).map( + return sanitizeTabsChildren(children).map( ({props: {value, label, attributes, default: isDefault}}) => ({ value, label, From 2b1a1cf985da8a946a45645a8790d02a6c3a3074 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 5 Jan 2023 19:32:09 +0100 Subject: [PATCH 076/155] rename markdown test page --- website/_dogfooding/_pages tests/index.mdx | 6 +++- ...wnPageTests.mdx => markdown-tests-mdx.mdx} | 36 ++++++++++++++++++- .../_pages tests/markdown-tests.mdx | 33 ----------------- 3 files changed, 40 insertions(+), 35 deletions(-) rename website/_dogfooding/_pages tests/{markdownPageTests.mdx => markdown-tests-mdx.mdx} (83%) delete mode 100644 website/_dogfooding/_pages tests/markdown-tests.mdx diff --git a/website/_dogfooding/_pages tests/index.mdx b/website/_dogfooding/_pages tests/index.mdx index d3986f1ca47e..9cfb6a0834dd 100644 --- a/website/_dogfooding/_pages tests/index.mdx +++ b/website/_dogfooding/_pages tests/index.mdx @@ -18,6 +18,11 @@ import Readme from "../README.mdx" ``` +### Markdown tests + +- [Markdown tests MDX](/tests/pages/markdown-tests-mdx) +- [Markdown tests MD](/tests/pages/markdown-tests-md) + ### Other tests - [Code block tests](/tests/pages/code-block-tests) @@ -25,7 +30,6 @@ import Readme from "../README.mdx" - [Error boundary tests](/tests/pages/error-boundary-tests) - [Hydration tests](/tests/pages/hydration-tests) - [Asset linking tests](/tests/pages/markdown-tests) -- [General Markdown tests](/tests/pages/markdownPageTests) - [TOC tests](/tests/pages/page-toc-tests) - [Diagram tests](/tests/pages/diagrams) - [Tabs tests](/tests/pages/tabs-tests) diff --git a/website/_dogfooding/_pages tests/markdownPageTests.mdx b/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx similarity index 83% rename from website/_dogfooding/_pages tests/markdownPageTests.mdx rename to website/_dogfooding/_pages tests/markdown-tests-mdx.mdx index 9508a1eaf68e..0d7f148c3ad9 100644 --- a/website/_dogfooding/_pages tests/markdownPageTests.mdx +++ b/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx @@ -4,7 +4,7 @@ description: Markdown Page tests description wrapperClassName: docusaurus-markdown-example --- -# Markdown page tests +# Markdown .mdx tests This is a page generated from Markdown to illustrate the Markdown page feature and test some edge cases. @@ -309,3 +309,37 @@ test :::: + +## Linking + +This is a test page to see if Docusaurus Markdown features are working properly + +### Linking to assets + +See [#3337](https://github.com/facebook/docusaurus/issues/3337) + +- [/someFile.pdf](/someFile.pdf) + +- [/someFile.xyz](/someFile.xyz) + +- [@site/\_dogfooding/\_asset-tests/someFile.pdf](@site/_dogfooding/_asset-tests/someFile.pdf) + +- [@site/\_dogfooding/\_asset-tests/someFile.xyz](@site/_dogfooding/_asset-tests/someFile.xyz) + +### Linking to non-SPA page hosted within website + +See [#3309](https://github.com/facebook/docusaurus/issues/3309) + +- [pathname:///dogfooding/javadoc](pathname:///dogfooding/javadoc) + +- [pathname:///dogfooding/javadoc/index.html](pathname:///dogfooding/javadoc/index.html) + +- [pathname://../dogfooding/javadoc](pathname://../dogfooding/javadoc) + +- [pathname://../dogfooding/javadoc/index.html](pathname://../dogfooding/javadoc/index.html) + +### Linking to JSON + +- [./script.js](./_script.js) + +- [./data.json](./data.json) diff --git a/website/_dogfooding/_pages tests/markdown-tests.mdx b/website/_dogfooding/_pages tests/markdown-tests.mdx deleted file mode 100644 index 48420cb718de..000000000000 --- a/website/_dogfooding/_pages tests/markdown-tests.mdx +++ /dev/null @@ -1,33 +0,0 @@ -# Markdown tests - -This is a test page to see if Docusaurus Markdown features are working properly - -## Linking to assets - -See [#3337](https://github.com/facebook/docusaurus/issues/3337) - -- [/someFile.pdf](/someFile.pdf) - -- [/someFile.xyz](/someFile.xyz) - -- [@site/\_dogfooding/\_asset-tests/someFile.pdf](@site/_dogfooding/_asset-tests/someFile.pdf) - -- [@site/\_dogfooding/\_asset-tests/someFile.xyz](@site/_dogfooding/_asset-tests/someFile.xyz) - -## Linking to non-SPA page hosted within website - -See [#3309](https://github.com/facebook/docusaurus/issues/3309) - -- [pathname:///dogfooding/javadoc](pathname:///dogfooding/javadoc) - -- [pathname:///dogfooding/javadoc/index.html](pathname:///dogfooding/javadoc/index.html) - -- [pathname://../dogfooding/javadoc](pathname://../dogfooding/javadoc) - -- [pathname://../dogfooding/javadoc/index.html](pathname://../dogfooding/javadoc/index.html) - -## Linking to JSON - -- [./script.js](./_script.js) - -- [./data.json](./data.json) From 62cd8b1480bd8daaf7199af15c130e615da6e8ab Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 5 Jan 2023 19:32:46 +0100 Subject: [PATCH 077/155] add markdown .md test page --- website/_dogfooding/_pages tests/markdown-tests-md.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 website/_dogfooding/_pages tests/markdown-tests-md.md diff --git a/website/_dogfooding/_pages tests/markdown-tests-md.md b/website/_dogfooding/_pages tests/markdown-tests-md.md new file mode 100644 index 000000000000..c6fb62e65f61 --- /dev/null +++ b/website/_dogfooding/_pages tests/markdown-tests-md.md @@ -0,0 +1,9 @@ +--- +title: Markdown Page tests title +description: Markdown Page tests description +wrapperClassName: docusaurus-markdown-example +--- + +# Markdown .md tests + +todo From 2163ba324d3293f286525d7db88fac6063011148 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 5 Jan 2023 19:34:50 +0100 Subject: [PATCH 078/155] broken link --- website/_dogfooding/_pages tests/index.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/website/_dogfooding/_pages tests/index.mdx b/website/_dogfooding/_pages tests/index.mdx index 9cfb6a0834dd..b419a2bdcd3a 100644 --- a/website/_dogfooding/_pages tests/index.mdx +++ b/website/_dogfooding/_pages tests/index.mdx @@ -29,7 +29,6 @@ import Readme from "../README.mdx" - [Link tests](/tests/pages/link-tests) - [Error boundary tests](/tests/pages/error-boundary-tests) - [Hydration tests](/tests/pages/hydration-tests) -- [Asset linking tests](/tests/pages/markdown-tests) - [TOC tests](/tests/pages/page-toc-tests) - [Diagram tests](/tests/pages/diagrams) - [Tabs tests](/tests/pages/tabs-tests) From 05bd2df3446e8af63b70884739dacca692a25265 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 11:52:19 +0100 Subject: [PATCH 079/155] format: "detect" --- .../src/__tests__/frontMatter.test.ts | 2 +- .../docusaurus-mdx-loader/src/frontMatter.ts | 8 ++- packages/docusaurus-mdx-loader/src/loader.ts | 58 +++++++++---------- .../_pages tests/markdown-tests-md.md | 10 ++++ 4 files changed, 42 insertions(+), 36 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/__tests__/frontMatter.test.ts b/packages/docusaurus-mdx-loader/src/__tests__/frontMatter.test.ts index e344f236cead..7a7e7a44805f 100644 --- a/packages/docusaurus-mdx-loader/src/__tests__/frontMatter.test.ts +++ b/packages/docusaurus-mdx-loader/src/__tests__/frontMatter.test.ts @@ -87,7 +87,7 @@ describe('validateDocFrontMatter format', () => { prefix: 'format', validFrontMatters: [{format: 'md'}, {format: 'mdx'}], invalidFrontMatters: [ - [{format: 'xdm'}, '"format" must be one of [md, mdx]'], + [{format: 'xdm'}, '"format" must be one of [md, mdx, detect]'], ], }); }); diff --git a/packages/docusaurus-mdx-loader/src/frontMatter.ts b/packages/docusaurus-mdx-loader/src/frontMatter.ts index 05ef5f15e621..3c47648f6d20 100644 --- a/packages/docusaurus-mdx-loader/src/frontMatter.ts +++ b/packages/docusaurus-mdx-loader/src/frontMatter.ts @@ -11,15 +11,17 @@ import { } from '@docusaurus/utils-validation'; export type MDXFrontMatter = { - format: 'md' | 'mdx'; + format: 'md' | 'mdx' | 'detect'; }; export const DefaultMDXFrontMatter: MDXFrontMatter = { - format: 'mdx', // TODO later => move to undefined (using file extension) + format: 'detect', }; const MDXFrontMatterSchema = Joi.object({ - format: Joi.string().equal('md', 'mdx').default(DefaultMDXFrontMatter.format), + format: Joi.string() + .equal('md', 'mdx', 'detect') + .default(DefaultMDXFrontMatter.format), }).default(DefaultMDXFrontMatter); export function validateMDXFrontMatter(frontMatter: unknown): MDXFrontMatter { diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 4553b7464e2e..2469931485bf 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -6,6 +6,7 @@ */ import fs from 'fs-extra'; +import path from 'path'; import logger from '@docusaurus/logger'; import { parseFrontMatter, @@ -15,7 +16,6 @@ import { } from '@docusaurus/utils'; import emoji from 'remark-emoji'; import stringifyObject from 'stringify-object'; -import {Simulate} from 'react-dom/test-utils'; import preprocessor from './preprocessor'; import headings from './remark/headings'; import toc from './remark/toc'; @@ -36,7 +36,23 @@ import type {AdmonitionOptions} from './remark/admonitions'; // @ts-expect-error: TODO import type {ProcessorOptions} from '@mdx-js/mdx'; -import load = Simulate.load; + +// Copied from https://mdxjs.com/packages/mdx/#optionsmdextensions +// Although we are likely to only use .md / .mdx anyway... +const mdFormatExtensions = [ + '.md', + '.markdown', + '.mdown', + '.mkdn', + '.mkd', + '.mdwn', + '.mkdown', + '.ron', +]; + +function isMDFormat(filepath: string) { + return mdFormatExtensions.includes(path.extname(filepath)); +} const { loaders: {inlineMarkdownImageFileLoader}, @@ -162,11 +178,6 @@ function getAdmonitionsPlugins( return []; } -function isDebugFile(filePath: string): boolean { - // return filePath.endsWith('plugin-sitemap.md'); - return false; -} - // TODO temporary, remove this after v3.1? // Some plugin authors use our mdx-loader, despite it not being public API // see https://github.com/facebook/docusaurus/issues/8298 @@ -204,20 +215,6 @@ export async function mdxLoader( admonitions: reqOptions.admonitions, }); - if (isDebugFile(filePath)) { - console.log('\n\n\n'); - console.log('contentUnprocessed'); - console.log('\n\n\n'); - console.log(contentUnprocessed); - console.log('\n\n\n'); - console.log('############################################################'); - console.log('\n\n\n'); - console.log('content'); - console.log('\n\n\n'); - console.log(content); - console.log('\n\n\n'); - } - const hasFrontMatter = Object.keys(frontMatter).length > 0; if (!compilerCache.has(this.query)) { @@ -260,14 +257,20 @@ export async function mdxLoader( ...(reqOptions.rehypePlugins ?? []), ]; + const format = + mdxFrontMatter.format === 'detect' + ? isMDFormat(filePath) + ? 'md' + : 'mdx' + : mdxFrontMatter.format; + const options: ProcessorOptions = { ...reqOptions, remarkPlugins, rehypePlugins, - format: mdxFrontMatter.format, + format, providerImportSource: '@mdx-js/react', }; - // @ts-expect-error: TODO compilerCache.set(this.query, [createProcessor(options), options]); } @@ -297,15 +300,6 @@ export async function mdxLoader( ); } - if (isDebugFile(filePath)) { - console.log('############################################################'); - console.log('\n\n\n'); - console.log('result'); - console.log('\n\n\n'); - console.log(result); - console.log('\n\n\n'); - } - // MDX partials are MDX files starting with _ or in a folder starting with _ // Partial are not expected to have associated metadata files or front matter const isMDXPartial = options.isMDXPartial?.(filePath); diff --git a/website/_dogfooding/_pages tests/markdown-tests-md.md b/website/_dogfooding/_pages tests/markdown-tests-md.md index c6fb62e65f61..18ea7192a1cb 100644 --- a/website/_dogfooding/_pages tests/markdown-tests-md.md +++ b/website/_dogfooding/_pages tests/markdown-tests-md.md @@ -7,3 +7,13 @@ wrapperClassName: docusaurus-markdown-example # Markdown .md tests todo + + + +:::note[test] + +note + +::: + +test From 05279eca8dca01fb24b18d8961cbf5ef33689773 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 11:52:28 +0100 Subject: [PATCH 080/155] format: "detect" --- project-words.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project-words.txt b/project-words.txt index d74da438780b..fd26dd801075 100644 --- a/project-words.txt +++ b/project-words.txt @@ -190,6 +190,9 @@ mkcert mkdir mkdirs mkdocs +mkdn +mdwn +mkdown moesif msapplication nabors From d68ca280d1458d1610e89d2cb002f868dedd73c3 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 12:09:36 +0100 Subject: [PATCH 081/155] remove useless duplicate jest/vendor ignores --- .eslintignore | 2 -- .prettierignore | 2 -- 2 files changed, 4 deletions(-) diff --git a/.eslintignore b/.eslintignore index bbd9f980e947..199ebb76f825 100644 --- a/.eslintignore +++ b/.eslintignore @@ -21,5 +21,3 @@ packages/create-docusaurus/lib/* packages/create-docusaurus/templates/facebook website/_dogfooding/_swizzle_theme_tests - -jest/vendor diff --git a/.prettierignore b/.prettierignore index d9343d369d23..6d600d2aad79 100644 --- a/.prettierignore +++ b/.prettierignore @@ -26,5 +26,3 @@ website/static/katex/katex.min.css website/changelog/_swizzle_theme_tests website/_dogfooding/_swizzle_theme_tests - -jest/vendor From 1457a23444e8b6bc028c35252d75ba1479287382 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 12:22:30 +0100 Subject: [PATCH 082/155] yarnlock cleanup --- yarn.lock | 5 ----- 1 file changed, 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index ade8e40ac299..073a8a33479c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2611,11 +2611,6 @@ unist-util-visit "^4.0.0" vfile "^5.0.0" -"@mdx-js/react@^1.6.22": - version "1.6.22" - resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.6.22.tgz#ae09b4744fddc74714ee9f9d6f17a66e77c43573" - integrity sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg== - "@mdx-js/react@^2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-2.1.5.tgz#8225a867dae6f845ae5b0ec15bb454c23be3f576" From 68c75d3556941337cbf4db10b67e8c8fdff7b65b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 12:23:43 +0100 Subject: [PATCH 083/155] remove MDXComponents/Head from swizzle config --- packages/docusaurus-theme-classic/src/getSwizzleConfig.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/getSwizzleConfig.ts b/packages/docusaurus-theme-classic/src/getSwizzleConfig.ts index 010967c003a6..c37f92ba31fe 100644 --- a/packages/docusaurus-theme-classic/src/getSwizzleConfig.ts +++ b/packages/docusaurus-theme-classic/src/getSwizzleConfig.ts @@ -312,14 +312,6 @@ export default function getSwizzleConfig(): SwizzleConfig { }, description: 'The component used to render
tags in MDX', }, - 'MDXComponents/Head': { - actions: { - eject: 'forbidden', - wrap: 'forbidden', - }, - description: - 'Technical component used to assign metadata (generally for SEO purpose) to the current MDX document', - }, 'MDXComponents/Heading': { actions: { eject: 'safe', From 3bc5cbd8af06b18a9adf78cbb3d9d3886867ebf2 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 12:39:53 +0100 Subject: [PATCH 084/155] remove useless MDX pragma/runtime/deps --- .../templates/classic-typescript/package.json | 1 - .../create-docusaurus/templates/classic/package.json | 1 - .../create-docusaurus/templates/facebook/package.json | 1 - packages/docusaurus-mdx-loader/src/loader.ts | 11 ----------- 4 files changed, 14 deletions(-) diff --git a/packages/create-docusaurus/templates/classic-typescript/package.json b/packages/create-docusaurus/templates/classic-typescript/package.json index ac55da8b8cb7..3a5005bb85f2 100644 --- a/packages/create-docusaurus/templates/classic-typescript/package.json +++ b/packages/create-docusaurus/templates/classic-typescript/package.json @@ -17,7 +17,6 @@ "dependencies": { "@docusaurus/core": "^3.0.0-alpha.0", "@docusaurus/preset-classic": "^3.0.0-alpha.0", - "@mdx-js/react": "^2.1.5", "clsx": "^1.2.1", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", diff --git a/packages/create-docusaurus/templates/classic/package.json b/packages/create-docusaurus/templates/classic/package.json index d0a06d1bd55c..aaf58b0dbb2e 100644 --- a/packages/create-docusaurus/templates/classic/package.json +++ b/packages/create-docusaurus/templates/classic/package.json @@ -16,7 +16,6 @@ "dependencies": { "@docusaurus/core": "^3.0.0-alpha.0", "@docusaurus/preset-classic": "^3.0.0-alpha.0", - "@mdx-js/react": "^2.1.5", "clsx": "^1.2.1", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", diff --git a/packages/create-docusaurus/templates/facebook/package.json b/packages/create-docusaurus/templates/facebook/package.json index 1ff5b2154858..13c857d31887 100644 --- a/packages/create-docusaurus/templates/facebook/package.json +++ b/packages/create-docusaurus/templates/facebook/package.json @@ -20,7 +20,6 @@ "dependencies": { "@docusaurus/core": "^3.0.0-alpha.0", "@docusaurus/preset-classic": "^3.0.0-alpha.0", - "@mdx-js/react": "^2.1.5", "clsx": "^1.2.1", "react": "^17.0.2", "react-dom": "^17.0.2" diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 2469931485bf..75d104797845 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -58,13 +58,6 @@ const { loaders: {inlineMarkdownImageFileLoader}, } = getFileLoaderUtils(); -// TODO replace with new mdx compiler options? -const pragma = ` -/* @jsxRuntime classic */ -/* @jsx mdx */ -/* @jsxFrag React.Fragment */ -`; - const DEFAULT_OPTIONS: MDXOptions = { admonitions: true, rehypePlugins: [], @@ -354,10 +347,6 @@ ${assets ? `export const assets = ${createAssetsExportCode(assets)};` : ''} `; const code = ` -${pragma} -import React from 'react'; -import { mdx } from '@mdx-js/react'; - ${exportsCode} ${result} `; From 5ca05f3e8fda29929b45dac4b0866d7e33e41e76 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 12:43:18 +0100 Subject: [PATCH 085/155] improve "yarn clear" command: cleanup create-docusaurus tests --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c1f730044b7..c906b04cbb72 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "test": "jest", "test:build:website": "./admin/scripts/test-release.sh", "watch": "yarn lerna run --parallel watch", - "clear": "(yarn workspace website clear || echo 'Failure while running docusaurus clear') && yarn lerna exec --ignore docusaurus yarn rimraf lib", + "clear": "(yarn workspace website clear || echo 'Failure while running docusaurus clear') && yarn rimraf test-website && yarn rimraf test-website-in-workspace && yarn lerna exec --ignore docusaurus yarn rimraf lib", "test:baseUrl": "yarn build:website:baseUrl && yarn serve:website:baseUrl", "lock:update": "npx --yes yarn-deduplicate" }, From 1c69210f0d4f0d1e28e71dad137e3baf3de5d7d4 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 12:46:38 +0100 Subject: [PATCH 086/155] restore needed dependency :D --- .../create-docusaurus/templates/classic-typescript/package.json | 1 + packages/create-docusaurus/templates/classic/package.json | 1 + packages/create-docusaurus/templates/facebook/package.json | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/create-docusaurus/templates/classic-typescript/package.json b/packages/create-docusaurus/templates/classic-typescript/package.json index 3a5005bb85f2..ac55da8b8cb7 100644 --- a/packages/create-docusaurus/templates/classic-typescript/package.json +++ b/packages/create-docusaurus/templates/classic-typescript/package.json @@ -17,6 +17,7 @@ "dependencies": { "@docusaurus/core": "^3.0.0-alpha.0", "@docusaurus/preset-classic": "^3.0.0-alpha.0", + "@mdx-js/react": "^2.1.5", "clsx": "^1.2.1", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", diff --git a/packages/create-docusaurus/templates/classic/package.json b/packages/create-docusaurus/templates/classic/package.json index aaf58b0dbb2e..d0a06d1bd55c 100644 --- a/packages/create-docusaurus/templates/classic/package.json +++ b/packages/create-docusaurus/templates/classic/package.json @@ -16,6 +16,7 @@ "dependencies": { "@docusaurus/core": "^3.0.0-alpha.0", "@docusaurus/preset-classic": "^3.0.0-alpha.0", + "@mdx-js/react": "^2.1.5", "clsx": "^1.2.1", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", diff --git a/packages/create-docusaurus/templates/facebook/package.json b/packages/create-docusaurus/templates/facebook/package.json index 13c857d31887..1ff5b2154858 100644 --- a/packages/create-docusaurus/templates/facebook/package.json +++ b/packages/create-docusaurus/templates/facebook/package.json @@ -20,6 +20,7 @@ "dependencies": { "@docusaurus/core": "^3.0.0-alpha.0", "@docusaurus/preset-classic": "^3.0.0-alpha.0", + "@mdx-js/react": "^2.1.5", "clsx": "^1.2.1", "react": "^17.0.2", "react-dom": "^17.0.2" From 77d7356c6a5f626daf44027b84f634376328e425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Fri, 6 Jan 2023 16:22:01 +0100 Subject: [PATCH 087/155] docs(website): use MDX comments instead of HTML comments (#8516) --- .../2021-08-21-blog-post-toc-tests.mdx | 2 +- .../2021-10-07-blog-post-mdx-feed-tests.mdx | 2 +- ...-10-08-blog-post-mdx-require-feed-tests.mdx | 2 +- .../demo/2020-08-03-second-blog-intro.mdx | 2 +- .../_pages tests/code-block-tests.mdx | 2 +- .../_pages tests/markdown-tests-mdx.mdx | 12 ++---------- website/docs/api/docusaurus.config.js.mdx | 2 +- website/docs/blog.mdx | 6 +++--- .../markdown-features-admonitions.mdx | 2 +- .../markdown-features-react.mdx | 18 ++++++++---------- .../markdown-features-tabs.mdx | 6 ++---- .../markdown-features-toc.mdx | 4 ++-- website/docs/introduction.mdx | 12 ------------ website/docs/search.mdx | 2 +- .../version-2.0.1/api/docusaurus.config.js.mdx | 2 +- website/versioned_docs/version-2.0.1/blog.mdx | 6 +++--- .../markdown-features-admonitions.mdx | 2 +- .../markdown-features-react.mdx | 18 ++++++++---------- .../markdown-features-tabs.mdx | 6 ++---- .../markdown-features-toc.mdx | 4 ++-- .../version-2.0.1/introduction.mdx | 12 ------------ .../versioned_docs/version-2.0.1/search.mdx | 2 +- .../version-2.1.0/api/docusaurus.config.js.mdx | 2 +- website/versioned_docs/version-2.1.0/blog.mdx | 6 +++--- .../markdown-features-admonitions.mdx | 2 +- .../markdown-features-react.mdx | 18 ++++++++---------- .../markdown-features-tabs.mdx | 6 ++---- .../markdown-features-toc.mdx | 4 ++-- .../version-2.1.0/introduction.mdx | 12 ------------ .../versioned_docs/version-2.1.0/search.mdx | 2 +- .../version-2.2.0/api/docusaurus.config.js.mdx | 2 +- website/versioned_docs/version-2.2.0/blog.mdx | 6 +++--- .../markdown-features-admonitions.mdx | 2 +- .../markdown-features-react.mdx | 18 ++++++++---------- .../markdown-features-tabs.mdx | 6 ++---- .../markdown-features-toc.mdx | 4 ++-- .../version-2.2.0/introduction.mdx | 12 ------------ .../versioned_docs/version-2.2.0/search.mdx | 2 +- 38 files changed, 79 insertions(+), 151 deletions(-) diff --git a/website/_dogfooding/_blog tests/2021-08-21-blog-post-toc-tests.mdx b/website/_dogfooding/_blog tests/2021-08-21-blog-post-toc-tests.mdx index 105d193ae6e2..fe66256a7427 100644 --- a/website/_dogfooding/_blog tests/2021-08-21-blog-post-toc-tests.mdx +++ b/website/_dogfooding/_blog tests/2021-08-21-blog-post-toc-tests.mdx @@ -7,7 +7,7 @@ toc_max_heading_level: 4 tags: [paginated-tag] --- - +{/* truncate */} import Content, { toc as ContentToc, diff --git a/website/_dogfooding/_blog tests/2021-10-07-blog-post-mdx-feed-tests.mdx b/website/_dogfooding/_blog tests/2021-10-07-blog-post-mdx-feed-tests.mdx index a171eefe3f95..7f501c7e4ba2 100644 --- a/website/_dogfooding/_blog tests/2021-10-07-blog-post-mdx-feed-tests.mdx +++ b/website/_dogfooding/_blog tests/2021-10-07-blog-post-mdx-feed-tests.mdx @@ -16,7 +16,7 @@ hide_reading_time: true Some MDX tests, mostly to test how the RSS feed render those - +{/* truncate */} ## Imports diff --git a/website/_dogfooding/_blog tests/2021-10-08-blog-post-mdx-require-feed-tests.mdx b/website/_dogfooding/_blog tests/2021-10-08-blog-post-mdx-require-feed-tests.mdx index 1485ef081753..4c572b44faa3 100644 --- a/website/_dogfooding/_blog tests/2021-10-08-blog-post-mdx-require-feed-tests.mdx +++ b/website/_dogfooding/_blog tests/2021-10-08-blog-post-mdx-require-feed-tests.mdx @@ -15,7 +15,7 @@ tags: Some MDX tests, mostly to test how the RSS feed render those - +{/* truncate */} Test MDX with require calls diff --git a/website/_dogfooding/_blog tests/demo/2020-08-03-second-blog-intro.mdx b/website/_dogfooding/_blog tests/demo/2020-08-03-second-blog-intro.mdx index c21273c78a17..890a2c9a54e6 100644 --- a/website/_dogfooding/_blog tests/demo/2020-08-03-second-blog-intro.mdx +++ b/website/_dogfooding/_blog tests/demo/2020-08-03-second-blog-intro.mdx @@ -6,7 +6,7 @@ tags: [paginated-tag, blog, docusaurus] Did you know you can use multiple instances of the same plugin? - +{/* truncate */} :::tip diff --git a/website/_dogfooding/_pages tests/code-block-tests.mdx b/website/_dogfooding/_pages tests/code-block-tests.mdx index 2c955e110cb4..a73042cbe48b 100644 --- a/website/_dogfooding/_pages tests/code-block-tests.mdx +++ b/website/_dogfooding/_pages tests/code-block-tests.mdx @@ -27,7 +27,7 @@ Multi-line text inside `pre` will turn into one-liner, but it's okay (https://gi
1 2 3
- +{/* prettier-ignore */}
 1
 2
diff --git a/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx b/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx
index 0d7f148c3ad9..69eaedecb478 100644
--- a/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx	
+++ b/website/_dogfooding/_pages tests/markdown-tests-mdx.mdx	
@@ -51,20 +51,12 @@ import TabItem from '@theme/TabItem';
 MDX comments can be used with
 
 ```mdx
-
+{/* My comment */}
 ```
 
 See, nothing is displayed:
 
-
+{/* My comment */}
 
 ## Import code block from source code file
 
diff --git a/website/docs/api/docusaurus.config.js.mdx b/website/docs/api/docusaurus.config.js.mdx
index e9c7c6e99dc4..9b4ff8762820 100644
--- a/website/docs/api/docusaurus.config.js.mdx
+++ b/website/docs/api/docusaurus.config.js.mdx
@@ -123,7 +123,7 @@ The i18n configuration object to [localize your site](../i18n/i18n-introduction.
 
 Example:
 
-
+{/* cSpell:ignore فارسی */}
 
 ```js title="docusaurus.config.js"
 module.exports = {
diff --git a/website/docs/blog.mdx b/website/docs/blog.mdx
index 02f870da6f6f..9276a52c30b3 100644
--- a/website/docs/blog.mdx
+++ b/website/docs/blog.mdx
@@ -63,7 +63,7 @@ hide_table_of_contents: false
 
 Welcome to this blog. This blog is created with [**Docusaurus 2**](https://docusaurus.io/).
 
-
+
 
 This is my first post on Docusaurus 2.
 
@@ -76,7 +76,7 @@ The [front matter](./guides/markdown-features/markdown-features-intro.mdx#front-
 
 The blog's index page (by default, it is at `/blog`) is the _blog list page_, where all blog posts are collectively displayed.
 
-Use the `` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `` will be part of the summary. For example:
+Use the `{/*truncate*/}` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `{/*truncate*/}` will be part of the summary. For example:
 
 ```md
 ---
@@ -87,7 +87,7 @@ All these will be part of the blog post summary.
 
 Even this.
 
-
+
 
 But anything from here on down will not be.
 
diff --git a/website/docs/guides/markdown-features/markdown-features-admonitions.mdx b/website/docs/guides/markdown-features/markdown-features-admonitions.mdx
index ab7f1b3736f8..11e6f1c389a5 100644
--- a/website/docs/guides/markdown-features/markdown-features-admonitions.mdx
+++ b/website/docs/guides/markdown-features/markdown-features-admonitions.mdx
@@ -87,7 +87,7 @@ Some **content** with _Markdown_ `syntax`. Check [this `api`](#).
 
 If you use [Prettier](https://prettier.io) to format your Markdown files, Prettier might auto-format your code to invalid admonition syntax. To avoid this problem, add empty lines around the starting and ending directives. This is also why the examples we show here all have empty lines around the content.
 
-
+{/* prettier-ignore */}
 ```md
 
 :::note
diff --git a/website/docs/guides/markdown-features/markdown-features-react.mdx b/website/docs/guides/markdown-features/markdown-features-react.mdx
index 0327c1e16023..4baabbb43c7a 100644
--- a/website/docs/guides/markdown-features/markdown-features-react.mdx
+++ b/website/docs/guides/markdown-features/markdown-features-react.mdx
@@ -76,7 +76,7 @@ I can write **Markdown** alongside my _JSX_!
 
 Since all doc files are parsed using MDX, anything that looks like HTML is actually JSX. Therefore, if you need to inline-style a component, follow JSX flavor and provide style objects.
 
-
+{/* prettier-ignore */}
 ```jsx
 /* Instead of this: */
 Foo
@@ -94,7 +94,7 @@ In addition, MDX is not [100% compatible with CommonMark](https://github.com/fac
 
 You can also import your own components defined in other files or third-party components installed via npm.
 
-
+{/* prettier-ignore */}
 ```md
 
 import TOCInline from '@theme/TOCInline';
@@ -339,7 +339,7 @@ Use JSX within JSX tag, or move the Markdown to the outer layer:
 
``` - +{/* prettier-ignore */} ```jsx
**Bold still doesn't work** @@ -365,7 +365,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -395,7 +395,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -425,7 +425,7 @@ Don't indent:
``` - +{/* prettier-ignore */} ```jsx
@@ -461,14 +461,13 @@ npm install --save raw-loader Now you can import code snippets from another file as it is: - +{/* prettier-ignore */} ```jsx title="myMarkdownFile.mdx" import CodeBlock from '@theme/CodeBlock'; import MyComponentSource from '!!raw-loader!./myComponent'; {MyComponentSource} ``` - ```mdx-code-block import CodeBlock from '@theme/CodeBlock'; @@ -507,13 +506,12 @@ By convention, using the **`_` filename prefix** will not create any doc page an This is text some content from `_markdown-partial-example.mdx`. ``` - +{/* prettier-ignore */} ```jsx title="someOtherDoc.mdx" import PartialExample from './_markdown-partial-example.mdx'; ``` - ```mdx-code-block import PartialExample from './_markdown-partial-example.mdx'; diff --git a/website/docs/guides/markdown-features/markdown-features-tabs.mdx b/website/docs/guides/markdown-features/markdown-features-tabs.mdx index 948c61ef6757..4f9973d557a3 100644 --- a/website/docs/guides/markdown-features/markdown-features-tabs.mdx +++ b/website/docs/guides/markdown-features/markdown-features-tabs.mdx @@ -15,7 +15,7 @@ import styles from './markdown-features-tabs-styles.module.css'; Docusaurus provides the `` component that you can use in Markdown thanks to [MDX](./markdown-features-react.mdx): - +{/* prettier-ignore */} ```jsx import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -32,7 +32,6 @@ import TabItem from '@theme/TabItem'; ``` - ```mdx-code-block @@ -250,7 +249,7 @@ You might want to customize the appearance of a certain set of tabs. You can pas You can also customize each tab heading independently by using the `attributes` field. The extra props can be passed to the headings either through the `values` prop in `Tabs`, or props of each `TabItem`—in the same way as you declare `label`. - +{/* prettier-ignore */} ```jsx title="some-doc.mdx" import styles from './styles.module.css'; @@ -266,7 +265,6 @@ import styles from './styles.module.css'; ``` - ```css title="styles.module.css" .red { diff --git a/website/docs/guides/markdown-features/markdown-features-toc.mdx b/website/docs/guides/markdown-features/markdown-features-toc.mdx index 4b2857c4f7c1..b4e81fde834b 100644 --- a/website/docs/guides/markdown-features/markdown-features-toc.mdx +++ b/website/docs/guides/markdown-features/markdown-features-toc.mdx @@ -102,7 +102,7 @@ It is also possible to display an inline table of contents directly inside a Mar The `toc` variable is available in any MDX document and contains all the headings of an MDX document. By default, only `h2` and `h3` headings are displayed in the TOC. You can change which heading levels are visible by setting `minHeadingLevel` or `maxHeadingLevel` for individual `TOCInline` components. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; @@ -129,7 +129,7 @@ declare const toc: { Note that the `toc` global is a flat array, so you can easily cut out unwanted nodes or insert extra nodes, and create a new TOC tree. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; diff --git a/website/docs/introduction.mdx b/website/docs/introduction.mdx index 84b5c4eab91b..a03b487c78b0 100644 --- a/website/docs/introduction.mdx +++ b/website/docs/introduction.mdx @@ -128,18 +128,6 @@ Docusaurus 2 is born to be compassionately accessible to all your users, and lig We believe that, as developers, knowing how a library works helps us become better at using it. Hence we're dedicating effort to explaining the architecture and various components of Docusaurus with the hope that users reading it will gain a deeper understanding of the tool and be even more proficient in using it. - - ## Comparison with other tools {#comparison-with-other-tools} Across all static site generators, Docusaurus has a unique focus on documentation sites and has many out-of-the-box features. diff --git a/website/docs/search.mdx b/website/docs/search.mdx index 32fdcd7f6850..78f785bca0cb 100644 --- a/website/docs/search.mdx +++ b/website/docs/search.mdx @@ -247,7 +247,7 @@ Still, you can reuse the [Infima CSS variables](styling-layout.mdx#styling-your- ### Customizing the Algolia search behavior {#customizing-the-algolia-search-behavior} - +{/* TODO: update options link once the documentation is available on the DocSearch website */} Algolia DocSearch supports a [list of options](https://autocomplete-experimental.netlify.app/docs/DocSearchModal#reference) that you can pass to the `algolia` field in the `docusaurus.config.js` file. diff --git a/website/versioned_docs/version-2.0.1/api/docusaurus.config.js.mdx b/website/versioned_docs/version-2.0.1/api/docusaurus.config.js.mdx index cdce44e0dd67..ae1803e5121f 100644 --- a/website/versioned_docs/version-2.0.1/api/docusaurus.config.js.mdx +++ b/website/versioned_docs/version-2.0.1/api/docusaurus.config.js.mdx @@ -123,7 +123,7 @@ The i18n configuration object to [localize your site](../i18n/i18n-introduction. Example: - +{/* cSpell:ignore فارسی */} ```js title="docusaurus.config.js" module.exports = { diff --git a/website/versioned_docs/version-2.0.1/blog.mdx b/website/versioned_docs/version-2.0.1/blog.mdx index a2262e2f11a5..a59ff92e8c01 100644 --- a/website/versioned_docs/version-2.0.1/blog.mdx +++ b/website/versioned_docs/version-2.0.1/blog.mdx @@ -63,7 +63,7 @@ hide_table_of_contents: false Welcome to this blog. This blog is created with [**Docusaurus 2**](https://docusaurus.io/). - + This is my first post on Docusaurus 2. @@ -76,7 +76,7 @@ The [front matter](./guides/markdown-features/markdown-features-intro.mdx#front- The blog's index page (by default, it is at `/blog`) is the _blog list page_, where all blog posts are collectively displayed. -Use the `` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `` will be part of the summary. For example: +Use the `{/*truncate*/}` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `{/*truncate*/}` will be part of the summary. For example: ```md --- @@ -87,7 +87,7 @@ All these will be part of the blog post summary. Even this. - + But anything from here on down will not be. diff --git a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-admonitions.mdx index f4c00f7c3f4a..0ea3e6b9075e 100644 --- a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-admonitions.mdx @@ -87,7 +87,7 @@ Some **content** with _Markdown_ `syntax`. Check [this `api`](#). If you use [Prettier](https://prettier.io) to format your Markdown files, Prettier might auto-format your code to invalid admonition syntax. To avoid this problem, add empty lines around the starting and ending directives. This is also why the examples we show here all have empty lines around the content. - +{/* prettier-ignore */} ```md :::note diff --git a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-react.mdx b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-react.mdx index a8d76f1067e9..ea6fbd9e4896 100644 --- a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-react.mdx +++ b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-react.mdx @@ -76,7 +76,7 @@ I can write **Markdown** alongside my _JSX_! Since all doc files are parsed using MDX, anything that looks like HTML is actually JSX. Therefore, if you need to inline-style a component, follow JSX flavor and provide style objects. - +{/* prettier-ignore */} ```jsx /* Instead of this: */ Foo @@ -94,7 +94,7 @@ In addition, MDX is not [100% compatible with CommonMark](https://github.com/fac You can also import your own components defined in other files or third-party components installed via npm. - +{/* prettier-ignore */} ```md import TOCInline from '@theme/TOCInline'; @@ -339,7 +339,7 @@ Use JSX within JSX tag, or move the Markdown to the outer layer:
``` - +{/* prettier-ignore */} ```jsx
**Bold still doesn't work** @@ -365,7 +365,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -395,7 +395,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -425,7 +425,7 @@ Don't indent:
``` - +{/* prettier-ignore */} ```jsx
@@ -461,14 +461,13 @@ npm install --save raw-loader Now you can import code snippets from another file as it is: - +{/* prettier-ignore */} ```jsx title="myMarkdownFile.mdx" import CodeBlock from '@theme/CodeBlock'; import MyComponentSource from '!!raw-loader!./myComponent'; {MyComponentSource} ``` - ```mdx-code-block import CodeBlock from '@theme/CodeBlock'; @@ -507,13 +506,12 @@ By convention, using the **`_` filename prefix** will not create any doc page an This is text some content from `_markdown-partial-example.mdx`. ``` - +{/* prettier-ignore */} ```jsx title="someOtherDoc.mdx" import PartialExample from './_markdown-partial-example.mdx'; ``` - ```mdx-code-block import PartialExample from './_markdown-partial-example.mdx'; diff --git a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-tabs.mdx b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-tabs.mdx index 897f54a8a7c0..987f1067a306 100644 --- a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-tabs.mdx +++ b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-tabs.mdx @@ -15,7 +15,7 @@ import styles from './markdown-features-tabs-styles.module.css'; Docusaurus provides the `` component that you can use in Markdown thanks to [MDX](./markdown-features-react.mdx): - +{/* prettier-ignore */} ```jsx import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -32,7 +32,6 @@ import TabItem from '@theme/TabItem'; ``` - ```mdx-code-block @@ -250,7 +249,7 @@ You might want to customize the appearance of a certain set of tabs. You can pas You can also customize each tab heading independently by using the `attributes` field. The extra props can be passed to the headings either through the `values` prop in `Tabs`, or props of each `TabItem`—in the same way as you declare `label`. - +{/* prettier-ignore */} ```jsx title="some-doc.mdx" import styles from './styles.module.css'; @@ -266,7 +265,6 @@ import styles from './styles.module.css'; ``` - ```css title="styles.module.css" .red { diff --git a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-toc.mdx b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-toc.mdx index 4b2857c4f7c1..b4e81fde834b 100644 --- a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-toc.mdx +++ b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-toc.mdx @@ -102,7 +102,7 @@ It is also possible to display an inline table of contents directly inside a Mar The `toc` variable is available in any MDX document and contains all the headings of an MDX document. By default, only `h2` and `h3` headings are displayed in the TOC. You can change which heading levels are visible by setting `minHeadingLevel` or `maxHeadingLevel` for individual `TOCInline` components. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; @@ -129,7 +129,7 @@ declare const toc: { Note that the `toc` global is a flat array, so you can easily cut out unwanted nodes or insert extra nodes, and create a new TOC tree. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; diff --git a/website/versioned_docs/version-2.0.1/introduction.mdx b/website/versioned_docs/version-2.0.1/introduction.mdx index 84b5c4eab91b..a03b487c78b0 100644 --- a/website/versioned_docs/version-2.0.1/introduction.mdx +++ b/website/versioned_docs/version-2.0.1/introduction.mdx @@ -128,18 +128,6 @@ Docusaurus 2 is born to be compassionately accessible to all your users, and lig We believe that, as developers, knowing how a library works helps us become better at using it. Hence we're dedicating effort to explaining the architecture and various components of Docusaurus with the hope that users reading it will gain a deeper understanding of the tool and be even more proficient in using it. - - ## Comparison with other tools {#comparison-with-other-tools} Across all static site generators, Docusaurus has a unique focus on documentation sites and has many out-of-the-box features. diff --git a/website/versioned_docs/version-2.0.1/search.mdx b/website/versioned_docs/version-2.0.1/search.mdx index 66e6b3c13ad1..c1dad98ff9a8 100644 --- a/website/versioned_docs/version-2.0.1/search.mdx +++ b/website/versioned_docs/version-2.0.1/search.mdx @@ -241,7 +241,7 @@ Still, you can reuse the [Infima CSS variables](styling-layout.mdx#styling-your- ### Customizing the Algolia search behavior {#customizing-the-algolia-search-behavior} - +{/* TODO: update options link once the documentation is available on the DocSearch website */} Algolia DocSearch supports a [list of options](https://autocomplete-experimental.netlify.app/docs/DocSearchModal#reference) that you can pass to the `algolia` field in the `docusaurus.config.js` file. diff --git a/website/versioned_docs/version-2.1.0/api/docusaurus.config.js.mdx b/website/versioned_docs/version-2.1.0/api/docusaurus.config.js.mdx index 466bf06f925a..a6c5215fc274 100644 --- a/website/versioned_docs/version-2.1.0/api/docusaurus.config.js.mdx +++ b/website/versioned_docs/version-2.1.0/api/docusaurus.config.js.mdx @@ -123,7 +123,7 @@ The i18n configuration object to [localize your site](../i18n/i18n-introduction. Example: - +{/* cSpell:ignore فارسی */} ```js title="docusaurus.config.js" module.exports = { diff --git a/website/versioned_docs/version-2.1.0/blog.mdx b/website/versioned_docs/version-2.1.0/blog.mdx index a2262e2f11a5..a59ff92e8c01 100644 --- a/website/versioned_docs/version-2.1.0/blog.mdx +++ b/website/versioned_docs/version-2.1.0/blog.mdx @@ -63,7 +63,7 @@ hide_table_of_contents: false Welcome to this blog. This blog is created with [**Docusaurus 2**](https://docusaurus.io/). - + This is my first post on Docusaurus 2. @@ -76,7 +76,7 @@ The [front matter](./guides/markdown-features/markdown-features-intro.mdx#front- The blog's index page (by default, it is at `/blog`) is the _blog list page_, where all blog posts are collectively displayed. -Use the `` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `` will be part of the summary. For example: +Use the `{/*truncate*/}` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `{/*truncate*/}` will be part of the summary. For example: ```md --- @@ -87,7 +87,7 @@ All these will be part of the blog post summary. Even this. - + But anything from here on down will not be. diff --git a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-admonitions.mdx index f4c00f7c3f4a..0ea3e6b9075e 100644 --- a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-admonitions.mdx @@ -87,7 +87,7 @@ Some **content** with _Markdown_ `syntax`. Check [this `api`](#). If you use [Prettier](https://prettier.io) to format your Markdown files, Prettier might auto-format your code to invalid admonition syntax. To avoid this problem, add empty lines around the starting and ending directives. This is also why the examples we show here all have empty lines around the content. - +{/* prettier-ignore */} ```md :::note diff --git a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-react.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-react.mdx index a8d76f1067e9..ea6fbd9e4896 100644 --- a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-react.mdx +++ b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-react.mdx @@ -76,7 +76,7 @@ I can write **Markdown** alongside my _JSX_! Since all doc files are parsed using MDX, anything that looks like HTML is actually JSX. Therefore, if you need to inline-style a component, follow JSX flavor and provide style objects. - +{/* prettier-ignore */} ```jsx /* Instead of this: */ Foo @@ -94,7 +94,7 @@ In addition, MDX is not [100% compatible with CommonMark](https://github.com/fac You can also import your own components defined in other files or third-party components installed via npm. - +{/* prettier-ignore */} ```md import TOCInline from '@theme/TOCInline'; @@ -339,7 +339,7 @@ Use JSX within JSX tag, or move the Markdown to the outer layer:
``` - +{/* prettier-ignore */} ```jsx
**Bold still doesn't work** @@ -365,7 +365,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -395,7 +395,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -425,7 +425,7 @@ Don't indent:
``` - +{/* prettier-ignore */} ```jsx
@@ -461,14 +461,13 @@ npm install --save raw-loader Now you can import code snippets from another file as it is: - +{/* prettier-ignore */} ```jsx title="myMarkdownFile.mdx" import CodeBlock from '@theme/CodeBlock'; import MyComponentSource from '!!raw-loader!./myComponent'; {MyComponentSource} ``` - ```mdx-code-block import CodeBlock from '@theme/CodeBlock'; @@ -507,13 +506,12 @@ By convention, using the **`_` filename prefix** will not create any doc page an This is text some content from `_markdown-partial-example.mdx`. ``` - +{/* prettier-ignore */} ```jsx title="someOtherDoc.mdx" import PartialExample from './_markdown-partial-example.mdx'; ``` - ```mdx-code-block import PartialExample from './_markdown-partial-example.mdx'; diff --git a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-tabs.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-tabs.mdx index 897f54a8a7c0..987f1067a306 100644 --- a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-tabs.mdx +++ b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-tabs.mdx @@ -15,7 +15,7 @@ import styles from './markdown-features-tabs-styles.module.css'; Docusaurus provides the `` component that you can use in Markdown thanks to [MDX](./markdown-features-react.mdx): - +{/* prettier-ignore */} ```jsx import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -32,7 +32,6 @@ import TabItem from '@theme/TabItem'; ``` - ```mdx-code-block @@ -250,7 +249,7 @@ You might want to customize the appearance of a certain set of tabs. You can pas You can also customize each tab heading independently by using the `attributes` field. The extra props can be passed to the headings either through the `values` prop in `Tabs`, or props of each `TabItem`—in the same way as you declare `label`. - +{/* prettier-ignore */} ```jsx title="some-doc.mdx" import styles from './styles.module.css'; @@ -266,7 +265,6 @@ import styles from './styles.module.css'; ``` - ```css title="styles.module.css" .red { diff --git a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-toc.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-toc.mdx index 4b2857c4f7c1..b4e81fde834b 100644 --- a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-toc.mdx +++ b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-toc.mdx @@ -102,7 +102,7 @@ It is also possible to display an inline table of contents directly inside a Mar The `toc` variable is available in any MDX document and contains all the headings of an MDX document. By default, only `h2` and `h3` headings are displayed in the TOC. You can change which heading levels are visible by setting `minHeadingLevel` or `maxHeadingLevel` for individual `TOCInline` components. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; @@ -129,7 +129,7 @@ declare const toc: { Note that the `toc` global is a flat array, so you can easily cut out unwanted nodes or insert extra nodes, and create a new TOC tree. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; diff --git a/website/versioned_docs/version-2.1.0/introduction.mdx b/website/versioned_docs/version-2.1.0/introduction.mdx index 84b5c4eab91b..a03b487c78b0 100644 --- a/website/versioned_docs/version-2.1.0/introduction.mdx +++ b/website/versioned_docs/version-2.1.0/introduction.mdx @@ -128,18 +128,6 @@ Docusaurus 2 is born to be compassionately accessible to all your users, and lig We believe that, as developers, knowing how a library works helps us become better at using it. Hence we're dedicating effort to explaining the architecture and various components of Docusaurus with the hope that users reading it will gain a deeper understanding of the tool and be even more proficient in using it. - - ## Comparison with other tools {#comparison-with-other-tools} Across all static site generators, Docusaurus has a unique focus on documentation sites and has many out-of-the-box features. diff --git a/website/versioned_docs/version-2.1.0/search.mdx b/website/versioned_docs/version-2.1.0/search.mdx index 66e6b3c13ad1..c1dad98ff9a8 100644 --- a/website/versioned_docs/version-2.1.0/search.mdx +++ b/website/versioned_docs/version-2.1.0/search.mdx @@ -241,7 +241,7 @@ Still, you can reuse the [Infima CSS variables](styling-layout.mdx#styling-your- ### Customizing the Algolia search behavior {#customizing-the-algolia-search-behavior} - +{/* TODO: update options link once the documentation is available on the DocSearch website */} Algolia DocSearch supports a [list of options](https://autocomplete-experimental.netlify.app/docs/DocSearchModal#reference) that you can pass to the `algolia` field in the `docusaurus.config.js` file. diff --git a/website/versioned_docs/version-2.2.0/api/docusaurus.config.js.mdx b/website/versioned_docs/version-2.2.0/api/docusaurus.config.js.mdx index 052baa5b069b..0601b2e39ef7 100644 --- a/website/versioned_docs/version-2.2.0/api/docusaurus.config.js.mdx +++ b/website/versioned_docs/version-2.2.0/api/docusaurus.config.js.mdx @@ -123,7 +123,7 @@ The i18n configuration object to [localize your site](../i18n/i18n-introduction. Example: - +{/* cSpell:ignore فارسی */} ```js title="docusaurus.config.js" module.exports = { diff --git a/website/versioned_docs/version-2.2.0/blog.mdx b/website/versioned_docs/version-2.2.0/blog.mdx index a2262e2f11a5..a59ff92e8c01 100644 --- a/website/versioned_docs/version-2.2.0/blog.mdx +++ b/website/versioned_docs/version-2.2.0/blog.mdx @@ -63,7 +63,7 @@ hide_table_of_contents: false Welcome to this blog. This blog is created with [**Docusaurus 2**](https://docusaurus.io/). - + This is my first post on Docusaurus 2. @@ -76,7 +76,7 @@ The [front matter](./guides/markdown-features/markdown-features-intro.mdx#front- The blog's index page (by default, it is at `/blog`) is the _blog list page_, where all blog posts are collectively displayed. -Use the `` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `` will be part of the summary. For example: +Use the `{/*truncate*/}` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `{/*truncate*/}` will be part of the summary. For example: ```md --- @@ -87,7 +87,7 @@ All these will be part of the blog post summary. Even this. - + But anything from here on down will not be. diff --git a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-admonitions.mdx index f4c00f7c3f4a..0ea3e6b9075e 100644 --- a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-admonitions.mdx @@ -87,7 +87,7 @@ Some **content** with _Markdown_ `syntax`. Check [this `api`](#). If you use [Prettier](https://prettier.io) to format your Markdown files, Prettier might auto-format your code to invalid admonition syntax. To avoid this problem, add empty lines around the starting and ending directives. This is also why the examples we show here all have empty lines around the content. - +{/* prettier-ignore */} ```md :::note diff --git a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-react.mdx b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-react.mdx index a8d76f1067e9..5abc552baa48 100644 --- a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-react.mdx +++ b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-react.mdx @@ -76,7 +76,7 @@ I can write **Markdown** alongside my _JSX_! Since all doc files are parsed using MDX, anything that looks like HTML is actually JSX. Therefore, if you need to inline-style a component, follow JSX flavor and provide style objects. - +{/* prettier-ignore */} ```jsx /* Instead of this: */ Foo @@ -94,7 +94,7 @@ In addition, MDX is not [100% compatible with CommonMark](https://github.com/fac You can also import your own components defined in other files or third-party components installed via npm. - +{/* prettier-ignore */} ```md import TOCInline from '@theme/TOCInline'; @@ -339,7 +339,7 @@ Use JSX within JSX tag, or move the Markdown to the outer layer:
``` - +{/* prettier-ignore */} ```jsx
**Bold still doesn't work** @@ -365,7 +365,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -395,7 +395,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -425,7 +425,7 @@ Don't indent:
``` - +{/* prettier-ignore */} ```jsx
@@ -461,14 +461,13 @@ npm install --save raw-loader Now you can import code snippets from another file as it is: - + ```jsx title="myMarkdownFile.mdx" import CodeBlock from '@theme/CodeBlock'; import MyComponentSource from '!!raw-loader!./myComponent'; {MyComponentSource} ``` - ```mdx-code-block import CodeBlock from '@theme/CodeBlock'; @@ -507,13 +506,12 @@ By convention, using the **`_` filename prefix** will not create any doc page an This is text some content from `_markdown-partial-example.mdx`. ``` - +{/* prettier-ignore */} ```jsx title="someOtherDoc.mdx" import PartialExample from './_markdown-partial-example.mdx'; ``` - ```mdx-code-block import PartialExample from './_markdown-partial-example.mdx'; diff --git a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-tabs.mdx b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-tabs.mdx index 897f54a8a7c0..987f1067a306 100644 --- a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-tabs.mdx +++ b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-tabs.mdx @@ -15,7 +15,7 @@ import styles from './markdown-features-tabs-styles.module.css'; Docusaurus provides the `` component that you can use in Markdown thanks to [MDX](./markdown-features-react.mdx): - +{/* prettier-ignore */} ```jsx import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -32,7 +32,6 @@ import TabItem from '@theme/TabItem'; ``` - ```mdx-code-block @@ -250,7 +249,7 @@ You might want to customize the appearance of a certain set of tabs. You can pas You can also customize each tab heading independently by using the `attributes` field. The extra props can be passed to the headings either through the `values` prop in `Tabs`, or props of each `TabItem`—in the same way as you declare `label`. - +{/* prettier-ignore */} ```jsx title="some-doc.mdx" import styles from './styles.module.css'; @@ -266,7 +265,6 @@ import styles from './styles.module.css'; ``` - ```css title="styles.module.css" .red { diff --git a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-toc.mdx b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-toc.mdx index 4b2857c4f7c1..b4e81fde834b 100644 --- a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-toc.mdx +++ b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-toc.mdx @@ -102,7 +102,7 @@ It is also possible to display an inline table of contents directly inside a Mar The `toc` variable is available in any MDX document and contains all the headings of an MDX document. By default, only `h2` and `h3` headings are displayed in the TOC. You can change which heading levels are visible by setting `minHeadingLevel` or `maxHeadingLevel` for individual `TOCInline` components. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; @@ -129,7 +129,7 @@ declare const toc: { Note that the `toc` global is a flat array, so you can easily cut out unwanted nodes or insert extra nodes, and create a new TOC tree. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; diff --git a/website/versioned_docs/version-2.2.0/introduction.mdx b/website/versioned_docs/version-2.2.0/introduction.mdx index 84b5c4eab91b..a03b487c78b0 100644 --- a/website/versioned_docs/version-2.2.0/introduction.mdx +++ b/website/versioned_docs/version-2.2.0/introduction.mdx @@ -128,18 +128,6 @@ Docusaurus 2 is born to be compassionately accessible to all your users, and lig We believe that, as developers, knowing how a library works helps us become better at using it. Hence we're dedicating effort to explaining the architecture and various components of Docusaurus with the hope that users reading it will gain a deeper understanding of the tool and be even more proficient in using it. - - ## Comparison with other tools {#comparison-with-other-tools} Across all static site generators, Docusaurus has a unique focus on documentation sites and has many out-of-the-box features. diff --git a/website/versioned_docs/version-2.2.0/search.mdx b/website/versioned_docs/version-2.2.0/search.mdx index 4febd4137831..ddef7a4a09c3 100644 --- a/website/versioned_docs/version-2.2.0/search.mdx +++ b/website/versioned_docs/version-2.2.0/search.mdx @@ -241,7 +241,7 @@ Still, you can reuse the [Infima CSS variables](styling-layout.mdx#styling-your- ### Customizing the Algolia search behavior {#customizing-the-algolia-search-behavior} - +{/* TODO: update options link once the documentation is available on the DocSearch website */} Algolia DocSearch supports a [list of options](https://autocomplete-experimental.netlify.app/docs/DocSearchModal#reference) that you can pass to the `algolia` field in the `docusaurus.config.js` file. From 86e39a1cda5105f031779b394fa69773d598907a Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 17:30:13 +0100 Subject: [PATCH 088/155] revert unwanted blog docs truncate marker change --- website/versioned_docs/version-2.0.1/blog.mdx | 4 ++-- website/versioned_docs/version-2.1.0/blog.mdx | 4 ++-- website/versioned_docs/version-2.2.0/blog.mdx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/website/versioned_docs/version-2.0.1/blog.mdx b/website/versioned_docs/version-2.0.1/blog.mdx index a59ff92e8c01..cc91a003249a 100644 --- a/website/versioned_docs/version-2.0.1/blog.mdx +++ b/website/versioned_docs/version-2.0.1/blog.mdx @@ -76,7 +76,7 @@ The [front matter](./guides/markdown-features/markdown-features-intro.mdx#front- The blog's index page (by default, it is at `/blog`) is the _blog list page_, where all blog posts are collectively displayed. -Use the `{/*truncate*/}` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `{/*truncate*/}` will be part of the summary. For example: +Use the `` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `` will be part of the summary. For example: ```md --- @@ -87,7 +87,7 @@ All these will be part of the blog post summary. Even this. - + But anything from here on down will not be. diff --git a/website/versioned_docs/version-2.1.0/blog.mdx b/website/versioned_docs/version-2.1.0/blog.mdx index a59ff92e8c01..cc91a003249a 100644 --- a/website/versioned_docs/version-2.1.0/blog.mdx +++ b/website/versioned_docs/version-2.1.0/blog.mdx @@ -76,7 +76,7 @@ The [front matter](./guides/markdown-features/markdown-features-intro.mdx#front- The blog's index page (by default, it is at `/blog`) is the _blog list page_, where all blog posts are collectively displayed. -Use the `{/*truncate*/}` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `{/*truncate*/}` will be part of the summary. For example: +Use the `` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `` will be part of the summary. For example: ```md --- @@ -87,7 +87,7 @@ All these will be part of the blog post summary. Even this. - + But anything from here on down will not be. diff --git a/website/versioned_docs/version-2.2.0/blog.mdx b/website/versioned_docs/version-2.2.0/blog.mdx index a59ff92e8c01..cc91a003249a 100644 --- a/website/versioned_docs/version-2.2.0/blog.mdx +++ b/website/versioned_docs/version-2.2.0/blog.mdx @@ -76,7 +76,7 @@ The [front matter](./guides/markdown-features/markdown-features-intro.mdx#front- The blog's index page (by default, it is at `/blog`) is the _blog list page_, where all blog posts are collectively displayed. -Use the `{/*truncate*/}` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `{/*truncate*/}` will be part of the summary. For example: +Use the `` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `` will be part of the summary. For example: ```md --- @@ -87,7 +87,7 @@ All these will be part of the blog post summary. Even this. - + But anything from here on down will not be. From cad8f740c88398ba7b1585c3a6ce0cf4bffa4406 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 17:34:46 +0100 Subject: [PATCH 089/155] Add MDX comment truncation docs --- website/docs/blog.mdx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/website/docs/blog.mdx b/website/docs/blog.mdx index 9276a52c30b3..eb46012a10c9 100644 --- a/website/docs/blog.mdx +++ b/website/docs/blog.mdx @@ -76,24 +76,33 @@ The [front matter](./guides/markdown-features/markdown-features-intro.mdx#front- The blog's index page (by default, it is at `/blog`) is the _blog list page_, where all blog posts are collectively displayed. -Use the `{/*truncate*/}` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `{/*truncate*/}` will be part of the summary. For example: +Use the `` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `` will be part of the summary. For example: -```md +```md title="website/blog/my-post.md" --- -title: Truncation Example +title: Markdown blog truncation example --- All these will be part of the blog post summary. -Even this. - But anything from here on down will not be. +``` + +For files using the `.mdx` extension, use a [MDX](https://mdxjs.com/) comment `{/* truncate */}` instead: -Not this. +{/* prettier-ignore */} +```md title="website/blog/my-post.mdx" +--- +title: MDX blog truncation Example +--- -Or this. +All these will be part of the blog post summary. + +{/* truncate */} + +But anything from here on down will not be. ``` By default, 10 posts are shown on each blog list page, but you can control pagination with the `postsPerPage` option in the plugin configuration. If you set `postsPerPage: 'ALL'`, pagination will be disabled and all posts will be displayed on the first page. You can also add a meta description to the blog list page for better SEO: From 65eee401b24a9cf918b9e3380bfb9ef7d9f37110 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 17:37:48 +0100 Subject: [PATCH 090/155] Add MDX comment truncation docs --- website/docs/blog.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/blog.mdx b/website/docs/blog.mdx index eb46012a10c9..2148b30570df 100644 --- a/website/docs/blog.mdx +++ b/website/docs/blog.mdx @@ -78,7 +78,7 @@ The blog's index page (by default, it is at `/blog`) is the _blog list page_, wh Use the `` marker in your blog post to represent what will be shown as the summary when viewing all published blog posts. Anything above `` will be part of the summary. For example: -```md title="website/blog/my-post.md" +```md title="website/blog/my-post.md" {7} --- title: Markdown blog truncation example --- @@ -93,7 +93,7 @@ But anything from here on down will not be. For files using the `.mdx` extension, use a [MDX](https://mdxjs.com/) comment `{/* truncate */}` instead: {/* prettier-ignore */} -```md title="website/blog/my-post.mdx" +```md title="website/blog/my-post.mdx" {7} --- title: MDX blog truncation Example --- From 6e46b62ab4f0f8cea403f659071c2a0b066b037c Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 17:58:51 +0100 Subject: [PATCH 091/155] add remark-comment to support html comments like MDX 1 --- packages/docusaurus-mdx-loader/package.json | 1 + packages/docusaurus-mdx-loader/src/loader.ts | 2 ++ packages/docusaurus-mdx-loader/src/preprocessor.ts | 2 -- yarn.lock | 13 +++++++++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus-mdx-loader/package.json b/packages/docusaurus-mdx-loader/package.json index f079cb6155b5..316296dafa72 100644 --- a/packages/docusaurus-mdx-loader/package.json +++ b/packages/docusaurus-mdx-loader/package.json @@ -32,6 +32,7 @@ "image-size": "^1.0.2", "mdast-util-to-string": "^3.0.0", "mdast-util-mdx": "^2.0.0", + "remark-comment": "^1.0.0", "remark-gfm": "^3.0.1", "remark-directive": "^2.0.1", "remark-emoji": "^2.2.0", diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 75d104797845..e44f1be628e7 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -193,6 +193,7 @@ export async function mdxLoader( const {createProcessor} = await import('@mdx-js/mdx'); const {default: gfm} = await import('remark-gfm'); + const {default: comment} = await import('remark-comment'); const {frontMatter, content: contentWithTitle} = parseFrontMatter(fileString); const mdxFrontMatter = validateMDXFrontMatter(frontMatter.mdx); @@ -235,6 +236,7 @@ export async function mdxLoader( }, ], gfm, + comment, // TODO add this conditionally ...(reqOptions.remarkPlugins ?? []), ]; diff --git a/packages/docusaurus-mdx-loader/src/preprocessor.ts b/packages/docusaurus-mdx-loader/src/preprocessor.ts index 104a49c59074..c03c37b52c0f 100644 --- a/packages/docusaurus-mdx-loader/src/preprocessor.ts +++ b/packages/docusaurus-mdx-loader/src/preprocessor.ts @@ -23,7 +23,5 @@ export default function preprocessContent( const {keywords} = normalizeAdmonitionOptions(admonitions); md = admonitionTitleToDirectiveLabel(md, keywords); } - // TODO MDX 2 doesn't like our unescaped html comments < - md = md.replaceAll('/` | Truncate marker marking where the summary ends. | +| `truncateMarker` | `RegExp` | `/ | \{\/\*\s*truncate\s*\*\/\}/` | Truncate marker marking where the summary ends. | | `showReadingTime` | `boolean` | `true` | Show estimated reading time for the blog post. | | `readingTime` | `ReadingTimeFn` | The default reading time | A callback to customize the reading time number displayed. | | `authorsMapPath` | `string` | `'authors.yml'` | Path to the authors map file, relative to the blog content directory. | From 9295366ec4004e5b48a9d1f5de84b35e04c9e389 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 18:34:29 +0100 Subject: [PATCH 093/155] better comment --- .../docusaurus-theme-classic/src/theme/MDXContent/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx b/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx index 68524f319599..dfbf4c3f96c5 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -// @ts-expect-error: todo +// @ts-expect-error: TODO ESM import {MDXProvider} from '@mdx-js/react'; import MDXComponents from '@theme/MDXComponents'; import type {Props} from '@theme/MDXContent'; From e75e6021a53a8953232c8c757fdc026a0e3ded5b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 18:44:05 +0100 Subject: [PATCH 094/155] restore cspell comment --- project-words.txt | 2 -- website/docs/introduction.mdx | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/project-words.txt b/project-words.txt index fd26dd801075..7d60b7500a05 100644 --- a/project-words.txt +++ b/project-words.txt @@ -402,6 +402,4 @@ yangshunz zhou zoomable zpao -Yhyx -Sksg hastscript diff --git a/website/docs/introduction.mdx b/website/docs/introduction.mdx index a03b487c78b0..383563a61f19 100644 --- a/website/docs/introduction.mdx +++ b/website/docs/introduction.mdx @@ -50,6 +50,8 @@ Or read the **[5-minute tutorial](https://tutorial.docusaurus.io)** online. In this presentation at [Algolia Community Event](https://www.algolia.com/), [Meta Open Source team](https://opensource.facebook.com/) shared a brief walk-through of Docusaurus. They covered how to get started with the project, enable plugins, and set up functionalities like documentation and blogging. +{/* cSpell:ignore Yhyx Sksg */} + ```mdx-code-block import LiteYouTubeEmbed from 'react-lite-youtube-embed'; From 31cf3228e84fac6a36f6b2ca937880a9c089b3d9 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 19:07:08 +0100 Subject: [PATCH 095/155] remove useless mdx inline render logic --- .../src/theme/MDXComponents/Code.tsx | 48 +------------------ 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx index 6bf8f730eb86..dfe3a582d41b 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx @@ -10,51 +10,7 @@ import React, {isValidElement} from 'react'; import CodeBlock from '@theme/CodeBlock'; import type {Props} from '@theme/MDXComponents/Code'; +// Keep this component for now, might be useful to swizzle it? export default function MDXCode(props: Props): JSX.Element { - const inlineElements: (string | undefined)[] = [ - 'a', - 'abbr', - 'b', - 'br', - 'button', - 'cite', - 'code', - 'del', - 'dfn', - 'em', - 'i', - 'img', - 'input', - 'ins', - 'kbd', - 'label', - 'object', - 'output', - 'q', - 'ruby', - 's', - 'small', - 'span', - 'strong', - 'sub', - 'sup', - 'time', - 'u', - 'var', - 'wbr', - ]; - const shouldBeInline = React.Children.toArray(props.children).every( - (el) => - (typeof el === 'string' && !el.includes('\n')) || - (isValidElement(el) && - inlineElements.includes( - (el.props as {mdxType: string} | null)?.mdxType, - )), - ); - - return shouldBeInline ? ( - - ) : ( - )} /> - ); + return )} />; } From 2d3ff9bf32fa77e9ab3262be928a180024b27ade Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 19:10:37 +0100 Subject: [PATCH 096/155] restore code inline logic for inline code blocks --- .../src/theme/MDXComponents/Code.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx index dfe3a582d41b..e11436faf7ff 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx @@ -10,7 +10,14 @@ import React, {isValidElement} from 'react'; import CodeBlock from '@theme/CodeBlock'; import type {Props} from '@theme/MDXComponents/Code'; -// Keep this component for now, might be useful to swizzle it? export default function MDXCode(props: Props): JSX.Element { - return )} />; + const shouldBeInline = React.Children.toArray(props.children).every( + (el) => typeof el === 'string' && !el.includes('\n'), + ); + + return shouldBeInline ? ( + + ) : ( + )} /> + ); } From 44882e4ce17ef121b7ae3284c785772bac2117e7 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 6 Jan 2023 19:24:48 +0100 Subject: [PATCH 097/155] Simplify MDXPre, unneeded remove originalType --- .../src/remark/mdx1Compat/codeCompatPlugin.ts | 2 -- .../src/theme/MDXComponents/Pre.tsx | 18 +++++------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts b/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts index bf999968dfd1..688941d12c29 100644 --- a/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts +++ b/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts @@ -22,8 +22,6 @@ export default function codeCompatPlugin(this: Processor): Transformer { node.data = node.data || {}; node.data.hProperties = node.data.hProperties || {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any - (node.data.hProperties as any).originalType = 'code'; - // eslint-disable-next-line @typescript-eslint/no-explicit-any (node.data.hProperties as any).metastring = node.meta; }); }; diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Pre.tsx b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Pre.tsx index cde1899da83e..5012ecc7ff98 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Pre.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Pre.tsx @@ -5,19 +5,11 @@ * LICENSE file in the root directory of this source tree. */ -import React, {isValidElement} from 'react'; -import CodeBlock from '@theme/CodeBlock'; +import React, {type ReactNode} from 'react'; import type {Props} from '@theme/MDXComponents/Pre'; -export default function MDXPre(props: Props): JSX.Element { - return ( - - ); +export default function MDXPre(props: Props): ReactNode | undefined { + // With MDX 2, this element is only used for fenced code blocks + // It always receives a MDXComponents/Code as children + return props.children; } From 32b0f1aaa87f31ebe37048acf462e125cd6e6f25 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 20 Jan 2023 15:14:51 +0100 Subject: [PATCH 098/155] mdx2 pr should build all versions --- website/docusaurus.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 5a2114bc852c..28099753301c 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -313,6 +313,11 @@ const config = { lastVersion: isDev || isDeployPreview || isBranchDeploy ? 'current' : undefined, onlyIncludeVersions: (() => { + // TODO temporary for mdx2 PR + if (isDeployPreview) { + return undefined; + } + if (isBuildFast) { return ['current']; } else if ( From 6f6627a2c3ca8aa0d18a7be4c816a609923db759 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 20 Jan 2023 15:59:11 +0100 Subject: [PATCH 099/155] fix blog api table --- website/docs/api/plugins/plugin-content-blog.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/api/plugins/plugin-content-blog.mdx b/website/docs/api/plugins/plugin-content-blog.mdx index d8cdc470a10a..68c0515dfff8 100644 --- a/website/docs/api/plugins/plugin-content-blog.mdx +++ b/website/docs/api/plugins/plugin-content-blog.mdx @@ -38,7 +38,7 @@ Accepted fields: ``` | Name | Type | Default | Description | -| --- | --- | --- | --- | --- | +| --- | --- | --- | --- | | `path` | `string` | `'blog'` | Path to the blog content directory on the file system, relative to site dir. | | `editUrl` | string \| EditUrlFn | `undefined` | Base URL to edit your site. The final URL is computed by `editUrl + relativePostPath`. Using a function allows more nuanced control for each file. Omitting this variable entirely will disable edit links. | | `editLocalizedFiles` | `boolean` | `false` | The edit URL will target the localized file, instead of the original unlocalized file. Ignored when `editUrl` is a function. | @@ -61,7 +61,7 @@ Accepted fields: | `rehypePlugins` | `any[]` | `[]` | Rehype plugins passed to MDX. | | `beforeDefaultRemarkPlugins` | `any[]` | `[]` | Custom Remark plugins passed to MDX before the default Docusaurus Remark plugins. | | `beforeDefaultRehypePlugins` | `any[]` | `[]` | Custom Rehype plugins passed to MDX before the default Docusaurus Rehype plugins. | -| `truncateMarker` | `RegExp` | `/ | \{\/\*\s*truncate\s*\*\/\}/` | Truncate marker marking where the summary ends. | +| `truncateMarker` | `RegExp` | `//` \| `\{\/\*\s*truncate\s*\*\/\}/` | Truncate marker marking where the summary ends. | | `showReadingTime` | `boolean` | `true` | Show estimated reading time for the blog post. | | `readingTime` | `ReadingTimeFn` | The default reading time | A callback to customize the reading time number displayed. | | `authorsMapPath` | `string` | `'authors.yml'` | Path to the authors map file, relative to the blog content directory. | From 9c30f0f4f05af8597a22e07d9bd8b3491c9b303a Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 20 Jan 2023 19:14:07 +0100 Subject: [PATCH 100/155] make mdx2 deploy preview use same lastVersion as prod --- website/docusaurus.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 28099753301c..0fc1c9629d62 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -312,6 +312,9 @@ const config = { disableVersioning: isVersioningDisabled, lastVersion: isDev || isDeployPreview || isBranchDeploy ? 'current' : undefined, + + // TODO temporary for mdx2 PR + ...(isDeployPreview && {lastVersion: undefined}), onlyIncludeVersions: (() => { // TODO temporary for mdx2 PR if (isDeployPreview) { From d0ab202ff0ed4d3111fd3fbe0796f55ef3ba124f Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 3 Feb 2023 18:59:47 +0100 Subject: [PATCH 101/155] Fix 2.3.1 doc for MDX 2 --- .../version-2.3.1/api/docusaurus.config.js.mdx | 2 +- .../api/plugins/plugin-content-blog.mdx | 2 +- .../version-2.3.1/api/plugins/plugin-pwa.mdx | 2 +- .../version-2.3.1/api/themes/theme-classic.mdx | 2 ++ .../markdown-features-admonitions.mdx | 2 +- .../markdown-features-react.mdx | 18 ++++++++---------- .../markdown-features-tabs.mdx | 6 ++---- .../markdown-features-toc.mdx | 4 ++-- .../version-2.3.1/introduction.mdx | 15 ++------------- .../versioned_docs/version-2.3.1/search.mdx | 2 +- 10 files changed, 21 insertions(+), 34 deletions(-) diff --git a/website/versioned_docs/version-2.3.1/api/docusaurus.config.js.mdx b/website/versioned_docs/version-2.3.1/api/docusaurus.config.js.mdx index 052baa5b069b..0601b2e39ef7 100644 --- a/website/versioned_docs/version-2.3.1/api/docusaurus.config.js.mdx +++ b/website/versioned_docs/version-2.3.1/api/docusaurus.config.js.mdx @@ -123,7 +123,7 @@ The i18n configuration object to [localize your site](../i18n/i18n-introduction. Example: - +{/* cSpell:ignore فارسی */} ```js title="docusaurus.config.js" module.exports = { diff --git a/website/versioned_docs/version-2.3.1/api/plugins/plugin-content-blog.mdx b/website/versioned_docs/version-2.3.1/api/plugins/plugin-content-blog.mdx index b9677afcd8b7..e6ffc4d9b01c 100644 --- a/website/versioned_docs/version-2.3.1/api/plugins/plugin-content-blog.mdx +++ b/website/versioned_docs/version-2.3.1/api/plugins/plugin-content-blog.mdx @@ -69,7 +69,7 @@ Accepted fields: | `feedOptions.type` | FeedType \| FeedType[] \| 'all' \| null | **Required** | Type of feed to be generated. Use `null` to disable generation. | | `feedOptions.createFeedItems` | CreateFeedItemsFn \| undefined | `undefined` | An optional function which can be used to transform and / or filter the items in the feed. | | `feedOptions.title` | `string` | `siteConfig.title` | Title of the feed. | -| `feedOptions.description` | `string` | \`${siteConfig.title} Blog\` | Description of the feed. | +| `feedOptions.description` | `string` | \`$\{siteConfig.title} Blog\` | Description of the feed. | | `feedOptions.copyright` | `string` | `undefined` | Copyright message. | | `feedOptions.language` | `string` (See [documentation](http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes) for possible values) | `undefined` | Language metadata of the feed. | | `sortPosts` | 'descending' \| 'ascending' | `'descending'` | Governs the direction of blog post sorting. | diff --git a/website/versioned_docs/version-2.3.1/api/plugins/plugin-pwa.mdx b/website/versioned_docs/version-2.3.1/api/plugins/plugin-pwa.mdx index cbd7e3deaf05..a6f388c503e7 100644 --- a/website/versioned_docs/version-2.3.1/api/plugins/plugin-pwa.mdx +++ b/website/versioned_docs/version-2.3.1/api/plugins/plugin-pwa.mdx @@ -120,7 +120,7 @@ Strategies used to turn the offline mode on: - `appInstalled`: activates for users having installed the site as an app (not 100% reliable) - `standalone`: activates for users running the app as standalone (often the case once a PWA is installed) - `queryString`: activates if queryString contains `offlineMode=true` (convenient for PWA debugging) -- `mobile`: activates for mobile users (width <= 996px) +- `mobile`: activates for mobile users (width \<= 996px) - `saveData`: activates for users with `navigator.connection.saveData === true` - `always`: activates for all users diff --git a/website/versioned_docs/version-2.3.1/api/themes/theme-classic.mdx b/website/versioned_docs/version-2.3.1/api/themes/theme-classic.mdx index b2421dc98b4d..12d812affbea 100644 --- a/website/versioned_docs/version-2.3.1/api/themes/theme-classic.mdx +++ b/website/versioned_docs/version-2.3.1/api/themes/theme-classic.mdx @@ -3,6 +3,8 @@ sidebar_position: 2 slug: /api/themes/@docusaurus/theme-classic --- +import APITable from '@site/src/components/APITable'; + # 📦 theme-classic The classic theme for Docusaurus. diff --git a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx index f4c00f7c3f4a..0ea3e6b9075e 100644 --- a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx @@ -87,7 +87,7 @@ Some **content** with _Markdown_ `syntax`. Check [this `api`](#). If you use [Prettier](https://prettier.io) to format your Markdown files, Prettier might auto-format your code to invalid admonition syntax. To avoid this problem, add empty lines around the starting and ending directives. This is also why the examples we show here all have empty lines around the content. - +{/* prettier-ignore */} ```md :::note diff --git a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-react.mdx b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-react.mdx index a8d76f1067e9..ea6fbd9e4896 100644 --- a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-react.mdx +++ b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-react.mdx @@ -76,7 +76,7 @@ I can write **Markdown** alongside my _JSX_! Since all doc files are parsed using MDX, anything that looks like HTML is actually JSX. Therefore, if you need to inline-style a component, follow JSX flavor and provide style objects. - +{/* prettier-ignore */} ```jsx /* Instead of this: */ Foo @@ -94,7 +94,7 @@ In addition, MDX is not [100% compatible with CommonMark](https://github.com/fac You can also import your own components defined in other files or third-party components installed via npm. - +{/* prettier-ignore */} ```md import TOCInline from '@theme/TOCInline'; @@ -339,7 +339,7 @@ Use JSX within JSX tag, or move the Markdown to the outer layer:
``` - +{/* prettier-ignore */} ```jsx
**Bold still doesn't work** @@ -365,7 +365,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -395,7 +395,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -425,7 +425,7 @@ Don't indent:
``` - +{/* prettier-ignore */} ```jsx
@@ -461,14 +461,13 @@ npm install --save raw-loader Now you can import code snippets from another file as it is: - +{/* prettier-ignore */} ```jsx title="myMarkdownFile.mdx" import CodeBlock from '@theme/CodeBlock'; import MyComponentSource from '!!raw-loader!./myComponent'; {MyComponentSource} ``` - ```mdx-code-block import CodeBlock from '@theme/CodeBlock'; @@ -507,13 +506,12 @@ By convention, using the **`_` filename prefix** will not create any doc page an This is text some content from `_markdown-partial-example.mdx`. ``` - +{/* prettier-ignore */} ```jsx title="someOtherDoc.mdx" import PartialExample from './_markdown-partial-example.mdx'; ``` - ```mdx-code-block import PartialExample from './_markdown-partial-example.mdx'; diff --git a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-tabs.mdx b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-tabs.mdx index 948c61ef6757..4f9973d557a3 100644 --- a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-tabs.mdx +++ b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-tabs.mdx @@ -15,7 +15,7 @@ import styles from './markdown-features-tabs-styles.module.css'; Docusaurus provides the `` component that you can use in Markdown thanks to [MDX](./markdown-features-react.mdx): - +{/* prettier-ignore */} ```jsx import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -32,7 +32,6 @@ import TabItem from '@theme/TabItem'; ``` - ```mdx-code-block @@ -250,7 +249,7 @@ You might want to customize the appearance of a certain set of tabs. You can pas You can also customize each tab heading independently by using the `attributes` field. The extra props can be passed to the headings either through the `values` prop in `Tabs`, or props of each `TabItem`—in the same way as you declare `label`. - +{/* prettier-ignore */} ```jsx title="some-doc.mdx" import styles from './styles.module.css'; @@ -266,7 +265,6 @@ import styles from './styles.module.css'; ``` - ```css title="styles.module.css" .red { diff --git a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-toc.mdx b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-toc.mdx index 4b2857c4f7c1..b4e81fde834b 100644 --- a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-toc.mdx +++ b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-toc.mdx @@ -102,7 +102,7 @@ It is also possible to display an inline table of contents directly inside a Mar The `toc` variable is available in any MDX document and contains all the headings of an MDX document. By default, only `h2` and `h3` headings are displayed in the TOC. You can change which heading levels are visible by setting `minHeadingLevel` or `maxHeadingLevel` for individual `TOCInline` components. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; @@ -129,7 +129,7 @@ declare const toc: { Note that the `toc` global is a flat array, so you can easily cut out unwanted nodes or insert extra nodes, and create a new TOC tree. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; diff --git a/website/versioned_docs/version-2.3.1/introduction.mdx b/website/versioned_docs/version-2.3.1/introduction.mdx index 46b616c7d5d6..2aeeba0948a8 100644 --- a/website/versioned_docs/version-2.3.1/introduction.mdx +++ b/website/versioned_docs/version-2.3.1/introduction.mdx @@ -53,9 +53,10 @@ In this presentation at [Algolia Community Event](https://www.algolia.com/), [Me ```mdx-code-block import LiteYouTubeEmbed from 'react-lite-youtube-embed'; +{/* cSpell:ignore Yhyx Sksg */} +
- ## Comparison with other tools {#comparison-with-other-tools} Across all static site generators, Docusaurus has a unique focus on documentation sites and has many out-of-the-box features. diff --git a/website/versioned_docs/version-2.3.1/search.mdx b/website/versioned_docs/version-2.3.1/search.mdx index 32fdcd7f6850..78f785bca0cb 100644 --- a/website/versioned_docs/version-2.3.1/search.mdx +++ b/website/versioned_docs/version-2.3.1/search.mdx @@ -247,7 +247,7 @@ Still, you can reuse the [Infima CSS variables](styling-layout.mdx#styling-your- ### Customizing the Algolia search behavior {#customizing-the-algolia-search-behavior} - +{/* TODO: update options link once the documentation is available on the DocSearch website */} Algolia DocSearch supports a [list of options](https://autocomplete-experimental.netlify.app/docs/DocSearchModal#reference) that you can pass to the `algolia` field in the `docusaurus.config.js` file. From 491f3ef2b1b3a9183c723b96515ac0cfb5e886d4 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 24 Feb 2023 18:40:29 +0100 Subject: [PATCH 102/155] merge lockfile --- yarn.lock | 551 +++++++++++++++++++++++++++--------------------------- 1 file changed, 276 insertions(+), 275 deletions(-) diff --git a/yarn.lock b/yarn.lock index 68b0f6304ad0..7ba3748ab306 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2984,6 +2984,21 @@ os-homedir "^1.0.1" regexpu-core "^4.5.4" +"@pnpm/network.ca-file@^1.0.1": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz#2ab05e09c1af0cdf2fcf5035bea1484e222f7983" + integrity sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA== + dependencies: + graceful-fs "4.2.10" + +"@pnpm/npm-conf@^1.0.4": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@pnpm/npm-conf/-/npm-conf-1.0.5.tgz#3475541fb71d7b6ce68acaaa3392eae9fedf3276" + integrity sha512-hD8ml183638O3R6/Txrh0L8VzGOrFXgRtRDG4qQC4tONdZ5Z1M+tlUUDUvrjYdmK6G+JTBTeaCLMna11cXzi8A== + dependencies: + "@pnpm/network.ca-file" "^1.0.1" + config-chain "^1.1.11" + "@polka/url@^1.0.0-next.20": version "1.0.0-next.21" resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" @@ -3053,10 +3068,10 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA== -"@sindresorhus/is@^0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" - integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== +"@sindresorhus/is@^5.2.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-5.3.0.tgz#0ec9264cf54a527671d990eb874e030b55b70dcc" + integrity sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw== "@sinonjs/commons@^1.7.0": version "1.8.6" @@ -3289,12 +3304,12 @@ "@jest/create-cache-key-function" "^27.4.2" jsonc-parser "^3.2.0" -"@szmarczak/http-timer@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" - integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== +"@szmarczak/http-timer@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-5.0.1.tgz#c7c1bf1141cdd4751b0399c8fc7b8b664cd5be3a" + integrity sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw== dependencies: - defer-to-connect "^1.0.1" + defer-to-connect "^2.0.1" "@testing-library/react-hooks@^8.0.1": version "8.0.1" @@ -3591,6 +3606,11 @@ "@types/tapable" "^1" "@types/webpack" "^4" +"@types/http-cache-semantics@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" + integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== + "@types/http-proxy@^1.17.5", "@types/http-proxy@^1.17.8": version "1.17.9" resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.9.tgz#7f0e7931343761efde1e2bf48c40f02f3f75705a" @@ -3988,13 +4008,13 @@ resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== -"@types/update-notifier@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/update-notifier/-/update-notifier-5.1.0.tgz#52ed6a2e9851fd6f1c88e93c85e8a0e1d5500fda" - integrity sha512-aGY5pH1Q/DcToKXl4MCj1c0uDUB+zSVFDRCI7Q7js5sguzBTqJV/5kJA2awofbtWYF3xnon1TYdZYnFditRPtQ== +"@types/update-notifier@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@types/update-notifier/-/update-notifier-6.0.2.tgz#19f60ebbb2b437d9fc971b032f7c625892c716ec" + integrity sha512-/OKZaYpzHqBO9D+IzqAB7VfC/fx+xl/CM1upD6D56QPNyvAsFULAVLfjlBIGCl1ibU1rKqZV45xOj018WqHhlA== dependencies: "@types/configstore" "*" - boxen "^4.2.0" + boxen "^7.0.0" "@types/wait-on@^5.3.1": version "5.3.1" @@ -4473,7 +4493,7 @@ algoliasearch@^4.0.0, algoliasearch@^4.14.3: "@algolia/requester-node-http" "4.14.3" "@algolia/transporter" "4.14.3" -ansi-align@^3.0.0, ansi-align@^3.0.1: +ansi-align@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== @@ -4991,34 +5011,6 @@ boolbase@^1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww== -boxen@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" - integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ== - dependencies: - ansi-align "^3.0.0" - camelcase "^5.3.1" - chalk "^3.0.0" - cli-boxes "^2.2.0" - string-width "^4.1.0" - term-size "^2.1.0" - type-fest "^0.8.1" - widest-line "^3.1.0" - -boxen@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" - integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== - dependencies: - ansi-align "^3.0.0" - camelcase "^6.2.0" - chalk "^4.1.0" - cli-boxes "^2.2.1" - string-width "^4.2.2" - type-fest "^0.20.2" - widest-line "^3.1.0" - wrap-ansi "^7.0.0" - boxen@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/boxen/-/boxen-6.2.1.tgz#b098a2278b2cd2845deef2dff2efc38d329b434d" @@ -5033,6 +5025,20 @@ boxen@^6.2.1: widest-line "^4.0.1" wrap-ansi "^8.0.1" +boxen@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-7.0.1.tgz#cd84db4364a8bae65f1f016ce94a21ec2c832c16" + integrity sha512-8k2eH6SRAK00NDl1iX5q17RJ8rfl53TajdYxE3ssMLehbg487dEVgsad4pIsZb/QqBgYWIl6JOauMTLGX2Kpkw== + dependencies: + ansi-align "^3.0.1" + camelcase "^7.0.0" + chalk "^5.0.1" + cli-boxes "^3.0.0" + string-width "^5.1.2" + type-fest "^2.13.0" + widest-line "^4.0.1" + wrap-ansi "^8.0.1" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -5192,18 +5198,23 @@ cacache@^16.0.0, cacache@^16.0.6, cacache@^16.1.0: tar "^6.1.11" unique-filename "^2.0.0" -cacheable-request@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" - integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== +cacheable-lookup@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz#3476a8215d046e5a3202a9209dd13fec1f933a27" + integrity sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w== + +cacheable-request@^10.2.1: + version "10.2.8" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-10.2.8.tgz#899ae6c0c8c7127f263b2005ecaac07c95124079" + integrity sha512-IDVO5MJ4LItE6HKFQTqT2ocAQsisOoCTUDu1ddCmnhyiwFQjXNPp4081Xj23N4tO+AFEFNzGuNEf/c8Gwwt15A== dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^3.0.0" - lowercase-keys "^2.0.0" - normalize-url "^4.1.0" - responselike "^1.0.2" + "@types/http-cache-semantics" "^4.0.1" + get-stream "^6.0.1" + http-cache-semantics "^4.1.1" + keyv "^4.5.2" + mimic-response "^4.0.0" + normalize-url "^8.0.0" + responselike "^3.0.0" call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" @@ -5250,6 +5261,11 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== +camelcase@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-7.0.1.tgz#f02e50af9fd7782bc8b88a3558c32fd3a388f048" + integrity sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw== + caniuse-api@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0" @@ -5299,14 +5315,6 @@ chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -5315,6 +5323,11 @@ chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^5.0.1: + version "5.2.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.2.0.tgz#249623b7d66869c673699fb66d65723e54dfcfb3" + integrity sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA== + char-regex@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" @@ -5462,11 +5475,6 @@ clear-module@^4.1.2: parent-module "^2.0.0" resolve-from "^5.0.0" -cli-boxes@^2.2.0, cli-boxes@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" - integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== - cli-boxes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-3.0.0.tgz#71a10c716feeba005e4504f36329ef0b17cf3145" @@ -5558,13 +5566,6 @@ clone-deep@^4.0.1: kind-of "^6.0.2" shallow-clone "^3.0.0" -clone-response@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" - integrity sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA== - dependencies: - mimic-response "^1.0.0" - clone@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" @@ -5796,7 +5797,7 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" -config-chain@^1.1.12: +config-chain@^1.1.11, config-chain@^1.1.12: version "1.1.13" resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4" integrity sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ== @@ -5816,6 +5817,17 @@ configstore@^5.0.1: write-file-atomic "^3.0.0" xdg-basedir "^4.0.0" +configstore@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-6.0.0.tgz#49eca2ebc80983f77e09394a1a56e0aca8235566" + integrity sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA== + dependencies: + dot-prop "^6.0.1" + graceful-fs "^4.2.6" + unique-string "^3.0.0" + write-file-atomic "^3.0.3" + xdg-basedir "^5.0.1" + confusing-browser-globals@^1.0.10: version "1.0.11" resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" @@ -6075,6 +6087,13 @@ crypto-random-string@^2.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== +crypto-random-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-4.0.0.tgz#5a3cc53d7dd86183df5da0312816ceeeb5bb1fc2" + integrity sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA== + dependencies: + type-fest "^1.0.1" + cspell-dictionary@6.18.1: version "6.18.1" resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-6.18.1.tgz#e5fd68c9fe5ff721812b209e23b88f5c7b7e1bd2" @@ -6669,13 +6688,6 @@ decode-named-character-reference@^1.0.0: dependencies: character-entities "^2.0.0" -decompress-response@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA== - dependencies: - mimic-response "^1.0.0" - decompress-response@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" @@ -6750,10 +6762,10 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -defer-to-connect@^1.0.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" - integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== +defer-to-connect@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" + integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== define-lazy-prop@^2.0.0: version "2.0.0" @@ -7032,11 +7044,6 @@ duplexer2@~0.1.4: dependencies: readable-stream "^2.0.2" -duplexer3@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.5.tgz#0b5e4d7bad5de8901ea4440624c8e1d20099217e" - integrity sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA== - duplexer@^0.1.1, duplexer@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" @@ -7250,10 +7257,10 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-goat@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" - integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q== +escape-goat@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-4.0.0.tgz#9424820331b510b0666b98f7873fe11ac4aa8081" + integrity sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg== escape-html@^1.0.3, escape-html@~1.0.3: version "1.0.3" @@ -8033,6 +8040,11 @@ fork-ts-checker-webpack-plugin@^6.5.0: semver "^7.3.2" tapable "^1.0.0" +form-data-encoder@^2.1.2: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-2.1.4.tgz#261ea35d2a70d48d30ec7a9603130fa5515e9cd5" + integrity sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw== + form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -8217,20 +8229,6 @@ get-stdin@^8.0.0: resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== -get-stream@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - get-stream@^6.0.0, get-stream@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" @@ -8441,24 +8439,24 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -got@^9.6.0: - version "9.6.0" - resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" - integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== - dependencies: - "@sindresorhus/is" "^0.14.0" - "@szmarczak/http-timer" "^1.1.2" - cacheable-request "^6.0.0" - decompress-response "^3.3.0" - duplexer3 "^0.1.4" - get-stream "^4.1.0" - lowercase-keys "^1.0.1" - mimic-response "^1.0.1" - p-cancelable "^1.0.0" - to-readable-stream "^1.0.0" - url-parse-lax "^3.0.0" - -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: +got@^12.1.0: + version "12.5.3" + resolved "https://registry.yarnpkg.com/got/-/got-12.5.3.tgz#82bdca2dd61258a02e24d668ea6e7abb70ac3598" + integrity sha512-8wKnb9MGU8IPGRIo+/ukTy9XLJBwDiCpIf5TVzQ9Cpol50eMTpBq2GAuDsuDIz7hTYmZgMgC1e9ydr6kSDWs3w== + dependencies: + "@sindresorhus/is" "^5.2.0" + "@szmarczak/http-timer" "^5.0.1" + cacheable-lookup "^7.0.0" + cacheable-request "^10.2.1" + decompress-response "^6.0.0" + form-data-encoder "^2.1.2" + get-stream "^6.0.1" + http2-wrapper "^2.1.10" + lowercase-keys "^3.0.0" + p-cancelable "^3.0.0" + responselike "^3.0.0" + +graceful-fs@4.2.10, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -8556,10 +8554,10 @@ has-unicode@^2.0.1: resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== -has-yarn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77" - integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw== +has-yarn@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-3.0.0.tgz#c3c21e559730d1d3b57e28af1f30d06fac38147d" + integrity sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA== has@^1.0.3: version "1.0.3" @@ -8852,7 +8850,7 @@ htmlparser2@^8.0.1: domutils "^3.0.1" entities "^4.3.0" -http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0: +http-cache-semantics@^4.1.0, http-cache-semantics@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== @@ -8937,6 +8935,14 @@ http-proxy@^1.18.1: follow-redirects "^1.0.0" requires-port "^1.0.0" +http2-wrapper@^2.1.10: + version "2.2.0" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-2.2.0.tgz#b80ad199d216b7d3680195077bd7b9060fa9d7f3" + integrity sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.2.0" + https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" @@ -9028,11 +9034,6 @@ import-fresh@^3.0.0, import-fresh@^3.1.0, import-fresh@^3.2.1, import-fresh@^3.3 parent-module "^1.0.0" resolve-from "^4.0.0" -import-lazy@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" - integrity sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A== - import-lazy@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153" @@ -9061,10 +9062,10 @@ infer-owner@^1.0.4: resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== -infima@0.2.0-alpha.42: - version "0.2.0-alpha.42" - resolved "https://registry.yarnpkg.com/infima/-/infima-0.2.0-alpha.42.tgz#f6e86a655ad40877c6b4d11b2ede681eb5470aa5" - integrity sha512-ift8OXNbQQwtbIt6z16KnSWP7uJ/SysSMFI4F87MNRTicypfl4Pv3E2OGVv6N3nSZFJvA8imYulCBS64iyHYww== +infima@0.2.0-alpha.43: + version "0.2.0-alpha.43" + resolved "https://registry.yarnpkg.com/infima/-/infima-0.2.0-alpha.43.tgz#f7aa1d7b30b6c08afef441c726bac6150228cbe0" + integrity sha512-2uw57LvUqW0rK/SWYnd/2rRfxNA5DDNOh33jxF7fy46VWoNhGxiUQyVZHbBMjQ33mQem0cjdDVwgWVAmlRfgyQ== inflight@^1.0.4: version "1.0.6" @@ -9271,6 +9272,13 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" +is-ci@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.1.tgz#db6ecbed1bd659c43dac0f45661e7674103d1867" + integrity sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ== + dependencies: + ci-info "^3.2.0" + is-core-module@^2.5.0, is-core-module@^2.8.1, is-core-module@^2.9.0: version "2.11.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" @@ -9375,10 +9383,10 @@ is-negative-zero@^2.0.2: resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== -is-npm@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-5.0.0.tgz#43e8d65cc56e1b67f8d47262cf667099193f45a8" - integrity sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA== +is-npm@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-6.0.0.tgz#b59e75e8915543ca5d881ecff864077cba095261" + integrity sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ== is-number-object@^1.0.4: version "1.0.7" @@ -9587,10 +9595,10 @@ is-wsl@^2.2.0: dependencies: is-docker "^2.0.0" -is-yarn-global@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" - integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== +is-yarn-global@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.4.1.tgz#b312d902b313f81e4eaf98b6361ba2b45cd694bb" + integrity sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ== isarray@0.0.1: version "0.0.1" @@ -10185,10 +10193,10 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== -json-buffer@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ== +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== json-parse-better-errors@^1.0.1: version "1.0.2" @@ -10303,12 +10311,12 @@ kebab-case@^1.0.0: resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.2.tgz#5eac97d5d220acf606d40e3c0ecfea21f1f9e1eb" integrity sha512-7n6wXq4gNgBELfDCpzKc+mRrZFs7D+wgfF5WRFLNAr4DA/qtr9Js8uOAVAfHhuLMfAcQ0pRKqbpjx+TcJVdE1Q== -keyv@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" - integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== +keyv@^4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.2.tgz#0e310ce73bf7851ec702f2eaf46ec4e3805cce56" + integrity sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g== dependencies: - json-buffer "3.0.0" + json-buffer "3.0.1" khroma@^2.0.0: version "2.0.0" @@ -10352,12 +10360,12 @@ language-tags@=1.0.5: dependencies: language-subtag-registry "~0.3.2" -latest-version@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" - integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA== +latest-version@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-7.0.0.tgz#843201591ea81a4d404932eeb61240fe04e9e5da" + integrity sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg== dependencies: - package-json "^6.3.0" + package-json "^8.1.0" lerna-changelog@^2.2.0: version "2.2.0" @@ -10660,15 +10668,10 @@ lower-case@^2.0.2: dependencies: tslib "^2.0.3" -lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" - integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== - -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lowercase-keys@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-3.0.0.tgz#c5e7d442e37ead247ae9db117a9d0a467c89d4f2" + integrity sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ== lru-cache@^5.1.1: version "5.1.1" @@ -11567,16 +11570,16 @@ mimic-fn@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== -mimic-response@^1.0.0, mimic-response@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - mimic-response@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== +mimic-response@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-4.0.0.tgz#35468b19e7c75d10f5165ea25e75a5ceea7cf70f" + integrity sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg== + min-indent@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" @@ -12009,16 +12012,16 @@ normalize-range@^0.1.2: resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" integrity sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA== -normalize-url@^4.1.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" - integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== - normalize-url@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== +normalize-url@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-8.0.0.tgz#593dbd284f743e8dcf6a5ddf8fadff149c82701a" + integrity sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw== + npm-bundled@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.2.tgz#944c78789bd739035b70baa2ca5cc32b8d860bc1" @@ -12131,10 +12134,10 @@ npm-run-path@^5.1.0: dependencies: path-key "^4.0.0" -npm-to-yarn@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/npm-to-yarn/-/npm-to-yarn-1.2.1.tgz#ee88854d03ac930510c28a621985d800b51e76e0" - integrity sha512-ci3GjP40SKgZL2OOVW6B1z/3LdLNBsEtJupkYC/NQ8/Y0grfZZNNsR5DQdoy7zgL+FsKIXtnxMgrDjoMoJ40zQ== +npm-to-yarn@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/npm-to-yarn/-/npm-to-yarn-2.0.0.tgz#59c9c615eca3ba8920308a0b418007b73ffc7492" + integrity sha512-/IbjiJ7vqbxfxJxAZ+QI9CCRjnIbvGxn5KQcSY9xHh0lMKc/Sgqmm7yp7KPmd6TiTZX5/KiSBKlkGHo59ucZbg== npmlog@^6.0.0, npmlog@^6.0.2: version "6.0.2" @@ -12373,10 +12376,10 @@ os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== -p-cancelable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" - integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== +p-cancelable@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-3.0.0.tgz#63826694b54d61ca1c20ebcb6d3ecf5e14cd8050" + integrity sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw== p-finally@^1.0.0: version "1.0.0" @@ -12501,15 +12504,15 @@ p-waterfall@^2.1.1: dependencies: p-reduce "^2.0.0" -package-json@^6.3.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0" - integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ== +package-json@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-8.1.0.tgz#2a22806f1ed7c786c8e6ff26cfe20003bf4c6850" + integrity sha512-hySwcV8RAWeAfPsXb9/HGSPn8lwDnv6fabH+obUZKX169QknRkRhPxd1yMubpKDskLFATkl3jHpNtVtDPFA0Wg== dependencies: - got "^9.6.0" - registry-auth-token "^4.0.0" - registry-url "^5.0.0" - semver "^6.2.0" + got "^12.1.0" + registry-auth-token "^5.0.1" + registry-url "^6.0.0" + semver "^7.3.7" pacote@^13.0.3, pacote@^13.6.1: version "13.6.2" @@ -13179,11 +13182,6 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== -prepend-http@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA== - prettier@^2.8.2: version "2.8.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.2.tgz#c4ea1b5b454d7c4b59966db2e06ed7eec5dfd160" @@ -13353,12 +13351,12 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.2.0.tgz#2092cc57cd2582c38e4e7e8bb869dc8d3148bc74" integrity sha512-LN6QV1IJ9ZhxWTNdktaPClrNfp8xdSAYS0Zk2ddX7XsXZAxckMHPCBcHRo0cTcEIgYPRiGEkmji3Idkh2yFtYw== -pupa@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62" - integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A== +pupa@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/pupa/-/pupa-3.1.0.tgz#f15610274376bbcc70c9a3aa8b505ea23f41c579" + integrity sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug== dependencies: - escape-goat "^2.0.0" + escape-goat "^4.0.0" pure-color@^1.2.0: version "1.3.0" @@ -13410,6 +13408,11 @@ quick-lru@^4.0.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -13445,7 +13448,7 @@ raw-loader@^4.0.2: loader-utils "^2.0.0" schema-utils "^3.0.0" -rc@1.2.8, rc@^1.2.7, rc@^1.2.8: +rc@1.2.8, rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -13934,19 +13937,19 @@ regexpu-core@^5.2.1: unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.1.0" -registry-auth-token@^4.0.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.2.tgz#f02d49c3668884612ca031419491a13539e21fac" - integrity sha512-PC5ZysNb42zpFME6D/XlIgtNGdTl8bBOCw90xQLVMpzuuubJKYDWFAEuUNc+Cn8Z8724tg2SDhDRrkVEsqfDMg== +registry-auth-token@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-5.0.1.tgz#5e6cd106e6c251135a046650c58476fc03e92833" + integrity sha512-UfxVOj8seK1yaIOiieV4FIP01vfBDLsY0H9sQzi9EbbUdJiuuBjJgLa1DpImXMNPnVkBD4eVxTEXcrZA6kfpJA== dependencies: - rc "1.2.8" + "@pnpm/npm-conf" "^1.0.4" -registry-url@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009" - integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw== +registry-url@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-6.0.1.tgz#056d9343680f2f64400032b1e199faa692286c58" + integrity sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q== dependencies: - rc "^1.2.8" + rc "1.2.8" regjsgen@^0.5.2: version "0.5.2" @@ -14195,6 +14198,11 @@ requires-port@^1.0.0: resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== +resolve-alpn@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" + integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -14247,12 +14255,12 @@ resolve@^2.0.0-next.3: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -responselike@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ== +responselike@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-3.0.0.tgz#20decb6c298aff0dbee1c355ca95461d42823626" + integrity sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg== dependencies: - lowercase-keys "^1.0.0" + lowercase-keys "^3.0.0" restore-cursor@^3.1.0: version "3.1.0" @@ -14472,12 +14480,12 @@ selfsigned@^2.1.1: dependencies: node-forge "^1" -semver-diff@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b" - integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg== +semver-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-4.0.0.tgz#3afcf5ed6d62259f5c72d0d5d50dffbdc9680df5" + integrity sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA== dependencies: - semver "^6.3.0" + semver "^7.3.5" "semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0: version "5.7.1" @@ -14491,7 +14499,7 @@ semver@7.3.4: dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -14991,7 +14999,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -15000,7 +15008,7 @@ string-length@^4.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@^5.0.0, string-width@^5.0.1: +string-width@^5.0.0, string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== @@ -15412,11 +15420,6 @@ tempy@^0.6.0: type-fest "^0.16.0" unique-string "^2.0.0" -term-size@^2.1.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54" - integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg== - terser-webpack-plugin@^5.1.3, terser-webpack-plugin@^5.3.6: version "5.3.6" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz#5590aec31aa3c6f771ce1b1acca60639eab3195c" @@ -15537,11 +15540,6 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== -to-readable-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" - integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -15742,7 +15740,12 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -type-fest@^2.5.0: +type-fest@^1.0.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" + integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== + +type-fest@^2.13.0, type-fest@^2.5.0: version "2.19.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b" integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA== @@ -15899,6 +15902,13 @@ unique-string@^2.0.0: dependencies: crypto-random-string "^2.0.0" +unique-string@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-3.0.0.tgz#84a1c377aff5fd7a8bc6b55d8244b2bd90d75b9a" + integrity sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ== + dependencies: + crypto-random-string "^4.0.0" + unist-builder@^2.0.0, unist-builder@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" @@ -16082,25 +16092,25 @@ update-browserslist-db@^1.0.9: escalade "^3.1.1" picocolors "^1.0.0" -update-notifier@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-5.1.0.tgz#4ab0d7c7f36a231dd7316cf7729313f0214d9ad9" - integrity sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw== +update-notifier@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-6.0.2.tgz#a6990253dfe6d5a02bd04fbb6a61543f55026b60" + integrity sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og== dependencies: - boxen "^5.0.0" - chalk "^4.1.0" - configstore "^5.0.1" - has-yarn "^2.1.0" - import-lazy "^2.1.0" - is-ci "^2.0.0" + boxen "^7.0.0" + chalk "^5.0.1" + configstore "^6.0.0" + has-yarn "^3.0.0" + import-lazy "^4.0.0" + is-ci "^3.0.1" is-installed-globally "^0.4.0" - is-npm "^5.0.0" - is-yarn-global "^0.3.0" - latest-version "^5.1.0" - pupa "^2.1.1" - semver "^7.3.4" - semver-diff "^3.1.1" - xdg-basedir "^4.0.0" + is-npm "^6.0.0" + is-yarn-global "^0.4.0" + latest-version "^7.0.0" + pupa "^3.1.0" + semver "^7.3.7" + semver-diff "^4.0.0" + xdg-basedir "^5.1.0" uri-js@^4.2.2: version "4.4.1" @@ -16118,13 +16128,6 @@ url-loader@^4.1.1: mime-types "^2.1.27" schema-utils "^3.0.0" -url-parse-lax@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ== - dependencies: - prepend-http "^2.0.0" - url-parse@^1.5.3: version "1.5.10" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" @@ -16608,13 +16611,6 @@ wide-align@^1.1.5: dependencies: string-width "^1.0.2 || 2 || 3 || 4" -widest-line@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" - integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== - dependencies: - string-width "^4.0.0" - widest-line@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-4.0.1.tgz#a0fc673aaba1ea6f0a0d35b3c2795c9a9cc2ebf2" @@ -16836,7 +16832,7 @@ write-file-atomic@^2.3.0, write-file-atomic@^2.4.2: imurmurhash "^0.1.4" signal-exit "^3.0.2" -write-file-atomic@^3.0.0: +write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== @@ -16902,6 +16898,11 @@ xdg-basedir@^4.0.0: resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== +xdg-basedir@^5.0.1, xdg-basedir@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-5.1.0.tgz#1efba19425e73be1bc6f2a6ceb52a3d2c884c0c9" + integrity sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ== + xml-js@^1.6.11: version "1.6.11" resolved "https://registry.yarnpkg.com/xml-js/-/xml-js-1.6.11.tgz#927d2f6947f7f1c19a316dd8eea3614e8b18f8e9" From 6094a997e29802269ebbfd8a272b2e4307eaa31a Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 24 Feb 2023 18:46:47 +0100 Subject: [PATCH 103/155] merge npm2yarn plugin changes, adapted for MDX 2 --- .../__snapshots__/index.test.ts.snap | 199 +++++++++++++++++- .../src/__tests__/index.test.ts | 33 ++- .../src/index.ts | 120 ++++++----- 3 files changed, 296 insertions(+), 56 deletions(-) diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap index f8f5d748ea70..cc56925b1cfd 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap @@ -15,7 +15,13 @@ import TabItem from '@theme/TabItem' \`\`\`bash - $ yarn add --global docusaurus + $ yarn global add docusaurus + \`\`\` + + + + \`\`\`bash + $ pnpm add --global docusaurus \`\`\` @@ -33,6 +39,12 @@ import TabItem from '@theme/TabItem' yarn install \`\`\` + + + \`\`\`bash + pnpm install + \`\`\` +
@@ -54,6 +66,12 @@ echo "no npm2yarn here" yarn add @docusaurus/core \`\`\` + + + \`\`\`bash + yarn add @docusaurus/core + \`\`\` + " `; @@ -72,7 +90,13 @@ import TabItem from '@theme/TabItem'; \`\`\`bash - $ yarn add --global docusaurus + $ yarn global add docusaurus + \`\`\` + + + + \`\`\`bash + $ pnpm add --global docusaurus \`\`\` @@ -89,7 +113,13 @@ exports[`npm2yarn plugin does not re-import tabs components when already importe \`\`\`bash - $ yarn add --global docusaurus + $ yarn global add docusaurus + \`\`\` + + + + \`\`\`bash + $ pnpm add --global docusaurus \`\`\` @@ -115,6 +145,54 @@ npm install --save docusaurus-plugin-name " `; +exports[`npm2yarn plugin work with pnpm converter 1`] = ` +"import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +## Installing a plugin + +A plugin is usually a npm package, so you install them like other npm packages using npm. + + + + \`\`\`bash + npm install --save docusaurus-plugin-name + \`\`\` + + + + \`\`\`bash + pnpm add docusaurus-plugin-name + \`\`\` + + +" +`; + +exports[`npm2yarn plugin work with yarn converter 1`] = ` +"import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +## Installing a plugin + +A plugin is usually a npm package, so you install them like other npm packages using npm. + + + + \`\`\`bash + npm install --save docusaurus-plugin-name + \`\`\` + + + + \`\`\`bash + yarn add docusaurus-plugin-name + \`\`\` + + +" +`; + exports[`npm2yarn plugin works on installation file 1`] = ` "import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' @@ -128,7 +206,13 @@ import TabItem from '@theme/TabItem' \`\`\`bash - $ yarn add --global docusaurus + $ yarn global add docusaurus + \`\`\` + + + + \`\`\`bash + $ pnpm add --global docusaurus \`\`\` @@ -155,6 +239,101 @@ A plugin is usually a npm package, so you install them like other npm packages u yarn add docusaurus-plugin-name \`\`\` + + + \`\`\`bash + pnpm add docusaurus-plugin-name + \`\`\` + + +" +`; + +exports[`npm2yarn plugin works with common commands 1`] = ` +"import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + + + + \`\`\`bash + npm run xxx -- --arg + \`\`\` + + + + \`\`\`bash + yarn xxx --arg + \`\`\` + + + + \`\`\`bash + pnpm run xxx -- --arg + \`\`\` + + + + + + \`\`\`bash + npm install package + \`\`\` + + + + \`\`\`bash + yarn add package + \`\`\` + + + + \`\`\`bash + pnpm add package + \`\`\` + + + + + + \`\`\`bash + npm remove package-name + \`\`\` + + + + \`\`\`bash + yarn remove package-name + \`\`\` + + + + \`\`\`bash + pnpm remove package-name + \`\`\` + + + + + + \`\`\`bash + npm init docusaurus + npm init docusaurus@latest my-website classic + \`\`\` + + + + \`\`\`bash + yarn create docusaurus + yarn create docusaurus@latest my-website classic + \`\`\` + + + + \`\`\`bash + pnpm create docusaurus + pnpm create docusaurus@latest my-website classic + \`\`\` + " `; @@ -179,6 +358,12 @@ Hey yarn add test \`\`\` + + + \`\`\`bash + pnpm add test + \`\`\` + " `; @@ -203,6 +388,12 @@ A plugin is usually a npm package, so you install them like other npm packages u yarn add docusaurus-plugin-name \`\`\` + + + \`\`\`bash + pnpm add docusaurus-plugin-name + \`\`\` + " `; diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts index 36e086b10c74..d4d2f5875519 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts @@ -10,7 +10,10 @@ import vfile from 'to-vfile'; import dedent from 'dedent'; import npm2yarn from '../index'; -const process = async (content: any, options?: {sync?: boolean}) => { +const process = async ( + content: any, + options?: Parameters[0], +) => { const {remark} = await import('remark'); const {default: mdx} = await import('remark-mdx'); @@ -22,7 +25,10 @@ const process = async (content: any, options?: {sync?: boolean}) => { return result.value; }; -const processFixture = async (name: string, options?: {sync?: boolean}) => { +const processFixture = async ( + name: string, + options?: Parameters[0], +) => { const filePath = path.join(__dirname, '__fixtures__', `${name}.md`); const file = await vfile.read(filePath); return process(file, options); @@ -56,6 +62,12 @@ describe('npm2yarn plugin', () => { expect(result).toMatchSnapshot(); }); + it('works with common commands', async () => { + const result = await processFixture('conversion-test', {sync: true}); + + expect(result).toMatchSnapshot(); + }); + it('works with sync option', async () => { const result = await processFixture('plugin', {sync: true}); @@ -82,7 +94,24 @@ describe('npm2yarn plugin', () => { it('does not re-import tabs components real-world multiple npm2yarn usage', async () => { const result = await processFixture('multiple'); + expect(result).toMatchSnapshot(); + }); + + it('work with yarn converter', async () => { + const result = await processFixture('plugin', {converters: ['yarn']}); expect(result).toMatchSnapshot(); }); + + it('work with pnpm converter', async () => { + const result = await processFixture('plugin', {converters: ['pnpm']}); + + expect(result).toMatchSnapshot(); + }); + + it('work with custom converter', async () => { + const result = await processFixture('plugin', { + converters: [['Turbo', (code) => code.replace(/npm/g, 'turbo')]], + }); + }); }); diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts index afa80b6a56fd..2e14e6a69cf6 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts @@ -6,20 +6,63 @@ */ import visit from 'unist-util-visit'; -// @ts-expect-error: this package provides CJS import npmToYarn from 'npm-to-yarn'; import type {Code, Literal} from 'mdast'; import type {Plugin} from 'unified'; import type {Node, Parent} from 'unist'; +type KnownConverter = 'yarn' | 'pnpm'; + +type CustomConverter = [name: string, cb: (npmCode: string) => string]; + +type Converter = CustomConverter | KnownConverter; + type PluginOptions = { sync?: boolean; + converters?: Converter[]; }; -// E.g. global install: 'npm i' -> 'yarn' -const convertNpmToYarn = (npmCode: string) => npmToYarn(npmCode, 'yarn'); +function createTabItem({ + code, + node, + value, + label, +}: { + code: string; + node: Code; + value: string; + label?: string; +}) { + return { + type: 'mdxJsxFlowElement', + name: 'TabItem', + attributes: [ + { + type: 'mdxJsxAttribute', + name: 'value', + value, + }, + label && { + type: 'mdxJsxAttribute', + name: 'label', + value: label, + }, + ].filter(Boolean), + children: [ + { + type: node.type, + lang: node.lang, + value: code, + }, + ], + }; +} -const transformNode = (node: Code, isSync: boolean) => { +const transformNode = ( + node: Code, + isSync: boolean, + converters: Converter[], +) => { const groupIdProp = isSync ? { type: 'mdxJsxAttribute', @@ -27,57 +70,34 @@ const transformNode = (node: Code, isSync: boolean) => { value: 'npm2yarn', } : undefined; - const npmCode = node.value; - const yarnCode = convertNpmToYarn(node.value); + + function createConvertedTabItem(converter: Converter) { + if (typeof converter === 'string') { + return createTabItem({ + code: npmToYarn(npmCode, converter), + node, + value: converter, + label: converter === 'yarn' ? 'Yarn' : converter, + }); + } + const [converterName, converterFn] = converter; + return createTabItem({ + code: converterFn(npmCode), + node, + value: converterName, + }); + + } + return [ { type: 'mdxJsxFlowElement', name: 'Tabs', attributes: [groupIdProp].filter(Boolean), children: [ - { - type: 'mdxJsxFlowElement', - name: 'TabItem', - attributes: [ - { - type: 'mdxJsxAttribute', - name: 'value', - value: 'npm', - }, - ], - children: [ - { - type: node.type, - lang: node.lang, - value: npmCode, - }, - ], - }, - - { - type: 'mdxJsxFlowElement', - name: 'TabItem', - attributes: [ - { - type: 'mdxJsxAttribute', - name: 'value', - value: 'yarn', - }, - { - type: 'mdxJsxAttribute', - name: 'label', - value: 'Yarn', - }, - ], - children: [ - { - type: node.type, - lang: node.lang, - value: yarnCode, - }, - ], - }, + createTabItem({code: npmCode, node, value: 'npm'}), + ...converters.flatMap(createConvertedTabItem), ], }, ] as any[]; @@ -139,7 +159,7 @@ function createImportNode() { } const plugin: Plugin<[PluginOptions?]> = (options = {}) => { - const {sync = false} = options; + const {sync = false, converters = ['yarn', 'pnpm']} = options; return (root, p) => { let transformed = false; let alreadyImported = false; @@ -154,7 +174,7 @@ const plugin: Plugin<[PluginOptions?]> = (options = {}) => { while (index < node.children.length) { const child = node.children[index]!; if (isNpm2Yarn(child)) { - const result = transformNode(child, sync); + const result = transformNode(child, sync, converters); node.children.splice(index, 1, ...result); index += result.length; transformed = true; From d31002823e4a772ab1ef0eb8efeb8f823732f9c5 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 24 Feb 2023 19:12:00 +0100 Subject: [PATCH 104/155] prettier --- .../src/index.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts index 2e14e6a69cf6..c006b26a3db5 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts @@ -80,14 +80,13 @@ const transformNode = ( value: converter, label: converter === 'yarn' ? 'Yarn' : converter, }); - } - const [converterName, converterFn] = converter; - return createTabItem({ - code: converterFn(npmCode), - node, - value: converterName, - }); - + } + const [converterName, converterFn] = converter; + return createTabItem({ + code: converterFn(npmCode), + node, + value: converterName, + }); } return [ From e398622a6daa3b7196462aa1e722231a153ba1de Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 24 Feb 2023 19:16:26 +0100 Subject: [PATCH 105/155] remove useless admonition paragraph --- .../markdown-features-admonitions.mdx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/website/docs/guides/markdown-features/markdown-features-admonitions.mdx b/website/docs/guides/markdown-features/markdown-features-admonitions.mdx index 11e6f1c389a5..7ad19c856d72 100644 --- a/website/docs/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/docs/guides/markdown-features/markdown-features-admonitions.mdx @@ -262,20 +262,16 @@ The types that are accepted are the same as above: `note`, `tip`, `danger`, `inf ```jsx title="MyReactPage.jsx" -

- Use plugins to introduce shorter syntax for the most commonly used JSX - elements in your project. -

+ Use plugins to introduce shorter syntax for the most commonly used JSX + elements in your project.
``` ```mdx-code-block -

- Use plugins to introduce shorter syntax for the most commonly used JSX - elements in your project. -

+ Use plugins to introduce shorter syntax for the most commonly used JSX + elements in your project.
``` From fbd5a85ac404e9bed009febc4751c3c60d0f8397 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 24 Feb 2023 19:26:00 +0100 Subject: [PATCH 106/155] fix live codeblock metastring to live=true prop --- .../src/remark/mdx1Compat/codeCompatPlugin.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts b/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts index 688941d12c29..c4c775c72f7e 100644 --- a/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts +++ b/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts @@ -23,6 +23,13 @@ export default function codeCompatPlugin(this: Processor): Transformer { node.data.hProperties = node.data.hProperties || {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any (node.data.hProperties as any).metastring = node.meta; + + // Retrocompatible support for live codeblock metastring + // Not really the appropriate place to handle that :s + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (node.data.hProperties as any).live = node.meta + ?.split(' ') + .includes('live'); }); }; } From 61ea35476717682c2f2c431851e348c865f266a9 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 3 Mar 2023 17:43:01 +0100 Subject: [PATCH 107/155] fix blockquote to produce identical mdx markup --- website/blog/2018-09-11-Towards-Docusaurus-2.mdx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/website/blog/2018-09-11-Towards-Docusaurus-2.mdx b/website/blog/2018-09-11-Towards-Docusaurus-2.mdx index 0cf963c66b78..5496e46ae93a 100644 --- a/website/blog/2018-09-11-Towards-Docusaurus-2.mdx +++ b/website/blog/2018-09-11-Towards-Docusaurus-2.mdx @@ -21,15 +21,12 @@ It all started with this [RFC issue](https://github.com/facebook/docusaurus/issu

- [RFC] Docusaurus v2 · Issue #789 · facebook/docusaurus + {'[RFC] Docusaurus v2 · Issue #789 · facebook/docusaurus'}

-

- These are some of the problems I'm seeing in Docusaurus now and also how we - can address them in v2. A number of the ideas here were inspired by VuePress - and other static site generators. In the current static site generators - ecosystem, t... -

+ These are some of the problems I'm seeing in Docusaurus now and also how we can + address them in v2. A number of the ideas here were inspired by VuePress and other + static site generators. In the current static site generators ecosystem, t...
Most of the suggested improvements are mentioned in the issue; I will provide details on some of issues in Docusaurus 1 and how we are going to address them in Docusaurus 2. From 86fda50cbd42fc5da187ec356b4be5b849e4c9a6 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 3 Mar 2023 17:46:57 +0100 Subject: [PATCH 108/155] fix precaching blockquote heading to produce identical mdx markup --- website/docs/api/plugins/plugin-pwa.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/docs/api/plugins/plugin-pwa.mdx b/website/docs/api/plugins/plugin-pwa.mdx index c97ae6996a54..8d41df812a3c 100644 --- a/website/docs/api/plugins/plugin-pwa.mdx +++ b/website/docs/api/plugins/plugin-pwa.mdx @@ -78,7 +78,11 @@ App installation requires the HTTPS protocol and a valid manifest. We enable users to browse a Docusaurus site offline, by using service-worker precaching. -> ### [What is Precaching?](https://developers.google.com/web/tools/workbox/modules/workbox-precaching) +>

+> +> {'What is Precaching?'} +> +>

> > One feature of service workers is the ability to save a set of files to the cache when the service worker is installing. This is often referred to as "precaching", since you are caching content ahead of the service worker being used. > From c9405f811702fb22806ea479bf9e8a94fc2f8b9b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 3 Mar 2023 18:21:34 +0100 Subject: [PATCH 109/155] fix admonition to produce identical mdx markup --- .../markdown-features/markdown-features-admonitions.mdx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx index 0ea3e6b9075e..7aacd1292375 100644 --- a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx @@ -197,10 +197,8 @@ The types that are accepted are the same as above: `note`, `tip`, `danger`, `inf ```mdx-code-block -

- Use plugins to introduce shorter syntax for the most commonly used JSX - elements in your project. -

+ Use plugins to introduce shorter syntax for the most commonly used JSX + elements in your project.
``` From 0b5db1be4b036879c93636ea5cbf10a560d2acba Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 3 Mar 2023 18:31:21 +0100 Subject: [PATCH 110/155] make files docs mdx to produce identical jsx markup --- .../docs/guides/markdown-features/markdown-features-assets.mdx | 2 +- .../guides/markdown-features/markdown-features-assets.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/guides/markdown-features/markdown-features-assets.mdx b/website/docs/guides/markdown-features/markdown-features-assets.mdx index bce4fc55747c..dfd3a96a518a 100644 --- a/website/docs/guides/markdown-features/markdown-features-assets.mdx +++ b/website/docs/guides/markdown-features/markdown-features-assets.mdx @@ -103,7 +103,7 @@ or - Download this docx + {'Download this docx'} [Download this docx using Markdown](../../assets/docusaurus-asset-example.docx) diff --git a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-assets.mdx b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-assets.mdx index bce4fc55747c..dfd3a96a518a 100644 --- a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-assets.mdx +++ b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-assets.mdx @@ -103,7 +103,7 @@ or - Download this docx + {'Download this docx'} [Download this docx using Markdown](../../assets/docusaurus-asset-example.docx) From 00bd10657d1094245ce0e421ae6ffdf22bcffb3f Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 3 Mar 2023 18:40:50 +0100 Subject: [PATCH 111/155] make code block docs mdx to produce identical jsx markup --- .../markdown-features/markdown-features-code-blocks.mdx | 6 ++++-- .../markdown-features/markdown-features-code-blocks.mdx | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/website/docs/guides/markdown-features/markdown-features-code-blocks.mdx b/website/docs/guides/markdown-features/markdown-features-code-blocks.mdx index fd6d65f7e522..13e1930e8e15 100644 --- a/website/docs/guides/markdown-features/markdown-features-code-blocks.mdx +++ b/website/docs/guides/markdown-features/markdown-features-code-blocks.mdx @@ -637,8 +637,10 @@ If you want to embed HTML markup such as anchor links or bold type, you can use
-    Input: 1 2 3 4{'\n'}
-    Output: "366300745"{'\n'}
+    {'Input: '}
+    {'1 2 3 4\n'}
+    {'Output: '}
+    {'"366300745"\n'}
   
diff --git a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-code-blocks.mdx b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-code-blocks.mdx index d16e8788ea2e..9ca2f574e1b4 100644 --- a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-code-blocks.mdx +++ b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-code-blocks.mdx @@ -635,8 +635,10 @@ If you want to embed HTML markup such as anchor links or bold type, you can use
-    Input: 1 2 3 4{'\n'}
-    Output: "366300745"{'\n'}
+    {'Input: '}
+    {'1 2 3 4\n'}
+    {'Output: '}
+    {'"366300745"\n'}
   
From 2d24c1628f75b6f26444a4663916efb41427cb09 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 3 Mar 2023 19:22:54 +0100 Subject: [PATCH 112/155] make react docs mdx to produce identical jsx markup --- .../docs/guides/markdown-features/markdown-features-react.mdx | 4 ++-- .../guides/markdown-features/markdown-features-react.mdx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/guides/markdown-features/markdown-features-react.mdx b/website/docs/guides/markdown-features/markdown-features-react.mdx index 4baabbb43c7a..bd985068ed6b 100644 --- a/website/docs/guides/markdown-features/markdown-features-react.mdx +++ b/website/docs/guides/markdown-features/markdown-features-react.mdx @@ -64,8 +64,8 @@ export const Highlight = ({children, color}) => ( -Docusaurus green -{` `}and Facebook blue are my favorite colors. +<>Docusaurus green +{` `}and Facebook blue are my favorite colors. I can write **Markdown** alongside my _JSX_! diff --git a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-react.mdx b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-react.mdx index ea6fbd9e4896..2921d002473c 100644 --- a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-react.mdx +++ b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-react.mdx @@ -64,8 +64,8 @@ export const Highlight = ({children, color}) => ( -Docusaurus green -{` `}and Facebook blue are my favorite colors. +<>Docusaurus green +{` `}and Facebook blue are my favorite colors. I can write **Markdown** alongside my _JSX_! From 6b71a8b59449e081716f3508af0044404d5c2dcf Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 3 Mar 2023 19:23:36 +0100 Subject: [PATCH 113/155] make autogenerated docs mdx to produce identical jsx markup --- website/docs/guides/docs/sidebar/autogenerated.mdx | 1 + .../version-2.3.1/guides/docs/sidebar/autogenerated.mdx | 1 + 2 files changed, 2 insertions(+) diff --git a/website/docs/guides/docs/sidebar/autogenerated.mdx b/website/docs/guides/docs/sidebar/autogenerated.mdx index b6209d143d06..edaa670c6d03 100644 --- a/website/docs/guides/docs/sidebar/autogenerated.mdx +++ b/website/docs/guides/docs/sidebar/autogenerated.mdx @@ -37,6 +37,7 @@ An `autogenerated` item is converted by Docusaurus to a **sidebar slice** (also
A real-world example + Consider this file structure: ```bash diff --git a/website/versioned_docs/version-2.3.1/guides/docs/sidebar/autogenerated.mdx b/website/versioned_docs/version-2.3.1/guides/docs/sidebar/autogenerated.mdx index bab38d29becf..c489689dc6ec 100644 --- a/website/versioned_docs/version-2.3.1/guides/docs/sidebar/autogenerated.mdx +++ b/website/versioned_docs/version-2.3.1/guides/docs/sidebar/autogenerated.mdx @@ -37,6 +37,7 @@ An `autogenerated` item is converted by Docusaurus to a **sidebar slice** (also
A real-world example + Consider this file structure: ```bash From fe5c77f4ea33c8cfdd9b0ce3f67466dc22bf3815 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 3 Mar 2023 19:30:16 +0100 Subject: [PATCH 114/155] make versioning docs mdx to produce identical jsx markup --- website/docs/guides/docs/versioning.mdx | 9 ++++++--- .../version-2.3.1/guides/docs/versioning.mdx | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/website/docs/guides/docs/versioning.mdx b/website/docs/guides/docs/versioning.mdx index 0ed5dffb6af8..df27a964f07f 100644 --- a/website/docs/guides/docs/versioning.mdx +++ b/website/docs/guides/docs/versioning.mdx @@ -76,14 +76,17 @@ Note the terminology we use here. Current version
- The version placed in the ./docs folder. + {'The version placed in the '} + ./docs + {' folder.'}
Latest version / last version
- The version served by default for docs navbar items. Usually has path{' '} - /docs. + {'The version served by default for docs navbar items. Usually has path '} + /docs + {'.'}
diff --git a/website/versioned_docs/version-2.3.1/guides/docs/versioning.mdx b/website/versioned_docs/version-2.3.1/guides/docs/versioning.mdx index 0ed5dffb6af8..df27a964f07f 100644 --- a/website/versioned_docs/version-2.3.1/guides/docs/versioning.mdx +++ b/website/versioned_docs/version-2.3.1/guides/docs/versioning.mdx @@ -76,14 +76,17 @@ Note the terminology we use here. Current version
- The version placed in the ./docs folder. + {'The version placed in the '} + ./docs + {' folder.'}
Latest version / last version
- The version served by default for docs navbar items. Usually has path{' '} - /docs. + {'The version served by default for docs navbar items. Usually has path '} + /docs + {'.'}
From f104c6d236ce782f8d51c36bb133a698aec625d6 Mon Sep 17 00:00:00 2001 From: Armano Date: Mon, 6 Mar 2023 04:23:20 +0100 Subject: [PATCH 115/155] fix: correct MDXPlugin type (#8738) fix: correct MDXPlugin type --- package.json | 2 +- packages/docusaurus-mdx-loader/package.json | 2 +- packages/docusaurus-mdx-loader/src/loader.ts | 15 ++++-------- .../src/remark/admonitions/index.ts | 1 + .../src/remark/details/index.ts | 1 + .../src/remark/head/index.ts | 1 + .../src/remark/headings/index.ts | 1 + .../src/remark/mdx1Compat/codeCompatPlugin.ts | 1 + .../src/remark/mermaid/index.ts | 1 + .../src/remark/toc/index.ts | 1 + .../src/remark/transformImage/index.ts | 1 + .../src/remark/transformLinks/index.ts | 1 + packages/docusaurus-migrate/package.json | 2 +- .../src/remark/footnoteIDFixer.ts | 1 + .../src/index.ts | 1 + yarn.lock | 24 +------------------ 16 files changed, 20 insertions(+), 36 deletions(-) diff --git a/package.json b/package.json index 8fe117f54709..60d97c8a7d69 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "lock:update": "npx --yes yarn-deduplicate" }, "dependencies": { - "unified": "^9.2.2" + "unified": "^10.1.2" }, "devDependencies": { "@crowdin/cli": "^3.9.1", diff --git a/packages/docusaurus-mdx-loader/package.json b/packages/docusaurus-mdx-loader/package.json index f9eb44b2d44c..ddb2b13e212c 100644 --- a/packages/docusaurus-mdx-loader/package.json +++ b/packages/docusaurus-mdx-loader/package.json @@ -38,7 +38,7 @@ "remark-emoji": "^2.2.0", "stringify-object": "^3.3.0", "tslib": "^2.4.1", - "unified": "^9.2.2", + "unified": "^10.1.2", "unist-util-visit": "^2.0.3", "url-loader": "^4.1.1", "webpack": "^5.75.0" diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index e44f1be628e7..b0be6d0ee73d 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -31,10 +31,11 @@ import {validateMDXFrontMatter} from './frontMatter'; import type {MarkdownConfig} from '@docusaurus/types'; import type {LoaderContext} from 'webpack'; -import type {Processor, PluggableList} from 'unified'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 +import type {Processor, Pluggable} from 'unified'; import type {AdmonitionOptions} from './remark/admonitions'; -// @ts-expect-error: TODO +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {ProcessorOptions} from '@mdx-js/mdx'; // Copied from https://mdxjs.com/packages/mdx/#optionsmdextensions @@ -61,7 +62,6 @@ const { const DEFAULT_OPTIONS: MDXOptions = { admonitions: true, rehypePlugins: [], - // @ts-expect-error: TODO remarkPlugins: [emoji, headings, toc], beforeDefaultRemarkPlugins: [], beforeDefaultRehypePlugins: [], @@ -69,7 +69,7 @@ const DEFAULT_OPTIONS: MDXOptions = { const compilerCache = new Map(); -export type MDXPlugin = PluggableList; +export type MDXPlugin = Pluggable; export type MDXOptions = { admonitions: boolean | Partial; @@ -160,7 +160,6 @@ function getAdmonitionsPlugins( admonitionsOption: MDXOptions['admonitions'], ): MDXPlugin[] { if (admonitionsOption) { - // @ts-expect-error: TODO fix types const plugin: MDXPlugin = admonitionsOption === true ? transformAdmonitions @@ -212,7 +211,6 @@ export async function mdxLoader( const hasFrontMatter = Object.keys(frontMatter).length > 0; if (!compilerCache.has(this.query)) { - // @ts-expect-error: TODO const remarkPlugins: ProcessorOptions['remarkPlugins'] = [ ...(reqOptions.beforeDefaultRemarkPlugins ?? []), (await import('remark-directive')).default, @@ -242,10 +240,8 @@ export async function mdxLoader( // codeCompatPlugin needs to be applied last after user-provided plugins // (after npm2yarn for example) - // @ts-expect-error: TODO remarkPlugins.push(codeCompatPlugin); - // @ts-expect-error: TODO const rehypePlugins: ProcessorOptions['rehypePlugins'] = [ ...(reqOptions.beforeDefaultRehypePlugins ?? []), ...DEFAULT_OPTIONS.rehypePlugins, @@ -259,14 +255,13 @@ export async function mdxLoader( : 'mdx' : mdxFrontMatter.format; - const options: ProcessorOptions = { + const options: ProcessorOptions & Options = { ...reqOptions, remarkPlugins, rehypePlugins, format, providerImportSource: '@mdx-js/react', }; - // @ts-expect-error: TODO compilerCache.set(this.query, [createProcessor(options), options]); } diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts index 0690cf7c386e..1f51a2a14194 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. */ import visit from 'unist-util-visit'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer, Processor, Plugin} from 'unified'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 diff --git a/packages/docusaurus-mdx-loader/src/remark/details/index.ts b/packages/docusaurus-mdx-loader/src/remark/details/index.ts index 628358c9bca1..8d2f1249e738 100644 --- a/packages/docusaurus-mdx-loader/src/remark/details/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/details/index.ts @@ -6,6 +6,7 @@ */ import visit from 'unist-util-visit'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer} from 'unified'; // @ts-expect-error: ES support... diff --git a/packages/docusaurus-mdx-loader/src/remark/head/index.ts b/packages/docusaurus-mdx-loader/src/remark/head/index.ts index 109a9c129953..bf064238f511 100644 --- a/packages/docusaurus-mdx-loader/src/remark/head/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/head/index.ts @@ -6,6 +6,7 @@ */ import visit from 'unist-util-visit'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer} from 'unified'; // @ts-expect-error: ES support... diff --git a/packages/docusaurus-mdx-loader/src/remark/headings/index.ts b/packages/docusaurus-mdx-loader/src/remark/headings/index.ts index e72954cbe0f6..a99685e58bed 100644 --- a/packages/docusaurus-mdx-loader/src/remark/headings/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/headings/index.ts @@ -9,6 +9,7 @@ import {parseMarkdownHeadingId, createSlugger} from '@docusaurus/utils'; import visit from 'unist-util-visit'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer} from 'unified'; import type {Heading, Text} from 'mdast'; diff --git a/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts b/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts index c4c775c72f7e..b50b6a4ddbe7 100644 --- a/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts +++ b/packages/docusaurus-mdx-loader/src/remark/mdx1Compat/codeCompatPlugin.ts @@ -6,6 +6,7 @@ */ import visit from 'unist-util-visit'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer, Processor} from 'unified'; import type {Code} from 'mdast'; diff --git a/packages/docusaurus-mdx-loader/src/remark/mermaid/index.ts b/packages/docusaurus-mdx-loader/src/remark/mermaid/index.ts index 3f71a8780bef..7947d3387e1f 100644 --- a/packages/docusaurus-mdx-loader/src/remark/mermaid/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/mermaid/index.ts @@ -6,6 +6,7 @@ */ import visit from 'unist-util-visit'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer} from 'unified'; import type {Code} from 'mdast'; diff --git a/packages/docusaurus-mdx-loader/src/remark/toc/index.ts b/packages/docusaurus-mdx-loader/src/remark/toc/index.ts index 97681be2bd2a..01162d0fd2bb 100644 --- a/packages/docusaurus-mdx-loader/src/remark/toc/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/toc/index.ts @@ -13,6 +13,7 @@ import {toValue} from '../utils'; import type {Identifier} from '@babel/types'; import type {Node, Parent} from 'unist'; import type {Heading, Literal} from 'mdast'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer} from 'unified'; export type TOCItem = { diff --git a/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts index aea08ad1b025..0b40d2bb31c7 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts @@ -21,6 +21,7 @@ import escapeHtml from 'escape-html'; import sizeOf from 'image-size'; import logger from '@docusaurus/logger'; import {assetRequireAttributeValue} from '../utils'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer} from 'unified'; import type {Image} from 'mdast'; import type {Parent} from 'unist'; diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts index eb2d5c1ca241..8a8de7871781 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts @@ -18,6 +18,7 @@ import { import visit from 'unist-util-visit'; import escapeHtml from 'escape-html'; import {assetRequireAttributeValue} from '../utils'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer} from 'unified'; import type {Parent} from 'unist'; import type {Link, Literal} from 'mdast'; diff --git a/packages/docusaurus-migrate/package.json b/packages/docusaurus-migrate/package.json index e99f67c989f3..16d4dcf06ae8 100644 --- a/packages/docusaurus-migrate/package.json +++ b/packages/docusaurus-migrate/package.json @@ -38,7 +38,7 @@ "remark-stringify": "^8.1.0", "semver": "^7.3.8", "tslib": "^2.4.1", - "unified": "^9.2.2", + "unified": "^10.1.2", "unist-util-visit": "^2.0.3" }, "devDependencies": { diff --git a/packages/docusaurus-plugin-content-blog/src/remark/footnoteIDFixer.ts b/packages/docusaurus-plugin-content-blog/src/remark/footnoteIDFixer.ts index a3c317ba6158..1986f8ed3da9 100644 --- a/packages/docusaurus-plugin-content-blog/src/remark/footnoteIDFixer.ts +++ b/packages/docusaurus-plugin-content-blog/src/remark/footnoteIDFixer.ts @@ -7,6 +7,7 @@ import visit from 'unist-util-visit'; import {simpleHash} from '@docusaurus/utils'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer} from 'unified'; import type {FootnoteReference, FootnoteDefinition} from 'mdast'; diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts index c006b26a3db5..0a7b6daeceff 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts @@ -8,6 +8,7 @@ import visit from 'unist-util-visit'; import npmToYarn from 'npm-to-yarn'; import type {Code, Literal} from 'mdast'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Plugin} from 'unified'; import type {Node, Parent} from 'unist'; diff --git a/yarn.lock b/yarn.lock index 7ba3748ab306..27c6fcad5e0b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4889,11 +4889,6 @@ babel-preset-jest@^29.2.0: babel-plugin-jest-hoist "^29.2.0" babel-preset-current-node-syntax "^1.0.0" -bail@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776" - integrity sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ== - bail@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/bail/-/bail-2.0.2.tgz#d26f5cd8fe5d6f832a31517b9f7c356040ba6d5d" @@ -15633,11 +15628,6 @@ trim@0.0.1: resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" integrity sha512-YzQV+TZg4AxpKxaTHK3c3D+kRDCGVEE7LemdlQZoQXn0iennk10RsIoY6ikzAqJTc9Xjl9C1/waHom/J86ziAQ== -trough@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" - integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== - trough@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/trough/-/trough-2.1.0.tgz#0f7b511a4fde65a46f18477ab38849b22c554876" @@ -15842,7 +15832,7 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== -unified@^10.0.0: +unified@^10.0.0, unified@^10.1.2: version "10.1.2" resolved "https://registry.yarnpkg.com/unified/-/unified-10.1.2.tgz#b1d64e55dafe1f0b98bb6c719881103ecf6c86df" integrity sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q== @@ -15855,18 +15845,6 @@ unified@^10.0.0: trough "^2.0.0" vfile "^5.0.0" -unified@^9.2.2: - version "9.2.2" - resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.2.tgz#67649a1abfc3ab85d2969502902775eb03146975" - integrity sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ== - dependencies: - bail "^1.0.0" - extend "^3.0.0" - is-buffer "^2.0.0" - is-plain-obj "^2.0.0" - trough "^1.0.0" - vfile "^4.0.0" - unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" From 2f6ff73b927ac08fcc9a45d1d3ae26aeec2f01d9 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 9 Mar 2023 20:00:46 +0100 Subject: [PATCH 116/155] Fix unified issue in docusaurus-migrate :/ --- jest.config.mjs | 1 + jest/vendor/unified@10.1.2.js | 779 ++++++++++++++++++ packages/docusaurus-migrate/src/index.ts | 17 +- packages/docusaurus-migrate/src/sanitizeMD.ts | 9 +- 4 files changed, 796 insertions(+), 10 deletions(-) create mode 100644 jest/vendor/unified@10.1.2.js diff --git a/jest.config.mjs b/jest.config.mjs index 9aa02bf47b94..2d2850d07d26 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -84,6 +84,7 @@ export default { // MDX packages are ESM-only and it is a pain to use in Jest // So we use them in Jest tests as CJS versions // see https://mdxjs.com/docs/troubleshooting-mdx/#problems-integrating-mdx + '^unified$': '/jest/vendor/unified@10.1.2.js', '^@mdx-js/mdx$': '/jest/vendor/@mdx-js__mdx@2.1.5.js', '^remark$': '/jest/vendor/remark@14.0.2.js', '^remark-mdx$': '/jest/vendor/remark-mdx@2.1.5.js', diff --git a/jest/vendor/unified@10.1.2.js b/jest/vendor/unified@10.1.2.js new file mode 100644 index 000000000000..0a7790428951 --- /dev/null +++ b/jest/vendor/unified@10.1.2.js @@ -0,0 +1,779 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/is-buffer/index.js +var require_is_buffer = __commonJS({ + "node_modules/is-buffer/index.js"(exports, module2) { + module2.exports = function isBuffer2(obj) { + return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj); + }; + } +}); + +// node_modules/extend/index.js +var require_extend = __commonJS({ + "node_modules/extend/index.js"(exports, module2) { + "use strict"; + var hasOwn = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + var defineProperty = Object.defineProperty; + var gOPD = Object.getOwnPropertyDescriptor; + var isArray = function isArray2(arr) { + if (typeof Array.isArray === "function") { + return Array.isArray(arr); + } + return toStr.call(arr) === "[object Array]"; + }; + var isPlainObject2 = function isPlainObject3(obj) { + if (!obj || toStr.call(obj) !== "[object Object]") { + return false; + } + var hasOwnConstructor = hasOwn.call(obj, "constructor"); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf"); + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + var key; + for (key in obj) { + } + return typeof key === "undefined" || hasOwn.call(obj, key); + }; + var setProperty = function setProperty2(target, options) { + if (defineProperty && options.name === "__proto__") { + defineProperty(target, options.name, { + enumerable: true, + configurable: true, + value: options.newValue, + writable: true + }); + } else { + target[options.name] = options.newValue; + } + }; + var getProperty = function getProperty2(obj, name) { + if (name === "__proto__") { + if (!hasOwn.call(obj, name)) { + return void 0; + } else if (gOPD) { + return gOPD(obj, name).value; + } + } + return obj[name]; + }; + module2.exports = function extend2() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + if (typeof target === "boolean") { + deep = target; + target = arguments[1] || {}; + i = 2; + } + if (target == null || typeof target !== "object" && typeof target !== "function") { + target = {}; + } + for (; i < length; ++i) { + options = arguments[i]; + if (options != null) { + for (name in options) { + src = getProperty(target, name); + copy = getProperty(options, name); + if (target !== copy) { + if (deep && copy && (isPlainObject2(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject2(src) ? src : {}; + } + setProperty(target, { name, newValue: extend2(deep, clone, copy) }); + } else if (typeof copy !== "undefined") { + setProperty(target, { name, newValue: copy }); + } + } + } + } + } + return target; + }; + } +}); + +// node_modules/unified/index.js +var unified_exports = {}; +__export(unified_exports, { + unified: () => unified1012 +}); +module.exports = __toCommonJS(unified_exports); + +// node_modules/bail/index.js +function bail(error) { + if (error) { + throw error; + } +} + +// node_modules/unified/lib/index.js +var import_is_buffer2 = __toESM(require_is_buffer(), 1); +var import_extend = __toESM(require_extend(), 1); + +// node_modules/unified/node_modules/is-plain-obj/index.js +function isPlainObject(value) { + if (typeof value !== "object" || value === null) { + return false; + } + const prototype = Object.getPrototypeOf(value); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); +} + +// node_modules/trough/index.js +function trough() { + const fns = []; + const pipeline = { run, use }; + return pipeline; + function run(...values) { + let middlewareIndex = -1; + const callback = values.pop(); + if (typeof callback !== "function") { + throw new TypeError("Expected function as last argument, not " + callback); + } + next(null, ...values); + function next(error, ...output) { + const fn = fns[++middlewareIndex]; + let index2 = -1; + if (error) { + callback(error); + return; + } + while (++index2 < values.length) { + if (output[index2] === null || output[index2] === void 0) { + output[index2] = values[index2]; + } + } + values = output; + if (fn) { + wrap(fn, next)(...output); + } else { + callback(null, ...output); + } + } + } + function use(middelware) { + if (typeof middelware !== "function") { + throw new TypeError( + "Expected `middelware` to be a function, not " + middelware + ); + } + fns.push(middelware); + return pipeline; + } +} +function wrap(middleware, callback) { + let called; + return wrapped; + function wrapped(...parameters) { + const fnExpectsCallback = middleware.length > parameters.length; + let result; + if (fnExpectsCallback) { + parameters.push(done); + } + try { + result = middleware.apply(this, parameters); + } catch (error) { + const exception = error; + if (fnExpectsCallback && called) { + throw exception; + } + return done(exception); + } + if (!fnExpectsCallback) { + if (result instanceof Promise) { + result.then(then, done); + } else if (result instanceof Error) { + done(result); + } else { + then(result); + } + } + } + function done(error, ...output) { + if (!called) { + called = true; + callback(error, ...output); + } + } + function then(value) { + done(null, value); + } +} + +// node_modules/vfile/lib/index.js +var import_is_buffer = __toESM(require_is_buffer(), 1); + +// node_modules/unist-util-stringify-position/index.js +function stringifyPosition(value) { + if (!value || typeof value !== "object") { + return ""; + } + if ("position" in value || "type" in value) { + return position(value.position); + } + if ("start" in value || "end" in value) { + return position(value); + } + if ("line" in value || "column" in value) { + return point(value); + } + return ""; +} +function point(point2) { + return index(point2 && point2.line) + ":" + index(point2 && point2.column); +} +function position(pos) { + return point(pos && pos.start) + "-" + point(pos && pos.end); +} +function index(value) { + return value && typeof value === "number" ? value : 1; +} + +// node_modules/vfile-message/index.js +var VFileMessage = class extends Error { + constructor(reason, place, origin) { + const parts = [null, null]; + let position2 = { + start: { line: null, column: null }, + end: { line: null, column: null } + }; + super(); + if (typeof place === "string") { + origin = place; + place = void 0; + } + if (typeof origin === "string") { + const index2 = origin.indexOf(":"); + if (index2 === -1) { + parts[1] = origin; + } else { + parts[0] = origin.slice(0, index2); + parts[1] = origin.slice(index2 + 1); + } + } + if (place) { + if ("type" in place || "position" in place) { + if (place.position) { + position2 = place.position; + } + } else if ("start" in place || "end" in place) { + position2 = place; + } else if ("line" in place || "column" in place) { + position2.start = place; + } + } + this.name = stringifyPosition(place) || "1:1"; + this.message = typeof reason === "object" ? reason.message : reason; + this.stack = ""; + if (typeof reason === "object" && reason.stack) { + this.stack = reason.stack; + } + this.reason = this.message; + this.fatal; + this.line = position2.start.line; + this.column = position2.start.column; + this.position = position2; + this.source = parts[0]; + this.ruleId = parts[1]; + this.file; + this.actual; + this.expected; + this.url; + this.note; + } +}; +VFileMessage.prototype.file = ""; +VFileMessage.prototype.name = ""; +VFileMessage.prototype.reason = ""; +VFileMessage.prototype.message = ""; +VFileMessage.prototype.stack = ""; +VFileMessage.prototype.fatal = null; +VFileMessage.prototype.column = null; +VFileMessage.prototype.line = null; +VFileMessage.prototype.source = null; +VFileMessage.prototype.ruleId = null; +VFileMessage.prototype.position = null; + +// node_modules/vfile/lib/minpath.js +var import_path = __toESM(require("path"), 1); + +// node_modules/vfile/lib/minproc.js +var import_process = __toESM(require("process"), 1); + +// node_modules/vfile/lib/minurl.js +var import_url = require("url"); + +// node_modules/vfile/lib/minurl.shared.js +function isUrl(fileURLOrPath) { + return fileURLOrPath !== null && typeof fileURLOrPath === "object" && fileURLOrPath.href && fileURLOrPath.origin; +} + +// node_modules/vfile/lib/index.js +var order = ["history", "path", "basename", "stem", "extname", "dirname"]; +var VFile = class { + constructor(value) { + let options; + if (!value) { + options = {}; + } else if (typeof value === "string" || (0, import_is_buffer.default)(value)) { + options = { value }; + } else if (isUrl(value)) { + options = { path: value }; + } else { + options = value; + } + this.data = {}; + this.messages = []; + this.history = []; + this.cwd = import_process.default.cwd(); + this.value; + this.stored; + this.result; + this.map; + let index2 = -1; + while (++index2 < order.length) { + const prop2 = order[index2]; + if (prop2 in options && options[prop2] !== void 0) { + this[prop2] = prop2 === "history" ? [...options[prop2]] : options[prop2]; + } + } + let prop; + for (prop in options) { + if (!order.includes(prop)) + this[prop] = options[prop]; + } + } + get path() { + return this.history[this.history.length - 1]; + } + set path(path) { + if (isUrl(path)) { + path = (0, import_url.fileURLToPath)(path); + } + assertNonEmpty(path, "path"); + if (this.path !== path) { + this.history.push(path); + } + } + get dirname() { + return typeof this.path === "string" ? import_path.default.dirname(this.path) : void 0; + } + set dirname(dirname) { + assertPath(this.basename, "dirname"); + this.path = import_path.default.join(dirname || "", this.basename); + } + get basename() { + return typeof this.path === "string" ? import_path.default.basename(this.path) : void 0; + } + set basename(basename) { + assertNonEmpty(basename, "basename"); + assertPart(basename, "basename"); + this.path = import_path.default.join(this.dirname || "", basename); + } + get extname() { + return typeof this.path === "string" ? import_path.default.extname(this.path) : void 0; + } + set extname(extname) { + assertPart(extname, "extname"); + assertPath(this.dirname, "extname"); + if (extname) { + if (extname.charCodeAt(0) !== 46) { + throw new Error("`extname` must start with `.`"); + } + if (extname.includes(".", 1)) { + throw new Error("`extname` cannot contain multiple dots"); + } + } + this.path = import_path.default.join(this.dirname, this.stem + (extname || "")); + } + get stem() { + return typeof this.path === "string" ? import_path.default.basename(this.path, this.extname) : void 0; + } + set stem(stem) { + assertNonEmpty(stem, "stem"); + assertPart(stem, "stem"); + this.path = import_path.default.join(this.dirname || "", stem + (this.extname || "")); + } + toString(encoding) { + return (this.value || "").toString(encoding); + } + message(reason, place, origin) { + const message = new VFileMessage(reason, place, origin); + if (this.path) { + message.name = this.path + ":" + message.name; + message.file = this.path; + } + message.fatal = false; + this.messages.push(message); + return message; + } + info(reason, place, origin) { + const message = this.message(reason, place, origin); + message.fatal = null; + return message; + } + fail(reason, place, origin) { + const message = this.message(reason, place, origin); + message.fatal = true; + throw message; + } +}; +function assertPart(part, name) { + if (part && part.includes(import_path.default.sep)) { + throw new Error( + "`" + name + "` cannot be a path: did not expect `" + import_path.default.sep + "`" + ); + } +} +function assertNonEmpty(part, name) { + if (!part) { + throw new Error("`" + name + "` cannot be empty"); + } +} +function assertPath(path, name) { + if (!path) { + throw new Error("Setting `" + name + "` requires `path` to be set too"); + } +} + +// node_modules/unified/lib/index.js +var unified1012 = base().freeze(); +var own = {}.hasOwnProperty; +function base() { + const transformers = trough(); + const attachers = []; + let namespace = {}; + let frozen; + let freezeIndex = -1; + processor.data = data; + processor.Parser = void 0; + processor.Compiler = void 0; + processor.freeze = freeze; + processor.attachers = attachers; + processor.use = use; + processor.parse = parse; + processor.stringify = stringify; + processor.run = run; + processor.runSync = runSync; + processor.process = process; + processor.processSync = processSync; + return processor; + function processor() { + const destination = base(); + let index2 = -1; + while (++index2 < attachers.length) { + destination.use(...attachers[index2]); + } + destination.data((0, import_extend.default)(true, {}, namespace)); + return destination; + } + function data(key, value) { + if (typeof key === "string") { + if (arguments.length === 2) { + assertUnfrozen("data", frozen); + namespace[key] = value; + return processor; + } + return own.call(namespace, key) && namespace[key] || null; + } + if (key) { + assertUnfrozen("data", frozen); + namespace = key; + return processor; + } + return namespace; + } + function freeze() { + if (frozen) { + return processor; + } + while (++freezeIndex < attachers.length) { + const [attacher, ...options] = attachers[freezeIndex]; + if (options[0] === false) { + continue; + } + if (options[0] === true) { + options[0] = void 0; + } + const transformer = attacher.call(processor, ...options); + if (typeof transformer === "function") { + transformers.use(transformer); + } + } + frozen = true; + freezeIndex = Number.POSITIVE_INFINITY; + return processor; + } + function use(value, ...options) { + let settings; + assertUnfrozen("use", frozen); + if (value === null || value === void 0) { + } else if (typeof value === "function") { + addPlugin(value, ...options); + } else if (typeof value === "object") { + if (Array.isArray(value)) { + addList(value); + } else { + addPreset(value); + } + } else { + throw new TypeError("Expected usable value, not `" + value + "`"); + } + if (settings) { + namespace.settings = Object.assign(namespace.settings || {}, settings); + } + return processor; + function add(value2) { + if (typeof value2 === "function") { + addPlugin(value2); + } else if (typeof value2 === "object") { + if (Array.isArray(value2)) { + const [plugin, ...options2] = value2; + addPlugin(plugin, ...options2); + } else { + addPreset(value2); + } + } else { + throw new TypeError("Expected usable value, not `" + value2 + "`"); + } + } + function addPreset(result) { + addList(result.plugins); + if (result.settings) { + settings = Object.assign(settings || {}, result.settings); + } + } + function addList(plugins) { + let index2 = -1; + if (plugins === null || plugins === void 0) { + } else if (Array.isArray(plugins)) { + while (++index2 < plugins.length) { + const thing = plugins[index2]; + add(thing); + } + } else { + throw new TypeError("Expected a list of plugins, not `" + plugins + "`"); + } + } + function addPlugin(plugin, value2) { + let index2 = -1; + let entry; + while (++index2 < attachers.length) { + if (attachers[index2][0] === plugin) { + entry = attachers[index2]; + break; + } + } + if (entry) { + if (isPlainObject(entry[1]) && isPlainObject(value2)) { + value2 = (0, import_extend.default)(true, entry[1], value2); + } + entry[1] = value2; + } else { + attachers.push([...arguments]); + } + } + } + function parse(doc) { + processor.freeze(); + const file = vfile(doc); + const Parser = processor.Parser; + assertParser("parse", Parser); + if (newable(Parser, "parse")) { + return new Parser(String(file), file).parse(); + } + return Parser(String(file), file); + } + function stringify(node, doc) { + processor.freeze(); + const file = vfile(doc); + const Compiler = processor.Compiler; + assertCompiler("stringify", Compiler); + assertNode(node); + if (newable(Compiler, "compile")) { + return new Compiler(node, file).compile(); + } + return Compiler(node, file); + } + function run(node, doc, callback) { + assertNode(node); + processor.freeze(); + if (!callback && typeof doc === "function") { + callback = doc; + doc = void 0; + } + if (!callback) { + return new Promise(executor); + } + executor(null, callback); + function executor(resolve, reject) { + transformers.run(node, vfile(doc), done); + function done(error, tree, file) { + tree = tree || node; + if (error) { + reject(error); + } else if (resolve) { + resolve(tree); + } else { + callback(null, tree, file); + } + } + } + } + function runSync(node, file) { + let result; + let complete; + processor.run(node, file, done); + assertDone("runSync", "run", complete); + return result; + function done(error, tree) { + bail(error); + result = tree; + complete = true; + } + } + function process(doc, callback) { + processor.freeze(); + assertParser("process", processor.Parser); + assertCompiler("process", processor.Compiler); + if (!callback) { + return new Promise(executor); + } + executor(null, callback); + function executor(resolve, reject) { + const file = vfile(doc); + processor.run(processor.parse(file), file, (error, tree, file2) => { + if (error || !tree || !file2) { + done(error); + } else { + const result = processor.stringify(tree, file2); + if (result === void 0 || result === null) { + } else if (looksLikeAVFileValue(result)) { + file2.value = result; + } else { + file2.result = result; + } + done(error, file2); + } + }); + function done(error, file2) { + if (error || !file2) { + reject(error); + } else if (resolve) { + resolve(file2); + } else { + callback(null, file2); + } + } + } + } + function processSync(doc) { + let complete; + processor.freeze(); + assertParser("processSync", processor.Parser); + assertCompiler("processSync", processor.Compiler); + const file = vfile(doc); + processor.process(file, done); + assertDone("processSync", "process", complete); + return file; + function done(error) { + complete = true; + bail(error); + } + } +} +function newable(value, name) { + return typeof value === "function" && value.prototype && (keys(value.prototype) || name in value.prototype); +} +function keys(value) { + let key; + for (key in value) { + if (own.call(value, key)) { + return true; + } + } + return false; +} +function assertParser(name, value) { + if (typeof value !== "function") { + throw new TypeError("Cannot `" + name + "` without `Parser`"); + } +} +function assertCompiler(name, value) { + if (typeof value !== "function") { + throw new TypeError("Cannot `" + name + "` without `Compiler`"); + } +} +function assertUnfrozen(name, frozen) { + if (frozen) { + throw new Error( + "Cannot call `" + name + "` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`." + ); + } +} +function assertNode(node) { + if (!isPlainObject(node) || typeof node.type !== "string") { + throw new TypeError("Expected node, got `" + node + "`"); + } +} +function assertDone(name, asyncName, complete) { + if (!complete) { + throw new Error( + "`" + name + "` finished async. Use `" + asyncName + "` instead" + ); + } +} +function vfile(value) { + return looksLikeAVFile(value) ? value : new VFile(value); +} +function looksLikeAVFile(value) { + return Boolean( + value && typeof value === "object" && "message" in value && "messages" in value + ); +} +function looksLikeAVFileValue(value) { + return typeof value === "string" || (0, import_is_buffer2.default)(value); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + unified: unified1012 +}); +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ diff --git a/packages/docusaurus-migrate/src/index.ts b/packages/docusaurus-migrate/src/index.ts index ec0615a5801b..2c162683e32e 100644 --- a/packages/docusaurus-migrate/src/index.ts +++ b/packages/docusaurus-migrate/src/index.ts @@ -37,10 +37,10 @@ async function walk(dir: string): Promise { return results; } -function sanitizedFileContent( +async function sanitizedFileContent( content: string, migrateMDFiles: boolean, -): string { +): Promise { const extractedData = extractMetadata(content); const extractedMetaData = Object.entries(extractedData.metadata) .map( @@ -55,7 +55,7 @@ ${extractedMetaData} --- ${ migrateMDFiles - ? sanitizeMD(extractedData.rawContent) + ? await sanitizeMD(extractedData.rawContent) : extractedData.rawContent }`; return sanitizedData; @@ -427,7 +427,7 @@ async function migrateBlogFiles(context: MigrationContext) { const content = await fs.readFile(file, 'utf-8'); await fs.outputFile( file, - sanitizedFileContent(content, shouldMigrateMdFiles), + await sanitizedFileContent(content, shouldMigrateMdFiles), ); }), ); @@ -515,7 +515,7 @@ async function migrateVersionedDocs( const content = await fs.readFile(pathToFile, 'utf-8'); await fs.outputFile( pathToFile, - sanitizedFileContent( + await sanitizedFileContent( content.replace(versionRegex, ''), shouldMigrateMdFiles, ), @@ -695,7 +695,7 @@ async function migrateLatestDocs(context: MigrationContext) { const content = await fs.readFile(file, 'utf-8'); await fs.outputFile( file, - sanitizedFileContent(content, shouldMigrateMdFiles), + await sanitizedFileContent(content, shouldMigrateMdFiles), ); } }), @@ -752,7 +752,10 @@ export async function migrateMDToMDX( files.map(async (filePath) => { if (path.extname(filePath) === '.md') { const content = await fs.readFile(filePath, 'utf-8'); - await fs.outputFile(filePath, sanitizedFileContent(content, true)); + await fs.outputFile( + filePath, + await sanitizedFileContent(content, true), + ); } }), ); diff --git a/packages/docusaurus-migrate/src/sanitizeMD.ts b/packages/docusaurus-migrate/src/sanitizeMD.ts index 61e3904cb0aa..c04f1341e8f2 100644 --- a/packages/docusaurus-migrate/src/sanitizeMD.ts +++ b/packages/docusaurus-migrate/src/sanitizeMD.ts @@ -7,7 +7,6 @@ import markdown from 'remark-parse'; import toJsx from '@mapbox/hast-util-to-jsx'; -import unified from 'unified'; import parse from 'rehype-parse'; import visit from 'unist-util-visit'; import remarkStringify from 'remark-stringify'; @@ -21,7 +20,9 @@ const tags = htmlTags.reduce((acc: {[key: string]: boolean}, tag) => { return acc; }, {}); -export default function sanitizeMD(code: string): string { +export default async function sanitizeMD(code: string): Promise { + const {unified} = await import('unified'); + const markdownTree = unified().use(markdown).parse(code); visit(markdownTree, 'code', (node: Code) => { node.value = `\n\n`; @@ -30,7 +31,8 @@ export default function sanitizeMD(code: string): string { node.value = ``; }); - const markdownString = unified() + // @ts-expect-error: :/ + const markdownString: string = await unified() .use(remarkStringify, {fence: '`', fences: true}) .stringify(markdownTree); @@ -45,6 +47,7 @@ export default function sanitizeMD(code: string): string { delete (node as Partial).tagName; } }); + return toJsx(htmlTree) .replace(/\{\/\*|\*\/\}/g, '') .replace(/\{\/\*|\*\/\}/g, '') From 43bdab9be4ad04c00337317906478627e846b94a Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 10 Mar 2023 15:36:45 +0100 Subject: [PATCH 117/155] Fix TS issues after merge --- .../docusaurus-mdx-loader/src/remark/admonitions/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts index 1f51a2a14194..98560a5d1c2f 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts @@ -130,16 +130,17 @@ function createAdmonitionNode({ */ type DirectiveLabel = Parent; +type DirectiveContent = ContainerDirective['children']; function parseDirective(directive: ContainerDirective): { directiveLabel: DirectiveLabel | undefined; - contentNodes: Node[]; + contentNodes: DirectiveContent; } { const hasDirectiveLabel = - directive.children?.[0].data?.directiveLabel === true; + directive.children?.[0]?.data?.directiveLabel === true; if (hasDirectiveLabel) { const [directiveLabel, ...contentNodes] = directive.children; - return {directiveLabel, contentNodes}; + return {directiveLabel: directiveLabel as DirectiveLabel, contentNodes}; } return {directiveLabel: undefined, contentNodes: directive.children}; } @@ -232,6 +233,7 @@ const plugin: Plugin = function plugin( }, children: directiveLabel.children, }; + // @ts-expect-error: invented node type directive.children.unshift(complexTitleNode); } } From 7efc696ab2b4faacbd0a23292a4b76dd62409ad1 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 10 Mar 2023 16:01:03 +0100 Subject: [PATCH 118/155] remove useless TS expect error for npm2yarn remark plugin --- website/docusaurus.config.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 719cda97cda1..6ca1602a5fb7 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -176,7 +176,6 @@ const config = { ], [ 'content-docs', - // @ts-expect-error: todo fix npm2yarn plugin /** @type {import('@docusaurus/plugin-content-docs').Options} */ ({ id: 'community', @@ -302,7 +301,6 @@ const config = { presets: [ [ 'classic', - // @ts-expect-error: todo fix npm2yarn plugin /** @type {import('@docusaurus/preset-classic').Options} */ ({ debug: true, // force debug plugin usage From 7ef4c996e46903b7f812dbbf4fe287efaad5ae0f Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 10 Mar 2023 18:45:30 +0100 Subject: [PATCH 119/155] PWA docs: fix Argos diff detected on TOC --- .../versioned_docs/version-2.3.1/api/plugins/plugin-pwa.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/versioned_docs/version-2.3.1/api/plugins/plugin-pwa.mdx b/website/versioned_docs/version-2.3.1/api/plugins/plugin-pwa.mdx index a6f388c503e7..6fd0ba6fe428 100644 --- a/website/versioned_docs/version-2.3.1/api/plugins/plugin-pwa.mdx +++ b/website/versioned_docs/version-2.3.1/api/plugins/plugin-pwa.mdx @@ -78,7 +78,11 @@ App installation requires the HTTPS protocol and a valid manifest. We enable users to browse a Docusaurus site offline, by using service-worker precaching. -> ### [What is Precaching?](https://developers.google.com/web/tools/workbox/modules/workbox-precaching) +>

+> +> {'What is Precaching?'} +> +>

> > One feature of service workers is the ability to save a set of files to the cache when the service worker is installing. This is often referred to as "precaching", since you are caching content ahead of the service worker being used. > From 8b089b4fa838e0a7bc30ec3f624897fb1c53623e Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 12:35:08 +0100 Subject: [PATCH 120/155] links: MDX flow => text element --- .../__snapshots__/index.test.ts.snap | 64 ++++--------------- .../src/remark/transformLinks/index.ts | 2 +- 2 files changed, 15 insertions(+), 51 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap index b6b1afde86a4..6330671b06aa 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap @@ -14,21 +14,13 @@ exports[`transformAsset plugin transform md links to 1`] = ` /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default} /> -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default}> - asset - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default}>asset -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset (2).pdf").default}> - asset with URL encoded chars - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset (2).pdf").default}>asset with URL encoded chars -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default + '#page=2'}> - asset with hash - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default + '#page=2'}>asset with hash -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default} title="Title"> - asset - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default} title="Title">asset [page](noUrl.md) @@ -42,52 +34,24 @@ exports[`transformAsset plugin transform md links to 1`] = ` [assets](/github/!file-loader!/assets.pdf) -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default}> - asset - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default}>asset -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static2/asset2.pdf").default}> - asset2 - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static2/asset2.pdf").default}>asset2 -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}> - staticAsset.pdf - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}>staticAsset.pdf -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}> - @site/static/staticAsset.pdf - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}>@site/static/staticAsset.pdf -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default + '#page=2'} title="Title"> - @site/static/staticAsset.pdf - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default + '#page=2'} title="Title">@site/static/staticAsset.pdf -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}> - Just staticAsset.pdf -, and /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}> - **awesome** +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}>Just staticAsset.pdf, and /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}>**awesome** staticAsset 2.pdf 'It is really "AWESOME"', but also /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}>coded \`staticAsset 3.pdf\` - staticAsset 2.pdf 'It is really "AWESOME"' -, but also /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAsset.pdf").default}> - coded +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAssetImage.png").default}>Clickable Docusaurus logo/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/staticAssetImage.png").default} width="200" height="200" /> - \`staticAsset 3.pdf\` - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default}>Stylized link to asset file -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/staticAssetImage.png").default}> - Clickable Docusaurus logo/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/staticAssetImage.png").default} width="200" height="200" /> - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./data.json").default}>JSON -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default}> - Stylized link to asset file - - -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./data.json").default}> - JSON - - -/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/static-json.json").default}> - static JSON - +/node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./static/static-json.json").default}>static JSON " `; diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts index 8a8de7871781..d5658616ec0c 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts @@ -98,7 +98,7 @@ async function toAssetRequireNode( (key) => delete jsxNode[key as keyof typeof jsxNode], ); - jsxNode.type = 'mdxJsxFlowElement'; + jsxNode.type = 'mdxJsxTextElement'; jsxNode.name = 'a'; jsxNode.attributes = attributes; jsxNode.children = children; From 925ef677f022379969b17e9a051ec9ca049ee6d2 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 12:41:28 +0100 Subject: [PATCH 121/155] improve transformLink types --- .../src/remark/transformLinks/index.ts | 11 ++++------- .../docusaurus-mdx-loader/src/remark/utils/index.ts | 4 +++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts index d5658616ec0c..f451079e25c6 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts @@ -20,6 +20,8 @@ import escapeHtml from 'escape-html'; import {assetRequireAttributeValue} from '../utils'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer} from 'unified'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 +import type {MdxJsxTextElement} from 'mdast-util-mdx'; import type {Parent} from 'unist'; import type {Link, Literal} from 'mdast'; @@ -48,13 +50,8 @@ async function toAssetRequireNode( ) { const {toString} = await import('mdast-util-to-string'); - const jsxNode = node as unknown as { - type: string; - name: string; - attributes: any[]; - children: any[]; - }; - const attributes = []; + const jsxNode = node as unknown as MdxJsxTextElement; + const attributes: MdxJsxTextElement['attributes'] = []; // require("assets/file.pdf") means requiring from a package called assets const relativeAssetPath = `./${posixPath( diff --git a/packages/docusaurus-mdx-loader/src/remark/utils/index.ts b/packages/docusaurus-mdx-loader/src/remark/utils/index.ts index 81fb1f0baf36..da3c40209997 100644 --- a/packages/docusaurus-mdx-loader/src/remark/utils/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/utils/index.ts @@ -8,6 +8,8 @@ import escapeHtml from 'escape-html'; import type {Parent} from 'unist'; import type {PhrasingContent, Heading} from 'mdast'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 +import type {MdxJsxAttributeValueExpression} from 'mdast-util-mdx'; export function stringifyContent( node: Parent, @@ -49,7 +51,7 @@ export function toValue( export function assetRequireAttributeValue( requireString: string, hash: string, -) { +): MdxJsxAttributeValueExpression { return { type: 'mdxJsxAttributeValueExpression', value: `require("${requireString}").default${hash && ` + '${hash}'`}`, From 4808e738c92d4bb76d0c17136166ada7d37f64e9 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 12:47:02 +0100 Subject: [PATCH 122/155] add transformLinks/images in paragraph fixtures --- .../remark/transformImage/__tests__/__fixtures__/img.md | 8 ++++---- .../__tests__/__snapshots__/index.test.ts.snap | 8 ++++---- .../remark/transformLinks/__tests__/__fixtures__/asset.md | 2 ++ .../__tests__/__snapshots__/index.test.ts.snap | 2 ++ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__fixtures__/img.md b/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__fixtures__/img.md index 969077544921..61b961202cb6 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__fixtures__/img.md +++ b/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__fixtures__/img.md @@ -4,6 +4,8 @@ ![img](static/img.png) +in paragraph ![img](static/img.png) + ![img from second static folder](/img2.png) ![img from second static folder](./static2/img2.png) @@ -16,11 +18,9 @@ ![site alias](@site/static/img.png) -![img with hash](/img.png#light) -![img with hash](/img.png#dark) +![img with hash](/img.png#light) ![img with hash](/img.png#dark) -![img with query](/img.png?w=10) -![img with query](/img.png?w=10&h=10) +![img with query](/img.png?w=10) ![img with query](/img.png?w=10&h=10) ![img with both](/img.png?w=10&h=10#light) diff --git a/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__snapshots__/index.test.ts.snap index 2cf64ba7288c..4745422c1ed7 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-mdx-loader/src/remark/transformImage/__tests__/__snapshots__/index.test.ts.snap @@ -23,6 +23,8 @@ exports[`transformImage plugin transform md images to 1`] = ` img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} width="200" height="200" /> +in paragraph img/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} width="200" height="200" /> + img from second static folder/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static2/img2.png").default} width="256" height="82" /> img from second static folder/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static2/img2.png").default} width="256" height="82" /> @@ -35,11 +37,9 @@ exports[`transformImage plugin transform md images to 1`] = ` site alias/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default} width="200" height="200" /> -img with hash/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default + '#light'} width="200" height="200" /> -img with hash/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default + '#dark'} width="200" height="200" /> +img with hash/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default + '#light'} width="200" height="200" /> img with hash/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png").default + '#dark'} width="200" height="200" /> -img with query/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png?w=10").default} width="200" height="200" /> -img with query/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png?w=10&h=10").default} width="200" height="200" /> +img with query/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png?w=10").default} width="200" height="200" /> img with query/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png?w=10&h=10").default} width="200" height="200" /> img with both/node_modules/url-loader/dist/cjs.js?limit=10000&name=assets/images/[name]-[contenthash].[ext]&fallback=/node_modules/file-loader/dist/cjs.js!./static/img.png?w=10&h=10").default + '#light'} width="200" height="200" /> diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__fixtures__/asset.md b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__fixtures__/asset.md index 6a8a0e44abcb..b179caa00672 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__fixtures__/asset.md +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__fixtures__/asset.md @@ -4,6 +4,8 @@ [asset](./asset.pdf) +in paragraph [asset](./asset.pdf) + [asset with URL encoded chars](./asset%20%282%29.pdf) [asset with hash](./asset.pdf#page=2) diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap index 6330671b06aa..06f8fcbcabe7 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/__tests__/__snapshots__/index.test.ts.snap @@ -16,6 +16,8 @@ exports[`transformAsset plugin transform md links to 1`] = ` /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default}>asset +in paragraph /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default}>asset + /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset (2).pdf").default}>asset with URL encoded chars /node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[contenthash].[ext]!./asset.pdf").default + '#page=2'}>asset with hash From eaac2e3a0c0e595f22c313cdb4b689f54ca604c7 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 12:49:14 +0100 Subject: [PATCH 123/155] transformImages => use mdxJsxTextElement + improve typing --- .../src/remark/transformImage/index.ts | 15 +++++++-------- .../src/remark/transformLinks/index.ts | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts index 0b40d2bb31c7..43a63448ce4b 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts @@ -23,6 +23,8 @@ import logger from '@docusaurus/logger'; import {assetRequireAttributeValue} from '../utils'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer} from 'unified'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 +import type {MdxJsxTextElement} from 'mdast-util-mdx'; import type {Image} from 'mdast'; import type {Parent} from 'unist'; @@ -46,13 +48,10 @@ async function toImageRequireNode( imagePath: string, filePath: string, ) { - const jsxNode = node as unknown as { - type: string; - name: string; - attributes: any[]; - children: any[]; - }; - const attributes = []; + // MdxJsxTextElement => see https://github.com/facebook/docusaurus/pull/8288#discussion_r1125871405 + const jsxNode = node as unknown as MdxJsxTextElement; + const attributes: MdxJsxTextElement['attributes'] = []; + let relativeImagePath = posixPath( path.relative(path.dirname(filePath), imagePath), ); @@ -115,7 +114,7 @@ ${(err as Error).message}`; (key) => delete jsxNode[key as keyof typeof jsxNode], ); - jsxNode.type = 'mdxJsxFlowElement'; + jsxNode.type = 'mdxJsxTextElement'; jsxNode.name = 'img'; jsxNode.attributes = attributes; jsxNode.children = []; diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts index f451079e25c6..0ece893259ce 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts @@ -50,6 +50,7 @@ async function toAssetRequireNode( ) { const {toString} = await import('mdast-util-to-string'); + // MdxJsxTextElement => see https://github.com/facebook/docusaurus/pull/8288#discussion_r1125871405 const jsxNode = node as unknown as MdxJsxTextElement; const attributes: MdxJsxTextElement['attributes'] = []; From 55b35095713cec2f13f05955fb3e8874d1db6d64 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 15:43:04 +0100 Subject: [PATCH 124/155] fix doc for custom heading id syntax due to mdx file pre-processing --- .../docs/guides/markdown-features/markdown-features-toc.mdx | 4 ++-- website/src/theme/MDXComponents.tsx | 2 ++ .../guides/markdown-features/markdown-features-toc.mdx | 4 ++-- .../guides/markdown-features/markdown-features-toc.mdx | 4 ++-- .../guides/markdown-features/markdown-features-toc.mdx | 4 ++-- .../guides/markdown-features/markdown-features-toc.mdx | 4 ++-- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/website/docs/guides/markdown-features/markdown-features-toc.mdx b/website/docs/guides/markdown-features/markdown-features-toc.mdx index b4e81fde834b..b1b6507f2559 100644 --- a/website/docs/guides/markdown-features/markdown-features-toc.mdx +++ b/website/docs/guides/markdown-features/markdown-features-toc.mdx @@ -43,8 +43,8 @@ Generated IDs have **some limitations**: A special Markdown syntax lets you set an **explicit heading id**: -```md -### Hello World {#my-explicit-id} +```mdx-code-block +{'### Hello World \u007B#my-explicit-id}\n'} ``` :::tip diff --git a/website/src/theme/MDXComponents.tsx b/website/src/theme/MDXComponents.tsx index d2fd0c128232..8cfc83150376 100644 --- a/website/src/theme/MDXComponents.tsx +++ b/website/src/theme/MDXComponents.tsx @@ -6,11 +6,13 @@ */ import MDXComponents from '@theme-original/MDXComponents'; +import Code from '@theme/MDXComponents/Code'; import Highlight from '@site/src/components/Highlight'; import TweetQuote from '@site/src/components/TweetQuote'; export default { ...MDXComponents, + Code, Highlight, TweetQuote, }; diff --git a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-toc.mdx b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-toc.mdx index b4e81fde834b..b1b6507f2559 100644 --- a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-toc.mdx +++ b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-toc.mdx @@ -43,8 +43,8 @@ Generated IDs have **some limitations**: A special Markdown syntax lets you set an **explicit heading id**: -```md -### Hello World {#my-explicit-id} +```mdx-code-block +{'### Hello World \u007B#my-explicit-id}\n'} ``` :::tip diff --git a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-toc.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-toc.mdx index b4e81fde834b..b1b6507f2559 100644 --- a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-toc.mdx +++ b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-toc.mdx @@ -43,8 +43,8 @@ Generated IDs have **some limitations**: A special Markdown syntax lets you set an **explicit heading id**: -```md -### Hello World {#my-explicit-id} +```mdx-code-block +{'### Hello World \u007B#my-explicit-id}\n'} ``` :::tip diff --git a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-toc.mdx b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-toc.mdx index b4e81fde834b..b1b6507f2559 100644 --- a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-toc.mdx +++ b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-toc.mdx @@ -43,8 +43,8 @@ Generated IDs have **some limitations**: A special Markdown syntax lets you set an **explicit heading id**: -```md -### Hello World {#my-explicit-id} +```mdx-code-block +{'### Hello World \u007B#my-explicit-id}\n'} ``` :::tip diff --git a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-toc.mdx b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-toc.mdx index b4e81fde834b..b1b6507f2559 100644 --- a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-toc.mdx +++ b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-toc.mdx @@ -43,8 +43,8 @@ Generated IDs have **some limitations**: A special Markdown syntax lets you set an **explicit heading id**: -```md -### Hello World {#my-explicit-id} +```mdx-code-block +{'### Hello World \u007B#my-explicit-id}\n'} ``` :::tip From dc86c92642f3cddeb489e027b51f87e35aa53967 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 16:32:48 +0100 Subject: [PATCH 125/155] improve npm2yarn typing --- .../package.json | 1 + .../src/index.ts | 29 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/packages/docusaurus-remark-plugin-npm2yarn/package.json b/packages/docusaurus-remark-plugin-npm2yarn/package.json index 69406341566a..dcd2c71da805 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/package.json +++ b/packages/docusaurus-remark-plugin-npm2yarn/package.json @@ -17,6 +17,7 @@ }, "license": "MIT", "dependencies": { + "mdast-util-mdx": "^2.0.0", "npm-to-yarn": "^2.0.0", "tslib": "^2.5.0", "unist-util-visit": "^2.0.3" diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts index 0a7b6daeceff..295ee5ae1bc5 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts @@ -10,6 +10,8 @@ import npmToYarn from 'npm-to-yarn'; import type {Code, Literal} from 'mdast'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Plugin} from 'unified'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 +import type {MdxJsxFlowElement, MdxJsxAttribute} from 'mdast-util-mdx'; import type {Node, Parent} from 'unist'; type KnownConverter = 'yarn' | 'pnpm'; @@ -23,6 +25,17 @@ type PluginOptions = { converters?: Converter[]; }; +function createAttribute( + attributeName: string, + attributeValue: MdxJsxAttribute['value'], +): MdxJsxAttribute { + return { + type: 'mdxJsxAttribute', + name: attributeName, + value: attributeValue, + }; +} + function createTabItem({ code, node, @@ -33,22 +46,14 @@ function createTabItem({ node: Code; value: string; label?: string; -}) { +}): MdxJsxFlowElement { return { type: 'mdxJsxFlowElement', name: 'TabItem', attributes: [ - { - type: 'mdxJsxAttribute', - name: 'value', - value, - }, - label && { - type: 'mdxJsxAttribute', - name: 'label', - value: label, - }, - ].filter(Boolean), + createAttribute('value', value), + label && createAttribute('label', label), + ].filter((attr): attr is MdxJsxAttribute => Boolean(attr)), children: [ { type: node.type, From 2aa97d97a1335ff8740fa26cfd7a512ac7ee1854 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 17:35:04 +0100 Subject: [PATCH 126/155] minor comment change --- .../docusaurus-theme-classic/src/theme/MDXContent/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx b/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx index dfbf4c3f96c5..55c530c9270e 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXContent/index.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -// @ts-expect-error: TODO ESM +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import {MDXProvider} from '@mdx-js/react'; import MDXComponents from '@theme/MDXComponents'; import type {Props} from '@theme/MDXContent'; From a562d299e277837edb9bda511733d7068183c60c Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 18:21:53 +0100 Subject: [PATCH 127/155] re-enable eslint rule + fix errors --- .eslintrc.js | 3 +-- .../src/remark/admonitions/index.ts | 1 - .../src/remark/transformImage/index.ts | 2 +- .../src/remark/transformLinks/index.ts | 4 +--- .../__snapshots__/index.test.ts.snap | 24 +++++++++++++++++++ .../src/__tests__/index.test.ts | 2 ++ .../src/index.ts | 2 +- .../src/theme/MDXComponents/Code.tsx | 2 +- .../src/theme/MDXComponents/Pre.tsx | 2 +- .../docusaurus-utils/src/markdownUtils.ts | 2 +- 10 files changed, 33 insertions(+), 11 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 718f00bad715..1acb68f82e64 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -372,8 +372,7 @@ module.exports = { // We don't provide any escape hatches for this rule. Rest siblings and // function placeholder params are always ignored, and any other unused // locals must be justified with a disable comment. - // TODO revert to error + add varsIgnorePattern _ prefix - '@typescript-eslint/no-unused-vars': [WARNING, {ignoreRestSiblings: true}], + '@typescript-eslint/no-unused-vars': [ERROR, {ignoreRestSiblings: true}], '@typescript-eslint/prefer-optional-chain': ERROR, '@docusaurus/no-html-links': ERROR, '@docusaurus/prefer-docusaurus-heading': ERROR, diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts index 98560a5d1c2f..96e3fb0b7c13 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts @@ -10,7 +10,6 @@ import type {Transformer, Processor, Plugin} from 'unified'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {ContainerDirective} from 'mdast-util-directive'; -import type {Node} from 'unist'; import type {Parent} from 'mdast'; // TODO not ideal option shape diff --git a/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts index 43a63448ce4b..5bd9c1d9a991 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformImage/index.ts @@ -44,7 +44,7 @@ type Context = PluginOptions & { type Target = [node: Image, index: number, parent: Parent]; async function toImageRequireNode( - [node, index, parent]: Target, + [node]: Target, imagePath: string, filePath: string, ) { diff --git a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts index 0ece893259ce..71086023345c 100644 --- a/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/transformLinks/index.ts @@ -44,12 +44,10 @@ type Target = [node: Link, index: number, parent: Parent]; * Transforms the link node to a JSX `` element with a `require()` call. */ async function toAssetRequireNode( - [node, index, parent]: Target, + [node]: Target, assetPath: string, filePath: string, ) { - const {toString} = await import('mdast-util-to-string'); - // MdxJsxTextElement => see https://github.com/facebook/docusaurus/pull/8288#discussion_r1125871405 const jsxNode = node as unknown as MdxJsxTextElement; const attributes: MdxJsxTextElement['attributes'] = []; diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap index cc56925b1cfd..d6e85e082bd6 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/__snapshots__/index.test.ts.snap @@ -145,6 +145,30 @@ npm install --save docusaurus-plugin-name " `; +exports[`npm2yarn plugin work with custom converter 1`] = ` +"import Tabs from '@theme/Tabs' +import TabItem from '@theme/TabItem' + +## Installing a plugin + +A plugin is usually a npm package, so you install them like other npm packages using npm. + + + + \`\`\`bash + npm install --save docusaurus-plugin-name + \`\`\` + + + + \`\`\`bash + turbo install --save docusaurus-plugin-name + \`\`\` + + +" +`; + exports[`npm2yarn plugin work with pnpm converter 1`] = ` "import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts index d4d2f5875519..575365c8f26d 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/__tests__/index.test.ts @@ -113,5 +113,7 @@ describe('npm2yarn plugin', () => { const result = await processFixture('plugin', { converters: [['Turbo', (code) => code.replace(/npm/g, 'turbo')]], }); + + expect(result).toMatchSnapshot(); }); }); diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts index 295ee5ae1bc5..9c491602234f 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts @@ -165,7 +165,7 @@ function createImportNode() { const plugin: Plugin<[PluginOptions?]> = (options = {}) => { const {sync = false, converters = ['yarn', 'pnpm']} = options; - return (root, p) => { + return (root) => { let transformed = false; let alreadyImported = false; diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx index e11436faf7ff..97e1ac4d8dd7 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Code.tsx @@ -6,7 +6,7 @@ */ import type {ComponentProps} from 'react'; -import React, {isValidElement} from 'react'; +import React from 'react'; import CodeBlock from '@theme/CodeBlock'; import type {Props} from '@theme/MDXComponents/Code'; diff --git a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Pre.tsx b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Pre.tsx index 5012ecc7ff98..69957ea29f55 100644 --- a/packages/docusaurus-theme-classic/src/theme/MDXComponents/Pre.tsx +++ b/packages/docusaurus-theme-classic/src/theme/MDXComponents/Pre.tsx @@ -11,5 +11,5 @@ import type {Props} from '@theme/MDXComponents/Pre'; export default function MDXPre(props: Props): ReactNode | undefined { // With MDX 2, this element is only used for fenced code blocks // It always receives a MDXComponents/Code as children - return props.children; + return <>{props.children}; } diff --git a/packages/docusaurus-utils/src/markdownUtils.ts b/packages/docusaurus-utils/src/markdownUtils.ts index dc34ea87c3e6..f7b141c9ad49 100644 --- a/packages/docusaurus-utils/src/markdownUtils.ts +++ b/packages/docusaurus-utils/src/markdownUtils.ts @@ -45,7 +45,7 @@ export function parseMarkdownHeadingId(heading: string): { */ export function escapeMarkdownHeadingIds(content: string): string { const markdownHeadingRegexp = /(?:^|\n)#{1,6}(?!#).*/g; - return content.replaceAll(markdownHeadingRegexp, (substring, ...args) => + return content.replaceAll(markdownHeadingRegexp, (substring) => // TODO probably not the most efficient impl... substring .replace('{#', '\\{#') From 2670cc1ffe04924bed69deb92fe68f21e333fdd0 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 18:27:36 +0100 Subject: [PATCH 128/155] mdx-code-block should only unwrap on the 1st level --- .../src/__tests__/markdownUtils.test.ts | 19 +++++++++++++++++++ .../docusaurus-utils/src/markdownUtils.ts | 9 ++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts b/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts index a515270f7be2..a889fa517a5c 100644 --- a/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts +++ b/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts @@ -1086,6 +1086,25 @@ describe('unwrapMdxCodeBlocks', () => { `); }); + it('cant unwrap a nested mdx code block', () => { + const markdown = dedent` + # Title + + \`\`\`\`mdx-code-block + + some content + + \`\`\`js + export const age = 36 + \`\`\` + + \`\`\`\` + + text + `; + expect(unwrapMdxCodeBlocks(markdown)).toEqual(markdown); + }); + it('works for realistic example', () => { expect( unwrapMdxCodeBlocks(dedent` diff --git a/packages/docusaurus-utils/src/markdownUtils.ts b/packages/docusaurus-utils/src/markdownUtils.ts index f7b141c9ad49..03e86d5d6eb3 100644 --- a/packages/docusaurus-utils/src/markdownUtils.ts +++ b/packages/docusaurus-utils/src/markdownUtils.ts @@ -54,12 +54,11 @@ export function escapeMarkdownHeadingIds(content: string): string { ); } -// TODO support other levels? export function unwrapMdxCodeBlocks(content: string): string { - const regexp3 = + // We only support triple backticks on purpose + // This is an escape hatch and shouldn't be used in a nested way + const regexp = /(?^|\n)```mdx-code-block\n(?.*?)\n```(?\n|$)/gs; - const regexp4 = - /(?^|\n)````mdx-code-block\n(?.*?)\n````(?\n|$)/gs; // eslint-disable-next-line @typescript-eslint/no-explicit-any const replacer = (substring: string, ...args: any[]) => { @@ -67,7 +66,7 @@ export function unwrapMdxCodeBlocks(content: string): string { return `${groups.begin}${groups.children}${groups.end}`; }; - return content.replaceAll(regexp3, replacer).replaceAll(regexp4, replacer); + return content.replaceAll(regexp, replacer); } /** From ab6d3dc765587314f2778c1f985cb1efca33632b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 18:48:11 +0100 Subject: [PATCH 129/155] Admonition api: remove support for using a custom tag option --- .../src/remark/admonitions/index.ts | 112 ------------------ .../validationSchemas.test.ts.snap | 24 ++-- .../src/__tests__/validationSchemas.test.ts | 8 +- .../src/validationSchemas.ts | 13 +- 4 files changed, 15 insertions(+), 142 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts index 96e3fb0b7c13..e253dcd23ad8 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts @@ -12,18 +12,12 @@ import type {Transformer, Processor, Plugin} from 'unified'; import type {ContainerDirective} from 'mdast-util-directive'; import type {Parent} from 'mdast'; -// TODO not ideal option shape -// First let upgrade to MDX 2.0 -// Maybe we'll want to provide different tags for different admonition types? -// Also maybe rename "keywords" to "types"? export type AdmonitionOptions = { - tag: string; // TODO remove this config option, now unused with md directives keywords: string[]; extendDefaults: boolean; }; export const DefaultAdmonitionOptions: AdmonitionOptions = { - tag: ':::', // TODO remove this, breaking change keywords: [ 'secondary', 'info', @@ -59,75 +53,6 @@ export function normalizeAdmonitionOptions( return options; } -/* -const isMdxEsmLiteral = (node: Node): node is Literal => - node.type === 'mdxjsEsm'; -// TODO good-enough approximation, but not 100% accurate -const isAdmonitionImport = (node: Node): boolean => - isMdxEsmLiteral(node) && node.value.includes('@theme/Admonition'); - -function createImportNode() { - return { - type: 'mdxjsEsm', - value: "import Admonition from '@theme/Admonition'", - data: { - estree: { - type: 'Program', - body: [ - { - type: 'ImportDeclaration', - specifiers: [ - { - type: 'ImportDefaultSpecifier', - local: {type: 'Identifier', name: 'Admonition'}, - }, - ], - source: { - type: 'Literal', - value: '@theme/Admonition', - raw: "'@theme/Admonition'", - }, - }, - ], - sourceType: 'module', - }, - }, - }; -} - -function createAdmonitionNode({ - directive, - title, - contentNodes, -}: { - directive: ContainerDirective; - title: unknown; - contentNodes: unknown; -}) { - return { - type: 'mdxJsxFlowElement', - name: 'Admonition', - attributes: [ - { - type: 'mdxJsxAttribute', - name: 'type', - value: directive.name, - }, - { - type: 'mdxJsxAttribute', - name: 'title', - value: { - type: 'mdxJsxAttributeValueExpression', - // TODO this is the complex part I couldn't solve :/ - value: mdastToValueExpression(title), - }, - }, - ], - children: contentNodes, - }; -} - */ - type DirectiveLabel = Parent; type DirectiveContent = ContainerDirective['children']; @@ -154,10 +79,6 @@ function getTextOnlyTitle(directiveLabel: DirectiveLabel): string | undefined { : undefined; } -// This string value does not matter much -// It is ignored because nodes are using hName/hProperties coming from HAST -// const admonitionNodeType = 'admonitionHTML'; - const plugin: Plugin = function plugin( this: Processor, optionsInput: Partial = {}, @@ -165,24 +86,8 @@ const plugin: Plugin = function plugin( const {keywords} = normalizeAdmonitionOptions(optionsInput); return async (root) => { - /* - let transformed = false; - let alreadyImported = false; - */ - visit(root, (node) => { - /* - if (isAdmonitionImport(node)) { - alreadyImported = true; - } - */ - - // See also: - // https://talk.commonmark.org/t/generic-directives-plugins-syntax/444 - // https://github.com/remarkjs/remark-directive if (node.type === 'containerDirective') { - // transformed = true; - const directive = node as ContainerDirective; const isAdmonition = keywords.includes(directive.name); @@ -192,17 +97,6 @@ const plugin: Plugin = function plugin( const {directiveLabel, contentNodes} = parseDirective(directive); - /* - // :::tip{title="my title} overrides :::tip[my title] - const title = directive.attributes?.title ?? directiveLabel?.children; - const admonitionNode = createAdmonitionNode({ - directive, - title, - contentNodes, - }); - parent!.children.splice(index, 1, admonitionNode); - */ - const textOnlyTitle = directive.attributes?.title ?? (directiveLabel ? getTextOnlyTitle(directiveLabel) : undefined); @@ -237,12 +131,6 @@ const plugin: Plugin = function plugin( } } }); - - /* - if (transformed && !alreadyImported) { - (root as Parent).children.unshift(createImportNode()); - } - */ }; }; diff --git a/packages/docusaurus-utils-validation/src/__tests__/__snapshots__/validationSchemas.test.ts.snap b/packages/docusaurus-utils-validation/src/__tests__/__snapshots__/validationSchemas.test.ts.snap index c0d9d3dd2aaf..b1f8cc75ee7e 100644 --- a/packages/docusaurus-utils-validation/src/__tests__/__snapshots__/validationSchemas.test.ts.snap +++ b/packages/docusaurus-utils-validation/src/__tests__/__snapshots__/validationSchemas.test.ts.snap @@ -2,27 +2,19 @@ exports[`validation schemas admonitionsSchema: for value=[] 1`] = `""value" does not look like a valid admonitions config"`; -exports[`validation schemas admonitionsSchema: for value={"customTypes":{"myKeyword":{"keyword":"myKeyword","infima":true,"svg":""}}} 1`] = ` -"The Docusaurus admonitions system has changed, and the option "customTypes" does not exist anymore. -You now need to swizzle the admonitions component to provide UI customizations such as icons. -Please refer to https://github.com/facebook/docusaurus/pull/7152 for detailed upgrade instructions." -`; +exports[`validation schemas admonitionsSchema: for value={"customTypes":{"myKeyword":{"keyword":"myKeyword","infima":true,"svg":""}}} 1`] = `""customTypes" is not allowed"`; -exports[`validation schemas admonitionsSchema: for value={"icons":"emoji"} 1`] = ` -"The Docusaurus admonitions system has changed, and the option "icons" does not exist anymore. -You now need to swizzle the admonitions component to provide UI customizations such as icons. -Please refer to https://github.com/facebook/docusaurus/pull/7152 for detailed upgrade instructions." -`; +exports[`validation schemas admonitionsSchema: for value={"icons":"emoji"} 1`] = `""icons" is not allowed"`; -exports[`validation schemas admonitionsSchema: for value={"infima":true} 1`] = ` -"The Docusaurus admonitions system has changed, and the option "infima" does not exist anymore. -You now need to swizzle the admonitions component to provide UI customizations such as icons. -Please refer to https://github.com/facebook/docusaurus/pull/7152 for detailed upgrade instructions." -`; +exports[`validation schemas admonitionsSchema: for value={"infima":true} 1`] = `""infima" is not allowed"`; exports[`validation schemas admonitionsSchema: for value={"keywords":["custom-keyword"],"extendDefaults":42} 1`] = `""extendDefaults" must be a boolean"`; -exports[`validation schemas admonitionsSchema: for value={"tag":""} 1`] = `""tag" is not allowed to be empty"`; +exports[`validation schemas admonitionsSchema: for value={"tag":""} 1`] = `"It is not possible anymore to use a custom admonition tag. The only admonition tag supported is ':::' (Markdown Directive syntax)"`; + +exports[`validation schemas admonitionsSchema: for value={"tag":"+++","keywords":["info","tip"]} 1`] = `"It is not possible anymore to use a custom admonition tag. The only admonition tag supported is ':::' (Markdown Directive syntax)"`; + +exports[`validation schemas admonitionsSchema: for value={"tag":"+++"} 1`] = `"It is not possible anymore to use a custom admonition tag. The only admonition tag supported is ':::' (Markdown Directive syntax)"`; exports[`validation schemas admonitionsSchema: for value={"unknownAttribute":"val"} 1`] = `""unknownAttribute" is not allowed"`; diff --git a/packages/docusaurus-utils-validation/src/__tests__/validationSchemas.test.ts b/packages/docusaurus-utils-validation/src/__tests__/validationSchemas.test.ts index 702856073649..0769edfd077f 100644 --- a/packages/docusaurus-utils-validation/src/__tests__/validationSchemas.test.ts +++ b/packages/docusaurus-utils-validation/src/__tests__/validationSchemas.test.ts @@ -97,22 +97,22 @@ describe('validation schemas', () => { testOK(true); testOK(false); testOK({}); - testOK({tag: '+++'}); testOK({keywords: ['info', 'tip']}); testOK({keywords: ['info', 'tip'], extendDefaults: true}); testOK({keywords: ['info', 'tip'], extendDefaults: false}); testOK({keywords: []}); testOK({keywords: [], extendDefaults: true}); // noop testOK({keywords: [], extendDefaults: false}); // disable admonitions - testOK({tag: '+++', keywords: ['info', 'tip']}); - testOK({tag: '+++', keywords: ['custom-keyword'], extendDefaults: true}); - testOK({tag: '+++', keywords: ['custom-keyword'], extendDefaults: false}); + testOK({keywords: ['custom-keyword'], extendDefaults: true}); + testOK({keywords: ['custom-keyword'], extendDefaults: false}); testFail(3); testFail([]); testFail({unknownAttribute: 'val'}); testFail({tag: ''}); testFail({keywords: ['custom-keyword'], extendDefaults: 42}); + testFail({tag: '+++'}); + testFail({tag: '+++', keywords: ['info', 'tip']}); // Legacy types testFail({ diff --git a/packages/docusaurus-utils-validation/src/validationSchemas.ts b/packages/docusaurus-utils-validation/src/validationSchemas.ts index 0044855aee43..c037e652f8bf 100644 --- a/packages/docusaurus-utils-validation/src/validationSchemas.ts +++ b/packages/docusaurus-utils-validation/src/validationSchemas.ts @@ -37,17 +37,10 @@ const MarkdownPluginsSchema = Joi.array() export const RemarkPluginsSchema = MarkdownPluginsSchema; export const RehypePluginsSchema = MarkdownPluginsSchema; -const LegacyAdmonitionConfigSchema = Joi.forbidden().messages({ - 'any.unknown': `The Docusaurus admonitions system has changed, and the option {#label} does not exist anymore. -You now need to swizzle the admonitions component to provide UI customizations such as icons. -Please refer to https://github.com/facebook/docusaurus/pull/7152 for detailed upgrade instructions.`, -}); - export const AdmonitionsSchema = JoiFrontMatter.alternatives() .try( JoiFrontMatter.boolean().required(), JoiFrontMatter.object({ - tag: JoiFrontMatter.string(), keywords: JoiFrontMatter.array().items( JoiFrontMatter.string(), // Apparently this is how we tell job to accept empty arrays... @@ -56,9 +49,9 @@ export const AdmonitionsSchema = JoiFrontMatter.alternatives() extendDefaults: JoiFrontMatter.boolean(), // TODO Remove before 2023 - customTypes: LegacyAdmonitionConfigSchema, - icons: LegacyAdmonitionConfigSchema, - infima: LegacyAdmonitionConfigSchema, + tag: Joi.any().forbidden().messages({ + 'any.unknown': `It is not possible anymore to use a custom admonition tag. The only admonition tag supported is ':::' (Markdown Directive syntax)`, + }), }).required(), ) .default(true) From 66317de85221c6af4dd15b1501f1710565ff13d0 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 18:58:18 +0100 Subject: [PATCH 130/155] admonitions: change extendDefaults default value --- .../src/remark/admonitions/__tests__/index.test.ts | 2 +- packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts | 2 +- .../guides/markdown-features/markdown-features-admonitions.mdx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts index d84aa91cf685..1aed773ea56d 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts @@ -57,7 +57,7 @@ describe('admonitions remark plugin', () => { it('default behavior for custom keyword', async () => { const result = await processFixture('base', { keywords: ['tip'], - // extendDefaults: false, // By default we don't extend + extendDefaults: undefined, // By default we extend }); expect(result).toMatchSnapshot(); }); diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts index e253dcd23ad8..4d49a4e5342b 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts @@ -29,7 +29,7 @@ export const DefaultAdmonitionOptions: AdmonitionOptions = { 'important', 'caution', ], - extendDefaults: false, // TODO make it true by default: breaking change + extendDefaults: true, }; export function normalizeAdmonitionOptions( diff --git a/website/docs/guides/markdown-features/markdown-features-admonitions.mdx b/website/docs/guides/markdown-features/markdown-features-admonitions.mdx index 7ad19c856d72..7cf423bbdbce 100644 --- a/website/docs/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/docs/guides/markdown-features/markdown-features-admonitions.mdx @@ -324,7 +324,7 @@ The plugin accepts the following options: - `tag`: The tag that encloses the admonition. Defaults to `:::`. - `keywords`: An array of keywords that can be used as the type for the admonition. -- `extendDefaults`: Should the provided options (such as `keywords`) be merged into the existing defaults. Defaults to `false`. +- `extendDefaults`: Should the provided options (such as `keywords`) be merged into the existing defaults. Defaults to `true`. The `keyword` will be passed as the `type` prop of the `Admonition` component. From 325826b0a9981a56196846eae20b7eb27820029a Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 17 Mar 2023 19:03:58 +0100 Subject: [PATCH 131/155] admonitions: remove docs for tag option in current version --- .../guides/markdown-features/markdown-features-admonitions.mdx | 3 --- website/docusaurus.config.js | 1 - 2 files changed, 4 deletions(-) diff --git a/website/docs/guides/markdown-features/markdown-features-admonitions.mdx b/website/docs/guides/markdown-features/markdown-features-admonitions.mdx index 7cf423bbdbce..f503005a84b3 100644 --- a/website/docs/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/docs/guides/markdown-features/markdown-features-admonitions.mdx @@ -309,7 +309,6 @@ module.exports = { { docs: { admonitions: { - tag: ':::', keywords: ['note', 'tip', 'info', 'caution', 'danger'], extendDefaults: true, }, @@ -322,7 +321,6 @@ module.exports = { The plugin accepts the following options: -- `tag`: The tag that encloses the admonition. Defaults to `:::`. - `keywords`: An array of keywords that can be used as the type for the admonition. - `extendDefaults`: Should the provided options (such as `keywords`) be merged into the existing defaults. Defaults to `true`. @@ -344,7 +342,6 @@ module.exports = { // ... docs: { admonitions: { - tag: ':::', keywords: ['my-custom-admonition'], extendDefaults: true, }, diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 6ca1602a5fb7..33e4a66c869f 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -321,7 +321,6 @@ const config = { }, admonitions: { keywords: ['my-custom-admonition'], - extendDefaults: true, }, showLastUpdateAuthor: true, showLastUpdateTime: true, From cd5047512e4cca3323849bd8146113a4386d2ae8 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 7 Apr 2023 19:23:24 +0200 Subject: [PATCH 132/155] fix introduction page --- .../versioned_docs/version-2.4.0/introduction.mdx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/website/versioned_docs/version-2.4.0/introduction.mdx b/website/versioned_docs/version-2.4.0/introduction.mdx index 46b616c7d5d6..383563a61f19 100644 --- a/website/versioned_docs/version-2.4.0/introduction.mdx +++ b/website/versioned_docs/version-2.4.0/introduction.mdx @@ -50,12 +50,13 @@ Or read the **[5-minute tutorial](https://tutorial.docusaurus.io)** online. In this presentation at [Algolia Community Event](https://www.algolia.com/), [Meta Open Source team](https://opensource.facebook.com/) shared a brief walk-through of Docusaurus. They covered how to get started with the project, enable plugins, and set up functionalities like documentation and blogging. +{/* cSpell:ignore Yhyx Sksg */} + ```mdx-code-block import LiteYouTubeEmbed from 'react-lite-youtube-embed';
- ## Comparison with other tools {#comparison-with-other-tools} Across all static site generators, Docusaurus has a unique focus on documentation sites and has many out-of-the-box features. From 2641fcdc6273d90eb6b9e6898553644da4f2e131 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 7 Apr 2023 19:39:02 +0200 Subject: [PATCH 133/155] backport 2.4 docs mdx changes --- .../api/plugins/plugin-content-blog.mdx | 2 +- .../markdown-features-admonitions.mdx | 2 +- .../markdown-features-react.mdx | 18 ++++++++---------- .../markdown-features-tabs.mdx | 6 ++---- .../markdown-features-toc.mdx | 8 ++++---- .../versioned_docs/version-2.4.0/search.mdx | 2 +- 6 files changed, 17 insertions(+), 21 deletions(-) diff --git a/website/versioned_docs/version-2.4.0/api/plugins/plugin-content-blog.mdx b/website/versioned_docs/version-2.4.0/api/plugins/plugin-content-blog.mdx index b9677afcd8b7..e6ffc4d9b01c 100644 --- a/website/versioned_docs/version-2.4.0/api/plugins/plugin-content-blog.mdx +++ b/website/versioned_docs/version-2.4.0/api/plugins/plugin-content-blog.mdx @@ -69,7 +69,7 @@ Accepted fields: | `feedOptions.type` | FeedType \| FeedType[] \| 'all' \| null | **Required** | Type of feed to be generated. Use `null` to disable generation. | | `feedOptions.createFeedItems` | CreateFeedItemsFn \| undefined | `undefined` | An optional function which can be used to transform and / or filter the items in the feed. | | `feedOptions.title` | `string` | `siteConfig.title` | Title of the feed. | -| `feedOptions.description` | `string` | \`${siteConfig.title} Blog\` | Description of the feed. | +| `feedOptions.description` | `string` | \`$\{siteConfig.title} Blog\` | Description of the feed. | | `feedOptions.copyright` | `string` | `undefined` | Copyright message. | | `feedOptions.language` | `string` (See [documentation](http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes) for possible values) | `undefined` | Language metadata of the feed. | | `sortPosts` | 'descending' \| 'ascending' | `'descending'` | Governs the direction of blog post sorting. | diff --git a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx index f4c00f7c3f4a..0ea3e6b9075e 100644 --- a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx @@ -87,7 +87,7 @@ Some **content** with _Markdown_ `syntax`. Check [this `api`](#). If you use [Prettier](https://prettier.io) to format your Markdown files, Prettier might auto-format your code to invalid admonition syntax. To avoid this problem, add empty lines around the starting and ending directives. This is also why the examples we show here all have empty lines around the content. - +{/* prettier-ignore */} ```md :::note diff --git a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-react.mdx b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-react.mdx index 5bd883980e72..da8e9fd86be0 100644 --- a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-react.mdx +++ b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-react.mdx @@ -76,7 +76,7 @@ I can write **Markdown** alongside my _JSX_! Since all doc files are parsed using MDX, anything that looks like HTML is actually JSX. Therefore, if you need to inline-style a component, follow JSX flavor and provide style objects. - +{/* prettier-ignore */} ```jsx /* Instead of this: */ Foo @@ -94,7 +94,7 @@ In addition, MDX is not [100% compatible with CommonMark](https://github.com/fac You can also import your own components defined in other files or third-party components installed via npm. - +{/* prettier-ignore */} ```md import TOCInline from '@theme/TOCInline'; @@ -341,7 +341,7 @@ Use JSX within JSX tag, or move the Markdown to the outer layer:
``` - +{/* prettier-ignore */} ```jsx
**Bold still doesn't work** @@ -367,7 +367,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -397,7 +397,7 @@ Add an empty new line:
``` - +{/* prettier-ignore */} ```jsx
@@ -427,7 +427,7 @@ Don't indent:
``` - +{/* prettier-ignore */} ```jsx
@@ -463,14 +463,13 @@ npm install --save raw-loader Now you can import code snippets from another file as it is: - +{/* prettier-ignore */} ```jsx title="myMarkdownFile.mdx" import CodeBlock from '@theme/CodeBlock'; import MyComponentSource from '!!raw-loader!./myComponent'; {MyComponentSource} ``` - ```mdx-code-block import CodeBlock from '@theme/CodeBlock'; @@ -509,13 +508,12 @@ By convention, using the **`_` filename prefix** will not create any doc page an This is text some content from `_markdown-partial-example.mdx`. ``` - +{/* prettier-ignore */} ```jsx title="someOtherDoc.mdx" import PartialExample from './_markdown-partial-example.mdx'; ``` - ```mdx-code-block import PartialExample from './_markdown-partial-example.mdx'; diff --git a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-tabs.mdx b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-tabs.mdx index 948c61ef6757..4f9973d557a3 100644 --- a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-tabs.mdx +++ b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-tabs.mdx @@ -15,7 +15,7 @@ import styles from './markdown-features-tabs-styles.module.css'; Docusaurus provides the `` component that you can use in Markdown thanks to [MDX](./markdown-features-react.mdx): - +{/* prettier-ignore */} ```jsx import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -32,7 +32,6 @@ import TabItem from '@theme/TabItem'; ``` - ```mdx-code-block @@ -250,7 +249,7 @@ You might want to customize the appearance of a certain set of tabs. You can pas You can also customize each tab heading independently by using the `attributes` field. The extra props can be passed to the headings either through the `values` prop in `Tabs`, or props of each `TabItem`—in the same way as you declare `label`. - +{/* prettier-ignore */} ```jsx title="some-doc.mdx" import styles from './styles.module.css'; @@ -266,7 +265,6 @@ import styles from './styles.module.css'; ``` - ```css title="styles.module.css" .red { diff --git a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-toc.mdx b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-toc.mdx index 4b2857c4f7c1..b1b6507f2559 100644 --- a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-toc.mdx +++ b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-toc.mdx @@ -43,8 +43,8 @@ Generated IDs have **some limitations**: A special Markdown syntax lets you set an **explicit heading id**: -```md -### Hello World {#my-explicit-id} +```mdx-code-block +{'### Hello World \u007B#my-explicit-id}\n'} ``` :::tip @@ -102,7 +102,7 @@ It is also possible to display an inline table of contents directly inside a Mar The `toc` variable is available in any MDX document and contains all the headings of an MDX document. By default, only `h2` and `h3` headings are displayed in the TOC. You can change which heading levels are visible by setting `minHeadingLevel` or `maxHeadingLevel` for individual `TOCInline` components. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; @@ -129,7 +129,7 @@ declare const toc: { Note that the `toc` global is a flat array, so you can easily cut out unwanted nodes or insert extra nodes, and create a new TOC tree. - +{/* prettier-ignore */} ```jsx import TOCInline from '@theme/TOCInline'; diff --git a/website/versioned_docs/version-2.4.0/search.mdx b/website/versioned_docs/version-2.4.0/search.mdx index 32fdcd7f6850..78f785bca0cb 100644 --- a/website/versioned_docs/version-2.4.0/search.mdx +++ b/website/versioned_docs/version-2.4.0/search.mdx @@ -247,7 +247,7 @@ Still, you can reuse the [Infima CSS variables](styling-layout.mdx#styling-your- ### Customizing the Algolia search behavior {#customizing-the-algolia-search-behavior} - +{/* TODO: update options link once the documentation is available on the DocSearch website */} Algolia DocSearch supports a [list of options](https://autocomplete-experimental.netlify.app/docs/DocSearchModal#reference) that you can pass to the `algolia` field in the `docusaurus.config.js` file. From 22449f2ef4230929ea57364b5214937d99b698bb Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 13 Apr 2023 19:46:32 +0200 Subject: [PATCH 134/155] Add siteConfig.markdown.mdx1Compat config --- packages/docusaurus-mdx-loader/src/loader.ts | 9 +++++---- .../docusaurus-mdx-loader/src/preprocessor.ts | 16 ++++++++++++---- packages/docusaurus-types/src/config.d.ts | 10 ++++++++++ .../server/__tests__/configValidation.test.ts | 10 ++++++++++ .../docusaurus/src/server/configValidation.ts | 16 ++++++++++++++++ 5 files changed, 53 insertions(+), 8 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index b0be6d0ee73d..fa6853fd8c9c 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -206,12 +206,13 @@ export async function mdxLoader( const content = preprocessor(contentUnprocessed, { admonitions: reqOptions.admonitions, + markdownConfig: reqOptions.markdownConfig, }); const hasFrontMatter = Object.keys(frontMatter).length > 0; if (!compilerCache.has(this.query)) { - const remarkPlugins: ProcessorOptions['remarkPlugins'] = [ + const remarkPlugins: MDXPlugin[] = [ ...(reqOptions.beforeDefaultRemarkPlugins ?? []), (await import('remark-directive')).default, ...getAdmonitionsPlugins(reqOptions.admonitions ?? false), @@ -234,15 +235,15 @@ export async function mdxLoader( }, ], gfm, - comment, // TODO add this conditionally + reqOptions.markdownConfig.mdx1Compat.comments ? comment : null, ...(reqOptions.remarkPlugins ?? []), - ]; + ].filter((plugin): plugin is MDXPlugin => Boolean(plugin)); // codeCompatPlugin needs to be applied last after user-provided plugins // (after npm2yarn for example) remarkPlugins.push(codeCompatPlugin); - const rehypePlugins: ProcessorOptions['rehypePlugins'] = [ + const rehypePlugins: MDXPlugin[] = [ ...(reqOptions.beforeDefaultRehypePlugins ?? []), ...DEFAULT_OPTIONS.rehypePlugins, ...(reqOptions.rehypePlugins ?? []), diff --git a/packages/docusaurus-mdx-loader/src/preprocessor.ts b/packages/docusaurus-mdx-loader/src/preprocessor.ts index c03c37b52c0f..3562eaa42384 100644 --- a/packages/docusaurus-mdx-loader/src/preprocessor.ts +++ b/packages/docusaurus-mdx-loader/src/preprocessor.ts @@ -11,15 +11,23 @@ import { admonitionTitleToDirectiveLabel, } from '@docusaurus/utils'; import {normalizeAdmonitionOptions} from './remark/admonitions'; -import type {MDXOptions} from './loader'; +import type {Options} from './loader'; export default function preprocessContent( md: string, - {admonitions}: {admonitions: MDXOptions['admonitions'] | undefined}, + { + markdownConfig, + admonitions, + }: { + markdownConfig: Options['markdownConfig']; + admonitions: Options['admonitions'] | undefined; + }, ): string { md = unwrapMdxCodeBlocks(md); - md = escapeMarkdownHeadingIds(md); - if (admonitions) { + if (markdownConfig.mdx1Compat.headingIds) { + md = escapeMarkdownHeadingIds(md); + } + if (markdownConfig.mdx1Compat.admonitions && admonitions) { const {keywords} = normalizeAdmonitionOptions(admonitions); md = admonitionTitleToDirectiveLabel(md, keywords); } diff --git a/packages/docusaurus-types/src/config.d.ts b/packages/docusaurus-types/src/config.d.ts index fa8fe1a190ea..f3e2c5ee62fa 100644 --- a/packages/docusaurus-types/src/config.d.ts +++ b/packages/docusaurus-types/src/config.d.ts @@ -28,6 +28,16 @@ export type MarkdownConfig = { * @default false */ mermaid?: boolean; + + /** + * Set of flags make it easier to upgrade from MDX 1 to MDX 2 + * See also https://github.com/facebook/docusaurus/issues/4029 + */ + mdx1Compat: { + comments: boolean; + admonitions: boolean; + headingIds: boolean; + }; }; /** diff --git a/packages/docusaurus/src/server/__tests__/configValidation.test.ts b/packages/docusaurus/src/server/__tests__/configValidation.test.ts index e6e0bcd225ff..f4ae9e9177ea 100644 --- a/packages/docusaurus/src/server/__tests__/configValidation.test.ts +++ b/packages/docusaurus/src/server/__tests__/configValidation.test.ts @@ -60,6 +60,11 @@ describe('normalizeConfig', () => { ], markdown: { mermaid: true, + mdx1Compat: { + comments: true, + admonitions: false, + headingIds: true, + }, }, }; const normalizedConfig = normalizeConfig(userConfig); @@ -496,6 +501,11 @@ describe('markdown', () => { it('accepts valid markdown object', () => { const markdown: DocusaurusConfig['markdown'] = { mermaid: true, + mdx1Compat: { + comments: false, + admonitions: true, + headingIds: false, + }, }; expect( normalizeConfig({ diff --git a/packages/docusaurus/src/server/configValidation.ts b/packages/docusaurus/src/server/configValidation.ts index 092a634677b8..2ba0ebc15635 100644 --- a/packages/docusaurus/src/server/configValidation.ts +++ b/packages/docusaurus/src/server/configValidation.ts @@ -66,6 +66,11 @@ export const DEFAULT_CONFIG: Pick< staticDirectories: [DEFAULT_STATIC_DIR_NAME], markdown: { mermaid: false, + mdx1Compat: { + comments: true, + admonitions: true, + headingIds: true, + }, }, }; @@ -271,6 +276,17 @@ export const ConfigSchema = Joi.object({ }).optional(), markdown: Joi.object({ mermaid: Joi.boolean().default(DEFAULT_CONFIG.markdown.mermaid), + mdx1Compat: Joi.object({ + comments: Joi.boolean().default( + DEFAULT_CONFIG.markdown.mdx1Compat.comments, + ), + admonitions: Joi.boolean().default( + DEFAULT_CONFIG.markdown.mdx1Compat.admonitions, + ), + headingIds: Joi.boolean().default( + DEFAULT_CONFIG.markdown.mdx1Compat.headingIds, + ), + }).default(DEFAULT_CONFIG.markdown.mdx1Compat), }).default(DEFAULT_CONFIG.markdown), }).messages({ 'docusaurus.configValidationWarning': From 5f0a5071f09810aa2c84d8547d8a97613d362740 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 14 Apr 2023 11:52:00 +0200 Subject: [PATCH 135/155] add proper markdown.mdx1Compat + markdown.preprocessor support + dogfood preprocessor --- packages/docusaurus-mdx-loader/src/loader.ts | 4 +- .../docusaurus-mdx-loader/src/preprocessor.ts | 40 +++++++++------ .../admonitions/__tests__/index.test.ts | 12 ++++- packages/docusaurus-types/src/config.d.ts | 10 +++- .../__snapshots__/config.test.ts.snap | 30 ++++++++++++ .../server/__tests__/configValidation.test.ts | 49 ++++++++++++++++++- .../docusaurus/src/server/configValidation.ts | 5 ++ project-words.txt | 2 + website/docusaurus.config.js | 12 +++++ 9 files changed, 146 insertions(+), 18 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index fa6853fd8c9c..076b0d315a63 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -204,7 +204,9 @@ export async function mdxLoader( }, ); - const content = preprocessor(contentUnprocessed, { + const content = preprocessor({ + fileContent: contentUnprocessed, + filePath, admonitions: reqOptions.admonitions, markdownConfig: reqOptions.markdownConfig, }); diff --git a/packages/docusaurus-mdx-loader/src/preprocessor.ts b/packages/docusaurus-mdx-loader/src/preprocessor.ts index 3562eaa42384..0581e6bcd9cc 100644 --- a/packages/docusaurus-mdx-loader/src/preprocessor.ts +++ b/packages/docusaurus-mdx-loader/src/preprocessor.ts @@ -13,23 +13,35 @@ import { import {normalizeAdmonitionOptions} from './remark/admonitions'; import type {Options} from './loader'; -export default function preprocessContent( - md: string, - { - markdownConfig, - admonitions, - }: { - markdownConfig: Options['markdownConfig']; - admonitions: Options['admonitions'] | undefined; - }, -): string { - md = unwrapMdxCodeBlocks(md); +/** + * Preprocess the string before passing it to MDX + * This is not particularly recommended but makes it easier to upgrade to MDX 2 + */ +export default function preprocessContent({ + fileContent: initialFileContent, + filePath, + markdownConfig, + admonitions, +}: { + fileContent: string; + filePath: string; + markdownConfig: Options['markdownConfig']; + admonitions: Options['admonitions'] | undefined; +}): string { + let fileContent = initialFileContent; + if (markdownConfig.preprocessor) { + fileContent = markdownConfig.preprocessor({ + fileContent, + filePath, + }); + } + fileContent = unwrapMdxCodeBlocks(fileContent); if (markdownConfig.mdx1Compat.headingIds) { - md = escapeMarkdownHeadingIds(md); + fileContent = escapeMarkdownHeadingIds(fileContent); } if (markdownConfig.mdx1Compat.admonitions && admonitions) { const {keywords} = normalizeAdmonitionOptions(admonitions); - md = admonitionTitleToDirectiveLabel(md, keywords); + fileContent = admonitionTitleToDirectiveLabel(fileContent, keywords); } - return md; + return fileContent; } diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts index 1aed773ea56d..7784850e44e1 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/__tests__/index.test.ts @@ -22,8 +22,18 @@ const processFixture = async ( const filePath = path.join(__dirname, '__fixtures__', `${name}.md`); const file = await vfile.read(filePath); - const fileContentPreprocessed = preprocessor(file.toString(), { + const fileContentPreprocessed = preprocessor({ + fileContent: file.toString(), + filePath, admonitions: DefaultAdmonitionOptions, + markdownConfig: { + mermaid: false, + mdx1Compat: { + admonitions: true, + comments: false, + headingIds: false, + }, + }, }); /* diff --git a/packages/docusaurus-types/src/config.d.ts b/packages/docusaurus-types/src/config.d.ts index f3e2c5ee62fa..6c7e16f100c0 100644 --- a/packages/docusaurus-types/src/config.d.ts +++ b/packages/docusaurus-types/src/config.d.ts @@ -27,7 +27,15 @@ export type MarkdownConfig = { * @see https://docusaurus.io/docs/markdown-features/diagrams/ * @default false */ - mermaid?: boolean; + mermaid: boolean; + + /** + * Gives opportunity to preprocess the MDX string content before compiling. + * A good escape hatch that can be used to handle edge cases. + * + * @param args + */ + preprocessor?: (args: {filePath: string; fileContent: string}) => string; /** * Set of flags make it easier to upgrade from MDX 1 to MDX 2 diff --git a/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap b/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap index 9ba1e01a4cdd..da4d582b281d 100644 --- a/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap +++ b/packages/docusaurus/src/server/__tests__/__snapshots__/config.test.ts.snap @@ -17,7 +17,13 @@ exports[`loadSiteConfig website with .cjs siteConfig 1`] = ` "path": "i18n", }, "markdown": { + "mdx1Compat": { + "admonitions": true, + "comments": true, + "headingIds": true, + }, "mermaid": false, + "preprocessor": undefined, }, "noIndex": false, "onBrokenLinks": "throw", @@ -58,7 +64,13 @@ exports[`loadSiteConfig website with valid async config 1`] = ` "path": "i18n", }, "markdown": { + "mdx1Compat": { + "admonitions": true, + "comments": true, + "headingIds": true, + }, "mermaid": false, + "preprocessor": undefined, }, "noIndex": false, "onBrokenLinks": "throw", @@ -101,7 +113,13 @@ exports[`loadSiteConfig website with valid async config creator function 1`] = ` "path": "i18n", }, "markdown": { + "mdx1Compat": { + "admonitions": true, + "comments": true, + "headingIds": true, + }, "mermaid": false, + "preprocessor": undefined, }, "noIndex": false, "onBrokenLinks": "throw", @@ -144,7 +162,13 @@ exports[`loadSiteConfig website with valid config creator function 1`] = ` "path": "i18n", }, "markdown": { + "mdx1Compat": { + "admonitions": true, + "comments": true, + "headingIds": true, + }, "mermaid": false, + "preprocessor": undefined, }, "noIndex": false, "onBrokenLinks": "throw", @@ -190,7 +214,13 @@ exports[`loadSiteConfig website with valid siteConfig 1`] = ` "path": "i18n", }, "markdown": { + "mdx1Compat": { + "admonitions": true, + "comments": true, + "headingIds": true, + }, "mermaid": false, + "preprocessor": undefined, }, "noIndex": false, "onBrokenLinks": "throw", diff --git a/packages/docusaurus/src/server/__tests__/configValidation.test.ts b/packages/docusaurus/src/server/__tests__/configValidation.test.ts index f4ae9e9177ea..465e99e05ce6 100644 --- a/packages/docusaurus/src/server/__tests__/configValidation.test.ts +++ b/packages/docusaurus/src/server/__tests__/configValidation.test.ts @@ -32,7 +32,7 @@ describe('normalizeConfig', () => { }); it('accepts correctly defined config options', () => { - const userConfig = { + const userConfig: Config = { ...DEFAULT_CONFIG, ...baseConfig, tagline: 'my awesome site', @@ -60,6 +60,7 @@ describe('normalizeConfig', () => { ], markdown: { mermaid: true, + preprocessor: ({fileContent}) => fileContent, mdx1Compat: { comments: true, admonitions: false, @@ -501,6 +502,7 @@ describe('markdown', () => { it('accepts valid markdown object', () => { const markdown: DocusaurusConfig['markdown'] = { mermaid: true, + preprocessor: ({fileContent}) => fileContent, mdx1Compat: { comments: false, admonitions: true, @@ -514,6 +516,51 @@ describe('markdown', () => { ).toEqual(expect.objectContaining({markdown})); }); + it('accepts partial markdown object', () => { + const markdown: DeepPartial = { + mdx1Compat: { + admonitions: true, + headingIds: false, + }, + }; + expect( + normalizeConfig({ + markdown, + }), + ).toEqual( + expect.objectContaining({ + markdown: { + ...DEFAULT_CONFIG.markdown, + ...markdown, + mdx1Compat: { + ...DEFAULT_CONFIG.markdown.mdx1Compat, + ...markdown.mdx1Compat, + }, + }, + }), + ); + }); + + it('throw for preprocessor bad arity', () => { + expect(() => + normalizeConfig({ + markdown: {preprocessor: () => 'content'}, + }), + ).toThrowErrorMatchingInlineSnapshot(` + ""markdown.preprocessor" must have an arity of 1 + " + `); + expect(() => + normalizeConfig({ + // @ts-expect-error: types forbid this + markdown: {preprocessor: (arg1, arg2) => String(arg1) + String(arg2)}, + }), + ).toThrowErrorMatchingInlineSnapshot(` + ""markdown.preprocessor" must have an arity of 1 + " + `); + }); + it('throw for null object', () => { expect(() => { normalizeConfig({ diff --git a/packages/docusaurus/src/server/configValidation.ts b/packages/docusaurus/src/server/configValidation.ts index 2ba0ebc15635..47db1ed29b34 100644 --- a/packages/docusaurus/src/server/configValidation.ts +++ b/packages/docusaurus/src/server/configValidation.ts @@ -66,6 +66,7 @@ export const DEFAULT_CONFIG: Pick< staticDirectories: [DEFAULT_STATIC_DIR_NAME], markdown: { mermaid: false, + preprocessor: undefined, mdx1Compat: { comments: true, admonitions: true, @@ -276,6 +277,10 @@ export const ConfigSchema = Joi.object({ }).optional(), markdown: Joi.object({ mermaid: Joi.boolean().default(DEFAULT_CONFIG.markdown.mermaid), + preprocessor: Joi.function() + .arity(1) + .optional() + .default(() => DEFAULT_CONFIG.markdown.preprocessor), mdx1Compat: Joi.object({ comments: Joi.boolean().default( DEFAULT_CONFIG.markdown.mdx1Compat.comments, diff --git a/project-words.txt b/project-words.txt index 0de24cd4c3c3..cae0c44958fa 100644 --- a/project-words.txt +++ b/project-words.txt @@ -137,6 +137,7 @@ immer infima inlines intelli +intellij interactiveness interpolatable investec @@ -393,6 +394,7 @@ wcag webfactory webp webpackbar +webstorm wolcott writeups xclip diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index a0bbe8465477..7d692a9701d0 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -138,6 +138,18 @@ const config = { }, markdown: { mermaid: true, + preprocessor: ({filePath, fileContent}) => { + if (isDev) { + // "vscode://file/${projectPath}${filePath}:${line}:${column}", + // "webstorm://open?file=${projectPath}${filePath}&line=${line}&column=${column}", + const vscodeLink = `vscode://file/${filePath}`; + const webstormLink = `webstorm://open?file=${filePath}`; + const intellijLink = `idea://open?file=${filePath}`; + return `${fileContent}\n\n---\n\n**DEV**: open this file in [VSCode](${vscodeLink}) | [WebStorm](${webstormLink}) | [IntelliJ](${intellijLink})\n`; + } + return fileContent; + }, + mdx1Compat: {}, }, onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', From 6470c2c3c101eed2b9923153e3bcea3ab357ee9e Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 14 Apr 2023 12:00:44 +0200 Subject: [PATCH 136/155] fix snapshot --- .../src/server/__tests__/__snapshots__/index.test.ts.snap | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/docusaurus/src/server/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus/src/server/__tests__/__snapshots__/index.test.ts.snap index 0894af65eec3..1051919eb867 100644 --- a/packages/docusaurus/src/server/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus/src/server/__tests__/__snapshots__/index.test.ts.snap @@ -91,7 +91,13 @@ exports[`load loads props for site with custom i18n path 1`] = ` "path": "i18n", }, "markdown": { + "mdx1Compat": { + "admonitions": true, + "comments": true, + "headingIds": true, + }, "mermaid": false, + "preprocessor": undefined, }, "noIndex": false, "onBrokenLinks": "throw", From d57382c770ddee1e033b032cd901f526eb9cb4b9 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 14 Apr 2023 12:45:26 +0200 Subject: [PATCH 137/155] Better MDX compilation error messages --- packages/docusaurus-mdx-loader/src/loader.ts | 16 +++++++--------- packages/docusaurus/src/webpack/utils.ts | 4 +++- website/docusaurus.config.js | 4 +++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 076b0d315a63..b3faea4f87bc 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -278,17 +278,15 @@ export async function mdxLoader( path: filePath, }) .then((res) => res.toString()); - } catch (err) { - console.log({err}); - // TODO why do we have to do such things to get a good error message :s + } catch (errorUnknown) { + const error = errorUnknown as Error; return callback( new Error( - `MDX compilation failed for file ${filePath}\n${ - (err as Error).message - }\n${JSON.stringify(err as Error, null, 2)}`, - { - cause: err as Error, - }, + `MDX compilation failed for file ${logger.path(filePath)}\nCause: ${ + error.message + }\nDetails:\n${JSON.stringify(error, null, 2)}`, + // TODO error cause doesn't seem to be used by Webpack stats.errors :s + {cause: error}, ), ); } diff --git a/packages/docusaurus/src/webpack/utils.ts b/packages/docusaurus/src/webpack/utils.ts index 868182479dcc..0be200e49f24 100644 --- a/packages/docusaurus/src/webpack/utils.ts +++ b/packages/docusaurus/src/webpack/utils.ts @@ -40,7 +40,9 @@ export function formatStatsErrorMessage( // Also the error causal chain is lost here // We log the stacktrace inside serverEntry.tsx for now (not ideal) const {errors} = formatWebpackMessages(statsJson); - return errors.join('\n---\n'); + return errors + .map((str) => logger.red(str)) + .join(`\n\n${logger.yellow('--------------------------')}\n\n`); } return undefined; } diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 7d692a9701d0..06055d355574 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -149,7 +149,9 @@ const config = { } return fileContent; }, - mdx1Compat: {}, + mdx1Compat: { + // comments: false, + }, }, onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', From 37cb892d840cd41b4ad8596ab9cda167d32ddfaf Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 14 Apr 2023 17:24:14 +0200 Subject: [PATCH 138/155] restore 4-backticks mdx-code-block (used on our own website) --- .../src/__tests__/markdownUtils.test.ts | 21 +++++++++++++++---- .../docusaurus-utils/src/markdownUtils.ts | 18 ++++++++++++---- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts b/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts index a889fa517a5c..9a1ecbee324a 100644 --- a/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts +++ b/packages/docusaurus-utils/src/__tests__/markdownUtils.test.ts @@ -1086,8 +1086,9 @@ describe('unwrapMdxCodeBlocks', () => { `); }); - it('cant unwrap a nested mdx code block', () => { - const markdown = dedent` + it('can unwrap a nested mdx code block', () => { + expect( + unwrapMdxCodeBlocks(dedent` # Title \`\`\`\`mdx-code-block @@ -1101,8 +1102,20 @@ describe('unwrapMdxCodeBlocks', () => { \`\`\`\` text - `; - expect(unwrapMdxCodeBlocks(markdown)).toEqual(markdown); + `), + ).toEqual(dedent` + # Title + + + some content + + \`\`\`js + export const age = 36 + \`\`\` + + + text + `); }); it('works for realistic example', () => { diff --git a/packages/docusaurus-utils/src/markdownUtils.ts b/packages/docusaurus-utils/src/markdownUtils.ts index 03e86d5d6eb3..daf9be47c540 100644 --- a/packages/docusaurus-utils/src/markdownUtils.ts +++ b/packages/docusaurus-utils/src/markdownUtils.ts @@ -54,11 +54,21 @@ export function escapeMarkdownHeadingIds(content: string): string { ); } +/** + * Hacky temporary escape hatch for Crowdin bad MDX support + * See https://docusaurus.io/docs/i18n/crowdin#mdx + * + * TODO Titus suggested a clean solution based on ```mdx eval and Remark + * See https://github.com/mdx-js/mdx/issues/701#issuecomment-947030041 + * + * @param content + */ export function unwrapMdxCodeBlocks(content: string): string { - // We only support triple backticks on purpose - // This is an escape hatch and shouldn't be used in a nested way - const regexp = + // We only support 3/4 backticks on purpose, should be good enough + const regexp3 = /(?^|\n)```mdx-code-block\n(?.*?)\n```(?\n|$)/gs; + const regexp4 = + /(?^|\n)````mdx-code-block\n(?.*?)\n````(?\n|$)/gs; // eslint-disable-next-line @typescript-eslint/no-explicit-any const replacer = (substring: string, ...args: any[]) => { @@ -66,7 +76,7 @@ export function unwrapMdxCodeBlocks(content: string): string { return `${groups.begin}${groups.children}${groups.end}`; }; - return content.replaceAll(regexp, replacer); + return content.replaceAll(regexp3, replacer).replaceAll(regexp4, replacer); } /** From a3226f5ee6f627e3c38aaf12add15cf763f70927 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 14 Apr 2023 17:49:44 +0200 Subject: [PATCH 139/155] minor preprocessor bug due to markdown links having spaces --- website/docusaurus.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 06055d355574..725c2e6e3758 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -145,7 +145,7 @@ const config = { const vscodeLink = `vscode://file/${filePath}`; const webstormLink = `webstorm://open?file=${filePath}`; const intellijLink = `idea://open?file=${filePath}`; - return `${fileContent}\n\n---\n\n**DEV**: open this file in [VSCode](${vscodeLink}) | [WebStorm](${webstormLink}) | [IntelliJ](${intellijLink})\n`; + return `${fileContent}\n\n---\n\n**DEV**: open this file in [VSCode](<${vscodeLink}>) | [WebStorm](<${webstormLink}>) | [IntelliJ](<${intellijLink}>)\n`; } return fileContent; }, From bb94f8fdd38e1fa818ccb00519cf221c04f55376 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 14 Apr 2023 17:50:08 +0200 Subject: [PATCH 140/155] fix diff for /tests/docs/tests/admonitions --- .../_docs tests/tests/admonitions.mdx | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/website/_dogfooding/_docs tests/tests/admonitions.mdx b/website/_dogfooding/_docs tests/tests/admonitions.mdx index 94d751430bed..1ecbb3c9a29e 100644 --- a/website/_dogfooding/_docs tests/tests/admonitions.mdx +++ b/website/_dogfooding/_docs tests/tests/admonitions.mdx @@ -16,24 +16,22 @@ ## Large font icon +import Admonition from '@theme/Admonition'; + ```mdx-code-block -💡} title="Did you know..."> -

content -

-
+ -ℹ️} title="Did you know..."> -

content -

-
+ ``` ## Large svg icon @@ -41,21 +39,17 @@ ```mdx-code-block import InfoIcon from "@theme/Admonition/Icon/Info" -} title="Did you know..."> -

content -

-
+ -} title="Did you know..."> -

content -

-
+ ``` From 130be08cbd471e5a03b4100abc505bc1dc4e3a31 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 14 Apr 2023 18:27:44 +0200 Subject: [PATCH 141/155] Add shitty non-breaking space hack to document mdx-code-block: the doc should not be escaped --- website/docs/i18n/i18n-crowdin.mdx | 3 ++- website/versioned_docs/version-2.0.1/i18n/i18n-crowdin.mdx | 2 +- website/versioned_docs/version-2.1.0/i18n/i18n-crowdin.mdx | 2 +- website/versioned_docs/version-2.2.0/i18n/i18n-crowdin.mdx | 2 +- website/versioned_docs/version-2.3.1/i18n/i18n-crowdin.mdx | 2 +- website/versioned_docs/version-2.4.0/i18n/i18n-crowdin.mdx | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/website/docs/i18n/i18n-crowdin.mdx b/website/docs/i18n/i18n-crowdin.mdx index 104b636a7bb9..f60b2a510286 100644 --- a/website/docs/i18n/i18n-crowdin.mdx +++ b/website/docs/i18n/i18n-crowdin.mdx @@ -351,7 +351,8 @@ We recommend extracting the complex embedded JSX code as separate standalone com To deploy Docusaurus, run the following command: -````mdx-code-block +````mdx-code-block  + import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; diff --git a/website/versioned_docs/version-2.0.1/i18n/i18n-crowdin.mdx b/website/versioned_docs/version-2.0.1/i18n/i18n-crowdin.mdx index 104b636a7bb9..455d68c1574d 100644 --- a/website/versioned_docs/version-2.0.1/i18n/i18n-crowdin.mdx +++ b/website/versioned_docs/version-2.0.1/i18n/i18n-crowdin.mdx @@ -351,7 +351,7 @@ We recommend extracting the complex embedded JSX code as separate standalone com To deploy Docusaurus, run the following command: -````mdx-code-block +````mdx-code-block  import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; diff --git a/website/versioned_docs/version-2.1.0/i18n/i18n-crowdin.mdx b/website/versioned_docs/version-2.1.0/i18n/i18n-crowdin.mdx index 104b636a7bb9..455d68c1574d 100644 --- a/website/versioned_docs/version-2.1.0/i18n/i18n-crowdin.mdx +++ b/website/versioned_docs/version-2.1.0/i18n/i18n-crowdin.mdx @@ -351,7 +351,7 @@ We recommend extracting the complex embedded JSX code as separate standalone com To deploy Docusaurus, run the following command: -````mdx-code-block +````mdx-code-block  import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; diff --git a/website/versioned_docs/version-2.2.0/i18n/i18n-crowdin.mdx b/website/versioned_docs/version-2.2.0/i18n/i18n-crowdin.mdx index 104b636a7bb9..455d68c1574d 100644 --- a/website/versioned_docs/version-2.2.0/i18n/i18n-crowdin.mdx +++ b/website/versioned_docs/version-2.2.0/i18n/i18n-crowdin.mdx @@ -351,7 +351,7 @@ We recommend extracting the complex embedded JSX code as separate standalone com To deploy Docusaurus, run the following command: -````mdx-code-block +````mdx-code-block  import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; diff --git a/website/versioned_docs/version-2.3.1/i18n/i18n-crowdin.mdx b/website/versioned_docs/version-2.3.1/i18n/i18n-crowdin.mdx index 104b636a7bb9..455d68c1574d 100644 --- a/website/versioned_docs/version-2.3.1/i18n/i18n-crowdin.mdx +++ b/website/versioned_docs/version-2.3.1/i18n/i18n-crowdin.mdx @@ -351,7 +351,7 @@ We recommend extracting the complex embedded JSX code as separate standalone com To deploy Docusaurus, run the following command: -````mdx-code-block +````mdx-code-block  import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; diff --git a/website/versioned_docs/version-2.4.0/i18n/i18n-crowdin.mdx b/website/versioned_docs/version-2.4.0/i18n/i18n-crowdin.mdx index 104b636a7bb9..455d68c1574d 100644 --- a/website/versioned_docs/version-2.4.0/i18n/i18n-crowdin.mdx +++ b/website/versioned_docs/version-2.4.0/i18n/i18n-crowdin.mdx @@ -351,7 +351,7 @@ We recommend extracting the complex embedded JSX code as separate standalone com To deploy Docusaurus, run the following command: -````mdx-code-block +````mdx-code-block  import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; From 47f2cad54531da5294a09fabaa086a4a3d869f65 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 14 Apr 2023 18:33:09 +0200 Subject: [PATCH 142/155] fix admonition extra paragraph --- .../markdown-features/markdown-features-admonitions.mdx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx index 0ea3e6b9075e..dcd9d542fd40 100644 --- a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx @@ -187,10 +187,8 @@ The types that are accepted are the same as above: `note`, `tip`, `danger`, `inf ```jsx title="MyReactPage.jsx" -

- Use plugins to introduce shorter syntax for the most commonly used JSX - elements in your project. -

+ Use plugins to introduce shorter syntax for the most commonly used JSX + elements in your project.
``` From d6f51f15cbf98c7c6f69e3facb9f1493bde8a5a8 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 14 Apr 2023 18:36:12 +0200 Subject: [PATCH 143/155] react page diff fix --- .../guides/markdown-features/markdown-features-react.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-react.mdx b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-react.mdx index da8e9fd86be0..431377b98bf6 100644 --- a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-react.mdx +++ b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-react.mdx @@ -64,8 +64,8 @@ export const Highlight = ({children, color}) => ( -Docusaurus green -{` `}and Facebook blue are my favorite colors. +<>Docusaurus green +{` `}and Facebook blue are my favorite colors. I can write **Markdown** alongside my _JSX_! From 03c5393fc7816c2b790e7a84bbb51b2db34f2c4d Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 20 Apr 2023 17:09:03 +0200 Subject: [PATCH 144/155] fix admonitions docs diff --- .../markdown-features-admonitions.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx index dcd9d542fd40..7aacd1292375 100644 --- a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx @@ -187,18 +187,18 @@ The types that are accepted are the same as above: `note`, `tip`, `danger`, `inf ```jsx title="MyReactPage.jsx" - Use plugins to introduce shorter syntax for the most commonly used JSX - elements in your project. +

+ Use plugins to introduce shorter syntax for the most commonly used JSX + elements in your project. +

``` ```mdx-code-block -

- Use plugins to introduce shorter syntax for the most commonly used JSX - elements in your project. -

+ Use plugins to introduce shorter syntax for the most commonly used JSX + elements in your project.
``` From 44fe1d6ded8e75a2198a2a71e50d349f7d42e17e Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 20 Apr 2023 17:36:10 +0200 Subject: [PATCH 145/155] Mention mdx v1 code block test page is legacy --- website/_dogfooding/_pages tests/code-block-tests.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/website/_dogfooding/_pages tests/code-block-tests.mdx b/website/_dogfooding/_pages tests/code-block-tests.mdx index 9a0a92850e27..8248d0dace65 100644 --- a/website/_dogfooding/_pages tests/code-block-tests.mdx +++ b/website/_dogfooding/_pages tests/code-block-tests.mdx @@ -5,6 +5,14 @@ import TabItem from '@theme/TabItem'; # Code block tests +:::danger legacy test page - MDX v1 + +This test page is quite outdated: MDX v2 lowercase tags are not substituted anymore in the same way as they were in v1. + +::: + +--- + ```java class HelloWorld { public static void main(String args[]) { From 1da05daa3fd33926f5481ddb234b07c7820c7c13 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Thu, 20 Apr 2023 19:19:14 +0200 Subject: [PATCH 146/155] Add TODO comment --- packages/docusaurus-mdx-loader/src/loader.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index b3faea4f87bc..3c78b8d4340a 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -337,6 +337,8 @@ ${JSON.stringify(frontMatter, null, 2)}`; ? reqOptions.createAssets({frontMatter, metadata}) : undefined; + // TODO use remark plugins to insert extra exports instead of string concat? + // cf how the toc is exported const exportsCode = ` export const frontMatter = ${stringifyObject(frontMatter)}; export const contentTitle = ${stringifyObject(contentTitle)}; From 8f205be0fe03eda29949d38fb82d3580c8336ab9 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 21 Apr 2023 12:37:56 +0200 Subject: [PATCH 147/155] report config changes for mdx v2 --- website/docusaurus.config.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 156ab21d68d6..53495db99852 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -7,7 +7,6 @@ // @ts-check const path = require('path'); -const math = require('remark-math'); const npm2yarn = require('@docusaurus/remark-plugin-npm2yarn'); const versions = require('./versions.json'); const VersionsArchived = require('./versionsArchived.json'); @@ -140,6 +139,20 @@ module.exports = async function createConfigAsync() { }, markdown: { mermaid: true, + mdx1Compat: { + // comments: false, + }, + preprocessor: ({filePath, fileContent}) => { + if (isDev) { + // "vscode://file/${projectPath}${filePath}:${line}:${column}", + // "webstorm://open?file=${projectPath}${filePath}&line=${line}&column=${column}", + const vscodeLink = `vscode://file/${filePath}`; + const webstormLink = `webstorm://open?file=${filePath}`; + const intellijLink = `idea://open?file=${filePath}`; + return `${fileContent}\n\n---\n\n**DEV**: open this file in [VSCode](<${vscodeLink}>) | [WebStorm](<${webstormLink}>) | [IntelliJ](<${intellijLink}>)\n`; + } + return fileContent; + }, }, onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', @@ -331,13 +344,12 @@ module.exports = async function createConfigAsync() { }, admonitions: { keywords: ['my-custom-admonition'], - extendDefaults: true, }, showLastUpdateAuthor: true, showLastUpdateTime: true, remarkPlugins: [ - math, [npm2yarn, {sync: true}], + (await import('remark-math')).default, (await import('./src/remark/configTabs.mjs')).default, ], rehypePlugins: [(await import('rehype-katex')).default], @@ -346,7 +358,15 @@ module.exports = async function createConfigAsync() { isDev || isDeployPreview || isBranchDeploy ? 'current' : undefined, + + // TODO temporary for mdx2 PR + ...(isDeployPreview && {lastVersion: undefined}), onlyIncludeVersions: (() => { + // TODO temporary for mdx2 PR + if (isDeployPreview) { + return undefined; + } + if (isBuildFast) { return ['current']; } else if ( From 3299da10226e20b56ec69783f9d88dbe318afc7a Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 21 Apr 2023 16:05:44 +0200 Subject: [PATCH 148/155] Add missing unified deps --- packages/docusaurus-remark-plugin-npm2yarn/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/docusaurus-remark-plugin-npm2yarn/package.json b/packages/docusaurus-remark-plugin-npm2yarn/package.json index dcd2c71da805..5a525e5d863b 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/package.json +++ b/packages/docusaurus-remark-plugin-npm2yarn/package.json @@ -20,6 +20,7 @@ "mdast-util-mdx": "^2.0.0", "npm-to-yarn": "^2.0.0", "tslib": "^2.5.0", + "unified": "^10.1.2", "unist-util-visit": "^2.0.3" }, "devDependencies": { From 8129a53ef7cda89e7e96683b1f56e8057f3eb9d0 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 21 Apr 2023 16:26:02 +0200 Subject: [PATCH 149/155] Relax typing for Unified Plugin type due to TS making it very hard to import ESM types in CJS modules --- packages/docusaurus-mdx-loader/src/loader.ts | 7 ++++++- .../src/remark/admonitions/index.ts | 8 +++++++- .../docusaurus-mdx-loader/src/remark/toc/index.ts | 14 ++++++++++++-- .../docusaurus-remark-plugin-npm2yarn/src/index.ts | 14 +++++++++++--- website/tsconfig.json | 2 +- 5 files changed, 37 insertions(+), 8 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index 3c78b8d4340a..d86c0b398ad0 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -32,12 +32,17 @@ import type {MarkdownConfig} from '@docusaurus/types'; import type {LoaderContext} from 'webpack'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 -import type {Processor, Pluggable} from 'unified'; +import type {Processor} from 'unified'; import type {AdmonitionOptions} from './remark/admonitions'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {ProcessorOptions} from '@mdx-js/mdx'; +// TODO as of April 2023, no way to import/re-export this ESM type easily :/ +// This might change soon, likely after TS 5.2 +// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391 +type Pluggable = any; // TODO fix this asap + // Copied from https://mdxjs.com/packages/mdx/#optionsmdextensions // Although we are likely to only use .md / .mdx anyway... const mdFormatExtensions = [ diff --git a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts index 4d49a4e5342b..1ca3d864ad21 100644 --- a/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/admonitions/index.ts @@ -6,12 +6,18 @@ */ import visit from 'unist-util-visit'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 -import type {Transformer, Processor, Plugin} from 'unified'; +import type {Transformer, Processor} from 'unified'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {ContainerDirective} from 'mdast-util-directive'; import type {Parent} from 'mdast'; +// TODO as of April 2023, no way to import/re-export this ESM type easily :/ +// This might change soon, likely after TS 5.2 +// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391 +// import type {Plugin} from 'unified'; +type Plugin = any; // TODO fix this asap + export type AdmonitionOptions = { keywords: string[]; extendDefaults: boolean; diff --git a/packages/docusaurus-mdx-loader/src/remark/toc/index.ts b/packages/docusaurus-mdx-loader/src/remark/toc/index.ts index 01162d0fd2bb..fea1585db935 100644 --- a/packages/docusaurus-mdx-loader/src/remark/toc/index.ts +++ b/packages/docusaurus-mdx-loader/src/remark/toc/index.ts @@ -16,6 +16,12 @@ import type {Heading, Literal} from 'mdast'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {Transformer} from 'unified'; +// TODO as of April 2023, no way to import/re-export this ESM type easily :/ +// This might change soon, likely after TS 5.2 +// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391 +// import type {Plugin} from 'unified'; +type Plugin = any; // TODO fix this asap + export type TOCItem = { readonly value: string; readonly id: string; @@ -75,7 +81,9 @@ const getOrCreateExistingTargetIndex = async ( return targetIndex; }; -export default function plugin(options: PluginOptions = {}): Transformer { +const plugin: Plugin = function plugin( + options: PluginOptions = {}, +): Transformer { const name = options.name || 'toc'; return async (root) => { @@ -103,7 +111,9 @@ export default function plugin(options: PluginOptions = {}): Transformer { children[targetIndex] = await createExportNode(name, headings); } }; -} +}; + +export default plugin; async function createExportNode(name: string, object: any) { const {valueToEstree} = await import('estree-util-value-to-estree'); diff --git a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts index 9c491602234f..e98bcc9830ff 100644 --- a/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts +++ b/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts @@ -9,10 +9,17 @@ import visit from 'unist-util-visit'; import npmToYarn from 'npm-to-yarn'; import type {Code, Literal} from 'mdast'; // @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 -import type {Plugin} from 'unified'; -// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 import type {MdxJsxFlowElement, MdxJsxAttribute} from 'mdast-util-mdx'; import type {Node, Parent} from 'unist'; +// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721 +import type {Transformer} from 'unified'; + +// TODO as of April 2023, no way to import/re-export this ESM type easily :/ +// This might change soon, likely after TS 5.2 +// See https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1517839391 +// import type {Plugin} from 'unified'; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +type Plugin = any; // TODO fix this asap type KnownConverter = 'yarn' | 'pnpm'; @@ -163,7 +170,8 @@ function createImportNode() { }; } -const plugin: Plugin<[PluginOptions?]> = (options = {}) => { +const plugin: Plugin<[PluginOptions?]> = (options = {}): Transformer => { + // @ts-expect-error: todo temporary const {sync = false, converters = ['yarn', 'pnpm']} = options; return (root) => { let transformed = false; diff --git a/website/tsconfig.json b/website/tsconfig.json index 67aee6fffb90..0fcd0946a271 100644 --- a/website/tsconfig.json +++ b/website/tsconfig.json @@ -34,7 +34,7 @@ // with our declaration files (mostly names that are forgotten to be // imported, invalid semantics...). Because we don't have end-to-end type // tests, removing this would make things much harder to catch. - "skipLibCheck": true, // TODO revert to false!!! + "skipLibCheck": false, "types": ["jest"] }, "exclude": ["src/sw.js"] From 94408de85431fd2304483f68b386a8f32171ed8b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 21 Apr 2023 17:38:42 +0200 Subject: [PATCH 150/155] update docs for math equations --- .../markdown-features-math-equations.mdx | 132 +++++------------- 1 file changed, 34 insertions(+), 98 deletions(-) diff --git a/website/docs/guides/markdown-features/markdown-features-math-equations.mdx b/website/docs/guides/markdown-features/markdown-features-math-equations.mdx index 3c550037f113..1b1a8ad38d7a 100644 --- a/website/docs/guides/markdown-features/markdown-features-math-equations.mdx +++ b/website/docs/guides/markdown-features/markdown-features-math-equations.mdx @@ -54,29 +54,32 @@ $$ To enable KaTeX, you need to install `remark-math` and `rehype-katex` plugins. ```bash npm2yarn -npm install --save remark-math rehype-katex hast-util-is-element@1.1.0 +npm install --save remark-math@5 rehype-katex@6 ``` :::caution -Use the exact same versions. The latest versions are incompatible with Docusaurus 2. - -TODO update this doc after MDX 2 migration +Make sure to use `remark-math >= 5` and `rehype-katex >= 6` for Docusaurus v3 (using MDX v2). ::: -Import the plugins in `docusaurus.config.js`: +Those 2 plugins are now only available as ESM packages, and you will need to import them dynamically. -```js -const math = require('remark-math'); -const katex = require('rehype-katex'); +First, turn your site config into an async config creator function: + +```js title="docusaurus.config.js" +module.exports = async function createConfigAsync() { + return { + // your site config... + }; +}; ``` -Add them to your content plugin or preset options (usually `@docusaurus/preset-classic` docs options): +It is now possible to import the plugins dynamically and add them to your content plugin or preset options (usually `@docusaurus/preset-classic` docs options): ```js -remarkPlugins: [math], -rehypePlugins: [katex], +remarkPlugins: [(await import('remark-math')).default], +rehypePlugins: [(await import('rehype-katex')).default], ``` Include the KaTeX CSS in your config under `stylesheets`: @@ -96,87 +99,7 @@ stylesheets: [ Overall the changes look like: ```js title="docusaurus.config.js" -// highlight-start -const math = require('remark-math'); -const katex = require('rehype-katex'); -// highlight-end - -module.exports = { - title: 'Docusaurus', - tagline: 'Build optimized websites quickly, focus on your content', - presets: [ - [ - '@docusaurus/preset-classic', - { - docs: { - path: 'docs', - // highlight-start - remarkPlugins: [math], - rehypePlugins: [katex], - // highlight-end - }, - }, - ], - ], - // highlight-start - stylesheets: [ - { - href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css', - type: 'text/css', - integrity: - 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM', - crossorigin: 'anonymous', - }, - ], - // highlight-end -}; -``` - -## Self-hosting KaTeX assets {#self-hosting-katex-assets} - -Loading stylesheets, fonts, and JavaScript libraries from CDN sources is a good practice for popular libraries and assets, since it reduces the amount of assets you have to host. In case you prefer to self-host the `katex.min.css` (along with required KaTeX fonts), you can download the latest version from [KaTeX GitHub releases](https://github.com/KaTeX/KaTeX/releases), extract and copy `katex.min.css` and `fonts` directory (only `.woff2` font types should be enough) to your site's `static` directory, and in `docusaurus.config.js`, replace the stylesheet's `href` from the CDN URL to your local path (say, `/katex/katex.min.css`). - -```js title="docusaurus.config.js" -module.exports = { - stylesheets: [ - { - href: '/katex/katex.min.css', - type: 'text/css', - }, - ], -}; -``` - -## Upgrading rehype-katex beyond recommended version {#upgrading-rehype-katex-beyond-recommended-version} - -:::tip - -Only use the latest version if you actually need the bleeding-edge features of $\KaTeX$. Most users should find the older versions work just as well. - -::: - -The latest versions of `rehype-katex` (starting from `v6.0.0`) has moved to ES Modules, a new module system of JavaScript, which Docusaurus doesn't officially support yet. However, it is possible to import `rehype-katex` dynamically, using an async config creator. Docusaurus will call this creator function and wait for it to return the config object. - -```js title="docusaurus.config.js" -async function createConfig() { - // ES Modules are imported with `import()` instead of `require()`, and are imported asynchronously - // highlight-next-line - const katex = (await import('rehype-katex')).default; - return { - // ... - }; -} -``` - -In this case, the overall configuration changes will look like: - -```js title="docusaurus.config.js" -// highlight-next-line -const math = require('remark-math'); - -async function createConfig() { - // highlight-next-line - const katex = (await import('rehype-katex')).default; +module.exports = async function createConfigAsync() { return { title: 'Docusaurus', tagline: 'Build optimized websites quickly, focus on your content', @@ -187,8 +110,8 @@ async function createConfig() { docs: { path: 'docs', // highlight-start - remarkPlugins: [math], - rehypePlugins: [katex], + remarkPlugins: [(await import('remark-math')).default], + rehypePlugins: [(await import('rehype-katex')).default], // highlight-end }, }, @@ -197,16 +120,29 @@ async function createConfig() { // highlight-start stylesheets: [ { - href: 'https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.css', + href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css', type: 'text/css', integrity: - 'sha384-MlJdn/WNKDGXveldHDdyRP1R4CTHr3FeuDNfhsLPYrq2t0UBkUdK2jyTnXPEK1NQ', + 'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM', crossorigin: 'anonymous', }, ], // highlight-end }; -} +}; +``` + +## Self-hosting KaTeX assets {#self-hosting-katex-assets} + +Loading stylesheets, fonts, and JavaScript libraries from CDN sources is a good practice for popular libraries and assets, since it reduces the amount of assets you have to host. In case you prefer to self-host the `katex.min.css` (along with required KaTeX fonts), you can download the latest version from [KaTeX GitHub releases](https://github.com/KaTeX/KaTeX/releases), extract and copy `katex.min.css` and `fonts` directory (only `.woff2` font types should be enough) to your site's `static` directory, and in `docusaurus.config.js`, replace the stylesheet's `href` from the CDN URL to your local path (say, `/katex/katex.min.css`). -module.exports = createConfig; +```js title="docusaurus.config.js" +module.exports = { + stylesheets: [ + { + href: '/katex/katex.min.css', + type: 'text/css', + }, + ], +}; ``` From 55e42c33ebb62a6070aa9bcce1f93a7aa52dd165 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 21 Apr 2023 17:50:13 +0200 Subject: [PATCH 151/155] update docs for admonitions --- .../markdown-features-admonitions.mdx | 49 +++++-------------- 1 file changed, 11 insertions(+), 38 deletions(-) diff --git a/website/docs/guides/markdown-features/markdown-features-admonitions.mdx b/website/docs/guides/markdown-features/markdown-features-admonitions.mdx index f503005a84b3..d1ae1593159f 100644 --- a/website/docs/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/docs/guides/markdown-features/markdown-features-admonitions.mdx @@ -110,49 +110,22 @@ Hello world You may also specify an optional title. ```md -TODO temporarily removed -``` - -```mdx-code-block - - -:::note[TEST Title] - -text1 +:::note[Your Title **with** some _Markdown_ `syntax`!] -**text2 bold** +Some **content** with some _Markdown_ `syntax`. ::: +``` -:::note[TEST Title with `inline code test`] - -text1 - -**text2 bold** - -::: - - -:::::note{title="Your title"} - -Some **content** with _Markdown_ `syntax`. - -::::note[Your nested Title] +```mdx-code-block + -:::note Your very nested Title +:::note[Your Title **with** some _Markdown_ `syntax`!] -Some **content** with _Markdown_ `syntax`. +Some **content** with some _Markdown_ `syntax`. ::: -Some **content** with _Markdown_ `syntax`. - -:::: - -hey - -::::: - ``` @@ -213,7 +186,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -:::tip Use tabs in admonitions +:::tip[Use tabs in admonitions] This is an apple 🍎 @@ -227,7 +200,7 @@ import TabItem from '@theme/TabItem'; ```mdx-code-block -:::tip Use tabs in admonitions +:::tip[Use tabs in admonitions] This is an apple 🍎 @@ -381,7 +354,7 @@ export default AdmonitionTypes; Now you can use your new admonition keyword in a Markdown file, and it will be parsed and rendered with your custom logic: ```md -:::my-custom-admonition Custom Admonition +:::my-custom-admonition[My Title] It works! @@ -390,7 +363,7 @@ It works! -:::my-custom-admonition Custom Admonition +:::my-custom-admonition[My Title] It works! From 2e033b0ae71b87ef12f9d1472f9c5f8d47096c74 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 21 Apr 2023 18:54:17 +0200 Subject: [PATCH 152/155] Fix mdx loader caching issues --- packages/docusaurus-mdx-loader/src/loader.ts | 55 ++++++++++++++----- .../_pages tests/markdown-tests-md.md | 33 +++++++++-- 2 files changed, 71 insertions(+), 17 deletions(-) diff --git a/packages/docusaurus-mdx-loader/src/loader.ts b/packages/docusaurus-mdx-loader/src/loader.ts index d86c0b398ad0..a93bb955bde4 100644 --- a/packages/docusaurus-mdx-loader/src/loader.ts +++ b/packages/docusaurus-mdx-loader/src/loader.ts @@ -72,7 +72,13 @@ const DEFAULT_OPTIONS: MDXOptions = { beforeDefaultRehypePlugins: [], }; -const compilerCache = new Map(); +type CompilerCacheEntry = { + mdCompiler: Processor; + mdxCompiler: Processor; + options: Options; +}; + +const compilerCache = new Map(); export type MDXPlugin = Pluggable; @@ -198,6 +204,7 @@ export async function mdxLoader( const {createProcessor} = await import('@mdx-js/mdx'); const {default: gfm} = await import('remark-gfm'); const {default: comment} = await import('remark-comment'); + const {default: directives} = await import('remark-directive'); const {frontMatter, content: contentWithTitle} = parseFrontMatter(fileString); const mdxFrontMatter = validateMDXFrontMatter(frontMatter.mdx); @@ -219,9 +226,15 @@ export async function mdxLoader( const hasFrontMatter = Object.keys(frontMatter).length > 0; if (!compilerCache.has(this.query)) { + /* + /!\ DO NOT PUT ANY ASYNC / AWAIT / DYNAMIC IMPORTS HERE + This creates cache creation race conditions + TODO extract this in a synchronous method + */ + const remarkPlugins: MDXPlugin[] = [ ...(reqOptions.beforeDefaultRemarkPlugins ?? []), - (await import('remark-directive')).default, + directives, ...getAdmonitionsPlugins(reqOptions.admonitions ?? false), ...DEFAULT_OPTIONS.remarkPlugins, details, @@ -256,28 +269,44 @@ export async function mdxLoader( ...(reqOptions.rehypePlugins ?? []), ]; - const format = - mdxFrontMatter.format === 'detect' - ? isMDFormat(filePath) - ? 'md' - : 'mdx' - : mdxFrontMatter.format; - const options: ProcessorOptions & Options = { ...reqOptions, remarkPlugins, rehypePlugins, - format, providerImportSource: '@mdx-js/react', }; - compilerCache.set(this.query, [createProcessor(options), options]); + + const compilerCacheEntry: CompilerCacheEntry = { + mdCompiler: createProcessor({ + ...options, + format: 'md', + }), + mdxCompiler: createProcessor({ + ...options, + format: 'mdx', + }), + options, + }; + + compilerCache.set(this.query, compilerCacheEntry); } - const [compiler, options] = compilerCache.get(this.query)!; + const {mdCompiler, mdxCompiler, options} = compilerCache.get(this.query)!; + + function getCompiler() { + const format = + mdxFrontMatter.format === 'detect' + ? isMDFormat(filePath) + ? 'md' + : 'mdx' + : mdxFrontMatter.format; + + return format === 'md' ? mdCompiler : mdxCompiler; + } let result: string; try { - result = await compiler + result = await getCompiler() .process({ value: content, path: filePath, diff --git a/website/_dogfooding/_pages tests/markdown-tests-md.md b/website/_dogfooding/_pages tests/markdown-tests-md.md index 18ea7192a1cb..a0d9800eb677 100644 --- a/website/_dogfooding/_pages tests/markdown-tests-md.md +++ b/website/_dogfooding/_pages tests/markdown-tests-md.md @@ -6,14 +6,39 @@ wrapperClassName: docusaurus-markdown-example # Markdown .md tests -todo +This file should be interpreted in a more CommonMark compliant way - +## Comment -:::note[test] +Html comment: + + +MDX comment: {/* comment */} + +## JSX syntax + +import BrowserWindow from '@site/src/components/BrowserWindow'; + + + +BrowserWindow content + + + +export const answer = 42; + +Test {xyz} + +## Admonition + +Admonitions still work + +:::note[title] note ::: -test +## Heading Id {#custom-heading-id} + +Custom heading syntax `{#custom-heading-id}` still works From a983945d320f48416b9b0b0e3156a05000463990 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 21 Apr 2023 19:16:11 +0200 Subject: [PATCH 153/155] update todo message --- packages/docusaurus-utils-validation/src/validationSchemas.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docusaurus-utils-validation/src/validationSchemas.ts b/packages/docusaurus-utils-validation/src/validationSchemas.ts index c037e652f8bf..5d2959359c81 100644 --- a/packages/docusaurus-utils-validation/src/validationSchemas.ts +++ b/packages/docusaurus-utils-validation/src/validationSchemas.ts @@ -48,7 +48,7 @@ export const AdmonitionsSchema = JoiFrontMatter.alternatives() ), extendDefaults: JoiFrontMatter.boolean(), - // TODO Remove before 2023 + // TODO Remove before 2024 tag: Joi.any().forbidden().messages({ 'any.unknown': `It is not possible anymore to use a custom admonition tag. The only admonition tag supported is ':::' (Markdown Directive syntax)`, }), From a8754c529780102505d8dd30f8e177fb4ab2ed9b Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 21 Apr 2023 19:23:32 +0200 Subject: [PATCH 154/155] Use nbsp hack to keep former admonition title doc retrocompatible --- packages/docusaurus-utils/src/markdownUtils.ts | 4 ++-- .../markdown-features-admonitions.mdx | 10 +++++++--- .../markdown-features-admonitions.mdx | 10 +++++++--- .../markdown-features-admonitions.mdx | 10 +++++++--- .../markdown-features-admonitions.mdx | 10 +++++++--- .../markdown-features-admonitions.mdx | 10 +++++++--- 6 files changed, 37 insertions(+), 17 deletions(-) diff --git a/packages/docusaurus-utils/src/markdownUtils.ts b/packages/docusaurus-utils/src/markdownUtils.ts index daf9be47c540..dc8589ac71c5 100644 --- a/packages/docusaurus-utils/src/markdownUtils.ts +++ b/packages/docusaurus-utils/src/markdownUtils.ts @@ -92,8 +92,8 @@ export function admonitionTitleToDirectiveLabel( content: string, admonitionContainerDirectives: string[], ): string { - // TODO this will also process ":::note Title" inside docs code blocks - // Probably not very important and we should now use directive labels? + // this will also process ":::note Title" inside docs code blocks + // good enough: we fixed older versions docs to not be affected const directiveNameGroup = `(${admonitionContainerDirectives.join('|')})`; const regexp = new RegExp( diff --git a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-admonitions.mdx index 0ea3e6b9075e..9957822ebf6c 100644 --- a/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.0.1/guides/markdown-features/markdown-features-admonitions.mdx @@ -110,7 +110,7 @@ Hello world You may also specify an optional title. ```md -:::note Your Title +:::note Your Title Some **content** with _Markdown_ `syntax`. @@ -138,7 +138,9 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -:::tip Use tabs in admonitions +:::tip + +Use tabs in admonitions This is an apple 🍎 @@ -152,7 +154,9 @@ import TabItem from '@theme/TabItem'; ```mdx-code-block -:::tip Use tabs in admonitions +:::tip + +Use tabs in admonitions This is an apple 🍎 diff --git a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-admonitions.mdx index 0ea3e6b9075e..9957822ebf6c 100644 --- a/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.1.0/guides/markdown-features/markdown-features-admonitions.mdx @@ -110,7 +110,7 @@ Hello world You may also specify an optional title. ```md -:::note Your Title +:::note Your Title Some **content** with _Markdown_ `syntax`. @@ -138,7 +138,9 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -:::tip Use tabs in admonitions +:::tip + +Use tabs in admonitions This is an apple 🍎 @@ -152,7 +154,9 @@ import TabItem from '@theme/TabItem'; ```mdx-code-block -:::tip Use tabs in admonitions +:::tip + +Use tabs in admonitions This is an apple 🍎 diff --git a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-admonitions.mdx index 0ea3e6b9075e..9957822ebf6c 100644 --- a/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.2.0/guides/markdown-features/markdown-features-admonitions.mdx @@ -110,7 +110,7 @@ Hello world You may also specify an optional title. ```md -:::note Your Title +:::note Your Title Some **content** with _Markdown_ `syntax`. @@ -138,7 +138,9 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -:::tip Use tabs in admonitions +:::tip + +Use tabs in admonitions This is an apple 🍎 @@ -152,7 +154,9 @@ import TabItem from '@theme/TabItem'; ```mdx-code-block -:::tip Use tabs in admonitions +:::tip + +Use tabs in admonitions This is an apple 🍎 diff --git a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx index 7aacd1292375..3bad5bb2ace9 100644 --- a/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.3.1/guides/markdown-features/markdown-features-admonitions.mdx @@ -110,7 +110,7 @@ Hello world You may also specify an optional title. ```md -:::note Your Title +:::note Your Title Some **content** with _Markdown_ `syntax`. @@ -138,7 +138,9 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -:::tip Use tabs in admonitions +:::tip + +Use tabs in admonitions This is an apple 🍎 @@ -152,7 +154,9 @@ import TabItem from '@theme/TabItem'; ```mdx-code-block -:::tip Use tabs in admonitions +:::tip + +Use tabs in admonitions This is an apple 🍎 diff --git a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx index 7aacd1292375..3bad5bb2ace9 100644 --- a/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx +++ b/website/versioned_docs/version-2.4.0/guides/markdown-features/markdown-features-admonitions.mdx @@ -110,7 +110,7 @@ Hello world You may also specify an optional title. ```md -:::note Your Title +:::note Your Title Some **content** with _Markdown_ `syntax`. @@ -138,7 +138,9 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -:::tip Use tabs in admonitions +:::tip + +Use tabs in admonitions This is an apple 🍎 @@ -152,7 +154,9 @@ import TabItem from '@theme/TabItem'; ```mdx-code-block -:::tip Use tabs in admonitions +:::tip + +Use tabs in admonitions This is an apple 🍎 From 5ab8e86f30a5b004f139705a53b0a78de4a47f44 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Fri, 21 Apr 2023 19:26:23 +0200 Subject: [PATCH 155/155] Revert website config changes before merge --- website/docusaurus.config.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 53495db99852..0a308b8aea90 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -359,14 +359,7 @@ module.exports = async function createConfigAsync() { ? 'current' : undefined, - // TODO temporary for mdx2 PR - ...(isDeployPreview && {lastVersion: undefined}), onlyIncludeVersions: (() => { - // TODO temporary for mdx2 PR - if (isDeployPreview) { - return undefined; - } - if (isBuildFast) { return ['current']; } else if (