12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706 |
- import {
- E as E4,
- W,
- _ as _2,
- a as a9,
- c as c5,
- c2 as c6,
- h as h5,
- i as i7,
- l as l5,
- t as t6
- } from "./chunk-G3TNMPDJ.js";
- import {
- D as D2,
- _,
- c as c4,
- f as f3,
- n as n10
- } from "./chunk-GDB2KX4Y.js";
- import {
- _ as _3
- } from "./chunk-Y2EWIDNZ.js";
- import {
- n as n5,
- u as u5
- } from "./chunk-546QCRS4.js";
- import {
- W as W2,
- i as i6
- } from "./chunk-Q7HVKAHU.js";
- import {
- u as u4
- } from "./chunk-QXZVBSBH.js";
- import {
- V as V3
- } from "./chunk-NKUISUYG.js";
- import {
- E as E3,
- L as L4,
- a2 as a8,
- d3 as d,
- e as e12,
- f as f4,
- h as h3,
- h2 as h4,
- i as i5,
- l as l4,
- o as o6,
- o3 as o7,
- o5 as o8,
- r as r9,
- r2 as r10,
- x as x2
- } from "./chunk-OBMTYN3I.js";
- import {
- C as C2,
- N,
- O as O5,
- a as a7,
- c as c3,
- l as l2,
- n as n9
- } from "./chunk-EPIK5VPD.js";
- import {
- e as e11
- } from "./chunk-YOPKLVID.js";
- import {
- n as n11
- } from "./chunk-T4GXZJ3D.js";
- import {
- a as a6
- } from "./chunk-ILP23N26.js";
- import {
- c as c2,
- e as e10,
- g,
- i as i4,
- l,
- n2 as n6,
- n3 as n7,
- n4 as n8,
- o as o3,
- o2 as o4,
- o3 as o5,
- r as r6,
- r2 as r7,
- t as t5,
- u as u6
- } from "./chunk-NBRP7CWO.js";
- import "./chunk-GXVMJ7RN.js";
- import "./chunk-6BRTRIDE.js";
- import {
- T
- } from "./chunk-AGCBSGET.js";
- import {
- t as t3
- } from "./chunk-J525NRN3.js";
- import {
- O as O3
- } from "./chunk-XXBIV3TZ.js";
- import "./chunk-2QVXRTVA.js";
- import {
- C,
- D,
- E as E2,
- F,
- G as G2,
- I,
- L as L3,
- M,
- O as O4,
- P as P2,
- V as V2,
- Y,
- u as u3
- } from "./chunk-MI7HWWFL.js";
- import {
- e2 as e9,
- f as f2,
- r as r5,
- t as t4
- } from "./chunk-4KFEVYXL.js";
- import {
- S as S2
- } from "./chunk-5W6F4NR5.js";
- import {
- e as e8
- } from "./chunk-YZUP3MAF.js";
- import {
- e as e7
- } from "./chunk-E3HOL2XO.js";
- import {
- e as e6
- } from "./chunk-SCXOTZ6Q.js";
- import {
- E,
- L as L2,
- O as O2,
- c,
- i as i3,
- u as u2,
- x
- } from "./chunk-H4JLO5B2.js";
- import "./chunk-LGW7TID4.js";
- import {
- l as l3
- } from "./chunk-FXKC6XZV.js";
- import "./chunk-G5AI6ZNE.js";
- import {
- j
- } from "./chunk-CRGVDJI6.js";
- import "./chunk-6P6NA7JB.js";
- import {
- r as r8
- } from "./chunk-LPQPD3EP.js";
- import "./chunk-WR32EHFC.js";
- import {
- B,
- h as h2
- } from "./chunk-WNCU6BFU.js";
- import {
- r as r4
- } from "./chunk-NTUXR253.js";
- import {
- n as n4
- } from "./chunk-H2KDMZTR.js";
- import "./chunk-PJ7ZQ4VD.js";
- import {
- G,
- h
- } from "./chunk-TERAW6FT.js";
- import "./chunk-N2663GRX.js";
- import {
- A,
- L,
- O,
- P,
- S,
- a2 as a4,
- e as e5,
- i,
- i2,
- o as o2,
- p,
- q,
- r as r3,
- s as s4,
- u,
- z
- } from "./chunk-XNLG7T2T.js";
- import {
- e as e4,
- n as n3,
- r as r2,
- t as t2
- } from "./chunk-IR4PV7VK.js";
- import {
- a as a5
- } from "./chunk-WJ3OEUD3.js";
- import {
- a as a3
- } from "./chunk-MXB2XLKV.js";
- import {
- n as n2
- } from "./chunk-DT6EAZQ5.js";
- import {
- U,
- a as a2
- } from "./chunk-VNFRAYHO.js";
- import "./chunk-R5IG2D6H.js";
- import {
- V,
- X
- } from "./chunk-VBRY5KJM.js";
- import "./chunk-ECW2QABR.js";
- import "./chunk-GCDJLKH4.js";
- import "./chunk-MRJEICT6.js";
- import {
- e,
- n5 as n
- } from "./chunk-Y3WMVFTW.js";
- import "./chunk-SAS7RONY.js";
- import "./chunk-WSRBH7BF.js";
- import "./chunk-IHXECKQQ.js";
- import {
- f,
- m as m2,
- v,
- w
- } from "./chunk-ULGDPLM2.js";
- import {
- s as s2,
- s3
- } from "./chunk-EMJ4ZSM2.js";
- import "./chunk-IKP3YN53.js";
- import {
- a2 as a,
- e as e2,
- e2 as e3,
- m,
- o2 as o,
- r,
- s,
- t
- } from "./chunk-GZT4BVFP.js";
- import "./chunk-A5ICIBVI.js";
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/BoundingInfo.js
- var a10 = class {
- constructor(i12, s8, a12, c12) {
- this.primitiveIndices = i12, this._numIndexPerPrimitive = s8, this.indices = a12, this.position = c12, this.center = n3(), e11(i12.length >= 1), e11(a12.length % this._numIndexPerPrimitive == 0), e11(a12.length >= i12.length * this._numIndexPerPrimitive), e11(c12.size === 3 || c12.size === 4);
- const { data: o12, size: d6 } = c12, M3 = i12.length;
- let l10 = d6 * a12[this._numIndexPerPrimitive * i12[0]];
- b.clear(), b.push(l10), this.bbMin = r2(o12[l10], o12[l10 + 1], o12[l10 + 2]), this.bbMax = t2(this.bbMin);
- for (let t11 = 0; t11 < M3; ++t11) {
- const s9 = this._numIndexPerPrimitive * i12[t11];
- for (let i13 = 0; i13 < this._numIndexPerPrimitive; ++i13) {
- l10 = d6 * a12[s9 + i13], b.push(l10);
- let t12 = o12[l10];
- this.bbMin[0] = Math.min(t12, this.bbMin[0]), this.bbMax[0] = Math.max(t12, this.bbMax[0]), t12 = o12[l10 + 1], this.bbMin[1] = Math.min(t12, this.bbMin[1]), this.bbMax[1] = Math.max(t12, this.bbMax[1]), t12 = o12[l10 + 2], this.bbMin[2] = Math.min(t12, this.bbMin[2]), this.bbMax[2] = Math.max(t12, 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 m6 = this.radius * this.radius;
- for (let t11 = 0; t11 < b.length; ++t11) {
- l10 = b.getItemAt(t11);
- const i13 = o12[l10] - this.center[0], s9 = o12[l10 + 1] - this.center[1], e16 = o12[l10 + 2] - this.center[2], n14 = i13 * i13 + s9 * s9 + e16 * e16;
- if (n14 <= m6)
- continue;
- const r12 = Math.sqrt(n14), h10 = 0.5 * (r12 - this.radius);
- this.radius = this.radius + h10, m6 = this.radius * this.radius;
- const a13 = h10 / r12;
- this.center[0] += i13 * a13, this.center[1] += s9 * a13, this.center[2] += e16 * a13;
- }
- b.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 i12 = A(n3(), this.bbMin, this.bbMax, 0.5), s8 = this.primitiveIndices.length, n14 = new Uint8Array(s8), r12 = new Array(8);
- for (let t11 = 0; t11 < 8; ++t11)
- r12[t11] = 0;
- const { data: h10, size: b3 } = this.position;
- for (let t11 = 0; t11 < s8; ++t11) {
- let s9 = 0;
- const e16 = this._numIndexPerPrimitive * this.primitiveIndices[t11];
- let a12 = b3 * this.indices[e16], c13 = h10[a12], o13 = h10[a12 + 1], d6 = h10[a12 + 2];
- for (let i13 = 1; i13 < this._numIndexPerPrimitive; ++i13) {
- a12 = b3 * this.indices[e16 + i13];
- const t12 = h10[a12], s10 = h10[a12 + 1], n15 = h10[a12 + 2];
- t12 < c13 && (c13 = t12), s10 < o13 && (o13 = s10), n15 < d6 && (d6 = n15);
- }
- c13 < i12[0] && (s9 |= 1), o13 < i12[1] && (s9 |= 2), d6 < i12[2] && (s9 |= 4), n14[t11] = s9, ++r12[s9];
- }
- let c12 = 0;
- for (let t11 = 0; t11 < 8; ++t11)
- r12[t11] > 0 && ++c12;
- if (c12 < 2)
- return;
- const o12 = new Array(8);
- for (let t11 = 0; t11 < 8; ++t11)
- o12[t11] = r12[t11] > 0 ? new Uint32Array(r12[t11]) : void 0;
- for (let t11 = 0; t11 < 8; ++t11)
- r12[t11] = 0;
- for (let t11 = 0; t11 < s8; ++t11) {
- const i13 = n14[t11];
- o12[i13][r12[i13]++] = this.primitiveIndices[t11];
- }
- this._children = new Array(8);
- for (let t11 = 0; t11 < 8; ++t11)
- o12[t11] !== void 0 && (this._children[t11] = new a10(o12[t11], this._numIndexPerPrimitive, this.indices, this.position));
- }
- return this._children;
- }
- static prune() {
- b.prune();
- }
- };
- var b = new n({ deallocator: null });
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Geometry.js
- var g2 = class extends r9 {
- constructor(t11, i12 = [], n14 = c3.Triangle, o12 = -1) {
- super(), this._primitiveType = n14, this.edgeIndicesLength = o12, this.type = e12.Geometry, this._vertexAttributes = new Map(), this._indices = new Map(), this._boundingInfo = null;
- for (const [e16, s8] of t11)
- s8 && this._vertexAttributes.set(e16, { ...s8 });
- if (i12 == null || i12.length === 0) {
- const t12 = d2(this._vertexAttributes), e16 = l(t12);
- this.edgeIndicesLength = this.edgeIndicesLength < 0 ? t12 : this.edgeIndicesLength;
- for (const i13 of this._vertexAttributes.keys())
- this._indices.set(i13, e16);
- } else
- for (const [e16, s8] of i12)
- s8 && (this._indices.set(e16, l6(s8)), e16 === O3.POSITION && (this.edgeIndicesLength = this.edgeIndicesLength < 0 ? this._indices.get(e16).length : this.edgeIndicesLength));
- }
- cloneShallow() {
- const t11 = new g2([], void 0, this._primitiveType, void 0), { _vertexAttributes: e16, _indices: i12 } = t11;
- return this._vertexAttributes.forEach((t12, i13) => {
- e16.set(i13, t12);
- }), this._indices.forEach((t12, e17) => {
- i12.set(e17, t12);
- }), t11.screenToWorldRatio = this.screenToWorldRatio, t11._boundingInfo = this._boundingInfo, t11;
- }
- get vertexAttributes() {
- return this._vertexAttributes;
- }
- getMutableAttribute(t11) {
- const e16 = this._vertexAttributes.get(t11);
- return e16 && !e16.exclusive && (e16.data = Array.from(e16.data), e16.exclusive = true), e16;
- }
- get indices() {
- return this._indices;
- }
- get indexCount() {
- const t11 = this._indices.values().next().value;
- return t11 ? t11.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(t11) {
- return this.primitiveType === c3.Triangle ? this._computeAttachmentOriginTriangles(t11) : this._computeAttachmentOriginPoints(t11);
- }
- _computeAttachmentOriginTriangles(t11) {
- const e16 = this.indices.get(O3.POSITION), i12 = this.vertexAttributes.get(O3.POSITION);
- return u6(i12, e16, t11);
- }
- _computeAttachmentOriginPoints(t11) {
- const e16 = this.indices.get(O3.POSITION), i12 = this.vertexAttributes.get(O3.POSITION);
- return g(i12, e16, t11);
- }
- invalidateBoundingInfo() {
- this._boundingInfo = null;
- }
- _calculateBoundingInfo() {
- const t11 = this.indices.get(O3.POSITION);
- if (t11.length === 0)
- return null;
- const n14 = this.primitiveType === c3.Triangle ? 3 : 1;
- e11(t11.length % n14 == 0, "Indexing error: " + t11.length + " not divisible by " + n14);
- const s8 = l(t11.length / n14), o12 = this.vertexAttributes.get(O3.POSITION);
- return new a10(s8, n14, t11, o12);
- }
- };
- function d2(t11) {
- const e16 = t11.values().next().value;
- return e16 == null ? 0 : e16.data.length / e16.size;
- }
- function l6(t11) {
- if (t11.BYTES_PER_ELEMENT === Uint16Array.BYTES_PER_ELEMENT)
- return t11;
- for (const e16 of t11)
- if (e16 >= 65536)
- return t11;
- return new Uint16Array(t11);
- }
- // node_modules/@arcgis/core/libs/basisu/BasisU.js
- function s5() {
- if (t(i8)) {
- const t11 = (t12) => a3(`esri/libs/basisu/${t12}`);
- i8 = import("./basis_transcoder-YLPYC2ZL.js").then((e16) => e16.b).then(({ default: e16 }) => e16({ locateFile: t11 }).then((e17) => (e17.initializeBasis(), delete e17.then, e17)));
- }
- return i8;
- }
- var i8;
- // 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 g3 = null;
- var l7 = null;
- async function c7() {
- return t(l7) && (l7 = s5(), g3 = await l7), l7;
- }
- function u7(t11, n14) {
- if (t(g3))
- return t11.byteLength;
- const r12 = new g3.BasisFile(new Uint8Array(t11)), s8 = T2(r12) ? E5(r12.getNumLevels(0), r12.getHasAlpha(), r12.getImageWidth(0, 0), r12.getImageHeight(0, 0), n14) : 0;
- return r12.close(), r12.delete(), s8;
- }
- function m3(t11, n14) {
- if (t(g3))
- return t11.byteLength;
- const r12 = new g3.KTX2File(new Uint8Array(t11)), s8 = _5(r12) ? E5(r12.getLevels(), r12.getHasAlpha(), r12.getWidth(), r12.getHeight(), n14) : 0;
- return r12.close(), r12.delete(), s8;
- }
- function E5(e16, t11, n14, s8, i12) {
- const a12 = _(t11 ? u3.COMPRESSED_RGBA8_ETC2_EAC : u3.COMPRESSED_RGB8_ETC2), g7 = i12 && e16 > 1 ? (4 ** e16 - 1) / (3 * 4 ** (e16 - 1)) : 1;
- return Math.ceil(n14 * s8 * a12 * g7);
- }
- function T2(e16) {
- return e16.getNumImages() >= 1 && !e16.isUASTC();
- }
- function _5(e16) {
- return e16.getFaces() >= 1 && e16.isETC1S();
- }
- async function h6(t11, n14, r12) {
- t(g3) && (g3 = await c7());
- const s8 = new g3.BasisFile(new Uint8Array(r12));
- if (!T2(s8))
- return null;
- s8.startTranscoding();
- const i12 = p2(t11, n14, s8.getNumLevels(0), s8.getHasAlpha(), s8.getImageWidth(0, 0), s8.getImageHeight(0, 0), (e16, t12) => s8.getImageTranscodedSizeInBytes(0, e16, t12), (e16, t12, n15) => s8.transcodeImage(n15, 0, e16, t12, 0, 0));
- return s8.close(), s8.delete(), i12;
- }
- async function A2(t11, n14, r12) {
- t(g3) && (g3 = await c7());
- const s8 = new g3.KTX2File(new Uint8Array(r12));
- if (!_5(s8))
- return null;
- s8.startTranscoding();
- const i12 = p2(t11, n14, s8.getLevels(), s8.getHasAlpha(), s8.getWidth(), s8.getHeight(), (e16, t12) => s8.getImageTranscodedSizeInBytes(e16, 0, 0, t12), (e16, t12, n15) => s8.transcodeImage(n15, e16, 0, 0, t12, 0, -1, -1));
- return s8.close(), s8.delete(), i12;
- }
- function p2(e16, t11, o12, g7, l10, c12, u11, m6) {
- const { compressedTextureETC: E9, compressedTextureS3TC: T6 } = e16.capabilities, [_8, h10] = E9 ? g7 ? [_4.ETC2_RGBA, u3.COMPRESSED_RGBA8_ETC2_EAC] : [_4.ETC1_RGB, u3.COMPRESSED_RGB8_ETC2] : T6 ? g7 ? [_4.BC3_RGBA, u3.COMPRESSED_RGBA_S3TC_DXT5_EXT] : [_4.BC1_RGB, u3.COMPRESSED_RGB_S3TC_DXT1_EXT] : [_4.RGBA32, P2.RGBA], A7 = t11.hasMipmap ? o12 : Math.min(1, o12), p5 = [];
- for (let n14 = 0; n14 < A7; n14++)
- p5.push(new Uint8Array(u11(n14, _8))), m6(n14, _8, p5[n14]);
- const C4 = p5.length > 1, d6 = C4 ? L3.LINEAR_MIPMAP_LINEAR : L3.LINEAR, R2 = { ...t11, samplingMode: d6, hasMipmap: C4, internalFormat: h10, width: l10, height: c12 };
- return new u5(e16, R2, { type: "compressed", levels: p5 });
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/DDSUtil.js
- var a11 = s2.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");
- var i9 = 542327876;
- var s6 = 131072;
- var l8 = 4;
- function u8(e16) {
- return e16.charCodeAt(0) + (e16.charCodeAt(1) << 8) + (e16.charCodeAt(2) << 16) + (e16.charCodeAt(3) << 24);
- }
- function m4(e16) {
- return String.fromCharCode(255 & e16, e16 >> 8 & 255, e16 >> 16 & 255, e16 >> 24 & 255);
- }
- var c8 = u8("DXT1");
- var h7 = u8("DXT3");
- var p3 = u8("DXT5");
- var d3 = 31;
- var g4 = 0;
- var f5 = 1;
- var C3 = 2;
- var w2 = 3;
- var D3 = 4;
- var _6 = 7;
- var T3 = 20;
- var A3 = 21;
- function E6(e16, t11, n14) {
- const { textureData: a12, internalFormat: i12, width: s8, height: l10 } = S3(n14, t11.hasMipmap);
- return t11.samplingMode = a12.levels.length > 1 ? L3.LINEAR_MIPMAP_LINEAR : L3.LINEAR, t11.hasMipmap = a12.levels.length > 1, t11.internalFormat = i12, t11.width = s8, t11.height = l10, new u5(e16, t11, a12);
- }
- function S3(e16, r12) {
- const o12 = new Int32Array(e16, 0, d3);
- if (o12[g4] !== i9)
- return a11.error("Invalid magic number in DDS header"), null;
- if (!(o12[T3] & l8))
- return a11.error("Unsupported format, must contain a FourCC code"), null;
- const u11 = o12[A3];
- let E9, S5;
- switch (u11) {
- case c8:
- E9 = 8, S5 = u3.COMPRESSED_RGB_S3TC_DXT1_EXT;
- break;
- case h7:
- E9 = 16, S5 = u3.COMPRESSED_RGBA_S3TC_DXT3_EXT;
- break;
- case p3:
- E9 = 16, S5 = u3.COMPRESSED_RGBA_S3TC_DXT5_EXT;
- break;
- default:
- return a11.error("Unsupported FourCC code:", m4(u11)), null;
- }
- let M3 = 1, R2 = o12[D3], x4 = o12[w2];
- (3 & R2) == 0 && (3 & x4) == 0 || (a11.warn("Rounding up compressed texture size to nearest multiple of 4."), R2 = R2 + 3 & -4, x4 = x4 + 3 & -4);
- const X3 = R2, b3 = x4;
- let I5, v4;
- o12[C3] & s6 && r12 !== false && (M3 = Math.max(1, o12[_6])), M3 === 1 || i2(R2) && i2(x4) || (a11.warn("Ignoring mipmaps of non power of two sized compressed texture."), M3 = 1);
- let F3 = o12[f5] + 4;
- const L6 = [];
- for (let t11 = 0; t11 < M3; ++t11)
- v4 = (R2 + 3 >> 2) * (x4 + 3 >> 2) * E9, I5 = new Uint8Array(e16, F3, v4), L6.push(I5), F3 += v4, R2 = Math.max(1, R2 >> 1), x4 = Math.max(1, x4 >> 1);
- return { textureData: { type: "compressed", levels: L6 }, internalFormat: S5, width: X3, height: b3 };
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js
- var n12 = [new t3(O3.POSITION, 3, C.FLOAT, 0, 12)];
- var w3 = [new t3(O3.POSITION, 3, C.FLOAT, 0, 20), new t3(O3.UV0, 2, C.FLOAT, 12, 20)];
- var I2 = [new t3(O3.POSITION, 3, C.FLOAT, 0, 32), new t3(O3.NORMAL, 3, C.FLOAT, 12, 32), new t3(O3.UV0, 2, C.FLOAT, 24, 32)];
- var r11 = [new t3(O3.POSITION, 3, C.FLOAT, 0, 16), new t3(O3.COLOR, 4, C.UNSIGNED_BYTE, 12, 16)];
- var t7 = [new t3(O3.POSITION, 2, C.FLOAT, 0, 8)];
- var A4 = [new t3(O3.POSITION, 2, C.FLOAT, 0, 16), new t3(O3.UV0, 2, C.FLOAT, 8, 16)];
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/glUtil3D.js
- function u9(a12, i12 = t7, m6 = E3, l10 = -1, T6 = 1) {
- let u11 = null;
- if (i12 === A4)
- u11 = new Float32Array([l10, l10, 0, 0, T6, l10, 1, 0, l10, T6, 0, 1, T6, T6, 1, 1]);
- else
- u11 = new Float32Array([l10, l10, T6, l10, l10, T6, T6, T6]);
- return new f3(a12, m6, { geometry: i12 }, { geometry: c4.createVertex(a12, F.STATIC_DRAW, u11) });
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Texture.js
- var L5 = class extends r9 {
- constructor(t11, e16) {
- super(), this.data = t11, this.type = e12.Texture, this._glTexture = null, this._powerOfTwoStretchInfo = null, this._loadingPromise = null, this._loadingController = null, this.events = new n2(), this.params = e16 || {}, this.params.mipmap = this.params.mipmap !== false, 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 || l2.STRETCH, this.estimatedTexMemRequired = L5._estimateTexMemRequired(this.data, this.params), this._startPreload();
- }
- _startPreload() {
- const t11 = this.data;
- t(t11) || (t11 instanceof HTMLVideoElement ? this._startPreloadVideoElement(t11) : t11 instanceof HTMLImageElement && this._startPreloadImageElement(t11));
- }
- _startPreloadVideoElement(t11) {
- if (!(V(t11.src) || t11.preload === "auto" && t11.crossOrigin)) {
- t11.preload = "auto", t11.crossOrigin = "anonymous";
- const e16 = !t11.paused;
- if (t11.src = t11.src, e16 && t11.autoplay) {
- const e17 = () => {
- t11.removeEventListener("canplay", e17), t11.play();
- };
- t11.addEventListener("canplay", e17);
- }
- }
- }
- _startPreloadImageElement(t11) {
- X(t11.src) || V(t11.src) || t11.crossOrigin || (t11.crossOrigin = "anonymous", t11.src = t11.src);
- }
- static _getDataDimensions(t11) {
- return t11 instanceof HTMLVideoElement ? { width: t11.videoWidth, height: t11.videoHeight } : t11;
- }
- static _estimateTexMemRequired(t11, e16) {
- if (t(t11))
- return 0;
- if (o(t11) || e3(t11))
- return e16.encoding === L5.KTX2_ENCODING ? m3(t11, e16.mipmap) : e16.encoding === L5.BASIS_ENCODING ? u7(t11, e16.mipmap) : t11.byteLength;
- const { width: r12, height: i12 } = t11 instanceof Image || t11 instanceof ImageData || t11 instanceof HTMLCanvasElement || t11 instanceof HTMLVideoElement ? L5._getDataDimensions(t11) : e16;
- return (e16.mipmap ? 4 / 3 : 1) * r12 * i12 * (e16.components || 4) || 0;
- }
- dispose() {
- this.data = void 0;
- }
- get width() {
- return this.params.width;
- }
- get height() {
- return this.params.height;
- }
- _createDescriptor(t11) {
- return { target: M.TEXTURE_2D, pixelFormat: P2.RGBA, dataType: G2.UNSIGNED_BYTE, wrapMode: this.params.wrap, flipped: !this.params.noUnpackFlip, samplingMode: this.params.mipmap ? L3.LINEAR_MIPMAP_LINEAR : L3.LINEAR, hasMipmap: this.params.mipmap, preMultiplyAlpha: this.params.preMultiplyAlpha, maxAnisotropy: this.params.maxAnisotropy ?? (this.params.mipmap ? t11.parameters.maxMaxAnisotropy : 1) };
- }
- get glTexture() {
- return this._glTexture;
- }
- load(t11, e16) {
- if (r(this._glTexture))
- return this._glTexture;
- if (r(this._loadingPromise))
- return this._loadingPromise;
- const r12 = this.data;
- return t(r12) ? (this._glTexture = new u5(t11, this._createDescriptor(t11), null), this._glTexture) : typeof r12 == "string" ? this._loadFromURL(t11, e16, r12) : r12 instanceof Image ? this._loadFromImageElement(t11, e16, r12) : r12 instanceof HTMLVideoElement ? this._loadFromVideoElement(t11, e16, r12) : r12 instanceof ImageData || r12 instanceof HTMLCanvasElement ? this._loadFromImage(t11, r12, e16) : (o(r12) || e3(r12)) && this.params.encoding === L5.DDS_ENCODING ? (this.data = void 0, this._loadFromDDSData(t11, r12)) : (o(r12) || e3(r12)) && this.params.encoding === L5.KTX2_ENCODING ? (this.data = void 0, this._loadFromKTX2(t11, r12)) : (o(r12) || e3(r12)) && this.params.encoding === L5.BASIS_ENCODING ? (this.data = void 0, this._loadFromBasis(t11, r12)) : e3(r12) ? this._loadFromPixelData(t11, r12) : o(r12) ? this._loadFromPixelData(t11, new Uint8Array(r12)) : null;
- }
- get requiresFrameUpdates() {
- return this.data instanceof HTMLVideoElement;
- }
- frameUpdate(t11, e16, r12) {
- if (!(this.data instanceof HTMLVideoElement) || t(this._glTexture))
- return r12;
- if (this.data.readyState < j2.HAVE_CURRENT_DATA || r12 === this.data.currentTime)
- return r12;
- if (r(this._powerOfTwoStretchInfo)) {
- const { framebuffer: r13, vao: i12, sourceTexture: s8 } = this._powerOfTwoStretchInfo;
- s8.setData(this.data), this._drawStretchedTexture(t11, e16, r13, i12, s8, this._glTexture);
- } else {
- const { videoWidth: t12, videoHeight: e17 } = this.data, { width: r13, height: i12 } = this._glTexture.descriptor;
- t12 !== r13 || e17 !== i12 ? this._glTexture.updateData(0, 0, 0, Math.min(t12, r13), Math.min(e17, i12), 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(t11, e16) {
- return this._glTexture = E6(t11, this._createDescriptor(t11), e16), this._glTexture;
- }
- _loadFromKTX2(t11, e16) {
- return this._loadAsync(() => A2(t11, this._createDescriptor(t11), e16).then((t12) => (this._glTexture = t12, t12)));
- }
- _loadFromBasis(t11, e16) {
- return this._loadAsync(() => h6(t11, this._createDescriptor(t11), e16).then((t12) => (this._glTexture = t12, t12)));
- }
- _loadFromPixelData(t11, e16) {
- e11(this.params.width > 0 && this.params.height > 0);
- const r12 = this._createDescriptor(t11);
- return r12.pixelFormat = this.params.components === 1 ? P2.LUMINANCE : this.params.components === 3 ? P2.RGB : P2.RGBA, r12.width = this.params.width, r12.height = this.params.height, this._glTexture = new u5(t11, r12, e16), this._glTexture;
- }
- _loadFromURL(t11, e16, r12) {
- return this._loadAsync(async (i12) => {
- const s8 = await t6(r12, { signal: i12 });
- return f(i12), this._loadFromImage(t11, s8, e16);
- });
- }
- _loadFromImageElement(t11, e16, r12) {
- return r12.complete ? this._loadFromImage(t11, r12, e16) : this._loadAsync(async (i12) => {
- const s8 = await a2(r12, r12.src, false, i12);
- return f(i12), this._loadFromImage(t11, s8, e16);
- });
- }
- _loadFromVideoElement(t11, e16, r12) {
- return r12.readyState >= j2.HAVE_CURRENT_DATA ? this._loadFromImage(t11, r12, e16) : this._loadFromVideoElementAsync(t11, e16, r12);
- }
- _loadFromVideoElementAsync(t11, r12, i12) {
- return this._loadAsync((s8) => new Promise((a12, o12) => {
- const m6 = () => {
- i12.removeEventListener("loadeddata", p5), i12.removeEventListener("error", d6), a(_8);
- }, p5 = () => {
- i12.readyState >= j2.HAVE_CURRENT_DATA && (m6(), a12(this._loadFromImage(t11, i12, r12)));
- }, d6 = (t12) => {
- m6(), o12(t12 || new s3("Failed to load video"));
- };
- i12.addEventListener("loadeddata", p5), i12.addEventListener("error", d6);
- const _8 = v(s8, () => d6(m2()));
- }));
- }
- _loadFromImage(t11, e16, r12) {
- const s8 = L5._getDataDimensions(e16);
- this.params.width = s8.width, this.params.height = s8.height;
- const a12 = this._createDescriptor(t11);
- return a12.pixelFormat = this.params.components === 3 ? P2.RGB : P2.RGBA, !this._requiresPowerOfTwo(t11, a12) || i2(s8.width) && i2(s8.height) ? (a12.width = s8.width, a12.height = s8.height, this._glTexture = new u5(t11, a12, e16), this._glTexture) : (this._glTexture = this._makePowerOfTwoTexture(t11, e16, s8, a12, r12), this._glTexture);
- }
- _loadAsync(t11) {
- const e16 = new AbortController();
- this._loadingController = e16;
- const r12 = t11(e16.signal);
- this._loadingPromise = r12;
- const i12 = () => {
- this._loadingController === e16 && (this._loadingController = null), this._loadingPromise === r12 && (this._loadingPromise = null);
- };
- return r12.then(i12, i12), r12;
- }
- _requiresPowerOfTwo(t11, e16) {
- const r12 = D.CLAMP_TO_EDGE, i12 = typeof e16.wrapMode == "number" ? e16.wrapMode === r12 : e16.wrapMode.s === r12 && e16.wrapMode.t === r12;
- return !n5(t11.gl) && (e16.hasMipmap || !i12);
- }
- _makePowerOfTwoTexture(e16, r12, i12, a12, o12) {
- const { width: n14, height: m6 } = i12, h10 = a4(n14), l10 = a4(m6);
- let p5;
- switch (a12.width = h10, a12.height = l10, this.params.powerOfTwoResizeMode) {
- case l2.PAD:
- a12.textureCoordinateScaleFactor = [n14 / h10, m6 / l10], p5 = new u5(e16, a12), p5.updateData(0, 0, 0, n14, m6, r12);
- break;
- case l2.STRETCH:
- case null:
- case void 0:
- p5 = this._stretchToPowerOfTwo(e16, r12, a12, o12());
- break;
- default:
- n4(this.params.powerOfTwoResizeMode);
- }
- return a12.hasMipmap && p5.generateMipmap(), p5;
- }
- _stretchToPowerOfTwo(t11, e16, r12, i12) {
- const s8 = new u5(t11, r12), a12 = new D2(t11, { colorTarget: Y.TEXTURE, depthStencilTarget: V2.NONE }, s8), o12 = new u5(t11, { target: M.TEXTURE_2D, pixelFormat: r12.pixelFormat, dataType: G2.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L3.LINEAR, flipped: !!r12.flipped, maxAnisotropy: 8, preMultiplyAlpha: r12.preMultiplyAlpha }, e16), n14 = u9(t11), m6 = t11.getBoundFramebufferObject();
- return this._drawStretchedTexture(t11, i12, a12, n14, o12, s8), this.requiresFrameUpdates ? this._powerOfTwoStretchInfo = { vao: n14, sourceTexture: o12, framebuffer: a12 } : (n14.dispose(true), o12.dispose(), a12.detachColorTexture(), a12.dispose()), t11.bindFramebuffer(m6), s8;
- }
- _drawStretchedTexture(t11, e16, r12, i12, s8, a12) {
- t11.bindFramebuffer(r12);
- const o12 = t11.getViewport();
- t11.setViewport(0, 0, a12.descriptor.width, a12.descriptor.height);
- const n14 = t11.bindTechnique(e16);
- n14.setUniform4f("uColor", 1, 1, 1, 1), n14.bindTexture("tex", s8), t11.bindVAO(i12), t11.drawArrays(E2.TRIANGLE_STRIP, 0, n10(i12, "geometry")), t11.bindFramebuffer(null), t11.setViewport(o12.x, o12.y, o12.width, o12.height);
- }
- unload() {
- if (r(this._powerOfTwoStretchInfo)) {
- const { framebuffer: t11, vao: e16, sourceTexture: r12 } = this._powerOfTwoStretchInfo;
- e16.dispose(true), r12.dispose(), t11.dispose(), this._glTexture = null, this._powerOfTwoStretchInfo = null;
- }
- if (r(this._glTexture) && (this._glTexture.dispose(), this._glTexture = null), r(this._loadingController)) {
- const t11 = this._loadingController;
- this._loadingController = null, this._loadingPromise = null, t11.abort();
- }
- this.events.emit("unloaded");
- }
- };
- var j2;
- L5.DDS_ENCODING = "image/vnd-ms.dds", L5.KTX2_ENCODING = "image/ktx2", L5.BASIS_ENCODING = "image/x.basis", function(t11) {
- t11[t11.HAVE_NOTHING = 0] = "HAVE_NOTHING", t11[t11.HAVE_METADATA = 1] = "HAVE_METADATA", t11[t11.HAVE_CURRENT_DATA = 2] = "HAVE_CURRENT_DATA", t11[t11.HAVE_FUTURE_DATA = 3] = "HAVE_FUTURE_DATA", t11[t11.HAVE_ENOUGH_DATA = 4] = "HAVE_ENOUGH_DATA";
- }(j2 || (j2 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/RenderPass.js
- var A5;
- !function(A7) {
- A7[A7.MATERIAL = 0] = "MATERIAL", A7[A7.MATERIAL_ALPHA = 1] = "MATERIAL_ALPHA", A7[A7.MATERIAL_DEPTH = 2] = "MATERIAL_DEPTH", A7[A7.MATERIAL_NORMAL = 3] = "MATERIAL_NORMAL", A7[A7.MATERIAL_DEPTH_SHADOWMAP_ALL = 4] = "MATERIAL_DEPTH_SHADOWMAP_ALL", A7[A7.MATERIAL_HIGHLIGHT = 5] = "MATERIAL_HIGHLIGHT", A7[A7.MATERIAL_DEPTH_SHADOWMAP_DEFAULT = 6] = "MATERIAL_DEPTH_SHADOWMAP_DEFAULT", A7[A7.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT = 7] = "MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT";
- }(A5 || (A5 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/RenderSlot.js
- var E7;
- !function(E9) {
- E9[E9.INTEGRATED_MESH = 0] = "INTEGRATED_MESH", E9[E9.OPAQUE_TERRAIN = 1] = "OPAQUE_TERRAIN", E9[E9.OPAQUE_MATERIAL = 2] = "OPAQUE_MATERIAL", E9[E9.TRANSPARENT_MATERIAL = 3] = "TRANSPARENT_MATERIAL", E9[E9.TRANSPARENT_TERRAIN = 4] = "TRANSPARENT_TERRAIN", E9[E9.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL = 5] = "TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL", E9[E9.OCCLUDED_TERRAIN = 6] = "OCCLUDED_TERRAIN", E9[E9.OCCLUDER_MATERIAL = 7] = "OCCLUDER_MATERIAL", E9[E9.TRANSPARENT_OCCLUDER_MATERIAL = 8] = "TRANSPARENT_OCCLUDER_MATERIAL", E9[E9.OCCLUSION_PIXELS = 9] = "OCCLUSION_PIXELS", E9[E9.POSTPROCESSING_ENVIRONMENT_OPAQUE = 10] = "POSTPROCESSING_ENVIRONMENT_OPAQUE", E9[E9.POSTPROCESSING_ENVIRONMENT_TRANSPARENT = 11] = "POSTPROCESSING_ENVIRONMENT_TRANSPARENT", E9[E9.LASERLINES = 12] = "LASERLINES", E9[E9.LASERLINES_CONTRAST_CONTROL = 13] = "LASERLINES_CONTRAST_CONTROL", E9[E9.HUD_MATERIAL = 14] = "HUD_MATERIAL", E9[E9.LABEL_MATERIAL = 15] = "LABEL_MATERIAL", E9[E9.LINE_CALLOUTS = 16] = "LINE_CALLOUTS", E9[E9.LINE_CALLOUTS_HUD_DEPTH = 17] = "LINE_CALLOUTS_HUD_DEPTH", E9[E9.DRAPED_MATERIAL = 18] = "DRAPED_MATERIAL", E9[E9.DRAPED_WATER = 19] = "DRAPED_WATER", E9[E9.VOXEL = 20] = "VOXEL", E9[E9.MAX_SLOTS = 21] = "MAX_SLOTS";
- }(E7 || (E7 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/verticalOffsetUtils.js
- var v2 = class {
- constructor(t11 = 0) {
- this.offset = t11, this.tmpVertex = n3();
- }
- applyToVertex(t11, s8, e16) {
- const i12 = t11 + this.localOrigin[0], r12 = s8 + this.localOrigin[1], a12 = e16 + this.localOrigin[2], o12 = this.offset / Math.sqrt(i12 * i12 + r12 * r12 + a12 * a12);
- return this.tmpVertex[0] = t11 + i12 * o12, this.tmpVertex[1] = s8 + r12 * o12, this.tmpVertex[2] = e16 + a12 * o12, this.tmpVertex;
- }
- applyToAabb(t11) {
- for (let r12 = 0; r12 < 3; ++r12)
- O6[r12] = t11[0 + r12] + this.localOrigin[r12], z2[r12] = t11[3 + r12] + this.localOrigin[r12], T4[r12] = O6[r12];
- const s8 = this.applyToVertex(O6[0], O6[1], O6[2]);
- for (let r12 = 0; r12 < 3; ++r12)
- t11[r12] = s8[r12], t11[r12 + 3] = s8[r12];
- const e16 = (s9) => {
- const e17 = this.applyToVertex(s9[0], s9[1], s9[2]);
- for (let i13 = 0; i13 < 3; ++i13)
- t11[i13 + 0] = Math.min(t11[i13 + 0], e17[i13]), t11[i13 + 3] = Math.max(t11[i13 + 3], e17[i13]);
- };
- for (let r12 = 1; r12 < 8; ++r12) {
- for (let t12 = 0; t12 < 3; ++t12)
- T4[t12] = (r12 & 1 << t12) == 0 ? O6[t12] : z2[t12];
- e16(T4);
- }
- let i12 = 0;
- for (let r12 = 0; r12 < 3; ++r12) {
- O6[r12] * z2[r12] < 0 && (i12 |= 1 << r12);
- }
- if (i12 !== 0 && i12 !== 7) {
- for (let r12 = 0; r12 < 8; ++r12)
- if ((i12 & r12) == 0) {
- for (let t12 = 0; t12 < 3; ++t12)
- i12[t12] ? T4[t12] = 0 : T4[t12] = (r12 & 1 << t12) != 0 ? O6[t12] : z2[t12];
- e16(T4);
- }
- }
- for (let r12 = 0; r12 < 3; ++r12)
- t11[r12 + 0] -= this.localOrigin[r12], t11[r12 + 3] -= this.localOrigin[r12];
- return t11;
- }
- };
- var O6 = n3();
- var z2 = n3();
- var T4 = n3();
- var g5 = class {
- constructor(t11 = 0) {
- this.componentLocalOriginLength = 0, this._tmpVertex = n3(), this._mbs = _3(), this._obb = { center: n3(), halfSize: n11(), quaternion: null }, this._totalOffset = 0, this._offset = 0, this._resetOffset(t11);
- }
- _resetOffset(t11) {
- this._offset = t11, this._totalOffset = t11;
- }
- set offset(t11) {
- this._resetOffset(t11);
- }
- get offset() {
- return this._offset;
- }
- set componentOffset(t11) {
- this._totalOffset = this._offset + t11;
- }
- set localOrigin(t11) {
- this.componentLocalOriginLength = Math.sqrt(t11[0] * t11[0] + t11[1] * t11[1] + t11[2] * t11[2]);
- }
- applyToVertex(t11, s8, e16) {
- const i12 = t11, r12 = s8, a12 = e16 + this.componentLocalOriginLength, o12 = this._totalOffset / Math.sqrt(i12 * i12 + r12 * r12 + a12 * a12);
- return this._tmpVertex[0] = t11 + i12 * o12, this._tmpVertex[1] = s8 + r12 * o12, this._tmpVertex[2] = e16 + a12 * o12, this._tmpVertex;
- }
- applyToAabb(t11) {
- const s8 = t11[0], e16 = t11[1], i12 = t11[2] + this.componentLocalOriginLength, r12 = t11[3], a12 = t11[4], o12 = t11[5] + this.componentLocalOriginLength, h10 = s8 * r12 < 0 ? 0 : Math.min(Math.abs(s8), Math.abs(r12)), n14 = e16 * a12 < 0 ? 0 : Math.min(Math.abs(e16), Math.abs(a12)), f7 = i12 * o12 < 0 ? 0 : Math.min(Math.abs(i12), Math.abs(o12)), l10 = Math.sqrt(h10 * h10 + n14 * n14 + f7 * f7);
- if (l10 < this._totalOffset)
- return t11[0] -= s8 < 0 ? this._totalOffset : 0, t11[1] -= e16 < 0 ? this._totalOffset : 0, t11[2] -= i12 < 0 ? this._totalOffset : 0, t11[3] += r12 > 0 ? this._totalOffset : 0, t11[4] += a12 > 0 ? this._totalOffset : 0, t11[5] += o12 > 0 ? this._totalOffset : 0, t11;
- const m6 = Math.max(Math.abs(s8), Math.abs(r12)), b3 = Math.max(Math.abs(e16), Math.abs(a12)), _8 = Math.max(Math.abs(i12), Math.abs(o12)), c12 = Math.sqrt(m6 * m6 + b3 * b3 + _8 * _8), p5 = this._totalOffset / c12, u11 = this._totalOffset / l10;
- return t11[0] += s8 * (s8 > 0 ? p5 : u11), t11[1] += e16 * (e16 > 0 ? p5 : u11), t11[2] += i12 * (i12 > 0 ? p5 : u11), t11[3] += r12 * (r12 < 0 ? p5 : u11), t11[4] += a12 * (a12 < 0 ? p5 : u11), t11[5] += o12 * (o12 < 0 ? p5 : u11), t11;
- }
- applyToMbs(t11) {
- const s8 = Math.sqrt(t11[0] * t11[0] + t11[1] * t11[1] + t11[2] * t11[2]), e16 = this._totalOffset / s8;
- return this._mbs[0] = t11[0] + t11[0] * e16, this._mbs[1] = t11[1] + t11[1] * e16, this._mbs[2] = t11[2] + t11[2] * e16, this._mbs[3] = t11[3] + t11[3] * this._totalOffset / s8, this._mbs;
- }
- applyToObb(t11) {
- const s8 = t11.center, e16 = this._totalOffset / Math.sqrt(s8[0] * s8[0] + s8[1] * s8[1] + s8[2] * s8[2]);
- this._obb.center[0] = s8[0] + s8[0] * e16, this._obb.center[1] = s8[1] + s8[1] * e16, this._obb.center[2] = s8[2] + s8[2] * e16, S(this._obb.halfSize, t11.halfSize, t11.quaternion), u(this._obb.halfSize, this._obb.halfSize, t11.center);
- const i12 = 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] * i12, this._obb.halfSize[1] += this._obb.halfSize[1] * i12, this._obb.halfSize[2] += this._obb.halfSize[2] * i12, e5(this._obb.halfSize, this._obb.halfSize, t11.center), S2(I3, t11.quaternion), S(this._obb.halfSize, this._obb.halfSize, I3), 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 = t11.quaternion, this._obb;
- }
- };
- var x3 = class {
- constructor(t11 = 0) {
- this.offset = t11, this.sphere = _3(), this.tmpVertex = n3();
- }
- applyToVertex(t11, s8, e16) {
- const i12 = this.objectTransform.transform;
- let r12 = i12[0] * t11 + i12[4] * s8 + i12[8] * e16 + i12[12], a12 = i12[1] * t11 + i12[5] * s8 + i12[9] * e16 + i12[13], o12 = i12[2] * t11 + i12[6] * s8 + i12[10] * e16 + i12[14];
- const h10 = this.offset / Math.sqrt(r12 * r12 + a12 * a12 + o12 * o12);
- r12 += r12 * h10, a12 += a12 * h10, o12 += o12 * h10;
- const n14 = this.objectTransform.inverse;
- return this.tmpVertex[0] = n14[0] * r12 + n14[4] * a12 + n14[8] * o12 + n14[12], this.tmpVertex[1] = n14[1] * r12 + n14[5] * a12 + n14[9] * o12 + n14[13], this.tmpVertex[2] = n14[2] * r12 + n14[6] * a12 + n14[10] * o12 + n14[14], this.tmpVertex;
- }
- applyToMinMax(t11, s8) {
- const e16 = this.offset / Math.sqrt(t11[0] * t11[0] + t11[1] * t11[1] + t11[2] * t11[2]);
- t11[0] += t11[0] * e16, t11[1] += t11[1] * e16, t11[2] += t11[2] * e16;
- const i12 = this.offset / Math.sqrt(s8[0] * s8[0] + s8[1] * s8[1] + s8[2] * s8[2]);
- s8[0] += s8[0] * i12, s8[1] += s8[1] * i12, s8[2] += s8[2] * i12;
- }
- applyToAabb(t11) {
- const s8 = this.offset / Math.sqrt(t11[0] * t11[0] + t11[1] * t11[1] + t11[2] * t11[2]);
- t11[0] += t11[0] * s8, t11[1] += t11[1] * s8, t11[2] += t11[2] * s8;
- const e16 = this.offset / Math.sqrt(t11[3] * t11[3] + t11[4] * t11[4] + t11[5] * t11[5]);
- return t11[3] += t11[3] * e16, t11[4] += t11[4] * e16, t11[5] += t11[5] * e16, t11;
- }
- applyToBoundingSphere(t11) {
- const s8 = Math.sqrt(t11[0] * t11[0] + t11[1] * t11[1] + t11[2] * t11[2]), e16 = this.offset / s8;
- return this.sphere[0] = t11[0] + t11[0] * e16, this.sphere[1] = t11[1] + t11[1] * e16, this.sphere[2] = t11[2] + t11[2] * e16, this.sphere[3] = t11[3] + t11[3] * this.offset / s8, this.sphere;
- }
- };
- var S4 = new x3();
- function y2(s8) {
- return r(s8) ? (S4.offset = s8, S4) : null;
- }
- var q2 = new g5();
- var d4 = new v2();
- var I3 = e8();
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js
- function c9(t11, e16, f7, o12) {
- const r12 = f7.typedBuffer, s8 = f7.typedBufferStride, n14 = t11.length;
- o12 *= s8;
- for (let i12 = 0; i12 < n14; ++i12) {
- const f8 = 2 * t11[i12];
- r12[o12] = e16[f8], r12[o12 + 1] = e16[f8 + 1], o12 += s8;
- }
- }
- function l9(t11, e16, f7, o12, r12) {
- const s8 = f7.typedBuffer, n14 = f7.typedBufferStride, i12 = t11.length;
- if (o12 *= n14, r12 == null || r12 === 1)
- for (let c12 = 0; c12 < i12; ++c12) {
- const f8 = 3 * t11[c12];
- s8[o12] = e16[f8], s8[o12 + 1] = e16[f8 + 1], s8[o12 + 2] = e16[f8 + 2], o12 += n14;
- }
- else
- for (let c12 = 0; c12 < i12; ++c12) {
- const f8 = 3 * t11[c12];
- for (let t12 = 0; t12 < r12; ++t12)
- s8[o12] = e16[f8], s8[o12 + 1] = e16[f8 + 1], s8[o12 + 2] = e16[f8 + 2], o12 += n14;
- }
- }
- function d5(t11, e16, f7, o12, r12 = 1) {
- const s8 = f7.typedBuffer, n14 = f7.typedBufferStride, i12 = t11.length;
- if (o12 *= n14, r12 === 1)
- for (let c12 = 0; c12 < i12; ++c12) {
- const f8 = 4 * t11[c12];
- s8[o12] = e16[f8], s8[o12 + 1] = e16[f8 + 1], s8[o12 + 2] = e16[f8 + 2], s8[o12 + 3] = e16[f8 + 3], o12 += n14;
- }
- else
- for (let c12 = 0; c12 < i12; ++c12) {
- const f8 = 4 * t11[c12];
- for (let t12 = 0; t12 < r12; ++t12)
- s8[o12] = e16[f8], s8[o12 + 1] = e16[f8 + 1], s8[o12 + 2] = e16[f8 + 2], s8[o12 + 3] = e16[f8 + 3], o12 += n14;
- }
- }
- function p4(t11, e16, f7, o12, r12, s8 = 1) {
- if (!f7)
- return void l9(t11, e16, o12, r12, s8);
- const n14 = o12.typedBuffer, i12 = o12.typedBufferStride, c12 = t11.length, d6 = f7[0], u11 = f7[1], a12 = f7[2], p5 = f7[4], B4 = f7[5], y4 = f7[6], g7 = f7[8], h10 = f7[9], S5 = f7[10], b3 = f7[12], m6 = f7[13], z4 = f7[14];
- if (r12 *= i12, s8 === 1)
- for (let l10 = 0; l10 < c12; ++l10) {
- const f8 = 3 * t11[l10], o13 = e16[f8], s9 = e16[f8 + 1], c13 = e16[f8 + 2];
- n14[r12] = d6 * o13 + p5 * s9 + g7 * c13 + b3, n14[r12 + 1] = u11 * o13 + B4 * s9 + h10 * c13 + m6, n14[r12 + 2] = a12 * o13 + y4 * s9 + S5 * c13 + z4, r12 += i12;
- }
- else
- for (let l10 = 0; l10 < c12; ++l10) {
- const f8 = 3 * t11[l10], o13 = e16[f8], c13 = e16[f8 + 1], O7 = e16[f8 + 2], k3 = d6 * o13 + p5 * c13 + g7 * O7 + b3, F3 = u11 * o13 + B4 * c13 + h10 * O7 + m6, M3 = a12 * o13 + y4 * c13 + S5 * O7 + z4;
- for (let t12 = 0; t12 < s8; ++t12)
- n14[r12] = k3, n14[r12 + 1] = F3, n14[r12 + 2] = M3, r12 += i12;
- }
- }
- function B2(e16, f7, o12, r12, s8, n14 = 1) {
- if (!o12)
- return void l9(e16, f7, r12, s8, n14);
- const i12 = o12, c12 = r12.typedBuffer, d6 = r12.typedBufferStride, u11 = e16.length, a12 = i12[0], p5 = i12[1], B4 = i12[2], y4 = i12[4], g7 = i12[5], h10 = i12[6], S5 = i12[8], b3 = i12[9], m6 = i12[10], z4 = !G(i12), O7 = 1e-6, k3 = 1 - O7;
- if (s8 *= d6, n14 === 1)
- for (let t11 = 0; t11 < u11; ++t11) {
- const o13 = 3 * e16[t11], r13 = f7[o13], n15 = f7[o13 + 1], i13 = f7[o13 + 2];
- let l10 = a12 * r13 + y4 * n15 + S5 * i13, u12 = p5 * r13 + g7 * n15 + b3 * i13, F3 = B4 * r13 + h10 * n15 + m6 * i13;
- if (z4) {
- const t12 = l10 * l10 + u12 * u12 + F3 * F3;
- if (t12 < k3 && t12 > O7) {
- const e17 = 1 / Math.sqrt(t12);
- l10 *= e17, u12 *= e17, F3 *= e17;
- }
- }
- c12[s8 + 0] = l10, c12[s8 + 1] = u12, c12[s8 + 2] = F3, s8 += d6;
- }
- else
- for (let t11 = 0; t11 < u11; ++t11) {
- const o13 = 3 * e16[t11], r13 = f7[o13], i13 = f7[o13 + 1], l10 = f7[o13 + 2];
- let u12 = a12 * r13 + y4 * i13 + S5 * l10, F3 = p5 * r13 + g7 * i13 + b3 * l10, M3 = B4 * r13 + h10 * i13 + m6 * l10;
- if (z4) {
- const t12 = u12 * u12 + F3 * F3 + M3 * M3;
- if (t12 < k3 && t12 > O7) {
- const e17 = 1 / Math.sqrt(t12);
- u12 *= e17, F3 *= e17, M3 *= e17;
- }
- }
- for (let t12 = 0; t12 < n14; ++t12)
- c12[s8 + 0] = u12, c12[s8 + 1] = F3, c12[s8 + 2] = M3, s8 += d6;
- }
- }
- function y3(e16, f7, o12, r12, s8, n14 = 1) {
- if (!o12)
- return void d5(e16, f7, r12, s8, n14);
- const i12 = o12, c12 = r12.typedBuffer, l10 = r12.typedBufferStride, u11 = e16.length, a12 = i12[0], p5 = i12[1], B4 = i12[2], y4 = i12[4], g7 = i12[5], h10 = i12[6], S5 = i12[8], b3 = i12[9], m6 = i12[10], z4 = !G(i12), O7 = 1e-6, k3 = 1 - O7;
- if (s8 *= l10, n14 === 1)
- for (let t11 = 0; t11 < u11; ++t11) {
- const o13 = 4 * e16[t11], r13 = f7[o13], n15 = f7[o13 + 1], i13 = f7[o13 + 2], d6 = f7[o13 + 3];
- let u12 = a12 * r13 + y4 * n15 + S5 * i13, F3 = p5 * r13 + g7 * n15 + b3 * i13, M3 = B4 * r13 + h10 * n15 + m6 * i13;
- if (z4) {
- const t12 = u12 * u12 + F3 * F3 + M3 * M3;
- if (t12 < k3 && t12 > O7) {
- const e17 = 1 / Math.sqrt(t12);
- u12 *= e17, F3 *= e17, M3 *= e17;
- }
- }
- c12[s8 + 0] = u12, c12[s8 + 1] = F3, c12[s8 + 2] = M3, c12[s8 + 3] = d6, s8 += l10;
- }
- else
- for (let t11 = 0; t11 < u11; ++t11) {
- const o13 = 4 * e16[t11], r13 = f7[o13], i13 = f7[o13 + 1], d6 = f7[o13 + 2], u12 = f7[o13 + 3];
- let F3 = a12 * r13 + y4 * i13 + S5 * d6, M3 = p5 * r13 + g7 * i13 + b3 * d6, N3 = B4 * r13 + h10 * i13 + m6 * d6;
- if (z4) {
- const t12 = F3 * F3 + M3 * M3 + N3 * N3;
- if (t12 < k3 && t12 > O7) {
- const e17 = 1 / Math.sqrt(t12);
- F3 *= e17, M3 *= e17, N3 *= e17;
- }
- }
- for (let t12 = 0; t12 < n14; ++t12)
- c12[s8 + 0] = F3, c12[s8 + 1] = M3, c12[s8 + 2] = N3, c12[s8 + 3] = u12, s8 += l10;
- }
- }
- function g6(t11, e16, f7, o12, r12, s8 = 1) {
- const n14 = o12.typedBuffer, i12 = o12.typedBufferStride, c12 = t11.length;
- if (r12 *= i12, s8 === 1) {
- if (f7 === 4)
- for (let l10 = 0; l10 < c12; ++l10) {
- const f8 = 4 * t11[l10];
- n14[r12] = e16[f8], n14[r12 + 1] = e16[f8 + 1], n14[r12 + 2] = e16[f8 + 2], n14[r12 + 3] = e16[f8 + 3], r12 += i12;
- }
- else if (f7 === 3)
- for (let l10 = 0; l10 < c12; ++l10) {
- const f8 = 3 * t11[l10];
- n14[r12] = e16[f8], n14[r12 + 1] = e16[f8 + 1], n14[r12 + 2] = e16[f8 + 2], n14[r12 + 3] = 255, r12 += i12;
- }
- } else if (f7 === 4)
- for (let l10 = 0; l10 < c12; ++l10) {
- const f8 = 4 * t11[l10];
- for (let t12 = 0; t12 < s8; ++t12)
- n14[r12] = e16[f8], n14[r12 + 1] = e16[f8 + 1], n14[r12 + 2] = e16[f8 + 2], n14[r12 + 3] = e16[f8 + 3], r12 += i12;
- }
- else if (f7 === 3)
- for (let l10 = 0; l10 < c12; ++l10) {
- const f8 = 3 * t11[l10];
- for (let t12 = 0; t12 < s8; ++t12)
- n14[r12] = e16[f8], n14[r12 + 1] = e16[f8 + 1], n14[r12 + 2] = e16[f8 + 2], n14[r12 + 3] = 255, r12 += i12;
- }
- }
- function h8(t11, i12, l10, d6, u11, a12) {
- for (const h10 of i12.fieldNames) {
- const i13 = t11.vertexAttributes.get(h10), S5 = t11.indices.get(h10);
- if (i13 && S5)
- switch (h10) {
- case O3.POSITION: {
- e11(i13.size === 3);
- const t12 = u11.getField(h10, i3);
- t12 && p4(S5, i13.data, l10, t12, a12);
- break;
- }
- case O3.NORMAL: {
- e11(i13.size === 3);
- const t12 = u11.getField(h10, i3);
- t12 && B2(S5, i13.data, d6, t12, a12);
- break;
- }
- case O3.UV0: {
- e11(i13.size === 2);
- const t12 = u11.getField(h10, u2);
- t12 && c9(S5, i13.data, t12, a12);
- break;
- }
- case O3.COLOR: {
- e11(i13.size === 3 || i13.size === 4);
- const t12 = u11.getField(h10, x);
- t12 && g6(S5, i13.data, i13.size, t12, a12);
- break;
- }
- case O3.SYMBOLCOLOR: {
- e11(i13.size === 3 || i13.size === 4);
- const t12 = u11.getField(h10, x);
- t12 && g6(S5, i13.data, i13.size, t12, a12);
- break;
- }
- case O3.TANGENT: {
- e11(i13.size === 4);
- const t12 = u11.getField(h10, c);
- t12 && y3(S5, i13.data, d6, t12, a12);
- break;
- }
- }
- }
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ReloadableShaderModule.js
- var t8 = class {
- constructor(t11, o12) {
- this._module = t11, this._loadModule = o12;
- }
- get() {
- return this._module;
- }
- async reload() {
- return this._module = await this._loadModule(), this._module;
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js
- var e13 = class {
- constructor(i12, t11, e16) {
- this.release = e16, t11 && (this.initializeConfiguration(i12, t11), this._configuration = t11.snapshot()), this._program = this.initializeProgram(i12), this._pipeline = this.initializePipeline(i12.rctx.capabilities);
- }
- destroy() {
- this._program = s(this._program), this._pipeline = this._configuration = null;
- }
- reload(t11) {
- s(this._program), this._program = this.initializeProgram(t11), this._pipeline = this.initializePipeline(t11.rctx.capabilities);
- }
- get program() {
- return this._program;
- }
- get compiled() {
- return this.program.isCompiled;
- }
- get key() {
- return this._configuration.key;
- }
- get configuration() {
- return this._configuration;
- }
- bindPass(i12, t11) {
- this.program.bindPass(i12, t11);
- }
- bindDraw(i12, t11) {
- this.program.bindDraw(i12, t11), this.program.rebindTextures();
- }
- bindPipelineState(i12, t11 = null, e16) {
- i12.setPipelineState(this.getPipelineState(t11, e16));
- }
- ensureAttributeLocations(i12) {
- this.program.assertCompatibleVertexAttributeLocations(i12);
- }
- get primitiveType() {
- return E2.TRIANGLES;
- }
- getPipelineState(i12, t11) {
- return this._pipeline;
- }
- initializeConfiguration(i12, t11) {
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Program.js
- var o10 = class {
- constructor(t11, e16, o12) {
- this._context = t11, this._locations = o12, this._textures = new Map(), this._freeTextureUnits = new n({ deallocator: null }), this._glProgram = t11.programCache.acquire(e16.generate("vertex"), e16.generate("fragment"), o12), this._glProgram.stop = () => {
- throw new Error("Wrapped _glProgram used directly");
- }, this.bindPass = e16.generateBind(a8.Pass, this), this.bindDraw = e16.generateBind(a8.Draw, this), this._fragmentUniforms = u4() ? e16.fragmentUniforms : null;
- }
- dispose() {
- this._glProgram.dispose();
- }
- get glName() {
- return this._glProgram.glName;
- }
- get isCompiled() {
- return this._glProgram.isCompiled;
- }
- setUniform1b(t11, e16) {
- this._glProgram.setUniform1i(t11, e16 ? 1 : 0);
- }
- setUniform1i(t11, e16) {
- this._glProgram.setUniform1i(t11, e16);
- }
- setUniform1f(t11, e16) {
- this._glProgram.setUniform1f(t11, e16);
- }
- setUniform2f(t11, e16, r12) {
- this._glProgram.setUniform2f(t11, e16, r12);
- }
- setUniform2fv(t11, e16) {
- this._glProgram.setUniform2fv(t11, e16);
- }
- setUniform3f(t11, e16, r12, i12) {
- this._glProgram.setUniform3f(t11, e16, r12, i12);
- }
- setUniform3fv(t11, e16) {
- this._glProgram.setUniform3fv(t11, e16);
- }
- setUniform4f(t11, e16, r12, i12, s8) {
- this._glProgram.setUniform4f(t11, e16, r12, i12, s8);
- }
- setUniform4fv(t11, e16) {
- this._glProgram.setUniform4fv(t11, e16);
- }
- setUniformMatrix3fv(t11, e16) {
- this._glProgram.setUniformMatrix3fv(t11, e16);
- }
- setUniformMatrix4fv(t11, e16) {
- this._glProgram.setUniformMatrix4fv(t11, e16);
- }
- setUniform1fv(t11, e16) {
- this._glProgram.setUniform1fv(t11, e16);
- }
- setUniform1iv(t11, e16) {
- this._glProgram.setUniform1iv(t11, e16);
- }
- setUniform2iv(t11, e16) {
- this._glProgram.setUniform3iv(t11, e16);
- }
- setUniform3iv(t11, e16) {
- this._glProgram.setUniform3iv(t11, e16);
- }
- setUniform4iv(t11, e16) {
- this._glProgram.setUniform4iv(t11, e16);
- }
- assertCompatibleVertexAttributeLocations(t11) {
- t11.locations !== this._locations && console.error("VertexAttributeLocations are incompatible");
- }
- stop() {
- this._textures.clear(), this._freeTextureUnits.clear();
- }
- bindTexture(e16, r12) {
- if (t(r12) || r12.glName == null) {
- const t11 = this._textures.get(e16);
- return t11 && (this._context.bindTexture(null, t11.unit), this._freeTextureUnit(t11), this._textures.delete(e16)), null;
- }
- let i12 = this._textures.get(e16);
- return i12 == null ? (i12 = this._allocTextureUnit(r12), this._textures.set(e16, i12)) : i12.texture = r12, this._context.useProgram(this), this.setUniform1i(e16, i12.unit), this._context.bindTexture(r12, i12.unit), i12.unit;
- }
- rebindTextures() {
- this._context.useProgram(this), this._textures.forEach((t11, e16) => {
- this._context.bindTexture(t11.texture, t11.unit), this.setUniform1i(e16, t11.unit);
- }), r(this._fragmentUniforms) && this._fragmentUniforms.forEach((t11) => {
- t11.type !== "sampler2D" && t11.type !== "samplerCube" || this._textures.has(t11.name) || console.error(`Texture sampler ${t11.name} has no bound texture`);
- });
- }
- _allocTextureUnit(t11) {
- return { texture: t11, unit: this._freeTextureUnits.length === 0 ? this._textures.size : this._freeTextureUnits.pop() };
- }
- _freeTextureUnit(t11) {
- this._freeTextureUnits.push(t11.unit);
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/StencilUtils.js
- var i10 = { func: I.LESS };
- var s7 = { func: I.ALWAYS };
- var e14 = { mask: 255 };
- var f6 = { function: { func: I.ALWAYS, ref: a7.OutlineVisualElementMask, mask: a7.OutlineVisualElementMask }, operation: { fail: O4.KEEP, zFail: O4.KEEP, zPass: O4.ZERO } };
- var o11 = { function: { func: I.ALWAYS, ref: a7.OutlineVisualElementMask, mask: a7.OutlineVisualElementMask }, operation: { fail: O4.KEEP, zFail: O4.KEEP, zPass: O4.REPLACE } };
- var P3 = { function: { func: I.EQUAL, ref: a7.OutlineVisualElementMask, mask: a7.OutlineVisualElementMask }, operation: { fail: O4.KEEP, zFail: O4.KEEP, zPass: O4.KEEP } };
- var m5 = { function: { func: I.NOTEQUAL, ref: a7.OutlineVisualElementMask, mask: a7.OutlineVisualElementMask }, operation: { fail: O4.KEEP, zFail: O4.KEEP, zPass: O4.KEEP } };
- // node_modules/@arcgis/core/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js
- var F2 = class extends f4 {
- 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 = n3(), 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 = N.Less, this.textureAlphaMode = C2.Blend, this.textureAlphaCutoff = o8, this.textureAlphaPremultiplied = false, this.hasOccludees = false, this.renderOccluded = h4.Occlude;
- }
- };
- var E8 = class extends e13 {
- initializeConfiguration(e16, t11) {
- t11.spherical = e16.viewingMode === l3.Global, t11.doublePrecisionRequiresObfuscation = r10(e16.rctx), t11.textureCoordinateType = t11.hasColorTexture || t11.hasMetalnessAndRoughnessTexture || t11.hasEmissionTexture || t11.hasOcclusionTexture || t11.hasNormalTexture ? o7.Default : o7.None;
- }
- initializeProgram(e16) {
- return this._initializeProgram(e16, E8.shader);
- }
- _initializeProgram(e16, t11) {
- const i12 = t11.get().build(this.configuration);
- return new o10(e16.rctx, i12, E3);
- }
- _convertDepthTestFunction(e16) {
- return e16 === N.Lequal ? I.LEQUAL : I.LESS;
- }
- _setPipeline(e16, t11) {
- const i12 = this.configuration, s8 = e16 === O5.NONE, r12 = e16 === O5.FrontFace;
- return W({ blending: i12.output !== o6.Color && i12.output !== o6.Alpha || !i12.transparent ? null : s8 ? c6 : E4(e16), culling: V4(i12) && h5(i12.cullFace), depthTest: { func: l5(e16, this._convertDepthTestFunction(i12.customDepthTest)) }, depthWrite: s8 || r12 ? i12.writeDepth && a9 : null, colorWrite: c5, stencilWrite: i12.hasOccludees ? e14 : null, stencilTest: i12.hasOccludees ? t11 ? o11 : f6 : null, polygonOffset: s8 || r12 ? null : i7(i12.enableOffset) });
- }
- initializePipeline() {
- return this._occludeePipelineState = this._setPipeline(this.configuration.transparencyPassType, true), this._setPipeline(this.configuration.transparencyPassType, false);
- }
- getPipelineState(e16, t11) {
- return t11 ? this._occludeePipelineState : super.getPipelineState(e16, t11);
- }
- };
- function V4(e16) {
- return e16.cullFace !== n9.None || !e16.hasSlicePlane && (!e16.transparent && !e16.doubleSidedMode);
- }
- E8.shader = new t8(W2, () => import("./DefaultMaterial.glsl-ORAFMP5K.js"));
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js
- var t9 = class {
- constructor() {
- this._key = "", this._keyDirty = false, this._parameterBits = this._parameterBits ? this._parameterBits.map(() => 0) : [], this._parameterNames || (this._parameterNames = []);
- }
- get key() {
- return this._keyDirty && (this._keyDirty = false, this._key = String.fromCharCode.apply(String, this._parameterBits)), this._key;
- }
- snapshot() {
- const t11 = this._parameterNames, e16 = { key: this.key };
- for (const r12 of t11)
- e16[r12] = this[r12];
- return e16;
- }
- };
- function e15(t11 = {}) {
- return (e16, r12) => {
- if (e16._parameterNames = e16._parameterNames ?? [], e16._parameterNames.push(r12), t11.constValue != null)
- Object.defineProperty(e16, r12, { get: () => t11.constValue });
- else {
- const s8 = e16._parameterNames.length - 1, a12 = t11.count || 2, i12 = Math.ceil(Math.log2(a12)), o12 = e16._parameterBits ?? [0];
- let h10 = 0;
- for (; o12[h10] + i12 > 16; )
- h10++, h10 >= o12.length && o12.push(0);
- e16._parameterBits = o12;
- const n14 = o12[h10], m6 = (1 << i12) - 1 << n14;
- o12[h10] += i12, Object.defineProperty(e16, r12, { get() {
- return this[s8];
- }, set(t12) {
- if (this[s8] !== t12 && (this[s8] = t12, this._keyDirty = true, this._parameterBits[h10] = this._parameterBits[h10] & ~m6 | +t12 << n14 & m6, typeof t12 != "number" && typeof t12 != "boolean"))
- throw "Configuration value for " + r12 + " must be boolean or number, got " + typeof t12;
- } });
- }
- };
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js
- var i11 = class extends t9 {
- };
- e([e15({ constValue: true })], i11.prototype, "hasSliceHighlight", void 0), e([e15({ constValue: false })], i11.prototype, "hasSliceInVertexProgram", void 0), e([e15({ constValue: false })], i11.prototype, "instancedDoublePrecision", void 0), e([e15({ constValue: false })], i11.prototype, "isGround", void 0), e([e15({ constValue: a8.Pass })], i11.prototype, "pbrTextureBindType", void 0);
- // node_modules/@arcgis/core/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js
- var c11 = class extends i11 {
- constructor() {
- super(...arguments), this.output = o6.Color, this.alphaDiscardMode = C2.Opaque, this.doubleSidedMode = i6.None, this.pbrMode = l4.Disabled, this.cullFace = n9.None, this.transparencyPassType = O5.NONE, this.normalType = i5.Attribute, this.textureCoordinateType = o7.None, this.customDepthTest = N.Less, this.spherical = false, this.hasVertexColors = false, this.hasSymbolColors = false, this.hasVerticalOffset = false, this.hasSlicePlane = false, this.hasSliceHighlight = true, this.hasColorTexture = false, this.hasMetalnessAndRoughnessTexture = 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.instancedDoublePrecision = false, this.doublePrecisionRequiresObfuscation = false, this.writeDepth = true, this.transparent = false, this.enableOffset = true, this.cullAboveGround = false, this.snowCover = false;
- }
- };
- e([e15({ count: o6.COUNT })], c11.prototype, "output", void 0), e([e15({ count: C2.COUNT })], c11.prototype, "alphaDiscardMode", void 0), e([e15({ count: i6.COUNT })], c11.prototype, "doubleSidedMode", void 0), e([e15({ count: l4.COUNT })], c11.prototype, "pbrMode", void 0), e([e15({ count: n9.COUNT })], c11.prototype, "cullFace", void 0), e([e15({ count: O5.COUNT })], c11.prototype, "transparencyPassType", void 0), e([e15({ count: i5.COUNT })], c11.prototype, "normalType", void 0), e([e15({ count: o7.COUNT })], c11.prototype, "textureCoordinateType", void 0), e([e15({ count: N.COUNT })], c11.prototype, "customDepthTest", void 0), e([e15()], c11.prototype, "spherical", void 0), e([e15()], c11.prototype, "hasVertexColors", void 0), e([e15()], c11.prototype, "hasSymbolColors", void 0), e([e15()], c11.prototype, "hasVerticalOffset", void 0), e([e15()], c11.prototype, "hasSlicePlane", void 0), e([e15()], c11.prototype, "hasSliceHighlight", void 0), e([e15()], c11.prototype, "hasColorTexture", void 0), e([e15()], c11.prototype, "hasMetalnessAndRoughnessTexture", void 0), e([e15()], c11.prototype, "hasEmissionTexture", void 0), e([e15()], c11.prototype, "hasOcclusionTexture", void 0), e([e15()], c11.prototype, "hasNormalTexture", void 0), e([e15()], c11.prototype, "hasScreenSizePerspective", void 0), e([e15()], c11.prototype, "hasVertexTangents", void 0), e([e15()], c11.prototype, "hasOccludees", void 0), e([e15()], c11.prototype, "hasMultipassTerrain", void 0), e([e15()], c11.prototype, "hasModelTransformation", void 0), e([e15()], c11.prototype, "offsetBackfaces", void 0), e([e15()], c11.prototype, "vvSize", void 0), e([e15()], c11.prototype, "vvColor", void 0), e([e15()], c11.prototype, "receiveShadows", void 0), e([e15()], c11.prototype, "receiveAmbientOcclusion", void 0), e([e15()], c11.prototype, "textureAlphaPremultiplied", void 0), e([e15()], c11.prototype, "instanced", void 0), e([e15()], c11.prototype, "instancedColor", void 0), e([e15()], c11.prototype, "instancedDoublePrecision", void 0), e([e15()], c11.prototype, "doublePrecisionRequiresObfuscation", void 0), e([e15()], c11.prototype, "writeDepth", void 0), e([e15()], c11.prototype, "transparent", void 0), e([e15()], c11.prototype, "enableOffset", void 0), e([e15()], c11.prototype, "cullAboveGround", void 0), e([e15()], c11.prototype, "snowCover", void 0), e([e15({ constValue: true })], c11.prototype, "hasVvInstancing", void 0), e([e15({ constValue: false })], c11.prototype, "useCustomDTRExponentForWater", void 0), e([e15({ constValue: false })], c11.prototype, "supportsTextureAtlas", void 0), e([e15({ constValue: true })], c11.prototype, "useFillLights", void 0);
- // node_modules/@arcgis/core/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js
- var t10 = class extends E8 {
- initializeConfiguration(i12, s8) {
- super.initializeConfiguration(i12, s8), s8.hasMetalnessAndRoughnessTexture = false, s8.hasEmissionTexture = false, s8.hasOcclusionTexture = false, s8.hasNormalTexture = false, s8.hasModelTransformation = false, s8.normalType = i5.Attribute, s8.doubleSidedMode = i6.WindingOrder, s8.hasVertexTangents = false;
- }
- initializeProgram(e16) {
- return this._initializeProgram(e16, t10.shader);
- }
- };
- t10.shader = new t8(V3, () => import("./RealisticTree.glsl-Z3HAPVGH.js"));
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultMaterial.js
- var R = class extends d {
- constructor(e16) {
- super(e16, _7), this.supportsEdges = true, this.techniqueConfig = new c11(), this.vertexBufferLayout = j3(this.parameters), this.instanceBufferLayout = e16.instanced ? B3(this.parameters) : null;
- }
- isVisibleInPass(e16) {
- return e16 !== A5.MATERIAL_DEPTH_SHADOWMAP_ALL && e16 !== A5.MATERIAL_DEPTH_SHADOWMAP_DEFAULT && e16 !== A5.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT || this.parameters.castShadows;
- }
- isVisible() {
- const t11 = this.parameters;
- if (!super.isVisible() || t11.layerOpacity === 0)
- return false;
- const { instanced: r12, hasVertexColors: s8, hasSymbolColors: i12, vvColorEnabled: a12 } = t11, n14 = r(r12) && r12.includes("color"), o12 = t11.colorMixMode === "replace", h10 = t11.opacity > 0, c12 = t11.externalColor && t11.externalColor[3] > 0;
- return s8 && (n14 || a12 || i12) ? !!o12 || h10 : s8 ? o12 ? c12 : h10 : n14 || a12 || i12 ? !!o12 || h10 : o12 ? c12 : h10;
- }
- getConfiguration(t11, r12) {
- return this.techniqueConfig.output = t11, this.techniqueConfig.hasNormalTexture = !!this.parameters.normalTextureId, this.techniqueConfig.hasColorTexture = !!this.parameters.textureId, this.techniqueConfig.hasVertexTangents = this.parameters.hasVertexTangents, this.techniqueConfig.instanced = !!this.parameters.instanced, this.techniqueConfig.instancedDoublePrecision = this.parameters.instancedDoublePrecision, this.techniqueConfig.vvSize = this.parameters.vvSizeEnabled, this.techniqueConfig.hasVerticalOffset = r(this.parameters.verticalOffset), this.techniqueConfig.hasScreenSizePerspective = r(this.parameters.screenSizePerspective), this.techniqueConfig.hasSlicePlane = this.parameters.hasSlicePlane, this.techniqueConfig.hasSliceHighlight = this.parameters.hasSliceHighlight, this.techniqueConfig.alphaDiscardMode = this.parameters.textureAlphaMode, this.techniqueConfig.normalType = this.parameters.normals === "screenDerivative" ? i5.ScreenDerivative : i5.Attribute, this.techniqueConfig.transparent = this.parameters.transparent, this.techniqueConfig.writeDepth = this.parameters.writeDepth, r(this.parameters.customDepthTest) && (this.techniqueConfig.customDepthTest = this.parameters.customDepthTest), this.techniqueConfig.hasOccludees = this.parameters.hasOccludees, this.techniqueConfig.cullFace = this.parameters.hasSlicePlane ? n9.None : this.parameters.cullFace, this.techniqueConfig.hasMultipassTerrain = r12.multipassTerrain.enabled, this.techniqueConfig.cullAboveGround = r12.multipassTerrain.cullAboveGround, this.techniqueConfig.hasModelTransformation = r(this.parameters.modelTransformation), t11 !== o6.Color && t11 !== o6.Alpha || (this.techniqueConfig.hasVertexColors = this.parameters.hasVertexColors, this.techniqueConfig.hasSymbolColors = this.parameters.hasSymbolColors, this.parameters.treeRendering ? this.techniqueConfig.doubleSidedMode = i6.WindingOrder : this.techniqueConfig.doubleSidedMode = this.parameters.doubleSided && this.parameters.doubleSidedType === "normal" ? i6.View : this.parameters.doubleSided && this.parameters.doubleSidedType === "winding-order" ? i6.WindingOrder : i6.None, this.techniqueConfig.instancedColor = r(this.parameters.instanced) && this.parameters.instanced.includes("color"), this.techniqueConfig.receiveShadows = this.parameters.receiveShadows && this.parameters.shadowMappingEnabled, this.techniqueConfig.receiveAmbientOcclusion = !!r12.ssaoHelper.ready && this.parameters.receiveSSAO, this.techniqueConfig.vvColor = this.parameters.vvColorEnabled, this.techniqueConfig.textureAlphaPremultiplied = !!this.parameters.textureAlphaPremultiplied, this.techniqueConfig.pbrMode = this.parameters.usePBR ? this.parameters.isSchematic ? l4.Schematic : l4.Normal : l4.Disabled, this.techniqueConfig.hasMetalnessAndRoughnessTexture = !!this.parameters.metallicRoughnessTextureId, this.techniqueConfig.hasEmissionTexture = !!this.parameters.emissiveTextureId, this.techniqueConfig.hasOcclusionTexture = !!this.parameters.occlusionTextureId, this.techniqueConfig.offsetBackfaces = !(!this.parameters.transparent || !this.parameters.offsetTransparentBackfaces), this.techniqueConfig.transparencyPassType = r12.transparencyPassType, this.techniqueConfig.enableOffset = r12.camera.relativeElevation < _2, this.techniqueConfig.snowCover = this.hasSnowCover(r12)), this.techniqueConfig;
- }
- hasSnowCover(t11) {
- return r(t11.weather) && t11.weatherVisible && t11.weather.type === "snowy" && t11.weather.snowCover === "enabled";
- }
- intersect(c12, u11, p5, m6, f7, d6, g7) {
- if (r(this.parameters.verticalOffset)) {
- const e16 = m6.camera;
- o2(z3, p5[12], p5[13], p5[14]);
- let c13 = null;
- switch (m6.viewingMode) {
- case l3.Global:
- c13 = z(U2, z3);
- break;
- case l3.Local:
- c13 = r3(U2, G3);
- }
- let u12 = 0;
- const g8 = e5(k, z3, e16.eye), T6 = s4(g8), C4 = q(g8, g8, 1 / T6);
- let v4 = null;
- this.parameters.screenSizePerspective && (v4 = P(c13, C4)), u12 += L4(e16, T6, this.parameters.verticalOffset, v4, this.parameters.screenSizePerspective), q(c13, c13, u12), O(W3, c13, m6.transform.inverseRotation), f7 = e5(V5, f7, W3), d6 = e5(H, d6, W3);
- }
- x2(c12, u11, m6, f7, d6, y2(m6.verticalOffset), g7);
- }
- requiresSlot(e16) {
- return e16 === (this.parameters.transparent ? this.parameters.writeDepth ? E7.TRANSPARENT_MATERIAL : E7.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL : E7.OPAQUE_MATERIAL) || e16 === E7.DRAPED_MATERIAL;
- }
- createGLMaterial(e16) {
- return e16.output === o6.Color || e16.output === o6.Alpha || e16.output === o6.Depth || e16.output === o6.Normal || e16.output === o6.Shadow || e16.output === o6.Highlight ? new w4(e16) : null;
- }
- createBufferWriter() {
- return new N2(this.vertexBufferLayout, this.instanceBufferLayout);
- }
- };
- var w4 = class extends h3 {
- constructor(e16) {
- super({ ...e16, ...e16.material.parameters });
- }
- _updateParameters(e16) {
- const r12 = this._material.parameters;
- this.updateTexture(r12.textureId);
- const s8 = e16.camera.viewInverseTransposeMatrix;
- return o2(r12.origin, s8[3], s8[7], s8[11]), this._material.setParameters(this.textureBindParameters), this.ensureTechnique(r12.treeRendering ? t10 : E8, e16);
- }
- _updateShadowState(e16) {
- e16.shadowMap.enabled !== this._material.parameters.shadowMappingEnabled && this._material.setParameters({ shadowMappingEnabled: e16.shadowMap.enabled });
- }
- _updateOccludeeState(e16) {
- e16.hasOccludees !== this._material.parameters.hasOccludees && this._material.setParameters({ hasOccludees: e16.hasOccludees });
- }
- beginSlot(e16) {
- return this._output !== o6.Color && this._output !== o6.Alpha || (this._updateShadowState(e16), this._updateOccludeeState(e16)), this._updateParameters(e16);
- }
- };
- var D4 = class extends F2 {
- constructor() {
- super(...arguments), this.initTextureTransparent = false, this.treeRendering = false, this.hasVertexTangents = false;
- }
- };
- var _7 = new D4();
- var N2 = class {
- constructor(e16, t11) {
- this.vertexBufferLayout = e16, this.instanceBufferLayout = t11;
- }
- allocate(e16) {
- return this.vertexBufferLayout.createBuffer(e16);
- }
- elementCount(e16) {
- return e16.indices.get(O3.POSITION).length;
- }
- write(e16, t11, r12, s8) {
- h8(t11, this.vertexBufferLayout, e16.transformation, e16.invTranspTransformation, r12, s8);
- }
- };
- function j3(e16) {
- const t11 = e16.textureId || e16.normalTextureId || e16.metallicRoughnessTextureId || e16.emissiveTextureId || e16.occlusionTextureId, r12 = T().vec3f(O3.POSITION).vec3f(O3.NORMAL);
- return e16.hasVertexTangents && r12.vec4f(O3.TANGENT), t11 && r12.vec2f(O3.UV0), e16.hasVertexColors && r12.vec4u8(O3.COLOR), e16.hasSymbolColors && r12.vec4u8(O3.SYMBOLCOLOR), r12;
- }
- function B3(t11) {
- let r12 = T();
- return r12 = t11.instancedDoublePrecision ? r12.vec3f(O3.MODELORIGINHI).vec3f(O3.MODELORIGINLO).mat3f(O3.MODEL).mat3f(O3.MODELNORMAL) : r12.mat4f(O3.MODEL).mat4f(O3.MODELNORMAL), r(t11.instanced) && t11.instanced.includes("color") && (r12 = r12.vec4f(O3.INSTANCECOLOR)), r(t11.instanced) && t11.instanced.includes("featureAttribute") && (r12 = r12.vec4f(O3.INSTANCEFEATUREATTRIBUTE)), r12;
- }
- var V5 = n3();
- var H = n3();
- var G3 = r2(0, 0, 1);
- var U2 = n3();
- var W3 = n3();
- var z3 = n3();
- var k = n3();
- // node_modules/@arcgis/core/views/3d/layers/graphics/wosrLoader.js
- var b2 = s2.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");
- async function w5(e16, t11) {
- const r12 = await h9(e16, t11);
- return { resource: r12, textures: await P4(r12.textureDefinitions, t11) };
- }
- async function h9(r12, n14) {
- const i12 = r(n14) && n14.streamDataRequester;
- if (i12)
- return v3(r12, i12, n14);
- const u11 = await a5(U(r12, e2(n14)));
- if (u11.ok === true)
- return u11.value.data;
- w(u11.error), j4(u11.error);
- }
- async function v3(e16, r12, n14) {
- const a12 = await a5(r12.request(e16, "json", n14));
- if (a12.ok === true)
- return a12.value;
- w(a12.error), j4(a12.error.details.url);
- }
- function j4(e16) {
- throw new s3("", `Request for object resource failed: ${e16}`);
- }
- function A6(e16) {
- const t11 = e16.params, r12 = t11.topology;
- let n14 = true;
- switch (t11.vertexAttributes || (b2.warn("Geometry must specify vertex attributes"), n14 = false), t11.topology) {
- case "PerAttributeArray":
- break;
- case "Indexed":
- case null:
- case void 0: {
- const e17 = t11.faces;
- if (e17) {
- if (t11.vertexAttributes)
- for (const r13 in t11.vertexAttributes) {
- const t12 = e17[r13];
- t12 && t12.values ? (t12.valueType != null && t12.valueType !== "UInt32" && (b2.warn(`Unsupported indexed geometry indices type '${t12.valueType}', only UInt32 is currently supported`), n14 = false), t12.valuesPerElement != null && t12.valuesPerElement !== 1 && (b2.warn(`Unsupported indexed geometry values per element '${t12.valuesPerElement}', only 1 is currently supported`), n14 = false)) : (b2.warn(`Indexed geometry does not specify face indices for '${r13}' attribute`), n14 = false);
- }
- } else
- b2.warn("Indexed geometries must specify faces"), n14 = false;
- break;
- }
- default:
- b2.warn(`Unsupported topology '${r12}'`), n14 = false;
- }
- e16.params.material || (b2.warn("Geometry requires material"), n14 = false);
- const a12 = e16.params.vertexAttributes;
- for (const s8 in a12) {
- a12[s8].values || (b2.warn("Geometries with externally defined attributes are not yet supported"), n14 = false);
- }
- return n14;
- }
- function M2(e16, t11) {
- const r12 = [], n14 = [], s8 = [], o12 = [], l10 = e16.resource, c12 = r8.parse(l10.version || "1.0", "wosr");
- k2.validate(c12);
- const p5 = l10.model.name, f7 = l10.model.geometries, x4 = l10.materialDefinitions, b3 = e16.textures;
- let w6 = 0;
- const h10 = new Map();
- for (let i12 = 0; i12 < f7.length; i12++) {
- const e17 = f7[i12];
- if (!A6(e17))
- continue;
- const l11 = T5(e17), c13 = e17.params.vertexAttributes, p6 = [];
- for (const t12 in c13) {
- const e18 = c13[t12], r13 = e18.values;
- p6.push([t12, { data: r13, size: e18.valuesPerElement, exclusive: true }]);
- }
- const v4 = [];
- if (e17.params.topology !== "PerAttributeArray") {
- const t12 = e17.params.faces;
- for (const e18 in t12)
- v4.push([e18, new Uint32Array(t12[e18].values)]);
- }
- const j5 = b3 && b3[l11.texture];
- if (j5 && !h10.has(l11.texture)) {
- const { image: e18, params: t12 } = j5, r13 = new L5(e18, t12);
- o12.push(r13), h10.set(l11.texture, r13);
- }
- const M3 = h10.get(l11.texture), U4 = M3 ? M3.id : void 0;
- let P5 = s8[l11.material] ? s8[l11.material][l11.texture] : null;
- if (!P5) {
- const e18 = x4[l11.material.substring(l11.material.lastIndexOf("/") + 1)].params;
- e18.transparency === 1 && (e18.transparency = 0);
- const r13 = j5 && j5.alphaChannelUsage, n15 = e18.transparency > 0 || r13 === "transparency" || r13 === "maskAndTransparency", o13 = j5 ? I4(j5.alphaChannelUsage) : void 0, i13 = { ambient: e4(e18.diffuse), diffuse: e4(e18.diffuse), opacity: 1 - (e18.transparency || 0), transparent: n15, textureAlphaMode: o13, textureAlphaCutoff: 0.33, textureId: U4, initTextureTransparent: true, doubleSided: true, cullFace: n9.None, colorMixMode: e18.externalColorMixMode || "tint", textureAlphaPremultiplied: !!j5 && !!j5.params.preMultiplyAlpha };
- r(t11) && t11.materialParamsMixin && Object.assign(i13, t11.materialParamsMixin), P5 = new R(i13), s8[l11.material] || (s8[l11.material] = {}), s8[l11.material][l11.texture] = P5;
- }
- n14.push(P5);
- const k3 = new g2(p6, v4);
- w6 += v4.position ? v4.position.length : 0, r12.push(k3);
- }
- return { name: p5, stageResources: { textures: o12, materials: n14, geometries: r12 }, pivotOffset: l10.model.pivotOffset, boundingBox: U3(r12), numberOfVertices: w6, lodThreshold: null };
- }
- function U3(e16) {
- const t11 = B();
- return e16.forEach((e17) => {
- const r12 = e17.boundingInfo;
- r(r12) && (h2(t11, r12.getBBMin()), h2(t11, r12.getBBMax()));
- }), t11;
- }
- async function P4(e16, t11) {
- const r12 = [];
- for (const o12 in e16) {
- const n15 = e16[o12], s9 = n15.images[0].data;
- if (!s9) {
- b2.warn("Externally referenced texture data is not yet supported");
- continue;
- }
- const i12 = n15.encoding + ";base64," + s9, u11 = "/textureDefinitions/" + o12, l10 = n15.channels === "rgba" ? n15.alphaChannelUsage || "transparency" : "none", c12 = { noUnpackFlip: true, wrap: { s: D.REPEAT, t: D.REPEAT }, preMultiplyAlpha: I4(l10) !== C2.Opaque }, m6 = r(t11) && t11.disableTextures ? Promise.resolve(null) : t6(i12, t11);
- r12.push(m6.then((e17) => ({ refId: u11, image: e17, params: c12, alphaChannelUsage: l10 })));
- }
- const n14 = await Promise.all(r12), s8 = {};
- for (const a12 of n14)
- s8[a12.refId] = a12;
- return s8;
- }
- function I4(e16) {
- switch (e16) {
- case "mask":
- return C2.Mask;
- case "maskAndTransparency":
- return C2.MaskBlend;
- case "none":
- return C2.Opaque;
- default:
- return C2.Blend;
- }
- }
- function T5(e16) {
- const t11 = e16.params;
- return { id: 1, material: t11.material, texture: t11.texture, region: t11.texture };
- }
- var k2 = new r8(1, 2, "wosr");
- // node_modules/@arcgis/core/views/3d/layers/graphics/objectResourceUtils.js
- async function J(s8, o12) {
- const i12 = X2(a6(s8));
- if (i12.fileType === "wosr") {
- const e16 = await (o12.cache ? o12.cache.loadWOSR(i12.url, o12) : w5(i12.url, o12)), t11 = M2(e16, o12);
- return { lods: [t11], referenceBoundingBox: t11.boundingBox, isEsriSymbolResource: false, isWosr: true, remove: e16.remove };
- }
- const a12 = await (o12.cache ? o12.cache.loadGLTF(i12.url, o12, o12.usePBR) : c2(new n7(o12.streamDataRequester), i12.url, o12, o12.usePBR)), u11 = m(a12.model.meta, "ESRI_proxyEllipsoid");
- a12.meta.isEsriSymbolResource && r(u11) && a12.meta.uri.includes("/RealisticTrees/") && te(a12, u11);
- const n14 = a12.meta.isEsriSymbolResource ? { usePBR: o12.usePBR, isSchematic: false, treeRendering: !!a12.customMeta.esriTreeRendering, mrrFactors: [0, 1, 0.2] } : { usePBR: o12.usePBR, isSchematic: false, treeRendering: false, mrrFactors: [0, 1, 0.5] }, l10 = { ...o12.materialParamsMixin, treeRendering: !!a12.customMeta.esriTreeRendering };
- if (i12.specifiedLodIndex != null) {
- const e16 = Y2(a12, n14, l10, i12.specifiedLodIndex);
- let t11 = e16[0].boundingBox;
- if (i12.specifiedLodIndex !== 0) {
- t11 = Y2(a12, n14, l10, 0)[0].boundingBox;
- }
- return { lods: e16, referenceBoundingBox: t11, isEsriSymbolResource: a12.meta.isEsriSymbolResource, isWosr: false, remove: a12.remove };
- }
- const c12 = Y2(a12, n14, l10);
- return { lods: c12, referenceBoundingBox: c12[0].boundingBox, isEsriSymbolResource: a12.meta.isEsriSymbolResource, isWosr: false, remove: a12.remove };
- }
- function X2(e16) {
- const t11 = e16.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);
- if (t11)
- return { fileType: "gltf", url: t11[1], specifiedLodIndex: t11[4] != null ? Number(t11[4]) : null };
- return e16.match(/(.*\.(json|json\.gz))$/) ? { fileType: "wosr", url: e16, specifiedLodIndex: null } : { fileType: "unknown", url: e16, specifiedLodIndex: null };
- }
- function Y2(e16, t11, s8, a12) {
- const u11 = e16.model, n14 = e6(), l10 = new Array(), c12 = new Map(), m6 = new Map();
- return u11.lods.forEach((e17, i12) => {
- if (a12 !== void 0 && i12 !== a12)
- return;
- const d6 = { name: e17.name, stageResources: { textures: new Array(), materials: new Array(), geometries: new Array() }, lodThreshold: r(e17.lodThreshold) ? e17.lodThreshold : null, pivotOffset: [0, 0, 0], numberOfVertices: 0, boundingBox: B() };
- l10.push(d6), e17.parts.forEach((e18) => {
- const i13 = e18.material + (e18.attributes.normal ? "_normal" : "") + (e18.attributes.color ? "_color" : "") + (e18.attributes.texCoord0 ? "_texCoord0" : "") + (e18.attributes.tangent ? "_tangent" : ""), a13 = u11.materials.get(e18.material), l11 = r(e18.attributes.texCoord0), f7 = r(e18.attributes.normal), p5 = Z(a13.alphaMode);
- if (!c12.has(i13)) {
- if (l11) {
- if (r(a13.textureColor) && !m6.has(a13.textureColor)) {
- const e19 = u11.textures.get(a13.textureColor), t12 = { ...e19.parameters, preMultiplyAlpha: p5 !== C2.Opaque };
- m6.set(a13.textureColor, new L5(e19.data, t12));
- }
- if (r(a13.textureNormal) && !m6.has(a13.textureNormal)) {
- const e19 = u11.textures.get(a13.textureNormal);
- m6.set(a13.textureNormal, new L5(e19.data, e19.parameters));
- }
- if (r(a13.textureOcclusion) && !m6.has(a13.textureOcclusion)) {
- const e19 = u11.textures.get(a13.textureOcclusion);
- m6.set(a13.textureOcclusion, new L5(e19.data, e19.parameters));
- }
- if (r(a13.textureEmissive) && !m6.has(a13.textureEmissive)) {
- const e19 = u11.textures.get(a13.textureEmissive);
- m6.set(a13.textureEmissive, new L5(e19.data, e19.parameters));
- }
- if (r(a13.textureMetallicRoughness) && !m6.has(a13.textureMetallicRoughness)) {
- const e19 = u11.textures.get(a13.textureMetallicRoughness);
- m6.set(a13.textureMetallicRoughness, new L5(e19.data, e19.parameters));
- }
- }
- const o12 = a13.color[0] ** (1 / o5), n15 = a13.color[1] ** (1 / o5), d7 = a13.color[2] ** (1 / o5), x5 = a13.emissiveFactor[0] ** (1 / o5), g7 = a13.emissiveFactor[1] ** (1 / o5), h10 = a13.emissiveFactor[2] ** (1 / o5), b3 = r(a13.textureColor) && l11 ? m6.get(a13.textureColor) : null;
- c12.set(i13, new R({ ...t11, transparent: p5 === C2.Blend, customDepthTest: N.Lequal, textureAlphaMode: p5, textureAlphaCutoff: a13.alphaCutoff, diffuse: [o12, n15, d7], ambient: [o12, n15, d7], opacity: a13.opacity, doubleSided: a13.doubleSided, doubleSidedType: "winding-order", cullFace: a13.doubleSided ? n9.None : n9.Back, hasVertexColors: !!e18.attributes.color, hasVertexTangents: !!e18.attributes.tangent, normals: f7 ? "default" : "screenDerivative", castShadows: true, receiveSSAO: true, textureId: r(b3) ? b3.id : void 0, colorMixMode: a13.colorMixMode, normalTextureId: r(a13.textureNormal) && l11 ? m6.get(a13.textureNormal).id : void 0, textureAlphaPremultiplied: r(b3) && !!b3.params.preMultiplyAlpha, occlusionTextureId: r(a13.textureOcclusion) && l11 ? m6.get(a13.textureOcclusion).id : void 0, emissiveTextureId: r(a13.textureEmissive) && l11 ? m6.get(a13.textureEmissive).id : void 0, metallicRoughnessTextureId: r(a13.textureMetallicRoughness) && l11 ? m6.get(a13.textureMetallicRoughness).id : void 0, emissiveFactor: [x5, g7, h10], mrrFactors: [a13.metallicFactor, a13.roughnessFactor, t11.mrrFactors[2]], isSchematic: false, ...s8 }));
- }
- const x4 = ee(e18.indices || e18.attributes.position.count, e18.primitiveType), S5 = e18.attributes.position.count, A7 = r7(i3, S5);
- t4(A7, e18.attributes.position, e18.transform);
- const N3 = [[O3.POSITION, { data: A7.typedBuffer, size: A7.elementCount, exclusive: true }]], I5 = [[O3.POSITION, x4]];
- if (r(e18.attributes.normal)) {
- const t12 = r7(i3, S5);
- j(n14, e18.transform), r5(t12, e18.attributes.normal, n14), N3.push([O3.NORMAL, { data: t12.typedBuffer, size: t12.elementCount, exclusive: true }]), I5.push([O3.NORMAL, x4]);
- }
- if (r(e18.attributes.tangent)) {
- const t12 = r7(c, S5);
- j(n14, e18.transform), r6(t12, e18.attributes.tangent, n14), N3.push([O3.TANGENT, { data: t12.typedBuffer, size: t12.elementCount, exclusive: true }]), I5.push([O3.TANGENT, x4]);
- }
- if (r(e18.attributes.texCoord0)) {
- const t12 = r7(u2, S5);
- n6(t12, e18.attributes.texCoord0), N3.push([O3.UV0, { data: t12.typedBuffer, size: t12.elementCount, exclusive: true }]), I5.push([O3.UV0, x4]);
- }
- if (r(e18.attributes.color)) {
- const t12 = r7(x, S5);
- if (e18.attributes.color.elementCount === 4)
- e18.attributes.color instanceof c ? o3(t12, e18.attributes.color, 255) : e18.attributes.color instanceof x ? e10(t12, e18.attributes.color) : e18.attributes.color instanceof L2 && o3(t12, e18.attributes.color, 1 / 256);
- else {
- t5(t12, 255, 255, 255, 255);
- const r12 = new O2(t12.buffer, 0, 4);
- e18.attributes.color instanceof i3 ? f2(r12, e18.attributes.color, 255) : e18.attributes.color instanceof O2 ? e9(r12, e18.attributes.color) : e18.attributes.color instanceof E && f2(r12, e18.attributes.color, 1 / 256);
- }
- N3.push([O3.COLOR, { data: t12.typedBuffer, size: t12.elementCount, exclusive: true }]), I5.push([O3.COLOR, x4]);
- }
- const L6 = new g2(N3, I5);
- d6.stageResources.geometries.push(L6), d6.stageResources.materials.push(c12.get(i13)), l11 && (r(a13.textureColor) && d6.stageResources.textures.push(m6.get(a13.textureColor)), r(a13.textureNormal) && d6.stageResources.textures.push(m6.get(a13.textureNormal)), r(a13.textureOcclusion) && d6.stageResources.textures.push(m6.get(a13.textureOcclusion)), r(a13.textureEmissive) && d6.stageResources.textures.push(m6.get(a13.textureEmissive)), r(a13.textureMetallicRoughness) && d6.stageResources.textures.push(m6.get(a13.textureMetallicRoughness))), d6.numberOfVertices += S5;
- const F3 = L6.boundingInfo;
- r(F3) && (h2(d6.boundingBox, F3.getBBMin()), h2(d6.boundingBox, F3.getBBMax()));
- });
- }), l10;
- }
- function Z(e16) {
- switch (e16) {
- case "BLEND":
- return C2.Blend;
- case "MASK":
- return C2.Mask;
- case "OPAQUE":
- case null:
- case void 0:
- return C2.Opaque;
- }
- }
- function ee(e16, t11) {
- switch (t11) {
- case E2.TRIANGLES:
- return n8(e16);
- case E2.TRIANGLE_STRIP:
- return o4(e16);
- case E2.TRIANGLE_FAN:
- return i4(e16);
- }
- }
- function te(e16, t11) {
- for (let r12 = 0; r12 < e16.model.lods.length; ++r12) {
- const o12 = e16.model.lods[r12];
- e16.customMeta.esriTreeRendering = true;
- for (const i12 of o12.parts) {
- const o13 = i12.attributes.normal;
- if (t(o13))
- return;
- const x4 = i12.attributes.position, g7 = x4.count, b3 = n3(), R2 = n3(), B4 = n3(), M3 = r7(x, g7), T6 = r7(i3, g7), w6 = h(e7(), i12.transform);
- for (let s8 = 0; s8 < g7; s8++) {
- x4.getVec(s8, R2), o13.getVec(s8, b3), L(R2, R2, i12.transform), e5(B4, R2, t11.center), i(B4, B4, t11.radius);
- const a12 = B4[2], u11 = s4(B4), p5 = Math.min(0.45 + 0.55 * u11 * u11, 1);
- i(B4, B4, t11.radius), L(B4, B4, w6), z(B4, B4), r12 + 1 !== e16.model.lods.length && e16.model.lods.length > 1 && A(B4, B4, b3, a12 > -1 ? 0.2 : Math.min(-4 * a12 - 3.8, 1)), T6.setVec(s8, B4), M3.set(s8, 0, 255 * p5), M3.set(s8, 1, 255 * p5), M3.set(s8, 2, 255 * p5), M3.set(s8, 3, 255);
- }
- i12.attributes.normal = T6, i12.attributes.color = M3;
- }
- }
- }
- export {
- J as fetch,
- Y2 as gltfToEngineResources,
- X2 as parseUrl
- };
- //# sourceMappingURL=objectResourceUtils-OTLKPTOD.js.map
|