@arcgis/core 4.32.0-next.20250106 → 4.32.0-next.20250107

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 (144) hide show
  1. package/AttributeBinsGraphic.js +5 -0
  2. package/README.md +1 -1
  3. package/applications/MapViewer/templateUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/000771f8eefcd6af0fda.js +1 -0
  6. package/assets/esri/core/workers/chunks/{9372d08ba8bf3342c48f.js → 011ccfd3acee83e7dc68.js} +1 -1
  7. package/assets/esri/core/workers/chunks/03af4a51043677ffcd0f.js +1 -0
  8. package/assets/esri/core/workers/chunks/{d07da8b63d83af179a2c.js → 05943caacfd28c383810.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{9f495ad57cdbfa90c5b8.js → 095aeb19e2207c8361ca.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{67c7bdc0c91a8f803ea8.js → 11cb25dfab7c8467897a.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{42aa697b4718b75b8cb2.js → 1abeba63bf623a746d5c.js} +2 -2
  12. package/assets/esri/core/workers/chunks/{42aa697b4718b75b8cb2.js.LICENSE.txt → 1abeba63bf623a746d5c.js.LICENSE.txt} +1 -1
  13. package/assets/esri/core/workers/chunks/{a57cead317eb2fc9afd8.js → 206194cf069ad4bcc3ad.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{0673d811c496143fc3d4.js → 2779cf112299b612a73a.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{bd37c9cc720587665fd3.js → 304b88ade7551130ad3a.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{aedff36d3fec86abb9fb.js → 30a84ddf0384bb52fdbe.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{367af4aa7e170c8553e3.js → 33a13544b9e5f4f20bce.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{dce55e7f76adecc055c3.js → 35d9457109d0631a1ca8.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{3a90163b76b0bc7f21d2.js → 3767defbd9c4b2e86886.js} +1 -1
  20. package/assets/esri/core/workers/chunks/3a3e9701e5d7b05f41b7.js +1 -0
  21. package/assets/esri/core/workers/chunks/{9a498f2c007f4d78d4dd.js → 4234539a9721104acafb.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{76fa5c7c87831ad25cde.js → 435c037ccba71f1e22d3.js} +1 -1
  23. package/assets/esri/core/workers/chunks/4387c47ae1b36d770f1d.js +1 -0
  24. package/assets/esri/core/workers/chunks/{88c68881cbdf4e911832.js → 4423aac6e44c3dbf184e.js} +1 -1
  25. package/assets/esri/core/workers/chunks/44ec3c77339b9765aaa4.js +1 -0
  26. package/assets/esri/core/workers/chunks/4b77c8d994498899631a.js +1 -0
  27. package/assets/esri/core/workers/chunks/62f8949a2d9076f3c1ea.js +2 -0
  28. package/assets/esri/core/workers/chunks/{c8cd6ba5600d8ff8db0b.js.LICENSE.txt → 62f8949a2d9076f3c1ea.js.LICENSE.txt} +1 -1
  29. package/assets/esri/core/workers/chunks/{664aa401887b59abd7b7.js → 6400f39a965900f66ce7.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{ddce265c46e4dfeb6c6d.js → 66d40a486aa3caa76106.js} +1 -1
  31. package/assets/esri/core/workers/chunks/6b3ee691646fbc39445c.js +1 -0
  32. package/assets/esri/core/workers/chunks/{533a7fd64b17bb294545.js → 6c58f792e2ae3736f662.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{370b230fd2d7703d0698.js → 6efb36bc2205203ff44d.js} +2 -2
  34. package/assets/esri/core/workers/chunks/{370b230fd2d7703d0698.js.LICENSE.txt → 6efb36bc2205203ff44d.js.LICENSE.txt} +1 -1
  35. package/assets/esri/core/workers/chunks/{a90611cdc86190799560.js → 7a43fda8984549a084b8.js} +1 -1
  36. package/assets/esri/core/workers/chunks/7b753da3b8a6d75abf20.js +1 -0
  37. package/assets/esri/core/workers/chunks/{9b020c47ca9ff5de9bb8.js → 7db356976198c4df76c1.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{4c56698cf1c669371865.js → 81816410cb1453938593.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{4ffaa2c5ab47a599ee9f.js → 82266ca8002554198208.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{f19d3c855f6e93544918.js → 8be0151a24c9af76a976.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{d9e396adf3354ee68339.js → 8f2b2d2dc9935b0d2039.js} +1 -1
  42. package/assets/esri/core/workers/chunks/907a91266e25cc4b9d42.js +1 -0
  43. package/assets/esri/core/workers/chunks/{a77aa86896bbb0e088df.js → 9857491cafa0278d9ae6.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{993db7646a8fc60179eb.js → 98da074899c82f0ded0b.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{3bb94da29dac3367ecc6.js → a1edd3f68e691ea39594.js} +1 -1
  46. package/assets/esri/core/workers/chunks/b07710e01494a6cda097.js +1 -0
  47. package/assets/esri/core/workers/chunks/{6a4305eb1e52b80ecb5c.js → b8ea84adff5619040494.js} +3 -3
  48. package/assets/esri/core/workers/chunks/{005727711cca0614c2ab.js → c05e0bd145a1c27d6857.js} +2 -2
  49. package/assets/esri/core/workers/chunks/{005727711cca0614c2ab.js.LICENSE.txt → c05e0bd145a1c27d6857.js.LICENSE.txt} +1 -1
  50. package/assets/esri/core/workers/chunks/c4374b6bc5c8dc6435c7.js +1 -0
  51. package/assets/esri/core/workers/chunks/c49707b577f3805f0142.js +1 -0
  52. package/assets/esri/core/workers/chunks/c5a928dcff7dc8a8cc9f.js +2 -0
  53. package/assets/esri/core/workers/chunks/{f4e3db71d1adae717535.js.LICENSE.txt → c5a928dcff7dc8a8cc9f.js.LICENSE.txt} +1 -1
  54. package/assets/esri/core/workers/chunks/cac79b64a7dade8bf486.js +2 -0
  55. package/assets/esri/core/workers/chunks/{bf0a0ca7fdac98f06a89.js.LICENSE.txt → cac79b64a7dade8bf486.js.LICENSE.txt} +1 -1
  56. package/assets/esri/core/workers/chunks/{2cccaf50134c65944e0a.js → d0876eed5249b029f9f0.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{178f606c8896ae5f39de.js → d1dbbab4a4c6072c182f.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{8e42fb623f56942958d8.js → d74b5dc60f02892d03e7.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{9ad7d095e614e7e8d7f5.js → dca0eb66116e4b5403fc.js} +1 -1
  60. package/assets/esri/core/workers/chunks/e27b8674a3492db51f2e.js +1 -0
  61. package/assets/esri/core/workers/chunks/{756c2f7c8659deab6c96.js → e2d987c39a6ef318511c.js} +2 -2
  62. package/assets/esri/core/workers/chunks/{756c2f7c8659deab6c96.js.LICENSE.txt → e2d987c39a6ef318511c.js.LICENSE.txt} +1 -1
  63. package/assets/esri/core/workers/chunks/{943428cf643e87ccfaad.js → e7e26b71f9eb28421936.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{f0adabf6d71a27f3183b.js → e80b0646a7e0e466ea65.js} +1 -1
  65. package/assets/esri/core/workers/chunks/e9c21907fabcedbd32ae.js +1 -0
  66. package/assets/esri/core/workers/chunks/{f9af0473878d960a02f2.js → f6d6bc43ac1c13892d44.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{3ed7c8138231de3a3b96.js → f8c960df1dabab120c70.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{fdd8a5eb07466541f1f9.js → fd95b19f02d8dfef2baf.js} +1 -1
  69. package/assets/esri/widgets/support/GridControls/t9n/GridControls_ja.json +1 -1
  70. package/chunks/bufferOperator.js +1 -1
  71. package/chunks/geodesicBufferOperator.js +1 -1
  72. package/chunks/terrainUtilsPlanar.js +1 -1
  73. package/chunks/terrainUtilsSpherical.js +1 -1
  74. package/geometry/operators/graphicBufferOperator.js +1 -1
  75. package/geometry/support/meshVertexSpaceUtils.js +1 -1
  76. package/interfaces.d.ts +11 -5
  77. package/layers/graphics/data/QueryEngineResult.js +1 -1
  78. package/layers/graphics/data/queryUtils.js +1 -1
  79. package/layers/graphics/data/queryValidationUtils.js +1 -1
  80. package/layers/graphics/sources/WFSSource.js +1 -1
  81. package/layers/support/capabilities.js +1 -1
  82. package/layers/support/featureLayerUtils.js +1 -1
  83. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  84. package/package.json +2 -2
  85. package/renderers/RasterStretchRenderer.js +1 -1
  86. package/rest/query/executeAttributeBinsQuery.js +1 -1
  87. package/rest/support/AttributeBinsFeatureSet.js +5 -0
  88. package/rest/support/AttributeBinsQuery.js +1 -1
  89. package/rest/support/BinParametersAttributes.js +1 -1
  90. package/rest/support/BinParametersBase.js +1 -1
  91. package/rest/support/DateBinParameters.js +1 -1
  92. package/rest/support/FeatureSet.js +1 -1
  93. package/rest/support/NormalizationBinParametersMixin.js +1 -1
  94. package/rest/support/Query.js +1 -1
  95. package/rest/support/TopFeaturesQuery.js +1 -1
  96. package/smartMapping/renderers/dotDensity.js +1 -1
  97. package/smartMapping/renderers/pieChart.js +1 -1
  98. package/smartMapping/statistics/summaryStatisticsForAttributes.js +1 -1
  99. package/support/revision.js +1 -1
  100. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  101. package/symbols/cim/cimAnalyzer.js +1 -1
  102. package/views/2d/engine/Bitmap.js +1 -1
  103. package/views/2d/engine/BitmapContainer.js +1 -1
  104. package/views/2d/engine/BitmapTileContainer.js +1 -1
  105. package/views/2d/engine/webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js +1 -1
  106. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  107. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  108. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  109. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  110. package/views/3d/state/NearFarHeuristic.js +1 -1
  111. package/views/3d/terrain/TerrainRenderer.js +1 -1
  112. package/views/3d/terrain/TerrainSurface.js +1 -1
  113. package/views/3d/terrain/terrainUtilsPlanar.js +1 -1
  114. package/views/3d/terrain/terrainUtilsSpherical.js +1 -1
  115. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  116. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  117. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +4 -4
  118. package/views/draw/support/HighlightHelper.js +1 -1
  119. package/views/layers/DimensionLayerView.js +1 -1
  120. package/views/webgl/Texture.js +1 -1
  121. package/views/webgl/textureUtils.js +5 -0
  122. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  123. package/widgets/Editor/UpdateWorkflow.js +1 -1
  124. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  125. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  126. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  127. package/widgets/support/ColorPicker.js +1 -1
  128. package/assets/esri/core/workers/chunks/0a3bf1b74cce1b6b7ed8.js +0 -1
  129. package/assets/esri/core/workers/chunks/0d2411a941c42acb8cc2.js +0 -1
  130. package/assets/esri/core/workers/chunks/13720b1d97fb7d80e972.js +0 -1
  131. package/assets/esri/core/workers/chunks/14b87f3dd9942e6b19d0.js +0 -1
  132. package/assets/esri/core/workers/chunks/16530347bd78dc6c2fcd.js +0 -1
  133. package/assets/esri/core/workers/chunks/1a713cc601c6fcd97d2f.js +0 -1
  134. package/assets/esri/core/workers/chunks/3029354194f1a3030c5c.js +0 -1
  135. package/assets/esri/core/workers/chunks/318a39b56851e707edad.js +0 -1
  136. package/assets/esri/core/workers/chunks/53cd990b2c988518de6d.js +0 -1
  137. package/assets/esri/core/workers/chunks/5a0eb9dfe668cf290462.js +0 -1
  138. package/assets/esri/core/workers/chunks/9f0ebeae8a3ba360284b.js +0 -1
  139. package/assets/esri/core/workers/chunks/a3cef3837f4df9ab022e.js +0 -1
  140. package/assets/esri/core/workers/chunks/bf0a0ca7fdac98f06a89.js +0 -2
  141. package/assets/esri/core/workers/chunks/c8cd6ba5600d8ff8db0b.js +0 -2
  142. package/assets/esri/core/workers/chunks/ea250d66089967976c05.js +0 -1
  143. package/assets/esri/core/workers/chunks/ecf317c6c790b3cc83bf.js +0 -1
  144. package/assets/esri/core/workers/chunks/f4e3db71d1adae717535.js +0 -2
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{geometryTypes as t}from"../../geometry.js";import o from"../../core/Clonable.js";import{JSONMap as r}from"../../core/jsonMap.js";import i from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{ensureType as n}from"../../core/accessorSupport/ensureType.js";import"../../core/RandomLCG.js";import"../../core/has.js";import{enumeration as p}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{fromJSON as m}from"../../geometry/support/jsonUtils.js";import{unitsKebabDict as u}from"../../layers/graphics/data/queryUtils.js";import d from"./AutoIntervalBinParameters.js";import c from"./BinParametersBase.js";import y from"./DateBinParameters.js";import j from"./FixedBoundariesBinParameters.js";import f from"./FixedIntervalBinParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import v from"./StatisticDefinition.js";import{isTimeZoneValid as w}from"../../time/timeZoneUtils.js";import S from"../../geometry/SpatialReference.js";const g=new r({asc:"ascending",desc:"descending"}),b={base:c,key:"type",typeMap:{"auto-interval":d,date:y,"fixed-boundaries":j,"fixed-interval":f}};let B=class extends(o.ClonableMixin(i)){constructor(e){super(e),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(e){this._set("outTimeZone",e),e&&!w(e)&&s.getLogger(this).warn("#outTimeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}};e([a({types:b,json:{name:"bin",write:!0}})],B.prototype,"binParameters",void 0),e([p(g)],B.prototype,"binOrder",void 0),e([a({type:Boolean,json:{write:!0}})],B.prototype,"cacheHint",void 0),e([a({json:{write:!0}})],B.prototype,"datumTransformation",void 0),e([a({type:S,json:{name:"defaultSR",write:!0}})],B.prototype,"defaultSpatialReference",void 0),e([a({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],B.prototype,"distance",void 0),e([a({types:t,json:{read:m,write:!0}})],B.prototype,"geometry",void 0),e([a({type:String,json:{write:!0}})],B.prototype,"lowerBoundaryAlias",void 0),e([a({type:S,json:{name:"outSR",write:!0}})],B.prototype,"outSpatialReference",void 0),e([a({type:[v],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],B.prototype,"outStatistics",void 0),e([a({value:null,json:{name:"outTimeReference",read:{reader:e=>e.ianaTimeZone},write:{writer:(e,t,o)=>{e&&(t[o]={ianaTimeZone:e})}}}})],B.prototype,"outTimeZone",null),e([a({type:Boolean,json:{write:!0}})],B.prototype,"returnDistinctValues",void 0),e([p(h,{name:"spatialRel"})],B.prototype,"spatialRelationship",void 0),e([a({type:String,json:{write:!0}})],B.prototype,"upperBoundaryAlias",void 0),e([a({type:String,json:{read:u.read,write:{writer:u.write,overridePolicy(e){return{enabled:null!=e&&null!=this.distance&&this.distance>0}}}}})],B.prototype,"units",void 0),e([a({type:String,json:{write:!0}})],B.prototype,"where",void 0),B=e([l("esri.rest.support.AttributeBinsQuery")],B);const R=B;B.from=n(B);export{R as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{geometryTypes as t}from"../../geometry.js";import o from"../../core/Clonable.js";import{JSONMap as r}from"../../core/jsonMap.js";import i from"../../core/JSONSupport.js";import s from"../../core/Logger.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{ensureType as n}from"../../core/accessorSupport/ensureType.js";import"../../core/RandomLCG.js";import"../../core/has.js";import{enumeration as p}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{fromJSON as m}from"../../geometry/support/jsonUtils.js";import{unitsKebabDict as u}from"../../layers/graphics/data/queryUtils.js";import d from"./AutoIntervalBinParameters.js";import c from"./BinParametersBase.js";import y from"./DateBinParameters.js";import j from"./FixedBoundariesBinParameters.js";import f from"./FixedIntervalBinParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import v from"./StatisticDefinition.js";import{isTimeZoneValid as w}from"../../time/timeZoneUtils.js";import S from"../../geometry/SpatialReference.js";const g=new r({asc:"ascending",desc:"descending"}),b={base:c,key:"type",typeMap:{"auto-interval":d,date:y,"fixed-boundaries":j,"fixed-interval":f}};let B=class extends(o.ClonableMixin(i)){constructor(e){super(e),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(e){this._set("outTimeZone",e),e&&!w(e)&&s.getLogger(this).warn("#outTimeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}};e([a({types:b,json:{name:"bin",write:!0}})],B.prototype,"binParameters",void 0),e([p(g)],B.prototype,"binOrder",void 0),e([a({type:Boolean,json:{write:!0}})],B.prototype,"cacheHint",void 0),e([a({json:{write:!0}})],B.prototype,"datumTransformation",void 0),e([a({type:S,json:{name:"defaultSR",write:!0}})],B.prototype,"defaultSpatialReference",void 0),e([a({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],B.prototype,"distance",void 0),e([a({types:t,json:{read:m,write:!0}})],B.prototype,"geometry",void 0),e([a({type:String,json:{write:!0}})],B.prototype,"lowerBoundaryAlias",void 0),e([a({type:S,json:{name:"outSR",write:!0}})],B.prototype,"outSpatialReference",void 0),e([a({type:[v],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],B.prototype,"outStatistics",void 0),e([a({value:null,json:{name:"outTimeReference",read:{reader:e=>e.ianaTimeZone},write:{writer:(e,t,o)=>{e&&(t[o]={ianaTimeZone:e})}}}})],B.prototype,"outTimeZone",null),e([a({type:Boolean,json:{write:!0}})],B.prototype,"returnDistinctValues",void 0),e([p(h,{name:"spatialRel"})],B.prototype,"spatialRelationship",void 0),e([a({type:String,json:{write:!0}})],B.prototype,"upperBoundaryAlias",void 0),e([a({type:String,json:{read:u.read,write:{writer:u.write,overridePolicy(e){return{enabled:null!=e&&null!=this.distance}}}}})],B.prototype,"units",void 0),e([a({type:String,json:{write:!0}})],B.prototype,"where",void 0),B=e([l("esri.rest.support.AttributeBinsQuery")],B);const R=B;B.from=n(B);export{R as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../core/Clonable.js";import s from"../../core/JSONSupport.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import{ensureType as t}from"../../core/accessorSupport/ensureType.js";import"../../core/RandomLCG.js";import"../../core/has.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";let i=class extends(r.ClonableMixin(s)){constructor(o){super(o),this.alias=null,this.expression=null,this.field=null,this.responseType=null}};o([e({type:String,json:{write:!0}})],i.prototype,"alias",void 0),o([e({type:String,json:{write:!0}})],i.prototype,"expression",void 0),o([e({type:String,json:{write:!0}})],i.prototype,"field",void 0),o([e({type:String,json:{write:!0}})],i.prototype,"responseType",void 0),i=o([p("esri.rest.support.BinParametersAttributes")],i);const n=i;i.from=t(i);export{n as default};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import r from"../../core/Clonable.js";import e from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import{ensureType as s}from"../../core/accessorSupport/ensureType.js";import"../../core/RandomLCG.js";import"../../core/has.js";import{enumeration as p}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{kebabDict as a}from"../../layers/support/fieldType.js";let l=class extends(r.ClonableMixin(e)){constructor(o){super(o),this.alias=null,this.responseType=null,this.type=null,this.value=null,this.valueType=null}};o([t({type:String,json:{name:"outAlias",write:!0}})],l.prototype,"alias",void 0),o([t({type:String})],l.prototype,"responseType",void 0),o([t({type:String,json:{write:!0}})],l.prototype,"type",void 0),o([t({type:String,json:{write:!0}})],l.prototype,"value",void 0),o([p(a)],l.prototype,"valueType",void 0),l=o([i("esri.rest.support.BinParametersAttributes")],l);const n=l;l.from=s(l);export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Clonable.js";import{JSONMap as s}from"../../core/jsonMap.js";import r from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as o}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import p from"./BinParametersAttributes.js";const a=new s({naturalLog:"natural-log",squareRoot:"square-root"});let n=class extends(e.ClonableMixin(r)){constructor(t){super(t),this.expression=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitByAttributes=null,this.stackByAttributes=null,this.transformation=null}};t([i({type:String,json:{write:!0}})],n.prototype,"expression",void 0),t([i({type:String,json:{name:"onField",write:!0}})],n.prototype,"field",void 0),t([i({type:String,json:{write:!0}})],n.prototype,"firstDayOfWeek",void 0),t([i({type:String,json:{write:!0}})],n.prototype,"hideUpperBound",void 0),t([i({type:p,json:{write:{target:{splitBy:{type:String},splitByField:{type:String},splitByAlias:{type:String}},writer:(t,e)=>{null!=t.field&&(e.splitByField=t.field),null!=t.expression&&(e.splitBy=t.expression),null!=t.alias&&(e.splitByAlias=t.alias)}},read:{source:["splitBy","splitByField","splitByAlias"],reader:(t,e)=>new p({field:e.splitByField,expression:e.splitBy,alias:e.splitByAlias})}}})],n.prototype,"splitByAttributes",void 0),t([i({type:p,json:{write:{target:{stackBy:{type:String},stackByField:{type:String},stackByAlias:{type:String},jsonStyle:{type:String}},writer:(t,e)=>{null!=t.field&&(e.stackByField=t.field),null!=t.expression&&(e.stackBy=t.expression),null!=t.alias&&(e.stackByAlias=t.alias),null!=t.responseType&&(e.jsonStyle=t.responseType)},overridePolicy(){return{enabled:null!=this.stackByAttributes?.field||null!=this.stackByAttributes?.expression}}},read:{source:["stackBy","stackByField","stackByAlias","jsonStyle"],reader:(t,e)=>new p({field:e.stackByField,expression:e.stackBy,alias:e.stackByAlias,responseType:e.jsonStyle})}}})],n.prototype,"stackByAttributes",void 0),t([o(a)],n.prototype,"transformation",void 0),n=t([l("esri.rest.support.BinParametersBase")],n);const y=n;export{y as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import o from"../../core/Clonable.js";import{JSONMap as t}from"../../core/jsonMap.js";import r from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as p}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{kebabDict as n}from"../../layers/support/fieldType.js";import l from"./BinParametersAttributes.js";const a=new t({naturalLog:"natural-log",squareRoot:"square-root"});let y=class extends(o.ClonableMixin(r)){constructor(e){super(e),this.expression=null,this.expressionValueType=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitBy=null,this.stackBy=null,this.transformation=null}};e([s({type:String,json:{name:"onExpression.value",write:!0}})],y.prototype,"expression",void 0),e([p(n,{name:"onExpression.valueType"})],y.prototype,"expressionValueType",void 0),e([s({type:String,json:{name:"onField",write:!0}})],y.prototype,"field",void 0),e([s({type:String,json:{write:!0}})],y.prototype,"firstDayOfWeek",void 0),e([s({type:String,json:{write:!0}})],y.prototype,"hideUpperBound",void 0),e([s({type:l,json:{write:{overridePolicy(){return{enabled:null!=this.splitBy?.value||null!=this.splitBy?.type}}}}})],y.prototype,"splitBy",void 0),e([s({type:l,json:{write:{target:{stackBy:{type:l},jsonStyle:{type:String}},writer:(e,o)=>{e&&(o.stackBy=e.toJSON(),null!=e.responseType&&(o.jsonStyle=e.responseType))},overridePolicy(){return{enabled:null!=this.stackBy?.value||null!=this.stackBy?.type}}},read:{source:["stackBy","jsonStyle"],reader:(e,o)=>l.fromJSON({...o.stackBy,responseType:o.jsonStyle})}}})],y.prototype,"stackBy",void 0),e([p(a)],y.prototype,"transformation",void 0),y=e([i("esri.rest.support.BinParametersBase")],y);const u=y;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{setDeepValue as t}from"../../core/object.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{ensureType as o}from"../../core/accessorSupport/ensureType.js";import"../../core/RandomLCG.js";import"../../core/has.js";import{enumeration as s}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import n from"./BinParametersBase.js";import p from"./DateBinTimeInterval.js";function i(e,r,o){t(o,"string"==typeof e?e:e?.getTime(),r)}function m(e,t){const r=e.parameters[t];return r?"string"==typeof r?r:new Date(r):null}let c=class extends n{constructor(e){super(e),this.end=null,this.interval=null,this.offset=null,this.start=null,this.type="date"}};e([r({cast:e=>e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.end",read:{reader:(e,t)=>m(t,"end")},write:{writer:i}}})],c.prototype,"end",void 0),e([r({type:p,json:{name:"parameters",write:!0}})],c.prototype,"interval",void 0),e([r({type:p,json:{name:"parameters.offset",write:!0}})],c.prototype,"offset",void 0),e([r({cast:e=>e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.start",read:{reader:(e,t)=>m(t,"start")},write:{writer:i}}})],c.prototype,"start",void 0),e([s({dateBin:"date"},{readOnly:!0})],c.prototype,"type",void 0),c=e([a("esri.rest.support.DateBinParameters")],c);const d=c;c.from=o(c);export{d as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import{setDeepValue as e}from"../../core/object.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{ensureType as o}from"../../core/accessorSupport/ensureType.js";import"../../core/RandomLCG.js";import"../../core/has.js";import{enumeration as s}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import n from"./BinParametersBase.js";import p from"./DateBinTimeInterval.js";function i(t,r,o){e(o,"string"==typeof t?t:t?.getTime(),r)}function m(t,e){const r=t.parameters[e];return r?"string"==typeof r?r:new Date(r):null}let l=class extends n{constructor(t){super(t),this.end=null,this.interval=null,this.offset=null,this.returnFullIntervalBin=null,this.start=null,this.snapToData=null,this.type="date"}};t([r({cast:t=>t?"string"==typeof t?t:new Date(t):null,json:{name:"parameters.end",read:{reader:(t,e)=>m(e,"end")},write:{writer:i}}})],l.prototype,"end",void 0),t([r({type:p,json:{name:"parameters",write:!0}})],l.prototype,"interval",void 0),t([r({type:p,json:{name:"parameters.offset",write:!0}})],l.prototype,"offset",void 0),t([r({type:Boolean,json:{name:"parameters.returnFullIntervalBin",write:!0}})],l.prototype,"returnFullIntervalBin",void 0),t([r({cast:t=>t?"string"==typeof t?t:new Date(t):null,json:{name:"parameters.start",read:{reader:(t,e)=>m(e,"start")},write:{writer:i}}})],l.prototype,"start",void 0),t([r({type:String,json:{name:"parameters.snapToData",write:!0}})],l.prototype,"snapToData",void 0),t([s({dateBin:"date"},{readOnly:!0})],l.prototype,"type",void 0),l=t([a("esri.rest.support.DateBinParameters")],l);const c=l;l.from=o(l);export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{geometryTypes as t}from"../../geometry.js";import r from"../../Graphic.js";import{JSONMap as o}from"../../core/jsonMap.js";import s from"../../core/JSONSupport.js";import{clone as n}from"../../core/lang.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import m from"../../geometry/SpatialReference.js";import{fromJSON as c,isPolygon as f}from"../../geometry/support/jsonUtils.js";import u from"../../layers/support/Field.js";var y;const h=new o({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let g=y=class extends s{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const o=m.fromJSON(t.spatialReference),s=[];for(let n=0;n<e.length;n++){const t=e[n],i=r.fromJSON(t),l=t.geometry?.spatialReference;null==i.geometry||l||(i.geometry.spatialReference=o);const a=t.aggregateGeometries,p=i.aggregateGeometries;if(a&&null!=p)for(const e in p){const t=p[e],r=a[e],s=r?.spatialReference;null==t||s||(t.spatialReference=o)}s.push(i)}return s}writeGeometryType(e,t,r,o){if(e)return void h.write(e,t,r,o);const{features:s}=this;if(s)for(const n of s)if(null!=n?.geometry)return void h.write(n.geometry.type,t,r,o)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,o=c(e);return o&&!r&&t.spatialReference&&(o.spatialReference=m.fromJSON(t.spatialReference)),o}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const o of r)if(o&&null!=o.geometry&&o.geometry.spatialReference)return void(t.spatialReference=o.geometry.spatialReference.toJSON())}clone(){return new y(this.cloneProperties())}cloneProperties(){return n({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const o=t.features[r];if(o.geometry){const t=e?.[r];o.geometry=t?.toJSON()||o.geometry}}return t}quantize(e){const{scale:[t,r],translate:[o,s]}=e,n=e=>Math.round((e-o)/t),i=e=>Math.round((s-e)/r),l=this.features,a=this._getQuantizationFunction(this.geometryType,n,i);for(let p=0,m=l.length;p<m;p++)a?.(l[p].geometry)||(l.splice(p,1),p--,m--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[o,s],scale:[n,i]}=r,l=e=>e*n+o,a=e=>s-e*i;let p=null,m=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;p=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;m=r=>null==r?r:r*t+e}const c=this._getHydrationFunction(e,l,a,p,m);for(const{geometry:f}of t)null!=f&&c&&c(f);return this.transform=null,this}_quantizePoints(e,t,r){let o,s;const n=[];for(let i=0,l=e.length;i<l;i++){const l=e[i];if(i>0){const e=t(l[0]),i=r(l[1]);e===o&&i===s||(n.push([e-o,i-s]),o=e,s=i)}else o=t(l[0]),s=r(l[1]),n.push([o,s])}return n.length>0?n:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const o=f(e)?e.rings:e.paths,s=[];for(let n=0,i=o.length;n<i;n++){const e=o[n],i=this._quantizePoints(e,t,r);i&&s.push(i)}return s.length>0?(f(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const o=this._quantizePoints(e.points,t,r);return o&&o.length>0?(e.points=o,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,o,s){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),o&&(e.z=o(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=f(e)?e.rings:e.paths;let i,l;for(let o=0,s=n.length;o<s;o++){const e=n[o];for(let o=0,s=e.length;o<s;o++){const s=e[o];o>0?(i+=s[0],l+=s[1]):(i=s[0],l=s[1]),s[0]=t(i),s[1]=r(l)}}if(o&&s)for(let t=0,r=n.length;t<r;t++){const e=n[t];for(let t=0,r=e.length;t<r;t++){const r=e[t];r[2]=o(r[2]),r[3]=s(r[3])}}else if(o)for(let t=0,r=n.length;t<r;t++){const e=n[t];for(let t=0,r=e.length;t<r;t++){const r=e[t];r[2]=o(r[2])}}else if(s)for(let t=0,r=n.length;t<r;t++){const e=n[t];for(let t=0,r=e.length;t<r;t++){const r=e[t];r[2]=s(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),o&&null!=e.zmax&&null!=e.zmin&&(e.zmax=o(e.zmax),e.zmin=o(e.zmin)),s&&null!=e.mmax&&null!=e.mmin&&(e.mmax=s(e.mmax),e.mmin=s(e.mmin))}:"multipoint"===e?e=>{const n=e.points;let i,l;for(let o=0,s=n.length;o<s;o++){const e=n[o];o>0?(i+=e[0],l+=e[1]):(i=e[0],l=e[1]),e[0]=t(i),e[1]=r(l)}if(o&&s)for(let t=0,r=n.length;t<r;t++){const e=n[t];e[2]=o(e[2]),e[3]=s(e[3])}else if(o)for(let t=0,r=n.length;t<r;t++){const e=n[t];e[2]=o(e[2])}else if(s)for(let t=0,r=n.length;t<r;t++){const e=n[t];e[2]=s(e[2])}}:null}};e([i({type:String,json:{write:!0}})],g.prototype,"displayFieldName",void 0),e([i({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"exceededTransferLimit",void 0),e([i({type:[r],json:{write:!0}})],g.prototype,"features",void 0),e([l("features")],g.prototype,"readFeatures",null),e([i({type:[u],json:{write:!0}})],g.prototype,"fields",void 0),e([i({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:h.read}}})],g.prototype,"geometryType",void 0),e([p("geometryType")],g.prototype,"writeGeometryType",null),e([i({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasM",void 0),e([i({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasZ",void 0),e([i({types:t,json:{write:!0}})],g.prototype,"queryGeometry",void 0),e([l("queryGeometry")],g.prototype,"readQueryGeometry",null),e([i({type:m,json:{write:!0}})],g.prototype,"spatialReference",void 0),e([p("spatialReference")],g.prototype,"writeSpatialReference",null),e([i({json:{write:!0}})],g.prototype,"transform",void 0),g=y=e([a("esri.rest.support.FeatureSet")],g),g.prototype.toJSON.isDefaultToJSON=!0;const d=g;export{d as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{geometryTypes as t}from"../../geometry.js";import r from"../../Graphic.js";import{JSONMap as o}from"../../core/jsonMap.js";import s from"../../core/JSONSupport.js";import{clone as n}from"../../core/lang.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import m from"../../geometry/SpatialReference.js";import{fromJSON as u,isPolygon as c}from"../../geometry/support/jsonUtils.js";import f from"../../layers/support/Field.js";var y;const h=new o({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let g=y=class extends s{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,r)}writeGeometryType(e,t,r,o){if(e)return void h.write(e,t,r,o);const{features:s}=this;if(s)for(const n of s)if(null!=n?.geometry)return void h.write(n.geometry.type,t,r,o)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,o=u(e);return o&&!r&&t.spatialReference&&(o.spatialReference=m.fromJSON(t.spatialReference)),o}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const o of r)if(o&&null!=o.geometry&&o.geometry.spatialReference)return void(t.spatialReference=o.geometry.spatialReference.toJSON())}clone(){return new y(this.cloneProperties())}cloneProperties(){return n({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const o=t.features[r];if(o.geometry){const t=e?.[r];o.geometry=t?.toJSON()||o.geometry}}return t}quantize(e){const{scale:[t,r],translate:[o,s]}=e,n=e=>Math.round((e-o)/t),i=e=>Math.round((s-e)/r),l=this.features,a=this._getQuantizationFunction(this.geometryType,n,i);for(let p=0,m=l.length;p<m;p++)a?.(l[p].geometry)||(l.splice(p,1),p--,m--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[o,s],scale:[n,i]}=r,l=e=>e*n+o,a=e=>s-e*i;let p=null,m=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;p=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;m=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,l,a,p,m);for(const{geometry:c}of t)null!=c&&u&&u(c);return this.transform=null,this}readFeaturesWithClass(e,t,r){const o=m.fromJSON(t.spatialReference),s=[];for(let n=0;n<e.length;n++){const t=e[n],i=r.fromJSON(t),l=t.geometry?.spatialReference;null==i.geometry||l||(i.geometry.spatialReference=o);const a=t.aggregateGeometries,p=i.aggregateGeometries;if(a&&null!=p)for(const e in p){const t=p[e],r=a[e],s=r?.spatialReference;null==t||s||(t.spatialReference=o)}s.push(i)}return s}_quantizePoints(e,t,r){let o,s;const n=[];for(let i=0,l=e.length;i<l;i++){const l=e[i];if(i>0){const e=t(l[0]),i=r(l[1]);e===o&&i===s||(n.push([e-o,i-s]),o=e,s=i)}else o=t(l[0]),s=r(l[1]),n.push([o,s])}return n.length>0?n:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const o=c(e)?e.rings:e.paths,s=[];for(let n=0,i=o.length;n<i;n++){const e=o[n],i=this._quantizePoints(e,t,r);i&&s.push(i)}return s.length>0?(c(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const o=this._quantizePoints(e.points,t,r);return o&&o.length>0?(e.points=o,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,o,s){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),o&&(e.z=o(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=c(e)?e.rings:e.paths;let i,l;for(let o=0,s=n.length;o<s;o++){const e=n[o];for(let o=0,s=e.length;o<s;o++){const s=e[o];o>0?(i+=s[0],l+=s[1]):(i=s[0],l=s[1]),s[0]=t(i),s[1]=r(l)}}if(o&&s)for(let t=0,r=n.length;t<r;t++){const e=n[t];for(let t=0,r=e.length;t<r;t++){const r=e[t];r[2]=o(r[2]),r[3]=s(r[3])}}else if(o)for(let t=0,r=n.length;t<r;t++){const e=n[t];for(let t=0,r=e.length;t<r;t++){const r=e[t];r[2]=o(r[2])}}else if(s)for(let t=0,r=n.length;t<r;t++){const e=n[t];for(let t=0,r=e.length;t<r;t++){const r=e[t];r[2]=s(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),o&&null!=e.zmax&&null!=e.zmin&&(e.zmax=o(e.zmax),e.zmin=o(e.zmin)),s&&null!=e.mmax&&null!=e.mmin&&(e.mmax=s(e.mmax),e.mmin=s(e.mmin))}:"multipoint"===e?e=>{const n=e.points;let i,l;for(let o=0,s=n.length;o<s;o++){const e=n[o];o>0?(i+=e[0],l+=e[1]):(i=e[0],l=e[1]),e[0]=t(i),e[1]=r(l)}if(o&&s)for(let t=0,r=n.length;t<r;t++){const e=n[t];e[2]=o(e[2]),e[3]=s(e[3])}else if(o)for(let t=0,r=n.length;t<r;t++){const e=n[t];e[2]=o(e[2])}else if(s)for(let t=0,r=n.length;t<r;t++){const e=n[t];e[2]=s(e[2])}}:null}};e([i({type:String,json:{write:!0}})],g.prototype,"displayFieldName",void 0),e([i({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"exceededTransferLimit",void 0),e([i({type:[r],json:{write:!0}})],g.prototype,"features",void 0),e([l("features")],g.prototype,"readFeatures",null),e([i({type:[f],json:{write:!0}})],g.prototype,"fields",void 0),e([i({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:h.read}}})],g.prototype,"geometryType",void 0),e([p("geometryType")],g.prototype,"writeGeometryType",null),e([i({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasM",void 0),e([i({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasZ",void 0),e([i({types:t,json:{write:!0}})],g.prototype,"queryGeometry",void 0),e([l("queryGeometry")],g.prototype,"readQueryGeometry",null),e([i({type:m,json:{write:!0}})],g.prototype,"spatialReference",void 0),e([p("spatialReference")],g.prototype,"writeSpatialReference",null),e([i({json:{write:!0}})],g.prototype,"transform",void 0),g=y=e([a("esri.rest.support.FeatureSet")],g),g.prototype.toJSON.isDefaultToJSON=!0;const d=g;export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../chunks/tslib.es6.js";import{strict as t}from"../../core/jsonMap.js";import r from"../../core/Logger.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as e}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";const n=t()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),l="percent-of-total",s="field",m=t=>{let m=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let o=this._get("normalizationType");const t=!!this.normalizationField,a=null!=this.normalizationTotal;return t||a?(o=t&&s||a&&l||null,t&&a&&r.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):o!==s&&o!==l||(o=null),o}set normalizationType(o){this._set("normalizationType",o)}};return o([a({type:String,json:{name:"parameters.normalizationField",write:!0}})],m.prototype,"normalizationField",void 0),o([a({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],m.prototype,"normalizationMaxValue",void 0),o([a({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],m.prototype,"normalizationMinValue",void 0),o([a({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],m.prototype,"normalizationTotal",void 0),o([e(n,{name:"parameters.normalizationType"})],m.prototype,"normalizationType",null),m=o([i("esri.rest.support.NormalizationBinParametersMixin")],m),m};export{m as NormalizationBinParametersMixin};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import{strict as t}from"../../core/jsonMap.js";import r from"../../core/Logger.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as e}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";const n=t()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),l="percent-of-total",s="field",m=t=>{let m=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let o=this._get("normalizationType");const t=!!this.normalizationField,a=null!=this.normalizationTotal;return t||a?(o=t&&s||a&&l||null,t&&a&&r.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):o!==s&&o!==l||(o=null),o}set normalizationType(o){this._set("normalizationType",o)}};return o([a({type:String,json:{name:"parameters.normalizationField",write:!0}})],m.prototype,"normalizationField",void 0),o([a({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],m.prototype,"normalizationMaxValue",void 0),o([a({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],m.prototype,"normalizationMinValue",void 0),o([a({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],m.prototype,"normalizationTotal",void 0),o([e(n,{name:"parameters.normalizationType"})],m.prototype,"normalizationType",null),m=o([i("esri.rest.support.NormalizationBinParametersMixin")],m),m};export{m as NormalizationBinParametersMixin,n as normalizationTypeJsonMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import{geometryTypes as e}from"../../geometry.js";import{JSONMap as r}from"../../core/jsonMap.js";import o from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../core/accessorSupport/decorators/cast.js";import{enumeration as a}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import{ensureClass as u}from"../../core/accessorSupport/ensureType.js";import{fromJSON as m}from"../../geometry/support/jsonUtils.js";import{DataLayerSource as c}from"../../layers/support/source/DataLayerSource.js";import d from"./FullTextSearch.js";import y from"./QuantizationParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import f from"./StatisticDefinition.js";import j from"../../time/TimeExtent.js";import v from"../../geometry/SpatialReference.js";import w from"../../geometry/Point.js";var S;const g=new r({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let R=S=class extends o{static from(t){return u(S,t)}constructor(t){super(t),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.returnTrueCurves=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(t){return"number"==typeof t||"object"==typeof t?t:null}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeParameterValues(t,e){if(t){const r={};for(const e in t){const o=t[e];Array.isArray(o)?r[e]=o.map((t=>t instanceof Date?t.getTime():t)):o instanceof Date?r[e]=o.getTime():r[e]=o}e.parameterValues=r}}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(t,e){e.where=t||"1=1"}clone(){return new S(i({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:null!=this.historicMoment?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,returnTrueCurves:this.returnTrueCurves,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};R.MAX_MAX_RECORD_COUNT_FACTOR=5,t([s({json:{write:!0}})],R.prototype,"aggregateIds",void 0),t([s({type:Boolean,json:{write:!0}})],R.prototype,"cacheHint",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"compactGeometryEnabled",void 0),t([s({json:{write:!0}})],R.prototype,"datumTransformation",void 0),t([n("datumTransformation")],R.prototype,"castDatumTransformation",null),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"defaultSpatialReferenceEnabled",void 0),t([s({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],R.prototype,"distance",void 0),t([s({type:c,json:{write:!0}})],R.prototype,"dynamicDataSource",void 0),t([s({type:String,json:{write:!0}})],R.prototype,"formatOf3DObjects",void 0),t([s({type:[d],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.fullText&&this.fullText.length>0}}}}})],R.prototype,"fullText",void 0),t([s({type:String,json:{write:!0}})],R.prototype,"gdbVersion",void 0),t([s({types:e,json:{read:m,write:!0}})],R.prototype,"geometry",void 0),t([s({type:Number,json:{write:!0}})],R.prototype,"geometryPrecision",void 0),t([s({type:[String],json:{write:!0}})],R.prototype,"groupByFieldsForStatistics",void 0),t([s({type:String,json:{write:!0}})],R.prototype,"having",void 0),t([s({type:Date})],R.prototype,"historicMoment",void 0),t([p("historicMoment")],R.prototype,"writeHistoricMoment",null),t([s({type:Number,json:{write:!0}})],R.prototype,"maxAllowableOffset",void 0),t([s({type:Number,cast:t=>t<1?1:t>R.MAX_MAX_RECORD_COUNT_FACTOR?R.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],R.prototype,"maxRecordCountFactor",void 0),t([s({type:["xyFootprint"],json:{write:!0}})],R.prototype,"multipatchOption",void 0),t([s({type:Number,json:{read:{source:"resultRecordCount"}}})],R.prototype,"num",void 0),t([s({json:{write:!0}})],R.prototype,"objectIds",void 0),t([s({type:[String],json:{write:!0}})],R.prototype,"orderByFields",void 0),t([s({type:[String],json:{write:!0}})],R.prototype,"outFields",void 0),t([s({type:v,json:{name:"outSR",write:!0}})],R.prototype,"outSpatialReference",void 0),t([s({type:[f],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],R.prototype,"outStatistics",void 0),t([s({json:{write:!0}})],R.prototype,"parameterValues",void 0),t([p("parameterValues")],R.prototype,"writeParameterValues",null),t([s({type:w,json:{write:!0}})],R.prototype,"pixelSize",void 0),t([s({type:y,json:{write:!0}})],R.prototype,"quantizationParameters",void 0),t([s({type:[Object],json:{write:!0}})],R.prototype,"rangeValues",void 0),t([s({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:"relation"===this.spatialRelationship}}}}})],R.prototype,"relationParameter",void 0),t([s({type:String,json:{write:!0}})],R.prototype,"resultType",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnCentroid",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnDistinctValues",void 0),t([s({type:Boolean,json:{default:!0,write:!0}})],R.prototype,"returnExceededLimitFeatures",void 0),t([s({type:Boolean,json:{write:!0}})],R.prototype,"returnGeometry",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnQueryGeometry",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnM",void 0),t([s({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],R.prototype,"returnZ",void 0),t([s({type:Boolean,json:{write:!0}})],R.prototype,"returnTrueCurves",void 0),t([s({type:v,json:{write:!0}})],R.prototype,"sourceSpatialReference",void 0),t([a(h,{ignoreUnknown:!1,name:"spatialRel"})],R.prototype,"spatialRelationship",void 0),t([s({type:Number,json:{read:{source:"resultOffset"}}})],R.prototype,"start",void 0),t([p("start"),p("num")],R.prototype,"writeStart",null),t([s({type:String,json:{write:!0}})],R.prototype,"sqlFormat",void 0),t([s({type:String,json:{write:!0}})],R.prototype,"text",void 0),t([s({type:j,json:{write:!0}})],R.prototype,"timeExtent",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"timeReferenceUnknownClient",void 0),t([a(g,{ignoreUnknown:!1}),s({json:{write:{overridePolicy(t){return{enabled:!!t&&null!=this.distance&&this.distance>0}}}}})],R.prototype,"units",void 0),t([s({type:String,json:{write:{overridePolicy(t){return{enabled:null!=t||null!=this.start&&this.start>0}}}}})],R.prototype,"where",void 0),t([p("where")],R.prototype,"writeWhere",null),R=S=t([l("esri.rest.support.Query")],R);const b=R;export{b as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import{geometryTypes as e}from"../../geometry.js";import{JSONMap as r}from"../../core/jsonMap.js";import o from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../core/accessorSupport/decorators/cast.js";import{enumeration as a}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import{ensureClass as u}from"../../core/accessorSupport/ensureType.js";import{fromJSON as m}from"../../geometry/support/jsonUtils.js";import{DataLayerSource as c}from"../../layers/support/source/DataLayerSource.js";import d from"./FullTextSearch.js";import y from"./QuantizationParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import f from"./StatisticDefinition.js";import j from"../../time/TimeExtent.js";import v from"../../geometry/SpatialReference.js";import w from"../../geometry/Point.js";var S;const g=new r({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let R=S=class extends o{static from(t){return u(S,t)}constructor(t){super(t),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.returnTrueCurves=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(t){return"number"==typeof t||"object"==typeof t?t:null}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeParameterValues(t,e){if(t){const r={};for(const e in t){const o=t[e];Array.isArray(o)?r[e]=o.map((t=>t instanceof Date?t.getTime():t)):o instanceof Date?r[e]=o.getTime():r[e]=o}e.parameterValues=r}}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(t,e){e.where=t||"1=1"}clone(){return new S(i({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:null!=this.historicMoment?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,returnTrueCurves:this.returnTrueCurves,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};R.MAX_MAX_RECORD_COUNT_FACTOR=5,t([s({json:{write:!0}})],R.prototype,"aggregateIds",void 0),t([s({type:Boolean,json:{write:!0}})],R.prototype,"cacheHint",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"compactGeometryEnabled",void 0),t([s({json:{write:!0}})],R.prototype,"datumTransformation",void 0),t([n("datumTransformation")],R.prototype,"castDatumTransformation",null),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"defaultSpatialReferenceEnabled",void 0),t([s({type:Number,json:{write:!0}})],R.prototype,"distance",void 0),t([s({type:c,json:{write:!0}})],R.prototype,"dynamicDataSource",void 0),t([s({type:String,json:{write:!0}})],R.prototype,"formatOf3DObjects",void 0),t([s({type:[d],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.fullText&&this.fullText.length>0}}}}})],R.prototype,"fullText",void 0),t([s({type:String,json:{write:!0}})],R.prototype,"gdbVersion",void 0),t([s({types:e,json:{read:m,write:!0}})],R.prototype,"geometry",void 0),t([s({type:Number,json:{write:!0}})],R.prototype,"geometryPrecision",void 0),t([s({type:[String],json:{write:!0}})],R.prototype,"groupByFieldsForStatistics",void 0),t([s({type:String,json:{write:!0}})],R.prototype,"having",void 0),t([s({type:Date})],R.prototype,"historicMoment",void 0),t([p("historicMoment")],R.prototype,"writeHistoricMoment",null),t([s({type:Number,json:{write:!0}})],R.prototype,"maxAllowableOffset",void 0),t([s({type:Number,cast:t=>t<1?1:t>R.MAX_MAX_RECORD_COUNT_FACTOR?R.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],R.prototype,"maxRecordCountFactor",void 0),t([s({type:["xyFootprint"],json:{write:!0}})],R.prototype,"multipatchOption",void 0),t([s({type:Number,json:{read:{source:"resultRecordCount"}}})],R.prototype,"num",void 0),t([s({json:{write:!0}})],R.prototype,"objectIds",void 0),t([s({type:[String],json:{write:!0}})],R.prototype,"orderByFields",void 0),t([s({type:[String],json:{write:!0}})],R.prototype,"outFields",void 0),t([s({type:v,json:{name:"outSR",write:!0}})],R.prototype,"outSpatialReference",void 0),t([s({type:[f],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],R.prototype,"outStatistics",void 0),t([s({json:{write:!0}})],R.prototype,"parameterValues",void 0),t([p("parameterValues")],R.prototype,"writeParameterValues",null),t([s({type:w,json:{write:!0}})],R.prototype,"pixelSize",void 0),t([s({type:y,json:{write:!0}})],R.prototype,"quantizationParameters",void 0),t([s({type:[Object],json:{write:!0}})],R.prototype,"rangeValues",void 0),t([s({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:"relation"===this.spatialRelationship}}}}})],R.prototype,"relationParameter",void 0),t([s({type:String,json:{write:!0}})],R.prototype,"resultType",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnCentroid",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnDistinctValues",void 0),t([s({type:Boolean,json:{default:!0,write:!0}})],R.prototype,"returnExceededLimitFeatures",void 0),t([s({type:Boolean,json:{write:!0}})],R.prototype,"returnGeometry",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnQueryGeometry",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnM",void 0),t([s({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],R.prototype,"returnZ",void 0),t([s({type:Boolean,json:{write:!0}})],R.prototype,"returnTrueCurves",void 0),t([s({type:v,json:{write:!0}})],R.prototype,"sourceSpatialReference",void 0),t([a(h,{ignoreUnknown:!1,name:"spatialRel"})],R.prototype,"spatialRelationship",void 0),t([s({type:Number,json:{read:{source:"resultOffset"}}})],R.prototype,"start",void 0),t([p("start"),p("num")],R.prototype,"writeStart",null),t([s({type:String,json:{write:!0}})],R.prototype,"sqlFormat",void 0),t([s({type:String,json:{write:!0}})],R.prototype,"text",void 0),t([s({type:j,json:{write:!0}})],R.prototype,"timeExtent",void 0),t([s({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"timeReferenceUnknownClient",void 0),t([a(g,{ignoreUnknown:!1}),s({json:{write:{overridePolicy(t){return{enabled:!!t&&null!=this.distance}}}}})],R.prototype,"units",void 0),t([s({type:String,json:{write:{overridePolicy(t){return{enabled:null!=t||null!=this.start&&this.start>0}}}}})],R.prototype,"where",void 0),t([p("where")],R.prototype,"writeWhere",null),R=S=t([l("esri.rest.support.Query")],R);const b=R;export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{geometryTypes as t}from"../../geometry.js";import{JSONMap as r}from"../../core/jsonMap.js";import i from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{ensureType as n}from"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";import{fromJSON as a}from"../../geometry/support/jsonUtils.js";import u from"./TopFilter.js";import c from"../../time/TimeExtent.js";import d from"../../geometry/SpatialReference.js";var m;const y=new r({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),h=new r({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let j=m=class extends i{constructor(e){super(e),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new m(o({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};e([s({type:Boolean,json:{write:!0}})],j.prototype,"cacheHint",void 0),e([s({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],j.prototype,"distance",void 0),e([s({types:t,json:{read:a,write:!0}})],j.prototype,"geometry",void 0),e([s({type:Number,json:{write:!0}})],j.prototype,"geometryPrecision",void 0),e([s({type:Number,json:{write:!0}})],j.prototype,"maxAllowableOffset",void 0),e([s({type:Number,json:{read:{source:"resultRecordCount"}}})],j.prototype,"num",void 0),e([s({json:{write:!0}})],j.prototype,"objectIds",void 0),e([s({type:[String],json:{write:!0}})],j.prototype,"orderByFields",void 0),e([s({type:[String],json:{write:!0}})],j.prototype,"outFields",void 0),e([s({type:d,json:{read:{source:"outSR"},write:{target:"outSR"}}})],j.prototype,"outSpatialReference",void 0),e([s({type:String,json:{write:!0}})],j.prototype,"resultType",void 0),e([s({json:{write:!0}})],j.prototype,"returnGeometry",void 0),e([s({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],j.prototype,"returnM",void 0),e([s({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],j.prototype,"returnZ",void 0),e([s({type:Number,json:{read:{source:"resultOffset"}}})],j.prototype,"start",void 0),e([l("start"),l("num")],j.prototype,"writeStart",null),e([s({type:String,json:{read:{source:"spatialRel",reader:y.read},write:{target:"spatialRel",writer:y.write}}})],j.prototype,"spatialRelationship",void 0),e([s({type:c,json:{write:!0}})],j.prototype,"timeExtent",void 0),e([s({type:u,json:{write:!0}})],j.prototype,"topFilter",void 0),e([s({type:String,json:{read:h.read,write:{writer:h.write,overridePolicy(e){return{enabled:null!=e&&null!=this.distance&&this.distance>0}}}}})],j.prototype,"units",void 0),e([s({type:String,json:{write:!0}})],j.prototype,"where",void 0),j=m=e([p("esri.rest.support.TopFeaturesQuery")],j),j.from=n(j);const S=j;export{S as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{geometryTypes as t}from"../../geometry.js";import{JSONMap as r}from"../../core/jsonMap.js";import i from"../../core/JSONSupport.js";import{clone as o}from"../../core/lang.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{ensureType as n}from"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";import{fromJSON as a}from"../../geometry/support/jsonUtils.js";import u from"./TopFilter.js";import c from"../../time/TimeExtent.js";import d from"../../geometry/SpatialReference.js";var m;const y=new r({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),h=new r({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let j=m=class extends i{constructor(e){super(e),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new m(o({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};e([s({type:Boolean,json:{write:!0}})],j.prototype,"cacheHint",void 0),e([s({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],j.prototype,"distance",void 0),e([s({types:t,json:{read:a,write:!0}})],j.prototype,"geometry",void 0),e([s({type:Number,json:{write:!0}})],j.prototype,"geometryPrecision",void 0),e([s({type:Number,json:{write:!0}})],j.prototype,"maxAllowableOffset",void 0),e([s({type:Number,json:{read:{source:"resultRecordCount"}}})],j.prototype,"num",void 0),e([s({json:{write:!0}})],j.prototype,"objectIds",void 0),e([s({type:[String],json:{write:!0}})],j.prototype,"orderByFields",void 0),e([s({type:[String],json:{write:!0}})],j.prototype,"outFields",void 0),e([s({type:d,json:{read:{source:"outSR"},write:{target:"outSR"}}})],j.prototype,"outSpatialReference",void 0),e([s({type:String,json:{write:!0}})],j.prototype,"resultType",void 0),e([s({json:{write:!0}})],j.prototype,"returnGeometry",void 0),e([s({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],j.prototype,"returnM",void 0),e([s({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],j.prototype,"returnZ",void 0),e([s({type:Number,json:{read:{source:"resultOffset"}}})],j.prototype,"start",void 0),e([l("start"),l("num")],j.prototype,"writeStart",null),e([s({type:String,json:{read:{source:"spatialRel",reader:y.read},write:{target:"spatialRel",writer:y.write}}})],j.prototype,"spatialRelationship",void 0),e([s({type:c,json:{write:!0}})],j.prototype,"timeExtent",void 0),e([s({type:u,json:{write:!0}})],j.prototype,"topFilter",void 0),e([s({type:String,json:{read:h.read,write:{writer:h.write,overridePolicy(e){return{enabled:null!=e&&null!=this.distance}}}}})],j.prototype,"units",void 0),e([s({type:String,json:{write:!0}})],j.prototype,"where",void 0),j=m=e([p("esri.rest.support.TopFeaturesQuery")],j),j.from=n(j);const S=j;export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import e from"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import"../../core/Logger.js";import{createUniqueColors as r}from"../../core/colorUtils.js";import t from"../../core/Error.js";import{getResolutionForScale as i}from"../../geometry/support/scaleUtils.js";import a from"../../renderers/support/AuthoringInfo.js";import n from"../heuristics/outline.js";import{roundValue as s}from"./support/dotDensityUtils.js";import{spliceVisualVariables as l,findOutlineVVIndex as o,processRegenerateParams as u,getRendererToUpdate as d,getStyleType as m,hasOutlineVV as p}from"./support/regenerateUtils.js";import{errorCallback as c,getSymbolOutlineFromScheme as f,verifyBasicFieldValidity as y,getBasemapInfo as b}from"./support/utils.js";import g from"../statistics/spatialStatistics.js";import w from"../statistics/summaryStatisticsForAttributes.js";import v from"../statistics/support/attributeDensity.js";import{verifyBinningParams as h}from"../support/binningUtils.js";import{getFieldsList as S}from"../support/utils.js";import{LayerType as V,binningCapableLayerTypes as j,createLayerAdapter as E,getLayerTypeLabels as x}from"../support/adapters/support/layerUtils.js";import{cloneScheme as T,getSchemes as D}from"../symbology/dotDensity.js";const I=500;async function z(e){const r=e.view;if(!(e?.layer&&r&&e.attributes?.length))throw new t("dot-density-renderer:missing-parameters","'layer', 'view' and 'attributes' parameters are required");if(e.attributes.length>8)throw new t("dot-density-renderer:invalid-parameters","Dot density renderer does not support more than 8 attributes");e.forBinning&&h(e,"dot-density-renderer");const i={...e,view:r,layer:e.layer,attributes:e.attributes},a=[V.FeatureLayer,V.OGCFeatureLayer,V.GeoJSONLayer,V.WFSLayer],n=e.forBinning?j:a,s=E(i.layer,n,e.forBinning);if(!s)throw new t("dot-density-renderer:invalid-parameters","'layer' must be one of these types: "+x(n).join(", "));i.dotBlendingEnabled??=!0,i.dotValueOptimizationEnabled??=!0;const l=null!=i.signal?{signal:i.signal}:null;await Promise.all([r.when(),s.load(l)]);if("polygon"!==s.geometryType)throw new t("dot-density-renderer:not-supported","Dot density renderer is supported for polygon layers only");const o=[],u=i.attributes;for(const t of u){const e=await S({field:t.field,valueExpression:t.valueExpression});o.push(...e)}const d=y(s,o.filter(Boolean),"dot-density-renderer:invalid-parameters");if(d)throw d;return{...i,layer:s}}async function O(e){const r="regenerate-dot-density-renderer";await u(e,r);const i=await d(e);if("dot-density"!==m(i))throw new t(`${r}:invalid-parameters`,"Renderer is invalid");const{layer:a,forBinning:n,filter:s,view:l,signal:o}=e,c=p(i),f=i.attributes.map((e=>({field:e.field,valueExpression:e.valueExpression,label:e.label,valueExpressionTitle:e.valueExpressionTitle}))),y=await z({layer:a,attributes:f,dotValueOptimizationEnabled:null!=i.referenceScale,outlineOptimizationEnabled:c,forBinning:n,filter:s,view:l,signal:o});return{...e,creatorParameters:y,renderer:i}}async function R(e){let r=e.dotDensityScheme,t=null,i=null;const a=await b(e.basemap,e.view);if(t=null!=a.basemapId?a.basemapId:null,i=null!=a.basemapTheme?a.basemapTheme:null,r)return{scheme:T(r),basemapId:t,basemapTheme:i};const n=D({numColors:e.attributes.length,basemapTheme:i});return n&&(r=n.primaryScheme,t=n.basemapId,i=n.basemapTheme),{scheme:r,basemapId:t,basemapTheme:i}}function B(e){return{dotValue:1,referenceScale:e.scale,minSliderValue:1,maxSliderValue:100}}async function U(e){const{view:r,layer:t,attributes:a,signal:n,filter:l}=e,o=await t.getSampleFeatures({view:r,sampleSize:I,returnGeometry:!0,filter:l,signal:n},"json"),[u,d]=await Promise.all([g({features:o,geometryType:t.geometryType}),w({layer:t,attributes:a,filter:l,includeZeros:!1,includeNegatives:!1,view:r,signal:n})]),m=null!=u&&"avgSize"in u&&u.avgSize,p=d.avg;if(!m||!p)return B(r);const c=i(r.scale,r.spatialReference);return{dotValue:s(p/(m*m/(c*c)*.1))||1,referenceScale:r.scale,minSliderValue:1,maxSliderValue:s(p)}}async function F(e){const{view:r,layer:t,attributes:a,signal:n,filter:l}=e,o=[];for(const i of a){const e=await S({field:i.field,valueExpression:i.valueExpression});o.push(...e)}const u=await t.getSampleFeatures({view:r,sampleSize:I,requiredFields:o,filter:l,returnGeometry:!0,signal:n},"json"),{minDensity:d,maxDensity:m,avgDensity:p}=await v({features:u,attributes:a,includeZeros:!1,includeNegatives:!1,view:r});if(!p||!d||!m)return B(r);const c=i(r.scale,r.spatialReference),f=c*c,y=s(d*f),b=s(m*f);let g=s(p*f*10)||1;return g>b&&(g=b),{dotValue:g,referenceScale:r.scale,minSliderValue:y,maxSliderValue:b}}async function P(i){const s=await z(i),l=s.layer,o=l.geometryType,u=await R(s),d=u?.scheme;if(!d)throw new t("dot-density-renderer:insufficient-info","Unable to find dot-density scheme");const m=s.view,p=s.filter,y={layer:l,view:m,filter:p,attributes:s.attributes,signal:s.signal},b={layer:s.layer,view:m,filter:p,signal:s.signal},[g,w]=await Promise.all([s.trueDensity?F(y):U(y),s.outlineOptimizationEnabled?n(b).catch(c):null]),{dotValue:v,referenceScale:h,minSliderValue:S,maxSliderValue:V}=g,j=r(d.colors,s.attributes.length),E=s.attributes.map(((e,r)=>({field:e.field,valueExpression:e.valueExpression,label:e.label,valueExpressionTitle:e.valueExpressionTitle,color:j[r]}))),x=new e({attributes:E,dotBlendingEnabled:s.dotBlendingEnabled,outline:w?f(d,o,w.opacity):null,dotValue:v,referenceScale:s.dotValueOptimizationEnabled?h:null,legendOptions:s.legendOptions});return w?.visualVariables.length&&(x.visualVariables=w.visualVariables.map((e=>e.clone()))),x.authoringInfo=new a({type:"dot-density",minSliderValue:S,maxSliderValue:V}),{renderer:x,dotDensityScheme:d,basemapId:u.basemapId,basemapTheme:u.basemapTheme}}async function L(e){const{creatorParameters:r,renderer:t}=await O(e),{layer:i,attributes:a,outlineOptimizationEnabled:s,view:u,signal:d,filter:m}=r,p={layer:i,view:u,filter:m,attributes:a,signal:d},[f,y]=await Promise.all([r.trueDensity?F(p):U(p),s?n({layer:i,view:u,signal:d,filter:m}).catch(c):null]),{dotValue:b,referenceScale:g,minSliderValue:w,maxSliderValue:v}=f;return t.dotValue=b,t.referenceScale=r.dotValueOptimizationEnabled?g:null,t.authoringInfo&&(t.authoringInfo.minSliderValue=w,t.authoringInfo.maxSliderValue=v),l(t,y?.visualVariables,o),{renderer:t}}export{P as createRenderer,L as regenerateRenderer};
5
+ import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import e from"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import"../../core/Logger.js";import{createUniqueColors as r}from"../../core/colorUtils.js";import t from"../../core/Error.js";import{getResolutionForScale as i}from"../../geometry/support/scaleUtils.js";import a from"../../renderers/support/AuthoringInfo.js";import n from"../heuristics/outline.js";import{roundValue as s}from"./support/dotDensityUtils.js";import{spliceVisualVariables as l,findOutlineVVIndex as o,processRegenerateParams as u,getRendererToUpdate as d,getStyleType as m,hasOutlineVV as p}from"./support/regenerateUtils.js";import{errorCallback as c,getSymbolOutlineFromScheme as f,verifyBasicFieldValidity as y,getBasemapInfo as b}from"./support/utils.js";import g from"../statistics/spatialStatistics.js";import w from"../statistics/summaryStatisticsForAttributes.js";import v from"../statistics/support/attributeDensity.js";import{verifyBinningParams as h}from"../support/binningUtils.js";import{getFieldsList as S}from"../support/utils.js";import{LayerType as V,binningCapableLayerTypes as j,createLayerAdapter as E,getLayerTypeLabels as x}from"../support/adapters/support/layerUtils.js";import{cloneScheme as T,getSchemes as D}from"../symbology/dotDensity.js";const I=500;async function z(e){const r=e.view;if(!(e?.layer&&r&&e.attributes?.length))throw new t("dot-density-renderer:missing-parameters","'layer', 'view' and 'attributes' parameters are required");if(e.attributes.length>8)throw new t("dot-density-renderer:invalid-parameters","Dot density renderer does not support more than 8 attributes");e.forBinning&&h(e,"dot-density-renderer");const i={...e,view:r,layer:e.layer,attributes:e.attributes},a=[V.FeatureLayer,V.ParquetLayer,V.OGCFeatureLayer,V.GeoJSONLayer,V.WFSLayer],n=e.forBinning?j:a,s=E(i.layer,n,e.forBinning);if(!s)throw new t("dot-density-renderer:invalid-parameters","'layer' must be one of these types: "+x(n).join(", "));i.dotBlendingEnabled??=!0,i.dotValueOptimizationEnabled??=!0;const l=null!=i.signal?{signal:i.signal}:null;await Promise.all([r.when(),s.load(l)]);if("polygon"!==s.geometryType)throw new t("dot-density-renderer:not-supported","Dot density renderer is supported for polygon layers only");const o=[],u=i.attributes;for(const t of u){const e=await S({field:t.field,valueExpression:t.valueExpression});o.push(...e)}const d=y(s,o.filter(Boolean),"dot-density-renderer:invalid-parameters");if(d)throw d;return{...i,layer:s}}async function O(e){const r="regenerate-dot-density-renderer";await u(e,r);const i=await d(e);if("dot-density"!==m(i))throw new t(`${r}:invalid-parameters`,"Renderer is invalid");const{layer:a,forBinning:n,filter:s,view:l,signal:o}=e,c=p(i),f=i.attributes.map((e=>({field:e.field,valueExpression:e.valueExpression,label:e.label,valueExpressionTitle:e.valueExpressionTitle}))),y=await z({layer:a,attributes:f,dotValueOptimizationEnabled:null!=i.referenceScale,outlineOptimizationEnabled:c,forBinning:n,filter:s,view:l,signal:o});return{...e,creatorParameters:y,renderer:i}}async function R(e){let r=e.dotDensityScheme,t=null,i=null;const a=await b(e.basemap,e.view);if(t=null!=a.basemapId?a.basemapId:null,i=null!=a.basemapTheme?a.basemapTheme:null,r)return{scheme:T(r),basemapId:t,basemapTheme:i};const n=D({numColors:e.attributes.length,basemapTheme:i});return n&&(r=n.primaryScheme,t=n.basemapId,i=n.basemapTheme),{scheme:r,basemapId:t,basemapTheme:i}}function B(e){return{dotValue:1,referenceScale:e.scale,minSliderValue:1,maxSliderValue:100}}async function U(e){const{view:r,layer:t,attributes:a,signal:n,filter:l}=e,o=await t.getSampleFeatures({view:r,sampleSize:I,returnGeometry:!0,filter:l,signal:n},"json"),[u,d]=await Promise.all([g({features:o,geometryType:t.geometryType}),w({layer:t,attributes:a,filter:l,includeZeros:!1,includeNegatives:!1,view:r,signal:n})]),m=null!=u&&"avgSize"in u&&u.avgSize,p=d.avg;if(!m||!p)return B(r);const c=i(r.scale,r.spatialReference);return{dotValue:s(p/(m*m/(c*c)*.1))||1,referenceScale:r.scale,minSliderValue:1,maxSliderValue:s(p)}}async function P(e){const{view:r,layer:t,attributes:a,signal:n,filter:l}=e,o=[];for(const i of a){const e=await S({field:i.field,valueExpression:i.valueExpression});o.push(...e)}const u=await t.getSampleFeatures({view:r,sampleSize:I,requiredFields:o,filter:l,returnGeometry:!0,signal:n},"json"),{minDensity:d,maxDensity:m,avgDensity:p}=await v({features:u,attributes:a,includeZeros:!1,includeNegatives:!1,view:r});if(!p||!d||!m)return B(r);const c=i(r.scale,r.spatialReference),f=c*c,y=s(d*f),b=s(m*f);let g=s(p*f*10)||1;return g>b&&(g=b),{dotValue:g,referenceScale:r.scale,minSliderValue:y,maxSliderValue:b}}async function F(i){const s=await z(i),l=s.layer,o=l.geometryType,u=await R(s),d=u?.scheme;if(!d)throw new t("dot-density-renderer:insufficient-info","Unable to find dot-density scheme");const m=s.view,p=s.filter,y={layer:l,view:m,filter:p,attributes:s.attributes,signal:s.signal},b={layer:s.layer,view:m,filter:p,signal:s.signal},[g,w]=await Promise.all([s.trueDensity?P(y):U(y),s.outlineOptimizationEnabled?n(b).catch(c):null]),{dotValue:v,referenceScale:h,minSliderValue:S,maxSliderValue:V}=g,j=r(d.colors,s.attributes.length),E=s.attributes.map(((e,r)=>({field:e.field,valueExpression:e.valueExpression,label:e.label,valueExpressionTitle:e.valueExpressionTitle,color:j[r]}))),x=new e({attributes:E,dotBlendingEnabled:s.dotBlendingEnabled,outline:w?f(d,o,w.opacity):null,dotValue:v,referenceScale:s.dotValueOptimizationEnabled?h:null,legendOptions:s.legendOptions});return w?.visualVariables.length&&(x.visualVariables=w.visualVariables.map((e=>e.clone()))),x.authoringInfo=new a({type:"dot-density",minSliderValue:S,maxSliderValue:V}),{renderer:x,dotDensityScheme:d,basemapId:u.basemapId,basemapTheme:u.basemapTheme}}async function L(e){const{creatorParameters:r,renderer:t}=await O(e),{layer:i,attributes:a,outlineOptimizationEnabled:s,view:u,signal:d,filter:m}=r,p={layer:i,view:u,filter:m,attributes:a,signal:d},[f,y]=await Promise.all([r.trueDensity?P(p):U(p),s?n({layer:i,view:u,signal:d,filter:m}).catch(c):null]),{dotValue:b,referenceScale:g,minSliderValue:w,maxSliderValue:v}=f;return t.dotValue=b,t.referenceScale=r.dotValueOptimizationEnabled?g:null,t.authoringInfo&&(t.authoringInfo.minSliderValue=w,t.authoringInfo.maxSliderValue=v),l(t,y?.visualVariables,o),{renderer:t}}export{F as createRenderer,L as regenerateRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import r from"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import"../../core/Logger.js";import"../../symbols.js";import{isSome as a}from"../../core/arrayUtils.js";import{createUniqueColors as i}from"../../core/colorUtils.js";import t from"../../core/Error.js";import{toPt as n}from"../../core/screenUtils.js";import{fetchMessageBundle as s}from"../../intl/messages.js";import o from"../../layers/support/AggregateField.js";import l from"../../layers/support/ExpressionInfo.js";import u from"../../renderers/support/AttributeColorInfo.js";import{OthersCategory as p}from"../../renderers/support/OthersCategory.js";import m from"../../renderers/support/RendererLegendOptions.js";import c from"../heuristics/outline.js";import d from"../heuristics/sizeRange.js";import{createVisualVariables as f}from"./size.js";import{spliceVisualVariables as b,findSizeVVIndex as h,updateAuthoringInfoVisualVariable as y,findOutlineVVIndex as w,findScaleDependentSizeVVIndex as g,processRegenerateParams as v,getRendererToUpdate as z,getStyleType as S,hasOutlineVV as E,hasScaleDependentSizeVV as j,isSizeVV as V}from"./support/regenerateUtils.js";import{errorCallback as x,createSymbol as C,getSymbolOutlineFromScheme as T,verifyBasicFieldValidity as $,getBasemapInfo as I}from"./support/utils.js";import O from"../statistics/predominantCategories.js";import{getSumOfAttributesExpr as k}from"../statistics/support/utils.js";import{verifyBinningParams as q}from"../support/binningUtils.js";import{getFieldsList as B}from"../support/utils.js";import{LayerType as L,binningCapableLayerTypes as R,createLayerAdapter as P,getLayerTypeLabels as U,getLayerTypes as F}from"../support/adapters/support/layerUtils.js";import{cloneScheme as M,getSchemes as N}from"../symbology/pieChart.js";import{getCIMSymbolColor as _}from"../../symbols/support/cimSymbolUtils.js";import A from"../../symbols/SimpleLineSymbol.js";const D=[L.CSVLayer,L.FeatureLayer,L.GeoJSONLayer,L.KnowledgeGraphSublayer,L.OGCFeatureLayer,L.OrientedImageryLayer,L.StreamLayer,L.WFSLayer];async function G(e){if(!(e?.layer&&e.view&&e.attributes?.length))throw new t("pie-chart-renderer:missing-parameters","'layer', 'view' and 'attributes' parameters are required");if(e.attributes.length>10)throw new t("pie-chart-renderer:invalid-parameters","PieChart renderer does not support more than 10 attributes");e.forBinning&&q(e,"pie-chart-renderer");const r={...e,layer:e.layer,view:e.view,attributes:e.attributes};r.shape=r.shape||"pie",r.othersCategoryEnabled??=!0,r.includeSizeVariable=e.includeSizeVariable||!1;const a=e.forBinning?R:D,i=P(r.layer,a,e.forBinning);if(!i)throw new t("pie-chart-renderer:invalid-parameters","'layer' must be one of these types: "+U(a).join(", "));const n=null!=r.signal?{signal:r.signal}:null;await Promise.all([e.view.when(),i.load(n)]);const s=i.geometryType,o="polygon"===s,l="point"===s||"multipoint"===s||o;if(r.outlineOptimizationEnabled=!!o&&r.outlineOptimizationEnabled,r.sizeOptimizationEnabled=!!l&&r.sizeOptimizationEnabled,!l)throw new t("pie-chart-renderer:not-supported","PieChart renderer is only supported for point and polygon layers");const u=[],p=r.attributes;for(const t of p){const e=await B({field:t.field,valueExpression:t.valueExpression});u.push(...e)}const m=$(i,u.filter(Boolean),"pie-chart-renderer:invalid-parameters");if(m)throw m;return{...r,layer:i}}async function W(e){const r="regenerate-pie-chart-renderer";await v(e,r);const a=await z(e);if("pie-chart"!==S(a))throw new t(`${r}:invalid-parameters`,"Renderer is invalid");const{visualVariables:i}=a,{layer:n,forBinning:s,filter:o,view:l,signal:u}=e,p=E(a),m=j(a),c=i?.some(V),d=a.attributes.map((e=>({field:e.field,label:e.label,valueExpression:e.valueExpression,valueExpressionTitle:e.valueExpressionTitle}))),f=await G({layer:n,attributes:d,outlineOptimizationEnabled:p,sizeOptimizationEnabled:m,includeSizeVariable:c,forBinning:s,filter:o,view:l,signal:u});return{...e,creatorParameters:f,renderer:a}}async function H(e){let r=e.pieChartScheme,a=null,i=null;const t=await I(e.basemap,e.view);if(a=null!=t.basemapId?t.basemapId:null,i=null!=t.basemapTheme?t.basemapTheme:null,r)return{scheme:M(r),basemapId:a,basemapTheme:i};const n=N({numColors:e.attributes.length,geometryType:e.layer.geometryType,basemapTheme:i});return n&&(r=n.primaryScheme,a=n.basemapId,i=n.basemapTheme),{scheme:r,basemapId:a,basemapTheme:i}}async function J(e,r){const{valueExpression:a,sqlExpression:i,sqlWhere:t}=k(e.attributes),n=await s("esri/smartMapping/t9n/smartMapping");return f({layer:e.layer,basemap:e.basemap,valueExpression:a,sqlExpression:i,sqlWhere:t,sizeScheme:r,sizeOptimizationEnabled:e.sizeOptimizationEnabled,legendOptions:{title:n.sumOfCategories},view:e.view,signal:e.signal})}async function K(e){const[o,l]=await Promise.all([G(e),s("esri/smartMapping/t9n/smartMapping")]),f=await H(o),b=f?.scheme;if(!b)throw new t("pie-chart-renderer:insufficient-info","Unable to find pie-chart scheme");const{layer:h,includeSizeVariable:y,sizeOptimizationEnabled:w,outlineOptimizationEnabled:g,view:v,signal:z,filter:S}=o,E=b.sizeScheme,j=o.attributes,V=j.map((e=>e.field)).filter(a),[$,I,k,q]=await Promise.all([V.length>1?O({layer:h,fields:V,view:v,signal:z,filter:S}):null,y?J(o,E):null,!y&&w?d({layer:h,view:v,signal:z,filter:S}).catch(x):null,g?c({layer:h,view:v,signal:z,filter:S}).catch(x):null]),B=$?.predominantCategoryInfos?{uniqueValueInfos:$.predominantCategoryInfos}:{uniqueValueInfos:V.map((e=>({value:e,count:0})))},L=i(b.colors,j.length),R=j.map(((e,r)=>new u({field:e.field,valueExpression:e.valueExpression,label:e.label,valueExpressionTitle:e.valueExpressionTitle,color:L[r]}))),P=h.geometryType,U=null!=E&&"background"in E&&E.background,F=new r({attributes:R,othersCategory:new p({label:l.other,color:o.othersCategoryEnabled?b.colorForOthersCategory:null,threshold:.04}),holePercentage:"donut"===o.shape?.45:0,backgroundFillSymbol:U?C(P,{type:"2d",color:U.color,outline:T(U,P,q?.opacity)}):null,size:n(b.size),outline:new A(T(b,"point",q?.opacity)),legendOptions:m.from(o.legendOptions)});if(I&&(Q(I,w,P),F.authoringInfo=I.authoringInfo.clone(),F.visualVariables=I.visualVariables?.map((e=>e.clone()))),q?.visualVariables?.length){const e=q.visualVariables.map((e=>e.clone())).filter((e=>"color"!==e.type&&"rotation"!==e.type));F.visualVariables?F.visualVariables.push(...e):F.visualVariables=e}return k?.minSize&&(X(k,P),F.visualVariables?F.visualVariables.push(k.minSize):F.visualVariables=[k.minSize]),{renderer:F,pieChartScheme:M(b),size:I,basemapId:f.basemapId,basemapTheme:f.basemapTheme,statistics:B}}async function Z(e){const{creatorParameters:r,view:a,signal:i,filter:t,renderer:n}=await W(e),{layer:s,outlineOptimizationEnabled:o,includeSizeVariable:l,sizeOptimizationEnabled:u}=r,p=await H(r),m=p?.scheme?.sizeScheme,[f,v,z]=await Promise.all([o?c({layer:s,view:a,signal:i,filter:t}).catch(x):null,l?J(r,m):null,!l&&u?d({layer:s,view:a,signal:i,filter:t}).catch(x):null]),S=s.geometryType;if(v&&(Q(v,u,S),b(n,v?.visualVariables,h),y(n,v?.authoringInfo,"size")),f?.visualVariables?.length){const e=f.visualVariables.map((e=>e.clone())).filter((e=>"color"!==e.type&&"rotation"!==e.type));b(n,e,w)}return z?.minSize&&(X(z,S),b(n,z?.minSize,g)),{renderer:n}}function Q(e,r,a){r||e.visualVariables.forEach((e=>{"number"==typeof e.minSize&&"number"==typeof e.maxSize&&(e.minSize*=2.5,e.maxSize*=1.8)})),r&&"point"===a&&e.visualVariables.forEach((e=>{e?.minSize&&"object"==typeof e.minSize&&e.minSize?.stops?.forEach((e=>{e.size*=1.8}))}))}function X(e,r){"point"===r&&e.minSize.stops?.forEach((e=>{e.size*=2.5})),"polygon"===r&&e.minSize.stops?.forEach((e=>{e.size*=1.8}))}const Y=new Set(["unique-value","class-breaks"]),ee=new e("#aaaaaa"),re=new e("#5c5c5c"),ae=[new e("#e60049"),new e("#0bb4ff"),new e("#50e991"),new e("#e6d800"),new e("#9b19f5"),new e("#ffa300"),new e("#dc0ab4"),new e("#b3d4ff"),new e("#00bfa0"),new e("#f0cccc")];async function ie(e){if(!e||!e.layer)throw new t("pie-chart-cluster-renderer:missing-parameters","'layer' parameter is required");const r={...e};r.shape=r.shape||"pie",r.defaultSymbolEnabled??=!0;const a=e.layer;if(!F(D).includes(a.type))throw new t("pie-chart-cluster-renderer:invalid-parameters","'layer' must be one of these types: "+U(D).join(", "));const i=null!=r.signal?{signal:r.signal}:null;await a.load(i);if(!("point"===a.geometryType))throw new t("pie-chart-cluster-renderer:invalid-parameters","Cluster renderers are only supported for point layers");const n="renderer"in a?a.renderer:void 0;if(!n)throw new t("pie-chart-cluster-renderer:invalid-parameters","input layer does not have a renderer.");if(!Y.has(n.type))throw new t("pie-chart-cluster-renderer:invalid-parameters",`Cannot create a pie chart renderer for clusters based on a ${n.type} renderer.`);if("valueExpression"in n&&n.valueExpression)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer whose renderer contains a valueExpression.");if("unique-value"===n.type){if(n.field2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a UniqueValueRenderer using more than one field.");if(null!=n.uniqueValueInfos&&n.uniqueValueInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer cannot be created from a UniqueValueRenderer with more than 10 unique value infos.")}if("class-breaks"===n.type){if(n.classBreakInfos.length<2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer renderer with a continuous color or size gradient.");if(n.classBreakInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with more than 10 class break infos.");if("class-breaks-size"===n?.authoringInfo?.type)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with breaks varied by size instead of color.")}return r}async function te(e){const a=await ie(e),{layer:i,shape:t,defaultSymbolEnabled:n,legendOptions:o}=a,l="renderer"in i?i.renderer:void 0,p=(await s("esri/smartMapping/t9n/smartMapping")).other;let c=[];"unique-value"===l?.type&&(c=ne({renderer:l,defaultSymbolEnabled:n,defaultLabelBackup:p})),"class-breaks"===l?.type&&(c=se({renderer:l,defaultSymbolEnabled:n,defaultLabelBackup:p}));const d=[],f=[];for(const r of c){const{field:e,color:a}=r;d.push(e),f.push(new u({color:a,field:e.name,label:e.alias}))}return{fields:d,renderer:new r({attributes:f,legendOptions:m.from(o),holePercentage:"donut"===t?.45:0,outline:null,size:9,othersCategory:null})}}function ne(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,defaultSymbol:s,defaultLabel:u}=r,p=r.uniqueValueInfos??[],m=s&&a,c=m?9:10,d=i(ae,c),f=(n?p.slice(0,c).map(((e,r)=>{const a=e.label,i=d[r];return{field:new o({name:oe(e.value?.toString()),alias:a,onStatisticExpression:new l({title:`Field definition - ${a}`,expression:ue(n,e),returnType:"number"}),statisticType:"sum"}),color:le(e.symbol,i)}})):null)??[];if(m){const e="cluster_default",r=u||t;f.push({field:new o({name:oe(e),alias:r,onStatisticExpression:new l({title:`Field definition - ${r}`,expression:pe(n,p),returnType:"number"}),statisticType:"sum"}),color:le(s,re)})}return f}function se(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,classBreakInfos:s,defaultSymbol:u,defaultLabel:p}=r,m=u&&a,c=m?9:10,d=i(ae,c),f=s.slice(0,c).map(((e,r)=>{const a=e.label||`${e.minValue} - ${e.maxValue}`,i=d[r];return{field:new o({name:oe(a),alias:a,onStatisticExpression:new l({title:`Field definition - ${a}`,expression:me(n,e),returnType:"number"}),statisticType:"sum"}),color:le(e.symbol,i)}}));if(m){const e="cluster_default",r=p||t;f.push({field:new o({name:oe(e),alias:r,onStatisticExpression:new l({title:`Field definition - ${r}`,expression:ce(n,s),returnType:"number"}),statisticType:"sum"}),color:le(u,re)})}return f}function oe(e){return"SUM_"+(e+"").replaceAll(/[^a-zA-Z0-9_]/g,"_")}function le(e,r){if("simple-marker"===e?.type&&e.color)return e.color.clone();if("cim"===e?.type){const r=_(e);if(r)return r.clone()}return r?r.clone():ee.clone()}function ue(e,r){return`Number(Text($feature["${e}"]) == "${r.value+""}")`}function pe(e,r){return`Number(!(${r.map((r=>`(Text($feature["${e}"]) == "${r.value+""}")`)).join(" || ")}))`}function me(e,r){return`Number($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`}function ce(e,r){return`Number(!(${r.map((r=>`($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`)).join(" || ")}))`}export{K as createRenderer,te as createRendererForClustering,Z as regenerateRenderer};
5
+ import e from"../../Color.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import r from"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import"../../renderers/SimpleRenderer.js";import"../../renderers/UniqueValueRenderer.js";import"../../renderers/support/jsonUtils.js";import"../../core/Logger.js";import"../../symbols.js";import{isSome as a}from"../../core/arrayUtils.js";import{createUniqueColors as i}from"../../core/colorUtils.js";import t from"../../core/Error.js";import{toPt as n}from"../../core/screenUtils.js";import{fetchMessageBundle as s}from"../../intl/messages.js";import o from"../../layers/support/AggregateField.js";import l from"../../layers/support/ExpressionInfo.js";import u from"../../renderers/support/AttributeColorInfo.js";import{OthersCategory as p}from"../../renderers/support/OthersCategory.js";import m from"../../renderers/support/RendererLegendOptions.js";import c from"../heuristics/outline.js";import d from"../heuristics/sizeRange.js";import{createVisualVariables as f}from"./size.js";import{spliceVisualVariables as b,findSizeVVIndex as h,updateAuthoringInfoVisualVariable as y,findOutlineVVIndex as w,findScaleDependentSizeVVIndex as g,processRegenerateParams as v,getRendererToUpdate as z,getStyleType as S,hasOutlineVV as E,hasScaleDependentSizeVV as j,isSizeVV as V}from"./support/regenerateUtils.js";import{errorCallback as x,createSymbol as C,getSymbolOutlineFromScheme as T,verifyBasicFieldValidity as $,getBasemapInfo as I}from"./support/utils.js";import O from"../statistics/predominantCategories.js";import{getSumOfAttributesExpr as k}from"../statistics/support/utils.js";import{verifyBinningParams as q}from"../support/binningUtils.js";import{getFieldsList as L}from"../support/utils.js";import{LayerType as B,binningCapableLayerTypes as P,createLayerAdapter as R,getLayerTypeLabels as U,getLayerTypes as F}from"../support/adapters/support/layerUtils.js";import{cloneScheme as M,getSchemes as N}from"../symbology/pieChart.js";import{getCIMSymbolColor as _}from"../../symbols/support/cimSymbolUtils.js";import A from"../../symbols/SimpleLineSymbol.js";const D=[B.CSVLayer,B.FeatureLayer,B.GeoJSONLayer,B.KnowledgeGraphSublayer,B.OGCFeatureLayer,B.OrientedImageryLayer,B.ParquetLayer,B.StreamLayer,B.WFSLayer];async function G(e){if(!(e?.layer&&e.view&&e.attributes?.length))throw new t("pie-chart-renderer:missing-parameters","'layer', 'view' and 'attributes' parameters are required");if(e.attributes.length>10)throw new t("pie-chart-renderer:invalid-parameters","PieChart renderer does not support more than 10 attributes");e.forBinning&&q(e,"pie-chart-renderer");const r={...e,layer:e.layer,view:e.view,attributes:e.attributes};r.shape=r.shape||"pie",r.othersCategoryEnabled??=!0,r.includeSizeVariable=e.includeSizeVariable||!1;const a=e.forBinning?P:D,i=R(r.layer,a,e.forBinning);if(!i)throw new t("pie-chart-renderer:invalid-parameters","'layer' must be one of these types: "+U(a).join(", "));const n=null!=r.signal?{signal:r.signal}:null;await Promise.all([e.view.when(),i.load(n)]);const s=i.geometryType,o="polygon"===s,l="point"===s||"multipoint"===s||o;if(r.outlineOptimizationEnabled=!!o&&r.outlineOptimizationEnabled,r.sizeOptimizationEnabled=!!l&&r.sizeOptimizationEnabled,!l)throw new t("pie-chart-renderer:not-supported","PieChart renderer is only supported for point and polygon layers");const u=[],p=r.attributes;for(const t of p){const e=await L({field:t.field,valueExpression:t.valueExpression});u.push(...e)}const m=$(i,u.filter(Boolean),"pie-chart-renderer:invalid-parameters");if(m)throw m;return{...r,layer:i}}async function W(e){const r="regenerate-pie-chart-renderer";await v(e,r);const a=await z(e);if("pie-chart"!==S(a))throw new t(`${r}:invalid-parameters`,"Renderer is invalid");const{visualVariables:i}=a,{layer:n,forBinning:s,filter:o,view:l,signal:u}=e,p=E(a),m=j(a),c=i?.some(V),d=a.attributes.map((e=>({field:e.field,label:e.label,valueExpression:e.valueExpression,valueExpressionTitle:e.valueExpressionTitle}))),f=await G({layer:n,attributes:d,outlineOptimizationEnabled:p,sizeOptimizationEnabled:m,includeSizeVariable:c,forBinning:s,filter:o,view:l,signal:u});return{...e,creatorParameters:f,renderer:a}}async function H(e){let r=e.pieChartScheme,a=null,i=null;const t=await I(e.basemap,e.view);if(a=null!=t.basemapId?t.basemapId:null,i=null!=t.basemapTheme?t.basemapTheme:null,r)return{scheme:M(r),basemapId:a,basemapTheme:i};const n=N({numColors:e.attributes.length,geometryType:e.layer.geometryType,basemapTheme:i});return n&&(r=n.primaryScheme,a=n.basemapId,i=n.basemapTheme),{scheme:r,basemapId:a,basemapTheme:i}}async function J(e,r){const{valueExpression:a,sqlExpression:i,sqlWhere:t}=k(e.attributes),n=await s("esri/smartMapping/t9n/smartMapping");return f({layer:e.layer,basemap:e.basemap,valueExpression:a,sqlExpression:i,sqlWhere:t,sizeScheme:r,sizeOptimizationEnabled:e.sizeOptimizationEnabled,legendOptions:{title:n.sumOfCategories},view:e.view,signal:e.signal})}async function K(e){const[o,l]=await Promise.all([G(e),s("esri/smartMapping/t9n/smartMapping")]),f=await H(o),b=f?.scheme;if(!b)throw new t("pie-chart-renderer:insufficient-info","Unable to find pie-chart scheme");const{layer:h,includeSizeVariable:y,sizeOptimizationEnabled:w,outlineOptimizationEnabled:g,view:v,signal:z,filter:S}=o,E=b.sizeScheme,j=o.attributes,V=j.map((e=>e.field)).filter(a),[$,I,k,q]=await Promise.all([V.length>1?O({layer:h,fields:V,view:v,signal:z,filter:S}):null,y?J(o,E):null,!y&&w?d({layer:h,view:v,signal:z,filter:S}).catch(x):null,g?c({layer:h,view:v,signal:z,filter:S}).catch(x):null]),L=$?.predominantCategoryInfos?{uniqueValueInfos:$.predominantCategoryInfos}:{uniqueValueInfos:V.map((e=>({value:e,count:0})))},B=i(b.colors,j.length),P=j.map(((e,r)=>new u({field:e.field,valueExpression:e.valueExpression,label:e.label,valueExpressionTitle:e.valueExpressionTitle,color:B[r]}))),R=h.geometryType,U=null!=E&&"background"in E&&E.background,F=new r({attributes:P,othersCategory:new p({label:l.other,color:o.othersCategoryEnabled?b.colorForOthersCategory:null,threshold:.04}),holePercentage:"donut"===o.shape?.45:0,backgroundFillSymbol:U?C(R,{type:"2d",color:U.color,outline:T(U,R,q?.opacity)}):null,size:n(b.size),outline:new A(T(b,"point",q?.opacity)),legendOptions:m.from(o.legendOptions)});if(I&&(Q(I,w,R),F.authoringInfo=I.authoringInfo.clone(),F.visualVariables=I.visualVariables?.map((e=>e.clone()))),q?.visualVariables?.length){const e=q.visualVariables.map((e=>e.clone())).filter((e=>"color"!==e.type&&"rotation"!==e.type));F.visualVariables?F.visualVariables.push(...e):F.visualVariables=e}return k?.minSize&&(X(k,R),F.visualVariables?F.visualVariables.push(k.minSize):F.visualVariables=[k.minSize]),{renderer:F,pieChartScheme:M(b),size:I,basemapId:f.basemapId,basemapTheme:f.basemapTheme,statistics:L}}async function Z(e){const{creatorParameters:r,view:a,signal:i,filter:t,renderer:n}=await W(e),{layer:s,outlineOptimizationEnabled:o,includeSizeVariable:l,sizeOptimizationEnabled:u}=r,p=await H(r),m=p?.scheme?.sizeScheme,[f,v,z]=await Promise.all([o?c({layer:s,view:a,signal:i,filter:t}).catch(x):null,l?J(r,m):null,!l&&u?d({layer:s,view:a,signal:i,filter:t}).catch(x):null]),S=s.geometryType;if(v&&(Q(v,u,S),b(n,v?.visualVariables,h),y(n,v?.authoringInfo,"size")),f?.visualVariables?.length){const e=f.visualVariables.map((e=>e.clone())).filter((e=>"color"!==e.type&&"rotation"!==e.type));b(n,e,w)}return z?.minSize&&(X(z,S),b(n,z?.minSize,g)),{renderer:n}}function Q(e,r,a){r||e.visualVariables.forEach((e=>{"number"==typeof e.minSize&&"number"==typeof e.maxSize&&(e.minSize*=2.5,e.maxSize*=1.8)})),r&&"point"===a&&e.visualVariables.forEach((e=>{e?.minSize&&"object"==typeof e.minSize&&e.minSize?.stops?.forEach((e=>{e.size*=1.8}))}))}function X(e,r){"point"===r&&e.minSize.stops?.forEach((e=>{e.size*=2.5})),"polygon"===r&&e.minSize.stops?.forEach((e=>{e.size*=1.8}))}const Y=new Set(["unique-value","class-breaks"]),ee=new e("#aaaaaa"),re=new e("#5c5c5c"),ae=[new e("#e60049"),new e("#0bb4ff"),new e("#50e991"),new e("#e6d800"),new e("#9b19f5"),new e("#ffa300"),new e("#dc0ab4"),new e("#b3d4ff"),new e("#00bfa0"),new e("#f0cccc")];async function ie(e){if(!e||!e.layer)throw new t("pie-chart-cluster-renderer:missing-parameters","'layer' parameter is required");const r={...e};r.shape=r.shape||"pie",r.defaultSymbolEnabled??=!0;const a=e.layer;if(!F(D).includes(a.type))throw new t("pie-chart-cluster-renderer:invalid-parameters","'layer' must be one of these types: "+U(D).join(", "));const i=null!=r.signal?{signal:r.signal}:null;await a.load(i);if(!("point"===a.geometryType))throw new t("pie-chart-cluster-renderer:invalid-parameters","Cluster renderers are only supported for point layers");const n="renderer"in a?a.renderer:void 0;if(!n)throw new t("pie-chart-cluster-renderer:invalid-parameters","input layer does not have a renderer.");if(!Y.has(n.type))throw new t("pie-chart-cluster-renderer:invalid-parameters",`Cannot create a pie chart renderer for clusters based on a ${n.type} renderer.`);if("valueExpression"in n&&n.valueExpression)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer whose renderer contains a valueExpression.");if("unique-value"===n.type){if(n.field2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a UniqueValueRenderer using more than one field.");if(null!=n.uniqueValueInfos&&n.uniqueValueInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer cannot be created from a UniqueValueRenderer with more than 10 unique value infos.")}if("class-breaks"===n.type){if(n.classBreakInfos.length<2)throw new t("pie-chart-cluster-renderer:invalid-parameters","Cannot create a pie chart renderer for clusters from a layer renderer with a continuous color or size gradient.");if(n.classBreakInfos.length>10)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with more than 10 class break infos.");if("class-breaks-size"===n?.authoringInfo?.type)throw new t("pie-chart-cluster-renderer:invalid-parameters","PieChart cluster renderer can not be created from a ClassBreaksRenderer with breaks varied by size instead of color.")}return r}async function te(e){const a=await ie(e),{layer:i,shape:t,defaultSymbolEnabled:n,legendOptions:o}=a,l="renderer"in i?i.renderer:void 0,p=(await s("esri/smartMapping/t9n/smartMapping")).other;let c=[];"unique-value"===l?.type&&(c=ne({renderer:l,defaultSymbolEnabled:n,defaultLabelBackup:p})),"class-breaks"===l?.type&&(c=se({renderer:l,defaultSymbolEnabled:n,defaultLabelBackup:p}));const d=[],f=[];for(const r of c){const{field:e,color:a}=r;d.push(e),f.push(new u({color:a,field:e.name,label:e.alias}))}return{fields:d,renderer:new r({attributes:f,legendOptions:m.from(o),holePercentage:"donut"===t?.45:0,outline:null,size:9,othersCategory:null})}}function ne(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,defaultSymbol:s,defaultLabel:u}=r,p=r.uniqueValueInfos??[],m=s&&a,c=m?9:10,d=i(ae,c),f=(n?p.slice(0,c).map(((e,r)=>{const a=e.label,i=d[r];return{field:new o({name:oe(e.value?.toString()),alias:a,onStatisticExpression:new l({title:`Field definition - ${a}`,expression:ue(n,e),returnType:"number"}),statisticType:"sum"}),color:le(e.symbol,i)}})):null)??[];if(m){const e="cluster_default",r=u||t;f.push({field:new o({name:oe(e),alias:r,onStatisticExpression:new l({title:`Field definition - ${r}`,expression:pe(n,p),returnType:"number"}),statisticType:"sum"}),color:le(s,re)})}return f}function se(e){const{renderer:r,defaultSymbolEnabled:a,defaultLabelBackup:t}=e,{field:n,classBreakInfos:s,defaultSymbol:u,defaultLabel:p}=r,m=u&&a,c=m?9:10,d=i(ae,c),f=s.slice(0,c).map(((e,r)=>{const a=e.label||`${e.minValue} - ${e.maxValue}`,i=d[r];return{field:new o({name:oe(a),alias:a,onStatisticExpression:new l({title:`Field definition - ${a}`,expression:me(n,e),returnType:"number"}),statisticType:"sum"}),color:le(e.symbol,i)}}));if(m){const e="cluster_default",r=p||t;f.push({field:new o({name:oe(e),alias:r,onStatisticExpression:new l({title:`Field definition - ${r}`,expression:ce(n,s),returnType:"number"}),statisticType:"sum"}),color:le(u,re)})}return f}function oe(e){return"SUM_"+(e+"").replaceAll(/[^a-zA-Z0-9_]/g,"_")}function le(e,r){if("simple-marker"===e?.type&&e.color)return e.color.clone();if("cim"===e?.type){const r=_(e);if(r)return r.clone()}return r?r.clone():ee.clone()}function ue(e,r){return`Number(Text($feature["${e}"]) == "${r.value+""}")`}function pe(e,r){return`Number(!(${r.map((r=>`(Text($feature["${e}"]) == "${r.value+""}")`)).join(" || ")}))`}function me(e,r){return`Number($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`}function ce(e,r){return`Number(!(${r.map((r=>`($feature["${e}"] >= ${r.minValue} && $feature["${e}"] < ${r.maxValue})`)).join(" || ")}))`}export{K as createRenderer,te as createRendererForClustering,Z as regenerateRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{getSumOfAttributesExpr as s,verifyBasicFieldValidity as t}from"./support/utils.js";import{verifyBinningParams as r}from"../support/binningUtils.js";import{defaultStatisticTypes as i,getFieldsList as a}from"../support/utils.js";import{LayerType as n,binningCapableLayerTypes as o,createLayerAdapter as u,getLayerTypeLabels as l}from"../support/adapters/support/layerUtils.js";async function p(s){if(!(s&&s.layer&&s.attributes))throw new e("summary-statistics-for-attributes:missing-parameters","'layer' and 'attributes' parameters are required");if(s.attributes.some((e=>!!e.valueExpression))&&!s.view)throw new e("summary-statistics-for-attributes:missing-parameters","View is required when 'valueExpression' is specified in attributes");s.forBinning&&r(s,"summary-statistics-for-attributes");const{layer:i,...p}=s,m=[n.CSVLayer,n.FeatureLayer,n.OGCFeatureLayer,n.GeoJSONLayer,n.WFSLayer],c=s.forBinning?o:m,f=u(i,c,s.forBinning);if(!f)throw new e("summary-statistics-for-attributes:invalid-parameters","'layer' must be one of these types: "+l(c).join(", "));const y={layerAdapter:f,...p};y.includeZeros=null==y.includeZeros||y.includeZeros,y.includeNegatives=null==y.includeNegatives||y.includeNegatives;const d=y.view,w=null!=y.signal?{signal:y.signal}:null;await Promise.all([d?.when(),f.load(w)]);const v=[];for(const e of y.attributes){const s=await a({field:e.field,valueExpression:e.valueExpression});Array.prototype.push.apply(v,s)}const g=t(f,v,"summary-statistics-for-attributes:invalid-parameters");if(g)throw g;return y}async function m(e){const{layerAdapter:t,...r}=await p(e),a=s(r.attributes,r.includeZeros,r.includeNegatives);return t.summaryStatistics({valueExpression:a.valueExpression,sqlExpression:a.sqlExpression,sqlWhere:a.sqlWhere,view:r.view,filter:r.filter,outStatisticTypes:i,signal:r.signal})}export{m as default};
5
+ import e from"../../core/Error.js";import{getSumOfAttributesExpr as s,verifyBasicFieldValidity as t}from"./support/utils.js";import{verifyBinningParams as r}from"../support/binningUtils.js";import{defaultStatisticTypes as i,getFieldsList as a}from"../support/utils.js";import{LayerType as n,binningCapableLayerTypes as o,createLayerAdapter as u,getLayerTypeLabels as l}from"../support/adapters/support/layerUtils.js";async function p(s){if(!(s&&s.layer&&s.attributes))throw new e("summary-statistics-for-attributes:missing-parameters","'layer' and 'attributes' parameters are required");if(s.attributes.some((e=>!!e.valueExpression))&&!s.view)throw new e("summary-statistics-for-attributes:missing-parameters","View is required when 'valueExpression' is specified in attributes");s.forBinning&&r(s,"summary-statistics-for-attributes");const{layer:i,...p}=s,m=[n.CSVLayer,n.FeatureLayer,n.OGCFeatureLayer,n.GeoJSONLayer,n.ParquetLayer,n.WFSLayer],c=s.forBinning?o:m,f=u(i,c,s.forBinning);if(!f)throw new e("summary-statistics-for-attributes:invalid-parameters","'layer' must be one of these types: "+l(c).join(", "));const y={layerAdapter:f,...p};y.includeZeros=null==y.includeZeros||y.includeZeros,y.includeNegatives=null==y.includeNegatives||y.includeNegatives;const d=y.view,w=null!=y.signal?{signal:y.signal}:null;await Promise.all([d?.when(),f.load(w)]);const v=[];for(const e of y.attributes){const s=await a({field:e.field,valueExpression:e.valueExpression});Array.prototype.push.apply(v,s)}const g=t(f,v,"summary-statistics-for-attributes:invalid-parameters");if(g)throw g;return y}async function m(e){const{layerAdapter:t,...r}=await p(e),a=s(r.attributes,r.includeZeros,r.includeNegatives);return t.summaryStatistics({valueExpression:a.valueExpression,sqlExpression:a.sqlExpression,sqlWhere:a.sqlWhere,view:r.view,filter:r.filter,outStatisticTypes:i,signal:r.signal})}export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- const d="20250106",a="75a956abdbdedb2376d9c36946215a28d51f26d3";export{d as buildDate,a as commitHash};
5
+ const b="20250107",e="2053d1ecbbc17eb28d73e5ab5b2a5ff47dce86d6";export{b as buildDate,e as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as i}from"../../core/mathUtils.js";import s from"../../core/ObjectPool.js";import{px2pt as o,pt2px as n}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{fromValues as l,create as h,expandPointInPlace as c,center as m,width as f,height as u,diagonal as d}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as g}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as p}from"../../geometry/support/centroid.js";import{isPoint as _,isPolygon as y,isPolyline as P,isExtent as S,isMultipoint as w}from"../../geometry/support/jsonUtils.js";import{SimpleEffectCursor as x}from"./CIMEffects.js";import M from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as b,getPlacementOperator as k}from"./CIMOperators.js";import{Placement as C}from"./CIMPlacements.js";import{defaultCIMValues as v}from"./defaultCIMValues.js";import{LineCapStyle as I,LineJoinStyle as T}from"./enums.js";import{getFirstFrame as R}from"./imageUtils.js";import{rotate as z}from"./mathUtils.js";import{addColorStops as L}from"./rasterizingUtils.js";import F from"./Rect.js";import U from"./TextRasterizer.js";import{getNumericValue as A,isCIMFill as j,getSize as G,isSVGImage as D,getRelativeGradientSize as H,fromCIMFontDecoration as B,fromCIMFontStyle as E,fromCIMHorizontalAlignment as X,fromCIMVerticalAlignment as J,getFillColor as N,getStrokeColor as O,getStrokeWidth as q,getFontStyle as V,getFontWeight as W}from"./utils.js";import{destroyHiddenSvg as Y,createHiddenSvg as $,createSvgElement as K}from"../../views/2d/engine/svgUtils.js";import{glyphSize as Q,magicLabelLineHeight as Z,hittestToleranceSmallSymbol as tt,hittestSmallSymbolThreshold as et}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as rt}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as it,getLineWidth as st}from"../../views/2d/layers/graphics/graphicsUtils.js";const ot=Math.PI/180,nt=.5,at=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class lt{constructor(t){this._t=t}static createIdentity(){return new lt([1,0,0,0,1,0])}clone(){const t=this._t;return new lt(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new lt([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new lt([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new lt([e,-r,0,r,e,0])}rotate(t){return lt.multiply(this,lt.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const i=t._t,s=e._t,o=i[0]*s[0]+i[3]*s[1],n=i[1]*s[0]+i[4]*s[1],a=i[2]*s[0]+i[5]*s[1]+s[2],l=i[0]*s[3]+i[3]*s[4],h=i[1]*s[3]+i[4]*s[4],c=i[2]*s[3]+i[5]*s[4]+s[5],m=r._t;return m[0]=o,m[1]=n,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new lt([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,s=t[4]*e,o=-t[1]*e,n=-t[3]*e,a=t[0]*e;return new lt([s,o,r,n,a,i])}}class ht{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new s(C,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||lt.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||lt.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;lt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const i=t.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this._resourceManager.geometryEngine;let i=new x(a.fromJSONCIM(e));for(const s of t){const t=b(s);t&&(i=t.execute(i,s,this.geomUnitsPerPoint(),null,r))}return i}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const i=t[r];if(!i||!1===i.enable)continue;const s=i.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(i,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=ut(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const i=k(r);if(i){const s="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;s&&this.pushClipPath(e);const o=i.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let e=null;for(;(e=o.next())&&(this.drawMarker(t,e),!this._earlyReturn););}s&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(_(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(y(e)){const i=p(e);i&&([r.tx,r.ty]=i,this.drawMarker(t,r))}else for(const i of e.points)if(r.tx=i[0],r.ty=i[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),i=A(t.size,v.CIMPictureMarker.size);if(null==r||i<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const n=s/o,a=A(t.scaleX,1),l=lt.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=i*n*a,r*=i),l.translate(-e,-r)}let c=A(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*ot);let m=A(t.offsetX),f=A(t.offsetY);if(m||f){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=m*r+f*e;m=m*e-f*r,f=i}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const i=A(t.size,v.CIMVectorMarker.size),s=t.frame,o=s?s.ymax-s.ymin:0,n=i&&o?i/o:1,a=lt.createIdentity();s&&a.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?s&&(e*=s.xmax-s.xmin,r*=s.ymax-s.ymin):(e/=n,r/=n),a.translate(-e,-r)}1!==n&&a.scale(n,n);let h=A(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*ot);let c=A(t.offsetX),m=A(t.offsetY);if(c||m){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=c*r+m*e;c=c*e-m*r,m=i}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||at().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!_(e))return;if(A(t.height,v.CIMTextSymbol.height)<=0)return;const i=lt.createIdentity();let s=A(t.angle);s=-s,s&&i.rotate(s*ot);const o=A(t.offsetX),n=A(t.offsetY);(o||n)&&i.translate(o,n);const a=this.geomUnitsPerPoint();1!==a&&i.scale(a,a),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,r),this.pop()}}class ct extends ht{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new F(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return l(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(y(t))this._processPath(t.rings,0);else if(P(t))this._processPath(t.paths,0);else if(S(t)){const e=_t(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const i=Math.max(.5*this.transformSize(A(r,v.CIMSolidStroke.width)),.5*nt);if(y(t))this._processPath(t.rings,i);else if(P(t))this._processPath(t.paths,i);else if(S(t)){const e=_t(t);e&&this._processPath(e.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){y(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,i=A(t.scaleX,1);let s=i*e,o=e;const n=this._resourceManager.getResource(r);if(null!=n){const t=n.height/n.width;s=i*(e?t>1?e:e/t:n.width),o=e?t>1?e*t:e:n.height}this._merge(this.transformPt([-s/2,-o/2]),0),this._merge(this.transformPt([-s/2,o/2]),0),this._merge(this.transformPt([s/2,-o/2]),0),this._merge(this.transformPt([s/2,o/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new U);const r=Pt(t);let[i,s]=this._textRasterizer.computeTextSize(e,r);i=o(i),s=o(s);const n=this.transformSize(1)*this.reverseTransformScalar(1);i*=n,s*=n;let a=0;switch(t.horizontalAlignment){case"Left":a=i/2;break;case"Right":a=-i/2}let l=0;switch(t.verticalAlignment){case"Bottom":l=s/2;break;case"Top":l=-s/2;break;case"Baseline":l=s/6}this._merge(this.transformPt([-i/2+a,-s/2+l]),0),this._merge(this.transformPt([-i/2+a,s/2+l]),0),this._merge(this.transformPt([i/2+a,-s/2+l]),0),this._merge(this.transformPt([i/2+a,s/2+l]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let i=1;i<t;i++)this._merge(this.transformPt(r[i]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class mt extends ht{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=Y(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,i,s,a){const l=a*n(1);this.setTransform(),this.setGeomUnitsPerPoint(l),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/l,this._textInfo=i;const h=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type);if(this._mapRotation=h?s:0,!has("esri-mobile")){const t=o(tt*window.devicePixelRatio),r=o(et);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(j))&&"CIMMeshSymbol"!==e?.type&&(G(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,i,s,o,n){null!=n?this._hittestSvgPath(t,n,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,i=A(t.scaleX,1),s=this._resourceManager.getResource(r);if(null==s||0===s.height||0===e)return;const o=e*this.geomUnitsPerPoint(),n=o*i*(s.width/s.height),a=this.reverseTransformPt(this._searchPoint),l=this._searchDistPoint;Math.abs(a[0])<n/2+l&&Math.abs(a[1])<o/2+l&&(this._earlyReturn=!0)}drawText(t,e){const r=this._textInfo;if(!r)return;const i=r.get(t);if(!i)return;if(!i.glyphMosaicItems.glyphs.length)return;const s=it(A(t.height,v.CIMTextSymbol.height)),{lineGapType:o,lineGap:n}=t,a=o?yt(o,A(n),s):0,l="CIMBackgroundCallout"===t.callout?.type,h=rt(i.glyphMosaicItems,{scale:s/Q,angle:0,xOffset:0,yOffset:0,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:st(t.lineWidth),lineHeight:Z*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}),c=this.reverseTransformPt(this._searchPoint),m=c[0],f=c[1];for(const u of h.glyphs)if(m>u.xTopLeft&&m<u.xBottomRight&&f>-u.yBottomRight&&f<-u.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if(S(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(y(t))e=t.rings;else{if(!P(t))return;e=t.paths}const r=this.reverseTransformPt(this._searchPoint);if(dt(r,e)&&(this._earlyReturn=!0),!this._earlyReturn){gt(r,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=$(),this._path??=K("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,i=0){const s=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),o=this.reverseTransformPt(this._searchPoint),n=h();g(n,t);const a={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},l=this._getSvgPath();l.setAttribute("d",e);const c=l.getBBox();let m=Math.max(c.width/a.width,c.height/a.height),f=1;const u=2*s*m;u<1&&(f=2/u,m*=f,c.x*=f,c.y*=f,c.width*=f,c.height*=f);const d=1+i*m/2,p=this._getCanvasContext(c.width+2*d,c.height+2*d);p.setTransform(f,0,0,f,-c.x+d,-c.y+d);const _=new Path2D(e);r?p.fill(_):(p.lineWidth=i*(m/f),p.stroke(_));const y=(a.width*m-c.width)/2,P=(a.height*m-c.height)/2,S=Math.floor((o[0]-a.x-s)*m-y+d),w=Math.floor((a.height-(o[1]-a.y)-s)*m+P+d),x=Math.ceil(2*s*m),M=Math.ceil(2*s*m),b=p.getImageData(S,w,x,M).data;for(let h=3;h<b.length;h+=4)if(b[h]>127.5)return void(this._earlyReturn=!0)}_hitTestStroke(t,e){let r=null;if(S(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(y(t))r=t.rings;else{if(!P(t))return;r=t.paths}gt(this.reverseTransformPt(this._searchPoint),r,A(e,v.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}class ft extends ht{constructor(t,e,r,i){super(e,r),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new M,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!0);else if(S(t))this._buildPath(_t(t).rings,!0);else{if(!w(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,i,s,o){if(!t||!e||0===r)return;if(y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!1);else{if(!S(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(_t(t).rings,!0)}const n=this._ctx;n.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",n.lineWidth=Math.max(this.transformSize(r),nt),this._setCapStyle(i),this._setJoinStyle(s),n.miterLimit=o,n.stroke()}pushClipPath(t){if(this._ctx.save(),y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!0);else{if(!S(t))return;this._buildPath(_t(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:i,tintColor:s}=t,o=A(t.scaleX,1),n=this._resourceManager.getResource(i);if(null==n)return;let a=e*(n.width/n.height),l=e;e||(a=n.width,l=n.height);const h=D(i)||"src"in n&&D(n.src);let c="getFrame"in n?R(n):n;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&s&&(c=this._colorSubstitutionHelper.tintImageData(c,s));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:o*d*f,m12:o*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new U);const r=Pt(t,this.transformSize(o(1))),i=this._textRasterizer.rasterizeText(e,r);if(!i)return;const{size:s,anchorX:n,anchorY:a,canvas:l}=i,h=s[0]*(n+.5),c=s[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-g*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:i,offsetX:s,offsetY:o,rotation:n,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(y(t))this._buildPath(t.rings,!0);else if(P(t))this._buildPath(t.paths,!0);else if(S(t))this._buildPath(_t(t).rings,!0);else{if(!w(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=D(h)||"src"in c&&D(c.src);let u,d="getFrame"in c?R(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);n||(n=0),s?s*=t:s=0,o?o*=t:o=0,i&&(i*=t);const e=i?i/c.height:1,r=a&&i?a*i/c.width:1;if(0!==n||1!==e||1!==r||0!==s||0!==o){const t=new DOMMatrix;t.rotateSelf(0,0,-n).translateSelf(s,o).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:i,capStyle:s,joinStyle:o,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(y(t))f=t.rings;else if(P(t))f=t.paths;else{if(!S(t))return w(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=_t(t).rings}c||(c=m.width);const u=D(h)||"src"in m&&D(m.src);let d="getFrame"in m?R(m):m;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(n(c)),.5),p=g/d.width,_=this._ctx,x=_.createPattern(d,"repeat-y");let M,b;_.save(),this._setCapStyle(s),this._setJoinStyle(o),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let n of f)if(n=e(n),wt(n),n&&!(n.length<=1)){M=this.transformPt(n[0]);for(let t=1;t<n.length;t++){b=this.transformPt(n[t]);const e=pt(M,b),r=new DOMMatrix;r.translateSelf(0,M[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),x.setTransform(r),_.strokeStyle=x,_.beginPath(),_.moveTo(M[0],M[1]),_.lineTo(b[0],b[1]),_.stroke(),M=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(y(t))r=t.rings;else if(P(t))r=t.paths;else{if(!S(t))return void at().error("Unable to draw gradient fill");r=_t(t).rings}this._buildPath(r,!0);const{angle:s,gradientMethod:o,gradientSize:a,gradientSizeUnits:l}=e,g=v.CIMGradientFill,p=e.gradientType??g.gradientType,_=-i(s??0),w=h();for(const i of r){const t=i?i.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(i[e]);"Linear"!==o&&"Rectangular"!==o||(t=z(t,-_)),c(w,t)}}const[x,M,b,k]=w,C=this._ctx;switch(C.save(),o){case"Buffered":at().error(`Gradient method "${o}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*(b-x),[i,s]="Discrete"===p?[b,b-r]:[x+r,x],o=z([i,t],_),h=z([s,t],_),c=C.createLinearGradient(o[0],o[1],h[0],h[1]);L(c,e),C.fillStyle=c,C.fill("evenodd");break}case"Circular":{const t=m(w),r=d(w)/2,i="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*r,[s,o]="Discrete"===p?[r,r-i]:[i,0],h=C.createRadialGradient(t[0],t[1],s,t[0],t[1],o);L(h,e),C.fillStyle=h,C.fill("evenodd");break}case"Rectangular":{const r=m(w),i=r[0],s=r[1],o=z(r,_),h=(r,i,s,n,a,l,h,c)=>{C.save(),this.pushClipPath(t);const m=z([a,l],_),f=z([h,c],_);C.beginPath(),C.moveTo(o[0],o[1]),C.lineTo(m[0],m[1]),C.lineTo(f[0],f[1]),C.lineTo(o[0],o[1]),C.clip();const u=z([r,i],_),d=z([s,n],_),g=C.createLinearGradient(u[0],u[1],d[0],d[1]);L(g,e),C.fillStyle=g,C.fill("evenodd"),C.restore()};let c="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*(f(w)/2),[d,y]="Discrete"===p?[b,b-c]:[i+c,i];h(d,s,y,s,b,M,b,k),[d,y]="Discrete"===p?[x,x+c]:[i-c,i],h(d,s,y,s,x,k,x,M),c="Absolute"===l?this.transformSize(n(a)):H(a,g.gradientSize)*(u(w)/2);let[P,S]="Discrete"===p?[k,k-c]:[s+c,s];h(i,P,i,S,b,k,x,k),[P,S]="Discrete"===p?[M,M+c]:[s-c,s],h(i,P,i,S,x,M,b,M);break}}C.restore()}drawGradientStroke(t,r){const{capStyle:i,gradientMethod:s,gradientSize:o,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(y(t))m=t.rings;else if(P(t))m=t.paths;else{if(!S(t))return void at().error("Unable to draw gradient stroke");m=_t(t).rings}const f=r.gradientType??v.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(n(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(i),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),wt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],i=p[1]-g[1];t+=Math.sqrt(r*r+i*i),g=p}const i="Absolute"===a?this.transformSize(n(o)):H(o,v.CIMGradientStroke.gradientSize)*("AcrossLine"===s?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const o=p[0]-g[0],n=p[1]-g[1],a=Math.sqrt(o*o+n*n);let h,c,m,y;switch(s){case"AcrossLine":{const[t,e]=z([o/a,n/a],Math.PI/2),r=u/2,s="Discrete"===f?r:i-r;h=(g[0]+p[0])/2+t*s,c=(g[1]+p[1])/2+e*s,m=h-t*i,y=c-e*i;break}case"AlongLine":{const e=o/a,r=n/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*i,y=c+r*i):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*i,c=y-r*i);break}default:return at().error("Unrecognized gradient method:",s),void d.restore()}const P=d.createLinearGradient(h,c,m,y);L(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const i of t){const t=i?i.length:0;if(t>1){let s=this.transformPt(i[0]);r.moveTo(s[0],s[1]);for(let e=1;e<t;e++)s=this.transformPt(i[e]),r.lineTo(s[0],s[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case I.Butt:this._ctx.lineCap="butt";break;case I.Round:this._ctx.lineCap="round";break;case I.Square:this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case T.Bevel:this._ctx.lineJoin="bevel";break;case T.Round:this._ctx.lineJoin="round";break;case T.Miter:this._ctx.lineJoin="miter"}}}function ut(t,e,r){let i=A(t.separation,v.CIMHatchFill.separation)*r,s=A(t.rotation);if(0===i)return null;i<0&&(i=-i);let o=0;const n=.5*i;for(;o>n;)o-=i;for(;o<-n;)o+=i;const a=h();g(a,e),a[0]-=n,a[1]-=n,a[2]+=n,a[3]+=n;const l=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const c=Math.cos(s*ot),m=Math.sin(s*ot),f=-i*m,u=i*c;let d,p,_,y;o=A(t.offsetX)*r*m-A(t.offsetY)*r*c,d=_=Number.MAX_VALUE,p=y=-Number.MAX_VALUE;for(const h of l){const t=h[0],e=h[1],r=c*t+m*e,i=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,i),p=Math.max(p,r),y=Math.max(y,i)}_=Math.floor(_/i)*i;let P=c*d-m*_-f*o/i,S=m*d+c*_-u*o/i,w=c*p-m*_-f*o/i,x=m*p+c*_-u*o/i;const M=1+Math.round((y-_)/i),b=[];for(let h=0;h<M;h++)P+=f,S+=u,w+=f,x+=u,b.push([[P,S],[w,x]]);return{paths:b}}function dt(t,e){let r=0;for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];if(e[1]>t[1]==o[1]>t[1])continue;(o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function gt(t,e,r){for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];let n=(o[0]-e[0])*(o[0]-e[0])+(o[1]-e[1])*(o[1]-e[1]);if(0===n)continue;n=Math.sqrt(n);const a=((o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0]))/n;if(Math.abs(a)<r){const i=((o[0]-e[0])*(t[0]-e[0])+(o[1]-e[1])*(t[1]-e[1]))/n;if(i>-r&&i<n+r)return!0}}}return!1}function pt(t,e){const r=e[0]-t[0],i=e[1]-t[1];return 180/Math.PI*Math.atan2(i,r)}const _t=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,yt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function Pt(e,r=1){const i=B(e),s=E(e.fontStyleName),o=e.fontFamilyName??t,{weight:n,style:a}=s,l=r*(e.height||5),h=X(e.horizontalAlignment),c=J(e.verticalAlignment),m=N(e),f=N(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=O(e.symbol),g=r*(q(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=N(p),y=q(p),P=O(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:o,style:V(a),weight:W(n),decoration:i},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const St=1e-4;function wt(t){let e,r,i,s,o,n=t[0],a=1;for(;a<t.length;)e=t[a][0]-n[0],r=t[a][1]-n[1],s=0!==e?r/e:Math.PI/2,void 0!==i&&Math.abs(s-i)<=St?(t.splice(a-1,1),n=o):(o=n,n=t[a],a++),i=s}export{ht as CIMSymbolDrawHelper,ft as CanvasDrawHelper,ct as EnvDrawHelper,mt as HittestDrawHelper,lt as Transformation,ot as cDegToRad,yt as lineGapType2LineHeight};
5
+ import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as i}from"../../core/mathUtils.js";import s from"../../core/ObjectPool.js";import{px2pt as o,pt2px as n}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{fromValues as l,create as h,empty as c,expandPointInPlace as m,center as f,width as u,height as d,diagonal as g}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as p}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as _}from"../../geometry/support/centroid.js";import{isPoint as y,isPolygon as P,isPolyline as S,isExtent as w,isMultipoint as x}from"../../geometry/support/jsonUtils.js";import{SimpleEffectCursor as M}from"./CIMEffects.js";import b from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as k,getPlacementOperator as C}from"./CIMOperators.js";import{Placement as v}from"./CIMPlacements.js";import{defaultCIMValues as I}from"./defaultCIMValues.js";import{LineCapStyle as T,LineJoinStyle as R}from"./enums.js";import{getFirstFrame as z}from"./imageUtils.js";import{rotate as L}from"./mathUtils.js";import{addColorStops as F}from"./rasterizingUtils.js";import U from"./Rect.js";import A from"./TextRasterizer.js";import{getNumericValue as j,isCIMFill as G,getSize as D,isSVGImage as H,getRelativeGradientSize as B,fromCIMFontDecoration as E,fromCIMFontStyle as X,fromCIMHorizontalAlignment as J,fromCIMVerticalAlignment as N,getFillColor as O,getStrokeColor as q,getStrokeWidth as V,getFontStyle as W,getFontWeight as Y}from"./utils.js";import{destroyHiddenSvg as $,createHiddenSvg as K,createSvgElement as Q}from"../../views/2d/engine/svgUtils.js";import{glyphSize as Z,magicLabelLineHeight as tt,hittestToleranceSmallSymbol as et,hittestSmallSymbolThreshold as rt}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as it}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as st,getLineWidth as ot}from"../../views/2d/layers/graphics/graphicsUtils.js";const nt=Math.PI/180,at=.5,lt=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class ht{constructor(t){this._t=t}static createIdentity(){return new ht([1,0,0,0,1,0])}clone(){const t=this._t;return new ht(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new ht([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new ht([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new ht([e,-r,0,r,e,0])}rotate(t){return ht.multiply(this,ht.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const i=t._t,s=e._t,o=i[0]*s[0]+i[3]*s[1],n=i[1]*s[0]+i[4]*s[1],a=i[2]*s[0]+i[5]*s[1]+s[2],l=i[0]*s[3]+i[3]*s[4],h=i[1]*s[3]+i[4]*s[4],c=i[2]*s[3]+i[5]*s[4]+s[5],m=r._t;return m[0]=o,m[1]=n,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new ht([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,s=t[4]*e,o=-t[1]*e,n=-t[3]*e,a=t[0]*e;return new ht([s,o,r,n,a,i])}}class ct{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new s(v,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||ht.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||ht.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;ht.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const i=t.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this._resourceManager.geometryEngine;let i=new M(a.fromJSONCIM(e));for(const s of t){const t=k(s);t&&(i=t.execute(i,s,this.geomUnitsPerPoint(),null,r))}return i}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const i=t[r];if(!i||!1===i.enable)continue;const s=i.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(i,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=dt(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const i=C(r);if(i){const s="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;s&&this.pushClipPath(e);const o=i.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let e=null;for(;(e=o.next())&&(this.drawMarker(t,e),!this._earlyReturn););}s&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(y(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(P(e)){const i=_(e);i&&([r.tx,r.ty]=i,this.drawMarker(t,r))}else for(const i of e.points)if(r.tx=i[0],r.ty=i[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),i=j(t.size,I.CIMPictureMarker.size);if(null==r||i<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const n=s/o,a=j(t.scaleX,1),l=ht.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=i*n*a,r*=i),l.translate(-e,-r)}let c=j(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*nt);let m=j(t.offsetX),f=j(t.offsetY);if(m||f){if(this._mapRotation){const t=nt*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=m*r+f*e;m=m*e-f*r,f=i}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const i=j(t.size,I.CIMVectorMarker.size),s=t.frame,o=s?s.ymax-s.ymin:0,n=i&&o?i/o:1,a=ht.createIdentity();s&&a.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?s&&(e*=s.xmax-s.xmin,r*=s.ymax-s.ymin):(e/=n,r/=n),a.translate(-e,-r)}1!==n&&a.scale(n,n);let h=j(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*nt);let c=j(t.offsetX),m=j(t.offsetY);if(c||m){if(this._mapRotation){const t=nt*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=c*r+m*e;c=c*e-m*r,m=i}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||lt().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!y(e))return;if(j(t.height,I.CIMTextSymbol.height)<=0)return;const i=ht.createIdentity();let s=j(t.angle);s=-s,s&&i.rotate(s*nt);const o=j(t.offsetX),n=j(t.offsetY);(o||n)&&i.translate(o,n);const a=this.geomUnitsPerPoint();1!==a&&i.scale(a,a),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,r),this.pop()}}class mt extends ct{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new U(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return l(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(P(t))this._processPath(t.rings,0);else if(S(t))this._processPath(t.paths,0);else if(w(t)){const e=yt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const i=Math.max(.5*this.transformSize(j(r,I.CIMSolidStroke.width)),.5*at);if(P(t))this._processPath(t.rings,i);else if(S(t))this._processPath(t.paths,i);else if(w(t)){const e=yt(t);e&&this._processPath(e.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){P(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,i=j(t.scaleX,1);let s=i*e,o=e;const n=this._resourceManager.getResource(r);if(null!=n){const t=n.height/n.width;s=i*(e?t>1?e:e/t:n.width),o=e?t>1?e*t:e:n.height}this._merge(this.transformPt([-s/2,-o/2]),0),this._merge(this.transformPt([-s/2,o/2]),0),this._merge(this.transformPt([s/2,-o/2]),0),this._merge(this.transformPt([s/2,o/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new A);const r=St(t);let[i,s]=this._textRasterizer.computeTextSize(e,r);i=o(i),s=o(s);const n=this.transformSize(1)*this.reverseTransformScalar(1);i*=n,s*=n;let a=0;switch(t.horizontalAlignment){case"Left":a=i/2;break;case"Right":a=-i/2}let l=0;switch(t.verticalAlignment){case"Bottom":l=s/2;break;case"Top":l=-s/2;break;case"Baseline":l=s/6}this._merge(this.transformPt([-i/2+a,-s/2+l]),0),this._merge(this.transformPt([-i/2+a,s/2+l]),0),this._merge(this.transformPt([i/2+a,-s/2+l]),0),this._merge(this.transformPt([i/2+a,s/2+l]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let i=1;i<t;i++)this._merge(this.transformPt(r[i]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class ft extends ct{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=$(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,i,s,a){const l=a*n(1);this.setTransform(),this.setGeomUnitsPerPoint(l),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/l,this._textInfo=i;const h=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type);if(this._mapRotation=h?s:0,!has("esri-mobile")){const t=o(et*window.devicePixelRatio),r=o(rt);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(G))&&"CIMMeshSymbol"!==e?.type&&(D(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,i,s,o,n){null!=n?this._hittestSvgPath(t,n,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,i=j(t.scaleX,1),s=this._resourceManager.getResource(r);if(null==s||0===s.height||0===e)return;const o=e*this.geomUnitsPerPoint(),n=o*i*(s.width/s.height),a=this.reverseTransformPt(this._searchPoint),l=this._searchDistPoint;Math.abs(a[0])<n/2+l&&Math.abs(a[1])<o/2+l&&(this._earlyReturn=!0)}drawText(t,e){const r=this._textInfo;if(!r)return;const i=r.get(t);if(!i)return;if(!i.glyphMosaicItems.glyphs.length)return;const s=st(j(t.height,I.CIMTextSymbol.height)),{lineGapType:o,lineGap:n}=t,a=o?Pt(o,j(n),s):0,l="CIMBackgroundCallout"===t.callout?.type,h=it(i.glyphMosaicItems,{scale:s/Z,angle:0,xOffset:0,yOffset:0,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:ot(t.lineWidth),lineHeight:tt*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}),c=this.reverseTransformPt(this._searchPoint),m=c[0],f=c[1];for(const u of h.glyphs)if(m>u.xTopLeft&&m<u.xBottomRight&&f>-u.yBottomRight&&f<-u.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if(w(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(P(t))e=t.rings;else{if(!S(t))return;e=t.paths}const r=this.reverseTransformPt(this._searchPoint);if(gt(r,e)&&(this._earlyReturn=!0),!this._earlyReturn){pt(r,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=K(),this._path??=Q("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,i=0){const s=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),o=this.reverseTransformPt(this._searchPoint),n=h();p(n,t);const a={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},l=this._getSvgPath();l.setAttribute("d",e);const c=l.getBBox();let m=Math.max(c.width/a.width,c.height/a.height),f=1;const u=2*s*m;u<1&&(f=2/u,m*=f,c.x*=f,c.y*=f,c.width*=f,c.height*=f);const d=1+i*m/2,g=this._getCanvasContext(c.width+2*d,c.height+2*d);g.setTransform(f,0,0,f,-c.x+d,-c.y+d);const _=new Path2D(e);r?g.fill(_):(g.lineWidth=i*(m/f),g.stroke(_));const y=(a.width*m-c.width)/2,P=(a.height*m-c.height)/2,S=Math.floor((o[0]-a.x-s)*m-y+d),w=Math.floor((a.height-(o[1]-a.y)-s)*m+P+d),x=Math.ceil(2*s*m),M=Math.ceil(2*s*m),b=g.getImageData(S,w,x,M).data;for(let h=3;h<b.length;h+=4)if(b[h]>127.5)return void(this._earlyReturn=!0)}_hitTestStroke(t,e){let r=null;if(w(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(P(t))r=t.rings;else{if(!S(t))return;r=t.paths}pt(this.reverseTransformPt(this._searchPoint),r,j(e,I.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}class ut extends ct{constructor(t,e,r,i){super(e,r),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new b,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(w(t))this._buildPath(yt(t).rings,!0);else{if(!x(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,i,s,o){if(!t||!e||0===r)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!1);else{if(!w(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(yt(t).rings,!0)}const n=this._ctx;n.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",n.lineWidth=Math.max(this.transformSize(r),at),this._setCapStyle(i),this._setJoinStyle(s),n.miterLimit=o,n.stroke()}pushClipPath(t){if(this._ctx.save(),P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else{if(!w(t))return;this._buildPath(yt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:i,tintColor:s}=t,o=j(t.scaleX,1),n=this._resourceManager.getResource(i);if(null==n)return;let a=e*(n.width/n.height),l=e;e||(a=n.width,l=n.height);const h=H(i)||"src"in n&&H(n.src);let c="getFrame"in n?z(n):n;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&s&&(c=this._colorSubstitutionHelper.tintImageData(c,s));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:o*d*f,m12:o*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new A);const r=St(t,this.transformSize(o(1))),i=this._textRasterizer.rasterizeText(e,r);if(!i)return;const{size:s,anchorX:n,anchorY:a,canvas:l}=i,h=s[0]*(n+.5),c=s[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-g*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:i,offsetX:s,offsetY:o,rotation:n,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(w(t))this._buildPath(yt(t).rings,!0);else{if(!x(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=H(h)||"src"in c&&H(c.src);let u,d="getFrame"in c?z(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);n||(n=0),s?s*=t:s=0,o?o*=t:o=0,i&&(i*=t);const e=i?i/c.height:1,r=a&&i?a*i/c.width:1;if(0!==n||1!==e||1!==r||0!==s||0!==o){const t=new DOMMatrix;t.rotateSelf(0,0,-n).translateSelf(s,o).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:i,capStyle:s,joinStyle:o,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(P(t))f=t.rings;else if(S(t))f=t.paths;else{if(!w(t))return x(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=yt(t).rings}c||(c=m.width);const u=H(h)||"src"in m&&H(m.src);let d="getFrame"in m?z(m):m;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(n(c)),.5),p=g/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let M,b;_.save(),this._setCapStyle(s),this._setJoinStyle(o),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let n of f)if(n=e(n),xt(n),n&&!(n.length<=1)){M=this.transformPt(n[0]);for(let t=1;t<n.length;t++){b=this.transformPt(n[t]);const e=_t(M,b),r=new DOMMatrix;r.translateSelf(0,M[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),y.setTransform(r),_.strokeStyle=y,_.beginPath(),_.moveTo(M[0],M[1]),_.lineTo(b[0],b[1]),_.stroke(),M=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(P(t))r=t.rings;else if(S(t))r=t.paths;else{if(!w(t))return void lt().error("Unable to draw gradient fill");r=yt(t).rings}this._buildPath(r,!0);const{angle:s,gradientMethod:o,gradientSize:a,gradientSizeUnits:l}=e,h=I.CIMGradientFill,p=e.gradientType??h.gradientType,_=-i(s??0),y=c();for(const i of r){const t=i?i.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(i[e]);"Linear"!==o&&"Rectangular"!==o||(t=L(t,-_)),m(y,t)}}const[x,M,b,k]=y,C=this._ctx;switch(C.save(),o){case"Buffered":lt().error(`Gradient method "${o}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(b-x),[i,s]="Discrete"===p?[b,b-r]:[x+r,x],o=L([i,t],_),c=L([s,t],_),m=C.createLinearGradient(o[0],o[1],c[0],c[1]);F(m,e),C.fillStyle=m,C.fill("evenodd");break}case"Circular":{const t=f(y),r=g(y)/2,i="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*r,[s,o]="Discrete"===p?[r,r-i]:[i,0],c=C.createRadialGradient(t[0],t[1],s,t[0],t[1],o);F(c,e),C.fillStyle=c,C.fill("evenodd");break}case"Rectangular":{const r=f(y),i=r[0],s=r[1],o=L(r,_),c=(r,i,s,n,a,l,h,c)=>{C.save(),this.pushClipPath(t);const m=L([a,l],_),f=L([h,c],_);C.beginPath(),C.moveTo(o[0],o[1]),C.lineTo(m[0],m[1]),C.lineTo(f[0],f[1]),C.lineTo(o[0],o[1]),C.clip();const u=L([r,i],_),d=L([s,n],_),g=C.createLinearGradient(u[0],u[1],d[0],d[1]);F(g,e),C.fillStyle=g,C.fill("evenodd"),C.restore()};let m="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(u(y)/2),[g,P]="Discrete"===p?[b,b-m]:[i+m,i];c(g,s,P,s,b,M,b,k),[g,P]="Discrete"===p?[x,x+m]:[i-m,i],c(g,s,P,s,x,k,x,M),m="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(d(y)/2);let[S,w]="Discrete"===p?[k,k-m]:[s+m,s];c(i,S,i,w,b,k,x,k),[S,w]="Discrete"===p?[M,M+m]:[s-m,s],c(i,S,i,w,x,M,b,M);break}}C.restore()}drawGradientStroke(t,r){const{capStyle:i,gradientMethod:s,gradientSize:o,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(P(t))m=t.rings;else if(S(t))m=t.paths;else{if(!w(t))return void lt().error("Unable to draw gradient stroke");m=yt(t).rings}const f=r.gradientType??I.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(n(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(i),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),xt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],i=p[1]-g[1];t+=Math.sqrt(r*r+i*i),g=p}const i="Absolute"===a?this.transformSize(n(o)):B(o,I.CIMGradientStroke.gradientSize)*("AcrossLine"===s?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const o=p[0]-g[0],n=p[1]-g[1],a=Math.sqrt(o*o+n*n);let h,c,m,y;switch(s){case"AcrossLine":{const[t,e]=L([o/a,n/a],-Math.PI/2),r=u/2,s="Discrete"===f?r:i-r;h=(g[0]+p[0])/2+t*s,c=(g[1]+p[1])/2+e*s,m=h-t*i,y=c-e*i;break}case"AlongLine":{const e=o/a,r=n/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*i,y=c+r*i):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*i,c=y-r*i);break}default:return lt().error("Unrecognized gradient method:",s),void d.restore()}const P=d.createLinearGradient(h,c,m,y);F(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const i of t){const t=i?i.length:0;if(t>1){let s=this.transformPt(i[0]);r.moveTo(s[0],s[1]);for(let e=1;e<t;e++)s=this.transformPt(i[e]),r.lineTo(s[0],s[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case T.Butt:this._ctx.lineCap="butt";break;case T.Round:this._ctx.lineCap="round";break;case T.Square:this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case R.Bevel:this._ctx.lineJoin="bevel";break;case R.Round:this._ctx.lineJoin="round";break;case R.Miter:this._ctx.lineJoin="miter"}}}function dt(t,e,r){let i=j(t.separation,I.CIMHatchFill.separation)*r,s=j(t.rotation);if(0===i)return null;i<0&&(i=-i);let o=0;const n=.5*i;for(;o>n;)o-=i;for(;o<-n;)o+=i;const a=h();p(a,e),a[0]-=n,a[1]-=n,a[2]+=n,a[3]+=n;const l=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const c=Math.cos(s*nt),m=Math.sin(s*nt),f=-i*m,u=i*c;let d,g,_,y;o=j(t.offsetX)*r*m-j(t.offsetY)*r*c,d=_=Number.MAX_VALUE,g=y=-Number.MAX_VALUE;for(const h of l){const t=h[0],e=h[1],r=c*t+m*e,i=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,i),g=Math.max(g,r),y=Math.max(y,i)}_=Math.floor(_/i)*i;let P=c*d-m*_-f*o/i,S=m*d+c*_-u*o/i,w=c*g-m*_-f*o/i,x=m*g+c*_-u*o/i;const M=1+Math.round((y-_)/i),b=[];for(let h=0;h<M;h++)P+=f,S+=u,w+=f,x+=u,b.push([[P,S],[w,x]]);return{paths:b}}function gt(t,e){let r=0;for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];if(e[1]>t[1]==o[1]>t[1])continue;(o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function pt(t,e,r){for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];let n=(o[0]-e[0])*(o[0]-e[0])+(o[1]-e[1])*(o[1]-e[1]);if(0===n)continue;n=Math.sqrt(n);const a=((o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0]))/n;if(Math.abs(a)<r){const i=((o[0]-e[0])*(t[0]-e[0])+(o[1]-e[1])*(t[1]-e[1]))/n;if(i>-r&&i<n+r)return!0}}}return!1}function _t(t,e){const r=e[0]-t[0],i=e[1]-t[1];return 180/Math.PI*Math.atan2(i,r)}const yt=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,Pt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function St(e,r=1){const i=E(e),s=X(e.fontStyleName),o=e.fontFamilyName??t,{weight:n,style:a}=s,l=r*(e.height||5),h=J(e.horizontalAlignment),c=N(e.verticalAlignment),m=O(e),f=O(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=q(e.symbol),g=r*(V(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=O(p),y=V(p),P=q(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:o,style:W(a),weight:Y(n),decoration:i},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const wt=1e-4;function xt(t){let e,r,i,s,o,n=t[0],a=1;for(;a<t.length;)e=t[a][0]-n[0],r=t[a][1]-n[1],s=0!==e?r/e:Math.PI/2,void 0!==i&&Math.abs(s-i)<=wt?(t.splice(a-1,1),n=o):(o=n,n=t[a],a++),i=s}export{ct as CIMSymbolDrawHelper,ut as CanvasDrawHelper,mt as EnvDrawHelper,ft as HittestDrawHelper,ht as Transformation,nt as cDegToRad,Pt as lineGapType2LineHeight};