import { e as e2 } from "./chunk-3OHML7FO.js"; import { U, d, e, n2 as n, t4 as t2, x, y3 as y } from "./chunk-Y3WMVFTW.js"; import { i } from "./chunk-ULGDPLM2.js"; import { s } from "./chunk-EMJ4ZSM2.js"; import { a, t } from "./chunk-GZT4BVFP.js"; // node_modules/@arcgis/core/core/throttle.js function e3(e6, t4, l, n4) { let o3 = null, p = 1e3; typeof t4 == "number" ? (p = t4, n4 = l) : (o3 = t4 ?? null, p = l); let r, u2 = 0; const a4 = () => { u2 = 0, e6.apply(n4, r); }, c2 = (...e7) => { o3 && o3.apply(n4, e7), r = e7, p ? u2 || (u2 = setTimeout(a4, p)) : a4(); }; return c2.remove = () => { u2 && (clearTimeout(u2), u2 = 0); }, c2.forceUpdate = () => { u2 && (clearTimeout(u2), a4()); }, c2.hasPendingUpdates = () => !!u2, c2; } // node_modules/@arcgis/core/views/2d/support/Timeline.js var s2 = (s5) => s5.includes("Brush"); var e4 = class { constructor() { this._names = new Map(); } begin(e6) { this._names.has(e6) || (this._names.set(e6, false), s2(e6) && this.record("Esri.FirstDraw"), performance.mark(`Esri.${e6}.Start`)); } end(s5) { this._names.has(s5) && !this._names.get(s5) && (this._names.set(s5, true), performance.mark(`Esri.${s5}.End`)); } record(s5) { this._names.has(s5) || (this._names.set(s5, true), performance.mark(`Esri.${s5}`)); } }; // node_modules/@arcgis/core/views/3d/support/PropertiesPool.js var o = class { constructor(r, o3) { this.owner = o3, this.properties = {}, this.afterDispatchHandle = null; for (const t4 in r) { const o4 = r[t4], s5 = new t2(o4, null, null, 2, 2); this.properties[t4] = { pool: s5, acquired: [] }; } this.afterDispatchHandle = U(() => this._release()); } destroy() { this.afterDispatchHandle && (this.afterDispatchHandle.remove(), this.afterDispatchHandle = null); for (const e6 in this.properties) { const t4 = this.properties[e6]; for (const e7 of t4.acquired) x(e7) || t4.pool.release(e7); t4.pool.destroy(), t4.pool = null, t4.acquired = null; } this.properties = null, this.owner = null; } get(e6) { const t4 = this.owner._get(e6), r = this.properties[e6]; let o3 = r.pool.acquire(); for (r.acquired.push(o3); o3 === t4; ) r.acquired.push(o3), o3 = r.pool.acquire(); return o3; } _release() { for (const e6 in this.properties) { const t4 = this.properties[e6]; let o3 = 0; for (const e7 of t4.acquired) x(e7) ? t4.acquired[o3++] = e7 : t4.pool.release(e7); t4.acquired.length = o3; } } }; // node_modules/@arcgis/core/views/input/keys.js var t3 = a("mac") ? "Meta" : "Ctrl"; var o2 = { 8: "Backspace", 9: "Tab", 13: "Enter", 27: "Escape", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "ArrowLeft", 38: "ArrowUp", 39: "ArrowRight", 40: "ArrowDown", 45: "Insert", 46: "Delete" }; for (let s5 = 48; s5 < 58; s5++) o2[s5] = String.fromCharCode(s5); for (let s5 = 1; s5 < 25; s5++) o2[111 + s5] = `F${s5}`; for (let s5 = 65; s5 < 91; s5++) o2[s5] = [String.fromCharCode(s5 + 32), String.fromCharCode(s5)]; function a2(e6) { if (e6.key !== void 0) return i(e6); const t4 = o2[e6.keyCode]; return Array.isArray(t4) ? e6.shiftKey ? t4[1] : t4[0] : t4; } function n2(r) { switch (r) { case "Ctrl": case "Alt": case "Shift": case "Meta": case "Primary": return true; } return false; } // node_modules/@arcgis/core/views/input/EventMatch.js var e5 = class { constructor(e6, t4 = []) { this.eventType = e6, this.keyModifiers = t4; } matches(e6) { if (e6.type !== this.eventType) return false; if (this.keyModifiers.length === 0) return true; const t4 = e6.modifiers; for (const i3 of this.keyModifiers) if (!t4.has(i3)) return false; return true; } }; // node_modules/@arcgis/core/views/input/InputHandler.js var n3 = s.getLogger("esri.views.input.InputHandler"); var i2 = class { constructor(e6) { this._manager = null, this._incoming = {}, this._outgoing = {}, this._incomingEventMatches = null, this._incomingEventTypes = null, this._outgoingEventTypes = null, this._hasSideEffects = e6; } get incomingEventMatches() { if (!this._incomingEventMatches) { this._incomingEventMatches = []; for (const e6 in this._incoming) { const t4 = this._incoming[e6]; for (const e7 of t4) this._incomingEventMatches.push(e7.match); } } return this._incomingEventMatches; } get incomingEventTypes() { return this._incomingEventTypes || (this._incomingEventTypes = this.incomingEventMatches.map((e6) => e6.eventType)), this._incomingEventTypes; } get outgoingEventTypes() { return this._outgoingEventTypes || (this._outgoingEventTypes = Object.keys(this._outgoing)), this._outgoingEventTypes; } get hasSideEffects() { return this._hasSideEffects; } get hasPendingInputs() { return false; } onInstall(e6) { this._manager ? n3.error("This InputHandler has already been registered with an InputManager") : (e6.setEventCallback((e7) => this._handleEvent(e7)), e6.setUninstallCallback(() => this._onUninstall()), this._manager = e6); } onUninstall() { } registerIncoming(e6, n4, i3) { let a4; typeof n4 == "function" ? (i3 = n4, a4 = []) : a4 = n4 || []; const o3 = typeof e6 == "string" ? new e5(e6, a4) : e6, h = () => { this._incomingEventTypes = null, this._incomingEventMatches = null; }, r = (e7) => { const t4 = this._incoming[e7.match.eventType]; if (t4) { const n5 = t4.indexOf(e7); t4.splice(n5, 1), h(), this._manager && this._manager.updateDependencies(); } }, g2 = new s3(o3, i3, { onPause: r, onRemove: r, onResume: (e7) => { const t4 = this._incoming[e7.match.eventType]; t4 && !t4.includes(e7) && (t4.push(e7), h(), this._manager && this._manager.updateDependencies()); } }); let c2 = this._incoming[o3.eventType]; return c2 || (c2 = [], this._incoming[o3.eventType] = c2), c2.push(g2), h(), this._manager && this._manager.updateDependencies(), g2; } registerOutgoing(e6) { if (this._outgoing[e6]) throw Error("There is already a callback registered for this outgoing InputEvent: " + e6); const t4 = new a3(e6, { onEmit: (e7, t5, n4, i3) => { this._manager.emit(e7.eventType, t5, n4, i3); }, onRemove: (e7) => { delete this._outgoing[e7.eventType], this._manager.updateDependencies(); } }); return this._outgoing[e6] = t4, this._outgoingEventTypes = null, this._manager && this._manager.updateDependencies(), t4; } startCapturingPointer(e6) { this._manager.setPointerCapture(e6, true); } stopCapturingPointer(e6) { this._manager.setPointerCapture(e6, false); } refreshHasPendingInputs() { this._manager.refreshHasPendingInputs(); } _onUninstall() { this._manager ? (this.onUninstall(), this._manager = null) : n3.error("This InputHandler is not registered with an InputManager"); } _handleEvent(e6) { const t4 = this._incoming[e6.type]; if (t4) { for (const n4 of t4) if (n4.match.matches(e6) && (n4.callback(e6), e6.shouldStopPropagation())) break; } } }; var s3 = class { constructor(e6, t4, n4) { this.match = e6, this._callback = t4, this._handler = n4; } pause() { this._handler.onPause(this); } resume() { this._handler.onResume(this); } remove() { this._handler.onRemove(this); } get callback() { return this._callback; } }; var a3 = class { constructor(e6, t4) { this.eventType = e6, this._removed = false, this._handler = t4; } emit(e6, t4, n4) { this._removed || this._handler.onEmit(this, e6, t4, n4); } remove() { this._removed = true, this._handler.onRemove(this); } }; // node_modules/@arcgis/core/views/input/handlers/LatestPointer.js var s4 = class extends i2 { constructor(t4) { super(true), this._onChange = t4, this._value = "mouse", this._x = null, this._y = null, this.registerIncoming("pointer-move", (t5) => { const s5 = t5.data.native.pointerType === "touch"; this._setValue(s5 ? "touch" : "mouse", t5.data.x, t5.data.y); }); } _setValue(t4, s5, e6) { t4 === this._value && this._x === s5 && this._y === e6 || (this._value = t4, this._x = s5, this._y = e6, this._onChange(t4, s5, e6)); } }; // node_modules/@arcgis/core/views/input/InputManager.js var d2 = s.getLogger("esri.views.input.InputManager"); var c = class extends y { constructor(e6) { super(e6), this._pointerCaptures = new Map(), this._nameToGroup = {}, this._handlers = [], this._currentPropagation = null, this._updateDependenciesAfterPropagation = false, this._sourceEvents = new Set(), this._keyModifiers = new Set(), this._activeKeyModifiers = new Set(), this._stoppedPropagationEventIds = new Set(), this.primaryKey = t3, this.latestPointerType = "mouse", this._propertiesPool = new o({ latestPointerLocation: P }, this), this.latestPointerLocation = null, this.test = { timestamp: void 0, hasCurrentPropagation: () => !!this._currentPropagation }; } initialize() { this.eventSource.onEventReceived = this._onEventReceived.bind(this), this._installRecognizers(); } destroy() { const e6 = Object.keys(this._nameToGroup); for (const t4 of e6) this.uninstallHandlers(t4); this.eventSource = null, this._currentPropagation = null, this._propertiesPool.destroy(); } get hasPendingInputs() { return this._handlers.some((e6) => e6.handler.hasPendingInputs); } installHandlers(e6, t4, r = g.INTERNAL) { if (this._nameToGroup[e6]) return void d2.error("There is already an InputHandler group registered under the name `" + e6 + "`"); if (t4.length === 0) return void d2.error("Can't register a group of zero handlers"); const i3 = { name: e6, handlers: t4.map((e7) => ({ handler: e7, active: true, removed: false, priorityIndex: 0, groupPriority: r, eventCallback: null, uninstallCallback: null })) }; this._nameToGroup[e6] = i3; for (let n4 = i3.handlers.length - 1; n4 >= 0; n4--) { const e7 = i3.handlers[n4]; this._handlers.push(e7), e7.handler.onInstall({ updateDependencies: () => { this.updateDependencies(); }, emit: (t5, r2, i4, n5, s5) => { this._emitInputEvent(e7.priorityIndex + 1, t5, r2, i4, s5, n5); }, setPointerCapture: (t5, r2) => { this._setPointerCapture(i3, e7, t5, r2); }, setEventCallback: (t5) => { e7.eventCallback = t5; }, setUninstallCallback: (t5) => { e7.uninstallCallback = t5; }, refreshHasPendingInputs: () => { this.notifyChange("hasPendingInputs"); } }); } this.updateDependencies(); } uninstallHandlers(e6) { const t4 = this._nameToGroup[e6]; t4 ? (t4.handlers.forEach((e7) => { e7.removed = true, e7.uninstallCallback(); }), delete this._nameToGroup[e6], this._currentPropagation ? this._currentPropagation.needsHandlerGarbageCollect = true : this._garbageCollectRemovedHandlers()) : d2.error("There is no InputHandler group registered under the name `" + e6 + "`"); } hasHandlers(e6) { return this._nameToGroup[e6] !== void 0; } updateDependencies() { if (this._currentPropagation) return void (this._updateDependenciesAfterPropagation = true); this._updateDependenciesAfterPropagation = false; const e6 = new Set(), t4 = new Set(); this._handlersPriority = []; for (let r = this._handlers.length - 1; r >= 0; r--) { const e7 = this._handlers[r]; e7.priorityIndex = r, this._handlersPriority.push(e7); } this._handlersPriority = this._sortHandlersPriority(this._handlersPriority); for (let r = this._handlersPriority.length - 1; r >= 0; r--) { const i3 = this._handlersPriority[r]; i3.priorityIndex = r; let n4 = i3.handler.hasSideEffects; if (!n4) { for (const t5 of i3.handler.outgoingEventTypes) if (e6.has(t5)) { n4 = true; break; } } if (n4) for (const r2 of i3.handler.incomingEventMatches) { e6.add(r2.eventType); for (const e7 of r2.keyModifiers) n2(e7) || t4.add(e7); } i3.active = n4; } this._sourceEvents = e6, this._keyModifiers = t4, this._pointerCaptures.size > 0 && this._sourceEvents.add("pointer-capture-lost"), this._keyModifiers.size > 0 && (this._sourceEvents.add("key-down"), this._sourceEvents.add("key-up")), this.eventSource && (this.eventSource.activeEvents = this._sourceEvents); } _setLatestPointer(e6, t4, r) { this._get("latestPointerType") !== e6 && this._set("latestPointerType", e6); const n4 = this._get("latestPointerLocation"); if (t(n4) || n4.x !== t4 || n4.y !== r) { const e7 = this._propertiesPool.get("latestPointerLocation"); e7.x = t4, e7.y = r, this._set("latestPointerLocation", e7); } } _onEventReceived(e6, t4) { if (e6 === "pointer-capture-lost") { const e7 = t4; this._pointerCaptures.delete(e7.native.pointerId); } this._updateKeyModifiers(e6, t4); const r = this.test.timestamp != null ? this.test.timestamp : t4.native ? t4.native.timestamp : void 0, i3 = t4.native ? t4.native.cancelable : void 0; this._emitInputEventFromSource(e6, t4, r, i3); } _updateKeyModifiers(e6, t4) { if (!t4) return; let r = false; const i3 = () => { if (!r) { const e7 = new Set(); this._activeKeyModifiers.forEach((t5) => { e7.add(t5); }), this._activeKeyModifiers = e7, r = true; } }, n4 = (e7, t5) => { t5 && !this._activeKeyModifiers.has(e7) ? (i3(), this._activeKeyModifiers.add(e7)) : !t5 && this._activeKeyModifiers.has(e7) && (i3(), this._activeKeyModifiers.delete(e7)); }; if (e6 === "key-down" || e6 === "key-up") { const r2 = t4.key; this._keyModifiers.has(r2) && n4(r2, e6 === "key-down"); } const s5 = t4.native; n4("Alt", !(!s5 || !s5.altKey)), n4("Ctrl", !(!s5 || !s5.ctrlKey)), n4("Shift", !(!s5 || !s5.shiftKey)), n4("Meta", !(!s5 || !s5.metaKey)), n4("Primary", this._activeKeyModifiers.has(this.primaryKey)); } _installRecognizers() { this._latestPointerHandler = new s4((e6, t4, r) => this._setLatestPointer(e6, t4, r)), this.installHandlers("input-manager-logic", [this._latestPointerHandler], g.ALWAYS), this.recognizers.length > 0 && this.installHandlers("default", this.recognizers, g.INTERNAL); } _setPointerCapture(e6, t4, r, i3) { const n4 = e6.name + "-" + t4.priorityIndex, s5 = this._pointerCaptures.get(r.pointerId) || new Set(); this._pointerCaptures.set(r.pointerId, s5), i3 ? (s5.add(n4), s5.size === 1 && this.eventSource && this.eventSource.setPointerCapture(r, true)) : s5.has(n4) && (s5.delete(n4), s5.size === 0 && (this._pointerCaptures.delete(r.pointerId), this.eventSource && this.eventSource.setPointerCapture(r, false))); } _garbageCollectRemovedHandlers() { this._handlers = this._handlers.filter((e6) => !e6.removed), this.updateDependencies(); } _emitInputEventFromSource(e6, t4, r, i3) { this._emitInputEvent(0, e6, t4, r, i3); } _emitInputEvent(e6, t4, r, i3, n4, s5) { const o3 = i3 !== void 0 ? i3 : this._currentPropagation ? this._currentPropagation.timestamp : performance.now(), a4 = n4 !== void 0 && n4, p = { event: new u(t4, r, o3, s5 || this._activeKeyModifiers, a4), priorityIndex: e6 }; this._currentPropagation ? this._currentPropagation.events.push(p) : this._doNewPropagation(p); } _doNewPropagation(e6) { this._currentPropagation = { events: new e2(), currentHandler: null, needsHandlerGarbageCollect: false, timestamp: e6.event.timestamp }, this._currentPropagation.events.push(e6), this._continuePropagation(); } _continuePropagation() { const e6 = this._currentPropagation; if (e6) { for (; this._currentPropagation.events.length > 0; ) { const { event: t4, priorityIndex: r } = this._currentPropagation.events.pop(), i3 = t4.data && t4.data.eventId; if (!(i3 != null && this._stoppedPropagationEventIds.has(i3))) for (e6.currentHandler = this._handlersPriority[r]; e6.currentHandler; ) { if (e6.currentHandler.removed) e6.needsHandlerGarbageCollect = true; else { if (e6.currentHandler.active && !t4.shouldStopPropagation() && e6.currentHandler.eventCallback(t4), t4.shouldStopPropagation()) { i3 != null && this._stoppedPropagationEventIds.add(i3); break; } if (t4.shouldPausePropagation(() => this._continuePropagation())) return void this._pausePropagation({ event: t4, priorityIndex: e6.currentHandler.priorityIndex + 1 }); } e6.currentHandler = this._handlersPriority[e6.currentHandler.priorityIndex + 1]; } } e6.needsHandlerGarbageCollect && this._garbageCollectRemovedHandlers(), this.hasPendingInputs || this._stoppedPropagationEventIds.clear(), this._currentPropagation = null, this._updateDependenciesAfterPropagation && this.updateDependencies(); } } _pausePropagation(e6) { const t4 = new e2(); for (t4.push(e6); this._currentPropagation.events.length; ) t4.push(this._currentPropagation.events.pop()); this._currentPropagation.events = t4, this._currentPropagation.currentHandler = null; } _compareHandlerPriority(e6, t4) { if (e6.handler.hasSideEffects !== t4.handler.hasSideEffects) return e6.handler.hasSideEffects ? 1 : -1; if (e6.groupPriority !== t4.groupPriority) return e6.groupPriority > t4.groupPriority ? -1 : 1; for (const r of e6.handler.incomingEventMatches) for (const e7 of t4.handler.incomingEventMatches) { if (r.eventType !== e7.eventType) continue; const t5 = r.keyModifiers.filter((t6) => e7.keyModifiers.includes(t6)); if (t5.length === r.keyModifiers.length !== (t5.length === e7.keyModifiers.length)) return r.keyModifiers.length > e7.keyModifiers.length ? -1 : 1; } return e6.priorityIndex > t4.priorityIndex ? -1 : 1; } _sortHandlersPriority(e6) { const t4 = []; for (const r of e6) { let e7 = 0; for (; e7 < t4.length && this._compareHandlerPriority(r, t4[e7]) >= 0; ) e7++; t4.splice(e7, 0, r); } return t4; } get debug() { const e6 = (e7) => { const t4 = this._setPointerCapture; this._setPointerCapture = () => { }, e7(), this._setPointerCapture = t4; }; return { injectEvent: (t4, r) => { e6(() => { this._onEventReceived(t4, r); }); }, disablePointerCapture: e6 }; } }; e([d({ readOnly: true })], c.prototype, "hasPendingInputs", null), e([d()], c.prototype, "eventSource", void 0), e([d()], c.prototype, "recognizers", void 0), e([d({ readOnly: true })], c.prototype, "latestPointerType", void 0), e([d({ readOnly: true })], c.prototype, "latestPointerLocation", void 0), c = e([n("esri.views.input.InputManager")], c); var u = class { constructor(e6, t4, r, i3, n4) { this.type = e6, this.data = t4, this.timestamp = r, this.modifiers = i3, this.cancelable = n4, this._propagationState = _.NONE, this._resumeCallback = null; } stopPropagation() { this._propagationState |= _.STOPPED; } shouldStopPropagation() { return (this._propagationState & _.STOPPED) != 0; } async(e6) { this._propagationState |= _.PAUSED; const t4 = (e7, t5) => { this._propagationState &= ~_.PAUSED; const r = this._resumeCallback; if (this._resumeCallback = null, r && r(), t5) throw e7; return e7; }; return (typeof e6 == "function" ? e6() : e6).then((e7) => t4(e7, false), (e7) => t4(e7, true)); } shouldPausePropagation(e6) { return !!(this._propagationState & _.PAUSED) && (this._resumeCallback = e6, true); } preventDefault() { this.data.native.preventDefault(); } }; var _; !function(e6) { e6[e6.NONE = 0] = "NONE", e6[e6.STOPPED = 1] = "STOPPED", e6[e6.PAUSED = 2] = "PAUSED"; }(_ || (_ = {})); var g = { ALWAYS: 1, DEFAULT: 0, TOOL: -1, WIDGET: -2, INTERNAL: -3 }; var P = class { }; export { e3 as e, a2 as a, i2 as i, c, g, e4 as e2 }; //# sourceMappingURL=chunk-RATJTB73.js.map