@dirwell/theme-ledger 0.0.1-alpha → 0.0.1-alpha.1

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @dirwell/theme-ledger
2
2
 
3
- Private alpha workspace. Svelte owns the server markup, client state, keyed rows, search, sorting, dialogs, navigation and cleanup. No framework-neutral serialized UI tree or imperative theme controller is used.
3
+ Svelte owns the server markup, client state, keyed rows, search, sorting, dialogs, navigation and cleanup. No framework-neutral serialized UI tree or imperative theme controller is used.
4
4
 
5
5
  Use `createLedgerTheme({ title: "Sample downloads" })` with `@dirwell/core` and an explicit listing policy. Paged HTML preserves native links without JavaScript. The browser loads and validates the complete compact listing before enabling directory-wide search and sorting; directories exceeding 500 visible rows use measured row virtualization. Folder snapshots resolve navigation URLs before updating History.
6
6
 
package/dist/index.mjs CHANGED
@@ -571,6 +571,12 @@ const renderBody = (model) => render(Ledger, { props: { model } }).body;
571
571
  //#endregion
572
572
  //#region src/index.ts
573
573
  function createLedgerTheme(options = {}, renderer) {
574
+ let resources;
575
+ const loadResources = () => resources ??= Promise.all([renderer?.clientScript ?? readFile(new URL("./client.js", import.meta.url), "utf8"), readFile(new URL("./styles.css", import.meta.url), "utf8")]).then(([script, styles]) => ({
576
+ script,
577
+ styles,
578
+ scriptName: `ledger-client-${createHash("sha256").update(script).digest("hex").slice(0, 16)}.js`
579
+ }));
574
580
  const theme = {
575
581
  name: "ledger",
576
582
  listing: { pagination: true },
@@ -580,9 +586,7 @@ function createLedgerTheme(options = {}, renderer) {
580
586
  ...createThemePage(context, theme, options.title ?? "Dirwell"),
581
587
  searchIndexHref: context.searchIndexHref
582
588
  };
583
- const script = renderer?.clientScript ?? await readFile(new URL("./client.js", import.meta.url), "utf8");
584
- const scriptName = `ledger-client-${createHash("sha256").update(script).digest("hex").slice(0, 16)}.js`;
585
- const styles = await readFile(new URL("./styles.css", import.meta.url), "utf8");
589
+ const { script, scriptName, styles } = await loadResources();
586
590
  const json = JSON.stringify(model).replaceAll("<", "\\u003c");
587
591
  return {
588
592
  html: `<!doctype html><html lang="en" data-theme="system"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${context.documentBaseHref === null ? "" : `<base href="${escapeHtml(context.documentBaseHref)}">`}${context.metadata?.head ?? `<title>${escapeHtml(model.title)}</title>`}<style>${styles}${renderer?.styles ?? ""}</style></head><body><div data-dirwell-theme="ledger">${await (renderer?.renderBody ?? renderBody)(model)}</div><script type="application/json" id="dirwell-page-data">${json}<\/script><script ${renderer?.clientType === "module" ? "type=\"module\"" : "defer"} src="${escapeHtml(context.assetHref(scriptName))}"><\/script></body></html>`,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["App"],"sources":["../../shared-theme/src/page.ts","../../shared-theme/src/icons.ts","../../shared-theme/src/navigation.ts","../../shared-theme/src/records.ts","../.generated/App-server.mjs","../render-generated.mjs","../src/index.ts"],"sourcesContent":["import path from \"node:path\";\nimport { createHash } from \"node:crypto\";\nimport { projectListingEntry, copyJsonObject } from \"@dirwell/core\";\nimport type {\n ListingEntry,\n ThemeContext,\n ListingPage,\n SortOptions,\n ExplorerTheme,\n} from \"@dirwell/core\";\nexport interface ThemePage {\n readonly version: 1;\n readonly theme: string;\n readonly title: string;\n readonly metadataHead?: string;\n readonly path: string;\n readonly rootHref: string;\n readonly parentHref: string | null;\n readonly parentDataHref: string | null;\n readonly rootDataHref: string;\n readonly dataHref: string;\n readonly manifestHref: string | null;\n readonly listingRevision?: string;\n readonly updatesHref: string | null;\n readonly total: number;\n readonly entries: readonly ListingEntry[];\n readonly sort: Required<SortOptions>;\n readonly page: ListingPage | null;\n readonly breadcrumbs: readonly {\n readonly name: string;\n readonly href: string;\n readonly dataHref: string;\n }[];\n}\nexport const pageAsset = (theme: string, directory: string, page = 1) =>\n `${theme}-page-${createHash(\"sha256\").update(directory).digest(\"hex\").slice(0, 24)}-${page}.json`;\nexport function folderDataHref(\n entry: ListingEntry,\n context: Parameters<NonNullable<ExplorerTheme[\"entryData\"]>>[1],\n theme: string,\n): string | null {\n if (\n entry.exitsExplorer ||\n entry.href === null ||\n !(entry.kind === \"directory\" || entry.link?.targetKind === \"directory\")\n )\n return null;\n const fake = \"https://dirwell.invalid/\";\n const base = new URL(\n context.documentBaseHref ?? `${context.directoryPath ? context.directoryPath + \"/\" : \"\"}`,\n fake,\n );\n const root = new URL(context.hrefForDirectory(\"\"), base);\n const target = new URL(entry.href, base);\n const rootPath = root.pathname.endsWith(\"/\")\n ? root.pathname\n : root.pathname.slice(0, root.pathname.lastIndexOf(\"/\") + 1);\n const directoryPath = target.pathname.endsWith(\"/\")\n ? target.pathname\n : target.pathname.slice(0, target.pathname.lastIndexOf(\"/\") + 1);\n const logical = directoryPath\n .slice(rootPath.length)\n .split(\"/\")\n .filter(Boolean)\n .map(decodeURIComponent)\n .join(\"/\");\n const filename = pageAsset(theme, logical);\n if (context.pageDataHref !== undefined) return context.pageDataHref(theme, logical, 1);\n if (context.mode === \"mpa\") return context.assetHref(filename);\n const href = new URL(filename, new URL(directoryPath, target));\n if (href.origin !== new URL(fake).origin) return href.href;\n if (context.documentBaseHref === null && !entry.href.startsWith(\"/\")) {\n return path.posix\n .relative(context.directoryPath || \".\", path.posix.join(logical, filename))\n .split(\"/\")\n .map((segment) =>\n segment === \"..\" || segment === \".\" ? segment : encodeURIComponent(segment),\n )\n .join(\"/\");\n }\n return href.pathname;\n}\nexport function createThemePage(\n context: ThemeContext,\n theme: ExplorerTheme,\n title: string,\n): ThemePage {\n const directoryPath = context.directory.current.relativePath;\n const safeContext = {\n ...(context.pageDataHref === undefined ? {} : { pageDataHref: context.pageDataHref }),\n mode: context.mode,\n outputName: context.outputName,\n assetHref: context.assetHref,\n hrefForDirectory: context.hrefForDirectory,\n documentBaseHref: context.documentBaseHref,\n directoryPath,\n };\n const dataForDirectory = (logicalPath: string) =>\n folderDataHref(\n {\n id: logicalPath,\n name: logicalPath,\n kind: \"directory\",\n href: context.hrefForDirectory(logicalPath),\n exitsExplorer: false,\n size: 0,\n modifiedAt: \"\",\n link: null,\n },\n safeContext,\n theme.name,\n )!;\n const entries = context.directory.entries.map((entry) => {\n const record = projectListingEntry(entry, context);\n return theme.entryData === undefined\n ? record\n : { ...record, presentation: copyJsonObject(theme.entryData(record, safeContext)) };\n });\n return {\n version: 1,\n ...(context.metadata === undefined ? {} : { metadataHead: context.metadata.head }),\n theme: theme.name,\n title: context.metadata?.title ?? (directoryPath ? `${directoryPath} · ${title}` : title),\n path: directoryPath,\n rootHref: context.hrefForDirectory(\"\"),\n parentHref:\n context.directory.parent === null\n ? null\n : context.hrefForDirectory(context.directory.parent.relativePath),\n rootDataHref: dataForDirectory(\"\"),\n parentDataHref:\n context.directory.parent === null\n ? null\n : dataForDirectory(context.directory.parent.relativePath),\n dataHref:\n context.pageDataHref?.(theme.name, directoryPath, context.listing?.page.number ?? 1) ??\n context.assetHref(pageAsset(theme.name, directoryPath, context.listing?.page.number ?? 1)),\n manifestHref: context.listing?.manifestHref ?? null,\n ...(context.listing ? { listingRevision: context.listing.revision } : {}),\n updatesHref: context.updatesHref ?? null,\n total: context.listing?.page.total ?? entries.length,\n entries,\n sort: context.sort,\n page: context.listing?.page ?? null,\n breadcrumbs: directoryPath\n .split(\"/\")\n .filter(Boolean)\n .map((name, index) => ({\n name,\n dataHref: dataForDirectory(\n directoryPath\n .split(\"/\")\n .slice(0, index + 1)\n .join(\"/\"),\n ),\n href: context.hrefForDirectory(\n directoryPath\n .split(\"/\")\n .slice(0, index + 1)\n .join(\"/\"),\n ),\n })),\n };\n}\n","const paths = {\n directory: '<path d=\"M3 7V5h6l2 3h10v12H3Z\"/><path d=\"M3 10h18\"/>',\n file: '<path d=\"M5 3h9l5 5v13H5ZM14 3v5h5M8 12h8M8 16h6\"/>',\n link: '<path d=\"m9 15 6-6M8 10l-3 3a4 4 0 0 0 6 6l3-3M10 8l3-3a4 4 0 0 1 6 6l-3 3\"/>',\n};\n/** Fixed authored geometry; source names and paths never enter SVG markup. */\nexport function entryIcon(kind: keyof typeof paths): string {\n return `<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.45\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${paths[kind]}</svg>`;\n}\n","import { loadListing, parseListingEntries, ListingDataError } from \"@dirwell/core/client\";\n\n/** Folder snapshots resolve relative URLs before History changes the document URL. */\nexport async function fetchThemePage(\n dataHref: string,\n pageHref: string,\n theme: string,\n signal: AbortSignal,\n fresh = false,\n attempt = 0,\n): Promise<Record<string, unknown>> {\n const source = new URL(dataHref, document.baseURI);\n if (source.origin !== location.origin)\n throw new ListingDataError(\"Folder leaves the theme origin\");\n const response = await fetch(source, { signal, cache: fresh ? \"no-store\" : \"default\" });\n if (!response.ok) throw new ListingDataError(\"Unavailable folder\");\n const value: unknown = await response.json();\n if (typeof value !== \"object\" || value === null || Array.isArray(value))\n throw new ListingDataError(\"Invalid folder snapshot\");\n const data = value as Record<string, unknown>;\n if (\n data.version !== 1 ||\n data.theme !== theme ||\n typeof data.title !== \"string\" ||\n typeof data.path !== \"string\" ||\n !Number.isSafeInteger(data.total) ||\n Number(data.total) < 0 ||\n !Array.isArray(data.breadcrumbs)\n )\n throw new ListingDataError(\"Unsupported folder snapshot\");\n if (data.metadataHead !== undefined && typeof data.metadataHead !== \"string\")\n throw new ListingDataError(\"Invalid folder metadata\");\n const base = document.querySelector(\"base\")?.href ?? pageHref;\n const link = (raw: unknown): string | null => {\n if (raw === null) return null;\n if (typeof raw !== \"string\") throw new ListingDataError(\"Invalid folder link\");\n const url = new URL(raw, base);\n if (![\"http:\", \"https:\"].includes(url.protocol) || url.origin !== location.origin)\n throw new ListingDataError(\"Unsupported folder link\");\n return url.href;\n };\n const entries = parseListingEntries(data.entries, base).map((entry) => ({\n ...entry,\n ...(entry.presentation\n ? {\n presentation: {\n ...entry.presentation,\n folderDataHref: link(entry.presentation.folderDataHref ?? null),\n },\n }\n : {}),\n }));\n if (entries.length > Number(data.total)) throw new ListingDataError(\"Invalid folder count\");\n const result = {\n ...data,\n updatesHref: link(data.updatesHref ?? null),\n entries,\n dataHref: source.href,\n manifestHref: link(data.manifestHref),\n rootHref: link(data.rootHref),\n rootDataHref: link(data.rootDataHref),\n parentHref: link(data.parentHref),\n parentDataHref: link(data.parentDataHref),\n breadcrumbs: data.breadcrumbs.map((raw) => {\n if (\n typeof raw !== \"object\" ||\n raw === null ||\n !(\"name\" in raw) ||\n !(\"href\" in raw) ||\n !(\"dataHref\" in raw) ||\n typeof raw.name !== \"string\"\n )\n throw new ListingDataError(\"Invalid breadcrumb\");\n return { name: raw.name, href: link(raw.href), dataHref: link(raw.dataHref) };\n }),\n };\n // Keep the current UI until independently fetched page and listing revisions agree.\n if (fresh && result.manifestHref) {\n const loaded = await loadListing(result.manifestHref, { signal, cache: \"no-store\" });\n if (\n loaded.manifest.total !== data.total ||\n (data.listingRevision !== undefined && loaded.manifest.revision !== data.listingRevision)\n ) {\n if (attempt < 2) return fetchThemePage(dataHref, pageHref, theme, signal, true, attempt + 1);\n throw new ListingDataError(\"Folder changed while refreshing\");\n }\n result.entries = [...loaded.entries];\n }\n return result;\n}\n\n// HMR can remount a wrapper while the outer explorer root stays mounted.\n// Keep only its current public model; production imports never register roots.\nconst hotModels = new WeakMap<Element, Record<string, unknown>>();\nexport function restoreThemePage(\n initial: Record<string, unknown>,\n hot: boolean,\n): Record<string, unknown> {\n if (!hot || typeof document === \"undefined\") return initial;\n const root = document.querySelector(\"[data-dirwell-theme]\");\n if (!root) return initial;\n const snapshot = hotModels.get(root) ?? initial;\n hotModels.set(root, snapshot);\n return snapshot;\n}\n\n/** Copy only inert metadata elements; never insert snapshot HTML or event attributes. */\nexport function applyThemeMetadata(page: Record<string, unknown>, pageHref: string): void {\n const root = document.querySelector(\"[data-dirwell-theme]\");\n if (root && hotModels.has(root)) hotModels.set(root, page);\n document.title = typeof page.title === \"string\" ? page.title : \"\";\n const template = document.createElement(\"template\");\n template.innerHTML = typeof page.metadataHead === \"string\" ? page.metadataHead : \"\";\n document.head.querySelectorAll(\"[data-dirwell-metadata]\").forEach((element) => element.remove());\n const base = document.querySelector(\"base\")?.href ?? pageHref;\n const url = (value: string): string | null => {\n try {\n const target = new URL(value, base);\n return [\"http:\", \"https:\"].includes(target.protocol) ? target.href : null;\n } catch {\n return null;\n }\n };\n for (const element of template.content.children) {\n if (!element.hasAttribute(\"data-dirwell-metadata\")) continue;\n let next: HTMLElement;\n if (element.tagName === \"META\") {\n const attribute = element.hasAttribute(\"property\") ? \"property\" : \"name\";\n const key = element.getAttribute(attribute) ?? \"\";\n if (!/^(?:description|og:[a-z_:]+|twitter:[a-z_:]+)$/i.test(key)) continue;\n let content = element.getAttribute(\"content\") ?? \"\";\n if ([\"og:image\", \"og:url\", \"twitter:image\"].includes(key)) {\n const resolved = url(content);\n if (resolved === null) continue;\n content = resolved;\n }\n next = document.createElement(\"meta\");\n next.setAttribute(attribute, key);\n next.setAttribute(\"content\", content);\n } else if (element.tagName === \"LINK\" && element.getAttribute(\"rel\") === \"canonical\") {\n const href = url(element.getAttribute(\"href\") ?? \"\");\n if (href === null) continue;\n next = document.createElement(\"link\");\n next.setAttribute(\"rel\", \"canonical\");\n next.setAttribute(\"href\", href);\n } else continue;\n next.setAttribute(\"data-dirwell-metadata\", \"\");\n document.head.append(next);\n }\n}\n","import type { ListingEntry, SortOptions } from \"@dirwell/core\";\nexport const directoryLike = (entry: ListingEntry) =>\n entry.kind === \"directory\" || entry.link?.targetKind === \"directory\";\nexport const entryType = (entry: ListingEntry) =>\n entry.kind === \"symlink\" ? \"link\" : directoryLike(entry) ? \"directory\" : \"file\";\nexport function fuzzy(query: string, value: string): number | null {\n let score = 0,\n start = 0,\n last = -2;\n for (const character of query.trim().toLocaleLowerCase()) {\n const index = value.toLocaleLowerCase().indexOf(character, start);\n if (index < 0) return null;\n if (index === last + 1) score += 8;\n if (index === 0 || /[\\s/_.-]/.test(value[index - 1] ?? \"\")) score += 5;\n score += Math.max(0, 4 - index * 0.05);\n last = index;\n start = index + 1;\n }\n return score - value.length * 0.01;\n}\nexport function visibleRecords(\n entries: readonly ListingEntry[],\n query: string,\n types: readonly string[],\n sort: Required<SortOptions>,\n): ListingEntry[] {\n return entries\n .map((entry) => ({ entry, score: fuzzy(query, `${entry.name} ${entry.link?.target ?? \"\"}`) }))\n .filter((item) => types.includes(entryType(item.entry)) && item.score !== null)\n .sort((left, right) => {\n if (query.trim() && left.score !== right.score) return (right.score ?? 0) - (left.score ?? 0);\n const a = left.entry,\n b = right.entry;\n if (sort.directoriesFirst && directoryLike(a) !== directoryLike(b))\n return directoryLike(a) ? -1 : 1;\n const name = () =>\n sort.nameMode === \"unicode\"\n ? compareUnicode(a.name, b.name)\n : a.name.localeCompare(b.name, undefined, {\n numeric: sort.nameMode === \"natural\",\n sensitivity: \"base\",\n });\n const primary =\n (sort.field === \"name\"\n ? name()\n : sort.field === \"size\"\n ? (a.kind === \"directory\" ? 0 : a.size) - (b.kind === \"directory\" ? 0 : b.size)\n : a.modifiedAt.localeCompare(b.modifiedAt)) || name();\n return (sort.direction === \"asc\" ? primary : -primary) || compareUnicode(a.id, b.id);\n })\n .map((item) => item.entry);\n}\nfunction compareUnicode(left: string, right: string): number {\n const a = [...left],\n b = [...right];\n for (let i = 0; i < Math.min(a.length, b.length); i++) {\n const delta = (a[i]?.codePointAt(0) ?? 0) - (b[i]?.codePointAt(0) ?? 0);\n if (delta) return delta;\n }\n return a.length - b.length;\n}\nexport function size(bytes: number): string {\n const units = [\"B\", \"KiB\", \"MiB\", \"GiB\", \"TiB\"];\n let value = bytes,\n index = 0;\n while (value >= 1024 && index < 4) {\n value /= 1024;\n index++;\n }\n return `${value.toFixed(index === 0 || value >= 100 ? 0 : 1)} ${units[index]}`;\n}\nexport function modified(value: string, local = false): string {\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) return \"Unknown\";\n return local\n ? date.toLocaleString(undefined, { dateStyle: \"short\", timeStyle: \"short\" })\n : `${date.toISOString().slice(0, 16).replace(\"T\", \" \")} UTC`;\n}\n","import * as $ from 'svelte/internal/server';\nimport { onMount, tick, untrack } from \"svelte\";\nimport { entryIcon } from \"../../shared-theme/src/icons.ts\";\nimport { loadListing } from \"@dirwell/core/client\";\nimport { fetchThemePage, applyThemeMetadata, restoreThemePage } from \"../../shared-theme/src/navigation.ts\";\n\nimport {\n\tvisibleRecords,\n\tdirectoryLike,\n\tentryType,\n\tsize,\n\tmodified,\n\tfuzzy\n} from \"../../shared-theme/src/records.ts\";\n\nexport default function Ledger($$renderer, $$props) {\n\t$$renderer.component(($$renderer) => {\n\t\tlet { model: initialModel, header, row, footer } = $$props;\n\t\tconst snapshot = untrack(() => restoreThemePage(initialModel, Boolean(import.meta.hot)));\n\t\tlet model = snapshot;\n\t\tlet entries = snapshot.entries;\n\t\tlet query = \"\";\n\t\tlet types = [\"directory\", \"file\", \"link\"];\n\t\tlet sort = snapshot.sort;\n\t\tlet scheme = \"system\";\n\t\tlet selected = null;\n\t\tlet ready = false;\n\t\tlet busy = false;\n\t\tlet error = \"\";\n\t\tlet timestamp = null;\n\t\tlet composing = false;\n\t\tlet scrollTop = 0;\n\t\tlet globalOpen = false;\n\t\tlet globalQuery = \"\";\n\t\tlet globalRows = [];\n\t\tlet globalStatus = \"Enter a search to begin.\";\n\t\tlet pendingUpdates = null;\n\t\tlet heights = new Map();\n\n\t\tlet updatesHref = $.derived(() => ready && model.updatesHref\n\t\t\t? new URL(model.updatesHref, document.baseURI).href\n\t\t\t: null);\n\n\t\tlet complete = $.derived(() => entries.length === model.total);\n\t\tlet rows = $.derived(() => visibleRecords(entries, composing ? \"\" : query, types, sort));\n\t\tlet virtual = $.derived(() => ready && rows().length > 500);\n\n\t\tlet offsets = $.derived(() => {\n\t\t\tconst values = [0];\n\n\t\t\tfor (const entry of rows()) values.push(values.at(-1) + (heights.get(entry.id) ?? 76));\n\n\t\t\treturn values;\n\t\t});\n\n\t\tlet start = $.derived(() => {\n\t\t\tif (!virtual()) return 0;\n\n\t\t\tlet low = 0, high = rows().length;\n\n\t\t\twhile (low < high) {\n\t\t\t\tconst mid = low + high >> 1;\n\n\t\t\t\tif (offsets()[mid + 1] <= scrollTop) low = mid + 1; else high = mid;\n\t\t\t}\n\n\t\t\treturn Math.max(0, low - 5);\n\t\t});\n\n\t\tlet end = $.derived(() => virtual() ? Math.min(rows().length, start() + 35) : rows().length);\n\n\t\tfunction measure(node, id) {\n\t\t\tif (typeof ResizeObserver === \"undefined\") return;\n\n\t\t\tconst observer = new ResizeObserver(() => {\n\t\t\t\tconst value = node.getBoundingClientRect().height;\n\n\t\t\t\tif (value > 0 && heights.get(id) !== value) {\n\t\t\t\t\tconst next = new Map(heights);\n\n\t\t\t\t\tnext.set(id, value);\n\t\t\t\t\theights = next;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tobserver.observe(node);\n\n\t\t\treturn { destroy: () => observer.disconnect() };\n\t\t}\n\n\t\tlet list = void 0;\n\t\tlet searchInput = void 0;\n\t\tlet globalInput = void 0;\n\t\tlet timeDialog = void 0;\n\t\tlet globalDialog = void 0;\n\t\tlet navigation = 0;\n\t\tlet abort;\n\t\tlet archiveAbort;\n\t\tlet archiveRequest = 0;\n\t\tconst isDirectory = directoryLike;\n\n\t\tfunction safeHref(record) {\n\t\t\tif (typeof location !== \"undefined\" && location.protocol === \"file:\" && isDirectory(record) && !record.exitsExplorer && record.href?.endsWith(\"/\")) return record.href + \"index.html\";\n\n\t\t\treturn record.href;\n\t\t}\n\n\t\tasync function hydrateData() {\n\t\t\tif (complete() || !model.manifestHref || location.protocol === \"file:\") return;\n\n\t\t\tconst local = abort, token = navigation;\n\n\t\t\tbusy = true;\n\n\t\t\ttry {\n\t\t\t\tconst loaded = await loadListing(new URL(model.manifestHref, document.baseURI).href, {\n\t\t\t\t\tsignal: local.signal,\n\t\t\t\t\tcache: model.updatesHref ? \"no-store\" : \"default\"\n\t\t\t\t});\n\n\t\t\t\tif (token === navigation && !local.signal.aborted) entries = loaded.entries;\n\t\t\t} catch(cause) {\n\t\t\t\tif (token === navigation && !local.signal.aborted) error = \"Could not load complete directory data. Native page links remain available.\";\n\t\t\t} finally {\n\t\t\t\tif (token === navigation) busy = false;\n\t\t\t}\n\t\t}\n\n\t\tasync function navigate(event, record) {\n\t\t\tconst dataHref = record.presentation?.folderDataHref;\n\n\t\t\tif (record.exitsExplorer || event?.altKey || event?.ctrlKey || event?.metaKey || event?.shiftKey || event?.button > 0 || typeof dataHref !== \"string\" || location.protocol === \"file:\") return;\n\n\t\t\tevent?.preventDefault();\n\t\t\tawait openFolder(dataHref, new URL(record.href, document.baseURI).href, true);\n\t\t}\n\n\t\tasync function openFolder(dataHref, url, push, refresh = false) {\n\t\t\tconst token = ++navigation;\n\n\t\t\tabort?.abort();\n\n\t\t\tconst local = abort = new AbortController();\n\n\t\t\tbusy = true;\n\t\t\terror = \"\";\n\n\t\t\ttry {\n\t\t\t\tconst next = await fetchThemePage(dataHref, url, \"ledger\", local.signal, refresh);\n\t\t\t\tlet nextEntries = next.entries;\n\n\t\t\t\tif (refresh && next.manifestHref && nextEntries.length !== next.total) {\n\t\t\t\t\tnextEntries = (await loadListing(next.manifestHref, { signal: local.signal, cache: \"no-store\" })).entries;\n\t\t\t\t}\n\n\t\t\t\tif (token !== navigation || local.signal.aborted) return;\n\n\t\t\t\tmodel = next;\n\t\t\t\tentries = nextEntries;\n\n\t\t\t\tif (!refresh) {\n\t\t\t\t\tquery = \"\";\n\t\t\t\t\tselected = null;\n\t\t\t\t\tscrollTop = 0;\n\t\t\t\t}\n\n\t\t\t\tif (push) history.pushState({ dataHref: next.dataHref }, \"\", url);\n\n\t\t\t\tapplyThemeMetadata(next, url);\n\t\t\t\tawait hydrateData();\n\n\t\t\t\tif (!refresh) window.scrollTo({ top: 0 });\n\t\t\t} catch(cause) {\n\t\t\t\tif (token === navigation && !local.signal.aborted) error = \"Could not open this folder. Open its native link or try again.\";\n\t\t\t} finally {\n\t\t\t\tif (token === navigation) busy = false;\n\t\t\t}\n\t\t}\n\n\t\tfunction navigateLink(event, href, dataHref) {\n\t\t\tif (event?.altKey || event?.ctrlKey || event?.metaKey || event?.shiftKey || event?.button > 0 || location.protocol === \"file:\") return;\n\n\t\t\tevent?.preventDefault();\n\t\t\topenFolder(dataHref, new URL(href, document.baseURI).href, true);\n\t\t}\n\n\t\tasync function move(index) {\n\t\t\tconst row = rows()[Math.max(0, Math.min(rows().length - 1, index))];\n\n\t\t\tif (!row) return;\n\n\t\t\tselected = row.id;\n\n\t\t\tif (virtual()) {\n\t\t\t\tscrollTop = Math.max(0, offsets()[index] - 100);\n\n\t\t\t\tif (list) window.scrollTo({\n\t\t\t\t\ttop: list.getBoundingClientRect().top + window.scrollY + scrollTop\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tawait tick();\n\t\t\tlist?.querySelector(`[data-order=\"${index}\"] a`)?.focus({ preventScroll: true });\n\t\t}\n\n\t\tfunction keyboard(event) {\n\t\t\tif (event.isComposing || event.altKey || event.ctrlKey || event.metaKey) return;\n\n\t\t\tif (globalOpen) {\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tglobalOpen = false;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (timestamp) {\n\t\t\t\tif (event.key === \"Escape\") timestamp = null;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst editable = (/INPUT|TEXTAREA|SELECT/).test(event.target?.tagName ?? \"\");\n\n\t\t\tif (event.key === \"/\" && !editable) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsearchInput?.focus();\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (editable) {\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tquery = \"\";\n\t\t\t\t\tsearchInput?.blur();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Backspace\" && model.parentHref) {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif (location.protocol === \"file:\") location.href = model.parentHref; else openFolder(model.parentDataHref, new URL(model.parentHref, document.baseURI).href, true);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst index = rows().findIndex((row) => row.id === selected);\n\n\t\t\tif ([\"ArrowDown\", \"ArrowUp\", \"Home\", \"End\"].includes(event.key)) {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tmove(event.key === \"Home\"\n\t\t\t\t\t? 0\n\t\t\t\t\t: event.key === \"End\"\n\t\t\t\t\t\t? rows().length - 1\n\t\t\t\t\t\t: index + (event.key === \"ArrowDown\" ? 1 : -1));\n\t\t\t}\n\t\t}\n\n\t\tfunction updateScheme(value) {\n\t\t\tscheme = value;\n\n\t\t\ttry {\n\t\t\t\tlocalStorage.setItem(\"dirwell-color-scheme\", value);\n\t\t\t} catch {}\n\t\t}\n\n\t\tasync function searchArchive() {\n\t\t\tconst token = ++archiveRequest;\n\n\t\t\tarchiveAbort?.abort();\n\n\t\t\tconst local = archiveAbort = new AbortController();\n\n\t\t\tglobalRows = [];\n\n\t\t\tconst query = globalQuery.trim();\n\n\t\t\tif (!query) {\n\t\t\t\tglobalStatus = \"Enter a search to begin.\";\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tglobalStatus = \"Searching archive…\";\n\n\t\t\ttry {\n\t\t\t\tconst url = new URL(model.searchIndexHref, document.baseURI);\n\t\t\t\tconst response = await fetch(url, { signal: local.signal });\n\n\t\t\t\tif (!response.ok) throw new Error(\"Unavailable archive\");\n\n\t\t\t\tconst index = await response.json();\n\n\t\t\t\tif (index.version !== 3 || !Array.isArray(index.shards) || !Number.isSafeInteger(index.count) || index.count > 100000) throw new Error(\"Unsupported archive\");\n\n\t\t\t\tconst all = [];\n\n\t\t\t\tfor (const shard of index.shards) {\n\t\t\t\t\tif (typeof shard !== \"string\") throw new Error(\"Invalid shard\");\n\n\t\t\t\t\tconst shardUrl = new URL(shard, url);\n\n\t\t\t\t\tif (shardUrl.origin !== url.origin) throw new Error(\"Unsafe shard\");\n\n\t\t\t\t\tconst chunk = await fetch(shardUrl, { signal: local.signal });\n\n\t\t\t\t\tif (!chunk.ok) throw new Error(\"Unavailable shard\");\n\n\t\t\t\t\tconst data = await chunk.json();\n\n\t\t\t\t\tif (!Array.isArray(data.entries) || all.length + data.entries.length > 100000) throw new Error(\"Invalid archive\");\n\n\t\t\t\t\tfor (const record of data.entries) {\n\t\t\t\t\t\tif (typeof record.name !== \"string\" || typeof record.path !== \"string\" || typeof record.exitsExplorer !== \"boolean\") throw new Error(\"Invalid archive record\");\n\n\t\t\t\t\t\tconst href = record.href === null ? null : new URL(record.href, url);\n\n\t\t\t\t\t\tif (href && ![\"http:\", \"https:\"].includes(href.protocol)) throw new Error(\"Unsupported archive link\");\n\n\t\t\t\t\t\tall.push({\n\t\t\t\t\t\t\tname: record.name,\n\t\t\t\t\t\t\tpath: record.path,\n\t\t\t\t\t\t\thref: href?.href ?? null,\n\t\t\t\t\t\t\texitsExplorer: record.exitsExplorer\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst matches = all.map((record) => ({ record, score: fuzzy(query, record.name + \" \" + record.path) })).filter((item) => item.score !== null).sort((a, b) => b.score - a.score || a.record.path.localeCompare(b.record.path));\n\n\t\t\t\tif (token !== archiveRequest || local.signal.aborted) return;\n\n\t\t\t\tglobalRows = matches.slice(0, 100).map((item) => item.record);\n\n\t\t\t\tglobalStatus = matches.length > 100\n\t\t\t\t\t? \"Showing 100 of \" + matches.length + \" results\"\n\t\t\t\t\t: matches.length + \" results\";\n\t\t\t} catch {\n\t\t\t\tif (token === archiveRequest && !local.signal.aborted) globalStatus = \"Could not load archive search. Try again.\";\n\t\t\t}\n\t\t}\n\n\t\tonMount(() => {\n\t\t\tready = true;\n\t\t\tabort = new AbortController();\n\n\t\t\ttry {\n\t\t\t\tconst stored = localStorage.getItem(\"dirwell-color-scheme\");\n\n\t\t\t\tif ([\"system\", \"light\", \"dark\"].includes(stored)) scheme = stored;\n\t\t\t} catch {}\n\n\t\t\thistory.replaceState({ dataHref: new URL(model.dataHref, document.baseURI).href }, \"\");\n\n\t\t\tconst onPop = (event) => {\n\t\t\t\tif (event.state?.dataHref) openFolder(event.state.dataHref, location.href, false); else location.reload();\n\t\t\t};\n\n\t\t\twindow.addEventListener(\"popstate\", onPop);\n\t\t\thydrateData();\n\n\t\t\treturn () => {\n\t\t\t\tabort?.abort();\n\t\t\t\tarchiveAbort?.abort();\n\t\t\t\twindow.removeEventListener(\"popstate\", onPop);\n\t\t\t};\n\t\t});\n\n\t\t$$renderer.push(`<header class=\"page-header\"><div class=\"wordmark\">`);\n\n\t\tif (header) {\n\t\t\t$$renderer.push('<!--[0-->');\n\t\t\theader($$renderer, { model });\n\t\t\t$$renderer.push(`<!---->`);\n\t\t} else {\n\t\t\t$$renderer.push(`<!--[-1--><h1>${$.escape(model.title)}</h1> <span>File archive</span>`);\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></div> <nav aria-label=\"Breadcrumb\"><a${$.attr('href', model.rootHref)}>Home</a><!--[-->`);\n\n\t\tconst each_array = $.ensure_array_like(model.breadcrumbs);\n\n\t\tfor (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {\n\t\t\tlet crumb = each_array[$$index];\n\n\t\t\t$$renderer.push(`<!---->/ <a${$.attr('href', crumb.href)}>${$.escape(crumb.name)}</a>`);\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></nav></header> <main data-explorer=\"\" data-framework=\"svelte\"${$.attr('aria-busy', busy)}><div class=\"toolbar\"><label class=\"search-field\">Search this directory<input type=\"search\" placeholder=\"Search files\"${$.attr('value', query)}${$.attr('disabled', !ready || !complete(), true)}/></label> <fieldset${$.attr('disabled', !ready || !complete(), true)}><legend>Types</legend><!--[-->`);\n\n\t\tconst each_array_1 = $.ensure_array_like([\"directory\", \"file\", \"link\"]);\n\n\t\tfor (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {\n\t\t\tlet type = each_array_1[$$index_1];\n\n\t\t\t$$renderer.push(`<label><input type=\"checkbox\"${$.attr('checked', types.includes(type), true)}/>${$.escape(type)}</label>`);\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></fieldset> <label>Sort`);\n\n\t\t$$renderer.select(\n\t\t\t{\n\t\t\t\tvalue: sort.field,\n\t\t\t\tdisabled: !ready || !complete(),\n\t\t\t\tonchange: (event) => sort = { ...sort, field: event.currentTarget.value }\n\t\t\t},\n\t\t\t($$renderer) => {\n\t\t\t\t$$renderer.option({ value: 'name' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Name`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'size' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Size`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'modified' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Modified`);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t$$renderer.push(`</label> <label>Names`);\n\n\t\t$$renderer.select(\n\t\t\t{\n\t\t\t\tvalue: sort.nameMode,\n\t\t\t\tdisabled: !ready || !complete(),\n\t\t\t\tonchange: (event) => sort = { ...sort, nameMode: event.currentTarget.value }\n\t\t\t},\n\t\t\t($$renderer) => {\n\t\t\t\t$$renderer.option({ value: 'natural' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Natural`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'locale' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Locale`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'unicode' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Unicode`);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t$$renderer.push(`</label> <label>Order`);\n\n\t\t$$renderer.select(\n\t\t\t{\n\t\t\t\tvalue: sort.direction,\n\t\t\t\tdisabled: !ready || !complete(),\n\t\t\t\tonchange: (event) => sort = { ...sort, direction: event.currentTarget.value }\n\t\t\t},\n\t\t\t($$renderer) => {\n\t\t\t\t$$renderer.option({ value: 'asc' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Ascending`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'desc' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Descending`);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t$$renderer.push(`</label> <label><input type=\"checkbox\"${$.attr('checked', sort.directoriesFirst, true)}${$.attr('disabled', !ready || !complete(), true)}/>Folders first</label> <label>Appearance`);\n\n\t\t$$renderer.select(\n\t\t\t{\n\t\t\t\tvalue: scheme,\n\t\t\t\tdisabled: !ready,\n\t\t\t\tonchange: (event) => updateScheme(event.currentTarget.value)\n\t\t\t},\n\t\t\t($$renderer) => {\n\t\t\t\t$$renderer.option({ value: 'system' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`System`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'light' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Light`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'dark' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Dark`);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t$$renderer.push(`</label> <button${$.attr('disabled', !ready || !model.searchIndexHref, true)}>Search archive</button></div> <section class=\"listing-card\"><div class=\"listing-summary\"><span data-visible-count=\"\">${$.escape(complete() ? rows().length : entries.length)}</span> entries`);\n\n\t\tif (!complete()) {\n\t\t\t$$renderer.push(`<!--[0-->on this page · ${$.escape(model.total)} in directory`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--><span role=\"status\" aria-live=\"polite\">${$.escape(busy ? \"Loading…\" : error)}</span></div> <div class=\"entry-head\"><span>Name</span><span>Size</span><span>Modified</span></div> <ul class=\"entry-list\">`);\n\n\t\tif (model.parentHref) {\n\t\t\t$$renderer.push(`<!--[0--><li class=\"entry\"><a${$.attr('href', model.parentHref)}>../</a></li>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--> `);\n\n\t\tif (start()) {\n\t\t\t$$renderer.push(`<!--[0--><li aria-hidden=\"true\"${$.attr_style('', { height: offsets()[start()] + \"px\" })}></li>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--> <!--[-->`);\n\n\t\tconst each_array_2 = $.ensure_array_like(rows().slice(start(), end()));\n\n\t\tfor (let index = 0, $$length = each_array_2.length; index < $$length; index++) {\n\t\t\tlet entry = each_array_2[index];\n\n\t\t\t$$renderer.push(`<li class=\"entry\" data-entry=\"\"${$.attr('data-id', entry.id)}${$.attr('data-order', start() + index)}${$.attr('data-active', selected === entry.id)}><span class=\"identity\">`);\n\n\t\t\tif (entry.href) {\n\t\t\t\t$$renderer.push(`<!--[0--><a class=\"name\"${$.attr('href', safeHref(entry))}${$.attr('target', entry.exitsExplorer ? \"_blank\" : undefined)}${$.attr('rel', entry.exitsExplorer ? \"noopener\" : undefined)}>`);\n\n\t\t\t\tif (row) {\n\t\t\t\t\t$$renderer.push('<!--[0-->');\n\t\t\t\t\trow($$renderer, { model, entry, selected: selected === entry.id });\n\t\t\t\t\t$$renderer.push(`<!---->`);\n\t\t\t\t} else {\n\t\t\t\t\t$$renderer.push(`<!--[-1--><span class=\"file-icon\" aria-hidden=\"true\">${$.html(entryIcon(entryType(entry)))}</span> ${$.escape(entry.name)}${$.escape(isDirectory(entry) ? \"/\" : \"\")}`);\n\t\t\t\t}\n\n\t\t\t\t$$renderer.push(`<!--]--></a>`);\n\t\t\t} else {\n\t\t\t\t$$renderer.push(`<!--[-1--><span>`);\n\n\t\t\t\tif (row) {\n\t\t\t\t\t$$renderer.push('<!--[0-->');\n\t\t\t\t\trow($$renderer, { model, entry, selected: selected === entry.id });\n\t\t\t\t\t$$renderer.push(`<!---->`);\n\t\t\t\t} else {\n\t\t\t\t\t$$renderer.push(`<!--[-1-->${$.escape(entry.name)}`);\n\t\t\t\t}\n\n\t\t\t\t$$renderer.push(`<!--]--></span>`);\n\t\t\t}\n\n\t\t\t$$renderer.push(`<!--]-->`);\n\n\t\t\tif (entry.link) {\n\t\t\t\t$$renderer.push(`<!--[0--><small class=\"target\">${$.escape(entry.link.unavailable ? \"Target unavailable · \" : \"→ \")}${$.escape(entry.link.target)}</small>`);\n\t\t\t} else {\n\t\t\t\t$$renderer.push('<!--[-1-->');\n\t\t\t}\n\n\t\t\t$$renderer.push(`<!--]--></span> <span class=\"kind\">${$.escape(isDirectory(entry) ? \"Folder\" : size(entry.size))}</span> <button class=\"timestamp-button\"${$.attr('disabled', !ready, true)}><time${$.attr('datetime', entry.modifiedAt)}>${$.escape(modified(entry.modifiedAt, ready))}</time></button></li>`);\n\t\t}\n\n\t\t$$renderer.push(`<!--]--> `);\n\n\t\tif (end() < rows().length) {\n\t\t\t$$renderer.push(`<!--[0--><li aria-hidden=\"true\"${$.attr_style('', { height: offsets()[rows().length] - offsets()[end()] + \"px\" })}></li>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></ul> `);\n\n\t\tif (rows().length === 0) {\n\t\t\t$$renderer.push(`<!--[0--><p>No matching entries.</p>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></section> `);\n\n\t\tif (model.page?.count > 1 && !complete()) {\n\t\t\t$$renderer.push(`<!--[0--><nav aria-label=\"Pagination\">`);\n\n\t\t\tif (model.page.previousHref) {\n\t\t\t\t$$renderer.push(`<!--[0--><a rel=\"prev\"${$.attr('href', model.page.previousHref)}>Previous</a>`);\n\t\t\t} else {\n\t\t\t\t$$renderer.push('<!--[-1-->');\n\t\t\t}\n\n\t\t\t$$renderer.push(`<!--]--> Page ${$.escape(model.page.number)} of ${$.escape(model.page.count)} `);\n\n\t\t\tif (model.page.nextHref) {\n\t\t\t\t$$renderer.push(`<!--[0--><a rel=\"next\"${$.attr('href', model.page.nextHref)}>Next</a>`);\n\t\t\t} else {\n\t\t\t\t$$renderer.push('<!--[-1-->');\n\t\t\t}\n\n\t\t\t$$renderer.push(`<!--]--></nav>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--> `);\n\n\t\tif (footer) {\n\t\t\t$$renderer.push('<!--[0-->');\n\t\t\tfooter($$renderer, { model });\n\t\t\t$$renderer.push(`<!---->`);\n\t\t} else {\n\t\t\t$$renderer.push(`<!--[-1--><p class=\"keyboard-help\">Arrow keys select files · Home / End jump · / searches · Backspace opens\n parent</p>`);\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></main> `);\n\n\t\tif (timestamp) {\n\t\t\t$$renderer.push(`<!--[0--><dialog><h2>Modified time</h2> <p>${$.escape(timestamp)}</p> <p>${$.escape(new Date(timestamp).toLocaleString())}</p> <button>Close</button></dialog>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--> `);\n\n\t\tif (globalOpen) {\n\t\t\t$$renderer.push(`<!--[0--><dialog><h2>Search archive</h2> <input aria-label=\"Search archive files\" type=\"search\"${$.attr('value', globalQuery)}/> <p role=\"status\">${$.escape(globalStatus)}</p> <ul><!--[-->`);\n\n\t\t\tconst each_array_3 = $.ensure_array_like(globalRows);\n\n\t\t\tfor (let $$index_3 = 0, $$length = each_array_3.length; $$index_3 < $$length; $$index_3++) {\n\t\t\t\tlet record = each_array_3[$$index_3];\n\n\t\t\t\t$$renderer.push(`<li>`);\n\n\t\t\t\tif (record.href) {\n\t\t\t\t\t$$renderer.push(`<!--[0--><a${$.attr('href', record.href)}${$.attr('target', record.exitsExplorer ? \"_blank\" : undefined)}${$.attr('rel', record.exitsExplorer ? \"noopener\" : undefined)}>${$.escape(record.path)}</a>`);\n\t\t\t\t} else {\n\t\t\t\t\t$$renderer.push(`<!--[-1-->${$.escape(record.path)}`);\n\t\t\t\t}\n\n\t\t\t\t$$renderer.push(`<!--]--></li>`);\n\t\t\t}\n\n\t\t\t$$renderer.push(`<!--]--></ul> <button>Close</button></dialog>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]-->`);\n\t});\n}","import {render} from 'svelte/server';import App from './.generated/App-server.mjs';export const renderBody=model=>render(App,{props:{model}}).body;","import { readFile } from \"node:fs/promises\";\nimport { createHash } from \"node:crypto\";\nimport { escapeHtml } from \"@dirwell/core\";\nimport type { ExplorerTheme } from \"@dirwell/core\";\nimport { createThemePage, folderDataHref, pageAsset } from \"../../shared-theme/src/page.ts\";\n// Generated server component is paired with the separately compiled browser component.\nimport type { FrameworkRenderer } from \"./model.ts\";\nexport type { FrameworkRenderer, ThemePage } from \"./model.ts\";\nimport { renderBody } from \"../render-generated.mjs\";\nexport interface LedgerThemeOptions {\n readonly title?: string;\n}\nexport function createLedgerTheme(\n options: LedgerThemeOptions = {},\n renderer?: FrameworkRenderer,\n): ExplorerTheme {\n const theme: ExplorerTheme = {\n name: \"ledger\",\n listing: { pagination: true },\n entryData: (entry, context) => ({ folderDataHref: folderDataHref(entry, context, \"ledger\") }),\n async render(context) {\n const model = {\n ...createThemePage(context, theme, options.title ?? \"Dirwell\"),\n searchIndexHref: context.searchIndexHref,\n };\n const script =\n renderer?.clientScript ?? (await readFile(new URL(\"./client.js\", import.meta.url), \"utf8\"));\n const scriptName = `ledger-client-${createHash(\"sha256\").update(script).digest(\"hex\").slice(0, 16)}.js`;\n const styles = await readFile(new URL(\"./styles.css\", import.meta.url), \"utf8\");\n const json = JSON.stringify(model).replaceAll(\"<\", \"\\\\u003c\");\n return {\n html: `<!doctype html><html lang=\"en\" data-theme=\"system\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">${context.documentBaseHref === null ? \"\" : `<base href=\"${escapeHtml(context.documentBaseHref)}\">`}${context.metadata?.head ?? `<title>${escapeHtml(model.title)}</title>`}<style>${styles}${renderer?.styles ?? \"\"}</style></head><body><div data-dirwell-theme=\"ledger\">${await (renderer?.renderBody ?? renderBody)(model)}</div><script type=\"application/json\" id=\"dirwell-page-data\">${json}</script><script ${renderer?.clientType === \"module\" ? 'type=\"module\"' : \"defer\"} src=\"${escapeHtml(context.assetHref(scriptName))}\"></script></body></html>`,\n assets: {\n [scriptName]: script,\n [pageAsset(\"ledger\", model.path, model.page?.number ?? 1)]: JSON.stringify(model),\n },\n };\n },\n };\n return theme;\n}\n"],"mappings":";;;;;;;;;AAkCA,MAAa,aAAa,OAAe,WAAmB,OAAO,MACjE,GAAG,MAAM,QAAQ,WAAW,QAAQ,CAAC,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE,EAAE,GAAG,KAAK;AAC7F,SAAgB,eACd,OACA,SACA,OACe;CACf,IACE,MAAM,iBACN,MAAM,SAAS,QACf,EAAE,MAAM,SAAS,eAAe,MAAM,MAAM,eAAe,cAE3D,OAAO;CACT,MAAM,OAAO;CACb,MAAM,OAAO,IAAI,IACf,QAAQ,oBAAoB,GAAG,QAAQ,gBAAgB,QAAQ,gBAAgB,MAAM,MACrF,IACF;CACA,MAAM,OAAO,IAAI,IAAI,QAAQ,iBAAiB,EAAE,GAAG,IAAI;CACvD,MAAM,SAAS,IAAI,IAAI,MAAM,MAAM,IAAI;CACvC,MAAM,WAAW,KAAK,SAAS,SAAS,GAAG,IACvC,KAAK,WACL,KAAK,SAAS,MAAM,GAAG,KAAK,SAAS,YAAY,GAAG,IAAI,CAAC;CAC7D,MAAM,gBAAgB,OAAO,SAAS,SAAS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M,aAAa,iBAAiB,WAAW,QAAQ,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE,EAAE;GACnG,MAAM,SAAS,MAAM,SAAS,IAAI,IAAI,gBAAgB,YAAY,GAAG,GAAG,MAAM;GAC9E,MAAM,OAAO,KAAK,UAAU,KAAK,CAAC,CAAC,WAAW,KAAK,SAAS;GAC5D,OAAO;IACL,MAAM,qJAAqJ,QAAQ,qBAAqB,OAAO,KAAK,eAAe,WAAW,QAAQ,gBAAgB,EAAE,MAAM,QAAQ,UAAU,QAAQ,UAAU,WAAW,MAAM,KAAK,EAAE,UAAU,SAAS,SAAS,UAAU,UAAU,GAAG,wDAAwD,OAAO,UAAU,cAAc,WAAA,CAAY,KAAK,EAAE,+DAA+D,KAAK,oBAAmB,UAAU,eAAe,WAAW,oBAAkB,QAAQ,QAAQ,WAAW,QAAQ,UAAU,UAAU,CAAC,EAAE;IAC9pB,QAAQ;MACL,aAAa;MACb,UAAU,UAAU,MAAM,MAAM,MAAM,MAAM,UAAU,CAAC,IAAI,KAAK,UAAU,KAAK;IAClF;GACF;EACF;CACF;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"index.mjs","names":["App"],"sources":["../../shared-theme/src/page.ts","../../shared-theme/src/icons.ts","../../shared-theme/src/navigation.ts","../../shared-theme/src/records.ts","../.generated/App-server.mjs","../render-generated.mjs","../src/index.ts"],"sourcesContent":["import path from \"node:path\";\nimport { createHash } from \"node:crypto\";\nimport { projectListingEntry, copyJsonObject } from \"@dirwell/core\";\nimport type {\n ListingEntry,\n ThemeContext,\n ListingPage,\n SortOptions,\n ExplorerTheme,\n} from \"@dirwell/core\";\nexport interface ThemePage {\n readonly version: 1;\n readonly theme: string;\n readonly title: string;\n readonly metadataHead?: string;\n readonly path: string;\n readonly rootHref: string;\n readonly parentHref: string | null;\n readonly parentDataHref: string | null;\n readonly rootDataHref: string;\n readonly dataHref: string;\n readonly manifestHref: string | null;\n readonly listingRevision?: string;\n readonly updatesHref: string | null;\n readonly total: number;\n readonly entries: readonly ListingEntry[];\n readonly sort: Required<SortOptions>;\n readonly page: ListingPage | null;\n readonly breadcrumbs: readonly {\n readonly name: string;\n readonly href: string;\n readonly dataHref: string;\n }[];\n}\nexport const pageAsset = (theme: string, directory: string, page = 1) =>\n `${theme}-page-${createHash(\"sha256\").update(directory).digest(\"hex\").slice(0, 24)}-${page}.json`;\nexport function folderDataHref(\n entry: ListingEntry,\n context: Parameters<NonNullable<ExplorerTheme[\"entryData\"]>>[1],\n theme: string,\n): string | null {\n if (\n entry.exitsExplorer ||\n entry.href === null ||\n !(entry.kind === \"directory\" || entry.link?.targetKind === \"directory\")\n )\n return null;\n const fake = \"https://dirwell.invalid/\";\n const base = new URL(\n context.documentBaseHref ?? `${context.directoryPath ? context.directoryPath + \"/\" : \"\"}`,\n fake,\n );\n const root = new URL(context.hrefForDirectory(\"\"), base);\n const target = new URL(entry.href, base);\n const rootPath = root.pathname.endsWith(\"/\")\n ? root.pathname\n : root.pathname.slice(0, root.pathname.lastIndexOf(\"/\") + 1);\n const directoryPath = target.pathname.endsWith(\"/\")\n ? target.pathname\n : target.pathname.slice(0, target.pathname.lastIndexOf(\"/\") + 1);\n const logical = directoryPath\n .slice(rootPath.length)\n .split(\"/\")\n .filter(Boolean)\n .map(decodeURIComponent)\n .join(\"/\");\n const filename = pageAsset(theme, logical);\n if (context.pageDataHref !== undefined) return context.pageDataHref(theme, logical, 1);\n if (context.mode === \"mpa\") return context.assetHref(filename);\n const href = new URL(filename, new URL(directoryPath, target));\n if (href.origin !== new URL(fake).origin) return href.href;\n if (context.documentBaseHref === null && !entry.href.startsWith(\"/\")) {\n return path.posix\n .relative(context.directoryPath || \".\", path.posix.join(logical, filename))\n .split(\"/\")\n .map((segment) =>\n segment === \"..\" || segment === \".\" ? segment : encodeURIComponent(segment),\n )\n .join(\"/\");\n }\n return href.pathname;\n}\nexport function createThemePage(\n context: ThemeContext,\n theme: ExplorerTheme,\n title: string,\n): ThemePage {\n const directoryPath = context.directory.current.relativePath;\n const safeContext = {\n ...(context.pageDataHref === undefined ? {} : { pageDataHref: context.pageDataHref }),\n mode: context.mode,\n outputName: context.outputName,\n assetHref: context.assetHref,\n hrefForDirectory: context.hrefForDirectory,\n documentBaseHref: context.documentBaseHref,\n directoryPath,\n };\n const dataForDirectory = (logicalPath: string) =>\n folderDataHref(\n {\n id: logicalPath,\n name: logicalPath,\n kind: \"directory\",\n href: context.hrefForDirectory(logicalPath),\n exitsExplorer: false,\n size: 0,\n modifiedAt: \"\",\n link: null,\n },\n safeContext,\n theme.name,\n )!;\n const entries = context.directory.entries.map((entry) => {\n const record = projectListingEntry(entry, context);\n return theme.entryData === undefined\n ? record\n : { ...record, presentation: copyJsonObject(theme.entryData(record, safeContext)) };\n });\n return {\n version: 1,\n ...(context.metadata === undefined ? {} : { metadataHead: context.metadata.head }),\n theme: theme.name,\n title: context.metadata?.title ?? (directoryPath ? `${directoryPath} · ${title}` : title),\n path: directoryPath,\n rootHref: context.hrefForDirectory(\"\"),\n parentHref:\n context.directory.parent === null\n ? null\n : context.hrefForDirectory(context.directory.parent.relativePath),\n rootDataHref: dataForDirectory(\"\"),\n parentDataHref:\n context.directory.parent === null\n ? null\n : dataForDirectory(context.directory.parent.relativePath),\n dataHref:\n context.pageDataHref?.(theme.name, directoryPath, context.listing?.page.number ?? 1) ??\n context.assetHref(pageAsset(theme.name, directoryPath, context.listing?.page.number ?? 1)),\n manifestHref: context.listing?.manifestHref ?? null,\n ...(context.listing ? { listingRevision: context.listing.revision } : {}),\n updatesHref: context.updatesHref ?? null,\n total: context.listing?.page.total ?? entries.length,\n entries,\n sort: context.sort,\n page: context.listing?.page ?? null,\n breadcrumbs: directoryPath\n .split(\"/\")\n .filter(Boolean)\n .map((name, index) => ({\n name,\n dataHref: dataForDirectory(\n directoryPath\n .split(\"/\")\n .slice(0, index + 1)\n .join(\"/\"),\n ),\n href: context.hrefForDirectory(\n directoryPath\n .split(\"/\")\n .slice(0, index + 1)\n .join(\"/\"),\n ),\n })),\n };\n}\n","const paths = {\n directory: '<path d=\"M3 7V5h6l2 3h10v12H3Z\"/><path d=\"M3 10h18\"/>',\n file: '<path d=\"M5 3h9l5 5v13H5ZM14 3v5h5M8 12h8M8 16h6\"/>',\n link: '<path d=\"m9 15 6-6M8 10l-3 3a4 4 0 0 0 6 6l3-3M10 8l3-3a4 4 0 0 1 6 6l-3 3\"/>',\n};\n/** Fixed authored geometry; source names and paths never enter SVG markup. */\nexport function entryIcon(kind: keyof typeof paths): string {\n return `<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.45\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">${paths[kind]}</svg>`;\n}\n","import { loadListing, parseListingEntries, ListingDataError } from \"@dirwell/core/client\";\n\n/** Folder snapshots resolve relative URLs before History changes the document URL. */\nexport async function fetchThemePage(\n dataHref: string,\n pageHref: string,\n theme: string,\n signal: AbortSignal,\n fresh = false,\n attempt = 0,\n): Promise<Record<string, unknown>> {\n const source = new URL(dataHref, document.baseURI);\n if (source.origin !== location.origin)\n throw new ListingDataError(\"Folder leaves the theme origin\");\n const response = await fetch(source, { signal, cache: fresh ? \"no-store\" : \"default\" });\n if (!response.ok) throw new ListingDataError(\"Unavailable folder\");\n const value: unknown = await response.json();\n if (typeof value !== \"object\" || value === null || Array.isArray(value))\n throw new ListingDataError(\"Invalid folder snapshot\");\n const data = value as Record<string, unknown>;\n if (\n data.version !== 1 ||\n data.theme !== theme ||\n typeof data.title !== \"string\" ||\n typeof data.path !== \"string\" ||\n !Number.isSafeInteger(data.total) ||\n Number(data.total) < 0 ||\n !Array.isArray(data.breadcrumbs)\n )\n throw new ListingDataError(\"Unsupported folder snapshot\");\n if (data.metadataHead !== undefined && typeof data.metadataHead !== \"string\")\n throw new ListingDataError(\"Invalid folder metadata\");\n const base = document.querySelector(\"base\")?.href ?? pageHref;\n const link = (raw: unknown): string | null => {\n if (raw === null) return null;\n if (typeof raw !== \"string\") throw new ListingDataError(\"Invalid folder link\");\n const url = new URL(raw, base);\n if (![\"http:\", \"https:\"].includes(url.protocol) || url.origin !== location.origin)\n throw new ListingDataError(\"Unsupported folder link\");\n return url.href;\n };\n const entries = parseListingEntries(data.entries, base).map((entry) => ({\n ...entry,\n ...(entry.presentation\n ? {\n presentation: {\n ...entry.presentation,\n folderDataHref: link(entry.presentation.folderDataHref ?? null),\n },\n }\n : {}),\n }));\n if (entries.length > Number(data.total)) throw new ListingDataError(\"Invalid folder count\");\n const result = {\n ...data,\n updatesHref: link(data.updatesHref ?? null),\n entries,\n dataHref: source.href,\n manifestHref: link(data.manifestHref),\n rootHref: link(data.rootHref),\n rootDataHref: link(data.rootDataHref),\n parentHref: link(data.parentHref),\n parentDataHref: link(data.parentDataHref),\n breadcrumbs: data.breadcrumbs.map((raw) => {\n if (\n typeof raw !== \"object\" ||\n raw === null ||\n !(\"name\" in raw) ||\n !(\"href\" in raw) ||\n !(\"dataHref\" in raw) ||\n typeof raw.name !== \"string\"\n )\n throw new ListingDataError(\"Invalid breadcrumb\");\n return { name: raw.name, href: link(raw.href), dataHref: link(raw.dataHref) };\n }),\n };\n // Keep the current UI until independently fetched page and listing revisions agree.\n if (fresh && result.manifestHref) {\n const loaded = await loadListing(result.manifestHref, { signal, cache: \"no-store\" });\n if (\n loaded.manifest.total !== data.total ||\n (data.listingRevision !== undefined && loaded.manifest.revision !== data.listingRevision)\n ) {\n if (attempt < 2) return fetchThemePage(dataHref, pageHref, theme, signal, true, attempt + 1);\n throw new ListingDataError(\"Folder changed while refreshing\");\n }\n result.entries = [...loaded.entries];\n }\n return result;\n}\n\n// HMR can remount a wrapper while the outer explorer root stays mounted.\n// Keep only its current public model; production imports never register roots.\nconst hotModels = new WeakMap<Element, Record<string, unknown>>();\nexport function restoreThemePage(\n initial: Record<string, unknown>,\n hot: boolean,\n): Record<string, unknown> {\n if (!hot || typeof document === \"undefined\") return initial;\n const root = document.querySelector(\"[data-dirwell-theme]\");\n if (!root) return initial;\n const snapshot = hotModels.get(root) ?? initial;\n hotModels.set(root, snapshot);\n return snapshot;\n}\n\n/** Copy only inert metadata elements; never insert snapshot HTML or event attributes. */\nexport function applyThemeMetadata(page: Record<string, unknown>, pageHref: string): void {\n const root = document.querySelector(\"[data-dirwell-theme]\");\n if (root && hotModels.has(root)) hotModels.set(root, page);\n document.title = typeof page.title === \"string\" ? page.title : \"\";\n const template = document.createElement(\"template\");\n template.innerHTML = typeof page.metadataHead === \"string\" ? page.metadataHead : \"\";\n document.head.querySelectorAll(\"[data-dirwell-metadata]\").forEach((element) => element.remove());\n const base = document.querySelector(\"base\")?.href ?? pageHref;\n const url = (value: string): string | null => {\n try {\n const target = new URL(value, base);\n return [\"http:\", \"https:\"].includes(target.protocol) ? target.href : null;\n } catch {\n return null;\n }\n };\n for (const element of template.content.children) {\n if (!element.hasAttribute(\"data-dirwell-metadata\")) continue;\n let next: HTMLElement;\n if (element.tagName === \"META\") {\n const attribute = element.hasAttribute(\"property\") ? \"property\" : \"name\";\n const key = element.getAttribute(attribute) ?? \"\";\n if (!/^(?:description|og:[a-z_:]+|twitter:[a-z_:]+)$/i.test(key)) continue;\n let content = element.getAttribute(\"content\") ?? \"\";\n if ([\"og:image\", \"og:url\", \"twitter:image\"].includes(key)) {\n const resolved = url(content);\n if (resolved === null) continue;\n content = resolved;\n }\n next = document.createElement(\"meta\");\n next.setAttribute(attribute, key);\n next.setAttribute(\"content\", content);\n } else if (element.tagName === \"LINK\" && element.getAttribute(\"rel\") === \"canonical\") {\n const href = url(element.getAttribute(\"href\") ?? \"\");\n if (href === null) continue;\n next = document.createElement(\"link\");\n next.setAttribute(\"rel\", \"canonical\");\n next.setAttribute(\"href\", href);\n } else continue;\n next.setAttribute(\"data-dirwell-metadata\", \"\");\n document.head.append(next);\n }\n}\n","import type { ListingEntry, SortOptions } from \"@dirwell/core\";\nexport const directoryLike = (entry: ListingEntry) =>\n entry.kind === \"directory\" || entry.link?.targetKind === \"directory\";\nexport const entryType = (entry: ListingEntry) =>\n entry.kind === \"symlink\" ? \"link\" : directoryLike(entry) ? \"directory\" : \"file\";\nexport function fuzzy(query: string, value: string): number | null {\n let score = 0,\n start = 0,\n last = -2;\n for (const character of query.trim().toLocaleLowerCase()) {\n const index = value.toLocaleLowerCase().indexOf(character, start);\n if (index < 0) return null;\n if (index === last + 1) score += 8;\n if (index === 0 || /[\\s/_.-]/.test(value[index - 1] ?? \"\")) score += 5;\n score += Math.max(0, 4 - index * 0.05);\n last = index;\n start = index + 1;\n }\n return score - value.length * 0.01;\n}\nexport function visibleRecords(\n entries: readonly ListingEntry[],\n query: string,\n types: readonly string[],\n sort: Required<SortOptions>,\n): ListingEntry[] {\n return entries\n .map((entry) => ({ entry, score: fuzzy(query, `${entry.name} ${entry.link?.target ?? \"\"}`) }))\n .filter((item) => types.includes(entryType(item.entry)) && item.score !== null)\n .sort((left, right) => {\n if (query.trim() && left.score !== right.score) return (right.score ?? 0) - (left.score ?? 0);\n const a = left.entry,\n b = right.entry;\n if (sort.directoriesFirst && directoryLike(a) !== directoryLike(b))\n return directoryLike(a) ? -1 : 1;\n const name = () =>\n sort.nameMode === \"unicode\"\n ? compareUnicode(a.name, b.name)\n : a.name.localeCompare(b.name, undefined, {\n numeric: sort.nameMode === \"natural\",\n sensitivity: \"base\",\n });\n const primary =\n (sort.field === \"name\"\n ? name()\n : sort.field === \"size\"\n ? (a.kind === \"directory\" ? 0 : a.size) - (b.kind === \"directory\" ? 0 : b.size)\n : a.modifiedAt.localeCompare(b.modifiedAt)) || name();\n return (sort.direction === \"asc\" ? primary : -primary) || compareUnicode(a.id, b.id);\n })\n .map((item) => item.entry);\n}\nfunction compareUnicode(left: string, right: string): number {\n const a = [...left],\n b = [...right];\n for (let i = 0; i < Math.min(a.length, b.length); i++) {\n const delta = (a[i]?.codePointAt(0) ?? 0) - (b[i]?.codePointAt(0) ?? 0);\n if (delta) return delta;\n }\n return a.length - b.length;\n}\nexport function size(bytes: number): string {\n const units = [\"B\", \"KiB\", \"MiB\", \"GiB\", \"TiB\"];\n let value = bytes,\n index = 0;\n while (value >= 1024 && index < 4) {\n value /= 1024;\n index++;\n }\n return `${value.toFixed(index === 0 || value >= 100 ? 0 : 1)} ${units[index]}`;\n}\nexport function modified(value: string, local = false): string {\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) return \"Unknown\";\n return local\n ? date.toLocaleString(undefined, { dateStyle: \"short\", timeStyle: \"short\" })\n : `${date.toISOString().slice(0, 16).replace(\"T\", \" \")} UTC`;\n}\n","import * as $ from 'svelte/internal/server';\nimport { onMount, tick, untrack } from \"svelte\";\nimport { entryIcon } from \"../../shared-theme/src/icons.ts\";\nimport { loadListing } from \"@dirwell/core/client\";\nimport { fetchThemePage, applyThemeMetadata, restoreThemePage } from \"../../shared-theme/src/navigation.ts\";\n\nimport {\n\tvisibleRecords,\n\tdirectoryLike,\n\tentryType,\n\tsize,\n\tmodified,\n\tfuzzy\n} from \"../../shared-theme/src/records.ts\";\n\nexport default function Ledger($$renderer, $$props) {\n\t$$renderer.component(($$renderer) => {\n\t\tlet { model: initialModel, header, row, footer } = $$props;\n\t\tconst snapshot = untrack(() => restoreThemePage(initialModel, Boolean(import.meta.hot)));\n\t\tlet model = snapshot;\n\t\tlet entries = snapshot.entries;\n\t\tlet query = \"\";\n\t\tlet types = [\"directory\", \"file\", \"link\"];\n\t\tlet sort = snapshot.sort;\n\t\tlet scheme = \"system\";\n\t\tlet selected = null;\n\t\tlet ready = false;\n\t\tlet busy = false;\n\t\tlet error = \"\";\n\t\tlet timestamp = null;\n\t\tlet composing = false;\n\t\tlet scrollTop = 0;\n\t\tlet globalOpen = false;\n\t\tlet globalQuery = \"\";\n\t\tlet globalRows = [];\n\t\tlet globalStatus = \"Enter a search to begin.\";\n\t\tlet pendingUpdates = null;\n\t\tlet heights = new Map();\n\n\t\tlet updatesHref = $.derived(() => ready && model.updatesHref\n\t\t\t? new URL(model.updatesHref, document.baseURI).href\n\t\t\t: null);\n\n\t\tlet complete = $.derived(() => entries.length === model.total);\n\t\tlet rows = $.derived(() => visibleRecords(entries, composing ? \"\" : query, types, sort));\n\t\tlet virtual = $.derived(() => ready && rows().length > 500);\n\n\t\tlet offsets = $.derived(() => {\n\t\t\tconst values = [0];\n\n\t\t\tfor (const entry of rows()) values.push(values.at(-1) + (heights.get(entry.id) ?? 76));\n\n\t\t\treturn values;\n\t\t});\n\n\t\tlet start = $.derived(() => {\n\t\t\tif (!virtual()) return 0;\n\n\t\t\tlet low = 0, high = rows().length;\n\n\t\t\twhile (low < high) {\n\t\t\t\tconst mid = low + high >> 1;\n\n\t\t\t\tif (offsets()[mid + 1] <= scrollTop) low = mid + 1; else high = mid;\n\t\t\t}\n\n\t\t\treturn Math.max(0, low - 5);\n\t\t});\n\n\t\tlet end = $.derived(() => virtual() ? Math.min(rows().length, start() + 35) : rows().length);\n\n\t\tfunction measure(node, id) {\n\t\t\tif (typeof ResizeObserver === \"undefined\") return;\n\n\t\t\tconst observer = new ResizeObserver(() => {\n\t\t\t\tconst value = node.getBoundingClientRect().height;\n\n\t\t\t\tif (value > 0 && heights.get(id) !== value) {\n\t\t\t\t\tconst next = new Map(heights);\n\n\t\t\t\t\tnext.set(id, value);\n\t\t\t\t\theights = next;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tobserver.observe(node);\n\n\t\t\treturn { destroy: () => observer.disconnect() };\n\t\t}\n\n\t\tlet list = void 0;\n\t\tlet searchInput = void 0;\n\t\tlet globalInput = void 0;\n\t\tlet timeDialog = void 0;\n\t\tlet globalDialog = void 0;\n\t\tlet navigation = 0;\n\t\tlet abort;\n\t\tlet archiveAbort;\n\t\tlet archiveRequest = 0;\n\t\tconst isDirectory = directoryLike;\n\n\t\tfunction safeHref(record) {\n\t\t\tif (typeof location !== \"undefined\" && location.protocol === \"file:\" && isDirectory(record) && !record.exitsExplorer && record.href?.endsWith(\"/\")) return record.href + \"index.html\";\n\n\t\t\treturn record.href;\n\t\t}\n\n\t\tasync function hydrateData() {\n\t\t\tif (complete() || !model.manifestHref || location.protocol === \"file:\") return;\n\n\t\t\tconst local = abort, token = navigation;\n\n\t\t\tbusy = true;\n\n\t\t\ttry {\n\t\t\t\tconst loaded = await loadListing(new URL(model.manifestHref, document.baseURI).href, {\n\t\t\t\t\tsignal: local.signal,\n\t\t\t\t\tcache: model.updatesHref ? \"no-store\" : \"default\"\n\t\t\t\t});\n\n\t\t\t\tif (token === navigation && !local.signal.aborted) entries = loaded.entries;\n\t\t\t} catch(cause) {\n\t\t\t\tif (token === navigation && !local.signal.aborted) error = \"Could not load complete directory data. Native page links remain available.\";\n\t\t\t} finally {\n\t\t\t\tif (token === navigation) busy = false;\n\t\t\t}\n\t\t}\n\n\t\tasync function navigate(event, record) {\n\t\t\tconst dataHref = record.presentation?.folderDataHref;\n\n\t\t\tif (record.exitsExplorer || event?.altKey || event?.ctrlKey || event?.metaKey || event?.shiftKey || event?.button > 0 || typeof dataHref !== \"string\" || location.protocol === \"file:\") return;\n\n\t\t\tevent?.preventDefault();\n\t\t\tawait openFolder(dataHref, new URL(record.href, document.baseURI).href, true);\n\t\t}\n\n\t\tasync function openFolder(dataHref, url, push, refresh = false) {\n\t\t\tconst token = ++navigation;\n\n\t\t\tabort?.abort();\n\n\t\t\tconst local = abort = new AbortController();\n\n\t\t\tbusy = true;\n\t\t\terror = \"\";\n\n\t\t\ttry {\n\t\t\t\tconst next = await fetchThemePage(dataHref, url, \"ledger\", local.signal, refresh);\n\t\t\t\tlet nextEntries = next.entries;\n\n\t\t\t\tif (refresh && next.manifestHref && nextEntries.length !== next.total) {\n\t\t\t\t\tnextEntries = (await loadListing(next.manifestHref, { signal: local.signal, cache: \"no-store\" })).entries;\n\t\t\t\t}\n\n\t\t\t\tif (token !== navigation || local.signal.aborted) return;\n\n\t\t\t\tmodel = next;\n\t\t\t\tentries = nextEntries;\n\n\t\t\t\tif (!refresh) {\n\t\t\t\t\tquery = \"\";\n\t\t\t\t\tselected = null;\n\t\t\t\t\tscrollTop = 0;\n\t\t\t\t}\n\n\t\t\t\tif (push) history.pushState({ dataHref: next.dataHref }, \"\", url);\n\n\t\t\t\tapplyThemeMetadata(next, url);\n\t\t\t\tawait hydrateData();\n\n\t\t\t\tif (!refresh) window.scrollTo({ top: 0 });\n\t\t\t} catch(cause) {\n\t\t\t\tif (token === navigation && !local.signal.aborted) error = \"Could not open this folder. Open its native link or try again.\";\n\t\t\t} finally {\n\t\t\t\tif (token === navigation) busy = false;\n\t\t\t}\n\t\t}\n\n\t\tfunction navigateLink(event, href, dataHref) {\n\t\t\tif (event?.altKey || event?.ctrlKey || event?.metaKey || event?.shiftKey || event?.button > 0 || location.protocol === \"file:\") return;\n\n\t\t\tevent?.preventDefault();\n\t\t\topenFolder(dataHref, new URL(href, document.baseURI).href, true);\n\t\t}\n\n\t\tasync function move(index) {\n\t\t\tconst row = rows()[Math.max(0, Math.min(rows().length - 1, index))];\n\n\t\t\tif (!row) return;\n\n\t\t\tselected = row.id;\n\n\t\t\tif (virtual()) {\n\t\t\t\tscrollTop = Math.max(0, offsets()[index] - 100);\n\n\t\t\t\tif (list) window.scrollTo({\n\t\t\t\t\ttop: list.getBoundingClientRect().top + window.scrollY + scrollTop\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tawait tick();\n\t\t\tlist?.querySelector(`[data-order=\"${index}\"] a`)?.focus({ preventScroll: true });\n\t\t}\n\n\t\tfunction keyboard(event) {\n\t\t\tif (event.isComposing || event.altKey || event.ctrlKey || event.metaKey) return;\n\n\t\t\tif (globalOpen) {\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tglobalOpen = false;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (timestamp) {\n\t\t\t\tif (event.key === \"Escape\") timestamp = null;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst editable = (/INPUT|TEXTAREA|SELECT/).test(event.target?.tagName ?? \"\");\n\n\t\t\tif (event.key === \"/\" && !editable) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsearchInput?.focus();\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (editable) {\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tquery = \"\";\n\t\t\t\t\tsearchInput?.blur();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Backspace\" && model.parentHref) {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif (location.protocol === \"file:\") location.href = model.parentHref; else openFolder(model.parentDataHref, new URL(model.parentHref, document.baseURI).href, true);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst index = rows().findIndex((row) => row.id === selected);\n\n\t\t\tif ([\"ArrowDown\", \"ArrowUp\", \"Home\", \"End\"].includes(event.key)) {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tmove(event.key === \"Home\"\n\t\t\t\t\t? 0\n\t\t\t\t\t: event.key === \"End\"\n\t\t\t\t\t\t? rows().length - 1\n\t\t\t\t\t\t: index + (event.key === \"ArrowDown\" ? 1 : -1));\n\t\t\t}\n\t\t}\n\n\t\tfunction updateScheme(value) {\n\t\t\tscheme = value;\n\n\t\t\ttry {\n\t\t\t\tlocalStorage.setItem(\"dirwell-color-scheme\", value);\n\t\t\t} catch {}\n\t\t}\n\n\t\tasync function searchArchive() {\n\t\t\tconst token = ++archiveRequest;\n\n\t\t\tarchiveAbort?.abort();\n\n\t\t\tconst local = archiveAbort = new AbortController();\n\n\t\t\tglobalRows = [];\n\n\t\t\tconst query = globalQuery.trim();\n\n\t\t\tif (!query) {\n\t\t\t\tglobalStatus = \"Enter a search to begin.\";\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tglobalStatus = \"Searching archive…\";\n\n\t\t\ttry {\n\t\t\t\tconst url = new URL(model.searchIndexHref, document.baseURI);\n\t\t\t\tconst response = await fetch(url, { signal: local.signal });\n\n\t\t\t\tif (!response.ok) throw new Error(\"Unavailable archive\");\n\n\t\t\t\tconst index = await response.json();\n\n\t\t\t\tif (index.version !== 3 || !Array.isArray(index.shards) || !Number.isSafeInteger(index.count) || index.count > 100000) throw new Error(\"Unsupported archive\");\n\n\t\t\t\tconst all = [];\n\n\t\t\t\tfor (const shard of index.shards) {\n\t\t\t\t\tif (typeof shard !== \"string\") throw new Error(\"Invalid shard\");\n\n\t\t\t\t\tconst shardUrl = new URL(shard, url);\n\n\t\t\t\t\tif (shardUrl.origin !== url.origin) throw new Error(\"Unsafe shard\");\n\n\t\t\t\t\tconst chunk = await fetch(shardUrl, { signal: local.signal });\n\n\t\t\t\t\tif (!chunk.ok) throw new Error(\"Unavailable shard\");\n\n\t\t\t\t\tconst data = await chunk.json();\n\n\t\t\t\t\tif (!Array.isArray(data.entries) || all.length + data.entries.length > 100000) throw new Error(\"Invalid archive\");\n\n\t\t\t\t\tfor (const record of data.entries) {\n\t\t\t\t\t\tif (typeof record.name !== \"string\" || typeof record.path !== \"string\" || typeof record.exitsExplorer !== \"boolean\") throw new Error(\"Invalid archive record\");\n\n\t\t\t\t\t\tconst href = record.href === null ? null : new URL(record.href, url);\n\n\t\t\t\t\t\tif (href && ![\"http:\", \"https:\"].includes(href.protocol)) throw new Error(\"Unsupported archive link\");\n\n\t\t\t\t\t\tall.push({\n\t\t\t\t\t\t\tname: record.name,\n\t\t\t\t\t\t\tpath: record.path,\n\t\t\t\t\t\t\thref: href?.href ?? null,\n\t\t\t\t\t\t\texitsExplorer: record.exitsExplorer\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst matches = all.map((record) => ({ record, score: fuzzy(query, record.name + \" \" + record.path) })).filter((item) => item.score !== null).sort((a, b) => b.score - a.score || a.record.path.localeCompare(b.record.path));\n\n\t\t\t\tif (token !== archiveRequest || local.signal.aborted) return;\n\n\t\t\t\tglobalRows = matches.slice(0, 100).map((item) => item.record);\n\n\t\t\t\tglobalStatus = matches.length > 100\n\t\t\t\t\t? \"Showing 100 of \" + matches.length + \" results\"\n\t\t\t\t\t: matches.length + \" results\";\n\t\t\t} catch {\n\t\t\t\tif (token === archiveRequest && !local.signal.aborted) globalStatus = \"Could not load archive search. Try again.\";\n\t\t\t}\n\t\t}\n\n\t\tonMount(() => {\n\t\t\tready = true;\n\t\t\tabort = new AbortController();\n\n\t\t\ttry {\n\t\t\t\tconst stored = localStorage.getItem(\"dirwell-color-scheme\");\n\n\t\t\t\tif ([\"system\", \"light\", \"dark\"].includes(stored)) scheme = stored;\n\t\t\t} catch {}\n\n\t\t\thistory.replaceState({ dataHref: new URL(model.dataHref, document.baseURI).href }, \"\");\n\n\t\t\tconst onPop = (event) => {\n\t\t\t\tif (event.state?.dataHref) openFolder(event.state.dataHref, location.href, false); else location.reload();\n\t\t\t};\n\n\t\t\twindow.addEventListener(\"popstate\", onPop);\n\t\t\thydrateData();\n\n\t\t\treturn () => {\n\t\t\t\tabort?.abort();\n\t\t\t\tarchiveAbort?.abort();\n\t\t\t\twindow.removeEventListener(\"popstate\", onPop);\n\t\t\t};\n\t\t});\n\n\t\t$$renderer.push(`<header class=\"page-header\"><div class=\"wordmark\">`);\n\n\t\tif (header) {\n\t\t\t$$renderer.push('<!--[0-->');\n\t\t\theader($$renderer, { model });\n\t\t\t$$renderer.push(`<!---->`);\n\t\t} else {\n\t\t\t$$renderer.push(`<!--[-1--><h1>${$.escape(model.title)}</h1> <span>File archive</span>`);\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></div> <nav aria-label=\"Breadcrumb\"><a${$.attr('href', model.rootHref)}>Home</a><!--[-->`);\n\n\t\tconst each_array = $.ensure_array_like(model.breadcrumbs);\n\n\t\tfor (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {\n\t\t\tlet crumb = each_array[$$index];\n\n\t\t\t$$renderer.push(`<!---->/ <a${$.attr('href', crumb.href)}>${$.escape(crumb.name)}</a>`);\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></nav></header> <main data-explorer=\"\" data-framework=\"svelte\"${$.attr('aria-busy', busy)}><div class=\"toolbar\"><label class=\"search-field\">Search this directory<input type=\"search\" placeholder=\"Search files\"${$.attr('value', query)}${$.attr('disabled', !ready || !complete(), true)}/></label> <fieldset${$.attr('disabled', !ready || !complete(), true)}><legend>Types</legend><!--[-->`);\n\n\t\tconst each_array_1 = $.ensure_array_like([\"directory\", \"file\", \"link\"]);\n\n\t\tfor (let $$index_1 = 0, $$length = each_array_1.length; $$index_1 < $$length; $$index_1++) {\n\t\t\tlet type = each_array_1[$$index_1];\n\n\t\t\t$$renderer.push(`<label><input type=\"checkbox\"${$.attr('checked', types.includes(type), true)}/>${$.escape(type)}</label>`);\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></fieldset> <label>Sort`);\n\n\t\t$$renderer.select(\n\t\t\t{\n\t\t\t\tvalue: sort.field,\n\t\t\t\tdisabled: !ready || !complete(),\n\t\t\t\tonchange: (event) => sort = { ...sort, field: event.currentTarget.value }\n\t\t\t},\n\t\t\t($$renderer) => {\n\t\t\t\t$$renderer.option({ value: 'name' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Name`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'size' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Size`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'modified' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Modified`);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t$$renderer.push(`</label> <label>Names`);\n\n\t\t$$renderer.select(\n\t\t\t{\n\t\t\t\tvalue: sort.nameMode,\n\t\t\t\tdisabled: !ready || !complete(),\n\t\t\t\tonchange: (event) => sort = { ...sort, nameMode: event.currentTarget.value }\n\t\t\t},\n\t\t\t($$renderer) => {\n\t\t\t\t$$renderer.option({ value: 'natural' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Natural`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'locale' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Locale`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'unicode' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Unicode`);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t$$renderer.push(`</label> <label>Order`);\n\n\t\t$$renderer.select(\n\t\t\t{\n\t\t\t\tvalue: sort.direction,\n\t\t\t\tdisabled: !ready || !complete(),\n\t\t\t\tonchange: (event) => sort = { ...sort, direction: event.currentTarget.value }\n\t\t\t},\n\t\t\t($$renderer) => {\n\t\t\t\t$$renderer.option({ value: 'asc' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Ascending`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'desc' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Descending`);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t$$renderer.push(`</label> <label><input type=\"checkbox\"${$.attr('checked', sort.directoriesFirst, true)}${$.attr('disabled', !ready || !complete(), true)}/>Folders first</label> <label>Appearance`);\n\n\t\t$$renderer.select(\n\t\t\t{\n\t\t\t\tvalue: scheme,\n\t\t\t\tdisabled: !ready,\n\t\t\t\tonchange: (event) => updateScheme(event.currentTarget.value)\n\t\t\t},\n\t\t\t($$renderer) => {\n\t\t\t\t$$renderer.option({ value: 'system' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`System`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'light' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Light`);\n\t\t\t\t});\n\n\t\t\t\t$$renderer.option({ value: 'dark' }, ($$renderer) => {\n\t\t\t\t\t$$renderer.push(`Dark`);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\n\t\t$$renderer.push(`</label> <button${$.attr('disabled', !ready || !model.searchIndexHref, true)}>Search archive</button></div> <section class=\"listing-card\"><div class=\"listing-summary\"><span data-visible-count=\"\">${$.escape(complete() ? rows().length : entries.length)}</span> entries`);\n\n\t\tif (!complete()) {\n\t\t\t$$renderer.push(`<!--[0-->on this page · ${$.escape(model.total)} in directory`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--><span role=\"status\" aria-live=\"polite\">${$.escape(busy ? \"Loading…\" : error)}</span></div> <div class=\"entry-head\"><span>Name</span><span>Size</span><span>Modified</span></div> <ul class=\"entry-list\">`);\n\n\t\tif (model.parentHref) {\n\t\t\t$$renderer.push(`<!--[0--><li class=\"entry\"><a${$.attr('href', model.parentHref)}>../</a></li>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--> `);\n\n\t\tif (start()) {\n\t\t\t$$renderer.push(`<!--[0--><li aria-hidden=\"true\"${$.attr_style('', { height: offsets()[start()] + \"px\" })}></li>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--> <!--[-->`);\n\n\t\tconst each_array_2 = $.ensure_array_like(rows().slice(start(), end()));\n\n\t\tfor (let index = 0, $$length = each_array_2.length; index < $$length; index++) {\n\t\t\tlet entry = each_array_2[index];\n\n\t\t\t$$renderer.push(`<li class=\"entry\" data-entry=\"\"${$.attr('data-id', entry.id)}${$.attr('data-order', start() + index)}${$.attr('data-active', selected === entry.id)}><span class=\"identity\">`);\n\n\t\t\tif (entry.href) {\n\t\t\t\t$$renderer.push(`<!--[0--><a class=\"name\"${$.attr('href', safeHref(entry))}${$.attr('target', entry.exitsExplorer ? \"_blank\" : undefined)}${$.attr('rel', entry.exitsExplorer ? \"noopener\" : undefined)}>`);\n\n\t\t\t\tif (row) {\n\t\t\t\t\t$$renderer.push('<!--[0-->');\n\t\t\t\t\trow($$renderer, { model, entry, selected: selected === entry.id });\n\t\t\t\t\t$$renderer.push(`<!---->`);\n\t\t\t\t} else {\n\t\t\t\t\t$$renderer.push(`<!--[-1--><span class=\"file-icon\" aria-hidden=\"true\">${$.html(entryIcon(entryType(entry)))}</span> ${$.escape(entry.name)}${$.escape(isDirectory(entry) ? \"/\" : \"\")}`);\n\t\t\t\t}\n\n\t\t\t\t$$renderer.push(`<!--]--></a>`);\n\t\t\t} else {\n\t\t\t\t$$renderer.push(`<!--[-1--><span>`);\n\n\t\t\t\tif (row) {\n\t\t\t\t\t$$renderer.push('<!--[0-->');\n\t\t\t\t\trow($$renderer, { model, entry, selected: selected === entry.id });\n\t\t\t\t\t$$renderer.push(`<!---->`);\n\t\t\t\t} else {\n\t\t\t\t\t$$renderer.push(`<!--[-1-->${$.escape(entry.name)}`);\n\t\t\t\t}\n\n\t\t\t\t$$renderer.push(`<!--]--></span>`);\n\t\t\t}\n\n\t\t\t$$renderer.push(`<!--]-->`);\n\n\t\t\tif (entry.link) {\n\t\t\t\t$$renderer.push(`<!--[0--><small class=\"target\">${$.escape(entry.link.unavailable ? \"Target unavailable · \" : \"→ \")}${$.escape(entry.link.target)}</small>`);\n\t\t\t} else {\n\t\t\t\t$$renderer.push('<!--[-1-->');\n\t\t\t}\n\n\t\t\t$$renderer.push(`<!--]--></span> <span class=\"kind\">${$.escape(isDirectory(entry) ? \"Folder\" : size(entry.size))}</span> <button class=\"timestamp-button\"${$.attr('disabled', !ready, true)}><time${$.attr('datetime', entry.modifiedAt)}>${$.escape(modified(entry.modifiedAt, ready))}</time></button></li>`);\n\t\t}\n\n\t\t$$renderer.push(`<!--]--> `);\n\n\t\tif (end() < rows().length) {\n\t\t\t$$renderer.push(`<!--[0--><li aria-hidden=\"true\"${$.attr_style('', { height: offsets()[rows().length] - offsets()[end()] + \"px\" })}></li>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></ul> `);\n\n\t\tif (rows().length === 0) {\n\t\t\t$$renderer.push(`<!--[0--><p>No matching entries.</p>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></section> `);\n\n\t\tif (model.page?.count > 1 && !complete()) {\n\t\t\t$$renderer.push(`<!--[0--><nav aria-label=\"Pagination\">`);\n\n\t\t\tif (model.page.previousHref) {\n\t\t\t\t$$renderer.push(`<!--[0--><a rel=\"prev\"${$.attr('href', model.page.previousHref)}>Previous</a>`);\n\t\t\t} else {\n\t\t\t\t$$renderer.push('<!--[-1-->');\n\t\t\t}\n\n\t\t\t$$renderer.push(`<!--]--> Page ${$.escape(model.page.number)} of ${$.escape(model.page.count)} `);\n\n\t\t\tif (model.page.nextHref) {\n\t\t\t\t$$renderer.push(`<!--[0--><a rel=\"next\"${$.attr('href', model.page.nextHref)}>Next</a>`);\n\t\t\t} else {\n\t\t\t\t$$renderer.push('<!--[-1-->');\n\t\t\t}\n\n\t\t\t$$renderer.push(`<!--]--></nav>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--> `);\n\n\t\tif (footer) {\n\t\t\t$$renderer.push('<!--[0-->');\n\t\t\tfooter($$renderer, { model });\n\t\t\t$$renderer.push(`<!---->`);\n\t\t} else {\n\t\t\t$$renderer.push(`<!--[-1--><p class=\"keyboard-help\">Arrow keys select files · Home / End jump · / searches · Backspace opens\n parent</p>`);\n\t\t}\n\n\t\t$$renderer.push(`<!--]--></main> `);\n\n\t\tif (timestamp) {\n\t\t\t$$renderer.push(`<!--[0--><dialog><h2>Modified time</h2> <p>${$.escape(timestamp)}</p> <p>${$.escape(new Date(timestamp).toLocaleString())}</p> <button>Close</button></dialog>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]--> `);\n\n\t\tif (globalOpen) {\n\t\t\t$$renderer.push(`<!--[0--><dialog><h2>Search archive</h2> <input aria-label=\"Search archive files\" type=\"search\"${$.attr('value', globalQuery)}/> <p role=\"status\">${$.escape(globalStatus)}</p> <ul><!--[-->`);\n\n\t\t\tconst each_array_3 = $.ensure_array_like(globalRows);\n\n\t\t\tfor (let $$index_3 = 0, $$length = each_array_3.length; $$index_3 < $$length; $$index_3++) {\n\t\t\t\tlet record = each_array_3[$$index_3];\n\n\t\t\t\t$$renderer.push(`<li>`);\n\n\t\t\t\tif (record.href) {\n\t\t\t\t\t$$renderer.push(`<!--[0--><a${$.attr('href', record.href)}${$.attr('target', record.exitsExplorer ? \"_blank\" : undefined)}${$.attr('rel', record.exitsExplorer ? \"noopener\" : undefined)}>${$.escape(record.path)}</a>`);\n\t\t\t\t} else {\n\t\t\t\t\t$$renderer.push(`<!--[-1-->${$.escape(record.path)}`);\n\t\t\t\t}\n\n\t\t\t\t$$renderer.push(`<!--]--></li>`);\n\t\t\t}\n\n\t\t\t$$renderer.push(`<!--]--></ul> <button>Close</button></dialog>`);\n\t\t} else {\n\t\t\t$$renderer.push('<!--[-1-->');\n\t\t}\n\n\t\t$$renderer.push(`<!--]-->`);\n\t});\n}","import {render} from 'svelte/server';import App from './.generated/App-server.mjs';export const renderBody=model=>render(App,{props:{model}}).body;","import { readFile } from \"node:fs/promises\";\nimport { createHash } from \"node:crypto\";\nimport { escapeHtml } from \"@dirwell/core\";\nimport type { ExplorerTheme } from \"@dirwell/core\";\nimport { createThemePage, folderDataHref, pageAsset } from \"../../shared-theme/src/page.ts\";\n// Generated server component is paired with the separately compiled browser component.\nimport type { FrameworkRenderer } from \"./model.ts\";\nexport type { FrameworkRenderer, ThemePage } from \"./model.ts\";\nimport { renderBody } from \"../render-generated.mjs\";\nexport interface LedgerThemeOptions {\n readonly title?: string;\n}\nexport function createLedgerTheme(\n options: LedgerThemeOptions = {},\n renderer?: FrameworkRenderer,\n): ExplorerTheme {\n // Bundled resources are immutable for this theme instance; source rebuilds use a new instance.\n let resources: Promise<{ script: string; scriptName: string; styles: string }> | undefined;\n const loadResources = () =>\n (resources ??= Promise.all([\n renderer?.clientScript ?? readFile(new URL(\"./client.js\", import.meta.url), \"utf8\"),\n readFile(new URL(\"./styles.css\", import.meta.url), \"utf8\"),\n ]).then(([script, styles]) => ({\n script,\n styles,\n scriptName: `ledger-client-${createHash(\"sha256\").update(script).digest(\"hex\").slice(0, 16)}.js`,\n })));\n const theme: ExplorerTheme = {\n name: \"ledger\",\n listing: { pagination: true },\n entryData: (entry, context) => ({ folderDataHref: folderDataHref(entry, context, \"ledger\") }),\n async render(context) {\n const model = {\n ...createThemePage(context, theme, options.title ?? \"Dirwell\"),\n searchIndexHref: context.searchIndexHref,\n };\n const { script, scriptName, styles } = await loadResources();\n const json = JSON.stringify(model).replaceAll(\"<\", \"\\\\u003c\");\n return {\n html: `<!doctype html><html lang=\"en\" data-theme=\"system\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">${context.documentBaseHref === null ? \"\" : `<base href=\"${escapeHtml(context.documentBaseHref)}\">`}${context.metadata?.head ?? `<title>${escapeHtml(model.title)}</title>`}<style>${styles}${renderer?.styles ?? \"\"}</style></head><body><div data-dirwell-theme=\"ledger\">${await (renderer?.renderBody ?? renderBody)(model)}</div><script type=\"application/json\" id=\"dirwell-page-data\">${json}</script><script ${renderer?.clientType === \"module\" ? 'type=\"module\"' : \"defer\"} src=\"${escapeHtml(context.assetHref(scriptName))}\"></script></body></html>`,\n assets: {\n [scriptName]: script,\n [pageAsset(\"ledger\", model.path, model.page?.number ?? 1)]: JSON.stringify(model),\n },\n };\n },\n };\n return theme;\n}\n"],"mappings":";;;;;;;;;AAkCA,MAAa,aAAa,OAAe,WAAmB,OAAO,MACjE,GAAG,MAAM,QAAQ,WAAW,QAAQ,CAAC,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE,EAAE,GAAG,KAAK;AAC7F,SAAgB,eACd,OACA,SACA,OACe;CACf,IACE,MAAM,iBACN,MAAM,SAAS,QACf,EAA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U,CAAC,IAAI,KAAK,UAAU,KAAK;IAClF;GACF;EACF;CACF;CACA,OAAO;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dirwell/theme-ledger",
3
- "version": "0.0.1-alpha",
3
+ "version": "0.0.1-alpha.1",
4
4
  "description": "Svelte-owned searchable directory explorer.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -34,7 +34,7 @@
34
34
  "tag": "alpha"
35
35
  },
36
36
  "dependencies": {
37
- "@dirwell/core": "0.0.1-alpha",
37
+ "@dirwell/core": "0.0.1-alpha.1",
38
38
  "svelte": "5.57.2"
39
39
  },
40
40
  "devDependencies": {