import { M as M2, c, e as e2, f, h, i as i2, r as r4 } from "./chunk-K3NA3LQS.js"; import { n as n2, r as r5 } from "./chunk-G5AI6ZNE.js"; import { An, en, rn, tn } from "./chunk-DH2OBAUC.js"; import { C, a as a2, j as j3, l as l2, o as o4, q, r as r3, s as s2, v, x, y, z as z2 } from "./chunk-6P6NA7JB.js"; import { l as l3 } from "./chunk-3D3QEPRE.js"; import { z } from "./chunk-O4FY3ITT.js"; import { i } from "./chunk-UXF37FQ4.js"; import { o2 as o3 } from "./chunk-XNLG7T2T.js"; import { o as o2 } from "./chunk-IR4PV7VK.js"; import { d as d2 } from "./chunk-2Z6LERTI.js"; import { j as j2 } from "./chunk-ALDCDSPV.js"; import { M2 as M, j2 as j, o, p } from "./chunk-ECW2QABR.js"; import { s } from "./chunk-GCDJLKH4.js"; import { E, I, R, k2 as k, r as r2 } from "./chunk-MRJEICT6.js"; import { d, e, l3 as l, n2 as n } from "./chunk-Y3WMVFTW.js"; import { a } from "./chunk-IHXECKQQ.js"; import { m, r, t } from "./chunk-GZT4BVFP.js"; // node_modules/@arcgis/core/core/Cyclical.js var i3 = class { constructor(n5, i4) { this.min = n5, this.max = i4, this.range = i4 - n5; } ndiff(n5, i4 = 0) { return Math.ceil((n5 - i4) / this.range) * this.range + i4; } _normalize(n5, i4, t4, o7 = 0, r8 = false) { return (t4 -= o7) < n5 ? t4 += this.ndiff(n5 - t4) : t4 > i4 && (t4 -= this.ndiff(t4 - i4)), r8 && t4 === i4 && (t4 = n5), t4 + o7; } normalize(n5, i4 = 0, t4 = false) { return this._normalize(this.min, this.max, n5, i4, t4); } clamp(i4, t4 = 0) { return o3(i4 - t4, this.min, this.max) + t4; } monotonic(n5, i4, t4) { return n5 < i4 ? i4 : i4 + this.ndiff(n5 - i4, t4); } minimalMonotonic(n5, i4, t4) { return this._normalize(n5, n5 + this.range, i4, t4); } center(n5, i4, t4) { return i4 = this.monotonic(n5, i4, t4), this.normalize((n5 + i4) / 2, t4); } diff(n5, i4, t4) { return this.monotonic(n5, i4, t4) - n5; } shortestSignedDiff(n5, i4) { n5 = this.normalize(n5); const t4 = (i4 = this.normalize(i4)) - n5, o7 = i4 < n5 ? this.minimalMonotonic(n5, i4) - n5 : i4 - this.minimalMonotonic(i4, n5); return Math.abs(t4) < Math.abs(o7) ? t4 : o7; } contains(n5, i4, t4) { return i4 = this.minimalMonotonic(n5, i4), (t4 = this.minimalMonotonic(n5, t4)) > n5 && t4 < i4; } }; function t2(n5) { for (const i4 in n5) { const t4 = n5[i4]; t4 instanceof Function && (n5[i4] = t4.bind(n5)); } return n5; } var o5 = t2(new i3(0, 2 * Math.PI)); var r6 = t2(new i3(-Math.PI, Math.PI)); var s3 = t2(new i3(0, 360)); // node_modules/@arcgis/core/Camera.js var u = class extends l3(l) { constructor(...o7) { super(...o7), this.position = new j([0, 0, 0]), this.heading = 0, this.tilt = 0, this.fov = 55; } normalizeCtorArgs(o7, r8, t4, e4) { if (o7 && typeof o7 == "object" && ("x" in o7 || Array.isArray(o7))) { const s4 = { position: o7 }; return r8 != null && (s4.heading = r8), t4 != null && (s4.tilt = t4), e4 != null && (s4.fov = e4), s4; } return o7; } writePosition(o7, r8, t4, e4) { const s4 = o7.clone(); s4.x = a(o7.x || 0), s4.y = a(o7.y || 0), s4.z = o7.hasZ ? a(o7.z || 0) : o7.z, r8[t4] = s4.write({}, e4); } readPosition(o7, r8) { const t4 = new j(); return t4.read(o7, r8), t4.x = a(t4.x || 0), t4.y = a(t4.y || 0), t4.z = t4.hasZ ? a(t4.z || 0) : t4.z, t4; } equals(o7) { return !!o7 && (this.tilt === o7.tilt && this.heading === o7.heading && this.fov === o7.fov && this.position.equals(o7.position)); } }; e([d({ type: j, json: { write: { isRequired: true } } })], u.prototype, "position", void 0), e([r2("position")], u.prototype, "writePosition", null), e([o("position")], u.prototype, "readPosition", null), e([d({ type: Number, nonNullable: true, json: { write: { isRequired: true } } }), s((o7) => s3.normalize(a(o7)))], u.prototype, "heading", void 0), e([d({ type: Number, nonNullable: true, json: { write: { isRequired: true } } }), s((o7) => o3(a(o7), -180, 180))], u.prototype, "tilt", void 0), e([d({ type: Number, nonNullable: true, json: { read: false, write: false } })], u.prototype, "fov", void 0), u = e([n("esri.Camera")], u); var d3 = u; // node_modules/@arcgis/core/Viewpoint.js var m2; var n3 = m2 = class extends l { constructor(r8) { super(r8), this.rotation = 0, this.scale = 0, this.targetGeometry = null, this.camera = null; } castRotation(r8) { return (r8 %= 360) < 0 && (r8 += 360), r8; } clone() { return new m2({ rotation: this.rotation, scale: this.scale, targetGeometry: r(this.targetGeometry) ? this.targetGeometry.clone() : null, camera: r(this.camera) ? this.camera.clone() : null }); } }; function l4() { return { enabled: !this.camera }; } e([d({ type: Number, json: { write: true, origins: { "web-map": { default: 0, write: true }, "web-scene": { write: { overridePolicy: l4 } } } } })], n3.prototype, "rotation", void 0), e([s("rotation")], n3.prototype, "castRotation", null), e([d({ type: Number, json: { write: true, origins: { "web-map": { default: 0, write: true }, "web-scene": { write: { overridePolicy: l4 } } } } })], n3.prototype, "scale", void 0), e([d({ types: i, json: { read: d2, write: true, origins: { "web-scene": { read: d2, write: { overridePolicy: l4 } } } } })], n3.prototype, "targetGeometry", void 0), e([d({ type: d3, json: { write: true } })], n3.prototype, "camera", void 0), n3 = m2 = e([n("esri.Viewpoint")], n3); var u2 = n3; // node_modules/@arcgis/core/chunks/mat2df64.js function e3() { return [1, 0, 0, 1, 0, 0]; } function r7(e4) { return [e4[0], e4[1], e4[2], e4[3], e4[4], e4[5]]; } function t3(e4, r8, t4, n5, o7, a3) { return [e4, r8, t4, n5, o7, a3]; } function n4(e4, r8) { return new Float64Array(e4, r8, 6); } var o6 = Object.freeze(Object.defineProperty({ __proto__: null, create: e3, clone: r7, fromValues: t3, createView: n4 }, Symbol.toStringTag, { value: "Module" })); // node_modules/@arcgis/core/views/2d/viewpointUtils.js var Q = 96; var U = 39.37; var B = 180 / Math.PI; function D(t4) { return t4.wkid ? t4 : t4.spatialReference || k.WGS84; } function T(t4, e4) { return e4.type ? r3(t4, e4.x, e4.y) : a2(t4, e4); } function W(t4) { return z(t4); } function H(t4, e4) { const n5 = Math.max(1, e4[0]), r8 = Math.max(1, e4[1]); return Math.max(t4.width / n5, t4.height / r8) * ct(t4.spatialReference); } async function J(t4, a3, i4, c2) { let s4, u3; if (!t4) return null; if (Array.isArray(t4) && !t4.length) return null; if (j2.isCollection(t4) && (t4 = t4.toArray()), Array.isArray(t4) && t4.length && typeof t4[0] == "object") { const e4 = t4.every((t5) => "attributes" in t5), r8 = t4.some((t5) => !t5.geometry); let o7 = t4; if (e4 && r8 && a3 && a3.allLayerViews) { const e5 = new Map(); for (const n5 of t4) { const t5 = n5.layer, r10 = e5.get(t5) || [], o8 = n5.attributes[t5.objectIdField]; o8 != null && r10.push(o8), e5.set(t5, r10); } const r9 = []; e5.forEach((t5, e6) => { const n5 = a3.allLayerViews.find((t6) => t6.layer.id === e6.id); if ("queryFeatures" in n5) { const o8 = e6.createQuery(); o8.objectIds = t5, o8.returnGeometry = true, r9.push(n5.queryFeatures(o8)); } }); const i5 = await Promise.all(r9), c3 = []; for (const t5 of i5) if (t5 && t5.features && t5.features.length) for (const e6 of t5.features) r(e6.geometry) && c3.push(e6.geometry); o7 = c3; } for (const t5 of o7) c2 = await J(t5, a3, i4, c2); return c2; } if (Array.isArray(t4) && t4.length === 2 && typeof t4[0] == "number" && typeof t4[1] == "number") s4 = new j(t4); else if (t4 instanceof p) s4 = t4; else if ("geometry" in t4) { if (t4.geometry) s4 = t4.geometry; else if (t4.layer) { const e4 = t4.layer, n5 = a3.allLayerViews.find((t5) => t5.layer.id === e4.id); if ("queryFeatures" in n5) { const o7 = e4.createQuery(); o7.objectIds = [t4.attributes[e4.objectIdField]], o7.returnGeometry = true; const a4 = await n5.queryFeatures(o7); s4 = m(a4, "features", 0, "geometry"); } } } if (t(s4)) return null; if (u3 = s4.type === "point" ? new M({ xmin: s4.x, ymin: s4.y, xmax: s4.x, ymax: s4.y, spatialReference: s4.spatialReference }) : s4.extent, !u3) return null; en() || An(u3.spatialReference, i4) || await tn(); const f2 = rn(u3, i4); return f2 ? c2 = c2 ? c2.union(f2) : f2 : null; } function K(t4) { if (t4 && (!Array.isArray(t4) || typeof t4[0] != "number") && (typeof t4 == "object" || Array.isArray(t4) && typeof t4[0] == "object")) { if ("layer" in t4 && t4.layer && t4.layer.minScale && t4.layer.maxScale) { const e4 = t4.layer; return { min: e4.minScale, max: e4.maxScale }; } if (Array.isArray(t4) && t4.length && t4.every((t5) => "layer" in t5)) { let e4 = 0, n5 = 0; for (const r8 of t4) { const t5 = r8.layer; t5 && t5.minScale && t5.maxScale && (e4 = t5.minScale < e4 ? t5.minScale : e4, n5 = t5.maxScale > n5 ? t5.maxScale : n5); } return e4 && n5 ? { min: e4, max: n5 } : null; } } } function X(t4, e4) { return E(D(t4), e4) ? t4 : rn(t4, e4); } async function Y(e4, r8) { if (!e4 || !r8) return new u2({ targetGeometry: new j(), scale: 0, rotation: 0 }); let o7 = r8.spatialReference; const { constraints: a3, padding: i4, viewpoint: c2, size: s4 } = r8, u3 = [i4 ? s4[0] - i4.left - i4.right : s4[0], i4 ? s4[1] - i4.top - i4.bottom : s4[1]]; let f2 = null; e4 instanceof u2 ? f2 = e4 : e4.viewpoint ? f2 = e4.viewpoint : e4.target && e4.target.declaredClass === "esri.Viewpoint" && (f2 = e4.target); let l5 = null; f2 && f2.targetGeometry ? l5 = f2.targetGeometry : e4 instanceof M ? l5 = e4 : (e4 || e4 && ("center" in e4 || "extent" in e4 || "target" in e4)) && (l5 = await J(e4.center, r8, o7) || await J(e4.extent, r8, o7) || await J(e4.target, r8, o7) || await J(e4, r8, o7)), !l5 && c2 && c2.targetGeometry ? l5 = c2.targetGeometry : !l5 && r8.extent && (l5 = r8.extent), o7 || (o7 = D(r8.spatialReference || r8.extent || l5)), en() || E(l5.spatialReference, o7) || An(l5, o7) || await tn(); const m3 = X(l5.center ? l5.center : l5, o7); let y2 = null; if (f2 && r(f2.targetGeometry) && f2.targetGeometry.type === "point") y2 = f2.scale; else if ("scale" in e4 && e4.scale) y2 = e4.scale; else if ("zoom" in e4 && e4.zoom !== -1 && a3 && a3.effectiveLODs) y2 = a3.zoomToScale(e4.zoom); else if (Array.isArray(l5) || l5.type === "point" || l5.type === "extent" && l5.width === 0 && l5.height === 0) { const t4 = X(r8.extent, o7); y2 = r(t4) ? H(t4, u3) : r8.extent ? H(r8.extent, u3) : c2.scale; } else y2 = H(X(l5.extent, o7), u3); const p2 = K(e4); p2 && (p2.min && p2.min > y2 ? y2 = p2.min : p2.max && p2.max < y2 && (y2 = p2.max)); let g = 0; f2 ? g = f2.rotation : e4.hasOwnProperty("rotation") ? g = e4.rotation : c2 && (g = c2.rotation); let x2 = new u2({ targetGeometry: m3, scale: y2, rotation: g }); return a3 && (x2 = a3.fit(x2), a3.constrainByGeometry(x2), a3.rotationEnabled || (x2.rotation = g)), x2; } function Z(t4, e4) { const n5 = t4.targetGeometry, r8 = e4.targetGeometry; return n5.x = r8.x, n5.y = r8.y, n5.spatialReference = r8.spatialReference, t4.scale = e4.scale, t4.rotation = e4.rotation, t4; } function $(t4, e4, n5) { return n5 ? r3(t4, 0.5 * (e4[0] - n5.right + n5.left), 0.5 * (e4[1] - n5.bottom + n5.top)) : l2(t4, e4, 0.5); } var _ = function() { const t4 = n2(); return function(e4, n5, r8) { const o7 = n5.targetGeometry; T(t4, o7); const a3 = 0.5 * ot(n5); return e4.xmin = t4[0] - a3 * r8[0], e4.ymin = t4[1] - a3 * r8[1], e4.xmax = t4[0] + a3 * r8[0], e4.ymax = t4[1] + a3 * r8[1], e4.spatialReference = o7.spatialReference, e4; }; }(); function tt(t4, e4, n5, r8, o7) { return xt(t4, e4, n5.center), t4.scale = H(n5, r8), o7 && o7.constraints && o7.constraints.constrain(t4), t4; } function et(t4, e4, n5, r8) { return ft(t4, e4, n5, r8), r4(t4, t4); } var nt = function() { const t4 = n2(); return function(e4, n5, r8) { return C(e4, st(e4, n5), $(t4, n5, r8)); }; }(); var rt = function() { const t4 = e3(), e4 = n2(); return function(n5, r8, o7, a3) { const i4 = ot(r8), f2 = it(r8); return r3(e4, i4, i4), M2(t4, e4), e2(t4, t4, f2), i2(t4, t4, nt(e4, o7, a3)), i2(t4, t4, [0, a3.top - a3.bottom]), r3(n5, t4[4], t4[5]); }; }(); function ot(t4) { return t4.scale * at(t4.targetGeometry); } function at(t4) { return r(t4) && I(t4.spatialReference) ? 1 / (W(t4.spatialReference) * U * Q) : 1; } function it(t4) { return o2(t4.rotation) || 0; } function ct(t4) { return I(t4) ? W(t4) * U * Q : 1; } function st(t4, e4) { return l2(t4, e4, 0.5); } var ut = function() { const t4 = n2(), e4 = n2(), n5 = n2(); return function(r8, o7, a3, i4, c2, m3) { return x(t4, o7), l2(e4, a3, 0.5 * m3), r3(n5, 1 / i4 * m3, -1 / i4 * m3), f(r8, e4), c2 && e2(r8, r8, c2), c(r8, r8, n5), i2(r8, r8, t4), r8; }; }(); var ft = function() { const t4 = n2(); return function(e4, n5, r8, o7) { const a3 = ot(n5), i4 = it(n5); return T(t4, n5.targetGeometry), ut(e4, t4, r8, a3, i4, o7); }; }(); var lt = function() { const t4 = n2(); return function(e4, n5, r8, o7) { const a3 = ot(n5); return T(t4, n5.targetGeometry), ut(e4, t4, r8, a3, 0, o7); }; }(); function mt(t4) { const e4 = R(t4); return e4 ? e4.valid[1] - e4.valid[0] : 0; } function yt(t4, e4) { return Math.round(mt(t4) / e4); } var pt = function() { const t4 = n2(), e4 = n2(), n5 = [0, 0, 0]; return function(r8, o7, a3) { o4(t4, r8, o7), v(t4, t4), o4(e4, r8, a3), v(e4, e4), y(n5, t4, e4); let i4 = Math.acos(j3(t4, e4) / (q(t4) * q(e4))) * B; return n5[2] < 0 && (i4 = -i4), isNaN(i4) && (i4 = 0), i4; }; }(); var gt = function() { const t4 = n2(); return function(e4, n5, r8, o7) { const a3 = e4.targetGeometry; return Z(e4, n5), rt(t4, n5, r8, o7), a3.x += t4[0], a3.y += t4[1], e4; }; }(); var xt = function(t4, e4, n5) { Z(t4, e4); const r8 = t4.targetGeometry; return r8.x = n5.x, r8.y = n5.y, r8.spatialReference = n5.spatialReference, t4; }; var ht = function() { const t4 = n2(); return function(e4, n5, r8, o7, a3) { a3 || (a3 = "center"), C(t4, r8, o7), l2(t4, t4, 0.5); const i4 = t4[0], c2 = t4[1]; switch (a3) { case "center": r3(t4, 0, 0); break; case "left": r3(t4, -i4, 0); break; case "top": r3(t4, 0, c2); break; case "right": r3(t4, i4, 0); break; case "bottom": r3(t4, 0, -c2); break; case "top-left": r3(t4, -i4, c2); break; case "bottom-left": r3(t4, -i4, -c2); break; case "top-right": r3(t4, i4, c2); break; case "bottom-right": r3(t4, i4, -c2); } return St(e4, n5, t4), e4; }; }(); function bt(t4, e4, n5) { return Z(t4, e4), t4.rotation += n5, t4; } function wt(t4, e4, n5) { return Z(t4, e4), t4.rotation = n5, t4; } var dt = function() { const t4 = n2(); return function(e4, n5, r8, o7, a3) { return Z(e4, n5), isNaN(r8) || r8 === 0 || (kt(t4, o7, n5, a3), e4.scale = n5.scale * r8, At(t4, t4, e4, a3), St(e4, e4, r3(t4, t4[0] - o7[0], o7[1] - t4[1]))), e4; }; }(); function jt(t4, e4, n5) { return Z(t4, e4), t4.scale = n5, t4; } var Gt = function() { const t4 = n2(); return function(e4, n5, r8, o7, a3, i4) { return Z(e4, n5), isNaN(r8) || r8 === 0 || (kt(t4, a3, n5, i4), e4.scale = n5.scale * r8, e4.rotation += o7, At(t4, t4, e4, i4), St(e4, e4, r3(t4, t4[0] - a3[0], a3[1] - t4[1]))), e4; }; }(); var Rt = function() { const t4 = n2(), e4 = n2(); return function(n5, r8, o7, a3, i4, c2, s4) { return nt(e4, c2, s4), s2(t4, i4, e4), a3 ? Gt(n5, r8, o7, a3, t4, c2) : dt(n5, r8, o7, t4, c2); }; }(); var kt = function() { const t4 = e3(); return function(e4, n5, r8, o7) { return z2(e4, n5, et(t4, r8, o7, 1)); }; }(); var At = function() { const t4 = e3(); return function(e4, n5, r8, o7) { return z2(e4, n5, ft(t4, r8, o7, 1)); }; }(); var St = function() { const t4 = n2(), e4 = e3(); return function(n5, r8, o7) { Z(n5, r8); const a3 = ot(r8), i4 = n5.targetGeometry; return h(e4, it(r8)), c(e4, e4, r5(a3, a3)), z2(t4, o7, e4), i4.x += t4[0], i4.y += t4[1], n5; }; }(); export { u2 as u, e3 as e, H, Y, Z, $, _, tt, nt, ot, ut, ft, lt, mt, yt, pt, gt, xt, ht, bt, wt, jt, Gt, Rt, St }; //# sourceMappingURL=chunk-7BTL34ZE.js.map