/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import { c as i } from "../../chunks/runtime.js";
import { css as o, html as t } from "lit";
import { usePropertyChange as c } from "@arcgis/lumina/controllers";
import { LitElement as a, createEvent as r } from "@arcgis/lumina";
import { u as s } from "../../chunks/useT9n.js";
import { u as n } from "../../chunks/useView.js";
import { s as l, a as m, u as d } from "../../chunks/time-utils.js";
const u = o`calcite-action{--calcite-action-background-color-hover: var(--calcite-color-foreground-1);--calcite-action-background-color-press: var(--calcite-color-foreground-1);--calcite-action-background-color: var(--calcite-color-foreground-1);--calcite-action-text-color-press: var(--calcite-color-text-1);--calcite-action-text-color: var(--calcite-color-text-1);cursor:default}calcite-input-time-zone{--calcite-color-background: var(--calcite-color-foreground-1);--calcite-color-border-input: transparent}calcite-label{--calcite-label-margin-bottom: 0;font-weight:var(--calcite-font-weight-medium);padding-block:var(--calcite-spacing-sm);padding-inline:var(--calcite-spacing-md)}`;
class g extends a {
  constructor() {
    super(...arguments), this._messages = s({ blocking: !0 }), this.disabled = !1, this.icon = "time-zone", this.view = n(this), this.arcgisPropertyChange = c()("state"), this.arcgisReady = r();
  }
  static {
    this.properties = { _interactive: 16, _resolvedTimeZone: 16, actionIcon: 3, disabled: 7, icon: 3, messageOverrides: 0, label: 1, referenceElement: 1, state: 32, view: 0 };
  }
  static {
    this.styles = u;
  }
  get _interactive() {
    return !(this.disabled || this.state === "disabled");
  }
  get _resolvedTimeZone() {
    const e = this.view?.timeZone;
    return !e || e === l ? m : e;
  }
  get state() {
    return this.view?.ready ? "ready" : "disabled";
  }
  render() {
    return t`<calcite-action .disabled=${!this._interactive} .icon=${this.actionIcon} text>${this._resolvedTimeZone === d ? t`<calcite-label>${this._messages.noAdjustment}</calcite-label>` : t`<calcite-input-time-zone mode=region overlay-positioning=fixed read-only .value=${this._resolvedTimeZone}></calcite-input-time-zone>`}</calcite-action>`;
  }
}
i("arcgis-time-zone-label", g);
export {
  g as ArcgisTimeZoneLabel
};
