/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.7 */
import b from"./IOWEOVC2.js";import a from"./7OU6NVXW.js";import{b as f}from"./IMJMO6DB.js";import{J as h,K as t,L as y,P as _,a as g,b as n}from"./RNRMSLW5.js";import"./G6QKOIC3.js";export default $arcgis.t(([{c:v},{e:$}])=>{var R=g`:host{display:flex}.arcgis-legend--card__layer-row{display:flex;flex:1}.arcgis-legend--card__color-ramp-container{justify-content:center}.arcgis-legend--card__symbol-container{display:flex;flex-direction:column}.arcgis-legend--card__interval-separators-container{text-align:center}.arcgis-legend--card__interval-separator{font-size:.5em}.arcgis-legend--card__ramp-label{margin:0 .5em;white-space:nowrap;height:25px;line-height:var(--calcite-font-line-height-fixed-xl)}`,i={layerRow:"arcgis-legend--card__layer-row",colorRampContainer:"arcgis-legend--card__color-ramp-container",symbolContainer:"arcgis-legend--card__symbol-container",intervalSeparatorsContainer:"arcgis-legend--card__interval-separators-container",intervalSeparator:"arcgis-legend--card__interval-separator",rampLabel:"arcgis-legend--card__ramp-label"},C=25,E=25,S=100,p=class extends h{constructor(){super(...arguments),this.legendElement=null,this.opacity=1}static{this.properties={cssEffectFilter:1,legendElement:0,opacity:9,messages:0}}static{this.styles=R}render(){let e=this.legendElement.infos.slice().reverse();return n`<div class=${t(f(i.layerRow,i.colorRampContainer))}>${this._renderRampLabel(e[0])}<div class=${t(i.symbolContainer)}>${this._renderPreview(e)}${this._renderMiddleStopRampLabel(e)}</div>${this._renderRampLabel(e.at(-1))}</div>`}_renderPreview(e){let{opacity:s}=this,d=this.legendElement.type==="heatmap-ramp",o=e.length-1,r=E,l=o>2&&!d?C*o:S,m=l+20,a=10,b=[[{shape:{type:"path",path:`M0 ${r/2} L${a} 0 L${a} ${r} Z`},fill:e[0].color,stroke:{width:0}},{shape:{type:"rect",x:a,y:0,width:l,height:r},fill:{type:"linear",x1:a,y1:0,x2:l+a,y2:0,colors:e.map((c,u)=>({color:c.color,offset:d&&"ratio"in c?c.ratio:u/o}))},stroke:{width:0}},{shape:{type:"path",path:`M${l+a} 0 L${m} ${r/2} L${l+a} ${r} Z`},fill:e[e.length-1].color,stroke:{width:0}}]],L=this.legendElement.type==="opacity-ramp"?this.messages.previewOpacityRampAriaLabel:this.messages.previewColorRampAriaLabel,w=$(b,m,r,{ariaLabel:L}),x={filter:this.cssEffectFilter,opacity:s==null?void 0:`${s}`};return n`<div style=${y(x)}>${w}</div>`}_renderMiddleStopRampLabel(e){let s=e.length%2!==0?e[e.length/2|0]:null;return s?n`<div class=${t(i.intervalSeparatorsContainer)}><div class=${t(i.intervalSeparator)}>|</div>${this._renderRampLabel(s)}</div>`:null}_renderRampLabel(e){return n`<div class=${t(i.rampLabel)}>${v(e,this.legendElement.type,this.messages)}</div>`}};_("arcgis-legend-card-color-ramp",p);return p},a,b)