import { c as $ } from "../../chunks/runtime.js";
import { css as C, html as r } from "lit";
import { ref as v } from "lit/directives/ref.js";
import { g as _ } from "../../chunks/globalCss.js";
import S from "@arcgis/core/views/Theme.js";
import { u as k } from "../../chunks/useT9n.js";
import { generateGuid as I } from "@arcgis/toolkit/string";
import { classes as h } from "@arcgis/toolkit/dom";
import { usePropertyChange as M } from "@arcgis/lumina/controllers";
import { m as E } from "../../chunks/useViewModel.js";
import p from "@arcgis/core/Color.js";
import { LitElement as T, createEvent as P, safeClassMap as d, nothing as u } from "@arcgis/lumina";
import { substitute as R } from "@arcgis/core/intl.js";
import { watch as D } from "@arcgis/core/core/reactiveUtils.js";
import O from "@arcgis/core/widgets/support/GridControls/GridControlsViewModel.js";
/*! 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 */
function L(o) {
  if (o == null || Number.isNaN(o))
    return 0;
  const e = o + 180;
  return Math.trunc(x(e, 360));
}
function z(o) {
  let e = o;
  return e == null || (typeof e == "string" && (e = Number.parseInt(e, 10)), Number.isNaN(e)) ? 0 : x(Math.trunc(e), 360) - 180;
}
function x(o, e) {
  return (o % e + e) % e;
}
const w = {
  fromAttribute: (o) => p.fromHex(o),
  toAttribute: (o) => typeof o == "string" ? o : o?.toHex() ?? ""
}, B = C`.esri-widget__heading{color:var(--calcite-color-text-2);margin:0 0 .5rem;font-weight:var(--calcite-font-weight-semibold)}h1.esri-widget__heading{font-size:var(--calcite-font-size-xl)}h2.esri-widget__heading{font-size:var(--calcite-font-size-md)}h3.esri-widget__heading,h4.esri-widget__heading,h5.esri-widget__heading,h6.esri-widget__heading{font-size:var(--calcite-font-size)}.esri-widget{--esri-widget-padding-x: 15px;--esri-widget-padding-y: var(--calcite-spacing-md);--esri-widget-padding: var(--esri-widget-padding-y) var(--esri-widget-padding-x);box-sizing:border-box;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget *,.esri-widget :before,.esri-widget :after{box-sizing:inherit}.esri-widget.esri-widget--disabled>*{opacity:.4;pointer-events:none}.esri-widget.esri-widget--compact{--esri-widget-padding-y: 0;--esri-widget-padding-x: 0}.esri-widget__anchor{color:var(--calcite-color-text-2)}.esri-widget__anchor:hover{color:var(--calcite-color-text-3)}.esri-widget__anchor:hover,.esri-widget__anchor:focus{text-decoration:underline}.esri-widget__anchor--disabled{opacity:.4;pointer-events:none}.esri-widget__header{background-color:var(--calcite-color-foreground-1);flex:1 0 100%;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:12px 0 12px 15px;display:flex}.esri-widget__header .esri-widget__heading{width:calc(100% - 48px);text-align:initial;color:var(--calcite-color-text-1);align-items:center;margin:0;padding:0;display:flex}.esri-widget__header-button{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);border:none;flex:0 0 48px;justify-content:center;align-self:stretch;align-items:center;width:48px;padding:0;display:flex}.esri-widget__footer{background-color:var(--calcite-color-foreground-1);justify-content:center;align-items:center;width:100%;min-height:48px;display:flex}.esri-widget__footer-pagination{color:var(--calcite-color-text-2);justify-content:space-between;align-items:center;display:flex}.esri-widget__footer-pagination-previous-button,.esri-widget__footer-pagination-next-button{cursor:pointer;background-color:var(--calcite-color-foreground-1);border:0;margin:0 7px;padding:12px 15px;transition:background-color .125s ease-in-out}.esri-widget__footer-pagination-previous-button:hover,.esri-widget__footer-pagination-previous-button:focus,.esri-widget__footer-pagination-next-button:hover,.esri-widget__footer-pagination-next-button:focus{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.esri-menu{visibility:hidden;z-index:1;background-clip:padding;background-color:var(--calcite-color-foreground-1);background-clip:padding-box;width:100%;max-height:0;margin:2px 0 0;padding:0;font-size:var(--calcite-font-size);line-height:var(--calcite-spacing-xl);position:absolute;top:100%;left:0;overflow:hidden;box-shadow:0 1px 2px #0000004d}.esri-menu .esri-menu__header{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse);padding:6px 12px}.esri-menu__list{margin:0;padding:0;list-style:none}.esri-menu__list-item{cursor:pointer;border-top:1px solid #adadad4d;border-left:3px solid #0000;padding:.8em 1em}.esri-menu__list-item [class^=esri-icon-],.esri-menu__list-item [class*=" esri-icon-"]{padding-right:2.8px}.esri-menu__list-item:first-child{border-top:none}.esri-menu__list-item--focus,.esri-menu__list-item:hover,.esri-menu__list-item:focus{background-color:var(--calcite-color-foreground-1)}.esri-menu__list-item:active{background-color:var(--calcite-color-foreground-current)}.esri-menu__list-item--active,.esri-menu__list-item--active:hover,.esri-menu__list-item--active:focus{background-color:var(--calcite-color-foreground-1);border-left-color:var(--calcite-color-brand)}.esri-widget__table{border-collapse:collapse;color:var(--calcite-color-text-1);border:none;width:100%;line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget__table tr:nth-child(odd){background-color:var(--calcite-color-transparent)}.esri-widget__table tr:nth-child(2n){background-color:var(--calcite-color-transparent-press)}.esri-widget__table tr a{color:var(--calcite-color-text-2)}.esri-widget__table tr a:hover,.esri-widget__table tr a:focus{color:var(--calcite-color-text-1)}.esri-widget__table tr td,.esri-widget__table tr th{vertical-align:top;word-break:break-word;padding:.5em .7em;font-size:var(--calcite-font-size-sm);font-weight:var(--calcite-font-weight-regular)}.esri-widget__table tr th{text-align:left;border-right:3px solid #0000000d;width:50%}.esri-widget__table tr td{width:50%}.esri-input{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1);border:1px solid #959595;font-size:var(--calcite-font-size)}.esri-input::-ms-clear{display:none}.esri-input::placeholder{opacity:1;color:var(--calcite-color-text-2)}.esri-input:placeholder-shown{text-overflow:ellipsis}.esri-input[type=text],.esri-input[type=password],.esri-input[type=number]{height:32px;padding:0 .5em}calcite-combobox.esri-input{border:none}.esri-widget__content--empty{text-align:center;color:var(--calcite-color-border-input);flex-flow:column wrap;align-items:center;padding:18px 22px;display:flex}.esri-widget__content--empty h1.esri-widget__heading,.esri-widget__content--empty h2.esri-widget__heading,.esri-widget__content--empty h3.esri-widget__heading,.esri-widget__content--empty h4.esri-widget__heading,.esri-widget__content--empty h5.esri-widget__heading{font-weight:var(--calcite-font-weight-regular)}.esri-widget__content-illustration--empty{width:128px;padding:1rem 0}.esri-widget__content-icon--empty{width:32px;padding:.5rem 0}.esri-select{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background:var(--calcite-color-foreground-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 32 32' width='32' height='32'%3E%3Cpath d='M8 11.207l-4-4V5.793l4 4 4-4v1.414z' fill='%23adadad' fillrule='nonzero'/%3E%3C/svg%3E") 100% no-repeat;border:1px solid #959595;border-radius:0;width:100%;height:32px;margin:0;padding:0 .5em;font-family:inherit;font-size:.85em;display:block}.esri-select[disabled]{cursor:auto}.esri-select::-ms-expand{display:none}.esri-disabled a,.esri-disabled [role=menu],.esri-disabled [role=checkbox],.esri-disabled [class^=esri-icon-],.esri-disabled [class*=" esri-icon-"]{color:var(--calcite-color-text-3)}.keynav-mode .esri-widget:focus,.keynav-mode .esri-widget :focus{z-index:1;outline-offset:2px;outline:2px solid #adadad}.esri-widget__loader-animation{border:.15em solid #adadad4d;border-top-color:var(--calcite-color-border-input);border-radius:100%;width:1em;height:1em;font-size:var(--calcite-font-size-md);animation:1.25s linear infinite esri-rotate;display:block;transform:translateZ(0)}:dir(rtl) .esri-widget__table th{text-align:right;border-left:3px solid #0000000d;border-right:none}:dir(rtl) .esri-select{background-position:0}:dir(rtl) .esri-menu__list-item{border-left:none;border-right:3px solid #0000}:dir(rtl) .esri-menu__list-item [class^=esri-icon-],:dir(rtl) .esri-menu__list-item [class*=" esri-icon-"]{padding-left:2px;padding-right:0}:dir(rtl) .esri-menu__list-item--active{border-right-color:var(--calcite-color-brand)}.esri-icon-font-fallback-text{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.esri-rotating{animation:1.25s linear infinite esri-rotate;transform:translateZ(0)}.esri-clearfix:before,.esri-clearfix:after{content:" ";display:table}.esri-clearfix:after{clear:both}.esri-interactive{cursor:pointer}.esri-hidden{display:none!important}.esri-invisible{visibility:hidden!important}.esri-offscreen{position:absolute;top:-999em;left:-999em}.esri-match-height{flex-direction:column;flex:auto;display:flex;overflow:hidden}:host{display:flex}.arcgis-grid-controls{user-select:none;display:flex;flex-flow:column wrap;padding:var(--calcite-spacing-sm);overflow-y:auto;width:100%;.container{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--calcite-spacing-sm)}.numeric-inputs-container{display:grid;grid-auto-columns:1fr;grid-auto-flow:column;gap:var(--calcite-spacing-sm)}arcgis-labeled-switch{margin-block-end:var(--calcite-spacing-sm)}.switch--bordered{border-width:0 0 var(--calcite-spacing-px) 0;border-style:solid;border-color:var(--calcite-color-border-1);padding-block-end:var(--calcite-spacing-sm)}.tile-group{display:flex;column-gap:var(--calcite-spacing-md);align-items:start;margin-bottom:calc(0px - var(--calcite-spacing-sm))}.tile{position:relative;.content{display:flex;flex-direction:column;row-gap:var(--calcite-spacing-md);align-items:center;padding:var(--calcite-spacing-md);color:var(--calcite-color-text-2)}&.disabled{opacity:var(--calcite-opacity-disabled)}&:focus-within{outline:var(--calcite-spacing-base) solid var(--calcite-color-brand);outline-offset:var(--calcite-spacing-base)}input[type=radio]{appearance:none;position:absolute;inset:0;opacity:.001;border:var(--calcite-spacing-px) solid transparent;cursor:pointer;&:checked+.content{border:var(--calcite-spacing-px) solid var(--calcite-color-brand)}+.content{border:var(--calcite-spacing-px) solid transparent;calcite-label{margin-bottom:calc(0px - var(--calcite-label-margin-bottom, .75rem));font-weight:var(--calcite-font-weight-medium)}}}}.inline-icon{margin-left:var(--calcite-spacing-xs);vertical-align:top;color:var(--calcite-color-status-warning)}}`, N = "arcgis-grid-controls", s = {
  base: N,
  borderedSwitch: "switch--bordered",
  container: "container",
  numericInputsContainer: "numeric-inputs-container",
  tileGroup: "tile-group",
  tile: "tile",
  tileDisabled: "disabled",
  tileContent: "content",
  inlineIcon: "inline-icon"
}, m = {
  componentIcon: "grid-unit",
  gridTheme: { light: "circle", dark: "circle-area", custom: "palette" },
  placementState: { interactive: "maximum-territory-distance", place: "move", rotate: "rotate" },
  warning: "exclamation-mark-triangle"
}, b = p.fromArray([115, 115, 115]), f = p.fromArray([200, 200, 200]), W = ["interactive", "place", "rotate"], j = E(O);
class G extends T {
  constructor() {
    super(...arguments), this._labelUid = I(), this._messages = k({}), this._viewModel = j(this), this._placementModeButtonRefs = /* @__PURE__ */ new Map(), this.numericSpacingInputShouldBeVisible = this._viewModel.numericSpacingInputShouldBeVisible, this.view = this._viewModel.view, this.icon = m.componentIcon, this.snappingOptions = this._viewModel.snappingOptions, this.hideColorSelection = !1, this.hideDynamicScaleToggle = !1, this.hideGridEnabledToggle = !1, this.hideNumericInputs = !1, this.hideGridSnapEnabledToggle = !1, this.hideLineIntervalInput = !1, this.hideOutOfScaleWarning = !1, this.hidePlacementButtons = !1, this.hideRotateWithMapToggle = !1, this.rotation = this._viewModel.rotation, this.rotateWithMap = this._viewModel.rotateWithMap, this.spacing = this._viewModel.spacing, this.majorLineInterval = this._viewModel.majorLineInterval, this.gridColor = this._viewModel.gridColor, this.displayEnabled = this._viewModel.displayEnabled, this.gridOutOfScale = this._viewModel.gridOutOfScale, this.unit = this._viewModel.unit, this.dynamicScaling = this._viewModel.dynamicScaling, this.gridControlsEnabled = this._viewModel.gridControlsEnabled, this.interactivePlacementState = this._viewModel.interactivePlacementState, this.snappingEnabled = this._viewModel.snappingEnabled, this.effectiveSpacingAfterDynamicScaling = this._viewModel.effectiveSpacingAfterDynamicScaling, this.placementDisabled = this._viewModel.placementDisabled, this.autoDestroyDisabled = !1, this.arcgisPropertyChange = M()("customColor", "theme", "spacing", "rotation", "majorLineInterval", "rotateWithMap", "dynamicScaling", "snappingEnabled", "interactivePlacementState", "displayEnabled", "gridOutOfScale", "effectiveSpacingAfterDynamicScaling", "gridControlsEnabled", "gridColor"), this.arcgisReady = P();
  }
  static {
    this.properties = { _placementModeButtonRefs: 16, _warningIconTooltipRef: 16, _themePopoverRef: 16, numericSpacingInputShouldBeVisible: 16, view: 0, referenceElement: 1, position: 3, icon: 1, customColor: [3, { converter: w }], snappingOptions: 0, theme: 1, hideColorSelection: 5, hideDynamicScaleToggle: 5, hideGridEnabledToggle: 5, hideNumericInputs: 5, hideGridSnapEnabledToggle: 5, hideLineIntervalInput: 5, hideOutOfScaleWarning: 5, hidePlacementButtons: 5, hideRotateWithMapToggle: 5, rotation: 11, rotateWithMap: 5, spacing: 11, majorLineInterval: 11, gridColor: [3, { converter: w }], displayEnabled: 4, gridOutOfScale: 7, unit: 1, dynamicScaling: 5, gridControlsEnabled: 4, interactivePlacementState: 3, snappingEnabled: 5, effectiveSpacingAfterDynamicScaling: 43, placementDisabled: 5, autoDestroyDisabled: 5, messageOverrides: 0, label: 1 };
  }
  static {
    this.styles = B;
  }
  get theme() {
    const e = this.gridColor;
    return !e || b.equals(e) ? "dark" : f.equals(e) ? "light" : "custom";
  }
  set theme(e) {
    const i = this._viewModel.view;
    switch (e) {
      case "dark":
        this.gridColor = b;
        break;
      case "custom":
        this.customColor == null && (this.customColor = i?.theme?.accentColor ?? new S().accentColor), this.gridColor = this.customColor;
        break;
      case "light":
      default:
        this.gridColor = f;
        break;
    }
  }
  async destroy() {
    await this.manager.destroy();
  }
  trySetDisplayEnabled(e) {
    this._viewModel.trySetDisplayEnabled(e);
  }
  loaded() {
    this.manager.onLifecycle(() => [
      // Move focus when movement angle changed by touch/mouse (not keyboard!)
      D(() => this._viewModel.gridColor, (e) => {
        const i = e instanceof p ? e : typeof e == "string" ? p.fromHex(e) : null;
        i && !b.equals(e) && !f.equals(i) ? this.customColor = i : b.equals(i) ? this.theme = "dark" : f.equals(i) && (this.theme = "light");
      })
    ]);
  }
  _togglePlacementState(e) {
    this.interactivePlacementState = this.interactivePlacementState === e ? null : e;
  }
  _setWarningIconRef(e) {
    this._warningIconTooltipRef = e;
  }
  _setPopoverRef(e) {
    this._themePopoverRef = e;
  }
  _emptyFunction(e) {
  }
  _setPlacementButtonRef(e) {
    if (e) {
      const i = e.dataset.placementAction;
      this._placementModeButtonRefs.set(i, e);
    } else
      this._placementModeButtonRefs.clear();
  }
  render() {
    return r`<div class=${d(h(s.base, _.widget, _.panel))}><div class=${d(s.container)}>${this._renderContent()}</div></div>`;
  }
  _renderContent() {
    const { hideGridEnabledToggle: e, hidePlacementButtons: i, hideNumericInputs: t, hideLineIntervalInput: a, hideGridSnapEnabledToggle: n, hideDynamicScaleToggle: l, hideRotateWithMapToggle: c, hideColorSelection: g } = this;
    return [
      e ? void 0 : this._renderEnabledToggle(),
      i ? void 0 : this._renderGridPlacementButtons(),
      t ? void 0 : this._renderNumericInputs(),
      a ? void 0 : this._renderIntervalInput(),
      !n && this.snappingOptions ? this._renderSnappingToggle() : void 0,
      l ? void 0 : this._renderDynamicScaleToggle(),
      c ? void 0 : this._renderRotateToggle(),
      g ? void 0 : this._renderColorSelection()
    ];
  }
  _renderGridPlacementButtons() {
    const { interactivePlacementState: e, placementDisabled: i, gridControlsEnabled: t } = this, a = i || !t;
    return r`<calcite-label scale=s>${this._messages.placementOptions}<calcite-action-bar expand-disabled layout=horizontal>${W.map((n) => this._renderPlacementModeButton(n, a, e))}</calcite-action-bar></calcite-label>`;
  }
  _renderPlacementModeButton(e, i, t) {
    const a = this._messages?.placementState?.[e], n = this._placementModeButtonRefs.get(e);
    return r`<div><calcite-action .active=${t === e} alignment=center .disabled=${i} .icon=${m.placementState[e]} data-placement-action=${e ?? u} @click=${() => this._togglePlacementState(e)} .text=${a ?? ""} ${v(this._setPlacementButtonRef)}></calcite-action>${n ? r`<calcite-tooltip overlay-positioning=fixed placement=top .referenceElement=${n}>${a}</calcite-tooltip>` : void 0}</div>`;
  }
  _renderNumericInputs() {
    const { rotation: e, spacing: i, effectiveSpacingAfterDynamicScaling: t, numericSpacingInputShouldBeVisible: a, gridControlsEnabled: n } = this, l = t != null && t !== i;
    return r`<div class=${d(h(s.numericInputsContainer))}>${[
      a ? r`<calcite-label scale=s><span>${this._messages?.inputLabel?.spacing}${l ? r`<calcite-icon class=${d(h(s.inlineIcon))} .icon=${m.warning} scale=s tabindex=0 ${v(this._setWarningIconRef)}></calcite-icon>` : void 0}</span><calcite-input-number .disabled=${!n} number-button-type=none .value=${i?.toFixed(2)} @calciteInputNumberChange=${({ currentTarget: c }) => {
        const g = Number.parseFloat(c.value);
        this.spacing = g, g !== this.spacing && (c.value = `${this.spacing}`);
      }}></calcite-input-number>${l && this._warningIconTooltipRef ? r`<calcite-tooltip overlay-positioning=fixed placement=leading .referenceElement=${this._warningIconTooltipRef}>${R(this._messages?.warnings?.dynamicSpacing ?? "", { actualSpacingIncludingUnit: t }, {
        format: {
          actualSpacingIncludingUnit: {
            type: "number",
            intlOptions: {
              minimumFractionDigits: 2,
              maximumFractionDigits: 2,
              unit: this.unit ?? "meters",
              style: "decimal"
            }
          }
        }
      })}</calcite-tooltip>` : void 0}</calcite-label>` : void 0,
      r`<calcite-label scale=s>${this._messages?.inputLabel?.angle}<calcite-input-number .disabled=${!n} integer number-button-type=none suffix-text=\u00B0 .value=${`${L(e)}`} @calciteInputNumberChange=${({ currentTarget: c }) => this.rotation = z(c.value)}></calcite-input-number></calcite-label>`
    ]}</div>`;
  }
  _renderIntervalInput() {
    const { majorLineInterval: e, gridControlsEnabled: i } = this;
    return r`<div class=${d(h(s.numericInputsContainer))}><calcite-label scale=s>${this._messages?.inputLabel?.interval}<calcite-input-number .disabled=${!i} integer max=15 min=1 number-button-type=vertical .value=${`${e}`} @calciteInputNumberChange=${({ currentTarget: t }) => {
      const a = Number.parseInt(t.value, 10);
      this.majorLineInterval = a, a !== this.majorLineInterval && (t.value = `${this.majorLineInterval}`);
    }}></calcite-input-number></calcite-label></div>`;
  }
  _renderSnappingToggle() {
    const { snappingOptions: e, gridControlsEnabled: i } = this, t = e?.gridEnabled ?? !1;
    return r`<arcgis-labeled-switch .checked=${!!t} .disabled=${!(i && !!e)} .label=${this._messages?.switchLabel?.snap} @arcgisCheckedChanged=${(n) => {
      n.stopPropagation(), this.snappingOptions?.set("gridEnabled", n.detail);
    }}></arcgis-labeled-switch>`;
  }
  _renderDynamicScaleToggle() {
    const { _messages: e, gridOutOfScale: i, dynamicScaling: t, gridControlsEnabled: a } = this, n = !this.hideOutOfScaleWarning && i;
    return r`<arcgis-labeled-switch .checked=${t} .disabled=${!a} .hint=${n ? e?.warnings?.outOfScale : void 0} .hintIcon=${m.warning} hint-kind=warning .label=${e?.switchLabel?.scaling} @arcgisCheckedChanged=${(l) => {
      l.stopPropagation(), this.dynamicScaling = l.detail;
    }}></arcgis-labeled-switch>`;
  }
  _renderRotateToggle() {
    const { gridControlsEnabled: e, rotateWithMap: i } = this;
    return r`<arcgis-labeled-switch .checked=${i} .disabled=${!e} .label=${this._messages?.switchLabel?.rotateWithMap ?? ""} @arcgisCheckedChanged=${(t) => {
      t.stopPropagation(), this.rotateWithMap = t.detail;
    }}></arcgis-labeled-switch>`;
  }
  _renderEnabledToggle() {
    return r`<div class=${d(s.borderedSwitch)}><arcgis-labeled-switch .checked=${this.displayEnabled} .disabled=${!!this.interactivePlacementState} .label=${this._messages?.switchLabel?.display} @arcgisCheckedChanged=${(e) => {
      e.stopPropagation(), this.trySetDisplayEnabled(e.detail);
    }}></arcgis-labeled-switch></div>`;
  }
  _renderColorSelection() {
    const { customColor: e } = this;
    return r`<calcite-label scale=s>${this._messages?.inputLabel?.theme}<div class=${d(s.tileGroup)}>${[
      this._renderThemeTile({ value: "dark" }),
      this._renderThemeTile({ value: "light" }),
      this._renderThemeTile({ value: "custom" }),
      this._themePopoverRef ? r`<calcite-popover auto-close .label=${this._messages?.gridLineColorPopoverLabel ?? ""} overlay-positioning=fixed .referenceElement=${this._themePopoverRef}><calcite-color-picker alpha-channel saved-disabled .value=${e?.toHex({ digits: 8 }) ?? "#000000ff"} @calciteColorPickerChange=${(i) => {
        const t = p.fromHex(i.currentTarget.value);
        t && (this.customColor = t, this.theme = "custom");
      }}></calcite-color-picker></calcite-popover>` : void 0
    ]}</div></calcite-label>`;
  }
  _renderThemeTile(e) {
    const { theme: i, gridControlsEnabled: t } = this, { value: a } = e, n = this._messages?.gridTheme?.[a], l = `${this._labelUid}--theme_tile_${a}`, c = `${l}__label`, g = m.gridTheme[a];
    return r`<div class=${d(h({ [s.tile]: !0, [s.tileDisabled]: !t }))} role=button ${v(a === "custom" ? this._setPopoverRef : this._emptyFunction)}><input aria-labelledby=${c ?? u} .checked=${i === a} .disabled=${!t} id=${l ?? u} .name=${`${this._labelUid}--theme`} @change=${(y) => {
      this.theme = a, y.currentTarget.focus();
    }} tabindex=0 type=radio><div class=${d(s.tileContent)}><calcite-icon .icon=${g} scale=l></calcite-icon><calcite-label .for=${l} id=${c ?? u}>${n}</calcite-label></div></div>`;
  }
}
$("arcgis-grid-controls", G);
export {
  G as ArcgisGridControls
};
