@arcgis/core 4.33.0-next.20250327 → 4.33.0-next.20250328

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 (185) hide show
  1. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +1 -0
  2. package/applications/KnowledgeStudio/layerInternalAccessUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/08ea652b7896c1da022d.js +1 -0
  5. package/assets/esri/core/workers/chunks/{66cae76da0582cfa8656.js → 0943695a1dcd21c45e83.js} +1 -1
  6. package/assets/esri/core/workers/chunks/09ca64184bed6abafcd9.js +1 -0
  7. package/assets/esri/core/workers/chunks/{c6bcfa99fb222894fa0e.js → 0a0e5d699ddb7052c5c0.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0a675f9f69b8b13b7443.js +1 -0
  9. package/assets/esri/core/workers/chunks/0eed612e82a279ac8d1e.js +1 -0
  10. package/assets/esri/core/workers/chunks/{cbe22c58b3230b12b31a.js → 13ad4ee2e064d13ca34d.js} +1 -1
  11. package/assets/esri/core/workers/chunks/176e7c7c2a871bcb512e.js +1 -0
  12. package/assets/esri/core/workers/chunks/18d0fe269531b951e309.js +1 -0
  13. package/assets/esri/core/workers/chunks/201db423e3c6f947b77c.js +1 -0
  14. package/assets/esri/core/workers/chunks/213e82a7e3fa5b253ec1.js +1 -0
  15. package/assets/esri/core/workers/chunks/{22618753349eb9d8b3df.js → 222446da9cb58c3c3b7e.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{0f37b3a797d8a55439a4.js → 277b61af8982092a4c81.js} +1 -1
  17. package/assets/esri/core/workers/chunks/2b07bdb6c4c4a5b2f968.js +1 -0
  18. package/assets/esri/core/workers/chunks/2bda2cfc6e81818d7d33.js +1 -0
  19. package/assets/esri/core/workers/chunks/2cbab0c078d0b844934c.js +1 -0
  20. package/assets/esri/core/workers/chunks/{a68b48fd1a529f69705e.js → 2fcfc21ba38d9919730a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{193b4fecdfee927d6200.js → 37e4f588a6896f98bce3.js} +1 -1
  22. package/assets/esri/core/workers/chunks/392e64a573f67817db02.js +1 -0
  23. package/assets/esri/core/workers/chunks/3a743653b786b010a57f.js +1 -0
  24. package/assets/esri/core/workers/chunks/3be007f32ea1e18b8b3b.js +1 -0
  25. package/assets/esri/core/workers/chunks/451555af283b32a10fef.js +1 -0
  26. package/assets/esri/core/workers/chunks/{835fa4484c58d9b31c78.js → 460afde071df9f35182d.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{26bedec014488e1fc5e4.js → 4816cf647eca2f4cecc2.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{09c9e4e94f09ba9f4c22.js → 4aa0a58ded4465ea28bd.js} +1 -1
  29. package/assets/esri/core/workers/chunks/4d02e211967384994e5e.js +1 -0
  30. package/assets/esri/core/workers/chunks/{82692bff98b4ec781544.js → 4d798da25a726f179089.js} +1 -1
  31. package/assets/esri/core/workers/chunks/51339193abddfe37745d.js +1 -0
  32. package/assets/esri/core/workers/chunks/{0a98dc3ea67ce97a6e7b.js → 5269793822e41dd07fe1.js} +1 -1
  33. package/assets/esri/core/workers/chunks/52d160cb7921ae7a4f57.js +1 -0
  34. package/assets/esri/core/workers/chunks/{630a9afdf0523c27ddb6.js → 555c95b149e3a82a4460.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{eab1e3c101158675abba.js → 5660f479c005149bce8d.js} +1 -1
  36. package/assets/esri/core/workers/chunks/5a51c75a2932d9da001a.js +1 -0
  37. package/assets/esri/core/workers/chunks/{37a3533f004bf2e888da.js → 5d01f0b86566d08ba29d.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{0576b035c1654a43ad5c.js → 5de3aee547113bfd59df.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{45eee326f7a649c5a15b.js → 626db8488f9d931cf55c.js} +2 -2
  40. package/assets/esri/core/workers/chunks/{5a6f7360183693f8490d.js → 6339a24874c698594101.js} +1 -1
  41. package/assets/esri/core/workers/chunks/63dade3e1cc7f5b76846.js +1 -0
  42. package/assets/esri/core/workers/chunks/6c378e7a6ca29d530880.js +1 -0
  43. package/assets/esri/core/workers/chunks/71e46e866c23372b0b58.js +1 -0
  44. package/assets/esri/core/workers/chunks/{c591527543fd75a917d4.js → 72c7126dbd27fa48fcdb.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{d459c790a3b89ac53d2d.js → 759c12b0715279e3c0f6.js} +1 -1
  46. package/assets/esri/core/workers/chunks/75fa861b5757551f8fdc.js +1 -0
  47. package/assets/esri/core/workers/chunks/7655be1470ce39f0e494.js +1 -0
  48. package/assets/esri/core/workers/chunks/796cf1c2ca9955595836.js +1 -0
  49. package/assets/esri/core/workers/chunks/79c4f10da8360ee60cd2.js +1 -0
  50. package/assets/esri/core/workers/chunks/{49c346d2fb8538990f45.js → 7d1c39c2a80e20a0595f.js} +1 -1
  51. package/assets/esri/core/workers/chunks/7f36cffc6ed984b7e467.js +1 -0
  52. package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +1 -0
  53. package/assets/esri/core/workers/chunks/84d301e1b6b0d0b48f51.js +1 -0
  54. package/assets/esri/core/workers/chunks/86931186095c23e47c0c.js +1 -0
  55. package/assets/esri/core/workers/chunks/{59e4e780dcdfed555ca5.js → 8ef5e6f1c606e5e41002.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{55c7c51e56d72f507c22.js → 90afead317186b31b2f9.js} +1 -1
  57. package/assets/esri/core/workers/chunks/90c893959145827961ac.js +1 -0
  58. package/assets/esri/core/workers/chunks/931275cfa2c55eb0f504.js +1 -0
  59. package/assets/esri/core/workers/chunks/{7e0e9ca84490a0c67197.js → 98da74243df03e0cc70d.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{354117429b3a0a0794c9.js → 999e8dbe6f4d0665b3ab.js} +1 -1
  61. package/assets/esri/core/workers/chunks/a348ff2dd936c6bf9399.js +1 -0
  62. package/assets/esri/core/workers/chunks/a53e9f5092de715da025.js +1 -0
  63. package/assets/esri/core/workers/chunks/a9b6377f1fef5826f28d.js +1 -0
  64. package/assets/esri/core/workers/chunks/{8063e35dacf8f99471d8.js → aa404aaec843a4f46ab6.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{21016d58428b15f7427c.js → aa712f850fd129ca5ed8.js} +1 -1
  66. package/assets/esri/core/workers/chunks/ab0113d1269675dcd520.js +1 -0
  67. package/assets/esri/core/workers/chunks/aff7c4477e1f0c31fffa.js +1 -0
  68. package/assets/esri/core/workers/chunks/bf453744067267e84d1b.js +1 -0
  69. package/assets/esri/core/workers/chunks/c2f38c66fae2cdb57445.js +1 -0
  70. package/assets/esri/core/workers/chunks/c7aa4a8263e21f631004.js +1 -0
  71. package/assets/esri/core/workers/chunks/{3be465c653236d6d8c1f.js → d2c7067bb6654c0e2793.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{bc3f42401131a12fce9b.js → d2eb3802fa003c2d497e.js} +1 -1
  73. package/assets/esri/core/workers/chunks/da7c14ae1a25fc7163ce.js +1 -0
  74. package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +1 -0
  75. package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +1 -0
  76. package/assets/esri/core/workers/chunks/{a2377969f76640f1d6fe.js → e2029267cddb8e2effab.js} +1 -1
  77. package/assets/esri/core/workers/chunks/e3ef0451dcdc2e966628.js +1 -0
  78. package/assets/esri/core/workers/chunks/e7e987558cf017c62458.js +1 -0
  79. package/assets/esri/core/workers/chunks/eabfab23246d4a052ea3.js +1 -0
  80. package/assets/esri/core/workers/chunks/ed3d1d0465f4a4d8df4a.js +1 -0
  81. package/assets/esri/core/workers/chunks/{ed4afafbcb31491c2049.js → f452ca61842dbe8de9af.js} +1 -1
  82. package/assets/esri/core/workers/chunks/f54546c155fba2fd3a7e.js +1 -0
  83. package/assets/esri/core/workers/chunks/{4c8164955f8d844c09ee.js → f8d1c7df671733c3325c.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{e45404a982e173459990.js → f92d521ed3df3c9f737b.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{b2289c18c02c868a2939.js → f9bedb421d4e115a888f.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{55f7b1de8882569861c0.js → faed301a25252c619cff.js} +1 -1
  87. package/assets/esri/core/workers/chunks/fb22b2e4988ecf4d6376.js +1 -0
  88. package/assets/esri/core/workers/chunks/fb455fd89b74b70a6a2b.js +1 -0
  89. package/assets/esri/core/workers/chunks/{6d77c7e9dec323fc4145.js → fb603edd374e24f366ff.js} +1 -1
  90. package/core/Accessor.js +1 -1
  91. package/core/accessorSupport/utils.js +1 -1
  92. package/core/workers/registry.js +1 -1
  93. package/geometry/support/meshUtils/elevation.js +1 -1
  94. package/geometry/support/meshUtils.js +1 -1
  95. package/interfaces.d.ts +38 -3
  96. package/intl/locale.js +1 -1
  97. package/layers/support/RasterWorker.js +1 -1
  98. package/layers/support/VideoElement.js +1 -1
  99. package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
  100. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  101. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  102. package/package.json +2 -2
  103. package/rest/networks/queryAssociations.js +1 -1
  104. package/support/revision.js +1 -1
  105. package/symbols/WebStyleSymbol.js +1 -1
  106. package/symbols/support/symbolUtils.js +1 -1
  107. package/views/2d/LabelManager.js +1 -1
  108. package/views/2d/engine/webgl/Overlay.js +1 -1
  109. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  110. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  111. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  112. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  113. package/views/3d/terrain/TerrainSurface.js +1 -1
  114. package/views/3d/terrain/TileRenderer.js +1 -1
  115. package/views/DOMContainer.js +1 -1
  116. package/views/FocusArea.js +1 -1
  117. package/views/GroundView.js +1 -1
  118. package/views/PopupView.js +1 -1
  119. package/views/support/GroundViewElevationSampler.js +1 -1
  120. package/views/support/TextureCompressionHelper.js +1 -1
  121. package/views/support/TextureCompressionWorker.js +5 -0
  122. package/views/support/TextureCompressionWorkerHandle.js +5 -0
  123. package/views/support/imageReprojection.js +1 -1
  124. package/webscene/Slide.js +1 -1
  125. package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
  126. package/widgets/CatalogLayerList.js +1 -1
  127. package/widgets/Directions.js +1 -1
  128. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  129. package/widgets/LayerList/ListItem.js +1 -1
  130. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  131. package/widgets/Legend.js +1 -1
  132. package/widgets/TableList/ListItem.js +1 -1
  133. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  134. package/widgets/UtilityNetworkTrace.js +1 -1
  135. package/widgets/ValuePicker.js +1 -1
  136. package/widgets/support/uriUtils.js +1 -1
  137. package/assets/esri/core/workers/chunks/07910d16d1efae41d4bc.js +0 -1
  138. package/assets/esri/core/workers/chunks/0a3c1642cfabf9acd5c5.js +0 -1
  139. package/assets/esri/core/workers/chunks/0b7331613f91a3258352.js +0 -1
  140. package/assets/esri/core/workers/chunks/1a09dfb2c9fd7cd84cd4.js +0 -1
  141. package/assets/esri/core/workers/chunks/1dd6d68d23ba07587ae4.js +0 -1
  142. package/assets/esri/core/workers/chunks/2079f9d28e4199714f22.js +0 -1
  143. package/assets/esri/core/workers/chunks/29ba2022c2978e9bd53e.js +0 -1
  144. package/assets/esri/core/workers/chunks/29fe3e9a0ecab74bb729.js +0 -1
  145. package/assets/esri/core/workers/chunks/35f3eef81fac7924a487.js +0 -1
  146. package/assets/esri/core/workers/chunks/4539a802cba77a7a7cc7.js +0 -1
  147. package/assets/esri/core/workers/chunks/470cf066294b053c2732.js +0 -1
  148. package/assets/esri/core/workers/chunks/4d7bd2bbe9045a2fee7a.js +0 -1
  149. package/assets/esri/core/workers/chunks/50b6be13c270d7ac80d3.js +0 -1
  150. package/assets/esri/core/workers/chunks/54ace3e4802934f3f9f2.js +0 -1
  151. package/assets/esri/core/workers/chunks/5656cc44e3d4547668db.js +0 -1
  152. package/assets/esri/core/workers/chunks/597f450a57750637cb4d.js +0 -1
  153. package/assets/esri/core/workers/chunks/605eddec7aac891ed141.js +0 -1
  154. package/assets/esri/core/workers/chunks/6e7577cb6378ff34e722.js +0 -1
  155. package/assets/esri/core/workers/chunks/6eb8d7edafeafeb10cae.js +0 -1
  156. package/assets/esri/core/workers/chunks/71bd94cc789a55910f92.js +0 -1
  157. package/assets/esri/core/workers/chunks/762567124623f6d11e67.js +0 -1
  158. package/assets/esri/core/workers/chunks/77845cd5d824c1004bfa.js +0 -1
  159. package/assets/esri/core/workers/chunks/78683f1aadc1377be5fd.js +0 -1
  160. package/assets/esri/core/workers/chunks/7a4413a188a8f1affb2f.js +0 -1
  161. package/assets/esri/core/workers/chunks/7d3b2bdc75525d47389c.js +0 -1
  162. package/assets/esri/core/workers/chunks/81f2f1614ea27f4c2e65.js +0 -1
  163. package/assets/esri/core/workers/chunks/901c957c049f53318e87.js +0 -1
  164. package/assets/esri/core/workers/chunks/94f41ef15f6c61562e5e.js +0 -1
  165. package/assets/esri/core/workers/chunks/95f23bd17ce9e07fc8ef.js +0 -1
  166. package/assets/esri/core/workers/chunks/96d7f47ea8fbf345101c.js +0 -1
  167. package/assets/esri/core/workers/chunks/9f312f7284e506a84ed7.js +0 -1
  168. package/assets/esri/core/workers/chunks/ac86d0b31f6368bd1fb1.js +0 -1
  169. package/assets/esri/core/workers/chunks/ad9b3b83aa96db7b79ea.js +0 -1
  170. package/assets/esri/core/workers/chunks/b02ac03503bfff1ff922.js +0 -1
  171. package/assets/esri/core/workers/chunks/b2666b89755323a84fcb.js +0 -1
  172. package/assets/esri/core/workers/chunks/b948fe33b4d650eea796.js +0 -1
  173. package/assets/esri/core/workers/chunks/be002f24beb832a369ce.js +0 -1
  174. package/assets/esri/core/workers/chunks/bf3c4c1bff8b71bc0b13.js +0 -1
  175. package/assets/esri/core/workers/chunks/d45ff061bf71b73e9f26.js +0 -1
  176. package/assets/esri/core/workers/chunks/d8ddff920725acb99200.js +0 -1
  177. package/assets/esri/core/workers/chunks/db4c110ab4c26c4b768c.js +0 -1
  178. package/assets/esri/core/workers/chunks/dfa4be2e07cc4c0938b0.js +0 -1
  179. package/assets/esri/core/workers/chunks/e491daf73ab1264aa1b9.js +0 -1
  180. package/assets/esri/core/workers/chunks/f2a6287c8d28be24f71e.js +0 -1
  181. package/assets/esri/core/workers/chunks/f4861d73c62096f73e48.js +0 -1
  182. package/assets/esri/core/workers/chunks/f70dd16f14279bb7e60d.js +0 -1
  183. package/assets/esri/core/workers/chunks/fa011ad649c05201e92a.js +0 -1
  184. package/views/3d/webgl-engine/lib/TextureCompressionWorker.js +0 -5
  185. package/views/3d/webgl-engine/lib/TextureCompressionWorkerHandle.js +0 -5
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8846],{1193:(t,n,e)=>{e.d(n,{H:()=>p});var r,o=e(90237),a=e(25482),i=e(4718),l=e(53966),u=e(10107),s=e(79901),c=e(40608),f=e(31199);let p=r=class extends a.A{constructor(t){super(t),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(t){return(0,f.b)(t,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},l.A.getLogger(this))}castPosition(t){return t&&t 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,f.b)(t,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},l.A.getLogger(this))}castUv(t){return(0,f.b)(t,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},l.A.getLogger(this))}castNormal(t){return(0,f.b)(t,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},l.A.getLogger(this))}castTangent(t){return(0,f.b)(t,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},l.A.getLogger(this))}clone(){const t={position:(0,i.o8)(this.position),uv:(0,i.o8)(this.uv),normal:(0,i.o8)(this.normal),tangent:(0,i.o8)(this.tangent),color:(0,i.o8)(this.color)};return new r(t)}clonePositional(){const t={position:(0,i.o8)(this.position),normal:(0,i.o8)(this.normal),tangent:(0,i.o8)(this.tangent),uv:this.uv,color:this.color};return new r(t)}get usedMemory(){return this.position.byteLength+(this.uv?.byteLength??0)+(this.normal?.byteLength??0)+(this.tangent?.byteLength??0)+(this.color?.byteLength??0)}};(0,o._)([(0,u.MZ)({json:{write:f.B}})],p.prototype,"color",void 0),(0,o._)([(0,s.w)("color")],p.prototype,"castColor",null),(0,o._)([(0,u.MZ)({nonNullable:!0,json:{write:f.B}})],p.prototype,"position",void 0),(0,o._)([(0,s.w)("position")],p.prototype,"castPosition",null),(0,o._)([(0,u.MZ)({json:{write:f.B}})],p.prototype,"uv",void 0),(0,o._)([(0,s.w)("uv")],p.prototype,"castUv",null),(0,o._)([(0,u.MZ)({json:{write:f.B}})],p.prototype,"normal",void 0),(0,o._)([(0,s.w)("normal")],p.prototype,"castNormal",null),(0,o._)([(0,u.MZ)({json:{write:f.B}})],p.prototype,"tangent",void 0),(0,o._)([(0,s.w)("tangent")],p.prototype,"castTangent",null),p=r=(0,o._)([(0,c.$)("esri.geometry.support.MeshVertexAttributes")],p)},22141:(t,n,e)=>{e.d(n,{$5:()=>b,CN:()=>A,JP:()=>m,KM:()=>B,Mv:()=>R,X4:()=>M,gr:()=>v,qs:()=>w,si:()=>T,xA:()=>S});var r=e(34727),o=e(77690),a=e(29242),i=e(58083),l=e(9093),u=e(38954),s=e(51850),c=e(48353),f=e(9762),p=(e(79258),e(21325)),g=e(28735),d=e(13030),h=e(73354),y=e(65686);const m="Projection may be possible after calling projection.load().";function A(t,n,e,r){t.error(`Failed to project from (wkid:${n.wkid}) to (wkid:${e.wkid}).${r?" ":""}${r}`)}function M(t,n,e,r,o,a){return N(C.TO_PCPF,d.xs.fromTypedArray(t),_.NORMAL,d.Xm.fromTypedArray(n),e,d.Xm.fromTypedArray(r),o,d.xs.fromTypedArray(a))?a:null}function T(t,n,e,r,o,a){return N(C.FROM_PCPF,d.xs.fromTypedArray(t),_.NORMAL,d.Xm.fromTypedArray(n),e,d.Xm.fromTypedArray(r),o,d.xs.fromTypedArray(a))?a:null}function v(t,n,e,r){return(0,f.projectBuffer)(t,n,0,e,r,0)?e:null}function b(t,n,e,r){return(0,f.projectBuffer)(t,n,0,e,r,0)?e:null}function w(t,n,e){return(0,o.Ge)(L,e),(0,h.b)(n,t,L),(0,r.or)(L)&&(0,h.n)(n,n),n}function B(t,n,e){return(0,o.z0)(L,e),(0,y.t)(n,t,L),(0,r.or)(L)&&(0,h.n)(n,n,4),n}function S(t,n,e,r,o,a){if(!N(C.TO_PCPF,d.xs.fromTypedArray(t,4*Float32Array.BYTES_PER_ELEMENT),_.TANGENT,d.Xm.fromTypedArray(n),e,d.Xm.fromTypedArray(r),o,d.xs.fromTypedArray(a,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(let n=3;n<t.length;n+=4)a[n]=t[n];return a}function R(t,n,e,r,o,a){if(!N(C.FROM_PCPF,d.xs.fromTypedArray(t,16),_.TANGENT,d.Xm.fromTypedArray(n),e,d.Xm.fromTypedArray(r),o,d.xs.fromTypedArray(a,16)))return null;for(let n=3;n<t.length;n+=4)a[n]=t[n];return a}var _,C,E;function F(t,n,e,r,a){switch((0,c.l)(r,e,P,r),t===C.FROM_PCPF&&(0,i.B8)(P,P),n){case _.NORMAL:return(0,o.Ge)(a,P);case _.TANGENT:return(0,o.z0)(a,P)}}function N(t,n,e,r,o,a,i,l){if(!n)return;const s=r.count;if(function(t){return t.isWGS84||(0,p.x1)(t)||(0,p.q8)(t)||(0,p.KQ)(t)}(o))for(let r=0;r<s;r++)a.getVec(r,x),n.getVec(r,O),(0,u.q)(O,O,F(t,e,x,i,L)),l.setVec(r,O);else for(let o=0;o<s;o++){a.getVec(o,x),n.getVec(o,O);const s=(0,g.jg)(r.get(o,1));let c=Math.cos(s);e===_.TANGENT!=(t===C.TO_PCPF)&&(c=1/c),F(t,e,x,i,L),t===C.TO_PCPF?(L[0]*=c,L[1]*=c,L[2]*=c,L[3]*=c,L[4]*=c,L[5]*=c):(L[0]*=c,L[3]*=c,L[6]*=c,L[1]*=c,L[4]*=c,L[7]*=c),(0,u.q)(O,O,L),(0,u.n)(O,O),l.setVec(o,O)}return l}(E=_||(_={}))[E.NORMAL=0]="NORMAL",E[E.TANGENT=1]="TANGENT",function(t){t[t.TO_PCPF=0]="TO_PCPF",t[t.FROM_PCPF=1]="FROM_PCPF"}(C||(C={}));const x=(0,s.vt)(),O=(0,s.vt)(),P=(0,l.vt)(),L=(0,a.vt)()},28846:(t,n,e)=>{e.d(n,{convertMeshVertexSpace:()=>u});var r=e(49186),o=e(4718),a=e(74887),i=e(1193),l=e(72258);async function u(t,n,e){await Promise.resolve(),(0,a.Te)(e);const u=(0,l.UR)(t,n,{useEllipsoid:e?.useEllipsoid});if(!u)throw new r.A("meshUtils:convertVertexSpace()","Failed to convert to provided vertex space due to projection errors");const s=t.cloneAndModifyVertexAttributes(new i.H({...u,uv:(0,o.o8)(t.vertexAttributes.uv),color:(0,o.o8)(t.vertexAttributes.color)}),n);return s.transform=null,s}},31199:(t,n,e)=>{function r(t,n,e,r){const{loggerTag:o,stride:a}=n;return t.length%a!=0?(r.error(o,`Invalid array length, expected a multiple of ${a}`),new e([])):t}function o(t,n,e,o,a){if(!t)return t;if(t instanceof n)return r(t,o,n,a);for(const i of e)if(t instanceof i)return r(new n(t),o,n,a);if(Array.isArray(t))return r(new n(t),o,n,a);{const r=e.map((t=>`'${t.name}'`));return a.error(`Failed to set property, expected one of ${r}, but got ${t.constructor.name}`),new n([])}}function a(t,n,e){n[e]=function(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=t[e];return n}(t)}e.d(n,{B:()=>a,b:()=>o})},48353:(t,n,e)=>{e.d(n,{l:()=>s});var r=e(34727),o=e(58083),a=e(51850);function i(t,n,e){const r=Math.sin(t),o=Math.cos(t),a=Math.sin(n),i=Math.cos(n),l=e;return l[0]=-r,l[4]=-a*o,l[8]=i*o,l[12]=0,l[1]=o,l[5]=-a*r,l[9]=i*r,l[13]=0,l[2]=0,l[6]=i,l[10]=a,l[14]=0,l[3]=0,l[7]=0,l[11]=0,l[15]=1,l}var l=e(37539),u=e(21325);function s(t,n,e,r){const a=(0,l.Tp)(t,r);if(null==a)return!1;const s=a.source.spatialReferenceId,d=a.dest.spatialReferenceId;if(s===d&&!c(d)&&(s!==l.rz.UNKNOWN||(0,u.aI)(t,r)))return(0,o.kN)(e,n),!0;if(c(d)){const t=l.w5[s][l.rz.LON_LAT],r=l.w5[l.rz.LON_LAT][d];return null!=t&&null!=r&&(t(n,0,p,0),r(p,0,g,0),i(f*p[0],f*p[1],e),e[12]=g[0],e[13]=g[1],e[14]=g[2],!0)}const h=c(s);if((d===l.rz.WEB_MERCATOR||d===l.rz.PLATE_CARREE||d===l.rz.WGS84||d===l.rz.CGCS2000)&&(s===l.rz.WGS84||h||s===l.rz.WEB_MERCATOR||s===l.rz.CGCS2000)){const t=l.w5[s][l.rz.LON_LAT],r=l.w5[l.rz.LON_LAT][d];return null!=t&&null!=r&&(t(n,0,p,0),r(p,0,g,0),h?function(t,n,e){i(t,n,e),(0,o.mg)(e,e)}(f*p[0],f*p[1],e):(0,o.D_)(e),e[12]=g[0],e[13]=g[1],e[14]=g[2],!0)}return!1}function c(t){return t===l.rz.SPHERICAL_ECEF||t===l.rz.SPHERICAL_MARS_PCPF||t===l.rz.SPHERICAL_MOON_PCPF||t===l.rz.WGS84_ECEF}const f=(0,r.kU)(1),p=(0,a.vt)(),g=(0,a.vt)()},65686:(t,n,e)=>{e.d(n,{a:()=>a,b:()=>c,l:()=>s,n:()=>l,t:()=>i});var r=e(40876),o=(e(44208),e(53966));function a(t,n,e){i(t.typedBuffer,n.typedBuffer,e,t.typedBufferStride,n.typedBufferStride)}function i(t,n,e,r=4,o=r){if(t.length/r!=n.length/o)return;const a=t.length/r,i=e[0],l=e[1],u=e[2],s=e[3],c=e[4],f=e[5],p=e[6],g=e[7],d=e[8];let h=0,y=0;for(let e=0;e<a;e++){const e=n[h],a=n[h+1],m=n[h+2],A=n[h+3];t[y]=i*e+s*a+p*m,t[y+1]=l*e+c*a+g*m,t[y+2]=u*e+f*a+d*m,t[y+3]=A,h+=o,y+=r}}function l(t,n){const e=Math.min(t.count,n.count),r=t.typedBuffer,o=t.typedBufferStride,a=n.typedBuffer,i=n.typedBufferStride;for(let t=0;t<e;t++){const n=t*o,e=t*i,l=a[e],u=a[e+1],s=a[e+2],c=l*l+u*u+s*s;if(c>0){const t=1/Math.sqrt(c);r[n]=t*l,r[n+1]=t*u,r[n+2]=t*s}}}function u(t,n,e,r=4){const o=Math.min(t.length/r,n.count),a=n.typedBuffer,i=n.typedBufferStride;let l=0,u=0;for(let n=0;n<o;n++)t[u]=e*a[l],t[u+1]=e*a[l+1],t[u+2]=e*a[l+2],t[u+3]=e*a[l+3],l+=i,u+=r}function s(t,n,e,r){c(t.typedBuffer,n,e,r,t.typedBufferStride)}function c(t,n,e,o,a=4){const i=Math.min(t.length/a,n.count),l=n.typedBuffer,u=n.typedBufferStride;let s=0,c=0;const f=1/r.Tf;for(let n=0;n<i;n++)t[c]=o*(e*l[s])**f,t[c+1]=o*(e*l[s+1])**f,t[c+2]=o*(e*l[s+2])**f,t[c+3]=o*e*l[s+3],s+=u,c+=a}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:s,normalize:l,scale:u,scaleView:function(t,n,e){u(t.typedBuffer,n,e,t.typedBufferStride)},transformMat3:i,transformMat3View:a,transformMat4:function(t,n,e,r=4,a=r){if(t.length/r!=n.length/a)return void o.A.getLogger("esri.views.3d.support.buffer.math").error("source and destination buffers need to have the same number of elements");const i=t.length/r,l=e[0],u=e[1],s=e[2],c=e[3],f=e[4],p=e[5],g=e[6],d=e[7],h=e[8],y=e[9],m=e[10],A=e[11],M=e[12],T=e[13],v=e[14],b=e[15];let w=0,B=0;for(let e=0;e<i;e++){const e=n[w],o=n[w+1],i=n[w+2],S=n[w+3];t[B]=l*e+f*o+h*i+M*S,t[B+1]=u*e+p*o+y*i+T*S,t[B+2]=s*e+g*o+m*i+v*S,t[B+3]=c*e+d*o+A*i+b*S,w+=a,B+=r}},transformMat4View:function(t,n,e){if(t.count!==n.count)return;const r=t.count,o=e[0],a=e[1],i=e[2],l=e[3],u=e[4],s=e[5],c=e[6],f=e[7],p=e[8],g=e[9],d=e[10],h=e[11],y=e[12],m=e[13],A=e[14],M=e[15],T=t.typedBuffer,v=t.typedBufferStride,b=n.typedBuffer,w=n.typedBufferStride;for(let t=0;t<r;t++){const n=t*v,e=t*w,r=b[e],B=b[e+1],S=b[e+2],R=b[e+3];T[n]=o*r+u*B+p*S+y*R,T[n+1]=a*r+s*B+g*S+m*R,T[n+2]=i*r+c*B+d*S+A*R,T[n+3]=l*r+f*B+h*S+M*R}}},Symbol.toStringTag,{value:"Module"}))},65806:(t,n,e)=>{e.d(n,{g:()=>i});var r=e(51850),o=e(57251),a=e(9762);function i(t,n,e,r){if((0,o.canProjectWithoutEngine)(t.spatialReference,e)){l[0]=t.x,l[1]=t.y;const o=t.z;return l[2]=o??r??0,(0,a.projectBuffer)(l,t.spatialReference,0,n,e,0)}const i=(0,o.tryProjectWithZConversion)(t,e);return!!i&&(n[0]=i?.x,n[1]=i?.y,n[2]=i?.z??r??0,!0)}const l=(0,r.vt)()},72258:(t,n,e)=>{e.d(n,{UR:()=>v,p5:()=>T,xK:()=>_});var r=e(53966),o=e(34727),a=e(83047),i=e(77690),l=e(29242),u=e(58083),s=e(9093),c=e(38954),f=e(51850),p=e(98764),g=e(48353),d=e(65806),h=e(27615),y=e(21325),m=e(73354),A=e(22141);const M=()=>r.A.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function T(t,n,{vertexSpace:e,spatialReference:r}){if("georeferenced"===e.type){const o=t;if(!(0,d.g)(n,o,r))return!1;const{origin:a}=e;return(0,c.d)(t,o,a),!0}const o=(0,p.lO)(r),a=t;if(!(0,d.g)(n,a,o))return!1;const{origin:i}=e,l=x;if(!(0,g.l)(r,i,l,o))return!1;const s=(0,u.B8)(x,l);return null!=s&&((0,c.t)(t,a,s),!0)}function v(t,n,e){const{vertexSpace:r,transform:o,vertexAttributes:a}=t,l=(0,h.Hq)(r)?o:null,f=S(t.spatialReference,e,O.SOURCE_AND_TARGET);if((0,h.yJ)(r,n)&&(!l||(0,u.t2)(l.localMatrix,s.zK))&&R(f)){const{position:t,normal:n,tangent:r}=a,o=e?.allowBufferReuse;return{position:o?t:t.slice(),normal:o?n:n?.slice(),tangent:o?r:r?.slice()}}switch(t.vertexSpace.type){case"local":return"local"===n.type?function({vertexAttributes:t,spatialReference:n,transform:e},{origin:r},o,a){const i=b(n,a);if(!(0,g.l)(n,r,C,i))return(0,A.CN)(M(),n,i),null;if(e&&(0,u.lw)(C,C,e.localMatrix),!(0,g.l)(n,o,E,i))return(0,A.CN)(M(),i,n),null;(0,u.B8)(E,E);const l=(0,u.lw)(C,E,C);return B(l,n,a,O.SOURCE_AND_TARGET),w(t,l)}(t,t.vertexSpace,n.origin,e):function({spatialReference:t,vertexAttributes:n,transform:e},{origin:r},o,a){const i=b(t,a);if(!(0,g.l)(t,r,C,i))return(0,A.CN)(M(),t,i),null;e&&(0,u.lw)(C,C,e.localMatrix),B(C,t,a,O.SOURCE);const l=new Float64Array(n.position.length),s=function(t,n,e,r,o){(0,m.t)(r,t,n);const a=new Float64Array(t.length);return(0,A.$5)(r,o,a,e)?a:((0,A.CN)(M(),o,e),null)}(n.position,C,t,l,i);if(!s)return null;const f=function(t,n,e,r,o,a){if(null==o)return null;const i=new Float32Array(o.length);return(0,A.qs)(o,i,a),(0,A.si)(i,t,n,e,r,i)?i:((0,A.CN)(M(),r,n),null)}(s,t,l,i,n.normal,C);if(n.normal&&!f)return null;const p=function(t,n,e,r,o,a){if(null==o)return null;const i=new Float32Array(o.length);return(0,A.KM)(o,i,a),(0,A.Mv)(i,t,n,e,r,i)?i:((0,A.CN)(M(),r,n),null)}(s,t,l,i,n.tangent,C);if(n.tangent&&!p)return null;if(o){const t=(0,c.v)(N,o);(0,m.a)(s,s,t)}return{position:s,normal:f,tangent:p}}(t,t.vertexSpace,n.origin,e);case"georeferenced":return"local"===n.type?function({vertexAttributes:t,spatialReference:n,transform:e},{origin:r},o,a){const l=b(n,a);if(!(0,g.l)(n,o,C,l))return(0,A.CN)(M(),n,l),null;const s=1/S(n,a,O.TARGET);(0,u.hs)(C,C,[s,s,s]);const c=(0,u.B8)(E,C),{position:f,normal:p,tangent:d}=function(t,n,e){if(!n)return t;if(!e){const{position:e,normal:r,tangent:o}=t;return{position:(0,m.a)(new Float64Array(e.length),e,n),tangent:o,normal:r}}const r=w(t,e.localMatrix);return(0,m.a)(r.position,r.position,n),r}(t,r,e),h=new Float64Array(f.length),y=function(t,n,e,r,o){const a=(0,A.gr)(t,n,r,o);if(!a)return(0,A.CN)(M(),n,o),null;const i=new Float64Array(a.length);return(0,m.t)(i,a,e),i}(f,n,c,h,l);if(!y)return null;const T=(0,i.Ge)(F,c),v=function(t,n,e,r,o,a,i){if(null==t)return null;const l=i??new Float32Array(t.length);return(0,A.X4)(t,n,e,r,o,l)?((0,m.b)(l,l,a),l):((0,A.CN)(M(),e,o),null)}(p,f,n,h,l,T,p!==t.normal?p:void 0);if(!v&&p)return null;const B=function(t,n,e,r,o,a,i){if(null==t)return null;const l=i??new Float32Array(t.length);return(0,A.xA)(t,n,e,r,o,l)?((0,m.b)(l,l,a,4),l):((0,A.CN)(M(),e,o),null)}(d,f,n,h,l,T,d!==t.tangent?d:void 0);return!B&&d?null:{position:y,normal:v,tangent:B}}(t,t.vertexSpace,n.origin,e):function({vertexAttributes:t,transform:n,spatialReference:e},{origin:r},o,a){const i=S(e,a,O.SOURCE_AND_TARGET),l=r||!R(i)?(0,u.C)(C,n?.localMatrix??s.zK):null;l&&B(l,e,a,O.SOURCE_AND_TARGET);const{position:f,normal:p,tangent:g}=l?w(t,l):t,d=a?.allowBufferReuse,h=d?f:new Float64Array(f.length);let y=f;if(r&&(y=(0,m.a)(h,y,r)),o){const t=(0,c.v)(N,o);y=(0,m.a)(h,y,t)}return{position:y!==t.position||d?y:y.slice(),normal:p!==t.normal||d?p:p?.slice(),tangent:g!==t.tangent||d?g:g?.slice()}}(t,t.vertexSpace,n.origin,e)}}function b(t,n){return n?.useEllipsoid&&(0,y.B3)(t)?p.Y0:(0,p.lO)(t)}function w(t,n){const e=new Float64Array(t.position.length);(0,m.t)(e,t.position,n);const r=t.normal?new Float32Array(t.normal.length):null,o=t.tangent?new Float32Array(t.tangent.length):null;return r&&t.normal&&(0,A.qs)(t.normal,r,n),o&&t.tangent&&(0,A.KM)(t.tangent,o,n),{position:e,normal:r,tangent:o}}function B(t,n,e,r){const o=S(n,e,r);R(o)||(0,u.hs)(t,t,[o,o,o])}function S(t,n,e){const r=!!(e&O.SOURCE),o=!!(e&O.TARGET),a=n?.sourceUnit,i=n?.targetUnit;if(!a&&!i)return 1;let l=_(a,t);r||!a||R(l)||(M().warn("source unit conversion not supported"),l=1);let u=1/_(i,t);return o||!i||R(u)||(M().warn("target unit conversion not supported"),u=1),l*u}function R(t){return(0,o.Io)(t,1)}function _(t,n){if(null==t)return 1;const e=(0,a.KX)(n);return 1/(0,a.oU)(e,"meters",t)}const C=(0,s.vt)(),E=(0,s.vt)(),F=(0,l.vt)(),N=(0,f.vt)(),x=(0,s.vt)();var O,P;(P=O||(O={}))[P.NONE=0]="NONE",P[P.SOURCE=1]="SOURCE",P[P.TARGET=2]="TARGET",P[P.SOURCE_AND_TARGET=3]="SOURCE_AND_TARGET"},73354:(t,n,e)=>{e.d(n,{a:()=>f,b:()=>l,c:()=>i,d:()=>o,e:()=>p,f:()=>c,l:()=>s,n:()=>g,t:()=>a});var r=e(40876);function o(t,n,e){a(t.typedBuffer,n.typedBuffer,e,t.typedBufferStride,n.typedBufferStride)}function a(t,n,e,r=3,o=r){if(t.length/r!==Math.ceil(n.length/o))return t;const a=t.length/r,i=e[0],l=e[1],u=e[2],s=e[4],c=e[5],f=e[6],p=e[8],g=e[9],d=e[10],h=e[12],y=e[13],m=e[14];let A=0,M=0;for(let e=0;e<a;e++){const e=n[A],a=n[A+1],T=n[A+2];t[M]=i*e+s*a+p*T+h,t[M+1]=l*e+c*a+g*T+y,t[M+2]=u*e+f*a+d*T+m,A+=o,M+=r}return t}function i(t,n,e){l(t.typedBuffer,n.typedBuffer,e,t.typedBufferStride,n.typedBufferStride)}function l(t,n,e,r=3,o=r){if(t.length/r!==Math.ceil(n.length/o))return;const a=t.length/r,i=e[0],l=e[1],u=e[2],s=e[3],c=e[4],f=e[5],p=e[6],g=e[7],d=e[8];let h=0,y=0;for(let e=0;e<a;e++){const e=n[h],a=n[h+1],m=n[h+2];t[y]=i*e+s*a+p*m,t[y+1]=l*e+c*a+g*m,t[y+2]=u*e+f*a+d*m,h+=o,y+=r}}function u(t,n,e,r=3,o=r){const a=Math.min(t.length/r,n.length/o);let i=0,l=0;for(let u=0;u<a;u++)t[l]=e*n[i],t[l+1]=e*n[i+1],t[l+2]=e*n[i+2],i+=o,l+=r;return t}function s(t,n,e,r){c(t.typedBuffer,n.typedBuffer,e,r,t.typedBufferStride,n.typedBufferStride)}function c(t,n,e,o,a=3,i=a){const l=Math.min(t.length/a,n.length/i);let u=0,s=0;const c=1/r.Tf;for(let r=0;r<l;r++)t[s]=o*(e*n[u])**c,t[s+1]=o*(e*n[u+1])**c,t[s+2]=o*(e*n[u+2])**c,u+=i,s+=a}function f(t,n,e,r=3,o=r){const a=t.length/r;if(a!==Math.ceil(n.length/o))return t;let i=0,l=0;for(let u=0;u<a;u++)t[l]=n[i]+e[0],t[l+1]=n[i+1]+e[1],t[l+2]=n[i+2]+e[2],i+=o,l+=r;return t}function p(t,n){g(t.typedBuffer,n.typedBuffer,t.typedBufferStride,n.typedBufferStride)}function g(t,n,e=3,r=e){const o=Math.min(t.length/e,n.length/r);let a=0,i=0;for(let l=0;l<o;l++){const o=n[a],l=n[a+1],u=n[a+2],s=o*o+l*l+u*u;if(s>0){const n=1/Math.sqrt(s);t[i]=n*o,t[i+1]=n*l,t[i+2]=n*u}a+=r,i+=e}}e(44208),e(53966),Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:s,normalize:g,normalizeView:p,scale:u,scaleView:function(t,n,e){u(t.typedBuffer,n.typedBuffer,e,t.typedBufferStride,n.typedBufferStride)},shiftRight:function(t,n,e){const r=Math.min(t.count,n.count),o=t.typedBuffer,a=t.typedBufferStride,i=n.typedBuffer,l=n.typedBufferStride;let u=0,s=0;for(let t=0;t<r;t++)o[s]=i[u]>>e,o[s+1]=i[u+1]>>e,o[s+2]=i[u+2]>>e,u+=l,s+=a},transformMat3:l,transformMat3View:i,transformMat4:a,transformMat4View:o,translate:f},Symbol.toStringTag,{value:"Module"}))},77690:(t,n,e)=>{e.d(n,{B8:()=>l,Ge:()=>p,I0:()=>f,KC:()=>u,hZ:()=>a,hs:()=>c,lw:()=>s,mg:()=>i,z0:()=>o});var r=e(34304);function o(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t}function a(t,n,e,r,o,a,i,l,u,s){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=a,t[5]=i,t[6]=l,t[7]=u,t[8]=s,t}function i(t,n){if(t===n){const e=n[1],r=n[2],o=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=o}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t}function l(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],l=n[5],u=n[6],s=n[7],c=n[8],f=c*i-l*s,p=-c*a+l*u,g=s*a-i*u;let d=e*f+r*p+o*g;return d?(d=1/d,t[0]=f*d,t[1]=(-c*r+o*s)*d,t[2]=(l*r-o*i)*d,t[3]=p*d,t[4]=(c*e-o*u)*d,t[5]=(-l*e+o*a)*d,t[6]=g*d,t[7]=(-s*e+r*u)*d,t[8]=(i*e-r*a)*d,t):null}function u(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],l=n[5],u=n[6],s=n[7],c=n[8];return t[0]=i*c-l*s,t[1]=o*s-r*c,t[2]=r*l-o*i,t[3]=l*u-a*c,t[4]=e*c-o*u,t[5]=o*a-e*l,t[6]=a*s-i*u,t[7]=r*u-e*s,t[8]=e*i-r*a,t}function s(t,n,e){const r=n[0],o=n[1],a=n[2],i=n[3],l=n[4],u=n[5],s=n[6],c=n[7],f=n[8],p=e[0],g=e[1],d=e[2],h=e[3],y=e[4],m=e[5],A=e[6],M=e[7],T=e[8];return t[0]=p*r+g*i+d*s,t[1]=p*o+g*l+d*c,t[2]=p*a+g*u+d*f,t[3]=h*r+y*i+m*s,t[4]=h*o+y*l+m*c,t[5]=h*a+y*u+m*f,t[6]=A*r+M*i+T*s,t[7]=A*o+M*l+T*c,t[8]=A*a+M*u+T*f,t}function c(t,n,e){const r=e[0],o=e[1],a=e[2];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t[6]=a*n[6],t[7]=a*n[7],t[8]=a*n[8],t}function f(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],i=e+e,l=r+r,u=o+o,s=e*i,c=r*i,f=r*l,p=o*i,g=o*l,d=o*u,h=a*i,y=a*l,m=a*u;return t[0]=1-f-d,t[3]=c-m,t[6]=p+y,t[1]=c+m,t[4]=1-s-d,t[7]=g-h,t[2]=p-y,t[5]=g+h,t[8]=1-s-f,t}function p(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],l=n[5],u=n[6],s=n[7],c=n[8],f=n[9],p=n[10],g=n[11],d=n[12],h=n[13],y=n[14],m=n[15],A=e*l-r*i,M=e*u-o*i,T=e*s-a*i,v=r*u-o*l,b=r*s-a*l,w=o*s-a*u,B=c*h-f*d,S=c*y-p*d,R=c*m-g*d,_=f*y-p*h,C=f*m-g*h,E=p*m-g*y;let F=A*E-M*C+T*_+v*R-b*S+w*B;return F?(F=1/F,t[0]=(l*E-u*C+s*_)*F,t[1]=(u*R-i*E-s*S)*F,t[2]=(i*C-l*R+s*B)*F,t[3]=(o*C-r*E-a*_)*F,t[4]=(e*E-o*R+a*S)*F,t[5]=(r*R-e*C-a*B)*F,t[6]=(h*w-y*b+m*v)*F,t[7]=(y*T-d*w-m*M)*F,t[8]=(d*b-h*T+m*A)*F,t):null}function g(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t}const d=s,h=g;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t},adjoint:u,copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},determinant:function(t){const n=t[0],e=t[1],r=t[2],o=t[3],a=t[4],i=t[5],l=t[6],u=t[7],s=t[8];return n*(s*a-i*u)+e*(-s*o+i*l)+r*(u*o-a*l)},equals:function(t,n){const e=t[0],o=t[1],a=t[2],i=t[3],l=t[4],u=t[5],s=t[6],c=t[7],f=t[8],p=n[0],g=n[1],d=n[2],h=n[3],y=n[4],m=n[5],A=n[6],M=n[7],T=n[8],v=(0,r.FD)();return Math.abs(e-p)<=v*Math.max(1,Math.abs(e),Math.abs(p))&&Math.abs(o-g)<=v*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-d)<=v*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-h)<=v*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(l-y)<=v*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(u-m)<=v*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(s-A)<=v*Math.max(1,Math.abs(s),Math.abs(A))&&Math.abs(c-M)<=v*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(f-T)<=v*Math.max(1,Math.abs(f),Math.abs(T))},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},fromMat4:o,fromQuat:f,fromRotation:function(t,n){const e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=-e,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:l,isOrthoNormal:function(t){const n=(0,r.FD)(),e=t[0],o=t[1],a=t[2],i=t[3],l=t[4],u=t[5],s=t[6],c=t[7],f=t[8];return Math.abs(1-(e*e+i*i+s*s))<=n&&Math.abs(1-(o*o+l*l+c*c))<=n&&Math.abs(1-(a*a+u*u+f*f))<=n},mul:d,multiply:s,multiplyScalar:function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t},multiplyScalarAndAdd:function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t},normalFromMat4:p,normalFromMat4Legacy:function(t,n){const e=n[0],r=n[1],o=n[2],a=n[4],i=n[5],l=n[6],u=n[8],s=n[9],c=n[10],f=c*i-l*s,p=-c*a+l*u,g=s*a-i*u,d=e*f+r*p+o*g;if(!d)return null;const h=1/d;return t[0]=f*h,t[1]=(-c*r+o*s)*h,t[2]=(l*r-o*i)*h,t[3]=p*h,t[4]=(c*e-o*u)*h,t[5]=(-l*e+o*a)*h,t[6]=g*h,t[7]=(-s*e+r*u)*h,t[8]=(i*e-r*a)*h,t},projection:function(t,n,e){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/e,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,n,e){const r=n[0],o=n[1],a=n[2],i=n[3],l=n[4],u=n[5],s=n[6],c=n[7],f=n[8],p=Math.sin(e),g=Math.cos(e);return t[0]=g*r+p*i,t[1]=g*o+p*l,t[2]=g*a+p*u,t[3]=g*i-p*r,t[4]=g*l-p*o,t[5]=g*u-p*a,t[6]=s,t[7]=c,t[8]=f,t},scale:c,scaleByVec2:function(t,n,e){const r=e[0],o=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t},set:a,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:h,subtract:g,translate:function(t,n,e){const r=n[0],o=n[1],a=n[2],i=n[3],l=n[4],u=n[5],s=n[6],c=n[7],f=n[8],p=e[0],g=e[1];return t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=l,t[5]=u,t[6]=p*r+g*i+s,t[7]=p*o+g*l+c,t[8]=p*a+g*u+f,t},transpose:i},Symbol.toStringTag,{value:"Module"}))},98764:(t,n,e)=>{e.d(n,{Y0:()=>s,lO:()=>c});var r=e(73941),o=e(16930),a=e(21325);const i=new o.A(r.fv),l=new o.A(r.FY),u=new o.A(r.LJ),s=new o.A(r.Ro);function c(t){const n=f.get(t);if(n)return n;let e=i;if(t)if(t===l)e=l;else if(t===u)e=u;else{const n=t.wkid,r=t.latestWkid;if(null!=n||null!=r)(0,a.tl)(n)||(0,a.tl)(r)?e=l:((0,a.ZL)(n)||(0,a.ZL)(r))&&(e=u);else{const n=t.wkt2??t.wkt;if(n){const t=n.toUpperCase();t===p?e=l:t===g&&(e=u)}}}return f.set(t,e),e}const f=new Map,p=l.wkt.toUpperCase(),g=u.wkt.toUpperCase()}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8846],{1193:(t,n,e)=>{e.d(n,{H:()=>p});var r,o=e(90237),a=e(25482),i=e(4718),l=e(53966),u=e(10107),s=e(79901),c=e(40608),f=e(31199);let p=r=class extends a.A{constructor(t){super(t),this.color=null,this.position=new Float64Array(0),this.uv=null,this.normal=null,this.tangent=null}castColor(t){return(0,f.b)(t,Uint8Array,[Uint8ClampedArray],{loggerTag:".color=",stride:4},l.A.getLogger(this))}castPosition(t){return t&&t 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,f.b)(t,Float64Array,[Float32Array],{loggerTag:".position=",stride:3},l.A.getLogger(this))}castUv(t){return(0,f.b)(t,Float32Array,[Float64Array],{loggerTag:".uv=",stride:2},l.A.getLogger(this))}castNormal(t){return(0,f.b)(t,Float32Array,[Float64Array],{loggerTag:".normal=",stride:3},l.A.getLogger(this))}castTangent(t){return(0,f.b)(t,Float32Array,[Float64Array],{loggerTag:".tangent=",stride:4},l.A.getLogger(this))}clone(){const t={position:(0,i.o8)(this.position),uv:(0,i.o8)(this.uv),normal:(0,i.o8)(this.normal),tangent:(0,i.o8)(this.tangent),color:(0,i.o8)(this.color)};return new r(t)}clonePositional(){const t={position:(0,i.o8)(this.position),normal:(0,i.o8)(this.normal),tangent:(0,i.o8)(this.tangent),uv:this.uv,color:this.color};return new r(t)}get usedMemory(){return this.position.byteLength+(this.uv?.byteLength??0)+(this.normal?.byteLength??0)+(this.tangent?.byteLength??0)+(this.color?.byteLength??0)}};(0,o._)([(0,u.MZ)({json:{write:f.B}})],p.prototype,"color",void 0),(0,o._)([(0,s.w)("color")],p.prototype,"castColor",null),(0,o._)([(0,u.MZ)({nonNullable:!0,json:{write:f.B}})],p.prototype,"position",void 0),(0,o._)([(0,s.w)("position")],p.prototype,"castPosition",null),(0,o._)([(0,u.MZ)({json:{write:f.B}})],p.prototype,"uv",void 0),(0,o._)([(0,s.w)("uv")],p.prototype,"castUv",null),(0,o._)([(0,u.MZ)({json:{write:f.B}})],p.prototype,"normal",void 0),(0,o._)([(0,s.w)("normal")],p.prototype,"castNormal",null),(0,o._)([(0,u.MZ)({json:{write:f.B}})],p.prototype,"tangent",void 0),(0,o._)([(0,s.w)("tangent")],p.prototype,"castTangent",null),p=r=(0,o._)([(0,c.$)("esri.geometry.support.MeshVertexAttributes")],p)},22141:(t,n,e)=>{e.d(n,{$5:()=>b,CN:()=>A,JP:()=>m,KM:()=>B,Mv:()=>R,X4:()=>M,gr:()=>v,qs:()=>w,si:()=>T,xA:()=>S});var r=e(34727),o=e(77690),a=e(29242),i=e(58083),l=e(9093),u=e(38954),s=e(51850),c=e(48353),f=e(9762),p=(e(79258),e(21325)),g=e(28735),d=e(13030),h=e(73354),y=e(65686);const m="Projection may be possible after calling projection.load().";function A(t,n,e,r){t.error(`Failed to project from (wkid:${n.wkid}) to (wkid:${e.wkid}).${r?" ":""}${r}`)}function M(t,n,e,r,o,a){return N(C.TO_PCPF,d.xs.fromTypedArray(t),_.NORMAL,d.Xm.fromTypedArray(n),e,d.Xm.fromTypedArray(r),o,d.xs.fromTypedArray(a))?a:null}function T(t,n,e,r,o,a){return N(C.FROM_PCPF,d.xs.fromTypedArray(t),_.NORMAL,d.Xm.fromTypedArray(n),e,d.Xm.fromTypedArray(r),o,d.xs.fromTypedArray(a))?a:null}function v(t,n,e,r){return(0,f.projectBuffer)(t,n,0,e,r,0)?e:null}function b(t,n,e,r){return(0,f.projectBuffer)(t,n,0,e,r,0)?e:null}function w(t,n,e){return(0,o.Ge)(L,e),(0,h.b)(n,t,L),(0,r.or)(L)&&(0,h.n)(n,n),n}function B(t,n,e){return(0,o.z0)(L,e),(0,y.t)(n,t,L),(0,r.or)(L)&&(0,h.n)(n,n,4),n}function S(t,n,e,r,o,a){if(!N(C.TO_PCPF,d.xs.fromTypedArray(t,4*Float32Array.BYTES_PER_ELEMENT),_.TANGENT,d.Xm.fromTypedArray(n),e,d.Xm.fromTypedArray(r),o,d.xs.fromTypedArray(a,4*Float32Array.BYTES_PER_ELEMENT)))return null;for(let n=3;n<t.length;n+=4)a[n]=t[n];return a}function R(t,n,e,r,o,a){if(!N(C.FROM_PCPF,d.xs.fromTypedArray(t,16),_.TANGENT,d.Xm.fromTypedArray(n),e,d.Xm.fromTypedArray(r),o,d.xs.fromTypedArray(a,16)))return null;for(let n=3;n<t.length;n+=4)a[n]=t[n];return a}var _,C,E;function F(t,n,e,r,a){switch((0,c.l)(r,e,P,r),t===C.FROM_PCPF&&(0,i.B8)(P,P),n){case _.NORMAL:return(0,o.Ge)(a,P);case _.TANGENT:return(0,o.z0)(a,P)}}function N(t,n,e,r,o,a,i,l){if(!n)return;const s=r.count;if(function(t){return t.isWGS84||(0,p.x1)(t)||(0,p.q8)(t)||(0,p.KQ)(t)}(o))for(let r=0;r<s;r++)a.getVec(r,x),n.getVec(r,O),(0,u.q)(O,O,F(t,e,x,i,L)),l.setVec(r,O);else for(let o=0;o<s;o++){a.getVec(o,x),n.getVec(o,O);const s=(0,g.jg)(r.get(o,1));let c=Math.cos(s);e===_.TANGENT!=(t===C.TO_PCPF)&&(c=1/c),F(t,e,x,i,L),t===C.TO_PCPF?(L[0]*=c,L[1]*=c,L[2]*=c,L[3]*=c,L[4]*=c,L[5]*=c):(L[0]*=c,L[3]*=c,L[6]*=c,L[1]*=c,L[4]*=c,L[7]*=c),(0,u.q)(O,O,L),(0,u.n)(O,O),l.setVec(o,O)}return l}(E=_||(_={}))[E.NORMAL=0]="NORMAL",E[E.TANGENT=1]="TANGENT",function(t){t[t.TO_PCPF=0]="TO_PCPF",t[t.FROM_PCPF=1]="FROM_PCPF"}(C||(C={}));const x=(0,s.vt)(),O=(0,s.vt)(),P=(0,l.vt)(),L=(0,a.vt)()},28846:(t,n,e)=>{e.d(n,{convertMeshVertexSpace:()=>u});var r=e(49186),o=e(4718),a=e(74887),i=e(1193),l=e(72258);async function u(t,n,e){await Promise.resolve(),(0,a.Te)(e);const u=(0,l.UR)(t,n,{useEllipsoid:e?.useEllipsoid});if(!u)throw new r.A("meshUtils:convertVertexSpace()","Failed to convert to provided vertex space due to projection errors");const s=t.cloneAndModifyVertexAttributes(new i.H({...u,uv:(0,o.o8)(t.vertexAttributes.uv),color:(0,o.o8)(t.vertexAttributes.color)}),n);return s.transform=null,s}},31199:(t,n,e)=>{function r(t,n,e,r){const{loggerTag:o,stride:a}=n;return t.length%a!=0?(r.error(o,`Invalid array length, expected a multiple of ${a}`),new e([])):t}function o(t,n,e,o,a){if(!t)return t;if(t instanceof n)return r(t,o,n,a);for(const i of e)if(t instanceof i)return r(new n(t),o,n,a);if(Array.isArray(t))return r(new n(t),o,n,a);{const r=e.map((t=>`'${t.name}'`));return a.error(`Failed to set property, expected one of ${r}, but got ${t.constructor.name}`),new n([])}}function a(t,n,e){n[e]=function(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=t[e];return n}(t)}e.d(n,{B:()=>a,b:()=>o})},48353:(t,n,e)=>{e.d(n,{l:()=>s});var r=e(34727),o=e(58083),a=e(51850);function i(t,n,e){const r=Math.sin(t),o=Math.cos(t),a=Math.sin(n),i=Math.cos(n),l=e;return l[0]=-r,l[4]=-a*o,l[8]=i*o,l[12]=0,l[1]=o,l[5]=-a*r,l[9]=i*r,l[13]=0,l[2]=0,l[6]=i,l[10]=a,l[14]=0,l[3]=0,l[7]=0,l[11]=0,l[15]=1,l}var l=e(37539),u=e(21325);function s(t,n,e,r){const a=(0,l.Tp)(t,r);if(null==a)return!1;const s=a.source.spatialReferenceId,d=a.dest.spatialReferenceId;if(s===d&&!c(d)&&(s!==l.rz.UNKNOWN||(0,u.aI)(t,r)))return(0,o.kN)(e,n),!0;if(c(d)){const t=l.w5[s][l.rz.LON_LAT],r=l.w5[l.rz.LON_LAT][d];return null!=t&&null!=r&&(t(n,0,p,0),r(p,0,g,0),i(f*p[0],f*p[1],e),e[12]=g[0],e[13]=g[1],e[14]=g[2],!0)}const h=c(s);if((d===l.rz.WEB_MERCATOR||d===l.rz.PLATE_CARREE||d===l.rz.WGS84||d===l.rz.CGCS2000)&&(s===l.rz.WGS84||h||s===l.rz.WEB_MERCATOR||s===l.rz.CGCS2000)){const t=l.w5[s][l.rz.LON_LAT],r=l.w5[l.rz.LON_LAT][d];return null!=t&&null!=r&&(t(n,0,p,0),r(p,0,g,0),h?function(t,n,e){i(t,n,e),(0,o.mg)(e,e)}(f*p[0],f*p[1],e):(0,o.D_)(e),e[12]=g[0],e[13]=g[1],e[14]=g[2],!0)}return!1}function c(t){return t===l.rz.SPHERICAL_ECEF||t===l.rz.SPHERICAL_MARS_PCPF||t===l.rz.SPHERICAL_MOON_PCPF||t===l.rz.WGS84_ECEF}const f=(0,r.kU)(1),p=(0,a.vt)(),g=(0,a.vt)()},65686:(t,n,e)=>{e.d(n,{a:()=>a,b:()=>c,l:()=>s,n:()=>l,t:()=>i});var r=e(40876),o=(e(44208),e(53966));function a(t,n,e){i(t.typedBuffer,n.typedBuffer,e,t.typedBufferStride,n.typedBufferStride)}function i(t,n,e,r=4,o=r){if(t.length/r!=n.length/o)return;const a=t.length/r,i=e[0],l=e[1],u=e[2],s=e[3],c=e[4],f=e[5],p=e[6],g=e[7],d=e[8];let h=0,y=0;for(let e=0;e<a;e++){const e=n[h],a=n[h+1],m=n[h+2],A=n[h+3];t[y]=i*e+s*a+p*m,t[y+1]=l*e+c*a+g*m,t[y+2]=u*e+f*a+d*m,t[y+3]=A,h+=o,y+=r}}function l(t,n){const e=Math.min(t.count,n.count),r=t.typedBuffer,o=t.typedBufferStride,a=n.typedBuffer,i=n.typedBufferStride;for(let t=0;t<e;t++){const n=t*o,e=t*i,l=a[e],u=a[e+1],s=a[e+2],c=l*l+u*u+s*s;if(c>0){const t=1/Math.sqrt(c);r[n]=t*l,r[n+1]=t*u,r[n+2]=t*s}}}function u(t,n,e,r=4){const o=Math.min(t.length/r,n.count),a=n.typedBuffer,i=n.typedBufferStride;let l=0,u=0;for(let n=0;n<o;n++)t[u]=e*a[l],t[u+1]=e*a[l+1],t[u+2]=e*a[l+2],t[u+3]=e*a[l+3],l+=i,u+=r}function s(t,n,e,r){c(t.typedBuffer,n,e,r,t.typedBufferStride)}function c(t,n,e,o,a=4){const i=Math.min(t.length/a,n.count),l=n.typedBuffer,u=n.typedBufferStride;let s=0,c=0;const f=1/r.Tf;for(let n=0;n<i;n++)t[c]=o*(e*l[s])**f,t[c+1]=o*(e*l[s+1])**f,t[c+2]=o*(e*l[s+2])**f,t[c+3]=o*e*l[s+3],s+=u,c+=a}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:s,normalize:l,scale:u,scaleView:function(t,n,e){u(t.typedBuffer,n,e,t.typedBufferStride)},transformMat3:i,transformMat3View:a,transformMat4:function(t,n,e,r=4,a=r){if(t.length/r!=n.length/a)return void o.A.getLogger("esri.views.3d.support.buffer.math").error("source and destination buffers need to have the same number of elements");const i=t.length/r,l=e[0],u=e[1],s=e[2],c=e[3],f=e[4],p=e[5],g=e[6],d=e[7],h=e[8],y=e[9],m=e[10],A=e[11],M=e[12],T=e[13],v=e[14],b=e[15];let w=0,B=0;for(let e=0;e<i;e++){const e=n[w],o=n[w+1],i=n[w+2],S=n[w+3];t[B]=l*e+f*o+h*i+M*S,t[B+1]=u*e+p*o+y*i+T*S,t[B+2]=s*e+g*o+m*i+v*S,t[B+3]=c*e+d*o+A*i+b*S,w+=a,B+=r}},transformMat4View:function(t,n,e){if(t.count!==n.count)return;const r=t.count,o=e[0],a=e[1],i=e[2],l=e[3],u=e[4],s=e[5],c=e[6],f=e[7],p=e[8],g=e[9],d=e[10],h=e[11],y=e[12],m=e[13],A=e[14],M=e[15],T=t.typedBuffer,v=t.typedBufferStride,b=n.typedBuffer,w=n.typedBufferStride;for(let t=0;t<r;t++){const n=t*v,e=t*w,r=b[e],B=b[e+1],S=b[e+2],R=b[e+3];T[n]=o*r+u*B+p*S+y*R,T[n+1]=a*r+s*B+g*S+m*R,T[n+2]=i*r+c*B+d*S+A*R,T[n+3]=l*r+f*B+h*S+M*R}}},Symbol.toStringTag,{value:"Module"}))},65806:(t,n,e)=>{e.d(n,{g:()=>i});var r=e(51850),o=e(80586),a=e(9762);function i(t,n,e,r){if((0,o.canProjectWithoutEngine)(t.spatialReference,e)){l[0]=t.x,l[1]=t.y;const o=t.z;return l[2]=o??r??0,(0,a.projectBuffer)(l,t.spatialReference,0,n,e,0)}const i=(0,o.tryProjectWithZConversion)(t,e);return!!i&&(n[0]=i?.x,n[1]=i?.y,n[2]=i?.z??r??0,!0)}const l=(0,r.vt)()},72258:(t,n,e)=>{e.d(n,{UR:()=>v,p5:()=>T,xK:()=>_});var r=e(53966),o=e(34727),a=e(83047),i=e(77690),l=e(29242),u=e(58083),s=e(9093),c=e(38954),f=e(51850),p=e(98764),g=e(48353),d=e(65806),h=e(27615),y=e(21325),m=e(73354),A=e(22141);const M=()=>r.A.getLogger("esri.geometry.support.meshUtils.vertexSpaceConversion");function T(t,n,{vertexSpace:e,spatialReference:r}){if("georeferenced"===e.type){const o=t;if(!(0,d.g)(n,o,r))return!1;const{origin:a}=e;return(0,c.d)(t,o,a),!0}const o=(0,p.lO)(r),a=t;if(!(0,d.g)(n,a,o))return!1;const{origin:i}=e,l=x;if(!(0,g.l)(r,i,l,o))return!1;const s=(0,u.B8)(x,l);return null!=s&&((0,c.t)(t,a,s),!0)}function v(t,n,e){const{vertexSpace:r,transform:o,vertexAttributes:a}=t,l=(0,h.Hq)(r)?o:null,f=S(t.spatialReference,e,O.SOURCE_AND_TARGET);if((0,h.yJ)(r,n)&&(!l||(0,u.t2)(l.localMatrix,s.zK))&&R(f)){const{position:t,normal:n,tangent:r}=a,o=e?.allowBufferReuse;return{position:o?t:t.slice(),normal:o?n:n?.slice(),tangent:o?r:r?.slice()}}switch(t.vertexSpace.type){case"local":return"local"===n.type?function({vertexAttributes:t,spatialReference:n,transform:e},{origin:r},o,a){const i=b(n,a);if(!(0,g.l)(n,r,C,i))return(0,A.CN)(M(),n,i),null;if(e&&(0,u.lw)(C,C,e.localMatrix),!(0,g.l)(n,o,E,i))return(0,A.CN)(M(),i,n),null;(0,u.B8)(E,E);const l=(0,u.lw)(C,E,C);return B(l,n,a,O.SOURCE_AND_TARGET),w(t,l)}(t,t.vertexSpace,n.origin,e):function({spatialReference:t,vertexAttributes:n,transform:e},{origin:r},o,a){const i=b(t,a);if(!(0,g.l)(t,r,C,i))return(0,A.CN)(M(),t,i),null;e&&(0,u.lw)(C,C,e.localMatrix),B(C,t,a,O.SOURCE);const l=new Float64Array(n.position.length),s=function(t,n,e,r,o){(0,m.t)(r,t,n);const a=new Float64Array(t.length);return(0,A.$5)(r,o,a,e)?a:((0,A.CN)(M(),o,e),null)}(n.position,C,t,l,i);if(!s)return null;const f=function(t,n,e,r,o,a){if(null==o)return null;const i=new Float32Array(o.length);return(0,A.qs)(o,i,a),(0,A.si)(i,t,n,e,r,i)?i:((0,A.CN)(M(),r,n),null)}(s,t,l,i,n.normal,C);if(n.normal&&!f)return null;const p=function(t,n,e,r,o,a){if(null==o)return null;const i=new Float32Array(o.length);return(0,A.KM)(o,i,a),(0,A.Mv)(i,t,n,e,r,i)?i:((0,A.CN)(M(),r,n),null)}(s,t,l,i,n.tangent,C);if(n.tangent&&!p)return null;if(o){const t=(0,c.v)(N,o);(0,m.a)(s,s,t)}return{position:s,normal:f,tangent:p}}(t,t.vertexSpace,n.origin,e);case"georeferenced":return"local"===n.type?function({vertexAttributes:t,spatialReference:n,transform:e},{origin:r},o,a){const l=b(n,a);if(!(0,g.l)(n,o,C,l))return(0,A.CN)(M(),n,l),null;const s=1/S(n,a,O.TARGET);(0,u.hs)(C,C,[s,s,s]);const c=(0,u.B8)(E,C),{position:f,normal:p,tangent:d}=function(t,n,e){if(!n)return t;if(!e){const{position:e,normal:r,tangent:o}=t;return{position:(0,m.a)(new Float64Array(e.length),e,n),tangent:o,normal:r}}const r=w(t,e.localMatrix);return(0,m.a)(r.position,r.position,n),r}(t,r,e),h=new Float64Array(f.length),y=function(t,n,e,r,o){const a=(0,A.gr)(t,n,r,o);if(!a)return(0,A.CN)(M(),n,o),null;const i=new Float64Array(a.length);return(0,m.t)(i,a,e),i}(f,n,c,h,l);if(!y)return null;const T=(0,i.Ge)(F,c),v=function(t,n,e,r,o,a,i){if(null==t)return null;const l=i??new Float32Array(t.length);return(0,A.X4)(t,n,e,r,o,l)?((0,m.b)(l,l,a),l):((0,A.CN)(M(),e,o),null)}(p,f,n,h,l,T,p!==t.normal?p:void 0);if(!v&&p)return null;const B=function(t,n,e,r,o,a,i){if(null==t)return null;const l=i??new Float32Array(t.length);return(0,A.xA)(t,n,e,r,o,l)?((0,m.b)(l,l,a,4),l):((0,A.CN)(M(),e,o),null)}(d,f,n,h,l,T,d!==t.tangent?d:void 0);return!B&&d?null:{position:y,normal:v,tangent:B}}(t,t.vertexSpace,n.origin,e):function({vertexAttributes:t,transform:n,spatialReference:e},{origin:r},o,a){const i=S(e,a,O.SOURCE_AND_TARGET),l=r||!R(i)?(0,u.C)(C,n?.localMatrix??s.zK):null;l&&B(l,e,a,O.SOURCE_AND_TARGET);const{position:f,normal:p,tangent:g}=l?w(t,l):t,d=a?.allowBufferReuse,h=d?f:new Float64Array(f.length);let y=f;if(r&&(y=(0,m.a)(h,y,r)),o){const t=(0,c.v)(N,o);y=(0,m.a)(h,y,t)}return{position:y!==t.position||d?y:y.slice(),normal:p!==t.normal||d?p:p?.slice(),tangent:g!==t.tangent||d?g:g?.slice()}}(t,t.vertexSpace,n.origin,e)}}function b(t,n){return n?.useEllipsoid&&(0,y.B3)(t)?p.Y0:(0,p.lO)(t)}function w(t,n){const e=new Float64Array(t.position.length);(0,m.t)(e,t.position,n);const r=t.normal?new Float32Array(t.normal.length):null,o=t.tangent?new Float32Array(t.tangent.length):null;return r&&t.normal&&(0,A.qs)(t.normal,r,n),o&&t.tangent&&(0,A.KM)(t.tangent,o,n),{position:e,normal:r,tangent:o}}function B(t,n,e,r){const o=S(n,e,r);R(o)||(0,u.hs)(t,t,[o,o,o])}function S(t,n,e){const r=!!(e&O.SOURCE),o=!!(e&O.TARGET),a=n?.sourceUnit,i=n?.targetUnit;if(!a&&!i)return 1;let l=_(a,t);r||!a||R(l)||(M().warn("source unit conversion not supported"),l=1);let u=1/_(i,t);return o||!i||R(u)||(M().warn("target unit conversion not supported"),u=1),l*u}function R(t){return(0,o.Io)(t,1)}function _(t,n){if(null==t)return 1;const e=(0,a.KX)(n);return 1/(0,a.oU)(e,"meters",t)}const C=(0,s.vt)(),E=(0,s.vt)(),F=(0,l.vt)(),N=(0,f.vt)(),x=(0,s.vt)();var O,P;(P=O||(O={}))[P.NONE=0]="NONE",P[P.SOURCE=1]="SOURCE",P[P.TARGET=2]="TARGET",P[P.SOURCE_AND_TARGET=3]="SOURCE_AND_TARGET"},73354:(t,n,e)=>{e.d(n,{a:()=>f,b:()=>l,c:()=>i,d:()=>o,e:()=>p,f:()=>c,l:()=>s,n:()=>g,t:()=>a});var r=e(40876);function o(t,n,e){a(t.typedBuffer,n.typedBuffer,e,t.typedBufferStride,n.typedBufferStride)}function a(t,n,e,r=3,o=r){if(t.length/r!==Math.ceil(n.length/o))return t;const a=t.length/r,i=e[0],l=e[1],u=e[2],s=e[4],c=e[5],f=e[6],p=e[8],g=e[9],d=e[10],h=e[12],y=e[13],m=e[14];let A=0,M=0;for(let e=0;e<a;e++){const e=n[A],a=n[A+1],T=n[A+2];t[M]=i*e+s*a+p*T+h,t[M+1]=l*e+c*a+g*T+y,t[M+2]=u*e+f*a+d*T+m,A+=o,M+=r}return t}function i(t,n,e){l(t.typedBuffer,n.typedBuffer,e,t.typedBufferStride,n.typedBufferStride)}function l(t,n,e,r=3,o=r){if(t.length/r!==Math.ceil(n.length/o))return;const a=t.length/r,i=e[0],l=e[1],u=e[2],s=e[3],c=e[4],f=e[5],p=e[6],g=e[7],d=e[8];let h=0,y=0;for(let e=0;e<a;e++){const e=n[h],a=n[h+1],m=n[h+2];t[y]=i*e+s*a+p*m,t[y+1]=l*e+c*a+g*m,t[y+2]=u*e+f*a+d*m,h+=o,y+=r}}function u(t,n,e,r=3,o=r){const a=Math.min(t.length/r,n.length/o);let i=0,l=0;for(let u=0;u<a;u++)t[l]=e*n[i],t[l+1]=e*n[i+1],t[l+2]=e*n[i+2],i+=o,l+=r;return t}function s(t,n,e,r){c(t.typedBuffer,n.typedBuffer,e,r,t.typedBufferStride,n.typedBufferStride)}function c(t,n,e,o,a=3,i=a){const l=Math.min(t.length/a,n.length/i);let u=0,s=0;const c=1/r.Tf;for(let r=0;r<l;r++)t[s]=o*(e*n[u])**c,t[s+1]=o*(e*n[u+1])**c,t[s+2]=o*(e*n[u+2])**c,u+=i,s+=a}function f(t,n,e,r=3,o=r){const a=t.length/r;if(a!==Math.ceil(n.length/o))return t;let i=0,l=0;for(let u=0;u<a;u++)t[l]=n[i]+e[0],t[l+1]=n[i+1]+e[1],t[l+2]=n[i+2]+e[2],i+=o,l+=r;return t}function p(t,n){g(t.typedBuffer,n.typedBuffer,t.typedBufferStride,n.typedBufferStride)}function g(t,n,e=3,r=e){const o=Math.min(t.length/e,n.length/r);let a=0,i=0;for(let l=0;l<o;l++){const o=n[a],l=n[a+1],u=n[a+2],s=o*o+l*l+u*u;if(s>0){const n=1/Math.sqrt(s);t[i]=n*o,t[i+1]=n*l,t[i+2]=n*u}a+=r,i+=e}}e(44208),e(53966),Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:s,normalize:g,normalizeView:p,scale:u,scaleView:function(t,n,e){u(t.typedBuffer,n.typedBuffer,e,t.typedBufferStride,n.typedBufferStride)},shiftRight:function(t,n,e){const r=Math.min(t.count,n.count),o=t.typedBuffer,a=t.typedBufferStride,i=n.typedBuffer,l=n.typedBufferStride;let u=0,s=0;for(let t=0;t<r;t++)o[s]=i[u]>>e,o[s+1]=i[u+1]>>e,o[s+2]=i[u+2]>>e,u+=l,s+=a},transformMat3:l,transformMat3View:i,transformMat4:a,transformMat4View:o,translate:f},Symbol.toStringTag,{value:"Module"}))},77690:(t,n,e)=>{e.d(n,{B8:()=>l,Ge:()=>p,I0:()=>f,KC:()=>u,hZ:()=>a,hs:()=>c,lw:()=>s,mg:()=>i,z0:()=>o});var r=e(34304);function o(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t}function a(t,n,e,r,o,a,i,l,u,s){return t[0]=n,t[1]=e,t[2]=r,t[3]=o,t[4]=a,t[5]=i,t[6]=l,t[7]=u,t[8]=s,t}function i(t,n){if(t===n){const e=n[1],r=n[2],o=n[5];t[1]=n[3],t[2]=n[6],t[3]=e,t[5]=n[7],t[6]=r,t[7]=o}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t}function l(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],l=n[5],u=n[6],s=n[7],c=n[8],f=c*i-l*s,p=-c*a+l*u,g=s*a-i*u;let d=e*f+r*p+o*g;return d?(d=1/d,t[0]=f*d,t[1]=(-c*r+o*s)*d,t[2]=(l*r-o*i)*d,t[3]=p*d,t[4]=(c*e-o*u)*d,t[5]=(-l*e+o*a)*d,t[6]=g*d,t[7]=(-s*e+r*u)*d,t[8]=(i*e-r*a)*d,t):null}function u(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],l=n[5],u=n[6],s=n[7],c=n[8];return t[0]=i*c-l*s,t[1]=o*s-r*c,t[2]=r*l-o*i,t[3]=l*u-a*c,t[4]=e*c-o*u,t[5]=o*a-e*l,t[6]=a*s-i*u,t[7]=r*u-e*s,t[8]=e*i-r*a,t}function s(t,n,e){const r=n[0],o=n[1],a=n[2],i=n[3],l=n[4],u=n[5],s=n[6],c=n[7],f=n[8],p=e[0],g=e[1],d=e[2],h=e[3],y=e[4],m=e[5],A=e[6],M=e[7],T=e[8];return t[0]=p*r+g*i+d*s,t[1]=p*o+g*l+d*c,t[2]=p*a+g*u+d*f,t[3]=h*r+y*i+m*s,t[4]=h*o+y*l+m*c,t[5]=h*a+y*u+m*f,t[6]=A*r+M*i+T*s,t[7]=A*o+M*l+T*c,t[8]=A*a+M*u+T*f,t}function c(t,n,e){const r=e[0],o=e[1],a=e[2];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t[6]=a*n[6],t[7]=a*n[7],t[8]=a*n[8],t}function f(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],i=e+e,l=r+r,u=o+o,s=e*i,c=r*i,f=r*l,p=o*i,g=o*l,d=o*u,h=a*i,y=a*l,m=a*u;return t[0]=1-f-d,t[3]=c-m,t[6]=p+y,t[1]=c+m,t[4]=1-s-d,t[7]=g-h,t[2]=p-y,t[5]=g+h,t[8]=1-s-f,t}function p(t,n){const e=n[0],r=n[1],o=n[2],a=n[3],i=n[4],l=n[5],u=n[6],s=n[7],c=n[8],f=n[9],p=n[10],g=n[11],d=n[12],h=n[13],y=n[14],m=n[15],A=e*l-r*i,M=e*u-o*i,T=e*s-a*i,v=r*u-o*l,b=r*s-a*l,w=o*s-a*u,B=c*h-f*d,S=c*y-p*d,R=c*m-g*d,_=f*y-p*h,C=f*m-g*h,E=p*m-g*y;let F=A*E-M*C+T*_+v*R-b*S+w*B;return F?(F=1/F,t[0]=(l*E-u*C+s*_)*F,t[1]=(u*R-i*E-s*S)*F,t[2]=(i*C-l*R+s*B)*F,t[3]=(o*C-r*E-a*_)*F,t[4]=(e*E-o*R+a*S)*F,t[5]=(r*R-e*C-a*B)*F,t[6]=(h*w-y*b+m*v)*F,t[7]=(y*T-d*w-m*M)*F,t[8]=(d*b-h*T+m*A)*F,t):null}function g(t,n,e){return t[0]=n[0]-e[0],t[1]=n[1]-e[1],t[2]=n[2]-e[2],t[3]=n[3]-e[3],t[4]=n[4]-e[4],t[5]=n[5]-e[5],t[6]=n[6]-e[6],t[7]=n[7]-e[7],t[8]=n[8]-e[8],t}const d=s,h=g;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,n,e){return t[0]=n[0]+e[0],t[1]=n[1]+e[1],t[2]=n[2]+e[2],t[3]=n[3]+e[3],t[4]=n[4]+e[4],t[5]=n[5]+e[5],t[6]=n[6]+e[6],t[7]=n[7]+e[7],t[8]=n[8]+e[8],t},adjoint:u,copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},determinant:function(t){const n=t[0],e=t[1],r=t[2],o=t[3],a=t[4],i=t[5],l=t[6],u=t[7],s=t[8];return n*(s*a-i*u)+e*(-s*o+i*l)+r*(u*o-a*l)},equals:function(t,n){const e=t[0],o=t[1],a=t[2],i=t[3],l=t[4],u=t[5],s=t[6],c=t[7],f=t[8],p=n[0],g=n[1],d=n[2],h=n[3],y=n[4],m=n[5],A=n[6],M=n[7],T=n[8],v=(0,r.FD)();return Math.abs(e-p)<=v*Math.max(1,Math.abs(e),Math.abs(p))&&Math.abs(o-g)<=v*Math.max(1,Math.abs(o),Math.abs(g))&&Math.abs(a-d)<=v*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(i-h)<=v*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(l-y)<=v*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(u-m)<=v*Math.max(1,Math.abs(u),Math.abs(m))&&Math.abs(s-A)<=v*Math.max(1,Math.abs(s),Math.abs(A))&&Math.abs(c-M)<=v*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(f-T)<=v*Math.max(1,Math.abs(f),Math.abs(T))},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},fromMat4:o,fromQuat:f,fromRotation:function(t,n){const e=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=e,t[2]=0,t[3]=-e,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:l,isOrthoNormal:function(t){const n=(0,r.FD)(),e=t[0],o=t[1],a=t[2],i=t[3],l=t[4],u=t[5],s=t[6],c=t[7],f=t[8];return Math.abs(1-(e*e+i*i+s*s))<=n&&Math.abs(1-(o*o+l*l+c*c))<=n&&Math.abs(1-(a*a+u*u+f*f))<=n},mul:d,multiply:s,multiplyScalar:function(t,n,e){return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*e,t[5]=n[5]*e,t[6]=n[6]*e,t[7]=n[7]*e,t[8]=n[8]*e,t},multiplyScalarAndAdd:function(t,n,e,r){return t[0]=n[0]+e[0]*r,t[1]=n[1]+e[1]*r,t[2]=n[2]+e[2]*r,t[3]=n[3]+e[3]*r,t[4]=n[4]+e[4]*r,t[5]=n[5]+e[5]*r,t[6]=n[6]+e[6]*r,t[7]=n[7]+e[7]*r,t[8]=n[8]+e[8]*r,t},normalFromMat4:p,normalFromMat4Legacy:function(t,n){const e=n[0],r=n[1],o=n[2],a=n[4],i=n[5],l=n[6],u=n[8],s=n[9],c=n[10],f=c*i-l*s,p=-c*a+l*u,g=s*a-i*u,d=e*f+r*p+o*g;if(!d)return null;const h=1/d;return t[0]=f*h,t[1]=(-c*r+o*s)*h,t[2]=(l*r-o*i)*h,t[3]=p*h,t[4]=(c*e-o*u)*h,t[5]=(-l*e+o*a)*h,t[6]=g*h,t[7]=(-s*e+r*u)*h,t[8]=(i*e-r*a)*h,t},projection:function(t,n,e){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/e,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,n,e){const r=n[0],o=n[1],a=n[2],i=n[3],l=n[4],u=n[5],s=n[6],c=n[7],f=n[8],p=Math.sin(e),g=Math.cos(e);return t[0]=g*r+p*i,t[1]=g*o+p*l,t[2]=g*a+p*u,t[3]=g*i-p*r,t[4]=g*l-p*o,t[5]=g*u-p*a,t[6]=s,t[7]=c,t[8]=f,t},scale:c,scaleByVec2:function(t,n,e){const r=e[0],o=e[1];return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=o*n[3],t[4]=o*n[4],t[5]=o*n[5],t},set:a,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:h,subtract:g,translate:function(t,n,e){const r=n[0],o=n[1],a=n[2],i=n[3],l=n[4],u=n[5],s=n[6],c=n[7],f=n[8],p=e[0],g=e[1];return t[0]=r,t[1]=o,t[2]=a,t[3]=i,t[4]=l,t[5]=u,t[6]=p*r+g*i+s,t[7]=p*o+g*l+c,t[8]=p*a+g*u+f,t},transpose:i},Symbol.toStringTag,{value:"Module"}))},98764:(t,n,e)=>{e.d(n,{Y0:()=>s,lO:()=>c});var r=e(73941),o=e(16930),a=e(21325);const i=new o.A(r.fv),l=new o.A(r.FY),u=new o.A(r.LJ),s=new o.A(r.Ro);function c(t){const n=f.get(t);if(n)return n;let e=i;if(t)if(t===l)e=l;else if(t===u)e=u;else{const n=t.wkid,r=t.latestWkid;if(null!=n||null!=r)(0,a.tl)(n)||(0,a.tl)(r)?e=l:((0,a.ZL)(n)||(0,a.ZL)(r))&&(e=u);else{const n=t.wkt2??t.wkt;if(n){const t=n.toUpperCase();t===p?e=l:t===g&&(e=u)}}}return f.set(t,e),e}const f=new Map,p=l.wkt.toUpperCase(),g=u.wkt.toUpperCase()}}]);
package/core/Accessor.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{deprecatedFunction as e}from"./deprecate.js";import t from"./Handles.js";import r from"./Logger.js";import{destroyMaybe as s}from"./maybe.js";import{beforeDestroySymbol as o}from"./accessorSupport/beforeDestroy.js";import{get as i}from"./accessorSupport/get.js";import{Lifecycle as c}from"./accessorSupport/interfaces.js";import{getPropertiesMetadata as a}from"./accessorSupport/metadata.js";import n from"./accessorSupport/Properties.js";import{set as _}from"./accessorSupport/set.js";import{getAccessorInterceptor as p}from"./accessorSupport/testSupport.js";import{removeTarget as l,watch as h}from"./accessorSupport/watch.js";import{property as u}from"./accessorSupport/decorators/property.js";import{subclass as d}from"./accessorSupport/decorators/subclass.js";var f,m;function y(e){if(null==e)return{value:e};if(Array.isArray(e))return{type:[e[0]],value:null};switch(typeof e){case"object":return e.constructor?.__accessorMetadata__||e instanceof Date?{type:e.constructor,value:e}:e;case"boolean":return{type:Boolean,value:e};case"string":return{type:String,value:e};case"number":return{type:Number,value:e};case"function":return{type:e,value:null};default:return}}const v=Symbol("Accessor-Handles"),g=Symbol("Accessor-Initialized");class b{static{f=v,m=g}static createSubclass(e={}){if(Array.isArray(e))throw new Error("Multi-inheritance unsupported since 4.16");const{properties:t,declaredClass:r,constructor:s}=e;delete e.declaredClass,delete e.properties,delete e.constructor;const o=this;class i extends o{constructor(...e){super(...e),this.inherited=null,s&&s.apply(this,e)}}a(i.prototype);for(const c in e){const t=e[c];i.prototype[c]="function"==typeof t?function(...e){const r=this.inherited;let s;this.inherited=function(...e){if(o.prototype[c])return o.prototype[c].apply(this,e)};try{s=t.apply(this,e)}catch(i){throw this.inherited=r,i}return this.inherited=r,s}:e[c]}for(const c in t){const e=y(t[c]);u(e)(i.prototype,c)}return d(r)(i)}static freeze(e){return e instanceof b?e.__accessor__.mutable=!1:Object.freeze(e),e}static isFrozen(e){return e instanceof b?!e.__accessor__.mutable:Object.isFrozen(e)}constructor(...e){if(this[f]=null,this[m]=!1,this.constructor===b)throw new Error("[accessor] cannot instantiate Accessor. This can be fixed by creating a subclass of Accessor");const t=new n(this);Object.defineProperty(this,"__accessor__",{enumerable:!1,value:t}),e.length>0&&(t.ctorArgs=this.normalizeCtorArgs?.apply(this,e)??e[0]),p()?.onInstanceConstruct(this)}postscript(){const e=this.__accessor__,t=e.ctorArgs;e.initialize(),t&&(this.set(t),e.ctorArgs=null),e.constructed(),this.initialize(),this[g]=!0}initialize(){}[o](){this[v]=s(this[v])}destroy(){this.destroyed||(l(this),this.__accessor__.destroy(),p()?.onInstanceDestroy(this))}[Symbol.dispose](){this.destroy()}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[g]}get destroyed(){return this.__accessor__?.lifecycle===c.DESTROYED||!1}get destroying(){return this.__accessor__?.lifecycle===c.DESTROYING||!1}commitProperty(e){i(this,e)}hasOwnProperty(e){return this.__accessor__?this.__accessor__.has(e):Object.prototype.hasOwnProperty.call(this,e)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(e,t){return _(this,e,t),this}watch(t,s,o){return e(r.getLogger(this),"`watch` is deprecated in favor of reactiveUtils.watch",{replacement:"reactiveUtils.watch",version:"4.32",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html#watch",warnOnce:!0}),h(this,t,s,o)}addHandles(e,r){if(this.destroyed){const t=Array.isArray(e)?e:[e];for(const e of t)e.remove();return}(this[v]??=new t).add(e,r)}removeHandles(e){this[v]?.remove(e)}removeAllHandles(){this[v]?.removeAll()}removeHandlesReference(e){this[v]?.removeReference(e)}hasHandles(e){return!0===this[v]?.has(e)}_override(e,t){void 0===t?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_clearOverride(e){return this.__accessor__.clearOverride(e)}_overrideIfSome(e,t){null==t?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_isOverridden(e){return this.__accessor__.isOverridden(e)}notifyChange(e){this.__accessor__.notifyChange(e)}_get(e){return this.__accessor__.internalGet(e)}_set(e,t){return this.__accessor__.internalSet(e,t),this}}export{b as default};
5
+ import{deprecatedFunction as e}from"./deprecate.js";import t from"./Handles.js";import r from"./Logger.js";import{destroyMaybe as s}from"./maybe.js";import{beforeDestroySymbol as o}from"./accessorSupport/beforeDestroy.js";import{get as i}from"./accessorSupport/get.js";import{Lifecycle as c}from"./accessorSupport/interfaces.js";import{getPropertiesMetadata as a}from"./accessorSupport/metadata.js";import n from"./accessorSupport/Properties.js";import{set as _}from"./accessorSupport/set.js";import{getAccessorInterceptor as h}from"./accessorSupport/testSupport.js";import{removeTarget as p,watch as l}from"./accessorSupport/watch.js";import{property as u}from"./accessorSupport/decorators/property.js";import{subclass as d}from"./accessorSupport/decorators/subclass.js";var f,m;function y(e){if(null==e)return{value:e};if(Array.isArray(e))return{type:[e[0]],value:null};switch(typeof e){case"object":return e.constructor?.__accessorMetadata__||e instanceof Date?{type:e.constructor,value:e}:e;case"boolean":return{type:Boolean,value:e};case"string":return{type:String,value:e};case"number":return{type:Number,value:e};case"function":return{type:e,value:null};default:return}}const v=Symbol("Accessor-Handles"),g=Symbol("Accessor-Initialized");class b{static{f=v,m=g}static createSubclass(e={}){if(Array.isArray(e))throw new Error("Multi-inheritance unsupported since 4.16");const{properties:t,declaredClass:r,constructor:s}=e;delete e.declaredClass,delete e.properties,delete e.constructor;const o=this;class i extends o{constructor(...e){super(...e),this.inherited=null,s&&s.apply(this,e)}}a(i.prototype);for(const c in e){const t=e[c];i.prototype[c]="function"==typeof t?function(...e){const r=this.inherited;let s;this.inherited=function(...e){if(o.prototype[c])return o.prototype[c].apply(this,e)};try{s=t.apply(this,e)}catch(i){throw this.inherited=r,i}return this.inherited=r,s}:e[c]}for(const c in t){const e=y(t[c]);u(e)(i.prototype,c)}return d(r)(i)}static freeze(e){return e instanceof b?e.__accessor__.mutable=!1:Object.freeze(e),e}static isFrozen(e){return e instanceof b?!e.__accessor__.mutable:Object.isFrozen(e)}constructor(...e){if(this[f]=null,this[m]=!1,this.constructor===b)throw new Error("[accessor] cannot instantiate Accessor. This can be fixed by creating a subclass of Accessor");const t=new n(this);Object.defineProperty(this,"__accessor__",{enumerable:!1,value:t}),e.length>0&&(t.ctorArgs=this.normalizeCtorArgs?.apply(this,e)??e[0]),h()?.onInstanceConstruct(this)}postscript(){const e=this.__accessor__,t=e.ctorArgs;e.initialize(),t&&(this.set(t),e.ctorArgs=null),e.constructed(),this.initialize(),this[g]=!0}initialize(){}[o](){this[v]=s(this[v])}destroy(){this.destroyed||(p(this),this.__accessor__.destroy(),h()?.onInstanceDestroy(this))}[Symbol.dispose](){this.destroy()}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[g]}get destroyed(){return this.__accessor__?.lifecycle===c.DESTROYED||!1}get destroying(){return this.__accessor__?.lifecycle===c.DESTROYING||!1}commitProperty(e){i(this,e)}hasOwnProperty(e){return this.__accessor__?this.__accessor__.has(e):Object.prototype.hasOwnProperty.call(this,e)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(e,t){return _(this,e,t),this}watch(t,s,o){return e(r.getLogger(this),"`watch` is deprecated in favor of reactiveUtils.watch",{replacement:"reactiveUtils.watch",version:"4.32",see:"https://arcg.is/1vaqf42#watch",warnOnce:!0}),l(this,t,s,o)}addHandles(e,r){if(this.destroyed){const t=Array.isArray(e)?e:[e];for(const e of t)e.remove();return}(this[v]??=new t).add(e,r)}removeHandles(e){this[v]?.remove(e)}removeAllHandles(){this[v]?.removeAll()}removeHandlesReference(e){this[v]?.removeReference(e)}hasHandles(e){return!0===this[v]?.has(e)}_override(e,t){void 0===t?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_clearOverride(e){return this.__accessor__.clearOverride(e)}_overrideIfSome(e,t){null==t?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_isOverridden(e){return this.__accessor__.isOverridden(e)}notifyChange(e){this.__accessor__.notifyChange(e)}_get(e){return this.__accessor__.internalGet(e)}_set(e,t){return this.__accessor__.internalSet(e,t),this}}export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{handlesGroup as r}from"../handleUtils.js";import{clone as n}from"../lang.js";function t(r){return r.__accessor__??null}function e(r,n){return null!=r?.metadata?.[n]}function i(r,n){const e=t(r);return e?e.getDependsInfo(r,n,""):""}function u(r,n,t){if(t){return o(r,n,{policy:t,path:""})}return o(r,n,null)}function o(r,t,e){return t?Object.keys(t).reduce(((r,i)=>{const u=i;let l=null,s="merge";if(e&&(l=e.path?`${e.path}.${i}`:i,s=e.policy(l)),"replace"===s)return r[u]=t[u],r;if("replace-arrays"===s&&Array.isArray(r[u]))return r[u]=t[u],r;if(void 0===r[u])return r[u]=n(t[u]),r;let a=r[u],c=t[u];if(a===c)return r;if(Array.isArray(c)||Array.isArray(r))a=a?Array.isArray(a)?r[u]=a.slice():r[u]=[a]:r[u]=[],c&&(Array.isArray(c)||(c=[c]),c.forEach((r=>{a.includes(r)||a.push(r)})));else if(c&&"object"==typeof c)if(e){const n=e.path;e.path=l,r[u]=o(a,c,e),e.path=n}else r[u]=o(a,c,null);else r.hasOwnProperty(i)&&!t.hasOwnProperty(i)||(r[u]=c);return r}),r||{}):r}function l(r){return r&&("string"!=typeof r||r.includes("."))?s(r):r}function s(r){return Array.isArray(r)?r:r.split(".")}function a(r){return r.includes(",")?r.split(",").map((r=>r.trim())):[r.trim()]}function c(r){if(Array.isArray(r)){const n=[];for(const t of r)n.push(...a(t));return n}return a(r)}function f(r){if(!r.includes("?"))return null;const n=s(r),t=new Array(n.length);for(let e=0;e<n.length;e++){const r=n[e];t[e]="?"===r[r.length-1],t[e]&&(n[e]=r.slice(0,-1))}return{fullPath:n.join("."),conditional:t}}function p(n,t,e,i){const u=c(t);if(1!==u.length){const t=u.map((r=>i(n,r,e)));return r(t)}return i(n,u[0],e)}export{i as getDependsInfo,t as getProperties,e as isPropertyDeclared,u as merge,p as parse,f as parseConditionalPath,s as pathToArray,l as pathToStringOrArray,c as splitPath};
5
+ import{handlesGroup as r}from"../handleUtils.js";import{clone as t}from"../lang.js";function n(r){return r.__accessor__??null}function e(r,t){return null!=r?.metadata?.[t]}function i(r,t){const e=n(r);return e?e.getDependsInfo(r,t,""):""}function u(r,t,n){if(n){return a(r,t,{policy:n,path:""})}return a(r,t,null)}function a(r,n,e){return n?Object.keys(n).reduce(((r,i)=>{const u=i;let s=null,o="merge";if(e&&(s=e.path?`${e.path}.${i}`:i,o=e.policy(s)),"replace"===o)return r[u]=n[u],r;if("replace-arrays"===o&&Array.isArray(r[u]))return r[u]=n[u],r;if(void 0===r[u])return r[u]=t(n[u]),r;let c=r[u],l=n[u];if(c===l)return r;if(Array.isArray(l)||Array.isArray(r))c=c?Array.isArray(c)?r[u]=c.slice():r[u]=[c]:r[u]=[],l&&(Array.isArray(l)||(l=[l]),l.forEach((r=>{c.includes(r)||c.push(r)})));else if(l&&"object"==typeof l)if(e){const t=e.path;e.path=s,r[u]=a(c,l,e),e.path=t}else r[u]=a(c,l,null);else r.hasOwnProperty(i)&&!n.hasOwnProperty(i)||(r[u]=l);return r}),r||{}):r}function s(r){return Array.isArray(r)?r:r.split(".")}function o(r){return r.includes(",")?r.split(",").map((r=>r.trim())):[r.trim()]}function c(r){if(Array.isArray(r)){const t=[];for(const n of r)t.push(...o(n));return t}return o(r)}function l(t,n,e,i){const u=c(n);if(1!==u.length){const n=u.map((r=>i(t,r,e)));return r(n)}return i(t,u[0],e)}export{i as getDependsInfo,n as getProperties,e as isPropertyDeclared,u as merge,l as parse,s as pathToArray,c as splitPath};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const e={statsWorker:()=>import("../../smartMapping/statistics/support/statsWorker.js"),geometryEngineWorker:()=>import("../../geometry/geometryEngineWorker.js"),arcadeGeometryOperatorsWorker:()=>import("../../arcade/geometry/operatorsWorker.js"),CSVSourceWorker:()=>import("../../layers/graphics/sources/support/CSVSourceWorker.js"),EdgeProcessingWorker:()=>import("../../views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker.js"),ElevationSamplerWorker:()=>import("../../geometry/support/meshUtils/ElevationSamplerWorker.js"),FeatureServiceSnappingSourceWorker:()=>import("../../views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js"),GeoJSONSourceWorker:()=>import("../../layers/graphics/sources/geojson/GeoJSONSourceWorker.js"),LercWorker:()=>import("../../layers/support/LercWorker.js"),MemorySourceWorker:()=>import("../../layers/graphics/sources/support/MemorySourceWorker.js"),PBFDecoderWorker:()=>import("../../views/3d/support/PBFDecoderWorker.js"),FeaturePipelineWorker:()=>import("../../views/2d/layers/features/FeaturePipelineWorker.js"),PointCloudWorker:()=>import("../../views/3d/layers/PointCloudWorker.js"),RasterWorker:()=>import("../../layers/support/RasterWorker.js"),SceneLayerSnappingSourceWorker:()=>import("../../views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js"),SceneLayerWorker:()=>import("../../views/3d/layers/SceneLayerWorker.js"),WFSSourceWorker:()=>import("../../layers/graphics/sources/WFSSourceWorker.js"),WorkerTileHandler:()=>import("../../views/2d/engine/vectorTiles/WorkerTileHandler.js"),Lyr3DWorker:()=>import("../../views/3d/layers/Lyr3DWorker.js"),Feature3DPipelineWorker:()=>import("../../views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js"),TextureCompressionWorker:()=>import("../../views/3d/webgl-engine/lib/TextureCompressionWorker.js")};export{e as registry};
5
+ const r={statsWorker:()=>import("../../smartMapping/statistics/support/statsWorker.js"),geometryEngineWorker:()=>import("../../geometry/geometryEngineWorker.js"),arcadeGeometryOperatorsWorker:()=>import("../../arcade/geometry/operatorsWorker.js"),CSVSourceWorker:()=>import("../../layers/graphics/sources/support/CSVSourceWorker.js"),EdgeProcessingWorker:()=>import("../../views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker.js"),ElevationSamplerWorker:()=>import("../../geometry/support/meshUtils/ElevationSamplerWorker.js"),FeatureServiceSnappingSourceWorker:()=>import("../../views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js"),GeoJSONSourceWorker:()=>import("../../layers/graphics/sources/geojson/GeoJSONSourceWorker.js"),LercWorker:()=>import("../../layers/support/LercWorker.js"),MemorySourceWorker:()=>import("../../layers/graphics/sources/support/MemorySourceWorker.js"),PBFDecoderWorker:()=>import("../../views/3d/support/PBFDecoderWorker.js"),FeaturePipelineWorker:()=>import("../../views/2d/layers/features/FeaturePipelineWorker.js"),PointCloudWorker:()=>import("../../views/3d/layers/PointCloudWorker.js"),RasterWorker:()=>import("../../layers/support/RasterWorker.js"),SceneLayerSnappingSourceWorker:()=>import("../../views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js"),SceneLayerWorker:()=>import("../../views/3d/layers/SceneLayerWorker.js"),WFSSourceWorker:()=>import("../../layers/graphics/sources/WFSSourceWorker.js"),WorkerTileHandler:()=>import("../../views/2d/engine/vectorTiles/WorkerTileHandler.js"),Lyr3DWorker:()=>import("../../views/3d/layers/Lyr3DWorker.js"),Feature3DPipelineWorker:()=>import("../../views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js"),TextureCompressionWorker:()=>import("../../views/support/TextureCompressionWorker.js")};export{r as registry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Logger.js";import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import o from"../../Mesh.js";import n from"../../Point.js";import{project as r}from"../../projection.js";import i from"../MeshComponent.js";import{MeshVertexAttributes as s}from"../MeshVertexAttributes.js";import{isGround as a}from"../../../support/groundInstanceUtils.js";const l=()=>e.getLogger("esri.geometry.support.meshUtils.elevation");async function m(e,t,n){let r;if(p(e)||a(e)){const o=await c(e);return r=await o.createElevationSampler(t,{demResolution:n?.demResolution??"finest-contiguous"}),u(r,t,{material:n?.material})}return"string"==typeof n?.demResolution?(l().error("create()","demResolution must be a number when used directly with a sampler"),new o):u(e,t,{material:n?.material,demResolution:n?.demResolution})}function u(e,n,a){if(e.demResolution.min<=0&&!a?.demResolution)return l().error("create()","demResolution must be specified when used with groundView.elevationSampler"),new o;const m=t(n.spatialReference),u=(a?.demResolution??e.demResolution.min)/m,c=Math.round(n.width/u),p=Math.round(n.height/u),d=c+1,w=p+1,R=new Float64Array(d*w*3),h=new Float32Array(d*w*2);let y=0,g=0;const j=new Uint32Array(c*p*2*3);let v=0,A=0;const b=!e.spatialReference.equals(n.spatialReference);f.spatialReference=n.spatialReference;const{xmin:x,ymin:M,height:U,width:S}=n;for(let t=0;t<w;t++){const o=M+U*(t/p);for(let n=0;n<d;n++){const i=x+S*(n/c);if(R[y++]=i,R[y++]=o,b){f.x=i,f.y=o;const t=r(f,e.spatialReference);R[y++]=e.elevationAt(t.x,t.y)??0}else R[y++]=e.elevationAt(i,o)??0;const s=n/c,a=t/p;h[g++]=s,h[g++]=a,t!==p&&n!==c&&(j[A++]=v+1,j[A++]=v+d+1,j[A++]=v+d,j[A++]=v,j[A++]=v+1,j[A++]=v+d),v++}}return new o({vertexAttributes:new s({position:R,uv:h}),components:[new i({faces:j,shading:"smooth",material:a?.material??null})],spatialReference:n.spatialReference})}async function c(e){return p(e)?e.load():(await e.load(),await Promise.allSettled(e.layers.items.map((e=>e.load()))),e)}function p(e){return"type"in e&&("elevation"===e.type||"base-elevation"===e.type)}const f=new n;export{m as create};
5
+ import e from"../../../core/Logger.js";import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import o from"../../Mesh.js";import n from"../../Point.js";import{project as r}from"../../projection.js";import i from"../MeshComponent.js";import{MeshVertexAttributes as a}from"../MeshVertexAttributes.js";import{isGround as s}from"../../../support/groundInstanceUtils.js";const l=()=>e.getLogger("esri.geometry.support.meshUtils.elevation");async function m(e,t,n){let r;if(p(e)||s(e)){const o=await u(e);return r=await o.createElevationSampler(t,{demResolution:n?.demResolution??"finest-contiguous"}),c(r,t,{material:n?.material})}return"string"==typeof n?.demResolution?(l().error("create()","demResolution must be a number when used directly with a sampler"),new o):c(e,t,{material:n?.material,demResolution:n?.demResolution})}function c(e,n,s){const l=t(n.spatialReference),m=(s?.demResolution??e.demResolution.min)/l,c=Math.round(n.width/m),u=Math.round(n.height/m),p=c+1,d=u+1,h=new Float64Array(p*d*3),w=new Float32Array(p*d*2);let R=0,y=0;const g=new Uint32Array(c*u*2*3);let j=0,v=0;const A=!e.spatialReference.equals(n.spatialReference);f.spatialReference=n.spatialReference;const{xmin:x,ymin:b,height:M,width:U}=n;for(let t=0;t<d;t++){const o=b+M*(t/u);for(let n=0;n<p;n++){const i=x+U*(n/c);if(h[R++]=i,h[R++]=o,A){f.x=i,f.y=o;const t=r(f,e.spatialReference);h[R++]=e.elevationAt(t.x,t.y)??0}else h[R++]=e.elevationAt(i,o)??0;const a=n/c,s=t/u;w[y++]=a,w[y++]=s,t!==u&&n!==c&&(g[v++]=j+1,g[v++]=j+p+1,g[v++]=j+p,g[v++]=j,g[v++]=j+1,g[v++]=j+p),j++}}return new o({vertexAttributes:new a({position:h,uv:w}),components:[new i({faces:g,shading:"smooth",material:s?.material??null})],spatialReference:n.spatialReference})}async function u(e){return p(e)?e.load():(await e.load(),await Promise.allSettled(e.layers.items.map((e=>e.load()))),e)}function p(e){return"type"in e&&("elevation"===e.type||"base-elevation"===e.type)}const f=new n;export{m as create};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{deprecatedFunction as e}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{throwIfAborted as t}from"../../core/promiseUtils.js";import s from"../Mesh.js";import{georeference as o,ungeoreference as n}from"./meshUtils/georeference.js";import{merge as c}from"./meshUtils/merge.js";const i=()=>r.getLogger("esri.geometry.support.meshUtils");async function a(e,r,s){const o=await import("./meshUtils/elevation.js");return t(s),o.create(e,r,s)}async function m(e,r){await e.load();return(await import("./meshUtils/elevationSampler.js")).create(e,r)}function p(r,t,s){return e(i(),"`meshUtils.georeference` is deprecated in favor of 'meshUtils.convertVertexSpace'",{replacement:"meshUtils.convertVertexSpace",version:"4.30",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#convertVertexSpace",warnOnce:!0}),o(r,t,s)}function l(r,t,s){return e(i(),"`meshUtils.ungeoreference` is deprecated in favor of 'meshUtils.convertVertexSpace'",{replacement:"meshUtils.convertVertexSpace",version:"4.30",see:"https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-support-meshUtils.html#convertVertexSpace",warnOnce:!0}),n(r,t,s)}function f(e){const r=c(e);return null!=r?new s(r):null}async function h(e,r,s){const{convertMeshVertexSpace:o}=await import("./meshUtils/convertMeshVertexSpace.js");return t(s),o(e,r,s)}export{h as convertVertexSpace,m as createElevationSampler,a as createFromElevation,p as georeference,f as merge,l as ungeoreference};
5
+ import{deprecatedFunction as e}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{throwIfAborted as t}from"../../core/promiseUtils.js";import s from"../Mesh.js";import{georeference as o,ungeoreference as n}from"./meshUtils/georeference.js";import{merge as c}from"./meshUtils/merge.js";const i=()=>r.getLogger("esri.geometry.support.meshUtils");async function a(e,r,s){const o=await import("./meshUtils/elevation.js");return t(s),o.create(e,r,s)}async function m(e,r){await e.load();return(await import("./meshUtils/elevationSampler.js")).create(e,r)}function p(r,t,s){return e(i(),"`meshUtils.georeference` is deprecated in favor of 'meshUtils.convertVertexSpace'",{replacement:"meshUtils.convertVertexSpace",version:"4.30",see:"https://arcg.is/1yHayr0#convertVertexSpace",warnOnce:!0}),o(r,t,s)}function l(r,t,s){return e(i(),"`meshUtils.ungeoreference` is deprecated in favor of 'meshUtils.convertVertexSpace'",{replacement:"meshUtils.convertVertexSpace",version:"4.30",see:"https://arcg.is/1yHayr0#convertVertexSpace",warnOnce:!0}),n(r,t,s)}function f(e){const r=c(e);return null!=r?new s(r):null}async function h(e,r,s){const{convertMeshVertexSpace:o}=await import("./meshUtils/convertMeshVertexSpace.js");return t(s),o(e,r,s)}export{h as convertVertexSpace,m as createElevationSampler,a as createFromElevation,p as georeference,f as merge,l as ungeoreference};
package/interfaces.d.ts CHANGED
@@ -855,6 +855,14 @@ declare namespace __esri {
855
855
  }
856
856
 
857
857
  export class SliceAnalysis {
858
+ /**
859
+ * A flag that indicates whether the ground surface should be excluded from the slice analysis.
860
+ *
861
+ * @default false
862
+ *
863
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SliceAnalysis.html#excludeGroundSurface Read more...}
864
+ */
865
+ excludeGroundSurface: boolean;
858
866
  /**
859
867
  * Whether the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SliceAnalysis.html#shape shape} supports a tilt angle or not.
860
868
  *
@@ -871,6 +879,13 @@ declare namespace __esri {
871
879
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SliceAnalysis.html Read more...}
872
880
  */
873
881
  constructor(properties?: SliceAnalysisProperties);
882
+ /**
883
+ * A collection of layers that should be excluded from the slice analysis.
884
+ *
885
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SliceAnalysis.html#excludedLayers Read more...}
886
+ */
887
+ get excludedLayers(): Collection<Layer | BuildingComponentSublayer>;
888
+ set excludedLayers(value: CollectionProperties<Layer | BuildingComponentSublayer>);
874
889
  /**
875
890
  * The shape used to slice elements in a 3D scene.
876
891
  *
@@ -887,6 +902,18 @@ declare namespace __esri {
887
902
  }
888
903
 
889
904
  interface SliceAnalysisProperties {
905
+ /**
906
+ * A collection of layers that should be excluded from the slice analysis.
907
+ *
908
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SliceAnalysis.html#excludedLayers Read more...}
909
+ */
910
+ excludedLayers?: CollectionProperties<Layer | BuildingComponentSublayer>;
911
+ /**
912
+ * A flag that indicates whether the ground surface should be excluded from the slice analysis.
913
+ *
914
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SliceAnalysis.html#excludeGroundSurface Read more...}
915
+ */
916
+ excludeGroundSurface?: boolean;
890
917
  /**
891
918
  * The shape used to slice elements in a 3D scene.
892
919
  *
@@ -1716,6 +1743,7 @@ declare namespace __esri {
1716
1743
  interface layerInternalAccessUtils {
1717
1744
  addInclusionDefinitionToLayer(layer: KnowledgeGraphLayer, inclusionDefinition: InclusionModeDefinitionOptimizedGeometry): void;
1718
1745
  getInclusionDefinitionFromLayer(layer: KnowledgeGraphLayer | LinkChartLayer): InclusionModeDefinitionOptimizedGeometry | nullish;
1746
+ readKnowledgeLayerJSON(layer: KnowledgeGraphLayer | LinkChartLayer | KnowledgeGraphSublayer, json: any, originName: "defaults" | "service" | "portal-item" | "web-scene" | "web-map" | "link-chart" | "user"): void;
1719
1747
  removeInclusionDefinitionFromLayer(layer: KnowledgeGraphLayer): void;
1720
1748
  }
1721
1749
 
@@ -89331,6 +89359,7 @@ declare namespace __esri {
89331
89359
  * @param options.spatialReference The spatial reference of the view in which the graphic is displayed.
89332
89360
  * @param options.renderer The renderer of the layer associated with the `graphic`.
89333
89361
  * @param options.resolution The {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#resolution resolution} of the view at which the graphic is displayed.
89362
+ * @param options.webStyleAcceptedFormats A list of accepted formats when resolving web style symbols. The symbol will resolve to the first accepted format in the list.
89334
89363
  *
89335
89364
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html#getDisplayedColor Read more...}
89336
89365
  */
@@ -89345,6 +89374,7 @@ declare namespace __esri {
89345
89374
  * @param options.spatialReference The spatial reference of the view in which the symbol is displayed.
89346
89375
  * @param options.renderer The renderer of the layer associated with the `graphic`.
89347
89376
  * @param options.resolution The {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#resolution resolution} of the view at which the symbol is displayed.
89377
+ * @param options.webStyleAcceptedFormats A list of accepted formats when resolving web style symbols. The symbol will resolve to the first accepted format in the list.
89348
89378
  *
89349
89379
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html#getDisplayedSymbol Read more...}
89350
89380
  */
@@ -89430,6 +89460,7 @@ declare namespace __esri {
89430
89460
  spatialReference?: SpatialReference;
89431
89461
  renderer?: RendererUnion;
89432
89462
  resolution?: number;
89463
+ webStyleAcceptedFormats?: ("web" | "cim")[];
89433
89464
  }
89434
89465
 
89435
89466
  export interface symbolUtilsGetDisplayedSymbolOptions {
@@ -89438,6 +89469,7 @@ declare namespace __esri {
89438
89469
  spatialReference?: SpatialReference;
89439
89470
  renderer?: RendererUnion;
89440
89471
  resolution?: number;
89472
+ webStyleAcceptedFormats?: ("web" | "cim")[];
89441
89473
  }
89442
89474
 
89443
89475
  export interface symbolUtilsGetLegendLabelOptions {
@@ -90184,20 +90216,22 @@ declare namespace __esri {
90184
90216
  *
90185
90217
  * @param options An object with the following properties.
90186
90218
  * @param options.signal Signal object that can be used to abort the asynchronous task. The returned promise will be rejected with an {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html Error} named `AbortError` when an abort is signaled. See also [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) for more information on how to construct a controller that can be used to deliver abort signals.
90219
+ * @deprecated since version 4.33. Use [`fetchSymbol`](#fetchSymbol) instead. Pass `{ acceptedFormats: ["cim"] }`
90220
+ * as options to [`fetchSymbol`](#fetchSymbol) to retrieve only CIM symbols.
90187
90221
  *
90188
90222
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#fetchCIMSymbol Read more...}
90189
90223
  */
90190
90224
  fetchCIMSymbol(options?: WebStyleSymbolFetchCIMSymbolOptions | null): Promise<CIMSymbol>;
90191
90225
  /**
90192
- * Downloads and returns the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html PointSymbol3D} instance the
90193
- * WebStyleSymbol refers to.
90226
+ * Resolves and returns the symbol instance the WebStyleSymbol refers to.
90194
90227
  *
90195
90228
  * @param options An object with the following properties.
90229
+ * @param options.acceptedFormats A list of accepted formats. The symbol will resolve to the first accepted format in the list.
90196
90230
  * @param options.signal Signal object that can be used to abort the asynchronous task. The returned promise will be rejected with an {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Error.html Error} named `AbortError` when an abort is signaled. See also [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) for more information on how to construct a controller that can be used to deliver abort signals.
90197
90231
  *
90198
90232
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html#fetchSymbol Read more...}
90199
90233
  */
90200
- fetchSymbol(options?: WebStyleSymbolFetchSymbolOptions | null): Promise<PointSymbol3D>;
90234
+ fetchSymbol(options?: WebStyleSymbolFetchSymbolOptions | null): Promise<Symbol2D3DUnion>;
90201
90235
  static fromJSON(json: any): WebStyleSymbol;
90202
90236
  }
90203
90237
 
@@ -90233,6 +90267,7 @@ declare namespace __esri {
90233
90267
  }
90234
90268
 
90235
90269
  export interface WebStyleSymbolFetchSymbolOptions {
90270
+ acceptedFormats?: ("web" | "cim")[];
90236
90271
  signal?: AbortSignal | nullish;
90237
90272
  }
90238
90273
 
package/intl/locale.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{makeHandle as n}from"../core/handleUtils.js";let e,o;const t=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale,i=globalThis.document?.documentElement;function a(){const n=i?.getAttribute("lang"),e=globalThis.navigator?.language;return t??n??e??"en"}function r(){return void 0===o&&(o=a()),o}function l(n){e=n||void 0,b()}const c=/^(?<language>[a-z]{2,3})(?:-[a-z]{3})?(?:-[A-Z][a-z]{3})?(?:-(?<region>[A-Z]{2}|\d{3}))?(?:-.*)?$/;function u(n=r()){return c.exec(n)?.groups}function s(n=r()){const e=u(n)?.language;return"he"===e||"ar"===e}const g=[];function f(e){return g.push(e),n((()=>g.splice(g.indexOf(e),1)))}const h=[];function d(e){return h.push(e),n((()=>h.splice(h.indexOf(e),1)))}function b(){const n=e??a();o!==n&&([...h].forEach((e=>e(n))),o=n,[...g].forEach((e=>e(n))))}if(globalThis.addEventListener?.("languagechange",b),i){new MutationObserver((()=>{b()})).observe(i,{attributeFilter:["lang"]})}export{d as beforeLocaleChange,a as getDefaultLocale,r as getLocale,u as getLocaleParts,f as onLocaleChange,s as prefersRTL,l as setLocale};
5
+ import{makeHandle as e}from"../core/handleUtils.js";let n,t;const o=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale,i=globalThis.document?.documentElement;function l(){const e=i?.getAttribute("lang"),n=globalThis.navigator?.language;return o??e??n??"en"}function a(){return void 0===t&&(t=l()),t}function r(e){n=e||void 0,v()}const s=/^(?<language>[a-z]{2,3})(?:-[a-z]{3})?(?:-[A-Z][a-z]{3})?(?:-(?<region>[A-Z]{2}|\d{3}))?(?:-.*)?$/;function c(e=a()){return s.exec(e)?.groups}function u(e=a()){const n=c(e)?.language;return"he"===n||"ar"===n}const g=[];function d(){const e=g.length;0!==e&&console.warn(`Still ${e} locale change listeners active. This typically means a widget or view model was not properly destroyed. Also do not create widgets or view models at the module top-level or suite functions since that means they are alive until the suite runs.`)}function h(n){return g.push(n),e((()=>g.splice(g.indexOf(n),1)))}const f=[];function p(n){return f.push(n),e((()=>f.splice(f.indexOf(n),1)))}function v(){const e=n??l();t!==e&&([...f].forEach((n=>n(e))),t=e,[...g].forEach((n=>n(e))))}if(globalThis.addEventListener?.("languagechange",v),i){new MutationObserver((()=>{v()})).observe(i,{attributeFilter:["lang"]})}export{d as assertNoLocaleChangeListeners,p as beforeLocaleChange,l as getDefaultLocale,a as getLocale,c as getLocaleParts,h as onLocaleChange,u as prefersRTL,r as setLocale};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import r from"../../geometry/Extent.js";import e from"../../geometry/Point.js";import t from"../../geometry/support/GeographicTransformation.js";import s from"./PixelBlock.js";import{decode as o}from"./rasterFormats/RasterCodec.js";import{split as i,clipTile as n,mosaic as a,approximateTransform as l,getLocalArithmeticNorthRotations as m}from"./rasterFunctions/pixelUtils.js";import{create as c}from"./rasterFunctions/rasterFunctionHelper.js";import{requirePE as f,load as p,getProjectionOffsetGrid as u}from"./rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as S,estimateStatisticsHistograms as d}from"./rasterFunctions/stretchUtils.js";import{convertVectorFieldData as x,convertToLocalDirections as y}from"./rasterFunctions/vectorFieldUtils.js";import{readTransform as O}from"./rasterTransforms/utils.js";import h from"../../renderers/support/RasterSymbolizer.js";import{createFlowMesh as N}from"../../views/2d/engine/flow/dataUtils.js";class J{convertVectorFieldData(r){const e=s.fromJSON(r.pixelBlock),t=x(e,r.type);return Promise.resolve(null!=t?t.toJSON():null)}computeStatisticsHistograms(r){const e=s.fromJSON(r.pixelBlock),t=S(e);return Promise.resolve(t)}async decode(r){const e=await o(r.data,r.options);return e&&e.toJSON()}symbolize(e){e.pixelBlock=s.fromJSON(e.pixelBlock),e.extent=e.extent?r.fromJSON(e.extent):null;const t=this.symbolizer.symbolize(e);return Promise.resolve(null!=t?t.toJSON():null)}async updateSymbolizer(r){this.symbolizer=h.fromJSON(r.symbolizerJSON),r.histograms&&"rasterStretch"===this.symbolizer?.rendererJSON.type&&(this.symbolizer.rendererJSON.histograms=r.histograms)}async updateRasterFunction(r){this.rasterFunction=c(r.rasterFunctionJSON)}async process(t){const o=this.rasterFunction.process({extent:r.fromJSON(t.extent),primaryPixelBlocks:t.primaryPixelBlocks.map((r=>null!=r?s.fromJSON(r):null)),primaryPixelSizes:t.primaryPixelSizes?.map((r=>null!=r?e.fromJSON(r):null)),primaryRasterIds:t.primaryRasterIds});return null!=o?o.toJSON():null}stretch(r){const e=this.symbolizer.simpleStretch(s.fromJSON(r.srcPixelBlock),r.stretchParams);return Promise.resolve(e?.toJSON())}estimateStatisticsHistograms(r){const e=d(s.fromJSON(r.srcPixelBlock));return Promise.resolve(e)}split(r){const e=i(s.fromJSON(r.srcPixelBlock),r.tileSize,r.maximumPyramidLevel??0,!1===r.useBilinear);return e&&e.forEach(((r,t)=>{e.set(t,r?.toJSON())})),Promise.resolve(e)}clipTile(r){const e=s.fromJSON(r.pixelBlock),t=n({...r,pixelBlock:e});return Promise.resolve(t?.toJSON())}async mosaicAndTransform(r){const e=r.srcPixelBlocks.map((r=>r?new s(r):null)),t=a(e,r.srcMosaicSize,{blockWidths:r.blockWidths,alignmentInfo:r.alignmentInfo,clipOffset:r.clipOffset,clipSize:r.clipSize});let o,i=t;return r.coefs&&(i=l(t,r.destDimension,r.coefs,r.sampleSpacing,r.interpolation)),r.projectDirections&&r.gcsGrid&&(o=m(r.destDimension,r.gcsGrid),i=y(i,r.isUV?"vector-uv":"vector-magdir",o)),{pixelBlock:i?.toJSON(),localNorthDirections:o}}async createFlowMesh(r,e){const t={data:new Float32Array(r.flowData.buffer),mask:new Uint8Array(r.flowData.maskBuffer),width:r.flowData.width,height:r.flowData.height},{vertexData:s,indexData:o}=await N(r.meshType,r.simulationSettings,t,e.signal);return{result:{vertexBuffer:s.buffer,indexBuffer:o.buffer},transferList:[s.buffer,o.buffer]}}async getProjectionOffsetGrid(e){const s=r.fromJSON(e.projectedExtent),o=r.fromJSON(e.srcBufferExtent);let i=null;e.datumTransformationSteps&&(i=new t({steps:e.datumTransformationSteps})),(e.includeGCSGrid||f(s.spatialReference,o.spatialReference,i))&&await p();const n=e.rasterTransform?O(e.rasterTransform):null;return u({...e,projectedExtent:s,srcBufferExtent:o,datumTransformation:i,rasterTransform:n})}}export{J as default};
5
+ import r from"../../geometry/Extent.js";import e from"../../geometry/Point.js";import t from"../../geometry/operators/support/GeographicTransformation.js";import s from"./PixelBlock.js";import{decode as o}from"./rasterFormats/RasterCodec.js";import{split as i,clipTile as n,mosaic as a,approximateTransform as l,getLocalArithmeticNorthRotations as m}from"./rasterFunctions/pixelUtils.js";import{create as c}from"./rasterFunctions/rasterFunctionHelper.js";import{load as f,getProjectionOffsetGrid as p}from"./rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as u,estimateStatisticsHistograms as S}from"./rasterFunctions/stretchUtils.js";import{convertVectorFieldData as d,convertToLocalDirections as x}from"./rasterFunctions/vectorFieldUtils.js";import{readTransform as y}from"./rasterTransforms/utils.js";import h from"../../renderers/support/RasterSymbolizer.js";import{createFlowMesh as O}from"../../views/2d/engine/flow/dataUtils.js";class N{convertVectorFieldData(r){const e=s.fromJSON(r.pixelBlock),t=d(e,r.type);return Promise.resolve(null!=t?t.toJSON():null)}computeStatisticsHistograms(r){const e=s.fromJSON(r.pixelBlock),t=u(e);return Promise.resolve(t)}async decode(r){const e=await o(r.data,r.options);return e&&e.toJSON()}symbolize(e){e.pixelBlock=s.fromJSON(e.pixelBlock),e.extent=e.extent?r.fromJSON(e.extent):null;const t=this.symbolizer.symbolize(e);return Promise.resolve(null!=t?t.toJSON():null)}async updateSymbolizer(r){this.symbolizer=h.fromJSON(r.symbolizerJSON),r.histograms&&"rasterStretch"===this.symbolizer?.rendererJSON.type&&(this.symbolizer.rendererJSON.histograms=r.histograms)}async updateRasterFunction(r){this.rasterFunction=c(r.rasterFunctionJSON)}async process(t){const o=this.rasterFunction.process({extent:r.fromJSON(t.extent),primaryPixelBlocks:t.primaryPixelBlocks.map((r=>null!=r?s.fromJSON(r):null)),primaryPixelSizes:t.primaryPixelSizes?.map((r=>null!=r?e.fromJSON(r):null)),primaryRasterIds:t.primaryRasterIds});return null!=o?o.toJSON():null}stretch(r){const e=this.symbolizer.simpleStretch(s.fromJSON(r.srcPixelBlock),r.stretchParams);return Promise.resolve(e?.toJSON())}estimateStatisticsHistograms(r){const e=S(s.fromJSON(r.srcPixelBlock));return Promise.resolve(e)}split(r){const e=i(s.fromJSON(r.srcPixelBlock),r.tileSize,r.maximumPyramidLevel??0,!1===r.useBilinear);return e&&e.forEach(((r,t)=>{e.set(t,r?.toJSON())})),Promise.resolve(e)}clipTile(r){const e=s.fromJSON(r.pixelBlock),t=n({...r,pixelBlock:e});return Promise.resolve(t?.toJSON())}async mosaicAndTransform(r){const e=r.srcPixelBlocks.map((r=>r?new s(r):null)),t=a(e,r.srcMosaicSize,{blockWidths:r.blockWidths,alignmentInfo:r.alignmentInfo,clipOffset:r.clipOffset,clipSize:r.clipSize});let o,i=t;return r.coefs&&(i=l(t,r.destDimension,r.coefs,r.sampleSpacing,r.interpolation)),r.projectDirections&&r.gcsGrid&&(o=m(r.destDimension,r.gcsGrid),i=x(i,r.isUV?"vector-uv":"vector-magdir",o)),{pixelBlock:i?.toJSON(),localNorthDirections:o}}async createFlowMesh(r,e){const t={data:new Float32Array(r.flowData.buffer),mask:new Uint8Array(r.flowData.maskBuffer),width:r.flowData.width,height:r.flowData.height},{vertexData:s,indexData:o}=await O(r.meshType,r.simulationSettings,t,e.signal);return{result:{vertexBuffer:s.buffer,indexBuffer:o.buffer},transferList:[s.buffer,o.buffer]}}async getProjectionOffsetGrid(e){const s=r.fromJSON(e.projectedExtent),o=r.fromJSON(e.srcBufferExtent);let i=null;e.datumTransformationSteps?.length&&(i=new t({steps:e.datumTransformationSteps})),await f();const n=e.rasterTransform?y(e.rasterTransform):null;return p({...e,projectedExtent:s,srcBufferExtent:o,datumTransformation:i,rasterTransform:n})}}export{N as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import o from"../../core/Error.js";import{once as r}from"../../core/events.js";import s from"../../core/Logger.js";import{clamp as i}from"../../core/mathUtils.js";import{whenOnce as n}from"../../core/reactiveUtils.js";import{isAbsolute as l,makeAbsolute as a,getProxyRule as c,addProxy as d,isBlobProtocol as p,isDataProtocol as m}from"../../core/urlUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{writer as v}from"../../core/accessorSupport/decorators/writer.js";import y from"./MediaElementBase.js";import{mediaElementUrlProperty as g,mediaTypeProperty as f}from"./mediaUtils.js";import{VideoElementSymbol as j}from"../../support/mediaLayerUtils.js";import{i as w}from"../../chunks/persistableUrlUtils.js";var U;let b=class extends y{static{U=j}constructor(e){super(e),this.autoplay=!0,this.content=null,this.controller=null,this.type="video",this[U]=!0}load(){const e=this.video;return"string"==typeof e?this.addResolvingPromise(Promise.all([this._preProcessVideoUrl(e),import("../video/VideoController.js")]).then((async([e,{default:t}])=>{this.controller=new t,this.controller.playerUrl=e,await n((()=>this.controller?.element)),this.controller.loop=!0,this.controller.muted=!0,this.controller.playsInline=!0,this.controller.crossOrigin="anonymous",await n((()=>"can-play"===this.controller?.state)),await this.controller.play(),this.autoplay||this.controller.pause(),this._set("content",this.controller.element)}))):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)}))):this.addResolvingPromise(Promise.reject(new o("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}get currentTime(){return this.controller?.currentTime}set currentTime(e){if(!this.controller)return;const t=i(e,0,this.controller.duration);this.controller?.setCurrentTime(t)}get duration(){return this.controller?.duration}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):s.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,r,s){if(!e)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source is missing")));const i=V(e)?e:null;if(!i)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source must be an absolute url")));!l(i)&&s?.blockedRelativeUrls&&s.blockedRelativeUrls.push(i);const n=a(i);!w(n)?t[r]=n:s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source cannot be an item resource"))}async _preProcessVideoUrl(e){if(c(e))return d(e);try{return await t(e,{method:"head"}),e}catch{return d(e,!0)}}_loadVideo(e){return new Promise(((t,o)=>{const s=r(e,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,o):t()}));this.addHandles(s,"canplay"),"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",p(e.src)||(e.src=e.src))}))}};e([u()],b.prototype,"autoplay",void 0),e([u({readOnly:!0})],b.prototype,"content",void 0),e([u({readOnly:!0})],b.prototype,"contentWidth",null),e([u({readOnly:!0})],b.prototype,"contentHeight",null),e([u()],b.prototype,"controller",void 0),e([u({type:Number})],b.prototype,"currentTime",null),e([u({type:Number})],b.prototype,"duration",null),e([u(g)],b.prototype,"video",null),e([v("video")],b.prototype,"writeVideo",null),e([u(f)],b.prototype,"type",void 0),b=e([h("esri.layers.support.VideoElement")],b);const P=b;function V(e){return"string"==typeof e&&!m(e)&&!p(e)}export{P as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import o from"../../core/Error.js";import{once as r}from"../../core/events.js";import s from"../../core/Logger.js";import{clamp as i}from"../../core/mathUtils.js";import{isAbsolute as n,makeAbsolute as a,getProxyRule as c,addProxy as d,isBlobProtocol as p,isDataProtocol as l}from"../../core/urlUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../../core/accessorSupport/decorators/writer.js";import v from"./MediaElementBase.js";import{mediaElementUrlProperty as y,mediaTypeProperty as g}from"./mediaUtils.js";import{VideoElementSymbol as f}from"../../support/mediaLayerUtils.js";import{i as j}from"../../chunks/persistableUrlUtils.js";var b;let U=class extends v{static{b=f}constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video",this[b]=!0}load(){const e=this.video;return"string"==typeof e?this.addResolvingPromise(this._preProcessVideoUrl(e).then((async e=>{const t=document.createElement("video");return t.src=e,t.crossOrigin="anonymous",t.autoplay=!1,t.muted=!0,t.loop=!0,t.playsInline=!0,this._loadVideo(t).then((()=>{this._set("content",t)}))}))):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)}))):this.addResolvingPromise(Promise.reject(new o("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}get currentTime(){return this.content?.currentTime}set currentTime(e){if(!this.content)return;const t=i(e,0,this.content.duration);"fastSeek"in this.content?this.content.fastSeek(t):this.content.currentTime=t,this.content.play().then((()=>{this.content?.pause()})).catch((()=>{}))}get duration(){return this.content?.duration}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):s.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,r,s){if(!e)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source is missing")));const i=V(e)?e:null;if(!i)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source must be an absolute url")));!n(i)&&s?.blockedRelativeUrls&&s.blockedRelativeUrls.push(i);const c=a(i);!j(c)?t[r]=c:s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source cannot be an item resource"))}async _preProcessVideoUrl(e){if(c(e))return d(e);try{return await t(e,{method:"head"}),e}catch{try{return d(e,!0)}catch{return e}}}_loadVideo(e){return new Promise(((t,o)=>{const s=r(e,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,o):t()}));this.addHandles(s,"canplay"),"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",p(e.src)||(e.src=e.src))}))}};e([u()],U.prototype,"autoplay",void 0),e([u({readOnly:!0})],U.prototype,"content",void 0),e([u({readOnly:!0})],U.prototype,"contentWidth",null),e([u({readOnly:!0})],U.prototype,"contentHeight",null),e([u({type:Number})],U.prototype,"currentTime",null),e([u({type:Number})],U.prototype,"duration",null),e([u(y)],U.prototype,"video",null),e([h("video")],U.prototype,"writeVideo",null),e([u(g)],U.prototype,"type",void 0),U=e([m("esri.layers.support.VideoElement")],U);const w=U;function V(e){return"string"==typeof e&&!l(e)&&!p(e)}export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Error.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/Polygon.js";import o from"./BaseRaster.js";import{clip as n}from"../rasterFunctions/clipUtils.js";import{approximateTransform as a}from"../rasterFunctions/pixelUtils.js";import{projectPolygon as l}from"../rasterFunctions/rasterProjectionHelper.js";import c from"../../../rest/support/FeatureSet.js";const p=40;let m=class extends o{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(t,e,r,s={}){const{rasters:i,rasterIds:o}=this.primaryRasters;let l=!1;const{interpolation:c}=s,p=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&p&&(l=1===i.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:l});const m=i.map((i=>i.fetchPixels(t,e,r,s))),u=await Promise.all(m),h=u.map((t=>t.pixelBlock)),f=l||s.requestRawData?u.map((t=>t.srcTilePixelSize)):null;if(s.skipRasterFunction||h.every((t=>null==t)))return u[0];const d=u.find((t=>null!=t.pixelBlock))?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:o}):this.rasterFunction.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:o});const{transformGrid:g}=u[0];if(!l||null==y||null==g){const t=s.noClip?null:this.getClippingGeometry(d.spatialReference);return s.noClip||s.requestRawData||null==y||!t||(y=await n(y,d,t)),{...u[0],pixelBlock:y}}const x={rows:g.spacing[0],cols:g.spacing[1]};let R;if(this.rasterJobHandler){R=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:c,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock}else R=a(y,{width:e,height:r},g.coefficients,x,c);const w=s.noClip?null:this.getClippingGeometry(t.spatialReference);return s.noClip||s.requestRawData||null==R||null==w||(R=await n(R,t,w)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:R}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=f(t);let s=this._clippingGeometry.get(r);return null!=s||(s=t.equals(e.spatialReference)?e:l(e,t),this._clippingGeometry.set(r,s)),s}async _open(t){const{rasterFunction:r}=this;this.primaryRasters?.rasters?.length?r.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=r.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((t=>t.rasterJobHandler=this.rasterJobHandler)));const{rasters:s,rasterIds:i}=this.primaryRasters,o=s.map((e=>e.rasterInfo?void 0:e.open(t)));await Promise.all(o);const n=s.map((({rasterInfo:t})=>t)),a=r.bind({rasterInfos:n,rasterIds:i});if(r.rawSourceRasterInfos=n,!a.success||0===n.length)throw new e("raster-function:open",`cannot bind the function: ${a.error??""}`);const l="Table"===r.functionName?r:r.functionArguments?.raster;"Table"===l?.functionName&&(r.rasterInfo.attributeTable=c.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const p=n[0];this.hasUniqueSourceStorageInfo=1===n.length||n.slice(1).every((t=>h(t,p))),this.set("sourceJSON",s[0].sourceJSON),this.set("rasterInfo",r.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&"inside"===t.clippingType){const{extent:t}=this.rasterInfo,{difference:r,densify:s}=await import("../../../geometry/geometryEngine.js");let o=s(i.fromExtent(t),2*(t.width+t.height)/p);o=l(o,e.spatialReference),e=r(o,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};t([r({type:String,json:{write:!0}})],m.prototype,"datasetFormat",void 0),t([r()],m.prototype,"tileType",void 0),t([r()],m.prototype,"rasterFunction",void 0),t([r()],m.prototype,"primaryRasters",void 0),m=t([s("esri.layers.support.rasterDatasets.FunctionRaster")],m);const u=m;function h(t,e){const{storageInfo:r,pixelSize:s,spatialReference:i,extent:o}=t,{storageInfo:n,pixelSize:a,spatialReference:l,extent:c}=e;return s.x===a.x&&s.y===a.y&&i.equals(l)&&o.equals(c)&&r.blockHeight===n.blockHeight&&r.blockWidth===n.blockWidth&&r.maximumPyramidLevel===n.maximumPyramidLevel}function f(t){return String(t.wkid??t.wkt??t.wkt2)}export{u as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Error.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/Polygon.js";import o from"./BaseRaster.js";import{clip as a}from"../rasterFunctions/clipUtils.js";import{approximateTransform as n}from"../rasterFunctions/pixelUtils.js";import{projectPolygon as l}from"../rasterFunctions/rasterProjectionHelper.js";import c from"../../../rest/support/FeatureSet.js";const p=40;let m=class extends o{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(t,e,r,s={}){const{rasters:i,rasterIds:o}=this.primaryRasters;let l=!1;const{interpolation:c}=s,p=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&p&&(l=1===i.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:l});const m=i.map((i=>i.fetchPixels(t,e,r,s))),u=await Promise.all(m),h=u.map((t=>t.pixelBlock)),f=l||s.requestRawData?u.map((t=>t.srcTilePixelSize)):null;if(s.skipRasterFunction||h.every((t=>null==t)))return u[0];const d=u.find((t=>null!=t.pixelBlock))?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:o}):this.rasterFunction.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:o});const{transformGrid:g}=u[0];if(!l||null==y||null==g){const t=s.noClip?null:this.getClippingGeometry(d.spatialReference);return s.noClip||s.requestRawData||null==y||!t||(y=await a(y,d,t)),{...u[0],pixelBlock:y}}const x={rows:g.spacing[0],cols:g.spacing[1]};let R;if(this.rasterJobHandler){R=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:c,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock}else R=n(y,{width:e,height:r},g.coefficients,x,c);const w=s.noClip?null:this.getClippingGeometry(t.spatialReference);return s.noClip||s.requestRawData||null==R||null==w||(R=await a(R,t,w)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:R}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=f(t);let s=this._clippingGeometry.get(r);return null!=s||(s=t.equals(e.spatialReference)?e:l(e,t),this._clippingGeometry.set(r,s)),s}async _open(t){const{rasterFunction:r}=this;this.primaryRasters?.rasters?.length?r.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=r.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((t=>t.rasterJobHandler=this.rasterJobHandler)));const{rasters:s,rasterIds:i}=this.primaryRasters,o=s.map((e=>e.rasterInfo?void 0:e.open(t)));await Promise.all(o);const a=s.map((({rasterInfo:t})=>t)),n=r.bind({rasterInfos:a,rasterIds:i});if(r.rawSourceRasterInfos=a,!n.success||0===a.length)throw new e("raster-function:open",`cannot bind the function: ${n.error??""}`);const l="Table"===r.functionName?r:r.functionArguments?.raster;"Table"===l?.functionName&&(r.rasterInfo.attributeTable=c.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const p=a[0];this.hasUniqueSourceStorageInfo=1===a.length||a.slice(1).every((t=>h(t,p))),this.set("sourceJSON",s[0].sourceJSON),this.set("rasterInfo",r.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&"inside"===t.clippingType){const{extent:t}=this.rasterInfo,r=await import("../../../geometry/operators/densifyOperator.js"),s=await import("../../../geometry/operators/differenceOperator.js");let o=r.execute(i.fromExtent(t),2*(t.width+t.height)/p);o=l(o,e.spatialReference),e=s.execute(o,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};t([r({type:String,json:{write:!0}})],m.prototype,"datasetFormat",void 0),t([r()],m.prototype,"tileType",void 0),t([r()],m.prototype,"rasterFunction",void 0),t([r()],m.prototype,"primaryRasters",void 0),m=t([s("esri.layers.support.rasterDatasets.FunctionRaster")],m);const u=m;function h(t,e){const{storageInfo:r,pixelSize:s,spatialReference:i,extent:o}=t,{storageInfo:a,pixelSize:n,spatialReference:l,extent:c}=e;return s.x===n.x&&s.y===n.y&&i.equals(l)&&o.equals(c)&&r.blockHeight===a.blockHeight&&r.blockWidth===a.blockWidth&&r.maximumPyramidLevel===a.maximumPyramidLevel}function f(t){return String(t.wkid??t.wkt??t.wkt2)}export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import e from"../../../geometry/Extent.js";import i from"../../../geometry/Point.js";import n from"../PixelBlock.js";function a(e,i){if(e.spatialReference.equals(i))return e;const n=t(e.spatialReference),a=t(i);if(n===a)return e;const h=n/a;return{x:e.x*h,y:e.y*h}}async function h(t,e,i){if("extent"===i.type)return o(t,e,i);const{width:a,height:h}=t,m=new Uint8Array(a*h),{contains:l,intersects:s}=await import("../../../geometry/geometryEngine.js");return s(e,i)?"polyline"===i.type?r(t,e,i):l(i,e)?t:x(t,e,i):new n({pixelType:t.pixelType,width:a,height:h,mask:m,maskIsAlpha:!1,pixels:[...t.pixels]})}function x(t,e,i){if(!t)return t;const{width:a,height:h}=t,x=e.width/a,o=e.height/h,{xmin:r,ymax:m}=e;let l;if("extent"===i.type){const t=(i.xmin-r)/x,e=(i.xmax-r)/x,n=(m-i.ymax)/o,a=(m-i.ymin)/o;l=[[[t,n],[t,a],[e,a],[e,n],[t,n]]]}else l=i.rings.map((t=>t.map((([t,e])=>[(t-r)/x,(m-e)/o]))));const s=document.createElement("canvas");s.width=a,s.height=h;const p=s.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach((t=>{p.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)p.lineTo(t[e][0],t[e][1]);p.closePath()})),p.fill();const y=p.getImageData(0,0,a,h).data,f=t.mask,c=a*h,M=new Uint8Array(c);for(let n=0;n<c;n++)f&&!f[n]||(M[n]=y[4*n+3]>127?255:0);return new n({pixelType:t.pixelType,width:a,height:h,mask:M,maskIsAlpha:!1,pixels:[...t.pixels]})}function o(t,e,i){const{width:a,height:h}=t,x=new Uint8Array(a*h),o=e.width/a,r=e.height/h;if(i.width/o<.5||i.height/r<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});const{xmin:m,xmax:l,ymin:s,ymax:p}=e,{xmin:y,xmax:f,ymin:c,ymax:M}=i,u=Math.max(m,y),d=Math.min(l,f),w=Math.max(s,c),g=Math.min(p,M),T=.5*o,k=.5*r;if(d-u<T||g-w<k||d<m+T||u>l-T||w>p-k||g<s+k)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});const R=Math.max(0,(u-m)/o),A=Math.min(a,Math.max(0,(d-m)/o)),j=Math.max(0,(p-g)/r),U=Math.min(h,Math.max(0,(p-w)/r)),E=Math.round(R),P=Math.round(A)-1,S=Math.round(j),z=Math.round(U)-1;if(E===P&&R%1>.5&&A%1<.5||S===z&&j%1>.5&&U%1<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});if(0===E&&0===S&&P===a&&z===h)return t;const I=t.mask;for(let n=S;n<=z;n++)for(let t=E;t<=P;t++){const e=n*a+t;x[e]=I?I[e]:255}return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]})}function r(t,e,i){const{width:a,height:h}=t,x=new Uint8Array(a*h),o=e.width/a,r=e.height/h,{xmin:m,ymax:l}=e,{paths:s}=i,p=t.mask;for(let n=0;n<s.length;n++){const t=s[n];for(let e=0;e<t.length-1;e++){const[i,n]=t[e],[s,y]=t[e+1];let f=Math.floor((l-n)/r),c=Math.floor((l-y)/r);if(c<f){const t=f;f=c,c=t}f=Math.max(0,f),c=Math.min(h-1,c);const M=(s-i)/(y-n);for(let t=f;t<=c;t++){const e=t===f?Math.max(n,y):(h+1-t)*r,l=t===c?Math.min(n,y):e-r;let u=y===n?Math.floor((i-m)/o):Math.floor((M*(e-n)+i-m)/o),d=y===n?Math.floor((s-m)/o):Math.floor((M*(l-n)+i-m)/o);if(d<u){const t=u;u=d,d=t}const w=t*a;u=Math.max(0,u),d=Math.min(a-1,d);for(let t=w+u;t<=w+d;t++)x[t]=p?p[t]:255}}}return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]})}function m(t,e){const{extent:n}=l(t,e,new i({x:t.pixelSize.x,y:t.pixelSize.y,spatialReference:t.spatialReference})),{extent:a}=t.extent;if(n.xmax=Math.min(n.xmax,a.xmax),n.ymax=Math.min(n.ymax,a.ymax),n.xmin<n.xmax&&n.ymin<n.ymax){const{x:e,y:i}=t.pixelSize,a=Math.round(n.width/e),h=Math.round(n.height/i);t.extent=n,t.width=a,t.height=h}}function l(t,i,n,h=!0){const{spatialReference:x}=t,{x:o,y:r}=a(n,x);let m,l,s;const p="extent"===i.type?i:i.extent;let{xmin:y,xmax:f,ymax:c,ymin:M}=p;const{xmin:u,ymax:d}=t.extent;return h?(y=u+(y>u?o*Math.round((y-u)/o):0),c=d-(c<d?r*Math.round((d-c)/r):0),f=u+(f>u?o*Math.round((f-u)/o):0),M=d-(M<d?r*Math.round((d-M)/r):0),m=new e({xmin:y,ymax:c,xmax:f,ymin:M,spatialReference:x}),l=Math.round(m.width/o),s=Math.round(m.height/r)):(l=Math.floor((f-y)/o+.8),s=Math.floor((c-M)/r+.8),y=u+(y>u?o*Math.floor((y-u)/o+.1):0),c=d-(c<d?r*Math.floor((d-c)/r+.1):0),f=y+l*o,M=c-s*r,m=new e({xmin:y,ymax:c,xmax:f,ymin:M,spatialReference:x})),{extent:m,width:l,height:s}}export{h as clip,m as clipRasterInfo,l as snapToRaster};
5
+ import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import e from"../../../geometry/Extent.js";import i from"../../../geometry/Point.js";import n from"../PixelBlock.js";function a(e,i){if(e.spatialReference.equals(i))return e;const n=t(e.spatialReference),a=t(i);if(n===a)return e;const h=n/a;return{x:e.x*h,y:e.y*h}}async function h(t,e,i){if("extent"===i.type)return r(t,e,i);const{width:a,height:h}=t,m=new Uint8Array(a*h);if(!(await import("../../../geometry/operators/intersectsOperator.js")).execute(e,i))return new n({pixelType:t.pixelType,width:a,height:h,mask:m,maskIsAlpha:!1,pixels:[...t.pixels]});if("polyline"===i.type)return x(t,e,i);return(await import("../../../geometry/operators/containsOperator.js")).execute(i,e)?t:o(t,e,i)}function o(t,e,i){if(!t)return t;const{width:a,height:h}=t,o=e.width/a,r=e.height/h,{xmin:x,ymax:m}=e;let l;if("extent"===i.type){const t=(i.xmin-x)/o,e=(i.xmax-x)/o,n=(m-i.ymax)/r,a=(m-i.ymin)/r;l=[[[t,n],[t,a],[e,a],[e,n],[t,n]]]}else l=i.rings.map((t=>t.map((([t,e])=>[(t-x)/o,(m-e)/r]))));const s=document.createElement("canvas");s.width=a,s.height=h;const p=s.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach((t=>{p.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)p.lineTo(t[e][0],t[e][1]);p.closePath()})),p.fill();const y=p.getImageData(0,0,a,h).data,f=t.mask,c=a*h,u=new Uint8Array(c);for(let n=0;n<c;n++)f&&!f[n]||(u[n]=y[4*n+3]>127?255:0);return new n({pixelType:t.pixelType,width:a,height:h,mask:u,maskIsAlpha:!1,pixels:[...t.pixels]})}function r(t,e,i){const{width:a,height:h}=t,o=new Uint8Array(a*h),r=e.width/a,x=e.height/h;if(i.width/r<.5||i.height/x<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]});const{xmin:m,xmax:l,ymin:s,ymax:p}=e,{xmin:y,xmax:f,ymin:c,ymax:u}=i,M=Math.max(m,y),w=Math.min(l,f),d=Math.max(s,c),g=Math.min(p,u),T=.5*r,k=.5*x;if(w-M<T||g-d<k||w<m+T||M>l-T||d>p-k||g<s+k)return new n({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]});const R=Math.max(0,(M-m)/r),j=Math.min(a,Math.max(0,(w-m)/r)),A=Math.max(0,(p-g)/x),U=Math.min(h,Math.max(0,(p-d)/x)),P=Math.round(R),S=Math.round(j)-1,z=Math.round(A),E=Math.round(U)-1;if(P===S&&R%1>.5&&j%1<.5||z===E&&A%1>.5&&U%1<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]});if(0===P&&0===z&&S===a&&E===h)return t;const I=t.mask;for(let n=z;n<=E;n++)for(let t=P;t<=S;t++){const e=n*a+t;o[e]=I?I[e]:255}return new n({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]})}function x(t,e,i){const{width:a,height:h}=t,o=new Uint8Array(a*h),r=e.width/a,x=e.height/h,{xmin:m,ymax:l}=e,{paths:s}=i,p=t.mask;for(let n=0;n<s.length;n++){const t=s[n];for(let e=0;e<t.length-1;e++){const[i,n]=t[e],[s,y]=t[e+1];let f=Math.floor((l-n)/x),c=Math.floor((l-y)/x);if(c<f){const t=f;f=c,c=t}f=Math.max(0,f),c=Math.min(h-1,c);const u=(s-i)/(y-n);for(let t=f;t<=c;t++){const e=t===f?Math.max(n,y):(h+1-t)*x,l=t===c?Math.min(n,y):e-x;let M=y===n?Math.floor((i-m)/r):Math.floor((u*(e-n)+i-m)/r),w=y===n?Math.floor((s-m)/r):Math.floor((u*(l-n)+i-m)/r);if(w<M){const t=M;M=w,w=t}const d=t*a;M=Math.max(0,M),w=Math.min(a-1,w);for(let t=d+M;t<=d+w;t++)o[t]=p?p[t]:255}}}return new n({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]})}function m(t,e){const{extent:n}=l(t,e,new i({x:t.pixelSize.x,y:t.pixelSize.y,spatialReference:t.spatialReference})),{extent:a}=t.extent;if(n.xmax=Math.min(n.xmax,a.xmax),n.ymax=Math.min(n.ymax,a.ymax),n.xmin<n.xmax&&n.ymin<n.ymax){const{x:e,y:i}=t.pixelSize,a=Math.round(n.width/e),h=Math.round(n.height/i);t.extent=n,t.width=a,t.height=h}}function l(t,i,n,h=!0){const{spatialReference:o}=t,{x:r,y:x}=a(n,o);let m,l,s;const p="extent"===i.type?i:i.extent;let{xmin:y,xmax:f,ymax:c,ymin:u}=p;const{xmin:M,ymax:w}=t.extent;return h?(y=M+(y>M?r*Math.round((y-M)/r):0),c=w-(c<w?x*Math.round((w-c)/x):0),f=M+(f>M?r*Math.round((f-M)/r):0),u=w-(u<w?x*Math.round((w-u)/x):0),m=new e({xmin:y,ymax:c,xmax:f,ymin:u,spatialReference:o}),l=Math.round(m.width/r),s=Math.round(m.height/x)):(l=Math.floor((f-y)/r+.8),s=Math.floor((c-u)/x+.8),y=M+(y>M?r*Math.floor((y-M)/r+.1):0),c=w-(c<w?x*Math.floor((w-c)/x+.1):0),f=y+l*r,u=c-s*x,m=new e({xmin:y,ymax:c,xmax:f,ymin:u,spatialReference:o})),{extent:m,width:l,height:s}}export{h as clip,m as clipRasterInfo,l as snapToRaster};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import i from"../../../geometry/Extent.js";import{P as o,a as r,g as s,h as a,j as l}from"../../../chunks/pe.js";import c from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{canProjectWithoutEngine as u,isLoaded as m,load as x,getTransformation as h,project as p}from"../../../geometry/projection.js";import g from"../../../geometry/SpatialReference.js";import{getInfo as y}from"../../../geometry/support/spatialReferenceUtils.js";var d;function w(e,t,n){return!u(e,t,n)}function M(e,n,i){const o=w(e,n,i);if(o&&!m())throw new t("rasterprojectionhelper-project","projection engine is not loaded");return o}!function(e){e[e.None=0]="None",e[e.North=1]="North",e[e.South=2]="South",e[e.Both=3]="Both"}(d||(d={}));const R=(e,t,n,i=0)=>{if(1===n[0])return[0,0];let o=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(o=o>e[g]?e[g]:o,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-o)/l/n[0],u=(a-s)/c/n[1],m=2*i;let x=0,h=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,i=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,o=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((i-e[n+2*c+2])/f),s=Math.abs((o-e[n+2*c+3])/u);if(r+s>x&&(x=r+s,p=[r,s]),m&&x>m){h=!0;break}}if(h)break}return p},S={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},P=32,b=4,G=b,k=new Map,E=new Map,N=500,T=39.37,v=96;let C=null;async function j(){C&&m()||(m()||await x(),C=await import("../../../geometry/geometryEngine.js"))}function _(e,t,n){M(e.spatialReference,t);return n?h(t,e.spatialReference,e):h(e.spatialReference,t,e)}function z(e,t,n,o=null){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;M(r,t,o);const s=n.center,a=new i({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=p(a,t,o),c=te(t);return null==l||null!=c&&l.width>=c?L(e,r,t):{x:l.width,y:l.height}}function L(e,t,i){const o=n(t)/n(i);return{x:e.x*o,y:e.y*o}}function I(e,i,o){const{spatialReference:r}=o;if(!r||!i||r.equals(i))return e;if(r.isGeographic&&i.isGeographic)return L(e,r,i);if(M(r,i),!C)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*n(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const u=256,m=s*u/2,x=a*u/2,{x:h,y:g}=o.center,y=[];for(let t=0;t<=u;t++)y.push([h-m,g-x+t*a]);for(let t=1;t<=u;t++)y.push([h-m+t*s,g+x]);for(let t=1;t<=u;t++)y.push([h+m,g+x-t*a]);for(let t=1;t<u;t++)y.push([h+m-t*s,g-x]);y.push(y[0]);const d=new f({rings:[y],spatialReference:r}),w=p(d,i);if(!w)return L(e,r,i);const R=w.extent,S=te(i);if(null==R||null!=S&&R.width>=S)return L(e,r,i);const P=C.planarArea(w),b=s*a*u*u,G=Math.sqrt(P/b)/c,k={x:R.width/c/u,y:R.height/c/u},E={x:s*G,y:a*G},N=k.x*k.y;return Math.abs(N-E.x*E.y)/N<.1?k:E}function W(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*n(t)*v*T}function O(e,t){const{pixelSize:n,extent:i}=e;return W(I(n,t,i),t)}function A(e,t=.01){return n(e)?t/n(e):0}function B(e,t,n=null,i=!0){const o=e.spatialReference;if(o.equals(t))return e;M(o,t,n);const r=p(e,t,n);return i&&r?(F([e],[r],o,t),r):r}function F(e,t,n,i){const o=ne(n,!0),r=ne(i,!0),s=A(n,N),a=A(i,N);if(s&&null!=o&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:i}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(i-o[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(i-o[1])<s&&(n.x+=r[1]-r[0])}}function q(e){const{inSR:t,outSR:n,datumTransformation:i,preferPE:o}=e;if(t.equals(n)){const{points:t}=D(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return U(e);if(M(t,n,i)&&o){if(t.isGeographic)return J(e);if(null!=X(t))return J(e)}return Y(e)}function Y(e){const{points:t}=D(e,null),{inSR:n,outSR:i,datumTransformation:o}=e,r=t.map((e=>new c(e[0],e[1],n))),s=p(r,i,o);return o&&F(r,s,n,i),s.map((e=>e?[e.x,e.y]:[NaN,NaN]))}function J(e){const{inSR:t,outSR:n,datumTransformation:i}=e,l=X(t),{points:c,mask:f}=D(e,l);if(!t.isGeographic){const e=t.wkid?o.coordsys(t.wkid):o.fromString(t.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,t.wkt2||t.wkt);s.projToGeog(e,c.length,c)}if(null!=i&&i.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=c.map((([e])=>e>t?1:e<-179.9955?-1:0))),i.steps.forEach((e=>{const t=e.wkid?o.geogtran(e.wkid):o.fromString(r.PE_TYPE_GEOGTRAN,e.wkt);a.geogToGeog(t,c.length,c,null,e.isInverse?r.PE_TRANSFORM_2_TO_1:r.PE_TRANSFORM_1_TO_2)})),e)for(let n=0;n<c.length;n++){const i=e[n],o=c[n][0],r=o>t?1:o<-179.9955?-1:0;i&&r&&i!==r&&(c[n][0]=i>0?o+360:o-360)}}if(!n.isGeographic){const e=X(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];H(c,t);const i=n.wkid?o.coordsys(n.wkid):o.fromString(n.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,n.wkt2||n.wkt);s.geogToProj(i,c.length,c)}let u=c;if(f&&c.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(c[t++]):u.push([NaN,NaN])}return u}function U(e){const{cols:t,rows:n,xres:i,yres:o,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:f}=e;r&&(l+=i/2,f-=o/2);const u=[],m=[],x=Math.max(t,n);for(let g=0;g<x;g++){const e=l+i*Math.min(t,g),r=f-o*Math.min(n,g),x=p(new c({x:e,y:r,spatialReference:s}),a);g<=t&&u.push(x.x),g<=n&&m.push(x.y)}const h=[];for(let c=0;c<t;c++)for(let e=0;e<n;e++)h.push([u[c],m[e]]);return h}function X(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),k.has(n)){const e=k.get(n);return t?e?.gcs:e?.pcs}const i=e.wkid?o.coordsys(e.wkid):o.fromString(e.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,e.wkt2||e.wkt),s=K(i,A(e,1e-4)),a=K(i,0,!0);return k.set(n,{pcs:s,gcs:a}),t?a:s}function K(e,t=0,n=!1){const i=l.generate(e),o=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!i||!o?.length)return null;let r=!1,s=o.find((e=>1===e.getInclusive()&&1===e.getKind()));if(!s){if(s=o.find((e=>1===e.getInclusive()&&0===e.getKind())),!s)return null;r=!0}const a=n?0:(2===i.getNorthPoleLocation()?1:0)|(2===i.getSouthPoleLocation()?2:0),c=i.isPannableRectangle(),f=s.getCoord();if(r)return{isEnvelope:r,isPannable:c,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:a};let u=0;const m=[];let[x,h]=f[0],[p,g]=f[0];for(let l=0,y=f.length;l<y;l++){u++,u===y&&(u=0);const[e,t]=f[l],[n,i]=f[u];if(i===t)m.push([e,n,t,i,2]);else{const o=(n-e)/(i-t||1e-4),r=e-o*t;t<i?m.push([o,r,t,i,0]):m.push([o,r,i,t,1])}x=x<e?x:e,h=h<t?h:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:c,vertices:f,coef:m,bbox:[x,h,p,g],poleLocation:a}}function D(e,t){const n=[],{cols:i,rows:o,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<i;e++)for(let t=0;t<o;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(i*o);if(t.isEnvelope){const{bbox:[e,a,u,m]}=t;for(let x=0,h=0;x<i;x++){const i=l+r*x,p=t.isPannable||i>=e&&i<=u;for(let e=0;e<o;e++,h++){const t=c-s*e;p&&t>=a&&t<=m&&(n.push([i,t]),f[h]=1)}}return{points:n,mask:f}}const u=t.coef,m=[];for(let x=0;x<o;x++){const e=c-s*x,t=[],n=[];for(let o=0;o<u.length;o++){const[i,r,s,a,l]=u[o];if(e===s&&s===a)t.push(i),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const o=i*e+r;t.push(o),n.push(l)}}let i=t;if(t.length>2){let e=2===n[0]?0:n[0],o=t[0];i=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(i.push(0===e?Math.min(o,t[r-1]):Math.max(o,t[r-1])),e=n[r],o=t[r]),r===n.length-1&&i.push(0===n[r]?Math.min(o,t[r]):Math.max(o,t[r])));i.sort(((e,t)=>e-t))}else t[0]>t[1]&&(i=[t[1],t[0]]);m.push(i)}for(let x=0,h=0;x<i;x++){const e=l+r*x;for(let t=0;t<o;t++,h++){const i=c-s*t,o=m[t];if(2===o.length)e>=o[0]&&e<=o[1]&&(n.push([e,i]),f[h]=1);else if(o.length>2){let t=!1;for(let n=0;n<o.length;n+=2)if(e>=o[n]&&e<=o[n+1]){t=!0;break}t&&(n.push([e,i]),f[h]=1)}}}return{points:n,mask:f}}function H(e,t){const[n,i]=t;for(let o=0;o<e.length;o++){const t=e[o][1];(t<n||t>i)&&(e[o]=[NaN,NaN])}}function Q(e,t){const n=te(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??A(e[0].spatialReference),1===(e=e.filter((e=>e.width>t))).length)return e[0];let{xmin:o,xmax:r,ymin:s,ymax:a}=e[0];for(let i=1;i<e.length;i++){const t=e[i];r=t.xmax+n*i,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new i({xmin:o,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function V(t,n,o=null,r=!0){const s=t.spatialReference;if(s.equals(n))return t;const a=oe(t),l=te(s,!0),c=te(n);if(0===a||null==l||null==c){const e=ee(t,n,o,r);if(null==l&&null!=c&&Math.abs(e.width-c)<A(n)&&m()){const i=X(s);if(null!=i&&i.poleLocation===d.None&&t.width<(i.bbox[2]-i.bbox[0])/2)return $(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>A(s)){const{xmin:e,xmax:n}=t;for(let o=0;o<=a;o++){const r=0===o?e:-l/2,c=o===a?n-l*o:l/2;f[o]=new i({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}return Q(f.map((e=>ee(e,n,o,r))).filter(e))}function Z(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:i,ymax:o,spatialReference:r}=e;e=new f({rings:[[[t,o],[i,o],[i,n],[t,n],[t,o]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(M(e.spatialReference,t,n),p(e,t,n))}function $(e,t){const n=te(t);if(null==n)return null;let{xmin:o,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new f({spatialReference:l,rings:[[[o,r],[s,r],[s,a],[o,a],[o,r]]]}),u=p(c,t);if(2!==u.rings.length||!u.rings[0].length||!u.rings[1].length)return null;const{rings:m}=u,x=A(l),h=new i({spatialReference:t});for(let i=0;i<2;i++){o=s=m[i][0][0],r=a=m[i][0][1];for(let e=0;e<m[i].length;e++)o=o>m[i][e][0]?m[i][e][0]:o,s=s<m[i][e][0]?m[i][e][0]:s,r=r>m[i][e][1]?m[i][e][1]:r,a=a<m[i][e][1]?m[i][e][1]:a;if(0===i)h.ymin=r,h.ymax=a,h.xmin=o,h.xmax=s;else if(h.ymin=Math.min(h.ymin,r),h.ymax=Math.max(h.ymax,a),Math.abs(s-n/2)<x)h.xmin=o,h.xmax=h.xmax+n;else{if(!(Math.abs(o+n/2)<x))return null;h.xmax=s+n}}return h}function ee(e,t,n=null,i=!0,o=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;M(r,t,n);const s=p(e,t,n);if(o&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!i||!s)return s;const a=ne(r,!0),l=ne(t,!0);if(null==a||null==l)return s;const f=A(r,.001),u=A(r,N),m=A(t,.001);if(Math.abs(s.xmin-l[0])<m&&Math.abs(s.xmax-l[1])<m){const i=Math.abs(e.xmin-a[0]),o=Math.abs(a[1]-e.xmax);if(i<f&&o>u){s.xmin=l[0];const i=[];i.push(new c(e.xmax,e.ymin,r)),i.push(new c(e.xmax,(e.ymin+e.ymax)/2,r)),i.push(new c(e.xmax,e.ymax,r));const o=i.map((e=>B(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmax=Math.max.apply(null,o)}if(o<f&&i>u){s.xmax=l[1];const i=[];i.push(new c(e.xmin,e.ymin,r)),i.push(new c(e.xmin,(e.ymin+e.ymax)/2,r)),i.push(new c(e.xmin,e.ymax,r));const o=i.map((e=>B(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmin=Math.min.apply(null,o)}}else{const e=A(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function te(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*S[e.wkid]||null}function ne(e,t=!1){if(e.isGeographic)return[-180,180];const n=te(e,t);return null!=n?[-n/2,n/2]:null}function ie(e,t,n,i){let o=(e-t)/n;return o-Math.floor(o)!=0?o=Math.floor(o):i&&(o-=1),o}function oe(e,t=!1){const n=te(e.spatialReference);if(null==n)return 0;const i=t?0:-(n/2),o=A(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<o?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<o?-n/2:e.xmin;return ie(r,i,n,!0)-ie(s,i,n,!1)}function re(e){const t=e.storageInfo.origin.x,n=te(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const i=n/2,{nativePixelSize:o,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=o.x;const u=[],m=null!=e.transform&&"gcs-shift"===e.transform.type,x=t+(m?0:i),h=m?n-t:i-t;for(let p=0;p<=a;p++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)==0?e:Math.ceil(e),i=h/f/l,o=i-Math.floor(i)==0?i:Math.ceil(i),r=Math.floor(x/f/l),a=Math.round(x/f)%l,m=(l-Math.round(h/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:o,leftMargin:a,rightPadding:m,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:i,pyramidsInfo:u,hasGCSSShiftTransform:m}}function se(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(E.has(t))n=E.get(t);else{n=(e.wkid?o.coordsys(e.wkid):o.fromString(r.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),E.set(t,n)}return new g({wkid:n})}function ae(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[P,P],i=le(e),o={cols:i.size[0]+1,rows:i.size[1]+1};const r=i.outofBoundPointCount>0&&i.outofBoundPointCount<i.offsets.length/2;let s=i.outofBoundPointCount===i.offsets.length/2||t&&r?[0,0]:R(i.offsets,o,n,G);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>G)){w(l,c,e.datumTransformation)&&(l.isGeographic||X(l)),n=[b,b],i=le({...e,spacing:n}),o={cols:i.size[0]+1,rows:i.size[1]+1},s=R(i.offsets,o,n,G)}if(i.error=s,n[0]>1&&(i.coefficients=ce(i.offsets,o,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)i.gcsGrid={offsets:i.offsets,coefficients:i.coefficients,spacing:n};else{const t=X(l);if(null!=t&&!t.isEnvelope){const t=se(l),s=V(e.projectedExtent,t),{offsets:a}=le({...e,srcBufferExtent:s,spacing:n}),c=ce(a,o,r);i.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return i}function le(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:i,datumTransformation:o,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference,l=M(s,a),{xmin:f,ymin:u,xmax:m,ymax:x}=t,h=te(a),p=null!=h&&(e.hasWrapAround||"gcs-shift"===r?.type),g=e.spacing||[P,P],y=g[0]*i.x,d=g[1]*i.y,w=1===g[0],R=Math.ceil((m-f)/y-.1/g[0])+(w?0:1),S=Math.ceil((x-u)/d-.1/g[1])+(w?0:1),G=q({cols:R,rows:S,xmin:f,ymax:x,xres:y,yres:d,inSR:s,outSR:a,datumTransformation:o,preferPE:g[0]<=b,usePixelCenter:w}),k=[];let E,T=0;const v=w?-1:NaN,{xmin:C,xmax:j,ymax:_,width:z,height:L}=n,I=A(a,N),W=null!=h&&C>0&&j>h/2;let O=!1;if(l){const e=X(s);O=null!=e&&e.poleLocation>0}for(let M=0;M<R;M++){const e=[];for(let t=0;t<S;t++){let n=G[M*S+t];if(p&&n[0]>j&&n[0]>h/2-I?n[0]-=h:p&&0===M&&n[0]<0&&W&&!r&&(n[0]+=h),!n||isNaN(n[0])||isNaN(n[1]))k.push(v),k.push(v),e.push(null),T++;else{if(r){const e=r.inverseTransform(new c({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),M>0&&p&&E[t]&&n[0]<E[t][0]&&(n[0]+=h,O&&n[0]>j&&n[0]>h&&(n[0]-=h)),k.push((n[0]-C)/z),k.push((_-n[1])/L)}}E=e}return{offsets:k,error:null,coefficients:null,outofBoundPointCount:T,spacing:g,size:w?[R,S]:[R-1,S-1]}}function ce(e,t,n){const{cols:i,rows:o}=t,r=new Float32Array((i-1)*(o-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<i-1;l++){for(let t=0;t<o-1;t++){let n=l*o*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],m=e[n+3];n+=2*o;const x=e[n],h=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(i-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*m+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*x+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function fe(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:Q(n,t)}function ue(e){const{spatialReference:t}=e,n=y(t);if(!n)return e;const[o,r]=n.valid,s=r-o;let a=0;if(e.xmin<o){const t=o-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new i({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function me(e,t,i){const{storageInfo:o,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=o,f="mixed"===o.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,o.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/f;if(null!=l&&l.length){const e=l[l.length-1],o=(e.x+e.y)/2,f=(r.x+r.y)/2;if(u<=f)s=0;else if(u>=o)s=l.length,a=u/o>8;else{let e,t=f;for(let n=1;n<=l.length;n++){if(e=(l[n-1].x+l[n-1].y)/2,u<=e){u===e?s=n:"down"===i?(s=n-1,a=u/t>8):s="up"===i||u-t>e-u||u/t>2?n:n-1;break}t=e}}const m=0===s?r:l[s-1];if(a){Math.min(m.x,m.y)*n(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new c({x:m.x,y:m.y,spatialReference:t.spatialReference}),excessiveReading:a}}const m=Math.log(e.x/r.x)/Math.LN2,x=Math.log(e.y/r.y)/Math.LN2,h=t.storageInfo.maximumPyramidLevel||0;s="down"===i?Math.floor(Math.min(m,x)):"up"===i?Math.ceil(Math.max(m,x)):Math.round((m+x)/2),s<0?s=0:s>h&&(a=s>h+3,s=h);const p=2**s;return{pyramidLevel:s,pyramidResolution:new c({x:p*t.nativePixelSize.x,y:p*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function xe(e,t,n=!1){const{pixelSize:i,extent:o}=e,r=_(o,t,!1),s=V(fe(o,(i.x+i.y)/16),t,r);return n||0===oe(s)?s:ee(o,t,r)}function he(e,t,n){const i=n?.tileSize??512,o=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,spatialReference:a,pixelSize:l}=e,c=I(l,t,s);if(null==c)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const f=(c.x+c.y)/2,u=W(f,t),m=t.isGeographic?256/i*295828763.7958547:256/i*591657527.591555;let x="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const h=xe(e,t,!0),p=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(m/2/u)/Math.LN2));if(!x&&o&&(t.isGeographic||t.isWebMercator)){const n=te(t);if(x=oe(h)>0||null!=n&&h.width>n/4,!x&&null!=n){let t=-1;if(p<3)t=2**p*f*i;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:o=2}=e.storageInfo;t=o**n*f*i}const o=Math.ceil(n/t);x=1===o||2===o&&n/2-h.xmax<t}}let y,d=u;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(x){d=m;const n=t.isGeographic?1341104507446289e-21:.29858214164761665,i=W(n,t),o=t.isGeographic?4326:3857;y=I({x:n,y:n},a,xe(e,new g({wkid:o}),!0)),y.x*=d/i,y.y*=d/i}else{y={x:l.x,y:l.y};let e=0;for(;d<m*(w/2)&&e<p;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,m)/Math.min(d,m)<=w&&(d=m)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,u)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*l.x;let t=S.findIndex((t=>t.x>=l.x-e&&t.x<=l.x+e));t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex((t=>t.x<=l.x+e)),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:c,scales:R,srcResolutions:S,isCustomTilingScheme:!x}}export{he as computeProjectedScales,P as defaultGridSpacing,G as defaultProjectionToleranceInPixels,_ as getDefaultDatumTransformationForDataset,q as getProjectedGridPoints,ae as getProjectionOffsetGrid,re as getRasterDatasetAlignmentInfo,O as getSourceScale,te as getWorldWidth,oe as getWorldWrapCount,j as load,b as minimumGridSpacing,xe as projectDatasetExtent,I as projectDatasetResolution,V as projectExtent,B as projectPoint,Z as projectPolygon,z as projectResolution,w as requirePE,ue as shiftExtent,fe as snapExtent,me as snapPyramid};
5
+ import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{createResolver as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../../../core/unitUtils.js";import i from"../../../geometry/Extent.js";import{P as r,a as s,g as a,h as l,j as c}from"../../../chunks/pe.js";import f from"../../../geometry/Point.js";import u from"../../../geometry/Polygon.js";import{projectWithoutEngine as m}from"../../../geometry/projection.js";import x from"../../../geometry/SpatialReference.js";import{getInfo as h}from"../../../geometry/support/spatialReferenceUtils.js";var p;function g(){if(!j)throw new t("rasterprojectionhelper-project","projection operator is not loaded")}!function(e){e[e.None=0]="None",e[e.North=1]="North",e[e.South=2]="South",e[e.Both=3]="Both"}(p||(p={}));const y=(e,t,n,o=0)=>{if(1===n[0])return[0,0];let i=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(i=i>e[g]?e[g]:i,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-i)/l/n[0],u=(a-s)/c/n[1],m=2*o;let x=0,h=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,o=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,i=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((o-e[n+2*c+2])/f),s=Math.abs((i-e[n+2*c+3])/u);if(r+s>x&&(x=r+s,p=[r,s]),m&&x>m){h=!0;break}}if(h)break}return p},d={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},w=32,M=4,R=M,S=new Map,P=new Map,b=500,G=39.37,k=96;let N,E,T,j=!1;async function v(){return N||(N=n(),E=await import("../../../geometry/operators/projectOperator.js"),T=await import("../../../geometry/operators/support/geographicTransformationUtils.js"),E.isLoaded()||await E.load(),T.isLoaded()||await T.load(),j=!0,N.resolve()),N.promise}function C(e,t,n){if(g(),n){const n=E.execute(e,t);return T.getTransformation(t,e.spatialReference,n)}return T.getTransformation(e.spatialReference,t,e)}function _(e,t,n,o){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;g();const s=n.center,a=new i({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=E.execute(a,t,{geographicTransformation:o}),c=ee(t);return null==l||null!=c&&l.width>=c?z(e,r,t):{x:l.width,y:l.height}}function z(e,t,n){const i=o(t)/o(n);return{x:e.x*i,y:e.y*i}}function L(e,n,i){const{spatialReference:r}=i;if(!r||!n||r.equals(n))return e;if(r.isGeographic&&n.isGeographic)return z(e,r,n);if(g(),!j)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*o(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const f=256,m=s*f/2,x=a*f/2,{x:h,y:p}=i.center,y=[];for(let t=0;t<=f;t++)y.push([h-m,p-x+t*a]);for(let t=1;t<=f;t++)y.push([h-m+t*s,p+x]);for(let t=1;t<=f;t++)y.push([h+m,p+x-t*a]);for(let t=1;t<f;t++)y.push([h+m-t*s,p-x]);y.push(y[0]);const d=new u({rings:[y],spatialReference:r}),w=E.execute(d,n);if(!w)return z(e,r,n);const M=w.extent,R=ee(n);if(null==M||null!=R&&M.width>=R)return z(e,r,n);const S=he(w.rings),P=s*a*f*f,b=Math.sqrt(S/P)/c,G={x:M.width/c/f,y:M.height/c/f},k={x:s*b,y:a*b},N=G.x*G.y;return Math.abs(N-k.x*k.y)/N<.1?G:k}function I(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*o(t)*k*G}function O(e,t){const{pixelSize:n,extent:o}=e;return I(L(n,t,o),t)}function W(e,t=.01){return o(e)?t/o(e):0}function A(e,t,n,o=!0){const i=e.spatialReference;if(i.equals(t))return e;g();const r=E.execute(e,t,{geographicTransformation:n});return o&&r?(B([e],[r],i,t),r):r}function B(e,t,n,o){const i=te(n,!0),r=te(o,!0),s=W(n,b),a=W(o,b);if(s&&null!=i&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:o}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(o-i[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(o-i[1])<s&&(n.x+=r[1]-r[0])}}function F(e){const{inSR:t,outSR:n,preferPE:o}=e;if(t.equals(n)){const{points:t}=K(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return U(e);if(o){if(t.isGeographic)return Y(e);if(null!=J(t))return Y(e)}return q(e)}function q(e){const{points:t}=K(e,null),{inSR:n,outSR:o,datumTransformation:i}=e,r=t.map((e=>new f(e[0],e[1],n))),s=E.executeMany(r,o,{geographicTransformation:i});return i&&B(r,s,n,o),s.map((e=>e?[e.x,e.y]:[NaN,NaN]))}function Y(e){const{inSR:t,outSR:n,datumTransformation:o}=e,i=J(t),{points:c,mask:f}=K(e,i);if(!t.isGeographic){const e=t.wkid?r.coordsys(t.wkid):r.fromString(t.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,t.wkt2||t.wkt);a.projToGeog(e,c.length,c)}if(null!=o&&o.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=c.map((([e])=>e>t?1:e<-179.9955?-1:0))),o.steps.forEach((e=>{const t=e.wkid?r.geogtran(e.wkid):r.fromString(s.PE_TYPE_GEOGTRAN,e.wkt);l.geogToGeog(t,c.length,c,null,e.isInverse?s.PE_TRANSFORM_2_TO_1:s.PE_TRANSFORM_1_TO_2)})),e)for(let n=0;n<c.length;n++){const o=e[n],i=c[n][0],r=i>t?1:i<-179.9955?-1:0;o&&r&&o!==r&&(c[n][0]=o>0?i+360:i-360)}}if(!n.isGeographic){const e=J(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];D(c,t);const o=n.wkid?r.coordsys(n.wkid):r.fromString(n.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,n.wkt2||n.wkt);a.geogToProj(o,c.length,c)}let u=c;if(f&&c.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(c[t++]):u.push([NaN,NaN])}return u}function U(e){const{cols:t,rows:n,xres:o,yres:i,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:c}=e;r&&(l+=o/2,c-=i/2);const u=[],x=[],h=Math.max(t,n);for(let g=0;g<h;g++){const e=l+o*Math.min(t,g),r=c-i*Math.min(n,g),h=m(new f({x:e,y:r,spatialReference:s}),s,a);g<=t&&u.push(h.x),g<=n&&x.push(h.y)}const p=[];for(let f=0;f<t;f++)for(let e=0;e<n;e++)p.push([u[f],x[e]]);return p}function J(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),S.has(n)){const e=S.get(n);return t?e?.gcs:e?.pcs}const o=e.wkid?r.coordsys(e.wkid):r.fromString(e.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,e.wkt2||e.wkt),i=X(o,W(e,1e-4)),a=X(o,0,!0);return S.set(n,{pcs:i,gcs:a}),t?a:i}function X(e,t=0,n=!1){const o=c.generate(e),i=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!o||!i?.length)return null;let r=!1,s=i.find((e=>1===e.getInclusive()&&1===e.getKind()));if(!s){if(s=i.find((e=>1===e.getInclusive()&&0===e.getKind())),!s)return null;r=!0}const a=n?0:(2===o.getNorthPoleLocation()?1:0)|(2===o.getSouthPoleLocation()?2:0),l=o.isPannableRectangle(),f=s.getCoord();if(r)return{isEnvelope:r,isPannable:l,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:a};let u=0;const m=[];let[x,h]=f[0],[p,g]=f[0];for(let c=0,y=f.length;c<y;c++){u++,u===y&&(u=0);const[e,t]=f[c],[n,o]=f[u];if(o===t)m.push([e,n,t,o,2]);else{const i=(n-e)/(o-t||1e-4),r=e-i*t;t<o?m.push([i,r,t,o,0]):m.push([i,r,o,t,1])}x=x<e?x:e,h=h<t?h:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:l,vertices:f,coef:m,bbox:[x,h,p,g],poleLocation:a}}function K(e,t){const n=[],{cols:o,rows:i,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<o;e++)for(let t=0;t<i;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(o*i);if(t.isEnvelope){const{bbox:[e,a,u,m]}=t;for(let x=0,h=0;x<o;x++){const o=l+r*x,p=t.isPannable||o>=e&&o<=u;for(let e=0;e<i;e++,h++){const t=c-s*e;p&&t>=a&&t<=m&&(n.push([o,t]),f[h]=1)}}return{points:n,mask:f}}const u=t.coef,m=[];for(let x=0;x<i;x++){const e=c-s*x,t=[],n=[];for(let i=0;i<u.length;i++){const[o,r,s,a,l]=u[i];if(e===s&&s===a)t.push(o),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const i=o*e+r;t.push(i),n.push(l)}}let o=t;if(t.length>2){let e=2===n[0]?0:n[0],i=t[0];o=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(o.push(0===e?Math.min(i,t[r-1]):Math.max(i,t[r-1])),e=n[r],i=t[r]),r===n.length-1&&o.push(0===n[r]?Math.min(i,t[r]):Math.max(i,t[r])));o.sort(((e,t)=>e-t))}else t[0]>t[1]&&(o=[t[1],t[0]]);m.push(o)}for(let x=0,h=0;x<o;x++){const e=l+r*x;for(let t=0;t<i;t++,h++){const o=c-s*t,i=m[t];if(2===i.length)e>=i[0]&&e<=i[1]&&(n.push([e,o]),f[h]=1);else if(i.length>2){let t=!1;for(let n=0;n<i.length;n+=2)if(e>=i[n]&&e<=i[n+1]){t=!0;break}t&&(n.push([e,o]),f[h]=1)}}}return{points:n,mask:f}}function D(e,t){const[n,o]=t;for(let i=0;i<e.length;i++){const t=e[i][1];(t<n||t>o)&&(e[i]=[NaN,NaN])}}function H(e,t){const n=ee(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??W(e[0].spatialReference),1===(e=e.filter((e=>e.width>t))).length)return e[0];let{xmin:o,xmax:r,ymin:s,ymax:a}=e[0];for(let i=1;i<e.length;i++){const t=e[i];r=t.xmax+n*i,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new i({xmin:o,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function Q(t,n,o=null,r=!0){const s=t.spatialReference;if(s.equals(n)||!n)return t;const a=oe(t),l=ee(s,!0),c=ee(n);if(0===a||null==l||null==c){const e=$(t,n,o,r);if(null==l&&null!=c&&Math.abs(e.width-c)<W(n)&&E.isLoaded()){const o=J(s);if(null!=o&&o.poleLocation===p.None&&t.width<(o.bbox[2]-o.bbox[0])/2)return Z(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>W(s)){const{xmin:e,xmax:n}=t;for(let o=0;o<=a;o++){const r=0===o?e:-l/2,c=o===a?n-l*o:l/2;f[o]=new i({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}return H(f.map((e=>$(e,n,o,r))).filter(e))}function V(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:o,ymax:i,spatialReference:r}=e;e=new u({rings:[[[t,i],[o,i],[o,n],[t,n],[t,i]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(g(),E.execute(e,t,{geographicTransformation:n}))}function Z(e,t){const n=ee(t);if(null==n)return null;let{xmin:o,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new u({spatialReference:l,rings:[[[o,r],[s,r],[s,a],[o,a],[o,r]]]}),f=E.execute(c,t);if(2!==f.rings.length||!f.rings[0].length||!f.rings[1].length)return null;const{rings:m}=f,x=W(l),h=new i({spatialReference:t});for(let i=0;i<2;i++){o=s=m[i][0][0],r=a=m[i][0][1];for(let e=0;e<m[i].length;e++)o=o>m[i][e][0]?m[i][e][0]:o,s=s<m[i][e][0]?m[i][e][0]:s,r=r>m[i][e][1]?m[i][e][1]:r,a=a<m[i][e][1]?m[i][e][1]:a;if(0===i)h.ymin=r,h.ymax=a,h.xmin=o,h.xmax=s;else if(h.ymin=Math.min(h.ymin,r),h.ymax=Math.max(h.ymax,a),Math.abs(s-n/2)<x)h.xmin=o,h.xmax=h.xmax+n;else{if(!(Math.abs(o+n/2)<x))return null;h.xmax=s+n}}return h}function $(e,t,n,o=!0,i=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;g();const s=E.execute(e,t,{geographicTransformation:n});if(i&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!o||!s)return s;const a=te(r,!0),l=te(t,!0);if(null==a||null==l)return s;const c=W(r,.001),u=W(r,b),m=W(t,.001);if(Math.abs(s.xmin-l[0])<m&&Math.abs(s.xmax-l[1])<m){const o=Math.abs(e.xmin-a[0]),i=Math.abs(a[1]-e.xmax);if(o<c&&i>u){s.xmin=l[0];const o=[];o.push(new f(e.xmax,e.ymin,r)),o.push(new f(e.xmax,(e.ymin+e.ymax)/2,r)),o.push(new f(e.xmax,e.ymax,r));const i=o.map((e=>A(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmax=Math.max.apply(null,i)}if(i<c&&o>u){s.xmax=l[1];const o=[];o.push(new f(e.xmin,e.ymin,r)),o.push(new f(e.xmin,(e.ymin+e.ymax)/2,r)),o.push(new f(e.xmin,e.ymax,r));const i=o.map((e=>A(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmin=Math.min.apply(null,i)}}else{const e=W(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function ee(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*d[e.wkid]||null}function te(e,t=!1){if(e.isGeographic)return[-180,180];const n=ee(e,t);return null!=n?[-n/2,n/2]:null}function ne(e,t,n,o){let i=(e-t)/n;return i-Math.floor(i)!=0?i=Math.floor(i):o&&(i-=1),i}function oe(e,t=!1){const n=ee(e.spatialReference);if(null==n)return 0;const o=t?0:-(n/2),i=W(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<i?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<i?-n/2:e.xmin;return ne(r,o,n,!0)-ne(s,o,n,!1)}function ie(e){const t=e.storageInfo.origin.x,n=ee(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const o=n/2,{nativePixelSize:i,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=i.x;const u=[],m=null!=e.transform&&"gcs-shift"===e.transform.type,x=t+(m?0:o),h=m?n-t:o-t;for(let p=0;p<=a;p++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)==0?e:Math.ceil(e),o=h/f/l,i=o-Math.floor(o)==0?o:Math.ceil(o),r=Math.floor(x/f/l),a=Math.round(x/f)%l,m=(l-Math.round(h/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:i,leftMargin:a,rightPadding:m,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:o,pyramidsInfo:u,hasGCSSShiftTransform:m}}function re(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(P.has(t))n=P.get(t);else{n=(e.wkid?r.coordsys(e.wkid):r.fromString(s.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),P.set(t,n)}return new x({wkid:n})}function se(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[w,w],o=ae(e),i={cols:o.size[0]+1,rows:o.size[1]+1};const r=o.outofBoundPointCount>0&&o.outofBoundPointCount<o.offsets.length/2;let s=o.outofBoundPointCount===o.offsets.length/2||t&&r?[0,0]:y(o.offsets,i,n,R);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>R)&&(l.isGeographic||J(l),n=[M,M],o=ae({...e,spacing:n}),i={cols:o.size[0]+1,rows:o.size[1]+1},s=y(o.offsets,i,n,R)),o.error=s,n[0]>1&&(o.coefficients=le(o.offsets,i,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)o.gcsGrid={offsets:o.offsets,coefficients:o.coefficients,spacing:n};else{const t=J(l);if(null!=t&&!t.isEnvelope){const t=re(l),s=Q(e.projectedExtent,t),{offsets:a}=ae({...e,srcBufferExtent:s,spacing:n}),c=le(a,i,r);o.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return o}function ae(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:o,datumTransformation:i,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference;g();const{xmin:l,ymin:c,xmax:u,ymax:m}=t,x=ee(a),h=null!=x&&(e.hasWrapAround||"gcs-shift"===r?.type),p=e.spacing||[w,w],y=p[0]*o.x,d=p[1]*o.y,R=1===p[0],S=Math.ceil((u-l)/y-.1/p[0])+(R?0:1),P=Math.ceil((m-c)/d-.1/p[1])+(R?0:1),G=F({cols:S,rows:P,xmin:l,ymax:m,xres:y,yres:d,inSR:s,outSR:a,datumTransformation:i,preferPE:p[0]<=M,usePixelCenter:R}),k=[];let N,E=0;const T=R?-1:NaN,{xmin:j,xmax:v,ymax:C,width:_,height:z}=n,L=W(a,b),I=null!=x&&j>0&&v>x/2,O=J(s),A=null!=O&&O.poleLocation>0;for(let g=0;g<S;g++){const e=[];for(let t=0;t<P;t++){let n=G[g*P+t];if(h&&n[0]>v&&n[0]>x/2-L?n[0]-=x:h&&0===g&&n[0]<0&&I&&!r&&(n[0]+=x),!n||isNaN(n[0])||isNaN(n[1]))k.push(T),k.push(T),e.push(null),E++;else{if(r){const e=r.inverseTransform(new f({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),g>0&&h&&N[t]&&n[0]<N[t][0]&&(n[0]+=x,A&&n[0]>v&&n[0]>x&&(n[0]-=x)),k.push((n[0]-j)/_),k.push((C-n[1])/z)}}N=e}return{offsets:k,error:null,coefficients:null,outofBoundPointCount:E,spacing:p,size:R?[S,P]:[S-1,P-1]}}function le(e,t,n){const{cols:o,rows:i}=t,r=new Float32Array((o-1)*(i-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<o-1;l++){for(let t=0;t<i-1;t++){let n=l*i*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],m=e[n+3];n+=2*i;const x=e[n],h=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(o-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*m+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*x+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function ce(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:H(n,t)}function fe(e){const{spatialReference:t}=e,n=h(t);if(!n)return e;const[o,r]=n.valid,s=r-o;let a=0;if(e.xmin<o){const t=o-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new i({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function ue(e,t,n){const{storageInfo:i,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=i,c="mixed"===i.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,i.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/c;if(null!=l&&l.length){const e=l[l.length-1],i=(e.x+e.y)/2,c=(r.x+r.y)/2;if(u<=c)s=0;else if(u>=i)s=l.length,a=u/i>8;else{let e,t=c;for(let o=1;o<=l.length;o++){if(e=(l[o-1].x+l[o-1].y)/2,u<=e){u===e?s=o:"down"===n?(s=o-1,a=u/t>8):s="up"===n||u-t>e-u||u/t>2?o:o-1;break}t=e}}const m=0===s?r:l[s-1];if(a){Math.min(m.x,m.y)*o(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new f({x:m.x,y:m.y,spatialReference:t.spatialReference}),excessiveReading:a}}const m=Math.log(e.x/r.x)/Math.LN2,x=Math.log(e.y/r.y)/Math.LN2,h=t.storageInfo.maximumPyramidLevel||0;s="down"===n?Math.floor(Math.min(m,x)):"up"===n?Math.ceil(Math.max(m,x)):Math.round((m+x)/2),s<0?s=0:s>h&&(a=s>h+3,s=h);const p=2**s;return{pyramidLevel:s,pyramidResolution:new f({x:p*t.nativePixelSize.x,y:p*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function me(e,t,n=!1){const{pixelSize:o,extent:i}=e,r=C(i,t,!1),s=Q(ce(i,(o.x+o.y)/16),t,r);return n||0===oe(s)?s:$(i,t,r)}function xe(e,t,n){const o=n?.tileSize??512,i=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,spatialReference:a,pixelSize:l}=e,c=L(l,t,s);if(null==c)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const f=(c.x+c.y)/2,u=I(f,t),m=t.isGeographic?256/o*295828763.7958547:256/o*591657527.591555;let h="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const p=me(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(m/2/u)/Math.LN2));if(!h&&i&&(t.isGeographic||t.isWebMercator)){const n=ee(t);if(h=oe(p)>0||null!=n&&p.width>n/4,!h&&null!=n){let t=-1;if(g<3)t=2**g*f*o;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:i=2}=e.storageInfo;t=i**n*f*o}const i=Math.ceil(n/t);h=1===i||2===i&&n/2-p.xmax<t}}let y,d=u;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(h){d=m;const n=t.isGeographic?1341104507446289e-21:.29858214164761665,o=I(n,t),i=t.isGeographic?4326:3857;y=L({x:n,y:n},a,me(e,new x({wkid:i}),!0)),y.x*=d/o,y.y*=d/o}else{y={x:l.x,y:l.y};let e=0;for(;d<m*(w/2)&&e<g;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,m)/Math.min(d,m)<=w&&(d=m)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,u)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*l.x;let t=S.findIndex((t=>t.x>=l.x-e&&t.x<=l.x+e));t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex((t=>t.x<=l.x+e)),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:c,scales:R,srcResolutions:S,isCustomTilingScheme:!h}}function he(e){let t=0;for(const n of e){const e=n.length;let o=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)o+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=o/2}return Math.abs(t)}export{xe as computeProjectedScales,w as defaultGridSpacing,R as defaultProjectionToleranceInPixels,C as getDefaultDatumTransformationForDataset,F as getProjectedGridPoints,se as getProjectionOffsetGrid,ie as getRasterDatasetAlignmentInfo,O as getSourceScale,ee as getWorldWidth,oe as getWorldWrapCount,v as load,M as minimumGridSpacing,me as projectDatasetExtent,L as projectDatasetResolution,Q as projectExtent,A as projectPoint,V as projectPolygon,_ as projectResolution,fe as shiftExtent,ce as snapExtent,ue as snapPyramid};