@arcgis/core 5.1.0-next.59 → 5.1.0-next.60

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 (177) hide show
  1. package/applications/Components/arcadeFeatureUtils.js +1 -1
  2. package/applications/Components/featureUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{9321f5ec514805307219.js → 05c8d2c0362af4511d86.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{ad1946c084219bb678a0.js → 06868e4f52de9d918255.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{8df0c154bb0d79a905c0.js → 06c0b93e276cfc1fb7ac.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{05d25a98c54679233902.js → 0888baa99c9007ad63bc.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{1613123918e9b0f7cfdb.js → 0f597c690e5c60fe944b.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{e2e3c39876bbe019c57a.js → 0f8736242544f9e9a57a.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{c9c5e6996f36ec4b1558.js → 11a8541f3909f9ffb000.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{3de17e89973160b42923.js → 16806f5044a9da553b66.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{3e0752a81a7247c567ab.js → 185f59f90070d5d6ac94.js} +1 -1
  13. package/assets/esri/core/workers/chunks/1984c0f037065acd21d3.js +1 -0
  14. package/assets/esri/core/workers/chunks/1af247c86d1c4ae8fef3.js +1 -0
  15. package/assets/esri/core/workers/chunks/{1f91280032aa42b1585b.js → 2a7e7a497823e9f05aa3.js} +1 -1
  16. package/assets/esri/core/workers/chunks/2d92ba11781a3cfc3a78.js +1 -0
  17. package/assets/esri/core/workers/chunks/{9d580b5bcd59857a5702.js → 2f74147597805828cb38.js} +23 -7
  18. package/assets/esri/core/workers/chunks/{d9444dd0d40aa8332b28.js → 31e0bfc2cab055aebf9a.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{93d1118f7a909d123b40.js → 32360a55d1836b2a737e.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{a9eb90b901e64e67b7a3.js → 368b4c0a5eecbb06feac.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{7b6e3cc086d13da770fa.js → 37729578a7c4cf15eded.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{4b3622fc355fd2fd8678.js → 3af1e2f0b3d30c58d0c2.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{83113a9e284701d053b5.js → 3c155efd5768003a91eb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{7ed2aa1092c0a2c839c0.js → 3f0d9fdd8c37605dd85d.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{86a6dd19903fa5023cc7.js → 58614f12796dbba013f4.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{26cafd20c8d03c274389.js → 5c1abb46b9937a050c32.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{1f8e22df08c2f5fbb8c8.js → 6172715b2b2853819d8a.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{87077f4cbca13e030411.js → 62c2757f5dc4aaca2df8.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{23f6d24bf850bc3280ec.js → 6355de3ee89916b74dae.js} +1 -1
  30. package/assets/esri/core/workers/chunks/64ad6130de549083caba.js +1 -0
  31. package/assets/esri/core/workers/chunks/{9b53aa2429573f1b977f.js → 68475eba323b4aa892a3.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{a7a553e245ba011d259f.js → 78c7eace6ec3fa5c7413.js} +1 -1
  33. package/assets/esri/core/workers/chunks/7cee28575fd57430cf02.js +1 -0
  34. package/assets/esri/core/workers/chunks/{b20f4c82d0b44fdb4670.js → 7e1ef2a55f8d123f31e2.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{5a9f5a49dc68b42762bb.js → 8083dface1ca2dbd12b2.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{85c72d9fa533552a6e8a.js → 82e0691995d821137d5f.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{ec1b2eb05410848081c9.js → 8432ffc33843e898bab7.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{bacc343a79828e456de7.js → 8435b6bf356959009b76.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{56bce3a6701f8549606b.js → 8878ab87ef7961fafae8.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{3ef740d25dc17bef11b2.js → 8a893f23827769d42092.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{e8a23ae30d586e3a973c.js → 8e68b4628e9616356c34.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{e7e565e7c0ce1464c6b0.js → 8ea67b502f9355dab7e9.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{66fc3c4d6c54eee231b9.js → 8edae79554843dd77ada.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{0e88e61d89f89994c4bf.js → 909ef35fa33be2b6da41.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c91d39e8e14be3d8bdf5.js → 90b7acc70adba193b215.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{b1a0a7cdaf50f98adb3e.js → 97f10efb0fe05bedcebd.js} +1 -1
  47. package/assets/esri/core/workers/chunks/98f5bf1b91f3696b2fce.js +1 -0
  48. package/assets/esri/core/workers/chunks/{4fb718174c6e07d752e0.js → 9c52d4b54dfdb69dee29.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{5143f74f1fe7533a6069.js → 9c72127de7afcbaafbaf.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{155c741a9839d24f04a2.js → 9def5d17b94e5db71883.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{a41fabf8b2cf15b7d0c9.js → a10be7eb05a007fff1ed.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{ab3183f2327ff26e2b45.js → a226ba96d9a3ecc14e3e.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{2bc6edeb3156d241677b.js → a32c87b89567a9fd1efc.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{e26894655823849947f4.js → a446dff865332268625a.js} +1 -1
  55. package/assets/esri/core/workers/chunks/a520f83ae0c3c3e78858.js +1 -0
  56. package/assets/esri/core/workers/chunks/{bb047157f09471ecea53.js → a6d166058e3025bb280e.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{691d0a60354b6458b9de.js → a80eb704e75d13732878.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{75e28458e08b0738b35a.js → ab223c508f3dd562e7d3.js} +2 -2
  59. package/assets/esri/core/workers/chunks/{3cb0f020f9bfc6653c5d.js → b42487c6a989e11a2559.js} +1 -1
  60. package/assets/esri/core/workers/chunks/b6d94cbd1c5adad2f247.js +1 -0
  61. package/assets/esri/core/workers/chunks/{cd391415b8b8320e12e4.js → b75165880704efccc47c.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{45eddf3918973fa8d751.js → ba72989749543122a6fe.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{0b4a2361b9f9a6c0b8a7.js → ba9e107edc2027238be3.js} +1 -1
  64. package/assets/esri/core/workers/chunks/be1d2c3a61e6447fbbc7.js +1 -0
  65. package/assets/esri/core/workers/chunks/{e9dd60d0220036545ebb.js → bf4bad2c9a541cd425f5.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{78cb6b9ab32abdd1d530.js → c08e9914deb1dc62bc0f.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{52dbfd7519555028a8af.js → c0bb53d8d58ad18334d3.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{c6149e0ac1c103e03baf.js → c0d453f93af2d4a6ce64.js} +1 -1
  69. package/assets/esri/core/workers/chunks/c72e90a952543d06d84b.js +1 -0
  70. package/assets/esri/core/workers/chunks/{005fe95c3329cfe74219.js → cf7acf5acb6d322fd996.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{457bbf27e9bc18132464.js → d23dd7da45a7aa341540.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{929b26999321519824b9.js → d2801df3fa44dee15ec8.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{932a0b39d85a76377d52.js → d626e08d23330d84413b.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{9d11e7972bc298cb94ce.js → db6e03fe8dd316f5005f.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{a37697ef360e2425768a.js → dca595fdd5e1a571e441.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{da2a10e72a315c3c1f82.js → e2779965db231fb666a5.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{f7af90c5f9d371eb7009.js → e4144ccc85ad4c76a9b7.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{9066f095f16448c0a04e.js → e4e2f059c52674dcae5b.js} +1 -1
  79. package/assets/esri/core/workers/chunks/edc2e87968c958bc852b.js +1 -0
  80. package/assets/esri/core/workers/chunks/{a256edc8337e462f80f0.js → efdd75896ca53eb6242f.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{c250799c131aa4ed2c35.js → f1c348cf2a1e35da9b20.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{861a7d0e665add901e11.js → f4d577ff61da7964e08a.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{5aff2d6ae0d2a2d92ecc.js → f7da652f8dab57677cc3.js} +1 -1
  84. package/chunks/GlobalIllumination.glsl.js +24 -8
  85. package/chunks/OITBlend.glsl.js +4 -3
  86. package/config.js +1 -1
  87. package/interfaces.d.ts +7 -0
  88. package/kernel.js +1 -1
  89. package/layers/graphics/OptimizedGeometry.js +1 -1
  90. package/layers/graphics/data/QueryEngineResult.js +1 -1
  91. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  92. package/layers/mixins/RasterJobHandlerMixin.js +1 -1
  93. package/layers/raster/functions/vectorFieldUtils.js +1 -1
  94. package/layers/support/RasterJobHandler.js +1 -1
  95. package/layers/support/RasterWorker.js +1 -1
  96. package/layers/support/TitleCreator.js +1 -1
  97. package/layers/video/VideoController.js +1 -1
  98. package/networks/support/NamedTraceConfiguration.d.ts +2 -1
  99. package/networks/support/NamedTraceConfiguration.js +1 -1
  100. package/networks/support/TraceConfiguration.d.ts +4 -2
  101. package/networks/support/TraceConfiguration.js +1 -1
  102. package/package.json +2 -2
  103. package/popup/Feature.d.ts +250 -0
  104. package/popup/Feature.js +2 -0
  105. package/popup/support/arcadeFeatureUtils.js +2 -0
  106. package/popup/support/featureUtils.js +2 -0
  107. package/popup/support/relatedFeatureUtils.js +2 -0
  108. package/popup/types.d.ts +17 -3
  109. package/support/revision.js +1 -1
  110. package/tables/AttributeTableTemplate.d.ts +2 -2
  111. package/tables/elements/AttributeTableGroupElement.d.ts +3 -16
  112. package/tables/support/tablesUtils.d.ts +6 -5
  113. package/tables/types.d.ts +18 -0
  114. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  115. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  116. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  117. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  118. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  119. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  120. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  121. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  122. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  123. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  124. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  125. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  126. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  127. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  128. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  129. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  130. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  131. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  132. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  133. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  134. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  135. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  136. package/views/2d/layers/imagery/ImageryVFStrategy.js +1 -1
  137. package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
  138. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  139. package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
  140. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  141. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  142. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  143. package/views/3d/webgl-engine/shaders/GlobalIllumination.glsl.js +1 -1
  144. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  145. package/widgets/Editor/UpdateWorkflow.js +1 -1
  146. package/widgets/Editor/support/EditorEditingCapabilities.js +1 -1
  147. package/widgets/Feature/FeatureContent/FeatureContentViewModel.js +1 -1
  148. package/widgets/Feature/FeatureContent.js +1 -1
  149. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  150. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  151. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  152. package/widgets/Feature/FeatureMedia.js +1 -1
  153. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  154. package/widgets/Feature/FeatureViewModel.js +1 -1
  155. package/widgets/FeatureForm/FieldInput.js +1 -1
  156. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  157. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  158. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  159. package/widgets/FeatureForm.js +1 -1
  160. package/widgets/Popup/actionUtils.js +1 -1
  161. package/widgets/Search.js +1 -1
  162. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  163. package/assets/esri/core/workers/chunks/0f2ab57e4eb722b3b0c0.js +0 -1
  164. package/assets/esri/core/workers/chunks/522bc1d79dbe957301e4.js +0 -1
  165. package/assets/esri/core/workers/chunks/60ad54e5707d4414d8b9.js +0 -1
  166. package/assets/esri/core/workers/chunks/76064c2c801da55cd844.js +0 -1
  167. package/assets/esri/core/workers/chunks/ad4f0a4e2dde44cd43d4.js +0 -1
  168. package/assets/esri/core/workers/chunks/b3e5dcb530cef678c8f8.js +0 -1
  169. package/assets/esri/core/workers/chunks/d01a98c13501c89205b6.js +0 -1
  170. package/assets/esri/core/workers/chunks/d3b3e8c6d7096bc59489.js +0 -1
  171. package/assets/esri/core/workers/chunks/d53c6fc10425adc2c0cf.js +0 -1
  172. package/assets/esri/core/workers/chunks/e543bb228f3f9d937d43.js +0 -1
  173. package/assets/esri/core/workers/chunks/f8ee1a99580a7da42cde.js +0 -1
  174. package/widgets/Feature/support/arcadeFeatureUtils.js +0 -2
  175. package/widgets/Feature/support/featureUtils.js +0 -2
  176. package/widgets/Feature/support/relatedFeatureUtils.js +0 -2
  177. /package/assets/esri/core/workers/chunks/{75e28458e08b0738b35a.js.LICENSE.txt → ab223c508f3dd562e7d3.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as i,createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e,this._cache=new s}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return a(t,null,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,postQueryFilter:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,geometryType:o,orderBy:s,objectIdField:a,renderer:n,labelingInfo:d,labelsVisible:p}=this.layer,u={featureReduction:null,labelingInfoSource:this.layer.id,fields:i.map(e=>e.toJSON()),geometryType:o,labelingInfo:d,labelsVisible:p,objectIdField:a,orderBy:s??"default",renderer:n?.clone()};return l(e,r,u,t)}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const o=this.layer,{capabilities:s,editingInfo:a,objectIdField:l,globalIdField:n,datesInUnknownTimezone:d,dateFieldsTimeZone:p,orderBy:u,parsedUrl:c}=o,y=o.fieldsIndex.toJSON(),m=t(o),f=o.timeInfo?.toJSON(),h=o.spatialReference.toJSON(),g=e(c);let b=l;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(b=e)}const F=r(g.path),I=i.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:F,orderByFields:b,outSpatialReference:I,metadata:{timeReferenceUnknownClient:d,dateFieldsTimeZone:p,globalIdField:n,fieldsIndex:y,geometryType:m,featureIdInfo:{type:"object-id",fieldName:l},timeInfo:f,spatialReference:h,outSpatialReference:I,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:s.query.maxRecordCount,tileMaxRecordCount:s.query.tileMaxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,lastEditDate:a?.lastEditDate?.getTime()}}}}export{d as CatalogFootprintLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as i,createLabelVVEvaluator as s}from"./labelingUtils.js";import{ExceedsLimitCache as a}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as o}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class u{constructor(e){this.layer=e,this._cache=new a}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r);return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return o(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:this.layer.returnZ,returnM:this.layer.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,postQueryFilter:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,geometryType:s,orderBy:a,objectIdField:o,renderer:n,labelingInfo:u,labelsVisible:d}=this.layer,p={featureReduction:null,labelingInfoSource:this.layer.id,fields:i.map(e=>e.toJSON()),geometryType:s,labelingInfo:u,labelsVisible:d,objectIdField:o,orderBy:a??"default",renderer:n?.clone()};return l(e,r,p,t)}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}_createServiceInfo(i){const s=this.layer,{capabilities:a,editingInfo:o,objectIdField:l,globalIdField:n,datesInUnknownTimezone:u,dateFieldsTimeZone:d,orderBy:p,parsedUrl:c,hasZ:y,hasM:m}=s,h=s.fieldsIndex.toJSON(),f=t(s),g=s.timeInfo?.toJSON(),b=s.spatialReference.toJSON(),F=e(c);let I=l;if(p?.length){const e=!p[0].valueExpression&&p[0].field;e&&(I=e)}const S=r(F.path),R=i.spatialReference.toJSON();return{type:"feature-service",source:F,isSourceHosted:S,orderByFields:I,outSpatialReference:R,metadata:{timeReferenceUnknownClient:u,dateFieldsTimeZone:d,globalIdField:n,fieldsIndex:h,geometryType:f,hasZ:y??!1,hasM:m??!1,featureIdInfo:{type:"object-id",fieldName:l},timeInfo:g,spatialReference:b,outSpatialReference:R,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:o?.lastEditDate?.getTime()}}}}export{u as CatalogFootprintLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{canConvertSqlRelativeTime as i,sqlRelativeTimeToAbsolute as a}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getEffectiveFeatureReduction as s}from"./featureReductionUtils.js";import{createFeatureIdInfo as o}from"./featureServiceUtils.js";import{addFloorFilter as l,hasFloorFilter as n}from"./floorFilterUtils.js";import{getServiceGeometryType as y}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as p,getLayerDeconflictionEnabled as d,createLabelVVEvaluator as c}from"./labelingUtils.js";import{ExceedsLimitCache as u}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as m,createFeatureSourceSchema as h}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as f}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as g}from"../support/rendererUtils.js";class b{constructor(e){this.layer=e,this._cache=new u}getLabelingDeconflictionInfo(e){const r=this.layer,t=p(r,e)??d(r),i=s(r,e),a=[...r.labelingInfo||[],...i?.labelingInfo||[]];return[{vvEvaluators:{0:c(r.renderer)},deconflictionEnabled:t,labelingInfo:a}]}async createSourceSchema(e,t){const s=this._createServiceInfo(e),o=null!=this.layer.editingInfo?.lastEditDate,l=this.layer.refreshInterval>0,n=!o&&l,y=m(s.isSourceHosted,n,this.layer.capabilities,s.metadata.geometryType,e.extent,this.layer.fullExtent),p=null!=this.layer.subtypeCode?`${this.layer.subtypeField} = ${this.layer.subtypeCode}`:null,d=r(this.layer.definitionExpression,p),c=i(d)?await a(this.layer.fieldsIndex,d,this.layer.capabilities.query.relativeTimeBinWindow):d;return h(s,y,{definitionExpression:c,postQueryFilter:d!==c?{where:d}:null,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const{fields:i,renderer:a,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:y,objectIdField:p,trackInfo:d}=this.layer,c={fields:i.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:s(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:y??"default",trackInfo:d};return f(e,r,c,t)}get hasRequiredSupport(){return g(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return l(this.layer,e,r)}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>s(this.layer,e),()=>n(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.subtypeCode,()=>this.layer.trackInfo]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a,editingInfo:s,typeIdField:l,globalIdField:n,datesInUnknownTimezone:p,dateFieldsTimeZone:d,orderBy:c,subtypeField:u}=i,m=i.fieldsIndex.toJSON(),h=y(i),f=i.timeInfo?.toJSON(),g=i.spatialReference.toJSON(),b=i.types?.map(e=>e.toJSON()),I=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(I.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let F=this.layer.objectIdField;if(c?.length){const e=!c[0].valueExpression&&c[0].field;e&&(F=e)}const S=t(I.path),x=r.spatialReference.toJSON();return{type:"feature-service",source:I,isSourceHosted:S,orderByFields:F,outSpatialReference:x,metadata:{typeIdField:l??void 0,types:b,timeReferenceUnknownClient:p,dateFieldsTimeZone:d,subtypeField:u,globalIdField:n,fieldsIndex:m,geometryType:h,featureIdInfo:o(i),timeInfo:f,spatialReference:g,outSpatialReference:x,subtypes:this.layer.subtypes?.map(e=>e.toJSON())},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:s?.lastEditDate?.getTime()}}}}export{b as FeatureLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{sqlAnd as r}from"../../../../../core/sql.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{canConvertSqlRelativeTime as i,sqlRelativeTimeToAbsolute as a}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{getEffectiveFeatureReduction as s}from"./featureReductionUtils.js";import{createFeatureIdInfo as o}from"./featureServiceUtils.js";import{addFloorFilter as l,hasFloorFilter as n}from"./floorFilterUtils.js";import{getServiceGeometryType as p}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as y,getLayerDeconflictionEnabled as d,createLabelVVEvaluator as u}from"./labelingUtils.js";import{ExceedsLimitCache as c}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as m,createFeatureSourceSchema as h}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as f}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as g}from"../support/rendererUtils.js";class b{constructor(e){this.layer=e,this._cache=new c}getLabelingDeconflictionInfo(e){const r=this.layer,t=y(r,e)??d(r),i=s(r,e),a=[...r.labelingInfo||[],...i?.labelingInfo||[]];return[{vvEvaluators:{0:u(r.renderer)},deconflictionEnabled:t,labelingInfo:a}]}async createSourceSchema(e,t){const s=this._createServiceInfo(e),o=null!=this.layer.editingInfo?.lastEditDate,l=this.layer.refreshInterval>0,n=!o&&l,p=m(s.isSourceHosted,n,this.layer.capabilities,s.metadata.geometryType,e.extent,this.layer.fullExtent),y=null!=this.layer.subtypeCode?`${this.layer.subtypeField} = ${this.layer.subtypeCode}`:null,d=r(this.layer.definitionExpression,y),u=i(d)?await a(this.layer.fieldsIndex,d,this.layer.capabilities.query.relativeTimeBinWindow):d,c=d!==u?{where:d}:null,{returnZ:f,returnM:g,gdbVersion:b,apiKey:I,historicMoment:F,timeExtent:S,customParameters:x,displayFilterInfo:R}=this.layer;return h(s,p,{definitionExpression:u,postQueryFilter:c,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:R,customParameters:x,gdbVersion:b,historicMoment:F,timeExtent:S,apiKey:I,sourceRefreshVersion:t,availableFields:e.availableFields,cache:this._cache,returnZ:f,returnM:g})}createProcessorSchema(e,r,t){const{fields:i,renderer:a,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:p,objectIdField:y,trackInfo:d}=this.layer,u={fields:i.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:s(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:y,orderBy:p??"default",trackInfo:d};return f(e,r,u,t)}get hasRequiredSupport(){return g(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return l(this.layer,e,r)}getUpdateHashProperties(e){return this.layer.destroyed?[]:[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>s(this.layer,e),()=>n(this.layer,e)?e.floors:null,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.subtypeCode,()=>this.layer.trackInfo]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a,editingInfo:s,typeIdField:l,globalIdField:n,datesInUnknownTimezone:y,dateFieldsTimeZone:d,orderBy:u,subtypeField:c}=i,m=i.fieldsIndex.toJSON(),h=p(i),{hasZ:f,hasM:g}=i,b=i.timeInfo?.toJSON(),I=i.spatialReference.toJSON(),F=i.types?.map(e=>e.toJSON()),S=e(this.layer.parsedUrl);this.layer.dynamicDataSource&&(S.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let x=this.layer.objectIdField;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(x=e)}const R=t(S.path),O=r.spatialReference.toJSON();return{type:"feature-service",source:S,isSourceHosted:R,orderByFields:x,outSpatialReference:O,metadata:{typeIdField:l??void 0,types:F,timeReferenceUnknownClient:y,dateFieldsTimeZone:d,subtypeField:c,globalIdField:n,fieldsIndex:m,geometryType:h,hasZ:f,hasM:g,featureIdInfo:o(i),timeInfo:b,spatialReference:I,outSpatialReference:O,subtypes:this.layer.subtypes?.map(e=>e.toJSON())},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:s?.lastEditDate?.getTime()}}}}export{b as FeatureLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as n,createLabelVVEvaluator as a}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";function c(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class d{constructor(e){this.layer=e,this._cache=new s}openMessagePorts(){return c(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(e){const r=this.layer,i=o(r,e)??n(r),s=t(r,e),l=[...r.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:a(r.renderer)},deconflictionEnabled:i,labelingInfo:l}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:"timeExtent"in this.layer?this.layer.timeExtent:null,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:o,renderer:n,geometryType:a,labelingInfo:s,labelsVisible:l,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:o.map(e=>e.toJSON()),renderer:n?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:a,labelingInfo:s,labelsVisible:l,objectIdField:c,orderBy:p??"default",trackInfo:d};return u(e,r,y,i)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return r(this.layer)?this.layer:null}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){"trackGraphicOrigin"in this.layer&&(e.origin=this.layer.trackGraphicOrigin)}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:o}=r,n=r.fieldsIndex.toJSON(),a=i(r),s="timeInfo"in r?r.timeInfo?.toJSON():null,l=r.spatialReference.toJSON();c(r.source);const u=o,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:u,outSpatialReference:p,metadata:{fieldsIndex:n,geometryType:a,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},timeInfo:s,spatialReference:l,outSpatialReference:p,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{d as InMemoryLayerAdapter};
2
+ import e from"../../../../../core/Error.js";import{hasTimeOptions as r}from"../../../../../layers/support/timeSupport.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as n,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as p}from"../support/rendererUtils.js";function c(r){if(!("openPorts"in r))throw new e("featurelayer:source-not-supported","source is not supported")}class d{constructor(e){this.layer=e,this._cache=new s}openMessagePorts(){return c(this.layer.source),this.layer.source.openPorts()}getLabelingDeconflictionInfo(e){const r=this.layer,i=n(r,e)??a(r),s=t(r,e),l=[...r.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:i,labelingInfo:l}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:"returnZ"in this.layer&&this.layer.returnZ,returnM:"returnM"in this.layer&&this.layer.returnM,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:"timeExtent"in this.layer?this.layer.timeExtent:null,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:n,renderer:a,geometryType:o,labelingInfo:s,labelsVisible:l,orderBy:p,objectIdField:c}=this.layer,d="trackInfo"in this.layer?this.layer.trackInfo:null,y={fields:n.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:s,labelsVisible:l,objectIdField:c,orderBy:p??"default",trackInfo:d};return u(e,r,y,i)}get hasRequiredSupport(){return p(this.layer.renderer)}get timeOptions(){return r(this.layer)?this.layer:null}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.displayFilterInfo,()=>this.layer.orderBy,()=>"outFields"in this.layer?this.layer.outFields:null,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>"trackInfo"in this.layer?this.layer.trackInfo:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){"trackGraphicOrigin"in this.layer&&(e.origin=this.layer.trackGraphicOrigin)}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:n}=r,a=r.fieldsIndex.toJSON(),o=i(r),s="timeInfo"in r?r.timeInfo?.toJSON():null,l=r.spatialReference.toJSON();c(r.source);const u=n,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:u,outSpatialReference:p,metadata:{fieldsIndex:a,geometryType:o,hasZ:"hasZ"in r&&r.hasZ,hasM:"hasM"in r&&r.hasM,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},timeInfo:s,spatialReference:l,outSpatialReference:p,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:"datesInUnknownTimezone"in r?r.datesInUnknownTimezone:null,dateFieldsTimeZone:"dateFieldsTimeZone"in r?r.dateFieldsTimeZone:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{d as InMemoryLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{getServiceGeometryType as o}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as a,getLayerDeconflictionEnabled as s,createLabelVVEvaluator as l}from"./labelingUtils.js";import{ExceedsLimitCache as n}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as p}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e,this._cache=new n}getLabelingDeconflictionInfo(e){const r=this.layer,t=a(r,e)??s(r);return[{vvEvaluators:{0:l(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return p(t,null,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:null,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,t){const{fields:o,renderer:a,geometryType:s,labelingInfo:l,labelsVisible:n,objectIdField:p}=this.layer,c={fields:o.map(e=>e.toJSON()),renderer:a?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:s,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:"default"};return u(e,r,c,t)}get hasRequiredSupport(){return c(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>i(this.layer,e),()=>y(this.layer)]}hasFilters(e){return y(this.layer)}addFilters(i,o){if(y(this.layer)){const o=e(i?.where,`${r}=1`);if(!o)return i;i??=new t,i.where=o}return i}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}openMessagePorts(){return this.layer.source.openPorts()}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:i}=r,a=r.fieldsIndex.toJSON(),s=o(r),l=r.spatialReference.toJSON(),n=i,p=e.spatialReference.toJSON();return{type:"memory",orderByFields:n,outSpatialReference:p,metadata:{fieldsIndex:a,geometryType:s,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:l,outSpatialReference:p,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}function y(e){return"link-chart"===e.parentCompositeLayer.type&&"hidden"===e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{d as KnowledgeGraphSublayerAdapter};
2
+ import{sqlAnd as e}from"../../../../../core/sql.js";import{systemIsSpatialFieldName as r}from"../../../../../layers/knowledgeGraph/constants.js";import t from"../../../../../layers/support/FeatureFilter.js";import{getEffectiveFeatureReduction as i}from"./featureReductionUtils.js";import{getServiceGeometryType as a}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as s,getLayerDeconflictionEnabled as o,createLabelVVEvaluator as l}from"./labelingUtils.js";import{ExceedsLimitCache as n}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as p}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as c}from"../support/rendererUtils.js";class d{constructor(e){this.layer=e,this._cache=new n}getLabelingDeconflictionInfo(e){const r=this.layer,t=s(r,e)??o(r);return[{vvEvaluators:{0:l(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return u(t,null,{definitionExpression:this.layer.definitionExpression,returnZ:null,returnM:null,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:null,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:null,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,t){const{fields:a,renderer:s,geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:u}=this.layer,c={fields:a.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:i(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:u,orderBy:"default"};return p(e,r,c,t)}get hasRequiredSupport(){return c(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>i(this.layer,e),()=>y(this.layer)]}hasFilters(e){return y(this.layer)}addFilters(i,a){if(y(this.layer)){const a=e(i?.where,`${r}=1`);if(!a)return i;i??=new t,i.where=a}return i}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}openMessagePorts(){return this.layer.source.openPorts()}_createServiceInfo(e){const r=this.layer,{capabilities:t,objectIdField:i}=r,s=r.fieldsIndex.toJSON(),o=a(r),l=r.spatialReference.toJSON(),n=i,u=e.spatialReference.toJSON();return{type:"memory",orderByFields:n,outSpatialReference:u,metadata:{fieldsIndex:s,geometryType:o,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:{type:"object-id",fieldName:r.objectIdField},spatialReference:l,outSpatialReference:u,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:r.timeInfo?.toJSON(),timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}function y(e){return"link-chart"===e.parentCompositeLayer.type&&"hidden"===e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode}export{d as KnowledgeGraphSublayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e,this._cache=new s}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??a(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t,labelingInfo:r.labelingInfo}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:null,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,t,i){const{fields:a,renderer:o,geometryType:s,labelingInfo:l,labelsVisible:u,orderBy:c,objectIdField:p}=this.layer,d={fields:a.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:r(this.layer,t),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:p,orderBy:c??"default"};return n(e,t,d,i)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>r(this.layer,e),()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.renderer]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a}=i,o=i.fieldsIndex.toJSON(),s=t(i),l=i.timeInfo?.toJSON(),n=i.spatialReference.toJSON(),u=i.source.getSource(),c=this.layer.objectIdField,p=e(a);p.query.maxRecordCount=u.maxRecordCount;const d=r.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:o,geometryType:s,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:l,spatialReference:n,outSpatialReference:d,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:p.query.maxRecordCount,tileMaxRecordCount:p.query.tileMaxRecordCount,supportsCompactGeometry:p.query.supportsCompactGeometry,supportsDefaultSpatialReference:p.query.supportsDefaultSpatialReference,supportsFormatPBF:p.query.supportsFormatPBF,supportsMaxRecordCountFactor:p.query.supportsMaxRecordCountFactor,supportsQuantization:p.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:p.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:p.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{c as OGCFeatureLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{getEffectiveFeatureReduction as r}from"./featureReductionUtils.js";import{getServiceGeometryType as t}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as i,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as o}from"./labelingUtils.js";import{ExceedsLimitCache as s}from"../schema/ExceedsLimitCache.js";import{createFeatureSourceSchema as l}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as u}from"../support/rendererUtils.js";class c{constructor(e){this.layer=e,this._cache=new s}getLabelingDeconflictionInfo(e){const r=this.layer,t=i(r,e)??a(r);return[{vvEvaluators:{0:o(r.renderer)},deconflictionEnabled:t,labelingInfo:r.labelingInfo}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e);return l(t,null,{definitionExpression:null,returnZ:null,returnM:!1,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:null,customParameters:this.layer.customParameters,gdbVersion:null,historicMoment:null,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,t,i){const{fields:a,renderer:o,geometryType:s,labelingInfo:l,labelsVisible:u,orderBy:c,objectIdField:p}=this.layer,d={fields:a.map(e=>e.toJSON()),renderer:o?.clone(),labelingInfoSource:this.layer.id,featureReduction:r(this.layer,t),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:p,orderBy:c??"default"};return n(e,t,d,i)}get hasRequiredSupport(){return u(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>r(this.layer,e),()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy,()=>this.layer.renderer]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(r){const i=this.layer,{capabilities:a}=i,o=i.fieldsIndex.toJSON(),s=t(i),l=i.timeInfo?.toJSON(),n=i.spatialReference.toJSON(),u=i.source.getSource(),c=this.layer.objectIdField,p=e(a);p.query.maxRecordCount=u.maxRecordCount;const d=r.spatialReference.toJSON();return{type:"ogc",source:u,orderByFields:c,outSpatialReference:d,metadata:{fieldsIndex:o,geometryType:s,hasZ:this.layer.hasZ??!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:l,spatialReference:n,outSpatialReference:d,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:p.query.maxRecordCount,tileMaxRecordCount:p.query.tileMaxRecordCount,supportsCompactGeometry:p.query.supportsCompactGeometry,supportsDefaultSpatialReference:p.query.supportsDefaultSpatialReference,supportsFormatPBF:p.query.supportsFormatPBF,supportsMaxRecordCountFactor:p.query.supportsMaxRecordCountFactor,supportsQuantization:p.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:p.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:p.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{c as OGCFeatureLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{addFloorFilter as i,hasFloorFilter as a}from"./floorFilterUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as n}from"./labelingUtils.js";import{ExceedsLimitCache as d}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as c}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as u}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as y}from"../support/rendererUtils.js";class m{constructor(e){this.layer=e,this._cache=new d}getLabelingDeconflictionInfo(e){const r=this.layer,t=o(r,e)??l(r);return[{vvEvaluators:{0:n(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=null!=this.layer.editingInfo?.lastEditDate,a=this.layer.refreshInterval>0,s=!i&&a,o=p(t.isSourceHosted,s,this.layer.capabilities,t.metadata.geometryType,e.extent,this.layer.fullExtent);return c(t,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:a,renderer:s,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:d,objectIdField:p}=this.layer,c={fields:a.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:d??"default"};return u(e,r,c,i)}get hasRequiredSupport(){return y(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return i(this.layer,e,r)}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.orderBy,()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>a(this.layer,e)?e.floors:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(t){const i=this.layer,{capabilities:a,globalIdField:o,orderBy:l}=i,n=i.fieldsIndex.toJSON(),d=s(i),p=i.timeInfo?.toJSON(),c=i.spatialReference.toJSON(),u=e(this.layer.parsedUrl);let y=this.layer.objectIdField;if(l?.length){const e=!l[0].valueExpression&&l[0].field;e&&(y=e)}const m=r(u.path),h=t.spatialReference.toJSON();return{type:"feature-service",source:u,isSourceHosted:m,orderByFields:y,outSpatialReference:h,metadata:{globalIdField:o,fieldsIndex:n,geometryType:d,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:p,spatialReference:c,outSpatialReference:h,timeReferenceUnknownClient:i.datesInUnknownTimezone,dateFieldsTimeZone:i.dateFieldsTimeZone,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{m as OrientedImageryLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{addFloorFilter as i,hasFloorFilter as a}from"./floorFilterUtils.js";import{getServiceGeometryType as s}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as o,getLayerDeconflictionEnabled as l,createLabelVVEvaluator as n}from"./labelingUtils.js";import{ExceedsLimitCache as d}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as p,createFeatureSourceSchema as u}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as c}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as y}from"../support/rendererUtils.js";class h{constructor(e){this.layer=e,this._cache=new d}getLabelingDeconflictionInfo(e){const r=this.layer,t=o(r,e)??l(r);return[{vvEvaluators:{0:n(r.renderer)},deconflictionEnabled:t}]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=null!=this.layer.editingInfo?.lastEditDate,a=this.layer.refreshInterval>0,s=!i&&a,o=p(t.isSourceHosted,s,this.layer.capabilities,t.metadata.geometryType,e.extent,this.layer.fullExtent);return u(t,o,{definitionExpression:this.layer.definitionExpression,queryScaleRanges:[],returnZ:this.layer.returnZ,returnM:this.layer.returnM,displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:this.layer.displayFilterInfo,customParameters:this.layer.customParameters,gdbVersion:this.layer.gdbVersion,historicMoment:this.layer.historicMoment,timeExtent:this.layer.timeExtent,apiKey:this.layer.apiKey,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache,postQueryFilter:null})}createProcessorSchema(e,r,i){const{fields:a,renderer:s,geometryType:o,labelingInfo:l,labelsVisible:n,orderBy:d,objectIdField:p}=this.layer,u={fields:a.map(e=>e.toJSON()),renderer:s?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:o,labelingInfo:l,labelsVisible:n,objectIdField:p,orderBy:d??"default"};return c(e,r,u,i)}get hasRequiredSupport(){return y(this.layer.renderer)}get timeOptions(){return this.layer}addFilters(e,r){return i(this.layer,e,r)}getUpdateHashProperties(e){return[()=>this.layer.outFields,()=>this.layer.orderBy,()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>a(this.layer,e)?e.floors:null]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(t){const i=this.layer,{capabilities:a,globalIdField:o,orderBy:l}=i,n=i.fieldsIndex.toJSON(),d=s(i),p=i.timeInfo?.toJSON(),u=i.spatialReference.toJSON(),c=e(this.layer.parsedUrl);let y=this.layer.objectIdField;if(l?.length){const e=!l[0].valueExpression&&l[0].field;e&&(y=e)}const h=r(c.path),m=t.spatialReference.toJSON();return{type:"feature-service",source:c,isSourceHosted:h,orderByFields:y,outSpatialReference:m,metadata:{globalIdField:o,fieldsIndex:n,geometryType:d,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:{type:"object-id",fieldName:i.objectIdField},timeInfo:p,spatialReference:u,outSpatialReference:m,timeReferenceUnknownClient:i.datesInUnknownTimezone,dateFieldsTimeZone:i.dateFieldsTimeZone,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:a.query.maxRecordCount,tileMaxRecordCount:a.query.tileMaxRecordCount,supportsCompactGeometry:a.query.supportsCompactGeometry,supportsDefaultSpatialReference:a.query.supportsDefaultSpatialReference,supportsFormatPBF:a.query.supportsFormatPBF,supportsMaxRecordCountFactor:a.query.supportsMaxRecordCountFactor,supportsQuantization:a.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:a.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:a.query.supportsDegeneratedQuantizedGeometry,lastEditDate:null}}}}export{h as OrientedImageryLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../../core/Error.js";import{toParquetJSONGeometryType as r}from"../../../../../layers/support/parquetUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as l,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as o}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}get hasRequiredSupport(){return o(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const r=this.layer,i=l(r,e)??a(r),n=t(r,e),o=[...r.labelingInfo||[],...n?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:i,labelingInfo:o}]}getUpdateHashProperties(e){return[()=>this.layer.urls.join(","),()=>this.layer.outFields,()=>this.layer.definitionExpression,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}openMessagePorts(){return this.layer.source.openPorts()}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=e.availableFields.includes("*")?this.layer.fields.map(e=>e.name):e.availableFields,l={partial:{urls:[...this.layer.urls.items],availableFields:i},full:{definitionExpression:this.layer.definitionExpression??null,sourceRefreshVersion:r,customParameters:this.layer.customParameters??null}};return{type:"parquet",service:t,strategy:this._createStrategy(t,l)}}_createStrategy(e,r){return e.geometryInfo.displayOptimization?{type:"xz",...r}:{type:"snapshot",...r}}createProcessorSchema(e,r,i){const l={fields:this.layer.fields.map(e=>e.toJSON()),renderer:this.layer.renderer?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return n(e,r,l,i)}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}_createServiceInfo(t){const l=i(this.layer),a=t.spatialReference.toJSON(),s=this.layer.geometryEncoding;if(null==s&&null==this.layer.displayOptimization)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",outSpatialReference:a,geometryInfo:{geometry:s?{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON()}:null,displayOptimization:this.layer.displayOptimization},metadata:{spatialReference:this.layer.spatialReference.toJSON(),outSpatialReference:a,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:l,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}}export{y as ParquetLayerAdapter};
2
+ import e from"../../../../../core/Error.js";import{toParquetJSONGeometryType as r}from"../../../../../layers/support/parquetUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as l,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as o}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}get hasRequiredSupport(){return o(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const r=this.layer,i=l(r,e)??a(r),n=t(r,e),o=[...r.labelingInfo||[],...n?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:i,labelingInfo:o}]}getUpdateHashProperties(e){return[()=>this.layer.urls.join(","),()=>this.layer.outFields,()=>this.layer.definitionExpression,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}openMessagePorts(){return this.layer.source.openPorts()}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=e.availableFields.includes("*")?this.layer.fields.map(e=>e.name):e.availableFields,l={partial:{urls:[...this.layer.urls.items],availableFields:i},full:{definitionExpression:this.layer.definitionExpression??null,sourceRefreshVersion:r,customParameters:this.layer.customParameters??null}};return{type:"parquet",service:t,strategy:this._createStrategy(t,l)}}_createStrategy(e,r){return e.geometryInfo.displayOptimization?{type:"xz",...r}:{type:"snapshot",...r}}createProcessorSchema(e,r,i){const l={fields:this.layer.fields.map(e=>e.toJSON()),renderer:this.layer.renderer?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return n(e,r,l,i)}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}_createServiceInfo(t){const l=i(this.layer),a=t.spatialReference.toJSON(),s=this.layer.geometryEncoding;if(null==s&&null==this.layer.displayOptimization)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",outSpatialReference:a,geometryInfo:{geometry:s?{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON()}:null,displayOptimization:this.layer.displayOptimization},metadata:{spatialReference:this.layer.spatialReference.toJSON(),outSpatialReference:a,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:l,hasZ:!1,hasM:!1,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}}export{y as ParquetLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as t,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as l}from"./labelingUtils.js";import{createSimpleProcessorSchema as a}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class s{constructor(e){this.layer=e}getLabelingDeconflictionInfo(r){const a=this.layer,n=t(a,r)??i(a),s=e(a,r),o=[...a.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:l(a.renderer)},deconflictionEnabled:n,labelingInfo:o}]}async createSourceSchema(e,r){return{type:"stream",service:this._createServiceInfo(e),strategy:{type:"stream",partial:{sourceRefreshVersion:r},full:{availableFields:e.availableFields,geometryDefinition:this.layer.geometryDefinition?.toJSON(),definitionExpression:this.layer.definitionExpression,customParameters:this.layer.customParameters,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(r,t,i){const{fields:l,renderer:n,geometryType:s,labelingInfo:o,labelsVisible:c,objectIdField:y,trackInfo:p}=this.layer,f={fields:l.map(e=>e.toJSON()),renderer:n?.clone(),labelingInfoSource:this.layer.id,featureReduction:e(this.layer,t),geometryType:s,labelingInfo:o,labelsVisible:c,objectIdField:y,orderBy:"default",trackInfo:p};return a(r,t,f,i)}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(r){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>e(this.layer,r),()=>this.layer.customParameters,()=>this.layer.geometryDefinition,()=>this.layer.definitionExpression,()=>this.layer.trackInfo]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(e){const t=r(this.layer),i=this.layer.timeInfo?.toJSON()||null,l=this.layer.spatialReference?this.layer.spatialReference.toJSON():null,a=e.spatialReference.toJSON();return{type:"stream",source:this.layer.parsedUrl,outSpatialReference:a,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:t,featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},timeInfo:i,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,spatialReference:l,outSpatialReference:a,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}}export{s as StreamLayerAdapter};
2
+ import{getEffectiveFeatureReduction as e}from"./featureReductionUtils.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as t,getLayerDeconflictionEnabled as i,createLabelVVEvaluator as a}from"./labelingUtils.js";import{createSimpleProcessorSchema as l}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class s{constructor(e){this.layer=e}getLabelingDeconflictionInfo(r){const l=this.layer,n=t(l,r)??i(l),s=e(l,r),o=[...l.labelingInfo||[],...s?.labelingInfo||[]];return[{vvEvaluators:{0:a(l.renderer)},deconflictionEnabled:n,labelingInfo:o}]}async createSourceSchema(e,r){return{type:"stream",service:this._createServiceInfo(e),strategy:{type:"stream",partial:{sourceRefreshVersion:r},full:{availableFields:e.availableFields,geometryDefinition:this.layer.geometryDefinition?.toJSON(),definitionExpression:this.layer.definitionExpression,customParameters:this.layer.customParameters,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(r,t,i){const{fields:a,renderer:n,geometryType:s,labelingInfo:o,labelsVisible:c,objectIdField:y,trackInfo:p}=this.layer,f={fields:a.map(e=>e.toJSON()),renderer:n?.clone(),labelingInfoSource:this.layer.id,featureReduction:e(this.layer,t),geometryType:s,labelingInfo:o,labelsVisible:c,objectIdField:y,orderBy:"default",trackInfo:p};return l(r,t,f,i)}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(r){return[()=>this.layer.definitionExpression,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>e(this.layer,r),()=>this.layer.customParameters,()=>this.layer.geometryDefinition,()=>this.layer.definitionExpression,()=>this.layer.trackInfo]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}setTrackGraphicOrigin(e){e.origin=this.layer.trackGraphicOrigin}_createServiceInfo(e){const t=r(this.layer),i=this.layer.timeInfo?.toJSON()||null,a=this.layer.spatialReference?this.layer.spatialReference.toJSON():null,l=e.spatialReference.toJSON();return{type:"stream",source:this.layer.parsedUrl,outSpatialReference:l,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:t,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},timeInfo:i,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,spatialReference:a,outSpatialReference:l,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}}export{s as StreamLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as r}from"../../../../../core/mathUtils.js";import{sqlAnd as t}from"../../../../../core/sql.js";import{isHostedAgolService as i}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as s,sqlRelativeTimeToAbsolute as l}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{createFeatureIdInfo as o}from"./featureServiceUtils.js";import{addFloorFilter as n,hasFloorFilter as u}from"./floorFilterUtils.js";import{getServiceGeometryType as y}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as p}from"./labelingUtils.js";import{ExceedsLimitCache as c}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as m,createFeatureSourceSchema as d}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as f}from"../schema/processor/SubtypeProcessorSchema.js";class h{constructor(e){this.layer=e,this._cache=new c}getLabelingDeconflictionInfo(e){const r=this.layer;return[{vvEvaluators:{},deconflictionEnabled:r.sublayers.some(e=>p(e)),labelingInfo:r.sublayers.toArray().filter(e=>!!e.labelingInfo).flatMap(e=>e.labelingInfo)}]}async createSourceSchema(e,r){const{definitionExpression:t,customParameters:i,gdbVersion:a,historicMoment:o,timeExtent:n,apiKey:u,displayFilterInfo:y}=this.layer,p=this._createServiceInfo(e),c=null!=this.layer.editingInfo?.lastEditDate,f=this.layer.refreshInterval>0,h=!c&&f,b=m(p.isSourceHosted,h,this.layer.capabilities,p.metadata.geometryType,e.extent,this.layer.fullExtent),g=s(t)?await l(this.layer.fieldsIndex,t,this.layer.capabilities.query.relativeTimeBinWindow):t;return d(p,b,{definitionExpression:g,postQueryFilter:t!==g?{where:t}:null,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:y,customParameters:i,gdbVersion:a,historicMoment:o,timeExtent:n,apiKey:u,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const i={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,r)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${r}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return f(e,r,i,t)}addFilters(e,r){e=n(this.layer,e,r);const i=this.layer.sublayers.filter(e=>!b(e,r)).map(e=>e.subtypeCode);if(!i.length)return e;e??=new a;const s=`NOT ${this.layer.subtypeField} IN (${i.join(",")})`;return e.where=t(e.where,s),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>u(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.sublayers.map(({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:a,maxScale:s})=>({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:a,maxScale:s}))]}setGraphicOrigin(e){const r=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=r,e.origin=r?.graphicOrigin}_createServiceInfo(r){const{capabilities:t,datesInUnknownTimezone:a,dateFieldsTimeZone:s,editingInfo:l,globalIdField:n,objectIdField:u,subtypeField:p}=this.layer,c=this.layer.fieldsIndex.toJSON(),m=y(this.layer),d=this.layer.timeInfo?.toJSON(),f=this.layer.spatialReference.toJSON(),h=e(this.layer.parsedUrl),b=u,g=i(h.path),S=r.spatialReference.toJSON();return{type:"feature-service",source:h,isSourceHosted:g,orderByFields:b,outSpatialReference:S,metadata:{timeReferenceUnknownClient:a,dateFieldsTimeZone:s,subtypeField:p,globalIdField:n,fieldsIndex:c,geometryType:m,featureIdInfo:o(this.layer),timeInfo:d,spatialReference:f,outSpatialReference:S,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:l?.lastEditDate?.getTime()}}}}function b(e,t){return e.visible&&(0===e.minScale||r(t.scale,e.minScale)||t.scale<e.minScale)&&(0===e.maxScale||r(t.scale,e.maxScale)||t.scale>e.maxScale)}export{h as SubtypeGroupLayerAdapter};
2
+ import{clone as e}from"../../../../../core/lang.js";import{floatEqualAbsolute as r}from"../../../../../core/mathUtils.js";import{sqlAnd as t}from"../../../../../core/sql.js";import{isHostedAgolService as i}from"../../../../../layers/support/arcgisLayerUrl.js";import a from"../../../../../layers/support/FeatureFilter.js";import{canConvertSqlRelativeTime as s,sqlRelativeTimeToAbsolute as l}from"../../../../../layers/support/relativeTimeQueryUtils.js";import{createFeatureIdInfo as o}from"./featureServiceUtils.js";import{addFloorFilter as n,hasFloorFilter as u}from"./floorFilterUtils.js";import{getServiceGeometryType as y}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as p}from"./labelingUtils.js";import{ExceedsLimitCache as c}from"../schema/ExceedsLimitCache.js";import{createSnapshotInfo as m,createFeatureSourceSchema as d}from"../schema/SourceSchema.js";import{createSubtypeProcessorSchema as h}from"../schema/processor/SubtypeProcessorSchema.js";class f{constructor(e){this.layer=e,this._cache=new c}getLabelingDeconflictionInfo(e){const r=this.layer;return[{vvEvaluators:{},deconflictionEnabled:r.sublayers.some(e=>p(e)),labelingInfo:r.sublayers.toArray().filter(e=>!!e.labelingInfo).flatMap(e=>e.labelingInfo)}]}async createSourceSchema(e,r){const{definitionExpression:t,customParameters:i,gdbVersion:a,historicMoment:o,timeExtent:n,apiKey:u,displayFilterInfo:y}=this.layer,p=this._createServiceInfo(e),c=null!=this.layer.editingInfo?.lastEditDate,h=this.layer.refreshInterval>0,f=!c&&h,b=m(p.isSourceHosted,f,this.layer.capabilities,p.metadata.geometryType,e.extent,this.layer.fullExtent),g=s(t)?await l(this.layer.fieldsIndex,t,this.layer.capabilities.query.relativeTimeBinWindow):t,S=t!==g?{where:t}:null;return d(p,b,{definitionExpression:g,returnZ:this.layer.returnZ,returnM:this.layer.returnM,postQueryFilter:S,queryScaleRanges:this.layer.sublayers.items.map(e=>({subtypeCode:e.subtypeCode,minScale:e.minScale,maxScale:e.maxScale})),displayFilterEnabled:e.displayFilterEnabled,displayFilterInfo:y,customParameters:i,gdbVersion:a,historicMoment:o,timeExtent:n,apiKey:u,sourceRefreshVersion:r,availableFields:e.availableFields,cache:this._cache})}createProcessorSchema(e,r,t){const i={labelingInfoSource:this.layer.id,subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,(e,r)=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfoSource:this.layer.id+`-${r}`,labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible,renderer:e.renderer,subtypeCode:e.subtypeCode,orderBy:null}))};return h(e,r,i,t)}addFilters(e,r){e=n(this.layer,e,r);const i=this.layer.sublayers.filter(e=>!b(e,r)).map(e=>e.subtypeCode);if(!i.length)return e;e??=new a;const s=`NOT ${this.layer.subtypeField} IN (${i.join(",")})`;return e.where=t(e.where,s),e}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>u(this.layer,e)?e.floors:null,()=>this.layer.outFields,()=>this.layer.gdbVersion,()=>this.layer.historicMoment,()=>this.layer.sublayers.map(({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:a,maxScale:s})=>({renderer:e,labelsVisible:r,labelingInfo:t,visible:i,minScale:a,maxScale:s}))]}setGraphicOrigin(e){const r=this.layer.findSublayerForFeature(e);e.layer=e.sourceLayer=r,e.origin=r?.graphicOrigin}_createServiceInfo(r){const{capabilities:t,datesInUnknownTimezone:a,dateFieldsTimeZone:s,editingInfo:l,globalIdField:n,objectIdField:u,subtypeField:p}=this.layer,c=this.layer.fieldsIndex.toJSON(),m=y(this.layer),d=this.layer.timeInfo?.toJSON(),h=this.layer.spatialReference.toJSON(),f=e(this.layer.parsedUrl),b=u,g=i(f.path),S=r.spatialReference.toJSON();return{type:"feature-service",source:f,isSourceHosted:g,orderByFields:b,outSpatialReference:S,metadata:{timeReferenceUnknownClient:a,dateFieldsTimeZone:s,subtypeField:p,globalIdField:n,fieldsIndex:c,geometryType:m,hasZ:this.layer.hasZ,hasM:this.layer.hasM,featureIdInfo:o(this.layer),timeInfo:d,spatialReference:h,outSpatialReference:S,subtypes:this.layer.subtypes?.map(e=>e.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:t.query.maxRecordCount,tileMaxRecordCount:t.query.tileMaxRecordCount,supportsCompactGeometry:t.query.supportsCompactGeometry,supportsDefaultSpatialReference:t.query.supportsDefaultSpatialReference,supportsFormatPBF:t.query.supportsFormatPBF,supportsMaxRecordCountFactor:t.query.supportsMaxRecordCountFactor,supportsQuantization:t.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:t.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:t.query.supportsDegeneratedQuantizedGeometry,lastEditDate:l?.lastEditDate?.getTime()}}}}function b(e,t){return e.visible&&(0===e.minScale||r(t.scale,e.minScale)||t.scale<e.minScale)&&(0===e.maxScale||r(t.scale,e.maxScale)||t.scale>e.maxScale)}export{f as SubtypeGroupLayerAdapter};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../../geometry/SpatialReference.js";import{convertToFeature as t,unquantizeOptimizedGeometryInPlace as s}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as a}from"../../../../../layers/graphics/OptimizedFeature.js";import{checkProjectionSupport as r}from"../../../../../layers/graphics/data/projectionSupport.js";import i from"../../../../../layers/support/FieldsIndex.js";import{ComputedAggregateField as o}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as n}from"./AAggregateStrategy.js";import{ASendState as l}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as d,FeatureTileUpdateMessage as c}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as u}from"../support/ComputedAttributeStorage.js";import f from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as p}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as h}from"../support/FeatureSetReaderJSON.js";import m from"../../../tiling/TileKey.js";class g extends l{constructor(e,t){super(e),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=t}reset(){this.destroy(),this.done=!1}destroy(){const e=this.subscription.tile.key.level;for(const t of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${t}.${e}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const e of this.featureCache.values()){const t=e.clone();t.geometry&&s(t.geometry,this.subscription.tile.transform),yield t}}}class y extends n{static async create(t,s,a,i,n){const l=s.metadata.outSpatialReference,d=new u({spatialReference:l}),c=await Promise.all(t.fields.map(async e=>o.create(d,e))),p=t.featureFilter?await f.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:l,filterJSON:t.featureFilter}):null;return"geohash"===t.index.type&&await r(l,e.WGS84),new y(t,p,i,c,l,s,a,n)}constructor(e,t,s,a,r,o,n,l){super(o,n,r,a,l),this._schema=e,this._featureFilter=t,this._arcadeContextInfo=s,this._metadata=p.createFeature({geometryType:"esriGeometryPolygon",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new i(e.fields).toJSON(),globalIdField:null,spatialReference:o.metadata.spatialReference,outSpatialReference:o.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}createState(e){return new g(e,this._attributeStore)}async*applyOverrideUpdate(e){for(const t of this._sendStates.values()){t.reset();const e=new d(t.subscription,h.empty(this._source.metadata),!0,!1,{});yield e}}displayMap(e,t,s){const a=new Map(e.map(e=>[t(e),e])),r=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace()){const{objectId:t,displayId:i}=e,o=a.get(t);if(null!=o){const e=s(i,o,t);r.push(e),a.delete(t)}}return r}getDisplayFeatures(e){const s=new Set(e),a=new Set,r=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace())s.has(e.displayId)&&!a.has(e.objectId)&&(e.geometry&&r.push({...t(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),a.add(e.objectId));return{features:[],aggregates:r,tracks:[]}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.containedObjectIds);return[]}async*updateChunks(){for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){const t=new Set;for(const s of this._sendStates.values())for(const a of s.featuresWorldSpace())t.has(a.objectId)||(e(a),t.add(a.objectId))}_createIndexOptions(e){switch(this._schema.index.type){case"geohash":return{type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:e.scale,sqlOptions:this._sqlOptions};case"grid":{const t=this._schema.index.fixedBinLevel,s=null!=t?e.tileInfoView.getLODInfoAt(t).scale:e.scale;return{type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:s,sqlOptions:this._sqlOptions}}}}async*_update(e,t){const{handledChunks:s,subscription:r,bins:i,featureCache:o}=e,n=r.tile;if(e.done)return;for(const a of t.chunks()){if(s.has(a.chunkId))continue;s.add(a.chunkId);const t=a.queryInfo;if("tileId"in t){const e=new m(t.tileId);if(e.level!==n.level||e.world!==n.key.world)continue}a.getAggregateIndex(this._createIndexOptions(e.tile)).putBounded(i,e.tile.extent,e.tile.resolution)}const l=[],d=r.tile.transform,u=r.tile.key.level;for(const c of i.values()){let e=o.get(c.id);if(e)e.attributes=c.getAttributes();else{const t=c.getGeometry(this.spatialReference,d);e=new a(t,c.getAttributes(),null,c.id),t||(e.centroid=c.getGeometricCentroid(this.spatialReference,d)),e.displayId=this._attributeStore.createDisplayIdForObjectId(`${e.objectId}.${u}`),o.set(c.id,e)}l.push(e)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const f=h.fromOptimizedFeatures(l,this._metadata,d),p=f.getCursor(),g=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo);for(;p.next();)this._attributeStore.setAttributeData(p.getDisplayId(),p,g,this._sqlOptions);const y=new c(e.subscription,f,[],e.done,{});yield y}}export{g as BinningState,y as BinningStrategy};
2
+ import e from"../../../../../geometry/SpatialReference.js";import{convertToFeature as t,unquantizeOptimizedGeometryInPlace as s}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as a}from"../../../../../layers/graphics/OptimizedFeature.js";import{checkProjectionSupport as r}from"../../../../../layers/graphics/data/projectionSupport.js";import i from"../../../../../layers/support/FieldsIndex.js";import{ComputedAggregateField as o}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as n}from"./AAggregateStrategy.js";import{ASendState as l}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as d,FeatureTileUpdateMessage as c}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as u}from"../support/ComputedAttributeStorage.js";import f from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as p}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as h}from"../support/FeatureSetReaderJSON.js";import m from"../../../tiling/TileKey.js";class g extends l{constructor(e,t){super(e),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=t}reset(){this.destroy(),this.done=!1}destroy(){const e=this.subscription.tile.key.level;for(const t of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${t}.${e}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const e of this.featureCache.values()){const t=e.clone();t.geometry&&s(t.geometry,this.subscription.tile.transform),yield t}}}class y extends n{static async create(t,s,a,i,n){const l=s.metadata.outSpatialReference,d=new u({spatialReference:l}),c=await Promise.all(t.fields.map(async e=>o.create(d,e))),p=t.featureFilter?await f.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:l,filterJSON:t.featureFilter}):null;return"geohash"===t.index.type&&await r(l,e.WGS84),new y(t,p,i,c,l,s,a,n)}constructor(e,t,s,a,r,o,n,l){super(o,n,r,a,l),this._schema=e,this._featureFilter=t,this._arcadeContextInfo=s,this._metadata=p.createFeature({geometryType:"esriGeometryPolygon",hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new i(e.fields).toJSON(),globalIdField:null,spatialReference:o.metadata.spatialReference,outSpatialReference:o.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}createState(e){return new g(e,this._attributeStore)}async*applyOverrideUpdate(e){for(const t of this._sendStates.values()){t.reset();const e=new d(t.subscription,h.empty(this._source.metadata),!0,!1,{});yield e}}displayMap(e,t,s){const a=new Map(e.map(e=>[t(e),e])),r=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace()){const{objectId:t,displayId:i}=e,o=a.get(t);if(null!=o){const e=s(i,o,t);r.push(e),a.delete(t)}}return r}getDisplayFeatures(e){const s=new Set(e),a=new Set,r=[];for(const i of this._sendStates.values())for(const e of i.featuresWorldSpace())s.has(e.displayId)&&!a.has(e.objectId)&&(e.geometry&&r.push({...t(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),a.add(e.objectId));return{features:[],aggregates:r,tracks:[]}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.containedObjectIds);return[]}async*updateChunks(){for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){const t=new Set;for(const s of this._sendStates.values())for(const a of s.featuresWorldSpace())t.has(a.objectId)||(e(a),t.add(a.objectId))}_createIndexOptions(e){switch(this._schema.index.type){case"geohash":return{type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:e.scale,sqlOptions:this._sqlOptions};case"grid":{const t=this._schema.index.fixedBinLevel,s=null!=t?e.tileInfoView.getLODInfoAt(t).scale:e.scale;return{type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,arcadeContextInfo:this._arcadeContextInfo,scale:s,sqlOptions:this._sqlOptions}}}}async*_update(e,t){const{handledChunks:s,subscription:r,bins:i,featureCache:o}=e,n=r.tile;if(e.done)return;for(const a of t.chunks()){if(s.has(a.chunkId))continue;s.add(a.chunkId);const t=a.queryInfo;if("tileId"in t){const e=new m(t.tileId);if(e.level!==n.level||e.world!==n.key.world)continue}a.getAggregateIndex(this._createIndexOptions(e.tile)).putBounded(i,e.tile.extent,e.tile.resolution)}const l=[],d=r.tile.transform,u=r.tile.key.level;for(const c of i.values()){let e=o.get(c.id);if(e)e.attributes=c.getAttributes();else{const t=c.getGeometry(this.spatialReference,d);e=new a(t,c.getAttributes(),null,c.id),t||(e.centroid=c.getGeometricCentroid(this.spatialReference,d)),e.displayId=this._attributeStore.createDisplayIdForObjectId(`${e.objectId}.${u}`),o.set(c.id,e)}l.push(e)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const f=h.fromOptimizedFeatures(l,this._metadata,d),p=f.getCursor(),g=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo);for(;p.next();)this._attributeStore.setAttributeData(p.getDisplayId(),p,g,this._sqlOptions);const y=new c(e.subscription,f,[],e.done,{});yield y}}export{g as BinningState,y as BinningStrategy};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{convertToFeature as e}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as t}from"../../../../../layers/graphics/OptimizedFeature.js";import s from"../../../../../layers/graphics/OptimizedGeometry.js";import i from"../../../../../layers/support/FieldsIndex.js";import{tileSize as r}from"../../../engine/webgl/definitions.js";import{ComputedAggregateField as n}from"../aggregation/ComputedAggregateField.js";import{GridCell as a}from"../aggregation/GridCell.js";import{pixelsPerMapUnit as l}from"../aggregation/GridSpatialIndex.js";import{AAggregateStrategy as o}from"./AAggregateStrategy.js";import{ASendState as d}from"./AProcessorStrategy.js";import{WithDisplayId as u}from"./support/WithDisplayId.js";import{FeatureTileAppendMessage as c}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as h}from"../support/ComputedAttributeStorage.js";import p from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as f}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as g}from"../support/FeatureSetReaderJSON.js";import _ from"../../../tiling/TileKey.js";const m=128;class y extends d{constructor(e){super(e),this.didSend=!1,this.done=!1}}class S{constructor(e,t,s,i,r){this._level=e,this._scale=t,this._indexOptions=s,this._clusterRadius=i,this._store=r,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const s=e.inner.getCentroid(null),i=new t(s,e.inner.getAttributes(),null,e.inner.id,e.displayId);yield i}}clusters(){return this._clusters.values()}updateChunks(e,t){let s=!1;for(const a of e){const e=a.queryInfo;if("tileId"in e){if(new _(e.tileId).level!==this._level)continue}if(!this._handledChunks.has(a.normalizedChunkId)){this._handledChunks.add(a.normalizedChunkId),s=!0;a.getAggregateIndex({...this._indexOptions,scale:this._scale}).put(this._cells)}}const i={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},r=l(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:a}of t){const e=a.tile.bounds,t=Math.floor(e[0]*r/n),s=Math.floor(e[1]*r/n),l=Math.ceil(e[2]*r/n),o=Math.ceil(e[3]*r/n);i.xMin=Math.min(i.xMin,t),i.yMin=Math.min(i.yMin,s),i.xMax=Math.max(i.xMax,l),i.yMax=Math.max(i.yMax,o)}return null!=this._lastCellBounds&&i.xMin===this._lastCellBounds.xMin&&i.yMin===this._lastCellBounds.yMin&&i.yMin===this._lastCellBounds.yMin&&i.yMax===this._lastCellBounds.yMax||(s=!0,this._lastCellBounds=i),s&&this._clusterCells(i),s}async updateStatistics(e){let t=!1;for(const s of this._clusters.values())s.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,s.inner)||t);if(t){const t=Array.from(this._statistics.entries()).map(([e,t])=>({fieldName:e,minValue:t.minValue,maxValue:t.maxValue}));await e.container.updateStatistics(this._level,t)}}createAggregateFeatures(e,i){const n=e.subscription,a=[],l=n.tile.transform;for(const o of this._clusters.values()){let e=o.inner.getCentroidX(l);const i=o.inner.getCentroidY(l),d=n.tile.lod,u=d.wrap?d.worldSize[0]:null,c=1===o.inner.count?o.inner.firstObjectId:o.inner.id,h=o.displayId;if(null!=u)if(1===u){const n=new s([],[e,i]),l=new t(n,o.inner.getAttributes(),null,c,h);l.geometry.coords[0]-=r,a.push(l);const d=new s([],[e,i]),u=new t(d,o.inner.getAttributes(),null,c,h);u.geometry.coords[0]+=r,a.push(u)}else e>r+r/2?e-=u*r:e<-256&&(e+=u*r);if(e<r+m&&e>=-m&&i<r+m&&i>=-m){const r=new s([],[e,i]),n=new t(r,o.inner.getAttributes(),null,c,h);a.push(n)}}return g.fromOptimizedFeatures(a,i,n.tile.transform)}_clusterCells(e){let t=Array.from(this._cells.values());t=t.sort((e,t)=>t.count-e.count);const s=[];for(const a of this._clusters.values())s.push(a.inner.id);this._clusters.clear();const i=this._clusterRadius*(1/l(this._indexOptions.spatialReference,this._scale)),r=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const l of t){if(n.has(l.id))continue;if(l.gridX<e.xMin||l.gridX>e.xMax||l.gridY<e.yMin||l.gridY>e.yMax)continue;const t=this._store.createDisplayIdForObjectId(l.id),s=new u(l.clone(),t);n.add(l.id),this._clusters.set(l.id,s);const o=l.centroidXWorld,d=l.centroidYWorld;for(let e=l.gridY-r;e<=l.gridY+r;e++)for(let t=l.gridX-r;t<=l.gridX+r;t++){if(e===l.gridY&&t===l.gridX)continue;const r=this._cells.get(a.createId(t,e));if(!r||n.has(r.id))continue;const u=Math.abs(r.centroidXWorld-o),c=Math.abs(r.centroidYWorld-d);u<i&&c<i&&(s.inner.merge(r),n.add(r.id))}}for(const a of s)this._store.releaseDisplayIdForObjectId(a)}_updateAggregateStatistics(e,t){let s=!1;for(const i of t.statistics.values()){if("esriFieldTypeString"===i.field.type)continue;const t=i.value,r=i.field,n=e.get(r.name);if(n){const{minValue:e,maxValue:i}=n,r=Math.min(n.minValue,t),a=Math.max(n.maxValue,t);e===r&&i===a||(n.minValue=r,n.maxValue=a,s=!0);continue}e.set(r.name,{minValue:t,maxValue:t}),s=!0}return s}}class x extends o{static async create(e,t,s,i,r,a,l,o){const d=s.metadata.outSpatialReference,u=new h({spatialReference:d}),c={type:"grid",fields:await Promise.all(t.fields.map(async e=>n.create(u,e))),spatialReference:d,featureFilter:t.featureFilter?await p.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:d,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,arcadeContextInfo:r,sqlOptions:a};return new x(e,t.clusterRadius,c,t.fields,s,i,a,l,o)}constructor(e,t,s,r,n,a,l,o,d){super(n,a,s.spatialReference,s.fields,l),this._connection=e,this._clusterRadius=t,this._indexOptions=s,this._requiredLevel=o,this._requiredScale=d,this._cellsPerScale=new Map,this._metadata=f.createFeature({geometryType:"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new i([...r,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:n.metadata.spatialReference,outSpatialReference:n.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}updateRequiredLevel(e,t){this._requiredLevel=e,this._requiredScale=t}createState(e){return new y(e)}async*applyOverrideUpdate(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,s){const i=new Map(e.map(e=>[t(e),e])),r=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const a of n.clusters()){const e=i.get(a.inner.id);if(null!=e){const t=s(a.displayId,e,a.inner.id);r.push(t),i.delete(a.inner.id);continue}if(1===a.inner.count){const{firstObjectId:e}=a.inner,t=e?i.get(e):null;if(null!=t){const n=s(a.displayId,t,e);r.push(n),i.delete(e)}}}return r}getDisplayFeatures(t){const s=new Set(t),i=new Set,r=[],n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const l of a.aggregatesWorldSpace())if(s.has(l.displayId)&&!i.has(l.displayId)){const t=e(l,this._metadata.geometryType,!1,!1);if(i.add(l.displayId),1===t.attributes.cluster_count){r.push({...t,displayId:l.displayId});continue}n.push({...t,displayId:l.displayId})}return{features:r,aggregates:n,tracks:[]}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.clusters())if(s.inner.id===e)return Array.from(s.inner.containedObjectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale),s=Array.from(this._sendStates.values()).filter(e=>e.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,s)||!this._source.updateTracking.updating)for(const n of s)n.subscription.tile.level===this._requiredLevel&&(n.didSend=!1,n.done=!1);const i=Array.from(this._sendStates.values()).filter(e=>e.done).map(e=>e.subscription.tile.key),r=new Set(i);for(const n of this._sendStates.values()){if(this._source.updateTracking.updating){if(i.some(e=>e.containsChild(n.subscription.tile.key)))continue;if(n.subscription.tile.key.getChildKeys().every(e=>r.has(e)))continue}n.didSend||n.subscription.tile.level!==this._requiredLevel||(n.didSend=!0,yield*this._update(n,t,this._source))}await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(null==this._requiredLevel||null==this._requiredScale)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.aggregatesWorldSpace())e(s)}_getClusterState(e,t){if(null==e||null==t)throw new Error("InternalError: Level and scale must be defined");let s=this._cellsPerScale.get(t);return s||(s=new S(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,s)),s}async*_update(e,t,s){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!s.updateTracking.updating;const r=i.getCursor(),n=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.arcadeContextInfo);for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,n,this._sqlOptions);const a=new c(e.subscription,i,!0,e.done,{});yield a}}export{y as ClusterState,x as ClusterStrategy};
2
+ import{convertToFeature as e}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as t}from"../../../../../layers/graphics/OptimizedFeature.js";import s from"../../../../../layers/graphics/OptimizedGeometry.js";import i from"../../../../../layers/support/FieldsIndex.js";import{tileSize as r}from"../../../engine/webgl/definitions.js";import{ComputedAggregateField as n}from"../aggregation/ComputedAggregateField.js";import{GridCell as a}from"../aggregation/GridCell.js";import{pixelsPerMapUnit as l}from"../aggregation/GridSpatialIndex.js";import{AAggregateStrategy as o}from"./AAggregateStrategy.js";import{ASendState as d}from"./AProcessorStrategy.js";import{WithDisplayId as u}from"./support/WithDisplayId.js";import{FeatureTileAppendMessage as c}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as h}from"../support/ComputedAttributeStorage.js";import p from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as f}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as g}from"../support/FeatureSetReaderJSON.js";import _ from"../../../tiling/TileKey.js";const m=128;class y extends d{constructor(e){super(e),this.didSend=!1,this.done=!1}}class S{constructor(e,t,s,i,r){this._level=e,this._scale=t,this._indexOptions=s,this._clusterRadius=i,this._store=r,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const s=e.inner.getCentroid(null),i=new t(s,e.inner.getAttributes(),null,e.inner.id,e.displayId);yield i}}clusters(){return this._clusters.values()}updateChunks(e,t){let s=!1;for(const a of e){const e=a.queryInfo;if("tileId"in e){if(new _(e.tileId).level!==this._level)continue}if(!this._handledChunks.has(a.normalizedChunkId)){this._handledChunks.add(a.normalizedChunkId),s=!0;a.getAggregateIndex({...this._indexOptions,scale:this._scale}).put(this._cells)}}const i={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},r=l(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:a}of t){const e=a.tile.bounds,t=Math.floor(e[0]*r/n),s=Math.floor(e[1]*r/n),l=Math.ceil(e[2]*r/n),o=Math.ceil(e[3]*r/n);i.xMin=Math.min(i.xMin,t),i.yMin=Math.min(i.yMin,s),i.xMax=Math.max(i.xMax,l),i.yMax=Math.max(i.yMax,o)}return null!=this._lastCellBounds&&i.xMin===this._lastCellBounds.xMin&&i.yMin===this._lastCellBounds.yMin&&i.yMin===this._lastCellBounds.yMin&&i.yMax===this._lastCellBounds.yMax||(s=!0,this._lastCellBounds=i),s&&this._clusterCells(i),s}async updateStatistics(e){let t=!1;for(const s of this._clusters.values())s.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,s.inner)||t);if(t){const t=Array.from(this._statistics.entries()).map(([e,t])=>({fieldName:e,minValue:t.minValue,maxValue:t.maxValue}));await e.container.updateStatistics(this._level,t)}}createAggregateFeatures(e,i){const n=e.subscription,a=[],l=n.tile.transform;for(const o of this._clusters.values()){let e=o.inner.getCentroidX(l);const i=o.inner.getCentroidY(l),d=n.tile.lod,u=d.wrap?d.worldSize[0]:null,c=1===o.inner.count?o.inner.firstObjectId:o.inner.id,h=o.displayId;if(null!=u)if(1===u){const n=new s([],[e,i]),l=new t(n,o.inner.getAttributes(),null,c,h);l.geometry.coords[0]-=r,a.push(l);const d=new s([],[e,i]),u=new t(d,o.inner.getAttributes(),null,c,h);u.geometry.coords[0]+=r,a.push(u)}else e>r+r/2?e-=u*r:e<-256&&(e+=u*r);if(e<r+m&&e>=-m&&i<r+m&&i>=-m){const r=new s([],[e,i]),n=new t(r,o.inner.getAttributes(),null,c,h);a.push(n)}}return g.fromOptimizedFeatures(a,i,n.tile.transform)}_clusterCells(e){let t=Array.from(this._cells.values());t=t.sort((e,t)=>t.count-e.count);const s=[];for(const a of this._clusters.values())s.push(a.inner.id);this._clusters.clear();const i=this._clusterRadius*(1/l(this._indexOptions.spatialReference,this._scale)),r=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const l of t){if(n.has(l.id))continue;if(l.gridX<e.xMin||l.gridX>e.xMax||l.gridY<e.yMin||l.gridY>e.yMax)continue;const t=this._store.createDisplayIdForObjectId(l.id),s=new u(l.clone(),t);n.add(l.id),this._clusters.set(l.id,s);const o=l.centroidXWorld,d=l.centroidYWorld;for(let e=l.gridY-r;e<=l.gridY+r;e++)for(let t=l.gridX-r;t<=l.gridX+r;t++){if(e===l.gridY&&t===l.gridX)continue;const r=this._cells.get(a.createId(t,e));if(!r||n.has(r.id))continue;const u=Math.abs(r.centroidXWorld-o),c=Math.abs(r.centroidYWorld-d);u<i&&c<i&&(s.inner.merge(r),n.add(r.id))}}for(const a of s)this._store.releaseDisplayIdForObjectId(a)}_updateAggregateStatistics(e,t){let s=!1;for(const i of t.statistics.values()){if("esriFieldTypeString"===i.field.type)continue;const t=i.value,r=i.field,n=e.get(r.name);if(n){const{minValue:e,maxValue:i}=n,r=Math.min(n.minValue,t),a=Math.max(n.maxValue,t);e===r&&i===a||(n.minValue=r,n.maxValue=a,s=!0);continue}e.set(r.name,{minValue:t,maxValue:t}),s=!0}return s}}class x extends o{static async create(e,t,s,i,r,a,l,o){const d=s.metadata.outSpatialReference,u=new h({spatialReference:d}),c={type:"grid",fields:await Promise.all(t.fields.map(async e=>n.create(u,e))),spatialReference:d,featureFilter:t.featureFilter?await p.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:d,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,arcadeContextInfo:r,sqlOptions:a};return new x(e,t.clusterRadius,c,t.fields,s,i,a,l,o)}constructor(e,t,s,r,n,a,l,o,d){super(n,a,s.spatialReference,s.fields,l),this._connection=e,this._clusterRadius=t,this._indexOptions=s,this._requiredLevel=o,this._requiredScale=d,this._cellsPerScale=new Map,this._metadata=f.createFeature({geometryType:"esriGeometryPoint",hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:new i([...r,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:n.metadata.spatialReference,outSpatialReference:n.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}updateRequiredLevel(e,t){this._requiredLevel=e,this._requiredScale=t}createState(e){return new y(e)}async*applyOverrideUpdate(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,s){const i=new Map(e.map(e=>[t(e),e])),r=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const a of n.clusters()){const e=i.get(a.inner.id);if(null!=e){const t=s(a.displayId,e,a.inner.id);r.push(t),i.delete(a.inner.id);continue}if(1===a.inner.count){const{firstObjectId:e}=a.inner,t=e?i.get(e):null;if(null!=t){const n=s(a.displayId,t,e);r.push(n),i.delete(e)}}}return r}getDisplayFeatures(t){const s=new Set(t),i=new Set,r=[],n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const l of a.aggregatesWorldSpace())if(s.has(l.displayId)&&!i.has(l.displayId)){const t=e(l,this._metadata.geometryType,!1,!1);if(i.add(l.displayId),1===t.attributes.cluster_count){r.push({...t,displayId:l.displayId});continue}n.push({...t,displayId:l.displayId})}return{features:r,aggregates:n,tracks:[]}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.clusters())if(s.inner.id===e)return Array.from(s.inner.containedObjectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale),s=Array.from(this._sendStates.values()).filter(e=>e.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,s)||!this._source.updateTracking.updating)for(const n of s)n.subscription.tile.level===this._requiredLevel&&(n.didSend=!1,n.done=!1);const i=Array.from(this._sendStates.values()).filter(e=>e.done).map(e=>e.subscription.tile.key),r=new Set(i);for(const n of this._sendStates.values()){if(this._source.updateTracking.updating){if(i.some(e=>e.containsChild(n.subscription.tile.key)))continue;if(n.subscription.tile.key.getChildKeys().every(e=>r.has(e)))continue}n.didSend||n.subscription.tile.level!==this._requiredLevel||(n.didSend=!0,yield*this._update(n,t,this._source))}await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(null==this._requiredLevel||null==this._requiredScale)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.aggregatesWorldSpace())e(s)}_getClusterState(e,t){if(null==e||null==t)throw new Error("InternalError: Level and scale must be defined");let s=this._cellsPerScale.get(t);return s||(s=new S(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,s)),s}async*_update(e,t,s){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!s.updateTracking.updating;const r=i.getCursor(),n=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.arcadeContextInfo);for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,n,this._sqlOptions);const a=new c(e.subscription,i,!0,e.done,{});yield a}}export{y as ClusterState,x as ClusterStrategy};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromPolyline as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as b}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as T}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let C;const G=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class W{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class z{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new W(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new b(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLinePath,this._spatialReference),this._bounds=N(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=m(r,this._metadata.geometryType,t.subscription.tile.transform)??new g,o=l(1/0,1/0,-1/0,-1/0);E(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new b(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new g;return new b(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new b(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class M extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,a,o){const n=e.metadata.outSpatialReference,l=new R({spatialReference:n}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:e.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:e.metadata.timeInfo,fieldsIndex:e.metadata.fieldsIndex,spatialReference:n,filterJSON:t.featureFilter}):null;return n.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then(([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,e,s,n,c,d,a,o)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}destroy(){super.destroy(),this._clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){return!0}invalidate(){super.invalidate(),this._clear()}createState(t){return new M(t)}async*applyOverrideUpdate(t){G().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_clear(){for(const t of this._source.chunks())if(this._handledChunks.has(t.chunkId)){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._attributeStore.releaseDisplayIdForObjectId(t)}}this._handledChunks.clear();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];if(this._handledChunks.has(i.chunkId))continue;this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.getObjectId();a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(t));const i=a.readAttribute(e);if(null!=i&&null!=t&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(!this._tracks.has(i)){const t=z.getOid(i),e=this._attributeStore.createDisplayIdForObjectId(t),s=new z(this._schema,i,t,e,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(i,s)}this._tracks.get(i).stageObservation(r,a),s.add(i)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,T(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId),null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function q(t,e){if(t.length<2)return _({paths:[t]},!1,!1);if(e.isWrappable){let s=!1;for(let r=1;r<t.length;r++){const i=t[r][0],a=h(i,t[r-1][0],e);i!==a&&(t[r][0]=a,s=!0)}if(s){const s=p({paths:[t],spatialReference:e});if(null!=s)return _({paths:s.paths},!1,!1)}return _({paths:[t]},!1,!1)}const s=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[t]}),r=C.fromSpatialReference(e);if(null!=r){const t=a(s,1e6,r,o.geodesic);if(null!=t){const e=C.toGeometry(t,r);if(null!=e&&"paths"in e)return _({paths:e.paths},!1,!1)}}return _({paths:[t]},!1,!1)}function E(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function N(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
2
+ import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromPolyline as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as b}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as T}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let C;const G=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class M{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class W{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new M(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new b(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLinePath,this._spatialReference),this._bounds=E(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=m(r,this._metadata.geometryType,t.subscription.tile.transform)??new g,o=l(1/0,1/0,-1/0,-1/0);Z(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new b(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new g;return new b(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new b(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class z extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,a,o){const n=e.metadata.outSpatialReference,l=new R({spatialReference:n}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:e.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:e.metadata.timeInfo,fieldsIndex:e.metadata.fieldsIndex,spatialReference:n,filterJSON:t.featureFilter}):null;return n.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then(([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,e,s,n,c,d,a,o)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null,hasZ:!1,hasM:!1})}destroy(){super.destroy(),this._clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){return!0}invalidate(){super.invalidate(),this._clear()}createState(t){return new z(t)}async*applyOverrideUpdate(t){G().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_clear(){for(const t of this._source.chunks())if(this._handledChunks.has(t.chunkId)){const e=t.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._attributeStore.releaseDisplayIdForObjectId(t)}}this._handledChunks.clear();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];if(this._handledChunks.has(i.chunkId))continue;this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.getObjectId();a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(t));const i=a.readAttribute(e);if(null!=i&&null!=t&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(!this._tracks.has(i)){const t=W.getOid(i),e=this._attributeStore.createDisplayIdForObjectId(t),s=new W(this._schema,i,t,e,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(i,s)}this._tracks.get(i).stageObservation(r,a),s.add(i)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,T(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId),null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function q(t,e){if(t.length<2)return _({paths:[t]},!1,!1);if(e.isWrappable){let s=!1;for(let r=1;r<t.length;r++){const i=t[r][0],a=h(i,t[r-1][0],e);i!==a&&(t[r][0]=a,s=!0)}if(s){const s=p({paths:[t],spatialReference:e});if(null!=s)return _({paths:s.paths},!1,!1)}return _({paths:[t]},!1,!1)}const s=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[t]}),r=C.fromSpatialReference(e);if(null!=r){const t=a(s,1e6,r,o.geodesic);if(null!=t){const e=C.toGeometry(t,r);if(null!=e&&"paths"in e)return _({paths:e.paths},!1,!1)}}return _({paths:[t]},!1,!1)}function Z(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function E(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"../../../../../core/has.js";async function e(e,r,i){return{type:"feature",service:e,strategy:await t(e,i,r,i.cache)}}async function t(e,t,r,i){const s=t.customParameters??{};t.apiKey&&(s.token=t.apiKey);const o=t.displayFilterEnabled?t.displayFilterInfo?.toJSON():null,n=t.historicMoment?.getTime(),a=t.timeExtent?.toJSON(),l={...t,displayFilterInfo:o,customParameters:s,historicMoment:n,timeExtent:a};if("feature-service"===e.type&&null!=r&&!await i.executeExceedsLimitQuery(e,l,r))return{type:"snapshot",snapshotInfo:r,partial:{availableFields:t.availableFields},full:{displayFilterInfo:null,queryScaleRanges:null,sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,postQueryFilter:t.postQueryFilter,customParameters:s,gdbVersion:t.gdbVersion,historicMoment:n,timeExtent:a}};return"feature-service"===e.type&&e.isSourceHosted||"memory"===e.type||"ogc"===e.type?{type:"paged-tile",partial:{availableFields:t.availableFields},full:{sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,postQueryFilter:t.postQueryFilter,customParameters:s,gdbVersion:t.gdbVersion,historicMoment:n,queryScaleRanges:t.queryScaleRanges,timeExtent:a,displayFilterInfo:o}}:{type:"drill-down",partial:{availableFields:t.availableFields},full:{sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,postQueryFilter:t.postQueryFilter,customParameters:s,gdbVersion:t.gdbVersion,historicMoment:n,queryScaleRanges:t.queryScaleRanges,timeExtent:a,displayFilterInfo:o}}}function r(e,t,r,a,l,u){const p=n(a);if(!(!!has("featurelayer-snapshot-enabled")&&r?.query.supportsPagination&&!t))return null;if(r?.operations.supportsEditing&&!has("featurelayer-snapshot-allow-editable"))return null;const c=o(l,u),{min:y,max:m}=p,h=c?m:y,f=s(a);let d=has("featurelayer-snapshot-initial-tolerance");return"esriGeometryPoint"!==a&&"esriGeometryMultipoint"!==a||(d=null),{supportsExceedsLimit:i(e,r),initialTolerance:d,maxFeatureCount:h,maxVertexCount:f}}function i(e,t){return!(!e&&!has("featurelayer-snapshot-non-hosted-exceedslimit-enabled"))&&t?.operations.supportsExceedsLimitStatistics}function s(e){switch(e){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":case"esriGeometryMultiPatch":case"esriGeometryMultipoint":return has("featurelayer-snapshot-max-vertex-count")}}function o(e,t){const r=t?.clone().intersection(e),i=null!=r?r.width*r.height:0,s=t?t.width*t.height:0,o=0===s?0:i/s,n=has("featurelayer-snapshot-coverage");return!isNaN(o)&&o>=n}function n(e){switch(e){case"esriGeometryMultipoint":return{min:has("featurelayer-snapshot-multipoint-min-threshold"),max:has("featurelayer-snapshot-multipoint-max-threshold")};case"esriGeometryPoint":return{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")};case"esriGeometryMultiPatch":case"esriGeometryPolygon":return{min:has("featurelayer-snapshot-polygon-min-threshold"),max:has("featurelayer-snapshot-polygon-max-threshold")};case"esriGeometryPolyline":return{min:has("featurelayer-snapshot-polyline-min-threshold"),max:has("featurelayer-snapshot-polyline-max-threshold")}}}export{e as createFeatureSourceSchema,r as createSnapshotInfo};
2
+ import has from"../../../../../core/has.js";async function e(e,r,i){return{type:"feature",service:e,strategy:await t(e,i,r,i.cache)}}async function t(e,t,r,i){const s=t.customParameters??{};t.apiKey&&(s.token=t.apiKey);const n=t.displayFilterEnabled?t.displayFilterInfo?.toJSON():null,o=t.historicMoment?.getTime(),a=t.timeExtent?.toJSON(),l={...t,displayFilterInfo:n,customParameters:s,historicMoment:o,timeExtent:a},{returnZ:u,returnM:p}=t;if("feature-service"===e.type&&null!=r&&!await i.executeExceedsLimitQuery(e,l,r))return{type:"snapshot",snapshotInfo:r,partial:{availableFields:t.availableFields},full:{displayFilterInfo:null,queryScaleRanges:null,sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,postQueryFilter:t.postQueryFilter,customParameters:s,gdbVersion:t.gdbVersion,historicMoment:o,timeExtent:a,returnZ:u,returnM:p}};return"feature-service"===e.type&&e.isSourceHosted||"memory"===e.type||"ogc"===e.type?{type:"paged-tile",partial:{availableFields:t.availableFields},full:{sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,postQueryFilter:t.postQueryFilter,customParameters:s,gdbVersion:t.gdbVersion,historicMoment:o,queryScaleRanges:t.queryScaleRanges,timeExtent:a,displayFilterInfo:n,returnZ:u,returnM:p}}:{type:"drill-down",partial:{availableFields:t.availableFields},full:{sourceRefreshVersion:t.sourceRefreshVersion,definitionExpression:t.definitionExpression,postQueryFilter:t.postQueryFilter,customParameters:s,gdbVersion:t.gdbVersion,historicMoment:o,queryScaleRanges:t.queryScaleRanges,timeExtent:a,displayFilterInfo:n,returnZ:u,returnM:p}}}function r(e,t,r,a,l,u){const p=o(a);if(!(!!has("featurelayer-snapshot-enabled")&&r?.query.supportsPagination&&!t))return null;if(r?.operations.supportsEditing&&!has("featurelayer-snapshot-allow-editable"))return null;const c=n(l,u),{min:y,max:m}=p,h=c?m:y,f=s(a);let d=has("featurelayer-snapshot-initial-tolerance");return"esriGeometryPoint"!==a&&"esriGeometryMultipoint"!==a||(d=null),{supportsExceedsLimit:i(e,r),initialTolerance:d,maxFeatureCount:h,maxVertexCount:f}}function i(e,t){return!(!e&&!has("featurelayer-snapshot-non-hosted-exceedslimit-enabled"))&&t?.operations.supportsExceedsLimitStatistics}function s(e){switch(e){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":case"esriGeometryMultiPatch":case"esriGeometryMultipoint":return has("featurelayer-snapshot-max-vertex-count")}}function n(e,t){const r=t?.clone().intersection(e),i=null!=r?r.width*r.height:0,s=t?t.width*t.height:0,n=0===s?0:i/s,o=has("featurelayer-snapshot-coverage");return!isNaN(n)&&n>=o}function o(e){switch(e){case"esriGeometryMultipoint":return{min:has("featurelayer-snapshot-multipoint-min-threshold"),max:has("featurelayer-snapshot-multipoint-max-threshold")};case"esriGeometryPoint":return{min:has("featurelayer-snapshot-point-min-threshold"),max:has("featurelayer-snapshot-point-max-threshold")};case"esriGeometryMultiPatch":case"esriGeometryPolygon":return{min:has("featurelayer-snapshot-polygon-min-threshold"),max:has("featurelayer-snapshot-polygon-max-threshold")};case"esriGeometryPolyline":return{min:has("featurelayer-snapshot-polyline-min-threshold"),max:has("featurelayer-snapshot-polyline-max-threshold")}}}export{e as createFeatureSourceSchema,r as createSnapshotInfo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../../core/object.js";import{ignoreAbortErrors as r,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{OptimizedFeature as a}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as i}from"../../../../../layers/graphics/data/QueryEngine.js";import{FeatureStoreStatistics as n}from"../FeatureStoreStatistics.js";import{StreamMessenger as o}from"./StreamMessenger.js";import{UpdateStatus as c}from"./strategies/ALoadStrategy.js";import{FeatureDrillDownTileLoadStrategy as d}from"./strategies/FeatureDrillDownTileLoadStrategy.js";import{FeaturePagedTileLoadStrategy as h}from"./strategies/FeaturePagedTileLoadStrategy.js";import{FeatureSnapshotLoadStrategy as u}from"./strategies/FeatureSnapshotLoadStrategy.js";import{ParquetSnapshotLoadStrategy as m}from"./strategies/ParquetSnapshotLoadStrategy.js";import{ParquetTileLoadStrategy as p}from"./strategies/ParquetTileLoadStrategy.js";import{StreamLoadStrategy as y}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as g}from"./strategies/chunks/SourceChunkStore.js";import l from"../support/FeatureFilterEvaluator.js";import{UpdateTracking2D as _}from"../../support/UpdateTracking2D.js";class f{constructor(e,t,r,s){this._aggregateAdapter=e,this._subscriptions=t,this._connection=r,this._cachedObjectIds=s,this._updateTracking=new _({debugName:"FeatureSource"}),this.store=new g}destroy(){this._strategy?.destroy(),this._streamMessenger?.destroy(),this._updateTracking?.destroy(),this.store.destroy()}get metadata(){return this._strategy.metadata}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return n.from(this.store)}get updateTracking(){return this._updateTracking}get usedMemory(){return this.store.usedMemory}get queryEngine(){if(!this._queryEngine){if(!this.store||!this._strategy)return null;this._queryEngine=new i({featureStore:this.store,fieldsIndex:this.metadata.fieldsIndex,geometryType:this.metadata.geometryType,featureIdInfo:this.metadata.featureIdInfo,hasM:!1,hasZ:!1,spatialReference:this.metadata.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:this.metadata.timeInfo,definitionExpression:this._strategy?.definitionExpression,availableFields:this._strategy?.availableFields})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasQueryDisplayFilter(){if(!this._schema)return!1;switch(this._schema.type){case"feature":return null!=this._schema.strategy.full.displayFilterInfo;case"parquet":case"stream":return!1}}chunks(){return Array.from(this.store.chunks())}prepareCacheUpdate(e,t){const r=new Set,s=new Set;for(const a of e)this._cachedObjectIds.has(a)||(this._cachedObjectIds.add(a),r.add(a));for(const a of t)this._cachedObjectIds.delete(a),s.add(a);this.hasQueryDisplayFilter&&this._strategy.prepareCacheUpdate(r,s)}async applyCacheUpdate(){this.hasQueryDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this.store.cleanup()}onSubscribe(e){if(this._connection.onEvent({type:"subscribe",tile:e.tile.id}),!this._strategy)return;const t=this._strategy.load(e);t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t})),this._updateTracking.consumePromise(t)}onResume(e){this._updateTracking.consumePromise(r(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}async applyOverride(e){await(this._strategy?.applyOverride(e))}takeOverrideUpdate(){return this._strategy?.takeOverrideUpdate()}async update(r,s){const a=this._schema;if(this._schema=r,this._queryEngine=e(this._queryEngine),a&&a.type!==r.type)throw new Error("InternalError: Reconfiguring source types is not supported.");const i=new c;if(!a||t(a.service,r.service)||a.strategy.type!==r.strategy.type||t(r.strategy.full,a.strategy.full)||!await this._strategy.tryUpdate(i,r.strategy.partial)){await this._updateStrategyType(this._schema.service,r,s);let e=null;return"postQueryFilter"in this._schema.strategy.full&&this._schema.strategy.full.postQueryFilter&&(e=await l.create({geometryType:this.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:this.metadata.timeInfo,fieldsIndex:this.metadata.fieldsIndex,spatialReference:this.metadata.outSpatialReference,filterJSON:this._schema.strategy.full.postQueryFilter})),await this.store.update({metadata:this.metadata,definitionExpression:this._schema.strategy.full.definitionExpression,postQueryFilter:e}),!0}return i.requiresInvalidation}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.strategy.full.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new o(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(a.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(a.fromJSON),remove:e.commands.remove,release:e.commands.release}},r=e.commands.updateByIdWeak,s=await this._queryOptimizedFeatures(r);if(s.length!==r.length){const e=new Set(s.map(e=>e.objectId));for(const s of r)e.has(s)||t.commands.removeWeak.push(s)}return t.commands.updateWeak.push(...s),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],r=(await this._strategy.queryByObjectId(e,["*"])).getCursor();for(;r.next();)t.push(r.readOptimizedFeatureWorldSpace());return t}getObjectIdsFromGlobalIds(e){const t=this.metadata.globalIdField;if(null==t)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const r=this.store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(r)}async _updateStrategyType(e,t,r){const a=this._createStrategy(e,t);this._connection.onEvent({type:"updateStrategyStart",about:a.about});const i=!!this._strategy;this.store.clear(),this._strategy?.destroy(),this._strategy=a,has("esri-2d-update-debug")&&console.debug(`Version[${r}] FeatureSource.updateStrategy`,{strategy:a});const n=Array.from(this._subscriptions.values());if(!n.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const o=Promise.all(n.map(e=>this._strategy.load(e).then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))));this._updateTracking.consumePromise(o),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{i&&await o}catch(c){s(c)}this._connection.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${r}] FeatureSource.updateStrategyEnd`,{strategy:a})}_createStrategy(e,t){const r={connection:this._connection,store:this.store};switch(t.type){case"feature":return this._createFeatureLoadStrategy(e,t.strategy,r);case"parquet":return this._createParquetLoadStrategy(e,t.strategy,r);case"stream":return this._createStreamLoadStrategy(e,t.strategy,r)}}_createFeatureLoadStrategy(e,t,r){switch(t.type){case"drill-down":return new d(e,t,r);case"paged-tile":return new h(e,t,r);case"snapshot":return new u(e,t,r)}}_createParquetLoadStrategy(e,t,r){switch(t.type){case"xz":return new p(e,t,r,this._connection);case"snapshot":return new m(e,t,r,this._connection)}}_createStreamLoadStrategy(e,t,r){const s=new y(e,t,r);return this.streamMessenger.strategy=s,s}}export{f as FeatureSource};
2
+ import has from"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../../core/object.js";import{ignoreAbortErrors as r,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{OptimizedFeature as a}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as i}from"../../../../../layers/graphics/data/QueryEngine.js";import{FeatureStoreStatistics as n}from"../FeatureStoreStatistics.js";import{StreamMessenger as o}from"./StreamMessenger.js";import{UpdateStatus as c}from"./strategies/ALoadStrategy.js";import{FeatureDrillDownTileLoadStrategy as h}from"./strategies/FeatureDrillDownTileLoadStrategy.js";import{FeaturePagedTileLoadStrategy as d}from"./strategies/FeaturePagedTileLoadStrategy.js";import{FeatureSnapshotLoadStrategy as u}from"./strategies/FeatureSnapshotLoadStrategy.js";import{ParquetSnapshotLoadStrategy as m}from"./strategies/ParquetSnapshotLoadStrategy.js";import{ParquetTileLoadStrategy as p}from"./strategies/ParquetTileLoadStrategy.js";import{StreamLoadStrategy as y}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as g}from"./strategies/chunks/SourceChunkStore.js";import l from"../support/FeatureFilterEvaluator.js";import{UpdateTracking2D as _}from"../../support/UpdateTracking2D.js";class f{constructor(e,t,r,s){this._aggregateAdapter=e,this._subscriptions=t,this._connection=r,this._cachedObjectIds=s,this._updateTracking=new _({debugName:"FeatureSource"}),this.store=new g}destroy(){this._strategy?.destroy(),this._streamMessenger?.destroy(),this._updateTracking?.destroy(),this.store.destroy()}get metadata(){return this._strategy.metadata}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return n.from(this.store)}get updateTracking(){return this._updateTracking}get usedMemory(){return this.store.usedMemory}get queryEngine(){if(!this._queryEngine){if(!this.store||!this._strategy)return null;this._queryEngine=new i({featureStore:this.store,fieldsIndex:this.metadata.fieldsIndex,geometryType:this.metadata.geometryType,featureIdInfo:this.metadata.featureIdInfo,hasZ:this.metadata.hasZ,hasM:this.metadata.hasM,spatialReference:this.metadata.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:this.metadata.timeInfo,definitionExpression:this._strategy?.definitionExpression,availableFields:this._strategy?.availableFields})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasQueryDisplayFilter(){if(!this._schema)return!1;switch(this._schema.type){case"feature":return null!=this._schema.strategy.full.displayFilterInfo;case"parquet":case"stream":return!1}}chunks(){return Array.from(this.store.chunks())}prepareCacheUpdate(e,t){const r=new Set,s=new Set;for(const a of e)this._cachedObjectIds.has(a)||(this._cachedObjectIds.add(a),r.add(a));for(const a of t)this._cachedObjectIds.delete(a),s.add(a);this.hasQueryDisplayFilter&&this._strategy.prepareCacheUpdate(r,s)}async applyCacheUpdate(){this.hasQueryDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this.store.cleanup()}onSubscribe(e){if(this._connection.onEvent({type:"subscribe",tile:e.tile.id}),!this._strategy)return;const t=this._strategy.load(e);t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t})),this._updateTracking.consumePromise(t)}onResume(e){this._updateTracking.consumePromise(r(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}async applyOverride(e){await(this._strategy?.applyOverride(e))}takeOverrideUpdate(){return this._strategy?.takeOverrideUpdate()}async update(r,s){const a=this._schema;if(this._schema=r,this._queryEngine=e(this._queryEngine),a&&a.type!==r.type)throw new Error("InternalError: Reconfiguring source types is not supported.");const i=new c;if(!a||t(a.service,r.service)||a.strategy.type!==r.strategy.type||t(r.strategy.full,a.strategy.full)||!await this._strategy.tryUpdate(i,r.strategy.partial)){await this._updateStrategyType(this._schema.service,r,s);let e=null;return"postQueryFilter"in this._schema.strategy.full&&this._schema.strategy.full.postQueryFilter&&(e=await l.create({geometryType:this.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:this.metadata.timeInfo,fieldsIndex:this.metadata.fieldsIndex,spatialReference:this.metadata.outSpatialReference,filterJSON:this._schema.strategy.full.postQueryFilter})),await this.store.update({metadata:this.metadata,definitionExpression:this._schema.strategy.full.definitionExpression,postQueryFilter:e}),!0}return i.requiresInvalidation}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.strategy.full.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new o(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(a.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(a.fromJSON),remove:e.commands.remove,release:e.commands.release}},r=e.commands.updateByIdWeak,s=await this._queryOptimizedFeatures(r);if(s.length!==r.length){const e=new Set(s.map(e=>e.objectId));for(const s of r)e.has(s)||t.commands.removeWeak.push(s)}return t.commands.updateWeak.push(...s),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],r=(await this._strategy.queryByObjectId(e,["*"])).getCursor();for(;r.next();)t.push(r.readOptimizedFeatureWorldSpace());return t}getObjectIdsFromGlobalIds(e){const t=this.metadata.globalIdField;if(null==t)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const r=this.store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(r)}async _updateStrategyType(e,t,r){const a=this._createStrategy(e,t);this._connection.onEvent({type:"updateStrategyStart",about:a.about});const i=!!this._strategy;this.store.clear(),this._strategy?.destroy(),this._strategy=a,has("esri-2d-update-debug")&&console.debug(`Version[${r}] FeatureSource.updateStrategy`,{strategy:a});const n=Array.from(this._subscriptions.values());if(!n.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const o=Promise.all(n.map(e=>this._strategy.load(e).then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))));this._updateTracking.consumePromise(o),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{i&&await o}catch(c){s(c)}this._connection.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${r}] FeatureSource.updateStrategyEnd`,{strategy:a})}_createStrategy(e,t){const r={connection:this._connection,store:this.store};switch(t.type){case"feature":return this._createFeatureLoadStrategy(e,t.strategy,r);case"parquet":return this._createParquetLoadStrategy(e,t.strategy,r);case"stream":return this._createStreamLoadStrategy(e,t.strategy,r)}}_createFeatureLoadStrategy(e,t,r){switch(t.type){case"drill-down":return new h(e,t,r);case"paged-tile":return new d(e,t,r);case"snapshot":return new u(e,t,r)}}_createParquetLoadStrategy(e,t,r){switch(t.type){case"xz":return new p(e,t,r,this._connection);case"snapshot":return new m(e,t,r,this._connection)}}_createStreamLoadStrategy(e,t,r){const s=new y(e,t,r);return this.streamMessenger.strategy=s,s}}export{f as FeatureSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"../../../../../core/has.js";import{sqlAnd as e}from"../../../../../core/sql.js";import t from"../../../../../geometry/SpatialReference.js";import{getClauseForScaleRange as r}from"../../../../../layers/support/displayFilterUtils.js";import a from"../../../../../rest/support/Query.js";import i from"../../../../../time/TimeExtent.js";const s=4;function o(e){switch(e.type){case"object-id":case"unique-id-simple":return`${e.fieldName} ASC`;case"unique-id-composite":return`${e.fieldNames.join(",")} ASC`}}function n(e,r,a){const s=o(a.featureIdInfo);return{returnCentroid:"esriGeometryPolygon"===a.serviceGeometryType&&!e.queryMetadata.supportsCentroidOnDegeneratedQuantizedGeometry&&!e.queryMetadata.supportsDegeneratedQuantizedGeometry,returnGeometry:!0,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[s],where:r.definitionExpression??"1=1",outFields:r.availableFields,multipatchOption:"esriGeometryMultiPatch"===a.serviceGeometryType?"xyFootprint":null,gdbVersion:r.gdbVersion,historicMoment:r.historicMoment?new Date(r.historicMoment):null,timeExtent:r.timeExtent?i.fromJSON(r.timeExtent):null}}class u{static create(e,t,r){const a=t.queryScaleRanges,i=t.displayFilterInfo;return new u(n(e,t,r),i,a,r.subtypeField,t.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,s,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=r,this._subtypeField=a,this._customParameters=i,this._geometryType=s,this._queryMetadata=o}getPageSize(e){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const t=this._queryMetadata.supportsMaxRecordCountFactor?s:null,r=((e?this._queryMetadata.tileMaxRecordCount:this._queryMetadata.maxRecordCount)??this._queryMetadata.maxRecordCount??2e3)*(t??1),a=has("featurelayer-query-max-page-size")??8e3;return Math.min(a,r)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,r){if(!t.getSize())return null;const a=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(a.outFields??[])[0])return null;a.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),r=[];for(const a of e)t.hasField(a)||r.push(a);if(0===r.length)return null;a.outFields=r}a.returnGeometry=!1,a.returnCentroid=!1,a.quantizationParameters=null,a.cacheHint=!0;const i={inner:a,customParameters:this._customParameters};if(has("esri-tiles-debug")&&null!=r){const e=r.chunkId.toString().replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,chunkId:e}:{chunkId:e}}return i}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new a({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(t,a){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const i=this.createQuery(a),o=i.inner;if(this._queryScaleRanges?.length){const r=this._queryScaleRanges.filter(e=>(!e.minScale||e.minScale>=t.maxScale)&&(!e.maxScale||e.maxScale<=t.minScale)).map(e=>e.subtypeCode);if(r.length){const t=`${this._subtypeField} IN (${r})`;o.where=e(o.where,t)}}if(this._displayFilter&&(o.where=e(o.where,r(this._displayFilter,t.minScale,t.maxScale))),o.quantizationParameters=a.quantizationParameters??t.getQuantizationParameters(),o.resultType="tile",o.geometry=t.hydratedExtent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset=t.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(o.maxAllowableOffset=t.resolution,"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),o.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,o.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(o.maxRecordCountFactor=s),has("esri-tiles-debug")){const e=t.id.replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,tileId:e}:{tileId:e}}return i}createPagedTileQuery(e,t){const r=this.getPageSize(!0);return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e,t){const r=this.getPageSize(!1);return this.createQuery({start:r*e,num:r,returnExceededLimitFeatures:!0,maxRecordCountFactor:s,quantizationParameters:t,cacheHint:!0})}createObjectIdsQuery(e){return this.createQuery({objectIds:e,outFields:["*"]})}}export{u as FeatureSourceQueryInfo};
2
+ import has from"../../../../../core/has.js";import{sqlAnd as e}from"../../../../../core/sql.js";import t from"../../../../../geometry/SpatialReference.js";import{getClauseForScaleRange as r}from"../../../../../layers/support/displayFilterUtils.js";import a from"../../../../../rest/support/Query.js";import i from"../../../../../time/TimeExtent.js";const s=4;function o(e){switch(e.type){case"object-id":case"unique-id-simple":return`${e.fieldName} ASC`;case"unique-id-composite":return`${e.fieldNames.join(",")} ASC`}}function n(e,r,a){const s=o(a.featureIdInfo);return{returnCentroid:"esriGeometryPolygon"===a.serviceGeometryType&&!e.queryMetadata.supportsCentroidOnDegeneratedQuantizedGeometry&&!e.queryMetadata.supportsDegeneratedQuantizedGeometry,returnGeometry:!0,returnZ:r.returnZ,returnM:r.returnM,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[s],where:r.definitionExpression??"1=1",outFields:r.availableFields,multipatchOption:"esriGeometryMultiPatch"===a.serviceGeometryType?"xyFootprint":null,gdbVersion:r.gdbVersion,historicMoment:r.historicMoment?new Date(r.historicMoment):null,timeExtent:r.timeExtent?i.fromJSON(r.timeExtent):null}}class u{static create(e,t,r){const a=t.queryScaleRanges,i=t.displayFilterInfo;return new u(n(e,t,r),i,a,r.subtypeField,t.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,s,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=r,this._subtypeField=a,this._customParameters=i,this._geometryType=s,this._queryMetadata=o}getPageSize(e){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const t=this._queryMetadata.supportsMaxRecordCountFactor?s:null,r=((e?this._queryMetadata.tileMaxRecordCount:this._queryMetadata.maxRecordCount)??this._queryMetadata.maxRecordCount??2e3)*(t??1),a=has("featurelayer-query-max-page-size")??8e3;return Math.min(a,r)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,r){if(!t.getSize())return null;const a=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(a.outFields??[])[0])return null;a.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),r=[];for(const a of e)t.hasField(a)||r.push(a);if(0===r.length)return null;a.outFields=r}a.returnGeometry=!1,a.returnCentroid=!1,a.quantizationParameters=null,a.cacheHint=!0;const i={inner:a,customParameters:this._customParameters};if(has("esri-tiles-debug")&&null!=r){const e=r.chunkId.toString().replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,chunkId:e}:{chunkId:e}}return i}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new a({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(t,a){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const i=this.createQuery(a),o=i.inner;if(this._queryScaleRanges?.length){const r=this._queryScaleRanges.filter(e=>(!e.minScale||e.minScale>=t.maxScale)&&(!e.maxScale||e.maxScale<=t.minScale)).map(e=>e.subtypeCode);if(r.length){const t=`${this._subtypeField} IN (${r})`;o.where=e(o.where,t)}}if(this._displayFilter&&(o.where=e(o.where,r(this._displayFilter,t.minScale,t.maxScale))),o.quantizationParameters=a.quantizationParameters??t.getQuantizationParameters(),o.resultType="tile",o.geometry=t.hydratedExtent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset=t.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(o.maxAllowableOffset=t.resolution,"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),o.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,o.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(o.maxRecordCountFactor=s),has("esri-tiles-debug")){const e=t.id.replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,tileId:e}:{tileId:e}}return i}createPagedTileQuery(e,t){const r=this.getPageSize(!0);return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e,t){const r=this.getPageSize(!1);return this.createQuery({start:r*e,num:r,returnExceededLimitFeatures:!0,maxRecordCountFactor:s,quantizationParameters:t,cacheHint:!0})}createObjectIdsQuery(e){return this.createQuery({objectIds:e,outFields:["*"]})}}export{u as FeatureSourceQueryInfo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../../geometry/SpatialReference.js";import t from"../../../../../layers/support/FieldsIndex.js";class i{static minimal(e,n,l=[]){return new i({geometryType:e,fieldsIndex:new t(l).toJSON(),featureIdInfo:{type:"object-id",fieldName:n},subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null})}static createFeature(e){return new i(e)}constructor(i){let n;this._options=i,this._fieldsIndex=t.fromJSON(i.fieldsIndex),i.spatialReference&&(i.spatialReference instanceof e?this._spatialReference=i.spatialReference:this._spatialReference=e.fromJSON(i.spatialReference)),i.outSpatialReference&&(i.outSpatialReference instanceof e?this._outSpatialReference=i.outSpatialReference:this._outSpatialReference=e.fromJSON(i.outSpatialReference)),"object-id"===i.featureIdInfo.type&&(n=i.featureIdInfo.fieldName),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:n,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0,datesInUnknownTimezone:this._options.timeReferenceUnknownClient??void 0,dateFieldsTimeZone:this._options.dateFieldsTimeZone??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return"esriGeometryMultiPatch"===this._options.geometryType?"esriGeometryPolygon":this._options.geometryType}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get featureIdInfo(){return this._options.featureIdInfo}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get outSpatialReference(){return this._outSpatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}weakCloneWithAdditionalFields(e){return new i({fieldsIndex:{fields:[...this._fieldsIndex.fields,...e],timeZoneByFieldName:null},geometryType:this.geometryType,globalIdField:this.globalIdField,featureIdInfo:this.featureIdInfo,spatialReference:this.spatialReference,outSpatialReference:this.outSpatialReference,subtypeField:this.subtypeField,subtypes:this._options.subtypes,timeInfo:this.timeInfo,timeReferenceUnknownClient:this.timeReferenceUnknownClient,dateFieldsTimeZone:this._options.dateFieldsTimeZone,typeIdField:this._options.typeIdField,types:this._options.types})}}class n extends i{static createGraphics(e){return new n({fieldsIndex:(new t).toJSON(),featureIdInfo:{type:"object-id",fieldName:"uid"},geometryType:null,spatialReference:e,outSpatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null})}}export{i as FeatureMetadata,n as GraphicsMetadata};
2
+ import e from"../../../../../geometry/SpatialReference.js";import t from"../../../../../layers/support/FieldsIndex.js";class i{static minimal(e,n,s=[],l=!1,o=!1){return new i({geometryType:e,hasZ:l,hasM:o,fieldsIndex:new t(s).toJSON(),featureIdInfo:{type:"object-id",fieldName:n},subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null})}static createFeature(e){return new i(e)}constructor(i){let n;this._options=i,this._fieldsIndex=t.fromJSON(i.fieldsIndex),i.spatialReference&&(i.spatialReference instanceof e?this._spatialReference=i.spatialReference:this._spatialReference=e.fromJSON(i.spatialReference)),i.outSpatialReference&&(i.outSpatialReference instanceof e?this._outSpatialReference=i.outSpatialReference:this._outSpatialReference=e.fromJSON(i.outSpatialReference)),"object-id"===i.featureIdInfo.type&&(n=i.featureIdInfo.fieldName),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:n,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0,datesInUnknownTimezone:this._options.timeReferenceUnknownClient??void 0,dateFieldsTimeZone:this._options.dateFieldsTimeZone??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return"esriGeometryMultiPatch"===this._options.geometryType?"esriGeometryPolygon":this._options.geometryType}get hasZ(){return this._options.hasZ}get hasM(){return this._options.hasM}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get featureIdInfo(){return this._options.featureIdInfo}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get outSpatialReference(){return this._outSpatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}weakCloneWithAdditionalFields(e){return new i({fieldsIndex:{fields:[...this._fieldsIndex.fields,...e],timeZoneByFieldName:null},geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM,globalIdField:this.globalIdField,featureIdInfo:this.featureIdInfo,spatialReference:this.spatialReference,outSpatialReference:this.outSpatialReference,subtypeField:this.subtypeField,subtypes:this._options.subtypes,timeInfo:this.timeInfo,timeReferenceUnknownClient:this.timeReferenceUnknownClient,dateFieldsTimeZone:this._options.dateFieldsTimeZone,typeIdField:this._options.typeIdField,types:this._options.types})}}class n extends i{static createGraphics(e){return new n({fieldsIndex:(new t).toJSON(),featureIdInfo:{type:"object-id",fieldName:"uid"},geometryType:null,hasZ:!1,hasM:!1,spatialReference:e,outSpatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null})}}export{i as FeatureMetadata,n as GraphicsMetadata};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{convertFromFeatures as e,convertFromFeatureSet as t,getQuantizedArea as r}from"../../../../../layers/graphics/featureConversionUtils.js";import{hasGeometry as s}from"../../../../../layers/graphics/OptimizedFeature.js";import n from"../../../../../layers/support/FieldsIndex.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";class u extends i{static fromFeatures(t,r){const{geometryType:s}=r,n=e([],t,s,!1,!1,r.featureIdInfo);for(let e=0;e<n.length;e++)n[e].displayId=t[e].displayId;return u.fromOptimizedFeatures(n,r)}static fromFeatureSet(e,r){const s=t(e,r.featureIdInfo);return u.fromOptimizedFeatureSet(s,r)}static fromOptimizedFeatureSet(e,t){const r=u.fromOptimizedFeatures(e.features,t);return r._exceededTransferLimit=e.exceededTransferLimit,r._transform=e.transform,r._fieldsIndex=new n(e.fields),r}static fromOptimizedFeatures(e,t,r){const s=new u(e,t);return s._fieldsIndex=t.fieldsIndex,s._transform=r,s}static empty(e){return new u([],e)}constructor(e,t){super(t),this._featureIndex=-1,this._exceededTransferLimit=!1,this._fieldsIndex=null,this._geometryType=t.geometryType,this._features=e}get fields(){return this._fieldsIndex}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}get _current(){return this._features[this._featureIndex]}get usedMemory(){return this._current.usedMemory}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new u(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readGeometryArea(){return s(this._current)?r(this._current.geometry,2):0}_readX(){return s(this._current)?this._current.geometry.coords[0]:0}_readY(){return s(this._current)?this._current.geometry.coords[1]:0}_readGeometry(){return s(this._current)?this._current.geometry??null:null}_readServerCentroid(){return this._current.centroid}_readAttribute(e,t){if(!this._fieldsIndex){const t=this._current.attributes[e];if(void 0!==t)return t;const r=e.toLowerCase();for(const e in this._current.attributes)if(e.toLowerCase()===r)return this._current.attributes[e];return}const r=this._fieldsIndex.get(e);if(!r)return;const s=this._current.attributes[r.name];return null==s?s:t&&this.fields.isDateField(e)?new Date(s):s}_readAttributes(){return this._current.attributes}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._fieldsIndex=this._fieldsIndex}}export{u as FeatureSetReaderJSON};
2
+ import{convertFromFeatures as e,convertFromFeatureSet as t,getQuantizedArea as r}from"../../../../../layers/graphics/featureConversionUtils.js";import{hasGeometry as s}from"../../../../../layers/graphics/OptimizedFeature.js";import i from"../../../../../layers/support/FieldsIndex.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";class u extends n{static fromFeatures(t,r){const{geometryType:s,hasZ:i,hasM:n,featureIdInfo:a}=r,d=e([],t,s,i,n,a);for(let e=0;e<d.length;e++)d[e].displayId=t[e].displayId;return u.fromOptimizedFeatures(d,r)}static fromFeatureSet(e,r){const s=t(e,r.featureIdInfo);return u.fromOptimizedFeatureSet(s,r)}static fromOptimizedFeatureSet(e,t){const r=u.fromOptimizedFeatures(e.features,t);return r._exceededTransferLimit=e.exceededTransferLimit,r._transform=e.transform,r._fieldsIndex=new i(e.fields),r}static fromOptimizedFeatures(e,t,r){const s=new u(e,t);return s._fieldsIndex=t.fieldsIndex,s._transform=r,s}static empty(e){return new u([],e)}constructor(e,t){super(t),this._featureIndex=-1,this._exceededTransferLimit=!1,this._fieldsIndex=null,this._hasZ=!1,this._hasM=!1,this._geometryType=t.geometryType,this._hasZ=t.hasZ,this._hasM=t.hasM,this._features=e}get fields(){return this._fieldsIndex}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return this._hasZ}get hasM(){return this._hasM}get _current(){return this._features[this._featureIndex]}get usedMemory(){return this._current.usedMemory}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new u(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readGeometryArea(){return s(this._current)?r(this._current.geometry,2):0}_readX(){return s(this._current)?this._current.geometry.coords[0]:0}_readY(){return s(this._current)?this._current.geometry.coords[1]:0}_readGeometry(){return s(this._current)?this._current.geometry??null:null}_readServerCentroid(){return this._current.centroid}_readAttribute(e,t){if(!this._fieldsIndex){const t=this._current.attributes[e];if(void 0!==t)return t;const r=e.toLowerCase();for(const e in this._current.attributes)if(e.toLowerCase()===r)return this._current.attributes[e];return}const r=this._fieldsIndex.get(e);if(!r)return;const s=this._current.attributes[r.name];return null==s?s:t&&this.fields.isDateField(e)?new Date(s):s}_readAttributes(){return this._current.attributes}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._fieldsIndex=this._fieldsIndex}}export{u as FeatureSetReaderJSON};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{baseObjectMemory as r}from"../../../../../core/memoryEstimations.js";import s from"../../../../../core/pbf.js";import n from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as a}from"./FeatureSetCache.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";import{parseHeader as h}from"./FeatureSetReaderPBFHeader.js";const o=268435455,d=128,u=128e3,c={small:{delta:new Int32Array(d),decoded:new Int32Array(d)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(u),decoded:new Int32Array(u)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function l(e,t){return t?e<=c.small64.delta.length?c.small64:(e<=c.large64.delta.length||(c.large64.delta=new Float64Array(Math.round(1.25*e)),c.large64.decoded=new Float64Array(Math.round(1.25*e))),c.large64):e<=c.small.delta.length?c.small:(e<=c.large.delta.length||(c.large.delta=new Int32Array(Math.round(1.25*e)),c.large.decoded=new Int32Array(Math.round(1.25*e))),c.large)}function _(t){try{const e=2,r=new s(new Uint8Array(t),new DataView(t));for(;r.next();){if(r.tag()===e)return g(r.getMessage());r.skip()}}catch(r){throw new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:r})}return null}function g(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function f(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function y(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class m extends i{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=h(n,"esriGeometryPoint"===s,t.featureIdInfo);return new m(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new m(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return r+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===o?null:new n([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===o)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new n([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new a(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=f(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=l(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),a=s.getLength(),i=s.pos()+a,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new n(o,h,this.hasZ,this.hasM)}_parseGeometryForDisplay(e){const r=2,s=3,a=e.asUnsafe(),i=a.getLength(),h=a.pos()+i,o=[],d=[];let u=0,c=0,_=null,g=0;const f="esriGeometryPolygon"===this.geometryType,m="esriGeometryPolyline"===this.geometryType,I=f?3:m?2:1,p=f||m;for(;a.pos()<h&&a.next();)switch(a.tag()){case r:{const e=a.getUInt32(),t=a.pos()+e;for(;a.pos()<t;){const e=a.getUInt32();o.push(e),u+=e}_=l(2*u,this._use64Bit).delta;break}case s:{a.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);t(_);for(const t of o){if(c+e*t>_.length){for(let e=0;e<t;e++)a.getSInt64(),a.getSInt64(),this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64();continue}let r=0,s=a.getSInt64(),n=a.getSInt64();this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64(),_[c++]=s,_[c++]=n,r+=1;for(let e=1;e<t;e++){const e=a.getSInt64(),t=a.getSInt64(),i=s+e,h=n+t;g+=-.5*(i-s)*(h+n),this.hasZ&&a.getSInt64(),this.hasM&&a.getSInt64(),0===e&&0===t||y(p,_[c-2],_[c-1],e,t)?(_[c-2]+=e,_[c-1]+=t):(_[c++]=e,_[c++]=t,r+=1),s=i,n=h}r>=I?d.push(r):c-=r*e}break}default:a.skip()}return this._cache.area=g,d.length?new n(d,_,this.hasZ,this.hasM):null!=_?this._createDeltaQuantizedExtrudedGeometry(_[0],_[1]):null}}export{m as FeatureSetReaderPBF};
2
+ import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{baseObjectMemory as r}from"../../../../../core/memoryEstimations.js";import s from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as n}from"./FeatureSetCache.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";import{parseHeader as h}from"./FeatureSetReaderPBFHeader.js";const o=268435455,d=128,u=128e3,c={small:{delta:new Int32Array(d),decoded:new Int32Array(d)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(u),decoded:new Int32Array(u)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function l(e,t){return t?e<=c.small64.delta.length?c.small64:(e<=c.large64.delta.length||(c.large64.delta=new Float64Array(Math.round(1.25*e)),c.large64.decoded=new Float64Array(Math.round(1.25*e))),c.large64):e<=c.small.delta.length?c.small:(e<=c.large.delta.length||(c.large.delta=new Int32Array(Math.round(1.25*e)),c.large.decoded=new Int32Array(Math.round(1.25*e))),c.large)}function _(t){try{const e=new s(new Uint8Array(t),new DataView(t));for(;e.next();){if(2===e.tag())return g(e.getMessage());e.skip()}}catch(r){throw new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:r})}return null}function g(e){for(;e.next();){if(1===e.tag())return e.getMessage();e.skip()}return null}function f(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}function y(e,t,r,s,a){if(!e)return!1;return 0===t*a-s*r&&t*s+r*a>0}class m extends i{static fromBuffer(e,t,r=!1){const s=t.geometryType,a=_(e),n=h(a,"esriGeometryPoint"===s,t.featureIdInfo);return new m(a,n,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return this._header.hasZ}get hasM(){return this._header.hasM}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new m(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return r+(this._cache.geometry?.usedMemory??0)}get underlyingMemory(){return super.underlyingMemory+this._reader.usedMemory+this._header.usedMemory}_readX(){return this._header.centroid[this._featureIndex*this._header.stride]}_readY(){return this._header.centroid[this._featureIndex*this._header.stride+1]}_readServerCentroid(){const e=new a([],[],this.hasZ,this.hasM),{coords:t,stride:r}=e;for(let s=this._featureIndex*r,a=s+r;s<a;++s)t.push(this._header.centroid[s]);return t[0]===o?null:e}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints)r=this._readServerCentroid();else{const s=this._header.offsets.geometry[this._featureIndex],a=this._reader;if(0===s)return null;a.move(s);try{r=e?this._parseGeometryForDisplay(a):this._parseGeometry(a)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),a=this._header.fields.isDateField(r.name);return t?null==s?s:a?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new n(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const a=f(s);return t.set(this._featureIndex,a),a}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=l(t.coords.length,this._use64Bit).decoded,s=t.clone(r),{lengths:a,coords:n,stride:i}=s;let h=0;for(const e of a){let t=n[h],r=n[h+1];h+=i;for(let s=1;s<e;++s)t=n[h]+=t,r=n[h+1]+=r,h+=i}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=e.asUnsafe(),r=t.getPackedEnd(),s=[],n=[];for(;t.pos()<r&&t.next();)switch(t.tag()){case 2:{const e=t.getPackedEnd();for(;t.pos()<e;)n.push(t.getUInt32());break}case 3:{const e=t.getPackedEnd();for(;t.pos()<e;)s.push(t.getSInt64());break}default:t.skip()}return new a(n,s,this.hasZ,this.hasM)}_parseGeometryForDisplay(e){const r=e.asUnsafe(),s=r.getLength(),n=r.pos()+s,i=[],h=[];let o=0,d=0,u=null,c=0;const _="esriGeometryPolygon"===this.geometryType,g="esriGeometryPolyline"===this.geometryType,f=_?3:g?2:1,m=_||g;for(;r.pos()<n&&r.next();)switch(r.tag()){case 2:{const e=r.getUInt32(),t=r.pos()+e;for(;r.pos()<t;){const e=r.getUInt32();i.push(e),o+=e}u=l(2*o,this._use64Bit).delta;break}case 3:{r.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);t(u);for(const t of i){if(d+e*t>u.length){for(let e=0;e<t;e++)r.getSInt64(),r.getSInt64(),this.hasZ&&r.getSInt64(),this.hasM&&r.getSInt64();continue}let s=r.getSInt64(),a=r.getSInt64();this.hasZ&&r.getSInt64(),this.hasM&&r.getSInt64(),u[d++]=s,u[d++]=a;let n=1;for(let e=1;e<t;e++){const e=r.getSInt64(),t=r.getSInt64();this.hasZ&&r.getSInt64(),this.hasM&&r.getSInt64();const i=s+e,h=a+t;c+=-.5*(i-s)*(h+a),s=i,a=h,0===e&&0===t||y(m,u[d-2],u[d-1],e,t)?(u[d-2]+=e,u[d-1]+=t):(u[d++]=e,u[d++]=t,n+=1)}n>=f?h.push(n):d-=n*e}break}default:r.skip()}return this._cache.area=c,h.length?new a(h,u,this.hasZ,this.hasM):null!=u?this._createDeltaQuantizedExtrudedGeometry(u[0],u[1]):null}}export{m as FeatureSetReaderPBF};