@arcgis/core 5.1.0-next.21 → 5.1.0-next.22

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 (183) hide show
  1. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -0
  2. package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +1 -0
  3. package/analysis/VolumeMeasurement/VolumeMeasurementInputUnits.d.ts +1 -0
  4. package/analysis/VolumeMeasurementAnalysis.d.ts +3 -2
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/03d11c7056fea763cbac.js +1 -0
  7. package/assets/esri/core/workers/chunks/05e5b9082c0a396df7e5.js +1 -0
  8. package/assets/esri/core/workers/chunks/08445fcba84ed7c23b3f.js +1 -0
  9. package/assets/esri/core/workers/chunks/0c706cdff6eac940eaab.js +1 -0
  10. package/assets/esri/core/workers/chunks/10a8612e7b2c74a8ce9a.js +1 -0
  11. package/assets/esri/core/workers/chunks/{2ddb8bb00b3af83ebd7c.js → 14792047c5519dd89828.js} +1 -1
  12. package/assets/esri/core/workers/chunks/1a1e57267306c07e5bdb.js +1 -0
  13. package/assets/esri/core/workers/chunks/1bb5aa1e3693e0c68b18.js +1 -0
  14. package/assets/esri/core/workers/chunks/1cd091fa567fc4026356.js +1 -0
  15. package/assets/esri/core/workers/chunks/{3ed7f19f77a11fa4d047.js → 2063b49607a03f7718ee.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{74a6d840813ac29b0bda.js → 209acb3ad16c99bb506c.js} +1 -1
  17. package/assets/esri/core/workers/chunks/21decfc1e477fb769204.js +1 -0
  18. package/assets/esri/core/workers/chunks/21e04705cad9fef1b01b.js +1 -0
  19. package/assets/esri/core/workers/chunks/23cb0611abe1031c513c.js +1 -0
  20. package/assets/esri/core/workers/chunks/285f3b07de852bfc1604.js +1 -0
  21. package/assets/esri/core/workers/chunks/2c61a53962093a331225.js +1 -0
  22. package/assets/esri/core/workers/chunks/2ecfd6edab796194bf88.js +1 -0
  23. package/assets/esri/core/workers/chunks/2f23af31b1190754ce13.js +1 -0
  24. package/assets/esri/core/workers/chunks/31eb59eae4c89b76e302.js +1 -0
  25. package/assets/esri/core/workers/chunks/3e61e7805dc6ff284831.js +1 -0
  26. package/assets/esri/core/workers/chunks/4150774059d67a8def74.js +1 -0
  27. package/assets/esri/core/workers/chunks/416c57df61fbd193078b.js +1 -0
  28. package/assets/esri/core/workers/chunks/46d28a0c20263012faff.js +1 -0
  29. package/assets/esri/core/workers/chunks/{43c8b1473695574c663e.js → 4754610760f3f634adf9.js} +2 -2
  30. package/assets/esri/core/workers/chunks/{f5cebeaad3e7d87d7997.js → 4fc6dd1423075e145b29.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{3861644c06cfebe8f40c.js → 527547fa10d52cb3a7b1.js} +2 -2
  32. package/assets/esri/core/workers/chunks/5480d4cc342a2669a8ab.js +1 -0
  33. package/assets/esri/core/workers/chunks/{e8495c655a0a4f534636.js → 551fee27bf3abf0c41fd.js} +1 -1
  34. package/assets/esri/core/workers/chunks/576995021660e8b34705.js +1 -0
  35. package/assets/esri/core/workers/chunks/57e375d8a8db9fa57193.js +1 -0
  36. package/assets/esri/core/workers/chunks/5cbc12545f42a32fb960.js +1 -0
  37. package/assets/esri/core/workers/chunks/61ebbae0773fccc1f2bf.js +1 -0
  38. package/assets/esri/core/workers/chunks/63c297b6b7438f49e7ee.js +1 -0
  39. package/assets/esri/core/workers/chunks/{53f8c1d56ef3b24d2226.js → 6c853fd89f0e9f102c6e.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{946698d9cefffdb63082.js → 6e32e7b2ea2ea1a1fc04.js} +1 -1
  41. package/assets/esri/core/workers/chunks/6f12854c5846edfe3239.js +1 -0
  42. package/assets/esri/core/workers/chunks/{b586f1021a27c5e1551a.js → 7189e03cc24f5c10865a.js} +2 -2
  43. package/assets/esri/core/workers/chunks/7c417d2bf432e4055b3d.js +30 -0
  44. package/assets/esri/core/workers/chunks/8021cb732f8136d87048.js +1 -0
  45. package/assets/esri/core/workers/chunks/84124c1a41a96192f81c.js +1 -0
  46. package/assets/esri/core/workers/chunks/845bbd82ddacbb62ad28.js +1 -0
  47. package/assets/esri/core/workers/chunks/868c8a152cb1452b9a94.js +1 -0
  48. package/assets/esri/core/workers/chunks/879ce85c50b0348056b2.js +1 -0
  49. package/assets/esri/core/workers/chunks/87a7d405a0b9a541d7f2.js +1 -0
  50. package/assets/esri/core/workers/chunks/9522430d34d29c1ffb1a.js +1 -0
  51. package/assets/esri/core/workers/chunks/9647f3983f955da21093.js +1 -0
  52. package/assets/esri/core/workers/chunks/9694b4b85168a38ca24b.js +1 -0
  53. package/assets/esri/core/workers/chunks/{83d913dab3c2b0d6a7cc.js → 9736299a4ac0e21f08a7.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{e7bee85f28d7ec03825a.js → 973e3743cb7fdaa27f80.js} +1 -1
  55. package/assets/esri/core/workers/chunks/9b2d0d36ee6c04c347df.js +1 -0
  56. package/assets/esri/core/workers/chunks/{2662750d5761ed2d0eb7.js → 9e7eea56e96f012f9ff4.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{3f812b0a28afb47aaaf0.js → a35d1be700ebd3109397.js} +2 -2
  58. package/assets/esri/core/workers/chunks/a4a4ce33de6432ba4dc3.js +1 -0
  59. package/assets/esri/core/workers/chunks/{aece665144aed2065ffc.js → a78ac951c00f090d9024.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{0debabe324c873066885.js → aa3bdfd00f666c6cc521.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{db5bbc240a1b8cd5af52.js → abc2471cfa9430ca5645.js} +1 -1
  62. package/assets/esri/core/workers/chunks/b2a67fe89f6505498bc3.js +1 -0
  63. package/assets/esri/core/workers/chunks/b4254fcb2051c873f2ba.js +1 -0
  64. package/assets/esri/core/workers/chunks/{a53fa34681efff8fc024.js → b859d98fa1c39f8e4099.js} +1 -1
  65. package/assets/esri/core/workers/chunks/c09bc36347e8eb9fff00.js +1 -0
  66. package/assets/esri/core/workers/chunks/c2cda93905f0a49a6931.js +1 -0
  67. package/assets/esri/core/workers/chunks/{3d0aa5f2db79c022243e.js → c794f7be868e53ca4a8c.js} +1 -1
  68. package/assets/esri/core/workers/chunks/cada79c174027f7a0df8.js +1 -0
  69. package/assets/esri/core/workers/chunks/d10c65cde3565d399275.js +1 -0
  70. package/assets/esri/core/workers/chunks/d44217de4c73475f9c66.js +1 -0
  71. package/assets/esri/core/workers/chunks/d587b7842091affdaac3.js +1 -0
  72. package/assets/esri/core/workers/chunks/d70678598f4080adfb39.js +1 -0
  73. package/assets/esri/core/workers/chunks/dad9c25f1b7cacf7b052.js +1 -0
  74. package/assets/esri/core/workers/chunks/{0facd2c143a04cc7c4ff.js → deee88e3f1641c6ef5db.js} +1 -1
  75. package/assets/esri/core/workers/chunks/e063cce778944fe97dd3.js +1 -0
  76. package/assets/esri/core/workers/chunks/e37e7ae2de974cef9a90.js +1 -0
  77. package/assets/esri/core/workers/chunks/e44ed205f74df34adb8b.js +1 -0
  78. package/assets/esri/core/workers/chunks/e6220c1fa887e21ffbbd.js +1 -0
  79. package/assets/esri/core/workers/chunks/{13d1cb50232ae761425b.js → eaeb95be8d4032513247.js} +2 -2
  80. package/assets/esri/core/workers/chunks/{93515f52d9b5fa12bd04.js → eb4934d3a3b82316c7c6.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{bfeab15d7ac9a2559fe5.js → f1c1f7583fa13dff9b5c.js} +1 -1
  82. package/assets/esri/core/workers/chunks/f27bbb4e26297d3c68de.js +1 -0
  83. package/assets/esri/core/workers/chunks/f4480636a910eaa4c531.js +1 -0
  84. package/assets/esri/core/workers/chunks/{5b991b0d4ca257291cb0.js → f5c5a9e771074f780fc8.js} +1 -1
  85. package/assets/esri/core/workers/chunks/f82a95c46f0d579d5bf5.js +1 -0
  86. package/assets/esri/core/workers/chunks/fb3a42cdd0d3105ec551.js +1 -0
  87. package/config.js +1 -1
  88. package/core/MultiOriginJSONSupport.d.ts +1 -1
  89. package/core/ReadOnlyMultiOriginJSONSupport.d.ts +5 -4
  90. package/geometry/FlatGeometry.js +1 -1
  91. package/kernel.js +1 -1
  92. package/layers/FeatureLayer.d.ts +7 -9
  93. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  94. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  95. package/layers/graphics/data/QueryEngineResult.js +1 -1
  96. package/layers/raster/datasets/MRFRaster.js +1 -1
  97. package/layers/support/SceneModification.js +1 -1
  98. package/package.json +2 -2
  99. package/renderers/VectorFieldRenderer.js +1 -1
  100. package/support/revision.js +1 -1
  101. package/symbols/cim/SDFHelper.js +1 -1
  102. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  103. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +1 -0
  104. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.d.ts +1 -0
  105. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +1 -0
  106. package/views/3d/layers/Lyr3DWorker.js +1 -1
  107. package/views/3d/layers/SceneLayerWorkerHandle.js +1 -1
  108. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  109. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  110. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  111. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  112. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  113. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  114. package/views/SelectionManager.d.ts +9 -9
  115. package/views/SelectionManager.js +1 -1
  116. package/views/layers/FeatureLikeLayerView.d.ts +24 -24
  117. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  118. package/widgets/Editor/workflowUtils.js +1 -1
  119. package/widgets/FeatureTemplates.d.ts +1 -1
  120. package/widgets/FeatureTemplates.js +1 -1
  121. package/widgets/Sketch/support/sketchUtils.js +1 -1
  122. package/assets/esri/core/workers/chunks/026c00ee272c64e53daf.js +0 -1
  123. package/assets/esri/core/workers/chunks/0883c4e63424d6746ada.js +0 -1
  124. package/assets/esri/core/workers/chunks/0987cb20148f65222b44.js +0 -1
  125. package/assets/esri/core/workers/chunks/0a1f88cf16bcbb53b371.js +0 -1
  126. package/assets/esri/core/workers/chunks/0ca405ca26676137a4be.js +0 -1
  127. package/assets/esri/core/workers/chunks/0ce968c89c35535da63e.js +0 -1
  128. package/assets/esri/core/workers/chunks/144c719d5ba9e3a30961.js +0 -1
  129. package/assets/esri/core/workers/chunks/1503ca177e2466ec0e87.js +0 -1
  130. package/assets/esri/core/workers/chunks/1597d7b380d510ff5252.js +0 -1
  131. package/assets/esri/core/workers/chunks/1880c3b293cdfa804625.js +0 -1
  132. package/assets/esri/core/workers/chunks/1bea32b02d35ddb9b118.js +0 -1
  133. package/assets/esri/core/workers/chunks/1d78ec98eef7fef08f86.js +0 -1
  134. package/assets/esri/core/workers/chunks/1e6271524602e159dbad.js +0 -1
  135. package/assets/esri/core/workers/chunks/1f96d597ba736e088168.js +0 -1
  136. package/assets/esri/core/workers/chunks/26e41b08efe77d247409.js +0 -1
  137. package/assets/esri/core/workers/chunks/297b58f29c496923e1f3.js +0 -1
  138. package/assets/esri/core/workers/chunks/2a2a9fa62969644ea200.js +0 -1
  139. package/assets/esri/core/workers/chunks/2b296378d21e4e3c11d4.js +0 -1
  140. package/assets/esri/core/workers/chunks/2cbcf34cf896a438999b.js +0 -1
  141. package/assets/esri/core/workers/chunks/394b645d51e7bf799382.js +0 -1
  142. package/assets/esri/core/workers/chunks/50ab9a3f8bbb268fae59.js +0 -1
  143. package/assets/esri/core/workers/chunks/5b2dd164dd84fd1ca4f7.js +0 -1
  144. package/assets/esri/core/workers/chunks/62c228ca16fdc7a2c695.js +0 -1
  145. package/assets/esri/core/workers/chunks/639202a461b17840a13f.js +0 -1
  146. package/assets/esri/core/workers/chunks/693d269637135047a0c4.js +0 -1
  147. package/assets/esri/core/workers/chunks/6a14ec2d2de6778a4e7a.js +0 -1
  148. package/assets/esri/core/workers/chunks/6d3467997b5d01630b08.js +0 -1
  149. package/assets/esri/core/workers/chunks/6dfcb0c804e63e87e311.js +0 -1
  150. package/assets/esri/core/workers/chunks/778ab9e4c3928b0d7d74.js +0 -1
  151. package/assets/esri/core/workers/chunks/8012fdc49a7a10982f78.js +0 -1
  152. package/assets/esri/core/workers/chunks/85e0fd618625a639387f.js +0 -1
  153. package/assets/esri/core/workers/chunks/86465d4bb185d7460087.js +0 -1
  154. package/assets/esri/core/workers/chunks/87e7378b242debbfd575.js +0 -1
  155. package/assets/esri/core/workers/chunks/90b19e60c056f32623e7.js +0 -1
  156. package/assets/esri/core/workers/chunks/9461f7225c42cf15a114.js +0 -1
  157. package/assets/esri/core/workers/chunks/978649cb6df99ee728be.js +0 -1
  158. package/assets/esri/core/workers/chunks/9f5f4da954228d876219.js +0 -1
  159. package/assets/esri/core/workers/chunks/a2323c957c8b2fe225b4.js +0 -1
  160. package/assets/esri/core/workers/chunks/a36a33f43610c3cd985b.js +0 -1
  161. package/assets/esri/core/workers/chunks/a381932eef77f4d80292.js +0 -1
  162. package/assets/esri/core/workers/chunks/b089947c9a492c96ca27.js +0 -1
  163. package/assets/esri/core/workers/chunks/b6e4c35b76379088035c.js +0 -1
  164. package/assets/esri/core/workers/chunks/b96dce64bdd7487e862a.js +0 -1
  165. package/assets/esri/core/workers/chunks/c4a78ab84186c7be599a.js +0 -1
  166. package/assets/esri/core/workers/chunks/c9d600dc6b6b5aafff1c.js +0 -1
  167. package/assets/esri/core/workers/chunks/ca33847a997ccfe8ddc2.js +0 -1
  168. package/assets/esri/core/workers/chunks/cca19c9564be2d02a277.js +0 -1
  169. package/assets/esri/core/workers/chunks/ccc2f2b3db008d8a495f.js +0 -1
  170. package/assets/esri/core/workers/chunks/d9f900975ac915a0f24f.js +0 -1
  171. package/assets/esri/core/workers/chunks/dd5d66f067e2386e0514.js +0 -1
  172. package/assets/esri/core/workers/chunks/eb4ffb72c9360062141c.js +0 -1
  173. package/assets/esri/core/workers/chunks/ebae903845643d60b44a.js +0 -1
  174. package/assets/esri/core/workers/chunks/ebb0372e8da0f75c09dd.js +0 -1
  175. package/assets/esri/core/workers/chunks/f349f64f683620bdf9b5.js +0 -30
  176. package/assets/esri/core/workers/chunks/f6fb87092bdf6bbf0769.js +0 -1
  177. package/assets/esri/core/workers/chunks/f76c2b09e6ba9d107898.js +0 -1
  178. package/assets/esri/core/workers/chunks/fcf962f3dec6b5440983.js +0 -1
  179. /package/assets/esri/core/workers/chunks/{43c8b1473695574c663e.js.LICENSE.txt → 4754610760f3f634adf9.js.LICENSE.txt} +0 -0
  180. /package/assets/esri/core/workers/chunks/{3861644c06cfebe8f40c.js.LICENSE.txt → 527547fa10d52cb3a7b1.js.LICENSE.txt} +0 -0
  181. /package/assets/esri/core/workers/chunks/{b586f1021a27c5e1551a.js.LICENSE.txt → 7189e03cc24f5c10865a.js.LICENSE.txt} +0 -0
  182. /package/assets/esri/core/workers/chunks/{3f812b0a28afb47aaaf0.js.LICENSE.txt → a35d1be700ebd3109397.js.LICENSE.txt} +0 -0
  183. /package/assets/esri/core/workers/chunks/{13d1cb50232ae761425b.js.LICENSE.txt → eaeb95be8d4032513247.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__addDisposableResource as t,__disposeResources as e}from"tslib";import{baseTypedSubArrayMemory as r}from"../core/memoryEstimations.js";import s from"./SpatialReference.js";import{empty as n,expandWithExtent as i}from"./support/aaBoundingBox.js";import{empty as a,expandExtentInPlace as o}from"./support/aaBoundingRect.js";import{isPoint as u,isMultipoint as h,isPolyline as l,isGeometryWithM as c,isGeometryWithZ as g}from"./support/jsonTypeUtils.js";import{equals as f}from"./support/spatialReferenceUtils.js";import{interpolateCircle as m}from"./support/curves/circleUtils.js";import{deriveCircleFromCircularArc as p}from"./support/curves/circularArcUtils.js";import{curveExtent as x}from"./support/curves/curveExtent.js";import{getEndpoint as v,isCurvedGeometry as d,isEllipticArc7 as y,isEllipticArc4 as C,isCircularArc as M,isBezierCurve as E}from"./support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as O}from"./support/curves/ellipticArc4Utils.js";import{deriveEllipse as F,interpolateEllipse as P}from"./support/curves/ellipticArc7Utils.js";import S from"../layers/graphics/OptimizedGeometry.js";class _{constructor({type:t,spatialReference:e,vertexCount:r,vertexXY:s,vertexZ:n,vertexM:i,partCount:a,partOffsets:o,partFlags:u,segmentFlags:h,segmentIndices:l,segmentParams:c,segmentCountArc:g,segmentCountBezier:f}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=t,this.spatialReference=e,this.vertexCount=r,this.vertexXY=s,this.vertexZ=n,this.vertexM=i,this.partCount=a,this.partOffsets=o,this.partFlags=u,this.segmentFlags=h,this.segmentIndices=l,this.segmentParams=c,this.segmentCountArc=g,this.segmentCountBezier=f}get segmentParamCount(){return 10*this.segmentCountArc+4*this.segmentCountBezier}get segmentCountLine(){const{segmentCount:t,segmentCountArc:e,segmentCountBezier:r}=this;return t&&t-e-r}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}hasCurves(){return null!=this.segmentFlags}isMultipart(){return"polyline"===this.type||"polygon"===this.type}get usedMemory(){function t(t){return t?r+t.byteLength:0}return t(this.vertexXY)+t(this.vertexZ)+t(this.vertexM)+t(this.partOffsets)+t(this.partFlags)+t(this.segmentFlags)+t(this.segmentIndices)+t(this.segmentParams)}clone(){const{type:t,vertexCount:e,partCount:r,hasZ:s,hasM:n,segmentCountArc:i,segmentCountBezier:a}=this,o=U(t,e,r,s,n,this.hasCurves(),i,a);o.spatialReference=this.spatialReference;const{vertexXY:u,vertexZ:h,vertexM:l}=this;if(o.vertexXY.set(u.subarray(0,2*e),0),o.vertexZ?.set(h.subarray(0,e),0),o.vertexM?.set(l.subarray(0,e),0),this.isMultipart()){const{partOffsets:t,partFlags:e}=this;o.partFlags.set(e.subarray(0,r+1)),o.partOffsets.set(t.subarray(0,r+1))}if(this.hasCurves()){const{segmentFlags:t,segmentIndices:r,segmentParams:s,segmentParamCount:n}=this;o.segmentFlags.set(t.subarray(0,e),0),o.segmentIndices.set(r.subarray(0,e),0),o.segmentParams.set(s.subarray(0,n),0)}return o}equals(t){return this.equalsWithinTolerance(t,0)}equalsWithinTolerance(t,e){if(null==t)return!1;if(this===t)return!0;if(!f(this.spatialReference,t.spatialReference))return!1;if(this.vertexCount!==t.vertexCount||this.partCount!==t.partCount)return!1;if(this.hasZ!==t.hasZ||this.hasM!==t.hasM)return!1;if(this.hasCurves()!==t.hasCurves()||this.segmentCountArc!==t.segmentCountArc||this.segmentCountBezier!==t.segmentCountBezier)return!1;const r=0===e?(t,e)=>t!==e||isNaN(t)!==isNaN(e):(t,r)=>Math.abs(t-r)>e||isNaN(t)!==isNaN(r);for(let s=0;s<this.vertexCount;++s)if(r(this.vertexXY[2*s],t.vertexXY[2*s])||r(this.vertexXY[2*s+1],t.vertexXY[2*s+1]))return!1;if(this.hasZ)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexZ[s],t.vertexZ[s]))return!1;if(this.hasM)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexM[s],t.vertexM[s]))return!1;for(let s=0;s<this.partCount;++s)if(this.partFlags[s]!==t.partFlags[s]||this.partOffsets[s]!==t.partOffsets[s])return!1;if(this.hasCurves()){for(let e=0;e<this.vertexCount;++e)if(this.segmentFlags[e]!==t.segmentFlags[e]||this.segmentIndices[e]!==t.segmentIndices[e])return!1;for(let e=0;e<this.segmentParamCount;++e)if(r(this.segmentParams[e],t.segmentParams[e]))return!1}return!0}get parts(){return new Z(this)}}class Z{constructor(t){this.geometry=t,this.value=new A(t)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class A{constructor(t){this.geometry=t,this.index=-1,this._readVertex=j(t),this._segments=new R(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){const t=this.geometry.partOffsets;return t[this.index+1]-t[this.index]}}class R{constructor(t){this._part=t,this._partStart=0,this._partEnd=0,this._isPolygon="polygon"===t.geometry.type,this.value=new V(t.geometry)}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;const t=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=t&&this._isPolygon?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){const{index:t}=this._part,e=this._part.geometry.partOffsets;this._partStart=e[t],this._partEnd=e[t+1]-(this._isPolygon?1:2),this.value.indexOfStartVertex=this._partStart-1}}class V{constructor(t){this.geometry=t,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=j(t)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){const t=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===t)return this.end;const e=this.geometry.segmentParams;let r=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===t){const t=e[r++],s=e[r++],n=e[r++],i=e[r++];return{b:[this.end,[t,s],[n,i]]}}const s=e[r++],n=e[r++],i=e[r++],a=e[r++],o=e[r++],u=e[r++];r++,r++;const h=e[r++],l=e[r++];if(!Boolean(4&s)&&1===i)return{c:[this.end,[h,l]]};const c=2&s?0:1,g=1&s?0:1;return{a:[this.end,[o,u],c,g,a,n,i]}}}function Y(r){let s;const{vertexCount:n,vertexXY:i,vertexZ:o,vertexM:u}=r,h=z(r);if(r.hasCurves()){const n={stack:[],error:void 0,hasError:!1};try{t(n,new k(r,["vertexZ","vertexM"]),!1);const e=a();for(const t of r.parts){let r=t.startVertex;for(const{curve:s}of t.segments)x(e,r,s),r=v(s)}const[i,o,u,l]=e;s={xmin:i,ymin:o,xmax:u,ymax:l,spatialReference:h}}catch(l){n.error=l,n.hasError=!0}finally{e(n)}}else{let t,e,r,a;t=e=1/0,r=a=-1/0;for(let s=0;s<n;++s){const n=i[2*s],o=i[2*s+1];t=Math.min(t,n),r=Math.max(r,n),e=Math.min(e,o),a=Math.max(a,o)}s={xmin:t,ymin:e,xmax:r,ymax:a,spatialReference:h}}if(o){let t=1/0,e=-1/0;for(const r of o)t=Math.min(t,r),e=Math.max(e,r);s.zmin=t,s.zmax=e}if(u){let t=1/0,e=-1/0;for(const r of u)t=Math.min(t,r),e=Math.max(e,r);s.mmin=t,s.mmax=e}return s}function b(r,s){const n={stack:[],error:void 0,hasError:!1};try{s??=a();t(n,new k(r,["vertexZ","vertexM","spatialReference"]),!1);return o(s,Y(r)),s}catch(i){n.error=i,n.hasError=!0}finally{e(n)}}function w(r,s){const a={stack:[],error:void 0,hasError:!1};try{s??=n();t(a,new k(r,["vertexM","spatialReference"]),!1);return i(s,Y(r)),s}catch(o){a.error=o,a.hasError=!0}finally{e(a)}}function I(t){let e,r,s;if(u(t)){s="point";const{x:n,y:i,z:a,m:o}=t,u=[n,i];null!=a&&u.push(a),null!=o&&u.push(o),r=[[u]],e=1}else h(t)?(s="multipoint",r=[t.points],e=t.points.length):l(t)?(s="polyline",r=t.curvePaths??t.paths,e=r.reduce((t,e)=>t+e.length,0)):(s="polygon",r=t.curveRings??t.rings,e=r.reduce((t,e)=>(0===e.length||(t+=e.length,W(e[0],v(e.at(-1)))&&--t),t),0));const n=U(s,e,s.includes("point")?0:r.length,g(t),c(t),d(t)),{hasZ:i,hasM:a,vertexXY:o,vertexZ:f,vertexM:m}=n;function p(t){o[2*O]=t[0],o[2*O+1]=t[1],i&&(f[O]=t[2]),a&&(m[O]=t[x]),++O}n.spatialReference=t.spatialReference??void 0;const x=n.hasZ?3:2;let O=0;if(!n.isMultipart()){if(!i&&!a){for(const[t,e]of r[0])o[2*O]=t,o[2*O+1]=e,++O;return n}for(const t of r[0])p(t);return n}const F="polygon"===s,{partOffsets:P}=n;let S=0;if(!n.hasCurves()){for(const t of r){if(P[S++]=O,0===t.length)continue;let e=t.length;if(F&&W(t[0],t.at(-1))&&--e,i||a)for(let r=0;r<e;++r)p(t[r]);else for(let r=0;r<e;++r){const[e,s]=t[r];o[2*O]=e,o[2*O+1]=s,++O}}return P[S]=O,n}function _(t){const e=Z+t;if(e<=(n.segmentParams?.length??0))return;let r=e*K;r=20*Math.ceil(r/20);const s=n.segmentParams;n.segmentParams=new Float64Array(r),null!=s&&n.segmentParams.set(s)}let Z=0;for(const u of r){if(n.partOffsets[S++]=O,0===u.length)continue;const t=u[0];let e=t;for(let r=1;r<u.length;++r){const t=u[r];p(e);const s=O-1;y(t)?(_(10),++n.segmentCountArc,Z=D(e,t,n,s,Z),e=t.a[0]):C(t)?(_(10),++n.segmentCountArc,Z=q(e,t,n,s,Z),e=t.a[0]):M(t)?(_(10),++n.segmentCountArc,Z=G(e,t,n,s,Z),e=t.c[0]):E(t)?(_(4),++n.segmentCountBezier,Z=H(e,t,n,s,Z),e=t.b[0]):e=t}F&&W(t,e)||p(e)}return n.partOffsets[S]=O,n}function X(t){const e=j(t),{vertexCount:r,partCount:s,hasZ:n,hasM:i}=t,a=z(t);if("point"===t.type){const[e,r]=t.vertexXY,s=t.vertexZ?.[0],n=t.vertexM?.[0];return{x:e,y:r,z:s,m:n,spatialReference:a}}let o=0;if("multipoint"===t.type){const t=[];for(;o<r;)t.push(e(o++));return{points:t,spatialReference:a,hasZ:n,hasM:i}}const u="polygon"===t.type;if(!t.hasCurves()){const r=new Array;for(let n=0;n<s;++n){const s=t.partOffsets[n+1],i=new Array;for(;o<s;)i.push(e(o++));u&&i.length>0&&i.push(i[0]),r.push(i)}return u?{rings:r,hasZ:n,hasM:i,spatialReference:a}:{paths:r,hasZ:n,hasM:i,spatialReference:a}}const h=new Array;for(const{segments:l,startVertex:c}of t.parts){const t=[c];for(const{curve:e}of l)t.push(e);h.push(t)}return u?{rings:[],curveRings:h,hasZ:n,hasM:i,spatialReference:a}:{paths:[],curvePaths:h,hasZ:n,hasM:i,spatialReference:a}}function B(t,{lengths:e,coords:r,hasZ:s,hasM:n},i){const a=t.includes("point")?0:e.length,o="polygon"===t,u="point"===t?1:e.reduce((t,e)=>t+e,0)-(o?a:0);s??=!1,n??=!1;const h=U(t,u,a,s,n,!1,0,0);if(h.spatialReference=i??void 0,!h.isMultipart()){for(let t=0,e=0;t<u;++t)h.vertexXY[2*t]=r[e++],h.vertexXY[2*t+1]=r[e++],s&&(h.vertexZ[t]=r[e++]),n&&(h.vertexM[t]=r[e++]);return h}const l=2+Number(s)+Number(n);let c=0,g=0;h.partOffsets[0]=0;for(const f of e){const t=h.partOffsets[g],e=t+f-Number(o);h.partOffsets[++g]=e;for(let i=t;i<e;++i)h.vertexXY[2*i]=r[c++],h.vertexXY[2*i+1]=r[c++],s&&(h.vertexZ[i]=r[c++]),n&&(h.vertexM[i]=r[c++]);o&&(c+=l)}return h}function L({type:t,vertexCount:e,vertexXY:r,vertexZ:s,vertexM:n,partCount:i,partOffsets:a,hasZ:o,hasM:u}){const h=new S([],[],o,u);i=Math.max(i,1);const l="polygon"===t;let c=0;for(let g=0;g<i;++g){const t=a?.[g+1]??e,i=h.coords.length;for(let e=c;e<t;++e)h.coords.push(r[2*e],r[2*e+1]),o&&h.coords.push(s[e]),u&&h.coords.push(n[e]);if(l){const t=c;h.coords.push(r[2*t],r[2*t+1]),o&&h.coords.push(s[t]),u&&h.coords.push(n[t])}h.lengths.push((h.coords.length-i)/h.stride),c=t}return"point"===t&&(h.lengths.length=0),h}function N(t,e){return"getSpatialReference"in t&&(e=T(t.getSpatialReference()),t=t.getGeometry()),new _({...t.toFlatGeometry(),spatialReference:e})}function T(t){if(null==t)return;const e=t.getText()||void 0,r=t.isCustomWkid()?0:t.getOldID();if(r<=0)return{wkt:e};let s=t.getLatestID();(s<=0||s===r)&&(s=void 0);const n=t.getVCS();if(null==n)return{wkid:r,latestWkid:s,wkt:e};const i=n.isCustomWkid()?0:n.getOldID();if(i<=0)return{wkt:e};let a=t.getLatestVerticalID();return(a<=0||a===i)&&(a=void 0),{wkid:r,wkt:e,latestWkid:s,vcsWkid:i,latestVcsWkid:a}}class k{constructor(t,e){this.target=t,this.keys=e,this.oldValues=e.map(e=>t[e]);for(const r of e)t[r]=void 0}[Symbol.dispose](){this.keys.map((t,e)=>{this.target[t]=this.oldValues[e]})}}function z({spatialReference:t}){return t instanceof s?t.toJSON():t}function j({vertexXY:t,vertexZ:e,vertexM:r}){return e?r?s=>[t[2*s],t[2*s+1],e[s],r[s]]:r=>[t[2*r],t[2*r+1],e[r]]:r?e=>[t[2*e],t[2*e+1],r[e]]:e=>[t[2*e],t[2*e+1]]}function W(t,e){return t.every((t,r)=>t===e[r])}function U(t,e,r,s,n,i,a,o){a??=0,o??=0;const u=new _({type:t,vertexCount:e,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:r,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:a,segmentCountBezier:o});let h=2*Float64Array.BYTES_PER_ELEMENT*e;s&&(h+=Float64Array.BYTES_PER_ELEMENT*e),n&&(h+=Float64Array.BYTES_PER_ELEMENT*e),u.isMultipart()&&(h+=(r+1)*Int32Array.BYTES_PER_ELEMENT,h+=(r+1)*Int8Array.BYTES_PER_ELEMENT),i&&(h+=e*Int8Array.BYTES_PER_ELEMENT,h+=e*Int32Array.BYTES_PER_ELEMENT,h+=u.segmentParamCount*Float64Array.BYTES_PER_ELEMENT);const l=new ArrayBuffer(h);let c=0;return u.vertexXY=new Float64Array(l,c,2*e),c+=u.vertexXY.byteLength,s&&(u.vertexZ=new Float64Array(l,c,e),c+=u.vertexZ.byteLength),n&&(u.vertexM=new Float64Array(l,c,e),c+=u.vertexM.byteLength),i&&(u.segmentParams=new Float64Array(l,c,u.segmentParamCount),c+=u.segmentParams.byteLength,u.segmentIndices=new Int32Array(l,c,e),u.segmentIndices.fill(Q),c+=u.segmentIndices.byteLength),u.isMultipart()&&(u.partOffsets=new Int32Array(l,c,r+1),c+=u.partOffsets.byteLength,u.partFlags=new Int8Array(l,c,r+1),c+=u.partFlags.byteLength,"polygon"===u.type&&u.partFlags.subarray(0,r).fill(1)),i&&(u.segmentFlags=new Int8Array(l,c,e),u.segmentFlags.fill(1),c+=u.segmentFlags.byteLength),u}function D(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;const[o,[u,h],l,c,g,f,m]=e.a;let p=4;c||(p|=1),l||(p|=2);const x=F(t,e),[v,d]=P(x,.5);return n[a++]=p,n[a++]=f,n[a++]=m,n[a++]=g,n[a++]=u,n[a++]=h,n[a++]=x.u2-x.u1,n[a++]=x.u1,n[a++]=v,n[a++]=d,a}function q(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;const o=O(t,e);return J(o,4,...m(o,.5),n,a)}function G(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;return J(p(t,e),0,...e.c[1],n,a)}function J(t,e,r,s,n,i){const{cx:a,cy:o,thetaStart:u,thetaEnd:h,radius:l}=t;u>h||(e|=1);return Math.abs(h-u)<=Math.PI||(e|=2),n[i++]=e,n[i++]=l,n[i++]=1,n[i++]=0,n[i++]=a,n[i++]=o,n[i++]=h-u,n[i++]=u,n[i++]=r,n[i++]=s,i}function H(t,{b:[e,[r,s],[n,i]]},{segmentFlags:a,segmentIndices:o,segmentParams:u},h,l){return a[h]=2,o[h]=l,u[l++]=r,u[l++]=s,u[l++]=n,u[l++]=i,l}const K=1.61803,Q=-1;export{_ as FlatGeometry,U as allocateFlatGeometry,X as convertFlatToGeometryJSON,L as convertFlatToOptimizedGeometry,I as convertGeometryToFlat,N as convertGeometryxToFlat,B as convertOptimizedGeometryToFlat,w as getBoundingBox,b as getBoundingRect,Y as getExtentJSON,H as writeBezierCurveSegment,G as writeCircularArcSegment,q as writeEllipticArc4Segment,D as writeEllipticArc7Segment};
2
+ import{__addDisposableResource as t,__disposeResources as e}from"tslib";import{baseTypedSubArrayMemory as r}from"../core/memoryEstimations.js";import s from"./SpatialReference.js";import{empty as n,expandWithExtent as i}from"./support/aaBoundingBox.js";import{empty as a,expandExtentInPlace as o}from"./support/aaBoundingRect.js";import{isPoint as u,isMultipoint as h,isPolyline as l,isGeometryWithM as c,isGeometryWithZ as g}from"./support/jsonTypeUtils.js";import{equals as f}from"./support/spatialReferenceUtils.js";import{interpolateCircle as m}from"./support/curves/circleUtils.js";import{deriveCircleFromCircularArc as p}from"./support/curves/circularArcUtils.js";import{curveExtent as x}from"./support/curves/curveExtent.js";import{getEndpoint as v,isCurvedGeometry as d,isEllipticArc7 as y,isEllipticArc4 as C,isCircularArc as M,isBezierCurve as E}from"./support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as O}from"./support/curves/ellipticArc4Utils.js";import{deriveEllipse as S,interpolateEllipse as F}from"./support/curves/ellipticArc7Utils.js";import P from"../layers/graphics/OptimizedGeometry.js";class _{constructor({type:t,spatialReference:e,vertexCount:r,vertexXY:s,vertexZ:n,vertexM:i,partCount:a,partOffsets:o,partFlags:u,segmentFlags:h,segmentIndices:l,segmentParams:c,segmentCountArc:g,segmentCountBezier:f}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=t,this.spatialReference=e,this.vertexCount=r,this.vertexXY=s,this.vertexZ=n,this.vertexM=i,this.partCount=a,this.partOffsets=o,this.partFlags=u,this.segmentFlags=h,this.segmentIndices=l,this.segmentParams=c,this.segmentCountArc=g,this.segmentCountBezier=f}get segmentParamCount(){return 10*this.segmentCountArc+4*this.segmentCountBezier}get segmentCountLine(){const{segmentCount:t,segmentCountArc:e,segmentCountBezier:r}=this;return t&&t-e-r}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}hasCurves(){return null!=this.segmentFlags}isMultipart(){return"polyline"===this.type||"polygon"===this.type}get usedMemory(){function t(t){return t?r+t.byteLength:0}return t(this.vertexXY)+t(this.vertexZ)+t(this.vertexM)+t(this.partOffsets)+t(this.partFlags)+t(this.segmentFlags)+t(this.segmentIndices)+t(this.segmentParams)}clone(){const{type:t,vertexCount:e,partCount:r,hasZ:s,hasM:n,segmentCountArc:i,segmentCountBezier:a}=this,o=U(t,e,r,s,n,this.hasCurves(),i,a);o.spatialReference=this.spatialReference;const{vertexXY:u,vertexZ:h,vertexM:l}=this;if(o.vertexXY.set(u.subarray(0,2*e),0),o.vertexZ?.set(h.subarray(0,e),0),o.vertexM?.set(l.subarray(0,e),0),this.isMultipart()){const{partOffsets:t,partFlags:e}=this;o.partFlags.set(e.subarray(0,r+1)),o.partOffsets.set(t.subarray(0,r+1))}if(this.hasCurves()){const{segmentFlags:t,segmentIndices:r,segmentParams:s,segmentParamCount:n}=this;o.segmentFlags.set(t.subarray(0,e),0),o.segmentIndices.set(r.subarray(0,e),0),o.segmentParams.set(s.subarray(0,n),0)}return o}equals(t){return this.equalsWithinTolerance(t,0)}equalsWithinTolerance(t,e){if(null==t)return!1;if(this===t)return!0;if(!f(this.spatialReference,t.spatialReference))return!1;if(this.vertexCount!==t.vertexCount||this.partCount!==t.partCount)return!1;if(this.hasZ!==t.hasZ||this.hasM!==t.hasM)return!1;if(this.hasCurves()!==t.hasCurves()||this.segmentCountArc!==t.segmentCountArc||this.segmentCountBezier!==t.segmentCountBezier)return!1;const r=0===e?(t,e)=>t!==e||isNaN(t)!==isNaN(e):(t,r)=>Math.abs(t-r)>e||isNaN(t)!==isNaN(r);for(let s=0;s<this.vertexCount;++s)if(r(this.vertexXY[2*s],t.vertexXY[2*s])||r(this.vertexXY[2*s+1],t.vertexXY[2*s+1]))return!1;if(this.hasZ)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexZ[s],t.vertexZ[s]))return!1;if(this.hasM)for(let s=0;s<this.vertexCount;++s)if(r(this.vertexM[s],t.vertexM[s]))return!1;for(let s=0;s<this.partCount;++s)if(this.partFlags[s]!==t.partFlags[s]||this.partOffsets[s]!==t.partOffsets[s])return!1;if(this.hasCurves()){for(let e=0;e<this.vertexCount;++e)if(this.segmentFlags[e]!==t.segmentFlags[e]||this.segmentIndices[e]!==t.segmentIndices[e])return!1;for(let e=0;e<this.segmentParamCount;++e)if(r(this.segmentParams[e],t.segmentParams[e]))return!1}return!0}get parts(){return this.isMultipart()?new Z(this):[][Symbol.iterator]()}}class Z{constructor(t){this.geometry=t,this.value=new A(t)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class A{constructor(t){this.geometry=t,this.index=-1,this._readVertex=j(t),this._segments=new R(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){const t=this.geometry.partOffsets;return t[this.index+1]-t[this.index]}}class R{constructor(t){this._part=t,this._partStart=0,this._partEnd=0,this._isPolygon="polygon"===t.geometry.type,this.value=new V(t.geometry)}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;const t=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=t&&this._isPolygon?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){const{index:t}=this._part,e=this._part.geometry.partOffsets;this._partStart=e[t],this._partEnd=e[t+1]-(this._isPolygon?1:2),this.value.indexOfStartVertex=this._partStart-1}}class V{constructor(t){this.geometry=t,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=j(t)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){const t=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===t)return this.end;const e=this.geometry.segmentParams;let r=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===t){const t=e[r++],s=e[r++],n=e[r++],i=e[r++];return{b:[this.end,[t,s],[n,i]]}}const s=e[r++],n=e[r++],i=e[r++],a=e[r++],o=e[r++],u=e[r++];r++,r++;const h=e[r++],l=e[r++];if(!Boolean(4&s)&&1===i)return{c:[this.end,[h,l]]};const c=2&s?0:1,g=1&s?0:1;return{a:[this.end,[o,u],c,g,a,n,i]}}}function Y(r){let s;const{vertexCount:n,vertexXY:i,vertexZ:o,vertexM:u}=r,h=z(r);if(r.hasCurves()){const n={stack:[],error:void 0,hasError:!1};try{t(n,new k(r,["vertexZ","vertexM"]),!1);const e=a();for(const t of r.parts){let r=t.startVertex;for(const{curve:s}of t.segments)x(e,r,s),r=v(s)}const[i,o,u,l]=e;s={xmin:i,ymin:o,xmax:u,ymax:l,spatialReference:h}}catch(l){n.error=l,n.hasError=!0}finally{e(n)}}else{let t,e,r,a;t=e=1/0,r=a=-1/0;for(let s=0;s<n;++s){const n=i[2*s],o=i[2*s+1];t=Math.min(t,n),r=Math.max(r,n),e=Math.min(e,o),a=Math.max(a,o)}s={xmin:t,ymin:e,xmax:r,ymax:a,spatialReference:h}}if(o){let t=1/0,e=-1/0;for(const r of o)t=Math.min(t,r),e=Math.max(e,r);s.zmin=t,s.zmax=e}if(u){let t=1/0,e=-1/0;for(const r of u)t=Math.min(t,r),e=Math.max(e,r);s.mmin=t,s.mmax=e}return s}function b(r,s){const n={stack:[],error:void 0,hasError:!1};try{s??=a();t(n,new k(r,["vertexZ","vertexM","spatialReference"]),!1);return o(s,Y(r)),s}catch(i){n.error=i,n.hasError=!0}finally{e(n)}}function w(r,s){const a={stack:[],error:void 0,hasError:!1};try{s??=n();t(a,new k(r,["vertexM","spatialReference"]),!1);return i(s,Y(r)),s}catch(o){a.error=o,a.hasError=!0}finally{e(a)}}function I(t){let e,r,s;if(u(t)){s="point";const{x:n,y:i,z:a,m:o}=t,u=[n,i];null!=a&&u.push(a),null!=o&&u.push(o),r=[[u]],e=1}else h(t)?(s="multipoint",r=[t.points],e=t.points.length):l(t)?(s="polyline",r=t.curvePaths??t.paths,e=r.reduce((t,e)=>t+e.length,0)):(s="polygon",r=t.curveRings??t.rings,e=r.reduce((t,e)=>(0===e.length||(t+=e.length,W(e[0],v(e.at(-1)))&&--t),t),0));const n=U(s,e,s.includes("point")?0:r.length,g(t),c(t),d(t)),{hasZ:i,hasM:a,vertexXY:o,vertexZ:f,vertexM:m}=n;function p(t){o[2*O]=t[0],o[2*O+1]=t[1],i&&(f[O]=t[2]),a&&(m[O]=t[x]),++O}n.spatialReference=t.spatialReference??void 0;const x=n.hasZ?3:2;let O=0;if(!n.isMultipart()){if(!i&&!a){for(const[t,e]of r[0])o[2*O]=t,o[2*O+1]=e,++O;return n}for(const t of r[0])p(t);return n}const S="polygon"===s,{partOffsets:F}=n;let P=0;if(!n.hasCurves()){for(const t of r){if(F[P++]=O,0===t.length)continue;let e=t.length;if(S&&W(t[0],t.at(-1))&&--e,i||a)for(let r=0;r<e;++r)p(t[r]);else for(let r=0;r<e;++r){const[e,s]=t[r];o[2*O]=e,o[2*O+1]=s,++O}}return F[P]=O,n}function _(t){const e=Z+t;if(e<=(n.segmentParams?.length??0))return;let r=e*K;r=20*Math.ceil(r/20);const s=n.segmentParams;n.segmentParams=new Float64Array(r),null!=s&&n.segmentParams.set(s)}let Z=0;for(const u of r){if(n.partOffsets[P++]=O,0===u.length)continue;const t=u[0];let e=t;for(let r=1;r<u.length;++r){const t=u[r];p(e);const s=O-1;y(t)?(_(10),++n.segmentCountArc,Z=D(e,t,n,s,Z),e=t.a[0]):C(t)?(_(10),++n.segmentCountArc,Z=q(e,t,n,s,Z),e=t.a[0]):M(t)?(_(10),++n.segmentCountArc,Z=G(e,t,n,s,Z),e=t.c[0]):E(t)?(_(4),++n.segmentCountBezier,Z=H(e,t,n,s,Z),e=t.b[0]):e=t}S&&W(t,e)||p(e)}return n.partOffsets[P]=O,n}function X(t){const e=j(t),{vertexCount:r,partCount:s,hasZ:n,hasM:i}=t,a=z(t);if("point"===t.type){const[e,r]=t.vertexXY,s=t.vertexZ?.[0],n=t.vertexM?.[0];return{x:e,y:r,z:s,m:n,spatialReference:a}}let o=0;if("multipoint"===t.type){const t=[];for(;o<r;)t.push(e(o++));return{points:t,spatialReference:a,hasZ:n,hasM:i}}const u="polygon"===t.type;if(!t.hasCurves()){const r=new Array;for(let n=0;n<s;++n){const s=t.partOffsets[n+1],i=new Array;for(;o<s;)i.push(e(o++));u&&i.length>0&&i.push(i[0]),r.push(i)}return u?{rings:r,hasZ:n,hasM:i,spatialReference:a}:{paths:r,hasZ:n,hasM:i,spatialReference:a}}const h=new Array;for(const{segments:l,startVertex:c}of t.parts){const t=[c];for(const{curve:e}of l)t.push(e);h.push(t)}return u?{rings:[],curveRings:h,hasZ:n,hasM:i,spatialReference:a}:{paths:[],curvePaths:h,hasZ:n,hasM:i,spatialReference:a}}function B(t,{lengths:e,coords:r,hasZ:s,hasM:n},i){const a=t.includes("point")?0:e.length,o="polygon"===t,u="point"===t?1:e.reduce((t,e)=>t+e,0)-(o?a:0);s??=!1,n??=!1;const h=U(t,u,a,s,n,!1,0,0);if(h.spatialReference=i??void 0,!h.isMultipart()){for(let t=0,e=0;t<u;++t)h.vertexXY[2*t]=r[e++],h.vertexXY[2*t+1]=r[e++],s&&(h.vertexZ[t]=r[e++]),n&&(h.vertexM[t]=r[e++]);return h}const l=2+Number(s)+Number(n);let c=0,g=0;h.partOffsets[0]=0;for(const f of e){const t=h.partOffsets[g],e=t+f-Number(o);h.partOffsets[++g]=e;for(let i=t;i<e;++i)h.vertexXY[2*i]=r[c++],h.vertexXY[2*i+1]=r[c++],s&&(h.vertexZ[i]=r[c++]),n&&(h.vertexM[i]=r[c++]);o&&(c+=l)}return h}function L({type:t,vertexCount:e,vertexXY:r,vertexZ:s,vertexM:n,partCount:i,partOffsets:a,hasZ:o,hasM:u}){const h=new P([],[],o,u);i=Math.max(i,1);const l="polygon"===t;let c=0;for(let g=0;g<i;++g){const t=a?.[g+1]??e,i=h.coords.length;for(let e=c;e<t;++e)h.coords.push(r[2*e],r[2*e+1]),o&&h.coords.push(s[e]),u&&h.coords.push(n[e]);if(l){const t=c;h.coords.push(r[2*t],r[2*t+1]),o&&h.coords.push(s[t]),u&&h.coords.push(n[t])}h.lengths.push((h.coords.length-i)/h.stride),c=t}return"point"===t&&(h.lengths.length=0),h}function N(t,e){return"getSpatialReference"in t&&(e=T(t.getSpatialReference()),t=t.getGeometry()),new _({...t.toFlatGeometry(),spatialReference:e})}function T(t){if(null==t)return;const e=t.getText()||void 0,r=t.isCustomWkid()?0:t.getOldID();if(r<=0)return{wkt:e};let s=t.getLatestID();(s<=0||s===r)&&(s=void 0);const n=t.getVCS();if(null==n)return{wkid:r,latestWkid:s,wkt:e};const i=n.isCustomWkid()?0:n.getOldID();if(i<=0)return{wkt:e};let a=t.getLatestVerticalID();return(a<=0||a===i)&&(a=void 0),{wkid:r,wkt:e,latestWkid:s,vcsWkid:i,latestVcsWkid:a}}class k{constructor(t,e){this.target=t,this.keys=e,this.oldValues=e.map(e=>t[e]);for(const r of e)t[r]=void 0}[Symbol.dispose](){this.keys.map((t,e)=>{this.target[t]=this.oldValues[e]})}}function z({spatialReference:t}){return t instanceof s?t.toJSON():t}function j({vertexXY:t,vertexZ:e,vertexM:r}){return e?r?s=>[t[2*s],t[2*s+1],e[s],r[s]]:r=>[t[2*r],t[2*r+1],e[r]]:r?e=>[t[2*e],t[2*e+1],r[e]]:e=>[t[2*e],t[2*e+1]]}function W(t,e){return t.every((t,r)=>t===e[r])}function U(t,e,r,s,n,i,a,o){a??=0,o??=0;const u=new _({type:t,vertexCount:e,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:r,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:a,segmentCountBezier:o});let h=2*Float64Array.BYTES_PER_ELEMENT*e;s&&(h+=Float64Array.BYTES_PER_ELEMENT*e),n&&(h+=Float64Array.BYTES_PER_ELEMENT*e),u.isMultipart()&&(h+=(r+1)*Int32Array.BYTES_PER_ELEMENT,h+=(r+1)*Int8Array.BYTES_PER_ELEMENT),i&&(h+=e*Int8Array.BYTES_PER_ELEMENT,h+=e*Int32Array.BYTES_PER_ELEMENT,h+=u.segmentParamCount*Float64Array.BYTES_PER_ELEMENT);const l=new ArrayBuffer(h);let c=0;return u.vertexXY=new Float64Array(l,c,2*e),c+=u.vertexXY.byteLength,s&&(u.vertexZ=new Float64Array(l,c,e),c+=u.vertexZ.byteLength),n&&(u.vertexM=new Float64Array(l,c,e),c+=u.vertexM.byteLength),i&&(u.segmentParams=new Float64Array(l,c,u.segmentParamCount),c+=u.segmentParams.byteLength,u.segmentIndices=new Int32Array(l,c,e),u.segmentIndices.fill(Q),c+=u.segmentIndices.byteLength),u.isMultipart()&&(u.partOffsets=new Int32Array(l,c,r+1),c+=u.partOffsets.byteLength,u.partFlags=new Int8Array(l,c,r+1),c+=u.partFlags.byteLength,"polygon"===u.type&&u.partFlags.subarray(0,r).fill(1)),i&&(u.segmentFlags=new Int8Array(l,c,e),u.segmentFlags.fill(1),c+=u.segmentFlags.byteLength),u}function D(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;const[o,[u,h],l,c,g,f,m]=e.a;let p=4;c||(p|=1),l||(p|=2);const x=S(t,e),[v,d]=F(x,.5);return n[a++]=p,n[a++]=f,n[a++]=m,n[a++]=g,n[a++]=u,n[a++]=h,n[a++]=x.u2-x.u1,n[a++]=x.u1,n[a++]=v,n[a++]=d,a}function q(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;const o=O(t,e);return J(o,4,...m(o,.5),n,a)}function G(t,e,{segmentFlags:r,segmentIndices:s,segmentParams:n},i,a){r[i]=4,s[i]=a;return J(p(t,e),0,...e.c[1],n,a)}function J(t,e,r,s,n,i){const{cx:a,cy:o,thetaStart:u,thetaEnd:h,radius:l}=t;u>h||(e|=1);return Math.abs(h-u)<=Math.PI||(e|=2),n[i++]=e,n[i++]=l,n[i++]=1,n[i++]=0,n[i++]=a,n[i++]=o,n[i++]=h-u,n[i++]=u,n[i++]=r,n[i++]=s,i}function H(t,{b:[e,[r,s],[n,i]]},{segmentFlags:a,segmentIndices:o,segmentParams:u},h,l){return a[h]=2,o[h]=l,u[l++]=r,u[l++]=s,u[l++]=n,u[l++]=i,l}const K=1.61803,Q=-1;export{_ as FlatGeometry,U as allocateFlatGeometry,X as convertFlatToGeometryJSON,L as convertFlatToOptimizedGeometry,I as convertGeometryToFlat,N as convertGeometryxToFlat,B as convertOptimizedGeometryToFlat,w as getBoundingBox,b as getBoundingRect,Y as getExtentJSON,H as writeBezierCurveSegment,G as writeCircularArcSegment,q as writeEllipticArc4Segment,D as writeEllipticArc7Segment};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.21",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.1";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.1.0-next.22",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -1372,15 +1372,13 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
1372
1372
  * >
1373
1373
  * > **Notes**
1374
1374
  * >
1375
- * > FeatureLayers are not optimized for high-frequency, dynamic data, or real-time streaming use cases. As a result, they may not perform efficiently with rapidly updating data streams.
1376
- * > For real-time or dynamic data updates, use [StreamLayers](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/), which are designed for efficient handling of high-frequency streaming data and dynamic features.
1377
- * >
1378
- * > When calling the applyEdits method on a service that does not have [vertical coordinate system](https://pro.arcgis.com/en/pro-app/help/mapping/properties/vertical-coordinate-systems.htm) information,
1379
- * > the z-values of the geometries in the `edits` object will automatically be converted to match the spatial reference of the layer.
1380
- * > Example: The service has a horizontal spatial reference with `feet` units, and `applyEdits()` is called with z-values based on `meter` units,
1381
- * > then the method will automatically convert the z values from `meter` to `feet` units.
1382
- * >
1383
- * > As of version 4.17, using applyEdits to add geometries with z-values to a FeatureLayer with `hasZ: false` no longer silently drops the z-value and now throws an error.
1375
+ * > - FeatureLayers are not optimized for high-frequency, dynamic data, or real-time streaming use cases. As a result, they may not perform efficiently with rapidly updating data streams.
1376
+ * > For real-time or dynamic data updates, use [StreamLayers](https://developers.arcgis.com/javascript/latest/references/core/layers/StreamLayer/), which are designed for efficient handling of high-frequency streaming data and dynamic features.
1377
+ * > - When calling the applyEdits method on a service that does not have [vertical coordinate system](https://pro.arcgis.com/en/pro-app/help/mapping/properties/vertical-coordinate-systems.htm) information,
1378
+ * > the z-values of the geometries in the `edits` object will automatically be converted to match the spatial reference of the layer.
1379
+ * > Example: The service has a horizontal spatial reference with `feet` units, and `applyEdits()` is called with z-values based on `meter` units,
1380
+ * > then the method will automatically convert the z values from `meter` to `feet` units.
1381
+ * > - As of version 4.17, using applyEdits to add geometries with z-values to a FeatureLayer with `hasZ: false` no longer silently drops the z-value and now throws an error.
1384
1382
  *
1385
1383
  * @param edits - Object containing features and attachments to be added, updated or deleted.
1386
1384
  * @param options - Additional edit options to specify when editing features or attachments.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Error.js";import has from"../core/has.js";import i from"../core/Logger.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as n,sync as a}from"../core/reactiveUtils.js";import{property as l,subclass as p}from"../core/accessorSupport/decorators.js";import{persistable as m}from"../core/accessorSupport/decorators/persistable.js";import c from"../geometry/Extent.js";import d from"../geometry/SpatialReference.js";import h from"./Layer.js";import{APIKeyMixin as u}from"./mixins/APIKeyMixin.js";import{ArcGISService as f}from"./mixins/ArcGISService.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as S}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as _}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as v,url as j}from"./support/commonProperties.js";import T from"./support/SceneModifications.js";import{default3DTilesSpatialReference as w,default3DTilesFullExtent as L,initFullExtent as b}from"./support/tiles3DUtils.js";import x from"../portal/Portal.js";import{logInvalidElevationInfoWarning as P,elevationModeRequiredMessage as I,featureExpressionUnsupportedMessage as k}from"../support/elevationInfoUtils.js";import{f as R}from"../chunks/persistableUrlUtils.js";import{isBasemap as D}from"../support/userTypeGuards/isBasemap.js";import{initialize as E,switchMeshModificationPolygonVCSSync as U}from"../views/3d/layers/Lyr3DWorker.js";import{toWasmModification as O,fromWasmModification as A}from"../views/3d/layers/SceneLayerWorkerHandle.js";import{reader as M}from"../core/accessorSupport/decorators/reader.js";let q=class extends(f(g(S(_(o(y(u(h)))))))){readModifications(e,t,r){this._modificationsSource={url:R(e,r),context:r}}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,a))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=w,this.fullExtent=L,this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this._rootTilesetJSON=null,this._rootTileset=null,this._key=null,this._session=null,this._rootRequestPromise=null,this.queryElevationCallback=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}get rootTilesetJSON(){return this._rootTilesetJSON}get rootTileset(){return this._rootTileset}get key(){return this._key}get session(){return this._session}_findSessionParameter(e){const t=[e];for(;t?.length>0;){const e=t.pop();if(!e)return;for(const[i,o]of Object.entries(e)){if("uri"===i)try{const e=new URL("https://tmp"+o).searchParams.get("session");if(e)return e}catch(r){}"object"==typeof o&&null!==o&&t.push(o)}}return null}async requestRootAndSession(e){const o=(e,t)=>new r("3dtiles-init:"+e,t);return this._rootRequestPromise||(this._rootRequestPromise=new Promise((r,n)=>{this.url||n(o("url-missing","Layer url missing")),this._key=this.customParameters?this.customParameters.key:null;new Promise((e,r)=>{if(this.replacesTerrain&&!this._key){const i=this.portalItem?.portal||this.parent?.portalItem?.portal||x.getDefault();i.signIn().then(()=>{i.g3dTilesEnabled?t(i.restUrl+"/portals/self/modules/g3dtiles",{responseType:"json",query:{f:"json"}}).then(t=>{this._key=t.data.keyString,e()},()=>r(o("g3dtiles-key-error","Error fetching Google 3D Tiles key from portal"))):r(o("g3dTilesEnabled-false","Google 3D Tiles are not enabled on Portal "+i.url))},()=>r(o("sign-in-failed","Error signing in to Portal")))}else e()}).then(()=>{t(this.url,{query:this._key?{key:this._key,token:this.apiKey}:{token:this.apiKey},responseType:"array-buffer",signal:e}).then(e=>{try{this._rootTilesetJSON=JSON.parse((new TextDecoder).decode(e.data))}catch(t){return void n(o("root-parse-failed","Error parsing root tile, details: "+t))}this._rootTilesetJSON?(this._session=this._findSessionParameter(this._rootTilesetJSON),this._rootTileset=e.data,this.fullExtent=b(this._rootTilesetJSON),r(),this._rootRequestPromise=null):n(o("root-is-null","Root tile is null."))},e=>{s(e),n(o("root-load-failed","Error loading root tile")),this._rootRequestPromise=null,i.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})},e=>n(e))})),this._rootRequestPromise}async _doLoad(e){const t=null!=e?e.signal:null;if(this.isUsedAsGroundLayer&&!has("enable-feature:basemap-groundlayers"))throw new r("3dtiles-init:not-supported-in-groundlayers","Layer is not supported in basemap.");try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new r("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(o){s(o)}if(null!=this._modificationsSource){const t=await T.fromUrl(this._modificationsSource.url,this.spatialReference,e);if(t&&t.length>0){await E();try{const e=O(null,t.toArray(),this.spatialReference),r=U({modifications:e,inVCS:115700});r.success&&r.modifications&&A(r.modifications,t)}catch(n){i.getLogger(this).error("convert-mesh-modification-z-error","Error when converting:",n)}null!=this._modificationsSource&&this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}}await this.requestRootAndSession(t)}async beforeSave(){if(null==this._modificationsSource){const{modifications:t}=this;if(t&&t.length>0){await E();try{const e=O(null,t.toArray(),this.spatialReference),r=U({modifications:e,inVCS:5773});r.success&&r.modifications&&A(r.modifications,t)}catch(e){i.getLogger(this).error("convert-mesh-modification-z-error","Error when converting:",e)}}return}await this.load().then(()=>{},()=>{})}get hasAttributionData(){return!1}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";P(i.getLogger(this),I(t,"absolute-height",e)),P(i.getLogger(this),k(t,e))}get replacesTerrain(){return!!has("enable-feature:basemap-groundlayers")&&this.hasGoogleUrl&&this.isUsedAsGroundLayer}get isUsedAsGroundLayer(){return D(this.parent)}get hasGoogleUrl(){return!!this.url?.match(/.+\.googleapis.com/)}};e([l({type:["IntegratedMesh3DTilesLayer"]})],q.prototype,"operationalLayerType",void 0),e([l({type:T,clonable:e=>e.clone()}),m({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],q.prototype,"modifications",void 0),e([M(["web-scene","portal-item"],"modifications")],q.prototype,"readModifications",null),e([l({type:d})],q.prototype,"spatialReference",void 0),e([l({type:c})],q.prototype,"fullExtent",void 0),e([l(v)],q.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],q.prototype,"listMode",void 0),e([l(j)],q.prototype,"url",void 0),e([l({readOnly:!0})],q.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],q.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],q.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],q.prototype,"maxScale",void 0),e([l({readOnly:!0})],q.prototype,"hasAttributionData",null),e([l()],q.prototype,"replacesTerrain",null),e([l()],q.prototype,"isUsedAsGroundLayer",null),e([l()],q.prototype,"hasGoogleUrl",null),q=e([p("esri.layers.IntegratedMesh3DTilesLayer")],q);const G=q;export{G as default};
2
+ import{__decorate as e}from"tslib";import t from"../request.js";import o from"../core/Error.js";import has from"../core/has.js";import r from"../core/Logger.js";import{MultiOriginJSONSupportMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as a,sync as n}from"../core/reactiveUtils.js";import{property as l,subclass as p}from"../core/accessorSupport/decorators.js";import{persistable as m}from"../core/accessorSupport/decorators/persistable.js";import c from"../geometry/Extent.js";import d from"../geometry/SpatialReference.js";import u from"./Layer.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISService as f}from"./mixins/ArcGISService.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as S}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as _}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as v,url as j}from"./support/commonProperties.js";import T from"./support/SceneModifications.js";import{default3DTilesSpatialReference as w,default3DTilesFullExtent as L,initFullExtent as b}from"./support/tiles3DUtils.js";import x from"../portal/Portal.js";import{logInvalidElevationInfoWarning as P,elevationModeRequiredMessage as I,featureExpressionUnsupportedMessage as k}from"../support/elevationInfoUtils.js";import{f as R}from"../chunks/persistableUrlUtils.js";import{isBasemap as D}from"../support/userTypeGuards/isBasemap.js";import{initialize as U,switchMeshModificationPolygonVCSSync as E}from"../views/3d/layers/Lyr3DWorker.js";import{toWasmModification as O,fromWasmModificationInLoad as M}from"../views/3d/layers/SceneLayerWorkerHandle.js";import{reader as q}from"../core/accessorSupport/decorators/reader.js";let A=class extends(f(g(S(_(i(y(h(u)))))))){readModifications(e,t,o){this._modificationsSource={url:R(e,o),context:o}}initialize(){this.addHandles(a(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,n))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=w,this.fullExtent=L,this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this._rootTilesetJSON=null,this._rootTileset=null,this._key=null,this._session=null,this._rootRequestPromise=null,this.queryElevationCallback=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}get rootTilesetJSON(){return this._rootTilesetJSON}get rootTileset(){return this._rootTileset}get key(){return this._key}get session(){return this._session}_findSessionParameter(e){const t=[e];for(;t?.length>0;){const e=t.pop();if(!e)return;for(const[r,i]of Object.entries(e)){if("uri"===r)try{const e=new URL("https://tmp"+i).searchParams.get("session");if(e)return e}catch(o){}"object"==typeof i&&null!==i&&t.push(i)}}return null}async requestRootAndSession(e){const i=(e,t)=>new o("3dtiles-init:"+e,t);return this._rootRequestPromise||(this._rootRequestPromise=new Promise((o,a)=>{this.url||a(i("url-missing","Layer url missing")),this._key=this.customParameters?this.customParameters.key:null;new Promise((e,o)=>{if(this.replacesTerrain&&!this._key){const r=this.portalItem?.portal||this.parent?.portalItem?.portal||x.getDefault();r.signIn().then(()=>{r.g3dTilesEnabled?t(r.restUrl+"/portals/self/modules/g3dtiles",{responseType:"json",query:{f:"json"}}).then(t=>{this._key=t.data.keyString,e()},()=>o(i("g3dtiles-key-error","Error fetching Google 3D Tiles key from portal"))):o(i("g3dTilesEnabled-false","Google 3D Tiles are not enabled on Portal "+r.url))},()=>o(i("sign-in-failed","Error signing in to Portal")))}else e()}).then(()=>{t(this.url,{query:this._key?{key:this._key,token:this.apiKey}:{token:this.apiKey},responseType:"array-buffer",signal:e}).then(e=>{try{this._rootTilesetJSON=JSON.parse((new TextDecoder).decode(e.data))}catch(t){return void a(i("root-parse-failed","Error parsing root tile, details: "+t))}this._rootTilesetJSON?(this._session=this._findSessionParameter(this._rootTilesetJSON),this._rootTileset=e.data,this.fullExtent=b(this._rootTilesetJSON),o(),this._rootRequestPromise=null):a(i("root-is-null","Root tile is null."))},e=>{s(e),a(i("root-load-failed","Error loading root tile")),this._rootRequestPromise=null,r.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})},e=>a(e))})),this._rootRequestPromise}async _doLoad(e){const t=null!=e?e.signal:null;if(this.isUsedAsGroundLayer&&!has("enable-feature:basemap-groundlayers"))throw new o("3dtiles-init:not-supported-in-groundlayers","Layer is not supported in basemap.");try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new o("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(i){s(i)}if(null!=this._modificationsSource){const t=await T.fromUrl(this._modificationsSource.url,this.spatialReference,e);if(t&&t.length>0){await U();try{const e=O(null,t.toArray(),this.spatialReference),o=E({modifications:e,inVCS:115700});o.success&&o.modifications&&M(o.modifications,t)}catch(a){r.getLogger(this).error("convert-mesh-modification-z-error","Error when converting:",a)}null!=this._modificationsSource&&this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}}await this.requestRootAndSession(t)}async beforeSave(){if(null==this._modificationsSource){const{modifications:e}=this;return void(e&&e.length>0&&await U())}await this.load().then(()=>{},()=>{})}get hasAttributionData(){return!1}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";P(r.getLogger(this),I(t,"absolute-height",e)),P(r.getLogger(this),k(t,e))}get replacesTerrain(){return!!has("enable-feature:basemap-groundlayers")&&this.hasGoogleUrl&&this.isUsedAsGroundLayer}get isUsedAsGroundLayer(){return D(this.parent)}get hasGoogleUrl(){return!!this.url?.match(/.+\.googleapis.com/)}};e([l({type:["IntegratedMesh3DTilesLayer"]})],A.prototype,"operationalLayerType",void 0),e([l({type:T,clonable:e=>e.clone()}),m({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],A.prototype,"modifications",void 0),e([q(["web-scene","portal-item"],"modifications")],A.prototype,"readModifications",null),e([l({type:d})],A.prototype,"spatialReference",void 0),e([l({type:c})],A.prototype,"fullExtent",void 0),e([l(v)],A.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],A.prototype,"listMode",void 0),e([l(j)],A.prototype,"url",void 0),e([l({readOnly:!0})],A.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],A.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],A.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],A.prototype,"maxScale",void 0),e([l({readOnly:!0})],A.prototype,"hasAttributionData",null),e([l()],A.prototype,"replacesTerrain",null),e([l()],A.prototype,"isUsedAsGroundLayer",null),e([l()],A.prototype,"hasGoogleUrl",null),A=e([p("esri.layers.IntegratedMesh3DTilesLayer")],A);const G=A;export{G as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import i from"../request.js";import t from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{createAbortError as a,isAborted as n,isAbortError as o}from"../core/promiseUtils.js";import{watch as l}from"../core/reactiveUtils.js";import{addFrameTask as d}from"../core/scheduling.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as c}from"../geometry/support/spatialReferenceUtils.js";import u from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as m,elevQueriesFull as g,elevQueriesGenericFail as w,invalidLayerView as p}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as b}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as f}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as M}from"../views/3d/layers/support/makeScheduleFunction.js";const L=3857,k=32662,R=4326,S=5773,C=115700;let W=class extends t{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,i,t,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=i){const e=s?`[js] ${t}`:`${t}`;0===i||1===i?r.getLogger(this).error(e):2===i&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([l(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),l(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=d({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,i)=>{this._lyr3DMain.cancel_elevation_query(i),e.rejectCallback(a())}),this._elevationQueries.clear(),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:m})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const i=this._layers.size;return 0===i&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),i}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(i=>{i.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){this._lyr3DMain.set_enabled(e.wasmLayerId,i),t.needMemoryUsageUpdate=!0;const s=this._isUpdating(t);t.needFrame=!0,s||t.layerView.updatingFlagChanged()}}setLayerOffset(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,i)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,i,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,i,t)}setMeshModifications(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){const s=this._lyr3DMain._malloc(8*i.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,i.length);for(let e=0;e<i.length;++e)r[e]=i[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,i.length),this._lyr3DMain._free(s);const a=this._isUpdating(t);t.needFrame=!0,a||t.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const i=this._layers.get(e);return!!i&&(i.outstandingJobCount>0||i.outstandingRenderableCount>0||i.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,i){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=v().then(t=>{this._lyr3DMain=t,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();const d="global"===this.view.viewingMode?5:3;if(5===d)this._viewSR.wkid=this._viewSR.latestWkid=R,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(this.view.renderSpatialReference?.isWebMercator)this._viewSR.wkid=this._viewSR.latestWkid=L,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(this.view.renderSpatialReference?.wkid===k)this._viewSR.wkid=this._viewSR.latestWkid=R,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(!this._viewSR.latestVcsWkid&&!this._viewSR.vcsWkid){const e=f(this.view.heightModelInfo);if(e)this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=e;else{const e=this.view.heightModelInfo?.heightModel,i=!e||"gravity-related-height"===e;this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=i?S:C}}return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,i,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0))?(this._workerHandle=new b(M(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,i){this._lyr3DMain?.set_lod_pixel_threshold(i);const t=this._layers.get(e.wasmLayerId);t&&(t.needFrame=!0)}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0)})}queryElevation(e,i,t){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===i.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===L?y.WebMercator:y.PlateCarree,r=i.projectSync(s);r&&(i=r);const a=2*i.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<i.coordinates.length;++y){const e=i.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=t?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===g)return Promise.reject("max mesh elevation query limit exceeded");if(d===w)return Promise.reject("elevation query failed");const h={descriptor:i,signal:t?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,i)=>{h.resolveCallback=e,h.rejectCallback=i});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((i,t)=>{n(i.signal)&&(this._lyr3DMain.cancel_elevation_query(t),i.rejectCallback(a()),e.push(t))});for(let i=0;i<e.length;++i)this._elevationQueries.delete(e[i])}_pulseTask(){if(this._lyr3DMain){if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;this._lyr3DMain.set_camera_elevation(e)}this._checkForAbortedElevationQueries();let e=0,i=0;this._layers.forEach(t=>{e+=t.layerView.usedMemory,i+=t.layerView.cachedMemory}),e/=1048576,i/=1048576;const t=this.view.resourceController.memoryController,s=t.usedMemory*t.maxMemory-e;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(t.memoryFactor,e,i,s,t.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._lyr3DBusyCount>0}_incrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount+=1,t||e.layerView.updatingFlagChanged()}_decrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount+=1,i||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_onJobFailed(e,i,t){i.error.length&&this._debugLog(1,1,i.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(t.jobId,t.desc),this._decrementJobCount(e,t)}_onJobSucceeded(e,i,t){if(this._lyr3DMain){if(e.layerView.destroyed)return void this._lyr3DMain.on_job_failed(t.jobId,t.desc);const s=i.data.byteLength,r=this._lyr3DMain._malloc(s);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,s).set(i.data),this._lyr3DMain.on_job_completed(t.jobId,i.jobDescJson,r,s),this._lyr3DMain._free(r)}this._decrementJobCount(e,t)}_getRequestPromises(e,t,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.append("session",r.session)}a.push(i(e.toString(),t).then(e=>e.data))}return a}_getInitialPromise(e,i,t,s,r,a,n){const l=this._getRequestPromises(e.urls,i,t,s);return Promise.all(l).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(i=>{let t=1;return o(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&400===i.details?.httpStatus?(t=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),{status:t,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),i=this._layers.get(e.layerId);if(!i)return;this._incrementJobCount(i,e);const t=i.abortController.signal,s=i.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:t,query:{...i.customParameters,token:i.apiKey,key:r}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(i,r,e);else if(0===r.status)this._onJobSucceeded(i,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{l.jobDescJson=r.jobDescJson,r.originalInputs?l.inputs=r.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const i of e)l.inputs.push(i);return this._workerHandle.invoke(l,t)}).then(t=>{1===t.status?this._onJobFailed(i,t,e):0===t.status&&this._onJobSucceeded(i,t,e)}).catch(t=>{this._decrementJobCount(i,e),o(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const i=await this._getInitialPromise(e,n,d,s,l,t,a);if(3===i.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(t);h(await this._getInitialPromise(e,n,d,s,l,t,s.session))}else h(i)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc),this._decrementJobCount(i,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:i}=e;i.data&&i.data.byteLength>0&&(i.data=i.data.slice());const t=this._layers.get(e.layerId);t&&(this._incrementRenderableCount(t),t.layerView.createRenderable(e).then(i=>{const s=i.numGaussians??0;this._lyr3DMain?.on_renderable_created(!0,e.layerId,e.handle,i.memUsageBytes,s),this._decrementRenderableCount(t)}).catch(i=>{o(i)||this._debugLog(2,1,`createRenderable failed with error ${i}.`),this._lyr3DMain?.on_renderable_created(!1,e.layerId,e.handle,0,0),this._decrementRenderableCount(t)}))}_freeRenderables(e,i,t){if(t<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,t);for(let o=0;o<t;++o)a.push(n[o]);for(let o=0;o<t;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,i,t,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,t,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(!!(1&d[h]));a.setRenderableVisibility(n,o,s)}_onWasmError(e,i,t,s){this._lyr3DMain&&this._debugLog(t,s,this._lyr3DMain.UTF8ToString(e,i),!1)}_onElevQueryComplete(e){const i=this._elevationQueries.get(e),t=this._lyr3DMain.get_elevation_query_result(e);if(i)if(t.succeeded&&t.zs){const s=t.zs.slice(),r=i.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),i.resolveCallback(r),this._elevationQueries.delete(e)}else i.rejectCallback(new s("elevation-query:error",t?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const i=this._layers.get(e.wasmLayerId);return!!i&&(i.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const i=e.layer;if(!i.url||!i.rootTilesetJSON)return{wasmLayerId:p};const t="integrated-mesh-3dtiles"===i.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(i.rootTilesetJSON),t);if(0!==s.errorCode)return{wasmLayerId:p,check:s};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:i.customParameters,apiKey:i.apiKey,needFrame:!0});const o=D(i.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(i)){let t=i.spatialReference;if(e.useEsriCrs&&i.esriCrsSpatialReference){t=i.esriCrsSpatialReference;const s=c(t);let r=1,a=1;!s&&t.wkid&&-1!==t.wkid&&(r=u.values[u[t.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(t)),s,r,a).catch(d),t.vcsWkid&&this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==t.vcsWkid&&this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d)}h=this._lyr3DMain.add_gaussian_splat_layer(l,i.url,a,o)}else this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,i.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")));return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:p})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:i,center:t,up:s,near:r,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:i,center:t,up:s,near:r,far:a,fov:n,aspectRatio:l,viewport:o}),this._markAllLayerViewsUpdating()}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const i=this._isUpdating(e);e.needFrame=!0,i||e.layerView.updatingFlagChanged()})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([h({constructOnly:!0})],W.prototype,"view",void 0),e([h({readOnly:!0})],W.prototype,"isTerrainReady",null),W=e([_("esri.layers.Lyr3DWasmPerSceneView")],W);const V=W;export{V as default};
2
+ import{__decorate as e}from"tslib";import i from"../request.js";import t from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{createAbortError as a,isAborted as n,isAbortError as o}from"../core/promiseUtils.js";import{watch as l}from"../core/reactiveUtils.js";import{addFrameTask as d}from"../core/scheduling.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as c}from"../geometry/support/spatialReferenceUtils.js";import u from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as m,elevQueriesFull as g,elevQueriesGenericFail as w,invalidLayerView as p}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as b}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as f}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as M}from"../views/3d/layers/support/makeScheduleFunction.js";const L=3857,k=32662,R=4326,S=5773,C=115700;let W=class extends t{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,i,t,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=i){const e=s?`[js] ${t}`:`${t}`;0===i||1===i?r.getLogger(this).error(e):2===i&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([l(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),l(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=d({preRender:()=>this._pulseTask()})}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,i)=>{this._lyr3DMain.cancel_elevation_query(i),e.rejectCallback(a())}),this._elevationQueries.clear(),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null);const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:m})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const i=this._layers.size;return 0===i&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),i}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(i=>{i.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){this._lyr3DMain.set_enabled(e.wasmLayerId,i),t.needMemoryUsageUpdate=!0;const s=this._isUpdating(t);t.needFrame=!0,s||t.layerView.updatingFlagChanged()}}setLayerOffset(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,i)}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,i,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,i,t)}setMeshModifications(e,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const t=this._layers.get(e.wasmLayerId);if(t){const s=this._lyr3DMain._malloc(8*i.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,i.length);for(let e=0;e<i.length;++e)r[e]=i[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,i.length),this._lyr3DMain._free(s);const a=this._isUpdating(t);t.needFrame=!0,a||t.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const i=this._layers.get(e);return!!i&&(i.outstandingJobCount>0||i.outstandingRenderableCount>0||i.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,i){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=v().then(t=>{this._lyr3DMain=t,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();const d="global"===this.view.viewingMode?5:3;if(5===d)this._viewSR.wkid=this._viewSR.latestWkid=R,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(this.view.renderSpatialReference?.isWebMercator)this._viewSR.wkid=this._viewSR.latestWkid=L,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(this.view.renderSpatialReference?.wkid===k)this._viewSR.wkid=this._viewSR.latestWkid=R,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=S;else if(!this._viewSR.latestVcsWkid&&!this._viewSR.vcsWkid){const e=f(this.view.heightModelInfo);if(e)this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=e;else{const e=this.view.heightModelInfo?.heightModel,i=!e||"gravity-related-height"===e;this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=i?S:C}}return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,i,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0))?(this._workerHandle=new b(M(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,i){this._lyr3DMain?.set_lod_pixel_threshold(i);const t=this._layers.get(e.wasmLayerId);t&&(t.needFrame=!0)}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0)})}queryElevation(e,i,t){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===i.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===L?y.WebMercator:y.PlateCarree,r=i.projectSync(s);r&&(i=r);const a=2*i.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<i.coordinates.length;++y){const e=i.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=t?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===g)return Promise.reject("max mesh elevation query limit exceeded");if(d===w)return Promise.reject("elevation query failed");const h={descriptor:i,signal:t?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,i)=>{h.resolveCallback=e,h.rejectCallback=i});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((i,t)=>{n(i.signal)&&(this._lyr3DMain.cancel_elevation_query(t),i.rejectCallback(a()),e.push(t))});for(let i=0;i<e.length;++i)this._elevationQueries.delete(e[i])}_pulseTask(){if(this._lyr3DMain){if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;this._lyr3DMain.set_camera_elevation(e)}this._checkForAbortedElevationQueries();let e=0,i=0;this._layers.forEach(t=>{e+=t.layerView.usedMemory,i+=t.layerView.cachedMemory}),e/=1048576,i/=1048576;const t=this.view.resourceController.memoryController,s=t.usedMemory*t.maxMemory-e-this._lyr3DInternalMemoryBytes/1048576;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(t.memoryFactor,e,i,s,t.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._lyr3DBusyCount>0}_incrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount+=1,t||e.layerView.updatingFlagChanged()}_decrementJobCount(e,i){if(i.isForElevationQuery)return;const t=this._isUpdating(e);e.outstandingJobCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount+=1,i||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const i=this._isUpdating(e);e.outstandingRenderableCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_onJobFailed(e,i,t){i.error.length&&this._debugLog(1,1,i.error,!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(t.jobId,t.desc),this._decrementJobCount(e,t)}_onJobSucceeded(e,i,t){if(this._lyr3DMain){if(e.layerView.destroyed)return void this._lyr3DMain.on_job_failed(t.jobId,t.desc);const s=i.data.byteLength,r=this._lyr3DMain._malloc(s);new Uint8Array(this._lyr3DMain.HEAPU8.buffer,r,s).set(i.data),this._lyr3DMain.on_job_completed(t.jobId,i.jobDescJson,r,s),this._lyr3DMain._free(r)}this._decrementJobCount(e,t)}_getRequestPromises(e,t,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.append("session",r.session)}a.push(i(e.toString(),t).then(e=>e.data))}return a}_getInitialPromise(e,i,t,s,r,a,n){const l=this._getRequestPromises(e.urls,i,t,s);return Promise.all(l).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(i=>{let t=1;return o(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&400===i.details?.httpStatus?(t=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),{status:t,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),i=this._layers.get(e.layerId);if(!i)return;this._incrementJobCount(i,e);const t=i.abortController.signal,s=i.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:t,query:{...i.customParameters,token:i.apiKey,key:r}},l={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(i,r,e);else if(0===r.status)this._onJobSucceeded(i,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{l.jobDescJson=r.jobDescJson,r.originalInputs?l.inputs=r.originalInputs:l.inputs=[],l.isMissingResourceCase=!0;for(const i of e)l.inputs.push(i);return this._workerHandle.invoke(l,t)}).then(t=>{1===t.status?this._onJobFailed(i,t,e):0===t.status&&this._onJobSucceeded(i,t,e)}).catch(t=>{this._decrementJobCount(i,e),o(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc)})}};try{const i=await this._getInitialPromise(e,n,d,s,l,t,a);if(3===i.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(t);h(await this._getInitialPromise(e,n,d,s,l,t,s.session))}else h(i)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain&&this._lyr3DMain.on_job_failed(e.jobId,e.desc),this._decrementJobCount(i,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:i}=e;i.data&&i.data.byteLength>0&&(i.data=i.data.slice());const t=this._layers.get(e.layerId);t&&(this._incrementRenderableCount(t),t.layerView.createRenderable(e).then(i=>{const s=i.numGaussians??0;this._lyr3DMain?.on_renderable_created(!0,e.layerId,e.handle,i.memUsageBytes,s),this._decrementRenderableCount(t)}).catch(i=>{o(i)||this._debugLog(2,1,`createRenderable failed with error ${i}.`),this._lyr3DMain?.on_renderable_created(!1,e.layerId,e.handle,0,0),this._decrementRenderableCount(t)}))}_freeRenderables(e,i,t){if(t<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,t);for(let o=0;o<t;++o)a.push(n[o]);for(let o=0;o<t;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,i,t,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,i,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,t,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(!!(1&d[h]));a.setRenderableVisibility(n,o,s)}_onWasmError(e,i,t,s){this._lyr3DMain&&this._debugLog(t,s,this._lyr3DMain.UTF8ToString(e,i),!1)}_onElevQueryComplete(e){const i=this._elevationQueries.get(e),t=this._lyr3DMain.get_elevation_query_result(e);if(i)if(t.succeeded&&t.zs){const s=t.zs.slice(),r=i.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),i.resolveCallback(r),this._elevationQueries.delete(e)}else i.rejectCallback(new s("elevation-query:error",t?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const i=this._layers.get(e.wasmLayerId);return!!i&&(i.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const i=e.layer;if(!i.url||!i.rootTilesetJSON)return{wasmLayerId:p};const t="integrated-mesh-3dtiles"===i.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(i.rootTilesetJSON),t);if(0!==s.errorCode)return{wasmLayerId:p,check:s};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:i.customParameters,apiKey:i.apiKey,needFrame:!0});const o=D(i.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(i)){let t=i.spatialReference;if(e.useEsriCrs&&i.esriCrsSpatialReference){t=i.esriCrsSpatialReference;const s=c(t);let r=1,a=1;!s&&t.wkid&&-1!==t.wkid&&(r=u.values[u[t.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(t)),s,r,a).catch(d),t.vcsWkid&&this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==t.vcsWkid&&this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d)}h=this._lyr3DMain.add_gaussian_splat_layer(l,i.url,a,o)}else this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,i.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")));return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:p})}_updateWasmCamera(){const e=this.view.state?.contentCamera;if(!e||!this._lyr3DMain)return;const{eye:i,center:t,up:s,near:r,far:a,fovY:n}=e,o=[e.viewport[2],e.viewport[3]],l=e.width/e.height;this._lyr3DMain.set_camera_parameters({eye:i,center:t,up:s,near:r,far:a,fov:n,aspectRatio:l,viewport:o}),this._markAllLayerViewsUpdating()}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const i=this._isUpdating(e);e.needFrame=!0,i||e.layerView.updatingFlagChanged()})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([h({constructOnly:!0})],W.prototype,"view",void 0),e([h({readOnly:!0})],W.prototype,"isTerrainReady",null),W=e([_("esri.layers.Lyr3DWasmPerSceneView")],W);const V=W;export{V as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as e}from"../../../core/lang.js";import{polygonCentroid as t,extentCentroid as s}from"../../../geometry/support/centroid.js";import{getPolygonExtent as i,getGeometryExtent as a}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as n}from"../../../geometry/support/quantizationUtils.js";import{isValid as r,equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{closestPointOnCurve as l}from"../../../geometry/support/curves/closestPointOnCurve.js";import{getEndpoint as u,isCoordinate as c,cloneCurve as m}from"../../../geometry/support/curves/curveUtils.js";import d from"./AttributesBuilder.js";import{cleanFromGeometryEngine as p,getGeometry as f,transformCentroid as h}from"./geometryUtils.js";import{project as y}from"./projectionSupport.js";import{getDateInNumber as g}from"./queryUtils.js";import{SnappingCandidateEdge as x,SnappingCandidateVertex as T}from"./SnappingCandidate.js";import{isDateField as F,isDateOnlyField as I,isTimestampOffsetField as _,isStringField as v,isTimeOnlyField as V}from"../../support/fieldUtils.js";import S from"../../../rest/support/AutoIntervalBinParameters.js";import b from"../../../rest/support/DateBinParameters.js";import{unitsDict as z}from"../../../rest/support/DateBinUtils.js";import R from"../../../rest/support/FixedBoundariesBinParameters.js";import B from"../../../rest/support/FixedIntervalBinParameters.js";import{isNullCountSupported as M,calculateStringStatistics as A,calculateStatistics as w,processSummaryStatisticsResult as N,calculateUniqueValuesCount as D,createUVResult as P,calculateClassBreaks as q,resolveCBResult as j,calculateHistogram as C,getAttributeComparator as O,calculatePercentile as Z,binIndex as G,getBinParams as E}from"../../../statistics/utils.js";import{utc as H}from"../../../time/constants.js";import{DateTime as U}from"luxon";const k="bin";class J{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new d(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,a=t?.length;if(!!!a)return 1;const n=new Map,r=new Map,o=new Set;for(const l of i){const{statisticType:i}=l,a="exceedslimit"!==i?l.onStatisticField:void 0;if(!r.has(a)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,this.items,n);s.push(t)}r.set(a,this._calculateUniqueValues(s,this.items,e.returnDistinctValues))}const u=r.get(a);for(const t in u){const{data:i,items:a}=u[t],n=i.join(",");s&&!e.validateItems(a,s)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some(e=>"exceedslimit"===e.statisticType)?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;r(this.query.outSR)&&!o(t.spatialReference,this.query.outSR)?e.queryGeometry=p({spatialReference:this.query.outSR,...y(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=p({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,s){const i=this.featureAdapter,a=Y(this.hasZ,this.hasM),{point:n}=e,r="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y;function d(e,t){const s=(e-n.x)/r,i=(t-n.y)/o;return s*s+i*i}const p={candidates:[]},f="esriGeometryPolygon"===this.geometryType,h="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,y=this._getPointCreator(t,this.spatialReference,s),g=new X(null,0),F=new X(null,0),I={x:0,y:0,z:0};for(const l of this.items){const e=i.getObjectId(l),t=i.getGeometryWithCurves?.(l);if(null!=t){v(t,e);continue}const s=i.getGeometry(l);null==s||_(s,e)}return p.candidates.sort((e,t)=>e.distance-t.distance),p;function _(t,s){const{coords:i}=t,r=t.isPoint?L:t.lengths;if(g.coords=i,F.coords=i,e.returnEdge){let e=0;for(let t=0;t<r.length;t++){const i=r[t],o=e;for(let t=0;t<i;t++,e+=a){if(!f&&t===i-1)continue;if(g.coordsIndex=e,F.coordsIndex=t===i-1?o:e+a,!Q(I,n,g,F))continue;const r=d(I.x,I.y);r<=1&&p.candidates.push(new x(s,y(I),Math.sqrt(r),y(g),y(F)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<r.length;t++){const i=r[t],n=e,o=F;o.coordsIndex=n;for(let t=0;t<i;t++,e+=a){if(g.coordsIndex=e,f&&t===i-1&&g.x===o.x&&g.y===o.y)continue;const a=d(g.x,g.y);a<=1&&p.candidates.push(new T(s,y(g),Math.sqrt(a)))}}}else if(h&&"ends"===e.vertexMode){let e=0;const t=[];for(let s=0;s<r.length;s++){t.push(e);const i=r[s];e+=i*a,i>1&&t.push(e-a)}for(const i of t){g.coordsIndex=i;const e=d(g.x,g.y);e<=1&&p.candidates.push(new T(s,y(g),Math.sqrt(e)))}}}function v(t,s){const{candidates:i}=p,a={x:0,y:0,z:0};if(e.returnEdge){const e=[n.x,n.y],r=new X(e,0),o=new X(e,0);for(const{segments:n}of t.parts)for(const{start:t,curve:p}of n){const{curvePoint:n}=l(t,p,e),f=d(...n);if(f>1)continue;[a.x,a.y]=n,r.coords=t,o.coords=u(p);const h=c(p)?null:m(p);i.push(new x(s,y(a),Math.sqrt(f),y(r),y(o),!1,h))}}function r(e){a.x=t.vertexXY[2*e],a.y=t.vertexXY[2*e+1];const n=d(a.x,a.y);n>1||(a.z=t.vertexZ?.[e]??0,i.push(new T(s,y(a),Math.sqrt(n))))}if("all"===e.vertexMode){const{vertexCount:e}=t;for(let t=0;t<e;++t)r(t);return}if("ends"===e.vertexMode)switch(t.type){case"point":r(0);break;case"polyline":for(let e=0;e<t.partCount;++e){const s=t.partOffsets[e],i=t.partOffsets[e+1]-1;r(s),i!==s&&r(i)}}}}_getPointCreator(e,t,s){const i=null==s||o(t,s)?e=>e:e=>y(e,t,s),{hasZ:a}=this,n=0;return a&&e?({x:e,y:t,z:s})=>i({x:e,y:t,z:s}):({x:e,y:t})=>i({x:e,y:t,z:n})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,minValue:r,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,m=this.fieldsIndex.get(t),d=F(m)||I(m)||_(m),p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:l,timeZone:u},this.items),f=M({normalizationType:a,normalizationField:i,minValue:r,maxValue:o}),h={value:.5,fieldType:m?.type},y=v(m)?A({values:p,supportsNullCount:f,percentileParams:h,outStatisticTypes:c}):w({values:p,minValue:r,maxValue:o,useSampleStdDev:!a,supportsNullCount:f,percentileParams:h,outStatisticTypes:c});return N(y,c,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:n,timeZone:r}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:n,timeZone:r},this.items,!1),l=D(o);return P(l,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:m,timeZone:d}=e,p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:m,timeZone:d},this.items),f=q(p,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return j(f,r)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:m,timeZone:d}=e,p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:m,timeZone:d},this.items);return C(p,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.slice().reverse()){const t=i.split(" "),a=t[0],n=this.fieldsIndex.get(a),r=!!t[1]&&"desc"===t[1].toLowerCase(),o=O(n?.type,r,"case-sensitive");e.sort((e,t)=>{const i=s(e,a,n),r=s(t,a,n);return o(i,r)})}}_createFeatureQueryResponse(e){const{items:t,geometryType:s,hasM:i,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:m,resultOffset:d,returnZ:f,returnM:h}=e,y=null!=m&&t.length>(d||0)+m,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(e=>this.fieldsIndex.get(e)));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:s,hasM:i&&h,hasZ:a&&f,objectIdFieldName:r,spatialReference:p(u||o),transform:c&&n(c)||null}}_createFeatures(e,t){const s=new d(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:c,resultOffset:m,resultRecordCount:p,returnZ:y=!1,returnM:g=!1}=e,x=a&&y,T=i&&g;let F=[],I=0;const _=[...t];if(this._sortFeatures(_,r,(e,t,i)=>s.getFieldValue(e,t,i)),this.geometryType&&(l||u)){const e=n(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!u)for(const i of _){const a=this.featureAdapter.getGeometry(i),n=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),geometry:f(this.geometryType,a,c,e,x,T)});t&&a&&!n.geometry&&(n.centroid=h(this,this.featureAdapter.getCentroid(i,this),e)),F[I++]=n}else if(!l&&u)for(const i of _)F[I++]=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),centroid:h(this,this.featureAdapter.getCentroid(i,this),e)});else for(const i of _)F[I++]=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),centroid:h(this,this.featureAdapter.getCentroid(i,this),e),geometry:f(this.geometryType,this.featureAdapter.getGeometry(i),c,e,x,T)})}else for(const n of _){const e=s.getAttributes(n);e&&(F[I++]=this._addFeatureJSONMetadata(n,{attributes:e}))}const v=m||0;if(null!=p){const e=v+p;F=F.slice(v,Math.min(F.length,e))}return F}_addFeatureJSONMetadata(e,t){const s=this.featureAdapter.getMetadata?.(e);return void 0!==s&&(t.metadata=s),t}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY;for(const a of this.query.outStatistics??[])if("exceedslimit"===a.statisticType){t=null!=a.maxPointCount?a.maxPointCount:Number.POSITIVE_INFINITY,s=null!=a.maxRecordCount?a.maxRecordCount:Number.POSITIVE_INFINITY,i=null!=a.maxVertexCount?a.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>s)e=!0;else{const t=Y(this.hasZ,this.hasM),s=this.featureAdapter;e=this.items.reduce((e,t)=>{const i=s.getGeometry(t);return e+(null!=i&&i.coords.length||0)},0)/t>i}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,s={attributes:{}}){const i=[],a=new Map,n=new Map,r=new Map,o=new Map,l=new d(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:m,orderByFields:p,resultRecordCount:f}=e,h=c?.length,y=!!h,g=y?c[0]:null,x=y&&!this.fieldsIndex.get(g);for(const d of u??[]){const{outStatisticFieldName:e,statisticType:u}=d,p=d,f="exceedslimit"!==u?d.onStatisticField:void 0,T="percentile_disc"===u||"percentile_cont"===u,F="EnvelopeAggregate"===u||"CentroidAggregate"===u||"ConvexHullAggregate"===u,I=y&&1===h&&(f===g||x)&&"count"===u;if(y){if(!r.has(f)){const e=[];for(const s of c){const i=this._getAttributeValues(l,s,t,a);e.push(i)}r.set(f,this._calculateUniqueValues(e,t,!F&&l.returnDistinctValues))}const s=r.get(f);if(!s)continue;const i=Object.keys(s);for(const n of i){const{count:i,data:r,items:u,itemPositions:d}=s[n],h=r.join(",");if(!m||l.validateItems(u,m)){const s=o.get(h)||{attributes:{}};if(F){s.aggregateGeometries||(s.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(p,u);s.aggregateGeometries[t]=e}else{let n=null;if(I)n=i;else{const e=this._getAttributeValues(l,f,t,a),s=d.map(t=>e[t]);n=T&&"statisticParameters"in p?this._getPercentileValue(p,s):this._getStatisticValue(p,s,null,l.returnDistinctValues)}s.attributes[e]=n}let n=0;c.forEach((e,t)=>s.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++n]=r[t]),o.set(h,s)}}}else if(F){s.aggregateGeometries||(s.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:i}=await this._getAggregateGeometry(p,t);s.aggregateGeometries[i]=e}else{const i=this._getAttributeValues(l,f,t,a);s.attributes[e]=T&&"statisticParameters"in p?this._getPercentileValue(p,i):this._getStatisticValue(p,i,n,l.returnDistinctValues)}const _="min"!==u&&"max"!==u||!v(this.fieldsIndex.get(f))&&!this._isAnyDateField(f)?null:this.fieldsIndex.get(f)?.type;i.push({name:e,alias:e,type:_||"esriFieldTypeDouble"})}const T=y?Array.from(o.values()):[s];return this._sortFeatures(T,p,(e,t)=>e.attributes[t]),f&&(T.length=Math.min(f,T.length)),{fields:i,features:T}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return F(t)||I(t)||_(t)||V(t)}async _getAggregateGeometry(e,n){const{convexHull:r,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:c,spatialReference:m,geometryType:d}=this,p=n.map(e=>f(d,c.getGeometry(e))),h=r(m,p,!0)[0],y={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=h?i(h):a(o(m,p));y.aggregateGeometries={...e,spatialReference:m},y.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=h?t(h):s(a(o(m,p)));y.aggregateGeometries={x:e[0],y:e[1],spatialReference:m},y.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(y.aggregateGeometries=h,y.outStatisticFieldName=u||"convexHull");return y}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:n}=e;let r=null;r=s?.has(a)?s.get(a):v(this.fieldsIndex.get(a))||this._isAnyDateField(a)?A({values:t,returnDistinct:i}):w({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,r);return r["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:n,orderBy:r}=i,o=this.fieldsIndex.get(s);return Z(t,{value:n,orderBy:r,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,s,i){if(i.has(t))return i.get(t);const a=this.fieldsIndex.get(t),n=s.map(s=>e.getFieldValue(s,t,a));return i.set(t,n),n}_calculateUniqueValues(e,t,s){const i={},a=t.length;for(let n=0;n<a;n++){const a=t[n],r=[];for(const t of e)r.push(t[n]);const o=r.join(",");null==i[o]?i[o]={count:1,data:r,items:[a],itemPositions:[n]}:(s||i[o].count++,i[o].items.push(a),i[o].itemPositions.push(n))}return i}async _getDataValues(t,s,i=!0){const a=new d(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:n,scale:r,timeZone:o}=t;return n?a.getExpressionValues(s,n,{viewingMode:"map",scale:r,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):a.getDataValues(s,e(t),i)}_calculateHistogramBins(e,t,s){if(null==t.min&&null==t.max)return[];const i=t.intervals,a=t.min??0,n=t.max??0,r=i.map(([e,t])=>({minValue:e,maxValue:t,count:0,items:[]}));for(let o=0;o<e.length;o++){const t=e[o],l=s[o];if(null!=t&&t>=a&&t<=n){const e=G(i,t);e>-1&&(r[e].count++,r[e].items.push(l))}}return r}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:s,outAlias:i,valueType:a}=t,n=[],r=[{name:i??s,alias:i??s,type:a??"esriFieldTypeString"},{name:k,alias:k,type:"esriFieldTypeInteger"}],o=new d(e,this.featureAdapter,this.fieldsIndex),l=new Map,u=[...this.items];this._sortFeatures(u,[s],(e,t,s)=>o.getFieldValue(e,t,s));const c=this._getAttributeValues(o,s,u,l),m=this._calculateUniqueValues([c],u,o.returnDistinctValues);for(const d in m){const{items:t}=m[d],a=await this._createBinsResponse(e,t);if(n.push(...a.features.map(e=>({...e,attributes:{...e.attributes,[i??s]:d}}))),a.fields)for(const e of a.fields)r.some(t=>t.name===e.name)||r.push(e)}return{fields:r,features:n}}async _createBinsResponse(e,t){const s=e.bin;switch(t=t??this.items,s.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(S.fromJSON(s),e,t);case"dateBin":return this._createDateBinsResponse(b.fromJSON(s),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(R.fromJSON(s),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(B.fromJSON(s),e,t)}}async _createAutoIntervalBinsResponse(e,t,s){const{field:i,normalizationField:a,numBins:n,normalizationType:r,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field||e.expression,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},s),m=E(c,{field:i,normalizationField:a,normalizationType:r,normalizationTotal:o,numBins:n,minValue:g(r?e.normalizationMinValue:l,!1),maxValue:g(r?e.normalizationMaxValue:u,!1)}),d=this._calculateHistogramBins(c,m,s);return this._createFeaturesFromHistogramBins(d,t)}async _createDateBinsResponse(e,t,s){const{field:i,interval:a,start:n,end:r,snapToData:o,returnFullIntervalBin:l,offset:u,firstDayOfWeek:c}=e,m=a.unit,d=await this._getDataValues({field:i||e.expression,timeZone:t.outTimeReference?.ianaTimeZone},s),p=V(this.fieldsIndex.get(i)),f=z.toJSON(m),h=d.filter(Boolean).sort((e,t)=>e-t),y=null!=n?g(n,p):h[0],x=null!=r?g(r,p):h[h.length-1],T=[];if(null!=y&&null!=x){const e={zone:t.outTimeReference?.ianaTimeZone??H},s=u?.unit?z.toJSON(u.unit):"milliseconds",i={[s]:u?.value||0},n=U.fromMillis(y,e).minus(i),r=U.fromMillis(x,e).minus(i),m="number"==typeof c&&c>=1&&c<=7?c:7,d=(e,t)=>{const s=(e.weekday-t+7)%7;return e.minus({days:s}).startOf("day")};if("last"===o){let e="week"===f?((e,t)=>d(e,t).plus({days:7}))(r,m):r;for(;e>n;){const t=e.minus({[f]:a.value});if(t<n){T.unshift([l?t.plus(i).toMillis():n.plus(i).toMillis(),e.plus(i).toMillis()]);break}T.unshift([t.plus(i).toMillis(),e.plus(i).toMillis()]),e=t}}else{let e="first"===o?n:"week"===f?d(n,m):n.startOf(f);for(;e<=r;){const t=e.plus({[f]:a.value});if(t>r){T.push([e.plus(i).toMillis(),l?t.plus(i).toMillis():r.plus(i).toMillis()]);break}T.push([e.plus(i).toMillis(),t.plus(i).toMillis()]),e=t}}}const F=this._calculateHistogramBins(d,{intervals:T,min:y,max:x},s);return this._createFeaturesFromHistogramBins(F,t)}async _createFixedBoundariesBinsResponse(e,t,s){const{field:i}=e,a=await this._getDataValues({field:i||e.expression,timeZone:t.outTimeReference?.ianaTimeZone},s),n=V(this.fieldsIndex.get(i)),r=e.boundaries.map(e=>g(e,n)).sort((e,t)=>e-t),o=[];for(let c=0;c<r.length-1;c++)o.push([r[c],r[c+1]]);const l={intervals:o,min:r.at(0),max:r.at(-1)},u=this._calculateHistogramBins(a,l,s);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,s){const{field:i,interval:a,normalizationType:n,start:r,end:o}=e,l=await this._getDataValues({field:i||e.expression,normalizationField:e.normalizationField,normalizationType:n,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},s),u=V(this.fieldsIndex.get(i)),c=E(l,{field:i,classificationMethod:"defined-interval",definedInterval:a,minValue:g(n?e.normalizationMinValue:r,u),maxValue:g(n?e.normalizationMaxValue:o,u)},!0),m=this._calculateHistogramBins(l,c,s);return this._createFeaturesFromHistogramBins(m,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:s,lowerBoundaryAlias:i}=t,a=i||"lowerBoundary",n=s||"upperBoundary",r=[],o=[{name:a,alias:a,type:"esriFieldTypeDouble"},{name:n,alias:n,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:k,alias:k,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const m="dateBin"===t.bin.type,d=t.outTimeReference?.ianaTimeZone;for(const p of e){const{minValue:e,maxValue:s,items:i}=p,f={attributes:{}};let h;if(f.attributes[a]=m&&d&&null!=e?U.fromMillis(e,{zone:d}).toISO():e,t.bin.hideUpperBound||(f.attributes[n]=m&&d&&null!=s?U.fromMillis(s,{zone:d}).toISO():s),l?(h=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},i),f.attributes[k]=++c,"flat"===t.bin.jsonStyle?r.push(...h.features.map(({attributes:{EXPR_1:e,...t},...s})=>({...s,attributes:u??e?{...t,[u??e]:e,...f.attributes}:{...t,...f.attributes}}))):(f.stackedAttributes=h.features.map(({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t),r.push(f))):(t.bin?.splitBy&&(f.attributes[k]=++c),h=await this._createStatisticsQueryResponse(t,i,f),r.push(f)),h.fields)for(const t of h.fields)o.some(e=>e.name===t.name)||o.push(t)}return"desc"===t.binOrder&&r.reverse(),{fields:o,features:r}}}function Q(e,t,s,i){const a=i.x-s.x,n=i.y-s.y,r=t.x-s.x,o=t.y-s.y,l=a*a+n*n;if(0===l)return!1;const u=r*a+o*n,c=Math.min(1,Math.max(0,u/l));return e.x=s.x+a*c,e.y=s.y+n*c,!0}function Y(e,t){return e?t?4:3:t?3:2}class X{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const L=[1];export{J as QueryEngineResult};
2
+ import{clone as e}from"../../../core/lang.js";import{polygonCentroid as t,extentCentroid as s}from"../../../geometry/support/centroid.js";import{getPolygonExtent as i,getGeometryExtent as a}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as n}from"../../../geometry/support/quantizationUtils.js";import{isValid as r,equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{closestPointOnCurve as l}from"../../../geometry/support/curves/closestPointOnCurve.js";import{getEndpoint as u,isCoordinate as c,cloneCurve as m}from"../../../geometry/support/curves/curveUtils.js";import d from"./AttributesBuilder.js";import{cleanFromGeometryEngine as p,getGeometry as f,transformCentroid as h}from"./geometryUtils.js";import{project as y}from"./projectionSupport.js";import{getDateInNumber as g}from"./queryUtils.js";import{SnappingCandidateEdge as x,SnappingCandidateVertex as T}from"./SnappingCandidate.js";import{isDateField as F,isDateOnlyField as I,isTimestampOffsetField as _,isStringField as v,isTimeOnlyField as V}from"../../support/fieldUtils.js";import S from"../../../rest/support/AutoIntervalBinParameters.js";import b from"../../../rest/support/DateBinParameters.js";import{unitsDict as z}from"../../../rest/support/DateBinUtils.js";import R from"../../../rest/support/FixedBoundariesBinParameters.js";import B from"../../../rest/support/FixedIntervalBinParameters.js";import{isNullCountSupported as M,calculateStringStatistics as A,calculateStatistics as w,processSummaryStatisticsResult as N,calculateUniqueValuesCount as D,createUVResult as P,calculateClassBreaks as q,resolveCBResult as j,calculateHistogram as C,getAttributeComparator as O,calculatePercentile as Z,binIndex as G,getBinParams as E}from"../../../statistics/utils.js";import{utc as H}from"../../../time/constants.js";import{DateTime as U}from"luxon";const k="bin";class J{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new d(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,a=t?.length;if(!!!a)return 1;const n=new Map,r=new Map,o=new Set;for(const l of i){const{statisticType:i}=l,a="exceedslimit"!==i?l.onStatisticField:void 0;if(!r.has(a)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,this.items,n);s.push(t)}r.set(a,this._calculateUniqueValues(s,this.items,e.returnDistinctValues))}const u=r.get(a);for(const t in u){const{data:i,items:a}=u[t],n=i.join(",");s&&!e.validateItems(a,s)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some(e=>"exceedslimit"===e.statisticType)?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;r(this.query.outSR)&&!o(t.spatialReference,this.query.outSR)?e.queryGeometry=p({spatialReference:this.query.outSR,...y(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=p({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,s){const i=this.featureAdapter,a=Y(this.hasZ,this.hasM),{point:n}=e,r="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y;function d(e,t){const s=(e-n.x)/r,i=(t-n.y)/o;return s*s+i*i}const p={candidates:[]},f="esriGeometryPolygon"===this.geometryType,h="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,y=this._getPointCreator(t,this.spatialReference,s),g=new X(null,0),F=new X(null,0),I={x:0,y:0,z:0};for(const l of this.items){const e=i.getObjectId(l),t=i.getGeometryWithCurves?.(l);if(null!=t){v(t,e);continue}const s=i.getGeometry(l);null==s||_(s,e)}return p.candidates.sort((e,t)=>e.distance-t.distance),p;function _(t,s){const{coords:i}=t,r=t.isPoint?L:t.lengths;if(g.coords=i,F.coords=i,e.returnEdge){let e=0;for(let t=0;t<r.length;t++){const i=r[t],o=e;for(let t=0;t<i;t++,e+=a){if(!f&&t===i-1)continue;if(g.coordsIndex=e,F.coordsIndex=t===i-1?o:e+a,!Q(I,n,g,F))continue;const r=d(I.x,I.y);r<=1&&p.candidates.push(new x(s,y(I),Math.sqrt(r),y(g),y(F)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<r.length;t++){const i=r[t],n=e,o=F;o.coordsIndex=n;for(let t=0;t<i;t++,e+=a){if(g.coordsIndex=e,f&&t===i-1&&g.x===o.x&&g.y===o.y)continue;const a=d(g.x,g.y);a<=1&&p.candidates.push(new T(s,y(g),Math.sqrt(a)))}}}else if(h&&"ends"===e.vertexMode){let e=0;const t=[];for(let s=0;s<r.length;s++){t.push(e);const i=r[s];e+=i*a,i>1&&t.push(e-a)}for(const i of t){g.coordsIndex=i;const e=d(g.x,g.y);e<=1&&p.candidates.push(new T(s,y(g),Math.sqrt(e)))}}}function v(t,s){const{candidates:i}=p,a={x:0,y:0,z:0};if(e.returnEdge){const e=[n.x,n.y],r=new X(e,0),o=new X(e,0);for(const{segments:n}of t.parts)for(const{start:t,curve:p}of n){const{curvePoint:n}=l(t,p,e),f=d(...n);if(f>1)continue;[a.x,a.y]=n,r.coords=t,o.coords=u(p);const h=c(p)?null:m(p);i.push(new x(s,y(a),Math.sqrt(f),y(r),y(o),!1,h))}}function r(e){a.x=t.vertexXY[2*e],a.y=t.vertexXY[2*e+1];const n=d(a.x,a.y);n>1||(a.z=t.vertexZ?.[e]??0,i.push(new T(s,y(a),Math.sqrt(n))))}if("all"===e.vertexMode){const{vertexCount:e}=t;for(let t=0;t<e;++t)r(t);return}if("ends"===e.vertexMode)switch(t.type){case"point":r(0);break;case"polyline":for(let e=0;e<t.partCount;++e){const s=t.partOffsets[e],i=t.partOffsets[e+1]-1;r(s),i!==s&&r(i)}}}}_getPointCreator(e,t,s){const i=null==s||o(t,s)?e=>e:e=>y(e,t,s),{hasZ:a}=this,n=0;return a&&e?({x:e,y:t,z:s})=>i({x:e,y:t,z:s}):({x:e,y:t})=>i({x:e,y:t,z:n})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,minValue:r,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,m=this.fieldsIndex.get(t),d=F(m)||I(m)||_(m),p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:l,timeZone:u},this.items),f=M({normalizationType:a,normalizationField:i,minValue:r,maxValue:o}),h={value:.5,fieldType:m?.type},y=v(m)?A({values:p,supportsNullCount:f,percentileParams:h,outStatisticTypes:c}):w({values:p,minValue:r,maxValue:o,useSampleStdDev:!a,supportsNullCount:f,percentileParams:h,outStatisticTypes:c});return N(y,c,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:n,timeZone:r}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:n,timeZone:r},this.items,!1),l=D(o);return P(l,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:m,timeZone:d}=e,p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:m,timeZone:d},this.items),f=q(p,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return j(f,r)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:m,timeZone:d}=e,p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:m,timeZone:d},this.items);return C(p,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.slice().reverse()){const t=i.split(" "),a=t[0],n=this.fieldsIndex.get(a),r=!!t[1]&&"desc"===t[1].toLowerCase(),o=O(n?.type,r,"case-insensitive");e.sort((e,t)=>{const i=s(e,a,n),r=s(t,a,n);return o(i,r)})}}_createFeatureQueryResponse(e){const{items:t,geometryType:s,hasM:i,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:m,resultOffset:d,returnZ:f,returnM:h}=e,y=null!=m&&t.length>(d||0)+m,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(e=>this.fieldsIndex.get(e)));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:s,hasM:i&&h,hasZ:a&&f,objectIdFieldName:r,spatialReference:p(u||o),transform:c&&n(c)||null}}_createFeatures(e,t){const s=new d(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:c,resultOffset:m,resultRecordCount:p,returnZ:y=!1,returnM:g=!1}=e,x=a&&y,T=i&&g;let F=[],I=0;const _=[...t];if(this._sortFeatures(_,r,(e,t,i)=>s.getFieldValue(e,t,i)),this.geometryType&&(l||u)){const e=n(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!u)for(const i of _){const a=this.featureAdapter.getGeometry(i),n=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),geometry:f(this.geometryType,a,c,e,x,T)});t&&a&&!n.geometry&&(n.centroid=h(this,this.featureAdapter.getCentroid(i,this),e)),F[I++]=n}else if(!l&&u)for(const i of _)F[I++]=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),centroid:h(this,this.featureAdapter.getCentroid(i,this),e)});else for(const i of _)F[I++]=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),centroid:h(this,this.featureAdapter.getCentroid(i,this),e),geometry:f(this.geometryType,this.featureAdapter.getGeometry(i),c,e,x,T)})}else for(const n of _){const e=s.getAttributes(n);e&&(F[I++]=this._addFeatureJSONMetadata(n,{attributes:e}))}const v=m||0;if(null!=p){const e=v+p;F=F.slice(v,Math.min(F.length,e))}return F}_addFeatureJSONMetadata(e,t){const s=this.featureAdapter.getMetadata?.(e);return void 0!==s&&(t.metadata=s),t}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY;for(const a of this.query.outStatistics??[])if("exceedslimit"===a.statisticType){t=null!=a.maxPointCount?a.maxPointCount:Number.POSITIVE_INFINITY,s=null!=a.maxRecordCount?a.maxRecordCount:Number.POSITIVE_INFINITY,i=null!=a.maxVertexCount?a.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>s)e=!0;else{const t=Y(this.hasZ,this.hasM),s=this.featureAdapter;e=this.items.reduce((e,t)=>{const i=s.getGeometry(t);return e+(null!=i&&i.coords.length||0)},0)/t>i}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,s={attributes:{}}){const i=[],a=new Map,n=new Map,r=new Map,o=new Map,l=new d(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:m,orderByFields:p,resultRecordCount:f}=e,h=c?.length,y=!!h,g=y?c[0]:null,x=y&&!this.fieldsIndex.get(g);for(const d of u??[]){const{outStatisticFieldName:e,statisticType:u}=d,p=d,f="exceedslimit"!==u?d.onStatisticField:void 0,T="percentile_disc"===u||"percentile_cont"===u,F="EnvelopeAggregate"===u||"CentroidAggregate"===u||"ConvexHullAggregate"===u,I=y&&1===h&&(f===g||x)&&"count"===u;if(y){if(!r.has(f)){const e=[];for(const s of c){const i=this._getAttributeValues(l,s,t,a);e.push(i)}r.set(f,this._calculateUniqueValues(e,t,!F&&l.returnDistinctValues))}const s=r.get(f);if(!s)continue;const i=Object.keys(s);for(const n of i){const{count:i,data:r,items:u,itemPositions:d}=s[n],h=r.join(",");if(!m||l.validateItems(u,m)){const s=o.get(h)||{attributes:{}};if(F){s.aggregateGeometries||(s.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(p,u);s.aggregateGeometries[t]=e}else{let n=null;if(I)n=i;else{const e=this._getAttributeValues(l,f,t,a),s=d.map(t=>e[t]);n=T&&"statisticParameters"in p?this._getPercentileValue(p,s):this._getStatisticValue(p,s,null,l.returnDistinctValues)}s.attributes[e]=n}let n=0;c.forEach((e,t)=>s.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++n]=r[t]),o.set(h,s)}}}else if(F){s.aggregateGeometries||(s.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:i}=await this._getAggregateGeometry(p,t);s.aggregateGeometries[i]=e}else{const i=this._getAttributeValues(l,f,t,a);s.attributes[e]=T&&"statisticParameters"in p?this._getPercentileValue(p,i):this._getStatisticValue(p,i,n,l.returnDistinctValues)}const _="min"!==u&&"max"!==u||!v(this.fieldsIndex.get(f))&&!this._isAnyDateField(f)?null:this.fieldsIndex.get(f)?.type;i.push({name:e,alias:e,type:_||"esriFieldTypeDouble"})}const T=y?Array.from(o.values()):[s];return this._sortFeatures(T,p,(e,t)=>e.attributes[t]),f&&(T.length=Math.min(f,T.length)),{fields:i,features:T}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return F(t)||I(t)||_(t)||V(t)}async _getAggregateGeometry(e,n){const{convexHull:r,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:c,spatialReference:m,geometryType:d}=this,p=n.map(e=>f(d,c.getGeometry(e))),h=r(m,p,!0)[0],y={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=h?i(h):a(o(m,p));y.aggregateGeometries={...e,spatialReference:m},y.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=h?t(h):s(a(o(m,p)));y.aggregateGeometries={x:e[0],y:e[1],spatialReference:m},y.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(y.aggregateGeometries=h,y.outStatisticFieldName=u||"convexHull");return y}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:n}=e;let r=null;r=s?.has(a)?s.get(a):v(this.fieldsIndex.get(a))||this._isAnyDateField(a)?A({values:t,returnDistinct:i}):w({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,r);return r["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:n,orderBy:r}=i,o=this.fieldsIndex.get(s);return Z(t,{value:n,orderBy:r,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,s,i){if(i.has(t))return i.get(t);const a=this.fieldsIndex.get(t),n=s.map(s=>e.getFieldValue(s,t,a));return i.set(t,n),n}_calculateUniqueValues(e,t,s){const i={},a=t.length;for(let n=0;n<a;n++){const a=t[n],r=[];for(const t of e)r.push(t[n]);const o=r.join(",");null==i[o]?i[o]={count:1,data:r,items:[a],itemPositions:[n]}:(s||i[o].count++,i[o].items.push(a),i[o].itemPositions.push(n))}return i}async _getDataValues(t,s,i=!0){const a=new d(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:n,scale:r,timeZone:o}=t;return n?a.getExpressionValues(s,n,{viewingMode:"map",scale:r,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):a.getDataValues(s,e(t),i)}_calculateHistogramBins(e,t,s){if(null==t.min&&null==t.max)return[];const i=t.intervals,a=t.min??0,n=t.max??0,r=i.map(([e,t])=>({minValue:e,maxValue:t,count:0,items:[]}));for(let o=0;o<e.length;o++){const t=e[o],l=s[o];if(null!=t&&t>=a&&t<=n){const e=G(i,t);e>-1&&(r[e].count++,r[e].items.push(l))}}return r}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:s,outAlias:i,valueType:a}=t,n=[],r=[{name:i??s,alias:i??s,type:a??"esriFieldTypeString"},{name:k,alias:k,type:"esriFieldTypeInteger"}],o=new d(e,this.featureAdapter,this.fieldsIndex),l=new Map,u=[...this.items];this._sortFeatures(u,[s],(e,t,s)=>o.getFieldValue(e,t,s));const c=this._getAttributeValues(o,s,u,l),m=this._calculateUniqueValues([c],u,o.returnDistinctValues);for(const d in m){const{items:t}=m[d],a=await this._createBinsResponse(e,t);if(n.push(...a.features.map(e=>({...e,attributes:{...e.attributes,[i??s]:d}}))),a.fields)for(const e of a.fields)r.some(t=>t.name===e.name)||r.push(e)}return{fields:r,features:n}}async _createBinsResponse(e,t){const s=e.bin;switch(t=t??this.items,s.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(S.fromJSON(s),e,t);case"dateBin":return this._createDateBinsResponse(b.fromJSON(s),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(R.fromJSON(s),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(B.fromJSON(s),e,t)}}async _createAutoIntervalBinsResponse(e,t,s){const{field:i,normalizationField:a,numBins:n,normalizationType:r,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field||e.expression,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},s),m=E(c,{field:i,normalizationField:a,normalizationType:r,normalizationTotal:o,numBins:n,minValue:g(r?e.normalizationMinValue:l,!1),maxValue:g(r?e.normalizationMaxValue:u,!1)}),d=this._calculateHistogramBins(c,m,s);return this._createFeaturesFromHistogramBins(d,t)}async _createDateBinsResponse(e,t,s){const{field:i,interval:a,start:n,end:r,snapToData:o,returnFullIntervalBin:l,offset:u,firstDayOfWeek:c}=e,m=a.unit,d=await this._getDataValues({field:i||e.expression,timeZone:t.outTimeReference?.ianaTimeZone},s),p=V(this.fieldsIndex.get(i)),f=z.toJSON(m),h=d.filter(Boolean).sort((e,t)=>e-t),y=null!=n?g(n,p):h[0],x=null!=r?g(r,p):h[h.length-1],T=[];if(null!=y&&null!=x){const e={zone:t.outTimeReference?.ianaTimeZone??H},s=u?.unit?z.toJSON(u.unit):"milliseconds",i={[s]:u?.value||0},n=U.fromMillis(y,e).minus(i),r=U.fromMillis(x,e).minus(i),m="number"==typeof c&&c>=1&&c<=7?c:7,d=(e,t)=>{const s=(e.weekday-t+7)%7;return e.minus({days:s}).startOf("day")};if("last"===o){let e="week"===f?((e,t)=>d(e,t).plus({days:7}))(r,m):r;for(;e>n;){const t=e.minus({[f]:a.value});if(t<n){T.unshift([l?t.plus(i).toMillis():n.plus(i).toMillis(),e.plus(i).toMillis()]);break}T.unshift([t.plus(i).toMillis(),e.plus(i).toMillis()]),e=t}}else{let e="first"===o?n:"week"===f?d(n,m):n.startOf(f);for(;e<=r;){const t=e.plus({[f]:a.value});if(t>r){T.push([e.plus(i).toMillis(),l?t.plus(i).toMillis():r.plus(i).toMillis()]);break}T.push([e.plus(i).toMillis(),t.plus(i).toMillis()]),e=t}}}const F=this._calculateHistogramBins(d,{intervals:T,min:y,max:x},s);return this._createFeaturesFromHistogramBins(F,t)}async _createFixedBoundariesBinsResponse(e,t,s){const{field:i}=e,a=await this._getDataValues({field:i||e.expression,timeZone:t.outTimeReference?.ianaTimeZone},s),n=V(this.fieldsIndex.get(i)),r=e.boundaries.map(e=>g(e,n)).sort((e,t)=>e-t),o=[];for(let c=0;c<r.length-1;c++)o.push([r[c],r[c+1]]);const l={intervals:o,min:r.at(0),max:r.at(-1)},u=this._calculateHistogramBins(a,l,s);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,s){const{field:i,interval:a,normalizationType:n,start:r,end:o}=e,l=await this._getDataValues({field:i||e.expression,normalizationField:e.normalizationField,normalizationType:n,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},s),u=V(this.fieldsIndex.get(i)),c=E(l,{field:i,classificationMethod:"defined-interval",definedInterval:a,minValue:g(n?e.normalizationMinValue:r,u),maxValue:g(n?e.normalizationMaxValue:o,u)},!0),m=this._calculateHistogramBins(l,c,s);return this._createFeaturesFromHistogramBins(m,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:s,lowerBoundaryAlias:i}=t,a=i||"lowerBoundary",n=s||"upperBoundary",r=[],o=[{name:a,alias:a,type:"esriFieldTypeDouble"},{name:n,alias:n,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:k,alias:k,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const m="dateBin"===t.bin.type,d=t.outTimeReference?.ianaTimeZone;for(const p of e){const{minValue:e,maxValue:s,items:i}=p,f={attributes:{}};let h;if(f.attributes[a]=m&&d&&null!=e?U.fromMillis(e,{zone:d}).toISO():e,t.bin.hideUpperBound||(f.attributes[n]=m&&d&&null!=s?U.fromMillis(s,{zone:d}).toISO():s),l?(h=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},i),f.attributes[k]=++c,"flat"===t.bin.jsonStyle?r.push(...h.features.map(({attributes:{EXPR_1:e,...t},...s})=>({...s,attributes:u??e?{...t,[u??e]:e,...f.attributes}:{...t,...f.attributes}}))):(f.stackedAttributes=h.features.map(({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t),r.push(f))):(t.bin?.splitBy&&(f.attributes[k]=++c),h=await this._createStatisticsQueryResponse(t,i,f),r.push(f)),h.fields)for(const t of h.fields)o.some(e=>e.name===t.name)||o.push(t)}return"desc"===t.binOrder&&r.reverse(),{fields:o,features:r}}}function Q(e,t,s,i){const a=i.x-s.x,n=i.y-s.y,r=t.x-s.x,o=t.y-s.y,l=a*a+n*n;if(0===l)return!1;const u=r*a+o*n,c=Math.min(1,Math.max(0,u/l));return e.x=s.x+a*c,e.y=s.y+n*c,!0}function Y(e,t){return e?t?4:3:t?3:2}class X{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const L=[1];export{J as QueryEngineResult};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import o from"../../../geometry/Extent.js";import i from"../../../geometry/Point.js";import a from"../../../geometry/SpatialReference.js";import n from"./BaseRaster.js";import{parseSpatialReference as l,parsePAMInfo as f}from"./pamParser.js";import{getElement as c,getElementValue as h}from"./xmlUtilities.js";import{isPlatformLittleEndian as p}from"../formats/utils.js";import{estimateStatisticsFromHistograms as m}from"../functions/stretchUtils.js";import u from"../../support/PixelBlock.js";import g from"../../support/RasterInfo.js";import d from"../../support/RasterStorageInfo.js";const y=new Map;y.set("Byte","u8"),y.set("Int8","s8"),y.set("UInt8","u8"),y.set("Int16","s16"),y.set("UInt16","u16"),y.set("Int32","s32"),y.set("UInt32","u32"),y.set("Float32","f32"),y.set("Float64","f32"),y.set("Double64","f32");const x=new Map;x.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),x.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),x.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),x.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),x.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let b=class extends n{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(t,e,s,r={}){const{blockWidth:o,blockHeight:i,blockBoundary:a}=this.rasterInfo.storageInfo,n=a[t];if(!n||n.maxRow<e||n.maxCol<s||n.minRow>e||n.minCol>s)return null;const{bandCount:l,pixelType:f}=this.rasterInfo,{ranges:c,actualTileWidth:h,actualTileHeight:p}=this._getTileLocation(t,e,s);if(!c||0===c.length)return null;if(0===c[0].from&&0===c[0].to){const t=new Uint8Array(o*i);return new u({width:o,height:i,pixels:void 0,mask:t,validPixelCount:0})}const{bandIds:m}=this.ioConfig,g=this._getBandSegmentCount(),d=[];let y=0;for(y=0;y<g;y++)m&&!m.includes(y)||d.push(this.request(this._files.data,{range:{from:c[y].from,to:c[y].to},responseType:"array-buffer",signal:r.signal}));const b=await Promise.all(d),w=b.map(t=>t.data.byteLength).reduce((t,e)=>t+e),I=new Uint8Array(w),A=[];let R=0;for(y=0;y<g;y++)A.push(R),I.set(new Uint8Array(b[y].data),R),R+=b[y].data.byteLength;const F=x.get(this.rasterInfo.storageInfo.compression).decoderFormat,S=await this.decodePixelBlock(I.buffer,{width:o,height:i,format:F,planes:m?.length||l,offsets:A,pixelType:f}).catch(()=>null);if(null==S)return null;let{noDataValue:_}=this.rasterInfo;if(null!=_&&"lerc"!==F&&!S.mask&&(_=_[0],null!=_)){const t=S.width*S.height,e=new Uint8Array(t);if(Math.abs(_)>1e24)for(y=0;y<t;y++)Math.abs((S.pixels[0][y]-_)/_)>1e-6&&(e[y]=1);else for(y=0;y<t;y++)S.pixels[0][y]!==_&&(e[y]=1);S.mask=e}let M=0,k=0;if(h!==o||p!==i){let t=S.mask;if(t)for(y=0;y<i;y++)if(k=y*o,y<p)for(M=h;M<o;M++)t[k+M]=0;else for(M=0;M<o;M++)t[k+M]=0;else for(t=new Uint8Array(o*i),S.mask=t,y=0;y<p;y++)for(k=y*o,M=0;M<h;M++)t[k+M]=1}return S}async _open(t){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const e=t?t.signal:null,s=await this.request(this.url,{responseType:"xml",signal:e}),{rasterInfo:r,files:o}=this._parseHeader(s.data),{skipMapInfo:i,skipExtensions:a=[]}=this.ioConfig;if(!a.includes("aux.xml")&&!i){const e=await this._fetchAuxiliaryData(t);null!=e&&(r.statistics=e.statistics??r.statistics,r.histograms=e.histograms,e.histograms&&null==r.statistics&&(r.statistics=m(e.histograms)))}i&&this.updateImageSpaceRasterInfo(r),this._set("rasterInfo",r),this._files=o;const n=await this.request(o.index,{responseType:"array-buffer",signal:e});this._storageIndex=w(n.data);const{blockWidth:l,blockHeight:f}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:h,height:p}=this.rasterInfo,u=[],g=this._getBandSegmentCount();let d=0,y=-1;for(;d<this._storageIndex.length;){y++;const t=Math.ceil(h/l/c**y)-1,e=Math.ceil(p/f/c**y)-1;d+=(t+1)*(e+1)*g*4,u.push({maxRow:e,maxCol:t,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=u,y>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=y),this.updateTileInfo()}_getBandSegmentCount(){return x.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,s){const{blockWidth:r,blockHeight:o,pyramidScalingFactor:i}=this.rasterInfo.storageInfo,{width:a,height:n}=this.rasterInfo,l=this._getBandSegmentCount();let f,c,h,p=0,m=0;for(h=0;h<t;h++)m=i**h,f=Math.ceil(a/r/m),c=Math.ceil(n/o/m),p+=f*c;m=i**t,f=Math.ceil(a/r/m),c=Math.ceil(n/o/m),p+=e*f+s,p*=4*l;const u=this._storageIndex.subarray(p,p+4*l);let g=0,d=0;const y=[];for(let x=0;x<l;x++)g=u[4*x]*2**32+u[4*x+1],d=g+u[4*x+2]*2**32+u[4*x+3]-1,y.push({from:g,to:d});return{ranges:y,actualTileWidth:s<f-1?r:Math.ceil(a/m)-r*(f-1),actualTileHeight:e<c-1?o:Math.ceil(n/m)-o*(c-1)}}_parseHeader(t){const s=c(t,"MRF_META/Raster");if(!s)throw new e("mrf:open","not a valid MRF format");const r=c(s,"Size"),n=parseInt(r.getAttribute("x"),10),f=parseInt(r.getAttribute("y"),10),p=parseInt(r.getAttribute("c"),10),m=(h(s,"Compression")||"none").toLowerCase();if(!x.has(m))throw new e("mrf:open","currently does not support compression "+m);const u=h(s,"DataType")||"UInt8",b=y.get(u);if(null==b)throw new e("mrf:open","currently does not support pixel type "+u);const w=c(s,"PageSize"),I=parseInt(w.getAttribute("x"),10),A=parseInt(w.getAttribute("y"),10),R=c(s,"DataValues");let F,S;R&&(S=R.getAttribute("NoData"),null!=S&&(F=S.trim().split(" ").map(t=>parseFloat(t))));if(c(t,"MRF_META/CachedSource"))throw new e("mrf:open","currently does not support MRF referencing other data files");const _=c(t,"MRF_META/GeoTags"),M=c(_,"BoundingBox");let k,T=!1;if(null!=M){const t=parseFloat(M.getAttribute("minx")),e=parseFloat(M.getAttribute("miny")),s=parseFloat(M.getAttribute("maxx")),r=parseFloat(M.getAttribute("maxy")),i=h(_,"Projection")||"";let n=a.WGS84;if("LOCAL_CS[]"!==i)if(i.toLowerCase().startsWith("epsg:")){const t=Number(i.slice(5));isNaN(t)||0===t||(n=new a({wkid:t}))}else n=l(i)??a.WGS84;else T=!0,n=new a({wkid:3857});k=new o(t,e,s,r),k.spatialReference=n}else T=!0,k=new o({xmin:-.5,ymin:.5-f,xmax:n-.5,ymax:.5,spatialReference:new a({wkid:3857})});const C=c(t,"MRF_META/Rsets"),j=parseInt(C?.getAttribute("scale")||"2",10),B=k.spatialReference,U=new d({origin:new i({x:k.xmin,y:k.ymax,spatialReference:B}),blockWidth:I,blockHeight:A,pyramidBlockWidth:I,pyramidBlockHeight:A,compression:m,pyramidScalingFactor:j}),E=new i({x:k.width/n,y:k.height/f,spatialReference:B}),L=new g({width:n,height:f,extent:k,isPseudoSpatialReference:T,spatialReference:B,bandCount:p,pixelType:b,pixelSize:E,noDataValue:F,storageInfo:U}),P=h(t,"datafile"),W=h(t,"IndexFile");return{rasterInfo:L,files:{mrf:this.url,index:W||this.url.replace(".mrf",".idx"),data:P||this.url.replace(".mrf",x.get(m).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return f(e)}catch{return null}}};function w(t){if(t.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let e,s,r,o,i,a;if(p){for(s=new Uint8Array(t),o=new ArrayBuffer(t.byteLength),r=new Uint8Array(o),i=0;i<t.byteLength/4;i++)for(a=0;a<4;a++)r[4*i+a]=s[4*i+3-a];e=new Uint32Array(o)}else e=new Uint32Array(t);return e}t([s()],b.prototype,"_files",void 0),t([s()],b.prototype,"_storageIndex",void 0),t([s({type:String,json:{write:!0}})],b.prototype,"datasetFormat",void 0),b=t([r("esri.layers.raster.datasets.MRFRaster")],b);const I=b;export{I as default};
2
+ import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import o from"../../../geometry/Extent.js";import i from"../../../geometry/Point.js";import a from"../../../geometry/SpatialReference.js";import n from"./BaseRaster.js";import{parseSpatialReference as l,parsePAMInfo as f}from"./pamParser.js";import{getElement as c,getElementValue as h}from"./xmlUtilities.js";import{isPlatformLittleEndian as p}from"../formats/utils.js";import{estimateStatisticsFromHistograms as m}from"../functions/stretchUtils.js";import u from"../../support/PixelBlock.js";import g from"../../support/RasterInfo.js";import d from"../../support/RasterStorageInfo.js";const y=new Map;y.set("Byte","u8"),y.set("Int8","s8"),y.set("UInt8","u8"),y.set("Int16","s16"),y.set("UInt16","u16"),y.set("Int32","s32"),y.set("UInt32","u32"),y.set("Float32","f32"),y.set("Float64","f32"),y.set("Double64","f32");const x=new Map;x.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),x.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),x.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),x.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),x.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let b=class extends n{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(t,e,s,r={}){const{blockWidth:o,blockHeight:i,blockBoundary:a}=this.rasterInfo.storageInfo,n=a[t];if(!n||n.maxRow<e||n.maxCol<s||n.minRow>e||n.minCol>s)return null;const{bandCount:l,pixelType:f}=this.rasterInfo,{ranges:c,actualTileWidth:h,actualTileHeight:p}=this._getTileLocation(t,e,s);if(!c||0===c.length)return null;if(c.some(t=>t.from>t.to)){const t=new Uint8Array(o*i);return new u({width:o,height:i,pixels:void 0,mask:t,validPixelCount:0})}const{bandIds:m}=this.ioConfig,g=this._getBandSegmentCount(),d=[];let y=0;for(y=0;y<g;y++)m&&!m.includes(y)||d.push(this.request(this._files.data,{range:{from:c[y].from,to:c[y].to},responseType:"array-buffer",signal:r.signal}));const b=await Promise.all(d),w=b.map(t=>t.data.byteLength).reduce((t,e)=>t+e),I=new Uint8Array(w),A=[];let R=0;for(y=0;y<g;y++)A.push(R),I.set(new Uint8Array(b[y].data),R),R+=b[y].data.byteLength;const F=x.get(this.rasterInfo.storageInfo.compression).decoderFormat,S=await this.decodePixelBlock(I.buffer,{width:o,height:i,format:F,planes:m?.length||l,offsets:A,pixelType:f}).catch(()=>null);if(null==S)return null;let{noDataValue:_}=this.rasterInfo;if(null!=_&&"lerc"!==F&&!S.mask&&(_=_[0],null!=_)){const t=S.width*S.height,e=new Uint8Array(t);if(Math.abs(_)>1e24)for(y=0;y<t;y++)Math.abs((S.pixels[0][y]-_)/_)>1e-6&&(e[y]=1);else for(y=0;y<t;y++)S.pixels[0][y]!==_&&(e[y]=1);S.mask=e}let M=0,k=0;if(h!==o||p!==i){let t=S.mask;if(t)for(y=0;y<i;y++)if(k=y*o,y<p)for(M=h;M<o;M++)t[k+M]=0;else for(M=0;M<o;M++)t[k+M]=0;else for(t=new Uint8Array(o*i),S.mask=t,y=0;y<p;y++)for(k=y*o,M=0;M<h;M++)t[k+M]=1}return S}async _open(t){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const e=t?t.signal:null,s=await this.request(this.url,{responseType:"xml",signal:e}),{rasterInfo:r,files:o}=this._parseHeader(s.data),{skipMapInfo:i,skipExtensions:a=[]}=this.ioConfig;if(!a.includes("aux.xml")&&!i){const e=await this._fetchAuxiliaryData(t);null!=e&&(r.statistics=e.statistics??r.statistics,r.histograms=e.histograms,e.histograms&&null==r.statistics&&(r.statistics=m(e.histograms)))}i&&this.updateImageSpaceRasterInfo(r),this._set("rasterInfo",r),this._files=o;const n=await this.request(o.index,{responseType:"array-buffer",signal:e});this._storageIndex=w(n.data);const{blockWidth:l,blockHeight:f}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:h,height:p}=this.rasterInfo,u=[],g=this._getBandSegmentCount();let d=0,y=-1;for(;d<this._storageIndex.length;){y++;const t=Math.ceil(h/l/c**y)-1,e=Math.ceil(p/f/c**y)-1;d+=(t+1)*(e+1)*g*4,u.push({maxRow:e,maxCol:t,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=u,y>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=y),this.updateTileInfo()}_getBandSegmentCount(){return x.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,s){const{blockWidth:r,blockHeight:o,pyramidScalingFactor:i}=this.rasterInfo.storageInfo,{width:a,height:n}=this.rasterInfo,l=this._getBandSegmentCount();let f,c,h,p=0,m=0;for(h=0;h<t;h++)m=i**h,f=Math.ceil(a/r/m),c=Math.ceil(n/o/m),p+=f*c;m=i**t,f=Math.ceil(a/r/m),c=Math.ceil(n/o/m),p+=e*f+s,p*=4*l;const u=this._storageIndex.subarray(p,p+4*l);let g=0,d=0;const y=[];for(let x=0;x<l;x++)g=u[4*x]*2**32+u[4*x+1],d=g+u[4*x+2]*2**32+u[4*x+3]-1,y.push({from:g,to:d});return{ranges:y,actualTileWidth:s<f-1?r:Math.ceil(a/m)-r*(f-1),actualTileHeight:e<c-1?o:Math.ceil(n/m)-o*(c-1)}}_parseHeader(t){const s=c(t,"MRF_META/Raster");if(!s)throw new e("mrf:open","not a valid MRF format");const r=c(s,"Size"),n=parseInt(r.getAttribute("x"),10),f=parseInt(r.getAttribute("y"),10),p=parseInt(r.getAttribute("c"),10),m=(h(s,"Compression")||"none").toLowerCase();if(!x.has(m))throw new e("mrf:open","currently does not support compression "+m);const u=h(s,"DataType")||"UInt8",b=y.get(u);if(null==b)throw new e("mrf:open","currently does not support pixel type "+u);const w=c(s,"PageSize"),I=parseInt(w.getAttribute("x"),10),A=parseInt(w.getAttribute("y"),10),R=c(s,"DataValues");let F,S;R&&(S=R.getAttribute("NoData"),null!=S&&(F=S.trim().split(" ").map(t=>parseFloat(t))));if(c(t,"MRF_META/CachedSource"))throw new e("mrf:open","currently does not support MRF referencing other data files");const _=c(t,"MRF_META/GeoTags"),M=c(_,"BoundingBox");let k,T=!1;if(null!=M){const t=parseFloat(M.getAttribute("minx")),e=parseFloat(M.getAttribute("miny")),s=parseFloat(M.getAttribute("maxx")),r=parseFloat(M.getAttribute("maxy")),i=h(_,"Projection")||"";let n=a.WGS84;if("LOCAL_CS[]"!==i)if(i.toLowerCase().startsWith("epsg:")){const t=Number(i.slice(5));isNaN(t)||0===t||(n=new a({wkid:t}))}else n=l(i)??a.WGS84;else T=!0,n=new a({wkid:3857});k=new o(t,e,s,r),k.spatialReference=n}else T=!0,k=new o({xmin:-.5,ymin:.5-f,xmax:n-.5,ymax:.5,spatialReference:new a({wkid:3857})});const C=c(t,"MRF_META/Rsets"),j=parseInt(C?.getAttribute("scale")||"2",10),B=k.spatialReference,U=new d({origin:new i({x:k.xmin,y:k.ymax,spatialReference:B}),blockWidth:I,blockHeight:A,pyramidBlockWidth:I,pyramidBlockHeight:A,compression:m,pyramidScalingFactor:j}),E=new i({x:k.width/n,y:k.height/f,spatialReference:B}),L=new g({width:n,height:f,extent:k,isPseudoSpatialReference:T,spatialReference:B,bandCount:p,pixelType:b,pixelSize:E,noDataValue:F,storageInfo:U}),P=h(t,"datafile"),W=h(t,"IndexFile");return{rasterInfo:L,files:{mrf:this.url,index:W||this.url.replace(".mrf",".idx"),data:P||this.url.replace(".mrf",x.get(m).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return f(e)}catch{return null}}};function w(t){if(t.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let e,s,r,o,i,a;if(p){for(s=new Uint8Array(t),o=new ArrayBuffer(t.byteLength),r=new Uint8Array(o),i=0;i<t.byteLength/4;i++)for(a=0;a<4;a++)r[4*i+a]=s[4*i+3-a];e=new Uint32Array(o)}else e=new Uint32Array(t);return e}t([s()],b.prototype,"_files",void 0),t([s()],b.prototype,"_storageIndex",void 0),t([s({type:String,json:{write:!0}})],b.prototype,"datasetFormat",void 0),b=t([r("esri.layers.raster.datasets.MRFRaster")],b);const I=b;export{I as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as t}from"../../core/lang.js";import o from"../../core/Warning.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{persistable as p}from"../../core/accessorSupport/decorators/persistable.js";import a from"../../geometry/Polygon.js";import{canProjectWithoutEngine as c,projectPolygon as n}from"../../geometry/projectionUtils.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";var m;let y=m=class extends r{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,r,t,s){if(s.layer?.spatialReference&&!s.layer.spatialReference.equals(this.geometry.spatialReference)){if(!c(e.spatialReference,s.layer.spatialReference))return void(s?.messages&&s.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:s.layer.spatialReference,context:s})));const i=new a;n(e,i,s.layer.spatialReference),r[t]=i.toJSON(s)}else r[t]=e.toJSON(s)}clone(){return new m({geometry:t(this.geometry),type:this.type})}};e([s({type:a}),p()],y.prototype,"geometry",void 0),e([l(["web-scene","portal-item"],"geometry")],y.prototype,"writeGeometry",null),e([s({type:["clip","mask","replace"],nonNullable:!0}),p()],y.prototype,"type",void 0),y=m=e([i("esri.layers.support.SceneModification")],y);export{y as default};
2
+ import{__decorate as e}from"tslib";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as t}from"../../core/lang.js";import o from"../../core/Warning.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{persistable as a}from"../../core/accessorSupport/decorators/persistable.js";import p from"../../geometry/Polygon.js";import{canProjectWithoutEngine as c,projectPolygon as n}from"../../geometry/projectionUtils.js";import{isInitialized as l,switchMeshModificationPolygonVCSSync as m}from"../../views/3d/layers/Lyr3DWorker.js";import{toWasmModification as f,fromWasmModificationInSave as y}from"../../views/3d/layers/SceneLayerWorkerHandle.js";import{writer as d}from"../../core/accessorSupport/decorators/writer.js";var u;let g=u=class extends r{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,r,t,s){if(s.layer?.spatialReference&&115700===s.layer?.spatialReference.vcsWkid){let e=!0;if(l()){const o=f(null,[this],s.layer?.spatialReference),i=m({modifications:o,inVCS:5773});if(i.success&&i.modifications){const o=y(i.modifications,this);o&&(r[t]=o.toJSON(s),e=!1)}}if(e)return void(s?.messages&&s.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:s.layer.spatialReference,context:s})))}else if(s.layer?.spatialReference&&!s.layer.spatialReference.equals(this.geometry.spatialReference)){if(!c(e.spatialReference,s.layer.spatialReference))return void(s?.messages&&s.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:s.layer.spatialReference,context:s})));const i=new p;n(e,i,s.layer.spatialReference),r[t]=i.toJSON(s)}else r[t]=e.toJSON(s)}clone(){return new u({geometry:t(this.geometry),type:this.type})}};e([s({type:p}),a()],g.prototype,"geometry",void 0),e([d(["web-scene","portal-item"],"geometry")],g.prototype,"writeGeometry",null),e([s({type:["clip","mask","replace"],nonNullable:!0}),a()],g.prototype,"type",void 0),g=u=e([i("esri.layers.support.SceneModification")],g);export{g as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.21",
3
+ "version": "5.1.0-next.22",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -19,7 +19,7 @@
19
19
  "license": "SEE LICENSE IN LICENSE.md",
20
20
  "dependencies": {
21
21
  "@amcharts/amcharts5": "~5.15.5",
22
- "@arcgis/toolkit": "^5.0.0-next.170",
22
+ "@arcgis/toolkit": "^5.0.0",
23
23
  "@esri/arcgis-html-sanitizer": "~4.1.0",
24
24
  "@esri/calcite-components": "^5.0.2",
25
25
  "@vaadin/grid": "~25.0.3",
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import M from"../Color.js";import i from"../Graphic.js";import{JSONMap as a}from"../core/jsonMap.js";import{JSONSupport as t}from"../core/JSONSupport.js";import{clone as I}from"../core/lang.js";import{property as r,subclass as g}from"../core/accessorSupport/decorators.js";import A from"../geometry/Point.js";import{normalizeCentralMeridian as o}from"../geometry/support/normalizeUtils.js";import{unitKebabDict as s,getUnitConversionFactor as d,convertVectorFieldData as l,convertVectorFieldUnit as n}from"../layers/raster/functions/vectorFieldUtils.js";import D from"./ClassBreaksRenderer.js";import{VisualVariablesMixin as c}from"./mixins/VisualVariablesMixin.js";import w from"./support/ClassBreakInfo.js";import y from"./visualVariables/RotationVariable.js";import C from"./visualVariables/SizeVariable.js";import{getAllSizes as L,getRotationAngle as m}from"./visualVariables/support/visualVariableUtils.js";import j from"../symbols/PictureMarkerSymbol.js";import p from"../symbols/SimpleLineSymbol.js";import T from"../symbols/SimpleMarkerSymbol.js";import{applySizesToSymbol as N,applyRotationToSymbol as H}from"../symbols/support/utils.js";import{reader as U}from"../core/accessorSupport/decorators/reader.js";import{enumeration as B}from"../core/accessorSupport/decorators/enumeration.js";var S;const u=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),z=new a({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),Z=new a({flow_from:"flow-from",flow_to:"flow-to"});let b=S=class extends(c(t)){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,M){return u.has(e)?s.fromJSON(e):null}readOutputUnit(e,M){return u.has(e)?s.fromJSON(e):null}get styleRenderer(){const e=this.style,M=this.attributeField,i=this._createStyleRenderer(e);return i.field=M,i}get visualVariables(){return super.visualVariables}set visualVariables(e){super.visualVariables=e}get sizeVariables(){const e=[];if(this.visualVariables)for(const M of this.visualVariables)"size"===M.type&&e.push(M);if(0===e.length){const M=new C({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(M):this._set("visualVariables",[M]),e.push(M)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const M of this.visualVariables)"rotation"===M.type&&e.push(M);if(0===e.length){const M=new y({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(M):this._set("visualVariables",[M]),e.push(M)}return e}clone(){return new S({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:I(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,M=!1,a=[]){const t=new Array,I=d(this.inputUnit,this.outputUnit),r=this.rotationVariables[0]?.rotationType||this.rotationType,g=M?l(e.pixelBlock,"vector-uv",r,I):n(e.pixelBlock,"vector-magdir",I);if(null==g)return t;const s=e.extent,D=null!=g.mask&&g.mask.length>0;let c=0;const w=(s.xmax-s.xmin)/g.width,y=(s.ymax-s.ymin)/g.height;for(let d=0;d<g.height;d++)for(let e=0;e<g.width;e++,c++){let M=new A({x:s.xmin+e*w+w/2,y:s.ymax-d*y-y/2,spatialReference:s.spatialReference});M=(await o(M))[0];const I=a.some(e=>e.intersects(M));if((!D||g.mask[c])&&!I){const e={Magnitude:g.pixels[0][c],Direction:g.pixels[1][c]},a=new i({geometry:new A({x:M.x,y:M.y,spatialReference:s.spatialReference}),attributes:e});a.symbol=this._getVisualVariablesAppliedSymbol(a),t.push(a)}}return t}getSymbol(e,M){}async getSymbolAsync(e,M){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(e){return new T({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new p({width:0}),size:20,color:e||new M([0,92,230])})}_getVisualVariablesAppliedSymbol(e){if(!e)return;const M=this.styleRenderer?.getSymbol(e)?.clone(),i=this.sizeVariables,a=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(i=>N(M,L([i],e))),a&&a.length){const i="flow-to"===this.flowRepresentation===("ocean-current-kn"===this.style||"ocean-current-m"===this.style)?0:180;e.attributes.Direction=e.attributes.Direction+i,this.rotationVariables.forEach(i=>H(M,m(i,e),i.axis))}return M}_createStyleRenderer(e){let M={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":M=this._createSingleArrowRenderer();break;case"beaufort-kn":M=this._createBeaufortKnotsRenderer();break;case"beaufort-m":M=this._createBeaufortMeterRenderer();break;case"beaufort-ft":M=this._createBeaufortFeetRenderer();break;case"beaufort-mi":M=this._createBeaufortMilesRenderer();break;case"beaufort-km":M=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":M=this._createCurrentMeterRenderer();break;case"ocean-current-kn":M=this._createCurrentKnotsRenderer();break;case"simple-scalar":M=this._createSimpleScalarRenderer();break;case"wind-barb":M=this._createWindBarbsRenderer();break;case"classified-arrow":M=this._createClassifiedArrowRenderer()}return new D(M)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],i=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new M([214,47,39])),classBreakInfos:this._getClassBreaks(e,i)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new M([214,47,39])),classBreakInfos:this._getClassBreaks(e,i)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new M([214,47,39]));let i=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],t=3.28084;i=i.map(e=>e*t);return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,a)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new M([214,47,39]));let i=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],t=2.23694;i=i.map(e=>e*t);return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,a)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new M([214,47,39]));let i=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],t=3.6;i=i.map(e=>e*t);return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,a)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],i=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new M([177,177,177])),classBreakInfos:this._getClassBreaks(e,i)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],i=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new M([177,177,177])),classBreakInfos:this._getClassBreaks(e,i)}}_createClassifiedArrowRenderer(){const e=this._getDefaultSymbol(new M([56,168,0]));let i=[0,1e-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const e=this.sizeVariables[0].minDataValue,M=this.sizeVariables[0].maxDataValue;if(e&&M){const a=(M-e)/5;i=Array.from(Array(6).keys()).map(M=>e+a*M)}}const a=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,a)}}_createSimpleScalarRenderer(){return{defaultSymbol:j.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(e=>5*e),M=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],i=j.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),a=e.map((a,t)=>{let I;if(t!==e.length-1)if(0===t)I={minValue:a,maxValue:e[t+1],symbol:i};else{const i=j.fromJSON({type:"esriPMS",imageData:M[t].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});I={minValue:a,maxValue:e[t+1],symbol:i}}return new w(I)});return{defaultSymbol:i,classBreakInfos:a}}_getClassBreaks(e,i){return i.map((i,a)=>new w({minValue:e[a],maxValue:e[a+1],symbol:this._getDefaultSymbol(new M(i))}))}};e([r({type:["Magnitude"],json:{write:!0}})],b.prototype,"attributeField",void 0),e([r({type:Z.apiValues,json:{type:Z.jsonValues,read:{reader:Z.read},write:{writer:Z.write}}})],b.prototype,"flowRepresentation",void 0),e([r({type:["geographic","arithmetic"],json:{write:!0}})],b.prototype,"rotationType",void 0),e([r({type:z.apiValues,json:{type:z.jsonValues,read:{reader:z.read},write:{writer:z.write}}})],b.prototype,"style",void 0),e([r({json:{write:!0}})],b.prototype,"symbolTileSize",void 0),e([r({type:s.apiValues,json:{type:s.jsonValues,write:{writer:s.write}}})],b.prototype,"inputUnit",void 0),e([U("inputUnit")],b.prototype,"readInputUnit",null),e([r({type:s.apiValues,json:{type:s.jsonValues,read:{reader:s.read},write:{writer:s.write}}})],b.prototype,"outputUnit",void 0),e([U("outputUnit")],b.prototype,"readOutputUnit",null),e([B({vectorField:"vector-field"})],b.prototype,"type",void 0),e([r({type:D})],b.prototype,"styleRenderer",null),e([r({type:C})],b.prototype,"sizeVariables",null),e([r({type:y})],b.prototype,"rotationVariables",null),b=S=e([g("esri.renderers.VectorFieldRenderer")],b);export{b as default};
2
+ import{__decorate as e}from"tslib";import M from"../Color.js";import i from"../Graphic.js";import{JSONMap as a}from"../core/jsonMap.js";import{JSONSupport as t}from"../core/JSONSupport.js";import{clone as I}from"../core/lang.js";import{property as g,subclass as r}from"../core/accessorSupport/decorators.js";import A from"../geometry/Point.js";import{normalizeCentralMeridian as o}from"../geometry/support/normalizeUtils.js";import{unitKebabDict as s,getUnitConversionFactor as l,convertVectorFieldData as d,convertVectorFieldUnit as n}from"../layers/raster/functions/vectorFieldUtils.js";import D from"./ClassBreaksRenderer.js";import{VisualVariablesMixin as c}from"./mixins/VisualVariablesMixin.js";import w from"./support/ClassBreakInfo.js";import y from"./visualVariables/RotationVariable.js";import C from"./visualVariables/SizeVariable.js";import{getAllSizes as L,getRotationAngle as m}from"./visualVariables/support/visualVariableUtils.js";import j from"../symbols/PictureMarkerSymbol.js";import T from"../symbols/SimpleLineSymbol.js";import p from"../symbols/SimpleMarkerSymbol.js";import{applySizesToSymbol as N,applyRotationToSymbol as H}from"../symbols/support/utils.js";import{reader as U}from"../core/accessorSupport/decorators/reader.js";import{enumeration as B}from"../core/accessorSupport/decorators/enumeration.js";var u;const S=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),z=new a({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),Z=new a({flow_from:"flow-from",flow_to:"flow-to"});let b=u=class extends(c(t)){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,M){return S.has(e)?s.fromJSON(e):null}readOutputUnit(e,M){return S.has(e)?s.fromJSON(e):null}get styleRenderer(){const e=this.style,M=this.attributeField,i=this._createStyleRenderer(e);return i.field=M,i}get visualVariables(){return super.visualVariables}set visualVariables(e){super.visualVariables=e}get sizeVariables(){const e=[];if(this.visualVariables)for(const M of this.visualVariables)"size"===M.type&&e.push(M);if(0===e.length){const M=new C({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(M):this._set("visualVariables",[M]),e.push(M)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const M of this.visualVariables)"rotation"===M.type&&e.push(M);if(0===e.length){const M=new y({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(M):this._set("visualVariables",[M]),e.push(M)}return e}clone(){return new u({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:I(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,M=!1,a=[]){const t=new Array,I=l(this.inputUnit,this.outputUnit),g=this.rotationVariables[0]?.rotationType||this.rotationType,r=M?d(e.pixelBlock,"vector-uv",g,I):n(e.pixelBlock,"vector-magdir",I);if(null==r)return t;const s=e.extent,D=null!=r.mask&&r.mask.length>0;let c=0;const w=(s.xmax-s.xmin)/r.width,y=(s.ymax-s.ymin)/r.height;for(let l=0;l<r.height;l++)for(let e=0;e<r.width;e++,c++){let M=new A({x:s.xmin+e*w+w/2,y:s.ymax-l*y-y/2,spatialReference:s.spatialReference});M=(await o(M))[0];const I=a.some(e=>e.intersects(M));if((!D||r.mask[c])&&!I){const e={Magnitude:r.pixels[0][c],Direction:r.pixels[1][c]},a=new i({geometry:new A({x:M.x,y:M.y,spatialReference:s.spatialReference}),attributes:e});a.symbol=this._getVisualVariablesAppliedSymbol(a),t.push(a)}}return t}getSymbol(e,M){}async getSymbolAsync(e,M){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(e){return new p({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new T({width:0}),size:20,color:e||new M([0,92,230])})}_getVisualVariablesAppliedSymbol(e){if(!e)return;const M=this.styleRenderer?.getSymbol(e)?.clone(),i=this.sizeVariables,a=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(i=>N(M,L([i],e))),a&&a.length){const i="flow-to"===this.flowRepresentation===("ocean-current-kn"===this.style||"ocean-current-m"===this.style)?0:180;e.attributes.Direction=e.attributes.Direction+i,this.rotationVariables.forEach(i=>H(M,m(i,e),i.axis))}return M}_createStyleRenderer(e){let M={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":M=this._createSingleArrowRenderer();break;case"beaufort-kn":M=this._createBeaufortKnotsRenderer();break;case"beaufort-m":M=this._createBeaufortMeterRenderer();break;case"beaufort-ft":M=this._createBeaufortFeetRenderer();break;case"beaufort-mi":M=this._createBeaufortMilesRenderer();break;case"beaufort-km":M=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":M=this._createCurrentMeterRenderer();break;case"ocean-current-kn":M=this._createCurrentKnotsRenderer();break;case"simple-scalar":M=this._createSimpleScalarRenderer();break;case"wind-barb":M=this._createWindBarbsRenderer();break;case"classified-arrow":M=this._createClassifiedArrowRenderer()}return new D(M)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],i=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new M([214,47,39])),classBreakInfos:this._getClassBreaks(e,i)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new M([214,47,39])),classBreakInfos:this._getClassBreaks(e,i)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new M([214,47,39]));let i=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],t=3.28084;i=i.map(e=>e*t);return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,a)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new M([214,47,39]));let i=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],t=2.23694;i=i.map(e=>e*t);return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,a)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new M([214,47,39]));let i=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],t=3.6;i=i.map(e=>e*t);return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,a)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],i=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new M([177,177,177])),classBreakInfos:this._getClassBreaks(e,i)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],i=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new M([177,177,177])),classBreakInfos:this._getClassBreaks(e,i)}}_createClassifiedArrowRenderer(){const e=this._getDefaultSymbol(new M([56,168,0]));let i=[0,1e-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const e=this.sizeVariables[0].minDataValue,M=this.sizeVariables[0].maxDataValue;if(null!=e&&null!=M){const a=(M-e)/5;i=Array.from({length:5},(M,i)=>e+a*i),i[5]=M}}const a=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(i,a)}}_createSimpleScalarRenderer(){return{defaultSymbol:j.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(e=>5*e),M=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],i=j.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),a=e.map((a,t)=>{let I;if(t!==e.length-1)if(0===t)I={minValue:a,maxValue:e[t+1],symbol:i};else{const i=j.fromJSON({type:"esriPMS",imageData:M[t].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});I={minValue:a,maxValue:e[t+1],symbol:i}}return new w(I)});return{defaultSymbol:i,classBreakInfos:a}}_getClassBreaks(e,i){return i.map((i,a)=>new w({minValue:e[a],maxValue:e[a+1],symbol:this._getDefaultSymbol(new M(i))}))}};e([g({type:["Magnitude"],json:{write:!0}})],b.prototype,"attributeField",void 0),e([g({type:Z.apiValues,json:{type:Z.jsonValues,read:{reader:Z.read},write:{writer:Z.write}}})],b.prototype,"flowRepresentation",void 0),e([g({type:["geographic","arithmetic"],json:{write:!0}})],b.prototype,"rotationType",void 0),e([g({type:z.apiValues,json:{type:z.jsonValues,read:{reader:z.read},write:{writer:z.write}}})],b.prototype,"style",void 0),e([g({json:{write:!0}})],b.prototype,"symbolTileSize",void 0),e([g({type:s.apiValues,json:{type:s.jsonValues,write:{writer:s.write}}})],b.prototype,"inputUnit",void 0),e([U("inputUnit")],b.prototype,"readInputUnit",null),e([g({type:s.apiValues,json:{type:s.jsonValues,read:{reader:s.read},write:{writer:s.write}}})],b.prototype,"outputUnit",void 0),e([U("outputUnit")],b.prototype,"readOutputUnit",null),e([B({vectorField:"vector-field"})],b.prototype,"type",void 0),e([g({type:D})],b.prototype,"styleRenderer",null),e([g({type:C})],b.prototype,"sizeVariables",null),e([g({type:y})],b.prototype,"rotationVariables",null),b=u=e([r("esri.renderers.VectorFieldRenderer")],b);export{b as default};