import { A, B, C, D, E as E2, F, H, J, K as K2, L, M, N, O, P as P2, R, S, U, W, b, d, g, h, j, k, m as m2, p as p2, v as v4, w as w3, x, y } from "./chunk-DVIKBNBZ.js"; import { e as e2, l, s, u as u2 } from "./chunk-C3UFAVPF.js"; import { a as a2, c, r } from "./chunk-BJT4XIGU.js"; import { E, K, P2 as P, Se, V, Y, be, e, he, le, pe, re, se, t, v2 as v3, z } from "./chunk-FT2BCPUP.js"; import { $ } from "./chunk-3RSFVUKZ.js"; import { v as v2 } from "./chunk-RMDDCMKS.js"; import { m2 as m, u, v2 as v } from "./chunk-VCH45Q2I.js"; import { a } from "./chunk-FWSQEIAR.js"; import { p, w, w2 } from "./chunk-6T6G6LCQ.js"; // node_modules/@arcgis/core/arcade/functions/geomasync.js function un(t2) { return 0 === a.indexOf("4.") ? v.fromExtent(t2) : new v({ spatialReference: t2.spatialReference, rings: [[[t2.xmin, t2.ymin], [t2.xmin, t2.ymax], [t2.xmax, t2.ymax], [t2.xmax, t2.ymin], [t2.xmin, t2.ymin]]] }); } function fn(n, t2, e3) { if (V(n, 2, 2, t2, e3), n[0] instanceof p && n[1] instanceof p) ; else if (n[0] instanceof p && null === n[1]) ; else if (n[1] instanceof p && null === n[0]) ; else if (null !== n[0] || null !== n[1]) throw new t(t2, e.InvalidParameter, e3); } async function cn(n, t2) { if ("polygon" !== n.type && "polyline" !== n.type && "extent" !== n.type) return 0; let e3 = 1; if (n.spatialReference.vcsWkid || n.spatialReference.latestVcsWkid) { e3 = s(n.spatialReference) / $(n.spatialReference); } let r2 = 0; if ("polyline" === n.type) for (const a3 of n.paths) for (let n2 = 1; n2 < a3.length; n2++) r2 += e2(a3[n2], a3[n2 - 1], e3); else if ("polygon" === n.type) for (const a3 of n.rings) { for (let n2 = 1; n2 < a3.length; n2++) r2 += e2(a3[n2], a3[n2 - 1], e3); (a3[0][0] !== a3[a3.length - 1][0] || a3[0][1] !== a3[a3.length - 1][1] || void 0 !== a3[0][2] && a3[0][2] !== a3[a3.length - 1][2]) && (r2 += e2(a3[0], a3[a3.length - 1], e3)); } else "extent" === n.type && (r2 += 2 * e2([n.xmin, n.ymin, 0], [n.xmax, n.ymin, 0], e3), r2 += 2 * e2([n.xmin, n.ymin, 0], [n.xmin, n.ymax, 0], e3), r2 *= 2, r2 += 4 * Math.abs(v3(n.zmax, 0) * e3 - v3(n.zmin, 0) * e3)); const i = new m({ hasZ: false, hasM: false, spatialReference: n.spatialReference, paths: [[0, 0], [0, r2]] }); return F(i, t2); } function dn(n) { "async" === n.mode && (n.functions.disjoint = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, a3) => (fn(a3 = pe(a3), t2, e3), null === a3[0] || null === a3[1] || A(a3[0], a3[1]))); }, n.functions.intersects = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, a3) => (fn(a3 = pe(a3), t2, e3), null !== a3[0] && null !== a3[1] && h(a3[0], a3[1]))); }, n.functions.touches = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, a3) => (fn(a3 = pe(a3), t2, e3), null !== a3[0] && null !== a3[1] && S(a3[0], a3[1]))); }, n.functions.crosses = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, a3) => (fn(a3 = pe(a3), t2, e3), null !== a3[0] && null !== a3[1] && m2(a3[0], a3[1]))); }, n.functions.within = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, a3) => (fn(a3 = pe(a3), t2, e3), null !== a3[0] && null !== a3[1] && x(a3[0], a3[1]))); }, n.functions.contains = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, a3) => (fn(a3 = pe(a3), t2, e3), null !== a3[0] && null !== a3[1] && p2(a3[0], a3[1]))); }, n.functions.overlaps = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, a3) => (fn(a3 = pe(a3), t2, e3), null !== a3[0] && null !== a3[1] && O(a3[0], a3[1]))); }, n.functions.equals = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, i) => (V(i, 2, 2, t2, e3), i[0] === i[1] || (i[0] instanceof p && i[1] instanceof p ? g(i[0], i[1]) : !(!z(i[0]) || !z(i[1])) && i[0].getTime() === i[1].getTime()))); }, n.functions.relate = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, o) => { if (o = pe(o), V(o, 3, 3, t2, e3), o[0] instanceof p && o[1] instanceof p) return R(o[0], o[1], K(o[2])); if (o[0] instanceof p && null === o[1]) return false; if (o[1] instanceof p && null === o[0]) return false; if (null === o[0] && null === o[1]) return false; throw new t(t2, e.InvalidParameter, e3); }); }, n.functions.intersection = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, a3) => (fn(a3 = pe(a3), t2, e3), null === a3[0] || null === a3[1] ? null : D(a3[0], a3[1]))); }, n.functions.union = function(e3, r2) { return n.standardFunctionAsync(e3, r2, (n2, a3, o) => { const s2 = []; if (0 === (o = pe(o)).length) throw new t(e3, e.WrongNumberOfParameters, r2); if (1 === o.length) if (Y(o[0])) { const n3 = pe(o[0]); for (let t2 = 0; t2 < n3.length; t2++) if (null !== n3[t2]) { if (!(n3[t2] instanceof p)) throw new t(e3, e.InvalidParameter, r2); s2.push(n3[t2]); } } else { if (!E(o[0])) { if (o[0] instanceof p) return se(c(o[0]), e3.spatialReference); if (null === o[0]) return null; throw new t(e3, e.InvalidParameter, r2); } { const n3 = pe(o[0].toArray()); for (let t2 = 0; t2 < n3.length; t2++) if (null !== n3[t2]) { if (!(n3[t2] instanceof p)) throw new t(e3, e.InvalidParameter, r2); s2.push(n3[t2]); } } } else for (let t2 = 0; t2 < o.length; t2++) if (null !== o[t2]) { if (!(o[t2] instanceof p)) throw new t(e3, e.InvalidParameter, r2); s2.push(o[t2]); } return 0 === s2.length ? null : b(s2); }); }, n.functions.difference = function(e3, r2) { return n.standardFunctionAsync(e3, r2, (n2, a3, o) => (fn(o = pe(o), e3, r2), null !== o[0] && null === o[1] ? c(o[0]) : null === o[0] ? null : E2(o[0], o[1]))); }, n.functions.symmetricdifference = function(e3, r2) { return n.standardFunctionAsync(e3, r2, (n2, a3, o) => (fn(o = pe(o), e3, r2), null === o[0] && null === o[1] ? null : null === o[0] ? c(o[1]) : null === o[1] ? c(o[0]) : k(o[0], o[1]))); }, n.functions.clip = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, o) => { if (o = pe(o), V(o, 2, 2, t2, e3), !(o[1] instanceof w2) && null !== o[1]) throw new t(t2, e.InvalidParameter, e3); if (null === o[0]) return null; if (!(o[0] instanceof p)) throw new t(t2, e.InvalidParameter, e3); return null === o[1] ? null : y(o[0], o[1]); }); }, n.functions.cut = function(e3, r2) { return n.standardFunctionAsync(e3, r2, (n2, o, s2) => { if (s2 = pe(s2), V(s2, 2, 2, e3, r2), !(s2[1] instanceof m) && null !== s2[1]) throw new t(e3, e.InvalidParameter, r2); if (null === s2[0]) return []; if (!(s2[0] instanceof p)) throw new t(e3, e.InvalidParameter, r2); return null === s2[1] ? [c(s2[0])] : w3(s2[0], s2[1]); }); }, n.functions.area = function(t2, r2) { return n.standardFunctionAsync(t2, r2, async (n2, o, s2) => { if (V(s2, 1, 2, t2, r2), null === (s2 = pe(s2))[0]) return 0; if (P(s2[0])) { const n3 = await s2[0].sumArea(r(v3(s2[1], -1)), false, t2.abortSignal); if (t2.abortSignal.aborted) throw new t(t2, e.Cancelled, r2); return n3; } if (Y(s2[0]) || E(s2[0])) { const n3 = he(s2[0], t2.spatialReference); return null === n3 ? 0 : W(n3, r(v3(s2[1], -1))); } if (!(s2[0] instanceof p)) throw new t(t2, e.InvalidParameter, r2); return W(s2[0], r(v3(s2[1], -1))); }); }, n.functions.areageodetic = function(t2, r2) { return n.standardFunctionAsync(t2, r2, async (n2, o, s2) => { if (V(s2, 1, 2, t2, r2), null === (s2 = pe(s2))[0]) return 0; if (P(s2[0])) { const n3 = await s2[0].sumArea(r(v3(s2[1], -1)), true, t2.abortSignal); if (t2.abortSignal.aborted) throw new t(t2, e.Cancelled, r2); return n3; } if (Y(s2[0]) || E(s2[0])) { const n3 = he(s2[0], t2.spatialReference); return null === n3 ? 0 : K2(n3, r(v3(s2[1], -1))); } if (!(s2[0] instanceof p)) throw new t(t2, e.InvalidParameter, r2); return K2(s2[0], r(v3(s2[1], -1))); }); }, n.functions.length = function(t2, e3) { return n.standardFunctionAsync(t2, e3, async (n2, o, s2) => { if (V(s2, 1, 2, t2, e3), null === (s2 = pe(s2))[0]) return 0; if (P(s2[0])) { const n3 = await s2[0].sumLength(a2(v3(s2[1], -1)), false, t2.abortSignal); if (t2.abortSignal.aborted) throw new t(t2, e.Cancelled, e3); return n3; } if (Y(s2[0]) || E(s2[0])) { const n3 = Se(s2[0], t2.spatialReference); return null === n3 ? 0 : F(n3, a2(v3(s2[1], -1))); } if (!(s2[0] instanceof p)) throw new t(t2, e.InvalidParameter, e3); return F(s2[0], a2(v3(s2[1], -1))); }); }, n.functions.length3d = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, o, s2) => { if (V(s2, 1, 2, t2, e3), null === (s2 = pe(s2))[0]) return 0; if (Y(s2[0]) || E(s2[0])) { const n3 = Se(s2[0], t2.spatialReference); return null === n3 ? 0 : true === n3.hasZ ? cn(n3, a2(v3(s2[1], -1))) : F(n3, a2(v3(s2[1], -1))); } if (!(s2[0] instanceof p)) throw new t(t2, e.InvalidParameter, e3); return true === s2[0].hasZ ? cn(s2[0], a2(v3(s2[1], -1))) : F(s2[0], a2(v3(s2[1], -1))); }); }, n.functions.lengthgeodetic = function(t2, e3) { return n.standardFunctionAsync(t2, e3, async (n2, o, s2) => { if (V(s2, 1, 2, t2, e3), null === (s2 = pe(s2))[0]) return 0; if (P(s2[0])) { const n3 = await s2[0].sumLength(a2(v3(s2[1], -1)), true, t2.abortSignal); if (t2.abortSignal.aborted) throw new t(t2, e.Cancelled, e3); return n3; } if (Y(s2[0]) || E(s2[0])) { const n3 = Se(s2[0], t2.spatialReference); return null === n3 ? 0 : M(n3, a2(v3(s2[1], -1))); } if (!(s2[0] instanceof p)) throw new t(t2, e.InvalidParameter, e3); return M(s2[0], a2(v3(s2[1], -1))); }); }, n.functions.distance = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, o, s2) => { s2 = pe(s2), V(s2, 2, 3, t2, e3); let f = s2[0]; (Y(s2[0]) || E(s2[0])) && (f = be(s2[0], t2.spatialReference)); let c2 = s2[1]; if ((Y(s2[1]) || E(s2[1])) && (c2 = be(s2[1], t2.spatialReference)), !(f instanceof p)) throw new t(t2, e.InvalidParameter, e3); if (!(c2 instanceof p)) throw new t(t2, e.InvalidParameter, e3); return d(f, c2, a2(v3(s2[2], -1))); }); }, n.functions.distancegeodetic = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, o, s2) => { s2 = pe(s2), V(s2, 2, 3, t2, e3); const l2 = s2[0], u3 = s2[1]; if (!(l2 instanceof w)) throw new t(t2, e.InvalidParameter, e3); if (!(u3 instanceof w)) throw new t(t2, e.InvalidParameter, e3); const f = new m({ paths: [], spatialReference: l2.spatialReference }); return f.addPath([l2, u3]), M(f, a2(v3(s2[2], -1))); }); }, n.functions.densify = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, o, s2) => { if (s2 = pe(s2), V(s2, 2, 3, t2, e3), null === s2[0]) return null; if (!(s2[0] instanceof p)) throw new t(t2, e.InvalidParameter, e3); const l2 = re(s2[1]); if (isNaN(l2)) throw new t(t2, e.InvalidParameter, e3); if (l2 <= 0) throw new t(t2, e.InvalidParameter, e3); return s2[0] instanceof v || s2[0] instanceof m ? C(s2[0], l2, a2(v3(s2[2], -1))) : s2[0] instanceof w2 ? C(un(s2[0]), l2, a2(v3(s2[2], -1))) : s2[0]; }); }, n.functions.densifygeodetic = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, o, s2) => { if (s2 = pe(s2), V(s2, 2, 3, t2, e3), null === s2[0]) return null; if (!(s2[0] instanceof p)) throw new t(t2, e.InvalidParameter, e3); const l2 = re(s2[1]); if (isNaN(l2)) throw new t(t2, e.InvalidParameter, e3); if (l2 <= 0) throw new t(t2, e.InvalidParameter, e3); return s2[0] instanceof v || s2[0] instanceof m ? U(s2[0], l2, a2(v3(s2[2], -1))) : s2[0] instanceof w2 ? U(un(s2[0]), l2, a2(v3(s2[2], -1))) : s2[0]; }); }, n.functions.generalize = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, o, s2) => { if (s2 = pe(s2), V(s2, 2, 4, t2, e3), null === s2[0]) return null; if (!(s2[0] instanceof p)) throw new t(t2, e.InvalidParameter, e3); const l2 = re(s2[1]); if (isNaN(l2)) throw new t(t2, e.InvalidParameter, e3); return B(s2[0], l2, le(v3(s2[2], true)), a2(v3(s2[3], -1))); }); }, n.functions.buffer = function(e3, o) { return n.standardFunctionAsync(e3, o, (n2, s2, l2) => { if (l2 = pe(l2), V(l2, 2, 3, e3, o), null === l2[0]) return null; if (!(l2[0] instanceof p)) throw new t(e3, e.InvalidParameter, o); const u3 = re(l2[1]); if (isNaN(u3)) throw new t(e3, e.InvalidParameter, o); return 0 === u3 ? c(l2[0]) : L(l2[0], u3, a2(v3(l2[2], -1))); }); }, n.functions.buffergeodetic = function(e3, o) { return n.standardFunctionAsync(e3, o, (n2, s2, l2) => { if (l2 = pe(l2), V(l2, 2, 3, e3, o), null === l2[0]) return null; if (!(l2[0] instanceof p)) throw new t(e3, e.InvalidParameter, o); const u3 = re(l2[1]); if (isNaN(u3)) throw new t(e3, e.InvalidParameter, o); return 0 === u3 ? c(l2[0]) : P2(l2[0], u3, a2(v3(l2[2], -1))); }); }, n.functions.offset = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, o, l2) => { if (l2 = pe(l2), V(l2, 2, 6, t2, e3), null === l2[0]) return null; if (!(l2[0] instanceof v || l2[0] instanceof m)) throw new t(t2, e.InvalidParameter, e3); const u3 = re(l2[1]); if (isNaN(u3)) throw new t(t2, e.InvalidParameter, e3); const f = re(v3(l2[4], 10)); if (isNaN(f)) throw new t(t2, e.InvalidParameter, e3); const c2 = re(v3(l2[5], 0)); if (isNaN(c2)) throw new t(t2, e.InvalidParameter, e3); return v4(l2[0], u3, a2(v3(l2[2], -1)), K(v3(l2[3], "round")).toLowerCase(), f, c2); }); }, n.functions.rotate = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, o) => { o = pe(o), V(o, 2, 3, t2, e3); let s2 = o[0]; if (null === s2) return null; if (!(s2 instanceof p)) throw new t(t2, e.InvalidParameter, e3); s2 instanceof w2 && (s2 = v.fromExtent(s2)); const l2 = re(o[1]); if (isNaN(l2)) throw new t(t2, e.InvalidParameter, e3); const u3 = v3(o[2], null); if (null === u3) return H(s2, l2); if (u3 instanceof w) return H(s2, l2, u3); throw new t(t2, e.InvalidParameter, e3); }); }, n.functions.centroid = function(e3, r2) { return n.standardFunctionAsync(e3, r2, (n2, o, s2) => { if (s2 = pe(s2), V(s2, 1, 1, e3, r2), null === s2[0]) return null; let c2 = s2[0]; if ((Y(s2[0]) || E(s2[0])) && (c2 = be(s2[0], e3.spatialReference)), null === c2) return null; if (!(c2 instanceof p)) throw new t(e3, e.InvalidParameter, r2); return c2 instanceof w ? se(c(s2[0]), e3.spatialReference) : c2 instanceof v ? c2.centroid : c2 instanceof m ? l(c2) : c2 instanceof u ? u2(c2) : c2 instanceof w2 ? c2.center : null; }); }, n.functions.multiparttosinglepart = function(e3, r2) { return n.standardFunctionAsync(e3, r2, async (n2, o, s2) => { s2 = pe(s2), V(s2, 1, 1, e3, r2); const l2 = []; if (null === s2[0]) return null; if (!(s2[0] instanceof p)) throw new t(e3, e.InvalidParameter, r2); if (s2[0] instanceof w) return [se(c(s2[0]), e3.spatialReference)]; if (s2[0] instanceof w2) return [se(c(s2[0]), e3.spatialReference)]; const u3 = await N(s2[0]); if (u3 instanceof v) { const n3 = [], t2 = []; for (let e4 = 0; e4 < u3.rings.length; e4++) if (u3.isClockwise(u3.rings[e4])) { const t3 = v2({ rings: [u3.rings[e4]], hasZ: true === u3.hasZ, hazM: true === u3.hasM, spatialReference: u3.spatialReference.toJSON() }); n3.push(t3); } else t2.push({ ring: u3.rings[e4], pt: u3.getPoint(e4, 0) }); for (let e4 = 0; e4 < t2.length; e4++) for (let r3 = 0; r3 < n3.length; r3++) if (n3[r3].contains(t2[e4].pt)) { n3[r3].addRing(t2[e4].ring); break; } return n3; } if (u3 instanceof m) { const n3 = []; for (let t2 = 0; t2 < u3.paths.length; t2++) { const e4 = v2({ paths: [u3.paths[t2]], hasZ: true === u3.hasZ, hazM: true === u3.hasM, spatialReference: u3.spatialReference.toJSON() }); n3.push(e4); } return n3; } if (s2[0] instanceof u) { const n3 = se(c(s2[0]), e3.spatialReference); for (let t2 = 0; t2 < n3.points.length; t2++) l2.push(n3.getPoint(t2)); return l2; } return null; }); }, n.functions.issimple = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, o) => { if (o = pe(o), V(o, 1, 1, t2, e3), null === o[0]) return true; if (!(o[0] instanceof p)) throw new t(t2, e.InvalidParameter, e3); return J(o[0]); }); }, n.functions.simplify = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, o) => { if (o = pe(o), V(o, 1, 1, t2, e3), null === o[0]) return null; if (!(o[0] instanceof p)) throw new t(t2, e.InvalidParameter, e3); return N(o[0]); }); }, n.functions.convexhull = function(t2, e3) { return n.standardFunctionAsync(t2, e3, (n2, r2, o) => { if (o = pe(o), V(o, 1, 1, t2, e3), null === o[0]) return null; if (!(o[0] instanceof p)) throw new t(t2, e.InvalidParameter, e3); return j(o[0]); }); }); } export { dn }; //# sourceMappingURL=chunk-FFRSXQUT.js.map