contour-ds 1.7.2 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +244 -326
- package/dist/agent-cookbook.json +960 -0
- package/dist/agent-examples.json +65 -0
- package/dist/agent-map-wiring.json +152 -0
- package/dist/agent-rules.json +16 -0
- package/dist/build-manifest.json +344 -126
- package/dist/contour-wc-content.esm.js +1939 -0
- package/dist/contour-wc-content.esm.min.js +1 -0
- package/dist/contour-wc-core.esm.js +3724 -0
- package/dist/contour-wc-core.esm.min.js +1 -0
- package/dist/contour-wc-dashboard.esm.js +6986 -0
- package/dist/contour-wc-dashboard.esm.min.js +1 -0
- package/dist/contour-wc-data.esm.js +6572 -0
- package/dist/contour-wc-data.esm.min.js +1 -0
- package/dist/contour-wc-docs.esm.js +976 -0
- package/dist/contour-wc-docs.esm.min.js +1 -0
- package/dist/contour-wc-feedback.esm.js +1742 -0
- package/dist/contour-wc-feedback.esm.min.js +1 -0
- package/dist/contour-wc-forms.esm.js +2437 -0
- package/dist/contour-wc-forms.esm.min.js +1 -0
- package/dist/contour-wc-interaction.esm.js +1343 -0
- package/dist/contour-wc-interaction.esm.min.js +1 -0
- package/dist/contour-wc-layout.esm.js +845 -0
- package/dist/contour-wc-layout.esm.min.js +1 -0
- package/dist/contour-wc-map.esm.js +2411 -0
- package/dist/contour-wc-map.esm.min.js +1 -0
- package/dist/contour-wc-misc.esm.js +945 -0
- package/dist/contour-wc-misc.esm.min.js +1 -0
- package/dist/contour-wc-navigation.esm.js +2842 -0
- package/dist/contour-wc-navigation.esm.min.js +1 -0
- package/dist/contour-wc-ui.esm.js +6519 -0
- package/dist/contour-wc-ui.esm.min.js +1 -0
- package/dist/contour-wc.esm.js +14435 -5723
- package/dist/contour-wc.esm.min.js +1 -1
- package/dist/contour-wc.js +14436 -5725
- package/dist/contour-wc.min.js +1 -1
- package/dist/contour.a11y.json +402 -0
- package/dist/contour.code-snippets +4534 -0
- package/dist/contour.components.json +4870 -1222
- package/dist/contour.css +6672 -4711
- package/dist/contour.d.ts +753 -1085
- package/dist/contour.esm.js +440 -18
- package/dist/contour.esm.min.js +1 -1
- package/dist/contour.html-data.json +11343 -0
- package/dist/contour.js +440 -18
- package/dist/contour.min.css +1 -1
- package/dist/contour.min.js +1 -1
- package/dist/contour.react.d.ts +422 -0
- package/dist/contour.single.html +17 -0
- package/dist/contour.single.min.css +1 -0
- package/dist/contour.themes.json +56 -12
- package/dist/contour.tokens.json +1318 -1053
- package/dist/contour.vue.d.ts +420 -0
- package/dist/contour.web-types.json +11703 -0
- package/dist/custom-elements.json +36120 -0
- package/dist/docs/actions.md +16 -6
- package/dist/docs/affordances.md +21 -85
- package/dist/docs/apireference.md +9 -5
- package/dist/docs/colour.md +10 -4
- package/dist/docs/componentindex.md +9 -22
- package/dist/docs/data.md +39 -58
- package/dist/docs/docs.md +12 -7
- package/dist/docs/feedback.md +30 -12
- package/dist/docs/field.md +28 -13
- package/dist/docs/forms.md +35 -19
- package/dist/docs/index.json +70 -61
- package/dist/docs/install.md +12 -7
- package/dist/docs/landing.md +7 -4
- package/dist/docs/mapengine.md +30 -8
- package/dist/docs/motion.md +12 -6
- package/dist/docs/navigation.md +31 -7
- package/dist/docs/overlays.md +32 -25
- package/dist/docs/overview.md +3 -2
- package/dist/docs/patterns.md +20 -10
- package/dist/docs/playground.md +11 -4
- package/dist/docs/principles.md +8 -6
- package/dist/docs/recipes.md +117 -13
- package/dist/docs/space.md +10 -6
- package/dist/docs/status.md +13 -14
- package/dist/docs/surfaces.md +17 -22
- package/dist/docs/theming.md +18 -32
- package/dist/docs/type.md +12 -5
- package/dist/docs/webcomponents.md +75 -33
- package/dist/hljs.css +1 -20
- package/dist/map-chrome.mapbox.css +68 -92
- package/dist/map-chrome.maplibre.css +68 -92
- package/dist/registry/items/contour-core.json +2 -2
- package/dist/registry/items/contour-data.json +2 -2
- package/dist/registry/items/contour-docs.json +2 -2
- package/dist/registry/items/contour-landing.json +2 -2
- package/dist/registry/registry.json +8 -8
- package/dist/surfaces/contour-core.min.css +1 -1
- package/dist/surfaces/contour-data.min.css +1 -1
- package/dist/surfaces/contour-docs.min.css +1 -1
- package/dist/surfaces/contour-landing.min.css +1 -1
- package/dist/svg/icons.svg +367 -0
- package/dist/wc/behaviours.mjs +222 -192
- package/dist/wc/content.mjs +486 -142
- package/dist/wc/core.mjs +917 -395
- package/dist/wc/dashboard.mjs +252 -25
- package/dist/wc/data-chart.mjs +1333 -0
- package/dist/wc/data-export.mjs +391 -0
- package/dist/wc/data-gauge.mjs +779 -0
- package/dist/wc/data-geo.mjs +696 -0
- package/dist/wc/data-glyphs.mjs +133 -0
- package/dist/wc/data-legend.mjs +431 -0
- package/dist/wc/data-readout.mjs +227 -0
- package/dist/wc/data-series.mjs +1004 -0
- package/dist/wc/data-table.mjs +751 -0
- package/dist/wc/data.mjs +15 -3707
- package/dist/wc/docs.mjs +113 -19
- package/dist/wc/feedback.mjs +320 -116
- package/dist/wc/forms-controls.mjs +635 -0
- package/dist/wc/forms-field.mjs +547 -0
- package/dist/wc/forms-groups.mjs +347 -0
- package/dist/wc/forms-input.mjs +292 -0
- package/dist/wc/forms.mjs +10 -1122
- package/dist/wc/glyph.mjs +204 -0
- package/dist/wc/index.mjs +16 -7
- package/dist/wc/interaction.mjs +322 -75
- package/dist/wc/layout.mjs +100 -29
- package/dist/wc/map.mjs +888 -285
- package/dist/wc/misc.mjs +137 -26
- package/dist/wc/navigation-menu.mjs +735 -0
- package/dist/wc/navigation-shell.mjs +495 -0
- package/dist/wc/navigation-tree.mjs +995 -0
- package/dist/wc/navigation.mjs +9 -1636
- package/dist/wc/registration.mjs +1 -8
- package/dist/wc/shadow.mjs +285 -113
- package/dist/wc/states.mjs +75 -78
- package/dist/wc/svg.mjs +209 -34
- package/dist/wc/ui-atoms.mjs +608 -0
- package/dist/wc/ui-data.mjs +1404 -0
- package/dist/wc/ui-feedback.mjs +419 -0
- package/dist/wc/ui-inputs.mjs +1570 -0
- package/dist/wc/ui-menus.mjs +307 -0
- package/dist/wc/ui-overlays.mjs +1605 -0
- package/integrations/README.md +25 -5
- package/integrations/ai/CLAUDE.md +6 -3
- package/integrations/ai/COPILOT.md +14 -0
- package/integrations/ai/GEMINI.md +14 -0
- package/integrations/ai/WINDSURF.md +14 -0
- package/integrations/ai/v0-prompt.md +13 -1
- package/integrations/frameworks/README.md +235 -0
- package/integrations/native/README.md +0 -3
- package/integrations/native/style-dictionary.config.json +1 -1
- package/integrations/tailwind/contour-theme.css +71 -13
- package/integrations/validate-markup.mjs +172 -0
- package/package.json +103 -39
- package/dist/wc/ui.mjs +0 -3560
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CLASS_ONLY,CONTOUR_EVENTS,ContourBase,MERCATOR_MAX_LAT,MODS,OBSERVED,REGISTERED,applyLabel,bearing,clampLat,contourId,cssLength,define,flagOn,flagOnValue,formatValue,haversine,headingTag,iconMarkup,isRtl,labelText,levelFromAttributes,mercatorResolution,navKey,normaliseLng,onDispose,safeColor,safeHref,sanitizeHtml,setHTML,simple,statusIcon,supportsUntilFound,unwrapBounds,warnBadJson,wcEmitOverlay,withBrownout,MARKER_SHAPES,arcPath,assignMarkers,barRects,compassNeedle,contourPaths,donutSlices,isMissing,marchingSquares,markerStyles,niceTicks,polylinePoints,scaleBarTicks,smoothPath,modalContain,wcReset,wireCombobox,wireCopy,wireMenu,wirePagination,wireRemovable,wireSegmented,wireTabs,wireTree,STATE_FALLBACK,loadRemote,parseArrayAttr,remoteData,remoteInvalidate,remoteRefresh,remoteVisible,renderEmpty,renderStates,stateLabel,watchViewport,wireStates}from"./contour-wc-core.esm.js";define("contour-box",simple(["c-box"])),define("contour-cluster",simple(["c-cluster"])),define("contour-container",simple(["c-container"])),define("contour-row",simple(["c-row"])),define("contour-scrim",simple(["c-scrim"])),define("contour-stack",simple(["c-stack"]));const assignedText=t=>{const e=t.querySelector("slot");return(e?e.assignedElements({flatten:!0}):[]).map(t=>(t.textContent||"").trim()).join(" ").trim()||(t.textContent||"").trim()};let ADOPTED=null,ADOPTED_KEY="";const _hashCss=t=>{let e=2166136261;for(let s=0;s<t.length;s++)e^=t.charCodeAt(s),e=Math.imul(e,16777619);return(e>>>0).toString(36)};export const adoptedSheets=()=>{let t=document.styleSheets.length+":";for(const e of document.styleSheets){let s="-1";try{const t=e.cssRules;let a="";for(let e=0;e<t.length;e++)a+=t[e].cssText+"\n";s=t.length+":"+_hashCss(a)}catch(t){}t+=(e.href||"inline")+"~"+s+"|"}if(ADOPTED&&t===ADOPTED_KEY)return ADOPTED;ADOPTED_KEY=t,ADOPTED=[];const e=(t,s)=>{let a;try{a=t.cssRules}catch(t){return}if(a)for(const t of a)if(t instanceof CSSImportRule)t.styleSheet&&e(t.styleSheet,s);else try{s.push(t.cssText)}catch(t){}};for(const t of document.styleSheets)try{if(!t.href||new URL(t.href).origin===location.origin){const s=[];e(t,s);const a=new CSSStyleSheet;s.length&&a.replaceSync(s.join("\n")),ADOPTED.push(a)}}catch(t){}return ADOPTED};const _ShadowParent="undefined"!=typeof HTMLElement?HTMLElement:Object;class ContourShadow extends _ShadowParent{static get observedAttributes(){return MODS.concat("labels")}constructor(){super();let t=this.shadowRoot;t||(t=this.attachShadow({mode:"open"}),this.constructor.contourTemplate&&t.appendChild(this.constructor.contourTemplate.content.cloneNode(!0)));const e=adoptedSheets();if(e.length)try{t.adoptedStyleSheets=e}catch(t){}this._shadowBase=t.firstElementChild?t.firstElementChild.className:""}enhance(t){t||(t=this.shadowRoot),t&&(t.querySelectorAll("details").forEach(t=>{const e=t.querySelector("summary");e&&!e.hasAttribute("aria-expanded")&&(e.setAttribute("aria-expanded",String(t.open)),t.addEventListener("toggle",()=>{e.setAttribute("aria-expanded",String(t.open))}))}),t.querySelectorAll("[data-live]").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite")}),t.querySelectorAll(".c-spinner").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite")}),t.querySelectorAll(".c-toast, .c-toast-host").forEach(t=>{t.hasAttribute("role")||t.setAttribute("role","status"),t.hasAttribute("aria-live")||t.setAttribute("aria-live","polite"),t.hasAttribute("aria-atomic")||t.setAttribute("aria-atomic","true")}),t.querySelectorAll("[role='tab']").forEach(e=>{const s=e.getAttribute("aria-controls");if(s){const a=t.querySelector("#"+CSS.escape(s))||document.getElementById(s);a&&!a.hasAttribute("aria-labelledby")&&(e.id||(e.id=contourId("tab")),a.setAttribute("aria-labelledby",e.id))}}),t.querySelectorAll("input, textarea, select").forEach(t=>{if(t.hasAttribute("aria-describedby"))return;const e=t.closest(".c-field");if(e){const s=e.querySelector(".c-field__hint");s&&(s.id||(s.id=contourId("hint")),t.setAttribute("aria-describedby",s.id));const a=e.querySelector(".c-field__error");if(a){a.id||(a.id=contourId("err"));const e=t.getAttribute("aria-describedby")||"";t.setAttribute("aria-describedby",(e+" "+a.id).trim())}}}),t.querySelectorAll(".c-alert").forEach(t=>{const e=t.classList.contains("c-alert--warning")||t.classList.contains("c-alert--danger"),s=e?"alert":"status",a=e?"assertive":"polite";t.hasAttribute("role")&&!t.dataset.contourAutoRole||(t.setAttribute("role",s),t.dataset.contourAutoRole=s),t.hasAttribute("aria-live")&&!t.dataset.contourAutoLive||(t.setAttribute("aria-live",a),t.dataset.contourAutoLive=a)}),t.querySelectorAll("input[required], textarea[required], select[required]").forEach(t=>{t.hasAttribute("aria-required")||t.setAttribute("aria-required","true")}),this._wireLabels(t),this._wireClose(t))}_wireClose(t){if(!t||this._wiredShadowClose)return;const e=t.querySelectorAll(".c-callout__close, .c-alert__close, .c-tag__remove, .c-filter-pill__remove");if(e.length){this._wiredShadowClose=!0;for(const t of e)t.addEventListener("click",()=>{this.hidden=!0,this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}))})}}_wireLabels(t){t&&t.querySelectorAll("label").forEach(t=>{const e=t.querySelector("slot"),s=t.closest(".c-field")||t.parentElement,a=[];if(e)for(const t of e.assignedElements({flatten:!0}))t.matches("input, textarea, select")&&a.push(t);if(!a.length&&s){const t=s.querySelector('slot[name="input"]');if(t)for(const e of t.assignedElements({flatten:!0}))e.matches("input, textarea, select")&&a.push(e)}for(const e of a){if(e.id||(e.id=contourId("shadow-input")),t.hasAttribute("for")||t.setAttribute("for",e.id),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")){const s=assignedText(t);s&&e.setAttribute("aria-label",s)}if(e._contourLabelWired||(e._contourLabelWired=!0,t.addEventListener("click",t=>{if(!t.target.closest("a, button, input, textarea, select"))try{e.click()}catch(t){}})),s&&!e.hasAttribute("aria-describedby")){const t=s.querySelector(".c-field__hint"),a=s.querySelector(".c-field__error"),i=[];t&&(t.id||(t.id=contourId("hint")),i.push(t.id)),a&&(a.id||(a.id=contourId("err")),i.push(a.id)),i.length&&e.setAttribute("aria-describedby",i.join(" "))}}})}connectedCallback(){this.applyMods();try{this.enhance(this.shadowRoot)}catch(t){}this._applyLabels();try{wcReset(this),wireTabs(this),wireSegmented(this),wireCombobox(this),wireTree(this),wireMenu(this),wirePagination(this),wireCopy(this),wireRemovable(this)}catch(t){}this.shadowRoot&&!this._wiredSlotchange&&(this._wiredSlotchange=!0,this.shadowRoot.addEventListener("slotchange",()=>{try{this.enhance(this.shadowRoot),this._applyLabels(),wireTabs(this),wireSegmented(this),wireCombobox(this),wireTree(this),wireMenu(this),wirePagination(this),wireCopy(this),wireRemovable(this)}catch(t){}}))}attributeChangedCallback(){this.applyMods(),this._applyLabels()}_applyLabels(){const t=this.shadowRoot;if(!t)return;const e=(e,s,a)=>{const i=t.querySelector(e);i&&i.setAttribute("aria-label",labelText(this,s,a))};e(".c-callout__close","close","Close"),e(".c-alert__close","close","Close"),e(".c-tag__remove","remove","Remove"),e(".c-filter-pill__remove","remove-filter","Remove filter"),e(".c-breadcrumb","breadcrumb","Breadcrumb"),e(".c-spinner","loading","Loading"),e(".c-install__copy","copy-command","Copy command");const s=t.querySelector(".c-install__copy, .c-code__copy");s&&"Copy"===s.textContent.trim()&&(s.textContent=labelText(this,"copy","Copy"))}applyMods(){const t=this.shadowRoot.firstElementChild;if(!t||!this._shadowBase)return;const e=[];for(const t of MODS){const s=this.getAttribute(t);if(s)for(const t of this._shadowBase.split(/\s+/))t&&e.push("c-"+t.replace(/^c-/,"")+"--"+s)}if(t.className=(this._shadowBase+" "+e.join(" ")).trim(),t.classList.contains("c-alert")){const e=t.classList.contains("c-alert--warning")||t.classList.contains("c-alert--danger"),s=e?"alert":"status",a=e?"assertive":"polite";t.hasAttribute("role")&&!t.dataset.contourAutoRole||(t.setAttribute("role",s),t.dataset.contourAutoRole=s),t.hasAttribute("aria-live")&&!t.dataset.contourAutoLive||(t.setAttribute("aria-live",a),t.dataset.contourAutoLive=a)}}}const SHADOW_PARTS_PUBLIC={},SHADOW_MARKUP={},recordParts=(t,e)=>{SHADOW_PARTS_PUBLIC[t]=[...e.matchAll(/part="([^"]+)"/g)].flatMap(t=>t[1].split(/\s+/)).filter(Boolean)},shadow=(t,e)=>{if(SHADOW_MARKUP[t]=e,recordParts(t,e),"undefined"==typeof document)return;const s=document.createElement("template");setHTML(s,e);const a=class extends ContourShadow{};a.contourTemplate=s,define(t,a)},slotWrapper=(t,e,s)=>"<"+t+' class="c-'+e+'" part="'+(s||e)+'"'+("button"===t?' type="button"':"")+"><slot></slot></"+t+">",SHADOW_SLOTS={div:["accordion","activity","advanced","affordance","affordances","anchor","app","app-body","box","btn-group","chart-grid","catchment","cluster","command","compare","comparison","compass","contour-plot","cta","dash-freshness","dash-kpi-row","dash-shell","dash-toolbar","datamark","delta","draggable","drag-handle","drop-indicator","drop-zone","destructive-hint","docs-shell","drawer","elevation","filter-bar","flow-map","heatmap","hexbin","icon-badge","input-group","instrument","range-scale","resizable","table-wrap","time-range","toast-host","scroll-area","isochrone","landing-features","landing-hero","layer-panel","layer-switch","legend","logos","map-area","map-footer","map-panel","map-slot","measure","metrics","minimap","pager","pagination","panel","plate","price","pricing","progress","prose","pullquote","radio-list","range","readout","recipe","reserved","resize-handle","row","row-action","scale-bar","scrim","segmented","sheet","shortcut-list","shortcut-overlay","shortcut-panel","shortcut-row","showcase","sidebar","skeleton","sparkline","stack","steps","streaming-chart","survey","theme-scope","time-slider","timeline","toast","toolbar","tooltip","tree","version","version-banner"],button:["btn","pressable"],span:["avatar","badge","chip","dot","flag","live-badge","mark","pill"],a:["link","linkish"],kbd:["kbd"],label:["check","radio","switch"],nav:["docs-nav"]},SHADOW_PARTS={"version-banner":"banner","contour-plot":"plot"};for(const[t,e]of Object.entries(SHADOW_SLOTS))for(const s of e){shadow("contour-shadow-"+s,slotWrapper(t,s,SHADOW_PARTS[s]||s))}shadow("contour-shadow-callout",'<div class="c-callout" part="callout"><div class="c-callout__title" part="title"><slot name="title"></slot></div><div class="c-callout__body" part="body"><slot></slot></div><button class="c-callout__close" part="close" type="button" aria-label="Close">×</button></div>'),shadow("contour-shadow-empty",'<div class="c-empty" part="empty"><div class="c-empty__illustration" part="illustration"><slot name="illustration"></slot></div><div class="c-empty__title" part="title"><slot name="title"></slot></div><div class="c-empty__text" part="body"><slot></slot></div><div><slot name="action"></slot></div></div>'),shadow("contour-shadow-feature",'<div class="c-feature" part="feature"><span class="c-feature__index" part="index"><slot name="index"></slot></span><div class="c-feature__title" part="title"><slot name="title"></slot></div><div class="c-feature__body" part="body"><slot></slot></div></div>'),shadow("contour-shadow-kpi",'<div class="c-kpi" part="kpi"><div class="c-kpi__value" part="value"><slot name="value"></slot></div><div class="c-kpi__label" part="label"><slot name="label"></slot></div><div class="c-kpi__foot" part="foot"><slot name="delta"></slot><slot name="note"></slot></div></div>'),shadow("contour-shadow-stat",'<div class="c-stat" part="stat"><div class="c-stat__value" part="value"><slot name="value"></slot></div><div class="c-stat__label" part="label"><slot name="label"></slot></div><div class="c-stat__delta" part="delta"><slot name="delta"></slot></div></div>'),shadow("contour-shadow-meter",'<div class="c-meter" part="meter"><span class="c-meter__core" part="core"><span class="c-meter__value" part="value"><slot name="value"></slot></span><span class="c-meter__label" part="label"><slot name="label"></slot></span></span></div>'),shadow("contour-shadow-brownout",'<div class="c-brownout" part="brownout" data-level="0"><slot></slot></div>'),shadow("contour-shadow-widget-state",'<div class="c-widget-state" part="widget-state"><slot></slot></div>'),shadow("contour-shadow-donut",'<div class="c-donut" part="donut"><svg class="c-donut__ring" part="ring" viewBox="0 0 32 32"></svg><div class="c-donut__center" part="center"><slot name="value"></slot></div><div class="c-donut__list" part="list"><slot></slot></div></div>'),shadow("contour-shadow-axis",'<div class="c-axis" part="axis"><slot></slot></div>'),shadow("contour-shadow-brush",'<div class="c-brush" part="brush"><div class="c-brush__selection" part="selection"></div></div>'),shadow("contour-shadow-stacked-bar",'<div class="c-stacked-bar" part="bar"><slot></slot></div>'),shadow("contour-shadow-category",'<div class="c-category" part="category" role="listbox"><slot></slot></div>'),shadow("contour-shadow-gauge",'<div class="c-gauge" part="gauge"><svg class="c-gauge__dial" part="dial" aria-hidden="true" viewBox="0 0 100 100"><path class="c-gauge__track" part="track" d="M 10 90 A 40 40 0 0 1 90 90"></path><g class="c-gauge__zones"></g><line class="c-gauge__needle" part="needle" x1="50" y1="50" x2="50" y2="15"></line><circle class="c-gauge__hub" part="hub" cx="50" cy="50" r="4"></circle></svg><div class="c-gauge__value" part="value"><slot name="value"></slot></div><div class="c-gauge__band" part="band"><slot name="band"></slot></div></div>'),shadow("contour-shadow-diff",'<div class="c-diff" part="diff"><div class="c-diff__line c-diff__line--del" part="before"><span class="c-diff__sign">−</span><span><slot name="before"></slot></span></div><div class="c-diff__line c-diff__line--add" part="after"><span class="c-diff__sign">+</span><span><slot name="after"></slot></span></div></div>'),shadow("contour-shadow-do-dont",'<div class="c-do-dont" part="do-dont"><div class="c-do-dont__item c-do-dont__item--do" part="do"><slot name="do"></slot></div><div class="c-do-dont__item c-do-dont__item--dont" part="dont"><slot name="dont"></slot></div></div>'),shadow("contour-shadow-threshold",'<div class="c-threshold" part="threshold"><span class="c-threshold__fill" part="value"></span><span class="c-threshold__target" part="target"></span></div>'),shadow("contour-shadow-coordinate",'<div class="c-coordinate" part="coordinate"><span class="c-coordinate__value" part="value"><slot name="value"></slot></span></div>'),shadow("contour-shadow-install",'<div class="c-install" part="install"><span class="c-install__prompt" part="prompt"><slot name="prompt"></slot></span><span class="c-install__command" part="command"><slot name="command"></slot></span><button class="c-btn c-btn--ghost c-btn--sm c-install__copy" part="copy" type="button" aria-label="Copy command">Copy</button></div>'),shadow("contour-shadow-toc",'<div class="c-toc" part="toc"><div class="c-toc__title" part="title"><slot name="title"></slot></div><nav class="c-toc__list" part="list"><slot></slot></nav></div>'),shadow("contour-shadow-testimonial",'<div class="c-testimonial" part="testimonial"><blockquote class="c-testimonial__quote" part="quote"><slot name="quote"></slot></blockquote><div class="c-testimonial__byline" part="byline"><span class="c-testimonial__name" part="name"><slot name="name"></slot></span><span class="c-testimonial__role" part="role"><slot name="role"></slot></span></div></div>'),shadow("contour-shadow-search-trigger",'<button class="c-search-trigger" part="trigger"><span><slot name="label"></slot></span><kbd class="c-search-trigger__kbd"><slot name="shortcut"></slot></kbd></button>'),shadow("contour-shadow-brand",'<a class="c-brand" part="brand"><span class="c-mark" part="mark"><slot name="mark"></slot></span><span class="c-brand__name" part="name"><slot name="name"></slot></span></a>'),shadow("contour-shadow-section-head",'<div class="c-section-head" part="head"><h2 class="c-section-head__title" part="title"><slot name="title"></slot></h2><p class="c-section-head__desc" part="desc"><slot name="desc"></slot></p></div>'),shadow("contour-shadow-loading",'<div class="c-loading" part="loading"><span class="c-spinner" part="spinner"></span><slot></slot></div>'),shadow("contour-shadow-tabs",'<div class="c-tabs" part="tabs"><div class="c-tabs__list" part="list" role="tablist"><slot name="tabs"></slot></div><div class="c-tabs__panels" role="presentation"><slot></slot></div></div>'),shadow("contour-shadow-breadcrumb",'<nav class="c-breadcrumb" part="breadcrumb" aria-label="Breadcrumb"><ol><slot></slot></ol></nav>'),shadow("contour-shadow-menu",'<div class="c-menu" part="menu" role="menu"><slot></slot></div>'),shadow("contour-shadow-combobox",'<div class="c-combobox" part="combobox"><input class="c-combobox__input" part="input" type="text" /><ul class="c-combobox__list" part="list" hidden><slot></slot></ul></div>'),shadow("contour-shadow-chart",'<div class="c-chart" part="chart"><div class="c-chart__plot" part="plot"><slot></slot></div></div>'),shadow("contour-shadow-bivariate",'<div class="c-bivariate" part="bivariate"><div class="c-bivariate__matrix" part="matrix"><slot></slot></div></div>'),shadow("contour-shadow-bivariate-legend",'<div class="c-bivariate-legend" part="legend"><div class="c-bivariate-legend__matrix" part="matrix"><slot></slot></div></div>'),shadow("contour-shadow-expandable",'<details class="c-expandable" part="expandable"><summary class="c-expandable__summary"><slot name="summary"></slot></summary><div class="c-expandable__body" part="body"><slot></slot></div></details>'),shadow("contour-shadow-disclosure",'<details class="c-disclosure" part="disclosure"><summary><slot name="summary"></slot></summary><div class="c-disclosure__body" part="body"><slot></slot></div></details>'),shadow("contour-shadow-faq",'<div class="c-faq" part="faq"><div class="c-faq__question" part="question"><slot name="question"></slot></div><div class="c-faq__answer" part="answer"><slot name="answer"></slot></div></div>'),shadow("contour-shadow-code-tabs",'<div class="c-code-tabs" part="code-tabs"><div class="c-code-tabs__list" part="list" role="tablist"><slot name="tabs"></slot></div><div class="c-code-tabs__panels"><slot></slot></div></div>'),shadow("contour-shadow-header",'<header class="c-header" part="header"><div class="container c-header__inner" part="inner"><a class="c-brand" part="brand"><slot name="brand"></slot></a><nav class="c-header__nav" part="nav"><slot name="nav"></slot></nav><div class="c-header__actions" part="actions"><slot name="actions"></slot></div></div></header>'),shadow("contour-shadow-footer",'<footer class="c-footer" part="footer"><div class="container c-footer__grid" part="grid"><div class="c-footer__brand" part="brand"><slot name="brand"></slot></div><div class="c-footer__links" part="links"><slot name="links"></slot></div></div></footer>'),shadow("contour-shadow-container",'<div class="container" part="container"><slot></slot></div>'),shadow("contour-shadow-spinner",'<span class="c-spinner" part="spinner" aria-label="Loading"></span>'),shadow("contour-shadow-code",'<pre class="c-code" part="code"><code><slot></slot></code><button class="c-code__copy" part="copy" type="button">Copy</button></pre>'),shadow("contour-shadow-card",'<div class="c-card" part="card"> <div class="c-card__title" part="head"><slot name="title">Untitled</slot></div> <div class="c-card__body" part="body"><slot></slot></div> <div class="c-card__foot" part="foot"><slot name="foot"></slot></div> </div>'),shadow("contour-shadow-field",'<div class="c-field" part="field"> <label class="c-field__label" part="label"><slot name="label">Label</slot></label> <slot name="input"></slot> <span class="c-field__hint" part="hint"><slot name="hint"></slot></span> </div>'),shadow("contour-shadow-alert",'<div class="c-alert" part="alert"> <div class="c-alert__title" part="title"><slot name="title"></slot></div> <div class="c-alert__body" part="body"><slot></slot></div> <div class="c-alert__actions" part="actions"><slot name="action"></slot></div> <button class="c-alert__close" part="close" type="button" aria-label="Close">×</button> </div>'),shadow("contour-shadow-tag",'<span class="c-tag" part="tag"><slot></slot><button class="c-tag__remove" part="remove" type="button" aria-label="Remove">×</button></span>'),shadow("contour-shadow-filter-pill",'<span class="c-filter-pill" part="filter-pill"><slot></slot><button class="c-filter-pill__remove" part="remove" type="button" aria-label="Remove filter">×</button></span>');const DIALOG_MARKUP='<dialog class="c-dialog" part="dialog"> <div class="c-dialog__head" part="head"> <slot name="title"></slot> <button class="c-btn c-btn--icon c-btn--ghost" part="close" type="button" aria-label="Close"> <svg aria-hidden="true" viewBox="0 0 24 24"><path d="m18 6-12 12M6 6l12 12" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"/></svg> </button> </div> <div class="c-dialog__body" part="body"><slot></slot></div> <div class="c-dialog__foot" part="foot"><slot name="foot"></slot></div> </dialog>';SHADOW_MARKUP["contour-shadow-dialog"]=DIALOG_MARKUP,recordParts("contour-shadow-dialog",DIALOG_MARKUP);class ContourShadowDialog extends ContourShadow{static contourTemplate="undefined"!=typeof document?(()=>{const t=document.createElement("template");return setHTML(t,DIALOG_MARKUP),t})():null;enhance(t){if(super.enhance(t),this._wiredShadowDialog)return;this._wiredShadowDialog=!0;const e=t.querySelector("dialog"),s=t.querySelector('[part="close"]');if(s&&s.addEventListener("click",()=>e?.close()),e){let t=null;e.addEventListener("beforetoggle",s=>{if("open"===s.newState){t=document.activeElement,this._syncingOpenAttr=!0,this.hasAttribute("open")||this.setAttribute("open",""),this._syncingOpenAttr=!1,this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}));const a=e.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(a)try{a.focus()}catch(s){}}else if("closed"===s.newState&&(this._syncingOpenAttr=!0,this.hasAttribute("open")&&this.removeAttribute("open"),this._syncingOpenAttr=!1,this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),t&&"function"==typeof t.focus))try{t.focus()}catch(s){}});const s=()=>{const t="button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])",s=Array.from(e.querySelectorAll(t));for(const a of e.querySelectorAll("slot"))for(const e of a.assignedElements({flatten:!0})){e.matches(t)&&s.push(e);for(const a of e.querySelectorAll(t))s.push(a)}return s},a=()=>this.shadowRoot&&this.shadowRoot.activeElement||document.activeElement;e.addEventListener("keydown",t=>{if("Tab"!==t.key)return;const e=s();if(!e.length)return;const i=e[0],r=e[e.length-1];t.shiftKey&&a()===i?(t.preventDefault(),r.focus()):t.shiftKey||a()!==r||(t.preventDefault(),i.focus())})}}static get observedAttributes(){return[...super.observedAttributes,"open"]}attributeChangedCallback(t,e,s){if(super.attributeChangedCallback(t,e,s),"open"===t&&this.shadowRoot&&!this._syncingOpenAttr){const t=this.shadowRoot.querySelector("dialog");t&&(null===s||t.open?null===s&&t.open&&this.close():this.show())}}connectedCallback(){super.connectedCallback(),this.hasAttribute("open")&&this.show()}show(){if(!this.isConnected)return void(this.hasAttribute("open")||this.setAttribute("open",""));const t=this.shadowRoot?.querySelector("dialog");t&&!t.open&&t.showModal()}close(){const t=this.shadowRoot?.querySelector("dialog");t&&t.open&&t.close()}showModal(){this.show()}get open(){return!!this.shadowRoot?.querySelector("dialog")?.open}set open(t){t?this.show():this.close()}get returnValue(){return this.shadowRoot?.querySelector("dialog")?.returnValue??""}set returnValue(t){const e=this.shadowRoot?.querySelector("dialog");e&&(e.returnValue=String(t))}}define("contour-shadow-dialog",ContourShadowDialog);const renderShadowDSD=(t,e="",s="")=>{const a=SHADOW_MARKUP[t];if("string"!=typeof a)return null;return`<${t}${e?e.startsWith(" ")?e:" "+e:""}><template shadowrootmode="open">${a}</template>${s}</${t}>`},FROZEN_SHADOW_MARKUP=Object.freeze({...SHADOW_MARKUP});if("undefined"!=typeof globalThis&&(globalThis.ContourShadowTemplates=FROZEN_SHADOW_MARKUP),"undefined"!=typeof window){window.ContourShadowParts=Object.freeze(Object.fromEntries(Object.entries(SHADOW_PARTS_PUBLIC).map(([t,e])=>[t,Object.freeze([...new Set(e)])]))),window.Contour||(window.Contour={});try{window.Contour.shadowTemplates=FROZEN_SHADOW_MARKUP}catch{}}export{SHADOW_MARKUP,renderShadowDSD};class ContourPressableFull extends ContourBase{static get observed(){return["disabled","label"]}static get properties(){return{disabled:{attribute:"disabled",type:Boolean}}}render(){this.classList.add("c-pressable"),this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||"Pressable"),this.hasAttribute("disabled")?(this.setAttribute("aria-disabled","true"),this.setAttribute("tabindex","-1")):(this.removeAttribute("aria-disabled"),this.hasAttribute("tabindex")&&"-1"!==this.getAttribute("tabindex")||this.setAttribute("tabindex","0"))}enhance(){if(this._wiredPressable)return;this._wiredPressable=!0;const t=()=>this.hasAttribute("disabled")||"true"===this.getAttribute("aria-disabled");this.addEventListener("click",e=>{t()&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener("keydown",e=>{if(t())return e.preventDefault(),void e.stopImmediatePropagation();"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.click(),this.dispatchEvent(new CustomEvent("contour:activate",{bubbles:!0,composed:!0})))})}}define("contour-pressable",ContourPressableFull);class ContourResizeHandleFull extends ContourBase{render(){this.classList.add("c-resize-handle"),this.hasAttribute("role")||this.setAttribute("role","separator"),this.hasAttribute("aria-valuenow")||this.setAttribute("aria-valuenow","0"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",labelText(this,"resize-handle","Resize handle")),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("aria-orientation")||this.setAttribute("aria-orientation","horizontal")}enhance(){this._wiredResizeHandle||(this._wiredResizeHandle=!0,this.addEventListener("keydown",t=>{const e=Number(this.getAttribute("aria-valuenow"))||0;let s=0;if("ArrowLeft"===t.key||"ArrowDown"===t.key)s=-5;else if("ArrowRight"===t.key||"ArrowUp"===t.key)s=5;else if("Home"===t.key)s=-e;else{if("End"!==t.key)return;s=100-e}t.preventDefault();const a=Math.min(100,Math.max(0,e+s));this.setAttribute("aria-valuenow",String(a)),this.dispatchEvent(new CustomEvent("contour:resize",{bubbles:!0,composed:!0,detail:{value:a,delta:s}}))}))}}define("contour-resize-handle",ContourResizeHandleFull);class ContourSearchTriggerFull extends ContourBase{static get observed(){return["label","shortcut"]}static get properties(){return{label:{attribute:"label"},shortcut:{attribute:"shortcut"}}}render(){this.classList.add("c-search-trigger");const t=this.getAttribute("label")||"Search";this.hasAttribute("aria-label")||this.setAttribute("aria-label",t);const e=this.ensure(".c-search-trigger__text",()=>{const t=document.createElement("span");return t.className="c-search-trigger__text",t});e.className="c-search-trigger__text",e.textContent.trim()&&e.textContent.trim()===t||(e.textContent=t);const s=this.ensure("kbd.c-search-trigger__kbd",()=>{const t=document.createElement("kbd");return t.className="c-search-trigger__kbd",t});s.className="c-search-trigger__kbd",s.textContent=this.getAttribute("shortcut")||"⌘K"}}define("contour-search-trigger",ContourSearchTriggerFull);class ContourShortcutListFull extends ContourBase{static get observed(){return["title"]}static get properties(){return{title:{attribute:"title"}}}render(){this.classList.add("c-shortcut-list"),this.setAttribute("role","list");const t=this.getAttribute("title");if(t){this.ensure(".c-shortcut-list__title",()=>{const t=document.createElement("div");return t.className="c-shortcut-list__title",t}).textContent=t}}}define("contour-shortcut-list",ContourShortcutListFull);class ContourShortcutRowFull extends ContourBase{static get observed(){return["desc","key"]}static get properties(){return{desc:{attribute:"desc"},key:{attribute:"key"}}}render(){this.classList.add("c-shortcut-row"),this.hasAttribute("role")||this.setAttribute("role","listitem");const t=this.getAttribute("key"),e=this.getAttribute("desc");if(t){const e=this.ensure(".c-shortcut-row__keys",()=>{const t=document.createElement("kbd");return t.className="c-shortcut-row__keys",t});e.className="c-shortcut-row__keys",e.textContent=t}else{const t=this.querySelector(".c-shortcut-row__keys");t&&t.remove()}if(e){const t=this.ensure(".c-shortcut-row__label",()=>{const t=document.createElement("span");return t.className="c-shortcut-row__label",t});t.className="c-shortcut-row__label",t.textContent=e}else{const t=this.querySelector(".c-shortcut-row__label");t&&t.remove()}}}define("contour-shortcut-row",ContourShortcutRowFull);class ContourShortcutPanelFull extends ContourBase{static get observed(){return["title"]}static get properties(){return{title:{attribute:"title"}}}render(){this.classList.add("c-shortcut-panel");const t=this.getAttribute("title");if(t){this.ensure(".c-shortcut-panel__title",()=>{const t=document.createElement("div");return t.className="c-shortcut-panel__title",t}).textContent=t}else{const t=this.querySelector(".c-shortcut-panel__title");t&&t.remove()}}}define("contour-shortcut-panel",ContourShortcutPanelFull);class ContourShortcutOverlayFull extends ContourBase{static get observed(){return["title","open","keybind"]}static get properties(){return{title:{attribute:"title"},open:{attribute:"open",type:Boolean},keybind:{attribute:"keybind"}}}render(){this.classList.add("c-shortcut-overlay"),this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("aria-modal")||this.setAttribute("aria-modal","true"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("title")||"Keyboard shortcuts");const t=this.getAttribute("title");if(t){this.ensure(".c-shortcut-overlay__title",()=>{const t=document.createElement("div");return t.className="c-shortcut-overlay__title",t}).textContent=t}this.hasAttribute("open")?this.removeAttribute("hidden"):this.hasAttribute("hidden")||this.setAttribute("hidden","")}show(){if(this.hasAttribute("open"))return;this._opener=document.activeElement,this.setAttribute("open",""),this.removeAttribute("hidden"),modalContain(this,!0),this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}));const t=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");t&&t.focus()}hide(){this.hasAttribute("open")&&(this.removeAttribute("open"),this.setAttribute("hidden",""),modalContain(this,!1),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),this._opener&&"function"==typeof this._opener.focus&&this._opener.focus(),this._opener=null)}toggle(){this.hasAttribute("open")?this.hide():this.show()}enhance(){if(this._wiredShortcutOverlay)return;this._wiredShortcutOverlay=!0;const t=t=>{if("?"!==t.key||!flagOn(this,"keybind")||t.metaKey||t.ctrlKey||t.altKey)"Escape"===t.key&&this.hasAttribute("open")&&this.hide();else{const e=t.target&&t.target.tagName||"";if("INPUT"===e||"TEXTAREA"===e||t.target&&t.target.isContentEditable)return;t.preventDefault(),this.toggle()}};document.addEventListener("keydown",t),onDispose(this,()=>document.removeEventListener("keydown",t)),this.addEventListener("click",t=>{t.target===this&&this.hide()})}}define("contour-shortcut-overlay",ContourShortcutOverlayFull);class ContourRowActionFull extends ContourBase{static get observed(){return["label","disabled"]}static get properties(){return{label:{attribute:"label"},disabled:{attribute:"disabled",type:Boolean}}}render(){this.classList.add("c-row-action"),this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("disabled")?(this.setAttribute("aria-disabled","true"),this.setAttribute("tabindex","-1")):(this.removeAttribute("aria-disabled"),this.hasAttribute("tabindex")&&"-1"!==this.getAttribute("tabindex")||this.setAttribute("tabindex","0"));const t=this.getAttribute("label");t&&!this.hasChildNodes()&&(this.textContent=t),t&&!this.hasAttribute("aria-label")&&this.setAttribute("aria-label",t)}enhance(){if(this._wiredRowAction)return;this._wiredRowAction=!0;const t=()=>this.hasAttribute("disabled")||"true"===this.getAttribute("aria-disabled");this.addEventListener("click",e=>{t()&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener("keydown",e=>{if(t())return e.preventDefault(),void e.stopImmediatePropagation();"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.click(),this.dispatchEvent(new CustomEvent("contour:activate",{bubbles:!0,composed:!0})))})}}define("contour-row-action",ContourRowActionFull);class ContourSegmented extends ContourBase{static get observed(){return["options","items","selected","label","value"]}static get properties(){return{options:{attribute:"options"},items:{attribute:"items"},selected:{attribute:"selected"},label:{attribute:"label"},value:{attribute:"value"}}}render(){this.classList.add("c-segmented");const t=this.getAttribute("options")||this.getAttribute("items");if(t){let e=null;try{e=JSON.parse(t)}catch(t){e=null}if(Array.isArray(e)){Array.from(this.querySelectorAll("button.c-segmented__option")).forEach(t=>t.remove());const t=this.getAttribute("selected")||this.getAttribute("value");e.forEach((e,s)=>{const a="string"==typeof e?e:e.label||e.value||"",i="string"==typeof e?e:e.value||e.label||"",r=document.createElement("button");r.className="c-segmented__option",r.type="button",r.textContent=a,r.dataset.value=i,null!==t&&String(i)===String(t)||null===t&&0===s?r.setAttribute("aria-pressed","true"):r.setAttribute("aria-pressed","false"),this.appendChild(r)})}}}enhance(){wireSegmented(this)}}define("contour-segmented",ContourSegmented);class ContourDraggable extends ContourBase{render(){this.classList.add("c-draggable"),this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("draggable")||this.setAttribute("draggable","true"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||"Draggable item")}_dragValue(){return this.getAttribute("value")||this.getAttribute("label")||(this.textContent||"").trim()||"draggable"}enhance(){this._wiredDraggable||(this._wiredDraggable=!0,this.addEventListener("dragstart",t=>{if(!t.dataTransfer)return;const e=this._dragValue();try{t.dataTransfer.effectAllowed="move"}catch(t){}t.dataTransfer.setData("text/plain",e),this.classList.add("c-draggable--dragging"),this.dispatchEvent(new CustomEvent("contour:dragstart",{bubbles:!0,composed:!0,detail:{value:e}}))}),this.addEventListener("dragend",()=>{this.classList.remove("c-draggable--dragging"),this.dispatchEvent(new CustomEvent("contour:dragend",{bubbles:!0,composed:!0,detail:{value:this._dragValue()}}))}),this.addEventListener("keydown",t=>{if("Enter"===t.key||" "===t.key)return t.preventDefault(),void this.dispatchEvent(new CustomEvent("contour:activate",{bubbles:!0,composed:!0}));"ArrowUp"!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:move",{bubbles:!0,composed:!0,detail:{direction:"ArrowUp"===t.key?"up":"down"}})))}))}}define("contour-draggable",ContourDraggable);class ContourDragHandle extends ContourBase{render(){this.classList.add("c-drag-handle"),this.hasAttribute("role")||this.setAttribute("role","separator");const t=this.getAttribute("min")||"0",e=this.getAttribute("max")||"100";this.hasAttribute("aria-valuenow")||this.setAttribute("aria-valuenow",t),this.hasAttribute("aria-valuemin")||this.setAttribute("aria-valuemin",t),this.hasAttribute("aria-valuemax")||this.setAttribute("aria-valuemax",e),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||"Drag handle"),this.hasAttribute("aria-orientation")||this.setAttribute("aria-orientation","horizontal");const s=this.getAttribute("controls");s&&!this.hasAttribute("aria-controls")&&this.setAttribute("aria-controls",s);const a=this.ensure(".c-drag-handle__grip",()=>{const t=document.createElement("span");return t.className="c-drag-handle__grip",t.setAttribute("aria-hidden","true"),setHTML(t,'<svg viewBox="0 0 24 24"><use href="#i-drag" /></svg>'),t});a.parentNode!==this&&this.appendChild(a)}enhance(){this._wiredDragHandle||(this._wiredDragHandle=!0,this.addEventListener("keydown",t=>{const e=Number(this.getAttribute("aria-valuenow")||0),s=Number(this.getAttribute("aria-valuemin")||0),a=Number(this.getAttribute("aria-valuemax")||100);let i=0;if("ArrowLeft"===t.key||"ArrowDown"===t.key)i=-1;else if("ArrowRight"===t.key||"ArrowUp"===t.key)i=1;else if("Home"===t.key)i=s-e;else{if("End"!==t.key)return;i=a-e}t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:drag",{bubbles:!0,composed:!0,detail:{key:t.key,delta:i,value:e}}))}))}}define("contour-drag-handle",ContourDragHandle);class ContourDropIndicator extends ContourBase{static get observed(){return["label","open"]}static get properties(){return{label:{attribute:"label"},open:{attribute:"open",type:Boolean}}}render(){this.classList.add("c-drop-indicator"),this.classList.toggle("c-drop-indicator--visible",this.hasAttribute("open")),this.hasAttribute("role")||this.setAttribute("role","presentation"),"presentation"===this.getAttribute("role")&&(this.removeAttribute("aria-label"),this.removeAttribute("aria-labelledby")),Array.from(this.childNodes).forEach(t=>{(t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE&&"SPAN"===t.tagName)&&t.remove()});const t=this.getAttribute("label");if(t){this.ensure(".c-drop-indicator__label",()=>{const t=document.createElement("span");return t.className="c-drop-indicator__label",t}).textContent=t}}}define("contour-drop-indicator",ContourDropIndicator);class ContourDropZone extends ContourBase{static get observed(){return["label"]}static get properties(){return{label:{attribute:"label"}}}render(){this.classList.add("c-drop-zone"),this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||"Drop zone"),Array.from(this.childNodes).forEach(t=>{(t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE&&"SPAN"===t.tagName)&&t.remove()});const t=this.getAttribute("label");if(t){const e=this.ensure(".c-drop-zone__label",()=>{const t=document.createElement("p");return t.className="c-drop-zone__label",t});setHTML(e,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-upload" /></svg>'),e.appendChild(document.createTextNode(" "+t))}}enhance(){if(this._wiredDropZone)return;this._wiredDropZone=!0;const t=t=>t.dataTransfer&&Array.from(t.dataTransfer.types).includes("text/plain"),e=()=>{this.classList.remove("c-drop-zone--active","c-drop-zone--reject")};this.addEventListener("dragenter",e=>{e.dataTransfer&&(this.classList.toggle("c-drop-zone--reject",!t(e)),t(e)&&(e.preventDefault(),this.classList.add("c-drop-zone--active")))}),this.addEventListener("dragover",e=>{e.dataTransfer&&(this.classList.toggle("c-drop-zone--reject",!t(e)),t(e)&&(e.preventDefault(),this.classList.add("c-drop-zone--active")))}),this.addEventListener("dragleave",e),this.addEventListener("drop",s=>{if(!t(s))return;s.preventDefault(),e();const a=s.dataTransfer.getData("text/plain")||"";this.dispatchEvent(new CustomEvent("contour:drop",{bubbles:!0,composed:!0,detail:{value:a,label:this.getAttribute("label")}}))})}}define("contour-drop-zone",ContourDropZone);class ContourResizable extends ContourBase{static get observed(){return["direction","value"]}static get properties(){return{direction:{attribute:"direction"},value:{attribute:"value"}}}render(){this.classList.add("c-resizable"),this.classList.remove("c-resizable--vertical","c-resizable--horizontal");const t="vertical"===this.getAttribute("direction");if(this.classList.add(t?"c-resizable--vertical":"c-resizable--horizontal"),!this.querySelector(".c-resizable__pane")){const t=document.createElement("div");t.className="c-resizable__pane";const e=document.createElement("div");e.className="c-resize-handle",e.setAttribute("tabindex","0"),e.setAttribute("role","separator"),e.setAttribute("aria-valuenow","0");const s=document.createElement("div");s.className="c-resizable__pane",this.appendChild(t),this.appendChild(e),this.appendChild(s)}const e=this._splitValue||this.getAttribute("value"),s=this.querySelector(".c-resize-handle");if(s&&(s.setAttribute("role","separator"),s.setAttribute("tabindex","0"),s.setAttribute("aria-valuenow",String(Math.round(parseFloat(e)||50))),s.setAttribute("aria-valuemin","10"),s.setAttribute("aria-valuemax","90"),s.setAttribute("aria-orientation",t?"horizontal":"vertical"),s.setAttribute("aria-label",labelText(this,"resize-panels","Resize panels"))),e){const t=this.querySelector(".c-resizable__pane");t&&(t.style.flex=`0 0 ${e}%`)}}enhance(){if(this._wiredResizable)return;this._wiredResizable=!0;const t=t=>{const e=this.querySelector(".c-resizable__pane");e&&(e.style.flex=`0 0 ${t}%`),this._splitValue=String(t);const s=this.querySelector(".c-resize-handle");if(s){const e=this.classList.contains("c-resizable--vertical");s.setAttribute("role","separator"),s.setAttribute("aria-valuenow",String(t)),s.setAttribute("aria-valuemin","10"),s.setAttribute("aria-valuemax","90"),s.setAttribute("aria-orientation",e?"horizontal":"vertical"),s.setAttribute("aria-label",labelText(this,"resize-panels","Resize panels")),s.setAttribute("tabindex","0")}},e=(e,s)=>{const a=this.getBoundingClientRect(),i=this.classList.contains("c-resizable--vertical"),r=i?a.height:a.width,o=i?s-a.top:e-a.left,l=r>0?Math.min(.9,Math.max(.1,o/r)):.5;t(Math.round(100*l))};this.addEventListener("pointerdown",t=>{const e=this.querySelector(".c-resize-handle");if(e&&t.target===e){if(this._resizing=!0,e.classList.add("c-resize-handle--dragging"),e.setPointerCapture)try{e.setPointerCapture(t.pointerId)}catch(t){}t.preventDefault()}}),this.addEventListener("pointermove",t=>{this._resizing&&e(t.clientX,t.clientY)});const s=t=>{if(!this._resizing)return;this._resizing=!1,this._splitValue&&(this.setAttribute("value",this._splitValue),this._splitValue=null);const e=this.getBoundingClientRect();this.dispatchEvent(new CustomEvent("contour:resize",{bubbles:!0,composed:!0,detail:{width:Math.round(e.width),height:Math.round(e.height)}}));const s=this.querySelector(".c-resize-handle");if(s&&(s.classList.remove("c-resize-handle--dragging"),s.hasPointerCapture&&s.hasPointerCapture(t.pointerId)))try{s.releasePointerCapture(t.pointerId)}catch(t){}};this.addEventListener("pointerup",s),this.addEventListener("pointercancel",s),this.addEventListener("keydown",e=>{const s=this.querySelector(".c-resize-handle");if(!s||document.activeElement!==s)return;this.classList.contains("c-resizable--vertical");const a=parseFloat(this.getAttribute("value"))||50;"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),t(Math.max(10,a-5)),this._splitValue=null,this.setAttribute("value",String(Math.max(10,a-5)))):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),t(Math.min(90,a+5)),this._splitValue=null,this.setAttribute("value",String(Math.min(90,a+5))));const i=this.getBoundingClientRect();this.dispatchEvent(new CustomEvent("contour:resize",{bubbles:!0,composed:!0,detail:{width:Math.round(i.width),height:Math.round(i.height)}}))})}}define("contour-resizable",ContourResizable);class ContourSplitView extends ContourBase{static get observed(){return["direction","value","left-label","right-label"]}static get properties(){return{direction:{attribute:"direction"},value:{attribute:"value"},"left-label":{attribute:"left-label"},"right-label":{attribute:"right-label"}}}render(){this.classList.add("c-split-view"),this.setAttribute("role","region");const t="vertical"===this.getAttribute("direction");if(t?(this.classList.add("c-split-view--vertical"),this.classList.remove("c-split-view--horizontal")):(this.classList.add("c-split-view--horizontal"),this.classList.remove("c-split-view--vertical")),this.getAttribute("left-label")&&this.setAttribute("aria-label",this.getAttribute("left-label")),!this.querySelector(".c-split-view__pane")){const e=document.createElement("div");e.className="c-split-view__pane c-split-view__pane--left",e.setAttribute("role","region"),this.getAttribute("left-label")&&e.setAttribute("aria-label",this.getAttribute("left-label"));const s=document.createElement("div");s.className="c-split-view__divider",s.setAttribute("tabindex","0"),s.setAttribute("role","separator"),s.setAttribute("aria-valuenow",this.getAttribute("value")||"50"),s.setAttribute("aria-valuemin","10"),s.setAttribute("aria-valuemax","90"),s.setAttribute("aria-orientation",t?"horizontal":"vertical"),s.setAttribute("aria-label",labelText(this,"split-divider","Split divider"));const a=document.createElement("div");a.className="c-split-view__pane c-split-view__pane--right",a.setAttribute("role","region"),this.getAttribute("right-label")&&a.setAttribute("aria-label",this.getAttribute("right-label")),this.appendChild(e),this.appendChild(s),this.appendChild(a)}if(!this.querySelector(".c-split-view__divider")){const e=document.createElement("div");e.className="c-split-view__divider",e.setAttribute("tabindex","0"),e.setAttribute("role","separator"),e.setAttribute("aria-valuenow",this.getAttribute("value")||"50"),e.setAttribute("aria-valuemin","10"),e.setAttribute("aria-valuemax","90"),e.setAttribute("aria-orientation",t?"horizontal":"vertical"),e.setAttribute("aria-label",labelText(this,"split-divider","Split divider")),this.appendChild(e)}const e=this.getAttribute("value")||"50",s=this.querySelector(".c-split-view__pane--left");s&&(s.style.flex=`0 0 ${e}%`);const a=this.querySelector(".c-split-view__divider");a&&(a.setAttribute("aria-valuenow",e),a.setAttribute("aria-valuemin","10"),a.setAttribute("aria-valuemax","90"),a.setAttribute("aria-orientation",t?"horizontal":"vertical"))}enhance(){if(this._wiredSplitView)return;this._wiredSplitView=!0;const t=()=>"column"===getComputedStyle(this).flexDirection,e=()=>{const e=this.querySelector(".c-split-view__divider");e&&e.setAttribute("aria-orientation",t()?"horizontal":"vertical")};if(e(),"function"==typeof ResizeObserver){const t=new ResizeObserver(e);t.observe(this),onDispose(this,()=>t.disconnect())}const s=(e,s)=>{const a=this.getBoundingClientRect(),i=t(),r=i?a.height:a.width,o=i?s-a.top:e-a.left,l=r>0?Math.min(.9,Math.max(.1,o/r)):.5,n=Math.round(100*l),c=this.querySelector(".c-split-view__pane--left");c&&(c.style.flex=`0 0 ${n}%`);const d=this.querySelector(".c-split-view__divider");d&&d.setAttribute("aria-valuenow",String(n)),this.setAttribute("value",String(n))};this.addEventListener("pointerdown",t=>{const e=this.querySelector(".c-split-view__divider");if(e&&t.target===e){if(this._resizing=!0,e.classList.add("c-split-view__divider--dragging"),e.setPointerCapture)try{e.setPointerCapture(t.pointerId)}catch(t){}t.preventDefault()}}),this.addEventListener("pointermove",t=>{this._resizing&&s(t.clientX,t.clientY)});const a=t=>{if(!this._resizing)return;this._resizing=!1;const e=this.querySelector(".c-split-view__divider");if(e&&(e.classList.remove("c-split-view__divider--dragging"),e.hasPointerCapture&&e.hasPointerCapture(t.pointerId)))try{e.releasePointerCapture(t.pointerId)}catch(t){}const s=this.getBoundingClientRect();this.dispatchEvent(new CustomEvent("contour:split-change",{bubbles:!0,composed:!0,detail:{value:this.getAttribute("value"),width:Math.round(s.width),height:Math.round(s.height)}}))};this.addEventListener("pointerup",a),this.addEventListener("pointercancel",a),this.addEventListener("keydown",t=>{const e=this.querySelector(".c-split-view__divider");if(!e||document.activeElement!==e)return;const s=parseFloat(this.getAttribute("value"))||50;if("ArrowLeft"===t.key||"ArrowDown"===t.key){t.preventDefault();const e=Math.max(10,s-5),a=this.querySelector(".c-split-view__pane--left");a&&(a.style.flex=`0 0 ${e}%`),this.setAttribute("value",String(e));const i=this.querySelector(".c-split-view__divider");i&&i.setAttribute("aria-valuenow",String(e))}else if("ArrowRight"===t.key||"ArrowUp"===t.key){t.preventDefault();const e=Math.min(90,s+5),a=this.querySelector(".c-split-view__pane--left");a&&(a.style.flex=`0 0 ${e}%`),this.setAttribute("value",String(e));const i=this.querySelector(".c-split-view__divider");i&&i.setAttribute("aria-valuenow",String(e))}const a=this.getBoundingClientRect();this.dispatchEvent(new CustomEvent("contour:split-change",{bubbles:!0,composed:!0,detail:{value:this.getAttribute("value"),width:Math.round(a.width),height:Math.round(a.height)}}))})}}define("contour-split-view",ContourSplitView);class ContourTableWrap extends ContourBase{static get observed(){return[]}static get properties(){return{}}render(){this.classList.add("c-table-wrap"),Array.from(this.childNodes).forEach(t=>{(t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE&&"SPAN"===t.tagName)&&t.remove()})}}define("contour-table-wrap",ContourTableWrap);class ContourScrollArea extends ContourBase{static get observed(){return["title"]}static get properties(){return{title:{attribute:"title"}}}render(){this.classList.add("c-scroll-area");const t=this.getAttribute("title");if(t){this.ensure(".c-scroll-area__title",()=>{const t=document.createElement("div");return t.className="c-scroll-area__title",t}).textContent=t}}}define("contour-scroll-area",ContourScrollArea);class ContourBtn extends ContourBase{static get observed(){return["variant","size","color","label","disabled","href","loading","title"]}static get properties(){return{variant:{attribute:"variant"},size:{attribute:"size"},color:{attribute:"color"},label:{attribute:"label"},disabled:{attribute:"disabled",type:Boolean}}}render(){this.classList.add("c-btn");for(const t of["variant","size","color"]){const e=this.getAttribute(t);e&&this.classList.add("c-btn--"+e)}this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("disabled")?(this.setAttribute("aria-disabled","true"),this.setAttribute("tabindex","-1")):(this.removeAttribute("aria-disabled"),this.hasAttribute("tabindex")&&"-1"!==this.getAttribute("tabindex")||this.setAttribute("tabindex","0"));const t=this.getAttribute("label")||this.getAttribute("title");t&&!this.hasChildNodes()&&(this.textContent=t),t&&!this.hasAttribute("aria-label")&&this.setAttribute("aria-label",t),this.hasAttribute("loading")?(this.setAttribute("data-loading","true"),this.setAttribute("aria-busy","true")):(this.removeAttribute("data-loading"),this.removeAttribute("aria-busy"))}enhance(){if(this._wiredBtn)return;this._wiredBtn=!0;const t=()=>this.hasAttribute("disabled")||"true"===this.getAttribute("aria-disabled");this.addEventListener("click",e=>{t()&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener("click",e=>{if(t())return;const s=safeHref(this.getAttribute("href"));s&&"#"!==s&&(location.href=s)}),this.addEventListener("keydown",e=>{if(t())return e.preventDefault(),void e.stopImmediatePropagation();"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.click(),this.dispatchEvent(new CustomEvent("contour:activate",{bubbles:!0,composed:!0})))})}}define("contour-btn",ContourBtn);
|