contour-ds 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-manifest.json +77 -77
- package/dist/contour-wc-core.esm.js +3 -1
- package/dist/contour-wc-core.esm.min.js +1 -1
- package/dist/contour-wc-dashboard.esm.js +160 -26
- package/dist/contour-wc-dashboard.esm.min.js +1 -1
- package/dist/contour-wc-data.esm.js +160 -26
- package/dist/contour-wc-data.esm.min.js +1 -1
- package/dist/contour-wc-feedback.esm.js +19 -14
- package/dist/contour-wc-feedback.esm.min.js +1 -1
- package/dist/contour-wc-forms.esm.js +38 -2
- package/dist/contour-wc-forms.esm.min.js +1 -1
- package/dist/contour-wc-interaction.esm.js +9 -0
- package/dist/contour-wc-interaction.esm.min.js +1 -1
- package/dist/contour-wc-navigation.esm.js +36 -12
- package/dist/contour-wc-navigation.esm.min.js +1 -1
- package/dist/contour-wc-ui.esm.js +68 -17
- package/dist/contour-wc-ui.esm.min.js +1 -1
- package/dist/contour-wc.esm.js +333 -72
- package/dist/contour-wc.esm.min.js +1 -1
- package/dist/contour-wc.js +333 -72
- package/dist/contour-wc.min.js +1 -1
- package/dist/contour.code-snippets +3 -3
- package/dist/contour.components.json +157 -13
- package/dist/contour.css +36 -3
- package/dist/contour.d.ts +15 -13
- package/dist/contour.html-data.json +78 -2
- package/dist/contour.min.css +1 -1
- package/dist/contour.single.html +1 -1
- package/dist/contour.single.min.css +1 -1
- package/dist/contour.web-types.json +78 -2
- package/dist/custom-elements.json +330 -0
- package/dist/docs/actions.md +1 -1
- package/dist/docs/affordances.md +1 -1
- package/dist/docs/apireference.md +1 -1
- package/dist/docs/colour.md +1 -1
- package/dist/docs/componentindex.md +1 -1
- package/dist/docs/data.md +1 -1
- package/dist/docs/docs.md +1 -1
- package/dist/docs/feedback.md +1 -1
- package/dist/docs/field.md +1 -1
- package/dist/docs/forms.md +1 -1
- package/dist/docs/index.json +2 -2
- package/dist/docs/install.md +1 -1
- package/dist/docs/landing.md +1 -1
- package/dist/docs/mapengine.md +1 -1
- package/dist/docs/motion.md +1 -1
- package/dist/docs/navigation.md +1 -1
- package/dist/docs/overlays.md +1 -1
- package/dist/docs/overview.md +1 -1
- package/dist/docs/patterns.md +1 -1
- package/dist/docs/playground.md +1 -1
- package/dist/docs/principles.md +1 -1
- package/dist/docs/recipes.md +1 -1
- package/dist/docs/space.md +1 -1
- package/dist/docs/status.md +1 -1
- package/dist/docs/surfaces.md +1 -1
- package/dist/docs/theming.md +1 -1
- package/dist/docs/type.md +1 -1
- package/dist/docs/webcomponents.md +1 -1
- 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/wc/core.mjs +2 -0
- package/dist/wc/data-chart.mjs +56 -3
- package/dist/wc/data-gauge.mjs +17 -3
- package/dist/wc/data-geo.mjs +26 -11
- package/dist/wc/data-legend.mjs +49 -4
- package/dist/wc/data-readout.mjs +8 -3
- package/dist/wc/data-series.mjs +4 -2
- package/dist/wc/feedback.mjs +19 -14
- package/dist/wc/forms-controls.mjs +38 -2
- package/dist/wc/index.mjs +1 -1
- package/dist/wc/interaction.mjs +9 -0
- package/dist/wc/navigation-menu.mjs +31 -9
- package/dist/wc/navigation-tree.mjs +5 -3
- package/dist/wc/ui-data.mjs +4 -4
- package/dist/wc/ui-overlays.mjs +64 -13
- package/integrations/libreship/contract.json +13 -2
- package/package.json +1 -1
|
@@ -869,8 +869,16 @@ class ContourAlert extends ContourBase {
|
|
|
869
869
|
const t = this.querySelector(".c-alert__title");
|
|
870
870
|
if (t) t.remove();
|
|
871
871
|
}
|
|
872
|
-
// Authored children move into .c-alert__body (default slot); `body`
|
|
873
|
-
|
|
872
|
+
// Authored children move into .c-alert__body (default slot); the `body`
|
|
873
|
+
// attribute is authoritative when present.
|
|
874
|
+
const bodyAttr = this.getAttribute("body");
|
|
875
|
+
const bodyPresent = bodyAttr !== null;
|
|
876
|
+
// U-18: an absent or empty `body` is an explicit clear. The base class lifts
|
|
877
|
+
// the previous `.c-alert__body` text back onto the host before re-render, so
|
|
878
|
+
// that lifted node must not be mistaken for authored content when the `body`
|
|
879
|
+
// attribute is present-but-empty or has been removed. `_alertHadBody` keeps
|
|
880
|
+
// a removed attribute distinguishable from a component that never set one.
|
|
881
|
+
const bodyAuthoritative = bodyPresent || this._alertHadBody === true;
|
|
874
882
|
const authored = Array.from(this.childNodes).filter((n) => {
|
|
875
883
|
// U-9: generated controls (action/close) are NOT authored children. Before
|
|
876
884
|
// this they were folded into the body on re-render, which wiped a changed
|
|
@@ -878,26 +886,23 @@ class ContourAlert extends ContourBase {
|
|
|
878
886
|
// never ran). Excluding them keeps `body` authoritative across re-renders.
|
|
879
887
|
if (n.nodeType === 1 && n.classList && (n.classList.contains("c-alert__icon") || n.classList.contains("c-alert__title") || n.classList.contains("c-alert__body") || n.classList.contains("c-alert__action") || n.classList.contains("c-alert__close"))) return false;
|
|
880
888
|
if (n.nodeType === 3 && !n.textContent.trim()) return false;
|
|
889
|
+
// U-18: the lifted body text belongs to the `body` attribute, not the slot.
|
|
890
|
+
if (bodyAuthoritative && n.nodeType === 3) return false;
|
|
881
891
|
return true;
|
|
882
892
|
});
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
if (
|
|
888
|
-
for (const n of authored) { if (n.nodeType === 3 && n.parentNode === this) n.remove(); }
|
|
889
|
-
}
|
|
890
|
-
if (authored.length && !body) {
|
|
893
|
+
if (bodyAuthoritative) {
|
|
894
|
+
const b = this.ensure(".c-alert__body", () => { const el = document.createElement("div"); el.className = "c-alert__body"; return el; });
|
|
895
|
+
// Present-but-empty clears to ""; a removed attribute also clears.
|
|
896
|
+
b.textContent = bodyPresent ? bodyAttr : "";
|
|
897
|
+
} else if (authored.length) {
|
|
891
898
|
const b = this.ensure(".c-alert__body", () => { const el = document.createElement("div"); el.className = "c-alert__body"; return el; });
|
|
892
899
|
b.textContent = "";
|
|
893
900
|
for (const n of authored) b.appendChild(n);
|
|
894
|
-
} else if (body) {
|
|
895
|
-
const b = this.ensure(".c-alert__body", () => { const el = document.createElement("div"); el.className = "c-alert__body"; return el; });
|
|
896
|
-
b.textContent = body;
|
|
897
901
|
} else {
|
|
898
902
|
const b = this.querySelector(".c-alert__body");
|
|
899
903
|
if (b) b.remove();
|
|
900
904
|
}
|
|
905
|
+
this._alertHadBody = bodyPresent;
|
|
901
906
|
// Remove stale action buttons on re-render.
|
|
902
907
|
Array.from(this.querySelectorAll(".c-alert__action")).forEach((n) => n.remove());
|
|
903
908
|
const actionsAttr = this.getAttribute("actions");
|
|
@@ -929,7 +934,7 @@ class ContourAlert extends ContourBase {
|
|
|
929
934
|
const btn = this.querySelector(".c-alert__close");
|
|
930
935
|
if (btn) btn.remove();
|
|
931
936
|
}
|
|
932
|
-
if (!title && !
|
|
937
|
+
if (!title && !bodyAttr && !icon && !authored.length) {
|
|
933
938
|
renderEmpty(this, "alert");
|
|
934
939
|
}
|
|
935
940
|
}
|
|
@@ -1 +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,PROPERTY_FIELDS,normalizeProperty,propertyDescriptor,propertyTypeOf,contourDiagnosticsEnabled,setContourDiagnostics,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,virtualRange,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 o="";for(let e=0;e<t.length;e++)o+=t[e].cssText+"\n";s=t.length+":"+_hashCss(o)}catch(t){}t+=(e.href||"inline")+"~"+s+"|"}if(ADOPTED&&t===ADOPTED_KEY)return ADOPTED;ADOPTED_KEY=t,ADOPTED=[];const e=(t,s)=>{let o;try{o=t.cssRules}catch(t){return}if(o)for(const t of o)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 o=new CSSStyleSheet;s.length&&o.replaceSync(s.join("\n")),ADOPTED.push(o)}}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 o=t.querySelector("#"+CSS.escape(s))||document.getElementById(s);o&&!o.hasAttribute("aria-labelledby")&&(e.id||(e.id=contourId("tab")),o.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 o=e.querySelector(".c-field__error");if(o){o.id||(o.id=contourId("err"));const e=t.getAttribute("aria-describedby")||"";t.setAttribute("aria-describedby",(e+" "+o.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",o=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",o),t.dataset.contourAutoLive=o)}),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,o=[];if(e)for(const t of e.assignedElements({flatten:!0}))t.matches("input, textarea, select")&&o.push(t);if(!o.length&&s){const t=s.querySelector('slot[name="input"]');if(t)for(const e of t.assignedElements({flatten:!0}))e.matches("input, textarea, select")&&o.push(e)}for(const e of o){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"),o=s.querySelector(".c-field__error"),a=[];t&&(t.id||(t.id=contourId("hint")),a.push(t.id)),o&&(o.id||(o.id=contourId("err")),a.push(o.id)),a.length&&e.setAttribute("aria-describedby",a.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,o)=>{const a=t.querySelector(e);a&&a.setAttribute("aria-label",labelText(this,s,o))};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",o=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",o),t.dataset.contourAutoLive=o)}}}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 o=class extends ContourShadow{};o.contourTemplate=s,define(t,o)},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 o=e.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(o)try{o.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 o of e.querySelectorAll("slot"))for(const e of o.assignedElements({flatten:!0})){e.matches(t)&&s.push(e);for(const o of e.querySelectorAll(t))s.push(o)}return s},o=()=>this.shadowRoot&&this.shadowRoot.activeElement||document.activeElement;e.addEventListener("keydown",t=>{if("Tab"!==t.key)return;const e=s();if(!e.length)return;const a=e[0],i=e[e.length-1];t.shiftKey&&o()===a?(t.preventDefault(),i.focus()):t.shiftKey||o()!==i||(t.preventDefault(),a.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 o=SHADOW_MARKUP[t];if("string"!=typeof o)return null;return`<${t}${e?e.startsWith(" ")?e:" "+e:""}><template shadowrootmode="open">${o}</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};function overlayIsModal(t){return"inline"!==t.getAttribute("mode")}const overlayStack=[];function overlayPush(t){const e=overlayStack.indexOf(t);e>=0&&overlayStack.splice(e,1),overlayStack.push(t)}function overlayPop(t){const e=overlayStack.indexOf(t);e>=0&&overlayStack.splice(e,1)}function overlayIsTop(t){return overlayStack[overlayStack.length-1]===t}function overlayHandleEscape(t,e){return"Escape"===e.key&&(!overlayIsTop(t)||(e.stopPropagation(),t.close(),!0))}function engageInitialModal(t){if(!t.hasAttribute("open")||t._modalEngaged)return;t._modalEngaged=!0,t._overlayOpen=!0,overlayPush(t),t.classList.add("is-open"),overlayIsModal(t)&&(t.setAttribute("aria-modal","true"),modalContain(t,!0));const e=t.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(e)try{e.focus()}catch(t){}}function syncDeclarativeOpen(t,e,s,o){if("open"===e&&o&&!t._declarativeOpen){t._declarativeOpen=!0;try{null===s||t._overlayOpen?null===s&&t._overlayOpen&&t.close():(t.removeAttribute("open"),t.show())}finally{t._declarativeOpen=!1}}}class ContourDialog extends ContourBase{static get observed(){return["title","size","heading","open"]}static get properties(){return{title:{attribute:"title"},size:{attribute:"size"}}}attributeChangedCallback(t,e,s){"open"!==t?super.attributeChangedCallback(t,e,s):syncDeclarativeOpen(this,t,s,this._wiredDialog)}showModal(){this.show()}get open(){return this.hasAttribute("open")}set open(t){t?this.show():this.close()}render(){this.classList.add("c-dialog"),Array.from(this.classList).forEach(t=>{t.startsWith("c-dialog--")&&this.classList.remove(t)});const t=this.getAttribute("size");t&&this.classList.add("c-dialog--"+t),this.hasAttribute("role")||this.setAttribute("role","dialog");const e=this.getAttribute("title");let s=this.querySelector(".c-dialog__head");if(e){if(!s){s=document.createElement("div"),s.className="c-dialog__head";const t=document.createElement(headingTag(this,"h2"));t.className="c-dialog__title",s.appendChild(t);const e=document.createElement("button");e.className="c-btn c-btn--icon c-btn--ghost c-dialog__close",e.setAttribute("type","button"),e.setAttribute("aria-label",labelText(this,"close","Close")),setHTML(e,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-x" /></svg>'),s.appendChild(e)}const t=s.querySelector(".c-dialog__title");t&&(t.textContent=e,t.id||(t.id=contourId("contour-dialog-title")),this.setAttribute("aria-labelledby",t.id))}s&&s.parentNode!==this&&this.prepend(s);const o=this.ensure(".c-dialog__body",()=>{const t=document.createElement("div");return t.className="c-dialog__body",t});Array.from(this.childNodes).forEach(t=>{t!==o&&t!==s&&(1===t.nodeType&&t.classList&&t.classList.contains("c-dialog__head")||o.appendChild(t))}),s&&s.parentNode===this?(o.parentNode!==this||s.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING)&&this.insertBefore(o,s.nextSibling):o.parentNode!==this&&this.appendChild(o)}enhance(){this._wiredDialog||(this._wiredDialog=!0,this.returnValue="",this._ensureScrim=()=>{if(this._overlayScrim||this.querySelector("dialog")||"DIALOG"===this.tagName)return;const t=document.createElement("div");t.className="c-scrim is-open",t.setAttribute("data-contour-overlay-scrim",""),t.addEventListener("click",()=>this.close()),document.body.appendChild(t),this._overlayScrim=t},this._removeScrim=()=>{this._overlayScrim&&(this._overlayScrim.remove(),this._overlayScrim=null)},onDispose(this,()=>{this.hasAttribute("open")&&modalContain(this,!1),overlayPop(this),this._removeScrim()}),this.show=()=>{if(this.hasAttribute("open"))return;this._overlayOpen=!0,overlayPush(this),this._dialogLastFocus=document.activeElement,this._declarativeOpen=!0;try{this.setAttribute("open","")}finally{this._declarativeOpen=!1}this.setAttribute("aria-modal","true");const t=this.querySelector("dialog")||("DIALOG"===this.tagName?this:null);if(t&&"function"==typeof t.showModal)try{t.showModal()}catch(t){}modalContain(this,!0),this._ensureScrim();const e=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(e)try{e.focus()}catch(t){}this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}))},this.close=()=>{const t=this.hasAttribute("open")||this.hasAttribute("aria-modal")||this._overlayOpen;this._overlayOpen=!1,overlayPop(this);const e=this.querySelector("dialog")||("DIALOG"===this.tagName?this:null);e&&"function"==typeof e.close&&e.close(),this._declarativeOpen=!0;try{this.hasAttribute("open")&&this.removeAttribute("open")}finally{this._declarativeOpen=!1}if(this.removeAttribute("aria-modal"),this._removeScrim(),t){modalContain(this,!1),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}));const t=this._dialogLastFocus;if(t&&"function"==typeof t.focus)try{t.focus()}catch(t){}}},this.focus=()=>{const t=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(t)try{t.focus()}catch(t){}else try{HTMLElement.prototype.focus.call(this)}catch(t){}},this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-dialog__close"):null;(e&&this.contains(e)||t.target===this)&&this.close()}),this.addEventListener("keydown",t=>{"Escape"===t.key&&this.hasAttribute("open")&&overlayHandleEscape(this,t)}),engageInitialModal(this))}}define("contour-dialog",ContourDialog);class ContourAlert extends ContourBase{static get observed(){return["title","body","variant","icon","closable","action","actions","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{title:{attribute:"title"},body:{attribute:"body"},variant:{attribute:"variant"},icon:{attribute:"icon"},closable:{attribute:"closable",type:Boolean},action:{attribute:"action"},actions:{attribute:"actions"}}}render(){this.classList.add("c-alert");const t=/^(warning|danger)$/.test(this.getAttribute("variant")||""),e=t?"alert":"status",s=t?"assertive":"polite";if(this.hasAttribute("role")&&this.getAttribute("role")!==this._autoRole||(this.setAttribute("role",e),this._autoRole=e),this.hasAttribute("aria-live")&&this.getAttribute("aria-live")!==this._autoLive||(this.setAttribute("aria-live",s),this._autoLive=s),wireStates(this),loadRemote(this,"title"),renderStates(this,"alert"))return;const o=this.getAttribute("variant");Array.from(this.classList).forEach(t=>{t.startsWith("c-alert--")&&this.classList.remove(t)}),o&&this.classList.add("c-alert--"+o);const a=this.getAttribute("icon"),i="none"===a?"":a||statusIcon(o);if(i){const t=this.ensure(".c-alert__icon",()=>{const t=document.createElement("span");return t.className="c-alert__icon",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(i).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>')}else{const t=this.querySelector(".c-alert__icon");t&&t.remove()}const r=this.getAttribute("title")||this._remoteData&&this._remoteData.title;if(r){const t=this.ensure(".c-alert__title",()=>{const t=document.createElement("div");return t.className="c-alert__title",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),t.textContent=r}else{const t=this.querySelector(".c-alert__title");t&&t.remove()}const n=this.getAttribute("body"),c=Array.from(this.childNodes).filter(t=>(1!==t.nodeType||!t.classList||!(t.classList.contains("c-alert__icon")||t.classList.contains("c-alert__title")||t.classList.contains("c-alert__body")||t.classList.contains("c-alert__action")||t.classList.contains("c-alert__close")))&&!(3===t.nodeType&&!t.textContent.trim()));if(n)for(const t of c)3===t.nodeType&&t.parentNode===this&&t.remove();if(c.length&&!n){const t=this.ensure(".c-alert__body",()=>{const t=document.createElement("div");return t.className="c-alert__body",t});t.textContent="";for(const e of c)t.appendChild(e)}else if(n){this.ensure(".c-alert__body",()=>{const t=document.createElement("div");return t.className="c-alert__body",t}).textContent=n}else{const t=this.querySelector(".c-alert__body");t&&t.remove()}Array.from(this.querySelectorAll(".c-alert__action")).forEach(t=>t.remove());const l=this.getAttribute("actions");let d=[];if(l)try{const t=JSON.parse(l);Array.isArray(t)&&(d=t.map(t=>String(t)))}catch(t){d=[l]}else{const t=this.getAttribute("action");t&&(d=[t])}if(d.forEach(t=>{const e=document.createElement("button");e.className="c-btn c-btn--sm c-alert__action",e.type="button",e.setAttribute("data-alert-action",""),e.textContent=t,this.appendChild(e)}),flagOn(this,"closable"))this.ensure(".c-alert__close",()=>{const t=document.createElement("button");return t.className="c-alert__close",t.type="button",t.setAttribute("aria-label",labelText(this,"close","Close")),t.textContent="×",t});else{const t=this.querySelector(".c-alert__close");t&&t.remove()}r||n||i||c.length||renderEmpty(this,"alert")}}ContourAlert.prototype.enhance=function(){if(this._wiredAlert)return;this._wiredAlert=!0,this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-alert__action"):null;if(e&&this.contains(e))return t.preventDefault(),void this.dispatchEvent(new CustomEvent("contour:action",{bubbles:!0,composed:!0,detail:{label:e.textContent.trim()}}));const s=t.target&&t.target.closest?t.target.closest(".c-alert__close"):null;s&&this.contains(s)&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),this.remove())});let t=null;const e=e=>{if(!t)return;const s=e.clientX-t.x;t.dx=s,!t.active&&Math.abs(s)>8&&(t.active=!0,this.classList.add("is-swiping")),t.active&&(this.style.transform="translateX("+s+"px)")},s=()=>{if(window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),!t)return;const{dx:o,active:a}=t;t=null,this.classList.remove("is-swiping"),this.style.removeProperty("transform"),a&&Math.abs(o)>80&&(this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),this.remove())};this.addEventListener("pointerdown",o=>{flagOn(this,"closable")&&("mouse"===o.pointerType&&0!==o.button||(t={x:o.clientX,dx:0,active:!1},window.addEventListener("pointermove",e),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s)))}),onDispose(this,()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)})},define("contour-alert",ContourAlert);class ContourDisclosure extends ContourBase{static get observed(){return["summary","icon"]}static get properties(){return{summary:{attribute:"summary"},icon:{attribute:"icon"}}}disconnectedCallback(){this._disclosureContent=null,super.disconnectedCallback()}connectedCallback(){this.innerHTML.trim()&&!this._disclosureContent&&(this._disclosureContent=this.innerHTML),super.connectedCallback()}attributeChangedCallback(t,e,s){const o=this.querySelector("details");if(o){const t=o.querySelector(".c-disclosure__body");t&&(this._disclosureContent=t.innerHTML)}else this.innerHTML.trim()&&(this._disclosureContent=this.innerHTML);super.attributeChangedCallback(t,e,s)}render(){this.classList.add("c-disclosure");const t=this.getAttribute("summary"),e=this.getAttribute("icon");if(t){let s=this.innerHTML.trim()?this.innerHTML:this._disclosureContent||"";s.trim()&&(this._disclosureContent=s);const o=this.ensure("details",()=>{const o=document.createElement("details"),a=document.createElement("summary");if(a.className="c-disclosure__summary",e){const t=document.createElement("span");t.className="c-disclosure__icon",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(e).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>'),a.appendChild(t)}a.appendChild(document.createTextNode(t)),o.appendChild(a);const i=document.createElement("div");return i.className="c-disclosure__body",setHTML(i,s),o.appendChild(i),o}),a=o.querySelector("summary");if(a){const s=a.querySelector(".c-disclosure__icon");if(e&&!s){const t=document.createElement("span");t.className="c-disclosure__icon",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(e).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>'),a.insertBefore(t,a.firstChild)}else!e&&s&&s.remove();Array.from(a.childNodes).filter(t=>3===t.nodeType).forEach(t=>t.remove()),a.appendChild(document.createTextNode(t))}const i=o.querySelector(".c-disclosure__body");i&&setHTML(i,s),o.parentNode!==this&&(setHTML(this,""),this.appendChild(o))}else{const t=this.querySelector("details");t&&t.remove()}}enhance(){this._wiredDisclosure||(this._wiredDisclosure=!0,this.addEventListener("toggle",t=>{const e=t.target;e&&"DETAILS"===e.tagName&&this.dispatchEvent(new CustomEvent("contour:toggle",{detail:{open:e.open},bubbles:!0,composed:!0}))},!0))}}define("contour-disclosure",ContourDisclosure);class ContourCallout extends ContourBase{static get observed(){return["variant","title","icon","closable"]}static get properties(){return{variant:{attribute:"variant"},title:{attribute:"title"},icon:{attribute:"icon"},closable:{attribute:"closable",type:Boolean}}}render(){this.classList.add("c-callout"),this.hasAttribute("role")||this.setAttribute("role","note"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("title")||"Callout"),Array.from(this.classList).forEach(t=>{t.startsWith("c-callout--")&&this.classList.remove(t)});const t=this.getAttribute("variant");t&&this.classList.add("c-callout--"+t);const e=this.getAttribute("icon"),s="none"===e?"":e||statusIcon(t);if(s){const t=this.ensure(".c-callout__icon",()=>{const t=document.createElement("span");return t.className="c-callout__icon",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(s).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>')}else{const t=this.querySelector(".c-callout__icon");t&&t.remove()}const o=this.getAttribute("title");if(o){const t=this.ensure(".c-callout__title",()=>{const t=document.createElement("div");return t.className="c-callout__title",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),t.textContent=o}else{const t=this.querySelector(".c-callout__title");t&&t.remove()}if(flagOn(this,"closable"))this.ensure(".c-callout__close",()=>{const t=document.createElement("button");return t.className="c-callout__close",t.type="button",t.setAttribute("aria-label",labelText(this,"close","Close")),t.textContent="×",t});else{const t=this.querySelector(".c-callout__close");t&&t.remove()}}}ContourCallout.prototype.enhance=function(){this._wiredCallout||(this._wiredCallout=!0,this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-callout__close"):null;e&&this.contains(e)&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),this.remove())}))},define("contour-callout",ContourCallout);const EMPTY_STATE_COPY={empty:{title:"No data yet",body:"There is nothing to show here yet.",action:""},filtered:{title:"Nothing matches",body:"Try clearing some filters.",action:"Clear filters"},selection:{title:"No selection",body:"Select one or more items to see details.",action:""},viewport:{title:"Nothing in view",body:"Pan or zoom to an area with data.",action:""},"saved-view":{title:"No saved view",body:"Save this view to return to it later.",action:""},permission:{title:"No access",body:"You do not have permission to see this.",action:""},setup:{title:"Not set up yet",body:"Finish setup to see data here.",action:""},error:{title:"Could not load",body:"Check your connection and try again.",action:"Retry"}};class ContourEmpty extends ContourBase{static get observed(){return["state","title","body","action","icon","illustration","heading"]}static get properties(){return{state:{attribute:"state"},title:{attribute:"title"},body:{attribute:"body"},action:{attribute:"action"},icon:{attribute:"icon"},illustration:{attribute:"illustration"}}}render(){this.classList.add("c-empty"),this.hasAttribute("role")||this.setAttribute("role","status");const t=this.getAttribute("state")||"empty",e=EMPTY_STATE_COPY[t]||EMPTY_STATE_COPY.empty,s=this.getAttribute("title")||e.title,o=this.getAttribute("body")||e.body,a=this.getAttribute("action")||e.action,i=this.getAttribute("illustration"),r=this.getAttribute("icon")||(i?"":"i-mark");if(r){const t=this.ensure(".c-empty__icon",()=>{const t=document.createElement("span");return t.className="c-empty__icon",t});setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(r).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>')}else{const t=this.querySelector(".c-empty__icon");t&&t.remove()}if(i){const t=this.ensure(".c-empty__illustration",()=>{const t=document.createElement("div");return t.className="c-empty__illustration",t});setHTML(t,sanitizeHtml(i))}else{const t=this.querySelector(".c-empty__illustration");t&&t.remove()}if(s){this.ensure(".c-empty__title",()=>{const t=document.createElement(headingTag(this,"h3"));return t.className="c-empty__title",t}).textContent=s}else{const t=this.querySelector(".c-empty__title");t&&t.remove()}if(o){this.ensure(".c-empty__text",()=>{const t=document.createElement("p");return t.className="c-empty__text",t}).textContent=o}else{const t=this.querySelector(".c-empty__text");t&&t.remove()}if(a){this.ensure("button.c-btn[data-empty-action]",()=>{const t=document.createElement("button");return t.className="c-btn c-btn--primary",t.type="button",t.setAttribute("data-empty-action",""),t}).textContent=a}else{const t=this.querySelector("[data-empty-action]");t&&t.remove()}}enhance(){wireRemovable(this)}}define("contour-empty",ContourEmpty);class ContourFaq extends ContourBase{static get observed(){return["question","answer","items","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{question:{attribute:"question"},answer:{attribute:"answer"},items:{attribute:"items"},src:{attribute:"src"}}}render(){if(this.classList.add("c-faq"),wireStates(this),loadRemote(this,"items"),renderStates(this,"faq"))return;const t=remoteData(this,"items"),e=this.getAttribute("question"),s=this.getAttribute("answer"),o=Array.from(this.children).filter(t=>t.classList&&t.classList.contains("c-faq__item"));if(t&&!o.length)try{const e=JSON.parse(t);Array.from(this.querySelectorAll(".c-faq__item")).forEach(t=>t.remove()),e.forEach((t,e)=>{const s=document.createElement("details");s.className="c-faq__item",0===e&&s.setAttribute("open","");const o=document.createElement("summary");o.className="c-faq__question",o.textContent="string"==typeof t?t:t.question||t.q||"";const a=document.createElement("span");a.className="c-faq__sign",a.setAttribute("aria-hidden","true"),setHTML(a,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-plus" /></svg>'),o.appendChild(a),s.appendChild(o);const i=document.createElement("div");i.className="c-faq__answer",i.textContent="string"==typeof t?"":t.answer||t.a||"",s.appendChild(i),this.appendChild(s)})}catch(t){warnBadJson(this,"attribute",t)}else if(!t)if(e||s){const t=this.ensure("details.c-faq__item",()=>{const t=document.createElement("details");return t.className="c-faq__item",t});t.hasAttribute("open")||t.setAttribute("open","");const o=this.ensure("summary.c-faq__question",()=>{const t=document.createElement("summary");return t.className="c-faq__question",t},t);o.textContent=e||"";const a=this.ensure(".c-faq__sign",()=>{const t=document.createElement("span");return t.className="c-faq__sign",t},o);a.setAttribute("aria-hidden","true"),setHTML(a,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-plus" /></svg>');this.ensure(".c-faq__answer",()=>{const t=document.createElement("div");return t.className="c-faq__answer",t},t).textContent=s||""}else renderEmpty(this,"faq")}}define("contour-faq",ContourFaq);class ContourAccordion extends ContourBase{static get observed(){return["items","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","persist","exclusive","cache-key","no-cache"]}static get properties(){return{items:{attribute:"items"},exclusive:{attribute:"exclusive",type:Boolean},src:{attribute:"src"}}}render(){this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",labelText(this,"accordion","Accordion"));const t=Array.from(this.children).filter(t=>"DETAILS"===t.tagName);if(wireStates(this),loadRemote(this,"items"),renderStates(this,"accordion"))return;const e=remoteData(this,"items");if(e&&!t.length){Array.from(this.querySelectorAll("details.c-disclosure")).forEach(t=>t.remove());try{JSON.parse(e).forEach(t=>{const e=document.createElement("details");e.className="c-disclosure";const s=document.createElement("summary");s.className="c-disclosure__summary",s.textContent=t.title||t.question||t.q||t.label||"",e.appendChild(s);const o=document.createElement("div");o.className="c-disclosure__body",o.textContent=t.body||t.answer||t.a||t.content||"",e.appendChild(o),this.appendChild(e)})}catch(t){warnBadJson(this,"attribute",t)}}else e||t.length||renderEmpty(this,"accordion");const s=this.getAttribute("persist");if(s){let t=null;if("storage"===s&&this.id)try{t=localStorage.getItem("contour-accordion:"+this.id)}catch(t){}else if("url"===s)try{t=new URLSearchParams(window.location.search).get("c-accordion")}catch(t){}if(null!==t)try{const e=JSON.parse(t);if(Array.isArray(e)){const t=new Set(e.map(t=>String(t)));Array.from(this.querySelectorAll("details.c-disclosure")).forEach(e=>{const s=e.querySelector("summary"),o=(s?s.textContent:"").trim().slice(0,120);t.has(o)&&(e.open=!0)})}}catch(t){}}}enhance(){this._wiredAccordion||(this._wiredAccordion=!0,this.addEventListener("toggle",t=>{const e=t.target;if(e&&"DETAILS"===e.tagName){e.open&&this.hasAttribute("exclusive")&&Array.from(this.querySelectorAll("details.c-disclosure")).forEach(t=>{t!==e&&(t.open=!1)}),this.dispatchEvent(new CustomEvent("contour:toggle",{detail:{open:e.open},bubbles:!0,composed:!0}));const s=this.getAttribute("persist");if("storage"===s&&this.id)try{const t=[];Array.from(this.querySelectorAll("details.c-disclosure")).forEach(e=>{if(e.open){const s=e.querySelector("summary");t.push((s?s.textContent:"").trim().slice(0,120))}}),localStorage.setItem("contour-accordion:"+this.id,JSON.stringify(t))}catch(t){}else if("url"===s)try{const t=[];Array.from(this.querySelectorAll("details.c-disclosure")).forEach(e=>{if(e.open){const s=e.querySelector("summary");t.push((s?s.textContent:"").trim().slice(0,120))}});const e=new URL(window.location.href);e.searchParams.set("c-accordion",JSON.stringify(t)),window.history.replaceState(null,"",e.toString())}catch(t){}}},!0))}}define("contour-accordion",ContourAccordion);class ContourDrawer extends ContourBase{static get observed(){return["title","body","size","open","mode"]}static get properties(){return{title:{attribute:"title"},body:{attribute:"body"},size:{attribute:"size"},mode:{attribute:"mode"}}}attributeChangedCallback(t,e,s){"open"!==t?super.attributeChangedCallback(t,e,s):syncDeclarativeOpen(this,t,s,this._wiredDrawer)}showModal(){this.show()}get open(){return this.hasAttribute("open")}set open(t){t?this.show():this.close()}render(){this.classList.add("c-drawer"),Array.from(this.classList).forEach(t=>{t.startsWith("c-drawer--")&&this.classList.remove(t)});const t=this.getAttribute("size");t&&this.classList.add("c-drawer--"+t),this.hasAttribute("role")||this.setAttribute("role","dialog");const e=this.getAttribute("title");let s=this.querySelector(".c-drawer__head");if(e){if(!s){s=document.createElement("div"),s.className="c-drawer__head";const t=document.createElement("div");t.className="c-drawer__title",s.appendChild(t);const e=document.createElement("button");e.className="c-btn c-btn--icon c-btn--ghost c-drawer__close",e.setAttribute("type","button"),e.setAttribute("aria-label",labelText(this,"close","Close")),setHTML(e,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-x" /></svg>'),s.appendChild(e)}const t=s.querySelector(".c-drawer__title");t&&(t.textContent=e,t.id||(t.id=contourId("contour-drawer-title")),this.setAttribute("aria-labelledby",t.id)),s.parentNode!==this&&this.prepend(s)}else if(s){const t=s.querySelector(".c-drawer__title");t&&t.id&&this.getAttribute("aria-labelledby")===t.id&&this.removeAttribute("aria-labelledby"),s.remove()}this.hasAttribute("open")?this.classList.add("is-open"):this.classList.remove("is-open");const o=this.getAttribute("body"),a=Array.from(this.childNodes).filter(t=>(1!==t.nodeType||!t.classList||!t.classList.contains("c-drawer__head")&&!t.classList.contains("c-drawer__body"))&&!(3===t.nodeType&&!t.textContent.trim()));if(a.length){const t=this.ensure(".c-drawer__body",()=>{const t=document.createElement("div");return t.className="c-drawer__body",t});for(const e of a)t.appendChild(e)}else if(o){const t=this.ensure(".c-drawer__body",()=>{const t=document.createElement("div");return t.className="c-drawer__body",t});setHTML(t,sanitizeHtml(o))}else{const t=this.querySelector(".c-drawer__body");t&&t.remove()}}enhance(){if(this._wiredDrawer)return;this._wiredDrawer=!0,this.returnValue="",onDispose(this,()=>{this.hasAttribute("open")&&modalContain(this,!1)}),this._drawerLastFocus=null,this._ensureScrim=()=>{if(this._overlayScrim)return;const t=document.createElement("div");t.className="c-scrim is-open",t.setAttribute("data-contour-overlay-scrim",""),t.addEventListener("click",()=>this.close()),document.body.appendChild(t),this._overlayScrim=t},this._removeScrim=()=>{this._overlayScrim&&(this._overlayScrim.remove(),this._overlayScrim=null)},onDispose(this,()=>{(this.hasAttribute("open")||this._overlayOpen)&&modalContain(this,!1),overlayPop(this),this._removeScrim()}),this.show=()=>{if(this.hasAttribute("open"))return;this._overlayOpen=!0,overlayPush(this),this._drawerLastFocus=document.activeElement,this._declarativeOpen=!0;try{this.setAttribute("open","")}finally{this._declarativeOpen=!1}this.classList.add("is-open"),overlayIsModal(this)?(this.setAttribute("aria-modal","true"),modalContain(this,!0),this._ensureScrim()):this.removeAttribute("aria-modal");const t=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(t)try{t.focus()}catch(t){}this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}))},this.close=()=>{if(!this.hasAttribute("open")&&!this._overlayOpen)return;this._overlayOpen=!1,overlayPop(this),this._declarativeOpen=!0;try{this.removeAttribute("open")}finally{this._declarativeOpen=!1}this.classList.remove("is-open"),overlayIsModal(this)&&(this.removeAttribute("aria-modal"),modalContain(this,!1)),this._removeScrim(),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}));const t=this._drawerLastFocus;if(t&&"function"==typeof t.focus)try{t.focus()}catch(t){}},this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-drawer__close"):null;(e&&this.contains(e)||t.target===this)&&this.close()}),this.addEventListener("keydown",t=>{"Escape"===t.key&&this.hasAttribute("open")&&overlayHandleEscape(this,t)});let t=0,e=0;this.addEventListener("touchstart",s=>{if(!this.hasAttribute("open"))return;const o=s.touches&&s.touches[0];o&&(t=o.clientX,e=o.clientY)},{passive:!0}),this.addEventListener("touchend",s=>{if(!this.hasAttribute("open"))return;const o=s.changedTouches&&s.changedTouches[0];if(!o)return;const a=o.clientX-t,i=o.clientY-e;Math.abs(a)>60&&Math.abs(a)>1.5*Math.abs(i)&&this.close()},{passive:!0}),engageInitialModal(this)}}define("contour-drawer",ContourDrawer);class ContourSheet extends ContourBase{static get observed(){return["title","body","size","open","mode"]}static get properties(){return{title:{attribute:"title"},body:{attribute:"body"},size:{attribute:"size"},mode:{attribute:"mode"}}}attributeChangedCallback(t,e,s){"open"!==t?super.attributeChangedCallback(t,e,s):syncDeclarativeOpen(this,t,s,this._wiredSheet)}showModal(){this.show()}get open(){return this.hasAttribute("open")}set open(t){t?this.show():this.close()}render(){this.classList.add("c-sheet"),Array.from(this.classList).forEach(t=>{t.startsWith("c-sheet--")&&this.classList.remove(t)});const t=this.getAttribute("size");t&&this.classList.add("c-sheet--"+t),this.hasAttribute("role")||this.setAttribute("role","dialog");const e=this.getAttribute("title");let s=this.querySelector(".c-sheet__head");if(e){if(!s){s=document.createElement("div"),s.className="c-sheet__head";const t=document.createElement("div");t.className="c-sheet__title",s.appendChild(t);const e=document.createElement("button");e.className="c-btn c-btn--icon c-btn--ghost c-sheet__close",e.setAttribute("type","button"),e.setAttribute("aria-label",labelText(this,"close","Close")),setHTML(e,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-x" /></svg>'),s.appendChild(e)}const t=s.querySelector(".c-sheet__title");t&&(t.textContent=e,t.id||(t.id=contourId("contour-sheet-title")),this.setAttribute("aria-labelledby",t.id)),s.parentNode!==this&&this.prepend(s)}else if(s){const t=s.querySelector(".c-sheet__title");t&&t.id&&this.getAttribute("aria-labelledby")===t.id&&this.removeAttribute("aria-labelledby"),s.remove()}this.hasAttribute("open")?this.classList.add("is-open"):this.classList.remove("is-open");const o=this.getAttribute("body"),a=Array.from(this.childNodes).filter(t=>(1!==t.nodeType||!t.classList||!t.classList.contains("c-sheet__head")&&!t.classList.contains("c-sheet__body"))&&!(3===t.nodeType&&!t.textContent.trim()));if(a.length){const t=this.ensure(".c-sheet__body",()=>{const t=document.createElement("div");return t.className="c-sheet__body",t});for(const e of a)t.appendChild(e)}else if(o){const t=this.ensure(".c-sheet__body",()=>{const t=document.createElement("div");return t.className="c-sheet__body",t});setHTML(t,sanitizeHtml(o))}else{const t=this.querySelector(".c-sheet__body");t&&t.remove()}}enhance(){if(this._wiredSheet)return;this._wiredSheet=!0,this.returnValue="",onDispose(this,()=>{this.hasAttribute("open")&&modalContain(this,!1)}),this._sheetLastFocus=null,this._ensureScrim=()=>{if(this._overlayScrim)return;const t=document.createElement("div");t.className="c-scrim is-open",t.setAttribute("data-contour-overlay-scrim",""),t.addEventListener("click",()=>this.close()),document.body.appendChild(t),this._overlayScrim=t},this._removeScrim=()=>{this._overlayScrim&&(this._overlayScrim.remove(),this._overlayScrim=null)},onDispose(this,()=>{(this.hasAttribute("open")||this._overlayOpen)&&modalContain(this,!1),overlayPop(this),this._removeScrim()}),this.show=()=>{if(this.hasAttribute("open"))return;this._overlayOpen=!0,overlayPush(this),this._sheetLastFocus=document.activeElement,this._declarativeOpen=!0;try{this.setAttribute("open","")}finally{this._declarativeOpen=!1}this.classList.add("is-open"),overlayIsModal(this)?(this.setAttribute("aria-modal","true"),modalContain(this,!0),this._ensureScrim()):this.removeAttribute("aria-modal");const t=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(t)try{t.focus()}catch(t){}this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}))},this.close=()=>{if(!this.hasAttribute("open")&&!this._overlayOpen)return;this._overlayOpen=!1,overlayPop(this),this._declarativeOpen=!0;try{this.removeAttribute("open")}finally{this._declarativeOpen=!1}this.classList.remove("is-open"),overlayIsModal(this)&&(this.removeAttribute("aria-modal"),modalContain(this,!1)),this._removeScrim(),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}));const t=this._sheetLastFocus;if(t&&"function"==typeof t.focus)try{t.focus()}catch(t){}},this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-sheet__close"):null;(e&&this.contains(e)||t.target===this)&&this.close()}),this.addEventListener("keydown",t=>{"Escape"===t.key&&this.hasAttribute("open")&&overlayHandleEscape(this,t)});let t=0,e=0;this.addEventListener("touchstart",s=>{if(!this.hasAttribute("open"))return;const o=s.touches&&s.touches[0];o&&(e=o.clientX,t=o.clientY)},{passive:!0}),this.addEventListener("touchend",s=>{if(!this.hasAttribute("open"))return;const o=s.changedTouches&&s.changedTouches[0];if(!o)return;const a=o.clientY-t,i=o.clientX-e;a>60&&Math.abs(a)>1.5*Math.abs(i)&&this.close()},{passive:!0}),engageInitialModal(this)}}define("contour-sheet",ContourSheet);class ContourToast extends ContourBase{static get observed(){return["message","variant","duration","action","icon"]}static get properties(){return{message:{attribute:"message"},variant:{attribute:"variant"},duration:{attribute:"duration",type:Number},action:{attribute:"action"}}}render(){this.classList.add("c-toast"),this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("aria-live")||this.setAttribute("aria-live","polite"),this.hasAttribute("aria-atomic")||this.setAttribute("aria-atomic","true");const t=this.getAttribute("message");t&&!this.hasChildNodes()&&(this.textContent=t);const e=this.getAttribute("variant");Array.from(this.classList).forEach(t=>{t.startsWith("c-toast--")&&this.classList.remove(t)}),e&&this.classList.add("c-toast--"+e);const s=this.getAttribute("icon"),o="none"===s?"":s||statusIcon(e);let a=this.querySelector(".c-toast__icon");o?(a||(a=document.createElement("span"),a.className="c-toast__icon"),setHTML(a,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(o).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>'),this.firstChild!==a&&this.prepend(a)):a&&a.remove();const i=this.getAttribute("action");let r=this.querySelector(".c-toast__action");i?(r||(r=document.createElement("button"),r.className="c-toast__action",r.type="button",this.appendChild(r)),r.textContent=i):r&&r.remove();let n=this.querySelector(".c-toast__close");n||(n=document.createElement("button"),n.className="c-toast__close",n.type="button",n.setAttribute("aria-label",labelText(this,"close","Close")),n.textContent="×",this.appendChild(n));let c=this.querySelector(".c-toast__progress");this._durationMs()>0?c||(c=document.createElement("span"),c.className="c-toast__progress",c.setAttribute("aria-hidden","true"),this.appendChild(c)):c&&c.remove()}enhance(){if(this._wiredToast)return;this._wiredToast=!0,this.addEventListener("click",t=>{if(t.target&&t.target.closest?t.target.closest(".c-toast__close"):null)return t.preventDefault(),void this._dismiss();(t.target&&t.target.closest?t.target.closest(".c-toast__action"):null)&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:toast-action",{bubbles:!0,composed:!0,detail:{action:this.getAttribute("action")}})),this._dismiss())});const t=()=>{clearTimeout(this._toastTimer),this._toastTimer=null};this.addEventListener("mouseenter",t),this.addEventListener("focusin",t),this.addEventListener("mouseleave",()=>this._arm()),this.addEventListener("focusout",()=>this._arm());let e=null;const s=s=>{if(!e)return;const o=s.clientX-e.x;e.dx=o,!e.active&&Math.abs(o)>8&&(e.active=!0,this.classList.add("is-swiping"),t()),e.active&&(this.style.transform="translateX("+o+"px)")},o=()=>{if(window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o),!e)return;const{dx:t,active:a}=e;e=null,this.classList.remove("is-swiping"),this.style.removeProperty("transform"),a&&Math.abs(t)>80?this._dismiss():this._arm()};this.addEventListener("pointerdown",t=>{"mouse"===t.pointerType&&0!==t.button||(e={x:t.clientX,dx:0,active:!1},window.addEventListener("pointermove",s),window.addEventListener("pointerup",o),window.addEventListener("pointercancel",o))}),onDispose(this,()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o)}),this._arm(),onDispose(this,()=>clearTimeout(this._toastTimer))}_durationMs(){const t=null!=this._toastDuration?Number(this._toastDuration):Number(this.duration);return 0===t?0:t>0?t:4e3}_arm(){clearTimeout(this._toastTimer),this._toastTimer=null;const t=this._durationMs();t>0?this.style.setProperty("--toast-ms",t+"ms"):this.style.removeProperty("--toast-ms"),t>0&&(this._toastTimer=setTimeout(()=>this._dismiss(),t))}_dismiss(){clearTimeout(this._toastTimer),this._toastTimer=null,this.setAttribute("hidden",""),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}))}show(t,e){const s=null!=t?String(t):this.getAttribute("message"),o=e&&e.variant||this.getAttribute("variant"),a=e&&e.action||this.getAttribute("action");s&&!this.hasChildNodes()&&(this.textContent=s),Array.from(this.classList).forEach(t=>{t.startsWith("c-toast--")&&this.classList.remove(t)}),o&&this.classList.add("c-toast--"+o);let i=this.querySelector(".c-toast__action");a?(i||(i=document.createElement("button"),i.className="c-toast__action",i.type="button",this.appendChild(i)),i.textContent=a):i&&i.remove(),e&&null!=e.duration&&(this._toastDuration=Number(e.duration)),this.removeAttribute("hidden"),this._arm()}}define("contour-toast",ContourToast);class ContourExpandable extends ContourBase{static get observed(){return["summary"]}static get properties(){return{summary:{attribute:"summary"}}}disconnectedCallback(){this._expandableContent=null,super.disconnectedCallback()}connectedCallback(){this.innerHTML.trim()&&!this._expandableContent&&(this._expandableContent=this.innerHTML),super.connectedCallback()}attributeChangedCallback(t,e,s){const o=this.querySelector("details");if(o){const t=o.querySelector(".c-expandable__body");t&&(this._expandableContent=t.innerHTML)}else this.innerHTML.trim()&&(this._expandableContent=this.innerHTML);super.attributeChangedCallback(t,e,s)}render(){this.classList.add("c-expandable"),this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("summary")||"Expandable");const t=this.getAttribute("summary");if(t){let e=this.innerHTML.trim()?this.innerHTML:this._expandableContent||"";e.trim()&&(this._expandableContent=e);const s=this.ensure("details",()=>{const s=document.createElement("details"),o=document.createElement("summary");o.className="c-expandable__summary",o.textContent=t,s.appendChild(o);const a=document.createElement("div");return a.className="c-expandable__body",setHTML(a,e),s.appendChild(a),s}),o=s.querySelector("summary");o&&(o.textContent=t);const a=s.querySelector(".c-expandable__body");a&&setHTML(a,e),s.parentNode!==this&&(setHTML(this,""),this.appendChild(s))}else{const t=this.querySelector("details");t&&t.remove()}}enhance(){this._wiredExpandable||(this._wiredExpandable=!0,this.addEventListener("toggle",t=>{const e=t.target;e&&"DETAILS"===e.tagName&&this.dispatchEvent(new CustomEvent("contour:toggle",{detail:{open:e.open},bubbles:!0,composed:!0}))},!0))}}define("contour-expandable",ContourExpandable);class ContourToastHost extends ContourBase{static get observed(){return[]}render(){this.classList.add("c-toast-host"),this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",labelText(this,"toast-host","Toast host")),this.hasAttribute("aria-live")||this.setAttribute("aria-live","polite"),this.hasAttribute("aria-atomic")||this.setAttribute("aria-atomic","true")}enhance(){if(this._wiredToastHost)return;this._wiredToastHost=!0,this._toastQueue=[],this._toastActive=null;const t=(t,s)=>{s=s||{};const o=document.createElement("div");o.className="c-toast",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic","true"),s.variant&&o.classList.add("c-toast--"+s.variant);const a=statusIcon(s.variant);if(a){const t=document.createElement("span");t.className="c-toast__icon",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+a+'" /></svg>'),o.appendChild(t)}o.dataset.message=null==t?"":String(t);const i=document.createElement("span");if(i.className="c-toast__text",i.textContent=null==t?"":String(t),o.appendChild(i),s.action&&("string"==typeof s.action||s.action.label)){const t="string"==typeof s.action?s.action:s.action.label,a=document.createElement("button");a.type="button",a.className="c-btn c-btn--ghost c-toast__action",a.textContent=t,a.addEventListener("click",t=>{if(t.stopPropagation(),"object"==typeof s.action&&"function"==typeof s.action.onClick)try{s.action.onClick()}catch(t){}e(o)}),o.appendChild(a)}const r=document.createElement("button");return r.type="button",r.className="c-toast__close",r.setAttribute("aria-label",labelText(this,"close","Close")),r.textContent="×",o.appendChild(r),r.addEventListener("click",t=>{t.stopPropagation(),e(o)}),o._arm=()=>{clearTimeout(o._timer);const t=s.duration,a=0===t?0:t>0?t:4e3;a>0&&(o._timer=setTimeout(()=>e(o),a))},o.addEventListener("mouseenter",()=>clearTimeout(o._timer)),o.addEventListener("focusin",()=>clearTimeout(o._timer)),o.addEventListener("mouseleave",o._arm),o.addEventListener("focusout",o._arm),o},e=t=>{t&&t.parentNode&&(t._timer&&(clearTimeout(t._timer),t._timer=null),t.parentNode.removeChild(t),this._toastActive===t&&(this._toastActive=null),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0,detail:{message:t.textContent}})),s())},s=()=>{for(;this._toastQueue.length;){const e=this._toastQueue.shift();if(e._deduped)continue;const s=t(e.message,e.opts);this._toastActive=s,this.appendChild(s),s._arm()}};this.show=(t,o)=>{o=o||{};const a=String(null==t?"":t),i=this._toastActive;if(i&&i.dataset&&i.dataset.message===a&&""!==a){i._timer&&clearTimeout(i._timer);const t=o.duration&&o.duration>0?o.duration:4e3;return i._timer=setTimeout(()=>e(i),t),i}const r=this._toastQueue.find(t=>String(t.message)===a&&""!==a);if(r)return r.opts=Object.assign({},r.opts,o),null;const n={message:t,opts:o,_deduped:!1};return this._toastQueue.push(n),s(),this._toastActive},this.hide=()=>{this._toastActive&&e(this._toastActive),this._toastQueue.length=0,Array.from(this.querySelectorAll(".c-toast")).forEach(t=>{t._timer&&clearTimeout(t._timer),t.parentNode&&t.parentNode.removeChild(t)}),this._toastActive=null}}}define("contour-toast-host",ContourToastHost);class ContourOffline extends ContourBase{static get observed(){return["status","label"]}static get properties(){return{status:{attribute:"status"},label:{attribute:"label"}}}render(){this.classList.add("c-offline"),Array.from(this.classList).forEach(t=>{t.startsWith("c-offline--")&&this.classList.remove(t)}),this.hasAttribute("role")||this.setAttribute("role","status");const t=this.getAttribute("status")||"online";this.classList.add("c-offline--"+t);const e=this.getAttribute("label")||("offline"===t?"Offline":"queued"===t?"Changes queued":"Online");this.ensure(".c-offline__dot",()=>{const t=document.createElement("span");return t.className="c-offline__dot",t.setAttribute("aria-hidden","true"),t});this.ensure(".c-offline__text",()=>{const t=document.createElement("span");return t.className="c-offline__text",t}).textContent=e}}define("contour-offline",ContourOffline);
|
|
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,PROPERTY_FIELDS,normalizeProperty,propertyDescriptor,propertyTypeOf,contourDiagnosticsEnabled,setContourDiagnostics,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,virtualRange,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 o="";for(let e=0;e<t.length;e++)o+=t[e].cssText+"\n";s=t.length+":"+_hashCss(o)}catch(t){}t+=(e.href||"inline")+"~"+s+"|"}if(ADOPTED&&t===ADOPTED_KEY)return ADOPTED;ADOPTED_KEY=t,ADOPTED=[];const e=(t,s)=>{let o;try{o=t.cssRules}catch(t){return}if(o)for(const t of o)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 o=new CSSStyleSheet;s.length&&o.replaceSync(s.join("\n")),ADOPTED.push(o)}}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 o=t.querySelector("#"+CSS.escape(s))||document.getElementById(s);o&&!o.hasAttribute("aria-labelledby")&&(e.id||(e.id=contourId("tab")),o.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 o=e.querySelector(".c-field__error");if(o){o.id||(o.id=contourId("err"));const e=t.getAttribute("aria-describedby")||"";t.setAttribute("aria-describedby",(e+" "+o.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",o=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",o),t.dataset.contourAutoLive=o)}),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,o=[];if(e)for(const t of e.assignedElements({flatten:!0}))t.matches("input, textarea, select")&&o.push(t);if(!o.length&&s){const t=s.querySelector('slot[name="input"]');if(t)for(const e of t.assignedElements({flatten:!0}))e.matches("input, textarea, select")&&o.push(e)}for(const e of o){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"),o=s.querySelector(".c-field__error"),a=[];t&&(t.id||(t.id=contourId("hint")),a.push(t.id)),o&&(o.id||(o.id=contourId("err")),a.push(o.id)),a.length&&e.setAttribute("aria-describedby",a.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,o)=>{const a=t.querySelector(e);a&&a.setAttribute("aria-label",labelText(this,s,o))};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",o=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",o),t.dataset.contourAutoLive=o)}}}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 o=class extends ContourShadow{};o.contourTemplate=s,define(t,o)},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 o=e.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(o)try{o.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 o of e.querySelectorAll("slot"))for(const e of o.assignedElements({flatten:!0})){e.matches(t)&&s.push(e);for(const o of e.querySelectorAll(t))s.push(o)}return s},o=()=>this.shadowRoot&&this.shadowRoot.activeElement||document.activeElement;e.addEventListener("keydown",t=>{if("Tab"!==t.key)return;const e=s();if(!e.length)return;const a=e[0],i=e[e.length-1];t.shiftKey&&o()===a?(t.preventDefault(),i.focus()):t.shiftKey||o()!==i||(t.preventDefault(),a.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 o=SHADOW_MARKUP[t];if("string"!=typeof o)return null;return`<${t}${e?e.startsWith(" ")?e:" "+e:""}><template shadowrootmode="open">${o}</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};function overlayIsModal(t){return"inline"!==t.getAttribute("mode")}const overlayStack=[];function overlayPush(t){const e=overlayStack.indexOf(t);e>=0&&overlayStack.splice(e,1),overlayStack.push(t)}function overlayPop(t){const e=overlayStack.indexOf(t);e>=0&&overlayStack.splice(e,1)}function overlayIsTop(t){return overlayStack[overlayStack.length-1]===t}function overlayHandleEscape(t,e){return"Escape"===e.key&&(!overlayIsTop(t)||(e.stopPropagation(),t.close(),!0))}function engageInitialModal(t){if(!t.hasAttribute("open")||t._modalEngaged)return;t._modalEngaged=!0,t._overlayOpen=!0,overlayPush(t),t.classList.add("is-open"),overlayIsModal(t)&&(t.setAttribute("aria-modal","true"),modalContain(t,!0));const e=t.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(e)try{e.focus()}catch(t){}}function syncDeclarativeOpen(t,e,s,o){if("open"===e&&o&&!t._declarativeOpen){t._declarativeOpen=!0;try{null===s||t._overlayOpen?null===s&&t._overlayOpen&&t.close():(t.removeAttribute("open"),t.show())}finally{t._declarativeOpen=!1}}}class ContourDialog extends ContourBase{static get observed(){return["title","size","heading","open"]}static get properties(){return{title:{attribute:"title"},size:{attribute:"size"}}}attributeChangedCallback(t,e,s){"open"!==t?super.attributeChangedCallback(t,e,s):syncDeclarativeOpen(this,t,s,this._wiredDialog)}showModal(){this.show()}get open(){return this.hasAttribute("open")}set open(t){t?this.show():this.close()}render(){this.classList.add("c-dialog"),Array.from(this.classList).forEach(t=>{t.startsWith("c-dialog--")&&this.classList.remove(t)});const t=this.getAttribute("size");t&&this.classList.add("c-dialog--"+t),this.hasAttribute("role")||this.setAttribute("role","dialog");const e=this.getAttribute("title");let s=this.querySelector(".c-dialog__head");if(e){if(!s){s=document.createElement("div"),s.className="c-dialog__head";const t=document.createElement(headingTag(this,"h2"));t.className="c-dialog__title",s.appendChild(t);const e=document.createElement("button");e.className="c-btn c-btn--icon c-btn--ghost c-dialog__close",e.setAttribute("type","button"),e.setAttribute("aria-label",labelText(this,"close","Close")),setHTML(e,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-x" /></svg>'),s.appendChild(e)}const t=s.querySelector(".c-dialog__title");t&&(t.textContent=e,t.id||(t.id=contourId("contour-dialog-title")),this.setAttribute("aria-labelledby",t.id))}s&&s.parentNode!==this&&this.prepend(s);const o=this.ensure(".c-dialog__body",()=>{const t=document.createElement("div");return t.className="c-dialog__body",t});Array.from(this.childNodes).forEach(t=>{t!==o&&t!==s&&(1===t.nodeType&&t.classList&&t.classList.contains("c-dialog__head")||o.appendChild(t))}),s&&s.parentNode===this?(o.parentNode!==this||s.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING)&&this.insertBefore(o,s.nextSibling):o.parentNode!==this&&this.appendChild(o)}enhance(){this._wiredDialog||(this._wiredDialog=!0,this.returnValue="",this._ensureScrim=()=>{if(this._overlayScrim||this.querySelector("dialog")||"DIALOG"===this.tagName)return;const t=document.createElement("div");t.className="c-scrim is-open",t.setAttribute("data-contour-overlay-scrim",""),t.addEventListener("click",()=>this.close()),document.body.appendChild(t),this._overlayScrim=t},this._removeScrim=()=>{this._overlayScrim&&(this._overlayScrim.remove(),this._overlayScrim=null)},onDispose(this,()=>{this.hasAttribute("open")&&modalContain(this,!1),overlayPop(this),this._removeScrim()}),this.show=()=>{if(this.hasAttribute("open"))return;this._overlayOpen=!0,overlayPush(this),this._dialogLastFocus=document.activeElement,this._declarativeOpen=!0;try{this.setAttribute("open","")}finally{this._declarativeOpen=!1}this.setAttribute("aria-modal","true");const t=this.querySelector("dialog")||("DIALOG"===this.tagName?this:null);if(t&&"function"==typeof t.showModal)try{t.showModal()}catch(t){}modalContain(this,!0),this._ensureScrim();const e=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(e)try{e.focus()}catch(t){}this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}))},this.close=()=>{const t=this.hasAttribute("open")||this.hasAttribute("aria-modal")||this._overlayOpen;this._overlayOpen=!1,overlayPop(this);const e=this.querySelector("dialog")||("DIALOG"===this.tagName?this:null);e&&"function"==typeof e.close&&e.close(),this._declarativeOpen=!0;try{this.hasAttribute("open")&&this.removeAttribute("open")}finally{this._declarativeOpen=!1}if(this.removeAttribute("aria-modal"),this._removeScrim(),t){modalContain(this,!1),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}));const t=this._dialogLastFocus;if(t&&"function"==typeof t.focus)try{t.focus()}catch(t){}}},this.focus=()=>{const t=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(t)try{t.focus()}catch(t){}else try{HTMLElement.prototype.focus.call(this)}catch(t){}},this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-dialog__close"):null;(e&&this.contains(e)||t.target===this)&&this.close()}),this.addEventListener("keydown",t=>{"Escape"===t.key&&this.hasAttribute("open")&&overlayHandleEscape(this,t)}),engageInitialModal(this))}}define("contour-dialog",ContourDialog);class ContourAlert extends ContourBase{static get observed(){return["title","body","variant","icon","closable","action","actions","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{title:{attribute:"title"},body:{attribute:"body"},variant:{attribute:"variant"},icon:{attribute:"icon"},closable:{attribute:"closable",type:Boolean},action:{attribute:"action"},actions:{attribute:"actions"}}}render(){this.classList.add("c-alert");const t=/^(warning|danger)$/.test(this.getAttribute("variant")||""),e=t?"alert":"status",s=t?"assertive":"polite";if(this.hasAttribute("role")&&this.getAttribute("role")!==this._autoRole||(this.setAttribute("role",e),this._autoRole=e),this.hasAttribute("aria-live")&&this.getAttribute("aria-live")!==this._autoLive||(this.setAttribute("aria-live",s),this._autoLive=s),wireStates(this),loadRemote(this,"title"),renderStates(this,"alert"))return;const o=this.getAttribute("variant");Array.from(this.classList).forEach(t=>{t.startsWith("c-alert--")&&this.classList.remove(t)}),o&&this.classList.add("c-alert--"+o);const a=this.getAttribute("icon"),i="none"===a?"":a||statusIcon(o);if(i){const t=this.ensure(".c-alert__icon",()=>{const t=document.createElement("span");return t.className="c-alert__icon",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(i).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>')}else{const t=this.querySelector(".c-alert__icon");t&&t.remove()}const r=this.getAttribute("title")||this._remoteData&&this._remoteData.title;if(r){const t=this.ensure(".c-alert__title",()=>{const t=document.createElement("div");return t.className="c-alert__title",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),t.textContent=r}else{const t=this.querySelector(".c-alert__title");t&&t.remove()}const n=this.getAttribute("body"),c=null!==n,l=c||!0===this._alertHadBody,d=Array.from(this.childNodes).filter(t=>(1!==t.nodeType||!t.classList||!(t.classList.contains("c-alert__icon")||t.classList.contains("c-alert__title")||t.classList.contains("c-alert__body")||t.classList.contains("c-alert__action")||t.classList.contains("c-alert__close")))&&(!(3===t.nodeType&&!t.textContent.trim())&&(!l||3!==t.nodeType)));if(l){this.ensure(".c-alert__body",()=>{const t=document.createElement("div");return t.className="c-alert__body",t}).textContent=c?n:""}else if(d.length){const t=this.ensure(".c-alert__body",()=>{const t=document.createElement("div");return t.className="c-alert__body",t});t.textContent="";for(const e of d)t.appendChild(e)}else{const t=this.querySelector(".c-alert__body");t&&t.remove()}this._alertHadBody=c,Array.from(this.querySelectorAll(".c-alert__action")).forEach(t=>t.remove());const h=this.getAttribute("actions");let u=[];if(h)try{const t=JSON.parse(h);Array.isArray(t)&&(u=t.map(t=>String(t)))}catch(t){u=[h]}else{const t=this.getAttribute("action");t&&(u=[t])}if(u.forEach(t=>{const e=document.createElement("button");e.className="c-btn c-btn--sm c-alert__action",e.type="button",e.setAttribute("data-alert-action",""),e.textContent=t,this.appendChild(e)}),flagOn(this,"closable"))this.ensure(".c-alert__close",()=>{const t=document.createElement("button");return t.className="c-alert__close",t.type="button",t.setAttribute("aria-label",labelText(this,"close","Close")),t.textContent="×",t});else{const t=this.querySelector(".c-alert__close");t&&t.remove()}r||n||i||d.length||renderEmpty(this,"alert")}}ContourAlert.prototype.enhance=function(){if(this._wiredAlert)return;this._wiredAlert=!0,this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-alert__action"):null;if(e&&this.contains(e))return t.preventDefault(),void this.dispatchEvent(new CustomEvent("contour:action",{bubbles:!0,composed:!0,detail:{label:e.textContent.trim()}}));const s=t.target&&t.target.closest?t.target.closest(".c-alert__close"):null;s&&this.contains(s)&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),this.remove())});let t=null;const e=e=>{if(!t)return;const s=e.clientX-t.x;t.dx=s,!t.active&&Math.abs(s)>8&&(t.active=!0,this.classList.add("is-swiping")),t.active&&(this.style.transform="translateX("+s+"px)")},s=()=>{if(window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),!t)return;const{dx:o,active:a}=t;t=null,this.classList.remove("is-swiping"),this.style.removeProperty("transform"),a&&Math.abs(o)>80&&(this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),this.remove())};this.addEventListener("pointerdown",o=>{flagOn(this,"closable")&&("mouse"===o.pointerType&&0!==o.button||(t={x:o.clientX,dx:0,active:!1},window.addEventListener("pointermove",e),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s)))}),onDispose(this,()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)})},define("contour-alert",ContourAlert);class ContourDisclosure extends ContourBase{static get observed(){return["summary","icon"]}static get properties(){return{summary:{attribute:"summary"},icon:{attribute:"icon"}}}disconnectedCallback(){this._disclosureContent=null,super.disconnectedCallback()}connectedCallback(){this.innerHTML.trim()&&!this._disclosureContent&&(this._disclosureContent=this.innerHTML),super.connectedCallback()}attributeChangedCallback(t,e,s){const o=this.querySelector("details");if(o){const t=o.querySelector(".c-disclosure__body");t&&(this._disclosureContent=t.innerHTML)}else this.innerHTML.trim()&&(this._disclosureContent=this.innerHTML);super.attributeChangedCallback(t,e,s)}render(){this.classList.add("c-disclosure");const t=this.getAttribute("summary"),e=this.getAttribute("icon");if(t){let s=this.innerHTML.trim()?this.innerHTML:this._disclosureContent||"";s.trim()&&(this._disclosureContent=s);const o=this.ensure("details",()=>{const o=document.createElement("details"),a=document.createElement("summary");if(a.className="c-disclosure__summary",e){const t=document.createElement("span");t.className="c-disclosure__icon",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(e).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>'),a.appendChild(t)}a.appendChild(document.createTextNode(t)),o.appendChild(a);const i=document.createElement("div");return i.className="c-disclosure__body",setHTML(i,s),o.appendChild(i),o}),a=o.querySelector("summary");if(a){const s=a.querySelector(".c-disclosure__icon");if(e&&!s){const t=document.createElement("span");t.className="c-disclosure__icon",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(e).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>'),a.insertBefore(t,a.firstChild)}else!e&&s&&s.remove();Array.from(a.childNodes).filter(t=>3===t.nodeType).forEach(t=>t.remove()),a.appendChild(document.createTextNode(t))}const i=o.querySelector(".c-disclosure__body");i&&setHTML(i,s),o.parentNode!==this&&(setHTML(this,""),this.appendChild(o))}else{const t=this.querySelector("details");t&&t.remove()}}enhance(){this._wiredDisclosure||(this._wiredDisclosure=!0,this.addEventListener("toggle",t=>{const e=t.target;e&&"DETAILS"===e.tagName&&this.dispatchEvent(new CustomEvent("contour:toggle",{detail:{open:e.open},bubbles:!0,composed:!0}))},!0))}}define("contour-disclosure",ContourDisclosure);class ContourCallout extends ContourBase{static get observed(){return["variant","title","icon","closable"]}static get properties(){return{variant:{attribute:"variant"},title:{attribute:"title"},icon:{attribute:"icon"},closable:{attribute:"closable",type:Boolean}}}render(){this.classList.add("c-callout"),this.hasAttribute("role")||this.setAttribute("role","note"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("title")||"Callout"),Array.from(this.classList).forEach(t=>{t.startsWith("c-callout--")&&this.classList.remove(t)});const t=this.getAttribute("variant");t&&this.classList.add("c-callout--"+t);const e=this.getAttribute("icon"),s="none"===e?"":e||statusIcon(t);if(s){const t=this.ensure(".c-callout__icon",()=>{const t=document.createElement("span");return t.className="c-callout__icon",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(s).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>')}else{const t=this.querySelector(".c-callout__icon");t&&t.remove()}const o=this.getAttribute("title");if(o){const t=this.ensure(".c-callout__title",()=>{const t=document.createElement("div");return t.className="c-callout__title",t});t.parentNode===this&&this.firstChild!==t&&this.prepend(t),t.textContent=o}else{const t=this.querySelector(".c-callout__title");t&&t.remove()}if(flagOn(this,"closable"))this.ensure(".c-callout__close",()=>{const t=document.createElement("button");return t.className="c-callout__close",t.type="button",t.setAttribute("aria-label",labelText(this,"close","Close")),t.textContent="×",t});else{const t=this.querySelector(".c-callout__close");t&&t.remove()}}}ContourCallout.prototype.enhance=function(){this._wiredCallout||(this._wiredCallout=!0,this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-callout__close"):null;e&&this.contains(e)&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0})),this.remove())}))},define("contour-callout",ContourCallout);const EMPTY_STATE_COPY={empty:{title:"No data yet",body:"There is nothing to show here yet.",action:""},filtered:{title:"Nothing matches",body:"Try clearing some filters.",action:"Clear filters"},selection:{title:"No selection",body:"Select one or more items to see details.",action:""},viewport:{title:"Nothing in view",body:"Pan or zoom to an area with data.",action:""},"saved-view":{title:"No saved view",body:"Save this view to return to it later.",action:""},permission:{title:"No access",body:"You do not have permission to see this.",action:""},setup:{title:"Not set up yet",body:"Finish setup to see data here.",action:""},error:{title:"Could not load",body:"Check your connection and try again.",action:"Retry"}};class ContourEmpty extends ContourBase{static get observed(){return["state","title","body","action","icon","illustration","heading"]}static get properties(){return{state:{attribute:"state"},title:{attribute:"title"},body:{attribute:"body"},action:{attribute:"action"},icon:{attribute:"icon"},illustration:{attribute:"illustration"}}}render(){this.classList.add("c-empty"),this.hasAttribute("role")||this.setAttribute("role","status");const t=this.getAttribute("state")||"empty",e=EMPTY_STATE_COPY[t]||EMPTY_STATE_COPY.empty,s=this.getAttribute("title")||e.title,o=this.getAttribute("body")||e.body,a=this.getAttribute("action")||e.action,i=this.getAttribute("illustration"),r=this.getAttribute("icon")||(i?"":"i-mark");if(r){const t=this.ensure(".c-empty__icon",()=>{const t=document.createElement("span");return t.className="c-empty__icon",t});setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(r).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>')}else{const t=this.querySelector(".c-empty__icon");t&&t.remove()}if(i){const t=this.ensure(".c-empty__illustration",()=>{const t=document.createElement("div");return t.className="c-empty__illustration",t});setHTML(t,sanitizeHtml(i))}else{const t=this.querySelector(".c-empty__illustration");t&&t.remove()}if(s){this.ensure(".c-empty__title",()=>{const t=document.createElement(headingTag(this,"h3"));return t.className="c-empty__title",t}).textContent=s}else{const t=this.querySelector(".c-empty__title");t&&t.remove()}if(o){this.ensure(".c-empty__text",()=>{const t=document.createElement("p");return t.className="c-empty__text",t}).textContent=o}else{const t=this.querySelector(".c-empty__text");t&&t.remove()}if(a){this.ensure("button.c-btn[data-empty-action]",()=>{const t=document.createElement("button");return t.className="c-btn c-btn--primary",t.type="button",t.setAttribute("data-empty-action",""),t}).textContent=a}else{const t=this.querySelector("[data-empty-action]");t&&t.remove()}}enhance(){wireRemovable(this)}}define("contour-empty",ContourEmpty);class ContourFaq extends ContourBase{static get observed(){return["question","answer","items","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{question:{attribute:"question"},answer:{attribute:"answer"},items:{attribute:"items"},src:{attribute:"src"}}}render(){if(this.classList.add("c-faq"),wireStates(this),loadRemote(this,"items"),renderStates(this,"faq"))return;const t=remoteData(this,"items"),e=this.getAttribute("question"),s=this.getAttribute("answer"),o=Array.from(this.children).filter(t=>t.classList&&t.classList.contains("c-faq__item"));if(t&&!o.length)try{const e=JSON.parse(t);Array.from(this.querySelectorAll(".c-faq__item")).forEach(t=>t.remove()),e.forEach((t,e)=>{const s=document.createElement("details");s.className="c-faq__item",0===e&&s.setAttribute("open","");const o=document.createElement("summary");o.className="c-faq__question",o.textContent="string"==typeof t?t:t.question||t.q||"";const a=document.createElement("span");a.className="c-faq__sign",a.setAttribute("aria-hidden","true"),setHTML(a,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-plus" /></svg>'),o.appendChild(a),s.appendChild(o);const i=document.createElement("div");i.className="c-faq__answer",i.textContent="string"==typeof t?"":t.answer||t.a||"",s.appendChild(i),this.appendChild(s)})}catch(t){warnBadJson(this,"attribute",t)}else if(!t)if(e||s){const t=this.ensure("details.c-faq__item",()=>{const t=document.createElement("details");return t.className="c-faq__item",t});t.hasAttribute("open")||t.setAttribute("open","");const o=this.ensure("summary.c-faq__question",()=>{const t=document.createElement("summary");return t.className="c-faq__question",t},t);o.textContent=e||"";const a=this.ensure(".c-faq__sign",()=>{const t=document.createElement("span");return t.className="c-faq__sign",t},o);a.setAttribute("aria-hidden","true"),setHTML(a,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-plus" /></svg>');this.ensure(".c-faq__answer",()=>{const t=document.createElement("div");return t.className="c-faq__answer",t},t).textContent=s||""}else renderEmpty(this,"faq")}}define("contour-faq",ContourFaq);class ContourAccordion extends ContourBase{static get observed(){return["items","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","persist","exclusive","cache-key","no-cache"]}static get properties(){return{items:{attribute:"items"},exclusive:{attribute:"exclusive",type:Boolean},src:{attribute:"src"}}}render(){this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",labelText(this,"accordion","Accordion"));const t=Array.from(this.children).filter(t=>"DETAILS"===t.tagName);if(wireStates(this),loadRemote(this,"items"),renderStates(this,"accordion"))return;const e=remoteData(this,"items");if(e&&!t.length){Array.from(this.querySelectorAll("details.c-disclosure")).forEach(t=>t.remove());try{JSON.parse(e).forEach(t=>{const e=document.createElement("details");e.className="c-disclosure";const s=document.createElement("summary");s.className="c-disclosure__summary",s.textContent=t.title||t.question||t.q||t.label||"",e.appendChild(s);const o=document.createElement("div");o.className="c-disclosure__body",o.textContent=t.body||t.answer||t.a||t.content||"",e.appendChild(o),this.appendChild(e)})}catch(t){warnBadJson(this,"attribute",t)}}else e||t.length||renderEmpty(this,"accordion");const s=this.getAttribute("persist");if(s){let t=null;if("storage"===s&&this.id)try{t=localStorage.getItem("contour-accordion:"+this.id)}catch(t){}else if("url"===s)try{t=new URLSearchParams(window.location.search).get("c-accordion")}catch(t){}if(null!==t)try{const e=JSON.parse(t);if(Array.isArray(e)){const t=new Set(e.map(t=>String(t)));Array.from(this.querySelectorAll("details.c-disclosure")).forEach(e=>{const s=e.querySelector("summary"),o=(s?s.textContent:"").trim().slice(0,120);t.has(o)&&(e.open=!0)})}}catch(t){}}}enhance(){this._wiredAccordion||(this._wiredAccordion=!0,this.addEventListener("toggle",t=>{const e=t.target;if(e&&"DETAILS"===e.tagName){e.open&&this.hasAttribute("exclusive")&&Array.from(this.querySelectorAll("details.c-disclosure")).forEach(t=>{t!==e&&(t.open=!1)}),this.dispatchEvent(new CustomEvent("contour:toggle",{detail:{open:e.open},bubbles:!0,composed:!0}));const s=this.getAttribute("persist");if("storage"===s&&this.id)try{const t=[];Array.from(this.querySelectorAll("details.c-disclosure")).forEach(e=>{if(e.open){const s=e.querySelector("summary");t.push((s?s.textContent:"").trim().slice(0,120))}}),localStorage.setItem("contour-accordion:"+this.id,JSON.stringify(t))}catch(t){}else if("url"===s)try{const t=[];Array.from(this.querySelectorAll("details.c-disclosure")).forEach(e=>{if(e.open){const s=e.querySelector("summary");t.push((s?s.textContent:"").trim().slice(0,120))}});const e=new URL(window.location.href);e.searchParams.set("c-accordion",JSON.stringify(t)),window.history.replaceState(null,"",e.toString())}catch(t){}}},!0))}}define("contour-accordion",ContourAccordion);class ContourDrawer extends ContourBase{static get observed(){return["title","body","size","open","mode"]}static get properties(){return{title:{attribute:"title"},body:{attribute:"body"},size:{attribute:"size"},mode:{attribute:"mode"}}}attributeChangedCallback(t,e,s){"open"!==t?super.attributeChangedCallback(t,e,s):syncDeclarativeOpen(this,t,s,this._wiredDrawer)}showModal(){this.show()}get open(){return this.hasAttribute("open")}set open(t){t?this.show():this.close()}render(){this.classList.add("c-drawer"),Array.from(this.classList).forEach(t=>{t.startsWith("c-drawer--")&&this.classList.remove(t)});const t=this.getAttribute("size");t&&this.classList.add("c-drawer--"+t),this.hasAttribute("role")||this.setAttribute("role","dialog");const e=this.getAttribute("title");let s=this.querySelector(".c-drawer__head");if(e){if(!s){s=document.createElement("div"),s.className="c-drawer__head";const t=document.createElement("div");t.className="c-drawer__title",s.appendChild(t);const e=document.createElement("button");e.className="c-btn c-btn--icon c-btn--ghost c-drawer__close",e.setAttribute("type","button"),e.setAttribute("aria-label",labelText(this,"close","Close")),setHTML(e,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-x" /></svg>'),s.appendChild(e)}const t=s.querySelector(".c-drawer__title");t&&(t.textContent=e,t.id||(t.id=contourId("contour-drawer-title")),this.setAttribute("aria-labelledby",t.id)),s.parentNode!==this&&this.prepend(s)}else if(s){const t=s.querySelector(".c-drawer__title");t&&t.id&&this.getAttribute("aria-labelledby")===t.id&&this.removeAttribute("aria-labelledby"),s.remove()}this.hasAttribute("open")?this.classList.add("is-open"):this.classList.remove("is-open");const o=this.getAttribute("body"),a=Array.from(this.childNodes).filter(t=>(1!==t.nodeType||!t.classList||!t.classList.contains("c-drawer__head")&&!t.classList.contains("c-drawer__body"))&&!(3===t.nodeType&&!t.textContent.trim()));if(a.length){const t=this.ensure(".c-drawer__body",()=>{const t=document.createElement("div");return t.className="c-drawer__body",t});for(const e of a)t.appendChild(e)}else if(o){const t=this.ensure(".c-drawer__body",()=>{const t=document.createElement("div");return t.className="c-drawer__body",t});setHTML(t,sanitizeHtml(o))}else{const t=this.querySelector(".c-drawer__body");t&&t.remove()}}enhance(){if(this._wiredDrawer)return;this._wiredDrawer=!0,this.returnValue="",onDispose(this,()=>{this.hasAttribute("open")&&modalContain(this,!1)}),this._drawerLastFocus=null,this._ensureScrim=()=>{if(this._overlayScrim)return;const t=document.createElement("div");t.className="c-scrim is-open",t.setAttribute("data-contour-overlay-scrim",""),t.addEventListener("click",()=>this.close()),document.body.appendChild(t),this._overlayScrim=t},this._removeScrim=()=>{this._overlayScrim&&(this._overlayScrim.remove(),this._overlayScrim=null)},onDispose(this,()=>{(this.hasAttribute("open")||this._overlayOpen)&&modalContain(this,!1),overlayPop(this),this._removeScrim()}),this.show=()=>{if(this.hasAttribute("open"))return;this._overlayOpen=!0,overlayPush(this),this._drawerLastFocus=document.activeElement,this._declarativeOpen=!0;try{this.setAttribute("open","")}finally{this._declarativeOpen=!1}this.classList.add("is-open"),overlayIsModal(this)?(this.setAttribute("aria-modal","true"),modalContain(this,!0),this._ensureScrim()):this.removeAttribute("aria-modal");const t=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(t)try{t.focus()}catch(t){}this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}))},this.close=()=>{if(!this.hasAttribute("open")&&!this._overlayOpen)return;this._overlayOpen=!1,overlayPop(this),this._declarativeOpen=!0;try{this.removeAttribute("open")}finally{this._declarativeOpen=!1}this.classList.remove("is-open"),overlayIsModal(this)&&(this.removeAttribute("aria-modal"),modalContain(this,!1)),this._removeScrim(),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}));const t=this._drawerLastFocus;if(t&&"function"==typeof t.focus)try{t.focus()}catch(t){}},this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-drawer__close"):null;(e&&this.contains(e)||t.target===this)&&this.close()}),this.addEventListener("keydown",t=>{"Escape"===t.key&&this.hasAttribute("open")&&overlayHandleEscape(this,t)});let t=0,e=0;this.addEventListener("touchstart",s=>{if(!this.hasAttribute("open"))return;const o=s.touches&&s.touches[0];o&&(t=o.clientX,e=o.clientY)},{passive:!0}),this.addEventListener("touchend",s=>{if(!this.hasAttribute("open"))return;const o=s.changedTouches&&s.changedTouches[0];if(!o)return;const a=o.clientX-t,i=o.clientY-e;Math.abs(a)>60&&Math.abs(a)>1.5*Math.abs(i)&&this.close()},{passive:!0}),engageInitialModal(this)}}define("contour-drawer",ContourDrawer);class ContourSheet extends ContourBase{static get observed(){return["title","body","size","open","mode"]}static get properties(){return{title:{attribute:"title"},body:{attribute:"body"},size:{attribute:"size"},mode:{attribute:"mode"}}}attributeChangedCallback(t,e,s){"open"!==t?super.attributeChangedCallback(t,e,s):syncDeclarativeOpen(this,t,s,this._wiredSheet)}showModal(){this.show()}get open(){return this.hasAttribute("open")}set open(t){t?this.show():this.close()}render(){this.classList.add("c-sheet"),Array.from(this.classList).forEach(t=>{t.startsWith("c-sheet--")&&this.classList.remove(t)});const t=this.getAttribute("size");t&&this.classList.add("c-sheet--"+t),this.hasAttribute("role")||this.setAttribute("role","dialog");const e=this.getAttribute("title");let s=this.querySelector(".c-sheet__head");if(e){if(!s){s=document.createElement("div"),s.className="c-sheet__head";const t=document.createElement("div");t.className="c-sheet__title",s.appendChild(t);const e=document.createElement("button");e.className="c-btn c-btn--icon c-btn--ghost c-sheet__close",e.setAttribute("type","button"),e.setAttribute("aria-label",labelText(this,"close","Close")),setHTML(e,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-x" /></svg>'),s.appendChild(e)}const t=s.querySelector(".c-sheet__title");t&&(t.textContent=e,t.id||(t.id=contourId("contour-sheet-title")),this.setAttribute("aria-labelledby",t.id)),s.parentNode!==this&&this.prepend(s)}else if(s){const t=s.querySelector(".c-sheet__title");t&&t.id&&this.getAttribute("aria-labelledby")===t.id&&this.removeAttribute("aria-labelledby"),s.remove()}this.hasAttribute("open")?this.classList.add("is-open"):this.classList.remove("is-open");const o=this.getAttribute("body"),a=Array.from(this.childNodes).filter(t=>(1!==t.nodeType||!t.classList||!t.classList.contains("c-sheet__head")&&!t.classList.contains("c-sheet__body"))&&!(3===t.nodeType&&!t.textContent.trim()));if(a.length){const t=this.ensure(".c-sheet__body",()=>{const t=document.createElement("div");return t.className="c-sheet__body",t});for(const e of a)t.appendChild(e)}else if(o){const t=this.ensure(".c-sheet__body",()=>{const t=document.createElement("div");return t.className="c-sheet__body",t});setHTML(t,sanitizeHtml(o))}else{const t=this.querySelector(".c-sheet__body");t&&t.remove()}}enhance(){if(this._wiredSheet)return;this._wiredSheet=!0,this.returnValue="",onDispose(this,()=>{this.hasAttribute("open")&&modalContain(this,!1)}),this._sheetLastFocus=null,this._ensureScrim=()=>{if(this._overlayScrim)return;const t=document.createElement("div");t.className="c-scrim is-open",t.setAttribute("data-contour-overlay-scrim",""),t.addEventListener("click",()=>this.close()),document.body.appendChild(t),this._overlayScrim=t},this._removeScrim=()=>{this._overlayScrim&&(this._overlayScrim.remove(),this._overlayScrim=null)},onDispose(this,()=>{(this.hasAttribute("open")||this._overlayOpen)&&modalContain(this,!1),overlayPop(this),this._removeScrim()}),this.show=()=>{if(this.hasAttribute("open"))return;this._overlayOpen=!0,overlayPush(this),this._sheetLastFocus=document.activeElement,this._declarativeOpen=!0;try{this.setAttribute("open","")}finally{this._declarativeOpen=!1}this.classList.add("is-open"),overlayIsModal(this)?(this.setAttribute("aria-modal","true"),modalContain(this,!0),this._ensureScrim()):this.removeAttribute("aria-modal");const t=this.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(t)try{t.focus()}catch(t){}this.dispatchEvent(new CustomEvent("contour:open",{bubbles:!0,composed:!0}))},this.close=()=>{if(!this.hasAttribute("open")&&!this._overlayOpen)return;this._overlayOpen=!1,overlayPop(this),this._declarativeOpen=!0;try{this.removeAttribute("open")}finally{this._declarativeOpen=!1}this.classList.remove("is-open"),overlayIsModal(this)&&(this.removeAttribute("aria-modal"),modalContain(this,!1)),this._removeScrim(),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}));const t=this._sheetLastFocus;if(t&&"function"==typeof t.focus)try{t.focus()}catch(t){}},this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-sheet__close"):null;(e&&this.contains(e)||t.target===this)&&this.close()}),this.addEventListener("keydown",t=>{"Escape"===t.key&&this.hasAttribute("open")&&overlayHandleEscape(this,t)});let t=0,e=0;this.addEventListener("touchstart",s=>{if(!this.hasAttribute("open"))return;const o=s.touches&&s.touches[0];o&&(e=o.clientX,t=o.clientY)},{passive:!0}),this.addEventListener("touchend",s=>{if(!this.hasAttribute("open"))return;const o=s.changedTouches&&s.changedTouches[0];if(!o)return;const a=o.clientY-t,i=o.clientX-e;a>60&&Math.abs(a)>1.5*Math.abs(i)&&this.close()},{passive:!0}),engageInitialModal(this)}}define("contour-sheet",ContourSheet);class ContourToast extends ContourBase{static get observed(){return["message","variant","duration","action","icon"]}static get properties(){return{message:{attribute:"message"},variant:{attribute:"variant"},duration:{attribute:"duration",type:Number},action:{attribute:"action"}}}render(){this.classList.add("c-toast"),this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("aria-live")||this.setAttribute("aria-live","polite"),this.hasAttribute("aria-atomic")||this.setAttribute("aria-atomic","true");const t=this.getAttribute("message");t&&!this.hasChildNodes()&&(this.textContent=t);const e=this.getAttribute("variant");Array.from(this.classList).forEach(t=>{t.startsWith("c-toast--")&&this.classList.remove(t)}),e&&this.classList.add("c-toast--"+e);const s=this.getAttribute("icon"),o="none"===s?"":s||statusIcon(e);let a=this.querySelector(".c-toast__icon");o?(a||(a=document.createElement("span"),a.className="c-toast__icon"),setHTML(a,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+String(o).replace(/[^a-zA-Z0-9_-]/g,"")+'" /></svg>'),this.firstChild!==a&&this.prepend(a)):a&&a.remove();const i=this.getAttribute("action");let r=this.querySelector(".c-toast__action");i?(r||(r=document.createElement("button"),r.className="c-toast__action",r.type="button",this.appendChild(r)),r.textContent=i):r&&r.remove();let n=this.querySelector(".c-toast__close");n||(n=document.createElement("button"),n.className="c-toast__close",n.type="button",n.setAttribute("aria-label",labelText(this,"close","Close")),n.textContent="×",this.appendChild(n));let c=this.querySelector(".c-toast__progress");this._durationMs()>0?c||(c=document.createElement("span"),c.className="c-toast__progress",c.setAttribute("aria-hidden","true"),this.appendChild(c)):c&&c.remove()}enhance(){if(this._wiredToast)return;this._wiredToast=!0,this.addEventListener("click",t=>{if(t.target&&t.target.closest?t.target.closest(".c-toast__close"):null)return t.preventDefault(),void this._dismiss();(t.target&&t.target.closest?t.target.closest(".c-toast__action"):null)&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:toast-action",{bubbles:!0,composed:!0,detail:{action:this.getAttribute("action")}})),this._dismiss())});const t=()=>{clearTimeout(this._toastTimer),this._toastTimer=null};this.addEventListener("mouseenter",t),this.addEventListener("focusin",t),this.addEventListener("mouseleave",()=>this._arm()),this.addEventListener("focusout",()=>this._arm());let e=null;const s=s=>{if(!e)return;const o=s.clientX-e.x;e.dx=o,!e.active&&Math.abs(o)>8&&(e.active=!0,this.classList.add("is-swiping"),t()),e.active&&(this.style.transform="translateX("+o+"px)")},o=()=>{if(window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o),!e)return;const{dx:t,active:a}=e;e=null,this.classList.remove("is-swiping"),this.style.removeProperty("transform"),a&&Math.abs(t)>80?this._dismiss():this._arm()};this.addEventListener("pointerdown",t=>{"mouse"===t.pointerType&&0!==t.button||(e={x:t.clientX,dx:0,active:!1},window.addEventListener("pointermove",s),window.addEventListener("pointerup",o),window.addEventListener("pointercancel",o))}),onDispose(this,()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o)}),this._arm(),onDispose(this,()=>clearTimeout(this._toastTimer))}_durationMs(){const t=null!=this._toastDuration?Number(this._toastDuration):Number(this.duration);return 0===t?0:t>0?t:4e3}_arm(){clearTimeout(this._toastTimer),this._toastTimer=null;const t=this._durationMs();t>0?this.style.setProperty("--toast-ms",t+"ms"):this.style.removeProperty("--toast-ms"),t>0&&(this._toastTimer=setTimeout(()=>this._dismiss(),t))}_dismiss(){clearTimeout(this._toastTimer),this._toastTimer=null,this.setAttribute("hidden",""),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0}))}show(t,e){const s=null!=t?String(t):this.getAttribute("message"),o=e&&e.variant||this.getAttribute("variant"),a=e&&e.action||this.getAttribute("action");s&&!this.hasChildNodes()&&(this.textContent=s),Array.from(this.classList).forEach(t=>{t.startsWith("c-toast--")&&this.classList.remove(t)}),o&&this.classList.add("c-toast--"+o);let i=this.querySelector(".c-toast__action");a?(i||(i=document.createElement("button"),i.className="c-toast__action",i.type="button",this.appendChild(i)),i.textContent=a):i&&i.remove(),e&&null!=e.duration&&(this._toastDuration=Number(e.duration)),this.removeAttribute("hidden"),this._arm()}}define("contour-toast",ContourToast);class ContourExpandable extends ContourBase{static get observed(){return["summary"]}static get properties(){return{summary:{attribute:"summary"}}}disconnectedCallback(){this._expandableContent=null,super.disconnectedCallback()}connectedCallback(){this.innerHTML.trim()&&!this._expandableContent&&(this._expandableContent=this.innerHTML),super.connectedCallback()}attributeChangedCallback(t,e,s){const o=this.querySelector("details");if(o){const t=o.querySelector(".c-expandable__body");t&&(this._expandableContent=t.innerHTML)}else this.innerHTML.trim()&&(this._expandableContent=this.innerHTML);super.attributeChangedCallback(t,e,s)}render(){this.classList.add("c-expandable"),this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("summary")||"Expandable");const t=this.getAttribute("summary");if(t){let e=this.innerHTML.trim()?this.innerHTML:this._expandableContent||"";e.trim()&&(this._expandableContent=e);const s=this.ensure("details",()=>{const s=document.createElement("details"),o=document.createElement("summary");o.className="c-expandable__summary",o.textContent=t,s.appendChild(o);const a=document.createElement("div");return a.className="c-expandable__body",setHTML(a,e),s.appendChild(a),s}),o=s.querySelector("summary");o&&(o.textContent=t);const a=s.querySelector(".c-expandable__body");a&&setHTML(a,e),s.parentNode!==this&&(setHTML(this,""),this.appendChild(s))}else{const t=this.querySelector("details");t&&t.remove()}}enhance(){this._wiredExpandable||(this._wiredExpandable=!0,this.addEventListener("toggle",t=>{const e=t.target;e&&"DETAILS"===e.tagName&&this.dispatchEvent(new CustomEvent("contour:toggle",{detail:{open:e.open},bubbles:!0,composed:!0}))},!0))}}define("contour-expandable",ContourExpandable);class ContourToastHost extends ContourBase{static get observed(){return[]}render(){this.classList.add("c-toast-host"),this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",labelText(this,"toast-host","Toast host")),this.hasAttribute("aria-live")||this.setAttribute("aria-live","polite"),this.hasAttribute("aria-atomic")||this.setAttribute("aria-atomic","true")}enhance(){if(this._wiredToastHost)return;this._wiredToastHost=!0,this._toastQueue=[],this._toastActive=null;const t=(t,s)=>{s=s||{};const o=document.createElement("div");o.className="c-toast",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic","true"),s.variant&&o.classList.add("c-toast--"+s.variant);const a=statusIcon(s.variant);if(a){const t=document.createElement("span");t.className="c-toast__icon",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+a+'" /></svg>'),o.appendChild(t)}o.dataset.message=null==t?"":String(t);const i=document.createElement("span");if(i.className="c-toast__text",i.textContent=null==t?"":String(t),o.appendChild(i),s.action&&("string"==typeof s.action||s.action.label)){const t="string"==typeof s.action?s.action:s.action.label,a=document.createElement("button");a.type="button",a.className="c-btn c-btn--ghost c-toast__action",a.textContent=t,a.addEventListener("click",t=>{if(t.stopPropagation(),"object"==typeof s.action&&"function"==typeof s.action.onClick)try{s.action.onClick()}catch(t){}e(o)}),o.appendChild(a)}const r=document.createElement("button");return r.type="button",r.className="c-toast__close",r.setAttribute("aria-label",labelText(this,"close","Close")),r.textContent="×",o.appendChild(r),r.addEventListener("click",t=>{t.stopPropagation(),e(o)}),o._arm=()=>{clearTimeout(o._timer);const t=s.duration,a=0===t?0:t>0?t:4e3;a>0&&(o._timer=setTimeout(()=>e(o),a))},o.addEventListener("mouseenter",()=>clearTimeout(o._timer)),o.addEventListener("focusin",()=>clearTimeout(o._timer)),o.addEventListener("mouseleave",o._arm),o.addEventListener("focusout",o._arm),o},e=t=>{t&&t.parentNode&&(t._timer&&(clearTimeout(t._timer),t._timer=null),t.parentNode.removeChild(t),this._toastActive===t&&(this._toastActive=null),this.dispatchEvent(new CustomEvent("contour:close",{bubbles:!0,composed:!0,detail:{message:t.textContent}})),s())},s=()=>{for(;this._toastQueue.length;){const e=this._toastQueue.shift();if(e._deduped)continue;const s=t(e.message,e.opts);this._toastActive=s,this.appendChild(s),s._arm()}};this.show=(t,o)=>{o=o||{};const a=String(null==t?"":t),i=this._toastActive;if(i&&i.dataset&&i.dataset.message===a&&""!==a){i._timer&&clearTimeout(i._timer);const t=o.duration&&o.duration>0?o.duration:4e3;return i._timer=setTimeout(()=>e(i),t),i}const r=this._toastQueue.find(t=>String(t.message)===a&&""!==a);if(r)return r.opts=Object.assign({},r.opts,o),null;const n={message:t,opts:o,_deduped:!1};return this._toastQueue.push(n),s(),this._toastActive},this.hide=()=>{this._toastActive&&e(this._toastActive),this._toastQueue.length=0,Array.from(this.querySelectorAll(".c-toast")).forEach(t=>{t._timer&&clearTimeout(t._timer),t.parentNode&&t.parentNode.removeChild(t)}),this._toastActive=null}}}define("contour-toast-host",ContourToastHost);class ContourOffline extends ContourBase{static get observed(){return["status","label"]}static get properties(){return{status:{attribute:"status"},label:{attribute:"label"}}}render(){this.classList.add("c-offline"),Array.from(this.classList).forEach(t=>{t.startsWith("c-offline--")&&this.classList.remove(t)}),this.hasAttribute("role")||this.setAttribute("role","status");const t=this.getAttribute("status")||"online";this.classList.add("c-offline--"+t);const e=this.getAttribute("label")||("offline"===t?"Offline":"queued"===t?"Changes queued":"Online");this.ensure(".c-offline__dot",()=>{const t=document.createElement("span");return t.className="c-offline__dot",t.setAttribute("aria-hidden","true"),t});this.ensure(".c-offline__text",()=>{const t=document.createElement("span");return t.className="c-offline__text",t}).textContent=e}}define("contour-offline",ContourOffline);
|
|
@@ -1225,7 +1225,7 @@ class ContourForm extends ContourBase {
|
|
|
1225
1225
|
* filled track.
|
|
1226
1226
|
*/
|
|
1227
1227
|
class ContourRange extends ContourBase {
|
|
1228
|
-
static get observed() { return ["min", "max", "value", "low", "high", "range", "sparkline", "label", "disabled", "error", "help", "name", "step"]; }
|
|
1228
|
+
static get observed() { return ["min", "max", "value", "low", "high", "range", "sparkline", "label", "disabled", "error", "help", "name", "step", "show-inputs"]; }
|
|
1229
1229
|
static get formAssociated() { return true; }
|
|
1230
1230
|
static get properties() { return { min: { attribute: "min" }, max: { attribute: "max" }, value: { attribute: "value" }, label: { attribute: "label" }, disabled: { attribute: "disabled", type: Boolean }, error: { attribute: "error" }, help: { attribute: "help" }, name: { attribute: "name" }, step: { attribute: "step" } }; }
|
|
1231
1231
|
render() {
|
|
@@ -1312,6 +1312,30 @@ class ContourRange extends ContourBase {
|
|
|
1312
1312
|
input.addEventListener("input", updateFill);
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
|
+
// U-26: optional numeric input(s) mirror the slider value(s); the host
|
|
1316
|
+
// can omit them entirely (default) for the bare slider.
|
|
1317
|
+
if (this.hasAttribute("show-inputs")) {
|
|
1318
|
+
const single = this.querySelector("input.c-range:not(.c-range__low):not(.c-range__high)");
|
|
1319
|
+
const lowInput = this.querySelector("input.c-range__low");
|
|
1320
|
+
const highInput = this.querySelector("input.c-range__high");
|
|
1321
|
+
const mkNum = (cls, srcInput, name) => {
|
|
1322
|
+
let n = this.querySelector("input." + cls);
|
|
1323
|
+
if (!n) { n = document.createElement("input"); n.type = "number"; n.className = "c-range__number " + cls; n.setAttribute("part", "number"); this.appendChild(n); }
|
|
1324
|
+
n.min = srcInput.min; n.max = srcInput.max;
|
|
1325
|
+
if (srcInput.step) n.step = srcInput.step;
|
|
1326
|
+
if (document.activeElement !== n) n.value = srcInput.value;
|
|
1327
|
+
n.dataset.rangeFor = srcInput.classList.contains("c-range__low") ? "low" : (srcInput.classList.contains("c-range__high") ? "high" : "single");
|
|
1328
|
+
n.setAttribute("aria-label", name);
|
|
1329
|
+
};
|
|
1330
|
+
if (lowInput && highInput) {
|
|
1331
|
+
mkNum("c-range__number--low", lowInput, (this.getAttribute("label") || labelText(this, "range", "Range")) + " low");
|
|
1332
|
+
mkNum("c-range__number--high", highInput, (this.getAttribute("label") || labelText(this, "range", "Range")) + " high");
|
|
1333
|
+
} else if (single) {
|
|
1334
|
+
mkNum("c-range__number--single", single, this.getAttribute("label") || labelText(this, "range", "Range"));
|
|
1335
|
+
}
|
|
1336
|
+
} else {
|
|
1337
|
+
Array.from(this.querySelectorAll(".c-range__number")).forEach((n) => n.remove());
|
|
1338
|
+
}
|
|
1315
1339
|
}
|
|
1316
1340
|
// R31-67: paint the sparkline series onto the canvas. The canvas has no
|
|
1317
1341
|
// box until it is laid out, so the first draw waits a frame; a 0-width
|
|
@@ -1357,7 +1381,9 @@ class ContourRange extends ContourBase {
|
|
|
1357
1381
|
};
|
|
1358
1382
|
// Form value (R20 T-08): single submits handle value; dual submits two entries via FormData.
|
|
1359
1383
|
ContourRange.prototype._syncFormValue = function() {
|
|
1360
|
-
|
|
1384
|
+
// jsdom does not implement ElementInternals.setFormValue; a missing API is
|
|
1385
|
+
// not a value — skip the sync rather than throw during enhance.
|
|
1386
|
+
if (!this._internals || typeof this._internals.setFormValue !== "function") return;
|
|
1361
1387
|
const low = this.querySelector("input.c-range__low");
|
|
1362
1388
|
const high = this.querySelector("input.c-range__high");
|
|
1363
1389
|
if (low && high) {
|
|
@@ -1408,6 +1434,16 @@ class ContourRange extends ContourBase {
|
|
|
1408
1434
|
this._syncFormValue();
|
|
1409
1435
|
const sync = () => { this._syncFormValue(); };
|
|
1410
1436
|
this.addEventListener("input", (e) => {
|
|
1437
|
+
// U-26: a numeric mirror drives its slider (which re-emits through this handler).
|
|
1438
|
+
const num = e.target && e.target.classList && e.target.classList.contains("c-range__number") ? e.target : null;
|
|
1439
|
+
if (num) {
|
|
1440
|
+
const which = num.dataset.rangeFor;
|
|
1441
|
+
const slider = which === "low" ? this.querySelector("input.c-range__low")
|
|
1442
|
+
: which === "high" ? this.querySelector("input.c-range__high")
|
|
1443
|
+
: this.querySelector("input.c-range:not(.c-range__low):not(.c-range__high)");
|
|
1444
|
+
if (slider) { slider.value = num.value; slider.dispatchEvent(new Event("input", { bubbles: true })); }
|
|
1445
|
+
return;
|
|
1446
|
+
}
|
|
1411
1447
|
const low = this.querySelector("input.c-range__low");
|
|
1412
1448
|
const high = this.querySelector("input.c-range__high");
|
|
1413
1449
|
const single = this.querySelector("input.c-range:not(.c-range__low):not(.c-range__high)");
|