@aparte/n8n-chat 1.1.0 → 1.1.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 +2 -2
- package/dist/cdn/chunks/{chunk-QLQPHZ4I.js → chunk-6ZVO7OTR.js} +2 -2
- package/dist/cdn/chunks/{chunk-QLQPHZ4I.js.map → chunk-6ZVO7OTR.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-3ZPEJRUN.js → chunk-7K4YMHQR.js} +2 -2
- package/dist/cdn/chunks/{chunk-3ZPEJRUN.js.map → chunk-7K4YMHQR.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-Z3UL76XU.js → chunk-KB6DEEIQ.js} +1 -1
- package/dist/cdn/chunks/{chunk-Z3UL76XU.js.map → chunk-KB6DEEIQ.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-QGJMBP66.js → chunk-L72XRVUT.js} +17 -17
- package/dist/cdn/chunks/{chunk-QGJMBP66.js.map → chunk-L72XRVUT.js.map} +4 -4
- package/dist/cdn/chunks/{chunk-HR2ND5EK.js → chunk-S6J6TTL4.js} +2 -2
- package/dist/cdn/chunks/{chunk-HR2ND5EK.js.map → chunk-S6J6TTL4.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-KXLJFCTW.js → chunk-Y44OMGIJ.js} +2 -2
- package/dist/cdn/chunks/{chunk-KXLJFCTW.js.map → chunk-Y44OMGIJ.js.map} +1 -1
- package/dist/cdn/chunks/{de-SOZWA4P4.js → de-7VJXZS3Y.js} +1 -1
- package/dist/cdn/chunks/{de-SOZWA4P4.js.map → de-7VJXZS3Y.js.map} +1 -1
- package/dist/cdn/chunks/{es-WUHNDTG7.js → es-DJOVPGNH.js} +1 -1
- package/dist/cdn/chunks/{es-WUHNDTG7.js.map → es-DJOVPGNH.js.map} +1 -1
- package/dist/cdn/chunks/{fr-QOUVY5FA.js → fr-MX37SEJL.js} +1 -1
- package/dist/cdn/chunks/{fr-QOUVY5FA.js.map → fr-MX37SEJL.js.map} +1 -1
- package/dist/cdn/chunks/{highlight-ZJAA24RG.js → highlight-UOFUMZVB.js} +2 -2
- package/dist/cdn/chunks/{highlight-ZJAA24RG.js.map → highlight-UOFUMZVB.js.map} +1 -1
- package/dist/cdn/chunks/{it-JOAAJHQH.js → it-ACF2ENLA.js} +1 -1
- package/dist/cdn/chunks/{it-JOAAJHQH.js.map → it-ACF2ENLA.js.map} +1 -1
- package/dist/cdn/chunks/{items-6EVOWL4Q.js → items-ZVVHDZQS.js} +2 -2
- package/dist/cdn/chunks/{items-6EVOWL4Q.js.map → items-ZVVHDZQS.js.map} +1 -1
- package/dist/cdn/chunks/{ja-VUZC7PKR.js → ja-RUBXQ3AK.js} +1 -1
- package/dist/cdn/chunks/{ja-VUZC7PKR.js.map → ja-RUBXQ3AK.js.map} +1 -1
- package/dist/cdn/chunks/{ko-O3YDRWQK.js → ko-SZPL4AIC.js} +1 -1
- package/dist/cdn/chunks/{ko-O3YDRWQK.js.map → ko-SZPL4AIC.js.map} +1 -1
- package/dist/cdn/chunks/{link-77UEHUXF.js → link-7HOSE2HR.js} +2 -2
- package/dist/cdn/chunks/{link-77UEHUXF.js.map → link-7HOSE2HR.js.map} +1 -1
- package/dist/cdn/chunks/{media-PN3A7I2Y.js → media-TKQMGWJL.js} +2 -2
- package/dist/cdn/chunks/{media-PN3A7I2Y.js.map → media-TKQMGWJL.js.map} +1 -1
- package/dist/cdn/chunks/{order-PC45M52X.js → order-JHIBAOAM.js} +2 -2
- package/dist/cdn/chunks/{order-PC45M52X.js.map → order-JHIBAOAM.js.map} +1 -1
- package/dist/cdn/chunks/{place-HVNXQ2XT.js → place-U5X4TNLJ.js} +2 -2
- package/dist/cdn/chunks/{place-HVNXQ2XT.js.map → place-U5X4TNLJ.js.map} +1 -1
- package/dist/cdn/chunks/{plan-VVVGWRRY.js → plan-SLX26KB6.js} +2 -2
- package/dist/cdn/chunks/{plan-VVVGWRRY.js.map → plan-SLX26KB6.js.map} +1 -1
- package/dist/cdn/chunks/{product-344AZESV.js → product-QD2UM2YC.js} +2 -2
- package/dist/cdn/chunks/{product-344AZESV.js.map → product-QD2UM2YC.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-VRSALGOW.js → pt-BR-O6V4ZHQV.js} +1 -1
- package/dist/cdn/chunks/{pt-BR-VRSALGOW.js.map → pt-BR-O6V4ZHQV.js.map} +1 -1
- package/dist/cdn/chunks/{ru-QHPM4IVN.js → ru-GHVKB5QT.js} +1 -1
- package/dist/cdn/chunks/{ru-QHPM4IVN.js.map → ru-GHVKB5QT.js.map} +1 -1
- package/dist/cdn/chunks/{score-3VE4ZDCR.js → score-SIWLGKFB.js} +2 -2
- package/dist/cdn/chunks/{score-3VE4ZDCR.js.map → score-SIWLGKFB.js.map} +1 -1
- package/dist/cdn/chunks/{stats-A6ATSHOO.js → stats-I7FWD22A.js} +2 -2
- package/dist/cdn/chunks/{stats-A6ATSHOO.js.map → stats-I7FWD22A.js.map} +1 -1
- package/dist/cdn/chunks/{stock-KPAFYPNA.js → stock-SU4RHFTL.js} +2 -2
- package/dist/cdn/chunks/{stock-KPAFYPNA.js.map → stock-SU4RHFTL.js.map} +1 -1
- package/dist/cdn/chunks/{weather-OHQUZ3YG.js → weather-OLNMWGUD.js} +2 -2
- package/dist/cdn/chunks/{weather-OHQUZ3YG.js.map → weather-OLNMWGUD.js.map} +1 -1
- package/dist/cdn/chunks/{zh-CN-U7Y6ABLD.js → zh-CN-EHJ3XH3O.js} +1 -1
- package/dist/cdn/chunks/{zh-CN-U7Y6ABLD.js.map → zh-CN-EHJ3XH3O.js.map} +1 -1
- package/dist/cdn/latest.js +4 -4
- package/dist/cdn/n8n-chat.js +2 -2
- package/dist/cdn/n8n-chat.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../node_modules/.pnpm/@aparte+plugin-cards@1.
|
|
3
|
+
"sources": ["../../../node_modules/.pnpm/@aparte+plugin-cards@1.5.0_@aparte+core@1.5.0/node_modules/@aparte/plugin-cards/src/plan/icons.ts", "../../../node_modules/.pnpm/@aparte+plugin-cards@1.5.0_@aparte+core@1.5.0/node_modules/@aparte/plugin-cards/src/plan/plan.css", "../../../node_modules/.pnpm/@aparte+plugin-cards@1.5.0_@aparte+core@1.5.0/node_modules/@aparte/plugin-cards/src/plan/index.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * The plan card's glyphs: one per step status, the timeline's \"current\" node, a clock for\n * the elapsed time, and the card's own for its one-line states.\n *\n * Drawn on a 24 × 24 grid in `currentColor`, so the sheet colours each status through\n * `color` and a theme follows. The check and the cross inside a disc are drawn in the\n * card's surface (`.aparte-plan__mark`), so they read in light and dark alike. Constants\n * of this package — the only markup the card parses.\n */\n\nconst svg = (body: string, className?: string) =>\n `<svg${className ? ` class=\"${className}\"` : ''} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\">${body}</svg>`; // safe-attr: a class name this file passes, a constant, never data // safe-text: this package's own SVG, built from its glyph constants\n\n/** An empty ring: not started yet. */\nconst PENDING = svg('<circle cx=\"12\" cy=\"12\" r=\"8\"/>');\n\n/** A faint ring with a quarter of it drawn, which the sheet turns: running now. Still under reduced motion. */\nconst RUNNING = svg('<circle cx=\"12\" cy=\"12\" r=\"8\" opacity=\"0.4\"/><path d=\"M12 4a8 8 0 0 1 8 8\"/>', 'aparte-plan__spinner');\n\n/** A filled disc with a check: done. */\nconst DONE = svg('<circle cx=\"12\" cy=\"12\" r=\"9\" fill=\"currentColor\" stroke=\"none\"/><path class=\"aparte-plan__mark\" d=\"M8.2 12.4l2.6 2.6 5-5.4\"/>');\n\n/** A filled disc with a cross: failed. */\nconst FAILED = svg('<circle cx=\"12\" cy=\"12\" r=\"9\" fill=\"currentColor\" stroke=\"none\"/><path class=\"aparte-plan__mark\" d=\"M9.3 9.3l5.4 5.4M14.7 9.3l-5.4 5.4\"/>');\n\n/** A dashed ring crossed by a dash: skipped, left out on purpose. */\nconst SKIPPED = svg('<circle cx=\"12\" cy=\"12\" r=\"8\" stroke-dasharray=\"2.4 2.6\"/><path d=\"M8.6 12h6.8\"/>');\n\n/** A padlock: blocked, waiting on something outside the plan. */\nconst BLOCKED = svg('<rect x=\"6\" y=\"10.6\" width=\"12\" height=\"9\" rx=\"2.2\"/><path d=\"M8.9 10.6V8.2a3.1 3.1 0 0 1 6.2 0v2.4\"/>');\n\n/** The glyph each status wears in a list. */\nexport const STATUS_GLYPHS = {\n pending: PENDING,\n 'in-progress': RUNNING,\n done: DONE,\n failed: FAILED,\n skipped: SKIPPED,\n blocked: BLOCKED,\n} as const;\n\n/** The timeline's node for the step under way: a ring round a dot, which the sheet makes pulse. */\nexport const NODE_CURRENT = svg('<circle cx=\"12\" cy=\"12\" r=\"8\"/><circle cx=\"12\" cy=\"12\" r=\"4\" fill=\"currentColor\" stroke=\"none\"/>');\n\n/** A clock, beside the elapsed time. */\nexport const CLOCK = svg('<circle cx=\"12\" cy=\"12\" r=\"8.2\"/><path d=\"M12 7.6V12l2.9 1.9\"/>');\n\n/** A clipboard with two ticked lines: the card's own glyph, for its one-line states. */\nexport const PLAN = svg('<rect x=\"5\" y=\"4.5\" width=\"14\" height=\"16.5\" rx=\"2.2\"/><path d=\"M9.2 4.5V3.8a1 1 0 0 1 1-1h3.6a1 1 0 0 1 1 1v.7\"/><path d=\"M8.4 10.6l1.4 1.4 2.4-2.6\"/><path d=\"M14.2 10.6h1.8\"/><path d=\"M8.4 16.1l1.4 1.4 2.4-2.6\"/><path d=\"M14.2 16.1h1.8\"/>');\n", "export default \"/* =========================================\\n The plan card — @aparte/plugin-cards/plan\\n =========================================\\n Three variants of one card, chosen by `data-variant` on its root:\\n checklist \\\"3 of 7 done\\\" over a thin bar, then a row per step: its status glyph,\\n its title, a detail line, its duration at the end once it finished.\\n timeline a rail with a node per step, coloured by its status, its start time and\\n duration under the title; the step under way pulses gently.\\n compact one line — \\\"Step 3 of 7: Running the tests\\\", a ring, the percentage.\\n An agent re-sends this card while it works, and the kit draws the new one into the\\n same root, so nothing here depends on the status for its SIZE: the glyph is one size\\n for all, the title reserves its bold width (and its other wording's), a timed plan\\n keeps every time slot, as wide as the language's widest duration.\\n A status is never said by colour alone: each has its own glyph shape, and its word for\\n a screen reader. Every colour is a theme token or derived from one.\\n */\\n\\n.aparte-plan-card {\\n --aparte-plan-pad: var(--aparte-space-6);\\n --aparte-plan-glyph-size: 1.125rem;\\n --aparte-plan-node-size: 1.25rem;\\n --aparte-plan-pending: color-mix(in oklab, var(--aparte-text-muted) 75%, transparent);\\n --aparte-plan-active: var(--aparte-primary);\\n --aparte-plan-done: var(--aparte-success);\\n --aparte-plan-failed: var(--aparte-error);\\n --aparte-plan-failed-ink: var(--aparte-error-ink);\\n --aparte-plan-skipped: var(--aparte-text-muted);\\n --aparte-plan-blocked: var(--aparte-warning);\\n --aparte-plan-blocked-ink: var(--aparte-warning-ink);\\n --aparte-plan-track: color-mix(in oklab, var(--aparte-text) 9%, transparent);\\n --aparte-plan-rail: color-mix(in oklab, var(--aparte-text) 13%, transparent);\\n --aparte-plan-active-tint: color-mix(in oklab, var(--aparte-primary) 8%, transparent);\\n --aparte-plan-hover-tint: color-mix(in oklab, var(--aparte-text) 3.5%, transparent);\\n --aparte-plan-done-text: var(--aparte-text-muted);\\n}\\n\\n.aparte-plan-card[data-variant=\\\"checklist\\\"],\\n.aparte-plan-card[data-variant=\\\"timeline\\\"] { --aparte-rich-card-max-inline-size: 26rem; }\\n.aparte-plan-card[data-variant=\\\"compact\\\"] { --aparte-rich-card-max-inline-size: 24rem; }\\n\\n/* ── Header: title, \\\"3 of 7 done\\\", the bar ───────────────────────────── */\\n\\n.aparte-plan__head {\\n display: flex;\\n flex-direction: column;\\n gap: var(--aparte-space-3);\\n padding: var(--aparte-plan-pad) var(--aparte-plan-pad) 0;\\n min-inline-size: 0;\\n}\\n\\n.aparte-plan__heading {\\n display: flex;\\n flex-direction: column;\\n gap: var(--aparte-space-1);\\n min-inline-size: 0;\\n}\\n\\n.aparte-plan__title {\\n color: var(--aparte-text);\\n font-size: var(--aparte-font-size-base);\\n font-weight: var(--aparte-font-weight-semibold);\\n line-height: 1.3;\\n overflow-wrap: anywhere;\\n}\\n\\n.aparte-plan__goal {\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n overflow-wrap: anywhere;\\n}\\n\\n/* One line, always: a count that grows a digit or a note that appears does not wrap the\\n header and push the steps down while the agent works. */\\n.aparte-plan__meter {\\n display: flex;\\n align-items: center;\\n gap: var(--aparte-space-3);\\n min-inline-size: 0;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n font-variant-numeric: tabular-nums;\\n white-space: nowrap;\\n}\\n\\n.aparte-plan__count {\\n flex: none;\\n color: var(--aparte-text);\\n font-weight: var(--aparte-font-weight-medium);\\n}\\n\\n.aparte-plan__note {\\n min-inline-size: 0;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n}\\n\\n.aparte-plan__note::before {\\n content: \\\"·\\\";\\n margin-inline-end: var(--aparte-space-3);\\n color: var(--aparte-text-muted);\\n}\\n\\n.aparte-plan__note[data-kind=\\\"failed\\\"] { color: var(--aparte-plan-failed-ink); }\\n\\n.aparte-plan__elapsed {\\n display: inline-flex;\\n flex: none;\\n align-items: center;\\n gap: var(--aparte-space-1);\\n margin-inline-start: auto;\\n --aparte-rich-card-glyph-size: 0.95rem;\\n}\\n\\n.aparte-plan__clock { opacity: 0.8; }\\n\\n/* The bar: what is done in the accent (green once all of it is), what was skipped after\\n it in hatching — counted, but plainly not the same as done. */\\n.aparte-plan__bar {\\n display: flex;\\n block-size: 0.375rem;\\n overflow: hidden;\\n border-radius: var(--aparte-radius-full);\\n background: var(--aparte-plan-track);\\n}\\n\\n.aparte-plan__bar-done,\\n.aparte-plan__bar-skipped {\\n flex: none;\\n block-size: 100%;\\n transition: inline-size var(--aparte-duration-slow, 400ms) var(--aparte-ease, ease);\\n}\\n\\n.aparte-plan__bar-done {\\n inline-size: var(--aparte-plan-done-share, 0%);\\n background: var(--aparte-plan-active);\\n}\\n\\n.aparte-plan__bar[data-complete] .aparte-plan__bar-done { background: var(--aparte-plan-done); }\\n\\n.aparte-plan__bar-skipped {\\n inline-size: var(--aparte-plan-skipped-share, 0%);\\n background: repeating-linear-gradient(\\n -45deg,\\n color-mix(in oklab, var(--aparte-plan-skipped) 55%, transparent) 0 2px,\\n color-mix(in oklab, var(--aparte-plan-skipped) 22%, transparent) 2px 4px\\n );\\n}\\n\\n/* ── A step's parts, whatever the variant ────────────────────────────── */\\n\\n/* The text and an invisible bold copy share one cell: the cell is always as wide and as\\n tall as the bold form, so the step that starts running reflows nothing. A todo's other\\n wording (`activeForm`) is a second invisible copy in the same cell, so the switch to\\n \\\"Updating the reference pages\\\" from \\\"Update\\\" reflows nothing either. */\\n.aparte-plan__step-title {\\n display: grid;\\n min-inline-size: 0;\\n overflow-wrap: anywhere;\\n}\\n\\n.aparte-plan__step-title > .aparte-plan__step-title-text,\\n.aparte-plan__step-title[data-alt]::before,\\n.aparte-plan__step-title::after { grid-area: 1 / 1; }\\n\\n.aparte-plan__step-title[data-alt]::before {\\n content: attr(data-alt);\\n content: attr(data-alt) / \\\"\\\";\\n}\\n\\n.aparte-plan__step-title[data-alt]::before,\\n.aparte-plan__step-title::after {\\n font-weight: var(--aparte-font-weight-semibold);\\n visibility: hidden;\\n pointer-events: none;\\n user-select: none;\\n}\\n\\n.aparte-plan__step-title::after {\\n content: attr(data-text);\\n content: attr(data-text) / \\\"\\\";\\n}\\n\\n.aparte-plan__detail {\\n display: -webkit-box;\\n margin-block-start: 0.125rem;\\n overflow: hidden;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n line-height: 1.4;\\n overflow-wrap: anywhere;\\n -webkit-box-orient: vertical;\\n -webkit-line-clamp: 2;\\n line-clamp: 2;\\n}\\n\\n.aparte-plan__duration {\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-xs);\\n font-variant-numeric: tabular-nums;\\n white-space: nowrap;\\n}\\n\\n/* The status colours: the glyph takes them; the text only where it must speak. */\\n[data-status] > .aparte-plan__row > .aparte-plan__glyph,\\n[data-status] > .aparte-plan__node,\\n.aparte-plan__compact > .aparte-plan__glyph { color: var(--aparte-plan-pending); }\\n\\n[data-status=\\\"in-progress\\\"] > .aparte-plan__row > .aparte-plan__glyph,\\n[data-status=\\\"in-progress\\\"] > .aparte-plan__node,\\n.aparte-plan__compact[data-status=\\\"in-progress\\\"] > .aparte-plan__glyph { color: var(--aparte-plan-active); }\\n\\n[data-status=\\\"done\\\"] > .aparte-plan__row > .aparte-plan__glyph,\\n[data-status=\\\"done\\\"] > .aparte-plan__node,\\n.aparte-plan__compact[data-status=\\\"done\\\"] > .aparte-plan__glyph { color: var(--aparte-plan-done); }\\n\\n[data-status=\\\"failed\\\"] > .aparte-plan__row > .aparte-plan__glyph,\\n[data-status=\\\"failed\\\"] > .aparte-plan__node,\\n.aparte-plan__compact[data-status=\\\"failed\\\"] > .aparte-plan__glyph { color: var(--aparte-plan-failed); }\\n\\n[data-status=\\\"skipped\\\"] > .aparte-plan__row > .aparte-plan__glyph,\\n[data-status=\\\"skipped\\\"] > .aparte-plan__node { color: var(--aparte-plan-skipped); }\\n\\n[data-status=\\\"blocked\\\"] > .aparte-plan__row > .aparte-plan__glyph,\\n[data-status=\\\"blocked\\\"] > .aparte-plan__node,\\n.aparte-plan__compact[data-status=\\\"blocked\\\"] > .aparte-plan__glyph { color: var(--aparte-plan-blocked-ink); }\\n\\n/* The check and the cross are cut out of their disc in the card's own surface. */\\n.aparte-plan__mark {\\n stroke: var(--aparte-surface-1);\\n stroke-width: 2.2;\\n}\\n\\n/* The running ring turns, on core's own keyframe — its sheet comes with the chat; a copy\\n here was a second name for the same turn. Under reduced motion the kit stops it and the\\n arc stays. */\\n.aparte-plan__spinner {\\n transform-origin: 50% 50%;\\n animation: aparte-spin 0.9s linear infinite;\\n}\\n\\n/* Done stays readable — muted, not struck through. Failed speaks in the error ink. */\\n[data-status=\\\"done\\\"] > .aparte-plan__row .aparte-plan__step-title,\\n[data-status=\\\"done\\\"] > .aparte-plan__event-body > .aparte-plan__step-title,\\n[data-status=\\\"skipped\\\"] > .aparte-plan__row .aparte-plan__step-title,\\n[data-status=\\\"skipped\\\"] > .aparte-plan__event-body > .aparte-plan__step-title { color: var(--aparte-plan-done-text); }\\n\\n[data-status=\\\"failed\\\"] > .aparte-plan__row .aparte-plan__step-title,\\n[data-status=\\\"failed\\\"] > .aparte-plan__event-body > .aparte-plan__step-title { color: var(--aparte-plan-failed-ink); }\\n\\n[data-status=\\\"blocked\\\"] > .aparte-plan__row .aparte-plan__step-title,\\n[data-status=\\\"blocked\\\"] > .aparte-plan__event-body > .aparte-plan__step-title { color: var(--aparte-text-muted); }\\n\\n[data-status=\\\"in-progress\\\"] > .aparte-plan__row .aparte-plan__step-title,\\n[data-status=\\\"in-progress\\\"] > .aparte-plan__event-body > .aparte-plan__step-title {\\n color: var(--aparte-text);\\n font-weight: var(--aparte-font-weight-semibold);\\n}\\n\\n/* ── checklist ───────────────────────────────────────────────────────── */\\n\\n.aparte-plan__steps,\\n.aparte-plan__substeps,\\n.aparte-plan__timeline {\\n margin: 0;\\n padding: 0;\\n list-style: none;\\n}\\n\\n.aparte-plan__steps {\\n display: flex;\\n flex-direction: column;\\n gap: 0.125rem;\\n padding: var(--aparte-space-4) calc(var(--aparte-plan-pad) - var(--aparte-space-3)) calc(var(--aparte-plan-pad) - var(--aparte-space-2));\\n}\\n\\n.aparte-plan__row {\\n display: grid;\\n grid-template-columns: var(--aparte-plan-glyph-size) minmax(0, 1fr) auto;\\n column-gap: var(--aparte-space-3);\\n align-items: baseline;\\n padding: var(--aparte-space-2) var(--aparte-space-3);\\n border-radius: var(--aparte-radius-md);\\n color: var(--aparte-text);\\n font-size: var(--aparte-font-size-md);\\n line-height: 1.4;\\n transition: background-color var(--aparte-duration-fast, 120ms) ease;\\n}\\n\\n.aparte-plan__row:hover { background: var(--aparte-plan-hover-tint); }\\n\\n/* The step under way: a soft tint of the accent, held on hover. */\\n.aparte-plan__step[data-status=\\\"in-progress\\\"] > .aparte-plan__row,\\n.aparte-plan__step[data-status=\\\"in-progress\\\"] > .aparte-plan__row:hover { background: var(--aparte-plan-active-tint); }\\n\\n.aparte-plan__step > .aparte-plan__row > .aparte-plan__glyph {\\n --aparte-rich-card-glyph-size: var(--aparte-plan-glyph-size);\\n align-self: start;\\n /* Centred on the first line of the title, however the font sizes it. */\\n margin-block-start: calc((1lh - var(--aparte-plan-glyph-size)) / 2);\\n}\\n\\n.aparte-plan__text { min-inline-size: 0; }\\n\\n/* A timed plan keeps the duration's column on every row, filled or not, as wide as the\\n language's widest duration: an invisible copy of it (`data-reserve`, written by the card)\\n lies under the text with no height, so `1 Std., 5 Min.` fills the slot without widening it\\n — a wider slot would narrow the title and could wrap it onto a second line. */\\n.aparte-plan__steps[data-timed] .aparte-plan__duration {\\n display: inline-flex;\\n flex-direction: column;\\n align-items: flex-end;\\n}\\n\\n.aparte-plan__steps[data-timed] .aparte-plan__duration::after {\\n content: attr(data-reserve);\\n content: attr(data-reserve) / \\\"\\\";\\n block-size: 0;\\n overflow: hidden;\\n visibility: hidden;\\n}\\n\\n.aparte-plan__substeps {\\n display: flex;\\n flex-direction: column;\\n gap: 0;\\n margin-inline-start: calc(var(--aparte-plan-glyph-size) + var(--aparte-space-3));\\n}\\n\\n.aparte-plan__step--sub {\\n --aparte-plan-glyph-size: 0.9375rem;\\n}\\n\\n.aparte-plan__step--sub > .aparte-plan__row {\\n padding-block: var(--aparte-space-1);\\n font-size: var(--aparte-font-size-sm);\\n}\\n\\n/* A sub-step under way is tinted by its parent's row already: it keeps only its weight. */\\n.aparte-plan__step--sub[data-status=\\\"in-progress\\\"] > .aparte-plan__row,\\n.aparte-plan__step--sub[data-status=\\\"in-progress\\\"] > .aparte-plan__row:hover { background: transparent; }\\n\\n/* ── timeline ────────────────────────────────────────────────────────── */\\n\\n.aparte-plan__timeline {\\n padding: var(--aparte-space-5) var(--aparte-plan-pad) var(--aparte-plan-pad);\\n}\\n\\n.aparte-plan__event {\\n position: relative;\\n display: grid;\\n grid-template-columns: var(--aparte-plan-node-size) minmax(0, 1fr);\\n column-gap: var(--aparte-space-4);\\n padding-block-end: var(--aparte-space-5);\\n color: var(--aparte-text);\\n font-size: var(--aparte-font-size-md);\\n line-height: 1.4;\\n}\\n\\n.aparte-plan__event:last-child { padding-block-end: 0; }\\n\\n/* The rail: from under this node to the top of the next one. Past a finished step it\\n takes the done colour, so the run reads as a line filling downwards. */\\n.aparte-plan__event:not(:last-child)::before {\\n content: \\\"\\\";\\n position: absolute;\\n inset-inline-start: calc(var(--aparte-plan-node-size) / 2 - 1px);\\n inset-block-start: calc((1lh - var(--aparte-plan-node-size)) / 2 + var(--aparte-plan-node-size) + 3px);\\n inset-block-end: calc((1lh - var(--aparte-plan-node-size)) / -2 + 3px);\\n inline-size: 2px;\\n border-radius: var(--aparte-radius-full);\\n background: var(--aparte-plan-rail);\\n}\\n\\n.aparte-plan__event[data-status=\\\"done\\\"]:not(:last-child)::before,\\n.aparte-plan__event[data-status=\\\"skipped\\\"]:not(:last-child)::before {\\n background: color-mix(in oklab, var(--aparte-plan-done) 55%, transparent);\\n}\\n\\n.aparte-plan__node {\\n position: relative;\\n display: grid;\\n place-items: center;\\n inline-size: var(--aparte-plan-node-size);\\n block-size: var(--aparte-plan-node-size);\\n margin-block-start: calc((1lh - var(--aparte-plan-node-size)) / 2);\\n border-radius: var(--aparte-radius-full);\\n --aparte-rich-card-glyph-size: var(--aparte-plan-node-size);\\n}\\n\\n/* The step under way breathes: a halo of the accent that widens and fades. */\\n.aparte-plan__event[data-status=\\\"in-progress\\\"] > .aparte-plan__node::after {\\n content: \\\"\\\";\\n position: absolute;\\n inset: 0;\\n border-radius: inherit;\\n animation: aparte-plan-pulse 2.2s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;\\n}\\n\\n@keyframes aparte-plan-pulse {\\n 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--aparte-plan-active) 45%, transparent); }\\n 70%, 100% { box-shadow: 0 0 0 0.45rem color-mix(in oklab, var(--aparte-plan-active) 0%, transparent); }\\n}\\n\\n.aparte-plan__event-body {\\n display: flex;\\n flex-direction: column;\\n min-inline-size: 0;\\n}\\n\\n/* Start and duration on one line under the title. In a timed plan the line is there for\\n every step, empty until it starts: every step keeps one rhythm. */\\n.aparte-plan__meta {\\n display: flex;\\n flex-wrap: wrap;\\n align-items: baseline;\\n gap: 0 var(--aparte-space-2);\\n min-block-size: 1lh;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-xs);\\n font-variant-numeric: tabular-nums;\\n}\\n\\n.aparte-plan__meta > .aparte-plan__start:not(:empty) + .aparte-plan__duration:not(:empty)::before {\\n content: \\\"·\\\";\\n margin-inline-end: var(--aparte-space-2);\\n}\\n\\n.aparte-plan__event-body > .aparte-plan__substeps {\\n margin-block-start: var(--aparte-space-2);\\n margin-inline: calc(var(--aparte-space-3) * -1) 0;\\n}\\n\\n/* ── compact ─────────────────────────────────────────────────────────── */\\n\\n.aparte-plan__compact {\\n display: grid;\\n grid-template-columns: auto minmax(0, 1fr) auto auto;\\n align-items: center;\\n column-gap: var(--aparte-space-3);\\n padding: var(--aparte-space-3) var(--aparte-space-5);\\n font-size: var(--aparte-font-size-md);\\n --aparte-rich-card-glyph-size: 1.125rem;\\n}\\n\\n.aparte-plan__compact-text {\\n min-inline-size: 0;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n\\n.aparte-plan__compact-step {\\n margin-inline-end: 0.35em;\\n color: var(--aparte-text-muted);\\n font-variant-numeric: tabular-nums;\\n}\\n\\n.aparte-plan__compact-title {\\n color: var(--aparte-text);\\n font-weight: var(--aparte-font-weight-semibold);\\n}\\n\\n/* Finished: the plan's name, then \\\"All steps done\\\". */\\n.aparte-plan__compact-title + .aparte-plan__compact-step { margin-inline: 0; }\\n.aparte-plan__compact-title + .aparte-plan__compact-step::before {\\n content: \\\"·\\\";\\n margin-inline: 0.4em;\\n}\\n\\n.aparte-plan__ring {\\n display: inline-flex;\\n inline-size: 1.375rem;\\n block-size: 1.375rem;\\n}\\n\\n/* The arc starts at twelve o'clock and runs with the reading direction. */\\n.aparte-plan__ring-svg {\\n inline-size: 100%;\\n block-size: 100%;\\n transform: rotate(-90deg);\\n}\\n\\n.aparte-plan__ring-svg:dir(rtl) { transform: scaleX(-1) rotate(-90deg); }\\n\\n.aparte-plan__ring-svg > circle {\\n fill: none;\\n stroke-width: 3;\\n}\\n\\n.aparte-plan__ring-track { stroke: var(--aparte-plan-track); }\\n.aparte-plan__ring-done { stroke: var(--aparte-plan-active); }\\n.aparte-plan__ring[data-complete] .aparte-plan__ring-done { stroke: var(--aparte-plan-done); }\\n.aparte-plan__ring-skipped { stroke: color-mix(in oklab, var(--aparte-plan-skipped) 45%, transparent); }\\n\\n.aparte-plan__percent {\\n min-inline-size: 4ch;\\n color: var(--aparte-text);\\n font-size: var(--aparte-font-size-sm);\\n font-weight: var(--aparte-font-weight-semibold);\\n font-variant-numeric: tabular-nums;\\n text-align: end;\\n}\\n\\n/* ── Loading ─────────────────────────────────────────────────────────── */\\n\\n.aparte-plan-card[data-state=\\\"loading\\\"] .aparte-skeleton.aparte-plan__sk-title { inline-size: 10rem; }\\n.aparte-plan-card[data-state=\\\"loading\\\"] .aparte-skeleton.aparte-plan__sk-count { inline-size: 6rem; }\\n\\n.aparte-plan-card[data-state=\\\"loading\\\"] .aparte-skeleton.aparte-plan__sk-glyph {\\n inline-size: var(--aparte-plan-glyph-size);\\n block-size: var(--aparte-plan-glyph-size);\\n align-self: center;\\n margin: 0;\\n}\\n\\n.aparte-plan-card[data-state=\\\"loading\\\"] .aparte-skeleton.aparte-plan__sk-node {\\n inline-size: var(--aparte-plan-node-size);\\n block-size: var(--aparte-plan-node-size);\\n}\\n\\n.aparte-plan-card[data-state=\\\"loading\\\"] .aparte-skeleton.aparte-plan__sk-ring {\\n inline-size: 1.375rem;\\n block-size: 1.375rem;\\n}\\n\\n.aparte-plan-card[data-state=\\\"loading\\\"] .aparte-plan__row { align-items: center; }\\n.aparte-plan-card[data-state=\\\"loading\\\"] .aparte-skeleton.aparte-plan__sk-line { inline-size: 70%; }\\n.aparte-plan-card[data-state=\\\"loading\\\"] li:nth-child(2) .aparte-skeleton.aparte-plan__sk-line { inline-size: 55%; }\\n.aparte-plan-card[data-state=\\\"loading\\\"] li:nth-child(3) .aparte-skeleton.aparte-plan__sk-line { inline-size: 80%; }\\n.aparte-plan-card[data-state=\\\"loading\\\"] li:nth-child(4) .aparte-skeleton.aparte-plan__sk-line { inline-size: 45%; }\\n.aparte-plan-card[data-state=\\\"loading\\\"] .aparte-skeleton.aparte-plan__sk-meta { inline-size: 5rem; }\\n.aparte-plan-card[data-state=\\\"loading\\\"] .aparte-plan__compact .aparte-skeleton.aparte-plan__sk-line { inline-size: 75%; }\\n\\n/* ── Small screens ───────────────────────────────────────────────────── */\\n\\n@media (max-width: 380px) {\\n .aparte-plan-card { --aparte-plan-pad: var(--aparte-space-5); }\\n .aparte-plan__compact { column-gap: var(--aparte-space-2); padding-inline: var(--aparte-space-4); }\\n}\\n\"", "/**\n * @aparte/plugin-cards/plan — an agent's plan, its task list, or its progress through steps.\n *\n * import { setupPlanCard } from '@aparte/plugin-cards/plan';\n *\n * setupPlanCard({ tool: 'update_plan' });\n *\n * // A tool whose INPUT is the list and whose result is only \"ok\" — Claude Code's\n * // `TodoWrite`, say — reads its input instead:\n * setupPlanCard({ tool: 'TodoWrite', map: (_result, input) => input });\n *\n * Three variants of one card: `checklist` (a header with \"3 of 7 done\" and a thin bar,\n * then one row per step with its status glyph, its detail and, once it finished, its\n * duration), `timeline` (a rail with a node per step coloured by its status, the start\n * time and duration beside each, the current node pulsing) and `compact` (one line —\n * \"Step 3 of 7: Running the tests\", a ring and the percentage — for a running plan in a\n * small space).\n *\n * This is the card an agent updates while it works: the same call re-sent with new\n * statuses, which the kit draws into the SAME root. So a step changing STATUS changes no\n * row's height: the title holds the room of its bold form and, for a todo with an active\n * form (Claude Code's `activeForm`), of both wordings; a timed plan keeps every row's\n * duration slot, filled or not, as wide as the language's widest duration; and the\n * timeline keeps every node's time line.\n *\n * What the card cannot hold for an update it has not seen: a detail the update brings (a\n * line under the title appears), a title the tool rewrites, and the first time a plan\n * carries — every row gains its time slot then, unless the plan said `timed: true` from its\n * first draw. LangGraph's `past_steps` results are not drawn at all: every step gains one\n * on completing, so every step would grow; a `map` that wants them gives them as `detail`.\n *\n * Your tool keeps its own fields: `readPlan` reads `{ title, goal, steps }`, a bare list of\n * steps, a list of strings (each a step to do), a Markdown checklist (`- [x] Write the\n * tests`), and the shapes agents already emit — Claude Code's and OpenAI's todo lists\n * (`todos[]` of `content`/`activeForm`/`status`), Codex's `plan[]` of `step`/`status`,\n * LangGraph's plan-and-execute state (`plan: string[]` and `past_steps` of\n * `[step, result]`), and `tasks[]` of `name`/`state`/`done`. `map` covers the rest.\n */\nimport type { AparteConfig } from '@aparte/core';\nimport { defineCard, type CardContext, type CardSetupOptions } from '../kit/define.js';\nimport { el, glyph, num, str } from '../kit/dom.js';\nimport { formatNumber, formatPercent, toDate } from '../kit/format.js';\nimport { intlTag, word, type CardWord } from '../kit/strings.js';\nimport { CLOCK, NODE_CURRENT, PLAN, STATUS_GLYPHS } from './icons.js';\nimport planStyles from './plan.css?raw';\n\nexport type PlanVariant = 'checklist' | 'timeline' | 'compact';\n\n/** Where a step stands. */\nexport type PlanStatus = 'pending' | 'in-progress' | 'done' | 'failed' | 'skipped' | 'blocked';\n\ntype When = string | number | Date;\n\n/**\n * One step as `map` returns it. Only `title` is needed; a step without `status` is\n * `pending` (or, when it has sub-steps, where they stand).\n */\nexport interface PlanStepInput {\n title: string;\n /** The wording while it runs (\"Running the tests\"), Claude Code's `activeForm`: shown while the step is in progress. */\n activeForm?: string;\n /** `pending`, `in-progress`, `done`, `failed`, `skipped`, `blocked` — or the usual words for them (`todo`, `running`, `completed`, `error`, `cancelled`…). */\n status?: PlanStatus | string;\n /** One or two lines under the title: what it did, why it failed. */\n detail?: string;\n startedAt?: When;\n finishedAt?: When;\n /** In seconds; worked out from the two dates when it is absent. */\n duration?: number;\n /** One level of sub-steps. */\n substeps?: Array<PlanStepInput | string>;\n id?: string;\n}\n\n/** What `map` returns: a plan, a list of steps, or a list of strings. */\nexport type PlanInput =\n | {\n title?: string;\n goal?: string;\n steps: Array<PlanStepInput | string>;\n updatedAt?: When;\n /**\n * The steps will carry times (a start, a duration) — say it before the first one does,\n * and every row keeps its time slot from the first draw, so the update that brings the\n * first time moves no row. Without it, the slots appear with that update.\n */\n timed?: boolean;\n }\n | Array<PlanStepInput | string>;\n\n/** One step as the card draws it, once read. */\nexport interface PlanStep {\n /** The wording shown now: the active form while the step runs, when it has one. */\n title: string;\n /**\n * The other wording — the active form while `title` is the plain one, and the reverse.\n * Never shown: the title holds its room too, so the update that switches wording moves no row.\n */\n altTitle?: string;\n status: PlanStatus;\n detail?: string;\n startedAt?: Date;\n finishedAt?: Date;\n /** Seconds, never negative. */\n duration?: number;\n /** Never nested deeper. */\n substeps?: PlanStep[];\n id?: string;\n}\n\n/** The data as the card draws it. */\nexport interface PlanData {\n title?: string;\n goal?: string;\n /** One at least; at most fifty, sub-steps counted. */\n steps: PlanStep[];\n updatedAt?: Date;\n /** The plan said its steps will carry times: their slots are kept from the first draw. */\n timed?: boolean;\n}\n\n/** How far a plan has got, over its top-level steps. */\nexport interface PlanProgress {\n total: number;\n done: number;\n skipped: number;\n failed: number;\n blocked: number;\n /** `done` + `skipped`: what the bar fills with. */\n finished: number;\n /** `finished / total`, 0–1. */\n ratio: number;\n /** The step under way: the first in progress, else the first to do, else the first blocked. */\n current?: PlanStep;\n currentIndex?: number;\n /** With nothing left to do, the first step that failed — where the plan stopped. */\n stoppedIndex?: number;\n /** Seconds from the first start to the last date the plan holds, else the sum of the durations. */\n elapsed?: number;\n}\n\nconst W = {\n cardsPlanTitle: { en: 'Plan', fr: 'Plan', de: 'Plan', es: 'Plan', it: 'Piano', ja: '計画', ko: '계획', pt: 'Plano', ru: 'План', zh: '计划' },\n cardsPlanProgress: {\n en: '{done} of {total} done', fr: '{done} sur {total} terminées', de: '{done} von {total} erledigt', es: '{done} de {total} completados',\n it: '{done} di {total} completati', ja: '{total}件中{done}件完了', ko: '{total}개 중 {done}개 완료', pt: '{done} de {total} concluídos',\n ru: 'Выполнено {done} из {total}', zh: '已完成 {done}/{total}',\n },\n cardsPlanSkipped: {\n en: '{n} skipped', fr: 'Ignorées : {n}', de: 'Übersprungen: {n}', es: 'Omitidos: {n}', it: 'Saltati: {n}',\n ja: 'スキップ {n}件', ko: '건너뜀 {n}개', pt: 'Ignorados: {n}', ru: 'Пропущено: {n}', zh: '已跳过 {n} 项',\n },\n cardsPlanFailed: {\n en: '{n} failed', fr: 'Échecs : {n}', de: 'Fehlgeschlagen: {n}', es: 'Fallidos: {n}', it: 'Falliti: {n}',\n ja: '失敗 {n}件', ko: '실패 {n}개', pt: 'Falhas: {n}', ru: 'Ошибок: {n}', zh: '失败 {n} 项',\n },\n cardsPlanElapsed: {\n en: '{time} elapsed', fr: 'Durée : {time}', de: 'Dauer: {time}', es: 'Duración: {time}', it: 'Durata: {time}',\n ja: '経過時間 {time}', ko: '경과 {time}', pt: 'Duração: {time}', ru: 'Прошло: {time}', zh: '用时 {time}',\n },\n cardsPlanStepNow: {\n en: 'Step {n} of {total}:', fr: 'Étape {n} sur {total} :', de: 'Schritt {n} von {total}:', es: 'Paso {n} de {total}:',\n it: 'Passo {n} di {total}:', ja: 'ステップ {n}/{total}:', ko: '{total}단계 중 {n}단계:', pt: 'Etapa {n} de {total}:',\n ru: 'Шаг {n} из {total}:', zh: '第 {n}/{total} 步:',\n },\n cardsPlanAllDone: {\n en: 'All steps done', fr: 'Toutes les étapes sont terminées', de: 'Alle Schritte erledigt', es: 'Todos los pasos completados',\n it: 'Tutti i passi completati', ja: 'すべてのステップが完了', ko: '모든 단계 완료', pt: 'Todas as etapas concluídas',\n ru: 'Все шаги выполнены', zh: '所有步骤已完成',\n },\n cardsPlanStatusPending: { en: 'To do', fr: 'À faire', de: 'Offen', es: 'Pendiente', it: 'Da fare', ja: '未着手', ko: '대기', pt: 'A fazer', ru: 'Не начато', zh: '待办' },\n cardsPlanStatusInProgress: { en: 'In progress', fr: 'En cours', de: 'In Arbeit', es: 'En curso', it: 'In corso', ja: '進行中', ko: '진행 중', pt: 'Em andamento', ru: 'Выполняется', zh: '进行中' },\n cardsPlanStatusDone: { en: 'Done', fr: 'Terminé', de: 'Erledigt', es: 'Hecho', it: 'Fatto', ja: '完了', ko: '완료', pt: 'Concluído', ru: 'Готово', zh: '已完成' },\n cardsPlanStatusFailed: { en: 'Failed', fr: 'Échec', de: 'Fehlgeschlagen', es: 'Fallido', it: 'Non riuscito', ja: '失敗', ko: '실패', pt: 'Falhou', ru: 'Ошибка', zh: '失败' },\n cardsPlanStatusSkipped: { en: 'Skipped', fr: 'Ignoré', de: 'Übersprungen', es: 'Omitido', it: 'Saltato', ja: 'スキップ', ko: '건너뜀', pt: 'Ignorado', ru: 'Пропущено', zh: '已跳过' },\n cardsPlanStatusBlocked: { en: 'Blocked', fr: 'Bloqué', de: 'Blockiert', es: 'Bloqueado', it: 'Bloccato', ja: 'ブロック中', ko: '차단됨', pt: 'Bloqueado', ru: 'Заблокировано', zh: '受阻' },\n cardsPlanSummary: {\n en: '{done}/{total} done', fr: '{done}/{total} terminées', de: '{done}/{total} erledigt', es: '{done}/{total} completados',\n it: '{done}/{total} completati', ja: '{done}/{total} 完了', ko: '{done}/{total} 완료', pt: '{done}/{total} concluídos',\n ru: 'выполнено {done}/{total}', zh: '已完成 {done}/{total}',\n },\n cardsPlanNow: {\n en: 'now: {step}', fr: 'en cours : {step}', de: 'jetzt: {step}', es: 'ahora: {step}', it: 'ora: {step}',\n ja: '実行中:{step}', ko: '현재: {step}', pt: 'agora: {step}', ru: 'сейчас: {step}', zh: '当前:{step}',\n },\n} satisfies Record<string, CardWord>;\n\ntype WordKey = keyof typeof W;\n\nconst say = (config: AparteConfig, key: WordKey, vars?: Record<string, string>) => word(config, key, W[key], vars);\n\nconst STATUS_WORD: Record<PlanStatus, WordKey> = {\n pending: 'cardsPlanStatusPending',\n 'in-progress': 'cardsPlanStatusInProgress',\n done: 'cardsPlanStatusDone',\n failed: 'cardsPlanStatusFailed',\n skipped: 'cardsPlanStatusSkipped',\n blocked: 'cardsPlanStatusBlocked',\n};\n\n/** Fifty, sub-steps counted: past that a plan is a backlog, not something to follow. */\nexport const PLAN_STEPS_SHOWN = 50;\n\n// ── Reading ──────────────────────────────────────────────────────────────────\n\ntype Raw = Record<string, unknown>;\n\nconst isObject = (value: unknown): value is Raw => !!value && typeof value === 'object' && !Array.isArray(value);\n\nconst notNull = <T>(value: T | null | undefined): value is T => value !== null && value !== undefined;\n\n/** The first of `keys` that `r` has a value for. */\nfunction pick(r: Raw, keys: readonly string[]): unknown {\n for (const key of keys) if (r[key] !== undefined && r[key] !== null && r[key] !== '') return r[key];\n return undefined;\n}\n\n/** The words tools use for each status, written lower-case with dashes. */\nconst STATUS_ALIASES: Record<PlanStatus, readonly string[]> = {\n pending: ['pending', 'todo', 'to-do', 'open', 'queued', 'planned', 'not-started', 'notstarted', 'new', 'waiting', 'scheduled', 'upcoming', 'ready', 'idle', 'backlog'],\n 'in-progress': ['in-progress', 'inprogress', 'progress', 'doing', 'running', 'active', 'current', 'started', 'working', 'executing', 'ongoing', 'processing', 'in-flight'],\n done: ['done', 'completed', 'complete', 'success', 'succeeded', 'successful', 'finished', 'ok', 'passed', 'resolved', 'closed', 'checked'],\n failed: ['failed', 'fail', 'failure', 'error', 'errored', 'aborted', 'timeout', 'timed-out', 'crashed'],\n skipped: ['skipped', 'skip', 'cancelled', 'canceled', 'omitted', 'not-needed', 'wont-do', \"won't-do\", 'wontdo', 'obsolete', 'dropped'],\n blocked: ['blocked', 'on-hold', 'onhold', 'paused', 'stuck', 'held', 'needs-input', 'needs-approval', 'awaiting-input', 'awaiting-approval'],\n};\n\nconst STATUS_OF = new Map<string, PlanStatus>(\n (Object.entries(STATUS_ALIASES) as Array<[PlanStatus, readonly string[]]>).flatMap(([status, words]) => words.map((w) => [w, status] as const)),\n);\n\n/** A status from what a tool wrote — `\"in_progress\"`, `\"Running\"`, `true` — or `undefined` for a word it does not know. */\nexport function readStatus(value: unknown): PlanStatus | undefined {\n if (typeof value === 'boolean') return value ? 'done' : 'pending';\n if (typeof value !== 'string') return undefined;\n return STATUS_OF.get(value.trim().toLowerCase().replace(/[\\s_]+/g, '-'));\n}\n\nconst STATUS_KEYS = ['status', 'state', 'stage', 'phase'] as const;\nconst DONE_FLAGS = ['done', 'completed', 'complete', 'checked', 'finished', 'isDone', 'is_done', 'isCompleted', 'is_completed'] as const;\nconst ACTIVE_FLAGS = ['active', 'running', 'current', 'inProgress', 'in_progress'] as const;\nconst TITLE_KEYS = ['title', 'content', 'name', 'label', 'text', 'task', 'step', 'action', 'description'] as const;\nconst ACTIVE_FORM_KEYS = ['activeForm', 'active_form', 'activeTitle', 'active_title'] as const;\nconst DETAIL_KEYS = ['detail', 'details', 'description', 'note', 'notes', 'summary', 'result', 'output', 'observation', 'message', 'reason'] as const;\nconst START_KEYS = ['startedAt', 'started_at', 'startTime', 'start_time', 'startDate', 'start_date', 'start', 'begin'] as const;\nconst END_KEYS = ['finishedAt', 'finished_at', 'completedAt', 'completed_at', 'endedAt', 'ended_at', 'endTime', 'end_time', 'doneAt', 'done_at', 'end'] as const;\nconst SECONDS_KEYS = ['duration', 'durationSeconds', 'duration_seconds', 'durationSec', 'elapsed', 'seconds', 'took'] as const;\nconst MS_KEYS = ['durationMs', 'duration_ms', 'elapsedMs', 'elapsed_ms', 'tookMs', 'took_ms'] as const;\nconst SUB_KEYS = ['substeps', 'subSteps', 'sub_steps', 'subtasks', 'subTasks', 'children', 'steps', 'todos', 'items', 'checklist'] as const;\nconst LIST_KEYS = ['steps', 'todos', 'tasks', 'items', 'checklist', 'stages', 'phases', 'subtasks', 'plan'] as const;\nconst PAST_KEYS = ['past_steps', 'pastSteps', 'completed_steps', 'completedSteps'] as const;\nconst PLAN_TITLE_KEYS = ['title', 'name', 'heading'] as const;\nconst GOAL_KEYS = ['goal', 'objective', 'task', 'input', 'query', 'request', 'description', 'explanation', 'summary'] as const;\nconst UPDATED_KEYS = ['updatedAt', 'updated_at', 'lastUpdated', 'last_updated', 'asOf', 'as_of', 'timestamp'] as const;\n\n/** A status the object says, by a word or by a flag. */\nfunction statusOf(r: Raw): PlanStatus | undefined {\n const said = readStatus(pick(r, STATUS_KEYS));\n if (said) return said;\n if (r['failed'] === true || r['error'] === true || str(r['error'])) return 'failed';\n if (r['skipped'] === true || r['cancelled'] === true || r['canceled'] === true) return 'skipped';\n if (r['blocked'] === true) return 'blocked';\n const active = ACTIVE_FLAGS.some((key) => r[key] === true);\n for (const key of DONE_FLAGS) {\n if (typeof r[key] === 'boolean') return r[key] ? 'done' : active ? 'in-progress' : 'pending';\n }\n return active ? 'in-progress' : undefined;\n}\n\n/**\n * A parent's status from its sub-steps, when it says none: done once they all are,\n * under way as soon as one started, failed when one failed and nothing else runs.\n */\nfunction fromSubsteps(subs: PlanStep[]): PlanStatus {\n const has = (status: PlanStatus) => subs.some((s) => s.status === status);\n if (subs.every((s) => s.status === 'done' || s.status === 'skipped')) return has('done') ? 'done' : 'skipped';\n if (has('in-progress')) return 'in-progress';\n if (has('failed')) return 'failed';\n if (has('done') || has('skipped')) return 'in-progress';\n if (has('blocked')) return 'blocked';\n return 'pending';\n}\n\n/** `- [x] Write the tests` → its title and status; a list marker and a checkbox are both optional. Only the prefix is matched: the rest of the line is sliced, so nothing can fail and backtrack. */\nconst PREFIX = /^\\s*(?:(?:[-*+•]|\\d+[.)])\\s+)?(?:\\[([ xX✓✔>~!-])\\]\\s*)?/;\n/** A line that is a list item: a marker, or a checkbox. */\nconst ITEM = /^\\s*(?:(?:[-*+•]|\\d+[.)])\\s+|\\[[ xX✓✔>~!-]\\])/;\n\nconst BOX: Record<string, PlanStatus> = { ' ': 'pending', x: 'done', X: 'done', '✓': 'done', '✔': 'done', '>': 'in-progress', '!': 'failed', '-': 'skipped', '~': 'blocked' };\n\nfunction checkbox(text: string): { title: string; status?: PlanStatus } | null {\n const match = PREFIX.exec(text)!;\n const title = text.slice(match[0].length).trim();\n if (!title) return null;\n return { title, ...(match[1] !== undefined ? { status: BOX[match[1]]! } : {}) };\n}\n\n/**\n * A Markdown checklist or list, as a model writes it in text: one step per item, an item\n * indented under another is its sub-step, a first line that is no item is the title.\n * `null` when a line further down is not an item — that is prose, not a plan.\n */\nfunction parseText(text: string): { title?: string; steps: PlanStep[] } | null {\n const lines = text.split(/\\r?\\n/).filter((line) => line.trim());\n let title: string | undefined;\n const steps: PlanStep[] = [];\n for (const [index, line] of lines.entries()) {\n if (!ITEM.test(line)) {\n if (index > 0) return null;\n // A model titles its list with a heading as often as with a sentence: `## Deploy plan`.\n title = line.trim().replace(/^#{1,6}\\s+/, '').replace(/:$/, '') || undefined;\n continue;\n }\n const step = readStep(line, 1);\n if (!step) continue;\n const parent = steps[steps.length - 1];\n // Indented by two spaces or more, or by a tab — one character, a whole level.\n if (/^(?:\\t|\\s{2,})/.test(line) && parent) (parent.substeps ??= []).push(step);\n else steps.push(step);\n }\n return steps.length ? { ...(title ? { title } : {}), steps } : null;\n}\n\n/** One step from whatever a tool wrote, or `null` without a title. `depth` 1 reads no sub-steps. */\nfunction readStep(raw: unknown, depth: number, forced?: PlanStatus): PlanStep | null {\n if (typeof raw === 'string' || typeof raw === 'number') {\n const line = checkbox(String(raw));\n return line ? { title: line.title, status: line.status ?? forced ?? 'pending' } : null;\n }\n if (Array.isArray(raw)) {\n // A `[step, result]` pair, as LangGraph's `past_steps` keeps them. The result is not\n // drawn: it arrives as the step completes, so as a detail it would add a line to every\n // step at that moment — and it is the executor's whole answer, not a line about the step.\n return readStep(raw[0], depth, forced);\n }\n if (!isObject(raw)) return null;\n const r = raw;\n // Only a text names a step: `step: 3` is an index, not a title.\n const titleKey = TITLE_KEYS.find((key) => typeof r[key] === 'string' && (r[key] as string).trim());\n let title = titleKey ? (r[titleKey] as string).trim() : undefined;\n if (!title) return null;\n\n const subsRaw = depth === 0 ? SUB_KEYS.map((key) => r[key]).find(Array.isArray) : undefined;\n const substeps = subsRaw ? subsRaw.map((item) => readStep(item, 1)).filter(notNull) : [];\n\n const startedAt = toDate(pick(r, START_KEYS)) ?? undefined;\n const finishedAt = toDate(pick(r, END_KEYS)) ?? undefined;\n const status = statusOf(r) ?? forced\n ?? (substeps.length ? fromSubsteps(substeps) : finishedAt ? 'done' : startedAt ? 'in-progress' : 'pending');\n\n // \"Running the tests\" while it runs, \"Run the tests\" before and after — Claude Code's pair.\n // The wording not shown is kept too, for the title to hold its room.\n const active = str(pick(r, ACTIVE_FORM_KEYS));\n let altTitle: string | undefined;\n if (active && active !== title) {\n if (status === 'in-progress') [title, altTitle] = [active, title];\n else altTitle = active;\n }\n\n const error = str(r['error']);\n const detail = (status === 'failed' ? error : undefined)\n ?? str(pick(r, DETAIL_KEYS.filter((key) => key !== titleKey)));\n\n const seconds = num(pick(r, SECONDS_KEYS));\n const ms = num(pick(r, MS_KEYS));\n let duration = seconds ?? (ms !== undefined ? ms / 1000 : undefined);\n if (duration === undefined && startedAt && finishedAt && finishedAt >= startedAt) duration = (finishedAt.getTime() - startedAt.getTime()) / 1000;\n if (duration !== undefined && duration < 0) duration = undefined;\n const id = str(pick(r, ['id', 'key', 'uuid']));\n\n return {\n title,\n ...(altTitle ? { altTitle } : {}),\n status,\n ...(detail ? { detail } : {}),\n ...(startedAt ? { startedAt } : {}),\n ...(finishedAt ? { finishedAt } : {}),\n ...(duration !== undefined ? { duration } : {}),\n ...(substeps.length ? { substeps } : {}),\n ...(id ? { id } : {}),\n };\n}\n\n/** At most fifty steps, sub-steps counted: a long list keeps its first steps whole, then stops. */\nfunction cap(steps: PlanStep[]): PlanStep[] {\n let left = PLAN_STEPS_SHOWN;\n const kept: PlanStep[] = [];\n for (const step of steps) {\n if (left <= 0) break;\n left -= 1;\n if (!step.substeps) {\n kept.push(step);\n continue;\n }\n const substeps = step.substeps.slice(0, left);\n left -= substeps.length;\n const copy: PlanStep = { ...step, substeps };\n if (!substeps.length) delete copy.substeps;\n kept.push(copy);\n }\n return kept;\n}\n\n/**\n * The card's data from the loose shape `map` returns — `{ title, goal, steps }` (also\n * `todos`, `tasks`, `items`, `plan`…), a list of steps or of strings, a Markdown\n * checklist, LangGraph's `{ plan, past_steps }` — or `null` when it holds no step.\n */\nexport function readPlan(raw: unknown): PlanData | null {\n if (typeof raw === 'string') {\n const parsed = parseText(raw);\n return parsed ? { ...(parsed.title ? { title: parsed.title } : {}), steps: cap(parsed.steps) } : null;\n }\n if (Array.isArray(raw)) {\n const steps = cap(raw.map((item) => readStep(item, 0)).filter(notNull));\n return steps.length ? { steps } : null;\n }\n if (!isObject(raw)) return null;\n const r = raw;\n const title = str(pick(r, PLAN_TITLE_KEYS));\n const goal = str(pick(r, GOAL_KEYS));\n const updatedAt = toDate(pick(r, UPDATED_KEYS)) ?? undefined;\n const meta = { ...(title ? { title } : {}), ...(goal ? { goal } : {}), ...(updatedAt ? { updatedAt } : {}), ...(r['timed'] === true ? { timed: true } : {}) };\n\n // A plan wrapped once more: `{ plan: { title, steps } }`. The outer words fill what it lacks.\n if (isObject(r['plan'])) {\n const inner = readPlan(r['plan']);\n return inner ? { ...meta, ...inner } : null;\n }\n\n const past = PAST_KEYS.map((key) => r[key]).find(Array.isArray) ?? [];\n const list = LIST_KEYS.map((key) => r[key]).find((value) => Array.isArray(value) || typeof value === 'string');\n const ahead = Array.isArray(list) ? list.map((item) => readStep(item, 0)).filter(notNull)\n : typeof list === 'string' ? parseText(list)?.steps ?? []\n : [];\n const steps = cap([...past.map((item) => readStep(item, 0, 'done')).filter(notNull), ...ahead]);\n return steps.length ? { ...meta, steps } : null;\n}\n\n// ── Progress ─────────────────────────────────────────────────────────────────\n\nconst allSteps = (data: PlanData) => data.steps.flatMap((step) => [step, ...(step.substeps ?? [])]);\n\n/** Seconds from the first start to the last date the plan holds, else the durations added up. */\nfunction elapsedOf(data: PlanData): number | undefined {\n const steps = allSteps(data);\n const starts = steps.map((s) => s.startedAt?.getTime()).filter(notNull);\n if (starts.length) {\n const ends = steps.flatMap((s) => [s.startedAt?.getTime(), s.finishedAt?.getTime()]).filter(notNull);\n if (data.updatedAt) ends.push(data.updatedAt.getTime());\n const span = (Math.max(...ends) - Math.min(...starts)) / 1000;\n if (span > 0) return span;\n }\n const sum = data.steps.reduce((total, s) => total + (s.duration ?? (s.substeps ?? []).reduce((t, sub) => t + (sub.duration ?? 0), 0)), 0);\n return sum > 0 ? sum : undefined;\n}\n\n/** How far the plan has got, counted over its top-level steps. */\nexport function planProgress(data: PlanData): PlanProgress {\n const steps = data.steps;\n const count = (status: PlanStatus) => steps.filter((s) => s.status === status).length;\n const total = steps.length;\n const done = count('done');\n const skipped = count('skipped');\n const finished = done + skipped;\n let currentIndex = steps.findIndex((s) => s.status === 'in-progress');\n if (currentIndex < 0) currentIndex = steps.findIndex((s) => s.status === 'pending');\n if (currentIndex < 0) currentIndex = steps.findIndex((s) => s.status === 'blocked');\n const stoppedIndex = currentIndex < 0 ? steps.findIndex((s) => s.status === 'failed') : -1;\n const elapsed = elapsedOf(data);\n return {\n total,\n done,\n skipped,\n failed: count('failed'),\n blocked: count('blocked'),\n finished,\n ratio: total ? finished / total : 0,\n ...(currentIndex >= 0 ? { current: steps[currentIndex]!, currentIndex } : {}),\n ...(stoppedIndex >= 0 ? { stoppedIndex } : {}),\n ...(elapsed !== undefined ? { elapsed } : {}),\n };\n}\n\n/** A plan that says when its steps ran, or that it will: its rows keep a slot for the time. */\nconst isTimed = (data: PlanData) => data.timed === true || allSteps(data).some((s) => s.startedAt || s.finishedAt || s.duration !== undefined);\n\n// ── Writing times ────────────────────────────────────────────────────────────\n\n/** A duration, its two largest units in their narrow form: `45s`, `1m 20s`, `2h 5m`, `0.4s`. */\nexport function durationText(config: AparteConfig, seconds: number): string {\n const tag = intlTag(config);\n const unit = (value: number, name: string, digits = 0) =>\n new Intl.NumberFormat(tag, { style: 'unit', unit: name, unitDisplay: 'narrow', maximumFractionDigits: digits }).format(value);\n const s = Math.max(0, seconds);\n if (s < 10 && !Number.isInteger(s)) return unit(s, 'second', 1);\n let rest = Math.round(s);\n if (rest < 60) return unit(rest, 'second');\n const parts: string[] = [];\n let slots = 0;\n for (const [name, size] of [['day', 86_400], ['hour', 3_600], ['minute', 60], ['second', 1]] as const) {\n const n = Math.floor(rest / size);\n rest -= n * size;\n if (n > 0) parts.push(unit(n, name));\n if (n > 0 || slots) slots += 1;\n if (slots === 2) break;\n }\n try {\n return new Intl.ListFormat(tag, { type: 'unit', style: 'narrow' }).format(parts);\n } catch {\n return parts.join(' ');\n }\n}\n\n/** A duration as `<time datetime>` takes it: `PT80S`. */\nconst isoDuration = (seconds: number) => `PT${Math.round(seconds * 1000) / 1000}S`;\n\n/** The time of day a step started; with its seconds when the whole run fits in an hour, where they tell steps apart. */\nfunction clockText(config: AparteConfig, date: Date, seconds: boolean): string {\n return new Intl.DateTimeFormat(intlTag(config), { hour: 'numeric', minute: '2-digit', ...(seconds ? { second: '2-digit' } : {}) }).format(date);\n}\n\n/** Whether the plan's dates all fall within an hour. */\nfunction withinAnHour(data: PlanData): boolean {\n const times = allSteps(data).flatMap((s) => [s.startedAt?.getTime(), s.finishedAt?.getTime()]).filter(notNull);\n return !times.length || Math.max(...times) - Math.min(...times) < 3_600_000;\n}\n\n// ── Drawing ──────────────────────────────────────────────────────────────────\n\nconst n = (config: AparteConfig, value: number) => formatNumber(config, value);\nconst percentOf = (part: number, total: number) => `${total ? (part / total) * 100 : 0}%`;\nconst FINISHED = new Set<PlanStatus>(['done', 'failed', 'skipped']);\n\nfunction statusGlyph(status: PlanStatus, className = 'aparte-plan__glyph'): HTMLElement {\n return glyph(STATUS_GLYPHS[status], `aparte-rich-card__glyph ${className}`);\n}\n\n/**\n * The step's title, holding the room of its bold form: the text and an invisible bold\n * copy share one grid cell, so the step that starts running turns bold without its line\n * growing or wrapping differently — the row the reader is looking at does not move. A step\n * with two wordings (\"Update\" / \"Updating the reference pages\") holds the room of the\n * other one too, in a second invisible copy.\n */\nfunction titleOf(step: PlanStep): HTMLElement {\n return el('span', { class: 'aparte-plan__step-title', attrs: { 'data-text': step.title, 'data-alt': step.altTitle } },\n el('span', { class: 'aparte-plan__step-title-text', text: step.title }));\n}\n\n/** The status in words, for a screen reader: the glyph and its colour say it to the eye only. */\nfunction statusText(ctx: CardContext, step: PlanStep): HTMLElement {\n const node = el('span', { class: 'aparte-sr-only aparte-plan__status' });\n ctx.bind(node, () => ` (${say(ctx.config, STATUS_WORD[step.status])})`);\n return node;\n}\n\nconst detailOf = (step: PlanStep) => (step.detail ? el('div', { class: 'aparte-plan__detail', text: step.detail }) : null);\n\n/**\n * The widest duration the language writes in two units — `59m 59s` in English,\n * `59 Min., 59 Sek.` in German. The checklist's duration slot holds its width (an invisible\n * copy, `data-reserve`): a fixed `3.5rem` held English and not German, so the first long\n * duration widened its slot and could wrap its title onto a second line.\n */\nfunction widestDuration(config: AparteConfig): string {\n return [3_599, 86_340, 604_799].map((s) => durationText(config, s)).reduce((a, b) => (b.length > a.length ? b : a));\n}\n\n/** How long a finished step took — always drawn in a timed plan, empty until it finished, so filling it moves nothing. */\nfunction durationOf(ctx: CardContext, step: PlanStep): HTMLElement {\n const shown = step.duration !== undefined && FINISHED.has(step.status) ? step.duration : undefined;\n const node = el('time', { class: 'aparte-plan__duration', attrs: { datetime: shown !== undefined ? isoDuration(shown) : undefined } });\n if (shown !== undefined) ctx.bind(node, () => durationText(ctx.config, shown));\n ctx.bind(node, () => widestDuration(ctx.config), 'data-reserve');\n return node;\n}\n\n/** The header: the title or the goal, \"3 of 7 done\", what was skipped or failed, the time taken — and, with `bar`, the bar. */\nfunction head(ctx: CardContext, data: PlanData, progress: PlanProgress, bar: boolean): HTMLElement {\n const heading = data.title ?? data.goal;\n const count = el('span', { class: 'aparte-plan__count' });\n ctx.bind(count, () => say(ctx.config, 'cardsPlanProgress', { done: n(ctx.config, progress.done), total: n(ctx.config, progress.total) }));\n const note = (kind: 'skipped' | 'failed', key: WordKey, value: number) => {\n if (!value) return null;\n const node = el('span', { class: 'aparte-plan__note', attrs: { 'data-kind': kind } });\n ctx.bind(node, () => say(ctx.config, key, { n: n(ctx.config, value) }));\n return node;\n };\n let elapsed: HTMLElement | null = null;\n if (progress.elapsed !== undefined) {\n const seconds = progress.elapsed;\n const text = el('span', { class: 'aparte-plan__elapsed-text' });\n ctx.bind(text, () => say(ctx.config, 'cardsPlanElapsed', { time: durationText(ctx.config, seconds) }));\n elapsed = el('span', { class: 'aparte-plan__elapsed' }, glyph(CLOCK, 'aparte-rich-card__glyph aparte-plan__clock'), text);\n }\n let track: HTMLElement | null = null;\n if (bar) {\n track = el('div', { class: 'aparte-plan__bar', attrs: { 'aria-hidden': 'true', 'data-complete': progress.total > 0 && progress.finished === progress.total } },\n el('span', { class: 'aparte-plan__bar-done' }),\n el('span', { class: 'aparte-plan__bar-skipped' }));\n track.style.setProperty('--aparte-plan-done-share', percentOf(progress.done, progress.total));\n track.style.setProperty('--aparte-plan-skipped-share', percentOf(progress.skipped, progress.total));\n }\n return el('div', { class: 'aparte-plan__head' },\n heading ? el('div', { class: 'aparte-plan__heading' },\n el('div', { class: 'aparte-plan__title', text: heading }),\n data.title && data.goal ? el('div', { class: 'aparte-plan__goal', text: data.goal }) : null) : null,\n el('div', { class: 'aparte-plan__meter' },\n count,\n note('skipped', 'cardsPlanSkipped', progress.skipped),\n note('failed', 'cardsPlanFailed', progress.failed),\n elapsed),\n track);\n}\n\n/** A row of the checklist, and its sub-steps under it. */\nfunction stepNode(ctx: CardContext, step: PlanStep, { timed, current = false, sub = false }: { timed: boolean; current?: boolean; sub?: boolean }): HTMLLIElement {\n const row = el('div', { class: 'aparte-plan__row' },\n statusGlyph(step.status),\n el('div', { class: 'aparte-plan__text' }, titleOf(step), statusText(ctx, step), detailOf(step)),\n timed ? durationOf(ctx, step) : null);\n const node = el('li', {\n class: `aparte-plan__step${sub ? ' aparte-plan__step--sub' : ''}`,\n attrs: { 'data-status': step.status, 'aria-current': current ? 'step' : undefined, 'data-step-id': step.id },\n }, row);\n if (step.substeps?.length) {\n node.append(el('ol', { class: 'aparte-plan__substeps', attrs: { role: 'list' } },\n ...step.substeps.map((s) => stepNode(ctx, s, { timed, sub: true }))));\n }\n return node;\n}\n\n/** The `checklist` variant: the header and its bar, then a row per step. */\nfunction checklist(ctx: CardContext, data: PlanData, progress: PlanProgress): Node[] {\n const timed = isTimed(data);\n const list = el('ol', { class: 'aparte-plan__steps', attrs: { role: 'list', 'data-timed': timed } },\n ...data.steps.map((step, i) => stepNode(ctx, step, { timed, current: i === progress.currentIndex })));\n return [head(ctx, data, progress, true), list];\n}\n\n/**\n * The time line of a timeline step: when it started, and how long it took. In a timed plan\n * every step has it, empty until it starts — the steps keep one rhythm, and a step that\n * starts fills its line instead of growing one.\n */\nfunction timesOf(ctx: CardContext, step: PlanStep, seconds: boolean): HTMLElement {\n const started = step.startedAt;\n const start = el('time', { class: 'aparte-plan__start', attrs: { datetime: started?.toISOString() } });\n if (started) ctx.bind(start, () => clockText(ctx.config, started, seconds));\n return el('div', { class: 'aparte-plan__meta' }, start, durationOf(ctx, step));\n}\n\n/** The `timeline` variant: a rail with a node per step, its time beside it. */\nfunction timeline(ctx: CardContext, data: PlanData, progress: PlanProgress): Node[] {\n const timed = isTimed(data);\n const seconds = withinAnHour(data);\n const list = el('ol', { class: 'aparte-plan__timeline', attrs: { role: 'list', 'data-timed': timed } });\n data.steps.forEach((step, i) => {\n const node = el('span', { class: 'aparte-plan__node' },\n glyph(step.status === 'in-progress' ? NODE_CURRENT : STATUS_GLYPHS[step.status], 'aparte-rich-card__glyph aparte-plan__node-glyph'));\n const body = el('div', { class: 'aparte-plan__event-body' },\n titleOf(step),\n statusText(ctx, step),\n timed ? timesOf(ctx, step, seconds) : null,\n detailOf(step),\n step.substeps?.length\n ? el('ol', { class: 'aparte-plan__substeps', attrs: { role: 'list' } }, ...step.substeps.map((s) => stepNode(ctx, s, { timed: false, sub: true })))\n : null);\n list.append(el('li', {\n class: 'aparte-plan__event',\n attrs: { 'data-status': step.status, 'aria-current': i === progress.currentIndex ? 'step' : undefined, 'data-step-id': step.id },\n }, node, body));\n });\n return [head(ctx, data, progress, false), list];\n}\n\nconst SVG = 'http://www.w3.org/2000/svg';\n\n/** The progress ring: what is done, then what was skipped, round a faint track. Numbers only. */\nfunction ring(progress: PlanProgress): HTMLElement {\n const svg = document.createElementNS(SVG, 'svg');\n svg.setAttribute('viewBox', '0 0 24 24');\n svg.setAttribute('class', 'aparte-plan__ring-svg');\n const arc = (cls: string, share?: number, offset = 0) => {\n const circle = document.createElementNS(SVG, 'circle');\n for (const [name, value] of [['cx', '12'], ['cy', '12'], ['r', '9.5'], ['pathLength', '100'], ['class', cls]]) circle.setAttribute(name!, value!);\n if (share !== undefined) {\n circle.setAttribute('stroke-dasharray', `${share} 100`);\n circle.setAttribute('stroke-dashoffset', String(-offset));\n }\n return circle;\n };\n const done = progress.total ? (progress.done / progress.total) * 100 : 0;\n const skipped = progress.total ? (progress.skipped / progress.total) * 100 : 0;\n svg.append(arc('aparte-plan__ring-track'), arc('aparte-plan__ring-done', done), arc('aparte-plan__ring-skipped', skipped, done));\n return el('span', { class: 'aparte-plan__ring', attrs: { 'aria-hidden': 'true', 'data-complete': progress.total > 0 && progress.finished === progress.total } }, svg);\n}\n\n/**\n * The `compact` variant: one line — the step under way (\"Step 3 of 7: Running the tests\"),\n * else where it stopped, else the plan's name and \"All steps done\" — a ring and the percentage.\n */\nfunction compact(ctx: CardContext, data: PlanData, progress: PlanProgress): Node[] {\n const index = progress.currentIndex ?? progress.stoppedIndex;\n const focus = index !== undefined ? data.steps[index] : undefined;\n const step = el('span', { class: 'aparte-plan__compact-step' });\n const parts: HTMLElement[] = [];\n if (focus) {\n ctx.bind(step, () => say(ctx.config, 'cardsPlanStepNow', { n: n(ctx.config, index! + 1), total: n(ctx.config, progress.total) }));\n parts.push(step, el('span', { class: 'aparte-plan__compact-title', text: focus.title }));\n } else {\n ctx.word(step, 'cardsPlanAllDone', W.cardsPlanAllDone);\n const name = data.title ?? data.goal;\n if (name) parts.push(el('span', { class: 'aparte-plan__compact-title', text: name }));\n parts.push(step);\n }\n const percent = el('span', { class: 'aparte-plan__percent' });\n ctx.bind(percent, () => formatPercent(ctx.config, progress.ratio));\n const status: PlanStatus = focus ? focus.status : 'done';\n return [el('div', { class: 'aparte-plan__compact', attrs: { 'data-status': status } },\n statusGlyph(status, 'aparte-plan__glyph aparte-plan__compact-glyph'),\n el('span', { class: 'aparte-plan__compact-text' }, ...parts),\n ring(progress),\n percent)];\n}\n\nfunction render(data: PlanData, ctx: CardContext<PlanVariant>): Node[] {\n const progress = planProgress(data);\n if (ctx.variant === 'timeline') return timeline(ctx, data, progress);\n if (ctx.variant === 'compact') return compact(ctx, data, progress);\n return checklist(ctx, data, progress);\n}\n\nfunction skeleton(partial: Partial<PlanData> | null, ctx: CardContext<PlanVariant>): Node[] {\n // The call's input may already be the plan — a todo tool's is: draw it while it runs.\n if (partial?.steps?.length) return render(partial as PlanData, ctx);\n const block = (cls: string, kind: 'text' | 'rect' | 'circle' = 'rect') =>\n el('span', { class: `aparte-skeleton aparte-skeleton--${kind} ${cls}`, attrs: { 'aria-hidden': 'true' } });\n const heading = partial?.title ?? partial?.goal;\n if (ctx.variant === 'compact') {\n return [el('div', { class: 'aparte-plan__compact' },\n block('aparte-plan__sk-glyph', 'circle'),\n el('span', { class: 'aparte-plan__compact-text' },\n heading ? el('span', { class: 'aparte-plan__compact-title', text: heading }) : block('aparte-plan__sk-line', 'text')),\n block('aparte-plan__sk-ring', 'circle'))];\n }\n const top = el('div', { class: 'aparte-plan__head' },\n heading ? el('div', { class: 'aparte-plan__heading' }, el('div', { class: 'aparte-plan__title', text: heading })) : block('aparte-plan__sk-title', 'text'),\n el('div', { class: 'aparte-plan__meter' }, block('aparte-plan__sk-count', 'text')),\n ctx.variant === 'checklist' ? el('div', { class: 'aparte-plan__bar', attrs: { 'aria-hidden': 'true' } }) : null);\n const rows = [0, 1, 2, 3];\n if (ctx.variant === 'timeline') {\n return [top, el('ol', { class: 'aparte-plan__timeline', attrs: { 'aria-hidden': 'true' } }, ...rows.map(() =>\n el('li', { class: 'aparte-plan__event', attrs: { 'data-status': 'pending' } },\n el('span', { class: 'aparte-plan__node' }, block('aparte-plan__sk-node', 'circle')),\n el('div', { class: 'aparte-plan__event-body' }, block('aparte-plan__sk-line', 'text'), block('aparte-plan__sk-meta', 'text')))))];\n }\n return [top, el('ol', { class: 'aparte-plan__steps', attrs: { 'aria-hidden': 'true' } }, ...rows.map(() =>\n el('li', { class: 'aparte-plan__step' },\n el('div', { class: 'aparte-plan__row' }, block('aparte-plan__sk-glyph', 'circle'), block('aparte-plan__sk-line', 'text')))))];\n}\n\nfunction cardLabel(data: Partial<PlanData> | null, ctx: CardContext): string {\n return data?.title ?? data?.goal ?? say(ctx.config, 'cardsPlanTitle');\n}\n\n/** The marker a step's line carries in the fallback — and which `readPlan` reads back. */\nconst MARK: Record<PlanStatus, string> = { done: '[x]', pending: '[ ]', 'in-progress': '[>]', failed: '[!]', skipped: '[-]', blocked: '[~]' };\n\n/** A detail kept short enough for one line of the fallback. */\nconst clip = (text: string) => (text.length > 120 ? `${text.slice(0, 119).trimEnd()}…` : text);\n\n/**\n * \"Deploy: 3/7 done — now: Run the tests\", then a line per step with its marker — what a\n * model reads back, and what a reader without the card gets.\n */\nfunction fallback(data: PlanData, ctx: CardContext): string {\n const progress = planProgress(data);\n const summary = say(ctx.config, 'cardsPlanSummary', { done: n(ctx.config, progress.done), total: n(ctx.config, progress.total) });\n const now = progress.current ? ` — ${say(ctx.config, 'cardsPlanNow', { step: progress.current.title })}` : '';\n const line = (step: PlanStep, indent: string) => {\n const why = (step.status === 'failed' || step.status === 'blocked') && step.detail ? ` — ${clip(step.detail)}` : '';\n return `${indent}- ${MARK[step.status]} ${step.title}${why}`;\n };\n const lines = data.steps.flatMap((step) => [line(step, ''), ...(step.substeps ?? []).map((sub) => line(sub, ' '))]);\n return [`${cardLabel(data, ctx)}: ${summary}${now}`, ...lines].join('\\n');\n}\n\nexport const planCard = defineCard<PlanData, PlanVariant>({\n name: 'plan',\n variants: ['checklist', 'timeline', 'compact'],\n styles: planStyles,\n icon: PLAN,\n normalize: readPlan,\n render,\n skeleton,\n label: cardLabel,\n fallback,\n partial: (input) => {\n const plan = readPlan(input);\n if (plan) return plan;\n const about = str(input['title'] ?? input['goal'] ?? input['task'] ?? input['objective'] ?? input['query']);\n return about ? { title: about } : null;\n },\n});\n\n/** Draw an agent's plan or task list as this card — returns the function that stops it. */\nexport function setupPlanCard(options: CardSetupOptions<PlanData, PlanVariant> = {}): () => void {\n return planCard.setup(options);\n}\n"],
|
|
5
5
|
"mappings": "+JAUA,IAAMA,EAAM,CAACC,EAAcC,IACvB,OAAOA,EAAY,WAAWA,CAAS,IAAM,EAAE,+JAA+JD,CAAI,SAGhNE,GAAUH,EAAI,iCAAiC,EAG/CI,GAAUJ,EAAI,+EAAgF,sBAAsB,EAGpHK,GAAOL,EAAI,gIAAgI,EAG3IM,GAASN,EAAI,2IAA2I,EAGxJO,GAAUP,EAAI,mFAAmF,EAGjGQ,GAAUR,EAAI,wGAAwG,EAG/GS,EAAgB,CACzB,QAASN,GACT,cAAeC,GACf,KAAMC,GACN,OAAQC,GACR,QAASC,GACT,QAASC,EACb,EAGaE,GAAeV,EAAI,kGAAkG,EAGrHW,GAAQX,EAAI,iEAAiE,EAG7EY,GAAOZ,EAAI,kPAAkP,EChD1Qa,GAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAG,EAC9D,EACMnI,EAAQuC,EAAK,MAAM,QAASnC,GAAS,CAACH,EAAKG,EAAM,EAAE,EAAG,IAAIA,EAAK,UAAY,CAAA,GAAI,IAAK2C,GAAQ9C,EAAK8C,EAAK,IAAI,CAAC,CAAC,CAAC,EACnH,MAAO,CAAC,GAAG6E,GAAUrF,EAAM2C,CAAG,CAAC,KAAK8C,CAAO,GAAGC,CAAG,GAAI,GAAGjI,CAAK,EAAE,KAAK;CAAI,CAC5E,CAEO,IAAMoI,GAAWC,EAAkC,CACtD,KAAM,OACN,SAAU,CAAC,YAAa,WAAY,SAAS,EAC7C,OAAQ1L,GACR,KAAMD,GACN,UAAWmF,EACX,OAAAyF,EACA,SAAAC,GACA,MAAOK,GACP,SAAAG,GACA,QAAUO,GAAU,CAChB,IAAMC,EAAO1G,EAASyG,CAAK,EAC3B,GAAIC,EAAM,OAAOA,EACjB,IAAMC,EAAQtJ,EAAIoJ,EAAM,OAAYA,EAAM,MAAWA,EAAM,MAAWA,EAAM,WAAgBA,EAAM,KAAQ,EAC1G,OAAOE,EAAQ,CAAE,MAAOA,CAAA,EAAU,IACtC,CACJ,CAAC,EAGM,SAASC,GAAcC,EAAmD,CAAA,EAAgB,CAC7F,OAAON,GAAS,MAAMM,CAAO,CACjC",
|
|
6
6
|
"names": ["svg", "body", "className", "PENDING", "RUNNING", "DONE", "FAILED", "SKIPPED", "BLOCKED", "STATUS_GLYPHS", "NODE_CURRENT", "CLOCK", "PLAN", "planStyles", "W", "say", "config", "key", "vars", "word", "STATUS_WORD", "PLAN_STEPS_SHOWN", "isObject", "value", "notNull", "pick", "r", "keys", "STATUS_ALIASES", "STATUS_OF", "status", "words", "w", "readStatus", "STATUS_KEYS", "DONE_FLAGS", "ACTIVE_FLAGS", "TITLE_KEYS", "ACTIVE_FORM_KEYS", "DETAIL_KEYS", "START_KEYS", "END_KEYS", "SECONDS_KEYS", "MS_KEYS", "SUB_KEYS", "LIST_KEYS", "PAST_KEYS", "PLAN_TITLE_KEYS", "GOAL_KEYS", "UPDATED_KEYS", "statusOf", "said", "str", "active", "fromSubsteps", "subs", "has", "s", "PREFIX", "ITEM", "BOX", "checkbox", "text", "match", "title", "parseText", "lines", "line", "steps", "index", "step", "readStep", "parent", "raw", "depth", "forced", "titleKey", "subsRaw", "substeps", "item", "startedAt", "toDate", "finishedAt", "altTitle", "error", "detail", "seconds", "num", "ms", "duration", "id", "cap", "left", "kept", "copy", "readPlan", "parsed", "goal", "updatedAt", "meta", "inner", "past", "list", "ahead", "allSteps", "data", "elapsedOf", "starts", "ends", "span", "sum", "total", "t", "sub", "planProgress", "count", "done", "skipped", "finished", "currentIndex", "stoppedIndex", "elapsed", "isTimed", "durationText", "tag", "intlTag", "unit", "name", "digits", "rest", "parts", "slots", "size", "n", "isoDuration", "clockText", "date", "withinAnHour", "times", "formatNumber", "percentOf", "part", "FINISHED", "statusGlyph", "glyph", "titleOf", "el", "statusText", "ctx", "node", "detailOf", "widestDuration", "a", "b", "durationOf", "shown", "head", "progress", "bar", "heading", "note", "kind", "track", "stepNode", "timed", "current", "row", "checklist", "i", "timesOf", "started", "start", "timeline", "SVG", "ring", "arc", "cls", "share", "offset", "circle", "compact", "focus", "percent", "formatPercent", "render", "skeleton", "partial", "block", "top", "rows", "cardLabel", "MARK", "clip", "fallback", "summary", "now", "indent", "why", "planCard", "defineCard", "input", "plan", "about", "setupPlanCard", "options"]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as z}from"./chunk-
|
|
1
|
+
import{a as z}from"./chunk-7K4YMHQR.js";import{a as C}from"./chunk-Y44OMGIJ.js";import{a as i,b as y,d as m,e as g,f as l,i as _,o as G,q as b,r as Q,s as O,t as X,u as Y}from"./chunk-S6J6TTL4.js";import"./chunk-L72XRVUT.js";import"./chunk-XAWE4EAK.js";var P=t=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">${t}</svg>`,ca=P('<path d="M5.5 8h13l-1 11.2a1.8 1.8 0 0 1-1.8 1.6H8.3a1.8 1.8 0 0 1-1.8-1.6z"/><path d="M9 10.5V6.8a3 3 0 0 1 6 0v3.7"/>'),da=P('<path d="M2.8 6.5h10.4v9.3H2.8z"/><path d="M13.2 9.5h4.1l3 3.2v3.1h-7.1"/><circle cx="7" cy="17.3" r="1.7"/><circle cx="17" cy="17.3" r="1.7"/>'),la=P('<circle cx="10.8" cy="10.8" r="6.3"/><path d="M15.5 15.5l4.7 4.7"/>'),ua=P('<path d="M3.5 12.6V4.8a1.3 1.3 0 0 1 1.3-1.3h7.8l8 8a1.3 1.3 0 0 1 0 1.8l-7 7a1.3 1.3 0 0 1-1.8 0z"/><circle cx="8.3" cy="8.3" r="1.5"/>'),_a=`/* =========================================
|
|
2
2
|
The product card \u2014 @aparte/plugin-cards/product
|
|
3
3
|
=========================================
|
|
4
4
|
Three variants of one card, chosen by \`data-variant\` on its root:
|
|
@@ -677,4 +677,4 @@ import{a as z}from"./chunk-3ZPEJRUN.js";import{a as C}from"./chunk-KXLJFCTW.js";
|
|
|
677
677
|
}
|
|
678
678
|
`,u={cardsProductTitle:{en:"Products",fr:"Produits",de:"Produkte",es:"Productos",it:"Prodotti",ja:"\u5546\u54C1",ko:"\uC0C1\uD488",pt:"Produtos",ru:"\u0422\u043E\u0432\u0430\u0440\u044B",zh:"\u5546\u54C1"},cardsProductCount:{en:"{n} products",fr:"{n} produits",de:"{n} Produkte",es:"{n} productos",it:"{n} prodotti",ja:"{n}\u4EF6\u306E\u5546\u54C1",ko:"\uC0C1\uD488 {n}\uAC1C",pt:"{n} produtos",ru:"\u0422\u043E\u0432\u0430\u0440\u043E\u0432: {n}",zh:"{n} \u4EF6\u5546\u54C1"},cardsProductInStock:{en:"In stock",fr:"En stock",de:"Auf Lager",es:"En stock",it:"Disponibile",ja:"\u5728\u5EAB\u3042\u308A",ko:"\uC7AC\uACE0 \uC788\uC74C",pt:"Em estoque",ru:"\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438",zh:"\u6709\u8D27"},cardsProductLowStock:{en:"Only a few left",fr:"Plus que quelques-uns",de:"Nur noch wenige",es:"Quedan pocas unidades",it:"Ultimi pezzi",ja:"\u6B8B\u308A\u308F\u305A\u304B",ko:"\uD488\uC808 \uC784\uBC15",pt:"\xDAltimas unidades",ru:"\u041E\u0441\u0442\u0430\u043B\u043E\u0441\u044C \u043C\u0430\u043B\u043E",zh:"\u4EC5\u5269\u5C11\u91CF"},cardsProductOutOfStock:{en:"Out of stock",fr:"Rupture de stock",de:"Ausverkauft",es:"Agotado",it:"Esaurito",ja:"\u5728\u5EAB\u5207\u308C",ko:"\uD488\uC808",pt:"Esgotado",ru:"\u041D\u0435\u0442 \u0432 \u043D\u0430\u043B\u0438\u0447\u0438\u0438",zh:"\u7F3A\u8D27"},cardsProductPreorder:{en:"Pre-order",fr:"Pr\xE9commande",de:"Vorbestellbar",es:"Preventa",it:"Preordine",ja:"\u4E88\u7D04\u53D7\u4ED8\u4E2D",ko:"\uC608\uC57D \uD310\uB9E4",pt:"Pr\xE9-venda",ru:"\u041F\u0440\u0435\u0434\u0437\u0430\u043A\u0430\u0437",zh:"\u9884\u552E"},cardsProductWas:{en:"Was",fr:"Au lieu de",de:"Statt",es:"Antes",it:"Prima",ja:"\u901A\u5E38\u4FA1\u683C",ko:"\uC815\uAC00",pt:"De",ru:"\u0411\u044B\u043B\u043E",zh:"\u539F\u4EF7"},cardsProductFreeShipping:{en:"Free delivery",fr:"Livraison gratuite",de:"Kostenloser Versand",es:"Env\xEDo gratis",it:"Spedizione gratuita",ja:"\u9001\u6599\u7121\u6599",ko:"\uBB34\uB8CC \uBC30\uC1A1",pt:"Frete gr\xE1tis",ru:"\u0411\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u0430\u044F \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0430",zh:"\u514D\u8FD0\u8D39"},cardsProductShippingCost:{en:"{price} delivery",fr:"Livraison {price}",de:"Versand {price}",es:"Env\xEDo {price}",it:"Spedizione {price}",ja:"\u9001\u6599 {price}",ko:"\uBC30\uC1A1\uBE44 {price}",pt:"Frete {price}",ru:"\u0414\u043E\u0441\u0442\u0430\u0432\u043A\u0430 {price}",zh:"\u8FD0\u8D39 {price}"},cardsProductOptions:{en:"Options",fr:"Options",de:"Optionen",es:"Opciones",it:"Opzioni",ja:"\u30AA\u30D7\u30B7\u30E7\u30F3",ko:"\uC635\uC158",pt:"Op\xE7\xF5es",ru:"\u0412\u0430\u0440\u0438\u0430\u043D\u0442\u044B",zh:"\u53EF\u9009\u9879"},cardsProductMoreOptions:{en:"{n} more",fr:"{n} de plus",de:"{n} weitere",es:"{n} m\xE1s",it:"altri {n}",ja:"\u307B\u304B{n}\u4EF6",ko:"{n}\uAC1C \uB354",pt:"mais {n}",ru:"\u0435\u0449\u0451 {n}",zh:"\u8FD8\u6709 {n} \u4E2A"},cardsProductMore:{en:"More options",fr:"Autres choix",de:"Weitere Angebote",es:"M\xE1s opciones",it:"Altre proposte",ja:"\u305D\u306E\u4ED6\u306E\u5019\u88DC",ko:"\uB2E4\uB978 \uC0C1\uD488",pt:"Mais op\xE7\xF5es",ru:"\u0414\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u044B",zh:"\u66F4\u591A\u9009\u62E9"}},J={"in-stock":"cardsProductInStock","low-stock":"cardsProductLowStock","out-of-stock":"cardsProductOutOfStock",preorder:"cardsProductPreorder"},fa=10,Z=6,S=2,d=t=>!!t&&typeof t=="object"&&!Array.isArray(t);function p(t,a){if(t){for(let e of a)if(t[e]!==void 0&&t[e]!==null)return t[e]}}function ra(t){return Array.isArray(t)?t:d(t)?Array.isArray(t.nodes)?t.nodes:Array.isArray(t.edges)?t.edges.map(a=>d(a)?a.node:void 0):[]:[]}function k(t){if(typeof t=="number")return{amount:Number.isFinite(t)&&t>=0?t:void 0};if(typeof t=="string"){let{amount:a,currency:e}=X(t);return{amount:a===void 0?void 0:Math.abs(a),currency:e}}return d(t)?{amount:k(p(t,["amount","value","price"])).amount,currency:O(p(t,["currencyCode","currency_code","currency"]))}:{}}function oa(t){if(Array.isArray(t)){for(let e of t){let r=oa(e);if(r)return r}return}if(d(t)){let e=m(p(t,["src","url","contentUrl","href","large","medium","thumbnail"])),r=l(p(t,["alt","altText","alt_text"]));return e?{src:e,...r?{alt:r}:{}}:void 0}let a=m(t);return a?{src:a}:void 0}var ma={instock:"in-stock",available:"in-stock",instoreonly:"in-stock",onlineonly:"in-stock",lowstock:"low-stock",limitedavailability:"low-stock",fewleft:"low-stock",outofstock:"out-of-stock",soldout:"out-of-stock",unavailable:"out-of-stock",discontinued:"out-of-stock",preorder:"preorder",presale:"preorder",backorder:"preorder"};function ha(t,a){let e=p(t,["availability","stockStatus","stock_status"])??p(a,["availability"]);if(typeof e=="string"&&e.trim()){let o=e.trim().toLowerCase().replace(/^(?:https?:\/\/schema\.org\/|schema:)/,"").replace(/[^a-z]/g,""),n=ma[o];return n?{status:n}:{text:e.trim()}}let r=typeof e=="boolean"?e:p(t,["inStock","in_stock","available"]);if(typeof r=="boolean")return{status:r?"in-stock":"out-of-stock"}}function va(t){let a=d(t.aggregateRating)?t.aggregateRating:void 0,e=p(t,["rating","stars","ratingValue","rating_value","averageRating","average_rating"])??p(a,["ratingValue"]),r=p(t,["reviewCount","review_count","reviews","reviewsCount","reviews_count","ratingCount","rating_count","numReviews"])??p(a,["reviewCount","ratingCount"]);d(e)&&(r??=p(e,["count","reviews"]),e=p(e,["rate","value","average"])),Array.isArray(r)&&(r=r.length);let o=g(p(t,["bestRating","best_rating"])??p(a,["bestRating"])),n=g(e),s=n!==void 0&&o!==void 0&&o>0&&n<=o?n*5/o:n,c=g(r);return{rating:s!==void 0&&s>=0&&s<=5?s:void 0,reviewCount:c!==void 0&&c>=0?Math.floor(c):void 0}}var ga="Default Title";function ba(t){let a=[],e=o=>{let n=l(o);n&&n!==ga&&!a.includes(n)&&a.push(n)},r=Array.isArray(t.options)?["options","sizes","colors","colours"]:["sizes","colors","colours","variants"];for(let o of r)for(let n of ra(t[o]))d(n)?Array.isArray(n.values)?n.values.forEach(e):e(p(n,["title","name","value","label"])):e(n);return a.slice(0,50)}function ka(t){if(t.freeShipping===!0||t.free_shipping===!0)return{cost:0};let a=p(t,["shipping","delivery","shippingInfo","shipping_info"]);if(d(a)&&(a=p(a,["text","label","description"])??p(a,["cost","price","amount"])),typeof a=="number")return Number.isFinite(a)&&a>=0?{cost:a}:void 0;let e=l(a);if(!e)return;let r=g(e);return r!==void 0&&r>=0?{cost:r}:{text:e}}function wa(t){return Array.isArray(t)?t.map(a=>{let e=d(a)?l(a.label):void 0;if(!e)return null;let r=a.url!==void 0?m(a.url):void 0;if(r===null)return null;let o=l(a.id);return!r&&!o?null:{label:e,...r?{url:r}:{},...o?{id:o}:{},...a.primary===!0?{primary:!0}:{}}}).filter(a=>a!==null).slice(0,S):[]}var ya={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function za(t){return t.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(a,e)=>{if(e.startsWith("#")){let r=/^#x/i.test(e)?parseInt(e.slice(2),16):Number(e.slice(1));return r>0&&r<=1114111?String.fromCodePoint(r):a}return ya[e.toLowerCase()]??a})}function xa(t){return za(t.replace(/<\/?(?:br|p|li|div|h\d)(?=[\s/>])[^>]*>/gi," ").replace(/<[^>]*>/g,"")).replace(/\s+/g," ").trim()}function Pa(t){let a;for(let e of ra(t.variants)){if(!d(e))continue;let r=k(p(e,["price","amount"]));r.amount!==void 0&&(!a||r.amount<a.price.amount)&&(a={price:r,compare:k(p(e,["compare_at_price","compareAtPrice"]))})}return a}var aa=t=>d(t)?t.minVariantPrice:void 0;function Aa(t){if(!d(t))return null;let a=t,e=l(p(a,["title","name","productName","product_title"]));if(!e)return null;let r=a.offers,o=Array.isArray(r)?d(r[0])?r[0]:void 0:d(r)?r:void 0,n=p(a,["price","extracted_price","salePrice","sale_price","currentPrice","current_price"])??p(o,["price","lowPrice"])??aa(a.priceRange),s=n===void 0?Pa(a):void 0,c=s?s.price:k(n),f=p(a,["compareAtPrice","compare_at_price","originalPrice","original_price","listPrice","list_price","regularPrice","regular_price","wasPrice","was_price","extracted_old_price","oldPrice","old_price","msrp"])??aa(a.compareAtPriceRange),w=f===void 0&&s?s.compare:k(f),I=O(p(a,["currency","currency_code","currencyCode","priceCurrency"])??p(o,["priceCurrency"]))??c.currency??w.currency,v=p(a,["merchant","seller","store","shop","source","retailer","vendor"])??p(a,["brand"]),A=d(v)?l(p(v,["name","title"])):l(v),N=m(p(a,["merchantLogo","merchant_logo","source_icon","storeLogo","logo"])??(d(v)?p(v,["logo","icon","image"]):void 0)),$=l(p(a,["description","summary","snippet","subtitle","body_html","descriptionHtml"])),{rating:V,reviewCount:W}=va(a),F=ha(a,o),U=ka(a),H=oa(p(a,["image","images","thumbnail","image_url","imageUrl","featuredImage","photo"])),D=m(p(a,["url","link","permalink","product_link","productUrl","product_url","onlineStoreUrl","href"])??p(o,["url"])),B=l(p(a,["id","sku","product_id","productId"])),K=l(p(a,["badge","tag","ribbon"]));return{title:e,...B?{id:B}:{},...H?{image:H}:{},...c.amount!==void 0?{price:c.amount}:{},...I?{currency:I}:{},...c.amount!==void 0&&w.amount!==void 0&&w.amount>c.amount?{compareAtPrice:w.amount}:{},...V!==void 0?{rating:V}:{},...W!==void 0?{reviewCount:W}:{},...F?{availability:F}:{},...A?{merchant:A}:{},...A&&N?{merchantLogo:N}:{},...K?{badge:K}:{},options:ba(a),...U?{shipping:U}:{},...$?{description:xa($)}:{},...D?{url:D}:{},actions:wa(a.actions)}}function Oa(t){if(!t||typeof t!="object")return null;let a,e;if(Array.isArray(t))a=t;else{let o=t,n=["products","results","shopping_results","items"].map(s=>o[s]).find(Array.isArray);n?(a=n,e=l(p(o,["title","heading"]))):a=[o]}let r=a.map(Aa).filter(o=>o!==null).slice(0,fa);return r.length?{...e?{title:e}:{},products:r}:null}function Ca(t){let{price:a,compareAtPrice:e}=t;if(a===void 0||e===void 0||e<=a||e<=0)return;let r=(e-a)/e;return Math.round(r*100)>=1?r:void 0}var x=(t,a,e)=>Q(t,e,a.currency),h=t=>t!=null;function q(t,a,e=""){let r=i("div",{class:`aparte-product__media${e?` ${e}`:""}`},y(ca,"aparte-rich-card__glyph aparte-product__placeholder")),o=a.image?t.image(a.image.src,{class:"aparte-product__image",attrs:{alt:a.image.alt??a.title,loading:"lazy",decoding:"async"}}):null;return o?(o.addEventListener("error",()=>{o.hidden=!0,r.setAttribute("data-empty","")},{once:!0}),r.append(o),r):(r.setAttribute("data-empty",""),r)}function j(t){let a=i("div",{class:"aparte-product__title"});return t.url?a.append(i("a",{class:"aparte-product__link",attrs:{href:t.url,target:"_blank",rel:"noopener noreferrer"},text:t.title})):a.textContent=t.title,a}function ia(t,a){if(!a.merchant)return null;let e=i("div",{class:"aparte-product__merchant"}),r=a.merchantLogo?t.image(a.merchantLogo,{class:"aparte-product__logo",attrs:{alt:"",loading:"lazy",decoding:"async"}}):null;return r&&(r.addEventListener("error",()=>{r.hidden=!0},{once:!0}),e.append(r)),e.append(i("span",{class:"aparte-product__merchant-name",text:a.merchant})),e}function na(t,a){let e=Ca(a);if(e===void 0)return null;let r=i("span",{class:"aparte-badge aparte-badge--danger aparte-badge--solid aparte-badge--sm aparte-product__discount"});return t.bind(r,()=>`\u2212${Y(t.config,e)}`),r}function M(t,a,e=!1){if(a.price===void 0)return null;let r=i("div",{class:"aparte-product__price"}),o=i("span",{class:"aparte-product__now"});if(t.bind(o,()=>x(t.config,a,a.price)),r.append(o),a.compareAtPrice!==void 0){let n=i("span",{class:"aparte-sr-only"});t.bind(n,()=>`${_(t.config,"cardsProductWas",u.cardsProductWas)} `);let s=i("span",{class:"aparte-product__was-value"});t.bind(s,()=>x(t.config,a,a.compareAtPrice)),r.append(i("del",{class:"aparte-product__was"},n,s));let c=e?na(t,a):null;c&&r.append(c)}return r}function R(t,a){let e=a.availability;if(!e)return null;let r="status"in e?e.status:void 0,o=i("span",{class:"aparte-product__stock-text"});return r?t.word(o,J[r],u[J[r]]):o.textContent=e.text,i("div",{class:"aparte-product__stock",attrs:{"data-availability":r??"other"}},i("span",{class:"aparte-product__dot",attrs:{"aria-hidden":"true"}}),o)}function Ta(t,a){let e=a.shipping;if(!e)return null;let r=i("span",{class:"aparte-product__shipping-text"});return"text"in e?r.textContent=e.text:e.cost===0?t.word(r,"cardsProductFreeShipping",u.cardsProductFreeShipping):t.bind(r,()=>_(t.config,"cardsProductShippingCost",u.cardsProductShippingCost,{price:x(t.config,a,e.cost)})),i("div",{class:"aparte-product__shipping",attrs:{"data-free":"cost"in e&&e.cost===0}},y(da,"aparte-rich-card__glyph aparte-product__shipping-icon"),r)}function pa(t,a,e){let r=[a.badge?i("span",{class:"aparte-badge aparte-badge--sm aparte-product__badge",text:a.badge}):null,e?na(t,a):null].filter(h);return r.length?i("div",{class:"aparte-product__flags"},...r):null}function Sa(t,a){if(!a.options.length)return null;let e=i("ul",{class:"aparte-product__options",attrs:{role:"list"}});t.bind(e,()=>_(t.config,"cardsProductOptions",u.cardsProductOptions),"aria-label");for(let o of a.options.slice(0,Z))e.append(i("li",{class:"aparte-tag aparte-tag--sm aparte-product__option"},i("span",{class:"aparte-tag__label",text:o})));let r=a.options.length-Z;if(r>0){let o=i("span",{class:"aparte-tag__label",attrs:{"aria-hidden":"true"}});t.bind(o,()=>`+${b(t.config,r)}`);let n=i("span",{class:"aparte-sr-only"});t.bind(n,()=>_(t.config,"cardsProductMoreOptions",u.cardsProductMoreOptions,{n:b(t.config,r)})),e.append(i("li",{class:"aparte-tag aparte-tag--sm aparte-product__option aparte-product__option--more"},o,n))}return e}function E(t,a,e){let r=a.actions.slice(0,e).map(o=>t.action(o,a,"aparte-product__action")).filter(h);return r.length?i("div",{class:"aparte-product__actions"},...r):null}function L(t,a,e=""){return i("div",{class:`aparte-product aparte-product--${t}${e?` ${e}`:""}`,attrs:{"data-availability":a.availability&&"status"in a.availability?a.availability.status:void 0,"data-linked":a.url!==void 0}})}function T(t,a,{actions:e,mini:r=!1}){let o=L("tile",a,r?"aparte-product--mini":""),n=q(t,a),s=r?null:pa(t,a,!0);s&&n.append(s);let c=i("div",{class:"aparte-product__body"},r?null:ia(t,a),j(a),r?null:z(t,a.rating,{count:a.reviewCount}),M(t,a),r?null:R(t,a));o.append(n,c);let f=E(t,a,e);return f&&o.append(f),o}function ta(t,a){let e=L("row",a),r=i("div",{class:"aparte-product__meta"},a.merchant?i("span",{class:"aparte-product__merchant-name",text:a.merchant}):null,z(t,a.rating,{starsOnly:!0}),a.availability&&!("status"in a.availability&&a.availability.status==="in-stock")?R(t,a):null),o=i("div",{class:"aparte-product__main"},j(a),r.childNodes.length?r:null);e.append(q(t,a,"aparte-product__thumb"),o);let n=M(t,a);n&&e.append(n);let s=E(t,a,1);return s&&e.append(s),e}function qa(t,a){let e=L("detail",a),r=q(t,a),o=pa(t,a,!1);o&&r.append(o);let n=a.url?i("a",{class:"aparte-product__media-link",attrs:{href:a.url,target:"_blank",rel:"noopener noreferrer",tabindex:-1,"aria-hidden":"true"}},r):r,s=i("div",{class:"aparte-product__facts"},R(t,a),Ta(t,a)),c=i("div",{class:"aparte-product__body"},ia(t,a),j(a),z(t,a.rating,{count:a.reviewCount}),M(t,a,!0),s.childNodes.length?s:null,a.description?i("p",{class:"aparte-product__description",text:a.description}):null,Sa(t,a),E(t,a,S));return e.append(n,c),i("div",{class:"aparte-product__detail"},e)}function ea(t){return t.title?i("div",{class:"aparte-product__heading",text:t.title}):null}function sa(t,a){let e=t?.products??[];return e.length===1?e[0].title:t?.title?t.title:e.length>1?_(a.config,"cardsProductCount",u.cardsProductCount,{n:b(a.config,e.length)}):_(a.config,"cardsProductTitle",u.cardsProductTitle)}function ja(t,a){let{products:e}=t,r=e[0];if(a.variant==="detail"){let n=[qa(a,r)];if(e.length>1){let s=i("div",{class:"aparte-product__more-title"});a.word(s,"cardsProductMore",u.cardsProductMore);let c=e.slice(1).map(f=>T(a,f,{actions:0,mini:!0}));n.push(i("div",{class:"aparte-product__more"},s,C(a,c,{label:()=>_(a.config,"cardsProductMore",u.cardsProductMore)})))}return n}if(a.variant==="compact"){if(e.length===1)return[ta(a,r)];let n=i("ul",{class:"aparte-product__rows",attrs:{role:"list"}},...e.map(s=>i("li",{class:"aparte-product__item"},ta(a,s))));return[ea(t),n].filter(h)}if(e.length===1)return[T(a,r,{actions:S})];let o=e.map(n=>T(a,n,{actions:1}));return[i("div",{class:"aparte-product__collection"},ea(t),C(a,o,{label:()=>sa(t,a)}))]}function Ma(t,a){let e=(s,c="rect")=>i("span",{class:`aparte-skeleton aparte-skeleton--${c} ${s}`,attrs:{"aria-hidden":"true"}}),r=()=>[e("aparte-product__sk-line","text"),e("aparte-product__sk-line aparte-product__sk-line--short","text")],o=t?.title?i("div",{class:"aparte-product__query"},y(la,"aparte-rich-card__glyph aparte-product__query-icon"),i("span",{class:"aparte-product__query-text",text:t.title})):null;if(a.variant==="compact"){let s=[0,1,2].map(()=>i("div",{class:"aparte-product__item"},i("div",{class:"aparte-product aparte-product--row aparte-product--skeleton"},e("aparte-product__sk-thumb"),i("div",{class:"aparte-product__main"},...r()),e("aparte-product__sk-price","text"))));return[o,i("div",{class:"aparte-product__rows"},...s)].filter(h)}if(a.variant==="detail")return[o,i("div",{class:"aparte-product__detail"},i("div",{class:"aparte-product aparte-product--detail aparte-product--skeleton"},e("aparte-product__sk-media"),i("div",{class:"aparte-product__body"},...r(),e("aparte-product__sk-price","text"),e("aparte-product__sk-line","text"))))].filter(h);let n=[0,1,2].map(()=>i("div",{class:"aparte-product aparte-product--tile aparte-product--skeleton"},e("aparte-product__sk-media"),i("div",{class:"aparte-product__body"},...r(),e("aparte-product__sk-price","text"))));return[i("div",{class:"aparte-product__collection"},o,i("div",{class:"aparte-product__sk-track"},...n))]}var Ra=G({name:"product",variants:["card","compact","detail"],styles:_a,icon:ua,normalize:Oa,render:ja,skeleton:Ma,label:sa,fallback:(t,a)=>{let e=t.products.map(r=>{let o=r.price!==void 0?` \u2014 ${x(a.config,r,r.price)}`:"",n=r.rating!==void 0?` (${b(a.config,r.rating,{maximumFractionDigits:1})}/5)`:"";return`${r.title}${o}${n}`});return[t.title,...e].filter(h).join(`
|
|
679
679
|
`)},partial:t=>{let a=l(t.query??t.q??t.search??t.keywords??t.term??t.product);return a?{title:a}:null}});function Na(t={}){return Ra.setup(t)}export{Ca as discountOf,Ra as productCard,Oa as readProducts,Na as setupProductCard};
|
|
680
|
-
//# sourceMappingURL=product-
|
|
680
|
+
//# sourceMappingURL=product-QD2UM2YC.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../node_modules/.pnpm/@aparte+plugin-cards@1.
|
|
3
|
+
"sources": ["../../../node_modules/.pnpm/@aparte+plugin-cards@1.5.0_@aparte+core@1.5.0/node_modules/@aparte/plugin-cards/src/product/icons.ts", "../../../node_modules/.pnpm/@aparte+plugin-cards@1.5.0_@aparte+core@1.5.0/node_modules/@aparte/plugin-cards/src/product/product.css", "../../../node_modules/.pnpm/@aparte+plugin-cards@1.5.0_@aparte+core@1.5.0/node_modules/@aparte/plugin-cards/src/product/index.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * The product card's glyphs: the bag a tile shows when it has no photo, the van beside a\n * delivery line, the loupe before a search that is still running.\n *\n * Drawn on a 24 × 24 grid in `currentColor` strokes, so the sheet colours them through\n * `color` and a theme follows. Constants of this package — the only markup the card parses.\n */\n\nconst svg = (body: string) =>\n `<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\">${body}</svg>`; // safe-text: this package's own SVG, built from its glyph constants\n\n/** A shopping bag: the placeholder where a photo is missing or failed to load. */\nexport const BAG = svg('<path d=\"M5.5 8h13l-1 11.2a1.8 1.8 0 0 1-1.8 1.6H8.3a1.8 1.8 0 0 1-1.8-1.6z\"/><path d=\"M9 10.5V6.8a3 3 0 0 1 6 0v3.7\"/>');\n\n/** A delivery van, before the shipping line. */\nexport const TRUCK = svg('<path d=\"M2.8 6.5h10.4v9.3H2.8z\"/><path d=\"M13.2 9.5h4.1l3 3.2v3.1h-7.1\"/><circle cx=\"7\" cy=\"17.3\" r=\"1.7\"/><circle cx=\"17\" cy=\"17.3\" r=\"1.7\"/>');\n\n/** A loupe, before the query a running search was given. */\nexport const SEARCH = svg('<circle cx=\"10.8\" cy=\"10.8\" r=\"6.3\"/><path d=\"M15.5 15.5l4.7 4.7\"/>');\n\n/** The card's own glyph, for its one-line states (waiting, refused, failed). */\nexport const TAG = svg('<path d=\"M3.5 12.6V4.8a1.3 1.3 0 0 1 1.3-1.3h7.8l8 8a1.3 1.3 0 0 1 0 1.8l-7 7a1.3 1.3 0 0 1-1.8 0z\"/><circle cx=\"8.3\" cy=\"8.3\" r=\"1.5\"/>');\n", "export default \"/* =========================================\\n The product card — @aparte/plugin-cards/product\\n =========================================\\n Three variants of one card, chosen by `data-variant` on its root:\\n card a tile: the photo, the shop, the name, the stars, the price. Several\\n products are a row of tiles that scrolls, and the card drops its own\\n frame so the tiles are not boxes inside a box.\\n compact a row per product — thumbnail, name, stars, price — a list to scan.\\n detail one product at length: the photo beside the facts on a wide card, above\\n them on a narrow one; the others in a small row under it.\\n Every colour is a theme token or derived from one, so light and dark follow the chat.\\n */\\n\\n.aparte-product-card {\\n --aparte-product-tile-size: 12.5rem;\\n --aparte-product-thumb-size: 3.5rem;\\n --aparte-product-media-radius: var(--aparte-radius-lg);\\n /* A product photo is shot on white. The plate it sits on is near-white in BOTH schemes\\n (derived from the ink, so it is a hair off white in light and a hair off cream in\\n dark) and the photo is multiplied into it: its white background melts into the plate\\n instead of sitting as a white square on a grey one. A photo on a dark plate in dark\\n mode keeps its white box whatever we do — the shops' own apps show it light too. */\\n --aparte-product-media-bg: color-mix(in oklab, var(--aparte-text) 5%, #fff);\\n --aparte-product-image-fit: contain;\\n --aparte-product-image-inset: 7%;\\n /* Where there is no photo: the theme's own surfaces, warmed by its accent. */\\n --aparte-product-placeholder: linear-gradient(\\n 145deg,\\n color-mix(in oklab, var(--aparte-primary) 16%, var(--aparte-surface-2)) 0%,\\n var(--aparte-surface-2) 55%,\\n color-mix(in oklab, var(--aparte-text) 5%, var(--aparte-surface-2)) 100%\\n );\\n --aparte-product-placeholder-ink: color-mix(in oklab, var(--aparte-text) 30%, transparent);\\n --aparte-product-price-color: var(--aparte-text);\\n --aparte-product-hover-border: color-mix(in oklab, var(--aparte-text) 22%, var(--aparte-border));\\n --aparte-product-hover-shadow: 0 8px 18px -12px rgb(0 0 0 / 0.38);\\n}\\n\\n/* ── Widths: each variant asks for its own; the bubble's limit caps them all ── */\\n\\n.aparte-product-card[data-variant=\\\"card\\\"] { --aparte-rich-card-max-inline-size: 16.5rem; }\\n.aparte-product-card[data-variant=\\\"compact\\\"] { --aparte-rich-card-max-inline-size: 28rem; }\\n.aparte-product-card[data-variant=\\\"detail\\\"] { --aparte-rich-card-max-inline-size: 36rem; }\\n.aparte-product-card:has(> .aparte-product__collection) { --aparte-rich-card-max-inline-size: 42rem; }\\n\\n/* Several tiles: each is framed, so the card is not. The kit's buttons under it lose\\n their band, which would otherwise float as a strip under nothing. */\\n.aparte-product-card:has(> .aparte-product__collection) {\\n overflow: visible;\\n border-color: transparent;\\n border-radius: 0;\\n background: transparent;\\n}\\n\\n.aparte-product-card:has(> .aparte-product__collection) > .aparte-rich-card__actions {\\n padding-inline: 0;\\n border-block-start: 0;\\n background: none;\\n}\\n\\n/* ── Headings: the collection's title, the query of a running search ─── */\\n\\n.aparte-product__heading {\\n margin-block-end: var(--aparte-space-4);\\n font-size: var(--aparte-font-size-md);\\n font-weight: var(--aparte-font-weight-semibold);\\n overflow-wrap: anywhere;\\n}\\n\\n.aparte-product-card[data-variant=\\\"compact\\\"] > .aparte-product__heading {\\n margin: 0;\\n padding: var(--aparte-space-5) var(--aparte-space-6) var(--aparte-space-2);\\n}\\n\\n.aparte-product__query {\\n display: flex;\\n align-items: center;\\n gap: var(--aparte-space-3);\\n min-inline-size: 0;\\n margin-block-end: var(--aparte-space-4);\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-md);\\n --aparte-rich-card-glyph-size: 1rem;\\n}\\n\\n.aparte-product__query-text {\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n\\n.aparte-product-card[data-variant=\\\"compact\\\"] > .aparte-product__query,\\n.aparte-product-card[data-variant=\\\"detail\\\"] > .aparte-product__query {\\n margin: 0;\\n padding: var(--aparte-space-5) var(--aparte-space-6) 0;\\n}\\n\\n/* ── The carousel, in product sizes ──────────────────────────────────── */\\n\\n.aparte-product-card .aparte-rich-card__carousel {\\n --aparte-rich-card-slide-size: var(--aparte-product-tile-size);\\n}\\n\\n/* ── A product, whatever its shape ───────────────────────────────────── */\\n\\n.aparte-product {\\n position: relative;\\n min-inline-size: 0;\\n color: var(--aparte-text);\\n}\\n\\n/* The title's link covers the tile or the row: one link per product, read once. */\\n.aparte-product__link {\\n color: inherit;\\n text-decoration: none;\\n}\\n\\n.aparte-product--tile .aparte-product__link,\\n.aparte-product--row .aparte-product__link {\\n outline: none;\\n}\\n\\n.aparte-product--tile .aparte-product__link::after,\\n.aparte-product--row .aparte-product__link::after {\\n content: \\\"\\\";\\n position: absolute;\\n inset: 0;\\n border-radius: inherit;\\n}\\n\\n.aparte-product[data-linked]:hover .aparte-product__title {\\n text-decoration: underline;\\n text-decoration-thickness: 1px;\\n text-underline-offset: 0.18em;\\n}\\n\\n/* The ring is the product's, since the link is all of it. */\\n.aparte-product--tile:has(.aparte-product__link:focus-visible) {\\n outline: var(--aparte-focus-outline-width) solid var(--aparte-border-focus);\\n outline-offset: var(--aparte-focus-outline-offset);\\n}\\n\\n.aparte-product--row:has(.aparte-product__link:focus-visible) {\\n /* A row reaches the card's clipped edges: its ring is drawn inside. */\\n outline: var(--aparte-focus-outline-width) solid var(--aparte-border-focus);\\n outline-offset: calc(var(--aparte-focus-outline-width) * -1);\\n}\\n\\n/* ── The photo ───────────────────────────────────────────────────────── */\\n\\n.aparte-product__media {\\n position: relative;\\n display: grid;\\n place-items: center;\\n aspect-ratio: 1;\\n overflow: hidden;\\n border-radius: var(--aparte-product-media-radius);\\n background: var(--aparte-product-media-bg);\\n isolation: isolate;\\n}\\n\\n.aparte-product__media[data-empty] {\\n background: var(--aparte-product-placeholder);\\n}\\n\\n.aparte-product__placeholder {\\n grid-area: 1 / 1;\\n color: var(--aparte-product-placeholder-ink);\\n --aparte-rich-card-glyph-size: clamp(1.25rem, 30%, 3.5rem);\\n}\\n\\n.aparte-product__media:not([data-empty]) .aparte-product__placeholder { visibility: hidden; }\\n\\n.aparte-product__image {\\n grid-area: 1 / 1;\\n /* The frame centres its children (for the placeholder's glyph): without this the photo's\\n 100% height never resolves and `--aparte-product-image-fit: cover` left bands above and\\n below a photo that is not square. */\\n place-self: stretch;\\n box-sizing: border-box;\\n inline-size: 100%;\\n block-size: 100%;\\n padding: var(--aparte-product-image-inset);\\n object-fit: var(--aparte-product-image-fit);\\n mix-blend-mode: multiply;\\n transition: scale var(--aparte-duration-slower) ease, opacity var(--aparte-duration-base) ease;\\n}\\n\\n.aparte-product__image[hidden] { display: none; }\\n\\n.aparte-product[data-linked]:hover .aparte-product__image,\\n.aparte-product__media-link:hover .aparte-product__image {\\n scale: 1.04;\\n}\\n\\n/* Out of stock: the photo steps back, the line under it says why. */\\n.aparte-product[data-availability=\\\"out-of-stock\\\"] .aparte-product__image {\\n opacity: 0.55;\\n filter: grayscale(0.5);\\n}\\n\\n.aparte-product__flags {\\n position: absolute;\\n z-index: 1;\\n inset-block-start: var(--aparte-space-3);\\n inset-inline-start: var(--aparte-space-3);\\n display: flex;\\n flex-wrap: wrap;\\n gap: var(--aparte-space-2);\\n max-inline-size: calc(100% - var(--aparte-space-3) * 2);\\n}\\n\\n/* The shop's word: a pill of the card's own surface over the plate, in either scheme. */\\n.aparte-product__flags .aparte-product__badge {\\n max-inline-size: 100%;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n background: color-mix(in oklab, var(--aparte-surface-1) 90%, transparent);\\n color: var(--aparte-text);\\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.14);\\n backdrop-filter: blur(6px);\\n}\\n\\n.aparte-product__discount {\\n font-variant-numeric: tabular-nums;\\n}\\n\\n/* ── The words beside the photo ──────────────────────────────────────── */\\n\\n.aparte-product__body {\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n}\\n\\n.aparte-product__merchant {\\n display: flex;\\n align-items: center;\\n gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-xs);\\n}\\n\\n.aparte-product__merchant-name {\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n\\n.aparte-product__logo {\\n flex: none;\\n inline-size: 1rem;\\n block-size: 1rem;\\n border-radius: var(--aparte-radius-xs);\\n object-fit: cover;\\n}\\n\\n.aparte-product__logo[hidden] { display: none; }\\n\\n.aparte-product__title {\\n display: -webkit-box;\\n overflow: hidden;\\n -webkit-box-orient: vertical;\\n -webkit-line-clamp: 2;\\n line-clamp: 2;\\n font-size: var(--aparte-font-size-md);\\n font-weight: var(--aparte-font-weight-medium);\\n line-height: 1.3;\\n overflow-wrap: anywhere;\\n}\\n\\n.aparte-product__price {\\n display: flex;\\n flex-wrap: wrap;\\n align-items: baseline;\\n gap: var(--aparte-space-1) var(--aparte-space-3);\\n font-variant-numeric: tabular-nums;\\n}\\n\\n.aparte-product__now {\\n color: var(--aparte-product-price-color);\\n font-size: var(--aparte-font-size-lg);\\n font-weight: var(--aparte-font-weight-bold);\\n letter-spacing: -0.01em;\\n white-space: nowrap;\\n}\\n\\n.aparte-product__was {\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n text-decoration-thickness: 1px;\\n white-space: nowrap;\\n}\\n\\n.aparte-product__price .aparte-product__discount { align-self: center; }\\n\\n/* Stock: a dot in the state's colour, the word in its readable ink. */\\n.aparte-product__stock {\\n --aparte-product-stock-tone: var(--aparte-neutral);\\n --aparte-product-stock-ink: var(--aparte-text-muted);\\n display: inline-flex;\\n align-items: center;\\n gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n color: var(--aparte-product-stock-ink);\\n font-size: var(--aparte-font-size-xs);\\n font-weight: var(--aparte-font-weight-medium);\\n}\\n\\n.aparte-product__stock[data-availability=\\\"in-stock\\\"] { --aparte-product-stock-tone: var(--aparte-success); --aparte-product-stock-ink: var(--aparte-success-ink); }\\n.aparte-product__stock[data-availability=\\\"low-stock\\\"] { --aparte-product-stock-tone: var(--aparte-warning); --aparte-product-stock-ink: var(--aparte-warning-ink); }\\n.aparte-product__stock[data-availability=\\\"out-of-stock\\\"] { --aparte-product-stock-tone: var(--aparte-error); --aparte-product-stock-ink: var(--aparte-error-ink); }\\n.aparte-product__stock[data-availability=\\\"preorder\\\"] { --aparte-product-stock-tone: var(--aparte-info); --aparte-product-stock-ink: var(--aparte-info-ink); }\\n\\n.aparte-product__dot {\\n flex: none;\\n inline-size: 0.4375rem;\\n block-size: 0.4375rem;\\n border-radius: var(--aparte-radius-full);\\n background: var(--aparte-product-stock-tone);\\n box-shadow: 0 0 0 3px color-mix(in oklab, var(--aparte-product-stock-tone) 20%, transparent);\\n}\\n\\n.aparte-product__stock-text {\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n\\n.aparte-product__shipping {\\n display: inline-flex;\\n align-items: center;\\n gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-xs);\\n --aparte-rich-card-glyph-size: 1rem;\\n}\\n\\n.aparte-product__shipping[data-free] {\\n color: var(--aparte-success-ink);\\n font-weight: var(--aparte-font-weight-medium);\\n}\\n\\n.aparte-product__shipping-icon:dir(rtl) { transform: scaleX(-1); }\\n\\n/* Buttons sit above the link that covers the product. */\\n.aparte-product__actions {\\n position: relative;\\n z-index: 1;\\n display: flex;\\n flex-wrap: wrap;\\n gap: var(--aparte-space-2);\\n}\\n\\n/* ── card: the tile ──────────────────────────────────────────────────── */\\n\\n.aparte-product--tile {\\n display: flex;\\n flex-direction: column;\\n gap: var(--aparte-space-4);\\n padding: var(--aparte-space-3) var(--aparte-space-3) var(--aparte-space-4);\\n border-radius: var(--aparte-card-radius);\\n}\\n\\n.aparte-product--tile .aparte-product__body { padding-inline: var(--aparte-space-2); }\\n\\n/* Two lines held even when the name takes one, so the prices in a row line up. */\\n.aparte-product--tile .aparte-product__title { min-block-size: 2lh; }\\n\\n/* The price sits at the foot of the tile, level with its neighbours'. */\\n.aparte-product--tile .aparte-product__price {\\n margin-block-start: auto;\\n padding-block-start: var(--aparte-space-1);\\n}\\n\\n.aparte-product--tile .aparte-product__actions { padding-inline: var(--aparte-space-2); }\\n.aparte-product--tile .aparte-product__action { flex: 1 1 auto; justify-content: center; }\\n\\n/* A tile alone, the one product of an answer: a square photo the width of a chat column is\\n taller than the chat's view, and without a photo the square held nothing. A landscape frame,\\n and a low band when there is no picture; in a row of tiles they stay square and level. */\\n.aparte-product--tile:not(:is(.aparte-product__collection, .aparte-product__more) .aparte-product--tile) .aparte-product__media {\\n aspect-ratio: 4 / 3;\\n}\\n\\n.aparte-product--tile:not(:is(.aparte-product__collection, .aparte-product__more) .aparte-product--tile) .aparte-product__media[data-empty] {\\n aspect-ratio: 3 / 1;\\n}\\n\\n.aparte-product__collection .aparte-product--tile,\\n.aparte-product__more .aparte-product--tile {\\n border: var(--aparte-border-width) solid var(--aparte-border);\\n background: var(--aparte-surface-1);\\n transition:\\n border-color var(--aparte-duration-base) ease,\\n box-shadow var(--aparte-duration-base) ease,\\n translate var(--aparte-duration-base) ease;\\n}\\n\\n.aparte-product__collection .aparte-product--tile[data-linked]:hover,\\n.aparte-product__more .aparte-product--tile[data-linked]:hover {\\n border-color: var(--aparte-product-hover-border);\\n box-shadow: var(--aparte-product-hover-shadow);\\n translate: 0 -2px;\\n}\\n\\n/* A mini tile: the others under a detail. */\\n.aparte-product--mini {\\n gap: var(--aparte-space-3);\\n padding: var(--aparte-space-2) var(--aparte-space-2) var(--aparte-space-3);\\n}\\n\\n.aparte-product--mini .aparte-product__body { gap: var(--aparte-space-1); }\\n.aparte-product--mini .aparte-product__title { font-size: var(--aparte-font-size-sm); }\\n.aparte-product--mini .aparte-product__now { font-size: var(--aparte-font-size-md); }\\n.aparte-product--mini .aparte-product__was { font-size: var(--aparte-font-size-xs); }\\n\\n/* ── compact: the rows ───────────────────────────────────────────────── */\\n\\n/* On the drawn card only: a one-line state shrinks to its words, and a size container\\n cannot. */\\n.aparte-product-card[data-variant=\\\"compact\\\"][data-state=\\\"ready\\\"] {\\n container: aparte-product-rows / inline-size;\\n}\\n\\n.aparte-product__rows {\\n margin: 0;\\n padding: var(--aparte-space-2) 0;\\n list-style: none;\\n}\\n\\n/* A divider starting after the thumbnail, the way a settings list draws it. */\\n.aparte-product__item { position: relative; }\\n\\n.aparte-product__item + .aparte-product__item::before {\\n content: \\\"\\\";\\n position: absolute;\\n inset-block-start: 0;\\n inset-inline: calc(var(--aparte-space-6) + var(--aparte-product-thumb-size) + var(--aparte-space-5)) var(--aparte-space-6);\\n border-block-start: var(--aparte-border-width) solid var(--aparte-border);\\n}\\n\\n.aparte-product--row {\\n display: grid;\\n grid-template-columns: var(--aparte-product-thumb-size) minmax(0, 1fr) auto;\\n align-items: center;\\n column-gap: var(--aparte-space-5);\\n padding: var(--aparte-space-4) var(--aparte-space-6);\\n transition: background-color var(--aparte-duration-fast) ease;\\n}\\n\\n.aparte-product--row:has(> .aparte-product__actions) {\\n grid-template-columns: var(--aparte-product-thumb-size) minmax(0, 1fr) auto auto;\\n}\\n\\n.aparte-product--row[data-linked]:hover { background: var(--aparte-surface-2); }\\n\\n.aparte-product__thumb {\\n inline-size: var(--aparte-product-thumb-size);\\n --aparte-product-media-radius: var(--aparte-radius-md);\\n --aparte-product-image-inset: 4%;\\n}\\n\\n.aparte-product__thumb .aparte-product__placeholder { --aparte-rich-card-glyph-size: 45%; }\\n\\n.aparte-product__main {\\n display: flex;\\n flex-direction: column;\\n gap: var(--aparte-space-1);\\n min-inline-size: 0;\\n}\\n\\n.aparte-product__meta {\\n display: flex;\\n flex-wrap: wrap;\\n align-items: center;\\n gap: var(--aparte-space-1) var(--aparte-space-3);\\n min-inline-size: 0;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-xs);\\n}\\n\\n.aparte-product__meta .aparte-rich-card__rating { font-size: var(--aparte-font-size-xs); }\\n\\n.aparte-product--row .aparte-product__price {\\n flex-direction: column;\\n align-items: flex-end;\\n gap: 0;\\n text-align: end;\\n}\\n\\n.aparte-product--row .aparte-product__now { font-size: var(--aparte-font-size-base); }\\n.aparte-product--row .aparte-product__was { font-size: var(--aparte-font-size-xs); }\\n\\n/* On a narrow card a row's button goes under its name rather than squeeze it. */\\n@container aparte-product-rows (max-width: 24rem) {\\n .aparte-product--row:has(> .aparte-product__actions) {\\n grid-template-columns: var(--aparte-product-thumb-size) minmax(0, 1fr) auto;\\n }\\n\\n .aparte-product--row > .aparte-product__actions {\\n grid-column: 2 / -1;\\n margin-block-start: var(--aparte-space-3);\\n }\\n}\\n\\n/* ── detail: one product at length ───────────────────────────────────── */\\n\\n.aparte-product__detail {\\n container: aparte-product-detail / inline-size;\\n}\\n\\n.aparte-product--detail {\\n display: grid;\\n gap: var(--aparte-space-6);\\n padding: var(--aparte-space-6);\\n}\\n\\n.aparte-product--detail .aparte-product__media,\\n.aparte-product--detail .aparte-product__sk-media {\\n aspect-ratio: 4 / 3;\\n}\\n\\n/* No picture: a low band for the glyph, not a frame the size of a photo that is not there. */\\n.aparte-product--detail .aparte-product__media[data-empty] {\\n aspect-ratio: 3 / 1;\\n}\\n\\n.aparte-product__media-link {\\n display: block;\\n border-radius: var(--aparte-product-media-radius);\\n}\\n\\n.aparte-product--detail .aparte-product__body { gap: var(--aparte-space-3); }\\n\\n/* The clamp clips what overflows it, the focus ring included: the padding gives the ring\\n room inside, and the margin takes that room back from the layout. */\\n.aparte-product--detail .aparte-product__title {\\n -webkit-line-clamp: 4;\\n line-clamp: 4;\\n margin: calc(var(--aparte-space-2) * -1);\\n padding: var(--aparte-space-2);\\n font-size: var(--aparte-font-size-lg);\\n font-weight: var(--aparte-font-weight-semibold);\\n}\\n\\n.aparte-product--detail .aparte-product__link:hover { text-decoration: underline; text-underline-offset: 0.18em; }\\n\\n.aparte-product--detail .aparte-product__link:focus-visible {\\n border-radius: var(--aparte-radius-xs);\\n outline: var(--aparte-focus-outline-width) solid var(--aparte-border-focus);\\n outline-offset: var(--aparte-focus-outline-offset);\\n}\\n\\n.aparte-product--detail .aparte-product__now { font-size: var(--aparte-font-size-2xl); }\\n.aparte-product--detail .aparte-product__was { font-size: var(--aparte-font-size-md); }\\n\\n.aparte-product__facts {\\n display: flex;\\n flex-wrap: wrap;\\n align-items: center;\\n gap: var(--aparte-space-2) var(--aparte-space-6);\\n}\\n\\n.aparte-product__description {\\n display: -webkit-box;\\n margin: 0;\\n overflow: hidden;\\n -webkit-box-orient: vertical;\\n -webkit-line-clamp: 3;\\n line-clamp: 3;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n line-height: 1.5;\\n overflow-wrap: anywhere;\\n}\\n\\n.aparte-product__options {\\n display: flex;\\n flex-wrap: wrap;\\n gap: var(--aparte-space-2);\\n margin: 0;\\n padding: 0;\\n list-style: none;\\n}\\n\\n.aparte-product__option--more { color: var(--aparte-text-muted); }\\n\\n.aparte-product--detail .aparte-product__actions { margin-block-start: var(--aparte-space-2); }\\n.aparte-product--detail .aparte-product__action { flex: 1 1 8rem; justify-content: center; }\\n\\n@container aparte-product-detail (min-width: 30rem) {\\n .aparte-product--detail {\\n grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);\\n align-items: start;\\n gap: var(--aparte-space-7);\\n }\\n\\n .aparte-product--detail .aparte-product__media,\\n .aparte-product--detail .aparte-product__sk-media {\\n aspect-ratio: 1;\\n }\\n}\\n\\n/* The others, under the detail. */\\n.aparte-product__more {\\n --aparte-product-tile-size: 9.5rem;\\n padding: var(--aparte-space-5) var(--aparte-space-6) var(--aparte-space-6);\\n border-block-start: var(--aparte-border-width) solid var(--aparte-border);\\n background: color-mix(in oklab, var(--aparte-surface-2) 45%, var(--aparte-surface-1));\\n}\\n\\n.aparte-product__more-title {\\n margin-block-end: var(--aparte-space-4);\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n font-weight: var(--aparte-font-weight-semibold);\\n}\\n\\n/* ── Loading ─────────────────────────────────────────────────────────── */\\n\\n.aparte-product__sk-track {\\n display: grid;\\n grid-auto-flow: column;\\n grid-auto-columns: var(--aparte-product-tile-size);\\n column-gap: var(--aparte-space-4);\\n overflow: hidden;\\n}\\n\\n.aparte-product-card .aparte-product__sk-media {\\n block-size: auto;\\n aspect-ratio: 1;\\n border-radius: var(--aparte-product-media-radius);\\n}\\n\\n.aparte-product-card .aparte-product__sk-thumb {\\n inline-size: var(--aparte-product-thumb-size);\\n block-size: auto;\\n aspect-ratio: 1;\\n border-radius: var(--aparte-radius-md);\\n}\\n\\n.aparte-product-card .aparte-product__sk-line--short { inline-size: 60%; }\\n\\n.aparte-product-card .aparte-product__sk-price {\\n inline-size: 4.5rem;\\n block-size: 1.125rem;\\n margin-block-start: auto;\\n}\\n\\n.aparte-product--row .aparte-product__sk-price { margin-block-start: 0; }\\n\\n/* ── Small screens, motion ───────────────────────────────────────────── */\\n\\n@media (max-width: 380px) {\\n .aparte-product-card { --aparte-product-tile-size: 10.75rem; --aparte-product-thumb-size: 3rem; }\\n .aparte-product--row { column-gap: var(--aparte-space-4); padding-inline: var(--aparte-space-5); }\\n .aparte-product__item + .aparte-product__item::before {\\n inset-inline: calc(var(--aparte-space-5) + var(--aparte-product-thumb-size) + var(--aparte-space-4)) var(--aparte-space-5);\\n }\\n .aparte-product--detail { padding: var(--aparte-space-5); }\\n .aparte-product__more { padding-inline: var(--aparte-space-5); }\\n}\\n\\n/* The kit stops every transition under reduced motion; the hover's lift and zoom are\\n end states, not transitions, so they are taken out here. */\\n@media (prefers-reduced-motion: reduce) {\\n .aparte-product__collection .aparte-product--tile[data-linked]:hover,\\n .aparte-product__more .aparte-product--tile[data-linked]:hover { translate: none; }\\n\\n .aparte-product[data-linked]:hover .aparte-product__image,\\n .aparte-product__media-link:hover .aparte-product__image { scale: none; }\\n}\\n\"", "/**\n * @aparte/plugin-cards/product — a tool's products, drawn as cards.\n *\n * import { setupProductCard } from '@aparte/plugin-cards/product';\n *\n * setupProductCard({\n * tool: 'search_products',\n * map: (result) => ({ title: result.query, products: result.items }),\n * });\n *\n * Three variants of one card: `card` (a tile — the photo, the shop, the name, the stars,\n * the price; several products are a row of tiles that scrolls), `compact` (a row per\n * product, to scan) and `detail` (one product at length, the others in a small row under\n * it). Your tool keeps its own fields: `readProducts` already reads the usual spellings —\n * `name` or `title`, a price as `49.9`, `\"49.90\"` or `\"49,90 € TTC\"`, schema.org's `offers`\n * and `aggregateRating`, a Google Shopping result's `extracted_price` and `source`, a Shopify\n * product from the Admin API (`variants`, `body_html`) or the Storefront API (`priceRange`,\n * `onlineStoreUrl`) — and `map` covers the rest.\n */\nimport type { AparteConfig } from '@aparte/core';\nimport { defineCard, type CardAction, type CardContext, type CardSetupOptions } from '../kit/define.js';\nimport { el, glyph, num, str, webUrl } from '../kit/dom.js';\nimport { carousel } from '../kit/carousel.js';\nimport { currencyCode, formatNumber, formatPercent, formatPrice, readPriceText } from '../kit/format.js';\nimport { rating } from '../kit/rating.js';\nimport { word, type CardWord } from '../kit/strings.js';\nimport { BAG, SEARCH, TAG, TRUCK } from './icons.js';\nimport productStyles from './product.css?raw';\n\nexport type ProductVariant = 'card' | 'compact' | 'detail';\n\n/** Where a product stands; anything else a tool writes is shown as it wrote it. */\nexport type ProductAvailability = 'in-stock' | 'low-stock' | 'out-of-stock' | 'preorder';\n\n/**\n * One product as `map` returns it. Only `title` is needed; every other field adds a line\n * when it is there and nothing when it is not.\n */\nexport interface ProductInput {\n title: string;\n /** An `http(s)` URL, or `{ src, alt }`. Anything else is no photo. */\n image?: string | { src: string; alt?: string };\n /** `49.9`, or a string a shop writes: `\"49.90\"`, `\"$49.90\"`, `\"49,90 €\"`. */\n price?: number | string;\n /** An ISO 4217 code (`EUR`) or a usual symbol (`€`). */\n currency?: string;\n /** The price before the sale: struck through, and the discount computed from it. */\n compareAtPrice?: number | string;\n /** 0–5. */\n rating?: number;\n reviewCount?: number;\n availability?: ProductAvailability | string;\n merchant?: string;\n /** The shop's logo, small, before its name. */\n merchantLogo?: string;\n /** A word over the photo: \"Bestseller\", \"New\". */\n badge?: string;\n /** Sizes, colours: drawn as chips in `detail`. */\n options?: string[];\n /** A line of your own (\"Delivered tomorrow\"), or a cost — `0` reads \"Free delivery\". */\n shipping?: string | number;\n /** A few lines, in `detail`. Tags are stripped: it is shown as text. */\n description?: string;\n /** Where the product's name and photo link to; `http(s)` only. */\n url?: string;\n /** Your own id, handed back with the product in `aparte-card-action`. */\n id?: string;\n /**\n * At most two buttons per product, each a link (`http(s)`) or an `id`, reporting the\n * product as its `data`. A `send` is dropped: a result never writes the person's next\n * message — send one from your `aparte-card-action` listener, or the card's `actions`.\n */\n actions?: CardAction[];\n}\n\n/** What `map` returns: one product, a list, or a list with a heading. */\nexport type ProductsInput = ProductInput | ProductInput[] | { title?: string; products: ProductInput[] };\n\n/** One product as the card draws it, once read. */\nexport interface Product {\n id?: string;\n title: string;\n image?: { src: string; alt?: string };\n price?: number;\n /** An ISO 4217 code. */\n currency?: string;\n /** Kept only when it is above `price`: a \"was\" price lower than the price is no sale. */\n compareAtPrice?: number;\n rating?: number;\n reviewCount?: number;\n /** One of the four, or the tool's own words. */\n availability?: { status: ProductAvailability } | { text: string };\n merchant?: string;\n merchantLogo?: string;\n badge?: string;\n options: string[];\n shipping?: { text: string } | { cost: number };\n description?: string;\n url?: string;\n actions: CardAction[];\n}\n\n/** The data as the card draws it. */\nexport interface ProductData {\n /** The heading over several products (\"Trail shoes under €100\"). */\n title?: string;\n products: Product[];\n}\n\nconst P = {\n cardsProductTitle: { en: 'Products', fr: 'Produits', de: 'Produkte', es: 'Productos', it: 'Prodotti', ja: '商品', ko: '상품', pt: 'Produtos', ru: 'Товары', zh: '商品' },\n cardsProductCount: { en: '{n} products', fr: '{n} produits', de: '{n} Produkte', es: '{n} productos', it: '{n} prodotti', ja: '{n}件の商品', ko: '상품 {n}개', pt: '{n} produtos', ru: 'Товаров: {n}', zh: '{n} 件商品' },\n cardsProductInStock: { en: 'In stock', fr: 'En stock', de: 'Auf Lager', es: 'En stock', it: 'Disponibile', ja: '在庫あり', ko: '재고 있음', pt: 'Em estoque', ru: 'В наличии', zh: '有货' },\n cardsProductLowStock: { en: 'Only a few left', fr: 'Plus que quelques-uns', de: 'Nur noch wenige', es: 'Quedan pocas unidades', it: 'Ultimi pezzi', ja: '残りわずか', ko: '품절 임박', pt: 'Últimas unidades', ru: 'Осталось мало', zh: '仅剩少量' },\n cardsProductOutOfStock: { en: 'Out of stock', fr: 'Rupture de stock', de: 'Ausverkauft', es: 'Agotado', it: 'Esaurito', ja: '在庫切れ', ko: '품절', pt: 'Esgotado', ru: 'Нет в наличии', zh: '缺货' },\n cardsProductPreorder: { en: 'Pre-order', fr: 'Précommande', de: 'Vorbestellbar', es: 'Preventa', it: 'Preordine', ja: '予約受付中', ko: '예약 판매', pt: 'Pré-venda', ru: 'Предзаказ', zh: '预售' },\n cardsProductWas: { en: 'Was', fr: 'Au lieu de', de: 'Statt', es: 'Antes', it: 'Prima', ja: '通常価格', ko: '정가', pt: 'De', ru: 'Было', zh: '原价' },\n cardsProductFreeShipping: { en: 'Free delivery', fr: 'Livraison gratuite', de: 'Kostenloser Versand', es: 'Envío gratis', it: 'Spedizione gratuita', ja: '送料無料', ko: '무료 배송', pt: 'Frete grátis', ru: 'Бесплатная доставка', zh: '免运费' },\n cardsProductShippingCost: { en: '{price} delivery', fr: 'Livraison {price}', de: 'Versand {price}', es: 'Envío {price}', it: 'Spedizione {price}', ja: '送料 {price}', ko: '배송비 {price}', pt: 'Frete {price}', ru: 'Доставка {price}', zh: '运费 {price}' },\n cardsProductOptions: { en: 'Options', fr: 'Options', de: 'Optionen', es: 'Opciones', it: 'Opzioni', ja: 'オプション', ko: '옵션', pt: 'Opções', ru: 'Варианты', zh: '可选项' },\n cardsProductMoreOptions: { en: '{n} more', fr: '{n} de plus', de: '{n} weitere', es: '{n} más', it: 'altri {n}', ja: 'ほか{n}件', ko: '{n}개 더', pt: 'mais {n}', ru: 'ещё {n}', zh: '还有 {n} 个' },\n cardsProductMore: { en: 'More options', fr: 'Autres choix', de: 'Weitere Angebote', es: 'Más opciones', it: 'Altre proposte', ja: 'その他の候補', ko: '다른 상품', pt: 'Mais opções', ru: 'Другие варианты', zh: '更多选择' },\n} satisfies Record<string, CardWord>;\n\nconst STOCK_WORD: Record<ProductAvailability, keyof typeof P> = {\n 'in-stock': 'cardsProductInStock',\n 'low-stock': 'cardsProductLowStock',\n 'out-of-stock': 'cardsProductOutOfStock',\n preorder: 'cardsProductPreorder',\n};\n\n/** Ten: past that a row of tiles is a catalogue, not an answer (3–8 is the comfortable range). */\nconst PRODUCTS_SHOWN = 10;\nconst OPTIONS_SHOWN = 6;\nconst ACTIONS_PER_PRODUCT = 2;\n\n// ── Reading ──────────────────────────────────────────────────────────────────\n\ntype Raw = Record<string, unknown>;\n\nconst isObject = (value: unknown): value is Raw => !!value && typeof value === 'object' && !Array.isArray(value);\n\n/** The first of `keys` that `r` has a value for. */\nfunction pick(r: Raw | undefined, keys: readonly string[]): unknown {\n if (!r) return undefined;\n for (const key of keys) if (r[key] !== undefined && r[key] !== null) return r[key];\n return undefined;\n}\n\n/** A list from an array or a GraphQL connection (`{ nodes }`, `{ edges }`) — Shopify's Storefront API returns the latter. */\nfunction listOf(value: unknown): unknown[] {\n if (Array.isArray(value)) return value;\n if (!isObject(value)) return [];\n if (Array.isArray(value['nodes'])) return value['nodes'];\n if (Array.isArray(value['edges'])) return value['edges'].map((e) => (isObject(e) ? e['node'] : undefined));\n return [];\n}\n\n/** An amount and its currency, from a number, a shop's text, or `{ amount, currencyCode }`. */\nfunction readMoney(value: unknown): { amount?: number; currency?: string } {\n if (typeof value === 'number') return { amount: Number.isFinite(value) && value >= 0 ? value : undefined };\n if (typeof value === 'string') {\n // A price is not negative: a minus in a shop's text is not this price's.\n const { amount, currency } = readPriceText(value);\n return { amount: amount === undefined ? undefined : Math.abs(amount), currency };\n }\n if (isObject(value)) {\n return {\n amount: readMoney(pick(value, ['amount', 'value', 'price'])).amount,\n currency: currencyCode(pick(value, ['currencyCode', 'currency_code', 'currency'])),\n };\n }\n return {};\n}\n\nfunction readImage(value: unknown): Product['image'] {\n if (Array.isArray(value)) {\n for (const item of value) {\n const image = readImage(item);\n if (image) return image;\n }\n return undefined;\n }\n if (isObject(value)) {\n // schema.org's ImageObject keeps its address in `contentUrl`.\n const src = webUrl(pick(value, ['src', 'url', 'contentUrl', 'href', 'large', 'medium', 'thumbnail']));\n const alt = str(pick(value, ['alt', 'altText', 'alt_text']));\n return src ? { src, ...(alt ? { alt } : {}) } : undefined;\n }\n const src = webUrl(value);\n return src ? { src } : undefined;\n}\n\n/** schema.org's ItemAvailability names and the usual shop words, squeezed to letters. */\nconst AVAILABILITY: Record<string, ProductAvailability> = {\n instock: 'in-stock', available: 'in-stock', instoreonly: 'in-stock', onlineonly: 'in-stock',\n lowstock: 'low-stock', limitedavailability: 'low-stock', fewleft: 'low-stock',\n outofstock: 'out-of-stock', soldout: 'out-of-stock', unavailable: 'out-of-stock', discontinued: 'out-of-stock',\n preorder: 'preorder', presale: 'preorder', backorder: 'preorder',\n};\n\nfunction readAvailability(r: Raw, offer: Raw | undefined): Product['availability'] {\n const value = pick(r, ['availability', 'stockStatus', 'stock_status']) ?? pick(offer, ['availability']);\n if (typeof value === 'string' && value.trim()) {\n // `https://schema.org/InStock`, `schema:InStock` (a JSON-LD prefix), `InStock`: one key.\n const key = value.trim().toLowerCase().replace(/^(?:https?:\\/\\/schema\\.org\\/|schema:)/, '').replace(/[^a-z]/g, '');\n const status = AVAILABILITY[key];\n return status ? { status } : { text: value.trim() };\n }\n const flag = typeof value === 'boolean' ? value : pick(r, ['inStock', 'in_stock', 'available']);\n if (typeof flag === 'boolean') return { status: flag ? 'in-stock' : 'out-of-stock' };\n return undefined;\n}\n\nfunction readRating(r: Raw): { rating?: number; reviewCount?: number } {\n const aggregate = isObject(r['aggregateRating']) ? r['aggregateRating'] : undefined;\n let value = pick(r, ['rating', 'stars', 'ratingValue', 'rating_value', 'averageRating', 'average_rating']) ?? pick(aggregate, ['ratingValue']);\n let count = pick(r, ['reviewCount', 'review_count', 'reviews', 'reviewsCount', 'reviews_count', 'ratingCount', 'rating_count', 'numReviews'])\n ?? pick(aggregate, ['reviewCount', 'ratingCount']);\n // `{ rate, count }`, as the Fake Store API and others nest it.\n if (isObject(value)) {\n count ??= pick(value, ['count', 'reviews']);\n value = pick(value, ['rate', 'value', 'average']);\n }\n if (Array.isArray(count)) count = count.length;\n // schema.org names the scale with `bestRating` (5 when missing): 4 out of 10 is two stars, not four.\n const best = num(pick(r, ['bestRating', 'best_rating']) ?? pick(aggregate, ['bestRating']));\n const given = num(value);\n const stars = given !== undefined && best !== undefined && best > 0 && given <= best ? (given * 5) / best : given;\n const reviews = num(count);\n return {\n // A value off the five-star scale is another scale, not a five: drawn as none.\n rating: stars !== undefined && stars >= 0 && stars <= 5 ? stars : undefined,\n reviewCount: reviews !== undefined && reviews >= 0 ? Math.floor(reviews) : undefined,\n };\n}\n\n/** Shopify's name for the one variant of a product that has none. */\nconst NO_VARIANT = 'Default Title';\n\nfunction readOptions(r: Raw): string[] {\n const out: string[] = [];\n const add = (value: unknown) => {\n const s = str(value);\n if (s && s !== NO_VARIANT && !out.includes(s)) out.push(s);\n };\n // A shop's variants are its options combined (\"Pink / M\"): beside the options they would\n // say each value a second time, in another chip.\n const keys = Array.isArray(r['options']) ? ['options', 'sizes', 'colors', 'colours'] : ['sizes', 'colors', 'colours', 'variants'];\n for (const key of keys) {\n for (const item of listOf(r[key])) {\n if (!isObject(item)) add(item);\n // Shopify's `{ name: 'Size', values: ['S', 'M'] }`: the values are the choices.\n else if (Array.isArray(item['values'])) item['values'].forEach(add);\n else add(pick(item, ['title', 'name', 'value', 'label']));\n }\n }\n return out.slice(0, 50);\n}\n\nfunction readShipping(r: Raw): Product['shipping'] {\n if (r['freeShipping'] === true || r['free_shipping'] === true) return { cost: 0 };\n let value = pick(r, ['shipping', 'delivery', 'shippingInfo', 'shipping_info']);\n if (isObject(value)) value = pick(value, ['text', 'label', 'description']) ?? pick(value, ['cost', 'price', 'amount']);\n if (typeof value === 'number') return Number.isFinite(value) && value >= 0 ? { cost: value } : undefined;\n const text = str(value);\n if (!text) return undefined;\n const cost = num(text);\n return cost !== undefined && cost >= 0 ? { cost } : { text };\n}\n\n/**\n * A product's own buttons, as the result gave them: a link (`http(s)`) or an `id` your\n * `aparte-card-action` listener handles. Never a `send`: the result is the tool's — a shop's\n * page, a feed, a model — and a button that posts its text as the person's next message lets\n * that text speak for them, a lever for prompt injection. A message is the app's to write: in\n * its listener, from the product the event carries, or in the card's `actions` option.\n */\nfunction readActions(value: unknown): CardAction[] {\n if (!Array.isArray(value)) return [];\n return value\n .map((a): CardAction | null => {\n const label = isObject(a) ? str(a['label']) : undefined;\n if (!label) return null;\n const url = a['url'] !== undefined ? webUrl(a['url']) : undefined;\n if (url === null) return null;\n const id = str(a['id']);\n if (!url && !id) return null;\n return { label, ...(url ? { url } : {}), ...(id ? { id } : {}), ...(a['primary'] === true ? { primary: true } : {}) };\n })\n .filter((a): a is CardAction => a !== null)\n .slice(0, ACTIONS_PER_PRODUCT);\n}\n\n/** HTML's usual entities, once its tags are out: `&` is `&`. One pass, so `&lt;` stays `<`. */\nconst ENTITIES: Record<string, string> = { amp: '&', lt: '<', gt: '>', quot: '\"', apos: '\\'', nbsp: ' ' };\nfunction decodeEntities(text: string): string {\n return text.replace(/&(#x[0-9a-f]+|#\\d+|[a-z]+);/gi, (whole, name: string) => {\n if (name.startsWith('#')) {\n const code = /^#x/i.test(name) ? parseInt(name.slice(2), 16) : Number(name.slice(1));\n return code > 0 && code <= 0x10ffff ? String.fromCodePoint(code) : whole;\n }\n return ENTITIES[name.toLowerCase()] ?? whole;\n });\n}\n\n/** The markup a shop writes a description in (Shopify's `body_html`), as the words a reader sees. */\nfunction plainText(html: string): string {\n return decodeEntities(html.replace(/<\\/?(?:br|p|li|div|h\\d)(?=[\\s/>])[^>]*>/gi, ' ').replace(/<[^>]*>/g, '')).replace(/\\s+/g, ' ').trim();\n}\n\ntype Money = ReturnType<typeof readMoney>;\n\n/**\n * The cheapest of a product's variants, with the price it replaces — where Shopify's Admin\n * API keeps a product's price (`variants[].price`, `compare_at_price`).\n */\nfunction cheapestVariant(r: Raw): { price: Money; compare: Money } | undefined {\n let best: { price: Money; compare: Money } | undefined;\n for (const v of listOf(r['variants'])) {\n if (!isObject(v)) continue;\n const price = readMoney(pick(v, ['price', 'amount']));\n if (price.amount === undefined) continue;\n if (!best || price.amount < best.price.amount!) best = { price, compare: readMoney(pick(v, ['compare_at_price', 'compareAtPrice'])) };\n }\n return best;\n}\n\n/** The low end of Shopify's Storefront range, `{ minVariantPrice: { amount, currencyCode } }`. */\nconst lowEnd = (range: unknown) => (isObject(range) ? range['minVariantPrice'] : undefined);\n\n/** One product from whatever a tool wrote, or `null` without a name to show. */\nfunction readProduct(raw: unknown): Product | null {\n if (!isObject(raw)) return null;\n const r = raw;\n const title = str(pick(r, ['title', 'name', 'productName', 'product_title']));\n if (!title) return null;\n // schema.org puts the price, the currency, the stock and the link on an offer.\n const offers = r['offers'];\n const offer = Array.isArray(offers) ? (isObject(offers[0]) ? offers[0] : undefined) : isObject(offers) ? offers : undefined;\n\n // A price of its own, an offer's, Shopify Storefront's range — else its cheapest variant's.\n const own = pick(r, ['price', 'extracted_price', 'salePrice', 'sale_price', 'currentPrice', 'current_price'])\n ?? pick(offer, ['price', 'lowPrice']) ?? lowEnd(r['priceRange']);\n const variant = own === undefined ? cheapestVariant(r) : undefined;\n const price = variant ? variant.price : readMoney(own);\n const compareOwn = pick(r, [\n 'compareAtPrice', 'compare_at_price', 'originalPrice', 'original_price', 'listPrice', 'list_price',\n 'regularPrice', 'regular_price', 'wasPrice', 'was_price', 'extracted_old_price', 'oldPrice', 'old_price', 'msrp',\n ]) ?? lowEnd(r['compareAtPriceRange']);\n const compare = compareOwn === undefined && variant ? variant.compare : readMoney(compareOwn);\n const currency = currencyCode(pick(r, ['currency', 'currency_code', 'currencyCode', 'priceCurrency']) ?? pick(offer, ['priceCurrency']))\n ?? price.currency ?? compare.currency;\n\n const merchantRaw = pick(r, ['merchant', 'seller', 'store', 'shop', 'source', 'retailer', 'vendor']) ?? pick(r, ['brand']);\n const merchant = isObject(merchantRaw) ? str(pick(merchantRaw, ['name', 'title'])) : str(merchantRaw);\n const merchantLogo = webUrl(pick(r, ['merchantLogo', 'merchant_logo', 'source_icon', 'storeLogo', 'logo'])\n ?? (isObject(merchantRaw) ? pick(merchantRaw, ['logo', 'icon', 'image']) : undefined));\n\n const description = str(pick(r, ['description', 'summary', 'snippet', 'subtitle', 'body_html', 'descriptionHtml']));\n const { rating: stars, reviewCount } = readRating(r);\n const availability = readAvailability(r, offer);\n const shipping = readShipping(r);\n const image = readImage(pick(r, ['image', 'images', 'thumbnail', 'image_url', 'imageUrl', 'featuredImage', 'photo']));\n const url = webUrl(pick(r, ['url', 'link', 'permalink', 'product_link', 'productUrl', 'product_url', 'onlineStoreUrl', 'href']) ?? pick(offer, ['url']));\n const id = str(pick(r, ['id', 'sku', 'product_id', 'productId']));\n const badge = str(pick(r, ['badge', 'tag', 'ribbon']));\n\n return {\n title,\n ...(id ? { id } : {}),\n ...(image ? { image } : {}),\n ...(price.amount !== undefined ? { price: price.amount } : {}),\n ...(currency ? { currency } : {}),\n ...(price.amount !== undefined && compare.amount !== undefined && compare.amount > price.amount ? { compareAtPrice: compare.amount } : {}),\n ...(stars !== undefined ? { rating: stars } : {}),\n ...(reviewCount !== undefined ? { reviewCount } : {}),\n ...(availability ? { availability } : {}),\n ...(merchant ? { merchant } : {}),\n ...(merchant && merchantLogo ? { merchantLogo } : {}),\n ...(badge ? { badge } : {}),\n options: readOptions(r),\n ...(shipping ? { shipping } : {}),\n // Shown as text, so a tag would show as `<p>`: take the words out of the markup.\n ...(description ? { description: plainText(description) } : {}),\n ...(url ? { url } : {}),\n actions: readActions(r['actions']),\n };\n}\n\n/**\n * The card's data from the loose shape `map` returns — one product, a list, or\n * `{ title, products }` (also `results`, `items`, Google Shopping's `shopping_results`) —\n * or `null` when not one product has a name. At most ten are kept.\n */\nexport function readProducts(raw: unknown): ProductData | null {\n if (!raw || typeof raw !== 'object') return null;\n let list: unknown[];\n let title: string | undefined;\n if (Array.isArray(raw)) {\n list = raw;\n } else {\n const r = raw as Raw;\n const many = ['products', 'results', 'shopping_results', 'items'].map((key) => r[key]).find(Array.isArray);\n if (many) {\n list = many;\n title = str(pick(r, ['title', 'heading']));\n } else {\n list = [r];\n }\n }\n const products = list.map(readProduct).filter((p): p is Product => p !== null).slice(0, PRODUCTS_SHOWN);\n return products.length ? { ...(title ? { title } : {}), products } : null;\n}\n\n/** The share taken off, from the two prices — never read from a tool's \"-20%\". `undefined` under one percent. */\nexport function discountOf(product: Pick<Product, 'price' | 'compareAtPrice'>): number | undefined {\n const { price, compareAtPrice } = product;\n if (price === undefined || compareAtPrice === undefined || compareAtPrice <= price || compareAtPrice <= 0) return undefined;\n const ratio = (compareAtPrice - price) / compareAtPrice;\n return Math.round(ratio * 100) >= 1 ? ratio : undefined;\n}\n\n// ── Drawing ──────────────────────────────────────────────────────────────────\n\nconst money = (config: AparteConfig, product: Product, amount: number) => formatPrice(config, amount, product.currency);\nconst notNull = <T>(value: T | null | undefined): value is T => value !== null && value !== undefined;\n\n/**\n * The photo in its square, over a bag glyph that stays underneath: a missing photo shows\n * the bag, and one that fails to load is hidden to show it — no node comes or goes.\n */\nfunction media(ctx: CardContext, product: Product, className = ''): HTMLElement {\n const frame = el('div', { class: `aparte-product__media${className ? ` ${className}` : ''}` },\n glyph(BAG, 'aparte-rich-card__glyph aparte-product__placeholder'));\n // A photo the policy holds shows the bag, as a product without one does.\n const image = product.image\n ? ctx.image(product.image.src, { class: 'aparte-product__image', attrs: { alt: product.image.alt ?? product.title, loading: 'lazy', decoding: 'async' } })\n : null;\n if (!image) {\n frame.setAttribute('data-empty', '');\n return frame;\n }\n image.addEventListener('error', () => {\n image.hidden = true;\n frame.setAttribute('data-empty', '');\n }, { once: true });\n frame.append(image);\n return frame;\n}\n\n/** The product's name, a link out when it has a URL — the one link a tile or a row has. */\nfunction titleOf(product: Product): HTMLElement {\n const title = el('div', { class: 'aparte-product__title' });\n if (product.url) {\n title.append(el('a', {\n class: 'aparte-product__link',\n attrs: { href: product.url, target: '_blank', rel: 'noopener noreferrer' },\n text: product.title,\n }));\n } else {\n title.textContent = product.title;\n }\n return title;\n}\n\nfunction merchantOf(ctx: CardContext, product: Product): HTMLElement | null {\n if (!product.merchant) return null;\n const node = el('div', { class: 'aparte-product__merchant' });\n // Empty alt: the shop's name is written right beside it. A held logo leaves the name alone.\n const logo = product.merchantLogo ? ctx.image(product.merchantLogo, { class: 'aparte-product__logo', attrs: { alt: '', loading: 'lazy', decoding: 'async' } }) : null;\n if (logo) {\n logo.addEventListener('error', () => { logo.hidden = true; }, { once: true });\n node.append(logo);\n }\n node.append(el('span', { class: 'aparte-product__merchant-name', text: product.merchant }));\n return node;\n}\n\nfunction discountBadge(ctx: CardContext, product: Product): HTMLElement | null {\n const ratio = discountOf(product);\n if (ratio === undefined) return null;\n const badge = el('span', { class: 'aparte-badge aparte-badge--danger aparte-badge--solid aparte-badge--sm aparte-product__discount' });\n ctx.bind(badge, () => `\\u2212${formatPercent(ctx.config, ratio)}`);\n return badge;\n}\n\n/** The price, the \"was\" price struck through after it, and — in `detail` — the discount beside them. */\nfunction priceOf(ctx: CardContext, product: Product, withDiscount = false): HTMLElement | null {\n if (product.price === undefined) return null;\n const row = el('div', { class: 'aparte-product__price' });\n const now = el('span', { class: 'aparte-product__now' });\n ctx.bind(now, () => money(ctx.config, product, product.price!));\n row.append(now);\n if (product.compareAtPrice !== undefined) {\n // A struck-through number is silent to a screen reader: it is told which one this is.\n const said = el('span', { class: 'aparte-sr-only' });\n ctx.bind(said, () => `${word(ctx.config, 'cardsProductWas', P.cardsProductWas)} `);\n const value = el('span', { class: 'aparte-product__was-value' });\n ctx.bind(value, () => money(ctx.config, product, product.compareAtPrice!));\n row.append(el('del', { class: 'aparte-product__was' }, said, value));\n const discount = withDiscount ? discountBadge(ctx, product) : null;\n if (discount) row.append(discount);\n }\n return row;\n}\n\nfunction availabilityOf(ctx: CardContext, product: Product): HTMLElement | null {\n const availability = product.availability;\n if (!availability) return null;\n const status = 'status' in availability ? availability.status : undefined;\n const text = el('span', { class: 'aparte-product__stock-text' });\n if (status) ctx.word(text, STOCK_WORD[status], P[STOCK_WORD[status]]);\n else text.textContent = (availability as { text: string }).text;\n return el('div', { class: 'aparte-product__stock', attrs: { 'data-availability': status ?? 'other' } },\n el('span', { class: 'aparte-product__dot', attrs: { 'aria-hidden': 'true' } }),\n text);\n}\n\nfunction shippingOf(ctx: CardContext, product: Product): HTMLElement | null {\n const shipping = product.shipping;\n if (!shipping) return null;\n const text = el('span', { class: 'aparte-product__shipping-text' });\n if ('text' in shipping) text.textContent = shipping.text;\n else if (shipping.cost === 0) ctx.word(text, 'cardsProductFreeShipping', P.cardsProductFreeShipping);\n else ctx.bind(text, () => word(ctx.config, 'cardsProductShippingCost', P.cardsProductShippingCost, { price: money(ctx.config, product, shipping.cost) }));\n return el('div', { class: 'aparte-product__shipping', attrs: { 'data-free': 'cost' in shipping && shipping.cost === 0 } },\n glyph(TRUCK, 'aparte-rich-card__glyph aparte-product__shipping-icon'),\n text);\n}\n\n/** What sits over the photo's corner: the shop's badge, and the discount where the variant puts it there. */\nfunction flags(ctx: CardContext, product: Product, withDiscount: boolean): HTMLElement | null {\n const items = [\n product.badge ? el('span', { class: 'aparte-badge aparte-badge--sm aparte-product__badge', text: product.badge }) : null,\n withDiscount ? discountBadge(ctx, product) : null,\n ].filter(notNull);\n return items.length ? el('div', { class: 'aparte-product__flags' }, ...items) : null;\n}\n\n/** Sizes, colours: six chips, then \"+n\" for the rest. */\nfunction optionsOf(ctx: CardContext, product: Product): HTMLElement | null {\n if (!product.options.length) return null;\n const list = el('ul', { class: 'aparte-product__options', attrs: { role: 'list' } });\n ctx.bind(list, () => word(ctx.config, 'cardsProductOptions', P.cardsProductOptions), 'aria-label');\n for (const option of product.options.slice(0, OPTIONS_SHOWN)) {\n list.append(el('li', { class: 'aparte-tag aparte-tag--sm aparte-product__option' }, el('span', { class: 'aparte-tag__label', text: option })));\n }\n const rest = product.options.length - OPTIONS_SHOWN;\n if (rest > 0) {\n const shown = el('span', { class: 'aparte-tag__label', attrs: { 'aria-hidden': 'true' } });\n ctx.bind(shown, () => `+${formatNumber(ctx.config, rest)}`);\n const said = el('span', { class: 'aparte-sr-only' });\n ctx.bind(said, () => word(ctx.config, 'cardsProductMoreOptions', P.cardsProductMoreOptions, { n: formatNumber(ctx.config, rest) }));\n list.append(el('li', { class: 'aparte-tag aparte-tag--sm aparte-product__option aparte-product__option--more' }, shown, said));\n }\n return list;\n}\n\n/** A product's own buttons, each handing the product back as the event's `data`. */\nfunction actionsOf(ctx: CardContext, product: Product, max: number): HTMLElement | null {\n const buttons = product.actions.slice(0, max).map((action) => ctx.action(action, product, 'aparte-product__action')).filter(notNull);\n return buttons.length ? el('div', { class: 'aparte-product__actions' }, ...buttons) : null;\n}\n\nfunction productRoot(kind: 'tile' | 'row' | 'detail', product: Product, extra = ''): HTMLElement {\n return el('div', {\n class: `aparte-product aparte-product--${kind}${extra ? ` ${extra}` : ''}`,\n attrs: {\n 'data-availability': product.availability && 'status' in product.availability ? product.availability.status : undefined,\n 'data-linked': product.url !== undefined,\n },\n });\n}\n\n/**\n * The `card` variant's tile. The title's link stretches over the whole tile (the sheet's\n * `::after`), so the tile is one link, read once, with its buttons lifted above it.\n * A `mini` tile — the others under a `detail` — keeps the photo, the name and the price.\n */\nfunction tile(ctx: CardContext, product: Product, { actions, mini = false }: { actions: number; mini?: boolean }): HTMLElement {\n const node = productRoot('tile', product, mini ? 'aparte-product--mini' : '');\n const photo = media(ctx, product);\n const corner = mini ? null : flags(ctx, product, true);\n if (corner) photo.append(corner);\n const body = el('div', { class: 'aparte-product__body' },\n mini ? null : merchantOf(ctx, product),\n titleOf(product),\n mini ? null : rating(ctx, product.rating, { count: product.reviewCount }),\n priceOf(ctx, product),\n mini ? null : availabilityOf(ctx, product));\n node.append(photo, body);\n const buttons = actionsOf(ctx, product, actions);\n if (buttons) node.append(buttons);\n return node;\n}\n\n/**\n * The `compact` variant's row: thumbnail, name, shop and stars, price. \"In stock\" is left\n * out — it is what a reader assumes — so the line only speaks when the stock changes the choice.\n */\nfunction row(ctx: CardContext, product: Product): HTMLElement {\n const node = productRoot('row', product);\n const meta = el('div', { class: 'aparte-product__meta' },\n product.merchant ? el('span', { class: 'aparte-product__merchant-name', text: product.merchant }) : null,\n rating(ctx, product.rating, { starsOnly: true }),\n product.availability && !('status' in product.availability && product.availability.status === 'in-stock') ? availabilityOf(ctx, product) : null);\n const main = el('div', { class: 'aparte-product__main' }, titleOf(product), meta.childNodes.length ? meta : null);\n node.append(media(ctx, product, 'aparte-product__thumb'), main);\n const amount = priceOf(ctx, product);\n if (amount) node.append(amount);\n const buttons = actionsOf(ctx, product, 1);\n if (buttons) node.append(buttons);\n return node;\n}\n\n/** The `detail` variant: everything the card knows, the photo beside it on a wide card. */\nfunction detail(ctx: CardContext, product: Product): HTMLElement {\n const node = productRoot('detail', product);\n const photo = media(ctx, product);\n const corner = flags(ctx, product, false);\n if (corner) photo.append(corner);\n // The photo links where the name does; the name's link is the one a keyboard and a\n // screen reader meet, so this copy is out of both.\n const shown = product.url\n ? el('a', { class: 'aparte-product__media-link', attrs: { href: product.url, target: '_blank', rel: 'noopener noreferrer', tabindex: -1, 'aria-hidden': 'true' } }, photo)\n : photo;\n const facts = el('div', { class: 'aparte-product__facts' }, availabilityOf(ctx, product), shippingOf(ctx, product));\n const body = el('div', { class: 'aparte-product__body' },\n merchantOf(ctx, product),\n titleOf(product),\n rating(ctx, product.rating, { count: product.reviewCount }),\n priceOf(ctx, product, true),\n facts.childNodes.length ? facts : null,\n product.description ? el('p', { class: 'aparte-product__description', text: product.description }) : null,\n optionsOf(ctx, product),\n actionsOf(ctx, product, ACTIONS_PER_PRODUCT));\n node.append(shown, body);\n return el('div', { class: 'aparte-product__detail' }, node);\n}\n\nfunction heading(data: ProductData): HTMLElement | null {\n return data.title ? el('div', { class: 'aparte-product__heading', text: data.title }) : null;\n}\n\nfunction labelOf(data: Partial<ProductData> | null, ctx: CardContext): string {\n const products = data?.products ?? [];\n if (products.length === 1) return products[0]!.title;\n if (data?.title) return data.title;\n if (products.length > 1) return word(ctx.config, 'cardsProductCount', P.cardsProductCount, { n: formatNumber(ctx.config, products.length) });\n return word(ctx.config, 'cardsProductTitle', P.cardsProductTitle);\n}\n\nfunction render(data: ProductData, ctx: CardContext<ProductVariant>): Node[] {\n const { products } = data;\n const first = products[0]!;\n\n if (ctx.variant === 'detail') {\n // One product looked at closely; the others stay one swipe away, small, rather\n // than a second row of full tiles competing with it. Rows were the other choice,\n // but nine rows under a detail make a page, and a row of mini tiles stays one line.\n const out: Node[] = [detail(ctx, first)];\n if (products.length > 1) {\n const title = el('div', { class: 'aparte-product__more-title' });\n ctx.word(title, 'cardsProductMore', P.cardsProductMore);\n const slides = products.slice(1).map((p) => tile(ctx, p, { actions: 0, mini: true }));\n out.push(el('div', { class: 'aparte-product__more' }, title,\n carousel(ctx, slides, { label: () => word(ctx.config, 'cardsProductMore', P.cardsProductMore) })));\n }\n return out;\n }\n\n if (ctx.variant === 'compact') {\n if (products.length === 1) return [row(ctx, first)];\n const list = el('ul', { class: 'aparte-product__rows', attrs: { role: 'list' } },\n ...products.map((p) => el('li', { class: 'aparte-product__item' }, row(ctx, p))));\n return [heading(data), list].filter(notNull);\n }\n\n if (products.length === 1) return [tile(ctx, first, { actions: ACTIONS_PER_PRODUCT })];\n // Several: tiles in a row that scrolls, one button each — a row of tiles reads as a\n // choice when each offers one thing to do.\n const slides = products.map((p) => tile(ctx, p, { actions: 1 }));\n return [el('div', { class: 'aparte-product__collection' },\n heading(data),\n carousel(ctx, slides, { label: () => labelOf(data, ctx) }))];\n}\n\nfunction skeleton(partial: Partial<ProductData> | null, ctx: CardContext<ProductVariant>): Node[] {\n const block = (cls: string, kind: 'text' | 'rect' = 'rect') =>\n el('span', { class: `aparte-skeleton aparte-skeleton--${kind} ${cls}`, attrs: { 'aria-hidden': 'true' } });\n const lines = () => [block('aparte-product__sk-line', 'text'), block('aparte-product__sk-line aparte-product__sk-line--short', 'text')];\n // What the search was for, before anything is found: the call's input already says it.\n const query = partial?.title\n ? el('div', { class: 'aparte-product__query' }, glyph(SEARCH, 'aparte-rich-card__glyph aparte-product__query-icon'), el('span', { class: 'aparte-product__query-text', text: partial.title }))\n : null;\n\n if (ctx.variant === 'compact') {\n const rows = [0, 1, 2].map(() => el('div', { class: 'aparte-product__item' },\n el('div', { class: 'aparte-product aparte-product--row aparte-product--skeleton' },\n block('aparte-product__sk-thumb'),\n el('div', { class: 'aparte-product__main' }, ...lines()),\n block('aparte-product__sk-price', 'text'))));\n return [query, el('div', { class: 'aparte-product__rows' }, ...rows)].filter(notNull);\n }\n if (ctx.variant === 'detail') {\n return [query, el('div', { class: 'aparte-product__detail' },\n el('div', { class: 'aparte-product aparte-product--detail aparte-product--skeleton' },\n block('aparte-product__sk-media'),\n el('div', { class: 'aparte-product__body' }, ...lines(), block('aparte-product__sk-price', 'text'), block('aparte-product__sk-line', 'text'))))].filter(notNull);\n }\n // Three tiles, the third cut by the edge: the shape a row of results will take.\n const tiles = [0, 1, 2].map(() => el('div', { class: 'aparte-product aparte-product--tile aparte-product--skeleton' },\n block('aparte-product__sk-media'),\n el('div', { class: 'aparte-product__body' }, ...lines(), block('aparte-product__sk-price', 'text'))));\n return [el('div', { class: 'aparte-product__collection' }, query, el('div', { class: 'aparte-product__sk-track' }, ...tiles))];\n}\n\nexport const productCard = defineCard<ProductData, ProductVariant>({\n name: 'product',\n variants: ['card', 'compact', 'detail'],\n styles: productStyles,\n icon: TAG,\n normalize: readProducts,\n render,\n skeleton,\n label: labelOf,\n fallback: (data, ctx) => {\n // One line per product, \"Title — price (4.6/5)\", the way a model or a text-only\n // reader would want them listed.\n const lines = data.products.map((p) => {\n const amount = p.price !== undefined ? ` — ${money(ctx.config, p, p.price)}` : '';\n const stars = p.rating !== undefined ? ` (${formatNumber(ctx.config, p.rating, { maximumFractionDigits: 1 })}/5)` : '';\n return `${p.title}${amount}${stars}`;\n });\n return [data.title, ...lines].filter(notNull).join('\\n');\n },\n partial: (input) => {\n const query = str(input['query'] ?? input['q'] ?? input['search'] ?? input['keywords'] ?? input['term'] ?? input['product']);\n return query ? { title: query } : null;\n },\n});\n\n/** Draw a tool's products as this card — returns the function that stops it. */\nexport function setupProductCard(options: CardSetupOptions<ProductData, ProductVariant> = {}): () => void {\n return productCard.setup(options);\n}\n"],
|
|
5
5
|
"mappings": "6PAQA,IAAMA,EAAOC,GACT,mKAAmKA,CAAI,SAG9JC,GAAMF,EAAI,yHAAyH,EAGnIG,GAAQH,EAAI,iJAAiJ,EAG7JI,GAASJ,EAAI,qEAAqE,EAGlFK,GAAML,EAAI,0IAA0I,ECrBjKM,GAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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U,OAAY,WAAMK,EAAMK,EAAI,OAAQV,EAAGA,EAAE,KAAK,CAAC,GAAK,GACzE9C,EAAQ8C,EAAE,SAAW,OAAY,KAAKoC,EAAa1B,EAAI,OAAQV,EAAE,OAAQ,CAAE,sBAAuB,CAAA,CAAG,CAAC,MAAQ,GACpH,MAAO,GAAGA,EAAE,KAAK,GAAGpE,CAAM,GAAGsB,CAAK,EACtC,CAAC,EACD,MAAO,CAACqG,EAAK,MAAO,GAAGU,CAAK,EAAE,OAAOzD,CAAO,EAAE,KAAK;CAAI,CAC3D,EACA,QAAU+D,GAAU,CAChB,IAAML,EAAQ5H,EAAIiI,EAAM,OAAYA,EAAM,GAAQA,EAAM,QAAaA,EAAM,UAAeA,EAAM,MAAWA,EAAM,OAAU,EAC3H,OAAOL,EAAQ,CAAE,MAAOA,CAAA,EAAU,IACtC,CACJ,CAAC,EAGM,SAASM,GAAiBC,EAAyD,CAAA,EAAgB,CACtG,OAAOJ,GAAY,MAAMI,CAAO,CACpC",
|
|
6
6
|
"names": ["svg", "body", "BAG", "TRUCK", "SEARCH", "TAG", "productStyles", "P", "STOCK_WORD", "PRODUCTS_SHOWN", "OPTIONS_SHOWN", "ACTIONS_PER_PRODUCT", "isObject", "value", "pick", "r", "keys", "key", "listOf", "e", "readMoney", "amount", "currency", "readPriceText", "currencyCode", "readImage", "item", "image", "src", "webUrl", "alt", "str", "AVAILABILITY", "readAvailability", "offer", "status", "flag", "readRating", "aggregate", "count", "best", "num", "given", "stars", "reviews", "NO_VARIANT", "readOptions", "out", "add", "s", "readShipping", "text", "cost", "readActions", "label", "url", "id", "ENTITIES", "decodeEntities", "whole", "name", "code", "plainText", "html", "cheapestVariant", "v", "price", "lowEnd", "range", "readProduct", "raw", "title", "offers", "own", "variant", "compareOwn", "compare", "merchantRaw", "merchant", "merchantLogo", "description", "reviewCount", "availability", "shipping", "badge", "readProducts", "list", "many", "products", "p", "discountOf", "product", "compareAtPrice", "ratio", "money", "config", "formatPrice", "notNull", "media", "ctx", "className", "frame", "el", "glyph", "titleOf", "merchantOf", "node", "logo", "discountBadge", "formatPercent", "priceOf", "withDiscount", "row", "now", "said", "word", "discount", "availabilityOf", "shippingOf", "flags", "items", "optionsOf", "option", "rest", "shown", "formatNumber", "actionsOf", "max", "buttons", "action", "productRoot", "kind", "extra", "tile", "actions", "mini", "photo", "corner", "rating", "meta", "main", "detail", "facts", "heading", "data", "labelOf", "render", "first", "slides", "carousel", "skeleton", "partial", "block", "cls", "lines", "query", "rows", "tiles", "productCard", "defineCard", "input", "setupProductCard", "options"]
|