@arcgis/core 5.2.0-next.21 → 5.2.0-next.23

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 (214) hide show
  1. package/Graphic.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js → 1040bce57ea63a6dbca4.js} +2 -2
  4. package/assets/esri/core/workers/chunks/1a7c0a1dc6ecc93ea03a.js +1 -0
  5. package/assets/esri/core/workers/chunks/292498a9c7d462d215c6.js +1 -0
  6. package/assets/esri/core/workers/chunks/2d6d01913096f7cb5ff8.js +1 -0
  7. package/assets/esri/core/workers/chunks/30298f84bd414f9dea64.js +1 -0
  8. package/assets/esri/core/workers/chunks/353c67da4b25c29360db.js +2 -0
  9. package/assets/esri/core/workers/chunks/3b4fc67f6cb7393fbd97.js +1 -0
  10. package/assets/esri/core/workers/chunks/47948c72bc01bd173c20.js +2 -0
  11. package/assets/esri/core/workers/chunks/{f0519b06987471456b69.js → 502464c4eab7667f6566.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{d7acbc2ddff4cee8a465.js → 5ee887fc6e1e0e70e02f.js} +1 -1
  13. package/assets/esri/core/workers/chunks/6c0c77de1934f35dc45f.js +1 -0
  14. package/assets/esri/core/workers/chunks/{f7f820483e45c05ab9e4.js → 75df436e6e9773bdcfc2.js} +1 -1
  15. package/assets/esri/core/workers/chunks/780519b60aa674a61a74.js +1 -0
  16. package/assets/esri/core/workers/chunks/7dbaa089c7472825b80c.js +1 -0
  17. package/assets/esri/core/workers/chunks/7dec8c453fdee1968d12.js +1 -0
  18. package/assets/esri/core/workers/chunks/{a2247f4c3116efb16c4f.js → 7e23de8d9b2d938808f6.js} +1 -1
  19. package/assets/esri/core/workers/chunks/7e4093f42795ba2f8cfd.js +1 -0
  20. package/assets/esri/core/workers/chunks/{6649acaceab00ad30e7f.js → 8ba3e0462a9bdaae5f40.js} +1 -1
  21. package/assets/esri/core/workers/chunks/928b18e13e015330d44b.js +1 -0
  22. package/assets/esri/core/workers/chunks/9434c76ad39c936dba90.js +1 -0
  23. package/assets/esri/core/workers/chunks/{909e67dee8c30e391d69.js → a8310f55de4749f973d0.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{ac16016964be3b684e98.js → aded4e704e09a28edc8f.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{7175f0c6a6e56b685d20.js → b419fd36337e76e2d4a3.js} +6 -6
  26. package/assets/esri/core/workers/chunks/{05d597dd117766beadd8.js → b91a15522692781560b4.js} +1 -1
  27. package/assets/esri/core/workers/chunks/c86d388d216adbb15a05.js +1 -0
  28. package/assets/esri/core/workers/chunks/{f1ff33584680d8718400.js → c9ce408675dae6a0edd1.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{0b522e05668bef729b1b.js → ceb5bd9f2afaa2ea0808.js} +1 -1
  30. package/assets/esri/core/workers/chunks/d07068c44d560e4ce02e.js +1 -0
  31. package/assets/esri/core/workers/chunks/{da47fdffb5969694a2ae.js → d41eed41916ed0422059.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{19493c9c7e1d2ac0f80f.js → d4e0346209fabc58f929.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{b375abfb2a2d9c63e20a.js → db90fb8ac96579259566.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js → dd0acd0f8b96839b4f24.js} +2 -2
  35. package/assets/esri/core/workers/chunks/{5809e70a8e57e9b05959.js → dd795c95cdc3812b5b49.js} +1 -1
  36. package/assets/esri/core/workers/chunks/f7344d855f1092383abe.js +1 -0
  37. package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js → f859c53432f258af77e3.js} +2 -2
  38. package/assets/esri/core/workers/chunks/{ecbf84a1f42e6188faab.js → fd629872b5c07853f695.js} +1 -1
  39. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  40. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -1
  41. package/assets/esri/themes/dark/main.css +1 -1
  42. package/assets/esri/themes/light/main.css +1 -1
  43. package/assets/esri/themes/light/view.css +1 -1
  44. package/chunks/GaussianSplat.glsl.js +4 -4
  45. package/chunks/GaussianSplatShadow.glsl.js +1 -1
  46. package/config.d.ts +9 -2
  47. package/config.js +1 -1
  48. package/core/date.js +1 -1
  49. package/form/FormTemplate.d.ts +15 -20
  50. package/form/elements/AttachmentElement.d.ts +38 -11
  51. package/form/elements/Element.d.ts +9 -6
  52. package/form/elements/FieldElement.d.ts +0 -1
  53. package/form/elements/GroupElement.d.ts +4 -6
  54. package/form/elements/RelationshipElement.d.ts +8 -8
  55. package/form/elements/inputs/attachments/AttachmentInput.d.ts +34 -18
  56. package/form/elements/inputs/attachments/AudioInput.d.ts +4 -3
  57. package/form/elements/inputs/attachments/DocumentInput.d.ts +2 -6
  58. package/form/elements/inputs/attachments/ImageInput.d.ts +4 -3
  59. package/form/elements/inputs/attachments/Input.d.ts +6 -3
  60. package/form/elements/inputs/attachments/SignatureInput.d.ts +3 -3
  61. package/form/elements/inputs/attachments/VideoInput.d.ts +4 -3
  62. package/form/elements.d.ts +6 -12
  63. package/form/types.d.ts +0 -4
  64. package/kernel.js +1 -1
  65. package/layers/AnnotationFeatureLayer.d.ts +2 -1
  66. package/layers/DimensionFeatureLayer.d.ts +2 -1
  67. package/layers/OrientedImageryLayer.d.ts +20 -2
  68. package/layers/OrientedImageryLayer.js +1 -1
  69. package/layers/ParquetLayer.js +1 -1
  70. package/layers/graphics/sources/ParquetSource.js +1 -1
  71. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  72. package/layers/graphics/sources/geojson/geojson.js +1 -1
  73. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  74. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
  75. package/layers/graphics/sources/parquet/fileProviderChangedError.js +2 -0
  76. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  77. package/layers/mixins/EditBusLayer.js +1 -1
  78. package/layers/orientedImagery/core/utils.js +1 -1
  79. package/layers/orientedImagery/types.d.ts +4 -1
  80. package/layers/support/RasterBandInfo.js +1 -1
  81. package/layers/types.d.ts +1 -0
  82. package/package.json +3 -3
  83. package/rest/support/AttachmentQuery.d.ts +13 -1
  84. package/rest/support/AttachmentQuery.js +1 -1
  85. package/rest/support/OutDistance.d.ts +5 -1
  86. package/rest/support/PrintParameters.d.ts +2 -1
  87. package/rest/support/Query.d.ts +2 -0
  88. package/support/basemapUtils.js +1 -1
  89. package/support/revision.js +1 -1
  90. package/symbols/SimpleMarkerSymbol.d.ts +2 -2
  91. package/views/2d/engine/AFeatureContainer.js +1 -1
  92. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  93. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  94. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  95. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  96. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  97. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js +1 -1
  98. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
  99. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  100. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  101. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  102. package/views/2d/layers/features/FeatureContainer.js +1 -1
  103. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  104. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  105. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  106. package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
  107. package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
  108. package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
  109. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  110. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  111. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
  112. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  113. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  114. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  115. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  116. package/views/3d/layers/GaussianSplatLayerViewPerformanceInfo.js +1 -1
  117. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  118. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  119. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  120. package/views/3d/state/utils/navigationUtils.js +1 -1
  121. package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
  122. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  123. package/views/3d/support/gaussianSplatting/GaussianSplatHeaderTexture.js +2 -0
  124. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  125. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +4 -4
  126. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +13 -12
  127. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  128. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  129. package/views/3d/webgl-engine/lib/GaussianSplatShadowRenderNode.js +1 -1
  130. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  131. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  132. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
  133. package/views/PopupView.d.ts +3 -0
  134. package/views/View2D.d.ts +2 -2
  135. package/views/layers/AnnotationFeatureLayerView.d.ts +9 -1
  136. package/views/layers/DimensionFeatureLayerView.d.ts +9 -1
  137. package/views/layers/FeatureLikeLayerView.js +1 -1
  138. package/widgets/BasemapGallery.js +1 -1
  139. package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
  140. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  141. package/widgets/BatchAttributeForm/css.js +1 -1
  142. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  143. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  144. package/widgets/BatchAttributeForm/types.d.ts +0 -7
  145. package/widgets/BatchAttributeForm.d.ts +7 -9
  146. package/widgets/BatchAttributeForm.js +1 -1
  147. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  148. package/widgets/Editor/EditorViewModel.d.ts +12 -2
  149. package/widgets/Editor/EditorViewModel.js +1 -1
  150. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  151. package/widgets/Editor/UpdateWorkflow.js +1 -1
  152. package/widgets/Editor/compatibilityAdapters.js +2 -0
  153. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  154. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  155. package/widgets/Editor/legacy/AddAssociationWorkflow.js +2 -0
  156. package/widgets/Editor/legacy/AddAssociationWorkflowData.js +2 -0
  157. package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +2 -0
  158. package/widgets/Editor/legacy/CreateFeaturesWorkflowData.js +2 -0
  159. package/widgets/Editor/legacy/MergeFeaturesWorkflow.js +2 -0
  160. package/widgets/Editor/legacy/MergeFeaturesWorkflowData.js +2 -0
  161. package/widgets/Editor/legacy/SplitFeatureWorkflow.js +2 -0
  162. package/widgets/Editor/legacy/SplitFeatureWorkflowData.js +2 -0
  163. package/widgets/Editor/legacy/UpdateFeatureWorkflow.js +2 -0
  164. package/widgets/Editor/legacy/UpdateFeatureWorkflowData.js +2 -0
  165. package/widgets/Editor/legacy/UpdateFeaturesWorkflow.js +2 -0
  166. package/widgets/Editor/legacy/UpdateFeaturesWorkflowData.js +2 -0
  167. package/widgets/Editor/legacy/UpdateRecordWorkflow.js +2 -0
  168. package/widgets/Editor/legacy/UpdateRecordWorkflowData.js +2 -0
  169. package/widgets/Editor/legacy/UpdateWorkflow.js +2 -0
  170. package/widgets/Editor/legacy/UpdateWorkflowData.js +2 -0
  171. package/widgets/Editor/legacy/Workflow.js +2 -0
  172. package/widgets/Editor/legacy/workflowUtils.js +2 -0
  173. package/widgets/Editor/types.d.ts +12 -0
  174. package/widgets/Editor/workflowUtils.js +1 -1
  175. package/widgets/Editor.js +1 -1
  176. package/widgets/FeatureForm/FeatureFormViewModel.d.ts +16 -12
  177. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  178. package/widgets/FeatureForm.d.ts +14 -16
  179. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +2 -1
  180. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  181. package/widgets/FeatureTable/Grid/GridViewModel.d.ts +3 -0
  182. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  183. package/widgets/FeatureTable/Grid/types.d.ts +20 -0
  184. package/widgets/FeatureTable.d.ts +14 -2
  185. package/widgets/FeatureTable.js +1 -1
  186. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  187. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  188. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  189. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  190. package/widgets/OrientedImageryViewer/support/panConstraint.js +1 -1
  191. package/widgets/OrientedImageryViewer.js +1 -1
  192. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  193. package/assets/esri/core/workers/chunks/057d288d795b853295f1.js +0 -2
  194. package/assets/esri/core/workers/chunks/26aa8190ac439f634c5b.js +0 -1
  195. package/assets/esri/core/workers/chunks/3192586ec7fc73ed1165.js +0 -1
  196. package/assets/esri/core/workers/chunks/33866e6e6de1bab64599.js +0 -1
  197. package/assets/esri/core/workers/chunks/360fd810d70d21c092d9.js +0 -1
  198. package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +0 -1
  199. package/assets/esri/core/workers/chunks/5aa375b0c6a205134703.js +0 -1
  200. package/assets/esri/core/workers/chunks/5f0bc019add4aff3130c.js +0 -1
  201. package/assets/esri/core/workers/chunks/630ad47857de3cf726d1.js +0 -1
  202. package/assets/esri/core/workers/chunks/754f7ed62afc4e0a1972.js +0 -2
  203. package/assets/esri/core/workers/chunks/7ee76504e7fea389a1c9.js +0 -1
  204. package/assets/esri/core/workers/chunks/8331e04ebe0a54b04ab6.js +0 -1
  205. package/assets/esri/core/workers/chunks/8c64c6b8d7376a9d1c91.js +0 -1
  206. package/assets/esri/core/workers/chunks/c30ca771dd3f7198142b.js +0 -1
  207. package/assets/esri/core/workers/chunks/e5fcd8e7a4a660ef6ad6.js +0 -1
  208. package/assets/esri/core/workers/chunks/f47319d36f1527277923.js +0 -1
  209. package/assets/esri/core/workers/chunks/ff00ac01f0baaecaa890.js +0 -1
  210. /package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js.LICENSE.txt → 1040bce57ea63a6dbca4.js.LICENSE.txt} +0 -0
  211. /package/assets/esri/core/workers/chunks/{057d288d795b853295f1.js.LICENSE.txt → 353c67da4b25c29360db.js.LICENSE.txt} +0 -0
  212. /package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js.LICENSE.txt → 47948c72bc01bd173c20.js.LICENSE.txt} +0 -0
  213. /package/assets/esri/core/workers/chunks/{754f7ed62afc4e0a1972.js.LICENSE.txt → dd0acd0f8b96839b4f24.js.LICENSE.txt} +0 -0
  214. /package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js.LICENSE.txt → f859c53432f258af77e3.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isISO8601Date as e}from"../../../../core/date.js";import t from"../../../../core/Error.js";import{isWGS84 as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromMultipoint as n,convertFromPolyline as r}from"../../featureConversionUtils.js";import{OptimizedFeature as i}from"../../OptimizedFeature.js";import s from"../../OptimizedGeometry.js";import{normalizeFieldName as c,isNumericField as l}from"../../../support/fieldUtils.js";const u={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function f(e){return u[e]}function*p(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*a(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function*y(e,t={}){const{geometryType:o,objectIdField:n}=t;for(const r of e){const{geometry:e,properties:s,id:c}=r;if(e&&f(e.type)!==o)continue;const l=s||{};let u;n&&(u=l[n],null==c||u||(l[n]=u=c)),yield new i(e&&P(e,t),l,null,u)}}function d(e){for(const t of e)if(t.length>2)return!0;return!1}function g(e){return!h(e)}function m(e){return h(e)}function h(e){let t=0;for(let o=0;o<e.length;o++){const n=e[o],r=e[(o+1)%e.length];t+=n[0]*r[1]-r[0]*n[1]}return t<=0}function w(e){const t=e[0],o=e[e.length-1];t[0]===o[0]&&t[1]===o[1]&&t[2]===o[2]||e.push(t)}function P(e,t){const{coordinates:o,type:i}=e,c=t.hasZ??!1,l=!0;switch(i){case"Point":return new s([],[...o],c,!1);case"LineString":return r({paths:[o],hasZ:l},c,!1);case"MultiLineString":return r({paths:o,hasZ:l},c,!1);case"MultiPoint":return n({points:o,hasZ:l},c,!1);case"Polygon":case"MultiPolygon":{const e=new s([],[],c,!1);for(const t of"Polygon"===i?[o]:o){j(e,t[0],c);for(let o=1;o<t.length;o++)b(e,t[o],c)}return e}}}function j(e,t,o){w(t),g(t)?F(e,t,o):S(e,t,o)}function b(e,t,o){w(t),m(t)?F(e,t,o):S(e,t,o)}function S(e,t,o){for(const n of t)G(e,n,o);e.lengths.push(t.length)}function F(e,t,o){for(let n=t.length-1;n>=0;n--)G(e,t[n],o);e.lengths.push(t.length)}function G(e,[t,o,n],r){e.coords.push(t,o),r&&e.coords.push(n||0)}function k(t){switch(typeof t){case"string":return e(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function M(e,n=4326){if(!e)throw new t("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new t("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:r}=e;if(!r)return;const i="string"==typeof r?r:"name"===r.type?r.properties.name:"EPSG"===r.type?r.properties.code:null,s=o({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!i||!s.test(i))throw new t("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:r})}function T(e,t={}){const o=[],n=new Set,r=new Set;let i,s=!1,u=null,y=!1,{geometryType:g=null}=t;for(const l of p(e)){const{geometry:e,properties:t,id:p}=l;if(!e||(g||(g=f(e.type)),f(e.type)===g)){if(!s){s=d(a(e))}if(y||(y=null!=p,y&&(i=typeof p,t&&(u=Object.keys(t).filter(e=>t[e]===p)))),t&&u&&y&&null!=p&&(u.length>1?u=u.filter(e=>t[e]===p):1===u.length&&(u=t[u[0]]===p?u:[])),t)for(const e in t){if(n.has(e))continue;const i=k(t[e]);if("unknown"===i){r.add(e);continue}r.delete(e),n.add(e);const s=c(e);s&&o.push({name:s,alias:e,type:i})}}}const m=c(1===u?.length&&u[0]||null)??void 0;if(m)for(const c of o)if(c.name===m&&l(c)){c.type="esriFieldTypeOID";break}return{fields:o,geometryType:g,hasZ:s,objectIdFieldName:m,objectIdFieldType:i,unknownFields:Array.from(r)}}function O(e,t){return Array.from(y(p(e),t))}export{O as createOptimizedFeatures,f as getGeometryType,T as inferLayerProperties,M as validateGeoJSON};
2
+ import{isDateString as e}from"../../../../core/date.js";import t from"../../../../core/Error.js";import{isWGS84 as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromMultipoint as n,convertFromPolyline as r}from"../../featureConversionUtils.js";import{OptimizedFeature as i}from"../../OptimizedFeature.js";import s from"../../OptimizedGeometry.js";import{normalizeFieldName as c,isNumericField as l}from"../../../support/fieldUtils.js";const u={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function f(e){return u[e]}function*p(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*a(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function*y(e,t={}){const{geometryType:o,objectIdField:n}=t;for(const r of e){const{geometry:e,properties:s,id:c}=r;if(e&&f(e.type)!==o)continue;const l=s||{};let u;n&&(u=l[n],null==c||u||(l[n]=u=c)),yield new i(e&&P(e,t),l,null,u)}}function d(e){for(const t of e)if(t.length>2)return!0;return!1}function g(e){return!h(e)}function m(e){return h(e)}function h(e){let t=0;for(let o=0;o<e.length;o++){const n=e[o],r=e[(o+1)%e.length];t+=n[0]*r[1]-r[0]*n[1]}return t<=0}function w(e){const t=e[0],o=e[e.length-1];t[0]===o[0]&&t[1]===o[1]&&t[2]===o[2]||e.push(t)}function P(e,t){const{coordinates:o,type:i}=e,c=t.hasZ??!1,l=!0;switch(i){case"Point":return new s([],[...o],c,!1);case"LineString":return r({paths:[o],hasZ:l},c,!1);case"MultiLineString":return r({paths:o,hasZ:l},c,!1);case"MultiPoint":return n({points:o,hasZ:l},c,!1);case"Polygon":case"MultiPolygon":{const e=new s([],[],c,!1);for(const t of"Polygon"===i?[o]:o){j(e,t[0],c);for(let o=1;o<t.length;o++)b(e,t[o],c)}return e}}}function j(e,t,o){w(t),g(t)?F(e,t,o):S(e,t,o)}function b(e,t,o){w(t),m(t)?F(e,t,o):S(e,t,o)}function S(e,t,o){for(const n of t)G(e,n,o);e.lengths.push(t.length)}function F(e,t,o){for(let n=t.length-1;n>=0;n--)G(e,t[n],o);e.lengths.push(t.length)}function G(e,[t,o,n],r){e.coords.push(t,o),r&&e.coords.push(n||0)}function k(t){switch(typeof t){case"string":return e(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function M(e,n=4326){if(!e)throw new t("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new t("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:r}=e;if(!r)return;const i="string"==typeof r?r:"name"===r.type?r.properties.name:"EPSG"===r.type?r.properties.code:null,s=o({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!i||!s.test(i))throw new t("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:r})}function T(e,t={}){const o=[],n=new Set,r=new Set;let i,s=!1,u=null,y=!1,{geometryType:g=null}=t;for(const l of p(e)){const{geometry:e,properties:t,id:p}=l;if(!e||(g||(g=f(e.type)),f(e.type)===g)){if(!s){s=d(a(e))}if(y||(y=null!=p,y&&(i=typeof p,t&&(u=Object.keys(t).filter(e=>t[e]===p)))),t&&u&&y&&null!=p&&(u.length>1?u=u.filter(e=>t[e]===p):1===u.length&&(u=t[u[0]]===p?u:[])),t)for(const e in t){if(n.has(e))continue;const i=k(t[e]);if("unknown"===i){r.add(e);continue}r.delete(e),n.add(e);const s=c(e);s&&o.push({name:s,alias:e,type:i})}}}const m=c(1===u?.length&&u[0]||null)??void 0;if(m)for(const c of o)if(c.name===m&&l(c)){c.type="esriFieldTypeOID";break}return{fields:o,geometryType:g,hasZ:s,objectIdFieldName:m,objectIdFieldType:i,unknownFields:Array.from(r)}}function O(e,t){return Array.from(y(p(e),t))}export{O as createOptimizedFeatures,f as getGeometryType,T as inferLayerProperties,M as validateGeoJSON};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as t,__disposeResources as e}from"tslib";import a from"../../../../request.js";import has from"../../../../core/has.js";import{QueueProcessor as s}from"../../../../core/QueueProcessor.js";import{isBlobProtocol as r}from"../../../../core/urlUtils.js";import{ParquetFileInfo as n}from"./ParquetFileInfo.js";import{parseFileStatisticsMap as i}from"./ParquetFileStatistics.js";import{createParquetFile as o,readMetadata as c}from"../../../../libs/parquet/parquet.js";const h="parquet.v1",u="_spatial.json",f=new s({concurrency:12,process:async t=>{const{data:e}=await a(t.url,t.options);return e}});class l{constructor(t,e=()=>{}){this._geometryInfo=t,this._getCustomParameters=e}async destroy(){await this.clear()}async clear(){if(this._infos){const t=await this._infos;for(const e of t.values())e.destroy();t.clear(),this._infos=null}}async getMetadata(){const a={stack:[],error:void 0,hasError:!1};try{const e=(await this._getParquetFileNames()).at(0);if(!e)return null;const s=t(a,await o(e,{provider:this}),!1);return c(s)}catch(s){a.error=s,a.hasError=!0}finally{e(a)}}getGeometryInfo(){return this._geometryInfo}async getFiles(){const t=await this._getInfoMap();return Array.from(t.values())}async updateGeometryInfo(t){if(this._geometryInfo)throw new Error("GeometryInfo already set");await this.clear(),this._geometryInfo=t}async fetchLength(t){const{byteLength:e,cacheTag:a}=await this._fetchLengthAndTag(t);if(!has("parquetlayer-cache-enabled"))return e;try{await this._createOrResetCache(t,a)}catch(s){}return e}async fetchRange(t,e,a,s){if(!has("parquetlayer-cache-enabled"))return this._fetchRange(t,e,a,s);const r=new URL(this._getCacheFileName(t));r.searchParams.append("range",`${e}-${a}`);try{const n=await this._openCache(t),i=await n.match(r);if(i)return await i.arrayBuffer();const o=await this._fetchRange(t,e,a,s);return await n.put(r,new Response(o,{headers:{"Content-Type":"application/octet-stream","Content-Length":o.byteLength.toString()}})),o}catch(n){return this._fetchRange(t,e,a,s)}}_getCacheFileName(t){return t}async _requestStatistics(t){const{data:e}=await a(t,{responseType:"json",query:this._getCustomParameters()});return e}async _fetchRange(t,e,a,s){const r={url:t,options:{responseType:"array-buffer",query:this._getCustomParameters()??{},cacheMode:"no-store",useQueue:!0,headers:{range:`bytes=${e}-${a}`}}};return f.push(r)}async _fetchLengthAndTag(t){if(r(t)){const{data:e}=await a(t,{responseType:"blob"});return{byteLength:e.size,cacheTag:null}}const e=await this._requestHead(t),s=e.headers.get("Content-Length");if(null==s)throw new Error("Unable to parse content length");const n=e.headers.get("etag")??e.headers.get("Last-Modified");return{byteLength:parseInt(s,10),cacheTag:n}}async _getInfoMap(){return this._infos||(this._infos=this._fetchParquetFiles()),this._infos}async _updateParquetFileInfos(t){const e=await this._getInfoMap(),a=new Set(t);for(const s of a)if(!e.get(s)){const t=e.size,a=await n.create(this.getGeometryInfo(),this,s,t,null);e.set(s,a)}for(const s of e.keys())if(!a.has(s))throw new Error("Deletion not supported")}async _getFileStatistics(t){this._statistics||(this._statistics=this._fetchStatistics());const e=await this._statistics,a=p(t);return e.get(a)}async _fetchParquetFiles(){const t=(await this._getParquetFileNames()).map(async(t,e)=>{const a=e,s=await this._getFileStatistics(t);return n.create(this.getGeometryInfo(),this,t,a,s)}),e=await Promise.all(t),a=new Map;for(const s of e)a.set(s.url,s);return a}async _fetchStatistics(){const t=await this._getStatisticsFileName();if(null==t)return new Map;const e=await this._resolveFileUrl(t),a=await this._requestStatistics(e);return i(a)}async _requestHead(t){const{data:e}=await a(t,{responseType:"native",method:"head",query:this._getCustomParameters()});return e}async _openCache(t){return caches.open(this._getCacheName(t))}_getCacheName(t){return`${h}:${this._getCacheFileName(t)}`}async _createOrResetCache(t,e){const a=this._getCacheName(t),s=new URL(this._getCacheFileName(t));if(s.searchParams.append("metadata","true"),null==e)return void await caches.delete(a);let r=await caches.open(a);const n=await r.match(s),i=await(n?.json());i?.tag!==e&&(await caches.delete(a),r=await caches.open(a));const o=JSON.stringify({tag:e});await r.put(s,new Response(o,{headers:{"Content-Type":"application/json","Content-Length":o.length.toString()}}))}}function g(t){const e=t.split(/[?#]/)[0];return e===u||e.endsWith(u)}function p(t){return t.split(/[?#]/)[0].split("/").at(-1)??t}export{l as FileProvider,g as isStatisticsFileName,u as spatialFileName};
2
+ import{__addDisposableResource as t,__disposeResources as e}from"tslib";import a from"../../../../request.js";import s from"../../../../core/Error.js";import{EventEmitter as r}from"../../../../core/Evented.js";import has from"../../../../core/has.js";import{QueueProcessor as n}from"../../../../core/QueueProcessor.js";import{isBlobProtocol as i}from"../../../../core/urlUtils.js";import{ParquetFileInfo as o}from"./ParquetFileInfo.js";import{parseFileStatisticsMap as c}from"./ParquetFileStatistics.js";import{createParquetFile as h,readMetadata as u}from"../../../../libs/parquet/parquet.js";const f="parquet.v1",l="_spatial.json",g=new n({concurrency:12,process:async t=>{const{data:e}=await a(t.url,t.options);return e}});class p{constructor(t,e=()=>{}){this._geometryInfo=t,this._getCustomParameters=e,this.events=new r}async destroy(){await this.clear()}async clear(){if(this._infos){const t=await this._infos;for(const e of t.values())e.destroy();t.clear(),this._infos=null}}async getMetadata(){const a={stack:[],error:void 0,hasError:!1};try{const e=(await this._getParquetFileNames()).at(0);if(!e)return null;const s=t(a,await h(e,{provider:this}),!1);return u(s)}catch(s){a.error=s,a.hasError=!0}finally{e(a)}}getGeometryInfo(){return this._geometryInfo}async getFiles(){const t=await this._getInfoMap();return Array.from(t.values())}async updateGeometryInfo(t){if(this._geometryInfo)throw new Error("GeometryInfo already set");await this.clear(),this._geometryInfo=t}async fetchLength(t){const{byteLength:e,cacheTag:a}=await this._fetchLengthAndTag(t);if(!has("parquetlayer-cache-enabled"))return e;try{await this._createOrResetCache(t,a)}catch(s){}return e}async fetchRange(t,e,a,s){if(!has("parquetlayer-cache-enabled"))return this._fetchRange(t,e,a,s);const r=new URL(this._getCacheFileName(t));r.searchParams.append("range",`${e}-${a}`);try{const n=await this._openCache(t),i=await n.match(r);if(i)return await i.arrayBuffer();const o=await this._fetchRange(t,e,a,s);return await n.put(r,new Response(o,{headers:{"Content-Type":"application/octet-stream","Content-Length":o.byteLength.toString()}})),o}catch(n){return this._fetchRange(t,e,a,s)}}_getCacheFileName(t){return t}async _requestStatistics(t){const{data:e}=await a(t,{responseType:"json",query:this._getCustomParameters()});return e}async _fetchRange(t,e,a,r){const n={url:t,options:{responseType:"array-buffer",query:this._getCustomParameters()??{},cacheMode:"no-store",useQueue:!0,headers:{range:`bytes=${e}-${a}`}}},i=await g.push(n),o=a-e+1;if(i.byteLength!==o)throw new s("InvalidRangeRequest",`request returned ${i.byteLength} bytes for range ${e}-${a}, expected ${o}.`);return i}async _fetchLengthAndTag(t){if(i(t)){const{data:e}=await a(t,{responseType:"blob"});return{byteLength:e.size,cacheTag:null}}const e=await this._requestHead(t),s=e.headers.get("Content-Length");if(null==s)throw new Error("Unable to parse content length");const r=e.headers.get("etag")??e.headers.get("Last-Modified");return{byteLength:parseInt(s,10),cacheTag:r}}async _getInfoMap(){return this._infos||(this._infos=this._fetchParquetFiles()),this._infos}async _updateParquetFileInfos(t){const e=await this._getInfoMap(),a=new Set(t);for(const s of a)if(!e.get(s)){const t=e.size,a=await o.create(this.getGeometryInfo(),this,s,t,null);e.set(s,a)}for(const s of e.keys())if(!a.has(s))throw new Error("Deletion not supported")}async _getFileStatistics(t){this._statistics||(this._statistics=this._fetchStatistics());const e=await this._statistics,a=m(t);return e.get(a)}async _fetchParquetFiles(){const t=(await this._getParquetFileNames()).map(async(t,e)=>{const a=e,s=await this._getFileStatistics(t);return o.create(this.getGeometryInfo(),this,t,a,s)}),e=await Promise.all(t),a=new Map;for(const s of e)a.set(s.url,s);return a}async _fetchStatistics(){const t=await this._getStatisticsFileName();if(null==t)return new Map;const e=await this._resolveFileUrl(t),a=await this._requestStatistics(e);return c(a)}async _requestHead(t){const{data:e}=await a(t,{responseType:"native",method:"head",query:this._getCustomParameters()});return e}async _openCache(t){return caches.open(this._getCacheName(t))}_getCacheName(t){return`${f}:${this._getCacheFileName(t)}`}async _createOrResetCache(t,e){const a=this._getCacheName(t),s=new URL(this._getCacheFileName(t));if(s.searchParams.append("metadata","true"),null==e)return void await caches.delete(a);let r=await caches.open(a);const n=await r.match(s),i=await(n?.json());i?.tag!==e&&(await caches.delete(a),r=await caches.open(a));const o=JSON.stringify({tag:e});await r.put(s,new Response(o,{headers:{"Content-Type":"application/json","Content-Length":o.length.toString()}}))}}function y(t){const e=t.split(/[?#]/)[0];return e===l||e.endsWith(l)}function m(t){return t.split(/[?#]/)[0].split("/").at(-1)??t}export{p as FileProvider,y as isStatisticsFileName,l as spatialFileName};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../request.js";import{FileProvider as t,isStatisticsFileName as s}from"./FileProvider.js";const r=100;class a extends t{constructor(e,t,s){super(t,s),this._schema=e}get _baseUrl(){return this._schema.itemCdnUrl??this._schema.itemUrl}async update(e){throw new Error("Unsupported")}async _getParquetFileNames(){const e=await this._getResources();return Array.from(e.keys()).filter(e=>e.endsWith(".parquet"))}async _getStatisticsFileName(){const e=await this._getResources();return Array.from(e.keys()).find(s)??null}_getCacheFileName(e){return`${this._baseUrl}/resources/${e}`}async _resolveFileUrl(e){const t=await this._getResource(e);return t.signedUrl?t.signedUrl:`${this._baseUrl}/resources/${e}`}async _fetchLengthAndTag(e){const t=await this._getResource(e),s=this._schema.itemMetadata.modified.getTime().toString();return{byteLength:t.size,cacheTag:s}}async _fetchRange(e,t,s,r){try{const a=await this._resolveFileUrl(e);return await super._fetchRange(a,t,s,r)}catch{this._invalidate()}const a=await this._resolveFileUrl(e);return super._fetchRange(a,t,s,r)}_invalidate(){this._resources=null}async _getResources(){return this._resources||(this._resources=this._fetchResources()),await this._resources}async _getResource(e){const t=(await this._getResources()).get(e);if(!t)throw new Error(`Resource ${e} not found.`);return t}async _fetchResources(){const t=new Map;let s=1;const a=n(this._schema.itemMetadata.url);for(;-1!==s;){const n=await e(`${this._baseUrl}/resources`,{query:{f:"json",start:s,num:r}});for(const e of n.data.resources)e.resource.startsWith(a)&&t.set(e.resource,e);s=n.data.nextStart}return t}}function n(e){const t=e.split("/").filter(Boolean),s=t.indexOf("resources");if(-1===s||s===t.length-1)throw new Error(`URL does not contain a resources directory name: ${e}`);return`${t.slice(s+1).map(e=>decodeURIComponent(e)).join("/")}/`}export{a as PortalParquetResourcesFileProvider};
2
+ import e from"../../../../request.js";import{FileProvider as t,isStatisticsFileName as r}from"./FileProvider.js";import{createFileProviderChangedError as s}from"./fileProviderChangedError.js";const a=100;class i extends t{constructor(e,t,r){super(t,r),this._schema=e,this._directoryChanged=!1}get _baseUrl(){return this._schema.itemCdnUrl??this._schema.itemUrl}async update(e){throw new Error("Unsupported")}async _getParquetFileNames(){const e=await this._getResources();return Array.from(e.keys()).filter(e=>e.endsWith(".parquet"))}async _getStatisticsFileName(){const e=await this._getResources();return Array.from(e.keys()).find(r)??null}_getCacheFileName(e){return`${this._baseUrl}/resources/${e}`}async _resolveFileUrl(e){const t=await this._getResource(e);return t.signedUrl?t.signedUrl:`${this._baseUrl}/resources/${e}`}async _fetchLengthAndTag(e){const t=await this._getResource(e),r=this._schema.itemMetadata.modified.getTime().toString();return{byteLength:t.size,cacheTag:r}}async _fetchRange(e,t,r,a){if(this._directoryChanged)throw s();try{const s=await this._resolveFileUrl(e);return await super._fetchRange(s,t,r,a)}catch{if("directory-changed"===await this._refetchResources())throw s()}const i=await this._resolveFileUrl(e);return super._fetchRange(i,t,r,a)}_refetchResources(){return this._directoryChanged?Promise.resolve("directory-changed"):(this._updateResourcesPromise||(this._updateResourcesPromise=this._executeRefetchResources().finally(()=>{this._updateResourcesPromise=null})),this._updateResourcesPromise)}async _executeRefetchResources(){return await this._refetchPortalItemMetadata()?(this.events.emit("sourceChanged"),this._directoryChanged=!0,"directory-changed"):(this._resources=this._fetchResources(),"ok")}async _refetchPortalItemMetadata(){const t=this._schema.itemMetadata.url,r=await e(this._schema.itemUrl,{responseType:"json",query:{f:"json"}}),{modified:s,url:a}=r.data;if(null==a)throw new Error("Portal item metadata must have a url defined.");if(null==s)throw new Error("Portal item metadata must have a modified timestamp defined.");return this._schema.itemMetadata={modified:new Date(s),url:a},t!==a}async _getResources(){return this._resources||(this._resources=this._fetchResources()),await this._resources}async _getResource(e){const t=(await this._getResources()).get(e);if(!t)throw new Error(`Resource ${e} not found.`);return t}async _fetchResources(){const t=new Map;let r=1;const s=o(this._schema.itemMetadata.url);for(;-1!==r;){const i=await e(`${this._baseUrl}/resources`,{query:{f:"json",start:r,num:a}});for(const e of i.data.resources)e.resource.startsWith(s)&&t.set(e.resource,e);r=i.data.nextStart}return t}}function o(e){const t=e.split("/").filter(Boolean),r=t.indexOf("resources");if(-1===r||r===t.length-1)throw new Error(`URL does not contain a resources directory name: ${e}`);return`${t.slice(r+1).map(e=>decodeURIComponent(e)).join("/")}/`}export{i as PortalParquetResourcesFileProvider};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import r from"../../../../core/Error.js";function e(r){return null!=r&&"object"==typeof r&&"name"in r&&"FileProviderChangedError"===r.name}function n(e=""){return new r("FileProviderChangedError",e)}export{n as createFileProviderChangedError,e as isFileProviderChangedError};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as r}from"../../../../core/compilerUtils.js";import s from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{onAbortOrThrow as n,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{QueueProcessor as u}from"../../../../core/QueueProcessor.js";import{parseWhereClause as o}from"../../../../core/sql.js";import l from"../../../../geometry/SpatialReference.js";import{set as c,create as p,expandWithAABB as d,expandWithRect as f,negativeInfinity as m}from"../../../../geometry/support/aaBoundingBox.js";import{copy as y,negativeInfinity as h,create as g,expandWithRect as _}from"../../../../geometry/support/aaBoundingRect.js";import{getScaleForResolution as w}from"../../../../geometry/support/scaleUtils.js";import{isWebMercator as x,isWGS84 as F}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertToGeometry as S}from"../../featureConversionUtils.js";import{getFieldNamesFromStatistics as I}from"../../data/attributeSupport.js";import{getQueryResultExtent as q,getQueryBoundingRects as v,QueryEngine as R}from"../../data/QueryEngine.js";import{queryCapabilities as b}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as C}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as E}from"../../data/queryUtils.js";import{createFileProvider as O}from"../parquet/createFileProvider.js";import{createDrawingInfo as P}from"./clientSideDefaults.js";import{getParquetFileId as T,getParquetRowId as Q,getParquetObjectId as j}from"./parquetIdUtils.js";import N from"../../../support/Field.js";import M from"../../../support/FieldsIndex.js";import{isNumericField as A}from"../../../support/fieldUtils.js";import{fromParquetGeometryEncodingJSON as B}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as G,fromParquetJSONGeometryType as D,toParquetJSONGeometryType as z}from"../../../support/parquetUtils.js";import{loadParquetModule as V}from"../../../../libs/parquet/loadParquetModule.js";import{FeatureStoreQueryAdapter as W}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as U}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as k}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as J}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as Z}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const L=new W,H=4,Y="__OBJECTID",X=new TextDecoder,$=8e3,K=2e7,ee=8,te=2,re=20;class se{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){a(e),await this._fill(e);const t=await ie(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,null!=t.chunk)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<ee;){const t=this._getOrCreateNextStream(e);if(null==t)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){const t=this._resolvedCount>=ee?ee:te;if(this._fileIndex<this._files.length&&this._streams.length<t){const t=this._files[this._fileIndex++],r=new ne(t.id,this._createFileStream(t,e));return this._streams.push(r),r}return this._getNextStream()}_getNextStream(){const e=this._streams.length;for(let t=0;t<e;t++){const r=(this._streamIndex+t)%e,s=this._streams[r];if(s.canRead)return this._streamIndex=(r+1)%e,s}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function ie(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class ne{constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&0===this._readCount}async read(e){this._readCount++;try{const t=await this._stream,r=await t.next(e);return null==r?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:r}}finally{this._readCount--}}}class ae{constructor(){this._queue=new u({concurrency:H,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={}}async load(e){const t=e.spatialReference?l.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new s("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");this._customParameters=e.customParameters,this._provider=O(e.provider,null,()=>this._customParameters);const r=await this._provider.getMetadata(),n=await G(r,{fields:e.fields?.map(e=>N.fromJSON(e)),geometryEncoding:e.geometryEncoding?B(e.geometryEncoding):null,geometryType:e.geometryType?D(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(!n.fields)throw new s("parquet:unsupported","Fields must be defined");let a;if(n.spatialReference&&n.geometryType){if(!n.spatialReference)throw new s("parquet:unsupported","SpatialReference must be defined");if(!n.spatialReference.isGeographic&&!n.spatialReference.isWebMercator)throw new s("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");n.spatialReference.isGeographic&&!n.spatialReference.isWGS84&&(i.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:n.spatialReference}),n.spatialReference=l.WGS84),a={geometry:n.geometryEncoding?{geometryType:z(n.geometryType),spatialReference:n.spatialReference.toJSON(),encoding:n.geometryEncoding.toJSON()}:null,displayOptimization:n.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=n.displayOptimization,await this._provider.updateGeometryInfo(a),this._capabilities=Ce(await this._getFileStatistics());const u=await this._provider.getFiles();if(!u.length)return{layerDefinition:{},capabilities:Ce(null)};const o=await u[0].file;n.file=o;const{fields:c}=n;if(null==c)throw new s("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",c);c.push(new N({name:Y,type:"oid",alias:Y}));for(const s of c){const e=o.getColumnId(s.name);null!=e&&(this._indexMap[s.name]=e)}const p=new M(c.map(e=>e.toJSON()));this._fieldsIndex=p;const d=z(n.geometryType??"point");return this._metadata=J.createFeature({fieldsIndex:p.toJSON(),geometryType:d,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:Y},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:n.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:d,featureIdInfo:{type:"object-id",fieldName:Y},hasM:!1,hasZ:!1,spatialReference:n.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=r?.extent?r.extent:await this._tryDeriveParquetFullExtent(n),{capabilities:this._capabilities,layerDefinition:{fields:n.fields?.map(e=>e.toJSON()),drawingInfo:P(d),extent:this._fullExtent??void 0,geometryType:d,geometryEncoding:n.geometryEncoding?.toJSON(),displayOptimization:n.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(const{handle:e}of this._streams.values())e.remove();this._streams.clear()}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._provider=O(e,this._provider.getGeometryInfo(),()=>this._customParameters)}async queryFeatures(e,t){const r=await E(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),Ee(r)||(r.resultRecordCount=r.resultRecordCount?Math.min(r.resultRecordCount,$):$,r.resultOffset=r.resultOffset??0),r.outStatistics)return this._queryStatistics(r,t);r.returnDistinctValues&&(r.returnGeometry=void 0);return(await this._enqueueQuery(r,t)).createQueryResponse()}async queryFeatureCount(e,t){const r=await E(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!ce(r))return this._getFeatureCount();r.outFields=void 0,r.returnGeometry=void 0;return(await this._enqueueQuery(r,t)).createQueryResponseForCount()}async queryObjectIds(e,t){const r=await E(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!ce(r))return Array.from({length:await this._getFeatureCount()},(e,t)=>t);r.resultRecordCount=r.resultRecordCount?Math.min(r.resultRecordCount,8e3):8e3,r.resultOffset=r.resultOffset??0,r.returnGeometry=void 0,r.outFields=void 0;return(await this._enqueueQuery(r,t)).items.map(e=>e.getObjectId())}async queryAttributeBins(e,t={}){throw new s("parquet:unsupported","queryAttributeBins not supported.")}async queryExtent(e,t){const s=await E(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(s),this._fullExtent&&!ce(s))return{count:await this._getFeatureCount(),extent:this._fullExtent};const i=r(this._metadata.spatialReference);s.returnGeometry=!0,s.outFields=void 0;const n=c(p(),m),a=p(),u=await this._enqueueQuery(s,t);let o=0;for(const r of u.items)r.getBounds(a)&&(d(n,a),o+=1);return{count:o,extent:q(n,i,s.outSR?r(s.outSR):i.toJSON(),i,!1)}}async queryStream(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const r=await this._getCandidateFiles(e),s=new se(r,async(t,r)=>{const s=await t.file,i=await this._createParquetDisplayQuery(s,t.id,e);return s.executeQuery(i,$,r)}),i=this._streamIdCounter++,a=n(t.signal,e=>{const t=this._streams.get(i);null!=t&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:s,handle:a}),i}async getStreamNext(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const r=this._streams.get(e);if(!r)return{result:null};const s=await r.stream.next(t.signal);if(null==s)return r.handle.remove(),this._streams.delete(e),{result:null};const i=s.chunk.serialize().buffer,n={fileId:s.fileId,buffer:i};return i instanceof ArrayBuffer?{result:n,transferList:[i]}:{result:n}}async getStreamNextFeatures(e,t){const{result:r}=await this.getStreamNext(e,t);if(null==r)return null;const s=(await V()).ParquetChunk.deserialize(new Uint8Array(r.buffer)),i=new Z(this._metadata,this._indexMap,s,r.fileId),n=[];for(;i.next();){const e=S(i.readGeometryWorldSpace(),i.geometryType,i.hasZ,i.hasM),t=i.readAttributes();n.push({attributes:t,geometry:e})}return{features:n}}async createPatch(e,t,r,s,i){if(!i.signal)throw new Error("InternalError: AbortSignal must be passed");const n=await this._getFileInfoById(e),a=await n.file;return(await a.createChunkPatch(t,r,s,i.signal)).serialize().buffer}async _getCandidateFiles(e){const t=await this._provider.getFiles(),r=await this._getSpatialFilePruning(e);if(null==r)return t;const s=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,r));return"xz"===r.type?Se(s,r):s}async _queryStatistics(e,t){const r=await E({...e},null,this._queryEngineParams.spatialReference);if(r.returnGeometry=void 0,fe(r,this._fieldsIndex)){const e=await this._getStatisticsFromFiles(r);if(e)return e}return(await this._enqueueQuery(r,t)).createQueryResponse()}async _getStatisticsFromFiles(e){const t=await this._provider.getFiles(),r={},s=[];for(const i of e.outStatistics??[]){const e=he(i,t);if(!e.available)return null;r[i.outStatisticFieldName]=e.value,s.push(ye(i,this._fieldsIndex))}return{fields:s,features:[{attributes:r}]}}async _getSpatialFilePruning(e){if("tile"!==e.type&&("arcade"!==e.type||null==e.extent))return null;const t=this._displayOptimization,r=t?.index;if(null==r)return null;const s=e.outSpatialReference.wkid;if(null==r.wkid||null==s)return null;const i=r.wkid,n=await V();switch(r.type){case"xz":return{type:"xz",fieldName:r.code,intersects:(t,a)=>n.queryIntersectsXZStatistics(r.fullExtent,e.extent,s,i,re,t,a)};case"z":return{type:"xy",xFieldName:r.xColumn,yFieldName:r.yColumn,intersects:(t,r,a,u)=>n.queryIntersectsXYStatistics(e.extent,s,i,t,r,a,u)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case"xz":{const r=Fe(e,t);return null==r||ve(r,t)}case"xy":{const{xStatistics:r,yStatistics:s}=qe(e,t);return null==r||null==s||Re(r,s,t)}}}async _tryDeriveParquetFullExtent(r){if(!r.spatialReference)return null;if(null==this._fullExtent&&"location"===r.geometryEncoding?.type){const i=await this._provider.getFiles(),{xField:n,yField:a}=r.geometryEncoding,u=c(p(),m);for(const r of i){const i=await r.file;for(const r of i.rowGroups()){const i={stack:[],error:void 0,hasError:!1};try{const t=e(i,r.columnDescriptorForAttribute(n),!1),s=e(i,r.columnDescriptorForAttribute(a),!1),o=[t.minValue(),s.minValue(),t.maxValue(),s.maxValue()];f(u,o),r.free()}catch(s){i.error=s,i.hasError=!0}finally{t(i)}}}return{xmin:u[0],ymin:u[1],xmax:u[3],ymax:u[4],spatialReference:r.spatialReference?.toJSON()}}return null}async _getFileInfoById(e){const t=await this._provider.getFiles();for(const r of t)if(r.id===e)return r;throw new Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t,r,s,i){const n=(await V()).Query.new();null!=r&&n.setPreFilterStart(r),null!=s&&n.setPreFilterCount(s),null!=i&&n.setPostFilterCount(i);const a=await this._getRequiredFields(e);n.setOutFields(a),(e.geometry||e.returnGeometry)&&n.setReturnGeometry(!0);const u=this._tryGetGeneralizedGeometryScale(e);null!=u&&n.setScale(u);const o=e.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=o.wkid;if(e.geometry&&(x(o)||F(o))){const t=y(g(),h);for(const r of v(e.geometry))_(t,r);n.setOutSpatialReference(l),n.setExtent({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]})}if(e.where){const{id:r,file:s}=t;await this._setWhereClause(n,await s,r,e.where)}return n}async _createParquetDisplayQuery(e,t,r){const s=(await V()).Query.new();return"tile"===r.type?(s.setExtent(r.extent),s.setQuantizationTransform(r.transform),s.setScale(r.scale)):"arcade"===r.type&&null!=r.extent&&s.setExtent(r.extent),s.setOutFields(r.outFields.filter(e=>null!=this._indexMap[e])),s.setOutSpatialReference(r.outSpatialReference.wkid),s.setReturnGeometry(r.returnGeometry),r.where&&await this._setWhereClause(s,e,t,r.where),s}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new s("parquet:unsupported","Statistics queries are not supported",{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new s("parquet:unsupported","Queries using orderBy are not supported",{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new s("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:e})}async _setWhereClause(e,t,r,i){const n=this._indexMap,a=this._fieldsIndex,u={getAttribute(e,s){const i=n[s];if(null==i){const t=a.get(s);if("__OBJECTID"===t?.name){const t=e.row+e.rowGroupStart;return j(r,t)}return null}const u=t.readAttribute(e.rowGroup,e.row,i);if(null==u)return null;const o=a.get(s);return"esriFieldTypeString"===o.type||"esriFieldTypeDateOnly"===o.type||"esriFieldTypeTimeOnly"===o.type||"esriFieldTypeTimestampOffset"===o.type?X.decode(u):u}},l=await o(i,this._fieldsIndex);if(!l.isStandardized)throw new s("sql-parse-error","expression is not standardized");const c=(e,t,r)=>l.testFeatureCompiled({rowGroup:e,row:t,rowGroupStart:r},u,null),p=l.fieldNames.map(e=>a.get(e)).filter(e=>e&&null!=this._indexMap[e?.name]);e.setWhere(i),e.setWhereEvaluator(c),e.setWhereFields(p.map(e=>e.name))}async*_streamFeatures(e,t,r,s,i){const n=await this._provider.getFiles();let a=0;for(const u of n){const n=a,o=a+u.statistics.rowCount;if(a+=u.statistics.rowCount,null!=t&&t>=o)continue;const l=null!=t?Math.max(t-n,0):null;let c=r;if(null!=r){const e=t??0,s=e+r,i=Math.max(e,n),a=Math.min(s,o);c=Math.max(a-i,0)}if(0===c)continue;const p=await this._createParquetQuery(e,u,l,c,s),d=await u.file,f=await d.executeQuery(p,$),m=async()=>{const e=await f.next(i);if(!e)return null;const t=new Z(this._metadata,this._indexMap,e,u.id);return xe([new U(t,null,0,!1)],this._queryEngineParams)};let y=await m();for(;null!=y;)yield y,y=await m()}}async _queryFeaturesWithQueryEnginePagination(e,t){const r=[],s=this._streamFeatures(e,null,null,null,t);let i=await s.next();for(;!i.done;){const n=await i.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(const e of n)r.push(e);i=await s.next()}return r}async _queryFeaturesWithUpfrontPagination(e,t){let r,s,i,n=e.resultOffset??0,a=e.resultRecordCount??$;pe(e)?de(e)||(i=n+a):(n&&(r=n,n=0),s=e.resultRecordCount);const u=[],o=this._streamFeatures(e,r,s,i,t);let l=await o.next();for(;!l.done&&a>0;){const r=await l.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(const e of r)if(n>0)n--;else if(u.push(e),--a<=0)return u;l=await o.next()}return u}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){if(e.objectIds?.length){const r=new Map;for(const t of e.objectIds){const e=T(t),s=Q(t);let i=r.get(e);i||(i=[],r.set(e,i)),i.push(s)}const s=[];for(const[i,n]of r.entries()){const r=await this._executeFileIdQuery(e,i,n,t);for(const e of r)s.push(e)}return new C(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:L,featureIdInfo:this._queryEngineParams.featureIdInfo})}if("1=1"===e.where&&(e.where=null),e.resultOffset??=0,e.resultRecordCount??=await this._getFeatureCount(),e.resultRecordCount>K){if(!(this._displayOptimization&&e.geometry))throw new s("parquet:cannot-execute-query","Unable to execute query, dataset is too large.")}const r=!!e.orderByFields?.length||!!e.outStatistics?.length||!!e.returnDistinctValues,i=r?await this._queryFeaturesWithQueryEnginePagination(e,t):await this._queryFeaturesWithUpfrontPagination(e,t);return r||(e.resultOffset=0),new C(i,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:L,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,r,s){const i=await this._getRequiredFields(e),n=(await V()).Query.new();n.setOutFields(i),n.setReturnGeometry(!!e.returnGeometry),n.setIds(new Uint32Array(r));const a=await this._getFile(t),u=await a.executeQuery(n,$,s);let o=await u.next(s),l=0;const c=[];for(;null!=o;){const e=new Z(this._metadata,this._indexMap,o,t),r=new U(e,null,l++,!1);c.push(r),o=await u.next(s)}return xe(c,this._queryEngineParams).executeQueryForOpaqueFeatures(e,s)}async _getRequiredFields(e){const t=new Set;if(e.outStatistics)for(const r of I(this._fieldsIndex,e.outStatistics,e.groupByFieldsForStatistics))t.add(r);else if(e.outFields)for(const r of e.outFields)t.add(r);return(t.has("*")?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>null!=this._indexMap[e])}_tryGetGeneralizedGeometryScale(e){if(!this._displayOptimization)return null;const t=e.outSR??this._queryEngineParams.spatialReference;if(!x(t)&&!F(t))return null;const r=e.quantizationParameters?.tolerance??e.maxAllowableOffset;return r?w(r,t):null}}function ue(e){switch(e){case"fullText":case"having":case"timeExtent":case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"geometry":case"resultOffset":case"resultRecordCount":return!0;default:return!1}}function oe(e){switch(e){case"fullText":case"having":case"timeExtent":case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"geometry":return!0;default:return!1}}function le(e){switch(e){case"fullText":case"having":case"timeExtent":return!0;case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"resultOffset":case"geometry":case"resultRecordCount":return!1}return!1}function ce(e){for(const t in e){const r=t;if(ue(r)&&null!==e[r])return!0}return!1}function pe(e){for(const t in e){const r=t;if(oe(r)&&null!==e[r])return!0}return!1}function de(e){for(const t in e){const r=t;if(le(r)&&null!==e[r])return!0}return!1}function fe(e,t){return!!e.outStatistics?.length&&!ce(e)&&!e.groupByFieldsForStatistics?.length&&!e.orderByFields?.length&&!e.returnDistinctValues&&!e.returnAggIds&&e.outStatistics.every(e=>me(e,t))}function me(e,t){switch(e.statisticType){case"count":return"1"===e.onStatisticField||null!=t.get(e.onStatisticField);case"min":case"max":{const r=t.get(e.onStatisticField);return null!=r&&A(r)}default:return!1}}function ye(e,t){const r="exceedslimit"!==e.statisticType?t.get(e.onStatisticField):null,s="min"!==e.statisticType&&"max"!==e.statisticType||"esriFieldTypeDate"!==r?.type?"esriFieldTypeDouble":r.type;return{name:e.outStatisticFieldName,alias:e.outStatisticFieldName,type:s}}function he(e,t){switch(e.statisticType){case"count":return ge(e,t);case"min":return _e(e,t,Math.min);case"max":return _e(e,t,Math.max);default:return{available:!1,value:null}}}function ge(e,t){if("count"!==e.statisticType)return{available:!1,value:null};if("1"===e.onStatisticField)return{available:!0,value:t.reduce((e,t)=>e+t.statistics.rowCount,0)};let r=0;for(const s of t){const t=s.statistics.statistics.get(e.onStatisticField);if(null==t||null==t.nullCount)return{available:!1,value:null};r+=s.statistics.rowCount-t.nullCount}return{available:!0,value:r}}function _e(e,t,r){if("min"!==e.statisticType&&"max"!==e.statisticType)return{available:!1,value:null};let s=null;const i="min"===e.statisticType?"minValue":"maxValue";for(const n of t){const t=n.statistics.statistics.get(e.onStatisticField);if(null==t)return{available:!1,value:null};const a=we(t[i]);null!=a&&(s=null==s?a:r(s,a))}return{available:!0,value:s}}function we(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function xe(e,t){const r=new k;for(const s of e)r.insert(s);return new R({...t,featureStore:r})}function Fe(e,t){return e.statistics.statistics.get(t.fieldName)??null}function Se(e,t){return e.slice().sort((e,r)=>{const s=Ie(e,t),i=Ie(r,t);return s===i?0:s<i?-1:1})}function Ie(e,t){const r=Fe(e,t);if(null==r)return Number.POSITIVE_INFINITY;const s=be(r.minValue),i=be(r.maxValue);return null==s||null==i||i<s?Number.POSITIVE_INFINITY:i-s}function qe(e,t){return{xStatistics:e.statistics.statistics.get(t.xFieldName)??null,yStatistics:e.statistics.statistics.get(t.yFieldName)??null}}function ve(e,t){const r=be(e.minValue),s=be(e.maxValue);return null==r||null==s||t.intersects(r,s)}function Re(e,t,r){const s=be(e.minValue),i=be(e.maxValue),n=be(t.minValue),a=be(t.maxValue);return null==s||null==i||null==n||null==a||r.intersects(s,i,n,a)}function be(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function Ce(e){const t=e?.featureCount;let r=!1;return null!=t&&t<has("parquetlayer-full-query-feature-count")&&(r=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{...b,maxRecordCount:$,supportsOrderBy:r,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function Ee(e){return!!(e.objectIds?.length||e.outStatistics||e.orderByFields?.length||e.returnDistinctValues)}export{ae as default};
2
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as r}from"../../../../core/compilerUtils.js";import s from"../../../../core/Error.js";import i from"../../../../core/Handles.js";import has from"../../../../core/has.js";import a from"../../../../core/Logger.js";import{onAbortOrThrow as n,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{QueueProcessor as o}from"../../../../core/QueueProcessor.js";import{parseWhereClause as l}from"../../../../core/sql.js";import c from"../../../../geometry/SpatialReference.js";import{set as p,create as d,expandWithAABB as f,expandWithRect as m,negativeInfinity as y}from"../../../../geometry/support/aaBoundingBox.js";import{copy as h,negativeInfinity as g,create as _,expandWithRect as w}from"../../../../geometry/support/aaBoundingRect.js";import{getScaleForResolution as x}from"../../../../geometry/support/scaleUtils.js";import{isWebMercator as F,isWGS84 as S}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertToGeometry as I}from"../../featureConversionUtils.js";import{getFieldNamesFromStatistics as v}from"../../data/attributeSupport.js";import{getQueryResultExtent as q,getQueryBoundingRects as R,QueryEngine as C}from"../../data/QueryEngine.js";import{queryCapabilities as b}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as E}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as O}from"../../data/queryUtils.js";import{createFileProvider as P}from"../parquet/createFileProvider.js";import{createDrawingInfo as T}from"./clientSideDefaults.js";import{getParquetFileId as j,getParquetRowId as Q,getParquetObjectId as M}from"./parquetIdUtils.js";import N from"../../../support/Field.js";import A from"../../../support/FieldsIndex.js";import{isNumericField as B}from"../../../support/fieldUtils.js";import{fromParquetGeometryEncodingJSON as G}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as D,fromParquetJSONGeometryType as z,toParquetJSONGeometryType as V}from"../../../support/parquetUtils.js";import{loadParquetModule as W}from"../../../../libs/parquet/loadParquetModule.js";import{FeatureStoreQueryAdapter as U}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as k}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as J}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as Z}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as L}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const H=new U,Y=4,X="__OBJECTID",$=new TextDecoder,K=8e3,ee=2e7,te=8,re=2,se=20;class ie{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){u(e),await this._fill(e);const t=await ae(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,null!=t.chunk)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<te;){const t=this._getOrCreateNextStream(e);if(null==t)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){const t=this._resolvedCount>=te?te:re;if(this._fileIndex<this._files.length&&this._streams.length<t){const t=this._files[this._fileIndex++],r=new ne(t.id,this._createFileStream(t,e));return this._streams.push(r),r}return this._getNextStream()}_getNextStream(){const e=this._streams.length;for(let t=0;t<e;t++){const r=(this._streamIndex+t)%e,s=this._streams[r];if(s.canRead)return this._streamIndex=(r+1)%e,s}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function ae(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class ne{constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&0===this._readCount}async read(e){this._readCount++;try{const t=await this._stream,r=await t.next(e);return null==r?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:r}}finally{this._readCount--}}}class ue{constructor(){this._queue=new o({concurrency:Y,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={},this._handles=new i}async load(e){const t=e.spatialReference?c.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new s("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");this._customParameters=e.customParameters,this._provider=P(e.provider,null,()=>this._customParameters),this._handles.add(this._provider.events.on("sourceChanged",async()=>{await this.reload(e),await this._source.onSourceChange()}));const r=await this._provider.getMetadata(),i=await D(r,{fields:e.fields?.map(e=>N.fromJSON(e)),geometryEncoding:e.geometryEncoding?G(e.geometryEncoding):null,geometryType:e.geometryType?z(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(!i.fields)throw new s("parquet:unsupported","Fields must be defined");let n;if(i.spatialReference&&i.geometryType){if(!i.spatialReference)throw new s("parquet:unsupported","SpatialReference must be defined");if(!i.spatialReference.isGeographic&&!i.spatialReference.isWebMercator)throw new s("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");i.spatialReference.isGeographic&&!i.spatialReference.isWGS84&&(a.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:i.spatialReference}),i.spatialReference=c.WGS84),n={geometry:i.geometryEncoding?{geometryType:V(i.geometryType),spatialReference:i.spatialReference.toJSON(),encoding:i.geometryEncoding.toJSON()}:null,displayOptimization:i.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=i.displayOptimization,await this._provider.updateGeometryInfo(n),this._capabilities=Ee(await this._getFileStatistics());const u=await this._provider.getFiles();if(!u.length)return{layerDefinition:{},capabilities:Ee(null)};const o=await u[0].file;i.file=o;const{fields:l}=i;if(null==l)throw new s("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",l);l.push(new N({name:X,type:"oid",alias:X}));for(const s of l){const e=o.getColumnId(s.name);null!=e&&(this._indexMap[s.name]=e)}const p=new A(l.map(e=>e.toJSON()));this._fieldsIndex=p;const d=V(i.geometryType??"point");return this._metadata=Z.createFeature({fieldsIndex:p.toJSON(),geometryType:d,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:X},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:i.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:d,featureIdInfo:{type:"object-id",fieldName:X},hasM:!1,hasZ:!1,spatialReference:i.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=r?.extent?r.extent:await this._tryDeriveParquetFullExtent(i),{capabilities:this._capabilities,layerDefinition:{fields:i.fields?.map(e=>e.toJSON()),drawingInfo:T(d),extent:this._fullExtent??void 0,geometryType:d,geometryEncoding:i.geometryEncoding?.toJSON(),displayOptimization:i.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(const{handle:e}of this._streams.values())e.remove();this._streams.clear(),this._indexMap={},this._handles.removeAll()}async reload(e){this.destroy(),await this.load(e)}set remoteClient(e){this._source=e.createInvokeProxy("")}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._provider=P(e,this._provider.getGeometryInfo(),()=>this._customParameters)}async queryFeatures(e,t){const r=await O(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),Oe(r)||(r.resultRecordCount=r.resultRecordCount?Math.min(r.resultRecordCount,K):K,r.resultOffset=r.resultOffset??0),r.outStatistics)return this._queryStatistics(r,t);r.returnDistinctValues&&(r.returnGeometry=void 0);return(await this._enqueueQuery(r,t)).createQueryResponse()}async queryFeatureCount(e,t){const r=await O(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!pe(r))return this._getFeatureCount();r.outFields=void 0,r.returnGeometry=void 0;return(await this._enqueueQuery(r,t)).createQueryResponseForCount()}async queryObjectIds(e,t){const r=await O(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!pe(r))return Array.from({length:await this._getFeatureCount()},(e,t)=>t);r.resultRecordCount=r.resultRecordCount?Math.min(r.resultRecordCount,8e3):8e3,r.resultOffset=r.resultOffset??0,r.returnGeometry=void 0,r.outFields=void 0;return(await this._enqueueQuery(r,t)).items.map(e=>e.getObjectId())}async queryAttributeBins(e,t={}){throw new s("parquet:unsupported","queryAttributeBins not supported.")}async queryExtent(e,t){const s=await O(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(s),this._fullExtent&&!pe(s))return{count:await this._getFeatureCount(),extent:this._fullExtent};const i=r(this._metadata.spatialReference);s.returnGeometry=!0,s.outFields=void 0;const a=p(d(),y),n=d(),u=await this._enqueueQuery(s,t);let o=0;for(const r of u.items)r.getBounds(n)&&(f(a,n),o+=1);return{count:o,extent:q(a,i,s.outSR?r(s.outSR):i.toJSON(),i,!1)}}async queryStream(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const r=await this._getCandidateFiles(e),s=new ie(r,async(t,r)=>{const s=await t.file,i=await this._createParquetDisplayQuery(s,t.id,e);return s.executeQuery(i,K,r)}),i=this._streamIdCounter++,a=n(t.signal,e=>{const t=this._streams.get(i);null!=t&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:s,handle:a}),i}async getStreamNext(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const r=this._streams.get(e);if(!r)return{result:null};const s=await r.stream.next(t.signal);if(null==s)return r.handle.remove(),this._streams.delete(e),{result:null};const i=s.chunk.serialize().buffer,a={fileId:s.fileId,buffer:i};return i instanceof ArrayBuffer?{result:a,transferList:[i]}:{result:a}}async getStreamNextFeatures(e,t){const{result:r}=await this.getStreamNext(e,t);if(null==r)return null;const s=(await W()).ParquetChunk.deserialize(new Uint8Array(r.buffer)),i=new L(this._metadata,this._indexMap,s,r.fileId),a=[];for(;i.next();){const e=I(i.readGeometryWorldSpace(),i.geometryType,i.hasZ,i.hasM),t=i.readAttributes();a.push({attributes:t,geometry:e})}return{features:a}}async createPatch(e,t,r,s,i){if(!i.signal)throw new Error("InternalError: AbortSignal must be passed");const a=await this._getFileInfoById(e),n=await a.file;return(await n.createChunkPatch(t,r,s,i.signal)).serialize().buffer}async _getCandidateFiles(e){const t=await this._provider.getFiles(),r=await this._getSpatialFilePruning(e);if(null==r)return t;const s=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,r));return"xz"===r.type?Ie(s,r):s}async _queryStatistics(e,t){const r=await O({...e},null,this._queryEngineParams.spatialReference);if(r.returnGeometry=void 0,me(r,this._fieldsIndex)){const e=await this._getStatisticsFromFiles(r);if(e)return e}return(await this._enqueueQuery(r,t)).createQueryResponse()}async _getStatisticsFromFiles(e){const t=await this._provider.getFiles(),r={},s=[];for(const i of e.outStatistics??[]){const e=ge(i,t);if(!e.available)return null;r[i.outStatisticFieldName]=e.value,s.push(he(i,this._fieldsIndex))}return{fields:s,features:[{attributes:r}]}}async _getSpatialFilePruning(e){if("tile"!==e.type&&("arcade"!==e.type||null==e.extent))return null;const t=this._displayOptimization,r=t?.index;if(null==r)return null;const s=e.outSpatialReference.wkid;if(null==r.wkid||null==s)return null;const i=r.wkid,a=await W();switch(r.type){case"xz":return{type:"xz",fieldName:r.code,intersects:(t,n)=>a.queryIntersectsXZStatistics(r.fullExtent,e.extent,s,i,se,t,n)};case"z":return{type:"xy",xFieldName:r.xColumn,yFieldName:r.yColumn,intersects:(t,r,n,u)=>a.queryIntersectsXYStatistics(e.extent,s,i,t,r,n,u)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case"xz":{const r=Se(e,t);return null==r||Re(r,t)}case"xy":{const{xStatistics:r,yStatistics:s}=qe(e,t);return null==r||null==s||Ce(r,s,t)}}}async _tryDeriveParquetFullExtent(r){if(!r.spatialReference)return null;if(null==this._fullExtent&&"location"===r.geometryEncoding?.type){const i=await this._provider.getFiles(),{xField:a,yField:n}=r.geometryEncoding,u=p(d(),y);for(const r of i){const i=await r.file;for(const r of i.rowGroups()){const i={stack:[],error:void 0,hasError:!1};try{const t=e(i,r.columnDescriptorForAttribute(a),!1),s=e(i,r.columnDescriptorForAttribute(n),!1),o=[t.minValue(),s.minValue(),t.maxValue(),s.maxValue()];m(u,o),r.free()}catch(s){i.error=s,i.hasError=!0}finally{t(i)}}}return{xmin:u[0],ymin:u[1],xmax:u[3],ymax:u[4],spatialReference:r.spatialReference?.toJSON()}}return null}async _getFileInfoById(e){const t=await this._provider.getFiles();for(const r of t)if(r.id===e)return r;throw new Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t,r,s,i){const a=(await W()).Query.new();null!=r&&a.setPreFilterStart(r),null!=s&&a.setPreFilterCount(s),null!=i&&a.setPostFilterCount(i);const n=await this._getRequiredFields(e);a.setOutFields(n),(e.geometry||e.returnGeometry)&&a.setReturnGeometry(!0);const u=this._tryGetGeneralizedGeometryScale(e);null!=u&&a.setScale(u);const o=e.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=o.wkid;if(e.geometry&&(F(o)||S(o))){const t=h(_(),g);for(const r of R(e.geometry))w(t,r);a.setOutSpatialReference(l),a.setExtent({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]})}if(e.where){const{id:r,file:s}=t;await this._setWhereClause(a,await s,r,e.where)}return a}async _createParquetDisplayQuery(e,t,r){const s=(await W()).Query.new();return"tile"===r.type?(s.setExtent(r.extent),s.setQuantizationTransform(r.transform),s.setScale(r.scale)):"arcade"===r.type&&null!=r.extent&&s.setExtent(r.extent),s.setOutFields(r.outFields.filter(e=>null!=this._indexMap[e])),s.setOutSpatialReference(r.outSpatialReference.wkid),s.setReturnGeometry(r.returnGeometry),r.where&&await this._setWhereClause(s,e,t,r.where),s}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new s("parquet:unsupported","Statistics queries are not supported",{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new s("parquet:unsupported","Queries using orderBy are not supported",{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new s("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:e})}async _setWhereClause(e,t,r,i){const a=this._indexMap,n=this._fieldsIndex,u={getAttribute(e,s){const i=a[s];if(null==i){const t=n.get(s);if("__OBJECTID"===t?.name){const t=e.row+e.rowGroupStart;return M(r,t)}return null}const u=t.readAttribute(e.rowGroup,e.row,i);if(null==u)return null;const o=n.get(s);return"esriFieldTypeString"===o.type||"esriFieldTypeDateOnly"===o.type||"esriFieldTypeTimeOnly"===o.type||"esriFieldTypeTimestampOffset"===o.type?$.decode(u):u}},o=await l(i,this._fieldsIndex);if(!o.isStandardized)throw new s("sql-parse-error","expression is not standardized");const c=(e,t,r)=>o.testFeatureCompiled({rowGroup:e,row:t,rowGroupStart:r},u,null),p=o.fieldNames.map(e=>n.get(e)).filter(e=>e&&null!=this._indexMap[e?.name]);e.setWhere(i),e.setWhereEvaluator(c),e.setWhereFields(p.map(e=>e.name))}async*_streamFeatures(e,t,r,s,i){const a=await this._provider.getFiles();let n=0;for(const u of a){const a=n,o=n+u.statistics.rowCount;if(n+=u.statistics.rowCount,null!=t&&t>=o)continue;const l=null!=t?Math.max(t-a,0):null;let c=r;if(null!=r){const e=t??0,s=e+r,i=Math.max(e,a),n=Math.min(s,o);c=Math.max(n-i,0)}if(0===c)continue;const p=await this._createParquetQuery(e,u,l,c,s),d=await u.file,f=await d.executeQuery(p,K),m=async()=>{const e=await f.next(i);if(!e)return null;const t=new L(this._metadata,this._indexMap,e,u.id);return Fe([new k(t,null,0,!1)],this._queryEngineParams)};let y=await m();for(;null!=y;)yield y,y=await m()}}async _queryFeaturesWithQueryEnginePagination(e,t){const r=[],s=this._streamFeatures(e,null,null,null,t);let i=await s.next();for(;!i.done;){const a=await i.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(const e of a)r.push(e);i=await s.next()}return r}async _queryFeaturesWithUpfrontPagination(e,t){let r,s,i,a=e.resultOffset??0,n=e.resultRecordCount??K;de(e)?fe(e)||(i=a+n):(a&&(r=a,a=0),s=e.resultRecordCount);const u=[],o=this._streamFeatures(e,r,s,i,t);let l=await o.next();for(;!l.done&&n>0;){const r=await l.value.executeQueryForOpaqueFeatures({...e,where:void 0},t);for(const e of r)if(a>0)a--;else if(u.push(e),--n<=0)return u;l=await o.next()}return u}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){if(e.objectIds?.length){const r=new Map;for(const t of e.objectIds){const e=j(t),s=Q(t);let i=r.get(e);i||(i=[],r.set(e,i)),i.push(s)}const s=[];for(const[i,a]of r.entries()){const r=await this._executeFileIdQuery(e,i,a,t);for(const e of r)s.push(e)}return new E(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:H,featureIdInfo:this._queryEngineParams.featureIdInfo})}if("1=1"===e.where&&(e.where=null),e.resultOffset??=0,e.resultRecordCount??=await this._getFeatureCount(),e.resultRecordCount>ee){if(!(this._displayOptimization&&e.geometry))throw new s("parquet:cannot-execute-query","Unable to execute query, dataset is too large.")}const r=!!e.orderByFields?.length||!!e.outStatistics?.length||!!e.returnDistinctValues,i=r?await this._queryFeaturesWithQueryEnginePagination(e,t):await this._queryFeaturesWithUpfrontPagination(e,t);return r||(e.resultOffset=0),new E(i,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:H,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,r,s){const i=await this._getRequiredFields(e),a=(await W()).Query.new();a.setOutFields(i),a.setReturnGeometry(!!e.returnGeometry),a.setIds(new Uint32Array(r));const n=await this._getFile(t),u=await n.executeQuery(a,K,s);let o=await u.next(s),l=0;const c=[];for(;null!=o;){const e=new L(this._metadata,this._indexMap,o,t),r=new k(e,null,l++,!1);c.push(r),o=await u.next(s)}return Fe(c,this._queryEngineParams).executeQueryForOpaqueFeatures(e,s)}async _getRequiredFields(e){const t=new Set;if(e.outStatistics)for(const r of v(this._fieldsIndex,e.outStatistics,e.groupByFieldsForStatistics))t.add(r);else if(e.outFields)for(const r of e.outFields)t.add(r);return(t.has("*")?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>null!=this._indexMap[e])}_tryGetGeneralizedGeometryScale(e){if(!this._displayOptimization)return null;const t=e.outSR??this._queryEngineParams.spatialReference;if(!F(t)&&!S(t))return null;const r=e.quantizationParameters?.tolerance??e.maxAllowableOffset;return r?x(r,t):null}}function oe(e){switch(e){case"fullText":case"having":case"timeExtent":case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"geometry":case"resultOffset":case"resultRecordCount":return!0;default:return!1}}function le(e){switch(e){case"fullText":case"having":case"timeExtent":case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"geometry":return!0;default:return!1}}function ce(e){switch(e){case"fullText":case"having":case"timeExtent":return!0;case"historicMoment":case"aggregateIds":case"uniqueIds":case"gdbVersion":case"objectIds":case"where":case"resultOffset":case"geometry":case"resultRecordCount":return!1}return!1}function pe(e){for(const t in e){const r=t;if(oe(r)&&null!==e[r])return!0}return!1}function de(e){for(const t in e){const r=t;if(le(r)&&null!==e[r])return!0}return!1}function fe(e){for(const t in e){const r=t;if(ce(r)&&null!==e[r])return!0}return!1}function me(e,t){return!!e.outStatistics?.length&&!pe(e)&&!e.groupByFieldsForStatistics?.length&&!e.orderByFields?.length&&!e.returnDistinctValues&&!e.returnAggIds&&e.outStatistics.every(e=>ye(e,t))}function ye(e,t){switch(e.statisticType){case"count":return"1"===e.onStatisticField||null!=t.get(e.onStatisticField);case"min":case"max":{const r=t.get(e.onStatisticField);return null!=r&&B(r)}default:return!1}}function he(e,t){const r="exceedslimit"!==e.statisticType?t.get(e.onStatisticField):null,s="min"!==e.statisticType&&"max"!==e.statisticType||"esriFieldTypeDate"!==r?.type?"esriFieldTypeDouble":r.type;return{name:e.outStatisticFieldName,alias:e.outStatisticFieldName,type:s}}function ge(e,t){switch(e.statisticType){case"count":return _e(e,t);case"min":return we(e,t,Math.min);case"max":return we(e,t,Math.max);default:return{available:!1,value:null}}}function _e(e,t){if("count"!==e.statisticType)return{available:!1,value:null};if("1"===e.onStatisticField)return{available:!0,value:t.reduce((e,t)=>e+t.statistics.rowCount,0)};let r=0;for(const s of t){const t=s.statistics.statistics.get(e.onStatisticField);if(null==t||null==t.nullCount)return{available:!1,value:null};r+=s.statistics.rowCount-t.nullCount}return{available:!0,value:r}}function we(e,t,r){if("min"!==e.statisticType&&"max"!==e.statisticType)return{available:!1,value:null};let s=null;const i="min"===e.statisticType?"minValue":"maxValue";for(const a of t){const t=a.statistics.statistics.get(e.onStatisticField);if(null==t)return{available:!1,value:null};const n=xe(t[i]);null!=n&&(s=null==s?n:r(s,n))}return{available:!0,value:s}}function xe(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function Fe(e,t){const r=new J;for(const s of e)r.insert(s);return new C({...t,featureStore:r})}function Se(e,t){return e.statistics.statistics.get(t.fieldName)??null}function Ie(e,t){return e.slice().sort((e,r)=>{const s=ve(e,t),i=ve(r,t);return s===i?0:s<i?-1:1})}function ve(e,t){const r=Se(e,t);if(null==r)return Number.POSITIVE_INFINITY;const s=be(r.minValue),i=be(r.maxValue);return null==s||null==i||i<s?Number.POSITIVE_INFINITY:i-s}function qe(e,t){return{xStatistics:e.statistics.statistics.get(t.xFieldName)??null,yStatistics:e.statistics.statistics.get(t.yFieldName)??null}}function Re(e,t){const r=be(e.minValue),s=be(e.maxValue);return null==r||null==s||t.intersects(r,s)}function Ce(e,t,r){const s=be(e.minValue),i=be(e.maxValue),a=be(t.minValue),n=be(t.maxValue);return null==s||null==i||null==a||null==n||r.intersects(s,i,a,n)}function be(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function Ee(e){const t=e?.featureCount;let r=!1;return null!=t&&t<has("parquetlayer-full-query-feature-count")&&(r=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{...b,maxRecordCount:K,supportsOrderBy:r,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function Oe(e){return!!(e.objectIds?.length||e.outStatistics||e.orderByFields?.length||e.returnDistinctValues)}export{ue as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{EventEmitter as e}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{property as s,subclass as d}from"../../core/accessorSupport/decorators.js";import{isVersionInEditSession as n,defaultVersionNameLookup as r}from"../../versionManagement/support/versionManagementUtils.js";const o=new e;function a(t){return o.on("apply-edits",new WeakRef(t))}function l(t){return o.on("update-moment",new WeakRef(t))}function h(t,e,i=null,s=!1){const d=Promise.withResolvers();return s=null==e||s,o.emit("apply-edits",{serviceUrl:t,layerId:e,gdbVersion:i,mayReceiveServiceEdits:s,result:d.promise}),d}function c(t,e,i=null,s){o.emit("update-moment",{serviceUrl:t,layerId:e,gdbVersion:i,moment:s})}const u=Symbol();function m(t){return null!=t&&"object"==typeof t&&u in t}function p(t){return null!=t&&"object"==typeof t&&"gdbVersion"in t}function b(t,e,i){const s=new URL(t).host,d=r.get(s),n=t=>!t||t===d;return n(e)&&n(i)||e===i}const g=e=>{var r;const o=e;let h=class extends o{static{r=u}constructor(...t){super(...t),this[r]=!0,this._applyEditsHandler=t=>{const{serviceUrl:e,layerId:s,gdbVersion:d,mayReceiveServiceEdits:n,result:r}=t,o=e===this.url,a=null!=s&&null!=this.layerId&&s===this.layerId,l=p(this),h=p(this)&&b(e,d,this.gdbVersion);if(!o||l&&!h||!a&&!n)return;const c=r.then(t=>{if(this.lastEditsEventDate=new Date,a&&(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length))return this.emit("edits",i(t)),t;const s=t.editedFeatures?.find(({layerId:t})=>t===this.layerId);if(s){const{adds:e,updates:d,deletes:n}=s.editedFeatures,r={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:e?e.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],deletedFeatures:n?n.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],updatedFeatures:d?d.map(({current:{attributes:t}})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return this.emit("edits",r),r}const n={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(e,d,n.historicMoment)&&this.emit("edits",n),n}).then(t=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(e,d,t.historicMoment)&&(this.historicMoment=t.historicMoment),t));this.emit("apply-edits",{result:c})},this._updateMomentHandler=t=>{const{serviceUrl:e,gdbVersion:i,moment:s}=t,d=e===this.url,n=p(this),r=p(this)&&b(e,i,this.gdbVersion),o=p(this)&&!b(e,this.gdbVersion,null);d&&n&&r&&o&&"historicMoment"in this&&this.historicMoment!==s&&(this.historicMoment=s)},this.when().then(()=>{this.addHandles(a(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(l(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(t,e,i){return"historicMoment"in this&&this.historicMoment!==i&&n(t,e)}};return t([s()],h.prototype,"lastEditsEventDate",void 0),h=t([d("esri.layers.mixins.EditBusLayer")],h),h};export{g as EditBusLayer,h as emitApplyEditsEvent,c as emitUpdateMomentEvent,m as isEditBusLayer,p as isLayerWithGDBVersion,a as onApplyEditsEvent,l as onUpdateMomentEvent,b as versionMatches};
2
+ import{__decorate as t}from"tslib";import{EventEmitter as e}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{property as s,subclass as d}from"../../core/accessorSupport/decorators.js";import{isVersionInEditSession as n,defaultVersionNameLookup as r}from"../../versionManagement/support/versionManagementUtils.js";const o=new e;function l(t){return o.on("apply-edits",new WeakRef(t))}function a(t){return o.on("update-moment",new WeakRef(t))}function h(t,e,i=null,s=!1){const d=Promise.withResolvers();return s=null==e||s,o.emit("apply-edits",{serviceUrl:t,layerId:e,gdbVersion:i,mayReceiveServiceEdits:s,result:d.promise}),d}function c(t,e,i=null,s){o.emit("update-moment",{serviceUrl:t,layerId:e,gdbVersion:i,moment:s})}const u=Symbol();function m(t){return null!=t&&"object"==typeof t&&u in t}function p(t){return null!=t&&"object"==typeof t&&"gdbVersion"in t}function b(t){return null!=t&&"object"==typeof t&&"historicMoment"in t}function g(t,e,i){const s=new URL(t).host,d=r.get(s),n=t=>!t||t===d;return n(e)&&n(i)||e===i}const F=e=>{var r;const o=e;let h=class extends o{static{r=u}constructor(...t){super(...t),this[r]=!0,this._applyEditsHandler=t=>{const{serviceUrl:e,layerId:s,gdbVersion:d,mayReceiveServiceEdits:n,result:r}=t,o=e===this.url,l=null!=s&&null!=this.layerId&&s===this.layerId,a=p(this),h=p(this)&&g(e,d,this.gdbVersion);if(!o||a&&!h||!l&&!n)return;const c=r.then(t=>{if(this.lastEditsEventDate=new Date,l&&(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length))return this.emit("edits",i(t)),t;const s=t.editedFeatures?.find(({layerId:t})=>t===this.layerId);if(s){const{adds:e,updates:d,deletes:n}=s.editedFeatures,r={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:e?e.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],deletedFeatures:n?n.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],updatedFeatures:d?d.map(({current:{attributes:t}})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return this.emit("edits",r),r}const n={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(e,d,n.historicMoment)&&this.emit("edits",n),n}).then(t=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(e,d,t.historicMoment)&&(this.historicMoment=t.historicMoment),t));this.emit("apply-edits",{result:c})},this._updateMomentHandler=t=>{const{serviceUrl:e,gdbVersion:i,moment:s}=t,d=e===this.url,n=p(this),r=p(this)&&g(e,i,this.gdbVersion),o=p(this)&&!g(e,this.gdbVersion,null);d&&n&&r&&o&&"historicMoment"in this&&this.historicMoment!==s&&(this.historicMoment=s)},this.when().then(()=>{this.addHandles(l(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(a(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(t,e,i){return"historicMoment"in this&&this.historicMoment!==i&&n(t,e)}};return t([s()],h.prototype,"lastEditsEventDate",void 0),h=t([d("esri.layers.mixins.EditBusLayer")],h),h};export{F as EditBusLayer,h as emitApplyEditsEvent,c as emitUpdateMomentEvent,m as isEditBusLayer,p as isLayerWithGDBVersion,b as isLayerWithHistoricMoment,l as onApplyEditsEvent,a as onUpdateMomentEvent,g as versionMatches};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/units.js";import{geographicToWebMercator as r}from"../../../geometry/support/webMercatorUtils.js";import n from"./cameraOrientationRegistry.js";import{isConstantElevation as i,ConstantElevation as o,ElevationSource as s}from"./ElevationSourceDefinitions.js";function l(e,t,r){return t&&(e=`${t}${e}`),r&&(e+=`${r}`),e}function a(e,t,r){let{url:n}=e;return n?(n=l(n,t,r),new s({...e,url:n})):null}function c(e,t,r){return e?i(e)?new o(e):a(e,t,r):e}const u=new e({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),f=new e({Feet:"feet",Meter:"meter"}),m=new e({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique",Terrestrial360Video:"terrestrial-360-video",TerrestrialFrameVideo:"terrestrial-frame-video",Aerial360Video:"aerial-360-video",AerialFrameVideo:"aerial-frame-video","":null}),p=new Map;function d(e){const[t,r,n,i,o,s,l,a,c,u,f,m,p,d,h,w,y,v,D,z,L,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,omega:s,phi:l,kappa:a,...g([c,u,f,m,p,d],[w,y],[v,D,z],[L,C],h)}}p.set("1",w),p.set("3",y),p.set("2",d),p.set("4",v);const h=e=>{const t=e.map(e=>parseFloat(e)).filter(e=>!isNaN(e));if(t.length===e.length)return t};function g(e,t,r,n,i){const o=h(e),s=h(t),l=h(r),a=h(n);return{affineTransformations:6===o?.length?o:void 0,focalLength:6===o?.length?parseFloat(i):void 0,principalOffsetPoint:2!==s?.length?[0,0]:s,radialDistortionCoefficients:3!==l?.length?[0,0,0]:l,tangentialDistortionCoefficients:2!==a?.length?[0,0]:a}}function w(e){const[t,r,n,i,o,s,l,a,c,u,f,m,p,d,h,w,y,v,D,z,L,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,heading:s,pitch:l,roll:a,...g([c,u,f,m,p,d],[w,y],[v,D,z],[L,C],h)}}function y(e){const[t,r,n,i,o,s,l,a,c,u,f,m,p,d,h,w,y,v,D,z,L,C]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,yaw:s,pitch:l,roll:a,...g([c,u,f,m,p,d],[w,y],[v,D,z],[L,C],h)}}function v(e){const[t,r,i,o,s,...l]=e.slice(1),a=p.get(s),c=n.get(s)?.constructor;if(!a||!c)return null;return{latitude:t,longitude:r,ellipsoidRadius:i,squaredEccentricity:o,properties:new c(a([s,"",...l]))}}function D(e){if(!e)return null;const t=`${e}`.split("|");if(0===t.length)return null;const r=n.get(t[0]);if(!r)return null;const i=p.get(t[0]);if(!i)return null;return new(0,r.constructor)(i(t))}function z(e){return Array.isArray(e)&&e?.length>5&&!e.some(isNaN)}function L(e){for(e=e.slice(0,8);e.length<8;)e.push(0);return e}function C(e){return e.spatialReference.isGeographic?r(e):e.clone()}function I(e){return e.isGeographic?1:t(e)}function N(e){const t=e.match(/^(.*)\/rest\/services\/(.*)$/);return t?t[1]:null}const W="sequenceorder";function j(e,t){if(!e){const e=t.find(e=>e.name.toLocaleLowerCase()===W.toLocaleLowerCase());return e?[{fieldName:e.name,sortOrder:"asc"}]:null}return e.split(";").map(e=>{const r=e.trim(),[n,i]=r.split(/\s+/).map(e=>e.trim()),o=t.find(e=>e.name.toLowerCase()===n.toLowerCase());return o?{fieldName:o?o.name:W,sortOrder:"desc"===i?.toLowerCase()?"desc":"asc"}:null}).filter(e=>null!=e)}export{l as appendPrefixAndSuffix,C as convertGeographicToWebMercator,D as createCameraOrientation,W as defaultSequenceOrderField,N as getArcGISServerUrl,c as getEffectiveElevationSource,I as getMetersPerUnitOfSR,z as isOrientationAccuracy,m as orientedImageryTypeMap,L as padAccuracyArray,j as parseSequenceOrderFields,a as processElevationSource,u as timeIntervalUnitTypeMap,p as transformersRegistry,f as verticalMeasurementTypeMap};
2
+ import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/units.js";import{geographicToWebMercator as r}from"../../../geometry/support/webMercatorUtils.js";import n from"./cameraOrientationRegistry.js";import{isConstantElevation as o,ConstantElevation as i,ElevationSource as s}from"./ElevationSourceDefinitions.js";function l(e,t,r){return t&&(e=`${t}${e}`),r&&(e+=`${r}`),e}function a(e,t,r){let{url:n}=e;return n?(n=l(n,t,r),new s({...e,url:n})):null}function c(e,t,r){return e?o(e)?new i(e):a(e,t,r):e}const u=new e({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),f=new e({Feet:"feet",Meter:"meter"}),m=new e({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique",Terrestrial360Video:"terrestrial-360-video",TerrestrialFrameVideo:"terrestrial-frame-video",Aerial360Video:"aerial-360-video",AerialFrameVideo:"aerial-frame-video","":null}),d=new Map;function p(e){const[t,r,n,o,i,s,l,a,c,u,f,m,d,p,h,w,y,v,D,L,C,z]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:o,z:i,omega:s,phi:l,kappa:a,...g([c,u,f,m,d,p],[w,y],[v,D,L],[C,z],h)}}d.set("1",w),d.set("3",y),d.set("2",p),d.set("4",v);const h=e=>{const t=e.map(e=>parseFloat(e)).filter(e=>!isNaN(e));if(t.length===e.length)return t};function g(e,t,r,n,o){const i=h(e),s=h(t),l=h(r),a=h(n);return{affineTransformations:6===i?.length?i:void 0,focalLength:6===i?.length?parseFloat(o):void 0,principalOffsetPoint:2!==s?.length?[0,0]:s,radialDistortionCoefficients:3!==l?.length?[0,0,0]:l,tangentialDistortionCoefficients:2!==a?.length?[0,0]:a}}function w(e){const[t,r,n,o,i,s,l,a,c,u,f,m,d,p,h,w,y,v,D,L,C,z]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:o,z:i,heading:s,pitch:l,roll:a,...g([c,u,f,m,d,p],[w,y],[v,D,L],[C,z],h)}}function y(e){const[t,r,n,o,i,s,l,a,c,u,f,m,d,p,h,w,y,v,D,L,C,z]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:o,z:i,yaw:s,pitch:l,roll:a,...g([c,u,f,m,d,p],[w,y],[v,D,L],[C,z],h)}}function v(e){const[t,r,o,i,s,...l]=e.slice(1),a=d.get(s),c=n.get(s)?.constructor;if(!a||!c)return null;return{latitude:t,longitude:r,ellipsoidRadius:o,squaredEccentricity:i,properties:new c(a([s,"",...l]))}}function D(e){if(!e)return null;const t=`${e}`.split("|");if(0===t.length)return null;const r=n.get(t[0]);if(!r)return null;const o=d.get(t[0]);if(!o)return null;return new(0,r.constructor)(o(t))}function L(e){return Array.isArray(e)&&e?.length>5&&!e.some(isNaN)}function C(e){for(e=e.slice(0,8);e.length<8;)e.push(0);return e}function z(e){return e.spatialReference.isGeographic?r(e):e.clone()}function N(e){return e.isGeographic?1:t(e)}function I(e){const t=e.match(/^(.*)\/rest\/services\/(.*)$/);return t?t[1]:null}const W="sequenceorder";function j(e,t){if(!e?.length)return null;return e.map(({field:e,order:r})=>{const n=t.find(t=>t.name.toLowerCase()===e.toLowerCase());return n?{fieldName:n.name,sortOrder:"desc"===r?.toLowerCase()?"desc":"asc"}:null}).filter(e=>null!=e)}function K(e,t,r){const n=j(r,t);if(n?.length)return n;if(!e){const e=t.find(e=>e.name.toLocaleLowerCase()===W.toLocaleLowerCase());return e?[{fieldName:e.name,sortOrder:"asc"}]:null}const o=t.find(t=>t.name.toLowerCase()===e.trim().toLowerCase());return o?[{fieldName:o.name,sortOrder:"asc"}]:null}export{l as appendPrefixAndSuffix,z as convertGeographicToWebMercator,D as createCameraOrientation,W as defaultSequenceOrderField,I as getArcGISServerUrl,c as getEffectiveElevationSource,N as getMetersPerUnitOfSR,L as isOrientationAccuracy,m as orientedImageryTypeMap,C as padAccuracyArray,K as parseSequenceOrderFields,a as processElevationSource,u as timeIntervalUnitTypeMap,d as transformersRegistry,f as verticalMeasurementTypeMap};
@@ -85,4 +85,7 @@ export interface ConstantElevation {
85
85
  }
86
86
 
87
87
  /** @since 5.0 */
88
- export type TimeIntervalUnit = Extract<TimeUnit, "days" | "hours" | "minutes" | "months" | "weeks" | "years">;
88
+ export type TimeIntervalUnit = Extract<TimeUnit, "days" | "hours" | "minutes" | "months" | "weeks" | "years">;
89
+
90
+ /** @since 5.1 */
91
+ export interface SequenceOrderFieldInfoJSON {}
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{JSONSupport as a}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";var n;function t(e){return e=Number(e),isNaN(e)?void 0:e}let o=class extends a{static{n=this}constructor(e){super(e),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new n({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};e([r({json:{name:"BandName",write:!0}})],o.prototype,"name",void 0),e([r({json:{read:{source:["WavelengthMin","Wavelength"],reader:(e,a)=>t(a.WavelengthMin??a.Wavelength)},write:{target:"WavelengthMin"}}})],o.prototype,"minWavelength",void 0),e([r({json:{name:"WavelengthMax",read:{reader:t},write:!0}})],o.prototype,"maxWavelength",void 0),e([r({json:{name:"RadianceBias",read:{reader:t},write:!0}})],o.prototype,"radianceBias",void 0),e([r({json:{name:"RadianceGain",read:{reader:t},write:!0}})],o.prototype,"radianceGain",void 0),e([r({json:{name:"ReflectanceBias",read:{reader:t},write:!0}})],o.prototype,"reflectanceBias",void 0),e([r({json:{name:"ReflectanceGain",read:{reader:t},write:!0}})],o.prototype,"reflectanceGain",void 0),e([r({json:{name:"SolarIrradiance",read:{reader:t},write:!0}})],o.prototype,"solarIrradiance",void 0),o=n=e([i("esri.layers.support.RasterBandInfo")],o);export{o as default};
2
+ import{__decorate as e}from"tslib";import{JSONSupport as a}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";var n;function t(e){return e=Number(e),isNaN(e)?void 0:e}let o=class extends a{static{n=this}constructor(e){super(e),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new n({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};e([r({json:{name:"BandName",write:!0}})],o.prototype,"name",void 0),e([r({json:{read:{source:["WavelengthMin","Wavelength","WAVELENGTH"],reader:(e,a)=>t(a.WavelengthMin??a.Wavelength??a.WAVELENGTH)},write:{target:"WavelengthMin"}}})],o.prototype,"minWavelength",void 0),e([r({json:{name:"WavelengthMax",read:{reader:t},write:!0}})],o.prototype,"maxWavelength",void 0),e([r({json:{name:"RadianceBias",read:{reader:t},write:!0}})],o.prototype,"radianceBias",void 0),e([r({json:{name:"RadianceGain",read:{reader:t},write:!0}})],o.prototype,"radianceGain",void 0),e([r({json:{name:"ReflectanceBias",read:{reader:t},write:!0}})],o.prototype,"reflectanceBias",void 0),e([r({json:{name:"ReflectanceGain",read:{reader:t},write:!0}})],o.prototype,"reflectanceGain",void 0),e([r({json:{name:"SolarIrradiance",read:{reader:t},write:!0}})],o.prototype,"solarIrradiance",void 0),o=n=e([i("esri.layers.support.RasterBandInfo")],o);export{o as default};
package/layers/types.d.ts CHANGED
@@ -434,6 +434,7 @@ export interface QueryCapabilities {
434
434
  * Indicates if the layer's query operation supports returning distance values of each feature in the query result using
435
435
  * the [Query.outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance) property.
436
436
  *
437
+ * @internal
437
438
  * @since 5.1
438
439
  */
439
440
  supportsOutDistance: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.21",
3
+ "version": "5.2.0-next.23",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -18,8 +18,8 @@
18
18
  ],
19
19
  "license": "SEE LICENSE IN LICENSE.md",
20
20
  "dependencies": {
21
- "@amcharts/amcharts5": "~5.18.0",
22
- "@arcgis/toolkit": "^5.1.0-next.137",
21
+ "@amcharts/amcharts5": "~5.19.1",
22
+ "@arcgis/toolkit": "^5.2.0-next.19",
23
23
  "@esri/arcgis-html-sanitizer": "~4.1.0",
24
24
  "@esri/calcite-components": "^5.1.1",
25
25
  "@vaadin/grid": "~25.1.4",
@@ -1,6 +1,6 @@
1
1
  import type { JSONSupport } from "../../core/JSONSupport.js";
2
2
 
3
- export interface AttachmentQueryProperties extends Partial<Pick<AttachmentQuery, "attachmentsWhere" | "attachmentTypes" | "cacheHint" | "globalIds" | "keywords" | "name" | "num" | "objectIds" | "orderByFields" | "returnMetadata" | "size" | "start" | "where">> {}
3
+ export interface AttachmentQueryProperties extends Partial<Pick<AttachmentQuery, "attachmentsWhere" | "attachmentTypes" | "cacheHint" | "globalIds" | "historicMoment" | "keywords" | "name" | "num" | "objectIds" | "orderByFields" | "returnMetadata" | "size" | "start" | "where">> {}
4
4
 
5
5
  /**
6
6
  * This class defines parameters for executing queries for feature attachments from a
@@ -69,6 +69,18 @@ export default class AttachmentQuery extends JSONSupport {
69
69
  * to be `true`.
70
70
  */
71
71
  accessor globalIds: string[] | null | undefined;
72
+ /**
73
+ * Retrieve attachments from a specific historic moment.
74
+ *
75
+ * This parameter only applies if
76
+ * the `supportsQueryWithHistoricMoment` capability of the service being queried is `true`.
77
+ *
78
+ * Used by BatchAttributeForm to support versioned data
79
+ * See also: [Query.historicMoment](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#historicMoment)
80
+ *
81
+ * @internal
82
+ */
83
+ accessor historicMoment: Date | null | undefined;
72
84
  /**
73
85
  * Used to query for attachments that match the provided `keywords`.
74
86
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{ensureType as i}from"../../core/accessorSupport/ensureType.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";var a;let p=class extends e{static{a=this}constructor(t){super(t),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.orderByFields=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new a(r({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};t([o({type:[String],json:{write:!0}})],p.prototype,"attachmentTypes",void 0),t([o({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],p.prototype,"attachmentsWhere",void 0),t([o({type:Boolean,json:{write:!0}})],p.prototype,"cacheHint",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"keywords",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"globalIds",void 0),t([o({json:{write:!0}})],p.prototype,"name",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],p.prototype,"num",void 0),t([o({type:[Number],json:{write:!0}})],p.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"orderByFields",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],p.prototype,"returnMetadata",void 0),t([o({type:[Number],json:{write:!0}})],p.prototype,"size",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],p.prototype,"start",void 0),t([n("start"),n("num")],p.prototype,"writeStart",null),t([o({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],p.prototype,"where",void 0),p=a=t([s("esri.rest.support.AttachmentQuery")],p),p.from=i(p);export{p as default};
2
+ import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{ensureType as i}from"../../core/accessorSupport/ensureType.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";var a;let p=class extends e{static{a=this}constructor(t){super(t),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.orderByFields=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}clone(){return new a(r({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,historicMoment:this.historicMoment,name:this.name,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};t([o({type:[String],json:{write:!0}})],p.prototype,"attachmentTypes",void 0),t([o({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],p.prototype,"attachmentsWhere",void 0),t([o({type:Boolean,json:{write:!0}})],p.prototype,"cacheHint",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"keywords",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"globalIds",void 0),t([o({json:{write:!0}})],p.prototype,"name",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],p.prototype,"num",void 0),t([o({type:[Number],json:{write:!0}})],p.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"orderByFields",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],p.prototype,"returnMetadata",void 0),t([o({type:[Number],json:{write:!0}})],p.prototype,"size",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],p.prototype,"start",void 0),t([n("start"),n("num")],p.prototype,"writeStart",null),t([o({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],p.prototype,"where",void 0),t([o()],p.prototype,"historicMoment",void 0),t([n("historicMoment")],p.prototype,"writeHistoricMoment",null),p=a=t([s("esri.rest.support.AttachmentQuery")],p),p.from=i(p);export{p as default};
@@ -1,7 +1,10 @@
1
1
  import type { ClonableMixin } from "../../core/Clonable.js";
2
2
  import type { JSONSupport } from "../../core/JSONSupport.js";
3
3
 
4
- /** @since 5.1 */
4
+ /**
5
+ * @internal
6
+ * @since 5.1
7
+ */
5
8
  export interface OutDistanceProperties extends Partial<Pick<OutDistance, "ascendingOrder" | "outDistanceUnit" | "returnDistance">> {}
6
9
 
7
10
  /**
@@ -20,6 +23,7 @@ export interface OutDistanceProperties extends Partial<Pick<OutDistance, "ascend
20
23
  * > Supported only on a service-backed [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) where the [supportsOutDistance](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities) capability
21
24
  * > is `true`.
22
25
  *
26
+ * @internal
23
27
  * @since 5.1
24
28
  */
25
29
  export default class OutDistance extends OutDistanceSuperclass {
@@ -18,7 +18,8 @@ export interface PrintParametersProperties extends Partial<Pick<PrintParameters,
18
18
  export default class PrintParameters extends Accessor {
19
19
  constructor(properties?: PrintParametersProperties);
20
20
  /**
21
- * todoc
21
+ * An array of [geographic transformations](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/support/GeographicTransformation/) to be used by the print service when
22
+ * projecting geometries for the printout.
22
23
  *
23
24
  * @since 5.1
24
25
  */
@@ -53,6 +53,7 @@ export interface QueryProperties extends Partial<Pick<Query, "aggregateIds" | "c
53
53
  * > Supported only on a service-backed [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) where the [supportsOutDistance](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities) capability
54
54
  * > is `true`.
55
55
  *
56
+ * @internal
56
57
  * @since 5.1
57
58
  */
58
59
  outDistance?: OutDistanceProperties | null;
@@ -623,6 +624,7 @@ export default class Query extends JSONSupport {
623
624
  * > Supported only on a service-backed [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) where the [supportsOutDistance](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities) capability
624
625
  * > is `true`.
625
626
  *
627
+ * @internal
626
628
  * @since 5.1
627
629
  */
628
630
  get outDistance(): OutDistance | null | undefined;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../core/Collection.js";import{mappedFind as r}from"../core/maybe.js";import{Url as t,makeAbsolute as a,normalize as n}from"../core/urlUtils.js";import{effectEquals as l}from"../layers/effects/utils.js";import{esriBasemapDefinitions as i}from"./basemapDefinitions.js";function s(e){return"Web Scene"===e.portalItem?.type||e.referenceLayers.some(e=>"scene"===e.type)}function u(e){return!!e?.portalItem?.tags?.some(e=>"beta"===e.toLowerCase())||!!e?.portalItem?.categories?.includes("/Categories/Status/Beta")}function c(e,r){const t=e.allLayerViews.find(e=>e.uid===r);return t?.layer.parent===e.map?.basemap}let o;function f(e){if(o)return o(e);let r=null;const t=v(e),a=!t?.baseLayers.length;for(const n in i){const e=w(t,R(i[n]),{mustMatchReferences:a});if("equal"===e){r=n;break}"base-layers-equal"===e&&(r=n)}return r}function y(e){o=e}function p(e,r){if(e===r)return!0;if(null!=e?.portalItem?.id&&e.portalItem.id===r?.portalItem?.id)return!0;return"equal"===w(v(e),v(r),{mustMatchReferences:!0})}function m(e){return!!e?.baseLayers.concat(e.referenceLayers).some(d)}function d(e){if(S(e.url))return!0;if("vector-tile"===e.type)for(const r in e.sourceNameToSource){const t=e.sourceNameToSource[r];if(S(t?.sourceUrl))return!0}return!1}function b(e,r){if(null==r||null==e)return{spatialReference:null,updating:!1};if("not-loaded"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const t=r.baseLayers.at(0);switch(t.loadStatus){case"not-loaded":t.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const a=(("supportedSpatialReferences"in t?t.supportedSpatialReferences:null)||["tileInfo"in t?t.tileInfo?.spatialReference:t.spatialReference]).filter(Boolean),n=e.spatialReference;return n?{spatialReference:a.find(e=>n.equals(e))??a[0]??null,updating:!1}:{spatialReference:a[0],updating:!1}}const L=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function S(e){if(!e)return!1;const r=new t(a(e));return!!r.authority&&L.test(r.authority)}function v(e){return e?!e.loaded&&e.resourceInfo?R(e.resourceInfo.data):{baseLayers:g(e.baseLayers),referenceLayers:g(e.referenceLayers),groundLayers:g(e.groundLayers)}:null}function g(r){return(e.isCollection(r)?r.toArray():r).map(I)}function I(e){return{type:e.type,effect:"effect"in e?e.effect:void 0,url:M("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl||""),minScale:"minScale"in e&&null!=e.minScale?e.minScale:0,maxScale:"maxScale"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:"map-image"!==e.type&&"wms"!==e.type||null==e.sublayers?void 0:e.sublayers?.map(e=>({id:e.id,visible:e.visible})),activeLayerId:"wmts"===e.type?e.activeLayer?.id:void 0}}function h(e){return e.isReference||"ArcGISSceneServiceLayer"===e.layerType}function R(e){return e?{baseLayers:T((e.baseMapLayers??[]).filter(e=>!h(e))),referenceLayers:T((e.baseMapLayers??[]).filter(e=>h(e))),groundLayers:T(e.groundLayers??[])}:null}function T(e){return e.map(e=>q(e))}function q(e){let r;switch(e.layerType){case"VectorTileLayer":r="vector-tile";break;case"ArcGISTiledMapServiceLayer":r="tile";break;case"ArcGISSceneServiceLayer":r="scene";break;case"IntegratedMesh3DTilesLayer":r="IntegratedMesh3DTilesLayer";break;default:r="unknown"}return{type:r,effect:e.effect,url:M(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale??0,maxScale:e.maxScale??0,opacity:e.opacity??1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function w(e,r,t){if(null!=e!=(null!=r))return"not-equal";if(!e||!r)return"equal";if(!x(e.baseLayers,r.baseLayers))return"not-equal";return x(e.referenceLayers,r.referenceLayers)?"equal":t.mustMatchReferences?"not-equal":"base-layers-equal"}function x(e,r){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(!U(e[t],r[t]))return!1;return!0}function U(e,r){if(e.type!==r.type||e.url!==r.url||e.minScale!==r.minScale||e.maxScale!==r.maxScale||e.visible!==r.visible||e.opacity!==r.opacity)return!1;if(!l(e.effect,r.effect))return!1;if(null!=e.activeLayerId||null!=r.activeLayerId)return e.activeLayerId===r.activeLayerId;if(null!=e.sublayers||null!=r.sublayers){if(null==e.sublayers||null==r.sublayers||e.sublayers.length!==r.sublayers.length)return!1;for(let t=0;t<e.sublayers.length;t++){const a=e.sublayers.at(t),n=r.sublayers.at(t);if(a?.id!==n?.id||a?.visible!==n?.visible)return!1}}return!0}function M(e){return e?n(e).replace(/^\s*https?:/i,"").toLowerCase():""}function k(e){if(!e)return null;const{thumbnailUrl:t}=e;if(t)return t;const a=f(e);return a?i[a].thumbnailUrl:r(e.baseLayers,j)}function j(e){return"portalItem"in e?e.portalItem?.thumbnailUrl:void 0}export{p as contentEquals,b as findSpatialReference,k as getBasemapThumbnailUrl,f as getWellKnownBasemapId,m as hasDeveloperBasemapLayer,s as isBasemap3D,u as isBasemapInBeta,c as isBasemapLayerView,d as isDeveloperBasemapLayer,U as layerDefinitionEquals,I as layerToDefinition,y as overrideGetWellKnownBasemapId};
2
+ import e from"../core/Collection.js";import{mappedFind as r}from"../core/maybe.js";import{Url as t,makeAbsolute as a,normalize as n}from"../core/urlUtils.js";import{effectEquals as l}from"../layers/effects/utils.js";import{esriBasemapDefinitions as i}from"./basemapDefinitions.js";function s(e){return"Web Scene"===e.portalItem?.type||e.referenceLayers.some(e=>"scene"===e.type)}function u(e){return!!e?.portalItem?.tags?.some(e=>"beta"===e.toLowerCase())||!!e?.portalItem?.categories?.includes("/Categories/Status/Beta")}function c(e){return!!e?.portalItem?.tags?.some(e=>"preview"===e.toLowerCase())||!!e?.portalItem?.categories?.includes("/Categories/Status/Preview")}function o(e,r){const t=e.allLayerViews.find(e=>e.uid===r);return t?.layer.parent===e.map?.basemap}let f;function y(e){if(f)return f(e);let r=null;const t=g(e),a=!t?.baseLayers.length;for(const n in i){const e=x(t,w(i[n]),{mustMatchReferences:a});if("equal"===e){r=n;break}"base-layers-equal"===e&&(r=n)}return r}function p(e){f=e}function m(e,r){if(e===r)return!0;if(null!=e?.portalItem?.id&&e.portalItem.id===r?.portalItem?.id)return!0;return"equal"===x(g(e),g(r),{mustMatchReferences:!0})}function d(e){return!!e?.baseLayers.concat(e.referenceLayers).some(b)}function b(e){if(v(e.url))return!0;if("vector-tile"===e.type)for(const r in e.sourceNameToSource){const t=e.sourceNameToSource[r];if(v(t?.sourceUrl))return!0}return!1}function L(e,r){if(null==r||null==e)return{spatialReference:null,updating:!1};if("not-loaded"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const t=r.baseLayers.at(0);switch(t.loadStatus){case"not-loaded":t.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const a=(("supportedSpatialReferences"in t?t.supportedSpatialReferences:null)||["tileInfo"in t?t.tileInfo?.spatialReference:t.spatialReference]).filter(Boolean),n=e.spatialReference;return n?{spatialReference:a.find(e=>n.equals(e))??a[0]??null,updating:!1}:{spatialReference:a[0],updating:!1}}const S=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function v(e){if(!e)return!1;const r=new t(a(e));return!!r.authority&&S.test(r.authority)}function g(e){return e?!e.loaded&&e.resourceInfo?w(e.resourceInfo.data):{baseLayers:I(e.baseLayers),referenceLayers:I(e.referenceLayers),groundLayers:I(e.groundLayers)}:null}function I(r){return(e.isCollection(r)?r.toArray():r).map(h)}function h(e){return{type:e.type,effect:"effect"in e?e.effect:void 0,url:C("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl||""),minScale:"minScale"in e&&null!=e.minScale?e.minScale:0,maxScale:"maxScale"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:"map-image"!==e.type&&"wms"!==e.type||null==e.sublayers?void 0:e.sublayers?.map(e=>({id:e.id,visible:e.visible})),activeLayerId:"wmts"===e.type?e.activeLayer?.id:void 0}}function R(e){return e.isReference||"ArcGISSceneServiceLayer"===e.layerType}function w(e){return e?{baseLayers:T((e.baseMapLayers??[]).filter(e=>!R(e))),referenceLayers:T((e.baseMapLayers??[]).filter(e=>R(e))),groundLayers:T(e.groundLayers??[])}:null}function T(e){return e.map(e=>q(e))}function q(e){let r;switch(e.layerType){case"VectorTileLayer":r="vector-tile";break;case"ArcGISTiledMapServiceLayer":r="tile";break;case"ArcGISSceneServiceLayer":r="scene";break;case"IntegratedMesh3DTilesLayer":r="IntegratedMesh3DTilesLayer";break;default:r="unknown"}return{type:r,effect:e.effect,url:C(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale??0,maxScale:e.maxScale??0,opacity:e.opacity??1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function x(e,r,t){if(null!=e!=(null!=r))return"not-equal";if(!e||!r)return"equal";if(!U(e.baseLayers,r.baseLayers))return"not-equal";return U(e.referenceLayers,r.referenceLayers)?"equal":t.mustMatchReferences?"not-equal":"base-layers-equal"}function U(e,r){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(!M(e[t],r[t]))return!1;return!0}function M(e,r){if(e.type!==r.type||e.url!==r.url||e.minScale!==r.minScale||e.maxScale!==r.maxScale||e.visible!==r.visible||e.opacity!==r.opacity)return!1;if(!l(e.effect,r.effect))return!1;if(null!=e.activeLayerId||null!=r.activeLayerId)return e.activeLayerId===r.activeLayerId;if(null!=e.sublayers||null!=r.sublayers){if(null==e.sublayers||null==r.sublayers||e.sublayers.length!==r.sublayers.length)return!1;for(let t=0;t<e.sublayers.length;t++){const a=e.sublayers.at(t),n=r.sublayers.at(t);if(a?.id!==n?.id||a?.visible!==n?.visible)return!1}}return!0}function C(e){return e?n(e).replace(/^\s*https?:/i,"").toLowerCase():""}function k(e){if(!e)return null;const{thumbnailUrl:t}=e;if(t)return t;const a=y(e);return a?i[a].thumbnailUrl:r(e.baseLayers,j)}function j(e){return"portalItem"in e?e.portalItem?.thumbnailUrl:void 0}export{m as contentEquals,L as findSpatialReference,k as getBasemapThumbnailUrl,y as getWellKnownBasemapId,d as hasDeveloperBasemapLayer,s as isBasemap3D,u as isBasemapInBeta,c as isBasemapInPreview,o as isBasemapLayerView,b as isDeveloperBasemapLayer,M as layerDefinitionEquals,h as layerToDefinition,p as overrideGetWellKnownBasemapId};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const a="20260617",e="5c30ed300866e2ab140a1fa8acb193438e584ffa";export{a as buildDate,e as commitHash};
2
+ const c="20260619",d="3e18d30dfa27171040977185a594d02520b5c7c5";export{c as buildDate,d as commitHash};
@@ -63,7 +63,7 @@ export interface SimpleMarkerSymbolProperties extends MarkerSymbolProperties, Pa
63
63
  * >
64
64
  * > **Known Limitations**
65
65
  * >
66
- * > [SimpleLineSymbol `style](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) property is not honored in a simple marker symbol's `outline` in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
66
+ * > [SimpleLineSymbol.style](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/#style) property is not honored in a simple marker symbol's `outline` in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
67
67
  * > Support for outline `style` was added in a 2D [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) at version 4.28.
68
68
  *
69
69
  * @example
@@ -188,7 +188,7 @@ export default class SimpleMarkerSymbol extends MarkerSymbol {
188
188
  * >
189
189
  * > **Known Limitations**
190
190
  * >
191
- * > [SimpleLineSymbol `style](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/) property is not honored in a simple marker symbol's `outline` in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
191
+ * > [SimpleLineSymbol.style](https://developers.arcgis.com/javascript/latest/references/core/symbols/SimpleLineSymbol/#style) property is not honored in a simple marker symbol's `outline` in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
192
192
  * > Support for outline `style` was added in a 2D [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) at version 4.28.
193
193
  *
194
194
  * @example
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{AttributeStoreView as e}from"./webgl/AttributeStoreView.js";import t from"./webgl/TileContainer.js";const i=60;class s extends t{constructor(t){super(t),this._statisticsByLevel=new Map,this._entityIndex=new Map,this.attributeView=new e}destroy(){super.destroy(),this.children.forEach(e=>e.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(e){e.context.capabilities.enable("textureFloatLinear"),super.doRender(e)}get hasAnimations(){for(const e of this.children)if(e.hasAnimations)return!0;return!1}_reindexAndUpdateFeaturesIfNeeded(){if(this.hasAnimations&&(this._reindexFeatures(),0!==this.attributeView.size))for(const e of this._entityIndex.values())e.dirty&&(this.attributeView.setData(e.displayId,7,0,e.firstIndexed),e.dirty=!1)}restartAnimation(e){const t=this._entityIndex.get(e);if(!t)return;const i=performance.now()/1e3;t.firstIndexed=i,t.dirty=!0}restartAllAnimations(){const e=performance.now()/1e3;for(const[t,i]of this._entityIndex)i.firstIndexed=e,i.dirty=!0}_reindexFeatures(){const e=performance.now()/1e3;for(const t of this.children)for(const i of t.entityIds){const{objectId:t}=i;let s=this._entityIndex.get(t);s||(s={objectId:t,displayId:0,firstIndexed:e,lastIndexed:0,dirty:!0},this._entityIndex.set(t,s)),s.lastIndexed=e,s.displayId=i.displayId}for(const[t,s]of this._entityIndex)e-s.lastIndexed>i&&this._entityIndex.delete(t)}_updateAttributeView(){this.attributeView.update()&&this.requestRender(),this._reindexAndUpdateFeaturesIfNeeded()}createRenderParams(e){const t=super.createRenderParams(e);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}}export{s as AFeatureContainer};
2
+ import{AttributeStoreView as e}from"./webgl/AttributeStoreView.js";import t from"./webgl/TileContainer.js";const i=60;class s extends t{constructor(t){super(t),this._statisticsByLevel=new Map,this._entityIndex=new Map,this.attributeView=new e}destroy(){super.destroy(),this.children.forEach(e=>e.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(e){e.context.capabilities.enable("textureFloatLinear"),super.doRender(e)}get hasAnimations(){for(const e of this.children)if(e.hasAnimations)return!0;return!1}_reindexAndUpdateFeaturesIfNeeded(){if(this.hasAnimations&&(this._reindexFeatures(),0!==this.attributeView.size))for(const e of this._entityIndex.values())e.dirty&&(this.attributeView.setData(e.displayId,7,0,e.firstIndexed),e.dirty=!1)}restartAnimation(e){const t=this._entityIndex.get(e);if(!t)return;const i=performance.now()/1e3;t.firstIndexed=i,t.dirty=!0}restartAllAnimations(){const e=performance.now()/1e3;for(const[t,i]of this._entityIndex)i.firstIndexed=e,i.dirty=!0}_reindexFeatures(){const e=performance.now()/1e3;for(const t of this.children)for(const i of t.entityIds){const{objectId:t}=i;let s=this._entityIndex.get(t);s||(s={objectId:t,displayId:0,firstIndexed:e,lastIndexed:0,dirty:!0},this._entityIndex.set(t,s)),s.lastIndexed=e,s.displayId=i.displayId}for(const[t,s]of this._entityIndex)e-s.lastIndexed>i&&this._entityIndex.delete(t)}_updateAttributeView(){this.attributeView.update()&&(this.requestRender(),this.hasLabels&&this.requestDeclutter()),this._reindexAndUpdateFeaturesIfNeeded()}createRenderParams(e){const t=super.createRenderParams(e);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}}export{s as AFeatureContainer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{estimateNumberArrayMemory as i}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{dataDrivenUnit2 as r,dataDrivenUnit1 as a,dataDrivenUnit0 as n,visualVariableUnit as u,localTimeOriginUnit as h,gpgpuUnit as o,animationUnit as d,filterFlagsUnit as l}from"./definitions.js";import{getDisplayIdTexel as g}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as _}from"./Utils.js";import{SizedPixelFormat as c}from"../../../webgl/enums.js";import{DisposableFramebufferObject as x}from"../../../webgl/FramebufferObject.js";import f from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class T{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:a}=t,n=p(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=a,a||(this.data=new n(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b(this.size);if(t.wrapMode=33071,t.samplingMode=9728,t.dataType=this.pixelType,2===this.blockIndex)t.pixelFormat=6403,t.internalFormat=c.R8;return t}get usedMemory(){return null!=this.data?i(this.data):0}setData(t,e,i){const s=g(t),r=this.data,a=s*this.texelSize+e;!r||a>=r.length||(r[a]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=g(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const a=this.data.buffer,n=this.getTexture(e),u=4,h=(s-s%this.size)/this.size,o=(r-r%this.size)/this.size,d=h,l=this.size,g=o,_=h*this.size*u,c=(l+g*this.size)*u-_,x=p(this.pixelType),f=new x(a,_*x.BYTES_PER_ELEMENT,c),b=this.size,T=g-d+1;if(T>this.size)return void m().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));n.updateData(0,0,d,b,T,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const a=1<<i%this.texelSize;t.layout&a&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,a=this._lastTexture.descriptor.pixelFormat,n=this.getFBO(t),u=_(r),h=new(p(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.boundFramebuffer,{x:d,y:l,width:g,height:c}=t.getViewport();t.bindFramebuffer(n),n.readPixels(0,0,i,s,a,r,h),e.updateData(0,0,0,2*i,s/2,h),t.setViewport(d,l,g,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._hasPendingUpdate=s(!1),this._locked=!1}get updating(){return this._hasPendingUpdate.value}get locked(){return this._locked}get usedMemory(){let t=0;for(const e of this._data??[])null!=e&&(t+=e.usedMemory);return t}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map((t,e)=>null!=t?new T(t,this.size,e):null);else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new T(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose(),this._defaultTexture=null,this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}setLocalTimeOrigin(t,e){this.setData(t,7,0,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVisualVariableData(t,e){return this.getData(t,3,e,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const a=r.getData(t,i);return null!=a?a:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}requestUpdate(t){this._version=t.version,this._pendingAttributeUpdates.push(t),this._hasPendingUpdate.value=!0,has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}get hasPendingUpdates(){return this._pendingAttributeUpdates.length>0}update(){if(this._locked)return!1;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];const e=!!t.length;for(const i of t){const{blockData:t,initArgs:e,sendUpdateEpoch:s,version:r}=i;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${s}] AttributeStoreView.applyUpdate`),this._version=r,this._epoch=s,null!=e&&this._initialize(e);const a=this._data;for(let i=0;i<t.length;i++){const e=t[i],s=a[i];null!=s&&null!=e&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${i}] AttributeStoreView.update`,{block:e}),s.update(e))}}return this._hasPendingUpdate.value=!1,e}getUniforms(){return{size:this.size}}getTextures(t){return{filterFlags:{texture:this._getTexture(t,0),unit:l},animation:{texture:this._getTexture(t,1),unit:d},gpgpu:{texture:this._getTexture(t,2),unit:o},localTimeOrigin:{texture:this._getTexture(t,7),unit:h},visualVariableData:{texture:this._getTexture(t,3),unit:u},dataDriven0:{texture:this._getTexture(t,4),unit:n},dataDriven1:{texture:this._getTexture(t,5),unit:a},dataDriven2:{texture:this._getTexture(t,6),unit:r}}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b(1);e.wrapMode=33071,e.samplingMode=9728,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
2
+ import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{estimateNumberArrayMemory as i}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{dataDrivenUnit2 as r,dataDrivenUnit1 as n,dataDrivenUnit0 as a,visualVariableUnit as u,localTimeOriginUnit as h,gpgpuUnit as o,animationUnit as d,filterFlagsUnit as l}from"./definitions.js";import{getDisplayIdTexel as g}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as _}from"./Utils.js";import{SizedPixelFormat as c}from"../../../webgl/enums.js";import{DisposableFramebufferObject as x}from"../../../webgl/FramebufferObject.js";import f from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class T{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:n}=t,a=p(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=n,n||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b(this.size);if(t.wrapMode=33071,t.samplingMode=9728,t.dataType=this.pixelType,2===this.blockIndex)t.pixelFormat=6403,t.internalFormat=c.R8;return t}get usedMemory(){return null!=this.data?i(this.data):0}setData(t,e,i){const s=g(t),r=this.data,n=s*this.texelSize+e;!r||n>=r.length||(r[n]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=g(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,a=this.getTexture(e),u=4,h=(s-s%this.size)/this.size,o=(r-r%this.size)/this.size,d=h,l=this.size,g=o,_=h*this.size*u,c=(l+g*this.size)*u-_,x=p(this.pixelType),f=new x(n,_*x.BYTES_PER_ELEMENT,c),b=this.size,T=g-d+1;if(T>this.size)return void m().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,d,b,T,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const n=1<<i%this.texelSize;t.layout&n&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,n=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(t),u=_(r),h=new(p(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.boundFramebuffer,{x:d,y:l,width:g,height:c}=t.getViewport();t.bindFramebuffer(a),a.readPixels(0,0,i,s,n,r,h),e.updateData(0,0,0,2*i,s/2,h),t.setViewport(d,l,g,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._hasPendingUpdate=s(!1),this._locked=!1}get updating(){return this._hasPendingUpdate.value}get locked(){return this._locked}get usedMemory(){let t=0;for(const e of this._data??[])null!=e&&(t+=e.usedMemory);return t}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map((t,e)=>null!=t?new T(t,this.size,e):null);else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new T(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose(),this._defaultTexture=null,this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}setLocalTimeOrigin(t,e){this.setData(t,7,0,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVisualVariableData(t,e){return this.getData(t,3,e,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const n=r.getData(t,i);return null!=n?n:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){return this._locked=!1,this.update()}requestUpdate(t){this._version=t.version,this._pendingAttributeUpdates.push(t),this._hasPendingUpdate.value=!0,has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}get hasPendingUpdates(){return this._pendingAttributeUpdates.length>0}update(){if(this._locked)return!1;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];const e=!!t.length;for(const i of t){const{blockData:t,initArgs:e,sendUpdateEpoch:s,version:r}=i;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${s}] AttributeStoreView.applyUpdate`),this._version=r,this._epoch=s,null!=e&&this._initialize(e);const n=this._data;for(let i=0;i<t.length;i++){const e=t[i],s=n[i];null!=s&&null!=e&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${i}] AttributeStoreView.update`,{block:e}),s.update(e))}}return this._hasPendingUpdate.value=!1,e}getUniforms(){return{size:this.size}}getTextures(t){return{filterFlags:{texture:this._getTexture(t,0),unit:l},animation:{texture:this._getTexture(t,1),unit:d},gpgpu:{texture:this._getTexture(t,2),unit:o},localTimeOrigin:{texture:this._getTexture(t,7),unit:h},visualVariableData:{texture:this._getTexture(t,3),unit:u},dataDriven0:{texture:this._getTexture(t,4),unit:a},dataDriven1:{texture:this._getTexture(t,5),unit:n},dataDriven2:{texture:this._getTexture(t,6),unit:r}}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b(1);e.wrapMode=33071,e.samplingMode=9728,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{fromRotation as t,multiply as e,translate as s,rotate as i}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as h}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as a,getYAnchorDirection as f}from"../../alignmentUtils.js";import c from"../../Rect.js";import l from"../../collisions/BoundingBox.js";const d=22,g=4,m=d+g,u=d-6,x=Math.PI/180,p=8,_=1.5;class w{constructor(t,e,s,i){this._rotationT=n(),this._transform=n(),this._angle=0,this._bounds=null;const{mosaicItem:o,rect:h,shaping:r,code:a}=s,f=o.rect;this.width=0===a?h.width:f.width*i,this.height=0===a?h.height:f.height*i,this.x=i*(t+r.xOffset+h.left),this.y=i*(e+r.yOffset-h.top),this.textureBinding=o.textureBinding,this.texcoords={topLeft:[f.x,f.y],topRight:[f.x+f.width,f.y],bottomLeft:[f.x,f.y+f.height],bottomRight:[f.x+f.width,f.y+f.height]}}set angle(e){this._angle=e,t(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){const{x:s,y:i,width:h,height:r}=this,a=t(n(),-this.angle),f=e(n(),a,this._transform);this._offsets={topLeft:o([0,0],[s,i],f),topRight:o([0,0],[s+h,i],f),bottomLeft:o([0,0],[s,i+r],f),bottomRight:o([0,0],[s+h,i+r],f)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){const t=this.offsets;let e=1/0,s=1/0,i=-1/0,n=-1/0;for(const[f,c]of[t.topLeft,t.topRight,t.bottomLeft,t.bottomRight])e=Math.min(e,f),s=Math.min(s,c),i=Math.max(i,f),n=Math.max(n,c);const o=i-e,h=n-s,r=e+o/2,a=s+h/2;this._bounds=new l(r,a,o,h)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}}const y=(t,e)=>({code:0,mosaicItem:{rect:new c(0,0,11,8),sdf:!0,page:0,textureBinding:e},rect:{height:4,width:t,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function b(t,e){return t.forEach(t=>o(t,t,e)),{topLeft:t[0],topRight:t[1],bottomLeft:t[2],bottomRight:t[3]}}class M{constructor(t,e,s,i){this._rotation=0,this._decorate(t,e,s,i),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==s.angle,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const n of t)n.setTransform(this._transform)}setRotation(s){if(0===s&&0===this._rotation)return;this._rotation=s;const i=this._transform,o=t(n(),s);e(i,o,i);for(const t of this.glyphs)t.setTransform(this._transform)}_decorate(t,e,s,i){if(!s.decoration||"none"===s.decoration||!t.length)return;const n=s.scale,o="underline"===s.decoration?i?.baseline??m:i?.midline??u,h=t[0].textureBinding;for(const r of e){const e=r.startX*n,s=r.startY*n,i=(r.width+r.glyphWidthEnd)*n;t.push(new w(e,s+o*n,y(i,h),1))}}shapeBackground(t){const e=this._borderLineSizePx||0,s=(_+e)/2,i=this._borderLineSizePx?s:0,{xmin:n,ymin:o,xmax:h,ymax:r,x:a,y:f,width:c,height:d}=this.bounds,g=[n-p,o-p],m=[h+p,o-p],u=[n-p,r+p],x=[h+p,r+p],w=b([[g[0]-s,g[1]-s],[m[0]+s,m[1]-s],[g[0]+i,g[1]+i],[m[0]-i,m[1]+i]],t),y=b([[u[0]+i,u[1]-i],[x[0]-i,x[1]-i],[u[0]-s,u[1]+s],[x[0]+s,x[1]+s]],t),M=b([[g[0]-s,g[1]-s],[g[0]+i,g[1]+i],[u[0]-s,u[1]+s],[u[0]+i,u[1]-i]],t),L=b([[m[0]-i,m[1]+i],[m[0]+s,m[1]-s],[x[0]-i,x[1]-i],[x[0]+s,x[1]+s]],t),A={main:b([g,m,u,x],t),top:w,bot:y,left:M,right:L};return[new l(a,f,c+2*s,d+2*s),A]}get boundsT(){const t=this.bounds,e=h(r(),t.x,t.y);if(o(e,e,this._transform),this._hasRotation){const s=Math.max(t.width,t.height);return new l(e[0],e[1],s,s)}return new l(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,s=1/0,i=0,n=0;for(const r of t)e=Math.min(e,r.offsets.topLeft[0]),s=Math.min(s,r.offsets.topLeft[1]),i=Math.max(i,r.offsets.bottomRight[0]),n=Math.max(n,r.offsets.bottomRight[1]);const o=i-e,h=n-s;return new l(e+o/2,s+h/2,o,h)}_createGlyphTransform(t,e){const o=x*e.angle,a=n(),f=r();return s(a,a,h(f,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?i(a,a,o):(s(a,a,h(f,t.x,t.y)),i(a,a,o),s(a,a,h(f,-t.x,-t.y))),a}}class L{constructor(t,e,s,i,n,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,s)),this.end=Math.max(0,Math.max(e,s)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].rect.width),this.width=i,this.yMin=n,this.yMax=o}}const A=t=>10===t,R=t=>32===t;function v(t,e,s){const i=new Array,n=1/s.scale,o=s.maxLineWidth*n,h=e?t.length-1:0,r=e?-1:t.length,a=e?-1:1;let f=h,c=0,l=0,d=f,g=d,m=0,u=1/0,x=0;for(;f!==r;){const{code:e,rect:s,shaping:n}=t[f],r=Math.abs(s.top);if(A(e)||R(e)||(u=Math.min(u,r),x=Math.max(x,r+s.height)),A(e))f!==h&&(i.push(new L(t,d,f-a,c,u===1/0?0:u,x)),u=1/0,x=0),c=0,d=f+a,g=f+a,l=0;else if(R(e))g=f+a,l=0,m=n.xAdvance,c+=n.xAdvance;else if(c>o){if(g!==d){const e=g-2*a;c-=m,i.push(new L(t,d,e,c-l,u,x)),u=1/0,x=0,d=g,c=l}else i.push(new L(t,d,f-a,c,u,x)),u=1/0,x=0,d=f,g=f,c=0;c+=n.xAdvance,l+=n.xAdvance}else c+=n.xAdvance,l+=n.xAdvance;f+=a}const p=new L(t,d,f-a,c,u,x);return p.start>=0&&p.end<t.length&&i.push(p),i}function B(t,e){let s=0;for(let o=0;o<t.length;o++){const{width:e}=t[o];s=Math.max(e,s)}const i="underline"===e.decoration?g:0,n=t[0].yMin;return{x:0,y:n,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+i-n,width:s}}function T(t,e,s){let i=0;for(let n=e;n<s;n++)R(t[n].code)&&!A(t[n+1].code)&&i++;return i}function j(t,e){const s=e.scale,i=new Array,n=t.sdfPadding,{faceInfo:o,glyphs:h,isRightToLeft:r}=t,c="justify"===e.horizontalAlignment||"Justify"===e.horizontalAlignment,l=v(h,r,e),g=l.length?B(l,e):{y:0,height:0,width:0},m=c?r?1:-1:a(e.horizontalAlignment),u=f(e.verticalAlignment),x=2===u?1:0,p=x?0:u-1,_=o?.baseline??d,y=l.length>1,b=x?y?-g.y-g.height:-_:-g.y+p*(g.height/2);for(let a=0;a<l.length;a++){const{start:o,end:r,width:f}=l[a],d=c&&a<l.length-1?T(h,o,r):0,u=d>0?(g.width-f)/d:0;let x=-1*(m+1)*((u>0?g.width:f)/2)-n;const p=(t.isRightToLeft?l.length-1-a:a)*e.lineHeight+b-n;l[a].startX=x,l[a].startY=p;for(let t=o;t<=r;t++){const e=h[t];if(A(e.code))continue;const n=new w(x,p,e,s);x+=e.shaping.xAdvance,u>0&&R(e.code)&&(x+=u),i.push(n)}}return new M(i,l,e,o)}function z(t,e){const s=e.scale,{faceInfo:i,glyphs:n}=t,o=n.map(t=>new w(0,0,t,s));return new M(o,[],e,i)}export{w as ShapedGlyph,M as ShapingInfo,j as shapeGlyphs,z as shapeGlyphsForMultipoint};
2
+ import{fromRotation as t,multiply as e,translate as i,rotate as s}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as h}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as a,getYAnchorDirection as f}from"../../alignmentUtils.js";import c from"../../Rect.js";import d from"../../collisions/BoundingBox.js";const l=22,g=4,m=l+g,u=l-6,x=Math.PI/180,p=8,w=1.5;class _{constructor(t,e,i,s){this._rotationT=n(),this._transform=n(),this._angle=0,this._bounds=null;const{mosaicItem:o,rect:h,shaping:r,code:a}=i,f=o.rect;this.width=0===a?h.width:f.width*s,this.height=0===a?h.height:f.height*s,this.x=s*(t+r.xOffset+h.left),this.y=s*(e+r.yOffset-h.top),this.textureBinding=o.textureBinding,this.texcoords={topLeft:[f.x,f.y],topRight:[f.x+f.width,f.y],bottomLeft:[f.x,f.y+f.height],bottomRight:[f.x+f.width,f.y+f.height]}}set angle(e){this._angle=e,t(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){const{x:i,y:s,width:h,height:r}=this,a=t(n(),-this.angle),f=e(n(),a,this._transform);this._offsets={topLeft:o([0,0],[i,s],f),topRight:o([0,0],[i+h,s],f),bottomLeft:o([0,0],[i,s+r],f),bottomRight:o([0,0],[i+h,s+r],f)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){const t=this.offsets;let e=1/0,i=1/0,s=-1/0,n=-1/0;for(const[f,c]of[t.topLeft,t.topRight,t.bottomLeft,t.bottomRight])e=Math.min(e,f),i=Math.min(i,c),s=Math.max(s,f),n=Math.max(n,c);const o=s-e,h=n-i,r=e+o/2,a=i+h/2;this._bounds=new d(r,a,o,h)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}}const y=(t,e)=>({code:0,mosaicItem:{rect:new c(0,0,11,8),sdf:!0,page:0,textureBinding:e},rect:{height:4,width:t,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function b(t,e){return t.forEach(t=>o(t,t,e)),{topLeft:t[0],topRight:t[1],bottomLeft:t[2],bottomRight:t[3]}}class M{constructor(t,e,i,s){this._rotation=0,this._decorate(t,e,i,s),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==i.angle,this._transform=this._createGlyphTransform(this.bounds,i),this._borderLineSizePx=i.borderLineSizePx,(i.borderLineSizePx||i.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const n of t)n.setTransform(this._transform)}setRotation(i){if(0===i&&0===this._rotation)return;this._rotation=i;const s=this._transform,o=t(n(),i);e(s,o,s);for(const t of this.glyphs)t.setTransform(this._transform)}_decorate(t,e,i,s){if(!i.decoration||"none"===i.decoration||!t.length)return;const n=i.scale,o="underline"===i.decoration?s?.baseline??m:s?.midline??u,h=t[0].textureBinding;for(const r of e){const e=r.startX*n,i=r.startY*n,s=(r.width+r.glyphWidthEnd)*n;t.push(new _(e,i+o*n,y(s,h),1))}}shapeBackground(t){const e=this._borderLineSizePx||0,i=(w+e)/2,s=this._borderLineSizePx?i:0,{xmin:n,ymin:o,xmax:h,ymax:r,x:a,y:f,width:c,height:l}=this.bounds,g=[n-p,o-p],m=[h+p,o-p],u=[n-p,r+p],x=[h+p,r+p],_=b([[g[0]-i,g[1]-i],[m[0]+i,m[1]-i],[g[0]+s,g[1]+s],[m[0]-s,m[1]+s]],t),y=b([[u[0]+s,u[1]-s],[x[0]-s,x[1]-s],[u[0]-i,u[1]+i],[x[0]+i,x[1]+i]],t),M=b([[g[0]-i,g[1]-i],[g[0]+s,g[1]+s],[u[0]-i,u[1]+i],[u[0]+s,u[1]-s]],t),L=b([[m[0]-s,m[1]+s],[m[0]+i,m[1]-i],[x[0]-s,x[1]-s],[x[0]+i,x[1]+i]],t),A={main:b([g,m,u,x],t),top:_,bot:y,left:M,right:L};return[new d(a,f,c+2*i,l+2*i),A]}get boundsT(){const t=this.bounds,e=h(r(),t.x,t.y);if(o(e,e,this._transform),this._hasRotation){const i=Math.max(t.width,t.height);return new d(e[0],e[1],i,i)}return new d(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,i=1/0,s=0,n=0;for(const r of t)e=Math.min(e,r.offsets.topLeft[0]),i=Math.min(i,r.offsets.topLeft[1]),s=Math.max(s,r.offsets.bottomRight[0]),n=Math.max(n,r.offsets.bottomRight[1]);const o=s-e,h=n-i;return new d(e+o/2,i+h/2,o,h)}_createGlyphTransform(t,e){const o=x*e.angle,a=n(),f=r();return i(a,a,h(f,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?s(a,a,o):(i(a,a,h(f,t.x,t.y)),s(a,a,o),i(a,a,h(f,-t.x,-t.y))),a}}class L{constructor(t,e,i,s,n,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,i)),this.end=Math.max(0,Math.max(e,i)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].rect.width),this.width=s,this.yMin=n,this.yMax=o}}const A=t=>10===t,R=t=>32===t;function v(t,e,i){const s=new Array,n=1/i.scale,o=i.maxLineWidth*n,h=e?t.length-1:0,r=e?-1:t.length,a=e?-1:1;let f=h,c=0,d=0,l=f,g=l,m=0,u=1/0,x=0;for(;f!==r;){const{code:e,rect:i,shaping:n}=t[f],r=Math.abs(i.top);if(A(e)||R(e)||(u=Math.min(u,r),x=Math.max(x,r+i.height)),A(e))f!==h&&(s.push(new L(t,l,f-a,c,u===1/0?0:u,x)),u=1/0,x=0),c=0,l=f+a,g=f+a,d=0;else if(R(e))g=f+a,d=0,m=n.xAdvance,c+=n.xAdvance;else if(c>o){if(g!==l){const e=g-2*a;c-=m,s.push(new L(t,l,e,c-d,u,x)),u=1/0,x=0,l=g,c=d}else s.push(new L(t,l,f-a,c,u,x)),u=1/0,x=0,l=f,g=f,c=0;c+=n.xAdvance,d+=n.xAdvance}else c+=n.xAdvance,d+=n.xAdvance;f+=a}const p=new L(t,l,f-a,c,u,x);return p.start>=0&&p.end<t.length&&s.push(p),s}function B(t,e){let i=0;for(let o=0;o<t.length;o++){const{width:e}=t[o];i=Math.max(e,i)}const s="underline"===e.decoration?g:0,n=t[0].yMin;return{x:0,y:n,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+s-n,width:i}}function T(t,e,i){let s=0;for(let n=e;n<i;n++)R(t[n].code)&&!A(t[n+1].code)&&s++;return s}function j(t,e){const i=e.scale,s=new Array,n=t.sdfPadding,{faceInfo:o,glyphs:h,isRightToLeft:r}=t,c="justify"===e.horizontalAlignment||"Justify"===e.horizontalAlignment,d=v(h,r,e),g=d.length?B(d,e):{y:0,height:0,width:0},m=c?r?1:-1:a(e.horizontalAlignment),u=f(e.verticalAlignment),x=2===u?1:0,p=x?0:u-1,w=o?.baseline??l,y=d.length>1,b=x?y?-g.y-g.height:-w:-g.y+p*(g.height/2);for(let a=0;a<d.length;a++){const{start:o,end:r,width:f}=d[a],l=c&&a<d.length-1?T(h,o,r):0,u=l>0?(g.width-f)/l:0;let x=-1*(m+1)*((u>0?g.width:f)/2)-n;const p=(t.isRightToLeft?d.length-1-a:a)*e.lineHeight+b-n;d[a].startX=x,d[a].startY=p;for(let t=o;t<=r;t++){const e=h[t];if(A(e.code))continue;const n=new _(x,p,e,i);x+=e.shaping.xAdvance,u>0&&R(e.code)&&(x+=u),s.push(n)}}return new M(s,d,e,o)}function z(t,e){const i=e.scale,{faceInfo:s,glyphs:n}=t,o=n.reduce((t,e)=>Math.max(t,e.rect.height),0),h=n.map(t=>new _(-t.rect.width/2,-o,t,i));return new M(h,[],e,s)}export{_ as ShapedGlyph,M as ShapingInfo,j as shapeGlyphs,z as shapeGlyphsForMultipoint};