contour-ds 1.5.0 → 1.7.2

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.
Files changed (64) hide show
  1. package/README.md +25 -3
  2. package/dist/build-manifest.json +79 -79
  3. package/dist/contour-wc.esm.js +348 -38
  4. package/dist/contour-wc.esm.min.js +1 -1
  5. package/dist/contour-wc.js +348 -38
  6. package/dist/contour-wc.min.js +1 -1
  7. package/dist/contour.components.json +2280 -204
  8. package/dist/contour.css +1658 -857
  9. package/dist/contour.d.ts +10 -1
  10. package/dist/contour.esm.js +7 -0
  11. package/dist/contour.esm.min.js +1 -1
  12. package/dist/contour.js +7 -0
  13. package/dist/contour.min.css +1 -1
  14. package/dist/contour.min.js +1 -1
  15. package/dist/contour.tokens.json +10 -2
  16. package/dist/docs/actions.md +2 -2
  17. package/dist/docs/affordances.md +4 -2
  18. package/dist/docs/apireference.md +30 -0
  19. package/dist/docs/colour.md +2 -2
  20. package/dist/docs/componentindex.md +2 -2
  21. package/dist/docs/data.md +2 -2
  22. package/dist/docs/docs.md +2 -2
  23. package/dist/docs/feedback.md +2 -2
  24. package/dist/docs/field.md +2 -2
  25. package/dist/docs/forms.md +2 -2
  26. package/dist/docs/index.json +24 -11
  27. package/dist/docs/install.md +2 -2
  28. package/dist/docs/landing.md +2 -2
  29. package/dist/docs/mapengine.md +2 -2
  30. package/dist/docs/motion.md +2 -2
  31. package/dist/docs/navigation.md +2 -2
  32. package/dist/docs/overlays.md +2 -2
  33. package/dist/docs/overview.md +2 -2
  34. package/dist/docs/patterns.md +2 -2
  35. package/dist/docs/playground.md +2 -2
  36. package/dist/docs/principles.md +2 -2
  37. package/dist/docs/recipes.md +2 -2
  38. package/dist/docs/space.md +2 -2
  39. package/dist/docs/status.md +2 -2
  40. package/dist/docs/surfaces.md +2 -2
  41. package/dist/docs/theming.md +2 -2
  42. package/dist/docs/type.md +2 -2
  43. package/dist/docs/webcomponents.md +3 -7
  44. package/dist/registry/items/contour-core.json +2 -2
  45. package/dist/registry/items/contour-data.json +2 -2
  46. package/dist/registry/items/contour-docs.json +2 -2
  47. package/dist/registry/items/contour-landing.json +2 -2
  48. package/dist/registry/registry.json +8 -8
  49. package/dist/surfaces/contour-core.min.css +1 -1
  50. package/dist/surfaces/contour-data.min.css +1 -1
  51. package/dist/surfaces/contour-docs.min.css +1 -1
  52. package/dist/surfaces/contour-landing.min.css +1 -1
  53. package/dist/wc/content.mjs +1 -0
  54. package/dist/wc/core.mjs +33 -3
  55. package/dist/wc/data.mjs +96 -21
  56. package/dist/wc/docs.mjs +117 -0
  57. package/dist/wc/forms.mjs +6 -2
  58. package/dist/wc/index.mjs +25 -1
  59. package/dist/wc/interaction.mjs +3 -1
  60. package/dist/wc/layout.mjs +2 -2
  61. package/dist/wc/map.mjs +21 -0
  62. package/dist/wc/navigation.mjs +2 -1
  63. package/dist/wc/ui.mjs +67 -8
  64. package/package.json +1 -1
