123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684 |
- import {
- E as E2,
- Q,
- X,
- _,
- d as d2,
- j,
- k,
- q as q2
- } from "./chunk-Y2EWIDNZ.js";
- import {
- c as c2
- } from "./chunk-YOPKLVID.js";
- import {
- d,
- l,
- v
- } from "./chunk-GXVMJ7RN.js";
- import {
- s
- } from "./chunk-6BRTRIDE.js";
- import {
- E
- } from "./chunk-6H5PP7QI.js";
- import "./chunk-XIEPNAEI.js";
- import "./chunk-M5BTTMP6.js";
- import "./chunk-ETWBEEKL.js";
- import "./chunk-XZA4MVET.js";
- import {
- y
- } from "./chunk-JSUXM6R5.js";
- import "./chunk-AGCBSGET.js";
- import "./chunk-J525NRN3.js";
- import "./chunk-XXBIV3TZ.js";
- import "./chunk-2DNADSBR.js";
- import "./chunk-2QVXRTVA.js";
- import "./chunk-MI7HWWFL.js";
- import "./chunk-YZUP3MAF.js";
- import "./chunk-E3HOL2XO.js";
- import "./chunk-SCXOTZ6Q.js";
- import "./chunk-H4JLO5B2.js";
- import "./chunk-D5GG5NVO.js";
- import "./chunk-USORKAIZ.js";
- import "./chunk-Q34L5KZA.js";
- import "./chunk-G5AI6ZNE.js";
- import "./chunk-7IKYLNB5.js";
- import "./chunk-P4UZNLD5.js";
- import "./chunk-FYNVVMWY.js";
- import "./chunk-Q52DVFYK.js";
- import "./chunk-HBMVUVZX.js";
- import "./chunk-DH2OBAUC.js";
- import "./chunk-TNLRDNTC.js";
- import "./chunk-6P6NA7JB.js";
- import "./chunk-WR32EHFC.js";
- import "./chunk-522WBHUO.js";
- import {
- r as r4
- } from "./chunk-NTUXR253.js";
- import "./chunk-EOSZHC5H.js";
- import "./chunk-C43UE3Z5.js";
- import "./chunk-7XXXCK2A.js";
- import "./chunk-7ZIDBK7B.js";
- import "./chunk-WZQZRKNH.js";
- import "./chunk-LRDX4TO7.js";
- import "./chunk-WDLTDV2L.js";
- import "./chunk-TERAW6FT.js";
- import "./chunk-N2663GRX.js";
- import "./chunk-O4FY3ITT.js";
- import "./chunk-JXW4QTJA.js";
- import "./chunk-UXF37FQ4.js";
- import "./chunk-ZOEK6QHJ.js";
- import {
- A,
- g,
- p,
- q,
- r as r3,
- u,
- x
- } from "./chunk-XNLG7T2T.js";
- import {
- n as n3,
- r as r2,
- t as t2
- } from "./chunk-IR4PV7VK.js";
- import "./chunk-2Z6LERTI.js";
- import "./chunk-OWVBLVP3.js";
- import "./chunk-MXB2XLKV.js";
- import "./chunk-HNOZUNJ4.js";
- import "./chunk-VNFRAYHO.js";
- import "./chunk-R5IG2D6H.js";
- import "./chunk-VBRY5KJM.js";
- import "./chunk-PDKDCAAD.js";
- import "./chunk-ECW2QABR.js";
- import "./chunk-GCDJLKH4.js";
- import "./chunk-MRJEICT6.js";
- import {
- e,
- n2 as n,
- n5 as n2
- } from "./chunk-Y3WMVFTW.js";
- import "./chunk-SAS7RONY.js";
- import {
- e as e2
- } from "./chunk-WSRBH7BF.js";
- import "./chunk-IHXECKQQ.js";
- import {
- f
- } from "./chunk-ULGDPLM2.js";
- import "./chunk-EMJ4ZSM2.js";
- import "./chunk-IKP3YN53.js";
- import {
- c,
- r,
- t
- } from "./chunk-GZT4BVFP.js";
- import "./chunk-A5ICIBVI.js";
- // node_modules/@arcgis/core/geometry/support/clipRay.js
- function s3(r6) {
- return r6 ? { ray: d2(r6.ray), c0: r6.c0, c1: r6.c1 } : { ray: d2(), c0: 0, c1: Number.MAX_VALUE };
- }
- var b = new s(() => ({ c0: 0, c1: 0, ray: null }));
- // node_modules/@arcgis/core/views/3d/support/mathUtils.js
- var w = n3();
- var y2 = n3();
- var z2 = n3();
- var A2 = n3();
- var B = n3();
- // node_modules/@arcgis/core/geometry/support/plane.js
- var y3 = n3();
- var X2 = n3();
- var d3 = n3();
- var l4 = n3();
- var C = n3();
- var tt;
- !function(t3) {
- t3[t3.NONE = 0] = "NONE", t3[t3.CLAMP = 1] = "CLAMP", t3[t3.INFINITE_MIN = 4] = "INFINITE_MIN", t3[t3.INFINITE_MAX = 8] = "INFINITE_MAX";
- }(tt || (tt = {}));
- var nt = tt.INFINITE_MIN | tt.INFINITE_MAX;
- var rt = tt.INFINITE_MAX;
- // node_modules/@arcgis/core/geometry/support/frustum.js
- function I() {
- return [n3(), n3(), n3(), n3(), n3(), n3(), n3(), n3()];
- }
- function P2(T2, _3) {
- for (let O2 = 0; O2 < g2.NUM; O2++) {
- const R2 = T2[O2];
- if (R2[0] * _3[0] + R2[1] * _3[1] + R2[2] * _3[2] + R2[3] >= _3[3])
- return false;
- }
- return true;
- }
- var k3;
- var v2;
- !function(T2) {
- T2[T2.LEFT = 0] = "LEFT", T2[T2.RIGHT = 1] = "RIGHT", T2[T2.BOTTOM = 2] = "BOTTOM", T2[T2.TOP = 3] = "TOP", T2[T2.NEAR = 4] = "NEAR", T2[T2.FAR = 5] = "FAR";
- }(k3 || (k3 = {})), function(T2) {
- T2[T2.NEAR_BOTTOM_LEFT = 0] = "NEAR_BOTTOM_LEFT", T2[T2.NEAR_BOTTOM_RIGHT = 1] = "NEAR_BOTTOM_RIGHT", T2[T2.NEAR_TOP_RIGHT = 2] = "NEAR_TOP_RIGHT", T2[T2.NEAR_TOP_LEFT = 3] = "NEAR_TOP_LEFT", T2[T2.FAR_BOTTOM_LEFT = 4] = "FAR_BOTTOM_LEFT", T2[T2.FAR_BOTTOM_RIGHT = 5] = "FAR_BOTTOM_RIGHT", T2[T2.FAR_TOP_RIGHT = 6] = "FAR_TOP_RIGHT", T2[T2.FAR_TOP_LEFT = 7] = "FAR_TOP_LEFT";
- }(v2 || (v2 = {}));
- var h2 = { bottom: [v2.FAR_BOTTOM_RIGHT, v2.NEAR_BOTTOM_RIGHT, v2.NEAR_BOTTOM_LEFT, v2.FAR_BOTTOM_LEFT], near: [v2.NEAR_BOTTOM_LEFT, v2.NEAR_BOTTOM_RIGHT, v2.NEAR_TOP_RIGHT, v2.NEAR_TOP_LEFT], far: [v2.FAR_BOTTOM_RIGHT, v2.FAR_BOTTOM_LEFT, v2.FAR_TOP_LEFT, v2.FAR_TOP_RIGHT], right: [v2.NEAR_BOTTOM_RIGHT, v2.FAR_BOTTOM_RIGHT, v2.FAR_TOP_RIGHT, v2.NEAR_TOP_RIGHT], left: [v2.FAR_BOTTOM_LEFT, v2.NEAR_BOTTOM_LEFT, v2.NEAR_TOP_LEFT, v2.FAR_TOP_LEFT], top: [v2.FAR_TOP_LEFT, v2.NEAR_TOP_LEFT, v2.NEAR_TOP_RIGHT, v2.FAR_TOP_RIGHT] };
- var g2;
- var b3;
- !function(T2) {
- T2[T2.NUM = 6] = "NUM";
- }(g2 || (g2 = {})), function(T2) {
- T2[T2.NUM = 8] = "NUM";
- }(b3 || (b3 = {}));
- var y4 = [r4(-1, -1, -1, 1), r4(1, -1, -1, 1), r4(1, 1, -1, 1), r4(-1, 1, -1, 1), r4(-1, -1, 1, 1), r4(1, -1, 1, 1), r4(1, 1, 1, 1), r4(-1, 1, 1, 1)];
- var S = new s(s3);
- var w3 = I();
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Octree.js
- var g3 = class {
- constructor(e4, t3) {
- this._objectToBoundingSphere = e4, this._maximumObjectsPerNode = 10, this._maximumDepth = 20, this._degenerateObjects = new Set(), this._root = new O(), this._objectCount = 0, t3 && (t3.maximumObjectsPerNode !== void 0 && (this._maximumObjectsPerNode = t3.maximumObjectsPerNode), t3.maximumDepth !== void 0 && (this._maximumDepth = t3.maximumDepth));
- }
- get bounds() {
- return this._root.bounds;
- }
- get halfSize() {
- return this._root.halfSize;
- }
- get root() {
- return this._root.node;
- }
- get maximumObjectsPerNode() {
- return this._maximumObjectsPerNode;
- }
- get maximumDepth() {
- return this._maximumDepth;
- }
- get objectCount() {
- return this._objectCount;
- }
- destroy() {
- this._degenerateObjects.clear(), O.clearPool(), B2[0] = null, w4.prune(), W2.prune();
- }
- add(e4, t3 = e4.length) {
- this._objectCount += t3, this._grow(e4, t3);
- const n4 = O.acquire();
- for (let o3 = 0; o3 < t3; o3++) {
- const t4 = e4[o3];
- this._isDegenerate(t4) ? this._degenerateObjects.add(t4) : (n4.init(this._root), this._add(t4, n4));
- }
- O.release(n4);
- }
- remove(t3, n4 = null) {
- this._objectCount -= t3.length;
- const o3 = O.acquire();
- for (const s4 of t3) {
- const t4 = r(n4) ? n4 : q2(this._objectToBoundingSphere(s4), C2);
- z3(t4[3]) ? (o3.init(this._root), this._remove(s4, t4, o3)) : this._degenerateObjects.delete(s4);
- }
- O.release(o3), this._shrink();
- }
- update(e4, t3) {
- if (!z3(t3[3]) && this._isDegenerate(e4))
- return;
- const n4 = R(e4);
- this.remove(n4, t3), this.add(n4);
- }
- forEachAlongRay(e4, t3, n4) {
- const o3 = j(e4, t3);
- this._forEachNode(this._root, (e5) => {
- if (!this._intersectsNode(o3, e5))
- return false;
- const t4 = e5.node;
- return t4.terminals.forAll((e6) => {
- this._intersectsObject(o3, e6) && n4(e6);
- }), t4.residents !== null && t4.residents.forAll((e6) => {
- this._intersectsObject(o3, e6) && n4(e6);
- }), true;
- });
- }
- forEachAlongRayWithVerticalOffset(e4, t3, n4, o3) {
- const s4 = j(e4, t3);
- this._forEachNode(this._root, (e5) => {
- if (!this._intersectsNodeWithOffset(s4, e5, o3))
- return false;
- const t4 = e5.node;
- return t4.terminals.forAll((e6) => {
- this._intersectsObjectWithOffset(s4, e6, o3) && n4(e6);
- }), t4.residents !== null && t4.residents.forAll((e6) => {
- this._intersectsObjectWithOffset(s4, e6, o3) && n4(e6);
- }), true;
- });
- }
- forEach(e4) {
- this._forEachNode(this._root, (t3) => {
- const n4 = t3.node;
- return n4.terminals.forAll(e4), n4.residents !== null && n4.residents.forAll(e4), true;
- }), this._degenerateObjects.forEach(e4);
- }
- forEachDegenerateObject(e4) {
- this._degenerateObjects.forEach(e4);
- }
- findClosest(e4, t3, n4, r6 = () => true, i = 1 / 0) {
- let h3 = 1 / 0, a = 1 / 0, d4 = null;
- const c4 = E3(e4, t3), u3 = (o3) => {
- if (--i, !r6(o3))
- return;
- const s4 = this._objectToBoundingSphere(o3);
- if (!P2(n4, s4))
- return;
- const c5 = M(e4, t3, E2(s4)), u4 = c5 - s4[3], f4 = c5 + s4[3];
- u4 < h3 && (h3 = u4, a = f4, d4 = o3);
- };
- return this._forEachNodeDepthOrdered(this._root, (r7) => {
- if (i <= 0 || !P2(n4, r7.bounds))
- return false;
- q(F2, c4, r7.halfSize), u(F2, F2, r7.bounds);
- if (M(e4, t3, F2) > a)
- return false;
- const h4 = r7.node;
- return h4.terminals.forAll((e5) => u3(e5)), h4.residents !== null && h4.residents.forAll((e5) => u3(e5)), true;
- }, e4, t3), d4;
- }
- forEachInDepthRange(e4, t3, n4, r6, i, h3, a) {
- let d4 = -1 / 0, c4 = 1 / 0;
- const u3 = { setRange: (e5) => {
- n4 === g3.DepthOrder.FRONT_TO_BACK ? (d4 = Math.max(d4, e5.near), c4 = Math.min(c4, e5.far)) : (d4 = Math.max(d4, -e5.far), c4 = Math.min(c4, -e5.near));
- } };
- u3.setRange(r6);
- const f4 = M(t3, n4, e4), m = E3(t3, n4), p4 = E3(t3, -n4), b4 = (e5) => {
- if (!a(e5))
- return;
- const o3 = this._objectToBoundingSphere(e5), s4 = E2(o3), r7 = M(t3, n4, s4) - f4, m2 = r7 - o3[3], p5 = r7 + o3[3];
- m2 > c4 || p5 < d4 || !P2(h3, o3) || i(e5, u3);
- };
- this._forEachNodeDepthOrdered(this._root, (e5) => {
- if (!P2(h3, e5.bounds))
- return false;
- q(F2, m, e5.halfSize), u(F2, F2, e5.bounds);
- if (M(t3, n4, F2) - f4 > c4)
- return false;
- q(F2, p4, e5.halfSize), u(F2, F2, e5.bounds);
- if (M(t3, n4, F2) - f4 < d4)
- return false;
- const r7 = e5.node;
- return r7.terminals.forAll((e6) => b4(e6)), r7.residents !== null && r7.residents.forAll((e6) => b4(e6)), true;
- }, t3, n4);
- }
- forEachNode(e4) {
- this._forEachNode(this._root, (t3) => e4(t3.node, t3.bounds, t3.halfSize));
- }
- forEachNeighbor(e4, t3) {
- const n4 = k(t3), o3 = E2(t3), s4 = (t4) => {
- const s5 = this._objectToBoundingSphere(t4), i = k(s5), h3 = n4 + i;
- p(E2(s5), o3) - h3 * h3 <= 0 && e4(t4);
- };
- this._forEachNode(this._root, (e5) => {
- const t4 = k(e5.bounds), i = n4 + t4;
- if (p(E2(e5.bounds), o3) - i * i > 0)
- return false;
- const h3 = e5.node;
- return h3.terminals.forAll((e6) => s4(e6)), h3.residents !== null && h3.residents.forAll((e6) => s4(e6)), true;
- }), this.forEachDegenerateObject(s4);
- }
- _intersectsNode(e4, t3) {
- return x2(t3.bounds, 2 * -t3.halfSize, k4), x2(t3.bounds, 2 * t3.halfSize, q3), c2(e4.origin, e4.direction, k4, q3);
- }
- _intersectsNodeWithOffset(e4, t3, n4) {
- return x2(t3.bounds, 2 * -t3.halfSize, k4), x2(t3.bounds, 2 * t3.halfSize, q3), n4.applyToMinMax(k4, q3), c2(e4.origin, e4.direction, k4, q3);
- }
- _intersectsObject(e4, t3) {
- const n4 = this._objectToBoundingSphere(t3);
- return !(n4[3] > 0) || X(n4, e4);
- }
- _intersectsObjectWithOffset(e4, t3, n4) {
- const o3 = this._objectToBoundingSphere(t3);
- return !(o3[3] > 0) || X(n4.applyToBoundingSphere(o3), e4);
- }
- _forEachNode(e4, t3) {
- let n4 = O.acquire().init(e4);
- const o3 = [n4];
- for (; o3.length !== 0; ) {
- if (n4 = o3.pop(), t3(n4) && !n4.isLeaf())
- for (let e5 = 0; e5 < n4.node.children.length; e5++) {
- n4.node.children[e5] && o3.push(O.acquire().init(n4).advance(e5));
- }
- O.release(n4);
- }
- }
- _forEachNodeDepthOrdered(e4, t3, n4, o3 = g3.DepthOrder.FRONT_TO_BACK) {
- let s4 = O.acquire().init(e4);
- const r6 = [s4];
- for (T(n4, o3, V); r6.length !== 0; ) {
- if (s4 = r6.pop(), t3(s4) && !s4.isLeaf())
- for (let e5 = 7; e5 >= 0; --e5) {
- const t4 = V[e5];
- s4.node.children[t4] && r6.push(O.acquire().init(s4).advance(t4));
- }
- O.release(s4);
- }
- }
- _remove(e4, t3, n4) {
- w4.clear();
- const o3 = n4.advanceTo(t3, (e5, t4) => {
- w4.push(e5.node), w4.push(t4);
- }) ? n4.node.terminals : n4.node.residents;
- if (o3.removeUnordered(e4), o3.length === 0)
- for (let s4 = w4.length - 2; s4 >= 0; s4 -= 2) {
- const e5 = w4.data[s4], t4 = w4.data[s4 + 1];
- if (!this._purge(e5, t4))
- break;
- }
- }
- _nodeIsEmpty(e4) {
- if (e4.terminals.length !== 0)
- return false;
- if (e4.residents !== null)
- return e4.residents.length === 0;
- for (let t3 = 0; t3 < e4.children.length; t3++)
- if (e4.children[t3])
- return false;
- return true;
- }
- _purge(e4, t3) {
- return t3 >= 0 && (e4.children[t3] = null), !!this._nodeIsEmpty(e4) && (e4.residents === null && (e4.residents = new n2({ shrink: true })), true);
- }
- _add(e4, t3) {
- t3.advanceTo(this._objectToBoundingSphere(e4)) ? t3.node.terminals.push(e4) : (t3.node.residents.push(e4), t3.node.residents.length > this._maximumObjectsPerNode && t3.depth < this._maximumDepth && this._split(t3));
- }
- _split(e4) {
- const t3 = e4.node.residents;
- e4.node.residents = null;
- for (let n4 = 0; n4 < t3.length; n4++) {
- const o3 = O.acquire().init(e4);
- this._add(t3.getItemAt(n4), o3), O.release(o3);
- }
- }
- _grow(e4, t3) {
- if (t3 !== 0 && (N(e4, t3, (e5) => this._objectToBoundingSphere(e5), I2), z3(I2[3]) && !this._fitsInsideTree(I2)))
- if (this._nodeIsEmpty(this._root.node))
- q2(I2, this._root.bounds), this._root.halfSize = 1.25 * I2[3];
- else {
- const e5 = this._rootBoundsForRootAsSubNode(I2);
- this._placingRootViolatesMaxDepth(e5) ? this._rebuildTree(I2, e5) : this._growRootAsSubNode(e5), O.release(e5);
- }
- }
- _rebuildTree(e4, t3) {
- r3(P3, t3.bounds), P3[3] = t3.halfSize, N([e4, P3], 2, (e5) => e5, L);
- const n4 = O.acquire().init(this._root);
- this._root.initFrom(null, L, 1.25 * L[3]), this._forEachNode(n4, (e5) => (this.add(e5.node.terminals.data, e5.node.terminals.length), e5.node.residents !== null && this.add(e5.node.residents.data, e5.node.residents.length), true)), O.release(n4);
- }
- _placingRootViolatesMaxDepth(e4) {
- const t3 = Math.log(e4.halfSize / this._root.halfSize) * Math.LOG2E;
- let n4 = 0;
- return this._forEachNode(this._root, (e5) => (n4 = Math.max(n4, e5.depth), n4 + t3 <= this._maximumDepth)), n4 + t3 > this._maximumDepth;
- }
- _rootBoundsForRootAsSubNode(e4) {
- const t3 = e4[3], n4 = e4;
- let o3 = -1 / 0;
- const s4 = this._root.bounds, r6 = this._root.halfSize;
- for (let i = 0; i < 3; i++) {
- const e5 = s4[i] - r6 - (n4[i] - t3), h3 = n4[i] + t3 - (s4[i] + r6), a = Math.max(0, Math.ceil(e5 / (2 * r6))), d4 = Math.max(0, Math.ceil(h3 / (2 * r6))) + 1, l5 = 2 ** Math.ceil(Math.log(a + d4) * Math.LOG2E);
- o3 = Math.max(o3, l5), K[i].min = a, K[i].max = d4;
- }
- for (let i = 0; i < 3; i++) {
- let e5 = K[i].min, t4 = K[i].max;
- const n5 = (o3 - (e5 + t4)) / 2;
- e5 += Math.ceil(n5), t4 += Math.floor(n5);
- const h3 = s4[i] - r6 - e5 * r6 * 2;
- y5[i] = h3 + (t4 + e5) * r6;
- }
- return y5[3] = o3 * r6 * v3, O.acquire().initFrom(null, y5, o3 * r6, 0);
- }
- _growRootAsSubNode(e4) {
- const t3 = this._root.node;
- r3(I2, this._root.bounds), I2[3] = this._root.halfSize, this._root.init(e4), e4.advanceTo(I2, null, true), e4.node.children = t3.children, e4.node.residents = t3.residents, e4.node.terminals = t3.terminals;
- }
- _shrink() {
- for (; ; ) {
- const e4 = this._findShrinkIndex();
- if (e4 === -1)
- break;
- this._root.advance(e4), this._root.depth = 0;
- }
- }
- _findShrinkIndex() {
- if (this._root.node.terminals.length !== 0 || this._root.isLeaf())
- return -1;
- let e4 = null;
- const t3 = this._root.node.children;
- let n4 = 0, o3 = 0;
- for (; o3 < t3.length && e4 == null; )
- n4 = o3++, e4 = t3[n4];
- for (; o3 < t3.length; )
- if (t3[o3++])
- return -1;
- return n4;
- }
- _isDegenerate(e4) {
- return !z3(this._objectToBoundingSphere(e4)[3]);
- }
- _fitsInsideTree(e4) {
- const t3 = this._root.bounds, n4 = this._root.halfSize;
- return e4[3] <= n4 && e4[0] >= t3[0] - n4 && e4[0] <= t3[0] + n4 && e4[1] >= t3[1] - n4 && e4[1] <= t3[1] + n4 && e4[2] >= t3[2] - n4 && e4[2] <= t3[2] + n4;
- }
- };
- var O = class {
- constructor() {
- this.bounds = _(), this.halfSize = 0, this.initFrom(null, null, 0, 0);
- }
- init(e4) {
- return this.initFrom(e4.node, e4.bounds, e4.halfSize, e4.depth);
- }
- initFrom(t3, n4, o3, s4 = this.depth) {
- return this.node = r(t3) ? t3 : O.createEmptyNode(), r(n4) && q2(n4, this.bounds), this.halfSize = o3, this.depth = s4, this;
- }
- advance(e4) {
- let t3 = this.node.children[e4];
- t3 || (t3 = O.createEmptyNode(), this.node.children[e4] = t3), this.node = t3, this.halfSize /= 2, this.depth++;
- const n4 = A4[e4];
- return this.bounds[0] += n4[0] * this.halfSize, this.bounds[1] += n4[1] * this.halfSize, this.bounds[2] += n4[2] * this.halfSize, this.bounds[3] = this.halfSize * v3, this;
- }
- advanceTo(e4, t3, n4 = false) {
- for (; ; ) {
- if (this.isTerminalFor(e4))
- return t3 && t3(this, -1), true;
- if (this.isLeaf()) {
- if (!n4)
- return t3 && t3(this, -1), false;
- this.node.residents = null;
- }
- const o3 = this._childIndex(e4);
- t3 && t3(this, o3), this.advance(o3);
- }
- }
- isLeaf() {
- return this.node.residents != null;
- }
- isTerminalFor(e4) {
- return e4[3] > this.halfSize / 2;
- }
- _childIndex(e4) {
- const t3 = this.bounds;
- return (t3[0] < e4[0] ? 1 : 0) + (t3[1] < e4[1] ? 2 : 0) + (t3[2] < e4[2] ? 4 : 0);
- }
- static createEmptyNode() {
- return { children: [null, null, null, null, null, null, null, null], terminals: new n2({ shrink: true }), residents: new n2({ shrink: true }) };
- }
- static acquire() {
- return O._pool.acquire();
- }
- static release(e4) {
- O._pool.release(e4);
- }
- static clearPool() {
- O._pool.prune();
- }
- };
- function j4(e4, t3) {
- e4[0] = Math.min(e4[0], t3[0] - t3[3]), e4[1] = Math.min(e4[1], t3[1] - t3[3]), e4[2] = Math.min(e4[2], t3[2] - t3[3]);
- }
- function S2(e4, t3) {
- e4[0] = Math.max(e4[0], t3[0] + t3[3]), e4[1] = Math.max(e4[1], t3[1] + t3[3]), e4[2] = Math.max(e4[2], t3[2] + t3[3]);
- }
- function x2(e4, t3, n4) {
- n4[0] = e4[0] + t3, n4[1] = e4[1] + t3, n4[2] = e4[2] + t3;
- }
- function N(e4, t3, n4, o3) {
- if (t3 === 1) {
- const t4 = n4(e4[0]);
- q2(t4, o3);
- } else {
- k4[0] = 1 / 0, k4[1] = 1 / 0, k4[2] = 1 / 0, q3[0] = -1 / 0, q3[1] = -1 / 0, q3[2] = -1 / 0;
- for (let o4 = 0; o4 < t3; o4++) {
- const t4 = n4(e4[o4]);
- z3(t4[3]) && (j4(k4, t4), S2(q3, t4));
- }
- A(o3, k4, q3, 0.5), o3[3] = Math.max(q3[0] - k4[0], q3[1] - k4[1], q3[2] - k4[2]) / 2;
- }
- }
- function T(e4, t3, n4) {
- if (!W2.length)
- for (let o3 = 0; o3 < 8; ++o3)
- W2.push({ index: 0, distance: 0 });
- for (let o3 = 0; o3 < 8; ++o3) {
- const n5 = A4[o3];
- W2.data[o3].index = o3, W2.data[o3].distance = M(e4, t3, n5);
- }
- W2.sort((e5, t4) => e5.distance - t4.distance);
- for (let o3 = 0; o3 < 8; ++o3)
- n4[o3] = W2.data[o3].index;
- }
- function E3(e4, t3) {
- let n4 = 1 / 0, o3 = null;
- for (let s4 = 0; s4 < 8; ++s4) {
- const r6 = M(e4, t3, D2[s4]);
- r6 < n4 && (n4 = r6, o3 = D2[s4]);
- }
- return o3;
- }
- function M(e4, t3, n4) {
- return t3 * (e4[0] * n4[0] + e4[1] * n4[1] + e4[2] * n4[2]);
- }
- function z3(e4) {
- return !isNaN(e4) && e4 !== -1 / 0 && e4 !== 1 / 0 && e4 > 0;
- }
- O._pool = new e2(O), function(e4) {
- var t3;
- (t3 = e4.DepthOrder || (e4.DepthOrder = {}))[t3.FRONT_TO_BACK = 1] = "FRONT_TO_BACK", t3[t3.BACK_TO_FRONT = -1] = "BACK_TO_FRONT";
- }(g3 || (g3 = {}));
- var A4 = [r2(-1, -1, -1), r2(1, -1, -1), r2(-1, 1, -1), r2(1, 1, -1), r2(-1, -1, 1), r2(1, -1, 1), r2(-1, 1, 1), r2(1, 1, 1)];
- var D2 = [r2(-1, -1, -1), r2(-1, -1, 1), r2(-1, 1, -1), r2(-1, 1, 1), r2(1, -1, -1), r2(1, -1, 1), r2(1, 1, -1), r2(1, 1, 1)];
- var v3 = Math.sqrt(3);
- var B2 = [null];
- function R(e4) {
- return B2[0] = e4, B2;
- }
- var y5 = _();
- var F2 = n3();
- var k4 = n3();
- var q3 = n3();
- var w4 = new n2();
- var C2 = _();
- var I2 = _();
- var P3 = _();
- var L = _();
- var K = [{ min: 0, max: 0 }, { min: 0, max: 0 }, { min: 0, max: 0 }];
- var W2 = new n2();
- var V = [0, 0, 0, 0, 0, 0, 0, 0];
- var G2 = g3;
- // node_modules/@arcgis/core/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js
- var j5 = class {
- constructor() {
- this._idToComponent = new Map(), this._components = new G2((e4) => e4.bounds), this._edges = new G2((e4) => e4.bounds), this._tmpLineSegment = v(), this._tmpP1 = n3(), this._tmpP2 = n3(), this._tmpP3 = n3(), this.remoteClient = null;
- }
- async fetchCandidates(e4, t3) {
- await Promise.resolve(), f(t3), await this._ensureEdgeLocations(e4, t3);
- const s4 = [];
- return this._edges.forEachNeighbor((t4) => this._addCandidates(e4, t4, s4), e4.bounds), { result: { candidates: s4 } };
- }
- async _ensureEdgeLocations(e4, o3) {
- const n4 = [];
- if (this._components.forEachNeighbor((e5) => {
- if (t(e5.info)) {
- const { id: t3, uid: s4 } = e5;
- n4.push({ id: t3, uid: s4 });
- }
- }, e4.bounds), !n4.length)
- return;
- const i = { components: n4 }, r6 = await this.remoteClient.invoke("fetchAllEdgeLocations", i, c(o3, {}));
- for (const t3 of r6.components)
- this._setFetchEdgeLocations(t3);
- }
- async add(e4) {
- const t3 = new C3(e4.id, e4.bounds);
- return this._idToComponent.set(t3.id, t3), this._components.add([t3]), { result: {} };
- }
- async remove(e4) {
- const t3 = this._idToComponent.get(e4.id);
- if (t3) {
- const e5 = [];
- this._edges.forEachNeighbor((s4) => {
- s4.component === t3 && e5.push(s4);
- }, t3.bounds), this._edges.remove(e5), this._components.remove([t3]), this._idToComponent.delete(t3.id);
- }
- return { result: {} };
- }
- _setFetchEdgeLocations(e4) {
- const s4 = this._idToComponent.get(e4.id);
- if (t(s4) || e4.uid !== s4.uid)
- return;
- const o3 = y.createView(e4.locations), n4 = new Array(o3.count), a = n3(), p4 = n3();
- for (let t3 = 0; t3 < o3.count; t3++) {
- const c4 = _(), u4 = E2(c4);
- o3.position0.getVec(t3, a), o3.position1.getVec(t3, p4), g(u4, u4, a, 0.5), g(u4, u4, p4, 0.5), u(u4, u4, e4.origin), c4[3] = x(u4, a);
- const m2 = new E4(s4, t3, c4);
- n4[t3] = m2;
- }
- this._edges.add(n4);
- const { objectIds: u3, origin: m } = e4;
- s4.info = { locations: o3, objectIds: u3, origin: m };
- }
- _addCandidates(e4, t3, s4) {
- const { locations: o3, origin: n4, objectIds: i } = t3.component.info, d4 = o3.position0.getVec(t3.index, this._tmpP1), c4 = o3.position1.getVec(t3.index, this._tmpP2);
- u(d4, d4, n4), u(c4, c4, n4);
- const a = i[o3.componentIndex.get(t3.index)];
- this._addEdgeCandidate(e4, a, d4, c4, s4), this._addVertexCandidate(e4, a, d4, s4), this._addVertexCandidate(e4, a, c4, s4);
- }
- _addEdgeCandidate(e4, t3, s4, o3, n4) {
- if (!(e4.types & E.EDGE))
- return;
- const i = E2(e4.bounds), r6 = l(s4, o3, this._tmpLineSegment), c4 = d(r6, i, this._tmpP3);
- if (!Q(e4.bounds, c4))
- return null;
- n4.push({ type: "edge", objectId: t3, target: t2(c4), distance: x(i, c4), start: t2(s4), end: t2(o3) });
- }
- _addVertexCandidate(e4, t3, s4, o3) {
- if (!(e4.types & E.VERTEX))
- return;
- const n4 = E2(e4.bounds);
- if (!Q(e4.bounds, s4))
- return null;
- o3.push({ type: "vertex", objectId: t3, target: t2(s4), distance: x(n4, s4) });
- }
- };
- function y6() {
- return new j5();
- }
- j5 = e([n("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")], j5);
- var C3 = class {
- constructor(e4, t3) {
- this.id = e4, this.bounds = t3, this.info = null, this.uid = ++C3.uid;
- }
- };
- C3.uid = 0;
- var E4 = class {
- constructor(e4, t3, s4) {
- this.component = e4, this.index = t3, this.bounds = s4;
- }
- };
- export {
- j5 as SceneLayerSnappingSourceWorker,
- y6 as default
- };
- //# sourceMappingURL=SceneLayerSnappingSourceWorker-ZCIBJJSJ.js.map
|