@aparte/n8n-chat 0.3.0 → 0.3.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 +71 -16
- package/dist/cards.d.ts +25 -1
- package/dist/cdn/chunks/{chunk-F2TNPBN3.js → chunk-37ODPEBD.js} +1 -1
- package/dist/cdn/chunks/{chunk-F2TNPBN3.js.map → chunk-37ODPEBD.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-XC2SVYFR.js → chunk-DEOOTEDD.js} +2 -2
- package/dist/cdn/chunks/{chunk-XC2SVYFR.js.map → chunk-DEOOTEDD.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-F2QIT4NR.js → chunk-NKYV5B7Q.js} +2 -2
- package/dist/cdn/chunks/{chunk-F2QIT4NR.js.map → chunk-NKYV5B7Q.js.map} +3 -3
- package/dist/cdn/chunks/{chunk-KY2H3HIJ.js → chunk-RDVTD2YO.js} +2 -2
- package/dist/cdn/chunks/{chunk-KY2H3HIJ.js.map → chunk-RDVTD2YO.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-E55C7UF2.js → chunk-U6354LAY.js} +2 -2
- package/dist/cdn/chunks/{chunk-E55C7UF2.js.map → chunk-U6354LAY.js.map} +1 -1
- package/dist/cdn/chunks/{chunk-VLHCX6EH.js → chunk-ZNUFBTZ7.js} +2 -2
- package/dist/cdn/chunks/{chunk-VLHCX6EH.js.map → chunk-ZNUFBTZ7.js.map} +1 -1
- package/dist/cdn/chunks/{de-M5OVUL5F.js → de-BCWJVDW5.js} +1 -1
- package/dist/cdn/chunks/{de-M5OVUL5F.js.map → de-BCWJVDW5.js.map} +1 -1
- package/dist/cdn/chunks/{es-JUSLSPF7.js → es-72JNODLG.js} +1 -1
- package/dist/cdn/chunks/{es-JUSLSPF7.js.map → es-72JNODLG.js.map} +1 -1
- package/dist/cdn/chunks/{fr-Z2Y3375Z.js → fr-ZKACSOY5.js} +1 -1
- package/dist/cdn/chunks/{fr-Z2Y3375Z.js.map → fr-ZKACSOY5.js.map} +1 -1
- package/dist/cdn/chunks/{highlight-ADUWBKTT.js → highlight-DG2OVLBT.js} +2 -2
- package/dist/cdn/chunks/{highlight-ADUWBKTT.js.map → highlight-DG2OVLBT.js.map} +1 -1
- package/dist/cdn/chunks/{it-N53LIIX5.js → it-SSBBMSGX.js} +1 -1
- package/dist/cdn/chunks/{it-N53LIIX5.js.map → it-SSBBMSGX.js.map} +1 -1
- package/dist/cdn/chunks/{items-GTJKLFZT.js → items-MITCIPF3.js} +2 -2
- package/dist/cdn/chunks/{items-GTJKLFZT.js.map → items-MITCIPF3.js.map} +1 -1
- package/dist/cdn/chunks/{ja-LJHMBKJ4.js → ja-NCV4Z63H.js} +1 -1
- package/dist/cdn/chunks/{ja-LJHMBKJ4.js.map → ja-NCV4Z63H.js.map} +1 -1
- package/dist/cdn/chunks/{ko-XAQOC75B.js → ko-VCNS24WV.js} +1 -1
- package/dist/cdn/chunks/{ko-XAQOC75B.js.map → ko-VCNS24WV.js.map} +1 -1
- package/dist/cdn/chunks/{link-L4C4K5GE.js → link-7JYKZK3A.js} +2 -2
- package/dist/cdn/chunks/{link-L4C4K5GE.js.map → link-7JYKZK3A.js.map} +1 -1
- package/dist/cdn/chunks/{media-EOQEOMXK.js → media-7CZBXNEK.js} +2 -2
- package/dist/cdn/chunks/{media-EOQEOMXK.js.map → media-7CZBXNEK.js.map} +1 -1
- package/dist/cdn/chunks/{order-T5L422AO.js → order-CPY2L7MI.js} +2 -2
- package/dist/cdn/chunks/{order-T5L422AO.js.map → order-CPY2L7MI.js.map} +1 -1
- package/dist/cdn/chunks/{place-UD2C3U5F.js → place-KQ3IA5IV.js} +43 -4
- package/dist/cdn/chunks/place-KQ3IA5IV.js.map +7 -0
- package/dist/cdn/chunks/{plan-JJ3Z64NU.js → plan-OKXEPKPV.js} +2 -2
- package/dist/cdn/chunks/{plan-JJ3Z64NU.js.map → plan-OKXEPKPV.js.map} +1 -1
- package/dist/cdn/chunks/{product-FNGKWEQP.js → product-ONQRJRDO.js} +7 -3
- package/dist/cdn/chunks/product-ONQRJRDO.js.map +7 -0
- package/dist/cdn/chunks/{pt-BR-KMZM3WTU.js → pt-BR-73MNA3YX.js} +1 -1
- package/dist/cdn/chunks/{pt-BR-KMZM3WTU.js.map → pt-BR-73MNA3YX.js.map} +1 -1
- package/dist/cdn/chunks/{ru-3AG5HYY2.js → ru-SCEGVTR4.js} +1 -1
- package/dist/cdn/chunks/{ru-3AG5HYY2.js.map → ru-SCEGVTR4.js.map} +1 -1
- package/dist/cdn/chunks/{score-3CGZEPWP.js → score-QF27XJUE.js} +2 -2
- package/dist/cdn/chunks/{score-3CGZEPWP.js.map → score-QF27XJUE.js.map} +1 -1
- package/dist/cdn/chunks/{stats-FGZCRFFK.js → stats-2W3GFI4P.js} +2 -2
- package/dist/cdn/chunks/{stats-FGZCRFFK.js.map → stats-2W3GFI4P.js.map} +1 -1
- package/dist/cdn/chunks/{stock-E72GAUMB.js → stock-RCVJOOH4.js} +2 -2
- package/dist/cdn/chunks/{stock-E72GAUMB.js.map → stock-RCVJOOH4.js.map} +1 -1
- package/dist/cdn/chunks/{weather-5ZNWC2WM.js → weather-NQGN2JOS.js} +2 -2
- package/dist/cdn/chunks/{weather-5ZNWC2WM.js.map → weather-NQGN2JOS.js.map} +1 -1
- package/dist/cdn/chunks/{zh-CN-DL6ZWLGA.js → zh-CN-4K6QPBRT.js} +1 -1
- package/dist/cdn/chunks/{zh-CN-DL6ZWLGA.js.map → zh-CN-4K6QPBRT.js.map} +1 -1
- package/dist/cdn/n8n-chat.js +42 -42
- package/dist/cdn/n8n-chat.js.map +4 -4
- package/dist/create-chat.d.ts +11 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/style.css +383 -370
- package/dist/theme.css +381 -368
- package/package.json +7 -7
- package/dist/cdn/chunks/place-UD2C3U5F.js.map +0 -7
- package/dist/cdn/chunks/product-FNGKWEQP.js.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aparte/n8n-chat",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"homepage": "https://github.com/apartejs/n8n-chat#readme",
|
|
5
5
|
"description": "n8n's chat widget, drawn by aparté: createChat() takes @n8n/chat's options — a button in the corner or a full-page chat on your Chat Trigger, response nodes and buttons included, in n8n's look, in ten languages, from npm or a CDN.",
|
|
6
6
|
"type": "module",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"test:coverage": "vitest run --coverage"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@aparte/core": "0.
|
|
47
|
-
"@aparte/locales": "0.
|
|
48
|
-
"@aparte/plugin-cards": "0.
|
|
49
|
-
"@aparte/plugin-marked": "0.
|
|
50
|
-
"@aparte/plugin-shiki": "0.
|
|
51
|
-
"@aparte/runner-n8n": "0.
|
|
46
|
+
"@aparte/core": "0.30.0",
|
|
47
|
+
"@aparte/locales": "0.30.0",
|
|
48
|
+
"@aparte/plugin-cards": "0.30.0",
|
|
49
|
+
"@aparte/plugin-marked": "0.30.0",
|
|
50
|
+
"@aparte/plugin-shiki": "0.30.0",
|
|
51
|
+
"@aparte/runner-n8n": "0.30.0",
|
|
52
52
|
"@shikijs/langs": "4.5.0",
|
|
53
53
|
"@shikijs/themes": "4.5.0",
|
|
54
54
|
"marked": "18.0.6",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../node_modules/.pnpm/@aparte+plugin-cards@0.29.3_@aparte+core@0.29.3/node_modules/@aparte/plugin-cards/src/place/icons.ts", "../../../node_modules/.pnpm/@aparte+plugin-cards@0.29.3_@aparte+core@0.29.3/node_modules/@aparte/plugin-cards/src/place/place.css", "../../../node_modules/.pnpm/@aparte+plugin-cards@0.29.3_@aparte+core@0.29.3/node_modules/@aparte/plugin-cards/src/place/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * The place card's glyphs: one 24 × 24 line drawing each, in `currentColor`, so the sheet\n * colours them with the text around them — the pin, the three actions' signs, and one\n * glyph per kind of place for the placeholder and the badge.\n *\n * They live here and not in core's `icons/`: core draws no place. They are constants of\n * the package, the only markup the card parses.\n */\n\n/** The kinds of place a glyph (and a word) exists for; anything else is a `place`. */\nexport type PlaceKind = 'restaurant' | 'cafe' | 'bar' | 'hotel' | 'shop' | 'museum' | 'park' | 'gym' | 'pharmacy' | 'place';\n\nconst svg = (body: string) =>\n `<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" 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\nexport const PIN = svg('<path d=\"M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0 1 13 0c0 5.4-6.5 11-6.5 11z\"/><circle cx=\"12\" cy=\"10\" r=\"2.4\"/>');\nexport const PHONE = svg('<path d=\"M5.2 4h3l1.6 4-2 1.3a10.5 10.5 0 0 0 5 5l1.3-2 4 1.6v3a2 2 0 0 1-2.1 2A15.2 15.2 0 0 1 3.2 6.1 2 2 0 0 1 5.2 4z\"/>');\nexport const GLOBE = svg('<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M3.5 12h17M12 3.5c2.4 2.4 3.5 5.3 3.5 8.5s-1.1 6.1-3.5 8.5c-2.4-2.4-3.5-5.3-3.5-8.5s1.1-6.1 3.5-8.5z\"/>');\nexport const DIRECTIONS = svg('<path d=\"M12 2.8 21.2 12 12 21.2 2.8 12z\"/><path d=\"M9.2 14.6v-2.4a1.4 1.4 0 0 1 1.4-1.4h4.6M13.4 8.8l1.9 2-1.9 2\"/>');\nexport const CLOCK = svg('<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M12 7.5V12l3 2\"/>');\n\nconst KIND_GLYPHS: Record<PlaceKind, string> = {\n restaurant: svg('<path d=\"M7 3v18M4.6 3v4.8A2.4 2.4 0 0 0 7 10.2a2.4 2.4 0 0 0 2.4-2.4V3M17 21V3c-2.3 1.4-3.5 4-3.5 7.2V13H17\"/>'),\n cafe: svg('<path d=\"M4.5 9h11v5.5a4.5 4.5 0 0 1-4.5 4.5H9a4.5 4.5 0 0 1-4.5-4.5z\"/><path d=\"M15.5 10.5h1.3a2.6 2.6 0 0 1 0 5.2h-1.6M8 3.5c-.6.8-.6 1.7 0 2.5M11.5 3.5c-.6.8-.6 1.7 0 2.5\"/>'),\n bar: svg('<path d=\"M5 4h14l-7 8z\"/><path d=\"M12 12v8M8.5 20h7M8.6 8h6.8\"/>'),\n hotel: svg('<path d=\"M3 18.5V6M3 14h18v4.5M21 14v-2.5a3 3 0 0 0-3-3h-7V14\"/><circle cx=\"7\" cy=\"10.5\" r=\"1.8\"/>'),\n shop: svg('<path d=\"M5.5 8h13l-1 12.5h-11z\"/><path d=\"M9 10V7a3 3 0 0 1 6 0v3\"/>'),\n museum: svg('<path d=\"M3.5 9.5 12 4l8.5 5.5zM5 20.5h14M6.5 11.5v6.5M10 11.5v6.5M14 11.5v6.5M17.5 11.5v6.5\"/>'),\n park: svg('<path d=\"M12 21v-5M12 3 6.5 11h3L6 16h12l-3.5-5h3z\"/>'),\n gym: svg('<path d=\"M6.5 7v10M17.5 7v10M3.5 9.5v5M20.5 9.5v5M6.5 12h11\"/>'),\n pharmacy: svg('<rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"4\"/><path d=\"M12 8.5v7M8.5 12h7\"/>'),\n place: PIN,\n};\n\n/** The glyph for a kind of place. */\nexport function kindGlyph(kind: PlaceKind): string {\n return KIND_GLYPHS[kind];\n}\n", "export default \"/* =========================================\\n The place card — @aparte/plugin-cards/place\\n =========================================\\n Three variants of one card, chosen by `data-variant` on its root:\\n card a tile: the photo with its category, the name, the rating, whether it is\\n open, the address, three buttons. Several scroll sideways as tiles.\\n compact one row: a thumbnail, the name and the distance, the rating, the status.\\n Several are stacked rows in one card.\\n detail one place in full: the tile's head, the buttons, the ways in (address,\\n phone, site), the week's hours with today marked, the tags.\\n Every colour comes from core's tokens, or from a `--aparte-place-*` token here: the\\n three status inks and one hue per kind of place, which tint the placeholder and the\\n marker. A theme repaints the card by setting them.\\n */\\n\\n.aparte-place-card {\\n /* What \\\"open\\\", \\\"closes soon\\\" and \\\"closed\\\" are written in: the derived inks, which are\\n readable as text on either ground. */\\n --aparte-place-open: var(--aparte-success-ink);\\n --aparte-place-soon: var(--aparte-warning-ink);\\n --aparte-place-closed: var(--aparte-error-ink);\\n --aparte-place-media-ratio: 16 / 9;\\n --aparte-place-detail-ratio: 2 / 1;\\n --aparte-place-thumb-size: 3.5rem;\\n --aparte-place-on-hue: #ffffff;\\n\\n /* One hue per kind of place: the marker on the placeholder, the badge's glyph. */\\n --aparte-place-kind-restaurant: #e8710a;\\n --aparte-place-kind-cafe: #a0612b;\\n --aparte-place-kind-bar: #9c3fd1;\\n --aparte-place-kind-hotel: #2f6fdf;\\n --aparte-place-kind-shop: #d6336c;\\n --aparte-place-kind-museum: #5b5bd6;\\n --aparte-place-kind-park: #2f9e44;\\n --aparte-place-kind-gym: #e03131;\\n --aparte-place-kind-pharmacy: #0c9488;\\n --aparte-place-kind-place: var(--aparte-primary);\\n}\\n\\n/* A tile reads its kind's hue once; everything inside it says `--aparte-place-hue`. */\\n.aparte-place { --aparte-place-hue: var(--aparte-place-kind-place); }\\n.aparte-place[data-kind=\\\"restaurant\\\"] { --aparte-place-hue: var(--aparte-place-kind-restaurant); }\\n.aparte-place[data-kind=\\\"cafe\\\"] { --aparte-place-hue: var(--aparte-place-kind-cafe); }\\n.aparte-place[data-kind=\\\"bar\\\"] { --aparte-place-hue: var(--aparte-place-kind-bar); }\\n.aparte-place[data-kind=\\\"hotel\\\"] { --aparte-place-hue: var(--aparte-place-kind-hotel); }\\n.aparte-place[data-kind=\\\"shop\\\"] { --aparte-place-hue: var(--aparte-place-kind-shop); }\\n.aparte-place[data-kind=\\\"museum\\\"] { --aparte-place-hue: var(--aparte-place-kind-museum); }\\n.aparte-place[data-kind=\\\"park\\\"] { --aparte-place-hue: var(--aparte-place-kind-park); }\\n.aparte-place[data-kind=\\\"gym\\\"] { --aparte-place-hue: var(--aparte-place-kind-gym); }\\n.aparte-place[data-kind=\\\"pharmacy\\\"] { --aparte-place-hue: var(--aparte-place-kind-pharmacy); }\\n\\n/* A single tile is narrower than the card's default: it is a photo and five lines. */\\n.aparte-place-card[data-variant=\\\"card\\\"] { --aparte-rich-card-max-inline-size: 22rem; }\\n\\n/* ── The place ───────────────────────────────────────────────────────── */\\n\\n.aparte-place {\\n position: relative;\\n display: flex;\\n flex-direction: column;\\n min-inline-size: 0;\\n color: var(--aparte-text);\\n}\\n\\n.aparte-place__body {\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n padding: var(--aparte-space-6) var(--aparte-space-7) var(--aparte-space-7);\\n}\\n\\n.aparte-place__name {\\n overflow: hidden;\\n font-size: var(--aparte-font-size-lg);\\n font-weight: var(--aparte-font-weight-semibold);\\n letter-spacing: -0.01em;\\n line-height: 1.25;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n\\n.aparte-place__link {\\n color: inherit;\\n text-decoration: none;\\n border-radius: var(--aparte-radius-xs);\\n}\\n\\n.aparte-place__link:hover {\\n text-decoration: underline;\\n text-decoration-thickness: 1px;\\n text-underline-offset: 0.18em;\\n}\\n\\n.aparte-place__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/* A tile, a row and a lone card are one target: the name's link covers the whole of it,\\n and its buttons sit above that cover. The ring is then drawn around the target, inset,\\n because the card clips what passes its edge. */\\n.aparte-place--tile .aparte-place__name .aparte-place__link::after,\\n.aparte-place__row .aparte-place__name .aparte-place__link::after,\\n.aparte-place-card[data-variant=\\\"card\\\"] > .aparte-place .aparte-place__name .aparte-place__link::after {\\n content: \\\"\\\";\\n position: absolute;\\n inset: 0;\\n border-radius: inherit;\\n}\\n\\n.aparte-place--tile .aparte-place__name .aparte-place__link:focus-visible,\\n.aparte-place__row .aparte-place__name .aparte-place__link:focus-visible,\\n.aparte-place-card[data-variant=\\\"card\\\"] > .aparte-place .aparte-place__name .aparte-place__link:focus-visible {\\n outline: none;\\n}\\n\\n.aparte-place--tile .aparte-place__name .aparte-place__link:focus-visible::after,\\n.aparte-place__row .aparte-place__name .aparte-place__link:focus-visible::after,\\n.aparte-place-card[data-variant=\\\"card\\\"] > .aparte-place .aparte-place__name .aparte-place__link:focus-visible::after {\\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.aparte-place--tile:hover .aparte-place__name .aparte-place__link,\\n.aparte-place__row:hover .aparte-place__name .aparte-place__link {\\n text-decoration: underline;\\n text-decoration-thickness: 1px;\\n text-underline-offset: 0.18em;\\n}\\n\\n.aparte-place__dot {\\n flex: none;\\n color: var(--aparte-text-muted);\\n opacity: 0.7;\\n}\\n\\n.aparte-place__score {\\n display: flex;\\n flex-wrap: wrap;\\n align-items: center;\\n column-gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n}\\n\\n.aparte-place__price {\\n white-space: nowrap;\\n letter-spacing: 0.04em;\\n}\\n\\n.aparte-place__price-on {\\n color: var(--aparte-text);\\n font-weight: var(--aparte-font-weight-medium);\\n}\\n\\n.aparte-place__price-off { opacity: 0.35; }\\n\\n.aparte-place__category {\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n\\n/* ── Open, closes soon, closed ───────────────────────────────────────── */\\n\\n.aparte-place__status {\\n --aparte-place-status: var(--aparte-place-open);\\n display: flex;\\n flex-wrap: wrap;\\n align-items: center;\\n column-gap: var(--aparte-space-2);\\n margin: 0;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n}\\n\\n.aparte-place__status[data-status=\\\"soon\\\"] { --aparte-place-status: var(--aparte-place-soon); }\\n.aparte-place__status[data-status=\\\"closed\\\"] { --aparte-place-status: var(--aparte-place-closed); }\\n\\n.aparte-place__status-dot {\\n position: relative;\\n flex: none;\\n inline-size: 0.5rem;\\n block-size: 0.5rem;\\n margin-inline-end: var(--aparte-space-1);\\n border-radius: var(--aparte-radius-full);\\n background: var(--aparte-place-status);\\n box-shadow: 0 0 0 3px color-mix(in oklab, var(--aparte-place-status) 20%, transparent);\\n}\\n\\n/* An open place breathes: a ring leaves the dot every few seconds. Still under reduced motion. */\\n.aparte-place__status[data-status=\\\"open\\\"] .aparte-place__status-dot::after {\\n content: \\\"\\\";\\n position: absolute;\\n inset: 0;\\n border-radius: inherit;\\n background: var(--aparte-place-status);\\n animation: aparte-place-pulse 2.6s ease-out infinite;\\n}\\n\\n.aparte-place__state {\\n color: var(--aparte-place-status);\\n font-weight: var(--aparte-font-weight-semibold);\\n}\\n\\n@keyframes aparte-place-pulse {\\n 0% { opacity: 0.55; transform: scale(1); }\\n 70%, 100% { opacity: 0; transform: scale(2.6); }\\n}\\n\\n/* ── Address and the lines with a glyph ──────────────────────────────── */\\n\\n.aparte-place__address {\\n display: flex;\\n align-items: center;\\n gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n margin: 0;\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n white-space: nowrap;\\n}\\n\\n.aparte-place__address-text {\\n min-inline-size: 0;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n}\\n\\n.aparte-place__distance {\\n flex: none;\\n color: var(--aparte-text);\\n font-weight: var(--aparte-font-weight-medium);\\n white-space: nowrap;\\n}\\n\\n.aparte-place__line-glyph {\\n --aparte-rich-card-glyph-size: 1rem;\\n color: var(--aparte-text-muted);\\n}\\n\\n/* ── The photo, or its placeholder ───────────────────────────────────── */\\n\\n.aparte-place__media {\\n position: relative;\\n flex: none;\\n overflow: hidden;\\n isolation: isolate;\\n background: var(--aparte-surface-2);\\n}\\n\\n.aparte-place__media--wide { aspect-ratio: var(--aparte-place-media-ratio); }\\n\\n.aparte-place__img {\\n position: absolute;\\n inset: 0;\\n z-index: 1;\\n display: block;\\n inline-size: 100%;\\n block-size: 100%;\\n object-fit: cover;\\n transition: transform var(--aparte-duration-slower, 0.3s) ease;\\n}\\n\\n.aparte-place--tile:hover .aparte-place__img,\\n.aparte-place-card[data-variant=\\\"card\\\"] > .aparte-place:hover .aparte-place__img {\\n transform: scale(1.04);\\n}\\n\\n/* No photo: a soft map in the kind's hue — two avenues, a grid of streets, a glow — and\\n the kind's marker standing on it. Decoration, drawn by the sheet: no map tile is fetched. */\\n.aparte-place__placeholder {\\n --aparte-place-street: color-mix(in oklab, var(--aparte-surface-1) 72%, transparent);\\n --aparte-place-avenue: color-mix(in oklab, var(--aparte-surface-1) 92%, transparent);\\n position: absolute;\\n inset: 0;\\n display: grid;\\n place-items: center;\\n background:\\n radial-gradient(circle at 50% 48%, color-mix(in oklab, var(--aparte-place-hue) 24%, transparent) 0 14%, transparent 48%),\\n linear-gradient(118deg, transparent 0 36%, var(--aparte-place-avenue) 36% 39.5%, transparent 39.5%),\\n linear-gradient(22deg, transparent 0 63%, var(--aparte-place-avenue) 63% 65.5%, transparent 65.5%),\\n repeating-linear-gradient(118deg, transparent 0 22px, var(--aparte-place-street) 22px 24px),\\n repeating-linear-gradient(28deg, transparent 0 31px, var(--aparte-place-street) 31px 33px),\\n color-mix(in oklab, var(--aparte-place-hue) 13%, var(--aparte-surface-2));\\n}\\n\\n/* The marker's shadow on the ground. */\\n.aparte-place__placeholder::after {\\n content: \\\"\\\";\\n position: absolute;\\n inset-block-start: calc(50% + 1.45rem);\\n inset-inline-start: 50%;\\n inline-size: 1.4rem;\\n block-size: 0.4rem;\\n margin-inline-start: -0.7rem;\\n border-radius: 50%;\\n background: rgb(0 0 0 / 0.22);\\n filter: blur(2px);\\n}\\n\\n/* A drop pin: a square with three round corners, turned so the sharp one points down. */\\n.aparte-place__marker {\\n display: grid;\\n place-items: center;\\n inline-size: 2.75rem;\\n block-size: 2.75rem;\\n margin-block-end: 0.9rem;\\n border-radius: 50% 50% 50% 0;\\n background: var(--aparte-place-hue);\\n color: var(--aparte-place-on-hue);\\n box-shadow:\\n 0 0 0 3px color-mix(in oklab, var(--aparte-surface-1) 85%, transparent),\\n 0 8px 16px -6px color-mix(in oklab, var(--aparte-place-hue) 70%, black);\\n transform: rotate(-45deg);\\n}\\n\\n.aparte-place__marker-glyph {\\n --aparte-rich-card-glyph-size: 1.3rem;\\n transform: rotate(45deg);\\n}\\n\\n.aparte-place__media--thumb {\\n inline-size: var(--aparte-place-thumb-size);\\n block-size: var(--aparte-place-thumb-size);\\n border-radius: var(--aparte-radius-lg);\\n}\\n\\n/* In a thumbnail the placeholder is only the kind's glyph on its tint. */\\n.aparte-place__media--thumb .aparte-place__placeholder {\\n background: color-mix(in oklab, var(--aparte-place-hue) 15%, var(--aparte-surface-1));\\n}\\n\\n.aparte-place__media--thumb .aparte-place__placeholder::after { content: none; }\\n\\n.aparte-place__media--thumb .aparte-place__marker {\\n inline-size: auto;\\n block-size: auto;\\n margin: 0;\\n border-radius: 0;\\n background: none;\\n box-shadow: none;\\n color: var(--aparte-place-hue);\\n transform: none;\\n}\\n\\n.aparte-place__media--thumb .aparte-place__marker-glyph {\\n --aparte-rich-card-glyph-size: 1.5rem;\\n transform: none;\\n}\\n\\n/* The category, over the photo: a frosted chip, which reads on any picture. */\\n.aparte-place__badge {\\n position: absolute;\\n inset-block-start: var(--aparte-space-5);\\n inset-inline-start: var(--aparte-space-5);\\n z-index: 2;\\n display: inline-flex;\\n align-items: center;\\n gap: var(--aparte-space-2);\\n max-inline-size: calc(100% - var(--aparte-space-5) * 2);\\n padding-block: var(--aparte-space-2);\\n padding-inline: var(--aparte-space-3) var(--aparte-space-4);\\n border-radius: var(--aparte-radius-full);\\n background: color-mix(in oklab, var(--aparte-surface-1) 86%, transparent);\\n backdrop-filter: blur(8px) saturate(1.4);\\n box-shadow: 0 1px 4px rgb(0 0 0 / 0.14);\\n color: var(--aparte-text);\\n font-size: var(--aparte-font-size-sm);\\n font-weight: var(--aparte-font-weight-medium);\\n line-height: 1.2;\\n}\\n\\n.aparte-place__badge-glyph {\\n --aparte-rich-card-glyph-size: 0.95rem;\\n color: var(--aparte-place-hue);\\n}\\n\\n/* ── Buttons ─────────────────────────────────────────────────────────── */\\n\\n.aparte-place__actions {\\n position: relative;\\n z-index: 3;\\n display: flex;\\n flex-wrap: wrap;\\n gap: var(--aparte-space-3);\\n margin-block-start: var(--aparte-space-5);\\n}\\n\\n.aparte-place__action {\\n gap: var(--aparte-space-2);\\n}\\n\\n/* ── Several, side by side ───────────────────────────────────────────── */\\n\\n/* Tiles in a row carry their own frame, so the card around them steps back. */\\n.aparte-place-card:has(> .aparte-place__collection) {\\n --aparte-rich-card-max-inline-size: 40rem;\\n overflow: visible;\\n border-color: transparent;\\n background: transparent;\\n}\\n\\n.aparte-place__collection {\\n display: grid;\\n gap: var(--aparte-space-4);\\n min-inline-size: 0;\\n}\\n\\n.aparte-place__collection .aparte-rich-card__carousel {\\n --aparte-rich-card-slide-size: min(15rem, 80%);\\n}\\n\\n.aparte-place__heading {\\n display: flex;\\n align-items: center;\\n gap: var(--aparte-space-3);\\n min-inline-size: 0;\\n font-size: var(--aparte-font-size-md);\\n font-weight: var(--aparte-font-weight-semibold);\\n}\\n\\n.aparte-place__heading-text {\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n}\\n\\n.aparte-place__collection > .aparte-place__heading { padding-inline: var(--aparte-space-2); }\\n\\n.aparte-place--tile {\\n block-size: 100%;\\n overflow: hidden;\\n border: var(--aparte-border-width) solid var(--aparte-border);\\n border-radius: var(--aparte-radius-xl);\\n background: var(--aparte-surface-1);\\n transition:\\n border-color var(--aparte-duration-base, 0.15s) ease,\\n box-shadow var(--aparte-duration-base, 0.15s) ease;\\n}\\n\\n.aparte-place--tile:hover {\\n border-color: color-mix(in oklab, var(--aparte-text) 20%, var(--aparte-border));\\n box-shadow: 0 10px 24px -16px rgb(0 0 0 / 0.5);\\n}\\n\\n.aparte-place--tile .aparte-place__body {\\n padding: var(--aparte-space-5) var(--aparte-space-6) var(--aparte-space-6);\\n}\\n\\n.aparte-place--tile .aparte-place__name { font-size: var(--aparte-font-size-base); }\\n\\n/* The buttons sit on the tile's floor, so a row of tiles lines them up. */\\n.aparte-place--tile .aparte-place__actions { margin-block-start: auto; padding-block-start: var(--aparte-space-5); }\\n\\n/* ── Compact: rows ───────────────────────────────────────────────────── */\\n\\n.aparte-place__row {\\n flex-direction: row;\\n align-items: center;\\n gap: var(--aparte-space-5);\\n padding: var(--aparte-space-5) var(--aparte-space-6);\\n transition: background-color var(--aparte-duration-fast, 0.12s) ease;\\n}\\n\\n.aparte-place__text {\\n display: flex;\\n flex: 1;\\n flex-direction: column;\\n gap: var(--aparte-space-1);\\n min-inline-size: 0;\\n}\\n\\n.aparte-place__row-head {\\n display: flex;\\n align-items: baseline;\\n gap: var(--aparte-space-3);\\n min-inline-size: 0;\\n}\\n\\n.aparte-place__row .aparte-place__name {\\n flex: 1;\\n min-inline-size: 0;\\n font-size: var(--aparte-font-size-base);\\n}\\n\\n.aparte-place__row .aparte-place__distance {\\n color: var(--aparte-text-muted);\\n font-size: var(--aparte-font-size-sm);\\n}\\n\\n.aparte-place__row .aparte-place__score,\\n.aparte-place__row .aparte-place__status { font-size: var(--aparte-font-size-xs); }\\n\\n.aparte-place__row .aparte-place__score { flex-wrap: nowrap; overflow: hidden; }\\n\\n.aparte-place__list {\\n margin: 0;\\n padding: 0;\\n list-style: none;\\n}\\n\\n.aparte-place__list > li + li { border-block-start: var(--aparte-border-width) solid var(--aparte-border); }\\n\\n.aparte-place__list > .aparte-place__row:hover,\\n.aparte-place-card[data-variant=\\\"compact\\\"] > .aparte-place__row:hover {\\n background: color-mix(in oklab, var(--aparte-text) 4%, transparent);\\n}\\n\\n.aparte-place-card[data-variant=\\\"compact\\\"] > .aparte-place__heading {\\n padding: var(--aparte-space-5) var(--aparte-space-6) var(--aparte-space-3);\\n border-block-end: var(--aparte-border-width) solid var(--aparte-border);\\n}\\n\\n/* ── Detail ──────────────────────────────────────────────────────────── */\\n\\n.aparte-place--detail .aparte-place__media--wide { aspect-ratio: var(--aparte-place-detail-ratio); }\\n\\n.aparte-place--detail .aparte-place__body {\\n gap: var(--aparte-space-7);\\n padding: var(--aparte-space-7) var(--aparte-space-8) var(--aparte-space-8);\\n}\\n\\n.aparte-place__head {\\n display: flex;\\n flex-direction: column;\\n gap: var(--aparte-space-2);\\n min-inline-size: 0;\\n}\\n\\n.aparte-place--detail .aparte-place__name {\\n font-size: var(--aparte-font-size-xl);\\n white-space: normal;\\n}\\n\\n.aparte-place--detail .aparte-place__score,\\n.aparte-place--detail .aparte-place__status { font-size: var(--aparte-font-size-md); }\\n\\n.aparte-place--detail .aparte-place__actions { margin: 0; }\\n\\n.aparte-place__info {\\n display: grid;\\n gap: var(--aparte-space-5);\\n margin: 0;\\n padding: var(--aparte-space-6) 0 0;\\n border-block-start: var(--aparte-border-width) solid var(--aparte-border);\\n list-style: none;\\n font-size: var(--aparte-font-size-md);\\n}\\n\\n.aparte-place__info > li {\\n display: flex;\\n align-items: flex-start;\\n gap: var(--aparte-space-4);\\n min-inline-size: 0;\\n overflow-wrap: anywhere;\\n}\\n\\n.aparte-place__info .aparte-place__line-glyph { margin-block-start: 0.1em; }\\n.aparte-place__info .aparte-place__address-text { white-space: normal; }\\n.aparte-place__info .aparte-place__link { color: var(--aparte-primary-ink, var(--aparte-text)); }\\n\\n.aparte-place__hours {\\n inline-size: 100%;\\n border-collapse: collapse;\\n font-size: var(--aparte-font-size-md);\\n}\\n\\n.aparte-place__hours-title {\\n padding-block: var(--aparte-space-6) var(--aparte-space-3);\\n border-block-start: var(--aparte-border-width) solid var(--aparte-border);\\n font-weight: var(--aparte-font-weight-semibold);\\n text-align: start;\\n}\\n\\n.aparte-place__hours-title .aparte-place__line-glyph {\\n margin-inline-end: var(--aparte-space-3);\\n vertical-align: -0.15em;\\n}\\n\\n.aparte-place__hours th,\\n.aparte-place__hours td {\\n padding-block: var(--aparte-space-2);\\n vertical-align: top;\\n}\\n\\n.aparte-place__hours th {\\n padding-inline: var(--aparte-space-3) var(--aparte-space-6);\\n color: var(--aparte-text-muted);\\n font-weight: var(--aparte-font-weight-normal);\\n text-align: start;\\n white-space: nowrap;\\n}\\n\\n/* `Intl` writes \\\"lundi\\\" for the middle of a sentence; a row's label starts with a capital. */\\n.aparte-place__hours th::first-letter { text-transform: uppercase; }\\n\\n.aparte-place__hours td {\\n padding-inline-end: var(--aparte-space-3);\\n text-align: end;\\n}\\n\\n.aparte-place__hours tr[data-closed] td { color: var(--aparte-place-closed); }\\n\\n/* Today: the first row, on a band of the accent, in full ink. */\\n.aparte-place__hours tr[aria-current] > * {\\n background: color-mix(in oklab, var(--aparte-primary) 10%, transparent);\\n color: var(--aparte-text);\\n font-weight: var(--aparte-font-weight-semibold);\\n}\\n\\n.aparte-place__hours tr[aria-current] > :first-child {\\n border-start-start-radius: var(--aparte-radius-md);\\n border-end-start-radius: var(--aparte-radius-md);\\n}\\n\\n.aparte-place__hours tr[aria-current] > :last-child {\\n border-start-end-radius: var(--aparte-radius-md);\\n border-end-end-radius: var(--aparte-radius-md);\\n}\\n\\n.aparte-place__tags {\\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/* ── Loading ─────────────────────────────────────────────────────────── */\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-media {\\n block-size: auto;\\n border-radius: 0;\\n}\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-thumb {\\n flex: none;\\n block-size: var(--aparte-place-thumb-size);\\n border-radius: var(--aparte-radius-lg);\\n}\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-name { inline-size: 60%; block-size: 1.1rem; }\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-line { inline-size: 80%; }\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-line--short { inline-size: 50%; }\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-actions {\\n display: flex;\\n gap: var(--aparte-space-3);\\n margin-block-start: var(--aparte-space-5);\\n}\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-btn {\\n inline-size: 6rem;\\n block-size: 2rem;\\n border-radius: var(--aparte-radius-full);\\n}\\n\\n.aparte-place-card[data-state=\\\"loading\\\"] .aparte-place__sk-hours {\\n display: grid;\\n gap: var(--aparte-space-3);\\n margin-block-start: var(--aparte-space-5);\\n}\\n\\n/* ── Small screens, and stillness ────────────────────────────────────── */\\n\\n@media (max-width: 380px) {\\n .aparte-place__body { padding: var(--aparte-space-5) var(--aparte-space-6) var(--aparte-space-6); }\\n .aparte-place--detail .aparte-place__body { padding: var(--aparte-space-6); }\\n .aparte-place__actions > .aparte-place__action:not(.aparte-btn--icon) { flex: 1 1 auto; justify-content: center; }\\n .aparte-place__collection .aparte-rich-card__carousel { --aparte-rich-card-slide-size: 84%; }\\n .aparte-place__hours th { padding-inline-end: var(--aparte-space-4); }\\n .aparte-place-card { --aparte-place-thumb-size: 3rem; }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n .aparte-place--tile:hover .aparte-place__img,\\n .aparte-place-card[data-variant=\\\"card\\\"] > .aparte-place:hover .aparte-place__img { transform: none; }\\n .aparte-place__status-dot::after { content: none; }\\n}\\n\"", "/**\n * @aparte/plugin-cards/place — a tool's places, drawn as cards: a restaurant, a shop, a\n * hotel, a venue, with its rating, whether it is open now, and the way there.\n *\n * import { setupPlaceCard } from '@aparte/plugin-cards/place';\n *\n * setupPlaceCard({ tool: 'search_places', map: (result) => result.results });\n *\n * One place or several (`[...]`, or `{ title, places: [...] }`). Three variants of one\n * card: `card` (a tile with its photo; several scroll sideways), `compact` (one row each,\n * stacked) and `detail` (one place in full, with its week of opening hours). Your tool keeps\n * its own fields: `readPlaces` reads the usual names for each (Google Places, both\n * generations, Yelp, OpenStreetMap-ish tools, what a model writes by hand), and `map` says\n * the rest.\n *\n * Whether a place is open is worked out when the card is drawn, from its weekly `hours`\n * (`isOpenAt`, `placeStatus`) — Google's current hours, holidays included, before its\n * regular week — else from the tool's own `openNow`. The three buttons a place\n * gets for free — Directions, Call, Website — appear only when its data can honour them,\n * and an app that passes its own `actions` replaces them.\n */\nimport type { AparteConfig } from '@aparte/core';\nimport { carousel } from '../kit/carousel.js';\nimport { defineCard, type CardContext, type CardSetupOptions } from '../kit/define.js';\nimport { el, glyph, num, safeUrl, str, type Loose } from '../kit/dom.js';\nimport { formatNumber, formatUnit } from '../kit/format.js';\nimport { rating } from '../kit/rating.js';\nimport { intlTag, word, type CardWord } from '../kit/strings.js';\nimport { CLOCK, DIRECTIONS, GLOBE, PHONE, PIN, kindGlyph, type PlaceKind } from './icons.js';\nimport placeStyles from './place.css?raw';\n\nexport type { PlaceKind } from './icons.js';\nexport type PlaceVariant = 'card' | 'compact' | 'detail';\n\n/** One opening range of the week, as a tool writes it. */\nexport interface PlaceHoursInput {\n /** 0 = Sunday … 6 = Saturday (7 reads as Sunday too), or an English day name (\"mon\", \"Monday\"). */\n day: number | string;\n /** \"09:00\", \"9:30\", \"0900\", \"21h30\", \"9 PM\". */\n open: string;\n /** Past midnight is fine (\"02:00\" after \"18:00\"). Missing, or \"24:00\", is midnight. */\n close?: string;\n}\n\n/** An opening range once read: minutes from the start of `day`. `end` passes 1440 when it closes after midnight. */\nexport interface PlaceHoursRange {\n day: number;\n start: number;\n end: number;\n}\n\n/**\n * A place as `map` returns it. Only `name` is needed; every other field adds a line when it\n * is there and nothing when it is not. `readPlaces` also reads the usual aliases (listed on\n * each field).\n */\nexport interface PlaceInput {\n /** Also `title`, `displayName`. */\n name: string;\n /** Shown as it is: \"Trattoria\", \"Boulangerie\". Also `primaryTypeDisplayName`, `categories[0]`. */\n category?: string;\n /** Google's `types`, read only to choose a glyph and, without `category`, a word. */\n types?: string[];\n /** An `http(s)` photo. Also `photo`, `imageUrl`, `thumbnail`, `photos[0]`. */\n image?: string;\n /** 0–5 (a 10-point score is halved). */\n rating?: number;\n /** Also `user_ratings_total`, `userRatingCount`, `reviews`, `review_count`. */\n reviewCount?: number;\n /** 1–4, `\"€€\"`, or Google's `\"PRICE_LEVEL_MODERATE\"`; any other text is shown as it is (\"€10–20\"). Also `price_level`. */\n priceLevel?: number | string;\n /** Also `formatted_address`, `formattedAddress`, `vicinity`, Yelp's `location.display_address`. */\n address?: string;\n /** In metres; a text (\"12 min walk\") is shown as it is. Also `distanceMeters`. */\n distance?: number | string;\n /** Also `formatted_phone_number`, `international_phone_number`, `nationalPhoneNumber`. */\n phone?: string;\n /** The place's own site. Also `websiteUri`. */\n website?: string;\n /** The place's page (on a map, a guide); the name links to it. Also `googleMapsUri`. */\n url?: string;\n /** Also `lat`/`lng`, `latitude`/`longitude`, `geometry.location`, `location`. */\n coordinates?: { lat: number; lng: number };\n /** Google's place id, which makes Directions land on the place itself. Also `place_id`. */\n placeId?: string;\n /** The tool's own answer; `hours` wins when both are given. Also `open_now`, `isOpen`, `opening_hours.open_now`, Yelp's `hours[0].is_open_now`. */\n openNow?: boolean;\n /**\n * The week's opening hours: `[{ day, open, close }]` (several ranges a day, closing past\n * midnight), Google's `periods` or `weekday_text`, Yelp's `hours`, or\n * `{ monday: \"09:00-18:00\", sunday: \"closed\" }`. Also `currentOpeningHours` (read first:\n * it has the holidays), `regularOpeningHours`, `opening_hours`, `openingHours`.\n */\n hours?: PlaceHoursInput[] | Record<string, unknown> | string[];\n /** The place's offset from UTC in minutes, so \"Open now\" is read on the place's clock. Also `utc_offset_minutes`. */\n utcOffset?: number;\n /** At most four short facts: \"Terrace\", \"Vegan\". Also `features`, `amenities`. */\n tags?: string[];\n}\n\n/** A price level once read: the tier, and the sign the source wrote it with, if it did. */\nexport interface PlacePrice {\n level: number;\n symbol?: string;\n}\n\n/** A place as the card draws it, once read. */\nexport interface Place {\n name: string;\n category?: string;\n kind: PlaceKind;\n image?: string;\n rating?: number;\n reviewCount?: number;\n price?: PlacePrice;\n priceText?: string;\n address?: string;\n distance?: number;\n distanceText?: string;\n phone?: string;\n website?: string;\n url?: string;\n coordinates?: { lat: number; lng: number };\n placeId?: string;\n openNow?: boolean;\n hours: PlaceHoursRange[];\n utcOffset?: number;\n tags: string[];\n}\n\n/** The card's data: one place or several, and the collection's title. */\nexport interface PlaceData {\n title?: string;\n places: Place[];\n}\n\n/** Whether a place is open at a moment, and when that changes (none: it never does). */\nexport interface PlaceStatus {\n open: boolean;\n changesAt?: Date;\n}\n\n/** How an app plugs the place card in: the kit's options, and two of the card's own. */\nexport interface PlaceCardOptions extends CardSetupOptions<PlaceData, PlaceVariant> {\n /**\n * The sign a price TIER (1–4) is drawn with. A tier is a scale, not an amount — Google\n * and Yelp return a number, not a currency — so the card cannot know the place's money.\n * `$` by default, the sign those APIs' own documentation uses; a European app passes `€`.\n * A tier the source wrote with its own sign (\"€€\") keeps it. Read aloud as\n * \"Price level 2 of 4\" either way.\n */\n currencySymbol?: string;\n /** The clock \"Open now\" is read against — the device's by default; a test or a replay passes its own. */\n now?: () => Date;\n /**\n * The Directions / Call / Website buttons on each place, drawn from its data (`true` by\n * default). They are the place's own; the app's `actions` are the card's, under it, and\n * one does not replace the other. `false` draws none.\n */\n builtIns?: boolean;\n}\n\nconst P = {\n cardsPlaceTitle: { en: 'Places', fr: 'Lieux', de: 'Orte', es: 'Lugares', it: 'Luoghi', ja: '場所', ko: '장소', pt: 'Lugares', ru: 'Места', zh: '地点' },\n cardsPlaceCount: { en: '{n} places', fr: '{n} lieux', de: '{n} Orte', es: '{n} lugares', it: '{n} luoghi', ja: '{n}件の場所', ko: '장소 {n}곳', pt: '{n} lugares', ru: 'Мест: {n}', zh: '{n} 个地点' },\n cardsPlaceOpen: { en: 'Open', fr: 'Ouvert', de: 'Geöffnet', es: 'Abierto', it: 'Aperto', ja: '営業中', ko: '영업 중', pt: 'Aberto', ru: 'Открыто', zh: '营业中' },\n cardsPlaceClosed: { en: 'Closed', fr: 'Fermé', de: 'Geschlossen', es: 'Cerrado', it: 'Chiuso', ja: '営業時間外', ko: '영업 종료', pt: 'Fechado', ru: 'Закрыто', zh: '已打烊' },\n cardsPlaceClosesSoon: { en: 'Closes soon', fr: 'Ferme bientôt', de: 'Schließt bald', es: 'Cierra pronto', it: 'Chiude a breve', ja: 'まもなく営業終了', ko: '곧 영업 종료', pt: 'Fecha em breve', ru: 'Скоро закроется', zh: '即将打烊' },\n cardsPlaceClosesAt: { en: 'Closes at {t}', fr: 'Ferme à {t}', de: 'Schließt um {t}', es: 'Cierra a las {t}', it: 'Chiude alle {t}', ja: '{t}に営業終了', ko: '{t}에 영업 종료', pt: 'Fecha às {t}', ru: 'Закроется в {t}', zh: '{t}打烊' },\n cardsPlaceClosesOn: { en: 'Closes {day} at {t}', fr: 'Ferme {day} à {t}', de: 'Schließt {day} um {t}', es: 'Cierra el {day} a las {t}', it: 'Chiude {day} alle {t}', ja: '{day}の{t}に営業終了', ko: '{day} {t}에 영업 종료', pt: 'Fecha {day} às {t}', ru: 'Закроется: {day}, {t}', zh: '{day}{t}打烊' },\n cardsPlaceOpensAt: { en: 'Opens at {t}', fr: 'Ouvre à {t}', de: 'Öffnet um {t}', es: 'Abre a las {t}', it: 'Apre alle {t}', ja: '{t}に営業開始', ko: '{t}에 영업 시작', pt: 'Abre às {t}', ru: 'Откроется в {t}', zh: '{t}开始营业' },\n cardsPlaceOpensTomorrow: { en: 'Opens tomorrow at {t}', fr: 'Ouvre demain à {t}', de: 'Öffnet morgen um {t}', es: 'Abre mañana a las {t}', it: 'Apre domani alle {t}', ja: '明日{t}に営業開始', ko: '내일 {t}에 영업 시작', pt: 'Abre amanhã às {t}', ru: 'Откроется завтра в {t}', zh: '明天{t}开始营业' },\n cardsPlaceOpensOn: { en: 'Opens {day} at {t}', fr: 'Ouvre {day} à {t}', de: 'Öffnet {day} um {t}', es: 'Abre el {day} a las {t}', it: 'Apre {day} alle {t}', ja: '{day}の{t}に営業開始', ko: '{day} {t}에 영업 시작', pt: 'Abre {day} às {t}', ru: 'Откроется: {day}, {t}', zh: '{day}{t}开始营业' },\n cardsPlaceAlwaysOpen: { en: 'Open 24 hours', fr: 'Ouvert 24 h/24', de: 'Rund um die Uhr geöffnet', es: 'Abierto 24 horas', it: 'Aperto 24 ore su 24', ja: '24時間営業', ko: '24시간 영업', pt: 'Aberto 24 horas', ru: 'Круглосуточно', zh: '24小时营业' },\n cardsPlaceDirections: { en: 'Directions', fr: 'Itinéraire', de: 'Route', es: 'Cómo llegar', it: 'Indicazioni', ja: 'ルート', ko: '길찾기', pt: 'Rotas', ru: 'Маршрут', zh: '路线' },\n cardsPlaceCall: { en: 'Call', fr: 'Appeler', de: 'Anrufen', es: 'Llamar', it: 'Chiama', ja: '電話', ko: '전화', pt: 'Ligar', ru: 'Позвонить', zh: '致电' },\n cardsPlaceWebsite: { en: 'Website', fr: 'Site web', de: 'Website', es: 'Sitio web', it: 'Sito web', ja: 'ウェブサイト', ko: '웹사이트', pt: 'Site', ru: 'Сайт', zh: '网站' },\n cardsPlaceHours: { en: 'Hours', fr: 'Horaires', de: 'Öffnungszeiten', es: 'Horario', it: 'Orari', ja: '営業時間', ko: '영업시간', pt: 'Horário', ru: 'Часы работы', zh: '营业时间' },\n cardsPlacePrice: { en: 'Price level {level} of {max}', fr: 'Gamme de prix {level} sur {max}', de: 'Preisniveau {level} von {max}', es: 'Nivel de precio {level} de {max}', it: 'Fascia di prezzo {level} su {max}', ja: '価格帯 {max}段階中{level}', ko: '가격대 {max}단계 중 {level}', pt: 'Faixa de preço {level} de {max}', ru: 'Уровень цен: {level} из {max}', zh: '价格等级 {level}/{max}' },\n cardsPlacePhoto: { en: 'Photo of {name}', fr: 'Photo de {name}', de: 'Foto von {name}', es: 'Foto de {name}', it: 'Foto di {name}', ja: '{name}の写真', ko: '{name} 사진', pt: 'Foto de {name}', ru: 'Фото: {name}', zh: '{name}的照片' },\n} satisfies Record<string, CardWord>;\n\n/** A kind's name, for the badge of a place whose tool gave only Google-style `types`. */\nconst KIND_WORDS: Record<Exclude<PlaceKind, 'place'>, CardWord> = {\n restaurant: { en: 'Restaurant', fr: 'Restaurant', de: 'Restaurant', es: 'Restaurante', it: 'Ristorante', ja: 'レストラン', ko: '음식점', pt: 'Restaurante', ru: 'Ресторан', zh: '餐厅' },\n cafe: { en: 'Café', fr: 'Café', de: 'Café', es: 'Cafetería', it: 'Caffè', ja: 'カフェ', ko: '카페', pt: 'Café', ru: 'Кафе', zh: '咖啡馆' },\n bar: { en: 'Bar', fr: 'Bar', de: 'Bar', es: 'Bar', it: 'Bar', ja: 'バー', ko: '바', pt: 'Bar', ru: 'Бар', zh: '酒吧' },\n hotel: { en: 'Hotel', fr: 'Hôtel', de: 'Hotel', es: 'Hotel', it: 'Hotel', ja: 'ホテル', ko: '호텔', pt: 'Hotel', ru: 'Отель', zh: '酒店' },\n shop: { en: 'Shop', fr: 'Boutique', de: 'Geschäft', es: 'Tienda', it: 'Negozio', ja: 'ショップ', ko: '상점', pt: 'Loja', ru: 'Магазин', zh: '商店' },\n museum: { en: 'Museum', fr: 'Musée', de: 'Museum', es: 'Museo', it: 'Museo', ja: '博物館', ko: '박물관', pt: 'Museu', ru: 'Музей', zh: '博物馆' },\n park: { en: 'Park', fr: 'Parc', de: 'Park', es: 'Parque', it: 'Parco', ja: '公園', ko: '공원', pt: 'Parque', ru: 'Парк', zh: '公园' },\n gym: { en: 'Gym', fr: 'Salle de sport', de: 'Fitnessstudio', es: 'Gimnasio', it: 'Palestra', ja: 'ジム', ko: '헬스장', pt: 'Academia', ru: 'Спортзал', zh: '健身房' },\n pharmacy: { en: 'Pharmacy', fr: 'Pharmacie', de: 'Apotheke', es: 'Farmacia', it: 'Farmacia', ja: '薬局', ko: '약국', pt: 'Farmácia', ru: 'Аптека', zh: '药店' },\n};\n\n/** The most places one card draws; a search that returns forty is a list, not a card. */\nconst MAX_PLACES = 10;\nconst MAX_TAGS = 4;\nconst PRICE_MAX = 4;\n/** Within this many minutes of closing, \"Open\" turns to \"Closes soon\". */\nconst SOON = 60;\nconst DAY = 1440;\nconst WEEK = 7 * DAY;\n\n// ── Reading ──────────────────────────────────────────────────────────────────\n\nconst DAY_NAMES = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\n\nfunction readDay(value: unknown): number | undefined {\n const n = num(value);\n if (n !== undefined) return Number.isInteger(n) && n >= 0 && n <= 7 ? n % 7 : undefined;\n if (typeof value !== 'string') return undefined;\n const i = DAY_NAMES.indexOf(value.trim().slice(0, 3).toLowerCase());\n return i >= 0 ? i : undefined;\n}\n\n/** Minutes from midnight: \"09:00\", \"9:30\", \"0900\", \"21h30\", \"9 PM\", Google's `{ hour, minute }`. */\nexport function readTime(value: unknown): number | undefined {\n if (value && typeof value === 'object') {\n const o = value as Record<string, unknown>;\n const h = num(o['hour']);\n const m = num(o['minute']) ?? 0;\n return h !== undefined && h >= 0 && h <= 24 && m >= 0 && m < 60 ? h * 60 + m : undefined;\n }\n const s = str(value);\n if (!s) return undefined;\n const match = /^(\\d{1,2})(?:\\s*[:h.]\\s*)?(\\d{2})?\\s*(?:([ap])\\.?\\s*m\\.?)?$/i.exec(s);\n if (!match) return undefined;\n let h = Number(match[1]);\n const m = match[2] ? Number(match[2]) : 0;\n const half = match[3]?.toLowerCase();\n if (m > 59) return undefined;\n if (half) {\n if (h < 1 || h > 12) return undefined;\n h = (h % 12) + (half === 'p' ? 12 : 0);\n }\n if (h > 24 || (h === 24 && m > 0)) return undefined;\n return h * 60 + m;\n}\n\n/** The ranges a day's text says: \"09:00-12:00, 14:00-18:00\", \"9:00 AM – 5:00 PM\", \"Closed\", \"Open 24 hours\". */\nfunction rangesOfText(day: number, value: unknown): PlaceHoursRange[] {\n const parts = Array.isArray(value) ? value : typeof value === 'string' ? value.split(/\\s*[,;]\\s*/) : [];\n const out: PlaceHoursRange[] = [];\n for (const part of parts) {\n if (typeof part !== 'string') continue;\n const [from, to] = part.split(/\\s*[-–—]\\s*|\\s+to\\s+/i);\n // \"Open 24 hours\", \"24h/24\" — but not the end of a range: \"18h-24h\" closes at midnight.\n if (to === undefined && /24\\s*(h|hours|heures|\\/\\s*24)/i.test(part)) {\n out.push({ day, start: 0, end: DAY });\n continue;\n }\n let end = readTime(to);\n const start = sharedMeridiem(from, to, end) ?? readTime(from);\n if (start === undefined || end === undefined) continue;\n if (end <= start) end += DAY;\n out.push({ day, start, end });\n }\n return out;\n}\n\n/**\n * The start of a range that writes AM/PM once, at its end — Google's \"5:00 – 10:00 PM\" is\n * five in the evening. The end's meridiem is lent to the start only when that keeps the\n * start before the end: \"9:00 – 5:00 PM\" stays nine in the morning.\n */\nfunction sharedMeridiem(from: string | undefined, to: string | undefined, end: number | undefined): number | undefined {\n const MERIDIEM = /([ap])\\.?\\s*m\\.?\\s*$/i;\n const half = to !== undefined ? MERIDIEM.exec(to) : null;\n if (!from || !half || end === undefined || /[ap]\\.?\\s*m\\.?\\s*$/i.test(from)) return undefined;\n const start = readTime(`${from} ${half[1]}M`);\n return start !== undefined && start < end ? start : undefined;\n}\n\n/**\n * A range longer than a day — open from Friday evening to Sunday night, or around the clock\n * (Google writes that as one period with no close) — split at each midnight, so the week's\n * table shows every day it covers instead of the day it started.\n */\nfunction splitLong(range: PlaceHoursRange): PlaceHoursRange[] {\n if (range.end - range.start <= DAY) return [range];\n const out: PlaceHoursRange[] = [];\n let at = range.day * DAY + range.start;\n const stop = Math.min(range.day * DAY + range.end, range.day * DAY + range.start + WEEK);\n while (at < stop) {\n const midnight = (Math.floor(at / DAY) + 1) * DAY;\n const end = Math.min(stop, midnight);\n out.push({ day: Math.floor(at / DAY) % 7, start: at % DAY, end: end - Math.floor(at / DAY) * DAY });\n at = end;\n }\n return out;\n}\n\n/**\n * The week's opening hours from the shapes tools write them in: `[{ day, open, close }]`,\n * Google's `periods` (`{ open: { day, time | hour, minute }, close }`), its `weekday_text`\n * (\"Monday: 9:00 AM – 5:00 PM\"), or a week by name (`{ monday: \"09:00-18:00\" }`).\n * Anything it cannot read is left out.\n */\nexport function readHours(raw: unknown): PlaceHoursRange[] {\n if (!raw || typeof raw !== 'object') return [];\n if (!Array.isArray(raw)) {\n const o = raw as Record<string, unknown>;\n for (const key of ['periods', 'weekday_text', 'weekdayDescriptions']) {\n if (Array.isArray(o[key])) return readHours(o[key]);\n }\n const out: PlaceHoursRange[] = [];\n for (const [key, value] of Object.entries(o)) {\n if (!/^[a-z]+$/i.test(key)) continue;\n const day = readDay(key);\n if (day !== undefined) out.push(...rangesOfText(day, value));\n }\n return tidy(out);\n }\n const yelp = raw.filter((item): item is Loose => !!item && typeof item === 'object' && Array.isArray((item as Loose)['open']));\n if (yelp.length) return tidy(yelpRanges(yelp));\n const out: PlaceHoursRange[] = [];\n for (const item of raw) {\n if (typeof item === 'string') {\n const line = /^\\s*([A-Za-z]+)\\s*:\\s*(.+)$/.exec(item);\n const day = line ? readDay(line[1]) : undefined;\n if (line && day !== undefined) out.push(...rangesOfText(day, line[2]));\n continue;\n }\n if (!item || typeof item !== 'object') continue;\n const r = item as Record<string, unknown>;\n if (typeof r['start'] === 'number' && typeof r['end'] === 'number') {\n // Already read.\n const day = readDay(r['day']);\n if (day !== undefined && r['end'] > r['start']) out.push({ day, start: r['start'], end: r['end'] });\n continue;\n }\n if (r['open'] && typeof r['open'] === 'object') {\n // Google's period: the opening and the closing each carry their own day.\n const o = r['open'] as Record<string, unknown>;\n const day = readDay(o['day']);\n const start = readTime(o['time'] ?? o);\n if (day === undefined || start === undefined) continue;\n const c = r['close'];\n if (!c || typeof c !== 'object') {\n // Google's documented \"always open\" is one period, Sunday 00:00, with no close.\n // A missing close anywhere else is not documented: read it as midnight, as the\n // plain `{ day, open }` shape does, rather than as the whole week.\n out.push({ day, start, end: day === 0 && start === 0 ? WEEK : DAY });\n continue;\n }\n const cDay = readDay((c as Record<string, unknown>)['day']);\n const cTime = readTime((c as Record<string, unknown>)['time'] ?? c);\n if (cDay === undefined || cTime === undefined) continue;\n let end = ((cDay - day + 7) % 7) * DAY + cTime;\n if (end <= start) end += WEEK;\n out.push({ day, start, end });\n continue;\n }\n const day = readDay(r['day'] ?? r['weekday']);\n const start = readTime(r['open'] ?? r['opens'] ?? r['from']);\n if (day === undefined || start === undefined) continue;\n const close = r['close'] ?? r['closes'] ?? r['to'];\n let end = close === undefined || close === null || close === '' ? DAY : readTime(close);\n if (end === undefined) continue;\n if (end <= start) end += DAY;\n out.push({ day, start, end });\n }\n return tidy(out);\n}\n\n/**\n * Yelp Fusion's `hours`: `[{ hour_type, is_open_now, open: [{ day, start, end, is_overnight }] }]`,\n * where `day` 0 is MONDAY and the times are \"HHMM\" (\"0700\", \"2130\"). Only the regular week:\n * another `hour_type` (special hours) would mix into it.\n */\nfunction yelpRanges(entries: Loose[]): PlaceHoursRange[] {\n const regular = entries.filter((e) => !str(e['hour_type']) || /regular/i.test(String(e['hour_type'])));\n const out: PlaceHoursRange[] = [];\n for (const entry of regular.length ? regular : entries.slice(0, 1)) {\n for (const range of entry['open'] as unknown[]) {\n const r = (range ?? {}) as Loose;\n const n = num(r['day']);\n const hhmm = (v: unknown) => readTime(str(v)?.padStart(4, '0'));\n const start = hhmm(r['start']);\n let end = hhmm(r['end']);\n if (n === undefined || !Number.isInteger(n) || n < 0 || n > 6 || start === undefined || end === undefined) continue;\n // `is_overnight`: the end is on the next day, which an end before the start says too.\n if (end <= start) end += DAY;\n out.push({ day: (n + 1) % 7, start, end });\n }\n }\n return out;\n}\n\nfunction tidy(ranges: PlaceHoursRange[]): PlaceHoursRange[] {\n return ranges.flatMap(splitLong).sort((a, b) => a.day - b.day || a.start - b.start);\n}\n\n/** The week's open spans in minutes from Sunday 00:00, repeated a week either side and merged. */\nfunction spans(ranges: PlaceHoursRange[]): Array<[number, number]> {\n const list: Array<[number, number]> = [];\n for (const r of ranges) {\n for (const shift of [-WEEK, 0, WEEK]) list.push([r.day * DAY + r.start + shift, r.day * DAY + r.end + shift]);\n }\n list.sort((a, b) => a[0] - b[0]);\n const merged: Array<[number, number]> = [];\n for (const span of list) {\n const last = merged[merged.length - 1];\n // Touching spans are one: open 09:00–12:00 and 12:00–14:00 closes at 14:00.\n if (last && span[0] <= last[1]) last[1] = Math.max(last[1], span[1]);\n else merged.push([span[0], span[1]]);\n }\n return merged;\n}\n\n/**\n * Whether a place with these hours is open at `date`, and when that changes — read on\n * `date`'s own clock (pass the place's local time). `null` when the hours say nothing.\n * Hours take any shape `readHours` reads.\n */\nexport function placeStatus(hours: unknown, date: Date): PlaceStatus | null {\n const ranges = readHours(hours);\n if (!ranges.length) return null;\n const t = date.getDay() * DAY + date.getHours() * 60 + date.getMinutes();\n // A minute of the week as a time on `date`'s clock, built from its fields rather than\n // added to it: a daylight-saving change in between would move \"04:00\" to 03:00.\n const at = (minute: number) => new Date(date.getFullYear(), date.getMonth(), date.getDate() - date.getDay() + Math.floor(minute / DAY), 0, minute % DAY);\n const list = spans(ranges);\n const inside = list.find(([s, e]) => s <= t && t < e);\n if (inside) return inside[1] - inside[0] >= WEEK ? { open: true } : { open: true, changesAt: at(inside[1]) };\n const next = list.find(([s]) => s > t);\n return next ? { open: false, changesAt: at(next[0]) } : { open: false };\n}\n\n/** Whether a place with these hours is open at `date`. No hours, no answer: `false`. */\nexport function isOpenAt(hours: unknown, date: Date): boolean {\n return placeStatus(hours, date)?.open ?? false;\n}\n\n/**\n * `date` moved to the place's wall clock, when its UTC offset is known: the place's time,\n * read off the UTC fields of the shifted instant, written into a Date's local fields (which\n * is how `placeStatus` reads a clock). Adding the reader's `getTimezoneOffset()` instead is\n * an hour wrong whenever the reader's own zone changes its clocks in between.\n */\nfunction placeTime(place: Pick<Place, 'utcOffset'>, now: Date): Date {\n if (place.utcOffset === undefined) return now;\n const t = new Date(now.getTime() + place.utcOffset * 60_000);\n return new Date(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate(), t.getUTCHours(), t.getUTCMinutes(), t.getUTCSeconds(), t.getUTCMilliseconds());\n}\n\nconst KIND_RULES: Array<[Exclude<PlaceKind, 'place'>, RegExp]> = [\n ['cafe', /\\bcaf[eé]s?\\b|coffee|tea ?room|bakery|boulangerie|p[aâ]tisserie|salon de th[eé]/],\n ['bar', /\\bbars?\\b|\\bpubs?\\b|brewery|\\bwine\\b|cocktail|night ?club/],\n ['restaurant', /restaurant|\\bfood\\b|meal|pizz|sushi|burger|bistro|brasserie|diner|eatery|trattoria|ramen|steak|cr[eê]perie/],\n ['hotel', /h[oô]tel|lodging|hostel|motel|\\binn\\b|resort|guest ?house|bed and breakfast|\\bb ?& ?b\\b/],\n ['museum', /museum|mus[eé]e|galler|monument|landmark|tourist attraction|\\bart\\b/],\n ['park', /\\bparks?\\b|\\bparcs?\\b|garden|jardin|beach|plage|\\bzoo\\b|campground/],\n ['gym', /\\bgyms?\\b|fitness|stadium|swimming|piscine/],\n ['pharmacy', /pharmac|drugstore|chemist/],\n ['shop', /shop|store|boutique|market|\\bmall\\b|grocery|supermarch|magasin|[eé]picerie/],\n];\n\n/** The kind of place, from its category, then its types in order — the first one that says. */\nfunction readKind(candidates: unknown[]): PlaceKind {\n for (const candidate of candidates) {\n const text = str(candidate)?.toLowerCase().replace(/[_-]+/g, ' ');\n if (!text) continue;\n for (const [kind, rule] of KIND_RULES) if (rule.test(text)) return kind;\n }\n return 'place';\n}\n\nconst PRICE_WORDS: Record<string, number> = {\n inexpensive: 1, cheap: 1, moderate: 2, expensive: 3, very_expensive: 4, 'very expensive': 4,\n};\n\nfunction readPrice(value: unknown): { price?: PlacePrice; priceText?: string } {\n const n = num(value);\n if (n !== undefined) return n >= 1 && n <= PRICE_MAX ? { price: { level: Math.round(n) } } : {};\n const s = str(value);\n if (!s) return {};\n const repeated = /^(\\p{Sc})\\1{0,3}$/u.exec(s);\n if (repeated) return { price: { level: s.length / repeated[1]!.length, symbol: repeated[1] } };\n const named = PRICE_WORDS[s.toLowerCase().replace(/^price_level_/, '')];\n if (named) return { price: { level: named } };\n if (/^price_level_/i.test(s)) return {};\n return s.length <= 24 ? { priceText: s } : {};\n}\n\nfunction readCoordinates(r: Loose): Place['coordinates'] {\n const candidates = [r['coordinates'], r['geometry']?.['location'], r['location'], r['position'], r['latlng'], r];\n for (const c of candidates) {\n if (!c || typeof c !== 'object') continue;\n const lat = num(c['lat'] ?? c['latitude']);\n const lng = num(c['lng'] ?? c['lon'] ?? c['long'] ?? c['longitude']);\n if (lat !== undefined && lng !== undefined && Math.abs(lat) <= 90 && Math.abs(lng) <= 180) return { lat, lng };\n }\n return undefined;\n}\n\n/**\n * A link a place's data gives — absolute `http(s)` only. A bare domain (\"trattoria.fr\") is read\n * as `https://` where asked. A path (`/img/a.jpg`) is refused, as the kit's `webUrl` refuses it:\n * it comes from a tool, and a photo's address is fetched on render, with the app's cookies.\n */\nfunction webUrl(value: unknown, guessScheme = false): string | undefined {\n let s = str(value);\n if (!s) return undefined;\n if (s.startsWith('//')) {\n s = `https:${s}`;\n } else if (!/^https?:\\/\\//i.test(s)) {\n // Not a link — Google's photo names (\"places/…/photos/…\") are not addresses a browser\n // can load, and a path on this site is not the tool's to ask for.\n if (!guessScheme || !/^[\\w-]+(\\.[\\w-]+)+(\\/|$)/.test(s)) return undefined;\n s = `https://${s}`;\n }\n const url = safeUrl(s);\n return url && /^https?:/i.test(url) ? url : undefined;\n}\n\nfunction textOf(value: unknown): string | undefined {\n if (value && typeof value === 'object') {\n const o = value as Record<string, unknown>;\n return str(o['text'] ?? o['title'] ?? o['name'] ?? o['url']);\n }\n return str(value);\n}\n\n/** A link given as a string or as `{ url | src | href | uri }`. */\nfunction linkOf(value: unknown): string | undefined {\n if (value && typeof value === 'object') {\n const o = value as Record<string, unknown>;\n return str(o['url'] ?? o['src'] ?? o['href'] ?? o['uri']);\n }\n return str(value);\n}\n\nfunction firstOf(value: unknown): unknown {\n return Array.isArray(value) ? value[0] : value;\n}\n\nfunction readPlace(raw: unknown): Place | null {\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return null;\n const r = raw as Loose;\n const name = textOf(r['name'] ?? r['displayName'] ?? r['title']);\n if (!name) return null;\n const category = textOf(r['category'] ?? r['primaryTypeDisplayName'] ?? firstOf(r['categories']));\n const types = Array.isArray(r['types']) ? r['types'] : [];\n let ratingValue = num(r['rating'] ?? r['stars']);\n if (ratingValue !== undefined && ratingValue > 5 && ratingValue <= 10) ratingValue /= 2;\n if (ratingValue !== undefined && (ratingValue < 0 || ratingValue > 5)) ratingValue = undefined;\n const reviewCount = num(r['reviewCount'] ?? r['review_count'] ?? r['user_ratings_total'] ?? r['userRatingCount'] ?? r['ratingCount'] ?? r['rating_count'] ?? r['reviews']);\n const rawDistance = r['distance'] ?? r['distanceMeters'] ?? r['distance_meters'] ?? r['distance_m'];\n const distance = num(rawDistance);\n // Google's current hours first: the next seven days, holidays included, where the regular\n // week would call a closed bank holiday open. The first source with a week gives the week;\n // the first with an answer gives \"open now\" (Yelp's sits on its first `hours` entry).\n const hourSources: Loose[] = [r['hours'], r['currentOpeningHours'], r['current_opening_hours'], r['regularOpeningHours'], r['opening_hours'], r['openingHours']]\n .filter((h) => h && typeof h === 'object');\n let hours: PlaceHoursRange[] = [];\n for (const source of hourSources) {\n hours = readHours(source);\n if (hours.length) break;\n }\n const openSource = r['openNow'] ?? r['open_now'] ?? r['isOpen'] ?? r['is_open'] ?? r['is_open_now']\n ?? hourSources.map((h) => (Array.isArray(h) ? h[0] : h) as Loose | undefined)\n .map((h) => h?.['openNow'] ?? h?.['open_now'] ?? h?.['is_open_now'])\n .find((v) => typeof v === 'boolean');\n const tags = (Array.isArray(r['tags']) ? r['tags'] : Array.isArray(r['features']) ? r['features'] : Array.isArray(r['amenities']) ? r['amenities'] : [])\n .map(textOf)\n .filter((t: string | undefined): t is string => !!t && t.length <= 32)\n .slice(0, MAX_TAGS);\n const utcOffset = num(r['utcOffset'] ?? r['utc_offset_minutes'] ?? r['utcOffsetMinutes'] ?? r['utc_offset']);\n return {\n name,\n category,\n kind: readKind([category, r['primaryType'], ...types]),\n image: webUrl(linkOf(r['image'] ?? r['photo'] ?? r['imageUrl'] ?? r['image_url'] ?? r['photoUrl'] ?? r['thumbnail'] ?? r['picture'] ?? firstOf(r['photos']))),\n rating: ratingValue,\n reviewCount: reviewCount !== undefined && reviewCount >= 0 ? Math.round(reviewCount) : undefined,\n ...readPrice(r['priceLevel'] ?? r['price_level'] ?? r['price']),\n address: str(r['address'] ?? r['formatted_address'] ?? r['formattedAddress'] ?? r['shortFormattedAddress'] ?? r['vicinity'] ?? (typeof r['location'] === 'string' ? r['location'] : undefined))\n // Yelp's address is lines to stack: on one line, they are joined.\n ?? (Array.isArray(r['location']?.['display_address']) ? str(r['location']['display_address'].map(str).filter(Boolean).join(', ')) : undefined),\n distance: distance !== undefined && distance >= 0 ? distance : undefined,\n distanceText: distance === undefined && typeof rawDistance === 'string' ? str(rawDistance) : undefined,\n phone: str(r['phone'] ?? r['phoneNumber'] ?? r['phone_number'] ?? r['formatted_phone_number'] ?? r['nationalPhoneNumber'] ?? r['international_phone_number'] ?? r['internationalPhoneNumber'] ?? r['tel']),\n website: webUrl(r['website'] ?? r['websiteUri'] ?? r['websiteUrl'] ?? r['site'], true),\n url: webUrl(r['url'] ?? r['googleMapsUri'] ?? r['mapsUrl'] ?? r['maps_url'] ?? r['link']),\n coordinates: readCoordinates(r),\n placeId: str(r['placeId'] ?? r['place_id'] ?? r['googlePlaceId']),\n openNow: typeof openSource === 'boolean' ? openSource : undefined,\n hours,\n utcOffset: utcOffset !== undefined && Math.abs(utcOffset) <= 14 * 60 ? utcOffset : undefined,\n tags,\n };\n}\n\n/**\n * The card's data from what `map` returns: one place, an array of places, or a collection\n * (`{ title?, places | results | candidates }`). At most ten places; `null` when not one\n * has a name.\n */\nexport function readPlaces(raw: unknown): PlaceData | null {\n if (!raw || typeof raw !== 'object') return null;\n let title: string | undefined;\n let list: unknown[];\n if (Array.isArray(raw)) {\n list = raw;\n } else {\n const r = raw as Record<string, unknown>;\n const nested = r['places'] ?? r['results'] ?? r['candidates'];\n if (Array.isArray(nested)) {\n list = nested;\n title = str(r['title']);\n } else {\n list = [raw];\n }\n }\n const places = list.map(readPlace).filter((p): p is Place => p !== null).slice(0, MAX_PLACES);\n return places.length ? { ...(title ? { title } : {}), places } : null;\n}\n\n/**\n * Google Maps directions to the place: to its coordinates when known, else to its name and\n * address, landing on the place itself when its Google id is known. `null` without either.\n */\nexport function directionsUrl(place: Pick<Place, 'name' | 'address' | 'coordinates' | 'placeId'>): string | null {\n const destination = place.coordinates\n ? `${place.coordinates.lat},${place.coordinates.lng}`\n : place.address ? `${place.name}, ${place.address}` : null;\n if (!destination) return null;\n const id = place.placeId ? `&destination_place_id=${encodeURIComponent(place.placeId)}` : ''; // safe-attr: a URL query parameter, encodeURIComponent-ed, not markup\n return `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(destination)}${id}`; // safe-attr: a URL query parameter, encodeURIComponent-ed, not markup\n}\n\n/**\n * A `tel:` link from a written number — its digits, and the `+` before the first of them\n * (\"Tel: +33 …\" keeps it). An extension (\"ext. 12\", \"x12\", \"#3\") is not part of the number:\n * dialled as digits, it would make a different one. `null` for no number.\n */\nexport function phoneUrl(phone: string | undefined): string | null {\n if (!phone) return null;\n const number = phone.replace(/\\s*(?:\\b(?:ext(?:ension)?\\.?|x)\\s*\\d|#).*$/i, '');\n const digits = number.replace(/\\D/g, '');\n const plus = /^[^\\d]*\\+/.test(number) ? '+' : '';\n return /\\d{3,}/.test(digits) ? safeUrl(`tel:${plus}${digits}`) : null;\n}\n\n// ── Drawing ──────────────────────────────────────────────────────────────────\n\ninterface Settings {\n builtIns: boolean;\n currencySymbol: string;\n now: () => Date;\n}\n\ntype Tone = 'open' | 'soon' | 'closed';\n\n/** What the status line says, worked out once at render, so a language switch re-words it without re-reading the clock. */\ninterface StatusView {\n tone: Tone;\n state: keyof typeof P;\n next?: (config: AparteConfig) => string;\n}\n\n/**\n * A time of day as the language writes it on a shop door: \"10 PM\" where the clock has\n * twelve hours, \"22:00\" where it has twenty-four — `formatHour` would write a bare \"22\",\n * which reads as a number, not a time.\n */\nfunction clock(config: AparteConfig, date: Date): string {\n const tag = intlTag(config);\n const twelve = /h1[12]/.test(new Intl.DateTimeFormat(tag, { hour: 'numeric' }).resolvedOptions().hourCycle ?? '');\n return twelve\n ? new Intl.DateTimeFormat(tag, { hour: 'numeric', minute: date.getMinutes() ? '2-digit' : undefined }).format(date)\n : new Intl.DateTimeFormat(tag, { hour: '2-digit', minute: '2-digit' }).format(date);\n}\nconst weekday = (config: AparteConfig, date: Date) => new Intl.DateTimeFormat(intlTag(config), { weekday: 'long' }).format(date);\nconst startOfDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();\nconst daysBetween = (from: Date, to: Date) => Math.round((startOfDay(to) - startOfDay(from)) / 86_400_000);\n\nfunction statusView(place: Place, now: Date): StatusView | null {\n const local = placeTime(place, now);\n const status = place.hours.length ? placeStatus(place.hours, local) : null;\n if (!status) {\n if (place.openNow === undefined) return null;\n return { tone: place.openNow ? 'open' : 'closed', state: place.openNow ? 'cardsPlaceOpen' : 'cardsPlaceClosed' };\n }\n const at = status.changesAt;\n if (status.open) {\n if (!at) return { tone: 'open', state: 'cardsPlaceAlwaysOpen' };\n const minutes = (at.getTime() - local.getTime()) / 60_000;\n if (minutes < SOON) return { tone: 'soon', state: 'cardsPlaceClosesSoon', next: (c) => clock(c, at) };\n return {\n tone: 'open',\n state: 'cardsPlaceOpen',\n // Past midnight is still \"closes at 02:00\"; only a close more than a day away names its day.\n next: minutes <= DAY\n ? (c) => word(c, 'cardsPlaceClosesAt', P.cardsPlaceClosesAt, { t: clock(c, at) })\n : (c) => word(c, 'cardsPlaceClosesOn', P.cardsPlaceClosesOn, { day: weekday(c, at), t: clock(c, at) }),\n };\n }\n if (!at) return { tone: 'closed', state: 'cardsPlaceClosed' };\n const days = daysBetween(local, at);\n return {\n tone: 'closed',\n state: 'cardsPlaceClosed',\n next: days === 0\n ? (c) => word(c, 'cardsPlaceOpensAt', P.cardsPlaceOpensAt, { t: clock(c, at) })\n : days === 1\n ? (c) => word(c, 'cardsPlaceOpensTomorrow', P.cardsPlaceOpensTomorrow, { t: clock(c, at) })\n : (c) => word(c, 'cardsPlaceOpensOn', P.cardsPlaceOpensOn, { day: weekday(c, at), t: clock(c, at) }),\n };\n}\n\nfunction distanceText(config: AparteConfig, metres: number): string {\n if (metres < 1000) return formatUnit(config, metres < 100 ? Math.round(metres) : Math.round(metres / 10) * 10, 'meter');\n const km = metres / 1000;\n return formatUnit(config, km, 'kilometer', km < 10 ? 1 : 0);\n}\n\n/** The middle dot between two facts on a line — drawn, not read. */\nconst dot = () => el('span', { class: 'aparte-place__dot', attrs: { 'aria-hidden': 'true' }, text: '·' });\n\nfunction joined(className: string, parts: Array<Node | null>, tag: 'div' | 'p' = 'div'): HTMLElement | null {\n const present = parts.filter((p): p is Node => p !== null);\n if (!present.length) return null;\n const line = el(tag, { class: className });\n present.forEach((part, i) => {\n if (i) line.append(dot());\n line.append(part);\n });\n return line;\n}\n\nfunction nameOf(place: Place, className = 'aparte-place__name'): HTMLElement {\n const name = el('div', { class: className });\n if (place.url) {\n name.append(el('a', { class: 'aparte-place__link', attrs: { href: place.url, target: '_blank', rel: 'noopener noreferrer' }, text: place.name }));\n } else {\n name.textContent = place.name;\n }\n return name;\n}\n\n/** The category as the tool wrote it, else the kind's name in the chat's language, else nothing. */\nfunction categoryOf(ctx: CardContext, place: Place): HTMLElement | null {\n if (place.category) return el('span', { class: 'aparte-place__category', text: place.category });\n if (place.kind === 'place') return null;\n const node = el('span', { class: 'aparte-place__category' });\n ctx.word(node, `cardsPlace_${place.kind}`, KIND_WORDS[place.kind]);\n return node;\n}\n\nfunction priceOf(ctx: CardContext, place: Place, settings: Settings): HTMLElement | null {\n if (place.priceText) return el('span', { class: 'aparte-place__price', text: place.priceText });\n if (!place.price) return null;\n const { level } = place.price;\n const sign = place.price.symbol ?? settings.currencySymbol;\n // The tier in full ink, the rest of the scale faint: \"€€\" reads as two of four.\n const node = el('span', { class: 'aparte-place__price', attrs: { role: 'img' } },\n el('span', { class: 'aparte-place__price-on', attrs: { 'aria-hidden': 'true' }, text: sign.repeat(level) }),\n level < PRICE_MAX ? el('span', { class: 'aparte-place__price-off', attrs: { 'aria-hidden': 'true' }, text: sign.repeat(PRICE_MAX - level) }) : null);\n ctx.bind(node, () => word(ctx.config, 'cardsPlacePrice', P.cardsPlacePrice, {\n level: formatNumber(ctx.config, level), max: formatNumber(ctx.config, PRICE_MAX),\n }), 'aria-label');\n return node;\n}\n\nfunction scoreOf(ctx: CardContext, place: Place, settings: Settings): HTMLElement | null {\n return joined('aparte-place__score', [rating(ctx, place.rating, { count: place.reviewCount }), priceOf(ctx, place, settings)]);\n}\n\nfunction distanceOf(ctx: CardContext, place: Place): HTMLElement | null {\n if (place.distance !== undefined) {\n const node = el('span', { class: 'aparte-place__distance' });\n ctx.bind(node, () => distanceText(ctx.config, place.distance!));\n return node;\n }\n return place.distanceText ? el('span', { class: 'aparte-place__distance', text: place.distanceText }) : null;\n}\n\n/** \"● Open · Closes at 22:00\" — the state is a word, so it does not rest on its colour. */\nfunction statusOf(ctx: CardContext, place: Place, now: Date): HTMLElement | null {\n const view = statusView(place, now);\n if (!view) return null;\n const line = el('p', { class: 'aparte-place__status', attrs: { 'data-status': view.tone } });\n const state = el('span', { class: 'aparte-place__state' });\n ctx.word(state, view.state, P[view.state]);\n line.append(el('span', { class: 'aparte-place__status-dot', attrs: { 'aria-hidden': 'true' } }), state);\n if (view.next) {\n const next = el('span', { class: 'aparte-place__next' });\n ctx.bind(next, () => view.next!(ctx.config));\n line.append(dot(), next);\n }\n return line;\n}\n\nfunction addressOf(ctx: CardContext, place: Place): HTMLElement | null {\n const distance = distanceOf(ctx, place);\n const address = place.address ? el('span', { class: 'aparte-place__address-text', text: place.address }) : null;\n const line = joined('aparte-place__address', [distance, address], 'p');\n if (line) line.prepend(glyph(PIN, 'aparte-rich-card__glyph aparte-place__line-glyph'));\n return line;\n}\n\n/**\n * The photo in a fixed box, over a placeholder that stays behind it: a soft map with the\n * kind's marker for a wide box, the kind's glyph for a thumbnail. A photo that fails to load\n * is removed, and the placeholder is what shows.\n */\nfunction mediaOf(ctx: CardContext, place: Place, size: 'wide' | 'thumb'): HTMLElement {\n const box = el('div', { class: `aparte-place__media aparte-place__media--${size}` });\n const mark = glyph(kindGlyph(place.kind), 'aparte-rich-card__glyph aparte-place__marker-glyph');\n box.append(el('span', { class: 'aparte-place__placeholder', attrs: { 'aria-hidden': 'true' } },\n el('span', { class: 'aparte-place__marker' }, mark)));\n if (place.image) {\n // No referrer: the photo is on someone else's server, which need not learn the chat's address.\n const img = el('img', { class: 'aparte-place__img', attrs: { src: place.image, loading: 'lazy', decoding: 'async', referrerpolicy: 'no-referrer' } });\n ctx.bind(img, () => word(ctx.config, 'cardsPlacePhoto', P.cardsPlacePhoto, { name: place.name }), 'alt');\n img.addEventListener('error', () => {\n img.remove();\n box.setAttribute('data-empty', '');\n }, { once: true });\n box.append(img);\n } else {\n box.setAttribute('data-empty', '');\n }\n return box;\n}\n\ntype ActionKind = 'directions' | 'call' | 'website';\nconst ACTION_WORD: Record<ActionKind, 'cardsPlaceDirections' | 'cardsPlaceCall' | 'cardsPlaceWebsite'> = {\n directions: 'cardsPlaceDirections', call: 'cardsPlaceCall', website: 'cardsPlaceWebsite',\n};\nconst ACTION_GLYPH: Record<ActionKind, string> = { directions: DIRECTIONS, call: PHONE, website: GLOBE };\n\n/**\n * The buttons a place's own data can honour — none it cannot. Labelled on a card on its own;\n * round and icon-only on a tile in a row, where three words do not fit (the word is then the\n * button's name and its tooltip).\n */\nfunction actionsOf(ctx: CardContext, place: Place, settings: Settings, iconOnly: boolean): HTMLElement | null {\n if (!settings.builtIns) return null;\n const urls: Array<[ActionKind, string | null | undefined]> = [\n ['directions', directionsUrl(place)],\n ['call', phoneUrl(place.phone)],\n ['website', place.website ?? place.url],\n ];\n const buttons: HTMLButtonElement[] = [];\n for (const [kind, url] of urls) {\n if (!url) continue;\n const label = () => word(ctx.config, ACTION_WORD[kind], P[ACTION_WORD[kind]]);\n const primary = kind === 'directions' && !iconOnly;\n const button = ctx.action({ id: kind, label: label(), url, primary }, place,\n `aparte-place__action${iconOnly ? ' aparte-btn--icon aparte-btn--circle' : ''}`)!;\n // The kit writes the label as plain text; the place's buttons carry a glyph, and a\n // word that follows the language.\n button.textContent = '';\n button.setAttribute('data-action', kind);\n button.append(glyph(ACTION_GLYPH[kind], 'aparte-rich-card__glyph aparte-btn__icon'));\n if (iconOnly) {\n ctx.bind(button, label, 'aria-label');\n ctx.bind(button, label, 'title');\n } else {\n const text = el('span');\n ctx.bind(text, label);\n button.append(text);\n }\n buttons.push(button);\n }\n return buttons.length ? el('div', { class: 'aparte-place__actions' }, ...buttons) : null;\n}\n\n/** A place as a tile: photo, name, rating, open status, address, buttons. */\nfunction tileOf(ctx: CardContext, place: Place, settings: Settings, now: Date, inRow: boolean): HTMLElement {\n const media = mediaOf(ctx, place, 'wide');\n const category = categoryOf(ctx, place);\n if (category) {\n media.append(el('span', { class: 'aparte-place__badge' },\n glyph(kindGlyph(place.kind), 'aparte-rich-card__glyph aparte-place__badge-glyph'), category));\n }\n const body = el('div', { class: 'aparte-place__body' }, nameOf(place), scoreOf(ctx, place, settings), statusOf(ctx, place, now), addressOf(ctx, place));\n const actions = actionsOf(ctx, place, settings, inRow);\n if (actions) body.append(actions);\n return el('article', { class: `aparte-place${inRow ? ' aparte-place--tile' : ''}`, attrs: { 'data-kind': place.kind } }, media, body);\n}\n\n/** A place as one row: thumbnail, name and distance, rating, open status. */\nfunction rowOf(ctx: CardContext, place: Place, settings: Settings, now: Date, tag: 'div' | 'li'): HTMLElement {\n const head = el('div', { class: 'aparte-place__row-head' }, nameOf(place), distanceOf(ctx, place));\n const facts = joined('aparte-place__score', [\n rating(ctx, place.rating, { count: place.reviewCount }),\n priceOf(ctx, place, settings),\n categoryOf(ctx, place),\n ]);\n const text = el('div', { class: 'aparte-place__text' }, head, facts, statusOf(ctx, place, now));\n return el(tag, { class: 'aparte-place aparte-place__row', attrs: { 'data-kind': place.kind } }, mediaOf(ctx, place, 'thumb'), text);\n}\n\nfunction rangeText(config: AparteConfig, range: PlaceHoursRange): string {\n if (range.start === 0 && range.end >= DAY) return word(config, 'cardsPlaceAlwaysOpen', P.cardsPlaceAlwaysOpen);\n const at = (minute: number) => clock(config, new Date(2000, 0, 1, Math.floor(minute / 60) % 24, minute % 60));\n return `${at(range.start)}–${at(range.end)}`;\n}\n\n/** The week, from today, today marked: a table, so each day is read with its hours. */\nfunction hoursOf(ctx: CardContext, place: Place, now: Date): HTMLElement | null {\n if (!place.hours.length) return null;\n const local = placeTime(place, now);\n const caption = el('caption', { class: 'aparte-place__hours-title' });\n const title = el('span');\n ctx.word(title, 'cardsPlaceHours', P.cardsPlaceHours);\n caption.append(glyph(CLOCK, 'aparte-rich-card__glyph aparte-place__line-glyph'), title);\n const body = el('tbody');\n for (let i = 0; i < 7; i++) {\n const date = new Date(local.getFullYear(), local.getMonth(), local.getDate() + i, 12);\n const ranges = place.hours.filter((r) => r.day === date.getDay());\n const day = el('th', { attrs: { scope: 'row' } });\n ctx.bind(day, () => weekday(ctx.config, date));\n const hours = el('td');\n ctx.bind(hours, () => (ranges.length\n ? ranges.map((r) => rangeText(ctx.config, r)).join(', ')\n : word(ctx.config, 'cardsPlaceClosed', P.cardsPlaceClosed)));\n body.append(el('tr', { attrs: { 'aria-current': i === 0 ? 'date' : undefined, 'data-closed': !ranges.length } }, day, hours));\n }\n return el('table', { class: 'aparte-place__hours' }, caption, body);\n}\n\n/** The place's ways in, one a line: where it is, its number, its site. */\nfunction infoOf(ctx: CardContext, place: Place): HTMLElement | null {\n const items: HTMLElement[] = [];\n const address = addressOf(ctx, place);\n if (address) items.push(el('li', {}, ...address.childNodes));\n const tel = phoneUrl(place.phone);\n if (place.phone) {\n items.push(el('li', {}, glyph(PHONE, 'aparte-rich-card__glyph aparte-place__line-glyph'),\n tel ? el('a', { class: 'aparte-place__link', attrs: { href: tel }, text: place.phone }) : place.phone));\n }\n if (place.website) {\n const host = new URL(place.website).hostname.replace(/^www\\./, '');\n items.push(el('li', {}, glyph(GLOBE, 'aparte-rich-card__glyph aparte-place__line-glyph'),\n el('a', { class: 'aparte-place__link', attrs: { href: place.website, target: '_blank', rel: 'noopener noreferrer' }, text: host })));\n }\n return items.length ? el('ul', { class: 'aparte-place__info' }, ...items) : null;\n}\n\nfunction tagsOf(place: Place): HTMLElement | null {\n if (!place.tags.length) return null;\n return el('ul', { class: 'aparte-place__tags' }, ...place.tags.map((t) =>\n el('li', { class: 'aparte-tag aparte-tag--sm aparte-place__tag' }, el('span', { class: 'aparte-tag__label', text: t }))));\n}\n\nfunction renderDetail(ctx: CardContext, place: Place, settings: Settings, now: Date): Node[] {\n const media = mediaOf(ctx, place, 'wide');\n const category = categoryOf(ctx, place);\n if (category) {\n media.append(el('span', { class: 'aparte-place__badge' },\n glyph(kindGlyph(place.kind), 'aparte-rich-card__glyph aparte-place__badge-glyph'), category));\n }\n const head = el('div', { class: 'aparte-place__head' }, nameOf(place), scoreOf(ctx, place, settings), statusOf(ctx, place, now));\n const body = el('div', { class: 'aparte-place__body' }, head);\n for (const part of [actionsOf(ctx, place, settings, false), infoOf(ctx, place), hoursOf(ctx, place, now), tagsOf(place)]) {\n if (part) body.append(part);\n }\n return [el('article', { class: 'aparte-place aparte-place--detail', attrs: { 'data-kind': place.kind } }, media, body)];\n}\n\nfunction countLabel(ctx: CardContext, data: Partial<PlaceData>): string {\n return data.title ?? word(ctx.config, 'cardsPlaceCount', P.cardsPlaceCount, { n: formatNumber(ctx.config, data.places?.length ?? 0) });\n}\n\nfunction headingOf(ctx: CardContext, data: PlaceData): HTMLElement {\n const text = el('span', { class: 'aparte-place__heading-text' });\n ctx.bind(text, () => countLabel(ctx, data));\n return el('div', { class: 'aparte-place__heading' }, glyph(PIN, 'aparte-rich-card__glyph aparte-place__line-glyph'), text);\n}\n\nfunction render(data: PlaceData, ctx: CardContext<PlaceVariant>, settings: Settings): Node[] {\n const now = settings.now();\n const [first] = data.places as [Place];\n const many = data.places.length > 1;\n if (ctx.variant === 'compact') {\n if (!many) return [rowOf(ctx, first, settings, now, 'div')];\n const list = el('ul', { class: 'aparte-place__list' }, ...data.places.map((p) => rowOf(ctx, p, settings, now, 'li')));\n ctx.bind(list, () => countLabel(ctx, data), 'aria-label');\n return [headingOf(ctx, data), list];\n }\n if (many) {\n // `detail` is one place's page: several of them are tiles in a row, like `card`.\n const slides = data.places.map((p) => tileOf(ctx, p, settings, now, true));\n return [el('div', { class: 'aparte-place__collection' }, headingOf(ctx, data), carousel(ctx, slides, { label: () => countLabel(ctx, data) }))];\n }\n return ctx.variant === 'detail' ? renderDetail(ctx, first, settings, now) : [tileOf(ctx, first, settings, now, false)];\n}\n\nfunction skeleton(partial: Partial<PlaceData> | null, ctx: CardContext<PlaceVariant>): 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 known = partial?.places?.[0]?.name ?? partial?.title;\n const name = known ? el('div', { class: 'aparte-place__name', text: known }) : block('aparte-place__sk-name', 'text');\n if (ctx.variant === 'compact') {\n return [el('div', { class: 'aparte-place aparte-place__row' }, block('aparte-place__media--thumb aparte-place__sk-thumb'),\n el('div', { class: 'aparte-place__text' }, name, block('aparte-place__sk-line', 'text')))];\n }\n const body = el('div', { class: 'aparte-place__body' }, name,\n block('aparte-place__sk-line', 'text'),\n block('aparte-place__sk-line aparte-place__sk-line--short', 'text'),\n el('div', { class: 'aparte-place__sk-actions' }, block('aparte-place__sk-btn'), block('aparte-place__sk-btn')));\n if (ctx.variant === 'detail') body.append(el('div', { class: 'aparte-place__sk-hours' }, ...Array.from({ length: 4 }, () => block('aparte-place__sk-line', 'text'))));\n return [el('article', { class: 'aparte-place' }, block('aparte-place__media--wide aparte-place__sk-media'), body)];\n}\n\nfunction label(data: Partial<PlaceData> | null, ctx: CardContext): string {\n const places = data?.places ?? [];\n if (places.length === 1) return places[0]!.name;\n if (places.length > 1 || data?.title) return countLabel(ctx, data!);\n return word(ctx.config, 'cardsPlaceTitle', P.cardsPlaceTitle);\n}\n\n/** One sentence a place: \"Name — 4.6/5 (1,284), 12 rue de la Paix\". */\nfunction fallback(data: PlaceData, ctx: CardContext): string {\n const lines = data.places.map((p) => {\n const score = p.rating !== undefined\n ? `${formatNumber(ctx.config, p.rating, { maximumFractionDigits: 1 })}/5${p.reviewCount !== undefined ? ` (${formatNumber(ctx.config, p.reviewCount)})` : ''}`\n : undefined;\n const rest = [score, p.address].filter(Boolean).join(', ');\n return rest ? `${p.name} — ${rest}` : p.name;\n });\n return data.title ? `${data.title}:\\n${lines.join('\\n')}` : lines.join('\\n');\n}\n\nfunction partial(input: Record<string, unknown>): Partial<PlaceData> | null {\n const name = str(input['name'] ?? input['place'] ?? input['placeName']);\n if (name) return { places: [readPlace({ name })!] };\n const query = str(input['query'] ?? input['q'] ?? input['keyword'] ?? input['search'] ?? input['textQuery']);\n return query ? { title: query } : null;\n}\n\nfunction createPlaceCard(settings: Settings) {\n return defineCard<PlaceData, PlaceVariant>({\n name: 'place',\n variants: ['card', 'compact', 'detail'],\n styles: placeStyles,\n icon: PIN,\n normalize: readPlaces,\n render: (data, ctx) => render(data, ctx, settings),\n skeleton,\n label,\n fallback,\n partial,\n });\n}\n\n/**\n * The place card with its built-in buttons and the device's clock — for `placeCard.segment(data)`.\n * Plug it in with `setupPlaceCard`, which also hears the card's own options.\n */\nexport const placeCard = createPlaceCard({ builtIns: true, currencySymbol: '$', now: () => new Date() });\n\n/**\n * Draw a tool's places as this card — returns the function that stops it. Each place keeps\n * its Directions / Call / Website buttons beside the app's own `actions` unless `builtIns`\n * is `false`.\n */\nexport function setupPlaceCard(options: PlaceCardOptions = {}): () => void {\n const { currencySymbol, now, builtIns, ...rest } = options;\n const card = createPlaceCard({\n builtIns: builtIns !== false,\n currencySymbol: str(currencySymbol) ?? '$',\n now: now ?? (() => new Date()),\n });\n return card.setup(rest);\n}\n"],
|
|
5
|
-
"mappings": "0OAYA,IAAMA,EAAOC,GACT,oKAAoKA,CAAI,SAE/JC,EAAMF,EAAI,6GAA6G,EACvHG,GAAQH,EAAI,6HAA6H,EACzII,GAAQJ,EAAI,mJAAmJ,EAC/JK,GAAaL,EAAI,sHAAsH,EACvIM,GAAQN,EAAI,6DAA6D,EAEhFO,GAAyC,CAC3C,WAAYP,EAAI,iHAAiH,EACjI,KAAMA,EAAI,kLAAkL,EAC5L,IAAKA,EAAI,kEAAkE,EAC3E,MAAOA,EAAI,oGAAoG,EAC/G,KAAMA,EAAI,uEAAuE,EACjF,OAAQA,EAAI,iGAAiG,EAC7G,KAAMA,EAAI,uDAAuD,EACjE,IAAKA,EAAI,gEAAgE,EACzE,SAAUA,EAAI,iFAAiF,EAC/F,MAAOE,CACX,EAGO,SAASM,EAAUC,EAAyB,CAC/C,OAAOF,GAAYE,CAAI,CAC3B,CCrCA,IAAAC,GAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACtC,OAAQrN,GACR,KAAMR,EACN,UAAWsH,GACX,OAAQ,CAACqF,EAAM/C,IAAQiD,GAAOF,EAAM/C,EAAKG,CAAQ,EACjD,SAAAmD,GACA,MAAA3B,GACA,SAAAgC,GACA,QAAAJ,EAAA,CACH,CACL,CAMO,IAAMW,GAAYF,GAAgB,CAAE,SAAU,GAAM,eAAgB,IAAK,IAAK,IAAM,IAAI,IAAK,CAAG,EAOhG,SAASG,GAAeC,EAA4B,CAAA,EAAgB,CACvE,GAAM,CAAE,eAAAC,EAAgB,IAAA7I,EAAK,SAAA8I,EAAU,GAAGT,CAAA,EAASO,EAMnD,OALaJ,GAAgB,CACzB,SAAUM,IAAa,GACvB,eAAgBvM,EAAIsM,CAAc,GAAK,IACvC,IAAK7I,IAAQ,IAAM,IAAI,KAAK,CAC/B,EACW,MAAMqI,CAAI,CAC1B",
|
|
6
|
-
"names": ["svg", "body", "PIN", "PHONE", "GLOBE", "DIRECTIONS", "CLOCK", "KIND_GLYPHS", "kindGlyph", "kind", "placeStyles", "P", "KIND_WORDS", "MAX_PLACES", "MAX_TAGS", "PRICE_MAX", "SOON", "DAY", "WEEK", "DAY_NAMES", "readDay", "value", "n", "num", "i", "readTime", "h", "m", "s", "str", "match", "half", "rangesOfText", "day", "parts", "out", "part", "from", "to", "end", "start", "sharedMeridiem", "splitLong", "range", "at", "stop", "midnight", "readHours", "raw", "o", "key", "tidy", "yelp", "item", "yelpRanges", "line", "r", "c", "cDay", "cTime", "close", "entries", "regular", "e", "entry", "hhmm", "v", "ranges", "a", "b", "spans", "list", "shift", "merged", "span", "last", "placeStatus", "hours", "date", "t", "minute", "inside", "next", "isOpenAt", "placeTime", "place", "now", "KIND_RULES", "readKind", "candidates", "candidate", "text", "rule", "PRICE_WORDS", "readPrice", "repeated", "named", "readCoordinates", "lat", "lng", "webUrl", "guessScheme", "url", "safeUrl", "textOf", "linkOf", "firstOf", "readPlace", "name", "category", "types", "ratingValue", "reviewCount", "rawDistance", "distance", "hourSources", "source", "openSource", "tags", "utcOffset", "readPlaces", "title", "nested", "places", "p", "directionsUrl", "destination", "id", "phoneUrl", "phone", "number", "digits", "plus", "clock", "config", "tag", "intlTag", "weekday", "startOfDay", "d", "daysBetween", "statusView", "local", "status", "minutes", "word", "days", "distanceText", "metres", "formatUnit", "km", "dot", "el", "joined", "className", "present", "nameOf", "categoryOf", "ctx", "node", "priceOf", "settings", "level", "sign", "formatNumber", "scoreOf", "rating", "distanceOf", "statusOf", "view", "state", "addressOf", "address", "glyph", "mediaOf", "size", "box", "mark", "img", "ACTION_WORD", "ACTION_GLYPH", "actionsOf", "iconOnly", "urls", "buttons", "label", "primary", "button", "tileOf", "inRow", "media", "actions", "rowOf", "head", "facts", "rangeText", "hoursOf", "caption", "infoOf", "items", "tel", "host", "tagsOf", "renderDetail", "countLabel", "data", "headingOf", "render", "first", "many", "slides", "carousel", "skeleton", "partial", "block", "cls", "known", "fallback", "lines", "rest", "input", "query", "createPlaceCard", "defineCard", "placeCard", "setupPlaceCard", "options", "currencySymbol", "builtIns"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../node_modules/.pnpm/@aparte+plugin-cards@0.29.3_@aparte+core@0.29.3/node_modules/@aparte/plugin-cards/src/product/icons.ts", "../../../node_modules/.pnpm/@aparte+plugin-cards@0.29.3_@aparte+core@0.29.3/node_modules/@aparte/plugin-cards/src/product/product.css", "../../../node_modules/.pnpm/@aparte+plugin-cards@0.29.3_@aparte+core@0.29.3/node_modules/@aparte/plugin-cards/src/product/index.ts"],
|
|
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 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(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 if (!product.image) {\n frame.setAttribute('data-empty', '');\n return frame;\n }\n const image = el('img', {\n class: 'aparte-product__image',\n attrs: {\n src: product.image.src,\n alt: product.image.alt ?? product.title,\n loading: 'lazy',\n decoding: 'async',\n // A shop's CDN learns nothing about the chat page that showed its photo.\n referrerpolicy: 'no-referrer',\n },\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(product: Product): HTMLElement | null {\n if (!product.merchant) return null;\n const node = el('div', { class: 'aparte-product__merchant' });\n if (product.merchantLogo) {\n // Empty alt: the shop's name is written right beside it.\n const logo = el('img', { class: 'aparte-product__logo', attrs: { src: product.merchantLogo, alt: '', loading: 'lazy', decoding: 'async', referrerpolicy: 'no-referrer' } });\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(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(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(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(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(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
|
-
"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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,GACA,MAAOL,GACP,SAAU,CAACD,EAAMpC,IAAQ,CAGrB,IAAM8C,EAAQV,EAAK,SAAS,IAAKvD,GAAM,CACnC,IAAMpE,EAASoE,EAAE,QAAU,OAAY,WAAMK,EAAMc,EAAI,OAAQnB,EAAGA,EAAE,KAAK,CAAC,GAAK,GACzE9C,EAAQ8C,EAAE,SAAW,OAAY,KAAKoC,EAAajB,EAAI,OAAQnB,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
|
-
"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", "className", "frame", "el", "glyph", "titleOf", "merchantOf", "node", "logo", "discountBadge", "ctx", "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"]
|
|
7
|
-
}
|