import { v } from "./chunk-GXVMJ7RN.js"; import { s as s4 } from "./chunk-6BRTRIDE.js"; import { c as c3, e as e3, r as r3, u as u4 } from "./chunk-2QVXRTVA.js"; import { C, D, E as E2, L as L2 } from "./chunk-MI7HWWFL.js"; import { e as e6 } from "./chunk-4KFEVYXL.js"; import { x as x2 } from "./chunk-5W6F4NR5.js"; import { e as e5 } from "./chunk-YZUP3MAF.js"; import { e as e4, r as r4 } from "./chunk-E3HOL2XO.js"; import { A, B, E, F, L, O, V, c as c2, d, g as g2, i as i3, q as q2, u as u3, w as w2, x } from "./chunk-H4JLO5B2.js"; import { r as r5 } from "./chunk-LPQPD3EP.js"; import { n as n2 } from "./chunk-H2KDMZTR.js"; import { c, f as f2, g, i as i2, u as u2 } from "./chunk-TERAW6FT.js"; import { _, e as e2, o, q, s as s3, u } from "./chunk-XNLG7T2T.js"; import { n } from "./chunk-IR4PV7VK.js"; import { a } from "./chunk-WJ3OEUD3.js"; import { U } from "./chunk-VNFRAYHO.js"; import { Q, X, Y, nt } from "./chunk-VBRY5KJM.js"; import { r as r2 } from "./chunk-IHXECKQQ.js"; import { f, w } from "./chunk-ULGDPLM2.js"; import { s, s3 as s2 } from "./chunk-EMJ4ZSM2.js"; import { e2 as e, i3 as i, r, t } from "./chunk-GZT4BVFP.js"; // node_modules/@arcgis/core/chunks/vec42.js function t2(t12, r11, f9) { if (t12.count !== r11.count) return void e6.error("source and destination buffers need to have the same number of elements"); const o7 = t12.count, n8 = f9[0], u8 = f9[1], d4 = f9[2], s7 = f9[3], c9 = f9[4], i6 = f9[5], a4 = f9[6], p2 = f9[7], y2 = f9[8], B2 = f9[9], m3 = f9[10], l4 = f9[11], S = f9[12], h2 = f9[13], b2 = f9[14], M3 = f9[15], v2 = t12.typedBuffer, g4 = t12.typedBufferStride, _2 = r11.typedBuffer, j = r11.typedBufferStride; for (let e11 = 0; e11 < o7; e11++) { const t13 = e11 * g4, r12 = e11 * j, f10 = _2[r12], o8 = _2[r12 + 1], z2 = _2[r12 + 2], O3 = _2[r12 + 3]; v2[t13] = n8 * f10 + c9 * o8 + y2 * z2 + S * O3, v2[t13 + 1] = u8 * f10 + i6 * o8 + B2 * z2 + h2 * O3, v2[t13 + 2] = d4 * f10 + a4 * o8 + m3 * z2 + b2 * O3, v2[t13 + 3] = s7 * f10 + p2 * o8 + l4 * z2 + M3 * O3; } } function r6(t12, r11, f9) { if (t12.count !== r11.count) return void e6.error("source and destination buffers need to have the same number of elements"); const o7 = t12.count, n8 = f9[0], u8 = f9[1], d4 = f9[2], s7 = f9[3], c9 = f9[4], i6 = f9[5], a4 = f9[6], p2 = f9[7], y2 = f9[8], B2 = t12.typedBuffer, m3 = t12.typedBufferStride, l4 = r11.typedBuffer, S = r11.typedBufferStride; for (let e11 = 0; e11 < o7; e11++) { const t13 = e11 * m3, r12 = e11 * S, f10 = l4[r12], o8 = l4[r12 + 1], h2 = l4[r12 + 2], b2 = l4[r12 + 3]; B2[t13] = n8 * f10 + s7 * o8 + a4 * h2, B2[t13 + 1] = u8 * f10 + c9 * o8 + p2 * h2, B2[t13 + 2] = d4 * f10 + i6 * o8 + y2 * h2, B2[t13 + 3] = b2; } } function f3(e11, t12) { const r11 = Math.min(e11.count, t12.count), f9 = e11.typedBuffer, o7 = e11.typedBufferStride, n8 = t12.typedBuffer, u8 = t12.typedBufferStride; for (let d4 = 0; d4 < r11; d4++) { const e12 = d4 * o7, t13 = d4 * u8, r12 = n8[t13], s7 = n8[t13 + 1], c9 = n8[t13 + 2], i6 = r12 * r12 + s7 * s7 + c9 * c9; if (i6 > 0) { const t14 = 1 / Math.sqrt(i6); f9[e12] = t14 * r12, f9[e12 + 1] = t14 * s7, f9[e12 + 2] = t14 * c9; } } } function o2(e11, t12, r11) { const f9 = Math.min(e11.count, t12.count), o7 = e11.typedBuffer, n8 = e11.typedBufferStride, u8 = t12.typedBuffer, d4 = t12.typedBufferStride; for (let s7 = 0; s7 < f9; s7++) { const e12 = s7 * n8, t13 = s7 * d4; o7[e12] = r11 * u8[t13], o7[e12 + 1] = r11 * u8[t13 + 1], o7[e12 + 2] = r11 * u8[t13 + 2], o7[e12 + 3] = r11 * u8[t13 + 3]; } } function n3(e11, t12, r11) { const f9 = Math.min(e11.count, t12.count), o7 = e11.typedBuffer, n8 = e11.typedBufferStride, u8 = t12.typedBuffer, d4 = t12.typedBufferStride; for (let s7 = 0; s7 < f9; s7++) { const e12 = s7 * n8, t13 = s7 * d4; o7[e12] = u8[t13] >> r11, o7[e12 + 1] = u8[t13 + 1] >> r11, o7[e12 + 2] = u8[t13 + 2] >> r11, o7[e12 + 3] = u8[t13 + 3] >> r11; } } var u5 = Object.freeze(Object.defineProperty({ __proto__: null, transformMat4: t2, transformMat3: r6, normalize: f3, scale: o2, shiftRight: n3 }, Symbol.toStringTag, { value: "Module" })); // node_modules/@arcgis/core/chunks/vec22.js function f4(e11, t12, r11) { const f9 = e11.typedBuffer, n8 = e11.typedBufferStride, d4 = t12.typedBuffer, o7 = t12.typedBufferStride, u8 = r11 ? r11.count : t12.count; let s7 = (r11 && r11.dstIndex ? r11.dstIndex : 0) * n8, c9 = (r11 && r11.srcIndex ? r11.srcIndex : 0) * o7; for (let p2 = 0; p2 < u8; ++p2) f9[s7] = d4[c9], f9[s7 + 1] = d4[c9 + 1], s7 += n8, c9 += o7; } function n4(n8, d4, o7) { const u8 = n8.typedBuffer, s7 = n8.typedBufferStride, c9 = d4.typedBuffer, p2 = d4.typedBufferStride, l4 = o7 ? o7.count : d4.count; let y2 = (o7 && o7.dstIndex ? o7.dstIndex : 0) * s7, i6 = (o7 && o7.srcIndex ? o7.srcIndex : 0) * p2; if (c3(d4.elementType)) { const e11 = u4(d4.elementType); if (r3(d4.elementType)) for (let t12 = 0; t12 < l4; ++t12) u8[y2] = Math.max(c9[i6] / e11, -1), u8[y2 + 1] = Math.max(c9[i6 + 1] / e11, -1), y2 += s7, i6 += p2; else for (let t12 = 0; t12 < l4; ++t12) u8[y2] = c9[i6] / e11, u8[y2 + 1] = c9[i6 + 1] / e11, y2 += s7, i6 += p2; } else f4(n8, d4, o7); return n8; } function d2(e11, t12, r11, f9) { const n8 = e11.typedBuffer, d4 = e11.typedBufferStride, o7 = f9?.count ?? e11.count; let u8 = (f9?.dstIndex ?? 0) * d4; for (let s7 = 0; s7 < o7; ++s7) n8[u8] = t12, n8[u8 + 1] = r11, u8 += d4; } var o3 = Object.freeze(Object.defineProperty({ __proto__: null, copy: f4, normalizeIntegerBuffer: n4, fill: d2 }, Symbol.toStringTag, { value: "Module" })); // node_modules/@arcgis/core/chunks/vec43.js function e7(e11, t12, f9) { const d4 = e11.typedBuffer, n8 = e11.typedBufferStride, o7 = t12.typedBuffer, r11 = t12.typedBufferStride, c9 = f9 ? f9.count : t12.count; let u8 = (f9 && f9.dstIndex ? f9.dstIndex : 0) * n8, l4 = (f9 && f9.srcIndex ? f9.srcIndex : 0) * r11; for (let s7 = 0; s7 < c9; ++s7) d4[u8] = o7[l4], d4[u8 + 1] = o7[l4 + 1], d4[u8 + 2] = o7[l4 + 2], d4[u8 + 3] = o7[l4 + 3], u8 += n8, l4 += r11; } function t3(e11, t12, f9, d4, n8, o7) { const r11 = e11.typedBuffer, c9 = e11.typedBufferStride, u8 = o7?.count ?? e11.count; let l4 = (o7?.dstIndex ?? 0) * c9; for (let s7 = 0; s7 < u8; ++s7) r11[l4] = t12, r11[l4 + 1] = f9, r11[l4 + 2] = d4, r11[l4 + 3] = n8, l4 += c9; } var f5 = Object.freeze(Object.defineProperty({ __proto__: null, copy: e7, fill: t3 }, Symbol.toStringTag, { value: "Module" })); // node_modules/@arcgis/core/chunks/mat32.js function e8(e11, t12, r11) { const o7 = e11.typedBuffer, d4 = e11.typedBufferStride, f9 = t12.typedBuffer, n8 = t12.typedBufferStride, c9 = r11 ? r11.count : t12.count; let u8 = (r11 && r11.dstIndex ? r11.dstIndex : 0) * d4, l4 = (r11 && r11.srcIndex ? r11.srcIndex : 0) * n8; for (let p2 = 0; p2 < c9; ++p2) { for (let e12 = 0; e12 < 9; ++e12) o7[u8 + e12] = f9[l4 + e12]; u8 += d4, l4 += n8; } } var t4 = Object.freeze(Object.defineProperty({ __proto__: null, copy: e8 }, Symbol.toStringTag, { value: "Module" })); // node_modules/@arcgis/core/chunks/mat42.js function e9(e11, t12, r11) { const o7 = e11.typedBuffer, d4 = e11.typedBufferStride, f9 = t12.typedBuffer, n8 = t12.typedBufferStride, c9 = r11 ? r11.count : t12.count; let u8 = (r11 && r11.dstIndex ? r11.dstIndex : 0) * d4, l4 = (r11 && r11.srcIndex ? r11.srcIndex : 0) * n8; for (let p2 = 0; p2 < c9; ++p2) { for (let e12 = 0; e12 < 16; ++e12) o7[u8 + e12] = f9[l4 + e12]; u8 += d4, l4 += n8; } } var t5 = Object.freeze(Object.defineProperty({ __proto__: null, copy: e9 }, Symbol.toStringTag, { value: "Module" })); // node_modules/@arcgis/core/chunks/scalar.js function e10(e11, t12, r11) { const n8 = e11.typedBuffer, o7 = e11.typedBufferStride, c9 = t12.typedBuffer, d4 = t12.typedBufferStride, f9 = r11 ? r11.count : t12.count; let u8 = (r11 && r11.dstIndex ? r11.dstIndex : 0) * o7, s7 = (r11 && r11.srcIndex ? r11.srcIndex : 0) * d4; for (let p2 = 0; p2 < f9; ++p2) n8[u8] = c9[s7], u8 += o7, s7 += d4; } function t6(e11, t12) { const r11 = e11.count; t12 || (t12 = new e11.TypedArrayConstructor(r11)); for (let n8 = 0; n8 < r11; n8++) t12[n8] = e11.get(n8); return t12; } var r7 = Object.freeze(Object.defineProperty({ __proto__: null, copy: e10, makeDense: t6 }, Symbol.toStringTag, { value: "Module" })); // node_modules/@arcgis/core/geometry/support/buffer/utils.js function r8(s7, r11) { return new s7(new ArrayBuffer(r11 * s7.ElementCount * e3(s7.ElementType))); } // node_modules/@arcgis/core/views/3d/glTF/DefaultLoadingContext.js var n5 = class { constructor(r11) { this.streamDataRequester = r11; } async loadJSON(r11, e11) { return this._load("json", r11, e11); } async loadBinary(r11, e11) { return X(r11) ? (f(e11), Y(r11)) : this._load("binary", r11, e11); } async loadImage(r11, e11) { return this._load("image", r11, e11); } async _load(t12, i6, m3) { if (t(this.streamDataRequester)) return (await U(i6, { responseType: c4[t12] })).data; const n8 = await a(this.streamDataRequester.request(i6, t12, m3)); if (n8.ok === true) return n8.value; throw w(n8.error), new s2("", `Request for resource failed: ${n8.error}`); } }; var c4 = { image: "image", binary: "array-buffer", json: "json" }; // node_modules/@arcgis/core/views/3d/glTF/DefaultErrorContext.js var o4 = s.getLogger("esri.views.3d.glTF"); var t7 = class { error(e11) { throw new s2("gltf-loader-error", e11); } errorUnsupported(e11) { throw new s2("gltf-loader-unsupported-feature", e11); } errorUnsupportedIf(r11, e11) { r11 && this.errorUnsupported(e11); } assert(r11, e11) { r11 || this.error(e11); } warn(r11) { o4.warn(r11); } warnUnsupported(r11) { this.warn("[Unsupported Feature] " + r11); } warnUnsupportedIf(r11, e11) { r11 && this.warnUnsupported(e11); } }; // node_modules/@arcgis/core/views/3d/glTF/LoaderResult.js function t8(e11 = {}) { return { color: [1, 1, 1], opacity: 1, alphaMode: "OPAQUE", alphaCutoff: 0.5, doubleSided: false, castShadows: true, receiveShadows: true, receiveAmbientOcclustion: true, textureColor: null, textureNormal: null, textureOcclusion: null, textureEmissive: null, textureMetallicRoughness: null, emissiveFactor: [0, 0, 0], metallicFactor: 1, roughnessFactor: 1, colorMixMode: "multiply", ...e11 }; } function l(t12, l4 = {}) { return { data: t12, parameters: { wrap: { s: D.REPEAT, t: D.REPEAT, ...l4.wrap }, noUnpackFlip: true, mipmap: false, ...l4 } }; } // node_modules/@arcgis/core/views/3d/glTF/internal/BinaryStreamReader.js var t9 = class { constructor(t12) { this.data = t12, this.offset4 = 0, this.dataUint32 = new Uint32Array(this.data, 0, Math.floor(this.data.byteLength / 4)); } readUint32() { const t12 = this.offset4; return this.offset4 += 1, this.dataUint32[t12]; } readUint8Array(t12) { const s7 = 4 * this.offset4; return this.offset4 += t12 / 4, new Uint8Array(this.data, s7, t12); } remainingBytes() { return this.data.byteLength - 4 * this.offset4; } }; // node_modules/@arcgis/core/views/3d/glTF/internal/enums.js var A2; var E3; !function(A4) { A4.SCALAR = "SCALAR", A4.VEC2 = "VEC2", A4.VEC3 = "VEC3", A4.VEC4 = "VEC4", A4.MAT2 = "MAT2", A4.MAT3 = "MAT3", A4.MAT4 = "MAT4"; }(A2 || (A2 = {})), function(A4) { A4[A4.ARRAY_BUFFER = 34962] = "ARRAY_BUFFER", A4[A4.ELEMENT_ARRAY_BUFFER = 34963] = "ELEMENT_ARRAY_BUFFER"; }(E3 || (E3 = {})); // node_modules/@arcgis/core/views/3d/glTF/internal/fillDefaults.js var t10 = { baseColorFactor: [1, 1, 1, 1], metallicFactor: 1, roughnessFactor: 1 }; var a2 = { pbrMetallicRoughness: t10, emissiveFactor: [0, 0, 0], alphaMode: "OPAQUE", alphaCutoff: 0.5, doubleSided: false }; var l2 = { ESRI_externalColorMixMode: "tint" }; var i4 = (e11 = {}) => { const o7 = { ...t10, ...e11.pbrMetallicRoughness }, r11 = s5({ ...l2, ...e11.extras }); return { ...a2, ...e11, pbrMetallicRoughness: o7, extras: r11 }; }; function s5(o7) { switch (o7.ESRI_externalColorMixMode) { case "multiply": case "tint": case "ignore": case "replace": break; default: n2(o7.ESRI_externalColorMixMode), o7.ESRI_externalColorMixMode = "tint"; } return o7; } var n6 = { magFilter: L2.LINEAR, minFilter: L2.LINEAR_MIPMAP_LINEAR, wrapS: D.REPEAT, wrapT: D.REPEAT }; var c5 = (e11) => ({ ...n6, ...e11 }); // node_modules/@arcgis/core/views/3d/glTF/internal/pathUtils.js function r9(r11) { let e11, t12; return r11.replace(/^(.*\/)?([^/]*)$/, (r12, a4, i6) => (e11 = a4 || "", t12 = i6 || "", "")), { dirPart: e11, filePart: t12 }; } // node_modules/@arcgis/core/views/3d/glTF/internal/Resource.js var M = { MAGIC: 1179937895, CHUNK_TYPE_JSON: 1313821514, CHUNK_TYPE_BIN: 5130562, MIN_HEADER_LENGTH: 20 }; var F2 = class { constructor(e11, t12, r11, s7, n8) { this.context = e11, this.errorContext = t12, this.uri = r11, this.json = s7, this.glbBuffer = n8, this.bufferLoaders = new Map(), this.textureLoaders = new Map(), this.textureCache = new Map(), this.materialCache = new Map(), this.nodeParentMap = new Map(), this.nodeTransformCache = new Map(), this.baseUri = r9(this.uri).dirPart, this._checkVersionSupported(), this._checkRequiredExtensionsSupported(), t12.errorUnsupportedIf(s7.scenes == null, "Scenes must be defined."), t12.errorUnsupportedIf(s7.meshes == null, "Meshes must be defined"), t12.errorUnsupportedIf(s7.nodes == null, "Nodes must be defined."), this._computeNodeParents(); } static async load(e11, t12, o7, a4) { if (X(o7)) { const r11 = nt(o7); if (r11.mediaType !== "model/gltf-binary") try { const s7 = JSON.parse(r11.isBase64 ? atob(r11.data) : r11.data); return new F2(e11, t12, o7, s7); } catch { } const a5 = Y(o7); if (F2._isGLBData(a5)) return this._fromGLBData(e11, t12, o7, a5); } if (o7.endsWith(".gltf")) { const r11 = await e11.loadJSON(o7, a4); return new F2(e11, t12, o7, r11); } const i6 = await e11.loadBinary(o7, a4); if (F2._isGLBData(i6)) return this._fromGLBData(e11, t12, o7, i6); const u8 = await e11.loadJSON(o7, a4); return new F2(e11, t12, o7, u8); } static _isGLBData(e11) { const t12 = new t9(e11); return t12.remainingBytes() >= 4 && t12.readUint32() === M.MAGIC; } static async _fromGLBData(e11, t12, r11, s7) { const n8 = await F2._parseGLBData(t12, s7); return new F2(e11, t12, r11, n8.json, n8.binaryData); } static async _parseGLBData(e11, t12) { const r11 = new t9(t12); e11.assert(r11.remainingBytes() >= 12, "GLB binary data is insufficiently large."); const s7 = r11.readUint32(), n8 = r11.readUint32(), o7 = r11.readUint32(); e11.assert(s7 === M.MAGIC, "Magic first 4 bytes do not fit to expected GLB value."), e11.assert(t12.byteLength >= o7, "GLB binary data is smaller than header specifies."), e11.errorUnsupportedIf(n8 !== 2, "An unsupported GLB container version was detected. Only version 2 is supported."); let a4, i6, u8 = 0; for (; r11.remainingBytes() >= 8; ) { const t13 = r11.readUint32(), s8 = r11.readUint32(); u8 === 0 ? (e11.assert(s8 === M.CHUNK_TYPE_JSON, "First GLB chunk must be JSON."), e11.assert(t13 >= 0, "No JSON data found."), a4 = await q3(r11.readUint8Array(t13))) : u8 === 1 ? (e11.errorUnsupportedIf(s8 !== M.CHUNK_TYPE_BIN, "Second GLB chunk expected to be BIN."), i6 = r11.readUint8Array(t13)) : e11.warnUnsupported("More than 2 GLB chunks detected. Skipping."), u8 += 1; } return a4 || e11.error("No GLB JSON chunk detected."), { json: a4, binaryData: i6 }; } async getBuffer(e11, t12) { const r11 = this.json.buffers[e11], s7 = this.errorContext; if (r11.uri == null) return s7.assert(this.glbBuffer != null, "GLB buffer not present"), this.glbBuffer; const n8 = await this._getBufferLoader(e11, t12); return s7.assert(n8.byteLength === r11.byteLength, "Buffer byte lengths should match."), n8; } async _getBufferLoader(e11, t12) { const r11 = this.bufferLoaders.get(e11); if (r11) return r11; const s7 = this.json.buffers[e11], n8 = this.context.loadBinary(this._resolveUri(s7.uri), t12).then((e12) => new Uint8Array(e12)); return this.bufferLoaders.set(e11, n8), n8; } async getAccessor(e11, t12) { const r11 = this.errorContext; r11.errorUnsupportedIf(!this.json.accessors, "Accessors missing."); const s7 = this.json.accessors[e11]; r11.errorUnsupportedIf(s7?.bufferView == null, "Some accessor does not specify a bufferView."), r11.errorUnsupportedIf(s7.type in [A2.MAT2, A2.MAT3, A2.MAT4], `AttributeType ${s7.type} is not supported`); const n8 = this.json.bufferViews[s7.bufferView], o7 = await this.getBuffer(n8.buffer, t12), a4 = H[s7.type], i6 = Y2[s7.componentType], u8 = a4 * i6, c9 = n8.byteStride || u8; return { raw: o7.buffer, byteStride: c9, byteOffset: o7.byteOffset + (n8.byteOffset || 0) + (s7.byteOffset || 0), entryCount: s7.count, isDenselyPacked: c9 === u8, componentCount: a4, componentByteSize: i6, componentType: s7.componentType, min: s7.min, max: s7.max, normalized: !!s7.normalized }; } async getIndexData(e11, t12) { if (e11.indices == null) return null; const r11 = await this.getAccessor(e11.indices, t12); if (r11.isDenselyPacked) switch (r11.componentType) { case C.UNSIGNED_BYTE: return new Uint8Array(r11.raw, r11.byteOffset, r11.entryCount); case C.UNSIGNED_SHORT: return new Uint16Array(r11.raw, r11.byteOffset, r11.entryCount); case C.UNSIGNED_INT: return new Uint32Array(r11.raw, r11.byteOffset, r11.entryCount); } else switch (r11.componentType) { case C.UNSIGNED_BYTE: return t6(this._wrapAccessor(d, r11)); case C.UNSIGNED_SHORT: return t6(this._wrapAccessor(g2, r11)); case C.UNSIGNED_INT: return t6(this._wrapAccessor(B, r11)); } } async getPositionData(e11, t12) { const r11 = this.errorContext; r11.errorUnsupportedIf(e11.attributes.POSITION == null, "No POSITION vertex data found."); const s7 = await this.getAccessor(e11.attributes.POSITION, t12); return r11.errorUnsupportedIf(s7.componentType !== C.FLOAT, "Expected type FLOAT for POSITION vertex attribute, but found " + X2[s7.componentType]), r11.errorUnsupportedIf(s7.componentCount !== 3, "POSITION vertex attribute must have 3 components, but found " + s7.componentCount.toFixed()), this._wrapAccessor(i3, s7); } async getNormalData(e11, t12) { const r11 = this.errorContext; r11.assert(e11.attributes.NORMAL != null, "No NORMAL vertex data found."); const s7 = await this.getAccessor(e11.attributes.NORMAL, t12); return r11.errorUnsupportedIf(s7.componentType !== C.FLOAT, "Expected type FLOAT for NORMAL vertex attribute, but found " + X2[s7.componentType]), r11.errorUnsupportedIf(s7.componentCount !== 3, "NORMAL vertex attribute must have 3 components, but found " + s7.componentCount.toFixed()), this._wrapAccessor(i3, s7); } async getTangentData(e11, t12) { const r11 = this.errorContext; r11.assert(e11.attributes.TANGENT != null, "No TANGENT vertex data found."); const s7 = await this.getAccessor(e11.attributes.TANGENT, t12); return r11.errorUnsupportedIf(s7.componentType !== C.FLOAT, "Expected type FLOAT for TANGENT vertex attribute, but found " + X2[s7.componentType]), r11.errorUnsupportedIf(s7.componentCount !== 4, "TANGENT vertex attribute must have 4 components, but found " + s7.componentCount.toFixed()), new c2(s7.raw, s7.byteOffset, s7.byteStride, s7.byteOffset + s7.byteStride * s7.entryCount); } async getTextureCoordinates(e11, t12) { const r11 = this.errorContext; r11.assert(e11.attributes.TEXCOORD_0 != null, "No TEXCOORD_0 vertex data found."); const s7 = await this.getAccessor(e11.attributes.TEXCOORD_0, t12); return r11.errorUnsupportedIf(s7.componentCount !== 2, "TEXCOORD_0 vertex attribute must have 2 components, but found " + s7.componentCount.toFixed()), s7.componentType === C.FLOAT ? this._wrapAccessor(u3, s7) : (r11.errorUnsupportedIf(!s7.normalized, "Integer component types are only supported for a normalized accessor for TEXCOORD_0."), J(s7)); } async getVertexColors(e11, t12) { const r11 = this.errorContext; r11.assert(e11.attributes.COLOR_0 != null, "No COLOR_0 vertex data found."); const s7 = await this.getAccessor(e11.attributes.COLOR_0, t12); if (r11.errorUnsupportedIf(s7.componentCount !== 4 && s7.componentCount !== 3, "COLOR_0 attribute must have 3 or 4 components, but found " + s7.componentCount.toFixed()), s7.componentCount === 4) { if (s7.componentType === C.FLOAT) return this._wrapAccessor(c2, s7); if (s7.componentType === C.UNSIGNED_BYTE) return this._wrapAccessor(x, s7); if (s7.componentType === C.UNSIGNED_SHORT) return this._wrapAccessor(L, s7); } else if (s7.componentCount === 3) { if (s7.componentType === C.FLOAT) return this._wrapAccessor(i3, s7); if (s7.componentType === C.UNSIGNED_BYTE) return this._wrapAccessor(O, s7); if (s7.componentType === C.UNSIGNED_SHORT) return this._wrapAccessor(E, s7); } r11.errorUnsupported("Unsupported component type for COLOR_0 attribute: " + X2[s7.componentType]); } hasPositions(e11) { return e11.attributes.POSITION !== void 0; } hasNormals(e11) { return e11.attributes.NORMAL !== void 0; } hasVertexColors(e11) { return e11.attributes.COLOR_0 !== void 0; } hasTextureCoordinates(e11) { return e11.attributes.TEXCOORD_0 !== void 0; } hasTangents(e11) { return e11.attributes.TANGENT !== void 0; } async getMaterial(e11, t12, r11) { let s7 = this.materialCache.get(e11.material); if (!s7) { const n8 = e11.material != null ? i4(this.json.materials[e11.material]) : i4(), o7 = n8.pbrMetallicRoughness, a4 = this.hasVertexColors(e11), i6 = this.getTexture(o7.baseColorTexture, t12), u8 = this.getTexture(n8.normalTexture, t12), c9 = r11 ? this.getTexture(n8.occlusionTexture, t12) : null, p2 = r11 ? this.getTexture(n8.emissiveTexture, t12) : null, f9 = r11 ? this.getTexture(o7.metallicRoughnessTexture, t12) : null, d4 = e11.material != null ? e11.material : -1; s7 = { alphaMode: n8.alphaMode, alphaCutoff: n8.alphaCutoff, color: o7.baseColorFactor, doubleSided: !!n8.doubleSided, colorTexture: await i6, normalTexture: await u8, name: n8.name, id: d4, occlusionTexture: await c9, emissiveTexture: await p2, emissiveFactor: n8.emissiveFactor, metallicFactor: o7.metallicFactor, roughnessFactor: o7.roughnessFactor, metallicRoughnessTexture: await f9, hasVertexColors: a4, ESRI_externalColorMixMode: n8.extras.ESRI_externalColorMixMode }; } return s7; } async getTexture(e11, r11) { if (!e11) return null; this.errorContext.errorUnsupportedIf((e11.texCoord || 0) !== 0, "Only TEXCOORD with index 0 is supported."); const s7 = e11.index, n8 = this.errorContext, o7 = this.json.textures[s7], a4 = c5(o7.sampler != null ? this.json.samplers[o7.sampler] : {}); n8.errorUnsupportedIf(o7.source == null, "Source is expected to be defined for a texture."); const i6 = this.json.images[o7.source], u8 = await this._loadTextureImageData(s7, o7, r11); return r2(this.textureCache, s7, () => { const e12 = (e13) => e13 === 33071 || e13 === 33648 || e13 === 10497, t12 = (e13) => (n8.error(`Unexpected TextureSampler WrapMode: ${e13}. Using default REPEAT(10497).`), 10497); return { data: u8, wrapS: e12(a4.wrapS) ? a4.wrapS : t12(a4.wrapS), wrapT: e12(a4.wrapT) ? a4.wrapT : t12(a4.wrapT), minFilter: a4.minFilter, name: i6.name, id: s7 }; }); } getNodeTransform(e11) { if (e11 === void 0) return V2; let t12 = this.nodeTransformCache.get(e11); if (!t12) { const r11 = this.getNodeTransform(this._getNodeParent(e11)), s7 = this.json.nodes[e11]; s7.matrix ? t12 = u2(e4(), r11, s7.matrix) : s7.translation || s7.rotation || s7.scale ? (t12 = r4(r11), s7.translation && c(t12, t12, s7.translation), s7.rotation && (k[3] = x2(k, s7.rotation), f2(t12, t12, k[3], k)), s7.scale && i2(t12, t12, s7.scale)) : t12 = r11, this.nodeTransformCache.set(e11, t12); } return t12; } _wrapAccessor(e11, t12) { return new e11(t12.raw, t12.byteOffset, t12.byteStride, t12.byteOffset + t12.byteStride * (t12.entryCount - 1) + t12.componentByteSize * t12.componentCount); } _resolveUri(e11) { return Q(e11, this.baseUri); } _getNodeParent(e11) { return this.nodeParentMap.get(e11); } _checkVersionSupported() { const e11 = r5.parse(this.json.asset.version, "glTF"); P.validate(e11); } _checkRequiredExtensionsSupported() { const e11 = this.json, t12 = this.errorContext; e11.extensionsRequired && e11.extensionsRequired.length !== 0 && t12.errorUnsupported("gltf loader was not able to load unsupported feature. Required extensions: " + e11.extensionsRequired.join(", ")); } _computeNodeParents() { this.json.nodes.forEach((e11, t12) => { e11.children && e11.children.forEach((e12) => { this.nodeParentMap.set(e12, t12); }); }); } async _loadTextureImageData(e11, t12, r11) { const s7 = this.textureLoaders.get(e11); if (s7) return s7; const n8 = this._createTextureLoader(t12, r11); return this.textureLoaders.set(e11, n8), n8; } async _createTextureLoader(e11, t12) { const r11 = this.json.images[e11.source]; if (r11.uri) return this.context.loadImage(this._resolveUri(r11.uri), t12); const s7 = this.errorContext; s7.errorUnsupportedIf(r11.bufferView == null, "Image bufferView must be defined."), s7.errorUnsupportedIf(r11.mimeType == null, "Image mimeType must be defined."); const n8 = this.json.bufferViews[r11.bufferView], o7 = await this.getBuffer(n8.buffer, t12); return s7.errorUnsupportedIf(n8.byteStride != null, "byteStride not supported for image buffer"), z(new Uint8Array(o7.buffer, o7.byteOffset + (n8.byteOffset || 0), n8.byteLength), r11.mimeType); } }; var P = new r5(2, 0, "glTF"); var V2 = g(e4(), Math.PI / 2); var k = e5(); var H = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4 }; var Y2 = { [C.BYTE]: 1, [C.UNSIGNED_BYTE]: 1, [C.SHORT]: 2, [C.UNSIGNED_SHORT]: 2, [C.FLOAT]: 4, [C.UNSIGNED_INT]: 4 }; function J(t12) { switch (t12.componentType) { case C.BYTE: return new V(t12.raw, t12.byteOffset, t12.byteStride, t12.byteOffset + t12.byteStride * t12.entryCount); case C.UNSIGNED_BYTE: return new A(t12.raw, t12.byteOffset, t12.byteStride, t12.byteOffset + t12.byteStride * t12.entryCount); case C.SHORT: return new q2(t12.raw, t12.byteOffset, t12.byteStride, t12.byteOffset + t12.byteStride * t12.entryCount); case C.UNSIGNED_SHORT: return new w2(t12.raw, t12.byteOffset, t12.byteStride, t12.byteOffset + t12.byteStride * t12.entryCount); case C.UNSIGNED_INT: return new F(t12.raw, t12.byteOffset, t12.byteStride, t12.byteOffset + t12.byteStride * t12.entryCount); case C.FLOAT: return new u3(t12.raw, t12.byteOffset, t12.byteStride, t12.byteOffset + t12.byteStride * t12.entryCount); default: return void n2(t12.componentType); } } async function q3(e11) { return new Promise((t12, r11) => { const s7 = new Blob([e11]), n8 = new FileReader(); n8.onload = () => { const e12 = n8.result; t12(JSON.parse(e12)); }, n8.onerror = (e12) => { r11(e12); }, n8.readAsText(s7); }); } async function z(e11, t12) { return new Promise((r11, s7) => { const n8 = new Blob([e11], { type: t12 }), o7 = URL.createObjectURL(n8), a4 = new Image(); a4.addEventListener("load", () => { URL.revokeObjectURL(o7), "decode" in a4 ? a4.decode().then(() => r11(a4), () => r11(a4)) : r11(a4); }), a4.addEventListener("error", (e12) => { URL.revokeObjectURL(o7), s7(e12); }), a4.src = o7; }); } var X2 = { 5120: "BYTE", 5121: "UNSIGNED_BYTE", 5122: "SHORT", 5123: "UNSIGNED_SHORT", 5125: "UNSIGNED_INT", 5126: "FLOAT" }; // node_modules/@arcgis/core/views/3d/glTF/loader.js var u6 = 0; async function c6(s7, r11, a4 = {}, i6 = true) { const c9 = await F2.load(s7, x3, r11, a4), p2 = "gltf_" + u6++, h2 = { lods: [], materials: new Map(), textures: new Map(), meta: m(c9) }, I = !(!c9.json.asset.extras || c9.json.asset.extras.ESRI_type !== "symbolResource"), R = new Map(); await d3(c9, async (s8, r12, n8, u8) => { const m3 = R.get(n8) ?? 0; R.set(n8, m3 + 1); const d4 = s8.mode !== void 0 ? s8.mode : E2.TRIANGLES, I2 = d4 === E2.TRIANGLES || d4 === E2.TRIANGLE_STRIP || d4 === E2.TRIANGLE_FAN ? d4 : null; if (t(I2)) return void x3.warnUnsupported("Unsupported primitive mode (" + T[d4] + "). Skipping primitive."); if (!c9.hasPositions(s8)) return void x3.warn("Skipping primitive without POSITION vertex attribute."); const E4 = c9.getPositionData(s8, a4), S = c9.getMaterial(s8, a4, i6), _2 = c9.hasNormals(s8) ? c9.getNormalData(s8, a4) : null, g4 = c9.hasTangents(s8) ? c9.getTangentData(s8, a4) : null, w5 = c9.hasTextureCoordinates(s8) ? c9.getTextureCoordinates(s8, a4) : null, N = c9.hasVertexColors(s8) ? c9.getVertexColors(s8, a4) : null, v2 = c9.getIndexData(s8, a4), M3 = { transform: r4(r12), attributes: { position: await E4, normal: _2 ? await _2 : null, texCoord0: w5 ? await w5 : null, color: N ? await N : null, tangent: g4 ? await g4 : null }, indices: await v2, primitiveType: I2, material: f7(h2, await S, p2) }; let A4 = null; r(h2.meta) && r(h2.meta.ESRI_lod) && h2.meta.ESRI_lod.metric === "screenSpaceRadius" && (A4 = h2.meta.ESRI_lod.thresholds[n8]), h2.lods[n8] = h2.lods[n8] || { parts: [], name: u8, lodThreshold: A4 }, h2.lods[n8].parts[m3] = M3; }); for (const e11 of h2.lods) e11.parts = e11.parts.filter((e12) => !!e12); return { model: h2, meta: { isEsriSymbolResource: I, uri: c9.uri }, customMeta: {} }; } function m(t12) { const o7 = t12.json; let s7 = null; return o7.nodes.forEach((t13) => { const o8 = t13.extras; r(o8) && (o8.ESRI_proxyEllipsoid || o8.ESRI_lod) && (s7 = o8); }), s7; } async function d3(e11, t12) { const o7 = e11.json, s7 = o7.scenes[o7.scene || 0].nodes, r11 = s7.length > 1, a4 = []; for (const i6 of s7) { const e12 = o7.nodes[i6]; if (a4.push(n8(i6, 0)), p(e12) && !r11) { e12.extensions.MSFT_lod.ids.forEach((e13, t13) => n8(e13, t13 + 1)); } } async function n8(s8, r12) { const i6 = o7.nodes[s8], l4 = e11.getNodeTransform(s8); if (x3.warnUnsupportedIf(i6.weights != null, "Morph targets are not supported."), i6.mesh != null) { const e12 = o7.meshes[i6.mesh]; for (const o8 of e12.primitives) a4.push(t12(o8, l4, r12, e12.name)); } for (const e12 of i6.children || []) a4.push(n8(e12, r12)); } await Promise.all(a4); } function p(e11) { return e11.extensions && e11.extensions.MSFT_lod && Array.isArray(e11.extensions.MSFT_lod.ids); } function f7(e11, t12, o7) { const s7 = (t13) => { const s8 = `${o7}_tex_${t13 && t13.id}${t13 && t13.name ? "_" + t13.name : ""}`; if (t13 && !e11.textures.has(s8)) { const o8 = l(t13.data, { wrap: { s: t13.wrapS, t: t13.wrapT }, mipmap: h.includes(t13.minFilter), noUnpackFlip: true }); e11.textures.set(s8, o8); } return s8; }, n8 = `${o7}_mat_${t12.id}_${t12.name}`; if (!e11.materials.has(n8)) { const o8 = t8({ color: [t12.color[0], t12.color[1], t12.color[2]], opacity: t12.color[3], alphaMode: t12.alphaMode, alphaCutoff: t12.alphaCutoff, doubleSided: t12.doubleSided, colorMixMode: t12.ESRI_externalColorMixMode, textureColor: t12.colorTexture ? s7(t12.colorTexture) : void 0, textureNormal: t12.normalTexture ? s7(t12.normalTexture) : void 0, textureOcclusion: t12.occlusionTexture ? s7(t12.occlusionTexture) : void 0, textureEmissive: t12.emissiveTexture ? s7(t12.emissiveTexture) : void 0, textureMetallicRoughness: t12.metallicRoughnessTexture ? s7(t12.metallicRoughnessTexture) : void 0, emissiveFactor: [t12.emissiveFactor[0], t12.emissiveFactor[1], t12.emissiveFactor[2]], metallicFactor: t12.metallicFactor, roughnessFactor: t12.roughnessFactor }); e11.materials.set(n8, o8); } return n8; } var x3 = new t7(); var h = [L2.LINEAR_MIPMAP_LINEAR, L2.LINEAR_MIPMAP_NEAREST]; var T = ["POINTS", "LINES", "LINE_LOOP", "LINE_STRIP", "TRIANGLES", "TRIANGLE_STRIP", "TRIANGLE_FAN"]; // node_modules/@arcgis/core/geometry/support/triangle.js function w3(t12, n8, p2) { return e2(O2, n8, t12), e2(V3, p2, t12), s3(_(O2, O2, V3)) / 2; } var M2 = new s4(v); var x4 = new s4(() => ({ p0: null, p1: null, p2: null })); var O2 = n(); var V3 = n(); // node_modules/@arcgis/core/views/3d/webgl-engine/lib/geometryDataUtils.js var s6 = (() => { const t12 = new Uint32Array(131072); for (let n8 = 0; n8 < t12.length; ++n8) t12[n8] = n8; return t12; })(); var f8 = new Uint16Array([0]); var c8 = (() => { const t12 = new Uint16Array(65536); for (let n8 = 0; n8 < t12.length; ++n8) t12[n8] = n8; return t12; })(); function l3(t12) { if (t12 === 1) return f8; if (t12 < c8.length) return new Uint16Array(c8.buffer, 0, t12); if (t12 > s6.length) { const n8 = Math.max(2 * s6.length, t12); s6 = new Uint32Array(n8); for (let t13 = 0; t13 < s6.length; t13++) s6[t13] = t13; } return new Uint32Array(s6.buffer, 0, t12); } function a3(t12) { if (t12 === 1) return new Uint16Array(f8); if (t12 < c8.length) return new Uint16Array(c8.slice(0, t12)); if (t12 > s6.length) { const n8 = new Uint32Array(t12); for (let t13 = 0; t13 < n8.length; t13++) n8[t13] = t13; return n8; } return new Uint32Array(s6.slice(0, t12)); } function u7(e11, o7, s7) { if (!e11) return false; const { size: f9, data: c9 } = e11; o(s7, 0, 0, 0), o(U3, 0, 0, 0); let l4 = 0, a4 = 0; for (let u8 = 0; u8 < o7.length - 2; u8 += 3) { const e12 = o7[u8 + 0] * f9, g4 = o7[u8 + 1] * f9, h2 = o7[u8 + 2] * f9; o(y, c9[e12 + 0], c9[e12 + 1], c9[e12 + 2]), o(w4, c9[g4 + 0], c9[g4 + 1], c9[g4 + 2]), o(A3, c9[h2 + 0], c9[h2 + 1], c9[h2 + 2]); const m3 = w3(y, w4, A3); m3 ? (u(y, y, w4), u(y, y, A3), q(y, y, 1 / 3 * m3), u(s7, s7, y), l4 += m3) : (u(U3, U3, y), u(U3, U3, w4), u(U3, U3, A3), a4 += 3); } return (a4 !== 0 || l4 !== 0) && (l4 !== 0 ? (q(s7, s7, 1 / l4), true) : a4 !== 0 && (q(s7, U3, 1 / a4), true)); } function g3(n8, e11, o7) { if (!n8 || !e11) return false; const { size: i6, data: s7 } = n8; o(o7, 0, 0, 0); let f9 = -1, c9 = 0; for (let t12 = 0; t12 < e11.length; t12++) { const n9 = e11[t12] * i6; f9 !== n9 && (o7[0] += s7[n9 + 0], o7[1] += s7[n9 + 1], o7[2] += s7[n9 + 2], c9++), f9 = n9; } return c9 > 1 && q(o7, o7, 1 / c9), c9 > 0; } var y = n(); var w4 = n(); var A3 = n(); var U3 = n(); // node_modules/@arcgis/core/views/3d/glTF/internal/indexUtils.js function n7(n8, o7 = l3) { return typeof n8 == "number" ? o7(n8) : i(n8) || e(n8) ? new Uint32Array(n8) : n8; } function o5(t12) { const e11 = typeof t12 == "number" ? t12 : t12.length; if (e11 < 3) return new Uint16Array(0); const r11 = e11 - 2, n8 = r11 <= 65536 ? new Uint16Array(3 * r11) : new Uint32Array(3 * r11); if (typeof t12 == "number") { let t13 = 0; for (let e12 = 0; e12 < r11; e12 += 1) e12 % 2 == 0 ? (n8[t13++] = e12, n8[t13++] = e12 + 1, n8[t13++] = e12 + 2) : (n8[t13++] = e12 + 1, n8[t13++] = e12, n8[t13++] = e12 + 2); } else { let e12 = 0; for (let o7 = 0; o7 < r11; o7 += 1) if (o7 % 2 == 0) { const r12 = t12[o7], i6 = t12[o7 + 1], f9 = t12[o7 + 2]; n8[e12++] = r12, n8[e12++] = i6, n8[e12++] = f9; } else { const r12 = t12[o7 + 1], i6 = t12[o7], f9 = t12[o7 + 2]; n8[e12++] = r12, n8[e12++] = i6, n8[e12++] = f9; } } return n8; } function i5(t12) { const e11 = typeof t12 == "number" ? t12 : t12.length; if (e11 < 3) return new Uint16Array(0); const r11 = e11 - 2, n8 = r11 <= 65536 ? new Uint16Array(3 * r11) : new Uint32Array(3 * r11); if (typeof t12 == "number") { let t13 = 0; for (let e12 = 0; e12 < r11; ++e12) n8[t13++] = 0, n8[t13++] = e12 + 1, n8[t13++] = e12 + 2; return n8; } { const e12 = t12[0]; let o7 = t12[1], i6 = 0; for (let f9 = 0; f9 < r11; ++f9) { const r12 = t12[f9 + 2]; n8[i6++] = e12, n8[i6++] = o7, n8[i6++] = r12, o7 = r12; } return n8; } } // node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultMaterial_COLOR_GAMMA.js var o6 = 2.1; export { r6 as r, f3 as f, o2 as o, n3 as n, n4 as n2, d2 as d, e7 as e, t3 as t, r8 as r2, n5 as n3, c6 as c, l3 as l, a3 as a, u7 as u, g3 as g, n7 as n4, o5 as o2, i5 as i, o6 as o3 }; //# sourceMappingURL=chunk-NBRP7CWO.js.map