/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import { c as l } from "../../chunks/runtime.js";
import { css as r, html as s } from "lit";
import { createRef as o, ref as a } from "lit-html/directives/ref.js";
import { LitElement as f, createEvent as t } from "@arcgis/lumina";
import * as i from "@arcgis/core/core/reactiveUtils.js";
const h = r`:host{display:block}`;
class c extends f {
  constructor() {
    super(...arguments), this.enabled = !1, this.floorFilterRef = o(), this.facilityChanged = t(), this.levelChanged = t(), this.siteChanged = t(), this._floorFilterReady = () => {
      this.floorFilterRef.value && (this._facilityHandle?.remove(), this._facilityHandle = i.watch(() => this.floorFilterRef.value?.facility, (e) => {
        e && this.facilityChanged.emit(e);
      }), this._levelHandle?.remove(), this._levelHandle = i.watch(() => this.floorFilterRef.value?.level, (e) => {
        e && this.levelChanged.emit(e);
      }), this._siteHandle?.remove(), this._siteHandle = i.watch(() => this.floorFilterRef.value?.site, (e) => {
        e && this.siteChanged.emit(e);
      }));
    };
  }
  static {
    this.properties = { enabled: 5, floorFilterRef: 0, mapView: 0 };
  }
  static {
    this.styles = h;
  }
  render() {
    return this.enabled && this.mapView && s`<arcgis-floor-filter auto-destroy-disabled .view=${this.mapView} @arcgisReady=${this._floorFilterReady} ${a(this.floorFilterRef)}></arcgis-floor-filter>` || "";
  }
  disconnectedCallback() {
    super.disconnectedCallback(), this.floorFilterRef.value && this.floorFilterRef.value.destroy();
  }
}
l("map-floor-filter", c);
export {
  c as MapFloorFilter
};
