@arcgis/core 4.34.0-next.30 → 4.34.0-next.31

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.
Files changed (81) hide show
  1. package/WebScene.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0ca8d6516323fc28dd58.js +1 -0
  4. package/assets/esri/core/workers/chunks/{031c4b4bf78079d0002d.js → 36024406932b0a44a74a.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{4e267a813e8b10d10b3b.js → 37bfc1a771792b6697fd.js} +121 -140
  6. package/assets/esri/core/workers/chunks/42c5d957813080143e5a.js +1 -0
  7. package/assets/esri/core/workers/chunks/6269c4bbf0f224a954e9.js +1 -0
  8. package/assets/esri/core/workers/chunks/871da12fb3029177df6f.js +1 -0
  9. package/assets/esri/core/workers/chunks/8abcf9d3343dd8d45103.js +1 -0
  10. package/assets/esri/core/workers/chunks/ac88e0aabbd6c1f1ec98.js +1 -0
  11. package/assets/esri/core/workers/chunks/{e7209654ecdfde926272.js → eec36628e638e244f452.js} +1 -1
  12. package/chunks/ComponentShader.glsl.js +34 -33
  13. package/chunks/DefaultMaterial.glsl.js +25 -25
  14. package/chunks/Path.glsl.js +20 -24
  15. package/chunks/RealisticTree.glsl.js +18 -20
  16. package/chunks/Terrain.glsl.js +32 -33
  17. package/chunks/WaterSurface.glsl.js +16 -16
  18. package/config.js +1 -1
  19. package/core/workers/registry.js +1 -1
  20. package/interfaces.d.ts +22 -25
  21. package/kernel.js +1 -1
  22. package/layers/MapImageLayer.js +1 -1
  23. package/package.json +1 -1
  24. package/portal/schemas/definitions.js +1 -1
  25. package/support/revision.js +1 -1
  26. package/views/2d/layers/support/MediaLayerInteraction.js +1 -1
  27. package/views/3d/environment/Precipitation.js +1 -1
  28. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  29. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  30. package/views/3d/layers/FlowSubView3D.js +1 -1
  31. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  32. package/views/3d/layers/MediaLayerView3D.js +1 -1
  33. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  34. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  35. package/views/3d/support/engineContent/line.js +1 -1
  36. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  37. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  38. package/views/3d/support/flow/FlowWorker.js +5 -0
  39. package/views/3d/support/flow/FlowWorkerHandle.js +5 -0
  40. package/views/3d/support/flow/geometryUtils.js +1 -1
  41. package/views/3d/support/flow/loadUtils.js +1 -1
  42. package/views/3d/support/hitTest.js +1 -1
  43. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  44. package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
  45. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +3 -5
  46. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToReadShadowMap.glsl.js +7 -0
  47. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +11 -0
  48. package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +1 -1
  49. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
  50. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -2
  51. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  52. package/views/3d/webgl-engine/lib/TextureUpdater.js +1 -1
  53. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  54. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  55. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  56. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  57. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  58. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  59. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  60. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  61. package/views/SceneView.js +1 -1
  62. package/views/View.js +1 -1
  63. package/views/draw/support/Box.js +1 -1
  64. package/views/draw/support/Reshape.js +1 -1
  65. package/views/webgl/RenderingContext.js +1 -1
  66. package/views/webgl/Util.js +1 -1
  67. package/views/webgl/checkWebGLError.js +1 -1
  68. package/views/webgl/testFloatBufferBlend.js +1 -1
  69. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  70. package/widgets/Editor/workflowUtils.js +1 -1
  71. package/widgets/ElevationProfile/ElevationProfileInteraction.js +1 -1
  72. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  73. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  74. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  75. package/widgets/Sketch/SketchViewModel.js +1 -1
  76. package/widgets/UtilityNetworkTrace.js +1 -1
  77. package/assets/esri/core/workers/chunks/278df50f2c557be81808.js +0 -1
  78. package/assets/esri/core/workers/chunks/2931fd6bb123200622c2.js +0 -1
  79. package/assets/esri/core/workers/chunks/4cf2894bda9e38af8790.js +0 -1
  80. package/assets/esri/core/workers/chunks/6a0777cf1270fcab4574.js +0 -1
  81. package/assets/esri/core/workers/chunks/9723512bc9db4a301c72.js +0 -1
@@ -1,18 +1,18 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7541],{1843:(e,t,r)=>{r.d(t,{BP:()=>l,l5:()=>d});var i=r(20498),n=r(13030),o=r(90239),a=r(620);class s{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new s(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get cachedMemory(){return this.byteLength}dispose(){}}class c{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:m(e[1].constructor)})))}freeze(){return this}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new s(this,e)}createView(e){return new s(this,e)}clone(){const e=new c;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function l(){return new c}class d{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:h(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const u=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function h(e){return`${e.ElementType}_${e.ElementCount}`}function m(e){return p.get(e)}const p=new Map;u.forEach(e=>p.set(h(e),e))},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(87317),c=r(91829),l=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.g)(h,this.ray.direction,this.distance),(0,o.l)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,o.g)(h,this.ray.direction,this.distance),(0,o.f)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,o.c)(m,this.normal),m[3]=0,(0,s.t)(m,m,this.transformation),(0,o.c)(e,m),(0,o.n)(e,e)}constructor(e){this.intersector=0,this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,l.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=0,(0,l.C)(e,this._ray)}set(e,t,r,s,c,l,d){this.intersector=e,this.distance=r,(0,o.c)(this.normal,s??a.Cb),(0,i.C)(this.transformation,c??n.zK),this.target=t,this.drapedLayerOrder=l,this.renderPriority=d}copy(e){(0,l.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.c)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),m=(0,c.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>n});var i=r(31821);function n(e,t){t.snowCover&&(e.code.add(i.H`float getSnow(vec3 normal, vec3 normalGround) {
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7541],{1843:(e,t,r)=>{r.d(t,{BP:()=>l,l5:()=>d});var i=r(20498),n=r(13030),o=r(90239),a=r(620);class s{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new s(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get cachedMemory(){return this.byteLength}dispose(){}}class c{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:p(e[1].constructor)})))}freeze(){return this}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new s(this,e)}createView(e){return new s(this,e)}clone(){const e=new c;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function l(){return new c}class d{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:h(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const u=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function h(e){return`${e.ElementType}_${e.ElementCount}`}function p(e){return m.get(e)}const m=new Map;u.forEach(e=>m.set(h(e),e))},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(87317),c=r(91829),l=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.g)(h,this.ray.direction,this.distance),(0,o.l)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,o.g)(h,this.ray.direction,this.distance),(0,o.f)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,o.c)(p,this.normal),p[3]=0,(0,s.t)(p,p,this.transformation),(0,o.c)(e,p),(0,o.n)(e,e)}constructor(e){this.intersector=0,this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,l.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=0,(0,l.C)(e,this._ray)}set(e,t,r,s,c,l,d){this.intersector=e,this.distance=r,(0,o.c)(this.normal,s??a.Cb),(0,i.C)(this.transformation,c??n.zK),this.target=t,this.drapedLayerOrder=l,this.renderPriority=d}copy(e){(0,l.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.c)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),p=(0,c.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>n});var i=r(31821);function n(e,t){t.snowCover&&(e.code.add(i.H`float getSnow(vec3 normal, vec3 normalGround) {
2
2
  return smoothstep(0.5, 0.55, dot(normal, normalGround));
3
3
  }`),e.code.add(i.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
4
4
  return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
5
5
  }
6
6
  vec4 snowCoverForEmissions(vec4 emission, float snow) {
7
7
  return mix(emission, vec4(0.0), snow);
8
- }`))}},11725:(e,t,r)=>{r.d(t,{i:()=>c});var i=r(24326),n=r(39341),o=r(35256),a=r(43616),s=r(65786);class c{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this.vertexAttributeLocations=n.D,this._renderPriority=0,this._parameters=new t,(0,a.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,a.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new o.E){return r.output=e,r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},11868:(e,t,r)=>{r.d(t,{Wz:()=>o,oe:()=>n});var i=r(34275);function n(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function o(e){return(Array.isArray(e)?e.length:e.byteLength/8)<=i.y9?Array.from(e):new Float32Array(e)}},11964:(e,t,r)=>{r.d(t,{Cr:()=>d,H6:()=>m,LV:()=>l,_I:()=>h,kb:()=>u,vt:()=>c});var i=r(34727),n=r(4341),o=r(38954),a=r(51850),s=r(32114);function c(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function l(e,t){const r=p.get();return r.origin=e,r.vector=t,r}function d(e,t,r=c()){return(0,o.c)(r.origin,e),(0,o.d)(r.vector,t,e),r}function u(e,t){const r=(0,o.d)(s.rq.get(),t,e.origin),n=(0,o.e)(e.vector,r),a=(0,o.e)(e.vector,e.vector),c=(0,i.qE)(n/a,0,1),l=(0,o.d)(s.rq.get(),(0,o.g)(s.rq.get(),e.vector,c),r);return(0,o.e)(l,l)}function h(e,t,r){return m(e,t,0,1,r)}function m(e,t,r,n,a){const{vector:c,origin:l}=e,d=(0,o.d)(s.rq.get(),t,l),u=(0,o.e)(c,d)/(0,o.k)(c);return(0,o.g)(a,c,(0,i.qE)(u,r,n)),(0,o.f)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)();const p=new n.I(()=>c())},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.extensions=new p,this.outputs=new f}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!1){const r=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),s=o.code.generateSource(),c=o.main.generateSource(t),l="vertex"===e?_:g,d=o.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${r.join("\n")}\n${l}\n${d.join("\n")}\n${a.join("\n")}\n${i.join("\n")}\n${n.join("\n")}\n${u.join("\n")}\n${s.join("\n")}\n${c.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let a=0;a<i;++a)r[a](e,o,t,n)}}}class c{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}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.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class l{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new d(this),this.constants=new v(this)}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 m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1,flat:r?.flat??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+(r.flat||"int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?p.ALLOWLIST_VERTEX:p.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(e=>t.includes(e)).map(e=>`#extension ${e} : enable`)}static{this.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"]}static{this.ALLOWLIST_VERTEX=[]}}class f{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:f.DEFAULT_NAME,type:f.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class v{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=v._numberToFloatStr(r);break;case"int":i=v._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>v._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}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 g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",_="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>ft});var i=r(31821),n=r(12791),o=r(31635),a=r(34727),s=r(97768),c=r(36708),l=r(78659),d=r(10107),u=(r(44208),r(53966)),h=(r(87811),r(40608)),m=r(37585),p=r(69540);let f=class extends p.A{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"rows",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"columns",void 0),f=(0,o.Cg)([(0,h.$)("esri.CameraLayout")],f);const v=f;var g=r(69052),_=r(25482),x=r(79901),b=r(36005),w=r(43937),y=r(56507),M=r(86738);let T=class extends(p.A.ClonableMixin(_.A)){constructor(...e){super(...e),this.position=new M.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new v}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,y.GB)(e.x||0),n.y=(0,y.GB)(e.y||0),n.z=e.hasZ?(0,y.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new M.A;return r.read(e,t),r.x=(0,y.GB)(r.x||0),r.y=(0,y.GB)(r.y||0),r.z=r.hasZ?(0,y.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o.Cg)([(0,d.MZ)({type:M.A,json:{write:{isRequired:!0}}})],T.prototype,"position",void 0),(0,o.Cg)([(0,w.K)("position")],T.prototype,"writePosition",null),(0,o.Cg)([(0,b.w)("position")],T.prototype,"readPosition",null),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>g.ie.normalize((0,y.GB)(e)))],T.prototype,"heading",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>(0,a.qE)((0,y.GB)(e),-180,180))],T.prototype,"tilt",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,x.w)(e=>(0,a.qE)((0,y.GB)(e,55),1,170))],T.prototype,"fov",void 0),(0,o.Cg)([(0,d.MZ)({type:v,nonNullable:!0,json:{read:!1,write:!1}})],T.prototype,"layout",void 0),T=(0,o.Cg)([(0,h.$)("esri.Camera")],T);var C,S=r(9093),E=r(38954),A=r(51850),R=r(16930),I=(r(48353),r(9762),r(65806)),P=r(27993),F=r(73941),O=(r(19419),r(69622)),D=r(90629),H=r(58083),N=r(48163),L=r(87317),B=r(91829),G=r(82919),z=r(71351),U=r(44280);let V=C=class extends O.A{constructor(e){super(e),this._ray=(0,z.vt)(),this._viewport=(0,B.fA)(0,0,1,1),this._padding=(0,B.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,N.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,S.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,S.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,S.vt)(),this._frustumDirty=!0,this._frustum=(0,G.vt)(),this._fullViewport=(0,B.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,A.vt)(),this._up=(0,A.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,E.d)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,H.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,L.d)((0,B.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,L.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,L.d)((0,B.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,L.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,L.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,L.c)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,H.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,H.B8)((0,S.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,S.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,E.j)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,H.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,H.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,c=-r/2+this.row*n,l=c+n,d=(0,H.$h)((0,S.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),c*(1+2*this._padding[2]/t),l*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,H.aI)(u,d)?u:d}copyFrom(e){(0,E.c)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,L.c)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,L.c)(this._padding,e.padding),this.notifyChange("_padding"),(0,m.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,H.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,G.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,H.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,L.c)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new C).copyFrom(this)}equals(e){return(0,E.q)(this.eye,e.eye)&&(0,E.q)(this.center,e.center)&&(0,E.q)(this.up,e.up)&&(0,L.a)(this._viewport,e.viewport)&&(0,L.a)(this._padding,e.padding)&&(0,m.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,L.f)(e.screenPadding,this.screenPadding)>=t||(0,L.f)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,E.a)(k,e.eye,e.center),(0,E.a)($,this.eye,this.center);const r=(0,E.e)(k,$),i=(0,E.y)(k),n=(0,E.y)($),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,E.x)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,U.gr)(this.viewForward,(0,E.d)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,D.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,E.c)(j,e),j[3]=1,(0,L.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,E.g)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,L.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,q),this.renderToScreen(q,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,L.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,E.g)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,n=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,q),t)}unprojectFromRenderScreen(e,t){if((0,H.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,H.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,L.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),c=-Math.min(n-r/2,0),l=-Math.min(this.fullHeight-o-i/2,0),d=r-c- -Math.min(this.fullWidth-n-r/2,0),u=i-l- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}_computeUpGlobal(){(0,E.d)(k,this.center,this.eye);const e=(0,E.l)(this.center);e<1?((0,E.i)(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,E.e)(k,this.center))>.9999*(0,E.l)(k)*e||((0,E.h)(this._up,k,this.center),(0,E.h)(this._up,this._up,k),(0,E.n)(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){(0,E.E)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,E.g)(k,k,k[2]),(0,E.i)(this._up,-k[0],-k[1],1-k[2]),(0,E.n)(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,E.q)(e,t)||((0,E.c)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):u.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,G.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,H.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewport",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_padding",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_fov",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_nearFar",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"pixelRatio",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_rows",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"rows",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_columns",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"columns",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"eye",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"center",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_center",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"up",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_up",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewForward",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewUp",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewRight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"nearFar",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"near",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"far",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenViewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenPadding",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"x",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"y",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"width",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"height",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullWidth",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullHeight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_aspect",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"padding",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"projectionMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fov",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovX",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovY",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"relativeElevation",void 0),V=C=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderCamera")],V);const j=(0,B.vt)(),W=(0,S.vt)(),k=(0,A.vt)(),$=(0,A.vt)(),q=(0,D.r_)();class Z{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far))}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.zero=new Z(0,0)}static{this.infinite=new Z}}r(49718),r(6867),r(16396),(0,A.vt)(),(0,A.vt)(),(0,A.vt)(),new WeakMap;var Y=r(5443),X=r(39829),J=r(95108);function K(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),c=t[o]+s*(i-t[r]);return e[r]=i,e[o]=c,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,N.o8)(ee));break;case 2:Q(e,(0,N.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,m.aI)(e.at(-1),t)||e.push(t)}const ee=(0,N.vt)();var te=r(11964),re=r(27921);const ie=(0,A.vt)(),ne=(0,A.vt)();function oe(){return{direction:(0,A.vt)(),up:(0,A.vt)()}}function ae(e,t,r,i,n){let o=(0,E.n)(ie,e),s=(0,E.e)(o,i);const c=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,E.e)(t,i)),s<.99?((0,E.c)(o,t),c&&(0,E.g)(o,o,-1)):o=null);let l=0;if(o){(0,E.g)(ne,i,(0,E.e)(i,o)),(0,E.d)(o,o,ne);const e=(0,E.e)(o,n)/((0,E.l)(o)*(0,E.l)(n));(0,E.h)(ne,o,n),l=((0,E.e)(ne,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,E.e)(i,e)/(0,E.l)(e)));return r?(r.heading=l,r.tilt=d,r):{heading:l,tilt:d}}function se(e,t,r,i){(0,E.d)(ce,r,t),(0,re.T7)(i,(0,te.LV)(t,ce),e)||e===r||(0,E.c)(e,r)}const ce=(0,A.vt)(),le=(0,A.fA)(0,1,0),de=(0,A.fA)(0,0,1),ue=(0,S.vt)(),he=(0,A.vt)(),me=(0,A.vt)();function pe(e,t,r,i=oe()){const{direction:n,up:o}=i;return(0,H.N9)(ue,-(0,a.kU)(t)),(0,H.eL)(ue,ue,(0,a.kU)(r)),(0,E.t)(n,de,ue),(0,E.g)(n,n,-1),(0,E.t)(o,le,ue),i}function fe(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,E.b)(e,i,o,a)}const ve=(0,A.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ae(t,r,i,de,le)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=pe(0,r,i),o=(0,A.vt)();return(0,E.g)(o,n.direction,-t),(0,E.f)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:pe,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],c=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,z.LV)(t.origin,t.direction),n,ve)||fe(ve,r,i,t.endpoint,n),se(ve,a,ve,c),s.push((0,N.fA)(ve[0],ve[1]))}return function(e,t,r){const i=e.map(e=>((0,E.i)(ve,e[0],e[1],0),t.fromRenderCoords(ve,ve,r),[ve[0],ve[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,J.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,I.g)(t,he,o),(0,I.g)(t,me,o),he[0]-=r/2,me[0]+=r/2,he[1]-=i/2,me[1]+=i/2,(0,P.F)(he,o,he,a),(0,P.F)(me,o,me,a),n?(n.xmin=he[0],n.ymin=he[1],n.xmax=me[0],n.ymax=me[1],n.spatialReference=a):n=new Y.A(he[0],he[1],me[0],me[1],a),n}},Symbol.toStringTag,{value:"Module"}));var ge=r(34304),_e=r(97937),xe=r(28735);class be{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,G.vt)(),this._points=(0,G.Qy)(),this.lines=new Array(12),this._origin=(0,A.vt)(),this._direction=(0,A.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,A.vt)(),endpoint:null}}update(e){(0,G.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,E.c)(this._origin,e.eye),(0,E.c)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,E.c)(this._points[t],e[t]);(0,G.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,G.m7)(this.frustum,e)}intersectsRay(e){return(0,G.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,G.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,G.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;we(this.lines[t],e[t],e[r]),we(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),we(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=G.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function we(e,t,r){e.origin=t,e.endpoint=r,(0,E.E)(e.direction,t,r)}r(83047);const ye=(0,A.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Me=(0,A.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,A.fA)(parseFloat(Number(ye[0]+Me[0]).toFixed(6)),parseFloat(Number(ye[1]+Me[1]).toFixed(6)),parseFloat(Number(ye[2]+Me[2]).toFixed(6)));(0,A.vt)(),(0,A.vt)(),(0,_e.c)(),(0,z.vt)();const Te=(0,A.vt)(),Ce=(0,A.vt)();var Se=r(32728);const Ee=(0,A.fA)(0,0,1),Ae=(0,E.n)((0,A.vt)(),(0,A.fA)(1,1,1)),Re=new g.hr(-180,180),Ie=(0,S.vt)(),Pe=(0,A.vt)(),Fe=(0,A.vt)();function Oe(e,t,r,i=oe()){(0,E.h)(Pe,e,Ee),0===(0,E.e)(Pe,Pe)&&(0,E.h)(Pe,e,Ae),(0,H.$0)(Ie,-(0,a.kU)(t),e),(0,H.e$)(Ie,Ie,-(0,a.kU)(r),Pe);const{up:n,direction:o}=i;return(0,E.h)(n,Pe,e),(0,E.n)(n,n),(0,E.t)(n,n,Ie),(0,E.n)(o,e),(0,E.u)(o,o),(0,E.t)(o,o,Ie),i}function De(e){const t=e[1];e[1]=-e[2],e[2]=t}function He(e,t){const r=Oe(t,e.heading,e.tilt);return e.up=r.up,e}function Ne(e,t){const r=[],i=[],n=(0,ge.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],c=(0,te.Cr)(a,s,We),l=(0,re.vE)(t,c.origin,c.vector,0,Ve);switch(l){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===l?[1,r,i]:[-1,i,r],c=(0,re.Qj)(t),d=(0,E.b)((0,A.vt)(),Ve,c,e*n),u=(0,E.b)((0,A.vt)(),Ve,c,e*-n);o.push(a),o.push(d),s.push(u)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Le={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Be=(0,A.fA)(1,0,0),Ge=(0,A.fA)(0,1,0),ze=(0,A.vt)(),Ue=(0,A.vt)(),Ve=(0,A.vt)(),je=(0,_e.c)(),We=(0,te.vt)(),ke=(0,B.vt)();var $e,qe,Ze;Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Pe,o=Fe;return(0,E.n)(n,e),(0,E.h)(Fe,n,Ee),0===(0,E.e)(Fe,Fe)&&(0,E.h)(Fe,n,Ae),(0,E.h)(o,Fe,n),ae(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,A.vt)(),up:null,tilt:i,heading:r},o=Pe;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,c=(0,a.kU)(r),l=(0,a.kU)(i),d=Math.sin(c),u=Math.cos(c),h=Math.sin(l),m=Math.cos(l),p=(0,E.l)(o);let f;if(Math.abs(l)<1e-8)f=s+p;else{const e=p/h,t=(0,a.YN)(s/e),r=Math.PI-l-t;f=e*Math.sin(r)}const v=m*s,g=s*s*(h*h),_=u*u*g,x=f-v,b=x*x,w=_*(_+b-o[1]*o[1]);if(w<0)return(0,E.g)(n.eye,o,f/p),n.tilt=0,He(n,e);const y=Math.sqrt(w),M=o[1]*x,T=_+b;let C;if(C=u>0?-y+M:y+M,Math.abs(T)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,E.g)(n.eye,o,f/p),n.tilt=0,De(n.eye),He(n,e);n.eye[1]=C/T;const S=d*d*g,R=h*s,I=u*R*n.eye[1],P=n.eye[1]*n.eye[1],F=1-P,O=Math.sqrt(F),D=_*P+S-2*I*O*x+F*b;return Math.abs(D)<1e-8?((0,E.g)(n.eye,o,f/p),n.tilt=0,De(n.eye),He(n,e)):(n.eye[0]=(F*(f*o[0]-v*o[0])-R*O*(o[0]*n.eye[1]*u+o[2]*d))/D,n.eye[2]=(F*(f*o[2]-v*o[2])-R*O*(o[2]*n.eye[1]*u-o[0]*d))/D,(0,E.g)(n.eye,n.eye,f),De(n.eye),He(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),n=(0,E.l)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:Oe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,E.l)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,a.YN)(r/(n/Math.sin(e)));return(0,a.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new be(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,c=r.referenceEllipsoid.radius,l=i.eye,d=1+(0,E.j)(l,t)/(c+o),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=Le,v=function(e){const{renderCoordsHelper:t,state:{camera:r}}=e,{center:i,eye:n}=r,o=Math.abs(t.getAltitude(i)),s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,Te),(0,E.d)(Ce,r,t);const i=(0,E.l)(Ce);return 0===i?0:(0,a.XM)((0,E.e)(Ce,Te)/i)}(t,i,n));return(0,_e.b)(je,t.referenceEllipsoid.radius+o),(0,_e.d)(je,s,r.distance,r.fovY)}(e),g=(0,a.qE)((u-h)/(m-h),0,1),_=Math.round((0,a.Cc)(p,f,g)),x=i.aboveGround,b=n.planes[5],w=[],y=(0,re.O_)(A.uY,Be,(0,re.vt)()),M=(0,re.O_)(A.uY,Ge,(0,re.vt)());(0,L.s)(ke,0,0,0,0);const T=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-v:0,i=1===e&&x||3===e&&!x?v:1,s=n.lines[e],c=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const d=n/_,u=0===n?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,E.m)(Ue,s.origin,c.origin,u),m=(0,Se.nu)(s.direction,c.direction,u,ze);r.intersectManifoldClosestSilhouette((0,z.LV)(h,m),o,Ve),se(Ve,l,Ve,b),w.push((0,A.o8)(Ve)),0!==w.length&&T((0,E.x)(w.at(-1),Ve));const p=((0,re.Tj)(y,Ve)?1:0)|((0,re.Tj)(M,Ve)?2:0);ke[p]=1}}w.length>2&&(0,E.x)(w[0],w.at(-1));const C=function(e,t,r){const i=2*(0,ge.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,Ve,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,Ve[1]]),n.push([null,Ve[1]]),o=!0):n.push([Ve[0],Ve[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,J.$3)(n)||n.reverse(),n})}((0,L.b)(ke)>1?function(e,t){const r=[];for(const i of e)r.push(...Ne(i,t));return r}(Ne(w,y),M):[w],r,s);return new X.A({rings:C,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,c,l;const d=t.latitude,u=(0,F.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,n=(0,a.kU)(e),o=Math.sin(i/2),s=Math.cos(n),c=2*(0,a.YN)(Math.sqrt(o*o/(s*s)));return(0,a.KJ)(c)}(d,r,u)/2;o=h-m,s=h+m;const p=(0,a.kU)(d),f=(1+Math.sin(p))/(1-Math.sin(p)),v=(f+1)*Math.tan(i/u/2),_=v*v;function x(e){const t=Math.PI/2;return(e=g.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(c=1.5*Math.PI-2*Math.atan(.5*(v+Math.sqrt(4*f+_))),l=c+i/u,c=x(c),l=x(l),l<c){const e=l;l=c,c=e}if(c=Math.max((0,a.KJ)(c),-90),l=Math.min((0,a.KJ)(l),90),s=Re.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const b=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:R.A.WGS84;return n?(n.xmin=o,n.ymin=c,n.xmax=s,n.ymax=l,n.spatialReference=b):n=new Y.A(o,c,s,l,b),e.spatialReference&&e.spatialReference.isWebMercator&&(0,xe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"})),(Ze=$e||($e={})).OPAQUE="opaque-color",Ze.TRANSPARENT="transparent-color",Ze.COMPOSITE="composite-color",Ze.FINAL="final-color",function(e){e.SSAO="ssao",e.LASERLINES="laserline-color",e.ANTIALIASING="aa-color",e.HIGHLIGHTS="highlight-color",e.MAGNIFIER="magnifier-color",e.OCCLUDED="occluded-color",e.VIEWSHED="viewshed-color",e.OPAQUE_TERRAIN="opaque-terrain-color",e.OPAQUE_ENVIRONMENT="opaque-environment-color",e.TRANSPARENT_ENVIRONMENT="transparent-environment-color",e.FOCUSAREA="focusarea",e.FOCUSAREA_COLOR="focusarea-color"}(qe||(qe={})),(0,A.vt)();var Ye=r(49186);let Xe=class extends O.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=$e.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,c.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},c.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new Ye.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){1===e&&this.view.stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],Xe.prototype,"view",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],Xe.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],Xe.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],Xe.prototype,"techniques",null),Xe=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderNode")],Xe);var Je=r(97220),Ke=r(98958),Qe=r(95774),et=r(90644);class tt extends Ke.w{constructor(e,t){super(e,t,new Je.$(Qe.S,()=>r.e(9384).then(r.bind(r,59384))))}initializePipeline(){return(0,et.Ey)({colorWrite:et.kn})}}var rt=r(65786);class it extends rt.Y{constructor(){super(...arguments),this.projScale=1}}class nt extends it{constructor(){super(...arguments),this.intensity=1}}class ot extends rt.Y{}class at extends ot{constructor(){super(...arguments),this.blurSize=(0,N.vt)()}}var st=r(15581);class ct extends Ke.w{constructor(e,t){super(e,t,new Je.$(st.S,()=>r.e(191).then(r.bind(r,90191))))}initializePipeline(){return(0,et.Ey)({colorWrite:et.kn})}}var lt=r(63907),dt=r(76284),ut=r(67171);const ht=2;let mt=class extends Xe{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=qe.SSAO,this.isEnabled=()=>!1,this._enableTime=(0,l.l5)(0),this._passParameters=new nt,this._drawParameters=new at}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ut.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new dt.g(this.renderingContext,t,e),this.techniques.precompile(ct),this.techniques.precompile(tt),this.addHandles((0,c.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,l.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(lt.nI);if(!r||!i)return;const n=this.techniques.get(ct),o=this.techniques.get(tt);if(!n.compiled||!o.compiled)return this._enableTime=(0,l.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,l.l5)(performance.now()));const s=this.renderingContext,c=this.view.qualitySettings.fadeDuration,d=this.bindParameters,u=d.camera,h=u.relativeElevation,p=(0,a.qE)((5e5-h)/2e5,0,1),f=c>0?Math.min(c,performance.now()-this._enableTime)/c:1,v=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/u.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*pt/(0,st.g)(u)**6*v;const g=u.fullViewport[2],_=u.fullViewport[3],x=this.fboCache.acquire(g,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,g,_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const b=Math.round(g/ht),w=Math.round(_/ht),y=this.fboCache.acquire(b,w,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,m.hZ)(this._drawParameters.blurSize,0,ht/_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,b,w),s.screen.draw(),x.release();const M=this.fboCache.acquire(b,w,qe.SSAO,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,m.hZ)(this._drawParameters.blurSize,ht/g,0),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,b,w),s.screen.draw(),s.setViewport4fv(u.fullViewport),y.release(),f<1&&this.requestRender(1),M}};(0,o.Cg)([(0,d.MZ)()],mt.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],mt.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],mt.prototype,"isEnabled",void 0),mt=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],mt);const pt=.5;function ft(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/ht),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
8
+ }`))}},11725:(e,t,r)=>{r.d(t,{i:()=>c});var i=r(24326),n=r(39341),o=r(35256),a=r(43616),s=r(65786);class c{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this.vertexAttributeLocations=n.D,this._renderPriority=0,this._parameters=new t,(0,a.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,a.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new o.E){return r.output=e,r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},11868:(e,t,r)=>{r.d(t,{Wz:()=>o,oe:()=>n});var i=r(34275);function n(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function o(e){return(Array.isArray(e)?e.length:e.byteLength/8)<=i.y9?Array.from(e):new Float32Array(e)}},11964:(e,t,r)=>{r.d(t,{Cr:()=>d,H6:()=>p,LV:()=>l,_I:()=>h,kb:()=>u,vt:()=>c});var i=r(34727),n=r(4341),o=r(38954),a=r(51850),s=r(32114);function c(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function l(e,t){const r=m.get();return r.origin=e,r.vector=t,r}function d(e,t,r=c()){return(0,o.c)(r.origin,e),(0,o.d)(r.vector,t,e),r}function u(e,t){const r=(0,o.d)(s.rq.get(),t,e.origin),n=(0,o.e)(e.vector,r),a=(0,o.e)(e.vector,e.vector),c=(0,i.qE)(n/a,0,1),l=(0,o.d)(s.rq.get(),(0,o.g)(s.rq.get(),e.vector,c),r);return(0,o.e)(l,l)}function h(e,t,r){return p(e,t,0,1,r)}function p(e,t,r,n,a){const{vector:c,origin:l}=e,d=(0,o.d)(s.rq.get(),t,l),u=(0,o.e)(c,d)/(0,o.k)(c);return(0,o.g)(a,c,(0,i.qE)(u,r,n)),(0,o.f)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)();const m=new n.I(()=>c())},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new p,this.extensions=new m,this.outputs=new f}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!1){const r=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),s=o.code.generateSource(),c=o.main.generateSource(t),l="vertex"===e?_:g,d=o.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${r.join("\n")}\n${l}\n${d.join("\n")}\n${a.join("\n")}\n${i.join("\n")}\n${n.join("\n")}\n${u.join("\n")}\n${s.join("\n")}\n${c.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let a=0;a<i;++a)r[a](e,o,t,n)}}}class c{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}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.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class l{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new d(this),this.constants=new v(this)}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 p{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1,flat:r?.flat??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+(r.flat||"int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${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`)}static{this.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"]}static{this.ALLOWLIST_VERTEX=[]}}class f{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:f.DEFAULT_NAME,type:f.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class v{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=v._numberToFloatStr(r);break;case"int":i=v._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>v._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}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 g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",_="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>ft});var i=r(31821),n=r(12791),o=r(31635),a=r(34727),s=r(97768),c=r(36708),l=r(78659),d=r(10107),u=(r(44208),r(53966)),h=(r(87811),r(40608)),p=r(37585),m=r(69540);let f=class extends m.A{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"rows",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"columns",void 0),f=(0,o.Cg)([(0,h.$)("esri.CameraLayout")],f);const v=f;var g=r(69052),_=r(25482),x=r(79901),b=r(36005),w=r(43937),y=r(56507),M=r(86738);let T=class extends(m.A.ClonableMixin(_.A)){constructor(...e){super(...e),this.position=new M.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new v}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,y.GB)(e.x||0),n.y=(0,y.GB)(e.y||0),n.z=e.hasZ?(0,y.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new M.A;return r.read(e,t),r.x=(0,y.GB)(r.x||0),r.y=(0,y.GB)(r.y||0),r.z=r.hasZ?(0,y.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o.Cg)([(0,d.MZ)({type:M.A,json:{write:{isRequired:!0}}})],T.prototype,"position",void 0),(0,o.Cg)([(0,w.K)("position")],T.prototype,"writePosition",null),(0,o.Cg)([(0,b.w)("position")],T.prototype,"readPosition",null),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>g.ie.normalize((0,y.GB)(e)))],T.prototype,"heading",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>(0,a.qE)((0,y.GB)(e),-180,180))],T.prototype,"tilt",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,x.w)(e=>(0,a.qE)((0,y.GB)(e,55),1,170))],T.prototype,"fov",void 0),(0,o.Cg)([(0,d.MZ)({type:v,nonNullable:!0,json:{read:!1,write:!1}})],T.prototype,"layout",void 0),T=(0,o.Cg)([(0,h.$)("esri.Camera")],T);var C,S=r(9093),E=r(38954),A=r(51850),R=r(16930),I=(r(48353),r(9762),r(65806)),P=r(27993),O=r(73941),D=(r(19419),r(69622)),F=r(90629),H=r(58083),N=r(48163),L=r(87317),B=r(91829),G=r(82919),z=r(71351),U=r(44280);let V=C=class extends D.A{constructor(e){super(e),this._ray=(0,z.vt)(),this._viewport=(0,B.fA)(0,0,1,1),this._padding=(0,B.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,N.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,S.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,S.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,S.vt)(),this._frustumDirty=!0,this._frustum=(0,G.vt)(),this._fullViewport=(0,B.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,A.vt)(),this._up=(0,A.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,E.d)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,H.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,L.d)((0,B.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,L.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,L.d)((0,B.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,L.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,L.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,L.c)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,H.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,H.B8)((0,S.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,S.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,E.j)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,H.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,H.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,c=-r/2+this.row*n,l=c+n,d=(0,H.$h)((0,S.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),c*(1+2*this._padding[2]/t),l*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,H.aI)(u,d)?u:d}copyFrom(e){(0,E.c)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,L.c)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,L.c)(this._padding,e.padding),this.notifyChange("_padding"),(0,p.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,H.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,G.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,H.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,L.c)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new C).copyFrom(this)}equals(e){return(0,E.q)(this.eye,e.eye)&&(0,E.q)(this.center,e.center)&&(0,E.q)(this.up,e.up)&&(0,L.a)(this._viewport,e.viewport)&&(0,L.a)(this._padding,e.padding)&&(0,p.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,L.f)(e.screenPadding,this.screenPadding)>=t||(0,L.f)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,E.a)(k,e.eye,e.center),(0,E.a)($,this.eye,this.center);const r=(0,E.e)(k,$),i=(0,E.y)(k),n=(0,E.y)($),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,E.x)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,U.gr)(this.viewForward,(0,E.d)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,F.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,E.c)(j,e),j[3]=1,(0,L.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,E.g)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,L.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,q),this.renderToScreen(q,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,L.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,E.g)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,n=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,q),t)}unprojectFromRenderScreen(e,t){if((0,H.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,H.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,L.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),c=-Math.min(n-r/2,0),l=-Math.min(this.fullHeight-o-i/2,0),d=r-c- -Math.min(this.fullWidth-n-r/2,0),u=i-l- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}_computeUpGlobal(){(0,E.d)(k,this.center,this.eye);const e=(0,E.l)(this.center);e<1?((0,E.i)(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,E.e)(k,this.center))>.9999*(0,E.l)(k)*e||((0,E.h)(this._up,k,this.center),(0,E.h)(this._up,this._up,k),(0,E.n)(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){(0,E.E)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,E.g)(k,k,k[2]),(0,E.i)(this._up,-k[0],-k[1],1-k[2]),(0,E.n)(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,E.q)(e,t)||((0,E.c)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):u.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,G.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,H.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewport",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_padding",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_fov",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_nearFar",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"pixelRatio",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_rows",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"rows",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_columns",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"columns",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"eye",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"center",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_center",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"up",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_up",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewForward",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewUp",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewRight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"nearFar",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"near",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"far",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenViewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenPadding",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"x",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"y",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"width",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"height",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullWidth",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullHeight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_aspect",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"padding",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"projectionMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fov",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovX",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovY",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"relativeElevation",void 0),V=C=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderCamera")],V);const j=(0,B.vt)(),W=(0,S.vt)(),k=(0,A.vt)(),$=(0,A.vt)(),q=(0,F.r_)();class Z{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far))}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.zero=new Z(0,0)}static{this.infinite=new Z}}r(49718),r(6867),r(16396),(0,A.vt)(),(0,A.vt)(),(0,A.vt)(),new WeakMap;var Y=r(5443),X=r(39829),J=r(95108);function K(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),c=t[o]+s*(i-t[r]);return e[r]=i,e[o]=c,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,N.o8)(ee));break;case 2:Q(e,(0,N.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,p.aI)(e.at(-1),t)||e.push(t)}const ee=(0,N.vt)();var te=r(11964),re=r(27921);const ie=(0,A.vt)(),ne=(0,A.vt)();function oe(){return{direction:(0,A.vt)(),up:(0,A.vt)()}}function ae(e,t,r,i,n){let o=(0,E.n)(ie,e),s=(0,E.e)(o,i);const c=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,E.e)(t,i)),s<.99?((0,E.c)(o,t),c&&(0,E.g)(o,o,-1)):o=null);let l=0;if(o){(0,E.g)(ne,i,(0,E.e)(i,o)),(0,E.d)(o,o,ne);const e=(0,E.e)(o,n)/((0,E.l)(o)*(0,E.l)(n));(0,E.h)(ne,o,n),l=((0,E.e)(ne,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,E.e)(i,e)/(0,E.l)(e)));return r?(r.heading=l,r.tilt=d,r):{heading:l,tilt:d}}function se(e,t,r,i){(0,E.d)(ce,r,t),(0,re.T7)(i,(0,te.LV)(t,ce),e)||e===r||(0,E.c)(e,r)}const ce=(0,A.vt)(),le=(0,A.fA)(0,1,0),de=(0,A.fA)(0,0,1),ue=(0,S.vt)(),he=(0,A.vt)(),pe=(0,A.vt)();function me(e,t,r,i=oe()){const{direction:n,up:o}=i;return(0,H.N9)(ue,-(0,a.kU)(t)),(0,H.eL)(ue,ue,(0,a.kU)(r)),(0,E.t)(n,de,ue),(0,E.g)(n,n,-1),(0,E.t)(o,le,ue),i}function fe(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,E.b)(e,i,o,a)}const ve=(0,A.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ae(t,r,i,de,le)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=me(0,r,i),o=(0,A.vt)();return(0,E.g)(o,n.direction,-t),(0,E.f)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:me,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],c=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,z.LV)(t.origin,t.direction),n,ve)||fe(ve,r,i,t.endpoint,n),se(ve,a,ve,c),s.push((0,N.fA)(ve[0],ve[1]))}return function(e,t,r){const i=e.map(e=>((0,E.i)(ve,e[0],e[1],0),t.fromRenderCoords(ve,ve,r),[ve[0],ve[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,J.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,I.g)(t,he,o),(0,I.g)(t,pe,o),he[0]-=r/2,pe[0]+=r/2,he[1]-=i/2,pe[1]+=i/2,(0,P.F)(he,o,he,a),(0,P.F)(pe,o,pe,a),n?(n.xmin=he[0],n.ymin=he[1],n.xmax=pe[0],n.ymax=pe[1],n.spatialReference=a):n=new Y.A(he[0],he[1],pe[0],pe[1],a),n}},Symbol.toStringTag,{value:"Module"}));var ge=r(34304),_e=r(97937),xe=r(28735);class be{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,G.vt)(),this._points=(0,G.Qy)(),this.lines=new Array(12),this._origin=(0,A.vt)(),this._direction=(0,A.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,A.vt)(),endpoint:null}}update(e){(0,G.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,E.c)(this._origin,e.eye),(0,E.c)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,E.c)(this._points[t],e[t]);(0,G.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,G.m7)(this.frustum,e)}intersectsRay(e){return(0,G.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,G.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,G.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;we(this.lines[t],e[t],e[r]),we(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),we(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=G.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function we(e,t,r){e.origin=t,e.endpoint=r,(0,E.E)(e.direction,t,r)}r(83047);const ye=(0,A.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Me=(0,A.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,A.fA)(parseFloat(Number(ye[0]+Me[0]).toFixed(6)),parseFloat(Number(ye[1]+Me[1]).toFixed(6)),parseFloat(Number(ye[2]+Me[2]).toFixed(6)));(0,A.vt)(),(0,A.vt)(),(0,_e.c)(),(0,z.vt)();const Te=(0,A.vt)(),Ce=(0,A.vt)();var Se=r(32728);const Ee=(0,A.fA)(0,0,1),Ae=(0,E.n)((0,A.vt)(),(0,A.fA)(1,1,1)),Re=new g.hr(-180,180),Ie=(0,S.vt)(),Pe=(0,A.vt)(),Oe=(0,A.vt)();function De(e,t,r,i=oe()){(0,E.h)(Pe,e,Ee),0===(0,E.e)(Pe,Pe)&&(0,E.h)(Pe,e,Ae),(0,H.$0)(Ie,-(0,a.kU)(t),e),(0,H.e$)(Ie,Ie,-(0,a.kU)(r),Pe);const{up:n,direction:o}=i;return(0,E.h)(n,Pe,e),(0,E.n)(n,n),(0,E.t)(n,n,Ie),(0,E.n)(o,e),(0,E.u)(o,o),(0,E.t)(o,o,Ie),i}function Fe(e){const t=e[1];e[1]=-e[2],e[2]=t}function He(e,t){const r=De(t,e.heading,e.tilt);return e.up=r.up,e}function Ne(e,t){const r=[],i=[],n=(0,ge.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],c=(0,te.Cr)(a,s,We),l=(0,re.vE)(t,c.origin,c.vector,0,Ve);switch(l){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===l?[1,r,i]:[-1,i,r],c=(0,re.Qj)(t),d=(0,E.b)((0,A.vt)(),Ve,c,e*n),u=(0,E.b)((0,A.vt)(),Ve,c,e*-n);o.push(a),o.push(d),s.push(u)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Le={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Be=(0,A.fA)(1,0,0),Ge=(0,A.fA)(0,1,0),ze=(0,A.vt)(),Ue=(0,A.vt)(),Ve=(0,A.vt)(),je=(0,_e.c)(),We=(0,te.vt)(),ke=(0,B.vt)();var $e,qe,Ze;Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Pe,o=Oe;return(0,E.n)(n,e),(0,E.h)(Oe,n,Ee),0===(0,E.e)(Oe,Oe)&&(0,E.h)(Oe,n,Ae),(0,E.h)(o,Oe,n),ae(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,A.vt)(),up:null,tilt:i,heading:r},o=Pe;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,c=(0,a.kU)(r),l=(0,a.kU)(i),d=Math.sin(c),u=Math.cos(c),h=Math.sin(l),p=Math.cos(l),m=(0,E.l)(o);let f;if(Math.abs(l)<1e-8)f=s+m;else{const e=m/h,t=(0,a.YN)(s/e),r=Math.PI-l-t;f=e*Math.sin(r)}const v=p*s,g=s*s*(h*h),_=u*u*g,x=f-v,b=x*x,w=_*(_+b-o[1]*o[1]);if(w<0)return(0,E.g)(n.eye,o,f/m),n.tilt=0,He(n,e);const y=Math.sqrt(w),M=o[1]*x,T=_+b;let C;if(C=u>0?-y+M:y+M,Math.abs(T)<1e-8)return m<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,E.g)(n.eye,o,f/m),n.tilt=0,Fe(n.eye),He(n,e);n.eye[1]=C/T;const S=d*d*g,R=h*s,I=u*R*n.eye[1],P=n.eye[1]*n.eye[1],O=1-P,D=Math.sqrt(O),F=_*P+S-2*I*D*x+O*b;return Math.abs(F)<1e-8?((0,E.g)(n.eye,o,f/m),n.tilt=0,Fe(n.eye),He(n,e)):(n.eye[0]=(O*(f*o[0]-v*o[0])-R*D*(o[0]*n.eye[1]*u+o[2]*d))/F,n.eye[2]=(O*(f*o[2]-v*o[2])-R*D*(o[2]*n.eye[1]*u-o[0]*d))/F,(0,E.g)(n.eye,n.eye,f),Fe(n.eye),He(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),n=(0,E.l)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:De,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,E.l)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,a.YN)(r/(n/Math.sin(e)));return(0,a.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new be(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,c=r.referenceEllipsoid.radius,l=i.eye,d=1+(0,E.j)(l,t)/(c+o),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:p,minSamples:m,maxSamples:f}=Le,v=function(e){const{renderCoordsHelper:t,state:{camera:r}}=e,{center:i,eye:n}=r,o=Math.abs(t.getAltitude(i)),s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,Te),(0,E.d)(Ce,r,t);const i=(0,E.l)(Ce);return 0===i?0:(0,a.XM)((0,E.e)(Ce,Te)/i)}(t,i,n));return(0,_e.b)(je,t.referenceEllipsoid.radius+o),(0,_e.d)(je,s,r.distance,r.fovY)}(e),g=(0,a.qE)((u-h)/(p-h),0,1),_=Math.round((0,a.Cc)(m,f,g)),x=i.aboveGround,b=n.planes[5],w=[],y=(0,re.O_)(A.uY,Be,(0,re.vt)()),M=(0,re.O_)(A.uY,Ge,(0,re.vt)());(0,L.s)(ke,0,0,0,0);const T=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-v:0,i=1===e&&x||3===e&&!x?v:1,s=n.lines[e],c=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const d=n/_,u=0===n?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,E.m)(Ue,s.origin,c.origin,u),p=(0,Se.nu)(s.direction,c.direction,u,ze);r.intersectManifoldClosestSilhouette((0,z.LV)(h,p),o,Ve),se(Ve,l,Ve,b),w.push((0,A.o8)(Ve)),0!==w.length&&T((0,E.x)(w.at(-1),Ve));const m=((0,re.Tj)(y,Ve)?1:0)|((0,re.Tj)(M,Ve)?2:0);ke[m]=1}}w.length>2&&(0,E.x)(w[0],w.at(-1));const C=function(e,t,r){const i=2*(0,ge.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,Ve,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,Ve[1]]),n.push([null,Ve[1]]),o=!0):n.push([Ve[0],Ve[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,J.$3)(n)||n.reverse(),n})}((0,L.b)(ke)>1?function(e,t){const r=[];for(const i of e)r.push(...Ne(i,t));return r}(Ne(w,y),M):[w],r,s);return new X.A({rings:C,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,c,l;const d=t.latitude,u=(0,O.tO)(e.spatialReference).radius,h=t.longitude,p=function(e,t,r){const i=t/r,n=(0,a.kU)(e),o=Math.sin(i/2),s=Math.cos(n),c=2*(0,a.YN)(Math.sqrt(o*o/(s*s)));return(0,a.KJ)(c)}(d,r,u)/2;o=h-p,s=h+p;const m=(0,a.kU)(d),f=(1+Math.sin(m))/(1-Math.sin(m)),v=(f+1)*Math.tan(i/u/2),_=v*v;function x(e){const t=Math.PI/2;return(e=g.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(c=1.5*Math.PI-2*Math.atan(.5*(v+Math.sqrt(4*f+_))),l=c+i/u,c=x(c),l=x(l),l<c){const e=l;l=c,c=e}if(c=Math.max((0,a.KJ)(c),-90),l=Math.min((0,a.KJ)(l),90),s=Re.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const b=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:R.A.WGS84;return n?(n.xmin=o,n.ymin=c,n.xmax=s,n.ymax=l,n.spatialReference=b):n=new Y.A(o,c,s,l,b),e.spatialReference&&e.spatialReference.isWebMercator&&(0,xe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"})),(Ze=$e||($e={})).OPAQUE="opaque-color",Ze.TRANSPARENT="transparent-color",Ze.COMPOSITE="composite-color",Ze.FINAL="final-color",function(e){e.SSAO="ssao",e.LASERLINES="laserline-color",e.ANTIALIASING="aa-color",e.HIGHLIGHTS="highlight-color",e.MAGNIFIER="magnifier-color",e.OCCLUDED="occluded-color",e.VIEWSHED="viewshed-color",e.OPAQUE_TERRAIN="opaque-terrain-color",e.OPAQUE_ENVIRONMENT="opaque-environment-color",e.TRANSPARENT_ENVIRONMENT="transparent-environment-color",e.FOCUSAREA="focusarea",e.FOCUSAREA_COLOR="focusarea-color"}(qe||(qe={})),(0,A.vt)();var Ye=r(49186);let Xe=class extends D.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=$e.COMPOSITE,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,c.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},c.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new Ye.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){1===e&&this.view.stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],Xe.prototype,"view",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],Xe.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],Xe.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],Xe.prototype,"techniques",null),Xe=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderNode")],Xe);var Je=r(97220),Ke=r(98958),Qe=r(95774),et=r(90644);class tt extends Ke.w{constructor(e,t){super(e,t,new Je.$(Qe.S,()=>r.e(9384).then(r.bind(r,59384))))}initializePipeline(){return(0,et.Ey)({colorWrite:et.kn})}}var rt=r(65786);class it extends rt.Y{constructor(){super(...arguments),this.projScale=1}}class nt extends it{constructor(){super(...arguments),this.intensity=1}}class ot extends rt.Y{}class at extends ot{constructor(){super(...arguments),this.blurSize=(0,N.vt)()}}var st=r(15581);class ct extends Ke.w{constructor(e,t){super(e,t,new Je.$(st.S,()=>r.e(191).then(r.bind(r,90191))))}initializePipeline(){return(0,et.Ey)({colorWrite:et.kn})}}var lt=r(63907),dt=r(76284),ut=r(67171);const ht=2;let pt=class extends Xe{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=qe.SSAO,this.isEnabled=()=>!1,this._enableTime=(0,l.l5)(0),this._passParameters=new nt,this._drawParameters=new at}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ut.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new dt.g(this.renderingContext,t,e),this.techniques.precompile(ct),this.techniques.precompile(tt),this.addHandles((0,c.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,l.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(lt.nI);if(!r||!i)return;const n=this.techniques.get(ct),o=this.techniques.get(tt);if(!n.compiled||!o.compiled)return this._enableTime=(0,l.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,l.l5)(performance.now()));const s=this.renderingContext,c=this.view.qualitySettings.fadeDuration,d=this.bindParameters,u=d.camera,h=u.relativeElevation,m=(0,a.qE)((5e5-h)/2e5,0,1),f=c>0?Math.min(c,performance.now()-this._enableTime)/c:1,v=f*m;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/u.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*mt/(0,st.g)(u)**6*v;const g=u.fullViewport[2],_=u.fullViewport[3],x=this.fboCache.acquire(g,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,g,_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const b=Math.round(g/ht),w=Math.round(_/ht),y=this.fboCache.acquire(b,w,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,0,ht/_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,b,w),s.screen.draw(),x.release();const M=this.fboCache.acquire(b,w,qe.SSAO,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,ht/g,0),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,b,w),s.screen.draw(),s.setViewport4fv(u.fullViewport),y.release(),f<1&&this.requestRender(1),M}};(0,o.Cg)([(0,d.MZ)()],pt.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],pt.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],pt.prototype,"isEnabled",void 0),pt=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],pt);const mt=.5;function ft(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/ht),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
9
9
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
10
10
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
11
11
  }
