/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import { proxyExports as i, GenericController as s } from "@arcgis/lumina/controllers";
import { a as t } from "./component-utils.js";
import * as r from "@arcgis/core/core/reactiveUtils.js";
const a = (o) => h(o);
class c extends s {
  #e;
  constructor(e) {
    super(e), this.setProvisionalExports(void 0);
  }
  hostConnected() {
    this.component.manager.loadedCalled && t(this.component);
  }
  hostLoad() {
    this.component.manager.destroyed;
  }
  hostLoaded() {
    const { el: e } = this.component, n = e.shadowRoot?.firstElementChild ?? e.firstElementChild ?? void 0;
    e.childElem ??= n, this.#e = r.when(
      () => this.component.view != null,
      () => {
        this.component.arcgisReady.emit();
      },
      { once: !0, initial: !0, sync: !0 }
    ), e.isConnected && t(this.component);
  }
  hostDisconnected() {
    typeof this.component.el.childElem == "object" && this.component.view?.ui?.remove(this.component.el.childElem), this.#e?.remove();
  }
  hostUpdate(e) {
    e.has("referenceElement") && t(this.component);
  }
}
const h = i(c);
export {
  c as V,
  a as u
};
