import { c as t } from "../../chunks/runtime.js";
import { usePropertyChange as s } from "@arcgis/lumina/controllers";
import e from "@geoscene/core/widgets/DistanceMeasurement2D.js";
import { LitElement as i, createEvent as o, noShadowRoot as a } from "@arcgis/lumina";
import { m as n } from "../../chunks/useWidget.js";
import { css as r } 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 c = r`@layer{geoscene-distance-measurement-2d{display:block}}`, h = n(e);
class d extends i {
  constructor() {
    super(...arguments), this.widget = h(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 = s()("state"), this.geosceneReady = o();
  }
  static {
    this.properties = { autoDestroyDisabled: 5, icon: 1, label: 1, position: 1, referenceElement: 1, snappingOptions: 0, state: 3, unit: 1, unitOptions: 0 };
  }
  static {
    this.shadowRootOptions = a;
  }
  static {
    this.styles = c;
  }
  async clear() {
    this.viewModel?.clear();
  }
  async destroy() {
    await this.manager.destroy();
  }
  async start() {
    this.viewModel?.start();
  }
}
t("geoscene-distance-measurement-2d", d);
export {
  d as GeosceneDistanceMeasurement2d
};