12
12
  float evaluateAmbientOcclusion() {
13
13
  return 1.0 - evaluateAmbientOcclusionInverse();
14
14
  }`)):e.code.add(i.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
15
- float evaluateAmbientOcclusion() { return 0.0; }`)}},15581:(e,t,r)=>{r.d(t,{S:()=>x,b:()=>v,g:()=>g});var i=r(37585),n=r(48163),o=r(82048),a=r(52540),s=r(34845),c=r(77108),l=r(47286),d=r(33094),u=r(20304),h=r(31821),m=r(63761),p=r(14113);const f=16;function v(){const e=new p.N5,t=e.fragment;return e.include(o.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new d.U("radius",e=>g(e.camera))).code.add(h.H`vec3 sphere[16] = vec3[16](
15
+ float evaluateAmbientOcclusion() { return 0.0; }`)}},15581:(e,t,r)=>{r.d(t,{S:()=>x,b:()=>v,g:()=>g});var i=r(37585),n=r(48163),o=r(82048),a=r(52540),s=r(34845),c=r(77108),l=r(47286),d=r(33094),u=r(20304),h=r(31821),p=r(63761),m=r(14113);const f=16;function v(){const e=new m.N5,t=e.fragment;return e.include(o.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new d.U("radius",e=>g(e.camera))).code.add(h.H`vec3 sphere[16] = vec3[16](
16
16
  vec3(0.186937, 0.0, 0.0),
17
17
  vec3(0.700542, 0.0, 0.0),
18
18
  vec3(-0.864858, -0.481795, -0.111713),
@@ -38,7 +38,7 @@ vec3 v = Q - C;
38
38
  float vv = dot(v, v);
39
39
  float vn = dot(normalize(v), n_C);
40
40
  return fallOffFunction(vv, vn, 0.1);
41
- }`),e.outputs.add("fragOcclusion","float"),t.uniforms.add(new m.N("normalMap",e=>e.normalTexture),new m.N("depthMap",e=>e.depthTexture),new u.m("projScale",e=>e.projScale),new m.N("rnm",e=>e.noiseTexture),new l.G("rnmScale",(e,t)=>(0,i.hZ)(_,t.camera.fullWidth/e.noiseTexture.descriptor.width,t.camera.fullHeight/e.noiseTexture.descriptor.height)),new u.m("intensity",e=>e.intensity),new c.E("screenSize",e=>(0,i.hZ)(_,e.camera.fullWidth,e.camera.fullHeight))).main.add(h.H`
41
+ }`),e.outputs.add("fragOcclusion","float"),t.uniforms.add(new p.N("normalMap",e=>e.normalTexture),new p.N("depthMap",e=>e.depthTexture),new u.m("projScale",e=>e.projScale),new p.N("rnm",e=>e.noiseTexture),new l.G("rnmScale",(e,t)=>(0,i.hZ)(_,t.camera.fullWidth/e.noiseTexture.descriptor.width,t.camera.fullHeight/e.noiseTexture.descriptor.height)),new u.m("intensity",e=>e.intensity),new c.E("screenSize",e=>(0,i.hZ)(_,e.camera.fullWidth,e.camera.fullHeight))).main.add(h.H`
42
42
  float depth = depthFromTexture(depthMap, uv);
43
43
 
44
44
  // Early out if depth is out of range, such as in the sky
@@ -94,7 +94,7 @@ return fallOffFunction(vv, vn, 0.1);
94
94
  A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2;
95
95
 
96
96
  fragOcclusion = A;
97
- `),e}function g(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const _=(0,n.vt)(),x=Object.freeze(Object.defineProperty({__proto__:null,build:v,getRadius:g},Symbol.toStringTag,{value:"Module"}))},15976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",2,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},16396:(e,t,r)=>{r.d(t,{ou:()=>c}),r(77690),r(29242),r(58083),r(9093);var i=r(38954),n=r(51850),o=r(97937),a=r(57005);const s=new class{constructor(e=0){this.offset=e,this.sphere=(0,o.c)(),this.tmpVertex=(0,n.vt)()}applyToVertex(e,t,r){const n=this.objectTransform.transform,o=(0,i.i)(l,e,t,r),a=(0,i.t)(o,o,n),s=this.offset/(0,i.l)(a);(0,i.b)(a,a,a,s);const c=this.objectTransform.inverse;return(0,i.t)(this.tmpVertex,a,c),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.l)(e);(0,i.b)(e,e,e,r);const n=this.offset/(0,i.l)(t);(0,i.b)(t,t,t,n)}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=(0,i.l)((0,o.a)(e)),r=this.offset/t;return(0,i.b)((0,o.a)(this.sphere),(0,o.a)(e),(0,o.a)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};function c(e){return null!=e?(s.offset=e,s):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=(0,o.c)(),this._tmpObb=new a.ab,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=(0,i.l)(e)}applyToVertex(e,t,r){const n=(0,i.i)(l,e,t,r),o=(0,i.i)(d,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,i.l)(o);return(0,i.b)(this._tmpVertex,n,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],a=e[4],s=e[5]+t,c=Math.abs(r),l=Math.abs(i),d=Math.abs(n),u=Math.abs(o),h=Math.abs(a),m=Math.abs(s),p=.5*(1+Math.sign(r*o))*Math.min(c,u),f=.5*(1+Math.sign(i*a))*Math.min(l,h),v=.5*(1+Math.sign(n*s))*Math.min(d,m),g=Math.max(c,u),_=Math.max(l,h),x=Math.max(d,m),b=Math.sqrt(p*p+f*f+v*v),w=Math.sign(c+r),y=Math.sign(l+i),M=Math.sign(d+n),T=Math.sign(u+o),C=Math.sign(h+a),S=Math.sign(m+s),E=this._totalOffset;if(b<E)return e[0]-=(1-w)*E,e[1]-=(1-y)*E,e[2]-=(1-M)*E,e[3]+=T*E,e[4]+=C*E,e[5]+=S*E,e;const A=E/Math.sqrt(g*g+_*_+x*x),R=E/b,I=R-A,P=-I;return e[0]+=r*(w*P+R),e[1]+=i*(y*P+R),e[2]+=n*(M*P+R),e[3]+=o*(T*I+A),e[4]+=a*(C*I+A),e[5]+=s*(S*I+A),e}applyToMbs(e){const t=(0,i.l)((0,o.a)(e)),r=this._totalOffset/t;return(0,i.b)((0,o.a)(this._tmpMbs),(0,o.a)(e),(0,o.a)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,a.gm)(e,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,n.vt)()}applyToVertex(e,t,r){const n=(0,i.i)(l,e,t,r),o=(0,i.f)(d,n,this.localOrigin),a=this.offset/(0,i.l)(o);return(0,i.b)(this.tmpVertex,n,o,a),this.tmpVertex}applyToAabb(e){const t=u,r=h,i=m;for(let n=0;n<3;++n)t[n]=e[0+n]+this.localOrigin[n],r[n]=e[3+n]+this.localOrigin[n],i[n]=t[n];const n=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=n[t],e[t+3]=n[t];const o=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 n=0;n<3;++n)i[n]=e&1<<n?r[n]:t[n];o(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0===(a&e)){for(let n=0;n<3;++n)i[n]=a&1<<n?0:e&1<<n?t[n]:r[n];o(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const l=(0,n.vt)(),d=(0,n.vt)(),u=(0,n.vt)(),h=(0,n.vt)(),m=(0,n.vt)()},16943:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(44208);function n(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},17352:(e,t,r)=>{r.d(t,{b:()=>j,f:()=>x}),r(44208);var i=r(53966),n=r(34727),o=r(4341),a=r(58083),s=r(9093),c=r(38954),l=r(51850),d=r(19419),u=r(11964),h=r(27921),m=r(71351),p=r(44280),f=r(32114);const v=()=>i.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function g(e=H){return{plane:(0,h.vt)(e.plane),origin:(0,l.o8)(e.origin),basis1:(0,l.o8)(e.basis1),basis2:(0,l.o8)(e.basis2)}}function _(e,t=g()){return x(e.origin,e.basis1,e.basis2,t)}function x(e,t,r,i=g()){return(0,c.c)(i.origin,e),(0,c.c)(i.basis1,t),(0,c.c)(i.basis2,r),b(i),function(e,t){Math.abs((0,c.e)(e.basis1,e.basis2)/((0,c.l)(e.basis1)*(0,c.l)(e.basis2)))>1e-6&&v().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,c.e)(e.basis1,I(e)))>1e-6&&v().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,c.e)(I(e),e.origin)-e.plane[3])>1e-6&&v().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function b(e){(0,h.mR)(e.basis2,e.basis1,e.origin,e.plane)}function w(e,t,r){e!==r&&_(e,r);const i=(0,c.g)(f.rq.get(),I(e),t);return(0,c.f)(r.origin,r.origin,i),r.plane[3]-=t,r}function y(e,t=g()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,c.i)(t.origin,e[0]+r,e[1]+i,0),(0,c.i)(t.basis1,r,0,0),(0,c.i)(t.basis2,0,i,0),(0,h.fA)(0,0,1,0,t.plane),t}function M(e,t,r){return!!(0,h.Ui)(e.plane,t,r)&&P(e,r)}function T(e,t,r){const i=N.get();D(e,t,i,N.get());let o=Number.POSITIVE_INFINITY;for(const a of z){const s=O(e,a,L.get()),l=f.rq.get();if((0,h.T7)(i,s,l)){const e=(0,c.E)(f.rq.get(),t.origin,l),i=Math.abs((0,n.XM)((0,c.e)(t.direction,e)));i<o&&(o=i,(0,c.c)(r,l))}}return o===Number.POSITIVE_INFINITY?C(e,t,r):r}function C(e,t,r){if(M(e,t,r))return r;const i=N.get(),n=N.get();D(e,t,i,n);let o=Number.POSITIVE_INFINITY;for(const a of z){const s=O(e,a,L.get()),l=f.rq.get();if((0,h.gv)(i,s,l)){const e=(0,m.kb)(t,l);if(!(0,h.Tj)(n,l))continue;e<o&&(o=e,(0,c.c)(r,l))}}return A(e,t.origin)<o&&S(e,t.origin,r),r}function S(e,t,r){const i=(0,h._I)(e.plane,t,f.rq.get()),n=(0,u.H6)(F(e,e.basis1),i,-1,1,f.rq.get()),o=(0,u.H6)(F(e,e.basis2),i,-1,1,f.rq.get());return(0,c.d)(r,(0,c.f)(f.rq.get(),n,o),e.origin),r}function E(e,t,r){const{origin:i,basis1:n,basis2:o}=e,a=(0,c.d)(f.rq.get(),t,i),s=(0,p.gr)(n,a),l=(0,p.gr)(o,a),d=(0,p.gr)(I(e),a);return(0,c.i)(r,s,l,d)}function A(e,t){const r=E(e,t,f.rq.get()),{basis1:i,basis2:n}=e,o=(0,c.l)(i),a=(0,c.l)(n),s=Math.max(Math.abs(r[0])-o,0),l=Math.max(Math.abs(r[1])-a,0),d=r[2];return s*s+l*l+d*d}function R(e,t){const r=-e.plane[3];return(0,p.gr)(I(e),t)-r}function I(e){return(0,h.Qj)(e.plane)}function P(e,t){const r=(0,c.d)(f.rq.get(),t,e.origin),i=(0,c.k)(e.basis1),n=(0,c.k)(e.basis2),o=(0,c.e)(e.basis1,r),a=(0,c.e)(e.basis2,r);return-o-i<0&&o-i<0&&-a-n<0&&a-n<0}function F(e,t){const r=L.get();return(0,c.c)(r.origin,e.origin),(0,c.c)(r.vector,t),r}function O(e,t,r){const{basis1:i,basis2:n,origin:o}=e,a=(0,c.g)(f.rq.get(),i,t.origin[0]),s=(0,c.g)(f.rq.get(),n,t.origin[1]);(0,c.f)(r.origin,a,s),(0,c.f)(r.origin,r.origin,o);const l=(0,c.g)(f.rq.get(),i,t.direction[0]),d=(0,c.g)(f.rq.get(),n,t.direction[1]);return(0,c.g)(r.vector,(0,c.f)(l,l,d),2),r}function D(e,t,r,i){const n=I(e);(0,h.mR)(n,t.direction,t.origin,r),(0,h.mR)((0,h.Qj)(r),n,t.origin,i)}const H={plane:(0,h.vt)(),origin:(0,l.fA)(0,0,0),basis1:(0,l.fA)(1,0,0),basis2:(0,l.fA)(0,1,0)},N=new o.I(h.vt),L=new o.I(u.vt),B=(0,l.vt)(),G=new o.I(()=>g()),z=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],U=(0,s.vt)(),V=(0,s.vt)(),j=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:class{constructor(){this.plane=(0,h.vt)(),this.origin=(0,l.vt)(),this.basis1=(0,l.vt)(),this.basis2=(0,l.vt)()}},altitudeAt:R,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case 0:(0,c.c)(r,e.basis1),(0,c.n)(r,r);break;case 1:(0,c.c)(r,e.basis2),(0,c.n)(r,r);break;case 2:(0,c.c)(r,I(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:C,closestPointOnSilhouette:T,copy:_,copyWithoutVerify:function(e,t){(0,c.c)(t.origin,e.origin),(0,c.c)(t.basis1,e.basis1),(0,c.c)(t.basis2,e.basis2),(0,h.C)(t.plane,e.plane)},create:g,distance:function(e,t){return Math.sqrt(A(e,t))},distance2:A,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of z){const n=O(e,i,L.get()),o=(0,u.kb)(n,t);o>r&&(r=o)}return Math.sqrt(r)},elevate:w,equals:function(e,t){return(0,c.q)(e.basis1,t.basis1)&&(0,c.q)(e.basis2,t.basis2)&&(0,c.q)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,h.Tj)(e.plane,t)&&P(e,t)},fromAABoundingRect:y,fromValues:x,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[n,o]=e.origin;return(0,d.fA)(n-r,o-i,n+r,o+i,t)},intersectRay:M,intersectRayClosestSilhouette:function(e,t,r){if(M(e,t,r))return r;const i=T(e,t,f.rq.get());return(0,c.f)(r,t.origin,(0,c.g)(f.rq.get(),t.direction,(0,c.j)(t.origin,i)/(0,c.l)(t.direction))),r},normal:I,projectPoint:S,projectPointLocal:E,rotate:function(e,t,r,i){return e!==i&&_(e,i),(0,a.$0)(V,t,r),(0,c.t)(i.basis1,e.basis1,V),(0,c.t)(i.basis2,e.basis2,V),b(i),i},setAltitudeAt:function(e,t,r,i){const n=R(e,t),o=(0,c.g)(B,I(e),r-n);return(0,c.f)(i,t,o),i},setExtent:function(e,t,r){return y(t,r),w(r,R(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&_(e,r),(0,a.B8)(U,t),(0,a.mg)(U,U),(0,c.t)(r.basis1,e.basis1,U),(0,c.t)(r.basis2,e.basis2,U),(0,c.t)((0,h.Qj)(r.plane),(0,h.Qj)(e.plane),U),(0,c.t)(r.origin,e.origin,t),(0,h.mP)(r.plane,r.plane,r.origin),r},up:H,updateUnboundedPlane:b,wrap:function(e,t,r){const i=G.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,h.LV)(0,0,0,0),b(i),i}},Symbol.toStringTag,{value:"Module"}))},20304:(e,t,r)=>{r.d(t,{m:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",1,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},22393:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(31821);function n(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
97
+ `),e}function g(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const _=(0,n.vt)(),x=Object.freeze(Object.defineProperty({__proto__:null,build:v,getRadius:g},Symbol.toStringTag,{value:"Module"}))},15976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",2,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},16396:(e,t,r)=>{r.d(t,{ou:()=>c}),r(77690),r(29242),r(58083),r(9093);var i=r(38954),n=r(51850),o=r(97937),a=r(57005);const s=new class{constructor(e=0){this.offset=e,this.sphere=(0,o.c)(),this.tmpVertex=(0,n.vt)()}applyToVertex(e,t,r){const n=this.objectTransform.transform,o=(0,i.i)(l,e,t,r),a=(0,i.t)(o,o,n),s=this.offset/(0,i.l)(a);(0,i.b)(a,a,a,s);const c=this.objectTransform.inverse;return(0,i.t)(this.tmpVertex,a,c),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.l)(e);(0,i.b)(e,e,e,r);const n=this.offset/(0,i.l)(t);(0,i.b)(t,t,t,n)}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=(0,i.l)((0,o.a)(e)),r=this.offset/t;return(0,i.b)((0,o.a)(this.sphere),(0,o.a)(e),(0,o.a)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};function c(e){return null!=e?(s.offset=e,s):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=(0,o.c)(),this._tmpObb=new a.ab,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=(0,i.l)(e)}applyToVertex(e,t,r){const n=(0,i.i)(l,e,t,r),o=(0,i.i)(d,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,i.l)(o);return(0,i.b)(this._tmpVertex,n,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],a=e[4],s=e[5]+t,c=Math.abs(r),l=Math.abs(i),d=Math.abs(n),u=Math.abs(o),h=Math.abs(a),p=Math.abs(s),m=.5*(1+Math.sign(r*o))*Math.min(c,u),f=.5*(1+Math.sign(i*a))*Math.min(l,h),v=.5*(1+Math.sign(n*s))*Math.min(d,p),g=Math.max(c,u),_=Math.max(l,h),x=Math.max(d,p),b=Math.sqrt(m*m+f*f+v*v),w=Math.sign(c+r),y=Math.sign(l+i),M=Math.sign(d+n),T=Math.sign(u+o),C=Math.sign(h+a),S=Math.sign(p+s),E=this._totalOffset;if(b<E)return e[0]-=(1-w)*E,e[1]-=(1-y)*E,e[2]-=(1-M)*E,e[3]+=T*E,e[4]+=C*E,e[5]+=S*E,e;const A=E/Math.sqrt(g*g+_*_+x*x),R=E/b,I=R-A,P=-I;return e[0]+=r*(w*P+R),e[1]+=i*(y*P+R),e[2]+=n*(M*P+R),e[3]+=o*(T*I+A),e[4]+=a*(C*I+A),e[5]+=s*(S*I+A),e}applyToMbs(e){const t=(0,i.l)((0,o.a)(e)),r=this._totalOffset/t;return(0,i.b)((0,o.a)(this._tmpMbs),(0,o.a)(e),(0,o.a)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,a.gm)(e,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,n.vt)()}applyToVertex(e,t,r){const n=(0,i.i)(l,e,t,r),o=(0,i.f)(d,n,this.localOrigin),a=this.offset/(0,i.l)(o);return(0,i.b)(this.tmpVertex,n,o,a),this.tmpVertex}applyToAabb(e){const t=u,r=h,i=p;for(let n=0;n<3;++n)t[n]=e[0+n]+this.localOrigin[n],r[n]=e[3+n]+this.localOrigin[n],i[n]=t[n];const n=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=n[t],e[t+3]=n[t];const o=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 n=0;n<3;++n)i[n]=e&1<<n?r[n]:t[n];o(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0===(a&e)){for(let n=0;n<3;++n)i[n]=a&1<<n?0:e&1<<n?t[n]:r[n];o(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const l=(0,n.vt)(),d=(0,n.vt)(),u=(0,n.vt)(),h=(0,n.vt)(),p=(0,n.vt)()},16943:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(44208);function n(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},17352:(e,t,r)=>{r.d(t,{b:()=>j,f:()=>x}),r(44208);var i=r(53966),n=r(34727),o=r(4341),a=r(58083),s=r(9093),c=r(38954),l=r(51850),d=r(19419),u=r(11964),h=r(27921),p=r(71351),m=r(44280),f=r(32114);const v=()=>i.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function g(e=H){return{plane:(0,h.vt)(e.plane),origin:(0,l.o8)(e.origin),basis1:(0,l.o8)(e.basis1),basis2:(0,l.o8)(e.basis2)}}function _(e,t=g()){return x(e.origin,e.basis1,e.basis2,t)}function x(e,t,r,i=g()){return(0,c.c)(i.origin,e),(0,c.c)(i.basis1,t),(0,c.c)(i.basis2,r),b(i),function(e,t){Math.abs((0,c.e)(e.basis1,e.basis2)/((0,c.l)(e.basis1)*(0,c.l)(e.basis2)))>1e-6&&v().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,c.e)(e.basis1,I(e)))>1e-6&&v().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,c.e)(I(e),e.origin)-e.plane[3])>1e-6&&v().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function b(e){(0,h.mR)(e.basis2,e.basis1,e.origin,e.plane)}function w(e,t,r){e!==r&&_(e,r);const i=(0,c.g)(f.rq.get(),I(e),t);return(0,c.f)(r.origin,r.origin,i),r.plane[3]-=t,r}function y(e,t=g()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,c.i)(t.origin,e[0]+r,e[1]+i,0),(0,c.i)(t.basis1,r,0,0),(0,c.i)(t.basis2,0,i,0),(0,h.fA)(0,0,1,0,t.plane),t}function M(e,t,r){return!!(0,h.Ui)(e.plane,t,r)&&P(e,r)}function T(e,t,r){const i=N.get();F(e,t,i,N.get());let o=Number.POSITIVE_INFINITY;for(const a of z){const s=D(e,a,L.get()),l=f.rq.get();if((0,h.T7)(i,s,l)){const e=(0,c.E)(f.rq.get(),t.origin,l),i=Math.abs((0,n.XM)((0,c.e)(t.direction,e)));i<o&&(o=i,(0,c.c)(r,l))}}return o===Number.POSITIVE_INFINITY?C(e,t,r):r}function C(e,t,r){if(M(e,t,r))return r;const i=N.get(),n=N.get();F(e,t,i,n);let o=Number.POSITIVE_INFINITY;for(const a of z){const s=D(e,a,L.get()),l=f.rq.get();if((0,h.gv)(i,s,l)){const e=(0,p.kb)(t,l);if(!(0,h.Tj)(n,l))continue;e<o&&(o=e,(0,c.c)(r,l))}}return A(e,t.origin)<o&&S(e,t.origin,r),r}function S(e,t,r){const i=(0,h._I)(e.plane,t,f.rq.get()),n=(0,u.H6)(O(e,e.basis1),i,-1,1,f.rq.get()),o=(0,u.H6)(O(e,e.basis2),i,-1,1,f.rq.get());return(0,c.d)(r,(0,c.f)(f.rq.get(),n,o),e.origin),r}function E(e,t,r){const{origin:i,basis1:n,basis2:o}=e,a=(0,c.d)(f.rq.get(),t,i),s=(0,m.gr)(n,a),l=(0,m.gr)(o,a),d=(0,m.gr)(I(e),a);return(0,c.i)(r,s,l,d)}function A(e,t){const r=E(e,t,f.rq.get()),{basis1:i,basis2:n}=e,o=(0,c.l)(i),a=(0,c.l)(n),s=Math.max(Math.abs(r[0])-o,0),l=Math.max(Math.abs(r[1])-a,0),d=r[2];return s*s+l*l+d*d}function R(e,t){const r=-e.plane[3];return(0,m.gr)(I(e),t)-r}function I(e){return(0,h.Qj)(e.plane)}function P(e,t){const r=(0,c.d)(f.rq.get(),t,e.origin),i=(0,c.k)(e.basis1),n=(0,c.k)(e.basis2),o=(0,c.e)(e.basis1,r),a=(0,c.e)(e.basis2,r);return-o-i<0&&o-i<0&&-a-n<0&&a-n<0}function O(e,t){const r=L.get();return(0,c.c)(r.origin,e.origin),(0,c.c)(r.vector,t),r}function D(e,t,r){const{basis1:i,basis2:n,origin:o}=e,a=(0,c.g)(f.rq.get(),i,t.origin[0]),s=(0,c.g)(f.rq.get(),n,t.origin[1]);(0,c.f)(r.origin,a,s),(0,c.f)(r.origin,r.origin,o);const l=(0,c.g)(f.rq.get(),i,t.direction[0]),d=(0,c.g)(f.rq.get(),n,t.direction[1]);return(0,c.g)(r.vector,(0,c.f)(l,l,d),2),r}function F(e,t,r,i){const n=I(e);(0,h.mR)(n,t.direction,t.origin,r),(0,h.mR)((0,h.Qj)(r),n,t.origin,i)}const H={plane:(0,h.vt)(),origin:(0,l.fA)(0,0,0),basis1:(0,l.fA)(1,0,0),basis2:(0,l.fA)(0,1,0)},N=new o.I(h.vt),L=new o.I(u.vt),B=(0,l.vt)(),G=new o.I(()=>g()),z=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],U=(0,s.vt)(),V=(0,s.vt)(),j=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:class{constructor(){this.plane=(0,h.vt)(),this.origin=(0,l.vt)(),this.basis1=(0,l.vt)(),this.basis2=(0,l.vt)()}},altitudeAt:R,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case 0:(0,c.c)(r,e.basis1),(0,c.n)(r,r);break;case 1:(0,c.c)(r,e.basis2),(0,c.n)(r,r);break;case 2:(0,c.c)(r,I(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:C,closestPointOnSilhouette:T,copy:_,copyWithoutVerify:function(e,t){(0,c.c)(t.origin,e.origin),(0,c.c)(t.basis1,e.basis1),(0,c.c)(t.basis2,e.basis2),(0,h.C)(t.plane,e.plane)},create:g,distance:function(e,t){return Math.sqrt(A(e,t))},distance2:A,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of z){const n=D(e,i,L.get()),o=(0,u.kb)(n,t);o>r&&(r=o)}return Math.sqrt(r)},elevate:w,equals:function(e,t){return(0,c.q)(e.basis1,t.basis1)&&(0,c.q)(e.basis2,t.basis2)&&(0,c.q)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,h.Tj)(e.plane,t)&&P(e,t)},fromAABoundingRect:y,fromValues:x,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[n,o]=e.origin;return(0,d.fA)(n-r,o-i,n+r,o+i,t)},intersectRay:M,intersectRayClosestSilhouette:function(e,t,r){if(M(e,t,r))return r;const i=T(e,t,f.rq.get());return(0,c.f)(r,t.origin,(0,c.g)(f.rq.get(),t.direction,(0,c.j)(t.origin,i)/(0,c.l)(t.direction))),r},normal:I,projectPoint:S,projectPointLocal:E,rotate:function(e,t,r,i){return e!==i&&_(e,i),(0,a.$0)(V,t,r),(0,c.t)(i.basis1,e.basis1,V),(0,c.t)(i.basis2,e.basis2,V),b(i),i},setAltitudeAt:function(e,t,r,i){const n=R(e,t),o=(0,c.g)(B,I(e),r-n);return(0,c.f)(i,t,o),i},setExtent:function(e,t,r){return y(t,r),w(r,R(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&_(e,r),(0,a.B8)(U,t),(0,a.mg)(U,U),(0,c.t)(r.basis1,e.basis1,U),(0,c.t)(r.basis2,e.basis2,U),(0,c.t)((0,h.Qj)(r.plane),(0,h.Qj)(e.plane),U),(0,c.t)(r.origin,e.origin,t),(0,h.mP)(r.plane,r.plane,r.origin),r},up:H,updateUnboundedPlane:b,wrap:function(e,t,r){const i=G.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,h.LV)(0,0,0,0),b(i),i}},Symbol.toStringTag,{value:"Module"}))},20304:(e,t,r)=>{r.d(t,{m:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",1,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},22393:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(31821);function n(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
98
98
  return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
99
99
  }`),e.code.add(i.H`float integratedRadiance(float cosTheta2, float roughness) {
100
100
  return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
@@ -150,7 +150,7 @@ return (diffuseComponent + specularComponent);
150
150
  }
151
151
  `)):e.vertex.code.add(n.H`MaskedColor applyInstanceColor(MaskedColor color) {
152
152
  return color;
153
- }`)}},25178:(e,t,r)=>{r.d(t,{yu:()=>m,Nz:()=>_,NB:()=>p,S7:()=>g});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(23205),c=r(40710),l=r(33094),d=r(74333);class u extends d.n{constructor(e,t,r){super(e,"mat4",0,(i,n)=>i.setUniformMatrix4fv(e,t(n),r))}}class h extends d.n{constructor(e,t,r){super(e,"mat4",2,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new c.W("cameraPosition",(e,t)=>(0,o.i)(v,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2])))}function p(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new u("proj",e=>e.camera.projectionMatrix),new h("view",(e,t)=>(0,i.Tl)(f,t.camera.viewMatrix,e.origin)),new c.W("localOrigin",e=>e.origin));const r=({camera:e})=>(0,o.i)(v,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(new u("proj",e=>e.camera.projectionMatrix),new u("view",e=>(0,i.Tl)(f,e.camera.viewMatrix,r(e))),new s.d("localOrigin",e=>r(e)))}const f=(0,n.vt)(),v=(0,a.vt)();function g(e){e.uniforms.add(new u("viewNormal",e=>e.camera.viewInverseTransposeMatrix))}function _(e){e.uniforms.add(new l.U("pixelRatio",e=>e.camera.pixelRatio/e.overlayStretch))}},25634:(e,t,r)=>{r.d(t,{m8:()=>s,NV:()=>l});var i=r(97768),n=r(74887);class o{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return 2}}var a=r(65786);class s extends o{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),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(){super.dispose(),this._texture=(0,i.Gz)(this._texture),this._textureNormal=(0,i.Gz)(this._textureNormal),this._textureEmissive=(0,i.Gz)(this._textureEmissive),this._textureOcclusion=(0,i.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new l(this._texture?.glTexture??null,this._textureNormal?.glTexture??null,this._textureEmissive?.glTexture??null,this._textureOcclusion?.glTexture??null,this._textureMetallicRoughness?.glTexture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,n.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,i.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class c extends a.Y{constructor(e=null){super(),this.textureEmissive=e}}class l extends c{constructor(e,t,r,i,n,o,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=a}}},26425:(e,t,r)=>{r.d(t,{u:()=>o});var i=r(33094),n=r(31821);function o({code:e,uniforms:t},r){t.add(new i.U("dpDummy",()=>1)),e.add(n.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
153
+ }`)}},25178:(e,t,r)=>{r.d(t,{yu:()=>p,Nz:()=>_,NB:()=>m,S7:()=>g});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(23205),c=r(40710),l=r(33094),d=r(74333);class u extends d.n{constructor(e,t,r){super(e,"mat4",0,(i,n)=>i.setUniformMatrix4fv(e,t(n),r))}}class h extends d.n{constructor(e,t,r){super(e,"mat4",2,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}function p(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new c.W("cameraPosition",(e,t)=>(0,o.i)(v,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 u("proj",e=>e.camera.projectionMatrix),new h("view",(e,t)=>(0,i.Tl)(f,t.camera.viewMatrix,e.origin)),new c.W("localOrigin",e=>e.origin));const r=({camera:e})=>(0,o.i)(v,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(new u("proj",e=>e.camera.projectionMatrix),new u("view",e=>(0,i.Tl)(f,e.camera.viewMatrix,r(e))),new s.d("localOrigin",e=>r(e)))}const f=(0,n.vt)(),v=(0,a.vt)();function g(e){e.uniforms.add(new u("viewNormal",e=>e.camera.viewInverseTransposeMatrix))}function _(e){e.uniforms.add(new l.U("pixelRatio",e=>e.camera.pixelRatio/e.overlayStretch))}},25634:(e,t,r)=>{r.d(t,{m8:()=>s,NV:()=>l});var i=r(97768),n=r(74887);class o{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return 2}}var a=r(65786);class s extends o{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),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(){super.dispose(),this._texture=(0,i.Gz)(this._texture),this._textureNormal=(0,i.Gz)(this._textureNormal),this._textureEmissive=(0,i.Gz)(this._textureEmissive),this._textureOcclusion=(0,i.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new l(this._texture?.glTexture??null,this._textureNormal?.glTexture??null,this._textureEmissive?.glTexture??null,this._textureOcclusion?.glTexture??null,this._textureMetallicRoughness?.glTexture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,n.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,i.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class c extends a.Y{constructor(e=null){super(),this.textureEmissive=e}}class l extends c{constructor(e,t,r,i,n,o,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=a}}},26425:(e,t,r)=>{r.d(t,{u:()=>o});var i=r(33094),n=r(31821);function o({code:e,uniforms:t},r){t.add(new i.U("dpDummy",()=>1)),e.add(n.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
154
154
  vec3 hiD = hiA + hiB;
155
155
  vec3 loD = loA + loB;
156
156
  return dpDummy * hiD + loD;
@@ -194,7 +194,7 @@ return dpDummy * hiD + loD;
194
194
  // multiply or tint (or something invalid)
195
195
  return allMixed;
196
196
  }
197
- `)}},27993:(e,t,r)=>{r.d(t,{F:()=>o}),r(98988);var i=r(16930),n=r(65806);function o(e,t,r,i,o){return!(null==t||null==i||e.length<2)&&(a.x=e[0],a.y=e[1],a.z=e[2],a.spatialReference=t,(0,n.g)(a,r,i,o))}const a={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:i.A.WGS84,type:"point"}},28421:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",2,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},28491:(e,t,r)=>{r.d(t,{D:()=>j,b:()=>V});var i=r(46686),n=r(32680),o=r(49255),a=r(76591),s=r(76597),c=r(24321),l=r(60864),d=r(43519),u=r(96336),h=r(71955),m=r(53466),p=r(92700),f=r(72824),v=r(35640),g=r(40261),_=r(77695),x=r(14527),b=r(89390),w=r(98619),y=r(62602),M=r(22393),T=r(59469),C=r(39168),S=r(96598),E=r(51406),A=r(42398),R=r(58614),I=r(27950),P=r(25178),F=r(33079),O=r(71988),D=r(20304),H=r(31821),N=r(63761),L=r(10906),B=r(43616),G=r(59744),z=r(14113),U=r(49788);function V(e){const t=new z.N5,{attributes:r,vertex:V,fragment:j,varyings:W}=t,{output:k,normalType:$,offsetBackfaces:q,spherical:Z,receiveShadows:Y,snowCover:X,pbrMode:J,textureAlphaPremultiplied:K,instancedDoublePrecision:Q,hasVertexColors:ee,hasVertexTangents:te,hasColorTexture:re,hasNormalTexture:ie,hasNormalTextureTransform:ne,hasColorTextureTransform:oe,hasBloom:ae}=e;if((0,P.NB)(V,e),r.add("position","vec3"),W.add("vpos","vec3",{invariant:!0}),t.include(A.A,e),t.include(l.B,e),t.include(v.Ge,e),t.include(E.q2,e),!(0,o.RN)(k))return t.include(g.E,e),t;t.include(E.Sx,e),t.include(E.MU,e),t.include(E.O1,e),t.include(E.QM,e),(0,P.yu)(V,e),t.include(u.Y,e),t.include(s.d,e);const se=0===$||1===$;return se&&q&&t.include(n.M),t.include(_.W,e),t.include(f.Mh,e),t.include(c.v,e),W.add("vPositionLocal","vec3"),t.include(m.U,e),t.include(i.oD,e),t.include(h.K,e),t.include(p.c,e),V.uniforms.add(new O.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),W.add("vcolorExt","vec4"),t.include(S.Z,e),V.include(d.WD),V.include(d.oF),V.main.add(H.H`
197
+ `)}},27993:(e,t,r)=>{r.d(t,{F:()=>o}),r(98988);var i=r(16930),n=r(65806);function o(e,t,r,i,o){return!(null==t||null==i||e.length<2)&&(a.x=e[0],a.y=e[1],a.z=e[2],a.spatialReference=t,(0,n.g)(a,r,i,o))}const a={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:i.A.WGS84,type:"point"}},28421:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",2,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},28491:(e,t,r)=>{r.d(t,{D:()=>V,b:()=>U});var i=r(32680),n=r(49255),o=r(76591),a=r(76597),s=r(24321),c=r(60864),l=r(43519),d=r(96336),u=r(71955),h=r(53466),p=r(92700),m=r(72824),f=r(35640),v=r(40261),g=r(77695),_=r(14527),x=r(89390),b=r(98619),w=r(62602),y=r(22393),M=r(59469),T=r(32482),C=r(96598),S=r(51406),E=r(42398),A=r(58614),R=r(27950),I=r(25178),P=r(33079),O=r(71988),D=r(20304),F=r(31821),H=r(63761),N=r(10906),L=r(43616),B=r(59744),G=r(14113),z=r(49788);function U(e){const t=new G.N5,{attributes:r,vertex:U,fragment:V,varyings:j}=t,{output:W,normalType:k,offsetBackfaces:$,spherical:q,snowCover:Z,pbrMode:Y,textureAlphaPremultiplied:X,instancedDoublePrecision:J,hasVertexColors:K,hasVertexTangents:Q,hasColorTexture:ee,hasNormalTexture:te,hasNormalTextureTransform:re,hasColorTextureTransform:ie,hasBloom:ne}=e;if((0,I.NB)(U,e),r.add("position","vec3"),j.add("vpos","vec3",{invariant:!0}),t.include(E.A,e),t.include(c.B,e),t.include(f.Ge,e),t.include(S.q2,e),!(0,n.RN)(W))return t.include(v.E,e),t;t.include(S.Sx,e),t.include(S.MU,e),t.include(S.O1,e),t.include(S.QM,e),(0,I.yu)(U,e),t.include(d.Y,e),t.include(a.d,e);const oe=0===k||1===k;return oe&&$&&t.include(i.M),t.include(g.W,e),t.include(m.Mh,e),t.include(s.v,e),j.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(u.K,e),t.include(p.c,e),U.uniforms.add(new O.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),j.add("vcolorExt","vec4"),t.include(C.Z,e),U.include(l.WD),U.include(l.oF),t.include(J?T.G:T.Bz,e),U.main.add(F.H`
198
198
  forwardNormalizedVertexColor();
199
199
 
200
200
  MaskedColor maskedColorExt =
@@ -206,14 +206,13 @@ return dpDummy * hiD + loD;
206
206
  vpos = getVertexInLocalOriginSpace();
207
207
  vPositionLocal = vpos - view[3].xyz;
208
208
  vpos = subtractOrigin(vpos);
209
- ${(0,H.If)(se,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
209
+ ${(0,F.If)(oe,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
210
210
  vpos = addVerticalOffset(vpos, localOrigin);
211
- ${(0,H.If)(te,"vTangent = dpTransformVertexTangent(tangent);")}
211
+ ${(0,F.If)(Q,"vTangent = dpTransformVertexTangent(tangent);")}
212
212
  gl_Position = transformPosition(proj, view, vpos);
213
- ${(0,H.If)(se&&q,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
213
+ ${(0,F.If)(oe&&$,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
214
214
 
215
215
  forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
216
- forwardLinearDepth();
217
216
  forwardTextureCoordinates();
218
217
  forwardColorUV();
219
218
  forwardNormalUV();
@@ -221,35 +220,36 @@ return dpDummy * hiD + loD;
221
220
  forwardOcclusionUV();
222
221
  forwardMetallicRoughnessUV();
223
222
 
224
- if (opacityMixMode != ${H.H.int(B.Um.ignore)} && vcolorExt.a < ${H.H.float(U.Q)}) {
223
+ if (opacityMixMode != ${F.H.int(L.Um.ignore)} && vcolorExt.a < ${F.H.float(z.Q)}) {
225
224
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
226
225
  }
227
- `),t.include(b.kA,e),j.include(x.n,e),t.include(R.S,e),t.include(Q?C.G:C.Bz,e),j.include(a.HQ,e),t.include(G.z,e),(0,P.yu)(j,e),j.uniforms.add(V.uniforms.get("localOrigin"),new F.t("ambient",e=>e.ambient),new F.t("diffuse",e=>e.diffuse),new D.m("opacity",e=>e.opacity),new D.m("layerOpacity",e=>e.layerOpacity)),re&&j.uniforms.add(new N.N("tex",e=>e.texture)),t.include(T._,e),j.include(M.c,e),j.include(I.N),t.include(y.r,e),j.include(L.b,e),(0,b.a8)(j),(0,b.eU)(j),(0,w.O4)(j),j.main.add(H.H`
226
+ forwardLinearDepthToReadShadowMap();
227
+ `),t.include(x.kA,e),V.include(_.n,e),t.include(A.S,e),V.include(o.HQ,e),t.include(B.z,e),(0,I.yu)(V,e),V.uniforms.add(U.uniforms.get("localOrigin"),new P.t("ambient",e=>e.ambient),new P.t("diffuse",e=>e.diffuse),new D.m("opacity",e=>e.opacity),new D.m("layerOpacity",e=>e.layerOpacity)),ee&&V.uniforms.add(new H.N("tex",e=>e.texture)),t.include(M._,e),V.include(y.c,e),V.include(R.N),t.include(w.r,e),V.include(N.b,e),(0,x.a8)(V),(0,x.eU)(V),(0,b.O4)(V),V.main.add(F.H`
228
228
  discardBySlice(vpos);
229
229
  discardByTerrainDepth();
230
- ${re?H.H`
231
- vec4 texColor = texture(tex, ${oe?"colorUV":"vuv0"});
232
- ${(0,H.If)(K,"texColor.rgb /= texColor.a;")}
233
- discardOrAdjustAlpha(texColor);`:H.H`vec4 texColor = vec4(1.0);`}
230
+ ${ee?F.H`
231
+ vec4 texColor = texture(tex, ${ie?"colorUV":"vuv0"});
232
+ ${(0,F.If)(X,"texColor.rgb /= texColor.a;")}
233
+ discardOrAdjustAlpha(texColor);`:F.H`vec4 texColor = vec4(1.0);`}
234
234
  shadingParams.viewDirection = normalize(vpos - cameraPosition);
235
- ${2===$?H.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:H.H`shadingParams.normalView = vNormalWorld;
235
+ ${2===k?F.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:F.H`shadingParams.normalView = vNormalWorld;
236
236
  vec3 normal = shadingNormal(shadingParams);`}
237
237
  applyPBRFactors();
238
238
  float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
239
239
 
240
240
  vec3 posWorld = vpos + localOrigin;
241
241
 
242
- float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
243
- float shadow = ${Y?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,H.If)(Z,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
242
+ float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
243
+ float shadow = readShadow(additionalAmbientScale, vpos);
244
244
 
245
245
  vec3 matColor = max(ambient, diffuse);
246
- vec3 albedo = mixExternalColor(${(0,H.If)(ee,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
247
- float opacity_ = layerOpacity * mixExternalOpacity(${(0,H.If)(ee,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
246
+ vec3 albedo = mixExternalColor(${(0,F.If)(K,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
247
+ float opacity_ = layerOpacity * mixExternalOpacity(${(0,F.If)(K,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
248
248
 
249
- ${ie?`mat3 tangentSpace = computeTangentSpace(${te?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${ne?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
250
- vec3 normalGround = ${Z?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
249
+ ${te?`mat3 tangentSpace = computeTangentSpace(${Q?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${re?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
250
+ vec3 normalGround = ${q?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
251
251
 
252
- ${(0,H.If)(X,H.H`
252
+ ${(0,F.If)(Z,F.H`
253
253
  float snow = getSnow(normal, normalGround);
254
254
  albedo = mix(albedo, vec3(1), snow);
255
255
  shadingNormal = mix(shadingNormal, normal, snow);
@@ -257,44 +257,59 @@ return dpDummy * hiD + loD;
257
257
 
258
258
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
259
259
 
260
- ${1===J||2===J?H.H`
260
+ ${1===Y||2===Y?F.H`
261
261
  float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
262
- vec4 emission = ${ae?"vec4(0.0)":"getEmissions(albedo)"};
263
- ${(0,H.If)(X,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}
264
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:H.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
262
+ vec4 emission = ${ne?"vec4(0.0)":"getEmissions(albedo)"};
263
+ ${(0,F.If)(Z,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}
264
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:F.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
265
265
  vec4 finalColor = vec4(shadedColor, opacity_);
266
- outputColorHighlightOID(finalColor, vpos, albedo ${(0,H.If)(X,", snow")});
267
- `),t}const j=Object.freeze(Object.defineProperty({__proto__:null,build:V},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(15142),n=r(38954),o=r(51850),a=r(620);class s{get center(){return(0,o.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,o.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,o.fA)(this._data[7],this._data[8],this._data[9])}constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:l}=r;(0,a.vA)(l.length%this._numIndexPerPrimitive===0),(0,a.vA)(l.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*l[this._numIndexPerPrimitive*e[0]];c.clear(),c.push(u);const h=(0,o.fA)(i[u],i[u+1],i[u+2]),m=(0,o.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*l[r+e],c.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}for(let e=0;e<3;++e)this._data[4+e]=h[e],this._data[7+e]=m[e];const p=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5);let f=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]),v=f*f;for(let e=0;e<c.length;++e){u=c.at(e);const t=i[u]-p[0],r=i[u+1]-p[1],n=i[u+2]-p[2],o=t*t+r*r+n*n;if(o<=v)continue;const a=Math.sqrt(o),s=.5*(a-f);f+=s,v=f*f;const l=s/a;p[0]+=t*l,p[1]+=r*l,p[2]+=n*l}this._data[3]=f;for(let e=0;e<3;++e)this._data[0+e]=p[e];c.clear()}getChildren(){if(this._children||(0,n.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,n.m)((0,o.vt)(),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:a,size:c,indices:l}=this.position;for(let n=0;n<t;++n){let t=0;const o=this._numIndexPerPrimitive*this.primitiveIndices[n];let s=c*l[o],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=c*l[o+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[n]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[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];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){c.prune()}}const c=new i.A({deallocator:null})},31821:(e,t,r)=>{function i(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}function n(e,t,r=""){return e?t:r}r.d(t,{H:()=>i,If:()=>n}),function(e){e.int=function(e){return Math.round(e).toString()},e.float=function(e){return e.toPrecision(8)}}(i||(i={}))},32680:(e,t,r)=>{r.d(t,{M:()=>n});var i=r(31821);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
266
+ outputColorHighlightOID(finalColor, vpos, albedo ${(0,F.If)(Z,", snow")});
267
+ `),t}const V=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(15142),n=r(38954),o=r(51850),a=r(620);class s{get center(){return(0,o.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,o.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,o.fA)(this._data[7],this._data[8],this._data[9])}constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:l}=r;(0,a.vA)(l.length%this._numIndexPerPrimitive===0),(0,a.vA)(l.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*l[this._numIndexPerPrimitive*e[0]];c.clear(),c.push(u);const h=(0,o.fA)(i[u],i[u+1],i[u+2]),p=(0,o.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*l[r+e],c.push(u);let t=i[u];h[0]=Math.min(t,h[0]),p[0]=Math.max(t,p[0]),t=i[u+1],h[1]=Math.min(t,h[1]),p[1]=Math.max(t,p[1]),t=i[u+2],h[2]=Math.min(t,h[2]),p[2]=Math.max(t,p[2])}}for(let e=0;e<3;++e)this._data[4+e]=h[e],this._data[7+e]=p[e];const m=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5);let f=.5*Math.max(Math.max(p[0]-h[0],p[1]-h[1]),p[2]-h[2]),v=f*f;for(let e=0;e<c.length;++e){u=c.at(e);const t=i[u]-m[0],r=i[u+1]-m[1],n=i[u+2]-m[2],o=t*t+r*r+n*n;if(o<=v)continue;const a=Math.sqrt(o),s=.5*(a-f);f+=s,v=f*f;const l=s/a;m[0]+=t*l,m[1]+=r*l,m[2]+=n*l}this._data[3]=f;for(let e=0;e<3;++e)this._data[0+e]=m[e];c.clear()}getChildren(){if(this._children||(0,n.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,n.m)((0,o.vt)(),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:a,size:c,indices:l}=this.position;for(let n=0;n<t;++n){let t=0;const o=this._numIndexPerPrimitive*this.primitiveIndices[n];let s=c*l[o],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=c*l[o+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[n]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[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];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){c.prune()}}const c=new i.A({deallocator:null})},31821:(e,t,r)=>{function i(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}function n(e,t,r=""){return e?t:r}r.d(t,{H:()=>i,If:()=>n}),function(e){e.int=function(e){return Math.round(e).toString()},e.float=function(e){return e.toPrecision(8)}}(i||(i={}))},32482:(e,t,r)=>{r.d(t,{Bz:()=>b,G:()=>x}),r(51850);var i=r(46686),n=r(49255),o=r(31821);function a(e,t){const r=(0,n.RN)(t.output)&&t.receiveShadows;r&&(0,i.o)(e,!0),e.vertex.code.add(o.H`
268
+ void forwardLinearDepthToReadShadowMap() { ${(0,o.If)(r,"forwardLinearDepth(gl_Position.w);")} }
269
+ `)}var s=r(14314),c=r(35818),l=r(74333);class d extends l.n{constructor(e,t,r,i){super(e,"mat4",2,(r,n,o,a)=>r.setUniformMatrix4fv(e,t(n,o,a),i),r)}}class u extends l.n{constructor(e,t,r,i){super(e,"mat4",1,(r,n,o)=>r.setUniformMatrix4fv(e,t(n,o),i),r)}}var h=r(65786);function p(e){e.fragment.uniforms.add(new u("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),f(e)}function m(e){e.fragment.uniforms.add(new d("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),f(e)}function f(e){const{fragment:t}=e;t.uniforms.add(new s.I("cascadeDistances",e=>e.shadowMap.cascadeDistances),new c.W("numCascades",e=>e.shadowMap.numCascades)),t.code.add(o.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
270
+ vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
271
+ vec4 lv = mat * vec4(_vpos, 1.0);
272
+ lv.xy /= lv.w;
273
+ return 0.5 * lv.xyz + vec3(0.5);
274
+ }
275
+ vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) {
276
+ float xScale = float(textureSize.y) / float(textureSize.x);
277
+ return vec2((float(i) + lvpos.x) * xScale, lvpos.y);
278
+ }
279
+ vec3 calculateUVZShadow(in vec3 _worldPos, in float _linearDepth, in ivec2 shadowMapSize) {
280
+ int i = _linearDepth < cascadeDistances[1] ? 0 : _linearDepth < cascadeDistances[2] ? 1 : _linearDepth < cascadeDistances[3] ? 2 : 3;
281
+ if (i >= numCascades) {
282
+ return invalidShadowmapUVZ;
283
+ }
284
+ mat4 shadowMatrix = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
285
+ vec3 lvpos = lightSpacePosition(_worldPos, shadowMatrix);
286
+ if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) {
287
+ return invalidShadowmapUVZ;
288
+ }
289
+ vec2 uvShadow = cascadeCoordinates(i, shadowMapSize, lvpos);
290
+ return vec3(uvShadow, lvpos.z);
291
+ }`)}function v(e){e.fragment.code.add(o.H`float readShadowMapUVZ(vec3 uvzShadow, sampler2DShadow _shadowMap) {
292
+ return texture(_shadowMap, uvzShadow);
293
+ }`)}h.Y;var g=r(33094);class _ extends l.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}function x(e,t){t.receiveShadows&&e.include(p),w(e,t)}function b(e,t){t.receiveShadows&&e.include(m),w(e,t)}function w(e,t){e.fragment.uniforms.add(new g.U("lightingGlobalFactor",e=>e.lighting.globalFactor));const{receiveShadows:r,spherical:i}=t;e.include(a,t),r&&y(e),e.fragment.code.add(o.H`
294
+ float readShadow(float additionalAmbientScale, vec3 vpos) {
295
+ return ${r?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,o.If)(i,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
296
+ }
297
+ `)}function y(e){e.include(v);const{fragment:t}=e;t.uniforms.add(new _("shadowMap",e=>e.shadowMap.depthTexture)),t.code.add(o.H`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
298
+ vec3 uvzShadow = calculateUVZShadow(_worldPos, _linearDepth, textureSize(shadowMap,0));
299
+ if (uvzShadow.z < 0.0) {
300
+ return 0.0;
301
+ }
302
+ return readShadowMapUVZ(uvzShadow, shadowMap);
303
+ }`)}h.Y},32680:(e,t,r)=>{r.d(t,{M:()=>n});var i=r(31821);function n(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
268
304
  vec3 camToVert = posWorld - camPosWorld;
269
305
  bool isBackface = dot(camToVert, normalWorld) > 0.0;
270
306
  if (isBackface) {
271
307
  posClip.z += 0.0000003 * posClip.w;
272
308
  }
273
309
  return posClip;
274
- }`)}},32976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"bool",0,(r,i)=>r.setUniform1b(e,t(i)))}}},33079:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",1,(i,n,o)=>i.setUniform3fv(e,t(n,o),r))}}},33094:(e,t,r)=>{r.d(t,{U:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",0,(i,n)=>i.setUniform1f(e,t(n),r))}}},33524:(e,t,r)=>{r.d(t,{K_:()=>m,Yf:()=>c,ez:()=>s,m6:()=>p,mE:()=>h,xt:()=>d,z5:()=>l});var i=r(49255),n=r(63907),o=r(90644);const a=(0,o.p3)(1,0,1,771);function s(e){return 2===e?null:a}function c(e){switch(e){case 0:return o.T8;case 1:return a;case 2:case 3:return null}}function l(e){if(e.draped)return null;switch(e.oitPass){case 0:case 2:return e.writeDepth?o.Uy:null;case 1:case 3:return null}}const d=5e5,u={factor:-1,units:-2};function h({oitPass:e,enableOffset:t}){return t&&1===e?u:null}function m(e,t=513){return 0===e||2===e?t:515}function p(e,t){const r=(0,i.LG)(t);return 1===e?r?{buffers:[n.r6,n.yI,n.Fq]}:{buffers:[n.r6,n.yI]}:r?{buffers:[n.r6,n.yI]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>v,dO:()=>f,em:()=>p});var i=r(29242),n=r(9093),o=r(51850),a=r(26425),s=r(40710),c=r(33079),l=r(31821),d=r(98353),u=r(35644),h=r(40095),m=r(65786);function p(e,t){const{attributes:r,vertex:i,varyings:n,fragment:o}=e;i.include(a.u,t),r.add("position","vec3"),n.add("vPositionWorldCameraRelative","vec3"),n.add("vPosition_view","vec3",{invariant:!0}),i.uniforms.add(new c.t("transformWorldFromViewTH",e=>e.transformWorldFromViewTH),new c.t("transformWorldFromViewTL",e=>e.transformWorldFromViewTL),new u.k("transformViewFromCameraRelativeRS",e=>e.transformViewFromCameraRelativeRS),new h.X("transformProjFromView",e=>e.transformProjFromView),new d.h("transformWorldFromModelRS",e=>e.transformWorldFromModelRS),new s.W("transformWorldFromModelTH",e=>e.transformWorldFromModelTH),new s.W("transformWorldFromModelTL",e=>e.transformWorldFromModelTL)),i.code.add(l.H`vec3 positionWorldCameraRelative() {
275
- vec3 rotatedModelPosition = transformWorldFromModelRS * position;
276
- vec3 transform_CameraRelativeFromModel = dpAdd(
277
- transformWorldFromModelTL,
278
- transformWorldFromModelTH,
279
- -transformWorldFromViewTL,
280
- -transformWorldFromViewTH
281
- );
282
- return transform_CameraRelativeFromModel + rotatedModelPosition;
283
- }`),i.code.add(l.H`
284
- void forwardPosition(float fOffset) {
285
- vPositionWorldCameraRelative = positionWorldCameraRelative();
286
- if (fOffset != 0.0) {
287
- vPositionWorldCameraRelative += fOffset * ${t.spherical?l.H`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:l.H`vec3(0.0, 0.0, 1.0)`};
288
- }
289
-
290
- vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
291
- gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
292
- }
293
- `),o.uniforms.add(new c.t("transformWorldFromViewTL",e=>e.transformWorldFromViewTL)),i.code.add(l.H`vec3 positionWorld() {
294
- return transformWorldFromViewTL + vPositionWorldCameraRelative;
295
- }`),o.code.add(l.H`vec3 positionWorld() {
296
- return transformWorldFromViewTL + vPositionWorldCameraRelative;
297
- }`)}class f extends m.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,o.vt)(),this.transformWorldFromViewTL=(0,o.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)(),this.transformProjFromView=(0,n.vt)()}}class v extends m.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,o.vt)(),this.transformWorldFromModelTL=(0,o.vt)()}}},34845:(e,t,r)=>{r.d(t,{Ir:()=>d});var i=r(37585),n=r(48163),o=r(87317),a=r(91829),s=r(77108),c=r(14314),l=r(31821);function d(e){e.fragment.uniforms.add(new c.I("projInfo",e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,o.s)(u,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,o.s)(u,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera))),e.fragment.uniforms.add(new s.E("zScale",e=>0===e.camera.projectionMatrix[11]?(0,i.hZ)(h,0,1):(0,i.hZ)(h,1,0))),e.fragment.code.add(l.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
310
+ }`)}},32976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"bool",0,(r,i)=>r.setUniform1b(e,t(i)))}}},33079:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",1,(i,n,o)=>i.setUniform3fv(e,t(n,o),r))}}},33094:(e,t,r)=>{r.d(t,{U:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",0,(i,n)=>i.setUniform1f(e,t(n),r))}}},33120:(e,t,r)=>{r.d(t,{i$:()=>a,xJ:()=>o}),r(46686),r(33752);var i=r(77108),n=r(31821);function o(e){e.vertex.uniforms.add(new i.E("nearFar",e=>e.camera.nearFar))}function a(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
311
+ return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
312
+ }`)}},33524:(e,t,r)=>{r.d(t,{K_:()=>p,Yf:()=>c,ez:()=>s,m6:()=>m,mE:()=>h,xt:()=>d,z5:()=>l});var i=r(49255),n=r(63907),o=r(90644);const a=(0,o.p3)(1,0,1,771);function s(e){return 2===e?null:a}function c(e){switch(e){case 0:return o.T8;case 1:return a;case 2:case 3:return null}}function l(e){if(e.draped)return null;switch(e.oitPass){case 0:case 2:return e.writeDepth?o.Uy:null;case 1:case 3:return null}}const d=5e5,u={factor:-1,units:-2};function h({oitPass:e,enableOffset:t}){return t&&1===e?u:null}function p(e,t=513){return 0===e||2===e?t:515}function m(e,t){const r=(0,i.LG)(t);return 1===e?r?{buffers:[n.r6,n.yI,n.Fq]}:{buffers:[n.r6,n.yI]}:r?{buffers:[n.r6,n.yI]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>c,dO:()=>s});var i=r(29242),n=r(9093),o=r(51850),a=(r(26425),r(40710),r(33079),r(31821),r(98353),r(35644),r(40095),r(65786));class s extends a.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,o.vt)(),this.transformWorldFromViewTL=(0,o.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)(),this.transformProjFromView=(0,n.vt)()}}class c extends a.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,o.vt)(),this.transformWorldFromModelTL=(0,o.vt)()}}},34845:(e,t,r)=>{r.d(t,{Ir:()=>d});var i=r(37585),n=r(48163),o=r(87317),a=r(91829),s=r(77108),c=r(14314),l=r(31821);function d(e){e.fragment.uniforms.add(new c.I("projInfo",e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,o.s)(u,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,o.s)(u,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera))),e.fragment.uniforms.add(new s.E("zScale",e=>0===e.camera.projectionMatrix[11]?(0,i.hZ)(h,0,1):(0,i.hZ)(h,1,0))),e.fragment.code.add(l.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
298
313
  return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
299
314
  }`)}const u=(0,a.vt)(),h=(0,n.vt)()},35256:(e,t,r)=>{r.d(t,{E:()=>a});var i=r(31635),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}class a extends o{constructor(){super(...arguments),this.output=0,this.oitPass=0,this.hasSlicePlane=!1,this.hasHighlightMixTexture=!1,this.bindType=1,this.writeDepth=!0}}(0,i.Cg)([(0,n.W)({count:10})],a.prototype,"output",void 0),(0,i.Cg)([(0,n.W)({count:3})],a.prototype,"oitPass",void 0),(0,i.Cg)([(0,n.W)()],a.prototype,"hasSlicePlane",void 0),(0,i.Cg)([(0,n.W)()],a.prototype,"hasHighlightMixTexture",void 0)},35640:(e,t,r)=>{r.d(t,{Ge:()=>l,VQ:()=>u});var i=r(87317),n=r(91829),o=r(52587),a=r(25178),s=r(71988),c=r(31821);function l(e,t){const r=e.vertex;t.hasVerticalOffset?(u(r),t.hasScreenSizePerspective&&(e.include(o.Y6),(0,o.OH)(r),(0,a.yu)(e.vertex,t)),r.code.add(c.H`
300
315
  vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
@@ -317,37 +332,7 @@ return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale
317
332
  objectAndLayerIdColorVarying = ${r?"instanceObjectAndLayerIdColor":"objectAndLayerIdColor"} * 0.003921568627451;
318
333
  }`),e.fragment.code.add(i.H`void outputObjectAndLayerIdColor() {
319
334
  fragColor = objectAndLayerIdColorVarying;
320
- }`)}},38969:(e,t,r)=>{r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},39168:(e,t,r)=>{r.d(t,{Bz:()=>v,G:()=>f}),r(51850);var i=r(14314),n=r(31821),o=r(35818),a=r(74333);class s extends a.n{constructor(e,t,r,i){super(e,"mat4",2,(r,n,o,a)=>r.setUniformMatrix4fv(e,t(n,o,a),i),r)}}class c extends a.n{constructor(e,t,r,i){super(e,"mat4",1,(r,n,o)=>r.setUniformMatrix4fv(e,t(n,o),i),r)}}var l=r(65786);function d(e){e.fragment.uniforms.add(new c("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),h(e)}function u(e){e.fragment.uniforms.add(new s("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),h(e)}function h(e){const{fragment:t}=e;t.uniforms.add(new i.I("cascadeDistances",e=>e.shadowMap.cascadeDistances),new o.W("numCascades",e=>e.shadowMap.numCascades)),t.code.add(n.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
321
- vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
322
- vec4 lv = mat * vec4(_vpos, 1.0);
323
- lv.xy /= lv.w;
324
- return 0.5 * lv.xyz + vec3(0.5);
325
- }
326
- vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) {
327
- float xScale = float(textureSize.y) / float(textureSize.x);
328
- return vec2((float(i) + lvpos.x) * xScale, lvpos.y);
329
- }
330
- vec3 calculateUVZShadow(in vec3 _worldPos, in float _linearDepth, in ivec2 shadowMapSize) {
331
- int i = _linearDepth < cascadeDistances[1] ? 0 : _linearDepth < cascadeDistances[2] ? 1 : _linearDepth < cascadeDistances[3] ? 2 : 3;
332
- if (i >= numCascades) {
333
- return invalidShadowmapUVZ;
334
- }
335
- mat4 shadowMatrix = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
336
- vec3 lvpos = lightSpacePosition(_worldPos, shadowMatrix);
337
- if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) {
338
- return invalidShadowmapUVZ;
339
- }
340
- vec2 uvShadow = cascadeCoordinates(i, shadowMapSize, lvpos);
341
- return vec3(uvShadow, lvpos.z);
342
- }`)}function m(e){e.fragment.code.add(n.H`float readShadowMapUVZ(vec3 uvzShadow, sampler2DShadow _shadowMap) {
343
- return texture(_shadowMap, uvzShadow);
344
- }`)}l.Y;class p extends a.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}function f(e,t){t.receiveShadows&&(e.include(d),g(e))}function v(e,t){t.receiveShadows&&(e.include(u),g(e))}function g(e){e.include(m);const{fragment:t}=e;t.uniforms.add(new p("shadowMap",e=>e.shadowMap.depthTexture)),t.code.add(n.H`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
345
- vec3 uvzShadow = calculateUVZShadow(_worldPos, _linearDepth, textureSize(shadowMap,0));
346
- if (uvzShadow.z < 0.0) {
347
- return 0.0;
348
- }
349
- return readShadowMapUVZ(uvzShadow, shadowMap);
350
- }`)}l.Y},39341:(e,t,r)=>{r.d(t,{D:()=>i});const i=new Map([["position",0],["normal",1],["normalCompressed",1],["uv0",2],["uvi",2],["color",3],["colorFeatureAttribute",3],["size",4],["tangent",4],["centerOffsetAndDistance",5],["symbolColor",5],["featureAttribute",6],["instanceFeatureAttribute",6],["objectAndLayerIdColor",6],["instanceObjectAndLayerIdColor",6],["instanceColor",7],["rotation",8],["instanceModel",8],["instanceModelNormal",12],["instanceModelOriginHi",11],["instanceModelOriginLo",15]])},40095:(e,t,r)=>{r.d(t,{X:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat4",1,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}},40261:(e,t,r)=>{r.d(t,{E:()=>g});var i=r(46686),n=r(76591),o=r(76597),a=r(96336),s=r(36782),c=r(53466),l=r(72824),d=r(31821);function u(e,t){switch(t.output){case 4:case 5:case 6:case 7:e.fragment.code.add(d.H`float _calculateFragDepth(const in float depth) {
335
+ }`)}},38969:(e,t,r)=>{r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},39341:(e,t,r)=>{r.d(t,{D:()=>i});const i=new Map([["position",0],["normal",1],["normalCompressed",1],["uv0",2],["uvi",2],["color",3],["colorFeatureAttribute",3],["size",4],["tangent",4],["centerOffsetAndDistance",5],["symbolColor",5],["featureAttribute",6],["instanceFeatureAttribute",6],["objectAndLayerIdColor",6],["instanceObjectAndLayerIdColor",6],["instanceColor",7],["rotation",8],["instanceModel",8],["instanceModelNormal",12],["instanceModelOriginHi",11],["instanceModelOriginLo",15]])},40095:(e,t,r)=>{r.d(t,{X:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat4",1,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}},40261:(e,t,r)=>{r.d(t,{E:()=>g});var i=r(33120),n=r(76591),o=r(76597),a=r(96336),s=r(36782),c=r(53466),l=r(72824),d=r(31821);function u(e,t){switch(t.output){case 4:case 5:case 6:case 7:e.fragment.code.add(d.H`float _calculateFragDepth(const in float depth) {
351
336
  const float SLOPE_SCALE = 2.0;
352
337
  const float BIAS = 20.0 * .000015259;
353
338
  float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
@@ -356,29 +341,29 @@ return depth + SLOPE_SCALE * m + BIAS;
356
341
  void outputDepth(float _linearDepth){
357
342
  float fragDepth = _calculateFragDepth(_linearDepth);
358
343
  gl_FragDepth = fragDepth;
359
- }`)}}var h=r(42593),m=r(42398),p=r(58614),f=r(25178),v=r(63761);function g(e,t){const{vertex:r,fragment:g,varyings:_}=e,{hasColorTexture:x,alphaDiscardMode:b}=t,w=x&&1!==b,{output:y,normalType:M,hasColorTextureTransform:T}=t;switch(y){case 2:(0,f.NB)(r,t),e.include(o.d,t),g.include(n.HQ,t),e.include(c.U,t),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
344
+ }`)}}var h=r(42593),p=r(42398),m=r(58614),f=r(25178),v=r(63761);function g(e,t){const{vertex:r,fragment:g,varyings:_}=e,{hasColorTexture:x,alphaDiscardMode:b}=t,w=x&&1!==b,{output:y,normalType:M,hasColorTextureTransform:T}=t;switch(y){case 2:(0,f.NB)(r,t),e.include(o.d,t),g.include(n.HQ,t),e.include(c.U,t),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
360
345
  vpos = subtractOrigin(vpos);
361
346
  vpos = addVerticalOffset(vpos, localOrigin);
362
347
  gl_Position = transformPosition(proj, view, vpos);
363
- forwardTextureCoordinates();`),e.include(p.S,t),g.main.add(d.H`
348
+ forwardTextureCoordinates();`),e.include(m.S,t),g.main.add(d.H`
364
349
  discardBySlice(vpos);
365
350
  ${(0,d.If)(w,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
366
- discardOrAdjustAlpha(texColor);`)}`);break;case 4:case 5:case 6:case 7:case 9:(0,f.NB)(r,t),e.include(o.d,t),e.include(c.U,t),e.include(m.A,t),e.include(u,t),g.include(n.HQ,t),e.include(s.g,t),(0,i.xJ)(e),_.add("depth","float",{invariant:!0}),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
351
+ discardOrAdjustAlpha(texColor);`)}`);break;case 4:case 5:case 6:case 7:case 9:(0,f.NB)(r,t),e.include(o.d,t),e.include(c.U,t),e.include(p.A,t),e.include(u,t),g.include(n.HQ,t),e.include(s.g,t),(0,i.xJ)(e),_.add("depth","float",{invariant:!0}),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
367
352
  vpos = subtractOrigin(vpos);
368
353
  vpos = addVerticalOffset(vpos, localOrigin);
369
354
  gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
370
355
  forwardTextureCoordinates();
371
- forwardObjectAndLayerIdColor();`),e.include(p.S,t),g.main.add(d.H`
356
+ forwardObjectAndLayerIdColor();`),e.include(m.S,t),g.main.add(d.H`
372
357
  discardBySlice(vpos);
373
358
  ${(0,d.If)(w,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
374
359
  discardOrAdjustAlpha(texColor);`)}
375
- ${9===y?d.H`outputObjectAndLayerIdColor();`:d.H`outputDepth(depth);`}`);break;case 3:{(0,f.NB)(r,t),e.include(o.d,t),e.include(a.Y,t),e.include(l.Mh,t),e.include(c.U,t),e.include(m.A,t),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),2===M&&_.add("vPositionView","vec3",{invariant:!0});const i=0===M||1===M;r.main.add(d.H`
360
+ ${9===y?d.H`outputObjectAndLayerIdColor();`:d.H`outputDepth(depth);`}`);break;case 3:{(0,f.NB)(r,t),e.include(o.d,t),e.include(a.Y,t),e.include(l.Mh,t),e.include(c.U,t),e.include(p.A,t),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),2===M&&_.add("vPositionView","vec3",{invariant:!0});const i=0===M||1===M;r.main.add(d.H`
376
361
  vpos = getVertexInLocalOriginSpace();
377
362
  ${i?d.H`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:d.H`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
378
363
  vpos = subtractOrigin(vpos);
379
364
  vpos = addVerticalOffset(vpos, localOrigin);
380
365
  gl_Position = transformPosition(proj, view, vpos);
381
- forwardTextureCoordinates();`),g.include(n.HQ,t),e.include(p.S,t),g.main.add(d.H`
366
+ forwardTextureCoordinates();`),g.include(n.HQ,t),e.include(m.S,t),g.main.add(d.H`
382
367
  discardBySlice(vpos);
383
368
  ${(0,d.If)(w,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
384
369
  discardOrAdjustAlpha(texColor);`)}
@@ -387,11 +372,11 @@ forwardObjectAndLayerIdColor();`),e.include(p.S,t),g.main.add(d.H`
387
372
  if (gl_FrontFacing == false){
388
373
  normal = -normal;
389
374
  }`}
390
- fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 8:(0,f.NB)(r,t),e.include(o.d,t),e.include(c.U,t),e.include(m.A,t),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
375
+ fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 8:(0,f.NB)(r,t),e.include(o.d,t),e.include(c.U,t),e.include(p.A,t),w&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
391
376
  vpos = subtractOrigin(vpos);
392
377
  vpos = addVerticalOffset(vpos, localOrigin);
393
378
  gl_Position = transformPosition(proj, view, vpos);
394
- forwardTextureCoordinates();`),g.include(n.HQ,t),e.include(p.S,t),e.include(h.Q,t),g.main.add(d.H`
379
+ forwardTextureCoordinates();`),g.include(n.HQ,t),e.include(m.S,t),e.include(h.Q,t),g.main.add(d.H`
395
380
  discardBySlice(vpos);
396
381
  ${(0,d.If)(w,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
397
382
  discardOrAdjustAlpha(texColor);`)}
