123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644 |
- import {
- A as A3,
- S as S3,
- a as a7,
- c as c7,
- l as l3
- } from "./chunk-KHMWUB3W.js";
- import {
- R as R2
- } from "./chunk-C6RQ734D.js";
- import {
- X as X2,
- i as i8
- } from "./chunk-7OWXIDS3.js";
- import {
- E as E5,
- L as L3,
- d,
- d2,
- d3,
- e as e15,
- e5 as e17,
- e7 as e18,
- f as f6,
- h as h3,
- h2 as h4,
- i as i7,
- i2 as i9,
- o3 as o8,
- o5 as o10,
- o6 as o11,
- r as r10,
- t2 as t9,
- t3 as t10,
- u as u5,
- x2 as x3
- } from "./chunk-VDPG2V67.js";
- import {
- t as t6
- } from "./chunk-W5NACXEJ.js";
- import {
- C,
- W,
- _ as _3,
- a as a4,
- a2 as a6,
- c as c6,
- e as e14,
- h as h5,
- n as n9,
- o2 as o9,
- t as t7
- } from "./chunk-LDMWL65U.js";
- import {
- _ as _2,
- n as n11,
- x as x2
- } from "./chunk-WBWQJQK4.js";
- import "./chunk-2UEXES4O.js";
- import {
- e as e16
- } from "./chunk-UUVY36LI.js";
- import {
- a as a5,
- f as f5,
- n as n10,
- o as o6,
- o2 as o7,
- t as t8
- } from "./chunk-FQZKJNXZ.js";
- import "./chunk-L5R6EFI6.js";
- import {
- n as n8
- } from "./chunk-A22ACVMF.js";
- import {
- v as v2
- } from "./chunk-6EMDGCNH.js";
- import {
- e as e12
- } from "./chunk-QHWZYJGI.js";
- import {
- R,
- s as s4
- } from "./chunk-6H6IOAKG.js";
- import {
- e as e11,
- f2 as f4,
- i as i6,
- m,
- n2 as n5,
- n3 as n6,
- n4 as n7,
- o as o3,
- o3 as o4,
- o4 as o5,
- r as r7,
- r2 as r8,
- t as t4,
- u as u4
- } from "./chunk-3AFXMP6W.js";
- import {
- E as E4,
- n as n4
- } from "./chunk-H2VOWDMO.js";
- import {
- a as a3
- } from "./chunk-4HL6BBWO.js";
- import {
- T
- } from "./chunk-AGGGC2FA.js";
- import {
- O as O4
- } from "./chunk-RUM3DXFX.js";
- import "./chunk-X6GHUY4U.js";
- import "./chunk-4OM3EX6P.js";
- import {
- D,
- E as E3,
- G as G2,
- I,
- L as L2,
- M,
- O as O3,
- P as P2,
- V as V2,
- Y,
- u as u3
- } from "./chunk-3OFVLRSL.js";
- import {
- e2 as e9,
- f as f3,
- r as r5,
- t as t3
- } from "./chunk-IRQMHCT3.js";
- import {
- S as S2
- } from "./chunk-MP62QTGD.js";
- import {
- e as e7
- } from "./chunk-44FMXGSC.js";
- import {
- e as e8
- } from "./chunk-XFDO4CMR.js";
- import {
- e as e6
- } from "./chunk-GHN7C53L.js";
- import {
- E as E2,
- L,
- O as O2,
- c as c4,
- i as i3,
- u as u2,
- x
- } from "./chunk-HIELTLML.js";
- import {
- e as e13,
- t as t5
- } from "./chunk-IQBIGNPU.js";
- import {
- l as l2
- } from "./chunk-ZCAE6QVH.js";
- import "./chunk-K7B6OWCU.js";
- import {
- c as c5,
- i as i5
- } from "./chunk-UDYHZLTE.js";
- import {
- r as r6
- } from "./chunk-RWQH5X3O.js";
- import {
- g as g2,
- i as i4
- } from "./chunk-O3JQY77G.js";
- import "./chunk-E3G7BRZB.js";
- import {
- e as e10
- } from "./chunk-OJ2HHY2O.js";
- import {
- r as r9
- } from "./chunk-GGGVIS2U.js";
- import {
- A as A2,
- c as c3
- } from "./chunk-NKMX5M3L.js";
- import {
- r as r4
- } from "./chunk-C7742RNZ.js";
- import "./chunk-FZQZIM7U.js";
- import {
- G,
- h as h2
- } from "./chunk-VGWC3IKZ.js";
- import "./chunk-SWMSD4RP.js";
- import {
- n as n3
- } from "./chunk-O6VYMEIX.js";
- import {
- b
- } from "./chunk-PIFOHNWC.js";
- import {
- a as a2
- } from "./chunk-ZLNEXZAN.js";
- import {
- c as c2,
- i as i2
- } from "./chunk-RYY6632W.js";
- import {
- A,
- E,
- O,
- P,
- S,
- _,
- e as e5,
- g,
- i,
- o as o2,
- p,
- r as r3,
- s as s3,
- u,
- z
- } from "./chunk-DW42UVIT.js";
- import {
- e as e4,
- n as n2,
- r as r2,
- t as t2
- } from "./chunk-TJNOJH33.js";
- import "./chunk-YAEIHDJH.js";
- import "./chunk-OSHI574D.js";
- import {
- n
- } from "./chunk-Z4JTBD7M.js";
- import {
- U,
- c
- } from "./chunk-5DMBXPN2.js";
- import "./chunk-QANZ6BFY.js";
- import {
- V,
- X
- } from "./chunk-VEGAOVMY.js";
- import "./chunk-CXCDYJ5R.js";
- import "./chunk-GAOW3WRZ.js";
- import "./chunk-QCKFNSN2.js";
- import {
- e,
- l
- } from "./chunk-6SOHRC7T.js";
- import "./chunk-U2XHEJM7.js";
- import "./chunk-SQOPWYIT.js";
- import "./chunk-6KZ2LTDA.js";
- import {
- a,
- f as f2,
- v,
- w
- } from "./chunk-V6P2MAQQ.js";
- import {
- s2 as s,
- s3 as s2
- } from "./chunk-E5O6P5I2.js";
- import {
- has
- } from "./chunk-SPWQ3AWG.js";
- import {
- e as e3,
- o
- } from "./chunk-2TIUKVZN.js";
- import {
- e as e2,
- f,
- h,
- q,
- r,
- t
- } from "./chunk-YXWMMD76.js";
- import "./chunk-S5KM4IGW.js";
- // node_modules/@arcgis/core/views/3d/glTF/internal/TextureTransformUtils.js
- function c8(c16) {
- if (t(c16))
- return null;
- const m7 = r(c16.offset) ? c16.offset : c5, e20 = r(c16.rotation) ? c16.rotation : 0, i15 = r(c16.scale) ? c16.scale : i5, h9 = t5(1, 0, 0, 0, 1, 0, m7[0], m7[1], 1), u11 = t5(Math.cos(e20), -Math.sin(e20), 0, Math.sin(e20), Math.cos(e20), 0, 0, 0, 1), p4 = t5(i15[0], 0, 0, 0, i15[1], 0, 0, 0, 1), j4 = e13();
- return i4(j4, u11, p4), i4(j4, h9, j4), j4;
- }
- // node_modules/@arcgis/core/views/3d/layers/graphics/ProcessedObjectResource.js
- var s5 = class {
- constructor(s10, t12, e20, h9, i15) {
- this.name = s10, this.stageResources = t12, this.lodThreshold = e20, this.pivotOffset = h9, this.numberOfVertices = i15;
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/BoundingInfo.js
- var a8 = class {
- constructor(i15, s10, a10, c16) {
- this.primitiveIndices = i15, this._numIndexPerPrimitive = s10, this.indices = a10, this.position = c16, this.center = n2(), this._children = void 0, e12(i15.length >= 1), e12(a10.length % this._numIndexPerPrimitive == 0), e12(a10.length >= i15.length * this._numIndexPerPrimitive), e12(3 === c16.size || 4 === c16.size);
- const { data: o14, size: d9 } = c16, l9 = i15.length;
- let M6 = d9 * a10[this._numIndexPerPrimitive * i15[0]];
- b2.clear(), b2.push(M6), this.bbMin = r2(o14[M6], o14[M6 + 1], o14[M6 + 2]), this.bbMax = t2(this.bbMin);
- for (let t12 = 0; t12 < l9; ++t12) {
- const s11 = this._numIndexPerPrimitive * i15[t12];
- for (let i16 = 0; i16 < this._numIndexPerPrimitive; ++i16) {
- M6 = d9 * a10[s11 + i16], b2.push(M6);
- let t13 = o14[M6];
- this.bbMin[0] = Math.min(t13, this.bbMin[0]), this.bbMax[0] = Math.max(t13, this.bbMax[0]), t13 = o14[M6 + 1], this.bbMin[1] = Math.min(t13, this.bbMin[1]), this.bbMax[1] = Math.max(t13, this.bbMax[1]), t13 = o14[M6 + 2], this.bbMin[2] = Math.min(t13, this.bbMin[2]), this.bbMax[2] = Math.max(t13, this.bbMax[2]);
- }
- }
- A(this.center, this.bbMin, this.bbMax, 0.5), this.radius = 0.5 * Math.max(Math.max(this.bbMax[0] - this.bbMin[0], this.bbMax[1] - this.bbMin[1]), this.bbMax[2] - this.bbMin[2]);
- let m7 = this.radius * this.radius;
- for (let t12 = 0; t12 < b2.length; ++t12) {
- M6 = b2.getItemAt(t12);
- const i16 = o14[M6] - this.center[0], s11 = o14[M6 + 1] - this.center[1], e20 = o14[M6 + 2] - this.center[2], n13 = i16 * i16 + s11 * s11 + e20 * e20;
- if (n13 <= m7)
- continue;
- const r11 = Math.sqrt(n13), h9 = 0.5 * (r11 - this.radius);
- this.radius = this.radius + h9, m7 = this.radius * this.radius;
- const a11 = h9 / r11;
- this.center[0] += i16 * a11, this.center[1] += s11 * a11, this.center[2] += e20 * a11;
- }
- b2.clear();
- }
- getCenter() {
- return this.center;
- }
- getBSRadius() {
- return this.radius;
- }
- getBBMin() {
- return this.bbMin;
- }
- getBBMax() {
- return this.bbMax;
- }
- getChildren() {
- if (this._children)
- return this._children;
- if (p(this.bbMin, this.bbMax) > 1) {
- const i15 = A(n2(), this.bbMin, this.bbMax, 0.5), s10 = this.primitiveIndices.length, n13 = new Uint8Array(s10), r11 = new Array(8);
- for (let t12 = 0; t12 < 8; ++t12)
- r11[t12] = 0;
- const { data: h9, size: b5 } = this.position;
- for (let t12 = 0; t12 < s10; ++t12) {
- let s11 = 0;
- const e20 = this._numIndexPerPrimitive * this.primitiveIndices[t12];
- let a10 = b5 * this.indices[e20], c17 = h9[a10], o15 = h9[a10 + 1], d9 = h9[a10 + 2];
- for (let i16 = 1; i16 < this._numIndexPerPrimitive; ++i16) {
- a10 = b5 * this.indices[e20 + i16];
- const t13 = h9[a10], s12 = h9[a10 + 1], n14 = h9[a10 + 2];
- t13 < c17 && (c17 = t13), s12 < o15 && (o15 = s12), n14 < d9 && (d9 = n14);
- }
- c17 < i15[0] && (s11 |= 1), o15 < i15[1] && (s11 |= 2), d9 < i15[2] && (s11 |= 4), n13[t12] = s11, ++r11[s11];
- }
- let c16 = 0;
- for (let t12 = 0; t12 < 8; ++t12)
- r11[t12] > 0 && ++c16;
- if (c16 < 2)
- return;
- const o14 = new Array(8);
- for (let t12 = 0; t12 < 8; ++t12)
- o14[t12] = r11[t12] > 0 ? new Uint32Array(r11[t12]) : void 0;
- for (let t12 = 0; t12 < 8; ++t12)
- r11[t12] = 0;
- for (let t12 = 0; t12 < s10; ++t12) {
- const i16 = n13[t12];
- o14[i16][r11[i16]++] = this.primitiveIndices[t12];
- }
- this._children = new Array(8);
- for (let t12 = 0; t12 < 8; ++t12)
- void 0 !== o14[t12] && (this._children[t12] = new a8(o14[t12], this._numIndexPerPrimitive, this.indices, this.position));
- }
- return this._children;
- }
- static prune() {
- b2.prune();
- }
- };
- var b2 = new l({ deallocator: null });
- // node_modules/@arcgis/core/geometry/support/triangle.js
- function j(t12) {
- return t12 ? { p0: t2(t12.p0), p1: t2(t12.p1), p2: t2(t12.p2) } : { p0: n2(), p1: n2(), p2: n2() };
- }
- function w2(t12, n13, o14) {
- return e5(O5, n13, t12), e5(V3, o14, t12), s3(_(O5, O5, V3)) / 2;
- }
- var M3 = new s4(v2);
- var x4 = new s4(() => j());
- var O5 = n2();
- var V3 = n2();
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/geometryDataUtils.js
- function c10(o14, r11, c16) {
- if (!o14 || !r11)
- return false;
- const { size: a10, data: f9 } = o14;
- o2(c16, 0, 0, 0), o2(g3, 0, 0, 0);
- let m7 = 0, h9 = 0;
- for (let p4 = 0; p4 < r11.length - 2; p4 += 3) {
- const o15 = r11[p4 + 0] * a10, j4 = r11[p4 + 1] * a10, d9 = r11[p4 + 2] * a10;
- o2(i10, f9[o15 + 0], f9[o15 + 1], f9[o15 + 2]), o2(u6, f9[j4 + 0], f9[j4 + 1], f9[j4 + 2]), o2(l4, f9[d9 + 0], f9[d9 + 1], f9[d9 + 2]);
- const z4 = w2(i10, u6, l4);
- z4 ? (u(i10, i10, u6), u(i10, i10, l4), g(i10, i10, 1 / 3 * z4), u(c16, c16, i10), m7 += z4) : (u(g3, g3, i10), u(g3, g3, u6), u(g3, g3, l4), h9 += 3);
- }
- return (0 !== h9 || 0 !== m7) && (0 !== m7 ? (g(c16, c16, 1 / m7), true) : 0 !== h9 && (g(c16, g3, 1 / h9), true));
- }
- function a9(n13, o14, r11) {
- if (!n13 || !o14)
- return false;
- const { size: s10, data: c16 } = n13;
- o2(r11, 0, 0, 0);
- let a10 = -1, f9 = 0;
- for (let t12 = 0; t12 < o14.length; t12++) {
- const n14 = o14[t12] * s10;
- a10 !== n14 && (r11[0] += c16[n14 + 0], r11[1] += c16[n14 + 1], r11[2] += c16[n14 + 2], f9++), a10 = n14;
- }
- return f9 > 1 && g(r11, r11, 1 / f9), f9 > 0;
- }
- var i10 = n2();
- var u6 = n2();
- var l4 = n2();
- var g3 = n2();
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Geometry.js
- var d4 = class extends r10 {
- constructor(t12, i15 = [], n13 = a4.Triangle, r11 = null, o14 = -1) {
- super(), this._primitiveType = n13, this.objectAndLayerIdColor = r11, this.edgeIndicesLength = o14, this.type = e15.Geometry, this._vertexAttributes = /* @__PURE__ */ new Map(), this._indices = /* @__PURE__ */ new Map(), this._boundingInfo = null;
- for (const [e20, s10] of t12)
- s10 && this._vertexAttributes.set(e20, { ...s10 });
- if (null == i15 || 0 === i15.length) {
- const t13 = l5(this._vertexAttributes), e20 = u4(t13);
- this.edgeIndicesLength = this.edgeIndicesLength < 0 ? t13 : this.edgeIndicesLength;
- for (const i16 of this._vertexAttributes.keys())
- this._indices.set(i16, e20);
- } else
- for (const [e20, s10] of i15)
- s10 && (this._indices.set(e20, n7(s10)), e20 === O4.POSITION && (this.edgeIndicesLength = this.edgeIndicesLength < 0 ? this._indices.get(e20).length : this.edgeIndicesLength));
- }
- cloneShallow() {
- const t12 = new d4([], void 0, this._primitiveType, this.objectAndLayerIdColor, void 0), { _vertexAttributes: e20, _indices: i15 } = t12;
- return this._vertexAttributes.forEach((t13, i16) => e20.set(i16, t13)), this._indices.forEach((t13, e21) => i15.set(e21, t13)), t12.screenToWorldRatio = this.screenToWorldRatio, t12._boundingInfo = this._boundingInfo, t12;
- }
- get vertexAttributes() {
- return this._vertexAttributes;
- }
- getMutableAttribute(t12) {
- const e20 = this._vertexAttributes.get(t12);
- return e20 && !e20.exclusive && (e20.data = Array.from(e20.data), e20.exclusive = true), e20;
- }
- get indices() {
- return this._indices;
- }
- get indexCount() {
- const t12 = this._indices.values().next().value;
- return t12 ? t12.length : 0;
- }
- get primitiveType() {
- return this._primitiveType;
- }
- get faceCount() {
- return this.indexCount / 3;
- }
- get boundingInfo() {
- return t(this._boundingInfo) && (this._boundingInfo = this._calculateBoundingInfo()), this._boundingInfo;
- }
- computeAttachmentOrigin(t12) {
- return this.primitiveType === a4.Triangle ? this._computeAttachmentOriginTriangles(t12) : this._computeAttachmentOriginPoints(t12);
- }
- _computeAttachmentOriginTriangles(t12) {
- const e20 = this.indices.get(O4.POSITION), i15 = this.vertexAttributes.get(O4.POSITION);
- return c10(i15, e20, t12);
- }
- _computeAttachmentOriginPoints(t12) {
- const e20 = this.indices.get(O4.POSITION), i15 = this.vertexAttributes.get(O4.POSITION);
- return a9(i15, e20, t12);
- }
- invalidateBoundingInfo() {
- this._boundingInfo = null;
- }
- _calculateBoundingInfo() {
- const t12 = this.indices.get(O4.POSITION);
- if (!t12 || 0 === t12.length)
- return null;
- const n13 = this.primitiveType === a4.Triangle ? 3 : 1;
- e12(t12.length % n13 == 0, "Indexing error: " + t12.length + " not divisible by " + n13);
- const s10 = u4(t12.length / n13), r11 = this.vertexAttributes.get(O4.POSITION);
- return r11 ? new a8(s10, n13, t12, r11) : null;
- }
- };
- function l5(t12) {
- const e20 = t12.values().next().value;
- return null == e20 ? 0 : e20.data.length / e20.size;
- }
- // node_modules/@arcgis/core/chunks/TextureOnly.glsl.js
- var i11 = class extends t8 {
- constructor() {
- super(...arguments), this.color = r4(1, 1, 1, 1);
- }
- };
- function l6() {
- const e20 = new o7();
- return e20.include(o6), e20.fragment.uniforms.add([new f5("tex", (e21) => e21.texture), new e16("uColor", (e21) => e21.color)]), e20.fragment.code.add(n10`void main() {
- vec4 texColor = texture2D(tex, uv);
- gl_FragColor = texColor * uColor;
- }`), e20;
- }
- var d5 = Object.freeze(Object.defineProperty({ __proto__: null, TextureOnlyPassParameters: i11, build: l6 }, Symbol.toStringTag, { value: "Module" }));
- // node_modules/@arcgis/core/libs/basisu/BasisU.js
- function s6() {
- if (t(i12)) {
- const t12 = (t13) => a2(`esri/libs/basisu/${t13}`);
- i12 = import("./basis_transcoder-NDVUP4EN.js").then((e20) => e20.b).then(({ default: e20 }) => e20({ locateFile: t12 }).then((e21) => (e21.initializeBasis(), delete e21.then, e21)));
- }
- return i12;
- }
- var i12;
- // node_modules/@arcgis/core/libs/basisu/TextureFormat.js
- var _4;
- !function(_8) {
- _8[_8.ETC1_RGB = 0] = "ETC1_RGB", _8[_8.ETC2_RGBA = 1] = "ETC2_RGBA", _8[_8.BC1_RGB = 2] = "BC1_RGB", _8[_8.BC3_RGBA = 3] = "BC3_RGBA", _8[_8.BC4_R = 4] = "BC4_R", _8[_8.BC5_RG = 5] = "BC5_RG", _8[_8.BC7_M6_RGB = 6] = "BC7_M6_RGB", _8[_8.BC7_M5_RGBA = 7] = "BC7_M5_RGBA", _8[_8.PVRTC1_4_RGB = 8] = "PVRTC1_4_RGB", _8[_8.PVRTC1_4_RGBA = 9] = "PVRTC1_4_RGBA", _8[_8.ASTC_4x4_RGBA = 10] = "ASTC_4x4_RGBA", _8[_8.ATC_RGB = 11] = "ATC_RGB", _8[_8.ATC_RGBA = 12] = "ATC_RGBA", _8[_8.FXT1_RGB = 17] = "FXT1_RGB", _8[_8.PVRTC2_4_RGB = 18] = "PVRTC2_4_RGB", _8[_8.PVRTC2_4_RGBA = 19] = "PVRTC2_4_RGBA", _8[_8.ETC2_EAC_R11 = 20] = "ETC2_EAC_R11", _8[_8.ETC2_EAC_RG11 = 21] = "ETC2_EAC_RG11", _8[_8.RGBA32 = 13] = "RGBA32", _8[_8.RGB565 = 14] = "RGB565", _8[_8.BGR565 = 15] = "BGR565", _8[_8.RGBA4444 = 16] = "RGBA4444";
- }(_4 || (_4 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/BasisUtil.js
- var g4 = null;
- var l7 = null;
- async function c11() {
- return t(l7) && (l7 = s6(), g4 = await l7), l7;
- }
- function u7(t12, n13) {
- if (t(g4))
- return t12.byteLength;
- const r11 = new g4.BasisFile(new Uint8Array(t12)), s10 = T2(r11) ? E6(r11.getNumLevels(0), r11.getHasAlpha(), r11.getImageWidth(0, 0), r11.getImageHeight(0, 0), n13) : 0;
- return r11.close(), r11.delete(), s10;
- }
- function m3(t12, n13) {
- if (t(g4))
- return t12.byteLength;
- const r11 = new g4.KTX2File(new Uint8Array(t12)), s10 = _5(r11) ? E6(r11.getLevels(), r11.getHasAlpha(), r11.getWidth(), r11.getHeight(), n13) : 0;
- return r11.close(), r11.delete(), s10;
- }
- function E6(e20, t12, n13, s10, i15) {
- const a10 = _2(t12 ? u3.COMPRESSED_RGBA8_ETC2_EAC : u3.COMPRESSED_RGB8_ETC2), g8 = i15 && e20 > 1 ? (4 ** e20 - 1) / (3 * 4 ** (e20 - 1)) : 1;
- return Math.ceil(n13 * s10 * a10 * g8);
- }
- function T2(e20) {
- return e20.getNumImages() >= 1 && !e20.isUASTC();
- }
- function _5(e20) {
- return e20.getFaces() >= 1 && e20.isETC1S();
- }
- async function h6(t12, n13, r11) {
- t(g4) && (g4 = await c11());
- const s10 = new g4.BasisFile(new Uint8Array(r11));
- if (!T2(s10))
- return null;
- s10.startTranscoding();
- const i15 = p2(t12, n13, s10.getNumLevels(0), s10.getHasAlpha(), s10.getImageWidth(0, 0), s10.getImageHeight(0, 0), (e20, t13) => s10.getImageTranscodedSizeInBytes(0, e20, t13), (e20, t13, n14) => s10.transcodeImage(n14, 0, e20, t13, 0, 0));
- return s10.close(), s10.delete(), i15;
- }
- async function A4(t12, n13, r11) {
- t(g4) && (g4 = await c11());
- const s10 = new g4.KTX2File(new Uint8Array(r11));
- if (!_5(s10))
- return null;
- s10.startTranscoding();
- const i15 = p2(t12, n13, s10.getLevels(), s10.getHasAlpha(), s10.getWidth(), s10.getHeight(), (e20, t13) => s10.getImageTranscodedSizeInBytes(e20, 0, 0, t13), (e20, t13, n14) => s10.transcodeImage(n14, e20, 0, 0, t13, 0, -1, -1));
- return s10.close(), s10.delete(), i15;
- }
- function p2(e20, t12, o14, g8, l9, c16, u11, m7) {
- const { compressedTextureETC: E10, compressedTextureS3TC: T6 } = e20.capabilities, [_8, h9] = E10 ? g8 ? [_4.ETC2_RGBA, u3.COMPRESSED_RGBA8_ETC2_EAC] : [_4.ETC1_RGB, u3.COMPRESSED_RGB8_ETC2] : T6 ? g8 ? [_4.BC3_RGBA, u3.COMPRESSED_RGBA_S3TC_DXT5_EXT] : [_4.BC1_RGB, u3.COMPRESSED_RGB_S3TC_DXT1_EXT] : [_4.RGBA32, P2.RGBA], A7 = t12.hasMipmap ? o14 : Math.min(1, o14), p4 = [];
- for (let n13 = 0; n13 < A7; n13++)
- p4.push(new Uint8Array(u11(n13, _8))), m7(n13, _8, p4[n13]);
- const C4 = p4.length > 1, d9 = C4 ? L2.LINEAR_MIPMAP_LINEAR : L2.LINEAR, R4 = { ...t12, samplingMode: d9, hasMipmap: C4, internalFormat: h9, width: l9, height: c16 };
- return new E4(e20, R4, { type: "compressed", levels: p4 });
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/DDSUtil.js
- var i13 = s.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");
- var s7 = 542327876;
- var l8 = 131072;
- var m4 = 4;
- function u8(e20) {
- return e20.charCodeAt(0) + (e20.charCodeAt(1) << 8) + (e20.charCodeAt(2) << 16) + (e20.charCodeAt(3) << 24);
- }
- function c12(e20) {
- return String.fromCharCode(255 & e20, e20 >> 8 & 255, e20 >> 16 & 255, e20 >> 24 & 255);
- }
- var h7 = u8("DXT1");
- var p3 = u8("DXT3");
- var d6 = u8("DXT5");
- var g5 = 31;
- var f7 = 0;
- var C2 = 1;
- var w3 = 2;
- var D2 = 3;
- var _6 = 4;
- var T3 = 7;
- var A5 = 20;
- var E7 = 21;
- function S4(e20, r11, n13) {
- var _a;
- const { textureData: i15, internalFormat: s10, width: l9, height: m7 } = f(M4(n13, (_a = r11.hasMipmap) != null ? _a : false));
- return r11.samplingMode = i15.levels.length > 1 ? L2.LINEAR_MIPMAP_LINEAR : L2.LINEAR, r11.hasMipmap = i15.levels.length > 1, r11.internalFormat = s10, r11.width = l9, r11.height = m7, new E4(e20, r11, i15);
- }
- function M4(e20, t12) {
- const o14 = new Int32Array(e20, 0, g5);
- if (o14[f7] !== s7)
- return i13.error("Invalid magic number in DDS header"), null;
- if (!(o14[A5] & m4))
- return i13.error("Unsupported format, must contain a FourCC code"), null;
- const a10 = o14[E7];
- let u11, S7;
- switch (a10) {
- case h7:
- u11 = 8, S7 = u3.COMPRESSED_RGB_S3TC_DXT1_EXT;
- break;
- case p3:
- u11 = 16, S7 = u3.COMPRESSED_RGBA_S3TC_DXT3_EXT;
- break;
- case d6:
- u11 = 16, S7 = u3.COMPRESSED_RGBA_S3TC_DXT5_EXT;
- break;
- default:
- return i13.error("Unsupported FourCC code:", c12(a10)), null;
- }
- let M6 = 1, R4 = o14[_6], b5 = o14[D2];
- 0 == (3 & R4) && 0 == (3 & b5) || (i13.warn("Rounding up compressed texture size to nearest multiple of 4."), R4 = R4 + 3 & -4, b5 = b5 + 3 & -4);
- const x6 = R4, X3 = b5;
- let I4, j4;
- o14[w3] & l8 && false !== t12 && (M6 = Math.max(1, o14[T3])), 1 === M6 || c2(R4) && c2(b5) || (i13.warn("Ignoring mipmaps of non power of two sized compressed texture."), M6 = 1);
- let v5 = o14[C2] + 4;
- const F = [];
- for (let r11 = 0; r11 < M6; ++r11)
- j4 = (R4 + 3 >> 2) * (b5 + 3 >> 2) * u11, I4 = new Uint8Array(e20, v5, j4), F.push(I4), v5 += j4, R4 = Math.max(1, R4 >> 1), b5 = Math.max(1, b5 >> 1);
- return { textureData: { type: "compressed", levels: F }, internalFormat: S7, width: x6, height: X3 };
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Texture.js
- var L4 = class extends r10 {
- constructor(t12, e20) {
- super(), this._data = t12, this.type = e15.Texture, this._glTexture = null, this._powerOfTwoStretchInfo = null, this._loadingPromise = null, this._loadingController = null, this.events = new n(), this._passParameters = new i11(), this.params = e20 || {}, this.params.mipmap = false !== this.params.mipmap, this.params.noUnpackFlip = this.params.noUnpackFlip || false, this.params.preMultiplyAlpha = this.params.preMultiplyAlpha || false, this.params.wrap = this.params.wrap || { s: D.REPEAT, t: D.REPEAT }, this.params.powerOfTwoResizeMode = this.params.powerOfTwoResizeMode || c6.STRETCH, this.estimatedTexMemRequired = L4._estimateTexMemRequired(this._data, this.params), this._startPreload();
- }
- _startPreload() {
- const t12 = this._data;
- t(t12) || (t12 instanceof HTMLVideoElement ? this._startPreloadVideoElement(t12) : t12 instanceof HTMLImageElement && this._startPreloadImageElement(t12));
- }
- _startPreloadVideoElement(t12) {
- if (!(V(t12.src) || "auto" === t12.preload && t12.crossOrigin)) {
- t12.preload = "auto", t12.crossOrigin = "anonymous";
- const e20 = !t12.paused;
- if (t12.src = t12.src, e20 && t12.autoplay) {
- const e21 = () => {
- t12.removeEventListener("canplay", e21), t12.play();
- };
- t12.addEventListener("canplay", e21);
- }
- }
- }
- _startPreloadImageElement(t12) {
- X(t12.src) || V(t12.src) || t12.crossOrigin || (t12.crossOrigin = "anonymous", t12.src = t12.src);
- }
- static _getDataDimensions(t12) {
- return t12 instanceof HTMLVideoElement ? { width: t12.videoWidth, height: t12.videoHeight } : t12;
- }
- static _estimateTexMemRequired(t12, e20) {
- if (t(t12))
- return 0;
- if (o(t12) || e3(t12))
- return e20.encoding === L4.KTX2_ENCODING ? m3(t12, e20.mipmap) : e20.encoding === L4.BASIS_ENCODING ? u7(t12, e20.mipmap) : t12.byteLength;
- const { width: r11, height: i15 } = t12 instanceof Image || t12 instanceof ImageData || t12 instanceof HTMLCanvasElement || t12 instanceof HTMLVideoElement ? L4._getDataDimensions(t12) : e20;
- return (e20.mipmap ? 4 / 3 : 1) * r11 * i15 * (e20.components || 4) || 0;
- }
- dispose() {
- this._data = void 0;
- }
- get width() {
- return this.params.width;
- }
- get height() {
- return this.params.height;
- }
- _createDescriptor(t12) {
- var _a;
- return { target: M.TEXTURE_2D, pixelFormat: P2.RGBA, dataType: G2.UNSIGNED_BYTE, wrapMode: this.params.wrap, flipped: !this.params.noUnpackFlip, samplingMode: this.params.mipmap ? L2.LINEAR_MIPMAP_LINEAR : L2.LINEAR, hasMipmap: this.params.mipmap, preMultiplyAlpha: this.params.preMultiplyAlpha, maxAnisotropy: (_a = this.params.maxAnisotropy) != null ? _a : this.params.mipmap ? t12.parameters.maxMaxAnisotropy : 1 };
- }
- get glTexture() {
- return this._glTexture;
- }
- load(t12, e20) {
- if (r(this._glTexture))
- return this._glTexture;
- if (r(this._loadingPromise))
- return this._loadingPromise;
- const r11 = this._data;
- return t(r11) ? (this._glTexture = new E4(t12, this._createDescriptor(t12), null), this._glTexture) : "string" == typeof r11 ? this._loadFromURL(t12, e20, r11) : r11 instanceof Image ? this._loadFromImageElement(t12, e20, r11) : r11 instanceof HTMLVideoElement ? this._loadFromVideoElement(t12, e20, r11) : r11 instanceof ImageData || r11 instanceof HTMLCanvasElement ? this._loadFromImage(t12, r11, e20) : (o(r11) || e3(r11)) && this.params.encoding === L4.DDS_ENCODING ? (this._data = void 0, this._loadFromDDSData(t12, r11)) : (o(r11) || e3(r11)) && this.params.encoding === L4.KTX2_ENCODING ? (this._data = void 0, this._loadFromKTX2(t12, r11)) : (o(r11) || e3(r11)) && this.params.encoding === L4.BASIS_ENCODING ? (this._data = void 0, this._loadFromBasis(t12, r11)) : e3(r11) ? this._loadFromPixelData(t12, r11) : o(r11) ? this._loadFromPixelData(t12, new Uint8Array(r11)) : null;
- }
- get requiresFrameUpdates() {
- return this._data instanceof HTMLVideoElement;
- }
- frameUpdate(t12, e20, r11) {
- if (!(this._data instanceof HTMLVideoElement) || t(this._glTexture))
- return r11;
- if (this._data.readyState < G3.HAVE_CURRENT_DATA || r11 === this._data.currentTime)
- return r11;
- if (r(this._powerOfTwoStretchInfo)) {
- const { framebuffer: r12, vao: i15, sourceTexture: s10 } = this._powerOfTwoStretchInfo;
- s10.setData(this._data), this._drawStretchedTexture(t12, e20, r12, i15, s10, this._glTexture);
- } else {
- const { videoWidth: t13, videoHeight: e21 } = this._data, { width: r12, height: i15 } = this._glTexture.descriptor;
- t13 !== r12 || e21 !== i15 ? this._glTexture.updateData(0, 0, 0, Math.min(t13, r12), Math.min(e21, i15), this._data) : this._glTexture.setData(this._data);
- }
- return this._glTexture.descriptor.hasMipmap && this._glTexture.generateMipmap(), this.params.updateCallback && this.params.updateCallback(), this._data.currentTime;
- }
- _loadFromDDSData(t12, e20) {
- return this._glTexture = S4(t12, this._createDescriptor(t12), e20), this._glTexture;
- }
- _loadFromKTX2(t12, e20) {
- return this._loadAsync(() => A4(t12, this._createDescriptor(t12), e20).then((t13) => (this._glTexture = t13, t13)));
- }
- _loadFromBasis(t12, e20) {
- return this._loadAsync(() => h6(t12, this._createDescriptor(t12), e20).then((t13) => (this._glTexture = t13, t13)));
- }
- _loadFromPixelData(t12, e20) {
- e12(this.params.width > 0 && this.params.height > 0);
- const r11 = this._createDescriptor(t12);
- return r11.pixelFormat = 1 === this.params.components ? P2.LUMINANCE : 3 === this.params.components ? P2.RGB : P2.RGBA, r11.width = this.params.width, r11.height = this.params.height, this._glTexture = new E4(t12, r11, e20), this._glTexture;
- }
- _loadFromURL(t12, e20, r11) {
- return this._loadAsync(async (i15) => {
- const s10 = await t6(r11, { signal: i15 });
- return f2(i15), this._loadFromImage(t12, s10, e20);
- });
- }
- _loadFromImageElement(t12, e20, r11) {
- return r11.complete ? this._loadFromImage(t12, r11, e20) : this._loadAsync(async (i15) => {
- const s10 = await c(r11, r11.src, false, i15);
- return f2(i15), this._loadFromImage(t12, s10, e20);
- });
- }
- _loadFromVideoElement(t12, e20, r11) {
- return r11.readyState >= G3.HAVE_CURRENT_DATA ? this._loadFromImage(t12, r11, e20) : this._loadFromVideoElementAsync(t12, e20, r11);
- }
- _loadFromVideoElementAsync(t12, r11, i15) {
- return this._loadAsync((s10) => new Promise((a10, o14) => {
- const m7 = () => {
- i15.removeEventListener("loadeddata", p4), i15.removeEventListener("error", d9), h(_8);
- }, p4 = () => {
- i15.readyState >= G3.HAVE_CURRENT_DATA && (m7(), a10(this._loadFromImage(t12, i15, r11)));
- }, d9 = (t13) => {
- m7(), o14(t13 || new s2("Failed to load video"));
- };
- i15.addEventListener("loadeddata", p4), i15.addEventListener("error", d9);
- const _8 = v(s10, () => d9(a()));
- }));
- }
- _loadFromImage(t12, e20, r11) {
- const s10 = L4._getDataDimensions(e20);
- this.params.width = s10.width, this.params.height = s10.height;
- const a10 = this._createDescriptor(t12);
- return a10.pixelFormat = 3 === this.params.components ? P2.RGB : P2.RGBA, !this._requiresPowerOfTwo(t12, a10) || c2(s10.width) && c2(s10.height) ? (a10.width = s10.width, a10.height = s10.height, this._glTexture = new E4(t12, a10, e20), this._glTexture) : (this._glTexture = this._makePowerOfTwoTexture(t12, e20, s10, a10, r11), this._glTexture);
- }
- _loadAsync(t12) {
- const e20 = new AbortController();
- this._loadingController = e20;
- const r11 = t12(e20.signal);
- this._loadingPromise = r11;
- const i15 = () => {
- this._loadingController === e20 && (this._loadingController = null), this._loadingPromise === r11 && (this._loadingPromise = null);
- };
- return r11.then(i15, i15), r11;
- }
- _requiresPowerOfTwo(t12, e20) {
- const r11 = D.CLAMP_TO_EDGE, i15 = "number" == typeof e20.wrapMode ? e20.wrapMode === r11 : e20.wrapMode.s === r11 && e20.wrapMode.t === r11;
- return !n4(t12.gl) && (e20.hasMipmap || !i15);
- }
- _makePowerOfTwoTexture(e20, r11, i15, a10, o14) {
- const { width: n13, height: m7 } = i15, h9 = i2(n13), l9 = i2(m7);
- let p4;
- switch (a10.width = h9, a10.height = l9, this.params.powerOfTwoResizeMode) {
- case c6.PAD:
- a10.textureCoordinateScaleFactor = [n13 / h9, m7 / l9], p4 = new E4(e20, a10), p4.updateData(0, 0, 0, n13, m7, r11);
- break;
- case c6.STRETCH:
- case null:
- case void 0:
- p4 = this._stretchToPowerOfTwo(e20, r11, a10, o14());
- break;
- default:
- n3(this.params.powerOfTwoResizeMode);
- }
- return a10.hasMipmap && p4.generateMipmap(), p4;
- }
- _stretchToPowerOfTwo(t12, e20, r11, i15) {
- const s10 = new E4(t12, r11), a10 = new x2(t12, { colorTarget: Y.TEXTURE, depthStencilTarget: V2.NONE }, s10), o14 = new E4(t12, { target: M.TEXTURE_2D, pixelFormat: r11.pixelFormat, dataType: G2.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L2.LINEAR, flipped: !!r11.flipped, maxAnisotropy: 8, preMultiplyAlpha: r11.preMultiplyAlpha }, e20), n13 = u5(t12), m7 = t12.getBoundFramebufferObject();
- return this._drawStretchedTexture(t12, i15, a10, n13, o14, s10), this.requiresFrameUpdates ? this._powerOfTwoStretchInfo = { vao: n13, sourceTexture: o14, framebuffer: a10 } : (n13.dispose(true), o14.dispose(), a10.detachColorTexture(), a10.dispose()), t12.bindFramebuffer(m7), s10;
- }
- _drawStretchedTexture(t12, e20, r11, i15, s10, a10) {
- this._passParameters.texture = s10, t12.bindFramebuffer(r11);
- const o14 = t12.getViewport();
- t12.setViewport(0, 0, a10.descriptor.width, a10.descriptor.height), t12.bindTechnique(e20, this._passParameters, null), t12.bindVAO(i15), t12.drawArrays(E3.TRIANGLE_STRIP, 0, n11(i15, "geometry")), t12.bindFramebuffer(null), t12.setViewport(o14.x, o14.y, o14.width, o14.height), this._passParameters.texture = null;
- }
- unload() {
- if (r(this._powerOfTwoStretchInfo)) {
- const { framebuffer: t12, vao: e20, sourceTexture: r11 } = this._powerOfTwoStretchInfo;
- e20.dispose(true), r11.dispose(), t12.dispose(), this._glTexture = null, this._powerOfTwoStretchInfo = null;
- }
- if (r(this._glTexture) && (this._glTexture.dispose(), this._glTexture = null), r(this._loadingController)) {
- const t12 = this._loadingController;
- this._loadingController = null, this._loadingPromise = null, t12.abort();
- }
- this.events.emit("unloaded");
- }
- };
- var G3;
- L4.DDS_ENCODING = "image/vnd-ms.dds", L4.KTX2_ENCODING = "image/ktx2", L4.BASIS_ENCODING = "image/x.basis", function(t12) {
- t12[t12.HAVE_NOTHING = 0] = "HAVE_NOTHING", t12[t12.HAVE_METADATA = 1] = "HAVE_METADATA", t12[t12.HAVE_CURRENT_DATA = 2] = "HAVE_CURRENT_DATA", t12[t12.HAVE_FUTURE_DATA = 3] = "HAVE_FUTURE_DATA", t12[t12.HAVE_ENOUGH_DATA = 4] = "HAVE_ENOUGH_DATA";
- }(G3 || (G3 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/RenderSlot.js
- var E8;
- !function(E10) {
- E10[E10.INTEGRATED_MESH = 0] = "INTEGRATED_MESH", E10[E10.OPAQUE_TERRAIN = 1] = "OPAQUE_TERRAIN", E10[E10.OPAQUE_MATERIAL = 2] = "OPAQUE_MATERIAL", E10[E10.TRANSPARENT_MATERIAL = 3] = "TRANSPARENT_MATERIAL", E10[E10.TRANSPARENT_TERRAIN = 4] = "TRANSPARENT_TERRAIN", E10[E10.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL = 5] = "TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL", E10[E10.OCCLUDED_TERRAIN = 6] = "OCCLUDED_TERRAIN", E10[E10.OCCLUDER_MATERIAL = 7] = "OCCLUDER_MATERIAL", E10[E10.TRANSPARENT_OCCLUDER_MATERIAL = 8] = "TRANSPARENT_OCCLUDER_MATERIAL", E10[E10.OCCLUSION_PIXELS = 9] = "OCCLUSION_PIXELS", E10[E10.POSTPROCESSING_ENVIRONMENT_OPAQUE = 10] = "POSTPROCESSING_ENVIRONMENT_OPAQUE", E10[E10.POSTPROCESSING_ENVIRONMENT_TRANSPARENT = 11] = "POSTPROCESSING_ENVIRONMENT_TRANSPARENT", E10[E10.LASERLINES = 12] = "LASERLINES", E10[E10.LASERLINES_CONTRAST_CONTROL = 13] = "LASERLINES_CONTRAST_CONTROL", E10[E10.HUD_MATERIAL = 14] = "HUD_MATERIAL", E10[E10.LABEL_MATERIAL = 15] = "LABEL_MATERIAL", E10[E10.LINE_CALLOUTS = 16] = "LINE_CALLOUTS", E10[E10.LINE_CALLOUTS_HUD_DEPTH = 17] = "LINE_CALLOUTS_HUD_DEPTH", E10[E10.DRAPED_MATERIAL = 18] = "DRAPED_MATERIAL", E10[E10.DRAPED_WATER = 19] = "DRAPED_WATER", E10[E10.VOXEL = 20] = "VOXEL", E10[E10.MAX_SLOTS = 21] = "MAX_SLOTS";
- }(E8 || (E8 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/verticalOffsetUtils.js
- var v3 = class {
- constructor(t12 = 0) {
- this.offset = t12, this.tmpVertex = n2();
- }
- applyToVertex(t12, s10, e20) {
- const i15 = t12 + this.localOrigin[0], r11 = s10 + this.localOrigin[1], a10 = e20 + this.localOrigin[2], o14 = this.offset / Math.sqrt(i15 * i15 + r11 * r11 + a10 * a10);
- return this.tmpVertex[0] = t12 + i15 * o14, this.tmpVertex[1] = s10 + r11 * o14, this.tmpVertex[2] = e20 + a10 * o14, this.tmpVertex;
- }
- applyToAabb(t12) {
- for (let r11 = 0; r11 < 3; ++r11)
- O6[r11] = t12[0 + r11] + this.localOrigin[r11], z2[r11] = t12[3 + r11] + this.localOrigin[r11], T4[r11] = O6[r11];
- const s10 = this.applyToVertex(O6[0], O6[1], O6[2]);
- for (let r11 = 0; r11 < 3; ++r11)
- t12[r11] = s10[r11], t12[r11 + 3] = s10[r11];
- const e20 = (s11) => {
- const e21 = this.applyToVertex(s11[0], s11[1], s11[2]);
- for (let i16 = 0; i16 < 3; ++i16)
- t12[i16 + 0] = Math.min(t12[i16 + 0], e21[i16]), t12[i16 + 3] = Math.max(t12[i16 + 3], e21[i16]);
- };
- for (let r11 = 1; r11 < 8; ++r11) {
- for (let t13 = 0; t13 < 3; ++t13)
- T4[t13] = 0 == (r11 & 1 << t13) ? O6[t13] : z2[t13];
- e20(T4);
- }
- let i15 = 0;
- for (let r11 = 0; r11 < 3; ++r11) {
- O6[r11] * z2[r11] < 0 && (i15 |= 1 << r11);
- }
- if (0 !== i15 && 7 !== i15) {
- for (let r11 = 0; r11 < 8; ++r11)
- if (0 == (i15 & r11)) {
- for (let t13 = 0; t13 < 3; ++t13)
- i15[t13] ? T4[t13] = 0 : T4[t13] = 0 != (r11 & 1 << t13) ? O6[t13] : z2[t13];
- e20(T4);
- }
- }
- for (let r11 = 0; r11 < 3; ++r11)
- t12[r11 + 0] -= this.localOrigin[r11], t12[r11 + 3] -= this.localOrigin[r11];
- return t12;
- }
- };
- var O6 = n2();
- var z2 = n2();
- var T4 = n2();
- var g6 = class {
- constructor(t12 = 0) {
- this.componentLocalOriginLength = 0, this._tmpVertex = n2(), this._mbs = R(), this._obb = { center: n2(), halfSize: n8(), quaternion: null }, this._totalOffset = 0, this._offset = 0, this._resetOffset(t12);
- }
- _resetOffset(t12) {
- this._offset = t12, this._totalOffset = t12;
- }
- set offset(t12) {
- this._resetOffset(t12);
- }
- get offset() {
- return this._offset;
- }
- set componentOffset(t12) {
- this._totalOffset = this._offset + t12;
- }
- set localOrigin(t12) {
- this.componentLocalOriginLength = Math.sqrt(t12[0] * t12[0] + t12[1] * t12[1] + t12[2] * t12[2]);
- }
- applyToVertex(t12, s10, e20) {
- const i15 = t12, r11 = s10, a10 = e20 + this.componentLocalOriginLength, o14 = this._totalOffset / Math.sqrt(i15 * i15 + r11 * r11 + a10 * a10);
- return this._tmpVertex[0] = t12 + i15 * o14, this._tmpVertex[1] = s10 + r11 * o14, this._tmpVertex[2] = e20 + a10 * o14, this._tmpVertex;
- }
- applyToAabb(t12) {
- const s10 = t12[0], e20 = t12[1], i15 = t12[2] + this.componentLocalOriginLength, r11 = t12[3], a10 = t12[4], o14 = t12[5] + this.componentLocalOriginLength, h9 = s10 * r11 < 0 ? 0 : Math.min(Math.abs(s10), Math.abs(r11)), n13 = e20 * a10 < 0 ? 0 : Math.min(Math.abs(e20), Math.abs(a10)), f9 = i15 * o14 < 0 ? 0 : Math.min(Math.abs(i15), Math.abs(o14)), l9 = Math.sqrt(h9 * h9 + n13 * n13 + f9 * f9);
- if (l9 < this._totalOffset)
- return t12[0] -= s10 < 0 ? this._totalOffset : 0, t12[1] -= e20 < 0 ? this._totalOffset : 0, t12[2] -= i15 < 0 ? this._totalOffset : 0, t12[3] += r11 > 0 ? this._totalOffset : 0, t12[4] += a10 > 0 ? this._totalOffset : 0, t12[5] += o14 > 0 ? this._totalOffset : 0, t12;
- const m7 = Math.max(Math.abs(s10), Math.abs(r11)), _8 = Math.max(Math.abs(e20), Math.abs(a10)), b5 = Math.max(Math.abs(i15), Math.abs(o14)), c16 = Math.sqrt(m7 * m7 + _8 * _8 + b5 * b5), p4 = this._totalOffset / c16, u11 = this._totalOffset / l9;
- return t12[0] += s10 * (s10 > 0 ? p4 : u11), t12[1] += e20 * (e20 > 0 ? p4 : u11), t12[2] += i15 * (i15 > 0 ? p4 : u11), t12[3] += r11 * (r11 < 0 ? p4 : u11), t12[4] += a10 * (a10 < 0 ? p4 : u11), t12[5] += o14 * (o14 < 0 ? p4 : u11), t12;
- }
- applyToMbs(t12) {
- const s10 = Math.sqrt(t12[0] * t12[0] + t12[1] * t12[1] + t12[2] * t12[2]), e20 = this._totalOffset / s10;
- return this._mbs[0] = t12[0] + t12[0] * e20, this._mbs[1] = t12[1] + t12[1] * e20, this._mbs[2] = t12[2] + t12[2] * e20, this._mbs[3] = t12[3] + t12[3] * this._totalOffset / s10, this._mbs;
- }
- applyToObb(t12) {
- const s10 = t12.center, e20 = this._totalOffset / Math.sqrt(s10[0] * s10[0] + s10[1] * s10[1] + s10[2] * s10[2]);
- this._obb.center[0] = s10[0] + s10[0] * e20, this._obb.center[1] = s10[1] + s10[1] * e20, this._obb.center[2] = s10[2] + s10[2] * e20, E(this._obb.halfSize, t12.halfSize, t12.quaternion), u(this._obb.halfSize, this._obb.halfSize, t12.center);
- const i15 = this._totalOffset / Math.sqrt(this._obb.halfSize[0] * this._obb.halfSize[0] + this._obb.halfSize[1] * this._obb.halfSize[1] + this._obb.halfSize[2] * this._obb.halfSize[2]);
- return this._obb.halfSize[0] += this._obb.halfSize[0] * i15, this._obb.halfSize[1] += this._obb.halfSize[1] * i15, this._obb.halfSize[2] += this._obb.halfSize[2] * i15, e5(this._obb.halfSize, this._obb.halfSize, t12.center), S2(I2, t12.quaternion), E(this._obb.halfSize, this._obb.halfSize, I2), this._obb.halfSize[0] *= this._obb.halfSize[0] < 0 ? -1 : 1, this._obb.halfSize[1] *= this._obb.halfSize[1] < 0 ? -1 : 1, this._obb.halfSize[2] *= this._obb.halfSize[2] < 0 ? -1 : 1, this._obb.quaternion = t12.quaternion, this._obb;
- }
- };
- var x5 = class {
- constructor(t12 = 0) {
- this.offset = t12, this.sphere = R(), this.tmpVertex = n2();
- }
- applyToVertex(t12, s10, e20) {
- const i15 = this.objectTransform.transform;
- let r11 = i15[0] * t12 + i15[4] * s10 + i15[8] * e20 + i15[12], a10 = i15[1] * t12 + i15[5] * s10 + i15[9] * e20 + i15[13], o14 = i15[2] * t12 + i15[6] * s10 + i15[10] * e20 + i15[14];
- const h9 = this.offset / Math.sqrt(r11 * r11 + a10 * a10 + o14 * o14);
- r11 += r11 * h9, a10 += a10 * h9, o14 += o14 * h9;
- const n13 = this.objectTransform.inverse;
- return this.tmpVertex[0] = n13[0] * r11 + n13[4] * a10 + n13[8] * o14 + n13[12], this.tmpVertex[1] = n13[1] * r11 + n13[5] * a10 + n13[9] * o14 + n13[13], this.tmpVertex[2] = n13[2] * r11 + n13[6] * a10 + n13[10] * o14 + n13[14], this.tmpVertex;
- }
- applyToMinMax(t12, s10) {
- const e20 = this.offset / Math.sqrt(t12[0] * t12[0] + t12[1] * t12[1] + t12[2] * t12[2]);
- t12[0] += t12[0] * e20, t12[1] += t12[1] * e20, t12[2] += t12[2] * e20;
- const i15 = this.offset / Math.sqrt(s10[0] * s10[0] + s10[1] * s10[1] + s10[2] * s10[2]);
- s10[0] += s10[0] * i15, s10[1] += s10[1] * i15, s10[2] += s10[2] * i15;
- }
- applyToAabb(t12) {
- const s10 = this.offset / Math.sqrt(t12[0] * t12[0] + t12[1] * t12[1] + t12[2] * t12[2]);
- t12[0] += t12[0] * s10, t12[1] += t12[1] * s10, t12[2] += t12[2] * s10;
- const e20 = this.offset / Math.sqrt(t12[3] * t12[3] + t12[4] * t12[4] + t12[5] * t12[5]);
- return t12[3] += t12[3] * e20, t12[4] += t12[4] * e20, t12[5] += t12[5] * e20, t12;
- }
- applyToBoundingSphere(t12) {
- const s10 = Math.sqrt(t12[0] * t12[0] + t12[1] * t12[1] + t12[2] * t12[2]), e20 = this.offset / s10;
- return this.sphere[0] = t12[0] + t12[0] * e20, this.sphere[1] = t12[1] + t12[1] * e20, this.sphere[2] = t12[2] + t12[2] * e20, this.sphere[3] = t12[3] + t12[3] * this.offset / s10, this.sphere;
- }
- };
- var S5 = new x5();
- function y2(s10) {
- return r(s10) ? (S5.offset = s10, S5) : null;
- }
- var q2 = new g6();
- var d7 = new v3();
- var I2 = e8();
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js
- function c13(e20, t12, f9, o14) {
- const r11 = f9.typedBuffer, n13 = f9.typedBufferStride, s10 = e20.length;
- o14 *= n13;
- for (let i15 = 0; i15 < s10; ++i15) {
- const f10 = 2 * e20[i15];
- r11[o14] = t12[f10], r11[o14 + 1] = t12[f10 + 1], o14 += n13;
- }
- }
- function d8(e20, t12, f9, o14, r11) {
- const n13 = f9.typedBuffer, s10 = f9.typedBufferStride, i15 = e20.length;
- if (o14 *= s10, null == r11 || 1 === r11)
- for (let l9 = 0; l9 < i15; ++l9) {
- const f10 = 3 * e20[l9];
- n13[o14] = t12[f10], n13[o14 + 1] = t12[f10 + 1], n13[o14 + 2] = t12[f10 + 2], o14 += s10;
- }
- else
- for (let l9 = 0; l9 < i15; ++l9) {
- const f10 = 3 * e20[l9];
- for (let e21 = 0; e21 < r11; ++e21)
- n13[o14] = t12[f10], n13[o14 + 1] = t12[f10 + 1], n13[o14 + 2] = t12[f10 + 2], o14 += s10;
- }
- }
- function u10(e20, t12, f9, o14, r11 = 1) {
- const n13 = f9.typedBuffer, s10 = f9.typedBufferStride, i15 = e20.length;
- if (o14 *= s10, 1 === r11)
- for (let l9 = 0; l9 < i15; ++l9) {
- const f10 = 4 * e20[l9];
- n13[o14] = t12[f10], n13[o14 + 1] = t12[f10 + 1], n13[o14 + 2] = t12[f10 + 2], n13[o14 + 3] = t12[f10 + 3], o14 += s10;
- }
- else
- for (let l9 = 0; l9 < i15; ++l9) {
- const f10 = 4 * e20[l9];
- for (let e21 = 0; e21 < r11; ++e21)
- n13[o14] = t12[f10], n13[o14 + 1] = t12[f10 + 1], n13[o14 + 2] = t12[f10 + 2], n13[o14 + 3] = t12[f10 + 3], o14 += s10;
- }
- }
- function y3(e20, t12, f9, o14, r11, n13 = 1) {
- if (!f9)
- return void d8(e20, t12, o14, r11, n13);
- const s10 = o14.typedBuffer, i15 = o14.typedBufferStride, l9 = e20.length, c16 = f9[0], u11 = f9[1], a10 = f9[2], p4 = f9[4], y4 = f9[5], B3 = f9[6], g8 = f9[8], h9 = f9[9], b5 = f9[10], m7 = f9[12], O7 = f9[13], z4 = f9[14];
- r11 *= i15;
- let A7 = 0, L5 = 0, j4 = 0;
- const I4 = S6(f9) ? (e21) => {
- A7 = t12[e21] + m7, L5 = t12[e21 + 1] + O7, j4 = t12[e21 + 2] + z4;
- } : (e21) => {
- const f10 = t12[e21], o15 = t12[e21 + 1], r12 = t12[e21 + 2];
- A7 = c16 * f10 + p4 * o15 + g8 * r12 + m7, L5 = u11 * f10 + y4 * o15 + h9 * r12 + O7, j4 = a10 * f10 + B3 * o15 + b5 * r12 + z4;
- };
- if (1 === n13)
- for (let d9 = 0; d9 < l9; ++d9)
- I4(3 * e20[d9]), s10[r11] = A7, s10[r11 + 1] = L5, s10[r11 + 2] = j4, r11 += i15;
- else
- for (let d9 = 0; d9 < l9; ++d9) {
- I4(3 * e20[d9]);
- for (let e21 = 0; e21 < n13; ++e21)
- s10[r11] = A7, s10[r11 + 1] = L5, s10[r11 + 2] = j4, r11 += i15;
- }
- }
- function B(e20, f9, o14, r11, n13, s10 = 1) {
- if (!o14)
- return void d8(e20, f9, r11, n13, s10);
- const i15 = o14, l9 = r11.typedBuffer, c16 = r11.typedBufferStride, u11 = e20.length, a10 = i15[0], p4 = i15[1], y4 = i15[2], B3 = i15[4], g8 = i15[5], h9 = i15[6], b5 = i15[8], m7 = i15[9], O7 = i15[10], z4 = !G(i15), A7 = 1e-6, L5 = 1 - A7;
- n13 *= c16;
- let j4 = 0, I4 = 0, k4 = 0;
- const C4 = S6(i15) ? (e21) => {
- j4 = f9[e21], I4 = f9[e21 + 1], k4 = f9[e21 + 2];
- } : (e21) => {
- const t12 = f9[e21], o15 = f9[e21 + 1], r12 = f9[e21 + 2];
- j4 = a10 * t12 + B3 * o15 + b5 * r12, I4 = p4 * t12 + g8 * o15 + m7 * r12, k4 = y4 * t12 + h9 * o15 + O7 * r12;
- };
- if (1 === s10)
- if (z4)
- for (let t12 = 0; t12 < u11; ++t12) {
- C4(3 * e20[t12]);
- const f10 = j4 * j4 + I4 * I4 + k4 * k4;
- if (f10 < L5 && f10 > A7) {
- const e21 = 1 / Math.sqrt(f10);
- l9[n13] = j4 * e21, l9[n13 + 1] = I4 * e21, l9[n13 + 2] = k4 * e21;
- } else
- l9[n13] = j4, l9[n13 + 1] = I4, l9[n13 + 2] = k4;
- n13 += c16;
- }
- else
- for (let t12 = 0; t12 < u11; ++t12)
- C4(3 * e20[t12]), l9[n13] = j4, l9[n13 + 1] = I4, l9[n13 + 2] = k4, n13 += c16;
- else
- for (let t12 = 0; t12 < u11; ++t12) {
- if (C4(3 * e20[t12]), z4) {
- const e21 = j4 * j4 + I4 * I4 + k4 * k4;
- if (e21 < L5 && e21 > A7) {
- const t13 = 1 / Math.sqrt(e21);
- j4 *= t13, I4 *= t13, k4 *= t13;
- }
- }
- for (let e21 = 0; e21 < s10; ++e21)
- l9[n13] = j4, l9[n13 + 1] = I4, l9[n13 + 2] = k4, n13 += c16;
- }
- }
- function g7(e20, f9, o14, r11, n13, s10 = 1) {
- if (!o14)
- return void u10(e20, f9, r11, n13, s10);
- const i15 = o14, l9 = r11.typedBuffer, c16 = r11.typedBufferStride, d9 = e20.length, a10 = i15[0], p4 = i15[1], y4 = i15[2], B3 = i15[4], g8 = i15[5], h9 = i15[6], b5 = i15[8], m7 = i15[9], S7 = i15[10], O7 = !G(i15), z4 = 1e-6, A7 = 1 - z4;
- if (n13 *= c16, 1 === s10)
- for (let t12 = 0; t12 < d9; ++t12) {
- const o15 = 4 * e20[t12], r12 = f9[o15], s11 = f9[o15 + 1], i16 = f9[o15 + 2], d10 = f9[o15 + 3];
- let u11 = a10 * r12 + B3 * s11 + b5 * i16, L5 = p4 * r12 + g8 * s11 + m7 * i16, j4 = y4 * r12 + h9 * s11 + S7 * i16;
- if (O7) {
- const e21 = u11 * u11 + L5 * L5 + j4 * j4;
- if (e21 < A7 && e21 > z4) {
- const t13 = 1 / Math.sqrt(e21);
- u11 *= t13, L5 *= t13, j4 *= t13;
- }
- }
- l9[n13] = u11, l9[n13 + 1] = L5, l9[n13 + 2] = j4, l9[n13 + 3] = d10, n13 += c16;
- }
- else
- for (let t12 = 0; t12 < d9; ++t12) {
- const o15 = 4 * e20[t12], r12 = f9[o15], i16 = f9[o15 + 1], d10 = f9[o15 + 2], u11 = f9[o15 + 3];
- let L5 = a10 * r12 + B3 * i16 + b5 * d10, j4 = p4 * r12 + g8 * i16 + m7 * d10, I4 = y4 * r12 + h9 * i16 + S7 * d10;
- if (O7) {
- const e21 = L5 * L5 + j4 * j4 + I4 * I4;
- if (e21 < A7 && e21 > z4) {
- const t13 = 1 / Math.sqrt(e21);
- L5 *= t13, j4 *= t13, I4 *= t13;
- }
- }
- for (let e21 = 0; e21 < s10; ++e21)
- l9[n13] = L5, l9[n13 + 1] = j4, l9[n13 + 2] = I4, l9[n13 + 3] = u11, n13 += c16;
- }
- }
- function h8(e20, t12, f9, o14, r11, n13 = 1) {
- const s10 = o14.typedBuffer, i15 = o14.typedBufferStride, l9 = e20.length;
- if (r11 *= i15, f9 !== t12.length || 4 !== f9)
- if (1 !== n13)
- if (4 !== f9)
- for (let c16 = 0; c16 < l9; ++c16) {
- const f10 = 3 * e20[c16];
- for (let e21 = 0; e21 < n13; ++e21)
- s10[r11] = t12[f10], s10[r11 + 1] = t12[f10 + 1], s10[r11 + 2] = t12[f10 + 2], s10[r11 + 3] = 255, r11 += i15;
- }
- else
- for (let c16 = 0; c16 < l9; ++c16) {
- const f10 = 4 * e20[c16];
- for (let e21 = 0; e21 < n13; ++e21)
- s10[r11] = t12[f10], s10[r11 + 1] = t12[f10 + 1], s10[r11 + 2] = t12[f10 + 2], s10[r11 + 3] = t12[f10 + 3], r11 += i15;
- }
- else {
- if (4 === f9) {
- for (let f10 = 0; f10 < l9; ++f10) {
- const o15 = 4 * e20[f10];
- s10[r11] = t12[o15], s10[r11 + 1] = t12[o15 + 1], s10[r11 + 2] = t12[o15 + 2], s10[r11 + 3] = t12[o15 + 3], r11 += i15;
- }
- return;
- }
- for (let f10 = 0; f10 < l9; ++f10) {
- const o15 = 3 * e20[f10];
- s10[r11] = t12[o15], s10[r11 + 1] = t12[o15 + 1], s10[r11 + 2] = t12[o15 + 2], s10[r11 + 3] = 255, r11 += i15;
- }
- }
- else {
- s10[r11] = t12[0], s10[r11 + 1] = t12[1], s10[r11 + 2] = t12[2], s10[r11 + 3] = t12[3];
- const e21 = new Uint32Array(o14.typedBuffer.buffer, o14.start), f10 = i15 / 4, c16 = e21[r11 /= 4];
- r11 += f10;
- const d9 = l9 * n13;
- for (let t13 = 1; t13 < d9; ++t13)
- e21[r11] = c16, r11 += f10;
- }
- }
- function b3(e20, t12, f9, o14, r11 = 1) {
- const n13 = t12.typedBuffer, s10 = t12.typedBufferStride;
- if (o14 *= s10, 1 === r11)
- for (let i15 = 0; i15 < f9; ++i15)
- n13[o14] = e20[0], n13[o14 + 1] = e20[1], n13[o14 + 2] = e20[2], n13[o14 + 3] = e20[3], o14 += s10;
- else
- for (let i15 = 0; i15 < f9; ++i15)
- for (let t13 = 0; t13 < r11; ++t13)
- n13[o14] = e20[0], n13[o14 + 1] = e20[1], n13[o14 + 2] = e20[2], n13[o14 + 3] = e20[3], o14 += s10;
- }
- function m5(t12, l9, d9, u11, a10, p4) {
- for (const m7 of l9.fieldNames) {
- const l10 = t12.vertexAttributes.get(m7), S7 = t12.indices.get(m7);
- if (l10 && S7)
- switch (m7) {
- case O4.POSITION: {
- e12(3 === l10.size);
- const e20 = a10.getField(m7, i3);
- e20 && y3(S7, l10.data, d9, e20, p4);
- break;
- }
- case O4.NORMAL: {
- e12(3 === l10.size);
- const e20 = a10.getField(m7, i3);
- e20 && B(S7, l10.data, u11, e20, p4);
- break;
- }
- case O4.UV0: {
- e12(2 === l10.size);
- const e20 = a10.getField(m7, u2);
- e20 && c13(S7, l10.data, e20, p4);
- break;
- }
- case O4.COLOR: {
- e12(3 === l10.size || 4 === l10.size);
- const e20 = a10.getField(m7, x);
- e20 && h8(S7, l10.data, l10.size, e20, p4);
- break;
- }
- case O4.SYMBOLCOLOR: {
- e12(3 === l10.size || 4 === l10.size);
- const e20 = a10.getField(m7, x);
- e20 && h8(S7, l10.data, l10.size, e20, p4);
- break;
- }
- case O4.TANGENT: {
- e12(4 === l10.size);
- const e20 = a10.getField(m7, c4);
- e20 && g7(S7, l10.data, u11, e20, p4);
- break;
- }
- }
- else if (m7 === O4.OBJECTANDLAYERIDCOLOR && r(t12.objectAndLayerIdColor) && 4 === t12.objectAndLayerIdColor.length) {
- const e20 = t12.indices.get(O4.POSITION);
- if (e20) {
- const f9 = e20.length, r11 = a10.getField(m7, x);
- b3(t12.objectAndLayerIdColor, r11, f9, p4);
- }
- }
- }
- }
- function S6(e20) {
- return 1 === e20[0] && 0 === e20[1] && 0 === e20[2] && 0 === e20[4] && 1 === e20[5] && 0 === e20[6] && 0 === e20[8] && 0 === e20[9] && 1 === e20[10];
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/StencilUtils.js
- var i14 = { func: I.LESS };
- var s8 = { func: I.ALWAYS };
- var e19 = { mask: 255 };
- var f8 = { function: { func: I.ALWAYS, ref: t7.OutlineVisualElementMask, mask: t7.OutlineVisualElementMask }, operation: { fail: O3.KEEP, zFail: O3.KEEP, zPass: O3.ZERO } };
- var o13 = { function: { func: I.ALWAYS, ref: t7.OutlineVisualElementMask, mask: t7.OutlineVisualElementMask }, operation: { fail: O3.KEEP, zFail: O3.KEEP, zPass: O3.REPLACE } };
- var P3 = { function: { func: I.EQUAL, ref: t7.OutlineVisualElementMask, mask: t7.OutlineVisualElementMask }, operation: { fail: O3.KEEP, zFail: O3.KEEP, zPass: O3.KEEP } };
- var m6 = { function: { func: I.NOTEQUAL, ref: t7.OutlineVisualElementMask, mask: t7.OutlineVisualElementMask }, operation: { fail: O3.KEEP, zFail: O3.KEEP, zPass: O3.KEEP } };
- // node_modules/@arcgis/core/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js
- var k = class extends f6 {
- constructor() {
- super(...arguments), this.isSchematic = false, this.usePBR = false, this.mrrFactors = r2(0, 1, 0.5), this.hasVertexColors = false, this.hasSymbolColors = false, this.doubleSided = false, this.doubleSidedType = "normal", this.cullFace = n9.Back, this.emissiveFactor = r2(0, 0, 0), this.instancedDoublePrecision = false, this.normals = "default", this.receiveSSAO = true, this.receiveShadows = true, this.castShadows = true, this.shadowMappingEnabled = false, this.ambient = r2(0.2, 0.2, 0.2), this.diffuse = r2(0.8, 0.8, 0.8), this.externalColor = r4(1, 1, 1, 1), this.colorMixMode = "multiply", this.opacity = 1, this.layerOpacity = 1, this.origin = n2(), this.hasSlicePlane = false, this.hasSliceHighlight = true, this.offsetTransparentBackfaces = false, this.vvSizeEnabled = false, this.vvSizeMinSize = [1, 1, 1], this.vvSizeMaxSize = [100, 100, 100], this.vvSizeOffset = [0, 0, 0], this.vvSizeFactor = [1, 1, 1], this.vvSizeValue = [1, 1, 1], this.vvColorEnabled = false, this.vvColorValues = [0, 0, 0, 0, 0, 0, 0, 0], this.vvColorColors = [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0], this.vvSymbolAnchor = [0, 0, 0], this.vvSymbolRotationMatrix = e6(), this.vvOpacityEnabled = false, this.vvOpacityValues = [], this.vvOpacityOpacities = [], this.transparent = false, this.writeDepth = true, this.customDepthTest = e14.Less, this.textureAlphaMode = C.Blend, this.textureAlphaCutoff = o10, this.textureAlphaPremultiplied = false, this.hasOccludees = false, this.renderOccluded = o8.Occlude;
- }
- };
- var _7 = class extends e17 {
- initializeConfiguration(e20, t12) {
- t12.hasWebGL2Context = e20.rctx.type === r6.WEBGL2, t12.spherical = e20.viewingMode === l2.Global, t12.doublePrecisionRequiresObfuscation = i9(e20.rctx), t12.textureCoordinateType = t12.hasColorTexture || t12.hasMetallicRoughnessTexture || t12.hasEmissionTexture || t12.hasOcclusionTexture || t12.hasNormalTexture ? d.Default : d.None, t12.objectAndLayerIdColorInstanced = t12.instanced;
- }
- initializeProgram(e20) {
- return this._initializeProgram(e20, _7.shader);
- }
- _initializeProgram(e20, t12) {
- return new o11(e20.rctx, t12.get().build(this.configuration), E5);
- }
- _convertDepthTestFunction(e20) {
- return e20 === e14.Lequal ? I.LEQUAL : I.LESS;
- }
- _makePipeline(e20, t12) {
- const i15 = this.configuration, s10 = e20 === o9.NONE, r11 = e20 === o9.FrontFace;
- return W({ blending: i15.output !== h3.Color && i15.output !== h3.Alpha || !i15.transparent ? null : s10 ? c7 : A3(e20), culling: V4(i15) && h5(i15.cullFace), depthTest: { func: l3(e20, this._convertDepthTestFunction(i15.customDepthTest)) }, depthWrite: s10 || r11 ? i15.writeDepth && a6 : null, colorWrite: _3, stencilWrite: i15.hasOccludees ? e19 : null, stencilTest: i15.hasOccludees ? t12 ? o13 : f8 : null, polygonOffset: s10 || r11 ? null : a7(i15.enableOffset) });
- }
- initializePipeline() {
- return this._occludeePipelineState = this._makePipeline(this.configuration.transparencyPassType, true), this._makePipeline(this.configuration.transparencyPassType, false);
- }
- getPipelineState(e20, t12) {
- return t12 ? this._occludeePipelineState : super.getPipelineState(e20, t12);
- }
- };
- function V4(e20) {
- return e20.cullFace !== n9.None || !e20.hasSlicePlane && (!e20.transparent && !e20.doubleSidedMode);
- }
- _7.shader = new t9(X2, () => import("./DefaultMaterial.glsl-ZGDAOX5L.js"));
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js
- var s9 = class extends t10 {
- constructor() {
- super(...arguments), this.hasWebGL2Context = false;
- }
- };
- e([e18({ constValue: true })], s9.prototype, "hasSliceHighlight", void 0), e([e18({ constValue: false })], s9.prototype, "hasSliceInVertexProgram", void 0), e([e18({ constValue: false })], s9.prototype, "instancedDoublePrecision", void 0), e([e18({ constValue: false })], s9.prototype, "useLegacyTerrainShading", void 0), e([e18({ constValue: false })], s9.prototype, "hasModelTransformation", void 0), e([e18({ constValue: a5.Pass })], s9.prototype, "pbrTextureBindType", void 0), e([e18()], s9.prototype, "hasWebGL2Context", void 0);
- // node_modules/@arcgis/core/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js
- var c15 = class extends s9 {
- constructor() {
- super(...arguments), this.output = h3.Color, this.alphaDiscardMode = C.Opaque, this.doubleSidedMode = i8.None, this.pbrMode = d2.Disabled, this.cullFace = n9.None, this.transparencyPassType = o9.NONE, this.normalType = i7.Attribute, this.textureCoordinateType = d.None, this.customDepthTest = e14.Less, this.spherical = false, this.hasVertexColors = false, this.hasSymbolColors = false, this.hasVerticalOffset = false, this.hasSlicePlane = false, this.hasSliceHighlight = true, this.hasColorTexture = false, this.hasMetallicRoughnessTexture = false, this.hasEmissionTexture = false, this.hasOcclusionTexture = false, this.hasNormalTexture = false, this.hasScreenSizePerspective = false, this.hasVertexTangents = false, this.hasOccludees = false, this.hasMultipassTerrain = false, this.hasModelTransformation = false, this.offsetBackfaces = false, this.vvSize = false, this.vvColor = false, this.receiveShadows = false, this.receiveAmbientOcclusion = false, this.textureAlphaPremultiplied = false, this.instanced = false, this.instancedColor = false, this.objectAndLayerIdColorInstanced = false, this.instancedDoublePrecision = false, this.doublePrecisionRequiresObfuscation = false, this.writeDepth = true, this.transparent = false, this.enableOffset = true, this.cullAboveGround = false, this.snowCover = false, this.hasColorTextureTransform = false, this.hasEmissionTextureTransform = false, this.hasNormalTextureTransform = false, this.hasOcclusionTextureTransform = false, this.hasMetallicRoughnessTextureTransform = false;
- }
- };
- e([e18({ count: h3.COUNT })], c15.prototype, "output", void 0), e([e18({ count: C.COUNT })], c15.prototype, "alphaDiscardMode", void 0), e([e18({ count: i8.COUNT })], c15.prototype, "doubleSidedMode", void 0), e([e18({ count: d2.COUNT })], c15.prototype, "pbrMode", void 0), e([e18({ count: n9.COUNT })], c15.prototype, "cullFace", void 0), e([e18({ count: o9.COUNT })], c15.prototype, "transparencyPassType", void 0), e([e18({ count: i7.COUNT })], c15.prototype, "normalType", void 0), e([e18({ count: d.COUNT })], c15.prototype, "textureCoordinateType", void 0), e([e18({ count: e14.COUNT })], c15.prototype, "customDepthTest", void 0), e([e18()], c15.prototype, "spherical", void 0), e([e18()], c15.prototype, "hasVertexColors", void 0), e([e18()], c15.prototype, "hasSymbolColors", void 0), e([e18()], c15.prototype, "hasVerticalOffset", void 0), e([e18()], c15.prototype, "hasSlicePlane", void 0), e([e18()], c15.prototype, "hasSliceHighlight", void 0), e([e18()], c15.prototype, "hasColorTexture", void 0), e([e18()], c15.prototype, "hasMetallicRoughnessTexture", void 0), e([e18()], c15.prototype, "hasEmissionTexture", void 0), e([e18()], c15.prototype, "hasOcclusionTexture", void 0), e([e18()], c15.prototype, "hasNormalTexture", void 0), e([e18()], c15.prototype, "hasScreenSizePerspective", void 0), e([e18()], c15.prototype, "hasVertexTangents", void 0), e([e18()], c15.prototype, "hasOccludees", void 0), e([e18()], c15.prototype, "hasMultipassTerrain", void 0), e([e18()], c15.prototype, "hasModelTransformation", void 0), e([e18()], c15.prototype, "offsetBackfaces", void 0), e([e18()], c15.prototype, "vvSize", void 0), e([e18()], c15.prototype, "vvColor", void 0), e([e18()], c15.prototype, "receiveShadows", void 0), e([e18()], c15.prototype, "receiveAmbientOcclusion", void 0), e([e18()], c15.prototype, "textureAlphaPremultiplied", void 0), e([e18()], c15.prototype, "instanced", void 0), e([e18()], c15.prototype, "instancedColor", void 0), e([e18()], c15.prototype, "objectAndLayerIdColorInstanced", void 0), e([e18()], c15.prototype, "instancedDoublePrecision", void 0), e([e18()], c15.prototype, "doublePrecisionRequiresObfuscation", void 0), e([e18()], c15.prototype, "writeDepth", void 0), e([e18()], c15.prototype, "transparent", void 0), e([e18()], c15.prototype, "enableOffset", void 0), e([e18()], c15.prototype, "cullAboveGround", void 0), e([e18()], c15.prototype, "snowCover", void 0), e([e18()], c15.prototype, "hasColorTextureTransform", void 0), e([e18()], c15.prototype, "hasEmissionTextureTransform", void 0), e([e18()], c15.prototype, "hasNormalTextureTransform", void 0), e([e18()], c15.prototype, "hasOcclusionTextureTransform", void 0), e([e18()], c15.prototype, "hasMetallicRoughnessTextureTransform", void 0), e([e18({ constValue: true })], c15.prototype, "hasVvInstancing", void 0), e([e18({ constValue: false })], c15.prototype, "useCustomDTRExponentForWater", void 0), e([e18({ constValue: false })], c15.prototype, "supportsTextureAtlas", void 0), e([e18({ constValue: true })], c15.prototype, "useFillLights", void 0);
- // node_modules/@arcgis/core/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js
- var t11 = class extends _7 {
- initializeConfiguration(i15, a10) {
- super.initializeConfiguration(i15, a10), a10.hasMetallicRoughnessTexture = false, a10.hasEmissionTexture = false, a10.hasOcclusionTexture = false, a10.hasNormalTexture = false, a10.hasModelTransformation = false, a10.normalType = i7.Attribute, a10.doubleSidedMode = i8.WindingOrder, a10.hasVertexTangents = false;
- }
- initializeProgram(e20) {
- return this._initializeProgram(e20, t11.shader);
- }
- };
- t11.shader = new t9(R2, () => import("./RealisticTree.glsl-FSHQ4APF.js"));
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultMaterial.js
- var C3 = class extends d3 {
- constructor(e20) {
- super(e20, P4), this.supportsEdges = true, this._configuration = new c15(), this._vertexBufferLayout = j2(this.parameters), this._instanceBufferLayout = e20.instanced ? B2(this.parameters) : null;
- }
- isVisibleForOutput(e20) {
- return e20 !== h3.Shadow && e20 !== h3.ShadowExludeHighlight && e20 !== h3.ShadowHighlight || this.parameters.castShadows;
- }
- isVisible() {
- const t12 = this.parameters;
- if (!super.isVisible() || 0 === t12.layerOpacity)
- return false;
- const { instanced: r11, hasVertexColors: a10, hasSymbolColors: s10, vvColorEnabled: i15 } = t12, o14 = r(r11) && r11.includes("color"), n13 = "replace" === t12.colorMixMode, h9 = t12.opacity > 0, c16 = t12.externalColor && t12.externalColor[3] > 0;
- return a10 && (o14 || i15 || s10) ? !!n13 || h9 : a10 ? n13 ? c16 : h9 : o14 || i15 || s10 ? !!n13 || h9 : n13 ? c16 : h9;
- }
- getConfiguration(t12, r11) {
- return this._configuration.output = t12, this._configuration.hasNormalTexture = !!this.parameters.normalTextureId, this._configuration.hasColorTexture = !!this.parameters.textureId, this._configuration.hasVertexTangents = this.parameters.hasVertexTangents, this._configuration.instanced = !!this.parameters.instanced, this._configuration.instancedDoublePrecision = this.parameters.instancedDoublePrecision, this._configuration.vvSize = this.parameters.vvSizeEnabled, this._configuration.hasVerticalOffset = r(this.parameters.verticalOffset), this._configuration.hasScreenSizePerspective = r(this.parameters.screenSizePerspective), this._configuration.hasSlicePlane = this.parameters.hasSlicePlane, this._configuration.hasSliceHighlight = this.parameters.hasSliceHighlight, this._configuration.alphaDiscardMode = this.parameters.textureAlphaMode, this._configuration.normalType = "screenDerivative" === this.parameters.normals ? i7.ScreenDerivative : i7.Attribute, this._configuration.transparent = this.parameters.transparent, this._configuration.writeDepth = this.parameters.writeDepth, r(this.parameters.customDepthTest) && (this._configuration.customDepthTest = this.parameters.customDepthTest), this._configuration.hasOccludees = this.parameters.hasOccludees, this._configuration.cullFace = this.parameters.hasSlicePlane ? n9.None : this.parameters.cullFace, this._configuration.hasMultipassTerrain = r11.multipassTerrain.enabled, this._configuration.cullAboveGround = r11.multipassTerrain.cullAboveGround, this._configuration.hasModelTransformation = r(this.parameters.modelTransformation), t12 !== h3.Color && t12 !== h3.Alpha || (this._configuration.hasVertexColors = this.parameters.hasVertexColors, this._configuration.hasSymbolColors = this.parameters.hasSymbolColors, this.parameters.treeRendering ? this._configuration.doubleSidedMode = i8.WindingOrder : this._configuration.doubleSidedMode = this.parameters.doubleSided && "normal" === this.parameters.doubleSidedType ? i8.View : this.parameters.doubleSided && "winding-order" === this.parameters.doubleSidedType ? i8.WindingOrder : i8.None, this._configuration.instancedColor = r(this.parameters.instanced) && this.parameters.instanced.includes("color"), this._configuration.receiveShadows = this.parameters.receiveShadows && this.parameters.shadowMappingEnabled, this._configuration.receiveAmbientOcclusion = !!r11.ssaoHelper.ready && this.parameters.receiveSSAO, this._configuration.vvColor = this.parameters.vvColorEnabled, this._configuration.textureAlphaPremultiplied = !!this.parameters.textureAlphaPremultiplied, this._configuration.pbrMode = this.parameters.usePBR ? this.parameters.isSchematic ? d2.Schematic : d2.Normal : d2.Disabled, this._configuration.hasMetallicRoughnessTexture = !!this.parameters.metallicRoughnessTextureId, this._configuration.hasEmissionTexture = !!this.parameters.emissiveTextureId, this._configuration.hasOcclusionTexture = !!this.parameters.occlusionTextureId, this._configuration.offsetBackfaces = !(!this.parameters.transparent || !this.parameters.offsetTransparentBackfaces), this._configuration.transparencyPassType = r11.transparencyPassType, this._configuration.enableOffset = r11.camera.relativeElevation < S3, this._configuration.snowCover = this.hasSnowCover(r11), this._configuration.hasColorTextureTransform = !!this.parameters.colorTextureTransformMatrix, this._configuration.hasNormalTextureTransform = !!this.parameters.normalTextureTransformMatrix, this._configuration.hasEmissionTextureTransform = !!this.parameters.emissiveTextureTransformMatrix, this._configuration.hasOcclusionTextureTransform = !!this.parameters.occlusionTextureTransformMatrix, this._configuration.hasMetallicRoughnessTextureTransform = !!this.parameters.metallicRoughnessTextureTransformMatrix), this._configuration;
- }
- hasSnowCover(t12) {
- return r(t12.weather) && t12.weatherVisible && "snowy" === t12.weather.type && "enabled" === t12.weather.snowCover;
- }
- intersect(c16, u11, m7, p4, d9, f9, g8) {
- if (r(this.parameters.verticalOffset)) {
- const e20 = p4.camera;
- o2(k2, m7[12], m7[13], m7[14]);
- let c17 = null;
- switch (p4.viewingMode) {
- case l2.Global:
- c17 = z(U3, k2);
- break;
- case l2.Local:
- c17 = r3(U3, G4);
- }
- let u12 = 0;
- const g9 = e5(q3, k2, e20.eye), T6 = s3(g9), _8 = g(g9, g9, 1 / T6);
- let b5 = null;
- this.parameters.screenSizePerspective && (b5 = P(c17, _8)), u12 += L3(e20, T6, this.parameters.verticalOffset, b5, this.parameters.screenSizePerspective), g(c17, c17, u12), S(z3, c17, p4.transform.inverseRotation), d9 = e5(V5, d9, z3), f9 = e5(H, f9, z3);
- }
- x3(c16, u11, p4, d9, f9, y2(p4.verticalOffset), g8);
- }
- requiresSlot(e20, t12) {
- if (t12 === h3.Color || t12 === h3.Alpha || t12 === h3.Depth || t12 === h3.Normal || t12 === h3.Shadow || t12 === h3.ShadowHighlight || t12 === h3.ShadowExludeHighlight || t12 === h3.Highlight || t12 === h3.ObjectAndLayerIdColor) {
- return e20 === (this.parameters.transparent ? this.parameters.writeDepth ? E8.TRANSPARENT_MATERIAL : E8.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL : E8.OPAQUE_MATERIAL) || e20 === E8.DRAPED_MATERIAL || t12 === h3.ObjectAndLayerIdColor;
- }
- return false;
- }
- createGLMaterial(e20) {
- return new R3(e20);
- }
- createBufferWriter() {
- return new N(this._vertexBufferLayout, this._instanceBufferLayout);
- }
- };
- var R3 = class extends h4 {
- constructor(e20) {
- super({ ...e20, ...e20.material.parameters });
- }
- _updateParameters(e20) {
- const r11 = this._material.parameters;
- this.updateTexture(r11.textureId);
- const a10 = e20.camera.viewInverseTransposeMatrix;
- return o2(r11.origin, a10[3], a10[7], a10[11]), this._material.setParameters(this.textureBindParameters), this.ensureTechnique(r11.treeRendering ? t11 : _7, e20);
- }
- _updateShadowState(e20) {
- e20.shadowMap.enabled !== this._material.parameters.shadowMappingEnabled && this._material.setParameters({ shadowMappingEnabled: e20.shadowMap.enabled });
- }
- _updateOccludeeState(e20) {
- e20.hasOccludees !== this._material.parameters.hasOccludees && this._material.setParameters({ hasOccludees: e20.hasOccludees });
- }
- beginSlot(e20) {
- return this._output !== h3.Color && this._output !== h3.Alpha || (this._updateShadowState(e20), this._updateOccludeeState(e20)), this._updateParameters(e20);
- }
- };
- var D3 = class extends k {
- constructor() {
- super(...arguments), this.initTextureTransparent = false, this.treeRendering = false, this.hasVertexTangents = false;
- }
- };
- var P4 = new D3();
- var N = class {
- constructor(e20, t12) {
- this.vertexBufferLayout = e20, this.instanceBufferLayout = t12;
- }
- allocate(e20) {
- return this.vertexBufferLayout.createBuffer(e20);
- }
- elementCount(e20) {
- return e20.indices.get(O4.POSITION).length;
- }
- write(e20, t12, r11, a10, s10) {
- m5(r11, this.vertexBufferLayout, e20, t12, a10, s10);
- }
- };
- function j2(e20) {
- const t12 = e20.textureId || e20.normalTextureId || e20.metallicRoughnessTextureId || e20.emissiveTextureId || e20.occlusionTextureId, r11 = T().vec3f(O4.POSITION).vec3f(O4.NORMAL);
- return e20.hasVertexTangents && r11.vec4f(O4.TANGENT), t12 && r11.vec2f(O4.UV0), e20.hasVertexColors && r11.vec4u8(O4.COLOR), e20.hasSymbolColors && r11.vec4u8(O4.SYMBOLCOLOR), has("enable-feature:objectAndLayerId-rendering") && r11.vec4u8(O4.OBJECTANDLAYERIDCOLOR), r11;
- }
- function B2(t12) {
- let r11 = T();
- return r11 = t12.instancedDoublePrecision ? r11.vec3f(O4.MODELORIGINHI).vec3f(O4.MODELORIGINLO).mat3f(O4.MODEL).mat3f(O4.MODELNORMAL) : r11.mat4f(O4.MODEL).mat4f(O4.MODELNORMAL), r(t12.instanced) && t12.instanced.includes("color") && (r11 = r11.vec4f(O4.INSTANCECOLOR)), r(t12.instanced) && t12.instanced.includes("featureAttribute") && (r11 = r11.vec4f(O4.INSTANCEFEATUREATTRIBUTE)), r(t12.instanced) && t12.instanced.includes("objectAndLayerIdColor") && (r11 = r11.vec4u8(O4.OBJECTANDLAYERIDCOLOR_INSTANCED)), r11;
- }
- var V5 = n2();
- var H = n2();
- var G4 = r2(0, 0, 1);
- var U3 = n2();
- var z3 = n2();
- var k2 = n2();
- var q3 = n2();
- // node_modules/@arcgis/core/views/3d/layers/graphics/wosrLoader.js
- var w4 = s.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");
- async function b4(e20, t12) {
- const n13 = await v4(e20, t12), s10 = await E9(n13.textureDefinitions, t12);
- let a10 = 0;
- for (const r11 in s10)
- if (s10.hasOwnProperty(r11)) {
- const e21 = s10[r11];
- a10 += (e21 == null ? void 0 : e21.image) ? e21.image.width * e21.image.height * 4 : 0;
- }
- return { resource: n13, textures: s10, size: a10 + e10(n13) };
- }
- async function v4(r11, n13) {
- const s10 = r(n13) && n13.streamDataRequester;
- if (s10)
- return j3(r11, s10, n13);
- const u11 = await b(U(r11, e2(n13)));
- if (true === u11.ok)
- return u11.value.data;
- w(u11.error), A6(u11.error);
- }
- async function j3(e20, r11, n13) {
- const s10 = await b(r11.request(e20, "json", n13));
- if (true === s10.ok)
- return s10.value;
- w(s10.error), A6(s10.error.details.url);
- }
- function A6(e20) {
- throw new s2("", `Request for object resource failed: ${e20}`);
- }
- function M5(e20) {
- const t12 = e20.params, r11 = t12.topology;
- let n13 = true;
- switch (t12.vertexAttributes || (w4.warn("Geometry must specify vertex attributes"), n13 = false), t12.topology) {
- case "PerAttributeArray":
- break;
- case "Indexed":
- case null:
- case void 0: {
- const e21 = t12.faces;
- if (e21) {
- if (t12.vertexAttributes)
- for (const r12 in t12.vertexAttributes) {
- const t13 = e21[r12];
- t13 && t13.values ? (null != t13.valueType && "UInt32" !== t13.valueType && (w4.warn(`Unsupported indexed geometry indices type '${t13.valueType}', only UInt32 is currently supported`), n13 = false), null != t13.valuesPerElement && 1 !== t13.valuesPerElement && (w4.warn(`Unsupported indexed geometry values per element '${t13.valuesPerElement}', only 1 is currently supported`), n13 = false)) : (w4.warn(`Indexed geometry does not specify face indices for '${r12}' attribute`), n13 = false);
- }
- } else
- w4.warn("Indexed geometries must specify faces"), n13 = false;
- break;
- }
- default:
- w4.warn(`Unsupported topology '${r11}'`), n13 = false;
- }
- e20.params.material || (w4.warn("Geometry requires material"), n13 = false);
- const s10 = e20.params.vertexAttributes;
- for (const a10 in s10) {
- s10[a10].values || (w4.warn("Geometries with externally defined attributes are not yet supported"), n13 = false);
- }
- return n13;
- }
- function P5(e20, t12) {
- const r11 = [], n13 = [], s10 = [], o14 = [], i15 = e20.resource, c16 = r9.parse(i15.version || "1.0", "wosr");
- k3.validate(c16);
- const m7 = i15.model.name, p4 = i15.model.geometries, d9 = i15.materialDefinitions, h9 = e20.textures;
- let w5 = 0;
- const b5 = /* @__PURE__ */ new Map();
- for (let u11 = 0; u11 < p4.length; u11++) {
- const e21 = p4[u11];
- if (!M5(e21))
- continue;
- const i16 = T5(e21), c17 = e21.params.vertexAttributes, m8 = [];
- for (const t13 in c17) {
- const e22 = c17[t13], r12 = e22.values;
- m8.push([t13, { data: r12, size: e22.valuesPerElement, exclusive: true }]);
- }
- const v5 = [];
- if ("PerAttributeArray" !== e21.params.topology) {
- const t13 = e21.params.faces;
- for (const e22 in t13)
- v5.push([e22, t13[e22].values]);
- }
- const j4 = h9 && h9[i16.texture];
- if (j4 && !b5.has(i16.texture)) {
- const { image: e22, params: t13 } = j4, r12 = new L4(e22, t13);
- o14.push(r12), b5.set(i16.texture, r12);
- }
- const A7 = b5.get(i16.texture), P6 = A7 ? A7.id : void 0;
- let U5 = s10[i16.material] ? s10[i16.material][i16.texture] : null;
- if (!U5) {
- const e22 = d9[i16.material.substring(i16.material.lastIndexOf("/") + 1)].params;
- 1 === e22.transparency && (e22.transparency = 0);
- const r12 = j4 && j4.alphaChannelUsage, n14 = e22.transparency > 0 || "transparency" === r12 || "maskAndTransparency" === r12, o15 = j4 ? I3(j4.alphaChannelUsage) : void 0, u12 = { ambient: e4(e22.diffuse), diffuse: e4(e22.diffuse), opacity: 1 - (e22.transparency || 0), transparent: n14, textureAlphaMode: o15, textureAlphaCutoff: 0.33, textureId: P6, initTextureTransparent: true, doubleSided: true, cullFace: n9.None, colorMixMode: e22.externalColorMixMode || "tint", textureAlphaPremultiplied: !!j4 && !!j4.params.preMultiplyAlpha };
- r(t12) && t12.materialParamsMixin && Object.assign(u12, t12.materialParamsMixin), U5 = new C3(u12), s10[i16.material] || (s10[i16.material] = {}), s10[i16.material][i16.texture] = U5;
- }
- n13.push(U5);
- const E10 = new d4(m8, v5);
- w5 += v5.position ? v5.position.length : 0, r11.push(E10);
- }
- return { engineResources: [{ name: m7, stageResources: { textures: o14, materials: n13, geometries: r11 }, pivotOffset: i15.model.pivotOffset, numberOfVertices: w5, lodThreshold: null }], referenceBoundingBox: U4(r11) };
- }
- function U4(e20) {
- const t12 = A2();
- return e20.forEach((e21) => {
- const r11 = e21.boundingInfo;
- r(r11) && (c3(t12, r11.getBBMin()), c3(t12, r11.getBBMax()));
- }), t12;
- }
- async function E9(e20, t12) {
- const r11 = [];
- for (const o14 in e20) {
- const n14 = e20[o14], s11 = n14.images[0].data;
- if (!s11) {
- w4.warn("Externally referenced texture data is not yet supported");
- continue;
- }
- const i15 = n14.encoding + ";base64," + s11, u11 = "/textureDefinitions/" + o14, l9 = "rgba" === n14.channels ? n14.alphaChannelUsage || "transparency" : "none", c16 = { noUnpackFlip: true, wrap: { s: D.REPEAT, t: D.REPEAT }, preMultiplyAlpha: I3(l9) !== C.Opaque }, m7 = r(t12) && t12.disableTextures ? Promise.resolve(null) : t6(i15, t12);
- r11.push(m7.then((e21) => ({ refId: u11, image: e21, params: c16, alphaChannelUsage: l9 })));
- }
- const n13 = await Promise.all(r11), s10 = {};
- for (const a10 of n13)
- s10[a10.refId] = a10;
- return s10;
- }
- function I3(e20) {
- switch (e20) {
- case "mask":
- return C.Mask;
- case "maskAndTransparency":
- return C.MaskBlend;
- case "none":
- return C.Opaque;
- default:
- return C.Blend;
- }
- }
- function T5(e20) {
- const t12 = e20.params;
- return { id: 1, material: t12.material, texture: t12.texture, region: t12.texture };
- }
- var k3 = new r9(1, 2, "wosr");
- // node_modules/@arcgis/core/views/3d/layers/graphics/objectResourceUtils.js
- async function Y2(s10, o14) {
- const i15 = Z(a3(s10));
- if ("wosr" === i15.fileType) {
- const e20 = await (o14.cache ? o14.cache.loadWOSR(i15.url, o14) : b4(i15.url, o14)), { engineResources: t12, referenceBoundingBox: r11 } = P5(e20, o14);
- return { lods: t12, referenceBoundingBox: r11, isEsriSymbolResource: false, isWosr: true };
- }
- const n13 = await (o14.cache ? o14.cache.loadGLTF(i15.url, o14, o14.usePBR) : m(new n6(o14.streamDataRequester), i15.url, o14, o14.usePBR)), a10 = q(n13.model.meta, "ESRI_proxyEllipsoid"), u11 = n13.meta.isEsriSymbolResource && r(a10) && n13.meta.uri.includes("/RealisticTrees/");
- u11 && !n13.customMeta.esriTreeRendering && (n13.customMeta.esriTreeRendering = true, ie(n13, a10));
- const l9 = n13.meta.isEsriSymbolResource ? { usePBR: o14.usePBR, isSchematic: false, treeRendering: u11, mrrFactors: [0, 1, 0.2] } : { usePBR: o14.usePBR, isSchematic: false, treeRendering: false, mrrFactors: [0, 1, 0.5] }, c16 = { ...o14.materialParamsMixin, treeRendering: u11 }, { engineResources: m7, referenceBoundingBox: f9 } = ee(n13, l9, c16, o14.skipHighLods && null == i15.specifiedLodIndex ? { skipHighLods: true } : { skipHighLods: false, singleLodIndex: i15.specifiedLodIndex });
- return { lods: m7, referenceBoundingBox: f9, isEsriSymbolResource: n13.meta.isEsriSymbolResource, isWosr: false };
- }
- function Z(e20) {
- const t12 = e20.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);
- if (t12)
- return { fileType: "gltf", url: t12[1], specifiedLodIndex: null != t12[4] ? Number(t12[4]) : null };
- return e20.match(/(.*\.(json|json\.gz))$/) ? { fileType: "wosr", url: e20, specifiedLodIndex: null } : { fileType: "unknown", url: e20, specifiedLodIndex: null };
- }
- function ee(e20, t12, o14, i15) {
- const n13 = e20.model, a10 = new Array(), u11 = /* @__PURE__ */ new Map(), l9 = /* @__PURE__ */ new Map(), c16 = n13.lods.length, m7 = A2();
- return n13.lods.forEach((e21, f9) => {
- const d9 = true === i15.skipHighLods && (c16 > 1 && 0 === f9 || c16 > 3 && 1 === f9) || false === i15.skipHighLods && null != i15.singleLodIndex && f9 !== i15.singleLodIndex;
- if (d9 && 0 !== f9)
- return;
- const p4 = new Array();
- let g8 = 0;
- if (e21.parts.forEach((e22) => {
- const { geometry: t13, vertexCount: s10 } = te(e22);
- p4.push(t13), g8 += s10;
- const o15 = t13.boundingInfo;
- r(o15) && 0 === f9 && (c3(m7, o15.getBBMin()), c3(m7, o15.getBBMax()));
- }), d9)
- return;
- const h9 = new s5(e21.name, { textures: new Array(), materials: new Array(), geometries: p4 }, e21.lodThreshold, [0, 0, 0], g8);
- a10.push(h9), e21.parts.forEach((e22) => {
- const i16 = e22.material + (e22.attributes.normal ? "_normal" : "") + (e22.attributes.color ? "_color" : "") + (e22.attributes.texCoord0 ? "_texCoord0" : "") + (e22.attributes.tangent ? "_tangent" : ""), a11 = n13.materials.get(e22.material), c17 = r(e22.attributes.texCoord0), m8 = r(e22.attributes.normal);
- if (t(a11))
- return;
- const f10 = se(a11.alphaMode);
- if (!u11.has(i16)) {
- if (c17) {
- const e23 = (e24, t13 = false) => {
- if (r(e24) && !l9.has(e24)) {
- const s11 = n13.textures.get(e24);
- r(s11) && l9.set(e24, new L4(s11.data, t13 ? { ...s11.parameters, preMultiplyAlpha: t13 } : s11.parameters));
- }
- };
- e23(a11.textureColor, f10 !== C.Opaque), e23(a11.textureNormal), e23(a11.textureOcclusion), e23(a11.textureEmissive), e23(a11.textureMetallicRoughness);
- }
- const s10 = a11.color[0] ** (1 / o5), d10 = a11.color[1] ** (1 / o5), p5 = a11.color[2] ** (1 / o5), g9 = a11.emissiveFactor[0] ** (1 / o5), x6 = a11.emissiveFactor[1] ** (1 / o5), h10 = a11.emissiveFactor[2] ** (1 / o5), b5 = r(a11.textureColor) && c17 ? l9.get(a11.textureColor) : null;
- u11.set(i16, new C3({ ...t12, transparent: f10 === C.Blend, customDepthTest: e14.Lequal, textureAlphaMode: f10, textureAlphaCutoff: a11.alphaCutoff, diffuse: [s10, d10, p5], ambient: [s10, d10, p5], opacity: a11.opacity, doubleSided: a11.doubleSided, doubleSidedType: "winding-order", cullFace: a11.doubleSided ? n9.None : n9.Back, hasVertexColors: !!e22.attributes.color, hasVertexTangents: !!e22.attributes.tangent, normals: m8 ? "default" : "screenDerivative", castShadows: true, receiveSSAO: true, textureId: r(b5) ? b5.id : void 0, colorMixMode: a11.colorMixMode, normalTextureId: r(a11.textureNormal) && c17 ? l9.get(a11.textureNormal).id : void 0, textureAlphaPremultiplied: r(b5) && !!b5.params.preMultiplyAlpha, occlusionTextureId: r(a11.textureOcclusion) && c17 ? l9.get(a11.textureOcclusion).id : void 0, emissiveTextureId: r(a11.textureEmissive) && c17 ? l9.get(a11.textureEmissive).id : void 0, metallicRoughnessTextureId: r(a11.textureMetallicRoughness) && c17 ? l9.get(a11.textureMetallicRoughness).id : void 0, emissiveFactor: [g9, x6, h10], mrrFactors: [a11.metallicFactor, a11.roughnessFactor, t12.mrrFactors[2]], isSchematic: false, colorTextureTransformMatrix: c8(a11.colorTextureTransform), normalTextureTransformMatrix: c8(a11.normalTextureTransform), occlusionTextureTransformMatrix: c8(a11.occlusionTextureTransform), emissiveTextureTransformMatrix: c8(a11.emissiveTextureTransform), metallicRoughnessTextureTransformMatrix: c8(a11.metallicRoughnessTextureTransform), ...o14 }));
- }
- if (h9.stageResources.materials.push(u11.get(i16)), c17) {
- const e23 = (e24) => {
- r(e24) && h9.stageResources.textures.push(l9.get(e24));
- };
- e23(a11.textureColor), e23(a11.textureNormal), e23(a11.textureOcclusion), e23(a11.textureEmissive), e23(a11.textureMetallicRoughness);
- }
- });
- }), { engineResources: a10, referenceBoundingBox: m7 };
- }
- function te(e20) {
- const t12 = oe(e20.indices || e20.attributes.position.count, e20.primitiveType), s10 = e20.attributes.position.count, i15 = r8(i3, s10);
- t3(i15, e20.attributes.position, e20.transform);
- const n13 = [[O4.POSITION, { data: i15.typedBuffer, size: i15.elementCount, exclusive: true }]], a10 = [[O4.POSITION, t12]];
- if (r(e20.attributes.normal)) {
- const r11 = r8(i3, s10);
- g2(re, e20.transform), r5(r11, e20.attributes.normal, re), n13.push([O4.NORMAL, { data: r11.typedBuffer, size: r11.elementCount, exclusive: true }]), a10.push([O4.NORMAL, t12]);
- }
- if (r(e20.attributes.tangent)) {
- const r11 = r8(c4, s10);
- g2(re, e20.transform), r7(r11, e20.attributes.tangent, re), n13.push([O4.TANGENT, { data: r11.typedBuffer, size: r11.elementCount, exclusive: true }]), a10.push([O4.TANGENT, t12]);
- }
- if (r(e20.attributes.texCoord0)) {
- const r11 = r8(u2, s10);
- n5(r11, e20.attributes.texCoord0), n13.push([O4.UV0, { data: r11.typedBuffer, size: r11.elementCount, exclusive: true }]), a10.push([O4.UV0, t12]);
- }
- if (r(e20.attributes.color)) {
- const r11 = r8(x, s10);
- if (4 === e20.attributes.color.elementCount)
- e20.attributes.color instanceof c4 ? o3(r11, e20.attributes.color, 255) : e20.attributes.color instanceof x ? e11(r11, e20.attributes.color) : e20.attributes.color instanceof L && o3(r11, e20.attributes.color, 1 / 256);
- else {
- t4(r11, 255, 255, 255, 255);
- const t13 = new O2(r11.buffer, 0, 4);
- e20.attributes.color instanceof i3 ? f3(t13, e20.attributes.color, 255) : e20.attributes.color instanceof O2 ? e9(t13, e20.attributes.color) : e20.attributes.color instanceof E2 && f3(t13, e20.attributes.color, 1 / 256);
- }
- n13.push([O4.COLOR, { data: r11.typedBuffer, size: r11.elementCount, exclusive: true }]), a10.push([O4.COLOR, t12]);
- }
- return { geometry: new d4(n13, a10), vertexCount: s10 };
- }
- var re = e6();
- function se(e20) {
- switch (e20) {
- case "BLEND":
- return C.Blend;
- case "MASK":
- return C.Mask;
- case "OPAQUE":
- case null:
- case void 0:
- return C.Opaque;
- }
- }
- function oe(e20, t12) {
- switch (t12) {
- case E3.TRIANGLES:
- return o4(e20);
- case E3.TRIANGLE_STRIP:
- return f4(e20);
- case E3.TRIANGLE_FAN:
- return i6(e20);
- }
- }
- function ie(e20, t12) {
- for (let r11 = 0; r11 < e20.model.lods.length; ++r11) {
- const o14 = e20.model.lods[r11];
- for (const i15 of o14.parts) {
- const o15 = i15.attributes.normal;
- if (t(o15))
- return;
- const g8 = i15.attributes.position, x6 = g8.count, b5 = n2(), T6 = n2(), v5 = n2(), M6 = r8(x, x6), y4 = r8(i3, x6), j4 = h2(e7(), i15.transform);
- for (let s10 = 0; s10 < x6; s10++) {
- g8.getVec(s10, T6), o15.getVec(s10, b5), O(T6, T6, i15.transform), e5(v5, T6, t12.center), i(v5, v5, t12.radius);
- const n13 = v5[2], a10 = s3(v5), p4 = Math.min(0.45 + 0.55 * a10 * a10, 1);
- i(v5, v5, t12.radius), null !== j4 && O(v5, v5, j4), z(v5, v5), r11 + 1 !== e20.model.lods.length && e20.model.lods.length > 1 && A(v5, v5, b5, n13 > -1 ? 0.2 : Math.min(-4 * n13 - 3.8, 1)), y4.setVec(s10, v5), M6.set(s10, 0, 255 * p4), M6.set(s10, 1, 255 * p4), M6.set(s10, 2, 255 * p4), M6.set(s10, 3, 255);
- }
- i15.attributes.normal = y4, i15.attributes.color = M6;
- }
- }
- }
- export {
- Y2 as fetch,
- ee as gltfToEngineResources,
- Z as parseUrl
- };
- //# sourceMappingURL=objectResourceUtils-KV6RC3N7.js.map
|