import { c as t } from "../../chunks/runtime.js";
import { usePropertyChange as e } from "@arcgis/lumina/controllers";
import s from "@geoscene/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 GeoScene, All Rights Reserved, unless otherwise specified.
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
v4.33.18 */
const h = n`@layer{geoscene-area-measurement-2d{display:block}}`, l = r(
  // Workaround for 
  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.geoscenePropertyChange = e()("state"), this.geosceneReady = 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("geoscene-area-measurement-2d", m);
export {
  m as GeosceneAreaMeasurement2d
};