/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import { c as r } from "../../chunks/runtime.js";
import { css as i, html as l } from "lit";
import { LitElement as s, safeStyleMap as c, safeClassMap as p } from "@arcgis/lumina";
import { s as o, a as n } from "../../chunks/utils2.js";
const m = i`.layer-row{display:flex}.layer-cell{padding:var(--calcite-spacing-xxs) 0;vertical-align:middle;word-break:break-word}.layer-cell-symbols{text-align:center}.layer-cell-info{padding-right:var(--calcite-spacing-sm);padding-left:var(--calcite-spacing-sm);max-width:250px;word-break:normal;word-wrap:normal;font-size:var(--calcite-font-size-sm)}.ramps{margin-left:var(--calcite-spacing-sm)}:dir(rtl) .ramps{margin-right:var(--calcite-spacing-sm);margin-left:auto}.color-ramp{width:24px}.opacity-ramp{background-image:url(data:image/avif;base64,AAAAHGZ0eXBhdmlmAAAAAG1pZjFhdmlmbWlhZgAAANZtZXRhAAAAAAAAACFoZGxyAAAAAAAAAABwaWN0AAAAAAAAAAAAAAAAAAAAAA5waXRtAAAAAAABAAAAImlsb2MAAAAAREAAAQABAAAAAAD6AAEAAAAAAAAAHgAAACNpaW5mAAAAAAABAAAAFWluZmUCAAAAAAEAAGF2MDEAAAAAVmlwcnAAAAA4aXBjbwAAAAxhdjFDgQAMAAAAABRpc3BlAAAAAAAAAAgAAAAIAAAAEHBpeGkAAAAAAwgICAAAABZpcG1hAAAAAAAAAAEAAQOBAgMAAAAmbWRhdBIACggYCL/kgIaDQjIQGAAAAEBAA1LuL7oS8L0QEA==)}.ramp-labels{display:flex;flex-flow:column nowrap;justify-content:space-between}.ramp-label{position:relative;padding:0 var(--calcite-spacing-sm);line-height:var(--calcite-font-size-sm);white-space:nowrap;font-size:var(--calcite-font-size-sm)}.ramp-label:before{display:block;position:absolute;top:.25em;right:100%;border-width:3px 4px 3px 0;border-style:solid;border-color:transparent var(--calcite-color-text-1) transparent transparent;width:0;height:0;content:""}.ramp-label:first-child{margin-top:calc(var(--calcite-font-size-sm) / 3 * -1)}.ramp-label:last-child{bottom:calc(var(--calcite-font-size-sm) * .25 * -1)}.layer-caption{display:table-caption;padding:var(--calcite-spacing-sm) 0}:dir(rtl) .ramp-label:before{right:auto;left:100%;border-width:3px 0 3px 4px;border-color:transparent transparent transparent var(--calcite-color-text-1)}`;
class d extends s {
  constructor() {
    super(...arguments), this.legendElement = null, this.opacity = 1;
  }
  static {
    this.properties = { _preview: 16, legendElement: 0, opacity: 9, messages: 0 };
  }
  static {
    this.styles = m;
  }
  get _preview() {
    const e = this.legendElement.preview;
    if (!e)
      return null;
    const a = this.legendElement.type === "opacity-ramp", A = a ? "opacity-ramp" : "";
    e.className = `color-ramp ${A}`, this.opacity != null && (e.style.opacity = this.opacity.toString());
    const t = a ? this.messages.previewOpacityRampAriaLabel : this.messages.previewColorRampAriaLabel;
    return o(e, t), e;
  }
  render() {
    const { legendElement: e, _preview: a } = this;
    if (!a)
      return null;
    const A = { height: a.style.height };
    return l`<div class="layer-row"><div class="layer-cell layer-cell-symbols"><div class="ramps">${a}</div></div><div class="layer-cell layer-cell-info"><div class="ramp-labels" style=${c(A)}>${e.infos.map((t) => this._renderRampLabel(t, e.type))}</div></div></div>`;
  }
  _renderRampLabel(e, a) {
    return l`<div class=${p(e.label ? "ramp-label" : void 0)}>${n(e, a, this.messages)}</div>`;
  }
}
r("arcgis-legend-classic-color-ramp", d);
export {
  d as ArcgisLegendClassicColorRamp
};
