import { c as t } from "../../chunks/runtime.js";
import { usePropertyChange as e } from "@arcgis/lumina/controllers";
import s from "@arcgis/core/widgets/AreaMeasurement2D.js";
import { LitElement as i, createEvent as a, noShadowRoot as o } from "@arcgis/lumina";
import { m as r } from "../../chunks/useWidget.js";
import { css as n } from "@lit/reactive-element/css-tag.js";
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
v4.33.16 */
const h = n`@layer{arcgis-area-measurement-2d{display:block}}`, l = r(
  // Workaround for https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/61559
  s
);
class m extends i {
  constructor() {
    super(...arguments), this.widget = l(this), this.viewModel = this.widget.viewModel, this.autoDestroyDisabled = !1, this.icon = this.widget.icon, this.label = this.widget.label, this.position = "bottom-left", this.snappingOptions = this.widget.snappingOptions, this.state = this.viewModel.state, this.unit = this.widget.unit, this.unitOptions = this.widget.unitOptions, this.arcgisPropertyChange = e()("state"), this.arcgisReady = a();
  }
  static {
    this.properties = { autoDestroyDisabled: 5, icon: 1, label: 1, position: 1, referenceElement: 1, snappingOptions: 0, state: 3, unit: 1, unitOptions: 0 };
  }
  static {
    this.shadowRootOptions = o;
  }
  static {
    this.styles = h;
  }
  async clear() {
    this.viewModel?.clear();
  }
  async destroy() {
    await this.manager.destroy();
  }
  async start() {
    this.viewModel?.start();
  }
}
t("arcgis-area-measurement-2d", m);
export {
  m as ArcgisAreaMeasurement2d
};
