@arcgis/core 5.1.0-next.113 → 5.1.0-next.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/Graphic.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{31a8bc25aa1441c70caa.js → 009250a7bded12099dd1.js} +1 -1
  4. package/assets/esri/core/workers/chunks/019a4fe7e085b2fc6ae9.js +1 -0
  5. package/assets/esri/core/workers/chunks/023837e5d9d2b6af66d8.js +1 -0
  6. package/assets/esri/core/workers/chunks/{a001e7e8a39f27284d87.js → 03c46880b69ce75a010f.js} +1 -1
  7. package/assets/esri/core/workers/chunks/0a530fbbb4486c670ea2.js +1 -0
  8. package/assets/esri/core/workers/chunks/{14b7b55c42af65ffa024.js → 0bd2b035c6ee89c725f9.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0ded5c114cbb7574f2f4.js +1 -0
  10. package/assets/esri/core/workers/chunks/{b432a5a829e309837db6.js → 0e549d942d6cba1608cf.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{7dafe608c224b9d48ffa.js → 115664cb7d7b22a315bb.js} +1 -1
  12. package/assets/esri/core/workers/chunks/123a67e84ed68b96ac59.js +1 -0
  13. package/assets/esri/core/workers/chunks/14a241b07baa67743248.js +1 -0
  14. package/assets/esri/core/workers/chunks/{054ae729e7cefa2c7778.js → 170f8dc97614e9609443.js} +1 -1
  15. package/assets/esri/core/workers/chunks/179ffa2168c42615ccf2.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4a65bc9091d7ea7e80df.js → 19f07c8d0f32ec889861.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{ca92176d5348e2c533d7.js → 224a9f39876aa426a9bc.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{0550dc63b6b1274242b8.js → 27d7c701306efeea6b82.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{8aac1155b8ac071cd2ad.js → 2855357a2c1f2ab03fb7.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{33329f5d88e60b4ec568.js → 2a8f198f6c272f92bad5.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{cb3004998eff7c60930e.js → 2b2a09ce14d00b4b1187.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{5d60253ea3d247cdb3d1.js → 2bdfae998371e3aa9f2d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/2f99a95facddc44319a9.js +1 -0
  24. package/assets/esri/core/workers/chunks/{bd17ac2e6f1eb8cf7abf.js → 2fa080539d039c92ce08.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{ee635172be7fdea69367.js → 3109b05fe4fc40d4f25b.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{92db9a6d273ae2862883.js → 315bf08dff4757ffbed3.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{593772bd8b19ac664b29.js → 35527a01d61cabbfd33e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{52a91c314afec70199bc.js → 39987c06636e757d1f00.js} +1 -1
  29. package/assets/esri/core/workers/chunks/41074d383af3662673ca.js +1 -0
  30. package/assets/esri/core/workers/chunks/49675e77a351abda2728.js +1 -0
  31. package/assets/esri/core/workers/chunks/4bfeac7338df9e0b7ce1.js +1 -0
  32. package/assets/esri/core/workers/chunks/4ffcca40e7aa24c8cc35.js +1 -0
  33. package/assets/esri/core/workers/chunks/534dd93c72ea448ee908.js +1 -0
  34. package/assets/esri/core/workers/chunks/{2dc2487d05381de07e3f.js → 548c34ea88f113d03c93.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{77ac243d4dcd901c2eec.js → 621d71d26bd20e296138.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{7e203e947846d40f897e.js → 67dffb896b6ef4b2038b.js} +1 -1
  37. package/assets/esri/core/workers/chunks/6920e7f700a9ba280dba.js +1 -0
  38. package/assets/esri/core/workers/chunks/696967c8c6f53b94f851.js +1 -0
  39. package/assets/esri/core/workers/chunks/6b1f2b36bdc6b2ff2ea5.js +1 -0
  40. package/assets/esri/core/workers/chunks/7014e73dfd3c8baa704c.js +1 -0
  41. package/assets/esri/core/workers/chunks/75dfdd85abbac26ac899.js +1 -0
  42. package/assets/esri/core/workers/chunks/76a9b64fd573775bf6cd.js +1 -0
  43. package/assets/esri/core/workers/chunks/798c4d3201fcc9f2a42b.js +1 -0
  44. package/assets/esri/core/workers/chunks/{6c79e8e840c1d027fbb2.js → 7e0daf0864005cdd63c5.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c0c693c2e0043ecba4a5.js → 817fd88fe9a48caf69fb.js} +1 -1
  46. package/assets/esri/core/workers/chunks/82f7d83a2073d1b0111c.js +1 -0
  47. package/assets/esri/core/workers/chunks/8795c4895df229cb471c.js +1 -0
  48. package/assets/esri/core/workers/chunks/{7bc746ea17f4e336e0b0.js → 8b5ee6be52e892fbd325.js} +1 -1
  49. package/assets/esri/core/workers/chunks/927c8ca7fd385b28a1b7.js +640 -0
  50. package/assets/esri/core/workers/chunks/942e527b9b92999886c7.js +1 -0
  51. package/assets/esri/core/workers/chunks/961995d8da45a9203255.js +1 -0
  52. package/assets/esri/core/workers/chunks/{eb1d6614eeac6d26bb9c.js → 9a3344f1dd22c425b8cc.js} +1 -1
  53. package/assets/esri/core/workers/chunks/9a6e62ef984e9c5babc4.js +1 -0
  54. package/assets/esri/core/workers/chunks/a0b6eef4890cc61609dc.js +1 -0
  55. package/assets/esri/core/workers/chunks/{f37be7e517f0892014e3.js → a320c69bc7528ff0d0cf.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{660713adb5a845dfa2ef.js → a40003dfe3c081d1a1d2.js} +1 -1
  57. package/assets/esri/core/workers/chunks/b5937ce657c1fff3864f.js +1 -0
  58. package/assets/esri/core/workers/chunks/{63ea9035dcf9ce45560c.js → b684ff4bc93bd60d6a19.js} +1 -1
  59. package/assets/esri/core/workers/chunks/b7a0a5b895ddd2d3d038.js +1 -0
  60. package/assets/esri/core/workers/chunks/{f3161c47a572194f6017.js → c06ae3a6ecc4a4fc67b2.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{970e91de5dfbbc247afb.js → c5b7ff8650235c464dbf.js} +1 -1
  62. package/assets/esri/core/workers/chunks/c8dedc010fcc2382af24.js +1 -0
  63. package/assets/esri/core/workers/chunks/cd2b2babcdc130b4c368.js +1 -0
  64. package/assets/esri/core/workers/chunks/{5a6523c903b11dea77d4.js → cdef9c3f80588ae45a04.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{e973cab79ec2541cb81b.js → d19600336cb6023d3e34.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{34c11e7c8762fe0c19fb.js → d39f5590022d910ee951.js} +1 -1
  67. package/assets/esri/core/workers/chunks/d412a43060441d347fb4.js +1 -0
  68. package/assets/esri/core/workers/chunks/{01c70c27aa3a955e2928.js → d41b847d08c42e5329d6.js} +2 -2
  69. package/assets/esri/core/workers/chunks/{10491b5b106bc5ad0b2b.js → d66f68a811c90739951a.js} +1 -1
  70. package/assets/esri/core/workers/chunks/d8c2bed12f937228c763.js +1 -0
  71. package/assets/esri/core/workers/chunks/de916dd0c11aefb6832e.js +1 -0
  72. package/assets/esri/core/workers/chunks/{63513e706fe55a1def15.js → e227ae2c1a63e30e62d9.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{e4c350dc65aae121171d.js → e29d182460564c2a52ad.js} +1 -1
  74. package/assets/esri/core/workers/chunks/e87d02af6d6b05e19d93.js +1 -0
  75. package/assets/esri/core/workers/chunks/f0b5c140a5ba174572b6.js +1 -0
  76. package/assets/esri/core/workers/chunks/{ce3b5b83237cf37ff523.js → f286680e363eefdf27df.js} +1 -1
  77. package/assets/esri/core/workers/chunks/f7698c855800e0af3038.js +1 -0
  78. package/assets/esri/core/workers/chunks/f931d560f3f14598f454.js +1 -0
  79. package/assets/esri/core/workers/chunks/{9890c85a238879490926.js → f9f331c76c96743d8522.js} +1 -1
  80. package/assets/esri/core/workers/chunks/fcbacca99c5a3ee5b69a.js +1 -0
  81. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  82. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  83. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery.json +1 -1
  84. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +1 -1
  85. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  86. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  87. package/chunks/Path.glsl.js +22 -17
  88. package/config.js +1 -1
  89. package/geometry/support/DoubleArray.js +1 -1
  90. package/geometry/support/Indices.js +1 -1
  91. package/kernel.js +1 -1
  92. package/layers/DimensionLayer.d.ts +22 -0
  93. package/layers/FeatureLayer.d.ts +15 -12
  94. package/layers/FeatureLayer.js +1 -1
  95. package/layers/GaussianSplatLayer.d.ts +22 -0
  96. package/layers/LineOfSightLayer.d.ts +22 -0
  97. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  98. package/layers/PointCloudLayer.d.ts +22 -0
  99. package/layers/ViewshedLayer.d.ts +22 -0
  100. package/layers/support/Field.d.ts +1 -0
  101. package/layers/support/Field.js +1 -1
  102. package/layers/support/SceneModification.js +1 -1
  103. package/layers/support/types.d.ts +1 -1
  104. package/layers/types.d.ts +1 -0
  105. package/package.json +1 -1
  106. package/rest/support/Query.d.ts +1 -0
  107. package/support/revision.js +1 -1
  108. package/symbols/cim/animationUtils.js +1 -1
  109. package/symbols/cim/defaultCIMValues.js +1 -1
  110. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  111. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  112. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  113. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  114. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  115. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  116. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  117. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  118. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  119. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  120. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  121. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  122. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  123. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  124. package/views/2d/support/clippingUtils.js +1 -1
  125. package/views/2d/support/hitTestUtils.js +1 -1
  126. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  127. package/views/3d/input/SceneInputManager.js +1 -1
  128. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  129. package/views/3d/layers/IntegratedMesh3DTilesLayerWorkerHandle.js +1 -1
  130. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  132. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  133. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  134. package/views/3d/layers/graphics/extrudeUtils.js +1 -1
  135. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  136. package/views/3d/support/engineContent/line.js +1 -1
  137. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  138. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +3 -3
  139. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +233 -0
  140. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +19 -0
  141. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +64 -40
  142. package/views/3d/webgl-engine/core/shaderModules/Float2sPassUniform.js +2 -0
  143. package/views/3d/webgl-engine/core/shaderModules/IntegersPassUniform.js +2 -0
  144. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  145. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  146. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  147. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  148. package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
  149. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  150. package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
  151. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  152. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  153. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  154. package/views/View2D.d.ts +1 -1
  155. package/views/draw/DrawTool.d.ts +34 -1
  156. package/views/input/EventMatch.js +1 -1
  157. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  158. package/widgets/BatchAttributeForm.js +1 -1
  159. package/widgets/Directions/DirectionsViewModel.js +1 -1
  160. package/widgets/Directions.js +1 -1
  161. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +7 -1
  162. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  163. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  164. package/widgets/FeatureTable/support/types.d.ts +11 -1
  165. package/widgets/FeatureTable.d.ts +7 -1
  166. package/widgets/FeatureTable.js +1 -1
  167. package/assets/esri/core/workers/chunks/02c0640005b09007bb70.js +0 -1
  168. package/assets/esri/core/workers/chunks/0c8e6ccb5a8174718d62.js +0 -640
  169. package/assets/esri/core/workers/chunks/13f0e08de2dfab07d212.js +0 -1
  170. package/assets/esri/core/workers/chunks/1c0e8808d14d8e6dde2c.js +0 -1
  171. package/assets/esri/core/workers/chunks/1c8c8050d60205cf2156.js +0 -1
  172. package/assets/esri/core/workers/chunks/23119a1b1310b7dab2aa.js +0 -1
  173. package/assets/esri/core/workers/chunks/282f3d364411efac7b80.js +0 -1
  174. package/assets/esri/core/workers/chunks/2ffffc1931b2e27c6617.js +0 -1
  175. package/assets/esri/core/workers/chunks/313a89b334e3518d30a4.js +0 -1
  176. package/assets/esri/core/workers/chunks/389e57aab12d52d72695.js +0 -1
  177. package/assets/esri/core/workers/chunks/3fed503185ea1913fb84.js +0 -1
  178. package/assets/esri/core/workers/chunks/4020f95d8131493f799e.js +0 -1
  179. package/assets/esri/core/workers/chunks/4255ad7601c7a7621b71.js +0 -1
  180. package/assets/esri/core/workers/chunks/453c3b265481c80fc625.js +0 -1
  181. package/assets/esri/core/workers/chunks/4a41f98210f1da3b5041.js +0 -1
  182. package/assets/esri/core/workers/chunks/4afe76de6e82e86fe697.js +0 -1
  183. package/assets/esri/core/workers/chunks/5a85cbc04c64091d7f46.js +0 -1
  184. package/assets/esri/core/workers/chunks/5e5c7cc74ff1c9603aff.js +0 -1
  185. package/assets/esri/core/workers/chunks/601edefd8da4eb2eda28.js +0 -1
  186. package/assets/esri/core/workers/chunks/6f02681bcaa9bef501fc.js +0 -1
  187. package/assets/esri/core/workers/chunks/7b66691d133dabd87ce6.js +0 -1
  188. package/assets/esri/core/workers/chunks/7c077e1a63ab97bf3e87.js +0 -1
  189. package/assets/esri/core/workers/chunks/7dc9ff66e1eceadbae24.js +0 -1
  190. package/assets/esri/core/workers/chunks/85a200aecc7a844c9566.js +0 -1
  191. package/assets/esri/core/workers/chunks/958617c3a9854ea04e06.js +0 -1
  192. package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +0 -1
  193. package/assets/esri/core/workers/chunks/a93a058678c8c8996d54.js +0 -1
  194. package/assets/esri/core/workers/chunks/acb8cff06142f828fb78.js +0 -1
  195. package/assets/esri/core/workers/chunks/b4badbcf1bdb7823d825.js +0 -1
  196. package/assets/esri/core/workers/chunks/b891d95b7858665cd6c1.js +0 -1
  197. package/assets/esri/core/workers/chunks/c91d4f1b42cfe474df52.js +0 -1
  198. package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +0 -1
  199. package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +0 -1
  200. package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +0 -1
  201. package/assets/esri/core/workers/chunks/e8518bd3596543b387f8.js +0 -1
  202. package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +0 -1
  203. package/assets/esri/core/workers/chunks/f91a2c69a93295cf4de6.js +0 -1
  204. package/assets/esri/core/workers/chunks/fec3fffcf854a6226df4.js +0 -1
@@ -0,0 +1,640 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7925],{72091(e,t,i){i.d(t,{H:()=>g,b:()=>p});var r=i(6733),n=i(29236),s=i(68259),o=i(20304),a=i(31821),l=i(93588),c=i(63761),h=i(9273),u=i(34053),d=i(14113);function p(){const e=new d.N5;e.include(r.Q);const{fragment:t}=e;return t.uniforms.add(new c.N("blurInput",e=>e.highlightBlurTexture),new s.t("blurSize",e=>e.blurSize),new h.R("highlightTexture",e=>e.highlightTexture),new c.N("highlightOptionsTexture",e=>e.highlightOptionsTexture),new l.c("highlightLevel",e=>e.highlightLevel),new o.m("occludedIntensityFactor",e=>e.occludedFactor)),t.constants.add("inner","float",1-(u.o-u.b)/u.o),e.include(n.y),t.main.add(a.H`vec2 highlightTextureSize = vec2(textureSize(highlightTexture,0));
2
+ vec2 uv = sUV;
3
+ vec2 center = texture(blurInput, uv).rg;
4
+ vec2 blurredHighlightValue = (vOutlinePossible == 0.0)
5
+ ? center
6
+ : center * 0.204164
7
+ + texture(blurInput, uv + blurSize * 1.407333).rg * 0.304005
8
+ + texture(blurInput, uv - blurSize * 1.407333).rg * 0.304005
9
+ + texture(blurInput, uv + blurSize * 3.294215).rg * 0.093913
10
+ + texture(blurInput, uv - blurSize * 3.294215).rg * 0.093913;
11
+ float highlightIntensity = blurredHighlightValue.r;
12
+ float occlusionWeight = blurredHighlightValue.g;
13
+ if (highlightIntensity <= 0.01) {
14
+ discard;
15
+ }
16
+ vec4 fillColor = texelFetch(highlightOptionsTexture, ivec2(highlightLevel, 0), 0);
17
+ vec4 outlineColor = texelFetch(highlightOptionsTexture, ivec2(highlightLevel, 1), 0);
18
+ uvec2 centerTexel = texelFetch(highlightTexture, ivec2(uv * highlightTextureSize), 0).rg;
19
+ uint centerBits = readLevelBits(centerTexel, highlightLevel);
20
+ bool centerFilled = (centerBits & 1u) == 1u;
21
+ bool centerOccluded = (centerBits & 3u) == 3u;
22
+ bool occluded = centerOccluded || (0.5 * highlightIntensity < occlusionWeight);
23
+ float occlusionFactor = occluded ? occludedIntensityFactor : 1.0;
24
+ float outlineFactor = centerFilled ? 1.0 : smoothstep(0.0, inner, highlightIntensity);
25
+ float fillFactor = centerFilled ? 1.0 : 0.0;
26
+ vec4 baseColor = mix(outlineColor, fillColor, fillFactor);
27
+ float intensity = baseColor.a * occlusionFactor * outlineFactor;
28
+ fragColor = vec4(baseColor.rgb, intensity);`),e}const g=Object.freeze(Object.defineProperty({__proto__:null,build:p},Symbol.toStringTag,{value:"Module"}))},28476(e,t,i){i.d(t,{H:()=>d,a:()=>h,b:()=>u});var r=i(48163),n=i(6733),s=i(68259),o=i(31821),a=i(15976),l=i(65786),c=i(14113);class h extends l.Y{constructor(){super(...arguments),this.blurSize=(0,r.vt)()}}function u(){const e=new c.N5;return e.include(n.Q),e.outputs.add("fragHighlight","vec2",0),e.fragment.uniforms.add(new s.t("blurSize",e=>e.blurSize),new a.o("blurInput",e=>e.blurInput)).main.add(o.H`vec2 highlightTextureSize = vec2(textureSize(blurInput,0));
29
+ vec2 center = texture(blurInput, sUV).rg;
30
+ if (vOutlinePossible == 0.0) {
31
+ fragHighlight = center;
32
+ } else {
33
+ vec2 sum = center * 0.204164;
34
+ sum += texture(blurInput, sUV + blurSize * 1.407333).rg * 0.304005;
35
+ sum += texture(blurInput, sUV - blurSize * 1.407333).rg * 0.304005;
36
+ sum += texture(blurInput, sUV + blurSize * 3.294215).rg * 0.093913;
37
+ sum += texture(blurInput, sUV - blurSize * 3.294215).rg * 0.093913;
38
+ fragHighlight = sum;
39
+ }`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,HighlightBlurDrawParameters:h,build:u},Symbol.toStringTag,{value:"Module"}))},34053(e,t,i){i.d(t,{H:()=>p,a:()=>l,b:()=>d,c:()=>c,g:()=>h,o:()=>u});var r=i(82048),n=i(31821),s=i(9273),o=i(65786),a=i(14113);class l extends o.Y{}function c(){const e=new a.N5,{outputs:t,fragment:i}=e;return e.include(r.c),i.uniforms.add(new s.R("highlightTexture",e=>e.highlightTexture)),i.constants.add("outlineWidth","int",Math.ceil(u)),i.constants.add("cellSize","int",h),t.add("fragGrid","uvec2"),i.main.add(n.H`ivec2 inputTextureSize = textureSize(highlightTexture, 0);
40
+ ivec2 cellBottomLeftCornerInput = ivec2(ivec2(floor(gl_FragCoord.xy) * vec2(cellSize)));
41
+ ivec2 coordMid = cellBottomLeftCornerInput + ivec2(cellSize >> 1);
42
+ uvec2 centreTexel = texelFetch(highlightTexture, coordMid, 0).rg & uvec2(0x55u);
43
+ float marginSquare = float(outlineWidth*outlineWidth);
44
+ uvec2 outputValue = centreTexel & uvec2(0x55u);
45
+ for(int y = -outlineWidth; y <= cellSize + outlineWidth; y+=2) {
46
+ int dy = y < 0 ? -y : y > cellSize ? y-cellSize : 0;
47
+ int xMargin = dy > 0 ? int(ceil(sqrt(marginSquare - float(dy*dy)))) : outlineWidth;
48
+ for(int x = -xMargin; x <= cellSize + xMargin; x+=2) {
49
+ ivec2 coord = cellBottomLeftCornerInput + ivec2(x, y);
50
+ uvec2[4] texels = uvec2[4] (
51
+ texelFetch(highlightTexture,coord+ivec2(0,0),0).rg & uvec2(0x55u),
52
+ texelFetch(highlightTexture,coord+ivec2(1,0),0).rg & uvec2(0x55u),
53
+ texelFetch(highlightTexture,coord+ivec2(0,1),0).rg & uvec2(0x55u),
54
+ texelFetch(highlightTexture,coord+ivec2(1,1),0).rg & uvec2(0x55u)
55
+ );
56
+ if (texels[0] == texels[1] && texels[1] == texels[2] && texels[2] == texels[3] && texels[3] == centreTexel) {
57
+ continue;
58
+ }
59
+ for (int i=0; i<4; ++i){
60
+ outputValue |= ((texels[i] ^ centreTexel) << 1);
61
+ outputValue |= texels[i];
62
+ }
63
+ }
64
+ }
65
+ fragGrid = outputValue;`),e}const h=32,u=9,d=.4,p=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:l,blurSize:d,build:c,gridCellPixelSize:h,outlineSize:u},Symbol.toStringTag,{value:"Module"}))},16824(e,t,i){i.d(t,{H:()=>h,b:()=>c});var r=i(6733),n=i(29236),s=i(31821),o=i(93588),a=i(9273),l=i(14113);function c(){const e=new l.N5;e.include(r.Q),e.include(n.y);const{fragment:t}=e;return e.outputs.add("fragSingleHighlight","vec2",0),t.uniforms.add(new a.R("highlightTexture",e=>e.highlightTexture),new o.c("highlightLevel",e=>e.highlightLevel)),t.main.add(s.H`ivec2 iuv = ivec2(gl_FragCoord.xy);
66
+ uvec2 inputTexel = texelFetch(highlightTexture, iuv, 0).rg;
67
+ uint bits = readLevelBits(inputTexel, highlightLevel);
68
+ bool hasHighlight = (bits & 1u) == 1u;
69
+ bool hasOccluded = (bits & 2u) == 2u;
70
+ fragSingleHighlight = vec2(hasHighlight ? 1.0 : 0.0, hasOccluded ? 1.0 : 0.0);`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,build:c},Symbol.toStringTag,{value:"Module"}))},80583(e,t,i){i.d(t,{O:()=>d,a:()=>h,b:()=>u});var r=i(82048),n=i(20304),s=i(31821),o=i(93588),a=i(63761),l=i(65786),c=i(14113);class h extends l.Y{constructor(){super(...arguments),this.overlayIndex=0,this.opacity=1}}function u(){const e=new c.N5;return e.include(r.c),e.fragment.uniforms.add(new a.N("tex",e=>e.texture)),e.fragment.uniforms.add(new o.c("overlayIdx",e=>e.overlayIndex)),e.fragment.uniforms.add(new n.m("opacity",e=>e.opacity)),e.fragment.main.add(s.H`vec2 overlayUV = overlayIdx == 0 ? vec2(uv.x * 0.5, uv.y) : vec2(uv.x * 0.5 + 0.5, uv.y);
71
+ fragColor = texture(tex, overlayUV) * opacity;`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,OverlayCompositingPassParameters:h,build:u},Symbol.toStringTag,{value:"Module"}))},32565(e,t,i){i.d(t,{R:()=>A,b:()=>T,r:()=>C});var r=i(68317),n=i(36782),s=i(84652),o=i(2923),a=i(28974),l=i(89786),c=i(82094),h=i(63365),u=i(66269),d=i(77949),p=i(77108),g=i(14314),f=i(71988),m=i(33094),v=i(20304),y=i(31821),x=i(58029),_=i(26934),b=i(54073),S=i(39122),w=i(14113);const C=1;function T(e){const t=new w.N5,{attributes:i,varyings:C,vertex:T,fragment:A}=t,{applyMarkerOffset:R,draped:E,output:O,capType:M,stippleEnabled:L,falloffEnabled:P,roundJoins:D,wireframe:I,innerColorEnabled:F,hasAnimation:z,hasScreenSizePerspective:N,worldSizedImagePattern:W}=e;T.inputs.add("position",()=>"position"),A.include(l.p),t.include(s.s,e),t.include(o.q,e),t.include(n.g,e),t.include(b.Q,e);const V=R&&!E;V&&(T.uniforms.add(new v.m("markerScale",e=>e.markerScale)),t.include(a.r,{space:2,hasScreenSizePerspective:N})),(0,d.NB)(T,e),T.uniforms.add(new x.F("inverseProjectionMatrix",e=>e.camera.inverseProjectionMatrix),new p.E("nearFar",e=>e.camera.nearFar),new v.m("miterLimit",e=>"miter"!==e.join?0:e.miterLimit),new g.I("viewport",e=>e.camera.fullViewport)),T.constants.add("LARGE_HALF_FLOAT","float",65500),T.constants.add("EPS","float",.001),T.constants.add("NUM_JOIN_SUBDIVISIONS","float",e.numJoinSubdivisions),i.add("position","vec3"),i.add("previousDelta","vec4"),i.add("nextDelta","vec4"),i.add("lineParameters","vec2"),i.add("u0","float"),C.add("vColor","vec4"),C.add("vpos","vec3",{invariant:!0}),C.add("vLineDistance","float"),C.add("vLineWidth","float"),L||(C.add("vIsInsideJoin","int"),C.add("vStretchFactor","float"),C.add("vJoinCenterLineSDFs","vec2"),C.add("vSubdivisionFactor","float"));const j=L;j&&C.add("vLineSizeInv","float");const H=2===M,U=L&&H,B=P||U;B&&C.add("vLineDistanceNorm","float"),H&&(C.add("vSegmentSDF","float"),C.add("vReverseSegmentSDF","float")),T.code.add(y.H`vec3 perpendicular(vec3 v) {
72
+ return vec3(v.y, -v.x, 0.0);
73
+ }
74
+ float interp(float ncp, vec4 a, vec4 b) {
75
+ return (-ncp - a.z) / (b.z - a.z);
76
+ }
77
+ vec3 rotateZ(vec3 v, float a) {
78
+ float s = sin(a);
79
+ float c = cos(a);
80
+ mat2 m = mat2(c, -s, s, c);
81
+ return vec3(m * v.xy, v.z);
82
+ }`),T.code.add(y.H`vec4 projectAndScale(vec4 pos) {
83
+ vec4 posNdc = proj * pos;
84
+ posNdc.xy *= viewport.zw / posNdc.w;
85
+ posNdc.z /= posNdc.w;
86
+ return posNdc;
87
+ }`),T.code.add(y.H`void clip(
88
+ inout vec4 pos,
89
+ inout vec4 prev,
90
+ inout vec4 next,
91
+ bool isStartVertex
92
+ ) {
93
+ float vnp = nearFar[0] * 0.99;
94
+ if (pos.z > -nearFar[0]) {
95
+ if (!isStartVertex) {
96
+ if (prev.z < -nearFar[0]) {
97
+ pos = mix(prev, pos, interp(vnp, prev, pos));
98
+ next = pos;
99
+ } else {
100
+ pos = vec4(0.0, 0.0, 0.0, 1.0);
101
+ }
102
+ } else {
103
+ if (next.z < -nearFar[0]) {
104
+ pos = mix(pos, next, interp(vnp, pos, next));
105
+ prev = pos;
106
+ } else {
107
+ pos = vec4(0.0, 0.0, 0.0, 1.0);
108
+ }
109
+ }
110
+ } else {
111
+ if (prev.z > -nearFar[0]) {
112
+ prev = mix(pos, prev, interp(vnp, pos, prev));
113
+ }
114
+ if (next.z > -nearFar[0]) {
115
+ next = mix(next, pos, interp(vnp, next, pos));
116
+ }
117
+ }
118
+ }`),(0,d.Nz)(T),T.constants.add("aaWidth","float",L?0:1).main.add(y.H`
119
+ // unpack values from vertex type
120
+ bool isStartVertex = abs(abs(lineParameters.y) - 3.0) == 1.0;
121
+ vec3 prevPosition = position + previousDelta.xyz * previousDelta.w;
122
+ vec3 nextPosition = position + nextDelta.xyz * nextDelta.w;
123
+
124
+ float coverage = 1.0;
125
+
126
+ // Check for special value of lineParameters.y which is used by the Renderer when graphics are removed before the
127
+ // VBO is recompacted. If this is the case, then we just project outside of clip space.
128
+ if (lineParameters.y == 0.0) {
129
+ gl_Position = ${c.Z};
130
+ }
131
+ else {
132
+ vec4 pos = view * vec4(position, 1.0);
133
+ vec4 prev = view * vec4(prevPosition, 1.0);
134
+ vec4 next = view * vec4(nextPosition, 1.0);
135
+
136
+ bool isJoin = abs(lineParameters.y) < 3.0;
137
+ `),V&&T.main.add(y.H`vec4 other = isStartVertex ? next : prev;
138
+ bool markersHidden = areWorldMarkersHidden(pos.xyz, other.xyz);
139
+ if (!isJoin && !markersHidden) {
140
+ pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos.xyz) * 0.5;
141
+ }`),t.include(u.F),T.main.add(y.H`
142
+ clip(pos, prev, next, isStartVertex);
143
+
144
+ vec3 clippedPos = pos.xyz;
145
+ vec3 clippedCenter = mix(pos.xyz, isStartVertex ? next.xyz : prev.xyz, 0.5);
146
+
147
+ pos = projectAndScale(pos);
148
+ next = projectAndScale(next);
149
+ prev = projectAndScale(prev);
150
+
151
+ vec3 left = (pos.xyz - prev.xyz);
152
+ vec3 right = (next.xyz - pos.xyz);
153
+
154
+ float leftLen = length(left);
155
+ float rightLen = length(right);
156
+
157
+ float lineSize = getSize(${(0,y.If)(N,"clippedPos")});
158
+ ${(0,y.If)(L&&N,"float patternLineSize = getSize(clippedCenter);")}
159
+ ${(0,y.If)(L&&!N,"float patternLineSize = lineSize;")}
160
+
161
+ ${(0,y.If)(W,y.H`
162
+ lineSize += aaWidth;
163
+ float lineWidth = lineSize * pixelRatio * worldToScreenRatio;
164
+ if (lineWidth < 1.0) {
165
+ coverage = lineWidth;
166
+ lineWidth = 1.0;
167
+ }
168
+ `,y.H`
169
+ if (lineSize < 1.0) {
170
+ coverage = lineSize; // convert sub-pixel coverage to alpha
171
+ lineSize = 1.0;
172
+ }
173
+
174
+ lineSize += aaWidth;
175
+ float lineWidth = lineSize * pixelRatio;
176
+ `)}
177
+
178
+ vLineWidth = noPerspectiveWrite(lineWidth, pos.w);
179
+ ${j?y.H`vLineSizeInv = noPerspectiveWrite(1.0 / lineSize, pos.w);`:""}
180
+ `),(L||H)&&T.main.add(y.H`
181
+ float isEndVertex = float(!isStartVertex);
182
+ vec3 segmentOrigin = mix(pos.xyz, prev.xyz, isEndVertex);
183
+ vec3 segment = mix(right, left, isEndVertex);
184
+ ${H?y.H`vec3 segmentEnd = mix(next.xyz, pos.xyz, isEndVertex);`:""}
185
+ `),T.main.add(y.H`left = (leftLen > EPS) ? left/leftLen : vec3(0.0, 0.0, 0.0);
186
+ right = (rightLen > EPS) ? right/rightLen : vec3(0.0, 0.0, 0.0);
187
+ vec3 segmentDirection = isStartVertex ? right : left;
188
+ vec3 capDisplacementDir = vec3(0.0, 0.0, 0.0);
189
+ vec3 joinDisplacementDir = vec3(0.0, 0.0, 0.0);
190
+ float displacementLen = lineWidth;
191
+ float miterDisplacementLen = lineWidth;
192
+ float innerDisplacementLen = lineWidth;`),L||T.main.add(y.H`vIsInsideJoin = 0;
193
+ vStretchFactor = 1.0;
194
+ vSubdivisionFactor = 0.0;
195
+ vJoinCenterLineSDFs = vec2(LARGE_HALF_FLOAT);`),T.main.add(y.H`float subdivisionFactor = 0.0;
196
+ bool isOutside = false;
197
+ if (isJoin) {
198
+ isOutside = (left.x * right.y - left.y * right.x) * lineParameters.y > 0.0;
199
+ vec3 joinDirection = normalize(left + right);
200
+ joinDisplacementDir = perpendicular(joinDirection);
201
+ if (leftLen > EPS && rightLen > EPS) {
202
+ float nDotSeg = dot(joinDisplacementDir, left);
203
+ displacementLen /= length(nDotSeg * left - joinDisplacementDir);
204
+ miterDisplacementLen = displacementLen;
205
+ innerDisplacementLen = min(displacementLen, min(leftLen, rightLen)/abs(nDotSeg));
206
+ if (!isOutside) {
207
+ displacementLen = innerDisplacementLen;
208
+ }
209
+ }
210
+ subdivisionFactor = lineParameters.x;`),L||T.main.add(y.H`if(subdivisionFactor > 0.0) {
211
+ vIsInsideJoin = 1;
212
+ }
213
+ vSubdivisionFactor = isOutside ? subdivisionFactor : 0.5;
214
+ if (miterDisplacementLen > miterLimit * lineWidth) {
215
+ vec2 leftScreenDir = left.xy;
216
+ vec2 rightScreenDir = right.xy;
217
+ float leftScreenLen = length(leftScreenDir);
218
+ float rightScreenLen = length(rightScreenDir);
219
+ if (leftScreenLen > EPS && rightScreenLen > EPS) {
220
+ leftScreenDir /= leftScreenLen;
221
+ rightScreenDir /= rightScreenLen;
222
+ float theta = acos(clamp(dot(leftScreenDir, rightScreenDir), -1.0, 1.0));
223
+ float subdividedTriangleHeight = (innerDisplacementLen + lineWidth) * cos(theta / (2.0 + 2.0 * NUM_JOIN_SUBDIVISIONS));
224
+ float bevelTriangleHeight = innerDisplacementLen + lineWidth * cos(theta * 0.5);
225
+ float triangleHeight = NUM_JOIN_SUBDIVISIONS > 0.0 ? subdividedTriangleHeight : bevelTriangleHeight;
226
+ vStretchFactor = noPerspectiveWrite(max(triangleHeight / (2.0 * lineWidth), 1.0), pos.w);
227
+ }
228
+ }`),T.main.add(y.H`if (isOutside && (displacementLen > miterLimit * lineWidth)) {`),D?T.main.add(y.H`
229
+ vec3 startDir = leftLen < EPS ? right : left;
230
+ startDir = perpendicular(startDir);
231
+
232
+ vec3 endDir = rightLen < EPS ? left : right;
233
+ endDir = perpendicular(endDir);
234
+
235
+ float factor = ${L?y.H`min(1.0, subdivisionFactor * ((NUM_JOIN_SUBDIVISIONS + 1.0) / NUM_JOIN_SUBDIVISIONS))`:y.H`subdivisionFactor`};
236
+
237
+ float rotationAngle = acos(clamp(dot(startDir.xy, endDir.xy), -1.0, 1.0));
238
+ joinDisplacementDir = rotateZ(startDir, -sign(lineParameters.y) * factor * rotationAngle);
239
+ `):T.main.add(y.H`
240
+ vec3 startDir = perpendicular(leftLen < EPS ? right : left);
241
+ vec3 endDir = perpendicular(rightLen < EPS ? left : right);
242
+
243
+ ${(0,y.If)(L,y.H`joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? endDir : startDir;`,y.H`joinDisplacementDir = mix(startDir, endDir, subdivisionFactor);`)}
244
+ `);const Z=0!==M;return T.main.add(y.H`
245
+ displacementLen = lineWidth;
246
+ }
247
+ } else {
248
+ // CAP handling ---------------------------------------------------
249
+ joinDisplacementDir = isStartVertex ? right : left;
250
+ joinDisplacementDir = perpendicular(joinDisplacementDir);
251
+
252
+ ${Z?y.H`capDisplacementDir = vec3((isStartVertex ? -right : left).xy, 0.0);`:""}
253
+ }
254
+ `),T.main.add(y.H`
255
+ // Displacement (in pixels) caused by join/or cap
256
+ vec2 dposXY = (joinDisplacementDir.xy * sign(lineParameters.y) + capDisplacementDir.xy) * displacementLen;
257
+
258
+ /**
259
+ * To prevent z-fighting between layers, we also adjust the z value.
260
+ * We want to ensure that the orientation of the final triangles is the same, regardless of the line width.
261
+ * To do so, the below formula projects the xy displacement onto the original segment direction
262
+ * to find the z-offset necessary so the triangle orientation is independent of the width.
263
+ */
264
+ float dposZ = dot(dposXY, segmentDirection.xy) / dot(segmentDirection.xy, segmentDirection.xy) * segmentDirection.z;
265
+ vec3 dpos = vec3(dposXY, dposZ);
266
+
267
+ float lineDistNorm = noPerspectiveWrite(sign(lineParameters.y), pos.w);
268
+
269
+ vLineDistance = lineWidth * lineDistNorm;
270
+ ${B?y.H`vLineDistanceNorm = lineDistNorm;`:""}
271
+
272
+ pos.xyz += dpos;
273
+ `),L||T.main.add(y.H`if (isJoin) {
274
+ vec2 joinCenterToVertex = dposXY;
275
+ vec2 leftCenterlineDir = left.xy;
276
+ vec2 rightCenterlineDir = right.xy;
277
+ float leftCenterlineLen = length(leftCenterlineDir);
278
+ float rightCenterlineLen = length(rightCenterlineDir);
279
+ leftCenterlineDir = leftCenterlineLen > EPS ? leftCenterlineDir / leftCenterlineLen : vec2(1.0, 0.0);
280
+ rightCenterlineDir = rightCenterlineLen > EPS ? rightCenterlineDir / rightCenterlineLen : leftCenterlineDir;
281
+ vJoinCenterLineSDFs = noPerspectiveWrite(
282
+ vec2(
283
+ dot(vec2(rightCenterlineDir.y, -rightCenterlineDir.x), joinCenterToVertex),
284
+ dot(vec2(leftCenterlineDir.y, -leftCenterlineDir.x), joinCenterToVertex)
285
+ ),
286
+ pos.w
287
+ );
288
+ }`),H&&T.main.add(y.H`vec2 segmentDir = normalize(segment.xy);
289
+ vSegmentSDF = noPerspectiveWrite((isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin.xy, segmentDir)), pos.w);
290
+ vReverseSegmentSDF = noPerspectiveWrite((isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd.xy, -segmentDir)), pos.w);`),L&&(E?T.uniforms.add(new m.U("worldToScreenRatio",e=>1/e.screenToPCSRatio)):T.main.add(y.H`vec3 segmentCenter = mix((nextPosition + position) * 0.5, (position + prevPosition) * 0.5, isEndVertex);
291
+ float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),T.main.add(y.H`float segmentLengthScreenDouble = length(segment.xy);
292
+ float segmentLengthScreen = segmentLengthScreenDouble * 0.5;
293
+ float discreteWorldToScreenRatio = discretizeWorldToScreenRatio(worldToScreenRatio);
294
+ float segmentLengthRender = length(mix(nextPosition - position, position - prevPosition, isEndVertex));
295
+ vStipplePatternStretch = worldToScreenRatio / discreteWorldToScreenRatio;`),E?T.main.add(y.H`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteWorldToScreenRatio / worldToScreenRatio;
296
+ float startPseudoScreen = u0 * discreteWorldToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):T.main.add(y.H`float startPseudoScreen = mix(u0, u0 - segmentLengthRender, isEndVertex) * discreteWorldToScreenRatio;
297
+ float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),T.uniforms.add(new v.m("stipplePatternPixelSize",e=>(0,o.h)(e))),T.main.add(y.H`
298
+ float patternLength = patternLineSize * stipplePatternPixelSize;
299
+
300
+ ${(0,y.If)(W,y.H`
301
+ float uu = mix(u0, u0 - segmentLengthRender, isEndVertex);
302
+ vStippleDistanceLimits = vec2(uu, uu + segmentLengthRender);
303
+ vStipplePatternStretch = 1.0;
304
+
305
+ // The v-coordinate used in case of an image pattern.
306
+ bool isLeft = sign(lineParameters.y) < 0.0;
307
+ vStippleV = isLeft ? 0.0 : 1.0;
308
+ `,y.H`
309
+ // Compute the coordinates at both start and end of the line segment, because we need both to clamp to in the
310
+ // fragment shader
311
+ vStippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength);
312
+ `)}
313
+
314
+ vStippleDistance = mix(vStippleDistanceLimits.x, vStippleDistanceLimits.y, isEndVertex);
315
+
316
+ // Adjust the coordinate to the displaced position (the pattern is shortened/overextended on the in/outside of
317
+ // joins)
318
+ if (segmentLengthScreenDouble >= EPS) {
319
+ // Project the actual vertex position onto the line segment. Note that the resulting factor is within [0..1]
320
+ // at the original vertex positions, and slightly outside of that range at the displaced positions
321
+ vec3 stippleDisplacement = pos.xyz - segmentOrigin;
322
+ float stippleDisplacementFactor = dot(segment.xy, stippleDisplacement.xy) / (segmentLengthScreenDouble * segmentLengthScreenDouble);
323
+
324
+ // Apply this offset to the actual vertex coordinate (can be screen or pseudo-screen space)
325
+ vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (vStippleDistanceLimits.y - vStippleDistanceLimits.x);
326
+ }
327
+
328
+ // Cancel out perspective correct interpolation because we want this length the really represent the screen
329
+ // distance
330
+ vStippleDistanceLimits = noPerspectiveWrite(vStippleDistanceLimits, pos.w);
331
+ vStippleDistance = noPerspectiveWrite(vStippleDistance, pos.w);
332
+
333
+ // Disable stipple distance limits on caps
334
+ vStippleDistanceLimits = isJoin ?
335
+ vStippleDistanceLimits :
336
+ isStartVertex ?
337
+ vec2(-1e34, vStippleDistanceLimits.y) :
338
+ vec2(vStippleDistanceLimits.x, 1e34);
339
+ `)),T.main.add(y.H`
340
+ // Convert back into NDC
341
+ pos.xy = (pos.xy / viewport.zw) * pos.w;
342
+ pos.z = pos.z * pos.w;
343
+
344
+ vColor = getColor();
345
+ vColor.a = noPerspectiveWrite(vColor.a * coverage, pos.w);
346
+
347
+ ${I&&!E?"pos.z -= EPS * pos.w;":""}
348
+
349
+ // transform final position to camera space for slicing
350
+ vpos = (inverseProjectionMatrix * pos).xyz;
351
+ gl_Position = pos;
352
+ forwardObjectAndLayerIdColor();
353
+ }`),t.fragment.include(r.HQ,e),t.include(S.D,e),A.include(h.a),A.main.add(y.H`discardBySlice(vpos);`),t.include(u.m),A.include(_.Q),A.main.add(y.H`
354
+ float lineWidth = noPerspectiveRead(vLineWidth);
355
+ float lineDistance = noPerspectiveRead(vLineDistance);
356
+ ${(0,y.If)(B,y.H`float lineDistanceNorm = noPerspectiveRead(vLineDistanceNorm);`)}
357
+ `),I?A.main.add(y.H`vec4 finalColor = vec4(1.0, 0.0, 1.0, 1.0);`):(H&&A.main.add(y.H`float sdf = noPerspectiveRead(min(vSegmentSDF, vReverseSegmentSDF));
358
+ vec2 fragmentPosition = vec2(min(sdf, 0.0), lineDistance);
359
+ float fragmentRadius = length(fragmentPosition);
360
+ float fragmentCapSDF = (fragmentRadius - lineWidth) * 0.5;
361
+ float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0);
362
+ if (capCoverage < alphaCutoff) {
363
+ discard;
364
+ }`),U?A.main.add(y.H`vec2 stipplePosition = vec2(
365
+ min(getStippleSDF() * 2.0 - 1.0, 0.0),
366
+ lineDistanceNorm
367
+ );
368
+ float stippleRadius = length(stipplePosition * lineWidth);
369
+ float stippleCapSDF = (stippleRadius - lineWidth) * 0.5;
370
+ float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0);
371
+ float stippleAlpha = step(alphaCutoff, stippleCoverage);`):A.main.add(y.H`float stippleAlpha = getStippleAlpha(lineWidth);`),11!==O&&A.main.add(y.H`discardByStippleAlpha(stippleAlpha, alphaCutoff);`),t.include(u.m),A.uniforms.add(new f.E("intrinsicColor",e=>e.color)).main.add(y.H`vec4 color = intrinsicColor * vColor;
372
+ color.a = noPerspectiveRead(color.a);`),F&&A.uniforms.add(new f.E("innerColor",e=>e.innerColor??e.color),new v.m("innerWidth",(e,t)=>e.innerWidth*t.camera.pixelRatio)).main.add(y.H`float distToInner = abs(lineDistance) - innerWidth;
373
+ float innerAA = clamp(0.5 - distToInner, 0.0, 1.0);
374
+ float innerAlpha = innerColor.a + color.a * (1.0 - innerColor.a);
375
+ color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`),A.main.add(y.H`vec4 finalColor = blendStipple(color, stippleAlpha);`),P&&(A.uniforms.add(new v.m("falloff",e=>e.falloff)),A.main.add(y.H`finalColor.a *= pow(max(0.0, 1.0 - abs(lineDistanceNorm)), falloff);`)),L||A.main.add(y.H`float stretchFactor = vIsInsideJoin == 1 ? noPerspectiveRead(vStretchFactor) : 1.0;
376
+ float featherWidth = 2.0;
377
+ float featherStartDistance = max(lineWidth - featherWidth / stretchFactor, 0.0);
378
+ float straightFeatherStartDistance = max(lineWidth - featherWidth, 0.0);
379
+ float value = abs(lineDistance);
380
+ float feather = (value - featherStartDistance) / (lineWidth - featherStartDistance);
381
+ vec2 joinCenterSDFs = noPerspectiveRead(vJoinCenterLineSDFs);
382
+ float joinCenterDistance = abs(vSubdivisionFactor > 0.5 ? joinCenterSDFs.x : joinCenterSDFs.y);
383
+ float straightFeather = (joinCenterDistance - straightFeatherStartDistance) / (lineWidth - straightFeatherStartDistance);
384
+ feather = vIsInsideJoin == 1 ? max(feather, straightFeather) : feather;
385
+ finalColor.a *= 1.0 - clamp(feather, 0.0, 1.0);`),z&&A.main.add(y.H`
386
+ finalColor = animate(finalColor);
387
+
388
+ ${(0,y.If)(11!==O,y.H`
389
+ if (finalColor.a <= alphaCutoff) {
390
+ discard;
391
+ }`)}
392
+ `)),A.main.add(y.H`outputColorHighlightOLID(applySlice(finalColor, vpos), finalColor.rgb);`),t}const A=Object.freeze(Object.defineProperty({__proto__:null,build:T,ribbonlineNumRoundJoinSubdivisions:C},Symbol.toStringTag,{value:"Module"}))},92942(e,t,i){i.d(t,{T:()=>d,a:()=>h,b:()=>u});var r=i(51850),n=i(82048),s=i(33079),o=i(31821),a=i(63761),l=i(65786),c=i(14113);class h extends l.Y{constructor(){super(...arguments),this.color=(0,r.fA)(1,1,1)}}function u(){const e=new c.N5;return e.include(n.c),e.fragment.uniforms.add(new a.N("tex",e=>e.texture),new s.t("uColor",e=>e.color)).main.add(o.H`vec4 texColor = texture(tex, uv);
393
+ fragColor = texColor * vec4(uColor, 1.0);`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,TexturePassParameters:h,build:u},Symbol.toStringTag,{value:"Module"}))},83349(e,t,i){function r(e,t,i){i=i||2;var r,s,a,l,c,h,d,p=t&&t.length,g=p?t[0]*i:e.length,f=n(e,0,g,i,!0),m=[];if(!f||f.next===f.prev)return m;if(p&&(f=u(e,t,f,i)),e.length>80*i){r=a=e[0],s=l=e[1];for(var v=i;v<g;v+=i)(c=e[v])<r&&(r=c),(h=e[v+1])<s&&(s=h),c>a&&(a=c),h>l&&(l=h);d=0!==(d=Math.max(a-r,l-s))?1/d:0}return o(f,m,i,r,s,d),m}function n(e,t,i,r,n){var s,o;if(n===L(e,t,i,r)>0)for(s=t;s<i;s+=r)o=E(s,e[s],e[s+1],o);else for(s=i-r;s>=t;s-=r)o=E(s,e[s],e[s+1],o);if(o&&S(o,o.next)){var a=o.next;O(o),o=a}return o}function s(e,t){if(!e)return e;t||(t=e);var i,r=e;do{if(i=!1,r.steiner||!S(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{var n=r.prev;if(O(r),(r=t=n)===r.next)break;i=!0}}while(i||r!==t);return t}function o(e,t,i,r,n,u,d){if(e){!d&&u&&m(e,r,n,u);for(var p,g,f=e;e.prev!==e.next;)if(p=e.prev,g=e.next,u?l(e,r,n,u):a(e))t.push(p.i/i),t.push(e.i/i),t.push(g.i/i),O(e),e=g.next,f=g.next;else if((e=g)===f){d?1===d?o(e=c(s(e),t,i),t,i,r,n,u,2):2===d&&h(e,t,i,r,n,u):o(s(e),t,i,r,n,u,1);break}}}function a(e){var t=e.prev,i=e,r=e.next;if(b(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(x(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&b(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function l(e,t,i,r){var n=e.prev,s=e,o=e.next;if(b(n,s,o)>=0)return!1;for(var a=n.x<s.x?n.x<o.x?n.x:o.x:s.x<o.x?s.x:o.x,l=n.y<s.y?n.y<o.y?n.y:o.y:s.y<o.y?s.y:o.y,c=n.x>s.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,h=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,u=v(a,l,t,i,r),d=v(c,h,t,i,r),p=e.prevZ,g=e.nextZ;p&&p.z>=u&&g&&g.z<=d;){if(p!==e.prev&&p!==e.next&&x(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,g!==e.prev&&g!==e.next&&x(n.x,n.y,s.x,s.y,o.x,o.y,g.x,g.y)&&b(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;p&&p.z>=u;){if(p!==e.prev&&p!==e.next&&x(n.x,n.y,s.x,s.y,o.x,o.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;g&&g.z<=d;){if(g!==e.prev&&g!==e.next&&x(n.x,n.y,s.x,s.y,o.x,o.y,g.x,g.y)&&b(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function c(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!S(n,o)&&w(n,r,r.next,o)&&A(n,o)&&A(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),O(r),O(r.next),r=e=o),r=r.next}while(r!==e);return s(r)}function h(e,t,i,r,n,a){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&_(l,c)){var h=R(l,c);return l=s(l,l.next),h=s(h,h.next),o(l,t,i,r,n,a),void o(h,t,i,r,n,a)}c=c.next}l=l.next}while(l!==e)}function u(e,t,i,r){var o,a,l,c=[];for(o=0,a=t.length;o<a;o++)(l=n(e,t[o]*r,o<a-1?t[o+1]*r:e.length,r,!1))===l.next&&(l.steiner=!0),c.push(y(l));for(c.sort(d),o=0;o<c.length;o++)i=s(i=g(c[o],i),i.next);return i}function d(e,t){return e.x-t.x}function p(e){if(e.next.prev===e)return e;let t=e;for(;;){const i=t.next;if(i.prev===t||i===t||i===e)break;t=i}return t}function g(e,t){var i=function(e,t){var i,r=t,n=e.x,s=e.y,o=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var a=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&a>o){if(o=a,a===n){if(s===r.y)return r;if(s===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===o)return i;var l,c=i,h=i.x,u=i.y,d=1/0;r=i;do{n>=r.x&&r.x>=h&&n!==r.x&&x(s<u?n:o,s,h,u,s<u?o:n,s,r.x,r.y)&&(l=Math.abs(s-r.y)/(n-r.x),A(r,e)&&(l<d||l===d&&(r.x>i.x||r.x===i.x&&f(i,r)))&&(i=r,d=l)),r=r.next}while(r!==c);return i}(e,t);if(!i)return t;var r=R(i,e),n=s(i,i.next);let o=p(r);return s(o,o.next),n=p(n),p(t===i?n:t)}function f(e,t){return b(e.prev,e,t.prev)<0&&b(t.next,e,e.next)<0}function m(e,t,i,r){var n=e;do{null===n.z&&(n.z=v(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,i,r,n,s,o,a,l,c=1;do{for(i=e,e=null,s=null,o=0;i;){for(o++,r=i,a=0,t=0;t<c&&(a++,r=r.nextZ);t++);for(l=c;a>0||l>0&&r;)0!==a&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,a--):(n=r,r=r.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;i=r}s.nextZ=null,c*=2}while(o>1)}(n)}function v(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function y(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function x(e,t,i,r,n,s,o,a){return(n-o)*(t-a)-(e-o)*(s-a)>=0&&(e-o)*(r-a)-(i-o)*(t-a)>=0&&(i-o)*(s-a)-(n-o)*(r-a)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&w(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(A(e,t)&&A(t,e)&&function(e,t){var i=e,r=!1,n=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==e);return r}(e,t)&&(b(e.prev,e,t.prev)||b(e,t.prev,t))||S(e,t)&&b(e.prev,e,e.next)>0&&b(t.prev,t,t.next)>0)}function b(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function w(e,t,i,r){var n=T(b(e,t,i)),s=T(b(e,t,r)),o=T(b(i,r,e)),a=T(b(i,r,t));return n!==s&&o!==a||!(0!==n||!C(e,i,t))||!(0!==s||!C(e,r,t))||!(0!==o||!C(i,e,r))||!(0!==a||!C(i,t,r))}function C(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function T(e){return e>0?1:e<0?-1:0}function A(e,t){return b(e.prev,e,e.next)<0?b(e,t,e.next)>=0&&b(e,e.prev,t)>=0:b(e,t,e.prev)<0||b(e,e.next,t)<0}function R(e,t){var i=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),n=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function E(e,t,i,r){var n=new M(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function O(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(e,t,i,r){for(var n=0,s=t,o=i-r;s<i;s+=r)n+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return n}i.d(t,{e:()=>r}),r.deviation=function(e,t,i,r){var n=t&&t.length,s=n?t[0]*i:e.length,o=Math.abs(L(e,0,s,i));if(n)for(var a=0,l=t.length;a<l;a++){var c=t[a]*i,h=a<l-1?t[a+1]*i:e.length;o-=Math.abs(L(e,c,h,i))}var u=0;for(a=0;a<r.length;a+=3){var d=r[a]*i,p=r[a+1]*i,g=r[a+2]*i;u+=Math.abs((e[d]-e[g])*(e[p+1]-e[d+1])-(e[d]-e[p])*(e[g+1]-e[d+1]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},r.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var s=0;s<e[n].length;s++)for(var o=0;o<t;o++)i.vertices.push(e[n][s][o]);n>0&&(r+=e[n-1].length,i.holes.push(r))}return i}},21287(e,t,i){i.d(t,{M5:()=>u,eV:()=>h});var r=i(11254),n=i(49186),s=i(17676),o=i(84952),a=i(26306);let l=null,c=!0;function h(e,t,i,r){if(!t||!i)throw new Error("Cannot construct image data without dimensions");if(c)try{return new ImageData(e,t,i)}catch(e){c=!1}const n=function(e,t,i){return i||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),i=l),i.getContext("2d").createImageData(e,t)}(t,i,r);return n.data.set(e,0),n}async function u(e,t){const{arrayBuffer:l,mediaType:c}=await async function(e,t){const i=(0,o.r$)(e);if(i?.isBase64)return{arrayBuffer:(0,a.M)(i.data),mediaType:i.mediaType};const n=await(0,r.A)(e,{responseType:"array-buffer",...t});return{arrayBuffer:n.data,mediaType:n.getHeader?.("Content-Type")??""}}(e,t),h="image/png"===c;if("image/gif"===c){const{isAnimatedGIF:e,parseGif:r}=await i.e(820).then(i.bind(i,10820));if(e(l))return r(l,t)}if(h){const{isAnimatedPNG:e,parseApng:r}=await i.e(2390).then(i.bind(i,22390));if(e(l))return r(l,t)}return async function(e,t){const i=window.URL.createObjectURL(e);try{const{data:e}=await(0,r.A)(i,{...t,responseType:"image"});return e}catch(e){if(!(0,s.zf)(e))throw new n.A("invalid-image",`Could not fetch requested image at ${i}`);throw e}finally{window.URL.revokeObjectURL(i)}}(new Blob([l],{type:c}),t)}},44794(e,t,i){i.d(t,{v:()=>a});var r=i(4718),n=i(62788),s=i(95488);class o{constructor(e,t){this._observable=new s.I,this._value=e,this._equalityFunction=t}get value(){return(0,n.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function a(e,t=r.gh){return new o(e,t)}},27925(e,t,i){i.r(t),i.d(t,{default:()=>ls});var r=i(5482),n=i(69540),s=i(49186),o=i(92474),a=i(53966),l=i(61893),c=i(17676),h=i(36708),u=i(91429),d=i(51850),p=i(91075),g=i(86738),f=i(39829),m=i(70328),v=i(24770),y=i(16939);const x="Expected location to be a Point instance";class _ extends s.A{constructor(){super("invalid-input:location",x)}}var b=i(95696),S=i(18251),w=i(73836),C=i(1193),T=i(27615),A=i(35522),R=i(65806);function E(e,t){switch(e.type){case"georeferenced":return t.isGeographic;case"local":return t.isGeographic||t.isWebMercator}}var O=i(22141),M=i(72258);const L=()=>a.A.getLogger("esri.geometry.support.meshUtils.centerAt");const P=(0,d.vt)(),D=(0,d.vt)(),I=(0,d.vt)();var F=i(9093),z=i(5443),N=i(91218),W=i(98764),V=i(48353),j=i(9762),H=i(4197),U=i(73354);const B=(0,F.vt)(),Z=(0,H.jh)(24);var k=i(84952);function G(e){const t=(0,k.nM)(e.url);return i=>{const r=(0,k.V1)(i,t,t),n=r?r.replace(/^ *\.\//,""):null;return(n?e.files.get(n):null)??i}}async function q(e,t){switch(e.type){case"client":return Array.isArray(e.files)?function(e){if(!e.length)throw new s.A("mesh-load-external:missing-assets","There must be at least one file to load");return ee(e.map(e=>({name:e.name,mimeType:e.type,source:$(e)})))}(e.files):$(e.files);case"service":return async function(e,t){if(!e.length)throw new s.A("mesh-load-external:missing-assets","There must be at least one file to load");const i=await(0,c.nA)(e.map(async e=>{const i=await async function(e,t){const{parts:i,assetMimeType:r,assetName:n}=e;if(1===i.length)return new te(i[0].partUrl);const s=await e.toBlob(t);return(0,c.Te)(t),te.fromBlob(s,ie(n,r))}(e);return(0,c.Te)(t),{name:e.assetName,mimeType:e.assetMimeType,source:i}}));if((0,c.G4)(t))throw i.forEach(e=>e.source.dispose()),(0,c.NK)();return ee(i)}(e.assets,t);default:throw new s.A("mesh-load-external:invalid-source","Invalid source type")}}function $(e){return te.fromBlob(e,ie(e.name,e.type))}const Y=/^model\/gltf\+json$/,Q=/^model\/gltf-binary$/,K=/\.gltf$/i,X=/\.glb$/i;function J({mimeType:e,source:t,name:i}){return Y.test(e)||K.test(i)?{url:t.url,type:"gltf"}:Q.test(e)||X.test(i)?{url:t.url,type:"glb"}:null}function ee(e){const t=new Map;let i=null,r=null;for(const n of e){const{source:e,name:s}=n;i??=J(n),"ESRI3DO_NORM.glb"===s&&(r=J(n)),t.set(s,e.url),e.files.forEach((e,i)=>t.set(i,e))}const n=r??i;if(null==n)throw new s.A("mesh-load-external:missing-files","Missing files to load external mesh source");return new te(n.url,()=>e.forEach(({source:e})=>e.dispose()),t,n.type)}class te{constructor(e,t=()=>{},i=new Map,r){this.url=e,this.dispose=t,this.files=i,this.type=r}static fromBlob(e,t){const i=URL.createObjectURL(e);return new te(i,()=>URL.revokeObjectURL(i),void 0,t)}}function ie(e,t){return Y.test(t)||K.test(e)?"gltf":Q.test(t)||K.test(e)?"glb":void 0}var re=i(66895),ne=i(7762),se=i(63579);let oe=class extends n.Pw{constructor(e){super(e),this.externalSources=new ne.A,this._explicitDisplaySource=null,this.addHandles((0,h.on)(()=>this.externalSources,"after-remove",({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(null!=e&&!(0,se.yr)(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!(0,se.in)(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>(0,se.eN)(t,e))}get _implicitDisplaySource(){return this.externalSources.find(se.yr)}};(0,r.Cg)([(0,u.MZ)()],oe.prototype,"externalSources",void 0),(0,r.Cg)([(0,u.MZ)()],oe.prototype,"displaySource",null),(0,r.Cg)([(0,u.MZ)()],oe.prototype,"_implicitDisplaySource",null),(0,r.Cg)([(0,u.MZ)()],oe.prototype,"_explicitDisplaySource",void 0),oe=(0,r.Cg)([(0,u.$K)("esri.geometry.support.meshUtils.Metadata")],oe);var ae=i(29242);const le={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[3,1,2],west:[-3,-1,2],north:[-1,3,2],south:[1,-3,2],up:[1,2,3],down:[1,-2,-3]}};function ce(e,t,i){e.isPlane||function(e){for(let t=0;t<e.position.length;t+=3)e.position[t+2]+=.5}(e),function(e,t){if(null!=t){pe[0]=t[0],pe[4]=t[1],pe[8]=t[2];for(let t=0;t<e.position.length;t+=3){for(let i=0;i<3;i++)de[i]=e.position[t+i];(0,A.ei)(de,de,pe);for(let i=0;i<3;i++)e.position[t+i]=de[i]}if(t[0]!==t[1]||t[1]!==t[2]){pe[0]=1/t[0],pe[4]=1/t[1],pe[8]=1/t[2];for(let t=0;t<e.normal.length;t+=3){for(let i=0;i<3;i++)de[i]=e.normal[t+i];(0,A.ei)(de,de,pe),(0,A.S8)(de,de);for(let i=0;i<3;i++)e.normal[t+i]=de[i]}}}}(e,function(e,t,i){const r=(0,M.xK)(t,i);if(null==e&&1===r)return null;if(null==e)return[r,r,r];if("number"==typeof e){const t=e*r;return[t,t,t]}return[null!=e.width?e.width*r:r,null!=e.depth?e.depth*r:r,null!=e.height?e.height*r:r]}(i?.size,i?.unit,t.spatialReference));const r=(0,T.TE)(t,i),n=t.spatialReference.isGeographic?(0,T.TE)(t):r,s=(0,M.UR)({vertexAttributes:e,vertexSpace:n,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new C.default({...s,uv:e.uv}),vertexSpace:r,components:[new y.default({faces:e.faces,material:i?.material||null})],spatialReference:t.spatialReference}}const he={faceDescriptions:[{axis:[0,-1,0],uvOrigin:[0,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[1,0,0],uvOrigin:[.25,.625],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,1,0],uvOrigin:[.5,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[-1,0,0],uvOrigin:[.75,.625],corners:[[1,-1],[-1,-1],[-1,1],[1,1]]},{axis:[0,0,1],uvOrigin:[0,.375],corners:[[-1,-1],[1,-1],[1,1],[-1,1]]},{axis:[0,0,-1],uvOrigin:[0,.875],corners:[[-1,1],[1,1],[1,-1],[-1,-1]]}],uvScales:[[0,0],[1,0],[1,1],[0,1]],faceVertexOffsets:[0,1,2,0,2,3]},ue={south:0,east:1,north:2,west:3,up:4,down:5},de=(0,d.vt)(),pe=(0,ae.vt)();var ge=i(77690),fe=i(58083),me=i(67026),ve=i(82534);const ye=()=>a.A.getLogger("esri.geometry.support.meshUtils.rotate");function xe(e,t,i,r=d.uY){if(null!=e){(0,fe.$0)(we,(0,v.$I)(t),(0,v.yo)(t));for(let t=0;t<e.length;t+=i){for(let i=0;i<3;i++)_e[i]=e[t+i]-r[i];(0,A.Z0)(_e,_e,we);for(let i=0;i<3;i++)e[t+i]=_e[i]+r[i]}}}const _e=(0,d.vt)(),be=(0,F.vt)(),Se=(0,v.vt)(),we=(0,F.vt)(),Ce=(0,ae.vt)(),Te=(0,d.vt)(),Ae=(0,ve.vt)(),Re=()=>a.A.getLogger("esri.geometry.support.meshUtils.scale");function Ee(e,t,i=d.uY){if(e)for(let r=0;r<e.length;r+=3){for(let t=0;t<3;t++)Oe[t]=e[r+t]-i[t];(0,A.hs)(Oe,Oe,t);for(let t=0;t<3;t++)e[r+t]=Oe[t]+i[t]}}const Oe=(0,d.vt)(),Me=(0,d.vt)(),Le=(0,F.vt)(),Pe=(0,d.vt)();(0,F.vt)(),new class{constructor(){this.verticalDistanceToGround=0,this.sampledElevation=0,this.z=0}},(0,d.vt)();var De=i(44208),Ie=i(62788),Fe=i(95488),ze=i(83349),Ne=i(15585),We=i(95108),Ve=i(97146),je=i(34727),He=i(86211),Ue=i(27921);const Be=(0,Ue.vt)();function Ze(e,t,i){if(!t)return 2;const r=e.map(e=>{const r=Xe(e,t);return r<3?2:function(e,t,i){const r=function(e,t,i,r){const n=(e=>!Array.isArray(e[0]))(t)?(e,i)=>t[3*e+i]:(e,i)=>t[e][i],s=(0,He.GA)(r)/(0,He.G9)(r);return(0,Ue.lU)(e,(e,t)=>(0,A.hZ)(e,n(t,0)*s,n(t,1)*s,n(t,2)),i)}(Be,e,t,i)?(0,Ue.Qj)(Be):[0,0,1];return Math.abs(r[2])>Math.cos((0,je.kU)(80))?2:Math.abs(r[1])>Math.abs(r[0])?1:0}(e,r,i)}),n=r[0];return r.every(e=>e===n)?n:2}function ke(e,t,i){if(!t)return!(0,We.$3)(e);if(e.length<3)return!1;switch(i){case 0:return!(0,We.$3)(e,1,2);case 1:return!(0,We.$3)(e,0,2);case 2:return!(0,We.$3)(e,0,1)}}const Ge=new Fe.I;function qe(e,t){if(!(0,Ne.O9)())return Je("libtess-not-loaded");const i=null!=t.outlines,{positions:r,mergedPathLengths:n}=function(e){const t=function(e){const t=e.reduce((e,t)=>e+t.pathLengths.length,0),i=new Array(t);let r=0;for(let t=0;t<e.length;t++){const n=e[t].pathLengths;for(let e=0;e<n.length;e++)i[r++]=n[e]}return i}(e.polygons),i=3*e.polygonVertexCount;return i===e.positions.length?{positions:e.positions,mergedPathLengths:t}:{positions:(0,H.l5)(e.positions,0,i),mergedPathLengths:t}}(e),{vertices:s,indices:o,outlineIndices:a,outlineRingLengths:l}=(0,Ne.O5)(r,n,3,i);if(s.length%3!=0)return Je("positions-not-multiple-of-3");const{positions:c,outlineIndexBuffer:h,mergedOutlineRingLengths:u}=i?function(e,t,i,r,n){const s=e.polygonVertexCount,o=t?.filter(e=>e.index>=s)??[];if(0===o.length)return{positions:i,outlineIndexBuffer:r,mergedOutlineRingLengths:n};const a=3*s,l=(0,H.l5)(e.positions,a,e.positions.length-a),c=(0,H.yH)(i,l),h=i.length/3,u=o.map(e=>({index:h+e.index-s,count:e.count})),{outlineIndexBuffer:d,outlineRingLengths:p}=Ye(u,c);return{positions:c,outlineIndexBuffer:(0,Ve.lC)(r,d,c.length/3),mergedOutlineRingLengths:(0,Ve.lC)(n,p,n.length+p.length)}}(e,t.outlines,s,a,l):{positions:s,outlineIndexBuffer:void 0,mergedOutlineRingLengths:void 0};return{succeeded:!0,positions:c,indices:o,outlineIndexBuffer:h,outlineRingLengths:u,vertexCount:c.length/3,method:"libtess"}}function $e(e,t,i){for(let r=0;r<e.length;r+=3){const n=e[r+t];e[r+t]=e[r+i],e[r+i]=n}}function Ye(e,t){const i=(0,Ve.my)(e.length);let r=0;for(let n=0;n<e.length;n++){const s=e[n],o=s.count;if(o<=0){i[n]=0;continue}const a=3*s.index,l=3*(s.index+o-1),c=o>1&&t[a]===t[l]&&t[a+1]===t[l+1]&&t[a+2]===t[l+2]?o-1:o,h=c>0?c+1:0;i[n]=h,r+=h}const n=(0,Ve.my)(r,t.length/3);let s=0;for(let t=0;t<e.length;t++){const r=i[t];if(0===r)continue;const o=e[t].index,a=r-1;for(let e=0;e<a;e++)n[s++]=o+e;n[s++]=o}return{outlineIndexBuffer:n,outlineRingLengths:i}}function Qe(e,{index:t,count:i}){return(0,H.l5)(e,3*t,3*i)}function Ke(e,t,i,r,n,s){let o=s?e.length-1:0;const a=s?-1:1;i*=3;for(let s=0;s<r;++s){const r=e[o];t[i++]=r[0],t[i++]=r[1],t[i++]=n&&null!=r[2]?r[2]:0,o+=a}return i/3}function Xe(e,t){return function(e,t){const i=e.length;if(i<2)return!1;const r=e[0],n=e[i-1];return r[0]===n[0]&&r[1]===n[1]&&(!t||r[2]===n[2])}(e,t)?e.length-1:e.length}function Je(e){return{succeeded:!1,message:e}}var et=i(4576),tt=i(65529),it=i(91869),rt=i(97768),nt=i(15142),st=i(3483),ot=i(26857),at=i(78955),lt=i(19419);class ct{constructor(e,t){this.vec3=e,this.id=t}}function ht(e,t,i,r){return new ct((0,d.fA)(e,t,i),r)}class ut{constructor(){this._extent=(0,lt.vt)(),this.resolution=0,this.renderLocalOrigin=ht(0,0,0,"O"),this.pixelRatio=1,this.mapUnitsPerPixel=1,this.canvasGeometries=new dt}get extent(){return this._extent}setExtent(e){(0,at.C)(this._extent,e)}setupGeometryViews(e){if(this._setupGeometryView(),!e)return;const t=.001*e.range;if(this._extent[0]-t<=e.min){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];(0,lt.cY)(this._extent,e.range,0,t)}if(this._extent[2]+t>=e.max){const t=this.canvasGeometries.extents[this.canvasGeometries.numViews++];(0,lt.cY)(this._extent,-e.range,0,t)}}_setupGeometryView(){this.canvasGeometries.numViews=1,(0,lt.C)(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let e=0;e<this.canvasGeometries.numViews;e++){const t=this.canvasGeometries.extents[e];if(t[0]!==t[2]&&t[1]!==t[3])return!0}return!1}}class dt{constructor(){this.extents=[(0,lt.vt)(),(0,lt.vt)(),(0,lt.vt)()],this.numViews=0}}class pt{constructor(e,t,i){this._fbos=e,this._format=t,this._name=i}get valid(){return null!=this._handle?.getTexture()}dispose(){this._handle=(0,rt.Gz)(this._handle)}get texture(){return this._handle?.getTexture()}ensureFramebuffer(e,t){this._handle&&this._handle.fbo?.width===e&&this._handle.fbo?.height===t||(this._handle?.release(),this._handle=this._fbos.acquire(e,t,this._name,this._format))}bind(e){e.bindFramebuffer(this._handle?.fbo)}generateMipMap(){this._handle?.getTexture()?.descriptor?.hasMipmap&&this._handle?.getTexture()?.generateMipmap()}}var gt=i(16943);class ft{constructor(e,t,i,r,n=1,s=6){this.output=i,this.content=r,this.redrawOnRequest=n,this.fbo=new pt(e,s,t)}handleRenderRequest(e){return 1===e||e===this.redrawOnRequest}get valid(){return this.fbo.valid}}class mt{constructor(e){const t=[new ft(e,"overlay color",0,0),new ft(e,"overlay IM color",0,1),new ft(e,"overlay highlight",10,2,1,3),new ft(e,"overlay water",4,3,0),new ft(e,"overlay occluded",0,4)];(0,gt.E)()&&t.push(new ft(e,"overlay olid",11,5,1,5)),this.targets=t}getTexture(e){return this.targets[e]?.fbo.texture}dispose(e){if(0!==e)for(const e of this.targets)e.fbo.dispose();else this.targets[3].fbo.dispose()}computeValidity(){return this.targets.reduce((e,t,i)=>t.valid?e|=1<<i:e,0)}}var vt=i(91712),yt=i(69622);class xt extends yt.A{precompile(e){return!!this.acquireTechniques(e)}get usedMemory(){return 0}get renderOccludedFlags(){return 1}get testsTransparentRenderOrder(){return 0}get isDecoration(){return!1}get readyToRun(){return!1}get numGeometries(){return 0}get hasOccludees(){return!1}get hasEmissions(){return 0}forEachGeometry(e){}}class _t extends xt{}var bt=i(37585),St=i(2016),wt=i(48375),Ct=i(13840),Tt=i(98958),At=i(72091),Rt=i(41976),Et=i(90644);let Ot=class extends Tt.w{constructor(e,t){super(e,t,Rt.wR),this.shader=new Ct.r(At.H,()=>i.e(785).then(i.bind(i,13166)))}initializePipeline(){return(0,Et.Ey)({blending:Et.T8,colorWrite:Et.kn})}};Ot=(0,r.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightApplyTechnique")],Ot);var Mt=i(28476);let Lt=class extends Tt.w{constructor(e,t){super(e,t,Rt.wR),this.shader=new Ct.r(Mt.H,()=>i.e(6027).then(i.bind(i,76027)))}initializePipeline(){return(0,Et.Ey)({colorWrite:Et.kn})}};Lt=(0,r.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightBlurTechnique")],Lt);var Pt=i(34053);let Dt=class extends Tt.w{constructor(){super(...arguments),this.shader=new Ct.r(Pt.H,()=>i.e(9438).then(i.bind(i,29438)))}initializePipeline(){return(0,Et.Ey)({colorWrite:Et.kn})}};Dt=(0,r.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightDownsampleTechnique")],Dt);var It=i(68197);new It.A("cyan"),new It.A("black"),new It.A("yellow");var Ft=i(65786);class zt extends Ft.Y{constructor(){super(...arguments),this.occludedFactor=.25,this.verticalCellCount=0,this.horizontalCellCount=0,this.highlightLevel=0,this.pixelRatio=1}}var Nt=i(16824);let Wt=class extends Tt.w{constructor(e,t){super(e,t,Rt.wR),this.shader=new Ct.r(Nt.H,()=>i.e(1011).then(i.bind(i,51011)))}initializePipeline(){return(0,Et.Ey)({colorWrite:Et.kn})}};Wt=(0,r.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.highlight.HighlightToSingleTechnique")],Wt);var Vt=i(79785);class jt extends Vt.Z{}var Ht=i(48852),Ut=i(63907),Bt=i(21231),Zt=i(67171),kt=i(66289);let Gt=class extends wt.A{constructor(){super(...arguments),this.produces=St.OG.HIGHLIGHT_COLOR,this.consumes={required:[St.OG.HIGHLIGHT_COLOR,"highlights"]},this._downsampleDrawParameters=new Pt.a,this._passParameters=new zt,this._highlightBlurDrawParameters=new Mt.a,this._grid=new qt}initialize(){this.addHandles([(0,h.wB)(()=>this._updateOptionsTexture(),()=>{},h.Vh)])}destroy(){this._grid.coverage=(0,rt.Gz)(this._grid.coverage),this._grid.vao=(0,rt.WD)(this._grid.vao),this._passParameters.highlightOptionsTexture=(0,rt.Gz)(this._passParameters.highlightOptionsTexture)}_updateOptionsTexture(){if(null==this._passParameters.highlightOptionsTexture){const e=new Zt.R(16,2);e.internalFormat=6408,e.samplingMode=9728,this._passParameters.highlightOptionsTexture=new Bt.A(this.renderingContext,e,null)}this._passParameters.highlightOptionsTexture.setData(function(e){const t=new Uint8Array(128);let i=0;for(const r of e){const e=4*i,n=4*i+64;++i;const{color:s}=r,o=r.haloColor??s;t[e+0]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=r.fillOpacity*s.a*255,t[n+0]=o.r,t[n+1]=o.g,t[n+2]=o.b,t[n+3]=r.haloOpacity*o.a*255}return t}(this.view.state.highlights)),this.requestRender(1)}render(e){const t=e.find(({name:e})=>e===St.OG.HIGHLIGHT_COLOR),{techniques:i,bindParameters:r,fboCache:n,_passParameters:s,renderingContext:o}=this;if(!r.decorations)return t;const a=i.getCompiled(Dt),l=i.getCompiled(Wt),c=i.getCompiled(Lt),h=i.getCompiled(Ot);if(!(a&&h&&c&&l))return this.requestRender(1),t;const u=e.find(({name:e})=>"highlights"===e).getTexture();s.highlightTexture=u;const d=this._prepareAndDownSample(u),{width:p,height:g}=u.descriptor;s.highlightTexture=u;const{camera:f}=r,{fullWidth:m,fullHeight:v,pixelRatio:y,fullViewport:x}=f,_=Math.ceil(m/y),b=Math.ceil(v/y),{_highlightBlurDrawParameters:S}=this,w=this.view.stage.renderView.renderer,{highlights:C}=r;for(let e=0;e<C.length;++e){const{name:i}=C[e];if(!w.hasHighlight(i))continue;s.highlightLevel=e,o.setClearColor(0,0,0,0);const a=n.acquire(p,g,"single highlight",2);o.bindFramebuffer(a.fbo),o.setViewport(0,0,p,g),o.clear(16384),o.bindTechnique(l,r,s),this._renderGrid(d),S.blurInput=a.getTexture(),(0,bt.hZ)(S.blurSize,1/_,0);const u=n.acquire(_,b,"single highlight blur",2);o.unbindTexture(u.fbo?.colorTexture),o.bindFramebuffer(u.fbo),o.setViewport(0,0,_,b),o.clear(16384),o.bindTechnique(c,r,s,S),this._renderGrid(d),a.release(),(0,bt.hZ)(S.blurSize,0,1/b),s.highlightBlurTexture=u.getTexture(),o.bindFramebuffer(t.fbo),o.setDrawBuffers([Ut.r6]),o.setViewport4fv(x),o.bindTechnique(h,r,s,S),this._renderGrid(d),u.release()}return s.coverageTexture=s.highlightTexture=null,t}_prepareAndDownSample(e){this._gridUpdateResources(e);const t=this.techniques.get(Dt),i=this._gridComputeCoverage(t,e),{horizontalCellCount:r,verticalCellCount:n}=i,s=this._passParameters;return s.horizontalCellCount=r,s.verticalCellCount=n,s.coverageTexture=i.coverage?.getTexture(),i}_renderGrid(e){const t=e.verticalCellCount*e.horizontalCellCount;this.renderingContext.bindVAO(e.vao),this.renderingContext.drawElementsInstanced(Ut.WR.TRIANGLES,6,Ut.pe.UNSIGNED_BYTE,0,t)}_gridUpdateResources(e){const t=this._grid,{width:i,height:r}=e.descriptor;if(t.horizontalCellCount=Math.ceil(i/Pt.g),t.verticalCellCount=Math.ceil(r/Pt.g),t.vao)return;const n=this.renderingContext,s=Ht.g.createIndex(n,35044,Yt);t.vao=new jt(n,new kt.R(n,Rt.wR),s)}_gridComputeCoverage(e,t){const i=this.renderingContext,r=this._grid,n=t.descriptor,s=Math.ceil(n.width/Pt.g),o=Math.ceil(n.height/Pt.g);this._downsampleDrawParameters.input=t;const{highlights:a}=this.bindParameters;r.coverage?.release();const l=this.fboCache.acquire(s,o,"highlight coverage",a.length>Qt?3:1);return r.coverage=l,i.bindFramebuffer(l.fbo),i.bindTechnique(e,this.bindParameters,this._passParameters,this._downsampleDrawParameters),i.setViewport(0,0,s,o),i.screen.draw(),r}get test(){}};(0,r.Cg)([(0,u.MZ)()],Gt.prototype,"produces",void 0),(0,r.Cg)([(0,u.MZ)()],Gt.prototype,"consumes",void 0),Gt=(0,r.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.highlight.Highlight")],Gt);class qt{constructor(){this.coverage=null,this.vao=null,this.verticalCellCount=0,this.horizontalCellCount=0,this.viewportWidth=0,this.viewportHeight=0}}let $t=0;const Yt=new Uint8Array([0,1,2,2,1,3]),Qt=4;class Kt{constructor(e,t,i){this.material=e,this.techniques=t,this.textures=i}}var Xt=i(620);class Jt{constructor(e,t,i,r){this._textures=e,this._techniques=t,this.materialChanged=i,this.requestRender=r,this._id2glMaterialRef=new Map}dispose(){this._textures.destroy()}acquire(e,t,i){this._ownMaterial(e);const r=e.produces.get(t);if(!r?.(i))return null;let n=this._id2glMaterialRef.get(e.id);if(null==n){const t=e.createGLMaterial(new Kt(e,this._techniques,this._textures));n=new ei(t),this._id2glMaterialRef.set(e.id,n)}return n.ref(),n.glMaterial}release(e){const t=this._id2glMaterialRef.get(e.id);null!=t&&(t.unref(),t.referenced||((0,rt.WD)(t.glMaterial),this._id2glMaterialRef.delete(e.id)))}_ownMaterial(e){e.repository&&e.repository!==this&&a.A.getLogger("esri.views.3d.webgl-engine.lib.GLMaterialRepository").error("Material is already owned by a different material repository"),e.repository=this}}class ei{constructor(e){this.glMaterial=e,this._refCnt=0}ref(){++this._refCnt}unref(){--this._refCnt,(0,Xt.vA)(this._refCnt>=0)}get referenced(){return this._refCnt>0}}var ti=i(24326),ii=i(91829),ri=i(46610),ni=i(63500),si=i(94008),oi=i(32728),ai=i(17478);function li(e,t){return null==e&&(e=[]),e.push(t),e}function ci(e,t){if(null==e)return null;const i=e.filter(e=>e!==t);return 0===i.length?null:i}i(28449),(0,d.vt)(),new Float32Array(6);class hi{constructor(e={}){this.id=(0,ti.c)(),this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=e.castShadow??!0,this.usesVerticalDistanceToGround=e.usesVerticalDistanceToGround??!1,this.graphicUid=e.graphicUid,this.layerViewUid=e.layerViewUid,e.isElevationSource&&(this.lastValidElevationBB=new ui),this._geometries=e.geometries?Array.from(e.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(e){(0,Xt.vA)(null==this._layer||null==e,"Object3D can only be added to a single Layer"),this._layer=e}addGeometry(e){e.visible=this._visible,this._geometries.push(e);for(const t of this._highlightIds)e.addHighlight(t);this._emit("geometryAdded",{object:this,geometry:e}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(e){const t=this._geometries.splice(e,1)[0];if(t){for(const e of this._highlightIds)t.removeHighlight(e);this._emit("geometryRemoved",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(e,t,i=!1){this._emit("attributesChanged",{object:this,geometry:e,attribute:t,sync:i}),function(e){return"position"===e}(t)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(e){if(this._visible!==e){this._visible=e;for(const e of this._geometries)e.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const e=new ai.p;for(const t of this._geometries)t.occludees=li(t.occludees,e);return this._emit("occlusionChanged",this),e}removeOcclude(e){for(const t of this._geometries)t.occludees=ci(t.occludees,e);this._emit("occlusionChanged",this)}highlight(e){const t=new ai.h(e);for(const e of this._geometries)e.addHighlight(t);return this._emit("highlightChanged",this),this._highlightIds.add(t),t}removeHighlight(e){this._highlightIds.delete(e);for(const t of this._geometries)t.removeHighlight(e);this._emit("highlightChanged",this)}removeStateID(e){0===e.channel?this.removeHighlight(e):this.removeOcclude(e)}getCombinedStaticTransformation(e,t){return(0,fe.lw)(t,this.transformation,e.transformation)}getCombinedShaderTransformation(e,t=(0,F.vt)()){return(0,fe.lw)(t,this.effectiveTransformation,e.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=new di,this._validateBoundingVolume(this._bvWorldSpace,0)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=new di,this._validateBoundingVolume(this._bvObjectSpace,1)),this._bvObjectSpace}_validateBoundingVolume(e,t){const i=1===t;for(const t of this._geometries){const r=t.boundingInfo;r&&pi(r,e,i?t.transformation:this.getCombinedShaderTransformation(t))}(0,A.Cc)(e.bounds.center,e.min,e.max,.5);for(const t of this._geometries){const r=t.boundingInfo;if(null==r)continue;const n=i?t.transformation:this.getCombinedShaderTransformation(t),s=(0,oi.hG)(n);(0,A.Z0)(vi,r.center,n);const o=(0,A.Io)(vi,e.bounds.center),a=r.radius*s;e.bounds.radius=Math.max(e.bounds.radius,o+a)}}_invalidateBoundingVolume(){const e=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&e&&this.layer.notifyObjectBBChanged(this,e)}_emit(e,t){this.layer?.events.emit(e,t)}get geometries(){return this._geometries}get transformation(){return this._transformation??F.zK}set transformation(e){this._transformation=(0,fe.C)(this._transformation??(0,F.vt)(),e),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(e){this._shaderTransformation=e?(0,fe.C)(this._shaderTransformation??(0,F.vt)(),e):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}class ui{constructor(){this._data=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]}get min(){return(0,d.fA)(this._data[0],this._data[1],this._data[2])}get max(){return(0,d.fA)(this._data[3],this._data[4],this._data[5])}minWith(e){const{_data:t}=this;t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2])}maxWith(e){const{_data:t}=this;t[3]=Math.max(t[3],e[0]),t[4]=Math.max(t[4],e[1]),t[5]=Math.max(t[5],e[2])}assignMinMax(e,t){for(let i=0;i<3;++i)this._data[0+i]=e[i],this._data[3+i]=t[i]}isEmpty(){return this._data[3]<this._data[0]&&this._data[4]<this._data[1]&&this._data[5]<this._data[2]}}class di extends ui{constructor(){super(...arguments),this.bounds=new si.iy}}function pi(e,t,i){const r=e.bbMin,n=e.bbMax;if((0,fe.tZ)(i)){const e=(0,A.hZ)(gi,i[12],i[13],i[14]);return(0,A.WQ)(fi,r,e),(0,A.WQ)(mi,n,e),t.minWith(fi),void t.maxWith(mi)}if((0,A.Z0)(fi,r,i),(0,A.t2)(r,n))return t.minWith(fi),void t.maxWith(fi);(0,A.Z0)(mi,n,i),t.minWith(fi),t.minWith(mi),t.maxWith(fi),t.maxWith(mi);for(let e=0;e<3;++e)(0,A.C)(fi,r),(0,A.C)(mi,n),fi[e]=n[e],mi[e]=r[e],(0,A.Z0)(fi,fi,i),(0,A.Z0)(mi,mi,i),t.minWith(fi),t.minWith(mi),t.maxWith(fi),t.maxWith(mi)}const gi=(0,d.vt)(),fi=(0,d.vt)(),mi=(0,d.vt)(),vi=(0,d.vt)();var yi=i(21818),xi=i(71511);const _i=["layerObjectAdded","layerObjectRemoved","layerObjectsAdded","layerObjectsRemoved","transformationChanged","shaderTransformationChanged","visibilityChanged","occlusionChanged","highlightChanged","geometryAdded","geometryRemoved","attributesChanged"];var bi=i(78230);class Si{constructor(e,t,i=""){this.stage=e,this.apiLayerViewUid=i,this.id=(0,ti.c)(),this.events=new tt.bk,this.visible=!0,this.sliceable=!1,this._objectsAdded=new Array,this._handles=new xi.A,this._objects=new Map,this._pickable=!0,this.visible=t?.visible??!0,this._pickable=t?.pickable??!0,this.updatePolicy=t?.updatePolicy??0,e.addLayer(this);for(const t of _i)this._handles.add(this.events.on(t,i=>e.handleEvent(t,i)))}destroy(){this._handles.size&&(this._handles.destroy(),this.stage.removeLayer(this),this.invalidateSpatialQueryAccelerator())}get objects(){return this._objects}getObject(e){return(0,yi.z)(this._objects.get(e))}set pickable(e){this._pickable=e}get pickable(){return this._pickable&&this.visible}add(e){this._objects.set(e.id,e),e.layer=this,this.events.emit("layerObjectAdded",e),null!=this._octree&&this._objectsAdded.push(e)}remove(e){this._objects.delete(e.id)&&(this.events.emit("layerObjectRemoved",e),e.layer=null,null!=this._octree&&((0,et.Xy)(this._objectsAdded,e)||this._octree.remove([e])))}addMany(e){for(const t of e)this._objects.set(t.id,t),t.layer=this;this.events.emit("layerObjectsAdded",e),null!=this._octree&&this._objectsAdded.push(...e)}removeMany(e){const t=new Array;for(const i of e)this._objects.delete(i.id)&&t.push(i);if(0!==t.length&&(this.events.emit("layerObjectsRemoved",t),t.forEach(e=>e.layer=null),null!=this._octree)){for(let e=0;e<t.length;)(0,et.Xy)(this._objectsAdded,t[e])?(t[e]=t[t.length-1],t.length-=1):++e;this._octree.remove(t)}}commit(){this.stage.commitLayer(this)}sync(){1!==this.updatePolicy&&this.stage.syncLayer(this.id)}notifyObjectBBChanged(e,t){null==this._octree||this._objectsAdded.includes(e)||this._octree.update(e,t)}getSpatialQueryAccelerator(){return null==this._octree&&this._objects.size>50?(this._octree=new bi.x(e=>e.boundingVolumeWorldSpace.bounds),this._octree.add(this._objects.values())):null!=this._octree&&this._objectsAdded.length>0&&(this._octree.add(this._objectsAdded),this._objectsAdded.length=0),this._octree}invalidateSpatialQueryAccelerator(){this._octree=(0,rt.pR)(this._octree),this._objectsAdded.length=0}get test(){}}var wi=i(90629),Ci=i(78659),Ti=i(20498),Ai=i(11964),Ri=i(49255),Ei=i(92130),Oi=i(11725),Mi=i(77194),Li=i(96095),Pi=i(35622),Di=i(59907),Ii=i(32565),Fi=i(1843);function zi(e){const t=(0,Fi.BP)().vec3f("position").vec4f16("previousDelta").vec4f16("nextDelta").f32("u0").vec2f16("lineParameters");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f32("size"),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),(0,gt.E)()&&t.vec4u8("olidColor"),e.hasAnimation&&t.vec4f16("timeStamps"),t}var Ni=i(4431),Wi=i(33524),Vi=i(56133),ji=i(33442);let Hi=class extends Tt.w{constructor(e,t){super(e,t,(0,Ni.U)(zi(t))),this.shader=new Ct.r(Ii.R,()=>i.e(2059).then(i.bind(i,92059))),this.ignoreUnused=!0,this.primitiveType=t.wireframe?Ut.WR.LINES:Ut.WR.TRIANGLE_STRIP}_makePipelineState(e,t){const{output:i,hasOccludees:r}=e;return(0,Et.Ey)({blending:(0,Wi.Yf)(i,!1,e.emissionDimmingPass),depthTest:(0,Wi.mt)(i),depthWrite:(0,Wi.z5)(e),colorWrite:Et.kn,stencilWrite:r?Vi.v0:null,stencilTest:r?t?Vi.Ax:Vi.cP:null,polygonOffset:(0,ji.Tk)(e)})}initializePipeline(e){if(e.occluder){const{hasOccludees:t}=e;this._occluderPipelineTransparent=(0,Et.Ey)({blending:Et.T8,polygonOffset:(0,ji.Tk)(e),depthTest:Vi.sf,depthWrite:null,colorWrite:Et.kn,stencilWrite:null,stencilTest:t?Vi.Q0:null}),this._occluderPipelineOpaque=(0,Et.Ey)({blending:Et.T8,polygonOffset:(0,ji.Tk)(e),depthTest:t?Vi.sf:Vi.m,depthWrite:null,colorWrite:Et.kn,stencilWrite:t?Vi.r8:null,stencilTest:t?Vi.iB:null}),this._occluderPipelineMaskWrite=(0,Et.Ey)({blending:null,polygonOffset:(0,ji.Tk)(e),depthTest:Vi.m,depthWrite:null,colorWrite:null,stencilWrite:t?Vi.v0:null,stencilTest:t?Vi.Ax:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t,i){if(i)return this._occludeePipeline;switch(e.occluder){case 11:return this._occluderPipelineTransparent??super.getPipeline(e,t,i);case 10:return this._occluderPipelineOpaque??super.getPipeline(e,t,i);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e,t,i)}}};Hi=(0,r.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.shaders.RibbonLineTechnique")],Hi);var Ui=i(51976),Bi=i(47724);class Zi extends Bi.L{constructor(e){super(),this.spherical=e,this.capType=0,this.emissionSource=0,this.animation=2,this.polygonOffsetIndex=0,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.numJoinSubdivisions=1,this.roundJoins=!1,this.applyMarkerOffset=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.hasOccludees=!1,this.occluder=!1,this.wireframe=!1,this.discardInvisibleFragments=!1,this.hasScreenSizePerspective=!1,this.worldSizedImagePattern=!1,this.textureCoordinateType=0,this.hasVVInstancing=!1,this.hasSliceTranslatedView=!0,this.overlayEnabled=!1,this.snowCover=!1}get hasAnimation(){return 0!==this.animation}}(0,r.Cg)([(0,Ui.W)({count:3})],Zi.prototype,"capType",void 0),(0,r.Cg)([(0,Ui.W)({count:8})],Zi.prototype,"emissionSource",void 0),(0,r.Cg)([(0,Ui.W)({count:4})],Zi.prototype,"animation",void 0),(0,r.Cg)([(0,Ui.W)({count:16})],Zi.prototype,"polygonOffsetIndex",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"writeDepth",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"draped",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"stippleEnabled",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"stippleOffColorEnabled",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"stipplePreferContinuous",void 0),(0,r.Cg)([(0,Ui.W)({count:8})],Zi.prototype,"numJoinSubdivisions",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"roundJoins",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"applyMarkerOffset",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"hasVVSize",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"hasVVColor",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"hasVVOpacity",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"falloffEnabled",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"innerColorEnabled",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"hasOccludees",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"occluder",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"wireframe",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"discardInvisibleFragments",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"hasScreenSizePerspective",void 0),(0,r.Cg)([(0,Ui.W)()],Zi.prototype,"worldSizedImagePattern",void 0);var ki=i(49788);class Gi extends Oi.i{constructor(e,t){super(e,$i),this.produces=new Map([[2,e=>(0,Ri.Ex)(e)||(0,Ri._o)(e)&&8===this.parameters.renderOccluded],[3,e=>(0,Ri.eh)(e)],[10,e=>(0,Ri.gr)(e)&&8===this.parameters.renderOccluded],[11,e=>(0,Ri.gr)(e)&&8===this.parameters.renderOccluded],[4,e=>(0,Ri._o)(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>(0,Ri._o)(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>(0,Ri.i3)(e)]]),this._configuration=new Zi(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=Xi(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&function(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.hasEmissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSizedImagePattern=r}get visible(){return this.parameters.color[3]>=ki.Q||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ki.Q}get hasEmissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectDraped({attributes:e,screenToWorldRatio:t},i,r,n,s){if(!i.options.selectionMode)return;const o=e.get("size");let a=this.parameters.width;if(this.parameters.vvSize){const t=e.get("sizeFeatureAttribute").data[0];Number.isNaN(t)?a*=this.parameters.vvSize.fallback[0]:a*=(0,je.qE)(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(a*=o.data[0]);const l=r[0],c=r[1],h=(a/2+4)*t;let u=Number.MAX_VALUE,d=0;const p=e.get("position").data,g=Ki(this.parameters,e)?p.length-2:p.length-5;for(let e=0;e<g;e+=3){const t=p[e],i=p[e+1],r=(e+3)%p.length,n=l-t,s=c-i,o=p[r]-t,a=p[r+1]-i,h=(0,je.qE)((o*n+a*s)/(o*o+a*a),0,1),g=o*h-n,f=a*h-s,m=g*g+f*f;m<u&&(u=m,d=e/3)}u<h*h&&n(s.distance,s.normal,d)}intersect(e,t,i,r,n,s){const{options:o,camera:l,rayBegin:c,rayEnd:h}=i;if(!o.selectionMode||!e.visible||!l)return;if(!(0,Xt.zH)(t))return void a.A.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const u=e.attributes,d=u.get("position").data;let p=this.parameters.width;if(this.parameters.vvSize){const e=u.get("sizeFeatureAttribute").data[0];Number.isNaN(e)||(p*=(0,je.qE)(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else u.has("size")&&(p*=u.get("size").data[0]);const g=ar;(0,bt.C)(g,i.point);const f=p*l.pixelRatio,m=4*l.pixelRatio,v=f/2+m;(0,A.hZ)(yr[0],g[0]-v,g[1]+v,0),(0,A.hZ)(yr[1],g[0]+v,g[1]+v,0),(0,A.hZ)(yr[2],g[0]+v,g[1]-v,0),(0,A.hZ)(yr[3],g[0]-v,g[1]-v,0);for(let e=0;e<4;e++)if(!l.unprojectFromRenderScreen(yr[e],xr[e]))return;(0,Ue.Cr)(l.eye,xr[0],xr[1],_r),(0,Ue.Cr)(l.eye,xr[1],xr[2],br),(0,Ue.Cr)(l.eye,xr[2],xr[3],Sr),(0,Ue.Cr)(l.eye,xr[3],xr[0],wr);let y=Number.MAX_VALUE,x=0;const _=Ki(this.parameters,u)?d.length-2:d.length-5;for(let e=0;e<_;e+=3){er[0]=d[e]+t[12],er[1]=d[e+1]+t[13],er[2]=d[e+2]+t[14];const i=(e+3)%d.length;if(tr[0]=d[i]+t[12],tr[1]=d[i+1]+t[13],tr[2]=d[i+2]+t[14],(0,Ue.mN)(_r,er)<0&&(0,Ue.mN)(_r,tr)<0||(0,Ue.mN)(br,er)<0&&(0,Ue.mN)(br,tr)<0||(0,Ue.mN)(Sr,er)<0&&(0,Ue.mN)(Sr,tr)<0||(0,Ue.mN)(wr,er)<0&&(0,Ue.mN)(wr,tr)<0)continue;const r=l.projectToRenderScreen(er,lr),n=l.projectToRenderScreen(tr,cr);if(null==r||null==n)continue;if(r[2]<0&&n[2]>0){(0,A.Re)(sr,er,tr);const e=l.frustum,t=-(0,Ue.mN)(e[4],er)/(0,A.Om)(sr,(0,Ue.Qj)(e[4]));if((0,A.hs)(sr,sr,t),(0,A.WQ)(er,er,sr),!l.projectToRenderScreen(er,r))continue}else if(r[2]>0&&n[2]<0){(0,A.Re)(sr,tr,er);const e=l.frustum,t=-(0,Ue.mN)(e[4],tr)/(0,A.Om)(sr,(0,Ue.Qj)(e[4]));if((0,A.hs)(sr,sr,t),(0,A.WQ)(tr,tr,sr),!l.projectToRenderScreen(tr,n))continue}else if(r[2]<0&&n[2]<0)continue;r[2]=0,n[2]=0;const s=(0,Ai.Cr)(r,n,dr),o=(0,Ai.kb)(s,g);if(!(o>=y)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(s,er,tr,g,l,p,m);if(o>=e*e)continue}y=o,(0,A.C)(hr,er),(0,A.C)(ur,tr),x=e/3}}if(y<v*v){let e=Number.MAX_VALUE;if((0,Ai.ld)((0,Ai.Cr)(hr,ur,dr),(0,Ai.Cr)(c,h,pr),or)){(0,A.Re)(or,or,c);const t=(0,A.Bw)(or);(0,A.hs)(or,or,1/t),e=t/(0,A.Io)(c,h)}s(e,or,x)}}createBufferWriter(){return new Yi(zi(this.parameters),this.parameters)}createGLMaterial(e){return new qi(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:(0,Ci.y)(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,n,s,o){const a=(0,Ai.G1)(e,r);(0,A.Cc)(ir,t,i,a),(0,A.Z0)(rr,ir,n.viewMatrix);const l=(0,A.Bw)(rr),c=this.computeCameraAbsCosAngle(ir,n,this._configuration.spherical);return Ji.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Ji.apply(s)*n.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,i){return i?(0,A.S8)(or,e):(0,A.hZ)(or,0,0,1),(0,A.Re)(nr,e,t.eye),(0,A.S8)(nr,nr),Math.abs((0,A.Om)(or,nr))}}class qi extends Ei.A{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Hi,e)}}class $i extends Pi.S{constructor(){super(...arguments),this._width=0,this.color=ii.Un,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=(0,Ci.Kp)(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=(0,Ci.Kp)(0),this.endTime=(0,Ci.Kp)(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return(0,Li.sL)(this.stipplePattern)&&null!=this.stippleTexture}}class Yi{constructor(e,t){this.layout=e,this._parameters=t,this.numJoinSubdivisions=Xi(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return Ki(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCount(e){const t=e.get("position").indices.length/2+1,i=this._isClosed(e);let r=i?2:4;return r+=((i?t:t-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),r+=2,this._parameters.wireframe&&(r=2+4*(r-2)),r}write(e,t,i,r,n,s){const{buffer:o,offset:a}=n,l=this.layout,c=i.get("position"),h=c.indices,u=c.data.length/3,d=i.get("distanceToStart")?.data;h&&h.length!==2*(u-1)&&console.warn("RibbonLineMaterial does not support indices");const p=l.fields.has("sizeFeatureAttribute");let g=1,f=null;if(p){const e=i.get("sizeFeatureAttribute");1===e.data.length?g=e.data[0]:f=e.data}else g=i.get("size")?.data[0]??1;let m=[1,1,1,1],v=0,y=null;const x=l.fields.has("colorFeatureAttribute");if(x){const e=i.get("colorFeatureAttribute");1===e.data.length?v=e.data[0]:y=e.data}else m=i.get("color")?.data??m;const _=i.get("timeStamps")?.data,b=_&&l.fields.has("timeStamps"),S=l.fields.has("opacityFeatureAttribute");let w=0,C=null;if(S){const e=i.get("opacityFeatureAttribute");1===e.data.length?w=e.data[0]:C=e.data}const T=new Float32Array(o.buffer),R=(0,Ti.Bg)(o.buffer),E=new Uint8Array(o.buffer),O=l.stride/4;let M=a*O;const L=M;let P=0;const D=d?(e,t,i)=>P=d[i]:(e,t,i)=>P+=(0,A.Io)(e,t),I=T.BYTES_PER_ELEMENT/R.BYTES_PER_ELEMENT,F=4/I,z=(0,gt.E)(),N=(e,t,i,n,s,o,a,l)=>{T[M++]=t[0],T[M++]=t[1],T[M++]=t[2],(0,Di.Wu)(e,t,R,M*I),M+=F,(0,Di.Wu)(i,t,R,M*I),M+=F,T[M++]=l;let c=M*I;if(R[c++]=s,R[c++]=o,M=Math.ceil(c/I),x)T[M]=y?.[a]??v;else{const e=Math.min(4*a,m.length-4),t=4*M;E[t]=255*m[e],E[t+1]=255*m[e+1],E[t+2]=255*m[e+2],E[t+3]=255*m[e+3]}if(M++,T[M++]=f?.[a]??g,S&&(T[M++]=C?.[a]??w),z){let e=4*M;r?(E[e++]=r[0],E[e++]=r[1],E[e++]=r[2],E[e++]=r[3]):(E[e++]=0,E[e++]=0,E[e++]=0,E[e++]=0),M=Math.ceil(.25*e)}b&&(c=M*I,R[c++]=n[0],R[c++]=n[1],R[c++]=n[2],R[c++]=n[3],M=Math.ceil(c/I))};M+=O,(0,A.hZ)(fr,c.data[0],c.data[1],c.data[2]),b&&(0,at.hZ)(vr,_[0],_[1],_[2],_[3]),e&&(0,A.Z0)(fr,fr,e);const W=this._isClosed(i);if(W){const t=c.data.length-3;(0,A.hZ)(gr,c.data[t],c.data[t+1],c.data[t+2]),e&&(0,A.Z0)(gr,gr,e)}else(0,A.hZ)(mr,c.data[3],c.data[4],c.data[5]),e&&(0,A.Z0)(mr,mr,e),N(fr,fr,mr,vr,1,-4,0,0),N(fr,fr,mr,vr,1,4,0,0),(0,A.C)(gr,fr),(0,A.C)(fr,mr),b&&(0,at.hZ)(vr,_[4],_[5],_[6],_[7]);const V=W?0:1,j=W?u:u-1;for(let t=V;t<j;t++){const i=(t+1)%u*3;(0,A.hZ)(mr,c.data[i],c.data[i+1],c.data[i+2]),e&&(0,A.Z0)(mr,mr,e),D(gr,fr,t),N(gr,fr,mr,vr,0,-1,t,P),N(gr,fr,mr,vr,0,1,t,P);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const i=(e+1)/(r+1);N(gr,fr,mr,vr,i,-1,t,P),N(gr,fr,mr,vr,i,1,t,P)}if(N(gr,fr,mr,vr,1,-2,t,P),N(gr,fr,mr,vr,1,2,t,P),(0,A.C)(gr,fr),(0,A.C)(fr,mr),b){const e=(t+1)%u*4;(0,at.hZ)(vr,_[e],_[e+1],_[e+2],_[e+3])}}W?((0,A.hZ)(mr,c.data[3],c.data[4],c.data[5]),e&&(0,A.Z0)(mr,mr,e),P=D(gr,fr,j),N(gr,fr,mr,vr,0,-1,V,P),N(gr,fr,mr,vr,0,1,V,P)):(P=D(gr,fr,j),N(gr,fr,fr,vr,0,-5,j,P),N(gr,fr,fr,vr,0,5,j,P)),Qi(T,L+O,T,L,O),M=Qi(T,M-O,T,M,O),this._parameters.wireframe&&this._addWireframeVertices(o,L,M,O)}_addWireframeVertices(e,t,i,r){const n=new Float32Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),s=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,i-t);let o=0;const a=e=>o=Qi(s,e,n,o,r);for(let e=0;e<s.length-1;e+=2*r)a(e),a(e+2*r),a(e+1*r),a(e+2*r),a(e+1*r),a(e+3*r)}}function Qi(e,t,i,r,n){for(let s=0;s<n;s++)i[r++]=e[t++];return r}function Ki(e,t){return!!e.isClosed&&t.get("position").indices.length>2}function Xi(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return Ii.r+i}}const Ji=new Mi.PS,er=(0,d.vt)(),tr=(0,d.vt)(),ir=(0,d.vt)(),rr=(0,d.vt)(),nr=(0,d.vt)(),sr=(0,d.vt)(),or=(0,d.vt)(),ar=(0,d.vt)(),lr=(0,wi.r_)(),cr=(0,wi.r_)(),hr=(0,d.vt)(),ur=(0,d.vt)(),dr=(0,Ai.vt)(),pr=(0,Ai.vt)(),gr=(0,d.vt)(),fr=(0,d.vt)(),mr=(0,d.vt)(),vr=(0,ii.vt)(),yr=[(0,wi.r_)(),(0,wi.r_)(),(0,wi.r_)(),(0,wi.r_)()],xr=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)()],_r=(0,Ue.vt)(),br=(0,Ue.vt)(),Sr=(0,Ue.vt)(),wr=(0,Ue.vt)();class Cr{constructor(e){this._originSR=e,this._rootOriginId="root/"+(0,ti.c)(),this._origins=new Map,this._objects=new Map,this._gridSize=5e5,this._originSR?.isGeographic&&(this._gridSize/=(0,He.GA)(this._originSR)),this._baselineDistance=.5*this._gridSize;const t=this._baselineDistance*Ar;this._baselineObjectSize=t/Rr}getOrigin(e){const t=this._origins.get(this._rootOriginId);if(null==t){const t=null;if(null!=t)return this._origins.set(this._rootOriginId,ht(t[0],t[1],t[2],this._rootOriginId)),this.getOrigin(e);const i=ht(e[0]+Math.random()-.5,e[1]+Math.random()-.5,e[2]+Math.random()-.5,this._rootOriginId);return this._origins.set(this._rootOriginId,i),i}const i=this._gridSize,r=Math.round(e[0]/i),n=Math.round(e[1]/i),s=Math.round(e[2]/i),o=`${r}/${n}/${s}`;let a=this._origins.get(o);const l=.5*i;if((0,A.Re)(Tr,e,t.vec3),Tr[0]=Math.abs(Tr[0]),Tr[1]=Math.abs(Tr[1]),Tr[2]=Math.abs(Tr[2]),Tr[0]<l&&Tr[1]<l&&Tr[2]<l){if(a){const t=Math.max(...Tr);if((0,A.Re)(Tr,e,a.vec3),Tr[0]=Math.abs(Tr[0]),Tr[1]=Math.abs(Tr[1]),Tr[2]=Math.abs(Tr[2]),Math.max(...Tr)<t)return a}return t}return a||(a=ht(r*i,n*i,s*i,o),this._origins.set(o,a)),a}needsOriginUpdate(e,t,i){const r=(0,A.Io)(e.vec3,t),n=Math.max(1,i/this._baselineObjectSize);return r>this._baselineDistance*n}_drawOriginBox(e,t=(0,ii.fA)(1,1,0,1)){const i=window.view,r=i.stage,n=t.toString();if(!this._objects.has(n)){this._material=new Gi({width:2,color:t},!1);const e=new Si(r,{pickable:!1}),i=new hi({castShadow:!1});e.add(i),this._objects.set(n,i)}const s=this._objects.get(n),o=[0,1,5,4,0,2,1,7,6,2,0,1,3,7,5,4,6,2,0],a=o.length,l=new Array(3*a),c=new Array,h=.5*this._gridSize;for(let t=0;t<a;t++)l[3*t]=e[0]+(1&o[t]?h:-h),l[3*t+1]=e[1]+(2&o[t]?h:-h),l[3*t+2]=e[2]+(4&o[t]?h:-h),t>0&&c.push(t-1,t);(0,j.projectBuffer)(l,this._originSR,0,l,i.renderSpatialReference,0,a);const u=new ni.V(this._material,[["position",new ri.n(l,c,3,!0)]],null,2);s.addGeometry(u)}get test(){}}const Tr=(0,d.vt)(),Ar=2**-23,Rr=.05;var Er,Or=i(44794),Mr=i(48163),Lr=i(79258),Pr=i(25482),Dr=i(93223);let Ir=Er=class extends Pr.o{constructor(e){super(e),this.type="cloudy",this.cloudCover=.5,this.fogOpacity=0}clone(){return new Er({cloudCover:this.cloudCover})}};(0,r.Cg)([(0,Dr.e)({cloudy:"cloudy"}),(0,u.MZ)({json:{write:{isRequired:!0}}})],Ir.prototype,"type",void 0),(0,r.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Ir.prototype,"cloudCover",void 0),Ir=Er=(0,r.Cg)([(0,u.$K)("esri.views.3d.environment.CloudyWeather")],Ir);const Fr=Ir;var zr;let Nr=class extends Pr.o{static{zr=this}constructor(e){super(e),this.type="foggy",this.fogStrength=.5}clone(){return new zr({fogStrength:this.fogStrength})}get fogOpacity(){return(0,je.Cc)(zr.minFogOpacity,zr.maxFogOpacity,this.fogStrength**3)}static{this.minFogOpacity=3e-5}static{this.maxFogOpacity=.005}};(0,r.Cg)([(0,Dr.e)({foggy:"foggy"}),(0,u.MZ)({json:{write:{isRequired:!0}}})],Nr.prototype,"type",void 0),(0,r.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Nr.prototype,"fogStrength",void 0),Nr=zr=(0,r.Cg)([(0,u.$K)("esri.views.3d.environment.FoggyWeather")],Nr);const Wr=Nr;var Vr;let jr=class extends Pr.o{static{Vr=this}constructor(e){super(e),this.type="rainy",this.cloudCover=.5,this.precipitation=.5}clone(){return new Vr({cloudCover:this.cloudCover,precipitation:this.precipitation})}get fogOpacity(){return(0,je.Cc)(Vr.minFogOpacity,Vr.maxFogOpacity,this.precipitation**3)}static{this.minFogOpacity=4e-6}static{this.maxFogOpacity=2e-4}};(0,r.Cg)([(0,Dr.e)({rainy:"rainy"}),(0,u.MZ)({json:{write:{isRequired:!0}}})],jr.prototype,"type",void 0),(0,r.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],jr.prototype,"cloudCover",void 0),(0,r.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],jr.prototype,"precipitation",void 0),jr=Vr=(0,r.Cg)([(0,u.$K)("esri.views.3d.environment.RainyWeather")],jr);const Hr=jr;var Ur;let Br=Ur=class extends Pr.o{constructor(e){super(e),this.type="snowy",this.cloudCover=.5,this.precipitation=.5,this.snowCover="disabled"}clone(){return new Ur({cloudCover:this.cloudCover,precipitation:this.precipitation,snowCover:this.snowCover})}get fogOpacity(){return(0,je.Cc)(Hr.minFogOpacity,Hr.maxFogOpacity,this.precipitation**3)}};(0,r.Cg)([(0,Dr.e)({snowy:"snowy"}),(0,u.MZ)({json:{write:{isRequired:!0}}})],Br.prototype,"type",void 0),(0,r.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Br.prototype,"cloudCover",void 0),(0,r.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Br.prototype,"precipitation",void 0),(0,r.Cg)([(0,u.MZ)({type:["enabled","disabled"],nonNullable:!0,json:{write:!0}})],Br.prototype,"snowCover",void 0),Br=Ur=(0,r.Cg)([(0,u.$K)("esri.views.3d.environment.SnowyWeather")],Br);const Zr=Br;var kr;let Gr=kr=class extends Pr.o{constructor(e){super(e),this.type="sunny",this.cloudCover=.5,this.fogOpacity=0}clone(){return new kr({cloudCover:this.cloudCover})}};(0,r.Cg)([(0,Dr.e)({sunny:"sunny"}),(0,u.MZ)({json:{write:{isRequired:!0}}})],Gr.prototype,"type",void 0),(0,r.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Gr.prototype,"cloudCover",void 0),Gr=kr=(0,r.Cg)([(0,u.$K)("esri.views.3d.environment.SunnyWeather")],Gr);const qr={key:"type",base:Gr,typeMap:{sunny:Gr,cloudy:Fr,rainy:Hr,snowy:Zr,foggy:Wr}};Object.keys(qr.typeMap);class $r{constructor(){this.startTime=0,this._data=(0,Or.v)(null),this.coverage=0,this.absorption=0,this._readChannels=0,this.parallax=new Yr,this.parallaxNew=new Yr,this._anchorPoint=(0,d.vt)(),this._fadeState=(0,Or.v)(0),this._fadeFactor=(0,Or.v)(1)}get data(){return this._data.value}set data(e){this._data.value=e}get readChannels(){return this._readChannels}get fadeState(){return this._fadeState.value}get fadeFactor(){return this._fadeFactor.value}get opacity(){switch(this.fadeState){case 0:return 0;case 4:return 1-this.fadeFactor;case 1:return this.fadeFactor;case 2:case 3:return 1}}fade(e,t,i){this.isFading&&this.fadeFactor<1&&(this._fadeFactor.value=i?(0,je.qE)((t-this.startTime)/(Jr*i),0,1):1,1===this.fadeFactor&&this._endFade()),this._evaluateState(e,t),this._updateParallax(e)}_evaluateState(e,t){const i=e.relativeElevation,r=this._updateAnchorPoint(e);(Math.abs(i)>17e3||r>tn)&&this.opacity>0?this._startFade(0,t):this.isFading||(Math.abs(i)>1e4||r>en*tn?this.opacity>0&&this._startFade(4,t):function(e){return null!=e&&!e.readyToRun}(this.data)&&(0===this.opacity?this._startFade(1,t):2===this.data.state&&(2===this.fadeState?this._startFade(3,t):this._startFade(2,t))))}_updateParallax(e){const t=(0,A.m3)(e.eye);this.parallax.radiusCurvatureCorrection=.84*Math.sqrt(Math.max(t-Lr.$O.radius*Lr.$O.radius,0))/Math.sqrt(t),(0,v.Cr)(Qr,this.parallax.anchorPoint,Kr),(0,fe.e$)(this.parallax.transform,F.zK,Kr[3],(0,v.yo)(Kr)),(0,v.Cr)(Qr,this.parallaxNew.anchorPoint,Kr),(0,fe.e$)(this.parallaxNew.transform,F.zK,Kr[3],(0,v.yo)(Kr))}_updateAnchorPoint(e){return(0,A.S8)(this._anchorPoint,e.eye),(0,A.hs)(this._anchorPoint,this._anchorPoint,Lr.$O.radius),0===this.fadeState&&2===this.data?.state?((0,A.C)(this.parallax.anchorPoint,this._anchorPoint),0):(0,A.Bw)((0,A.Re)(Xr,this.parallax.anchorPoint,this._anchorPoint))}requestFade(){this._fadeFactor.value=0}_startFade(e,t){switch(this._fadeState.value=e,this.startTime=t,e){case 3:this.requestFade(),this._switchReadChannels(),(0,A.C)(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 1:this.requestFade(),this._switchReadChannels(),(0,A.C)(this.parallax.anchorPoint,this._anchorPoint),(0,A.C)(this.parallaxNew.anchorPoint,this._anchorPoint);break;case 4:this.requestFade();break;case 2:this._switchReadChannels(),(0,A.C)(this.parallax.anchorPoint,this._anchorPoint),(0,A.C)(this.parallaxNew.anchorPoint,this._anchorPoint),this._endFade();break;case 0:this._endFade()}}_endFade(){switch(this._fadeFactor.value=1,this.data&&2!==this.data.state&&(this.data.state=0),this.fadeState){case 3:(0,A.C)(this.parallax.anchorPoint,this.parallaxNew.anchorPoint),this._fadeState.value=2;break;case 1:this._fadeState.value=2;break;case 4:this._fadeState.value=0;break;case 2:case 0:break;default:this.fadeState}}_switchReadChannels(){2===this.data?.state&&(this._readChannels=1-this._readChannels,this.data.state=3)}get isFading(){return 4===this.fadeState||1===this.fadeState||3===this.fadeState}}class Yr{constructor(){this.anchorPoint=(0,d.vt)(),this.radiusCurvatureCorrection=0,this.transform=(0,F.vt)()}}const Qr=(0,d.fA)(0,0,1),Kr=(0,v.vt)(),Xr=(0,d.vt)(),Jr=1.25,en=.5,tn=2e5;class rn{constructor(){this.lastFrameCamera=new vt.A,this.matrix=(0,F.vt)(),this.viewMatrix=(0,F.vt)()}}class nn{constructor(){this.enabled=!1,this.fadeFactor=1}}var sn=i(57226);class on{constructor(e,t){this._rctx=e,this.shadowMap=t,this._output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.emissions=0,this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=(0,Or.v)(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=new vt.A,this._inverseViewport=(0,Mr.vt)(),this._oldLighting=new sn.TA,this._newLighting=new sn.TA,this._fadedLighting=new sn.TA,this._lighting=this._newLighting,this.screenSpaceReflections=new nn,this.reprojection=new rn,this.highlights=new Array,this.highlightMixOrigin=(0,Mr.vt)(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new $r,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=(0,rt.Gz)(this.depth),this.shadowMap?.dispose()}get output(){return this._output}set output(e){this._output!==e&&(this._output=e,this._rctx.resetDrawBuffers(e))}get hasEmission(){return 0!==this.emissions}get hasOpaqueEmissions(){return 1===this.emissions||3===this.emissions}get camera(){return this._camera}set camera(e){this._camera=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return 1===this.output&&this.camera.relativeElevation<5e5}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,i,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=i,this._newLighting.set(e),this._oldLighting.updateLegacy(),1===r&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return(0,Ri._o)(this.output)&&this.screenSpaceReflections.enabled&&null!=this.reprojection.lastFrameColor}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name="geometry depth"),this._depth=e}get occluder(){return 10===this.slot||11===this.slot?this.slot:null}}class an{constructor(e,t,i){this.rctx=e,this.techniques=i,this.renderOccludedMask=ln,this.time=(0,Ci.l5)(0),this.bind=new on(e,t),this.bind.alignPixelEnabled=!0}destroy(){this.bind.destroy()}get output(){return this.bind.output}}const ln=13;let cn=class extends vt.A{constructor(){super(...arguments),this._projectionMatrix=(0,F.vt)()}get projectionMatrix(){return this._projectionMatrix}};(0,r.Cg)([(0,u.MZ)()],cn.prototype,"_projectionMatrix",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0})],cn.prototype,"projectionMatrix",null),cn=(0,r.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.lib.CascadeCamera")],cn);var hn=i(78988);class un{constructor(){this.camera=new cn,this.lightMat=(0,F.vt)()}}class dn{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}}class pn{constructor(e,t){this._fbos=e,this._viewingMode=t,this._enabled=!1,this._outputs=new Array,this._textureHeight=0,this._numCascades=1,this.settings=new dn,this._projectionView=(0,F.vt)(),this._projectionViewInverse=(0,F.vt)(),this._modelViewLight=(0,F.vt)(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=(0,ii.vt)(),this._cascades=[new un,new un,new un,new un],this._lastOrigin=null,this._maxTextureWidth=Math.min((0,De.A)("esri-mobile")?4096:16384,e.rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1}disposeOutputs(){this._handle=(0,rt.Gz)(this._handle),this._outputs.forEach(e=>e?.release()),this._outputs.length=0}disposeOutput(e){this._outputs[e]=(0,rt.Gz)(this._outputs[e])}set maxCascades(e){this.settings.maxNumCascadesHighQuality=(0,je.qE)(Math.floor(e),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(e){this._enabled=e,e||this.disposeOutputs()}get enabled(){return this._enabled}get ready(){return!!this.getOutput(5)||!!this.getOutput(7)}get renderTarget(){return this._handle}get cascades(){for(let e=0;e<this._numCascades;++e)wn[e]=this._cascades[e];return wn.length=this._numCascades,wn}start(e,t,i,r,n){(0,Xt.vA)(this.enabled);const{near:s,far:o}=function(e){let{near:t,far:i}=e;return t<2&&(t=2),i<2&&(i=2),t>=i&&(t=2,i=4),{near:t,far:i}}(i);this._computeCascadeDistances(s,o,r),this._textureHeight=this._computeTextureHeight(e,n,r),this._setupMatrices(e,t);const{viewMatrix:a,projectionMatrix:l}=e;for(let e=0;e<this._numCascades;++e)this._constructCascade(e,l,a,t);this._lastOrigin=null,this.clear()}getShadowMapMatrices(e){if(!this._lastOrigin||!(0,A.t2)(e,this._lastOrigin)){this._lastOrigin=this._lastOrigin||(0,d.vt)(),(0,A.C)(this._lastOrigin,e);for(let t=0;t<this._numCascades;++t){(0,fe.Tl)(Cn,this._cascades[t].lightMat,e);for(let e=0;e<16;++e)Tn[16*t+e]=Cn[e]}}return Tn}finish(e){(0,Xt.vA)(this.enabled),this._outputs[e]?.release(),this._outputs[e]=this._handle,this._handle?.setName(6===e?"shadow map highlight":"shadow map excluding highlight"),this._handle=null}getOutput(e){return this.enabled?this._outputs[e]?.getTexture(Ut.nI):null}clear(){this._ensureFbo(),this.bindFramebuffer(),this._fbos.rctx.clear(256)}_computeTextureHeight({pixelRatio:e,fullWidth:t,fullHeight:i},r,n){const s=Math.min(window.devicePixelRatio,r)/e,o=n?this.settings.textureSizeModHighQuality:this.settings.textureSizeModLowQuality;return(0,hn.Mv)(Math.max(t,i)*s*o,this._maxTextureWidth/this._numCascades)}_ensureFbo(){this._handle?.fbo?.width===this._textureWidth&&this._handle?.fbo.height===this._textureHeight||(this._handle?.release(),this._handle=this._fbos.acquire(this._textureWidth,this._textureHeight,"shadow map",13),this._handle.getTexture(Ut.nI)?.setShadowFiltering(!0))}bindFramebuffer(){this._fbos.rctx.bindFramebuffer(this._handle?.fbo)}_constructCascade(e,t,i,r){const n=this._cascades[e],s=-this._cascadeDistances[e],o=-this._cascadeDistances[e+1],a=(t[10]*s+t[14])/Math.abs(t[11]*s+t[15]),l=(t[10]*o+t[14])/Math.abs(t[11]*o+t[15]);(0,Xt.vA)(a<l);for(let e=0;e<8;++e){(0,at.hZ)(fn,e%4==0||e%4==3?-1:1,e%4==0||e%4==1?-1:1,e<4?a:l,1);const t=mn[e];(0,at.Z0)(t,fn,this._projectionViewInverse),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3]}(0,A.ze)(Sn,mn[0]),n.camera.viewMatrix=(0,fe.Tl)(gn,this._modelViewLight,Sn);for(let e=0;e<8;++e)(0,A.Z0)(mn[e],mn[e],n.camera.viewMatrix);let c=mn[0][2],h=mn[0][2];for(let e=1;e<8;++e)c=Math.min(c,mn[e][2]),h=Math.max(h,mn[e][2]);c-=200,h+=200,n.camera.near=-h,n.camera.far=-c,function(e,t,i,r,n){const s=1/mn[0][3],o=1/mn[4][3];(0,Xt.vA)(s<o);let a=s+Math.sqrt(s*o);const l=Math.sin((0,je.XM)(e[2]*t[0]+e[6]*t[1]+e[10]*t[2]));a/=l,function(e,t,i,r,n,s,o,a){(0,bt.hZ)(An,0,0);for(let t=0;t<4;++t)(0,bt.WQ)(An,An,e[t]);(0,bt.hs)(An,An,.25),(0,bt.hZ)(Rn,0,0);for(let t=4;t<8;++t)(0,bt.WQ)(Rn,Rn,e[t]);(0,bt.hs)(Rn,Rn,.25),(0,bt.Cc)(En[0],e[4],e[5],.5),(0,bt.Cc)(En[1],e[5],e[6],.5),(0,bt.Cc)(En[2],e[6],e[7],.5),(0,bt.Cc)(En[3],e[7],e[4],.5);let l=0,c=(0,bt.hG)(En[0],An);for(let e=1;e<4;++e){const t=(0,bt.hG)(En[e],An);t<c&&(c=t,l=e)}(0,bt.Re)(On,En[l],e[l+4]);const h=On[0];let u,d;On[0]=-On[1],On[1]=h,(0,bt.Re)(Mn,Rn,An),(0,bt.Om)(Mn,On)<0&&(0,bt.ze)(On,On),(0,bt.Cc)(On,On,Mn,i),(0,bt.S8)(On,On),u=d=(0,bt.Om)((0,bt.Re)(Ln,e[0],An),On);for(let t=1;t<8;++t){const i=(0,bt.Om)((0,bt.Re)(Ln,e[t],An),On);i<u?u=i:i>d&&(d=i)}(0,bt.C)(r,An),(0,bt.hs)(Ln,On,u-t),(0,bt.WQ)(r,r,Ln);let p=-1,g=1,f=0,m=0;for(let t=0;t<8;++t){(0,bt.Re)(Pn,e[t],r),(0,bt.S8)(Pn,Pn);const i=On[0]*Pn[1]-On[1]*Pn[0];i>0?i>p&&(p=i,f=t):i<g&&(g=i,m=t)}(0,Xt.MX)(p>0,"leftArea"),(0,Xt.MX)(g<0,"rightArea"),(0,bt.hs)(Dn,On,u),(0,bt.WQ)(Dn,Dn,An),(0,bt.hs)(In,On,d),(0,bt.WQ)(In,In,An),Fn[0]=-On[1],Fn[1]=On[0];const v=(0,Xt.L)(r,e[m],In,(0,bt.WQ)(Ln,In,Fn),1,n),y=(0,Xt.L)(r,e[f],In,Ln,1,s),x=(0,Xt.L)(r,e[f],Dn,(0,bt.WQ)(Ln,Dn,Fn),1,o),_=(0,Xt.L)(r,e[m],Dn,Ln,1,a);(0,Xt.MX)(v,"rayRay"),(0,Xt.MX)(y,"rayRay"),(0,Xt.MX)(x,"rayRay"),(0,Xt.MX)(_,"rayRay")}(mn,a,l,vn,yn,xn,_n,bn),function(e,t,i,r,n){(0,bt.Re)(Vn,i,r),(0,bt.hs)(Vn,Vn,.5),jn[0]=Vn[0],jn[1]=Vn[1],jn[2]=0,jn[3]=Vn[1],jn[4]=-Vn[0],jn[5]=0,jn[6]=Vn[0]*Vn[0]+Vn[1]*Vn[1],jn[7]=Vn[0]*Vn[1]-Vn[1]*Vn[0],jn[8]=1,jn[zn(0,2)]=-(0,bt.Om)(Wn(jn,0),e),jn[zn(1,2)]=-(0,bt.Om)(Wn(jn,1),e);let s=(0,bt.Om)(Wn(jn,0),i)+jn[zn(0,2)],o=(0,bt.Om)(Wn(jn,1),i)+jn[zn(1,2)],a=(0,bt.Om)(Wn(jn,0),r)+jn[zn(0,2)],l=(0,bt.Om)(Wn(jn,1),r)+jn[zn(1,2)];s=-(s+a)/(o+l),jn[zn(0,0)]+=jn[zn(1,0)]*s,jn[zn(0,1)]+=jn[zn(1,1)]*s,jn[zn(0,2)]+=jn[zn(1,2)]*s,s=1/((0,bt.Om)(Wn(jn,0),i)+jn[zn(0,2)]),o=1/((0,bt.Om)(Wn(jn,1),i)+jn[zn(1,2)]),jn[zn(0,0)]*=s,jn[zn(0,1)]*=s,jn[zn(0,2)]*=s,jn[zn(1,0)]*=o,jn[zn(1,1)]*=o,jn[zn(1,2)]*=o,jn[zn(2,0)]=jn[zn(1,0)],jn[zn(2,1)]=jn[zn(1,1)],jn[zn(2,2)]=jn[zn(1,2)],jn[zn(1,2)]+=1,s=(0,bt.Om)(Wn(jn,1),t)+jn[zn(1,2)],o=(0,bt.Om)(Wn(jn,2),t)+jn[zn(2,2)],a=(0,bt.Om)(Wn(jn,1),i)+jn[zn(1,2)],l=(0,bt.Om)(Wn(jn,2),i)+jn[zn(2,2)],s=-.5*(s/o+a/l),jn[zn(1,0)]+=jn[zn(2,0)]*s,jn[zn(1,1)]+=jn[zn(2,1)]*s,jn[zn(1,2)]+=jn[zn(2,2)]*s,s=(0,bt.Om)(Wn(jn,1),t)+jn[zn(1,2)],o=(0,bt.Om)(Wn(jn,2),t)+jn[zn(2,2)],a=-o/s,jn[zn(1,0)]*=a,jn[zn(1,1)]*=a,jn[zn(1,2)]*=a,n[0]=jn[0],n[1]=jn[1],n[2]=0,n[3]=jn[2],n[4]=jn[3],n[5]=jn[4],n[6]=0,n[7]=jn[5],n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=jn[6],n[13]=jn[7],n[14]=0,n[15]=jn[8]}(vn,yn,_n,bn,n.projectionMatrix),n.projectionMatrix[10]=2/(i-r),n.projectionMatrix[14]=-(i+r)/(i-r)}(i,r,c,h,n.camera),(0,fe.lw)(n.lightMat,n.camera.projectionMatrix,n.camera.viewMatrix);const u=this._textureHeight;n.camera.viewport=[e*u,0,u,u]}_setupMatrices(e,t){(0,fe.lw)(this._projectionView,e.projectionMatrix,e.viewMatrix),(0,fe.B8)(this._projectionViewInverse,this._projectionView);const i=1===this._viewingMode?e.eye:(0,A.hZ)(Sn,0,0,1);(0,fe.t5)(this._modelViewLight,[0,0,0],[-t[0],-t[1],-t[2]],i)}_computeCascadeDistances(e,t,i){const r=i?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor((0,Xt.kL)(t/e,4)),r);const n=(t-e)/this._numCascades,s=(t/e)**(1/this._numCascades);let o=e,a=e;for(let e=0;e<this._numCascades+1;++e)this._cascadeDistances[e]=(0,je.Cc)(o,a,this.settings.splitSchemeLambda),o*=s,a+=n}get _textureWidth(){return this._textureHeight*this._numCascades}get numCascades(){return this._numCascades}get cascadeDistances(){return(0,at.hZ)(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}get test(){}}const gn=(0,F.vt)(),fn=(0,ii.vt)(),mn=[];for(let e=0;e<8;++e)mn.push((0,ii.vt)());const vn=(0,Mr.vt)(),yn=(0,Mr.vt)(),xn=(0,Mr.vt)(),_n=(0,Mr.vt)(),bn=(0,Mr.vt)(),Sn=(0,d.vt)(),wn=[],Cn=(0,F.vt)(),Tn=F.zK.concat(F.zK,F.zK,F.zK),An=(0,Mr.vt)(),Rn=(0,Mr.vt)(),En=[(0,Mr.vt)(),(0,Mr.vt)(),(0,Mr.vt)(),(0,Mr.vt)()],On=(0,Mr.vt)(),Mn=(0,Mr.vt)(),Ln=(0,Mr.vt)(),Pn=(0,Mr.vt)(),Dn=(0,Mr.vt)(),In=(0,Mr.vt)(),Fn=(0,Mr.vt)();function zn(e,t){return 3*t+e}const Nn=(0,Mr.vt)();function Wn(e,t){return(0,bt.hZ)(Nn,e[t],e[t+3]),Nn}const Vn=(0,Mr.vt)(),jn=(0,ae.vt)();var Hn=i(92942);let Un=class extends Tt.w{constructor(){super(...arguments),this.shader=new Ct.r(Hn.T,()=>i.e(959).then(i.bind(i,959)))}initializePipeline(e){return e.hasAlpha?(0,Et.Ey)({blending:Et.T8,colorWrite:Et.kn}):(0,Et.Ey)({colorWrite:Et.kn})}};Un=(0,r.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.lib.TextureTechnique")],Un);class Bn extends Ui.K{constructor(){super(...arguments),this.hasAlpha=!1}}(0,r.Cg)([(0,Ui.W)()],Bn.prototype,"hasAlpha",void 0);var Zn=i(75497),kn=i(80583);let Gn=class extends Tt.w{constructor(){super(...arguments),this.shader=new Ct.r(kn.O,()=>i.e(4849).then(i.bind(i,64849))),this.ignoreUnused=!0}};Gn=(0,r.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.shaders.OverlayCompositingTechnique")],Gn);var qn=i(92359);let $n=class extends _t{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new kn.a,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new nt.A,this._passParameters=new Hn.a,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new vt.A,this.events=new tt.bk,this.longitudeCyclical=null,this.produces=new Map([[18,e=>10!==e||this.hasHighlights],[19,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;const{state:t,stage:i}=e.parent.view,r=i.renderer.fboCache,n=i.renderView.renderingContext,s=i.renderView.techniques;this._renderContext=new an(n,new pn(r,t.viewingMode),s)}initialize(){const e=this._view,t=e.stage.renderView.waterTextures;this.addHandles([(0,h.wB)(()=>t.updating,()=>this.events.emit("content-changed"),h.pc),(0,h.wB)(()=>this._spatialReference,e=>this._localOriginFactory=new Cr(e),h.pc),(0,h.on)(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),(0,h.wB)(()=>function(e){let t=0;for(const i of e){const{name:e}=i;t+=e.length;const{color:r,fillOpacity:n,haloColor:s,haloOpacity:o}=i;t+=r.r+r.g+r.b+r.a+n,t+=s?s.r+s.g+s.b+s.a+o:0}const i=e.at(0);if(i){const{shadowOpacity:e,shadowDifference:r,shadowColor:n}=i;t+=e+r+n.r+n.g+n.b+n.a}return $t+++(t>=0?0:1)}(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,h.Vh),(0,h.wB)(()=>e.state.highlights,e=>{this._bindParameters.highlights=e},h.Vh),e.resourceController.scheduler.registerTask(qn.W6.OVERLAY_RENDERER,this)]);const i=this._camera;i.near=1,i.far=1e4,i.relativeElevation=null,this._bindParameters.slot=18,this._bindParameters.camera=i,this._bindParameters.updateLighting(new Zn.$p((0,d.S)()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=(0,rt.WD)(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const t=new Jt(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:t},this._techniques.precompile(Gn)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||(0,it.Bs)(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const t of this._renderers.values()){const i=t.getMaterialRenderer(e);if(i)return i}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),(0,et.Am)(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,t){const i=this._renderers.get(e);null!=i&&i.destroy(),this._renderers.set(e,t),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles((0,h.wB)(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const t=this._renderers.get(e);null!=t&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),t.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&(0,st.bw)(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=(0,st.bw)(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=(0,st.bw)(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=(0,st.bw)(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,t,i=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new mt(this._stage.renderer.fboCache),this._overlays=[new ut,new ut]),this.ensureDrapeTargets(e),this.ensureDrapeSources(t),this._bindParameters.overlayStretch=i}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const t=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(t?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=(0,it.Bs)(this._renderers,e=>e.hasOccluders)?Kn:1}_processDrapeSources(e,t){let i=!1;for(const[r,n]of this._renderers){if(t?.done)break;(r.destroyed||e(r))&&n.commitChanges()&&(i=!0,t?.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,i=!0,this._updateSortedDrapeSourceRenderers(),t?.madeProgress()),t&&this.compact(t),i&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=(0,it.Bs)(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let t=!1;for(const i of this._renderers.values()){if(e.done)break;t=i.compact(e)||t}return t&&this.notifyChange("updating"),t}hasHighlight(e){return(0,it.Bs)(this._renderers,t=>t.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>1===e.updatePolicy)}get isEmpty(){return!ot.b.OVERLAY_DRAW_DEBUG_TEXTURE&&(0,it.mt)(this._renderers,e=>e.isEmpty)}get hasWater(){const e=(0,it.Bs)(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(ot.b.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const t=this._overlays[0];for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);if(!t.hasSomeSizedView())return!1;const i=this._setOutput(this._renderTargets?.targets.find(t=>t.content===e)?.output??0);++this._techniques.precompiling;const r=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(i),r}_setOutput(e){const t=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=4===e?19:18,t}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let t=!1;return this._renderers.forEach(i=>t=i.updateAnimation(e)||t),t&&this.parent.requestRender(0),t}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const t=this._bindParameters;t.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const e of this._renderTargets.targets){if(1===e.content&&!this._needsColorWithoutRasterImage)continue;const{output:i}=e;this._setOutput(i),10===i&&(t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null);const r=this._renderContext.renderOccludedMask;4===e.content&&(this._renderContext.renderOccludedMask=Kn),this._sortedRenderers.forAll(({drapeSource:t,renderer:i})=>{1===e.content&&0===t.drapeSourceType||4===e.content&&i.hasOnlyOccluders||i.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=r,t.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,t){if(!this._overlays||!this._renderTargets)return;for(const e of this._overlays)e.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const i=this.allSourcesOccluders;for(const e of this._renderTargets.targets){if((0!==e.content||!this._hasDrapedFlowSource)&&!e.handleRenderRequest(t)||1===e.content&&!this._needsColorWithoutRasterImage||4===e.content&&i)continue;const r=this._drawTarget(0,e),n=this._drawTarget(1,e);(r||n)&&e.fbo.generateMipMap()}}_drawTarget(e,t){const i=this._overlays[e],r=i.canvasGeometries;if(0===r.numViews)return!1;const n=this._view.state.contentPixelRatio;this._screenToWorldRatio=n*i.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:s,content:o}=t;if(this.isEmpty||4===s&&!this.hasWater||!i.hasSomeSizedView())return!1;const{_rctx:a,_camera:l,_renderContext:c,_bindParameters:h}=this;if(l.pixelRatio=i.pixelRatio*n,this._setOutput(s),h.screenToWorldRatio=this._screenToWorldRatio,h.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===o&&(c.renderOccludedMask=Kn),!this.renders(o))return c.renderOccludedMask=ln,!1;const{resolution:u}=i,d=0===e,p=d?0:u;if(a.setViewport(p,0,u,u),this._bindTargetFBO(t),d&&(10===s?a.gl.clearBufferuiv(a.gl.COLOR,0,[0,0,0,0]):(a.setClearColor(0,0,0,0),a.clear(16384))),ot.b.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==o&&2!==o){this._techniques.precompile(Un,Xn);const t=this._techniques.get(Un,Xn);for(let n=0;n<r.numViews;n++)this._setViewParameters(r.extents[n],i),this._ensureDebugPatternResources(i.resolution,Qn[e]),a.bindTechnique(t,h,this._passParameters),a.screen.draw()}if(10===s){const{fboCache:i}=this._stage.renderer,r=this._resolution;this._bindTargetFBO(t),function(e,t,i,r,n,s,o=0){const{highlights:a}=n,l=a.length>1?t.acquire(i,r,"highlight mix",a.length>Qt?3:1):null,{gl:c}=e;if(l){const t=e.boundFramebuffer;e.bindFramebuffer(l.fbo),c.clearBufferuiv(c.COLOR,0,[0,0,0,0]),e.bindFramebuffer(t)}const h=l?.getTexture();n.highlightMixTexture=h,(0,bt.hZ)(n.highlightMixOrigin,o,0),a.forEach((t,a)=>{if(a>0){const t=Bt.A.TEXTURE_UNIT_FOR_UPDATES;e.bindTexture(h,t),e.setActiveTexture(t),c.copyTexSubImage2D(3553,0,0,0,o,0,i,r),e.bindTexture(null,t)}e.clear(256),n.highlightLevel=a,s()}),n.highlightLevel=null,n.highlightMixTexture=null,l?.release()}(a,i,r,r,h,()=>this._renderAllGeometry(e,t),p)}else this._renderAllGeometry(e,t);return a.bindFramebuffer(null),c.renderOccludedMask=ln,!0}get allSourcesOccluders(){return(0,it.mt)(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,t){const i=this._overlays[e],r=i.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:n,renderer:s})=>{if(1===t.content&&0===n.drapeSourceType)return;const{fullOpacity:o}=n,a=null!=o&&o<1&&0===t.output&&this._bindTemporaryFBO();for(let e=0;e<r.numViews;e++)this._setViewParameters(r.extents[e],i),s.render(this._renderContext);if(a){this._bindTargetFBO(t),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const i=this._techniques.get(Gn);this._rctx.bindTechnique(i,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}})}_bindTargetFBO(e){const t=this._resolution,i=2*t;e.fbo.ensureFramebuffer(i,t),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,t=2*e,i=this._stage.renderer.fboCache,r=i.acquire(t,e,"overlay tmp");return i.rctx.bindFramebuffer(r.fbo),i.rctx.clear(16384),r}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,t,i,r){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let n=0;for(const{renderer:s}of this._sortedRenderers)n=s.intersect?.(e,t,i,r,n)??n}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),t=e.length;this._renderers.forEach((i,r)=>{const n=e.indexOf(r.layer?.uid),s=n>=0,o=r.renderGroup??(s?0:1),a=r.drapeSourcePriorityOffset??0,l=t*o+(s?n:0)+a;this._sortedRenderers.push(new Yn(r,i,l))}),this._sortedRenderers.sort((e,t)=>e.index-t.index)}_setViewParameters(e,t){const i=this._camera;i.viewport=[0,0,t.resolution,t.resolution],(0,fe.v3)(i.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],i.near,i.far),(0,fe.kN)(i.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,t){if((0,A.hZ)(this._passParameters.color,t[0],t[1],t[2]),this._passParameters.texture)return;const i=new Uint8Array(e*e*4);let r=0;for(let t=0;t<e;t++)for(let n=0;n<e;n++){const s=Math.floor(n/10),o=Math.floor(t/10);s<2||o<2||10*s>e-20||10*o>e-20?(i[r++]=255,i[r++]=255,i[r++]=255,i[r++]=255):(i[r++]=255,i[r++]=255,i[r++]=255,i[r++]=1&s&&1&o?1&n^1&t?0:255:1&s^1&o?0:128)}const n=new Zt.R(e);n.samplingMode=9728,this._passParameters.texture=new Bt.A(this._rctx,n,i)}get test(){}};(0,r.Cg)([(0,u.MZ)()],$n.prototype,"hasHighlights",void 0),(0,r.Cg)([(0,u.MZ)()],$n.prototype,"renderOccludedFlags",void 0),(0,r.Cg)([(0,u.MZ)()],$n.prototype,"_sortedDrapeSourceRenderersDirty",void 0),(0,r.Cg)([(0,u.MZ)({constructOnly:!0})],$n.prototype,"parent",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0})],$n.prototype,"_techniques",null),(0,r.Cg)([(0,u.MZ)({type:Boolean,readOnly:!0})],$n.prototype,"updating",null),(0,r.Cg)([(0,u.MZ)()],$n.prototype,"isEmpty",null),$n=(0,r.Cg)([(0,u.$K)("esri.views.3d.terrain.OverlayRenderer")],$n);class Yn{constructor(e,t,i){this.drapeSource=e,this.renderer=t,this.index=i}}const Qn=[[1,.5,.5],[.5,.5,1]],Kn=4,Xn=new Bn;var Jn;Xn.hasAlpha=!0;class es{constructor(e,t,i,r){this.positions=e,this.polygonIndices=t,this.outline=i,this.projectionSuccess=r,this.count=e.length/3}get vertexCount(){return this.positions.length/3}get polygonIndexCount(){return this.polygonIndices.length}get outlineIndexCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let i=0;i<e.outlineIndices.length;i++)t+=ns(e.outlineIndices[i]);return t}get outlineSegmentCount(){const{outline:e}=this;if("tessellated-indices"!==e.output)return 0;let t=0;for(let i=0;i<e.outlineIndices.length;i++)t+=ns(e.outlineIndices[i]);return t}}class ts extends es{}function is(e,t){const{projectIfNearlyVertical:i=!1,outlineOutput:r="none",method:n}=t??{},s="tessellated-indices"===r,o=Ze(e.rings,!!e.hasZ,e.spatialReference),a=function(e,t){const{hasZ:i,ccwRingsAsHoles:r,spatialReference:n}=t,s=t.axis??Ze(e,i,n),o=e.length,a=[],l=[],c=[],h=[],u=e.reduce((e,t)=>e+t.length,0);let d=0;const p=(0,H.jh)(3*u);let g=0;const f=r&&e[0]&&ke(e[0],i,s);for(let t=o-1;t>=0;t--){const n=e[t],o=Xe(n,i);if(o<3){o>1&&h.push(n);continue}const u=!!r&&ke(n,i,s);if(f?!u:u)a[d++]=n;else{let e=n.length;for(let t=0;t<d;++t)e+=a[t].length;const t={index:g,pathLengths:new Array(d+1),count:e,holeIndices:new Array(d)};t.pathLengths[0]=n.length,n.length>0&&c.push({index:g,count:n.length}),g=Ke(n,p,g,n.length,i,f);for(let e=0;e<d;++e){const r=a[e];t.holeIndices[e]=g,t.pathLengths[e+1]=r.length,r.length>0&&c.push({index:g,count:r.length}),g=Ke(r,p,g,r.length,i,f)}d=0,t.count>0&&l.push(t)}}const m=g;for(const e of h)c.push({index:g,count:e.length}),g=Ke(e,p,g,e.length,i,f);return{positions:3*g===p.length?p:(0,H.l5)(p,0,3*g),polygonVertexCount:m,polygons:l,outlines:c}}(e.rings,{hasZ:!!e.hasZ,ccwRingsAsHoles:!0,spatialReference:e.spatialReference,axis:o}),l=function(e,t){const i=function(e,t){const i={method:t?.method??"auto",projectionAxis:t?.projectionAxis??void 0,outlines:t?.outlines??void 0},{projectionAxis:r}=i,n=null!=r&&2!==r;n&&$e(e.positions,r,2);const s=function(e,t){if("libtess"===t.method)return qe(e,t);const i=Array();let r=0;for(const n of e.polygons){const s=Qe(e.positions,n),o=(n.holeIndices??[]).map(e=>e-n.index),a=o.length>0?o:null,l=(0,ze.e)(s,a,3),c=ze.e.deviation(s,o,3,l);if("auto"===t.method&&c>1e-5)return qe(e,t);for(let e=0;e<l.length;e++)i.push(l[e]+n.index);r=Math.max(r,c)}const{outlineIndexBuffer:n,outlineRingLengths:s}=null!=t.outlines?Ye(t.outlines,e.positions):{outlineIndexBuffer:void 0,outlineRingLengths:void 0};return{succeeded:!0,positions:e.positions,indices:(0,Ve.uW)(i),outlineIndexBuffer:n,outlineRingLengths:s,vertexCount:e.positions.length/3,method:"earcut",deviation:r}}(e,i);if(n){const t=s.succeeded?s.positions:null;null!=t&&t!==e.positions&&$e(t,2,r),$e(e.positions,2,r)}return s}(e,t);return i.succeeded?i:"libtess-not-loaded"===i.message?((0,Ie.gc)(Ge),async function(){try{await(0,Ne.l3)(),Ge.notify()}catch(e){throw e}}()):i}(a,{projectionAxis:i?o:void 0,outlines:s?a.outlines:void 0,method:n});if((0,c.$X)(l))return l;if(!l.succeeded)return null;let h={output:"none"};if("vertex-data"===r){const e=l.positions!==a.positions?a.positions:a.positions.slice();h={output:"vertex-data",outlines:rs(a.outlines,e)}}else"tessellated-indices"===r&&(h=function(e){const{outlineIndexBuffer:t,outlineRingLengths:i}=e;if(null==t||null==i)return{output:"none"};const r=new Array(i.length);let n=0;for(let e=0;e<i.length;e++){const s=i[e],o=t.slice(n,n+s);r[e]=o,n+=s}return{output:"tessellated-indices",outlineIndices:r}}(l));return new ts(l.positions,l.indices,h,!0)}function rs(e,t,i=null){return e.filter(({count:e})=>e>1).map(({index:e,count:r})=>{const n=3*e,s=3*r;return null!=i?new os(e,r,(0,H.l5)(t,n,s),(0,H.l5)(i,n,s)):new ss(e,r,(0,H.l5)(t,n,s))})}function ns(e,t=0,i=e.length){return i>1&&e[t]===e[t+i-1]?i-1:i}class ss{constructor(e,t,i){this.index=e,this.count=t,this.position=i}}class os extends ss{constructor(e,t,i,r){super(e,t,i),this.mapPositions=r}}const as={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:b.A,local:S.default}};let ls=Jn=class extends((0,n.OU)((0,o.WV)((0,l.g)(p.A)))){constructor(e){super(e),this.components=null,this.vertexSpace=new b.A,this.transform=null,this.metadata=new oe,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new C.default,this.type="mesh"}initialize(){(0===this.metadata.externalSources.length||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when(()=>{this.addHandles((0,h.wB)(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):null!=this.metadata.displaySource?.extent}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,i=this;return function(e){const{spatialReference:t,vertexSpace:i,untransformedBounds:r}=e,n=(0,m.gE)(r,Z);if((0,T.Hq)(i)&&e.transform&&(0,U.f)(n,n,e.transform.localMatrix),"georeferenced"===i.type){const e=i.origin;return e&&(0,U.h)(n,n,e),(0,m.w1)((0,m.vY)(n),t)}const s=(0,W.lO)(t),o=i.origin;if(!(0,N.canProjectWithoutEngine)(s,t)){const[e,i,r]=o;return new z.A({xmin:e,ymin:i,zmin:r,xmax:e,ymax:i,zmax:r,spatialReference:t})}return(0,V.l)(t,o,B,s),(0,U.f)(n,n,B),(0,j.projectBuffer)(n,s,0,n,t,0),(0,m.w1)((0,m.vY)(n),t)}({get transform(){return i.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return 0===e.length||0===t?.length?(0,m.vt)(m.v_):(0,m.vY)(e)}get origin(){const e=(0,T.MW)(this.vertexSpace,this.spatialReference);if(null!=e)return e;const{center:t,zmin:i}=this._transformedExtent;return new g.A({x:t.x,y:t.y,z:i,spatialReference:this.spatialReference})}get extent(){return this.loaded||null==this.metadata?.displaySource?.extent?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(y.default.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}a.A.getLogger(this).error("removeComponent()","Provided component is not part of the list of components")}}rotate(e,t,i,r){return(0,v.AU)(e,t,i,cs),function(e,t,i){if(!e.vertexAttributes?.position||0===t[3])return;const{spatialReference:r,vertexSpace:n}=e,s=i?.origin??e.origin;(0,T.CK)(e)?function(e,t,i){e.transform??=new w.A;const{vertexSpace:r,transform:n,spatialReference:s}=e,[o,a,l]=r.origin,c=new g.A({x:o,y:a,z:l,spatialReference:s}),h=_e;if(c.equals(i))(0,A.hZ)(h,0,0,0);else if(!(0,M.p5)(h,i,e))return void(0,O.CN)(ye(),i.spatialReference,s,O.JP);(0,me.x8)(Ae,(0,v.yo)(t),(0,v.$I)(t));const u=(0,fe.O7)(be,Ae,d.uY,d.Un,h),{localMatrix:p}=n,f=(0,fe.lw)(be,u,p);n.scale=(0,fe.X_)((0,d.vt)(),f),(0,fe.hs)(f,f,(0,A.DI)(_e,n.scale));const m=n.rotationAxis;n.rotation=(0,v.ui)(f),0===n.rotationAngle&&(n.rotationAxis=m),n.translation=(0,fe.sC)((0,d.vt)(),f)}(e,t,s):E(n,r)?function(e,t,i){const r=e.spatialReference,n=(0,W.lO)(r),s=Te;if(!(0,R.g)(i,s,n)&&((0,O.CN)(ye(),i.spatialReference,n,"Falling back to mesh origin"),!(0,R.g)(e.origin,s,n)))return void(0,O.CN)(ye(),e.origin.spatialReference,n);const o=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(o.length),h=null!=a?new Float32Array(a.length):null,u=null!=l?new Float32Array(l.length):null;(0,V.l)(n,s,we,n),(0,ge.z0)(Ce,we);const d=Se;(0,A.ei)((0,v.yo)(Se),(0,v.yo)(t),Ce),d[3]=t[3],!(0,O.gr)(o,r,c,n)||null!=a&&null!=h&&!(0,O.X4)(a,o,r,c,n,h)||null!=l&&null!=u&&!(0,O.xA)(l,o,r,c,n,u)?(0,O.CN)(ye(),r,n):(xe(c,d,3,s),!(0,O.$5)(c,n,o,r)||null!=a&&null!=h&&(xe(h,d,3),!(0,O.si)(h,o,r,c,n,a))||null!=l&&null!=u&&(xe(u,d,4),!(0,O.Mv)(u,o,r,c,n,l))?(0,O.CN)(ye(),n,r):e.vertexAttributesChanged())}(e,t,s):function(e,t,i){const r=Te;if(!(0,R.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(ye(),i.spatialReference,e.spatialReference,O.JP)}xe(e.vertexAttributes.position,t,3,r),xe(e.vertexAttributes.normal,t,3),xe(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}(e,t,s)}(this,cs,r),this}offset(e,t,i){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:n}=this,s=n?.position;if(!s)return this;if((0,T.Hq)(r)){const[n,s,o]=r.origin;r.origin=(0,d.fA)(n+e,s+t,o+i)}else{for(let r=0;r<s.length;r+=3)s[r]+=e,s[r+1]+=t,s[r+2]+=i;this.vertexAttributesChanged()}return this}scale(e,t){return this._checkIfLoaded("scale()")?(function(e,t,i){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:n}=e,s=i?.origin??e.origin;(0,T.CK)(e)?function(e,t,i){e.transform??=new w.A;const{vertexSpace:r,transform:n,spatialReference:s}=e,[o,a,l]=r.origin,c=new g.A({x:o,y:a,z:l,spatialReference:s}),h=Oe;if(c.equals(i))(0,A.hZ)(h,0,0,0);else if(!(0,M.p5)(h,i,e))return void(0,O.CN)(Re(),i.spatialReference,s,O.JP);const u=(0,A.hZ)(Me,t,t,t),p=(0,fe.O7)(Le,ve.zK,d.uY,u,h),{localMatrix:f}=n,m=(0,fe.lw)(Le,p,f);n.scale=(0,fe.X_)((0,d.vt)(),m),(0,fe.hs)(m,m,(0,A.DI)(Oe,n.scale));const y=n.rotationAxis;n.rotation=(0,v.ui)(m),0===n.rotationAngle&&(n.rotationAxis=y),n.translation=(0,fe.sC)((0,d.vt)(),m)}(e,t,s):E(r,n)?function(e,t,i){const r=e.spatialReference,n=(0,W.lO)(r),s=Pe;if(!(0,R.g)(i,s,n)&&((0,O.CN)(Re(),i.spatialReference,n,"Falling back to mesh origin"),!(0,R.g)(e.origin,s,n)))return void(0,O.CN)(Re(),e.origin.spatialReference,n);const o=e.vertexAttributes.position,a=e.vertexAttributes.normal,l=e.vertexAttributes.tangent,c=new Float64Array(o.length),h=null!=a?new Float32Array(a.length):null,u=null!=l?new Float32Array(l.length):null;!(0,O.gr)(o,r,c,n)||null!=a&&null!=h&&!(0,O.X4)(a,o,r,c,n,h)||null!=l&&null!=u&&!(0,O.xA)(l,o,r,c,n,u)?(0,O.CN)(Re(),r,n):(Ee(c,t,s),!(0,O.$5)(c,n,o,r)||null!=a&&null!=h&&!(0,O.si)(h,o,r,c,n,a)||null!=l&&null!=u&&!(0,O.Mv)(u,o,r,c,n,l)?(0,O.CN)(Re(),n,r):e.vertexAttributesChanged())}(e,t,s):function(e,t,i){const r=Pe;if(!(0,R.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(Re(),i.spatialReference,e.spatialReference,O.JP)}Ee(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}(e,t,s)}(this,e,t),this):this}centerAt(e,t){return this._checkIfLoaded("centerAt()")?(function(e,t,i){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,n=i?.origin??e.origin;(0,T.Hq)(r)?function(e,t,i){const{vertexSpace:r}=e;if(!(0,T.Hq)(r))return;const n=D,s=P;if(!(0,R.g)(t,s,e.spatialReference))return void(0,O.CN)(L(),t.spatialReference,e.spatialReference,O.JP);if(!(0,R.g)(i,n,e.spatialReference))return void(0,O.CN)(L(),i.spatialReference,e.spatialReference,O.JP);const o=(0,A.Re)(I,s,n);r.origin=(0,A.WQ)((0,d.vt)(),r.origin,o)}(e,t,n):E(r,n.spatialReference)?function(e,t,i){const r=(0,d.fA)(i.x,i.y,i.z??0),n=(0,M.UR)(e,new S.default({origin:r}));if(!n)return;const s=(0,d.fA)(t.x,t.y,t.z??0),o=(0,M.UR)({vertexAttributes:n,spatialReference:e.spatialReference,vertexSpace:new S.default({origin:s})},b.A.absolute);if(!o)return;const{position:a,normal:l,tangent:c}=o;e.vertexAttributes.position=a,e.vertexAttributes.normal=l,e.vertexAttributes.tangent=c,e.vertexAttributesChanged()}(e,t,n):function(e,t,i){const r=D,n=P;if((0,R.g)(t,n,e.spatialReference)){if(!(0,R.g)(i,r,e.spatialReference)){const t=e.origin;return r[0]=t.x,r[1]=t.y,r[2]=t.z,void(0,O.CN)(L(),i.spatialReference,e.spatialReference,O.JP)}(function(e,t,i){if(e)for(let r=0;r<e.length;r+=3)for(let n=0;n<3;n++)e[r+n]+=t[n]-i[n]})(e.vertexAttributes.position,n,r),e.vertexAttributesChanged()}else(0,O.CN)(L(),t.spatialReference,e.spatialReference,O.JP)}(e,t,n)}(this,e,t),this):this}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(async function(e,t,r){switch(t.source.type){case"client":case"service":return async function(e,t,r){const{source:n}=t,{loadGLTFMesh:o}=await(0,c.qr)(i.e(5841).then(i.bind(i,35841)),r),a=await q(n,r);(0,c.Te)(r);const l=o(new g.A({x:0,y:0,z:0,spatialReference:e.spatialReference}),a.url,{resolveFile:G(a),signal:r?.signal,expectedType:a.type,unitConversionDisabled:t.unitConversionDisabled});l.then(()=>a.dispose(),()=>a.dispose());const{mesh:{vertexAttributes:h,components:u},meta:{isDracoDecompressed:d}}=await l;if(d)throw new s.A("mesh-load-external:draco-not-supported","The provided mesh uses Draco compression which is not supported.");e.vertexAttributes=h,e.components=u}(e,t,r);case"loadable":return t.source.load(e,r);default:t.source}}(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(e){return super.clone((0,re.WO)((0,re.QN)(e)))}cloneShallow(){return new Jn({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([i.e(4038).then(i.bind(i,84038)),this.load(e)]);return(0,c.Te)(e),await t(this,e)}get usedMemory(){return this.components?this.components.reduce((e,t)=>e+t.memoryUsage,this.vertexAttributes.usedMemory):this.vertexAttributes.usedMemory}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(a.A.getLogger(this).error(e,"Mesh must be loaded before applying operations"),!1)}static createBox(e,t){if(!(e instanceof g.A))return a.A.getLogger(this.prototype).error(".createBox()",x),null;const i=new Jn(ce(function(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:i}=he,r=4*e.length,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let l=0,c=0,h=0,u=0;for(let r=0;r<e.length;r++){const d=e[r],p=l/3;for(const e of t)a[u++]=p+e;const g=d.corners;for(let e=0;e<4;e++){const t=g[e];let r=0;o[h++]=.25*i[e][0]+d.uvOrigin[0],o[h++]=d.uvOrigin[1]-.25*i[e][1];for(let e=0;e<3;e++)0!==d.axis[e]?(n[l++]=.5*d.axis[e],s[c++]=d.axis[e]):(n[l++]=.5*t[r++],s[c++]=0)}}return{position:n,normal:s,uv:o,faces:a}}(),e,t));return t?.imageFace&&"all"!==t.imageFace?function(e,t){const i=e.components[0],r=i.faces,n=ue[t],s=6*n,o=new Array(6),a=new Array(r.length-6);let l=0,c=0;for(let e=0;e<r.length;e++)e>=s&&e<s+6?o[l++]=r[e]:a[c++]=r[e];if(null!=e.vertexAttributes.uv){const t=new Float32Array(e.vertexAttributes.uv),i=4*n*2,r=[0,1,1,1,1,0,0,0];for(let e=0;e<r.length;e++)t[i+e]=r[e];e.vertexAttributes.uv=t}return e.components=[new y.default({faces:o,material:i.material}),new y.default({faces:a})],e}(i,t.imageFace):i}static createSphere(e,t){return e instanceof g.A?new Jn(ce(function(e=0){const t=Math.round(8*2**e),i=2*t,r=(t-1)*(i+1)+2*i,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array((t-1)*i*2*3);let l=0,c=0,h=0,u=0;for(let e=0;e<=t;e++){const r=e/t*Math.PI+.5*Math.PI,d=Math.cos(r),p=Math.sin(r);de[2]=p;const g=0===e||e===t,f=g?i-1:i;for(let r=0;r<=f;r++){const p=r/f*2*Math.PI;de[0]=-Math.sin(p)*d,de[1]=Math.cos(p)*d;for(let e=0;e<3;e++)n[l]=.5*de[e],s[l]=de[e],++l;o[c++]=(r+(g?.5:0))/i,o[c++]=e/t,0!==e&&r!==i&&(e!==t&&(a[h++]=u,a[h++]=u+1,a[h++]=u-i),1!==e&&(a[h++]=u,a[h++]=u-i,a[h++]=u-i-1)),u++}}return{position:n,normal:s,uv:o,faces:a}}(t?.densificationFactor||0),e,t)):(a.A.getLogger(this.prototype).error(".createSphere()",x),null)}static createCylinder(e,t){return e instanceof g.A?new Jn(ce(function(e=0){const t=Math.round(16*2**e),i=4*(t+1)+2*t,r=new Float64Array(3*i),n=new Float32Array(3*i),s=new Float32Array(2*i),o=new Uint32Array(4*t*3);let a=0,l=0,c=0,h=0,u=0;for(let e=0;e<=5;e++){const i=0===e||5===e,d=e<=1||e>=4,p=2===e||4===e,g=i?t-1:t;for(let f=0;f<=g;f++){const m=f/g*2*Math.PI,v=i?0:.5;de[0]=v*Math.sin(m),de[1]=v*-Math.cos(m),de[2]=e<=2?.5:-.5;for(let t=0;t<3;t++)r[a++]=de[t],n[l++]=d?2===t?e<=1?1:-1:0:2===t?0:de[t]/v;s[c++]=(f+(i?.5:0))/t,s[c++]=e<=1?1*e/3:e<=3?1*(e-2)/3+1/3:1*(e-4)/3+2/3,p||0===e||f===t||(5!==e&&(o[h++]=u,o[h++]=u+1,o[h++]=u-t),1!==e&&(o[h++]=u,o[h++]=u-t,o[h++]=u-t-1)),u++}}return{position:r,normal:n,uv:s,faces:o}}(t?.densificationFactor||0),e,t)):(a.A.getLogger(this.prototype).error(".createCylinder()",x),null)}static createPlane(e,t){if(!(e instanceof g.A))return a.A.getLogger(this.prototype).error(".createPlane()",x),null;const i=t?.facing??"up",r=function(e,t){const i="number"==typeof t?t:null!=t?t.width:1,r="number"==typeof t?t:null!=t?t.height:1;switch(e){case"up":case"down":return{width:i,depth:r};case"north":case"south":return{width:i,height:r};case"east":case"west":return{depth:i,height:r}}}(i,t?.size);return new Jn(ce(function(e){const t=le.facingAxisOrderSwap[e],i=le.position,r=le.normal,n=new Float64Array(i.length),s=new Float32Array(r.length);let o=0;for(let e=0;e<4;e++){const e=o;for(let a=0;a<3;a++){const l=t[a],c=Math.abs(l)-1,h=l>=0?1:-1;n[o]=i[e+c]*h,s[o]=r[e+c]*h,o++}}return{position:n,normal:s,uv:new Float32Array(le.uv),faces:new Uint32Array(le.faces),isPlane:!0}}(i),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof f.A))return a.A.getLogger(this.prototype).error(".createFromPolygon()","Expected polygon to be a Polygon instance"),null;const i=is(e,{method:"earcut"}),r=(0,c.$X)(i)?null:i,n=r?.positions??[],s=r?.polygonIndices??[];return new Jn({vertexAttributes:new C.default({position:n}),components:[new y.default({faces:s,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new b.A})}static async createFromGLTF(e,t,r){if(!(e instanceof g.A)){const e=new _;throw a.A.getLogger(this.prototype).error(".createfromGLTF()",e.message),e}const{loadGLTFMesh:n}=await(0,c.qr)(i.e(5841).then(i.bind(i,35841)),r);return new Jn((await n(e,t,r)).mesh)}static createWithExternalSource(e,t,i){const r=i?.extent??null,{spatialReference:n}=e,s=i?.transform?.clone()??new w.A,o=(0,T.TE)(e,i),a=i?.unitConversionDisabled,l={source:t,extent:r,unitConversionDisabled:a},c=new oe;return c.externalSources.push(l),new Jn({metadata:c,transform:s,vertexSpace:o,spatialReference:n})}static createIncomplete(e,t){const{spatialReference:i}=e,r=t?.transform?.clone()??new w.A,n=(0,T.TE)(e,t),o=new Jn({transform:r,vertexSpace:n,spatialReference:i});return o.addResolvingPromise(Promise.reject(new s.A("mesh-incomplete","Mesh resources are not complete"))),o}};(0,r.Cg)([(0,u.MZ)({type:[y.default],json:{write:!0}})],ls.prototype,"components",void 0),(0,r.Cg)([(0,u.MZ)({nonNullable:!0,types:as,constructOnly:!0,json:{write:!0},clonable:(e,t)=>(0,re.o2)(t)?.vertexSpace??e.clone(t)})],ls.prototype,"vertexSpace",void 0),(0,r.Cg)([(0,u.MZ)({type:w.A,clonable:(e,t)=>{const i=(0,re.o2)(t);return i&&"transform"in i?i.transform:e?.clone()??e},json:{write:!0}})],ls.prototype,"transform",void 0),(0,r.Cg)([(0,u.MZ)({constructOnly:!0,type:oe,clonable:(e,t)=>(0,re.o2)(t)?.metadata??e.clone()})],ls.prototype,"metadata",void 0),(0,r.Cg)([(0,u.MZ)()],ls.prototype,"hasExtent",null),(0,r.Cg)([(0,u.MZ)()],ls.prototype,"_transformedExtent",null),(0,r.Cg)([(0,u.MZ)()],ls.prototype,"_untransformedBounds",null),(0,r.Cg)([(0,u.MZ)()],ls.prototype,"origin",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1}})],ls.prototype,"extent",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!0}})],ls.prototype,"hasZ",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1,write:!0,default:!1}})],ls.prototype,"hasM",void 0),(0,r.Cg)([(0,u.MZ)({type:C.default,nonNullable:!0,json:{write:!0},clonable:(e,t)=>(0,re.o2)(t)?.vertexAttributes??e.clone(t)})],ls.prototype,"vertexAttributes",void 0),ls=Jn=(0,r.Cg)([(0,u.$K)("esri.geometry.Mesh")],ls);const cs=(0,v.vt)()},15585(e,t,i){i.d(t,{If:()=>p,O5:()=>v,O9:()=>f,QT:()=>m,l3:()=>g});var r=i(5482),n=i(2741),s=i(49186),o=i(44208),a=i(34727);let l=null,c=null,h=null,u=null;const d=(new Float32Array(0),new Uint32Array(0),new Uint32Array(0),new Uint32Array(0),{vertices:new Float64Array(0),indices:new Uint32Array(0),outlineIndices:new Uint32Array(0),outlineRingLengths:new Uint32Array(0),vertexCount:0,indexCount:0,outlineIndexCount:0,outlineRingCount:0});async function p(){return l??=async function(){const e=await i.e(2997).then(i.bind(i,42997)),t=await e.default({locateFile:e=>(0,n.s)(`esri/core/libs/libtess/${e}`)});h=t}(),l}async function g(){return c??=async function(){const e=await i.e(9134).then(i.bind(i,99134)),t=await e.default({locateFile:e=>(0,n.s)(`esri/core/libs/libtess/${e}`)});u=t}(),c}function f(){return null!==u}function m(e,t,i=2){const n={stack:[],error:void 0,hasError:!1};try{const a=h;if(!a)throw new s.A("libtess:not-loaded","libtessF32 not loaded");const l=(0,r.mS)(n,b.from(a,e),!1),c=(0,r.mS)(n,w.from(a,t),!1),u=e.length/i*4,d=(0,r.mS)(n,new b(a,u*i),!1),p=a.triangulate(l.ptr,c.ptr,c.size,i,d.ptr,u);if((0,o.A)("esri-tessellation-debug")){const e=a.getError();0!==e&&console.warn("libtess:triangulation",C(e))}return{buffer:d.slice(0,p*i),vertexCount:p}}catch(e){n.error=e,n.hasError=!0}finally{(0,r.hk)(n)}}function v(e,t,i=2,n=!0){const l={stack:[],error:void 0,hasError:!1};try{const c=u;if(!c)throw new s.A("libtess:not-loaded","libtessF64 not loaded");const h=(0,r.mS)(l,S.from(c,e),!1),p=(0,r.mS)(l,w.from(c,t),!1),g=(0,r.mS)(l,new w(c,1),!1),f=(0,r.mS)(l,new w(c,1),!1),m=(0,r.mS)(l,new w(c,1),!1),v=(0,r.mS)(l,new w(c,1),!1),{maxVertexCount:y,maxIndexCount:x,maxOutlineIndexCount:b,maxOutlineRingCount:T}=function(e,t){const i=e.reduce((e,t)=>e+t,0),r=e.length,n=Math.max(0,e.length-1),s=Math.max(0,i+2*n-2),o=Math.max(0,Math.ceil(2*i)),l=Math.max(0,Math.ceil(3*s*2)),c=(0,a.mP)(l,3),h=i>0?Math.max(2,Math.ceil(.25*i)):0,u=i>0?Math.max(1,Math.ceil(h/3)):0;return{maxVertexCount:o,maxIndexCount:c,maxOutlineIndexCount:t?Math.max(0,i+r+h):0,maxOutlineRingCount:t?Math.max(0,r+u):0}}(t,n);let A=0,R=0,E=0,O=0,M=0;{const e={stack:[],error:void 0,hasError:!1};try{const t=(0,r.mS)(e,new S(c,y*i),!1),s=(0,r.mS)(e,new w(c,x),!1),o=(0,r.mS)(e,n?new w(c,b):null,!1),a=(0,r.mS)(e,n?new w(c,T):null,!1);if(c.triangulateIndexed(h.ptr,p.ptr,p.size,i,t.ptr,y,i,s.ptr,x,g.ptr,f.ptr,o?.ptr??0,b,a?.ptr??0,T,m.ptr,v.ptr),M=c.getError(),A=_(c)[g.ptr/Int32Array.BYTES_PER_ELEMENT],R=_(c)[f.ptr/Int32Array.BYTES_PER_ELEMENT],E=_(c)[m.ptr/Int32Array.BYTES_PER_ELEMENT],O=_(c)[v.ptr/Int32Array.BYTES_PER_ELEMENT],0===M){const e=t.slice(0,A*i);return{vertices:e,indices:s.slice(0,R),outlineIndices:n&&o?o.slice(0,E):d.outlineIndices,outlineRingLengths:n&&a?a.slice(0,O):d.outlineRingLengths,vertexCount:A,indexCount:R,outlineIndexCount:n?E:0,outlineRingCount:n?O:0}}}catch(t){e.error=t,e.hasError=!0}finally{(0,r.hk)(e)}}if(100903!==M)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",C(M)),d;const L=(0,r.mS)(l,new S(c,A*i),!1),P=(0,r.mS)(l,new w(c,R),!1),D=(0,r.mS)(l,n?new w(c,E):null,!1),I=(0,r.mS)(l,n?new w(c,O):null,!1);if(c.triangulateIndexed(h.ptr,p.ptr,p.size,i,L.ptr,A,i,P.ptr,R,g.ptr,f.ptr,D?.ptr??0,n?E:0,I?.ptr??0,n?O:0,m.ptr,v.ptr),M=c.getError(),0!==M)return(0,o.A)("esri-tessellation-debug")&&console.warn("libtess:triangulation",C(M)),d;const F=_(c)[g.ptr/Int32Array.BYTES_PER_ELEMENT],z=_(c)[f.ptr/Int32Array.BYTES_PER_ELEMENT],N=_(c)[m.ptr/Int32Array.BYTES_PER_ELEMENT],W=_(c)[v.ptr/Int32Array.BYTES_PER_ELEMENT],V=L.slice(0,F*i);return{vertices:V,indices:P.slice(0,z),outlineIndices:n&&D?D.slice(0,N):d.outlineIndices,outlineRingLengths:n&&I?I.slice(0,W):d.outlineRingLengths,vertexCount:F,indexCount:z,outlineIndexCount:n?N:0,outlineRingCount:n?W:0}}catch(e){l.error=e,l.hasError=!0}finally{(0,r.hk)(l)}}function y(e){return e.HEAPF64}function x(e){return e.HEAPF32}function _(e){return e.HEAP32}class b{static from(e,t){const i=new b(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float32Array.BYTES_PER_ELEMENT}set(e){x(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return x(this._libtess).slice(i+e,i+t)}}class S{static from(e,t){const i=new S(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateCoordinateArray(t)}destroy(){this._libtess.destroyCoordinateArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Float64Array.BYTES_PER_ELEMENT}set(e){y(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return y(this._libtess).slice(i+e,i+t)}}class w{static from(e,t){const i=new w(e,t.length);return i.set(t),i}constructor(e,t){this._libtess=e,this.size=t,this.ptr=e.allocateLengthsArray(t)}destroy(){this._libtess.destroyLengthsArray(this.ptr)}[Symbol.dispose](){this.destroy()}get bytesPerCoordinate(){return Int32Array.BYTES_PER_ELEMENT}set(e){_(this._libtess).set(e,this.ptr/this.bytesPerCoordinate)}slice(e,t){const i=this.ptr/this.bytesPerCoordinate;return function(e){const t=_(e);return new Uint32Array(t.buffer,t.byteOffset,t.length)}(this._libtess).slice(i+e,i+t)}}function C(e){switch(e){case 100903:return"Insufficient output buffer";case 100902:return"Out of memory";case 100151:return"Missing begin polygon";case 100152:return"Missing begin contour";case 100153:return"Missing end polygon";case 100154:return"Missing end countour";case 100155:return"Coordinates too large";case 100156:return"Missing combine callback";default:return`Unknown: ${e}`}}},16939(e,t,i){i.r(t),i.d(t,{default:()=>p});var r,n=i(5482),s=i(69540),o=i(25482),a=i(53966),l=i(91429),c=i(56507),h=i(19211),u=i(80882),d=i(31199);let p=r=class extends((0,s.OU)(o.o)){static from(e){return(0,c.PZ)(r,e)}constructor(e){super(e),this.material=null,this.name=void 0,this.shading="source",this.trustSourceNormals=!1}get faces(){return this._get("faces")??null}set faces(e){this._set("faces",(0,d.b)(e,Uint32Array,[Uint16Array],{loggerTag:".faces=",stride:3},a.A.getLogger(this)))}castMaterial(e){return(0,c.PZ)(e&&"object"==typeof e&&("metallic"in e||"roughness"in e||"metallicRoughnessTexture"in e)?u.A:h.default,e)}get memoryUsage(){let e=0;return null!=this.faces&&(e+=this.faces.byteLength),null!=this.material&&(e+=this.material.memoryUsage),e}};(0,n.Cg)([(0,l.MZ)({json:{write:d.B}})],p.prototype,"faces",null),(0,n.Cg)([(0,l.MZ)({type:h.default,json:{write:!0}})],p.prototype,"material",void 0),(0,n.Cg)([(0,l.wg)("material")],p.prototype,"castMaterial",null),(0,n.Cg)([(0,l.MZ)({json:{write:!0}})],p.prototype,"name",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],p.prototype,"shading",void 0),(0,n.Cg)([(0,l.MZ)({type:Boolean})],p.prototype,"trustSourceNormals",void 0),p=r=(0,n.Cg)([(0,l.$K)("esri.geometry.support.MeshComponent")],p)},95696(e,t,i){i.d(t,{A:()=>c});var r,n=i(5482),s=i(69540),o=i(25482),a=i(91429),l=i(93223);let c=class extends((0,s.OU)(o.o)){static{r=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new r}};(0,n.Cg)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],c.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],c.prototype,"origin",void 0),c=r=(0,n.Cg)([(0,a.$K)("esri.geometry.support.MeshGeoreferencedVertexSpace")],c)},18251(e,t,i){i.r(t),i.d(t,{default:()=>c});var r=i(5482),n=i(69540),s=i(25482),o=i(91429),a=i(51850),l=i(93223);let c=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.type="local",this.origin=(0,a.vt)()}};(0,r.Cg)([(0,l.e)({local:"local"},{readOnly:!0})],c.prototype,"type",void 0),(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],c.prototype,"origin",void 0),c=(0,r.Cg)([(0,o.$K)("esri.geometry.support.MeshLocalVertexSpace")],c)},19211(e,t,i){i.r(t),i.d(t,{default:()=>u});var r=i(5482),n=i(68197),s=i(69540),o=i(25482),a=i(91429),l=i(35063),c=i(51147),h=i(66895);let u=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.color=null,this.colorTextureTransform=null,this.normalTextureTransform=void 0,this.alphaMode="auto",this.alphaCutoff=.5,this.doubleSided=!0}get colorTexture(){return this._get("colorTexture")}set colorTexture(e){this._set("colorTexture",null==e?null:l.default.from(e))}get normalTexture(){return this._get("normalTexture")}set normalTexture(e){this._set("normalTexture",null==e?null:l.default.from(e))}clone(e){const t=(0,h.hz)(e),i=t?.materialMap?.get(this);if(i)return i;const r=super.clone((0,h.QN)(e));return t?.materialMap?.set(this,r),r}get memoryUsage(){return this.getMemoryUsage()}getMemoryUsage(){let e=0;return e+=null!=this.color?16:0,null!=this.colorTexture&&(e+=this.colorTexture.memoryUsage),e+=null!=this.colorTextureTransform?20:0,null!=this.normalTexture&&(e+=this.normalTexture.memoryUsage),e+=null!=this.normalTextureTransform?20:0,e}};(0,r.Cg)([(0,a.MZ)({type:n.A,json:{write:!0}})],u.prototype,"color",void 0),(0,r.Cg)([(0,a.MZ)({type:l.default,json:{write:!0},value:null})],u.prototype,"colorTexture",null),(0,r.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],u.prototype,"colorTextureTransform",void 0),(0,r.Cg)([(0,a.MZ)({type:l.default,json:{write:!0},value:null})],u.prototype,"normalTexture",null),(0,r.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],u.prototype,"normalTextureTransform",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],u.prototype,"alphaMode",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],u.prototype,"alphaCutoff",void 0),(0,r.Cg)([(0,a.MZ)({nonNullable:!0,json:{write:!0}})],u.prototype,"doubleSided",void 0),u=(0,r.Cg)([(0,a.$K)("esri.geometry.support.MeshMaterial")],u)},80882(e,t,i){i.d(t,{A:()=>c});var r=i(5482),n=i(68197),s=i(91429),o=i(19211),a=i(35063),l=i(51147);let c=class extends o.default{constructor(e){super(e),this.emissiveColor=null,this.emissiveStrength=null,this.emissiveTextureTransform=void 0,this.occlusionTextureTransform=void 0,this.metallic=1,this.roughness=1,this.metallicRoughnessTextureTransform=void 0}get emissiveTexture(){return this._get("emissiveTexture")}set emissiveTexture(e){this._set("emissiveTexture",null==e?null:a.default.from(e))}get occlusionTexture(){return this._get("occlusionTexture")}set occlusionTexture(e){this._set("occlusionTexture",null==e?null:a.default.from(e))}get metallicRoughnessTexture(){return this._get("metallicRoughnessTexture")}set metallicRoughnessTexture(e){this._set("metallicRoughnessTexture",null==e?null:a.default.from(e))}getMemoryUsage(){let e=super.getMemoryUsage();return e+=null!=this.emissiveColor?16:0,null!=this.emissiveTexture&&(e+=this.emissiveTexture.memoryUsage),e+=null!=this.emissiveTextureTransform?20:0,null!=this.occlusionTexture&&(e+=this.occlusionTexture.memoryUsage),e+=null!=this.occlusionTextureTransform?20:0,null!=this.metallicRoughnessTexture&&(e+=this.metallicRoughnessTexture.memoryUsage),e+=null!=this.metallicRoughnessTextureTransform?20:0,e}};(0,r.Cg)([(0,s.MZ)({type:n.A,json:{write:!0}})],c.prototype,"emissiveColor",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0}})],c.prototype,"emissiveStrength",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"emissiveTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"emissiveTextureTransform",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"occlusionTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"occlusionTextureTransform",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],c.prototype,"metallic",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0},range:{min:0,max:1}})],c.prototype,"roughness",void 0),(0,r.Cg)([(0,s.MZ)({type:a.default,json:{write:!0},value:null})],c.prototype,"metallicRoughnessTexture",null),(0,r.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],c.prototype,"metallicRoughnessTextureTransform",void 0),c=(0,r.Cg)([(0,s.$K)("esri.geometry.support.MeshMaterialMetallicRoughness")],c)},35063(e,t,i){i.r(t),i.d(t,{default:()=>m});var r,n=i(5482),s=i(69540),o=i(21287),a=i(25482),l=i(91429),c=i(56507),h=i(66895),u=i(97159),d=i(43937),p=i(36005);const g=new WeakMap;let f=0,m=class extends((0,s.OU)(a.o)){static{r=this}constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,i,r){if(e instanceof HTMLImageElement){const n={type:"image-element",src:(0,u.c)(e.src,r),crossOrigin:e.crossOrigin};t[i]=n}else if(e instanceof HTMLCanvasElement){const r={type:"canvas-element",imageData:v(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[i]=r}else if(e instanceof HTMLVideoElement){const n={type:"video-element",src:(0,u.c)(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[i]=n}else if(e instanceof ImageData){const r={type:"image-data",imageData:v(e)};t[i]=r}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=y(e.imageData),i=document.createElement("canvas");return i.width=t.width,i.height=t.height,i.getContext("2d").putImageData(t,0,0),i}case"image-data":return y(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const{data:e,url:t}=this,i=e=>e?.toLowerCase().endsWith(".png")||e?.toLocaleLowerCase().startsWith("data:image/png;");return e instanceof HTMLCanvasElement?x(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?x(e):!(!t||!i(t))||!!(e instanceof HTMLImageElement&&i(e.src))}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e="string"==typeof this.wrap?this.wrap:"object"==typeof this.wrap?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(t="")=>`d:${t},t:${this.transparent},w:${e}`;return null!=this.url?t(this.url):null!=this.data?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(g.has(this.data)||g.set(this.data,++f),t(g.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=null!=this.url?this.url.length:0,null!=this.data){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(e){const t=(0,h.$N)(e),i=t?.textureMap?.get(this);if(i)return i;const r=super.clone(e);return t?.textureMap?.set(this,r),r}static from(e){return"string"==typeof e?new r({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new r({data:e}):(0,c.PZ)(r,e)}};function v(e){let t="";for(let i=0;i<e.data.length;i++)t+=String.fromCharCode(e.data[i]);return{data:btoa(t),width:e.width,height:e.height}}function y(e){const t=atob(e.data),i=new Uint8ClampedArray(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return(0,o.eV)(i,e.width,e.height)}function x(e){for(let t=3;t<e.data.length;t+=4)if(255!==e.data[t])return!0;return!1}(0,n.Cg)([(0,l.MZ)({type:String,json:{write:u.w}})],m.prototype,"url",null),(0,n.Cg)([(0,l.MZ)({clonable:"reference",json:{write:{overridePolicy(){return{enabled:!this.url}}}}})],m.prototype,"data",null),(0,n.Cg)([(0,d.K)("data")],m.prototype,"writeData",null),(0,n.Cg)([(0,p.w)("data")],m.prototype,"readData",null),(0,n.Cg)([(0,l.MZ)({type:Boolean,json:{write:{overridePolicy(){return{enabled:this._isOverridden("transparent")}}}}})],m.prototype,"transparent",null),(0,n.Cg)([(0,l.MZ)({json:{write:!0}})],m.prototype,"wrap",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],m.prototype,"contentHash",null),m=r=(0,n.Cg)([(0,l.$K)("esri.geometry.support.MeshTexture")],m)},51147(e,t,i){i.d(t,{A:()=>a});var r=i(5482),n=i(69540),s=i(25482),o=i(91429);let a=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.offset=[0,0],this.rotation=0,this.scale=[1,1]}};(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],a.prototype,"offset",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],a.prototype,"rotation",void 0),(0,r.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],a.prototype,"scale",void 0),a=(0,r.Cg)([(0,o.$K)("esri.geometry.support.MeshTextureTransform")],a)},1193(e,t,i){i.r(t),i.d(t,{default:()=>u});var r,n=i(5482),s=i(69540),o=i(25482),a=i(4718),l=i(53966),c=i(91429),h=i(31199);let u=r=class extends((0,s.OU)(o.o)){constructor(e){super(e),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(e){return(0,h.b)(e,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},l.A.getLogger(this))}castPosition(e){return e&&e instanceof Float32Array&&l.A.getLogger(this).warn(".position=","Setting position attribute from a Float32Array may cause precision problems. Consider storing data in a Float64Array or a regular number array"),(0,h.b)(e,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},l.A.getLogger(this))}castUv(e){return(0,h.b)(e,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},l.A.getLogger(this))}castNormal(e){return(0,h.b)(e,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},l.A.getLogger(this))}castTangent(e){return(0,h.b)(e,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},l.A.getLogger(this))}clonePositional(){const e={position:(0,a.o8)(this.position),normal:(0,a.o8)(this.normal),tangent:(0,a.o8)(this.tangent),uv:this.uv,color:this.color};return new r(e)}get usedMemory(){return this.position.byteLength+(this.uv?.byteLength??0)+(this.normal?.byteLength??0)+(this.tangent?.byteLength??0)+(this.color?.byteLength??0)}};(0,n.Cg)([(0,c.MZ)({json:{write:h.B}})],u.prototype,"color",void 0),(0,n.Cg)([(0,c.wg)("color")],u.prototype,"castColor",null),(0,n.Cg)([(0,c.MZ)({nonNullable:!0,json:{write:h.B}})],u.prototype,"position",void 0),(0,n.Cg)([(0,c.wg)("position")],u.prototype,"castPosition",null),(0,n.Cg)([(0,c.MZ)({json:{write:h.B}})],u.prototype,"uv",void 0),(0,n.Cg)([(0,c.wg)("uv")],u.prototype,"castUv",null),(0,n.Cg)([(0,c.MZ)({json:{write:h.B}})],u.prototype,"normal",void 0),(0,n.Cg)([(0,c.wg)("normal")],u.prototype,"castNormal",null),(0,n.Cg)([(0,c.MZ)({json:{write:h.B}})],u.prototype,"tangent",void 0),(0,n.Cg)([(0,c.wg)("tangent")],u.prototype,"castTangent",null),u=r=(0,n.Cg)([(0,c.$K)("esri.geometry.support.MeshVertexAttributes")],u)},31199(e,t,i){function r(e,t,i,r){const{loggerTag:n,stride:s}=t;return e.length%s!==0?(r.error(n,`Invalid array length, expected a multiple of ${s}`),new i([])):e}function n(e,t,i,n,s){if(!e)return e;if(e instanceof t)return r(e,n,t,s);for(const o of i)if(e instanceof o)return r(new t(e),n,t,s);if(Array.isArray(e))return r(new t(e),n,t,s);{const r=i.map(e=>`'${e.name}'`);return s.error(`Failed to set property, expected one of ${r}, but got ${e.constructor.name}`),new t([])}}function s(e,t,i){t[i]=function(e){const t=new Array(e.length);for(let i=0;i<e.length;i++)t[i]=e[i];return t}(e)}i.d(t,{B:()=>s,b:()=>n})},63579(e,t,i){i.d(t,{Bq:()=>l,Qp:()=>a,WN:()=>m,dK:()=>v,eN:()=>p,fH:()=>f,in:()=>g,yr:()=>c});var r=i(11254),n=i(4576),s=i(17676),o=i(20557);class a{constructor(e,t,i){this.assetName=e,this.assetMimeType=t,this.parts=i}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,n.aI)(this.parts,e.parts,(e,t)=>e.equals(t))}isOnService(e){return this.parts.every(t=>t.isOnService(e))}makeHash(){let e="";for(const t of this.parts)e+=t.partHash;return e}async toBlob(e){const{parts:t}=this;if(1===t.length)return t[0].toBlob(e);const i=await Promise.all(t.map(t=>t.toBlob(e)));return(0,s.Te)(e),new Blob(i)}}class l{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:t}=await(0,r.A)(this.partUrl,{responseType:"blob"});return(0,s.Te)(e),t}}function c(e){return function(e){switch(e?.type){case"client":return Array.isArray(e.files)?e.files.some(d):d(e.files);case"service":return e.assets.some(d);case"loadable":return!0;default:return!1}}(e?.source)}const h=/^(model\/gltf\+json)|(model\/gltf-binary)$/,u=/\.(gltf|glb)/i;function d(e){if(e instanceof File){const{type:t,name:i}=e;return h.test(t)||u.test(i)}return h.test(e.assetMimeType)||u.test(e.assetName)}function p(e,t){if(!e)return!1;const{source:i}=e;return function(e,t){return"service"===e.type&&e.assets.every(e=>e.isOnService(t))}(i,t)}function g(e,t){if(e===t)return!0;const{source:i}=e,{source:r}=t;if(i===r)return!0;if("service"===i.type&&"service"===r.type){if(i.assets.length!==r.assets.length)return!1;const e=(e,t)=>e.assetName<t.assetName?-1:e.assetName>t.assetName?1:0,t=[...i.assets].sort(e),n=[...r.assets].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(n[e]))return!1;return!0}return!1}function f(e,t){return e instanceof File?(0,o.rq)(e,t):(0,o.z$)(e.assetMimeType,e.assetName,t)}function m(e){switch(e.type){case"client":return Array.isArray(e.files)?e.files:[e.files];case"service":return e.assets;case"loadable":return}}function v(e){return!!e.original}},66895(e,t,i){i.d(t,{$N:()=>h,Lz:()=>s,QN:()=>u,WO:()=>l,hz:()=>a,o2:()=>n});const r=Symbol("meshContext");function n(e){return e&&"object"==typeof e&&r in e?e[r]:void 0}function s(e,t){const i=n(e);return{...e,[r]:{...i,...t}}}const o=Symbol("meshMaterialContext");function a(e){return e&&"object"==typeof e&&o in e?e[o]:void 0}function l(e){const t=a(e);if(t?.materialMap)return e;const i={materialMap:new Map};return{...e,[o]:i}}const c=Symbol("meshTextureContext");function h(e){return e&&"object"==typeof e&&c in e?e[c]:void 0}function u(e){const t=h(e);if(t?.textureMap)return e;const i={textureMap:new Map};return{...e,[c]:i}}},22141(e,t,i){i.d(t,{$5:()=>w,CN:()=>x,JP:()=>y,KM:()=>T,Mv:()=>R,X4:()=>_,gr:()=>S,qs:()=>C,si:()=>b,xA:()=>A});var r=i(34727),n=i(77690),s=i(29242),o=i(58083),a=i(9093),l=i(35522),c=i(51850),h=i(73941),u=i(48353),d=i(9762),p=(i(79258),i(21325)),g=i(28735),f=i(13030),m=i(73354),v=i(50867);const y="Projection may be possible after calling projection.load().";function x(e,t,i,r){e.error(`Failed to project from (wkid:${t.wkid}) to (wkid:${i.wkid}).${r?" ":""}${r}`)}function _(e,t,i,r,n,s){return O(0,f.xs.fromTypedArray(e),0,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s))?s:null}function b(e,t,i,r,n,s){return O(1,f.xs.fromTypedArray(e),0,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s))?s:null}function S(e,t,i,r){return(0,d.projectBuffer)(e,t,0,i,r,0)?i:null}function w(e,t,i,r){return(0,d.projectBuffer)(e,t,0,i,r,0)?i:null}function C(e,t,i){return(0,n.Ge)(D,i),(0,m.t)(t,e,D),(0,r.or)(D)&&(0,m.n)(t,t),t}function T(e,t,i){return(0,n.z0)(D,i),(0,v.t)(t,e,D),(0,r.or)(D)&&(0,m.n)(t,t,4),t}function A(e,t,i,r,n,s){if(!O(0,f.xs.fromTypedArray(e,4*Float32Array.BYTES_PER_ELEMENT),1,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(let t=3;t<e.length;t+=4)s[t]=e[t];return s}function R(e,t,i,r,n,s){if(!O(1,f.xs.fromTypedArray(e,16),1,f.Xm.fromTypedArray(t),i,f.Xm.fromTypedArray(r),n,f.xs.fromTypedArray(s,16)))return null;for(let t=3;t<e.length;t+=4)s[t]=e[t];return s}function E(e,t,i,r,s){switch((0,u.l)(r,i,P,r),1===e&&(0,o.B8)(P,P),t){case 0:return(0,n.Ge)(s,P);case 1:return(0,n.z0)(s,P)}}function O(e,t,i,r,n,s,o,a){if(!t)return;const c=r.count;if(function(e){return e.isWGS84||(0,p.x1)(e)||(0,h.q8)(e)||(0,h.KQ)(e)}(n))for(let r=0;r<c;r++)s.getVec(r,M),t.getVec(r,L),(0,l.ei)(L,L,E(e,i,M,o,D)),a.setVec(r,L);else for(let n=0;n<c;n++){s.getVec(n,M),t.getVec(n,L);const c=(0,g.jg)(r.get(n,1));let h=Math.cos(c);1===i!=(0===e)&&(h=1/h),E(e,i,M,o,D),0===e?(D[0]*=h,D[1]*=h,D[2]*=h,D[3]*=h,D[4]*=h,D[5]*=h):(D[0]*=h,D[3]*=h,D[6]*=h,D[1]*=h,D[4]*=h,D[7]*=h),(0,l.ei)(L,L,D),(0,l.S8)(L,L),a.setVec(n,L)}return a}const M=(0,c.vt)(),L=(0,c.vt)(),P=(0,a.vt)(),D=(0,s.vt)()},72258(e,t,i){i.d(t,{UR:()=>b,p5:()=>_,xK:()=>R});var r=i(53966),n=i(34727),s=i(86211),o=i(77690),a=i(29242),l=i(58083),c=i(9093),h=i(35522),u=i(51850),d=i(73941),p=i(98764),g=i(48353),f=i(65806),m=i(27615),v=i(73354),y=i(22141);const x=()=>r.A.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function _(e,t,{vertexSpace:i,spatialReference:r}){if("georeferenced"===i.type){const n=e;if(!(0,f.g)(t,n,r))return!1;const{origin:s}=i;return(0,h.Re)(e,n,s),!0}const n=(0,p.lO)(r),s=e;if(!(0,f.g)(t,s,n))return!1;const{origin:o}=i,a=P;if(!(0,g.l)(r,o,a,n))return!1;const c=(0,l.B8)(P,a);return null!=c&&((0,h.Z0)(e,s,c),!0)}function b(e,t,i){const{vertexSpace:r,transform:n,vertexAttributes:s}=e,a=(0,m.Hq)(r)?n:null,u=T(e.spatialReference,i,3);if((0,m.yJ)(r,t)&&(!a||(0,l.t2)(a.localMatrix,c.zK))&&A(u)){const{position:e,normal:t,tangent:r}=s,n=i?.allowBufferReuse;return{position:n?e:e.slice(),normal:n?t:t?.slice(),tangent:n?r:r?.slice()}}switch(e.vertexSpace.type){case"local":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:i},{origin:r},n,s){const o=S(t,s);if(!(0,g.l)(t,r,E,o))return(0,y.CN)(x(),t,o),null;if(i&&(0,l.lw)(E,E,i.localMatrix),!(0,g.l)(t,n,O,o))return(0,y.CN)(x(),o,t),null;(0,l.B8)(O,O);const a=(0,l.lw)(E,O,E);return C(a,t,s,3),w(e,a)}(e,e.vertexSpace,t.origin,i):function({spatialReference:e,vertexAttributes:t,transform:i},{origin:r},n,s){const o=S(e,s);if(!(0,g.l)(e,r,E,o))return(0,y.CN)(x(),e,o),null;i&&(0,l.lw)(E,E,i.localMatrix),C(E,e,s,1);const a=new Float64Array(t.position.length),c=function(e,t,i,r,n){(0,v.f)(r,e,t);const s=new Float64Array(e.length);return(0,y.$5)(r,n,s,i)?s:((0,y.CN)(x(),n,i),null)}(t.position,E,e,a,o);if(!c)return null;const u=function(e,t,i,r,n,s){if(null==n)return null;const o=new Float32Array(n.length);return(0,y.qs)(n,o,s),(0,y.si)(o,e,t,i,r,o)?o:((0,y.CN)(x(),r,t),null)}(c,e,a,o,t.normal,E);if(t.normal&&!u)return null;const d=function(e,t,i,r,n,s){if(null==n)return null;const o=new Float32Array(n.length);return(0,y.KM)(n,o,s),(0,y.Mv)(o,e,t,i,r,o)?o:((0,y.CN)(x(),r,t),null)}(c,e,a,o,t.tangent,E);if(t.tangent&&!d)return null;if(n){const e=(0,h.ze)(L,n);(0,v.h)(c,c,e)}return{position:c,normal:u,tangent:d}}(e,e.vertexSpace,t.origin,i);case"georeferenced":return"local"===t.type?function({vertexAttributes:e,spatialReference:t,transform:i},{origin:r},n,s){const a=S(t,s);if(!(0,g.l)(t,n,E,a))return(0,y.CN)(x(),t,a),null;const c=1/T(t,s,2);(0,l.hs)(E,E,[c,c,c]);const h=(0,l.B8)(O,E),{position:u,normal:d,tangent:p}=function(e,t,i){if(!t)return e;if(!i){const{position:i,normal:r,tangent:n}=e;return{position:(0,v.h)(new Float64Array(i.length),i,t),tangent:n,normal:r}}const r=w(e,i.localMatrix);return(0,v.h)(r.position,r.position,t),r}(e,r,i),f=new Float64Array(u.length),m=function(e,t,i,r,n){const s=(0,y.gr)(e,t,r,n);if(!s)return(0,y.CN)(x(),t,n),null;const o=new Float64Array(s.length);return(0,v.f)(o,s,i),o}(u,t,h,f,a);if(!m)return null;const _=(0,o.Ge)(M,h),b=function(e,t,i,r,n,s,o){if(null==e)return null;const a=o??new Float32Array(e.length);return(0,y.X4)(e,t,i,r,n,a)?((0,v.t)(a,a,s),a):((0,y.CN)(x(),i,n),null)}(d,u,t,f,a,_,d!==e.normal?d:void 0);if(!b&&d)return null;const C=function(e,t,i,r,n,s,o){if(null==e)return null;const a=o??new Float32Array(e.length);return(0,y.xA)(e,t,i,r,n,a)?((0,v.t)(a,a,s,4),a):((0,y.CN)(x(),i,n),null)}(p,u,t,f,a,_,p!==e.tangent?p:void 0);return!C&&p?null:{position:m,normal:b,tangent:C}}(e,e.vertexSpace,t.origin,i):function({vertexAttributes:e,transform:t,spatialReference:i},{origin:r},n,s){const o=T(i,s,3),a=r||!A(o)?(0,l.C)(E,t?.localMatrix??c.zK):null;a&&C(a,i,s,3);const{position:u,normal:d,tangent:p}=a?w(e,a):e,g=s?.allowBufferReuse,f=g?u:new Float64Array(u.length);let m=u;if(r&&(m=(0,v.h)(f,m,r)),n){const e=(0,h.ze)(L,n);m=(0,v.h)(f,m,e)}return{position:m!==e.position||g?m:m.slice(),normal:d!==e.normal||g?d:d?.slice(),tangent:p!==e.tangent||g?p:p?.slice()}}(e,e.vertexSpace,t.origin,i)}}function S(e,t){return t?.useEllipsoid&&(0,d.B3)(e)?p.Y0:(0,p.lO)(e)}function w(e,t){const i=new Float64Array(e.position.length);(0,v.f)(i,e.position,t);const r=e.normal?new Float32Array(e.normal.length):null,n=e.tangent?new Float32Array(e.tangent.length):null;return r&&e.normal&&(0,y.qs)(e.normal,r,t),n&&e.tangent&&(0,y.KM)(e.tangent,n,t),{position:i,normal:r,tangent:n}}function C(e,t,i,r){const n=T(t,i,r);A(n)||(0,l.hs)(e,e,[n,n,n])}function T(e,t,i){const r=!!(1&i),n=!!(2&i),s=t?.sourceUnit,o=t?.targetUnit;if(!s&&!o)return 1;let a=R(s,e);r||!s||A(a)||(x().warn("source unit conversion not supported"),a=1);let l=1/R(o,e);return n||!o||A(l)||(x().warn("target unit conversion not supported"),l=1),a*l}function A(e){return(0,n.Io)(e,1)}function R(e,t){if(null==e)return 1;const i=(0,s.KX)(t);return 1/(0,s.oU)(i,"meters",e)}const E=(0,c.vt)(),O=(0,c.vt)(),M=(0,a.vt)(),L=(0,u.vt)(),P=(0,c.vt)()},27615(e,t,i){i.d(t,{CK:()=>l,Hq:()=>a,MW:()=>c,TE:()=>h,yJ:()=>u});var r=i(35522),n=i(86738),s=i(95696),o=i(18251);function a(e){return null!=e.origin}function l(e){return a(e.vertexSpace)}function c(e,t){if(!a(e))return null;const[i,r,s]=e.origin;return new n.A({x:i,y:r,z:s,spatialReference:t})}function h(e,t){const{x:i,y:r,z:n,spatialReference:a}=e,l=[i,r,n??0];return"local"===(t?.vertexSpace??function(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}(a))?new o.default({origin:l}):new s.A({origin:l})}function u(e,t){return e.type===t.type&&(e.origin===t.origin||null!=e.origin&&null!=t.origin&&(0,r.t2)(e.origin,t.origin))}},6733(e,t,i){i.d(t,{Q:()=>u});var r=i(37585),n=i(48163),s=i(31821),o=i(74333);class a extends o.n{constructor(e,t){super(e,"ivec2",1,(i,r,n)=>i.setUniform2iv(e,t(r,n)))}}var l=i(93588),c=i(9273),h=i(34053);function u(e){const{vertex:t}=e;t.uniforms.add(new c.R("coverageTexture",e=>e.coverageTexture),new a("highlightRenderCellCount",e=>(0,r.hZ)(d,e.horizontalCellCount,e.verticalCellCount)),new a("highlightTextureResolution",({highlightTexture:e})=>(0,r.hZ)(d,e.descriptor.width,e.descriptor.height)),new l.c("highlightLevel",e=>e.highlightLevel)).constants.add("cellSize","int",h.g),e.varyings.add("sUV","vec2"),e.varyings.add("vOutlinePossible","float"),t.code.add(s.H`const ivec2 cellVertices[4] = ivec2[4](ivec2(0,0), ivec2(1,0), ivec2(0,1), ivec2(1,1));`),t.main.add(s.H`int cellIndex = gl_InstanceID;
394
+ int cellX = cellIndex % highlightRenderCellCount[0];
395
+ int cellY = (cellIndex - cellX) / highlightRenderCellCount[0];
396
+ ivec2 cellPos = ivec2(cellX, cellY);
397
+ uvec2 covTexel = texelFetch(coverageTexture, cellPos, 0).rg;
398
+ int channelIndex = (highlightLevel >> 2) & 3;
399
+ uint channelValue = covTexel[channelIndex];
400
+ int highlightIndex = (highlightLevel & 3) << 1;
401
+ bool covered = ((channelValue >> highlightIndex) & 1u) == 1u;
402
+ if (!covered) {
403
+ gl_Position = vec4(0.0);
404
+ return;
405
+ }
406
+ vOutlinePossible = (((channelValue >> highlightIndex) & 2u) == 2u) ? 1.0 : 0.0;
407
+ ivec2 iPosInCell = cellVertices[gl_VertexID];
408
+ vec2 sPos = vec2(cellPos * cellSize + iPosInCell * (cellSize));
409
+ vec2 vPos = sPos / vec2(highlightTextureResolution);
410
+ sUV = vPos;
411
+ gl_Position = vec4(2.0 * vPos - vec2(1.0), 0.0, 1.0);`)}const d=(0,n.vt)()},84652(e,t,i){i.d(t,{s:()=>p});var r=i(58083),n=i(9093),s=i(43259),o=i(52587),a=i(77949),l=i(33079),c=i(20304),h=i(44887),u=i(31821),d=i(97102);function p(e,t){const{vertex:i,attributes:n}=e;i.uniforms.add(new c.m("intrinsicWidth",e=>e.width));const{hasScreenSizePerspective:p,spherical:f}=t;p?(e.include(o.Y6,t),(0,o.pM)(i),(0,a.yu)(i,t),i.uniforms.add(new d.S("inverseViewMatrix",(e,t)=>(0,r.B8)(g,(0,r.Tl)(g,t.camera.viewMatrix,e.origin)))),i.code.add(u.H`
412
+ float applyLineSizeScreenSizePerspective(float size, vec3 pos) {
413
+ vec3 worldPos = (inverseViewMatrix * vec4(pos, 1)).xyz;
414
+ vec3 groundUp = ${f?u.H`normalize(worldPos + localOrigin)`:u.H`vec3(0.0, 0.0, 1.0)`};
415
+ float absCosAngle = abs(dot(groundUp, normalize(worldPos - cameraPosition)));
416
+
417
+ return screenSizePerspectiveScaleFloat(size, absCosAngle, length(pos), screenSizePerspective);
418
+ }
419
+ `)):i.code.add(u.H`float applyLineSizeScreenSizePerspective(float size, vec3 pos) {
420
+ return size;
421
+ }`),t.hasVVSize?(n.add("sizeFeatureAttribute","float"),i.uniforms.add(new l.t("vvSizeMinSize",e=>e.vvSize.minSize),new l.t("vvSizeMaxSize",e=>e.vvSize.maxSize),new l.t("vvSizeOffset",e=>e.vvSize.offset),new l.t("vvSizeFactor",e=>e.vvSize.factor),new l.t("vvSizeFallback",e=>e.vvSize.fallback)),i.code.add(u.H`
422
+ float getSize(${(0,u.If)(p,"vec3 pos")}) {
423
+ float size = isnan(sizeFeatureAttribute)
424
+ ? vvSizeFallback.x
425
+ : intrinsicWidth * clamp(vvSizeOffset + sizeFeatureAttribute * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).x;
426
+
427
+ return ${(0,u.If)(p,"applyLineSizeScreenSizePerspective(size, pos)","size")};
428
+ }
429
+ `)):(n.add("size","float"),i.code.add(u.H`
430
+ float getSize(${(0,u.If)(p,"vec3 pos")}) {
431
+ float fullSize = intrinsicWidth * size;
432
+ return ${(0,u.If)(p,"applyLineSizeScreenSizePerspective(fullSize, pos)","fullSize")};
433
+ }
434
+ `)),t.hasVVOpacity?(n.add("opacityFeatureAttribute","float"),i.constants.add("vvOpacityNumber","int",8),i.uniforms.add(new h.x("vvOpacityValues",8,e=>e.vvOpacity.values),new h.x("vvOpacityOpacities",8,e=>e.vvOpacity.opacityValues),new c.m("vvOpacityFallback",e=>e.vvOpacity.fallback,{supportsNaN:!0})),i.code.add(u.H`
435
+ float interpolateOpacity(float value) {
436
+ if (value <= vvOpacityValues[0]) {
437
+ return vvOpacityOpacities[0];
438
+ }
439
+
440
+ for (int i = 1; i < vvOpacityNumber; ++i) {
441
+ if (vvOpacityValues[i] >= value) {
442
+ float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]);
443
+ return mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f);
444
+ }
445
+ }
446
+
447
+ return vvOpacityOpacities[vvOpacityNumber - 1];
448
+ }
449
+
450
+ vec4 applyOpacity(vec4 color) {
451
+ if (isnan(opacityFeatureAttribute)) {
452
+ // If there is a color vv then it will already have taken care of applying the fallback
453
+ return ${(0,u.If)(t.hasVVColor,"color","vec4(color.rgb, vvOpacityFallback)")};
454
+ }
455
+
456
+ return vec4(color.rgb, interpolateOpacity(opacityFeatureAttribute));
457
+ }
458
+ `)):i.code.add(u.H`vec4 applyOpacity(vec4 color) {
459
+ return color;
460
+ }`),t.hasVVColor?(e.include(s.A,t),n.add("colorFeatureAttribute","float"),i.code.add(u.H`vec4 getColor() {
461
+ vec4 color = interpolateVVColor(colorFeatureAttribute);
462
+ if (isnan(color.r)) {
463
+ return vec4(0);
464
+ }
465
+ return applyOpacity(color);
466
+ }`)):(n.add("color","vec4"),i.code.add(u.H`vec4 getColor() {
467
+ return applyOpacity(color);
468
+ }`))}const g=(0,n.vt)()},2923(e,t,i){i.d(t,{q:()=>m,h:()=>v});var r=i(27950),n=i(66269),s=i(77949),o=i(71988),a=i(33094),l=i(20304),c=i(31821),h=i(63761),u=i(96095);function d(e){if(null==e)return 1;const t=function(e){return e.pattern.map(t=>Math.round(t*e.pixelRatio))}(e);return Math.floor(t.reduce((e,t)=>e+t))}i(63907),i(21231),i(67171);var p=i(78955),g=i(91829);const f=(0,g.vt)();function m(e,t){if(!t.stippleEnabled)return void e.fragment.code.add(c.H`float getStippleAlpha(float lineWidth) { return 1.0; }
469
+ void discardByStippleAlpha(float stippleAlpha, float threshold) {}
470
+ vec4 blendStipple(vec4 color, float stippleAlpha) { return color; }`);const i=!(t.draped&&t.stipplePreferContinuous),{vertex:u,fragment:d}=e;t.draped||((0,s.yu)(u,t),u.uniforms.add(new a.U("worldToScreenPerDistanceRatio",({camera:e})=>1/e.perScreenPixelRatio)).code.add(c.H`float computeWorldToScreenRatio(vec3 segmentCenter) {
471
+ float segmentDistanceToCamera = length(segmentCenter - cameraPosition);
472
+ return worldToScreenPerDistanceRatio / segmentDistanceToCamera;
473
+ }`)),e.varyings.add("vStippleDistance","float"),e.varyings.add("vStippleDistanceLimits","vec2"),e.varyings.add("vStipplePatternStretch","float"),u.code.add(c.H`
474
+ float discretizeWorldToScreenRatio(float worldToScreenRatio) {
475
+ float step = ${c.H.float(y)};
476
+
477
+ float discreteWorldToScreenRatio = log(worldToScreenRatio);
478
+ discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step;
479
+ discreteWorldToScreenRatio = exp(discreteWorldToScreenRatio);
480
+ return discreteWorldToScreenRatio;
481
+ }
482
+ `),(0,s.Nz)(u),u.code.add(c.H`
483
+ vec2 computeStippleDistanceLimits(float startPseudoScreen, float segmentLengthPseudoScreen, float segmentLengthScreen, float patternLength) {
484
+
485
+ // First check if the segment is long enough to support fully screen space patterns.
486
+ // Force sparse mode for segments that are very large in screen space even if it is not allowed,
487
+ // to avoid imprecision from calculating with large floats.
488
+ if (segmentLengthPseudoScreen >= ${i?"patternLength":"1e4"}) {
489
+ // Round the screen length to get an integer number of pattern repetitions (minimum 1).
490
+ float repetitions = segmentLengthScreen / (patternLength * pixelRatio);
491
+ float flooredRepetitions = max(1.0, floor(repetitions + 0.5));
492
+ float segmentLengthScreenRounded = flooredRepetitions * patternLength;
493
+
494
+ float stretch = repetitions / flooredRepetitions;
495
+
496
+ // We need to impose a lower bound on the stretch factor to prevent the dots from merging together when there is only 1 repetition.
497
+ // 0.75 is the lowest possible stretch value for flooredRepetitions > 1, so it makes sense as lower bound.
498
+ vStipplePatternStretch = max(0.75, stretch);
499
+
500
+ return vec2(0.0, segmentLengthScreenRounded);
501
+ }
502
+ return vec2(startPseudoScreen, startPseudoScreen + segmentLengthPseudoScreen);
503
+ }
504
+ `),d.uniforms.add(new h.N("stipplePatternTexture",e=>e.stippleTexture),new l.m("stipplePatternPixelSizeInv",e=>1/v(e))),t.stippleOffColorEnabled&&d.uniforms.add(new o.E("stippleOffColor",e=>{return null==(t=e.stippleOffColor)?g.uY:4===t.length?t:(0,p.hZ)(f,t[0],t[1],t[2],1);var t})),e.include(n.m),t.worldSizedImagePattern?(e.varyings.add("vStippleV","float"),e.fragment.include(r.N),d.code.add(c.H`vec4 getStippleColor(out bool isClamped) {
505
+ vec2 aaCorrectedLimits = vStippleDistanceLimits + vec2(1.0, -1.0) / gl_FragCoord.w;
506
+ isClamped = vStippleDistance < aaCorrectedLimits.x || vStippleDistance > aaCorrectedLimits.y;
507
+ float u = vStippleDistance * stipplePatternPixelSizeInv;
508
+ float v = vStippleV == -1.0 ? 0.5 : vStippleV;
509
+ return texture(stipplePatternTexture, vec2(u, v));
510
+ }
511
+ vec4 getStippleColor() {
512
+ bool ignored;
513
+ return getStippleColor(ignored);
514
+ }
515
+ float getStippleSDF() {
516
+ vec4 color = getStippleColor();
517
+ return color.a == 0.0 ? -0.5 : 0.5;
518
+ }
519
+ float getStippleAlpha(float lineWidth) {
520
+ return getStippleColor().a;
521
+ }
522
+ vec4 blendStipple(vec4 color, float stippleAlpha) {
523
+ vec4 stippleColor = getStippleColor();
524
+ int mixMode = 1;
525
+ vec3 col = mixExternalColor(color.rgb, vec3(1.0), stippleColor.rgb, mixMode);
526
+ float opacity = mixExternalOpacity(color.a, 1.0, stippleColor.a, mixMode);
527
+ return vec4(col, opacity);
528
+ }`)):d.code.add(c.H`
529
+ float getStippleSDF(out bool isClamped) {
530
+ float stippleDistanceClamped = noPerspectiveRead(clamp(vStippleDistance, vStippleDistanceLimits.x, vStippleDistanceLimits.y));
531
+ float lineSizeInv = noPerspectiveRead(vLineSizeInv);
532
+
533
+ vec2 aaCorrectedLimits = vStippleDistanceLimits + vec2(1.0, -1.0) / gl_FragCoord.w;
534
+ isClamped = vStippleDistance < aaCorrectedLimits.x || vStippleDistance > aaCorrectedLimits.y;
535
+
536
+ float u = stippleDistanceClamped * stipplePatternPixelSizeInv * lineSizeInv;
537
+ u = fract(u);
538
+
539
+ float sdf = texture(stipplePatternTexture, vec2(u, 0.5)).r;
540
+
541
+ return (sdf - 0.5) * vStipplePatternStretch + 0.5;
542
+ }
543
+
544
+ float getStippleSDF() {
545
+ bool ignored;
546
+ return getStippleSDF(ignored);
547
+ }
548
+
549
+ float getStippleAlpha(float lineWidth) {
550
+ bool isClamped;
551
+ float stippleSDF = getStippleSDF(isClamped);
552
+ float antiAliasedResult = clamp(stippleSDF * lineWidth + 0.5, 0.0, 1.0);
553
+ return isClamped ? floor(antiAliasedResult + 0.5) : antiAliasedResult;
554
+ }
555
+
556
+ vec4 blendStipple(vec4 color, float stippleAlpha) {
557
+ return ${t.stippleOffColorEnabled?"mix(color, stippleOffColor, stippleAlpha)":"vec4(color.rgb, color.a * stippleAlpha)"};
558
+ }
559
+ `),d.code.add(c.H`
560
+ void discardByStippleAlpha(float stippleAlpha, float threshold) {
561
+ ${(0,c.If)(!t.stippleOffColorEnabled,"if (stippleAlpha < threshold) { discard; }")}
562
+ }
563
+ `)}function v(e){const t=e.stipplePattern;return(0,u.sL)(t)?t.length:t?d(t)/t.pixelRatio:1}const y=.4},28974(e,t,i){i.d(t,{r:()=>a});var r=i(91829);i(18845),i(63907);(0,r.CN)(.25,.25,.75,.75),i(21231),i(67171);var n=i(77949),s=i(33094),o=i(31821);function a(e,t){const i=e.vertex,r=t.hasScreenSizePerspective;(0,n.Nz)(i),null==i.uniforms.get("markerScale")&&i.constants.add("markerScale","float",1),i.constants.add("markerSizePerLineWidth","float",10).code.add(o.H`
564
+ float getLineWidth(${(0,o.If)(r,"vec3 pos")}) {
565
+ return max(getSize(${(0,o.If)(r,"pos")}), 1.0) * pixelRatio;
566
+ }
567
+
568
+ float getScreenMarkerSize(float lineWidth) {
569
+ return markerScale * markerSizePerLineWidth * lineWidth;
570
+ }
571
+ `),2===t.space&&(i.constants.add("maxSegmentLengthFraction","float",.45),i.uniforms.add(new s.U("perRenderPixelRatio",e=>e.camera.perRenderPixelRatio)),i.code.add(o.H`
572
+ bool areWorldMarkersHidden(vec3 pos, vec3 other) {
573
+ vec3 midPoint = mix(pos, other, 0.5);
574
+ float distanceToCamera = length(midPoint);
575
+ float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
576
+ float worldMarkerSize = getScreenMarkerSize(getLineWidth(${(0,o.If)(r,"pos")})) * screenToWorldRatio;
577
+ float segmentLen = length(pos - other);
578
+ return worldMarkerSize > maxSegmentLengthFraction * segmentLen;
579
+ }
580
+
581
+ float getWorldMarkerSize(vec3 pos) {
582
+ float distanceToCamera = length(pos);
583
+ float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
584
+ return getScreenMarkerSize(getLineWidth(${(0,o.If)(r,"pos")})) * screenToWorldRatio;
585
+ }
586
+ `))}},82094(e,t,i){i.d(t,{Z:()=>r});const r=i(31821).H`vec4(0.0, 0.0, 2.0, 1.0)`},66269(e,t,i){function r(e){e.vertex.code.add("#define noPerspectiveWrite(x, w) (x * w)")}function n(e){e.fragment.code.add("#define noPerspectiveRead(x) (x * gl_FragCoord.w)")}i.d(t,{F:()=>r,m:()=>n})},9273(e,t,i){i.d(t,{R:()=>n});var r=i(74333);class n extends r.n{constructor(e,t){super(e,"usampler2D",1,(i,r,n)=>i.bindTexture(e,t(r,n)))}}},78230(e,t,i){i.d(t,{x:()=>u});var r=i(93687),n=i(15142),s=i(35522),o=i(51850),a=i(82919),l=i(71351),c=i(94008),h=i(620);class u{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(e,t){this.objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new d,this._objectCount=0,t&&(void 0!==t.maximumObjectsPerNode&&(this._maximumObjectsPerNode=t.maximumObjectsPerNode),void 0!==t.maximumDepth&&(this._maximumDepth=t.maximumDepth))}destroy(){this._degenerateObjects.clear(),d.clearPool(),E[0]=null,D.prune(),W.prune()}add(e){const t=Array.from(e);this._grow(t);const i=d.acquire();for(const e of t)++this._objectCount,this._isDegenerate(e)?this._degenerateObjects.add(e):(i.init(this._root),this._add(e,i));d.release(i)}remove(e,t=null){this._objectCount-=e.length;const i=d.acquire();for(const r of e){const e=t??this.objectToBoundingSphere(r);C(e.radius)?(i.init(this._root),f(r,e,i)):this._degenerateObjects.delete(r)}d.release(i),this._shrink()}update(e,t){if(!C(t.radius)&&this._isDegenerate(e))return;const i=function(e){return E[0]=e,E}(e);this.remove(i,t),this.add(i)}forEachAlongRay(e,t,i){const r=(0,l.LV)(e,t);p(this._root,e=>{if(!function(e,t){return _(t.bounds.center,2*-t.halfSize,L),_(t.bounds.center,2*t.halfSize,P),(0,h.O_)(e.origin,e.direction,L,P)}(r,e))return!1;const t=e.node;return t.terminals.forAll(e=>{this._intersectsObject(r,e)&&i(e)}),null!==t.residents&&t.residents.forAll(e=>{this._intersectsObject(r,e)&&i(e)}),!0})}forEachAlongRayWithVerticalOffset(e,t,i,r){const n=(0,l.LV)(e,t);p(this._root,e=>{if(!function(e,t,i){return _(t.bounds.center,2*-t.halfSize,L),_(t.bounds.center,2*t.halfSize,P),i.applyToMinMax(L,P),(0,h.O_)(e.origin,e.direction,L,P)}(n,e,r))return!1;const t=e.node;return t.terminals.forAll(e=>{this._intersectsObjectWithOffset(n,e,r)&&i(e)}),null!==t.residents&&t.residents.forAll(e=>{this._intersectsObjectWithOffset(n,e,r)&&i(e)}),!0})}forEach(e){p(this._root,t=>{const i=t.node;return i.terminals.forAll(e),null!==i.residents&&i.residents.forAll(e),!0}),this._degenerateObjects.forEach(e)}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}findClosest(e,t,i,r=()=>!0,n=1/0){let o=1/0,l=1/0,c=null;const h=S(e,t),u=s=>{if(--n,!r(s))return;const h=this.objectToBoundingSphere(s);if(!(0,a.m7)(i,h))return;const u=w(e,t,h.center),d=u-h.radius,p=u+h.radius;d<o&&(o=d,l=p,c=s)};return g(this._root,r=>{if(n<=0||!(0,a.m7)(i,r.bounds))return!1;if((0,s.hs)(M,h,r.halfSize),(0,s.WQ)(M,M,r.bounds.center),w(e,t,M)>l)return!1;const o=r.node;return o.terminals.forAll(e=>u(e)),null!==o.residents&&o.residents.forAll(e=>u(e)),!0},e,t),c}forEachInDepthRange(e,t,i,r,n,o,l){let c=-1/0,h=1/0;const u={setRange:e=>{1===i?(c=Math.max(c,e.near),h=Math.min(h,e.far)):(c=Math.max(c,-e.far),h=Math.min(h,-e.near))}};u.setRange(r);const d=w(t,i,e),p=S(t,i),f=S(t,-i),m=e=>{if(!l(e))return;const r=this.objectToBoundingSphere(e),s=w(t,i,r.center)-d,p=s-r.radius,g=s+r.radius;p>h||g<c||!(0,a.m7)(o,r)||n(e,u)};g(this._root,e=>{if(!(0,a.m7)(o,e.bounds))return!1;if((0,s.hs)(M,p,e.halfSize),(0,s.WQ)(M,M,e.bounds.center),w(t,i,M)-d>h)return!1;if((0,s.hs)(M,f,e.halfSize),(0,s.WQ)(M,M,e.bounds.center),w(t,i,M)-d<c)return!1;const r=e.node;return r.terminals.forAll(e=>m(e)),null!==r.residents&&r.residents.forAll(e=>m(e)),!0},t,i)}forEachNode(e){p(this._root,t=>e(t.node,t.bounds,t.halfSize,t.depth))}forEachNeighbor(e,t){const i=t.radius,r=t.center,n=t=>{const n=this.objectToBoundingSphere(t),o=n.radius,a=i+o;return!((0,s.hG)(n.center,r)-a*a<=0)||e(t)};let o=!0;const a=e=>{o&&(o=n(e))};p(this._root,e=>{const t=e.bounds.radius,n=i+t;if((0,s.hG)(e.bounds.center,r)-n*n>0)return!1;const l=e.node;return l.terminals.forAll(a),o&&null!==l.residents&&l.residents.forAll(a),o}),o&&this.forEachDegenerateObject(a)}_intersectsObject(e,t){const i=this.objectToBoundingSphere(t);return!(i.radius>0)||i.intersectRay(e)}_intersectsObjectWithOffset(e,t,i){const r=this.objectToBoundingSphere(t);return!(r.radius>0)||i.applyToBoundingSphere(r).intersectRay(e)}_add(e,t){t.advanceTo(this.objectToBoundingSphere(e))?t.node.terminals.push(e):(t.node.residents.push(e),t.node.residents.length>this._maximumObjectsPerNode&&t.depth<this._maximumDepth&&this._split(t))}_split(e){const t=e.node.residents;e.node.residents=null;for(let i=0;i<t.length;i++){const r=d.acquire().init(e);this._add(t.at(i),r),d.release(r)}}_grow(e){if(b(e,e=>this.objectToBoundingSphere(e),I),C(I.radius)&&!this._fitsInsideTree(I))if(v(this._root.node))this._root.bounds.copyFrom(I),this._root.halfSize=1.25*this._root.bounds.radius,this._root.updateBoundsRadiusFromHalfSize();else{const e=this._rootBoundsForRootAsSubNode(I);this._placingRootViolatesMaxDepth(e)?this._rebuildTree(I,e):this._growRootAsSubNode(e),d.release(e)}}_rebuildTree(e,t){F.center=t.bounds.center,F.radius=t.halfSize,b([e,F],e=>e,z);const i=d.acquire().init(this._root);this._root.initFrom(null,z,z.radius),this._root.increaseHalfSize(1.25),p(i,e=>(this.add(e.node.terminals.data),null!==e.node.residents&&this.add(e.node.residents.data),!0)),d.release(i)}_placingRootViolatesMaxDepth(e){const t=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let i=0;return p(this._root,e=>(i=Math.max(i,e.depth),i+t<=this._maximumDepth)),i+t>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const t=e.radius,i=e.center;let r=-1/0;const n=this._root.bounds.center,s=this._root.halfSize;for(let e=0;e<3;e++){const o=n[e]-s-(i[e]-t),a=i[e]+t-(n[e]+s),l=Math.max(0,Math.ceil(o/(2*s))),c=Math.max(0,Math.ceil(a/(2*s)))+1,h=2**Math.ceil(Math.log(l+c)*Math.LOG2E);r=Math.max(r,h),N[e].min=l,N[e].max=c}for(let e=0;e<3;e++){let t=N[e].min,i=N[e].max;const o=(r-(t+i))/2;t+=Math.ceil(o),i+=Math.floor(o);const a=n[e]-s-t*s*2;O.center[e]=a+(i+t)*s}const o=r*s;return O.radius=o*R,d.acquire().initFrom(null,O,o,0)}_growRootAsSubNode(e){const t=this._root.node;I.center=this._root.bounds.center,I.radius=this._root.halfSize,this._root.init(e),e.advanceTo(I,null,!0),e.node.children=t.children,e.node.residents=t.residents,e.node.terminals=t.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(-1===e)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let e=null;const t=this._root.node.children;let i=0,r=0;for(;r<t.length&&null==e;)i=r++,e=t[i];for(;r<t.length;)if(t[r++])return-1;return i}_isDegenerate(e){return!C(this.objectToBoundingSphere(e).radius)}_fitsInsideTree(e){const t=this._root.bounds,i=this._root.halfSize;return e.radius<=i&&e.center[0]>=t.center[0]-i&&e.center[0]<=t.center[0]+i&&e.center[1]>=t.center[1]-i&&e.center[1]<=t.center[1]+i&&e.center[2]>=t.center[2]-i&&e.center[2]<=t.center[2]+i}_nodeToJSON(e){const t=e.children.map(e=>e?this._nodeToJSON(e):null),i=e.residents?.map(e=>this.objectToBoundingSphere(e)),r=e.terminals?.map(e=>this.objectToBoundingSphere(e));return{children:t,residents:i,terminals:r}}}class d{constructor(){this.bounds=new c.iy,this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(e,t,i,r=this.depth){return this.node=null!=e?e:d.createEmptyNode(),t&&this.bounds.copyFrom(t),this.halfSize=i,this.depth=r,this}increaseHalfSize(e){this.halfSize*=e,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds.radius=this.halfSize*R}advance(e){let t=this.node.children[e];t||(t=d.createEmptyNode(),this.node.children[e]=t),this.node=t,this.halfSize/=2,this.depth++;const i=T[e];return this.bounds.center[0]+=i[0]*this.halfSize,this.bounds.center[1]+=i[1]*this.halfSize,this.bounds.center[2]+=i[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(e,t,i=!1){for(;;){if(this.isTerminalFor(e))return t?.(this,-1),!0;if(this.isLeaf()){if(!i)return t?.(this,-1),!1;this.node.residents=null}const r=this._childIndex(e);t?.(this,r),this.advance(r)}}isLeaf(){return null!=this.node.residents}isTerminalFor(e){return e.radius>this.halfSize/2}_childIndex(e){const t=this.bounds.center;return(t[0]<e.center[0]?1:0)+(t[1]<e.center[1]?2:0)+(t[2]<e.center[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new n.A({shrink:!0}),residents:new n.A({shrink:!0})}}static{this._pool=new r.A(()=>new d)}static acquire(){return d._pool.acquire()}static release(e){d._pool.release(e)}static clearPool(){d._pool.prune()}}function p(e,t){let i=d.acquire().init(e);const r=[i];for(;0!==r.length;){if(i=r.pop(),t(i)&&!i.isLeaf())for(let e=0;e<i.node.children.length;e++)i.node.children[e]&&r.push(d.acquire().init(i).advance(e));d.release(i)}}function g(e,t,i,r=1){let n=d.acquire().init(e);const s=[n];for(function(e,t,i){if(!W.length)for(let e=0;e<8;++e)W.push({index:0,distance:0});for(let i=0;i<8;++i){const r=T[i];W.data[i].index=i,W.data[i].distance=w(e,t,r)}W.sort((e,t)=>e.distance-t.distance);for(let e=0;e<8;++e)i[e]=W.data[e].index}(i,r,V);0!==s.length;){if(n=s.pop(),t(n)&&!n.isLeaf())for(let e=7;e>=0;--e){const t=V[e];n.node.children[t]&&s.push(d.acquire().init(n).advance(t))}d.release(n)}}function f(e,t,i){D.clear();const r=i.advanceTo(t,(e,t)=>{D.push(e.node),D.push(t)})?i.node.terminals:i.node.residents;if(r.removeUnordered(e),0===r.length)for(let e=D.length-2;e>=0&&m(D.data[e],D.data[e+1]);e-=2);}function m(e,t){return t>=0&&(e.children[t]=null),!!v(e)&&(null===e.residents&&(e.residents=new n.A({shrink:!0})),!0)}function v(e){if(0!==e.terminals.length)return!1;if(null!==e.residents)return 0===e.residents.length;for(let t=0;t<e.children.length;t++)if(e.children[t])return!1;return!0}function y(e,t){e[0]=Math.min(e[0],t.center[0]-t.radius),e[1]=Math.min(e[1],t.center[1]-t.radius),e[2]=Math.min(e[2],t.center[2]-t.radius)}function x(e,t){e[0]=Math.max(e[0],t.center[0]+t.radius),e[1]=Math.max(e[1],t.center[1]+t.radius),e[2]=Math.max(e[2],t.center[2]+t.radius)}function _(e,t,i){i[0]=e[0]+t,i[1]=e[1]+t,i[2]=e[2]+t}function b(e,t,i){L[0]=1/0,L[1]=1/0,L[2]=1/0,P[0]=-1/0,P[1]=-1/0,P[2]=-1/0;for(const i of e){const e=t(i);C(e.radius)&&(y(L,e),x(P,e))}(0,s.Cc)(i.center,L,P,.5),i.radius=Math.max(P[0]-L[0],P[1]-L[1],P[2]-L[2])/2}function S(e,t){let i,r=1/0;for(let n=0;n<8;++n){const s=w(e,t,A[n]);s<r&&(r=s,i=A[n])}return i}function w(e,t,i){return t*(e[0]*i[0]+e[1]*i[1]+e[2]*i[2])}function C(e){return!isNaN(e)&&e!==-1/0&&e!==1/0&&e>0}const T=[(0,o.fA)(-1,-1,-1),(0,o.fA)(1,-1,-1),(0,o.fA)(-1,1,-1),(0,o.fA)(1,1,-1),(0,o.fA)(-1,-1,1),(0,o.fA)(1,-1,1),(0,o.fA)(-1,1,1),(0,o.fA)(1,1,1)],A=[(0,o.fA)(-1,-1,-1),(0,o.fA)(-1,-1,1),(0,o.fA)(-1,1,-1),(0,o.fA)(-1,1,1),(0,o.fA)(1,-1,-1),(0,o.fA)(1,-1,1),(0,o.fA)(1,1,-1),(0,o.fA)(1,1,1)],R=Math.sqrt(3),E=[null],O=new c.iy,M=(0,o.vt)(),L=(0,o.vt)(),P=(0,o.vt)(),D=new n.A,I=new c.iy,F=new c.iy,z=new c.iy,N=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],W=new n.A,V=[0,0,0,0,0,0,0,0]},96095(e,t,i){i.d(t,{sL:()=>r}),i(13069);function r(e){return null!=e&&"image"in e}},54073(e,t,i){i.d(t,{Q:()=>u});var r=i(37585),n=i(48163),s=i(78659);const o=(0,s.Kp)(1),a=(0,s.Kp)(1);var l=i(47286),c=i(20304),h=i(31821);function u(e,t){const{hasAnimation:i,animation:n}=t;if(!i)return;const{attributes:s,varyings:u,vertex:p,fragment:g}=e;s.add("timeStamps","vec4"),u.add("vTimeStamp","float"),u.add("vFirstTime","float"),u.add("vLastTime","float"),u.add("vTransitionType","float"),p.main.add(h.H`vTimeStamp = timeStamps.x;
587
+ vFirstTime = timeStamps.y;
588
+ vLastTime = timeStamps.z;
589
+ vTransitionType = timeStamps.w;`),3===n&&g.constants.add("decayRate","float",2.3),g.code.add(h.H`
590
+ float getTrailOpacity(float x) {
591
+ if (x < 0.0) {
592
+ return 0.0;
593
+ }
594
+
595
+ ${function(e){switch(e){case 2:return"return x >= 0.0 && x <= 1.0 ? 1.0 : 0.0;";case 3:return"float cutOff = exp(-decayRate);\n return (exp(-decayRate * x) - cutOff) / (1.0 - cutOff);";default:return"return 1.0;"}}(n)}
596
+ }`),g.uniforms.add(new c.m("timeElapsed",e=>e.timeElapsed),new c.m("trailLength",e=>e.trailLength),new c.m("speed",e=>e.animationSpeed),new l.G("startEndTime",e=>(0,r.hZ)(d,e.startTime,e.endTime))),g.constants.add("fadeInTime","float",a),g.constants.add("fadeOutTime","float",o),g.constants.add("incomingTransition","int",0),g.constants.add("outgoingTransition","int",2),g.code.add(h.H`float fadeIn(float x) {
597
+ return smoothstep(0.0, fadeInTime, x);
598
+ }
599
+ float fadeOut(float x) {
600
+ return isinf(fadeOutTime) ? 1.0 : smoothstep(fadeOutTime, 0.0, x);
601
+ }
602
+ void updateAlphaIf(inout float alpha, bool condition, float newAlpha) {
603
+ alpha = condition ? min(alpha, newAlpha) : alpha;
604
+ }
605
+ vec4 animate(vec4 color) {
606
+ float startTime = startEndTime[0];
607
+ float endTime = startEndTime[1];
608
+ float totalTime = vLastTime - vFirstTime;
609
+ float actualFadeOutTime = min(fadeOutTime * speed, trailLength);
610
+ float longStreamlineThreshold = (fadeInTime + 1.0) * speed + actualFadeOutTime;
611
+ bool longStreamline = totalTime > longStreamlineThreshold;
612
+ float totalTimeWithFadeOut = longStreamline && actualFadeOutTime != trailLength ? totalTime : totalTime + actualFadeOutTime;
613
+ float fadeOutStartTime = longStreamline ? totalTime - actualFadeOutTime : totalTime;
614
+ float originTime = -vFirstTime;
615
+ float actualEndTime = int(vTransitionType) == outgoingTransition ? min(endTime, startTime + vLastTime / speed) : endTime;
616
+ vec4 animatedColor = color;
617
+ if (speed == 0.0) {
618
+ float alpha = getTrailOpacity((totalTimeWithFadeOut - (vTimeStamp - vFirstTime)) / trailLength);
619
+ updateAlphaIf(alpha, !isinf(actualEndTime), fadeOut(timeElapsed - actualEndTime));
620
+ updateAlphaIf(alpha, true, fadeIn(timeElapsed - startTime));
621
+ animatedColor.a *= alpha;
622
+ return animatedColor;
623
+ }
624
+ float relativeStartTime = mod(startTime, totalTimeWithFadeOut);
625
+ float shiftedTimeElapsed = timeElapsed - relativeStartTime + originTime;
626
+ float headRelativeToFirst = mod(shiftedTimeElapsed * speed, totalTimeWithFadeOut);
627
+ float vRelativeToHead = headRelativeToFirst - originTime - vTimeStamp;
628
+ float vAbsoluteTime = timeElapsed - vRelativeToHead / speed;
629
+ if (startTime > timeElapsed) {
630
+ return vec4(0.0);
631
+ }
632
+ float alpha = getTrailOpacity(vRelativeToHead / trailLength);
633
+ updateAlphaIf(alpha, true, fadeIn(timeElapsed - startTime));
634
+ updateAlphaIf(alpha, !isinf(actualEndTime), fadeOut(timeElapsed - actualEndTime));
635
+ updateAlphaIf(alpha, int(vTransitionType) != incomingTransition, step(startTime, vAbsoluteTime));
636
+ updateAlphaIf(alpha, headRelativeToFirst > fadeOutStartTime, fadeOut((headRelativeToFirst - fadeOutStartTime) / speed));
637
+ alpha *= fadeIn(vTimeStamp - vFirstTime);
638
+ animatedColor.a *= alpha;
639
+ return animatedColor;
640
+ }`)}const d=(0,n.vt)()},92359(e,t,i){i.d(t,{nu:()=>u,W6:()=>c}),i(4576),i(71511),i(44208),i(53966);var r=i(17676),n=(i(36708),i(44794),i(78659)),s=i(5482),o=i(69622),a=i(91429);let l=class extends o.A{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,s.Cg)([(0,a.MZ)()],l.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,s.Cg)([(0,a.MZ)()],l.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),l=(0,s.Cg)([(0,a.$K)("esri.views.support.debugFlags")],l),new l,i(49186),Symbol("Yield");const c={RESOURCE_CONTROLLER_IMMEDIATE:"immediate",RESOURCE_CONTROLLER:"schedule",SLIDE:"slide",STREAM_DATA_LOADER:"stream loader",ELEVATION_QUERY:"elevation query",TERRAIN_SURFACE:"terrain",SURFACE_GEOMETRY_UPDATES:"surface geometry updates",LOD_RENDERER:"LoD renderer",GRAPHICS_CORE:"Graphics3D",I3S:"I3S",LYR3D:"Lyr3D",TILES3D:"3DTiles",POINT_CLOUD_LAYER:"point cloud",FEATURE_TILE_FETCHER:"feature fetcher",STREAM_CONTROLLER:"stream controller",OCCLUSION_QUERY:"occlusion query",OVERLAY:"overlay",OVERLAY_RENDERER:"overlay renderer",STAGE:"stage",GRAPHICS_DECONFLICTOR:"graphics deconflictor",FILTER_VISIBILITY:"graphics filter visibility",SCALE_VISIBILITY:"graphics scale visibility",FRUSTUM_VISIBILITY:"graphics frustum visibility",POINT_OF_INTEREST_FREQUENT:"POI frequent",POINT_OF_INTEREST_INFREQUENT:"POI infrequent",LABELER:"labeler",FEATURE_QUERY_ENGINE:"feature query",FEATURE_TILE_TREE:"feature tile tree",FEATURE_TILE_TREE_ACTIVE:"fast feature tile tree",ELEVATION_ALIGNMENT:"elevation alignment",ELEVATION_ALIGNMENT_SCENE:"elevation alignment scene",TEXT_TEXTURE_ATLAS:"text texture atlas",TEXTURE_UNLOAD:"texture unload",LINE_OF_SIGHT_TOOL:"line of sight tool",LINE_OF_SIGHT_TOOL_INTERACTIVE:"interactive line of sight tool",VOLUME_MEASUREMENT:"volume measurement",ELEVATION_PROFILE:"elevation profile",SNAPPING:"snapping",SHADOW_ACCUMULATOR:"shadow accumulator",CLOUDS_GENERATOR:"clouds generator",FLOW_GENERATOR:"flow generator",GAUSSIAN_SPLAT_SORTING:"gaussian splat sorting",GAUSSIAN_SPLAT_TEXTURE_ATLAS:"gaussian splat texture atlas",MAPVIEW_FETCH_QUEUE:"mapview fetch queue",MAPVIEW_LAYERVIEW_UPDATE:"mapview layerview update",MAPVIEW_VECTOR_TILE_PARSING_QUEUE:"mapview vector tile parsing queue",NONE:0,TEST_PRIO:1};new Map([[c.RESOURCE_CONTROLLER_IMMEDIATE,0],[c.RESOURCE_CONTROLLER,4],[c.SLIDE,0],[c.STREAM_DATA_LOADER,0],[c.ELEVATION_QUERY,0],[c.TERRAIN_SURFACE,1],[c.SURFACE_GEOMETRY_UPDATES,1],[c.LOD_RENDERER,2],[c.GRAPHICS_CORE,2],[c.I3S,2],[c.LYR3D,2],[c.TILES3D,3],[c.POINT_CLOUD_LAYER,2],[c.FEATURE_TILE_FETCHER,2],[c.STREAM_CONTROLLER,2],[c.CLOUDS_GENERATOR,2],[c.OCCLUSION_QUERY,2],[c.OVERLAY,4],[c.OVERLAY_RENDERER,4],[c.STAGE,4],[c.GRAPHICS_DECONFLICTOR,4],[c.FILTER_VISIBILITY,4],[c.SCALE_VISIBILITY,4],[c.FRUSTUM_VISIBILITY,4],[c.POINT_OF_INTEREST_FREQUENT,6],[c.POINT_OF_INTEREST_INFREQUENT,30],[c.LABELER,8],[c.FEATURE_QUERY_ENGINE,8],[c.FEATURE_TILE_TREE,16],[c.FEATURE_TILE_TREE_ACTIVE,0],[c.ELEVATION_ALIGNMENT,12],[c.ELEVATION_ALIGNMENT_SCENE,14],[c.TEXT_TEXTURE_ATLAS,12],[c.TEXTURE_UNLOAD,12],[c.LINE_OF_SIGHT_TOOL,16],[c.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[c.VOLUME_MEASUREMENT,4],[c.SNAPPING,0],[c.SHADOW_ACCUMULATOR,30],[c.FLOW_GENERATOR,12],[c.GAUSSIAN_SPLAT_SORTING,2],[c.GAUSSIAN_SPLAT_TEXTURE_ATLAS,12],[c.MAPVIEW_FETCH_QUEUE,0],[c.MAPVIEW_LAYERVIEW_UPDATE,2],[c.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,0]]),(0,n.l5)(6.5),(0,n.l5)(1),(0,n.l5)(30),(0,n.l5)(1e3/30),(0,n.l5)(100);const h=new class{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}};h.enabled=!1;const u=new class{remove(){}processQueue(){}schedule(e,t,i){try{if((0,r.G4)(t)){const e=(0,r.NK)();return i?Promise.resolve(i(e)):Promise.reject(e)}return(0,r.z7)(e(h))}catch(e){return Promise.reject(e)}}reschedule(e,t,i){return this.schedule(e,t,i)}async scheduleGenerator(e,t,i){if((0,r.G4)(t)){const e=(0,r.NK)();if(i)return i(e);throw e}const n=e(h);for(;;){const e=n.next(h),s=(0,r.$X)(e)?await e:e;if((0,r.G4)(t)){const e=(0,r.NK)();if(i){const t=i(e),s=n.return(null);return(0,r.$X)(s)&&await(0,r.QZ)(s),t}const t=n.throw(e);throw(0,r.$X)(t)&&await(0,r.QZ)(t),e}if(s.done)return s.value}}}}}]);