@@ -1 +1 @@
1
- (()=>{"use strict";if(window.Contour&&window.Contour.__loaded)return;const $=(sel,root=document)=>root.querySelector(sel);const $$=(sel,root=document)=>Array.from((root||document).querySelectorAll(sel));const isTyping=(el)=>!!el&&(el.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(el.tagName));const reducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)");const goTo=(el)=>{if(!el)return;if(el.id&&location.hash!=="#"+el.id){history.replaceState(null,"","#"+el.id)}el.scrollIntoView({behavior:reducedMotion.matches?"auto":"smooth",block:"start",})};const schemeMeta=()=>$('meta[name="color-scheme"]');const storedScheme=()=>{try{return localStorage.getItem("contour-scheme")??"light dark"}catch{return"light dark"}};const applyScheme=(value)=>{document.documentElement.classList.add("is-theme-switching");const meta=schemeMeta();if(meta)meta.setAttribute("content",value);requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.documentElement.classList.remove("is-theme-switching")})});try{if(value==="light dark")localStorage.removeItem("contour-scheme");else localStorage.setItem("contour-scheme",value)}catch{}syncSchemeControls(value)};const resolvedScheme=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";function syncSchemeControls(value){const resolved=resolvedScheme();const rendered=value==="light dark"?resolved:value;const target=rendered==="dark"?"light":"dark";$$("[data-scheme-toggle]").forEach((btn)=>{btn.dataset.schemeNext=target;btn.setAttribute("aria-label",target==="dark"?"Switch to dark theme":"Switch to light theme",);btn.setAttribute("title",value==="light dark"?`Following the system (${resolved}). Activate to switch to ${target}.`:`Manual: ${value}. Activate to switch to ${target}.`,)});$$("[data-scheme-option]").forEach((el)=>{const active=el.dataset.schemeOption===value;if(el.type==="radio"){el.checked=active}else{el.setAttribute("aria-checked",String(active));el.tabIndex=active?0:-1}})}$$("[data-scheme-toggle]").forEach((btn)=>{btn.addEventListener("click",()=>{const current=storedScheme();const rendered=current==="light dark"?resolvedScheme():current;const target=rendered==="dark"?"light":"dark";const system=resolvedScheme();applyScheme(target===system?"light dark":target)})});$$("[data-scheme-option]").forEach((el)=>{if(el.type==="radio"){el.addEventListener("change",()=>applyScheme(el.dataset.schemeOption));return}el.addEventListener("click",()=>applyScheme(el.dataset.schemeOption));el.addEventListener("keydown",(event)=>{const options=$$("[data-scheme-option]").filter((o)=>o.type!=="radio");const index=options.indexOf(el);if(event.key==="ArrowRight"||event.key==="ArrowDown"){event.preventDefault();options[(index+1)%options.length].focus();options[(index+1)%options.length].click()}if(event.key==="ArrowLeft"||event.key==="ArrowUp"){event.preventDefault();const prev=options[(index-1+options.length)%options.length];prev.focus();prev.click()}})});window.addEventListener("storage",(event)=>{if(event.key==="contour-scheme")syncSchemeControls(storedScheme())});window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{syncSchemeControls(storedScheme())});syncSchemeControls(storedScheme());$$("[data-tabs]").forEach((group)=>{const list=$("[role='tablist']",group);const tabs=$$("[role='tab']",list);if(!tabs.length)return;const activate=(tab,focus=true)=>{tabs.forEach((t)=>{const selected=t===tab;t.setAttribute("aria-selected",String(selected));t.tabIndex=selected?0:-1;const panel=document.getElementById(t.getAttribute("aria-controls"));if(panel)panel.hidden=!selected});if(focus)tab.focus()};tabs.forEach((tab,index)=>{tab.addEventListener("click",()=>activate(tab,false));tab.addEventListener("keydown",(event)=>{const map={ArrowRight:index+1,ArrowLeft:index-1,Home:0,End:tabs.length-1,};if(!(event.key in map))return;event.preventDefault();const next=tabs[(map[event.key]+tabs.length)%tabs.length];activate(next)})});if(tabs[0])activate(tabs[0],false)});$$("[data-segmented]").forEach((group)=>{const options=$$("button",group);options.forEach((option)=>{option.addEventListener("click",()=>{options.forEach((o)=>o.setAttribute("aria-pressed",String(o===option)));group.dispatchEvent(new CustomEvent("contour:change",{detail:{value:option.dataset.value}}),)})})});const paintRange=(input)=>{const min=Number(input.min||0);const max=Number(input.max||100);const value=Number(input.value);const pct=max===min?0:((value-min)/(max-min))*100;input.style.setProperty("--fill",`${pct}%`);const output=document.getElementById(input.getAttribute("aria-describedby")||"");if(output)output.textContent=input.dataset.format?formatValue(input,value):value};const formatValue=(input,value)=>{const format=input.dataset.format||"";if(format==="deg")return`${value}°`;if(format==="ms")return`${value} ms`;if(format==="km")return`${value.toFixed(1)} km`;if(format==="pct")return`${value}%`;return String(value)};$$('input[type="range"].c-range').forEach((input)=>{paintRange(input);input.addEventListener("input",()=>{paintRange(input);input.dispatchEvent(new CustomEvent("contour:input",{bubbles:true,detail:{value:Number(input.value)}}))})});$$('.c-time-slider__play').forEach((btn)=>{btn.addEventListener('click',()=>{const playing=btn.getAttribute('data-state')==='play';btn.setAttribute('data-state',playing?'pause':'play');btn.setAttribute('aria-label',playing?'Pause':'Play');const use=btn.querySelector('use');if(use)use.setAttribute('href',playing?'#i-pause':'#i-play')})});const railLinks=$$("[data-spy] a");if(railLinks.length){const sections=railLinks.map((link)=>document.getElementById(link.getAttribute("href")?.slice(1))).filter(Boolean);const setActive=(id)=>{railLinks.forEach((link)=>{const active=link.getAttribute("href")===`#${id}`;link.setAttribute("aria-current",active?"true":"false")})};if(sections[0])setActive(sections[0].id);if("IntersectionObserver"in window){const spy=new IntersectionObserver((entries)=>{const visible=entries.filter((e)=>e.isIntersecting).sort((a,b)=>a.boundingClientRect.top-b.boundingClientRect.top);if(visible[0])setActive(visible[0].target.id)},{rootMargin:"-20% 0px -70% 0px"},);sections.forEach((section)=>spy.observe(section))}}const copyText=async(text)=>{try{await navigator.clipboard.writeText(text);return true}catch{try{const ta=document.createElement("textarea");ta.value=text;ta.setAttribute("readonly","");ta.style.position="fixed";ta.style.top="-9999px";ta.style.opacity="0";document.body.append(ta);ta.select();const ok=document.execCommand("copy");ta.remove();return ok}catch{return false}}};document.addEventListener("click",async(event)=>{const trigger=event.target.closest("[data-copy]");if(!trigger)return;if(trigger.closest("summary"))event.preventDefault();const selector=trigger.dataset.copy;const source=selector?$(selector):trigger.previousElementSibling;const text=source?.textContent?.trim()??"";if(!text)return;const ok=await copyText(text);const icon=trigger.querySelector("use");const originalHref=icon?.getAttribute("href");const originalLabel=trigger.getAttribute("aria-label")||trigger.title;if(ok&&icon)icon.setAttribute("href","#i-check");trigger.setAttribute("aria-label",ok?"Copied":"Copy failed");trigger.dataset.copied=String(ok);const timer=setTimeout(()=>{if(!trigger.isConnected)return;if(icon&&originalHref)icon.setAttribute("href",originalHref);trigger.setAttribute("aria-label",originalLabel);delete trigger.dataset.copied},1600)});let toastHost=$("#toast-host");const ensureToastHost=()=>{if(!toastHost||!document.contains(toastHost)){toastHost=document.createElement("div");toastHost.id="toast-host";toastHost.className="c-toast-host";document.body.append(toastHost)}if(!toastHost.getAttribute("role"))toastHost.setAttribute("role","status");if(!toastHost.hasAttribute("aria-live"))toastHost.setAttribute("aria-live","polite");return toastHost};ensureToastHost();const showToast=(message,variant="success")=>{const host=ensureToastHost();if(!host)return;const toast=document.createElement("div");toast.className=`c-toast c-toast--${variant}`;toast.innerHTML=`<span class="c-dot c-dot--${variant === "danger" ? "danger" : "success"}"></span><span></span>`;toast.querySelector("span:last-child").textContent=message;host.append(toast);requestAnimationFrame(()=>{toast.animate([{opacity:0,transform:"translateY(0.75rem) scale(0.98)"},{opacity:1,transform:"none"},],{duration:240,easing:"cubic-bezier(0.16, 1, 0.3, 1)"},)});setTimeout(()=>{toast.animate([{opacity:1},{opacity:0}],{duration:200}).onfinish=()=>toast.remove()},3200)};$$("[data-toast]").forEach((btn)=>btn.addEventListener("click",()=>showToast(btn.dataset.toast,btn.dataset.toastVariant)),);const counters=$$("[data-count]");if(counters.length){const run=(el)=>{const target=Number(el.dataset.count);const decimals=Number(el.dataset.countDecimals||0);const suffix=el.dataset.countSuffix||"";if(reducedMotion.matches){el.textContent=target.toFixed(decimals)+suffix;return}const duration=1100;const start=performance.now();const tick=(now)=>{const t=Math.min(1,(now-start)/duration);const eased=1-Math.pow(1-t,4);el.textContent=(target*eased).toFixed(decimals)+suffix;if(t<1)requestAnimationFrame(tick)};requestAnimationFrame(tick)};if("IntersectionObserver"in window){const obs=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{if(!entry.isIntersecting)return;run(entry.target);obs.unobserve(entry.target)})},{threshold:0.4},);counters.forEach((el)=>obs.observe(el))}else{counters.forEach(run)}}const playground=$("[data-playground]");if(playground){const scope=$("[data-playground-scope]",playground)||document.documentElement;const outputs=$$("[data-playground-out]",playground);const write=(key,value)=>{scope.style.setProperty(key,value);outputs.forEach((out)=>{if(out.dataset.playgroundOut===key)out.textContent=value})};$$("[data-playground-input]",playground).forEach((input)=>{const key=input.dataset.playgroundInput;const unit=input.dataset.playgroundUnit||"";const divisor=Number(input.dataset.playgroundDivisor||1);const handler=()=>{const raw=Number(input.value);write(key,divisor===1?`${raw}${unit}`:`${raw / divisor}`)};input.addEventListener("input",handler);handler()});const reset=$("[data-playground-reset]",playground);reset?.addEventListener("click",()=>{$$("[data-playground-input]",playground).forEach((input)=>{input.value=input.defaultValue;input.dispatchEvent(new Event("input",{bubbles:true}))})})}const navToggle=$("[data-nav-toggle]");const nav=$("#primary-nav");if(navToggle&&nav){navToggle.addEventListener("click",()=>{const open=navToggle.getAttribute("aria-expanded")==="true";navToggle.setAttribute("aria-expanded",String(!open));nav.classList.toggle("is-open",!open)})}$$("[data-dialog-open]").forEach((btn)=>{const dialog=document.getElementById(btn.dataset.dialogOpen);btn.addEventListener("click",()=>dialog?.showModal())});$$("[data-dialog-close]").forEach((btn)=>{const dialog=btn.closest("dialog");btn.addEventListener("click",()=>dialog?.close())});$$("[data-menu-toggle]").forEach((btn)=>{const menu=document.getElementById(btn.dataset.menuToggle);if(!menu)return;btn.setAttribute("popovertarget",menu.id);menu.addEventListener("toggle",(e)=>{btn.setAttribute("aria-expanded",String(e.newState==="open"))})});$$("[data-drawer-toggle]").forEach((btn)=>{const drawer=document.getElementById(btn.dataset.drawerToggle);if(!drawer)return;btn.setAttribute("popovertarget",drawer.id);drawer.addEventListener("toggle",(e)=>{btn.setAttribute("aria-expanded",String(e.newState==="open"))})});$$("[data-alert-close]").forEach((btn)=>{btn.addEventListener("click",()=>{const alertEl=btn.closest(".c-alert");if(!alertEl)return;const animation=alertEl.animate([{opacity:1},{opacity:0,transform:"translateX(-8px)"}],{duration:180,easing:"ease-in"},);animation.onfinish=()=>alertEl.remove()})});if("popover"in HTMLElement.prototype){$$("[data-tooltip]").forEach((trigger)=>{const tip=document.getElementById(trigger.dataset.tooltip);if(!tip)return;trigger.setAttribute("popovertarget",tip.id);trigger.setAttribute("aria-describedby",tip.id)})}else{$$("[data-tooltip]").forEach((trigger)=>{const tip=document.getElementById(trigger.dataset.tooltip);if(!tip)return;trigger.setAttribute("title",tip.textContent.trim())})}const palette=$("[data-command-palette]");if(palette){const field=$("[data-command-field]",palette);const list=$("[data-command-list]",palette);const empty=$("[data-command-empty]",palette);const supportsPopover=typeof palette.showPopover==="function";let index=[];let filtered=[];let active=0;const fuzzy=(query,text)=>{if(!query)return{score:0,hits:[]};const q=query.toLowerCase();const t=text.toLowerCase();const hits=[];let ti=0;let score=0;let streak=0;for(const ch of q){if(ch===" ")continue;const found=t.indexOf(ch,ti);if(found===-1)return null;hits.push(found);streak=found===ti?streak+1:0;score+=10+streak*6-Math.min(found-ti,8);ti=found+1}if(t.startsWith(q))score+=40;else if(t.includes(q))score+=25;score-=text.length*0.12;return{score,hits}};const buildIndex=()=>{const found=[];const push=(group,title,hint,icon,run)=>{if(!title)return;found.push({group,title,hint,icon,run})};$$("[data-command-nav] a[href]").forEach((a)=>{const clone=a.cloneNode(true);clone.querySelectorAll(".c-docs-nav__badge, .c-badge, .c-tag, .c-kbd").forEach((n)=>n.remove());push(a.dataset.commandGroup||"Navigate",clone.textContent.trim(),a.dataset.commandHint||"",a.dataset.commandIcon||"i-file",()=>{location.hash=a.getAttribute("href")},)});$$("main section[id]").forEach((section)=>{const heading=$(".c-section-head__title",section)||$("h2",section)||$("h3",section);push("Sections",heading?heading.textContent.replace(/[\u00b6#]/g,"").trim():"",section.id,"i-hash",()=>goTo(section),)});$$("main h2[id], main h3[id]").forEach((h)=>{push("Sections",h.textContent.replace(/[\u00b6#]/g,"").trim(),h.tagName==="H2"?"Section":"Subsection","i-hash",()=>goTo(h),)});$$("[data-command-action]").forEach((b)=>{push("Actions",b.dataset.commandAction,b.dataset.commandHint||"",b.dataset.commandIcon||"i-zap",()=>b.click(),)});commandRegistry.forEach((cmd)=>{push("Commands",cmd.label,cmd.shortcut||"","i-zap",()=>cmd.run(),)});return found};const escapeHtml=(text)=>text.replace(/[&<>"]/g,(c)=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;",})[c]);const highlight=(text,hits)=>{if(!hits?.length)return escapeHtml(text);const set=new Set(hits);let html="";for(let i=0;i<text.length;i++){html+=set.has(i)?'<mark class="c-command__mark">'+escapeHtml(text[i])+"</mark>":escapeHtml(text[i])}return html};const matchCommand=(query,cmd)=>{const title=fuzzy(query,cmd.title);if(title)return{score:title.score+24,hits:title.hits,hintHits:[]};const hint=fuzzy(query,cmd.hint);if(hint)return{score:hint.score+8,hits:[],hintHits:hint.hits};const group=fuzzy(query,cmd.group);if(group)return{score:group.score,hits:[],hintHits:[]};return null};const items=()=>$$(".c-command__item",list);function setActive(position){const all=items();if(!all.length){field.removeAttribute("aria-activedescendant");return}active=(position+all.length)%all.length;all.forEach((el,i)=>el.setAttribute("aria-selected",String(i===active)));const activeEl=all[active];if(activeEl&&!activeEl.id)activeEl.id="command-item-"+active;if(activeEl)field.setAttribute("aria-activedescendant",activeEl.id);all[active].scrollIntoView({block:"nearest"})}const render=()=>{const query=field.value.trim();filtered=index.map((cmd)=>{const match=matchCommand(query,cmd);return match?Object.assign({},cmd,match):null}).filter(Boolean).sort((a,b)=>b.score-a.score);if(!filtered.length){list.innerHTML="";if(empty)empty.hidden=false;return}if(empty)empty.hidden=true;const groups=new Map();filtered.forEach((cmd)=>{if(!groups.has(cmd.group))groups.set(cmd.group,[]);groups.get(cmd.group).push(cmd)});list.innerHTML=Array.from(groups,([group,cmds])=>{const rows=cmds.map((cmd)=>{const position=filtered.indexOf(cmd);const safeGroup=escapeHtml(group);const hint=cmd.hint?safeGroup+" \u00b7 "+highlight(cmd.hint,cmd.hintHits):safeGroup;return('<button class="c-command__item" role="option" aria-selected="false" tabindex="-1" id="command-item-'+position+'" data-index="'+position+'" type="button">'+'<span class="c-command__item-icon"><svg aria-hidden="true"><use href="#'+escapeHtml(cmd.icon)+'"/></svg></span>'+'<span class="c-command__item-body">'+'<span class="c-command__item-title">'+highlight(cmd.title,cmd.hits)+"</span>"+'<span class="c-command__item-hint">'+hint+"</span>"+"</span>"+"</button>")}).join("");return('<div class="c-command__group"><div class="c-command__group-title">'+escapeHtml(group)+"</div>"+rows+"</div>")}).join("");setActive(0)};const open=()=>{index=buildIndex();field.value="";render();field.setAttribute("aria-expanded","true");if(supportsPopover)palette.showPopover();else palette.classList.add("is-open");requestAnimationFrame(()=>field.focus())};const close=()=>{field.setAttribute("aria-expanded","false");field.removeAttribute("aria-activedescendant");if(supportsPopover)palette.hidePopover();else palette.classList.remove("is-open")};const isOpen=()=>supportsPopover?palette.matches(":popover-open"):palette.classList.contains("is-open");field?.addEventListener("input",render);field?.addEventListener("keydown",(event)=>{if(event.key==="ArrowDown"){event.preventDefault();setActive(active+1)}else if(event.key==="ArrowUp"){event.preventDefault();setActive(active-1)}else if(event.key==="Enter"){event.preventDefault();const all=items();if(all[active])all[active].click()}else if(event.key==="Escape"){if(field.value){event.preventDefault();field.value="";render()}else{close()}}});list?.addEventListener("click",(event)=>{const item=event.target.closest(".c-command__item");if(!item)return;const cmd=filtered[Number(item.dataset.index)];if(!cmd)return;close();cmd.run()});document.addEventListener("keydown",(event)=>{if(event.key.toLowerCase()==="k"&&(event.metaKey||event.ctrlKey)&&!isTyping(event.target)){event.preventDefault();if(isOpen())close();else open();return}if(event.key==="/"&&!event.metaKey&&!event.ctrlKey&&!event.altKey&&!isTyping(event.target)){event.preventDefault();if(!isOpen())open()}if(event.key==="?"&&!event.metaKey&&!event.ctrlKey&&!event.altKey&&!isTyping(event.target)){event.preventDefault();const overlay=document.querySelector("[data-shortcut-overlay]");if(overlay){if(overlay.hasAttribute("hidden")){overlay.removeAttribute("hidden")}else{overlay.setAttribute("hidden","")}}return}if(event.key==="Escape"){const overlay=document.querySelector("[data-shortcut-overlay]");if(overlay&&!overlay.hasAttribute("hidden")){overlay.setAttribute("hidden","")}}if(!isTyping(event.target)){const mod=event.metaKey||event.ctrlKey;for(const cmd of commandRegistry){if(!cmd.shortcut)continue;const parts=String(cmd.shortcut).toLowerCase().split("+").map((p)=>p.trim());const needsMod=parts.includes("mod")||parts.includes("ctrl")||parts.includes("meta");const key=parts.filter((p)=>!["mod","ctrl","meta","shift","alt"].includes(p))[0];if(needsMod!==mod)continue;if(parts.includes("shift")!==event.shiftKey)continue;if(parts.includes("alt")!==event.altKey)continue;if(key&&event.key.toLowerCase()===key){event.preventDefault();cmd.run();return}}}});$$("[data-command-open]").forEach((btn)=>btn.addEventListener("click",(event)=>{event.preventDefault();open()}),)}$$("table[data-sortable]").forEach((table)=>{const headers=$$("th[aria-sort]",table);const tbody=table.tBodies[0];if(!tbody)return;headers.forEach((th)=>{th.setAttribute("tabindex","0");th.setAttribute("role","columnheader");const apply=()=>{const type=th.dataset.sortType||"text";const dir=th.getAttribute("aria-sort")==="ascending"?-1:1;headers.forEach((h)=>{if(h!==th)h.setAttribute("aria-sort","none")});th.setAttribute("aria-sort",dir===1?"ascending":"descending");const rows=Array.from(tbody.rows);rows.sort((a,b)=>{const av=a.cells[th.cellIndex]?.dataset.value??a.cells[th.cellIndex]?.textContent.trim()??"";const bv=b.cells[th.cellIndex]?.dataset.value??b.cells[th.cellIndex]?.textContent.trim()??"";if(type==="number")return(parseFloat(av)||0)*dir-(parseFloat(bv)||0)*dir;return av.localeCompare(bv,undefined,{numeric:true})*dir});rows.forEach((row)=>tbody.append(row))};th.addEventListener("click",apply);th.addEventListener("keydown",(event)=>{if(event.key==="Enter"||event.key===" "){event.preventDefault();apply()}})})});$$("[data-density-toggle]").forEach((group)=>{const scope=document.querySelector(group.dataset.densityToggle)||document;const options=$$("button",group);options.forEach((option)=>{option.addEventListener("click",()=>{options.forEach((o)=>o.setAttribute("aria-pressed",String(o===option)));scope.setAttribute("data-density",option.dataset.value)})})});const tocLinks=$$("[data-toc] a");if(tocLinks.length){const headings=tocLinks.map((link)=>document.getElementById(link.getAttribute("href")?.slice(1))).filter(Boolean);const setCurrent=(id)=>{tocLinks.forEach((link)=>{link.setAttribute("aria-current",link.getAttribute("href")===`#${id}`?"true":"false")})};if("IntersectionObserver"in window){const spy=new IntersectionObserver((entries)=>{const visible=entries.filter((e)=>e.isIntersecting).sort((a,b)=>a.boundingClientRect.top-b.boundingClientRect.top);if(visible[0])setCurrent(visible[0].target.id)},{rootMargin:"-15% 0px -75% 0px"},);headings.forEach((h)=>spy.observe(h))}}document.addEventListener("click",(event)=>{const remove=event.target.closest("[data-remove]");if(!remove)return;const target=remove.closest("[data-removable]")||remove.parentElement;target?.remove()});function linearScale(domain,range){const[d0,d1]=domain;const[r0,r1]=range;const span=d1-d0||1;return(v)=>r0+((v-d0)/span)*(r1-r0)}function niceTicks(min,max,count){count=count||5;const span=max-min||1;const step=Math.pow(10,Math.floor(Math.log10(span/count)));const err=(count*step)/span;if(!isFinite(step)||step<=0)return[min,max];let niceStep=step;if(!isFinite(niceStep)||niceStep<=0)niceStep=step||1;if(err<=0.15)niceStep=10*step;else if(err<=0.35)niceStep=5*step;else if(err<=0.75)niceStep=2*step;const niceMin=Math.floor(min/niceStep)*niceStep;const niceMax=Math.ceil(max/niceStep)*niceStep;const ticks=[];for(let v=niceMin;v<=niceMax+niceStep/2;v+=niceStep){ticks.push(Math.round(v*1e9)/1e9)}return ticks}function datum(x,y,r){r=r||3;return{cx:x,cy:y,r:r}}const commandRegistry=[];function registerCommand(cmd){if(!cmd||!cmd.id||typeof cmd.id!=="string")return;if(cmd.label!=null&&typeof cmd.label!=="string")return;if(cmd.shortcut!=null&&typeof cmd.shortcut!=="string")return;if(cmd.run!=null&&typeof cmd.run!=="function")return;commandRegistry.push(Object.freeze({id:cmd.id,label:cmd.label||cmd.id,shortcut:cmd.shortcut||null,run:typeof cmd.run==="function"?cmd.run:function(){},}))}function listCommands(){return commandRegistry.slice()}$$("[data-cvd-toggle]").forEach((group)=>{const scope=document.getElementById("data")||document.documentElement;const targets=()=>$$(".u-cvd-target, .c-chart, .c-datamark",scope);$$("button",group).forEach((btn)=>{btn.addEventListener("click",()=>{const value=btn.dataset.cvdValue||"";targets().forEach((el)=>{if(value)el.setAttribute("data-cvd",value);else el.removeAttribute("data-cvd")});$$("button",group).forEach((b)=>b.setAttribute("aria-pressed",String(b===btn)))})})});$$("[data-theme-set]").forEach((group)=>{$$("button",group).forEach((btn)=>{btn.addEventListener("click",()=>{const value=btn.dataset.themeValue||"";if(value)document.documentElement.setAttribute("data-theme",value);else document.documentElement.removeAttribute("data-theme");$$("button",group).forEach((b)=>b.setAttribute("aria-pressed",String(b===btn)))})})});$$("[data-profile-toggle]").forEach((group)=>{const scope=document.getElementById(group.dataset.profileScope||"data")||document.documentElement;$$("button",group).forEach((btn)=>{btn.addEventListener("click",()=>{const value=btn.dataset.profileValue||"";if(value)scope.setAttribute("data-profile",value);else scope.removeAttribute("data-profile");$$("button",group).forEach((b)=>b.setAttribute("aria-pressed",String(b===btn)))})})});$$("[data-motion-toggle]").forEach((group)=>{const scope=(group.dataset.motionScope&&document.getElementById(group.dataset.motionScope))||document.documentElement;$$("button",group).forEach((btn)=>{btn.addEventListener("click",()=>{const value=btn.dataset.motionValue||"auto";if(value==="auto")scope.removeAttribute("data-motion");else scope.setAttribute("data-motion",value);$$("button",group).forEach((b)=>b.setAttribute("aria-pressed",String(b===btn)))})})});const marchingSquares=(grid,level)=>{const rows=grid.length;const cols=grid[0].length;const segments=[];const lerp=(a,b,va,vb)=>{if(vb===va)return 0.5;return(level-va)/(vb-va)};for(let y=0;y<rows-1;y++){for(let x=0;x<cols-1;x++){const tl=grid[y][x];const tr=grid[y][x+1];const bl=grid[y+1][x];const br=grid[y+1][x+1];const code=(tl>=level?8:0)|(tr>=level?4:0)|(br>=level?2:0)|(bl>=level?1:0);if(code===0||code===15)continue;const top={x:x+lerp(tl,tr,tl,tr),y:y};const right={x:x+1,y:y+lerp(tr,br,tr,br)};const bottom={x:x+lerp(bl,br,bl,br),y:y+1};const left={x:x,y:y+lerp(tl,bl,tl,bl)};let connect;if(code===5){const center=(tl+tr+bl+br)/4;connect=center>=level?"top-bottom":"left-right"}else if(code===10){const center=(tl+tr+bl+br)/4;connect=center>=level?"left-right":"top-bottom"}switch(code){case 1:case 14:segments.push([left,bottom]);break;case 2:case 13:segments.push([bottom,right]);break;case 3:case 12:segments.push([left,right]);break;case 4:case 11:segments.push([top,right]);break;case 6:case 9:segments.push([top,bottom]);break;case 7:case 8:segments.push([left,top]);break;case 5:if(connect==="top-bottom"){segments.push([top,bottom]);segments.push([left,right])}else{segments.push([top,right]);segments.push([left,bottom])}break;case 10:if(connect==="left-right"){segments.push([left,right]);segments.push([top,bottom])}else{segments.push([top,right]);segments.push([left,bottom])}break}}}return segments};const renderContourPlot=(el)=>{const svg=el.querySelector("svg");if(!svg)return;const valuesAttr=el.getAttribute("data-values");const levelsAttr=el.getAttribute("data-levels");if(!valuesAttr)return;let grid;try{grid=JSON.parse(valuesAttr)}catch(e){return}const levels=levelsAttr?JSON.parse(levelsAttr):[0.3,0.5,0.7];const rows=grid.length;const cols=grid[0].length;const w=el.clientWidth||300;const h=el.clientHeight||300;const sx=w/(cols-1);const sy=h/(rows-1);svg.querySelectorAll(".c-contour-plot__contour").forEach((n)=>n.remove());levels.forEach((level,li)=>{const segs=marchingSquares(grid,level);const path=document.createElementNS("http://www.w3.org/2000/svg","path");let d="";for(const[a,b]of segs){d+=`M ${a.x * sx} ${a.y * sy} L ${b.x * sx} ${b.y * sy} `}path.setAttribute("d",d.trim());path.setAttribute("class","c-contour-plot__contour"+(li>0?" c-contour-plot__contour--level-"+(li+1):""));svg.appendChild(path)})};$$("[data-contour-plot]").forEach((el)=>{renderContourPlot(el);if(typeof ResizeObserver!=="undefined"){new ResizeObserver(()=>renderContourPlot(el)).observe(el)}});$$("[data-chart-export]").forEach((chart)=>{const btn=document.createElement("button");btn.className="c-btn c-btn--sm c-btn--ghost";btn.textContent="Export";btn.setAttribute("aria-label","Export chart");btn.addEventListener("click",()=>{const svg=chart.querySelector("svg");if(!svg)return;const serializer=new XMLSerializer();const svgStr=serializer.serializeToString(svg);const blob=new Blob([svgStr],{type:"image/svg+xml"});const url=URL.createObjectURL(blob);const a=document.createElement("a");a.href=url;a.download="chart.svg";a.click();URL.revokeObjectURL(url)});chart.appendChild(btn)});$$(".c-combobox").forEach((combo)=>{const input=combo.querySelector(".c-combobox__input");const list=combo.querySelector(".c-combobox__list");if(!input||!list)return;const options=[...list.querySelectorAll(".c-combobox__option")];let activeIndex=-1;const filter=(query)=>{const q=query.toLowerCase();options.forEach((opt)=>{const text=opt.textContent.toLowerCase();opt.hidden=q&&!text.includes(q)});activeIndex=-1};const open=()=>list.removeAttribute("hidden");const close=()=>list.setAttribute("hidden","");input.addEventListener("input",()=>{filter(input.value);open()});input.addEventListener("focus",()=>{filter(input.value);open()});input.addEventListener("keydown",(e)=>{const visible=options.filter((o)=>!o.hidden);if(e.key==="ArrowDown"){e.preventDefault();activeIndex=Math.min(activeIndex+1,visible.length-1);visible.forEach((o,i)=>o.classList.toggle("c-combobox__option--active",i===activeIndex))}else if(e.key==="ArrowUp"){e.preventDefault();activeIndex=Math.max(activeIndex-1,0);visible.forEach((o,i)=>o.classList.toggle("c-combobox__option--active",i===activeIndex))}else if(e.key==="Enter"){e.preventDefault();if(activeIndex>=0&&visible[activeIndex]){input.value=visible[activeIndex].textContent;close()}}else if(e.key==="Escape"){close()}});list.addEventListener("click",(e)=>{const opt=e.target.closest(".c-combobox__option");if(opt){input.value=opt.textContent;close();input.focus()}});document.addEventListener("click",(e)=>{if(!combo.contains(e.target))close()})});$$(".c-tree__toggle").forEach((toggle)=>{toggle.addEventListener("click",(e)=>{e.stopPropagation();const expanded=toggle.getAttribute("aria-expanded")==="true";toggle.setAttribute("aria-expanded",String(!expanded));const row=toggle.closest(".c-tree__row");if(row)row.setAttribute("aria-expanded",String(!expanded));const children=toggle.closest(".c-tree__node")?.querySelector(":scope > .c-tree__children");if(children){if(expanded)children.setAttribute("hidden","");else children.removeAttribute("hidden")}})});$$(".c-resize-handle").forEach((handle)=>{handle.setAttribute("tabindex","0");handle.setAttribute("role","separator");if(!handle.hasAttribute("aria-valuenow"))handle.setAttribute("aria-valuenow","50");if(!handle.hasAttribute("aria-valuemin"))handle.setAttribute("aria-valuemin","0");if(!handle.hasAttribute("aria-valuemax"))handle.setAttribute("aria-valuemax","100");if(!handle.hasAttribute("aria-orientation"))handle.setAttribute("aria-orientation","vertical");handle.addEventListener("pointerdown",(e)=>{e.preventDefault();handle.setPointerCapture(e.pointerId);handle.classList.add("c-resize-handle--dragging");const resizable=handle.closest(".c-resizable");const isHorizontal=resizable?.classList.contains("c-resizable--horizontal");const prevPane=handle.previousElementSibling;const nextPane=handle.nextElementSibling;if(!prevPane||!nextPane)return;const startPos=isHorizontal?e.clientX:e.clientY;const prevSize=isHorizontal?prevPane.offsetWidth:prevPane.offsetHeight;const nextSize=isHorizontal?nextPane.offsetWidth:nextPane.offsetHeight;const onMove=(ev)=>{const delta=(isHorizontal?ev.clientX:ev.clientY)-startPos;const newPrev=Math.max(50,prevSize+delta);const newNext=Math.max(50,nextSize-delta);prevPane.style.flex="0 0 "+newPrev+"px";nextPane.style.flex="0 0 "+newNext+"px"};const onUp=()=>{handle.classList.remove("c-resize-handle--dragging");handle.releasePointerCapture(e.pointerId);document.removeEventListener("pointermove",onMove);document.removeEventListener("pointerup",onUp)};document.addEventListener("pointermove",onMove);document.addEventListener("pointerup",onUp)});handle.addEventListener("keydown",(e)=>{const resizable=handle.closest(".c-resizable");const isHorizontal=resizable?.classList.contains("c-resizable--horizontal");const prevPane=handle.previousElementSibling;const nextPane=handle.nextElementSibling;if(!prevPane||!nextPane)return;const step=10;let delta=0;if(isHorizontal){if(e.key==="ArrowLeft")delta=-step;else if(e.key==="ArrowRight")delta=step}else{if(e.key==="ArrowUp")delta=-step;else if(e.key==="ArrowDown")delta=step}if(delta!==0){e.preventDefault();const prevSize=isHorizontal?prevPane.offsetWidth:prevPane.offsetHeight;const nextSize=isHorizontal?nextPane.offsetWidth:nextPane.offsetHeight;const newPrev=Math.max(50,prevSize+delta);const newNext=Math.max(50,nextSize-delta);prevPane.style.flex="0 0 "+newPrev+"px";nextPane.style.flex="0 0 "+newNext+"px"}})});$$(".c-comparison").forEach((comp)=>{const divider=comp.querySelector(".c-comparison__divider");const before=comp.querySelector(".c-comparison__pane--before");if(!divider||!before)return;const setPct=(pct)=>{const clamped=Math.max(2,Math.min(98,pct));divider.style.insetInlineStart=clamped+"%";before.style.clipPath="inset(0 "+(100-clamped)+"% 0 0)";divider.setAttribute("aria-valuenow",String(Math.round(clamped)))};divider.setAttribute("tabindex","0");divider.setAttribute("role","separator");divider.setAttribute("aria-orientation","vertical");divider.setAttribute("aria-valuemin","0");divider.setAttribute("aria-valuemax","100");if(!divider.getAttribute("aria-label")){divider.setAttribute("aria-label","Comparison divider")}const seed=parseFloat(divider.style.insetInlineStart);setPct(Number.isFinite(seed)?seed:50);divider.addEventListener("pointerdown",(e)=>{e.preventDefault();divider.setPointerCapture(e.pointerId);const onMove=(ev)=>{const rect=comp.getBoundingClientRect();if(!rect.width)return;setPct(((ev.clientX-rect.left)/rect.width)*100)};const onUp=()=>{try{divider.releasePointerCapture(e.pointerId)}catch(_){}document.removeEventListener("pointermove",onMove);document.removeEventListener("pointerup",onUp)};document.addEventListener("pointermove",onMove);document.addEventListener("pointerup",onUp)});divider.addEventListener("keydown",(e)=>{const current=parseFloat(divider.style.insetInlineStart);const base=Number.isFinite(current)?current:50;let delta=0;if(e.key==="ArrowLeft")delta=-2;else if(e.key==="ArrowRight")delta=2;if(delta!==0){e.preventDefault();setPct(base+delta)}})});let draggedEl=null;$$(".c-draggable").forEach((el)=>{el.setAttribute("draggable","true");el.setAttribute("tabindex","0");el.addEventListener("dragstart",(e)=>{el.classList.add("c-draggable--dragging");draggedEl=el;e.dataTransfer?.setData("text/plain",el.textContent||"");if(e.dataTransfer)e.dataTransfer.effectAllowed="move"});el.addEventListener("dragend",()=>{el.classList.remove("c-draggable--dragging");draggedEl=null});let touchTimer=null;el.addEventListener("touchstart",()=>{touchTimer=setTimeout(()=>{el.classList.add("c-draggable--dragging");el.style.opacity="0.5"},300)},{passive:true});el.addEventListener("touchend",()=>{if(touchTimer)clearTimeout(touchTimer);el.classList.remove("c-draggable--dragging");el.style.opacity=""});el.addEventListener("touchmove",()=>{if(touchTimer)clearTimeout(touchTimer)},{passive:true});el.addEventListener("keydown",(e)=>{const parent=el.parentElement;if(!parent)return;const siblings=[...parent.querySelectorAll(".c-draggable")];const idx=siblings.indexOf(el);if(e.key==="ArrowUp"&&idx>0){e.preventDefault();el.classList.add("c-draggable--reordering");parent.insertBefore(el,siblings[idx-1]);el.focus();setTimeout(()=>el.classList.remove("c-draggable--reordering"),200)}else if(e.key==="ArrowDown"&&idx<siblings.length-1){e.preventDefault();el.classList.add("c-draggable--reordering");parent.insertBefore(siblings[idx+1],el);el.focus();setTimeout(()=>el.classList.remove("c-draggable--reordering"),200)}})});$$(".c-drop-zone").forEach((zone)=>{zone.addEventListener("dragover",(e)=>{e.preventDefault();zone.classList.add("c-drop-zone--active");const indicator=zone.querySelector(".c-drop-indicator");if(indicator)indicator.classList.add("c-drop-indicator--visible")});zone.addEventListener("dragleave",()=>{zone.classList.remove("c-drop-zone--active");const indicator=zone.querySelector(".c-drop-indicator");if(indicator)indicator.classList.remove("c-drop-indicator--visible")});zone.addEventListener("drop",(e)=>{e.preventDefault();zone.classList.remove("c-drop-zone--active");const indicator=zone.querySelector(".c-drop-indicator");if(indicator)indicator.classList.remove("c-drop-indicator--visible");if(draggedEl){zone.appendChild(draggedEl);draggedEl.classList.remove("c-draggable--dragging");draggedEl=null;return}const data=e.dataTransfer?.getData("text/plain");if(data){const item=document.createElement("span");item.className="c-draggable c-card";item.style.padding="var(--space-sm)";item.style.overflow="hidden";item.style.textOverflow="ellipsis";item.style.whiteSpace="nowrap";item.style.maxInlineSize="100%";item.textContent=data;item.setAttribute("tabindex","0");zone.appendChild(item)}})});$$(".c-layer-panel").forEach((panel)=>{if(!panel.hasAttribute("role"))panel.setAttribute("role","list");const items=()=>[...panel.querySelectorAll(".c-layer-panel__item")];const reorder=(el,dir)=>{const s=items(),i=s.indexOf(el);if(dir<0&&i>0){el.classList.add("c-layer-panel__item--dragging");panel.insertBefore(el,s[i-1]);el.focus();setTimeout(()=>el.classList.remove("c-layer-panel__item--dragging"),200)}else if(dir>0&&i<s.length-1){el.classList.add("c-layer-panel__item--dragging");panel.insertBefore(s[i+1],el);el.focus();setTimeout(()=>el.classList.remove("c-layer-panel__item--dragging"),200)}};items().forEach((item)=>{item.setAttribute("draggable","true");item.setAttribute("tabindex","0");item.setAttribute("role","listitem");item.addEventListener("dragstart",(e)=>{const t=e.target;if(t&&t!==item&&/^(INPUT|BUTTON|SELECT)$/.test(t.tagName)&&!(t.classList&&t.classList.contains("c-drag-handle"))){e.preventDefault();return}item.classList.add("c-layer-panel__item--dragging");e.dataTransfer?.setData("text/plain",item.querySelector(".c-layer-panel__name")?.textContent||"");if(e.dataTransfer)e.dataTransfer.effectAllowed="move"});item.addEventListener("dragend",()=>item.classList.remove("c-layer-panel__item--dragging"));item.addEventListener("dragover",(e)=>{e.preventDefault();const dragged=panel.querySelector(".c-layer-panel__item--dragging");if(!dragged||dragged===item)return;const r=item.getBoundingClientRect(),mid=r.top+r.height/2;if(e.clientY<mid)panel.insertBefore(dragged,item);else panel.insertBefore(dragged,item.nextSibling)});item.addEventListener("keydown",(e)=>{if(e.key==="ArrowUp"){e.preventDefault();reorder(item,-1)}else if(e.key==="ArrowDown"){e.preventDefault();reorder(item,1)}})})});window.Contour=Object.freeze({__loaded:true,version:"1.0",toast:showToast,setScheme:applyScheme,scrollTo:(id)=>{const el=typeof id==="string"?document.getElementById(id):id;if(el)goTo(el)},copy:async(text)=>copyText(text),format:{number:(value,format,locale)=>{const n=Number(value);if(!Number.isFinite(n))return String(value);if(format==="percent")return(n*100).toFixed(0)+"%";try{return new Intl.NumberFormat(locale||undefined).format(n)}catch(e){return String(n)}},time:(value,locale)=>{try{return new Intl.DateTimeFormat(locale||undefined).format(new Date(value))}catch(e){return String(value)}},locale:(locale)=>locale||(typeof navigator!=="undefined"?navigator.language:"en"),},chart:{scale:linearScale,ticks:niceTicks,datum:datum},commands:{register:registerCommand,list:listCommands},})})();
1
+ (()=>{"use strict";if(window.Contour&&window.Contour.__loaded)return;const $=(sel,root=document)=>root.querySelector(sel);const $$=(sel,root=document)=>Array.from((root||document).querySelectorAll(sel));const isTyping=(el)=>!!el&&(el.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(el.tagName));const reducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)");const goTo=(el)=>{if(!el)return;if(el.id&&location.hash!=="#"+el.id){history.replaceState(null,"","#"+el.id)}el.scrollIntoView({behavior:reducedMotion.matches?"auto":"smooth",block:"start",})};const schemeMeta=()=>$('meta[name="color-scheme"]');const storedScheme=()=>{try{return localStorage.getItem("contour-scheme")??"light dark"}catch{return"light dark"}};const applyScheme=(value)=>{document.documentElement.classList.add("is-theme-switching");const meta=schemeMeta();if(meta)meta.setAttribute("content",value);requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.documentElement.classList.remove("is-theme-switching")})});try{if(value==="light dark")localStorage.removeItem("contour-scheme");else localStorage.setItem("contour-scheme",value)}catch{}syncSchemeControls(value)};const resolvedScheme=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";function syncSchemeControls(value){const resolved=resolvedScheme();const rendered=value==="light dark"?resolved:value;const target=rendered==="dark"?"light":"dark";$$("[data-scheme-toggle]").forEach((btn)=>{btn.dataset.schemeNext=target;btn.setAttribute("aria-label",target==="dark"?"Switch to dark theme":"Switch to light theme",);btn.setAttribute("title",value==="light dark"?`Following the system (${resolved}). Activate to switch to ${target}.`:`Manual: ${value}. Activate to switch to ${target}.`,)});$$("[data-scheme-option]").forEach((el)=>{const active=el.dataset.schemeOption===value;if(el.type==="radio"){el.checked=active}else{el.setAttribute("aria-checked",String(active));el.tabIndex=active?0:-1}})}$$("[data-scheme-toggle]").forEach((btn)=>{btn.addEventListener("click",()=>{const current=storedScheme();const rendered=current==="light dark"?resolvedScheme():current;const target=rendered==="dark"?"light":"dark";const system=resolvedScheme();applyScheme(target===system?"light dark":target)})});$$("[data-scheme-option]").forEach((el)=>{if(el.type==="radio"){el.addEventListener("change",()=>applyScheme(el.dataset.schemeOption));return}el.addEventListener("click",()=>applyScheme(el.dataset.schemeOption));el.addEventListener("keydown",(event)=>{const options=$$("[data-scheme-option]").filter((o)=>o.type!=="radio");const index=options.indexOf(el);if(event.key==="ArrowRight"||event.key==="ArrowDown"){event.preventDefault();options[(index+1)%options.length].focus();options[(index+1)%options.length].click()}if(event.key==="ArrowLeft"||event.key==="ArrowUp"){event.preventDefault();const prev=options[(index-1+options.length)%options.length];prev.focus();prev.click()}})});window.addEventListener("storage",(event)=>{if(event.key==="contour-scheme")syncSchemeControls(storedScheme())});window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{syncSchemeControls(storedScheme())});syncSchemeControls(storedScheme());$$("[data-tabs]").forEach((group)=>{const list=$("[role='tablist']",group);const tabs=$$("[role='tab']",list);if(!tabs.length)return;const activate=(tab,focus=true)=>{tabs.forEach((t)=>{const selected=t===tab;t.setAttribute("aria-selected",String(selected));t.tabIndex=selected?0:-1;const panel=document.getElementById(t.getAttribute("aria-controls"));if(panel)panel.hidden=!selected});if(focus)tab.focus()};tabs.forEach((tab,index)=>{tab.addEventListener("click",()=>activate(tab,false));tab.addEventListener("keydown",(event)=>{const map={ArrowRight:index+1,ArrowLeft:index-1,Home:0,End:tabs.length-1,};if(!(event.key in map))return;event.preventDefault();const next=tabs[(map[event.key]+tabs.length)%tabs.length];activate(next)})});if(tabs[0])activate(tabs[0],false)});$$("[data-segmented]").forEach((group)=>{const options=$$("button",group);options.forEach((option)=>{option.addEventListener("click",()=>{options.forEach((o)=>o.setAttribute("aria-pressed",String(o===option)));group.dispatchEvent(new CustomEvent("contour:change",{detail:{value:option.dataset.value}}),)})})});const paintRange=(input)=>{const min=Number(input.min||0);const max=Number(input.max||100);const value=Number(input.value);const pct=max===min?0:((value-min)/(max-min))*100;input.style.setProperty("--fill",`${pct}%`);const output=document.getElementById(input.getAttribute("aria-describedby")||"");if(output)output.textContent=input.dataset.format?formatValue(input,value):value};const formatValue=(input,value)=>{const format=input.dataset.format||"";if(format==="deg")return`${value}°`;if(format==="ms")return`${value} ms`;if(format==="km")return`${value.toFixed(1)} km`;if(format==="pct")return`${value}%`;return String(value)};$$('input[type="range"].c-range').forEach((input)=>{paintRange(input);input.addEventListener("input",()=>{paintRange(input);input.dispatchEvent(new CustomEvent("contour:input",{bubbles:true,detail:{value:Number(input.value)}}))})});$$('.c-time-slider__play').forEach((btn)=>{btn.addEventListener('click',()=>{const playing=btn.getAttribute('data-state')==='play';btn.setAttribute('data-state',playing?'pause':'play');btn.setAttribute('aria-label',playing?'Pause':'Play');const use=btn.querySelector('use');if(use)use.setAttribute('href',playing?'#i-pause':'#i-play')})});const railLinks=$$("[data-spy] a");if(railLinks.length){const sections=railLinks.map((link)=>document.getElementById(link.getAttribute("href")?.slice(1))).filter(Boolean);const setActive=(id)=>{railLinks.forEach((link)=>{const active=link.getAttribute("href")===`#${id}`;link.setAttribute("aria-current",active?"true":"false")})};if(sections[0])setActive(sections[0].id);if("IntersectionObserver"in window){const spy=new IntersectionObserver((entries)=>{const visible=entries.filter((e)=>e.isIntersecting).sort((a,b)=>a.boundingClientRect.top-b.boundingClientRect.top);if(visible[0])setActive(visible[0].target.id)},{rootMargin:"-20% 0px -70% 0px"},);sections.forEach((section)=>spy.observe(section))}}const copyText=async(text)=>{try{await navigator.clipboard.writeText(text);return true}catch{try{const ta=document.createElement("textarea");ta.value=text;ta.setAttribute("readonly","");ta.style.position="fixed";ta.style.top="-9999px";ta.style.opacity="0";document.body.append(ta);ta.select();const ok=document.execCommand("copy");ta.remove();return ok}catch{return false}}};document.addEventListener("click",async(event)=>{const trigger=event.target.closest("[data-copy]");if(!trigger)return;if(trigger.closest("summary"))event.preventDefault();const selector=trigger.dataset.copy;const source=selector?$(selector):trigger.previousElementSibling;const text=source?.textContent?.trim()??"";if(!text)return;const ok=await copyText(text);const icon=trigger.querySelector("use");const originalHref=icon?.getAttribute("href");const originalLabel=trigger.getAttribute("aria-label")||trigger.title;if(ok&&icon)icon.setAttribute("href","#i-check");trigger.setAttribute("aria-label",ok?"Copied":"Copy failed");trigger.dataset.copied=String(ok);const timer=setTimeout(()=>{if(!trigger.isConnected)return;if(icon&&originalHref)icon.setAttribute("href",originalHref);trigger.setAttribute("aria-label",originalLabel);delete trigger.dataset.copied},1600)});let toastHost=$("#toast-host");const ensureToastHost=()=>{if(!toastHost||!document.contains(toastHost)){toastHost=document.createElement("div");toastHost.id="toast-host";toastHost.className="c-toast-host";document.body.append(toastHost)}if(!toastHost.getAttribute("role"))toastHost.setAttribute("role","status");if(!toastHost.hasAttribute("aria-live"))toastHost.setAttribute("aria-live","polite");return toastHost};ensureToastHost();const showToast=(message,variant="success")=>{const host=ensureToastHost();if(!host)return;const toast=document.createElement("div");toast.className=`c-toast c-toast--${variant}`;toast.innerHTML=`<span class="c-dot c-dot--${variant === "danger" ? "danger" : "success"}"></span><span></span>`;toast.querySelector("span:last-child").textContent=message;host.append(toast);requestAnimationFrame(()=>{toast.animate([{opacity:0,transform:"translateY(0.75rem) scale(0.98)"},{opacity:1,transform:"none"},],{duration:240,easing:"cubic-bezier(0.16, 1, 0.3, 1)"},)});setTimeout(()=>{toast.animate([{opacity:1},{opacity:0}],{duration:200}).onfinish=()=>toast.remove()},3200)};$$("[data-toast]").forEach((btn)=>btn.addEventListener("click",()=>showToast(btn.dataset.toast,btn.dataset.toastVariant)),);const counters=$$("[data-count]");if(counters.length){const run=(el)=>{const target=Number(el.dataset.count);const decimals=Number(el.dataset.countDecimals||0);const suffix=el.dataset.countSuffix||"";if(reducedMotion.matches){el.textContent=target.toFixed(decimals)+suffix;return}const duration=1100;const start=performance.now();const tick=(now)=>{const t=Math.min(1,(now-start)/duration);const eased=1-Math.pow(1-t,4);el.textContent=(target*eased).toFixed(decimals)+suffix;if(t<1)requestAnimationFrame(tick)};requestAnimationFrame(tick)};if("IntersectionObserver"in window){const obs=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{if(!entry.isIntersecting)return;run(entry.target);obs.unobserve(entry.target)})},{threshold:0.4},);counters.forEach((el)=>obs.observe(el))}else{counters.forEach(run)}}const playground=$("[data-playground]");if(playground){const scope=$("[data-playground-scope]",playground)||document.documentElement;const outputs=$$("[data-playground-out]",playground);const write=(key,value)=>{scope.style.setProperty(key,value);outputs.forEach((out)=>{if(out.dataset.playgroundOut===key)out.textContent=value})};$$("[data-playground-input]",playground).forEach((input)=>{const key=input.dataset.playgroundInput;const unit=input.dataset.playgroundUnit||"";const divisor=Number(input.dataset.playgroundDivisor||1);const handler=()=>{const raw=Number(input.value);write(key,divisor===1?`${raw}${unit}`:`${raw / divisor}`)};input.addEventListener("input",handler);handler()});const reset=$("[data-playground-reset]",playground);reset?.addEventListener("click",()=>{$$("[data-playground-input]",playground).forEach((input)=>{input.value=input.defaultValue;input.dispatchEvent(new Event("input",{bubbles:true}))})})}const navToggle=$("[data-nav-toggle]");const nav=$("#primary-nav");if(navToggle&&nav){navToggle.addEventListener("click",()=>{const open=navToggle.getAttribute("aria-expanded")==="true";navToggle.setAttribute("aria-expanded",String(!open));nav.classList.toggle("is-open",!open)})}$$("[data-dialog-open]").forEach((btn)=>{const dialog=document.getElementById(btn.dataset.dialogOpen);btn.addEventListener("click",()=>dialog?.showModal())});$$("[data-dialog-close]").forEach((btn)=>{const dialog=btn.closest("dialog");btn.addEventListener("click",()=>dialog?.close())});$$("[data-menu-toggle]").forEach((btn)=>{const menu=document.getElementById(btn.dataset.menuToggle);if(!menu)return;btn.setAttribute("popovertarget",menu.id);menu.addEventListener("toggle",(e)=>{btn.setAttribute("aria-expanded",String(e.newState==="open"))})});$$("[data-drawer-toggle]").forEach((btn)=>{const drawer=document.getElementById(btn.dataset.drawerToggle);if(!drawer)return;btn.setAttribute("popovertarget",drawer.id);drawer.addEventListener("toggle",(e)=>{btn.setAttribute("aria-expanded",String(e.newState==="open"))})});$$("[data-alert-close]").forEach((btn)=>{btn.addEventListener("click",()=>{const alertEl=btn.closest(".c-alert");if(!alertEl)return;const animation=alertEl.animate([{opacity:1},{opacity:0,transform:"translateX(-8px)"}],{duration:180,easing:"ease-in"},);animation.onfinish=()=>alertEl.remove()})});if("popover"in HTMLElement.prototype){$$("[data-tooltip]").forEach((trigger)=>{const tip=document.getElementById(trigger.dataset.tooltip);if(!tip)return;trigger.setAttribute("popovertarget",tip.id);trigger.setAttribute("aria-describedby",tip.id)})}else{$$("[data-tooltip]").forEach((trigger)=>{const tip=document.getElementById(trigger.dataset.tooltip);if(!tip)return;trigger.setAttribute("title",tip.textContent.trim())})}const palette=$("[data-command-palette]");if(palette){const field=$("[data-command-field]",palette);const list=$("[data-command-list]",palette);const empty=$("[data-command-empty]",palette);const supportsPopover=typeof palette.showPopover==="function";let index=[];let filtered=[];let active=0;const fuzzy=(query,text)=>{if(!query)return{score:0,hits:[]};const q=query.toLowerCase();const t=text.toLowerCase();const hits=[];let ti=0;let score=0;let streak=0;for(const ch of q){if(ch===" ")continue;const found=t.indexOf(ch,ti);if(found===-1)return null;hits.push(found);streak=found===ti?streak+1:0;score+=10+streak*6-Math.min(found-ti,8);ti=found+1}if(t.startsWith(q))score+=40;else if(t.includes(q))score+=25;score-=text.length*0.12;return{score,hits}};const buildIndex=()=>{const found=[];const push=(group,title,hint,icon,run)=>{if(!title)return;found.push({group,title,hint,icon,run})};$$("[data-command-nav] a[href]").forEach((a)=>{const clone=a.cloneNode(true);clone.querySelectorAll(".c-docs-nav__badge, .c-badge, .c-tag, .c-kbd").forEach((n)=>n.remove());push(a.dataset.commandGroup||"Navigate",clone.textContent.trim(),a.dataset.commandHint||"",a.dataset.commandIcon||"i-file",()=>{location.hash=a.getAttribute("href")},)});$$("main section[id]").forEach((section)=>{const heading=$(".c-section-head__title",section)||$("h2",section)||$("h3",section);push("Sections",heading?heading.textContent.replace(/[\u00b6#]/g,"").trim():"",section.id,"i-hash",()=>goTo(section),)});$$("main h2[id], main h3[id]").forEach((h)=>{push("Sections",h.textContent.replace(/[\u00b6#]/g,"").trim(),h.tagName==="H2"?"Section":"Subsection","i-hash",()=>goTo(h),)});$$("[data-command-action]").forEach((b)=>{push("Actions",b.dataset.commandAction,b.dataset.commandHint||"",b.dataset.commandIcon||"i-zap",()=>b.click(),)});commandRegistry.forEach((cmd)=>{push("Commands",cmd.label,cmd.shortcut||"","i-zap",()=>cmd.run(),)});return found};const escapeHtml=(text)=>text.replace(/[&<>"]/g,(c)=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;",})[c]);const highlight=(text,hits)=>{if(!hits?.length)return escapeHtml(text);const set=new Set(hits);let html="";for(let i=0;i<text.length;i++){html+=set.has(i)?'<mark class="c-command__mark">'+escapeHtml(text[i])+"</mark>":escapeHtml(text[i])}return html};const matchCommand=(query,cmd)=>{const title=fuzzy(query,cmd.title);if(title)return{score:title.score+24,hits:title.hits,hintHits:[]};const hint=fuzzy(query,cmd.hint);if(hint)return{score:hint.score+8,hits:[],hintHits:hint.hits};const group=fuzzy(query,cmd.group);if(group)return{score:group.score,hits:[],hintHits:[]};return null};const items=()=>$$(".c-command__item",list);function setActive(position){const all=items();if(!all.length){field.removeAttribute("aria-activedescendant");return}active=(position+all.length)%all.length;all.forEach((el,i)=>el.setAttribute("aria-selected",String(i===active)));const activeEl=all[active];if(activeEl&&!activeEl.id)activeEl.id="command-item-"+active;if(activeEl)field.setAttribute("aria-activedescendant",activeEl.id);all[active].scrollIntoView({block:"nearest"})}const render=()=>{const query=field.value.trim();filtered=index.map((cmd)=>{const match=matchCommand(query,cmd);return match?Object.assign({},cmd,match):null}).filter(Boolean).sort((a,b)=>b.score-a.score);if(!filtered.length){list.innerHTML="";if(empty)empty.hidden=false;return}if(empty)empty.hidden=true;const groups=new Map();filtered.forEach((cmd)=>{if(!groups.has(cmd.group))groups.set(cmd.group,[]);groups.get(cmd.group).push(cmd)});list.innerHTML=Array.from(groups,([group,cmds])=>{const rows=cmds.map((cmd)=>{const position=filtered.indexOf(cmd);const safeGroup=escapeHtml(group);const hint=cmd.hint?safeGroup+" \u00b7 "+highlight(cmd.hint,cmd.hintHits):safeGroup;return('<button class="c-command__item" role="option" aria-selected="false" tabindex="-1" id="command-item-'+position+'" data-index="'+position+'" type="button">'+'<span class="c-command__item-icon"><svg aria-hidden="true"><use href="#'+escapeHtml(cmd.icon)+'"/></svg></span>'+'<span class="c-command__item-body">'+'<span class="c-command__item-title">'+highlight(cmd.title,cmd.hits)+"</span>"+'<span class="c-command__item-hint">'+hint+"</span>"+"</span>"+"</button>")}).join("");return('<div class="c-command__group"><div class="c-command__group-title">'+escapeHtml(group)+"</div>"+rows+"</div>")}).join("");setActive(0)};let lastFocus=null;const open=()=>{lastFocus=document.activeElement;index=buildIndex();field.value="";render();field.setAttribute("aria-expanded","true");if(supportsPopover)palette.showPopover();else palette.classList.add("is-open");requestAnimationFrame(()=>field.focus())};const close=()=>{field.setAttribute("aria-expanded","false");field.removeAttribute("aria-activedescendant");if(supportsPopover)palette.hidePopover();else palette.classList.remove("is-open");if(lastFocus&&typeof lastFocus.focus==="function"&&document.contains(lastFocus)){try{lastFocus.focus()}catch(e){}}lastFocus=null};const isOpen=()=>supportsPopover?palette.matches(":popover-open"):palette.classList.contains("is-open");field?.addEventListener("input",render);field?.addEventListener("keydown",(event)=>{if(event.key==="ArrowDown"){event.preventDefault();setActive(active+1)}else if(event.key==="ArrowUp"){event.preventDefault();setActive(active-1)}else if(event.key==="Enter"){event.preventDefault();const all=items();if(all[active])all[active].click()}else if(event.key==="Escape"){if(field.value){event.preventDefault();field.value="";render()}else{close()}}});list?.addEventListener("click",(event)=>{const item=event.target.closest(".c-command__item");if(!item)return;const cmd=filtered[Number(item.dataset.index)];if(!cmd)return;close();cmd.run()});document.addEventListener("keydown",(event)=>{if(event.key.toLowerCase()==="k"&&(event.metaKey||event.ctrlKey)&&!isTyping(event.target)){event.preventDefault();if(isOpen())close();else open();return}if(event.key==="/"&&!event.metaKey&&!event.ctrlKey&&!event.altKey&&!isTyping(event.target)){event.preventDefault();if(!isOpen())open()}if(event.key==="?"&&!event.metaKey&&!event.ctrlKey&&!event.altKey&&!isTyping(event.target)){event.preventDefault();const overlay=document.querySelector("[data-shortcut-overlay]");if(overlay){if(overlay.hasAttribute("hidden")){overlay.removeAttribute("hidden")}else{overlay.setAttribute("hidden","")}}return}if(event.key==="Escape"){const overlay=document.querySelector("[data-shortcut-overlay]");if(overlay&&!overlay.hasAttribute("hidden")){overlay.setAttribute("hidden","")}}if(!isTyping(event.target)){const mod=event.metaKey||event.ctrlKey;for(const cmd of commandRegistry){if(!cmd.shortcut)continue;const parts=String(cmd.shortcut).toLowerCase().split("+").map((p)=>p.trim());const needsMod=parts.includes("mod")||parts.includes("ctrl")||parts.includes("meta");const key=parts.filter((p)=>!["mod","ctrl","meta","shift","alt"].includes(p))[0];if(needsMod!==mod)continue;if(parts.includes("shift")!==event.shiftKey)continue;if(parts.includes("alt")!==event.altKey)continue;if(key&&event.key.toLowerCase()===key){event.preventDefault();cmd.run();return}}}});$$("[data-command-open]").forEach((btn)=>btn.addEventListener("click",(event)=>{event.preventDefault();open()}),)}$$("table[data-sortable]").forEach((table)=>{const headers=$$("th[aria-sort]",table);const tbody=table.tBodies[0];if(!tbody)return;headers.forEach((th)=>{th.setAttribute("tabindex","0");th.setAttribute("role","columnheader");const apply=()=>{const type=th.dataset.sortType||"text";const dir=th.getAttribute("aria-sort")==="ascending"?-1:1;headers.forEach((h)=>{if(h!==th)h.setAttribute("aria-sort","none")});th.setAttribute("aria-sort",dir===1?"ascending":"descending");const rows=Array.from(tbody.rows);rows.sort((a,b)=>{const av=a.cells[th.cellIndex]?.dataset.value??a.cells[th.cellIndex]?.textContent.trim()??"";const bv=b.cells[th.cellIndex]?.dataset.value??b.cells[th.cellIndex]?.textContent.trim()??"";if(type==="number")return(parseFloat(av)||0)*dir-(parseFloat(bv)||0)*dir;return av.localeCompare(bv,undefined,{numeric:true})*dir});rows.forEach((row)=>tbody.append(row))};th.addEventListener("click",apply);th.addEventListener("keydown",(event)=>{if(event.key==="Enter"||event.key===" "){event.preventDefault();apply()}})})});$$("[data-density-toggle]").forEach((group)=>{const scope=document.querySelector(group.dataset.densityToggle)||document;const options=$$("button",group);options.forEach((option)=>{option.addEventListener("click",()=>{options.forEach((o)=>o.setAttribute("aria-pressed",String(o===option)));scope.setAttribute("data-density",option.dataset.value)})})});const tocLinks=$$("[data-toc] a");if(tocLinks.length){const headings=tocLinks.map((link)=>document.getElementById(link.getAttribute("href")?.slice(1))).filter(Boolean);const setCurrent=(id)=>{tocLinks.forEach((link)=>{link.setAttribute("aria-current",link.getAttribute("href")===`#${id}`?"true":"false")})};if("IntersectionObserver"in window){const spy=new IntersectionObserver((entries)=>{const visible=entries.filter((e)=>e.isIntersecting).sort((a,b)=>a.boundingClientRect.top-b.boundingClientRect.top);if(visible[0])setCurrent(visible[0].target.id)},{rootMargin:"-15% 0px -75% 0px"},);headings.forEach((h)=>spy.observe(h))}}document.addEventListener("click",(event)=>{const remove=event.target.closest("[data-remove]");if(!remove)return;const target=remove.closest("[data-removable]")||remove.parentElement;target?.remove()});function linearScale(domain,range){const[d0,d1]=domain;const[r0,r1]=range;const span=d1-d0||1;return(v)=>r0+((v-d0)/span)*(r1-r0)}function niceTicks(min,max,count){count=count||5;const span=max-min||1;const step=Math.pow(10,Math.floor(Math.log10(span/count)));const err=(count*step)/span;if(!isFinite(step)||step<=0)return[min,max];let niceStep=step;if(!isFinite(niceStep)||niceStep<=0)niceStep=step||1;if(err<=0.15)niceStep=10*step;else if(err<=0.35)niceStep=5*step;else if(err<=0.75)niceStep=2*step;const niceMin=Math.floor(min/niceStep)*niceStep;const niceMax=Math.ceil(max/niceStep)*niceStep;const ticks=[];for(let v=niceMin;v<=niceMax+niceStep/2;v+=niceStep){ticks.push(Math.round(v*1e9)/1e9)}return ticks}function datum(x,y,r){r=r||3;return{cx:x,cy:y,r:r}}const commandRegistry=[];function registerCommand(cmd){if(!cmd||!cmd.id||typeof cmd.id!=="string")return;if(cmd.label!=null&&typeof cmd.label!=="string")return;if(cmd.shortcut!=null&&typeof cmd.shortcut!=="string")return;if(cmd.run!=null&&typeof cmd.run!=="function")return;commandRegistry.push(Object.freeze({id:cmd.id,label:cmd.label||cmd.id,shortcut:cmd.shortcut||null,run:typeof cmd.run==="function"?cmd.run:function(){},}))}function listCommands(){return commandRegistry.slice()}$$("[data-cvd-toggle]").forEach((group)=>{const scope=document.getElementById("data")||document.documentElement;const targets=()=>$$(".u-cvd-target, .c-chart, .c-datamark",scope);$$("button",group).forEach((btn)=>{btn.addEventListener("click",()=>{const value=btn.dataset.cvdValue||"";targets().forEach((el)=>{if(value)el.setAttribute("data-cvd",value);else el.removeAttribute("data-cvd")});$$("button",group).forEach((b)=>b.setAttribute("aria-pressed",String(b===btn)))})})});$$("[data-theme-set]").forEach((group)=>{$$("button",group).forEach((btn)=>{btn.addEventListener("click",()=>{const value=btn.dataset.themeValue||"";if(value)document.documentElement.setAttribute("data-theme",value);else document.documentElement.removeAttribute("data-theme");$$("button",group).forEach((b)=>b.setAttribute("aria-pressed",String(b===btn)))})})});$$("[data-profile-toggle]").forEach((group)=>{const scope=document.getElementById(group.dataset.profileScope||"data")||document.documentElement;$$("button",group).forEach((btn)=>{btn.addEventListener("click",()=>{const value=btn.dataset.profileValue||"";if(value)scope.setAttribute("data-profile",value);else scope.removeAttribute("data-profile");$$("button",group).forEach((b)=>b.setAttribute("aria-pressed",String(b===btn)))})})});$$("[data-motion-toggle]").forEach((group)=>{const scope=(group.dataset.motionScope&&document.getElementById(group.dataset.motionScope))||document.documentElement;$$("button",group).forEach((btn)=>{btn.addEventListener("click",()=>{const value=btn.dataset.motionValue||"auto";if(value==="auto")scope.removeAttribute("data-motion");else scope.setAttribute("data-motion",value);$$("button",group).forEach((b)=>b.setAttribute("aria-pressed",String(b===btn)))})})});const marchingSquares=(grid,level)=>{const rows=grid.length;const cols=grid[0].length;const segments=[];const lerp=(a,b,va,vb)=>{if(vb===va)return 0.5;return(level-va)/(vb-va)};for(let y=0;y<rows-1;y++){for(let x=0;x<cols-1;x++){const tl=grid[y][x];const tr=grid[y][x+1];const bl=grid[y+1][x];const br=grid[y+1][x+1];const code=(tl>=level?8:0)|(tr>=level?4:0)|(br>=level?2:0)|(bl>=level?1:0);if(code===0||code===15)continue;const top={x:x+lerp(tl,tr,tl,tr),y:y};const right={x:x+1,y:y+lerp(tr,br,tr,br)};const bottom={x:x+lerp(bl,br,bl,br),y:y+1};const left={x:x,y:y+lerp(tl,bl,tl,bl)};let connect;if(code===5){const center=(tl+tr+bl+br)/4;connect=center>=level?"top-bottom":"left-right"}else if(code===10){const center=(tl+tr+bl+br)/4;connect=center>=level?"left-right":"top-bottom"}switch(code){case 1:case 14:segments.push([left,bottom]);break;case 2:case 13:segments.push([bottom,right]);break;case 3:case 12:segments.push([left,right]);break;case 4:case 11:segments.push([top,right]);break;case 6:case 9:segments.push([top,bottom]);break;case 7:case 8:segments.push([left,top]);break;case 5:if(connect==="top-bottom"){segments.push([top,bottom]);segments.push([left,right])}else{segments.push([top,right]);segments.push([left,bottom])}break;case 10:if(connect==="left-right"){segments.push([left,right]);segments.push([top,bottom])}else{segments.push([top,right]);segments.push([left,bottom])}break}}}return segments};const renderContourPlot=(el)=>{const svg=el.querySelector("svg");if(!svg)return;const valuesAttr=el.getAttribute("data-values");const levelsAttr=el.getAttribute("data-levels");if(!valuesAttr)return;let grid;try{grid=JSON.parse(valuesAttr)}catch(e){return}const levels=levelsAttr?JSON.parse(levelsAttr):[0.3,0.5,0.7];const rows=grid.length;const cols=grid[0].length;const w=el.clientWidth||300;const h=el.clientHeight||300;const sx=w/(cols-1);const sy=h/(rows-1);svg.querySelectorAll(".c-contour-plot__contour").forEach((n)=>n.remove());levels.forEach((level,li)=>{const segs=marchingSquares(grid,level);const path=document.createElementNS("http://www.w3.org/2000/svg","path");let d="";for(const[a,b]of segs){d+=`M ${a.x * sx} ${a.y * sy} L ${b.x * sx} ${b.y * sy} `}path.setAttribute("d",d.trim());path.setAttribute("class","c-contour-plot__contour"+(li>0?" c-contour-plot__contour--level-"+(li+1):""));svg.appendChild(path)})};$$("[data-contour-plot]").forEach((el)=>{renderContourPlot(el);if(typeof ResizeObserver!=="undefined"){new ResizeObserver(()=>renderContourPlot(el)).observe(el)}});$$("[data-chart-export]").forEach((chart)=>{const btn=document.createElement("button");btn.className="c-btn c-btn--sm c-btn--ghost";btn.textContent="Export";btn.setAttribute("aria-label","Export chart");btn.addEventListener("click",()=>{const svg=chart.querySelector("svg");if(!svg)return;const serializer=new XMLSerializer();const svgStr=serializer.serializeToString(svg);const blob=new Blob([svgStr],{type:"image/svg+xml"});const url=URL.createObjectURL(blob);const a=document.createElement("a");a.href=url;a.download="chart.svg";a.click();URL.revokeObjectURL(url)});chart.appendChild(btn)});$$(".c-combobox").forEach((combo)=>{const input=combo.querySelector(".c-combobox__input");const list=combo.querySelector(".c-combobox__list");if(!input||!list)return;const options=[...list.querySelectorAll(".c-combobox__option")];let activeIndex=-1;const filter=(query)=>{const q=query.toLowerCase();options.forEach((opt)=>{const text=opt.textContent.toLowerCase();opt.hidden=q&&!text.includes(q)});activeIndex=-1};const open=()=>list.removeAttribute("hidden");const close=()=>list.setAttribute("hidden","");input.addEventListener("input",()=>{filter(input.value);open()});input.addEventListener("focus",()=>{filter(input.value);open()});input.addEventListener("keydown",(e)=>{const visible=options.filter((o)=>!o.hidden);if(e.key==="ArrowDown"){e.preventDefault();activeIndex=Math.min(activeIndex+1,visible.length-1);visible.forEach((o,i)=>o.classList.toggle("c-combobox__option--active",i===activeIndex))}else if(e.key==="ArrowUp"){e.preventDefault();activeIndex=Math.max(activeIndex-1,0);visible.forEach((o,i)=>o.classList.toggle("c-combobox__option--active",i===activeIndex))}else if(e.key==="Enter"){e.preventDefault();if(activeIndex>=0&&visible[activeIndex]){input.value=visible[activeIndex].textContent;close()}}else if(e.key==="Escape"){close()}});list.addEventListener("click",(e)=>{const opt=e.target.closest(".c-combobox__option");if(opt){input.value=opt.textContent;close();input.focus()}});document.addEventListener("click",(e)=>{if(!combo.contains(e.target))close()})});$$(".c-tree__toggle").forEach((toggle)=>{toggle.addEventListener("click",(e)=>{e.stopPropagation();const expanded=toggle.getAttribute("aria-expanded")==="true";toggle.setAttribute("aria-expanded",String(!expanded));const row=toggle.closest(".c-tree__row");if(row)row.setAttribute("aria-expanded",String(!expanded));const children=toggle.closest(".c-tree__node")?.querySelector(":scope > .c-tree__children");if(children){if(expanded)children.setAttribute("hidden","");else children.removeAttribute("hidden")}})});$$(".c-resize-handle").forEach((handle)=>{handle.setAttribute("tabindex","0");handle.setAttribute("role","separator");if(!handle.hasAttribute("aria-valuenow"))handle.setAttribute("aria-valuenow","50");if(!handle.hasAttribute("aria-valuemin"))handle.setAttribute("aria-valuemin","0");if(!handle.hasAttribute("aria-valuemax"))handle.setAttribute("aria-valuemax","100");if(!handle.hasAttribute("aria-orientation"))handle.setAttribute("aria-orientation","vertical");handle.addEventListener("pointerdown",(e)=>{e.preventDefault();handle.setPointerCapture(e.pointerId);handle.classList.add("c-resize-handle--dragging");const resizable=handle.closest(".c-resizable");const isHorizontal=resizable?.classList.contains("c-resizable--horizontal");const prevPane=handle.previousElementSibling;const nextPane=handle.nextElementSibling;if(!prevPane||!nextPane)return;const startPos=isHorizontal?e.clientX:e.clientY;const prevSize=isHorizontal?prevPane.offsetWidth:prevPane.offsetHeight;const nextSize=isHorizontal?nextPane.offsetWidth:nextPane.offsetHeight;const onMove=(ev)=>{const delta=(isHorizontal?ev.clientX:ev.clientY)-startPos;const newPrev=Math.max(50,prevSize+delta);const newNext=Math.max(50,nextSize-delta);prevPane.style.flex="0 0 "+newPrev+"px";nextPane.style.flex="0 0 "+newNext+"px"};const onUp=()=>{handle.classList.remove("c-resize-handle--dragging");handle.releasePointerCapture(e.pointerId);document.removeEventListener("pointermove",onMove);document.removeEventListener("pointerup",onUp)};document.addEventListener("pointermove",onMove);document.addEventListener("pointerup",onUp)});handle.addEventListener("keydown",(e)=>{const resizable=handle.closest(".c-resizable");const isHorizontal=resizable?.classList.contains("c-resizable--horizontal");const prevPane=handle.previousElementSibling;const nextPane=handle.nextElementSibling;if(!prevPane||!nextPane)return;const step=10;let delta=0;if(isHorizontal){if(e.key==="ArrowLeft")delta=-step;else if(e.key==="ArrowRight")delta=step}else{if(e.key==="ArrowUp")delta=-step;else if(e.key==="ArrowDown")delta=step}if(delta!==0){e.preventDefault();const prevSize=isHorizontal?prevPane.offsetWidth:prevPane.offsetHeight;const nextSize=isHorizontal?nextPane.offsetWidth:nextPane.offsetHeight;const newPrev=Math.max(50,prevSize+delta);const newNext=Math.max(50,nextSize-delta);prevPane.style.flex="0 0 "+newPrev+"px";nextPane.style.flex="0 0 "+newNext+"px"}})});$$(".c-comparison").forEach((comp)=>{const divider=comp.querySelector(".c-comparison__divider");const before=comp.querySelector(".c-comparison__pane--before");if(!divider||!before)return;const setPct=(pct)=>{const clamped=Math.max(2,Math.min(98,pct));divider.style.insetInlineStart=clamped+"%";before.style.clipPath="inset(0 "+(100-clamped)+"% 0 0)";divider.setAttribute("aria-valuenow",String(Math.round(clamped)))};divider.setAttribute("tabindex","0");divider.setAttribute("role","separator");divider.setAttribute("aria-orientation","vertical");divider.setAttribute("aria-valuemin","0");divider.setAttribute("aria-valuemax","100");if(!divider.getAttribute("aria-label")){divider.setAttribute("aria-label","Comparison divider")}const seed=parseFloat(divider.style.insetInlineStart);setPct(Number.isFinite(seed)?seed:50);divider.addEventListener("pointerdown",(e)=>{e.preventDefault();divider.setPointerCapture(e.pointerId);const onMove=(ev)=>{const rect=comp.getBoundingClientRect();if(!rect.width)return;setPct(((ev.clientX-rect.left)/rect.width)*100)};const onUp=()=>{try{divider.releasePointerCapture(e.pointerId)}catch(_){}document.removeEventListener("pointermove",onMove);document.removeEventListener("pointerup",onUp)};document.addEventListener("pointermove",onMove);document.addEventListener("pointerup",onUp)});divider.addEventListener("keydown",(e)=>{const current=parseFloat(divider.style.insetInlineStart);const base=Number.isFinite(current)?current:50;let delta=0;if(e.key==="ArrowLeft")delta=-2;else if(e.key==="ArrowRight")delta=2;if(delta!==0){e.preventDefault();setPct(base+delta)}})});let draggedEl=null;$$(".c-draggable").forEach((el)=>{el.setAttribute("draggable","true");el.setAttribute("tabindex","0");el.addEventListener("dragstart",(e)=>{el.classList.add("c-draggable--dragging");draggedEl=el;e.dataTransfer?.setData("text/plain",el.textContent||"");if(e.dataTransfer)e.dataTransfer.effectAllowed="move"});el.addEventListener("dragend",()=>{el.classList.remove("c-draggable--dragging");draggedEl=null});let touchTimer=null;el.addEventListener("touchstart",()=>{touchTimer=setTimeout(()=>{el.classList.add("c-draggable--dragging");el.style.opacity="0.5"},300)},{passive:true});el.addEventListener("touchend",()=>{if(touchTimer)clearTimeout(touchTimer);el.classList.remove("c-draggable--dragging");el.style.opacity=""});el.addEventListener("touchmove",()=>{if(touchTimer)clearTimeout(touchTimer)},{passive:true});el.addEventListener("keydown",(e)=>{const parent=el.parentElement;if(!parent)return;const siblings=[...parent.querySelectorAll(".c-draggable")];const idx=siblings.indexOf(el);if(e.key==="ArrowUp"&&idx>0){e.preventDefault();el.classList.add("c-draggable--reordering");parent.insertBefore(el,siblings[idx-1]);el.focus();setTimeout(()=>el.classList.remove("c-draggable--reordering"),200)}else if(e.key==="ArrowDown"&&idx<siblings.length-1){e.preventDefault();el.classList.add("c-draggable--reordering");parent.insertBefore(siblings[idx+1],el);el.focus();setTimeout(()=>el.classList.remove("c-draggable--reordering"),200)}})});$$(".c-drop-zone").forEach((zone)=>{zone.addEventListener("dragover",(e)=>{e.preventDefault();zone.classList.add("c-drop-zone--active");const indicator=zone.querySelector(".c-drop-indicator");if(indicator)indicator.classList.add("c-drop-indicator--visible")});zone.addEventListener("dragleave",()=>{zone.classList.remove("c-drop-zone--active");const indicator=zone.querySelector(".c-drop-indicator");if(indicator)indicator.classList.remove("c-drop-indicator--visible")});zone.addEventListener("drop",(e)=>{e.preventDefault();zone.classList.remove("c-drop-zone--active");const indicator=zone.querySelector(".c-drop-indicator");if(indicator)indicator.classList.remove("c-drop-indicator--visible");if(draggedEl){zone.appendChild(draggedEl);draggedEl.classList.remove("c-draggable--dragging");draggedEl=null;return}const data=e.dataTransfer?.getData("text/plain");if(data){const item=document.createElement("span");item.className="c-draggable c-card";item.style.padding="var(--space-sm)";item.style.overflow="hidden";item.style.textOverflow="ellipsis";item.style.whiteSpace="nowrap";item.style.maxInlineSize="100%";item.textContent=data;item.setAttribute("tabindex","0");zone.appendChild(item)}})});$$(".c-layer-panel").forEach((panel)=>{if(!panel.hasAttribute("role"))panel.setAttribute("role","list");const items=()=>[...panel.querySelectorAll(".c-layer-panel__item")];const reorder=(el,dir)=>{const s=items(),i=s.indexOf(el);if(dir<0&&i>0){el.classList.add("c-layer-panel__item--dragging");panel.insertBefore(el,s[i-1]);el.focus();setTimeout(()=>el.classList.remove("c-layer-panel__item--dragging"),200)}else if(dir>0&&i<s.length-1){el.classList.add("c-layer-panel__item--dragging");panel.insertBefore(s[i+1],el);el.focus();setTimeout(()=>el.classList.remove("c-layer-panel__item--dragging"),200)}};items().forEach((item)=>{item.setAttribute("draggable","true");item.setAttribute("tabindex","0");item.setAttribute("role","listitem");item.addEventListener("dragstart",(e)=>{const t=e.target;if(t&&t!==item&&/^(INPUT|BUTTON|SELECT)$/.test(t.tagName)&&!(t.classList&&t.classList.contains("c-drag-handle"))){e.preventDefault();return}item.classList.add("c-layer-panel__item--dragging");e.dataTransfer?.setData("text/plain",item.querySelector(".c-layer-panel__name")?.textContent||"");if(e.dataTransfer)e.dataTransfer.effectAllowed="move"});item.addEventListener("dragend",()=>item.classList.remove("c-layer-panel__item--dragging"));item.addEventListener("dragover",(e)=>{e.preventDefault();const dragged=panel.querySelector(".c-layer-panel__item--dragging");if(!dragged||dragged===item)return;const r=item.getBoundingClientRect(),mid=r.top+r.height/2;if(e.clientY<mid)panel.insertBefore(dragged,item);else panel.insertBefore(dragged,item.nextSibling)});item.addEventListener("keydown",(e)=>{if(e.key==="ArrowUp"){e.preventDefault();reorder(item,-1)}else if(e.key==="ArrowDown"){e.preventDefault();reorder(item,1)}})})});window.Contour=Object.freeze({__loaded:true,version:"1.0",toast:showToast,setScheme:applyScheme,scrollTo:(id)=>{const el=typeof id==="string"?document.getElementById(id):id;if(el)goTo(el)},copy:async(text)=>copyText(text),format:{number:(value,format,locale)=>{const n=Number(value);if(!Number.isFinite(n))return String(value);if(format==="percent")return(n*100).toFixed(0)+"%";try{return new Intl.NumberFormat(locale||undefined).format(n)}catch(e){return String(n)}},time:(value,locale)=>{try{return new Intl.DateTimeFormat(locale||undefined).format(new Date(value))}catch(e){return String(value)}},locale:(locale)=>locale||(typeof navigator!=="undefined"?navigator.language:"en"),},chart:{scale:linearScale,ticks:niceTicks,datum:datum},commands:{register:registerCommand,list:listCommands},})})();
@@ -1200,13 +1200,17 @@
1200
1200
  "$type": "number",
1201
1201
  "$value": 100
1202
1202
  },
1203
+ "header": {
1204
+ "$type": "number",
1205
+ "$value": 400
1206
+ },
1203
1207
  "drawer": {
1204
1208
  "$type": "number",
1205
1209
  "$value": 500
1206
1210
  },
1207
- "header": {
1211
+ "modal": {
1208
1212
  "$type": "number",
1209
- "$value": 400
1213
+ "$value": 600
1210
1214
  },
1211
1215
  "toast": {
1212
1216
  "$type": "number",
@@ -2422,6 +2426,10 @@
2422
2426
  "$description": "Sequential — one hue, rising lightness."
2423
2427
  },
2424
2428
  "$extensions": {
2429
+ "com.contour.version": {
2430
+ "version": "1.6.0",
2431
+ "deprecation": "A deprecated token keeps its name and gains a `$deprecated` boolean plus a `replacement` pointer in its `$extensions`; removals land in the next major release (see CHANGELOG.md)."
2432
+ },
2425
2433
  "com.contour.dtcg": {
2426
2434
  "source": "src/css/tokens.css",
2427
2435
  "statement": "Generated by tools/build.mjs; src/css stays the source of truth. The tokens named here are declared CSS the Format Module cannot represent, so a consumer must read the stylesheet for them — they are listed rather than dropped, and tools/check-export.mjs fails unless exported plus refused equals the census. Note what this document CANNOT say: a knob-resolved colour is published at the value :root declares, so the JSON describes the default theme only. Re-pointing --brand-hue works from :root and not from a subtree — that is why .c-theme-scope re-derives the whole brand layer rather than overriding one value — and a Resolver set carries themes, not an arbitrary hue. Read src/css for the mechanism.",
@@ -1,6 +1,6 @@
1
1
  # Actions
2
2
 
3
- Section `actions` — marker `06`, position 7 of 26 in the guide.
3
+ Section `actions` — marker `06`, position 7 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -31,4 +31,4 @@ starts disagreeing with itself.
31
31
 
32
32
  ---
33
33
 
34
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
34
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Affordances, made visible.
2
2
 
3
- Section `affordances` — marker `18`, position 19 of 26 in the guide.
3
+ Section `affordances` — marker `18`, position 19 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -66,6 +66,8 @@ RTL specimen — chevron flips to the inline-start side.
66
66
 
67
67
  The spatial dashboard skeleton: an app shell, a map area with floating panels, a footer for charts, and the containers that fill them.
68
68
 
69
+ Grouping helpers: use .c-row for a non-wrapping horizontal line, .c-cluster when items may wrap, .c-stack for vertical rhythm, .c-btn-group / .c-btn-group--attached for button rows, .c-segmented for option sets, and .c-toolbar for icon toolbars. Components adopt these internally; prefer them over ad-hoc flex when composing.
70
+
69
71
  .c-row — horizontal flex, items centered
70
72
 
71
73
  .c-stack — vertical, gap scales with --space-md
@@ -184,4 +186,4 @@ part of the component contract and nothing in an installed package defines them:
184
186
 
185
187
  ---
186
188
 
187
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
189
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -0,0 +1,30 @@
1
+ # API reference.
2
+
3
+ Section `apireference` — marker `24`, position 25 of 27 in the guide.
4
+ Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
+ private until v1.0). See `index.json` for the whole set and the shared statement.
6
+
7
+ ## What the guide says
8
+
9
+ Per-element reference generated from contour.components.json: host-set inputs, sheet-defaulted vars, variants, element count and token count.
10
+
11
+ Per-element reference generated from contour.components.json: host-set inputs, sheet-defaulted vars, variants, element count and token count. Regenerate with node tools/gen-api-cards.mjs.
12
+
13
+ ## Subsections
14
+
15
+ - Component API reference
16
+
17
+ ## Blocks documented here
18
+
19
+ 4 block(s). Their facts live in `../contour.components.json`;
20
+ only the names are here, because the same figure in two files is how a document
21
+ starts disagreeing with itself.
22
+
23
+ - `.c-disclosure`
24
+ - `.c-panel`
25
+ - `.c-section-head`
26
+ - `.c-stack`
27
+
28
+ ---
29
+
30
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Colour, in five families and a neutral ramp.
2
2
 
3
- Section `colour` — marker `02`, position 3 of 26 in the guide.
3
+ Section `colour` — marker `02`, position 3 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -41,4 +41,4 @@ starts disagreeing with itself.
41
41
 
42
42
  ---
43
43
 
44
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
44
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Component index.
2
2
 
3
- Section `componentindex` — marker `25`, position 26 of 26 in the guide.
3
+ Section `componentindex` — marker `26`, position 27 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -36,4 +36,4 @@ starts disagreeing with itself.
36
36
 
37
37
  ---
38
38
 
39
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
39
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
package/dist/docs/data.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Data display
2
2
 
3
- Section `data` — marker `13`, position 14 of 26 in the guide.
3
+ Section `data` — marker `13`, position 14 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -138,4 +138,4 @@ starts disagreeing with itself.
138
138
 
139
139
  ---
140
140
 
141
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
141
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
package/dist/docs/docs.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Documentation
2
2
 
3
- Section `docs` — marker `15`, position 16 of 26 in the guide.
3
+ Section `docs` — marker `15`, position 16 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -103,4 +103,4 @@ starts disagreeing with itself.
103
103
 
104
104
  ---
105
105
 
106
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
106
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Feedback
2
2
 
3
- Section `feedback` — marker `11`, position 12 of 26 in the guide.
3
+ Section `feedback` — marker `11`, position 12 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -72,4 +72,4 @@ starts disagreeing with itself.
72
72
 
73
73
  ---
74
74
 
75
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
75
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Field
2
2
 
3
- Section `field` — marker `14`, position 15 of 26 in the guide.
3
+ Section `field` — marker `14`, position 15 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -62,4 +62,4 @@ starts disagreeing with itself.
62
62
 
63
63
  ---
64
64
 
65
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
65
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Forms
2
2
 
3
- Section `forms` — marker `07`, position 8 of 26 in the guide.
3
+ Section `forms` — marker `07`, position 8 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -69,4 +69,4 @@ starts disagreeing with itself.
69
69
 
70
70
  ---
71
71
 
72
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
72
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "version": "1.0",
3
3
  "source": "index.html",
4
- "sourceSha256": "89164adf826b1812",
5
- "lastUpdated": "2026-11-03T18:38:35+01:00",
4
+ "sourceSha256": "1beb0033376e73f1",
5
+ "lastUpdated": "2026-11-08T12:25:18+01:00",
6
6
  "generatedBy": "tools/build.mjs, from index.html",
7
7
  "statement": "Machine-readable copy of the style guide's prose, generated and never hand-edited. Sections are listed in guide order; titles, prose and counts are quoted or counted, not authored. Prose is verbatim: a paragraph here is the guide's own sentence, never a sentence this generator wrote. Contains no URL: the project is private until v1.0.",
8
8
  "counts": {
9
- "sections": 26,
10
- "inRail": 26,
11
- "titled": 25,
9
+ "sections": 27,
10
+ "inRail": 27,
11
+ "titled": 26,
12
12
  "blocksReferenced": 221,
13
13
  "guideOnlyClasses": 1
14
14
  },
@@ -202,13 +202,21 @@
202
202
  "title": "Web components",
203
203
  "marker": "23",
204
204
  "file": "docs/webcomponents.md",
205
- "blocks": 23,
205
+ "blocks": 22,
206
+ "inRail": true
207
+ },
208
+ {
209
+ "id": "apireference",
210
+ "title": "API reference.",
211
+ "marker": "24",
212
+ "file": "docs/apireference.md",
213
+ "blocks": 4,
206
214
  "inRail": true
207
215
  },
208
216
  {
209
217
  "id": "mapengine",
210
218
  "title": "Map engine integration.",
211
- "marker": "24",
219
+ "marker": "25",
212
220
  "file": "docs/mapengine.md",
213
221
  "blocks": 5,
214
222
  "inRail": true
@@ -216,16 +224,21 @@
216
224
  {
217
225
  "id": "componentindex",
218
226
  "title": "Component index.",
219
- "marker": "25",
227
+ "marker": "26",
220
228
  "file": "docs/componentindex.md",
221
229
  "blocks": 15,
222
230
  "inRail": true
223
231
  }
224
232
  ],
225
233
  "coverage": {
226
- "contractBlocks": 221,
234
+ "contractBlocks": 225,
227
235
  "namedBySections": 221,
228
- "notNamedByAnySection": []
236
+ "notNamedByAnySection": [
237
+ "c-changelog",
238
+ "c-data-export",
239
+ "c-pull-to-refresh",
240
+ "c-split-map"
241
+ ]
229
242
  },
230
243
  "contracts": {
231
244
  "tokens": "../contour.tokens.json",
@@ -233,7 +246,7 @@
233
246
  "components": "../contour.components.json"
234
247
  },
235
248
  "tables": {
236
- "taxonomy-table": "| Group | Count | Read | Unread | Covers |\n|---|---|---|---|---|\n| Colour ramps | 53 | 53 | — | `--basalt-…`, `--tidal-…`, `--lumen-…`, `--plasma-…`, `--sol-…`, `--clay-…` |\n| Brand ramp | 8 | 8 | — | `--brand-hue` and the ramp derived from it |\n| Semantic colours | 69 | 69 | — | `--color-…` — text, surface, border, primary; every one `light-dark()` |\n| Chart | 45 | 45 | — | categorical, sequential, diverging, dash patterns, chart chrome |\n| Fill patterns | 6 | 6 | — | `--fill-hatch-…`, `--fill-dot` — the shape branch of a filled mark |\n| Gradients | 4 | 4 | — | canvas, plate, heat, rule |\n| Typography | 31 | 31 | — | families, sizes, weights, leading, tracking, measures |\n| Space and layout | 22 | 22 | — | the 4 px scale, containers, gutter, header height, target sizes |\n| Shape | 20 | 20 | — | radii, borders, hairline, shadows, elevation |\n| Motion | 16 | 14 | 2 | durations and easings |\n| Z-index | 6 | 6 | — | `--z-raised` … `--z-tooltip` |\n| Density | 6 | 6 | — | row height, cell padding, label size |\n| Focus | 1 | 1 | — | the focus ring perimeter |\n| Miscellaneous | 13 | 12 | 1 | no documented prefix — fix the taxonomy |\n| **Total** | **300** | **297** | **3** | unique custom properties in `src/css/tokens.css` |"
249
+ "taxonomy-table": "| Group | Count | Read | Unread | Covers |\n|---|---|---|---|---|\n| Colour ramps | 53 | 53 | — | `--basalt-…`, `--tidal-…`, `--lumen-…`, `--plasma-…`, `--sol-…`, `--clay-…` |\n| Brand ramp | 8 | 8 | — | `--brand-hue` and the ramp derived from it |\n| Semantic colours | 69 | 69 | — | `--color-…` — text, surface, border, primary; every one `light-dark()` |\n| Chart | 45 | 45 | — | categorical, sequential, diverging, dash patterns, chart chrome |\n| Fill patterns | 6 | 6 | — | `--fill-hatch-…`, `--fill-dot` — the shape branch of a filled mark |\n| Gradients | 4 | 4 | — | canvas, plate, heat, rule |\n| Typography | 31 | 31 | — | families, sizes, weights, leading, tracking, measures |\n| Space and layout | 22 | 22 | — | the 4 px scale, containers, gutter, header height, target sizes |\n| Shape | 20 | 20 | — | radii, borders, hairline, shadows, elevation |\n| Motion | 16 | 14 | 2 | durations and easings |\n| Z-index | 7 | 7 | — | `--z-raised` … `--z-tooltip` |\n| Density | 6 | 6 | — | row height, cell padding, label size |\n| Focus | 1 | 1 | — | the focus ring perimeter |\n| Miscellaneous | 13 | 12 | 1 | no documented prefix — fix the taxonomy |\n| **Total** | **301** | **298** | **3** | unique custom properties in `src/css/tokens.css` |"
237
250
  },
238
251
  "missingRail": []
239
252
  }
@@ -1,6 +1,6 @@
1
1
  # Install
2
2
 
3
- Section `install` — marker `22`, position 23 of 26 in the guide.
3
+ Section `install` — marker `22`, position 23 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -29,4 +29,4 @@ starts disagreeing with itself.
29
29
 
30
30
  ---
31
31
 
32
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
32
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Landing
2
2
 
3
- Section `landing` — marker `16`, position 17 of 26 in the guide.
3
+ Section `landing` — marker `16`, position 17 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -67,4 +67,4 @@ starts disagreeing with itself.
67
67
 
68
68
  ---
69
69
 
70
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
70
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Map engine integration.
2
2
 
3
- Section `mapengine` — marker `24`, position 25 of 26 in the guide.
3
+ Section `mapengine` — marker `25`, position 26 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -33,4 +33,4 @@ starts disagreeing with itself.
33
33
 
34
34
  ---
35
35
 
36
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
36
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Motion that decelerates, never bounces.
2
2
 
3
- Section `motion` — marker `05`, position 6 of 26 in the guide.
3
+ Section `motion` — marker `05`, position 6 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -47,4 +47,4 @@ starts disagreeing with itself.
47
47
 
48
48
  ---
49
49
 
50
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
50
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Navigation
2
2
 
3
- Section `navigation` — marker `10`, position 11 of 26 in the guide.
3
+ Section `navigation` — marker `10`, position 11 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -57,4 +57,4 @@ starts disagreeing with itself.
57
57
 
58
58
  ---
59
59
 
60
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
60
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Overlays
2
2
 
3
- Section `overlays` — marker `11`, position 13 of 26 in the guide.
3
+ Section `overlays` — marker `11`, position 13 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -80,4 +80,4 @@ starts disagreeing with itself.
80
80
 
81
81
  ---
82
82
 
83
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
83
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # overview
2
2
 
3
- Section `overview` — marker `00`, position 1 of 26 in the guide.
3
+ Section `overview` — marker `00`, position 1 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -18,4 +18,4 @@ starts disagreeing with itself.
18
18
 
19
19
  ---
20
20
 
21
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
21
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.
@@ -1,6 +1,6 @@
1
1
  # Patterns
2
2
 
3
- Section `patterns` — marker `17`, position 18 of 26 in the guide.
3
+ Section `patterns` — marker `17`, position 18 of 27 in the guide.
4
4
  Generated from `index.html`; prose quoted, counts from the inventory, no URL (the project is
5
5
  private until v1.0). See `index.json` for the whole set and the shared statement.
6
6
 
@@ -67,4 +67,4 @@ starts disagreeing with itself.
67
67
 
68
68
  ---
69
69
 
70
- Source `index.html` @ `89164adf826b1812` · last committed 2026-11-03T18:38:35+01:00 · no URL: the project is private until v1.0.
70
+ Source `index.html` @ `1beb0033376e73f1` · last committed 2026-11-08T12:25:18+01:00 · no URL: the project is private until v1.0.