@arcgis/core 4.27.0-next.20230321 → 4.27.0-next.20230322
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/LineOfSightAnalysisObserver.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02b6227c156ee0d8eb66.js +1 -0
- package/assets/esri/core/workers/chunks/{7e0c65aa61c2ff0c3504.js → 1c98b92933a48cf96c1e.js} +1 -1
- package/assets/esri/core/workers/chunks/321f272d4c7ed6b0cb46.js +1 -0
- package/assets/esri/core/workers/chunks/47bd558e2ce89f47f908.js +1 -0
- package/assets/esri/core/workers/chunks/76d6c1fc25f02bcf258e.js +1 -0
- package/assets/esri/core/workers/chunks/{c5d872adce711ec61ede.js → 8980c5dc389c27368b73.js} +1 -1
- package/assets/esri/core/workers/chunks/8d0143c0ff009b98a31f.js +1 -0
- package/assets/esri/core/workers/chunks/{6acaf28cba5d49a98fb6.js → 91b292f310f06a0cbf72.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff9efa829497557ec26a.js → aa4640a0207e0be224e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{92951b85676df776961f.js → ab8139e3a875a8b8dab9.js} +23 -25
- package/assets/esri/core/workers/chunks/{c8cd3fde6d8d43ddb954.js → b6cdf4daf07d9e55f61e.js} +1 -1
- package/assets/esri/core/workers/chunks/{6b14673a4afd6ef81487.js → c76cabd2d2510a653dff.js} +1 -1
- package/assets/esri/core/workers/chunks/{4be7647605300e07e843.js → c90fff7e28ba5b443b11.js} +1 -1
- package/assets/esri/core/workers/chunks/{e637e47000f4dc48054d.js → cc7f4fd20443a2acf0f1.js} +1 -1
- package/assets/esri/core/workers/chunks/d19e9fab4f4fb765c6a3.js +1 -0
- package/assets/esri/core/workers/chunks/d9ef4891c8b0bdd90f5b.js +1 -0
- package/assets/esri/core/workers/chunks/{d92d6a43270fb0d366b4.js → de4f5c48efbcee82c3c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{32f9b488915a4a8864e5.js → f8b9e0c1671e55b61904.js} +1 -1
- package/assets/esri/views/3d/analysis/Slice/images/heading-rotate.ts.svg +7 -28
- package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.svg +11 -0
- package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
- package/chunks/ComponentShader.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +4 -4
- package/chunks/vec42.js +1 -1
- package/core/Loadable.js +1 -1
- package/core/accessorSupport/Property.js +1 -1
- package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
- package/geometry/support/buffer/math/vec4.js +1 -1
- package/interfaces.d.ts +1 -1
- package/layers/LineOfSightLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/RefreshableLayer.js +1 -1
- package/layers/support/rasterFunctions/clipUtils.js +1 -1
- package/layers/support/rasterFunctions/stretchUtils.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/images/Factory.js +1 -1
- package/views/3d/analysis/Slice/images/generateTextures.js +1 -1
- package/views/3d/analysis/Slice/images/heading-rotate-svg.js +1 -1
- package/views/3d/analysis/Slice/images/tilt-rotate-svg.js +5 -0
- package/views/3d/analysis/Slice/settings.js +5 -0
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/PointCloudRendererUtil.js +1 -1
- package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
- package/views/3d/layers/i3s/PointGraphic.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
- package/views/3d/terrain/GeometryState.js +1 -1
- package/views/3d/terrain/PatchGeometry.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +6 -5
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +11 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/AnimationTimeStep.js +1 -1
- package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.js +5 -0
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/layers/SceneLayerView.js +1 -1
- package/views/webgl/ShaderTranspiler.js +1 -1
- package/widgets/Expand.js +1 -1
- package/assets/esri/core/workers/chunks/0487ab23a20ec356ab4c.js +0 -1
- package/assets/esri/core/workers/chunks/29ee4f14602caf6967e4.js +0 -1
- package/assets/esri/core/workers/chunks/2c0775541cfec9d43acb.js +0 -1
- package/assets/esri/core/workers/chunks/4879164b48da9ad4547a.js +0 -1
- package/assets/esri/core/workers/chunks/69060e5cffc19e76062a.js +0 -1
- package/assets/esri/core/workers/chunks/a71a5c8a9aa302bf6f01.js +0 -1
- package/assets/esri/core/workers/chunks/bc002e4dff8859571a7a.js +0 -1
- package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.svg +0 -80
- package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.png +0 -0
- package/views/3d/analysis/Slice/images/tilt-rotate-png.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/DecodeNormal.glsl.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4815],{32078:(e,t,r)=>{r.d(t,{D:()=>W,b:()=>G});var i=r(13598),o=r(1391),n=r(62707),a=r(55039),s=r(51546),l=r(77171),c=r(47624),d=r(
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4815],{32078:(e,t,r)=>{r.d(t,{D:()=>W,b:()=>G});var i=r(13598),o=r(1391),n=r(62707),a=r(55039),s=r(51546),l=r(77171),c=r(47624),d=r(60624),u=r(37099),h=r(76056),f=r(135),m=r(11317),p=r(15719),_=r(92555),g=r(89136),v=r(15817),T=r(72160),x=r(89753),b=r(5802),E=r(42001),A=r(19419),S=r(26322),w=r(85504),R=r(22539),y=r(57806),C=r(92302),O=r(96310),M=r(85787),P=r(90692),N=r(93669),I=r(172),L=r(71250),D=r(21437),H=r(74709),F=r(8319),B=r(33680),U=r(98069),V=r(93144),z=r(35065);function G(e){const t=new B.kG,{vertex:r,fragment:G,varyings:W}=t;if((0,N.Sv)(r,e),t.include(u.f),W.add("vpos","vec3"),t.include(C.k,e),t.include(c.f,e),t.include(_.L,e),e.hasColorTextureTransform&&t.include(y.av),e.output===a.H.Color||e.output===a.H.Alpha){e.hasNormalTextureTransform&&t.include(y.NI),e.hasEmissionTextureTransform&&t.include(y.R5),e.hasOcclusionTextureTransform&&t.include(y.jF),e.hasMetallicRoughnessTextureTransform&&t.include(y.DT),(0,N.hY)(r,e),t.include(d.O,e),t.include(l.w,e);const a=e.normalType===d.r.Attribute||e.normalType===d.r.CompressedAttribute;a&&e.offsetBackfaces&&t.include(n.w),t.include(v.Q,e),t.include(p.Bb,e),e.instancedColor&&t.attributes.add(z.T.INSTANCECOLOR,"vec4"),W.add("vPositionLocal","vec3"),t.include(f.D,e),t.include(o.qj,e),t.include(h.R,e),t.include(m.c,e),r.uniforms.add(new L.N("externalColor",(e=>e.externalColor))),W.add("vcolorExt","vec4"),e.hasMultipassTerrain&&W.add("depth","float"),e.hasModelTransformation&&r.uniforms.add(new F.g("model",(e=>null!=e.modelTransformation?e.modelTransformation:i.I))),r.code.add(H.H`
|
|
2
2
|
void main(void) {
|
|
3
3
|
forwardNormalizedVertexColor();
|
|
4
4
|
vcolorExt = externalColor;
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
vpos = calculateVPos();
|
|
14
14
|
vPositionLocal = vpos - view[3].xyz;
|
|
15
15
|
vpos = subtractOrigin(vpos);
|
|
16
|
-
${
|
|
16
|
+
${a?H.H`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:""}
|
|
17
17
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
18
18
|
${e.hasVertexTangents?"vTangent = dpTransformVertexTangent(tangent);":""}
|
|
19
19
|
gl_Position = transformPosition(proj, view, ${e.hasModelTransformation?"model,":""} vpos);
|
|
20
|
-
${
|
|
20
|
+
${a&&e.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
${e.hasMultipassTerrain?"depth = (view * vec4(vpos, 1.0)).z;":""}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
${e.hasOcclusionTextureTransform?H.H`forwardOcclusionUV();`:""}
|
|
30
30
|
${e.hasMetallicRoughnessTextureTransform?H.H`forwardMetallicRoughnessUV();`:""}
|
|
31
31
|
}
|
|
32
|
-
`)
|
|
32
|
+
`)}return e.output===a.H.Alpha&&(t.include(s.f5,e),t.include(M.z,e),t.include(E.l,e),G.uniforms.add([new D.p("opacity",(e=>e.opacity)),new D.p("layerOpacity",(e=>e.layerOpacity))]),e.hasColorTexture&&G.uniforms.add(new U.A("tex",(e=>e.texture))),G.include(P.y),G.code.add(H.H`
|
|
33
33
|
void main() {
|
|
34
34
|
discardBySlice(vpos);
|
|
35
35
|
${e.hasMultipassTerrain?"terrainDepthTest(gl_FragCoord, depth);":""}
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
|
|
50
50
|
discardOrAdjustAlpha(texColor);`:H.H`vec4 texColor = vec4(1.0);`}
|
|
51
51
|
shadingParams.viewDirection = normalize(vpos - cameraPosition);
|
|
52
|
-
${e.normalType===d.
|
|
52
|
+
${e.normalType===d.r.ScreenDerivative?H.H`
|
|
53
53
|
vec3 normal = screenDerivativeNormal(vPositionLocal);`:H.H`
|
|
54
54
|
shadingParams.normalView = vNormalWorld;
|
|
55
55
|
vec3 normal = shadingNormal(shadingParams);`}
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
|
|
92
92
|
${e.transparencyPassType===V.A.Color?H.H`fragColor = premultiplyAlpha(fragColor);`:""}
|
|
93
93
|
}
|
|
94
|
-
`)),t.include(g.s,e),t}const W=Object.freeze(Object.defineProperty({__proto__:null,build:G},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>F,b:()=>H});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(
|
|
94
|
+
`)),t.include(g.s,e),t}const W=Object.freeze(Object.defineProperty({__proto__:null,build:G},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>F,b:()=>H});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),d=r(37099),u=r(76056),h=r(135),f=r(11317),m=r(92555),p=r(89136),_=r(72160),g=r(89753),v=r(5802),T=r(42001),x=r(26322),b=r(85504),E=r(22539),A=r(92302),S=r(96310),w=r(85787),R=r(90692),y=r(93669),C=r(172),O=r(71250),M=r(21437),P=r(74709),N=r(33680),I=r(98069),L=r(93144),D=r(35065);function H(e){const t=new N.kG,{vertex:r,fragment:H,varyings:F}=t;return(0,y.Sv)(r,e),t.include(d.f),F.add("vpos","vec3"),t.include(A.k,e),t.include(l.f,e),t.include(m.L,e),e.output!==n.H.Color&&e.output!==n.H.Alpha||((0,y.hY)(t.vertex,e),t.include(c.O,e),t.include(s.w,e),e.offsetBackfaces&&t.include(o.w),e.instancedColor&&t.attributes.add(D.T.INSTANCECOLOR,"vec4"),F.add("vNormalWorld","vec3"),F.add("localvpos","vec3"),e.hasMultipassTerrain&&F.add("depth","float"),t.include(h.D,e),t.include(i.qj,e),t.include(u.R,e),t.include(f.c,e),r.uniforms.add(new O.N("externalColor",(e=>e.externalColor))),F.add("vcolorExt","vec4"),r.code.add(P.H`
|
|
95
95
|
void main(void) {
|
|
96
96
|
forwardNormalizedVertexColor();
|
|
97
97
|
vcolorExt = externalColor;
|
|
@@ -281,10 +281,10 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
281
281
|
|
|
282
282
|
fragColor = vec4(b / w_total);
|
|
283
283
|
}
|
|
284
|
-
`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>d,Z:()=>c,c:()=>i,f:()=>o});const c=n(),d=a(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>d,e:()=>l,n:()=>u,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[4],u=r[5],h=r[6],f=r[8],m=r[9],p=r[10],_=r[12],g=r[13],v=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+d*i+f*a+_,e[x+1]=l*r+u*i+m*a+g,e[x+2]=c*r+h*i+p*a+v,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],f=r[6],m=r[7],p=r[8];let _=0,g=0;for(let r=0;r<a;r++){const r=t[_],i=t[_+1],a=t[_+2];e[g]=s*r+d*i+f*a,e[g+1]=l*r+u*i+m*a,e[g+2]=c*r+h*i+p*a,_+=n,g+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>d,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.a)(e.origin),vector:(0,a.a)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.b)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,d=(0,n.b)(s.WM.get(),t,c),u=(0,n.e)(l,d)/(0,n.p)(l);return(0,n.g)(a,l,(0,i.uZ)(u,0,1)),(0,n.a)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},14815:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>Rr,gltfToEngineResources:()=>Cr,parseUrl:()=>yr});var i=r(32243),o=r(70586),n=r(21787),a=r(46521),s=r(52138),l=r(13598),c=r(17896),d=r(65617),u=r(60437),h=r(1533);function f(e,t=!1){return e<=h.DB?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),p=r(20773),_=r(11077),g=r(10816),v=r(56067),T=r(75488),x=r(40270),b=r(91695),E=r(91911),A=r(15317),S=r(14682),w=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:w.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:w.O,o=(0,S.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,S.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,S.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,S.c)();return(0,n.m)(l,a,s),(0,n.m)(l,o,l),l}class y{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class C{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new y,this.numberOfVertices=0}}var O=r(3172),M=r(66643),P=r(43090),N=r(20102),I=r(92604);class L{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var D=r(95330),H=r(23670);async function F(e,t){const{data:r}=await(0,O.default)(e,{responseType:"image",...t});return r}var B=r(51417),U=r(47026),V=r(24882);function z(e){if(e.length<h.DB)return Array.from(e);if((0,h.kJ)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return Uint16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var G=r(44553),W=r(11726);class k{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this._children=void 0,(0,W.hu)(e.length>=1),(0,W.hu)(r.length%this._numIndexPerPrimitive==0),(0,W.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,W.hu)(3===i.size||4===i.size);const{data:o,size:n}=i,a=e.length;let s=n*r[this._numIndexPerPrimitive*e[0]];$.clear(),$.push(s);const l=(0,d.f)(o[s],o[s+1],o[s+2]),u=(0,d.a)(l);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=n*r[i+e],$.push(s);let t=o[s];l[0]=Math.min(t,l[0]),u[0]=Math.max(t,u[0]),t=o[s+1],l[1]=Math.min(t,l[1]),u[1]=Math.max(t,u[1]),t=o[s+2],l[2]=Math.min(t,l[2]),u[2]=Math.max(t,u[2])}}this.bbMin=l,this.bbMax=u;const h=(0,c.h)((0,d.c)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(u[0]-l[0],u[1]-l[1]),u[2]-l[2]);let f=this.radius*this.radius;for(let e=0;e<$.length;++e){s=$.getItemAt(e);const t=o[s]-h[0],r=o[s+1]-h[1],i=o[s+2]-h[2],n=t*t+r*r+i*i;if(n<=f)continue;const a=Math.sqrt(n),l=.5*(a-this.radius);this.radius=this.radius+l,f=this.radius*this.radius;const c=l/a;h[0]+=t*c,h[1]+=r*c,h[2]+=i*c}this.center=h,$.clear()}getChildren(){if(this._children||(0,c.d)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,c.h)((0,d.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:o,size:n}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=n*this.indices[s],c=o[l],d=o[l+1],u=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=n*this.indices[s+e];const t=o[l],r=o[l+1],i=o[l+2];t<c&&(c=t),r<d&&(d=r),i<u&&(u=i)}c<e[0]&&(t|=1),d<e[1]&&(t|=2),u<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==s[e]&&this._children.push(new k(s[e],this._numIndexPerPrimitive,this.indices,this.position));return this._children}static prune(){$.prune()}}const $=new G.Z({deallocator:null});var q=r(17662),j=r(4726),X=r(22807),Y=r(16996);function J(e,t,r){return(0,c.b)(K,t,e),(0,c.b)(Z,r,e),(0,c.l)((0,c.f)(K,K,Z))/2}r(12981),new X.x(Y.Ue),new X.x((()=>{return e?{p0:(0,d.a)(e.p0),p1:(0,d.a)(e.p1),p2:(0,d.a)(e.p2)}:{p0:(0,d.c)(),p1:(0,d.c)(),p2:(0,d.c)()};var e}));const K=(0,d.c)(),Z=(0,d.c)(),Q=(0,d.c)(),ee=(0,d.c)(),te=(0,d.c)(),re=(0,d.c)();var ie=r(99001);class oe{constructor(e){this.channel=e,this.id=(0,ie.D)()}}var ne=r(35065);r(9820),(0,d.c)(),new Float32Array(6);class ae extends q.c{constructor(e,t,r=[],i=null,o=j.U.Mesh,n=null,a=-1){super(),this.material=e,this.mapPositions=i,this.type=o,this.objectAndLayerIdColor=n,this.edgeIndicesLength=a,this.visible=!0,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[e,r]of t)r&&this._vertexAttributes.set(e,{...r});if(null==r||0===r.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,V.KF)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,t]of r)t&&(this._indices.set(e,(0,V.mi)(t)),e===ne.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}instantiate(e={}){const t=new ae(e.material||this.material,[],void 0,this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._vertexAttributes.forEach(((e,r)=>{e.exclusive=!1,t._vertexAttributes.set(r,e)})),this._indices.forEach(((e,r)=>t._indices.set(r,e))),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){let t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:z(t.data)},this._vertexAttributes.set(e,t)),t}setAttributeData(e,t){const r=this._vertexAttributes.get(e);r&&this._vertexAttributes.set(e,{...r,exclusive:!0,data:t})}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===j.U.Mesh?this._computeAttachmentOriginTriangles(e):this.type===j.U.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,c.m)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(ne.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,c.s)(r,0,0,0),(0,c.s)(re,0,0,0);let n=0,a=0;for(let e=0;e<t.length-2;e+=3){const s=t[e]*i,l=t[e+1]*i,d=t[e+2]*i;(0,c.s)(Q,o[s],o[s+1],o[s+2]),(0,c.s)(ee,o[l],o[l+1],o[l+2]),(0,c.s)(te,o[d],o[d+1],o[d+2]);const u=J(Q,ee,te);u?((0,c.a)(Q,Q,ee),(0,c.a)(Q,Q,te),(0,c.g)(Q,Q,1/3*u),(0,c.a)(r,r,Q),n+=u):((0,c.a)(re,re,Q),(0,c.a)(re,re,ee),(0,c.a)(re,re,te),a+=3)}return!(0===a&&0===n||(0!==n?((0,c.g)(r,r,1/n),0):0===a||((0,c.g)(r,re,1/a),0)))}(this.vertexAttributes.get(ne.T.POSITION),t,e)}_computeAttachmentOriginLines(e){const t=this.vertexAttributes.get(ne.T.POSITION),r=this.indices.get(ne.T.POSITION);return function(e,t,r,i){if(!e)return!1;(0,c.s)(i,0,0,0),(0,c.s)(re,0,0,0);let o=0,n=0;const{size:a,data:s}=e,l=t?t.length-1:s.length/a-1,d=l+(r?2:0);for(let e=0;e<d;e+=2){const r=e<l?e:l,d=e<l?e+1:0,u=(t?t[r]:r)*a,h=(t?t[d]:d)*a;Q[0]=s[u],Q[1]=s[u+1],Q[2]=s[u+2],ee[0]=s[h],ee[1]=s[h+1],ee[2]=s[h+2],(0,c.g)(Q,(0,c.a)(Q,Q,ee),.5);const f=(0,c.j)(Q,ee);f>0?((0,c.a)(i,i,(0,c.g)(Q,Q,f)),o+=f):0===o&&((0,c.a)(re,re,Q),n++)}return 0!==o?((0,c.g)(i,i,1/o),!0):0!==n&&((0,c.g)(i,re,1/n),!0)}(t,r,r&&function(e,t,r){return!(!("isClosed"in e)||!e.isClosed)&&(r?r.length>2:t.data.length>6)}(this.material.parameters,t,r),e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(ne.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,c.s)(r,0,0,0);let n=-1,a=0;for(let e=0;e<t.length;e++){const s=t[e]*i;n!==s&&(r[0]+=o[s],r[1]+=o[s+1],r[2]+=o[s+2],a++),n=s}return a>1&&(0,c.g)(r,r,1/a),a>0}(this.vertexAttributes.get(ne.T.POSITION),t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(ne.T.POSITION),t=this.vertexAttributes.get(ne.T.POSITION);if(!e||0===e.length||!t)return null;const r=this.type===j.U.Mesh?3:1;(0,W.hu)(e.length%r==0,"Indexing error: "+e.length+" not divisible by "+r);const i=(0,V.KF)(e.length/r);return new k(i,r,e,t)}get transformation(){return this._transformation??l.I}set transformation(e){this._transformation=e&&e!==l.I?(0,l.b)(e):null}get shaderTransformation(){return null!=this._shaderTransformer?this._shaderTransformer(this.transformation):this.transformation}get shaderTransformer(){return this._shaderTransformer}set shaderTransformer(e){this._shaderTransformer=e}get hasVolatileTransformation(){return null!=this._shaderTransformer}addHighlight(){const e=new oe(U.V_.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}var se=r(74085),le=r(32448),ce=r(22021),de=r(17452),ue=r(85958),he=r(88669),fe=r(51666),me=r(71250),pe=r(74709),_e=r(33680),ge=r(98069);class ve extends pe.K{constructor(){super(...arguments),this.color=(0,he.f)(1,1,1,1)}}Object.freeze(Object.defineProperty({__proto__:null,TextureOnlyPassParameters:ve,build:function(){const e=new _e.kG;return e.include(fe.k),e.fragment.uniforms.add([new ge.A("tex",(e=>e.texture)),new me.N("uColor",(e=>e.color))]),e.fragment.code.add(pe.H`void main() {
|
|
284
|
+
`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>d,Z:()=>c,c:()=>i,f:()=>o});const c=n(),d=a(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>d,e:()=>l,n:()=>u,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[4],u=r[5],h=r[6],f=r[8],m=r[9],p=r[10],_=r[12],g=r[13],v=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+d*i+f*a+_,e[x+1]=l*r+u*i+m*a+g,e[x+2]=c*r+h*i+p*a+v,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],f=r[6],m=r[7],p=r[8];let _=0,g=0;for(let r=0;r<a;r++){const r=t[_],i=t[_+1],a=t[_+2];e[g]=s*r+d*i+f*a,e[g+1]=l*r+u*i+m*a,e[g+2]=c*r+h*i+p*a,_+=n,g+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>d,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.a)(e.origin),vector:(0,a.a)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.b)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,d=(0,n.b)(s.WM.get(),t,c),u=(0,n.e)(l,d)/(0,n.p)(l);return(0,n.g)(a,l,(0,i.uZ)(u,0,1)),(0,n.a)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},14815:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>Rr,gltfToEngineResources:()=>Cr,parseUrl:()=>yr});var i=r(32243),o=r(70586),n=r(21787),a=r(46521),s=r(52138),l=r(13598),c=r(17896),d=r(65617),u=r(60437),h=r(1533);function f(e,t=!1){return e<=h.DB?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),p=r(20773),_=r(11077),g=r(10816),v=r(56067),T=r(75488),x=r(40270),b=r(91695),E=r(91911),A=r(15317),S=r(14682),w=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:w.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:w.O,o=(0,S.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,S.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,S.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,S.c)();return(0,n.m)(l,a,s),(0,n.m)(l,o,l),l}class y{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class C{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new y,this.numberOfVertices=0}}var O=r(3172),M=r(66643),P=r(43090),N=r(20102),I=r(92604);class L{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var D=r(95330),H=r(23670);async function F(e,t){const{data:r}=await(0,O.default)(e,{responseType:"image",...t});return r}var B=r(51417),U=r(47026),V=r(24882);function z(e){if(e.length<h.DB)return Array.from(e);if((0,h.kJ)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,h.Uc)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var G=r(44553),W=r(11726);class k{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this._children=void 0,(0,W.hu)(e.length>=1),(0,W.hu)(r.length%this._numIndexPerPrimitive==0),(0,W.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,W.hu)(3===i.size||4===i.size);const{data:o,size:n}=i,a=e.length;let s=n*r[this._numIndexPerPrimitive*e[0]];$.clear(),$.push(s);const l=(0,d.f)(o[s],o[s+1],o[s+2]),u=(0,d.a)(l);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=n*r[i+e],$.push(s);let t=o[s];l[0]=Math.min(t,l[0]),u[0]=Math.max(t,u[0]),t=o[s+1],l[1]=Math.min(t,l[1]),u[1]=Math.max(t,u[1]),t=o[s+2],l[2]=Math.min(t,l[2]),u[2]=Math.max(t,u[2])}}this.bbMin=l,this.bbMax=u;const h=(0,c.h)((0,d.c)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(u[0]-l[0],u[1]-l[1]),u[2]-l[2]);let f=this.radius*this.radius;for(let e=0;e<$.length;++e){s=$.getItemAt(e);const t=o[s]-h[0],r=o[s+1]-h[1],i=o[s+2]-h[2],n=t*t+r*r+i*i;if(n<=f)continue;const a=Math.sqrt(n),l=.5*(a-this.radius);this.radius=this.radius+l,f=this.radius*this.radius;const c=l/a;h[0]+=t*c,h[1]+=r*c,h[2]+=i*c}this.center=h,$.clear()}getChildren(){if(this._children||(0,c.d)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,c.h)((0,d.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:o,size:n}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=n*this.indices[s],c=o[l],d=o[l+1],u=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=n*this.indices[s+e];const t=o[l],r=o[l+1],i=o[l+2];t<c&&(c=t),r<d&&(d=r),i<u&&(u=i)}c<e[0]&&(t|=1),d<e[1]&&(t|=2),u<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==s[e]&&this._children.push(new k(s[e],this._numIndexPerPrimitive,this.indices,this.position));return this._children}static prune(){$.prune()}}const $=new G.Z({deallocator:null});var q=r(17662),j=r(4726),X=r(22807),Y=r(16996);function J(e,t,r){return(0,c.b)(K,t,e),(0,c.b)(Z,r,e),(0,c.l)((0,c.f)(K,K,Z))/2}r(12981),new X.x(Y.Ue),new X.x((()=>{return e?{p0:(0,d.a)(e.p0),p1:(0,d.a)(e.p1),p2:(0,d.a)(e.p2)}:{p0:(0,d.c)(),p1:(0,d.c)(),p2:(0,d.c)()};var e}));const K=(0,d.c)(),Z=(0,d.c)(),Q=(0,d.c)(),ee=(0,d.c)(),te=(0,d.c)(),re=(0,d.c)();var ie=r(99001);class oe{constructor(e){this.channel=e,this.id=(0,ie.D)()}}var ne=r(35065);r(9820),(0,d.c)(),new Float32Array(6);class ae extends q.c{constructor(e,t,r=[],i=null,o=j.U.Mesh,n=null,a=-1){super(),this.material=e,this.mapPositions=i,this.type=o,this.objectAndLayerIdColor=n,this.edgeIndicesLength=a,this.visible=!0,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[e,r]of t)r&&this._vertexAttributes.set(e,{...r});if(null==r||0===r.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,V.KF)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,t]of r)t&&(this._indices.set(e,(0,V.mi)(t)),e===ne.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}instantiate(e={}){const t=new ae(e.material||this.material,[],void 0,this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._vertexAttributes.forEach(((e,r)=>{e.exclusive=!1,t._vertexAttributes.set(r,e)})),this._indices.forEach(((e,r)=>t._indices.set(r,e))),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){let t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:z(t.data)},this._vertexAttributes.set(e,t)),t}setAttributeData(e,t){const r=this._vertexAttributes.get(e);r&&this._vertexAttributes.set(e,{...r,exclusive:!0,data:t})}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===j.U.Mesh?this._computeAttachmentOriginTriangles(e):this.type===j.U.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,c.m)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(ne.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,c.s)(r,0,0,0),(0,c.s)(re,0,0,0);let n=0,a=0;for(let e=0;e<t.length-2;e+=3){const s=t[e]*i,l=t[e+1]*i,d=t[e+2]*i;(0,c.s)(Q,o[s],o[s+1],o[s+2]),(0,c.s)(ee,o[l],o[l+1],o[l+2]),(0,c.s)(te,o[d],o[d+1],o[d+2]);const u=J(Q,ee,te);u?((0,c.a)(Q,Q,ee),(0,c.a)(Q,Q,te),(0,c.g)(Q,Q,1/3*u),(0,c.a)(r,r,Q),n+=u):((0,c.a)(re,re,Q),(0,c.a)(re,re,ee),(0,c.a)(re,re,te),a+=3)}return!(0===a&&0===n||(0!==n?((0,c.g)(r,r,1/n),0):0===a||((0,c.g)(r,re,1/a),0)))}(this.vertexAttributes.get(ne.T.POSITION),t,e)}_computeAttachmentOriginLines(e){const t=this.vertexAttributes.get(ne.T.POSITION),r=this.indices.get(ne.T.POSITION);return function(e,t,r,i){if(!e)return!1;(0,c.s)(i,0,0,0),(0,c.s)(re,0,0,0);let o=0,n=0;const{size:a,data:s}=e,l=t?t.length-1:s.length/a-1,d=l+(r?2:0);for(let e=0;e<d;e+=2){const r=e<l?e:l,d=e<l?e+1:0,u=(t?t[r]:r)*a,h=(t?t[d]:d)*a;Q[0]=s[u],Q[1]=s[u+1],Q[2]=s[u+2],ee[0]=s[h],ee[1]=s[h+1],ee[2]=s[h+2],(0,c.g)(Q,(0,c.a)(Q,Q,ee),.5);const f=(0,c.j)(Q,ee);f>0?((0,c.a)(i,i,(0,c.g)(Q,Q,f)),o+=f):0===o&&((0,c.a)(re,re,Q),n++)}return 0!==o?((0,c.g)(i,i,1/o),!0):0!==n&&((0,c.g)(i,re,1/n),!0)}(t,r,r&&function(e,t,r){return!(!("isClosed"in e)||!e.isClosed)&&(r?r.length>2:t.data.length>6)}(this.material.parameters,t,r),e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(ne.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,c.s)(r,0,0,0);let n=-1,a=0;for(let e=0;e<t.length;e++){const s=t[e]*i;n!==s&&(r[0]+=o[s],r[1]+=o[s+1],r[2]+=o[s+2],a++),n=s}return a>1&&(0,c.g)(r,r,1/a),a>0}(this.vertexAttributes.get(ne.T.POSITION),t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(ne.T.POSITION),t=this.vertexAttributes.get(ne.T.POSITION);if(!e||0===e.length||!t)return null;const r=this.type===j.U.Mesh?3:1;(0,W.hu)(e.length%r==0,"Indexing error: "+e.length+" not divisible by "+r);const i=(0,V.KF)(e.length/r);return new k(i,r,e,t)}get transformation(){return this._transformation??l.I}set transformation(e){this._transformation=e&&e!==l.I?(0,l.b)(e):null}get shaderTransformation(){return null!=this._shaderTransformer?this._shaderTransformer(this.transformation):this.transformation}get shaderTransformer(){return this._shaderTransformer}set shaderTransformer(e){this._shaderTransformer=e}get hasVolatileTransformation(){return null!=this._shaderTransformer}addHighlight(){const e=new oe(U.V_.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}var se=r(74085),le=r(32448),ce=r(22021),de=r(17452),ue=r(85958),he=r(88669),fe=r(51666),me=r(71250),pe=r(74709),_e=r(33680),ge=r(98069);class ve extends pe.K{constructor(){super(...arguments),this.color=(0,he.f)(1,1,1,1)}}Object.freeze(Object.defineProperty({__proto__:null,TextureOnlyPassParameters:ve,build:function(){const e=new _e.kG;return e.include(fe.k),e.fragment.uniforms.add([new ge.A("tex",(e=>e.texture)),new me.N("uColor",(e=>e.color))]),e.fragment.code.add(pe.H`void main() {
|
|
285
285
|
vec4 texColor = texture(tex, uv);
|
|
286
286
|
fragColor = texColor * uColor;
|
|
287
|
-
}`),e}},Symbol.toStringTag,{value:"Module"}));var Te=r(99880);let xe;var be,Ee;(Ee=be||(be={}))[Ee.ETC1_RGB=0]="ETC1_RGB",Ee[Ee.ETC2_RGBA=1]="ETC2_RGBA",Ee[Ee.BC1_RGB=2]="BC1_RGB",Ee[Ee.BC3_RGBA=3]="BC3_RGBA",Ee[Ee.BC4_R=4]="BC4_R",Ee[Ee.BC5_RG=5]="BC5_RG",Ee[Ee.BC7_M6_RGB=6]="BC7_M6_RGB",Ee[Ee.BC7_M5_RGBA=7]="BC7_M5_RGBA",Ee[Ee.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Ee[Ee.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Ee[Ee.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Ee[Ee.ATC_RGB=11]="ATC_RGB",Ee[Ee.ATC_RGBA=12]="ATC_RGBA",Ee[Ee.FXT1_RGB=17]="FXT1_RGB",Ee[Ee.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Ee[Ee.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Ee[Ee.ETC2_EAC_R11=20]="ETC2_EAC_R11",Ee[Ee.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Ee[Ee.RGBA32=13]="RGBA32",Ee[Ee.RGB565=14]="RGB565",Ee[Ee.BGR565=15]="BGR565",Ee[Ee.RGBA4444=16]="RGBA4444";var Ae=r(35371),Se=r(75656),we=r(45762);let Re=null,ye=null;async function Ce(){return null==ye&&(ye=function(){if(null==xe){const e=e=>(0,Te.V)(`esri/libs/basisu/${e}`);xe=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return xe}(),Re=await ye),ye}function Oe(e,t,r,i,o){const n=(0,we.RG)(t?Ae.q_.COMPRESSED_RGBA8_ETC2_EAC:Ae.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function Me(e){return e.getNumImages()>=1&&!e.isUASTC()}function Pe(e){return e.getFaces()>=1&&e.isETC1S()}function Ne(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[be.ETC2_RGBA,Ae.q_.COMPRESSED_RGBA8_ETC2_EAC]:[be.ETC1_RGB,Ae.q_.COMPRESSED_RGB8_ETC2]:c?i?[be.BC3_RGBA,Ae.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[be.BC1_RGB,Ae.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[be.RGBA32,Ae.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,d))),s(e,d,f[e]);const m=f.length>1,p=m?Ae.cw.LINEAR_MIPMAP_LINEAR:Ae.cw.LINEAR,_={...t,samplingMode:p,hasMipmap:m,internalFormat:u,width:o,height:n};return new Se.x(e,_,{type:"compressed",levels:f})}const Ie=I.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),Le=542327876,De=131072,He=4;function Fe(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Be=Fe("DXT1"),Ue=Fe("DXT3"),Ve=Fe("DXT5"),ze=31,Ge=0,We=1,ke=2,$e=3,qe=4,je=7,Xe=20,Ye=21;var Je,Ke,Ze=r(89917),Qe=r(54738),et=r(33696);class tt extends q.c{constructor(e,t){super(),this._data=e,this.type=j.U.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new le.Z,this._passParameters=new ve,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:Ae.e8.REPEAT,t:Ae.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||U.CE.STRETCH,this.estimatedTexMemRequired=tt._estimateTexMemRequired(this._data,this.params),this._startPreload()}_startPreload(){const e=this._data;null!=e&&(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,de.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,de.HK)(e.src)||(0,de.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if(null==e)return 0;if((0,h.eP)(e)||(0,h.lq)(e))return t.encoding===U.Ti.KTX2_ENCODING?function(e,t){if(null==Re)return e.byteLength;const r=new Re.KTX2File(new Uint8Array(e)),i=Pe(r)?Oe(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===U.Ti.BASIS_ENCODING?function(e,t){if(null==Re)return e.byteLength;const r=new Re.BasisFile(new Uint8Array(e)),i=Me(r)?Oe(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?tt._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this._data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){return{target:Ae.No.TEXTURE_2D,pixelFormat:Ae.VI.RGBA,dataType:Ae.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?Ae.cw.LINEAR_MIPMAP_LINEAR:Ae.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.maxAnisotropy??(this.params.mipmap?e.parameters.maxMaxAnisotropy:1)}}get glTexture(){return this._glTexture}load(e,t){if(null!=this._glTexture)return this._glTexture;if(null!=this._loadingPromise)return this._loadingPromise;const r=this._data;return null==r?(this._glTexture=new Se.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,h.eP)(r)||(0,h.lq)(r))&&this.params.encoding===U.Ti.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,r)):((0,h.eP)(r)||(0,h.lq)(r))&&this.params.encoding===U.Ti.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,r)):((0,h.eP)(r)||(0,h.lq)(r))&&this.params.encoding===U.Ti.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,r)):(0,h.lq)(r)?this._loadFromPixelData(e,r):(0,h.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this._data instanceof HTMLVideoElement)||null==this._glTexture)return r;if(this._data.readyState<Je.HAVE_CURRENT_DATA||r===this._data.currentTime)return r;if(null!=this._powerOfTwoStretchInfo){const{framebuffer:r,vao:i,sourceTexture:o}=this._powerOfTwoStretchInfo;o.setData(this._data),this._drawStretchedTexture(e,t,r,i,o,this._glTexture)}else{const{videoWidth:e,videoHeight:t}=this._data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),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(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:n,width:a,height:s}=(0,o.s3)(function(e,t){const r=new Int32Array(e,0,ze);if(r[Ge]!==Le)return Ie.error("Invalid magic number in DDS header"),null;if(!(r[Xe]&He))return Ie.error("Unsupported format, must contain a FourCC code"),null;const i=r[Ye];let o,n;switch(i){case Be:o=8,n=Ae.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ue:o=16,n=Ae.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Ve:o=16,n=Ae.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Ie.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[qe],l=r[$e];0==(3&s)&&0==(3&l)||(Ie.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;r[ke]&De&&!1!==t&&(a=Math.max(1,r[je])),1===a||(0,ce.wt)(s)&&(0,ce.wt)(l)||(Ie.warn("Ignoring mipmaps of non power of two sized compressed texture."),a=1);let f=r[We]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,f,h),m.push(u),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:n,width:c,height:d}}(r,t.hasMipmap??!1));return t.samplingMode=i.levels.length>1?Ae.cw.LINEAR_MIPMAP_LINEAR:Ae.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new Se.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Re&&(Re=await Ce());const i=new Re.KTX2File(new Uint8Array(r));if(!Pe(i))return null;i.startTranscoding();const o=Ne(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Re&&(Re=await Ce());const i=new Re.BasisFile(new Uint8Array(r));if(!Me(i))return null;i.startTranscoding();const o=Ne(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,W.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?Ae.VI.LUMINANCE:3===this.params.components?Ae.VI.RGB:Ae.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new Se.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const o=await F(r,{signal:i});return(0,D.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const o=await(0,ue.fY)(r,r.src,!1,i);return(0,D.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Je.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((n,a)=>{const s=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),(0,o.hw)(d)},l=()=>{r.readyState>=Je.HAVE_CURRENT_DATA&&(s(),n(this._loadFromImage(e,r,t)))},c=e=>{s(),a(e||new N.Z("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const d=(0,D.fu)(i,(()=>c((0,D.zE)())))}))))}_loadFromImage(e,t,r){const i=tt._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this.params.components?Ae.VI.RGB:Ae.VI.RGBA,!this._requiresPowerOfTwo(e,o)||(0,ce.wt)(i.width)&&(0,ce.wt)(i.height)?(o.width=i.width,o.height=i.height,this._glTexture=new Se.x(e,o,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,o,r),this._glTexture)}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}_requiresPowerOfTwo(e,t){const r=Ae.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return e.type===Qe.zO.WEBGL1&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,o){const{width:n,height:a}=r,s=(0,ce.Sf)(n),l=(0,ce.Sf)(a);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case U.CE.PAD:i.textureCoordinateScaleFactor=[n/s,a/l],c=new Se.x(e,i),c.updateData(0,0,0,n,a,t);break;case U.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,o());break;default:(0,se.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const o=new Se.x(e,r),n=new et.X(e,{colorTarget:Ae.Lm.TEXTURE,depthStencilTarget:Ae.OU.NONE},o),a=new Se.x(e,{target:Ae.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:Ae.Br.UNSIGNED_BYTE,wrapMode:Ae.e8.CLAMP_TO_EDGE,samplingMode:Ae.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=(0,Ze.ow)(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,n,s,a,o),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:a,framebuffer:n}:(s.dispose(!0),a.dispose(),n.detachColorTexture(),n.dispose()),e.bindFramebuffer(l),o}_drawStretchedTexture(e,t,r,i,o,n){this._passParameters.texture=o,e.bindFramebuffer(r);const a=e.getViewport();e.setViewport(0,0,n.descriptor.width,n.descriptor.height),e.bindTechnique(t,this._passParameters,null),e.bindVAO(i),e.drawArrays(Ae.MX.TRIANGLE_STRIP,0,(0,we._V)(i,"geometry")),e.bindFramebuffer(null),e.setViewport(a.x,a.y,a.width,a.height),this._passParameters.texture=null}unload(){if(null!=this._powerOfTwoStretchInfo){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if(null!=this._glTexture&&(this._glTexture.dispose(),this._glTexture=null),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}(Ke=Je||(Je={}))[Ke.HAVE_NOTHING=0]="HAVE_NOTHING",Ke[Ke.HAVE_METADATA=1]="HAVE_METADATA",Ke[Ke.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Ke[Ke.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Ke[Ke.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var rt=r(80442),it=r(64822),ot=r(65576),nt=r(55039),at=r(19419),st=r(85504),lt=r(60537),ct=r(82791),dt=r(93144),ut=r(27097);const ht=(0,ut.wK)(Ae.zi.SRC_ALPHA,Ae.zi.ONE,Ae.zi.ONE_MINUS_SRC_ALPHA,Ae.zi.ONE_MINUS_SRC_ALPHA),ft=(0,ut.if)(Ae.zi.ONE,Ae.zi.ONE),mt=(0,ut.if)(Ae.zi.ZERO,Ae.zi.ONE_MINUS_SRC_ALPHA);function pt(e){return e===dt.A.FrontFace?null:e===dt.A.Alpha?mt:ft}const _t={factor:-1,units:-2};function gt(e,t=Ae.wb.LESS){return e===dt.A.NONE||e===dt.A.FrontFace?t:Ae.wb.LEQUAL}var vt,Tt;(Tt=vt||(vt={}))[Tt.INTEGRATED_MESH=0]="INTEGRATED_MESH",Tt[Tt.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",Tt[Tt.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",Tt[Tt.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",Tt[Tt.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",Tt[Tt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",Tt[Tt.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",Tt[Tt.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",Tt[Tt.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",Tt[Tt.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",Tt[Tt.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",Tt[Tt.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",Tt[Tt.LASERLINES=12]="LASERLINES",Tt[Tt.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",Tt[Tt.HUD_MATERIAL=14]="HUD_MATERIAL",Tt[Tt.LABEL_MATERIAL=15]="LABEL_MATERIAL",Tt[Tt.LINE_CALLOUTS=16]="LINE_CALLOUTS",Tt[Tt.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",Tt[Tt.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",Tt[Tt.DRAPED_WATER=19]="DRAPED_WATER",Tt[Tt.VOXEL=20]="VOXEL",Tt[Tt.MAX_SLOTS=21]="MAX_SLOTS";var xt=r(51305),bt=r(94961),Et=r(72119),At=r(29268);const St=(0,d.c)(),wt=(0,d.c)(),Rt=(0,d.c)(),yt=new class{constructor(e=0){this.offset=e,this.sphere=(0,At.c)(),this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],n=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+n*n+a*a);o+=o*s,n+=n*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*n+l[8]*a+l[12],this.tmpVertex[1]=l[1]*o+l[5]*n+l[9]*a+l[13],this.tmpVertex[2]=l[2]*o+l[6]*n+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,d.c)(),this._mbs=(0,At.c)(),this._obb={center:(0,d.c)(),halfSize:(0,Et.c)(),quaternion:null},this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,n=r+this.componentLocalOriginLength,a=this._totalOffset/Math.sqrt(i*i+o*o+n*n);return this._tmpVertex[0]=e+i*a,this._tmpVertex[1]=t+o*a,this._tmpVertex[2]=r+n*a,this._tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],n=e[4],a=e[5]+this.componentLocalOriginLength,s=t*o<0?0:Math.min(Math.abs(t),Math.abs(o)),l=r*n<0?0:Math.min(Math.abs(r),Math.abs(n)),c=i*a<0?0:Math.min(Math.abs(i),Math.abs(a)),d=Math.sqrt(s*s+l*l+c*c);if(d<this._totalOffset)return e[0]-=t<0?this._totalOffset:0,e[1]-=r<0?this._totalOffset:0,e[2]-=i<0?this._totalOffset:0,e[3]+=o>0?this._totalOffset:0,e[4]+=n>0?this._totalOffset:0,e[5]+=a>0?this._totalOffset:0,e;const u=Math.max(Math.abs(t),Math.abs(o)),h=Math.max(Math.abs(r),Math.abs(n)),f=Math.max(Math.abs(i),Math.abs(a)),m=Math.sqrt(u*u+h*h+f*f),p=this._totalOffset/m,_=this._totalOffset/d;return e[0]+=t*(t>0?p:_),e[1]+=r*(r>0?p:_),e[2]+=i*(i>0?p:_),e[3]+=o*(o<0?p:_),e[4]+=n*(n<0?p:_),e[5]+=a*(a<0?p:_),e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this._totalOffset/t;return this._mbs[0]=e[0]+e[0]*r,this._mbs[1]=e[1]+e[1]*r,this._mbs[2]=e[2]+e[2]*r,this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){const t=e.center,r=this._totalOffset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this._obb.center[0]=t[0]+t[0]*r,this._obb.center[1]=t[1]+t[1]*r,this._obb.center[2]=t[2]+t[2]*r,(0,c.q)(this._obb.halfSize,e.halfSize,e.quaternion),(0,c.a)(this._obb.halfSize,this._obb.halfSize,e.center);const i=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]*i,this._obb.halfSize[1]+=this._obb.halfSize[1]*i,this._obb.halfSize[2]+=this._obb.halfSize[2]*i,(0,c.b)(this._obb.halfSize,this._obb.halfSize,e.center),(0,xt.c)(Ct,e.quaternion),(0,c.q)(this._obb.halfSize,this._obb.halfSize,Ct),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=e.quaternion,this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],n=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+o*o+n*n);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+o*a,this.tmpVertex[2]=r+n*a,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)St[t]=e[0+t]+this.localOrigin[t],wt[t]=e[3+t]+this.localOrigin[t],Rt[t]=St[t];const t=this.applyToVertex(St[0],St[1],St[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let t=0;t<3;++t)Rt[t]=0==(e&1<<t)?St[t]:wt[t];r(Rt)}let i=0;for(let e=0;e<3;++e)St[e]*wt[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)i[t]?Rt[t]=0:Rt[t]=0!=(e&1<<t)?St[t]:wt[t];r(Rt)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ct=(0,bt.a)();function Ot(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function Mt(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function Pt(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}function Nt(e,t,r,i,o,n=1){if(!r)return void Mt(e,t,i,o,n);const a=i.typedBuffer,l=i.typedBufferStride,c=e.length,d=r[0],u=r[1],h=r[2],f=r[4],m=r[5],p=r[6],_=r[8],g=r[9],v=r[10],T=r[12],x=r[13],b=r[14];o*=l;let E=0,A=0,S=0;const w=(0,s.y)(r)?e=>{E=t[e]+T,A=t[e+1]+x,S=t[e+2]+b}:e=>{const r=t[e],i=t[e+1],o=t[e+2];E=d*r+f*i+_*o+T,A=u*r+m*i+g*o+x,S=h*r+p*i+v*o+b};if(1===n)for(let t=0;t<c;++t)w(3*e[t]),a[o]=E,a[o+1]=A,a[o+2]=S,o+=l;else for(let t=0;t<c;++t){w(3*e[t]);for(let e=0;e<n;++e)a[o]=E,a[o+1]=A,a[o+2]=S,o+=l}}function It(e,t,r,i,o,n=1){if(!r)return void Mt(e,t,i,o,n);const a=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=a[0],h=a[1],f=a[2],m=a[4],p=a[5],_=a[6],g=a[8],v=a[9],T=a[10],x=!(0,s.z)(a),b=1e-6,E=1-b;o*=c;let A=0,S=0,w=0;const R=(0,s.y)(a)?e=>{A=t[e],S=t[e+1],w=t[e+2]}:e=>{const r=t[e],i=t[e+1],o=t[e+2];A=u*r+m*i+g*o,S=h*r+p*i+v*o,w=f*r+_*i+T*o};if(1===n)if(x)for(let t=0;t<d;++t){R(3*e[t]);const r=A*A+S*S+w*w;if(r<E&&r>b){const e=1/Math.sqrt(r);l[o]=A*e,l[o+1]=S*e,l[o+2]=w*e}else l[o]=A,l[o+1]=S,l[o+2]=w;o+=c}else for(let t=0;t<d;++t)R(3*e[t]),l[o]=A,l[o+1]=S,l[o+2]=w,o+=c;else for(let t=0;t<d;++t){if(R(3*e[t]),x){const e=A*A+S*S+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,w*=t}}for(let e=0;e<n;++e)l[o]=A,l[o+1]=S,l[o+2]=w,o+=c}}function Lt(e,t,r,i,o,n=1){if(!r)return void Pt(e,t,i,o,n);const a=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=a[0],h=a[1],f=a[2],m=a[4],p=a[5],_=a[6],g=a[8],v=a[9],T=a[10],x=!(0,s.z)(a),b=1e-6,E=1-b;if(o*=c,1===n)for(let r=0;r<d;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],d=t[i+3];let A=u*n+m*a+g*s,S=h*n+p*a+v*s,w=f*n+_*a+T*s;if(x){const e=A*A+S*S+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,w*=t}}l[o]=A,l[o+1]=S,l[o+2]=w,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],a=t[i],s=t[i+1],d=t[i+2],A=t[i+3];let S=u*a+m*s+g*d,w=h*a+p*s+v*d,R=f*a+_*s+T*d;if(x){const e=S*S+w*w+R*R;if(e<E&&e>b){const t=1/Math.sqrt(e);S*=t,w*=t,R*=t}}for(let e=0;e<n;++e)l[o]=S,l[o+1]=w,l[o+2]=R,l[o+3]=A,o+=c}}function Dt(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,r!==t.length||4!==r)if(1!==n)if(4!==r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}else for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else{if(4===r){for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}return}for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else{a[o]=t[0],a[o+1]=t[1],a[o+2]=t[2],a[o+3]=t[3];const e=new Uint32Array(i.typedBuffer.buffer,i.start),r=s/4,c=e[o/=4];o+=r;const d=l*n;for(let t=1;t<d;++t)e[o]=c,o+=r}}function Ht(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length,s=t[0];i*=n;for(let e=0;e<a;++e)o[i]=s,i+=n}function Ft(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}class Bt{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(ne.T.POSITION).length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)switch(a){case ne.T.POSITION:{(0,W.hu)(3===t.size);const e=o.getField(a,m.ct);(0,W.hu)(!!e,`No buffer view for ${a}`),e&&Nt(s,t.data,r,e,n);break}case ne.T.NORMAL:{(0,W.hu)(3===t.size);const e=o.getField(a,m.ct);(0,W.hu)(!!e,`No buffer view for ${a}`),e&&It(s,t.data,i,e,n);break}case ne.T.UV0:{(0,W.hu)(2===t.size);const e=o.getField(a,m.Eu);(0,W.hu)(!!e,`No buffer view for ${a}`),e&&Ot(s,t.data,e,n);break}case ne.T.COLOR:case ne.T.SYMBOLCOLOR:{const e=o.getField(a,m.mc);(0,W.hu)(!!e,`No buffer view for ${a}`),(0,W.hu)(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||Dt(s,t.data,t.size,e,n);break}case ne.T.COLORFEATUREATTRIBUTE:{const e=o.getField(a,m.ly);(0,W.hu)(!!e,`No buffer view for ${a}`),(0,W.hu)(1===t.size),e&&1===t.size&&Ht(s,t.data,e,n);break}case ne.T.TANGENT:{(0,W.hu)(4===t.size);const e=o.getField(a,m.ek);(0,W.hu)(!!e,`No buffer view for ${a}`),e&&Lt(s,t.data,i,e,n);break}case ne.T.PROFILERIGHT:case ne.T.PROFILEUP:case ne.T.PROFILEVERTEXANDNORMAL:case ne.T.FEATUREVALUE:{(0,W.hu)(4===t.size);const e=o.getField(a,m.ek);(0,W.hu)(!!e,`No buffer view for ${a}`),e&&Pt(s,t.data,e,n)}}else if(a===ne.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(ne.T.POSITION);if((0,W.hu)(!!t,`No buffer view for ${a}`),t){const r=t.length,i=o.getField(a,m.mc);Ft(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var Ut=r(57790),Vt=r(64267),zt=r(135),Gt=r(15719),Wt=r(96310),kt=r(78869),$t=r(14589),qt=r(83475),jt=r(59377);Ae.wb.LESS,Ae.wb.ALWAYS;const Xt={mask:255},Yt={function:{func:Ae.wb.ALWAYS,ref:U.hU.OutlineVisualElementMask,mask:U.hU.OutlineVisualElementMask},operation:{fail:Ae.xS.KEEP,zFail:Ae.xS.KEEP,zPass:Ae.xS.ZERO}},Jt={function:{func:Ae.wb.ALWAYS,ref:U.hU.OutlineVisualElementMask,mask:U.hU.OutlineVisualElementMask},operation:{fail:Ae.xS.KEEP,zFail:Ae.xS.KEEP,zPass:Ae.xS.REPLACE}};Ae.wb.EQUAL,U.hU.OutlineVisualElementMask,U.hU.OutlineVisualElementMask,Ae.xS.KEEP,Ae.xS.KEEP,Ae.xS.KEEP,Ae.wb.NOTEQUAL,U.hU.OutlineVisualElementMask,U.hU.OutlineVisualElementMask,Ae.xS.KEEP,Ae.xS.KEEP,Ae.xS.KEEP;var Kt=r(32078);class Zt extends Gt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,d.f)(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=U.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,d.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Vt.h.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,d.f)(.2,.2,.2),this.diffuse=(0,d.f)(.8,.8,.8),this.externalColor=(0,he.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=U.Gv.Less,this.textureAlphaMode=U.JJ.Blend,this.textureAlphaCutoff=Wt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=ct.yD.Occlude}}class Qt extends $t.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===it.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?zt.N.Default:zt.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Qt.shader)}_initializeProgram(e,t){return new jt.$(e.rctx,t.get().build(this.configuration),qt.i)}_convertDepthTestFunction(e){return e===U.Gv.Lequal?Ae.wb.LEQUAL:Ae.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===dt.A.NONE,o=e===dt.A.FrontFace;return(0,ut.sm)({blending:r.output!==nt.H.Color&&r.output!==nt.H.Alpha||!r.transparent?null:i?ht:pt(e),culling:er(r)?(0,ut.zp)(r.cullFace):null,depthTest:{func:gt(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?ut.LZ:null,colorWrite:ut.BK,stencilWrite:r.hasOccludees?Xt:null,stencilTest:r.hasOccludees?t?Jt:Yt:null,polygonOffset:i||o?null:(n=r.enableOffset,n?_t:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function er(e){return e.cullFace!==U.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Qt.shader=new kt.J(Kt.D,(()=>r.e(9291).then(r.bind(r,79291))));var tr=r(43697),rr=r(51354),ir=r(67498);class or extends rr.m{}(0,tr._)([(0,rr.o)({constValue:!0})],or.prototype,"hasSliceHighlight",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],or.prototype,"hasSliceInVertexProgram",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],or.prototype,"instancedDoublePrecision",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],or.prototype,"hasModelTransformation",void 0),(0,tr._)([(0,rr.o)({constValue:ir.P.Pass})],or.prototype,"pbrTextureBindType",void 0);class nr extends or{constructor(){super(...arguments),this.output=nt.H.Color,this.alphaDiscardMode=U.JJ.Opaque,this.doubleSidedMode=at.q.None,this.pbrMode=st.f7.Disabled,this.cullFace=U.Vr.None,this.transparencyPassType=dt.A.NONE,this.normalType=Vt.h.Attribute,this.textureCoordinateType=zt.N.None,this.customDepthTest=U.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,tr._)([(0,rr.o)({count:nt.H.COUNT})],nr.prototype,"output",void 0),(0,tr._)([(0,rr.o)({count:U.JJ.COUNT})],nr.prototype,"alphaDiscardMode",void 0),(0,tr._)([(0,rr.o)({count:at.q.COUNT})],nr.prototype,"doubleSidedMode",void 0),(0,tr._)([(0,rr.o)({count:st.f7.COUNT})],nr.prototype,"pbrMode",void 0),(0,tr._)([(0,rr.o)({count:U.Vr.COUNT})],nr.prototype,"cullFace",void 0),(0,tr._)([(0,rr.o)({count:dt.A.COUNT})],nr.prototype,"transparencyPassType",void 0),(0,tr._)([(0,rr.o)({count:Vt.h.COUNT})],nr.prototype,"normalType",void 0),(0,tr._)([(0,rr.o)({count:zt.N.COUNT})],nr.prototype,"textureCoordinateType",void 0),(0,tr._)([(0,rr.o)({count:U.Gv.COUNT})],nr.prototype,"customDepthTest",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"spherical",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasVertexColors",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasSymbolColors",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasVerticalOffset",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasSlicePlane",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasSliceHighlight",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasColorTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasMetallicRoughnessTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasEmissionTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasOcclusionTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasNormalTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasScreenSizePerspective",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasVertexTangents",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasOccludees",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasMultipassTerrain",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasModelTransformation",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"offsetBackfaces",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"vvSize",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"vvColor",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"receiveShadows",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"receiveAmbientOcclusion",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"textureAlphaPremultiplied",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"instanced",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"instancedColor",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"objectAndLayerIdColorInstanced",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"instancedDoublePrecision",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"writeDepth",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"transparent",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"enableOffset",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"cullAboveGround",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"snowCover",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasColorTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasEmissionTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasNormalTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasOcclusionTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,tr._)([(0,rr.o)({constValue:!0})],nr.prototype,"hasVvInstancing",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],nr.prototype,"useCustomDTRExponentForWater",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],nr.prototype,"supportsTextureAtlas",void 0),(0,tr._)([(0,rr.o)({constValue:!0})],nr.prototype,"useFillLights",void 0);var ar=r(41846);class sr extends Qt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Vt.h.Attribute,t.doubleSidedMode=at.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,sr.shader)}}sr.shader=new kt.J(ar.R,(()=>r.e(8096).then(r.bind(r,38096))));class lr extends ct.F5{constructor(e){super(e,dr),this.supportsEdges=!0,this._configuration=new nr,this._vertexBufferLayout=function(e){const t=(0,ot.U$)().vec3f(ne.T.POSITION).vec3f(ne.T.NORMAL),r=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId;return e.hasVertexTangents&&t.vec4f(ne.T.TANGENT),r&&t.vec2f(ne.T.UV0),e.hasVertexColors&&t.vec4u8(ne.T.COLOR),e.hasSymbolColors&&t.vec4u8(ne.T.SYMBOLCOLOR),(0,rt.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(ne.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==nt.H.Shadow&&e!==nt.H.ShadowExcludeHighlight&&e!==nt.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?U.Vr.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==nt.H.Color&&e!==nt.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=at.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?at.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?at.q.WindingOrder:at.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.active&&this.parameters.receiveSSAO,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?st.f7.Schematic:st.f7.Normal:st.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,c.s)(_r,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case it.JY.Global:n=(0,c.n)(mr,_r);break;case it.JY.Local:n=(0,c.c)(mr,fr)}let a=0;const s=(0,c.b)(gr,_r,e.eye),l=(0,c.l)(s),d=(0,c.g)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,c.e)(n,d)),a+=(0,Ut.Hx)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,c.g)(n,n,a),(0,c.t)(pr,n,r.transform.inverseRotation),i=(0,c.b)(ur,i,pr),o=(0,c.b)(hr,o,pr)}(0,Ut.Bw)(e,r,i,o,function(e){return null!=e?(yt.offset=e,yt):null}(r.verticalOffset),n)}requiresSlot(e,t){return!(t!==nt.H.Color&&t!==nt.H.Alpha&&t!==nt.H.Depth&&t!==nt.H.Normal&&t!==nt.H.Shadow&&t!==nt.H.ShadowHighlight&&t!==nt.H.ShadowExcludeHighlight&&t!==nt.H.Highlight&&t!==nt.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?vt.TRANSPARENT_MATERIAL:vt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:vt.OPAQUE_MATERIAL)&&e!==vt.DRAPED_MATERIAL)}createGLMaterial(e){return new cr(e)}createBufferWriter(){return new Bt(this._vertexBufferLayout)}}class cr extends lt.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==nt.H.Color&&this._output!==nt.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,c.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?sr:Qt,e)}}const dr=new class extends Zt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},ur=(0,d.c)(),hr=(0,d.c)(),fr=(0,d.f)(0,0,1),mr=(0,d.c)(),pr=(0,d.c)(),_r=(0,d.c)(),gr=(0,d.c)(),vr=I.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Tr(e){throw new N.Z("",`Request for object resource failed: ${e}`)}function xr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(vr.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(vr.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(vr.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(vr.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else vr.warn("Indexed geometries must specify faces"),i=!1;break}default:vr.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(vr.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(vr.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function br(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.pp)(t,r.bbMin),(0,u.pp)(t,r.bbMax))})),t}function Er(e){switch(e){case"mask":return U.JJ.Mask;case"maskAndTransparency":return U.JJ.MaskBlend;case"none":return U.JJ.Opaque;default:return U.JJ.Blend}}function Ar(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Sr=new H.G(1,2,"wosr");var wr=r(57758);async function Rr(e,t){const r=yr((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=null!=t&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,M.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,D.r9)(i.error),Tr(i.error.details.url)}(e,r,t);const i=await(0,M.q6)((0,O.default)(e,t));if(!0===i.ok)return i.value.data;(0,D.r9)(i.error),Tr(i.error)}(e,t),i=await async function(e,t){const r=[];for(const i in e){const o=e[i],n=o.images[0].data;if(!n){vr.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:Ae.e8.REPEAT,t:Ae.e8.REPEAT},preMultiplyAlpha:Er(l)!==U.JJ.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):F(a,t);r.push(d.then((e=>({refId:s,image:e,params:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,P.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new L,a=e.resource,s=H.G.parse(a.version||"1.0","wosr");Sr.validate(s);const l=a.model.name,c=a.model.geometries,u=a.materialDefinitions??{},h=e.textures;let f=0;const m=new Map;for(let e=0;e<c.length;e++){const a=c[e];if(!xr(a))continue;const s=Ar(a),l=a.params.vertexAttributes,p=[];for(const e in l){const t=l[e],r=t.values;p.push([e,new B.a(r,t.valuesPerElement,!0)])}const _=[];if("PerAttributeArray"!==a.params.topology){const e=a.params.faces;for(const t in e)_.push([t,e[t].values])}const g=s.texture,v=h&&h[g];if(v&&!m.has(g)){const{image:e,params:t}=v,r=new tt(e,t);i.push(r),m.set(g,r)}const T=m.get(g),x=T?T.id:void 0,b=s.material;let E=n.get(b,g);if(null==E){const e=u[b.substring(b.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=v&&v.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=v?Er(v.alphaChannelUsage):void 0,a={ambient:(0,d.d)(e.diffuse),diffuse:(0,d.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:U.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!v&&!!v.params.preMultiplyAlpha};null!=t&&t.materialParamsMixin&&Object.assign(a,t.materialParamsMixin),E=new lr(a),n.set(b,g,E)}o.push(E);const A=new ae(E,p,_);f+=_.position?_.position.length:0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:f,lodThreshold:null}],referenceBoundingBox:br(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,b.Q)(new x.C(t.streamDataRequester),r.url,t,t.usePBR)),a=(0,o.U2)(n.model.meta,"ESRI_proxyEllipsoid"),u=n.meta.isEsriSymbolResource&&null!=a&&n.meta.uri.includes("/RealisticTrees/");u&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,a=n.count,u=(0,d.c)(),h=(0,d.c)(),f=(0,d.c)(),p=new Uint8Array(4*a),_=new Float64Array(3*a),g=(0,s.a)((0,l.c)(),o.transform);let v=0,T=0;for(let s=0;s<a;s++){n.getVec(s,h),i.getVec(s,u),(0,c.m)(h,h,o.transform),(0,c.b)(f,h,t.center),(0,c.D)(f,f,t.radius);const a=f[2],l=(0,c.l)(f),d=Math.min(.45+.55*l*l,1);(0,c.D)(f,f,t.radius),null!==g&&(0,c.m)(f,f,g),(0,c.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.h)(f,f,u,a>-1?.2:Math.min(-4*a-3.8,1)),_[v]=f[0],_[v+1]=f[1],_[v+2]=f[2],v+=3,p[T]=255*d,p[T+1]=255*d,p[T+2]=255*d,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(_),o.attributes.color=new m.mc(p)}}}(n,a));const h=!!t.usePBR,f=n.meta.isEsriSymbolResource?{usePBR:h,isSchematic:!1,treeRendering:u,mrrFactors:[0,1,.2]}:{usePBR:h,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},p={...t.materialParamsMixin,treeRendering:u},{engineResources:_,referenceBoundingBox:g}=Cr(n,f,p,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:_,referenceBoundingBox:g,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}function yr(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function Cr(e,t,r,i){const o=e.model,a=new Array,s=new Map,l=new Map,c=o.lods.length,d=(0,u.cS)();return o.lods.forEach(((e,h)=>{const x=!0===i.skipHighLods&&(c>1&&0===h||c>3&&1===h)||!1===i.skipHighLods&&null!=i.singleLodIndex&&h!==i.singleLodIndex;if(x&&0!==h)return;const b=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=x?new lr({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),l=e.materials.get(t.material),c=null!=t.attributes.texCoord0,d=null!=t.attributes.normal;if(null==l)return null;const u=function(e){switch(e){case"BLEND":return U.JJ.Blend;case"MASK":return U.JJ.Mask;case"OPAQUE":case null:case void 0:return U.JJ.Opaque}}(l.alphaMode);if(!n.has(s)){if(c){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new tt((0,A.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,A.$A)(e)&&r,encoding:(0,A.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,u!==U.JJ.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/wr.K),h=l.color[1]**(1/wr.K),f=l.color[2]**(1/wr.K),m=l.emissiveFactor[0]**(1/wr.K),p=l.emissiveFactor[1]**(1/wr.K),_=l.emissiveFactor[2]**(1/wr.K),g=null!=l.textureColor&&c?a.get(l.textureColor):null;n.set(s,new lr({...i,transparent:u===U.JJ.Blend,customDepthTest:U.Gv.Lequal,textureAlphaMode:u,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,h,f],ambient:[r,h,f],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?U.Vr.None:U.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:d?Vt.h.Attribute:Vt.h.ScreenDerivative,castShadows:!0,receiveSSAO:!0,textureId:null!=g?g.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&c?a.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=g&&!!g.params.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&c?a.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&c?a.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&c?a.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[m,p,_],mrrFactors:[l.metallicFactor,l.roughnessFactor,i.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:R(l.colorTextureTransform),normalTextureTransformMatrix:R(l.normalTextureTransform),occlusionTextureTransformMatrix:R(l.occlusionTextureTransform),emissiveTextureTransformMatrix:R(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(l.metallicRoughnessTextureTransform),...o}))}const h=n.get(s);if(r.stageResources.materials.push(h),c){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(l.textureColor),e(l.textureNormal),e(l.textureOcclusion),e(l.textureEmissive),e(l.textureMetallicRoughness)}return h}(o,e,b,t,r,s,l),{geometry:a,vertexCount:c}=function(e,t){const r=e.attributes.position.count,i=(0,E.p)(e.indices||r,e.primitiveType),o=f(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,p.t)(o,a,e.transform,3,s);const l=[[ne.T.POSITION,new B.a(o,3,!0)]],c=[[ne.T.POSITION,i]];if(null!=e.attributes.normal){const t=f(3*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.normal;(0,n.b)(Or,e.transform),(0,p.a)(t,o,Or,3,a),l.push([ne.T.NORMAL,new B.a(t,3,!0)]),c.push([ne.T.NORMAL,i])}if(null!=e.attributes.tangent){const t=f(4*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.tangent;(0,n.b)(Or,e.transform),(0,_.t)(t,o,Or,4,a),l.push([ne.T.TANGENT,new B.a(t,4,!0)]),c.push([ne.T.TANGENT,i])}if(null!=e.attributes.texCoord0){const t=f(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([ne.T.UV0,new B.a(t,2,!0)]),c.push([ne.T.UV0,i])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,_.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,T.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,_.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,p.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,p.s)(t,e.attributes.color,1/256,4)),l.push([ne.T.COLOR,new B.a(t,4,!0)]),c.push([ne.T.COLOR,i])}return{geometry:new ae(t,l,c),vertexCount:r}}(e,null!=i?i:new lr({})),S=a.boundingInfo;null!=S&&0===h&&((0,u.pp)(d,S.bbMin),(0,u.pp)(d,S.bbMax)),null!=i&&(b.stageResources.geometries.push(a),b.numberOfVertices+=c)})),x||a.push(b)})),{engineResources:a,referenceBoundingBox:d}}const Or=(0,a.c)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>d});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
287
|
+
}`),e}},Symbol.toStringTag,{value:"Module"}));var Te=r(99880);let xe;var be,Ee;(Ee=be||(be={}))[Ee.ETC1_RGB=0]="ETC1_RGB",Ee[Ee.ETC2_RGBA=1]="ETC2_RGBA",Ee[Ee.BC1_RGB=2]="BC1_RGB",Ee[Ee.BC3_RGBA=3]="BC3_RGBA",Ee[Ee.BC4_R=4]="BC4_R",Ee[Ee.BC5_RG=5]="BC5_RG",Ee[Ee.BC7_M6_RGB=6]="BC7_M6_RGB",Ee[Ee.BC7_M5_RGBA=7]="BC7_M5_RGBA",Ee[Ee.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Ee[Ee.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Ee[Ee.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Ee[Ee.ATC_RGB=11]="ATC_RGB",Ee[Ee.ATC_RGBA=12]="ATC_RGBA",Ee[Ee.FXT1_RGB=17]="FXT1_RGB",Ee[Ee.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Ee[Ee.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Ee[Ee.ETC2_EAC_R11=20]="ETC2_EAC_R11",Ee[Ee.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Ee[Ee.RGBA32=13]="RGBA32",Ee[Ee.RGB565=14]="RGB565",Ee[Ee.BGR565=15]="BGR565",Ee[Ee.RGBA4444=16]="RGBA4444";var Ae=r(35371),Se=r(75656),we=r(45762);let Re=null,ye=null;async function Ce(){return null==ye&&(ye=function(){if(null==xe){const e=e=>(0,Te.V)(`esri/libs/basisu/${e}`);xe=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return xe}(),Re=await ye),ye}function Oe(e,t,r,i,o){const n=(0,we.RG)(t?Ae.q_.COMPRESSED_RGBA8_ETC2_EAC:Ae.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function Me(e){return e.getNumImages()>=1&&!e.isUASTC()}function Pe(e){return e.getFaces()>=1&&e.isETC1S()}function Ne(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[be.ETC2_RGBA,Ae.q_.COMPRESSED_RGBA8_ETC2_EAC]:[be.ETC1_RGB,Ae.q_.COMPRESSED_RGB8_ETC2]:c?i?[be.BC3_RGBA,Ae.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[be.BC1_RGB,Ae.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[be.RGBA32,Ae.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,d))),s(e,d,f[e]);const m=f.length>1,p=m?Ae.cw.LINEAR_MIPMAP_LINEAR:Ae.cw.LINEAR,_={...t,samplingMode:p,hasMipmap:m,internalFormat:u,width:o,height:n};return new Se.x(e,_,{type:"compressed",levels:f})}const Ie=I.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),Le=542327876,De=131072,He=4;function Fe(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Be=Fe("DXT1"),Ue=Fe("DXT3"),Ve=Fe("DXT5"),ze=31,Ge=0,We=1,ke=2,$e=3,qe=4,je=7,Xe=20,Ye=21;var Je,Ke,Ze=r(89917),Qe=r(54738),et=r(33696);class tt extends q.c{constructor(e,t){super(),this._data=e,this.type=j.U.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new le.Z,this._passParameters=new ve,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:Ae.e8.REPEAT,t:Ae.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||U.CE.STRETCH,this.estimatedTexMemRequired=tt._estimateTexMemRequired(this._data,this.params),this._startPreload()}_startPreload(){const e=this._data;null!=e&&(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,de.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,de.HK)(e.src)||(0,de.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if(null==e)return 0;if((0,h.eP)(e)||(0,h.lq)(e))return t.encoding===U.Ti.KTX2_ENCODING?function(e,t){if(null==Re)return e.byteLength;const r=new Re.KTX2File(new Uint8Array(e)),i=Pe(r)?Oe(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===U.Ti.BASIS_ENCODING?function(e,t){if(null==Re)return e.byteLength;const r=new Re.BasisFile(new Uint8Array(e)),i=Me(r)?Oe(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?tt._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this._data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){return{target:Ae.No.TEXTURE_2D,pixelFormat:Ae.VI.RGBA,dataType:Ae.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?Ae.cw.LINEAR_MIPMAP_LINEAR:Ae.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:this.params.maxAnisotropy??(this.params.mipmap?e.parameters.maxMaxAnisotropy:1)}}get glTexture(){return this._glTexture}load(e,t){if(null!=this._glTexture)return this._glTexture;if(null!=this._loadingPromise)return this._loadingPromise;const r=this._data;return null==r?(this._glTexture=new Se.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,h.eP)(r)||(0,h.lq)(r))&&this.params.encoding===U.Ti.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,r)):((0,h.eP)(r)||(0,h.lq)(r))&&this.params.encoding===U.Ti.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,r)):((0,h.eP)(r)||(0,h.lq)(r))&&this.params.encoding===U.Ti.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,r)):(0,h.lq)(r)?this._loadFromPixelData(e,r):(0,h.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this._data instanceof HTMLVideoElement)||null==this._glTexture)return r;if(this._data.readyState<Je.HAVE_CURRENT_DATA||r===this._data.currentTime)return r;if(null!=this._powerOfTwoStretchInfo){const{framebuffer:r,vao:i,sourceTexture:o}=this._powerOfTwoStretchInfo;o.setData(this._data),this._drawStretchedTexture(e,t,r,i,o,this._glTexture)}else{const{videoWidth:e,videoHeight:t}=this._data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),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(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:n,width:a,height:s}=(0,o.s3)(function(e,t){const r=new Int32Array(e,0,ze);if(r[Ge]!==Le)return Ie.error("Invalid magic number in DDS header"),null;if(!(r[Xe]&He))return Ie.error("Unsupported format, must contain a FourCC code"),null;const i=r[Ye];let o,n;switch(i){case Be:o=8,n=Ae.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ue:o=16,n=Ae.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Ve:o=16,n=Ae.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Ie.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[qe],l=r[$e];0==(3&s)&&0==(3&l)||(Ie.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;r[ke]&De&&!1!==t&&(a=Math.max(1,r[je])),1===a||(0,ce.wt)(s)&&(0,ce.wt)(l)||(Ie.warn("Ignoring mipmaps of non power of two sized compressed texture."),a=1);let f=r[We]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,f,h),m.push(u),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:n,width:c,height:d}}(r,t.hasMipmap??!1));return t.samplingMode=i.levels.length>1?Ae.cw.LINEAR_MIPMAP_LINEAR:Ae.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new Se.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Re&&(Re=await Ce());const i=new Re.KTX2File(new Uint8Array(r));if(!Pe(i))return null;i.startTranscoding();const o=Ne(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Re&&(Re=await Ce());const i=new Re.BasisFile(new Uint8Array(r));if(!Me(i))return null;i.startTranscoding();const o=Ne(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,W.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?Ae.VI.LUMINANCE:3===this.params.components?Ae.VI.RGB:Ae.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new Se.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const o=await F(r,{signal:i});return(0,D.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const o=await(0,ue.fY)(r,r.src,!1,i);return(0,D.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Je.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((n,a)=>{const s=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),(0,o.hw)(d)},l=()=>{r.readyState>=Je.HAVE_CURRENT_DATA&&(s(),n(this._loadFromImage(e,r,t)))},c=e=>{s(),a(e||new N.Z("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const d=(0,D.fu)(i,(()=>c((0,D.zE)())))}))))}_loadFromImage(e,t,r){const i=tt._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this.params.components?Ae.VI.RGB:Ae.VI.RGBA,!this._requiresPowerOfTwo(e,o)||(0,ce.wt)(i.width)&&(0,ce.wt)(i.height)?(o.width=i.width,o.height=i.height,this._glTexture=new Se.x(e,o,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,o,r),this._glTexture)}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}_requiresPowerOfTwo(e,t){const r=Ae.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return e.type===Qe.zO.WEBGL1&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,o){const{width:n,height:a}=r,s=(0,ce.Sf)(n),l=(0,ce.Sf)(a);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case U.CE.PAD:i.textureCoordinateScaleFactor=[n/s,a/l],c=new Se.x(e,i),c.updateData(0,0,0,n,a,t);break;case U.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,o());break;default:(0,se.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const o=new Se.x(e,r),n=new et.X(e,{colorTarget:Ae.Lm.TEXTURE,depthStencilTarget:Ae.OU.NONE},o),a=new Se.x(e,{target:Ae.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:Ae.Br.UNSIGNED_BYTE,wrapMode:Ae.e8.CLAMP_TO_EDGE,samplingMode:Ae.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=(0,Ze.ow)(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,n,s,a,o),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:a,framebuffer:n}:(s.dispose(!0),a.dispose(),n.detachColorTexture(),n.dispose()),e.bindFramebuffer(l),o}_drawStretchedTexture(e,t,r,i,o,n){this._passParameters.texture=o,e.bindFramebuffer(r);const a=e.getViewport();e.setViewport(0,0,n.descriptor.width,n.descriptor.height),e.bindTechnique(t,this._passParameters,null),e.bindVAO(i),e.drawArrays(Ae.MX.TRIANGLE_STRIP,0,(0,we._V)(i,"geometry")),e.bindFramebuffer(null),e.setViewport(a.x,a.y,a.width,a.height),this._passParameters.texture=null}unload(){if(null!=this._powerOfTwoStretchInfo){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if(null!=this._glTexture&&(this._glTexture.dispose(),this._glTexture=null),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}(Ke=Je||(Je={}))[Ke.HAVE_NOTHING=0]="HAVE_NOTHING",Ke[Ke.HAVE_METADATA=1]="HAVE_METADATA",Ke[Ke.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Ke[Ke.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Ke[Ke.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var rt=r(80442),it=r(64822),ot=r(65576),nt=r(55039),at=r(60624),st=r(19419),lt=r(85504),ct=r(60537),dt=r(82791),ut=r(93144),ht=r(27097);const ft=(0,ht.wK)(Ae.zi.SRC_ALPHA,Ae.zi.ONE,Ae.zi.ONE_MINUS_SRC_ALPHA,Ae.zi.ONE_MINUS_SRC_ALPHA),mt=(0,ht.if)(Ae.zi.ONE,Ae.zi.ONE),pt=(0,ht.if)(Ae.zi.ZERO,Ae.zi.ONE_MINUS_SRC_ALPHA);function _t(e){return e===ut.A.FrontFace?null:e===ut.A.Alpha?pt:mt}const gt={factor:-1,units:-2};function vt(e,t=Ae.wb.LESS){return e===ut.A.NONE||e===ut.A.FrontFace?t:Ae.wb.LEQUAL}var Tt,xt;(xt=Tt||(Tt={}))[xt.INTEGRATED_MESH=0]="INTEGRATED_MESH",xt[xt.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",xt[xt.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",xt[xt.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",xt[xt.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",xt[xt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",xt[xt.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",xt[xt.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",xt[xt.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",xt[xt.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",xt[xt.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",xt[xt.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",xt[xt.LASERLINES=12]="LASERLINES",xt[xt.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",xt[xt.HUD_MATERIAL=14]="HUD_MATERIAL",xt[xt.LABEL_MATERIAL=15]="LABEL_MATERIAL",xt[xt.LINE_CALLOUTS=16]="LINE_CALLOUTS",xt[xt.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",xt[xt.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",xt[xt.DRAPED_WATER=19]="DRAPED_WATER",xt[xt.VOXEL=20]="VOXEL",xt[xt.MAX_SLOTS=21]="MAX_SLOTS";var bt=r(51305),Et=r(94961),At=r(72119),St=r(29268);const wt=(0,d.c)(),Rt=(0,d.c)(),yt=(0,d.c)(),Ct=new class{constructor(e=0){this.offset=e,this.sphere=(0,St.c)(),this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],n=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+n*n+a*a);o+=o*s,n+=n*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*n+l[8]*a+l[12],this.tmpVertex[1]=l[1]*o+l[5]*n+l[9]*a+l[13],this.tmpVertex[2]=l[2]*o+l[6]*n+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,d.c)(),this._mbs=(0,St.c)(),this._obb={center:(0,d.c)(),halfSize:(0,At.c)(),quaternion:null},this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,n=r+this.componentLocalOriginLength,a=this._totalOffset/Math.sqrt(i*i+o*o+n*n);return this._tmpVertex[0]=e+i*a,this._tmpVertex[1]=t+o*a,this._tmpVertex[2]=r+n*a,this._tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],n=e[4],a=e[5]+this.componentLocalOriginLength,s=t*o<0?0:Math.min(Math.abs(t),Math.abs(o)),l=r*n<0?0:Math.min(Math.abs(r),Math.abs(n)),c=i*a<0?0:Math.min(Math.abs(i),Math.abs(a)),d=Math.sqrt(s*s+l*l+c*c);if(d<this._totalOffset)return e[0]-=t<0?this._totalOffset:0,e[1]-=r<0?this._totalOffset:0,e[2]-=i<0?this._totalOffset:0,e[3]+=o>0?this._totalOffset:0,e[4]+=n>0?this._totalOffset:0,e[5]+=a>0?this._totalOffset:0,e;const u=Math.max(Math.abs(t),Math.abs(o)),h=Math.max(Math.abs(r),Math.abs(n)),f=Math.max(Math.abs(i),Math.abs(a)),m=Math.sqrt(u*u+h*h+f*f),p=this._totalOffset/m,_=this._totalOffset/d;return e[0]+=t*(t>0?p:_),e[1]+=r*(r>0?p:_),e[2]+=i*(i>0?p:_),e[3]+=o*(o<0?p:_),e[4]+=n*(n<0?p:_),e[5]+=a*(a<0?p:_),e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this._totalOffset/t;return this._mbs[0]=e[0]+e[0]*r,this._mbs[1]=e[1]+e[1]*r,this._mbs[2]=e[2]+e[2]*r,this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){const t=e.center,r=this._totalOffset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this._obb.center[0]=t[0]+t[0]*r,this._obb.center[1]=t[1]+t[1]*r,this._obb.center[2]=t[2]+t[2]*r,(0,c.q)(this._obb.halfSize,e.halfSize,e.quaternion),(0,c.a)(this._obb.halfSize,this._obb.halfSize,e.center);const i=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]*i,this._obb.halfSize[1]+=this._obb.halfSize[1]*i,this._obb.halfSize[2]+=this._obb.halfSize[2]*i,(0,c.b)(this._obb.halfSize,this._obb.halfSize,e.center),(0,bt.c)(Ot,e.quaternion),(0,c.q)(this._obb.halfSize,this._obb.halfSize,Ot),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=e.quaternion,this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],n=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+o*o+n*n);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+o*a,this.tmpVertex[2]=r+n*a,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)wt[t]=e[0+t]+this.localOrigin[t],Rt[t]=e[3+t]+this.localOrigin[t],yt[t]=wt[t];const t=this.applyToVertex(wt[0],wt[1],wt[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let t=0;t<3;++t)yt[t]=0==(e&1<<t)?wt[t]:Rt[t];r(yt)}let i=0;for(let e=0;e<3;++e)wt[e]*Rt[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)i[t]?yt[t]=0:yt[t]=0!=(e&1<<t)?wt[t]:Rt[t];r(yt)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ot=(0,Et.a)();function Mt(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function Pt(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function Nt(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}function It(e,t,r,i,o,n=1){if(!r)return void Pt(e,t,i,o,n);const a=i.typedBuffer,l=i.typedBufferStride,c=e.length,d=r[0],u=r[1],h=r[2],f=r[4],m=r[5],p=r[6],_=r[8],g=r[9],v=r[10],T=r[12],x=r[13],b=r[14];o*=l;let E=0,A=0,S=0;const w=(0,s.y)(r)?e=>{E=t[e]+T,A=t[e+1]+x,S=t[e+2]+b}:e=>{const r=t[e],i=t[e+1],o=t[e+2];E=d*r+f*i+_*o+T,A=u*r+m*i+g*o+x,S=h*r+p*i+v*o+b};if(1===n)for(let t=0;t<c;++t)w(3*e[t]),a[o]=E,a[o+1]=A,a[o+2]=S,o+=l;else for(let t=0;t<c;++t){w(3*e[t]);for(let e=0;e<n;++e)a[o]=E,a[o+1]=A,a[o+2]=S,o+=l}}function Lt(e,t,r,i,o,n=1){if(!r)return void Pt(e,t,i,o,n);const a=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=a[0],h=a[1],f=a[2],m=a[4],p=a[5],_=a[6],g=a[8],v=a[9],T=a[10],x=!(0,s.z)(a),b=1e-6,E=1-b;o*=c;let A=0,S=0,w=0;const R=(0,s.y)(a)?e=>{A=t[e],S=t[e+1],w=t[e+2]}:e=>{const r=t[e],i=t[e+1],o=t[e+2];A=u*r+m*i+g*o,S=h*r+p*i+v*o,w=f*r+_*i+T*o};if(1===n)if(x)for(let t=0;t<d;++t){R(3*e[t]);const r=A*A+S*S+w*w;if(r<E&&r>b){const e=1/Math.sqrt(r);l[o]=A*e,l[o+1]=S*e,l[o+2]=w*e}else l[o]=A,l[o+1]=S,l[o+2]=w;o+=c}else for(let t=0;t<d;++t)R(3*e[t]),l[o]=A,l[o+1]=S,l[o+2]=w,o+=c;else for(let t=0;t<d;++t){if(R(3*e[t]),x){const e=A*A+S*S+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,w*=t}}for(let e=0;e<n;++e)l[o]=A,l[o+1]=S,l[o+2]=w,o+=c}}function Dt(e,t,r,i,o,n=1){if(!r)return void Nt(e,t,i,o,n);const a=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=a[0],h=a[1],f=a[2],m=a[4],p=a[5],_=a[6],g=a[8],v=a[9],T=a[10],x=!(0,s.z)(a),b=1e-6,E=1-b;if(o*=c,1===n)for(let r=0;r<d;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],d=t[i+3];let A=u*n+m*a+g*s,S=h*n+p*a+v*s,w=f*n+_*a+T*s;if(x){const e=A*A+S*S+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,w*=t}}l[o]=A,l[o+1]=S,l[o+2]=w,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],a=t[i],s=t[i+1],d=t[i+2],A=t[i+3];let S=u*a+m*s+g*d,w=h*a+p*s+v*d,R=f*a+_*s+T*d;if(x){const e=S*S+w*w+R*R;if(e<E&&e>b){const t=1/Math.sqrt(e);S*=t,w*=t,R*=t}}for(let e=0;e<n;++e)l[o]=S,l[o+1]=w,l[o+2]=R,l[o+3]=A,o+=c}}function Ht(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,r!==t.length||4!==r)if(1!==n)if(4!==r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}else for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else{if(4===r){for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}return}for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else{a[o]=t[0],a[o+1]=t[1],a[o+2]=t[2],a[o+3]=t[3];const e=new Uint32Array(i.typedBuffer.buffer,i.start),r=s/4,c=e[o/=4];o+=r;const d=l*n;for(let t=1;t<d;++t)e[o]=c,o+=r}}function Ft(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length,s=t[0];i*=n;for(let e=0;e<a;++e)o[i]=s,i+=n}function Bt(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}class Ut{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(ne.T.POSITION).length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)switch(a){case ne.T.POSITION:{(0,W.hu)(3===t.size);const e=o.getField(a,m.ct);(0,W.hu)(!!e,`No buffer view for ${a}`),e&&It(s,t.data,r,e,n);break}case ne.T.NORMAL:{(0,W.hu)(3===t.size);const e=o.getField(a,m.ct);(0,W.hu)(!!e,`No buffer view for ${a}`),e&&Lt(s,t.data,i,e,n);break}case ne.T.NORMALCOMPRESSED:{(0,W.hu)(2===t.size);const e=o.getField(a,m.or);(0,W.hu)(!!e,`No buffer view for ${a}`),e&&Mt(s,t.data,e,n);break}case ne.T.UV0:{(0,W.hu)(2===t.size);const e=o.getField(a,m.Eu);(0,W.hu)(!!e,`No buffer view for ${a}`),e&&Mt(s,t.data,e,n);break}case ne.T.COLOR:case ne.T.SYMBOLCOLOR:{const e=o.getField(a,m.mc);(0,W.hu)(!!e,`No buffer view for ${a}`),(0,W.hu)(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||Ht(s,t.data,t.size,e,n);break}case ne.T.COLORFEATUREATTRIBUTE:{const e=o.getField(a,m.ly);(0,W.hu)(!!e,`No buffer view for ${a}`),(0,W.hu)(1===t.size),e&&1===t.size&&Ft(s,t.data,e,n);break}case ne.T.TANGENT:{(0,W.hu)(4===t.size);const e=o.getField(a,m.ek);(0,W.hu)(!!e,`No buffer view for ${a}`),e&&Dt(s,t.data,i,e,n);break}case ne.T.PROFILERIGHT:case ne.T.PROFILEUP:case ne.T.PROFILEVERTEXANDNORMAL:case ne.T.FEATUREVALUE:{(0,W.hu)(4===t.size);const e=o.getField(a,m.ek);(0,W.hu)(!!e,`No buffer view for ${a}`),e&&Nt(s,t.data,e,n)}}else if(a===ne.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(ne.T.POSITION);if((0,W.hu)(!!t,`No buffer view for ${a}`),t){const r=t.length,i=o.getField(a,m.mc);Bt(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var Vt=r(57790),zt=r(135),Gt=r(15719),Wt=r(96310),kt=r(78869),$t=r(14589),qt=r(83475),jt=r(59377);Ae.wb.LESS,Ae.wb.ALWAYS;const Xt={mask:255},Yt={function:{func:Ae.wb.ALWAYS,ref:U.hU.OutlineVisualElementMask,mask:U.hU.OutlineVisualElementMask},operation:{fail:Ae.xS.KEEP,zFail:Ae.xS.KEEP,zPass:Ae.xS.ZERO}},Jt={function:{func:Ae.wb.ALWAYS,ref:U.hU.OutlineVisualElementMask,mask:U.hU.OutlineVisualElementMask},operation:{fail:Ae.xS.KEEP,zFail:Ae.xS.KEEP,zPass:Ae.xS.REPLACE}};Ae.wb.EQUAL,U.hU.OutlineVisualElementMask,U.hU.OutlineVisualElementMask,Ae.xS.KEEP,Ae.xS.KEEP,Ae.xS.KEEP,Ae.wb.NOTEQUAL,U.hU.OutlineVisualElementMask,U.hU.OutlineVisualElementMask,Ae.xS.KEEP,Ae.xS.KEEP,Ae.xS.KEEP;var Kt=r(32078);class Zt extends Gt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,d.f)(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=U.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,d.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=at.r.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,d.f)(.2,.2,.2),this.diffuse=(0,d.f)(.8,.8,.8),this.externalColor=(0,he.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=U.Gv.Less,this.textureAlphaMode=U.JJ.Blend,this.textureAlphaCutoff=Wt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=dt.yD.Occlude}}class Qt extends $t.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===it.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?zt.N.Default:zt.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Qt.shader)}_initializeProgram(e,t){return new jt.$(e.rctx,t.get().build(this.configuration),qt.i)}_convertDepthTestFunction(e){return e===U.Gv.Lequal?Ae.wb.LEQUAL:Ae.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===ut.A.NONE,o=e===ut.A.FrontFace;return(0,ht.sm)({blending:r.output!==nt.H.Color&&r.output!==nt.H.Alpha||!r.transparent?null:i?ft:_t(e),culling:er(r)?(0,ht.zp)(r.cullFace):null,depthTest:{func:vt(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?ht.LZ:null,colorWrite:ht.BK,stencilWrite:r.hasOccludees?Xt:null,stencilTest:r.hasOccludees?t?Jt:Yt:null,polygonOffset:i||o?null:(n=r.enableOffset,n?gt:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function er(e){return e.cullFace!==U.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Qt.shader=new kt.J(Kt.D,(()=>r.e(9291).then(r.bind(r,79291))));var tr=r(43697),rr=r(51354),ir=r(67498);class or extends rr.m{}(0,tr._)([(0,rr.o)({constValue:!0})],or.prototype,"hasSliceHighlight",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],or.prototype,"hasSliceInVertexProgram",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],or.prototype,"instancedDoublePrecision",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],or.prototype,"hasModelTransformation",void 0),(0,tr._)([(0,rr.o)({constValue:ir.P.Pass})],or.prototype,"pbrTextureBindType",void 0);class nr extends or{constructor(){super(...arguments),this.output=nt.H.Color,this.alphaDiscardMode=U.JJ.Opaque,this.doubleSidedMode=st.q.None,this.pbrMode=lt.f7.Disabled,this.cullFace=U.Vr.None,this.transparencyPassType=ut.A.NONE,this.normalType=at.r.Attribute,this.textureCoordinateType=zt.N.None,this.customDepthTest=U.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,tr._)([(0,rr.o)({count:nt.H.COUNT})],nr.prototype,"output",void 0),(0,tr._)([(0,rr.o)({count:U.JJ.COUNT})],nr.prototype,"alphaDiscardMode",void 0),(0,tr._)([(0,rr.o)({count:st.q.COUNT})],nr.prototype,"doubleSidedMode",void 0),(0,tr._)([(0,rr.o)({count:lt.f7.COUNT})],nr.prototype,"pbrMode",void 0),(0,tr._)([(0,rr.o)({count:U.Vr.COUNT})],nr.prototype,"cullFace",void 0),(0,tr._)([(0,rr.o)({count:ut.A.COUNT})],nr.prototype,"transparencyPassType",void 0),(0,tr._)([(0,rr.o)({count:at.r.COUNT})],nr.prototype,"normalType",void 0),(0,tr._)([(0,rr.o)({count:zt.N.COUNT})],nr.prototype,"textureCoordinateType",void 0),(0,tr._)([(0,rr.o)({count:U.Gv.COUNT})],nr.prototype,"customDepthTest",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"spherical",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasVertexColors",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasSymbolColors",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasVerticalOffset",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasSlicePlane",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasSliceHighlight",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasColorTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasMetallicRoughnessTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasEmissionTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasOcclusionTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasNormalTexture",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasScreenSizePerspective",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasVertexTangents",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasOccludees",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasMultipassTerrain",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasModelTransformation",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"offsetBackfaces",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"vvSize",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"vvColor",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"receiveShadows",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"receiveAmbientOcclusion",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"textureAlphaPremultiplied",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"instanced",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"instancedColor",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"objectAndLayerIdColorInstanced",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"instancedDoublePrecision",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"writeDepth",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"transparent",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"enableOffset",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"cullAboveGround",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"snowCover",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasColorTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasEmissionTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasNormalTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasOcclusionTextureTransform",void 0),(0,tr._)([(0,rr.o)()],nr.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,tr._)([(0,rr.o)({constValue:!0})],nr.prototype,"hasVvInstancing",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],nr.prototype,"useCustomDTRExponentForWater",void 0),(0,tr._)([(0,rr.o)({constValue:!1})],nr.prototype,"supportsTextureAtlas",void 0),(0,tr._)([(0,rr.o)({constValue:!0})],nr.prototype,"useFillLights",void 0);var ar=r(41846);class sr extends Qt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=at.r.Attribute,t.doubleSidedMode=st.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,sr.shader)}}sr.shader=new kt.J(ar.R,(()=>r.e(8096).then(r.bind(r,38096))));class lr extends dt.F5{constructor(e){super(e,dr),this.supportsEdges=!0,this._configuration=new nr,this._vertexBufferLayout=function(e){const t=(0,ot.U$)().vec3f(ne.T.POSITION);return e.normalType===at.r.CompressedAttribute?t.vec2i16(ne.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(ne.T.NORMAL),e.hasVertexTangents&&t.vec4f(ne.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(ne.T.UV0),e.hasVertexColors&&t.vec4u8(ne.T.COLOR),e.hasSymbolColors&&t.vec4u8(ne.T.SYMBOLCOLOR),(0,rt.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(ne.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==nt.H.Shadow&&e!==nt.H.ShadowExcludeHighlight&&e!==nt.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?U.Vr.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==nt.H.Color&&e!==nt.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=st.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?st.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?st.q.WindingOrder:st.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.active&&this.parameters.receiveSSAO,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?lt.f7.Schematic:lt.f7.Normal:lt.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,c.s)(_r,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case it.JY.Global:n=(0,c.n)(mr,_r);break;case it.JY.Local:n=(0,c.c)(mr,fr)}let a=0;const s=(0,c.b)(gr,_r,e.eye),l=(0,c.l)(s),d=(0,c.g)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,c.e)(n,d)),a+=(0,Vt.Hx)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,c.g)(n,n,a),(0,c.t)(pr,n,r.transform.inverseRotation),i=(0,c.b)(ur,i,pr),o=(0,c.b)(hr,o,pr)}(0,Vt.Bw)(e,r,i,o,function(e){return null!=e?(Ct.offset=e,Ct):null}(r.verticalOffset),n)}requiresSlot(e,t){return!(t!==nt.H.Color&&t!==nt.H.Alpha&&t!==nt.H.Depth&&t!==nt.H.Normal&&t!==nt.H.Shadow&&t!==nt.H.ShadowHighlight&&t!==nt.H.ShadowExcludeHighlight&&t!==nt.H.Highlight&&t!==nt.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Tt.TRANSPARENT_MATERIAL:Tt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Tt.OPAQUE_MATERIAL)&&e!==Tt.DRAPED_MATERIAL)}createGLMaterial(e){return new cr(e)}createBufferWriter(){return new Ut(this._vertexBufferLayout)}}class cr extends ct.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==nt.H.Color&&this._output!==nt.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,c.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?sr:Qt,e)}}const dr=new class extends Zt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},ur=(0,d.c)(),hr=(0,d.c)(),fr=(0,d.f)(0,0,1),mr=(0,d.c)(),pr=(0,d.c)(),_r=(0,d.c)(),gr=(0,d.c)(),vr=I.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Tr(e){throw new N.Z("",`Request for object resource failed: ${e}`)}function xr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(vr.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(vr.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(vr.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(vr.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else vr.warn("Indexed geometries must specify faces"),i=!1;break}default:vr.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(vr.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(vr.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function br(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.pp)(t,r.bbMin),(0,u.pp)(t,r.bbMax))})),t}function Er(e){switch(e){case"mask":return U.JJ.Mask;case"maskAndTransparency":return U.JJ.MaskBlend;case"none":return U.JJ.Opaque;default:return U.JJ.Blend}}function Ar(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Sr=new H.G(1,2,"wosr");var wr=r(57758);async function Rr(e,t){const r=yr((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=null!=t&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,M.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,D.r9)(i.error),Tr(i.error.details.url)}(e,r,t);const i=await(0,M.q6)((0,O.default)(e,t));if(!0===i.ok)return i.value.data;(0,D.r9)(i.error),Tr(i.error)}(e,t),i=await async function(e,t){const r=[];for(const i in e){const o=e[i],n=o.images[0].data;if(!n){vr.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:Ae.e8.REPEAT,t:Ae.e8.REPEAT},preMultiplyAlpha:Er(l)!==U.JJ.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):F(a,t);r.push(d.then((e=>({refId:s,image:e,params:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,P.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new L,a=e.resource,s=H.G.parse(a.version||"1.0","wosr");Sr.validate(s);const l=a.model.name,c=a.model.geometries,u=a.materialDefinitions??{},h=e.textures;let f=0;const m=new Map;for(let e=0;e<c.length;e++){const a=c[e];if(!xr(a))continue;const s=Ar(a),l=a.params.vertexAttributes,p=[];for(const e in l){const t=l[e],r=t.values;p.push([e,new B.a(r,t.valuesPerElement,!0)])}const _=[];if("PerAttributeArray"!==a.params.topology){const e=a.params.faces;for(const t in e)_.push([t,e[t].values])}const g=s.texture,v=h&&h[g];if(v&&!m.has(g)){const{image:e,params:t}=v,r=new tt(e,t);i.push(r),m.set(g,r)}const T=m.get(g),x=T?T.id:void 0,b=s.material;let E=n.get(b,g);if(null==E){const e=u[b.substring(b.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=v&&v.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=v?Er(v.alphaChannelUsage):void 0,a={ambient:(0,d.d)(e.diffuse),diffuse:(0,d.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:U.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!v&&!!v.params.preMultiplyAlpha};null!=t&&t.materialParamsMixin&&Object.assign(a,t.materialParamsMixin),E=new lr(a),n.set(b,g,E)}o.push(E);const A=new ae(E,p,_);f+=_.position?_.position.length:0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:f,lodThreshold:null}],referenceBoundingBox:br(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,b.Q)(new x.C(t.streamDataRequester),r.url,t,t.usePBR)),a=(0,o.U2)(n.model.meta,"ESRI_proxyEllipsoid"),u=n.meta.isEsriSymbolResource&&null!=a&&n.meta.uri.includes("/RealisticTrees/");u&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,a=n.count,u=(0,d.c)(),h=(0,d.c)(),f=(0,d.c)(),p=new Uint8Array(4*a),_=new Float64Array(3*a),g=(0,s.a)((0,l.c)(),o.transform);let v=0,T=0;for(let s=0;s<a;s++){n.getVec(s,h),i.getVec(s,u),(0,c.m)(h,h,o.transform),(0,c.b)(f,h,t.center),(0,c.D)(f,f,t.radius);const a=f[2],l=(0,c.l)(f),d=Math.min(.45+.55*l*l,1);(0,c.D)(f,f,t.radius),null!==g&&(0,c.m)(f,f,g),(0,c.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.h)(f,f,u,a>-1?.2:Math.min(-4*a-3.8,1)),_[v]=f[0],_[v+1]=f[1],_[v+2]=f[2],v+=3,p[T]=255*d,p[T+1]=255*d,p[T+2]=255*d,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(_),o.attributes.color=new m.mc(p)}}}(n,a));const h=!!t.usePBR,f=n.meta.isEsriSymbolResource?{usePBR:h,isSchematic:!1,treeRendering:u,mrrFactors:[0,1,.2]}:{usePBR:h,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},p={...t.materialParamsMixin,treeRendering:u},{engineResources:_,referenceBoundingBox:g}=Cr(n,f,p,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:_,referenceBoundingBox:g,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}function yr(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function Cr(e,t,r,i){const o=e.model,a=new Array,s=new Map,l=new Map,c=o.lods.length,d=(0,u.cS)();return o.lods.forEach(((e,h)=>{const x=!0===i.skipHighLods&&(c>1&&0===h||c>3&&1===h)||!1===i.skipHighLods&&null!=i.singleLodIndex&&h!==i.singleLodIndex;if(x&&0!==h)return;const b=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=x?new lr({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),l=e.materials.get(t.material),c=null!=t.attributes.texCoord0,d=null!=t.attributes.normal;if(null==l)return null;const u=function(e){switch(e){case"BLEND":return U.JJ.Blend;case"MASK":return U.JJ.Mask;case"OPAQUE":case null:case void 0:return U.JJ.Opaque}}(l.alphaMode);if(!n.has(s)){if(c){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new tt((0,A.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,A.$A)(e)&&r,encoding:(0,A.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,u!==U.JJ.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/wr.K),h=l.color[1]**(1/wr.K),f=l.color[2]**(1/wr.K),m=l.emissiveFactor[0]**(1/wr.K),p=l.emissiveFactor[1]**(1/wr.K),_=l.emissiveFactor[2]**(1/wr.K),g=null!=l.textureColor&&c?a.get(l.textureColor):null;n.set(s,new lr({...i,transparent:u===U.JJ.Blend,customDepthTest:U.Gv.Lequal,textureAlphaMode:u,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,h,f],ambient:[r,h,f],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?U.Vr.None:U.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:d?at.r.Attribute:at.r.ScreenDerivative,castShadows:!0,receiveSSAO:!0,textureId:null!=g?g.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&c?a.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=g&&!!g.params.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&c?a.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&c?a.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&c?a.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[m,p,_],mrrFactors:[l.metallicFactor,l.roughnessFactor,i.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:R(l.colorTextureTransform),normalTextureTransformMatrix:R(l.normalTextureTransform),occlusionTextureTransformMatrix:R(l.occlusionTextureTransform),emissiveTextureTransformMatrix:R(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(l.metallicRoughnessTextureTransform),...o}))}const h=n.get(s);if(r.stageResources.materials.push(h),c){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(l.textureColor),e(l.textureNormal),e(l.textureOcclusion),e(l.textureEmissive),e(l.textureMetallicRoughness)}return h}(o,e,b,t,r,s,l),{geometry:a,vertexCount:c}=function(e,t){const r=e.attributes.position.count,i=(0,E.p)(e.indices||r,e.primitiveType),o=f(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,p.t)(o,a,e.transform,3,s);const l=[[ne.T.POSITION,new B.a(o,3,!0)]],c=[[ne.T.POSITION,i]];if(null!=e.attributes.normal){const t=f(3*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.normal;(0,n.b)(Or,e.transform),(0,p.a)(t,o,Or,3,a),l.push([ne.T.NORMAL,new B.a(t,3,!0)]),c.push([ne.T.NORMAL,i])}if(null!=e.attributes.tangent){const t=f(4*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.tangent;(0,n.b)(Or,e.transform),(0,_.t)(t,o,Or,4,a),l.push([ne.T.TANGENT,new B.a(t,4,!0)]),c.push([ne.T.TANGENT,i])}if(null!=e.attributes.texCoord0){const t=f(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([ne.T.UV0,new B.a(t,2,!0)]),c.push([ne.T.UV0,i])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,_.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,T.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,_.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,p.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,p.s)(t,e.attributes.color,1/256,4)),l.push([ne.T.COLOR,new B.a(t,4,!0)]),c.push([ne.T.COLOR,i])}return{geometry:new ae(t,l,c),vertexCount:r}}(e,null!=i?i:new lr({})),S=a.boundingInfo;null!=S&&0===h&&((0,u.pp)(d,S.bbMin),(0,u.pp)(d,S.bbMax)),null!=i&&(b.stageResources.geometries.push(a),b.numberOfVertices+=c)})),x||a.push(b)})),{engineResources:a,referenceBoundingBox:d}}const Or=(0,a.c)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>d});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
288
288
|
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
289
289
|
}`)}function d(e,t){const{vertex:r}=e;switch(t.output){case i.H.Color:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.H.Depth:case i.H.Shadow:case i.H.ShadowHighlight:case i.H.ShadowExcludeHighlight:return e.include(o.up,t),s(e),l(e),c(e),void r.code.add(a.H`void forwardLinearDepth() {
|
|
290
290
|
linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
|
|
@@ -395,16 +395,14 @@ return proj * (view * vec4(pos, 1.0));
|
|
|
395
395
|
${t.instancedDoublePrecision?"return vec4(modelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
|
|
396
396
|
|
|
397
397
|
}
|
|
398
|
-
`)}(0,i._)([(0,u.o)()],m.prototype,"instancedDoublePrecision",void 0);const _=(0,n.c)()},
|
|
399
|
-
float z = 1.0 - abs(
|
|
400
|
-
return vec3(
|
|
401
|
-
}
|
|
402
|
-
return decodeNormal(normalCompressed);
|
|
403
|
-
}`);break;case a.Attribute:e.attributes.add(l.T.NORMAL,"vec3"),e.vertex.code.add(o.H`vec3 normalModel() {
|
|
398
|
+
`)}(0,i._)([(0,u.o)()],m.prototype,"instancedDoublePrecision",void 0);const _=(0,n.c)()},60624:(e,t,r)=>{r.d(t,{O:()=>l,r:()=>i});var i,o,n=r(74085),a=r(74709),s=r(35065);function l(e,t){switch(t.normalType){case i.CompressedAttribute:e.attributes.add(s.T.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(a.H`vec3 normalModel() {
|
|
399
|
+
float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y);
|
|
400
|
+
return vec3(normalCompressed + sign(normalCompressed) * min(z, 0.0), z);
|
|
401
|
+
}`);break;case i.Attribute:e.attributes.add(s.T.NORMAL,"vec3"),e.vertex.code.add(a.H`vec3 normalModel() {
|
|
404
402
|
return normal;
|
|
405
|
-
}`);break;case
|
|
403
|
+
}`);break;case i.ScreenDerivative:e.fragment.code.add(a.H`vec3 screenDerivativeNormal(vec3 positionView) {
|
|
406
404
|
return normalize(cross(dFdx(positionView), dFdy(positionView)));
|
|
407
|
-
}`);break;default:(0,
|
|
405
|
+
}`);break;default:(0,n.Bg)(t.normalType);case i.COUNT:case i.Ground:}}(o=i||(i={}))[o.Attribute=0]="Attribute",o[o.CompressedAttribute=1]="CompressedAttribute",o[o.Ground=2]="Ground",o[o.ScreenDerivative=3]="ScreenDerivative",o[o.COUNT=4]="COUNT"},37099:(e,t,r)=>{r.d(t,{f:()=>n});var i=r(74709),o=r(35065);function n(e){e.attributes.add(o.T.POSITION,"vec3"),e.vertex.code.add(i.H`vec3 positionModel() { return position; }`)}},76056:(e,t,r)=>{r.d(t,{R:()=>c});var i=r(6206),o=r(74709);function n(e){e.vertex.code.add(o.H`
|
|
408
406
|
vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
|
|
409
407
|
float symbolAlpha = 0.0;
|
|
410
408
|
|
|
@@ -446,14 +444,14 @@ vuv0 = getUV0();
|
|
|
446
444
|
vuv0 = uv0;
|
|
447
445
|
vuvRegion = uvRegion;
|
|
448
446
|
}`);default:(0,n.Bg)(t.textureCoordinateType);case i.None:return void e.vertex.code.add(a.H`void forwardTextureCoordinates() {}`);case i.COUNT:return}}(o=i||(i={}))[o.None=0]="None",o[o.Default=1]="Default",o[o.Atlas=2]="Atlas",o[o.Compressed=3]="Compressed",o[o.COUNT=4]="COUNT"},11317:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(74709),o=r(35065);function n(e,t){t.hasVertexColors?(e.attributes.add(o.T.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
|
|
449
|
-
void forwardNormalizedVertexColor() {}`)}},15719:(e,t,r)=>{r.d(t,{Bb:()=>d,d4:()=>u});var i=r(74085),o=r(46521),n=(r(88669),r(
|
|
447
|
+
void forwardNormalizedVertexColor() {}`)}},15719:(e,t,r)=>{r.d(t,{Bb:()=>d,d4:()=>u});var i=r(74085),o=r(46521),n=(r(88669),r(60624)),a=r(2095),s=r(74709),l=r(52114),c=r(19850);function d(e,t){switch(t.normalType){case n.r.Attribute:case n.r.CompressedAttribute:e.include(n.O,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add([new l.j("transformNormalGlobalFromModel",(e=>e.transformNormalGlobalFromModel)),new c.c("transformNormalViewFromGlobal",(e=>e.transformNormalViewFromGlobal))]),e.vertex.code.add(s.H`void forwardNormal() {
|
|
450
448
|
vNormalWorld = transformNormalGlobalFromModel * normalModel();
|
|
451
449
|
vNormalView = transformNormalViewFromGlobal * vNormalWorld;
|
|
452
|
-
}`);break;case n.
|
|
450
|
+
}`);break;case n.r.Ground:e.include(a.up,t),e.varyings.add("vNormalWorld","vec3"),e.vertex.code.add(s.H`
|
|
453
451
|
void forwardNormal() {
|
|
454
452
|
vNormalWorld = ${t.spherical?s.H`normalize(vPositionWorldCameraRelative);`:s.H`vec3(0.0, 0.0, 1.0);`}
|
|
455
453
|
}
|
|
456
|
-
`);break;case n.
|
|
454
|
+
`);break;case n.r.ScreenDerivative:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:(0,i.Bg)(t.normalType);case n.r.COUNT:}}class u extends a.su{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.c)()}}},2095:(e,t,r)=>{r.d(t,{su:()=>p,up:()=>m});var i=r(46521),o=r(13598),n=(r(72119),r(65617)),a=r(37099),s=r(89243),l=r(70582),c=r(172),d=r(74709),u=r(52114),h=r(19850),f=r(8319);function m(e,t){e.include(a.f);const r=e.vertex;r.include(s.$,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add([new c.J("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new c.J("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new h.c("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new f.g("transformProjFromView",(e=>e.transformProjFromView)),new u.j("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new l.B("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new l.B("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))]),r.code.add(d.H`vec3 positionWorldCameraRelative() {
|
|
457
455
|
vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
|
|
458
456
|
vec3 transform_CameraRelativeFromModel = dpAdd(
|
|
459
457
|
transformWorldFromModelTL,
|
|
@@ -534,7 +532,7 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
|
|
|
534
532
|
vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
535
533
|
return worldPos + calculateVerticalOffset(worldPos, localOrigin);
|
|
536
534
|
}
|
|
537
|
-
`)):r.code.add(a.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const u=(0,o.c)()},89136:(e,t,r)=>{r.d(t,{s:()=>R});var i=r(13598),o=r(1391),n=r(55039),a=r(51546),s=r(77171),l=r(
|
|
535
|
+
`)):r.code.add(a.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const u=(0,o.c)()},89136:(e,t,r)=>{r.d(t,{s:()=>R});var i=r(13598),o=r(1391),n=r(55039),a=r(51546),s=r(77171),l=r(60624),c=r(74709),d=r(35065);function u(e,t){const r=t.output===n.H.ObjectAndLayerIdColor,i=t.objectAndLayerIdColorInstanced;r&&(e.varyings.add("objectAndLayerIdColorVarying","vec4"),i?e.attributes.add(d.T.OBJECTANDLAYERIDCOLOR_INSTANCED,"vec4"):e.attributes.add(d.T.OBJECTANDLAYERIDCOLOR,"vec4")),e.vertex.code.add(c.H`
|
|
538
536
|
void forwardObjectAndLayerIdColor() {
|
|
539
537
|
${r?i?c.H`objectAndLayerIdColorVarying = objectAndLayerIdColor_instanced * 0.003921568627451;`:c.H`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:c.H``} }`),e.fragment.code.add(c.H`
|
|
540
538
|
void outputObjectAndLayerIdColor() {
|
|
@@ -573,11 +571,11 @@ fragColor = unoccludedHighlightFlag;
|
|
|
573
571
|
discardOrAdjustAlpha(texColor);`:""}
|
|
574
572
|
${t.output===n.H.ObjectAndLayerIdColor?c.H`outputObjectAndLayerIdColor();`:c.H`outputDepth(depth);`}
|
|
575
573
|
}
|
|
576
|
-
`);break;case n.H.Normal:(0,A.Sv)(r,t),e.include(s.w,t),e.include(l.O,t),e.include(f.Bb,t),e.include(h.D,t),e.include(b.k,t),_&&d.uniforms.add(new g.A("tex",(e=>e.texture))),t.normalType===l.
|
|
574
|
+
`);break;case n.H.Normal:{(0,A.Sv)(r,t),e.include(s.w,t),e.include(l.O,t),e.include(f.Bb,t),e.include(h.D,t),e.include(b.k,t),_&&d.uniforms.add(new g.A("tex",(e=>e.texture))),t.normalType===l.r.ScreenDerivative&&e.varyings.add("vPositionView","vec3");const i=t.normalType===l.r.Attribute||t.normalType===l.r.CompressedAttribute;r.code.add(c.H`
|
|
577
575
|
void main(void) {
|
|
578
576
|
vpos = calculateVPos();
|
|
579
577
|
|
|
580
|
-
${
|
|
578
|
+
${i?c.H`
|
|
581
579
|
vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:c.H`
|
|
582
580
|
// Get vertex position in camera space for screen-space derivative normals
|
|
583
581
|
vPositionView = (view * (${m?"model *":""} vec4(vpos, 1.0))).xyz;
|
|
@@ -594,14 +592,14 @@ fragColor = unoccludedHighlightFlag;
|
|
|
594
592
|
vec4 texColor = texture(tex, ${t.hasColorTextureTransform?c.H`colorUV`:c.H`vuv0`});
|
|
595
593
|
discardOrAdjustAlpha(texColor);`:""}
|
|
596
594
|
|
|
597
|
-
${t.normalType===l.
|
|
595
|
+
${t.normalType===l.r.ScreenDerivative?c.H`vec3 normal = screenDerivativeNormal(vPositionView);`:c.H`
|
|
598
596
|
vec3 normal = normalize(vNormalWorld);
|
|
599
597
|
if (gl_FrontFacing == false){
|
|
600
598
|
normal = -normal;
|
|
601
599
|
}`}
|
|
602
600
|
fragColor = vec4(0.5 + 0.5 * normal, 1.0);
|
|
603
601
|
}
|
|
604
|
-
`);break
|
|
602
|
+
`);break}case n.H.Highlight:(0,A.Sv)(r,t),e.include(s.w,t),e.include(h.D,t),e.include(b.k,t),_&&d.uniforms.add(new g.A("tex",(e=>e.texture))),r.code.add(c.H`
|
|
605
603
|
void main(void) {
|
|
606
604
|
vpos = calculateVPos();
|
|
607
605
|
vpos = subtractOrigin(vpos);
|
|
@@ -1097,4 +1095,4 @@ const vec4 RGBA_2_FLOAT_FACTORS = vec4(
|
|
|
1097
1095
|
);
|
|
1098
1096
|
float rgba2float(vec4 rgba) {
|
|
1099
1097
|
return dot(rgba, RGBA_2_FLOAT_FACTORS);
|
|
1100
|
-
}`)}},93669:(e,t,r)=>{r.d(t,{hY:()=>f,Sv:()=>m,_8:()=>g});var i=r(52138),o=r(10937),n=r(17896),a=r(65617),s=r(70582),l=r(172),c=r(79884),d=r(67498);class u extends c.x{constructor(e,t){super(e,"mat4",d.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function f(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,n.s)(_,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function m(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin))]);const r=e=>(0,n.s)(_,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new h.g("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t)))])}const p=(0,o.c)(),_=(0,a.c)();function g(e){e.uniforms.add(new h.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},98925:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Draw,((r,i,o,n)=>r.setUniform2fv(e,t(i,o,n))))}}},19693:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,n)=>r.setUniform3fv(e,t(i,o,n))))}}},172:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),o=r(92604),n=r(11726);const a=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){a.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class l extends s{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new f,this.extensions=new m,this.constants=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s="vertex"===e?g:_,l=this.constants.generateSource().concat(o.constants.generateSource());return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${n.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${a.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];null!=i&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];null!=i&&r.set(t.name,i)}));const i=Array.from(r.values()),o=i.length;return(e,r,n)=>{for(let a=0;a<o;++a)i[a](t,e,r,n)}}}class c{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else a.error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class u extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new d,this.constants=new p}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,n.hu)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push("vertex"===e?`out ${r} ${i};`:`in ${r} ${i};`))),t}}class m{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?m.ALLOWLIST_VERTEX:m.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}m.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],m.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>p._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif\n\nout vec4 fragColor;",g="precision highp float;\nprecision highp sampler2D;"},16374:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},98069:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},79884:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(67498);class o{constructor(e,t,r,o,n=null){this.name=e,this.type=t,this.arraySize=n,this.bind={[i.P.Pass]:null,[i.P.Draw]:null},null!=r&&null!=o&&(this.bind[r]=o)}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});const i=class{};function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}var n;(n=o||(o={})).int=function(e){return Math.round(e).toString()},n.float=function(e){return e.toPrecision(8)}},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},78869:(e,t,r)=>{r.d(t,{J:()=>i});class i{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},14589:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(70586),o=r(35371);class n{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,i.M2)(this._program),this._pipeline=this._configuration=null}reload(e){(0,i.M2)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return o.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}},51354:(e,t,r)=>{r.d(t,{m:()=>o,o:()=>n});var i=r(74709);class o extends i.K{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function n(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits??[0];let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);t._parameterBits=a;const l=a[s],c=(1<<n)-1<<l;a[s]+=n,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}unload(){}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.COLORFEATUREATTRIBUTE,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR_INSTANCED,7],[i.T.MODEL,8],[i.T.MODELNORMAL,12],[i.T.MODELORIGINHI,11],[i.T.MODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>l});var i=r(70586),o=r(95330),n=r(74709),a=r(47026);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return a.Rw.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Rw.LOADED:a.Rw.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends n.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},82791:(e,t,r)=>{r.d(t,{F5:()=>d,yD:()=>i});var i,o,n=r(65617),a=(r(74709),r(17662)),s=r(4726),l=r(83475),c=r(57790);class d extends a.c{constructor(e,t){super(),this.type=s.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=l.i,this._pp0=(0,n.f)(0,0,1),this._pp1=(0,n.f)(0,0,0),this._parameters=(0,c.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,c.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){null!=this.repository&&this.repository.materialChanged(this)}intersectDraped(e,t,r,i,o,n){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},59377:(e,t,r)=>{r.d(t,{$:()=>a});var i=r(44553),o=r(67498),n=r(49300);class a{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new i.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBind(o.P.Pass,this),this.bindDraw=t.generateBind(o.P.Draw,this),this._fragmentUniforms=(0,n.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t||null==t.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),null!=this._fragmentUniforms&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},89917:(e,t,r)=>{r.d(t,{ow:()=>_});var i=r(83475),o=r(35065),n=r(35371),a=r(21968);new a.G(o.T.POSITION,3,n.g.FLOAT,0,12),new a.G(o.T.POSITION,3,n.g.FLOAT,0,20),new a.G(o.T.UV0,2,n.g.FLOAT,12,20),new a.G(o.T.POSITION,3,n.g.FLOAT,0,32),new a.G(o.T.NORMAL,3,n.g.FLOAT,12,32),new a.G(o.T.UV0,2,n.g.FLOAT,24,32),new a.G(o.T.POSITION,3,n.g.FLOAT,0,16),new a.G(o.T.COLOR,4,n.g.UNSIGNED_BYTE,12,16);const s=[new a.G(o.T.POSITION,2,n.g.FLOAT,0,8)],l=[new a.G(o.T.POSITION,2,n.g.FLOAT,0,16),new a.G(o.T.UV0,2,n.g.FLOAT,8,16)];var c=r(92604),d=r(70586),u=r(45762);const h=c.Z.getLogger("esri.views.webgl.VertexArrayObject");let f=class{constructor(e,t,r,i,o=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=o,this._glName=null,this._initialized=!1,e.instanceCounter.increment(n._g.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),null!=this._indexBuffer?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){const e=this._context?.capabilities?.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):h.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e]?.dispose(),delete this._buffers[e];this._indexBuffer=(0,d.M2)(this._indexBuffer)}this._context.instanceCounter.decrement(n._g.VertexArrayObject,this),this._context=(0,d.wN)(this._context)}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&h.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||h.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||h.error("Vertex buffer is uninitialized!");const o=t[r];o||h.error("Vertex element descriptor is empty!"),(0,u.XP)(this._context,this._locations,i,o)}null!=r&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||h.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||h.error("Vertex buffer is uninitialized!");const o=t[r];(0,u.UF)(this._context,this._locations,i,o)}null!=this._indexBuffer&&this._context.unbindBuffer(this._indexBuffer.bufferType)}};class m extends f{}var p=r(63587);function _(e,t=s,r=i.i,o=-1,a=1){let c=null;return c=t===l?new Float32Array([o,o,0,0,a,o,1,0,o,a,0,1,a,a,1,1]):new Float32Array([o,o,a,o,o,a,a,a]),new m(e,r,{geometry:t},{geometry:p.f.createVertex(e,n.l1.STATIC_DRAW,c)})}r(75656)},57790:(e,t,r)=>{r.d(t,{FZ:()=>R,Uf:()=>A,Bw:()=>m,LO:()=>S,Hx:()=>E});var i=r(67676),o=r(22021),n=r(17896),a=r(65617),s=r(60437),l=r(4726);function c(e,t,r,i){return function(e,t){return Math.max((0,o.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}(e,function(e,t,r){const i=r.parameters,o=r.paddingPixelsOverride;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d.minPixelSize=i.minPixelSize,d.paddingPixels=o,d}(t,r,i))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const d={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var u=r(11726),h=r(35065);const f=(0,s.Ue)();function m(e,t,r,i,o,n){if(e.visible)if(e.boundingInfo){(0,u.hu)(e.type===l.U.Mesh);const a=t.tolerance;_(e.boundingInfo,r,i,a,o,n)}else{const t=e.indices.get(h.T.POSITION),a=e.vertexAttributes.get(h.T.POSITION);v(r,i,0,t.length/3,t,a,void 0,o,n)}}const p=(0,a.c)();function _(e,t,r,i,o,a){if(null==e)return;const l=function(e,t,r){return(0,n.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,p);if((0,s.op)(f,e.bbMin),(0,s.Tn)(f,e.bbMax),null!=o&&o.applyToAabb(f),function(e,t,r,i){return function(e,t,r,i,o){const n=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(n,a),l=Math.max(n,a);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(f,t,l,i)){const{primitiveIndices:n,indices:s,position:l}=e,c=n?n.length:s.length/3;if(c>y){const n=e.getChildren();if(void 0!==n){for(const e of n)_(e,t,r,i,o,a);return}}v(t,r,0,c,s,l,n,o,a)}}const g=(0,a.c)();function v(e,t,r,i,o,n,a,s,l){if(a)return function(e,t,r,i,o,n,a,s,l){const{data:c,stride:d}=n,u=e[0],h=e[1],f=e[2],m=t[0]-u,p=t[1]-h,_=t[2]-f;for(let e=r;e<i;++e){const t=a[e];let r=3*t,i=d*o[r++],n=c[i++],v=c[i++],T=c[i];i=d*o[r++];let x=c[i++],E=c[i++],A=c[i];i=d*o[r];let S=c[i++],w=c[i++],R=c[i];null!=s&&([n,v,T]=s.applyToVertex(n,v,T,e),[x,E,A]=s.applyToVertex(x,E,A,e),[S,w,R]=s.applyToVertex(S,w,R,e));const y=x-n,C=E-v,O=A-T,M=S-n,P=w-v,N=R-T,I=p*N-P*_,L=_*M-N*m,D=m*P-M*p,H=y*I+C*L+O*D;if(Math.abs(H)<=Number.EPSILON)continue;const F=u-n,B=h-v,U=f-T,V=F*I+B*L+U*D;if(H>0){if(V<0||V>H)continue}else if(V>0||V<H)continue;const z=B*O-C*U,G=U*y-O*F,W=F*C-y*B,k=m*z+p*G+_*W;if(H>0){if(k<0||V+k>H)continue}else if(k>0||V+k<H)continue;const $=(M*z+P*G+N*W)/H;$>=0&&l($,b(y,C,O,M,P,N,g),t,!1)}}(e,t,r,i,o,n,a,s,l);const{data:c,stride:d}=n,u=e[0],h=e[1],f=e[2],m=t[0]-u,p=t[1]-h,_=t[2]-f;for(let e=r,t=3*r;e<i;++e){let r=d*o[t++],i=c[r++],n=c[r++],a=c[r];r=d*o[t++];let v=c[r++],T=c[r++],x=c[r];r=d*o[t++];let E=c[r++],A=c[r++],S=c[r];null!=s&&([i,n,a]=s.applyToVertex(i,n,a,e),[v,T,x]=s.applyToVertex(v,T,x,e),[E,A,S]=s.applyToVertex(E,A,S,e));const w=v-i,R=T-n,y=x-a,C=E-i,O=A-n,M=S-a,P=p*M-O*_,N=_*C-M*m,I=m*O-C*p,L=w*P+R*N+y*I;if(Math.abs(L)<=Number.EPSILON)continue;const D=u-i,H=h-n,F=f-a,B=D*P+H*N+F*I;if(L>0){if(B<0||B>L)continue}else if(B>0||B<L)continue;const U=H*y-R*F,V=F*w-y*D,z=D*R-w*H,G=m*U+p*V+_*z;if(L>0){if(G<0||B+G>L)continue}else if(G>0||B+G<L)continue;const W=(C*U+O*V+M*z)/L;W>=0&&l(W,b(w,R,y,C,O,M,g),e,!1)}}const T=(0,a.c)(),x=(0,a.c)();function b(e,t,r,i,o,a,s){return(0,n.s)(T,e,t,r),(0,n.s)(x,i,o,a),(0,n.f)(s,T,x),(0,n.n)(s,s),s}function E(e,t,r,i,n){let a=(r.screenLength||0)*e.pixelRatio;null!=n&&(a=c(a,i,t,n));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function A(e,t){const r=t?A(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=w(i)),null==i&&t in r||(r[t]=i)}return r}function S(e,t){let r=!1;for(const o in t){const n=t[o];void 0!==n&&(Array.isArray(n)?null===e[o]?(e[o]=n.slice(),r=!0):(0,i.Vx)(e[o],n)&&(r=!0):e[o]!==n&&(r=!0,e[o]=n))}return r}function w(e){const t=[];return e.forEach((e=>t.push(e))),t}const R={multiply:1,ignore:2,replace:3,tint:4},y=1e3},63587:(e,t,r)=>{r.d(t,{f:()=>u});var i=r(67676),o=r(92604),n=r(70586),a=r(1533),s=r(49300),l=r(54738),c=r(35371);const d=o.Z.getLogger("esri.views.webgl.BufferObject");class u{static createIndex(e,t,r){return new u(e,c.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new u(e,c.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==l.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new u(e,c.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=c.l1.STREAM_READ,r){if(e.type!==l.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new u(e,c.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=c.l1.STREAM_DRAW,r){if(e.type!==l.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new u(e,c.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(c._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,s.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER?this._indexType===c.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===c.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(c._g.BufferObject,this),this._context=(0,n.wN)(this._context)):this._glName&&d.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&d.error("Buffer size needs to be positive!"),this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case c.g.UNSIGNED_SHORT:e*=2;break;case c.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER&&((0,a.Uc)(e)&&(t/=2,this._indexType=c.g.UNSIGNED_SHORT),(0,a.ZY)(e)&&(t/=4,this._indexType=c.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,s.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteSize)&&d.error("offset is out of range!"),r>=i&&d.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteSize&&d.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===l.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,s.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,o){if(this._context.type!==l.zO.WEBGL2)return void d.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||o<0)return void d.error("Problem getting subdata: offset and length were less than zero!");const n=function(e){return(0,i.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(n*((r??0)+(o??0))>e.byteLength)return void d.error("Problem getting subdata: offset and length exceeded destination size!");t+n*(o??0)>this.byteSize&&d.warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;this._context.bindBuffer(this,c.w0.COPY_READ_BUFFER),a.getBufferSubData(c.w0.COPY_READ_BUFFER,t,e,r,o),this._context.unbindBuffer(c.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===l.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):d.error("Get buffer subdata is supported in WebGL2 only!")}}},33696:(e,t,r)=>{r.d(t,{X:()=>h});var i=r(92604),o=r(63587),n=r(49300),a=r(54738),s=r(35371),l=r(70586);class c{constructor(e,t){this._context=e,this._desc=t,this.type="renderbuffer",this._context.instanceCounter.increment(s._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:l}=t;if(l){if(this._context.type!==a.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(s._g.Renderbuffer,this),this._context=(0,l.wN)(this._context))}}var d=r(75656),u=r(45762);class h{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._depthStencilTexture=null,this._initialized=!1,this._desc={...t},e.instanceCounter.increment(s._g.FramebufferObject,this),null!=r){Array.isArray(r)||(r=[r]);for(let e=0;e<r.length;++e){const t=r[e],i=s.VY.COLOR_ATTACHMENT0+e;let o;p(t)?(f(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new d.x(this._context,o))),_(o,this._desc)):(m(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new c(this._context,o))),g(o,this._desc)),this._validateColorAttachmentPoint(i)}}if(null!=i){let e,t;if(p(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),f(i)?(t=i.descriptor,this._depthStencilTexture=i):(t=i,this._depthStencilTexture=new d.x(this._context,t)),_(t,this._desc);else{m(i)?(t=i.descriptor,e=i):(t=i,e=new c(this._context,t));const r=this._desc.depthStencilTarget??s.OU.DEPTH_STENCIL_RENDER_BUFFER;r===s.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=e:r===s.OU.DEPTH_RENDER_BUFFER||r===s.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=e:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),this._desc.depthStencilTarget=r,g(t,this._desc)}}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(s._g.FramebufferObject,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get(s.VY.COLOR_ATTACHMENT0);return e&&f(e)?e:null}get colorAttachment(){return this._colorAttachments.get(s.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width??0}get height(){return this._desc.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+(0,u.un)(r)),0)+(0,u.un)(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&f(t)?t:null}attachColorTexture(e,t=s.VY.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(t),_(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e))}detachColorTexture(e=s.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(f(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,t=s.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);f(r)&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==s.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==s.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),_(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==s.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=s.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,s.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,s.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(t.internalFormat!==s.Tg.DEPTH_STENCIL&&t.internalFormat!==s.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),g(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===s.Tg.DEPTH_STENCIL?s.OU.DEPTH_STENCIL_RENDER_BUFFER:s.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(s.qi.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(s.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this._colorAttachments.forEach(((e,t)=>this._detachColorAttachment(t))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const l=this._desc,c=a.descriptor;a.descriptor.target!==s.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==l?.width||null==l?.height||null==c?.width||null==c?.height||e+r>l.width||t+i>l.height||o+r>c.width||n+i>c.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const u=this._context,h=u.bindTexture(a,d.x.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(d.x.TEXTURE_UNIT_FOR_UPDATES),u.bindFramebuffer(this),u.gl.copyTexSubImage2D(s.No.TEXTURE_2D,0,o,n,e,t,r,i),u.bindTexture(h,d.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,l,c,d){if(this._context.type!==a.zO.WEBGL2)return(0,n.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,l,c,d);const u=this._context.gl,h=o.f.createPixelPack(this._context,s.l1.STREAM_READ,d.byteLength);this._context.bindBuffer(h),this._context.bindFramebuffer(this),u.readPixels(e,t,r,i,l,c,0),this._context.unbindBuffer(s.w0.PIXEL_PACK_BUFFER),await h.getSubDataAsync(d),h.dispose()}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(r.width=e,r.height=t,!this._initialized)return this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=s.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=this._context,i=t.createFramebuffer(),o=this._desc,a=o.colorTarget??s.Lm.RENDER_BUFFER,l=o.width??1,u=o.height??1;if(t.bindFramebuffer(e,i),0===this._colorAttachments.size)if(a===s.Lm.TEXTURE||a===s.Lm.CUBEMAP)this._colorAttachments.set(s.VY.COLOR_ATTACHMENT0,function(e,t,r){return new d.x(e,{target:r,pixelFormat:s.VI.RGBA,dataType:s.Br.UNSIGNED_BYTE,samplingMode:s.cw.NEAREST,wrapMode:s.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(r,o,this.descriptor.colorTarget===s.Lm.CUBEMAP?s.No.TEXTURE_CUBE_MAP:s.No.TEXTURE_2D));else{const e=new c(r,{internalFormat:s.lP.RGBA4,width:l,height:u});this._colorAttachments.set(s.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((r,i)=>{r&&(f(r)?this._framebufferTexture2D(r.glName,i,v(r),e):t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,r.glName))}));const h=o.depthStencilTarget??s.OU.NONE;switch(h){case s.OU.DEPTH_RENDER_BUFFER:case s.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new c(r,{internalFormat:o.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?s.Tg.DEPTH_COMPONENT16:s.Tg.DEPTH_STENCIL,width:l,height:u}));const i=h===s.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,this._depthAttachment.glName);break}case s.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new c(r,{internalFormat:s.Tg.STENCIL_INDEX8,width:l,height:u})),t.framebufferRenderbuffer(e,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,this._stencilAttachment.glName);break;case s.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){r.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:s.No.TEXTURE_2D,pixelFormat:s.VI.DEPTH_STENCIL,dataType:s.Br.UNSIGNED_INT_24_8,samplingMode:s.cw.NEAREST,wrapMode:s.e8.CLAMP_TO_EDGE,width:l,height:u};this._depthStencilTexture=new d.x(r,e)}this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,v(this._depthStencilTexture),e)}(0,n.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(e,t=s.VY.COLOR_ATTACHMENT0,r=s.No.TEXTURE_2D,i=s.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_detachColorAttachment(e){(0,n.hZ)()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const t=this._context.gl,r=this._colorAttachments.get(e);return f(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(s.qi.FRAMEBUFFER,e,t.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{this._detachColorAttachment(t),e.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(s.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(s.qi.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(-1===h._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;h._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else h._MAX_COLOR_ATTACHMENTS=1}const t=e-s.VY.COLOR_ATTACHMENT0;t+1>h._MAX_COLOR_ATTACHMENTS&&i.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${h._MAX_COLOR_ATTACHMENTS} color attachments`)}}function f(e){return null!=e&&"type"in e&&"texture"===e.type}function m(e){return null!=e&&"type"in e&&"renderbuffer"===e.type}function p(e){return f(e)||null!=e&&"pixelFormat"in e}function _(e,t){e.target!==s.No.TEXTURE_2D&&e.target!==s.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function g(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function v(e){return e.descriptor.target===s.No.TEXTURE_CUBE_MAP?s.No.TEXTURE_CUBE_MAP_POSITIVE_X:s.No.TEXTURE_2D}h._MAX_COLOR_ATTACHMENTS=-1},75656:(e,t,r)=>{r.d(t,{x:()=>l}),r(80442);var i=r(22021),o=r(49300),n=r(54738),a=r(35371);const s={target:a.No.TEXTURE_2D,samplingMode:a.cw.LINEAR,wrapMode:a.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1};let l=class{constructor(e,t,r=null){this._context=e,this.type="texture",this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(a._g.Texture,this),this._descriptor={...s,...t};for(const e in s)void 0===this._descriptor[e]&&(this._descriptor[e]=s[e]);if(e.type!==n.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),u(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===a.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(a._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===a.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=a.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=a.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor,n=t??i.target,s=u(n);null===e&&(i.width=i.width||4,i.height=i.height||4,s&&(i.depth=i.depth??1));const f=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),l._validateTexture(this._context,i),this._configurePixelStorage(),(0,o.zu)(r);const m=i.pixelFormat;let p=i.internalFormat??this._deriveInternalFormat(m,i.dataType);if(d(e)){let t=e.width,a=e.height;const l=1;e instanceof HTMLVideoElement&&(t=e.videoWidth,a=e.videoHeight),i.width&&i.height,s&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,p,i.hasMipmap,t,a,l),this._texImage(n,0,p,t,a,l,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=t),void 0===i.height&&(i.height=a),s&&void 0===i.depth&&(i.depth=l)}else{const{width:t,height:l,depth:d}=i;if(null==t||null==l)throw new Error("Width and height must be specified!");if(s&&null==d)throw new Error("Depth must be specified!");if(i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,p,i.hasMipmap,t,l,d),r.DEPTH24_STENCIL8&&p===r.DEPTH_STENCIL&&(p=r.DEPTH24_STENCIL8),c(e)){const o=e.levels,s=h(n,t,l,d),c=Math.min(s-1,o.length-1);null!=this._context.gl2?r.texParameteri(i.target,this._context.gl2.TEXTURE_MAX_LEVEL,c):i.hasMipmap=i.hasMipmap&&s===o.length;const u=p;if(!function(e){return e in a.q_}(u))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const a=o[Math.min(e,o.length-1)];this._compressedTexImage(n,e,u,t,r,i,a)}),c)}else null!=e?(this._texImage(n,0,p,t,l,d,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,t,i,a)=>{this._texImage(n,e,p,t,i,a,null),(0,o.zu)(r)}))}l._applySamplingMode(r,this._descriptor),l._applyWrapMode(r,this._descriptor),l._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,o.zu)(r),this._context.bindTexture(f,l.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,o,n,a=0){n||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const s=this._context.gl,u=this._descriptor,{pixelFormat:h,dataType:f,target:m,isImmutable:p}=u,_=u.internalFormat??this._deriveInternalFormat(h,f);if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const g=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES,!0);if((t<0||r<0||i>u.width||o>u.height||t+i>u.width||r+o>u.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),a){if(null==this._context.gl2)return void console.error("Webgl2 must be enabled to use dataRowOffset!");s.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,a)}if(d(n)?null!=this._context.gl2?this._context.gl2.texSubImage2D(m,e,t,r,i,o,h,f,n):s.texSubImage2D(m,e,t,r,h,f,n):c(n)?s.compressedTexSubImage2D(m,e,t,r,i,o,_,n.levels[e]):s.texSubImage2D(m,e,t,r,i,o,h,f,n),a){if(null==this._context.gl2)return void console.error("Webgl2 must be enabled to use dataRowOffset!");s.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,0)}this._context.bindTexture(g,l.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,o,n,a,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const d=this._context.gl2;if(null==d)throw new Error("3D textures are not supported in WebGL1");const h=this._descriptor,{pixelFormat:f,dataType:m,isImmutable:p,target:_}=h,g=h.internalFormat??this._deriveInternalFormat(f,m);if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");u(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const v=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||o>h.width||n>h.height||a>h.depth||t+o>h.width||r+n>h.height||i+a>h.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),c(s))s=s.levels[e],d.compressedTexSubImage3D(_,e,t,r,i,o,n,a,g,s);else{const l=s;d.texSubImage3D(_,e,t,r,i,o,n,a,f,m,l)}this._context.bindTexture(v,l.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,l._validateTexture(this._context,e)}e.samplingMode===a.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=a.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===a.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=a.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,l.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,l._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(l._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(l._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===n.zO.WEBGL1)return e;switch(t){case a.Br.FLOAT:switch(e){case a.VI.RGBA:return a.lP.RGBA32F;case a.VI.RGB:return a.lP.RGB32F;default:throw new Error("Unable to derive format")}case a.Br.UNSIGNED_BYTE:switch(e){case a.VI.RGBA:return a.lP.RGBA8;case a.VI.RGB:return a.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,i,o,n){const s=this._context.gl2;if(null==s)throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in a.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?h(e,i,o,n):1;if(u(e)){if(null==n)throw new Error("Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,i,o,n)}else s.texStorage2D(e,l,t,i,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,o,a,s){const l=this._context.gl;let c=null;const h=this._context.type===n.zO.WEBGL2,f=u(e),{isImmutable:m,pixelFormat:p,dataType:_}=this._descriptor;if(h&&(c=l),h||!d(s))if(m){if(null!=s){const r=s;if(f){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,i,o,a,p,_,r)}else l.texSubImage2D(e,t,0,0,i,o,p,_,r)}}else{const n=s;if(f){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,i,o,a,0,p,_,n)}else l.texImage2D(e,t,r,i,o,0,p,_,n)}else l.texImage2D(e,0,r,p,_,s)}_compressedTexImage(e,t,r,i,o,a,s){const l=this._context.gl;let c=null;const d=u(e),h=this._descriptor.isImmutable;if(d){if(this._context.type!==n.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");c=l}if(h){if(null!=s)if(d){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,i,o,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,i,o,r,s)}else if(d){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,i,o,a,0,s)}else l.compressedTexImage2D(e,t,r,i,o,0,s)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:o,hasMipmap:n,target:s}=this._descriptor;const l=s===a.No.TEXTURE_3D;if(null==r||null==i||l&&null==o)throw new Error("Missing texture dimensions for mipmap calculation");for(let a=0;e(a,r,i,o),n&&(1!==r||1!==i||l&&1!==o)&&!(a>=t);++a)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(o=Math.max(1,o>>1))}static _validateTexture(e,t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=e.type===n.zO.WEBGL2,o=null!=t.width&&(0,i.wt)(t.width)&&null!=t.height&&(0,i.wt)(t.height);r||!t.isImmutable&&!u(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||o||("number"==typeof t.wrapMode?t.wrapMode!==a.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===a.e8.CLAMP_TO_EDGE&&t.wrapMode.t===a.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===a.cw.LINEAR_MIPMAP_NEAREST||r===a.cw.LINEAR_MIPMAP_LINEAR?(r=a.cw.LINEAR,t.hasMipmap||(i=a.cw.LINEAR)):r!==a.cw.NEAREST_MIPMAP_NEAREST&&r!==a.cw.NEAREST_MIPMAP_LINEAR||(r=a.cw.NEAREST,t.hasMipmap||(i=a.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};function c(e){return null!=e&&"type"in e&&"compressed"===e.type}function d(e){return null!=e&&!c(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function u(e){return e===a.No.TEXTURE_3D||e===a.No.TEXTURE_2D_ARRAY}function h(e,t,r,i=1){let o=Math.max(t,r);return e===a.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}l.TEXTURE_UNIT_FOR_UPDATES=0},45762:(e,t,r)=>{r.d(t,{RG:()=>s,UF:()=>a,XP:()=>n,_V:()=>o,un:()=>l}),r(80442);var i=r(35371);function o(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}function n(e,t,r,i,o=0){const n=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=o*e.stride;if(e.count<=4)n.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),n.enableVertexAttribArray(r),e.divisor>0&&a&&a.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)n.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)n.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function a(e,t,r,o){const n=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of o){const r=t.get(e.name);if(e.count<=4)n.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer(i.w0.ARRAY_BUFFER)}function s(e){switch(e){case i.VI.ALPHA:case i.VI.LUMINANCE:case i.VI.RED:case i.VI.RED_INTEGER:case i.lP.R8:case i.lP.R8I:case i.lP.R8UI:case i.lP.R8_SNORM:case i.Tg.STENCIL_INDEX8:return 1;case i.VI.LUMINANCE_ALPHA:case i.VI.RG:case i.VI.RG_INTEGER:case i.lP.RGBA4:case i.lP.R16F:case i.lP.R16I:case i.lP.R16UI:case i.lP.RG8:case i.lP.RG8I:case i.lP.RG8UI:case i.lP.RG8_SNORM:case i.lP.RGB565:case i.lP.RGB5_A1:case i.Tg.DEPTH_COMPONENT16:return 2;case i.VI.DEPTH_COMPONENT:case i.VI.RGB:case i.VI.RGB_INTEGER:case i.lP.RGB8:case i.lP.RGB8I:case i.lP.RGB8UI:case i.lP.RGB8_SNORM:case i.lP.SRGB8:case i.Tg.DEPTH_COMPONENT24:return 3;case i.VI.DEPTH_STENCIL:case i.VI.RGBA:case i.VI.RGBA_INTEGER:case i.lP.RGBA8:case i.lP.R32F:case i.lP.R11F_G11F_B10F:case i.lP.RG16F:case i.lP.R32I:case i.lP.R32UI:case i.lP.RG16I:case i.lP.RG16UI:case i.lP.RGBA8I:case i.lP.RGBA8UI:case i.lP.RGBA8_SNORM:case i.lP.SRGB8_ALPHA8:case i.lP.RGB9_E5:case i.lP.RGB10_A2UI:case i.lP.RGB10_A2:case i.Tg.DEPTH_STENCIL:case i.Tg.DEPTH_COMPONENT32F:case i.Tg.DEPTH24_STENCIL8:return 4;case i.Tg.DEPTH32F_STENCIL8:return 5;case i.lP.RGB16F:case i.lP.RGB16I:case i.lP.RGB16UI:return 6;case i.lP.RG32F:case i.lP.RG32I:case i.lP.RG32UI:case i.lP.RGBA16F:case i.lP.RGBA16I:case i.lP.RGBA16UI:return 8;case i.lP.RGB32F:case i.lP.RGB32I:case i.lP.RGB32UI:return 12;case i.lP.RGBA32F:case i.lP.RGBA32I:case i.lP.RGBA32UI:return 16;case i.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.q_.COMPRESSED_R11_EAC:case i.q_.COMPRESSED_SIGNED_R11_EAC:case i.q_.COMPRESSED_RGB8_ETC2:case i.q_.COMPRESSED_SRGB8_ETC2:case i.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.q_.COMPRESSED_RG11_EAC:case i.q_.COMPRESSED_SIGNED_RG11_EAC:case i.q_.COMPRESSED_RGBA8_ETC2_EAC:case i.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function l(e){if(null==e)return 0;if("descriptor"in e)return e.glName?l(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return s(t)*i*r}},49300:(e,t,r)=>{r.d(t,{hZ:()=>s,zu:()=>l});var i=r(20102),o=r(80442);const n=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),a=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return a}function l(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),o=(new Error).stack;n.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:o}))}}}},54738:(e,t,r)=>{r.d(t,{Sh:()=>n,kr:()=>a,zO:()=>i});var i,o=r(80442);function n(e){const t=(0,o.Z)("esri-force-webgl");if(t===i.WEBGL1||t===i.WEBGL2)return[t];switch(e){case"2d":return(0,o.Z)("mac")&&(0,o.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1];case"3d":return[i.WEBGL2,i.WEBGL1]}}function a(e,t,r={}){const o=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let n=null;for(const t of o){try{n=e.getContext(t,r)}catch(e){}if(n)break}return n}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(i||(i={}))},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],t[i]=n[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],n[1]=e[i]-n[0],t[i]=n[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const n=new Float32Array(2)},27097:(e,t,r)=>{r.d(t,{BK:()=>u,LZ:()=>d,if:()=>n,sm:()=>x,wK:()=>a,zp:()=>c});var i=r(47026),o=r(35371);function n(e,t,r=o.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function a(e,t,r,i,n=o.db.ADD,a=o.db.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.LR.BACK,mode:o.Wf.CCW},l={face:o.LR.FRONT,mode:o.Wf.CCW},c=e=>e===i.Vr.Back?s:e===i.Vr.Front?l:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return A.intern(e)}function f(e){return w.intern(e)}function m(e){return y.intern(e)}function p(e){return O.intern(e)}function _(e){return P.intern(e)}function g(e){return I.intern(e)}function v(e){return D.intern(e)}function T(e){return F.intern(e)}function x(e){return U.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function E(e){return"["+e.join(",")+"]"}const A=new b(S,(e=>({__tag:"Blending",...e})));function S(e){return e?E([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const w=new b(R,(e=>({__tag:"Culling",...e})));function R(e){return e?E([e.face,e.mode]):null}const y=new b(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?E([e.factor,e.units]):null}const O=new b(M,(e=>({__tag:"DepthTest",...e})));function M(e){return e?E([e.func]):null}const P=new b(N,(e=>({__tag:"StencilTest",...e})));function N(e){return e?E([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const I=new b(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?E([e.zNear,e.zFar]):null}const D=new b(H,(e=>({__tag:"ColorWrite",...e})));function H(e){return e?E([e.r,e.g,e.b,e.a]):null}const F=new b(B,(e=>({__tag:"StencilWrite",...e})));function B(e){return e?E([e.mask]):null}const U=new b((function(e){return e?E([S(e.blending),R(e.culling),C(e.polygonOffset),M(e.depthTest),N(e.stencilTest),L(e.depthWrite),H(e.colorWrite),B(e.stencilWrite)]):null}),(e=>({blending:h(e.blending),culling:f(e.culling),polygonOffset:m(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:_(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:v(e.colorWrite),stencilWrite:T(e.stencilWrite)})))}}]);
|
|
1098
|
+
}`)}},93669:(e,t,r)=>{r.d(t,{hY:()=>f,Sv:()=>m,_8:()=>g});var i=r(52138),o=r(10937),n=r(17896),a=r(65617),s=r(70582),l=r(172),c=r(79884),d=r(67498);class u extends c.x{constructor(e,t){super(e,"mat4",d.P.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(8319);function f(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.Z):e.uniforms.add(new s.B("cameraPosition",((e,t)=>(0,n.s)(_,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function m(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,e.origin))),new s.B("localOrigin",(e=>e.origin))]);const r=e=>(0,n.s)(_,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add([new h.g("proj",((e,t)=>t.camera.projectionMatrix)),new h.g("view",((e,t)=>(0,i.w)(p,t.camera.viewMatrix,r(t)))),new l.J("localOrigin",((e,t)=>r(t)))])}const p=(0,o.c)(),_=(0,a.c)();function g(e){e.uniforms.add(new h.g("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},98925:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Draw,((r,i,o,n)=>r.setUniform2fv(e,t(i,o,n))))}}},19693:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec2",o.P.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},70582:(e,t,r)=>{r.d(t,{B:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Draw,((r,i,o,n)=>r.setUniform3fv(e,t(i,o,n))))}}},172:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec3",o.P.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},71250:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"vec4",o.P.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},21437:(e,t,r)=>{r.d(t,{p:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"float",o.P.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},15736:(e,t,r)=>{r.d(t,{_:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"int",o.P.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},52114:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},19850:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat3",o.P.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},8319:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"mat4",o.P.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},33680:(e,t,r)=>{r.d(t,{kG:()=>l});var i=r(20102),o=r(92604),n=r(11726);const a=o.Z.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){a.error("Trying to include shader module multiple times with different sets of options.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class l extends s{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new f,this.extensions=new m,this.constants=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s="vertex"===e?g:_,l=this.constants.generateSource().concat(o.constants.generateSource());return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${n.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${a.join("\n")}`}generateBind(e,t){const r=new Map;this.vertex.uniforms.entries.forEach((t=>{const i=t.bind[e];null!=i&&r.set(t.name,i)})),this.fragment.uniforms.entries.forEach((t=>{const i=t.bind[e];null!=i&&r.set(t.name,i)}));const i=Array.from(r.values()),o=i.length;return(e,r,n)=>{for(let a=0;a<o;++a)i[a](t,e,r,n)}}}class c{constructor(){this._entries=new Map}add(e){if(!Array.isArray(e))return this._add(e);for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.Z(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else a.error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class u extends s{constructor(){super(...arguments),this.uniforms=new c,this.code=new d,this.constants=new p}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,n.hu)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push("vertex"===e?`out ${r} ${i};`:`in ${r} ${i};`))),t}}class m{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?m.ALLOWLIST_VERTEX:m.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}m.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],m.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>p._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif\n\nout vec4 fragColor;",g="precision highp float;\nprecision highp sampler2D;"},16374:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},98069:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(79884),o=r(67498);class n extends i.x{constructor(e,t){super(e,"sampler2D",o.P.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},79884:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(67498);class o{constructor(e,t,r,o,n=null){this.name=e,this.type=t,this.arraySize=n,this.bind={[i.P.Pass]:null,[i.P.Draw]:null},null!=r&&null!=o&&(this.bind[r]=o)}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74709:(e,t,r)=>{r.d(t,{H:()=>o,K:()=>i});const i=class{};function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}var n;(n=o||(o={})).int=function(e){return Math.round(e).toString()},n.float=function(e){return e.toPrecision(8)}},67498:(e,t,r)=>{var i;r.d(t,{P:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},78869:(e,t,r)=>{r.d(t,{J:()=>i});class i{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},14589:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(70586),o=r(35371);class n{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=(0,i.M2)(this._program),this._pipeline=this._configuration=null}reload(e){(0,i.M2)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return o.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}initializeConfiguration(e,t){}}},51354:(e,t,r)=>{r.d(t,{m:()=>o,o:()=>n});var i=r(74709);class o extends i.K{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function n(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits??[0];let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);t._parameterBits=a;const l=a[s],c=(1<<n)-1<<l;a[s]+=n,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},17662:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(99001);class o{constructor(){this.id=(0,i.D)()}unload(){}}},4726:(e,t,r)=>{var i;r.d(t,{U:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(i||(i={}))},83475:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(35065);const o=new Map([[i.T.POSITION,0],[i.T.NORMAL,1],[i.T.NORMALCOMPRESSED,1],[i.T.UV0,2],[i.T.COLOR,3],[i.T.COLORFEATUREATTRIBUTE,3],[i.T.SIZE,4],[i.T.TANGENT,4],[i.T.AUXPOS1,5],[i.T.SYMBOLCOLOR,5],[i.T.AUXPOS2,6],[i.T.FEATUREATTRIBUTE,6],[i.T.INSTANCEFEATUREATTRIBUTE,6],[i.T.INSTANCECOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR,7],[i.T.OBJECTANDLAYERIDCOLOR_INSTANCED,7],[i.T.MODEL,8],[i.T.MODELNORMAL,12],[i.T.MODELORIGINHI,11],[i.T.MODELORIGINLO,15]])},60537:(e,t,r)=>{r.d(t,{F:()=>l});var i=r(70586),o=r(95330),n=r(74709),a=r(47026);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return a.Rw.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.RY)(this._texture),this._textureNormal=(0,i.RY)(this._textureNormal),this._textureEmissive=(0,i.RY)(this._textureEmissive),this._textureOcclusion=(0,i.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Rw.LOADED:a.Rw.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textureRepository.acquire(e);if((0,o.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends n.K{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},82791:(e,t,r)=>{r.d(t,{F5:()=>d,yD:()=>i});var i,o,n=r(65617),a=(r(74709),r(17662)),s=r(4726),l=r(83475),c=r(57790);class d extends a.c{constructor(e,t){super(),this.type=s.U.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=l.i,this._pp0=(0,n.f)(0,0,1),this._pp1=(0,n.f)(0,0,0),this._parameters=(0,c.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,c.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){null!=this.repository&&this.repository.materialChanged(this)}intersectDraped(e,t,r,i,o,n){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque"},59377:(e,t,r)=>{r.d(t,{$:()=>a});var i=r(44553),o=r(67498),n=r(49300);class a{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new i.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBind(o.P.Pass,this),this.bindDraw=t.generateBind(o.P.Draw,this),this._fragmentUniforms=(0,n.hZ)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t||null==t.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),null!=this._fragmentUniforms&&this._fragmentUniforms.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},93144:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},89917:(e,t,r)=>{r.d(t,{ow:()=>_});var i=r(83475),o=r(35065),n=r(35371),a=r(21968);new a.G(o.T.POSITION,3,n.g.FLOAT,0,12),new a.G(o.T.POSITION,3,n.g.FLOAT,0,20),new a.G(o.T.UV0,2,n.g.FLOAT,12,20),new a.G(o.T.POSITION,3,n.g.FLOAT,0,32),new a.G(o.T.NORMAL,3,n.g.FLOAT,12,32),new a.G(o.T.UV0,2,n.g.FLOAT,24,32),new a.G(o.T.POSITION,3,n.g.FLOAT,0,16),new a.G(o.T.COLOR,4,n.g.UNSIGNED_BYTE,12,16);const s=[new a.G(o.T.POSITION,2,n.g.FLOAT,0,8)],l=[new a.G(o.T.POSITION,2,n.g.FLOAT,0,16),new a.G(o.T.UV0,2,n.g.FLOAT,8,16)];var c=r(92604),d=r(70586),u=r(45762);const h=c.Z.getLogger("esri.views.webgl.VertexArrayObject");let f=class{constructor(e,t,r,i,o=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=o,this._glName=null,this._initialized=!1,e.instanceCounter.increment(n._g.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),null!=this._indexBuffer?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){const e=this._context?.capabilities?.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):h.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e]?.dispose(),delete this._buffers[e];this._indexBuffer=(0,d.M2)(this._indexBuffer)}this._context.instanceCounter.decrement(n._g.VertexArrayObject,this),this._context=(0,d.wN)(this._context)}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&h.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||h.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||h.error("Vertex buffer is uninitialized!");const o=t[r];o||h.error("Vertex element descriptor is empty!"),(0,u.XP)(this._context,this._locations,i,o)}null!=r&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||h.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||h.error("Vertex buffer is uninitialized!");const o=t[r];(0,u.UF)(this._context,this._locations,i,o)}null!=this._indexBuffer&&this._context.unbindBuffer(this._indexBuffer.bufferType)}};class m extends f{}var p=r(63587);function _(e,t=s,r=i.i,o=-1,a=1){let c=null;return c=t===l?new Float32Array([o,o,0,0,a,o,1,0,o,a,0,1,a,a,1,1]):new Float32Array([o,o,a,o,o,a,a,a]),new m(e,r,{geometry:t},{geometry:p.f.createVertex(e,n.l1.STATIC_DRAW,c)})}r(75656)},57790:(e,t,r)=>{r.d(t,{FZ:()=>R,Uf:()=>A,Bw:()=>m,LO:()=>S,Hx:()=>E});var i=r(67676),o=r(22021),n=r(17896),a=r(65617),s=r(60437),l=r(4726);function c(e,t,r,i){return function(e,t){return Math.max((0,o.t7)(e*t.scale,e,t.factor),function(e,t){return 0===e?t.minPixelSize:t.minPixelSize*(1+2*t.paddingPixels/e)}(e,t))}(e,function(e,t,r){const i=r.parameters,o=r.paddingPixelsOverride;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d.minPixelSize=i.minPixelSize,d.paddingPixels=o,d}(t,r,i))}r(64822),(0,o.Vl)(10),(0,o.Vl)(12),(0,o.Vl)(70),(0,o.Vl)(40);const d={scale:0,factor:0,minPixelSize:0,paddingPixels:0};var u=r(11726),h=r(35065);const f=(0,s.Ue)();function m(e,t,r,i,o,n){if(e.visible)if(e.boundingInfo){(0,u.hu)(e.type===l.U.Mesh);const a=t.tolerance;_(e.boundingInfo,r,i,a,o,n)}else{const t=e.indices.get(h.T.POSITION),a=e.vertexAttributes.get(h.T.POSITION);v(r,i,0,t.length/3,t,a,void 0,o,n)}}const p=(0,a.c)();function _(e,t,r,i,o,a){if(null==e)return;const l=function(e,t,r){return(0,n.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,p);if((0,s.op)(f,e.bbMin),(0,s.Tn)(f,e.bbMax),null!=o&&o.applyToAabb(f),function(e,t,r,i){return function(e,t,r,i,o){const n=(e[0]-i-t[0])*r[0],a=(e[3]+i-t[0])*r[0];let s=Math.min(n,a),l=Math.max(n,a);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(f,t,l,i)){const{primitiveIndices:n,indices:s,position:l}=e,c=n?n.length:s.length/3;if(c>y){const n=e.getChildren();if(void 0!==n){for(const e of n)_(e,t,r,i,o,a);return}}v(t,r,0,c,s,l,n,o,a)}}const g=(0,a.c)();function v(e,t,r,i,o,n,a,s,l){if(a)return function(e,t,r,i,o,n,a,s,l){const{data:c,stride:d}=n,u=e[0],h=e[1],f=e[2],m=t[0]-u,p=t[1]-h,_=t[2]-f;for(let e=r;e<i;++e){const t=a[e];let r=3*t,i=d*o[r++],n=c[i++],v=c[i++],T=c[i];i=d*o[r++];let x=c[i++],E=c[i++],A=c[i];i=d*o[r];let S=c[i++],w=c[i++],R=c[i];null!=s&&([n,v,T]=s.applyToVertex(n,v,T,e),[x,E,A]=s.applyToVertex(x,E,A,e),[S,w,R]=s.applyToVertex(S,w,R,e));const y=x-n,C=E-v,O=A-T,M=S-n,P=w-v,N=R-T,I=p*N-P*_,L=_*M-N*m,D=m*P-M*p,H=y*I+C*L+O*D;if(Math.abs(H)<=Number.EPSILON)continue;const F=u-n,B=h-v,U=f-T,V=F*I+B*L+U*D;if(H>0){if(V<0||V>H)continue}else if(V>0||V<H)continue;const z=B*O-C*U,G=U*y-O*F,W=F*C-y*B,k=m*z+p*G+_*W;if(H>0){if(k<0||V+k>H)continue}else if(k>0||V+k<H)continue;const $=(M*z+P*G+N*W)/H;$>=0&&l($,b(y,C,O,M,P,N,g),t,!1)}}(e,t,r,i,o,n,a,s,l);const{data:c,stride:d}=n,u=e[0],h=e[1],f=e[2],m=t[0]-u,p=t[1]-h,_=t[2]-f;for(let e=r,t=3*r;e<i;++e){let r=d*o[t++],i=c[r++],n=c[r++],a=c[r];r=d*o[t++];let v=c[r++],T=c[r++],x=c[r];r=d*o[t++];let E=c[r++],A=c[r++],S=c[r];null!=s&&([i,n,a]=s.applyToVertex(i,n,a,e),[v,T,x]=s.applyToVertex(v,T,x,e),[E,A,S]=s.applyToVertex(E,A,S,e));const w=v-i,R=T-n,y=x-a,C=E-i,O=A-n,M=S-a,P=p*M-O*_,N=_*C-M*m,I=m*O-C*p,L=w*P+R*N+y*I;if(Math.abs(L)<=Number.EPSILON)continue;const D=u-i,H=h-n,F=f-a,B=D*P+H*N+F*I;if(L>0){if(B<0||B>L)continue}else if(B>0||B<L)continue;const U=H*y-R*F,V=F*w-y*D,z=D*R-w*H,G=m*U+p*V+_*z;if(L>0){if(G<0||B+G>L)continue}else if(G>0||B+G<L)continue;const W=(C*U+O*V+M*z)/L;W>=0&&l(W,b(w,R,y,C,O,M,g),e,!1)}}const T=(0,a.c)(),x=(0,a.c)();function b(e,t,r,i,o,a,s){return(0,n.s)(T,e,t,r),(0,n.s)(x,i,o,a),(0,n.f)(s,T,x),(0,n.n)(s,s),s}function E(e,t,r,i,n){let a=(r.screenLength||0)*e.pixelRatio;null!=n&&(a=c(a,i,t,n));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.uZ)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function A(e,t){const r=t?A(t):{};for(const t in e){let i=e[t];i&&i.forEach&&(i=w(i)),null==i&&t in r||(r[t]=i)}return r}function S(e,t){let r=!1;for(const o in t){const n=t[o];void 0!==n&&(Array.isArray(n)?null===e[o]?(e[o]=n.slice(),r=!0):(0,i.Vx)(e[o],n)&&(r=!0):e[o]!==n&&(r=!0,e[o]=n))}return r}function w(e){const t=[];return e.forEach((e=>t.push(e))),t}const R={multiply:1,ignore:2,replace:3,tint:4},y=1e3},63587:(e,t,r)=>{r.d(t,{f:()=>u});var i=r(67676),o=r(92604),n=r(70586),a=r(1533),s=r(49300),l=r(54738),c=r(35371);const d=o.Z.getLogger("esri.views.webgl.BufferObject");class u{static createIndex(e,t,r){return new u(e,c.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new u(e,c.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==l.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new u(e,c.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=c.l1.STREAM_READ,r){if(e.type!==l.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new u(e,c.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=c.l1.STREAM_DRAW,r){if(e.type!==l.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new u(e,c.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(c._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,s.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER?this._indexType===c.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===c.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(c._g.BufferObject,this),this._context=(0,n.wN)(this._context)):this._glName&&d.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&d.error("Buffer size needs to be positive!"),this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case c.g.UNSIGNED_SHORT:e*=2;break;case c.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===c.w0.ELEMENT_ARRAY_BUFFER&&((0,a.Uc)(e)&&(t/=2,this._indexType=c.g.UNSIGNED_SHORT),(0,a.ZY)(e)&&(t/=4,this._indexType=c.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,s.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteSize)&&d.error("offset is out of range!"),r>=i&&d.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteSize&&d.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===l.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,s.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,o){if(this._context.type!==l.zO.WEBGL2)return void d.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||o<0)return void d.error("Problem getting subdata: offset and length were less than zero!");const n=function(e){return(0,i.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(n*((r??0)+(o??0))>e.byteLength)return void d.error("Problem getting subdata: offset and length exceeded destination size!");t+n*(o??0)>this.byteSize&&d.warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;this._context.bindBuffer(this,c.w0.COPY_READ_BUFFER),a.getBufferSubData(c.w0.COPY_READ_BUFFER,t,e,r,o),this._context.unbindBuffer(c.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===l.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):d.error("Get buffer subdata is supported in WebGL2 only!")}}},33696:(e,t,r)=>{r.d(t,{X:()=>h});var i=r(92604),o=r(63587),n=r(49300),a=r(54738),s=r(35371),l=r(70586);class c{constructor(e,t){this._context=e,this._desc=t,this.type="renderbuffer",this._context.instanceCounter.increment(s._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:l}=t;if(l){if(this._context.type!==a.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._desc}get samples(){const e=this._desc.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(s._g.Renderbuffer,this),this._context=(0,l.wN)(this._context))}}var d=r(75656),u=r(45762);class h{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._depthStencilTexture=null,this._initialized=!1,this._desc={...t},e.instanceCounter.increment(s._g.FramebufferObject,this),null!=r){Array.isArray(r)||(r=[r]);for(let e=0;e<r.length;++e){const t=r[e],i=s.VY.COLOR_ATTACHMENT0+e;let o;p(t)?(f(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new d.x(this._context,o))),_(o,this._desc)):(m(t)?(o=t.descriptor,this._colorAttachments.set(i,t)):(o=t,this._colorAttachments.set(i,new c(this._context,o))),g(o,this._desc)),this._validateColorAttachmentPoint(i)}}if(null!=i){let e,t;if(p(i))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),f(i)?(t=i.descriptor,this._depthStencilTexture=i):(t=i,this._depthStencilTexture=new d.x(this._context,t)),_(t,this._desc);else{m(i)?(t=i.descriptor,e=i):(t=i,e=new c(this._context,t));const r=this._desc.depthStencilTarget??s.OU.DEPTH_STENCIL_RENDER_BUFFER;r===s.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=e:r===s.OU.DEPTH_RENDER_BUFFER||r===s.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=e:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),this._desc.depthStencilTarget=r,g(t,this._desc)}}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(s._g.FramebufferObject,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get(s.VY.COLOR_ATTACHMENT0);return e&&f(e)?e:null}get colorAttachment(){return this._colorAttachments.get(s.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width??0}get height(){return this._desc.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+(0,u.un)(r)),0)+(0,u.un)(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&f(t)?t:null}attachColorTexture(e,t=s.VY.COLOR_ATTACHMENT0){e&&(this._validateColorAttachmentPoint(t),_(e.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e))}detachColorTexture(e=s.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(f(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),r}}setColorTextureTarget(e,t=s.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);f(r)&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==s.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==s.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),_(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==s.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=s.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,s.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,s.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(t.internalFormat!==s.Tg.DEPTH_STENCIL&&t.internalFormat!==s.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),g(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===s.Tg.DEPTH_STENCIL?s.OU.DEPTH_STENCIL_RENDER_BUFFER:s.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(s.qi.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(s.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this._colorAttachments.forEach(((e,t)=>this._detachColorAttachment(t))),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const l=this._desc,c=a.descriptor;a.descriptor.target!==s.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==l?.width||null==l?.height||null==c?.width||null==c?.height||e+r>l.width||t+i>l.height||o+r>c.width||n+i>c.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const u=this._context,h=u.bindTexture(a,d.x.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(d.x.TEXTURE_UNIT_FOR_UPDATES),u.bindFramebuffer(this),u.gl.copyTexSubImage2D(s.No.TEXTURE_2D,0,o,n,e,t,r,i),u.bindTexture(h,d.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,l,c,d){if(this._context.type!==a.zO.WEBGL2)return(0,n.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,l,c,d);const u=this._context.gl,h=o.f.createPixelPack(this._context,s.l1.STREAM_READ,d.byteLength);this._context.bindBuffer(h),this._context.bindFramebuffer(this),u.readPixels(e,t,r,i,l,c,0),this._context.unbindBuffer(s.w0.PIXEL_PACK_BUFFER),await h.getSubDataAsync(d),h.dispose()}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(r.width=e,r.height=t,!this._initialized)return this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=s.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=this._context,i=t.createFramebuffer(),o=this._desc,a=o.colorTarget??s.Lm.RENDER_BUFFER,l=o.width??1,u=o.height??1;if(t.bindFramebuffer(e,i),0===this._colorAttachments.size)if(a===s.Lm.TEXTURE||a===s.Lm.CUBEMAP)this._colorAttachments.set(s.VY.COLOR_ATTACHMENT0,function(e,t,r){return new d.x(e,{target:r,pixelFormat:s.VI.RGBA,dataType:s.Br.UNSIGNED_BYTE,samplingMode:s.cw.NEAREST,wrapMode:s.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(r,o,this.descriptor.colorTarget===s.Lm.CUBEMAP?s.No.TEXTURE_CUBE_MAP:s.No.TEXTURE_2D));else{const e=new c(r,{internalFormat:s.lP.RGBA4,width:l,height:u});this._colorAttachments.set(s.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((r,i)=>{r&&(f(r)?this._framebufferTexture2D(r.glName,i,v(r),e):t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,r.glName))}));const h=o.depthStencilTarget??s.OU.NONE;switch(h){case s.OU.DEPTH_RENDER_BUFFER:case s.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new c(r,{internalFormat:o.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?s.Tg.DEPTH_COMPONENT16:s.Tg.DEPTH_STENCIL,width:l,height:u}));const i=h===s.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(e,i,t.RENDERBUFFER,this._depthAttachment.glName);break}case s.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new c(r,{internalFormat:s.Tg.STENCIL_INDEX8,width:l,height:u})),t.framebufferRenderbuffer(e,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,this._stencilAttachment.glName);break;case s.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){r.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:s.No.TEXTURE_2D,pixelFormat:s.VI.DEPTH_STENCIL,dataType:s.Br.UNSIGNED_INT_24_8,samplingMode:s.cw.NEAREST,wrapMode:s.e8.CLAMP_TO_EDGE,width:l,height:u};this._depthStencilTexture=new d.x(r,e)}this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,v(this._depthStencilTexture),e)}(0,n.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(e,t=s.VY.COLOR_ATTACHMENT0,r=s.No.TEXTURE_2D,i=s.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_detachColorAttachment(e){(0,n.hZ)()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const t=this._context.gl,r=this._colorAttachments.get(e);return f(r)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)):this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(s.qi.FRAMEBUFFER,e,t.RENDERBUFFER,null)),this._colorAttachments.delete(e),r}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{this._detachColorAttachment(t),e.dispose()})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===s.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(s.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(s.qi.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(e){if(-1===h._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;h._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else h._MAX_COLOR_ATTACHMENTS=1}const t=e-s.VY.COLOR_ATTACHMENT0;t+1>h._MAX_COLOR_ATTACHMENTS&&i.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${h._MAX_COLOR_ATTACHMENTS} color attachments`)}}function f(e){return null!=e&&"type"in e&&"texture"===e.type}function m(e){return null!=e&&"type"in e&&"renderbuffer"===e.type}function p(e){return f(e)||null!=e&&"pixelFormat"in e}function _(e,t){e.target!==s.No.TEXTURE_2D&&e.target!==s.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function g(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}function v(e){return e.descriptor.target===s.No.TEXTURE_CUBE_MAP?s.No.TEXTURE_CUBE_MAP_POSITIVE_X:s.No.TEXTURE_2D}h._MAX_COLOR_ATTACHMENTS=-1},75656:(e,t,r)=>{r.d(t,{x:()=>l}),r(80442);var i=r(22021),o=r(49300),n=r(54738),a=r(35371);const s={target:a.No.TEXTURE_2D,samplingMode:a.cw.LINEAR,wrapMode:a.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1};let l=class{constructor(e,t,r=null){this._context=e,this.type="texture",this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(a._g.Texture,this),this._descriptor={...s,...t};for(const e in s)void 0===this._descriptor[e]&&(this._descriptor[e]=s[e]);if(e.type!==n.zO.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),u(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===a.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(a._g.Texture,this))}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===a.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=a.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=a.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._context||!this._context.gl)return;const r=this._context.gl;this._glName||(this._glName=r.createTexture()),void 0===e&&(e=null);const i=this._descriptor,n=t??i.target,s=u(n);null===e&&(i.width=i.width||4,i.height=i.height||4,s&&(i.depth=i.depth??1));const f=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),l._validateTexture(this._context,i),this._configurePixelStorage(),(0,o.zu)(r);const m=i.pixelFormat;let p=i.internalFormat??this._deriveInternalFormat(m,i.dataType);if(d(e)){let t=e.width,a=e.height;const l=1;e instanceof HTMLVideoElement&&(t=e.videoWidth,a=e.videoHeight),i.width&&i.height,s&&i.depth,i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,p,i.hasMipmap,t,a,l),this._texImage(n,0,p,t,a,l,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap(),void 0===i.width&&(i.width=t),void 0===i.height&&(i.height=a),s&&void 0===i.depth&&(i.depth=l)}else{const{width:t,height:l,depth:d}=i;if(null==t||null==l)throw new Error("Width and height must be specified!");if(s&&null==d)throw new Error("Depth must be specified!");if(i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,p,i.hasMipmap,t,l,d),r.DEPTH24_STENCIL8&&p===r.DEPTH_STENCIL&&(p=r.DEPTH24_STENCIL8),c(e)){const o=e.levels,s=h(n,t,l,d),c=Math.min(s-1,o.length-1);null!=this._context.gl2?r.texParameteri(i.target,this._context.gl2.TEXTURE_MAX_LEVEL,c):i.hasMipmap=i.hasMipmap&&s===o.length;const u=p;if(!function(e){return e in a.q_}(u))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const a=o[Math.min(e,o.length-1)];this._compressedTexImage(n,e,u,t,r,i,a)}),c)}else null!=e?(this._texImage(n,0,p,t,l,d,e),(0,o.zu)(r),i.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel(((e,t,i,a)=>{this._texImage(n,e,p,t,i,a,null),(0,o.zu)(r)}))}l._applySamplingMode(r,this._descriptor),l._applyWrapMode(r,this._descriptor),l._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,o.zu)(r),this._context.bindTexture(f,l.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,i,o,n,a=0){n||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const s=this._context.gl,u=this._descriptor,{pixelFormat:h,dataType:f,target:m,isImmutable:p}=u,_=u.internalFormat??this._deriveInternalFormat(h,f);if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const g=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES,!0);if((t<0||r<0||i>u.width||o>u.height||t+i>u.width||r+o>u.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),a){if(null==this._context.gl2)return void console.error("Webgl2 must be enabled to use dataRowOffset!");s.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,a)}if(d(n)?null!=this._context.gl2?this._context.gl2.texSubImage2D(m,e,t,r,i,o,h,f,n):s.texSubImage2D(m,e,t,r,h,f,n):c(n)?s.compressedTexSubImage2D(m,e,t,r,i,o,_,n.levels[e]):s.texSubImage2D(m,e,t,r,i,o,h,f,n),a){if(null==this._context.gl2)return void console.error("Webgl2 must be enabled to use dataRowOffset!");s.pixelStorei(this._context.gl2.UNPACK_SKIP_ROWS,0)}this._context.bindTexture(g,l.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,i,o,n,a,s){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const d=this._context.gl2;if(null==d)throw new Error("3D textures are not supported in WebGL1");const h=this._descriptor,{pixelFormat:f,dataType:m,isImmutable:p,target:_}=h,g=h.internalFormat??this._deriveInternalFormat(f,m);if(p&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");u(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const v=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||i<0||o>h.width||n>h.height||a>h.depth||t+o>h.width||r+n>h.height||i+a>h.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),c(s))s=s.levels[e],d.compressedTexSubImage3D(_,e,t,r,i,o,n,a,g,s);else{const l=s;d.texSubImage3D(_,e,t,r,i,o,n,a,f,m,l)}this._context.bindTexture(v,l.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,l._validateTexture(this._context,e)}e.samplingMode===a.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=a.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===a.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=a.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,l.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(l.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,l.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,l._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(l._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(l._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===n.zO.WEBGL1)return e;switch(t){case a.Br.FLOAT:switch(e){case a.VI.RGBA:return a.lP.RGBA32F;case a.VI.RGB:return a.lP.RGB32F;default:throw new Error("Unable to derive format")}case a.Br.UNSIGNED_BYTE:switch(e){case a.VI.RGBA:return a.lP.RGBA8;case a.VI.RGB:return a.lP.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,i,o,n){const s=this._context.gl2;if(null==s)throw new Error("Immutable textures are not supported in WebGL1");if(!function(e){return e in a.lP}(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?h(e,i,o,n):1;if(u(e)){if(null==n)throw new Error("Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,i,o,n)}else s.texStorage2D(e,l,t,i,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,i,o,a,s){const l=this._context.gl;let c=null;const h=this._context.type===n.zO.WEBGL2,f=u(e),{isImmutable:m,pixelFormat:p,dataType:_}=this._descriptor;if(h&&(c=l),h||!d(s))if(m){if(null!=s){const r=s;if(f){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,i,o,a,p,_,r)}else l.texSubImage2D(e,t,0,0,i,o,p,_,r)}}else{const n=s;if(f){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,i,o,a,0,p,_,n)}else l.texImage2D(e,t,r,i,o,0,p,_,n)}else l.texImage2D(e,0,r,p,_,s)}_compressedTexImage(e,t,r,i,o,a,s){const l=this._context.gl;let c=null;const d=u(e),h=this._descriptor.isImmutable;if(d){if(this._context.type!==n.zO.WEBGL2)throw new Error("3D textures are not supported in WebGL1");c=l}if(h){if(null!=s)if(d){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,i,o,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,i,o,r,s)}else if(d){if(null==a)throw new Error("Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,i,o,a,0,s)}else l.compressedTexImage2D(e,t,r,i,o,0,s)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:i,depth:o,hasMipmap:n,target:s}=this._descriptor;const l=s===a.No.TEXTURE_3D;if(null==r||null==i||l&&null==o)throw new Error("Missing texture dimensions for mipmap calculation");for(let a=0;e(a,r,i,o),n&&(1!==r||1!==i||l&&1!==o)&&!(a>=t);++a)r=Math.max(1,r>>1),i=Math.max(1,i>>1),l&&(o=Math.max(1,o>>1))}static _validateTexture(e,t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const r=e.type===n.zO.WEBGL2,o=null!=t.width&&(0,i.wt)(t.width)&&null!=t.height&&(0,i.wt)(t.height);r||!t.isImmutable&&!u(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),r||o||("number"==typeof t.wrapMode?t.wrapMode!==a.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===a.e8.CLAMP_TO_EDGE&&t.wrapMode.t===a.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let r=t.samplingMode,i=t.samplingMode;r===a.cw.LINEAR_MIPMAP_NEAREST||r===a.cw.LINEAR_MIPMAP_LINEAR?(r=a.cw.LINEAR,t.hasMipmap||(i=a.cw.LINEAR)):r!==a.cw.NEAREST_MIPMAP_NEAREST&&r!==a.cw.NEAREST_MIPMAP_LINEAR||(r=a.cw.NEAREST,t.hasMipmap||(i=a.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};function c(e){return null!=e&&"type"in e&&"compressed"===e.type}function d(e){return null!=e&&!c(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function u(e){return e===a.No.TEXTURE_3D||e===a.No.TEXTURE_2D_ARRAY}function h(e,t,r,i=1){let o=Math.max(t,r);return e===a.No.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}l.TEXTURE_UNIT_FOR_UPDATES=0},45762:(e,t,r)=>{r.d(t,{RG:()=>s,UF:()=>a,XP:()=>n,_V:()=>o,un:()=>l}),r(80442);var i=r(35371);function o(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}function n(e,t,r,i,o=0){const n=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=o*e.stride;if(e.count<=4)n.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),n.enableVertexAttribArray(r),e.divisor>0&&a&&a.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)n.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)n.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function a(e,t,r,o){const n=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of o){const r=t.get(e.name);if(e.count<=4)n.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)n.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&a&&a.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer(i.w0.ARRAY_BUFFER)}function s(e){switch(e){case i.VI.ALPHA:case i.VI.LUMINANCE:case i.VI.RED:case i.VI.RED_INTEGER:case i.lP.R8:case i.lP.R8I:case i.lP.R8UI:case i.lP.R8_SNORM:case i.Tg.STENCIL_INDEX8:return 1;case i.VI.LUMINANCE_ALPHA:case i.VI.RG:case i.VI.RG_INTEGER:case i.lP.RGBA4:case i.lP.R16F:case i.lP.R16I:case i.lP.R16UI:case i.lP.RG8:case i.lP.RG8I:case i.lP.RG8UI:case i.lP.RG8_SNORM:case i.lP.RGB565:case i.lP.RGB5_A1:case i.Tg.DEPTH_COMPONENT16:return 2;case i.VI.DEPTH_COMPONENT:case i.VI.RGB:case i.VI.RGB_INTEGER:case i.lP.RGB8:case i.lP.RGB8I:case i.lP.RGB8UI:case i.lP.RGB8_SNORM:case i.lP.SRGB8:case i.Tg.DEPTH_COMPONENT24:return 3;case i.VI.DEPTH_STENCIL:case i.VI.RGBA:case i.VI.RGBA_INTEGER:case i.lP.RGBA8:case i.lP.R32F:case i.lP.R11F_G11F_B10F:case i.lP.RG16F:case i.lP.R32I:case i.lP.R32UI:case i.lP.RG16I:case i.lP.RG16UI:case i.lP.RGBA8I:case i.lP.RGBA8UI:case i.lP.RGBA8_SNORM:case i.lP.SRGB8_ALPHA8:case i.lP.RGB9_E5:case i.lP.RGB10_A2UI:case i.lP.RGB10_A2:case i.Tg.DEPTH_STENCIL:case i.Tg.DEPTH_COMPONENT32F:case i.Tg.DEPTH24_STENCIL8:return 4;case i.Tg.DEPTH32F_STENCIL8:return 5;case i.lP.RGB16F:case i.lP.RGB16I:case i.lP.RGB16UI:return 6;case i.lP.RG32F:case i.lP.RG32I:case i.lP.RG32UI:case i.lP.RGBA16F:case i.lP.RGBA16I:case i.lP.RGBA16UI:return 8;case i.lP.RGB32F:case i.lP.RGB32I:case i.lP.RGB32UI:return 12;case i.lP.RGBA32F:case i.lP.RGBA32I:case i.lP.RGBA32UI:return 16;case i.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.q_.COMPRESSED_R11_EAC:case i.q_.COMPRESSED_SIGNED_R11_EAC:case i.q_.COMPRESSED_RGB8_ETC2:case i.q_.COMPRESSED_SRGB8_ETC2:case i.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.q_.COMPRESSED_RG11_EAC:case i.q_.COMPRESSED_SIGNED_RG11_EAC:case i.q_.COMPRESSED_RGBA8_ETC2_EAC:case i.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function l(e){if(null==e)return 0;if("descriptor"in e)return e.glName?l(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return s(t)*i*r}},49300:(e,t,r)=>{r.d(t,{hZ:()=>s,zu:()=>l});var i=r(20102),o=r(80442);const n=r(92604).Z.getLogger("esri.views.webgl.checkWebGLError"),a=!!(0,o.Z)("enable-feature:webgl-debug");function s(){return a}function l(e){if(s()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),o=(new Error).stack;n.error(new i.Z("webgl-error","WebGL error occured",{message:r,stack:o}))}}}},54738:(e,t,r)=>{r.d(t,{Sh:()=>n,kr:()=>a,zO:()=>i});var i,o=r(80442);function n(e){const t=(0,o.Z)("esri-force-webgl");if(t===i.WEBGL1||t===i.WEBGL2)return[t];switch(e){case"2d":return(0,o.Z)("mac")&&(0,o.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1];case"3d":return[i.WEBGL2,i.WEBGL1]}}function a(e,t,r={}){const o=t===i.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let n=null;for(const t of o){try{n=e.getContext(t,r)}catch(e){}if(n)break}return n}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(i||(i={}))},9820:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],t[i]=n[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)n[0]=e[i],n[1]=e[i]-n[0],t[i]=n[1];return t}r.d(t,{GB:()=>o,U8:()=>i});const n=new Float32Array(2)},27097:(e,t,r)=>{r.d(t,{BK:()=>u,LZ:()=>d,if:()=>n,sm:()=>x,wK:()=>a,zp:()=>c});var i=r(47026),o=r(35371);function n(e,t,r=o.db.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function a(e,t,r,i,n=o.db.ADD,a=o.db.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.LR.BACK,mode:o.Wf.CCW},l={face:o.LR.FRONT,mode:o.Wf.CCW},c=e=>e===i.Vr.Back?s:e===i.Vr.Front?l:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return A.intern(e)}function f(e){return w.intern(e)}function m(e){return y.intern(e)}function p(e){return O.intern(e)}function _(e){return P.intern(e)}function g(e){return I.intern(e)}function v(e){return D.intern(e)}function T(e){return F.intern(e)}function x(e){return U.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function E(e){return"["+e.join(",")+"]"}const A=new b(S,(e=>({__tag:"Blending",...e})));function S(e){return e?E([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const w=new b(R,(e=>({__tag:"Culling",...e})));function R(e){return e?E([e.face,e.mode]):null}const y=new b(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?E([e.factor,e.units]):null}const O=new b(M,(e=>({__tag:"DepthTest",...e})));function M(e){return e?E([e.func]):null}const P=new b(N,(e=>({__tag:"StencilTest",...e})));function N(e){return e?E([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const I=new b(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?E([e.zNear,e.zFar]):null}const D=new b(H,(e=>({__tag:"ColorWrite",...e})));function H(e){return e?E([e.r,e.g,e.b,e.a]):null}const F=new b(B,(e=>({__tag:"StencilWrite",...e})));function B(e){return e?E([e.mask]):null}const U=new b((function(e){return e?E([S(e.blending),R(e.culling),C(e.polygonOffset),M(e.depthTest),N(e.stencilTest),L(e.depthWrite),H(e.colorWrite),B(e.stencilWrite)]):null}),(e=>({blending:h(e.blending),culling:f(e.culling),polygonOffset:m(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:_(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:v(e.colorWrite),stencilWrite:T(e.stencilWrite)})))}}]);
|