import { a as a2, c, e as e3, i2 as i, k, n as n4, o, p, t as t2, t2 as t3 } from "./chunk-GZBNC76D.js"; import { autoTheme, darkTheme } from "./chunk-2TTT3V5O.js"; import { setAssetPath } from "./chunk-IOZKU7B2.js"; import { n as n3 } from "./chunk-I4RYNNL6.js"; import { f as f2, h, l } from "./chunk-TJV6ODRM.js"; import { u } from "./chunk-HWSWTWZD.js"; import { a } from "./chunk-ZLNEXZAN.js"; import { s as s4 } from "./chunk-5UVJ64RB.js"; import { n as n2 } from "./chunk-IM3LVQXV.js"; import { m } from "./chunk-55RWC67C.js"; import { Q } from "./chunk-VEGAOVMY.js"; import { s as s5 } from "./chunk-YEJL5NEF.js"; import { e, f, n5 as n, s4 as s3, t2 as t, y3 as y2 } from "./chunk-2Z2TG5CU.js"; import { E, b, e as e2, r2 as r, x } from "./chunk-V6P2MAQQ.js"; import { s2 } from "./chunk-E5O6P5I2.js"; import { y } from "./chunk-SPWQ3AWG.js"; import { s } from "./chunk-YXWMMD76.js"; // node_modules/@arcgis/core/core/domUtils.js function e4(e14) { return "string" == typeof e14 ? document.getElementById(e14) : e14 != null ? e14 : null; } function t4(e14) { for (; e14.hasChildNodes(); ) e14.removeChild(e14.firstChild); } function o2(e14, t9) { const n9 = t9.parentNode; n9 && n9.insertBefore(e14, t9); } function r2(e14, t9) { for (; ; ) { const n9 = e14.firstChild; if (!n9) break; t9.appendChild(n9); } } var i2 = (() => { if ("function" == typeof Element.prototype.closest) return (e15, t9) => e15.closest(t9); const e14 = Element.prototype.matches || Element.prototype.msMatchesSelector; return (t9, n9) => { let o5 = t9; do { if (e14.call(o5, n9)) return o5; o5 = o5.parentElement; } while (null !== o5 && 1 === o5.nodeType); return null; }; })(); // node_modules/@arcgis/core/libs/maquette-advanced-projector/advanced-projector-options.js var e5 = { handleInterceptedEvent: (e14, p2, t9, n9) => (e14.scheduleRender(), p2.properties[`on${n9.type}`].apply(p2.properties.bind || t9, [n9])) }; // node_modules/@arcgis/core/libs/maquette-advanced-projector/utils.js var e6 = { namespace: void 0, performanceLogger: () => { }, eventHandlerInterceptor: void 0, styleApplyer: (e14, r6, o5) => { e14.style[r6] = o5; } }; var r3 = (r6) => ({ ...e6, ...r6 }); // node_modules/@arcgis/core/libs/maquette-advanced-projector/projector.js var o3 = (e14, t9) => { const r6 = []; for (; e14 && e14 !== t9; ) r6.push(e14), e14 = e14.parentNode; return r6; }; var n5 = (e14, t9) => e14.find(t9); var d = (e14, t9, r6 = false) => { let o5 = e14; return t9.forEach((e15, d2) => { const s8 = (o5 == null ? void 0 : o5.children) ? n5(o5.children, (t10) => t10.domNode === e15) : void 0; r6 && !s8 && d2 !== t9.length - 1 || (o5 = s8); }), o5; }; var s6 = (n9) => { let s8; const i4 = { ...e5, ...n9 }, c3 = r3(i4), a3 = c3.performanceLogger; let m3, p2 = true, l2 = false; const f4 = [], u2 = [], h3 = (e14, t9, r6) => { var _a; let n10; c3.eventHandlerInterceptor = (e15, t10, r7, c4) => function(e16) { let t11; a3("domEvent", e16); const r8 = o3(e16.currentTarget, n10.domNode), c5 = r8.some((e17) => { var _a2; return customElements.get((_a2 = e17 == null ? void 0 : e17.tagName) == null ? void 0 : _a2.toLowerCase()); }); if (e16.eventPhase === Event.CAPTURING_PHASE || !c5) r8.reverse(), t11 = d(n10.getLastRender(), r8); else { const r9 = e16.composedPath(), o5 = r9.slice(r9.indexOf(e16.currentTarget), r9.indexOf(n10.domNode)).filter((e17) => e17.getRootNode() === e17.ownerDocument).reverse(); t11 = d(n10.getLastRender(), o5, true); } let m5; return t11 && (m5 = i4.handleInterceptedEvent(s8, t11, this, e16)), a3("domEventProcessed", e16), m5; }, (_a = i4.postProcessProjectionOptions) == null ? void 0 : _a.call(i4, c3); const m4 = r6(); n10 = e14(t9, m4, c3), f4.push(n10), u2.push(r6), i4.afterFirstVNodeRendered && i4.afterFirstVNodeRendered(n10, m4); }; let v2 = () => { if (m3 = void 0, p2) { p2 = false, a3("renderStart", void 0); for (let e14 = 0; e14 < f4.length; e14++) { const t9 = u2[e14](); a3("rendered", void 0), f4[e14].update(t9), a3("patched", void 0); } a3("renderDone", void 0), p2 = true; } }; return i4.modifyDoRenderImplementation && (v2 = i4.modifyDoRenderImplementation(v2, f4, u2)), s8 = { renderNow: v2, scheduleRender: () => { m3 || l2 || (m3 = requestAnimationFrame(v2)); }, stop: () => { m3 && (cancelAnimationFrame(m3), m3 = void 0), l2 = true; }, resume: () => { l2 = false, p2 = true, s8.scheduleRender(); }, append: (t9, r6) => { h3(n4.append, t9, r6); }, insertBefore: (t9, r6) => { h3(n4.insertBefore, t9, r6); }, merge: (t9, r6) => { h3(n4.merge, t9, r6); }, replace: (t9, r6) => { h3(n4.replace, t9, r6); }, detach: (e14) => { for (let t9 = 0; t9 < u2.length; t9++) if (u2[t9] === e14) return u2.splice(t9, 1), f4.splice(t9, 1)[0]; throw new Error("renderFunction was not found"); } }, s8; }; // node_modules/@esri/calcite-components/dist/components/index.js function initThemeChangeEvent() { const { classList } = document.body; const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches; const getTheme = () => classList.contains(darkTheme) || classList.contains(autoTheme) && prefersDark ? "dark" : "light"; const emitThemeChange = (theme) => document.body.dispatchEvent(new CustomEvent("calciteThemeChange", { bubbles: true, detail: { theme } })); const themeChangeHandler = (newTheme) => { currentTheme !== newTheme && emitThemeChange(newTheme); currentTheme = newTheme; }; let currentTheme = getTheme(); emitThemeChange(currentTheme); window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (event) => themeChangeHandler(event.matches ? "dark" : "light")); new MutationObserver(() => themeChangeHandler(getTheme())).observe(document.body, { attributes: true, attributeFilter: ["class"] }); } function appGlobalScript() { const isBrowser = typeof window !== "undefined" && typeof location !== "undefined" && typeof document !== "undefined" && window.location === location && window.document === document; if (isBrowser) { if (document.readyState === "interactive") { initThemeChangeEvent(); } else { document.addEventListener("DOMContentLoaded", () => initThemeChangeEvent(), { once: true }); } } } var globalScripts = appGlobalScript; globalScripts(); // node_modules/@arcgis/core/widgets/support/componentsUtils.js var e7; function r4() { setAssetPath(Q(a(e7))); } e7 = "components/assets"; // node_modules/@arcgis/core/widgets/support/tests.js var e8 = /* @__PURE__ */ new Set(); function n6(n9) { e8.add(n9), n9.finally(() => e8.delete(n9)); } // node_modules/@arcgis/core/widgets/Widget.js var U = "esri.widgets.Widget"; var $ = 0; var x2 = { widgetIcon: "esri-icon-checkbox-unchecked" }; function z(e14, t9) { for (const r6 in t9) null != e14[r6] && ("object" == typeof e14[r6] && "object" == typeof t9[r6] ? z(e14[r6], t9 == null ? void 0 : t9[r6]) : e14[r6] = t9[r6]); return e14; } var A = s6({ postProcessProjectionOptions(e14) { const t9 = e14.eventHandlerInterceptor, r6 = /capture$/i; e14.eventHandlerInterceptor = (e15, o5, s8, i4) => { const n9 = t9 == null ? void 0 : t9(e15, o5, s8, i4), a3 = r6.test(e15); if (!((e15 = e15.replace(r6, "")).toLowerCase() in s8) || a3) { const t10 = e15[2].toLowerCase() + e15.slice(3), r7 = (e16) => n9 == null ? void 0 : n9.call(s8, e16); s8.addEventListener(t10, r7, a3); const o6 = () => s8.removeEventListener(t10, r7, a3), c3 = i4.afterRemoved; i4.afterRemoved = (e16) => { c3 == null ? void 0 : c3(e16), o6(); }; } return n9; }; }, handleInterceptedEvent(e14, t9, r6, o5) { const { eventPhase: s8, type: i4 } = o5, n9 = s8 === Event.CAPTURING_PHASE; let a3 = `on${i4}${n9 ? "capture" : ""}`; const c3 = t9.properties; (c3 && a3 in c3 || (a3 = `on${i4[0].toUpperCase()}${i4.slice(1)}${n9 ? "Capture" : ""}`, c3 && a3 in c3)) && (t2(), e14.scheduleRender(), c3[a3].call(c3.bind || r6, o5)); } }); var B = false; var D = class extends m(n2.EventedAccessor) { constructor(e14, t9) { super(e14, t9), this._attached = false, this._internalHandles = new t(), this._projector = A, this._readyForTrueRender = false, this.iconClass = x2.widgetIcon, this.key = this, this._loadLocale = x(async () => { if (this._messageBundleProps && this._messageBundleProps.length) { const e15 = await E(this._messageBundleProps.map(async ({ bundlePath: e16, propertyName: t10 }) => { let r7 = await u(e16); this.uiStrings && Object.keys(this.uiStrings) && (r7 = z(y(r7), this.uiStrings)), this[t10] = r7; })); for (const t10 of e15) t10.error && s2.getLogger(this.declaredClass).error("widget-intl:locale-error", this.declaredClass, t10.error); } await this.loadLocale(); }), r4(); const r6 = "esri-widget-uid-" + n3(), o5 = this.render.bind(this); this._trackingTarget = new s3(() => this.scheduleRender()); const s8 = () => { var _a; if (!this._readyForTrueRender || this.destroyed) return null; if (!this.visible) return { vnodeSelector: "div", properties: { key: r6, class: "", styles: { display: "none" } }, domNode: null, children: void 0, text: void 0 }; const e15 = o5(); let { properties: t10 } = e15; t10 || (e15.properties = t10 = {}); let { key: s9, styles: i4 } = t10; s9 || (t10.key = r6), i4 || (t10.styles = i4 = {}), i4.display || (i4.display = ""); let n9 = 0; return (_a = e15.children) == null ? void 0 : _a.forEach((e16) => { if (a2(e16.vnodeSelector)) return; let { properties: t11 } = e16; t11 || (e16.properties = t11 = {}), t11.key || (t11.key = `${this.id}--${n9++}`); }), i(this, e15); }; this.render = () => { var _a; if (B) return s8(); let e15 = (_a = e3(this)) != null ? _a : null; if (e15) return e15; this._trackingTarget.clear(), B = true; try { e15 = f(this._trackingTarget, s8); } catch (t10) { throw console.error(t10), t10; } finally { B = false; } return e15 && c(this, e15), e15; }, this.addResolvingPromise(this._resourcesFetch = this.beforeFirstRender().then(() => { this._readyForTrueRender = true, this._postInitialize(); })), n6(this._resourcesFetch); } normalizeCtorArgs(e14, t9) { const r6 = { ...e14 }; return t9 && (r6.container = t9), r6; } postInitialize() { } beforeFirstRender() { return Promise.all([this.loadDependencies(), this._loadLocale()]).then(() => { }).catch(b); } async loadDependencies() { } async loadLocale() { } destroy() { this.destroyed || (s(this._trackingTarget), s(this.viewModel), this._detach(this.container), this._set("container", null), this._internalHandles.destroy(), this._emitter.clear(), this.render = () => null, this._projector = null, o(this)); } set container(e14) { this._get("container") || this._set("container", e14); } castContainer(e14) { return e4(e14); } get domNode() { return this.container; } set domNode(e14) { this.container = e14; } get id() { return this._get("id") || this.get("container.id") || Date.now().toString(16) + "-widget-" + $++; } set id(e14) { e14 && this._set("id", e14); } get label() { return this.declaredClass.split(".").pop(); } set label(e14) { this._overrideIfSome("label", e14); } get renderable() { return this._resourcesFetch; } get visible() { return this._get("visible"); } set visible(e14) { this._set("visible", e14); } get test() { return { projector: this._projector }; } render() { throw new Error("not implemented"); } scheduleRender() { this.destroyed || (o(this), this._projector.scheduleRender()); } classes(...e14) { return p.apply(this, e14); } renderNow() { o(this), this._projector.renderNow(); } _postInitialize() { var _a; if (this.destroyed) return; this.scheduleRender(), ((_a = this._delegatedEventNames) == null ? void 0 : _a.length) && this._internalHandles.add(l(() => this.viewModel, (e15, t9) => { t9 && this._internalHandles.remove("delegated-events"), e15 && e2(e15) && this._internalHandles.add(this._delegatedEventNames.map((t10) => r(e15, t10, (e16) => { this.emit(t10, e16); })), "delegated-events"); }, h)), this.postInitialize(); const e14 = async () => { await this._loadLocale().catch(b), this.scheduleRender(); }; this._internalHandles.add([s4(e14), l(() => this.uiStrings, e14), f2(() => this.container, (e15) => { this.destroyed || this._attach(e15); }, { initial: true, once: true })]); } _attach(e14) { e14 && (this._projector.merge(e14, this.render), this._attached = true); } _detach(e14) { var _a; this._attached && (this._projector.detach(this.render), this._attached = false), (_a = e14 == null ? void 0 : e14.parentNode) == null ? void 0 : _a.removeChild(e14); } }; D[t3] = true, e([y2()], D.prototype, "_readyForTrueRender", void 0), e([y2({ value: null })], D.prototype, "container", null), e([s5("container")], D.prototype, "castContainer", null), e([y2()], D.prototype, "domNode", null), e([y2()], D.prototype, "iconClass", void 0), e([y2()], D.prototype, "id", null), e([y2()], D.prototype, "label", null), e([y2()], D.prototype, "renderable", null), e([y2()], D.prototype, "uiStrings", void 0), e([y2()], D.prototype, "viewModel", void 0), e([y2({ value: true })], D.prototype, "visible", null), e([y2()], D.prototype, "key", void 0), e([y2()], D.prototype, "children", void 0), e([y2()], D.prototype, "afterCreate", void 0), e([y2()], D.prototype, "afterUpdate", void 0), e([y2()], D.prototype, "afterRemoved", void 0), D = e([n(U)], D); var M = D; // node_modules/@arcgis/core/widgets/support/decorators/messageBundle.js function e9(e14) { return (s8, r6) => { s8.hasOwnProperty("_messageBundleProps") || (s8._messageBundleProps = s8._messageBundleProps ? s8._messageBundleProps.slice() : []); s8._messageBundleProps.push({ bundlePath: e14, propertyName: r6 }); }; } // node_modules/@arcgis/core/widgets/support/decorators/accessibleHandler.js function t5() { return function(n9, t9) { if (!n9[t9]) throw new TypeError(`Cannot auto bind undefined function '${t9}'`); return { value: o4(n9[t9]) }; }; } function e10(n9) { const { type: t9 } = n9; return n9 instanceof KeyboardEvent || "keyup" === t9 || "keydown" === t9 || "keypress" === t9; } function o4(t9) { return function(o5, ...r6) { e10(o5) ? k(o5.key) && (o5.preventDefault(), o5.stopPropagation(), o5.target.click()) : t9.call(this, o5, ...r6); }; } // node_modules/@arcgis/core/widgets/support/decorators/vmEvent.js function e11(e14) { return (a3) => { a3.hasOwnProperty("_delegatedEventNames") || (a3._delegatedEventNames = a3._delegatedEventNames ? a3._delegatedEventNames.slice() : []); const n9 = a3._delegatedEventNames, r6 = Array.isArray(e14) ? e14 : t6(e14); n9.push(...r6); }; } function t6(e14) { return e14.split(",").map((e15) => e15.trim()); } // node_modules/@arcgis/core/support/themeUtils.js var t7 = "calcite-theme-"; function e12() { return getComputedStyle(document.body).getPropertyValue("--esri-calcite-theme-name").replace(/\s|'|"/g, ""); } function r5() { return e12().startsWith("dark"); } function c2() { return `${t7}${r5() ? "dark" : "light"}`; } function n7(t9) { s7(t9), t9.classList.add(c2()); } function s7(e14) { Array.from(e14.classList).forEach((r6) => { r6.startsWith(t7) && e14.classList.remove(r6); }); } // node_modules/@arcgis/core/widgets/support/widget.js function e13(e14) { return e14 && "function" == typeof e14.render; } function t8(e14) { return e14 && "function" == typeof e14.postMixInProperties && "function" == typeof e14.buildRendering && "function" == typeof e14.postCreate && "function" == typeof e14.startup; } export { e4 as e, t4 as t, o2 as o, r2 as r, M, e9 as e2, t5 as t2, e11 as e3, r5 as r2, n7 as n, e13 as e4, t8 as t3 }; /*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 */ //# sourceMappingURL=chunk-PB5D5C6Y.js.map