/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import { c as t } from "../../chunks/runtime.js";
import { html as e } from "lit";
import { LitElement as s, createEvent as i } from "@arcgis/lumina";
import { u as o } from "../../chunks/useT9n.js";
import { createRef as r, ref as a } from "lit/directives/ref.js";
import "@arcgis/toolkit/intl";
import "lodash-es";
import "luxon";
import "d3-array";
import "@arcgis/toolkit/type";
import "../../chunks/series-types.js";
import "../../chunks/index.js";
import "@arcgis/core/Graphic.js";
import "@arcgis/core/renderers/support/jsonUtils.js";
import "@arcgis/core/symbols/support/symbolUtils.js";
import "@esri/arcgis-html-sanitizer";
import "@arcgis/core/intl.js";
import "@arcgis/core/layers/support/FeatureFilter.js";
import "@arcgis/core/smartMapping/statistics/histogram.js";
import "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
import "simple-statistics";
import "@arcgis/core/request.js";
import "@arcgis/core/core/sql.js";
import "@arcgis/core/AttributeBinsGraphic.js";
import "@arcgis/core/geometry/support/jsonUtils.js";
import "@arcgis/core/rest/support/AttributeBinsQuery.js";
import "@arcgis/core/rest/support/StatisticDefinition.js";
import "@arcgis/core/time/TimeExtent.js";
import "@arcgis/core/core/promiseUtils.js";
import "@arcgis/toolkit/dom";
import { e as p } from "../../chunks/popover-ui-utils.js";
class l extends s {
  constructor() {
    super(...arguments), this._messages = o(), this.popoverElement = r(), this.onAddXGuide = () => {
      this.open = !1, this.arcgisChartsAddXAxisGuide.emit();
    }, this.onAddYGuide = () => {
      this.open = !1, this.arcgisChartsAddYAxisGuide.emit();
    }, this.enableXAxisGuide = !1, this.enableYAxisGuide = !1, this.placement = "bottom", this.open = !1, this.arcgisChartsAddXAxisGuide = i(), this.arcgisChartsAddYAxisGuide = i(), this.arcgisChartsConfigPopoverClose = i();
  }
  static {
    this.properties = { enableXAxisGuide: 5, enableYAxisGuide: 5, messageOverrides: 0, referenceElement: 0, placement: 1, open: 5 };
  }
  async reposition() {
    await this.popoverElement.value?.reposition();
  }
  updated() {
    p(this.popoverElement.value, this.open);
  }
  guidePopoverClose() {
    this.open = !1, this.arcgisChartsConfigPopoverClose.emit();
  }
  render() {
    return e`<calcite-popover .open=${this.open} .referenceElement=${this.referenceElement ?? document.body} flip-disabled pointer-disabled offset-distance=-18 @calcitePopoverClose=${this.guidePopoverClose} .placement=${this.placement} auto-close label ${a(this.popoverElement)}><calcite-panel .heading=${this._messages.guideType} closable @calcitePanelClose=${this.guidePopoverClose}>${this.enableXAxisGuide ? e`<calcite-action .label=${this._messages.addXAxisGuide} .text=${this._messages.addXAxisGuide ?? ""} @click=${this.onAddXGuide} icon=x-axis-guide text-enabled></calcite-action>` : null}${this.enableYAxisGuide ? e`<calcite-action .label=${this._messages.addYAxisGuide} .text=${this._messages.addYAxisGuide ?? ""} @click=${this.onAddYGuide} icon=y-axis-guide text-enabled></calcite-action>` : null}</calcite-panel></calcite-popover>`;
  }
}
t("arcgis-charts-config-guides-type-popover", l);
export {
  l as ArcgisChartsConfigGuidesTypePopover
};
