teallemur 0.15.0 → 0.16.0
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/dist/cli.js +33 -21
- package/dist/viewer/viewer.css +206 -16
- package/dist/viewer/viewer.js +5 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1671,13 +1671,16 @@ function viewerPage(title, data, assetPrefix) {
|
|
|
1671
1671
|
function lockupHtml(markOnPhone, assets) {
|
|
1672
1672
|
return `<span class="lockup${markOnPhone ? " lockup--mark-on-phone" : ""}" title="${escapeHtml(PRODUCT_NAME)}"><img class="mark" src="${escapeHtml(`${assets}${MARK_FILE}`)}" alt=""><span class="wordmark">${escapeHtml(PRODUCT_NAME)}</span></span>`;
|
|
1673
1673
|
}
|
|
1674
|
-
function
|
|
1674
|
+
function topBarStart(name, what, assets, framed) {
|
|
1675
|
+
return `<header class="top-bar${framed ? " top-bar--in-app" : ""}">
|
|
1676
|
+
<div class="top-bar__start">${framed ? "" : lockupHtml(true, assets)}<div class="top-bar__product"><strong>${escapeHtml(name)}</strong><span>${escapeHtml(what)}</span></div></div>`;
|
|
1677
|
+
}
|
|
1678
|
+
function errorPage(name, slug, findings, commit, framed = false) {
|
|
1675
1679
|
const lines = findings.map((f) => escapeHtml(formatFinding(f))).join("\n");
|
|
1676
1680
|
const built = commit ? `<span class="top-bar__meta desktop-only">${escapeHtml(commit.date ? `${dayTime(commit.date)} \xB7 ` : "")}<span class="sha">${escapeHtml(shortSha(commit.sha))}</span></span>` : "";
|
|
1677
1681
|
return `${head(`${name} \xB7 check failed`, STATIC_CSP, "_viewer/")}
|
|
1678
1682
|
<body class="dv-body dv-page-error">
|
|
1679
|
-
|
|
1680
|
-
<div class="top-bar__start">${lockupHtml(true, "_viewer/")}<div class="top-bar__product"><strong>${escapeHtml(name)}</strong><span>Check failed</span></div></div>
|
|
1683
|
+
${topBarStart(name, "Check failed", "_viewer/", framed)}
|
|
1681
1684
|
<span class="top-bar__spacer"></span>
|
|
1682
1685
|
${built}
|
|
1683
1686
|
</header>
|
|
@@ -2388,8 +2391,7 @@ function overviewPage(input) {
|
|
|
2388
2391
|
];
|
|
2389
2392
|
return `${head(`${product.name} \xB7 design system`, VIEWER_CSP, "../_viewer/", '<link rel="stylesheet" href="fonts.css">\n')}
|
|
2390
2393
|
<body class="dv-body dv-page-overview">
|
|
2391
|
-
|
|
2392
|
-
<div class="top-bar__start">${lockupHtml(true, "../_viewer/")}<div class="top-bar__product"><strong>${e(product.name)}</strong><span>Design system</span></div></div>
|
|
2394
|
+
${topBarStart(product.name, "Design system", "../_viewer/", input.framed ?? false)}
|
|
2393
2395
|
<span class="top-bar__spacer"></span>
|
|
2394
2396
|
<a class="button dv-back" href="${attr2(boardHref)}">${iconHtml("back")}<span class="desktop-only">Back to the board</span><span class="phone-only">Board</span></a>
|
|
2395
2397
|
</header>
|
|
@@ -2487,7 +2489,7 @@ function rowHtml(file, from) {
|
|
|
2487
2489
|
return `<div class="file-row" data-path="${attr3(file.path)}"><span class="file-row__thumb" aria-hidden="true"><img src="${href}" alt="" loading="lazy" decoding="async"></span><span class="file-row__body"><span class="file-row__name" title="${attr3(name)}">${e2(name)}</span><span class="file-row__facts">${e2(factsText(file))}</span></span><a class="button button--small button--icon-on-phone" href="${href}" download="${attr3(name)}" data-download="${attr3(file.path)}" aria-label="${attr3(`Download ${name}${from}`)}">${iconHtml("download")}<span class="desktop-only">Download</span></a></div>`;
|
|
2488
2490
|
}
|
|
2489
2491
|
function filesPage(input) {
|
|
2490
|
-
const { product, commit, files, boardHref, change } = input;
|
|
2492
|
+
const { product, commit, files, boardHref, change, framed = false } = input;
|
|
2491
2493
|
const folders = byFolder(files);
|
|
2492
2494
|
const ids = folderIds(folders.map(([folder]) => folder));
|
|
2493
2495
|
const sha = commit ? shortSha(commit.sha) : "";
|
|
@@ -2505,8 +2507,7 @@ ${list.map((f) => rowHtml(f, from)).join("\n")}
|
|
|
2505
2507
|
).join("\n");
|
|
2506
2508
|
return `${head(`${product.name} \xB7 files`, STATIC_CSP, "../_viewer/")}
|
|
2507
2509
|
<body class="dv-body dv-page-files">
|
|
2508
|
-
|
|
2509
|
-
<div class="top-bar__start">${lockupHtml(true, "../_viewer/")}<div class="top-bar__product"><strong>${e2(product.name)}</strong><span>Files</span></div></div>
|
|
2510
|
+
${topBarStart(product.name, "Files", "../_viewer/", framed)}
|
|
2510
2511
|
<span class="top-bar__spacer"></span>
|
|
2511
2512
|
<a class="button dv-back" href="${attr3(boardHref)}">${iconHtml("back")}<span class="desktop-only">Back to the board</span><span class="phone-only">Board</span></a>
|
|
2512
2513
|
</header>
|
|
@@ -2970,6 +2971,7 @@ var BOARD_DIR = "board";
|
|
|
2970
2971
|
var UsageError = class extends Error {
|
|
2971
2972
|
};
|
|
2972
2973
|
function buildProduct(options2) {
|
|
2974
|
+
const framed = options2.framed === true;
|
|
2973
2975
|
const repo = resolve(options2.repo);
|
|
2974
2976
|
const base = options2.base === void 0 ? void 0 : resolve(options2.base);
|
|
2975
2977
|
const check2 = checkRepo(repo, base === void 0 ? {} : { base });
|
|
@@ -2993,7 +2995,7 @@ function buildProduct(options2) {
|
|
|
2993
2995
|
findings: check2.findings
|
|
2994
2996
|
};
|
|
2995
2997
|
copyViewer(options2.viewerAssets, join7(dir2, VIEWER_DIR));
|
|
2996
|
-
writeFileSync(join7(dir2, "index.html"), errorPage(name ?? slug, slug, check2.findings, commit));
|
|
2998
|
+
writeFileSync(join7(dir2, "index.html"), errorPage(name ?? slug, slug, check2.findings, commit, framed));
|
|
2997
2999
|
writeJson(join7(dir2, MANIFEST_FILE), manifest2);
|
|
2998
3000
|
return { findings: check2.findings, productDir: dir2, manifest: manifest2 };
|
|
2999
3001
|
}
|
|
@@ -3010,16 +3012,17 @@ function buildProduct(options2) {
|
|
|
3010
3012
|
const boardHref = base === void 0 ? "../" : `../${BOARD_DIR}/`;
|
|
3011
3013
|
const label = options2.label ?? null;
|
|
3012
3014
|
const change = base === void 0 ? void 0 : changeName(label);
|
|
3013
|
-
const overview = writeOverview(dir, read(TOKENS_CSS), design, pages, commit, boardHref);
|
|
3015
|
+
const overview = writeOverview(dir, read(TOKENS_CSS), design, pages, commit, boardHref, framed);
|
|
3014
3016
|
const assets = assetFiles(repo, files);
|
|
3015
3017
|
if (assets.length > 0) {
|
|
3016
3018
|
mkdirSync2(join7(dir, FILES_DIR), { recursive: true });
|
|
3017
|
-
writeFileSync(join7(dir, FILES_DIR, "index.html"), filesPage({ product, commit, files: assets, boardHref, change }));
|
|
3019
|
+
writeFileSync(join7(dir, FILES_DIR, "index.html"), filesPage({ product, commit, files: assets, boardHref, change, framed }));
|
|
3018
3020
|
}
|
|
3019
3021
|
const board = boardSections(design, pages, archive, archiveFiles, read, overview ?? void 0, assets, `${FILES_DIR}/`);
|
|
3020
3022
|
const frames = board.reduce((n, s) => n + s.lines.reduce((m, l) => m + l.cells.length, 0), 0);
|
|
3021
3023
|
const boardFields = { product, commit, viewports: design.viewports, flows: design.flows, board };
|
|
3022
3024
|
const own = ownSizes(pages) ? { ownSizes: true } : {};
|
|
3025
|
+
const frame = framed ? { framed: true } : {};
|
|
3023
3026
|
const manifest = {
|
|
3024
3027
|
generator: GENERATOR,
|
|
3025
3028
|
tool: PRODUCT_NAME,
|
|
@@ -3032,7 +3035,7 @@ function buildProduct(options2) {
|
|
|
3032
3035
|
cover: coverFrame(board, design.viewports)
|
|
3033
3036
|
};
|
|
3034
3037
|
if (base === void 0) {
|
|
3035
|
-
const data = { kind: "board", ...boardFields, ...own, roots: { head: "", base: `${BASE_DIR}/` } };
|
|
3038
|
+
const data = { kind: "board", ...boardFields, ...own, ...frame, roots: { head: "", base: `${BASE_DIR}/` } };
|
|
3036
3039
|
const reviews = (options2.reviews ?? []).filter((r) => r.product === design.slug);
|
|
3037
3040
|
if (reviews.length > 0) data.reviews = reviews;
|
|
3038
3041
|
writeFileSync(join7(dir, "index.html"), viewerPage(`${design.name} \xB7 design board`, data, ""));
|
|
@@ -3050,6 +3053,7 @@ function buildProduct(options2) {
|
|
|
3050
3053
|
kind: "preview",
|
|
3051
3054
|
...boardFields,
|
|
3052
3055
|
...own,
|
|
3056
|
+
...frame,
|
|
3053
3057
|
change,
|
|
3054
3058
|
roots: { head: "", base: `${BASE_DIR}/` },
|
|
3055
3059
|
preview: {
|
|
@@ -3061,7 +3065,7 @@ function buildProduct(options2) {
|
|
|
3061
3065
|
}
|
|
3062
3066
|
};
|
|
3063
3067
|
writeFileSync(join7(dir, "index.html"), viewerPage(`${label ?? design.name} \xB7 design preview`, data, ""));
|
|
3064
|
-
const boardData = { kind: "board", ...boardFields, ...own, change, roots: { head: "../", base: `../${BASE_DIR}/` } };
|
|
3068
|
+
const boardData = { kind: "board", ...boardFields, ...own, ...frame, change, roots: { head: "../", base: `../${BASE_DIR}/` } };
|
|
3065
3069
|
mkdirSync2(join7(dir, BOARD_DIR), { recursive: true });
|
|
3066
3070
|
writeFileSync(join7(dir, BOARD_DIR, "index.html"), viewerPage(`${design.name} \xB7 design board`, boardData, "../"));
|
|
3067
3071
|
manifest.base = baseCommit;
|
|
@@ -3084,7 +3088,7 @@ function productDir(out, slug, protect) {
|
|
|
3084
3088
|
mkdirSync2(dir, { recursive: true });
|
|
3085
3089
|
return dir;
|
|
3086
3090
|
}
|
|
3087
|
-
function writeOverview(dir, tokensCss, design, pages, commit, boardHref) {
|
|
3091
|
+
function writeOverview(dir, tokensCss, design, pages, commit, boardHref, framed) {
|
|
3088
3092
|
if (tokensCss === null) return null;
|
|
3089
3093
|
const overview = buildOverview(tokensCss);
|
|
3090
3094
|
if (overview.total === 0) return null;
|
|
@@ -3099,7 +3103,7 @@ function writeOverview(dir, tokensCss, design, pages, commit, boardHref) {
|
|
|
3099
3103
|
writeFileSync(join7(dir, OVERVIEW_DIR, "fonts.css"), fontFacesCss(overview.fontFaces, aliases));
|
|
3100
3104
|
writeFileSync(
|
|
3101
3105
|
join7(dir, OVERVIEW_DIR, "index.html"),
|
|
3102
|
-
overviewPage({ product: { name: design.name, slug: design.slug }, commit, overview, aliases, brand, components, boardHref })
|
|
3106
|
+
overviewPage({ product: { name: design.name, slug: design.slug }, commit, overview, aliases, brand, components, boardHref, framed })
|
|
3103
3107
|
);
|
|
3104
3108
|
return {
|
|
3105
3109
|
href: `${OVERVIEW_DIR}/`,
|
|
@@ -3324,7 +3328,7 @@ function readReviews(path) {
|
|
|
3324
3328
|
// src/cli.ts
|
|
3325
3329
|
var USAGE = `Usage:
|
|
3326
3330
|
${COMMAND} check <repo> [--base <dir>]
|
|
3327
|
-
${COMMAND} build <repo> --out <dir> [--base <dir>] [--label <text>] [--reviews <file>]
|
|
3331
|
+
${COMMAND} build <repo> --out <dir> [--base <dir>] [--label <text>] [--reviews <file>] [--framed]
|
|
3328
3332
|
${COMMAND} hub --out <dir> --title <text> [--reviews <file>]
|
|
3329
3333
|
${COMMAND} --version | --help
|
|
3330
3334
|
`;
|
|
@@ -3332,14 +3336,21 @@ function say(message) {
|
|
|
3332
3336
|
process.stderr.write(`${COMMAND}: ${message}
|
|
3333
3337
|
`);
|
|
3334
3338
|
}
|
|
3335
|
-
function parse(args2, allowed) {
|
|
3339
|
+
function parse(args2, allowed, switches = []) {
|
|
3336
3340
|
const positionals = [];
|
|
3337
3341
|
const flags = /* @__PURE__ */ new Map();
|
|
3342
|
+
const given = /* @__PURE__ */ new Set();
|
|
3338
3343
|
for (let i = 0; i < args2.length; i++) {
|
|
3339
3344
|
const arg = args2[i] ?? "";
|
|
3340
3345
|
if (arg.startsWith("--")) {
|
|
3341
3346
|
const eq = arg.indexOf("=");
|
|
3342
3347
|
const name = eq < 0 ? arg.slice(2) : arg.slice(2, eq);
|
|
3348
|
+
if (switches.includes(name)) {
|
|
3349
|
+
if (eq >= 0) throw new UsageError(`--${name} takes no value`);
|
|
3350
|
+
if (given.has(name)) throw new UsageError(`--${name} given twice`);
|
|
3351
|
+
given.add(name);
|
|
3352
|
+
continue;
|
|
3353
|
+
}
|
|
3343
3354
|
if (!allowed.includes(name)) throw new UsageError(`unknown option --${name}`);
|
|
3344
3355
|
let value;
|
|
3345
3356
|
if (eq >= 0) value = arg.slice(eq + 1);
|
|
@@ -3354,7 +3365,7 @@ function parse(args2, allowed) {
|
|
|
3354
3365
|
positionals.push(arg);
|
|
3355
3366
|
}
|
|
3356
3367
|
}
|
|
3357
|
-
return { positionals, flags };
|
|
3368
|
+
return { positionals, flags, switches: given };
|
|
3358
3369
|
}
|
|
3359
3370
|
function reviewsFrom(path) {
|
|
3360
3371
|
if (path === void 0) return void 0;
|
|
@@ -3373,7 +3384,7 @@ function run(argv) {
|
|
|
3373
3384
|
return command === void 0 ? 2 : 0;
|
|
3374
3385
|
}
|
|
3375
3386
|
if (command === "--version" || command === "-v") {
|
|
3376
|
-
process.stdout.write(`${"0.
|
|
3387
|
+
process.stdout.write(`${"0.16.0"}
|
|
3377
3388
|
`);
|
|
3378
3389
|
return 0;
|
|
3379
3390
|
}
|
|
@@ -3390,7 +3401,7 @@ function run(argv) {
|
|
|
3390
3401
|
return findings.length === 0 ? 0 : 1;
|
|
3391
3402
|
}
|
|
3392
3403
|
if (command === "build") {
|
|
3393
|
-
const { positionals, flags } = parse(rest, ["out", "base", "label", "reviews"]);
|
|
3404
|
+
const { positionals, flags, switches } = parse(rest, ["out", "base", "label", "reviews"], ["framed"]);
|
|
3394
3405
|
if (positionals.length !== 1) throw new UsageError("build needs exactly one <repo>");
|
|
3395
3406
|
const repo = requireDir(positionals[0] ?? "", "repo");
|
|
3396
3407
|
const out = flags.get("out");
|
|
@@ -3406,6 +3417,7 @@ function run(argv) {
|
|
|
3406
3417
|
...base === void 0 ? {} : { base },
|
|
3407
3418
|
...label === void 0 ? {} : { label },
|
|
3408
3419
|
...reviews === void 0 ? {} : { reviews },
|
|
3420
|
+
...switches.has("framed") ? { framed: true } : {},
|
|
3409
3421
|
viewerAssets: fileURLToPath(new URL("./viewer/", import.meta.url))
|
|
3410
3422
|
});
|
|
3411
3423
|
for (const f of result.findings) process.stdout.write(`${formatFinding(f)}
|
|
@@ -3429,7 +3441,7 @@ function run(argv) {
|
|
|
3429
3441
|
const reviews = reviewsFrom(flags.get("reviews"));
|
|
3430
3442
|
const result = buildHub(out, title, {
|
|
3431
3443
|
viewerAssets: fileURLToPath(new URL("./viewer/", import.meta.url)),
|
|
3432
|
-
version: "0.
|
|
3444
|
+
version: "0.16.0",
|
|
3433
3445
|
...reviews === void 0 ? {} : { reviews }
|
|
3434
3446
|
});
|
|
3435
3447
|
say(`wrote ${result.path} with ${result.products.length} product${result.products.length === 1 ? "" : "s"}`);
|
package/dist/viewer/viewer.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Made by design:sync from design-system/tokens.css at
|
|
1
|
+
/* Made by design:sync from design-system/tokens.css at 739d3bbda79c47f460667a75c0011af62425a6b9. Do not edit; see design-source.json. */
|
|
2
2
|
@font-face {
|
|
3
3
|
font-family: "Newsreader";
|
|
4
4
|
src: url("assets/fonts/newsreader-Newsreader.woff2") format("woff2");
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
--star-seam: var(--color-betalgo-ground);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
/* Made by design:sync from design-system/components.css at
|
|
114
|
+
/* Made by design:sync from design-system/components.css at 739d3bbda79c47f460667a75c0011af62425a6b9. Do not edit; see design-source.json. */
|
|
115
115
|
*, *::before, *::after { box-sizing: border-box; }
|
|
116
116
|
|
|
117
117
|
body {
|
|
@@ -250,6 +250,10 @@ a { color: inherit; }
|
|
|
250
250
|
.top-bar--focus .stepper { margin-left: 6px; }
|
|
251
251
|
.top-bar__close { gap: 8px; padding-left: 10px; }
|
|
252
252
|
|
|
253
|
+
.top-bar--in-app { gap: 16px; height: 52px; padding-left: 20px; }
|
|
254
|
+
.top-bar--in-app .top-bar__start { gap: 14px; }
|
|
255
|
+
.top-bar--in-app .top-bar__product:first-child { padding-left: 0; border-left: 0; }
|
|
256
|
+
|
|
253
257
|
@media (max-width: 767px) {
|
|
254
258
|
.top-bar { gap: 10px; height: 56px; padding: 0 12px 0 16px; }
|
|
255
259
|
.top-bar--centered { display: flex; }
|
|
@@ -275,6 +279,15 @@ a { color: inherit; }
|
|
|
275
279
|
.top-bar--board .top-bar__start { grid-area: start; height: 56px; }
|
|
276
280
|
.top-bar--board .top-bar__end { grid-area: end; }
|
|
277
281
|
.top-bar--board .top-bar__center { grid-area: center; }
|
|
282
|
+
|
|
283
|
+
.top-bar--in-app { height: 48px; }
|
|
284
|
+
.top-bar--in-app.top-bar--board { height: auto; padding-bottom: 10px; }
|
|
285
|
+
.top-bar--in-app.top-bar--board .top-bar__start { height: 48px; }
|
|
286
|
+
.top-bar--in-app .top-bar__end { gap: 8px; }
|
|
287
|
+
.top-bar--in-app .button,
|
|
288
|
+
.top-bar--in-app .switcher button { position: relative; }
|
|
289
|
+
.top-bar--in-app .button::after { content: ""; position: absolute; inset: -4px; }
|
|
290
|
+
.top-bar--in-app .switcher button::after { content: ""; position: absolute; inset: -5px 0; }
|
|
278
291
|
}
|
|
279
292
|
|
|
280
293
|
.bottom-bar {
|
|
@@ -555,10 +568,13 @@ a { color: inherit; }
|
|
|
555
568
|
.section-head__meta { font-size: 13px; color: var(--color-ink-soft); }
|
|
556
569
|
.section-head__aside { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--color-ink-faint); }
|
|
557
570
|
|
|
571
|
+
.section-head__action { flex: none; align-self: center; margin-left: auto; }
|
|
572
|
+
|
|
558
573
|
@media (max-width: 767px) {
|
|
559
574
|
.section-head { flex-wrap: wrap; gap: 4px 10px; margin-bottom: 16px; }
|
|
560
575
|
.section-head h2 { font-size: 26px; }
|
|
561
576
|
.section-head__aside { flex-basis: 100%; margin-left: 0; }
|
|
577
|
+
.section-head__action { flex-basis: 100%; margin: 10px 0 0; }
|
|
562
578
|
}
|
|
563
579
|
|
|
564
580
|
.frame { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; }
|
|
@@ -1740,10 +1756,6 @@ a { color: inherit; }
|
|
|
1740
1756
|
|
|
1741
1757
|
.avatar--invite { background: transparent; border: 1px dashed var(--color-rule-strong); color: var(--color-ink-faint); }
|
|
1742
1758
|
|
|
1743
|
-
.top-bar__up { color: var(--color-ink-soft); font-size: 14px; font-weight: 500; text-decoration: none; }
|
|
1744
|
-
.top-bar__up:hover,
|
|
1745
|
-
.top-bar__up.is-hover { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-rule-strong); text-underline-offset: 4px; }
|
|
1746
|
-
|
|
1747
1759
|
@media (max-width: 767px) {
|
|
1748
1760
|
.top-bar--app {
|
|
1749
1761
|
display: grid;
|
|
@@ -1776,6 +1788,54 @@ a { color: inherit; }
|
|
|
1776
1788
|
.account-button { width: 38px; height: 38px; }
|
|
1777
1789
|
}
|
|
1778
1790
|
|
|
1791
|
+
.frame-page { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: 100dvh; }
|
|
1792
|
+
|
|
1793
|
+
.top-bar--above-frame {
|
|
1794
|
+
gap: 12px;
|
|
1795
|
+
height: 48px;
|
|
1796
|
+
padding: 0 20px 0 22px;
|
|
1797
|
+
border-bottom-color: var(--color-rule-strong);
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
.top-bar--above-frame .lockup { font-size: 17px; }
|
|
1801
|
+
.top-bar--above-frame .top-bar__divider { height: 18px; }
|
|
1802
|
+
.top-bar--above-frame .top-bar__account { flex: none; margin-left: auto; }
|
|
1803
|
+
|
|
1804
|
+
.app-crumb { display: flex; align-items: center; min-width: 0; font-size: 14px; white-space: nowrap; }
|
|
1805
|
+
.app-crumb .crumb__sep { flex: none; padding: 0 2px; }
|
|
1806
|
+
|
|
1807
|
+
.app-crumb__item {
|
|
1808
|
+
display: block;
|
|
1809
|
+
flex: 0 1 auto;
|
|
1810
|
+
min-width: 4em;
|
|
1811
|
+
max-width: 320px;
|
|
1812
|
+
height: 32px;
|
|
1813
|
+
padding: 0 8px;
|
|
1814
|
+
overflow: hidden;
|
|
1815
|
+
border-radius: var(--radius-inner);
|
|
1816
|
+
color: var(--color-ink-soft);
|
|
1817
|
+
font-weight: 500;
|
|
1818
|
+
line-height: 32px;
|
|
1819
|
+
text-decoration: none;
|
|
1820
|
+
text-overflow: ellipsis;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
.app-crumb__item--workspace { flex-shrink: 3; max-width: 240px; }
|
|
1824
|
+
.app-crumb__item--pr { flex: none; min-width: 0; }
|
|
1825
|
+
a.app-crumb__item:hover,
|
|
1826
|
+
a.app-crumb__item.is-hover { background: color-mix(in srgb, var(--color-ink) 5%, transparent); color: var(--color-ink); }
|
|
1827
|
+
.app-crumb__item[aria-current="page"] { color: var(--color-ink); font-weight: 600; }
|
|
1828
|
+
|
|
1829
|
+
.app-frame { position: relative; min-height: 0; overflow: auto; overscroll-behavior: contain; contain: layout paint; background: var(--color-ground); }
|
|
1830
|
+
|
|
1831
|
+
@media (max-width: 767px) {
|
|
1832
|
+
.top-bar--above-frame { gap: 10px; height: 48px; padding: 0 12px 0 16px; }
|
|
1833
|
+
.top-bar--above-frame .lockup--mark-on-phone .mark { width: 24px; height: 24px; }
|
|
1834
|
+
.top-bar--above-frame .top-bar__account { position: static; }
|
|
1835
|
+
.app-crumb { flex: 1 1 auto; }
|
|
1836
|
+
.app-crumb__item { max-width: none; height: 44px; padding: 0 6px; line-height: 44px; }
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1779
1839
|
.menu {
|
|
1780
1840
|
position: absolute;
|
|
1781
1841
|
top: calc(100% + 6px);
|
|
@@ -1887,6 +1947,69 @@ a { color: inherit; }
|
|
|
1887
1947
|
.select--small .field__input { height: 38px; font-size: 16px; }
|
|
1888
1948
|
}
|
|
1889
1949
|
|
|
1950
|
+
.choice-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
|
|
1951
|
+
.choice-list > legend { margin-bottom: 7px; padding: 0; font-size: 13.5px; font-weight: 600; color: var(--color-ink); }
|
|
1952
|
+
|
|
1953
|
+
.choice {
|
|
1954
|
+
position: relative;
|
|
1955
|
+
display: grid;
|
|
1956
|
+
grid-template-columns: 18px minmax(0, 1fr) auto;
|
|
1957
|
+
align-items: center;
|
|
1958
|
+
gap: 12px;
|
|
1959
|
+
min-height: 54px;
|
|
1960
|
+
padding: 11px 16px;
|
|
1961
|
+
background: var(--color-surface);
|
|
1962
|
+
border: 1px solid var(--color-rule-strong);
|
|
1963
|
+
border-radius: var(--radius-control);
|
|
1964
|
+
cursor: pointer;
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
.choice__input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
|
|
1968
|
+
|
|
1969
|
+
.choice__dot {
|
|
1970
|
+
display: grid;
|
|
1971
|
+
place-items: center;
|
|
1972
|
+
width: 18px;
|
|
1973
|
+
height: 18px;
|
|
1974
|
+
background: var(--color-surface);
|
|
1975
|
+
border: 1.5px solid var(--color-rule-strong);
|
|
1976
|
+
border-radius: var(--radius-pill);
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
.choice__dot::after { content: ""; width: 8px; height: 8px; border-radius: var(--radius-pill); }
|
|
1980
|
+
.choice__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
|
|
1981
|
+
.choice__name { font-size: 14.5px; font-weight: 600; color: var(--color-ink); }
|
|
1982
|
+
.choice__hint { font-size: 13px; line-height: 1.45; color: var(--color-ink-soft); }
|
|
1983
|
+
.choice__price { font-size: 14px; font-weight: 500; color: var(--color-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
1984
|
+
|
|
1985
|
+
.choice:hover,
|
|
1986
|
+
.choice.is-hover { border-color: var(--color-ink-faint); }
|
|
1987
|
+
|
|
1988
|
+
.choice:has(.choice__input:checked),
|
|
1989
|
+
.choice.is-selected { background: var(--color-accent-tint); border-color: color-mix(in srgb, var(--color-accent) 45%, transparent); }
|
|
1990
|
+
.choice:has(.choice__input:checked) .choice__dot,
|
|
1991
|
+
.choice.is-selected .choice__dot { border-color: var(--color-accent); }
|
|
1992
|
+
.choice:has(.choice__input:checked) .choice__dot::after,
|
|
1993
|
+
.choice.is-selected .choice__dot::after { background: var(--color-accent); }
|
|
1994
|
+
.choice:has(.choice__input:checked) .choice__name,
|
|
1995
|
+
.choice.is-selected .choice__name { color: var(--color-accent-strong); }
|
|
1996
|
+
|
|
1997
|
+
.choice:has(.choice__input:focus-visible),
|
|
1998
|
+
.choice.is-focus { outline: 2px solid var(--color-accent); outline-offset: 2px; }
|
|
1999
|
+
|
|
2000
|
+
.choice:has(.choice__input:disabled),
|
|
2001
|
+
.choice.is-disabled { background: var(--color-ground); cursor: default; }
|
|
2002
|
+
.choice:has(.choice__input:disabled) .choice__name,
|
|
2003
|
+
.choice:has(.choice__input:disabled) .choice__price,
|
|
2004
|
+
.choice.is-disabled .choice__name,
|
|
2005
|
+
.choice.is-disabled .choice__price { color: var(--color-ink-faint); }
|
|
2006
|
+
|
|
2007
|
+
@media (max-width: 767px) {
|
|
2008
|
+
.choice { min-height: 60px; padding: 12px 14px; }
|
|
2009
|
+
.choice__name { font-size: 15.5px; }
|
|
2010
|
+
.choice__price { font-size: 15px; }
|
|
2011
|
+
}
|
|
2012
|
+
|
|
1890
2013
|
.dialog-scrim {
|
|
1891
2014
|
position: fixed;
|
|
1892
2015
|
inset: 0;
|
|
@@ -1900,6 +2023,8 @@ a { color: inherit; }
|
|
|
1900
2023
|
.dialog {
|
|
1901
2024
|
width: 100%;
|
|
1902
2025
|
max-width: 480px;
|
|
2026
|
+
max-height: 100%;
|
|
2027
|
+
overflow-y: auto;
|
|
1903
2028
|
padding: 28px 28px 24px;
|
|
1904
2029
|
background: var(--color-surface);
|
|
1905
2030
|
border: 1px solid var(--color-rule);
|
|
@@ -1932,7 +2057,7 @@ a { color: inherit; }
|
|
|
1932
2057
|
|
|
1933
2058
|
.member-row {
|
|
1934
2059
|
display: grid;
|
|
1935
|
-
grid-template-columns: minmax(0, 1fr) 168px 128px
|
|
2060
|
+
grid-template-columns: minmax(0, 1fr) 168px 128px 196px;
|
|
1936
2061
|
grid-template-areas: "person joined role action";
|
|
1937
2062
|
align-items: center;
|
|
1938
2063
|
gap: 16px;
|
|
@@ -1942,18 +2067,18 @@ a { color: inherit; }
|
|
|
1942
2067
|
|
|
1943
2068
|
.member-row + .member-row { border-top: 1px solid var(--color-rule); }
|
|
1944
2069
|
|
|
1945
|
-
.member-list--read .member-row { grid-template-columns: minmax(0, 1fr) 168px 128px; grid-template-areas: "person joined role"; }
|
|
1946
|
-
|
|
1947
2070
|
.member-row__person { display: flex; grid-area: person; align-items: center; gap: 12px; min-width: 0; }
|
|
1948
2071
|
.member-row__who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
|
|
1949
|
-
|
|
1950
|
-
.member-row__name
|
|
2072
|
+
|
|
2073
|
+
.member-row__name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 14px; font-weight: 600; }
|
|
2074
|
+
.member-row__name span { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
|
|
2075
|
+
.member-row__name .tag { flex: none; }
|
|
1951
2076
|
.member-row__email { overflow: hidden; font-size: 13px; color: var(--color-ink-faint); text-overflow: ellipsis; white-space: nowrap; }
|
|
1952
2077
|
.member-row__joined { grid-area: joined; font-size: 13px; color: var(--color-ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
1953
2078
|
.member-row__role { grid-area: role; font-size: 13.5px; color: var(--color-ink-soft); }
|
|
1954
2079
|
.member-row__role .select,
|
|
1955
2080
|
.member-row__role .field__input { width: 100%; }
|
|
1956
|
-
.member-row__action { display: flex; grid-area: action; justify-content: flex-end; }
|
|
2081
|
+
.member-row__action { display: flex; grid-area: action; justify-content: flex-end; gap: 4px; }
|
|
1957
2082
|
|
|
1958
2083
|
@media (max-width: 767px) {
|
|
1959
2084
|
.member-row {
|
|
@@ -1963,13 +2088,14 @@ a { color: inherit; }
|
|
|
1963
2088
|
padding: 14px 16px 16px;
|
|
1964
2089
|
}
|
|
1965
2090
|
|
|
1966
|
-
.member-list--read .member-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "person person" "joined role"; }
|
|
1967
2091
|
.member-row__joined { margin: 4px 0 0 44px; }
|
|
1968
2092
|
.member-row__role,
|
|
1969
2093
|
.member-row__action { margin-top: 12px; }
|
|
1970
2094
|
.member-row__role { margin-left: 44px; }
|
|
1971
|
-
.member-row__role .select { width:
|
|
1972
|
-
|
|
2095
|
+
.member-row__role .select { width: 128px; }
|
|
2096
|
+
|
|
2097
|
+
.member-row:has(.member-row__action > .button + .button) { grid-template-areas: "person person" "joined joined" "role role" "action action"; }
|
|
2098
|
+
.member-row:has(.member-row__action > .button + .button) .member-row__action { margin-top: 6px; }
|
|
1973
2099
|
}
|
|
1974
2100
|
|
|
1975
2101
|
.notice {
|
|
@@ -2016,13 +2142,68 @@ a { color: inherit; }
|
|
|
2016
2142
|
@media (max-width: 767px) {
|
|
2017
2143
|
.notice { flex-wrap: wrap; padding: 14px; }
|
|
2018
2144
|
.notice__text { flex-basis: calc(100% - 28px); }
|
|
2019
|
-
.notice__action { flex
|
|
2145
|
+
.notice__action { flex: 0 0 auto; margin: 6px 0 0 28px; }
|
|
2020
2146
|
.empty-wall { min-height: 0; padding: 32px 20px 28px; }
|
|
2021
2147
|
.empty-wall h2 { font-size: 28px; }
|
|
2022
2148
|
.empty-wall p { font-size: 15px; }
|
|
2023
2149
|
.empty-wall .button { width: 100%; }
|
|
2024
2150
|
}
|
|
2025
2151
|
|
|
2152
|
+
.plan { padding: 26px 28px 24px; background: var(--color-surface); border: 1px solid var(--color-rule); border-radius: var(--radius-card); }
|
|
2153
|
+
.plan__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; }
|
|
2154
|
+
|
|
2155
|
+
.plan__name {
|
|
2156
|
+
font-family: var(--font-display);
|
|
2157
|
+
font-size: 28px;
|
|
2158
|
+
font-weight: 450;
|
|
2159
|
+
line-height: 1.1;
|
|
2160
|
+
letter-spacing: -0.015em;
|
|
2161
|
+
font-optical-sizing: auto;
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2164
|
+
.plan__status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--color-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
2165
|
+
.plan__status .icon { width: 15px; height: 15px; color: var(--color-ink-soft); }
|
|
2166
|
+
.plan__text { max-width: 560px; margin-top: 8px; font-size: 14.5px; line-height: 1.55; color: var(--color-ink-soft); }
|
|
2167
|
+
.plan .choice-list { margin-top: 22px; }
|
|
2168
|
+
.plan__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--color-rule); }
|
|
2169
|
+
.plan__note { font-size: 13px; line-height: 1.5; color: var(--color-ink-faint); }
|
|
2170
|
+
|
|
2171
|
+
.plan__gift { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--color-rule); }
|
|
2172
|
+
.plan__gift-text { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; line-height: 1.45; color: var(--color-ink); }
|
|
2173
|
+
.plan__gift-text .icon { color: var(--color-ink-soft); }
|
|
2174
|
+
|
|
2175
|
+
@media (max-width: 767px) {
|
|
2176
|
+
.plan { padding: 20px 16px 18px; }
|
|
2177
|
+
.plan__name { font-size: 25px; }
|
|
2178
|
+
.plan__actions .button,
|
|
2179
|
+
.plan__gift .button { flex: 1 1 100%; }
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
.gift { padding: 22px 24px 20px; background: var(--color-surface); border: 1px solid var(--color-rule); border-radius: var(--radius-card); }
|
|
2183
|
+
.gift__from { display: flex; align-items: center; gap: 7px; font-size: 13.5px; line-height: 1.4; color: var(--color-ink-soft); }
|
|
2184
|
+
|
|
2185
|
+
.gift__title {
|
|
2186
|
+
max-width: 760px;
|
|
2187
|
+
margin-top: 6px;
|
|
2188
|
+
font-family: var(--font-display);
|
|
2189
|
+
font-size: 28px;
|
|
2190
|
+
font-weight: 450;
|
|
2191
|
+
line-height: 1.15;
|
|
2192
|
+
letter-spacing: -0.015em;
|
|
2193
|
+
font-optical-sizing: auto;
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
.gift__text { max-width: 640px; margin-top: 8px; font-size: 14.5px; line-height: 1.55; color: var(--color-ink-soft); }
|
|
2197
|
+
.gift__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px; margin-top: 20px; }
|
|
2198
|
+
.gift__note { margin-left: 8px; font-size: 13px; line-height: 1.5; color: var(--color-ink-faint); }
|
|
2199
|
+
|
|
2200
|
+
@media (max-width: 767px) {
|
|
2201
|
+
.gift { padding: 18px 16px 16px; }
|
|
2202
|
+
.gift__title { font-size: 24px; }
|
|
2203
|
+
.gift__actions .button { flex: 1 1 0; }
|
|
2204
|
+
.gift__note { flex-basis: 100%; margin-left: 0; }
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2026
2207
|
.app-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 40px; padding: 64px 0 40px; }
|
|
2027
2208
|
|
|
2028
2209
|
.app-head h1 {
|
|
@@ -2042,6 +2223,9 @@ a { color: inherit; }
|
|
|
2042
2223
|
.app-foot-note { margin-top: 20px; font-size: 13.5px; color: var(--color-ink-faint); }
|
|
2043
2224
|
.app-foot-note .sha { color: var(--color-ink-soft); }
|
|
2044
2225
|
|
|
2226
|
+
.app-column { max-width: 720px; }
|
|
2227
|
+
.app-section--end { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--color-rule); }
|
|
2228
|
+
|
|
2045
2229
|
.app-page { max-width: 560px; margin: 0 auto; padding: 104px 0 120px; }
|
|
2046
2230
|
|
|
2047
2231
|
.app-page h1 {
|
|
@@ -2059,6 +2243,10 @@ a { color: inherit; }
|
|
|
2059
2243
|
.app-page__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
|
|
2060
2244
|
.app-page__form + .app-page__actions { margin-top: 28px; }
|
|
2061
2245
|
|
|
2246
|
+
.app-page .choice-list { margin-top: 32px; }
|
|
2247
|
+
.app-page .choice-list + .app-page__actions { margin-top: 24px; }
|
|
2248
|
+
.app-page__note { align-self: center; font-size: 13px; color: var(--color-ink-faint); }
|
|
2249
|
+
|
|
2062
2250
|
.app-page__foot { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--color-rule); font-size: 13.5px; line-height: 1.6; color: var(--color-ink-faint); }
|
|
2063
2251
|
|
|
2064
2252
|
.app-page__foot a,
|
|
@@ -2075,6 +2263,8 @@ a { color: inherit; }
|
|
|
2075
2263
|
.app-head__aside { flex-basis: 100%; margin-left: 0; }
|
|
2076
2264
|
.app-head__aside .button { flex: 1 1 100%; }
|
|
2077
2265
|
.app-section { margin-top: 44px; }
|
|
2266
|
+
.app-section--end { margin-top: 48px; }
|
|
2267
|
+
.app-section--end .button { width: 100%; }
|
|
2078
2268
|
.app-page { padding: 48px 0 64px; }
|
|
2079
2269
|
.app-page h1 { font-size: 36px; }
|
|
2080
2270
|
.app-page__lede { font-size: 15.5px; }
|
package/dist/viewer/viewer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";(()=>{var Be="2026-10-25",cn={id:"linkedin-profile",name:"LinkedIn profile",checked:Be,upload:{width:1584,height:396},layout:"wide",columns:"332px minmax(0, 1fr)",safe:"620,40 1544,40 1544,356 620,356",covered:"Covered by the photo and, in your own view, the gear",desktop:{width:1180,height:560,shapes:[["nav","nav",0,0,1180,52],["nav-logo","chip",26,9,34,34],["nav-search","field",70,10,280,32],["nav-icon-1","dot",816,12,28,28],["nav-icon-2","dot",878,12,28,28],["nav-icon-3","dot",940,12,28,28],["nav-icon-4","dot",1002,12,28,28],["nav-icon-5","dot",1064,12,28,28],["nav-icon-6","dot",1126,12,28,28],["card","card",26,76,792,436],["image","image card",26,76,792,198],["photo","cover photo",54,182,152,152],["name","bar strong",54,346,230,20],["headline","bar",54,378,440,11],["headline-2","bar",54,396,320,11],["location","bar faint",54,422,190,9],["contact","bar faint",254,422,90,9],["connections","bar faint",54,440,130,9],["button-primary","pill primary",54,466,104,32],["button-secondary","pill",168,466,148,32],["button-more","pill",326,466,72,32],["work-logo","chip",560,346,28,28],["work-name","bar",598,355,160,10],["school-logo","chip",560,386,28,28],["school-name","bar",598,395,140,10],["next-card","card",26,528,792,80],["rail-card","card",842,76,312,170],["rail-title","bar strong",862,98,140,12],["rail-line-1","bar",862,124,240,9],["rail-line-2","bar",862,142,200,9],["rail-line-3","bar faint",862,196,120,9],["rail-card-2","card",842,262,312,320],["rail-title-2","bar strong",862,284,150,12],["rail-person-1","dot",862,316,44,44],["rail-person-1-name","bar",918,322,150,10],["rail-person-1-line","bar faint",918,340,110,8],["rail-person-2","dot",862,386,44,44],["rail-person-2-name","bar",918,392,150,10],["rail-person-2-line","bar faint",918,410,110,8],["rail-person-3","dot",862,456,44,44],["rail-person-3-name","bar",918,462,150,10],["rail-person-3-line","bar faint",918,480,110,8]]},phone:{width:390,height:640,shapes:[["nav","nav",0,0,390,48],["nav-me","dot",16,10,28,28],["nav-search","field",54,8,284,32],["nav-icon-1","chip",350,12,24,24],["image","image",0,48,390,97.5],["photo","cover photo",15.8,70.2,130.5,130.5],["gear","cover icon",346,58,32,32],["name","bar strong",16,214,190,20],["headline","bar",16,246,330,11],["headline-2","bar",16,264,250,11],["location","bar faint",16,290,170,9],["connections","bar faint",16,308,110,9],["button-primary","pill primary",16,334,132,34],["button-secondary","pill",156,334,132,34],["button-more","pill",296,334,34,34],["about","card flat",0,390,390,140],["about-title","bar strong",16,408,120,14],["about-line-1","bar",16,436,340,9],["about-line-2","bar",16,454,300,9],["about-line-3","bar",16,472,320,9],["about-line-4","bar",16,490,200,9],["work","card flat",0,538,390,180],["work-title","bar strong",16,556,110,14],["work-logo","chip",16,586,40,40],["work-name","bar",66,590,220,10],["work-line","bar faint",66,608,160,8],["school-logo","chip",16,642,40,40],["school-name","bar",66,646,200,10],["school-line","bar faint",66,664,140,8]]}},dn={id:"linkedin-company",name:"LinkedIn company page",checked:Be,upload:{width:1512,height:256},layout:"wide",columns:"310px minmax(0, 1fr)",safe:"430,28 1472,28 1472,128 1300,128 1300,200 430,200",covered:"Covered by the logo",desktop:{width:1180,height:520,shapes:[["nav","nav",0,0,1180,52],["nav-logo","chip",26,9,34,34],["nav-search","field",70,10,280,32],["nav-icon-1","dot",816,12,28,28],["nav-icon-2","dot",878,12,28,28],["nav-icon-3","dot",940,12,28,28],["nav-icon-4","dot",1002,12,28,28],["nav-icon-5","dot",1064,12,28,28],["nav-icon-6","dot",1126,12,28,28],["card","card",26,76,792,420],["image","image card",26,76,792,134],["logo","cover logo",53.8,127.9,152,152],["name","bar strong",54,294,260,22],["tagline","bar",54,328,470,11],["meta","bar faint",54,350,400,9],["people-1","dot",54,368,24,24],["people-2","dot",70,368,24,24],["people-3","dot",86,368,24,24],["people-line","bar faint",120,376,180,9],["button-primary","pill primary",54,408,112,32],["button-secondary","pill",176,408,124,32],["button-more","pill",310,408,80,32],["tabs-rule","rule",26,456,792,1],["tab-1","bar strong",54,471,44,10],["tab-1-on","bar strong",50,492,52,3],["tab-2","bar",126,471,50,10],["tab-3","bar",204,471,44,10],["tab-4","bar",276,471,40,10],["tab-5","bar",344,471,56,10],["next-card","card",26,512,792,80],["rail-card","card",842,76,312,190],["rail-title","bar strong",862,98,160,12],["rail-line-1","bar",862,124,250,9],["rail-line-2","bar",862,142,210,9],["rail-line-3","bar",862,160,230,9],["rail-button","pill",862,206,120,30],["rail-card-2","card",842,282,312,300],["rail-title-2","bar strong",862,304,150,12],["rail-page-1","chip",862,336,44,44],["rail-page-1-name","bar",918,342,150,10],["rail-page-1-line","bar faint",918,360,100,8],["rail-page-2","chip",862,400,44,44],["rail-page-2-name","bar",918,406,150,10],["rail-page-2-line","bar faint",918,424,100,8],["rail-page-3","chip",862,464,44,44],["rail-page-3-name","bar",918,470,150,10],["rail-page-3-line","bar faint",918,488,100,8]]},phone:{width:390,height:660,style:{"--logo-radius":"var(--outline-radius-logo-phone)"},shapes:[["nav","nav",0,0,390,48],["nav-me","dot",16,10,28,28],["nav-search","field",54,8,284,32],["nav-icon-1","chip",350,12,24,24],["image","image",0,48,390,66.03],["logo","cover logo",16.8,81,92.9,92.9],["name","bar strong",16,188,210,20],["tagline","bar",16,218,330,11],["tagline-2","bar",16,236,240,11],["meta","bar faint",16,262,280,9],["people-1","dot",16,282,22,22],["people-2","dot",30,282,22,22],["people-3","dot",44,282,22,22],["people-line","bar faint",76,289,160,9],["button-primary","pill primary",16,318,160,34],["button-secondary","pill",184,318,150,34],["button-more","pill",342,318,34,34],["tabs-rule","rule",0,368,390,1],["tab-1","bar strong",16,384,40,10],["tab-1-on","bar strong",12,404,48,3],["tab-2","bar",76,384,44,10],["tab-3","bar",140,384,40,10],["tab-4","bar",200,384,36,10],["tab-5","bar",256,384,50,10],["post","card flat",0,418,390,260],["post-avatar","chip",16,434,40,40],["post-name","bar",66,438,140,11],["post-meta","bar faint",66,456,90,8],["post-line-1","bar",16,490,340,9],["post-line-2","bar",16,506,300,9],["post-image","block",0,528,390,150]]}},pn={id:"linkedin-feed-post",name:"LinkedIn feed post",checked:Be,upload:null,ratios:{widest:[3,1],tallest:[4,5]},layout:"tall",whole:"Nothing covers a feed image. From 3:1 to 4:5 it shows whole.",desktop:{width:860,height:1e3,shapes:[["nav","nav",0,0,860,52],["nav-logo","chip",16,9,34,34],["nav-search","field",60,10,240,32],["nav-icon-1","dot",560,12,28,28],["nav-icon-2","dot",620,12,28,28],["nav-icon-3","dot",680,12,28,28],["nav-icon-4","dot",740,12,28,28],["nav-icon-5","dot",800,12,28,28],["left-card","card",-96,76,224,250],["left-avatar","dot",40,104,56,56],["left-name","bar strong",28,176,80,11],["left-line","bar faint",28,196,92,8],["left-line-2","bar faint",28,240,92,8],["left-line-3","bar faint",28,262,70,8],["post","card",152,76,555,904],["post-avatar","dot",168,90,48,48],["post-name","bar strong",226,94,150,12],["post-meta","bar faint",226,112,220,8],["post-meta-2","bar faint",226,126,90,8],["post-follow","pill",611,94,82,30],["post-line-1","bar",168,154,520,10],["post-line-2","bar",168,172,390,10],["image","image",152,196,555,694],["reaction-1","dot",168,902,16,16],["reaction-2","dot",180,902,16,16],["reaction-count","bar faint",204,906,60,8],["comment-count","bar faint",580,906,110,8],["actions-rule","rule",164,928,531,1],["action-1-icon","chip",186,944,18,18],["action-1-label","bar",212,949,52,9],["action-2-icon","chip",320,944,18,18],["action-2-label","bar",346,949,52,9],["action-3-icon","chip",454,944,18,18],["action-3-label","bar",480,949,52,9],["action-4-icon","chip",588,944,18,18],["action-4-label","bar",614,949,52,9],["right-card","card",731,76,225,300],["right-title","bar strong",751,98,100,12],["right-line-1","bar",751,130,96,9],["right-line-2","bar",751,168,96,9],["right-line-3","bar",751,206,96,9],["right-line-4","bar",751,244,96,9],["right-card-2","card",731,392,225,220],["right-block","block",747,408,113,120]]},phone:{width:390,height:800,shapes:[["nav","nav",0,0,390,48],["nav-me","dot",16,10,28,28],["nav-search","field",54,8,284,32],["nav-icon-1","chip",350,12,24,24],["post","card flat",0,56,390,704],["post-avatar","dot",12,68,44,44],["post-name","bar strong",64,72,140,12],["post-meta","bar faint",64,90,200,8],["post-meta-2","bar faint",64,104,80,8],["post-follow","pill",300,74,76,30],["post-line-1","bar",12,128,350,10],["post-line-2","bar",12,146,260,10],["image","image",0,170,390,487.5],["reaction-1","dot",12,668,14,14],["reaction-2","dot",22,668,14,14],["reaction-count","bar faint",44,671,50,8],["comment-count","bar faint",290,671,88,8],["actions-rule","rule",12,692,366,1],["action-1-icon","chip",38,704,20,20],["action-1-label","bar",26,732,44,7],["action-2-icon","chip",132,704,20,20],["action-2-label","bar",120,732,44,7],["action-3-icon","chip",226,704,20,20],["action-3-label","bar",214,732,44,7],["action-4-icon","chip",320,704,20,20],["action-4-label","bar",308,732,44,7],["next-post","card flat",0,768,390,60]]}},ct=[cn,dn,pn];var un=[...ct];function Ve(t){return un.find(e=>e.id===t)??null}function Ue(t){return{x:t[2],y:t[3],w:t[4],h:t[5]}}function We(t){return t[1]==="image"||t[1]==="image card"}var X=t=>Math.round(t*100)/100;function Se(t,e,n){let s=e.shapes.find(We);if(!s)throw new Error(`${t.id}: an outline has no image area`);let r=Ue(s),i=n.width/n.height,a=r,l=null;if(t.ratios){let w=t.ratios.widest[0]/t.ratios.widest[1],p=t.ratios.tallest[0]/t.ratios.tallest[1],v=Math.min(w,Math.max(p,i));a={...r,h:X(r.w/v)},i<p?l={axis:"y",px:Math.round((n.height-n.width/p)/2)}:i>w&&(l={axis:"x",px:Math.round((n.width-n.height*w)/2)})}let c=X(a.h-r.h),u=r.y+r.h,d=e.shapes.map(w=>c===0?w:w[3]>=u?[w[0],w[1],w[2],X(w[3]+c),w[4],w[5]]:w[3]<=r.y&&w[3]+w[5]>=u?[w[0],w[1],w[2],w[3],w[4],X(w[5]+c)]:w),h=Math.max(a.w/n.width,a.h/n.height),f=X(n.width*h),m=X(n.height*h),g={x:X(a.x+(a.w-f)/2),y:X(a.y+(a.h-m)/2),w:f,h:m};return{height:X(e.height+c),shapes:d,area:a,image:g,cut:l}}function dt(t,e){let n=(a,l)=>l===0?a:n(l,a%l),s=n(t,e),r=t/s,i=e/s;return r<=16&&i<=16?`${r}:${i}`:null}var Ke="Teal Lemur";var ne="design-viewer";var hn={search:'<circle cx="7" cy="7" r="4.25"/><path d="M10.25 10.25L13.5 13.5"/>',sidebar:'<path d="M2.75 3.25h10.5v9.5H2.75zM6.25 3.25v9.5"/>',close:'<path d="M4 4l8 8M12 4l-8 8"/>',expanded:'<path d="M4 6.5l4 4 4-4"/>',collapsed:'<path d="M6.5 4l4 4-4 4"/>',previous:'<path d="M9.5 4l-4 4 4 4"/>',next:'<path d="M6.5 4l4 4-4 4"/>',height:'<path d="M8 2.5v11M5.5 5L8 2.5 10.5 5M5.5 11L8 13.5 10.5 11"/>',external:'<path d="M9.5 2.75h3.75V6.5M13.25 2.75L7.5 8.5M11.5 9.5v3.75H2.75V4.5H6.5"/>',forward:'<path d="M3 8h9.5M8.5 4l4 4-4 4"/>',back:'<path d="M13 8H3.5M7.5 4L3.5 8l4 4"/>',clock:'<circle cx="8" cy="8" r="5.75"/><path d="M8 5v3.25l2.25 1.5"/>',commit:'<circle cx="8" cy="8" r="2.5"/><path d="M1.5 8h4M10.5 8h4"/>',arrow:'<path d="M3.5 8h9M9 4.5l3.5 3.5L9 11.5"/>',archive:'<path d="M2.5 3.5h11v3h-11zM3.5 6.5v6h9v-6M6.5 9h3"/>',check:'<path d="M3.5 8.5l3 3 6-7"/>',download:'<path d="M8 2.75v7.5M4.75 7L8 10.25 11.25 7M2.75 10.5v2.75h10.5V10.5"/>',keyLeft:'<path d="M12.5 8h-9M7 4.5L3.5 8 7 11.5"/>',keyRight:'<path d="M3.5 8h9M9 4.5l3.5 3.5L9 11.5"/>',keyUp:'<path d="M8 12.5v-9M4.5 7L8 3.5 11.5 7"/>',keyDown:'<path d="M8 3.5v9M4.5 9L8 12.5 11.5 9"/>',blank:""};function pt(t,e=""){return`<svg class="icon${e?` ${e}`:""}" viewBox="0 0 16 16" aria-hidden="true">${hn[t]}</svg>`}var ut="assets/mark.svg";function o(t,e=null,...n){let s=document.createElement(t);if(e){e.class&&(s.className=e.class),e.text!==void 0&&(s.textContent=e.text);for(let[r,i]of Object.entries(e.attrs??{}))i==null||i===!1||s.setAttribute(r,i===!0?"":String(i));for(let[r,i]of Object.entries(e.style??{}))i!==void 0&&s.style.setProperty(r,i);for(let[r,i]of Object.entries(e.on??{}))i&&s.addEventListener(r,i)}for(let r of n)r==null||r===!1||s.append(r);return s}function x(t,e=""){let n=document.createElement("span");return n.innerHTML=pt(t,e),n.firstElementChild}function fn(){let t=document.querySelector('script[src$="viewer.js"]')?.getAttribute("src")??"";return t.slice(0,t.length-9)}function ke(t){return o("span",{class:`lockup${t?" lockup--mark-on-phone":""}`,attrs:{title:Ke}},o("img",{class:"mark",attrs:{src:`${fn()}${ut}`,alt:""}}),o("span",{class:"wordmark",text:Ke}))}function oe(t){return typeof matchMedia=="function"?matchMedia(t):{matches:!1,addEventListener:()=>{}}}function se(t,e){return typeof getComputedStyle!="function"?0:parseFloat(getComputedStyle(t).getPropertyValue(e)||"0")||0}var je=!1;function Ee(){return je}typeof document<"u"&&typeof document.addEventListener=="function"&&(document.addEventListener("keydown",()=>{je=!0},!0),document.addEventListener("pointerdown",()=>{je=!1},!0));function T(t){return`${Math.round(t*100)/100}px`}async function ht(t){try{return await navigator.clipboard.writeText(t),!0}catch{let e=o("textarea",{attrs:{readonly:!0,"aria-hidden":"true"},class:"dv-offscreen"});e.value=t,document.body.append(e),e.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return e.remove(),n}}function Ge(t,e){let n;return(...s)=>{n!==void 0&&clearTimeout(n),n=setTimeout(()=>t(...s),e)}}function ft(t){let e=document.documentElement.clientWidth;window.addEventListener("resize",Ge(()=>{let n=document.documentElement.clientWidth;n!==e&&(e=n,t())},150))}function mt(t,e){let n=new Map;for(let r of t)if(r.kind!=="archive")for(let i of r.lines)for(let a of i.cells)n.set(a.viewport,(n.get(a.viewport)??0)+1);let s=null;for(let r of e)(s===null||(n.get(r.id)??0)>(n.get(s.id)??0))&&(s=r);return s}function gt(t){return t.find(e=>e.id==="desktop")??t[0]??null}function vt(t){if(t.ownSizes)return{viewports:new Set(t.viewports.map(n=>n.id)),query:""};let e=mt(t.board,t.viewports);return{viewports:new Set(e?[e.id]:t.viewports.map(n=>n.id)),query:""}}function me(t,e){let n=e.trim().toLowerCase();if(!n)return!0;let s=t.toLowerCase();return n.split(/\s+/).every(r=>s.includes(r))}function bt(t,e){return me(`${t.title}
|
|
1
|
+
"use strict";(()=>{var Be="2026-10-25",dn={id:"linkedin-profile",name:"LinkedIn profile",checked:Be,upload:{width:1584,height:396},layout:"wide",columns:"332px minmax(0, 1fr)",safe:"620,40 1544,40 1544,356 620,356",covered:"Covered by the photo and, in your own view, the gear",desktop:{width:1180,height:560,shapes:[["nav","nav",0,0,1180,52],["nav-logo","chip",26,9,34,34],["nav-search","field",70,10,280,32],["nav-icon-1","dot",816,12,28,28],["nav-icon-2","dot",878,12,28,28],["nav-icon-3","dot",940,12,28,28],["nav-icon-4","dot",1002,12,28,28],["nav-icon-5","dot",1064,12,28,28],["nav-icon-6","dot",1126,12,28,28],["card","card",26,76,792,436],["image","image card",26,76,792,198],["photo","cover photo",54,182,152,152],["name","bar strong",54,346,230,20],["headline","bar",54,378,440,11],["headline-2","bar",54,396,320,11],["location","bar faint",54,422,190,9],["contact","bar faint",254,422,90,9],["connections","bar faint",54,440,130,9],["button-primary","pill primary",54,466,104,32],["button-secondary","pill",168,466,148,32],["button-more","pill",326,466,72,32],["work-logo","chip",560,346,28,28],["work-name","bar",598,355,160,10],["school-logo","chip",560,386,28,28],["school-name","bar",598,395,140,10],["next-card","card",26,528,792,80],["rail-card","card",842,76,312,170],["rail-title","bar strong",862,98,140,12],["rail-line-1","bar",862,124,240,9],["rail-line-2","bar",862,142,200,9],["rail-line-3","bar faint",862,196,120,9],["rail-card-2","card",842,262,312,320],["rail-title-2","bar strong",862,284,150,12],["rail-person-1","dot",862,316,44,44],["rail-person-1-name","bar",918,322,150,10],["rail-person-1-line","bar faint",918,340,110,8],["rail-person-2","dot",862,386,44,44],["rail-person-2-name","bar",918,392,150,10],["rail-person-2-line","bar faint",918,410,110,8],["rail-person-3","dot",862,456,44,44],["rail-person-3-name","bar",918,462,150,10],["rail-person-3-line","bar faint",918,480,110,8]]},phone:{width:390,height:640,shapes:[["nav","nav",0,0,390,48],["nav-me","dot",16,10,28,28],["nav-search","field",54,8,284,32],["nav-icon-1","chip",350,12,24,24],["image","image",0,48,390,97.5],["photo","cover photo",15.8,70.2,130.5,130.5],["gear","cover icon",346,58,32,32],["name","bar strong",16,214,190,20],["headline","bar",16,246,330,11],["headline-2","bar",16,264,250,11],["location","bar faint",16,290,170,9],["connections","bar faint",16,308,110,9],["button-primary","pill primary",16,334,132,34],["button-secondary","pill",156,334,132,34],["button-more","pill",296,334,34,34],["about","card flat",0,390,390,140],["about-title","bar strong",16,408,120,14],["about-line-1","bar",16,436,340,9],["about-line-2","bar",16,454,300,9],["about-line-3","bar",16,472,320,9],["about-line-4","bar",16,490,200,9],["work","card flat",0,538,390,180],["work-title","bar strong",16,556,110,14],["work-logo","chip",16,586,40,40],["work-name","bar",66,590,220,10],["work-line","bar faint",66,608,160,8],["school-logo","chip",16,642,40,40],["school-name","bar",66,646,200,10],["school-line","bar faint",66,664,140,8]]}},pn={id:"linkedin-company",name:"LinkedIn company page",checked:Be,upload:{width:1512,height:256},layout:"wide",columns:"310px minmax(0, 1fr)",safe:"430,28 1472,28 1472,128 1300,128 1300,200 430,200",covered:"Covered by the logo",desktop:{width:1180,height:520,shapes:[["nav","nav",0,0,1180,52],["nav-logo","chip",26,9,34,34],["nav-search","field",70,10,280,32],["nav-icon-1","dot",816,12,28,28],["nav-icon-2","dot",878,12,28,28],["nav-icon-3","dot",940,12,28,28],["nav-icon-4","dot",1002,12,28,28],["nav-icon-5","dot",1064,12,28,28],["nav-icon-6","dot",1126,12,28,28],["card","card",26,76,792,420],["image","image card",26,76,792,134],["logo","cover logo",53.8,127.9,152,152],["name","bar strong",54,294,260,22],["tagline","bar",54,328,470,11],["meta","bar faint",54,350,400,9],["people-1","dot",54,368,24,24],["people-2","dot",70,368,24,24],["people-3","dot",86,368,24,24],["people-line","bar faint",120,376,180,9],["button-primary","pill primary",54,408,112,32],["button-secondary","pill",176,408,124,32],["button-more","pill",310,408,80,32],["tabs-rule","rule",26,456,792,1],["tab-1","bar strong",54,471,44,10],["tab-1-on","bar strong",50,492,52,3],["tab-2","bar",126,471,50,10],["tab-3","bar",204,471,44,10],["tab-4","bar",276,471,40,10],["tab-5","bar",344,471,56,10],["next-card","card",26,512,792,80],["rail-card","card",842,76,312,190],["rail-title","bar strong",862,98,160,12],["rail-line-1","bar",862,124,250,9],["rail-line-2","bar",862,142,210,9],["rail-line-3","bar",862,160,230,9],["rail-button","pill",862,206,120,30],["rail-card-2","card",842,282,312,300],["rail-title-2","bar strong",862,304,150,12],["rail-page-1","chip",862,336,44,44],["rail-page-1-name","bar",918,342,150,10],["rail-page-1-line","bar faint",918,360,100,8],["rail-page-2","chip",862,400,44,44],["rail-page-2-name","bar",918,406,150,10],["rail-page-2-line","bar faint",918,424,100,8],["rail-page-3","chip",862,464,44,44],["rail-page-3-name","bar",918,470,150,10],["rail-page-3-line","bar faint",918,488,100,8]]},phone:{width:390,height:660,style:{"--logo-radius":"var(--outline-radius-logo-phone)"},shapes:[["nav","nav",0,0,390,48],["nav-me","dot",16,10,28,28],["nav-search","field",54,8,284,32],["nav-icon-1","chip",350,12,24,24],["image","image",0,48,390,66.03],["logo","cover logo",16.8,81,92.9,92.9],["name","bar strong",16,188,210,20],["tagline","bar",16,218,330,11],["tagline-2","bar",16,236,240,11],["meta","bar faint",16,262,280,9],["people-1","dot",16,282,22,22],["people-2","dot",30,282,22,22],["people-3","dot",44,282,22,22],["people-line","bar faint",76,289,160,9],["button-primary","pill primary",16,318,160,34],["button-secondary","pill",184,318,150,34],["button-more","pill",342,318,34,34],["tabs-rule","rule",0,368,390,1],["tab-1","bar strong",16,384,40,10],["tab-1-on","bar strong",12,404,48,3],["tab-2","bar",76,384,44,10],["tab-3","bar",140,384,40,10],["tab-4","bar",200,384,36,10],["tab-5","bar",256,384,50,10],["post","card flat",0,418,390,260],["post-avatar","chip",16,434,40,40],["post-name","bar",66,438,140,11],["post-meta","bar faint",66,456,90,8],["post-line-1","bar",16,490,340,9],["post-line-2","bar",16,506,300,9],["post-image","block",0,528,390,150]]}},un={id:"linkedin-feed-post",name:"LinkedIn feed post",checked:Be,upload:null,ratios:{widest:[3,1],tallest:[4,5]},layout:"tall",whole:"Nothing covers a feed image. From 3:1 to 4:5 it shows whole.",desktop:{width:860,height:1e3,shapes:[["nav","nav",0,0,860,52],["nav-logo","chip",16,9,34,34],["nav-search","field",60,10,240,32],["nav-icon-1","dot",560,12,28,28],["nav-icon-2","dot",620,12,28,28],["nav-icon-3","dot",680,12,28,28],["nav-icon-4","dot",740,12,28,28],["nav-icon-5","dot",800,12,28,28],["left-card","card",-96,76,224,250],["left-avatar","dot",40,104,56,56],["left-name","bar strong",28,176,80,11],["left-line","bar faint",28,196,92,8],["left-line-2","bar faint",28,240,92,8],["left-line-3","bar faint",28,262,70,8],["post","card",152,76,555,904],["post-avatar","dot",168,90,48,48],["post-name","bar strong",226,94,150,12],["post-meta","bar faint",226,112,220,8],["post-meta-2","bar faint",226,126,90,8],["post-follow","pill",611,94,82,30],["post-line-1","bar",168,154,520,10],["post-line-2","bar",168,172,390,10],["image","image",152,196,555,694],["reaction-1","dot",168,902,16,16],["reaction-2","dot",180,902,16,16],["reaction-count","bar faint",204,906,60,8],["comment-count","bar faint",580,906,110,8],["actions-rule","rule",164,928,531,1],["action-1-icon","chip",186,944,18,18],["action-1-label","bar",212,949,52,9],["action-2-icon","chip",320,944,18,18],["action-2-label","bar",346,949,52,9],["action-3-icon","chip",454,944,18,18],["action-3-label","bar",480,949,52,9],["action-4-icon","chip",588,944,18,18],["action-4-label","bar",614,949,52,9],["right-card","card",731,76,225,300],["right-title","bar strong",751,98,100,12],["right-line-1","bar",751,130,96,9],["right-line-2","bar",751,168,96,9],["right-line-3","bar",751,206,96,9],["right-line-4","bar",751,244,96,9],["right-card-2","card",731,392,225,220],["right-block","block",747,408,113,120]]},phone:{width:390,height:800,shapes:[["nav","nav",0,0,390,48],["nav-me","dot",16,10,28,28],["nav-search","field",54,8,284,32],["nav-icon-1","chip",350,12,24,24],["post","card flat",0,56,390,704],["post-avatar","dot",12,68,44,44],["post-name","bar strong",64,72,140,12],["post-meta","bar faint",64,90,200,8],["post-meta-2","bar faint",64,104,80,8],["post-follow","pill",300,74,76,30],["post-line-1","bar",12,128,350,10],["post-line-2","bar",12,146,260,10],["image","image",0,170,390,487.5],["reaction-1","dot",12,668,14,14],["reaction-2","dot",22,668,14,14],["reaction-count","bar faint",44,671,50,8],["comment-count","bar faint",290,671,88,8],["actions-rule","rule",12,692,366,1],["action-1-icon","chip",38,704,20,20],["action-1-label","bar",26,732,44,7],["action-2-icon","chip",132,704,20,20],["action-2-label","bar",120,732,44,7],["action-3-icon","chip",226,704,20,20],["action-3-label","bar",214,732,44,7],["action-4-icon","chip",320,704,20,20],["action-4-label","bar",308,732,44,7],["next-post","card flat",0,768,390,60]]}},dt=[dn,pn,un];var hn=[...dt];function Ve(t){return hn.find(e=>e.id===t)??null}function Ue(t){return{x:t[2],y:t[3],w:t[4],h:t[5]}}function We(t){return t[1]==="image"||t[1]==="image card"}var X=t=>Math.round(t*100)/100;function Se(t,e,n){let s=e.shapes.find(We);if(!s)throw new Error(`${t.id}: an outline has no image area`);let r=Ue(s),i=n.width/n.height,a=r,l=null;if(t.ratios){let v=t.ratios.widest[0]/t.ratios.widest[1],f=t.ratios.tallest[0]/t.ratios.tallest[1],y=Math.min(v,Math.max(f,i));a={...r,h:X(r.w/y)},i<f?l={axis:"y",px:Math.round((n.height-n.width/f)/2)}:i>v&&(l={axis:"x",px:Math.round((n.width-n.height*v)/2)})}let c=X(a.h-r.h),p=r.y+r.h,d=e.shapes.map(v=>c===0?v:v[3]>=p?[v[0],v[1],v[2],X(v[3]+c),v[4],v[5]]:v[3]<=r.y&&v[3]+v[5]>=p?[v[0],v[1],v[2],v[3],v[4],X(v[5]+c)]:v),u=Math.max(a.w/n.width,a.h/n.height),h=X(n.width*u),m=X(n.height*u),g={x:X(a.x+(a.w-h)/2),y:X(a.y+(a.h-m)/2),w:h,h:m};return{height:X(e.height+c),shapes:d,area:a,image:g,cut:l}}function pt(t,e){let n=(a,l)=>l===0?a:n(l,a%l),s=n(t,e),r=t/s,i=e/s;return r<=16&&i<=16?`${r}:${i}`:null}var Ke="Teal Lemur";var oe="design-viewer";var fn={search:'<circle cx="7" cy="7" r="4.25"/><path d="M10.25 10.25L13.5 13.5"/>',sidebar:'<path d="M2.75 3.25h10.5v9.5H2.75zM6.25 3.25v9.5"/>',close:'<path d="M4 4l8 8M12 4l-8 8"/>',expanded:'<path d="M4 6.5l4 4 4-4"/>',collapsed:'<path d="M6.5 4l4 4-4 4"/>',previous:'<path d="M9.5 4l-4 4 4 4"/>',next:'<path d="M6.5 4l4 4-4 4"/>',height:'<path d="M8 2.5v11M5.5 5L8 2.5 10.5 5M5.5 11L8 13.5 10.5 11"/>',external:'<path d="M9.5 2.75h3.75V6.5M13.25 2.75L7.5 8.5M11.5 9.5v3.75H2.75V4.5H6.5"/>',forward:'<path d="M3 8h9.5M8.5 4l4 4-4 4"/>',back:'<path d="M13 8H3.5M7.5 4L3.5 8l4 4"/>',clock:'<circle cx="8" cy="8" r="5.75"/><path d="M8 5v3.25l2.25 1.5"/>',commit:'<circle cx="8" cy="8" r="2.5"/><path d="M1.5 8h4M10.5 8h4"/>',arrow:'<path d="M3.5 8h9M9 4.5l3.5 3.5L9 11.5"/>',archive:'<path d="M2.5 3.5h11v3h-11zM3.5 6.5v6h9v-6M6.5 9h3"/>',check:'<path d="M3.5 8.5l3 3 6-7"/>',download:'<path d="M8 2.75v7.5M4.75 7L8 10.25 11.25 7M2.75 10.5v2.75h10.5V10.5"/>',keyLeft:'<path d="M12.5 8h-9M7 4.5L3.5 8 7 11.5"/>',keyRight:'<path d="M3.5 8h9M9 4.5l3.5 3.5L9 11.5"/>',keyUp:'<path d="M8 12.5v-9M4.5 7L8 3.5 11.5 7"/>',keyDown:'<path d="M8 3.5v9M4.5 9L8 12.5 11.5 9"/>',blank:""};function ut(t,e=""){return`<svg class="icon${e?` ${e}`:""}" viewBox="0 0 16 16" aria-hidden="true">${fn[t]}</svg>`}var ht="assets/mark.svg";function o(t,e=null,...n){let s=document.createElement(t);if(e){e.class&&(s.className=e.class),e.text!==void 0&&(s.textContent=e.text);for(let[r,i]of Object.entries(e.attrs??{}))i==null||i===!1||s.setAttribute(r,i===!0?"":String(i));for(let[r,i]of Object.entries(e.style??{}))i!==void 0&&s.style.setProperty(r,i);for(let[r,i]of Object.entries(e.on??{}))i&&s.addEventListener(r,i)}for(let r of n)r==null||r===!1||s.append(r);return s}function x(t,e=""){let n=document.createElement("span");return n.innerHTML=ut(t,e),n.firstElementChild}function mn(){let t=document.querySelector('script[src$="viewer.js"]')?.getAttribute("src")??"";return t.slice(0,t.length-9)}function ke(t){return o("span",{class:`lockup${t?" lockup--mark-on-phone":""}`,attrs:{title:Ke}},o("img",{class:"mark",attrs:{src:`${mn()}${ht}`,alt:""}}),o("span",{class:"wordmark",text:Ke}))}function Q(t){return typeof matchMedia=="function"?matchMedia(t):{matches:!1,addEventListener:()=>{}}}function se(t,e){return typeof getComputedStyle!="function"?0:parseFloat(getComputedStyle(t).getPropertyValue(e)||"0")||0}var je=!1;function Ee(){return je}typeof document<"u"&&typeof document.addEventListener=="function"&&(document.addEventListener("keydown",()=>{je=!0},!0),document.addEventListener("pointerdown",()=>{je=!1},!0));function z(t){return`${Math.round(t*100)/100}px`}async function ft(t){try{return await navigator.clipboard.writeText(t),!0}catch{let e=o("textarea",{attrs:{readonly:!0,"aria-hidden":"true"},class:"dv-offscreen"});e.value=t,document.body.append(e),e.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return e.remove(),n}}function Ge(t,e){let n;return(...s)=>{n!==void 0&&clearTimeout(n),n=setTimeout(()=>t(...s),e)}}function mt(t){let e=document.documentElement.clientWidth;window.addEventListener("resize",Ge(()=>{let n=document.documentElement.clientWidth;n!==e&&(e=n,t())},150))}function gt(t,e){let n=new Map;for(let r of t)if(r.kind!=="archive")for(let i of r.lines)for(let a of i.cells)n.set(a.viewport,(n.get(a.viewport)??0)+1);let s=null;for(let r of e)(s===null||(n.get(r.id)??0)>(n.get(s.id)??0))&&(s=r);return s}function vt(t){return t.find(e=>e.id==="desktop")??t[0]??null}function bt(t){if(t.ownSizes)return{viewports:new Set(t.viewports.map(n=>n.id)),query:""};let e=gt(t.board,t.viewports);return{viewports:new Set(e?[e.id]:t.viewports.map(n=>n.id)),query:""}}function me(t,e){let n=e.trim().toLowerCase();if(!n)return!0;let s=t.toLowerCase();return n.split(/\s+/).every(r=>s.includes(r))}function wt(t,e){return me(`${t.title}
|
|
2
2
|
${t.path}
|
|
3
|
-
${t.label}`,e)}function re(t){return t.viewports[0]??t.viewport}function Xe(t,e,n){return!n&&t.viewports.includes(e)?e:re(t)}function Le(t,e,n){let s=[],r;for(let i of t){i.heading!==void 0&&(r=i.heading);let a=i.cells.filter(c=>c.viewport===Xe(c,e,n));if(a.length===0)continue;let l={cells:a};r!==void 0&&(l.heading=r),r=void 0,s.push(l)}return s}function
|
|
4
|
-
${new URL(r,window.location.href).href}`)))}function Ze(t){return Math.round(Math.min(480,Math.max(200,t*.2)))}function et(t,e,n,s,r=1){return t<=0||e<=0?1:Math.max(.01,Math.min(r,n/t,s/e))}var le=class{io;slots=new Map;near=new Set;live=[];pending=0;sizer=null;constructor(e,n){this.io=new IntersectionObserver(s=>{for(let r of s)r.isIntersecting?this.near.add(r.target):this.near.delete(r.target);this.refresh()},{root:e,rootMargin:n})}observe(e,n){this.slots.set(e,{host:e,make:n,frame:null}),this.io.observe(e)}scale(e,n){e.dataset.width=String(n),!(typeof ResizeObserver>"u")&&(this.sizer??=new ResizeObserver(s=>{for(let r of s){let i=r.target,a=Number(i.dataset.width);a>0&&r.contentRect.width>0&&i.style.setProperty("--dv-scale",String(r.contentRect.width/a))}this.refreshSoon()}),this.sizer.observe(e))}forget(e){let n=this.slots.get(e);this.io.unobserve(e),n?.frame?.remove(),this.slots.delete(e),this.near.delete(e),this.live=this.live.filter(s=>s!==n)}clear(){this.sizer?.disconnect(),this.sizer=null;for(let e of this.slots.values())this.io.unobserve(e.host),e.frame?.remove();this.slots.clear(),this.near.clear(),this.live=[]}refreshSoon(){this.pending||(this.pending=requestAnimationFrame(()=>{this.pending=0,this.refresh()}))}refresh(){for(let s of this.near){let r=this.slots.get(s);!r||r.frame||r.host.getBoundingClientRect().width<48||(r.frame=r.make(),r.host.prepend(r.frame),this.live.push(r))}if(this.live.length<=64)return;let e=[],n=this.live.length-64;for(let s of this.live)n>0&&!this.near.has(s.host)?(s.frame?.remove(),s.frame=null,n--):e.push(s);this.live=e}};var bn={photo:"Photo",logo:"Logo"},wn={y:22,x:120},ce=t=>`${Math.round(t*1e4)/100}%`;function zt(t){let[e,n]=t.split(" ");return e==="cover"?`cover cover--${n}`:e==="image"?`outline__image${n?` outline__image--${n}`:""}`:`shape-${e}${n?` shape-${e}--${n}`:""}`}function tt(t){return{"--x":String(t.x),"--y":String(t.y),"--w":String(t.w),"--h":String(t.h)}}function nt(t){return{"data-path":t.path,"data-viewport":t.viewport,"data-root":t.root}}function At(t,e){return o("span",{class:"frame__label"},o("b",{text:t}),o("i",{text:` \xB7 ${e}`}))}function Rt(t,e,n,s,r,i,a={}){let l=o("div",{class:"dv-view",style:{width:T(n.width),height:T(n.height),...a}});s.scale(r,i);let c=t.url(e);return s.observe(l,()=>o("iframe",{class:"dv-iframe",attrs:{src:c,title:e.label,width:n.width,height:n.height,tabindex:-1,"aria-hidden":"true"}})),l}function yn(t,e){let n=document.createElement("span"),s=["halo","line"].map(r=>`<polygon class="safe-area__${r}" points="${t}"/>`).join("");return n.innerHTML=`<svg class="safe-area" viewBox="0 0 ${e.width} ${e.height}" preserveAspectRatio="none" aria-hidden="true">${s}</svg>`,n.firstElementChild}function xn(t,e){let n=t.trim().split(/\s+/).map(i=>i.split(",").map(Number)),s=Math.min(...n.map(([i])=>i??0)),r=Math.min(...n.map(([,i])=>i??0));return{"--safe-left":ce(s/e.width),"--safe-top":ce(r/e.height)}}function Sn(t,e,n,s,r,i,a){let{area:l,image:c,cut:u}=r,d=n.safe&&n.upload?{points:n.safe,upload:n.upload}:null,h=o("span",{class:`outline__shape ${zt(s[1])}${u?" outline__image--cut":""}`,attrs:{"data-at":s[0]},style:{...tt(l),...d?xn(d.points,d.upload):{}}}),f={left:ce((c.x-l.x)/l.w),top:ce((c.y-l.y)/l.h)};if(h.append(Rt(t,e,i,a,h,i.width*l.w/c.w,f)),d&&h.append(yn(d.points,d.upload),o("span",{class:"mark-label mark-label--safe",text:"Safe area"})),u){let[m,g]=u.axis==="y"?["top","bottom"]:["left","right"];h.append(o("span",{class:`crop-edge crop-edge--${m}`}),o("span",{class:`crop-edge crop-edge--${g}`}))}return h}function kn(t,e,n,s,r){let{area:i,image:a,cut:l}=n;if(!l)return null;let c=o("span",{class:"outline__shape outline__cut",attrs:{"data-at":"cut"},style:tt(a)}),u=Rt(t,e,s,r,c,s.width);u.classList.add("media"),c.append(u);let d=`Cut off: ${l.px} px`,[h,f]=l.axis==="y"?["top","bottom"]:["left","right"],m=l.axis==="y"?ce((i.y-a.y)/2/a.h):ce((i.x-a.x)/2/a.w),g=`clamp(0, (var(--dv-scale) * ${l.px} - ${wn[l.axis]}) * 100, 1)`;for(let[w,p]of[[h,m],[f,`calc(100% - ${m})`]])c.append(o("span",{class:`mark-label mark-label--${w}`,text:d,style:{[l.axis==="y"?"top":"left"]:p,opacity:g}}));return c}function Ht(t,e,n,s,r,i){let a=n[s],l=Se(n,a,r),c=o("div",{class:`outline${s==="phone"?" outline--phone":""}`,attrs:{role:"img","aria-label":`${n.name} at ${s} width, with the image in place`,"data-outline":`${n.id}-${s}`},style:{"--u":`calc(100cqw / ${a.width})`,...a.style}});for(let h of l.shapes){if(We(h)){let w=kn(t,e,l,r,i),p=Sn(t,e,n,h,l,r,i);if(l.cut?.axis==="x")for(let v of[w,p])v?.style.setProperty("z-index","1");w&&c.append(w),c.append(p);continue}let[f,m]=h[1].split(" "),g=f==="cover"?bn[m??""]:void 0;c.append(o("span",{class:`outline__shape ${zt(h[1])}`,attrs:{"data-at":h[0]},style:tt(Ue(h))},g?o("span",{class:"mark-label",text:g}):null))}let u=o("div",{class:`frame__shot dv-shot${t.isSelected(e)?" is-selected":""}`,style:{"aspect-ratio":`${a.width} / ${l.height}`},attrs:nt(e)},c),d=o("button",{class:"dv-frame-open",attrs:{type:"button","aria-label":`Open ${e.label} (${s}, in context)`}});return d.addEventListener("click",()=>t.focus(e,d)),u.append(d),o("figure",{class:`frame frame--${s}`,attrs:{"data-media-frame":s}},u,o("figcaption",{class:"frame__caption"},At(s,"in context"),D(()=>t.ref(e,e.viewport,`${s}, in context`))))}function En(t,e,n,s){let r=null,i=Q(t,e,s,()=>t.focus(e,r??void 0));return r=i.querySelector(".dv-frame-open"),o("figure",{class:"frame frame--own dv-frame",attrs:{...nt(e),"data-media-frame":"own"}},i,o("figcaption",{class:"frame__caption"},At("on its own",`${n.width} \xD7 ${n.height}`),D(()=>t.ref(e,e.viewport))),e.note?o("p",{class:"dv-note",text:e.note}):null)}function Ln(t,e,n,s,r){let i=`${s.width} \xD7 ${s.height}`;if(n.upload)i=`upload ${i}`;else if(r&&n.ratios)i+=`, shown cut to ${(r.axis==="y"?n.ratios.tallest:n.ratios.widest).join(":")}`;else{let l=dt(s.width,s.height);l&&(i+=`, ${l}`)}let a=[];return n.covered&&a.push(["covered",n.covered]),n.safe&&a.push(["safe","Safe for text and key marks"]),r&&a.push(["cut",`Cut off: ${r.px} px ${r.axis==="y"?"top and bottom":"left and right"}`]),a.length===0&&n.whole&&a.push([null,n.whole]),o("div",{class:"media-group__head"},o("div",{class:"media-group__title"},o("h3",{text:e.title}),o("p",null,`${n.name} \xB7 `,o("code",{text:n.id}),` \xB7 ${i} \xB7 sizes checked ${Je(n.checked)}`)),o("ul",{class:"legend"},...a.map(([l,c])=>o("li",{attrs:l?{"data-key":l}:{}},l?o("span",{class:`key key--${l}`}):null,c))),e.download?_t(t,e,e.download):null)}function Mn(t,e){let n=s=>s.width/Se(t,s,e).height;return[n(t.desktop),n(t.phone),e.width/e.height].map(s=>`minmax(0, ${Math.round(s*1e4)/1e4}fr)`).join(" ")}function Pt(t,e,n,s){let r=t.viewports.get(e.viewport),i={width:r?.width??1,height:r?.height??1},a=n.layout==="wide",l=o("div",{class:`media-grid${a?" media-grid--wide":""}`,style:{"--media-columns":a?n.columns:Mn(n,i)}},Ht(t,e,n,"desktop",i,s),Ht(t,e,n,"phone",i,s),En(t,e,i,s));return o("article",{class:"media-group dv-media",attrs:{...nt(e),"data-frame":n.id}},Ln(t,e,n,i,Se(n,n.desktop,i).cut),l)}var Ae="(max-width: 767px)";function He(t,e){return e.lines.map(n=>{let s={cells:n.cells.filter(r=>t.viewports.has(r.viewport)&&t.visible(r))};return n.heading&&(s.heading=n.heading),s}).filter(n=>n.cells.length>0)}var ze=class{ctx;sections;el;loader;shown=0;cardsShown=0;archiveOpen=!1;constructor(e,n){this.ctx=e,this.sections=n,this.el=o("main",{class:"dv-wall",attrs:{id:"dv-wall",tabindex:-1}}),this.loader=new le(this.el,"50% 0px"),e.onFilters(()=>this.render()),e.onSelect(()=>this.markSelected()),ft(()=>this.loader.refreshSoon())}get frames(){return this.shown}get found(){return this.shown+this.cardsShown}jump(e){let n=this.ctx.ownSizes?this.ownFrame(e):e,s=this.sections.some(a=>a.kind==="archive"&&a.lines.some(l=>l.cells.some(c=>c.path===n.path)));s&&(this.archiveOpen=!0),this.ctx.select(n),!this.ctx.ownSizes&&this.ctx.size!==n.viewport||this.ctx.filters.query?this.ctx.setFilters(this.ctx.ownSizes?{query:""}:{query:"",viewports:new Set([n.viewport])}):s&&this.render();let r=[...this.el.querySelectorAll(".dv-frame")].find(a=>a.dataset.path===n.path&&a.dataset.viewport===n.viewport&&a.dataset.root===n.root);if(!r)return;let i=r.closest(".dv-media");(i??r).scrollIntoView({block:i?"start":"center",inline:"nearest"}),!i?.contains(document.activeElement)&&r.querySelector(".dv-frame-open")?.focus({preventScroll:!0})}ownFrame(e){if(e.viewport===re(e))return e;for(let n of this.sections)for(let s of n.lines){let r=s.cells.find(i=>i.path===e.path&&i.root===e.root&&i.viewport===re(i));if(r)return r}return e}render(){let e=this.el.scrollTop;this.loader.clear(),this.el.replaceChildren(),this.shown=0,this.cardsShown=0;let n=this.ctx.ownSizes?void 0:this.ctx.viewports.get(this.ctx.size);n&&this.el.style.setProperty("--dv-min",T(Ze(n.width)));let s=Cn(this.ctx);s&&this.el.append(s);let r=null,i=0;for(let a of this.sections){if(a.kind==="exploration"){let c=this.optionSet(a);if(!c)continue;r||(r=o("section",{class:"dv-section",attrs:{"data-kind":"exploration",id:"dv-options"}}),this.el.append(r)),r.append(c),i++;continue}let l=a.kind==="archive"?this.archive(a):a.kind==="design-system"?this.designSystem(a):this.section(a);l&&this.el.append(l)}if(r){let a=o("span",{class:"tag tag--strong"},x("clock"),"Waiting for a pick");r.prepend(this.head("Open options",L(i,"question"),"explorations/",[a]))}this.el.childElementCount===(s?1:0)&&this.el.append(o("p",{class:"dv-empty",text:this.ctx.filters.query?"No frames match the search.":"Nothing is drawn at this size."})),this.el.scrollTop=e}markSelected(){for(let n of this.el.querySelectorAll(".dv-shot.is-selected"))n.classList.remove("is-selected");let e=this.ctx.selected;if(e)for(let n of this.el.querySelectorAll(".dv-shot"))n.dataset.path===e.path&&n.dataset.viewport===e.viewport&&n.dataset.root===e.root&&n.classList.add("is-selected")}head(e,n,s,r=[]){return o("div",{class:"section-head"},o("h2",{text:e}),...r,n?o("span",{class:"section-head__meta",text:n}):null,s?o("span",{class:"section-head__aside",text:s}):null)}sizeAside(){if(this.ctx.ownSizes)return"Each at its own size";let e=this.ctx.viewports.get(this.ctx.size);return e?ie(e):""}grid(e,n){let s=o("div",{class:"frame-grid dv-grid"});if(this.ctx.ownSizes){let r=Math.max(0,...e.map(i=>this.ctx.viewports.get(i.viewport)?.width??0));r>0&&s.style.setProperty("--dv-min",T(Ze(r)))}for(let r of e)s.append(ge(this.ctx,r,this.loader,{above:n?.(r)??null})),this.shown++;return s}section(e){let n=He(this.ctx,e).flatMap(i=>i.cells);if(n.length===0)return null;let s="",r=this.sizeAside();if(e.kind==="flow"){let i=n.filter(u=>!Ve(u.frame)),a=n.length-i.length,l=new Set(i.map(u=>u.path.replace(/--[^/]*$/,""))),c=new Set(i.map(u=>u.path));s=[i.length>0?`${L(l.size,"screen")} \xB7 ${L(c.size,"state")}`:"",a>0?L(a,"image"):""].filter(Boolean).join(" \xB7 "),i.length===0&&!this.ctx.ownSizes&&(r="In context and on its own")}else e.kind==="components"?s=L(n.length,"component"):s=L(n.length,"page");return o("section",{class:"dv-section",attrs:{"data-kind":e.kind,id:`dv-${e.id}`}},this.head(e.title,s,r),...this.framesAndGroups(n))}framesAndGroups(e){let n=[],s=[],r=()=>{s.length>0&&n.push(this.grid(s)),s=[]};for(let i of e){let a=Ve(i.frame);if(!a){s.push(i);continue}r(),n.push(Pt(this.ctx,i,a,this.loader)),this.shown++}return r(),n}designSystem(e){let n=He(this.ctx,e).flatMap(f=>f.cells),s=this.ctx.filters.query,r=e.overview&&me("design system overview tokens colours colors type fonts",s)?this.overviewCard(e):null,i=e.assets??[],l=!!e.filesHref&&i.length>0&&(me("design system files images downloads",s)||i.some(f=>this.ctx.fileVisible(f.path)))&&e.filesHref?Tt(this.ctx,e.filesHref,i,this.cardSize()):null;if(l&&s.trim()&&this.cardsShown++,n.length===0&&!r&&!l)return null;let c=n.filter(f=>f.path.startsWith("design-system/brand/")).length,u=n.length-c,d=[r?"Overview":"",l?L(i.length,"file"):"",c?L(c,"brand page"):"",u?L(u,"component"):""].filter(Boolean).join(" \xB7 "),h=this.grid(n);return h.prepend(...[r,l].filter(f=>f!==null)),o("section",{class:"dv-section",attrs:{"data-kind":e.kind,id:`dv-${e.id}`}},this.head(e.title,d,this.sizeAside()),h)}cardSize(){return this.ctx.ownSizes?void 0:this.ctx.viewports.get(this.ctx.size)}overviewCard(e){let n=e.overview;if(!n)return null;let s=`${this.ctx.data.roots.head}${n.href}`,r=this.cardSize(),i=[L(n.tokens,"token"),L(n.colours,"colour"),L(n.fontStacks.length,"font")].filter(a=>!a.startsWith("0 ")).join(" \xB7 ");return o("figure",{class:"frame dv-overview",attrs:{"data-kind":"overview"}},o("a",{class:"overview-card",attrs:{href:s,"aria-label":"Open the design system overview"},style:r?{"aspect-ratio":`${r.width} / ${r.height}`}:{}},o("span",{class:"overview-card__palette",attrs:{"aria-hidden":"true"}},...n.palette.map(a=>o("i",{style:{background:a}}))),o("span",{class:"overview-card__body"},o("span",{class:"overview-card__title",text:"Overview"}),o("span",{class:"overview-card__meta",text:i}),n.fontStacks.length>0?o("span",{class:"overview-card__fonts",attrs:{"aria-hidden":"true"}},...n.fontStacks.slice(0,2).map(a=>o("span",{text:"Aa",style:{"font-family":a}}))):null)),o("figcaption",{class:"frame__caption"},o("span",{class:"frame__label"},"design-system / ",o("b",{text:"overview"})),D(()=>`${this.ctx.data.product.slug} design-system/tokens.css (overview)
|
|
5
|
-
${new URL(s,window.location.href).href}`)))}optionSet(e){let n=He(this.ctx,e);return n.length===0?null:ot(this.ctx,e,n,(s,r)=>this.grid(s,r))}archive(e){let n=He(this.ctx,e).flatMap(l=>l.cells),s=(e.files??[]).filter(l=>this.ctx.fileVisible(l.path));if(n.length===0&&s.length===0)return null;let r=new Set(n.map(l=>l.path)).size,i=o("details",{class:"collapsed dv-archive",attrs:{"data-kind":"archive",id:"dv-archive",open:this.archiveOpen}},o("summary",null,x("collapsed"),o("h2",null,`${e.title} `,o("span",{text:`(${r||s.length})`})),o("p",{text:r>0?`${
|
|
6
|
-
${this.link({...e,viewport:n})}`}link(e,n="focus"){let s=new URL(window.location.href);return s.hash=ve(e,n),s.href}};function Fe(t){return t.flows.map(e=>{let n=new Map;for(let s of t.board.filter(r=>r.kind==="flow"))for(let r of s.lines)for(let i of r.cells){let a=B.exec(i.path);if(!a||a[1]!==e.id)continue;let l=a[2],c=a[3],u=n.get(l)??{id:l,states:[]};n.set(l,u);let d=u.states.find(h=>h.id===c);d||(d={id:c,cells:[]},u.states.push(d)),d.cells.push(i)}return{...e,screens:[...n.values()]}}).filter(e=>e.screens.length>0)}function rt(t,e,n){let r=(e.root==="head"?t.board:t.preview?.sections??[]).flatMap(h=>h.lines.flatMap(f=>f.cells)).filter(h=>h.root===e.root),i=h=>h.find(f=>f.viewport===e.viewport)??h[0]??null;if(n.toLowerCase()==="v"){let h=t.viewports.flatMap(m=>r.filter(g=>g.path===e.path&&g.viewport===m.id).slice(0,1)),f=h.findIndex(m=>m.viewport===e.viewport);return f>=0?h[(f+1)%h.length]??null:null}let a=B.exec(e.path);if(!a)return null;let c=Fe({...t,board:[{id:"step",kind:"flow",title:"",align:!1,columns:[],lines:r.map(h=>({cells:[h]}))}]}).find(h=>h.id===a[1]),u=c?.screens.findIndex(h=>h.id===a[2])??-1,d=c?.screens[u];if(!c||!d)return null;if(n==="ArrowLeft"||n==="ArrowRight"){let h=d.states.findIndex(f=>f.id===a[3]);return i(d.states[h+(n==="ArrowLeft"?-1:1)]?.cells??[])}if(n==="ArrowUp"||n==="ArrowDown"){let h=c.screens[u+(n==="ArrowUp"?-1:1)];return i((h?.states.find(f=>f.id===a[3])??h?.states[0])?.cells??[])}return null}function Nt(t,e){let n=B.exec(e.path);if(!n)return null;let r=(e.root==="head"?t.board:t.preview?.sections??[]).flatMap(c=>c.lines.flatMap(u=>u.cells)).filter(c=>c.root===e.root),a=Fe({...t,board:[{id:"position",kind:"flow",title:"",align:!1,columns:[],lines:r.map(c=>({cells:[c]}))}]}).find(c=>c.id===n[1])?.screens.find(c=>c.id===n[2]);if(!a)return null;let l=a.states.findIndex(c=>c.id===n[3]);return l<0?null:{index:l,total:a.states.length}}function Hn(t){let e=[],n=0,s="",r=!1;for(let i=0;i<t.length;i++){let a=t[i];if(r){r=!1;continue}if(a==="\\"){r=!0;continue}if(s){a===s&&(s="");continue}if(a==='"'||a==="'"){s=a;continue}if(a!=="-"||t[i+1]!==">")continue;let l=/^->\s*([^,]*)(?:,|$)/.exec(t.slice(i));if(!l)continue;let c=t.slice(n,i).trim(),u=l[1]?.trim()??"";c&&B.test(`screens/${u}.html`)&&e.push({selector:c,target:u}),i+=l[0].length-1,n=i+1}return e}function zn(t,e,n){let s=`screens/${n}.html`;if(!B.test(s))return null;let r=[...t.board,...t.preview?.sections??[]].flatMap(l=>l.lines.flatMap(c=>c.cells)).filter(l=>l.path===s),i=r.filter(l=>l.root===e.root),a=i.length?i:r.filter(l=>l.root==="head");return a.find(l=>l.viewport===e.viewport)??a[0]??null}function Dt(t,e,n,s){let r=[...t.querySelectorAll('meta[name="design:links"]')].flatMap(a=>Hn(a.content)),i=a=>{if(a.button!==0||a.ctrlKey||a.metaKey||a.altKey||a.shiftKey)return;let l=a.target;if(typeof l?.closest=="function")for(let c of r){try{if(!l.closest(c.selector))continue}catch{continue}let u=zn(e,n,c.target);if(u){a.preventDefault(),a.stopImmediatePropagation(),s(u);return}}};return t.addEventListener("click",i,!0),()=>t.removeEventListener("click",i,!0)}var qt=4,An=0;function Bt(t,e,n,s={}){let r=`dv-size-menu-${++An}`,i=o("span",{class:"size-menu__name"}),a=o("span",{class:"size-menu__dims"}),l=o("button",{class:"size-menu__button",attrs:{type:"button","aria-haspopup":"menu","aria-expanded":"false","aria-controls":r}},o("span",{class:"size-menu__label",text:"Size"}),i,a,x("expanded")),c=t.map(p=>{let v=o("button",{class:"size-menu__option",attrs:{type:"button",role:"menuitemradio","aria-checked":"false","data-viewport":p.id,tabindex:-1,disabled:s.disabled?.(p.id)??!1}},o("span"),o("span",{text:H(p.id)}),o("span",{class:"size-menu__option-dims",text:`${p.width} \xD7 ${p.height}`}));return v.addEventListener("click",()=>{v.disabled||(g(!0),n(p.id))}),v}),u=o("div",{class:"size-menu__list",attrs:{id:r,role:"menu","aria-label":"Size",hidden:!0}},...c),d=o("div",{class:`size-menu${s.extraClass?` ${s.extraClass}`:""}`},l,u),h=()=>c.filter(p=>!p.disabled),f=p=>{d.contains(p.target)||g(!1)};function m(){if(!u.hidden)return;u.hidden=!1,l.setAttribute("aria-expanded","true"),document.addEventListener("pointerdown",f,!0);let p=c.find(v=>v.getAttribute("aria-checked")==="true"&&!v.disabled)??h()[0];p?.focus({focusVisible:Ee()}),p?.scrollIntoView?.({block:"nearest"})}function g(p){u.hidden||(u.hidden=!0,l.setAttribute("aria-expanded","false"),document.removeEventListener("pointerdown",f,!0),p&&l.focus())}l.addEventListener("click",()=>u.hidden?m():g(!1)),l.addEventListener("keydown",p=>{(p.key==="ArrowDown"||p.key==="ArrowUp")&&(p.preventDefault(),m())}),u.addEventListener("keydown",p=>{let v=h(),S=v.indexOf(document.activeElement),C;if(p.key==="ArrowDown")C=v[(S+1)%v.length];else if(p.key==="ArrowUp")C=v[(S-1+v.length)%v.length];else if(p.key==="Home")C=v[0];else if(p.key==="End")C=v[v.length-1];else if(p.key==="Escape"){p.preventDefault(),p.stopPropagation(),g(!0);return}else if(p.key==="Tab"){g(!1);return}else return;p.preventDefault(),C?.focus()});let w=p=>{let v=t.find(S=>S.id===p);i.textContent=v?H(v.id):"",a.textContent=v?`${v.width} \xD7 ${v.height}`:"";for(let S of c){let C=S.getAttribute("data-viewport")===p;S.setAttribute("aria-checked",String(C)),S.firstElementChild?.replaceWith(C?x("check"):o("span"))}};return w(e),{el:d,set:w}}function Rn(t,e,n,s={}){let r=o("div",{class:`switcher${s.fill?" switcher--fill":""}${s.extraClass?` ${s.extraClass}`:""}`,attrs:{role:"group","aria-label":"Size"}});for(let i of t){let a=o("button",{text:H(i.id),attrs:{type:"button","aria-pressed":String(i.id===e),title:`${i.width} \xD7 ${i.height}`,"data-viewport":i.id,disabled:s.disabled?.(i.id)??!1}});a.addEventListener("click",()=>n(i.id)),r.append(a)}return r}function Pn(t,e){for(let n of t.querySelectorAll("button"))n.setAttribute("aria-pressed",String(n.getAttribute("data-viewport")===e));ue(t)}function pe(t,e,n,s={}){if(t.length>qt){let i={};return s.extraClass&&(i.extraClass=s.extraClass),s.disabled&&(i.disabled=s.disabled),Bt(t,e,n,i)}let r=Rn(t,e,n,s);return{el:r,set:i=>Pn(r,i)}}function ue(t){let e=t.querySelector('[aria-pressed="true"]');!e||t.scrollWidth<=t.clientWidth||(t.scrollLeft=Math.max(0,e.offsetLeft-(t.clientWidth-e.offsetWidth)/2))}function Ut(t){return`${ne}:size:${t.data.product.slug}`}function Wt(t){if(t.ownSizes)return null;try{let e=localStorage.getItem(Ut(t));return e&&t.viewports.has(e)?e:null}catch{return null}}function Fn(t,e){try{localStorage.setItem(Ut(t),e)}catch{}}function Vt(t){let e=o("input",{attrs:{type:"search",placeholder:"Search screens","aria-label":"Search screens",autocomplete:"off"}}),n=o("span",{class:"dv-search-status"},o("kbd",{class:"kbd",text:"/"}));return{el:o("label",{class:`search-field${t?" search-field--fill":" desktop-only"}`},x("search"),e,n),input:e,status:n}}function Kt(t,e){let n=t.data.board.filter(p=>p.kind==="flow"),s=new Set(n.flatMap(p=>p.lines.flatMap(v=>v.cells.map(S=>S.path)))),r=o("button",{class:"button button--quiet button--icon desktop-only dv-show-sidebar",attrs:{type:"button","aria-label":"Show the sidebar","aria-controls":"dv-screens"}},x("sidebar")),i=t.ownSizes?null:pe(t.data.viewports,t.size,p=>{Fn(t,p),t.setFilters({viewports:new Set([p])})},{extraClass:"top-bar__center"}),a=Vt(!1),l=Vt(!0),c=[a.input,l.input],u=Ge(p=>t.setFilters({query:p}),150);for(let p of c)p.addEventListener("input",()=>{for(let v of c)v!==p&&(v.value=p.value);u(p.value)}),p.addEventListener("keydown",v=>{if(v.key==="Escape"&&p.value){v.stopPropagation();for(let S of c)S.value="";t.setFilters({query:""})}});let d=o("div",{class:"dv-search-row phone-only",attrs:{hidden:!0}},l.el),h=o("button",{class:"button button--quiet button--icon phone-only",attrs:{type:"button","aria-label":"Search screens","aria-expanded":"false"}},x("search"));h.addEventListener("click",()=>{d.hidden=!d.hidden,h.setAttribute("aria-expanded",String(!d.hidden)),d.hidden||l.input.focus()});let f=o("button",{class:"button phone-only",attrs:{type:"button","aria-controls":"dv-screens","aria-expanded":"false"}},x("sidebar"),"Screens"),m=()=>{let p=t.filters.query.trim(),v=e();for(let S of[a,l])S.status.replaceChildren(p?o("span",{class:"search-field__count",text:v===0?"None found":`${v} found`}):S===a?o("kbd",{class:"kbd",text:"/"}):"")};return t.onFilters(()=>{i?.set(t.size);for(let p of c)p.value!==t.filters.query&&(p.value=t.filters.query);setTimeout(m,0)}),setTimeout(()=>{m(),i?.el.classList.contains("switcher")&&ue(i.el)},0),{el:o("header",{class:i?"top-bar top-bar--centered top-bar--board":"top-bar"},o("div",{class:"top-bar__start"},r,ke(!0),o("div",{class:"top-bar__product"},o("strong",{text:t.data.product.name}),o("span",null,L(s.size,"screen"),o("span",{class:"desktop-only",text:` in ${L(n.length,"flow")}`})))),i?i.el:o("span",{class:"top-bar__spacer"}),o("div",{class:"top-bar__end"},a.el,h,f)),searchRow:d,screens:f,showSidebar:r,focusSearch:()=>{oe("(max-width: 767px)").matches?(d.hidden=!1,h.setAttribute("aria-expanded","true"),l.input.focus()):a.input.focus()}}}function On(t){let e=t.defaultView;if(!e||typeof e.getComputedStyle!="function")return!0;let n=s=>{if(!s)return null;let r=e.getComputedStyle(s).overflowY;return r==="visible"||r===""?null:r==="hidden"||r==="clip"};return!(n(t.documentElement)??n(t.body)??!1)}var In=/url\([^)]*\)|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|(?<![\w.])(\d*\.?\d+)[sld]?(vh|vb|vmin|vmax)\b/gi;function Nn(t,e,n){let s={vh:n/100,vb:n/100,vmin:Math.min(e,n)/100,vmax:Math.max(e,n)/100};return t.replace(In,(r,i,a)=>i===void 0||a===void 0?r:`${Math.round(Number(i)*(s[a.toLowerCase()]??0)*100)/100}px`)}function it(t,e,n){let s;try{s=t.contentDocument}catch{return}if(!s)return;let r=a=>{let l=a?.cssText;if(!a||!l)return;let c=Nn(l,e,n);c!==l&&(a.cssText=c)},i=a=>{for(let l of Array.from(a??[]))"style"in l&&r(l.style),"cssRules"in l&&i(l.cssRules),"styleSheet"in l&&i(jt(l.styleSheet))};for(let a of Array.from(s.styleSheets??[]))i(jt(a));for(let a of Array.from(s.querySelectorAll("[style]")))r(a.style)}function jt(t){try{return t?.cssRules}catch{return}}function at(t,e){let n;try{n=t.contentDocument}catch{return null}let s=n?.documentElement;if(!n||!s)return null;if(!On(n))return e;let r=t.style.height;t.style.height=`${e}px`;try{return Math.max(e,s.scrollHeight,n.body?.scrollHeight??0)}finally{t.style.height=r}}function Dn(t,e){let n;try{n=t.contentDocument}catch{return}if(!n?.documentElement)return;n.fonts?.ready.then(e,()=>{});let s=n.defaultView?.ResizeObserver;if(typeof s!="function"||typeof requestAnimationFrame!="function")return;let r=0,i=new s(()=>{if(!t.isConnected){i.disconnect();return}r||=requestAnimationFrame(()=>{r=0,e()})});i.observe(n.documentElement),n.body&&i.observe(n.body)}var Gt=t=>`${t.root}:${t.path}@${t.viewport}`,Oe=class{measured=new Map;viewports;steady;constructor(e,n=s=>s()){this.viewports=e,this.steady=n}group(e){let n=Math.max(1,...e.map(c=>this.viewports.get(c.viewport)?.height??1)),s=e.map(Gt),r=[],i=()=>Math.max(n,...s.map(c=>this.measured.get(c)??0)),a=i(),l=()=>{let c=i();c!==a&&(a=c,this.steady(()=>{for(let u of r)u(c)}))};return{fit:c=>{r.push(c),c(a)},clear:()=>{r.length=0},frames:(c,u)=>()=>{let d=u(),h=Gt(c),f=this.viewports.get(c.viewport)??{width:1,height:n},m=()=>{if(!d.isConnected)return;let g=at(d,f.height);g!==null&&(this.measured.set(h,g),l())};return d.addEventListener("load",()=>{it(d,f.width,f.height),m(),Dn(d,m)}),d}}}};function qn(t,e){let n=t.data.product.name,s=B.exec(e.path);if(s){let i=t.data.flows.find(a=>a.id===s?.[1])?.title??H(s[1]??"");return{desktop:[n,i],both:[H(s[2]??"")],last:H(s[3]??"")}}if(s=Ot.exec(e.path))return{desktop:[n,`Option ${(s[2]??"").toUpperCase()}`],both:[H(s[4]??"")],last:H(s[5]??"")};let r=e.path.startsWith("design-system/brand/")?"Brand":e.path.startsWith("design-system/components/")?"Components":e.path.startsWith("archive/")?"Archive":"";return{desktop:[n],both:r?[r]:[],last:e.title}}function be(t,e){return o("li",null,o("span",{class:"key-list__keys"},...t.map(n=>o("kbd",{class:"kbd kbd--large"},n))),o("span",{text:e}))}function Xt(t,e,n){let s=e.viewport,r=t.focusFullHeight,i=t.viewports.get(s)??{id:s,width:1,height:1},a=new Set(e.viewports.length>0?e.viewports:[s]),l=oe(Ae);t.select(e);let c=o("iframe",{class:"dv-focus-frame",attrs:{src:t.url(e),title:e.title,width:i.width,height:i.height}}),u=o("div",{class:"frame__shot dv-focus-shot"},c),d=o("i"),h=o("div",{class:"dv-stage"}),f=o("div",{class:"stage__cap desktop-only"},e.root==="base"?o("span",{class:"tag",text:"Before"}):null,o("span",{class:"frame__label"},e.path.slice(0,e.path.lastIndexOf("/")+1),o("b",{text:e.path.slice(e.path.lastIndexOf("/")+1)}),d),D(()=>t.ref(e,s)));h.append(f,o("figure",{class:"frame dv-focus-figure"},u));let m=i.height,g=()=>{r&&!l.matches&&(m=at(c,i.height)??i.height);let y=h.clientWidth-se(h,"padding-left")-se(h,"padding-right"),P=f.offsetHeight?f.offsetHeight+se(f,"margin-bottom"):0,$=h.clientHeight-se(h,"padding-top")-se(h,"padding-bottom")-P,R=r&&!l.matches,N=y>0&&$>0?R?et(i.width,1,y,Number.POSITIVE_INFINITY):et(i.width,i.height,y,$):1,fe=R?m:i.height;c.style.height=T(fe),c.setAttribute("height",String(fe)),c.style.transform=N===1?"":`scale(${N})`,u.style.width=T(i.width*N),u.style.height=T(fe*N),h.classList.toggle("dv-stage--tall",R),d.textContent=` \xB7 ${ie(i," ")} \xB7 shown at ${Math.round(N*100)}%`,S.classList.remove("dv-crumb--short"),S.classList.add("dv-crumb--measure");let xe=S.scrollWidth>S.clientWidth+1;S.classList.remove("dv-crumb--measure"),S.classList.toggle("dv-crumb--short",xe)},w=()=>{it(c,i.width,i.height),g()};c.addEventListener("load",w);let p=o("button",{class:"button button--quiet top-bar__close",attrs:{type:"button","aria-label":"Close and go back to the board"}},x("close"),o("span",{class:"desktop-only",text:"Close"}),o("kbd",{class:"kbd kbd--small desktop-only",text:"Esc"})),v=qn(t,e),S=o("nav",{class:"crumb",attrs:{"aria-label":"Screen"}});for(let y of v.desktop)S.append(o("span",{class:"desktop-only",text:y}),o("span",{class:"crumb__sep desktop-only",text:"/"}));for(let y of v.both)S.append(o("span",{text:y}),o("span",{class:"crumb__sep",text:"/"}));S.append(o("b",{text:v.last}));let C=Nt(t.data,e),F=y=>{let P=rt(t.data,{...e,viewport:s},y);P&&t.focus(P)},z=(y,P,$,R)=>{let N=o("button",{class:"button button--small button--icon",attrs:{type:"button","aria-label":P,disabled:R}},x($));return N.addEventListener("click",()=>F(y)),N},q=C?o("div",{class:"stepper"},z("ArrowLeft","Previous state","previous",C.index===0),z("ArrowRight","Next state","next",C.index>=C.total-1),o("span",{class:"stepper__count"},o("span",{class:"desktop-only",text:"State "}),`${C.index+1} of ${C.total}`)):null,V=y=>{y!==s&&a.has(y)&&t.focus({...e,viewport:y})},G=!(t.ownSizes&&a.size<=1),J=y=>!a.has(y),_=G?pe(t.data.viewports,s,V,{extraClass:"desktop-only",disabled:J}):null,U=G?pe(t.data.viewports,s,V,{fill:!0,disabled:J}):null,W=U?o("div",{class:"bottom-bar bottom-bar--fixed phone-only"},U.el):null,K=o("button",{class:"button button--quiet desktop-only",attrs:{type:"button","aria-pressed":String(r)}},x("height"),"Full height");K.addEventListener("click",()=>{r=!r,t.focusFullHeight=r,K.setAttribute("aria-pressed",String(r)),g()});let Ne=o("a",{class:"button button--icon-on-phone",attrs:{href:t.url(e),target:"_blank",rel:"noopener","aria-label":"Open in a new tab"}},x("external"),o("span",{class:"desktop-only",text:"Open in a new tab"})),ee=o("button",{class:"button button--quiet button--small button--icon",attrs:{type:"button","aria-label":"Close"}},x("close")),j=o("section",{class:"key-help key-help--anchored dv-shortcuts desktop-only",attrs:{hidden:!0,id:"dv-shortcuts",role:"dialog","aria-labelledby":"dv-shortcuts-title"}},o("div",{class:"key-help__head"},o("div",null,o("h2",{text:"Keyboard shortcuts",attrs:{id:"dv-shortcuts-title"}}),o("p",{text:"They work in this view."})),ee),o("ul",{class:"key-list"},be([x("keyLeft"),x("keyRight")],"Previous or next state"),be([x("keyUp"),x("keyDown")],"Previous or next screen"),G?be(["V"],"Change the size"):null,be(["Esc"],"Back to the board"),be(["?"],"Show or hide this help")),o("p",{class:"key-help__foot",text:"Shortcuts also work inside the frame, except while you type in a field."})),Y=o("button",{class:"button button--icon desktop-only",text:"?",attrs:{type:"button","aria-label":"Keyboard shortcuts","aria-pressed":"false","aria-expanded":"false","aria-controls":"dv-shortcuts"}}),te=()=>{j.hidden=!j.hidden,Y.setAttribute("aria-expanded",String(!j.hidden)),Y.setAttribute("aria-pressed",String(!j.hidden))};Y.addEventListener("click",te),ee.addEventListener("click",te);let ye=o("div",{class:`dv-focus${W?"":" dv-focus--one-size"}`,attrs:{role:"dialog","aria-modal":"true","aria-label":e.label}},o("header",{class:"top-bar top-bar--centered top-bar--focus"},o("div",{class:"top-bar__start"},p,o("span",{class:"top-bar__divider desktop-only"}),S,q),_?_.el:o("span",{class:"top-bar__spacer desktop-only"}),o("div",{class:"top-bar__end"},K,e.download?$t(t,e.download):null,Ne,Y)),h,W,j),De=document.documentElement.style.overflow,b=null,E,k=!1,M=()=>{k=!0,ye.remove(),document.removeEventListener("keydown",O,!0),b?.removeEventListener("keydown",O,!0),E?.(),c.removeEventListener("load",w),c.removeEventListener("load",I),document.documentElement.style.overflow=De,n?.focus({preventScroll:!0})},A=()=>t.navigate({...e,viewport:s},"board"),O=y=>{if(y.ctrlKey||y.metaKey||y.altKey)return;let P=typeof y.target?.closest=="function"?y.target.closest(".size-menu"):null;if(P&&(y.key!=="Escape"||P.querySelector(".size-menu__list:not([hidden])")))return;if(y.key==="Escape"){y.preventDefault(),j.hidden?A():te();return}let $=y.target;if(typeof $?.closest=="function"&&$.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;if(y.key==="?"){y.preventDefault(),te();return}let R=rt(t.data,{...e,viewport:s},y.key);R?(y.preventDefault(),t.focus(R)):["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","v","V"].includes(y.key)&&y.preventDefault()},I=()=>{b?.removeEventListener("keydown",O,!0),E?.(),E=void 0;try{b=c.contentDocument,b?.addEventListener("keydown",O,!0),b&&(E=Dt(b,t.data,{...e,viewport:s},y=>t.focus(y)))}catch{b=null}};if(c.addEventListener("load",I),p.addEventListener("click",A),document.addEventListener("keydown",O,!0),document.documentElement.style.overflow="hidden",document.body.append(ye),typeof ResizeObserver<"u"){let y=new ResizeObserver(()=>{k?y.disconnect():g()});y.observe(h)}return g(),U?.el.classList.contains("switcher")&&ue(U.el),p.focus({focusVisible:Ee()}),M}function Jt(t,e,n,s,r,i){let a=t.viewports.get(n.viewport)??{id:n.viewport,width:1,height:1},l=i?.group([e,n]),c=o("div"),u=o("button",{text:"Side by side",attrs:{type:"button"}}),d=o("button",{text:"Overlay",attrs:{type:"button"}}),h=o("div",{class:"switcher switcher--small",attrs:{role:"group","aria-label":`Compare ${n.path} at ${n.viewport}`}},u,d),f=o("article",{class:"change dv-comparison",attrs:{"data-path":n.path,"data-viewport":n.viewport}},o("div",{class:"change__head"},_e(n),h,$e(t,n,D(()=>t.ref(n,n.viewport)))),c),m=t.data.preview?.base?.sha,g=t.data.commit?.sha,w=(v,S,C)=>{let F=o("div",{class:"compare-side dv-frame",attrs:{"data-path":v.path,"data-viewport":v.viewport,"data-root":v.root}},o("p",{class:"compare-side__label"},S,C?o("span",{class:"sha",text:ae(C)}):null)),z=null;return z=Q(t,v,s,()=>t.focus(v,z?.querySelector(".dv-frame-open")??void 0),"",l),F.append(z),F},p=()=>{for(let _ of c.querySelectorAll(".dv-view"))s.forget(_);if(c.replaceChildren(),l?.clear(),u.setAttribute("aria-pressed",String(!r.overlay)),d.setAttribute("aria-pressed",String(r.overlay)),!r.overlay){c.className="compare-pair",c.append(w(e,"Before",m),w(n,"After",g));return}c.className="overlay";let v=[n,e].map(_=>{let U=o("div",{class:"dv-view dv-compare-layer",style:{width:T(a.width),height:T(a.height)}}),W=()=>o("iframe",{class:"dv-iframe",attrs:{src:t.url(_),title:`${_.root==="base"?"Before":"After"}: ${_.label}`,width:a.width,height:a.height,tabindex:-1}});return s.observe(U,l?l.frames(_,W):W),l?.fit(K=>{U.style.height=T(K)}),U}),S=v[1],C=o("span",{class:"overlay__line",attrs:{"aria-hidden":"true"}}),F=o("span",{class:"overlay__knob",attrs:{"aria-hidden":"true"}},x("previous"),x("next")),z=o("input",{class:"dv-compare-range",attrs:{type:"range",min:0,max:100,step:1,value:r.split,"aria-label":`Line between before and after at ${n.viewport}`}}),q=o("div",{class:"frame__shot dv-shot dv-overlay",style:{"aspect-ratio":`${a.width} / ${a.height}`,"max-width":T(a.width)}},...v,C,z,F,o("span",{class:"overlay__tag overlay__tag--before",text:"Before"}),o("span",{class:"overlay__tag overlay__tag--after",text:"After"}));s.scale(q,a.width),l?.fit(_=>{q.style.setProperty("aspect-ratio",`${a.width} / ${_}`)});let V=()=>{r.split=Math.max(0,Math.min(100,Number(z.value))),S.style.clipPath=`inset(0 ${100-r.split}% 0 0)`,q.style.setProperty("--reveal",`${r.split}%`),z.setAttribute("aria-valuetext",`${r.split}% before`)};z.addEventListener("input",V),V();let G=o("div",{class:"overlay__notes"},o("h3",{text:"Overlay"}),o("p",{text:"Before on the left of the line, after on the right. Drag the line, or use the arrow keys."}));n.note&&G.append(o("h3",{text:"Note"}),o("p",{text:n.note}));let J=o("p",{class:"dv-overlay-links"},o("a",{text:"Open before",attrs:{href:t.link(e)}})," \xB7 ",o("a",{text:"Open after",attrs:{href:t.link(n)}}));G.append(J),c.append(q,G)};return u.addEventListener("click",()=>{r.overlay=!1,p()}),d.addEventListener("click",()=>{r.overlay=!0,p()}),p(),f}var Yt=".dv-comparison, .dv-added > .dv-frame, .option-set .dv-frame",Bn=".dv-shot, .dv-files, .dv-shared";function Qt(t,e){return o("span",{class:"commit"},o("b",{text:t}),o("span",{class:"sha",text:e?ae(e.sha):"unknown"}))}function he(t){return t?t.lines.flatMap(e=>e.cells):[]}function Vn(t){return t.length>1?`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`:t[0]??""}function lt(t){return t.every(e=>e.path.startsWith("screens/"))?["screen","screens"]:["page","pages"]}function Zt(t,e,n,s){if(t.ownSizes)return"Each at its own size.";let r=t.viewports.get(t.size);if(!r||n.length===0)return"";let i=f=>{let m=new Set(f);return Vn(t.data.viewports.filter(g=>m.has(g.id)).map(g=>H(g.id)))},a=new Map(n.map(f=>[f.path,f.viewport])),l=[...new Map(n.filter(f=>f.viewport!==r.id).map(f=>[f.path,f])).values()],c=e.filter(f=>a.has(f.path)&&f.viewport!==a.get(f.path)).map(f=>f.viewport),[u,d]=lt(l),h;return l.length<a.size?(h=`Shown at ${s?ie(r,", "):H(r.id)}`,l.length>0&&(h+=`, and ${L(l.length,u,d)} without it at ${l.length===1?"its":"their"} own size`)):h=`No ${d} at ${H(r.id)}, so shown at ${i(a.values())}`,c.length>0?`${h}; also at ${i(c)}.`:`${h}.`}function en(t,e){let n=Math.max(0,...e.map(s=>t.viewports.get(s.viewport)?.width??0));return T(Math.max(240,Math.min(640,n*.4)))}function tn(t,e){let n=t.data.preview,{product:s,commit:r}=t.data,i=t.ownSizes,a=new le(null,"100% 0px"),l=b=>n.sections.find(E=>E.kind===b),c=he(l("changed")).filter(b=>b.root==="head"),u=he(l("added")),d=n.sections.filter(b=>b.kind==="exploration"),h=[...he(l("changed")),...u,...d.flatMap(he)],f=l("archived"),m=he(f),g=f?.files??[],w=new Set(c.map(b=>b.path)).size,p=new Set(u.map(b=>b.path)).size,v=m.length>0?new Set(m.map(b=>b.path)).size:g.length,S=n.shared?.tokens.length??0,C=i?null:gt(t.data.viewports)?.id;C&&(t.filters={...t.filters,viewports:new Set([C])});let F=i||h.length===0?null:pe(t.data.viewports,t.size,b=>t.setFilters({viewports:new Set([b])}),{extraClass:"top-bar__center"}),z=o("header",{class:F?"top-bar top-bar--centered top-bar--board":"top-bar"},o("div",{class:"top-bar__start"},ke(!0),o("div",{class:"top-bar__product"},o("strong",{text:s.name}),o("span",{text:"Preview"}))),F?F.el:o("span",{class:"top-bar__spacer"}),o("div",{class:"top-bar__end"},o("a",{class:"button dv-board-link",attrs:{href:n.boardHref}},o("span",{class:"desktop-only",text:"Open the full board"}),o("span",{class:"phone-only",text:"Full board"})))),q=`Review here, then approve by merging the pull request.${F&&t.data.viewports.length>1?" Changes show at one size at a time: pick another size in the top bar.":""}`,V=(b,E,k)=>b>0?o("a",{attrs:{href:`#${k}`}},o("b",{text:String(b)}),E):o("span",{class:"dv-summary-zero"},o("b",{text:"0"}),E),G=o("section",{class:"pr-banner dv-banner"},o("div",{class:"container pr-banner__layout"},o("div",null,o("p",{class:"pr-banner__eyebrow"},x("commit"),`Pull request preview${r?.date?` \xB7 ${Ce(r.date)}`:""}`),o("h1",{class:"pr-banner__title",text:n.label??`${s.name} design preview`}),o("div",{class:"commits"},Qt("Base",n.base),x("arrow","commits__arrow"),Qt("Head",r)),o("p",{class:"pr-banner__note",text:q})),o("nav",{class:"change-summary",attrs:{"aria-label":"Changes"}},V(w,"changed","changed"),V(p+d.length,"added","added"),V(v,"archived","archived"),V(S,S===1?"token change":"token changes","tokens")))),J=new Map,_=o("div",{class:"container"}),U=o("main",{class:"dv-content"},_),W=()=>{if(typeof window.scrollBy!="function"||typeof z.getBoundingClientRect!="function")return null;let b=z.getBoundingClientRect().bottom;return{bar:b,line:b+Math.max(0,window.innerHeight-b)/4}},K=null;for(let b of["wheel","touchstart","pointerdown","keydown"])window.addEventListener?.(b,()=>{K=null},{capture:!0,passive:!0});let Ne=b=>{let E=W(),k=E?K?.isConnected?K:[..._.querySelectorAll(Bn)].find(O=>O.getBoundingClientRect().bottom>E.line):null,M=k?.getBoundingClientRect().top;b();let A=k&&M!==void 0?k.getBoundingClientRect().top-M:0;A&&window.scrollBy(0,A)},ee=new Oe(t.viewports,Ne),j=(b,E)=>o("div",{class:"section-head"},o("h2",{text:b}),o("p",{class:"section-head__meta",text:E})),Y=()=>{a.clear(),_.replaceChildren();let b=l("changed"),E=b?Le(b.lines,t.size,i):[];if(E.length>0){let[k,M]=lt(c),A=E.flatMap(I=>I.cells).filter(I=>I.root==="head"),O=o("section",{class:"dv-sec",attrs:{id:"changed","data-kind":"changed"}},j(`${L(w,k,M)} changed`,`Same file, different content. ${Zt(t,c,A,!0)}`));for(let I of E){let y=I.cells.find(N=>N.root==="base"),P=I.cells.find(N=>N.root==="head");if(!y||!P)continue;let $=`${P.path}@${P.viewport}`,R=J.get($)??{overlay:!1,split:50};J.set($,R),O.append(Jt(t,y,P,a,R,ee))}_.append(O)}if(u.length>0||d.length>0){let[k,M]=lt(u),A=Le(l("added")?.lines??[],t.size,i).flatMap($=>$.cells),O=d.map($=>({s:$,lines:Le($.lines,t.size,i)})),I=[...u,...d.flatMap(he)],y=[...A,...O.flatMap($=>$.lines.flatMap(R=>R.cells))],P=o("section",{class:"dv-sec",attrs:{id:"added","data-kind":"added"}},j(u.length>0?`${L(p,k,M)} added`:`${L(d.length,"question")} added`,`New files in this pull request. ${Zt(t,I,y,!1)}`));if(A.length>0){let $=o("div",{class:"frame-grid dv-grid dv-added",style:{"--dv-min":en(t,A)}});for(let R of A)$.append(ge(t,R,a,{cardTag:"Added",whole:ee.group([R])}));P.append($)}for(let{s:$,lines:R}of O)R.length!==0&&P.append(ot(t,$,R,(N,fe)=>{let xe=o("div",{class:"frame-grid dv-grid",style:{"--dv-min":en(t,N)}});for(let qe of N)xe.append(ge(t,qe,a,{above:fe(qe),whole:ee.group([qe])}));return xe}));_.append(P)}if(m.length>0||g.length>0){let k=o("section",{class:"dv-sec",attrs:{id:"archived","data-kind":"archived"}},j(`${v} archived`,"Moved out of the board, kept in the repo."));for(let M of m){let A=null;A=Q(t,M,a,()=>t.focus(M,A?.querySelector(".dv-frame-open")??void 0)),k.append(o("div",{class:"archived-row dv-frame",attrs:{"data-path":M.path,"data-viewport":M.viewport,"data-root":M.root}},A,o("div",{class:"archived-row__text"},o("h3",{text:M.title}),o("p",{text:"Moved to the archive in this pull request. It stays on the board under Archive."}),o("span",{class:"frame__label"},...st(M.path))),o("span",{class:"tag"},x("archive"),"Archived")))}g.length>0&&k.append(Re(t,g)),_.append(k)}n.shared&&_.append(Un(t,n)),_.childElementCount===0&&_.append(o("p",{class:"dv-empty",text:"No design files changed in this pull request."}))},te=()=>{let b=W();if(!b)return null;for(let E of _.querySelectorAll(Yt)){let k=E.getBoundingClientRect();if(k.bottom>b.line)return{path:E.dataset.path??"",top:k.top,share:k.top<b.bar&&k.height>0?(b.line-k.top)/k.height:null}}return null},ye=b=>{let E=b&&[..._.querySelectorAll(Yt)].find(A=>A.dataset.path===b.path),k=W();if(!b||!E||!k)return;let M=E.getBoundingClientRect();window.scrollBy(0,M.top-(b.share===null?b.top:k.line-b.share*M.height))},De=b=>{let E=W(),k=E?b.getBoundingClientRect():null;!E||!k||k.height<=window.innerHeight-E.bar?b.scrollIntoView({block:"center",inline:"nearest"}):(k.bottom<=E.bar||k.top>=window.innerHeight)&&window.scrollBy(0,k.top-E.bar-16),K=b};t.onFilters(()=>{F?.set(t.size);let b=te();Y(),ye(b)}),t.jump=b=>{let E=h.filter(y=>y.path===b.path&&y.root===b.root),k=E.find(y=>y.viewport===Xe(y,t.size,i)),M=i&&k?k:b;t.select(M),!i&&E.length>0&&k?.viewport!==M.viewport&&t.setFilters({viewports:new Set([M.viewport])});let A=[...e.querySelectorAll(".dv-frame")].find(y=>y.dataset.path===M.path&&y.dataset.root===M.root&&y.dataset.viewport===M.viewport),O=[...e.querySelectorAll(".dv-comparison")].find(y=>y.dataset.path===M.path&&y.dataset.viewport===M.viewport),I=A??O;I&&De(I),I?.querySelector(".dv-frame-open, button, a")?.focus({preventScroll:!0})},e.classList.add("dv-doc-app"),e.append(z,G,U),Y(),setTimeout(()=>{F?.el.classList.contains("switcher")&&ue(F.el)},0)}function Un(t,e){let n=e.shared;if(!n)return o("div");let s=d=>d&&typeof CSS<"u"&&CSS.supports("color",d)?o("i",{class:"token-table__swatch",style:{background:d},attrs:{"aria-hidden":"true"}}):null,r=d=>o("td",null,d===null?o("span",{class:"dv-none",text:"(none)"}):o("span",null,s(d),d)),i=d=>o("tr",{attrs:{"data-token":d.name}},o("td",null,d.name,d.context&&d.context!==":root"?o("span",{class:"dv-token-where",text:` ${d.context}`}):null,d.file!=="design-system/tokens.css"?o("span",{class:"dv-token-where",text:` (${d.file.replace(/^design-system\//,"")})`}):null),r(d.old),o("td",{class:"dv-token-arrow",text:"\u2192"}),r(d.new)),a=[...new Set(n.tokens.map(d=>d.file.replace(/^design-system\//,"")))],l=a.length>0?` in ${a.join(" and ")}`:"",c=n.files.some(d=>d==="design-system/tokens.css"||d==="design-system/components.css"),u=n.tokens.length;return o("details",{class:"collapsed dv-shared",attrs:{id:"tokens","data-kind":"tokens"}},o("summary",null,x("collapsed"),o("h2",null,"Token changes ",o("span",{text:`(${u})`})),o("p",null,u>0?`${L(u,"value")} changed${l}.`:`${L(n.files.length,"shared file")} changed.`,c?o("span",{class:"dv-warning",text:" Every screen may be affected."}):null)),o("div",{class:"collapsed__body"},u>0?o("table",{class:"token-table"},o("tbody",null,...n.tokens.map(i))):null,Re(t,n.files.map(d=>({path:d,root:"head"})))))}var we=class{key;stored={};constructor(e){this.key=`${ne}:tree:${e}`;try{let n=JSON.parse(localStorage.getItem(this.key)??"{}");n&&typeof n=="object"&&!Array.isArray(n)&&(this.stored=n)}catch{}}get(e,n){return typeof this.stored[e]=="boolean"?this.stored[e]:n}set(e,n){this.stored[e]=n;try{localStorage.setItem(this.key,JSON.stringify(this.stored))}catch{}}};function Z(t,e,n,s,r,i,a,l=!1){let c=t.get(e,i),u=x(c?"expanded":"collapsed"),d=o("button",{class:`tree-row tree-row--${n}${l?" tree-row--quiet":""}`,attrs:{type:"button","aria-expanded":String(c),"data-branch":e}},u,o("span",{text:s}),r?o("span",{class:"tree-row__count",text:r}):null),h=o("div",{class:"dv-tree-group",attrs:{role:"group",hidden:!c}},...a);return d.addEventListener("click",()=>{let f=d.getAttribute("aria-expanded")!=="true";d.setAttribute("aria-expanded",String(f)),h.hidden=!f;let m=x(f?"expanded":"collapsed");u.replaceWith(m),u=m,t.set(e,f)}),[d,h]}function Wn(t){let e=t.closest(".dv-tree-group");for(;e;){let n=e.previousElementSibling;n?.getAttribute("aria-expanded")==="false"&&n.click(),e=e.parentElement?.closest(".dv-tree-group")??null}}function Ie(t,e,n,s,r="state",i=""){let a=e[0],l=o("a",{class:`tree-row tree-row--${r}`,attrs:{"data-path":a?.path,href:a?ve(a,"board"):"#"}},r==="screen"?x("blank"):null,r==="screen"?o("span",{text:n}):n,i?o("span",{class:"tree-row__count",text:i}):null);return l.addEventListener("click",c=>{c.preventDefault();let u=e.find(d=>t.atSize(d))??a;u&&s(u)}),l}function nn(t){let e=new Map;for(let n of t){let s=e.get(n.path)??[];s.push(n),e.set(n.path,s)}return[...e.values()]}var on=()=>o("div",{class:"tree-sep",attrs:{role:"separator"}});function sn(t,e){let n=new we(t.data.product.slug),s=o("nav",{class:"tree",attrs:{"aria-label":"Screens"}}),r=t.data.board,i=m=>m.lines.flatMap(g=>g.cells),a=r.find(m=>m.kind==="design-system");if(a){let m=nn(i(a)),g=m.filter(z=>z[0]?.path.startsWith("design-system/brand/")),w=m.filter(z=>!z[0]?.path.startsWith("design-system/brand/")),p=[];a.overview&&p.push(o("a",{class:"tree-row tree-row--screen",attrs:{href:`${t.data.roots.head}${a.overview.href}`}},x("blank"),o("span",{text:"Overview"})));let v=a.assets??[],S=a.filesHref&&v.length>0?a.filesHref:null;S&&p.push(o("a",{class:"tree-row tree-row--screen",attrs:{href:`${t.data.roots.head}${S}`,"data-files":""}},x("blank"),o("span",{text:"Files"}),o("span",{class:"tree-row__count",text:String(v.length)})));let C=z=>z.map(q=>Ie(t,q,q[0]?.title??"",e));g.length>0&&p.push(...Z(n,"design:brand","screen","Brand pages",String(g.length),!1,C(g))),w.length>0&&p.push(...Z(n,"design:components","screen","Components",String(w.length),!1,C(w)));let F=m.length+(a.overview?1:0)+(S?1:0);s.append(...Z(n,"design","flow","Design system",String(F),!0,p),on())}let l=Fe(t.data);for(let m of l){let g=m.screens.reduce((p,v)=>p+v.states.length,0),w=m.screens.map(p=>{let v=p.states.map(S=>Ie(t,S.cells,H(S.id),e));return Z(n,`screen:${m.id}/${p.id}`,"screen",H(p.id),String(p.states.length),!1,v)});s.append(...Z(n,`flow:${m.id}`,"flow",m.title,String(g),!1,w.flat()))}let c=r.filter(m=>m.kind==="exploration"),u=r.find(m=>m.kind==="archive");if((c.length>0||u)&&s.append(on()),c.length>0){let m=c.map(g=>{let w=(g.exploration?.options.map(p=>p.id)??[...new Set(i(g).map(p=>p.col))]).map(p=>p.toUpperCase()).join(", ");return Ie(t,i(g),H(g.title.replace(/^\d{4}-\d{2}-\d{2}-?/,""))||g.title,e,"screen",w)});s.append(...Z(n,"options","flow","Open options",`${c.length} waiting`,!1,m))}if(u){let m=nn(i(u)),g=u.files??[],w=m.map(p=>Ie(t,p,p[0]?.title??"",e));s.append(...Z(n,"archive","flow","Archive",String(m.length||g.length),!1,w,!0))}let d=()=>{let m=t.selected;for(let g of s.querySelectorAll(".tree-row--state")){let w=!!m&&g.getAttribute("data-path")===m.path&&m.root==="head";g.classList.toggle("is-selected",w),w?(g.setAttribute("aria-current","true"),Wn(g)):g.removeAttribute("aria-current")}};t.onSelect(d);let h=l.reduce((m,g)=>m+g.screens.reduce((w,p)=>w+p.states.length,0),0),{commit:f}=t.data;return o("aside",{class:"sidebar sidebar--drawer dv-sidebar",attrs:{id:"dv-screens","aria-label":"Screens"}},o("div",{class:"sidebar__head"},o("h2",null,"Screens",o("span",{text:String(h)})),o("button",{class:"button button--quiet button--small button--icon desktop-only",attrs:{type:"button","aria-label":"Hide the sidebar","data-sidebar-hide":""}},x("sidebar")),o("button",{class:"button button--quiet button--icon phone-only",attrs:{type:"button","aria-label":"Close the screens list","data-drawer-close":""}},x("close"))),s,f?o("div",{class:"sidebar__foot"},"Built from ",o("span",{class:"sha",text:ae(f.sha)}),f.date?o("br"):null,f.date?Ce(f.date):null):null)}function rn(t){let e=[...t.querySelectorAll(".dv-thumb[data-width]")];if(e.length===0||typeof ResizeObserver>"u")return;let n=new ResizeObserver(s=>{for(let r of s){let i=r.target,a=Number(i.dataset.width);a>0&&r.contentRect.width>0&&i.style.setProperty("--dv-scale",String(r.contentRect.width/a))}});for(let s of e)n.observe(s)}var an=`${ne}:hub:reviews`;function Kn(){try{let t=localStorage.getItem(an);return t==="open"?!0:t==="closed"?!1:null}catch{return null}}function jn(t){try{localStorage.setItem(an,t?"open":"closed")}catch{}}function ln(t=document){let e=t.querySelector(".review-panel"),n=e?.querySelector("[data-reviews-toggle]");if(!e||!n)return;let s=i=>{e.dataset.open=String(i),n.setAttribute("aria-expanded",String(i))};s(Kn()??!oe(Ae).matches),n.addEventListener("click",()=>{let i=e.dataset.open!=="true";s(i),jn(i)});let r=e.querySelector("[data-reviews-more]");r?.addEventListener("click",()=>{let i=r.getAttribute("aria-expanded")!=="true";r.setAttribute("aria-expanded",String(i));for(let a of e.querySelectorAll(".review-row[data-extra]"))a.hidden=!i})}function Gn(t,e){let n=Wt(t);n&&(t.filters={...t.filters,viewports:new Set([n])});let s=new ze(t,t.data.board),r=Kt(t,()=>s.found),i=o("div",{class:"drawer-scrim"}),a=new we(t.data.product.slug),l=sn(t,d=>{c(!1),t.navigate(d,"board")}),c=d=>{l.classList.toggle("is-open",d),i.classList.toggle("is-open",d),r.screens.setAttribute("aria-expanded",String(d)),d&&l.querySelector("[data-drawer-close]")?.focus()},u=d=>{e.dataset.sidebar=d?"shown":"hidden",a.set("sidebar",d)};e.dataset.sidebar=a.get("sidebar",!0)?"shown":"hidden",r.screens.addEventListener("click",()=>c(!0)),i.addEventListener("click",()=>c(!1)),l.querySelector("[data-drawer-close]")?.addEventListener("click",()=>{c(!1),r.screens.focus()}),l.querySelector("[data-sidebar-hide]")?.addEventListener("click",()=>{u(!1),r.showSidebar.focus()}),r.showSidebar.addEventListener("click",()=>u(!0)),document.addEventListener("keydown",d=>{if(d.ctrlKey||d.metaKey||d.altKey||document.querySelector(".dv-focus"))return;let h=d.target;typeof h?.closest=="function"&&h.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||(d.key==="Escape"&&l.classList.contains("is-open")?(c(!1),r.screens.focus()):d.key==="/"&&(d.preventDefault(),r.focusSearch()))}),t.jump=d=>s.jump(d),e.classList.add("dv-board-app"),e.append(r.el,r.searchRow,o("div",{class:"dv-main"},l,i,s.el)),s.render()}function Xn(){let t=document.getElementById("dv-app"),e=document.getElementById("dv-data")?.textContent;if(!t||!e){rn(document),ln(document);return}let n=new Pe(JSON.parse(e));n.data.kind==="preview"&&n.data.preview?tn(n,t):Gn(n,t),It(n,(s,r)=>Xt(n,s,r))}Xn();})();
|
|
3
|
+
${t.label}`,e)}function re(t){return t.viewports[0]??t.viewport}function Xe(t,e,n){return!n&&t.viewports.includes(e)?e:re(t)}function Le(t,e,n){let s=[],r;for(let i of t){i.heading!==void 0&&(r=i.heading);let a=i.cells.filter(c=>c.viewport===Xe(c,e,n));if(a.length===0)continue;let l={cells:a};r!==void 0&&(l.heading=r),r=void 0,s.push(l)}return s}function yt(t,e,n){return`${t} ${e.path} @ ${n}${e.root==="base"?" (base)":""}`}function xt(t,e){return(e.root==="base"?t.roots.base:t.roots.head)+e.path.split("/").map(encodeURIComponent).join("/")}function St(t,e){return me(t,e.query)}var kt=(t,e)=>t<e?-1:t>e?1:0;function Me(t){return t.slice(0,t.lastIndexOf("/")+1)}function Et(t){let e=new Map;for(let n of[...t].sort((s,r)=>kt(Me(s.path),Me(r.path))||kt(s.path,r.path))){let s=e.get(Me(n.path))??[];s.push(n),e.set(Me(n.path),s)}return[...e]}var gn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(t){let e=t.replace(/[-_]+/g," ").trim();return e?e[0].toUpperCase()+e.slice(1):t}function M(t,e,n=`${e}s`){return`${t} ${t===1?e:n}`}function Je(t){let e=t?/^(\d{4})-(\d{2})-(\d{2})/.exec(t):null;return e?`${Number(e[3])} ${gn[Number(e[2])-1]??e[2]} ${e[1]}`:""}function Ce(t){let e=Je(t),n=t?/T(\d{2}):(\d{2})/.exec(t):null;return e&&n?`${e}, ${n[1]}:${n[2]}`:e}function ie(t,e=" \xB7 "){return`${A(t.id)}${e}${t.width} \xD7 ${t.height}`}function Lt(t){return`PR ${t}`}function ae(t){return t.slice(0,7)}function Mt(t){return t.width!==null&&t.height!==null?`${t.width} \xD7 ${t.height}`:null}function Ye(t){return t.slice(t.lastIndexOf("/")+1)}function V(t,e="Copy link"){let n=o("button",{class:"copy-link",text:e,attrs:{type:"button",title:"Copy a reference and link to this frame"}}),s;return n.addEventListener("click",r=>{r.stopPropagation(),ft(t()).then(i=>{n.replaceChildren(...i?[x("check"),"Copied"]:["Copy failed"]),n.classList.toggle("is-copied",i),n.dataset.state=i?"ok":"failed",s!==void 0&&clearTimeout(s),s=setTimeout(()=>{n.replaceChildren(e),n.classList.remove("is-copied"),delete n.dataset.state},2e3)})}),n}function _e(t,e=!0){let n=/ · ([^·]+)$/.exec(t.label),r=(n?t.label.slice(0,n.index):t.label).split(" / "),i=r.pop()??"";return o("span",{class:"frame__label",attrs:{title:t.label}},r.length?`${r.join(" / ")} / `:"",o("b",{text:i}),n&&e?o("i",{text:` \xB7 ${n[1]}`}):null)}function Z(t,e,n,s,r="",i){let a=t.viewports.get(e.viewport),l=a?.width??1,c=a?.height??1,p=o("div",{class:"dv-view",style:{width:z(l),height:z(c)}}),d=o("div",{class:`frame__shot dv-shot${r?` ${r}`:""}${t.isSelected(e)?" is-selected":""}`,style:{"aspect-ratio":`${l} / ${c}`,"max-width":z(l)},attrs:{"data-path":e.path,"data-viewport":e.viewport,"data-root":e.root}},o("span",{class:"dv-placeholder",text:e.title}),p);if(s){let m=o("button",{class:"dv-frame-open",attrs:{type:"button","aria-label":`Open ${e.caption?`${e.caption}: `:""}${e.label}`}});m.addEventListener("click",s),d.append(m)}n.scale(d,l);let u=t.url(e),h=()=>o("iframe",{class:"dv-iframe",attrs:{src:u,title:e.label,width:l,height:c,tabindex:-1,"aria-hidden":"true"}});return n.observe(p,i?i.frames(e,h):h),i?.fit(m=>{p.style.height=z(m),d.style.setProperty("aspect-ratio",`${l} / ${m}`)}),d}function ge(t,e,n,s={}){let r=null,i=Z(t,e,n,()=>{s.canOpen&&!s.canOpen()||t.focus(e,r??void 0)},"",s.whole);r=i.querySelector(".dv-frame-open");let a=o("figcaption",{class:"frame__caption"},_e(e),$e(t,e,s.cardTag?o("span",{class:"tag",text:s.cardTag}):V(()=>t.ref(e,e.viewport))));return o("figure",{class:`frame dv-frame${s.cardTag?" frame--card":""}`,attrs:{"data-path":e.path,"data-viewport":e.viewport,"data-root":e.root}},s.above??null,i,a,e.note?o("p",{class:"dv-note",text:e.note}):null)}function vn(t,e){return t.url({path:e.path,root:"head"})}function Ct(t){return t.data.change?` from ${t.data.change}`:""}function Te(t,e){return`Download ${e.format}${Ct(t)}`}function Qe(t,e,n){let s={href:vn(t,e),download:Ye(e.path),"data-download":e.path};return n&&(s["aria-label"]=n),s}function _t(t){let e=Mt(t);return e?`, ${e}`:""}function bn(t,e){return o("a",{class:"download-link",attrs:{...Qe(t,e),title:Ye(e.path)}},x("download"),Te(t,e))}function $e(t,e,n){return e.download?o("span",{class:"frame__links"},bn(t,e.download),n):n}function $t(t,e,n){let s=`Download ${n.format} of ${e.title}${Ct(t)}${_t(n)}`;return o("a",{class:"button media-group__download",attrs:Qe(t,n,s)},x("download"),Te(t,n))}function Tt(t,e){return o("a",{class:"button button--icon-on-phone",attrs:Qe(t,e,`${Te(t,e)}${_t(e)}`)},x("download"),o("span",{class:"desktop-only",text:Te(t,e)}))}function Ht(t,e,n,s){let r=`${t.data.roots.head}${e}`,i=Et(n),a=i.flatMap(([,l])=>l).slice(0,4);return o("figure",{class:"frame dv-files-card",attrs:{"data-kind":"files"}},o("a",{class:"files-card",attrs:{href:r,"aria-label":`Open Files: ${M(n.length,"image")} to download`},style:s?{"aspect-ratio":`${s.width} / ${s.height}`}:{}},o("span",{class:"files-card__thumbs",attrs:{"aria-hidden":"true"}},...a.map(l=>o("span",{class:"files-card__thumb",attrs:{"data-path":l.path}},o("img",{attrs:{src:t.url({path:l.path,root:"head"}),alt:"",loading:"lazy",decoding:"async"}})))),o("span",{class:"files-card__body"},o("span",{class:"files-card__title",text:"Files"}),o("span",{class:"files-card__meta",text:`${M(n.length,"image")} in ${M(i.length,"folder")}, ready to download`}))),o("figcaption",{class:"frame__caption"},o("span",{class:"frame__label"},"design-system / ",o("b",{text:"files"})),V(()=>`${t.data.product.slug} design-system/assets/ (files)
|
|
4
|
+
${new URL(r,window.location.href).href}`)))}function Ze(t){return Math.round(Math.min(480,Math.max(200,t*.2)))}function et(t,e,n,s,r=1){return t<=0||e<=0?1:Math.max(.01,Math.min(r,n/t,s/e))}var le=class{io;slots=new Map;near=new Set;live=[];pending=0;sizer=null;constructor(e,n){this.io=new IntersectionObserver(s=>{for(let r of s)r.isIntersecting?this.near.add(r.target):this.near.delete(r.target);this.refresh()},{root:e,rootMargin:n})}observe(e,n){this.slots.set(e,{host:e,make:n,frame:null}),this.io.observe(e)}scale(e,n){e.dataset.width=String(n),!(typeof ResizeObserver>"u")&&(this.sizer??=new ResizeObserver(s=>{for(let r of s){let i=r.target,a=Number(i.dataset.width);a>0&&r.contentRect.width>0&&i.style.setProperty("--dv-scale",String(r.contentRect.width/a))}this.refreshSoon()}),this.sizer.observe(e))}forget(e){let n=this.slots.get(e);this.io.unobserve(e),n?.frame?.remove(),this.slots.delete(e),this.near.delete(e),this.live=this.live.filter(s=>s!==n)}clear(){this.sizer?.disconnect(),this.sizer=null;for(let e of this.slots.values())this.io.unobserve(e.host),e.frame?.remove();this.slots.clear(),this.near.clear(),this.live=[]}refreshSoon(){this.pending||(this.pending=requestAnimationFrame(()=>{this.pending=0,this.refresh()}))}refresh(){for(let s of this.near){let r=this.slots.get(s);!r||r.frame||r.host.getBoundingClientRect().width<48||(r.frame=r.make(),r.host.prepend(r.frame),this.live.push(r))}if(this.live.length<=64)return;let e=[],n=this.live.length-64;for(let s of this.live)n>0&&!this.near.has(s.host)?(s.frame?.remove(),s.frame=null,n--):e.push(s);this.live=e}};var wn={photo:"Photo",logo:"Logo"},yn={y:22,x:120},ce=t=>`${Math.round(t*1e4)/100}%`;function At(t){let[e,n]=t.split(" ");return e==="cover"?`cover cover--${n}`:e==="image"?`outline__image${n?` outline__image--${n}`:""}`:`shape-${e}${n?` shape-${e}--${n}`:""}`}function tt(t){return{"--x":String(t.x),"--y":String(t.y),"--w":String(t.w),"--h":String(t.h)}}function nt(t){return{"data-path":t.path,"data-viewport":t.viewport,"data-root":t.root}}function Rt(t,e){return o("span",{class:"frame__label"},o("b",{text:t}),o("i",{text:` \xB7 ${e}`}))}function Pt(t,e,n,s,r,i,a={}){let l=o("div",{class:"dv-view",style:{width:z(n.width),height:z(n.height),...a}});s.scale(r,i);let c=t.url(e);return s.observe(l,()=>o("iframe",{class:"dv-iframe",attrs:{src:c,title:e.label,width:n.width,height:n.height,tabindex:-1,"aria-hidden":"true"}})),l}function xn(t,e){let n=document.createElement("span"),s=["halo","line"].map(r=>`<polygon class="safe-area__${r}" points="${t}"/>`).join("");return n.innerHTML=`<svg class="safe-area" viewBox="0 0 ${e.width} ${e.height}" preserveAspectRatio="none" aria-hidden="true">${s}</svg>`,n.firstElementChild}function Sn(t,e){let n=t.trim().split(/\s+/).map(i=>i.split(",").map(Number)),s=Math.min(...n.map(([i])=>i??0)),r=Math.min(...n.map(([,i])=>i??0));return{"--safe-left":ce(s/e.width),"--safe-top":ce(r/e.height)}}function kn(t,e,n,s,r,i,a){let{area:l,image:c,cut:p}=r,d=n.safe&&n.upload?{points:n.safe,upload:n.upload}:null,u=o("span",{class:`outline__shape ${At(s[1])}${p?" outline__image--cut":""}`,attrs:{"data-at":s[0]},style:{...tt(l),...d?Sn(d.points,d.upload):{}}}),h={left:ce((c.x-l.x)/l.w),top:ce((c.y-l.y)/l.h)};if(u.append(Pt(t,e,i,a,u,i.width*l.w/c.w,h)),d&&u.append(xn(d.points,d.upload),o("span",{class:"mark-label mark-label--safe",text:"Safe area"})),p){let[m,g]=p.axis==="y"?["top","bottom"]:["left","right"];u.append(o("span",{class:`crop-edge crop-edge--${m}`}),o("span",{class:`crop-edge crop-edge--${g}`}))}return u}function En(t,e,n,s,r){let{area:i,image:a,cut:l}=n;if(!l)return null;let c=o("span",{class:"outline__shape outline__cut",attrs:{"data-at":"cut"},style:tt(a)}),p=Pt(t,e,s,r,c,s.width);p.classList.add("media"),c.append(p);let d=`Cut off: ${l.px} px`,[u,h]=l.axis==="y"?["top","bottom"]:["left","right"],m=l.axis==="y"?ce((i.y-a.y)/2/a.h):ce((i.x-a.x)/2/a.w),g=`clamp(0, (var(--dv-scale) * ${l.px} - ${yn[l.axis]}) * 100, 1)`;for(let[v,f]of[[u,m],[h,`calc(100% - ${m})`]])c.append(o("span",{class:`mark-label mark-label--${v}`,text:d,style:{[l.axis==="y"?"top":"left"]:f,opacity:g}}));return c}function zt(t,e,n,s,r,i){let a=n[s],l=Se(n,a,r),c=o("div",{class:`outline${s==="phone"?" outline--phone":""}`,attrs:{role:"img","aria-label":`${n.name} at ${s} width, with the image in place`,"data-outline":`${n.id}-${s}`},style:{"--u":`calc(100cqw / ${a.width})`,...a.style}});for(let u of l.shapes){if(We(u)){let v=En(t,e,l,r,i),f=kn(t,e,n,u,l,r,i);if(l.cut?.axis==="x")for(let y of[v,f])y?.style.setProperty("z-index","1");v&&c.append(v),c.append(f);continue}let[h,m]=u[1].split(" "),g=h==="cover"?wn[m??""]:void 0;c.append(o("span",{class:`outline__shape ${At(u[1])}`,attrs:{"data-at":u[0]},style:tt(Ue(u))},g?o("span",{class:"mark-label",text:g}):null))}let p=o("div",{class:`frame__shot dv-shot${t.isSelected(e)?" is-selected":""}`,style:{"aspect-ratio":`${a.width} / ${l.height}`},attrs:nt(e)},c),d=o("button",{class:"dv-frame-open",attrs:{type:"button","aria-label":`Open ${e.label} (${s}, in context)`}});return d.addEventListener("click",()=>t.focus(e,d)),p.append(d),o("figure",{class:`frame frame--${s}`,attrs:{"data-media-frame":s}},p,o("figcaption",{class:"frame__caption"},Rt(s,"in context"),V(()=>t.ref(e,e.viewport,`${s}, in context`))))}function Ln(t,e,n,s){let r=null,i=Z(t,e,s,()=>t.focus(e,r??void 0));return r=i.querySelector(".dv-frame-open"),o("figure",{class:"frame frame--own dv-frame",attrs:{...nt(e),"data-media-frame":"own"}},i,o("figcaption",{class:"frame__caption"},Rt("on its own",`${n.width} \xD7 ${n.height}`),V(()=>t.ref(e,e.viewport))),e.note?o("p",{class:"dv-note",text:e.note}):null)}function Mn(t,e,n,s,r){let i=`${s.width} \xD7 ${s.height}`;if(n.upload)i=`upload ${i}`;else if(r&&n.ratios)i+=`, shown cut to ${(r.axis==="y"?n.ratios.tallest:n.ratios.widest).join(":")}`;else{let l=pt(s.width,s.height);l&&(i+=`, ${l}`)}let a=[];return n.covered&&a.push(["covered",n.covered]),n.safe&&a.push(["safe","Safe for text and key marks"]),r&&a.push(["cut",`Cut off: ${r.px} px ${r.axis==="y"?"top and bottom":"left and right"}`]),a.length===0&&n.whole&&a.push([null,n.whole]),o("div",{class:"media-group__head"},o("div",{class:"media-group__title"},o("h3",{text:e.title}),o("p",null,`${n.name} \xB7 `,o("code",{text:n.id}),` \xB7 ${i} \xB7 sizes checked ${Je(n.checked)}`)),o("ul",{class:"legend"},...a.map(([l,c])=>o("li",{attrs:l?{"data-key":l}:{}},l?o("span",{class:`key key--${l}`}):null,c))),e.download?$t(t,e,e.download):null)}function Cn(t,e){let n=s=>s.width/Se(t,s,e).height;return[n(t.desktop),n(t.phone),e.width/e.height].map(s=>`minmax(0, ${Math.round(s*1e4)/1e4}fr)`).join(" ")}function Ft(t,e,n,s){let r=t.viewports.get(e.viewport),i={width:r?.width??1,height:r?.height??1},a=n.layout==="wide",l=o("div",{class:`media-grid${a?" media-grid--wide":""}`,style:{"--media-columns":a?n.columns:Cn(n,i)}},zt(t,e,n,"desktop",i,s),zt(t,e,n,"phone",i,s),Ln(t,e,i,s));return o("article",{class:"media-group dv-media",attrs:{...nt(e),"data-frame":n.id}},Mn(t,e,n,i,Se(n,n.desktop,i).cut),l)}var Ae="(max-width: 767px)";function He(t,e){return e.lines.map(n=>{let s={cells:n.cells.filter(r=>t.viewports.has(r.viewport)&&t.visible(r))};return n.heading&&(s.heading=n.heading),s}).filter(n=>n.cells.length>0)}var ze=class{ctx;sections;el;loader;shown=0;cardsShown=0;archiveOpen=!1;constructor(e,n){this.ctx=e,this.sections=n,this.el=o("main",{class:"dv-wall",attrs:{id:"dv-wall",tabindex:-1}}),this.loader=new le(this.el,"50% 0px"),e.onFilters(()=>this.render()),e.onSelect(()=>this.markSelected()),mt(()=>this.loader.refreshSoon())}get frames(){return this.shown}get found(){return this.shown+this.cardsShown}jump(e){let n=this.ctx.ownSizes?this.ownFrame(e):e,s=this.sections.some(a=>a.kind==="archive"&&a.lines.some(l=>l.cells.some(c=>c.path===n.path)));s&&(this.archiveOpen=!0),this.ctx.select(n),!this.ctx.ownSizes&&this.ctx.size!==n.viewport||this.ctx.filters.query?this.ctx.setFilters(this.ctx.ownSizes?{query:""}:{query:"",viewports:new Set([n.viewport])}):s&&this.render();let r=[...this.el.querySelectorAll(".dv-frame")].find(a=>a.dataset.path===n.path&&a.dataset.viewport===n.viewport&&a.dataset.root===n.root);if(!r)return;let i=r.closest(".dv-media");(i??r).scrollIntoView({block:i?"start":"center",inline:"nearest"}),!i?.contains(document.activeElement)&&r.querySelector(".dv-frame-open")?.focus({preventScroll:!0})}ownFrame(e){if(e.viewport===re(e))return e;for(let n of this.sections)for(let s of n.lines){let r=s.cells.find(i=>i.path===e.path&&i.root===e.root&&i.viewport===re(i));if(r)return r}return e}render(){let e=this.el.scrollTop;this.loader.clear(),this.el.replaceChildren(),this.shown=0,this.cardsShown=0;let n=this.ctx.ownSizes?void 0:this.ctx.viewports.get(this.ctx.size);n&&this.el.style.setProperty("--dv-min",z(Ze(n.width)));let s=_n(this.ctx);s&&this.el.append(s);let r=null,i=0;for(let a of this.sections){if(a.kind==="exploration"){let c=this.optionSet(a);if(!c)continue;r||(r=o("section",{class:"dv-section",attrs:{"data-kind":"exploration",id:"dv-options"}}),this.el.append(r)),r.append(c),i++;continue}let l=a.kind==="archive"?this.archive(a):a.kind==="design-system"?this.designSystem(a):this.section(a);l&&this.el.append(l)}if(r){let a=o("span",{class:"tag tag--strong"},x("clock"),"Waiting for a pick");r.prepend(this.head("Open options",M(i,"question"),"explorations/",[a]))}this.el.childElementCount===(s?1:0)&&this.el.append(o("p",{class:"dv-empty",text:this.ctx.filters.query?"No frames match the search.":"Nothing is drawn at this size."})),this.el.scrollTop=e}markSelected(){for(let n of this.el.querySelectorAll(".dv-shot.is-selected"))n.classList.remove("is-selected");let e=this.ctx.selected;if(e)for(let n of this.el.querySelectorAll(".dv-shot"))n.dataset.path===e.path&&n.dataset.viewport===e.viewport&&n.dataset.root===e.root&&n.classList.add("is-selected")}head(e,n,s,r=[]){return o("div",{class:"section-head"},o("h2",{text:e}),...r,n?o("span",{class:"section-head__meta",text:n}):null,s?o("span",{class:"section-head__aside",text:s}):null)}sizeAside(){if(this.ctx.ownSizes)return"Each at its own size";let e=this.ctx.viewports.get(this.ctx.size);return e?ie(e):""}grid(e,n){let s=o("div",{class:"frame-grid dv-grid"});if(this.ctx.ownSizes){let r=Math.max(0,...e.map(i=>this.ctx.viewports.get(i.viewport)?.width??0));r>0&&s.style.setProperty("--dv-min",z(Ze(r)))}for(let r of e)s.append(ge(this.ctx,r,this.loader,{above:n?.(r)??null})),this.shown++;return s}section(e){let n=He(this.ctx,e).flatMap(i=>i.cells);if(n.length===0)return null;let s="",r=this.sizeAside();if(e.kind==="flow"){let i=n.filter(p=>!Ve(p.frame)),a=n.length-i.length,l=new Set(i.map(p=>p.path.replace(/--[^/]*$/,""))),c=new Set(i.map(p=>p.path));s=[i.length>0?`${M(l.size,"screen")} \xB7 ${M(c.size,"state")}`:"",a>0?M(a,"image"):""].filter(Boolean).join(" \xB7 "),i.length===0&&!this.ctx.ownSizes&&(r="In context and on its own")}else e.kind==="components"?s=M(n.length,"component"):s=M(n.length,"page");return o("section",{class:"dv-section",attrs:{"data-kind":e.kind,id:`dv-${e.id}`}},this.head(e.title,s,r),...this.framesAndGroups(n))}framesAndGroups(e){let n=[],s=[],r=()=>{s.length>0&&n.push(this.grid(s)),s=[]};for(let i of e){let a=Ve(i.frame);if(!a){s.push(i);continue}r(),n.push(Ft(this.ctx,i,a,this.loader)),this.shown++}return r(),n}designSystem(e){let n=He(this.ctx,e).flatMap(h=>h.cells),s=this.ctx.filters.query,r=e.overview&&me("design system overview tokens colours colors type fonts",s)?this.overviewCard(e):null,i=e.assets??[],l=!!e.filesHref&&i.length>0&&(me("design system files images downloads",s)||i.some(h=>this.ctx.fileVisible(h.path)))&&e.filesHref?Ht(this.ctx,e.filesHref,i,this.cardSize()):null;if(l&&s.trim()&&this.cardsShown++,n.length===0&&!r&&!l)return null;let c=n.filter(h=>h.path.startsWith("design-system/brand/")).length,p=n.length-c,d=[r?"Overview":"",l?M(i.length,"file"):"",c?M(c,"brand page"):"",p?M(p,"component"):""].filter(Boolean).join(" \xB7 "),u=this.grid(n);return u.prepend(...[r,l].filter(h=>h!==null)),o("section",{class:"dv-section",attrs:{"data-kind":e.kind,id:`dv-${e.id}`}},this.head(e.title,d,this.sizeAside()),u)}cardSize(){return this.ctx.ownSizes?void 0:this.ctx.viewports.get(this.ctx.size)}overviewCard(e){let n=e.overview;if(!n)return null;let s=`${this.ctx.data.roots.head}${n.href}`,r=this.cardSize(),i=[M(n.tokens,"token"),M(n.colours,"colour"),M(n.fontStacks.length,"font")].filter(a=>!a.startsWith("0 ")).join(" \xB7 ");return o("figure",{class:"frame dv-overview",attrs:{"data-kind":"overview"}},o("a",{class:"overview-card",attrs:{href:s,"aria-label":"Open the design system overview"},style:r?{"aspect-ratio":`${r.width} / ${r.height}`}:{}},o("span",{class:"overview-card__palette",attrs:{"aria-hidden":"true"}},...n.palette.map(a=>o("i",{style:{background:a}}))),o("span",{class:"overview-card__body"},o("span",{class:"overview-card__title",text:"Overview"}),o("span",{class:"overview-card__meta",text:i}),n.fontStacks.length>0?o("span",{class:"overview-card__fonts",attrs:{"aria-hidden":"true"}},...n.fontStacks.slice(0,2).map(a=>o("span",{text:"Aa",style:{"font-family":a}}))):null)),o("figcaption",{class:"frame__caption"},o("span",{class:"frame__label"},"design-system / ",o("b",{text:"overview"})),V(()=>`${this.ctx.data.product.slug} design-system/tokens.css (overview)
|
|
5
|
+
${new URL(s,window.location.href).href}`)))}optionSet(e){let n=He(this.ctx,e);return n.length===0?null:ot(this.ctx,e,n,(s,r)=>this.grid(s,r))}archive(e){let n=He(this.ctx,e).flatMap(l=>l.cells),s=(e.files??[]).filter(l=>this.ctx.fileVisible(l.path));if(n.length===0&&s.length===0)return null;let r=new Set(n.map(l=>l.path)).size,i=o("details",{class:"collapsed dv-archive",attrs:{"data-kind":"archive",id:"dv-archive",open:this.archiveOpen}},o("summary",null,x("collapsed"),o("h2",null,`${e.title} `,o("span",{text:`(${r||s.length})`})),o("p",{text:r>0?`${M(r,"screen")} kept from earlier work`:`${M(s.length,"file")} kept from earlier work`})));i.addEventListener("toggle",()=>{this.archiveOpen=i.open,this.loader.refreshSoon()});let a=o("div",{class:"collapsed__body dv-archive__body"});return n.length>0&&a.append(this.grid(n)),s.length>0&&a.append(Re(this.ctx,s)),i.append(a),i}},Ot=/^https?:\/\//i;function _n(t){let e=(t.data.reviews??[]).flatMap(n=>{let s=typeof n.previewUrl=="string"&&Ot.test(n.previewUrl),r=s?n.previewUrl:Ot.test(n.url)?n.url:null;return r?[{r:n,href:r,preview:s}]:[]});return e.length===0?null:o("aside",{class:"review-strip dv-reviews",attrs:{"aria-label":"Waiting for review","data-reviews":e.length}},o("span",{class:"tag tag--strong"},x("clock"),`${e.length} waiting for review`),o("ul",{class:"review-strip__list"},...e.map(({r:n,href:s,preview:r})=>{let i=Lt(n.number);return o("li",null,o("a",{class:"review-strip__link",attrs:{href:s,target:"_blank",rel:"noopener noreferrer","data-link":r?"preview":"pull-request",title:`${i}: ${n.title}`,"aria-label":`${r?"Preview":"Pull request"}: ${i}, ${n.title} (opens in a new tab)`}},o("b",{text:i}),o("span",{text:n.title}),x("external")))})))}function ot(t,e,n,s){let r=e.exploration,i=A((e.title||"").replace(/^\d{4}-\d{2}-\d{2}-?/,""))||e.title,a=r?.options??[],l=[],c=r?.since?$n(r.since):null;c&&l.push(`Waiting since ${c} \xB7 `),l.push(M(a.length||new Set(n.flatMap(u=>u.cells.map(h=>h.col))).size,"option")),e.readme&&l.push(" \xB7 ",o("a",{class:"dv-quiet-link",text:"Notes",attrs:{href:t.url({path:e.readme,root:"head"}),target:"_blank",rel:"noopener"}}));let p=u=>{let h=a.find(v=>v.id===u.col),m=(u.col||"?").toUpperCase(),g=o("span",null,o("b",{text:h?.title??`Option ${m}`}));return h?.text&&g.append(`${/^[a-z]/.test(h.text)?", ":". "}${h.text}`),o("p",{class:"option__label"},o("span",{class:"option__letter",text:m}),g)},d=o("article",{class:"option-set",attrs:{"data-exploration":e.title}},o("div",{class:"option-set__head"},o("h3",{class:"option-set__question",text:r?.question??i}),o("p",{class:"option-set__meta"},...l)));for(let u of n)n.length>1&&u.heading&&d.append(o("h4",{class:"dv-line-heading frame__label",text:u.heading.replace(/^screens\//,"").replace(/\.html?$/i,"")})),d.append(s(u.cells,p));return d}function $n(t){let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(!e)return null;let n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return`${Number(e[3])} ${n[Number(e[2])-1]??e[2]}`}function Re(t,e){return o("ul",{class:"dv-files"},...e.map(n=>o("li",null,o("a",{class:"frame__label",attrs:{href:t.url(n),target:"_blank",rel:"noopener"}},...st(n.path)))))}function st(t){let e=t.lastIndexOf("/");return[t.slice(0,e+1),o("b",{text:t.slice(e+1)})]}var de="[a-z0-9]+(?:-[a-z0-9]+)*",U=new RegExp(`^screens/(${de})/(${de})--(${de})\\.html$`),It=new RegExp(`^explorations/([^/]+)/([a-d])/screens/(${de})/(${de})--(${de})\\.html$`);function ve(t,e="focus"){let n=U.exec(t.path),s=n?`${n[1]}/${n[2]}--${n[3]}`:`file/${t.path.split("/").map(encodeURIComponent).join("/")}`,r=new URLSearchParams;return t.root==="base"&&r.set("root","base"),e==="board"&&r.set("view","board"),`#/${s}@${encodeURIComponent(t.viewport)}${r.size?`?${r}`:""}`}function Tn(t){try{let e=/^#\/([^?]+)@([^@/?]+)(?:\?(.*))?$/.exec(t);if(!e)return null;let n=e[1],s=new URLSearchParams(e[3]);if([...s.keys()].some(i=>i!=="root"&&i!=="view")||s.has("root")&&s.get("root")!=="base"||s.has("view")&&s.get("view")!=="board")return null;let r=n.startsWith("file/")?n.slice(5).split("/").map(decodeURIComponent).join("/"):`screens/${decodeURIComponent(n)}.html`;return r.split("/").some(i=>i==="."||i===".."||!i)||r.includes("\\")?null:{path:r,viewport:decodeURIComponent(e[2]),root:s.has("root")?"base":"head",view:s.has("view")?"board":"focus"}}catch{return null}}function Hn(t,e){return[...t.board,...t.preview?.sections??[]].flatMap(s=>s.lines.flatMap(r=>r.cells)).find(s=>s.path===e.path&&s.root===e.root&&s.viewport===e.viewport)??null}function Nt(t,e){let n,s,r,i=()=>{if(s===window.location.hash)return;s=window.location.hash,n?.(),n=void 0;let a=Tn(window.location.hash),l=a&&Hn(t.data,a);!l||!a||(t.jump(l),a.view==="focus"&&(n=e(l,r)),r=void 0)};t.navigate=(a,l,c)=>{r=c;let p=ve(a,l);p!==window.location.hash&&(window.history.pushState(null,"",p),i())},t.focus=(a,l)=>t.navigate(a,"focus",l),window.addEventListener("hashchange",i),window.addEventListener("popstate",i),i()}var Pe=class{data;viewports;ownSizes;filters;focusFullHeight=!1;selected=null;listeners=new Set;selectionListeners=new Set;focus=()=>{};jump=()=>{};navigate=()=>{};constructor(e){this.data=e,this.viewports=new Map(e.viewports.map(n=>[n.id,n])),this.ownSizes=e.ownSizes===!0,this.filters=bt(e)}get size(){return[...this.filters.viewports][0]??this.data.viewports[0]?.id??""}setFilters(e){this.filters={...this.filters,...e};for(let n of this.listeners)n()}onFilters(e){this.listeners.add(e)}select(e){this.selected=e?{path:e.path,root:e.root,viewport:e.viewport}:null;for(let n of this.selectionListeners)n()}onSelect(e){this.selectionListeners.add(e)}isSelected(e){let n=this.selected;return!!n&&n.path===e.path&&n.root===e.root&&n.viewport===e.viewport}atSize(e){return this.ownSizes?e.viewport===re(e):this.filters.viewports.has(e.viewport)}visible=e=>this.atSize(e)&&wt(e,this.filters.query);fileVisible=e=>St(e,this.filters);url(e){return xt(this.data,e)}ref(e,n,s){return`${yt(this.data.product.slug,e,n)}${s?` \xB7 ${s}`:""}
|
|
6
|
+
${this.link({...e,viewport:n})}`}link(e,n="focus"){let s=new URL(window.location.href);return s.hash=ve(e,n),s.href}};function Fe(t){return t.flows.map(e=>{let n=new Map;for(let s of t.board.filter(r=>r.kind==="flow"))for(let r of s.lines)for(let i of r.cells){let a=U.exec(i.path);if(!a||a[1]!==e.id)continue;let l=a[2],c=a[3],p=n.get(l)??{id:l,states:[]};n.set(l,p);let d=p.states.find(u=>u.id===c);d||(d={id:c,cells:[]},p.states.push(d)),d.cells.push(i)}return{...e,screens:[...n.values()]}}).filter(e=>e.screens.length>0)}function rt(t,e,n){let r=(e.root==="head"?t.board:t.preview?.sections??[]).flatMap(u=>u.lines.flatMap(h=>h.cells)).filter(u=>u.root===e.root),i=u=>u.find(h=>h.viewport===e.viewport)??u[0]??null;if(n.toLowerCase()==="v"){let u=t.viewports.flatMap(m=>r.filter(g=>g.path===e.path&&g.viewport===m.id).slice(0,1)),h=u.findIndex(m=>m.viewport===e.viewport);return h>=0?u[(h+1)%u.length]??null:null}let a=U.exec(e.path);if(!a)return null;let c=Fe({...t,board:[{id:"step",kind:"flow",title:"",align:!1,columns:[],lines:r.map(u=>({cells:[u]}))}]}).find(u=>u.id===a[1]),p=c?.screens.findIndex(u=>u.id===a[2])??-1,d=c?.screens[p];if(!c||!d)return null;if(n==="ArrowLeft"||n==="ArrowRight"){let u=d.states.findIndex(h=>h.id===a[3]);return i(d.states[u+(n==="ArrowLeft"?-1:1)]?.cells??[])}if(n==="ArrowUp"||n==="ArrowDown"){let u=c.screens[p+(n==="ArrowUp"?-1:1)];return i((u?.states.find(h=>h.id===a[3])??u?.states[0])?.cells??[])}return null}function Dt(t,e){let n=U.exec(e.path);if(!n)return null;let r=(e.root==="head"?t.board:t.preview?.sections??[]).flatMap(c=>c.lines.flatMap(p=>p.cells)).filter(c=>c.root===e.root),a=Fe({...t,board:[{id:"position",kind:"flow",title:"",align:!1,columns:[],lines:r.map(c=>({cells:[c]}))}]}).find(c=>c.id===n[1])?.screens.find(c=>c.id===n[2]);if(!a)return null;let l=a.states.findIndex(c=>c.id===n[3]);return l<0?null:{index:l,total:a.states.length}}function zn(t){let e=[],n=0,s="",r=!1;for(let i=0;i<t.length;i++){let a=t[i];if(r){r=!1;continue}if(a==="\\"){r=!0;continue}if(s){a===s&&(s="");continue}if(a==='"'||a==="'"){s=a;continue}if(a!=="-"||t[i+1]!==">")continue;let l=/^->\s*([^,]*)(?:,|$)/.exec(t.slice(i));if(!l)continue;let c=t.slice(n,i).trim(),p=l[1]?.trim()??"";c&&U.test(`screens/${p}.html`)&&e.push({selector:c,target:p}),i+=l[0].length-1,n=i+1}return e}function An(t,e,n){let s=`screens/${n}.html`;if(!U.test(s))return null;let r=[...t.board,...t.preview?.sections??[]].flatMap(l=>l.lines.flatMap(c=>c.cells)).filter(l=>l.path===s),i=r.filter(l=>l.root===e.root),a=i.length?i:r.filter(l=>l.root==="head");return a.find(l=>l.viewport===e.viewport)??a[0]??null}function qt(t,e,n,s){let r=[...t.querySelectorAll('meta[name="design:links"]')].flatMap(a=>zn(a.content)),i=a=>{if(a.button!==0||a.ctrlKey||a.metaKey||a.altKey||a.shiftKey)return;let l=a.target;if(typeof l?.closest=="function")for(let c of r){try{if(!l.closest(c.selector))continue}catch{continue}let p=An(e,n,c.target);if(p){a.preventDefault(),a.stopImmediatePropagation(),s(p);return}}};return t.addEventListener("click",i,!0),()=>t.removeEventListener("click",i,!0)}var Bt=4,Rn=0;function Vt(t,e,n,s={}){let r=`dv-size-menu-${++Rn}`,i=o("span",{class:"size-menu__name"}),a=o("span",{class:"size-menu__dims"}),l=o("button",{class:"size-menu__button",attrs:{type:"button","aria-haspopup":"menu","aria-expanded":"false","aria-controls":r}},o("span",{class:"size-menu__label",text:"Size"}),i,a,x("expanded")),c=t.map(f=>{let y=o("button",{class:"size-menu__option",attrs:{type:"button",role:"menuitemradio","aria-checked":"false","data-viewport":f.id,tabindex:-1,disabled:s.disabled?.(f.id)??!1}},o("span"),o("span",{text:A(f.id)}),o("span",{class:"size-menu__option-dims",text:`${f.width} \xD7 ${f.height}`}));return y.addEventListener("click",()=>{y.disabled||(g(!0),n(f.id))}),y}),p=o("div",{class:"size-menu__list",attrs:{id:r,role:"menu","aria-label":"Size",hidden:!0}},...c),d=o("div",{class:`size-menu${s.extraClass?` ${s.extraClass}`:""}`},l,p),u=()=>c.filter(f=>!f.disabled),h=f=>{d.contains(f.target)||g(!1)};function m(){if(!p.hidden)return;p.hidden=!1,l.setAttribute("aria-expanded","true"),document.addEventListener("pointerdown",h,!0);let f=c.find(y=>y.getAttribute("aria-checked")==="true"&&!y.disabled)??u()[0];f?.focus({focusVisible:Ee()}),f?.scrollIntoView?.({block:"nearest"})}function g(f){p.hidden||(p.hidden=!0,l.setAttribute("aria-expanded","false"),document.removeEventListener("pointerdown",h,!0),f&&l.focus())}l.addEventListener("click",()=>p.hidden?m():g(!1)),l.addEventListener("keydown",f=>{(f.key==="ArrowDown"||f.key==="ArrowUp")&&(f.preventDefault(),m())}),p.addEventListener("keydown",f=>{let y=u(),S=y.indexOf(document.activeElement),C;if(f.key==="ArrowDown")C=y[(S+1)%y.length];else if(f.key==="ArrowUp")C=y[(S-1+y.length)%y.length];else if(f.key==="Home")C=y[0];else if(f.key==="End")C=y[y.length-1];else if(f.key==="Escape"){f.preventDefault(),f.stopPropagation(),g(!0);return}else if(f.key==="Tab"){g(!1);return}else return;f.preventDefault(),C?.focus()});let v=f=>{let y=t.find(S=>S.id===f);i.textContent=y?A(y.id):"",a.textContent=y?`${y.width} \xD7 ${y.height}`:"";for(let S of c){let C=S.getAttribute("data-viewport")===f;S.setAttribute("aria-checked",String(C)),S.firstElementChild?.replaceWith(C?x("check"):o("span"))}};return v(e),{el:d,set:v}}function Pn(t,e,n,s={}){let r=o("div",{class:`switcher${s.fill?" switcher--fill":""}${s.extraClass?` ${s.extraClass}`:""}`,attrs:{role:"group","aria-label":"Size"}});for(let i of t){let a=o("button",{text:A(i.id),attrs:{type:"button","aria-pressed":String(i.id===e),title:`${i.width} \xD7 ${i.height}`,"data-viewport":i.id,disabled:s.disabled?.(i.id)??!1}});a.addEventListener("click",()=>n(i.id)),r.append(a)}return r}function Fn(t,e){for(let n of t.querySelectorAll("button"))n.setAttribute("aria-pressed",String(n.getAttribute("data-viewport")===e));ue(t)}function pe(t,e,n,s={}){if(t.length>Bt){let i={};return s.extraClass&&(i.extraClass=s.extraClass),s.disabled&&(i.disabled=s.disabled),Vt(t,e,n,i)}let r=Pn(t,e,n,s);return{el:r,set:i=>Fn(r,i)}}function ue(t){let e=t.querySelector('[aria-pressed="true"]');!e||t.scrollWidth<=t.clientWidth||(t.scrollLeft=Math.max(0,e.offsetLeft-(t.clientWidth-e.offsetWidth)/2))}function Wt(t){return`${oe}:size:${t.data.product.slug}`}function Kt(t){if(t.ownSizes)return null;try{let e=localStorage.getItem(Wt(t));return e&&t.viewports.has(e)?e:null}catch{return null}}function On(t,e){try{localStorage.setItem(Wt(t),e)}catch{}}function Ut(t){let e=o("input",{attrs:{type:"search",placeholder:"Search screens","aria-label":"Search screens",autocomplete:"off"}}),n=o("span",{class:"dv-search-status"},o("kbd",{class:"kbd",text:"/"}));return{el:o("label",{class:`search-field${t?" search-field--fill":" desktop-only"}`},x("search"),e,n),input:e,status:n}}function it(t,e){return`${e?"top-bar top-bar--centered top-bar--board":"top-bar"}${t.data.framed?" top-bar--in-app":""}`}function jt(t,e){let n=t.data.board.filter(E=>E.kind==="flow"),s=new Set(n.flatMap(E=>E.lines.flatMap(R=>R.cells.map(N=>N.path)))),r=o("button",{class:"button button--quiet button--icon desktop-only dv-show-sidebar",attrs:{type:"button","aria-label":"Show the sidebar","aria-controls":"dv-screens"}},x("sidebar")),i=t.ownSizes?null:pe(t.data.viewports,t.size,E=>{On(t,E),t.setFilters({viewports:new Set([E])})},{extraClass:"top-bar__center"}),a=Ut(!1),l=Ut(!0),c=[a.input,l.input],p=Ge(E=>t.setFilters({query:E}),150);for(let E of c)E.addEventListener("input",()=>{for(let R of c)R!==E&&(R.value=E.value);p(E.value)}),E.addEventListener("keydown",R=>{if(R.key==="Escape"&&E.value){R.stopPropagation();for(let N of c)N.value="";t.setFilters({query:""})}});let d=o("div",{class:"dv-search-row phone-only",attrs:{hidden:!0}},l.el),u=o("button",{class:"button button--quiet button--icon phone-only",attrs:{type:"button","aria-label":"Search screens","aria-expanded":"false"}},x("search"));u.addEventListener("click",()=>{d.hidden=!d.hidden,u.setAttribute("aria-expanded",String(!d.hidden)),d.hidden||l.input.focus()});let h=o("button",{class:"button phone-only",attrs:{type:"button","aria-controls":"dv-screens","aria-expanded":"false"}},x("sidebar"),"Screens"),m=()=>{let E=t.filters.query.trim(),R=e();for(let N of[a,l])N.status.replaceChildren(E?o("span",{class:"search-field__count",text:R===0?"None found":`${R} found`}):N===a?o("kbd",{class:"kbd",text:"/"}):"")};t.onFilters(()=>{i?.set(t.size);for(let E of c)E.value!==t.filters.query&&(E.value=t.filters.query);setTimeout(m,0)}),setTimeout(()=>{m(),i?.el.classList.contains("switcher")&&ue(i.el)},0);let g=t.data.framed===!0,v=o("div",{class:"top-bar__start"},g?null:r,g?null:ke(!0),o("div",{class:"top-bar__product"},o("strong",{text:t.data.product.name}),o("span",null,M(s.size,"screen"),o("span",{class:"desktop-only",text:` in ${M(n.length,"flow")}`})))),f=o("header",{class:it(t,i!==null)},v,i?i.el:o("span",{class:"top-bar__spacer"}),o("div",{class:"top-bar__end"},a.el,u,h)),y=!0,S=Q("(min-width: 768px)"),C=()=>{g&&(!y&&S.matches?v.prepend(r):r.remove())};return S.addEventListener("change",C),{el:f,searchRow:d,screens:h,showSidebar:r,focusSearch:()=>{Q("(max-width: 767px)").matches?(d.hidden=!1,u.setAttribute("aria-expanded","true"),l.input.focus()):a.input.focus()},sidebarShown:E=>{y=E,C()}}}function In(t){let e=t.defaultView;if(!e||typeof e.getComputedStyle!="function")return!0;let n=s=>{if(!s)return null;let r=e.getComputedStyle(s).overflowY;return r==="visible"||r===""?null:r==="hidden"||r==="clip"};return!(n(t.documentElement)??n(t.body)??!1)}var Nn=/url\([^)]*\)|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|(?<![\w.])(\d*\.?\d+)[sld]?(vh|vb|vmin|vmax)\b/gi;function Dn(t,e,n){let s={vh:n/100,vb:n/100,vmin:Math.min(e,n)/100,vmax:Math.max(e,n)/100};return t.replace(Nn,(r,i,a)=>i===void 0||a===void 0?r:`${Math.round(Number(i)*(s[a.toLowerCase()]??0)*100)/100}px`)}function at(t,e,n){let s;try{s=t.contentDocument}catch{return}if(!s)return;let r=a=>{let l=a?.cssText;if(!a||!l)return;let c=Dn(l,e,n);c!==l&&(a.cssText=c)},i=a=>{for(let l of Array.from(a??[]))"style"in l&&r(l.style),"cssRules"in l&&i(l.cssRules),"styleSheet"in l&&i(Gt(l.styleSheet))};for(let a of Array.from(s.styleSheets??[]))i(Gt(a));for(let a of Array.from(s.querySelectorAll("[style]")))r(a.style)}function Gt(t){try{return t?.cssRules}catch{return}}function lt(t,e){let n;try{n=t.contentDocument}catch{return null}let s=n?.documentElement;if(!n||!s)return null;if(!In(n))return e;let r=t.style.height;t.style.height=`${e}px`;try{return Math.max(e,s.scrollHeight,n.body?.scrollHeight??0)}finally{t.style.height=r}}function qn(t,e){let n;try{n=t.contentDocument}catch{return}if(!n?.documentElement)return;n.fonts?.ready.then(e,()=>{});let s=n.defaultView?.ResizeObserver;if(typeof s!="function"||typeof requestAnimationFrame!="function")return;let r=0,i=new s(()=>{if(!t.isConnected){i.disconnect();return}r||=requestAnimationFrame(()=>{r=0,e()})});i.observe(n.documentElement),n.body&&i.observe(n.body)}var Xt=t=>`${t.root}:${t.path}@${t.viewport}`,Oe=class{measured=new Map;viewports;steady;constructor(e,n=s=>s()){this.viewports=e,this.steady=n}group(e){let n=Math.max(1,...e.map(c=>this.viewports.get(c.viewport)?.height??1)),s=e.map(Xt),r=[],i=()=>Math.max(n,...s.map(c=>this.measured.get(c)??0)),a=i(),l=()=>{let c=i();c!==a&&(a=c,this.steady(()=>{for(let p of r)p(c)}))};return{fit:c=>{r.push(c),c(a)},clear:()=>{r.length=0},frames:(c,p)=>()=>{let d=p(),u=Xt(c),h=this.viewports.get(c.viewport)??{width:1,height:n},m=()=>{if(!d.isConnected)return;let g=lt(d,h.height);g!==null&&(this.measured.set(u,g),l())};return d.addEventListener("load",()=>{at(d,h.width,h.height),m(),qn(d,m)}),d}}}};function Bn(t,e){let n=t.data.product.name,s=U.exec(e.path);if(s){let i=t.data.flows.find(a=>a.id===s?.[1])?.title??A(s[1]??"");return{desktop:[n,i],both:[A(s[2]??"")],last:A(s[3]??"")}}if(s=It.exec(e.path))return{desktop:[n,`Option ${(s[2]??"").toUpperCase()}`],both:[A(s[4]??"")],last:A(s[5]??"")};let r=e.path.startsWith("design-system/brand/")?"Brand":e.path.startsWith("design-system/components/")?"Components":e.path.startsWith("archive/")?"Archive":"";return{desktop:[n],both:r?[r]:[],last:e.title}}function be(t,e){return o("li",null,o("span",{class:"key-list__keys"},...t.map(n=>o("kbd",{class:"kbd kbd--large"},n))),o("span",{text:e}))}function Jt(t,e,n){let s=e.viewport,r=t.focusFullHeight,i=t.viewports.get(s)??{id:s,width:1,height:1},a=new Set(e.viewports.length>0?e.viewports:[s]),l=Q(Ae);t.select(e);let c=o("iframe",{class:"dv-focus-frame",attrs:{src:t.url(e),title:e.title,width:i.width,height:i.height}}),p=o("div",{class:"frame__shot dv-focus-shot"},c),d=o("i"),u=o("div",{class:"dv-stage"}),h=o("div",{class:"stage__cap desktop-only"},e.root==="base"?o("span",{class:"tag",text:"Before"}):null,o("span",{class:"frame__label"},e.path.slice(0,e.path.lastIndexOf("/")+1),o("b",{text:e.path.slice(e.path.lastIndexOf("/")+1)}),d),V(()=>t.ref(e,s)));u.append(h,o("figure",{class:"frame dv-focus-figure"},p));let m=i.height,g=()=>{r&&!l.matches&&(m=lt(c,i.height)??i.height);let w=u.clientWidth-se(u,"padding-left")-se(u,"padding-right"),O=h.offsetHeight?h.offsetHeight+se(h,"margin-bottom"):0,H=u.clientHeight-se(u,"padding-top")-se(u,"padding-bottom")-O,F=r&&!l.matches,B=w>0&&H>0?F?et(i.width,1,w,Number.POSITIVE_INFINITY):et(i.width,i.height,w,H):1,fe=F?m:i.height;c.style.height=z(fe),c.setAttribute("height",String(fe)),c.style.transform=B===1?"":`scale(${B})`,p.style.width=z(i.width*B),p.style.height=z(fe*B),u.classList.toggle("dv-stage--tall",F),d.textContent=` \xB7 ${ie(i," ")} \xB7 shown at ${Math.round(B*100)}%`,S.classList.remove("dv-crumb--short"),S.classList.add("dv-crumb--measure");let xe=S.scrollWidth>S.clientWidth+1;S.classList.remove("dv-crumb--measure"),S.classList.toggle("dv-crumb--short",xe)},v=()=>{at(c,i.width,i.height),g()};c.addEventListener("load",v);let f=o("button",{class:"button button--quiet top-bar__close",attrs:{type:"button","aria-label":"Close and go back to the board"}},x("close"),o("span",{class:"desktop-only",text:"Close"}),o("kbd",{class:"kbd kbd--small desktop-only",text:"Esc"})),y=Bn(t,e),S=o("nav",{class:"crumb",attrs:{"aria-label":"Screen"}});for(let w of y.desktop)S.append(o("span",{class:"desktop-only",text:w}),o("span",{class:"crumb__sep desktop-only",text:"/"}));for(let w of y.both)S.append(o("span",{text:w}),o("span",{class:"crumb__sep",text:"/"}));S.append(o("b",{text:y.last}));let C=Dt(t.data,e),I=w=>{let O=rt(t.data,{...e,viewport:s},w);O&&t.focus(O)},T=(w,O,H,F)=>{let B=o("button",{class:"button button--small button--icon",attrs:{type:"button","aria-label":O,disabled:F}},x(H));return B.addEventListener("click",()=>I(w)),B},E=C?o("div",{class:"stepper"},T("ArrowLeft","Previous state","previous",C.index===0),T("ArrowRight","Next state","next",C.index>=C.total-1),o("span",{class:"stepper__count"},o("span",{class:"desktop-only",text:"State "}),`${C.index+1} of ${C.total}`)):null,R=w=>{w!==s&&a.has(w)&&t.focus({...e,viewport:w})},N=!(t.ownSizes&&a.size<=1),J=w=>!a.has(w),$=N?pe(t.data.viewports,s,R,{extraClass:"desktop-only",disabled:J}):null,W=N?pe(t.data.viewports,s,R,{fill:!0,disabled:J}):null,K=W?o("div",{class:"bottom-bar bottom-bar--fixed phone-only"},W.el):null,j=o("button",{class:"button button--quiet desktop-only",attrs:{type:"button","aria-pressed":String(r)}},x("height"),"Full height");j.addEventListener("click",()=>{r=!r,t.focusFullHeight=r,j.setAttribute("aria-pressed",String(r)),g()});let Ne=o("a",{class:"button button--icon-on-phone",attrs:{href:t.url(e),target:"_blank",rel:"noopener","aria-label":"Open in a new tab"}},x("external"),o("span",{class:"desktop-only",text:"Open in a new tab"})),te=o("button",{class:"button button--quiet button--small button--icon",attrs:{type:"button","aria-label":"Close"}},x("close")),G=o("section",{class:"key-help key-help--anchored dv-shortcuts desktop-only",attrs:{hidden:!0,id:"dv-shortcuts",role:"dialog","aria-labelledby":"dv-shortcuts-title"}},o("div",{class:"key-help__head"},o("div",null,o("h2",{text:"Keyboard shortcuts",attrs:{id:"dv-shortcuts-title"}}),o("p",{text:"They work in this view."})),te),o("ul",{class:"key-list"},be([x("keyLeft"),x("keyRight")],"Previous or next state"),be([x("keyUp"),x("keyDown")],"Previous or next screen"),N?be(["V"],"Change the size"):null,be(["Esc"],"Back to the board"),be(["?"],"Show or hide this help")),o("p",{class:"key-help__foot",text:"Shortcuts also work inside the frame, except while you type in a field."})),Y=o("button",{class:"button button--icon desktop-only",text:"?",attrs:{type:"button","aria-label":"Keyboard shortcuts","aria-pressed":"false","aria-expanded":"false","aria-controls":"dv-shortcuts"}}),ne=()=>{G.hidden=!G.hidden,Y.setAttribute("aria-expanded",String(!G.hidden)),Y.setAttribute("aria-pressed",String(!G.hidden))};Y.addEventListener("click",ne),te.addEventListener("click",ne);let ye=o("div",{class:`dv-focus${K?"":" dv-focus--one-size"}`,attrs:{role:"dialog","aria-modal":"true","aria-label":e.label}},o("header",{class:"top-bar top-bar--centered top-bar--focus"},o("div",{class:"top-bar__start"},f,o("span",{class:"top-bar__divider desktop-only"}),S,E),$?$.el:o("span",{class:"top-bar__spacer desktop-only"}),o("div",{class:"top-bar__end"},j,e.download?Tt(t,e.download):null,Ne,Y)),u,K,G),De=document.documentElement.style.overflow,b=null,L,k=!1,_=()=>{k=!0,ye.remove(),document.removeEventListener("keydown",D,!0),b?.removeEventListener("keydown",D,!0),L?.(),c.removeEventListener("load",v),c.removeEventListener("load",q),document.documentElement.style.overflow=De,n?.focus({preventScroll:!0})},P=()=>t.navigate({...e,viewport:s},"board"),D=w=>{if(w.ctrlKey||w.metaKey||w.altKey)return;let O=typeof w.target?.closest=="function"?w.target.closest(".size-menu"):null;if(O&&(w.key!=="Escape"||O.querySelector(".size-menu__list:not([hidden])")))return;if(w.key==="Escape"){w.preventDefault(),G.hidden?P():ne();return}let H=w.target;if(typeof H?.closest=="function"&&H.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;if(w.key==="?"){w.preventDefault(),ne();return}let F=rt(t.data,{...e,viewport:s},w.key);F?(w.preventDefault(),t.focus(F)):["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","v","V"].includes(w.key)&&w.preventDefault()},q=()=>{b?.removeEventListener("keydown",D,!0),L?.(),L=void 0;try{b=c.contentDocument,b?.addEventListener("keydown",D,!0),b&&(L=qt(b,t.data,{...e,viewport:s},w=>t.focus(w)))}catch{b=null}};if(c.addEventListener("load",q),f.addEventListener("click",P),document.addEventListener("keydown",D,!0),document.documentElement.style.overflow="hidden",document.body.append(ye),typeof ResizeObserver<"u"){let w=new ResizeObserver(()=>{k?w.disconnect():g()});w.observe(u)}return g(),W?.el.classList.contains("switcher")&&ue(W.el),f.focus({focusVisible:Ee()}),_}function Yt(t,e,n,s,r,i){let a=t.viewports.get(n.viewport)??{id:n.viewport,width:1,height:1},l=i?.group([e,n]),c=o("div"),p=o("button",{text:"Side by side",attrs:{type:"button"}}),d=o("button",{text:"Overlay",attrs:{type:"button"}}),u=o("div",{class:"switcher switcher--small",attrs:{role:"group","aria-label":`Compare ${n.path} at ${n.viewport}`}},p,d),h=o("article",{class:"change dv-comparison",attrs:{"data-path":n.path,"data-viewport":n.viewport}},o("div",{class:"change__head"},_e(n),u,$e(t,n,V(()=>t.ref(n,n.viewport)))),c),m=t.data.preview?.base?.sha,g=t.data.commit?.sha,v=(y,S,C)=>{let I=o("div",{class:"compare-side dv-frame",attrs:{"data-path":y.path,"data-viewport":y.viewport,"data-root":y.root}},o("p",{class:"compare-side__label"},S,C?o("span",{class:"sha",text:ae(C)}):null)),T=null;return T=Z(t,y,s,()=>t.focus(y,T?.querySelector(".dv-frame-open")??void 0),"",l),I.append(T),I},f=()=>{for(let $ of c.querySelectorAll(".dv-view"))s.forget($);if(c.replaceChildren(),l?.clear(),p.setAttribute("aria-pressed",String(!r.overlay)),d.setAttribute("aria-pressed",String(r.overlay)),!r.overlay){c.className="compare-pair",c.append(v(e,"Before",m),v(n,"After",g));return}c.className="overlay";let y=[n,e].map($=>{let W=o("div",{class:"dv-view dv-compare-layer",style:{width:z(a.width),height:z(a.height)}}),K=()=>o("iframe",{class:"dv-iframe",attrs:{src:t.url($),title:`${$.root==="base"?"Before":"After"}: ${$.label}`,width:a.width,height:a.height,tabindex:-1}});return s.observe(W,l?l.frames($,K):K),l?.fit(j=>{W.style.height=z(j)}),W}),S=y[1],C=o("span",{class:"overlay__line",attrs:{"aria-hidden":"true"}}),I=o("span",{class:"overlay__knob",attrs:{"aria-hidden":"true"}},x("previous"),x("next")),T=o("input",{class:"dv-compare-range",attrs:{type:"range",min:0,max:100,step:1,value:r.split,"aria-label":`Line between before and after at ${n.viewport}`}}),E=o("div",{class:"frame__shot dv-shot dv-overlay",style:{"aspect-ratio":`${a.width} / ${a.height}`,"max-width":z(a.width)}},...y,C,T,I,o("span",{class:"overlay__tag overlay__tag--before",text:"Before"}),o("span",{class:"overlay__tag overlay__tag--after",text:"After"}));s.scale(E,a.width),l?.fit($=>{E.style.setProperty("aspect-ratio",`${a.width} / ${$}`)});let R=()=>{r.split=Math.max(0,Math.min(100,Number(T.value))),S.style.clipPath=`inset(0 ${100-r.split}% 0 0)`,E.style.setProperty("--reveal",`${r.split}%`),T.setAttribute("aria-valuetext",`${r.split}% before`)};T.addEventListener("input",R),R();let N=o("div",{class:"overlay__notes"},o("h3",{text:"Overlay"}),o("p",{text:"Before on the left of the line, after on the right. Drag the line, or use the arrow keys."}));n.note&&N.append(o("h3",{text:"Note"}),o("p",{text:n.note}));let J=o("p",{class:"dv-overlay-links"},o("a",{text:"Open before",attrs:{href:t.link(e)}})," \xB7 ",o("a",{text:"Open after",attrs:{href:t.link(n)}}));N.append(J),c.append(E,N)};return p.addEventListener("click",()=>{r.overlay=!1,f()}),d.addEventListener("click",()=>{r.overlay=!0,f()}),f(),h}var Qt=".dv-comparison, .dv-added > .dv-frame, .option-set .dv-frame",Vn=".dv-shot, .dv-files, .dv-shared";function Zt(t,e){return o("span",{class:"commit"},o("b",{text:t}),o("span",{class:"sha",text:e?ae(e.sha):"unknown"}))}function he(t){return t?t.lines.flatMap(e=>e.cells):[]}function Un(t){return t.length>1?`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`:t[0]??""}function ct(t){return t.every(e=>e.path.startsWith("screens/"))?["screen","screens"]:["page","pages"]}function en(t,e,n,s){if(t.ownSizes)return"Each at its own size.";let r=t.viewports.get(t.size);if(!r||n.length===0)return"";let i=h=>{let m=new Set(h);return Un(t.data.viewports.filter(g=>m.has(g.id)).map(g=>A(g.id)))},a=new Map(n.map(h=>[h.path,h.viewport])),l=[...new Map(n.filter(h=>h.viewport!==r.id).map(h=>[h.path,h])).values()],c=e.filter(h=>a.has(h.path)&&h.viewport!==a.get(h.path)).map(h=>h.viewport),[p,d]=ct(l),u;return l.length<a.size?(u=`Shown at ${s?ie(r,", "):A(r.id)}`,l.length>0&&(u+=`, and ${M(l.length,p,d)} without it at ${l.length===1?"its":"their"} own size`)):u=`No ${d} at ${A(r.id)}, so shown at ${i(a.values())}`,c.length>0?`${u}; also at ${i(c)}.`:`${u}.`}function tn(t,e){let n=Math.max(0,...e.map(s=>t.viewports.get(s.viewport)?.width??0));return z(Math.max(240,Math.min(640,n*.4)))}function nn(t,e){let n=t.data.preview,{product:s,commit:r}=t.data,i=t.ownSizes,a=new le(null,"100% 0px"),l=b=>n.sections.find(L=>L.kind===b),c=he(l("changed")).filter(b=>b.root==="head"),p=he(l("added")),d=n.sections.filter(b=>b.kind==="exploration"),u=[...he(l("changed")),...p,...d.flatMap(he)],h=l("archived"),m=he(h),g=h?.files??[],v=new Set(c.map(b=>b.path)).size,f=new Set(p.map(b=>b.path)).size,y=m.length>0?new Set(m.map(b=>b.path)).size:g.length,S=n.shared?.tokens.length??0,C=i?null:vt(t.data.viewports)?.id;C&&(t.filters={...t.filters,viewports:new Set([C])});let I=i||u.length===0?null:pe(t.data.viewports,t.size,b=>t.setFilters({viewports:new Set([b])}),{extraClass:"top-bar__center"}),T=o("header",{class:it(t,I!==null)},o("div",{class:"top-bar__start"},t.data.framed?null:ke(!0),o("div",{class:"top-bar__product"},o("strong",{text:s.name}),o("span",{text:"Preview"}))),I?I.el:o("span",{class:"top-bar__spacer"}),o("div",{class:"top-bar__end"},o("a",{class:"button dv-board-link",attrs:{href:n.boardHref}},o("span",{class:"desktop-only",text:"Open the full board"}),o("span",{class:"phone-only",text:"Full board"})))),E=`Review here, then approve by merging the pull request.${I&&t.data.viewports.length>1?" Changes show at one size at a time: pick another size in the top bar.":""}`,R=(b,L,k)=>b>0?o("a",{attrs:{href:`#${k}`}},o("b",{text:String(b)}),L):o("span",{class:"dv-summary-zero"},o("b",{text:"0"}),L),N=o("section",{class:"pr-banner dv-banner"},o("div",{class:"container pr-banner__layout"},o("div",null,o("p",{class:"pr-banner__eyebrow"},x("commit"),`Pull request preview${r?.date?` \xB7 ${Ce(r.date)}`:""}`),o("h1",{class:"pr-banner__title",text:n.label??`${s.name} design preview`}),o("div",{class:"commits"},Zt("Base",n.base),x("arrow","commits__arrow"),Zt("Head",r)),o("p",{class:"pr-banner__note",text:E})),o("nav",{class:"change-summary",attrs:{"aria-label":"Changes"}},R(v,"changed","changed"),R(f+d.length,"added","added"),R(y,"archived","archived"),R(S,S===1?"token change":"token changes","tokens")))),J=new Map,$=o("div",{class:"container"}),W=o("main",{class:"dv-content"},$),K=()=>{if(typeof window.scrollBy!="function"||typeof T.getBoundingClientRect!="function")return null;let b=T.getBoundingClientRect().bottom;return{bar:b,line:b+Math.max(0,window.innerHeight-b)/4}},j=null;for(let b of["wheel","touchstart","pointerdown","keydown"])window.addEventListener?.(b,()=>{j=null},{capture:!0,passive:!0});let Ne=b=>{let L=K(),k=L?j?.isConnected?j:[...$.querySelectorAll(Vn)].find(D=>D.getBoundingClientRect().bottom>L.line):null,_=k?.getBoundingClientRect().top;b();let P=k&&_!==void 0?k.getBoundingClientRect().top-_:0;P&&window.scrollBy(0,P)},te=new Oe(t.viewports,Ne),G=(b,L)=>o("div",{class:"section-head"},o("h2",{text:b}),o("p",{class:"section-head__meta",text:L})),Y=()=>{a.clear(),$.replaceChildren();let b=l("changed"),L=b?Le(b.lines,t.size,i):[];if(L.length>0){let[k,_]=ct(c),P=L.flatMap(q=>q.cells).filter(q=>q.root==="head"),D=o("section",{class:"dv-sec",attrs:{id:"changed","data-kind":"changed"}},G(`${M(v,k,_)} changed`,`Same file, different content. ${en(t,c,P,!0)}`));for(let q of L){let w=q.cells.find(B=>B.root==="base"),O=q.cells.find(B=>B.root==="head");if(!w||!O)continue;let H=`${O.path}@${O.viewport}`,F=J.get(H)??{overlay:!1,split:50};J.set(H,F),D.append(Yt(t,w,O,a,F,te))}$.append(D)}if(p.length>0||d.length>0){let[k,_]=ct(p),P=Le(l("added")?.lines??[],t.size,i).flatMap(H=>H.cells),D=d.map(H=>({s:H,lines:Le(H.lines,t.size,i)})),q=[...p,...d.flatMap(he)],w=[...P,...D.flatMap(H=>H.lines.flatMap(F=>F.cells))],O=o("section",{class:"dv-sec",attrs:{id:"added","data-kind":"added"}},G(p.length>0?`${M(f,k,_)} added`:`${M(d.length,"question")} added`,`New files in this pull request. ${en(t,q,w,!1)}`));if(P.length>0){let H=o("div",{class:"frame-grid dv-grid dv-added",style:{"--dv-min":tn(t,P)}});for(let F of P)H.append(ge(t,F,a,{cardTag:"Added",whole:te.group([F])}));O.append(H)}for(let{s:H,lines:F}of D)F.length!==0&&O.append(ot(t,H,F,(B,fe)=>{let xe=o("div",{class:"frame-grid dv-grid",style:{"--dv-min":tn(t,B)}});for(let qe of B)xe.append(ge(t,qe,a,{above:fe(qe),whole:te.group([qe])}));return xe}));$.append(O)}if(m.length>0||g.length>0){let k=o("section",{class:"dv-sec",attrs:{id:"archived","data-kind":"archived"}},G(`${y} archived`,"Moved out of the board, kept in the repo."));for(let _ of m){let P=null;P=Z(t,_,a,()=>t.focus(_,P?.querySelector(".dv-frame-open")??void 0)),k.append(o("div",{class:"archived-row dv-frame",attrs:{"data-path":_.path,"data-viewport":_.viewport,"data-root":_.root}},P,o("div",{class:"archived-row__text"},o("h3",{text:_.title}),o("p",{text:"Moved to the archive in this pull request. It stays on the board under Archive."}),o("span",{class:"frame__label"},...st(_.path))),o("span",{class:"tag"},x("archive"),"Archived")))}g.length>0&&k.append(Re(t,g)),$.append(k)}n.shared&&$.append(Wn(t,n)),$.childElementCount===0&&$.append(o("p",{class:"dv-empty",text:"No design files changed in this pull request."}))},ne=()=>{let b=K();if(!b)return null;for(let L of $.querySelectorAll(Qt)){let k=L.getBoundingClientRect();if(k.bottom>b.line)return{path:L.dataset.path??"",top:k.top,share:k.top<b.bar&&k.height>0?(b.line-k.top)/k.height:null}}return null},ye=b=>{let L=b&&[...$.querySelectorAll(Qt)].find(P=>P.dataset.path===b.path),k=K();if(!b||!L||!k)return;let _=L.getBoundingClientRect();window.scrollBy(0,_.top-(b.share===null?b.top:k.line-b.share*_.height))},De=b=>{let L=K(),k=L?b.getBoundingClientRect():null;!L||!k||k.height<=window.innerHeight-L.bar?b.scrollIntoView({block:"center",inline:"nearest"}):(k.bottom<=L.bar||k.top>=window.innerHeight)&&window.scrollBy(0,k.top-L.bar-16),j=b};t.onFilters(()=>{I?.set(t.size);let b=ne();Y(),ye(b)}),t.jump=b=>{let L=u.filter(w=>w.path===b.path&&w.root===b.root),k=L.find(w=>w.viewport===Xe(w,t.size,i)),_=i&&k?k:b;t.select(_),!i&&L.length>0&&k?.viewport!==_.viewport&&t.setFilters({viewports:new Set([_.viewport])});let P=[...e.querySelectorAll(".dv-frame")].find(w=>w.dataset.path===_.path&&w.dataset.root===_.root&&w.dataset.viewport===_.viewport),D=[...e.querySelectorAll(".dv-comparison")].find(w=>w.dataset.path===_.path&&w.dataset.viewport===_.viewport),q=P??D;q&&De(q),q?.querySelector(".dv-frame-open, button, a")?.focus({preventScroll:!0})},e.classList.add("dv-doc-app"),e.append(T,N,W),Y(),setTimeout(()=>{I?.el.classList.contains("switcher")&&ue(I.el)},0)}function Wn(t,e){let n=e.shared;if(!n)return o("div");let s=d=>d&&typeof CSS<"u"&&CSS.supports("color",d)?o("i",{class:"token-table__swatch",style:{background:d},attrs:{"aria-hidden":"true"}}):null,r=d=>o("td",null,d===null?o("span",{class:"dv-none",text:"(none)"}):o("span",null,s(d),d)),i=d=>o("tr",{attrs:{"data-token":d.name}},o("td",null,d.name,d.context&&d.context!==":root"?o("span",{class:"dv-token-where",text:` ${d.context}`}):null,d.file!=="design-system/tokens.css"?o("span",{class:"dv-token-where",text:` (${d.file.replace(/^design-system\//,"")})`}):null),r(d.old),o("td",{class:"dv-token-arrow",text:"\u2192"}),r(d.new)),a=[...new Set(n.tokens.map(d=>d.file.replace(/^design-system\//,"")))],l=a.length>0?` in ${a.join(" and ")}`:"",c=n.files.some(d=>d==="design-system/tokens.css"||d==="design-system/components.css"),p=n.tokens.length;return o("details",{class:"collapsed dv-shared",attrs:{id:"tokens","data-kind":"tokens"}},o("summary",null,x("collapsed"),o("h2",null,"Token changes ",o("span",{text:`(${p})`})),o("p",null,p>0?`${M(p,"value")} changed${l}.`:`${M(n.files.length,"shared file")} changed.`,c?o("span",{class:"dv-warning",text:" Every screen may be affected."}):null)),o("div",{class:"collapsed__body"},p>0?o("table",{class:"token-table"},o("tbody",null,...n.tokens.map(i))):null,Re(t,n.files.map(d=>({path:d,root:"head"})))))}var we=class{key;stored={};constructor(e){this.key=`${oe}:tree:${e}`;try{let n=JSON.parse(localStorage.getItem(this.key)??"{}");n&&typeof n=="object"&&!Array.isArray(n)&&(this.stored=n)}catch{}}get(e,n){return typeof this.stored[e]=="boolean"?this.stored[e]:n}set(e,n){this.stored[e]=n;try{localStorage.setItem(this.key,JSON.stringify(this.stored))}catch{}}};function ee(t,e,n,s,r,i,a,l=!1){let c=t.get(e,i),p=x(c?"expanded":"collapsed"),d=o("button",{class:`tree-row tree-row--${n}${l?" tree-row--quiet":""}`,attrs:{type:"button","aria-expanded":String(c),"data-branch":e}},p,o("span",{text:s}),r?o("span",{class:"tree-row__count",text:r}):null),u=o("div",{class:"dv-tree-group",attrs:{role:"group",hidden:!c}},...a);return d.addEventListener("click",()=>{let h=d.getAttribute("aria-expanded")!=="true";d.setAttribute("aria-expanded",String(h)),u.hidden=!h;let m=x(h?"expanded":"collapsed");p.replaceWith(m),p=m,t.set(e,h)}),[d,u]}function Kn(t){let e=t.closest(".dv-tree-group");for(;e;){let n=e.previousElementSibling;n?.getAttribute("aria-expanded")==="false"&&n.click(),e=e.parentElement?.closest(".dv-tree-group")??null}}function Ie(t,e,n,s,r="state",i=""){let a=e[0],l=o("a",{class:`tree-row tree-row--${r}`,attrs:{"data-path":a?.path,href:a?ve(a,"board"):"#"}},r==="screen"?x("blank"):null,r==="screen"?o("span",{text:n}):n,i?o("span",{class:"tree-row__count",text:i}):null);return l.addEventListener("click",c=>{c.preventDefault();let p=e.find(d=>t.atSize(d))??a;p&&s(p)}),l}function on(t){let e=new Map;for(let n of t){let s=e.get(n.path)??[];s.push(n),e.set(n.path,s)}return[...e.values()]}var sn=()=>o("div",{class:"tree-sep",attrs:{role:"separator"}});function rn(t,e){let n=new we(t.data.product.slug),s=o("nav",{class:"tree",attrs:{"aria-label":"Screens"}}),r=t.data.board,i=m=>m.lines.flatMap(g=>g.cells),a=r.find(m=>m.kind==="design-system");if(a){let m=on(i(a)),g=m.filter(T=>T[0]?.path.startsWith("design-system/brand/")),v=m.filter(T=>!T[0]?.path.startsWith("design-system/brand/")),f=[];a.overview&&f.push(o("a",{class:"tree-row tree-row--screen",attrs:{href:`${t.data.roots.head}${a.overview.href}`}},x("blank"),o("span",{text:"Overview"})));let y=a.assets??[],S=a.filesHref&&y.length>0?a.filesHref:null;S&&f.push(o("a",{class:"tree-row tree-row--screen",attrs:{href:`${t.data.roots.head}${S}`,"data-files":""}},x("blank"),o("span",{text:"Files"}),o("span",{class:"tree-row__count",text:String(y.length)})));let C=T=>T.map(E=>Ie(t,E,E[0]?.title??"",e));g.length>0&&f.push(...ee(n,"design:brand","screen","Brand pages",String(g.length),!1,C(g))),v.length>0&&f.push(...ee(n,"design:components","screen","Components",String(v.length),!1,C(v)));let I=m.length+(a.overview?1:0)+(S?1:0);s.append(...ee(n,"design","flow","Design system",String(I),!0,f),sn())}let l=Fe(t.data);for(let m of l){let g=m.screens.reduce((f,y)=>f+y.states.length,0),v=m.screens.map(f=>{let y=f.states.map(S=>Ie(t,S.cells,A(S.id),e));return ee(n,`screen:${m.id}/${f.id}`,"screen",A(f.id),String(f.states.length),!1,y)});s.append(...ee(n,`flow:${m.id}`,"flow",m.title,String(g),!1,v.flat()))}let c=r.filter(m=>m.kind==="exploration"),p=r.find(m=>m.kind==="archive");if((c.length>0||p)&&s.append(sn()),c.length>0){let m=c.map(g=>{let v=(g.exploration?.options.map(f=>f.id)??[...new Set(i(g).map(f=>f.col))]).map(f=>f.toUpperCase()).join(", ");return Ie(t,i(g),A(g.title.replace(/^\d{4}-\d{2}-\d{2}-?/,""))||g.title,e,"screen",v)});s.append(...ee(n,"options","flow","Open options",`${c.length} waiting`,!1,m))}if(p){let m=on(i(p)),g=p.files??[],v=m.map(f=>Ie(t,f,f[0]?.title??"",e));s.append(...ee(n,"archive","flow","Archive",String(m.length||g.length),!1,v,!0))}let d=()=>{let m=t.selected;for(let g of s.querySelectorAll(".tree-row--state")){let v=!!m&&g.getAttribute("data-path")===m.path&&m.root==="head";g.classList.toggle("is-selected",v),v?(g.setAttribute("aria-current","true"),Kn(g)):g.removeAttribute("aria-current")}};t.onSelect(d);let u=l.reduce((m,g)=>m+g.screens.reduce((v,f)=>v+f.states.length,0),0),{commit:h}=t.data;return o("aside",{class:"sidebar sidebar--drawer dv-sidebar",attrs:{id:"dv-screens","aria-label":"Screens"}},o("div",{class:"sidebar__head"},o("h2",null,"Screens",o("span",{text:String(u)})),o("button",{class:"button button--quiet button--small button--icon desktop-only",attrs:{type:"button","aria-label":"Hide the sidebar","data-sidebar-hide":""}},x("sidebar")),o("button",{class:"button button--quiet button--icon phone-only",attrs:{type:"button","aria-label":"Close the screens list","data-drawer-close":""}},x("close"))),s,h?o("div",{class:"sidebar__foot"},"Built from ",o("span",{class:"sha",text:ae(h.sha)}),h.date?o("br"):null,h.date?Ce(h.date):null):null)}function an(t){let e=[...t.querySelectorAll(".dv-thumb[data-width]")];if(e.length===0||typeof ResizeObserver>"u")return;let n=new ResizeObserver(s=>{for(let r of s){let i=r.target,a=Number(i.dataset.width);a>0&&r.contentRect.width>0&&i.style.setProperty("--dv-scale",String(r.contentRect.width/a))}});for(let s of e)n.observe(s)}var ln=`${oe}:hub:reviews`;function jn(){try{let t=localStorage.getItem(ln);return t==="open"?!0:t==="closed"?!1:null}catch{return null}}function Gn(t){try{localStorage.setItem(ln,t?"open":"closed")}catch{}}function cn(t=document){let e=t.querySelector(".review-panel"),n=e?.querySelector("[data-reviews-toggle]");if(!e||!n)return;let s=i=>{e.dataset.open=String(i),n.setAttribute("aria-expanded",String(i))};s(jn()??!Q(Ae).matches),n.addEventListener("click",()=>{let i=e.dataset.open!=="true";s(i),Gn(i)});let r=e.querySelector("[data-reviews-more]");r?.addEventListener("click",()=>{let i=r.getAttribute("aria-expanded")!=="true";r.setAttribute("aria-expanded",String(i));for(let a of e.querySelectorAll(".review-row[data-extra]"))a.hidden=!i})}function Xn(t,e){let n=Kt(t);n&&(t.filters={...t.filters,viewports:new Set([n])});let s=new ze(t,t.data.board),r=jt(t,()=>s.found),i=o("div",{class:"drawer-scrim"}),a=new we(t.data.product.slug),l=rn(t,d=>{c(!1),t.navigate(d,"board")}),c=d=>{l.classList.toggle("is-open",d),i.classList.toggle("is-open",d),r.screens.setAttribute("aria-expanded",String(d)),d&&l.querySelector("[data-drawer-close]")?.focus()},p=d=>{e.dataset.sidebar=d?"shown":"hidden",r.sidebarShown(d),a.set("sidebar",d)};e.dataset.sidebar=a.get("sidebar",!0)?"shown":"hidden",r.sidebarShown(e.dataset.sidebar==="shown"),r.screens.addEventListener("click",()=>c(!0)),i.addEventListener("click",()=>c(!1)),l.querySelector("[data-drawer-close]")?.addEventListener("click",()=>{c(!1),r.screens.focus()}),l.querySelector("[data-sidebar-hide]")?.addEventListener("click",()=>{p(!1),r.showSidebar.focus()}),r.showSidebar.addEventListener("click",()=>p(!0)),document.addEventListener("keydown",d=>{if(d.ctrlKey||d.metaKey||d.altKey||document.querySelector(".dv-focus"))return;let u=d.target;typeof u?.closest=="function"&&u.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||(d.key==="Escape"&&l.classList.contains("is-open")?(c(!1),r.screens.focus()):d.key==="/"&&(d.preventDefault(),r.focusSearch()))}),t.jump=d=>s.jump(d),e.classList.add("dv-board-app"),e.append(r.el,r.searchRow,o("div",{class:"dv-main"},l,i,s.el)),s.render()}function Jn(){let t=document.getElementById("dv-app"),e=document.getElementById("dv-data")?.textContent;if(!t||!e){an(document),cn(document);return}let n=new Pe(JSON.parse(e));n.data.kind==="preview"&&n.data.preview?nn(n,t):Xn(n,t),Nt(n,(s,r)=>Jt(n,s,r))}Jn();})();
|
package/package.json
CHANGED