/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as e}from"tslib";import{property as t,subclass as i}from"../../../../core/accessorSupport/decorators.js";import s from"../../../Widget.js";import{css as o}from"./css.js";import{getUnivariateColorSizeRampElements as r,getUnivariateSizeRampSize as l,getUnivariateColorRampSize as a,getUnivariateColorRampPreview as n,getUnivariateColorRampMargin as p}from"../support/univariateUtils.js";import{attachToNode as c}from"../../support/styleUtils.js";import{tsx as m,isRTL as f}from"../../../support/widget.js";let d=class extends s{constructor(e,t){super(e,t),this.cssEffectFilter=null,this.legendElement=null,this.opacity=1}render(){const{legendElement:e,opacity:t,cssEffectFilter:i,key:s}=this,{sizeRampElement:d,colorRampElement:y}=r(e,"horizontal");if(!d)return null;const u=l(d,"full",!1,"horizontal"),v=a(d,"full",!1,"horizontal"),h=n(y,{width:v,height:12,rampAlignment:"horizontal",opacity:t,type:"full",cssEffectFilter:i,ariaLabel:this.messages?.previewColorRampAriaLabel}),g=p(d,"card"),x=d.infos.length-1,w=d.infos.map((e,t)=>0===t||t===x?m("div",{key:t},e.label):null),b={display:"flex",flexDirection:"column"},E={display:"flex",flexDirection:"row"},z={marginTop:"3px",display:"flex"};f(this.container)?z.marginRight=`${g}px`:z.marginLeft=`${g}px`;const C={width:`${u}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return m("div",{class:o.layerRow,key:`${s}-container`,styles:b},m("div",{class:this.classes(o.symbolContainer,o.sizeRampHorizontal),styles:E},d.infos.map((e,t)=>m("div",{afterCreate:c,bind:e.preview,class:o.symbol,key:t}))),m("div",{class:o.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:z},m("div",{afterCreate:c,bind:h})),m("div",{class:o.layerInfo},m("div",{class:o.rampLabelsContainer,styles:C},w)))}};e([t()],d.prototype,"cssEffectFilter",void 0),e([t()],d.prototype,"legendElement",void 0),e([t()],d.prototype,"messages",void 0),e([t()],d.prototype,"opacity",void 0),d=e([i("esri.widgets.Legend.styles.card.UnivariateColorSizeRamp")],d);export{d as default};
