/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{h as g}from"./GMSXMC4Y.js";import{B as n,N as l,O as o,P as i,R as c,U as p,a as s,b as e}from"./GRFF5Y4R.js";import"./ALDX5YZO.js";export default $arcgis.t(([m])=>{var d=s`:host{--arcgis-internal-color-black-30: color-mix(in srgb, #000000 30.2%, transparent);--arcgis-internal-box-shadow: var(--calcite-spacing-none) var(--calcite-spacing-px) var(--calcite-spacing-base) var(--arcgis-internal-color-black-30);--arcgis-internal-top-max-width: calc(min(100cqw, 100vw) - var(--calcite-spacing-xxxl));--arcgis-internal-panel-width: 300px;--arcgis-internal-panel-height: 100%;--arcgis-internal-panel-height-sm: 240px;--arcgis-internal-panel-height-md: 420px;--arcgis-internal-panel-height-lg: 540px;--arcgis-internal-panel-height-xl: 680px;--arcgis-internal-panel-gap: var(--calcite-spacing-lg);--arcgis-internal-panel-actions-gap: var(--calcite-spacing-sm);--arcgis-internal-basemap-gallery-width-lg: 450px;--arcgis-internal-collapse-icon-flip: scaleX(1);--arcgis-internal-row-direction: row;--arcgis-internal-legend-width: 300px;--arcgis-internal-layout-overlay-space-top: var(--arcgis-layout-overlay-space-top, 0px);--arcgis-internal-layout-overlay-space-bottom: var(--arcgis-layout-overlay-space-bottom, 0px);--arcgis-internal-layout-overlay-space-left: var(--arcgis-layout-overlay-space-left, 0px);--arcgis-internal-layout-overlay-space-right: var(--arcgis-layout-overlay-space-right, 0px);--arcgis-internal-view-color-focus: var(--arcgis-view-color-focus, var(--calcite-color-brand));--arcgis-internal-attribution-space-bottom: var(--arcgis-internal-layout-overlay-space-bottom);--arcgis-internal-attribution-space-left: var(--arcgis-internal-layout-overlay-space-left);--arcgis-internal-attribution-space-right: var(--arcgis-internal-layout-overlay-space-right);--arcgis-internal-attribution-font-size: var(--calcite-font-size-sm);--arcgis-internal-attribution-font-size-sm: var(--calcite-font-size-xs);--arcgis-internal-sketch-justify-content: flex-start}:host,.hint,.error,.section,.actions,.item{display:flex;flex-direction:column;gap:var(--arcgis-internal-panel-gap);animation:esri-fade-in .25s ease-in-out}.error{color:var(--calcite-color-status-danger)}.error,.hint{overflow:hidden;p{margin:0;padding:0}}.results-grid{display:grid;gap:var(--calcite-spacing-md);column-gap:var(--calcite-spacing-xxl);grid-template-columns:1fr max-content;&.vertical{display:flex;flex-direction:column;align-items:flex-start;.item{display:block}.title{margin-bottom:var(--calcite-spacing-xxs)}.value{align-self:flex-start}}}.item{display:contents;&.disabled>*{color:var(--calcite-color-text-1);opacity:var(--calcite-opacity-light)}}.title{grid-column:1;word-break:break-word;--calcite-label-margin-bottom: 0}.value{grid-column:2;font-weight:var(--calcite-font-weight-semibold);white-space:nowrap;align-self:center;justify-self:flex-end}.actions{justify-content:center;gap:var(--arcgis-internal-panel-actions-gap);&[hidden]{display:none}}`,r=class extends o{constructor(){super(...arguments),this._formatter=new m,this._baseId=n(),this._hasActionsContent=!1,this.layout="horizontal",this.items=[],this.state="disabled",this.unsupportedLabel=""}static{this.properties={_hasActionsContent:16,hintLabel:1,layout:1,items:0,state:1,unsupportedLabel:1}}static{this.styles=d}async load(){await this._formatter.when()}_actionsRef(t){this._updateHasActionsContent(t)}_updateHasActionsContent(t){this._hasActionsContent=t!=null&&t.assignedNodes({flatten:!0}).length>0}render(){switch(this.state){case"unsupported":return e`<section class="error"><p>${this.unsupportedLabel}</p></section>`;case"measuring":return e`<section class="hint"><p>${this.hintLabel}</p></section>`;case"ready":return this._renderActions();default:return e`<slot name=settings></slot>${h({idBase:this._baseId,formatter:this._formatter,items:this.items,layout:this.layout})}${this._renderActions()}`}}_renderActions(){return e`<div class="actions" .hidden=${!this._hasActionsContent}><slot name=actions @slotchange=${({currentTarget:t})=>{this._updateHasActionsContent(t)}} ${l(this._actionsRef)}></slot></div>`}};function h(a){return e`<section class=${i({"results-grid":!0,vertical:a.layout==="vertical"})}>${a.items.map((t,u)=>v({formatter:a.formatter,measurement:t.measurement,title:t.title,valueId:`${a.idBase}-item-${u}`}))}</section>`}function v(a){let t=a.measurement.state==="available"?g(a.formatter,a.measurement.value):null;return e`<div class=${i({item:!0,disabled:a.measurement.state!=="available"})}><calcite-label layout=inline class="title" .for=${a.valueId}>${a.title??""}</calcite-label><output id=${a.valueId??c} aria-live=polite class="value">${t??"-"}</output></div>`}p("arcgis-measurement-content",r);return r},"applications/Components/QuantityFormatter")