@arcgis/core 5.2.0-next.36 → 5.2.0-next.38
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/02b043a3c5fa8bcb4c5b.js +1 -0
- package/assets/esri/core/workers/chunks/{acbc14395c31f6da509e.js → 03437a8ef35c200dbf17.js} +1 -1
- package/assets/esri/core/workers/chunks/034dd8ee5152a12412cd.js +1 -0
- package/assets/esri/core/workers/chunks/{29542a3d7f3fa8d42380.js → 0603cbd938ab619c706b.js} +1 -1
- package/assets/esri/core/workers/chunks/0a6e03263ab0906d8bcf.js +1 -0
- package/assets/esri/core/workers/chunks/0edd250159ec259601b3.js +1 -0
- package/assets/esri/core/workers/chunks/{401ee7fa500adad77db1.js → 1079914101d69a40b3eb.js} +1 -1
- package/assets/esri/core/workers/chunks/{c72121076e438ed28d60.js → 1599dc5309a4e60017ce.js} +2 -2
- package/assets/esri/core/workers/chunks/181e98399732f425305d.js +1 -0
- package/assets/esri/core/workers/chunks/{47d88e1b003c4519b7b6.js → 18f4b2099299942aaf97.js} +1 -1
- package/assets/esri/core/workers/chunks/196e7515a43bd0026f49.js +1 -0
- package/assets/esri/core/workers/chunks/1aa7496a7dc95aae11ac.js +1 -0
- package/assets/esri/core/workers/chunks/{c2a02c33462bcdabd39d.js → 1c263ffb7144e171a64f.js} +1 -1
- package/assets/esri/core/workers/chunks/1d524690c4b66289bd20.js +1 -0
- package/assets/esri/core/workers/chunks/{f72f38e7609756a7f8ea.js → 20fa2c3d4360afa5e136.js} +1 -1
- package/assets/esri/core/workers/chunks/{03350a56f840cffe5459.js → 2757c4bf0280e27f3484.js} +1 -1
- package/assets/esri/core/workers/chunks/{93ceb74ac88ef460fe5f.js → 278409028bc5af45b507.js} +1 -1
- package/assets/esri/core/workers/chunks/{afaf6874a645854c3357.js → 294537e1ac43e8dfeaea.js} +1 -1
- package/assets/esri/core/workers/chunks/{2c61bb25578f73ba49bc.js → 29a1d0659bbc5a039864.js} +1 -1
- package/assets/esri/core/workers/chunks/29df3f829006719b2680.js +1 -0
- package/assets/esri/core/workers/chunks/{2c00f89030c7a4201033.js → 2a344bca6837ca3b5c41.js} +2 -2
- package/assets/esri/core/workers/chunks/30cf84a47ebefd180bb7.js +1 -0
- package/assets/esri/core/workers/chunks/{71a593fa116770e58832.js → 37a95f097533bad1b338.js} +1 -1
- package/assets/esri/core/workers/chunks/{7335a762412bc8c15a2f.js → 37e823202424c11076cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee446250a40e5d89bb5a.js → 3a76fffa2016c16d7989.js} +3 -3
- package/assets/esri/core/workers/chunks/{58ce4bcfb15f378b1b9f.js → 3d6d2b42ba2ad7086d5d.js} +1 -1
- package/assets/esri/core/workers/chunks/3ec91474658eae87b832.js +1 -0
- package/assets/esri/core/workers/chunks/448e0596005cba9a4225.js +1 -0
- package/assets/esri/core/workers/chunks/{f148666308071bdb185a.js → 45530a49fa1f09d1682e.js} +1 -1
- package/assets/esri/core/workers/chunks/{155940ef3d1888272d73.js → 459e89d1b94a3b204d20.js} +2 -2
- package/assets/esri/core/workers/chunks/{f71f5778e03f68f27482.js → 45b2e58051f42ebd236e.js} +1 -1
- package/assets/esri/core/workers/chunks/4611cf051c3c396fdf96.js +1 -0
- package/assets/esri/core/workers/chunks/{efaa1d05705f6b450e8f.js → 46e3d33e44e5398221e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{866950e9ab96aebc6b32.js → 4a8201e09bc3ad5cc00b.js} +1 -1
- package/assets/esri/core/workers/chunks/{110135b0562a3b5708b9.js → 4abe820bbe4f7ffccc09.js} +1 -1
- package/assets/esri/core/workers/chunks/4ad86d6b1be07c97b6f6.js +1 -0
- package/assets/esri/core/workers/chunks/{20ffeb09bb30400de110.js → 4e28f49d0be20ea50fd7.js} +1 -1
- package/assets/esri/core/workers/chunks/4f25aac84d9eb10cac83.js +1 -0
- package/assets/esri/core/workers/chunks/{0197e459fdb04dfb28ef.js → 51838d55d8ec4ce70398.js} +1 -1
- package/assets/esri/core/workers/chunks/542d8a6c415098b9857c.js +1 -0
- package/assets/esri/core/workers/chunks/57abf838fcff0f0e2c5e.js +1 -0
- package/assets/esri/core/workers/chunks/57dd017fed2943d24e3d.js +1 -0
- package/assets/esri/core/workers/chunks/59801b2ccaaf4b394e02.js +1 -0
- package/assets/esri/core/workers/chunks/{add79af151e3eb560599.js → 5a2d2dcdfa8d958f277d.js} +1 -1
- package/assets/esri/core/workers/chunks/5a62c9f64db4fcae5e52.js +1 -0
- package/assets/esri/core/workers/chunks/{e84c13ac59e5381b77e2.js → 5aebecb5c2b3e7887127.js} +1 -1
- package/assets/esri/core/workers/chunks/{c19fe4f31e4ef84bbcf6.js → 5e68b74fd548c7cdba36.js} +1 -1
- package/assets/esri/core/workers/chunks/{9dcb2cbf89dcb7558432.js → 5f360492560ae07083a6.js} +1 -1
- package/assets/esri/core/workers/chunks/6022f43ebd58e21c737a.js +1 -0
- package/assets/esri/core/workers/chunks/62b137a795e487fa06a1.js +1 -0
- package/assets/esri/core/workers/chunks/{007485862ce95928717a.js → 632de34ebd2f44b4423d.js} +1 -1
- package/assets/esri/core/workers/chunks/{1ad5fcae6d6a9801cf58.js → 63ca17f569407c89bde1.js} +2 -2
- package/assets/esri/core/workers/chunks/6896a6dd36fa91a27151.js +1 -0
- package/assets/esri/core/workers/chunks/{e6263e1983e703befe48.js → 68bc674affe2f7269c40.js} +1 -1
- package/assets/esri/core/workers/chunks/{759686b896f51f0fe6a9.js → 6a51499c6623ddce5f00.js} +1 -1
- package/assets/esri/core/workers/chunks/6cdf1db30793133294dd.js +1 -0
- package/assets/esri/core/workers/chunks/{b0e4af49fc968b0a910f.js → 6ff6783f89ecd3a5e752.js} +1 -1
- package/assets/esri/core/workers/chunks/{857532de88f21e8c3466.js → 70763c7b68d8abe8d5fe.js} +1 -1
- package/assets/esri/core/workers/chunks/{e67a9f9298d63026e7f6.js → 716b1f073e3cd807abd3.js} +1 -1
- package/assets/esri/core/workers/chunks/71a3f05cb86ae2920f8d.js +1 -0
- package/assets/esri/core/workers/chunks/723bb56de2324b41df4e.js +1 -0
- package/assets/esri/core/workers/chunks/73f61107cb7e6d30bf03.js +1 -0
- package/assets/esri/core/workers/chunks/752c34cee981862add89.js +1 -0
- package/assets/esri/core/workers/chunks/760dfd585b6c2c1937ce.js +1 -0
- package/assets/esri/core/workers/chunks/{595401947e74a0a67144.js → 76449e50222111ba0eb1.js} +1 -1
- package/assets/esri/core/workers/chunks/76bed5497f42f23a27ed.js +1 -0
- package/assets/esri/core/workers/chunks/832ecc1f7d45774c4726.js +1 -0
- package/assets/esri/core/workers/chunks/860a0f9d20f53db1caf4.js +1 -0
- package/assets/esri/core/workers/chunks/867e39bb444947c93586.js +1 -0
- package/assets/esri/core/workers/chunks/{4f08b69f4a33a114c5f7.js → 8a66a3e8391206f7d8aa.js} +1 -1
- package/assets/esri/core/workers/chunks/8a8b7ac6693bdfbebf07.js +1 -0
- package/assets/esri/core/workers/chunks/{cda2bae39135e5519d8c.js → 8e80441eddef1b5be8b9.js} +1 -1
- package/assets/esri/core/workers/chunks/8fce15ce4cfdccf407f3.js +1 -0
- package/assets/esri/core/workers/chunks/{5260f623438bd84f2caa.js → 937cf55b3b9d324eea73.js} +1 -1
- package/assets/esri/core/workers/chunks/93df864c2e829f0fd5ce.js +1 -0
- package/assets/esri/core/workers/chunks/{7b5e628ea3d4a51f1c4e.js → 966d002acec8c72be56a.js} +1 -1
- package/assets/esri/core/workers/chunks/{367a3031abbeff0c0090.js → 9aef0b87f471626abd66.js} +1 -1
- package/assets/esri/core/workers/chunks/{f1d211904d5a1de93cb3.js → 9ba9a3705623679bc305.js} +1 -1
- package/assets/esri/core/workers/chunks/{aec82b94787821153d2b.js → a188d0767825d322f96d.js} +1 -1
- package/assets/esri/core/workers/chunks/a638de0102c3990403d1.js +1 -0
- package/assets/esri/core/workers/chunks/{828b64624c76156a6416.js → a6bda5f17fb1c03f7e4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{050aba7089318e1c7d53.js → b022debf9e0bc2bff0e2.js} +1 -1
- package/assets/esri/core/workers/chunks/b09935d0105d50a0971b.js +1 -0
- package/assets/esri/core/workers/chunks/b12fc1b5a9da97346684.js +1 -0
- package/assets/esri/core/workers/chunks/b2c0262c4a76b8a86200.js +1 -0
- package/assets/esri/core/workers/chunks/{599bd80379423c99799d.js → b4323e69e624c6b51754.js} +1 -1
- package/assets/esri/core/workers/chunks/b5141f240ca79729686d.js +1 -0
- package/assets/esri/core/workers/chunks/b549a4d4b1a34bee8beb.js +1 -0
- package/assets/esri/core/workers/chunks/bb89b6fd93513c61b2d3.js +1 -0
- package/assets/esri/core/workers/chunks/{3bd32387af52fa48d747.js → bc553ecc8cbcc1b02717.js} +1 -1
- package/assets/esri/core/workers/chunks/bcba02f61cf0abcb5600.js +1 -0
- package/assets/esri/core/workers/chunks/{f63e7b01c70352538b1e.js → bd0f488e228a75fbefb3.js} +2 -2
- package/assets/esri/core/workers/chunks/c48dfda8dcb9551606fb.js +1 -0
- package/assets/esri/core/workers/chunks/c4e44fde4bc4ff89e2bc.js +1 -0
- package/assets/esri/core/workers/chunks/c93a68618674b38b932e.js +1 -0
- package/assets/esri/core/workers/chunks/d2745886ba5a86fd5c4c.js +680 -0
- package/assets/esri/core/workers/chunks/d4c341b15d9244276fb9.js +1 -0
- package/assets/esri/core/workers/chunks/d5faab9799891e5da5a8.js +1 -0
- package/assets/esri/core/workers/chunks/d811924acc9c0be95bba.js +1 -0
- package/assets/esri/core/workers/chunks/{4b96aa2dc5b88846bb53.js → e0a4d0288abd334b0673.js} +1 -1
- package/assets/esri/core/workers/chunks/{b22a1c98271c2e4d8808.js → e1ddb8e4977b317fd40c.js} +1 -1
- package/assets/esri/core/workers/chunks/e961c6140c39921816a8.js +1 -0
- package/assets/esri/core/workers/chunks/eb7daa0f6610983ff8db.js +1 -0
- package/assets/esri/core/workers/chunks/eb842cf470ce28a73187.js +1 -0
- package/assets/esri/core/workers/chunks/ed1d4ebf487c7dcd5c33.js +1 -0
- package/assets/esri/core/workers/chunks/f80cadcc2a588da63b38.js +1 -0
- package/assets/esri/core/workers/chunks/f8bbb52b865a0a242140.js +1 -0
- package/assets/esri/core/workers/chunks/f9592bcdd9988199a7ea.js +1 -0
- package/assets/esri/core/workers/chunks/ff7e1eb2366d4301d288.js +1 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/chunks/NavigationDepth.glsl.js +18 -0
- package/chunks/Path.glsl.js +20 -16
- package/config.js +1 -1
- package/core/accessorSupport/diffUtils.js +1 -1
- package/geometry/FlatGeometry.js +1 -1
- package/geometry/support/Indices.js +1 -1
- package/geometry/support/ShortArray.js +1 -1
- package/geometry/support/UintArray.js +1 -1
- package/geometry/support/meshUtils/geographicUtils.js +1 -1
- package/kernel.js +1 -1
- package/layers/mixins/PublishableLayer.js +1 -1
- package/layers/mixins/RefreshableLayer.js +1 -1
- package/layers/raster/functions/pixelUtils.js +1 -1
- package/layers/support/kustoUtils.js +1 -1
- package/package.json +2 -2
- package/popup/Feature.js +1 -1
- package/portal/support/resourceUtils.js +1 -1
- package/renderers/support/rasterTypeUtils.js +1 -1
- package/rest/query/operations/pbfFeatureSetUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/tables/support/tablesUtils.js +1 -1
- package/views/2d/engine/flow/utils.js +1 -1
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/AlignedVertexSpec.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/layerAdapters/labelingUtils.js +1 -1
- package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
- package/views/2d/layers/support/annodime/utils.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/Lyr3DWasm.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/i3s/PointCloudRendererUtil.js +1 -1
- package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
- package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +32 -16
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/NavigationDepthCache.js +2 -0
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
- package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/NavigationDepth.glsl.js +2 -0
- package/views/3d/webgl-engine/shaders/NavigationDepthTechnique.js +2 -0
- package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/selectionUtils.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/VertexAttributeLayouts.js +1 -1
- package/webscene/spec-certification/utils.js +1 -1
- package/widgets/Editor/legacy/workflowUtils.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/errors.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
- package/widgets/OrientedImageryViewer/utils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/constants.js +1 -1
- package/widgets/PanoramicViewer/support/importUtils.js +1 -1
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/support/dateUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0a2f08298a3c932614f2.js +0 -1
- package/assets/esri/core/workers/chunks/0df978697328b6453c94.js +0 -1
- package/assets/esri/core/workers/chunks/168c15cf462f9abcbdd2.js +0 -1
- package/assets/esri/core/workers/chunks/22c447fcc9a28afeb6e3.js +0 -1
- package/assets/esri/core/workers/chunks/24aa98cb2021ddd789ce.js +0 -1
- package/assets/esri/core/workers/chunks/2509da565e5a2b43ac7f.js +0 -1
- package/assets/esri/core/workers/chunks/256cc116e3be4feee593.js +0 -1
- package/assets/esri/core/workers/chunks/2bb3494659609594c4ca.js +0 -1
- package/assets/esri/core/workers/chunks/2c017eae434254610c8e.js +0 -1
- package/assets/esri/core/workers/chunks/303e723e829ea7088d43.js +0 -1
- package/assets/esri/core/workers/chunks/368db1420b8520beae05.js +0 -1
- package/assets/esri/core/workers/chunks/38a6a7c56c592f336a12.js +0 -1
- package/assets/esri/core/workers/chunks/39ff5b2a05a90e1cb214.js +0 -1
- package/assets/esri/core/workers/chunks/3b914ca36e7e2b00cfe6.js +0 -1
- package/assets/esri/core/workers/chunks/3e8fa2a7a36881234479.js +0 -1
- package/assets/esri/core/workers/chunks/451331f69d21c61ec93b.js +0 -1
- package/assets/esri/core/workers/chunks/4656a4bf430d7eed1465.js +0 -1
- package/assets/esri/core/workers/chunks/472ec242cd3070e6acfe.js +0 -1
- package/assets/esri/core/workers/chunks/51d7145f748b4865de7f.js +0 -1
- package/assets/esri/core/workers/chunks/54f54623532f633dc0e2.js +0 -1
- package/assets/esri/core/workers/chunks/570a4725b2a4a19c5148.js +0 -1
- package/assets/esri/core/workers/chunks/586ca90e46f5cbdfeece.js +0 -1
- package/assets/esri/core/workers/chunks/59c22bab85f9cdbb9948.js +0 -1
- package/assets/esri/core/workers/chunks/5dfeefee96659832398a.js +0 -1
- package/assets/esri/core/workers/chunks/6c746ac4bd2e57b8cb41.js +0 -1
- package/assets/esri/core/workers/chunks/6d72a1bdc2664df62c4c.js +0 -1
- package/assets/esri/core/workers/chunks/7085b4c655a19694da04.js +0 -1
- package/assets/esri/core/workers/chunks/777b16b76db406c99c69.js +0 -1
- package/assets/esri/core/workers/chunks/818a481ce579f519de1c.js +0 -1
- package/assets/esri/core/workers/chunks/85a280ee915010a8da3c.js +0 -1
- package/assets/esri/core/workers/chunks/86731e276b31453bc235.js +0 -1
- package/assets/esri/core/workers/chunks/87b86375f8557418dbe6.js +0 -1
- package/assets/esri/core/workers/chunks/8817d25c7f4cf0e6c6bd.js +0 -1
- package/assets/esri/core/workers/chunks/8a9b2efa0603e9fa4e8b.js +0 -1
- package/assets/esri/core/workers/chunks/8aa5bbf9a9b09815725a.js +0 -1
- package/assets/esri/core/workers/chunks/8b68a69ab8fb1679e7b2.js +0 -1
- package/assets/esri/core/workers/chunks/98685bd149dee1d6dc99.js +0 -1
- package/assets/esri/core/workers/chunks/9de673a04c70bd47047e.js +0 -1
- package/assets/esri/core/workers/chunks/9de9cec5c644bc452294.js +0 -1
- package/assets/esri/core/workers/chunks/9fb0431b0628dcb53004.js +0 -680
- package/assets/esri/core/workers/chunks/a2a688dd2ed4565e01ff.js +0 -1
- package/assets/esri/core/workers/chunks/a3ae7c41832c7a8b0570.js +0 -1
- package/assets/esri/core/workers/chunks/a3e86830460e52706a4d.js +0 -1
- package/assets/esri/core/workers/chunks/a58b8903ae17acf117d6.js +0 -1
- package/assets/esri/core/workers/chunks/a99ce2f12c8204ee542a.js +0 -1
- package/assets/esri/core/workers/chunks/ab3d1c00ef514b61ce0b.js +0 -1
- package/assets/esri/core/workers/chunks/ae5363956b4467208e04.js +0 -1
- package/assets/esri/core/workers/chunks/b24b7411a73d1da87c30.js +0 -1
- package/assets/esri/core/workers/chunks/b97b83159fec34f383af.js +0 -1
- package/assets/esri/core/workers/chunks/bec660ee2e7828f965e2.js +0 -1
- package/assets/esri/core/workers/chunks/c7316fd2bdb7ac9eada3.js +0 -1
- package/assets/esri/core/workers/chunks/ca7d4d76a6bf5a3046cd.js +0 -1
- package/assets/esri/core/workers/chunks/cffef41791f0cfa6c26c.js +0 -1
- package/assets/esri/core/workers/chunks/d26b1a9f47b4b2744c89.js +0 -1
- package/assets/esri/core/workers/chunks/d4a96f0402172787823a.js +0 -1
- package/assets/esri/core/workers/chunks/d9fcc63df008f687848a.js +0 -1
- package/assets/esri/core/workers/chunks/e3a4695c31d3f9d55213.js +0 -1
- package/assets/esri/core/workers/chunks/e65d291bab13f7f5323b.js +0 -1
- package/assets/esri/core/workers/chunks/eeee7421f64a52074ff4.js +0 -1
- package/assets/esri/core/workers/chunks/eef7e0bee19c4258ba55.js +0 -1
- package/assets/esri/core/workers/chunks/efaf998d18479a0380ae.js +0 -1
- package/assets/esri/core/workers/chunks/f0573db9a3d3e1499a7e.js +0 -1
- package/assets/esri/core/workers/chunks/f07722efd7fa2b75d4dd.js +0 -1
- package/assets/esri/core/workers/chunks/f137e544076482e348ad.js +0 -1
- package/assets/esri/core/workers/chunks/fd53ef66176ae164e221.js +0 -1
- package/assets/esri/core/workers/chunks/fd956a58787020d610af.js +0 -1
- package/rest/sharedTemplates/addSharedTemplates.js +0 -2
- package/support/featureFlags.js +0 -2
- package/views/2d/engine/webgl/ClippingInfo.js +0 -2
- package/views/2d/engine/webgl/Mesh2D.js +0 -2
- package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +0 -2
- package/views/2d/layers/features/ProcessorTileMessageQueue.js +0 -2
- package/views/3d/support/AsyncWorkerQueue.js +0 -2
- package/views/3d/webgl-engine/lib/PathGeometryData.js +0 -2
- package/widgets/BatchAttributeForm/templates/support/contingentValuesUtils.js +0 -2
- package/widgets/OrientedImageryViewer/components/NavigationAction.js +0 -2
- package/widgets/OrientedImageryViewer/components/NavigationActions.js +0 -2
- package/widgets/OrientedImageryViewer/support/NonPanoramicMediaCollection.js +0 -2
- package/widgets/PanoramicViewer/support/PanoramicMediaCollection.js +0 -2
- /package/assets/esri/core/workers/chunks/{2c00f89030c7a4201033.js.LICENSE.txt → 2a344bca6837ca3b5c41.js.LICENSE.txt} +0 -0
|
@@ -246,7 +246,7 @@ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
|
|
|
246
246
|
return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
|
|
247
247
|
}`),t.vertex.code.add(o.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
248
248
|
return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
|
|
249
|
-
}`)}function c(t){t.uniforms.add(new s.t("screenSizePerspective",t=>l(t.screenSizePerspective,t.screenSizePerspectiveMinPixelReferenceSize)))}function h(t){t.uniforms.add(new s.t("screenSizePerspectiveAlignment",t=>l(t.screenSizePerspectiveAlignment||t.screenSizePerspective,t.screenSizePerspectiveAlignment?null:t.screenSizePerspectiveMinPixelReferenceSize)))}function l(t,e){const i=null!=e&&null!=t?Math.min(t.minPixelSize/e,1):0;return t?(0,r.hZ)(u,t.divisor,t.offset,i):(0,r.hZ)(u,0,0,0)}const u=(0,n.vt)()},77949(t,e,i){i.d(e,{NB:()=>p,Nz:()=>_,S7:()=>g,yu:()=>d});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(23205),c=i(40710),h=i(33094),l=i(58029),u=i(97102);function d(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",o.uY):t.uniforms.add(new c.W("cameraPosition",(t,e)=>(0,s.hZ)(m,e.camera.viewInverseTransposeMatrix[3]-t.origin[0],e.camera.viewInverseTransposeMatrix[7]-t.origin[1],e.camera.viewInverseTransposeMatrix[11]-t.origin[2])))}function p(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new u.S("view",(t,e)=>(0,r.Tl)(f,e.camera.viewMatrix,t.origin)),new c.W("localOrigin",t=>t.origin));const i=({camera:t})=>(0,s.hZ)(m,t.viewInverseTransposeMatrix[3],t.viewInverseTransposeMatrix[7],t.viewInverseTransposeMatrix[11]);t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new l.F("view",t=>(0,r.Tl)(f,t.camera.viewMatrix,i(t))),new a.d("localOrigin",t=>i(t)))}const f=(0,n.vt)(),m=(0,o.vt)();function g(t){t.uniforms.add(new l.F("viewNormal",t=>t.camera.viewInverseTransposeMatrix))}function _(t){t.uniforms.add(new h.U("pixelRatio",t=>t.camera.pixelRatio/t.overlayStretch))}},77108(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",0,(r,n)=>r.setUniform2fv(t,e(n),i))}}},68259(t,e,i){i.d(e,{t:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",2,(r,n,s,o)=>r.setUniform2fv(t,e(n,s,o),i))}}},47286(t,e,i){i.d(e,{G:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",1,(r,n,s)=>r.setUniform2fv(t,e(n,s),i))}}},23205(t,e,i){i.d(e,{d:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec3",0,(r,n)=>r.setUniform3fv(t,e(n),i))}}},14314(t,e,i){i.d(e,{I:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",0,(r,n)=>r.setUniform4fv(t,e(n),i))}}},71988(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",1,(r,n,s)=>r.setUniform4fv(t,e(n,s),i))}}},33094(t,e,i){i.d(e,{U:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"float",0,(r,n)=>r.setUniform1f(t,e(n),i))}}},44887(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i,r){super(t,"float",1,(e,n,s)=>e.setUniform1fv(t,i(n,s),r),e)}}},35818(t,e,i){i.d(e,{W:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",0,(i,r)=>i.setUniform1i(t,e(r)))}}},93588(t,e,i){i.d(e,{c:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",1,(i,r,n)=>i.setUniform1i(t,e(r,n)))}}},35644(t,e,i){i.d(e,{k:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat3",1,(r,n,s)=>r.setUniformMatrix3fv(t,e(n,s),i))}}},58029(t,e,i){i.d(e,{F:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",0,(r,n)=>r.setUniformMatrix4fv(t,e(n),i))}}},97102(t,e,i){i.d(e,{S:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",2,(r,n,s)=>r.setUniformMatrix4fv(t,e(n,s),i))}}},12791(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"sampler2D",0,(i,r)=>i.bindTexture(t,e(r)))}}},13840(t,e,i){i.d(e,{r:()=>r});class r{constructor(t,e){this._module=t,this._load=e}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98958(t,e,i){i.d(e,{w:()=>f});var r=i(5482),n=i(69622),s=i(53966),o=i(91429),a=i(41976),c=(i(44208),i(26857)),h=i(94656);class l{constructor(t,e,i){this._context=t,this.locations=i,this._textures=new Map,this.source=(0,h.en)()?e:null,e.attributeNames.forEach(t=>{i.has(t)||s.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${t} used in shader`)}),this._glProgram=t.programCache.get(e.generate("vertex",!0),e.generate("fragment",!0),i),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=e.generateBind(this),this.bindPass=e.generateBindPass(this),this.bindDraw=e.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,e){this._glProgram.setUniform1i(t,e?1:0)}setUniform1i(t,e){this._glProgram.setUniform1i(t,e)}setUniform1f(t,e,i){this._glProgram.setUniform1f(t,e,i)}setUniform2fv(t,e,i){this._glProgram.setUniform2fv(t,e,i)}setUniform3fv(t,e,i){this._glProgram.setUniform3fv(t,e,i)}setUniform4fv(t,e,i){this._glProgram.setUniform4fv(t,e,i)}setUniformMatrix3fv(t,e,i){this._glProgram.setUniformMatrix3fv(t,e,!1,i)}setUniformMatrix4fv(t,e,i){this._glProgram.setUniformMatrix4fv(t,e,!1,i)}setUniformMatrices4fv(t,e,i){this._glProgram.setUniformMatrices4fv(t,e,!1,i)}setUniform1fv(t,e,i){this._glProgram.setUniform1fv(t,e,i)}setUniform1iv(t,e){this._glProgram.setUniform1iv(t,e)}setUniform2iv(t,e){this._glProgram.setUniform2iv(t,e)}setUniform3iv(t,e){this._glProgram.setUniform3iv(t,e)}setUniform4iv(t,e){this._glProgram.setUniform4iv(t,e)}assertCompatibleVertexAttributeLocations(t,e){if(c.b.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((e,r)=>t.set(r,i.size+e)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${i}, ${this.locations}`),this.locations.forEach((t,e)=>{i.get(e)!==t&&console.error(`VertexAttributeLocations are incompatible: Program has ${e} at position ${t}, VAO has it at position ${i.get(e)}.`)})}stop(){this._textures.clear()}bindTexture(t,e,i){if(!e?.glName){const i=`Texture sampler ${t} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(i),e=this._context.emptyTexture}const r=this._ensureTextureUnit(t,e);this._context.useProgram(this);const n=r.unit;this.setUniform1i(t,n),this._context.bindTexture(e,n,!1,i)}_ensureTextureUnit(t,e){let i=this._textures.get(t);return null==i?(i={texture:e,unit:this._textures.size},this._textures.set(t,i)):i.texture=e,i}}var u=i(63907),d=i(90644),p=i(85079);let f=class extends n.A{constructor(t,e,i){super({}),this._context=t,this._configuration=e,this.primitiveType=u.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=e.key,this.locations=(0,p.Xk)(i??a.lK),this._pipeline=this.initializePipeline(e),this.reload=async i=>{if(i&&await this.shader.reload(),!this.key.equals(e.key))return void s.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(e);r.debugName=this.declaredClass,this._program=new l(t.rctx,r,this.locations),this._pipeline=this.initializePipeline(e)}}initialize(){const t=this.shader.get().build(this._configuration);t.debugName=this.declaredClass,this._program=new l(this._context.rctx,t,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(t){this.program.assertCompatibleVertexAttributeLocations(t)}getPipeline(t,e,i){return this._pipeline}initializePipeline(t){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}};f=(0,r.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],f)},16943(t,e,i){i.d(e,{E:()=>n});var r=i(44208);function n(){return!!(0,r.A)("enable-feature:objectAndLayerId-rendering")}},41976(t,e,i){i.d(e,{lK:()=>a,wR:()=>o});var r=i(63907),n=i(85079),s=i(74038);const o=[],a=(new s._("position",3,r.pe.FLOAT,0,12),[new s._("position",2,r.pe.FLOAT,0,8)]);(0,n.Xk)(a),new s._("position",2,r.pe.FLOAT,0,12),new s._("uv0",2,r.pe.HALF_FLOAT,8,12),new s._("position",2,r.pe.FLOAT,0,16),new s._("uv0",2,r.pe.FLOAT,8,16)},92130(t,e,i){i.d(e,{A:()=>r});class r{constructor(t){this._material=t.material,this._techniques=t.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(t,e){return this._techniques.get(t,this._material.getConfiguration(e))}ensureResources(t){return 2}}},16613(t,e,i){i.d(e,{V:()=>M});var r=i(9093),n=i(35522),s=i(97146),o=i(46610),a=i(34275),c=i(20498);function h(t){if(t.length<a.y9)return Array.from(t);if(Array.isArray(t))return Float64Array.from(t);if(!("BYTES_PER_ELEMENT"in t))return Array.from(t);switch(t.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(t);case 2:return(0,a.LW)(t)?(0,c.pX)().from(t):(0,a.jq)(t)?Uint16Array.from(t):Int16Array.from(t);case 4:return(0,a.vZ)(t)?Float32Array.from(t):Uint32Array.from(t);default:return Float64Array.from(t)}}var l=i(15142),u=i(51850),d=i(620);class p{get center(){return(0,u.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,u.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,u.fA)(this._data[7],this._data[8],this._data[9])}constructor(t,e,i){this.primitiveIndices=t,this._numIndexPerPrimitive=e,this.position=i,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,d.vA)(t.length>=1),(0,d.vA)(3===i.size||4===i.size);const{data:r,size:s,indices:o}=i;(0,d.vA)(o.length%this._numIndexPerPrimitive===0),(0,d.vA)(o.length>=t.length*this._numIndexPerPrimitive);const a=t.length;let c=s*o[this._numIndexPerPrimitive*t[0]];f.clear(),f.push(c);const h=(0,u.fA)(r[c],r[c+1],r[c+2]),l=(0,u.o8)(h);for(let e=0;e<a;++e){const i=this._numIndexPerPrimitive*t[e];for(let t=0;t<this._numIndexPerPrimitive;++t){c=s*o[i+t],f.push(c);let e=r[c];h[0]=Math.min(e,h[0]),l[0]=Math.max(e,l[0]),e=r[c+1],h[1]=Math.min(e,h[1]),l[1]=Math.max(e,l[1]),e=r[c+2],h[2]=Math.min(e,h[2]),l[2]=Math.max(e,l[2])}}for(let t=0;t<3;++t)this._data[4+t]=h[t],this._data[7+t]=l[t];const p=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(l[0]-h[0],l[1]-h[1]),l[2]-h[2]),g=m*m;for(let t=0;t<f.length;++t){c=f.at(t);const e=r[c]-p[0],i=r[c+1]-p[1],n=r[c+2]-p[2],s=e*e+i*i+n*n;if(s<=g)continue;const o=Math.sqrt(s),a=.5*(o-m);m+=a,g=m*m;const h=a/o;p[0]+=e*h,p[1]+=i*h,p[2]+=n*h}this._data[3]=m;for(let t=0;t<3;++t)this._data[0+t]=p[t];f.clear()}getChildren(){if(this._children||(0,n.hG)(this.bbMin,this.bbMax)<=1)return this._children;const t=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5),e=this.primitiveIndices.length,i=new Uint8Array(e),r=new Array(8);for(let t=0;t<8;++t)r[t]=0;const{data:s,size:o,indices:a}=this.position;for(let n=0;n<e;++n){let e=0;const c=this._numIndexPerPrimitive*this.primitiveIndices[n];let h=o*a[c],l=s[h],u=s[h+1],d=s[h+2];for(let t=1;t<this._numIndexPerPrimitive;++t){h=o*a[c+t];const e=s[h],i=s[h+1],r=s[h+2];e<l&&(l=e),i<u&&(u=i),r<d&&(d=r)}l<t[0]&&(e|=1),u<t[1]&&(e|=2),d<t[2]&&(e|=4),i[n]=e,++r[e]}let c=0;for(let t=0;t<8;++t)r[t]>0&&++c;if(c<2)return;const h=new Array(8);for(let t=0;t<8;++t)h[t]=r[t]>0?new Uint32Array(r[t]):void 0;for(let t=0;t<8;++t)r[t]=0;for(let t=0;t<e;++t){const e=i[t];h[e][r[e]++]=this.primitiveIndices[t]}this._children=new Array;for(let t=0;t<8;++t)void 0!==h[t]&&this._children.push(new p(h[t],this._numIndexPerPrimitive,this.position));return this._children}static prune(){f.prune()}}const f=new l.A({deallocator:null});var m=i(24326);class g{constructor(t){this.id=(0,m.c)(),this._attributes=new Map;for(const[e,i]of t)this._attributes.set(e,{...i,indices:(0,s.Dg)(i.indices)})}get attributes(){return this._attributes}}var _=i(48295);const v=(0,u.vt)(),x=(0,u.vt)(),y=(0,u.vt)(),b=(0,u.vt)();var w=i(17478),T=i(94656);class M extends g{constructor(t,e,i=null,r=0,n=null,s=-1,o,a){super(e),this.material=t,this.mapPositions=i,this.type=r,this.olidColor=n,this.edgeIndicesLength=s,this.baseGeometry=o,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,d.vA)((t?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match");const c=this.positionAttribute;null!=c&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=c.indices.length)}instantiate(t={}){const e=new M(t.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((t,i)=>{t.exclusive=!1,e._attributes.set(i,t)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:h(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const i=this._attributes.get(t);i?this._attributes.set(t,{...i,exclusive:!0,data:e}):(0,T.en)()&&console.warn(`Setting undefined attribute ${t} data`)}get primitivePositionIndices(){return void 0!==this._vertexPositionIndicesCache||(this._vertexPositionIndicesCache=this._computePrimitivePositionIndices()),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){const{drawIndices:t}=this,e=this.positionAttribute;if(null!=t&&null!=e){const i=new Array;for(const r of t)i.push(e.indices[r]);return i}return e?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const t=this.drawIndices??this.positionAttribute?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(t){return!!(0===this.type?this._computeAttachmentOriginTriangles(t):2===this.type?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(null!=this._transformation&&(0,n.Z0)(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;(0,n.hZ)(t,0,0,0),(0,n.hZ)(b,0,0,0);let o=0,a=0;for(let e=0;e<i.length-2;e+=3){const c=i[e]*r,h=i[e+1]*r,l=i[e+2]*r;(0,n.hZ)(v,s[c],s[c+1],s[c+2]),(0,n.hZ)(x,s[h],s[h+1],s[h+2]),(0,n.hZ)(y,s[l],s[l+1],s[l+2]);const u=(0,_.BU)(v,x,y);u?((0,n.WQ)(v,v,x),(0,n.WQ)(v,v,y),(0,n.hs)(v,v,1/3*u),(0,n.WQ)(t,t,v),o+=u):((0,n.WQ)(b,b,v),(0,n.WQ)(b,b,x),(0,n.WQ)(b,b,y),a+=3)}return!(0===a&&0===o||(0!==o?((0,n.hs)(t,t,1/o),0):0===a||((0,n.hs)(t,b,1/a),0)))}(t,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(t){const e=this.positionAttribute,i=this.primitivePositionIndices;return function(t,e,i,r=e?.indices){if(!e||!r)return!1;(0,n.hZ)(t,0,0,0),(0,n.hZ)(b,0,0,0);let s=0,o=0;const{size:a,data:c}=e,h=r.length-1,l=h+(i?2:0);for(let e=0;e<l;e+=2){const i=e<h?e+1:0,l=r[e<h?e:h]*a,u=r[i]*a;v[0]=c[l],v[1]=c[l+1],v[2]=c[l+2],x[0]=c[u],x[1]=c[u+1],x[2]=c[u+2],(0,n.hs)(v,(0,n.WQ)(v,v,x),.5);const d=(0,n.xg)(v,x);d>0?((0,n.WQ)(t,t,(0,n.hs)(v,v,d)),s+=d):0===s&&((0,n.WQ)(b,b,v),o++)}return 0!==s?((0,n.hs)(t,t,1/s),!0):0!==o&&((0,n.hs)(t,b,1/o),!0)}(t,e,function(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e.indices.length>2}(this.material.parameters,e),i)}_computeAttachmentOriginPoints(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;(0,n.hZ)(t,0,0,0);let o=-1,a=0;for(let e=0;e<i.length;e++){const n=i[e]*r;o!==n&&(t[0]+=s[n],t[1]+=s[n+1],t[2]+=s[n+2],a++),o=n}return a>1&&(0,n.hs)(t,t,1/a),a>0}(t,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const t=this.positionAttribute,e=this.primitivePositionIndices;if(!t||!e||0===e.length)return null;const i=e===t.indices?t:new o.n(t.data,e,t.size,!1,t.stride),r=0===this.type?3:1;(0,d.vA)(e.length%r===0,"Indexing error: "+e.length+" not divisible by "+r);const n=(0,s.tM)(e.length/r);return new p(n,r,i)}get transformation(){return this._transformation??r.zK}set transformation(t){this._transformation=t&&t!==r.zK?(0,r.o8)(t):null}get highlights(){return this._highlights||A}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(t){this._highlightOptionsCounts?.forEach((e,i)=>t(i))}allocateIdAndHighlight(t){const e=new w.h(t);return this.addHighlight(e)}addHighlight(t){this._ensureHighlights().add(t);const{highlightName:e}=t,i=(this._highlightOptionsCounts?.get(e)??0)+1;return this._ensureHighlightOptionsCounts().set(e,i),t}_ensureHighlights(){let t=this._highlights;return t||(t=new Set,this._highlights=t),t}_ensureHighlightOptionsCounts(){let t=this._highlightOptionsCounts;return t||(t=new Map,this._highlightOptionsCounts=t),t}removeHighlight(t){if(this._highlights?.delete(t)){const{highlightName:e}=t,i=this._highlightOptionsCounts?.get(e)??0;i<=1?this._highlightOptionsCounts?.delete(e):this._ensureHighlightOptionsCounts().set(e,i-1)}}}const A=new Set},49718(t,e,i){i(51850),i(6867).i9},6867(t,e,i){i.d(e,{i9:()=>l});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);class l{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,s.hs)(d,this.ray.direction,this.distance),(0,s.Bw)(d))}withinDistance(t){return!!u(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!u(this)&&((0,s.hs)(d,this.ray.direction,this.distance),(0,s.WQ)(t,this.ray.origin,d),!0)}getTransformedNormal(t){return(0,s.C)(p,this.normal),p[3]=0,(0,a.Z0)(p,p,this.transformation),(0,s.C)(t,p),(0,s.S8)(t,t)}constructor(t){this.intersector=4,this.normal=(0,o.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,h.vt)(),this.init(t)}init(t){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,h.C)(t,this._ray)}set(t,e,i,a,c,h,l){this.intersector=t,this.distance=i,(0,s.C)(this.normal,a??o.Cb),(0,r.C)(this.transformation,c??n.zK),this.target=e,this.drapedLayerOrder=h,this.renderPriority=l}copy(t){(0,h.C)(t.ray,this._ray),this.intersector=t.intersector,this.distance=t.distance,this.target=t.target,this.drapedLayerOrder=t.drapedLayerOrder,this.renderPriority=t.renderPriority,(0,s.C)(this.normal,t.normal),(0,r.C)(this.transformation,t.transformation)}}function u(t){return null!=t?.distance}const d=(0,o.vt)(),p=(0,c.vt)()},18845(t,e,i){i.d(e,{h:()=>U});var r=i(49186),n=i(65529),s=i(97768),o=i(17676),a=i(34275),c=i(24326),h=i(84952),l=i(38969),u=i(31217),d=i(95117),p=i(2741);let f;var m=i(63907),g=i(21231),_=i(42293);let v=null,x=null;async function y(){return null==x&&(f??=(async()=>{const t=await i.e(9321).then(i.bind(i,49321)),e=await t.default({locateFile:t=>(0,p.s)(`esri/libs/basisu/${t}`)});return e.initializeBasis(),e})(),x=f,v=await x),x}function b(t,e){if(null==v)return t.byteLength;const i=new v.BasisFile(new Uint8Array(t)),r=M(i)?T(i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),e):0;return i.close(),i.delete(),r}function w(t,e){if(null==v)return t.byteLength;const i=new v.KTX2File(new Uint8Array(t)),r=A(i)?T(i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),e):0;return i.close(),i.delete(),r}function T(t,e,i,r,n){const s=(0,_.MW)(e?m.CQ.COMPRESSED_RGBA8_ETC2_EAC:m.CQ.COMPRESSED_RGB8_ETC2),o=n&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(i*r*s*o)}function M(t){return t.getNumImages()>=1&&!t.isUASTC()}function A(t){return t.getFaces()>=1&&(t.isETC1S()||t.isUASTC())}function C(t,e,i,r,n,s,o,a){const{compressedTextureETC:c,compressedTextureS3TC:h}=t.capabilities,[l,u]=c?r?[1,m.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,m.CQ.COMPRESSED_RGB8_ETC2]:h?r?[3,m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=e.hasMipmap?i:Math.min(1,i),p=[];for(let t=0;t<d;t++)p.push(new Uint8Array(o(t,l))),a(t,l,p[t]);return e.internalFormat=u,e.hasMipmap=p.length>1,e.samplingMode=e.hasMipmap?9987:9729,e.width=n,e.height=s,new g.A(t,e,{type:"compressed",levels:p})}var S=i(53966);const E=()=>S.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}const I=R("DXT1"),O=R("DXT3"),D=R("DXT5");function P(t,e){const i=new Int32Array(t.buffer,t.byteOffset,31);if(542327876!==i[0])return E().error("Invalid magic number in DDS header"),null;if(!(4&i[20]))return E().error("Unsupported format, must contain a FourCC code"),null;const r=i[21];let n,s;switch(r){case I:n=8,s=m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case O:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case D:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return E().error("Unsupported FourCC code:",function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}(r)),null}let o=1,a=i[4],c=i[3];(3&a||3&c)&&(E().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const h=a,l=c;let u,d;131072&i[2]&&!1!==e&&(o=Math.max(1,i[7]));let p=t.byteOffset+i[1]+4;const f=[];for(let e=0;e<o;++e)d=(a+3>>2)*(c+3>>2)*n,u=new Uint8Array(t.buffer,p,d),f.push(u),p+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:f},internalFormat:s,width:h,height:l}}var F=i(78988),N=i(620),L=i(67171),B=i(12541);class U{constructor(t,e){this._data=t,this.id=(0,c.c)(),this.events=new n.bk,this._parameters={...V,...e},this._startPreload(t)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(t){t instanceof HTMLVideoElement?(this.update=e=>this._update(t,e),this._startPreloadVideoElement(t)):t instanceof HTMLImageElement&&this._startPreloadImageElement(t)}_startPreloadVideoElement(t){if(!((0,h.w8)(t.src)||"auto"===t.preload&&t.crossOrigin)&&(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src,t.paused&&t.autoplay)){const e=[];(0,l.i)(t,t=>e.push(t)).then(()=>{t.play()}).finally(()=>e.forEach(t=>t.remove()))}}_startPreloadImageElement(t){(0,h.DB)(t.src)||(0,h.w8)(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}_createDescriptor(t){const e=new L.R;return e.wrapMode=this._parameters.wrap??10497,e.flipped=!this._parameters.noUnpackFlip,e.samplingMode=this._parameters.mipmap?9987:9729,e.hasMipmap=!!this._parameters.mipmap,e.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,e.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?t.parameters.maxMaxAnisotropy:1),e.dataType=this._parameters.dataType??e.dataType,e.pixelFormat=this._parameters.pixelFormat??e.pixelFormat,e.internalFormat=this._parameters.internalFormat??e.internalFormat,e.isImmutable=!0===this._parameters.immutable&&function(t){return null!=t&&((0,B.tl)(t)||(0,B.tr)(t)||(0,B.CR)(t)||(0,B.QJ)(t))}(this._parameters.internalFormat),e}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(t,e){if(null==t)return 0;if((0,a.mw)(t)||(0,a.mg)(t))return"image/ktx2"===e.encoding?w(t,!!e.mipmap):"image/x.basis"===e.encoding?b(t,!!e.mipmap):t.byteLength;const{width:i,height:r}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?H(t):e,n=e.pixelFormat??6408,s=(0,_.wH)(n);return(e.mipmap?4/3:1)*i*r*s||0}(this._data,this._parameters)}load(t){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const e=this._data;return null==e?(this._texture=new g.A(t,this._createDescriptor(t),null),this._texture):(this._emptyTexture=t.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof e?this._loadFromURL(t,e):e instanceof Image?this._loadFromImageElement(t,e):e instanceof HTMLVideoElement?this._loadFromVideoElement(t,e):e instanceof ImageData||e instanceof HTMLCanvasElement?this._loadFromImage(t,e):(0,a.mg)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,e):(0,a.mw)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,new Uint8Array(e)):((0,a.mw)(e)||(0,a.mg)(e))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(t,e):((0,a.mw)(e)||(0,a.mg)(e))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(t,e):(0,a.mw)(e)?this._loadFromPixelData(t,new Uint8Array(e)):(0,a.iu)(e)?this._loadFromPixelData(t,e):null)}_update(t,e){return null==this._texture||t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e===t.currentTime?e:(this._texture.setData(t),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),t.currentTime)}_loadFromDDSData(t,e){return this._texture=function(t,e,i){const r=P(i,e.hasMipmap??!1);if(null==r)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:s,width:o,height:a}=r;return e.samplingMode=n.levels.length>1?9987:9729,e.hasMipmap=n.levels.length>1,e.internalFormat=s,e.width=o,e.height=a,new g.A(t,e,n)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX2(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await y());const r=new v.KTX2File(new Uint8Array(i));if(!A(r))return null;r.startTranscoding();const n=C(t,e,r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),(t,e)=>r.getImageTranscodedSizeInBytes(t,0,0,e),(t,e,i)=>r.transcodeImage(i,t,0,0,e,0,-1,-1));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromBasis(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await y());const r=new v.BasisFile(new Uint8Array(i));if(!M(r))return null;r.startTranscoding();const n=C(t,e,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(t,e)=>r.getImageTranscodedSizeInBytes(0,t,e),(t,e,i)=>r.transcodeImage(i,0,t,e,0,0));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromPixelData(t,e){(0,N.vA)(this._parameters.width>0&&this._parameters.height>0);const i=this._createDescriptor(t);return 6407!==i.pixelFormat&&6408!==i.pixelFormat||(i.compress=this._parameters.compressionOptions),i.width=this._parameters.width??0,i.height=this._parameters.height??0,this._texture=new g.A(t,i,e),this._texture}_loadFromURL(t,e){return this._loadAsync(async i=>{const r=await(0,u.D)(e,{signal:i});return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromImageElement(t,e){return e.complete?this._loadFromImage(t,e):this._loadAsync(async i=>{const r=await(0,d.y)(e,e.src,!1,i);return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromVideoElement(t,e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(t,e):this._loadFromVideoElementAsync(t,e)}_loadFromVideoElementAsync(t,e){return this._loadAsync(i=>new Promise((n,a)=>{const c=()=>{e.removeEventListener("loadeddata",h),e.removeEventListener("error",l),(0,s.xt)(u)},h=()=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(t,e)))},l=t=>{c(),a(t||new r.A("texture:load-error","Failed to load video"))};e.addEventListener("loadeddata",h),e.addEventListener("error",l);const u=(0,o.u7)(i,()=>l((0,o.NK)()))}))}_loadFromImage(t,e){let i=e;i instanceof HTMLVideoElement||(i=(0,F.vM)(i,t.parameters));const r=H(i);this._parameters.width=r.width,this._parameters.height=r.height;const n=this._createDescriptor(t);return n.width=r.width,n.height=r.height,n.compress=this._parameters.compressionOptions,this._texture=new g.A(t,n,i),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(t){const e=new AbortController;this._loadingController=e;const i=t(e.signal);this._loadingPromise=i;const r=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===i&&(this._loadingPromise=null),this._emptyTexture=null};return i.then(r,r),i}unload(){if(this._texture=(0,s.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function H(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}const V={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},11725(t,e,i){i.d(e,{i:()=>a});var r=i(24326),n=i(49255),s=i(43616),o=i(65786);class a{constructor(t,e){this.id=(0,r.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new e,(0,s.MB)(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(t){return!1}setParameters(t,e=!0){(0,s.MB)(this._parameters,t)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(t){}shouldRender(t){return this.visible&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bind.decorations)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&&(this._renderPriority=t,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(t){return this.updateConfiguration(t),this._configuration}updateConfiguration(t){this._configuration.output=t.output,this._configuration.hasEmission=t.hasEmission&&(0,n._o)(t.output),this._configuration.hasHighlightMixTexture=10===t.output&&null!=t.highlightMixTexture,this._configuration.useFloatBlend=t.useFloatBlend.value,this._configuration.emissionDimmingPass=t.transparentWithoutDepthEmissionDimmingPass&&(0,n._o)(t.output)}}o.Y},17478(t,e,i){i.d(e,{h:()=>s,p:()=>o});var r=i(24326);class n{constructor(){this.uid=(0,r.c)()}}class s extends n{constructor(t){super(),this.highlightName=t,this.channel=0}}class o extends n{constructor(){super(...arguments),this.channel=1}}},33524(t,e,i){i.d(e,{Yf:()=>a,mt:()=>h,z5:()=>c});var r=i(91829),n=i(49255),s=i(90644);const o=(0,s.p3)(1,0,1,771);function a(t,e=!1,i=!1){if(i)return s.uR;switch(t){case 0:return e?s.RC:s.T8;case 1:return o;default:return null}}function c(t){if(t.draped)return null;switch(t.output){case 0:case 2:default:return t.writeDepth?s.Uy:null;case 1:return null}}function h(t,e=513){return{func:(0,n._$)(t)?515:e}}(0,r._Y)()},56133(t,e,i){i.d(e,{Ax:()=>h,Q0:()=>u,cP:()=>c,iB:()=>l,m:()=>n,r8:()=>a,sf:()=>s,v0:()=>o});var r=i(90644);const n={func:513},s={func:519},o={mask:255},a={mask:0},c=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),h=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681}),l=(0,r.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),u=(0,r.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680})},83252(t,e,i){i.d(e,{F:()=>r});const r=1e3},58964(t,e,i){i.d(e,{AH:()=>g,SB:()=>d,Vh:()=>p,jP:()=>f,q6:()=>_,yx:()=>m});var r=i(90629),n=i(35522),s=i(51850),o=i(19419),a=i(11964),c=i(27921),h=i(48295);class l{constructor(t,e,i){this.bounds=t,this.nearestDistance=e,this.nearestPoint=i}}function u(t,e){return t.isRectangle?(0,o.Uc)(t.bounds,e):y(e,t.points)}function d(t,e){if(!(0,o.HY)(t.bounds,e))return!1;if(t.isRectangle)return!0;for(const i of t.points)if((0,o.Uc)(e,i))return!0;for(let i=0;i<4;i++)if(y(C(E,e,i),t.points))return!0;for(let i=0;i<t.points.length;i++){const r=t.points[i],n=i===t.points.length-1?t.points[0]:t.points[i+1];for(let t=0;t<4;t++)if(b(r,n,C(E,e,t),C(R,e,(t+1)%4)))return!0}return!1}function p(t,e,i,r){const n=Math.min(e[0],i[0],r[0]),s=Math.min(e[1],i[1],r[1]),a=Math.max(e[0],i[0],r[0]),c=Math.max(e[1],i[1],r[1]);if(!d(t,(0,o.fA)(n,s,a,c,S)))return!1;if(u(t,e)||u(t,i)||u(t,r))return!0;for(const n of t.points)if((0,h.cq)(e,i,r,n,V))return!0;for(let n=0;n<t.points.length;n++){const s=t.points[n],o=t.points[(n+1)%t.points.length];if(b(e,i,s,o)||b(i,r,s,o)||b(r,e,s,o))return!0}return!1}function f(t,e,i,r){const n=Math.min(e[0],i[0])-r,s=Math.min(e[1],i[1])-r,a=Math.max(e[0],i[0])+r,c=Math.max(e[1],i[1])+r;if(!(0,o.HY)(t.bounds,(0,o.fA)(n,s,a,c,S)))return!1;if(u(t,e)||u(t,i))return!0;const h=r*r;for(const r of t.points)if(T(r,e,i)<=h)return!0;for(let r=0;r<t.points.length;r++){const n=t.points[r],s=t.points[(r+1)%t.points.length];if(b(e,i,n,s)||w(e,i,n,s)<=h)return!0}return!1}function m(t,e,i){return g(t,e.bbMin,e.bbMax,i)}function g(t,e,i,r){const a=(0,o.Ie)(S);H.reset(t.eye);let c=0;for(let s=0;s<2;s++)for(let h=0;h<2;h++)for(let l=0;l<2;l++)D[0]=0===s?e[0]:i[0],D[1]=0===h?e[1]:i[1],D[2]=0===l?e[2]:i[2],r&&(0,n.Z0)(D,D,r),(0,n.C)(B[c++],D),v(t,D)||(t.projectToScreen(D,E),(0,o.tK)(a,E),H.addNearestCandidate(D));return function(t,e,i,r){for(let n=0;n<i.length;n++)for(const s of U){const a=n|s;a!==n&&x(t,i[n],i[a],P)&&(t.projectToScreen(P,E),(0,o.tK)(e,E),r.addNearestCandidate(P))}}(t,a,B,H),H.valid?new l((0,o.o8)(a),H.distance,(0,s.o8)(H.point)):null}function _(t,e,i,r,s){(0,n.C)(P,e),(0,n.C)(F,i);const o=t.projectToRenderScreen(P,I),a=t.projectToRenderScreen(F,O);if(null==o||null==a)return!1;const c=v(t,P),h=v(t,F);if(c&&h)return!1;if(c!==h){const e=c?P:F,i=c?o:a;if(!function(t,e,i){return x(t,e,i,e)}(t,e,c?F:P))return!1;if(!t.projectToRenderScreen(e,i))return!1}return r[0]=o[0],r[1]=o[1],r[2]=0,s[0]=a[0],s[1]=a[1],s[2]=0,!0}function v(t,e){return function(t,e){return(0,c.mN)(t.frustum[4],e)}(t,e)>0}function x(t,e,i,r){return(0,c.T7)(t.frustum[4],(0,a.Cr)(e,i,L),r)}function y(t,e){let i=!1;for(let r=0,n=e.length-1;r<e.length;n=r++){const s=e[r],o=e[n];if(s[1]>t[1]==o[1]>t[1])continue;const a=(o[0]-s[0])*(t[1]-s[1])/(o[1]-s[1])+s[0];t[0]<a&&(i=!i)}return i}function b(t,e,i,r){const n=M(t,e,i),s=M(t,e,r),o=M(i,r,t),a=M(i,r,e);return n!==s&&o!==a||0===n&&A(t,e,i)||0===s&&A(t,e,r)||0===o&&A(i,r,t)||0===a&&A(i,r,e)}function w(t,e,i,r){return b(t,e,i,r)?0:Math.min(T(t,i,r),T(e,i,r),T(i,t,e),T(r,t,e))}function T(t,e,i){return(0,a.kb)((0,a.Cr)((0,n.hZ)(P,e[0],e[1],0),(0,n.hZ)(F,i[0],i[1],0),L),(0,n.hZ)(N,t[0],t[1],0))}function M(t,e,i){const r=(e[1]-t[1])*(i[0]-e[0])-(e[0]-t[0])*(i[1]-e[1]);return Math.abs(r)<=V?0:Math.sign(r)}function A(t,e,i){return i[0]>=Math.min(t[0],e[0])-V&&i[0]<=Math.max(t[0],e[0])+V&&i[1]>=Math.min(t[1],e[1])-V&&i[1]<=Math.max(t[1],e[1])+V}function C(t,e,i){return t[0]=0===i||3===i?e[0]:e[2],t[1]=i<2?e[1]:e[3],t}const S=(0,o.vt)(),E=(0,r.gs)(),R=(0,r.gs)(),I=(0,r.r_)(),O=(0,r.r_)(),D=(0,s.vt)(),P=(0,s.vt)(),F=(0,s.vt)(),N=(0,s.vt)(),L=(0,a.vt)(),B=[(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)()],U=[1,2,4],H=new class{constructor(){this._origin=(0,s.vt)(),this.point=(0,s.vt)(),this.distance=Number.POSITIVE_INFINITY}get valid(){return Number.isFinite(this.distance)}addNearestCandidate(t){const e=(0,n.Io)(this._origin,t);e<this.distance&&(this.distance=e,(0,n.C)(this.point,t))}reset(t){this.distance=Number.POSITIVE_INFINITY,(0,n.C)(this._origin,t)}},V=1e-9},75956(t,e,i){i.d(e,{MJ:()=>d,Uq:()=>u});var r=i(90629),n=i(35522),s=i(51850),o=i(70328),a=i(27921),c=i(48295),h=i(83252),l=i(58964);class u{constructor(){this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,s.vt)(),this.normal=(0,s.vt)()}reset(){this.distance=Number.POSITIVE_INFINITY}update(t,e,i,r){this.distance=t,this.primitiveIndex=e,(0,n.C)(this.point,i),this.hasNormal=null!=r,null!=r&&(0,n.C)(this.normal,r)}updateIfCloserFromValues(t,e,i,r){t<this.distance&&this.update(t,e,i,r)}updateIfCloser(t){const{distance:e,primitiveIndex:i,point:r,normal:n}=t;this.updateIfCloserFromValues(e,i,r,t.hasNormal?n:null)}get valid(){return Number.isFinite(this.distance)}}function d(t,e,i,r,n){if(!t.visible||0!==t.type)return null;const s=new u;let o;if(t.boundingInfo)o=f(t.boundingInfo,e,i,r,n);else{const s=t.positionAttribute,a=t.primitivePositionIndices;o=p(e,i,r,0,a.length/3,a,s.data,s.stride,n,null,0)}for(const t of o)s.updateIfCloser(t);return s.valid?s:null}function*p(t,e,i,r,s,o,h,l,u,d=null,p=0){if(null==t.camera)return;const{camera:f,screenPolygonPrimitiveProcessor:v}=t;for(let t=r;t<s;++t){const r=(d?.[t]??t)+p,s=null==d?r:t,M=3*r;m(x[0],o,h,l,M+0,u,s,e),m(x[1],o,h,l,M+1,u,s,e),m(x[2],o,h,l,M+2,u,s,e);const S=T;let E;A.reset();for(const{list:t,count:e}of v.processTriangle(C,x)){const s=(0,a.H)(f.frustum[4],t,e,y,!1);if(!(s<3)){for(let t=0;t<s;t++)f.projectToScreen(y[t],b[t]);g(i,b,s)&&(_(f.eye,y,s,w),null==E&&(E=(0,c.rb)(T,x[0],x[1],x[2])),A.updateIfCloserFromValues((0,n.Io)(f.eye,w),r,w,E?S:null))}}A.valid&&(yield A)}}function*f(t,e,i,r,n){const s=e.camera,a=null!=n?((0,o.Ne)(v,t.bbMin),(0,o.vI)(v,t.bbMax),n.applyToAabb(v),(0,l.AH)(s,(0,o.pg)(v,x[0]),(0,o.Lu)(v,x[1]),i)):(0,l.yx)(s,t,i);if(null==a||!(0,l.SB)(r,a.bounds))return;const{primitiveIndices:c,position:u}=t,d=c?c.length:u.indices.length/3;if(d>h.F){const s=t.getChildren();if(void 0!==s){for(const t of s)yield*f(t,e,i,r,n);return}}yield*p(e,i,r,0,d,u.indices,u.data,u.stride,n,c,0)}function m(t,e,i,r,s,o,a,c){const h=r*e[s],l=i[h+0],u=i[h+1],d=i[h+2];null!=o?o.applyToVertex(t,l,u,d,a):(0,n.hZ)(t,l,u,d),c&&(0,n.Z0)(t,t,c)}function g(t,e,i){for(let r=1;r<i-1;r++)if((0,l.Vh)(t,e[0],e[r],e[r+1]))return!0;return!1}function _(t,e,i,r){let s=Number.POSITIVE_INFINITY;for(let o=1;o<i-1;o++){(0,c.k3)(M,t,e[0],e[o],e[o+1]);const i=(0,n.hG)(t,M);i<s&&(s=i,(0,n.C)(r,M))}}const v=(0,o.vt)(),x=[(0,s.vt)(),(0,s.vt)(),(0,s.vt)()],y=Array.from({length:12},()=>(0,s.vt)()),b=Array.from({length:12},()=>(0,r.gs)()),w=(0,s.vt)(),T=(0,s.vt)(),M=(0,s.vt)(),A=new u,C={list:[],count:0}},77194(t,e,i){i.d(e,{PS:()=>n}),i(44208);var r=i(34727);class n{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(t,e,i,r){i?(this._scale=Math.min(i.divisor/(e-i.offset),1),this._angleFactor=function(t){return Math.abs(t)**3}(t),this._minScale=null!=r?Math.min(i.minPixelSize/r,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(t){const{_scale:e,_angleFactor:i,_minScale:n}=this;return t*(0,r.qE)((0,r.Cc)(e,1,i),n,1)}applyVec2(t,e){t[0]=this.apply(e[0]),t[1]=this.apply(e[1])}}},78988(t,e,i){i.d(e,{Mv:()=>n,vM:()=>s});var r=i(49186);function n(t,e){return e=16*Math.floor(e/16),Math.min(16*Math.round(t/16),e)}function s(t,e){const[i,r]=o(t,e);return t.width===i&&t.height===r?t:a(t,i,r)}function o({width:t,height:e},{maxPreferredTexturePixels:i,maxTextureSize:r}){const s=Math.max(t,e),o=t*e;if(s<=r&&o<=i)return[t,e];const a=Math.min(Math.sqrt(i/o),r/s);return[n(Math.round(t*a),r),n(Math.round(e*a),r)]}function a(t,e,i){if(t instanceof ImageData)return a(function(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");if(null==i)throw new r.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return i.putImageData(t,0,0),e}(t),e,i);const n=document.createElement("canvas");return n.width=e,n.height=i,n.getContext("2d").drawImage(t,0,0,n.width,n.height),n}},16396(t,e,i){i.d(e,{ou:()=>c}),i(77690),i(29242),i(58083),i(9093);var r=i(35522),n=i(51850),s=i(94008),o=i(57005);const a=new class{constructor(t=0){this.offset=t,this._tmpSphere=new s.iy}applyToVertex(t,e,i,n){const s=this.objectTransform.transform,o=(0,r.hZ)(h,e,i,n),a=(0,r.Z0)(o,o,s),c=this.offset/(0,r.Bw)(a);(0,r.Ln)(a,a,a,c);const l=this.objectTransform.inverse;return(0,r.Z0)(t,a,l),t}applyToMinMax(t,e){const i=this.offset/(0,r.Bw)(t);(0,r.Ln)(t,t,t,i);const n=this.offset/(0,r.Bw)(e);(0,r.Ln)(e,e,e,n)}applyToAabb(t){const e=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*e,t[1]+=t[1]*e,t[2]+=t[2]*e;const i=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*i,t[4]+=t[4]*i,t[5]+=t[5]*i,t}applyToBoundingSphere(t){const e=t.center,i=(0,r.Bw)(e),n=this.offset/i;return(0,r.Ln)(this._tmpSphere.center,e,e,n),this._tmpSphere.radius=t.radius+t.radius*this.offset/i,this._tmpSphere}};function c(t){return null!=t?(a.offset=t,a):null}new class{constructor(t=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpMbs=new s.iy,this._tmpObb=new o.ab,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=(0,r.Bw)(t)}applyToVertex(t,e,i,n){const s=(0,r.hZ)(h,e,i,n),o=(0,r.hZ)(l,e,i,n+this.componentLocalOriginLength),a=this._totalOffset/(0,r.Bw)(o);return(0,r.Ln)(t,s,o,a),t}applyToAabb(t){const e=this.componentLocalOriginLength,i=t[0],r=t[1],n=t[2]+e,s=t[3],o=t[4],a=t[5]+e,c=Math.abs(i),h=Math.abs(r),l=Math.abs(n),u=Math.abs(s),d=Math.abs(o),p=Math.abs(a),f=.5*(1+Math.sign(i*s))*Math.min(c,u),m=.5*(1+Math.sign(r*o))*Math.min(h,d),g=.5*(1+Math.sign(n*a))*Math.min(l,p),_=Math.sqrt(f*f+m*m+g*g),v=Math.sign(c+i),x=Math.sign(h+r),y=Math.sign(l+n),b=Math.sign(u+s),w=Math.sign(d+o),T=Math.sign(p+a),M=this._totalOffset;if(_<M)return t[0]-=(1-v)*M,t[1]-=(1-x)*M,t[2]-=(1-y)*M,t[3]+=b*M,t[4]+=w*M,t[5]+=T*M,t;const A=Math.max(c,u),C=Math.max(h,d),S=Math.max(l,p),E=M/Math.sqrt(A*A+C*C+S*S),R=M/_,I=R-E,O=-I;return t[0]+=i*(v*O+R),t[1]+=r*(x*O+R),t[2]+=n*(y*O+R),t[3]+=s*(b*I+E),t[4]+=o*(w*I+E),t[5]+=a*(T*I+E),t}applyToMbs(t){const e=t.center,i=(0,r.Bw)(e),n=this._totalOffset/i;return(0,r.Ln)(this._tmpMbs.center,e,e,n),this._tmpMbs.radius=t.radius+t.radius*this._totalOffset/i,this._tmpMbs}applyToObb(t){return(0,o.gm)(t,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(t=0){this.offset=t,this._tmpVertex=(0,n.vt)()}applyToVertex(t,e,i,n){const s=(0,r.hZ)(h,e,i,n),o=(0,r.WQ)(l,s,this.localOrigin),a=this.offset/(0,r.Bw)(o);return(0,r.Ln)(t,s,o,a),t}applyToAabb(t){const e=u,i=d,r=p;for(let n=0;n<3;++n)e[n]=t[0+n]+this.localOrigin[n],i[n]=t[3+n]+this.localOrigin[n],r[n]=e[n];const n=this.applyToVertex(this._tmpVertex,e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=n[e],t[e+3]=n[e];const s=e=>{const i=this.applyToVertex(this._tmpVertex,e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],i[e]),t[e+3]=Math.max(t[e+3],i[e])};for(let t=1;t<8;++t){for(let n=0;n<3;++n)r[n]=t&1<<n?i[n]:e[n];s(r)}let o=0;for(let t=0;t<3;++t)e[t]*i[t]<0&&(o|=1<<t);if(0!==o&&7!==o)for(let t=0;t<8;++t)if(0===(o&t)){for(let n=0;n<3;++n)r[n]=o&1<<n?0:t&1<<n?e[n]:i[n];s(r)}for(let e=0;e<3;++e)t[e]-=this.localOrigin[e],t[e+3]-=this.localOrigin[e];return t}};const h=(0,n.vt)(),l=(0,n.vt)(),u=(0,n.vt)(),d=(0,n.vt)(),p=(0,n.vt)()},75497(t,e,i){i.d(e,{$p:()=>s,Qx:()=>o,e_:()=>a});var r=i(51850),n=i(37957);class s{constructor(t=(0,r.Ul)()){this.intensity=t}}class o{constructor(t=(0,r.Ul)(),e=(0,r.fA)(.57735,.57735,.57735),i=!0,n=1,s=1){this.intensity=t,this.direction=e,this.castShadows=i,this.specularStrength=n,this.environmentStrength=s}}class a{constructor(){this.r=n.P.create(),this.g=n.P.create(),this.b=n.P.create()}clear(){this.r.fill(0),this.g.fill(0),this.b.fill(0)}}},57226(t,e,i){i.d(e,{TA:()=>y,uH:()=>x});var r=i(34727),n=i(35522),s=i(51850),o=i(75497);function a(t,e,i){i.length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e;return i}function c(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]+e[r];return i}var h=i(37957);const l=.28209479177;function u(t,e){(0,n.ze)(m,t.direction),function(t,e){const i=t[0],r=t[1],n=t[2],s=e||h.P.create();s[0]=l,s[1]=.4886025119*i,s[2]=.4886025119*n,s[3]=.4886025119*r,s[4]=1.09254843059*i*r,s[5]=1.09254843059*r*n,s[6]=.31539156525*(3*n*n-1),s[7]=1.09254843059*i*n,s[8]=.54627421529*(i*i-r*r)}(m,p),function(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e[r]}(p,g),a(p,t.intensity[0],f),c(e.r,f),a(p,t.intensity[1],f),c(e.g,f),a(p,t.intensity[2],f),c(e.b,f)}function d(t,e){e.r[0]+=l*g[0]*t.intensity[0]*4*Math.PI,e.g[0]+=l*g[0]*t.intensity[1]*4*Math.PI,e.b[0]+=l*g[0]*t.intensity[2]*4*Math.PI}const p=h.P.create(),f=h.P.create(),m=(0,s.vt)(),g=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];class _{constructor(){this.color=(0,s.vt)(),this.intensity=1}}class v{constructor(){this.direction=(0,s.vt)(),this.ambient=new _,this.diffuse=new _}}const x=.4;class y{constructor(){this._legacy=new v,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o.e_,this._mainLight=new o.Qx((0,s.vt)(),(0,s.fA)(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(t){(function(t,e,i){var r;i.clear(),(0,n.hZ)(e.intensity,0,0,0),r=t,Array.isArray(r)?Array.isArray(t)&&((0,n.C)(e.direction,t[0].direction),(0,n.C)(e.intensity,t[0].intensity),e.specularStrength=t[0].specularStrength,e.environmentStrength=t[0].environmentStrength,e.castShadows=t[0].castShadows,u(t[2],i),d(t[1],i)):d(t,i)})(t,this._mainLight,this._sphericalHarmonics),this.updateLegacy()}updateLegacy(){(0,n.C)(this._legacy.direction,this._mainLight.direction);const t=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*t,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*t,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*t,(0,n.hs)(this._legacy.diffuse.color,this._mainLight.intensity,t),(0,n.C)(b,this._legacy.diffuse.color),(0,n.hs)(b,b,x*this.globalFactor),(0,n.WQ)(this._legacy.ambient.color,this._legacy.ambient.color,b)}copyFrom(t){h.P.copy(this._sphericalHarmonics.r,t.sh.r),h.P.copy(this._sphericalHarmonics.g,t.sh.g),h.P.copy(this._sphericalHarmonics.b,t.sh.b),(0,n.C)(this._mainLight.direction,t.mainLight.direction),(0,n.C)(this._mainLight.intensity,t.mainLight.intensity),this._mainLight.castShadows=t.mainLight.castShadows,this._mainLight.specularStrength=t.mainLight.specularStrength,this._mainLight.environmentStrength=t.mainLight.environmentStrength,this.globalFactor=t.globalFactor,this.noonFactor=t.noonFactor}lerpLighting(t,e,i){if((0,n.Cc)(this._mainLight.intensity,t.mainLight.intensity,e.mainLight.intensity,i),this._mainLight.environmentStrength=(0,r.Cc)(t.mainLight.environmentStrength,e.mainLight.environmentStrength,i),this._mainLight.specularStrength=(0,r.Cc)(t.mainLight.specularStrength,e.mainLight.specularStrength,i),(0,n.C)(this._mainLight.direction,e.mainLight.direction),this._mainLight.castShadows=e.mainLight.castShadows,this.globalFactor=(0,r.Cc)(t.globalFactor,e.globalFactor,i),this.noonFactor=(0,r.Cc)(t.noonFactor,e.noonFactor,i),t.sh.r.length===e.sh.r.length)for(let n=0;n<e.sh.r.length;n++)this._sphericalHarmonics.r[n]=(0,r.Cc)(t.sh.r[n],e.sh.r[n],i),this._sphericalHarmonics.g[n]=(0,r.Cc)(t.sh.g[n],e.sh.g[n],i),this._sphericalHarmonics.b[n]=(0,r.Cc)(t.sh.b[n],e.sh.b[n],i);else for(let t=0;t<e.sh.r.length;t++)this._sphericalHarmonics.r[t]=e.sh.r[t],this._sphericalHarmonics.g[t]=e.sh.g[t],this._sphericalHarmonics.b[t]=e.sh.b[t];this.updateLegacy()}}const b=(0,s.vt)()},33442(t,e,i){i.d(e,{T:()=>u,s:()=>h});var r=i(49255);const n=l(-1),s=l(1),o=n,a=new Array;a[0]=null,a[1]=s,a[2]=n,a[3]=l(-2),a[4]=l(-3);const c=a.map(t=>function(t,e){return e?{factor:t.factor+e.factor,units:t.units+e.units}:t}(o,t));function h({output:t,enableOITOffset:e,polygonOffset:i}){return(0,r._$)(t)&&e?c[i]:a[i]}function l(t){return{factor:1*t,units:2*t}}function u(t){const e=h(t)??{factor:0,units:0};return{factor:e.factor+n.factor*t.polygonOffsetIndex,units:e.units+n.units*t.polygonOffsetIndex}}a[1]=s},47724(t,e,i){i.d(e,{L:()=>a});var r=i(5482),n=i(51976),s=i(34711);class o extends s.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,r.Cg)([(0,n.W)()],o.prototype,"hasHighlightMixTexture",void 0),(0,r.Cg)([(0,n.W)()],o.prototype,"emissionDimmingPass",void 0);class a extends o{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,r.Cg)([(0,n.W)({count:5})],a.prototype,"polygonOffset",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"transparent",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"enableOITOffset",void 0)},35622(t,e,i){i.d(e,{S:()=>a,p:()=>c}),i(34727),i(77690),i(29242),i(58083);var r=i(9093),n=(i(35522),i(51850)),s=(i(78955),i(91829),i(31756),i(26857),i(16943),i(65786));class o extends s.Y{constructor(t){super(),this.vvSize=t?.size??null,this.vvColor=t?.color??null,this.vvOpacity=t?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,r.vt)(),(0,n.vt)(),(0,r.vt)();class a extends o{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const c=8},43616(t,e,i){i.d(e,{MB:()=>c,Um:()=>h,kE:()=>o});var r=i(4576),n=i(34727),s=i(77194);function o(t,e,i,r,s,o){let a=i.screenLength*t.pixelRatio;null!=s&&(l.update(r,e,s,o),a=l.apply(a));const c=a*Math.tan(.5*t.fovY)/(.5*t.fullHeight);return(0,n.qE)(c*e,i.minWorldLength,i.maxWorldLength)}const a=(0,r.VO)();function c(t,e){let i=!1;for(const r in e){const n=e[r];void 0!==n&&(Array.isArray(n)?Array.isArray(t[r])&&a(n,t[r])||(t[r]=n.slice(),i=!0):t[r]!==n&&(i=!0,t[r]=n))}return i}const h={multiply:1,ignore:2,replace:3,tint:4},l=new s.PS},47630(t,e,i){i.d(e,{D:()=>d});var r=i(49255),n=i(22911),s=i(3871),o=i(63365),a=i(66211);function c(t,e){t.include(o.a),t.include(a.Hp,e),t.code.add("\n vec3 emissionFilter(in vec3 srcColor, float srcAlpha) {\n vec3 color = min(srcColor + vec3(1.0 - srcAlpha), 1.0);\n float m = max(color.r, max(color.g, color.b));\n return m > 0.0 ? color / m : vec3(1.0);\n }\n ")}var h=i(31821),l=i(26934),u=i(58243);function d(t,e){t.include(s.Q,e),t.include(n.NL,e);const{fragment:i,outputs:d}=t;i.include(o.a);const{output:p,hasEmission:f,oitPremultipliedAlpha:m,snowCover:g,emissionDimmingPass:_,renderOccluded:v}=e,x=11===p,y=(0,r._$)(p),b=(0,r.Rb)(p),w=(0,r._o)(p)&&!y,T=0!==p||v;let M=0;(w||y)&&d.add("fragColor","vec4",M++),y&&d.add("fragAlpha","float",M++),f&&d.add("fragEmission","vec4",M++),i.include(o.a),i.include(l.Q),i.include(a.Hp,e),i.include(u.t,e),_&&i.include(c,e),i.code.add(h.H`
|
|
249
|
+
}`)}function c(t){t.uniforms.add(new s.t("screenSizePerspective",t=>l(t.screenSizePerspective,t.screenSizePerspectiveMinPixelReferenceSize)))}function h(t){t.uniforms.add(new s.t("screenSizePerspectiveAlignment",t=>l(t.screenSizePerspectiveAlignment||t.screenSizePerspective,t.screenSizePerspectiveAlignment?null:t.screenSizePerspectiveMinPixelReferenceSize)))}function l(t,e){const i=null!=e&&null!=t?Math.min(t.minPixelSize/e,1):0;return t?(0,r.hZ)(u,t.divisor,t.offset,i):(0,r.hZ)(u,0,0,0)}const u=(0,n.vt)()},77949(t,e,i){i.d(e,{NB:()=>p,Nz:()=>_,S7:()=>g,yu:()=>d});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(23205),c=i(40710),h=i(33094),l=i(58029),u=i(97102);function d(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",o.uY):t.uniforms.add(new c.W("cameraPosition",(t,e)=>(0,s.hZ)(m,e.camera.viewInverseTransposeMatrix[3]-t.origin[0],e.camera.viewInverseTransposeMatrix[7]-t.origin[1],e.camera.viewInverseTransposeMatrix[11]-t.origin[2])))}function p(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new u.S("view",(t,e)=>(0,r.Tl)(f,e.camera.viewMatrix,t.origin)),new c.W("localOrigin",t=>t.origin));const i=({camera:t})=>(0,s.hZ)(m,t.viewInverseTransposeMatrix[3],t.viewInverseTransposeMatrix[7],t.viewInverseTransposeMatrix[11]);t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new l.F("view",t=>(0,r.Tl)(f,t.camera.viewMatrix,i(t))),new a.d("localOrigin",t=>i(t)))}const f=(0,n.vt)(),m=(0,o.vt)();function g(t){t.uniforms.add(new l.F("viewNormal",t=>t.camera.viewInverseTransposeMatrix))}function _(t){t.uniforms.add(new h.U("pixelRatio",t=>t.camera.pixelRatio/t.overlayStretch))}},77108(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",0,(r,n)=>r.setUniform2fv(t,e(n),i))}}},68259(t,e,i){i.d(e,{t:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",2,(r,n,s,o)=>r.setUniform2fv(t,e(n,s,o),i))}}},47286(t,e,i){i.d(e,{G:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec2",1,(r,n,s)=>r.setUniform2fv(t,e(n,s),i))}}},23205(t,e,i){i.d(e,{d:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec3",0,(r,n)=>r.setUniform3fv(t,e(n),i))}}},14314(t,e,i){i.d(e,{I:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",0,(r,n)=>r.setUniform4fv(t,e(n),i))}}},71988(t,e,i){i.d(e,{E:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"vec4",1,(r,n,s)=>r.setUniform4fv(t,e(n,s),i))}}},33094(t,e,i){i.d(e,{U:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"float",0,(r,n)=>r.setUniform1f(t,e(n),i))}}},44887(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i,r){super(t,"float",1,(e,n,s)=>e.setUniform1fv(t,i(n,s),r),e)}}},35818(t,e,i){i.d(e,{W:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",0,(i,r)=>i.setUniform1i(t,e(r)))}}},93588(t,e,i){i.d(e,{c:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"int",1,(i,r,n)=>i.setUniform1i(t,e(r,n)))}}},35644(t,e,i){i.d(e,{k:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat3",1,(r,n,s)=>r.setUniformMatrix3fv(t,e(n,s),i))}}},58029(t,e,i){i.d(e,{F:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",0,(r,n)=>r.setUniformMatrix4fv(t,e(n),i))}}},97102(t,e,i){i.d(e,{S:()=>n});var r=i(74333);class n extends r.n{constructor(t,e,i){super(t,"mat4",2,(r,n,s)=>r.setUniformMatrix4fv(t,e(n,s),i))}}},12791(t,e,i){i.d(e,{x:()=>n});var r=i(74333);class n extends r.n{constructor(t,e){super(t,"sampler2D",0,(i,r)=>i.bindTexture(t,e(r)))}}},13840(t,e,i){i.d(e,{r:()=>r});class r{constructor(t,e){this._module=t,this._load=e}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98958(t,e,i){i.d(e,{w:()=>f});var r=i(5482),n=i(69622),s=i(53966),o=i(91429),a=i(41976),c=(i(44208),i(26857)),h=i(94656);class l{constructor(t,e,i){this._context=t,this.locations=i,this._textures=new Map,this.source=(0,h.en)()?e:null,e.attributeNames.forEach(t=>{i.has(t)||s.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${t} used in shader`)}),this._glProgram=t.programCache.get(e.generate("vertex",!0),e.generate("fragment",!0),i),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=e.generateBind(this),this.bindPass=e.generateBindPass(this),this.bindDraw=e.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,e){this._glProgram.setUniform1i(t,e?1:0)}setUniform1i(t,e){this._glProgram.setUniform1i(t,e)}setUniform1f(t,e,i){this._glProgram.setUniform1f(t,e,i)}setUniform2fv(t,e,i){this._glProgram.setUniform2fv(t,e,i)}setUniform3fv(t,e,i){this._glProgram.setUniform3fv(t,e,i)}setUniform4fv(t,e,i){this._glProgram.setUniform4fv(t,e,i)}setUniformMatrix3fv(t,e,i){this._glProgram.setUniformMatrix3fv(t,e,!1,i)}setUniformMatrix4fv(t,e,i){this._glProgram.setUniformMatrix4fv(t,e,!1,i)}setUniformMatrices4fv(t,e,i){this._glProgram.setUniformMatrices4fv(t,e,!1,i)}setUniform1fv(t,e,i){this._glProgram.setUniform1fv(t,e,i)}setUniform1iv(t,e){this._glProgram.setUniform1iv(t,e)}setUniform2iv(t,e){this._glProgram.setUniform2iv(t,e)}setUniform3iv(t,e){this._glProgram.setUniform3iv(t,e)}setUniform4iv(t,e){this._glProgram.setUniform4iv(t,e)}assertCompatibleVertexAttributeLocations(t,e){if(c.b.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((e,r)=>t.set(r,i.size+e)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${i}, ${this.locations}`),this.locations.forEach((t,e)=>{i.get(e)!==t&&console.error(`VertexAttributeLocations are incompatible: Program has ${e} at position ${t}, VAO has it at position ${i.get(e)}.`)})}stop(){this._textures.clear()}bindTexture(t,e,i){if(!e?.glName){const i=`Texture sampler ${t} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(i),e=this._context.emptyTexture}const r=this._ensureTextureUnit(t,e);this._context.useProgram(this);const n=r.unit;this.setUniform1i(t,n),this._context.bindTexture(e,n,!1,i)}_ensureTextureUnit(t,e){let i=this._textures.get(t);return null==i?(i={texture:e,unit:this._textures.size},this._textures.set(t,i)):i.texture=e,i}}var u=i(63907),d=i(90644),p=i(85079);let f=class extends n.A{constructor(t,e,i){super({}),this._context=t,this._configuration=e,this.primitiveType=u.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=e.key,this.locations=(0,p.Xk)(i??a.lK),this._pipeline=this.initializePipeline(e),this.reload=async i=>{if(i&&await this.shader.reload(),!this.key.equals(e.key))return void s.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(e);r.debugName=this.declaredClass,this._program=new l(t.rctx,r,this.locations),this._pipeline=this.initializePipeline(e)}}initialize(){const t=this.shader.get().build(this._configuration);t.debugName=this.declaredClass,this._program=new l(this._context.rctx,t,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(t){this.program.assertCompatibleVertexAttributeLocations(t)}getPipeline(t,e,i){return this._pipeline}initializePipeline(t){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}};f=(0,r.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],f)},16943(t,e,i){i.d(e,{E:()=>n});var r=i(44208);function n(){return!!(0,r.A)("enable-feature:objectAndLayerId-rendering")}},41976(t,e,i){i.d(e,{lK:()=>a,wR:()=>o});var r=i(63907),n=i(85079),s=i(74038);const o=[],a=(new s._("position",3,r.pe.FLOAT,0,12),[new s._("position",2,r.pe.FLOAT,0,8)]);(0,n.Xk)(a),new s._("position",2,r.pe.FLOAT,0,12),new s._("uv0",2,r.pe.HALF_FLOAT,8,12),new s._("position",2,r.pe.FLOAT,0,16),new s._("uv0",2,r.pe.FLOAT,8,16)},92130(t,e,i){i.d(e,{A:()=>r});class r{constructor(t){this._material=t.material,this._techniques=t.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(t,e){return this._techniques.get(t,this._material.getConfiguration(e))}ensureResources(t){return 2}}},16613(t,e,i){i.d(e,{V:()=>M});var r=i(9093),n=i(35522),s=i(97146),o=i(46610),a=i(34275),c=i(20498);function h(t){if(t.length<a.y9)return Array.from(t);if(Array.isArray(t))return Float64Array.from(t);if(!("BYTES_PER_ELEMENT"in t))return Array.from(t);switch(t.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(t);case 2:return(0,a.LW)(t)?(0,c.pX)().from(t):(0,a.jq)(t)?Uint16Array.from(t):Int16Array.from(t);case 4:return(0,a.vZ)(t)?Float32Array.from(t):Uint32Array.from(t);default:return Float64Array.from(t)}}var l=i(15142),u=i(51850),d=i(620);class p{get center(){return(0,u.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,u.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,u.fA)(this._data[7],this._data[8],this._data[9])}constructor(t,e,i){this.primitiveIndices=t,this._numIndexPerPrimitive=e,this.position=i,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,d.vA)(t.length>=1),(0,d.vA)(3===i.size||4===i.size);const{data:r,size:s,indices:o}=i;(0,d.vA)(o.length%this._numIndexPerPrimitive===0),(0,d.vA)(o.length>=t.length*this._numIndexPerPrimitive);const a=t.length;let c=s*o[this._numIndexPerPrimitive*t[0]];f.clear(),f.push(c);const h=(0,u.fA)(r[c],r[c+1],r[c+2]),l=(0,u.o8)(h);for(let e=0;e<a;++e){const i=this._numIndexPerPrimitive*t[e];for(let t=0;t<this._numIndexPerPrimitive;++t){c=s*o[i+t],f.push(c);let e=r[c];h[0]=Math.min(e,h[0]),l[0]=Math.max(e,l[0]),e=r[c+1],h[1]=Math.min(e,h[1]),l[1]=Math.max(e,l[1]),e=r[c+2],h[2]=Math.min(e,h[2]),l[2]=Math.max(e,l[2])}}for(let t=0;t<3;++t)this._data[4+t]=h[t],this._data[7+t]=l[t];const p=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(l[0]-h[0],l[1]-h[1]),l[2]-h[2]),g=m*m;for(let t=0;t<f.length;++t){c=f.at(t);const e=r[c]-p[0],i=r[c+1]-p[1],n=r[c+2]-p[2],s=e*e+i*i+n*n;if(s<=g)continue;const o=Math.sqrt(s),a=.5*(o-m);m+=a,g=m*m;const h=a/o;p[0]+=e*h,p[1]+=i*h,p[2]+=n*h}this._data[3]=m;for(let t=0;t<3;++t)this._data[0+t]=p[t];f.clear()}getChildren(){if(this._children||(0,n.hG)(this.bbMin,this.bbMax)<=1)return this._children;const t=(0,n.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5),e=this.primitiveIndices.length,i=new Uint8Array(e),r=new Array(8);for(let t=0;t<8;++t)r[t]=0;const{data:s,size:o,indices:a}=this.position;for(let n=0;n<e;++n){let e=0;const c=this._numIndexPerPrimitive*this.primitiveIndices[n];let h=o*a[c],l=s[h],u=s[h+1],d=s[h+2];for(let t=1;t<this._numIndexPerPrimitive;++t){h=o*a[c+t];const e=s[h],i=s[h+1],r=s[h+2];e<l&&(l=e),i<u&&(u=i),r<d&&(d=r)}l<t[0]&&(e|=1),u<t[1]&&(e|=2),d<t[2]&&(e|=4),i[n]=e,++r[e]}let c=0;for(let t=0;t<8;++t)r[t]>0&&++c;if(c<2)return;const h=new Array(8);for(let t=0;t<8;++t)h[t]=r[t]>0?new Uint32Array(r[t]):void 0;for(let t=0;t<8;++t)r[t]=0;for(let t=0;t<e;++t){const e=i[t];h[e][r[e]++]=this.primitiveIndices[t]}this._children=new Array;for(let t=0;t<8;++t)void 0!==h[t]&&this._children.push(new p(h[t],this._numIndexPerPrimitive,this.position));return this._children}static prune(){f.prune()}}const f=new l.A({deallocator:null});var m=i(24326);class g{constructor(t){this.id=(0,m.c)(),this._attributes=new Map;for(const[e,i]of t)this._attributes.set(e,{...i,indices:(0,s.Dg)(i.indices)})}get attributes(){return this._attributes}}var _=i(48295);const v=(0,u.vt)(),x=(0,u.vt)(),y=(0,u.vt)(),b=(0,u.vt)();var w=i(17478),T=i(94656);class M extends g{constructor(t,e,i=null,r=0,n=null,s=-1,o,a){super(e),this.material=t,this.mapPositions=i,this.type=r,this.olidColor=n,this.edgeIndicesLength=s,this.baseGeometry=o,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,d.vA)((t?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match");const c=this.positionAttribute;null!=c&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=c.indices.length)}instantiate(t={}){const e=new M(t.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((t,i)=>{t.exclusive=!1,e._attributes.set(i,t)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:h(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const i=this._attributes.get(t);i?this._attributes.set(t,{...i,exclusive:!0,data:e}):(0,T.en)()&&console.warn(`Setting undefined attribute ${t} data`)}get primitivePositionIndices(){return void 0!==this._vertexPositionIndicesCache||(this._vertexPositionIndicesCache=this._computePrimitivePositionIndices()),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){const{drawIndices:t}=this,e=this.positionAttribute;if(null!=t&&null!=e){const i=new Array;for(const r of t)i.push(e.indices[r]);return i}return e?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const t=this.drawIndices??this.positionAttribute?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(t){return!!this._calculateAttachmentOrigin(t)&&(null!=this._transformation&&(0,n.Z0)(t,t,this._transformation),!0)}_calculateAttachmentOrigin(t){return 0===this.type?this._computeAttachmentOriginTriangles(t):2===this.type?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t)}_computeAttachmentOriginTriangles(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;return function(t,e,i){(0,n.hZ)(t,0,0,0),(0,n.hZ)(b,0,0,0);let r=0,s=0;for(let o=0;o<e;++o){i(v,x,y,o);const e=(0,_.BU)(v,x,y);e?((0,n.WQ)(v,v,x),(0,n.WQ)(v,v,y),(0,n.hs)(v,v,1/3*e),(0,n.WQ)(t,t,v),r+=e):((0,n.WQ)(b,b,v),(0,n.WQ)(b,b,x),(0,n.WQ)(b,b,y),s+=3)}return!(0===s&&0===r||(0!==r?((0,n.hs)(t,t,1/r),0):0===s||((0,n.hs)(t,b,1/s),0)))}(t,i.length/3,(t,e,o,a)=>{const c=3*a,h=i[c]*r,l=i[c+1]*r,u=i[c+2]*r;(0,n.hZ)(t,s[h],s[h+1],s[h+2]),(0,n.hZ)(e,s[l],s[l+1],s[l+2]),(0,n.hZ)(o,s[u],s[u+1],s[u+2])})}(t,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(t){const e=this.positionAttribute,i=this.primitivePositionIndices;return function(t,e,i,r=e?.indices){if(!e||!r)return!1;(0,n.hZ)(t,0,0,0),(0,n.hZ)(b,0,0,0);let s=0,o=0;const{size:a,data:c}=e,h=r.length-1,l=h+(i?2:0);for(let e=0;e<l;e+=2){const i=e<h?e+1:0,l=r[e<h?e:h]*a,u=r[i]*a;v[0]=c[l],v[1]=c[l+1],v[2]=c[l+2],x[0]=c[u],x[1]=c[u+1],x[2]=c[u+2],(0,n.hs)(v,(0,n.WQ)(v,v,x),.5);const d=(0,n.xg)(v,x);d>0?((0,n.WQ)(t,t,(0,n.hs)(v,v,d)),s+=d):0===s&&((0,n.WQ)(b,b,v),o++)}return 0!==s?((0,n.hs)(t,t,1/s),!0):0!==o&&((0,n.hs)(t,b,1/o),!0)}(t,e,function(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e.indices.length>2}(this.material.parameters,e),i)}_computeAttachmentOriginPoints(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:s}=e;(0,n.hZ)(t,0,0,0);let o=-1,a=0;for(let e=0;e<i.length;e++){const n=i[e]*r;o!==n&&(t[0]+=s[n],t[1]+=s[n+1],t[2]+=s[n+2],a++),o=n}return a>1&&(0,n.hs)(t,t,1/a),a>0}(t,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const t=this.positionAttribute,e=this.primitivePositionIndices;if(!t||!e||0===e.length)return null;const i=e===t.indices?t:new o.n(t.data,e,t.size,!1,t.stride),r=0===this.type?3:1;(0,d.vA)(e.length%r===0,"Indexing error: "+e.length+" not divisible by "+r);const n=(0,s.tM)(e.length/r);return new p(n,r,i)}get transformation(){return this._transformation??r.zK}set transformation(t){this._transformation=t&&t!==r.zK?(0,r.o8)(t):null}get highlights(){return this._highlights||A}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(t){this._highlightOptionsCounts?.forEach((e,i)=>t(i))}allocateIdAndHighlight(t){const e=new w.h(t);return this.addHighlight(e)}addHighlight(t){this._ensureHighlights().add(t);const{highlightName:e}=t,i=(this._highlightOptionsCounts?.get(e)??0)+1;return this._ensureHighlightOptionsCounts().set(e,i),t}_ensureHighlights(){let t=this._highlights;return t||(t=new Set,this._highlights=t),t}_ensureHighlightOptionsCounts(){let t=this._highlightOptionsCounts;return t||(t=new Map,this._highlightOptionsCounts=t),t}removeHighlight(t){if(this._highlights?.delete(t)){const{highlightName:e}=t,i=this._highlightOptionsCounts?.get(e)??0;i<=1?this._highlightOptionsCounts?.delete(e):this._ensureHighlightOptionsCounts().set(e,i-1)}}}const A=new Set},49718(t,e,i){i(51850),i(6867).i9},6867(t,e,i){i.d(e,{i9:()=>l});var r=i(58083),n=i(9093),s=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);class l{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,s.hs)(d,this.ray.direction,this.distance),(0,s.Bw)(d))}withinDistance(t){return!!u(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!u(this)&&((0,s.hs)(d,this.ray.direction,this.distance),(0,s.WQ)(t,this.ray.origin,d),!0)}getTransformedNormal(t){return(0,s.C)(p,this.normal),p[3]=0,(0,a.Z0)(p,p,this.transformation),(0,s.C)(t,p),(0,s.S8)(t,t)}constructor(t){this.intersector=4,this.normal=(0,o.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,h.vt)(),this.init(t)}init(t){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,h.C)(t,this._ray)}set(t,e,i,a,c,h,l){this.intersector=t,this.distance=i,(0,s.C)(this.normal,a??o.Cb),(0,r.C)(this.transformation,c??n.zK),this.target=e,this.drapedLayerOrder=h,this.renderPriority=l}copy(t){(0,h.C)(t.ray,this._ray),this.intersector=t.intersector,this.distance=t.distance,this.target=t.target,this.drapedLayerOrder=t.drapedLayerOrder,this.renderPriority=t.renderPriority,(0,s.C)(this.normal,t.normal),(0,r.C)(this.transformation,t.transformation)}}function u(t){return null!=t?.distance}const d=(0,o.vt)(),p=(0,c.vt)()},18845(t,e,i){i.d(e,{h:()=>U});var r=i(49186),n=i(65529),s=i(97768),o=i(17676),a=i(34275),c=i(24326),h=i(84952),l=i(38969),u=i(31217),d=i(95117),p=i(2741);let f;var m=i(63907),g=i(21231),_=i(42293);let v=null,x=null;async function y(){return null==x&&(f??=(async()=>{const t=await i.e(9321).then(i.bind(i,49321)),e=await t.default({locateFile:t=>(0,p.s)(`esri/libs/basisu/${t}`)});return e.initializeBasis(),e})(),x=f,v=await x),x}function b(t,e){if(null==v)return t.byteLength;const i=new v.BasisFile(new Uint8Array(t)),r=M(i)?T(i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),e):0;return i.close(),i.delete(),r}function w(t,e){if(null==v)return t.byteLength;const i=new v.KTX2File(new Uint8Array(t)),r=A(i)?T(i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),e):0;return i.close(),i.delete(),r}function T(t,e,i,r,n){const s=(0,_.MW)(e?m.CQ.COMPRESSED_RGBA8_ETC2_EAC:m.CQ.COMPRESSED_RGB8_ETC2),o=n&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(i*r*s*o)}function M(t){return t.getNumImages()>=1&&!t.isUASTC()}function A(t){return t.getFaces()>=1&&(t.isETC1S()||t.isUASTC())}function C(t,e,i,r,n,s,o,a){const{compressedTextureETC:c,compressedTextureS3TC:h}=t.capabilities,[l,u]=c?r?[1,m.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,m.CQ.COMPRESSED_RGB8_ETC2]:h?r?[3,m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=e.hasMipmap?i:Math.min(1,i),p=[];for(let t=0;t<d;t++)p.push(new Uint8Array(o(t,l))),a(t,l,p[t]);return e.internalFormat=u,e.hasMipmap=p.length>1,e.samplingMode=e.hasMipmap?9987:9729,e.width=n,e.height=s,new g.A(t,e,{type:"compressed",levels:p})}var S=i(53966);const E=()=>S.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}const I=R("DXT1"),O=R("DXT3"),D=R("DXT5");function P(t,e){const i=new Int32Array(t.buffer,t.byteOffset,31);if(542327876!==i[0])return E().error("Invalid magic number in DDS header"),null;if(!(4&i[20]))return E().error("Unsupported format, must contain a FourCC code"),null;const r=i[21];let n,s;switch(r){case I:n=8,s=m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case O:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case D:n=16,s=m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return E().error("Unsupported FourCC code:",function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}(r)),null}let o=1,a=i[4],c=i[3];(3&a||3&c)&&(E().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const h=a,l=c;let u,d;131072&i[2]&&!1!==e&&(o=Math.max(1,i[7]));let p=t.byteOffset+i[1]+4;const f=[];for(let e=0;e<o;++e)d=(a+3>>2)*(c+3>>2)*n,u=new Uint8Array(t.buffer,p,d),f.push(u),p+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:f},internalFormat:s,width:h,height:l}}var F=i(78988),N=i(620),L=i(67171),B=i(12541);class U{constructor(t,e){this._data=t,this.id=(0,c.c)(),this.events=new n.bk,this._parameters={...V,...e},this._startPreload(t)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(t){t instanceof HTMLVideoElement?(this.update=e=>this._update(t,e),this._startPreloadVideoElement(t)):t instanceof HTMLImageElement&&this._startPreloadImageElement(t)}_startPreloadVideoElement(t){if(!((0,h.w8)(t.src)||"auto"===t.preload&&t.crossOrigin)&&(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src,t.paused&&t.autoplay)){const e=[];(0,l.i)(t,t=>e.push(t)).then(()=>{t.play()}).finally(()=>e.forEach(t=>t.remove()))}}_startPreloadImageElement(t){(0,h.DB)(t.src)||(0,h.w8)(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}_createDescriptor(t){const e=new L.R;return e.wrapMode=this._parameters.wrap??10497,e.flipped=!this._parameters.noUnpackFlip,e.samplingMode=this._parameters.mipmap?9987:9729,e.hasMipmap=!!this._parameters.mipmap,e.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,e.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?t.parameters.maxMaxAnisotropy:1),e.dataType=this._parameters.dataType??e.dataType,e.pixelFormat=this._parameters.pixelFormat??e.pixelFormat,e.internalFormat=this._parameters.internalFormat??e.internalFormat,e.isImmutable=!0===this._parameters.immutable&&function(t){return null!=t&&((0,B.tl)(t)||(0,B.tr)(t)||(0,B.CR)(t)||(0,B.QJ)(t))}(this._parameters.internalFormat),e}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(t,e){if(null==t)return 0;if((0,a.mw)(t)||(0,a.mg)(t))return"image/ktx2"===e.encoding?w(t,!!e.mipmap):"image/x.basis"===e.encoding?b(t,!!e.mipmap):t.byteLength;const{width:i,height:r}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?H(t):e,n=e.pixelFormat??6408,s=(0,_.wH)(n);return(e.mipmap?4/3:1)*i*r*s||0}(this._data,this._parameters)}load(t){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const e=this._data;return null==e?(this._texture=new g.A(t,this._createDescriptor(t),null),this._texture):(this._emptyTexture=t.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof e?this._loadFromURL(t,e):e instanceof Image?this._loadFromImageElement(t,e):e instanceof HTMLVideoElement?this._loadFromVideoElement(t,e):e instanceof ImageData||e instanceof HTMLCanvasElement?this._loadFromImage(t,e):(0,a.mg)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,e):(0,a.mw)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,new Uint8Array(e)):((0,a.mw)(e)||(0,a.mg)(e))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(t,e):((0,a.mw)(e)||(0,a.mg)(e))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(t,e):(0,a.mw)(e)?this._loadFromPixelData(t,new Uint8Array(e)):(0,a.iu)(e)?this._loadFromPixelData(t,e):null)}_update(t,e){return null==this._texture||t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e===t.currentTime?e:(this._texture.setData(t),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),t.currentTime)}_loadFromDDSData(t,e){return this._texture=function(t,e,i){const r=P(i,e.hasMipmap??!1);if(null==r)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:s,width:o,height:a}=r;return e.samplingMode=n.levels.length>1?9987:9729,e.hasMipmap=n.levels.length>1,e.internalFormat=s,e.width=o,e.height=a,new g.A(t,e,n)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX2(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await y());const r=new v.KTX2File(new Uint8Array(i));if(!A(r))return null;r.startTranscoding();const n=C(t,e,r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),(t,e)=>r.getImageTranscodedSizeInBytes(t,0,0,e),(t,e,i)=>r.transcodeImage(i,t,0,0,e,0,-1,-1));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromBasis(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await y());const r=new v.BasisFile(new Uint8Array(i));if(!M(r))return null;r.startTranscoding();const n=C(t,e,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(t,e)=>r.getImageTranscodedSizeInBytes(0,t,e),(t,e,i)=>r.transcodeImage(i,0,t,e,0,0));return r.close(),r.delete(),n}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromPixelData(t,e){(0,N.vA)(this._parameters.width>0&&this._parameters.height>0);const i=this._createDescriptor(t);return 6407!==i.pixelFormat&&6408!==i.pixelFormat||(i.compress=this._parameters.compressionOptions),i.width=this._parameters.width??0,i.height=this._parameters.height??0,this._texture=new g.A(t,i,e),this._texture}_loadFromURL(t,e){return this._loadAsync(async i=>{const r=await(0,u.D)(e,{signal:i});return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromImageElement(t,e){return e.complete?this._loadFromImage(t,e):this._loadAsync(async i=>{const r=await(0,d.y)(e,e.src,!1,i);return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromVideoElement(t,e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(t,e):this._loadFromVideoElementAsync(t,e)}_loadFromVideoElementAsync(t,e){return this._loadAsync(i=>new Promise((n,a)=>{const c=()=>{e.removeEventListener("loadeddata",h),e.removeEventListener("error",l),(0,s.xt)(u)},h=()=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(t,e)))},l=t=>{c(),a(t||new r.A("texture:load-error","Failed to load video"))};e.addEventListener("loadeddata",h),e.addEventListener("error",l);const u=(0,o.u7)(i,()=>l((0,o.NK)()))}))}_loadFromImage(t,e){let i=e;i instanceof HTMLVideoElement||(i=(0,F.vM)(i,t.parameters));const r=H(i);this._parameters.width=r.width,this._parameters.height=r.height;const n=this._createDescriptor(t);return n.width=r.width,n.height=r.height,n.compress=this._parameters.compressionOptions,this._texture=new g.A(t,n,i),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(t){const e=new AbortController;this._loadingController=e;const i=t(e.signal);this._loadingPromise=i;const r=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===i&&(this._loadingPromise=null),this._emptyTexture=null};return i.then(r,r),i}unload(){if(this._texture=(0,s.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function H(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}const V={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},11725(t,e,i){i.d(e,{i:()=>a});var r=i(24326),n=i(49255),s=i(43616),o=i(65786);class a{constructor(t,e){this.id=(0,r.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new e,(0,s.MB)(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(t){return!1}setParameters(t,e=!0){(0,s.MB)(this._parameters,t)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(t){}shouldRender(t){return this.visible&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bind.decorations)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&&(this._renderPriority=t,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(t){return this.updateConfiguration(t),this._configuration}updateConfiguration(t){this._configuration.output=t.output,this._configuration.hasEmission=t.hasEmission&&(0,n._o)(t.output),this._configuration.hasHighlightMixTexture=10===t.output&&null!=t.highlightMixTexture,this._configuration.useFloatBlend=t.useFloatBlend.value,this._configuration.emissionDimmingPass=t.transparentWithoutDepthEmissionDimmingPass&&(0,n._o)(t.output)}}o.Y},17478(t,e,i){i.d(e,{h:()=>s,p:()=>o});var r=i(24326);class n{constructor(){this.uid=(0,r.c)()}}class s extends n{constructor(t){super(),this.highlightName=t,this.channel=0}}class o extends n{constructor(){super(...arguments),this.channel=1}}},33524(t,e,i){i.d(e,{Yf:()=>a,mt:()=>h,z5:()=>c});var r=i(91829),n=i(49255),s=i(90644);const o=(0,s.p3)(1,0,1,771);function a(t,e=!1,i=!1){if(i)return s.uR;switch(t){case 0:return e?s.RC:s.T8;case 1:return o;default:return null}}function c(t){if(t.draped)return null;switch(t.output){case 0:case 2:default:return t.writeDepth?s.Uy:null;case 1:return null}}function h(t,e=513){return{func:(0,n._$)(t)?515:e}}(0,r._Y)()},56133(t,e,i){i.d(e,{Ax:()=>h,Q0:()=>u,cP:()=>c,iB:()=>l,m:()=>n,r8:()=>a,sf:()=>s,v0:()=>o});var r=i(90644);const n={func:513},s={func:519},o={mask:255},a={mask:0},c=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),h=(0,r.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681}),l=(0,r.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),u=(0,r.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680})},83252(t,e,i){i.d(e,{F:()=>r});const r=1e3},58964(t,e,i){i.d(e,{AH:()=>g,SB:()=>d,Vh:()=>p,jP:()=>f,q6:()=>_,yx:()=>m});var r=i(90629),n=i(35522),s=i(51850),o=i(19419),a=i(11964),c=i(27921),h=i(48295);class l{constructor(t,e,i){this.bounds=t,this.nearestDistance=e,this.nearestPoint=i}}function u(t,e){return t.isRectangle?(0,o.Uc)(t.bounds,e):y(e,t.points)}function d(t,e){if(!(0,o.HY)(t.bounds,e))return!1;if(t.isRectangle)return!0;for(const i of t.points)if((0,o.Uc)(e,i))return!0;for(let i=0;i<4;i++)if(y(C(E,e,i),t.points))return!0;for(let i=0;i<t.points.length;i++){const r=t.points[i],n=i===t.points.length-1?t.points[0]:t.points[i+1];for(let t=0;t<4;t++)if(b(r,n,C(E,e,t),C(R,e,(t+1)%4)))return!0}return!1}function p(t,e,i,r){const n=Math.min(e[0],i[0],r[0]),s=Math.min(e[1],i[1],r[1]),a=Math.max(e[0],i[0],r[0]),c=Math.max(e[1],i[1],r[1]);if(!d(t,(0,o.fA)(n,s,a,c,S)))return!1;if(u(t,e)||u(t,i)||u(t,r))return!0;for(const n of t.points)if((0,h.cq)(e,i,r,n,V))return!0;for(let n=0;n<t.points.length;n++){const s=t.points[n],o=t.points[(n+1)%t.points.length];if(b(e,i,s,o)||b(i,r,s,o)||b(r,e,s,o))return!0}return!1}function f(t,e,i,r){const n=Math.min(e[0],i[0])-r,s=Math.min(e[1],i[1])-r,a=Math.max(e[0],i[0])+r,c=Math.max(e[1],i[1])+r;if(!(0,o.HY)(t.bounds,(0,o.fA)(n,s,a,c,S)))return!1;if(u(t,e)||u(t,i))return!0;const h=r*r;for(const r of t.points)if(T(r,e,i)<=h)return!0;for(let r=0;r<t.points.length;r++){const n=t.points[r],s=t.points[(r+1)%t.points.length];if(b(e,i,n,s)||w(e,i,n,s)<=h)return!0}return!1}function m(t,e,i){return g(t,e.bbMin,e.bbMax,i)}function g(t,e,i,r){const a=(0,o.Ie)(S);H.reset(t.eye);let c=0;for(let s=0;s<2;s++)for(let h=0;h<2;h++)for(let l=0;l<2;l++)D[0]=0===s?e[0]:i[0],D[1]=0===h?e[1]:i[1],D[2]=0===l?e[2]:i[2],r&&(0,n.Z0)(D,D,r),(0,n.C)(B[c++],D),v(t,D)||(t.projectToScreen(D,E),(0,o.tK)(a,E),H.addNearestCandidate(D));return function(t,e,i,r){for(let n=0;n<i.length;n++)for(const s of U){const a=n|s;a!==n&&x(t,i[n],i[a],P)&&(t.projectToScreen(P,E),(0,o.tK)(e,E),r.addNearestCandidate(P))}}(t,a,B,H),H.valid?new l((0,o.o8)(a),H.distance,(0,s.o8)(H.point)):null}function _(t,e,i,r,s){(0,n.C)(P,e),(0,n.C)(F,i);const o=t.projectToRenderScreen(P,I),a=t.projectToRenderScreen(F,O);if(null==o||null==a)return!1;const c=v(t,P),h=v(t,F);if(c&&h)return!1;if(c!==h){const e=c?P:F,i=c?o:a;if(!function(t,e,i){return x(t,e,i,e)}(t,e,c?F:P))return!1;if(!t.projectToRenderScreen(e,i))return!1}return r[0]=o[0],r[1]=o[1],r[2]=0,s[0]=a[0],s[1]=a[1],s[2]=0,!0}function v(t,e){return function(t,e){return(0,c.mN)(t.frustum[4],e)}(t,e)>0}function x(t,e,i,r){return(0,c.T7)(t.frustum[4],(0,a.Cr)(e,i,L),r)}function y(t,e){let i=!1;for(let r=0,n=e.length-1;r<e.length;n=r++){const s=e[r],o=e[n];if(s[1]>t[1]==o[1]>t[1])continue;const a=(o[0]-s[0])*(t[1]-s[1])/(o[1]-s[1])+s[0];t[0]<a&&(i=!i)}return i}function b(t,e,i,r){const n=M(t,e,i),s=M(t,e,r),o=M(i,r,t),a=M(i,r,e);return n!==s&&o!==a||0===n&&A(t,e,i)||0===s&&A(t,e,r)||0===o&&A(i,r,t)||0===a&&A(i,r,e)}function w(t,e,i,r){return b(t,e,i,r)?0:Math.min(T(t,i,r),T(e,i,r),T(i,t,e),T(r,t,e))}function T(t,e,i){return(0,a.kb)((0,a.Cr)((0,n.hZ)(P,e[0],e[1],0),(0,n.hZ)(F,i[0],i[1],0),L),(0,n.hZ)(N,t[0],t[1],0))}function M(t,e,i){const r=(e[1]-t[1])*(i[0]-e[0])-(e[0]-t[0])*(i[1]-e[1]);return Math.abs(r)<=V?0:Math.sign(r)}function A(t,e,i){return i[0]>=Math.min(t[0],e[0])-V&&i[0]<=Math.max(t[0],e[0])+V&&i[1]>=Math.min(t[1],e[1])-V&&i[1]<=Math.max(t[1],e[1])+V}function C(t,e,i){return t[0]=0===i||3===i?e[0]:e[2],t[1]=i<2?e[1]:e[3],t}const S=(0,o.vt)(),E=(0,r.gs)(),R=(0,r.gs)(),I=(0,r.r_)(),O=(0,r.r_)(),D=(0,s.vt)(),P=(0,s.vt)(),F=(0,s.vt)(),N=(0,s.vt)(),L=(0,a.vt)(),B=[(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)()],U=[1,2,4],H=new class{constructor(){this._origin=(0,s.vt)(),this.point=(0,s.vt)(),this.distance=Number.POSITIVE_INFINITY}get valid(){return Number.isFinite(this.distance)}addNearestCandidate(t){const e=(0,n.Io)(this._origin,t);e<this.distance&&(this.distance=e,(0,n.C)(this.point,t))}reset(t){this.distance=Number.POSITIVE_INFINITY,(0,n.C)(this._origin,t)}},V=1e-9},75956(t,e,i){i.d(e,{MJ:()=>d,Uq:()=>u});var r=i(90629),n=i(35522),s=i(51850),o=i(70328),a=i(27921),c=i(48295),h=i(83252),l=i(58964);class u{constructor(){this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,s.vt)(),this.normal=(0,s.vt)()}reset(){this.distance=Number.POSITIVE_INFINITY}update(t,e,i,r){this.distance=t,this.primitiveIndex=e,(0,n.C)(this.point,i),this.hasNormal=null!=r,null!=r&&(0,n.C)(this.normal,r)}updateIfCloserFromValues(t,e,i,r){t<this.distance&&this.update(t,e,i,r)}updateIfCloser(t){const{distance:e,primitiveIndex:i,point:r,normal:n}=t;this.updateIfCloserFromValues(e,i,r,t.hasNormal?n:null)}get valid(){return Number.isFinite(this.distance)}}function d(t,e,i,r,n){if(!t.visible||0!==t.type)return null;const s=new u;let o;if(t.boundingInfo)o=f(t.boundingInfo,e,i,r,n);else{const s=t.positionAttribute,a=t.primitivePositionIndices;o=p(e,i,r,0,a.length/3,a,s.data,s.stride,n,null,0)}for(const t of o)s.updateIfCloser(t);return s.valid?s:null}function*p(t,e,i,r,s,o,h,l,u,d=null,p=0){return yield*function*(t,e,i,r,s){if(null==t.camera)return;const{camera:o,screenPolygonPrimitiveProcessor:h}=t;for(let t=i;t<r;++t){const i=s(x[0],x[1],x[2],t),r=T;let l;A.reset();for(const{list:t,count:s}of h.processTriangle(C,x)){const h=(0,a.H)(o.frustum[4],t,s,y,!1);if(!(h<3)){for(let t=0;t<h;t++)o.projectToScreen(y[t],b[t]);g(e,b,h)&&(_(o.eye,y,h,w),null==l&&(l=(0,c.rb)(T,x[0],x[1],x[2])),A.updateIfCloserFromValues((0,n.Io)(o.eye,w),i,w,l?r:null))}}A.valid&&(yield A)}}(t,i,r,s,(t,i,r,n)=>{const s=(d?.[n]??n)+p,a=null==d?s:n,c=3*s;return m(t,o,h,l,c+0,u,a,e),m(i,o,h,l,c+1,u,a,e),m(r,o,h,l,c+2,u,a,e),s})}function*f(t,e,i,r,n){const s=e.camera,a=null!=n?((0,o.Ne)(v,t.bbMin),(0,o.vI)(v,t.bbMax),n.applyToAabb(v),(0,l.AH)(s,(0,o.pg)(v,x[0]),(0,o.Lu)(v,x[1]),i)):(0,l.yx)(s,t,i);if(null==a||!(0,l.SB)(r,a.bounds))return;const{primitiveIndices:c,position:u}=t,d=c?c.length:u.indices.length/3;if(d>h.F){const s=t.getChildren();if(void 0!==s){for(const t of s)yield*f(t,e,i,r,n);return}}yield*p(e,i,r,0,d,u.indices,u.data,u.stride,n,c,0)}function m(t,e,i,r,s,o,a,c){const h=r*e[s],l=i[h+0],u=i[h+1],d=i[h+2];null!=o?o.applyToVertex(t,l,u,d,a):(0,n.hZ)(t,l,u,d),c&&(0,n.Z0)(t,t,c)}function g(t,e,i){for(let r=1;r<i-1;r++)if((0,l.Vh)(t,e[0],e[r],e[r+1]))return!0;return!1}function _(t,e,i,r){let s=Number.POSITIVE_INFINITY;for(let o=1;o<i-1;o++){(0,c.k3)(M,t,e[0],e[o],e[o+1]);const i=(0,n.hG)(t,M);i<s&&(s=i,(0,n.C)(r,M))}}const v=(0,o.vt)(),x=[(0,s.vt)(),(0,s.vt)(),(0,s.vt)()],y=Array.from({length:12},()=>(0,s.vt)()),b=Array.from({length:12},()=>(0,r.gs)()),w=(0,s.vt)(),T=(0,s.vt)(),M=(0,s.vt)(),A=new u,C={list:[],count:0}},77194(t,e,i){i.d(e,{PS:()=>n}),i(44208);var r=i(34727);class n{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(t,e,i,r){i?(this._scale=Math.min(i.divisor/(e-i.offset),1),this._angleFactor=function(t){return Math.abs(t)**3}(t),this._minScale=null!=r?Math.min(i.minPixelSize/r,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(t){const{_scale:e,_angleFactor:i,_minScale:n}=this;return t*(0,r.qE)((0,r.Cc)(e,1,i),n,1)}applyVec2(t,e){t[0]=this.apply(e[0]),t[1]=this.apply(e[1])}}},78988(t,e,i){i.d(e,{Mv:()=>n,vM:()=>s});var r=i(49186);function n(t,e){return e=16*Math.floor(e/16),Math.min(16*Math.round(t/16),e)}function s(t,e){const[i,r]=o(t,e);return t.width===i&&t.height===r?t:a(t,i,r)}function o({width:t,height:e},{maxPreferredTexturePixels:i,maxTextureSize:r}){const s=Math.max(t,e),o=t*e;if(s<=r&&o<=i)return[t,e];const a=Math.min(Math.sqrt(i/o),r/s);return[n(Math.round(t*a),r),n(Math.round(e*a),r)]}function a(t,e,i){if(t instanceof ImageData)return a(function(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");if(null==i)throw new r.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return i.putImageData(t,0,0),e}(t),e,i);const n=document.createElement("canvas");return n.width=e,n.height=i,n.getContext("2d").drawImage(t,0,0,n.width,n.height),n}},16396(t,e,i){i.d(e,{ou:()=>c}),i(77690),i(29242),i(58083),i(9093);var r=i(35522),n=i(51850),s=i(94008),o=i(57005);const a=new class{constructor(t=0){this.offset=t,this._tmpSphere=new s.iy}applyToVertex(t,e,i,n){const s=this.objectTransform.transform,o=(0,r.hZ)(h,e,i,n),a=(0,r.Z0)(o,o,s),c=this.offset/(0,r.Bw)(a);(0,r.Ln)(a,a,a,c);const l=this.objectTransform.inverse;return(0,r.Z0)(t,a,l),t}applyToMinMax(t,e){const i=this.offset/(0,r.Bw)(t);(0,r.Ln)(t,t,t,i);const n=this.offset/(0,r.Bw)(e);(0,r.Ln)(e,e,e,n)}applyToAabb(t){const e=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*e,t[1]+=t[1]*e,t[2]+=t[2]*e;const i=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*i,t[4]+=t[4]*i,t[5]+=t[5]*i,t}applyToBoundingSphere(t){const e=t.center,i=(0,r.Bw)(e),n=this.offset/i;return(0,r.Ln)(this._tmpSphere.center,e,e,n),this._tmpSphere.radius=t.radius+t.radius*this.offset/i,this._tmpSphere}};function c(t){return null!=t?(a.offset=t,a):null}new class{constructor(t=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpMbs=new s.iy,this._tmpObb=new o.ab,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=(0,r.Bw)(t)}applyToVertex(t,e,i,n){const s=(0,r.hZ)(h,e,i,n),o=(0,r.hZ)(l,e,i,n+this.componentLocalOriginLength),a=this._totalOffset/(0,r.Bw)(o);return(0,r.Ln)(t,s,o,a),t}applyToAabb(t){const e=this.componentLocalOriginLength,i=t[0],r=t[1],n=t[2]+e,s=t[3],o=t[4],a=t[5]+e,c=Math.abs(i),h=Math.abs(r),l=Math.abs(n),u=Math.abs(s),d=Math.abs(o),p=Math.abs(a),f=.5*(1+Math.sign(i*s))*Math.min(c,u),m=.5*(1+Math.sign(r*o))*Math.min(h,d),g=.5*(1+Math.sign(n*a))*Math.min(l,p),_=Math.sqrt(f*f+m*m+g*g),v=Math.sign(c+i),x=Math.sign(h+r),y=Math.sign(l+n),b=Math.sign(u+s),w=Math.sign(d+o),T=Math.sign(p+a),M=this._totalOffset;if(_<M)return t[0]-=(1-v)*M,t[1]-=(1-x)*M,t[2]-=(1-y)*M,t[3]+=b*M,t[4]+=w*M,t[5]+=T*M,t;const A=Math.max(c,u),C=Math.max(h,d),S=Math.max(l,p),E=M/Math.sqrt(A*A+C*C+S*S),R=M/_,I=R-E,O=-I;return t[0]+=i*(v*O+R),t[1]+=r*(x*O+R),t[2]+=n*(y*O+R),t[3]+=s*(b*I+E),t[4]+=o*(w*I+E),t[5]+=a*(T*I+E),t}applyToMbs(t){const e=t.center,i=(0,r.Bw)(e),n=this._totalOffset/i;return(0,r.Ln)(this._tmpMbs.center,e,e,n),this._tmpMbs.radius=t.radius+t.radius*this._totalOffset/i,this._tmpMbs}applyToObb(t){return(0,o.gm)(t,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(t=0){this.offset=t,this._tmpVertex=(0,n.vt)()}applyToVertex(t,e,i,n){const s=(0,r.hZ)(h,e,i,n),o=(0,r.WQ)(l,s,this.localOrigin),a=this.offset/(0,r.Bw)(o);return(0,r.Ln)(t,s,o,a),t}applyToAabb(t){const e=u,i=d,r=p;for(let n=0;n<3;++n)e[n]=t[0+n]+this.localOrigin[n],i[n]=t[3+n]+this.localOrigin[n],r[n]=e[n];const n=this.applyToVertex(this._tmpVertex,e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=n[e],t[e+3]=n[e];const s=e=>{const i=this.applyToVertex(this._tmpVertex,e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],i[e]),t[e+3]=Math.max(t[e+3],i[e])};for(let t=1;t<8;++t){for(let n=0;n<3;++n)r[n]=t&1<<n?i[n]:e[n];s(r)}let o=0;for(let t=0;t<3;++t)e[t]*i[t]<0&&(o|=1<<t);if(0!==o&&7!==o)for(let t=0;t<8;++t)if(0===(o&t)){for(let n=0;n<3;++n)r[n]=o&1<<n?0:t&1<<n?e[n]:i[n];s(r)}for(let e=0;e<3;++e)t[e]-=this.localOrigin[e],t[e+3]-=this.localOrigin[e];return t}};const h=(0,n.vt)(),l=(0,n.vt)(),u=(0,n.vt)(),d=(0,n.vt)(),p=(0,n.vt)()},75497(t,e,i){i.d(e,{$p:()=>s,Qx:()=>o,e_:()=>a});var r=i(51850),n=i(37957);class s{constructor(t=(0,r.Ul)()){this.intensity=t}}class o{constructor(t=(0,r.Ul)(),e=(0,r.fA)(.57735,.57735,.57735),i=!0,n=1,s=1){this.intensity=t,this.direction=e,this.castShadows=i,this.specularStrength=n,this.environmentStrength=s}}class a{constructor(){this.r=n.P.create(),this.g=n.P.create(),this.b=n.P.create()}clear(){this.r.fill(0),this.g.fill(0),this.b.fill(0)}}},57226(t,e,i){i.d(e,{TA:()=>y,uH:()=>x});var r=i(34727),n=i(35522),s=i(51850),o=i(75497);function a(t,e,i){i.length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e;return i}function c(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]+e[r];return i}var h=i(37957);const l=.28209479177;function u(t,e){(0,n.ze)(m,t.direction),function(t,e){const i=t[0],r=t[1],n=t[2],s=e||h.P.create();s[0]=l,s[1]=.4886025119*i,s[2]=.4886025119*n,s[3]=.4886025119*r,s[4]=1.09254843059*i*r,s[5]=1.09254843059*r*n,s[6]=.31539156525*(3*n*n-1),s[7]=1.09254843059*i*n,s[8]=.54627421529*(i*i-r*r)}(m,p),function(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e[r]}(p,g),a(p,t.intensity[0],f),c(e.r,f),a(p,t.intensity[1],f),c(e.g,f),a(p,t.intensity[2],f),c(e.b,f)}function d(t,e){e.r[0]+=l*g[0]*t.intensity[0]*4*Math.PI,e.g[0]+=l*g[0]*t.intensity[1]*4*Math.PI,e.b[0]+=l*g[0]*t.intensity[2]*4*Math.PI}const p=h.P.create(),f=h.P.create(),m=(0,s.vt)(),g=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];class _{constructor(){this.color=(0,s.vt)(),this.intensity=1}}class v{constructor(){this.direction=(0,s.vt)(),this.ambient=new _,this.diffuse=new _}}const x=.4;class y{constructor(){this._legacy=new v,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o.e_,this._mainLight=new o.Qx((0,s.vt)(),(0,s.fA)(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(t){(function(t,e,i){var r;i.clear(),(0,n.hZ)(e.intensity,0,0,0),r=t,Array.isArray(r)?Array.isArray(t)&&((0,n.C)(e.direction,t[0].direction),(0,n.C)(e.intensity,t[0].intensity),e.specularStrength=t[0].specularStrength,e.environmentStrength=t[0].environmentStrength,e.castShadows=t[0].castShadows,u(t[2],i),d(t[1],i)):d(t,i)})(t,this._mainLight,this._sphericalHarmonics),this.updateLegacy()}updateLegacy(){(0,n.C)(this._legacy.direction,this._mainLight.direction);const t=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*t,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*t,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*t,(0,n.hs)(this._legacy.diffuse.color,this._mainLight.intensity,t),(0,n.C)(b,this._legacy.diffuse.color),(0,n.hs)(b,b,x*this.globalFactor),(0,n.WQ)(this._legacy.ambient.color,this._legacy.ambient.color,b)}copyFrom(t){h.P.copy(this._sphericalHarmonics.r,t.sh.r),h.P.copy(this._sphericalHarmonics.g,t.sh.g),h.P.copy(this._sphericalHarmonics.b,t.sh.b),(0,n.C)(this._mainLight.direction,t.mainLight.direction),(0,n.C)(this._mainLight.intensity,t.mainLight.intensity),this._mainLight.castShadows=t.mainLight.castShadows,this._mainLight.specularStrength=t.mainLight.specularStrength,this._mainLight.environmentStrength=t.mainLight.environmentStrength,this.globalFactor=t.globalFactor,this.noonFactor=t.noonFactor}lerpLighting(t,e,i){if((0,n.Cc)(this._mainLight.intensity,t.mainLight.intensity,e.mainLight.intensity,i),this._mainLight.environmentStrength=(0,r.Cc)(t.mainLight.environmentStrength,e.mainLight.environmentStrength,i),this._mainLight.specularStrength=(0,r.Cc)(t.mainLight.specularStrength,e.mainLight.specularStrength,i),(0,n.C)(this._mainLight.direction,e.mainLight.direction),this._mainLight.castShadows=e.mainLight.castShadows,this.globalFactor=(0,r.Cc)(t.globalFactor,e.globalFactor,i),this.noonFactor=(0,r.Cc)(t.noonFactor,e.noonFactor,i),t.sh.r.length===e.sh.r.length)for(let n=0;n<e.sh.r.length;n++)this._sphericalHarmonics.r[n]=(0,r.Cc)(t.sh.r[n],e.sh.r[n],i),this._sphericalHarmonics.g[n]=(0,r.Cc)(t.sh.g[n],e.sh.g[n],i),this._sphericalHarmonics.b[n]=(0,r.Cc)(t.sh.b[n],e.sh.b[n],i);else for(let t=0;t<e.sh.r.length;t++)this._sphericalHarmonics.r[t]=e.sh.r[t],this._sphericalHarmonics.g[t]=e.sh.g[t],this._sphericalHarmonics.b[t]=e.sh.b[t];this.updateLegacy()}}const b=(0,s.vt)()},33442(t,e,i){i.d(e,{T:()=>u,s:()=>h});var r=i(49255);const n=l(-1),s=l(1),o=n,a=new Array;a[0]=null,a[1]=s,a[2]=n,a[3]=l(-2),a[4]=l(-3);const c=a.map(t=>function(t,e){return e?{factor:t.factor+e.factor,units:t.units+e.units}:t}(o,t));function h({output:t,enableOITOffset:e,polygonOffset:i}){return(0,r._$)(t)&&e?c[i]:a[i]}function l(t){return{factor:1*t,units:2*t}}function u(t){const e=h(t)??{factor:0,units:0};return{factor:e.factor+n.factor*t.polygonOffsetIndex,units:e.units+n.units*t.polygonOffsetIndex}}a[1]=s},47724(t,e,i){i.d(e,{L:()=>a});var r=i(5482),n=i(51976),s=i(34711);class o extends s.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,r.Cg)([(0,n.W)()],o.prototype,"hasHighlightMixTexture",void 0),(0,r.Cg)([(0,n.W)()],o.prototype,"emissionDimmingPass",void 0);class a extends o{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,r.Cg)([(0,n.W)({count:5})],a.prototype,"polygonOffset",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"transparent",void 0),(0,r.Cg)([(0,n.W)()],a.prototype,"enableOITOffset",void 0)},35622(t,e,i){i.d(e,{S:()=>a,p:()=>c}),i(34727),i(77690),i(29242),i(58083);var r=i(9093),n=(i(35522),i(51850)),s=(i(78955),i(91829),i(31756),i(26857),i(16943),i(65786));class o extends s.Y{constructor(t){super(),this.vvSize=t?.size??null,this.vvColor=t?.color??null,this.vvOpacity=t?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,r.vt)(),(0,n.vt)(),(0,r.vt)();class a extends o{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const c=8},43616(t,e,i){i.d(e,{MB:()=>c,Um:()=>h,kE:()=>o});var r=i(4576),n=i(34727),s=i(77194);function o(t,e,i,r,s,o){let a=i.screenLength*t.pixelRatio;null!=s&&(l.update(r,e,s,o),a=l.apply(a));const c=a*Math.tan(.5*t.fovY)/(.5*t.fullHeight);return(0,n.qE)(c*e,i.minWorldLength,i.maxWorldLength)}const a=(0,r.VO)();function c(t,e){let i=!1;for(const r in e){const n=e[r];void 0!==n&&(Array.isArray(n)?Array.isArray(t[r])&&a(n,t[r])||(t[r]=n.slice(),i=!0):t[r]!==n&&(i=!0,t[r]=n))}return i}const h={multiply:1,ignore:2,replace:3,tint:4},l=new s.PS},47630(t,e,i){i.d(e,{D:()=>d});var r=i(49255),n=i(22911),s=i(3871),o=i(63365),a=i(66211);function c(t,e){t.include(o.a),t.include(a.Hp,e),t.code.add("\n vec3 emissionFilter(in vec3 srcColor, float srcAlpha) {\n vec3 color = min(srcColor + vec3(1.0 - srcAlpha), 1.0);\n float m = max(color.r, max(color.g, color.b));\n return m > 0.0 ? color / m : vec3(1.0);\n }\n ")}var h=i(31821),l=i(26934),u=i(58243);function d(t,e){t.include(s.Q,e),t.include(n.NL,e);const{fragment:i,outputs:d}=t;i.include(o.a);const{output:p,hasEmission:f,oitPremultipliedAlpha:m,snowCover:g,emissionDimmingPass:_,renderOccluded:v}=e,x=11===p,y=(0,r._$)(p),b=(0,r.Rb)(p),w=(0,r._o)(p)&&!y,T=0!==p||v;let M=0;(w||y)&&d.add("fragColor","vec4",M++),y&&d.add("fragAlpha","float",M++),f&&d.add("fragEmission","vec4",M++),i.include(o.a),i.include(l.Q),i.include(a.Hp,e),i.include(u.t,e),_&&i.include(c,e),i.code.add(h.H`
|
|
250
250
|
void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${(0,h.If)(g,", float snow")}) {
|
|
251
251
|
${(0,h.If)(x,"finalColor.a = 1.0;")}
|
|
252
252
|
${(0,h.If)(T,"if (finalColor.a < alphaCutoff) discard;")}
|
|
@@ -258,4 +258,4 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
|
|
|
258
258
|
calculateOcclusionAndOutputHighlight();
|
|
259
259
|
${(0,h.If)(x,"outputObjectAndLayerIdColor();")}
|
|
260
260
|
}
|
|
261
|
-
`)}},26934(t,e,i){i.d(e,{Q:()=>n});var r=i(49788);function n(t){t.constants.add("alphaCutoff","float",r.Q),t.constants.add("opacityCutoff","float",r.v)}},58243(t,e,i){function r(t,e){e.useFloatBlend?t.code.add("float ditherNoise(vec4 color) { return 0.0; }"):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}i.d(e,{t:()=>r})},92044(t,e,i){i.d(e,{OG:()=>Ot,gP:()=>Rt});var r=i(5482),n=i(69540),s=i(91429);let o=class extends n.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,s.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),p=i(43937),f=i(36005);let m=class extends((0,n.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const n={position:t};return null!=e&&(n.heading=e),null!=i&&(n.tilt=i),null!=r&&(n.fov=r),n}return t}writePosition(t,e,i,r){const n=t.clone();n.x=(0,u.GB)(t.x||0),n.y=(0,u.GB)(t.y||0),n.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=n.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,s.MZ)({type:d.A,json:{write:{isRequired:!0}}})],m.prototype,"position",void 0),(0,r.Cg)([(0,p.K)("position")],m.prototype,"writePosition",null),(0,r.Cg)([(0,f.w)("position")],m.prototype,"readPosition",null),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>c.ie.normalize((0,u.GB)(t)))],m.prototype,"heading",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],m.prototype,"tilt",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],m.prototype,"fov",void 0),(0,r.Cg)([(0,s.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"layout",void 0),m=(0,r.Cg)([(0,s.$K)("esri.Camera")],m);var g=i(9093),_=i(35522),v=i(51850),x=i(16930),y=(i(48353),i(9762),i(65806)),b=i(27993),w=i(73941),T=(i(19419),i(82919)),M=i(71351);i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var A=i(58083),C=i(48163),S=i(5443),E=i(39829),R=i(95108),I=i(37585);function O(t,e,i,r){const n=function(t,e){const i=0===e||2===e?0:1,r=t[e],n=0===e||1===e?1:-1,s=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===n?0:1;if(e[i]>r&&o[i]>r)return 1===n?1:0;const a=(o[s]-e[s])/(o[i]-e[i]),c=e[s]+a*(r-e[i]);return t[i]=r,t[s]=c,(e[i]<r?1:-1)*n>0?2:3}}(i,r);if(t.length=0,e.length){1===n(P,e[0],e[0])&&D(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(n(P,e[i],r)){case 1:D(t,r);break;case 3:D(t,(0,C.o8)(P));break;case 2:D(t,(0,C.o8)(P)),D(t,r)}}}}function D(t,e){0!==t.length&&(0,I.aI)(t.at(-1),e)||t.push(e)}const P=(0,C.vt)();var F=i(11964),N=i(27921);const L=(0,v.vt)(),B=(0,v.vt)();function U(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function H(t,e,i,r,n){let s=(0,_.S8)(L,t),o=(0,_.Om)(s,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(s,e),a&&(0,_.hs)(s,s,-1)):s=null);let c=0;if(s){(0,_.hs)(B,r,(0,_.Om)(r,s)),(0,_.Re)(s,s,B);const t=(0,_.Om)(s,n)/((0,_.Bw)(s)*(0,_.Bw)(n));(0,_.$A)(B,s,n),c=((0,_.Om)(B,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function V(t,e,i,r){(0,_.Re)(z,i,e),(0,N.T7)(r,(0,F.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),G=(0,v.fA)(0,1,0),k=(0,v.fA)(0,0,1),W=(0,g.vt)(),Z=(0,v.vt)(),j=(0,v.vt)();function $(t,e,i,r=U()){const{direction:n,up:s}=r;return(0,A.N9)(W,-(0,l.kU)(e)),(0,A.eL)(W,W,(0,l.kU)(i)),(0,_.Z0)(n,k,W),(0,_.hs)(n,n,-1),(0,_.Z0)(s,G,W),r}function q(t,e,i,r,n){const s=e.lines[11].direction,o=(n-i.getAltitude(r))/s[2];(0,_.Ln)(t,r,s,o)}const X=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return H(e,i,r,k,G)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n=$(0,i,r),s=(0,v.vt)();return(0,_.hs)(s,n.direction,-e),(0,_.WQ)(s,s,t),{up:n.up,eye:s,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:$,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,n=r.getAltitude(e),s=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,M.LV)(e.origin,e.direction),n,X)||q(X,i,r,e.endpoint,n),V(X,o,X,c),a.push((0,C.fA)(X[0],X[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(X,t[0],t[1],0),e.fromRenderCoords(X,X,i),[X[0],X[1]]));return r.length<=2?new E.A({spatialReference:i}):(r.push(r[0].slice()),(0,R.$3)(r)||r.reverse(),new E.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return O(i,t,e,0),O(r,i,e,1),O(i,r,e,2),O(r,i,e,3),r}(a,r.extent),r,s)},toExtent:function(t,e,i,r,n){const s=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,y.g)(e,Z,s),(0,y.g)(e,j,s),Z[0]-=i/2,j[0]+=i/2,Z[1]-=r/2,j[1]+=r/2,(0,b.F)(Z,s,Z,o),(0,b.F)(j,s,j,o),n?(n.xmin=Z[0],n.ymin=Z[1],n.xmax=j[0],n.ymax=j[1],n.spatialReference=o):n=new S.A(Z[0],Z[1],j[0],j[1],o),n}},Symbol.toStringTag,{value:"Module"}));var Q=i(78955),Y=i(91829),K=i(34304),J=i(17136),tt=i(94008),et=i(28735);class it{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,T.vt)(),this._points=(0,T.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new tt.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,T.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,T.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,T.m7)(this.frustum,t)}intersectsRay(t){return(0,T.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,T.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,T.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=st;(0,_.S8)(e,this.direction);const i=nt;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),n=this._boundingSphere,s=(0,_.Ln)(ot,t,e,r);n.center=s,n.radius=r}static{this.planePointIndices=T.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const nt=(0,v.vt)(),st=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new tt.iy,(0,M.vt)(),new S.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),pt=(0,g.vt)(),ft=(0,v.vt)(),mt=(0,v.vt)();function gt(t,e,i,r=U()){(0,_.$A)(ft,t,ut),0===(0,_.Om)(ft,ft)&&(0,_.$A)(ft,t,dt),(0,A.$0)(pt,-(0,l.kU)(e),t),(0,A.e$)(pt,pt,-(0,l.kU)(i),ft);const{up:n,direction:s}=r;return(0,_.$A)(n,ft,t),(0,_.S8)(n,n),(0,_.Z0)(n,n,pt),(0,_.S8)(s,t),(0,_.ze)(s,s),(0,_.Z0)(s,s,pt),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=gt(e,t.heading,t.tilt);return t.up=i.up,t}function xt(t,e){const i=[],r=[],n=(0,K.FD)();for(let s=0;s<t.length;s++){const o=t[s],a=s===t.length-1?t[0]:t[s+1],c=(0,F.Cr)(o,a,St),h=(0,N.vE)(e,c.origin,c.vector,0,At);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,s,a]=0===h?[1,i,r]:[-1,r,i],c=(0,N.Qj)(e),l=(0,_.Ln)((0,v.vt)(),At,c,t*n),u=(0,_.Ln)((0,v.vt)(),At,c,t*-n);s.push(o),s.push(l),a.push(u)}}}const s=[];return i.length&&s.push(i),r.length&&s.push(r),s}const yt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},bt=(0,v.fA)(1,0,0),wt=(0,v.fA)(0,1,0),Tt=(0,v.vt)(),Mt=(0,v.vt)(),At=(0,v.vt)(),Ct=new tt.iy,St=(0,F.vt)(),Et=(0,Y.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const n=ft,s=mt;return(0,_.S8)(n,t),(0,_.$A)(mt,n,ut),0===(0,_.Om)(mt,mt)&&(0,_.$A)(mt,n,dt),(0,_.$A)(s,mt,n),H(e,i,r,n,s)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n={eye:(0,v.vt)(),up:null,tilt:r,heading:i},s=ft;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),p=Math.cos(c),f=(0,_.Bw)(s);let m;if(Math.abs(c)<1e-8)m=o+f;else{const t=f/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;m=t*Math.sin(i)}const g=p*o,x=o*o*(d*d),y=u*u*x,b=m-g,w=b*b,T=y*(y+w-s[1]*s[1]);if(T<0)return(0,_.hs)(n.eye,s,m/f),n.tilt=0,vt(n,t);const M=Math.sqrt(T),A=s[1]*b,C=y+w;let S;if(S=u>0?-M+A:M+A,Math.abs(C)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):(0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t);n.eye[1]=S/C;const E=h*h*x,R=d*o,I=u*R*n.eye[1],O=n.eye[1]*n.eye[1],D=1-O,P=Math.sqrt(D),F=y*O+E-2*I*P*b+D*w;return Math.abs(F)<1e-8?((0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t)):(n.eye[0]=(D*(m*s[0]-g*s[0])-R*P*(s[0]*n.eye[1]*u+s[2]*h))/F,n.eye[2]=(D*(m*s[2]-g*s[2])-R*P*(s[2]*n.eye[1]*u-s[0]*h))/F,(0,_.hs)(n.eye,n.eye,m),_t(n.eye),vt(n,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),n=(0,_.Bw)(e);return(0,l.YN)(i/(n/Math.sin(r)))+r},headingTiltToDirectionUp:gt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),n=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),s=(0,l.YN)(i/(n/Math.sin(t)));return(0,l.KJ)(t-s)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),n=new it(i);r.near=2,n.update(r);const s=i.getAltitude(e),o=t.spatialReference,a=i.referenceEllipsoid.radius,c=r.eye,h=1+(0,_.Io)(c,e)/(a+s),u=Math.sqrt(h*h-1),{minCurvature:d,maxCurvature:p,minSamples:f,maxSamples:m}=yt,g=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return Ct.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(Ct,e)}(t),x=(0,l.qE)((u-d)/(p-d),0,1),y=Math.round((0,l.Cc)(f,m,x)),b=r.aboveGround,w=n.planes[5],T=[],A=(0,N.O_)(v.uY,bt,(0,N.vt)()),C=(0,N.O_)(v.uY,wt,(0,N.vt)());(0,Q.hZ)(Et,0,0,0,0);const S=t=>{};for(let t=0;t<4;t++){const e=1===t&&!b||3===t&&b?1-g:0,r=1===t&&b||3===t&&!b?g:1,o=n.lines[t],a=n.lines[3===t?0:t+1];for(let n=0;n<y;n++){const h=n/y,u=0===n?0:(0,l.Cc)(e,r,1===t?1-(1-h)**2:3===t?h**2:h),d=(0,_.Cc)(Mt,o.origin,a.origin,u),p=(0,lt.nu)(o.direction,a.direction,u,Tt);i.intersectManifoldClosestSilhouette((0,M.LV)(d,p),s,At),V(At,c,At,w),T.push((0,v.o8)(At)),0!==T.length&&S((0,_.lo)(T.at(-1),At));const f=((0,N.Tj)(A,At)?1:0)|((0,N.Tj)(C,At)?2:0);Et[f]=1}}T.length>2&&(0,_.lo)(T[0],T.at(-1));const I=function(t,e,i){const r=2*(0,K.FD)();return t.map(t=>{const n=[];let s=!1;for(const o of t)e.fromRenderCoords(o,At,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(n.push([null,At[1]]),n.push([null,At[1]]),s=!0):n.push([At[0],At[1]]);if(s)for(let t=0;t<n.length;t++){const e=n[t];if(null!=e[0])continue;const i=n[t+1],r=n.at(0===t?-1:t-1);e[0]=r[0],t++;const s=n.at(t===n.length-1?0:t+1);i[0]=s[0]}return n.push(n[0]),(0,R.$3)(n)||n.reverse(),n})}((0,Q.m3)(Et)>1?function(t,e){const i=[];for(const r of t)i.push(...xt(r,e));return i}(xt(T,A),C):[T],i,o);return new E.A({rings:I,spatialReference:o})},toExtent:function(t,e,i,r,n){let s,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,p=e.longitude,f=function(t,e,i){const r=e/i,n=(0,l.kU)(t),s=Math.sin(r/2),o=Math.cos(n),a=2*(0,l.YN)(Math.sqrt(s*s/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;s=p-f,o=p+f;const m=(0,l.kU)(u),g=(1+Math.sin(m))/(1-Math.sin(m)),_=(g+1)*Math.tan(r/d/2),v=_*_;function y(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*g+v))),h=a+r/d,a=y(a),h=y(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=J.Y_.monotonic(s,o),o-s>180){const t=(o-s-180)/2;s+=t,o-=t}const b=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:x.A.WGS84;return n?(n.xmin=s,n.ymin=a,n.xmax=o,n.ymax=h,n.spatialReference=b):n=new S.A(s,a,o,h,b),t.spatialReference&&t.spatialReference.isWebMercator&&(0,et.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Rt={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},It=[Rt.FINAL,Rt.COMPOSITE,Rt.OPAQUE,Rt.TRANSPARENT],Ot={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values(Ot)).concat(It),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>M});var r=i(5482),n=i(69622),s=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),p=i(35522),f=i(51850),m=i(78955),g=i(91829),_=i(82919),v=i(71351),x=i(44280);function y(t,e,i){t.worldUpAtPosition(e,b),(0,p.Re)(w,i,e);const r=(0,p.Bw)(w);return 0===r?0:(0,o.XM)((0,p.Om)(w,b)/r)}const b=(0,f.vt)(),w=(0,f.vt)();var T;let M=T=class extends n.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,g.fA)(0,0,1,1),this._padding=(0,g.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,g.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,f.vt)(),this._up=(0,f.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,p.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,m.hs)((0,g.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,m.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,m.hs)((0,g.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,m.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){(0,m.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,m.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,p.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,n=i/this.rows,s=r/this.columns,o=-r/2+this.column*s,a=o+s,c=-i/2+this.row*n,u=c+n,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),p=this._get("projectionMatrix");return p&&(0,h.t2)(p,d)?p:d}copyFrom(t){(0,p.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,m.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,m.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,m.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&(0,m.t2)(this._viewport,t.viewport)&&(0,m.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}equalsView(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&this._fov===t.fov}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,m.hG)(t.screenPadding,this.screenPadding)>=e||(0,m.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,p.jb)(S,t.eye,t.center),(0,p.jb)(E,this.eye,this.center);const i=(0,p.Om)(S,E),r=(0,p.uE)(S),n=(0,p.uE)(E),s=5e-4;return i*i>=(1-1e-10)*r*n&&(0,p.lo)(t.eye,this.eye)<Math.max(r,n)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,x.gr)(this.viewForward,(0,p.Re)(S,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==A&&(0,p.C)(A,t),A[3]=1,(0,m.Z0)(A,A,this.projectionMatrix);const i=Math.abs(A[3]);(0,p.hs)(A,A,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*A[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*A[1]),e[2]=.5*(A[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;A[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],A[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],A[2]=(2*t[2]-1)*t[3],A[3]=t[3],null!=this.inverseProjectionMatrix&&((0,m.Z0)(A,A,this.inverseProjectionMatrix),e[0]=A[0],e[1]=A[1],e[2]=A[2])}projectToScreen(t,e){return null==this.projectToRenderScreen(t,R)?null:(this.renderToScreen(R,e),e)}projectToRenderScreen(t,e){if(A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=1,(0,m.Z0)(A,A,this.viewProjectionMatrix),0===A[3])return null;const i=A;(0,p.hs)(i,i,1/Math.abs(A[3]));const r=this.fullViewport,n=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),s=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=n,e.y=s):(e[0]=n,e[1]=s,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,R),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(C,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(C,C))return null;const i=this.fullViewport;return A[0]=2*(t[0]-i[0])/i[2]-1,A[1]=2*(t[1]-i[1])/i[3]-1,A[2]=2*t[2]-1,A[3]=1,(0,m.Z0)(A,A,C),0===A[3]?null:(e[0]=A[0]/A[3],e[1]=A[1]/A[3],e[2]=A[2]/A[3],e)}constrainWindowSize(t,e,i,r){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-i/2,0),a=Math.max(this.fullHeight-s-r/2,0),c=-Math.min(n-i/2,0),h=-Math.min(this.fullHeight-s-r/2,0),l=i-c- -Math.min(this.fullWidth-n-i/2,0),u=r-h- -Math.min(s-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:n,fovY:s}=this,o=Math.abs(Math.PI/2-y(e,i,r));return t.frustumCoverage(o,n,s)}_computeUpGlobal(){(0,p.Re)(S,this.center,this.eye);const t=(0,p.Bw)(this.center);t<1?(0,p.t2)(this._up,f.Cb)&&((0,p.C)(this._up,f.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,p.Om)(S,this.center))>.9999*(0,p.Bw)(S)*t||((0,p.$A)(E,S,this.center),(0,p.$A)(E,E,S),(0,p.S8)(E,E),(0,p.t2)(this._up,E)||((0,p.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,p.oW)(S,this.eye,this.center),Math.abs(S[2])<=.9999&&((0,p.hs)(S,S,S[2]),(0,p.hZ)(S,-S[0],-S[1],1-S[2]),(0,p.S8)(S,S),(0,p.t2)(this._up,S)||((0,p.C)(this._up,S),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,p.t2)(t,e)||((0,p.C)(e,t),this._markViewDirty(),i.length&&this.notifyChange(i)):s.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"relativeElevation",void 0),M=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],M);const A=(0,g.vt)(),C=(0,l.vt)(),S=(0,f.vt)(),E=(0,f.vt)(),R=(0,a.r_)()},78607(t,e,i){i.d(e,{A:()=>D});var r=i(5482),n=i(69622),s=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(92044),l=i(44208),u=i(53966),d=(i(17676),i(94656)),p=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var f=i(21231),m=i(97768),g=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class x{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:s,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,s,r,n):i.renderbufferStorage(i.RENDERBUFFER,s,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class y{constructor(t,e,i){if(this._context=t,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,t.instanceCounter.increment(p.vt.FramebufferObject,this),null!=e){const i=function(t,e){return b(e)||w(e)?e:T(e)?new f.A(t,e):function(t){return 3===M(t)||null!=t&&"samples"in t}(e)?new x(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(p.r6,i),b(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(p.r6)}if(null!=i)if(function(t){return b(t)||T(t)}(i))this._depthStencilTexture=b(i)?i:new f.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new x(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(p.r6);return b(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,i])=>t+i.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(t){this._level!==t&&(this._level=t,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&b(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=p.r6){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=p.r6){const e=this._colorAttachments.get(t);if(!e)return;const i=b(e);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._glName){const e=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{t.forEach(t=>{b(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=p.r6,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,i):this._framebufferTexture2D(r.glName,e,t,36160))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===p.ld.UNSIGNED_INT_24_8?6402!==i||r===p.ld.UNSIGNED_INT||r===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,S(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,S(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._glName){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,n,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebuffer(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,n,s,o){(t<0||e<0||n<0||s<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||n+i>a.width||s+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,f.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,s,t,e,i,r),c.bindTexture(h,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,n,s,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,n,s,o)}async readPixelsAsync(t,e,i,r,n,s,o){const{gl:a}=this._context,c=g.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(c);const h=this._context.boundFramebuffer;this._context.bindFramebuffer(this),a.readPixels(t,e,i,r,n,s,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(h),await c.getSubDataAsync(o),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(A(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._glName&&(A(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;this._glName?e.bindFramebuffer(t,this._glName):(this._glName&&e.deleteFramebuffer(this._glName),this._glName=e.createFramebuffer(),e.bindFramebuffer(t,this._glName),this._initializeAttachments(t))}_initializeAttachments(t=36160){const{gl:e}=this._context;if(this._colorAttachments.forEach((e,i)=>{if(b(e)){const r=C(e);35866===r?this._framebufferTextureLayer(e.glName,i,t):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=S(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,C(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(t,e=p.r6,i=3553,r=36160){this._context.gl.framebufferTexture2D(r,e,i,t,this._level)}_framebufferTextureLayer(t,e=p.r6,i=36160,r=0){this._context.gl.framebufferTextureLayer(i,e,t,this._level,r)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,m.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,S(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,m.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),A(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){A(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return p.xL;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return p.nI;case 36168:return p.uH;default:return p.r6}}_validateColorAttachmentPoint(t){if(-1===y._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;y._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-p.r6;e+1>y._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(t){return 1===M(t)}function w(t){return 2===M(t)}function T(t){return 0===M(t)}function M(t){return null!=t&&"type"in t?t.type:null}function A(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function C(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function S(t){return 6402===t?p.xL:p.nI}i(67171),i(79785);var E=i(85079),R=i(74038);const I=[new R._("position",2,p.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,p.pe.BYTE,0,2),new R._("a_pos",2,p.pe.BYTE,0,4),new R._("a_tex",2,p.pe.BYTE,2,4),(0,E.Xk)(I),i(66289);const O=new Image;O.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",O.width=5,O.height=5,O.decode();let D=class extends n.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[p.$0]:[p.C5])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(t){return null}get input(){return this._frameBuffer}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],D.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],D.prototype,"techniques",null),D=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],D)},37957(t,e,i){i.d(e,{P:()=>r});const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){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]}}},48852(t,e,i){i.d(e,{g:()=>d});var r=i(4576),n=i(44208),s=i(53966),o=i(17676),a=i(34275),c=i(94656),h=i(63907);const l=()=>s.A.getLogger("esri.views.webgl.BufferObject"),u=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class d{static createIndex(t,e,i){return new d(t,34963,e,i)}static createUniform(t,e,i){return new d(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new d(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new d(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new d(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(h.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,c.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case h.pe.UNSIGNED_INT:return this._sizeBytes/4;case h.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case h.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return u?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(h.vt.BufferObject,this),this._context=null):this._glName&&l().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case h.pe.UNSIGNED_SHORT:t*=2;break;case h.pe.UNSIGNED_INT:t*=4;case h.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,a.mg)(t)?this._indexType=h.pe.UNSIGNED_BYTE:(0,a.jq)(t)?this._indexType=h.pe.UNSIGNED_SHORT:(0,a.XJ)(t)&&(this._indexType=h.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,c.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:s}=this._context;s.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,c.Y2)(s),this._isVAOAware&&this._context.bindVAO(n)}getSubData(t,e=0,i,n){if(i<0||n<0)return;const s=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(s*((i??0)+(n??0))>t.byteLength)return;e+s*(n??0)>this.usedMemory&&l().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,n),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r){if(await this._context.clientWaitAsync(),!this._context||!this._glName)throw(0,o.NK)();this.getSubData(t,e,i,r)}}},14113(t,e,i){i.d(e,{Cy:()=>u,N5:()=>a});var r=i(49186),n=(i(44208),i(53966));const s=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new p,this.varyings=new f,this.outputs=new m}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),n="vertex"===t?this.vertex:this.fragment,s=n.uniforms.generateSource(),o=n.code.generateSource(),a=n.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=n.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let n=0;n<r;++n)i[n](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n)=>{for(let s=0;s<r;++s)i[s](t,n,e)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n,s)=>{for(let o=0;o<r;++o)i[o](t,s,e,n)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0){const t=[];for(const e of this._bodies)"string"==typeof e?t.push(e):t.push(...e());return[`void main() {\n ${t.join("\n")||""} \n}`]}if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){const t=[];for(const e of this._entries)"string"==typeof e?t.push(e):t.push(...e());return t}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new g(this),this.inputs=new h}get builder(){return this}}class p{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class f{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?s().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class m{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):s().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class g{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=g._numberToFloatStr(i);break;case"int":r=g._numberToIntStr(i);break;case"uint":r=g._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])}, ${g._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])}, ${g._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])}, ${g._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>g._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},21231(t,e,i){i.d(e,{A:()=>g});var r=i(49186),n=i(44208),s=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171),d=i(12541);class p extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(t,e){return new p(t,e)}}const f=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),m=()=>s.A.getLogger("esri/views/webgl/Texture");class g{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=p.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return f?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!(0,d.Qp)(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!(0,d.Qp)(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,n,s,o,a=0){o||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=(0,d.mq)(c);const{context:h,pixelFormat:l,dataType:u,target:p,isImmutable:f}=c;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const _=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+n>c.width||i+s>c.height)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=h;a&&(n&&s||m().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),v.pixelStorei(v.UNPACK_SKIP_ROWS,a)),(0,d.Kv)(o)?v.texSubImage2D(p,t,e,i,n,s,l,u,o):(0,d.Qp)(o)?v.compressedTexSubImage2D(p,t,e,i,n,s,c.internalFormat,o.levels[t]):v.texSubImage2D(p,t,e,i,n,s,l,u,o),a&&v.pixelStorei(v.UNPACK_SKIP_ROWS,0),h.bindTexture(_,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,n,s,o,a,c){c||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=(0,d.mq)(h);const{context:l,pixelFormat:u,dataType:p,isImmutable:f,target:_}=h;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,d.re)(_)||m().warn("Attempting to set 3D texture data on a non-3D texture");const v=l.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||n<0||e+s>h.width||i+o>h.height||n+a>h.depth)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=l;if((0,d.Qp)(c))c=c.levels[t],x.compressedTexSubImage3D(_,t,e,i,n,s,o,a,h.internalFormat,c);else{const r=c;x.texSubImage3D(_,t,e,i,n,s,o,a,u,p,r)}l.bindTexture(v,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,d.QE)(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,(0,d.QE)(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,(0,d.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),(0,d.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,h.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),(0,d.QE)(i);const s=i.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(n);const o=e??i.target,a=(0,d.re)(o);if((0,d.Kv)(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:s,depth:c}=i;if(null==e||null==s)throw new r.A("texture:missing-size","Width and height must be specified!");if(a&&null==c)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=(0,d.mq)(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,s,c),(0,d.Qp)(t)){if(!(0,d.tl)(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,s,c,t),(0,h.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(n),i.context.bindTexture(s,g.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=(0,d.mq)(r);const n=(0,d.re)(e),{width:s,height:o,depth:a}=(0,d.Eo)(t);r.width&&r.height,r.width||(r.width=s),r.height||(r.height=o),n&&r.depth,n&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,s,o,a),this._texImage(e,0,r.internalFormat,s,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:n,height:s,depth:o}=r,a=t.levels,c=(0,d.FV)(i,n,s,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,n,s)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,n,s,o)},h)}_texStorage(t,e,i,n,s,o){const{gl:a}=this._descriptor.context;if(!(0,d.tr)(e)&&!(0,d.tl)(e))throw new r.A("texture:missing-format","Immutable textures must have a sized or compressed internal format");if(!this._descriptor.isImmutable)return;const c=i?(0,d.FV)(t,n,s,o):1;if((0,d.re)(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,n,s,o)}else a.texStorage2D(t,c,e,n,s);this._wasImmutablyAllocated=!0}_texImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t),{isImmutable:l,pixelFormat:u,dataType:p}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,n,s,o,u,p,i)}else c.texSubImage2D(t,e,0,0,n,s,u,p,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,n,s,o,0,u,p,l)}else c.texImage2D(t,e,i,n,s,0,u,p,l)}}_compressedTexImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,n,s,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,n,s,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,n,s,o,0,a)}else c.compressedTexImage2D(t,e,i,n,s,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:n,preMultiplyAlpha:s,hasMipmap:o,compress:a}=this._descriptor;if(!a)return;const{compressionTracker:h,compressionCallback:l,preserveSourceBitmap:u}=a,{compressedTextureETC:d,compressedTextureS3TC:p}=r.capabilities;if(!g.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!d&&!p)return;this.abortCompression();const f=new AbortController;let _;this._compressionAbortController=f,h?.increment();let v=!1,x=!1;try{t instanceof ImageBitmap?u?(_=await createImageBitmap(t),(0,c.Te)(f),x=!0):_=t:t instanceof Uint8Array?(_=t.buffer,v=this.descriptor.flipped):(_=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(f),x=!0);const r={data:_,width:e,height:i,needsFlip:v,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,hasMipmap:o,hasETC:!!d,hasS3TC:!!p},a=await g.compressionWorkerHandle.invoke(r,f.signal,1);if((0,c.Te)(f),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),l?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||m().error("Texture compression failed!")}finally{h?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),x&&_ instanceof ImageBitmap&&_.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==n||c&&null==s)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,n,s),o&&(1!==i||1!==n||c&&1!==s)&&!(r>=e);++r)i=Math.max(1,i>>1),n=Math.max(1,n>>1),c&&(s=Math.max(1,s>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>s,e:()=>o});var r=i(63907),n=i(42293);class s{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,n.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),n=i(63907);const s=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function o(t,e,i,n=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&s.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>u});var r=i(21818),n=i(53966),s=i(97768),o=i(69397),a=i(63907),c=i(42293),h=i(85079);const l=()=>n.A.getLogger("esri.views.webgl.VertexArrayObject");let u=class t{constructor(t,e,i,n,s){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==n?new Map:"number"==typeof n?new Map([["geometry",n]]):n,this.locations=s??(0,r.z)((0,h.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*o.i5)}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,s.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&l().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(a.vt.VertexArrayObject,this)),this._context=null):this._glName&&l().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(a.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||l().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,c.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>n});var r=i(48852);class n extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),n=i(44208),s=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],e[r]=s[0];return e}function n(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],s[1]=t[r]-s[0],e[r]=s[1];return e}i.d(e,{Zo:()=>r,jA:()=>n});const s=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function n(t,e,i,r,n=32774,s=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>T,RC:()=>o,T8:()=>a,Uy:()=>p,Xt:()=>u,iD:()=>s,kn:()=>f,nk:()=>d,p3:()=>n,uR:()=>c}),i(4718);const s=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=n(770,1,771,771),c=n(0,0,768,0),h={face:1029,mode:2305},l={face:1028,mode:2305},u=t=>2===t?h:1===t?l:null;function d(t,e,i){return{ref:t,readMask:e,stencilFront:i,stencilBack:i}}const p={zNear:0,zFar:1},f={r:!0,g:!0,b:!0,a:!0};function m(t){return C.intern(t)}function g(t){return E.intern(t)}function _(t){return I.intern(t)}function v(t){return D.intern(t)}function x(t){return F.intern(t)}function y(t){return L.intern(t)}function b(t){return U.intern(t)}function w(t){return V.intern(t)}function T(t){return G.intern(t)}class M{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function A(t){return"["+t.join(",")+"]"}const C=new M(S,t=>({__tag:"Blending",...t}));function S(t){return t?A([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const E=new M(R,t=>({__tag:"Culling",...t}));function R(t){return t?A([t.face,t.mode]):null}const I=new M(O,t=>({__tag:"PolygonOffset",...t}));function O(t){return t?A([t.factor,t.units]):null}const D=new M(P,t=>({__tag:"DepthTest",...t}));function P(t){return t?A([t.func]):null}const F=new M(N,t=>({__tag:"StencilTest",...t}));function N(t){return t?A([t.ref,t.readMask,t.stencilFront.compare,t.stencilFront.fail,t.stencilFront.zFail,t.stencilFront.zPass,t.stencilBack.compare,t.stencilBack.fail,t.stencilBack.zFail,t.stencilBack.zPass]):null}const L=new M(B,t=>({__tag:"DepthWrite",...t}));function B(t){return t?A([t.zNear,t.zFar]):null}const U=new M(H,t=>({__tag:"ColorWrite",...t}));function H(t){return t?A([t.r,t.g,t.b,t.a]):null}const V=new M(z,t=>({__tag:"StencilWrite",...t}));function z(t){return t?A([t.mask]):null}const G=new M(function(t){return t?A([S(t.blending),R(t.culling),O(t.polygonOffset),P(t.depthTest),N(t.stencilTest),B(t.depthWrite),H(t.colorWrite),z(t.stencilWrite)]):null},t=>({blending:m(t.blending),culling:g(t.culling),polygonOffset:_(t.polygonOffset),depthTest:v(t.depthTest),stencilTest:x(t.stencilTest),depthWrite:y(t.depthWrite),colorWrite:b(t.colorWrite),stencilWrite:w(t.stencilWrite)}))},12541(t,e,i){i.d(e,{CR:()=>l,Eo:()=>v,FV:()=>g,Kv:()=>f,QE:()=>c,QJ:()=>u,Qp:()=>p,mq:()=>_,re:()=>m,tl:()=>d,tr:()=>h});var r=i(49186),n=i(53966),s=i(93637),o=i(63907);const a=()=>n.A.getLogger("esri/views/webgl/textureUtils");function c(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=t;if(n&&(l(n)||u(n))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:n}=t;n&&a().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&a().error("Depth textures cannot sample mipmaps"):(9728!==r&&a().error("Depth textures without filtering must use NEAREST filtering"),i&&a().error("Depth textures without filtering cannot use compare function"))}}function h(t){return function(t){return o.XN.includes(t)}(t)||l(t)||u(t)}function l(t){return(0,s.a4)(o.SB,t)}function u(t){return(0,s.a4)(o.iE,t)}function d(t){return null!=t&&(0,s.a4)(o.CQ,t)}function p(t){return null!=t&&"type"in t&&"compressed"===t.type}function f(t){return null!=t&&!p(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function m(t){return 32879===t||35866===t}function g(t,e,i,r=1){let n=Math.max(e,i);return 32879===t&&(n=Math.max(n,r)),Math.floor(Math.log2(n))+1}function _(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case o.ld.FLOAT:switch(t.pixelFormat){case 6408:return o.H0.RGBA32F;case 6407:return o.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case o.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return o.H0.RGBA8;case 6407:return o.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?o.iE.DEPTH24_STENCIL8:6402===e?o.SB.DEPTH_COMPONENT24:e,t.internalFormat}function v(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}},49788(t,e,i){i.d(e,{Q:()=>r,v:()=>n});const r=1/255.5,n=1-r}}]);
|
|
261
|
+
`)}},26934(t,e,i){i.d(e,{Q:()=>n});var r=i(49788);function n(t){t.constants.add("alphaCutoff","float",r.Q),t.constants.add("opacityCutoff","float",r.v)}},58243(t,e,i){function r(t,e){e.useFloatBlend?t.code.add("float ditherNoise(vec4 color) { return 0.0; }"):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}i.d(e,{t:()=>r})},92044(t,e,i){i.d(e,{OG:()=>Ot,gP:()=>Rt});var r=i(5482),n=i(69540),s=i(91429);let o=class extends n.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,s.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),p=i(43937),f=i(36005);let m=class extends((0,n.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const n={position:t};return null!=e&&(n.heading=e),null!=i&&(n.tilt=i),null!=r&&(n.fov=r),n}return t}writePosition(t,e,i,r){const n=t.clone();n.x=(0,u.GB)(t.x||0),n.y=(0,u.GB)(t.y||0),n.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=n.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,s.MZ)({type:d.A,json:{write:{isRequired:!0}}})],m.prototype,"position",void 0),(0,r.Cg)([(0,p.K)("position")],m.prototype,"writePosition",null),(0,r.Cg)([(0,f.w)("position")],m.prototype,"readPosition",null),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>c.ie.normalize((0,u.GB)(t)))],m.prototype,"heading",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],m.prototype,"tilt",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],m.prototype,"fov",void 0),(0,r.Cg)([(0,s.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"layout",void 0),m=(0,r.Cg)([(0,s.$K)("esri.Camera")],m);var g=i(9093),_=i(35522),v=i(51850),x=i(16930),y=(i(48353),i(9762),i(65806)),b=i(27993),w=i(73941),T=(i(19419),i(82919)),M=i(71351);i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var A=i(58083),C=i(48163),S=i(5443),E=i(39829),R=i(95108),I=i(37585);function O(t,e,i,r){const n=function(t,e){const i=0===e||2===e?0:1,r=t[e],n=0===e||1===e?1:-1,s=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===n?0:1;if(e[i]>r&&o[i]>r)return 1===n?1:0;const a=(o[s]-e[s])/(o[i]-e[i]),c=e[s]+a*(r-e[i]);return t[i]=r,t[s]=c,(e[i]<r?1:-1)*n>0?2:3}}(i,r);if(t.length=0,e.length){1===n(P,e[0],e[0])&&D(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(n(P,e[i],r)){case 1:D(t,r);break;case 3:D(t,(0,C.o8)(P));break;case 2:D(t,(0,C.o8)(P)),D(t,r)}}}}function D(t,e){0!==t.length&&(0,I.aI)(t.at(-1),e)||t.push(e)}const P=(0,C.vt)();var F=i(11964),N=i(27921);const L=(0,v.vt)(),B=(0,v.vt)();function U(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function H(t,e,i,r,n){let s=(0,_.S8)(L,t),o=(0,_.Om)(s,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(s,e),a&&(0,_.hs)(s,s,-1)):s=null);let c=0;if(s){(0,_.hs)(B,r,(0,_.Om)(r,s)),(0,_.Re)(s,s,B);const t=(0,_.Om)(s,n)/((0,_.Bw)(s)*(0,_.Bw)(n));(0,_.$A)(B,s,n),c=((0,_.Om)(B,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function V(t,e,i,r){(0,_.Re)(z,i,e),(0,N.T7)(r,(0,F.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),G=(0,v.fA)(0,1,0),k=(0,v.fA)(0,0,1),W=(0,g.vt)(),Z=(0,v.vt)(),j=(0,v.vt)();function $(t,e,i,r=U()){const{direction:n,up:s}=r;return(0,A.N9)(W,-(0,l.kU)(e)),(0,A.eL)(W,W,(0,l.kU)(i)),(0,_.Z0)(n,k,W),(0,_.hs)(n,n,-1),(0,_.Z0)(s,G,W),r}function q(t,e,i,r,n){const s=e.lines[11].direction,o=(n-i.getAltitude(r))/s[2];(0,_.Ln)(t,r,s,o)}const X=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return H(e,i,r,k,G)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n=$(0,i,r),s=(0,v.vt)();return(0,_.hs)(s,n.direction,-e),(0,_.WQ)(s,s,t),{up:n.up,eye:s,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:$,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,n=r.getAltitude(e),s=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,M.LV)(e.origin,e.direction),n,X)||q(X,i,r,e.endpoint,n),V(X,o,X,c),a.push((0,C.fA)(X[0],X[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(X,t[0],t[1],0),e.fromRenderCoords(X,X,i),[X[0],X[1]]));return r.length<=2?new E.A({spatialReference:i}):(r.push(r[0].slice()),(0,R.$3)(r)||r.reverse(),new E.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return O(i,t,e,0),O(r,i,e,1),O(i,r,e,2),O(r,i,e,3),r}(a,r.extent),r,s)},toExtent:function(t,e,i,r,n){const s=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,y.g)(e,Z,s),(0,y.g)(e,j,s),Z[0]-=i/2,j[0]+=i/2,Z[1]-=r/2,j[1]+=r/2,(0,b.F)(Z,s,Z,o),(0,b.F)(j,s,j,o),n?(n.xmin=Z[0],n.ymin=Z[1],n.xmax=j[0],n.ymax=j[1],n.spatialReference=o):n=new S.A(Z[0],Z[1],j[0],j[1],o),n}},Symbol.toStringTag,{value:"Module"}));var Q=i(78955),Y=i(91829),K=i(34304),J=i(17136),tt=i(94008),et=i(28735);class it{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,T.vt)(),this._points=(0,T.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new tt.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,T.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,T.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,T.m7)(this.frustum,t)}intersectsRay(t){return(0,T.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,T.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,T.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=st;(0,_.S8)(e,this.direction);const i=nt;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),n=this._boundingSphere,s=(0,_.Ln)(ot,t,e,r);n.center=s,n.radius=r}static{this.planePointIndices=T.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const nt=(0,v.vt)(),st=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new tt.iy,(0,M.vt)(),new S.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),pt=(0,g.vt)(),ft=(0,v.vt)(),mt=(0,v.vt)();function gt(t,e,i,r=U()){(0,_.$A)(ft,t,ut),0===(0,_.Om)(ft,ft)&&(0,_.$A)(ft,t,dt),(0,A.$0)(pt,-(0,l.kU)(e),t),(0,A.e$)(pt,pt,-(0,l.kU)(i),ft);const{up:n,direction:s}=r;return(0,_.$A)(n,ft,t),(0,_.S8)(n,n),(0,_.Z0)(n,n,pt),(0,_.S8)(s,t),(0,_.ze)(s,s),(0,_.Z0)(s,s,pt),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=gt(e,t.heading,t.tilt);return t.up=i.up,t}function xt(t,e){const i=[],r=[],n=(0,K.FD)();for(let s=0;s<t.length;s++){const o=t[s],a=s===t.length-1?t[0]:t[s+1],c=(0,F.Cr)(o,a,St),h=(0,N.vE)(e,c.origin,c.vector,0,At);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,s,a]=0===h?[1,i,r]:[-1,r,i],c=(0,N.Qj)(e),l=(0,_.Ln)((0,v.vt)(),At,c,t*n),u=(0,_.Ln)((0,v.vt)(),At,c,t*-n);s.push(o),s.push(l),a.push(u)}}}const s=[];return i.length&&s.push(i),r.length&&s.push(r),s}const yt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},bt=(0,v.fA)(1,0,0),wt=(0,v.fA)(0,1,0),Tt=(0,v.vt)(),Mt=(0,v.vt)(),At=(0,v.vt)(),Ct=new tt.iy,St=(0,F.vt)(),Et=(0,Y.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const n=ft,s=mt;return(0,_.S8)(n,t),(0,_.$A)(mt,n,ut),0===(0,_.Om)(mt,mt)&&(0,_.$A)(mt,n,dt),(0,_.$A)(s,mt,n),H(e,i,r,n,s)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n={eye:(0,v.vt)(),up:null,tilt:r,heading:i},s=ft;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),p=Math.cos(c),f=(0,_.Bw)(s);let m;if(Math.abs(c)<1e-8)m=o+f;else{const t=f/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;m=t*Math.sin(i)}const g=p*o,x=o*o*(d*d),y=u*u*x,b=m-g,w=b*b,T=y*(y+w-s[1]*s[1]);if(T<0)return(0,_.hs)(n.eye,s,m/f),n.tilt=0,vt(n,t);const M=Math.sqrt(T),A=s[1]*b,C=y+w;let S;if(S=u>0?-M+A:M+A,Math.abs(C)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):(0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t);n.eye[1]=S/C;const E=h*h*x,R=d*o,I=u*R*n.eye[1],O=n.eye[1]*n.eye[1],D=1-O,P=Math.sqrt(D),F=y*O+E-2*I*P*b+D*w;return Math.abs(F)<1e-8?((0,_.hs)(n.eye,s,m/f),n.tilt=0,_t(n.eye),vt(n,t)):(n.eye[0]=(D*(m*s[0]-g*s[0])-R*P*(s[0]*n.eye[1]*u+s[2]*h))/F,n.eye[2]=(D*(m*s[2]-g*s[2])-R*P*(s[2]*n.eye[1]*u-s[0]*h))/F,(0,_.hs)(n.eye,n.eye,m),_t(n.eye),vt(n,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),n=(0,_.Bw)(e);return(0,l.YN)(i/(n/Math.sin(r)))+r},headingTiltToDirectionUp:gt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),n=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),s=(0,l.YN)(i/(n/Math.sin(t)));return(0,l.KJ)(t-s)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),n=new it(i);r.near=2,n.update(r);const s=i.getAltitude(e),o=t.spatialReference,a=i.referenceEllipsoid.radius,c=r.eye,h=1+(0,_.Io)(c,e)/(a+s),u=Math.sqrt(h*h-1),{minCurvature:d,maxCurvature:p,minSamples:f,maxSamples:m}=yt,g=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return Ct.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(Ct,e)}(t),x=(0,l.qE)((u-d)/(p-d),0,1),y=Math.round((0,l.Cc)(f,m,x)),b=r.aboveGround,w=n.planes[5],T=[],A=(0,N.O_)(v.uY,bt,(0,N.vt)()),C=(0,N.O_)(v.uY,wt,(0,N.vt)());(0,Q.hZ)(Et,0,0,0,0);const S=t=>{};for(let t=0;t<4;t++){const e=1===t&&!b||3===t&&b?1-g:0,r=1===t&&b||3===t&&!b?g:1,o=n.lines[t],a=n.lines[3===t?0:t+1];for(let n=0;n<y;n++){const h=n/y,u=0===n?0:(0,l.Cc)(e,r,1===t?1-(1-h)**2:3===t?h**2:h),d=(0,_.Cc)(Mt,o.origin,a.origin,u),p=(0,lt.nu)(o.direction,a.direction,u,Tt);i.intersectManifoldClosestSilhouette((0,M.LV)(d,p),s,At),V(At,c,At,w),T.push((0,v.o8)(At)),0!==T.length&&S((0,_.lo)(T.at(-1),At));const f=((0,N.Tj)(A,At)?1:0)|((0,N.Tj)(C,At)?2:0);Et[f]=1}}T.length>2&&(0,_.lo)(T[0],T.at(-1));const I=function(t,e,i){const r=2*(0,K.FD)();return t.map(t=>{const n=[];let s=!1;for(const o of t)e.fromRenderCoords(o,At,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(n.push([null,At[1]]),n.push([null,At[1]]),s=!0):n.push([At[0],At[1]]);if(s)for(let t=0;t<n.length;t++){const e=n[t];if(null!=e[0])continue;const i=n[t+1],r=n.at(0===t?-1:t-1);e[0]=r[0],t++;const s=n.at(t===n.length-1?0:t+1);i[0]=s[0]}return n.push(n[0]),(0,R.$3)(n)||n.reverse(),n})}((0,Q.m3)(Et)>1?function(t,e){const i=[];for(const r of t)i.push(...xt(r,e));return i}(xt(T,A),C):[T],i,o);return new E.A({rings:I,spatialReference:o})},toExtent:function(t,e,i,r,n){let s,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,p=e.longitude,f=function(t,e,i){const r=e/i,n=(0,l.kU)(t),s=Math.sin(r/2),o=Math.cos(n),a=2*(0,l.YN)(Math.sqrt(s*s/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;s=p-f,o=p+f;const m=(0,l.kU)(u),g=(1+Math.sin(m))/(1-Math.sin(m)),_=(g+1)*Math.tan(r/d/2),v=_*_;function y(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*g+v))),h=a+r/d,a=y(a),h=y(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=J.Y_.monotonic(s,o),o-s>180){const t=(o-s-180)/2;s+=t,o-=t}const b=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:x.A.WGS84;return n?(n.xmin=s,n.ymin=a,n.xmax=o,n.ymax=h,n.spatialReference=b):n=new S.A(s,a,o,h,b),t.spatialReference&&t.spatialReference.isWebMercator&&(0,et.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Rt={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},It=[Rt.FINAL,Rt.COMPOSITE,Rt.OPAQUE,Rt.TRANSPARENT],Ot={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values(Ot)).concat(It),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>M});var r=i(5482),n=i(69622),s=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),p=i(35522),f=i(51850),m=i(78955),g=i(91829),_=i(82919),v=i(71351),x=i(44280);function y(t,e,i){t.worldUpAtPosition(e,b),(0,p.Re)(w,i,e);const r=(0,p.Bw)(w);return 0===r?0:(0,o.XM)((0,p.Om)(w,b)/r)}const b=(0,f.vt)(),w=(0,f.vt)();var T;let M=T=class extends n.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,g.fA)(0,0,1,1),this._padding=(0,g.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,g.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,f.vt)(),this._up=(0,f.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,p.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,m.hs)((0,g.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,m.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,m.hs)((0,g.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,m.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){(0,m.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,m.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,p.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,n=i/this.rows,s=r/this.columns,o=-r/2+this.column*s,a=o+s,c=-i/2+this.row*n,u=c+n,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),p=this._get("projectionMatrix");return p&&(0,h.t2)(p,d)?p:d}copyFrom(t){(0,p.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,m.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,m.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,m.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&(0,m.t2)(this._viewport,t.viewport)&&(0,m.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}equalsView(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&this._fov===t.fov}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,m.hG)(t.screenPadding,this.screenPadding)>=e||(0,m.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,p.jb)(S,t.eye,t.center),(0,p.jb)(E,this.eye,this.center);const i=(0,p.Om)(S,E),r=(0,p.uE)(S),n=(0,p.uE)(E),s=5e-4;return i*i>=(1-1e-10)*r*n&&(0,p.lo)(t.eye,this.eye)<Math.max(r,n)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,x.gr)(this.viewForward,(0,p.Re)(S,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==A&&(0,p.C)(A,t),A[3]=1,(0,m.Z0)(A,A,this.projectionMatrix);const i=Math.abs(A[3]);(0,p.hs)(A,A,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*A[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*A[1]),e[2]=.5*(A[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;A[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],A[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],A[2]=(2*t[2]-1)*t[3],A[3]=t[3],null!=this.inverseProjectionMatrix&&((0,m.Z0)(A,A,this.inverseProjectionMatrix),e[0]=A[0],e[1]=A[1],e[2]=A[2])}projectToScreen(t,e){return null==this.projectToRenderScreen(t,R)?null:(this.renderToScreen(R,e),e)}projectToRenderScreen(t,e){if(A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=1,(0,m.Z0)(A,A,this.viewProjectionMatrix),0===A[3])return null;const i=A;(0,p.hs)(i,i,1/Math.abs(A[3]));const r=this.fullViewport,n=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),s=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=n,e.y=s):(e[0]=n,e[1]=s,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,R),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(C,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(C,C))return null;const i=this.fullViewport;return A[0]=2*(t[0]-i[0])/i[2]-1,A[1]=2*(t[1]-i[1])/i[3]-1,A[2]=2*t[2]-1,A[3]=1,(0,m.Z0)(A,A,C),0===A[3]?null:(e[0]=A[0]/A[3],e[1]=A[1]/A[3],e[2]=A[2]/A[3],e)}constrainWindowSize(t,e,i,r){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-i/2,0),a=Math.max(this.fullHeight-s-r/2,0),c=-Math.min(n-i/2,0),h=-Math.min(this.fullHeight-s-r/2,0),l=i-c- -Math.min(this.fullWidth-n-i/2,0),u=r-h- -Math.min(s-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:n,fovY:s}=this,o=Math.abs(Math.PI/2-y(e,i,r));return t.frustumCoverage(o,n,s)}_computeUpGlobal(){(0,p.Re)(S,this.center,this.eye);const t=(0,p.Bw)(this.center);t<1?(0,p.t2)(this._up,f.Cb)&&((0,p.C)(this._up,f.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,p.Om)(S,this.center))>.9999*(0,p.Bw)(S)*t||((0,p.$A)(E,S,this.center),(0,p.$A)(E,E,S),(0,p.S8)(E,E),(0,p.t2)(this._up,E)||((0,p.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,p.oW)(S,this.eye,this.center),Math.abs(S[2])<=.9999&&((0,p.hs)(S,S,S[2]),(0,p.hZ)(S,-S[0],-S[1],1-S[2]),(0,p.S8)(S,S),(0,p.t2)(this._up,S)||((0,p.C)(this._up,S),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,p.t2)(t,e)||((0,p.C)(e,t),this._markViewDirty(),i.length&&this.notifyChange(i)):s.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"relativeElevation",void 0),M=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],M);const A=(0,g.vt)(),C=(0,l.vt)(),S=(0,f.vt)(),E=(0,f.vt)(),R=(0,a.r_)()},78607(t,e,i){i.d(e,{A:()=>D});var r=i(5482),n=i(69622),s=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(92044),l=i(44208),u=i(53966),d=(i(17676),i(94656)),p=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var f=i(21231),m=i(97768),g=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class x{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:s,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,s,r,n):i.renderbufferStorage(i.RENDERBUFFER,s,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class y{constructor(t,e,i){if(this._context=t,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,t.instanceCounter.increment(p.vt.FramebufferObject,this),null!=e){const i=function(t,e){return b(e)||w(e)?e:T(e)?new f.A(t,e):function(t){return 3===M(t)||null!=t&&"samples"in t}(e)?new x(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(p.r6,i),b(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(p.r6)}if(null!=i)if(function(t){return b(t)||T(t)}(i))this._depthStencilTexture=b(i)?i:new f.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new x(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(p.r6);return b(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,i])=>t+i.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(t){this._level!==t&&(this._level=t,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&b(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=p.r6){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=p.r6){const e=this._colorAttachments.get(t);if(!e)return;const i=b(e);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._glName){const e=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{t.forEach(t=>{b(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=p.r6,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,i):this._framebufferTexture2D(r.glName,e,t,36160))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===p.ld.UNSIGNED_INT_24_8?6402!==i||r===p.ld.UNSIGNED_INT||r===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,S(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,S(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._glName){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,n,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebuffer(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,n,s,o){(t<0||e<0||n<0||s<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||n+i>a.width||s+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,f.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,s,t,e,i,r),c.bindTexture(h,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,n,s,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,n,s,o)}async readPixelsAsync(t,e,i,r,n,s,o,a){const{gl:c}=this._context,h=g.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(h);const l=this._context.boundFramebuffer;this._context.bindFramebuffer(this),c.readPixels(t,e,i,r,n,s,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(l);try{await h.getSubDataAsync(o,void 0,void 0,void 0,a)}finally{h.dispose()}}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(A(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._glName&&(A(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;this._glName?e.bindFramebuffer(t,this._glName):(this._glName&&e.deleteFramebuffer(this._glName),this._glName=e.createFramebuffer(),e.bindFramebuffer(t,this._glName),this._initializeAttachments(t))}_initializeAttachments(t=36160){const{gl:e}=this._context;if(this._colorAttachments.forEach((e,i)=>{if(b(e)){const r=C(e);35866===r?this._framebufferTextureLayer(e.glName,i,t):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=S(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,C(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(t,e=p.r6,i=3553,r=36160){this._context.gl.framebufferTexture2D(r,e,i,t,this._level)}_framebufferTextureLayer(t,e=p.r6,i=36160,r=0){this._context.gl.framebufferTextureLayer(i,e,t,this._level,r)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,m.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,S(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,m.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),A(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){A(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return p.xL;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return p.nI;case 36168:return p.uH;default:return p.r6}}_validateColorAttachmentPoint(t){if(-1===y._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;y._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-p.r6;e+1>y._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(t){return 1===M(t)}function w(t){return 2===M(t)}function T(t){return 0===M(t)}function M(t){return null!=t&&"type"in t?t.type:null}function A(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function C(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function S(t){return 6402===t?p.xL:p.nI}i(67171),i(79785);var E=i(85079),R=i(74038);const I=[new R._("position",2,p.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,p.pe.BYTE,0,4),new R._("a_tex",2,p.pe.BYTE,2,4),(0,E.Xk)(I),i(66289);const O=new Image;O.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",O.width=5,O.height=5,O.decode();let D=class extends n.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[p.$0]:[p.C5])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(t){return null}get input(){return this._frameBuffer}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],D.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],D.prototype,"techniques",null),D=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],D)},37957(t,e,i){i.d(e,{P:()=>r});const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){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]}}},48852(t,e,i){i.d(e,{g:()=>p});var r=i(4576),n=i(44208),s=i(53966),o=i(17676),a=i(78659),c=i(34275),h=i(94656),l=i(63907);const u=()=>s.A.getLogger("esri.views.webgl.BufferObject"),d=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class p{static createIndex(t,e,i){return new p(t,34963,e,i)}static createUniform(t,e,i){return new p(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new p(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new p(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new p(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(l.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,h.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case l.pe.UNSIGNED_INT:return this._sizeBytes/4;case l.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case l.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return d?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(l.vt.BufferObject,this),this._context=null):this._glName&&u().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case l.pe.UNSIGNED_SHORT:t*=2;break;case l.pe.UNSIGNED_INT:t*=4;case l.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,c.mg)(t)?this._indexType=l.pe.UNSIGNED_BYTE:(0,c.jq)(t)?this._indexType=l.pe.UNSIGNED_SHORT:(0,c.XJ)(t)&&(this._indexType=l.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,h.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:s}=this._context;s.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,h.Y2)(s),this._isVAOAware&&this._context.bindVAO(n)}getSubData(t,e=0,i,n){if(i<0||n<0)return;const s=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(s*((i??0)+(n??0))>t.byteLength)return;e+s*(n??0)>this.usedMemory&&u().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,n),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r,n){if(await this._context.clientWaitAsync((0,a.l5)(10),n),!this._context||!this._glName)throw(0,o.NK)();this.getSubData(t,e,i,r)}}},14113(t,e,i){i.d(e,{Cy:()=>u,N5:()=>a});var r=i(49186),n=(i(44208),i(53966));const s=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new p,this.varyings=new f,this.outputs=new m}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),n="vertex"===t?this.vertex:this.fragment,s=n.uniforms.generateSource(),o=n.code.generateSource(),a=n.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=n.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let n=0;n<r;++n)i[n](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n)=>{for(let s=0;s<r;++s)i[s](t,n,e)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n,s)=>{for(let o=0;o<r;++o)i[o](t,s,e,n)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0){const t=[];for(const e of this._bodies)"string"==typeof e?t.push(e):t.push(...e());return[`void main() {\n ${t.join("\n")||""} \n}`]}if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){const t=[];for(const e of this._entries)"string"==typeof e?t.push(e):t.push(...e());return t}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new g(this),this.inputs=new h}get builder(){return this}}class p{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class f{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?s().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class m{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):s().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class g{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=g._numberToFloatStr(i);break;case"int":r=g._numberToIntStr(i);break;case"uint":r=g._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])}, ${g._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])}, ${g._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])}, ${g._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>g._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},21231(t,e,i){i.d(e,{A:()=>g});var r=i(49186),n=i(44208),s=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171),d=i(12541);class p extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(t,e){return new p(t,e)}}const f=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),m=()=>s.A.getLogger("esri/views/webgl/Texture");class g{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=p.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return f?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!(0,d.Qp)(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!(0,d.Qp)(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,n,s,o,a=0){o||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=(0,d.mq)(c);const{context:h,pixelFormat:l,dataType:u,target:p,isImmutable:f}=c;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const _=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+n>c.width||i+s>c.height)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=h;a&&(n&&s||m().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),v.pixelStorei(v.UNPACK_SKIP_ROWS,a)),(0,d.Kv)(o)?v.texSubImage2D(p,t,e,i,n,s,l,u,o):(0,d.Qp)(o)?v.compressedTexSubImage2D(p,t,e,i,n,s,c.internalFormat,o.levels[t]):v.texSubImage2D(p,t,e,i,n,s,l,u,o),a&&v.pixelStorei(v.UNPACK_SKIP_ROWS,0),h.bindTexture(_,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,n,s,o,a,c){c||m().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||m().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=(0,d.mq)(h);const{context:l,pixelFormat:u,dataType:p,isImmutable:f,target:_}=h;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,d.re)(_)||m().warn("Attempting to set 3D texture data on a non-3D texture");const v=l.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||n<0||e+s>h.width||i+o>h.height||n+a>h.depth)&&m().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=l;if((0,d.Qp)(c))c=c.levels[t],x.compressedTexSubImage3D(_,t,e,i,n,s,o,a,h.internalFormat,c);else{const r=c;x.texSubImage3D(_,t,e,i,n,s,o,a,u,p,r)}l.bindTexture(v,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,d.QE)(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,(0,d.QE)(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,(0,d.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),(0,d.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,h.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),(0,d.QE)(i);const s=i.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(n);const o=e??i.target,a=(0,d.re)(o);if((0,d.Kv)(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:s,depth:c}=i;if(null==e||null==s)throw new r.A("texture:missing-size","Width and height must be specified!");if(a&&null==c)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=(0,d.mq)(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,s,c),(0,d.Qp)(t)){if(!(0,d.tl)(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,s,c,t),(0,h.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(n),i.context.bindTexture(s,g.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=(0,d.mq)(r);const n=(0,d.re)(e),{width:s,height:o,depth:a}=(0,d.Eo)(t);r.width&&r.height,r.width||(r.width=s),r.height||(r.height=o),n&&r.depth,n&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,s,o,a),this._texImage(e,0,r.internalFormat,s,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:n,height:s,depth:o}=r,a=t.levels,c=(0,d.FV)(i,n,s,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,n,s)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,n,s,o)},h)}_texStorage(t,e,i,n,s,o){const{gl:a}=this._descriptor.context;if(!(0,d.tr)(e)&&!(0,d.tl)(e))throw new r.A("texture:missing-format","Immutable textures must have a sized or compressed internal format");if(!this._descriptor.isImmutable)return;const c=i?(0,d.FV)(t,n,s,o):1;if((0,d.re)(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,n,s,o)}else a.texStorage2D(t,c,e,n,s);this._wasImmutablyAllocated=!0}_texImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t),{isImmutable:l,pixelFormat:u,dataType:p}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,n,s,o,u,p,i)}else c.texSubImage2D(t,e,0,0,n,s,u,p,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,n,s,o,0,u,p,l)}else c.texImage2D(t,e,i,n,s,0,u,p,l)}}_compressedTexImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,n,s,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,n,s,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,n,s,o,0,a)}else c.compressedTexImage2D(t,e,i,n,s,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:n,preMultiplyAlpha:s,hasMipmap:o,compress:a}=this._descriptor;if(!a)return;const{compressionTracker:h,compressionCallback:l,preserveSourceBitmap:u}=a,{compressedTextureETC:d,compressedTextureS3TC:p}=r.capabilities;if(!g.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!d&&!p)return;this.abortCompression();const f=new AbortController;let _;this._compressionAbortController=f,h?.increment();let v=!1,x=!1;try{t instanceof ImageBitmap?u?(_=await createImageBitmap(t),(0,c.Te)(f),x=!0):_=t:t instanceof Uint8Array?(_=t.buffer,v=this.descriptor.flipped):(_=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(f),x=!0);const r={data:_,width:e,height:i,needsFlip:v,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,hasMipmap:o,hasETC:!!d,hasS3TC:!!p},a=await g.compressionWorkerHandle.invoke(r,f.signal,1);if((0,c.Te)(f),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),l?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||m().error("Texture compression failed!")}finally{h?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),x&&_ instanceof ImageBitmap&&_.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==n||c&&null==s)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,n,s),o&&(1!==i||1!==n||c&&1!==s)&&!(r>=e);++r)i=Math.max(1,i>>1),n=Math.max(1,n>>1),c&&(s=Math.max(1,s>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>s,e:()=>o});var r=i(63907),n=i(42293);class s{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,n.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),n=i(63907);const s=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function o(t,e,i,n=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&s.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>u});var r=i(21818),n=i(53966),s=i(97768),o=i(69397),a=i(63907),c=i(42293),h=i(85079);const l=()=>n.A.getLogger("esri.views.webgl.VertexArrayObject");let u=class t{constructor(t,e,i,n,s){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==n?new Map:"number"==typeof n?new Map([["geometry",n]]):n,this.locations=s??(0,r.z)((0,h.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*o.i5)}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,s.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&l().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(a.vt.VertexArrayObject,this)),this._context=null):this._glName&&l().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(a.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||l().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,c.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>n});var r=i(48852);class n extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),n=i(44208),s=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],e[r]=s[0];return e}function n(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],s[1]=t[r]-s[0],e[r]=s[1];return e}i.d(e,{Zo:()=>r,jA:()=>n});const s=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function n(t,e,i,r,n=32774,s=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>T,RC:()=>o,T8:()=>a,Uy:()=>p,Xt:()=>u,iD:()=>s,kn:()=>f,nk:()=>d,p3:()=>n,uR:()=>c}),i(4718);const s=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=n(770,1,771,771),c=n(0,0,768,0),h={face:1029,mode:2305},l={face:1028,mode:2305},u=t=>2===t?h:1===t?l:null;function d(t,e,i){return{ref:t,readMask:e,stencilFront:i,stencilBack:i}}const p={zNear:0,zFar:1},f={r:!0,g:!0,b:!0,a:!0};function m(t){return C.intern(t)}function g(t){return E.intern(t)}function _(t){return I.intern(t)}function v(t){return D.intern(t)}function x(t){return F.intern(t)}function y(t){return L.intern(t)}function b(t){return U.intern(t)}function w(t){return V.intern(t)}function T(t){return G.intern(t)}class M{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function A(t){return"["+t.join(",")+"]"}const C=new M(S,t=>({__tag:"Blending",...t}));function S(t){return t?A([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const E=new M(R,t=>({__tag:"Culling",...t}));function R(t){return t?A([t.face,t.mode]):null}const I=new M(O,t=>({__tag:"PolygonOffset",...t}));function O(t){return t?A([t.factor,t.units]):null}const D=new M(P,t=>({__tag:"DepthTest",...t}));function P(t){return t?A([t.func]):null}const F=new M(N,t=>({__tag:"StencilTest",...t}));function N(t){return t?A([t.ref,t.readMask,t.stencilFront.compare,t.stencilFront.fail,t.stencilFront.zFail,t.stencilFront.zPass,t.stencilBack.compare,t.stencilBack.fail,t.stencilBack.zFail,t.stencilBack.zPass]):null}const L=new M(B,t=>({__tag:"DepthWrite",...t}));function B(t){return t?A([t.zNear,t.zFar]):null}const U=new M(H,t=>({__tag:"ColorWrite",...t}));function H(t){return t?A([t.r,t.g,t.b,t.a]):null}const V=new M(z,t=>({__tag:"StencilWrite",...t}));function z(t){return t?A([t.mask]):null}const G=new M(function(t){return t?A([S(t.blending),R(t.culling),O(t.polygonOffset),P(t.depthTest),N(t.stencilTest),B(t.depthWrite),H(t.colorWrite),z(t.stencilWrite)]):null},t=>({blending:m(t.blending),culling:g(t.culling),polygonOffset:_(t.polygonOffset),depthTest:v(t.depthTest),stencilTest:x(t.stencilTest),depthWrite:y(t.depthWrite),colorWrite:b(t.colorWrite),stencilWrite:w(t.stencilWrite)}))},12541(t,e,i){i.d(e,{CR:()=>l,Eo:()=>v,FV:()=>g,Kv:()=>f,QE:()=>c,QJ:()=>u,Qp:()=>p,mq:()=>_,re:()=>m,tl:()=>d,tr:()=>h});var r=i(49186),n=i(53966),s=i(93637),o=i(63907);const a=()=>n.A.getLogger("esri/views/webgl/textureUtils");function c(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=t;if(n&&(l(n)||u(n))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:n}=t;n&&a().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&a().error("Depth textures cannot sample mipmaps"):(9728!==r&&a().error("Depth textures without filtering must use NEAREST filtering"),i&&a().error("Depth textures without filtering cannot use compare function"))}}function h(t){return function(t){return o.XN.includes(t)}(t)||l(t)||u(t)}function l(t){return(0,s.a4)(o.SB,t)}function u(t){return(0,s.a4)(o.iE,t)}function d(t){return null!=t&&(0,s.a4)(o.CQ,t)}function p(t){return null!=t&&"type"in t&&"compressed"===t.type}function f(t){return null!=t&&!p(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function m(t){return 32879===t||35866===t}function g(t,e,i,r=1){let n=Math.max(e,i);return 32879===t&&(n=Math.max(n,r)),Math.floor(Math.log2(n))+1}function _(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case o.ld.FLOAT:switch(t.pixelFormat){case 6408:return o.H0.RGBA32F;case 6407:return o.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case o.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return o.H0.RGBA8;case 6407:return o.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?o.iE.DEPTH24_STENCIL8:6402===e?o.SB.DEPTH_COMPONENT24:e,t.internalFormat}function v(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}},49788(t,e,i){i.d(e,{Q:()=>r,v:()=>n});const r=1/255.5,n=1-r}}]);
|