@quartz-community/breadcrumbs 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +4 -2
- package/dist/components/index.js +1619 -54
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +1619 -54
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../node_modules/@quartz-community/utils/src/lang.ts","../node_modules/@quartz-community/utils/src/path.ts","../node_modules/preact/src/constants.js","../node_modules/preact/src/options.js","../node_modules/preact/src/diff/catch-error.js","../node_modules/preact/src/component.js","../node_modules/preact/src/diff/props.js","../node_modules/preact/src/create-context.js","../node_modules/preact/jsx-runtime/src/index.js","../src/util/fileTrie.ts","../src/components/styles/breadcrumbs.scss","../src/components/Breadcrumbs.tsx"],"names":["slug","s","x","_","options","__e","error","vnode","oldVNode","errorInfo","component","ctor","handled","__","__c","constructor","getDerivedStateFromError","setState","__d","componentDidCatch","__E","e","Promise","prototype","then","bind","resolve","setTimeout","Math","random","toString","vnodeId","createVNode","type","props","key","isStaticChildren","__source","__self","ref","i","normalizedProps","__k","__b","__v","__i","__u","defaultProps","joinSegments","stripSlashes","c","u"],"mappings":";AAIO,SAAS,cAAc,OAAA,EAAwD;AACpF,EAAA,OAAO,OAAA,CAAQ,MAAA,CAAO,OAAO,CAAA,CAAE,KAAK,GAAG,CAAA;AACzC;AC2CO,SAAS,aAAa,EAAA,EAAmC;AAC9D,EAAA,MAAM,MAAM,YAAA,CAAa,UAAA,CAAW,EAAA,EAAI,OAAO,GAAG,IAAI,CAAA;AACtD,EAAA,OAAQ,GAAA,CAAI,MAAA,KAAW,CAAA,GAAI,GAAA,GAAM,GAAA;AACnC;AAcO,SAAS,eAAA,CAAgB,IAAc,UAAA,EAAgC;AAC5E,EAAA,EAAA,GAAK,aAAa,EAAE,CAAA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IAAA,GAAO,EAAA;AAAA,MACf;AAEA,MAAA,OAAO,KAAA;AAAA,IACT,CAAC,CAAA;AAED,IAAA,IAAI,CAAC,QAAQ,eAAA,EAAiB;AAC5B,MAAA,MAAA,CAAO,GAAA,EAAI;AAAA,IACb;AAEA,IAAA,uBACE8B,EAAAA,CAAC,KAAA,EAAA,EAAI,OAAO,UAAA,CAAW,YAAA,EAAc,sBAAsB,CAAA,EAAG,YAAA,EAAW,eACtE,QAAA,EAAA,MAAA,CAAO,GAAA,CAAI,CAAC,KAAA,EAAO,KAAA,qBAClBA,EAAAA,CAAC,KAAA,EAAA,EAAI,OAAM,oBAAA,EACT,QAAA,EAAA;AAAA,sBAAAA,GAAC,GAAA,EAAA,EAAE,IAAA,EAAM,KAAA,CAAM,IAAA,EAAO,gBAAM,WAAA,EAAY,CAAA;AAAA,MACvC,KAAA,KAAU,MAAA,CAAO,MAAA,GAAS,CAAA,oBAAKA,GAAC,GAAA,EAAA,EAAG,QAAA,EAAA,CAAA,CAAA,EAAI,OAAA,CAAQ,YAAY,CAAA,CAAA,CAAA,EAAI;AAAA,KAAA,EAClE,CACD,CAAA,EACH,CAAA;AAAA,EAEJ,CAAA;AACA,EAAA,WAAA,CAAY,GAAA,GAAM,mBAAA;AAElB,EAAA,OAAO,WAAA;AACT,CAAA","file":"index.js","sourcesContent":["export function capitalize(s: string): string {\n return s.substring(0, 1).toUpperCase() + s.substring(1);\n}\n\nexport function classNames(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n","import GithubSlugger, { slug as githubSlug } from \"github-slugger\";\nimport type { Element as HastElement } from \"hast\";\nimport type { FilePath, FullSlug } from \"@quartz-community/types\";\n\nexport type { FilePath, FullSlug };\n\n/** No '/index' ending, no file extension, can have trailing slash for folders. */\nexport type SimpleSlug = string & { _brand: \"SimpleSlug\" };\n\n/** Starts with './' or '../', used for navigation. */\nexport type RelativeURL = string & { _brand: \"RelativeURL\" };\n\nexport interface TransformOptions {\n strategy: \"absolute\" | \"relative\" | \"shortest\";\n allSlugs: FullSlug[];\n}\n\nexport function isFilePath(s: string): s is FilePath {\n const validStart = !s.startsWith(\".\");\n return validStart && _hasFileExtension(s);\n}\n\nexport function isFullSlug(s: string): s is FullSlug {\n const validStart = !(s.startsWith(\".\") || s.startsWith(\"/\"));\n const validEnding = !s.endsWith(\"/\");\n return validStart && validEnding && !_containsForbiddenCharacters(s);\n}\n\nexport function isSimpleSlug(s: string): s is SimpleSlug {\n const validStart = !(s.startsWith(\".\") || (s.length > 1 && s.startsWith(\"/\")));\n const validEnding = !endsWith(s, \"index\");\n return validStart && !_containsForbiddenCharacters(s) && validEnding && !_hasFileExtension(s);\n}\n\nexport function isRelativeURL(s: string): s is RelativeURL {\n const validStart = /^\\.{1,2}/.test(s);\n const validEnding = !endsWith(s, \"index\");\n return validStart && validEnding && ![\".md\", \".html\"].includes(getFileExtension(s) ?? \"\");\n}\n\nexport function isAbsoluteURL(s: string): boolean {\n try {\n new URL(s);\n } catch {\n return false;\n }\n return true;\n}\n\nexport function simplifySlug(fp: FullSlug | string): SimpleSlug {\n const res = stripSlashes(trimSuffix(fp, \"index\"), true);\n return (res.length === 0 ? \"/\" : res) as SimpleSlug;\n}\n\nexport function getFullSlug(window: Window): FullSlug {\n const res = window.document.body.dataset.slug! as FullSlug;\n return res;\n}\n\nexport function getFullSlugFromUrl(): FullSlug {\n let rawSlug = decodeURI(window.location.pathname);\n if (rawSlug.endsWith(\"/\")) rawSlug = rawSlug.slice(0, -1);\n if (rawSlug.startsWith(\"/\")) rawSlug = rawSlug.slice(1);\n return rawSlug as FullSlug;\n}\n\nexport function slugifyFilePath(fp: FilePath, excludeExt?: boolean): FullSlug {\n fp = stripSlashes(fp) as FilePath;\n const ext = getFileExtension(fp);\n const withoutFileExt = fp.replace(new RegExp(ext + \"$\"), \"\");\n const finalExt = excludeExt || [\".md\", \".html\", undefined].includes(ext) ? \"\" : ext;\n\n let slug = _sluggify(withoutFileExt);\n\n if (endsWith(slug, \"_index\")) {\n slug = slug.replace(/_index$/, \"index\");\n }\n\n // Obsidian \"Folder Notes\" convention (insideFolder storage): a file named the\n // same as its parent folder is treated as the folder's landing page. Rewrite\n // `folder/folder` → `folder/index` so every downstream consumer (trie, link\n // resolver, simplifySlug, isFolderPath) sees the canonical Quartz slug shape\n // and Just Works. A top-level single-segment slug is NOT rewritten — that\n // represents Obsidian's `parentFolder` storage mode, which Quartz already\n // routes as a regular top-level page.\n const segments = slug.split(\"/\");\n if (segments.length >= 2 && segments[segments.length - 1] === segments[segments.length - 2]) {\n segments[segments.length - 1] = \"index\";\n slug = segments.join(\"/\");\n }\n\n return (slug + (finalExt ?? \"\")) as FullSlug;\n}\n\nexport function joinSegments(...args: string[]): string {\n if (args.length === 0) {\n return \"\";\n }\n\n let joined = args\n .filter((segment) => segment !== \"\" && segment !== \"/\")\n .map((segment) => stripSlashes(segment))\n .join(\"/\");\n\n const first = args[0];\n const last = args[args.length - 1];\n\n if (first?.startsWith(\"/\")) {\n joined = \"/\" + joined;\n }\n\n if (last?.endsWith(\"/\")) {\n joined = joined + \"/\";\n }\n\n return joined;\n}\n\nexport function resolvePath(to: string): string {\n if (to.startsWith(\"/\")) return to;\n return \"/\" + to;\n}\n\n/** Read the base path injected at build time via `data-basepath` on `<body>`.\n * Returns `\"\"` for root deployments, e.g. `\"/repository\"` for subdirectory. */\nexport function getBasePath(): string {\n if (typeof document === \"undefined\") return \"\";\n return document.body?.dataset?.basepath ?? \"\";\n}\n\n/** Resolve a slug to an absolute URL path, prepending the site's base path.\n * e.g. `resolveBasePath(\"features/Callouts\")` → `\"/repository/features/Callouts\"` */\nexport function resolveBasePath(to: string, basePath?: string): string {\n const base = basePath ?? getBasePath();\n const slug = to.startsWith(\"/\") ? to : \"/\" + to;\n return base + slug;\n}\n\nexport function endsWith(s: string, suffix: string): boolean {\n return s === suffix || s.endsWith(\"/\" + suffix);\n}\n\nexport function trimSuffix(s: string, suffix: string): string {\n if (endsWith(s, suffix)) {\n s = s.slice(0, -suffix.length);\n }\n return s;\n}\n\nexport function stripSlashes(s: string, onlyStripPrefix?: boolean): string {\n if (s.startsWith(\"/\")) {\n s = s.substring(1);\n }\n\n if (!onlyStripPrefix && s.endsWith(\"/\")) {\n s = s.slice(0, -1);\n }\n\n return s;\n}\n\nexport function getFileExtension(s: string): string | undefined {\n return s.match(/\\.[A-Za-z0-9]+$/)?.[0];\n}\n\nexport function isFolderPath(fplike: string): boolean {\n return (\n fplike.endsWith(\"/\") ||\n endsWith(fplike, \"index\") ||\n endsWith(fplike, \"index.md\") ||\n endsWith(fplike, \"index.html\")\n );\n}\n\nexport function getAllSegmentPrefixes(path: string): string[] {\n const segments = path.split(\"/\");\n const results: string[] = [];\n for (let i = 0; i < segments.length; i++) {\n results.push(segments.slice(0, i + 1).join(\"/\"));\n }\n return results;\n}\n\nexport function pathToRoot(slug: FullSlug): RelativeURL {\n let rootPath = slug\n .split(\"/\")\n .filter((x) => x !== \"\")\n .slice(0, -1)\n .map((_) => \"..\")\n .join(\"/\");\n\n if (rootPath.length === 0) {\n rootPath = \".\";\n }\n\n return rootPath as RelativeURL;\n}\n\nexport function resolveRelative(current: FullSlug, target: FullSlug | SimpleSlug): RelativeURL {\n const res = joinSegments(pathToRoot(current), simplifySlug(target as FullSlug)) as RelativeURL;\n return res;\n}\n\n/**\n * The slug of a heading's text: the `id` Quartz gives a heading, and the\n * anchor every link or table-of-contents entry to that heading must use.\n *\n * Same rule as GitHub and `rehype-slug` (`github-slugger`): lowercase,\n * punctuation removed, each space replaced by `-`. Non-Latin letters and\n * digits are kept, e.g. `\"监听 127.0.0.1(推荐)\"` → `\"监听-127001推荐\"`.\n *\n * Use {@link HeadingSlugger} when slugging every heading on a page, so that\n * repeated headings get unique ids (`foo`, `foo-1`, …).\n */\nexport function slugHeading(text: string): string {\n return githubSlug(text);\n}\n\n/**\n * Slugs the headings of one page in document order with {@link slugHeading},\n * numbering repeats the way GitHub and `rehype-slug` do (`foo`, `foo-1`,\n * `foo-2`). Create one per page, or call `reset()` between pages.\n */\nexport class HeadingSlugger {\n private readonly slugger = new GithubSlugger();\n\n /** Slug `text`, unique among the slugs this instance has returned. */\n slug(text: string): string {\n return this.slugger.slug(text);\n }\n\n reset(): void {\n this.slugger.reset();\n }\n}\n\n/**\n * The anchor Obsidian writes when it links to a heading with this text.\n *\n * Obsidian anchors cannot hold `:`, `|`, `^`, `#` or `\\`, so Obsidian replaces\n * each with a space and collapses the spaces: `\"Colon:unspaced\"` →\n * `\"Colon unspaced\"`. Slugging this with {@link slugHeading} gives the anchor\n * a link written in Obsidian resolves to; when it differs from the heading's\n * `id`, heading producers can add it as an alias id.\n */\nexport function obsidianHeadingAnchor(text: string): string {\n return text\n .replace(/[:|^#\\\\]/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n}\n\n/**\n * Point a same-page anchor link (`href` starting with `#`, as written) at an\n * `id` on the page. `ids` holds every `id` on the page.\n *\n * - An anchor that already names an id (as written or percent-decoded) is\n * returned unchanged.\n * - `#^name` (an Obsidian block reference) points at the id `name`.\n * - Otherwise, when the anchor is a heading's text, it points at the\n * heading's id: the anchor slugged with {@link slugHeading}, e.g.\n * `#监听 127.0.0.1(推荐)` → `#监听-127001推荐`.\n * - An anchor that names no id either way is returned unchanged, so a link to\n * an id added later (raw HTML, another plugin) keeps working.\n */\nexport function resolveAnchorHref(href: string, ids: ReadonlySet<string>): string {\n if (!href.startsWith(\"#\") || href.length === 1) return href;\n const raw = href.slice(1);\n let decoded = raw;\n try {\n decoded = decodeURIComponent(raw);\n } catch {\n // keep the anchor as written\n }\n if (ids.has(raw) || ids.has(decoded)) return href;\n const bare = decoded.startsWith(\"^\") ? decoded.slice(1) : decoded;\n if (ids.has(bare)) return \"#\" + bare;\n const slugged = slugHeading(bare);\n return ids.has(slugged) ? \"#\" + slugged : href;\n}\n\nexport function splitAnchor(link: string): [string, string] {\n const [fp, anchor] = link.split(\"#\", 2);\n if (fp!.endsWith(\".pdf\")) {\n return [fp!, anchor === undefined ? \"\" : `#${anchor}`];\n }\n if (anchor === undefined) {\n return [fp!, \"\"];\n }\n const bare = anchor.startsWith(\"^\") ? anchor.slice(1) : anchor;\n const slugged = \"#\" + slugHeading(bare);\n return [fp!, slugged];\n}\n\nexport function slugTag(tag: string): string {\n return tag\n .split(\"/\")\n .map((tagSegment) => _sluggify(tagSegment))\n .join(\"/\");\n}\n\nexport function transformInternalLink(link: string): RelativeURL {\n const [fplike, anchor] = splitAnchor(decodeURI(link));\n\n const segments = fplike.split(\"/\").filter((x) => x.length > 0);\n const prefix = segments.filter(_isRelativeSegment).join(\"/\");\n const fp = segments.filter((seg) => !_isRelativeSegment(seg) && seg !== \"\").join(\"/\");\n\n const slugged = slugifyFilePath(fp as FilePath);\n const simpleSlug = simplifySlug(slugged);\n const folderPath = isFolderPath(fplike) || isFolderPath(slugged);\n const joined = joinSegments(stripSlashes(prefix), stripSlashes(simpleSlug));\n const trail = folderPath ? \"/\" : \"\";\n const res = (_addRelativeToStart(joined) + trail + anchor) as RelativeURL;\n return res;\n}\n\nexport function transformLink(src: FullSlug, target: string, opts: TransformOptions): RelativeURL {\n const targetSlug = transformInternalLink(target);\n\n if (opts.strategy === \"relative\") {\n return _resolveRelativeFolderNote(src, target) ?? (targetSlug as RelativeURL);\n } else {\n // When src is a folder page (e.g. \"Compendium/Spells\" backed by index.md),\n // the browser serves it at \"/Compendium/Spells/\" with a trailing slash.\n // pathToRoot needs the \"/index\" suffix to compute the correct depth.\n const effectiveSrc =\n !endsWith(src, \"index\") && opts.allSlugs.includes(`${src}/index` as FullSlug)\n ? (`${src}/index` as FullSlug)\n : src;\n\n const folderTail = isFolderPath(targetSlug) ? \"/\" : \"\";\n const canonicalSlug = stripSlashes(targetSlug.slice(\".\".length));\n const [targetCanonical, targetAnchor] = splitAnchor(canonicalSlug);\n\n if (opts.strategy === \"shortest\") {\n const isMultiSegment = targetCanonical.includes(\"/\");\n const isFolderTarget = isFolderPath(targetSlug);\n let matchingFileNames = opts.allSlugs.filter((slug) => {\n if (isMultiSegment) {\n // Multi-segment partial path: match by suffix\n if (slug === targetCanonical || slug.endsWith(\"/\" + targetCanonical)) {\n return true;\n }\n // Folder targets have \"/index\" stripped — also match the \"/index\" variant\n if (isFolderTarget) {\n const withIndex = targetCanonical + \"/index\";\n return slug === withIndex || slug.endsWith(\"/\" + withIndex);\n }\n return false;\n }\n const parts = slug.split(\"/\");\n const fileName = parts.at(-1);\n return targetCanonical === fileName;\n });\n\n // Folder note Foo/Foo.md slugs to Foo/index, so its last segment never matches [[Foo]]\n // Retry by folder name, only when no real file claims it\n if (matchingFileNames.length === 0 && !isMultiSegment) {\n matchingFileNames = opts.allSlugs.filter((slug) => {\n const parts = slug.split(\"/\");\n return parts.at(-1) === \"index\" && parts.at(-2) === targetCanonical;\n });\n }\n\n if (matchingFileNames.length === 1) {\n const matchedSlug = matchingFileNames[0]!;\n return (resolveRelative(effectiveSrc, matchedSlug) + targetAnchor) as RelativeURL;\n }\n }\n\n return (joinSegments(pathToRoot(effectiveSrc), canonicalSlug) + folderTail) as RelativeURL;\n }\n}\n\n/**\n * A relative link can name a folder note (`topic/Topic.md`, slugged\n * `topic/index`) without spelling out its folder, e.g. `./Topic.md` written\n * inside `topic/`. `slugifyFilePath` only sees the segments the link spells\n * out, so apply the folder-note rule to the target as resolved against the\n * source's folder, and return the link with its file name replaced by\n * `index`. Returns `undefined` when the target is not such a folder note.\n * @internal\n */\nfunction _resolveRelativeFolderNote(src: FullSlug, target: string): RelativeURL | undefined {\n let decoded: string;\n try {\n decoded = decodeURI(target);\n } catch {\n return undefined;\n }\n const hashIdx = decoded.indexOf(\"#\");\n const fplike = hashIdx === -1 ? decoded : decoded.slice(0, hashIdx);\n const rest = hashIdx === -1 ? \"\" : decoded.slice(hashIdx);\n if (fplike === \"\" || fplike.endsWith(\"/\") || fplike.startsWith(\"/\")) return undefined;\n\n const ext = getFileExtension(fplike);\n if (![\".md\", \".html\", undefined].includes(ext)) return undefined;\n\n const segments = fplike.split(\"/\");\n const fileName = segments[segments.length - 1]!;\n const fileSlug = slugifyPath(ext ? fileName.slice(0, -ext.length) : fileName);\n if (fileSlug === \"index\") return undefined;\n\n // Resolve the link's folder against the source's folder (both as slugs)\n const resolved = src.split(\"/\").slice(0, -1);\n for (const seg of segments.slice(0, -1)) {\n if (seg === \"\" || seg === \".\") continue;\n if (seg === \"..\") {\n if (resolved.length === 0) return undefined;\n resolved.pop();\n } else {\n resolved.push(slugifyPath(seg));\n }\n }\n\n if (resolved.length === 0 || resolved[resolved.length - 1] !== fileSlug) return undefined;\n\n segments[segments.length - 1] = \"index\" + (ext ?? \"\");\n return transformInternalLink(encodeURI(segments.join(\"/\") + rest));\n}\n\n/**\n * Slugify a file path for use as an href.\n * Replaces whitespace→hyphens, &→-and-, %→-percent, removes ? and #, and\n * lowercases the result so that link matching is case-insensitive (matching\n * Obsidian's link-resolution semantics). Operates per segment so directory\n * separators are preserved.\n */\nexport function slugifyPath(s: string): string {\n return s\n .split(\"/\")\n .map((segment) =>\n segment\n .replace(/\\s/g, \"-\")\n .replace(/&/g, \"-and-\")\n .replace(/%/g, \"-percent\")\n .replace(/\\?/g, \"\")\n .replace(/#/g, \"\")\n .replace(/[<>:\"|*]/g, \"\")\n .toLowerCase(),\n )\n .join(\"/\")\n .replace(/\\/$/, \"\");\n}\n\n/**\n * Re-base the relative `href` and `src` attributes of a HAST element so that\n * links inside content originally resolved relative to `newBase` remain valid\n * when the element is embedded at a page with slug `curBase`.\n *\n * Used for transclusions and cross-slug HAST embedding (Quartz core's\n * `renderPage` transclude expansion, canvas-page's embedded file-nodes, and\n * any plugin that takes `vfile.data.htmlAst` from one page and renders it\n * inside another). Absolute URLs pass through unchanged.\n *\n * The element (and its children) are deep-cloned via `structuredClone`, so\n * the original HAST tree is never mutated.\n */\nexport function normalizeHastElement<T extends HastElement>(\n rawEl: T,\n curBase: FullSlug,\n newBase: FullSlug,\n): T {\n const el = structuredClone(rawEl);\n _rebaseHastElement(el, \"src\", curBase, newBase);\n _rebaseHastElement(el, \"href\", curBase, newBase);\n if (el.children) {\n el.children = el.children.map((child) =>\n child.type === \"element\"\n ? (normalizeHastElement(child as HastElement, curBase, newBase) as typeof child)\n : child,\n );\n }\n return el;\n}\n\n/** @internal */\nfunction _rebaseHastElement(\n el: HastElement,\n attr: \"href\" | \"src\",\n curBase: FullSlug,\n newBase: FullSlug,\n): void {\n const value = el.properties?.[attr];\n if (value === undefined || value === null) return;\n const href = String(value);\n if (!isRelativeURL(href)) return;\n el.properties![attr] = joinSegments(resolveRelative(curBase, newBase), \"..\", href);\n}\n\n/** @internal */\nfunction _sluggify(s: string): string {\n return slugifyPath(s);\n}\n\nfunction _containsForbiddenCharacters(s: string): boolean {\n return s.includes(\" \") || s.includes(\"#\") || s.includes(\"?\") || s.includes(\"&\");\n}\n\nfunction _hasFileExtension(s: string): boolean {\n return getFileExtension(s) !== undefined;\n}\n\nfunction _isRelativeSegment(s: string): boolean {\n return /^\\.{0,2}$/.test(s);\n}\n\nfunction _addRelativeToStart(s: string): string {\n if (s === \"\") {\n s = \".\";\n }\n\n if (!s.startsWith(\".\")) {\n s = joinSegments(\".\", s);\n }\n\n return s;\n}\n","/** Normal hydration that attaches to a DOM tree but does not diff it. */\nexport const MODE_HYDRATE = 1 << 5;\n/** Signifies this VNode suspended on the previous render */\nexport const MODE_SUSPENDED = 1 << 7;\n/** Indicates that this node needs to be inserted while patching children */\nexport const INSERT_VNODE = 1 << 2;\n/** Indicates a VNode has been matched with another VNode in the diff */\nexport const MATCHED = 1 << 1;\n\n/** Reset all mode flags */\nexport const RESET_MODE = ~(MODE_HYDRATE | MODE_SUSPENDED);\n\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nexport const XHTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\nexport const MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n\nexport const NULL = null;\nexport const UNDEFINED = undefined;\nexport const EMPTY_OBJ = /** @type {any} */ ({});\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL =\n\t/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\n","import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","import { NULL } from '../constants';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw the error that was caught (except\n * for unmounting when this parameter is the highest parent that was being\n * unmounted)\n * @param {import('../internal').VNode} [oldVNode]\n * @param {import('../internal').ErrorInfo} [errorInfo]\n */\nexport function _catchError(error, vnode, oldVNode, errorInfo) {\n\t/** @type {import('../internal').Component} */\n\tlet component,\n\t\t/** @type {import('../internal').ComponentType} */\n\t\tctor,\n\t\t/** @type {boolean} */\n\t\thandled;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tctor = component.constructor;\n\n\t\t\t\tif (ctor && ctor.getDerivedStateFromError != NULL) {\n\t\t\t\t\tcomponent.setState(ctor.getDerivedStateFromError(error));\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != NULL) {\n\t\t\t\t\tcomponent.componentDidCatch(error, errorInfo || {});\n\t\t\t\t\thandled = component._dirty;\n\t\t\t\t}\n\n\t\t\t\t// This is an error boundary. Mark it as having bailed out, and whether it was mid-hydration.\n\t\t\t\tif (handled) {\n\t\t\t\t\treturn (component._pendingError = component);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\nimport { MODE_HYDRATE, NULL } from './constants';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function BaseComponent(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @this {import('./internal').Component}\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nBaseComponent.prototype.setState = function (update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState != NULL && this._nextState != this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\t// Some libraries like `immer` mark the current state as readonly,\n\t\t// preventing us from mutating it, so we need to clone it. See #2716\n\t\tupdate = update(assign({}, s), this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == NULL) return;\n\n\tif (this._vnode) {\n\t\tif (callback) {\n\t\t\tthis._stateCallbacks.push(callback);\n\t\t}\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @this {import('./internal').Component}\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nBaseComponent.prototype.forceUpdate = function (callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](https://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {ComponentChildren | void}\n */\nBaseComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == NULL) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._index + 1)\n\t\t\t: NULL;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != NULL && sibling._dom != NULL) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : NULL;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tif (component._parentDom && component._dirty) {\n\t\tlet oldVNode = component._vnode,\n\t\t\toldDom = oldVNode._dom,\n\t\t\tcommitQueue = [],\n\t\t\trefQueue = [],\n\t\t\tnewVNode = assign({}, oldVNode);\n\t\tnewVNode._original = oldVNode._original + 1;\n\t\tif (options.vnode) options.vnode(newVNode);\n\n\t\tdiff(\n\t\t\tcomponent._parentDom,\n\t\t\tnewVNode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tcomponent._parentDom.namespaceURI,\n\t\t\toldVNode._flags & MODE_HYDRATE ? [oldDom] : NULL,\n\t\t\tcommitQueue,\n\t\t\toldDom == NULL ? getDomSibling(oldVNode) : oldDom,\n\t\t\t!!(oldVNode._flags & MODE_HYDRATE),\n\t\t\trefQueue\n\t\t);\n\n\t\tnewVNode._original = oldVNode._original;\n\t\tnewVNode._parent._children[newVNode._index] = newVNode;\n\t\tcommitRoot(commitQueue, newVNode, refQueue);\n\t\toldVNode._dom = oldVNode._parent = null;\n\n\t\tif (newVNode._dom != oldDom) {\n\t\t\tupdateParentDomPointers(newVNode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != NULL && vnode._component != NULL) {\n\t\tvnode._dom = vnode._component.base = NULL;\n\t\tvnode._children.some(child => {\n\t\t\tif (child != NULL && child._dom != NULL) {\n\t\t\t\treturn (vnode._dom = vnode._component.base = child._dom);\n\t\t\t}\n\t\t});\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!process._rerenderCount++) ||\n\t\tprevDebounce != options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/**\n * @param {import('./internal').Component} a\n * @param {import('./internal').Component} b\n */\nconst depthSort = (a, b) => a._vnode._depth - b._vnode._depth;\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\ttry {\n\t\tlet c,\n\t\t\tl = 1;\n\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\twhile (rerenderQueue.length) {\n\t\t\t// Keep the rerender queue sorted by (depth, insertion order). The queue\n\t\t\t// will initially be sorted on the first iteration only if it has more than 1 item.\n\t\t\t//\n\t\t\t// New items can be added to the queue e.g. when rerendering a provider, so we want to\n\t\t\t// keep the order from top to bottom with those new items so we can handle them in a\n\t\t\t// single pass\n\t\t\tif (rerenderQueue.length > l) {\n\t\t\t\trerenderQueue.sort(depthSort);\n\t\t\t}\n\n\t\t\tc = rerenderQueue.shift();\n\t\t\tl = rerenderQueue.length;\n\n\t\t\trenderComponent(c);\n\t\t}\n\t} finally {\n\t\trerenderQueue.length = process._rerenderCount = 0;\n\t}\n}\n\nprocess._rerenderCount = 0;\n","import { IS_NON_DIMENSIONAL, NULL, SVG_NAMESPACE } from '../constants';\nimport options from '../options';\n\n// Per-instance unique key for event clock stamps. Each Preact copy on the page\n// gets its own random suffix so that `_dispatched` / `_attached` properties on\n// shared event objects and handler functions cannot collide across instances.\n// ~1 in 60M collision odds - if you have that many praect versions on the page,\n// you deserve some weird bugs.\n// In 11 we can replace this with a\n// Symbol\nlet _id = Math.random().toString(8),\n\tEVENT_DISPATCHED = '__d' + _id,\n\tEVENT_ATTACHED = '__a' + _id;\n\nfunction setStyle(style, key, value) {\n\tif (key[0] == '-') {\n\t\tstyle.setProperty(key, value == NULL ? '' : value);\n\t} else if (value == NULL) {\n\t\tstyle[key] = '';\n\t} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {\n\t\tstyle[key] = value;\n\t} else {\n\t\tstyle[key] = value + 'px';\n\t}\n}\n\nconst CAPTURE_REGEX = /(PointerCapture)$|Capture$/i;\n\n// A logical clock to solve issues like https://github.com/preactjs/preact/issues/3927.\n// When the DOM performs an event it leaves micro-ticks in between bubbling up which means that\n// an event can trigger on a newly reated DOM-node while the event bubbles up.\n//\n// Originally inspired by Vue\n// (https://github.com/vuejs/core/blob/caeb8a68811a1b0f79/packages/runtime-dom/src/modules/events.ts#L90-L101),\n// but modified to use a logical clock instead of Date.now() in case event handlers get attached\n// and events get dispatched during the same millisecond.\n//\n// The clock is incremented after each new event dispatch. This allows 1 000 000 new events\n// per second for over 280 years before the value reaches Number.MAX_SAFE_INTEGER (2**53 - 1).\nlet eventClock = 0;\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {string} namespace Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, namespace) {\n\tlet useCapture;\n\n\to: if (name == 'style') {\n\t\tif (typeof value == 'string') {\n\t\t\tdom.style.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\tdom.style.cssText = oldValue = '';\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (name in oldValue) {\n\t\t\t\t\tif (!(value && name in value)) {\n\t\t\t\t\t\tsetStyle(dom.style, name, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (name in value) {\n\t\t\t\t\tif (!oldValue || value[name] != oldValue[name]) {\n\t\t\t\t\t\tsetStyle(dom.style, name, value[name]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] == 'o' && name[1] == 'n') {\n\t\tuseCapture = name != (name = name.replace(CAPTURE_REGEX, '$1'));\n\t\tconst lowerCaseName = name.toLowerCase();\n\n\t\t// Infer correct casing for DOM built-in events:\n\t\tif (lowerCaseName in dom || name == 'onFocusOut' || name == 'onFocusIn')\n\t\t\tname = lowerCaseName.slice(2);\n\t\telse name = name.slice(2);\n\n\t\tif (!dom._listeners) dom._listeners = {};\n\t\tdom._listeners[name + useCapture] = value;\n\n\t\tif (value) {\n\t\t\tif (!oldValue) {\n\t\t\t\tvalue[EVENT_ATTACHED] = eventClock;\n\t\t\t\tdom.addEventListener(\n\t\t\t\t\tname,\n\t\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\t\tuseCapture\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tvalue[EVENT_ATTACHED] = oldValue[EVENT_ATTACHED];\n\t\t\t}\n\t\t} else {\n\t\t\tdom.removeEventListener(\n\t\t\t\tname,\n\t\t\t\tuseCapture ? eventProxyCapture : eventProxy,\n\t\t\t\tuseCapture\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (namespace == SVG_NAMESPACE) {\n\t\t\t// Normalize incorrect prop usage for SVG:\n\t\t\t// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)\n\t\t\t// - className --> class\n\t\t\tname = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');\n\t\t} else if (\n\t\t\tname != 'width' &&\n\t\t\tname != 'height' &&\n\t\t\tname != 'href' &&\n\t\t\tname != 'list' &&\n\t\t\tname != 'form' &&\n\t\t\t// Default value in browsers is `-1` and an empty string is\n\t\t\t// cast to `0` instead\n\t\t\tname != 'tabIndex' &&\n\t\t\tname != 'download' &&\n\t\t\tname != 'rowSpan' &&\n\t\t\tname != 'colSpan' &&\n\t\t\tname != 'role' &&\n\t\t\tname != 'popover' &&\n\t\t\tname in dom\n\t\t) {\n\t\t\ttry {\n\t\t\t\tdom[name] = value == NULL ? '' : value;\n\t\t\t\t// labelled break is 1b smaller here than a return statement (sorry)\n\t\t\t\tbreak o;\n\t\t\t} catch (e) {}\n\t\t}\n\n\t\t// aria- and data- attributes have no boolean representation.\n\t\t// A `false` value is different from the attribute not being\n\t\t// present, so we can't remove it. For non-boolean aria\n\t\t// attributes we could treat false as a removal, but the\n\t\t// amount of exceptions would cost too many bytes. On top of\n\t\t// that other frameworks generally stringify `false`.\n\n\t\tif (typeof value == 'function') {\n\t\t\t// never serialize functions as attribute values\n\t\t} else if (value != NULL && (value !== false || name[4] == '-')) {\n\t\t\tdom.setAttribute(name, name == 'popover' && value == true ? '' : value);\n\t\t} else {\n\t\t\tdom.removeAttribute(name);\n\t\t}\n\t}\n}\n\n/**\n * Create an event proxy function.\n * @param {boolean} useCapture Is the event handler for the capture phase.\n * @private\n */\nfunction createEventProxy(useCapture) {\n\t/**\n\t * Proxy an event to hooked event handlers\n\t * @param {import('../internal').PreactEvent} e The event object from the browser\n\t * @private\n\t */\n\treturn function (e) {\n\t\tif (this._listeners) {\n\t\t\tconst eventHandler = this._listeners[e.type + useCapture];\n\t\t\tif (e[EVENT_DISPATCHED] == NULL) {\n\t\t\t\te[EVENT_DISPATCHED] = eventClock++;\n\n\t\t\t\t// When `e[EVENT_DISPATCHED]` is smaller than the time when the targeted event\n\t\t\t\t// handler was attached we know we have bubbled up to an element that was added\n\t\t\t\t// during patching the DOM.\n\t\t\t} else if (e[EVENT_DISPATCHED] < eventHandler[EVENT_ATTACHED]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn eventHandler(options.event ? options.event(e) : e);\n\t\t}\n\t};\n}\n\nconst eventProxy = createEventProxy(false);\nconst eventProxyCapture = createEventProxy(true);\n","import { enqueueRender } from './component';\nimport { NULL } from './constants';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tfunction Context(props) {\n\t\tif (!this.getChildContext) {\n\t\t\t/** @type {Set<import('./internal').Component> | null} */\n\t\t\tlet subs = new Set();\n\t\t\tlet ctx = {};\n\t\t\tctx[Context._id] = this;\n\n\t\t\tthis.getChildContext = () => ctx;\n\n\t\t\tthis.componentWillUnmount = () => {\n\t\t\t\tsubs = NULL;\n\t\t\t};\n\n\t\t\tthis.shouldComponentUpdate = function (_props) {\n\t\t\t\t// @ts-expect-error even\n\t\t\t\tif (this.props.value != _props.value) {\n\t\t\t\t\tsubs.forEach(c => {\n\t\t\t\t\t\tc._force = true;\n\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.sub = c => {\n\t\t\t\tsubs.add(c);\n\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\tif (subs) {\n\t\t\t\t\t\tsubs.delete(c);\n\t\t\t\t\t}\n\t\t\t\t\tif (old) old.call(c);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\n\t\treturn props.children;\n\t}\n\n\tContext._id = '__cC' + i++;\n\tContext._defaultValue = defaultValue;\n\n\t/** @type {import('./internal').FunctionComponent} */\n\tContext.Consumer = (props, contextValue) => {\n\t\treturn props.children(contextValue);\n\t};\n\n\t// we could also get rid of _contextRef entirely\n\tContext.Provider =\n\t\tContext._contextRef =\n\t\tContext.Consumer.contextType =\n\t\t\tContext;\n\n\treturn Context;\n}\n","import { options, Fragment } from 'preact';\nimport { encodeEntities } from './utils';\nimport { IS_NON_DIMENSIONAL } from '../../src/constants';\n\nlet vnodeId = 0;\n\nconst isArray = Array.isArray;\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {unknown} [isStaticChildren]\n * @param {unknown} [__source]\n * @param {unknown} [__self]\n */\nfunction createVNode(type, props, key, isStaticChildren, __source, __self) {\n\tif (!props) props = {};\n\t// We'll want to preserve `ref` in props to get rid of the need for\n\t// forwardRef components in the future, but that should happen via\n\t// a separate PR.\n\tlet normalizedProps = props,\n\t\tref,\n\t\ti;\n\n\tif ('ref' in normalizedProps) {\n\t\tnormalizedProps = {};\n\t\tfor (i in props) {\n\t\t\tif (i == 'ref') {\n\t\t\t\tref = props[i];\n\t\t\t} else {\n\t\t\t\tnormalizedProps[i] = props[i];\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @type {VNode & { __source: any; __self: any }} */\n\tconst vnode = {\n\t\ttype,\n\t\tprops: normalizedProps,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_component: null,\n\t\tconstructor: undefined,\n\t\t_original: --vnodeId,\n\t\t_index: -1,\n\t\t_flags: 0,\n\t\t__source,\n\t\t__self\n\t};\n\n\t// If a Component VNode, check for and apply defaultProps.\n\t// Note: `type` is often a String, and can be `undefined` in development.\n\tif (typeof type === 'function' && (ref = type.defaultProps)) {\n\t\tfor (i in ref)\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = ref[i];\n\t\t\t}\n\t}\n\n\tif (options.vnode) options.vnode(vnode);\n\treturn vnode;\n}\n\n/**\n * Create a template vnode. This function is not expected to be\n * used directly, but rather through a precompile JSX transform\n * @param {string[]} templates\n * @param {Array<string | null | VNode>} exprs\n * @returns {VNode}\n */\nfunction jsxTemplate(templates, ...exprs) {\n\tconst vnode = createVNode(Fragment, { tpl: templates, exprs });\n\t// Bypass render to string top level Fragment optimization\n\tvnode.key = vnode._vnode;\n\treturn vnode;\n}\n\nconst JS_TO_CSS = {};\nconst CSS_REGEX = /[A-Z]/g;\n\n/**\n * Unwrap potential signals.\n * @param {*} value\n * @returns {*}\n */\nfunction normalizeAttrValue(value) {\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.valueOf === 'function'\n\t\t? value.valueOf()\n\t\t: value;\n}\n\n/**\n * Serialize an HTML attribute to a string. This function is not\n * expected to be used directly, but rather through a precompile\n * JSX transform\n * @param {string} name The attribute name\n * @param {*} value The attribute value\n * @returns {string}\n */\nfunction jsxAttr(name, value) {\n\tif (options.attr) {\n\t\tconst result = options.attr(name, value);\n\t\tif (typeof result === 'string') return result;\n\t}\n\n\tvalue = normalizeAttrValue(value);\n\n\tif (name === 'ref' || name === 'key') return '';\n\tif (name === 'style' && typeof value === 'object') {\n\t\tlet str = '';\n\t\tfor (let prop in value) {\n\t\t\tlet val = value[prop];\n\t\t\tif (val != null && val !== '') {\n\t\t\t\tconst name =\n\t\t\t\t\tprop[0] == '-'\n\t\t\t\t\t\t? prop\n\t\t\t\t\t\t: JS_TO_CSS[prop] ||\n\t\t\t\t\t\t\t(JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());\n\n\t\t\t\tlet suffix = ';';\n\t\t\t\tif (\n\t\t\t\t\ttypeof val === 'number' &&\n\t\t\t\t\t// Exclude custom-attributes\n\t\t\t\t\t!name.startsWith('--') &&\n\t\t\t\t\t!IS_NON_DIMENSIONAL.test(name)\n\t\t\t\t) {\n\t\t\t\t\tsuffix = 'px;';\n\t\t\t\t}\n\t\t\t\tstr = str + name + ':' + val + suffix;\n\t\t\t}\n\t\t}\n\t\treturn name + '=\"' + encodeEntities(str) + '\"';\n\t}\n\n\tif (\n\t\tvalue == null ||\n\t\tvalue === false ||\n\t\ttypeof value === 'function' ||\n\t\ttypeof value === 'object'\n\t) {\n\t\treturn '';\n\t} else if (value === true) return name;\n\n\treturn name + '=\"' + encodeEntities('' + value) + '\"';\n}\n\n/**\n * Escape a dynamic child passed to `jsxTemplate`. This function\n * is not expected to be used directly, but rather through a\n * precompile JSX transform\n * @param {*} value\n * @returns {string | null | VNode | Array<string | null | VNode>}\n */\nfunction jsxEscape(value) {\n\tif (\n\t\tvalue == null ||\n\t\ttypeof value === 'boolean' ||\n\t\ttypeof value === 'function'\n\t) {\n\t\treturn null;\n\t}\n\n\tif (typeof value === 'object') {\n\t\t// Check for VNode\n\t\tif (value.constructor === undefined) return value;\n\n\t\tif (isArray(value)) {\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tvalue[i] = jsxEscape(value[i]);\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t}\n\n\treturn encodeEntities('' + value);\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment,\n\t// precompiled JSX transform\n\tjsxTemplate,\n\tjsxAttr,\n\tjsxEscape\n};\n","import { slugifyFilePath } from \"@quartz-community/utils/path\";\nimport { joinSegments } from \"@quartz-community/utils\";\n\ninterface FileTrieData {\n slug: string;\n title: string;\n filePath: string;\n}\n\nexport class FileTrieNode<T extends FileTrieData = FileTrieData> {\n isFolder: boolean;\n children: Array<FileTrieNode<T>>;\n\n private slugSegments: string[];\n private fileSegmentHint?: string;\n private displayNameOverride?: string;\n data: T | null;\n\n constructor(segments: string[], data?: T) {\n this.children = [];\n this.slugSegments = segments;\n this.data = data ?? null;\n this.isFolder = false;\n this.displayNameOverride = undefined;\n }\n\n get displayName(): string {\n const nonIndexTitle = this.data?.title === \"index\" ? undefined : this.data?.title;\n return (\n this.displayNameOverride ?? nonIndexTitle ?? this.fileSegmentHint ?? this.slugSegment ?? \"\"\n );\n }\n\n set displayName(name: string) {\n this.displayNameOverride = name;\n }\n\n get slug(): string {\n const path = joinSegments(...this.slugSegments);\n if (this.isFolder) {\n return joinSegments(path, \"index\");\n }\n\n return path;\n }\n\n get slugSegment(): string {\n return this.slugSegments[this.slugSegments.length - 1] ?? \"\";\n }\n\n private makeChild(path: string[], file?: T): FileTrieNode<T> {\n const nextSegment = path[0];\n if (!nextSegment) {\n throw new Error(\"path is empty\");\n }\n const fullPath = [...this.slugSegments, nextSegment];\n const child = new FileTrieNode<T>(fullPath, file);\n this.children.push(child);\n return child;\n }\n\n private insert(path: string[], file: T): void {\n if (path.length === 0) {\n throw new Error(\"path is empty\");\n }\n\n this.isFolder = true;\n const segment = path[0];\n if (!segment) {\n throw new Error(\"path is empty\");\n }\n if (path.length === 1) {\n if (segment === \"index\") {\n this.data ??= file;\n } else {\n this.makeChild(path, file);\n }\n } else if (path.length > 1) {\n const child =\n this.children.find((c) => c.slugSegment === segment) ?? this.makeChild(path, undefined);\n\n const fileParts = file.filePath.split(\"/\");\n const hint = fileParts.at(-path.length);\n if (hint) {\n child.fileSegmentHint = hint;\n }\n child.insert(path.slice(1), file);\n }\n }\n\n /** Add a page at `position` (default: its slug); see trieFromAllFiles. */\n add(file: T, position: string = file.slug): void {\n this.insert(position.split(\"/\"), file);\n }\n\n findNode(path: string[]): FileTrieNode<T> | undefined {\n if (path.length === 0 || (path.length === 1 && path[0] === \"index\")) {\n return this;\n }\n\n return this.children.find((c) => c.slugSegment === path[0])?.findNode(path.slice(1));\n }\n\n ancestryChain(path: string[]): Array<FileTrieNode<T>> | undefined {\n if (path.length === 0 || (path.length === 1 && path[0] === \"index\")) {\n return [this];\n }\n\n const child = this.children.find((c) => c.slugSegment === path[0]);\n if (!child) {\n return undefined;\n }\n\n const childPath = child.ancestryChain(path.slice(1));\n if (!childPath) {\n return undefined;\n }\n\n return [this, ...childPath];\n }\n\n filter(filterFn: (node: FileTrieNode<T>) => boolean): void {\n this.children = this.children.filter(filterFn);\n this.children.forEach((child) => child.filter(filterFn));\n }\n\n map(mapFn: (node: FileTrieNode<T>) => void): void {\n mapFn(this);\n this.children.forEach((child) => child.map(mapFn));\n }\n\n sort(sortFn: (a: FileTrieNode<T>, b: FileTrieNode<T>) => number): void {\n this.children = this.children.sort(sortFn);\n this.children.forEach((e) => e.sort(sortFn));\n }\n}\n\nexport function trieFromAllFiles(\n allFiles: Array<{\n slug?: string;\n filePath?: string;\n relativePath?: string;\n frontmatter?: { title?: string; [key: string]: unknown };\n }>,\n): FileTrieNode {\n const trie = new FileTrieNode([]);\n allFiles.forEach((file) => {\n if (file.frontmatter) {\n trie.add(\n {\n slug: file.slug!,\n title: file.frontmatter.title ?? \"\",\n filePath: file.filePath!,\n },\n pagePosition(file),\n );\n }\n });\n\n return trie;\n}\n\n/**\n * Where a page sits in the navigation: its file path. A note with a permalink is published at the\n * permalink (its slug) but stays in its folder, as in Obsidian Publish.\n */\nexport function pagePosition(file: { slug?: string; relativePath?: string }): string {\n return file.relativePath ? slugifyFilePath(file.relativePath as never) : (file.slug ?? \"\");\n}\n",".breadcrumb-container {\n margin: 0;\n margin-top: 0.75rem;\n padding: 0;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 0.5rem;\n}\n\n.breadcrumb-element p {\n margin: 0;\n margin-left: 0.5rem;\n padding: 0;\n line-height: normal;\n}\n.breadcrumb-element {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n}","import type {\n QuartzComponent,\n QuartzComponentConstructor,\n QuartzComponentProps,\n} from \"@quartz-community/types\";\nimport { classNames } from \"../util/lang\";\nimport { resolveRelative, simplifySlug } from \"../util/path\";\nimport { FileTrieNode, pagePosition, trieFromAllFiles } from \"../util/fileTrie\";\nimport style from \"./styles/breadcrumbs.scss\";\n\ntype CrumbData = {\n displayName: string;\n path: string;\n};\n\nexport interface BreadcrumbOptions {\n /** Symbol between crumbs */\n spacerSymbol: string;\n /** Name of first crumb */\n rootName: string;\n /** Whether to look up frontmatter title for folders */\n resolveFrontmatterTitle: boolean;\n /** Whether to display the current page in the breadcrumbs */\n showCurrentPage: boolean;\n}\n\nconst defaultOptions: BreadcrumbOptions = {\n spacerSymbol: \"❯\",\n rootName: \"Home\",\n resolveFrontmatterTitle: true,\n showCurrentPage: true,\n};\n\nfunction formatCrumb(displayName: string, baseSlug: string, currentSlug: string): CrumbData {\n return {\n displayName,\n path: resolveRelative(baseSlug, currentSlug),\n };\n}\n\nexport default ((opts?: Partial<BreadcrumbOptions>) => {\n const options: BreadcrumbOptions = { ...defaultOptions, ...opts };\n const Breadcrumbs: QuartzComponent = ({\n fileData,\n allFiles,\n displayClass,\n ctx,\n }: QuartzComponentProps) => {\n const typedCtx = (ctx ?? {}) as Record<string, unknown> as { trie?: FileTrieNode };\n typedCtx.trie ??= trieFromAllFiles(\n allFiles as Array<{\n slug?: string;\n filePath?: string;\n frontmatter?: { title?: string; [key: string]: unknown };\n }>,\n );\n const trie = typedCtx.trie;\n const slug = fileData.slug as string;\n // the page's place in the navigation (its file path), which differs from its slug with a permalink\n const slugParts = pagePosition(fileData as { slug?: string; relativePath?: string }).split(\"/\");\n const pathNodes = trie.ancestryChain(slugParts);\n\n if (!pathNodes) {\n return null;\n }\n\n const crumbs: CrumbData[] = pathNodes.map((node, idx) => {\n const crumb = formatCrumb(node.displayName, slug, simplifySlug(node.slug));\n if (idx === 0) {\n crumb.displayName = options.rootName;\n }\n\n if (idx === pathNodes.length - 1) {\n crumb.path = \"\";\n }\n\n return crumb;\n });\n\n if (!options.showCurrentPage) {\n crumbs.pop();\n }\n\n return (\n <nav class={classNames(displayClass, \"breadcrumb-container\")} aria-label=\"breadcrumbs\">\n {crumbs.map((crumb, index) => (\n <div class=\"breadcrumb-element\">\n <a href={crumb.path}>{crumb.displayName}</a>\n {index !== crumbs.length - 1 && <p>{` ${options.spacerSymbol} `}</p>}\n </div>\n ))}\n </nav>\n );\n };\n Breadcrumbs.css = style;\n\n return Breadcrumbs;\n}) satisfies QuartzComponentConstructor;\n"]}
|
|
1
|
+
{"version":3,"sources":["../node_modules/@quartz-community/utils/src/lang.ts","../node_modules/@quartz-community/utils/src/path.ts","../node_modules/@quartz-community/utils/node_modules/inline-style-parser/index.js","../node_modules/@quartz-community/utils/node_modules/style-to-object/src/index.ts","../node_modules/@quartz-community/utils/node_modules/style-to-js/src/utilities.ts","../node_modules/@quartz-community/utils/node_modules/style-to-js/src/index.ts","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/util/schema.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/util/merge.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/normalize.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/util/info.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/util/types.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/util/defined-info.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/util/create.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/aria.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/util/case-sensitive-transform.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/util/case-insensitive-transform.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/html.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/svg.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/xlink.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/xmlns.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/lib/xml.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/node_modules/property-information/index.js","../node_modules/@quartz-community/utils/node_modules/hast-util-to-jsx-runtime/lib/index.js","../node_modules/@quartz-community/utils/node_modules/unist-util-stringify-position/lib/index.js","../node_modules/@quartz-community/utils/node_modules/vfile-message/lib/index.js","../src/util/fileTrie.ts","../src/components/styles/breadcrumbs.scss","../src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KAAA,GAAQ,YAAY,IAAA,CAAK,WAAA,EAAa,MAAM,YAAA,CAAa,IAAA,CAAK,IAAI,CAAC,CAAA;AACzE,MAAA,IAAI,QAAQ,CAAA,EAAG;AACb,QAAA,KAAA,CAAM,cAAc,OAAA,CAAQ,QAAA;AAAA,MAC9B;AAEA,MAAA,IAAI,GAAA,KAAQ,SAAA,CAAU,MAAA,GAAS,CAAA,EAAG;AAChC,QAAA,KAAA,CAAM,IAAA,GAAO,EAAA;AAAA,MACf;AAEA,MAAA,OAAO,KAAA;AAAA,IACT,CAAC,CAAA;AAED,IAAA,IAAI,CAAC,QAAQ,eAAA,EAAiB;AAC5B,MAAA,MAAA,CAAO,GAAA,EAAI;AAAA,IACb;AAEA,IAAA,uBACEG,GAAAA,CAAC,KAAA,EAAA,EAAI,OAAO,UAAA,CAAW,YAAA,EAAc,sBAAsB,CAAA,EAAG,YAAA,EAAW,eACtE,QAAA,EAAA,MAAA,CAAO,GAAA,CAAI,CAAC,KAAA,EAAOT,MAAAA,qBAClBU,IAAAA,CAAC,KAAA,EAAA,EAAI,OAAM,oBAAA,EACT,QAAA,EAAA;AAAA,sBAAAD,IAAC,GAAA,EAAA,EAAE,IAAA,EAAM,KAAA,CAAM,IAAA,EAAO,gBAAM,WAAA,EAAY,CAAA;AAAA,MACvCT,MAAAA,KAAU,MAAA,CAAO,MAAA,GAAS,CAAA,oBAAKS,IAAC,GAAA,EAAA,EAAG,QAAA,EAAA,CAAA,CAAA,EAAI,OAAA,CAAQ,YAAY,CAAA,CAAA,CAAA,EAAI;AAAA,KAAA,EAClE,CACD,CAAA,EACH,CAAA;AAAA,EAEJ,CAAA;AACA,EAAA,WAAA,CAAY,GAAA,GAAM,mBAAA;AAElB,EAAA,OAAO,WAAA;AACT,CAAA","file":"index.js","sourcesContent":["export function capitalize(s: string): string {\n return s.substring(0, 1).toUpperCase() + s.substring(1);\n}\n\nexport function classNames(...classes: (string | undefined | null | false)[]): string {\n return classes.filter(Boolean).join(\" \");\n}\n","import GithubSlugger, { slug as githubSlug } from \"github-slugger\";\nimport type { Element as HastElement } from \"hast\";\nimport type { FilePath, FullSlug } from \"@quartz-community/types\";\n\nexport type { FilePath, FullSlug };\n\n/** No '/index' ending, no file extension, can have trailing slash for folders. */\nexport type SimpleSlug = string & { _brand: \"SimpleSlug\" };\n\n/** Starts with './' or '../', used for navigation. */\nexport type RelativeURL = string & { _brand: \"RelativeURL\" };\n\nexport interface TransformOptions {\n strategy: \"absolute\" | \"relative\" | \"shortest\";\n allSlugs: FullSlug[];\n}\n\nexport function isFilePath(s: string): s is FilePath {\n const validStart = !s.startsWith(\".\");\n return validStart && _hasFileExtension(s);\n}\n\nexport function isFullSlug(s: string): s is FullSlug {\n const validStart = !(s.startsWith(\".\") || s.startsWith(\"/\"));\n const validEnding = !s.endsWith(\"/\");\n return validStart && validEnding && !_containsForbiddenCharacters(s);\n}\n\nexport function isSimpleSlug(s: string): s is SimpleSlug {\n const validStart = !(s.startsWith(\".\") || (s.length > 1 && s.startsWith(\"/\")));\n const validEnding = !endsWith(s, \"index\");\n return validStart && !_containsForbiddenCharacters(s) && validEnding && !_hasFileExtension(s);\n}\n\nexport function isRelativeURL(s: string): s is RelativeURL {\n const validStart = /^\\.{1,2}/.test(s);\n const validEnding = !endsWith(s, \"index\");\n return validStart && validEnding && ![\".md\", \".html\"].includes(getFileExtension(s) ?? \"\");\n}\n\nexport function isAbsoluteURL(s: string): boolean {\n try {\n new URL(s);\n } catch {\n return false;\n }\n return true;\n}\n\nexport function simplifySlug(fp: FullSlug | string): SimpleSlug {\n const res = stripSlashes(trimSuffix(fp, \"index\"), true);\n return (res.length === 0 ? \"/\" : res) as SimpleSlug;\n}\n\nexport function getFullSlug(window: Window): FullSlug {\n const res = window.document.body.dataset.slug! as FullSlug;\n return res;\n}\n\nexport function getFullSlugFromUrl(): FullSlug {\n let rawSlug = decodeURI(window.location.pathname);\n if (rawSlug.endsWith(\"/\")) rawSlug = rawSlug.slice(0, -1);\n if (rawSlug.startsWith(\"/\")) rawSlug = rawSlug.slice(1);\n return rawSlug as FullSlug;\n}\n\nexport function slugifyFilePath(fp: FilePath, excludeExt?: boolean): FullSlug {\n fp = stripSlashes(fp) as FilePath;\n const ext = getFileExtension(fp);\n const withoutFileExt = fp.replace(new RegExp(ext + \"$\"), \"\");\n const finalExt = excludeExt || [\".md\", \".html\", undefined].includes(ext) ? \"\" : ext;\n\n let slug = _sluggify(withoutFileExt);\n\n if (endsWith(slug, \"_index\")) {\n slug = slug.replace(/_index$/, \"index\");\n }\n\n // Obsidian \"Folder Notes\" convention (insideFolder storage): a file named the\n // same as its parent folder is treated as the folder's landing page. Rewrite\n // `folder/folder` → `folder/index` so every downstream consumer (trie, link\n // resolver, simplifySlug, isFolderPath) sees the canonical Quartz slug shape\n // and Just Works. A top-level single-segment slug is NOT rewritten — that\n // represents Obsidian's `parentFolder` storage mode, which Quartz already\n // routes as a regular top-level page.\n const segments = slug.split(\"/\");\n if (segments.length >= 2 && segments[segments.length - 1] === segments[segments.length - 2]) {\n segments[segments.length - 1] = \"index\";\n slug = segments.join(\"/\");\n }\n\n return (slug + (finalExt ?? \"\")) as FullSlug;\n}\n\nexport function joinSegments(...args: string[]): string {\n if (args.length === 0) {\n return \"\";\n }\n\n let joined = args\n .filter((segment) => segment !== \"\" && segment !== \"/\")\n .map((segment) => stripSlashes(segment))\n .join(\"/\");\n\n const first = args[0];\n const last = args[args.length - 1];\n\n if (first?.startsWith(\"/\")) {\n joined = \"/\" + joined;\n }\n\n if (last?.endsWith(\"/\")) {\n joined = joined + \"/\";\n }\n\n return joined;\n}\n\nexport function resolvePath(to: string): string {\n if (to.startsWith(\"/\")) return to;\n return \"/\" + to;\n}\n\n/** Read the base path injected at build time via `data-basepath` on `<body>`.\n * Returns `\"\"` for root deployments, e.g. `\"/repository\"` for subdirectory. */\nexport function getBasePath(): string {\n if (typeof document === \"undefined\") return \"\";\n return document.body?.dataset?.basepath ?? \"\";\n}\n\n/** Resolve a slug to an absolute URL path, prepending the site's base path.\n * e.g. `resolveBasePath(\"features/Callouts\")` → `\"/repository/features/Callouts\"` */\nexport function resolveBasePath(to: string, basePath?: string): string {\n const base = basePath ?? getBasePath();\n const slug = to.startsWith(\"/\") ? to : \"/\" + to;\n return base + slug;\n}\n\nexport function endsWith(s: string, suffix: string): boolean {\n return s === suffix || s.endsWith(\"/\" + suffix);\n}\n\nexport function trimSuffix(s: string, suffix: string): string {\n if (endsWith(s, suffix)) {\n s = s.slice(0, -suffix.length);\n }\n return s;\n}\n\nexport function stripSlashes(s: string, onlyStripPrefix?: boolean): string {\n if (s.startsWith(\"/\")) {\n s = s.substring(1);\n }\n\n if (!onlyStripPrefix && s.endsWith(\"/\")) {\n s = s.slice(0, -1);\n }\n\n return s;\n}\n\nexport function getFileExtension(s: string): string | undefined {\n return s.match(/\\.[A-Za-z0-9]+$/)?.[0];\n}\n\nexport function isFolderPath(fplike: string): boolean {\n return (\n fplike.endsWith(\"/\") ||\n endsWith(fplike, \"index\") ||\n endsWith(fplike, \"index.md\") ||\n endsWith(fplike, \"index.html\")\n );\n}\n\nexport function getAllSegmentPrefixes(path: string): string[] {\n const segments = path.split(\"/\");\n const results: string[] = [];\n for (let i = 0; i < segments.length; i++) {\n results.push(segments.slice(0, i + 1).join(\"/\"));\n }\n return results;\n}\n\nexport function pathToRoot(slug: FullSlug): RelativeURL {\n let rootPath = slug\n .split(\"/\")\n .filter((x) => x !== \"\")\n .slice(0, -1)\n .map((_) => \"..\")\n .join(\"/\");\n\n if (rootPath.length === 0) {\n rootPath = \".\";\n }\n\n return rootPath as RelativeURL;\n}\n\nexport function resolveRelative(current: FullSlug, target: FullSlug | SimpleSlug): RelativeURL {\n const res = joinSegments(pathToRoot(current), simplifySlug(target as FullSlug)) as RelativeURL;\n return res;\n}\n\n/**\n * The slug of a heading's text: the `id` Quartz gives a heading, and the\n * anchor every link or table-of-contents entry to that heading must use.\n *\n * Same rule as GitHub and `rehype-slug` (`github-slugger`): lowercase,\n * punctuation removed, each space replaced by `-`. Non-Latin letters and\n * digits are kept, e.g. `\"监听 127.0.0.1(推荐)\"` → `\"监听-127001推荐\"`.\n *\n * Use {@link HeadingSlugger} when slugging every heading on a page, so that\n * repeated headings get unique ids (`foo`, `foo-1`, …).\n */\nexport function slugHeading(text: string): string {\n return githubSlug(text);\n}\n\n/**\n * Slugs the headings of one page in document order with {@link slugHeading},\n * numbering repeats the way GitHub and `rehype-slug` do (`foo`, `foo-1`,\n * `foo-2`). Create one per page, or call `reset()` between pages.\n */\nexport class HeadingSlugger {\n private readonly slugger = new GithubSlugger();\n\n /** Slug `text`, unique among the slugs this instance has returned. */\n slug(text: string): string {\n return this.slugger.slug(text);\n }\n\n reset(): void {\n this.slugger.reset();\n }\n}\n\n/**\n * The anchor Obsidian writes when it links to a heading with this text.\n *\n * Obsidian anchors cannot hold `:`, `|`, `^`, `#` or `\\`, so Obsidian replaces\n * each with a space and collapses the spaces: `\"Colon:unspaced\"` →\n * `\"Colon unspaced\"`. Slugging this with {@link slugHeading} gives the anchor\n * a link written in Obsidian resolves to; when it differs from the heading's\n * `id`, heading producers can add it as an alias id.\n */\nexport function obsidianHeadingAnchor(text: string): string {\n return text\n .replace(/[:|^#\\\\]/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim();\n}\n\n/**\n * Point a same-page anchor link (`href` starting with `#`, as written) at an\n * `id` on the page. `ids` holds every `id` on the page.\n *\n * - An anchor that already names an id (as written or percent-decoded) is\n * returned unchanged.\n * - `#^name` (an Obsidian block reference) points at the id `name`.\n * - Otherwise, when the anchor is a heading's text, it points at the\n * heading's id: the anchor slugged with {@link slugHeading}, e.g.\n * `#监听 127.0.0.1(推荐)` → `#监听-127001推荐`.\n * - An anchor that names no id either way is returned unchanged, so a link to\n * an id added later (raw HTML, another plugin) keeps working.\n */\nexport function resolveAnchorHref(href: string, ids: ReadonlySet<string>): string {\n if (!href.startsWith(\"#\") || href.length === 1) return href;\n const raw = href.slice(1);\n let decoded = raw;\n try {\n decoded = decodeURIComponent(raw);\n } catch {\n // keep the anchor as written\n }\n if (ids.has(raw) || ids.has(decoded)) return href;\n const bare = decoded.startsWith(\"^\") ? decoded.slice(1) : decoded;\n if (ids.has(bare)) return \"#\" + bare;\n const slugged = slugHeading(bare);\n return ids.has(slugged) ? \"#\" + slugged : href;\n}\n\nexport function splitAnchor(link: string): [string, string] {\n const [fp, anchor] = link.split(\"#\", 2);\n if (fp!.endsWith(\".pdf\")) {\n return [fp!, anchor === undefined ? \"\" : `#${anchor}`];\n }\n if (anchor === undefined) {\n return [fp!, \"\"];\n }\n const bare = anchor.startsWith(\"^\") ? anchor.slice(1) : anchor;\n const slugged = \"#\" + slugHeading(bare);\n return [fp!, slugged];\n}\n\nexport function slugTag(tag: string): string {\n return tag\n .split(\"/\")\n .map((tagSegment) => _sluggify(tagSegment))\n .join(\"/\");\n}\n\n/** `decodeURI`, or the input unchanged when it is not valid percent-encoding (`%zz`, `a%E2.md`). */\nfunction _safeDecodeURI(s: string): string {\n try {\n return decodeURI(s);\n } catch {\n return s;\n }\n}\n\n/**\n * Whether a link's path (before any `#`) percent-decodes. Obsidian treats a Markdown link whose\n * path does not (`[x](%zz)`, `[x](a%E2.md)`) as external.\n */\nexport function linkPathDecodes(link: string): boolean {\n const hash = link.indexOf(\"#\");\n try {\n decodeURI(hash === -1 ? link : link.slice(0, hash));\n return true;\n } catch {\n return false;\n }\n}\n\nexport function transformInternalLink(link: string): RelativeURL {\n const [fplike, anchor] = splitAnchor(_safeDecodeURI(link));\n\n const segments = fplike.split(\"/\").filter((x) => x.length > 0);\n const prefix = segments.filter(_isRelativeSegment).join(\"/\");\n const fp = segments.filter((seg) => !_isRelativeSegment(seg) && seg !== \"\").join(\"/\");\n\n const slugged = slugifyFilePath(fp as FilePath);\n const simpleSlug = simplifySlug(slugged);\n const folderPath = isFolderPath(fplike) || isFolderPath(slugged);\n const joined = joinSegments(stripSlashes(prefix), stripSlashes(simpleSlug));\n const trail = folderPath ? \"/\" : \"\";\n const res = (_addRelativeToStart(joined) + trail + anchor) as RelativeURL;\n return res;\n}\n\nexport function transformLink(src: FullSlug, target: string, opts: TransformOptions): RelativeURL {\n const targetSlug = transformInternalLink(target);\n\n if (opts.strategy === \"relative\") {\n return _resolveRelativeFolderNote(src, target) ?? (targetSlug as RelativeURL);\n } else {\n // When src is a folder page (e.g. \"Compendium/Spells\" backed by index.md),\n // the browser serves it at \"/Compendium/Spells/\" with a trailing slash.\n // pathToRoot needs the \"/index\" suffix to compute the correct depth.\n const effectiveSrc =\n !endsWith(src, \"index\") && opts.allSlugs.includes(`${src}/index` as FullSlug)\n ? (`${src}/index` as FullSlug)\n : src;\n\n const folderTail = isFolderPath(targetSlug) ? \"/\" : \"\";\n const canonicalSlug = stripSlashes(targetSlug.slice(\".\".length));\n const [targetCanonical, targetAnchor] = splitAnchor(canonicalSlug);\n\n if (opts.strategy === \"shortest\") {\n const isMultiSegment = targetCanonical.includes(\"/\");\n const isFolderTarget = isFolderPath(targetSlug);\n let matchingFileNames = opts.allSlugs.filter((slug) => {\n if (isMultiSegment) {\n // Multi-segment partial path: match by suffix\n if (slug === targetCanonical || slug.endsWith(\"/\" + targetCanonical)) {\n return true;\n }\n // Folder targets have \"/index\" stripped — also match the \"/index\" variant\n if (isFolderTarget) {\n const withIndex = targetCanonical + \"/index\";\n return slug === withIndex || slug.endsWith(\"/\" + withIndex);\n }\n return false;\n }\n const parts = slug.split(\"/\");\n const fileName = parts.at(-1);\n return targetCanonical === fileName;\n });\n\n // Folder note Foo/Foo.md slugs to Foo/index, so its last segment never matches [[Foo]]\n // Retry by folder name, only when no real file claims it\n if (matchingFileNames.length === 0 && !isMultiSegment) {\n matchingFileNames = opts.allSlugs.filter((slug) => {\n const parts = slug.split(\"/\");\n return parts.at(-1) === \"index\" && parts.at(-2) === targetCanonical;\n });\n }\n\n if (matchingFileNames.length === 1) {\n const matchedSlug = matchingFileNames[0]!;\n return (resolveRelative(effectiveSrc, matchedSlug) + targetAnchor) as RelativeURL;\n }\n }\n\n return (joinSegments(pathToRoot(effectiveSrc), canonicalSlug) + folderTail) as RelativeURL;\n }\n}\n\n/**\n * A relative link can name a folder note (`topic/Topic.md`, slugged\n * `topic/index`) without spelling out its folder, e.g. `./Topic.md` written\n * inside `topic/`. `slugifyFilePath` only sees the segments the link spells\n * out, so apply the folder-note rule to the target as resolved against the\n * source's folder, and return the link with its file name replaced by\n * `index`. Returns `undefined` when the target is not such a folder note.\n * @internal\n */\nfunction _resolveRelativeFolderNote(src: FullSlug, target: string): RelativeURL | undefined {\n let decoded: string;\n try {\n decoded = decodeURI(target);\n } catch {\n return undefined;\n }\n const hashIdx = decoded.indexOf(\"#\");\n const fplike = hashIdx === -1 ? decoded : decoded.slice(0, hashIdx);\n const rest = hashIdx === -1 ? \"\" : decoded.slice(hashIdx);\n if (fplike === \"\" || fplike.endsWith(\"/\") || fplike.startsWith(\"/\")) return undefined;\n\n const ext = getFileExtension(fplike);\n if (![\".md\", \".html\", undefined].includes(ext)) return undefined;\n\n const segments = fplike.split(\"/\");\n const fileName = segments[segments.length - 1]!;\n const fileSlug = slugifyPath(ext ? fileName.slice(0, -ext.length) : fileName);\n if (fileSlug === \"index\") return undefined;\n\n // Resolve the link's folder against the source's folder (both as slugs)\n const resolved = src.split(\"/\").slice(0, -1);\n for (const seg of segments.slice(0, -1)) {\n if (seg === \"\" || seg === \".\") continue;\n if (seg === \"..\") {\n if (resolved.length === 0) return undefined;\n resolved.pop();\n } else {\n resolved.push(slugifyPath(seg));\n }\n }\n\n if (resolved.length === 0 || resolved[resolved.length - 1] !== fileSlug) return undefined;\n\n segments[segments.length - 1] = \"index\" + (ext ?? \"\");\n return transformInternalLink(encodeURI(segments.join(\"/\") + rest));\n}\n\nexport interface SlugOptions {\n /**\n * Strip accents and other diacritics from slugs (`české/čeština` → `ceske/cestina`).\n * Quartz sets this from `configuration.slugs.stripDiacritics`. Default `false`.\n */\n stripDiacritics?: boolean;\n}\n\n// Kept on globalThis under a registered symbol, so every copy of this package loaded in the same\n// thread (Quartz core and each plugin may resolve their own) sees the same setting.\nconst SLUG_OPTIONS = Symbol.for(\"@quartz-community/utils/slugOptions\");\ntype SlugOptionsHost = { [SLUG_OPTIONS]?: SlugOptions };\n\n/**\n * Set how paths and tags become slugs, for this thread (Quartz calls it when the config is\n * loaded, in the main thread and in every worker). `undefined` restores the defaults.\n */\nexport function setSlugOptions(options: SlugOptions | undefined): void {\n (globalThis as SlugOptionsHost)[SLUG_OPTIONS] = { ...(options ?? {}) };\n}\n\nexport function getSlugOptions(): Readonly<SlugOptions> {\n return (globalThis as SlugOptionsHost)[SLUG_OPTIONS] ?? {};\n}\n\n/**\n * Remove combining diacritical marks (U+0300–U+036F) after canonical decomposition, then\n * recompose: `Čeština` → `Cestina`. Scripts whose marks lie outside that block (Hangul, kana\n * with dakuten, Devanagari, Arabic) keep their usual form; letters without a decomposition\n * (`ø`, `ł`, `ß`, `æ`) are kept.\n */\nexport function stripDiacritics(s: string): string {\n return s\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\")\n .normalize(\"NFC\");\n}\n\n/**\n * Slugify a file path for use as an href.\n * Replaces whitespace→hyphens, &→-and-, %→-percent, removes ? and #, and\n * lowercases the result so that link matching is case-insensitive (matching\n * Obsidian's link-resolution semantics). Operates per segment so directory\n * separators are preserved. With `setSlugOptions({ stripDiacritics: true })` diacritics are\n * stripped as well (this also applies to `slugifyFilePath`, `slugTag` and link resolution).\n */\nexport function slugifyPath(s: string): string {\n // NFC, as Obsidian resolves paths: `cafe\\u0301.md` (NFD, as macOS spells it) and `café.md` are\n // the same note, so a file and a link spelled either way get the same slug\n const normalized = s.normalize(\"NFC\");\n return (getSlugOptions().stripDiacritics ? stripDiacritics(normalized) : normalized)\n .split(\"/\")\n .map((segment) =>\n segment\n .replace(/\\s/g, \"-\")\n .replace(/&/g, \"-and-\")\n .replace(/%/g, \"-percent\")\n .replace(/\\?/g, \"\")\n .replace(/#/g, \"\")\n .replace(/[<>:\"|*]/g, \"\")\n .toLowerCase(),\n )\n .join(\"/\")\n .replace(/\\/$/, \"\");\n}\n\n/**\n * Re-base the relative `href` and `src` attributes of a HAST element so that\n * links inside content originally resolved relative to `newBase` remain valid\n * when the element is embedded at a page with slug `curBase`.\n *\n * Used for transclusions and cross-slug HAST embedding (Quartz core's\n * `renderPage` transclude expansion, canvas-page's embedded file-nodes, and\n * any plugin that takes `vfile.data.htmlAst` from one page and renders it\n * inside another). Absolute URLs pass through unchanged.\n *\n * The element (and its children) are deep-cloned via `structuredClone`, so\n * the original HAST tree is never mutated.\n */\nexport function normalizeHastElement<T extends HastElement>(\n rawEl: T,\n curBase: FullSlug,\n newBase: FullSlug,\n): T {\n const el = structuredClone(rawEl);\n _rebaseHastElement(el, \"src\", curBase, newBase);\n _rebaseHastElement(el, \"href\", curBase, newBase);\n if (el.children) {\n el.children = el.children.map((child) =>\n child.type === \"element\"\n ? (normalizeHastElement(child as HastElement, curBase, newBase) as typeof child)\n : child,\n );\n }\n return el;\n}\n\n/** @internal */\nfunction _rebaseHastElement(\n el: HastElement,\n attr: \"href\" | \"src\",\n curBase: FullSlug,\n newBase: FullSlug,\n): void {\n const value = el.properties?.[attr];\n if (value === undefined || value === null) return;\n const href = String(value);\n if (!isRelativeURL(href)) return;\n // `href` is relative to the embedded page's directory. Take that directory\n // from the raw slug: `resolveRelative` simplifies its target, which strips a\n // trailing `index`, so for a folder note (`folder/index`) an extra `..`\n // would remove a real path segment.\n const targetDir = newBase.split(\"/\").slice(0, -1).join(\"/\");\n el.properties![attr] = joinSegments(pathToRoot(curBase), targetDir, href);\n}\n\n/** @internal */\nfunction _sluggify(s: string): string {\n return slugifyPath(s);\n}\n\nfunction _containsForbiddenCharacters(s: string): boolean {\n return s.includes(\" \") || s.includes(\"#\") || s.includes(\"?\") || s.includes(\"&\");\n}\n\nfunction _hasFileExtension(s: string): boolean {\n return getFileExtension(s) !== undefined;\n}\n\nfunction _isRelativeSegment(s: string): boolean {\n return /^\\.{0,2}$/.test(s);\n}\n\nfunction _addRelativeToStart(s: string): string {\n if (s === \"\") {\n s = \".\";\n }\n\n if (!s.startsWith(\".\")) {\n s = joinSegments(\".\", s);\n }\n\n return s;\n}\n","// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nexport default function (style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n var errorsList = [];\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) {\n errorsList.push(err);\n } else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }\n\n /**\n * Parse declarations.\n *\n * @return {Object[]}\n */\n function declarations() {\n var decls = [];\n\n comments(decls);\n\n // declarations\n var decl;\n while ((decl = declaration())) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n }\n\n return decls;\n }\n\n whitespace();\n return declarations();\n}\n\n/**\n * Trim `str`.\n *\n * @param {String} str\n * @return {String}\n */\nfunction trim(str) {\n return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;\n}\n","import type { Declaration } from 'inline-style-parser';\nimport parse from 'inline-style-parser';\n\nexport { Declaration };\n\nexport interface StyleObject {\n [name: string]: string;\n}\n\ntype Iterator = (\n property: string,\n value: string,\n declaration: Declaration,\n) => void;\n\n/**\n * Parses inline style to object.\n *\n * @param style - Inline style.\n * @param iterator - Iterator.\n * @returns - Style object or null.\n *\n * @example Parsing inline style to object:\n *\n * ```js\n * import parse from 'style-to-object';\n * parse('line-height: 42;'); // { 'line-height': '42' }\n * ```\n */\nexport default function StyleToObject(\n style: string,\n iterator?: Iterator,\n): StyleObject | null {\n let styleObject: StyleObject | null = null;\n\n if (!style || typeof style !== 'string') {\n return styleObject;\n }\n\n const declarations = parse(style);\n const hasIterator = typeof iterator === 'function';\n\n declarations.forEach((declaration) => {\n if (declaration.type !== 'declaration') {\n return;\n }\n\n const { property, value } = declaration;\n\n if (hasIterator) {\n iterator(property, value, declaration);\n } else if (value) {\n styleObject = styleObject || {};\n styleObject[property] = value;\n }\n });\n\n return styleObject;\n}\n","const CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/;\nconst HYPHEN_REGEX = /-([a-z])/g;\nconst NO_HYPHEN_REGEX = /^[^-]+$/;\nconst VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;\nconst MS_VENDOR_PREFIX_REGEX = /^-(ms)-/;\n\n/**\n * Checks whether to skip camelCase.\n */\nconst skipCamelCase = (property: string) =>\n !property ||\n NO_HYPHEN_REGEX.test(property) ||\n CUSTOM_PROPERTY_REGEX.test(property);\n\n/**\n * Replacer that capitalizes first character.\n */\nconst capitalize = (match: string, character: string) =>\n character.toUpperCase();\n\n/**\n * Replacer that removes beginning hyphen of vendor prefix property.\n */\nconst trimHyphen = (match: string, prefix: string) => `${prefix}-`;\n\n/**\n * CamelCase options.\n */\nexport interface CamelCaseOptions {\n reactCompat?: boolean;\n}\n\n/**\n * CamelCases a CSS property.\n */\nexport const camelCase = (property: string, options: CamelCaseOptions = {}) => {\n if (skipCamelCase(property)) {\n return property;\n }\n\n property = property.toLowerCase();\n\n if (options.reactCompat) {\n // `-ms` vendor prefix should not be capitalized\n property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen);\n } else {\n // for non-React, remove first hyphen so vendor prefix is not capitalized\n property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);\n }\n\n return property.replace(HYPHEN_REGEX, capitalize);\n};\n","import StyleToObject from 'style-to-object';\n\nimport { camelCase, CamelCaseOptions } from './utilities';\n\ntype StyleObject = Record<string, string>;\n\ninterface StyleToJSOptions extends CamelCaseOptions {}\n\n/**\n * Parses CSS inline style to JavaScript object (camelCased).\n */\nfunction StyleToJS(style: string, options?: StyleToJSOptions): StyleObject {\n const output: StyleObject = {};\n\n if (!style || typeof style !== 'string') {\n return output;\n }\n\n StyleToObject(style, (property, value) => {\n // skip CSS comment\n if (property && value) {\n output[camelCase(property, options)] = value;\n }\n });\n\n return output;\n}\n\nStyleToJS.default = StyleToJS;\n\nexport = StyleToJS;\n","/**\n * @import {Schema as SchemaType, Space} from 'property-information'\n */\n\n/** @type {SchemaType} */\nexport class Schema {\n /**\n * @param {SchemaType['property']} property\n * Property.\n * @param {SchemaType['normal']} normal\n * Normal.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Schema.\n */\n constructor(property, normal, space) {\n this.normal = normal\n this.property = property\n\n if (space) {\n this.space = space\n }\n }\n}\n\nSchema.prototype.normal = {}\nSchema.prototype.property = {}\nSchema.prototype.space = undefined\n","/**\n * @import {Info, Space} from 'property-information'\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {ReadonlyArray<Schema>} definitions\n * Definitions.\n * @param {Space | undefined} [space]\n * Space.\n * @returns {Schema}\n * Schema.\n */\nexport function merge(definitions, space) {\n /** @type {Record<string, Info>} */\n const property = {}\n /** @type {Record<string, string>} */\n const normal = {}\n\n for (const definition of definitions) {\n Object.assign(property, definition.property)\n Object.assign(normal, definition.normal)\n }\n\n return new Schema(property, normal, space)\n}\n","/**\n * Get the cleaned case insensitive form of an attribute or property.\n *\n * @param {string} value\n * An attribute-like or property-like name.\n * @returns {string}\n * Value that can be used to look up the properly cased property on a\n * `Schema`.\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n","/**\n * @import {Info as InfoType} from 'property-information'\n */\n\n/** @type {InfoType} */\nexport class Info {\n /**\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @returns\n * Info.\n */\n constructor(property, attribute) {\n this.attribute = attribute\n this.property = property\n }\n}\n\nInfo.prototype.attribute = ''\nInfo.prototype.booleanish = false\nInfo.prototype.boolean = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.defined = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.number = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.property = ''\nInfo.prototype.spaceSeparated = false\nInfo.prototype.space = undefined\n","let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n","/**\n * @import {Space} from 'property-information'\n */\n\nimport {Info} from './info.js'\nimport * as types from './types.js'\n\nconst checks = /** @type {ReadonlyArray<keyof typeof types>} */ (\n Object.keys(types)\n)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @param {number | null | undefined} [mask]\n * Mask.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Info.\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @template {keyof DefinedInfo} Key\n * Key type.\n * @param {DefinedInfo} values\n * Info.\n * @param {Key} key\n * Key.\n * @param {DefinedInfo[Key]} value\n * Value.\n * @returns {undefined}\n * Nothing.\n */\nfunction mark(values, key, value) {\n if (value) {\n values[key] = value\n }\n}\n","/**\n * @import {Info, Space} from 'property-information'\n */\n\n/**\n * @typedef Definition\n * Definition of a schema.\n * @property {Record<string, string> | undefined} [attributes]\n * Normalzed names to special attribute case.\n * @property {ReadonlyArray<string> | undefined} [mustUseProperty]\n * Normalized names that must be set as properties.\n * @property {Record<string, number | null>} properties\n * Property names to their types.\n * @property {Space | undefined} [space]\n * Space.\n * @property {Transform} transform\n * Transform a property name.\n */\n\n/**\n * @callback Transform\n * Transform.\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Attribute.\n */\n\nimport {normalize} from '../normalize.js'\nimport {DefinedInfo} from './defined-info.js'\nimport {Schema} from './schema.js'\n\n/**\n * @param {Definition} definition\n * Definition.\n * @returns {Schema}\n * Schema.\n */\nexport function create(definition) {\n /** @type {Record<string, Info>} */\n const properties = {}\n /** @type {Record<string, string>} */\n const normals = {}\n\n for (const [property, value] of Object.entries(definition.properties)) {\n const info = new DefinedInfo(\n property,\n definition.transform(definition.attributes || {}, property),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(property)\n ) {\n info.mustUseProperty = true\n }\n\n properties[property] = info\n\n normals[normalize(property)] = property\n normals[normalize(info.attribute)] = property\n }\n\n return new Schema(properties, normals, definition.space)\n}\n","import {create} from './util/create.js'\nimport {booleanish, number, spaceSeparated} from './util/types.js'\n\nexport const aria = create({\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n },\n transform(_, property) {\n return property === 'role'\n ? property\n : 'aria-' + property.slice(4).toLowerCase()\n }\n})\n","/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} attribute\n * Attribute.\n * @returns {string}\n * Transformed attribute.\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Transformed property.\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","import {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n booleanish,\n boolean,\n commaSeparated,\n number,\n overloadedBoolean,\n spaceSeparated\n} from './util/types.js'\n\nexport const html = create({\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alpha: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n blocking: spaceSeparated,\n capture: null,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n closedBy: null,\n colorSpace: null,\n cols: number,\n colSpan: number,\n command: null,\n commandFor: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n fetchPriority: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: overloadedBoolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inert: boolean,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforeMatch: null,\n onBeforePrint: null,\n onBeforeToggle: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onScrollEnd: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n popover: null,\n popoverTarget: null,\n popoverTargetAction: null,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shadowRootClonable: boolean,\n shadowRootCustomElementRegistry: boolean,\n shadowRootDelegatesFocus: boolean,\n shadowRootMode: null,\n shadowRootSerializable: boolean,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n writingSuggestions: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // `<body>`. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // `<object>`. List of URIs to archives\n axis: null, // `<td>` and `<th>`. Use `scope` on `<th>`\n background: null, // `<body>`. Use CSS `background-image` instead\n bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead\n border: number, // `<table>`. Use CSS `border-width` instead,\n borderColor: null, // `<table>`. Use CSS `border-color` instead,\n bottomMargin: number, // `<body>`\n cellPadding: null, // `<table>`\n cellSpacing: null, // `<table>`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // `<object>`\n clear: null, // `<br>`. Use CSS `clear` instead\n code: null, // `<object>`\n codeBase: null, // `<object>`\n codeType: null, // `<object>`\n color: null, // `<font>` and `<hr>`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // `<object>`\n event: null, // `<script>`\n face: null, // `<font>`. Use CSS instead\n frame: null, // `<table>`\n frameBorder: null, // `<iframe>`. Use CSS `border` instead\n hSpace: number, // `<img>` and `<object>`\n leftMargin: number, // `<body>`\n link: null, // `<body>`. Use CSS `a:link {color: *}` instead\n longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`\n lowSrc: null, // `<img>`. Use a `<picture>`\n marginHeight: number, // `<body>`\n marginWidth: number, // `<body>`\n noResize: boolean, // `<frame>`\n noHref: boolean, // `<area>`. Use no href instead of an explicit `nohref`\n noShade: boolean, // `<hr>`. Use background-color and height instead of borders\n noWrap: boolean, // `<td>` and `<th>`\n object: null, // `<applet>`\n profile: null, // `<head>`\n prompt: null, // `<isindex>`\n rev: null, // `<link>`\n rightMargin: number, // `<body>`\n rules: null, // `<table>`\n scheme: null, // `<meta>`\n scrolling: booleanish, // `<frame>`. Use overflow in the child context\n standby: null, // `<object>`\n summary: null, // `<table>`\n text: null, // `<body>`. Use CSS `color` instead\n topMargin: number, // `<body>`\n valueType: null, // `<param>`\n version: null, // `<html>`. Use a doctype.\n vAlign: null, // Several. Use CSS `vertical-align` instead\n vLink: null, // `<body>`. Use CSS `a:visited {color}` instead\n vSpace: number, // `<img>` and `<object>`\n\n // Non-standard Properties.\n allowTransparency: null,\n autoCorrect: null,\n autoSave: null,\n credentialless: boolean,\n disablePictureInPicture: boolean,\n disableRemotePlayback: boolean,\n exportParts: commaSeparated,\n part: spaceSeparated,\n prefix: null,\n property: null,\n results: number,\n security: null,\n unselectable: null\n },\n space: 'html',\n transform: caseInsensitiveTransform\n})\n","import {caseSensitiveTransform} from './util/case-sensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n boolean,\n commaOrSpaceSeparated,\n commaSeparated,\n number,\n spaceSeparated\n} from './util/types.js'\n\nexport const svg = create({\n attributes: {\n accentHeight: 'accent-height',\n alignmentBaseline: 'alignment-baseline',\n arabicForm: 'arabic-form',\n baselineShift: 'baseline-shift',\n capHeight: 'cap-height',\n className: 'class',\n clipPath: 'clip-path',\n clipRule: 'clip-rule',\n colorInterpolation: 'color-interpolation',\n colorInterpolationFilters: 'color-interpolation-filters',\n colorProfile: 'color-profile',\n colorRendering: 'color-rendering',\n crossOrigin: 'crossorigin',\n dataType: 'datatype',\n dominantBaseline: 'dominant-baseline',\n enableBackground: 'enable-background',\n fillOpacity: 'fill-opacity',\n fillRule: 'fill-rule',\n floodColor: 'flood-color',\n floodOpacity: 'flood-opacity',\n fontFamily: 'font-family',\n fontSize: 'font-size',\n fontSizeAdjust: 'font-size-adjust',\n fontStretch: 'font-stretch',\n fontStyle: 'font-style',\n fontVariant: 'font-variant',\n fontWeight: 'font-weight',\n glyphName: 'glyph-name',\n glyphOrientationHorizontal: 'glyph-orientation-horizontal',\n glyphOrientationVertical: 'glyph-orientation-vertical',\n hrefLang: 'hreflang',\n horizAdvX: 'horiz-adv-x',\n horizOriginX: 'horiz-origin-x',\n horizOriginY: 'horiz-origin-y',\n imageRendering: 'image-rendering',\n letterSpacing: 'letter-spacing',\n lightingColor: 'lighting-color',\n markerEnd: 'marker-end',\n markerMid: 'marker-mid',\n markerStart: 'marker-start',\n maskType: 'mask-type',\n navDown: 'nav-down',\n navDownLeft: 'nav-down-left',\n navDownRight: 'nav-down-right',\n navLeft: 'nav-left',\n navNext: 'nav-next',\n navPrev: 'nav-prev',\n navRight: 'nav-right',\n navUp: 'nav-up',\n navUpLeft: 'nav-up-left',\n navUpRight: 'nav-up-right',\n onAbort: 'onabort',\n onActivate: 'onactivate',\n onAfterPrint: 'onafterprint',\n onBeforePrint: 'onbeforeprint',\n onBegin: 'onbegin',\n onCancel: 'oncancel',\n onCanPlay: 'oncanplay',\n onCanPlayThrough: 'oncanplaythrough',\n onChange: 'onchange',\n onClick: 'onclick',\n onClose: 'onclose',\n onCopy: 'oncopy',\n onCueChange: 'oncuechange',\n onCut: 'oncut',\n onDblClick: 'ondblclick',\n onDrag: 'ondrag',\n onDragEnd: 'ondragend',\n onDragEnter: 'ondragenter',\n onDragExit: 'ondragexit',\n onDragLeave: 'ondragleave',\n onDragOver: 'ondragover',\n onDragStart: 'ondragstart',\n onDrop: 'ondrop',\n onDurationChange: 'ondurationchange',\n onEmptied: 'onemptied',\n onEnd: 'onend',\n onEnded: 'onended',\n onError: 'onerror',\n onFocus: 'onfocus',\n onFocusIn: 'onfocusin',\n onFocusOut: 'onfocusout',\n onHashChange: 'onhashchange',\n onInput: 'oninput',\n onInvalid: 'oninvalid',\n onKeyDown: 'onkeydown',\n onKeyPress: 'onkeypress',\n onKeyUp: 'onkeyup',\n onLoad: 'onload',\n onLoadedData: 'onloadeddata',\n onLoadedMetadata: 'onloadedmetadata',\n onLoadStart: 'onloadstart',\n onMessage: 'onmessage',\n onMouseDown: 'onmousedown',\n onMouseEnter: 'onmouseenter',\n onMouseLeave: 'onmouseleave',\n onMouseMove: 'onmousemove',\n onMouseOut: 'onmouseout',\n onMouseOver: 'onmouseover',\n onMouseUp: 'onmouseup',\n onMouseWheel: 'onmousewheel',\n onOffline: 'onoffline',\n onOnline: 'ononline',\n onPageHide: 'onpagehide',\n onPageShow: 'onpageshow',\n onPaste: 'onpaste',\n onPause: 'onpause',\n onPlay: 'onplay',\n onPlaying: 'onplaying',\n onPopState: 'onpopstate',\n onProgress: 'onprogress',\n onRateChange: 'onratechange',\n onRepeat: 'onrepeat',\n onReset: 'onreset',\n onResize: 'onresize',\n onScroll: 'onscroll',\n onSeeked: 'onseeked',\n onSeeking: 'onseeking',\n onSelect: 'onselect',\n onShow: 'onshow',\n onStalled: 'onstalled',\n onStorage: 'onstorage',\n onSubmit: 'onsubmit',\n onSuspend: 'onsuspend',\n onTimeUpdate: 'ontimeupdate',\n onToggle: 'ontoggle',\n onUnload: 'onunload',\n onVolumeChange: 'onvolumechange',\n onWaiting: 'onwaiting',\n onZoom: 'onzoom',\n overlinePosition: 'overline-position',\n overlineThickness: 'overline-thickness',\n paintOrder: 'paint-order',\n panose1: 'panose-1',\n pointerEvents: 'pointer-events',\n referrerPolicy: 'referrerpolicy',\n renderingIntent: 'rendering-intent',\n shapeRendering: 'shape-rendering',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\n strikethroughPosition: 'strikethrough-position',\n strikethroughThickness: 'strikethrough-thickness',\n strokeDashArray: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeLineCap: 'stroke-linecap',\n strokeLineJoin: 'stroke-linejoin',\n strokeMiterLimit: 'stroke-miterlimit',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n tabIndex: 'tabindex',\n textAnchor: 'text-anchor',\n textDecoration: 'text-decoration',\n textRendering: 'text-rendering',\n transformOrigin: 'transform-origin',\n typeOf: 'typeof',\n underlinePosition: 'underline-position',\n underlineThickness: 'underline-thickness',\n unicodeBidi: 'unicode-bidi',\n unicodeRange: 'unicode-range',\n unitsPerEm: 'units-per-em',\n vAlphabetic: 'v-alphabetic',\n vHanging: 'v-hanging',\n vIdeographic: 'v-ideographic',\n vMathematical: 'v-mathematical',\n vectorEffect: 'vector-effect',\n vertAdvY: 'vert-adv-y',\n vertOriginX: 'vert-origin-x',\n vertOriginY: 'vert-origin-y',\n wordSpacing: 'word-spacing',\n writingMode: 'writing-mode',\n xHeight: 'x-height',\n // These were camelcased in Tiny. Now lowercased in SVG 2\n playbackOrder: 'playbackorder',\n timelineBegin: 'timelinebegin'\n },\n properties: {\n about: commaOrSpaceSeparated,\n accentHeight: number,\n accumulate: null,\n additive: null,\n alignmentBaseline: null,\n alphabetic: number,\n amplitude: number,\n arabicForm: null,\n ascent: number,\n attributeName: null,\n attributeType: null,\n azimuth: number,\n bandwidth: null,\n baselineShift: null,\n baseFrequency: null,\n baseProfile: null,\n bbox: null,\n begin: null,\n bias: number,\n by: null,\n calcMode: null,\n capHeight: number,\n className: spaceSeparated,\n clip: null,\n clipPath: null,\n clipPathUnits: null,\n clipRule: null,\n color: null,\n colorInterpolation: null,\n colorInterpolationFilters: null,\n colorProfile: null,\n colorRendering: null,\n content: null,\n contentScriptType: null,\n contentStyleType: null,\n crossOrigin: null,\n cursor: null,\n cx: null,\n cy: null,\n d: null,\n dataType: null,\n defaultAction: null,\n descent: number,\n diffuseConstant: number,\n direction: null,\n display: null,\n dur: null,\n divisor: number,\n dominantBaseline: null,\n download: boolean,\n dx: null,\n dy: null,\n edgeMode: null,\n editable: null,\n elevation: number,\n enableBackground: null,\n end: null,\n event: null,\n exponent: number,\n externalResourcesRequired: null,\n fill: null,\n fillOpacity: number,\n fillRule: null,\n filter: null,\n filterRes: null,\n filterUnits: null,\n floodColor: null,\n floodOpacity: null,\n focusable: null,\n focusHighlight: null,\n fontFamily: null,\n fontSize: null,\n fontSizeAdjust: null,\n fontStretch: null,\n fontStyle: null,\n fontVariant: null,\n fontWeight: null,\n format: null,\n fr: null,\n from: null,\n fx: null,\n fy: null,\n g1: commaSeparated,\n g2: commaSeparated,\n glyphName: commaSeparated,\n glyphOrientationHorizontal: null,\n glyphOrientationVertical: null,\n glyphRef: null,\n gradientTransform: null,\n gradientUnits: null,\n handler: null,\n hanging: number,\n hatchContentUnits: null,\n hatchUnits: null,\n height: null,\n href: null,\n hrefLang: null,\n horizAdvX: number,\n horizOriginX: number,\n horizOriginY: number,\n id: null,\n ideographic: number,\n imageRendering: null,\n initialVisibility: null,\n in: null,\n in2: null,\n intercept: number,\n k: number,\n k1: number,\n k2: number,\n k3: number,\n k4: number,\n kernelMatrix: commaOrSpaceSeparated,\n kernelUnitLength: null,\n keyPoints: null, // SEMI_COLON_SEPARATED\n keySplines: null, // SEMI_COLON_SEPARATED\n keyTimes: null, // SEMI_COLON_SEPARATED\n kerning: null,\n lang: null,\n lengthAdjust: null,\n letterSpacing: null,\n lightingColor: null,\n limitingConeAngle: number,\n local: null,\n markerEnd: null,\n markerMid: null,\n markerStart: null,\n markerHeight: null,\n markerUnits: null,\n markerWidth: null,\n mask: null,\n maskContentUnits: null,\n maskType: null,\n maskUnits: null,\n mathematical: null,\n max: null,\n media: null,\n mediaCharacterEncoding: null,\n mediaContentEncodings: null,\n mediaSize: number,\n mediaTime: null,\n method: null,\n min: null,\n mode: null,\n name: null,\n navDown: null,\n navDownLeft: null,\n navDownRight: null,\n navLeft: null,\n navNext: null,\n navPrev: null,\n navRight: null,\n navUp: null,\n navUpLeft: null,\n navUpRight: null,\n numOctaves: null,\n observer: null,\n offset: null,\n onAbort: null,\n onActivate: null,\n onAfterPrint: null,\n onBeforePrint: null,\n onBegin: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnd: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFocusIn: null,\n onFocusOut: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadStart: null,\n onMessage: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onMouseWheel: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRepeat: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onShow: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onZoom: null,\n opacity: null,\n operator: null,\n order: null,\n orient: null,\n orientation: null,\n origin: null,\n overflow: null,\n overlay: null,\n overlinePosition: number,\n overlineThickness: number,\n paintOrder: null,\n panose1: null,\n path: null,\n pathLength: number,\n patternContentUnits: null,\n patternTransform: null,\n patternUnits: null,\n phase: null,\n ping: spaceSeparated,\n pitch: null,\n playbackOrder: null,\n pointerEvents: null,\n points: null,\n pointsAtX: number,\n pointsAtY: number,\n pointsAtZ: number,\n preserveAlpha: null,\n preserveAspectRatio: null,\n primitiveUnits: null,\n propagate: null,\n property: commaOrSpaceSeparated,\n r: null,\n radius: null,\n referrerPolicy: null,\n refX: null,\n refY: null,\n rel: commaOrSpaceSeparated,\n rev: commaOrSpaceSeparated,\n renderingIntent: null,\n repeatCount: null,\n repeatDur: null,\n requiredExtensions: commaOrSpaceSeparated,\n requiredFeatures: commaOrSpaceSeparated,\n requiredFonts: commaOrSpaceSeparated,\n requiredFormats: commaOrSpaceSeparated,\n resource: null,\n restart: null,\n result: null,\n rotate: null,\n rx: null,\n ry: null,\n scale: null,\n seed: null,\n shapeRendering: null,\n side: null,\n slope: null,\n snapshotTime: null,\n specularConstant: number,\n specularExponent: number,\n spreadMethod: null,\n spacing: null,\n startOffset: null,\n stdDeviation: null,\n stemh: null,\n stemv: null,\n stitchTiles: null,\n stopColor: null,\n stopOpacity: null,\n strikethroughPosition: number,\n strikethroughThickness: number,\n string: null,\n stroke: null,\n strokeDashArray: commaOrSpaceSeparated,\n strokeDashOffset: null,\n strokeLineCap: null,\n strokeLineJoin: null,\n strokeMiterLimit: number,\n strokeOpacity: number,\n strokeWidth: null,\n style: null,\n surfaceScale: number,\n syncBehavior: null,\n syncBehaviorDefault: null,\n syncMaster: null,\n syncTolerance: null,\n syncToleranceDefault: null,\n systemLanguage: commaOrSpaceSeparated,\n tabIndex: number,\n tableValues: null,\n target: null,\n targetX: number,\n targetY: number,\n textAnchor: null,\n textDecoration: null,\n textRendering: null,\n textLength: null,\n timelineBegin: null,\n title: null,\n transformBehavior: null,\n type: null,\n typeOf: commaOrSpaceSeparated,\n to: null,\n transform: null,\n transformOrigin: null,\n u1: null,\n u2: null,\n underlinePosition: number,\n underlineThickness: number,\n unicode: null,\n unicodeBidi: null,\n unicodeRange: null,\n unitsPerEm: number,\n values: null,\n vAlphabetic: number,\n vMathematical: number,\n vectorEffect: null,\n vHanging: number,\n vIdeographic: number,\n version: null,\n vertAdvY: number,\n vertOriginX: number,\n vertOriginY: number,\n viewBox: null,\n viewTarget: null,\n visibility: null,\n width: null,\n widths: null,\n wordSpacing: null,\n writingMode: null,\n x: null,\n x1: null,\n x2: null,\n xChannelSelector: null,\n xHeight: number,\n y: null,\n y1: null,\n y2: null,\n yChannelSelector: null,\n z: null,\n zoomAndPan: null\n },\n space: 'svg',\n transform: caseSensitiveTransform\n})\n","import {create} from './util/create.js'\n\nexport const xlink = create({\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n },\n space: 'xlink',\n transform(_, property) {\n return 'xlink:' + property.slice(5).toLowerCase()\n }\n})\n","import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n properties: {xmlnsXLink: null, xmlns: null},\n space: 'xmlns',\n transform: caseInsensitiveTransform\n})\n","import {create} from './util/create.js'\n\nexport const xml = create({\n properties: {xmlBase: null, xmlLang: null, xmlSpace: null},\n space: 'xml',\n transform(_, property) {\n return 'xml:' + property.slice(3).toLowerCase()\n }\n})\n","// Note: types exposed from `index.d.ts`.\nimport {merge} from './lib/util/merge.js'\nimport {aria} from './lib/aria.js'\nimport {html as htmlBase} from './lib/html.js'\nimport {svg as svgBase} from './lib/svg.js'\nimport {xlink} from './lib/xlink.js'\nimport {xmlns} from './lib/xmlns.js'\nimport {xml} from './lib/xml.js'\n\nexport {hastToReact} from './lib/hast-to-react.js'\n\nexport const html = merge([aria, htmlBase, xlink, xmlns, xml], 'html')\n\nexport {find} from './lib/find.js'\nexport {normalize} from './lib/normalize.js'\n\nexport const svg = merge([aria, svgBase, xlink, xmlns, xml], 'svg')\n","/**\n * @import {Identifier, Literal, MemberExpression} from 'estree'\n * @import {Jsx, JsxDev, Options, Props} from 'hast-util-to-jsx-runtime'\n * @import {Element, Nodes, Parents, Root, Text} from 'hast'\n * @import {MdxFlowExpressionHast, MdxTextExpressionHast} from 'mdast-util-mdx-expression'\n * @import {MdxJsxFlowElementHast, MdxJsxTextElementHast} from 'mdast-util-mdx-jsx'\n * @import {MdxjsEsmHast} from 'mdast-util-mdxjs-esm'\n * @import {Position} from 'unist'\n * @import {Child, Create, Field, JsxElement, State, Style} from './types.js'\n */\n\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {ok as assert} from 'devlop'\nimport {name as isIdentifierName} from 'estree-util-is-identifier-name'\nimport {whitespace} from 'hast-util-whitespace'\nimport {find, hastToReact, html, svg} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport styleToJs from 'style-to-js'\nimport {pointStart} from 'unist-util-position'\nimport {VFileMessage} from 'vfile-message'\n\n// To do: next major: `Object.hasOwn`.\nconst own = {}.hasOwnProperty\n\n/** @type {Map<string, number>} */\nconst emptyMap = new Map()\n\nconst cap = /[A-Z]/g\n\n// `react-dom` triggers a warning for *any* white space in tables.\n// To follow GFM, `mdast-util-to-hast` injects line endings between elements.\n// Other tools might do so too, but they don’t do here, so we remove all of\n// that.\n\n// See: <https://github.com/facebook/react/pull/7081>.\n// See: <https://github.com/facebook/react/pull/7515>.\n// See: <https://github.com/remarkjs/remark-react/issues/64>.\n// See: <https://github.com/rehypejs/rehype-react/pull/29>.\n// See: <https://github.com/rehypejs/rehype-react/pull/32>.\n// See: <https://github.com/rehypejs/rehype-react/pull/45>.\nconst tableElements = new Set(['table', 'tbody', 'thead', 'tfoot', 'tr'])\n\nconst tableCellElement = new Set(['td', 'th'])\n\nconst docs = 'https://github.com/syntax-tree/hast-util-to-jsx-runtime'\n\n/**\n * Transform a hast tree to preact, react, solid, svelte, vue, etc.,\n * with an automatic JSX runtime.\n *\n * @param {Nodes} tree\n * Tree to transform.\n * @param {Options} options\n * Configuration (required).\n * @returns {JsxElement}\n * JSX element.\n */\n\nexport function toJsxRuntime(tree, options) {\n if (!options || options.Fragment === undefined) {\n throw new TypeError('Expected `Fragment` in options')\n }\n\n const filePath = options.filePath || undefined\n /** @type {Create} */\n let create\n\n if (options.development) {\n if (typeof options.jsxDEV !== 'function') {\n throw new TypeError(\n 'Expected `jsxDEV` in options when `development: true`'\n )\n }\n\n create = developmentCreate(filePath, options.jsxDEV)\n } else {\n if (typeof options.jsx !== 'function') {\n throw new TypeError('Expected `jsx` in production options')\n }\n\n if (typeof options.jsxs !== 'function') {\n throw new TypeError('Expected `jsxs` in production options')\n }\n\n create = productionCreate(filePath, options.jsx, options.jsxs)\n }\n\n /** @type {State} */\n const state = {\n Fragment: options.Fragment,\n ancestors: [],\n components: options.components || {},\n create,\n elementAttributeNameCase: options.elementAttributeNameCase || 'react',\n evaluater: options.createEvaluater ? options.createEvaluater() : undefined,\n filePath,\n ignoreInvalidStyle: options.ignoreInvalidStyle || false,\n passKeys: options.passKeys !== false,\n passNode: options.passNode || false,\n schema: options.space === 'svg' ? svg : html,\n stylePropertyNameCase: options.stylePropertyNameCase || 'dom',\n tableCellAlignToStyle: options.tableCellAlignToStyle !== false\n }\n\n const result = one(state, tree, undefined)\n\n // JSX element.\n if (result && typeof result !== 'string') {\n return result\n }\n\n // Text node or something that turned into nothing.\n return state.create(\n tree,\n state.Fragment,\n {children: result || undefined},\n undefined\n )\n}\n\n/**\n * Transform a node.\n *\n * @param {State} state\n * Info passed around.\n * @param {Nodes} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction one(state, node, key) {\n if (node.type === 'element') {\n return element(state, node, key)\n }\n\n if (node.type === 'mdxFlowExpression' || node.type === 'mdxTextExpression') {\n return mdxExpression(state, node)\n }\n\n if (node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') {\n return mdxJsxElement(state, node, key)\n }\n\n if (node.type === 'mdxjsEsm') {\n return mdxEsm(state, node)\n }\n\n if (node.type === 'root') {\n return root(state, node, key)\n }\n\n if (node.type === 'text') {\n return text(state, node)\n }\n}\n\n/**\n * Handle element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction element(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.tagName.toLowerCase() === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type = findComponentFromName(state, node.tagName, false)\n const props = createElementProps(state, node)\n let children = createChildren(state, node)\n\n if (tableElements.has(node.tagName)) {\n children = children.filter(function (child) {\n return typeof child === 'string' ? !whitespace(child) : true\n })\n }\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle MDX expression.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxFlowExpressionHast | MdxTextExpressionHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxExpression(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n const program = node.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateExpression(expression.expression)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX ESM.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxjsEsmHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxEsm(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateProgram(node.data.estree)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX JSX.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxJsxElement(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.name === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type =\n node.name === null\n ? state.Fragment\n : findComponentFromName(state, node.name, true)\n const props = createJsxElementProps(state, node)\n const children = createChildren(state, node)\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle root.\n *\n * @param {State} state\n * Info passed around.\n * @param {Root} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction root(state, node, key) {\n /** @type {Props} */\n const props = {}\n\n addChildren(props, createChildren(state, node))\n\n return state.create(node, state.Fragment, props, key)\n}\n\n/**\n * Handle text.\n *\n * @param {State} _\n * Info passed around.\n * @param {Text} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction text(_, node) {\n return node.value\n}\n\n/**\n * Add `node` to props.\n *\n * @param {State} state\n * Info passed around.\n * @param {Props} props\n * Props.\n * @param {unknown} type\n * Type.\n * @param {Element | MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Node.\n * @returns {undefined}\n * Nothing.\n */\nfunction addNode(state, props, type, node) {\n // If this is swapped out for a component:\n if (typeof type !== 'string' && type !== state.Fragment && state.passNode) {\n props.node = node\n }\n}\n\n/**\n * Add children to props.\n *\n * @param {Props} props\n * Props.\n * @param {Array<Child>} children\n * Children.\n * @returns {undefined}\n * Nothing.\n */\nfunction addChildren(props, children) {\n if (children.length > 0) {\n const value = children.length > 1 ? children : children[0]\n\n if (value) {\n props.children = value\n }\n }\n}\n\n/**\n * @param {string | undefined} _\n * Path to file.\n * @param {Jsx} jsx\n * Dynamic.\n * @param {Jsx} jsxs\n * Static.\n * @returns {Create}\n * Create a production element.\n */\nfunction productionCreate(_, jsx, jsxs) {\n return create\n /** @type {Create} */\n function create(_, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const fn = isStaticChildren ? jsxs : jsx\n return key ? fn(type, props, key) : fn(type, props)\n }\n}\n\n/**\n * @param {string | undefined} filePath\n * Path to file.\n * @param {JsxDev} jsxDEV\n * Development.\n * @returns {Create}\n * Create a development element.\n */\nfunction developmentCreate(filePath, jsxDEV) {\n return create\n /** @type {Create} */\n function create(node, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const point = pointStart(node)\n return jsxDEV(\n type,\n props,\n key,\n isStaticChildren,\n {\n columnNumber: point ? point.column - 1 : undefined,\n fileName: filePath,\n lineNumber: point ? point.line : undefined\n },\n undefined\n )\n }\n}\n\n/**\n * Create props from an element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current element.\n * @returns {Props}\n * Props.\n */\nfunction createElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n /** @type {string | undefined} */\n let alignValue\n /** @type {string} */\n let prop\n\n for (prop in node.properties) {\n if (prop !== 'children' && own.call(node.properties, prop)) {\n const result = createProperty(state, prop, node.properties[prop])\n\n if (result) {\n const [key, value] = result\n\n if (\n state.tableCellAlignToStyle &&\n key === 'align' &&\n typeof value === 'string' &&\n tableCellElement.has(node.tagName)\n ) {\n alignValue = value\n } else {\n props[key] = value\n }\n }\n }\n }\n\n if (alignValue) {\n // Assume style is an object.\n const style = /** @type {Style} */ (props.style || (props.style = {}))\n style[state.stylePropertyNameCase === 'css' ? 'text-align' : 'textAlign'] =\n alignValue\n }\n\n return props\n}\n\n/**\n * Create props from a JSX element.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current JSX element.\n * @returns {Props}\n * Props.\n */\nfunction createJsxElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n\n for (const attribute of node.attributes) {\n if (attribute.type === 'mdxJsxExpressionAttribute') {\n if (attribute.data && attribute.data.estree && state.evaluater) {\n const program = attribute.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n const objectExpression = expression.expression\n assert(objectExpression.type === 'ObjectExpression')\n const property = objectExpression.properties[0]\n assert(property.type === 'SpreadElement')\n\n Object.assign(\n props,\n state.evaluater.evaluateExpression(property.argument)\n )\n } else {\n crashEstree(state, node.position)\n }\n } else {\n // For JSX, the author is responsible of passing in the correct values.\n const name = attribute.name\n /** @type {unknown} */\n let value\n\n if (attribute.value && typeof attribute.value === 'object') {\n if (\n attribute.value.data &&\n attribute.value.data.estree &&\n state.evaluater\n ) {\n const program = attribute.value.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n value = state.evaluater.evaluateExpression(expression.expression)\n } else {\n crashEstree(state, node.position)\n }\n } else {\n value = attribute.value === null ? true : attribute.value\n }\n\n // Assume a prop.\n props[name] = /** @type {Props[keyof Props]} */ (value)\n }\n }\n\n return props\n}\n\n/**\n * Create children.\n *\n * @param {State} state\n * Info passed around.\n * @param {Parents} node\n * Current element.\n * @returns {Array<Child>}\n * Children.\n */\nfunction createChildren(state, node) {\n /** @type {Array<Child>} */\n const children = []\n let index = -1\n /** @type {Map<string, number>} */\n // Note: test this when Solid doesn’t want to merge my upcoming PR.\n /* c8 ignore next */\n const countsByName = state.passKeys ? new Map() : emptyMap\n\n while (++index < node.children.length) {\n const child = node.children[index]\n /** @type {string | undefined} */\n let key\n\n if (state.passKeys) {\n const name =\n child.type === 'element'\n ? child.tagName\n : child.type === 'mdxJsxFlowElement' ||\n child.type === 'mdxJsxTextElement'\n ? child.name\n : undefined\n\n if (name) {\n const count = countsByName.get(name) || 0\n key = name + '-' + count\n countsByName.set(name, count + 1)\n }\n }\n\n const result = one(state, child, key)\n if (result !== undefined) children.push(result)\n }\n\n return children\n}\n\n/**\n * Handle a property.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} prop\n * Key.\n * @param {Array<number | string> | boolean | number | string | null | undefined} value\n * hast property value.\n * @returns {Field | undefined}\n * Field for runtime, optional.\n */\nfunction createProperty(state, prop, value) {\n const info = find(state.schema, prop)\n\n // Ignore nullish and `NaN` values.\n if (\n value === null ||\n value === undefined ||\n (typeof value === 'number' && Number.isNaN(value))\n ) {\n return\n }\n\n if (Array.isArray(value)) {\n // Accept `array`.\n // Most props are space-separated.\n value = info.commaSeparated ? commas(value) : spaces(value)\n }\n\n // React only accepts `style` as object.\n if (info.property === 'style') {\n let styleObject =\n typeof value === 'object' ? value : parseStyle(state, String(value))\n\n if (state.stylePropertyNameCase === 'css') {\n styleObject = transformStylesToCssCasing(styleObject)\n }\n\n return ['style', styleObject]\n }\n\n return [\n state.elementAttributeNameCase === 'react' && info.space\n ? hastToReact[info.property] || info.property\n : info.attribute,\n value\n ]\n}\n\n/**\n * Parse a CSS declaration to an object.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} value\n * CSS declarations.\n * @returns {Style}\n * Properties.\n * @throws\n * Throws `VFileMessage` when CSS cannot be parsed.\n */\nfunction parseStyle(state, value) {\n try {\n return styleToJs(value, {reactCompat: true})\n } catch (error) {\n if (state.ignoreInvalidStyle) {\n return {}\n }\n\n const cause = /** @type {Error} */ (error)\n const message = new VFileMessage('Cannot parse `style` attribute', {\n ancestors: state.ancestors,\n cause,\n ruleId: 'style',\n source: 'hast-util-to-jsx-runtime'\n })\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-parse-style-attribute'\n\n throw message\n }\n}\n\n/**\n * Create a JSX name from a string.\n *\n * @param {State} state\n * To do.\n * @param {string} name\n * Name.\n * @param {boolean} allowExpression\n * Allow member expressions and identifiers.\n * @returns {unknown}\n * To do.\n */\nfunction findComponentFromName(state, name, allowExpression) {\n /** @type {Identifier | Literal | MemberExpression} */\n let result\n\n if (!allowExpression) {\n result = {type: 'Literal', value: name}\n } else if (name.includes('.')) {\n const identifiers = name.split('.')\n let index = -1\n /** @type {Identifier | Literal | MemberExpression | undefined} */\n let node\n\n while (++index < identifiers.length) {\n /** @type {Identifier | Literal} */\n const prop = isIdentifierName(identifiers[index])\n ? {type: 'Identifier', name: identifiers[index]}\n : {type: 'Literal', value: identifiers[index]}\n node = node\n ? {\n type: 'MemberExpression',\n object: node,\n property: prop,\n computed: Boolean(index && prop.type === 'Literal'),\n optional: false\n }\n : prop\n }\n\n assert(node, 'always a result')\n result = node\n } else {\n result =\n isIdentifierName(name) && !/^[a-z]/.test(name)\n ? {type: 'Identifier', name}\n : {type: 'Literal', value: name}\n }\n\n // Only literals can be passed in `components` currently.\n // No identifiers / member expressions.\n if (result.type === 'Literal') {\n const name = /** @type {string | number} */ (result.value)\n return own.call(state.components, name) ? state.components[name] : name\n }\n\n // Assume component.\n if (state.evaluater) {\n return state.evaluater.evaluateExpression(result)\n }\n\n crashEstree(state)\n}\n\n/**\n * @param {State} state\n * @param {Position | undefined} [place]\n * @returns {never}\n */\nfunction crashEstree(state, place) {\n const message = new VFileMessage(\n 'Cannot handle MDX estrees without `createEvaluater`',\n {\n ancestors: state.ancestors,\n place,\n ruleId: 'mdx-estree',\n source: 'hast-util-to-jsx-runtime'\n }\n )\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-handle-mdx-estrees-without-createevaluater'\n\n throw message\n}\n\n/**\n * Transform a DOM casing style object to a CSS casing style object.\n *\n * @param {Style} domCasing\n * @returns {Style}\n */\nfunction transformStylesToCssCasing(domCasing) {\n /** @type {Style} */\n const cssCasing = {}\n /** @type {string} */\n let from\n\n for (from in domCasing) {\n if (own.call(domCasing, from)) {\n cssCasing[transformStyleToCssCasing(from)] = domCasing[from]\n }\n }\n\n return cssCasing\n}\n\n/**\n * Transform a DOM casing style field to a CSS casing style field.\n *\n * @param {string} from\n * @returns {string}\n */\nfunction transformStyleToCssCasing(from) {\n let to = from.replace(cap, toDash)\n // Handle `ms-xxx` -> `-ms-xxx`.\n if (to.slice(0, 3) === 'ms-') to = '-' + to\n return to\n}\n\n/**\n * Make `$0` dash cased.\n *\n * @param {string} $0\n * Capitalized ASCII leter.\n * @returns {string}\n * Dash and lower letter.\n */\nfunction toDash($0) {\n return '-' + $0.toLowerCase()\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n */\n\n/**\n * Serialize the positional info of a point, position (start and end points),\n * or node.\n *\n * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value]\n * Node, position, or point.\n * @returns {string}\n * Pretty printed positional info of a node (`string`).\n *\n * In the format of a range `ls:cs-le:ce` (when given `node` or `position`)\n * or a point `l:c` (when given `point`), where `l` stands for line, `c` for\n * column, `s` for `start`, and `e` for end.\n * An empty string (`''`) is returned if the given value is neither `node`,\n * `position`, nor `point`.\n */\nexport function stringifyPosition(value) {\n // Nothing.\n if (!value || typeof value !== 'object') {\n return ''\n }\n\n // Node.\n if ('position' in value || 'type' in value) {\n return position(value.position)\n }\n\n // Position.\n if ('start' in value || 'end' in value) {\n return position(value)\n }\n\n // Point.\n if ('line' in value || 'column' in value) {\n return point(value)\n }\n\n // ?\n return ''\n}\n\n/**\n * @param {Point | PointLike | null | undefined} point\n * @returns {string}\n */\nfunction point(point) {\n return index(point && point.line) + ':' + index(point && point.column)\n}\n\n/**\n * @param {Position | PositionLike | null | undefined} pos\n * @returns {string}\n */\nfunction position(pos) {\n return point(pos && pos.start) + '-' + point(pos && pos.end)\n}\n\n/**\n * @param {number | null | undefined} value\n * @returns {number}\n */\nfunction index(value) {\n return value && typeof value === 'number' ? value : 1\n}\n","/**\n * @import {Node, Point, Position} from 'unist'\n */\n\n/**\n * @typedef {object & {type: string, position?: Position | undefined}} NodeLike\n *\n * @typedef Options\n * Configuration.\n * @property {Array<Node> | null | undefined} [ancestors]\n * Stack of (inclusive) ancestor nodes surrounding the message (optional).\n * @property {Error | null | undefined} [cause]\n * Original error cause of the message (optional).\n * @property {Point | Position | null | undefined} [place]\n * Place of message (optional).\n * @property {string | null | undefined} [ruleId]\n * Category of message (optional, example: `'my-rule'`).\n * @property {string | null | undefined} [source]\n * Namespace of who sent the message (optional, example: `'my-package'`).\n */\n\nimport {stringifyPosition} from 'unist-util-stringify-position'\n\n/**\n * Message.\n */\nexport class VFileMessage extends Error {\n /**\n * Create a message for `reason`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {Options | null | undefined} [options]\n * @returns\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns\n * Instance of `VFileMessage`.\n */\n // eslint-disable-next-line complexity\n constructor(causeOrReason, optionsOrParentOrPlace, origin) {\n super()\n\n if (typeof optionsOrParentOrPlace === 'string') {\n origin = optionsOrParentOrPlace\n optionsOrParentOrPlace = undefined\n }\n\n /** @type {string} */\n let reason = ''\n /** @type {Options} */\n let options = {}\n let legacyCause = false\n\n if (optionsOrParentOrPlace) {\n // Point.\n if (\n 'line' in optionsOrParentOrPlace &&\n 'column' in optionsOrParentOrPlace\n ) {\n options = {place: optionsOrParentOrPlace}\n }\n // Position.\n else if (\n 'start' in optionsOrParentOrPlace &&\n 'end' in optionsOrParentOrPlace\n ) {\n options = {place: optionsOrParentOrPlace}\n }\n // Node.\n else if ('type' in optionsOrParentOrPlace) {\n options = {\n ancestors: [optionsOrParentOrPlace],\n place: optionsOrParentOrPlace.position\n }\n }\n // Options.\n else {\n options = {...optionsOrParentOrPlace}\n }\n }\n\n if (typeof causeOrReason === 'string') {\n reason = causeOrReason\n }\n // Error.\n else if (!options.cause && causeOrReason) {\n legacyCause = true\n reason = causeOrReason.message\n options.cause = causeOrReason\n }\n\n if (!options.ruleId && !options.source && typeof origin === 'string') {\n const index = origin.indexOf(':')\n\n if (index === -1) {\n options.ruleId = origin\n } else {\n options.source = origin.slice(0, index)\n options.ruleId = origin.slice(index + 1)\n }\n }\n\n if (!options.place && options.ancestors && options.ancestors) {\n const parent = options.ancestors[options.ancestors.length - 1]\n\n if (parent) {\n options.place = parent.position\n }\n }\n\n const start =\n options.place && 'start' in options.place\n ? options.place.start\n : options.place\n\n /**\n * Stack of ancestor nodes surrounding the message.\n *\n * @type {Array<Node> | undefined}\n */\n this.ancestors = options.ancestors || undefined\n\n /**\n * Original error cause of the message.\n *\n * @type {Error | undefined}\n */\n this.cause = options.cause || undefined\n\n /**\n * Starting column of message.\n *\n * @type {number | undefined}\n */\n this.column = start ? start.column : undefined\n\n /**\n * State of problem.\n *\n * * `true` — error, file not usable\n * * `false` — warning, change may be needed\n * * `undefined` — change likely not needed\n *\n * @type {boolean | null | undefined}\n */\n this.fatal = undefined\n\n /**\n * Path of a file (used throughout the `VFile` ecosystem).\n *\n * @type {string | undefined}\n */\n this.file = ''\n\n // Field from `Error`.\n /**\n * Reason for message.\n *\n * @type {string}\n */\n this.message = reason\n\n /**\n * Starting line of error.\n *\n * @type {number | undefined}\n */\n this.line = start ? start.line : undefined\n\n // Field from `Error`.\n /**\n * Serialized positional info of message.\n *\n * On normal errors, this would be something like `ParseError`, buit in\n * `VFile` messages we use this space to show where an error happened.\n */\n this.name = stringifyPosition(options.place) || '1:1'\n\n /**\n * Place of message.\n *\n * @type {Point | Position | undefined}\n */\n this.place = options.place || undefined\n\n /**\n * Reason for message, should use markdown.\n *\n * @type {string}\n */\n this.reason = this.message\n\n /**\n * Category of message (example: `'my-rule'`).\n *\n * @type {string | undefined}\n */\n this.ruleId = options.ruleId || undefined\n\n /**\n * Namespace of message (example: `'my-package'`).\n *\n * @type {string | undefined}\n */\n this.source = options.source || undefined\n\n // Field from `Error`.\n /**\n * Stack of message.\n *\n * This is used by normal errors to show where something happened in\n * programming code, irrelevant for `VFile` messages,\n *\n * @type {string}\n */\n this.stack =\n legacyCause && options.cause && typeof options.cause.stack === 'string'\n ? options.cause.stack\n : ''\n\n // The following fields are “well known”.\n // Not standard.\n // Feel free to add other non-standard fields to your messages.\n\n /**\n * Specify the source value that’s being reported, which is deemed\n * incorrect.\n *\n * @type {string | undefined}\n */\n this.actual = undefined\n\n /**\n * Suggest acceptable values that can be used instead of `actual`.\n *\n * @type {Array<string> | undefined}\n */\n this.expected = undefined\n\n /**\n * Long form description of the message (you should use markdown).\n *\n * @type {string | undefined}\n */\n this.note = undefined\n\n /**\n * Link to docs for the message.\n *\n * > 👉 **Note**: this must be an absolute URL that can be passed as `x`\n * > to `new URL(x)`.\n *\n * @type {string | undefined}\n */\n this.url = undefined\n }\n}\n\nVFileMessage.prototype.file = ''\nVFileMessage.prototype.name = ''\nVFileMessage.prototype.reason = ''\nVFileMessage.prototype.message = ''\nVFileMessage.prototype.stack = ''\nVFileMessage.prototype.column = undefined\nVFileMessage.prototype.line = undefined\nVFileMessage.prototype.ancestors = undefined\nVFileMessage.prototype.cause = undefined\nVFileMessage.prototype.fatal = undefined\nVFileMessage.prototype.place = undefined\nVFileMessage.prototype.ruleId = undefined\nVFileMessage.prototype.source = undefined\n","import { slugifyFilePath } from \"@quartz-community/utils/path\";\nimport { joinSegments } from \"@quartz-community/utils\";\n\ninterface FileTrieData {\n slug: string;\n title: string;\n filePath: string;\n}\n\nexport class FileTrieNode<T extends FileTrieData = FileTrieData> {\n isFolder: boolean;\n children: Array<FileTrieNode<T>>;\n\n private slugSegments: string[];\n private fileSegmentHint?: string;\n private displayNameOverride?: string;\n data: T | null;\n\n constructor(segments: string[], data?: T) {\n this.children = [];\n this.slugSegments = segments;\n this.data = data ?? null;\n this.isFolder = false;\n this.displayNameOverride = undefined;\n }\n\n get displayName(): string {\n const nonIndexTitle = this.data?.title === \"index\" ? undefined : this.data?.title;\n return (\n this.displayNameOverride ?? nonIndexTitle ?? this.fileSegmentHint ?? this.slugSegment ?? \"\"\n );\n }\n\n set displayName(name: string) {\n this.displayNameOverride = name;\n }\n\n get slug(): string {\n const path = joinSegments(...this.slugSegments);\n if (this.isFolder) {\n return joinSegments(path, \"index\");\n }\n\n return path;\n }\n\n get slugSegment(): string {\n return this.slugSegments[this.slugSegments.length - 1] ?? \"\";\n }\n\n private makeChild(path: string[], file?: T): FileTrieNode<T> {\n const nextSegment = path[0];\n if (!nextSegment) {\n throw new Error(\"path is empty\");\n }\n const fullPath = [...this.slugSegments, nextSegment];\n const child = new FileTrieNode<T>(fullPath, file);\n this.children.push(child);\n return child;\n }\n\n private insert(path: string[], file: T): void {\n if (path.length === 0) {\n throw new Error(\"path is empty\");\n }\n\n this.isFolder = true;\n const segment = path[0];\n if (!segment) {\n throw new Error(\"path is empty\");\n }\n if (path.length === 1) {\n if (segment === \"index\") {\n this.data ??= file;\n } else {\n this.makeChild(path, file);\n }\n } else if (path.length > 1) {\n const child =\n this.children.find((c) => c.slugSegment === segment) ?? this.makeChild(path, undefined);\n\n const fileParts = file.filePath.split(\"/\");\n const hint = fileParts.at(-path.length);\n if (hint) {\n child.fileSegmentHint = hint;\n }\n child.insert(path.slice(1), file);\n }\n }\n\n /** Add a page at `position` (default: its slug); see trieFromAllFiles. */\n add(file: T, position: string = file.slug): void {\n this.insert(position.split(\"/\"), file);\n }\n\n findNode(path: string[]): FileTrieNode<T> | undefined {\n if (path.length === 0 || (path.length === 1 && path[0] === \"index\")) {\n return this;\n }\n\n return this.children.find((c) => c.slugSegment === path[0])?.findNode(path.slice(1));\n }\n\n ancestryChain(path: string[]): Array<FileTrieNode<T>> | undefined {\n if (path.length === 0 || (path.length === 1 && path[0] === \"index\")) {\n return [this];\n }\n\n const child = this.children.find((c) => c.slugSegment === path[0]);\n if (!child) {\n return undefined;\n }\n\n const childPath = child.ancestryChain(path.slice(1));\n if (!childPath) {\n return undefined;\n }\n\n return [this, ...childPath];\n }\n\n filter(filterFn: (node: FileTrieNode<T>) => boolean): void {\n this.children = this.children.filter(filterFn);\n this.children.forEach((child) => child.filter(filterFn));\n }\n\n map(mapFn: (node: FileTrieNode<T>) => void): void {\n mapFn(this);\n this.children.forEach((child) => child.map(mapFn));\n }\n\n sort(sortFn: (a: FileTrieNode<T>, b: FileTrieNode<T>) => number): void {\n this.children = this.children.sort(sortFn);\n this.children.forEach((e) => e.sort(sortFn));\n }\n}\n\nexport function trieFromAllFiles(\n allFiles: Array<{\n slug?: string;\n filePath?: string;\n relativePath?: string;\n frontmatter?: { title?: string; [key: string]: unknown };\n }>,\n): FileTrieNode {\n const trie = new FileTrieNode([]);\n allFiles.forEach((file) => {\n if (file.frontmatter) {\n trie.add(\n {\n slug: file.slug!,\n title: file.frontmatter.title ?? \"\",\n filePath: file.filePath!,\n },\n pagePosition(file),\n );\n }\n });\n\n return trie;\n}\n\n/**\n * Where a page sits in the navigation: its file path. A note with a permalink is published at the\n * permalink (its slug) but stays in its folder, as in Obsidian Publish.\n */\nexport function pagePosition(file: { slug?: string; relativePath?: string }): string {\n return file.relativePath ? slugifyFilePath(file.relativePath as never) : (file.slug ?? \"\");\n}\n",".breadcrumb-container {\n margin: 0;\n margin-top: 0.75rem;\n padding: 0;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 0.5rem;\n}\n\n.breadcrumb-element p {\n margin: 0;\n margin-left: 0.5rem;\n padding: 0;\n line-height: normal;\n}\n.breadcrumb-element {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n}","import type {\n QuartzComponent,\n QuartzComponentConstructor,\n QuartzComponentProps,\n} from \"@quartz-community/types\";\nimport { classNames } from \"../util/lang\";\nimport { resolveRelative, simplifySlug } from \"../util/path\";\nimport { FileTrieNode, pagePosition, trieFromAllFiles } from \"../util/fileTrie\";\nimport style from \"./styles/breadcrumbs.scss\";\n\ntype CrumbData = {\n displayName: string;\n path: string;\n};\n\nexport interface BreadcrumbOptions {\n /** Symbol between crumbs */\n spacerSymbol: string;\n /** Name of first crumb */\n rootName: string;\n /** Whether to look up frontmatter title for folders */\n resolveFrontmatterTitle: boolean;\n /** Whether to display the current page in the breadcrumbs */\n showCurrentPage: boolean;\n}\n\nconst defaultOptions: BreadcrumbOptions = {\n spacerSymbol: \"❯\",\n rootName: \"Home\",\n resolveFrontmatterTitle: true,\n showCurrentPage: true,\n};\n\nfunction formatCrumb(displayName: string, baseSlug: string, currentSlug: string): CrumbData {\n return {\n displayName,\n path: resolveRelative(baseSlug, currentSlug),\n };\n}\n\nexport default ((opts?: Partial<BreadcrumbOptions>) => {\n const options: BreadcrumbOptions = { ...defaultOptions, ...opts };\n const Breadcrumbs: QuartzComponent = ({\n fileData,\n allFiles,\n displayClass,\n ctx,\n }: QuartzComponentProps) => {\n const typedCtx = (ctx ?? {}) as Record<string, unknown> as { trie?: FileTrieNode };\n typedCtx.trie ??= trieFromAllFiles(\n allFiles as Array<{\n slug?: string;\n filePath?: string;\n frontmatter?: { title?: string; [key: string]: unknown };\n }>,\n );\n const trie = typedCtx.trie;\n const slug = fileData.slug as string;\n // the page's place in the navigation (its file path), which differs from its slug with a permalink\n const slugParts = pagePosition(fileData as { slug?: string; relativePath?: string }).split(\"/\");\n const pathNodes = trie.ancestryChain(slugParts);\n\n if (!pathNodes) {\n return null;\n }\n\n const crumbs: CrumbData[] = pathNodes.map((node, idx) => {\n const crumb = formatCrumb(node.displayName, slug, simplifySlug(node.slug));\n if (idx === 0) {\n crumb.displayName = options.rootName;\n }\n\n if (idx === pathNodes.length - 1) {\n crumb.path = \"\";\n }\n\n return crumb;\n });\n\n if (!options.showCurrentPage) {\n crumbs.pop();\n }\n\n return (\n <nav class={classNames(displayClass, \"breadcrumb-container\")} aria-label=\"breadcrumbs\">\n {crumbs.map((crumb, index) => (\n <div class=\"breadcrumb-element\">\n <a href={crumb.path}>{crumb.displayName}</a>\n {index !== crumbs.length - 1 && <p>{` ${options.spacerSymbol} `}</p>}\n </div>\n ))}\n </nav>\n );\n };\n Breadcrumbs.css = style;\n\n return Breadcrumbs;\n}) satisfies QuartzComponentConstructor;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quartz-community/breadcrumbs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Breadcrumbs navigation component for Quartz",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,9 +59,10 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@quartz-community/types": "^1.0.0",
|
|
62
|
-
"@quartz-community/utils": "^1.
|
|
62
|
+
"@quartz-community/utils": "^1.3.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
+
"@changesets/cli": "^2.29.2",
|
|
65
66
|
"@types/hast": "^3.0.4",
|
|
66
67
|
"@types/mdast": "^4.0.4",
|
|
67
68
|
"@types/node": "^24.10.0",
|
|
@@ -77,8 +78,7 @@
|
|
|
77
78
|
"tsup": "^8.5.0",
|
|
78
79
|
"typescript": "^5.9.3",
|
|
79
80
|
"vfile": "^6.0.3",
|
|
80
|
-
"vitest": "^2.1.9"
|
|
81
|
-
"@changesets/cli": "^2.29.2"
|
|
81
|
+
"vitest": "^2.1.9"
|
|
82
82
|
},
|
|
83
83
|
"engines": {
|
|
84
84
|
"node": ">=22",
|