@@ -517,11 +502,9 @@ vec4 masked2 = mix(color2.color, vec4(1), color2.mask);
517
502
  return MaskedColor(masked1 * masked2, bvec4(ivec4(color1.mask) & ivec4(color2.mask)));
518
503
  }`)}function s(e){e.include(n),e.code.add(i.H`MaskedColor createMaskedFromNaNColor(vec4 color) {
519
504
  return MaskedColor(color, isnan(color));
520
- }`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>s,Um:()=>c,kE:()=>a});var i=r(4576),n=r(34727),o=r(77194);function a(e,t,r,i,a){let s=r.screenLength*e.pixelRatio;null!=a&&(s=(0,o.hs)(s,i,t,a));const c=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(c*t,r.minWorldLength,r.maxWorldLength)}function s(e,t){let r=!1;for(const n in t){const o=t[n];void 0!==o&&(Array.isArray(o)?Array.isArray(e[n])&&(0,i.aI)(o,e[n])||(e[n]=o.slice(),r=!0):e[n]!==o&&(r=!0,e[n]=o))}return r}const c={multiply:1,ignore:2,replace:3,tint:4}},46140:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(49186);let n=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[n,o]=t.split("."),a=/^\s*\d+\s*$/;if(!n?.match||!a.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!o?.match||!a.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(n,10),c=parseInt(o,10);return new e(s,c,r)}}},46686:(e,t,r)=>{r.d(t,{i$:()=>c,oD:()=>l,xJ:()=>s});var i=r(33752),n=r(77108),o=r(31821);function a(e){e.varyings.add("linearDepth","float",{invariant:!0})}function s(e){e.vertex.uniforms.add(new n.E("nearFar",e=>e.camera.nearFar))}function c(e){e.vertex.code.add(o.H`float calculateLinearDepth(vec2 nearFar,float z) {
521
- return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
522
- }`)}function l(e,t){const{vertex:r}=e;switch(t.output){case 0:case 1:if(t.receiveShadows)return a(e),void r.code.add(o.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case 4:case 5:case 6:case 7:return e.include(i.em,t),a(e),s(e),c(e),void r.code.add(o.H`void forwardLinearDepth() {
523
- linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
524
- }`)}r.code.add(o.H`void forwardLinearDepth() {}`)}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,n,o)=>i.setUniform2fv(e,t(n,o),r))}}},48833:(e,t,r)=>{r.d(t,{g:()=>G}),r(44208);var i=r(49186),n=r(65529),o=r(97768),a=r(74887),s=r(34275),c=r(24326),l=r(84952),d=r(38969),u=r(99677),h=r(56058),m=r(2741);let p;var f=r(63907),v=r(76284),g=r(42293);let _=null,x=null;async function b(){return null==x&&(p??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,m.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=p,_=await x),x}function w(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=T(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function y(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=C(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function M(e,t,r,i,n){const o=(0,g.IB)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function T(e){return e.getNumImages()>=1&&!e.isUASTC()}function C(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,n,o,a,s){const{compressedTextureETC:c,compressedTextureS3TC:l}=e.capabilities,[d,u]=c?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:l?i?[3,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new v.g(e,t,{type:"compressed",levels:m})}var E=r(53966);const A=()=>E.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const I=R("DXT1"),P=R("DXT3"),F=R("DXT5");function O(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return A().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return A().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case I:n=8,o=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case P:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case F:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return A().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[4],c=r[3];(3&s||3&c)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,c=c+3&-4);const l=s,d=c;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(c+3>>2)*n,u=new Uint8Array(e.buffer,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:p},internalFormat:o,width:l,height:d}}function D(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function H(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const a=Math.min(Math.sqrt(r/o),i/n);return[D(Math.round(e*a),i),D(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:N(e,r,i)}function N(e,t,r){if(e instanceof ImageData)return N(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const n=document.createElement("canvas");return n.width=t,n.height=r,n.getContext("2d").drawImage(e,0,0,n.width,n.height),n}var L=r(620),B=r(67171);class G{constructor(e,t){this._data=e,this.id=(0,c.c)(),this.events=new n.A.EventEmitter,this._parameters={...U,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,l.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,l.DB)(e.src)||(0,l.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new B.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture??this._emptyTexture}get loaded(){return null!=this._glTexture}get usedMemory(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return"image/ktx2"===t.encoding?y(e,!!t.mipmap):"image/x.basis"===t.encoding?w(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?z(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._glTexture)return this._glTexture;const t=this._data;return null==t?(this._glTexture=new v.g(e,this._createDescriptor(e),null),this._glTexture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,s.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,s.mg)(t)?this._loadFromPixelData(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_update(e,t){return null==this._glTexture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=O(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new v.g(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._glTexture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await b());const i=new _.KTX2File(new Uint8Array(r));if(!C(i))return null;i.startTranscoding();const n=S(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(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await b());const i=new _.BasisFile(new Uint8Array(r));if(!T(i))return null;i.startTranscoding();const n=S(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(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromPixelData(e,t){(0,L.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?6409:3===this._parameters.components?6407:6408,6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new v.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.Sx)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((n,s)=>{const c=()=>{t.removeEventListener("loadeddata",l),t.removeEventListener("error",d),(0,o.xt)(u)},l=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(e,t)))},d=e=>{c(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",l),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=H(r,e.parameters));const i=z(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this._parameters.components?6407:6408,n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._glTexture=new v.g(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),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),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._glTexture=(0,o.WD)(this._glTexture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function z(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const U={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},49255:(e,t,r)=>{function i(e){return 4===e||5===e||6===e||7===e}function n(e){return function(e){return function(e){return s(e)||a(e)}(e)||d(e)}(e)||3===e}function o(e){return function(e){return l(e)||d(e)}(e)||3===e}function a(e){return 8===e||9===e}function s(e){return 0===e}function c(e){return s(e)||u(e)}function l(e){return c(e)||a(e)}function d(e){return 2===e}function u(e){return 1===e}function h(e){switch(e){case 2:case 4:case 5:case 6:case 7:return!0}return!1}r.d(t,{LG:()=>u,Mb:()=>l,PJ:()=>i,RN:()=>c,Vg:()=>h,XY:()=>n,iq:()=>o})},49718:(e,t,r)=>{r(51850),r(6867).i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51406:(e,t,r)=>{r.d(t,{MU:()=>c,O1:()=>l,QM:()=>d,Sx:()=>s,q2:()=>a});var i=r(29242),n=r(31821),o=r(35644);function a(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new o.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(n.H`void forwardColorUV(){
505
+ }`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>s,Um:()=>c,kE:()=>a});var i=r(4576),n=r(34727),o=r(77194);function a(e,t,r,i,a){let s=r.screenLength*e.pixelRatio;null!=a&&(s=(0,o.hs)(s,i,t,a));const c=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(c*t,r.minWorldLength,r.maxWorldLength)}function s(e,t){let r=!1;for(const n in t){const o=t[n];void 0!==o&&(Array.isArray(o)?Array.isArray(e[n])&&(0,i.aI)(o,e[n])||(e[n]=o.slice(),r=!0):e[n]!==o&&(r=!0,e[n]=o))}return r}const c={multiply:1,ignore:2,replace:3,tint:4}},46140:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(49186);let n=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[n,o]=t.split("."),a=/^\s*\d+\s*$/;if(!n?.match||!a.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!o?.match||!a.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(n,10),c=parseInt(o,10);return new e(s,c,r)}}},46686:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(31821);function n(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
506
+ void forwardLinearDepth(float _linearDepth) { ${(0,i.If)(t,"linearDepth = _linearDepth;")} }
507
+ `)}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,n,o)=>i.setUniform2fv(e,t(n,o),r))}}},48833:(e,t,r)=>{r.d(t,{g:()=>G}),r(44208);var i=r(49186),n=r(65529),o=r(97768),a=r(74887),s=r(34275),c=r(24326),l=r(84952),d=r(38969),u=r(99677),h=r(56058),p=r(2741);let m;var f=r(63907),v=r(76284),g=r(42293);let _=null,x=null;async function b(){return null==x&&(m??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,p.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=m,_=await x),x}function w(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=T(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function y(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=C(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function M(e,t,r,i,n){const o=(0,g.IB)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function T(e){return e.getNumImages()>=1&&!e.isUASTC()}function C(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,n,o,a,s){const{compressedTextureETC:c,compressedTextureS3TC:l}=e.capabilities,[d,u]=c?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:l?i?[3,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),p=[];for(let e=0;e<h;e++)p.push(new Uint8Array(a(e,d))),s(e,d,p[e]);return t.internalFormat=u,t.hasMipmap=p.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new v.g(e,t,{type:"compressed",levels:p})}var E=r(53966);const A=()=>E.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const I=R("DXT1"),P=R("DXT3"),O=R("DXT5");function D(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return A().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return A().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case I:n=8,o=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case P:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case O:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return A().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[4],c=r[3];(3&s||3&c)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,c=c+3&-4);const l=s,d=c;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let p=e.byteOffset+r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(c+3>>2)*n,u=new Uint8Array(e.buffer,p,h),m.push(u),p+=h,s=Math.max(1,s>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:m},internalFormat:o,width:l,height:d}}function F(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function H(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const a=Math.min(Math.sqrt(r/o),i/n);return[F(Math.round(e*a),i),F(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:N(e,r,i)}function N(e,t,r){if(e instanceof ImageData)return N(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const n=document.createElement("canvas");return n.width=t,n.height=r,n.getContext("2d").drawImage(e,0,0,n.width,n.height),n}var L=r(620),B=r(67171);class G{constructor(e,t){this._data=e,this.id=(0,c.c)(),this.events=new n.A.EventEmitter,this._parameters={...U,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,l.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,l.DB)(e.src)||(0,l.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new B.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture??this._emptyTexture}get loaded(){return null!=this._glTexture}get usedMemory(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return"image/ktx2"===t.encoding?y(e,!!t.mipmap):"image/x.basis"===t.encoding?w(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?z(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._glTexture)return this._glTexture;const t=this._data;return null==t?(this._glTexture=new v.g(e,this._createDescriptor(e),null),this._glTexture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,s.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,s.mg)(t)?this._loadFromPixelData(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_update(e,t){return null==this._glTexture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=D(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new v.g(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._glTexture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await b());const i=new _.KTX2File(new Uint8Array(r));if(!C(i))return null;i.startTranscoding();const n=S(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(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await b());const i=new _.BasisFile(new Uint8Array(r));if(!T(i))return null;i.startTranscoding();const n=S(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(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromPixelData(e,t){(0,L.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?6409:3===this._parameters.components?6407:6408,6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new v.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.Sx)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((n,s)=>{const c=()=>{t.removeEventListener("loadeddata",l),t.removeEventListener("error",d),(0,o.xt)(u)},l=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(e,t)))},d=e=>{c(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",l),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=H(r,e.parameters));const i=z(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this._parameters.components?6407:6408,n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._glTexture=new v.g(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),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),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._glTexture=(0,o.WD)(this._glTexture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function z(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const U={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},49255:(e,t,r)=>{function i(e){return 4===e||5===e||6===e||7===e}function n(e){return function(e){return function(e){return s(e)||a(e)}(e)||d(e)}(e)||3===e}function o(e){return function(e){return l(e)||d(e)}(e)||3===e}function a(e){return 8===e||9===e}function s(e){return 0===e}function c(e){return s(e)||u(e)}function l(e){return c(e)||a(e)}function d(e){return 2===e}function u(e){return 1===e}function h(e){switch(e){case 2:case 4:case 5:case 6:case 7:return!0}return!1}r.d(t,{LG:()=>u,Mb:()=>l,PJ:()=>i,RN:()=>c,Vg:()=>h,XY:()=>n,iq:()=>o})},49718:(e,t,r)=>{r(51850),r(6867).i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51406:(e,t,r)=>{r.d(t,{MU:()=>c,O1:()=>l,QM:()=>d,Sx:()=>s,q2:()=>a});var i=r(29242),n=r(31821),o=r(35644);function a(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new o.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(n.H`void forwardColorUV(){
525
508
  colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
526
509
  }`)):e.vertex.code.add(n.H`void forwardColorUV(){}`)}function s(e,t){t.hasNormalTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new o.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK)).code.add(n.H`void forwardNormalUV(){
527
510
  normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
@@ -564,7 +547,7 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
564
547
  }`)}function c(e){e.uniforms.add(new o.t("screenSizePerspective",e=>d(e.screenSizePerspective)))}function l(e){e.uniforms.add(new o.t("screenSizePerspectiveAlignment",e=>d(e.screenSizePerspectiveAlignment||e.screenSizePerspective)))}function d(e){return(0,i.i)(u,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}const u=(0,n.vt)()},53466:(e,t,r)=>{r.d(t,{U:()=>o});var i=r(21818),n=r(31821);function o(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(n.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(n.H`void forwardTextureCoordinates() {
565
548
  vuv0 = uv0;
566
549
  vuvRegion = uvRegion;
567
- }`);default:(0,i.Xb)(t.textureCoordinateType);case 0:return void e.vertex.code.add(n.H`void forwardTextureCoordinates() {}`);case 3:return}}},57323:(e,t,r)=>{r.d(t,{R:()=>B,b:()=>L});var i=r(46686),n=r(32680),o=r(49255),a=r(76591),s=r(76597),c=r(24321),l=r(60864),d=r(43519),u=r(96336),h=r(71955),m=r(53466),p=r(92700),f=r(35640),v=r(40261),g=r(14527),_=r(89390),x=r(98619),b=r(22393),w=r(59469),y=r(39168),M=r(96598),T=r(42398),C=r(58614),S=r(27950),E=r(25178),A=r(33079),R=r(71988),I=r(20304),P=r(31821),F=r(63761),O=r(43616),D=r(59744),H=r(14113),N=r(49788);function L(e){const t=new H.N5,{attributes:r,vertex:L,fragment:B,varyings:G}=t,{output:z,offsetBackfaces:U,pbrMode:V,snowCover:j,spherical:W,hasBloom:k}=e,$=1===V||2===V;if((0,E.NB)(L,e),r.add("position","vec3"),G.add("vpos","vec3",{invariant:!0}),t.include(T.A,e),t.include(l.B,e),t.include(f.Ge,e),t.include(M.Z,e),!(0,o.RN)(z))return t.include(v.E,e),t;(0,E.yu)(t.vertex,e),t.include(u.Y,e),t.include(s.d,e),U&&t.include(n.M),G.add("vNormalWorld","vec3"),G.add("localvpos","vec3",{invariant:!0}),t.include(m.U,e),t.include(i.oD,e),t.include(h.K,e),t.include(c.v,e),t.include(p.c,e),L.include(d.WD),L.include(d.oF),L.uniforms.add(new R.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),G.add("vcolorExt","vec4"),L.main.add(P.H`
550
+ }`);default:(0,i.Xb)(t.textureCoordinateType);case 0:return void e.vertex.code.add(n.H`void forwardTextureCoordinates() {}`);case 3:return}}},57323:(e,t,r)=>{r.d(t,{R:()=>L,b:()=>N});var i=r(32680),n=r(49255),o=r(76591),a=r(76597),s=r(24321),c=r(60864),l=r(43519),d=r(96336),u=r(71955),h=r(53466),p=r(92700),m=r(35640),f=r(40261),v=r(14527),g=r(89390),_=r(98619),x=r(22393),b=r(59469),w=r(32482),y=r(96598),M=r(42398),T=r(58614),C=r(27950),S=r(25178),E=r(33079),A=r(71988),R=r(20304),I=r(31821),P=r(63761),O=r(43616),D=r(59744),F=r(14113),H=r(49788);function N(e){const t=new F.N5,{attributes:r,vertex:N,fragment:L,varyings:B}=t,{output:G,offsetBackfaces:z,pbrMode:U,snowCover:V,spherical:j,hasBloom:W}=e,k=1===U||2===U;if((0,S.NB)(N,e),r.add("position","vec3"),B.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(c.B,e),t.include(m.Ge,e),t.include(y.Z,e),!(0,n.RN)(G))return t.include(f.E,e),t;(0,S.yu)(t.vertex,e),t.include(d.Y,e),t.include(a.d,e),z&&t.include(i.M),B.add("vNormalWorld","vec3"),B.add("localvpos","vec3",{invariant:!0}),t.include(h.U,e),t.include(u.K,e),t.include(s.v,e),t.include(p.c,e),N.include(l.WD),N.include(l.oF),N.uniforms.add(new A.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),B.add("vcolorExt","vec4"),t.include(e.instancedDoublePrecision?w.G:w.Bz,e),N.main.add(I.H`
568
551
  forwardNormalizedVertexColor();
569
552
 
570
553
  MaskedColor maskedColorExt =
@@ -573,7 +556,7 @@ vuvRegion = uvRegion;
573
556
  vcolorExt = maskedColorExt.color;
574
557
  forwardColorMixMode(maskedColorExt.mask);
575
558
 
576
- bool alphaCut = opacityMixMode != ${P.H.int(O.Um.ignore)} && vcolorExt.a < ${P.H.float(N.Q)};
559
+ bool alphaCut = opacityMixMode != ${I.H.int(O.Um.ignore)} && vcolorExt.a < ${I.H.float(H.Q)};
577
560
  vpos = getVertexInLocalOriginSpace();
578
561
  localvpos = vpos - view[3].xyz;
579
562
  vpos = subtractOrigin(vpos);
@@ -582,17 +565,15 @@ vuvRegion = uvRegion;
582
565
  vec4 basePosition = transformPosition(proj, view, vpos);
583
566
 
584
567
  forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
585
- forwardLinearDepth();
586
-
587
568
  forwardTextureCoordinates();
588
-
569
+ forwardLinearDepthToReadShadowMap();
589
570
  gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
590
- ${(0,P.If)(U,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
591
- `);const{hasColorTexture:q,hasColorTextureTransform:Z,receiveShadows:Y}=e;return t.include(_.kA,e),B.include(g.n,e),t.include(C.S,e),t.include(e.instancedDoublePrecision?y.G:y.Bz,e),B.include(a.HQ,e),t.include(D.z,e),(0,E.yu)(B,e),(0,x.Gc)(B),(0,_.a8)(B),(0,_.eU)(B),B.uniforms.add(L.uniforms.get("localOrigin"),L.uniforms.get("view"),new A.t("ambient",e=>e.ambient),new A.t("diffuse",e=>e.diffuse),new I.m("opacity",e=>e.opacity),new I.m("layerOpacity",e=>e.layerOpacity)),q&&B.uniforms.add(new F.N("tex",e=>e.texture)),t.include(w._,e),B.include(b.c,e),B.include(S.N),(0,x.O4)(B),B.main.add(P.H`
571
+ ${(0,I.If)(z,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
572
+ `);const{hasColorTexture:$,hasColorTextureTransform:q}=e;return t.include(g.kA,e),L.include(v.n,e),t.include(T.S,e),L.include(o.HQ,e),t.include(D.z,e),(0,S.yu)(L,e),(0,_.Gc)(L),(0,g.a8)(L),(0,g.eU)(L),L.uniforms.add(N.uniforms.get("localOrigin"),N.uniforms.get("view"),new E.t("ambient",e=>e.ambient),new E.t("diffuse",e=>e.diffuse),new R.m("opacity",e=>e.opacity),new R.m("layerOpacity",e=>e.layerOpacity)),$&&L.uniforms.add(new P.N("tex",e=>e.texture)),t.include(b._,e),L.include(x.c,e),L.include(C.N),(0,_.O4)(L),L.main.add(I.H`
592
573
  discardBySlice(vpos);
593
574
  discardByTerrainDepth();
594
- vec4 texColor = ${q?`texture(tex, ${Z?"colorUV":"vuv0"})`:" vec4(1.0)"};
595
- ${(0,P.If)(q,`${(0,P.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
575
+ vec4 texColor = ${$?`texture(tex, ${q?"colorUV":"vuv0"})`:" vec4(1.0)"};
576
+ ${(0,I.If)($,`${(0,I.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
596
577
  vec3 viewDirection = normalize(vpos - cameraPosition);
597
578
  applyPBRFactors();
598
579
  float ssao = evaluateAmbientOcclusionInverse();
@@ -600,14 +581,14 @@ vuvRegion = uvRegion;
600
581
 
601
582
  float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
602
583
  vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
603
- float shadow = ${Y?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":W?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
584
+ float shadow = readShadow(additionalAmbientScale, vpos);
604
585
  vec3 matColor = max(ambient, diffuse);
605
- ${e.hasVertexColors?P.H`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
606
- float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, opacityMixMode);`:P.H`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
586
+ ${e.hasVertexColors?I.H`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
587
+ float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, opacityMixMode);`:I.H`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
607
588
  float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, opacityMixMode);`}
608
589
 
609
- ${(0,P.If)(j,"albedo = mix(albedo, vec3(1), 0.9);")}
610
- ${P.H`vec3 shadingNormal = normalize(vNormalWorld);
590
+ ${(0,I.If)(V,"albedo = mix(albedo, vec3(1), 0.9);")}
591
+ ${I.H`vec3 shadingNormal = normalize(vNormalWorld);
611
592
  albedo *= 1.2;
612
593
  vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
613
594
  float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
@@ -615,13 +596,13 @@ vuvRegion = uvRegion;
615
596
  float treeRadialFalloff = vColor.r;
616
597
  float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
617
598
  additionalLight += backLightFactor * mainLightIntensity;`}
618
- ${(0,P.If)($,`vec3 normalGround = ${W?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)}
619
- ${$?P.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
620
- ${(0,P.If)(j,P.H`mrr = applySnowToMRR(mrr, 1.0)`)}
621
- vec4 emission = ${j||k?"vec4(0.0)":"getEmissions(albedo)"};
622
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:P.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
599
+ ${(0,I.If)(k,`vec3 normalGround = ${j?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};`)}
600
+ ${k?I.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
601
+ ${(0,I.If)(V,I.H`mrr = applySnowToMRR(mrr, 1.0)`)}
602
+ vec4 emission = ${V||W?"vec4(0.0)":"getEmissions(albedo)"};
603
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:I.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
623
604
  vec4 finalColor = vec4(shadedColor, opacity_);
624
- outputColorHighlightOID(finalColor, vpos, albedo ${(0,P.If)(j,", 1.0")});`),t}const B=Object.freeze(Object.defineProperty({__proto__:null,build:L},Symbol.toStringTag,{value:"Module"}))},57917:(e,t,r)=>{r.d(t,{S:()=>o});var i=r(34275),n=r(20498);function o(e){if(e.length<i.y9)return Array.from(e);if(Array.isArray(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,i.LW)(e)?(0,n.pX)().from(e):(0,i.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}},58614:(e,t,r)=>{r.d(t,{S:()=>a}),r(28421);var i=r(20304),n=r(31821),o=r(49788);function a(e,t){!function(e,t,r){const i=e.fragment,a=t.alphaDiscardMode,s=0===a;2!==a&&3!==a||i.uniforms.add(r),i.code.add(n.H`
605
+ outputColorHighlightOID(finalColor, vpos, albedo ${(0,I.If)(V,", 1.0")});`),t}const L=Object.freeze(Object.defineProperty({__proto__:null,build:N},Symbol.toStringTag,{value:"Module"}))},57917:(e,t,r)=>{r.d(t,{S:()=>o});var i=r(34275),n=r(20498);function o(e){if(e.length<i.y9)return Array.from(e);if(Array.isArray(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,i.LW)(e)?(0,n.pX)().from(e):(0,i.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}},58614:(e,t,r)=>{r.d(t,{S:()=>a}),r(28421);var i=r(20304),n=r(31821),o=r(49788);function a(e,t){!function(e,t,r){const i=e.fragment,a=t.alphaDiscardMode,s=0===a;2!==a&&3!==a||i.uniforms.add(r),i.code.add(n.H`
625
606
  void discardOrAdjustAlpha(inout vec4 color) {
626
607
  ${1===a?"color.a = 1.0;":`if (color.a < ${s?n.H.float(o.Q):"textureAlphaCutoff"}) {\n discard;\n } ${(0,n.If)(2===a,"else { color.a = 1.0; }")}`}
627
608
  }
@@ -629,8 +610,8 @@ vuvRegion = uvRegion;
629
610
  float getBakedOcclusion() { return 1.0; }`);if(2===r)return void l.code.add(a.H`vec3 mrr = vec3(0.0, 0.6, 0.2);
630
611
  float occlusion = 1.0;
631
612
  void applyPBRFactors() {}
632
- float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:d,hasMetallicRoughnessTextureTransform:u,hasOcclusionTexture:h,hasOcclusionTextureTransform:m,bindType:p}=t;(d||h)&&e.include(i.r,t),l.code.add(a.H`vec3 mrr;
633
- float occlusion;`),d&&l.uniforms.add(1===p?new c.N("texMetallicRoughness",e=>e.textureMetallicRoughness):new s.o("texMetallicRoughness",e=>e.textureMetallicRoughness)),h&&l.uniforms.add(1===p?new c.N("texOcclusion",e=>e.textureOcclusion):new s.o("texOcclusion",e=>e.textureOcclusion)),l.uniforms.add(1===p?new o.t("mrrFactors",e=>e.mrrFactors):new n.W("mrrFactors",e=>e.mrrFactors)),l.code.add(a.H`
613
+ float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:d,hasMetallicRoughnessTextureTransform:u,hasOcclusionTexture:h,hasOcclusionTextureTransform:p,bindType:m}=t;(d||h)&&e.include(i.r,t),l.code.add(a.H`vec3 mrr;
614
+ float occlusion;`),d&&l.uniforms.add(1===m?new c.N("texMetallicRoughness",e=>e.textureMetallicRoughness):new s.o("texMetallicRoughness",e=>e.textureMetallicRoughness)),h&&l.uniforms.add(1===m?new c.N("texOcclusion",e=>e.textureOcclusion):new s.o("texOcclusion",e=>e.textureOcclusion)),l.uniforms.add(1===m?new o.t("mrrFactors",e=>e.mrrFactors):new n.W("mrrFactors",e=>e.mrrFactors)),l.code.add(a.H`
634
615
  ${(0,a.If)(d,a.H`void applyMetallicRoughness(vec2 uv) {
635
616
  vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
636
617
  mrr[0] *= metallicRoughness.b;
@@ -648,16 +629,16 @@ float occlusion;`),d&&l.uniforms.add(1===p?new c.N("texMetallicRoughness",e=>e.t
648
629
  occlusion = 1.0;
649
630
 
650
631
  ${(0,a.If)(d,`applyMetallicRoughness(${u?"metallicRoughnessUV":"vuv0"});`)}
651
- ${(0,a.If)(h,`applyOcclusion(${m?"occlusionUV":"vuv0"});`)}
632
+ ${(0,a.If)(h,`applyOcclusion(${p?"occlusionUV":"vuv0"});`)}
652
633
  }
653
- `)}(r(74810),r(65786)).Y},59744:(e,t,r)=>{r.d(t,{z:()=>v});var i=r(49255),n=r(99208),o=r(40710),a=r(33079),s=r(28421),c=r(20304),l=r(31821),d=r(15976),u=r(63761);function h(e,t){if(!(0,i.RN)(t.output))return;const{emissionSource:r,hasEmissiveTextureTransform:h,bindType:m}=t,p=3===r;p&&(e.include(n.r,t),e.fragment.uniforms.add(1===m?new u.N("texEmission",e=>e.textureEmissive):new d.o("texEmission",e=>e.textureEmissive)));const f=2===r||p;f&&e.fragment.uniforms.add(1===m?new a.t("emissiveBaseColor",e=>e.emissiveBaseColor):new o.W("emissiveBaseColor",e=>e.emissiveBaseColor));const v=0!==r;v&&e.fragment.uniforms.add(1===m?new c.m("emissiveStrength",e=>e.emissiveStrength):new s.J("emissiveStrength",e=>e.emissiveStrength));const g=1===r;e.fragment.code.add(l.H`
634
+ `)}(r(74810),r(65786)).Y},59744:(e,t,r)=>{r.d(t,{z:()=>v});var i=r(49255),n=r(99208),o=r(40710),a=r(33079),s=r(28421),c=r(20304),l=r(31821),d=r(15976),u=r(63761);function h(e,t){if(!(0,i.RN)(t.output))return;const{emissionSource:r,hasEmissiveTextureTransform:h,bindType:p}=t,m=3===r;m&&(e.include(n.r,t),e.fragment.uniforms.add(1===p?new u.N("texEmission",e=>e.textureEmissive):new d.o("texEmission",e=>e.textureEmissive)));const f=2===r||m;f&&e.fragment.uniforms.add(1===p?new a.t("emissiveBaseColor",e=>e.emissiveBaseColor):new o.W("emissiveBaseColor",e=>e.emissiveBaseColor));const v=0!==r;v&&e.fragment.uniforms.add(1===p?new c.m("emissiveStrength",e=>e.emissiveStrength):new s.J("emissiveStrength",e=>e.emissiveStrength));const g=1===r;e.fragment.code.add(l.H`
654
635
  vec4 getEmissions(vec3 symbolColor) {
655
636
  vec4 emissions = ${f?"vec4(emissiveBaseColor, 1.0)":g?"vec4(symbolColor, 1.0)":"vec4(0.0)"};
656
- ${(0,l.If)(p,`emissions *= textureLookup(texEmission, ${h?"emissiveUV":"vuv0"});\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
637
+ ${(0,l.If)(m,`emissions *= textureLookup(texEmission, ${h?"emissiveUV":"vuv0"});\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
657
638
  ${(0,l.If)(v,"emissions.rgb *= emissiveStrength;")}
658
639
  return emissions;
659
640
  }
660
- `)}r(25634);var m=r(42593),p=r(63365),f=r(49788);function v(e,t){e.include(m.Q,t),e.include(h,t),e.fragment.include(p.a);const{output:r,oitPass:n,discardInvisibleFragments:o,snowCover:a}=t,s=9===r,c=(0,i.LG)(r),d=(0,i.RN)(r)&&1===n,u=(0,i.RN)(r)&&1!==n;let v=0;(u||c||d)&&e.outputs.add("fragColor","vec4",v++),c&&e.outputs.add("fragEmission","vec4",v++),d&&e.outputs.add("fragAlpha","float",v++),e.fragment.code.add(l.H`
641
+ `)}r(25634);var p=r(42593),m=r(63365),f=r(49788);function v(e,t){e.include(p.Q,t),e.include(h,t),e.fragment.include(m.a);const{output:r,oitPass:n,discardInvisibleFragments:o,snowCover:a}=t,s=9===r,c=(0,i.LG)(r),d=(0,i.RN)(r)&&1===n,u=(0,i.RN)(r)&&1!==n;let v=0;(u||c||d)&&e.outputs.add("fragColor","vec4",v++),c&&e.outputs.add("fragEmission","vec4",v++),d&&e.outputs.add("fragAlpha","float",v++),e.fragment.code.add(l.H`
661
642
  void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition, vec3 emissiveBaseColor ${(0,l.If)(a,", float snow")}) {
662
643
  ${(0,l.If)(s,"finalColor.a = 1.0;")}
663
644
 
@@ -671,7 +652,7 @@ float occlusion;`),d&&l.uniforms.add(1===p?new c.N("texMetallicRoughness",e=>e.t
671
652
  calculateOcclusionAndOutputHighlight();
672
653
  ${(0,l.If)(s,"outputObjectAndLayerIdColor();")}
673
654
  }
674
- `)}},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>u,SA:()=>v,Ut:()=>d,p1:()=>m,tb:()=>p,uO:()=>s,vx:()=>f}),r(38954);var i=r(51850),n=r(58083),o=r(13030),a=r(620);function s(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,c=o.length;if(r*=s,1===i)for(let e=0;e<c;++e)a[r]=n[o[e]],r+=s;else for(let e=0;e<c;++e){const t=n[o[e]];for(let e=0;e<i;e++)a[r]=t,r+=s}}function c(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function l(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,c=o.length;if(r*=s,1===i)for(let e=0;e<c;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<c;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function d(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,c=o.length;if(r*=s,1===i)for(let e=0;e<c;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<c;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}function u(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride;t*=n;for(let e=0;e<r;++e)i[t]=0,i[t+1]=0,i[t+2]=0,i[t+3]=0,t+=n}function h(e,t,r,i,o=1){if(!t)return void l(e,r,i,o);const{data:a,indices:s}=e,c=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=t[0],m=t[1],p=t[2],f=t[4],v=t[5],g=t[6],_=t[8],x=t[9],b=t[10],w=t[12],y=t[13],M=t[14];i*=d;let T=0,C=0,S=0;const E=(0,n.tZ)(t)?e=>{T=a[e]+w,C=a[e+1]+y,S=a[e+2]+M}:e=>{const t=a[e],r=a[e+1],i=a[e+2];T=h*t+f*r+_*i+w,C=m*t+v*r+x*i+y,S=p*t+g*r+b*i+M};if(1===o)for(let e=0;e<u;++e)E(3*s[e]),c[i]=T,c[i+1]=C,c[i+2]=S,i+=d;else for(let e=0;e<u;++e){E(3*s[e]);for(let e=0;e<o;++e)c[i]=T,c[i+1]=C,c[i+2]=S,i+=d}}function m(e,t,r,i,o=1){if(!t)return void l(e,r,i,o);const{data:a,indices:s}=e,c=t,d=r.typedBuffer,u=r.typedBufferStride,h=s.length,m=c[0],p=c[1],f=c[2],v=c[4],g=c[5],_=c[6],x=c[8],b=c[9],w=c[10],y=!(0,n.ut)(c),M=1e-6,T=1-M;i*=u;let C=0,S=0,E=0;const A=(0,n.tZ)(c)?e=>{C=a[e],S=a[e+1],E=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];C=m*t+v*r+x*i,S=p*t+g*r+b*i,E=f*t+_*r+w*i};if(1===o)if(y)for(let e=0;e<h;++e){A(3*s[e]);const t=C*C+S*S+E*E;if(t<T&&t>M){const e=1/Math.sqrt(t);d[i]=C*e,d[i+1]=S*e,d[i+2]=E*e}else d[i]=C,d[i+1]=S,d[i+2]=E;i+=u}else for(let e=0;e<h;++e)A(3*s[e]),d[i]=C,d[i+1]=S,d[i+2]=E,i+=u;else for(let e=0;e<h;++e){if(A(3*s[e]),y){const e=C*C+S*S+E*E;if(e<T&&e>M){const t=1/Math.sqrt(e);C*=t,S*=t,E*=t}}for(let e=0;e<o;++e)d[i]=C,d[i+1]=S,d[i+2]=E,i+=u}}function p(e,t,r,i,n=1){const{data:o,indices:a}=e,s=r.typedBuffer,c=r.typedBufferStride,l=a.length;if(i*=c,t===o.length&&4===t){s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=c/4,a=e[i/=4];i+=t;const d=l*n;for(let r=1;r<d;++r)e[i]=a,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=c}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=c}return}for(let e=0;e<l;++e){const t=3*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=c}}}function f(e,t,r,i,n=1){const o=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a}function v(e,t,r,i,n,a,s){let c={numItems:0,numVerticesPerItem:0};for(const l of r.fields.keys()){const r=e.get(l),d=r?.indices;if(r&&d)"position"===l&&(c={numItems:1,numVerticesPerItem:d.length}),g(l,r,i,n,a,s);else if("objectAndLayerIdColor"===l&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;f(t,a.getField(l,o.XP),e,s)}}}return c}function g(e,t,r,i,s,u){switch(e){case"position":{(0,a.vA)(3===t.size);const i=s.getField(e,o.xs);(0,a.vA)(!!i,`No buffer view for ${e}`),h(t,r,i,u);break}case"normal":{(0,a.vA)(3===t.size);const r=s.getField(e,o.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),m(t,i,r,u);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,a.vA)(2===t.size);const r=s.getField(e,o.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,u);break}case"uv0":{(0,a.vA)(2===t.size);const r=s.getField(e,o.ZD)??s.getField(e,o.gH);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,u);break}case"uvi":{(0,a.vA)(2===t.size);const r=s.getField(e,o.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,u);break}case"color":case"symbolColor":{const r=s.getField(e,o.XP);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(3===t.size||4===t.size),p(t,t.size,r,u);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=s.getField(e,o.Y$)??s.getField(e,o.Y$);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length,c=i[0];r*=a;for(let e=0;e<s;++e)o[r]=c,r+=a}(t,r,u);break}case"tangent":{(0,a.vA)(4===t.size);const i=s.getField(e,o.Eq);(0,a.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void d(e,r,i,o);const{data:a,indices:s}=e,c=t,l=r.typedBuffer,u=r.typedBufferStride,h=s.length,m=c[0],p=c[1],f=c[2],v=c[4],g=c[5],_=c[6],x=c[8],b=c[9],w=c[10],y=!(0,n.ut)(c),M=1e-6,T=1-M;if(i*=u,1===o)for(let e=0;e<h;++e){const t=4*s[e],r=a[t],n=a[t+1],o=a[t+2],c=a[t+3];let d=m*r+v*n+x*o,h=p*r+g*n+b*o,C=f*r+_*n+w*o;if(y){const e=d*d+h*h+C*C;if(e<T&&e>M){const t=1/Math.sqrt(e);d*=t,h*=t,C*=t}}l[i]=d,l[i+1]=h,l[i+2]=C,l[i+3]=c,i+=u}else for(let e=0;e<h;++e){const t=4*s[e],r=a[t],n=a[t+1],c=a[t+2],d=a[t+3];let h=m*r+v*n+x*c,C=p*r+g*n+b*c,S=f*r+_*n+w*c;if(y){const e=h*h+C*C+S*S;if(e<T&&e>M){const t=1/Math.sqrt(e);h*=t,C*=t,S*=t}}for(let e=0;e<o;++e)l[i]=h,l[i+1]=C,l[i+2]=S,l[i+3]=d,i+=u}}(t,r,i,u);break}case"profileVertexAndNormal":{(0,a.vA)(4===t.size);const r=s.getField(e,o.jz)??s.getField(e,o.Eq);(0,a.vA)(!!r,`No buffer view for ${e}`),d(t,r,u);break}case"profileAuxData":{(0,a.vA)(3===t.size);const r=s.getField(e,o.EC)??s.getField(e,o.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,u);break}}}(0,i.vt)()},60864:(e,t,r)=>{r.d(t,{B:()=>_});var i=r(77690),n=r(29242),o=r(9093),a=r(38954),s=r(51850),c=r(26425),l=r(25178),d=r(23205),u=r(31821),h=r(35644),m=r(40095);function p(e,t){const r=e.length;for(let i=0;i<r;++i)v[0]=e[i],t[i]=v[0];return t}function f(e,t){const r=e.length;for(let i=0;i<r;++i)v[0]=e[i],v[1]=e[i]-v[0],t[i]=v[1];return t}const v=new Float32Array(2);r(65786).Y;const g=(0,n.vt)();function _(e,t){const{hasModelTransformation:r,instancedDoublePrecision:n,instanced:s,output:v,hasVertexTangents:_}=t;r&&(e.vertex.uniforms.add(new m.X("model",e=>e.modelTransformation??o.zK)),e.vertex.uniforms.add(new h.k("normalLocalOriginFromModel",e=>((0,i.Ge)(g,e.modelTransformation??o.zK),g)))),s&&n&&(e.attributes.add("instanceModelOriginHi","vec3"),e.attributes.add("instanceModelOriginLo","vec3"),e.attributes.add("instanceModel","mat3"),e.attributes.add("instanceModelNormal","mat3"));const b=e.vertex;n&&(b.include(c.u,t),b.uniforms.add(new d.d("viewOriginHi",e=>p((0,a.i)(x,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),x)),new d.d("viewOriginLo",e=>f((0,a.i)(x,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),x)))),b.code.add(u.H`
655
+ `)}},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>u,SA:()=>v,Ut:()=>d,p1:()=>p,tb:()=>m,uO:()=>s,vx:()=>f}),r(38954);var i=r(51850),n=r(58083),o=r(13030),a=r(620);function s(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,c=o.length;if(r*=s,1===i)for(let e=0;e<c;++e)a[r]=n[o[e]],r+=s;else for(let e=0;e<c;++e){const t=n[o[e]];for(let e=0;e<i;e++)a[r]=t,r+=s}}function c(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function l(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,c=o.length;if(r*=s,1===i)for(let e=0;e<c;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<c;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function d(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,c=o.length;if(r*=s,1===i)for(let e=0;e<c;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<c;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}function u(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride;t*=n;for(let e=0;e<r;++e)i[t]=0,i[t+1]=0,i[t+2]=0,i[t+3]=0,t+=n}function h(e,t,r,i,o=1){if(!t)return void l(e,r,i,o);const{data:a,indices:s}=e,c=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=t[0],p=t[1],m=t[2],f=t[4],v=t[5],g=t[6],_=t[8],x=t[9],b=t[10],w=t[12],y=t[13],M=t[14];i*=d;let T=0,C=0,S=0;const E=(0,n.tZ)(t)?e=>{T=a[e]+w,C=a[e+1]+y,S=a[e+2]+M}:e=>{const t=a[e],r=a[e+1],i=a[e+2];T=h*t+f*r+_*i+w,C=p*t+v*r+x*i+y,S=m*t+g*r+b*i+M};if(1===o)for(let e=0;e<u;++e)E(3*s[e]),c[i]=T,c[i+1]=C,c[i+2]=S,i+=d;else for(let e=0;e<u;++e){E(3*s[e]);for(let e=0;e<o;++e)c[i]=T,c[i+1]=C,c[i+2]=S,i+=d}}function p(e,t,r,i,o=1){if(!t)return void l(e,r,i,o);const{data:a,indices:s}=e,c=t,d=r.typedBuffer,u=r.typedBufferStride,h=s.length,p=c[0],m=c[1],f=c[2],v=c[4],g=c[5],_=c[6],x=c[8],b=c[9],w=c[10],y=!(0,n.ut)(c),M=1e-6,T=1-M;i*=u;let C=0,S=0,E=0;const A=(0,n.tZ)(c)?e=>{C=a[e],S=a[e+1],E=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];C=p*t+v*r+x*i,S=m*t+g*r+b*i,E=f*t+_*r+w*i};if(1===o)if(y)for(let e=0;e<h;++e){A(3*s[e]);const t=C*C+S*S+E*E;if(t<T&&t>M){const e=1/Math.sqrt(t);d[i]=C*e,d[i+1]=S*e,d[i+2]=E*e}else d[i]=C,d[i+1]=S,d[i+2]=E;i+=u}else for(let e=0;e<h;++e)A(3*s[e]),d[i]=C,d[i+1]=S,d[i+2]=E,i+=u;else for(let e=0;e<h;++e){if(A(3*s[e]),y){const e=C*C+S*S+E*E;if(e<T&&e>M){const t=1/Math.sqrt(e);C*=t,S*=t,E*=t}}for(let e=0;e<o;++e)d[i]=C,d[i+1]=S,d[i+2]=E,i+=u}}function m(e,t,r,i,n=1){const{data:o,indices:a}=e,s=r.typedBuffer,c=r.typedBufferStride,l=a.length;if(i*=c,t===o.length&&4===t){s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=c/4,a=e[i/=4];i+=t;const d=l*n;for(let r=1;r<d;++r)e[i]=a,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=c}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=c}return}for(let e=0;e<l;++e){const t=3*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=c}}}function f(e,t,r,i,n=1){const o=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a}function v(e,t,r,i,n,a,s){let c={numItems:0,numVerticesPerItem:0};for(const l of r.fields.keys()){const r=e.get(l),d=r?.indices;if(r&&d)"position"===l&&(c={numItems:1,numVerticesPerItem:d.length}),g(l,r,i,n,a,s);else if("objectAndLayerIdColor"===l&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;f(t,a.getField(l,o.XP),e,s)}}}return c}function g(e,t,r,i,s,u){switch(e){case"position":{(0,a.vA)(3===t.size);const i=s.getField(e,o.xs);(0,a.vA)(!!i,`No buffer view for ${e}`),h(t,r,i,u);break}case"normal":{(0,a.vA)(3===t.size);const r=s.getField(e,o.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),p(t,i,r,u);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,a.vA)(2===t.size);const r=s.getField(e,o.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,u);break}case"uv0":{(0,a.vA)(2===t.size);const r=s.getField(e,o.ZD)??s.getField(e,o.gH);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,u);break}case"uvi":{(0,a.vA)(2===t.size);const r=s.getField(e,o.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,u);break}case"color":case"symbolColor":{const r=s.getField(e,o.XP);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(3===t.size||4===t.size),m(t,t.size,r,u);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=s.getField(e,o.Y$)??s.getField(e,o.Y$);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length,c=i[0];r*=a;for(let e=0;e<s;++e)o[r]=c,r+=a}(t,r,u);break}case"tangent":{(0,a.vA)(4===t.size);const i=s.getField(e,o.Eq);(0,a.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void d(e,r,i,o);const{data:a,indices:s}=e,c=t,l=r.typedBuffer,u=r.typedBufferStride,h=s.length,p=c[0],m=c[1],f=c[2],v=c[4],g=c[5],_=c[6],x=c[8],b=c[9],w=c[10],y=!(0,n.ut)(c),M=1e-6,T=1-M;if(i*=u,1===o)for(let e=0;e<h;++e){const t=4*s[e],r=a[t],n=a[t+1],o=a[t+2],c=a[t+3];let d=p*r+v*n+x*o,h=m*r+g*n+b*o,C=f*r+_*n+w*o;if(y){const e=d*d+h*h+C*C;if(e<T&&e>M){const t=1/Math.sqrt(e);d*=t,h*=t,C*=t}}l[i]=d,l[i+1]=h,l[i+2]=C,l[i+3]=c,i+=u}else for(let e=0;e<h;++e){const t=4*s[e],r=a[t],n=a[t+1],c=a[t+2],d=a[t+3];let h=p*r+v*n+x*c,C=m*r+g*n+b*c,S=f*r+_*n+w*c;if(y){const e=h*h+C*C+S*S;if(e<T&&e>M){const t=1/Math.sqrt(e);h*=t,C*=t,S*=t}}for(let e=0;e<o;++e)l[i]=h,l[i+1]=C,l[i+2]=S,l[i+3]=d,i+=u}}(t,r,i,u);break}case"profileVertexAndNormal":{(0,a.vA)(4===t.size);const r=s.getField(e,o.jz)??s.getField(e,o.Eq);(0,a.vA)(!!r,`No buffer view for ${e}`),d(t,r,u);break}case"profileAuxData":{(0,a.vA)(3===t.size);const r=s.getField(e,o.EC)??s.getField(e,o.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,u);break}}}(0,i.vt)()},60864:(e,t,r)=>{r.d(t,{B:()=>_});var i=r(77690),n=r(29242),o=r(9093),a=r(38954),s=r(51850),c=r(26425),l=r(25178),d=r(23205),u=r(31821),h=r(35644),p=r(40095);function m(e,t){const r=e.length;for(let i=0;i<r;++i)v[0]=e[i],t[i]=v[0];return t}function f(e,t){const r=e.length;for(let i=0;i<r;++i)v[0]=e[i],v[1]=e[i]-v[0],t[i]=v[1];return t}const v=new Float32Array(2);r(65786).Y;const g=(0,n.vt)();function _(e,t){const{hasModelTransformation:r,instancedDoublePrecision:n,instanced:s,output:v,hasVertexTangents:_}=t;r&&(e.vertex.uniforms.add(new p.X("model",e=>e.modelTransformation??o.zK)),e.vertex.uniforms.add(new h.k("normalLocalOriginFromModel",e=>((0,i.Ge)(g,e.modelTransformation??o.zK),g)))),s&&n&&(e.attributes.add("instanceModelOriginHi","vec3"),e.attributes.add("instanceModelOriginLo","vec3"),e.attributes.add("instanceModel","mat3"),e.attributes.add("instanceModelNormal","mat3"));const b=e.vertex;n&&(b.include(c.u,t),b.uniforms.add(new d.d("viewOriginHi",e=>m((0,a.i)(x,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),x)),new d.d("viewOriginLo",e=>f((0,a.i)(x,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),x)))),b.code.add(u.H`
675
656
  vec3 getVertexInLocalOriginSpace() {
676
657
  return ${r?n?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":n?"instanceModel * localPosition().xyz":"localPosition().xyz"};
677
658
  }
@@ -720,7 +701,7 @@ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
720
701
  }
721
702
  float rgb2v(vec3 c) {
722
703
  return max(c.x, max(c.y, c.z));
723
- }`)}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},63907:(e,t,r)=>{var i,n,o,a,s,c;r.d(t,{CQ:()=>m,Fq:()=>u,H0:()=>o,SB:()=>s,WR:()=>i,iE:()=>a,nI:()=>h,pe:()=>n,r6:()=>l,vt:()=>c,yI:()=>d}),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(i||(i={})),function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.HALF_FLOAT=5131]="HALF_FLOAT"}(n||(n={})),function(e){e[e.RGBA4=32854]="RGBA4",e[e.R16F=33325]="R16F",e[e.RG16F=33327]="RG16F",e[e.RGB32F=34837]="RGB32F",e[e.RGBA16F=34842]="RGBA16F",e[e.R32F=33326]="R32F",e[e.RG32F=33328]="RG32F",e[e.RGBA32F=34836]="RGBA32F",e[e.R11F_G11F_B10F=35898]="R11F_G11F_B10F",e[e.RGB8=32849]="RGB8",e[e.RGBA8=32856]="RGBA8",e[e.RGB5_A1=32855]="RGB5_A1",e[e.R8=33321]="R8",e[e.RG8=33323]="RG8",e[e.R8I=33329]="R8I",e[e.R8UI=33330]="R8UI",e[e.R16I=33331]="R16I",e[e.R16UI=33332]="R16UI",e[e.R32I=33333]="R32I",e[e.R32UI=33334]="R32UI",e[e.RG8I=33335]="RG8I",e[e.RG8UI=33336]="RG8UI",e[e.RG16I=33337]="RG16I",e[e.RG16UI=33338]="RG16UI",e[e.RG32I=33339]="RG32I",e[e.RG32UI=33340]="RG32UI",e[e.RGB16F=34843]="RGB16F",e[e.RGB9_E5=35901]="RGB9_E5",e[e.SRGB8=35905]="SRGB8",e[e.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",e[e.RGB565=36194]="RGB565",e[e.RGBA32UI=36208]="RGBA32UI",e[e.RGB32UI=36209]="RGB32UI",e[e.RGBA16UI=36214]="RGBA16UI",e[e.RGB16UI=36215]="RGB16UI",e[e.RGBA8UI=36220]="RGBA8UI",e[e.RGB8UI=36221]="RGB8UI",e[e.RGBA32I=36226]="RGBA32I",e[e.RGB32I=36227]="RGB32I",e[e.RGBA16I=36232]="RGBA16I",e[e.RGB16I=36233]="RGB16I",e[e.RGBA8I=36238]="RGBA8I",e[e.RGB8I=36239]="RGB8I",e[e.R8_SNORM=36756]="R8_SNORM",e[e.RG8_SNORM=36757]="RG8_SNORM",e[e.RGB8_SNORM=36758]="RGB8_SNORM",e[e.RGBA8_SNORM=36759]="RGBA8_SNORM",e[e.RGB10_A2=32857]="RGB10_A2",e[e.RGB10_A2UI=36975]="RGB10_A2UI"}(o||(o={})),function(e){e[e.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",e[e.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(a||(a={})),function(e){e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",e[e.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F"}(s||(s={})),function(e){e[e.Texture=0]="Texture",e[e.TileTexture=1]="TileTexture",e[e.BufferObject=2]="BufferObject",e[e.VertexArrayObject=3]="VertexArrayObject",e[e.Shader=4]="Shader",e[e.Program=5]="Program",e[e.FramebufferObject=6]="FramebufferObject",e[e.Renderbuffer=7]="Renderbuffer",e[e.TransformFeedback=8]="TransformFeedback",e[e.Sync=9]="Sync",e[e.UNCOUNTED=10]="UNCOUNTED",e[e.LinesOfCode=10]="LinesOfCode",e[e.Uniform=11]="Uniform",e[e.COUNT=12]="COUNT"}(c||(c={}));const l=36064,d=36065,u=36066,h=33306;var m;!function(e){e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(m||(m={}))},65786:(e,t,r)=>{r.d(t,{Y:()=>i});const i=class{};new i},65806:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(51850),n=r(98988),o=r(9762);function a(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r)){s[0]=e.x,s[1]=e.y;const n=e.z;return s[2]=n??i??0,(0,o.projectBuffer)(s,e.spatialReference,0,t,r,0)}const a=(0,n.tryProjectWithZConversion)(e,r);return!!a&&(t[0]=a?.x,t[1]=a?.y,t[2]=a?.z??i??0,!0)}const s=(0,i.vt)()},67171:(e,t,r)=>{r.d(t,{R:()=>n,e:()=>o});var i=r(42293);class n{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=5121,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,i.IB)(e.internalFormat))*(34067===e.target?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,n,o,a)=>i.setUniform2fv(e,t(n,o,a),r))}}},69052:(e,t,r)=>{r.d(t,{hr:()=>n,ie:()=>c,uC:()=>s});var i=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+a(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,i,n=0,o=!1){return(i-=n)<t?i+=a(e,t-i):i>r&&(i-=a(e,i-r)),o&&i===r&&(i=t),i+n}function a(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new n(0,2*Math.PI),c=(new n(-Math.PI,Math.PI),new n(0,360))},71955:(e,t,r)=>{r.d(t,{K:()=>c});var i=r(43519),n=r(31821),o=r(74333);class a extends o.n{constructor(e,t){super(e,"int",1,(r,i,n)=>r.setUniform1i(e,t(i,n)))}}var s=r(43616);function c(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new a("symbolColorMixMode",e=>s.Um[e.colorMixMode])),t.hasSymbolColors?(e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.attributes.add("symbolColor","vec4"),e.vertex.code.add(n.H`
704
+ }`)}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},63907:(e,t,r)=>{var i,n,o,a,s,c;r.d(t,{CQ:()=>p,Fq:()=>u,H0:()=>o,SB:()=>s,WR:()=>i,iE:()=>a,nI:()=>h,pe:()=>n,r6:()=>l,vt:()=>c,yI:()=>d}),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(i||(i={})),function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.HALF_FLOAT=5131]="HALF_FLOAT"}(n||(n={})),function(e){e[e.RGBA4=32854]="RGBA4",e[e.R16F=33325]="R16F",e[e.RG16F=33327]="RG16F",e[e.RGB32F=34837]="RGB32F",e[e.RGBA16F=34842]="RGBA16F",e[e.R32F=33326]="R32F",e[e.RG32F=33328]="RG32F",e[e.RGBA32F=34836]="RGBA32F",e[e.R11F_G11F_B10F=35898]="R11F_G11F_B10F",e[e.RGB8=32849]="RGB8",e[e.RGBA8=32856]="RGBA8",e[e.RGB5_A1=32855]="RGB5_A1",e[e.R8=33321]="R8",e[e.RG8=33323]="RG8",e[e.R8I=33329]="R8I",e[e.R8UI=33330]="R8UI",e[e.R16I=33331]="R16I",e[e.R16UI=33332]="R16UI",e[e.R32I=33333]="R32I",e[e.R32UI=33334]="R32UI",e[e.RG8I=33335]="RG8I",e[e.RG8UI=33336]="RG8UI",e[e.RG16I=33337]="RG16I",e[e.RG16UI=33338]="RG16UI",e[e.RG32I=33339]="RG32I",e[e.RG32UI=33340]="RG32UI",e[e.RGB16F=34843]="RGB16F",e[e.RGB9_E5=35901]="RGB9_E5",e[e.SRGB8=35905]="SRGB8",e[e.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",e[e.RGB565=36194]="RGB565",e[e.RGBA32UI=36208]="RGBA32UI",e[e.RGB32UI=36209]="RGB32UI",e[e.RGBA16UI=36214]="RGBA16UI",e[e.RGB16UI=36215]="RGB16UI",e[e.RGBA8UI=36220]="RGBA8UI",e[e.RGB8UI=36221]="RGB8UI",e[e.RGBA32I=36226]="RGBA32I",e[e.RGB32I=36227]="RGB32I",e[e.RGBA16I=36232]="RGBA16I",e[e.RGB16I=36233]="RGB16I",e[e.RGBA8I=36238]="RGBA8I",e[e.RGB8I=36239]="RGB8I",e[e.R8_SNORM=36756]="R8_SNORM",e[e.RG8_SNORM=36757]="RG8_SNORM",e[e.RGB8_SNORM=36758]="RGB8_SNORM",e[e.RGBA8_SNORM=36759]="RGBA8_SNORM",e[e.RGB10_A2=32857]="RGB10_A2",e[e.RGB10_A2UI=36975]="RGB10_A2UI"}(o||(o={})),function(e){e[e.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",e[e.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(a||(a={})),function(e){e[e.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",e[e.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",e[e.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F"}(s||(s={})),function(e){e[e.Texture=0]="Texture",e[e.TileTexture=1]="TileTexture",e[e.BufferObject=2]="BufferObject",e[e.VertexArrayObject=3]="VertexArrayObject",e[e.Shader=4]="Shader",e[e.Program=5]="Program",e[e.FramebufferObject=6]="FramebufferObject",e[e.Renderbuffer=7]="Renderbuffer",e[e.TransformFeedback=8]="TransformFeedback",e[e.Sync=9]="Sync",e[e.UNCOUNTED=10]="UNCOUNTED",e[e.LinesOfCode=10]="LinesOfCode",e[e.Uniform=11]="Uniform",e[e.COUNT=12]="COUNT"}(c||(c={}));const l=36064,d=36065,u=36066,h=33306;var p;!function(e){e[e.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",e[e.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",e[e.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",e[e.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",e[e.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",e[e.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",e[e.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",e[e.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",e[e.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",e[e.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",e[e.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(p||(p={}))},65786:(e,t,r)=>{r.d(t,{Y:()=>i});const i=class{};new i},65806:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(51850),n=r(98988),o=r(9762);function a(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r)){s[0]=e.x,s[1]=e.y;const n=e.z;return s[2]=n??i??0,(0,o.projectBuffer)(s,e.spatialReference,0,t,r,0)}const a=(0,n.tryProjectWithZConversion)(e,r);return!!a&&(t[0]=a?.x,t[1]=a?.y,t[2]=a?.z??i??0,!0)}const s=(0,i.vt)()},67171:(e,t,r)=>{r.d(t,{R:()=>n,e:()=>o});var i=r(42293);class n{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=5121,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,i.IB)(e.internalFormat))*(34067===e.target?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,n,o,a)=>i.setUniform2fv(e,t(n,o,a),r))}}},69052:(e,t,r)=>{r.d(t,{hr:()=>n,ie:()=>c,uC:()=>s});var i=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+a(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,i,n=0,o=!1){return(i-=n)<t?i+=a(e,t-i):i>r&&(i-=a(e,i-r)),o&&i===r&&(i=t),i+n}function a(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new n(0,2*Math.PI),c=(new n(-Math.PI,Math.PI),new n(0,360))},71955:(e,t,r)=>{r.d(t,{K:()=>c});var i=r(43519),n=r(31821),o=r(74333);class a extends o.n{constructor(e,t){super(e,"int",1,(r,i,n)=>r.setUniform1i(e,t(i,n)))}}var s=r(43616);function c(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new a("symbolColorMixMode",e=>s.Um[e.colorMixMode])),t.hasSymbolColors?(e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.attributes.add("symbolColor","vec4"),e.vertex.code.add(n.H`
724
705
  MaskedColor applySymbolColor(MaskedColor color) {
725
706
  return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${"symbolColor"}));
726
707
  }
@@ -731,10 +712,10 @@ return color;
731
712
  colorMixMode = mask.r ? ${n.H.int(s.Um.ignore)} : symbolColorMixMode;
732
713
  opacityMixMode = mask.a ? ${n.H.int(s.Um.ignore)} : symbolColorMixMode;
733
714
  }
734
- `)}},71988:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,n,o)=>i.setUniform4fv(e,t(n,o),r))}}},72824:(e,t,r)=>{r.d(t,{Mh:()=>u,Zo:()=>h,gy:()=>m});var i=r(21818),n=r(29242),o=r(91829),a=r(96336),s=r(33752),c=r(31821),l=r(98353),d=r(35644);function u(e,t){switch(t.normalType){case 0:case 1:e.include(a.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new l.h("transformNormalGlobalFromModel",e=>e.transformNormalGlobalFromModel),new d.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)),e.vertex.code.add(c.H`void forwardNormal() {
715
+ `)}},71988:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,n,o)=>i.setUniform4fv(e,t(n,o),r))}}},72824:(e,t,r)=>{r.d(t,{Mh:()=>u,Zo:()=>h,gy:()=>p});var i=r(21818),n=r(29242),o=r(91829),a=r(96336),s=r(33752),c=r(31821),l=r(98353),d=r(35644);function u(e,t){switch(t.normalType){case 0:case 1:e.include(a.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new l.h("transformNormalGlobalFromModel",e=>e.transformNormalGlobalFromModel),new d.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)),e.vertex.code.add(c.H`void forwardNormal() {
735
716
  vNormalWorld = transformNormalGlobalFromModel * normalModel();
736
717
  vNormalView = transformNormalViewFromGlobal * vNormalWorld;
737
- }`);break;case 2:e.vertex.code.add(c.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,n.vt)()}}class m extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,n.vt)(),this.toMapSpace=(0,o.vt)()}}},74333:(e,t,r)=>{r.d(t,{n:()=>i}),r(44208);class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>o,SY:()=>c,mb:()=>a});var i=r(38954),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:a,emissiveFactor:s,occlusionTexture:c}){return null==e&&null==t&&null==a&&(null==s||(0,i.q)(s,n.uY))&&null==c&&(null==o||1===o)&&(null==r||1===r)}const a=(0,n.CN)(1,1,.5),s=(0,n.CN)(0,.6,.2),c=(0,n.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>M});var i=r(49186),n=r(44208),o=r(53966),a=r(97768),s=r(74887),c=r(94656),l=r(63907),d=r(67171);const u=()=>o.A.getLogger("esri/views/webgl/textureUtils");function h(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&u().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(m(n)||p(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&u().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&u().error("Depth textures cannot sample mipmaps"):(9728!==i&&u().error("Depth textures without filtering must use NEAREST filtering"),r&&u().error("Depth textures without filtering cannot use compare function"))}}function m(e){return e in l.SB}function p(e){return e in l.iE}function f(e){return null!=e&&"type"in e&&"compressed"===e.type}function v(e){return null!=e&&!f(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function g(e){return 32879===e||35866===e}function _(e,t,r,i=1){let n=Math.max(t,r);return 32879===e&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function x(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case 5126:switch(e.pixelFormat){case 6408:return l.H0.RGBA32F;case 6407:return l.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case 5121:switch(e.pixelFormat){case 6408:return l.H0.RGBA8;case 6407:return l.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?l.iE.DEPTH24_STENCIL8:6402===t?l.SB.DEPTH_COMPONENT24:t,e.internalFormat}class b extends d.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new b(e,t)}}const w=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),y=()=>o.A.getLogger("esri/views/webgl/Texture");let M=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=b.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return w?0:(0,d.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!f(e)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in l.CQ&&(this._descriptor.internalFormat=void 0),this._setData(e),!f(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(t,r,n,o,a,s,c=0){s||y().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||y().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=x(l);const{context:d,pixelFormat:u,dataType:h,target:m,isImmutable:p}=l;if(p&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const g=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||n<0||r+o>l.width||n+a>l.height)&&y().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=d;c&&(o&&a||y().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),_.pixelStorei(_.UNPACK_SKIP_ROWS,c)),v(s)?_.texSubImage2D(m,t,r,n,o,a,u,h,s):f(s)?_.compressedTexSubImage2D(m,t,r,n,o,a,l.internalFormat,s.levels[t]):_.texSubImage2D(m,t,r,n,o,a,u,h,s),c&&_.pixelStorei(_.UNPACK_SKIP_ROWS,0),d.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,n,o,a,s,c,l){l||y().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||y().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=x(d);const{context:u,pixelFormat:h,dataType:m,isImmutable:p,target:v}=d;if(p&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");g(v)||y().warn("Attempting to set 3D texture data on a non-3D texture");const _=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||n<0||o<0||r+a>d.width||n+s>d.height||o+c>d.depth)&&y().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:b}=u;if(f(l))l=l.levels[t],b.compressedTexSubImage3D(v,t,r,n,o,a,s,c,d.internalFormat,l);else{const e=l;b.texSubImage3D(v,t,r,n,o,a,s,c,h,m,e)}u.bindTexture(_,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,h(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,h(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,h(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),h(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(t,r){const n=this._descriptor,o=n.context?.gl;if(!o)return;(0,c.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),n.context.instanceCounter.increment(l.vt.Texture,this)),h(n);const a=n.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);n.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(o);const s=r??n.target,d=g(s);if(v(t))this._setDataFromTexImageSource(t,s);else{const{width:e,height:r,depth:a}=n;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(d&&null==a)throw new i.A("texture:missing-depth","Depth must be specified!");if(n.internalFormat=x(n),n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,n.internalFormat,n.hasMipmap,e,r,a),f(t)){if(!function(e){return null!=e&&e in l.CQ}(n.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,n.internalFormat,s)}else this._texImage(s,0,n.internalFormat,e,r,a,t),(0,c.Y2)(o),n.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),n.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.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)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=x(i);const n=g(t),{width:o,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,s),this._texImage(t,0,i.internalFormat,o,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,c=_(r,n,o,a),l=Math.min(c,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,l),this._forEachMipmapLevel((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)},l)}_texStorage(e,t,r,n,o,a){const{gl:s}=this._descriptor.context;if(!function(e){return e in l.H0}(t)&&!m(t)&&!p(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?_(e,n,o,a):1;if(g(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,c,t,n,o,a)}else s.texStorage2D(e,c,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,a,s){const c=this._descriptor.context.gl,l=g(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,n,o,a,u,h,r)}else c.texSubImage2D(e,t,0,0,n,o,u,h,r)}}else{const d=s;if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,n,o,a,0,u,h,d)}else c.texImage2D(e,t,r,n,o,0,u,h,d)}}_compressedTexImage(e,t,r,n,o,a,s){const c=this._descriptor.context.gl,l=g(e);if(this._descriptor.isImmutable){if(null!=s)if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,n,o,a,r,s)}else c.compressedTexSubImage2D(e,t,0,0,n,o,r,s)}else if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,n,o,a,0,s)}else c.compressedTexImage2D(e,t,r,n,o,0,s)}async _compressOnWorker(t){const{width:r,height:i,context:n,flipped:o,preMultiplyAlpha:a,hasMipmap:c}=this._descriptor,l=this._descriptor.compress?.compressionTracker,d=this._descriptor.compress?.compressionCallback,{compressedTextureETC:u,compressedTextureS3TC:h}=n.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!u&&!h)return;this.abortCompression();const m=new AbortController;this._compressionAbortController=m,l?.increment();try{let n;t instanceof Uint8Array?n=t.buffer:(n=await createImageBitmap(t,{imageOrientation:o?"flipY":"none"}),(0,s.Te)(m));const l={data:n,width:r,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:a,hasMipmap:c,hasETC:!!u,hasS3TC:!!h},p=await e.compressionWorkerHandle.invoke(l,m.signal,"low");if((0,s.Te)(m),p.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=p.internalFormat,this._setData(p.compressedTexture),d?.(e-this.usedMemory)}}catch(e){(0,s.zf)(e)||y().error("Texture compression failed!")}finally{l?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null)}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:a,target:s}=this._descriptor;const c=32879===s;if(null==r||null==n||c&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),a&&(1!==r||1!==n||c&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),c&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>l,rA:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(40710),c=(r(33079),r(31821));function l(e,t){!function(e,t,...r){h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(c.H`void discardBySlice(vec3 pos) { }
718
+ }`);break;case 2:e.vertex.code.add(c.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,n.vt)()}}class p extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,n.vt)(),this.toMapSpace=(0,o.vt)()}}},74333:(e,t,r)=>{r.d(t,{n:()=>i}),r(44208);class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>o,SY:()=>c,mb:()=>a});var i=r(38954),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:a,emissiveFactor:s,occlusionTexture:c}){return null==e&&null==t&&null==a&&(null==s||(0,i.q)(s,n.uY))&&null==c&&(null==o||1===o)&&(null==r||1===r)}const a=(0,n.CN)(1,1,.5),s=(0,n.CN)(0,.6,.2),c=(0,n.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>M});var i=r(49186),n=r(44208),o=r(53966),a=r(97768),s=r(74887),c=r(94656),l=r(63907),d=r(67171);const u=()=>o.A.getLogger("esri/views/webgl/textureUtils");function h(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&u().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(p(n)||m(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&u().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&u().error("Depth textures cannot sample mipmaps"):(9728!==i&&u().error("Depth textures without filtering must use NEAREST filtering"),r&&u().error("Depth textures without filtering cannot use compare function"))}}function p(e){return e in l.SB}function m(e){return e in l.iE}function f(e){return null!=e&&"type"in e&&"compressed"===e.type}function v(e){return null!=e&&!f(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function g(e){return 32879===e||35866===e}function _(e,t,r,i=1){let n=Math.max(t,r);return 32879===e&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function x(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case 5126:switch(e.pixelFormat){case 6408:return l.H0.RGBA32F;case 6407:return l.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case 5121:switch(e.pixelFormat){case 6408:return l.H0.RGBA8;case 6407:return l.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?l.iE.DEPTH24_STENCIL8:6402===t?l.SB.DEPTH_COMPONENT24:t,e.internalFormat}class b extends d.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new b(e,t)}}const w=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),y=()=>o.A.getLogger("esri/views/webgl/Texture");let M=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=b.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return w?0:(0,d.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!f(e)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in l.CQ&&(this._descriptor.internalFormat=void 0),this._setData(e),!f(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(t,r,n,o,a,s,c=0){s||y().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||y().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=x(l);const{context:d,pixelFormat:u,dataType:h,target:p,isImmutable:m}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const g=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||n<0||r+o>l.width||n+a>l.height)&&y().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=d;c&&(o&&a||y().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),_.pixelStorei(_.UNPACK_SKIP_ROWS,c)),v(s)?_.texSubImage2D(p,t,r,n,o,a,u,h,s):f(s)?_.compressedTexSubImage2D(p,t,r,n,o,a,l.internalFormat,s.levels[t]):_.texSubImage2D(p,t,r,n,o,a,u,h,s),c&&_.pixelStorei(_.UNPACK_SKIP_ROWS,0),d.bindTexture(g,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,n,o,a,s,c,l){l||y().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||y().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=x(d);const{context:u,pixelFormat:h,dataType:p,isImmutable:m,target:v}=d;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");g(v)||y().warn("Attempting to set 3D texture data on a non-3D texture");const _=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||n<0||o<0||r+a>d.width||n+s>d.height||o+c>d.depth)&&y().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:b}=u;if(f(l))l=l.levels[t],b.compressedTexSubImage3D(v,t,r,n,o,a,s,c,d.internalFormat,l);else{const e=l;b.texSubImage3D(v,t,r,n,o,a,s,c,h,p,e)}u.bindTexture(_,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,h(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,h(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,h(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),h(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(t,r){const n=this._descriptor,o=n.context?.gl;if(!o)return;(0,c.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),n.context.instanceCounter.increment(l.vt.Texture,this)),h(n);const a=n.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);n.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(o);const s=r??n.target,d=g(s);if(v(t))this._setDataFromTexImageSource(t,s);else{const{width:e,height:r,depth:a}=n;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(d&&null==a)throw new i.A("texture:missing-depth","Depth must be specified!");if(n.internalFormat=x(n),n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,n.internalFormat,n.hasMipmap,e,r,a),f(t)){if(!function(e){return null!=e&&e in l.CQ}(n.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,n.internalFormat,s)}else this._texImage(s,0,n.internalFormat,e,r,a,t),(0,c.Y2)(o),n.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),n.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.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)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=x(i);const n=g(t),{width:o,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,s),this._texImage(t,0,i.internalFormat,o,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,c=_(r,n,o,a),l=Math.min(c,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,l),this._forEachMipmapLevel((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)},l)}_texStorage(e,t,r,n,o,a){const{gl:s}=this._descriptor.context;if(!function(e){return e in l.H0}(t)&&!p(t)&&!m(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?_(e,n,o,a):1;if(g(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,c,t,n,o,a)}else s.texStorage2D(e,c,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,a,s){const c=this._descriptor.context.gl,l=g(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,n,o,a,u,h,r)}else c.texSubImage2D(e,t,0,0,n,o,u,h,r)}}else{const d=s;if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,n,o,a,0,u,h,d)}else c.texImage2D(e,t,r,n,o,0,u,h,d)}}_compressedTexImage(e,t,r,n,o,a,s){const c=this._descriptor.context.gl,l=g(e);if(this._descriptor.isImmutable){if(null!=s)if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,n,o,a,r,s)}else c.compressedTexSubImage2D(e,t,0,0,n,o,r,s)}else if(l){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,n,o,a,0,s)}else c.compressedTexImage2D(e,t,r,n,o,0,s)}async _compressOnWorker(t){const{width:r,height:i,context:n,flipped:o,preMultiplyAlpha:a,hasMipmap:c}=this._descriptor,l=this._descriptor.compress?.compressionTracker,d=this._descriptor.compress?.compressionCallback,{compressedTextureETC:u,compressedTextureS3TC:h}=n.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!u&&!h)return;this.abortCompression();const p=new AbortController;this._compressionAbortController=p,l?.increment();try{let n;t instanceof Uint8Array?n=t.buffer:(n=await createImageBitmap(t,{imageOrientation:o?"flipY":"none"}),(0,s.Te)(p));const l={data:n,width:r,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:a,hasMipmap:c,hasETC:!!u,hasS3TC:!!h},m=await e.compressionWorkerHandle.invoke(l,p.signal,"low");if((0,s.Te)(p),m.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=m.internalFormat,this._setData(m.compressedTexture),d?.(e-this.usedMemory)}}catch(e){(0,s.zf)(e)||y().error("Texture compression failed!")}finally{l?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null)}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:a,target:s}=this._descriptor;const c=32879===s;if(null==r||null==n||c&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),a&&(1!==r||1!==n||c&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),c&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>l,rA:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(40710),c=(r(33079),r(31821));function l(e,t){!function(e,t,...r){h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(c.H`void discardBySlice(vec3 pos) { }
738
719
  vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,new s.W("slicePlaneOrigin",(e,r)=>v(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>g(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>g(t,e,r,r.slicePlane?.basis2)))}function d(e,t){h(e,t,new s.W("slicePlaneOrigin",(e,r)=>v(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>g(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>g(t,e,r,r.slicePlane?.basis2)))}r(65786).Y;const u=c.H`struct SliceFactors {
739
720
  float front;
740
721
  float side0;
@@ -773,13 +754,13 @@ return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
773
754
  }
774
755
  bool rejectBySlice(vec3 pos) {
775
756
  return sliceByPlane(pos);
776
- }`;function h(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(u)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function m(e,t,r){return e.instancedDoublePrecision?(0,o.i)(_,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function p(e,t){return null!=e?(0,o.d)(x,t.origin,e):t.origin}function f(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.Tl)(w,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function v(e,t,r){if(null==r.slicePlane)return a.uY;const i=m(e,t,r),n=p(i,r.slicePlane),s=f(e,i,r);return null!=s?(0,o.t)(x,n,s):n}function g(e,t,r,i){if(null==i||null==r.slicePlane)return a.uY;const n=m(e,t,r),s=p(n,r.slicePlane),c=f(e,n,r);return null!=c?((0,o.f)(b,i,s),(0,o.t)(x,s,c),(0,o.t)(b,b,c),(0,o.d)(b,b,x)):i}const _=(0,a.vt)(),x=(0,a.vt)(),b=(0,a.vt)(),w=(0,n.vt)()},76597:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(46686),n=r(31821);function o(e){(0,i.i$)(e),e.vertex.code.add(n.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
757
+ }`;function h(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(u)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function p(e,t,r){return e.instancedDoublePrecision?(0,o.i)(_,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function m(e,t){return null!=e?(0,o.d)(x,t.origin,e):t.origin}function f(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.Tl)(w,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function v(e,t,r){if(null==r.slicePlane)return a.uY;const i=p(e,t,r),n=m(i,r.slicePlane),s=f(e,i,r);return null!=s?(0,o.t)(x,n,s):n}function g(e,t,r,i){if(null==i||null==r.slicePlane)return a.uY;const n=p(e,t,r),s=m(n,r.slicePlane),c=f(e,n,r);return null!=c?((0,o.f)(b,i,s),(0,o.t)(x,s,c),(0,o.t)(b,b,c),(0,o.d)(b,b,x)):i}const _=(0,a.vt)(),x=(0,a.vt)(),b=(0,a.vt)(),w=(0,n.vt)()},76597:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(33120),n=r(31821);function o(e){(0,i.i$)(e),e.vertex.code.add(n.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
777
758
  vec4 eye = view * vec4(pos, 1.0);
778
759
  depth = calculateLinearDepth(nearFar,eye.z);
779
760
  return proj * eye;
780
761
  }`),e.vertex.code.add(n.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
781
762
  return proj * (view * vec4(pos, 1.0));
782
- }`)}},77108:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,n)=>i.setUniform2fv(e,t(n),r))}}},77194:(e,t,r)=>{r.d(t,{MD:()=>c,cJ:()=>s,hs:()=>l,m0:()=>a});var i=r(34727),n=(r(17352),r(97937));function o(e,t,r){const i=r.parameters;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d}function a(e,t){return(0,i.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}function s(e,t,r,i){i.scale=function(e,t,r){const i=o(e,t,r);return i.minScaleFactor=0,a(1,i)}(e,t,r),i.factor=0,i.minScaleFactor=r.minScaleFactor}function c(e,t,r=[0,0]){const i=Math.min(Math.max(t.scale,t.minScaleFactor),1);return r[0]=e[0]*i,r[1]=e[1]*i,r}function l(e,t,r,i){return a(e,o(t,r,i))}(0,i.kU)(10),(0,i.kU)(12),(0,i.kU)(70),(0,i.kU)(40);const d={scale:0,factor:0,minScaleFactor:0};(0,n.c)()},77695:(e,t,r)=>{r.d(t,{W:()=>u});var i=r(29242),n=r(48163),o=r(99208),a=r(47286),s=r(31821),c=r(35644),l=r(15976),d=r(63761);function u(e,t){const r=e.fragment,{hasVertexTangents:u,doubleSidedMode:h,hasNormalTexture:m,textureCoordinateType:p,bindType:f,hasNormalTextureTransform:v}=t;u?(e.attributes.add("tangent","vec4"),e.varyings.add("vTangent","vec4"),2===h?r.code.add(s.H`mat3 computeTangentSpace(vec3 normal) {
763
+ }`)}},77108:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,n)=>i.setUniform2fv(e,t(n),r))}}},77194:(e,t,r)=>{r.d(t,{MD:()=>c,cJ:()=>s,hs:()=>l,m0:()=>a});var i=r(34727),n=(r(17352),r(97937));function o(e,t,r){const i=r.parameters;return d.scale=Math.min(i.divisor/(t-i.offset),1),d.factor=function(e){return Math.abs(e*e*e)}(e),d}function a(e,t){return(0,i.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}function s(e,t,r,i){i.scale=function(e,t,r){const i=o(e,t,r);return i.minScaleFactor=0,a(1,i)}(e,t,r),i.factor=0,i.minScaleFactor=r.minScaleFactor}function c(e,t,r=[0,0]){const i=Math.min(Math.max(t.scale,t.minScaleFactor),1);return r[0]=e[0]*i,r[1]=e[1]*i,r}function l(e,t,r,i){return a(e,o(t,r,i))}(0,i.kU)(10),(0,i.kU)(12),(0,i.kU)(70),(0,i.kU)(40);const d={scale:0,factor:0,minScaleFactor:0};(0,n.c)()},77695:(e,t,r)=>{r.d(t,{W:()=>u});var i=r(29242),n=r(48163),o=r(99208),a=r(47286),s=r(31821),c=r(35644),l=r(15976),d=r(63761);function u(e,t){const r=e.fragment,{hasVertexTangents:u,doubleSidedMode:h,hasNormalTexture:p,textureCoordinateType:m,bindType:f,hasNormalTextureTransform:v}=t;u?(e.attributes.add("tangent","vec4"),e.varyings.add("vTangent","vec4"),2===h?r.code.add(s.H`mat3 computeTangentSpace(vec3 normal) {
783
764
  float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
784
765
  vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
785
766
  vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
@@ -800,7 +781,7 @@ T = T - normal * dot(normal, T);
800
781
  T *= inversesqrt(max(dot(T,T), 1.e-10));
801
782
  vec3 B = sign(det) * cross(normal, T);
802
783
  return mat3(T, B, normal);
803
- }`),m&&0!==p&&(e.include(o.r,t),r.uniforms.add(1===f?new d.N("normalTexture",e=>e.textureNormal):new l.o("normalTexture",e=>e.textureNormal)),v&&(r.uniforms.add(new a.G("scale",e=>e.scale??n.Un)),r.uniforms.add(new c.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK))),r.code.add(s.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
784
+ }`),p&&0!==m&&(e.include(o.r,t),r.uniforms.add(1===f?new d.N("normalTexture",e=>e.textureNormal):new l.o("normalTexture",e=>e.textureNormal)),v&&(r.uniforms.add(new a.G("scale",e=>e.scale??n.Un)),r.uniforms.add(new c.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK))),r.code.add(s.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
804
785
  vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),v&&r.code.add(s.H`mat3 normalRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0,
805
786
  normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
806
787
  0.0, 0.0, 0.0 );
@@ -808,10 +789,10 @@ rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.co
808
789
  }`))}},78662:(e,t,r)=>{r.d(t,{Gd:()=>c,VC:()=>l}),r(44208);var i=r(34727),n=(r(77690),r(29242),r(58083),r(9093)),o=r(38954),a=r(51850),s=(r(87317),r(91829),r(31756),r(26857),r(16943),r(65786));class c extends s.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}}function l(e,t,r){if(!t.vvSize)return(0,o.i)(e,1,1,1),e;if(Number.isNaN(r[0]))return(0,o.c)(e,t.vvSize.fallback);for(let n=0;n<3;++n){const o=t.vvSize.offset[n]+r[0]*t.vvSize.factor[n];e[n]=(0,i.qE)(o,t.vvSize.minSize[n],t.vvSize.maxSize[n])}return e}(0,n.vt)(),(0,a.vt)(),(0,n.vt)()},82048:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821);function n(e,t=!0){e.attributes.add("position","vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
809
790
  gl_Position = vec4(position, 0.0, 1.0);
810
791
  ${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
811
- `)}},82919:(e,t,r)=>{r.d(t,{DV:()=>g,C:()=>f,vt:()=>m,Qy:()=>p,ui:()=>v,ST:()=>b,bU:()=>w,pw:()=>x,m7:()=>_,c8:()=>M});var i=r(4341),n=r(58083),o=r(38954),a=r(51850),s=r(87317),c=r(91829),l=r(71351);function d(e){return e?{ray:(0,l.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,l.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>d());var u=r(27921),h=r(32114);function m(e){return e?[(0,u.vt)(e[0]),(0,u.vt)(e[1]),(0,u.vt)(e[2]),(0,u.vt)(e[3]),(0,u.vt)(e[4]),(0,u.vt)(e[5])]:[(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)()]}function p(){return[(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)()]}function f(e,t){for(let r=0;r<T;r++)(0,u.C)(e[r],t[r]);return e}function v(e,t,r,i=A){const a=(0,n.lw)(h.Rc.get(),t,e);(0,n.B8)(a,a);for(let e=0;e<C;++e){const t=(0,s.t)(h.Km.get(),S[e],a);(0,o.i)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}g(r,i)}function g(e,t){(0,u.Cr)(t[4],t[0],t[3],e[0]),(0,u.Cr)(t[1],t[5],t[6],e[1]),(0,u.Cr)(t[4],t[5],t[1],e[2]),(0,u.Cr)(t[3],t[2],t[6],e[3]),(0,u.Cr)(t[0],t[1],t[2],e[4]),(0,u.Cr)(t[5],t[4],t[7],e[5])}function _(e,t){for(let r=0;r<T;r++){const i=e[r];if(i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]>=t[3])return!1}return!0}function x(e,t){return y(e,function(e,t=d()){return(0,l.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,E.get()))}function b(e,t,r){return y(e,function(e,t,r=d()){const i=(0,o.l)(e.vector);return(0,l.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,E.get()))}function w(e,t){for(let r=0;r<T;r++)if((0,u.mN)(e[r],t)>0)return!1;return!0}function y(e,t){for(let r=0;r<T;r++)if(!(0,u.$Q)(e[r],t))return!1;return!0}const M={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},T=6,C=8,S=[(0,c.fA)(-1,-1,-1,1),(0,c.fA)(1,-1,-1,1),(0,c.fA)(1,1,-1,1),(0,c.fA)(-1,1,-1,1),(0,c.fA)(-1,-1,1,1),(0,c.fA)(1,-1,1,1),(0,c.fA)(1,1,1,1),(0,c.fA)(-1,1,1,1)],E=new i.I(d),A=p()},87170:(e,t,r)=>{r.d(t,{V:()=>M});var i=r(24326),n=r(9093),o=r(38954),a=r(97146),s=r(57917),c=r(29920),l=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,o.d)(m,t,e),(0,o.d)(p,r,e),.5*(0,o.l)((0,o.h)(m,m,p))}r(32114),new d.I(u.vt),new d.I(()=>function(e){return e?{p0:(0,l.o8)(e.p0),p1:(0,l.o8)(e.p1),p2:(0,l.o8)(e.p2)}:{p0:(0,l.vt)(),p1:(0,l.vt)(),p2:(0,l.vt)()}}());const m=(0,l.vt)(),p=(0,l.vt)(),f=(0,l.vt)(),v=(0,l.vt)(),g=(0,l.vt)(),_=(0,l.vt)();class x{constructor(){this.uid=(0,i.c)()}}class b extends x{constructor(e){super(),this.highlightName=e,this.channel=0}}var w=r(620),y=r(94656);class M{constructor(e,t,r=null,n=0,o=null,s=-1){this.material=e,this.mapPositions=r,this.type=n,this.objectAndLayerIdColor=o,this.edgeIndicesLength=s,this._highlights=null,this._highlightOptionsCounts=null,this.id=(0,i.c)(),this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,a.Dg)(r.indices)}),"position"===e&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new M(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,s.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,y.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.t)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.i)(t,0,0,0),(0,o.i)(_,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const c=n[e]*r,l=n[e+1]*r,d=n[e+2]*r;(0,o.i)(f,i[c],i[c+1],i[c+2]),(0,o.i)(v,i[l],i[l+1],i[l+2]),(0,o.i)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,o.f)(f,f,v),(0,o.f)(f,f,g),(0,o.g)(f,f,1/3*u),(0,o.f)(t,t,f),a+=u):((0,o.f)(_,_,f),(0,o.f)(_,_,v),(0,o.f)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.g)(t,t,1/a),0):0===s||((0,o.g)(t,_,1/s),0)))}(this.attributes.get("position"),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get("position");return function(e,t,r){if(!e)return!1;(0,o.i)(r,0,0,0),(0,o.i)(_,0,0,0);let i=0,n=0;const{size:a,data:s,indices:c}=e,l=c.length-1,d=l+(t?2:0);for(let e=0;e<d;e+=2){const t=e<l?e+1:0,d=c[e<l?e:l]*a,u=c[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,o.g)(f,(0,o.f)(f,f,v),.5);const h=(0,o.F)(f,v);h>0?((0,o.f)(r,r,(0,o.g)(f,f,h)),i+=h):0===i&&((0,o.f)(_,_,f),n++)}return 0!==i?((0,o.g)(r,r,1/i),!0):0!==n&&((0,o.g)(r,_,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.i)(t,0,0,0);let a=-1,s=0;for(let e=0;e<n.length;e++){const o=n[e]*r;a!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),a=o}return s>1&&(0,o.g)(t,t,1/s),s>0}(this.attributes.get("position"),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get("position");if(!e||0===e.indices.length)return null;const t=0===this.type?3:1;(0,w.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,a.tM)(e.indices.length/t);return new c.j(r,t,e)}get transformation(){return this._transformation??n.zK}set transformation(e){this._transformation=e&&e!==n.zK?(0,n.o8)(e):null}get highlights(){return this._highlights||T}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new b(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const T=new Set},88076:(e,t,r)=>{r.d(t,{$U:()=>ie,fs:()=>oe,ty:()=>ae});var i=r(38954),n=r(51850),o=r(1843),a=r(49255),s=r(16943),c=r(25634),l=r(11725),d=r(33524),u=r(70328),h=r(620);class m{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const p=(0,u.vt)();function f(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(A,n,r),c=(e,t,r)=>{a(e,r,t)},l=new m(!1,t.options.normalRequired);if(e.boundingInfo){(0,h.vA)(0===e.type);const i=t.tolerance;g(e.boundingInfo,r,s,i,o,l,c)}else{const t=e.attributes.get("position"),n=t.indices;!function(e,t,r,n,o,a,s,c,l,d){const u=t,h=R,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),v=m>=p?m>=f?0:2:p>=f?1:2,g=v,_=u[g]<0?2:1,y=(v+_)%3,T=(v+(3-_))%3,C=u[y]/u[g],S=u[T]/u[g],E=1/u[g],A=x,I=b,P=w,{normalRequired:F}=l;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.i)(h[0],a[n+0],a[n+1],a[n+2]);const l=s*o[r+1];(0,i.i)(h[1],a[l+0],a[l+1],a[l+2]);const u=s*o[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),c&&((0,i.c)(h[0],c.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],c.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],c.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(A,h[0],e),(0,i.a)(I,h[1],e),(0,i.a)(P,h[2],e);const m=A[y]-C*A[g],p=A[T]-S*A[g],f=I[y]-C*I[g],v=I[T]-S*I[g],_=P[y]-C*P[g],x=P[T]-S*P[g],b=_*v-x*f,w=m*x-p*_,R=f*p-v*m;if((b<0||w<0||R<0)&&(b>0||w>0||R>0))continue;const O=b+w+R;if(0===O)continue;const D=b*(E*A[g])+w*(E*I[g])+R*(E*P[g]);if(D*Math.sign(O)<0)continue;const H=D/O;H>=0&&d(H,t,F?M(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,l,c)}}const v=(0,n.vt)();function g(e,t,r,n,o,a,s){if(null==e)return;const c=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,v);if((0,u.Ne)(p,e.bbMin),(0,u.vI)(p,e.bbMax),null!=o&&o.applyToAabb(p),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const c=(e[1]-i-t[1])*r[1],l=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(c,l)),s<0)return!1;if(a=Math.max(a,Math.min(c,l)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(p,t,c,n)){const{primitiveIndices:i,position:c}=e,l=i?i.length:c.indices.length/3;if(l>S){const i=e.getChildren();if(void 0!==i){for(const e of i)g(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,c,l,d){const u=e[0],h=e[1],m=e[2],p=t[0],f=t[1],v=t[2],{normalRequired:g}=l;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let l=o[i],x=o[i+1],b=o[i+2];const w=a*n[r+1];let M=o[w],T=o[w+1],C=o[w+2];const S=a*n[r+2];let A=o[S],R=o[S+1],I=o[S+2];null!=c&&([l,x,b]=c.applyToVertex(l,x,b,e),[M,T,C]=c.applyToVertex(M,T,C,e),[A,R,I]=c.applyToVertex(A,R,I,e));const P=M-l,F=T-x,O=C-b,D=A-l,H=R-x,N=I-b,L=f*N-H*v,B=v*D-N*p,G=p*H-D*f,z=P*L+F*B+O*G;if(Math.abs(z)<=E)continue;const U=u-l,V=h-x,j=m-b,W=U*L+V*B+j*G;if(z>0){if(W<0||W>z)continue}else if(W>0||W<z)continue;const k=V*O-F*j,$=j*P-O*U,q=U*F-P*V,Z=p*k+f*$+v*q;if(z>0){if(Z<0||W+Z>z)continue}else if(Z>0||W+Z<z)continue;const Y=(D*k+H*$+N*q)/z;Y>=0&&d(Y,t,g?y(P,F,O,D,H,N,_):null)}}(t,r,0,l,c.indices,c.data,c.stride,i,o,a,s)}}const _=(0,n.vt)();const x=(0,n.vt)(),b=(0,n.vt)(),w=(0,n.vt)();function y(e,t,r,n,o,a,s){return(0,i.i)(T,e,t,r),(0,i.i)(C,n,o,a),(0,i.h)(s,T,C),(0,i.n)(s,s),s}function M(e){return(0,i.a)(T,e[1],e[0]),(0,i.a)(C,e[2],e[0]),(0,i.h)(_,T,C),(0,i.n)(_,_),_}const T=(0,n.vt)(),C=(0,n.vt)(),S=1e3,E=1e-7,A=(0,n.vt)(),R=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var I=r(16396),P=r(13030),F=r(59907);class O{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return(0,F.SA)(r,i,this.vertexBufferLayout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const c=this.vertexBufferLayout.createView(e).getField("position",P.xs);if(null==c)return;const l=(0,i.a)(D,a,o),d=c.count/3,u=n.options.normalRequired;!function(e,t,r,i,n,o,a,s){const c=e[0],l=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=0;e<i;++e){const t=3*e,r=t+1,i=t+2,p=o*t,f=n[p],v=n[p+1],g=n[p+2],x=o*r,b=o*i,w=n[x]-f,M=n[x+1]-v,T=n[x+2]-g,C=n[b]-f,S=n[b+1]-v,A=n[b+2]-g,R=h*A-S*m,I=m*C-A*u,P=u*S-C*h,F=w*R+M*I+T*P;if(Math.abs(F)<=E)continue;const O=c-f,D=l-v,H=d-g,N=O*R+D*I+H*P;if(F>0){if(N<0||N>F)continue}else if(N>0||N<F)continue;const L=D*T-M*H,B=H*w-T*O,G=O*M-w*D,z=u*L+h*B+m*G;if(F>0){if(z<0||N+z>F)continue}else if(z>0||N+z<F)continue;const U=(C*L+S*B+A*G)/F;U>=0&&s(U,e,a?y(w,M,T,C,S,A,_):null)}}(o,l,0,d,c.typedBuffer,c.typedBufferStride,u,(e,t,r)=>{s(e,r,t)})}}const D=(0,n.vt)();var H=r(43616),N=r(91829),L=r(72824),B=r(97220),G=r(98958);const z={mask:255},U={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},V={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var j=r(74810),W=r(28491),k=r(90644),$=r(49788);class q extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=j.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.isInstanced=!1,this.hasInstancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=n.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,n.CN)(.2,.2,.2),this.diffuse=(0,n.CN)(.8,.8,.8),this.externalColor=(0,N.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,n.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=$.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}}L.gy;class Z extends G.w{constructor(e,t,i=new B.$(W.D,()=>r.e(5141).then(r.bind(r,5141)))){super(e,t,i),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:n,cullFace:o,customDepthTest:s,hasOccludees:c}=e;return(0,k.Ey)({blending:(0,a.RN)(i)&&n?(0,d.Yf)(r):null,culling:X(e)?(0,k.Xt)(o):null,depthTest:{func:(0,d.K_)(r,Y(s))},depthWrite:(0,d.z5)(e),drawBuffers:(0,G.L)(i,(0,d.m6)(r,i)),colorWrite:k.kn,stencilWrite:c?z:null,stencilTest:c?t?V:U:null,polygonOffset:(0,d.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Y(e){return 1===e?515:513}function X(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}var J=r(31635),K=r(51976),Q=r(35256);class ee extends Q.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instancedDoublePrecision=!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.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasBloom=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture||this.hasNormalTexture?1:0}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,J.Cg)([(0,K.W)({count:4})],ee.prototype,"alphaDiscardMode",void 0),(0,J.Cg)([(0,K.W)({count:3})],ee.prototype,"doubleSidedMode",void 0),(0,J.Cg)([(0,K.W)({count:7})],ee.prototype,"pbrMode",void 0),(0,J.Cg)([(0,K.W)({count:3})],ee.prototype,"cullFace",void 0),(0,J.Cg)([(0,K.W)({count:3})],ee.prototype,"normalType",void 0),(0,J.Cg)([(0,K.W)({count:2})],ee.prototype,"customDepthTest",void 0),(0,J.Cg)([(0,K.W)({count:4})],ee.prototype,"emissionSource",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasVertexColors",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasSymbolColors",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasVerticalOffset",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasColorTexture",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasMetallicRoughnessTexture",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasOcclusionTexture",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasNormalTexture",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasScreenSizePerspective",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasVertexTangents",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasOccludees",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"instancedDoublePrecision",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasModelTransformation",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"offsetBackfaces",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"vvSize",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"vvColor",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"receiveShadows",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"receiveAmbientOcclusion",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"textureAlphaPremultiplied",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"instanced",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"instancedColor",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"writeDepth",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"transparent",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"enableOffset",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"terrainDepthTest",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"cullAboveTerrain",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"snowCover",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasBloom",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasColorTextureTransform",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasEmissionTextureTransform",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasNormalTextureTransform",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasOcclusionTextureTransform",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasMetallicRoughnessTextureTransform",void 0);var te=r(57323);class re extends Z{constructor(e,t){super(e,t,new B.$(te.R,()=>r.e(9933).then(r.bind(r,39933)))),this.type="RealisticTreeTechnique"}}class ie extends l.i{constructor(e,t){super(e,oe),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,a.iq)(e)||(0,a.PJ)(e))&&!this.transparent],[4,e=>((0,a.iq)(e)||(0,a.PJ)(e))&&this.transparent&&this.parameters.writeDepth],[7,e=>((0,a.XY)(e)||(0,a.PJ)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,o.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),(0,s.E)()&&t.vec4u8("objectAndLayerIdColor"),t}(this.parameters),this._configuration=new ee(t.spherical)}isVisibleForOutput(e){return 4!==e&&6!==e&&5!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=$.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.q)(this.parameters.emissiveBaseColor,n.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:o,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=!n&&!!r.normalTextureId,i.hasColorTexture=!!r.textureId,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.isInstanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.vvSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?2:o&&"normal"===s?1:o&&"winding-order"===s?2:0,i.instancedColor=r.hasInstancedColor,(0,a.RN)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.vvColor=!!r.vvColor,i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.hasMetallicRoughnessTexture=!n&&!!r.metallicRoughnessTextureId,i.emissionSource=n?0:null!=r.emissiveTextureId&&0===r.emissiveSource?3:r.usePBR?0===r.emissiveSource?2:1:0,i.hasOcclusionTexture=!n&&!!r.occlusionTextureId,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.camera.relativeElevation<d.xt,i.snowCover=t.snowCover,i.hasBloom=(0,a.LG)(e),i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,n,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(he,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(de,he);break;case 2:a=(0,i.c)(de,le)}let s=0;const c=(0,i.d)(me,he,e.eye),l=(0,i.l)(c),d=(0,i.g)(c,c,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,i.e)(a,d)),s+=(0,H.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,i.g)(a,a,s),(0,i.o)(ue,a,r.transform.inverseRotation),n=(0,i.d)(se,n,ue),o=(0,i.d)(ce,o,ue)}f(e,r,n,o,(0,I.ou)(r.verticalOffset),a)}createGLMaterial(e){return new ne(e)}createBufferWriter(){return new O(this._vertexBufferLayout)}get transparent(){return ae(this.parameters)}}class ne extends c.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?re:Z,e)}}class oe extends q{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}function ae(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:a,textureAlphaMode:s,colorMixMode:c}=e,l=i[3];return t||r<1&&"replace"!==c||l<1&&"ignore"!==c||n<1||(null!=o||null!=a)&&1!==s&&2!==s&&"replace"!==c}const se=(0,n.vt)(),ce=(0,n.vt)(),le=(0,n.fA)(0,0,1),de=(0,n.vt)(),ue=(0,n.vt)(),he=(0,n.vt)(),me=(0,n.vt)()},89390:(e,t,r)=>{r.d(t,{kA:()=>C,a8:()=>M,eU:()=>T});var i=r(40876),n=(r(44208),r(38954)),o=r(51850),a=r(87317),s=r(91829),c=r(23205),l=r(14314),d=r(31821);function u(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.d("lightingAmbientSH0",({lighting:e})=>(0,n.i)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
792
+ `)}},82919:(e,t,r)=>{r.d(t,{DV:()=>g,C:()=>f,vt:()=>p,Qy:()=>m,ui:()=>v,ST:()=>b,bU:()=>w,pw:()=>x,m7:()=>_,c8:()=>M});var i=r(4341),n=r(58083),o=r(38954),a=r(51850),s=r(87317),c=r(91829),l=r(71351);function d(e){return e?{ray:(0,l.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,l.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>d());var u=r(27921),h=r(32114);function p(e){return e?[(0,u.vt)(e[0]),(0,u.vt)(e[1]),(0,u.vt)(e[2]),(0,u.vt)(e[3]),(0,u.vt)(e[4]),(0,u.vt)(e[5])]:[(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)()]}function m(){return[(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)()]}function f(e,t){for(let r=0;r<T;r++)(0,u.C)(e[r],t[r]);return e}function v(e,t,r,i=A){const a=(0,n.lw)(h.Rc.get(),t,e);(0,n.B8)(a,a);for(let e=0;e<C;++e){const t=(0,s.t)(h.Km.get(),S[e],a);(0,o.i)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}g(r,i)}function g(e,t){(0,u.Cr)(t[4],t[0],t[3],e[0]),(0,u.Cr)(t[1],t[5],t[6],e[1]),(0,u.Cr)(t[4],t[5],t[1],e[2]),(0,u.Cr)(t[3],t[2],t[6],e[3]),(0,u.Cr)(t[0],t[1],t[2],e[4]),(0,u.Cr)(t[5],t[4],t[7],e[5])}function _(e,t){for(let r=0;r<T;r++){const i=e[r];if(i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]>=t[3])return!1}return!0}function x(e,t){return y(e,function(e,t=d()){return(0,l.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,E.get()))}function b(e,t,r){return y(e,function(e,t,r=d()){const i=(0,o.l)(e.vector);return(0,l.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,E.get()))}function w(e,t){for(let r=0;r<T;r++)if((0,u.mN)(e[r],t)>0)return!1;return!0}function y(e,t){for(let r=0;r<T;r++)if(!(0,u.$Q)(e[r],t))return!1;return!0}const M={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},T=6,C=8,S=[(0,c.fA)(-1,-1,-1,1),(0,c.fA)(1,-1,-1,1),(0,c.fA)(1,1,-1,1),(0,c.fA)(-1,1,-1,1),(0,c.fA)(-1,-1,1,1),(0,c.fA)(1,-1,1,1),(0,c.fA)(1,1,1,1),(0,c.fA)(-1,1,1,1)],E=new i.I(d),A=m()},87170:(e,t,r)=>{r.d(t,{V:()=>M});var i=r(24326),n=r(9093),o=r(38954),a=r(97146),s=r(57917),c=r(29920),l=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,o.d)(p,t,e),(0,o.d)(m,r,e),.5*(0,o.l)((0,o.h)(p,p,m))}r(32114),new d.I(u.vt),new d.I(()=>function(e){return e?{p0:(0,l.o8)(e.p0),p1:(0,l.o8)(e.p1),p2:(0,l.o8)(e.p2)}:{p0:(0,l.vt)(),p1:(0,l.vt)(),p2:(0,l.vt)()}}());const p=(0,l.vt)(),m=(0,l.vt)(),f=(0,l.vt)(),v=(0,l.vt)(),g=(0,l.vt)(),_=(0,l.vt)();class x{constructor(){this.uid=(0,i.c)()}}class b extends x{constructor(e){super(),this.highlightName=e,this.channel=0}}var w=r(620),y=r(94656);class M{constructor(e,t,r=null,n=0,o=null,s=-1){this.material=e,this.mapPositions=r,this.type=n,this.objectAndLayerIdColor=o,this.edgeIndicesLength=s,this._highlights=null,this._highlightOptionsCounts=null,this.id=(0,i.c)(),this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,a.Dg)(r.indices)}),"position"===e&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new M(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,s.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,y.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.t)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.i)(t,0,0,0),(0,o.i)(_,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const c=n[e]*r,l=n[e+1]*r,d=n[e+2]*r;(0,o.i)(f,i[c],i[c+1],i[c+2]),(0,o.i)(v,i[l],i[l+1],i[l+2]),(0,o.i)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,o.f)(f,f,v),(0,o.f)(f,f,g),(0,o.g)(f,f,1/3*u),(0,o.f)(t,t,f),a+=u):((0,o.f)(_,_,f),(0,o.f)(_,_,v),(0,o.f)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.g)(t,t,1/a),0):0===s||((0,o.g)(t,_,1/s),0)))}(this.attributes.get("position"),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get("position");return function(e,t,r){if(!e)return!1;(0,o.i)(r,0,0,0),(0,o.i)(_,0,0,0);let i=0,n=0;const{size:a,data:s,indices:c}=e,l=c.length-1,d=l+(t?2:0);for(let e=0;e<d;e+=2){const t=e<l?e+1:0,d=c[e<l?e:l]*a,u=c[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,o.g)(f,(0,o.f)(f,f,v),.5);const h=(0,o.F)(f,v);h>0?((0,o.f)(r,r,(0,o.g)(f,f,h)),i+=h):0===i&&((0,o.f)(_,_,f),n++)}return 0!==i?((0,o.g)(r,r,1/i),!0):0!==n&&((0,o.g)(r,_,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.i)(t,0,0,0);let a=-1,s=0;for(let e=0;e<n.length;e++){const o=n[e]*r;a!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),a=o}return s>1&&(0,o.g)(t,t,1/s),s>0}(this.attributes.get("position"),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get("position");if(!e||0===e.indices.length)return null;const t=0===this.type?3:1;(0,w.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,a.tM)(e.indices.length/t);return new c.j(r,t,e)}get transformation(){return this._transformation??n.zK}set transformation(e){this._transformation=e&&e!==n.zK?(0,n.o8)(e):null}get highlights(){return this._highlights||T}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new b(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const T=new Set},88076:(e,t,r)=>{r.d(t,{$U:()=>ie,fs:()=>oe,ty:()=>ae});var i=r(38954),n=r(51850),o=r(1843),a=r(49255),s=r(16943),c=r(25634),l=r(11725),d=r(33524),u=r(70328),h=r(620);class p{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const m=(0,u.vt)();function f(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(A,n,r),c=(e,t,r)=>{a(e,r,t)},l=new p(!1,t.options.normalRequired);if(e.boundingInfo){(0,h.vA)(0===e.type);const i=t.tolerance;g(e.boundingInfo,r,s,i,o,l,c)}else{const t=e.attributes.get("position"),n=t.indices;!function(e,t,r,n,o,a,s,c,l,d){const u=t,h=R,p=Math.abs(u[0]),m=Math.abs(u[1]),f=Math.abs(u[2]),v=p>=m?p>=f?0:2:m>=f?1:2,g=v,_=u[g]<0?2:1,y=(v+_)%3,T=(v+(3-_))%3,C=u[y]/u[g],S=u[T]/u[g],E=1/u[g],A=x,I=b,P=w,{normalRequired:O}=l;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.i)(h[0],a[n+0],a[n+1],a[n+2]);const l=s*o[r+1];(0,i.i)(h[1],a[l+0],a[l+1],a[l+2]);const u=s*o[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),c&&((0,i.c)(h[0],c.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],c.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],c.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(A,h[0],e),(0,i.a)(I,h[1],e),(0,i.a)(P,h[2],e);const p=A[y]-C*A[g],m=A[T]-S*A[g],f=I[y]-C*I[g],v=I[T]-S*I[g],_=P[y]-C*P[g],x=P[T]-S*P[g],b=_*v-x*f,w=p*x-m*_,R=f*m-v*p;if((b<0||w<0||R<0)&&(b>0||w>0||R>0))continue;const D=b+w+R;if(0===D)continue;const F=b*(E*A[g])+w*(E*I[g])+R*(E*P[g]);if(F*Math.sign(D)<0)continue;const H=F/D;H>=0&&d(H,t,O?M(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,l,c)}}const v=(0,n.vt)();function g(e,t,r,n,o,a,s){if(null==e)return;const c=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,v);if((0,u.Ne)(m,e.bbMin),(0,u.vI)(m,e.bbMax),null!=o&&o.applyToAabb(m),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const c=(e[1]-i-t[1])*r[1],l=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(c,l)),s<0)return!1;if(a=Math.max(a,Math.min(c,l)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(m,t,c,n)){const{primitiveIndices:i,position:c}=e,l=i?i.length:c.indices.length/3;if(l>S){const i=e.getChildren();if(void 0!==i){for(const e of i)g(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,c,l,d){const u=e[0],h=e[1],p=e[2],m=t[0],f=t[1],v=t[2],{normalRequired:g}=l;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let l=o[i],x=o[i+1],b=o[i+2];const w=a*n[r+1];let M=o[w],T=o[w+1],C=o[w+2];const S=a*n[r+2];let A=o[S],R=o[S+1],I=o[S+2];null!=c&&([l,x,b]=c.applyToVertex(l,x,b,e),[M,T,C]=c.applyToVertex(M,T,C,e),[A,R,I]=c.applyToVertex(A,R,I,e));const P=M-l,O=T-x,D=C-b,F=A-l,H=R-x,N=I-b,L=f*N-H*v,B=v*F-N*m,G=m*H-F*f,z=P*L+O*B+D*G;if(Math.abs(z)<=E)continue;const U=u-l,V=h-x,j=p-b,W=U*L+V*B+j*G;if(z>0){if(W<0||W>z)continue}else if(W>0||W<z)continue;const k=V*D-O*j,$=j*P-D*U,q=U*O-P*V,Z=m*k+f*$+v*q;if(z>0){if(Z<0||W+Z>z)continue}else if(Z>0||W+Z<z)continue;const Y=(F*k+H*$+N*q)/z;Y>=0&&d(Y,t,g?y(P,O,D,F,H,N,_):null)}}(t,r,0,l,c.indices,c.data,c.stride,i,o,a,s)}}const _=(0,n.vt)();const x=(0,n.vt)(),b=(0,n.vt)(),w=(0,n.vt)();function y(e,t,r,n,o,a,s){return(0,i.i)(T,e,t,r),(0,i.i)(C,n,o,a),(0,i.h)(s,T,C),(0,i.n)(s,s),s}function M(e){return(0,i.a)(T,e[1],e[0]),(0,i.a)(C,e[2],e[0]),(0,i.h)(_,T,C),(0,i.n)(_,_),_}const T=(0,n.vt)(),C=(0,n.vt)(),S=1e3,E=1e-7,A=(0,n.vt)(),R=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var I=r(16396),P=r(13030),O=r(59907);class D{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return(0,O.SA)(r,i,this.vertexBufferLayout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const c=this.vertexBufferLayout.createView(e).getField("position",P.xs);if(null==c)return;const l=(0,i.a)(F,a,o),d=c.count/3,u=n.options.normalRequired;!function(e,t,r,i,n,o,a,s){const c=e[0],l=e[1],d=e[2],u=t[0],h=t[1],p=t[2];for(let e=0;e<i;++e){const t=3*e,r=t+1,i=t+2,m=o*t,f=n[m],v=n[m+1],g=n[m+2],x=o*r,b=o*i,w=n[x]-f,M=n[x+1]-v,T=n[x+2]-g,C=n[b]-f,S=n[b+1]-v,A=n[b+2]-g,R=h*A-S*p,I=p*C-A*u,P=u*S-C*h,O=w*R+M*I+T*P;if(Math.abs(O)<=E)continue;const D=c-f,F=l-v,H=d-g,N=D*R+F*I+H*P;if(O>0){if(N<0||N>O)continue}else if(N>0||N<O)continue;const L=F*T-M*H,B=H*w-T*D,G=D*M-w*F,z=u*L+h*B+p*G;if(O>0){if(z<0||N+z>O)continue}else if(z>0||N+z<O)continue;const U=(C*L+S*B+A*G)/O;U>=0&&s(U,e,a?y(w,M,T,C,S,A,_):null)}}(o,l,0,d,c.typedBuffer,c.typedBufferStride,u,(e,t,r)=>{s(e,r,t)})}}const F=(0,n.vt)();var H=r(43616),N=r(91829),L=r(72824),B=r(97220),G=r(98958);const z={mask:255},U={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},V={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var j=r(74810),W=r(28491),k=r(90644),$=r(49788);class q extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=j.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.isInstanced=!1,this.hasInstancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=n.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,n.CN)(.2,.2,.2),this.diffuse=(0,n.CN)(.8,.8,.8),this.externalColor=(0,N.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,n.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=$.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}}L.gy;class Z extends G.w{constructor(e,t,i=new B.$(W.D,()=>r.e(5141).then(r.bind(r,5141)))){super(e,t,i),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:n,cullFace:o,customDepthTest:s,hasOccludees:c}=e;return(0,k.Ey)({blending:(0,a.RN)(i)&&n?(0,d.Yf)(r):null,culling:X(e)?(0,k.Xt)(o):null,depthTest:{func:(0,d.K_)(r,Y(s))},depthWrite:(0,d.z5)(e),drawBuffers:(0,G.L)(i,(0,d.m6)(r,i)),colorWrite:k.kn,stencilWrite:c?z:null,stencilTest:c?t?V:U:null,polygonOffset:(0,d.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Y(e){return 1===e?515:513}function X(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}var J=r(31635),K=r(51976),Q=r(35256);class ee extends Q.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instancedDoublePrecision=!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.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasBloom=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture||this.hasNormalTexture?1:0}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,J.Cg)([(0,K.W)({count:4})],ee.prototype,"alphaDiscardMode",void 0),(0,J.Cg)([(0,K.W)({count:3})],ee.prototype,"doubleSidedMode",void 0),(0,J.Cg)([(0,K.W)({count:7})],ee.prototype,"pbrMode",void 0),(0,J.Cg)([(0,K.W)({count:3})],ee.prototype,"cullFace",void 0),(0,J.Cg)([(0,K.W)({count:3})],ee.prototype,"normalType",void 0),(0,J.Cg)([(0,K.W)({count:2})],ee.prototype,"customDepthTest",void 0),(0,J.Cg)([(0,K.W)({count:4})],ee.prototype,"emissionSource",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasVertexColors",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasSymbolColors",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasVerticalOffset",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasColorTexture",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasMetallicRoughnessTexture",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasOcclusionTexture",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasNormalTexture",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasScreenSizePerspective",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasVertexTangents",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasOccludees",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"instancedDoublePrecision",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasModelTransformation",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"offsetBackfaces",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"vvSize",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"vvColor",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"receiveShadows",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"receiveAmbientOcclusion",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"textureAlphaPremultiplied",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"instanced",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"instancedColor",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"writeDepth",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"transparent",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"enableOffset",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"terrainDepthTest",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"cullAboveTerrain",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"snowCover",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasBloom",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasColorTextureTransform",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasEmissionTextureTransform",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasNormalTextureTransform",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasOcclusionTextureTransform",void 0),(0,J.Cg)([(0,K.W)()],ee.prototype,"hasMetallicRoughnessTextureTransform",void 0);var te=r(57323);class re extends Z{constructor(e,t){super(e,t,new B.$(te.R,()=>r.e(9933).then(r.bind(r,39933)))),this.type="RealisticTreeTechnique"}}class ie extends l.i{constructor(e,t){super(e,oe),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,a.iq)(e)||(0,a.PJ)(e))&&!this.transparent],[4,e=>((0,a.iq)(e)||(0,a.PJ)(e))&&this.transparent&&this.parameters.writeDepth],[7,e=>((0,a.XY)(e)||(0,a.PJ)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,o.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),(0,s.E)()&&t.vec4u8("objectAndLayerIdColor"),t}(this.parameters),this._configuration=new ee(t.spherical)}isVisibleForOutput(e){return 4!==e&&6!==e&&5!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=$.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.q)(this.parameters.emissiveBaseColor,n.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:o,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=!n&&!!r.normalTextureId,i.hasColorTexture=!!r.textureId,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.isInstanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.vvSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?2:o&&"normal"===s?1:o&&"winding-order"===s?2:0,i.instancedColor=r.hasInstancedColor,(0,a.RN)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.vvColor=!!r.vvColor,i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.hasMetallicRoughnessTexture=!n&&!!r.metallicRoughnessTextureId,i.emissionSource=n?0:null!=r.emissiveTextureId&&0===r.emissiveSource?3:r.usePBR?0===r.emissiveSource?2:1:0,i.hasOcclusionTexture=!n&&!!r.occlusionTextureId,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.camera.relativeElevation<d.xt,i.snowCover=t.snowCover,i.hasBloom=(0,a.LG)(e),i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,n,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(he,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(de,he);break;case 2:a=(0,i.c)(de,le)}let s=0;const c=(0,i.d)(pe,he,e.eye),l=(0,i.l)(c),d=(0,i.g)(c,c,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,i.e)(a,d)),s+=(0,H.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,i.g)(a,a,s),(0,i.o)(ue,a,r.transform.inverseRotation),n=(0,i.d)(se,n,ue),o=(0,i.d)(ce,o,ue)}f(e,r,n,o,(0,I.ou)(r.verticalOffset),a)}createGLMaterial(e){return new ne(e)}createBufferWriter(){return new D(this._vertexBufferLayout)}get transparent(){return ae(this.parameters)}}class ne extends c.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?re:Z,e)}}class oe extends q{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}function ae(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:a,textureAlphaMode:s,colorMixMode:c}=e,l=i[3];return t||r<1&&"replace"!==c||l<1&&"ignore"!==c||n<1||(null!=o||null!=a)&&1!==s&&2!==s&&"replace"!==c}const se=(0,n.vt)(),ce=(0,n.vt)(),le=(0,n.fA)(0,0,1),de=(0,n.vt)(),ue=(0,n.vt)(),he=(0,n.vt)(),pe=(0,n.vt)()},89390:(e,t,r)=>{r.d(t,{kA:()=>C,a8:()=>M,eU:()=>T});var i=r(40876),n=(r(44208),r(38954)),o=r(51850),a=r(87317),s=r(91829),c=r(23205),l=r(14314),d=r(31821);function u(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.d("lightingAmbientSH0",({lighting:e})=>(0,n.i)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
812
793
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
813
794
  return ambientLight * (1.0 - ambientOcclusion);
814
- }`)):1===i?(r.uniforms.add(new l.I("lightingAmbientSH_R",({lighting:e})=>(0,a.s)(m,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3])),new l.I("lightingAmbientSH_G",({lighting:e})=>(0,a.s)(m,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3])),new l.I("lightingAmbientSH_B",({lighting:e})=>(0,a.s)(m,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
795
+ }`)):1===i?(r.uniforms.add(new l.I("lightingAmbientSH_R",({lighting:e})=>(0,a.s)(p,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3])),new l.I("lightingAmbientSH_G",({lighting:e})=>(0,a.s)(p,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3])),new l.I("lightingAmbientSH_B",({lighting:e})=>(0,a.s)(p,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
815
796
  vec4 sh0 = vec4(
816
797
  0.282095,
817
798
  0.488603 * normal.x,
@@ -824,7 +805,7 @@ dot(lightingAmbientSH_G, sh0),
824
805
  dot(lightingAmbientSH_B, sh0)
825
806
  );
826
807
  return ambientLight * (1.0 - ambientOcclusion);
827
- }`)):2===i&&(r.uniforms.add(new c.d("lightingAmbientSH0",({lighting:e})=>(0,n.i)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0])),new l.I("lightingAmbientSH_R1",({lighting:e})=>(0,a.s)(m,e.sh.r[1],e.sh.r[2],e.sh.r[3],e.sh.r[4])),new l.I("lightingAmbientSH_G1",({lighting:e})=>(0,a.s)(m,e.sh.g[1],e.sh.g[2],e.sh.g[3],e.sh.g[4])),new l.I("lightingAmbientSH_B1",({lighting:e})=>(0,a.s)(m,e.sh.b[1],e.sh.b[2],e.sh.b[3],e.sh.b[4])),new l.I("lightingAmbientSH_R2",({lighting:e})=>(0,a.s)(m,e.sh.r[5],e.sh.r[6],e.sh.r[7],e.sh.r[8])),new l.I("lightingAmbientSH_G2",({lighting:e})=>(0,a.s)(m,e.sh.g[5],e.sh.g[6],e.sh.g[7],e.sh.g[8])),new l.I("lightingAmbientSH_B2",({lighting:e})=>(0,a.s)(m,e.sh.b[5],e.sh.b[6],e.sh.b[7],e.sh.b[8]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
808
+ }`)):2===i&&(r.uniforms.add(new c.d("lightingAmbientSH0",({lighting:e})=>(0,n.i)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0])),new l.I("lightingAmbientSH_R1",({lighting:e})=>(0,a.s)(p,e.sh.r[1],e.sh.r[2],e.sh.r[3],e.sh.r[4])),new l.I("lightingAmbientSH_G1",({lighting:e})=>(0,a.s)(p,e.sh.g[1],e.sh.g[2],e.sh.g[3],e.sh.g[4])),new l.I("lightingAmbientSH_B1",({lighting:e})=>(0,a.s)(p,e.sh.b[1],e.sh.b[2],e.sh.b[3],e.sh.b[4])),new l.I("lightingAmbientSH_R2",({lighting:e})=>(0,a.s)(p,e.sh.r[5],e.sh.r[6],e.sh.r[7],e.sh.r[8])),new l.I("lightingAmbientSH_G2",({lighting:e})=>(0,a.s)(p,e.sh.g[5],e.sh.g[6],e.sh.g[7],e.sh.g[8])),new l.I("lightingAmbientSH_B2",({lighting:e})=>(0,a.s)(p,e.sh.b[5],e.sh.b[6],e.sh.b[7],e.sh.b[8]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
828
809
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
829
810
  vec4 sh1 = vec4(
830
811
  0.488603 * normal.x,
@@ -854,14 +835,14 @@ vec3 calculateAmbientRadiance(float ambientOcclusion)
854
835
  {
855
836
  vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
856
837
  return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
857
- }`))}const h=(0,o.vt)(),m=(0,s.vt)();var p=r(14527),f=r(98619),v=r(22393),g=r(89786),_=r(32976),x=r(33094);r(34727),(0,o.vt)();const b=.4;function w(e){e.code.add(d.H`float mapChannel(float x, vec2 p) {
838
+ }`))}const h=(0,o.vt)(),p=(0,s.vt)();var m=r(14527),f=r(98619),v=r(22393),g=r(89786),_=r(32976),x=r(33094);r(34727),(0,o.vt)();const b=.4;function w(e){e.code.add(d.H`float mapChannel(float x, vec2 p) {
858
839
  return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
859
840
  }`),e.code.add(d.H`vec3 blackLevelSoftCompression(vec3 color, float averageAmbientRadiance) {
860
841
  vec2 p = vec2(0.02, 0.0075) * averageAmbientRadiance;
861
842
  return vec3(mapChannel(color.x, p), mapChannel(color.y, p), mapChannel(color.z, p));
862
843
  }`)}function y(e){e.code.add(d.H`vec3 tonemapACES(vec3 x) {
863
844
  return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
864
- }`)}function M(e){e.constants.add("ambientBoostFactor","float",b)}function T(e){e.uniforms.add(new x.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function C(e,t){const r=e.fragment,{pbrMode:n,spherical:o,hasColorTexture:a}=t;r.include(p.n,t),0!==n&&r.include(v.c,t),e.include(u,t),r.include(g.p),r.include(y,t);const s=!(2===n&&!a);switch(s&&r.include(w),r.code.add(d.H`
845
+ }`)}function M(e){e.constants.add("ambientBoostFactor","float",b)}function T(e){e.uniforms.add(new x.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function C(e,t){const r=e.fragment,{pbrMode:n,spherical:o,hasColorTexture:a}=t;r.include(m.n,t),0!==n&&r.include(v.c,t),e.include(u,t),r.include(g.p),r.include(y,t);const s=!(2===n&&!a);switch(s&&r.include(w),r.code.add(d.H`
865
846
  const float GAMMA_SRGB = ${d.H.float(i.Tf)};
866
847
  const float INV_GAMMA_SRGB = 0.4761904;
867
848
  ${(0,d.If)(0!==n,"const float GROUND_REFLECTANCE = 0.2;")}
@@ -951,10 +932,10 @@ vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceC
951
932
  vec3 outColorLinear = outDiffColor + specularComponent;
952
933
  vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
953
934
  return outColor;
954
- }`)}}(0,o.vt)()},89786:(e,t,r)=>{function i(e){const t=.3183098861837907;e.constants.add("PI","float",3.141592653589793),e.constants.add("LIGHT_NORMALIZATION","float",t),e.constants.add("INV_PI","float",t),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("TWO_PI","float",6.28318530717958)}r.d(t,{p:()=>i})},90239:(e,t,r)=>{function i(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>i})},90644:(e,t,r)=>{function i(e,t,r=32774,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 n(e,t,r,i,n=32774,o=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>w,RC:()=>o,T8:()=>a,Uy:()=>d,Xt:()=>l,kn:()=>u,p3:()=>n}),i(0,771),i(1,0),i(1,1);const o=i(1,771),a=n(770,1,771,771),s={face:1029,mode:2305},c={face:1028,mode:2305},l=e=>2===e?s:1===e?c:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return T.intern(e)}function m(e){return S.intern(e)}function p(e){return A.intern(e)}function f(e){return I.intern(e)}function v(e){return F.intern(e)}function g(e){return D.intern(e)}function _(e){return N.intern(e)}function x(e){return B.intern(e)}function b(e){return z.intern(e)}function w(e){return V.intern(e)}class y{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 M(e){return"["+e.join(",")+"]"}const T=new y(C,e=>({__tag:"Blending",...e}));function C(e){return e?M([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 S=new y(E,e=>({__tag:"Culling",...e}));function E(e){return e?M([e.face,e.mode]):null}const A=new y(R,e=>({__tag:"PolygonOffset",...e}));function R(e){return e?M([e.factor,e.units]):null}const I=new y(P,e=>({__tag:"DepthTest",...e}));function P(e){return e?M([e.func]):null}const F=new y(O,e=>({__tag:"StencilTest",...e}));function O(e){return e?M([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const D=new y(H,e=>({__tag:"DepthWrite",...e}));function H(e){return e?M([e.zNear,e.zFar]):null}const N=new y(L,e=>({__tag:"ColorWrite",...e}));function L(e){return e?M([e.r,e.g,e.b,e.a]):null}const B=new y(G,e=>({__tag:"StencilWrite",...e}));function G(e){return e?M([e.mask]):null}const z=new y(U,e=>({__tag:"DrawBuffers",...e}));function U(e){return e?M(e.buffers):null}const V=new y(function(e){return e?M([C(e.blending),E(e.culling),R(e.polygonOffset),P(e.depthTest),O(e.stencilTest),H(e.depthWrite),L(e.colorWrite),G(e.stencilWrite),U(e.drawBuffers)]):null},e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:p(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:x(e.stencilWrite),drawBuffers:b(e.drawBuffers)}))},92700:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821);function n(e,t){t.hasVertexColors?(e.attributes.add("color","vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`
935
+ }`)}}(0,o.vt)()},89786:(e,t,r)=>{function i(e){const t=.3183098861837907;e.constants.add("PI","float",3.141592653589793),e.constants.add("LIGHT_NORMALIZATION","float",t),e.constants.add("INV_PI","float",t),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("TWO_PI","float",6.28318530717958)}r.d(t,{p:()=>i})},90239:(e,t,r)=>{function i(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>i})},90644:(e,t,r)=>{function i(e,t,r=32774,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 n(e,t,r,i,n=32774,o=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>w,RC:()=>o,T8:()=>a,Uy:()=>d,Xt:()=>l,kn:()=>u,p3:()=>n}),i(0,771),i(1,0),i(1,1);const o=i(1,771),a=n(770,1,771,771),s={face:1029,mode:2305},c={face:1028,mode:2305},l=e=>2===e?s:1===e?c:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return T.intern(e)}function p(e){return S.intern(e)}function m(e){return A.intern(e)}function f(e){return I.intern(e)}function v(e){return O.intern(e)}function g(e){return F.intern(e)}function _(e){return N.intern(e)}function x(e){return B.intern(e)}function b(e){return z.intern(e)}function w(e){return V.intern(e)}class y{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 M(e){return"["+e.join(",")+"]"}const T=new y(C,e=>({__tag:"Blending",...e}));function C(e){return e?M([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 S=new y(E,e=>({__tag:"Culling",...e}));function E(e){return e?M([e.face,e.mode]):null}const A=new y(R,e=>({__tag:"PolygonOffset",...e}));function R(e){return e?M([e.factor,e.units]):null}const I=new y(P,e=>({__tag:"DepthTest",...e}));function P(e){return e?M([e.func]):null}const O=new y(D,e=>({__tag:"StencilTest",...e}));function D(e){return e?M([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const F=new y(H,e=>({__tag:"DepthWrite",...e}));function H(e){return e?M([e.zNear,e.zFar]):null}const N=new y(L,e=>({__tag:"ColorWrite",...e}));function L(e){return e?M([e.r,e.g,e.b,e.a]):null}const B=new y(G,e=>({__tag:"StencilWrite",...e}));function G(e){return e?M([e.mask]):null}const z=new y(U,e=>({__tag:"DrawBuffers",...e}));function U(e){return e?M(e.buffers):null}const V=new y(function(e){return e?M([C(e.blending),E(e.culling),R(e.polygonOffset),P(e.depthTest),D(e.stencilTest),H(e.depthWrite),L(e.colorWrite),G(e.stencilWrite),U(e.drawBuffers)]):null},e=>({blending:h(e.blending),culling:p(e.culling),polygonOffset:m(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:x(e.stencilWrite),drawBuffers:b(e.drawBuffers)}))},92700:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821);function n(e,t){t.hasVertexColors?(e.attributes.add("color","vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`
955
936
  void forwardNormalizedVertexColor() { vColor = color * ${i.H.float(1/255)}; }
956
937
  `)):e.vertex.code.add(i.H`void forwardVertexColor() {}
957
- void forwardNormalizedVertexColor() {}`)}},94656:(e,t,r)=>{r.d(t,{Y2:()=>l,en:()=>c});var i=r(49186),n=r(44208),o=r(53966);const a=()=>o.A.getLogger("esri.views.webgl.checkWebGLError"),s=!!(0,n.A)("enable-feature:webgl-debug");function c(){return s}function l(e,t=c()){if(t){const t=e.getError();if(t){const e=function(e){switch(e){case 1280:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case 1281:return"Invalid Value. A numeric argument is out of range.";case 1282:return"Invalid Operation. The specified command is not allowed for the current state.";case 1286:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case 1285:return"Out of memory. Not enough memory is left to execute the command.";case 37442:return"WebGL context has been lost";default:return"Unknown error"}}(t),r=(new Error).stack;a().error(new i.A("webgl-error","WebGL error occurred",{message:e,stack:r}))}}}},95774:(e,t,r)=>{r.d(t,{S:()=>m,b:()=>h});var i=r(82048),n=r(52540),o=r(68259),a=r(20304),s=r(31821),c=r(15976),l=r(63761),d=r(14113);const u=4;function h(){const e=new d.N5,t=e.fragment;e.include(i.c);const r=(u+1)/2,h=1/(2*r*r);return t.include(n.E),t.uniforms.add(new l.N("depthMap",e=>e.depthTexture),new c.o("tex",e=>e.colorTexture),new o.t("blurSize",e=>e.blurSize),new a.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(s.H`
938
+ void forwardNormalizedVertexColor() {}`)}},94656:(e,t,r)=>{r.d(t,{Y2:()=>l,en:()=>c});var i=r(49186),n=r(44208),o=r(53966);const a=()=>o.A.getLogger("esri.views.webgl.checkWebGLError"),s=!!(0,n.A)("enable-feature:webgl-debug");function c(){return s}function l(e,t=c()){if(t){const t=function(e){switch(e.getError()){case e.NO_ERROR:return null;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);if(t){const e=(new Error).stack;a().error(new i.A("webgl-error","WebGL error occurred",{message:t,stack:e}))}}}},95774:(e,t,r)=>{r.d(t,{S:()=>p,b:()=>h});var i=r(82048),n=r(52540),o=r(68259),a=r(20304),s=r(31821),c=r(15976),l=r(63761),d=r(14113);const u=4;function h(){const e=new d.N5,t=e.fragment;e.include(i.c);const r=(u+1)/2,h=1/(2*r*r);return t.include(n.E),t.uniforms.add(new l.N("depthMap",e=>e.depthTexture),new c.o("tex",e=>e.colorTexture),new o.t("blurSize",e=>e.blurSize),new a.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(s.H`
958
939
  void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
959
940
  float c = texture(tex, uv).r;
960
941
  float d = linearDepthFromTexture(depthMap, uv);
@@ -977,7 +958,7 @@ void forwardNormalizedVertexColor() {}`)}},94656:(e,t,r)=>{r.d(t,{Y2:()=>l,en:()
977
958
  vec2 uvOffset = uv + rf * blurSize;
978
959
  blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
979
960
  }
980
- fragBlur = b / w_total;`),e}const m=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}))},96336:(e,t,r)=>{r.d(t,{Y:()=>o});var i=r(21818),n=r(31821);function o(e,t){switch(t.normalType){case 1:e.attributes.add("normalCompressed","vec2"),e.vertex.code.add(n.H`vec3 decompressNormal(vec2 normal) {
961
+ fragBlur = b / w_total;`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}))},96336:(e,t,r)=>{r.d(t,{Y:()=>o});var i=r(21818),n=r(31821);function o(e,t){switch(t.normalType){case 1:e.attributes.add("normalCompressed","vec2"),e.vertex.code.add(n.H`vec3 decompressNormal(vec2 normal) {
981
962
  float z = 1.0 - abs(normal.x) - abs(normal.y);
982
963
  return vec3(normal + sign(normal) * min(z, 0.0), z);
983
964
  }