contour-ds 1.7.2 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +244 -326
- package/dist/agent-cookbook.json +960 -0
- package/dist/agent-examples.json +65 -0
- package/dist/agent-map-wiring.json +152 -0
- package/dist/agent-rules.json +16 -0
- package/dist/build-manifest.json +344 -126
- package/dist/contour-wc-content.esm.js +1939 -0
- package/dist/contour-wc-content.esm.min.js +1 -0
- package/dist/contour-wc-core.esm.js +3724 -0
- package/dist/contour-wc-core.esm.min.js +1 -0
- package/dist/contour-wc-dashboard.esm.js +6986 -0
- package/dist/contour-wc-dashboard.esm.min.js +1 -0
- package/dist/contour-wc-data.esm.js +6572 -0
- package/dist/contour-wc-data.esm.min.js +1 -0
- package/dist/contour-wc-docs.esm.js +976 -0
- package/dist/contour-wc-docs.esm.min.js +1 -0
- package/dist/contour-wc-feedback.esm.js +1742 -0
- package/dist/contour-wc-feedback.esm.min.js +1 -0
- package/dist/contour-wc-forms.esm.js +2437 -0
- package/dist/contour-wc-forms.esm.min.js +1 -0
- package/dist/contour-wc-interaction.esm.js +1343 -0
- package/dist/contour-wc-interaction.esm.min.js +1 -0
- package/dist/contour-wc-layout.esm.js +845 -0
- package/dist/contour-wc-layout.esm.min.js +1 -0
- package/dist/contour-wc-map.esm.js +2411 -0
- package/dist/contour-wc-map.esm.min.js +1 -0
- package/dist/contour-wc-misc.esm.js +945 -0
- package/dist/contour-wc-misc.esm.min.js +1 -0
- package/dist/contour-wc-navigation.esm.js +2842 -0
- package/dist/contour-wc-navigation.esm.min.js +1 -0
- package/dist/contour-wc-ui.esm.js +6519 -0
- package/dist/contour-wc-ui.esm.min.js +1 -0
- package/dist/contour-wc.esm.js +14435 -5723
- package/dist/contour-wc.esm.min.js +1 -1
- package/dist/contour-wc.js +14436 -5725
- package/dist/contour-wc.min.js +1 -1
- package/dist/contour.a11y.json +402 -0
- package/dist/contour.code-snippets +4534 -0
- package/dist/contour.components.json +4870 -1222
- package/dist/contour.css +6672 -4711
- package/dist/contour.d.ts +753 -1085
- package/dist/contour.esm.js +440 -18
- package/dist/contour.esm.min.js +1 -1
- package/dist/contour.html-data.json +11343 -0
- package/dist/contour.js +440 -18
- package/dist/contour.min.css +1 -1
- package/dist/contour.min.js +1 -1
- package/dist/contour.react.d.ts +422 -0
- package/dist/contour.single.html +17 -0
- package/dist/contour.single.min.css +1 -0
- package/dist/contour.themes.json +56 -12
- package/dist/contour.tokens.json +1318 -1053
- package/dist/contour.vue.d.ts +420 -0
- package/dist/contour.web-types.json +11703 -0
- package/dist/custom-elements.json +36120 -0
- package/dist/docs/actions.md +16 -6
- package/dist/docs/affordances.md +21 -85
- package/dist/docs/apireference.md +9 -5
- package/dist/docs/colour.md +10 -4
- package/dist/docs/componentindex.md +9 -22
- package/dist/docs/data.md +39 -58
- package/dist/docs/docs.md +12 -7
- package/dist/docs/feedback.md +30 -12
- package/dist/docs/field.md +28 -13
- package/dist/docs/forms.md +35 -19
- package/dist/docs/index.json +70 -61
- package/dist/docs/install.md +12 -7
- package/dist/docs/landing.md +7 -4
- package/dist/docs/mapengine.md +30 -8
- package/dist/docs/motion.md +12 -6
- package/dist/docs/navigation.md +31 -7
- package/dist/docs/overlays.md +32 -25
- package/dist/docs/overview.md +3 -2
- package/dist/docs/patterns.md +20 -10
- package/dist/docs/playground.md +11 -4
- package/dist/docs/principles.md +8 -6
- package/dist/docs/recipes.md +117 -13
- package/dist/docs/space.md +10 -6
- package/dist/docs/status.md +13 -14
- package/dist/docs/surfaces.md +17 -22
- package/dist/docs/theming.md +18 -32
- package/dist/docs/type.md +12 -5
- package/dist/docs/webcomponents.md +75 -33
- package/dist/hljs.css +1 -20
- package/dist/map-chrome.mapbox.css +68 -92
- package/dist/map-chrome.maplibre.css +68 -92
- package/dist/registry/items/contour-core.json +2 -2
- package/dist/registry/items/contour-data.json +2 -2
- package/dist/registry/items/contour-docs.json +2 -2
- package/dist/registry/items/contour-landing.json +2 -2
- package/dist/registry/registry.json +8 -8
- package/dist/surfaces/contour-core.min.css +1 -1
- package/dist/surfaces/contour-data.min.css +1 -1
- package/dist/surfaces/contour-docs.min.css +1 -1
- package/dist/surfaces/contour-landing.min.css +1 -1
- package/dist/svg/icons.svg +367 -0
- package/dist/wc/behaviours.mjs +222 -192
- package/dist/wc/content.mjs +486 -142
- package/dist/wc/core.mjs +917 -395
- package/dist/wc/dashboard.mjs +252 -25
- package/dist/wc/data-chart.mjs +1333 -0
- package/dist/wc/data-export.mjs +391 -0
- package/dist/wc/data-gauge.mjs +779 -0
- package/dist/wc/data-geo.mjs +696 -0
- package/dist/wc/data-glyphs.mjs +133 -0
- package/dist/wc/data-legend.mjs +431 -0
- package/dist/wc/data-readout.mjs +227 -0
- package/dist/wc/data-series.mjs +1004 -0
- package/dist/wc/data-table.mjs +751 -0
- package/dist/wc/data.mjs +15 -3707
- package/dist/wc/docs.mjs +113 -19
- package/dist/wc/feedback.mjs +320 -116
- package/dist/wc/forms-controls.mjs +635 -0
- package/dist/wc/forms-field.mjs +547 -0
- package/dist/wc/forms-groups.mjs +347 -0
- package/dist/wc/forms-input.mjs +292 -0
- package/dist/wc/forms.mjs +10 -1122
- package/dist/wc/glyph.mjs +204 -0
- package/dist/wc/index.mjs +16 -7
- package/dist/wc/interaction.mjs +322 -75
- package/dist/wc/layout.mjs +100 -29
- package/dist/wc/map.mjs +888 -285
- package/dist/wc/misc.mjs +137 -26
- package/dist/wc/navigation-menu.mjs +735 -0
- package/dist/wc/navigation-shell.mjs +495 -0
- package/dist/wc/navigation-tree.mjs +995 -0
- package/dist/wc/navigation.mjs +9 -1636
- package/dist/wc/registration.mjs +1 -8
- package/dist/wc/shadow.mjs +285 -113
- package/dist/wc/states.mjs +75 -78
- package/dist/wc/svg.mjs +209 -34
- package/dist/wc/ui-atoms.mjs +608 -0
- package/dist/wc/ui-data.mjs +1404 -0
- package/dist/wc/ui-feedback.mjs +419 -0
- package/dist/wc/ui-inputs.mjs +1570 -0
- package/dist/wc/ui-menus.mjs +307 -0
- package/dist/wc/ui-overlays.mjs +1605 -0
- package/integrations/README.md +25 -5
- package/integrations/ai/CLAUDE.md +6 -3
- package/integrations/ai/COPILOT.md +14 -0
- package/integrations/ai/GEMINI.md +14 -0
- package/integrations/ai/WINDSURF.md +14 -0
- package/integrations/ai/v0-prompt.md +13 -1
- package/integrations/frameworks/README.md +235 -0
- package/integrations/native/README.md +0 -3
- package/integrations/native/style-dictionary.config.json +1 -1
- package/integrations/tailwind/contour-theme.css +71 -13
- package/integrations/validate-markup.mjs +172 -0
- package/package.json +103 -39
- package/dist/wc/ui.mjs +0 -3560
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CLASS_ONLY,CONTOUR_EVENTS,ContourBase,MERCATOR_MAX_LAT,MODS,OBSERVED,REGISTERED,applyLabel,bearing,clampLat,contourId,cssLength,define,flagOn,flagOnValue,formatValue,haversine,headingTag,iconMarkup,isRtl,labelText,levelFromAttributes,mercatorResolution,navKey,normaliseLng,onDispose,safeColor,safeHref,sanitizeHtml,setHTML,simple,statusIcon,supportsUntilFound,unwrapBounds,warnBadJson,wcEmitOverlay,withBrownout,MARKER_SHAPES,arcPath,assignMarkers,barRects,compassNeedle,contourPaths,donutSlices,isMissing,marchingSquares,markerStyles,niceTicks,polylinePoints,scaleBarTicks,smoothPath,modalContain,wcReset,wireCombobox,wireCopy,wireMenu,wirePagination,wireRemovable,wireSegmented,wireTabs,wireTree,STATE_FALLBACK,loadRemote,parseArrayAttr,remoteData,remoteInvalidate,remoteRefresh,remoteVisible,renderEmpty,renderStates,stateLabel,watchViewport,wireStates}from"./contour-wc-core.esm.js";define("contour-box",simple(["c-box"])),define("contour-cluster",simple(["c-cluster"])),define("contour-container",simple(["c-container"])),define("contour-row",simple(["c-row"])),define("contour-scrim",simple(["c-scrim"])),define("contour-stack",simple(["c-stack"]));const assignedText=t=>{const e=t.querySelector("slot");return(e?e.assignedElements({flatten:!0}):[]).map(t=>(t.textContent||"").trim()).join(" ").trim()||(t.textContent||"").trim()};let ADOPTED=null,ADOPTED_KEY="";const _hashCss=t=>{let e=2166136261;for(let a=0;a<t.length;a++)e^=t.charCodeAt(a),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 a="-1";try{const t=e.cssRules;let s="";for(let e=0;e<t.length;e++)s+=t[e].cssText+"\n";a=t.length+":"+_hashCss(s)}catch(t){}t+=(e.href||"inline")+"~"+a+"|"}if(ADOPTED&&t===ADOPTED_KEY)return ADOPTED;ADOPTED_KEY=t,ADOPTED=[];const e=(t,a)=>{let s;try{s=t.cssRules}catch(t){return}if(s)for(const t of s)if(t instanceof CSSImportRule)t.styleSheet&&e(t.styleSheet,a);else try{a.push(t.cssText)}catch(t){}};for(const t of document.styleSheets)try{if(!t.href||new URL(t.href).origin===location.origin){const a=[];e(t,a);const s=new CSSStyleSheet;a.length&&s.replaceSync(a.join("\n")),ADOPTED.push(s)}}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 a=e.getAttribute("aria-controls");if(a){const s=t.querySelector("#"+CSS.escape(a))||document.getElementById(a);s&&!s.hasAttribute("aria-labelledby")&&(e.id||(e.id=contourId("tab")),s.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 a=e.querySelector(".c-field__hint");a&&(a.id||(a.id=contourId("hint")),t.setAttribute("aria-describedby",a.id));const s=e.querySelector(".c-field__error");if(s){s.id||(s.id=contourId("err"));const e=t.getAttribute("aria-describedby")||"";t.setAttribute("aria-describedby",(e+" "+s.id).trim())}}}),t.querySelectorAll(".c-alert").forEach(t=>{const e=t.classList.contains("c-alert--warning")||t.classList.contains("c-alert--danger"),a=e?"alert":"status",s=e?"assertive":"polite";t.hasAttribute("role")&&!t.dataset.contourAutoRole||(t.setAttribute("role",a),t.dataset.contourAutoRole=a),t.hasAttribute("aria-live")&&!t.dataset.contourAutoLive||(t.setAttribute("aria-live",s),t.dataset.contourAutoLive=s)}),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"),a=t.closest(".c-field")||t.parentElement,s=[];if(e)for(const t of e.assignedElements({flatten:!0}))t.matches("input, textarea, select")&&s.push(t);if(!s.length&&a){const t=a.querySelector('slot[name="input"]');if(t)for(const e of t.assignedElements({flatten:!0}))e.matches("input, textarea, select")&&s.push(e)}for(const e of s){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 a=assignedText(t);a&&e.setAttribute("aria-label",a)}if(e._contourLabelWired||(e._contourLabelWired=!0,t.addEventListener("click",t=>{if(!t.target.closest("a, button, input, textarea, select"))try{e.click()}catch(t){}})),a&&!e.hasAttribute("aria-describedby")){const t=a.querySelector(".c-field__hint"),s=a.querySelector(".c-field__error"),r=[];t&&(t.id||(t.id=contourId("hint")),r.push(t.id)),s&&(s.id||(s.id=contourId("err")),r.push(s.id)),r.length&&e.setAttribute("aria-describedby",r.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,a,s)=>{const r=t.querySelector(e);r&&r.setAttribute("aria-label",labelText(this,a,s))};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 a=t.querySelector(".c-install__copy, .c-code__copy");a&&"Copy"===a.textContent.trim()&&(a.textContent=labelText(this,"copy","Copy"))}applyMods(){const t=this.shadowRoot.firstElementChild;if(!t||!this._shadowBase)return;const e=[];for(const t of MODS){const a=this.getAttribute(t);if(a)for(const t of this._shadowBase.split(/\s+/))t&&e.push("c-"+t.replace(/^c-/,"")+"--"+a)}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"),a=e?"alert":"status",s=e?"assertive":"polite";t.hasAttribute("role")&&!t.dataset.contourAutoRole||(t.setAttribute("role",a),t.dataset.contourAutoRole=a),t.hasAttribute("aria-live")&&!t.dataset.contourAutoLive||(t.setAttribute("aria-live",s),t.dataset.contourAutoLive=s)}}}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 a=document.createElement("template");setHTML(a,e);const s=class extends ContourShadow{};s.contourTemplate=a,define(t,s)},slotWrapper=(t,e,a)=>"<"+t+' class="c-'+e+'" part="'+(a||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 a of e){shadow("contour-shadow-"+a,slotWrapper(t,a,SHADOW_PARTS[a]||a))}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"),a=t.querySelector('[part="close"]');if(a&&a.addEventListener("click",()=>e?.close()),e){let t=null;e.addEventListener("beforetoggle",a=>{if("open"===a.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 s=e.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])");if(s)try{s.focus()}catch(a){}}else if("closed"===a.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(a){}});const a=()=>{const t="button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])",a=Array.from(e.querySelectorAll(t));for(const s of e.querySelectorAll("slot"))for(const e of s.assignedElements({flatten:!0})){e.matches(t)&&a.push(e);for(const s of e.querySelectorAll(t))a.push(s)}return a},s=()=>this.shadowRoot&&this.shadowRoot.activeElement||document.activeElement;e.addEventListener("keydown",t=>{if("Tab"!==t.key)return;const e=a();if(!e.length)return;const r=e[0],o=e[e.length-1];t.shiftKey&&s()===r?(t.preventDefault(),o.focus()):t.shiftKey||s()!==o||(t.preventDefault(),r.focus())})}}static get observedAttributes(){return[...super.observedAttributes,"open"]}attributeChangedCallback(t,e,a){if(super.attributeChangedCallback(t,e,a),"open"===t&&this.shadowRoot&&!this._syncingOpenAttr){const t=this.shadowRoot.querySelector("dialog");t&&(null===a||t.open?null===a&&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="",a="")=>{const s=SHADOW_MARKUP[t];if("string"!=typeof s)return null;return`<${t}${e?e.startsWith(" ")?e:" "+e:""}><template shadowrootmode="open">${s}</template>${a}</${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};const SHAPES=new Set(["point","line","polygon","raster","heatmap","symbol"]);function wireMapItems(t,e,a){if(t._wiredMapItems)return;t._wiredMapItems=!0;const s=()=>Array.from(t.querySelectorAll(e)),r=s=>{const r=t.querySelector(a);if(!r)return;const o=s&&s.target&&"function"==typeof s.target.closest?s.target.closest(e):null;if(!o||!t.contains(o))return void r.setAttribute("hidden","");const i=o.getAttribute("data-title")||o.getAttribute("title");i&&(r.textContent=i);const n=t.getBoundingClientRect(),l=o.getBoundingClientRect();r.style.setProperty("--chart-tip-inline-start",l.left-n.left+l.width/2+"px"),r.style.setProperty("--chart-tip-block-start",l.top-n.top+"px"),r.removeAttribute("hidden")},o=()=>{const e=t.querySelector(a);e&&e.setAttribute("hidden","")};t.addEventListener("mouseover",r),t.addEventListener("mouseout",e=>{e.relatedTarget&&t.contains(e.relatedTarget)||o()}),t.addEventListener("focusin",a=>{const s=a&&a.target&&"function"==typeof a.target.closest?a.target.closest(e):null;s&&t.contains(s)&&r({target:s})}),t.addEventListener("focusout",e=>{t.contains(e.relatedTarget)||o()}),t.addEventListener("click",a=>{const r=a&&a.target&&"function"==typeof a.target.closest?a.target.closest(e):null;if(!r||!t.contains(r))return;const o=s().indexOf(r);o<0||t.dispatchEvent(new CustomEvent("contour:select",{bubbles:!0,composed:!0,detail:{index:o,label:r.getAttribute("data-title")||r.getAttribute("title")||r.textContent.trim()}}))}),t.addEventListener("keydown",a=>{const r=a&&a.target&&"function"==typeof a.target.closest?a.target.closest(e):null;if(r&&t.contains(r))if("Enter"===a.key||" "===a.key){a.preventDefault();const e=s().indexOf(r);e>=0&&t.dispatchEvent(new CustomEvent("contour:select",{bubbles:!0,composed:!0,detail:{index:e,label:r.getAttribute("data-title")||r.getAttribute("title")||r.textContent.trim()}}))}else{const e=s();navKey(a,e,{wrap:!1,homeEnd:!0,rtl:isRtl(t),onNavigate:t=>e.forEach((e,a)=>e.setAttribute("tabindex",a===t?"0":"-1"))})}})}class ContourMinimap extends ContourBase{static get observed(){return["label","viewport","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{label:{attribute:"label"},viewport:{attribute:"viewport"},src:{attribute:"src"}}}render(){if(this.classList.add("c-minimap"),this.hasAttribute("role")||this.setAttribute("role","img"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||"Minimap"),wireStates(this),loadRemote(this,["label","viewport"]),renderStates(this,"minimap"))return;const t=remoteData(this,"label")||this._remoteData&&this._remoteData.label,e=remoteData(this,"viewport")||this._remoteData&&(this._remoteData.viewport||this._remoteData.value);if(t||e){if(t){this.ensure(".c-minimap__label",()=>{const t=document.createElement("span");return t.className="c-minimap__label",t}).textContent=t}else{const t=this.querySelector(".c-minimap__label");t&&t.remove()}if(e){this.ensure(".c-minimap__viewport",()=>{const t=document.createElement("div");return t.className="c-minimap__viewport",t}).textContent=e}else{const t=this.querySelector(".c-minimap__viewport");t&&t.remove()}}else renderEmpty(this,"minimap")}enhance(){if(this._wiredMinimap)return;this._wiredMinimap=!0,this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");let t=!1,e=0,a=0;this.addEventListener("pointerdown",s=>{const r=this.querySelector(".c-minimap__viewport");if(r&&r.contains(s.target)){t=!0,e=s.clientX,a=s.clientY;try{r.setPointerCapture(s.pointerId)}catch(t){}}}),this.addEventListener("pointermove",s=>{if(!t)return;const r=s.clientX-e,o=s.clientY-a;this.dispatchEvent(new CustomEvent("contour:move",{detail:{direction:"drag",dx:r,dy:o},bubbles:!0,composed:!0}))}),this.addEventListener("pointerup",()=>{t=!1}),this.addEventListener("keydown",t=>{let e=null;"ArrowUp"===t.key?e="up":"ArrowDown"===t.key?e="down":"ArrowLeft"===t.key?e="left":"ArrowRight"===t.key?e="right":"Home"===t.key?e="home":"End"===t.key&&(e="end"),e&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:move",{detail:{direction:e},bubbles:!0,composed:!0})))})}}define("contour-minimap",ContourMinimap);class ContourCoordinate extends ContourBase{static get observed(){return["value","format","locale","precision","live","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{value:{attribute:"value"},format:{attribute:"format"},locale:{attribute:"locale"},precision:{attribute:"precision"},live:{attribute:"live"},src:{attribute:"src"}}}render(){if(this.classList.add("c-coordinate"),wireStates(this),loadRemote(this,"value"),renderStates(this,"coordinate"))return;const t=remoteData(this,"value")||this._remoteData&&(this._remoteData.value||this._remoteData.coordinate);if(!t)return void renderEmpty(this,"coordinate");const e=this.getAttribute("format")||"decimal";let a=String(t);if("dms"===e){const e=String(t).split(/[,\s]+/).map(Number);if(e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])){const t=parseInt(this.getAttribute("precision")||"1",10),s=Number.isFinite(t)&&t>=0?t:1,r=(t,e)=>{const a=Math.floor(Math.abs(t)),r=Math.floor(60*(Math.abs(t)-a)),o="lat"===e?t<0?"S":"N":t<0?"W":"E";return a+"°"+r+"'"+(60*(60*(Math.abs(t)-a)-r)).toFixed(s)+'"'+o};a=r(e[0],"lat")+" "+r(e[1],"lon")}}else if("web-mercator"===e){const e=String(t).split(/[,\s]+/).map(Number);if(e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])){const t=20037508.34*e[1]/180,s=Math.log(Math.tan((90+e[0])*Math.PI/360))/(Math.PI/180)*20037508.34/180;a=t.toFixed(2)+", "+s.toFixed(2)}}else if("decimal"===e){const e=String(t).split(/[,\s]+/).map(Number),s=parseInt(this.getAttribute("precision")||"",10);a=e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])&&Number.isFinite(s)&&s>=0?e[0].toFixed(s)+", "+e[1].toFixed(s):formatValue(t,this.getAttribute("format"),this.getAttribute("locale"))}else a=formatValue(t,this.getAttribute("format"),this.getAttribute("locale"));const s=this.ensure(".c-coordinate__value",()=>{const t=document.createElement("span");return t.className="c-coordinate__value",t});this.hasAttribute("live")?(s.setAttribute("role","status"),s.setAttribute("aria-live","polite")):(s.removeAttribute("role"),s.removeAttribute("aria-live")),s.textContent=a;let r=this.querySelector(".c-coordinate__copy");function o(t){try{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}catch(t){}}r||(r=document.createElement("button"),r.type="button",r.className="c-btn c-btn--sm c-btn--icon c-coordinate__copy",setHTML(r,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-copy" /></svg>'),r.setAttribute("aria-label",labelText(this,"copy-coordinate","Copy coordinate")),r.setAttribute("data-contour-label","true"),this.appendChild(r)),r.onclick=()=>{try{navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(a).catch(()=>{o(a)}):o(a)}catch(t){o(a)}this.dispatchEvent(new CustomEvent("contour:copy",{detail:{text:a},bubbles:!0,composed:!0}))}}}define("contour-coordinate",ContourCoordinate);class ContourLayerPanel extends ContourBase{static get observed(){return["label","items","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","allow-rename","allow-remove","allow-duplicate","allow-zoom","allow-opacity","allow-reorder","allow-projection","cache-key","no-cache"]}static get properties(){return{label:{attribute:"label"},items:{attribute:"items"},src:{attribute:"src"}}}render(){if(this.classList.add("c-layer-panel"),this.setAttribute("role","group"),this.setAttribute("aria-label",labelText(this,"layer-panel","Layer panel")),this._layerIdSeen=new Set,wireStates(this),loadRemote(this,"items"),renderStates(this,"layer-panel"))return;const t=remoteData(this,"items"),e=this.getAttribute("label");if(e){this.ensure(".c-layer-panel__label",()=>{const t=document.createElement("span");return t.className="c-layer-panel__label",t}).textContent=e}else{const t=this.querySelector(".c-layer-panel__label");t&&t.remove()}const a=Array.from(this.querySelectorAll(":scope > .c-layer-panel__item")),s=new Map,r=new Map;this.querySelectorAll(".c-layer-panel__item").forEach(t=>{const e=t.querySelector(".c-layer-panel__name"),a=t.querySelector(".c-layer-panel__toggle");if(e&&a){const t=a.hasAttribute("aria-pressed")?"true"===a.getAttribute("aria-pressed"):!!a.checked;s.set(e.textContent,t)}const o=t.querySelector(".c-layer-panel__opacity");e&&o&&r.set(e.textContent,o.value)});let o=null;if(a.length)o=a.map(t=>{const e=t.querySelector(".c-layer-panel__name"),a=t.querySelector(".c-layer-panel__toggle"),s=!a||(a.hasAttribute("aria-pressed")?"true"===a.getAttribute("aria-pressed"):!!a.checked),r=t.querySelector(".c-layer-panel__caption");return{name:e?e.textContent:"",visible:s,caption:r?r.textContent:t.dataset.caption||void 0}}),a.forEach(t=>t.remove());else if(t)try{o=JSON.parse(t),Array.from(this.querySelectorAll(".c-layer-panel__item")).forEach(t=>t.remove())}catch(t){warnBadJson(this,"attribute",t)}o&&o.forEach(t=>{const e="string"==typeof t?t:t.name||t.label||"",a="object"==typeof t&&t&&(t.caption||t.subtitle)||"";null==this._layerIdByName&&(this._layerIdByName=new Map);const o="object"==typeof t&&t&&t.id?String(t.id):"";let i;if(o)i=o;else if(this._layerIdByName.has(e))i=this._layerIdByName.get(e);else{i=(e?e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""):"")||"layer",this._layerIdByName.set(e,i)}if(null==this._layerIdSeen&&(this._layerIdSeen=new Set),this._layerIdSeen.has(i)){let t=2;for(;this._layerIdSeen.has(i+"-"+t);)t++;i=i+"-"+t}this._layerIdSeen.add(i);const n=document.createElement("div");if(n.className="c-layer-panel__item"+(t.dragging?" c-layer-panel__item--dragging":""),n.dataset.layerId=i,"false"!==this.getAttribute("allow-reorder")){const t=document.createElement("button");t.type="button",t.className="c-drag-handle--dots",t.setAttribute("aria-label",labelText(this,"reorder","Reorder")+" "+(e||labelText(this,"layer","layer"))),t.setAttribute("tabindex","0"),n.appendChild(t)}const l=document.createElement("button");l.type="button",l.className="c-layer-panel__toggle",l.setAttribute("part","visibility-toggle"),l.setAttribute("aria-label",labelText(this,"toggle","Toggle")+" "+(e||labelText(this,"layer","layer")));const c=s.has(e)?s.get(e):"object"==typeof t&&!1!==t.visible;l.setAttribute("aria-pressed",String(!!c)),l.checked=!!c,setHTML(l,c?'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-check" /></svg>':'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-minus" /></svg>'),n.appendChild(l);const d=document.createElement("span");if(d.className="c-layer-panel__name",d.textContent=e,n.appendChild(d),a){const t=document.createElement("span");t.className="c-layer-panel__caption",t.textContent=a,n.appendChild(t)}if("false"!==this.getAttribute("allow-opacity")){const a=document.createElement("input");a.type="range",a.className="c-layer-panel__opacity",a.min="0",a.max="100",a.setAttribute("aria-label",labelText(this,"opacity-of","Opacity of")+" "+(e||"layer")),a.value=r.has(e)?r.get(e):"object"==typeof t&&null!=t.opacity?t.opacity:"100",n.appendChild(a)}if("false"!==this.getAttribute("allow-rename")){const t=document.createElement("button");t.type="button",t.className="c-btn c-btn--icon c-btn--ghost c-btn--sm c-layer-panel__rename",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-pen" /></svg>'),t.setAttribute("aria-label",labelText(this,"rename","Rename")+" "+(e||"layer")),n.appendChild(t)}if("false"!==this.getAttribute("allow-duplicate")){const t=document.createElement("button");t.type="button",t.className="c-btn c-btn--icon c-btn--ghost c-btn--sm c-layer-panel__duplicate",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-copy" /></svg>'),t.setAttribute("aria-label",labelText(this,"duplicate","Duplicate")+" "+(e||"layer")),n.appendChild(t)}if("false"!==this.getAttribute("allow-zoom")){const t=document.createElement("button");t.type="button",t.className="c-layer-panel__zoom",t.textContent=labelText(this,"zoom","Zoom"),t.setAttribute("aria-label",labelText(this,"zoom-to","Zoom to")+" "+(e||"layer")),n.appendChild(t)}if("false"!==this.getAttribute("allow-remove")){const t=document.createElement("button");t.type="button",t.className="c-layer-panel__remove",setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-minus" /></svg>'),t.setAttribute("aria-label",labelText(this,"remove","Remove")+" "+(e||"layer")),n.appendChild(t)}if(this.hasAttribute("allow-projection")&&"false"!==this.getAttribute("allow-projection")){const t=document.createElement("select");t.className="c-select c-layer-panel__projection",t.setAttribute("aria-label",labelText(this,"projection-of","Projection of")+" "+(e||labelText(this,"layer","layer"))),["EPSG:4326","EPSG:3857"].forEach(e=>{const a=document.createElement("option");a.value=e,a.textContent=e,t.appendChild(a)}),n.appendChild(t)}this.appendChild(n)}),o||a.length||t||(Array.from(this.querySelectorAll(".c-layer-panel__item")).forEach(t=>t.remove()),renderEmpty(this,"layer-panel"))}enhance(){if(this._wiredLayerPanel)return;this._wiredLayerPanel=!0;const t=t=>t&&t.dataset&&t.dataset.layerId||"";this.addEventListener("change",e=>{const a=e.target&&e.target.closest?e.target.closest(".c-layer-panel__item"):null;if(!a||!this.contains(a))return;const s=a.querySelector(".c-layer-panel__name")?.textContent||"",r=t(a);if(e.target.classList.contains("c-layer-panel__toggle")){const t="boolean"==typeof e.target.checked?e.target.checked:"true"!==e.target.getAttribute("aria-pressed");e.target.checked=t,e.target.setAttribute("aria-pressed",String(t)),setHTML(e.target,t?'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-check" /></svg>':'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-minus" /></svg>'),this.dispatchEvent(new CustomEvent("contour:layer-visibility",{bubbles:!0,composed:!0,detail:{layerId:r,name:s,visible:t}}))}else e.target.classList.contains("c-layer-panel__opacity")?this.dispatchEvent(new CustomEvent("contour:layer-opacity",{bubbles:!0,composed:!0,detail:{layerId:r,name:s,opacity:Number(e.target.value)}})):e.target.classList.contains("c-layer-panel__projection")&&this.dispatchEvent(new CustomEvent("contour:layer-projection",{bubbles:!0,composed:!0,detail:{layerId:r,name:s,projection:e.target.value}}))}),this.addEventListener("input",e=>{const a=e.target;if(!a||!a.classList||!a.classList.contains("c-layer-panel__opacity"))return;const s=a.closest(".c-layer-panel__item");if(!s||!this.contains(s))return;const r=s.querySelector(".c-layer-panel__name")?.textContent||"";this.dispatchEvent(new CustomEvent("contour:layer-opacity",{bubbles:!0,composed:!0,detail:{layerId:t(s),name:r,opacity:Number(a.value)}}))}),this.addEventListener("click",e=>{const a=e.target&&e.target.closest?e.target.closest("button"):null;if(!a||!this.contains(a))return;const s=a.closest(".c-layer-panel__item");if(a.classList.contains("c-layer-panel__toggle")){if(!s)return;const e=s.querySelector(".c-layer-panel__name")?.textContent||"",r=t(s),o="true"!==a.getAttribute("aria-pressed");return a.setAttribute("aria-pressed",String(o)),a.checked=o,setHTML(a,o?'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-check" /></svg>':'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-minus" /></svg>'),void this.dispatchEvent(new CustomEvent("contour:layer-visibility",{bubbles:!0,composed:!0,detail:{layerId:r,name:e,visible:o}}))}if(!s)return;const r=s.querySelector(".c-layer-panel__name")?.textContent||"",o=t(s);if(a.classList.contains("c-layer-panel__rename")){const t=s.querySelector(".c-layer-panel__name");if(t){const e=document.createElement("input");e.type="text",e.className="c-input c-layer-panel__rename-input",e.value=r,e.setAttribute("aria-label",labelText(this,"rename-layer","Rename layer")),t.replaceWith(e),e.focus(),e.select();let a=!1;const s=()=>{if(a)return;if(!e.isConnected)return;a=!0;const t=(e.value||"").trim(),s=document.createElement("span");s.className="c-layer-panel__name",s.textContent=t||r,e.replaceWith(s),t&&t!==r&&(null==this._layerIdByName&&(this._layerIdByName=new Map),this._layerIdByName.set(t,o),this.dispatchEvent(new CustomEvent("contour:layer-rename",{bubbles:!0,composed:!0,detail:{layerId:o,name:r,newName:t}})))};e.addEventListener("keydown",t=>{"Enter"===t.key?(t.preventDefault(),s()):"Escape"===t.key&&(t.preventDefault(),e.value=r,s())}),e.addEventListener("blur",s,{once:!0})}}else a.classList.contains("c-layer-panel__duplicate")?this.dispatchEvent(new CustomEvent("contour:layer-duplicate",{bubbles:!0,composed:!0,detail:{layerId:o,name:r}})):a.classList.contains("c-layer-panel__zoom")?this.dispatchEvent(new CustomEvent("contour:layer-zoom",{bubbles:!0,composed:!0,detail:{layerId:o,name:r}})):a.classList.contains("c-layer-panel__remove")&&this.dispatchEvent(new CustomEvent("contour:layer-remove",{bubbles:!0,composed:!0,detail:{layerId:o,name:r}}))}),this.addEventListener("keydown",t=>{if(t.target&&t.target.classList&&t.target.classList.contains("c-layer-panel__toggle")&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void t.target.click();const e=t.target&&t.target.closest?t.target.closest(".c-layer-panel__item"):null;if(!e||!this.contains(e))return;const a=t.target&&t.target.classList&&t.target.classList.contains("c-drag-handle--dots");if(a&&("ArrowUp"===t.key||"ArrowDown"===t.key)||t.altKey&&("ArrowUp"===t.key||"ArrowDown"===t.key)){t.preventDefault();const s=Array.from(this.querySelectorAll(".c-layer-panel__item")),r=s.indexOf(e);if(r<0)return;const o="ArrowUp"===t.key?-1:1,i=r+o;if(i<0||i>=s.length)return;e.classList.add("c-layer-panel__item--dragging"),o<0?this.insertBefore(e,s[i]):this.insertBefore(s[i],e),(a?t.target:e).focus(),setTimeout(()=>e.classList.remove("c-layer-panel__item--dragging"),200);const n=Array.from(this.querySelectorAll(".c-layer-panel__item")).map((t,e)=>t.dataset.layerId||t.getAttribute("data-layer-id")||String(e));this.dispatchEvent(new CustomEvent("contour:layer-reorder",{bubbles:!0,composed:!0,detail:{layerIds:n}}))}})}}define("contour-layer-panel",ContourLayerPanel);class ContourTimeSlider extends ContourBase{static get observed(){return["label","value","min","max","loop","speed","speeds","show-loop","loop-label","current-time","time-format","is-playing","play-label","pause-label","time-label","speed-label"]}static get properties(){return{label:{attribute:"label"},value:{attribute:"value"},min:{attribute:"min"},max:{attribute:"max"},distance:{attribute:"distance"},resolution:{attribute:"resolution"},latitude:{attribute:"latitude"},src:{attribute:"src"},loop:{attribute:"loop",type:Boolean},speed:{attribute:"speed"},speeds:{attribute:"speeds"},showLoop:{attribute:"show-loop",type:Boolean},loopLabel:{attribute:"loop-label"},currentTime:{attribute:"current-time"},timeFormat:{attribute:"time-format"},isPlaying:{attribute:"is-playing",type:Boolean},playLabel:{attribute:"play-label"},pauseLabel:{attribute:"pause-label"},timeLabel:{attribute:"time-label"},speedLabel:{attribute:"speed-label"}}}render(){this.classList.add("c-time-slider"),this.hasAttribute("role")||this.setAttribute("role","group"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||"Time slider");const t=this.ensure(".c-time-slider__play",()=>{const t=document.createElement("button");t.className="c-time-slider__play",t.type="button",t.setAttribute("aria-label",this.getAttribute("play-label")||"Play"),t.setAttribute("data-state","play");const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("aria-hidden","true");const a=document.createElementNS("http://www.w3.org/2000/svg","use");return a.setAttribute("href","#i-play"),e.appendChild(a),t.appendChild(e),t}),e=this.ensure(".c-time-slider__track",()=>{const t=document.createElement("input");return t.className="c-time-slider__track",t.type="range",t.min="0",t.max="100",t.setAttribute("part","input"),t.setAttribute("aria-label",this.getAttribute("time-label")||"Time"),t});e.min=this.getAttribute("min")||"0",e.max=this.getAttribute("max")||"100";const a=this.getAttribute("value")||"0";this._timeSliderAttrLast!==a&&(e.value=a,this._timeSliderAttrLast=a),e.setAttribute("aria-label",this.getAttribute("label")||this.getAttribute("time-label")||"Time");const s=this.ensure(".c-time-slider__time",()=>{const t=document.createElement("span");return t.className="c-time-slider__time",t}),r=this.getAttribute("current-time"),o=this.getAttribute("time-format");r?(s.textContent=r,e.setAttribute("aria-valuetext",r)):o?(s.textContent=formatValue(String(e.value),o),e.removeAttribute("aria-valuetext")):(s.textContent=String(e.value),e.removeAttribute("aria-valuetext"));const i=this.ensure("datalist",()=>document.createElement("datalist"));i.id||(i.id=contourId("time-slider-ticks")),setHTML(i,"");const n=Number(e.min)||0,l=Number(e.max)||100;for(let t=0;t<5;t++){const e=document.createElement("option");e.value=String(Math.round(n+t/4*(l-n))),i.appendChild(e)}e.setAttribute("list",i.id),i.parentNode!==this&&this.appendChild(i);let c=null;const d=this.getAttribute("speeds");if(d)try{c=JSON.parse(d)}catch(t){c=null}const u=this.ensure(".c-time-slider__speed",()=>{const t=document.createElement("select");return t.className="c-select c-time-slider__speed",t.setAttribute("aria-label",this.getAttribute("speed-label")||"Speed"),t});setHTML(u,"");(Array.isArray(c)?c:[.5,1,2,5,10]).forEach(t=>{const e=document.createElement("option");e.value=String(t),e.textContent=String(t),String(t)===(this.getAttribute("speed")||"")&&(e.selected=!0),u.appendChild(e)});const h=this.getAttribute("speed");h&&(u.value=h);if(this.hasAttribute("show-loop")){const t=this.ensure(".c-time-slider__loop",()=>{const t=document.createElement("button");return t.className="c-time-slider__loop",t.type="button",t.setAttribute("aria-label",this.getAttribute("loop-label")||"Loop"),t});t.setAttribute("aria-pressed",this.hasAttribute("loop")?"true":"false"),setHTML(t,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-refresh" /></svg>')}else{const t=this.querySelector(".c-time-slider__loop");t&&t.remove()}const m=this.hasAttribute("is-playing");t.setAttribute("data-state",m?"pause":"play"),t.setAttribute("aria-label",m?this.getAttribute("pause-label")||"Pause":this.getAttribute("play-label")||"Play");const p=t.querySelector("use");p&&p.setAttribute("href",m?"#i-pause":"#i-play")}enhance(){if(this._timeSliderReconcile&&this._timeSliderReconcile(),this._wiredTimeSlider)return;let t;this._wiredTimeSlider=!0;const e=()=>{void 0!==t&&(clearInterval(t),t=void 0)},a=()=>{const t=this.querySelector(".c-time-slider__track");if(!t)return;const e=this.querySelector(".c-time-slider__time"),a=this.getAttribute("current-time"),s=this.getAttribute("time-format");e&&(e.textContent=a||(s?formatValue(String(t.value),s):String(t.value))),a?t.setAttribute("aria-valuetext",a):t.removeAttribute("aria-valuetext")},s=()=>{const t=this.querySelector(".c-time-slider__track");if(!t)return void e();const s=Number(t.max)||100,r=Number(t.min)||0,o=this.hasAttribute("loop");let i=(Number(t.value)||0)+1;i>s&&(i=o?r:s),t.value=String(i);const n=this.querySelector(".c-time-slider__speed");this._timeSliderScrubbing||n&&document.activeElement===n||this.setAttribute("value",String(i)),a(),this.dispatchEvent(new CustomEvent("contour:time-change",{detail:{value:String(i)},bubbles:!0,composed:!0})),!o&&i>=s&&(e(),this.removeAttribute("is-playing"),this.dispatchEvent(new CustomEvent("contour:pause",{bubbles:!0,composed:!0})))},r=()=>{e();const a=parseFloat(this.getAttribute("speed")||"1")||1;t=setInterval(s,Math.max(100,1e3/a))};this._timeSliderReconcile=()=>{const a=this.hasAttribute("is-playing");a&&void 0===t?(r(),this.dispatchEvent(new CustomEvent("contour:play",{bubbles:!0,composed:!0}))):a||void 0===t||(e(),this.dispatchEvent(new CustomEvent("contour:pause",{bubbles:!0,composed:!0})))},this.addEventListener("click",t=>{if(t.target&&t.target.closest?t.target.closest(".c-time-slider__play"):null)return void this.toggleAttribute("is-playing",!this.hasAttribute("is-playing"));const e=t.target&&t.target.closest?t.target.closest(".c-time-slider__loop"):null;if(e){const t="true"!==e.getAttribute("aria-pressed");e.setAttribute("aria-pressed",String(t)),this.toggleAttribute("loop",t),this.dispatchEvent(new CustomEvent("contour:loop-change",{detail:{loop:t},bubbles:!0,composed:!0}))}}),this.addEventListener("pointerdown",t=>{t.target&&t.target.closest&&t.target.closest(".c-time-slider__track")&&(this._timeSliderScrubbing=!0)},{passive:!0});const o=()=>{this._timeSliderScrubbing=!1};this.addEventListener("pointerup",o,{passive:!0}),this.addEventListener("pointercancel",o,{passive:!0}),this.addEventListener("input",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-time-slider__track"):null;e&&(this._timeSliderScrubbing||this.setAttribute("value",e.value),a(),this.dispatchEvent(new CustomEvent("contour:time-change",{detail:{value:e.value},bubbles:!0,composed:!0})))}),this.addEventListener("change",e=>{const s=e.target&&e.target.closest?e.target.closest(".c-time-slider__speed"):null;if(s){const e=Number(s.value);return this.setAttribute("speed",String(e)),void 0!==t&&r(),void this.dispatchEvent(new CustomEvent("contour:speed-change",{detail:{speed:e},bubbles:!0,composed:!0}))}const o=e.target&&e.target.closest?e.target.closest(".c-time-slider__track"):null;o&&(this.setAttribute("value",o.value),a())}),onDispose(this,e),this._timeSliderReconcile()}disconnectedCallback(){super.disconnectedCallback(),this._wiredTimeSlider=!1,this._timeSliderReconcile=null}}define("contour-time-slider",ContourTimeSlider);class ContourHexbin extends ContourBase{static get observed(){return["label","cells","width","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{label:{attribute:"label"},cells:{attribute:"cells"},width:{attribute:"width"},src:{attribute:"src"}}}render(){this.classList.add("c-hexbin"),this.hasAttribute("role")||this.setAttribute("role","group"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||"Hexbin");const t=this.getAttribute("label")||this._remoteData&&this._remoteData.label;if(t){this.ensure(".c-hexbin__label",()=>{const t=document.createElement("span");return t.className="c-hexbin__label",t}).textContent=t}else{const t=this.querySelector(".c-hexbin__label");t&&t.remove()}if(wireStates(this),loadRemote(this,"cells"),renderStates(this,"hexbin"))return;const e=remoteData(this,"cells")||(this._remoteData&&this._remoteData.cells?JSON.stringify(this._remoteData.cells):null),a=Array.from(this.querySelectorAll(":scope > .c-hexbin__cell"));this.ensure(".c-hexbin__tooltip",()=>{const t=document.createElement("div");return t.className="c-hexbin__tooltip",t.setAttribute("role","tooltip"),t.setAttribute("hidden",""),t}).setAttribute("hidden","");const s=this.getAttribute("width");if(s?this.style.inlineSize=s:this.style.removeProperty("inline-size"),a.length){const t=Math.ceil(Math.sqrt(a.length||1));this.style.gridTemplateColumns="repeat("+t+", minmax(0, 1fr))",a.forEach((t,e)=>t.setAttribute("tabindex",0===e?"0":"-1"))}else{let t=null;if(e)try{t=JSON.parse(e)}catch(e){t=null}if(Array.isArray(t))try{Array.from(this.querySelectorAll(".c-hexbin__cell")).forEach(t=>t.remove());const e=Math.ceil(Math.sqrt(t.length||1));this.style.gridTemplateColumns="repeat("+e+", minmax(0, 1fr))";const a=t.map(t=>Number("object"==typeof t&&null!==t?t.value:t)).filter(t=>Number.isFinite(t)),s=a.length?Math.min(...a):0,r=a.length?Math.max(...a):0,o=r-s;if(t.forEach((t,e)=>{const a=document.createElement("div");a.className="c-hexbin__cell",a.setAttribute("tabindex",0===e?"0":"-1");const r="object"==typeof t&&null!==t&&null!=t.value?t.value:t;null!=r&&""!==r&&(a.textContent=r,a.setAttribute("data-title",String(r)));const i=Number(r);if(Number.isFinite(i)){const t=o>0?(i-s)/o:1,e=Math.round(20+60*t);a.style.background="color-mix(in oklab, var(--color-primary) "+e+"%, var(--color-surface-2))"}this.appendChild(a)}),o>0&&a.length){const t=this.ensure(".c-hexbin__legend",()=>{const t=document.createElement("div");return t.className="c-hexbin__legend",t});t.textContent="";const e=document.createElement("div");e.className="c-hexbin__legend-swatch",e.style.background="color-mix(in oklab, var(--color-primary) 20%, var(--color-surface-2))",e.setAttribute("title",String(s));const a=document.createElement("div");a.className="c-hexbin__legend-swatch",a.style.background="color-mix(in oklab, var(--color-primary) 80%, var(--color-surface-2))",a.setAttribute("title",String(r));const o=document.createElement("span");o.className="c-hexbin__legend-label",o.textContent=String(s);const i=document.createElement("span");i.className="c-hexbin__legend-label",i.textContent=String(r),t.appendChild(e),t.appendChild(o),t.appendChild(a),t.appendChild(i)}}catch(t){warnBadJson(this,"attribute",t)}else Array.from(this.querySelectorAll(".c-hexbin__cell")).forEach(t=>t.remove()),renderEmpty(this,"hexbin")}}enhance(){this._wiredHexbin||(this._wiredHexbin=!0,wireMapItems(this,".c-hexbin__cell",".c-hexbin__tooltip"))}}define("contour-hexbin",ContourHexbin);class ContourFlowMap extends ContourBase{static get observed(){return["label","nodes","flows","edges","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{label:{attribute:"label"},nodes:{attribute:"nodes"},flows:{attribute:"flows"},edges:{attribute:"edges"},src:{attribute:"src"}}}render(){this.classList.add("c-flow-map"),this.hasAttribute("role")||this.setAttribute("role","group"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||"Flow map");const t=this.getAttribute("label")||this._remoteData&&this._remoteData.label;if(t){this.ensure(".c-flow-map__label",()=>{const t=document.createElement("span");return t.className="c-flow-map__label",t}).textContent=t}else{const t=this.querySelector(".c-flow-map__label");t&&t.remove()}if(wireStates(this),loadRemote(this,"nodes"),renderStates(this,"flow-map"))return;const e=remoteData(this,"nodes")||(this._remoteData&&this._remoteData.nodes?JSON.stringify(this._remoteData.nodes):null),a=Array.from(this.querySelectorAll(":scope > .c-flow-map__node"));let s=null;if(a.length)s=a.map(t=>t.textContent||t.getAttribute("data-title")||t.getAttribute("title")||""),a.forEach(t=>t.remove());else if(e)try{s=JSON.parse(e)}catch(t){s=null}if(s)try{Array.from(this.querySelectorAll(".c-flow-map__node")).forEach(t=>t.remove()),s.forEach((t,e)=>{const a=document.createElement("span");a.className="c-flow-map__node"+(t.source?" c-flow-map__node--source":"")+(t.target?" c-flow-map__node--target":""),a.setAttribute("tabindex",0===e?"0":"-1"),a.textContent="string"==typeof t?t:t.label||t.name||"","object"==typeof t&&(t.label||t.name)&&a.setAttribute("data-title",t.label||t.name),this.appendChild(a)});this.ensure(".c-flow-map__tooltip",()=>{const t=document.createElement("div");return t.className="c-flow-map__tooltip",t.setAttribute("role","tooltip"),t.setAttribute("hidden",""),t}).setAttribute("hidden","")}catch(t){warnBadJson(this,"attribute",t)}else s||(Array.from(this.querySelectorAll(".c-flow-map__node")).forEach(t=>t.remove()),renderEmpty(this,"flow-map"));const r=null!=this.flows&&""!==this.flows?this.flows:null!=this.edges&&""!==this.edges?this.edges:this._remoteData&&null!=this._remoteData.flows?JSON.stringify(this._remoteData.flows):null;let o=null;if(null!=r)try{const t=JSON.parse(r);Array.isArray(t)?o=t:warnBadJson(this,"flows",new Error("expected an array"))}catch(t){warnBadJson(this,"flows",t)}const i=this.querySelector(".c-flow-map__summary");if(o){const t=this.ensure(".c-flow-map__summary",()=>{const t=document.createElement("div");return t.className="c-flow-map__summary c-table-wrap",t});let e=t.querySelector("table");e||(e=document.createElement("table"),e.className="c-table c-flow-map__table",t.appendChild(e)),setHTML(e,"");const a=document.createElement("caption");a.textContent=labelText(this,"flow-summary","Flow summary"),e.appendChild(a);const s=document.createElement("thead"),r=document.createElement("tr");[["source","Source"],["target","Target"],["magnitude","Magnitude"]].forEach(([t,e])=>{const a=document.createElement("th");a.setAttribute("scope","col"),a.textContent=labelText(this,t,e),r.appendChild(a)}),s.appendChild(r),e.appendChild(s);const i=document.createElement("tbody"),n=t=>"string"==typeof t?t:t&&"object"==typeof t?String(t.label||t.name||t.id||""):"";o.forEach(t=>{const e=t&&"object"==typeof t?t:{},a=document.createElement("tr"),s=document.createElement("th");s.setAttribute("scope","row"),s.textContent=n(e.source),a.appendChild(s);const r=document.createElement("td");r.textContent=n(e.target),a.appendChild(r);const o=document.createElement("td"),l=null!=e.value?e.value:e.magnitude,c=Number(l);o.textContent=null==l||""===l?"":Number.isFinite(c)?(c>0?"+":"")+c:String(l),a.appendChild(o),i.appendChild(a)}),e.appendChild(i)}else i&&i.remove()}enhance(){this._wiredFlowMap||(this._wiredFlowMap=!0,wireMapItems(this,".c-flow-map__node",".c-flow-map__tooltip"))}}define("contour-flow-map",ContourFlowMap);class ContourIsochrone extends ContourBase{static get observed(){return["label","center","rings","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{label:{attribute:"label"},center:{attribute:"center"},rings:{attribute:"rings"},src:{attribute:"src"}}}render(){this.classList.add("c-isochrone"),this.hasAttribute("role")||this.setAttribute("role","group"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||"Isochrone");const t=this.getAttribute("label")||this._remoteData&&this._remoteData.label;if(t){this.ensure(".c-isochrone__label",()=>{const t=document.createElement("span");return t.className="c-isochrone__label",t}).textContent=t}else{const t=this.querySelector(".c-isochrone__label");t&&t.remove()}const e=this.getAttribute("center")||this._remoteData&&this._remoteData.center;if(e){this.ensure(".c-isochrone__center",()=>{const t=document.createElement("span");return t.className="c-isochrone__center",t}).textContent=e}else{const t=this.querySelector(".c-isochrone__center");t&&t.remove()}if(wireStates(this),loadRemote(this,"rings"),renderStates(this,"isochrone"))return;const a=remoteData(this,"rings")||(this._remoteData&&this._remoteData.rings?JSON.stringify(this._remoteData.rings):null),s=Array.from(this.querySelectorAll(":scope > .c-isochrone__ring"));let r=null;if(s.length)r=s.map(t=>t.textContent||t.getAttribute("data-title")||t.getAttribute("title")||""),s.forEach(t=>t.remove());else if(a)try{r=JSON.parse(a)}catch(t){r=null}if(r)try{Array.from(this.querySelectorAll(".c-isochrone__ring")).forEach(t=>t.remove()),r.forEach((t,e)=>{const a=document.createElement("span"),s="string"==typeof t?t:t&&(t.label||t.name||t.value||t.min),r=null==s?"":String(s),o=r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");a.className="c-isochrone__ring"+(o?" c-isochrone__ring--"+o:""),a.setAttribute("tabindex",0===e?"0":"-1"),a.setAttribute("aria-label",r||"Isochrone ring "+(e+1)),r&&a.setAttribute("data-title",r),this.appendChild(a)});this.ensure(".c-isochrone__tooltip",()=>{const t=document.createElement("div");return t.className="c-isochrone__tooltip",t.setAttribute("role","tooltip"),t.setAttribute("hidden",""),t}).setAttribute("hidden","")}catch(t){warnBadJson(this,"attribute",t)}else r||(Array.from(this.querySelectorAll(".c-isochrone__ring")).forEach(t=>t.remove()),renderEmpty(this,"isochrone"))}enhance(){this._wiredIsochrone||(this._wiredIsochrone=!0,wireMapItems(this,".c-isochrone__ring",".c-isochrone__tooltip"))}}define("contour-isochrone",ContourIsochrone);class ContourCatchment extends ContourBase{static get observed(){return["label","area","center","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{label:{attribute:"label"},area:{attribute:"area"},center:{attribute:"center"},src:{attribute:"src"}}}render(){this.classList.add("c-catchment"),this.hasAttribute("role")||this.setAttribute("role","img"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||"Catchment");const t=this.getAttribute("label")||this._remoteData&&this._remoteData.label;if(t){this.ensure(".c-catchment__label",()=>{const t=document.createElement("span");return t.className="c-catchment__label",t}).textContent=t}else{const t=this.querySelector(".c-catchment__label");t&&t.remove()}const e=this.getAttribute("area")||this._remoteData&&this._remoteData.area;if(e){this.ensure(".c-catchment__area",()=>{const t=document.createElement("span");return t.className="c-catchment__area",t}).textContent=e}else{const t=this.querySelector(".c-catchment__area");t&&t.remove()}const a=this.getAttribute("center")||this._remoteData&&this._remoteData.center;if(a){this.ensure(".c-catchment__center",()=>{const t=document.createElement("span");return t.className="c-catchment__center",t}).textContent=a}else{const t=this.querySelector(".c-catchment__center");t&&t.remove()}if(wireStates(this),loadRemote(this,["label","area","center"]),renderStates(this,"catchment"))return;const s=remoteData(this,"label")||this._remoteData&&this._remoteData.label,r=remoteData(this,"area")||this._remoteData&&this._remoteData.area,o=remoteData(this,"center")||this._remoteData&&this._remoteData.center;if(!s&&!r&&!o)return void renderEmpty(this,"catchment");const i=this.ensure(".c-catchment__tooltip",()=>{const t=document.createElement("div");return t.className="c-catchment__tooltip",t.setAttribute("role","tooltip"),t.setAttribute("hidden",""),t});i.setAttribute("hidden",""),r&&(i.textContent=r)}enhance(){if(this._wiredCatchment)return;this._wiredCatchment=!0;const t=()=>{const t=this.querySelector(".c-catchment__tooltip");t&&t.removeAttribute("hidden")},e=()=>{const t=this.querySelector(".c-catchment__tooltip");t&&t.setAttribute("hidden","")};this.addEventListener("mouseenter",t),this.addEventListener("mouseleave",e),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("focusin",t),this.addEventListener("focusout",e),this.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.dispatchEvent(new CustomEvent("contour:select",{bubbles:!0,composed:!0,detail:{area:this.getAttribute("area")}})))})}}define("contour-catchment",ContourCatchment);class ContourCompassFull extends ContourBase{static get observed(){return["label","needle","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","empty","no-cache"]}static get properties(){return{label:{attribute:"label"},needle:{attribute:"needle"},src:{attribute:"src"}}}render(){this.classList.add("c-compass"),this.hasAttribute("role")||this.setAttribute("role","img"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||"Compass");const t=this.getAttribute("label")||this._remoteData&&this._remoteData.label;if(wireStates(this),loadRemote(this,"needle"),renderStates(this,"compass"))return;const e=remoteData(this,"needle")||this._remoteData&&(this._remoteData.needle||this._remoteData.value);if(e||t){for(const t of["n","s","e","w"]){const e=".c-compass__label--"+t;let a=this.querySelector(e);a||(a=document.createElement("span"),a.className="c-compass__label "+e.slice(1),a.textContent=t.toUpperCase(),a.setAttribute("role","button"),a.setAttribute("tabindex","0"),this.appendChild(a))}if(t&&"compass"!==t.toLowerCase()){this.ensure(".c-compass__label:not([class*='--'])",()=>{const t=document.createElement("span");return t.className="c-compass__label",t}).textContent=t}if(e){const t=Number(e)||0,a=this.ensure("svg.c-compass__needle",()=>{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("class","c-compass__needle"),e.setAttribute("viewBox","0 0 40 40"),e.setAttribute("aria-hidden","true");const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("class","c-compass__needle--n"),a.setAttribute("d",compassNeedle(20,20,16,t)),e.appendChild(a);const s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("class","c-compass__needle--s"),s.setAttribute("d",compassNeedle(20,20,16,t+180)),e.appendChild(s),e}),s=a.querySelector(".c-compass__needle--n");s&&s.setAttribute("d",compassNeedle(20,20,16,t));const r=a.querySelector(".c-compass__needle--s");r&&r.setAttribute("d",compassNeedle(20,20,16,t+180))}else{const t=this.querySelector("svg.c-compass__needle, .c-compass__needle");t&&t.remove()}}else renderEmpty(this,"compass")}enhance(){if(this._wiredCompass)return;this._wiredCompass=!0;const t={n:0,e:90,s:180,w:270},e=e=>{const a=t[e];if(void 0===a)return;const s=this.querySelector(".c-compass__needle");if(s){const t=s.querySelector(".c-compass__needle--n");t&&t.setAttribute("d",compassNeedle(20,20,16,a));const e=s.querySelector(".c-compass__needle--s");e&&e.setAttribute("d",compassNeedle(20,20,16,a+180))}this.dispatchEvent(new CustomEvent("contour:bearing",{bubbles:!0,composed:!0,detail:{direction:e,degrees:a}}))};this.addEventListener("click",t=>{const a=t.target&&t.target.closest?t.target.closest(".c-compass__label--n, .c-compass__label--e, .c-compass__label--s, .c-compass__label--w"):null;if(!a||!this.contains(a))return;const s=a.className.match(/c-compass__label--([nsew])/);s&&e(s[1])}),this.addEventListener("keydown",t=>{if("Enter"!==t.key&&" "!==t.key)return;const a=t.target&&t.target.closest?t.target.closest(".c-compass__label--n, .c-compass__label--e, .c-compass__label--s, .c-compass__label--w"):null;if(!a||!this.contains(a))return;t.preventDefault();const s=a.className.match(/c-compass__label--([nsew])/);s&&e(s[1])})}}define("contour-compass",ContourCompassFull);class ContourLayerSwitch extends ContourBase{static get observed(){return["items","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{items:{attribute:"items"},src:{attribute:"src"}}}render(){if(this.classList.add("c-layer-switch"),this.hasAttribute("role")||this.setAttribute("role","list"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",labelText(this,"layer-switch","Layer switch")),wireStates(this),loadRemote(this,"items"),renderStates(this,"layer-switch"))return;const t=remoteData(this,"items"),e=Array.from(this.children).filter(t=>t.classList&&t.classList.contains("c-layer-switch__item"));if(t&&!e.length){Array.from(this.querySelectorAll(".c-layer-switch__item")).forEach(t=>t.remove());try{const e=JSON.parse(t);(Array.isArray(e)?e.slice(0,50):e).forEach(t=>{const e=document.createElement("div");e.className="c-layer-switch__item",e.setAttribute("role","listitem");const a="string"==typeof t?t:t.name||t.label||"",s="object"==typeof t&&t&&t.id?String(t.id):a?a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""):"";this._layerSwitchSeq=(this._layerSwitchSeq||0)+1,e.dataset.layerId=s||"layer-"+this._layerSwitchSeq;const r=document.createElement("span");r.className="c-layer-switch__swatch";const o="object"==typeof t&&t&&t.shape?String(t.shape):"";if(SHAPES.has(o)&&r.classList.add("c-swatch--"+o),t.color){const e=safeColor(t.color);e&&(SHAPES.has(o)?r.style.color=e:r.style.background=e)}r.setAttribute("aria-hidden","true"),e.appendChild(r);const i=document.createElement("span");if(i.className="c-layer-switch__name",i.textContent="string"==typeof t?t:t.name||t.label||"",e.appendChild(i),null!=t.count){const a=document.createElement("span");a.className="c-layer-switch__count",a.textContent=t.count,e.appendChild(a)}const n=document.createElement("button");n.className="c-layer-switch__toggle",n.type="button",n.setAttribute("aria-label",labelText(this,"toggle","Toggle")+" "+("string"==typeof t?t:t.name||t.label||labelText(this,"layer","layer")));const l="object"!=typeof t||!1!==t.visible;n.setAttribute("aria-pressed",String(l)),setHTML(n,l?'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-check" /></svg>':'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-minus" /></svg>'),e.appendChild(n),this.appendChild(e)})}catch(t){warnBadJson(this,"attribute",t)}}else t||e.length||(Array.from(this.querySelectorAll(".c-layer-switch__item")).forEach(t=>t.remove()),renderEmpty(this,"layer-switch"))}enhance(){this._wiredLayerSwitch||(this._wiredLayerSwitch=!0,this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-layer-switch__toggle"):null;if(!e||!this.contains(e))return;const a=e.closest(".c-layer-switch__item"),s=a&&a.querySelector(".c-layer-switch__name")?.textContent||"",r=a&&a.dataset&&a.dataset.layerId||"",o="true"!==e.getAttribute("aria-pressed");e.setAttribute("aria-pressed",String(o)),this.dispatchEvent(new CustomEvent("contour:layer-toggle",{bubbles:!0,composed:!0,detail:{layerId:r,name:s,visible:o}}))}),this.addEventListener("keydown",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-layer-switch__toggle"):null;e&&this.contains(e)&&("Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.click()))}))}}define("contour-layer-switch",ContourLayerSwitch);class ContourBasemapSwitcher extends ContourBase{static get observed(){return["items","value","label"]}static get properties(){return{items:{attribute:"items"},value:{attribute:"value"},label:{attribute:"label"}}}render(){this.classList.add("c-basemap-switcher"),this.hasAttribute("role")||this.setAttribute("role","group"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",this.getAttribute("label")||labelText(this,"basemap","Basemap"));let t=[];try{const e=JSON.parse(this.getAttribute("items")||"[]");Array.isArray(e)&&(t=e)}catch(t){}const e=this.getAttribute("value");Array.from(this.querySelectorAll(".c-basemap-switcher__item")).forEach(t=>t.remove()),t.forEach(t=>{const a="string"==typeof t?t:t.label||t.value||t,s="string"==typeof t?t:t.value||t.label||t,r=document.createElement("button");r.type="button",r.className="c-basemap-switcher__item c-btn c-btn--sm"+(e===s?" is-active":""),r.textContent=a,r.dataset.value=s,e===s&&r.setAttribute("aria-pressed","true"),this.appendChild(r)})}enhance(){this._wiredBasemap||(this._wiredBasemap=!0,this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-basemap-switcher__item"):null;if(!e||!this.contains(e))return;const a=e.dataset.value,s=(e.textContent||"").trim();this.setAttribute("value",a),this.dispatchEvent(new CustomEvent("contour:map-style",{bubbles:!0,composed:!0,detail:{style:a,name:s}}))}))}}define("contour-basemap-switcher",ContourBasemapSwitcher);class ContourMapSlot extends ContourBase{static get observed(){return["attribution","scale","chrome"]}static get properties(){return{attribution:{attribute:"attribution"},scale:{attribute:"scale"},chrome:{attribute:"chrome"}}}render(){this.classList.add("c-map-slot");const t=this.getAttribute("chrome");if(t){this.ensure(".c-map-slot__chrome",()=>{const t=document.createElement("div");return t.className="c-map-slot__chrome",t}).textContent=t}else{const t=this.querySelector(".c-map-slot__chrome");t&&t.remove()}const e=this.getAttribute("attribution");if(e){this.ensure(".c-map-slot__attribution",()=>{const t=document.createElement("div");return t.className="c-map-slot__attribution",t}).textContent=e}else{const t=this.querySelector(".c-map-slot__attribution");t&&t.remove()}const a=this.getAttribute("scale");if(a){this.ensure(".c-map-slot__scale",()=>{const t=document.createElement("div");return t.className="c-map-slot__scale",t}).textContent=a}else{const t=this.querySelector(".c-map-slot__scale");t&&t.remove()}}}define("contour-map-slot",ContourMapSlot);class ContourMapArea extends ContourBase{static get observed(){return["attribution","attribution-mark","scale","controls","style","style-name","src"]}static get properties(){return{attribution:{attribute:"attribution"},"attribution-mark":{attribute:"attribution-mark"},scale:{attribute:"scale"},controls:{attribute:"controls"},"style-name":{attribute:"style-name"}}}render(){this.classList.add("c-map-area"),this.classList.add("c-map-slot");const t=this.getAttribute("style");if(t&&t!==this._lastMapStyle){this._lastMapStyle=t;const e=this.getAttribute("style-name")||t;this.dispatchEvent(new CustomEvent("contour:map-style",{bubbles:!0,composed:!0,detail:{style:t,name:e}})),"function"==typeof requestAnimationFrame&&requestAnimationFrame(()=>this.dispatchEvent(new CustomEvent("contour:map-ready",{bubbles:!0,composed:!0})))}this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",labelText(this,"map-area","Map area"));const e=this.getAttribute("attribution");if(e&&"engine"!==e){this.ensure(".c-map-slot__attribution",()=>{const t=document.createElement("div");return t.className="c-map-slot__attribution",t}).textContent=e}else{const t=this.querySelector(".c-map-slot__attribution");t&&t.remove()}const a=this.getAttribute("attribution-mark");if(a){this.ensure(".c-map-slot__attribution-mark",()=>{const t=document.createElement("span");return t.className="c-map-slot__attribution-mark",t}).textContent=a}else{const t=this.querySelector(".c-map-slot__attribution-mark");t&&t.remove()}const s=this.getAttribute("scale");if(s&&"engine"!==s){this.ensure(".c-map-slot__scale",()=>{const t=document.createElement("div");return t.className="c-map-slot__scale",t}).textContent=s}else{const t=this.querySelector(".c-map-slot__scale");t&&t.remove()}const r=this.getAttribute("controls");if(r)try{const t=JSON.parse(r),e=this.ensure(".c-map-slot__controls",()=>{const t=document.createElement("div");return t.className="c-map-slot__controls",t});setHTML(e,""),t.forEach(t=>{const a=document.createElement("button");a.className="c-map-slot__control",a.type="button";const s="object"==typeof t&&t,r=s?t.label||t.action||"":String(t),o=s&&t.action?{zoomIn:"i-plus",zoomOut:"i-minus",zoomReset:"i-crosshair",zoom:"i-zoom",reset:"i-refresh",locate:"i-crosshair",recenter:"i-crosshair"}[String(t.action)]:null;o&&setHTML(a,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#'+o+'" /></svg>'),a.appendChild(document.createTextNode((o?" ":"")+r)),s&&t.action&&(a.dataset.mapAction=String(t.action)),s&&t.label&&a.setAttribute("aria-label",String(t.label)),e.appendChild(a)})}catch(t){warnBadJson(this,"attribute",t)}else{const t=this.querySelector(".c-map-slot__controls");t&&t.remove()}}enhance(){this._wiredMapArea||(this._wiredMapArea=!0,this._map=null,this.getViewport=()=>{const t=this._map;if(!t)return null;try{if("function"==typeof t.getBounds){const e=t.getBounds();return unwrapBounds({west:e.getWest(),south:e.getSouth(),east:e.getEast(),north:e.getNorth()})}if(t.transform&&"object"==typeof t.transform)return{zoom:t.transform.zoom,center:t.transform.center}}catch(t){}return null},this._emitViewport=()=>{this.dispatchEvent(new CustomEvent("contour:map-viewport",{bubbles:!0,composed:!0,detail:this.getViewport()}))},this._detachEngine=()=>{const t=this._map;if(t&&"function"==typeof t.off){try{t.off("moveend",this._emitViewport)}catch(t){}try{t.off("idle",this._onMapIdle)}catch(t){}try{t.off("load",this._onMapIdle)}catch(t){}}if(this._mapRO){try{this._mapRO.disconnect()}catch(t){}this._mapRO=null}},this._onMapIdle=()=>{this._mapReadySent||(this._mapReadySent=!0,this.dispatchEvent(new CustomEvent("contour:map-ready",{bubbles:!0,composed:!0})))},this.attachMap=t=>{if(this._detachEngine(),this._map=t||null,this._mapReadySent=!1,this._map){const e=()=>{this.isConnected&&this._map===t&&(this.clientWidth&&this.clientHeight||this.dispatchEvent(new CustomEvent("contour:error",{bubbles:!0,composed:!0,detail:{src:this.getAttribute("src")||"",message:"Map container has zero size; the engine cannot render.",name:"map-zero-size",status:0}})))};"function"==typeof requestAnimationFrame?requestAnimationFrame(e):e()}if(this._map&&"function"==typeof this._map.on){try{this._map.on("moveend",this._emitViewport)}catch(t){}try{this._map.on("idle",this._onMapIdle)}catch(t){}try{this._map.on("load",this._onMapIdle)}catch(t){}}if("undefined"!=typeof ResizeObserver&&this._map)try{let t=0;this._mapRO=new ResizeObserver(()=>{t||(t=requestAnimationFrame(()=>{t=0;const e=this._map;if(e)try{"function"==typeof e.resize?e.resize():"function"==typeof e.invalidateSize&&e.invalidateSize()}catch(t){}}))}),this._mapRO.observe(this)}catch(t){this._mapRO=null}if(this.dispatchEvent(new CustomEvent("contour:map-attach",{bubbles:!0,composed:!0})),this._emitViewport(),this._map&&"function"==typeof this._map.loaded)try{this._map.loaded()&&this._onMapIdle()}catch(t){}},this.detachMap=()=>{this._detachEngine(),this._map=null,this.dispatchEvent(new CustomEvent("contour:map-detach",{bubbles:!0,composed:!0}))},this.hasOwnProperty("map")||Object.defineProperty(this,"map",{get:()=>this._map,set:t=>this.attachMap(t)}),this.fitBounds=(t,e)=>{const a=this._map;if(a&&"function"==typeof a.fitBounds)try{a.fitBounds(t,e)}catch(t){}},this.flyTo=t=>{const e=this._map;if(e&&"function"==typeof e.flyTo)try{e.flyTo(t)}catch(t){}},this.attachChrome=t=>{const e=t||this._map;if(!e||this._chromeMap===e)return;this._chromeMap=e,this._chromeDelegated||(this._chromeDelegated=!0,this.addEventListener("keydown",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-drag-handle--dots, .c-layer-panel__grip"):null;if(!e||!this.contains(e))return;if("ArrowUp"!==t.key&&"ArrowDown"!==t.key)return;const a=e.closest(".c-layer-panel__item");if(!a)return;const s=a.parentNode,r="ArrowUp"===t.key?a.previousElementSibling:a.nextElementSibling;if(!r||!r.classList||!r.classList.contains("c-layer-panel__item"))return;t.preventDefault(),"ArrowUp"===t.key?s.insertBefore(a,r):s.insertBefore(r,a);try{e.focus()}catch(t){}const o=Array.from(s.querySelectorAll(":scope > .c-layer-panel__item")).map((t,e)=>t.dataset.layerId||t.getAttribute("data-layer-id")||String(e));this.dispatchEvent(new CustomEvent("contour:layer-reorder",{bubbles:!0,composed:!0,detail:{layerIds:o}}))}),this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-map-slot__control"):null;if(!e||!this.contains(e))return;const a=this._map;if(!a)return;const s=e.dataset.mapAction,r=(e.getAttribute("aria-label")||e.textContent||"").toLowerCase(),o=s?/out|minus|zoomout/i.test(s):/out|minus|−|-/.test(r)&&!/in\b/.test(r);try{o?a.zoomOut():a.zoomIn()}catch(t){}}));const a=this.querySelector(".c-readout");if(a&&"function"==typeof e.getCenter){const t=a.querySelector(".c-readout__value--coord"),s=a.querySelector(".c-readout__row:nth-child(2) .c-readout__value"),r=()=>{const a=this._map||e;if("function"!=typeof a.getCenter)return;const r=a.getCenter();t&&r&&(t.textContent=`${r.lng.toFixed(6)}, ${r.lat.toFixed(6)}`),s&&"function"==typeof a.getZoom&&(s.textContent=a.getZoom().toFixed(1))};try{e.on("move",r)}catch(t){}r()}const s=this.querySelector(".c-compass__needle");if(s&&"function"==typeof e.getBearing){const t=s.querySelector(".c-compass__needle--n"),a=s.querySelector(".c-compass__needle--s"),r=s.closest("contour-compass"),o=t=>{const e=t*Math.PI/180;return[20+16*Math.sin(e),20-16*Math.cos(e)]},i=()=>{const s=this._map||e;if("function"!=typeof s.getBearing)return;const i=-s.getBearing(),[n,l]=o(i),[c,d]=o(i+180);if(t&&t.setAttribute("d",`M ${n} ${l} L 20 20 Z`),a&&a.setAttribute("d",`M ${c} ${d} L 20 20 Z`),r){const t=r.getAttribute("aria-label")||"";if(!t||/^compass\b/i.test(t)){const t=Math.round((i%360+360)%360);r.setAttribute("aria-label",`Compass, bearing ${t} degrees`)}}};try{e.on("rotate",i)}catch(t){}i()}},this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-map-slot__control"):null;e&&this.contains(e)&&this.dispatchEvent(new CustomEvent("contour:map-control",{bubbles:!0,composed:!0,detail:{control:e.textContent}}))}))}}define("contour-map-area",ContourMapArea);class ContourMapPanel extends ContourBase{static get observed(){return["title"]}static get properties(){return{title:{attribute:"title"}}}render(){this.classList.add("c-map-panel"),this.hasAttribute("role")||this.setAttribute("role","region");const t=this.getAttribute("title");if(t){const e=this._mapPanelTitle;(!this.hasAttribute("aria-label")||e&&this.getAttribute("aria-label")===e)&&this.setAttribute("aria-label",t),this._mapPanelTitle=t}else this._mapPanelTitle&&this.getAttribute("aria-label")===this._mapPanelTitle&&(this.removeAttribute("aria-label"),this._mapPanelTitle=null)}}define("contour-map-panel",ContourMapPanel);class ContourMapFooter extends ContourBase{static get observed(){return["brand"]}static get properties(){return{brand:{attribute:"brand"}}}render(){this.classList.add("c-map-footer"),this.hasAttribute("role")||this.setAttribute("role","contentinfo");const t=this.getAttribute("brand");if(t){this.ensure(".c-map-footer__brand",()=>{const t=document.createElement("span");return t.className="c-map-footer__brand",t}).textContent=t}else{const t=this.querySelector(".c-map-footer__brand");t&&t.remove()}}}define("contour-map-footer",ContourMapFooter);class ContourScaleBar extends ContourBase{static get observed(){return["label","value","distance","resolution","latitude","zoom","units","empty","loading","error","retry","src","lazy","refresh","timeout","skeleton","cache-key","no-cache"]}static get properties(){return{label:{attribute:"label"},value:{attribute:"value"},distance:{attribute:"distance"},resolution:{attribute:"resolution"},latitude:{attribute:"latitude"},zoom:{attribute:"zoom"},src:{attribute:"src"}}}render(){if(this.classList.add("c-scale-bar"),this.hasAttribute("role")||this.setAttribute("role","img"),this.hasAttribute("aria-label")||this.setAttribute("aria-label",labelText(this,"map-scale","Map scale")),wireStates(this),loadRemote(this,["label","value"]),renderStates(this,"scale-bar"))return;let t=remoteData(this,"value")||this._remoteData&&this._remoteData.value;const e=parseFloat(this.getAttribute("resolution")),a=parseFloat(this.getAttribute("latitude")),s=parseFloat(this.getAttribute("zoom"));let r=e;!Number.isFinite(r)&&Number.isFinite(a)&&Number.isFinite(s)&&(r=mercatorResolution(a,s));let o=null;if(Number.isFinite(r)&&r>0){const e=parseFloat(this.getAttribute("distance"))||1e3;if(t=String(Math.round(e/r)),!this.getAttribute("label")&&!remoteData(this,"label")){o="imperial"===(this.getAttribute("units")||"metric")?e>=1609.34?(e/1609.34).toFixed(1)+" mi":Math.round(3.28084*e)+" ft":e>=1e3?e/1e3+" km":e+" m"}}const i=o||remoteData(this,"label")||this._remoteData&&this._remoteData.label;if(i){this.ensure(".c-scale-bar__label",()=>{const t=document.createElement("span");return t.className="c-scale-bar__label",t}).textContent=i}else{const t=this.querySelector(".c-scale-bar__label");t&&t.remove()}const n=this.ensure(".c-scale-bar__units",()=>{const t=document.createElement("button");return t.type="button",t.className="c-scale-bar__units",t}),l=this.getAttribute("units")||"metric";if(n.textContent="imperial"===l?"mi":"km",n.onclick=()=>{this.setAttribute("units","imperial"===(this.getAttribute("units")||"metric")?"metric":"imperial")},!t)return void renderEmpty(this,"scale-bar");const c=this.ensure(".c-scale-bar__line",()=>{const t=document.createElement("span");return t.className="c-scale-bar__line",t});c.style.inlineSize=/^\d+(\.\d+)?$/.test(String(t))?t+"px":t;const d=scaleBarTicks(parseFloat(t)||0,4),u=d[d.length-1]||1;Array.from(c.querySelectorAll(".c-scale-bar__tick")).forEach(t=>t.remove()),d.forEach(t=>{const e=document.createElement("span");e.className="c-scale-bar__tick",e.style.insetInlineStart=t/u*100+"%",c.appendChild(e)})}}define("contour-scale-bar",ContourScaleBar);class ContourSplitMap extends ContourBase{static get observed(){return[]}render(){this.classList.add("c-split-map");const t=this.ensure(".c-split-map__pane--left",()=>{const t=document.createElement("div");return t.className="c-split-map__pane c-split-map__pane--left",t}),e=this.ensure(".c-split-map__pane--right",()=>{const t=document.createElement("div");return t.className="c-split-map__pane c-split-map__pane--right",t});t.parentNode!==this&&this.appendChild(t),e.parentNode!==this&&this.appendChild(e)}}define("contour-split-map",ContourSplitMap);class ContourMapLegend extends ContourBase{static get observed(){return["items","label","collapsed"]}static get properties(){return{items:{attribute:"items"},label:{attribute:"label"},collapsed:{attribute:"collapsed",type:Boolean}}}render(){this.classList.add("c-map-legend");const t=this.getAttribute("label")||labelText(this,"legend","Legend"),e=this.ensure(".c-map-legend__head",()=>{const t=document.createElement("button");return t.type="button",t.className="c-btn c-btn--sm c-map-legend__head",t});setHTML(e,'<svg aria-hidden="true" viewBox="0 0 24 24"><use href="#i-layers" /></svg>'),e.appendChild(document.createTextNode(" "+t));const a=this.hasAttribute("collapsed");e.setAttribute("aria-expanded",a?"false":"true");let s=[];try{const t=JSON.parse(this.getAttribute("items")||"[]");Array.isArray(t)&&(s=t)}catch(t){}const r=this.ensure(".c-map-legend__list",()=>{const t=document.createElement("ul");return t.className="c-map-legend__list",t});setHTML(r,""),a||s.forEach(t=>{const e="string"==typeof t?t:t.label||t.name||"",a="object"==typeof t&&t?t.color:null,s=document.createElement("li");s.className="c-map-legend__item";const o="object"==typeof t&&t&&t.shape?String(t.shape):"";if(a||SHAPES.has(o)){const t=document.createElement("span");t.className="c-map-legend__swatch",SHAPES.has(o)&&t.classList.add("c-swatch--"+o),a&&(SHAPES.has(o)?t.style.color=a:t.style.setProperty("--c",a)),s.appendChild(t)}s.appendChild(document.createTextNode(" "+e)),r.appendChild(s)})}enhance(){this._wiredMapLegend||(this._wiredMapLegend=!0,this.addEventListener("click",t=>{const e=t.target&&t.target.closest?t.target.closest(".c-map-legend__head"):null;e&&this.contains(e)&&this.toggleAttribute("collapsed")}))}}define("contour-map-legend",ContourMapLegend);
|