@arcgis/core 4.28.0-next.20230819 → 4.28.0-next.20230821
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/003744a45b07865f1be9.js +1 -0
- package/assets/esri/core/workers/chunks/034accc7cab6c88a3b31.js +1 -0
- package/assets/esri/core/workers/chunks/{a67e5b22adc91e850b4e.js → 05ab09713d599687afa3.js} +1 -1
- package/assets/esri/core/workers/chunks/{3724f23b6f5ac8ec2568.js → 12b8fe0374fa9ab4ca09.js} +1 -1
- package/assets/esri/core/workers/chunks/16d1a72014074e87ecb9.js +1 -0
- package/assets/esri/core/workers/chunks/{e4b6565c16430b28ad93.js → 19857e5420cdf23c5f2e.js} +1 -1
- package/assets/esri/core/workers/chunks/{1a804dea42c0fb5e5c07.js → 1bab408eaffd2c18976d.js} +1 -1
- package/assets/esri/core/workers/chunks/201365f53509e3f78e17.js +1 -0
- package/assets/esri/core/workers/chunks/{2031451b82ff70fb201a.js → 2f48f4a9a0a056ac5e1c.js} +1 -1
- package/assets/esri/core/workers/chunks/318b51fdee09c1fd750f.js +1 -0
- package/assets/esri/core/workers/chunks/{5b799dc155adeb728c74.js → 3361e3e8385f8de8820c.js} +1 -1
- package/assets/esri/core/workers/chunks/3ce1870c28ab6ac3648e.js +1 -0
- package/assets/esri/core/workers/chunks/41929e4531787389804b.js +1 -0
- package/assets/esri/core/workers/chunks/{55ac725127c5ea9fb942.js → 4e39252f40bc57be9d12.js} +1 -1
- package/assets/esri/core/workers/chunks/{8ed83426ef88a3eccecd.js → 4e496b03ce24b1206f86.js} +1 -1
- package/assets/esri/core/workers/chunks/54513578f735d274a20e.js +1 -0
- package/assets/esri/core/workers/chunks/{d46f8ef92e79d12384c9.js → 587437526ea77f764986.js} +1 -1
- package/assets/esri/core/workers/chunks/{ab720e2f0a35138564b2.js → 5ffabd1a90c5b08109aa.js} +1 -1
- package/assets/esri/core/workers/chunks/6108d72faf48a592c8ba.js +1 -0
- package/assets/esri/core/workers/chunks/6479439afae01f9bb5e6.js +1 -0
- package/assets/esri/core/workers/chunks/69306dfc89e877539223.js +1 -0
- package/assets/esri/core/workers/chunks/{ed499c328ae3a704791c.js → 6db4a6f9d25691830829.js} +1 -1
- package/assets/esri/core/workers/chunks/{61393fd3376ea599a447.js → 76e27cece1559ae815df.js} +1 -1
- package/assets/esri/core/workers/chunks/81526909c0fa11639038.js +1 -0
- package/assets/esri/core/workers/chunks/873111ddf4813cdd4903.js +1 -0
- package/assets/esri/core/workers/chunks/8d4f1170394a8be15da9.js +1 -0
- package/assets/esri/core/workers/chunks/8d8bdfda09c24e363f78.js +1 -0
- package/assets/esri/core/workers/chunks/9b54b5bdb6367c36f6e9.js +1 -0
- package/assets/esri/core/workers/chunks/{88f0b5c0fe751bf35af2.js → b2752e038c5fa3c21e49.js} +1 -1
- package/assets/esri/core/workers/chunks/{dd3b7cfc6f78552249a4.js → b78dc6cbe14e5817b4d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{e31d0c7363cbceeb5ac9.js → c35b850fbfcb28133235.js} +1 -1
- package/assets/esri/core/workers/chunks/c83e1be4ee64320cf2fe.js +1 -0
- package/assets/esri/core/workers/chunks/c88869d2a647c22dc3e6.js +1 -0
- package/assets/esri/core/workers/chunks/cb0a5bc6deaa98026bb5.js +1 -0
- package/assets/esri/core/workers/chunks/{767467738aeabec14abd.js → d0c4367a197b193e95d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{f113141e254505116b82.js → d1cc2c050423595e54e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f34945036495ad7c3f8.js → d2a8bf2d090b94cb294b.js} +1 -1
- package/assets/esri/core/workers/chunks/{08af7f7f1950a59a8e47.js → d6c96a20e9640b433719.js} +4 -4
- package/assets/esri/core/workers/chunks/da5453e67d00ff546640.js +1 -0
- package/assets/esri/core/workers/chunks/daa79c14150c12d8bc3d.js +1 -0
- package/assets/esri/core/workers/chunks/ef03b78659c72de93076.js +1 -0
- package/assets/esri/core/workers/chunks/{c3cace5b25b5170228ba.js → f2fe89b6ac6bf6817e71.js} +1 -1
- package/assets/esri/core/workers/chunks/f3554627664a419e00fa.js +1 -0
- package/assets/esri/themes/base/widgets/_Editor.scss +65 -4
- package/assets/esri/themes/base/widgets/_UtilityNetworkAssociations.scss +97 -39
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-caps/butt.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-caps/round.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-caps/square.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/dash-dot.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/dash.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/dot.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/long-dash-dot-dot.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/long-dash-dot.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/long-dash.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dash-dot-dot.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dash-dot.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dash.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dot.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/solid.png +0 -0
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations.json +1 -1
- package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_en.json +1 -1
- package/chunks/HighlightBlur.glsl.js +3 -3
- package/chunks/HighlightDownsample.glsl.js +24 -6
- package/chunks/SSAO.glsl.js +2 -2
- package/core/timeUtils.js +1 -1
- package/intl/date.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/StreamLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/graphics/sources/support/uploads.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/save/imageryUtils.js +1 -1
- package/layers/save/streamLayerUtils.js +1 -1
- package/package.json +1 -1
- package/popup/support/FieldInfoFormat.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/sketch/normalizedPoint.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/candidates/IntersectionSnappingCandidate.js +1 -1
- package/views/interactive/tooltip/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/TooltipEditableFieldAngle.js +1 -1
- package/views/interactive/tooltip/constraintUtils.js +5 -0
- package/views/support/angularMeasurementUtils.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/Upload.js +1 -1
- package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
- package/widgets/Editor/components/UploadDetails.js +1 -1
- package/widgets/Editor/modelUploadUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +5 -0
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/UtilityNetworkAssociations/VisibleElements.js +5 -0
- package/widgets/UtilityNetworkAssociations/VisibleElementsSettingsPane.js +5 -0
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/assets/esri/core/workers/chunks/11abbbf97093b55e2417.js +0 -1
- package/assets/esri/core/workers/chunks/1b2a081f2c3b97ba7e00.js +0 -1
- package/assets/esri/core/workers/chunks/235f333177ed7ea21e01.js +0 -1
- package/assets/esri/core/workers/chunks/3725dd14c2da0f47198f.js +0 -1
- package/assets/esri/core/workers/chunks/42595c4870c673ed451c.js +0 -1
- package/assets/esri/core/workers/chunks/481cdd2a4bc40c6fef66.js +0 -1
- package/assets/esri/core/workers/chunks/54893132e70c515ea7e3.js +0 -1
- package/assets/esri/core/workers/chunks/6509a4198972b323d9b6.js +0 -1
- package/assets/esri/core/workers/chunks/68598d2806d4aa3d8acc.js +0 -1
- package/assets/esri/core/workers/chunks/718d2e8ea61f3b7b70c5.js +0 -1
- package/assets/esri/core/workers/chunks/7bce4b5eec630ef57f1e.js +0 -1
- package/assets/esri/core/workers/chunks/8706dc9f852df9b2095d.js +0 -1
- package/assets/esri/core/workers/chunks/8ef26aac0fe7feb8c324.js +0 -1
- package/assets/esri/core/workers/chunks/91e61da22f258d9e86c5.js +0 -1
- package/assets/esri/core/workers/chunks/9f039bf79b34d8fd75ae.js +0 -1
- package/assets/esri/core/workers/chunks/a20fd9e7db37b3c3b041.js +0 -1
- package/assets/esri/core/workers/chunks/aa83dce42d64034a0a13.js +0 -1
- package/assets/esri/core/workers/chunks/cdcf0a5e05283d37b3ac.js +0 -1
- package/assets/esri/core/workers/chunks/d4f9106bf2ea5d66d96a.js +0 -1
- package/assets/esri/core/workers/chunks/e6bfbc4347fa13db4df2.js +0 -1
- package/assets/esri/core/workers/chunks/f1d5487f2d828fb142ba.js +0 -1
- package/assets/esri/core/workers/chunks/f97f165d05439e668e05.js +0 -1
- package/assets/esri/core/workers/chunks/fe973d8155c22d73a4f9.js +0 -1
|
@@ -208,7 +208,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
208
208
|
return;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy,currentPixelDepth);
|
|
211
|
+
vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth);
|
|
212
212
|
|
|
213
213
|
// get the normal of current fragment
|
|
214
214
|
vec4 norm4 = texture(normalMap, uv);
|
|
@@ -244,7 +244,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
244
244
|
|
|
245
245
|
tapPixelPos = reconstructPosition(tc, occluderFragmentDepth);
|
|
246
246
|
|
|
247
|
-
sum+= aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);
|
|
247
|
+
sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
// output the result
|
|
@@ -282,7 +282,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
282
282
|
|
|
283
283
|
fragBlur = b / w_total;
|
|
284
284
|
}
|
|
285
|
-
`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>d,Z:()=>c,c:()=>i,f:()=>o});const c=n(),d=a(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>d,e:()=>l,n:()=>u,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[4],u=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],v=r[13],_=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+d*i+m*a+g,e[x+1]=l*r+u*i+f*a+v,e[x+2]=c*r+h*i+p*a+_,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,v=0;for(let r=0;r<a;r++){const r=t[g],i=t[g+1],a=t[g+2];e[v]=s*r+d*i+m*a,e[v+1]=l*r+u*i+f*a,e[v+2]=c*r+h*i+p*a,g+=n,v+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(20102);let o=class{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}since(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.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),a=/^\s*\d+\s*$/;if(!r||!r.match||!a.test(r))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n||!n.match||!a.test(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new o(s,l,t)}}},43090:(e,t,r)=>{function i(e){return 32+e.length}function o(e){if(!e)return 0;let t=l;for(const r in e)if(e.hasOwnProperty(r)){const o=e[r];switch(typeof o){case"string":t+=i(o);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function n(e){if(!e)return 0;if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return 32+8*t;let r=c;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=l;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e){switch(typeof e){case"object":return n(e);case"string":return i(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(e,t){return c+e.length*t}r.d(t,{Ul:()=>n,do:()=>s,f2:()=>o});const l=32,c=32},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>d,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.a)(e.origin),vector:(0,a.a)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.i)(r.origin,e),(0,n.g)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,d=(0,n.g)(s.WM.get(),t,c),u=(0,n.d)(l,d)/(0,n.p)(l);return(0,n.b)(a,l,(0,i.uZ)(u,0,1)),(0,n.e)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},31370:(e,t,r)=>{r.d(t,{fetch:()=>Wt});var i=r(32243),o=r(21787),n=r(46521),a=r(52138),s=r(13598),l=r(17896),c=r(65617),d=r(60437),u=r(1533);function h(e,t=!1){return e<=u.DB?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),v=r(56067),_=r(75488),T=r(40270),x=r(91695),E=r(91911),b=r(15317),A=r(14682),S=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,n=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,a,s),(0,o.m)(l,n,l),l}class w{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class y{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new w,this.numberOfVertices=0}}var C=r(3172),M=r(66643),O=r(43090),I=r(20102),P=r(92604);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var L=r(95330),D=r(23670);async function F(e,t){const{data:r}=await(0,C.Z)(e,{responseType:"image",...t});return r}var H=r(51417),B=r(47026),G=r(22631),U=r(80442),z=r(32448),V=r(70586),W=r(17452),j=r(85958),k=r(99880);let q;var X,$;($=X||(X={}))[$.ETC1_RGB=0]="ETC1_RGB",$[$.ETC2_RGBA=1]="ETC2_RGBA",$[$.BC1_RGB=2]="BC1_RGB",$[$.BC3_RGBA=3]="BC3_RGBA",$[$.BC4_R=4]="BC4_R",$[$.BC5_RG=5]="BC5_RG",$[$.BC7_M6_RGB=6]="BC7_M6_RGB",$[$.BC7_M5_RGBA=7]="BC7_M5_RGBA",$[$.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",$[$.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",$[$.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",$[$.ATC_RGB=11]="ATC_RGB",$[$.ATC_RGBA=12]="ATC_RGBA",$[$.FXT1_RGB=17]="FXT1_RGB",$[$.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",$[$.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",$[$.ETC2_EAC_R11=20]="ETC2_EAC_R11",$[$.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",$[$.RGBA32=13]="RGBA32",$[$.RGB565=14]="RGB565",$[$.BGR565=15]="BGR565",$[$.RGBA4444=16]="RGBA4444";var Y=r(35371),J=r(57088),Z=r(45762);let K=null,Q=null;async function ee(){return null==Q&&(Q=function(){if(null==q){const e=e=>(0,k.V)(`esri/libs/basisu/${e}`);q=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return q}(),K=await Q),Q}function te(e,t,r,i,o){const n=(0,Z.RG)(t?Y.q_.COMPRESSED_RGBA8_ETC2_EAC:Y.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function re(e){return e.getNumImages()>=1&&!e.isUASTC()}function ie(e){return e.getFaces()>=1&&e.isETC1S()}function oe(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[X.ETC2_RGBA,Y.q_.COMPRESSED_RGBA8_ETC2_EAC]:[X.ETC1_RGB,Y.q_.COMPRESSED_RGB8_ETC2]:c?i?[X.BC3_RGBA,Y.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[X.BC1_RGB,Y.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[X.RGBA32,Y.VI.RGBA],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?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,t.width=o,t.height=n,new J.x(e,t,{type:"compressed",levels:m})}var ne=r(17662),ae=r(4726);const se=P.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function le(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ce=le("DXT1"),de=le("DXT3"),ue=le("DXT5");var he,me,fe=r(11726),pe=r(47859);class ge extends ne.c{constructor(e,t){super(),this._data=e,this.type=ae.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new z.Z,this.parameters=t||{},this.parameters.mipmap=!1!==this.parameters.mipmap,this.parameters.noUnpackFlip=this.parameters.noUnpackFlip||!1,this.parameters.preMultiplyAlpha=this.parameters.preMultiplyAlpha||!1,this.parameters.wrap=this.parameters.wrap||{s:Y.e8.REPEAT,t:Y.e8.REPEAT},this._startPreload(e)}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,W.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,W.HK)(e.src)||(0,W.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}dispose(){this._data=void 0}_createDescriptor(e){const t=new pe.X;return t.wrapMode=this.parameters.wrap??Y.e8.REPEAT,t.flipped=!this.parameters.noUnpackFlip,t.samplingMode=this.parameters.mipmap?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,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}get memoryEstimate(){return this._glTexture?.gpuMemoryUsage||function(e,t){if(null==e)return 0;if((0,u.eP)(e)||(0,u.lq)(e))return t.encoding===B.Ti.KTX2_ENCODING?function(e,t){if(null==K)return e.byteLength;const r=new K.KTX2File(new Uint8Array(e)),i=ie(r)?te(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.Ti.BASIS_ENCODING?function(e,t){if(null==K)return e.byteLength;const r=new K.BasisFile(new Uint8Array(e)),i=re(r)?te(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?ve(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this.parameters)}load(e){if(null!=this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new J.x(e,this._createDescriptor(e),null),this._glTexture):"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,u.eP)(t)||(0,u.lq)(t))&&this.parameters.encoding===B.Ti.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,t)):((0,u.eP)(t)||(0,u.lq)(t))&&this.parameters.encoding===B.Ti.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,t)):((0,u.eP)(t)||(0,u.lq)(t))&&this.parameters.encoding===B.Ti.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,t)):(0,u.lq)(t)?this._loadFromPixelData(e,t):(0,u.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e){return this._data instanceof HTMLVideoElement&&null!=this._glTexture?this._data.readyState<he.HAVE_CURRENT_DATA||e===this._data.currentTime?e:(this._glTexture.setData(this._data),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.parameters.updateCallback&&this.parameters.updateCallback(),this._data.currentTime):e}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return se.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return se.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case ce:o=8,n=Y.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case de:o=16,n=Y.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case ue:o=16,n=Y.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return se.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],l=r[3];0==(3&s)&&0==(3&l)||(se.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,m,h),f.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new J.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==K&&(K=await ee());const i=new K.KTX2File(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=oe(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==K&&(K=await ee());const i=new K.BasisFile(new Uint8Array(r));if(!re(i))return null;i.startTranscoding();const o=oe(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,fe.hu)(this.parameters.width>0&&this.parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.parameters.components?Y.VI.LUMINANCE:3===this.parameters.components?Y.VI.RGB:Y.VI.RGBA,r.width=this.parameters.width??0,r.height=this.parameters.height??0,this._glTexture=new J.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await F(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,j.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=he.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,V.hw)(l)},a=()=>{t.readyState>=he.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,t)))},s=e=>{n(),o(e||new I.Z("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_loadFromImage(e,t){const r=ve(t);this.parameters.width=r.width,this.parameters.height=r.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this.parameters.components?Y.VI.RGB:Y.VI.RGBA,i.width=r.width,i.height=r.height,this._glTexture=new J.x(e,i,t),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,V.M2)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function ve(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(me=he||(he={}))[me.HAVE_NOTHING=0]="HAVE_NOTHING",me[me.HAVE_METADATA=1]="HAVE_METADATA",me[me.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",me[me.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",me[me.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var _e=r(35065),Te=r(64822),xe=r(65576),Ee=r(55039),be=r(60624),Ae=r(19419),Se=r(85504),Re=r(60537),we=r(82791),ye=r(93144),Ce=r(27097);const Me=(0,Ce.wK)(Y.zi.SRC_ALPHA,Y.zi.ONE,Y.zi.ONE_MINUS_SRC_ALPHA,Y.zi.ONE_MINUS_SRC_ALPHA),Oe=(0,Ce.if)(Y.zi.ONE,Y.zi.ONE),Ie=(0,Ce.if)(Y.zi.ZERO,Y.zi.ONE_MINUS_SRC_ALPHA);function Pe(e){return e===ye.A.FrontFace?null:e===ye.A.Alpha?Ie:Oe}const Ne={factor:-1,units:-2};function Le(e,t=Y.wb.LESS){return e===ye.A.NONE||e===ye.A.FrontFace?t:Y.wb.LEQUAL}var De=r(97995),Fe=r(8310),He=r(87951);const Be=new class{constructor(e=0){this.offset=e,this.sphere=(0,Fe.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,l.s)(Ge,e,t,r),n=(0,l.m)(o,o,i),a=this.offset/(0,l.l)(n);(0,l.q)(n,n,n,a);const s=this.objectTransform.inverse;return(0,l.m)(this.tmpVertex,n,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,l.l)(e);(0,l.q)(e,e,e,r);const i=this.offset/(0,l.l)(t);(0,l.q)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,l.l)(e),r=this.offset/t;return(0,l.q)(this.sphere,e,e,r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,Fe.c)(),this._obb=(0,He.Ue)(),this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,l.l)(e)}applyToVertex(e,t,r){const i=(0,l.s)(Ge,e,t,r),o=(0,l.s)(Ue,e,t,r+this.componentLocalOriginLength),n=this._totalOffset/(0,l.l)(o);return(0,l.q)(this._tmpVertex,i,o,n),this._tmpVertex}applyToAabb(e){const t=(0,l.s)(Ge,e[0],e[1],e[2]+this.componentLocalOriginLength),r=(0,l.s)(Ue,e[3],e[4],e[5]+this.componentLocalOriginLength),i=(0,l.r)(ze,t),o=(0,l.r)(Ve,r),n=(0,l.u)(We,t),a=(0,l.u)(je,r),s=(0,l.v)(ke,n,a);s[0]=i[0]*o[0]<0?0:s[0],s[1]=i[1]*o[1]<0?0:s[1],s[2]=i[2]*o[2]<0?0:s[2];const c=(0,l.l)(s);if(c<this._totalOffset)return e[0]-=t[0]<0?this._totalOffset:0,e[1]-=t[1]<0?this._totalOffset:0,e[2]-=t[2]<0?this._totalOffset:0,e[3]+=r[0]>0?this._totalOffset:0,e[4]+=r[1]>0?this._totalOffset:0,e[5]+=r[2]>0?this._totalOffset:0,e;const d=(0,l.w)(ke,n,a),u=(0,l.l)(d),h=this._totalOffset/u,m=this._totalOffset/c;return e[0]+=t[0]*(t[0]>0?h:m),e[1]+=t[1]*(t[1]>0?h:m),e[2]+=t[2]*(t[2]>0?h:m),e[3]+=r[0]*(r[0]<0?h:m),e[4]+=r[1]*(r[1]<0?h:m),e[5]+=r[2]*(r[2]<0?h:m),e}applyToMbs(e){const t=(0,l.l)(e),r=this._totalOffset/t;return(0,l.q)(this._mbs,e,e,r),this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){return(0,He.gI)(e,this._totalOffset,this._totalOffset,Te.JY.Global,this._obb),this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=(0,l.s)(Ge,e,t,r),o=(0,l.e)(Ue,i,this.localOrigin),n=this.offset/(0,l.l)(o);return(0,l.q)(this.tmpVertex,i,o,n),this.tmpVertex}applyToAabb(e){const t=ze,r=Ve,i=We;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const n=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 o=0;o<3;++o)i[o]=0==(e&1<<o)?t[o]:r[o];n(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 o=0;o<3;++o)i[o]=0!=(a&1<<o)?0:0!=(e&1<<o)?t[o]:r[o];n(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ge=(0,c.c)(),Ue=(0,c.c)(),ze=(0,c.c)(),Ve=(0,c.c)(),We=(0,c.c)(),je=(0,c.c)(),ke=(0,c.c)();function qe(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function Xe(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function $e(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}function Ye(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function Je(e,t,r,i,o,n,s){switch(e){case _e.T.POSITION:{(0,fe.hu)(3===t.size);const o=n.getField(e,m.ct);(0,fe.hu)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,i,o,n=1){if(!r)return void Xe(e,t,i,o,n);const s=i.typedBuffer,l=i.typedBufferStride,c=e.length,d=r[0],u=r[1],h=r[2],m=r[4],f=r[5],p=r[6],g=r[8],v=r[9],_=r[10],T=r[12],x=r[13],E=r[14];o*=l;let b=0,A=0,S=0;const R=(0,a.y)(r)?e=>{b=t[e]+T,A=t[e+1]+x,S=t[e+2]+E}:e=>{const r=t[e],i=t[e+1],o=t[e+2];b=d*r+m*i+g*o+T,A=u*r+f*i+v*o+x,S=h*r+p*i+_*o+E};if(1===n)for(let t=0;t<c;++t)R(3*e[t]),s[o]=b,s[o+1]=A,s[o+2]=S,o+=l;else for(let t=0;t<c;++t){R(3*e[t]);for(let e=0;e<n;++e)s[o]=b,s[o+1]=A,s[o+2]=S,o+=l}}(r,t.data,i,o,s);break}case _e.T.NORMAL:{(0,fe.hu)(3===t.size);const i=n.getField(e,m.ct);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o,n=1){if(!r)return void Xe(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),E=1e-6,b=1-E;o*=c;let A=0,S=0,R=0;const w=(0,a.y)(s)?e=>{A=t[e],S=t[e+1],R=t[e+2]}:e=>{const r=t[e],i=t[e+1],o=t[e+2];A=u*r+f*i+v*o,S=h*r+p*i+_*o,R=m*r+g*i+T*o};if(1===n)if(x)for(let t=0;t<d;++t){w(3*e[t]);const r=A*A+S*S+R*R;if(r<b&&r>E){const e=1/Math.sqrt(r);l[o]=A*e,l[o+1]=S*e,l[o+2]=R*e}else l[o]=A,l[o+1]=S,l[o+2]=R;o+=c}else for(let t=0;t<d;++t)w(3*e[t]),l[o]=A,l[o+1]=S,l[o+2]=R,o+=c;else for(let t=0;t<d;++t){if(w(3*e[t]),x){const e=A*A+S*S+R*R;if(e<b&&e>E){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}for(let e=0;e<n;++e)l[o]=A,l[o+1]=S,l[o+2]=R,o+=c}}(r,t.data,o,i,s);break}case _e.T.NORMALCOMPRESSED:{(0,fe.hu)(2===t.size);const i=n.getField(e,m.or);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&qe(r,t.data,i,s);break}case _e.T.UV0:{(0,fe.hu)(2===t.size);const i=n.getField(e,m.Eu);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&qe(r,t.data,i,s);break}case _e.T.COLOR:case _e.T.SYMBOLCOLOR:{const i=n.getField(e,m.mc);(0,fe.hu)(!!i,`No buffer view for ${e}`),(0,fe.hu)(3===t.size||4===t.size),!i||3!==t.size&&4!==t.size||function(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,r!==t.length||4!==r)if(1!==n)if(4!==r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}else for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else{if(4===r){for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}return}for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else{a[o]=t[0],a[o+1]=t[1],a[o+2]=t[2],a[o+3]=t[3];const e=new Uint32Array(i.typedBuffer.buffer,i.start),r=s/4,c=e[o/=4];o+=r;const d=l*n;for(let t=1;t<d;++t)e[o]=c,o+=r}}(r,t.data,t.size,i,s);break}case _e.T.COLORFEATUREATTRIBUTE:{const i=n.getField(e,m.ly);(0,fe.hu)(!!i,`No buffer view for ${e}`),(0,fe.hu)(1===t.size),i&&1===t.size&&function(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length,s=t[0];i*=n;for(let e=0;e<a;++e)o[i]=s,i+=n}(r,t.data,i,s);break}case _e.T.TANGENT:{(0,fe.hu)(4===t.size);const i=n.getField(e,m.ek);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o,n=1){if(!r)return void $e(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),E=1e-6,b=1-E;if(o*=c,1===n)for(let r=0;r<d;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],d=t[i+3];let A=u*n+f*a+v*s,S=h*n+p*a+_*s,R=m*n+g*a+T*s;if(x){const e=A*A+S*S+R*R;if(e<b&&e>E){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}l[o]=A,l[o+1]=S,l[o+2]=R,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],a=t[i],s=t[i+1],d=t[i+2],A=t[i+3];let S=u*a+f*s+v*d,R=h*a+p*s+_*d,w=m*a+g*s+T*d;if(x){const e=S*S+R*R+w*w;if(e<b&&e>E){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<n;++e)l[o]=S,l[o+1]=R,l[o+2]=w,l[o+3]=A,o+=c}}(r,t.data,o,i,s);break}case _e.T.PROFILERIGHT:case _e.T.PROFILEUP:case _e.T.PROFILEVERTEXANDNORMAL:case _e.T.FEATUREVALUE:{(0,fe.hu)(4===t.size);const i=n.getField(e,m.ek);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&$e(r,t.data,i,s)}}}class Ze{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.indices.get(_e.T.POSITION).length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)Je(a,t,s,r,i,o,n);else if(a===_e.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(_e.T.POSITION);if((0,fe.hu)(!!t,`No buffer view for ${a}`),t){const r=t.length,i=o.getField(a,m.mc);Ye(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var Ke=r(57790),Qe=r(88669),et=r(135),tt=r(15719),rt=r(96310),it=r(78869),ot=r(14589),nt=r(83475),at=r(59377);Y.wb.LESS,Y.wb.ALWAYS;const st={mask:255},lt={function:{func:Y.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:Y.xS.KEEP,zFail:Y.xS.KEEP,zPass:Y.xS.ZERO}},ct={function:{func:Y.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:Y.xS.KEEP,zFail:Y.xS.KEEP,zPass:Y.xS.REPLACE}};Y.wb.EQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,Y.xS.KEEP,Y.xS.KEEP,Y.xS.KEEP,Y.wb.NOTEQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,Y.xS.KEEP,Y.xS.KEEP,Y.xS.KEEP;const dt=[1,1,.5],ut=[0,.6,.2],ht=[0,1,.2];var mt=r(32078);class ft extends tt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.g)(dt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=be.r.Attribute,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,Qe.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.Gv.Less,this.textureAlphaMode=B.JJ.Blend,this.textureAlphaCutoff=rt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=we.yD.Occlude,this.isDecoration=!1}}class pt extends ot.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===Te.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?et.N.Default:et.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,pt.shader)}_initializeProgram(e,t){return new at.$(e.rctx,t.get().build(this.configuration),nt.i)}_convertDepthTestFunction(e){return e===B.Gv.Lequal?Y.wb.LEQUAL:Y.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===ye.A.NONE,o=e===ye.A.FrontFace;return(0,Ce.sm)({blending:r.output!==Ee.H.Color&&r.output!==Ee.H.Alpha||!r.transparent?null:i?Me:Pe(e),culling:gt(r)?(0,Ce.zp)(r.cullFace):null,depthTest:{func:Le(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ce.LZ:null,colorWrite:Ce.BK,stencilWrite:r.hasOccludees?st:null,stencilTest:r.hasOccludees?t?ct:lt:null,polygonOffset:i||o?null:(n=r.enableOffset,n?Ne:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function gt(e){return e.cullFace!==B.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}pt.shader=new it.J(mt.D,(()=>r.e(9291).then(r.bind(r,79291))));var vt=r(43697),_t=r(51354),Tt=r(47624),xt=r(67498);class Et extends Tt.PO{}(0,vt._)([(0,_t.o)({constValue:!0})],Et.prototype,"hasSliceHighlight",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],Et.prototype,"hasSliceInVertexProgram",void 0),(0,vt._)([(0,_t.o)({constValue:xt.P.Pass})],Et.prototype,"pbrTextureBindType",void 0);class bt extends Et{constructor(){super(...arguments),this.output=Ee.H.Color,this.alphaDiscardMode=B.JJ.Opaque,this.doubleSidedMode=Ae.q.None,this.pbrMode=Se.f7.Disabled,this.cullFace=B.Vr.None,this.transparencyPassType=ye.A.NONE,this.normalType=be.r.Attribute,this.textureCoordinateType=et.N.None,this.customDepthTest=B.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,vt._)([(0,_t.o)({count:Ee.H.COUNT})],bt.prototype,"output",void 0),(0,vt._)([(0,_t.o)({count:B.JJ.COUNT})],bt.prototype,"alphaDiscardMode",void 0),(0,vt._)([(0,_t.o)({count:Ae.q.COUNT})],bt.prototype,"doubleSidedMode",void 0),(0,vt._)([(0,_t.o)({count:Se.f7.COUNT})],bt.prototype,"pbrMode",void 0),(0,vt._)([(0,_t.o)({count:B.Vr.COUNT})],bt.prototype,"cullFace",void 0),(0,vt._)([(0,_t.o)({count:ye.A.COUNT})],bt.prototype,"transparencyPassType",void 0),(0,vt._)([(0,_t.o)({count:be.r.COUNT})],bt.prototype,"normalType",void 0),(0,vt._)([(0,_t.o)({count:et.N.COUNT})],bt.prototype,"textureCoordinateType",void 0),(0,vt._)([(0,_t.o)({count:B.Gv.COUNT})],bt.prototype,"customDepthTest",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"spherical",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVertexColors",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSymbolColors",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVerticalOffset",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSlicePlane",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSliceHighlight",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasColorTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasMetallicRoughnessTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasEmissionTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOcclusionTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasNormalTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasScreenSizePerspective",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVertexTangents",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOccludees",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"multipassEnabled",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasModelTransformation",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"offsetBackfaces",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"vvSize",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"vvColor",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"receiveShadows",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"receiveAmbientOcclusion",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"textureAlphaPremultiplied",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instanced",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instancedColor",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instancedDoublePrecision",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"writeDepth",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"transparent",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"enableOffset",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"cullAboveGround",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"snowCover",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasColorTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasEmissionTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasNormalTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOcclusionTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,vt._)([(0,_t.o)({constValue:!0})],bt.prototype,"hasVvInstancing",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],bt.prototype,"useCustomDTRExponentForWater",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],bt.prototype,"supportsTextureAtlas",void 0),(0,vt._)([(0,_t.o)({constValue:!0})],bt.prototype,"useFillLights",void 0);var At=r(41846);class St extends pt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=be.r.Attribute,t.doubleSidedMode=Ae.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,St.shader)}}St.shader=new it.J(At.R,(()=>r.e(8096).then(r.bind(r,38096))));class Rt extends we.F5{constructor(e){super(e,yt),this.supportsEdges=!0,this._configuration=new bt,this._vertexBufferLayout=function(e){const t=(0,xe.U$)().vec3f(_e.T.POSITION);return e.normalType===be.r.Compressed?t.vec2i16(_e.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(_e.T.NORMAL),e.hasVertexTangents&&t.vec4f(_e.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(_e.T.UV0),e.hasVertexColors&&t.vec4u8(_e.T.COLOR),e.hasSymbolColors&&t.vec4u8(_e.T.SYMBOLCOLOR),(0,U.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(_e.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Ee.H.Shadow&&e!==Ee.H.ShadowExcludeHighlight&&e!==Ee.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.Vr.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Ee.H.Color&&e!==Ee.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ae.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ae.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ae.q.WindingOrder:Ae.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Se.f7.Schematic:Se.f7.Normal:Se.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(Nt,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case Te.JY.Global:n=(0,l.n)(It,Nt);break;case Te.JY.Local:n=(0,l.i)(It,Ot)}let a=0;const s=(0,l.g)(Lt,Nt,e.eye),c=(0,l.l)(s),d=(0,l.b)(s,s,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,l.d)(n,d)),a+=(0,Ke.Hx)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,l.b)(n,n,a),(0,l.t)(Pt,n,r.transform.inverseRotation),i=(0,l.g)(Ct,i,Pt),o=(0,l.g)(Mt,o,Pt)}(0,Ke.Bw)(e,r,i,o,function(e){return null!=e?(Be.offset=e,Be):null}(r.verticalOffset),n)}canRender(e,t){return!(t!==Ee.H.Color&&t!==Ee.H.Alpha&&t!==Ee.H.Depth&&t!==Ee.H.Normal&&t!==Ee.H.Shadow&&t!==Ee.H.ShadowHighlight&&t!==Ee.H.ShadowExcludeHighlight&&t!==Ee.H.Highlight&&t!==Ee.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?De.r.TRANSPARENT_MATERIAL:De.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:De.r.OPAQUE_MATERIAL)&&e!==De.r.DRAPED_MATERIAL)}createGLMaterial(e){return new wt(e)}createBufferWriter(){return new Ze(this._vertexBufferLayout)}}class wt extends Re.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==Ee.H.Color&&this._output!==Ee.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?St:pt,e)}}const yt=new class extends ft{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Ct=(0,c.c)(),Mt=(0,c.c)(),Ot=(0,c.f)(0,0,1),It=(0,c.c)(),Pt=(0,c.c)(),Nt=(0,c.c)(),Lt=(0,c.c)(),Dt=P.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Ft(e){throw new I.Z("",`Request for object resource failed: ${e}`)}function Ht(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Dt.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Dt.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Dt.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Dt.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Dt.warn("Indexed geometries must specify faces"),i=!1;break}default:Dt.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Dt.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Dt.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Bt(e){const t=(0,d.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,d.pp)(t,r.bbMin),(0,d.pp)(t,r.bbMax))})),t}function Gt(e){switch(e){case"mask":return B.JJ.Mask;case"maskAndTransparency":return B.JJ.MaskBlend;case"none":return B.JJ.Opaque;default:return B.JJ.Blend}}function Ut(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const zt=new D.G(1,2,"wosr");var Vt=r(57758);async function Wt(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=null!=t&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,M.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Ft(i.error.details.url)}(e,r,t);const i=await(0,M.q6)((0,C.Z)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Ft(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],n=o.images[0].data;if(!n){Dt.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:Y.e8.REPEAT,t:Y.e8.REPEAT},preMultiplyAlpha:Gt(l)!==B.JJ.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):F(a,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,O.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new N,a=e.resource,s=D.G.parse(a.version||"1.0","wosr");zt.validate(s);const l=a.model.name,d=a.model.geometries,u=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<d.length;e++){const a=d[e];if(!Ht(a))continue;const s=Ut(a),l=a.params.vertexAttributes,p=[];for(const e in l){const t=l[e],r=t.values;p.push([e,new H.a(r,t.valuesPerElement,!0)])}const g=[];if("PerAttributeArray"!==a.params.topology){const e=a.params.faces;for(const t in e)g.push([t,e[t].values])}const v=s.texture,_=h&&h[v];if(_&&!f.has(v)){const{image:e,parameters:t}=_,r=new ge(e,t);i.push(r),f.set(v,r)}const T=f.get(v),x=T?T.id:void 0,E=s.material;let b=n.get(E,v);if(null==b){const e=u[E.substring(E.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=_&&_.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=_?Gt(_.alphaChannelUsage):void 0,a={ambient:(0,c.g)(e.diffuse),diffuse:(0,c.g)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:B.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:_?.parameters.preMultiplyAlpha??!1};null!=t&&t.materialParamsMixin&&Object.assign(a,t.materialParamsMixin),b=new Rt(a),n.set(E,v,b)}o.push(b);const A=new G.Z(b,p,g);m+=g.find((e=>e[0]===_e.T.POSITION))?.[1].length??0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Bt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),u=n.model.meta?.ESRI_proxyEllipsoid,A=n.meta.isEsriSymbolResource&&null!=u&&n.meta.uri.includes("/RealisticTrees/");A&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,d=n.count,u=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*d),g=new Float64Array(3*d),v=(0,a.a)((0,s.c)(),o.transform);let _=0,T=0;for(let a=0;a<d;a++){n.getVec(a,h),i.getVec(a,u),(0,l.m)(h,h,o.transform),(0,l.g)(f,h,t.center),(0,l.E)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),d=Math.min(.45+.55*c*c,1);(0,l.E)(f,f,t.radius),null!==v&&(0,l.m)(f,f,v),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.f)(f,f,u,s>-1?.2:Math.min(-4*s-3.8,1)),g[_]=f[0],g[_+1]=f[1],g[_+2]=f[2],_+=3,p[T]=255*d,p[T+1]=255*d,p[T+2]=255*d,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(n,u));const S=!!t.usePBR,w=n.meta.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:A,mrrFactors:[...ht]}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:[...dt]},I={...t.materialParamsMixin,treeRendering:A},{engineResources:P,referenceBoundingBox:U}=function(e,t,r,i){const n=e.model,a=new Array,s=new Map,u=new Map,T=n.lods.length,x=(0,d.cS)();return n.lods.forEach(((e,A)=>{const S=!0===i.skipHighLods&&(T>1&&0===A||T>3&&1===A)||!1===i.skipHighLods&&null!=i.singleLodIndex&&A!==i.singleLodIndex;if(S&&0!==A)return;const w=new y(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=S?new Rt({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),d=e.materials.get(t.material),u=null!=t.attributes.texCoord0,h=null!=t.attributes.normal;if(null==d)return null;const m=function(e){switch(e){case"BLEND":return B.JJ.Blend;case"MASK":return B.JJ.Mask;case"OPAQUE":case null:case void 0:return B.JJ.Opaque}}(d.alphaMode);if(!n.has(s)){if(u){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new ge((0,b.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,b.$A)(e)&&r,encoding:(0,b.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(d.textureColor,m!==B.JJ.Opaque),t(d.textureNormal),t(d.textureOcclusion),t(d.textureEmissive),t(d.textureMetallicRoughness)}const r=d.color[0]**(1/Vt.K),f=d.color[1]**(1/Vt.K),p=d.color[2]**(1/Vt.K),g=d.emissiveFactor[0]**(1/Vt.K),v=d.emissiveFactor[1]**(1/Vt.K),_=d.emissiveFactor[2]**(1/Vt.K),T=null!=d.textureColor&&u?a.get(d.textureColor):null,x=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==o&&(null==n||(0,l.k)(n,c.Z))&&null==a&&(null==i||1===i)&&(null==r||1===r||0===r)}({normalTexture:d.textureNormal,metallicRoughnessTexture:d.textureMetallicRoughness,metallicFactor:d.metallicFactor,roughnessFactor:d.roughnessFactor,emissiveTexture:d.textureEmissive,emissiveFactor:d.emissiveFactor,occlusionTexture:d.textureOcclusion});n.set(s,new Rt({...i,transparent:m===B.JJ.Blend,customDepthTest:B.Gv.Lequal,textureAlphaMode:m,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,f,p],ambient:[r,f,p],opacity:d.opacity,doubleSided:d.doubleSided,doubleSidedType:"winding-order",cullFace:d.doubleSided?B.Vr.None:B.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?be.r.Attribute:be.r.ScreenDerivative,castShadows:!0,textureId:null!=T?T.id:void 0,colorMixMode:d.colorMixMode,normalTextureId:null!=d.textureNormal&&u?a.get(d.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.textureOcclusion&&u?a.get(d.textureOcclusion).id:void 0,emissiveTextureId:null!=d.textureEmissive&&u?a.get(d.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=d.textureMetallicRoughness&&u?a.get(d.textureMetallicRoughness).id:void 0,emissiveFactor:[g,v,_],mrrFactors:x?[...ut]:[d.metallicFactor,d.roughnessFactor,i.mrrFactors[2]],isSchematic:x,colorTextureTransformMatrix:R(d.colorTextureTransform),normalTextureTransformMatrix:R(d.normalTextureTransform),occlusionTextureTransformMatrix:R(d.occlusionTextureTransform),emissiveTextureTransformMatrix:R(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(d.metallicRoughnessTextureTransform),...o}))}const f=n.get(s);if(r.stageResources.materials.push(f),u){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(d.textureColor),e(d.textureNormal),e(d.textureOcclusion),e(d.textureEmissive),e(d.textureMetallicRoughness)}return f}(n,e,w,t,r,s,u),{geometry:a,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.p)(e.indices||r,e.primitiveType),n=h(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,f.t)(n,a,e.transform,3,s);const l=[[_e.T.POSITION,new H.a(n,3,!0)]],c=[[_e.T.POSITION,i]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.d)(jt,e.transform),(0,f.a)(t,n,jt,3,a),l.push([_e.T.NORMAL,new H.a(t,3,!0)]),c.push([_e.T.NORMAL,i])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.d)(jt,e.transform),(0,p.t)(t,n,jt,4,a),l.push([_e.T.TANGENT,new H.a(t,4,!0)]),c.push([_e.T.TANGENT,i])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([_e.T.UV0,new H.a(t,2,!0)]),c.push([_e.T.UV0,i])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([_e.T.COLOR,new H.a(t,4,!0)]),c.push([_e.T.COLOR,i])}return{geometry:new G.Z(t,l,c),vertexCount:r}}(e,null!=i?i:new Rt({})),y=a.boundingInfo;null!=y&&0===A&&((0,d.pp)(x,y.bbMin),(0,d.pp)(x,y.bbMax)),null!=i&&(w.stageResources.geometries.push(a),w.numberOfVertices+=T)})),S||a.push(w)})),{engineResources:a,referenceBoundingBox:x}}(n,w,I,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:P,referenceBoundingBox:U,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const jt=(0,n.c)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>d});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
285
|
+
`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>d,Z:()=>c,c:()=>i,f:()=>o});const c=n(),d=a(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>d,e:()=>l,n:()=>u,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[4],u=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],v=r[13],_=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+d*i+m*a+g,e[x+1]=l*r+u*i+f*a+v,e[x+2]=c*r+h*i+p*a+_,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,v=0;for(let r=0;r<a;r++){const r=t[g],i=t[g+1],a=t[g+2];e[v]=s*r+d*i+m*a,e[v+1]=l*r+u*i+f*a,e[v+2]=c*r+h*i+p*a,g+=n,v+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(20102);let o=class{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}since(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.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),a=/^\s*\d+\s*$/;if(!r||!r.match||!a.test(r))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n||!n.match||!a.test(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new o(s,l,t)}}},43090:(e,t,r)=>{function i(e){return 32+e.length}function o(e){if(!e)return 0;let t=l;for(const r in e)if(e.hasOwnProperty(r)){const o=e[r];switch(typeof o){case"string":t+=i(o);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function n(e){if(!e)return 0;if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return 32+8*t;let r=c;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=l;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e){switch(typeof e){case"object":return n(e);case"string":return i(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(e,t){return c+e.length*t}r.d(t,{Ul:()=>n,do:()=>s,f2:()=>o});const l=32,c=32},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>d,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.a)(e.origin),vector:(0,a.a)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.i)(r.origin,e),(0,n.g)(r.vector,t,e),r}function d(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,d=(0,n.g)(s.WM.get(),t,c),u=(0,n.d)(l,d)/(0,n.p)(l);return(0,n.b)(a,l,(0,i.uZ)(u,0,1)),(0,n.e)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},31370:(e,t,r)=>{r.d(t,{fetch:()=>Wt});var i=r(32243),o=r(21787),n=r(46521),a=r(52138),s=r(13598),l=r(17896),c=r(65617),d=r(60437),u=r(1533);function h(e,t=!1){return e<=u.DB?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),v=r(56067),_=r(75488),T=r(40270),x=r(91695),E=r(91911),b=r(15317),A=r(14682),S=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,n=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,a,s),(0,o.m)(l,n,l),l}class w{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class y{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new w,this.numberOfVertices=0}}var C=r(3172),M=r(66643),O=r(43090),I=r(20102),P=r(92604);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var L=r(95330),D=r(23670);async function F(e,t){const{data:r}=await(0,C.Z)(e,{responseType:"image",...t});return r}var H=r(51417),B=r(47026),G=r(22631),U=r(80442),z=r(32448),V=r(70586),W=r(17452),j=r(85958),k=r(99880);let q;var X,$;($=X||(X={}))[$.ETC1_RGB=0]="ETC1_RGB",$[$.ETC2_RGBA=1]="ETC2_RGBA",$[$.BC1_RGB=2]="BC1_RGB",$[$.BC3_RGBA=3]="BC3_RGBA",$[$.BC4_R=4]="BC4_R",$[$.BC5_RG=5]="BC5_RG",$[$.BC7_M6_RGB=6]="BC7_M6_RGB",$[$.BC7_M5_RGBA=7]="BC7_M5_RGBA",$[$.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",$[$.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",$[$.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",$[$.ATC_RGB=11]="ATC_RGB",$[$.ATC_RGBA=12]="ATC_RGBA",$[$.FXT1_RGB=17]="FXT1_RGB",$[$.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",$[$.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",$[$.ETC2_EAC_R11=20]="ETC2_EAC_R11",$[$.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",$[$.RGBA32=13]="RGBA32",$[$.RGB565=14]="RGB565",$[$.BGR565=15]="BGR565",$[$.RGBA4444=16]="RGBA4444";var Y=r(35371),J=r(57088),Z=r(45762);let K=null,Q=null;async function ee(){return null==Q&&(Q=function(){if(null==q){const e=e=>(0,k.V)(`esri/libs/basisu/${e}`);q=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return q}(),K=await Q),Q}function te(e,t,r,i,o){const n=(0,Z.RG)(t?Y.q_.COMPRESSED_RGBA8_ETC2_EAC:Y.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function re(e){return e.getNumImages()>=1&&!e.isUASTC()}function ie(e){return e.getFaces()>=1&&e.isETC1S()}function oe(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[X.ETC2_RGBA,Y.q_.COMPRESSED_RGBA8_ETC2_EAC]:[X.ETC1_RGB,Y.q_.COMPRESSED_RGB8_ETC2]:c?i?[X.BC3_RGBA,Y.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[X.BC1_RGB,Y.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[X.RGBA32,Y.VI.RGBA],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?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,t.width=o,t.height=n,new J.x(e,t,{type:"compressed",levels:m})}var ne=r(17662),ae=r(4726);const se=P.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function le(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ce=le("DXT1"),de=le("DXT3"),ue=le("DXT5");var he,me,fe=r(11726),pe=r(47859);class ge extends ne.c{constructor(e,t){super(),this._data=e,this.type=ae.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new z.Z,this.parameters=t||{},this.parameters.mipmap=!1!==this.parameters.mipmap,this.parameters.noUnpackFlip=this.parameters.noUnpackFlip||!1,this.parameters.preMultiplyAlpha=this.parameters.preMultiplyAlpha||!1,this.parameters.wrap=this.parameters.wrap||{s:Y.e8.REPEAT,t:Y.e8.REPEAT},this._startPreload(e)}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,W.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,W.HK)(e.src)||(0,W.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}dispose(){this._data=void 0}_createDescriptor(e){const t=new pe.X;return t.wrapMode=this.parameters.wrap??Y.e8.REPEAT,t.flipped=!this.parameters.noUnpackFlip,t.samplingMode=this.parameters.mipmap?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,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}get memoryEstimate(){return this._glTexture?.gpuMemoryUsage||function(e,t){if(null==e)return 0;if((0,u.eP)(e)||(0,u.lq)(e))return t.encoding===B.Ti.KTX2_ENCODING?function(e,t){if(null==K)return e.byteLength;const r=new K.KTX2File(new Uint8Array(e)),i=ie(r)?te(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.Ti.BASIS_ENCODING?function(e,t){if(null==K)return e.byteLength;const r=new K.BasisFile(new Uint8Array(e)),i=re(r)?te(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?ve(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this.parameters)}load(e){if(null!=this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new J.x(e,this._createDescriptor(e),null),this._glTexture):"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,u.eP)(t)||(0,u.lq)(t))&&this.parameters.encoding===B.Ti.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,t)):((0,u.eP)(t)||(0,u.lq)(t))&&this.parameters.encoding===B.Ti.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,t)):((0,u.eP)(t)||(0,u.lq)(t))&&this.parameters.encoding===B.Ti.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,t)):(0,u.lq)(t)?this._loadFromPixelData(e,t):(0,u.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e){return this._data instanceof HTMLVideoElement&&null!=this._glTexture?this._data.readyState<he.HAVE_CURRENT_DATA||e===this._data.currentTime?e:(this._glTexture.setData(this._data),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.parameters.updateCallback&&this.parameters.updateCallback(),this._data.currentTime):e}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return se.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return se.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case ce:o=8,n=Y.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case de:o=16,n=Y.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case ue:o=16,n=Y.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return se.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],l=r[3];0==(3&s)&&0==(3&l)||(se.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,m,h),f.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?Y.cw.LINEAR_MIPMAP_LINEAR:Y.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new J.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==K&&(K=await ee());const i=new K.KTX2File(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=oe(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==K&&(K=await ee());const i=new K.BasisFile(new Uint8Array(r));if(!re(i))return null;i.startTranscoding();const o=oe(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,fe.hu)(this.parameters.width>0&&this.parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.parameters.components?Y.VI.LUMINANCE:3===this.parameters.components?Y.VI.RGB:Y.VI.RGBA,r.width=this.parameters.width??0,r.height=this.parameters.height??0,this._glTexture=new J.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await F(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,j.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=he.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,V.hw)(l)},a=()=>{t.readyState>=he.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,t)))},s=e=>{n(),o(e||new I.Z("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_loadFromImage(e,t){const r=ve(t);this.parameters.width=r.width,this.parameters.height=r.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this.parameters.components?Y.VI.RGB:Y.VI.RGBA,i.width=r.width,i.height=r.height,this._glTexture=new J.x(e,i,t),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,V.M2)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function ve(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(me=he||(he={}))[me.HAVE_NOTHING=0]="HAVE_NOTHING",me[me.HAVE_METADATA=1]="HAVE_METADATA",me[me.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",me[me.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",me[me.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var _e=r(35065),Te=r(64822),xe=r(65576),Ee=r(55039),be=r(60624),Ae=r(19419),Se=r(85504),Re=r(60537),we=r(82791),ye=r(93144),Ce=r(27097);const Me=(0,Ce.wK)(Y.zi.SRC_ALPHA,Y.zi.ONE,Y.zi.ONE_MINUS_SRC_ALPHA,Y.zi.ONE_MINUS_SRC_ALPHA),Oe=(0,Ce.if)(Y.zi.ONE,Y.zi.ONE),Ie=(0,Ce.if)(Y.zi.ZERO,Y.zi.ONE_MINUS_SRC_ALPHA);function Pe(e){return e===ye.A.FrontFace?null:e===ye.A.Alpha?Ie:Oe}const Ne={factor:-1,units:-2};function Le(e,t=Y.wb.LESS){return e===ye.A.NONE||e===ye.A.FrontFace?t:Y.wb.LEQUAL}var De=r(97995),Fe=r(8310),He=r(87951);const Be=new class{constructor(e=0){this.offset=e,this.sphere=(0,Fe.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,l.s)(Ge,e,t,r),n=(0,l.m)(o,o,i),a=this.offset/(0,l.l)(n);(0,l.q)(n,n,n,a);const s=this.objectTransform.inverse;return(0,l.m)(this.tmpVertex,n,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,l.l)(e);(0,l.q)(e,e,e,r);const i=this.offset/(0,l.l)(t);(0,l.q)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,l.l)(e),r=this.offset/t;return(0,l.q)(this.sphere,e,e,r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,Fe.c)(),this._obb=(0,He.Ue)(),this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,l.l)(e)}applyToVertex(e,t,r){const i=(0,l.s)(Ge,e,t,r),o=(0,l.s)(Ue,e,t,r+this.componentLocalOriginLength),n=this._totalOffset/(0,l.l)(o);return(0,l.q)(this._tmpVertex,i,o,n),this._tmpVertex}applyToAabb(e){const t=(0,l.s)(Ge,e[0],e[1],e[2]+this.componentLocalOriginLength),r=(0,l.s)(Ue,e[3],e[4],e[5]+this.componentLocalOriginLength),i=(0,l.r)(ze,t),o=(0,l.r)(Ve,r),n=(0,l.u)(We,t),a=(0,l.u)(je,r),s=(0,l.v)(ke,n,a);s[0]=i[0]*o[0]<0?0:s[0],s[1]=i[1]*o[1]<0?0:s[1],s[2]=i[2]*o[2]<0?0:s[2];const c=(0,l.l)(s);if(c<this._totalOffset)return e[0]-=t[0]<0?this._totalOffset:0,e[1]-=t[1]<0?this._totalOffset:0,e[2]-=t[2]<0?this._totalOffset:0,e[3]+=r[0]>0?this._totalOffset:0,e[4]+=r[1]>0?this._totalOffset:0,e[5]+=r[2]>0?this._totalOffset:0,e;const d=(0,l.w)(ke,n,a),u=(0,l.l)(d),h=this._totalOffset/u,m=this._totalOffset/c;return e[0]+=t[0]*(t[0]>0?h:m),e[1]+=t[1]*(t[1]>0?h:m),e[2]+=t[2]*(t[2]>0?h:m),e[3]+=r[0]*(r[0]<0?h:m),e[4]+=r[1]*(r[1]<0?h:m),e[5]+=r[2]*(r[2]<0?h:m),e}applyToMbs(e){const t=(0,l.l)(e),r=this._totalOffset/t;return(0,l.q)(this._mbs,e,e,r),this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){return(0,He.gI)(e,this._totalOffset,this._totalOffset,Te.JY.Global,this._obb),this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=(0,l.s)(Ge,e,t,r),o=(0,l.e)(Ue,i,this.localOrigin),n=this.offset/(0,l.l)(o);return(0,l.q)(this.tmpVertex,i,o,n),this.tmpVertex}applyToAabb(e){const t=ze,r=Ve,i=We;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const n=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 o=0;o<3;++o)i[o]=0==(e&1<<o)?t[o]:r[o];n(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 o=0;o<3;++o)i[o]=0!=(a&1<<o)?0:0!=(e&1<<o)?t[o]:r[o];n(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ge=(0,c.c)(),Ue=(0,c.c)(),ze=(0,c.c)(),Ve=(0,c.c)(),We=(0,c.c)(),je=(0,c.c)(),ke=(0,c.c)();function qe(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function Xe(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function $e(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}function Ye(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function Je(e,t,r,i,o,n,s){switch(e){case _e.T.POSITION:{(0,fe.hu)(3===t.size);const o=n.getField(e,m.ct);(0,fe.hu)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,i,o,n=1){if(!r)return void Xe(e,t,i,o,n);const s=i.typedBuffer,l=i.typedBufferStride,c=e.length,d=r[0],u=r[1],h=r[2],m=r[4],f=r[5],p=r[6],g=r[8],v=r[9],_=r[10],T=r[12],x=r[13],E=r[14];o*=l;let b=0,A=0,S=0;const R=(0,a.y)(r)?e=>{b=t[e]+T,A=t[e+1]+x,S=t[e+2]+E}:e=>{const r=t[e],i=t[e+1],o=t[e+2];b=d*r+m*i+g*o+T,A=u*r+f*i+v*o+x,S=h*r+p*i+_*o+E};if(1===n)for(let t=0;t<c;++t)R(3*e[t]),s[o]=b,s[o+1]=A,s[o+2]=S,o+=l;else for(let t=0;t<c;++t){R(3*e[t]);for(let e=0;e<n;++e)s[o]=b,s[o+1]=A,s[o+2]=S,o+=l}}(r,t.data,i,o,s);break}case _e.T.NORMAL:{(0,fe.hu)(3===t.size);const i=n.getField(e,m.ct);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o,n=1){if(!r)return void Xe(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),E=1e-6,b=1-E;o*=c;let A=0,S=0,R=0;const w=(0,a.y)(s)?e=>{A=t[e],S=t[e+1],R=t[e+2]}:e=>{const r=t[e],i=t[e+1],o=t[e+2];A=u*r+f*i+v*o,S=h*r+p*i+_*o,R=m*r+g*i+T*o};if(1===n)if(x)for(let t=0;t<d;++t){w(3*e[t]);const r=A*A+S*S+R*R;if(r<b&&r>E){const e=1/Math.sqrt(r);l[o]=A*e,l[o+1]=S*e,l[o+2]=R*e}else l[o]=A,l[o+1]=S,l[o+2]=R;o+=c}else for(let t=0;t<d;++t)w(3*e[t]),l[o]=A,l[o+1]=S,l[o+2]=R,o+=c;else for(let t=0;t<d;++t){if(w(3*e[t]),x){const e=A*A+S*S+R*R;if(e<b&&e>E){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}for(let e=0;e<n;++e)l[o]=A,l[o+1]=S,l[o+2]=R,o+=c}}(r,t.data,o,i,s);break}case _e.T.NORMALCOMPRESSED:{(0,fe.hu)(2===t.size);const i=n.getField(e,m.or);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&qe(r,t.data,i,s);break}case _e.T.UV0:{(0,fe.hu)(2===t.size);const i=n.getField(e,m.Eu);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&qe(r,t.data,i,s);break}case _e.T.COLOR:case _e.T.SYMBOLCOLOR:{const i=n.getField(e,m.mc);(0,fe.hu)(!!i,`No buffer view for ${e}`),(0,fe.hu)(3===t.size||4===t.size),!i||3!==t.size&&4!==t.size||function(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,r!==t.length||4!==r)if(1!==n)if(4!==r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}else for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else{if(4===r){for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}return}for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else{a[o]=t[0],a[o+1]=t[1],a[o+2]=t[2],a[o+3]=t[3];const e=new Uint32Array(i.typedBuffer.buffer,i.start),r=s/4,c=e[o/=4];o+=r;const d=l*n;for(let t=1;t<d;++t)e[o]=c,o+=r}}(r,t.data,t.size,i,s);break}case _e.T.COLORFEATUREATTRIBUTE:{const i=n.getField(e,m.ly);(0,fe.hu)(!!i,`No buffer view for ${e}`),(0,fe.hu)(1===t.size),i&&1===t.size&&function(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length,s=t[0];i*=n;for(let e=0;e<a;++e)o[i]=s,i+=n}(r,t.data,i,s);break}case _e.T.TANGENT:{(0,fe.hu)(4===t.size);const i=n.getField(e,m.ek);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o,n=1){if(!r)return void $e(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),E=1e-6,b=1-E;if(o*=c,1===n)for(let r=0;r<d;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],d=t[i+3];let A=u*n+f*a+v*s,S=h*n+p*a+_*s,R=m*n+g*a+T*s;if(x){const e=A*A+S*S+R*R;if(e<b&&e>E){const t=1/Math.sqrt(e);A*=t,S*=t,R*=t}}l[o]=A,l[o+1]=S,l[o+2]=R,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],a=t[i],s=t[i+1],d=t[i+2],A=t[i+3];let S=u*a+f*s+v*d,R=h*a+p*s+_*d,w=m*a+g*s+T*d;if(x){const e=S*S+R*R+w*w;if(e<b&&e>E){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<n;++e)l[o]=S,l[o+1]=R,l[o+2]=w,l[o+3]=A,o+=c}}(r,t.data,o,i,s);break}case _e.T.PROFILERIGHT:case _e.T.PROFILEUP:case _e.T.PROFILEVERTEXANDNORMAL:case _e.T.FEATUREVALUE:{(0,fe.hu)(4===t.size);const i=n.getField(e,m.ek);(0,fe.hu)(!!i,`No buffer view for ${e}`),i&&$e(r,t.data,i,s)}}}class Ze{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.indices.get(_e.T.POSITION).length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)Je(a,t,s,r,i,o,n);else if(a===_e.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(_e.T.POSITION);if((0,fe.hu)(!!t,`No buffer view for ${a}`),t){const r=t.length,i=o.getField(a,m.mc);Ye(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var Ke=r(57790),Qe=r(88669),et=r(135),tt=r(15719),rt=r(96310),it=r(78869),ot=r(14589),nt=r(83475),at=r(59377);Y.wb.LESS,Y.wb.ALWAYS;const st={mask:255},lt={function:{func:Y.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:Y.xS.KEEP,zFail:Y.xS.KEEP,zPass:Y.xS.ZERO}},ct={function:{func:Y.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:Y.xS.KEEP,zFail:Y.xS.KEEP,zPass:Y.xS.REPLACE}};Y.wb.EQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,Y.xS.KEEP,Y.xS.KEEP,Y.xS.KEEP,Y.wb.NOTEQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,Y.xS.KEEP,Y.xS.KEEP,Y.xS.KEEP;const dt=[1,1,.5],ut=[0,.6,.2],ht=[0,1,.2];var mt=r(32078);class ft extends tt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.g)(dt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=be.r.Attribute,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,Qe.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.Gv.Less,this.textureAlphaMode=B.JJ.Blend,this.textureAlphaCutoff=rt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=we.yD.Occlude,this.isDecoration=!1}}class pt extends ot.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===Te.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?et.N.Default:et.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,pt.shader)}_initializeProgram(e,t){return new at.$(e.rctx,t.get().build(this.configuration),nt.i)}_convertDepthTestFunction(e){return e===B.Gv.Lequal?Y.wb.LEQUAL:Y.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===ye.A.NONE,o=e===ye.A.FrontFace;return(0,Ce.sm)({blending:r.output!==Ee.H.Color&&r.output!==Ee.H.Alpha||!r.transparent?null:i?Me:Pe(e),culling:gt(r)?(0,Ce.zp)(r.cullFace):null,depthTest:{func:Le(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ce.LZ:null,colorWrite:Ce.BK,stencilWrite:r.hasOccludees?st:null,stencilTest:r.hasOccludees?t?ct:lt:null,polygonOffset:i||o?null:(n=r.enableOffset,n?Ne:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function gt(e){return e.cullFace!==B.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}pt.shader=new it.J(mt.D,(()=>r.e(9291).then(r.bind(r,79291))));var vt=r(43697),_t=r(51354),Tt=r(47624),xt=r(67498);class Et extends Tt.PO{}(0,vt._)([(0,_t.o)({constValue:!0})],Et.prototype,"hasSliceHighlight",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],Et.prototype,"hasSliceInVertexProgram",void 0),(0,vt._)([(0,_t.o)({constValue:xt.P.Pass})],Et.prototype,"pbrTextureBindType",void 0);class bt extends Et{constructor(){super(...arguments),this.output=Ee.H.Color,this.alphaDiscardMode=B.JJ.Opaque,this.doubleSidedMode=Ae.q.None,this.pbrMode=Se.f7.Disabled,this.cullFace=B.Vr.None,this.transparencyPassType=ye.A.NONE,this.normalType=be.r.Attribute,this.textureCoordinateType=et.N.None,this.customDepthTest=B.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,vt._)([(0,_t.o)({count:Ee.H.COUNT})],bt.prototype,"output",void 0),(0,vt._)([(0,_t.o)({count:B.JJ.COUNT})],bt.prototype,"alphaDiscardMode",void 0),(0,vt._)([(0,_t.o)({count:Ae.q.COUNT})],bt.prototype,"doubleSidedMode",void 0),(0,vt._)([(0,_t.o)({count:Se.f7.COUNT})],bt.prototype,"pbrMode",void 0),(0,vt._)([(0,_t.o)({count:B.Vr.COUNT})],bt.prototype,"cullFace",void 0),(0,vt._)([(0,_t.o)({count:ye.A.COUNT})],bt.prototype,"transparencyPassType",void 0),(0,vt._)([(0,_t.o)({count:be.r.COUNT})],bt.prototype,"normalType",void 0),(0,vt._)([(0,_t.o)({count:et.N.COUNT})],bt.prototype,"textureCoordinateType",void 0),(0,vt._)([(0,_t.o)({count:B.Gv.COUNT})],bt.prototype,"customDepthTest",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"spherical",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVertexColors",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSymbolColors",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVerticalOffset",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSlicePlane",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasSliceHighlight",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasColorTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasMetallicRoughnessTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasEmissionTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOcclusionTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasNormalTexture",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasScreenSizePerspective",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasVertexTangents",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOccludees",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"multipassEnabled",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasModelTransformation",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"offsetBackfaces",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"vvSize",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"vvColor",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"receiveShadows",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"receiveAmbientOcclusion",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"textureAlphaPremultiplied",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instanced",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instancedColor",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"instancedDoublePrecision",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"writeDepth",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"transparent",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"enableOffset",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"cullAboveGround",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"snowCover",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasColorTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasEmissionTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasNormalTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasOcclusionTextureTransform",void 0),(0,vt._)([(0,_t.o)()],bt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,vt._)([(0,_t.o)({constValue:!0})],bt.prototype,"hasVvInstancing",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],bt.prototype,"useCustomDTRExponentForWater",void 0),(0,vt._)([(0,_t.o)({constValue:!1})],bt.prototype,"supportsTextureAtlas",void 0),(0,vt._)([(0,_t.o)({constValue:!0})],bt.prototype,"useFillLights",void 0);var At=r(41846);class St extends pt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=be.r.Attribute,t.doubleSidedMode=Ae.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,St.shader)}}St.shader=new it.J(At.R,(()=>r.e(8096).then(r.bind(r,38096))));class Rt extends we.F5{constructor(e){super(e,yt),this.supportsEdges=!0,this._configuration=new bt,this._vertexBufferLayout=function(e){const t=(0,xe.U$)().vec3f(_e.T.POSITION);return e.normalType===be.r.Compressed?t.vec2i16(_e.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(_e.T.NORMAL),e.hasVertexTangents&&t.vec4f(_e.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(_e.T.UV0),e.hasVertexColors&&t.vec4u8(_e.T.COLOR),e.hasSymbolColors&&t.vec4u8(_e.T.SYMBOLCOLOR),(0,U.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(_e.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Ee.H.Shadow&&e!==Ee.H.ShadowExcludeHighlight&&e!==Ee.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.Vr.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Ee.H.Color&&e!==Ee.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ae.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ae.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ae.q.WindingOrder:Ae.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Se.f7.Schematic:Se.f7.Normal:Se.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(Nt,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case Te.JY.Global:n=(0,l.n)(It,Nt);break;case Te.JY.Local:n=(0,l.i)(It,Ot)}let a=0;const s=(0,l.g)(Lt,Nt,e.eye),c=(0,l.l)(s),d=(0,l.b)(s,s,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,l.d)(n,d)),a+=(0,Ke.Hx)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,l.b)(n,n,a),(0,l.t)(Pt,n,r.transform.inverseRotation),i=(0,l.g)(Ct,i,Pt),o=(0,l.g)(Mt,o,Pt)}(0,Ke.Bw)(e,r,i,o,function(e){return null!=e?(Be.offset=e,Be):null}(r.verticalOffset),n)}produces(e,t){return!(t!==Ee.H.Color&&t!==Ee.H.Alpha&&t!==Ee.H.Depth&&t!==Ee.H.Normal&&t!==Ee.H.Shadow&&t!==Ee.H.ShadowHighlight&&t!==Ee.H.ShadowExcludeHighlight&&t!==Ee.H.Highlight&&t!==Ee.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?De.r.TRANSPARENT_MATERIAL:De.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:De.r.OPAQUE_MATERIAL)&&e!==De.r.DRAPED_MATERIAL)}createGLMaterial(e){return new wt(e)}createBufferWriter(){return new Ze(this._vertexBufferLayout)}}class wt extends Re.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==Ee.H.Color&&this._output!==Ee.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?St:pt,e)}}const yt=new class extends ft{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Ct=(0,c.c)(),Mt=(0,c.c)(),Ot=(0,c.f)(0,0,1),It=(0,c.c)(),Pt=(0,c.c)(),Nt=(0,c.c)(),Lt=(0,c.c)(),Dt=P.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Ft(e){throw new I.Z("",`Request for object resource failed: ${e}`)}function Ht(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Dt.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Dt.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Dt.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Dt.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Dt.warn("Indexed geometries must specify faces"),i=!1;break}default:Dt.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Dt.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Dt.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Bt(e){const t=(0,d.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,d.pp)(t,r.bbMin),(0,d.pp)(t,r.bbMax))})),t}function Gt(e){switch(e){case"mask":return B.JJ.Mask;case"maskAndTransparency":return B.JJ.MaskBlend;case"none":return B.JJ.Opaque;default:return B.JJ.Blend}}function Ut(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const zt=new D.G(1,2,"wosr");var Vt=r(57758);async function Wt(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=null!=t&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,M.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Ft(i.error.details.url)}(e,r,t);const i=await(0,M.q6)((0,C.Z)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Ft(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],n=o.images[0].data;if(!n){Dt.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:Y.e8.REPEAT,t:Y.e8.REPEAT},preMultiplyAlpha:Gt(l)!==B.JJ.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):F(a,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,O.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new N,a=e.resource,s=D.G.parse(a.version||"1.0","wosr");zt.validate(s);const l=a.model.name,d=a.model.geometries,u=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<d.length;e++){const a=d[e];if(!Ht(a))continue;const s=Ut(a),l=a.params.vertexAttributes,p=[];for(const e in l){const t=l[e],r=t.values;p.push([e,new H.a(r,t.valuesPerElement,!0)])}const g=[];if("PerAttributeArray"!==a.params.topology){const e=a.params.faces;for(const t in e)g.push([t,e[t].values])}const v=s.texture,_=h&&h[v];if(_&&!f.has(v)){const{image:e,parameters:t}=_,r=new ge(e,t);i.push(r),f.set(v,r)}const T=f.get(v),x=T?T.id:void 0,E=s.material;let b=n.get(E,v);if(null==b){const e=u[E.substring(E.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=_&&_.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=_?Gt(_.alphaChannelUsage):void 0,a={ambient:(0,c.g)(e.diffuse),diffuse:(0,c.g)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:B.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:_?.parameters.preMultiplyAlpha??!1};null!=t&&t.materialParamsMixin&&Object.assign(a,t.materialParamsMixin),b=new Rt(a),n.set(E,v,b)}o.push(b);const A=new G.Z(b,p,g);m+=g.find((e=>e[0]===_e.T.POSITION))?.[1].length??0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Bt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),u=n.model.meta?.ESRI_proxyEllipsoid,A=n.meta.isEsriSymbolResource&&null!=u&&n.meta.uri.includes("/RealisticTrees/");A&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,d=n.count,u=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*d),g=new Float64Array(3*d),v=(0,a.a)((0,s.c)(),o.transform);let _=0,T=0;for(let a=0;a<d;a++){n.getVec(a,h),i.getVec(a,u),(0,l.m)(h,h,o.transform),(0,l.g)(f,h,t.center),(0,l.E)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),d=Math.min(.45+.55*c*c,1);(0,l.E)(f,f,t.radius),null!==v&&(0,l.m)(f,f,v),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.f)(f,f,u,s>-1?.2:Math.min(-4*s-3.8,1)),g[_]=f[0],g[_+1]=f[1],g[_+2]=f[2],_+=3,p[T]=255*d,p[T+1]=255*d,p[T+2]=255*d,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(n,u));const S=!!t.usePBR,w=n.meta.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:A,mrrFactors:[...ht]}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:[...dt]},I={...t.materialParamsMixin,treeRendering:A},{engineResources:P,referenceBoundingBox:U}=function(e,t,r,i){const n=e.model,a=new Array,s=new Map,u=new Map,T=n.lods.length,x=(0,d.cS)();return n.lods.forEach(((e,A)=>{const S=!0===i.skipHighLods&&(T>1&&0===A||T>3&&1===A)||!1===i.skipHighLods&&null!=i.singleLodIndex&&A!==i.singleLodIndex;if(S&&0!==A)return;const w=new y(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=S?new Rt({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),d=e.materials.get(t.material),u=null!=t.attributes.texCoord0,h=null!=t.attributes.normal;if(null==d)return null;const m=function(e){switch(e){case"BLEND":return B.JJ.Blend;case"MASK":return B.JJ.Mask;case"OPAQUE":case null:case void 0:return B.JJ.Opaque}}(d.alphaMode);if(!n.has(s)){if(u){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new ge((0,b.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,b.$A)(e)&&r,encoding:(0,b.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(d.textureColor,m!==B.JJ.Opaque),t(d.textureNormal),t(d.textureOcclusion),t(d.textureEmissive),t(d.textureMetallicRoughness)}const r=d.color[0]**(1/Vt.K),f=d.color[1]**(1/Vt.K),p=d.color[2]**(1/Vt.K),g=d.emissiveFactor[0]**(1/Vt.K),v=d.emissiveFactor[1]**(1/Vt.K),_=d.emissiveFactor[2]**(1/Vt.K),T=null!=d.textureColor&&u?a.get(d.textureColor):null,x=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==o&&(null==n||(0,l.k)(n,c.Z))&&null==a&&(null==i||1===i)&&(null==r||1===r||0===r)}({normalTexture:d.textureNormal,metallicRoughnessTexture:d.textureMetallicRoughness,metallicFactor:d.metallicFactor,roughnessFactor:d.roughnessFactor,emissiveTexture:d.textureEmissive,emissiveFactor:d.emissiveFactor,occlusionTexture:d.textureOcclusion});n.set(s,new Rt({...i,transparent:m===B.JJ.Blend,customDepthTest:B.Gv.Lequal,textureAlphaMode:m,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,f,p],ambient:[r,f,p],opacity:d.opacity,doubleSided:d.doubleSided,doubleSidedType:"winding-order",cullFace:d.doubleSided?B.Vr.None:B.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?be.r.Attribute:be.r.ScreenDerivative,castShadows:!0,textureId:null!=T?T.id:void 0,colorMixMode:d.colorMixMode,normalTextureId:null!=d.textureNormal&&u?a.get(d.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.textureOcclusion&&u?a.get(d.textureOcclusion).id:void 0,emissiveTextureId:null!=d.textureEmissive&&u?a.get(d.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=d.textureMetallicRoughness&&u?a.get(d.textureMetallicRoughness).id:void 0,emissiveFactor:[g,v,_],mrrFactors:x?[...ut]:[d.metallicFactor,d.roughnessFactor,i.mrrFactors[2]],isSchematic:x,colorTextureTransformMatrix:R(d.colorTextureTransform),normalTextureTransformMatrix:R(d.normalTextureTransform),occlusionTextureTransformMatrix:R(d.occlusionTextureTransform),emissiveTextureTransformMatrix:R(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(d.metallicRoughnessTextureTransform),...o}))}const f=n.get(s);if(r.stageResources.materials.push(f),u){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(d.textureColor),e(d.textureNormal),e(d.textureOcclusion),e(d.textureEmissive),e(d.textureMetallicRoughness)}return f}(n,e,w,t,r,s,u),{geometry:a,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.p)(e.indices||r,e.primitiveType),n=h(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,f.t)(n,a,e.transform,3,s);const l=[[_e.T.POSITION,new H.a(n,3,!0)]],c=[[_e.T.POSITION,i]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.d)(jt,e.transform),(0,f.a)(t,n,jt,3,a),l.push([_e.T.NORMAL,new H.a(t,3,!0)]),c.push([_e.T.NORMAL,i])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.d)(jt,e.transform),(0,p.t)(t,n,jt,4,a),l.push([_e.T.TANGENT,new H.a(t,4,!0)]),c.push([_e.T.TANGENT,i])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([_e.T.UV0,new H.a(t,2,!0)]),c.push([_e.T.UV0,i])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([_e.T.COLOR,new H.a(t,4,!0)]),c.push([_e.T.COLOR,i])}return{geometry:new G.Z(t,l,c),vertexCount:r}}(e,null!=i?i:new Rt({})),y=a.boundingInfo;null!=y&&0===A&&((0,d.pp)(x,y.bbMin),(0,d.pp)(x,y.bbMax)),null!=i&&(w.stageResources.geometries.push(a),w.numberOfVertices+=T)})),S||a.push(w)})),{engineResources:a,referenceBoundingBox:x}}(n,w,I,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:P,referenceBoundingBox:U,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const jt=(0,n.c)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>d});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
286
286
|
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
287
287
|
}`)}function d(e,t){const{vertex:r}=e;switch(t.output){case i.H.Color:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.H.Depth:case i.H.Shadow:case i.H.ShadowHighlight:case i.H.ShadowExcludeHighlight:return e.include(o.up,t),s(e),l(e),c(e),void r.code.add(a.H`void forwardLinearDepth() {
|
|
288
288
|
linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
|
|
@@ -620,7 +620,7 @@ return mat3(T, B, normal);
|
|
|
620
620
|
}`),t.textureCoordinateType!==i.N.None&&(e.include(o.i,t),r.uniforms.add(t.pbrTextureBindType===c.P.Pass?new l.A("normalTexture",(e=>e.textureNormal)):new s.R("normalTexture",(e=>e.textureNormal))),r.code.add(a.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
|
|
621
621
|
vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;
|
|
622
622
|
return tangentSpace * rawNormal;
|
|
623
|
-
}`))}},77813:(e,t,r)=>{r.d(t,{K:()=>de});var i=r(74709),o=r(98069),n=r(43697),a=r(70586),s=r(17445),l=r(76882),c=r(5600),d=(r(75215),r(67676)),u=(r(80442),r(52011)),h=r(4307);r(69801);var m=r(35371),f=r(92604),p=r(1533),g=r(49300),v=r(7575);const _=f.Z.getLogger("esri.views.webgl.BufferObject");class T{static createIndex(e,t,r){return new T(e,m.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new T(e,m.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==v.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new T(e,m.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=m.l1.STREAM_READ,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new T(e,m.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=m.l1.STREAM_DRAW,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new T(e,m.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(m._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,g.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER?this._indexType===m.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===m.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(m._g.BufferObject,this),this._context=null):this._glName&&_.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_.error("Buffer size needs to be positive!"),this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case m.g.UNSIGNED_SHORT:e*=2;break;case m.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&((0,p.Uc)(e)&&(t/=2,this._indexType=m.g.UNSIGNED_SHORT),(0,p.ZY)(e)&&(t/=4,this._indexType=m.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,g.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteLength)&&_.error("offset is out of range!"),r>=i&&_.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteLength&&_.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===v.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,g.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==v.zO.WEBGL2)return void _.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,d.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void _.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteLength&&_.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,m.w0.COPY_READ_BUFFER),n.getBufferSubData(m.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(m.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===v.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_.error("Get buffer subdata is supported in WebGL2 only!")}}var x=r(4375),E=r(45762);class b{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}}class A{constructor(e,t){this._context=e,this._descriptor=t,this.type=x.B.RenderBuffer,this._context.instanceCounter.increment(m._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;if(a){if(this._context.type!==v.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get gpuMemoryUsage(){return(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,E.RG)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m._g.Renderbuffer,this),this._context=null)}}var S=r(57088);const R=f.Z.getLogger("esri.views.webgl.FramebufferObject");class w{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m._g.FramebufferObject,this);const i=y(t)?t:new S.x(this._context,t);if(this._colorAttachments.set(m.VY.COLOR_ATTACHMENT0,i),this._validateTextureDescriptor(i.descriptor),this._validateColorAttachmentPoint(m.VY.COLOR_ATTACHMENT0),null!=r)if(function(e){return y(e)||null!=e&&"pixelFormat"in e}(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=y(r)?r:new S.x(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=function(e){return null!=e&&"type"in e&&e.type===x.B.RenderBuffer}(r)?r:new A(this._context,r);this._depthStencilBuffer=e,this._validateRenderBufferDescriptor(e.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach(((e,t)=>this.detachColorTexture(t)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(m._g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+r.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&y(t)?t:null}attachColorTexture(e,t=m.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=m.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),t}setColorTextureTarget(e,t=m.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case x.B.Texture:return this._attachDepthStencilTexture(e);case x.B.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==m.VI.DEPTH_STENCIL&&t.pixelFormat!==m.VI.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==m.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m.Lu)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m.Lu)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(m.qi.FRAMEBUFFER,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer?.dispose(),this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(m.qi.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;a.descriptor.target!==m.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||n+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,S.x.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(S.x.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(m.No.TEXTURE_2D,0,o,n,e,t,r,i),l.bindTexture(c,S.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==v.zO.WEBGL2)return(0,g.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=T.createPixelPack(this._context,m.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(m.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};C(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((e=>e.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(C(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=m.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();t.bindFramebuffer(e,r),this._colorAttachments.forEach(((t,r)=>this._framebufferTexture2D(t.glName,r,M(t),e)));const i=this._depthStencilBuffer;if(i){const r=this._getGLAttachmentPoint(i.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,i.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,M(this._depthStencilTexture),e);(0,g.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.VY.COLOR_ATTACHMENT0,r=m.No.TEXTURE_2D,i=m.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(m.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.M2)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=(0,a.M2)(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==m.No.TEXTURE_2D&&e.target!==m.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),C(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){C(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.Tg.DEPTH_COMPONENT16:case m.Tg.DEPTH_COMPONENT24:case m.Tg.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case m.Tg.DEPTH24_STENCIL8:case m.Tg.DEPTH32F_STENCIL8:case m.Tg.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case m.Tg.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===w._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;w._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else w._MAX_COLOR_ATTACHMENTS=1}const t=e-m.VY.COLOR_ATTACHMENT0;t+1>w._MAX_COLOR_ATTACHMENTS&&f.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${w._MAX_COLOR_ATTACHMENTS} color attachments`)}}function y(e){return null!=e&&"type"in e&&e.type===x.B.Texture}function C(e,t){const r=Math.max(e.width,e.height);if(r>t){R.warn(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function M(e){return e.descriptor.target===m.No.TEXTURE_CUBE_MAP?m.No.TEXTURE_CUBE_MAP_POSITIVE_X:m.No.TEXTURE_2D}w._MAX_COLOR_ATTACHMENTS=-1;var O,I,P=r(47859);(I=O||(O={}))[I.RED=0]="RED",I[I.RG=1]="RG",I[I.RGBA4=2]="RGBA4",I[I.RGBA=3]="RGBA",I[I.RGBA_MIPMAP=4]="RGBA_MIPMAP",I[I.R16F=5]="R16F",I[I.RGBA16F=6]="RGBA16F";const N=new P.X;N.pixelFormat=m.VI.RED,N.internalFormat=m.lP.R8,N.wrapMode=m.e8.CLAMP_TO_EDGE;const L=new P.X;L.pixelFormat=m.VI.RG,L.internalFormat=m.lP.RG8,L.wrapMode=m.e8.CLAMP_TO_EDGE;const D=new P.X;D.internalFormat=m.lP.RGBA4,D.dataType=m.Br.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.e8.CLAMP_TO_EDGE;(new P.X).wrapMode=m.e8.CLAMP_TO_EDGE;const F=new P.X;F.wrapMode=m.e8.CLAMP_TO_EDGE,F.samplingMode=m.cw.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const H=new P.X;H.pixelFormat=m.VI.RED,H.dataType=m.Br.HALF_FLOAT,H.internalFormat=m.lP.R16F,H.samplingMode=m.cw.NEAREST;const B=new P.X;var G;B.dataType=m.Br.HALF_FLOAT,B.internalFormat=m.lP.RGBA16F,B.samplingMode=m.cw.NEAREST,O.RED,O.RG,O.RGBA4,O.RGBA,O.RGBA_MIPMAP,O.R16F,O.RGBA16F,function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH24_BUFFER=1]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=2]="DEPTH16_BUFFER"}(G||(G={}));const U=new P.X;U.pixelFormat=m.VI.DEPTH_STENCIL,U.dataType=m.Br.UNSIGNED_INT_24_8,U.samplingMode=m.cw.NEAREST,U.wrapMode=m.e8.CLAMP_TO_EDGE,G.DEPTH_STENCIL_TEXTURE,G.DEPTH24_BUFFER,new b(m.Tg.DEPTH_COMPONENT24,4),G.DEPTH16_BUFFER,new b(m.Tg.DEPTH_COMPONENT16,4);var z=r(55039),V=r(92036);class W extends V.Z{requires(e){return!1}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}}class j extends W{}var k=r(78869),q=r(14589),X=r(83475),$=r(59377),Y=r(59915),J=r(27097);class Z extends q.A{initializeProgram(e){return new $.$(e.rctx,Z.shader.get().build(),X.i)}initializePipeline(){return(0,J.sm)({colorWrite:J.BK})}}Z.shader=new k.J(Y.S,(()=>r.e(8092).then(r.bind(r,88092))));var K=r(97323);class Q extends i.K{constructor(){super(...arguments),this.projScale=1}}class ee extends Q{constructor(){super(...arguments),this.intensity=1}}class te extends i.K{}class re extends te{constructor(){super(...arguments),this.blurSize=(0,K.a)()}}var ie,oe=r(25377);class ne extends q.A{initializeProgram(e){return new $.$(e.rctx,ne.shader.get().build(),X.i)}initializePipeline(){return(0,J.sm)({colorWrite:J.BK})}}ne.shader=new k.J(oe.S,(()=>r.e(9243).then(r.bind(r,49243)))),r(95720),function(e){e[e.Antialiasing=0]="Antialiasing",e[e.HighQualityTransparency=1]="HighQualityTransparency",e[e.HighResolutionVoxel=2]="HighResolutionVoxel",e[e.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",e[e.SSAO=4]="SSAO",e[e.WaterReflection=5]="WaterReflection",e[e.HighResolutionShadows=6]="HighResolutionShadows",e[e.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(ie||(ie={}));var ae=r(97995);const se=2;let le=class extends j{constructor(e){super(e),this.renderSlots=[ae.r.SSAO],this._context=null,this._passParameters=new ee,this._drawParameters=new re}canRender(){return null!=this._enableTime&&null!=this._context}requires(e){return this.canRender()&&(e===z.H.Depth||e===z.H.Normal)}initializeRenderContext(e){this._context=e,this.addHandles([(0,s.YP)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(ie.SSAO)),(e=>e?this._enable():this._disable()),s.tX)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,a.M2)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;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 P.X;t.wrapMode=m.e8.CLAMP_TO_EDGE,t.pixelFormat=m.VI.RGB,t.wrapMode=m.e8.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new S.x(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(ne)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(Z)),this._enableTime=(0,l.HA)(0),this._context?.requestRender()}render(e,t,r,i){const o=e.bindParameters,n=o.linearDepth?.colorTexture;if(null==this._enableTime||null==this._context||null==n||!r?.normalTexture)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,s=o.camera,l=this.view.qualitySettings.fadeDuration,c=l>0?Math.min(l,e.time-this._enableTime)/l:1;this._passParameters.normalTexture=r.normalTexture,this._passParameters.depthTexture=n,this._passParameters.projScale=1/s.computeRenderPixelSizeAtDist(1),this._passParameters.intensity=4*ce/(0,oe.g)(s)**6*c;const d=s.fullViewport[2],u=s.fullViewport[3],f=d/se,p=u/se,g=this._context.fbos,v=g.acquire(O.RED,d,u);a.bindFramebuffer(v.fbo),a.setViewport(0,0,d,u),a.bindTechnique(this._ssaoTechnique,this._passParameters,o).bindDraw(this._drawParameters,o,this._passParameters),a.screen.draw();const _=a.bindTechnique(this._blurTechnique,this._passParameters,o);a.setViewport(0,0,f,p);const T=g.acquire(O.RED,f,p);a.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=v.colorTexture,(0,h.s)(this._drawParameters.blurSize,0,se/u),_.bindDraw(this._drawParameters,o,this._passParameters),a.setViewport(0,0,f,p),a.screen.draw(),v.release();const x=g.acquire(O.RED,f,p);return a.bindFramebuffer(x.fbo),a.setViewport(0,0,d,u),a.setClearColor(1,1,1,0),a.clear(m.lk.COLOR_BUFFER_BIT),a.setViewport(0,0,f,p),this._drawParameters.colorTexture=T.colorTexture,(0,h.s)(this._drawParameters.blurSize,se/d,0),_.bindDraw(this._drawParameters,o,this._passParameters),a.screen.draw(),a.setViewport4fv(s.fullViewport),T.release(),c<1&&this._context.requestRender(),x}};(0,n._)([(0,c.Cb)({constructOnly:!0})],le.prototype,"view",void 0),(0,n._)([(0,c.Cb)()],le.prototype,"_context",void 0),le=(0,n._)([(0,u.j)("esri.views.3d.webgl-engine.lib.SSAO")],le);const ce=.5;function de(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new o.A("ssaoTex",((e,t)=>t.ssao?.colorTexture))),r.constants.add("blurSizePixelsInverse","float",1/se),r.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
623
|
+
}`))}},77813:(e,t,r)=>{r.d(t,{K:()=>de});var i=r(74709),o=r(98069),n=r(43697),a=r(70586),s=r(17445),l=r(76882),c=r(5600),d=(r(75215),r(67676)),u=(r(80442),r(52011)),h=r(4307);r(69801);var m=r(35371),f=r(92604),p=r(1533),g=r(49300),v=r(7575);const _=f.Z.getLogger("esri.views.webgl.BufferObject");class T{static createIndex(e,t,r){return new T(e,m.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new T(e,m.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==v.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new T(e,m.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=m.l1.STREAM_READ,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new T(e,m.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=m.l1.STREAM_DRAW,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new T(e,m.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(m._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,g.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER?this._indexType===m.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===m.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(m._g.BufferObject,this),this._context=null):this._glName&&_.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_.error("Buffer size needs to be positive!"),this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case m.g.UNSIGNED_SHORT:e*=2;break;case m.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&((0,p.Uc)(e)&&(t/=2,this._indexType=m.g.UNSIGNED_SHORT),(0,p.ZY)(e)&&(t/=4,this._indexType=m.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,g.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteLength)&&_.error("offset is out of range!"),r>=i&&_.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteLength&&_.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===v.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,g.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==v.zO.WEBGL2)return void _.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,d.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void _.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteLength&&_.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,m.w0.COPY_READ_BUFFER),n.getBufferSubData(m.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(m.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===v.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_.error("Get buffer subdata is supported in WebGL2 only!")}}var x=r(4375),E=r(45762);class b{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}}class A{constructor(e,t){this._context=e,this._descriptor=t,this.type=x.B.RenderBuffer,this._context.instanceCounter.increment(m._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;if(a){if(this._context.type!==v.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get gpuMemoryUsage(){return(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,E.RG)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m._g.Renderbuffer,this),this._context=null)}}var S=r(57088);const R=f.Z.getLogger("esri.views.webgl.FramebufferObject");class w{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m._g.FramebufferObject,this);const i=y(t)?t:new S.x(this._context,t);if(this._colorAttachments.set(m.VY.COLOR_ATTACHMENT0,i),this._validateTextureDescriptor(i.descriptor),this._validateColorAttachmentPoint(m.VY.COLOR_ATTACHMENT0),null!=r)if(function(e){return y(e)||null!=e&&"pixelFormat"in e}(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=y(r)?r:new S.x(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=function(e){return null!=e&&"type"in e&&e.type===x.B.RenderBuffer}(r)?r:new A(this._context,r);this._depthStencilBuffer=e,this._validateRenderBufferDescriptor(e.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach(((e,t)=>this.detachColorTexture(t)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(m._g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+r.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&y(t)?t:null}attachColorTexture(e,t=m.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=m.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),t}setColorTextureTarget(e,t=m.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case x.B.Texture:return this._attachDepthStencilTexture(e);case x.B.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==m.VI.DEPTH_STENCIL&&t.pixelFormat!==m.VI.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==m.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m.Lu)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m.Lu)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(m.qi.FRAMEBUFFER,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer?.dispose(),this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(m.qi.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;a.descriptor.target!==m.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||n+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,S.x.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(S.x.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(m.No.TEXTURE_2D,0,o,n,e,t,r,i),l.bindTexture(c,S.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==v.zO.WEBGL2)return(0,g.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=T.createPixelPack(this._context,m.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(m.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};C(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((e=>e.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(C(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=m.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();t.bindFramebuffer(e,r),this._colorAttachments.forEach(((t,r)=>this._framebufferTexture2D(t.glName,r,M(t),e)));const i=this._depthStencilBuffer;if(i){const r=this._getGLAttachmentPoint(i.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,i.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,M(this._depthStencilTexture),e);(0,g.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.VY.COLOR_ATTACHMENT0,r=m.No.TEXTURE_2D,i=m.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(m.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.M2)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=(0,a.M2)(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==m.No.TEXTURE_2D&&e.target!==m.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),C(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){C(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.Tg.DEPTH_COMPONENT16:case m.Tg.DEPTH_COMPONENT24:case m.Tg.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case m.Tg.DEPTH24_STENCIL8:case m.Tg.DEPTH32F_STENCIL8:case m.Tg.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case m.Tg.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===w._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;w._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else w._MAX_COLOR_ATTACHMENTS=1}const t=e-m.VY.COLOR_ATTACHMENT0;t+1>w._MAX_COLOR_ATTACHMENTS&&f.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${w._MAX_COLOR_ATTACHMENTS} color attachments`)}}function y(e){return null!=e&&"type"in e&&e.type===x.B.Texture}function C(e,t){const r=Math.max(e.width,e.height);if(r>t){R.warn(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function M(e){return e.descriptor.target===m.No.TEXTURE_CUBE_MAP?m.No.TEXTURE_CUBE_MAP_POSITIVE_X:m.No.TEXTURE_2D}w._MAX_COLOR_ATTACHMENTS=-1;var O,I,P=r(47859);(I=O||(O={}))[I.RED=0]="RED",I[I.RG=1]="RG",I[I.RGBA4=2]="RGBA4",I[I.RGBA=3]="RGBA",I[I.RGBA_MIPMAP=4]="RGBA_MIPMAP",I[I.R16F=5]="R16F",I[I.RGBA16F=6]="RGBA16F";const N=new P.X;N.pixelFormat=m.VI.RED,N.internalFormat=m.lP.R8,N.wrapMode=m.e8.CLAMP_TO_EDGE;const L=new P.X;L.pixelFormat=m.VI.RG,L.internalFormat=m.lP.RG8,L.wrapMode=m.e8.CLAMP_TO_EDGE;const D=new P.X;D.internalFormat=m.lP.RGBA4,D.dataType=m.Br.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.e8.CLAMP_TO_EDGE;(new P.X).wrapMode=m.e8.CLAMP_TO_EDGE;const F=new P.X;F.wrapMode=m.e8.CLAMP_TO_EDGE,F.samplingMode=m.cw.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const H=new P.X;H.pixelFormat=m.VI.RED,H.dataType=m.Br.HALF_FLOAT,H.internalFormat=m.lP.R16F,H.samplingMode=m.cw.NEAREST;const B=new P.X;var G;B.dataType=m.Br.HALF_FLOAT,B.internalFormat=m.lP.RGBA16F,B.samplingMode=m.cw.NEAREST,O.RED,O.RG,O.RGBA4,O.RGBA,O.RGBA_MIPMAP,O.R16F,O.RGBA16F,function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH24_BUFFER=1]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=2]="DEPTH16_BUFFER"}(G||(G={}));const U=new P.X;U.pixelFormat=m.VI.DEPTH_STENCIL,U.dataType=m.Br.UNSIGNED_INT_24_8,U.samplingMode=m.cw.NEAREST,U.wrapMode=m.e8.CLAMP_TO_EDGE,G.DEPTH_STENCIL_TEXTURE,G.DEPTH24_BUFFER,new b(m.Tg.DEPTH_COMPONENT24,4),G.DEPTH16_BUFFER,new b(m.Tg.DEPTH_COMPONENT16,4);var z=r(55039),V=r(92036);class W extends V.Z{consumes(e){return!1}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}}class j extends W{}var k=r(78869),q=r(14589),X=r(83475),$=r(59377),Y=r(59915),J=r(27097);class Z extends q.A{initializeProgram(e){return new $.$(e.rctx,Z.shader.get().build(),X.i)}initializePipeline(){return(0,J.sm)({colorWrite:J.BK})}}Z.shader=new k.J(Y.S,(()=>r.e(8092).then(r.bind(r,88092))));var K=r(97323);class Q extends i.K{constructor(){super(...arguments),this.projScale=1}}class ee extends Q{constructor(){super(...arguments),this.intensity=1}}class te extends i.K{}class re extends te{constructor(){super(...arguments),this.blurSize=(0,K.a)()}}var ie,oe=r(25377);class ne extends q.A{initializeProgram(e){return new $.$(e.rctx,ne.shader.get().build(),X.i)}initializePipeline(){return(0,J.sm)({colorWrite:J.BK})}}ne.shader=new k.J(oe.S,(()=>r.e(9243).then(r.bind(r,49243)))),r(95720),function(e){e[e.Antialiasing=0]="Antialiasing",e[e.HighQualityTransparency=1]="HighQualityTransparency",e[e.HighResolutionVoxel=2]="HighResolutionVoxel",e[e.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",e[e.SSAO=4]="SSAO",e[e.WaterReflection=5]="WaterReflection",e[e.HighResolutionShadows=6]="HighResolutionShadows",e[e.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(ie||(ie={}));var ae=r(97995);const se=2;let le=class extends j{constructor(e){super(e),this.renderSlots=[ae.r.SSAO],this._context=null,this._passParameters=new ee,this._drawParameters=new re}produces(){return null!=this._enableTime&&null!=this._context}consumes(e){return this.produces()&&(e===z.H.Depth||e===z.H.Normal)}initializeRenderContext(e){this._context=e,this.addHandles([(0,s.YP)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(ie.SSAO)),(e=>e?this._enable():this._disable()),s.tX)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,a.M2)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;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 P.X;t.wrapMode=m.e8.CLAMP_TO_EDGE,t.pixelFormat=m.VI.RGB,t.wrapMode=m.e8.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new S.x(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(ne)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(Z)),this._enableTime=(0,l.HA)(0),this._context?.requestRender()}render(e,t,r,i){const o=e.bindParameters,n=o.linearDepth?.colorTexture;if(null==this._enableTime||null==this._context||null==n||!r?.normalTexture)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,s=o.camera,l=this.view.qualitySettings.fadeDuration,c=l>0?Math.min(l,e.time-this._enableTime)/l:1;this._passParameters.normalTexture=r.normalTexture,this._passParameters.depthTexture=n,this._passParameters.projScale=1/s.computeRenderPixelSizeAtDist(1),this._passParameters.intensity=4*ce/(0,oe.g)(s)**6*c;const d=s.fullViewport[2],u=s.fullViewport[3],f=d/se,p=u/se,g=this._context.fbos,v=g.acquire(O.RED,d,u);a.bindFramebuffer(v.fbo),a.setViewport(0,0,d,u),a.bindTechnique(this._ssaoTechnique,this._passParameters,o).bindDraw(this._drawParameters,o,this._passParameters),a.screen.draw();const _=a.bindTechnique(this._blurTechnique,this._passParameters,o);a.setViewport(0,0,f,p);const T=g.acquire(O.RED,f,p);a.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=v.colorTexture,(0,h.s)(this._drawParameters.blurSize,0,se/u),_.bindDraw(this._drawParameters,o,this._passParameters),a.setViewport(0,0,f,p),a.screen.draw(),v.release();const x=g.acquire(O.RED,f,p);return a.bindFramebuffer(x.fbo),a.setViewport(0,0,d,u),a.setClearColor(1,1,1,0),a.clear(m.lk.COLOR_BUFFER_BIT),a.setViewport(0,0,f,p),this._drawParameters.colorTexture=T.colorTexture,(0,h.s)(this._drawParameters.blurSize,se/d,0),_.bindDraw(this._drawParameters,o,this._passParameters),a.screen.draw(),a.setViewport4fv(s.fullViewport),T.release(),c<1&&this._context.requestRender(),x}};(0,n._)([(0,c.Cb)({constructOnly:!0})],le.prototype,"view",void 0),(0,n._)([(0,c.Cb)()],le.prototype,"_context",void 0),le=(0,n._)([(0,u.j)("esri.views.3d.webgl-engine.lib.SSAO")],le);const ce=.5;function de(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new o.A("ssaoTex",((e,t)=>t.ssao?.colorTexture))),r.constants.add("blurSizePixelsInverse","float",1/se),r.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
624
624
|
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
625
625
|
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
626
626
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4865,5732],{92835:(e,t,r)=>{r.d(t,{Z:()=>m});var o,s=r(43697),l=r(96674),i=r(35463),n=r(5600),a=(r(75215),r(67676),r(80442),r(71715)),u=r(52011),h=r(30556);let p=o=class extends l.wq{static get allTime(){return c}static get empty(){return d}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(o.allTime)}get isEmpty(){return this.equals(o.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new o({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,o=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===o&&r===s}expandTo(e,t="system"){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,i.JE)(r,e,t));let s=this.end;if(s){const r=(0,i.JE)(s,e,t);s=s.getTime()===r.getTime()?r:(0,i.Nm)(r,1,e,t)}return new o({start:r,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return o.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,l=e.end?.getTime()??1/0;let i,n;if(s>=t&&s<=r?i=s:t>=s&&t<=l&&(i=t),r>=s&&r<=l?n=r:l>=t&&l<=r&&(n=l),null!=i&&null!=n&&!isNaN(i)&&!isNaN(n)){const e=new o;return e.start=i===-1/0?null:new Date(i),e.end=n===1/0?null:new Date(n),e}return o.empty}offset(e,t,r="system"){if(this.isEmpty||this.isAllTime)return this.clone();const s=new o,{start:l,end:n}=this;return null!=l&&(s.start=(0,i.Nm)(l,e,t,r)),null!=n&&(s.end=(0,i.Nm)(n,e,t,r)),s}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return c.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new o({start:t,end:r})}};(0,s._)([(0,n.Cb)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,s._)([(0,a.r)("end")],p.prototype,"readEnd",null),(0,s._)([(0,h.c)("end")],p.prototype,"writeEnd",null),(0,s._)([(0,n.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,s._)([(0,n.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,s._)([(0,n.Cb)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,s._)([(0,a.r)("start")],p.prototype,"readStart",null),(0,s._)([(0,h.c)("start")],p.prototype,"writeStart",null),p=o=(0,s._)([(0,u.j)("esri.TimeExtent")],p);const c=new p,d=new p({start:void 0,end:void 0}),m=p},5732:(e,t,r)=>{r.d(t,{c:()=>o,g:()=>s});var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},25929:(e,t,r)=>{r.d(t,{M:()=>m,a:()=>f,e:()=>c,f:()=>s,i:()=>h,p:()=>p,r:()=>i,t:()=>l,w:()=>n});var o=r(17452);function s(e,t){const r=t&&t.url&&t.url.path;if(e&&r&&(e=(0,o.hF)(e,r,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const r=(0,o.PF)(e,t.portalItem.itemUrl);null!=r&&u.test(r)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(r).path)}return d(e,t&&t.portal)}function l(e,t,r=m.YES){if(null==e)return e;!(0,o.YP)(e)&&t&&t.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let s=(0,o.hF)(e);if(t){const r=t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.rootPath||t.url&&t.url.path;if(r){const l=d(r,t.portal),i=d(s,t.portal);s=(0,o.PF)(i,l,l),null!=s&&s!==i&&s!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(s)}}return s=c(s,t?.portal),(0,o.YP)(s)&&(s=(0,o.Fv)(s)),t?.resources&&t?.portalItem&&!(0,o.YP)(s)&&!(0,o.HK)(s)&&r===m.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(s),compress:!1}),s}function i(e,t,r){return s(e,r)}function n(e,t,r,o){const s=l(e,o);void 0!==s&&(t[r]=s)}const a=/\/items\/([^\/]+)\/resources\/(.*)/,u=/^\.\/resources\//;function h(e){const t=e?.match(a)??null;return t?.[1]??null}function p(e){const t=e?.match(a)??null;if(null==t)return null;const r=t[2],s=r.lastIndexOf("/");if(-1===s){const{path:e,extension:t}=(0,o.fZ)(r);return{prefix:null,filename:e,extension:t}}const{path:l,extension:i}=(0,o.fZ)(r.slice(s+1));return{prefix:r.slice(0,s),filename:l,extension:i}}function c(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?(0,o.Ie)(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function d(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const r=`${t.urlKey}.${t.customBaseUrl}`,s=(0,o.TI)();return(0,o.D6)(s,`${s.scheme}://${r}`)?(0,o.Ie)(e,t.portalHostname,r):(0,o.Ie)(e,r,t.portalHostname)}var m,y;(y=m||(m={}))[y.YES=0]="YES",y[y.NO=1]="NO";const f=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return m},ensureMainOnlineDomain:c,fromJSON:s,itemIdFromResourceUrl:h,prefixAndFilenameFromResourceUrl:p,read:i,toJSON:l,write:n},Symbol.toStringTag,{value:"Module"}))},10699:(e,t,r)=>{r.d(t,{IG:()=>i,iv:()=>n});var o=r(43697),s=r(52011);let l=0;const i=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+l++})}};return t=(0,o._)([(0,s.j)("esri.core.Identifiable")],t),t},n=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:l++})}};return t=(0,o._)([(0,s.j)("esri.core.NumericIdentifiable")],t),t};let a=class extends(i(class{})){};a=(0,o._)([(0,s.j)("esri.core.Identifiable")],a)},35463:(e,t,r)=>{r.d(t,{JE:()=>n,Nm:()=>i,rJ:()=>a});var o=r(90344),s=r(17126);const l={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function i(e,t,r,l="system"){const i=new s.vF((0,o.f1)(l)),n=s.ou.fromJSDate(e,{zone:i}),a="decades"===r||"centuries"===r?"year":u(r);return"decades"===r&&(t*=10),"centuries"===r&&(t*=100),n.plus({[a]:t}).toJSDate()}function n(e,t,r="system"){const l=new s.vF((0,o.f1)(r)),i=s.ou.fromJSDate(e,{zone:l});if("decades"===t||"centuries"===t){const e=i.startOf("year"),{year:r}=e,o=r-r%("decades"===t?10:100);return e.set({year:o}).toJSDate()}const n=u(t);return i.startOf(n).toJSDate()}function a(e,t,r){return 0===e?0:e*l[t]/l[r]}function u(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}},90344:(e,t,r)=>{r.d(t,{LJ:()=>Z,Xr:()=>g,Ze:()=>_,f1:()=>D,i$:()=>C,o8:()=>I,p6:()=>T});var o=r(35454),s=r(70171),l=r(17126);const i={year:void 0,month:void 0,day:void 0,weekday:void 0},n={hour:void 0,minute:void 0,second:void 0},a=Intl.DateTimeFormat().resolvedOptions().timeZone,u={timeZone:"UTC"},h={year:"numeric",month:"numeric",day:"numeric"},p={year:"numeric",month:"long",day:"numeric"},c={year:"numeric",month:"short",day:"numeric"},d={year:"numeric",month:"long",weekday:"long",day:"numeric"},m={hour:"numeric",minute:"numeric"},y={...m,second:"numeric"},f={"short-date":h,"short-date-short-time":{...h,...m},"short-date-short-time-24":{...h,...m,hour12:!1},"short-date-long-time":{...h,...y},"short-date-long-time-24":{...h,...y,hour12:!1},"short-date-le":h,"short-date-le-short-time":{...h,...m},"short-date-le-short-time-24":{...h,...m,hour12:!1},"short-date-le-long-time":{...h,...y},"short-date-le-long-time-24":{...h,...y,hour12:!1},"long-month-day-year":p,"long-month-day-year-short-time":{...p,...m},"long-month-day-year-short-time-24":{...p,...m,hour12:!1},"long-month-day-year-long-time":{...p,...y},"long-month-day-year-long-time-24":{...p,...y,hour12:!1},"day-short-month-year":c,"day-short-month-year-short-time":{...c,...m},"day-short-month-year-short-time-24":{...c,...m,hour12:!1},"day-short-month-year-long-time":{...c,...y},"day-short-month-year-long-time-24":{...c,...y,hour12:!1},"long-date":d,"long-date-short-time":{...d,...m},"long-date-short-time-24":{...d,...m,hour12:!1},"long-date-long-time":{...d,...y},"long-date-long-time-24":{...d,...y,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":m,"long-time":y},g=(0,o.w)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),v={ar:"ar-u-nu-latn-ca-gregory"};let w=new WeakMap;const b=f["short-date-short-time"];function _(e){return f[e]}function T(e,t=b){return function(e){let t=w.get(e);if(!t){const r=(0,s.Kd)(),o=v[r]||r,l=S(e);t=new Intl.DateTimeFormat(o,l),w.set(e,t)}return t}(t).format(e)}function I(e,t=b){return T(new Date(e),{...t,...u,...n})}function Z(e,t=b){return T(new Date(`1970-01-01T${e}Z`),{...t,...u,...i})}function C(e,t=b){const r=l.ou.fromISO(e,{setZone:!0}),o=(0,s.Kd)(),i=v[o]??o,n=S(t);return r.toLocaleString(n,{locale:i})}function S(e){const t=D(e.timeZone??"system");return{...e,timeZone:t}}function D(e){switch(e){case"system":return a;case"unknown":return"UTC";default:return e}}(0,s.Ze)((()=>{w=new WeakMap}))},87085:(e,t,r)=>{r.d(t,{Z:()=>w});var o=r(43697),s=(r(66577),r(3172)),l=r(20102),i=r(32448),n=r(10699),a=r(83379),u=r(92604),h=r(95330),p=r(17452),c=r(5600),d=(r(75215),r(67676),r(80442),r(52011)),m=r(68773),y=r(6570),f=r(82971);let g=0,v=class extends(i.Z.EventedMixin((0,n.IG)(a.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y.Z(-180,-90,180,90,f.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=f.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(3529).then(r.bind(r,63529))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:o}=await r.e(8008).then(r.bind(r,28008));try{return await o(t)}catch(e){const r=t&&t.portalItem,o=r&&r.id||"unset",s=r&&r.portal&&r.portal.url||m.default.portalUrl;throw u.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+o+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,h.D_)(e)||u.Z.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,p.mN)(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.Z)(e,{query:{f:"json"},responseType:"json"})).data;throw new l.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,o._)([(0,c.Cb)({type:String})],v.prototype,"attributionDataUrl",void 0),(0,o._)([(0,c.Cb)({type:y.Z})],v.prototype,"fullExtent",void 0),(0,o._)([(0,c.Cb)({readOnly:!0})],v.prototype,"hasAttributionData",null),(0,o._)([(0,c.Cb)({type:String,clonable:!1})],v.prototype,"id",void 0),(0,o._)([(0,c.Cb)({type:Boolean,nonNullable:!0})],v.prototype,"legendEnabled",void 0),(0,o._)([(0,c.Cb)({type:["show","hide","hide-children"]})],v.prototype,"listMode",void 0),(0,o._)([(0,c.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],v.prototype,"opacity",void 0),(0,o._)([(0,c.Cb)({clonable:!1})],v.prototype,"parent",void 0),(0,o._)([(0,c.Cb)({readOnly:!0})],v.prototype,"parsedUrl",null),(0,o._)([(0,c.Cb)({type:Boolean})],v.prototype,"popupEnabled",void 0),(0,o._)([(0,c.Cb)({type:Boolean})],v.prototype,"attributionVisible",void 0),(0,o._)([(0,c.Cb)({type:f.Z})],v.prototype,"spatialReference",void 0),(0,o._)([(0,c.Cb)({type:String})],v.prototype,"title",void 0),(0,o._)([(0,c.Cb)({readOnly:!0,json:{read:!1}})],v.prototype,"type",void 0),(0,o._)([(0,c.Cb)()],v.prototype,"url",void 0),(0,o._)([(0,c.Cb)({type:Boolean,nonNullable:!0})],v.prototype,"visible",void 0),v=(0,o._)([(0,d.j)("esri.layers.Layer")],v);const w=v},16199:(e,t,r)=>{r.r(t),r.d(t,{default:()=>P});var o,s=r(43697),l=(r(66577),r(3172)),i=r(20102),n=r(16453),a=r(19153),u=r(17452),h=r(5600),p=(r(75215),r(67676),r(80442),r(71715)),c=r(52011),d=r(30556),m=r(87085),y=r(71612),f=r(38009),g=r(16859),v=r(34760),w=r(72965),b=r(90082),_=r(39450),T=r(11145),I=r(5833),Z=r(6570),C=r(82971),S=r(94139);let D=o=class extends((0,y.h)((0,v.Q)((0,w.M)((0,f.q)((0,g.I)((0,n.R)(m.Z))))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new Z.Z(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,C.Z.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=C.Z.WebMercator,this.subDomains=null,this.tileInfo=new T.Z({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new S.Z({x:-20037508.342787,y:20037508.342787,spatialReference:C.Z.WebMercator}),spatialReference:C.Z.WebMercator,lods:[new _.Z({level:0,scale:591657527.591555,resolution:156543.033928}),new _.Z({level:1,scale:295828763.795777,resolution:78271.5169639999}),new _.Z({level:2,scale:147914381.897889,resolution:39135.7584820001}),new _.Z({level:3,scale:73957190.948944,resolution:19567.8792409999}),new _.Z({level:4,scale:36978595.474472,resolution:9783.93962049996}),new _.Z({level:5,scale:18489297.737236,resolution:4891.96981024998}),new _.Z({level:6,scale:9244648.868618,resolution:2445.98490512499}),new _.Z({level:7,scale:4622324.434309,resolution:1222.99245256249}),new _.Z({level:8,scale:2311162.217155,resolution:611.49622628138}),new _.Z({level:9,scale:1155581.108577,resolution:305.748113140558}),new _.Z({level:10,scale:577790.554289,resolution:152.874056570411}),new _.Z({level:11,scale:288895.277144,resolution:76.4370282850732}),new _.Z({level:12,scale:144447.638572,resolution:38.2185141425366}),new _.Z({level:13,scale:72223.819286,resolution:19.1092570712683}),new _.Z({level:14,scale:36111.909643,resolution:9.55462853563415}),new _.Z({level:15,scale:18055.954822,resolution:4.77731426794937}),new _.Z({level:16,scale:9027.977411,resolution:2.38865713397468}),new _.Z({level:17,scale:4513.988705,resolution:1.19432856685505}),new _.Z({level:18,scale:2256.994353,resolution:.597164283559817}),new _.Z({level:19,scale:1128.497176,resolution:.298582141647617}),new _.Z({level:20,scale:564.248588,resolution:.14929107082380833}),new _.Z({level:21,scale:282.124294,resolution:.07464553541190416}),new _.Z({level:22,scale:141.062147,resolution:.03732276770595208}),new _.Z({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return"string"==typeof e?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then((()=>{let e="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const t=new u.R9(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&t.authority?.includes("{subDomain}")&&(e="is missing 'subDomains' property")}else e="spatialReference must match tileInfo.spatialReference";else e="is missing the required 'urlTemplate' property value";if(e)throw new i.Z("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${e}`)}));return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||C.Z.fromJSON(t.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:r}=this,o=new u.R9(t),s=o.scheme?o.scheme+"://":"//",l=s+o.authority+"/",i=o.authority;if(i?.includes("{subDomain}")){if(r&&r.length>0&&i.split(".").length>1)for(const t of r)e.push(s+i.replaceAll(/\{subDomain\}/gi,t)+"/")}else e.push(l);return e.map(u.xs)}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new u.R9(e),r=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.substring(r.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){(0,u.oC)(e)&&(e="https:"+e),e&&(e=e.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),e=(0,u.Fv)(e)),t.templateUrl=e}fetchTile(e,t,r,o={}){const{signal:s}=o,i=this.getTileUrl(e,t,r),n={responseType:"image",signal:s,query:{...this.refreshParameters}};return(0,l.Z)(i,n).then((e=>e.data))}async fetchImageBitmapTile(e,t,r,s={}){const{signal:i}=s;if(this.fetchTile!==o.prototype.fetchTile){const o=await this.fetchTile(e,t,r,s);return(0,b.V)(o,e,t,r,i)}const n=this.getTileUrl(e,t,r),a={responseType:"blob",signal:i,query:{...this.refreshParameters}},{data:u}=await(0,l.Z)(n,a);return(0,b.V)(u,e,t,r,i)}getTileUrl(e,t,r){const{levelValues:o,tileServers:s,urlPath:l}=this;if(!o||!s||!l)return"";const i=o[e];return s[t%s.length]+(0,a.gx)(l,{level:i,z:i,col:r,x:r,row:t,y:t})}};(0,s._)([(0,h.Cb)({type:String,value:"",json:{write:!0}})],D.prototype,"copyright",void 0),(0,s._)([(0,h.Cb)({type:Z.Z,json:{write:!0},nonNullable:!0})],D.prototype,"fullExtent",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1,write:!1}})],D.prototype,"legendEnabled",void 0),(0,s._)([(0,h.Cb)({type:["show","hide"]})],D.prototype,"listMode",void 0),(0,s._)([(0,h.Cb)({json:{read:!0,write:!0}})],D.prototype,"blendMode",void 0),(0,s._)([(0,h.Cb)()],D.prototype,"levelValues",null),(0,s._)([(0,h.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],D.prototype,"isReference",void 0),(0,s._)([(0,h.Cb)({type:["WebTiledLayer"],value:"WebTiledLayer"})],D.prototype,"operationalLayerType",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1,write:!1}})],D.prototype,"popupEnabled",void 0),(0,s._)([(0,h.Cb)({type:C.Z})],D.prototype,"spatialReference",void 0),(0,s._)([(0,p.r)("spatialReference",["spatialReference","fullExtent.spatialReference"])],D.prototype,"readSpatialReference",null),(0,s._)([(0,h.Cb)({type:[String],json:{write:!0}})],D.prototype,"subDomains",void 0),(0,s._)([(0,h.Cb)({type:T.Z,json:{write:!0}})],D.prototype,"tileInfo",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],D.prototype,"tileServers",null),(0,s._)([(0,h.Cb)({json:{read:!1}})],D.prototype,"type",void 0),(0,s._)([(0,h.Cb)()],D.prototype,"urlPath",null),(0,s._)([(0,h.Cb)({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],D.prototype,"urlTemplate",void 0),(0,s._)([(0,p.r)("urlTemplate",["urlTemplate","templateUrl"])],D.prototype,"readUrlTemplate",null),(0,s._)([(0,d.c)("urlTemplate",{templateUrl:{type:String}})],D.prototype,"writeUrlTemplate",null),(0,s._)([(0,h.Cb)({type:I.B,json:{write:!0}})],D.prototype,"wmtsInfo",void 0),D=o=(0,s._)([(0,c.j)("esri.layers.WebTileLayer")],D);const P=D},16859:(e,t,r)=>{r.d(t,{I:()=>T});var o=r(43697),s=r(68773),l=r(40330),i=r(3172),n=r(66643),a=r(20102),u=r(92604),h=r(70586),p=r(95330),c=r(17452),d=r(5600),m=(r(75215),r(67676),r(80442),r(71715)),y=r(52011),f=r(30556),g=r(84230),v=r(48522),w=r(15235),b=r(86082),_=r(14661);const T=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,h.SC)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new w.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const{load:o}=await r.e(8062).then(r.bind(r,18062));return(0,p.k_)(t),await o({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,p.D_)(e)||u.Z.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async setUserPrivileges(e,t){if(!s.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:o},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",o),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,p.r9)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const o=e===r.id;if(o&&r.portal.user)return(0,_.Ss)(r);let s,i;if(o)s=r.portal.url;else try{s=await(0,g.oP)(this.url,t)}catch(e){(0,p.r9)(e)}if(!s||!(0,c.Zo)(s,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;i=await(l.id?.getCredential(`${s}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.r9)(e)}if(!i)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(o?await r.reload():(r=new w.default({id:e,portal:{url:s}}),await r.load(t)),r.portal.user)return(0,_.Ss)(r)}catch(e){(0,p.r9)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.r9)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?l.id?.findCredential(this.url):null;if(!t)return!0;const r=I.credential===t?I.user:await this._fetchEditingUser(e);return I.credential=t,I.user=r,null==r||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=l.id.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const o=`${r.owningSystemUrl}/sharing/rest`,s=v.Z.getDefault();if(s&&s.loaded&&(0,c.Fv)(s.restUrl)===(0,c.Fv)(o))return s.user;const a=`${o}/community/self`,u=null!=e?e.signal:null,h=await(0,n.q6)((0,i.Z)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return h.ok?b.Z.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,o=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||v.Z.getDefault());return r&&o&&!(0,c.tm)(o.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,o._)([(0,d.Cb)({type:w.default})],t.prototype,"portalItem",null),(0,o._)([(0,m.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,o._)([(0,f.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,o._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,o._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,o._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,o._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,o._)([(0,y.j)("esri.layers.mixins.PortalLayer")],t),t},I={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>g});var o=r(43697),s=r(92604),l=r(95330),i=r(5600),n=r(90578),a=(r(67676),r(80442),r(52011)),u=r(46791),h=(r(66643),r(20102),r(26258),r(87538));const p=new u.Z,c=new WeakMap;function d(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:d(t,e%t):0}let m=0,y=0;function f(){const e=Date.now();let t=!1;for(const r of p){const o=r.deref();o?o.refreshInterval&&e-(c.get(o)??0)+5>=6e4*o.refreshInterval&&(c.set(o,e),o.refresh(e)):t=!0}if(t)for(let e=p.length-1;e>=0;e--)p.at(e).deref()||p.removeAt(e)}(0,h.EH)((()=>{const e=Date.now();let t=0;for(const r of p){const o=r.deref();o&&(t=d(Math.round(6e4*o.refreshInterval),t),o.refreshInterval?c.get(o)||c.set(o,e):c.delete(o))}if(t!==y){if(y=t,clearInterval(m),0===y)return void(m=0);m=setInterval(f,y)}}));const g=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,l.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{this.destroyed||function(e){(function(e){return null!=e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e})(e)&&p.push(new WeakRef(e))}(this)}),(()=>{}))}destroy(){!function(e){const t=p.find((t=>t.deref()===e));t&&p.remove(t)}(this)}castRefreshInterval(e){return e>=.1?e:e<=0?0:.1}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,l.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{s.Z.getLogger(this).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}get test(){const e=this;return{set refreshInterval(t){e._set("refreshInterval",t)}}}};return(0,o._)([(0,i.Cb)({type:Number,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,o._)([(0,n.p)("refreshInterval")],t.prototype,"castRefreshInterval",null),(0,o._)([(0,i.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,o._)([(0,i.Cb)({readOnly:!0})],t.prototype,"refreshParameters",null),t=(0,o._)([(0,a.j)("esri.layers.mixins.RefreshableLayer")],t),t}},39450:(e,t,r)=>{r.d(t,{Z:()=>h});var o,s=r(43697),l=r(96674),i=r(5600),n=r(75215),a=(r(67676),r(80442),r(52011));let u=o=class extends l.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new o({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,s._)([(0,i.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"cols",void 0),(0,s._)([(0,i.Cb)({type:n.z8,json:{write:!0}})],u.prototype,"level",void 0),(0,s._)([(0,i.Cb)({type:String,json:{write:!0}})],u.prototype,"levelValue",void 0),(0,s._)([(0,i.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"origin",void 0),(0,s._)([(0,i.Cb)({type:Number,json:{write:!0}})],u.prototype,"resolution",void 0),(0,s._)([(0,i.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"rows",void 0),(0,s._)([(0,i.Cb)({type:Number,json:{write:!0}})],u.prototype,"scale",void 0),u=o=(0,s._)([(0,a.j)("esri.layers.support.LOD")],u);const h=u},11145:(e,t,r)=>{r.d(t,{Z:()=>Z});var o,s=r(43697),l=r(35454),i=r(96674),n=r(67900),a=r(5600),u=r(75215),h=(r(67676),r(80442),r(71715)),p=r(52011),c=r(30556),d=r(94139),m=r(82971),y=r(24470),f=r(8744),g=r(40488),v=r(39450),w=r(43077);const b=new l.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let _=o=class extends i.wq{static create(e={}){const{resolutionFactor:t=1,scales:r,size:s=256,spatialReference:l=m.Z.WebMercator,numLODs:i=24}=e;if(!(0,f.JY)(l)){const e=[];if(r)for(let t=0;t<r.length;t++){const o=r[t];e.push(new v.Z({level:t,scale:o,resolution:o}))}else{let t=5e-4;for(let r=i-1;r>=0;r--)e.unshift(new v.Z({level:r,scale:t,resolution:t})),t*=2}return new o({dpi:96,lods:e,origin:new d.Z(0,0,l),size:[s,s],spatialReference:l})}const a=(0,f.C5)(l),u=e.origin?new d.Z({x:e.origin.x,y:e.origin.y,spatialReference:l}):new d.Z(a?{x:a.origin[0],y:a.origin[1],spatialReference:l}:{x:0,y:0,spatialReference:l}),h=1/(39.37*(0,n.c9)(l)*96),p=[];if(r)for(let e=0;e<r.length;e++){const t=r[e],o=t*h;p.push(new v.Z({level:e,scale:t,resolution:o}))}else{let e=(0,f.sT)(l)?512/s*591657527.5917094:256/s*591657527.591555;const r=Math.ceil(i/t);p.push(new v.Z({level:0,scale:e,resolution:e*h}));for(let o=1;o<r;o++){const r=e/2**t,s=r*h;p.push(new v.Z({level:o,scale:r,resolution:s})),e=r}}return new o({dpi:96,lods:p,origin:u,size:[s,s],spatialReference:l})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const r=(0,f.C5)(e);return e.isWrappable&&!!r&&Math.abs(r.origin[0]-t.x)<=r.dx}return!1}readOrigin(e,t){return d.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,r=0;const o=[],s=this._levelToLOD={};e&&(t=-1/0,r=1/0,e.forEach((e=>{o.push(e.scale),t=e.scale>t?e.scale:t,r=e.scale<r?e.scale:r,s[e.level]=e}))),this._set("scales",o),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const r=Math.floor(e),o=r+1;return t[r]/(t[r]/t[o])**(e-r)}scaleToZoom(e){const t=this.scales,r=t.length-1;let o=0;for(;o<r;o++){const r=t[o],s=t[o+1];if(r<=e)return o;if(s===e)return o+1;if(r>e&&s<e)return o+Math.log(r/e)/Math.log(r/s)}return o}snapScale(e,t=.95){const r=this.scaleToZoom(e);return r%Math.floor(r)>=t?this.zoomToScale(Math.ceil(r)):this.zoomToScale(Math.floor(r))}tileAt(e,t,r,o){const s=this.lodAt(e);if(!s)return null;let l,i;if("number"==typeof t)l=t,i=r;else if((0,f.fS)(t.spatialReference,this.spatialReference))l=t.x,i=t.y,o=r;else{const e=(0,g.iV)(t,this.spatialReference);if(null==e)return null;l=e.x,i=e.y,o=r}const n=s.resolution*this.size[0],a=s.resolution*this.size[1];return o||(o=new w.f(null,0,0,0,(0,y.Ue)())),o.level=e,o.row=Math.floor((this.origin.y-i)/a+.001),o.col=Math.floor((l-this.origin.x)/n+.001),this.updateTileInfo(o),o}updateTileInfo(e,t=o.ExtrapolateOptions.NONE){let r=this.lodAt(e.level);if(!r&&t===o.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(r=t)}if(!r)return;const s=e.level-r.level,l=r.resolution*this.size[0]/2**s,i=r.resolution*this.size[1]/2**s;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,y.Ue)()),e.extent[0]=this.origin.x+e.col*l,e.extent[1]=this.origin.y-(e.row+1)*i,e.extent[2]=e.extent[0]+l,e.extent[3]=e.extent[1]+i}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const r=this.lodAt(t.level);if(null==r)return null;const{resolution:o}=r,s=o*this.size[0],l=o*this.size[1];return e[0]=this.origin.x+t.col*s,e[1]=this.origin.y-(t.row+1)*l,e[2]=e[0]+s,e[3]=e[1]+l,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return o.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const r=[],s=this.lods.length;for(let e=0;e<s;e++){const o=this.lods[e],s=o.resolution*t;r.push(new v.Z({level:o.level,scale:o.scale,resolution:s}))}return new o({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:r})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let r=0;r<e.length;r++){const o=e[r];this._upsampleLevels[o.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/o.resolution:0},t=o}}};var T,I;(0,s._)([(0,a.Cb)({type:Number,json:{write:!0}})],_.prototype,"compressionQuality",void 0),(0,s._)([(0,a.Cb)({type:Number,json:{write:!0}})],_.prototype,"dpi",void 0),(0,s._)([(0,a.Cb)({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],_.prototype,"format",void 0),(0,s._)([(0,a.Cb)({readOnly:!0})],_.prototype,"isWrappable",null),(0,s._)([(0,a.Cb)({type:d.Z,json:{write:!0}})],_.prototype,"origin",void 0),(0,s._)([(0,h.r)("origin")],_.prototype,"readOrigin",null),(0,s._)([(0,a.Cb)({type:[v.Z],value:null,json:{write:!0}})],_.prototype,"lods",null),(0,s._)([(0,a.Cb)({readOnly:!0})],_.prototype,"scales",void 0),(0,s._)([(0,a.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],_.prototype,"size",void 0),(0,s._)([(0,h.r)("size",["rows","cols"])],_.prototype,"readSize",null),(0,s._)([(0,c.c)("size",{cols:{type:u.z8},rows:{type:u.z8}})],_.prototype,"writeSize",null),(0,s._)([(0,a.Cb)({type:m.Z,json:{write:!0}})],_.prototype,"spatialReference",void 0),_=o=(0,s._)([(0,p.j)("esri.layers.support.TileInfo")],_),(I=(T=_||(_={})).ExtrapolateOptions||(T.ExtrapolateOptions={}))[I.NONE=0]="NONE",I[I.POWER_OF_TWO=1]="POWER_OF_TWO";const Z=_},43077:(e,t,r)=>{r.d(t,{f:()=>o});class o{constructor(e,t,r,o,s=void 0){this.id=e,this.level=t,this.row=r,this.col=o,this.extent=s}}},5833:(e,t,r)=>{r.d(t,{B:()=>u});var o,s=r(43697),l=r(96674),i=r(22974),n=r(5600),a=(r(75215),r(52011));let u=o=class extends l.wq{constructor(e){super(e)}clone(){return new o({customLayerParameters:(0,i.d9)(this.customLayerParameters),customParameters:(0,i.d9)(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};(0,s._)([(0,n.Cb)({json:{type:Object,write:!0}})],u.prototype,"customLayerParameters",void 0),(0,s._)([(0,n.Cb)({json:{type:Object,write:!0}})],u.prototype,"customParameters",void 0),(0,s._)([(0,n.Cb)({type:String,json:{write:!0}})],u.prototype,"layerIdentifier",void 0),(0,s._)([(0,n.Cb)({type:String,json:{write:!0}})],u.prototype,"tileMatrixSet",void 0),(0,s._)([(0,n.Cb)({type:String,json:{write:!0}})],u.prototype,"url",void 0),u=o=(0,s._)([(0,a.j)("esri.layer.support.WMTSLayerInfo")],u)},90082:(e,t,r)=>{r.d(t,{V:()=>i,g:()=>l});var o=r(20102),s=r(95330);async function l(e,t,r){let l;try{l=await createImageBitmap(e)}catch(e){throw new o.Z("request:server",`Unable to load ${t}`,{url:t,error:e})}return(0,s.k_)(r),l}async function i(e,t,r,l,i){let n;try{n=await createImageBitmap(e)}catch(e){throw new o.Z("request:server",`Unable to load tile ${t}/${r}/${l}`,{error:e,level:t,row:r,col:l})}return(0,s.k_)(i),n}}}]);
|