/*! 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 a from"./7OU6NVXW.js";import{J as P,K as p,L as u,P as A,a as N,b as $}from"./RNRMSLW5.js";import"./G6QKOIC3.js";export default $arcgis.t(([{e:k,g:C,h:I}])=>{var O=N`.arcgis-legend--card__size-ramp--container{display:flex;align-items:center;justify-content:center}.arcgis-legend--card__size-ramp--vertical-container{display:flex;flex-direction:column;align-items:center;justify-content:center}.arcgis-legend--card__size-ramp--label{margin:0 .5em;white-space:nowrap}.arcgis-legend--card__size-ramp--vertical-ramp{display:flex;flex-direction:column;align-items:center}.arcgis-legend--card__size-ramp--ramp{display:flex;flex-direction:row-reverse;align-items:center}.arcgis-legend--card__size-ramp--preview{display:flex}`,d={container:"arcgis-legend--card__size-ramp--container",verticalContainer:"arcgis-legend--card__size-ramp--vertical-container",label:"arcgis-legend--card__size-ramp--label",ramp:"arcgis-legend--card__size-ramp--ramp",verticalRamp:"arcgis-legend--card__size-ramp--vertical-ramp",preview:"arcgis-legend--card__size-ramp--preview"},X="#ddd";function Y(e){if(!e)return;if(e.type.includes("3d")){if(!("symbolLayers"in e)||!e.symbolLayers?.length)return;let i=e.symbolLayers.at(-1),s=i&&"resource"in i?i.resource?.primitive:void 0;return s==="circle"||s==="cross"||s==="kite"||s==="sphere"||s==="cube"||s==="diamond"}let a="style"in e?e.style:void 0;return a==="circle"||a==="diamond"||a==="cross"}function q(e){if(e){if(e.type.includes("3d")){if(!("symbolLayers"in e)||!e.symbolLayers?.length)return;let a=e.symbolLayers.at(-1),i=a&&"resource"in a?a.resource?.primitive:void 0;return i==="triangle"||i==="cone"||i==="tetrahedron"}return"style"in e&&e.style==="triangle"}}var j=class extends P{constructor(){super(...arguments),this.hasIndicators=!1,this.legendElement=null,this.opacity=1}static{this.properties={hasIndicators:5,legendElement:0,opacity:9,messages:0}}static{this.styles=O}render(){if(this.legendElement.theme==="spike")return $`<div style=${u({display:"flex",flex:"1",justifyContent:"center"})}><arcgis-legend-spike-ramp .legendElement=${this.legendElement} .messages=${this.messages}></arcgis-legend-spike-ramp></div>`;let{legendElement:a,hasIndicators:i,opacity:s}=this,c=a.infos,y=c.at(0),m=c.at(-1);if(!y||!m)return null;let{label:v,...x}=y,{label:f,...z}=m,t=x.preview,r=z.preview;if(!t||!r)return null;t=t.cloneNode(!0),t.style.display="flex",I(t,C(this.messages,v)),r=r.cloneNode(!0),r.style.display="flex",I(r,C(this.messages,f));let l={opacity:`${s??""}`};return $`<div class=${p(i?d.verticalContainer:d.container)}><div class=${p(d.label)}>${i?v:f}</div><div class=${p(i?d.verticalRamp:d.ramp)}><div class=${p(d.preview)} style=${u(l)}>${t}</div>${this._renderSizeRampLines(a)}<div class=${p(d.preview)} style=${u(l)}>${r}</div></div><div class=${p(d.label)}>${i?f:v}</div></div>`}_renderSizeRampLines(a){let i=a.infos,s=i.at(0),c=i.at(-1);if(!s||!c)return null;let y=s.symbol,m=this.hasIndicators,v=s.size&&typeof s.size=="number"?s.size:0,x=c.size&&typeof c.size=="number"?c.size:0,f=s.outlineSize||0,z=c.outlineSize||0,t=k(v+f),r=k(x+z),l=m?t:t+50,g=m?t/2+50:t,h=q(y),_=Y(y),o=document.createElement("canvas");o.width=l,o.height=g,o.style.width=`${o.width}px`,o.style.height=`${o.height}px`;let n=o.getContext("2d");if(m){n.beginPath();let b=0,w=0,L=l/2-r/2,M=g;n.moveTo(b,w),n.lineTo(L,M);let T=l,E=0,S=l/2+r/2,R=g;n.moveTo(T,E),n.lineTo(S,R)}else{n.beginPath();let b=0,w=g/2-r/2,L=l;n.moveTo(b,w),n.lineTo(L,0);let T=0,E=g/2+r/2,S=l,R=g;n.moveTo(T,E),n.lineTo(S,R)}return n.strokeStyle=X,n.stroke(),$`<div style=${u(m?{display:"flex",marginTop:`-${h?0:_?t/2:0}px`,marginBottom:`-${h?r:_?r/2:0}px`}:{display:"flex",marginRight:`-${h?0:_?t/2:0}px`,marginLeft:`-${h?0:_?r/2:0}px`})}>${o}</div>`}};A("arcgis-legend-card-size-ramp",j);return j},a)