@arcgis/core 4.33.0-next.20250204 → 4.33.0-next.20250206

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 (148) hide show
  1. package/assets/components/assets/icon/dualImageArea16.json +1 -0
  2. package/assets/components/assets/icon/dualImageArea24.json +1 -0
  3. package/assets/components/assets/icon/dualImageArea32.json +1 -0
  4. package/assets/components/assets/icon/dualImageDistance16.json +1 -0
  5. package/assets/components/assets/icon/dualImageDistance24.json +1 -0
  6. package/assets/components/assets/icon/dualImageDistance32.json +1 -0
  7. package/assets/components/assets/icon/dualImageLocation16.json +1 -0
  8. package/assets/components/assets/icon/dualImageLocation24.json +1 -0
  9. package/assets/components/assets/icon/dualImageLocation32.json +1 -0
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/06f693780f70e5a627c4.js +1 -0
  12. package/assets/esri/core/workers/chunks/{24a86c52c8bdd0b5eb4d.js → 09a99c556089c166d1f8.js} +1 -1
  13. package/assets/esri/core/workers/chunks/15f850c9a1154fc57e5a.js +1 -0
  14. package/assets/esri/core/workers/chunks/{9b4f471fcd8a3b5e089f.js → 192569dfa7c0ea8dd864.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1a2e1a414e651e988435.js.LICENSE.txt +1 -1
  16. package/assets/esri/core/workers/chunks/24e47f748f0e4f815c6e.js +1 -0
  17. package/assets/esri/core/workers/chunks/28374a64790342e1b5ae.js +1 -0
  18. package/assets/esri/core/workers/chunks/{c3f03ccabca691186aad.js → 287362f9af132fafe4de.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{ad215219e5eef8598745.js → 28dbbfc44cc2bdcd221d.js} +1 -1
  20. package/assets/esri/core/workers/chunks/2adc533dadcb018a9755.js +1 -0
  21. package/assets/esri/core/workers/chunks/308ec51ff4a66f7fcb0d.js.LICENSE.txt +1 -1
  22. package/assets/esri/core/workers/chunks/333091ab2e267652ed56.js +1 -0
  23. package/assets/esri/core/workers/chunks/354531dc2f0dea2ad96f.js.LICENSE.txt +1 -1
  24. package/assets/esri/core/workers/chunks/38cd7745b8ef1b8b6196.js +1 -0
  25. package/assets/esri/core/workers/chunks/{8a1e4f65fc81aba7a704.js → 4122d10bc910e888eee1.js} +1 -1
  26. package/assets/esri/core/workers/chunks/41cd1a5c99ab3bbd1fb4.js +1 -0
  27. package/assets/esri/core/workers/chunks/433576983754f690bcc7.js +1 -0
  28. package/assets/esri/core/workers/chunks/{b1269b51cef3e11c85e3.js → 48ecc5a74fecbb2b9c6f.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{b8a519d5d24b2e728ff8.js → 5a25cef6355fd20e44e7.js} +2 -2
  30. package/assets/esri/core/workers/chunks/{b8a519d5d24b2e728ff8.js.LICENSE.txt → 5a25cef6355fd20e44e7.js.LICENSE.txt} +1 -1
  31. package/assets/esri/core/workers/chunks/{8edae4ca2b18a219a43e.js → 5e7f16b312077ca8c18d.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{7a0415db78c68d31733f.js → 6039da57a2adedd3b83f.js} +1 -1
  33. package/assets/esri/core/workers/chunks/72cf9192292e5c85c6df.js.LICENSE.txt +1 -1
  34. package/assets/esri/core/workers/chunks/73d03c208242778e67bf.js +1 -0
  35. package/assets/esri/core/workers/chunks/{e4f82b5b50996b1ae48e.js → 746c964cf07e4306f21f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/77764ca90bdd13ee2167.js.LICENSE.txt +1 -1
  37. package/assets/esri/core/workers/chunks/{723a9fba144e2fa6d017.js → 7cb09e58bcc537ec1f7a.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{07360fde6ea65664e6ca.js → 82d26884127ed772cc4b.js} +1 -1
  39. package/assets/esri/core/workers/chunks/842db06ce62758fab1e7.js +1 -0
  40. package/assets/esri/core/workers/chunks/{60cd8f4bba3e682ba57e.js → 91d2bdfa6e34c10b7f50.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{12dd892cf61a76fb40ad.js → 991e0f619f1f81f94d56.js} +1 -1
  42. package/assets/esri/core/workers/chunks/9a27824d94df702e6e28.js +1 -0
  43. package/assets/esri/core/workers/chunks/{610b33b7291cffcc4e5d.js → a42ae5d5e5f66d120b4d.js} +1 -1
  44. package/assets/esri/core/workers/chunks/a5e9ea13e844a62b2a7f.js +1 -0
  45. package/assets/esri/core/workers/chunks/b21b152fa15896577242.js.LICENSE.txt +1 -1
  46. package/assets/esri/core/workers/chunks/b43d88b6e7dc4ab13599.js +1 -0
  47. package/assets/esri/core/workers/chunks/{da77eefaad83c0644380.js → b8fae500c69ca2cff62a.js} +1 -1
  48. package/assets/esri/core/workers/chunks/b9d9a1dc3c5d799e2685.js +1 -0
  49. package/assets/esri/core/workers/chunks/{9c5c6ecaf5be24279fa5.js → ddc30044f61a2c2df3fe.js} +1 -1
  50. package/assets/esri/core/workers/chunks/e26dc0c1654316bb1558.js +1 -0
  51. package/assets/esri/core/workers/chunks/ef6279f5c63ab1e88c71.js +1 -0
  52. package/assets/esri/core/workers/chunks/{0711d3ad4d403bcfdcad.js → f117a89d1f4001a1f9f0.js} +1 -1
  53. package/assets/esri/core/workers/chunks/f4e48bbdbc9da10ec71a.js +1 -0
  54. package/assets/esri/core/workers/chunks/f9e48205178a5a804d38.js +1 -0
  55. package/assets/esri/themes/base/widgets/_Directions.scss +74 -17
  56. package/assets/esri/themes/dark/main.css +1 -1
  57. package/assets/esri/themes/light/main.css +1 -1
  58. package/assets/esri/themes/light/view.css +1 -1
  59. package/chunks/ColorMaterial.glsl.js +4 -5
  60. package/chunks/Pattern.glsl.js +1 -1
  61. package/chunks/WaterSurface.glsl.js +2 -2
  62. package/geometry/operators/projectOperator.js +1 -1
  63. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  64. package/geometry/support/meshUtils/elevation.js +1 -1
  65. package/interfaces.d.ts +76 -28
  66. package/layers/Layer.js +1 -1
  67. package/layers/graphics/data/FeatureStore.js +1 -1
  68. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  69. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  70. package/layers/ogc/wcsUtils.js +1 -1
  71. package/layers/support/RasterFunctionTemplate.js +1 -1
  72. package/layers/support/Sublayer.js +1 -1
  73. package/layers/support/capabilities.js +1 -1
  74. package/layers/support/featureLayerUtils.js +1 -1
  75. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  76. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  77. package/layers/support/rasterDatasets/wcsCapabilitiesParser.js +1 -1
  78. package/layers/support/rasterFunctionUtils.d.ts +2 -1
  79. package/layers/support/rasterFunctionUtils.js +1 -1
  80. package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
  81. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  82. package/package.json +2 -2
  83. package/rest/query/operations/queryAttachments.js +1 -1
  84. package/rest/support/AttachmentQuery.js +1 -1
  85. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  86. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  87. package/support/revision.js +1 -1
  88. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  89. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  90. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  91. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  92. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  93. package/views/2d/layers/LayerView2D.js +1 -1
  94. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  95. package/views/2d/layers/TileLayerView2D.js +1 -1
  96. package/views/2d/layers/graphics/HighlightGraphicContainer.js +1 -1
  97. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  98. package/views/2d/layers/support/util.js +1 -1
  99. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  100. package/views/3d/layers/MediaLayerView3D.js +1 -1
  101. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  102. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  103. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  104. package/views/3d/terrain/OverlayManager.js +1 -1
  105. package/views/3d/terrain/OverlayRenderer.js +1 -1
  106. package/views/3d/terrain/TerrainSurface.js +1 -1
  107. package/views/3d/webgl-engine/Stage.js +1 -1
  108. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  109. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  110. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  111. package/views/LayerViewManager.js +1 -1
  112. package/views/SceneView.js +1 -1
  113. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  114. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileCache.js +1 -1
  115. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  116. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  117. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  118. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  119. package/widgets/Directions.js +1 -1
  120. package/widgets/Editor/UpdateWorkflow.js +1 -1
  121. package/widgets/Editor/support/EditorItem.js +1 -1
  122. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  123. package/widgets/Feature/FeatureViewModel.js +1 -1
  124. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  125. package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
  126. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  127. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  128. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  129. package/widgets/support/geolocationUtils.js +1 -1
  130. package/assets/esri/core/workers/chunks/04306c2760c1f5b19966.js +0 -1
  131. package/assets/esri/core/workers/chunks/1e3ab66d0e8a7f160f33.js +0 -1
  132. package/assets/esri/core/workers/chunks/380d37ceb8cf52bad190.js +0 -1
  133. package/assets/esri/core/workers/chunks/39e38aab86dcee3f79be.js +0 -1
  134. package/assets/esri/core/workers/chunks/3ce826ebf0692363309d.js +0 -1
  135. package/assets/esri/core/workers/chunks/402de76b5de05615e111.js +0 -1
  136. package/assets/esri/core/workers/chunks/69d307758262e5d7a32e.js +0 -1
  137. package/assets/esri/core/workers/chunks/6dee40b94f94ee7bc4e4.js +0 -1
  138. package/assets/esri/core/workers/chunks/7a3e4cb5f64dac2cfe0e.js +0 -1
  139. package/assets/esri/core/workers/chunks/7e4d72279cc599b7029c.js +0 -1
  140. package/assets/esri/core/workers/chunks/8438fba57e82e4cc7c11.js +0 -1
  141. package/assets/esri/core/workers/chunks/92155d112ebb6a4c6c6e.js +0 -1
  142. package/assets/esri/core/workers/chunks/ba37ab9e560644dc1f18.js +0 -1
  143. package/assets/esri/core/workers/chunks/bbbe5d6cb8b737811c84.js +0 -1
  144. package/assets/esri/core/workers/chunks/bf26f58210755875748c.js +0 -1
  145. package/assets/esri/core/workers/chunks/c7a94e569c905f97244a.js +0 -1
  146. package/assets/esri/core/workers/chunks/d8c762ca94e3a11b125d.js +0 -1
  147. package/assets/esri/core/workers/chunks/dbc447413ab40a79ba87.js +0 -1
  148. package/assets/esri/core/workers/chunks/f48ef415b90edc7ccadd.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import t from"../../request.js";import i from"../../core/Collection.js";import o from"../../core/Error.js";import has from"../../core/has.js";import s from"../../core/Identifiable.js";import{clone as a}from"../../core/lang.js";import l from"../../core/Loadable.js";import n from"../../core/Logger.js";import{MultiOriginJSONMixin as p}from"../../core/MultiOriginJSONSupport.js";import{sqlAnd as u}from"../../core/sql.js";import{objectToQuery as y}from"../../core/urlUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import{cast as c}from"../../core/accessorSupport/decorators/cast.js";import{reader as f}from"../../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../../core/accessorSupport/decorators/writer.js";import{ensureInteger as b,ensureType as g,Integer as S,ensureClass as I}from"../../core/accessorSupport/ensureType.js";import{OriginId as w,nameToId as v}from"../../core/accessorSupport/PropertyOrigin.js";import{getProperties as j}from"../../core/accessorSupport/utils.js";import L from"../../geometry/Extent.js";import F from"../../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as D}from"../../geometry/support/typeUtils.js";import x from"../graphics/sources/support/QueryTask.js";import{readOrderByInfos as O}from"../mixins/OrderedLayer.js";import{getFeatureType as E}from"./featureLayerUtils.js";import P from"./FeatureType.js";import q from"./Field.js";import T from"./FieldsIndex.js";import{fixRendererFields as _}from"./fieldUtils.js";import A from"./LabelClass.js";import{validateLabelingInfo as R}from"./labelingInfo.js";import C from"./LayerFloorInfo.js";import M from"./OrderByInfo.js";import V from"./Relationship.js";import{getFeatureLayerCapabilities as N}from"./serviceCapabilitiesUtils.js";import{DataLayerSource as k}from"./source/DataLayerSource.js";import{MapLayerSource as U}from"./source/MapLayerSource.js";import{rendererTypes as B,webSceneRendererTypes as Q}from"../../renderers/support/typeUtils.js";import{parseUrl as J}from"../../rest/utils.js";import $ from"../../rest/support/AttachmentQuery.js";import K from"../../rest/support/Query.js";import{createPopupTemplate as G}from"../../support/popupUtils.js";import{isSymbol3D as z}from"../../symbols/support/typeUtils.js";var H;function W(e){return"esriSMS"===e?.type}function X(e,r,t){const i=this.originIdOf(r)>=v(t.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!t&&("map-image"===t.layer?.type&&(t.writeSublayerStructure||i))}}function Y(e,r,t){return{enabled:!!t&&("tile"===t.layer?.type&&(t.origin&&this.originIdOf(r)>=v(t.origin)||this._isOverridden(r)))}}function Z(e,r,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function ee(e,r,t){return{ignoreOrigin:!0,enabled:!!t?.writeSublayerStructure&&this.originIdOf(r)>w.SERVICE}}function re(e,r,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(r)>=v(t.origin))}}let te=0;const ie=new Set(["layer","parent","loaded","loadStatus","loadError","loadWarnings"]);let oe=H=class extends(p(s.IdentifiableMixin(l))){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:r,url:i}=this;if(!r&&!i)throw new o("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const s=r?await r.fetchSublayerInfo(this,e):(await t(i,{responseType:"json",query:{f:"json"},...e})).data;s&&(this.sourceJSON=s,this.read({layerDefinition:s},{origin:"service",layer:r,url:J(i)}))})()),this}readCapabilities(e,r){r=r.layerDefinition||r;const{attachment:t,operations:{supportsQuery:i,supportsQueryAttachments:o},query:{supportsFormatPBF:s,supportsOrderBy:a,supportsPagination:l},data:{supportsAttachment:n},queryRelated:p}=N(r,this.url);return{attachment:{supportsResize:t?.supportsResize??!1},exportMap:{supportsModification:!!r.canModifyLayer},operations:{supportsQuery:i,supportsQueryAttachments:o},data:{supportsAttachment:n},query:{supportsFormatPBF:s,supportsOrderBy:a,supportsPagination:l},queryRelated:p}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:r}=this;return{minScale:e,maxScale:r}}readMaxScaleRange(e,r){return{minScale:(r=r.layerDefinition||r).minScale??0,maxScale:r.maxScale??0}}get fieldsIndex(){return new T(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,r){if((r=r.layerDefinition||r).globalIdField)return r.globalIdField;if(r.fields)for(const t of r.fields)if("esriFieldTypeGlobalID"===t.type)return t.name}get id(){const e=this._get("id");return e??te++}set id(e){this._get("id")!==e&&(!1!==this.layer?.capabilities?.exportMap?.supportsDynamicLayers?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}readIsTable(e,r){return"Table"===r.type}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,r,t,i){e&&e.length&&(r.layerDefinition={drawingInfo:{labelingInfo:e.map((e=>e.write({},i)))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers?.forEach((r=>r.layer=e))}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,r){return r.minScale||r.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,r){return r.maxScale||r.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,r){if((r=r.layerDefinition||r).objectIdField)return r.objectIdField;const t=r.fields?.find((e=>"esriFieldTypeOID"===e.type));return t?.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,r){const{layerDefinition:t}=r;return 1-.01*(t?.transparency??t?.drawingInfo?.transparency??0)}writeOpacity(e,r,t,i){r.layerDefinition={drawingInfo:{transparency:100-100*e}}}set orderBy(e){this._setAndNotifyLayer("orderBy",e)}writeParent(e,r){this.parent&&this.parent!==this.layer?r.parentLayerId=b(this.parent.id):r.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{capabilities:e,fieldsIndex:r,layer:t,url:i}=this,{spatialReference:o}=t,s="gdbVersion"in t?t.gdbVersion:void 0,a=has("featurelayer-pbf")&&e?.query.supportsFormatPBF;return new x({fieldsIndex:r,gdbVersion:s,pbfSupported:a,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:o,url:i})}set renderer(e){if(_(e,this.fieldsIndex),e)for(const r of e.symbols)if(z(r)){n.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new U({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return g(i.ofType(H),e)}writeSublayers(e,r,t){this.sublayers?.length&&(r[t]=this.sublayers.map((e=>e.id)).toArray().reverse())}readTitle(e,r){return r.layerDefinition?.name??r.name}readTypeIdField(e,r){let t=(r=r.layerDefinition||r).typeIdField;if(t&&r.fields){t=t.toLowerCase();const e=r.fields.find((e=>e.name.toLowerCase()===t));e&&(t=e.name)}return t}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,r=this.source;if(!e)return null;if(this._lastParsedUrl=e,"map-layer"===r?.type)return`${e.path}/${r.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${y(t)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,r,t,i){r[t]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=j(this),r=new H;return j(r).store=e.clone(ie),this.commitProperty("url"),r._lastParsedUrl=this._lastParsedUrl,r}createPopupTemplate(e){return G(this,e)}createQuery(){return new K({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await import("../FeatureLayer.js")).default,{layer:r,url:t}=this;let i;if(t&&this.originIdOf("url")>w.SERVICE)i=new e({url:t});else{if(!r?.parsedUrl)throw new o("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const t=r.parsedUrl;i=new e({url:t.path}),t&&this.source&&("map-layer"===this.source.type?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return null!=r?.refreshInterval&&(i.refreshInterval=r.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=a(this.floorInfo)),this.originIdOf("labelingInfo")>w.SERVICE&&(i.labelingInfo=a(this.labelingInfo)),this.originIdOf("labelsVisible")>w.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>w.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>w.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>w.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>w.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>w.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>w.DEFAULTS&&(i.popupTemplate=a(this.popupTemplate)),this.originIdOf("renderer")>w.SERVICE&&(i.renderer=a(this.renderer)),"data-layer"===this.source?.type&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>w.DEFAULTS&&(i.title=this.title),"map-image"===r?.type&&r.originIdOf("customParameters")>w.DEFAULTS&&(i.customParameters=r.customParameters),"tile"===r?.type&&r.originIdOf("customParameters")>w.DEFAULTS&&(i.customParameters=r.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return E(this.types,this.typeIdField,e)}getFieldDomain(e,r){const t=r?.feature,i=this.getFeatureType(t);if(i){const r=i.domains&&i.domains[e];if(r&&"inherited"!==r.type)return r}return this._getLayerDomain(e)}async queryAttachments(e,r){await this.load(),e=$.from(e);const t=this.capabilities;if(!t?.data?.supportsAttachment)throw new o("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:a,num:l,size:n,start:p,where:u}=e;if(!t?.operations?.supportsQueryAttachments){if(i?.length>0||a?.length>0||n?.length>0||l||p||u)throw new o("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e)}if(!(s?.length||a?.length||u))throw new o("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatureCount(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryFeatureCount:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryFeatureCount:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryFeatures(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(e,{...r,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(t?.features)for(const i of t.features)i.sourceLayer=this;return t}async queryObjectIds(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryObjectIds:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryObjectIds:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryRelatedFeatures(e,r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryRelatedFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryRelatedFeatures:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryRelatedFeaturesCount(e,r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryRelatedFeaturesCount:not-supported","this layer doesn't support queries.");if(!this.capabilities.queryRelated.supportsCount)throw new o("queryRelatedFeaturesCount:not-supported","this layer doesn't support query related counts.");if(!this.url)throw new o("queryRelatedFeaturesCount:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...r,query:{...this.layer?.customParameters,token:t}})}toExportImageJSON(e){const r={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},t=u(e,this.definitionExpression);null!=t&&(r.definitionExpression=t);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce(((e,r)=>(e[r]=this.originIdOf(r),e)),{}),o=Object.keys(i).some((e=>i[e]>w.SERVICE));if(o){const e=r.drawingInfo={};if(i.renderer>w.SERVICE&&(e.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>w.SERVICE&&(e.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>w.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some((e=>!e.labelPlacement))&&n.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let r=this.labelingInfo;null!=this.geometryType&&(r=R(this.labelingInfo,D.toJSON(this.geometryType))),e.showLabels=!0,e.labelingInfo=r.filter((e=>e.labelPlacement)).map((e=>e.toJSON({origin:"service",layer:this.layer})))}else e.showLabels=!1;i.opacity>w.SERVICE&&(e.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(e.renderer)}return(this.layer?.capabilities?.exportMap?.supportsSublayerOrderBy??!1)&&this.originIdOf("orderBy")>w.SERVICE&&(r.orderBy=this.orderBy?.map((e=>e.toJSON()))??null),r}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,(e=>{e.color||"esriSMSX"!==e.style&&"esriSMSCross"!==e.style||(e.outline?.color?e.color=e.outline.color:e.color=[0,0,0,0])}))}_forEachSimpleMarkerSymbols(e,r){if(e){const t=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const e of t)W(e.symbol)&&r(e.symbol);"symbol"in e&&W(e.symbol)&&r(e.symbol),"defaultSymbol"in e&&W(e.defaultSymbol)&&r(e.defaultSymbol)}}_setAndNotifyLayer(e,r){const t=this.layer,i=this._get(e);let o,s;switch(e){case"definitionExpression":case"floorInfo":o="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":o="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":o="supportsDynamicLayers",s="supportsModification";break;case"orderBy":o="supportsSublayerOrderBy",s="supportsModification"}const a=j(this).getDefaultOrigin();if("service"!==a){if(o&&!1===this.layer?.capabilities?.exportMap?.[o])return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${o}'`);if(s&&!1===this.capabilities?.exportMap[s])return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${s}'`)}"source"!==e||"not-loaded"===this.loadStatus?(this._set(e,r),"service"!==a&&i!==r&&t&&t.emit&&t.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,r){r&&(r.forEach((e=>{e.parent=null,e.layer=null})),this.removeAllHandles()),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null})),e.on("before-changes",(e=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??1)||(n.getLogger(this).error(new o("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),e.preventDefault())}))]))}_logLockedError(e,r){const{layer:t,declaredClass:i}=this;n.getLogger(i).error(new o("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${t?.id}'`,{reason:r,sublayer:this,layer:t}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}};oe.test={isMapImageLayerOverridePolicy:e=>e===ee||e===Z||e===X,isTileImageLayerOverridePolicy:e=>e===Y},e([d({readOnly:!0})],oe.prototype,"capabilities",void 0),e([f("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],oe.prototype,"readCapabilities",null),e([d()],oe.prototype,"defaultPopupTemplate",null),e([d({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:X}}})],oe.prototype,"definitionExpression",null),e([d({readOnly:!0})],oe.prototype,"effectiveScaleRange",null),e([f("service","maxScaleRange",["minScale","maxScale"])],oe.prototype,"readMaxScaleRange",null),e([d({type:[q],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],oe.prototype,"fields",void 0),e([d({readOnly:!0})],oe.prototype,"fieldsIndex",null),e([d({type:C,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:X},origins:{"web-scene":{read:!1,write:!1}}}})],oe.prototype,"floorInfo",null),e([d({type:L,json:{read:{source:"layerDefinition.extent"}}})],oe.prototype,"fullExtent",void 0),e([d({type:D.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:D.read}}}}})],oe.prototype,"geometryType",void 0),e([d({type:String})],oe.prototype,"globalIdField",void 0),e([f("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],oe.prototype,"readGlobalIdFieldFromService",null),e([d({type:S,json:{write:{ignoreOrigin:!0}}})],oe.prototype,"id",null),e([d({readOnly:!0})],oe.prototype,"isTable",void 0),e([f("service","isTable",["type"])],oe.prototype,"readIsTable",null),e([d({value:null,type:[A],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:ee}}})],oe.prototype,"labelingInfo",null),e([m("labelingInfo")],oe.prototype,"writeLabelingInfo",null),e([d({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:Z}}})],oe.prototype,"labelsVisible",null),e([d({value:null})],oe.prototype,"layer",null),e([d({type:String,json:{write:{overridePolicy:Y}}})],oe.prototype,"layerItemId",void 0),e([d({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:re}}})],oe.prototype,"legendEnabled",void 0),e([d({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],oe.prototype,"listMode",null),e([d({type:Number,value:0,json:{write:{overridePolicy:Z}}})],oe.prototype,"minScale",null),e([f("minScale",["minScale","layerDefinition.minScale"])],oe.prototype,"readMinScale",null),e([d({type:Number,value:0,json:{write:{overridePolicy:Z}}})],oe.prototype,"maxScale",null),e([f("maxScale",["maxScale","layerDefinition.maxScale"])],oe.prototype,"readMaxScale",null),e([d()],oe.prototype,"objectIdField",void 0),e([f("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],oe.prototype,"readObjectIdFieldFromService",null),e([d({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:Z}}})],oe.prototype,"opacity",null),e([f("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],oe.prototype,"readOpacity",null),e([m("opacity")],oe.prototype,"writeOpacity",null),e([d({value:null,type:[M],json:{name:"layerDefinition.orderBy",read:{reader:O}}})],oe.prototype,"orderBy",null),e([d({json:{type:S,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:Z}}})],oe.prototype,"parent",void 0),e([m("parent")],oe.prototype,"writeParent",null),e([d({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,r)=>!r.disablePopup},write:{target:"disablePopup",overridePolicy:re,writer(e,r,t){r[t]=!e}}}})],oe.prototype,"popupEnabled",void 0),e([d({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:re}}})],oe.prototype,"popupTemplate",void 0),e([d({readOnly:!0})],oe.prototype,"queryTask",null),e([d({type:[V],readOnly:!0,json:{origins:{service:{read:{source:"layerDefinition.relationships"}}}}})],oe.prototype,"relationships",void 0),e([d({types:B,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:ee},origins:{"web-scene":{types:Q,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:ee}}}}})],oe.prototype,"renderer",null),e([d({types:{key:"type",base:null,typeMap:{"data-layer":k,"map-layer":U}},cast(e){if(e){if("mapLayerId"in e)return I(U,e);if("dataSource"in e)return I(k,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:Z}}})],oe.prototype,"source",null),e([d()],oe.prototype,"sourceJSON",void 0),e([d({type:F,json:{origins:{service:{read:{source:"layerDefinition.extent.spatialReference"}}}}})],oe.prototype,"spatialReference",void 0),e([d({value:null,json:{type:[S],write:{target:"subLayerIds",allowNull:!0,overridePolicy:Z}}})],oe.prototype,"sublayers",null),e([c("sublayers")],oe.prototype,"castSublayers",null),e([m("sublayers")],oe.prototype,"writeSublayers",null),e([d({type:String,json:{name:"name",write:{overridePolicy:re}}})],oe.prototype,"title",void 0),e([f("service","title",["name","layerDefinition.name"])],oe.prototype,"readTitle",null),e([d({type:String})],oe.prototype,"typeIdField",void 0),e([d({json:{read:!1},readOnly:!0,value:"sublayer"})],oe.prototype,"type",void 0),e([f("typeIdField",["layerDefinition.typeIdField"])],oe.prototype,"readTypeIdField",null),e([d({type:[P],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],oe.prototype,"types",void 0),e([d({type:String,json:{name:"layerUrl",write:{overridePolicy:Y}}})],oe.prototype,"url",null),e([d({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:Z}}})],oe.prototype,"visible",null),e([m("visible")],oe.prototype,"writeVisible",null),oe=H=e([h("esri.layers.support.Sublayer")],oe);const se=oe;export{se as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import t from"../../request.js";import i from"../../core/Collection.js";import o from"../../core/Error.js";import has from"../../core/has.js";import s from"../../core/Identifiable.js";import{clone as a}from"../../core/lang.js";import l from"../../core/Loadable.js";import n from"../../core/Logger.js";import{MultiOriginJSONMixin as p}from"../../core/MultiOriginJSONSupport.js";import{sqlAnd as u}from"../../core/sql.js";import{objectToQuery as y}from"../../core/urlUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import{cast as c}from"../../core/accessorSupport/decorators/cast.js";import{reader as f}from"../../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../../core/accessorSupport/decorators/writer.js";import{ensureInteger as b,ensureType as g,Integer as S,ensureClass as I}from"../../core/accessorSupport/ensureType.js";import{OriginId as w,nameToId as v}from"../../core/accessorSupport/PropertyOrigin.js";import{getProperties as j}from"../../core/accessorSupport/utils.js";import F from"../../geometry/Extent.js";import L from"../../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as O}from"../../geometry/support/typeUtils.js";import D from"../graphics/sources/support/QueryTask.js";import{readOrderByInfos as x}from"../mixins/OrderedLayer.js";import{getFeatureType as E}from"./featureLayerUtils.js";import P from"./FeatureType.js";import q from"./Field.js";import T from"./FieldsIndex.js";import{fixRendererFields as _}from"./fieldUtils.js";import A from"./LabelClass.js";import{validateLabelingInfo as R}from"./labelingInfo.js";import C from"./LayerFloorInfo.js";import M from"./OrderByInfo.js";import V from"./Relationship.js";import{getFeatureLayerCapabilities as N}from"./serviceCapabilitiesUtils.js";import{DataLayerSource as k}from"./source/DataLayerSource.js";import{MapLayerSource as B}from"./source/MapLayerSource.js";import{rendererTypes as U,webSceneRendererTypes as Q}from"../../renderers/support/typeUtils.js";import{parseUrl as J}from"../../rest/utils.js";import $ from"../../rest/support/AttachmentQuery.js";import K from"../../rest/support/Query.js";import{createPopupTemplate as G}from"../../support/popupUtils.js";import{isSymbol3D as z}from"../../symbols/support/typeUtils.js";var H;function W(e){return"esriSMS"===e?.type}function X(e,r,t){const i=this.originIdOf(r)>=v(t.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!t&&("map-image"===t.layer?.type&&(t.writeSublayerStructure||i))}}function Y(e,r,t){return{enabled:!!t&&("tile"===t.layer?.type&&(t.origin&&this.originIdOf(r)>=v(t.origin)||this._isOverridden(r)))}}function Z(e,r,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function ee(e,r,t){return{ignoreOrigin:!0,enabled:!!t?.writeSublayerStructure&&this.originIdOf(r)>w.SERVICE}}function re(e,r,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(r)>=v(t.origin))}}let te=0;const ie=new Set(["layer","parent","loaded","loadStatus","loadError","loadWarnings"]);let oe=H=class extends(p(s.IdentifiableMixin(l))){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:r,url:i}=this;if(!r&&!i)throw new o("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const s=r?await r.fetchSublayerInfo(this,e):(await t(i,{responseType:"json",query:{f:"json"},...e})).data;s&&(this.sourceJSON=s,this.read({layerDefinition:s},{origin:"service",layer:r,url:J(i)}))})()),this}readCapabilities(e,r){r=r.layerDefinition||r;const{attachment:t,operations:{supportsQuery:i,supportsQueryAttachments:o},query:{supportsFormatPBF:s,supportsOrderBy:a,supportsPagination:l},data:{supportsAttachment:n},queryRelated:p}=N(r,this.url);return{attachment:{supportsOrderByFields:t?.supportsOrderByFields??!1,supportsResize:t?.supportsResize??!1},exportMap:{supportsModification:!!r.canModifyLayer},operations:{supportsQuery:i,supportsQueryAttachments:o},data:{supportsAttachment:n},query:{supportsFormatPBF:s,supportsOrderBy:a,supportsPagination:l},queryRelated:p}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:r}=this;return{minScale:e,maxScale:r}}readMaxScaleRange(e,r){return{minScale:(r=r.layerDefinition||r).minScale??0,maxScale:r.maxScale??0}}get fieldsIndex(){return new T(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,r){if((r=r.layerDefinition||r).globalIdField)return r.globalIdField;if(r.fields)for(const t of r.fields)if("esriFieldTypeGlobalID"===t.type)return t.name}get id(){const e=this._get("id");return e??te++}set id(e){this._get("id")!==e&&(!1!==this.layer?.capabilities?.exportMap?.supportsDynamicLayers?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}readIsTable(e,r){return"Table"===r.type}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,r,t,i){e&&e.length&&(r.layerDefinition={drawingInfo:{labelingInfo:e.map((e=>e.write({},i)))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers?.forEach((r=>r.layer=e))}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,r){return r.minScale||r.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,r){return r.maxScale||r.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,r){if((r=r.layerDefinition||r).objectIdField)return r.objectIdField;const t=r.fields?.find((e=>"esriFieldTypeOID"===e.type));return t?.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,r){const{layerDefinition:t}=r;return 1-.01*(t?.transparency??t?.drawingInfo?.transparency??0)}writeOpacity(e,r,t,i){r.layerDefinition={drawingInfo:{transparency:100-100*e}}}set orderBy(e){this._setAndNotifyLayer("orderBy",e)}writeParent(e,r){this.parent&&this.parent!==this.layer?r.parentLayerId=b(this.parent.id):r.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{capabilities:e,fieldsIndex:r,layer:t,url:i}=this,{spatialReference:o}=t,s="gdbVersion"in t?t.gdbVersion:void 0,a=has("featurelayer-pbf")&&e?.query.supportsFormatPBF;return new D({fieldsIndex:r,gdbVersion:s,pbfSupported:a,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:o,url:i})}set renderer(e){if(_(e,this.fieldsIndex),e)for(const r of e.symbols)if(z(r)){n.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new B({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return g(i.ofType(H),e)}writeSublayers(e,r,t){this.sublayers?.length&&(r[t]=this.sublayers.map((e=>e.id)).toArray().reverse())}readTitle(e,r){return r.layerDefinition?.name??r.name}readTypeIdField(e,r){let t=(r=r.layerDefinition||r).typeIdField;if(t&&r.fields){t=t.toLowerCase();const e=r.fields.find((e=>e.name.toLowerCase()===t));e&&(t=e.name)}return t}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,r=this.source;if(!e)return null;if(this._lastParsedUrl=e,"map-layer"===r?.type)return`${e.path}/${r.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${y(t)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,r,t,i){r[t]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=j(this),r=new H;return j(r).store=e.clone(ie),this.commitProperty("url"),r._lastParsedUrl=this._lastParsedUrl,r}createPopupTemplate(e){return G(this,e)}createQuery(){return new K({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await import("../FeatureLayer.js")).default,{layer:r,url:t}=this;let i;if(t&&this.originIdOf("url")>w.SERVICE)i=new e({url:t});else{if(!r?.parsedUrl)throw new o("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const t=r.parsedUrl;i=new e({url:t.path}),t&&this.source&&("map-layer"===this.source.type?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return null!=r?.refreshInterval&&(i.refreshInterval=r.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=a(this.floorInfo)),this.originIdOf("labelingInfo")>w.SERVICE&&(i.labelingInfo=a(this.labelingInfo)),this.originIdOf("labelsVisible")>w.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>w.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>w.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>w.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>w.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>w.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>w.DEFAULTS&&(i.popupTemplate=a(this.popupTemplate)),this.originIdOf("renderer")>w.SERVICE&&(i.renderer=a(this.renderer)),"data-layer"===this.source?.type&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>w.DEFAULTS&&(i.title=this.title),"map-image"===r?.type&&r.originIdOf("customParameters")>w.DEFAULTS&&(i.customParameters=r.customParameters),"tile"===r?.type&&r.originIdOf("customParameters")>w.DEFAULTS&&(i.customParameters=r.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return E(this.types,this.typeIdField,e)}getFieldDomain(e,r){const t=r?.feature,i=this.getFeatureType(t);if(i){const r=i.domains&&i.domains[e];if(r&&"inherited"!==r.type)return r}return this._getLayerDomain(e)}async queryAttachments(e,r){await this.load(),e=$.from(e);const t=this.capabilities;if(!t?.data?.supportsAttachment)throw new o("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:a,num:l,size:n,start:p,where:u}=e;if(!t?.operations?.supportsQueryAttachments){if(i?.length>0||a?.length>0||n?.length>0||l||p||u)throw new o("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e)}if(!(s?.length||a?.length||u))throw new o("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return!t?.attachment?.supportsOrderByFields&&e.orderByFields?.length&&((e=e.clone()).orderByFields=null),this.queryTask.executeAttachmentQuery(e,r)}async queryFeatureCount(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryFeatureCount:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryFeatureCount:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryFeatures(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(e,{...r,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(t?.features)for(const i of t.features)i.sourceLayer=this;return t}async queryObjectIds(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryObjectIds:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryObjectIds:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryRelatedFeatures(e,r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryRelatedFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryRelatedFeatures:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryRelatedFeaturesCount(e,r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryRelatedFeaturesCount:not-supported","this layer doesn't support queries.");if(!this.capabilities.queryRelated.supportsCount)throw new o("queryRelatedFeaturesCount:not-supported","this layer doesn't support query related counts.");if(!this.url)throw new o("queryRelatedFeaturesCount:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...r,query:{...this.layer?.customParameters,token:t}})}toExportImageJSON(e){const r={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},t=u(e,this.definitionExpression);null!=t&&(r.definitionExpression=t);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce(((e,r)=>(e[r]=this.originIdOf(r),e)),{}),o=Object.keys(i).some((e=>i[e]>w.SERVICE));if(o){const e=r.drawingInfo={};if(i.renderer>w.SERVICE&&(e.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>w.SERVICE&&(e.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>w.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some((e=>!e.labelPlacement))&&n.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let r=this.labelingInfo;null!=this.geometryType&&(r=R(this.labelingInfo,O.toJSON(this.geometryType))),e.showLabels=!0,e.labelingInfo=r.filter((e=>e.labelPlacement)).map((e=>e.toJSON({origin:"service",layer:this.layer})))}else e.showLabels=!1;i.opacity>w.SERVICE&&(e.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(e.renderer)}return(this.layer?.capabilities?.exportMap?.supportsSublayerOrderBy??!1)&&this.originIdOf("orderBy")>w.SERVICE&&(r.orderBy=this.orderBy?.map((e=>e.toJSON()))??null),r}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,(e=>{e.color||"esriSMSX"!==e.style&&"esriSMSCross"!==e.style||(e.outline?.color?e.color=e.outline.color:e.color=[0,0,0,0])}))}_forEachSimpleMarkerSymbols(e,r){if(e){const t=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const e of t)W(e.symbol)&&r(e.symbol);"symbol"in e&&W(e.symbol)&&r(e.symbol),"defaultSymbol"in e&&W(e.defaultSymbol)&&r(e.defaultSymbol)}}_setAndNotifyLayer(e,r){const t=this.layer,i=this._get(e);let o,s;switch(e){case"definitionExpression":case"floorInfo":o="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":o="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":o="supportsDynamicLayers",s="supportsModification";break;case"orderBy":o="supportsSublayerOrderBy",s="supportsModification"}const a=j(this).getDefaultOrigin();if("service"!==a){if(o&&!1===this.layer?.capabilities?.exportMap?.[o])return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${o}'`);if(s&&!1===this.capabilities?.exportMap[s])return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${s}'`)}"source"!==e||"not-loaded"===this.loadStatus?(this._set(e,r),"service"!==a&&i!==r&&t&&t.emit&&t.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,r){r&&(r.forEach((e=>{e.parent=null,e.layer=null})),this.removeAllHandles()),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null})),e.on("before-changes",(e=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??1)||(n.getLogger(this).error(new o("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),e.preventDefault())}))]))}_logLockedError(e,r){const{layer:t,declaredClass:i}=this;n.getLogger(i).error(new o("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${t?.id}'`,{reason:r,sublayer:this,layer:t}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}};oe.test={isMapImageLayerOverridePolicy:e=>e===ee||e===Z||e===X,isTileImageLayerOverridePolicy:e=>e===Y},e([d({readOnly:!0})],oe.prototype,"capabilities",void 0),e([f("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],oe.prototype,"readCapabilities",null),e([d()],oe.prototype,"defaultPopupTemplate",null),e([d({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:X}}})],oe.prototype,"definitionExpression",null),e([d({readOnly:!0})],oe.prototype,"effectiveScaleRange",null),e([f("service","maxScaleRange",["minScale","maxScale"])],oe.prototype,"readMaxScaleRange",null),e([d({type:[q],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],oe.prototype,"fields",void 0),e([d({readOnly:!0})],oe.prototype,"fieldsIndex",null),e([d({type:C,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:X},origins:{"web-scene":{read:!1,write:!1}}}})],oe.prototype,"floorInfo",null),e([d({type:F,json:{read:{source:"layerDefinition.extent"}}})],oe.prototype,"fullExtent",void 0),e([d({type:O.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:O.read}}}}})],oe.prototype,"geometryType",void 0),e([d({type:String})],oe.prototype,"globalIdField",void 0),e([f("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],oe.prototype,"readGlobalIdFieldFromService",null),e([d({type:S,json:{write:{ignoreOrigin:!0}}})],oe.prototype,"id",null),e([d({readOnly:!0})],oe.prototype,"isTable",void 0),e([f("service","isTable",["type"])],oe.prototype,"readIsTable",null),e([d({value:null,type:[A],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:ee}}})],oe.prototype,"labelingInfo",null),e([m("labelingInfo")],oe.prototype,"writeLabelingInfo",null),e([d({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:Z}}})],oe.prototype,"labelsVisible",null),e([d({value:null})],oe.prototype,"layer",null),e([d({type:String,json:{write:{overridePolicy:Y}}})],oe.prototype,"layerItemId",void 0),e([d({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:re}}})],oe.prototype,"legendEnabled",void 0),e([d({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],oe.prototype,"listMode",null),e([d({type:Number,value:0,json:{write:{overridePolicy:Z}}})],oe.prototype,"minScale",null),e([f("minScale",["minScale","layerDefinition.minScale"])],oe.prototype,"readMinScale",null),e([d({type:Number,value:0,json:{write:{overridePolicy:Z}}})],oe.prototype,"maxScale",null),e([f("maxScale",["maxScale","layerDefinition.maxScale"])],oe.prototype,"readMaxScale",null),e([d()],oe.prototype,"objectIdField",void 0),e([f("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],oe.prototype,"readObjectIdFieldFromService",null),e([d({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:Z}}})],oe.prototype,"opacity",null),e([f("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],oe.prototype,"readOpacity",null),e([m("opacity")],oe.prototype,"writeOpacity",null),e([d({value:null,type:[M],json:{name:"layerDefinition.orderBy",read:{reader:x}}})],oe.prototype,"orderBy",null),e([d({json:{type:S,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:Z}}})],oe.prototype,"parent",void 0),e([m("parent")],oe.prototype,"writeParent",null),e([d({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,r)=>!r.disablePopup},write:{target:"disablePopup",overridePolicy:re,writer(e,r,t){r[t]=!e}}}})],oe.prototype,"popupEnabled",void 0),e([d({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:re}}})],oe.prototype,"popupTemplate",void 0),e([d({readOnly:!0})],oe.prototype,"queryTask",null),e([d({type:[V],readOnly:!0,json:{origins:{service:{read:{source:"layerDefinition.relationships"}}}}})],oe.prototype,"relationships",void 0),e([d({types:U,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:ee},origins:{"web-scene":{types:Q,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:ee}}}}})],oe.prototype,"renderer",null),e([d({types:{key:"type",base:null,typeMap:{"data-layer":k,"map-layer":B}},cast(e){if(e){if("mapLayerId"in e)return I(B,e);if("dataSource"in e)return I(k,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:Z}}})],oe.prototype,"source",null),e([d()],oe.prototype,"sourceJSON",void 0),e([d({type:L,json:{origins:{service:{read:{source:"layerDefinition.extent.spatialReference"}}}}})],oe.prototype,"spatialReference",void 0),e([d({value:null,json:{type:[S],write:{target:"subLayerIds",allowNull:!0,overridePolicy:Z}}})],oe.prototype,"sublayers",null),e([c("sublayers")],oe.prototype,"castSublayers",null),e([m("sublayers")],oe.prototype,"writeSublayers",null),e([d({type:String,json:{name:"name",write:{overridePolicy:re}}})],oe.prototype,"title",void 0),e([f("service","title",["name","layerDefinition.name"])],oe.prototype,"readTitle",null),e([d({type:String})],oe.prototype,"typeIdField",void 0),e([d({json:{read:!1},readOnly:!0,value:"sublayer"})],oe.prototype,"type",void 0),e([f("typeIdField",["layerDefinition.typeIdField"])],oe.prototype,"readTypeIdField",null),e([d({type:[P],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],oe.prototype,"types",void 0),e([d({type:String,json:{name:"layerUrl",write:{overridePolicy:Y}}})],oe.prototype,"url",null),e([d({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:Z}}})],oe.prototype,"visible",null),e([m("visible")],oe.prototype,"writeVisible",null),oe=H=e([h("esri.layers.support.Sublayer")],oe);const se=oe;export{se as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const s={supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1,supportedStatistics:void 0,supportedNormalizationTypes:void 0},t={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsCurrentUser:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsTrueCurve:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};export{t as zeroCapabilities,s as zeroQueryBins};
5
+ const s={supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1,supportedStatistics:void 0,supportedNormalizationTypes:void 0},t={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsOrderByFields:!1,supportsResize:!1},data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsCurrentUser:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsTrueCurve:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};export{t as zeroCapabilities,s as zeroQueryBins};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{id as e}from"../../kernel.js";import{resultOrAbort as t}from"../../core/asyncUtils.js";import r from"../../core/Error.js";import{JSONMap as n}from"../../core/jsonMap.js";import{parseWhereClause as o}from"../../core/sql.js";import{normalizeGlobalID as i}from"../../core/uuid.js";import{createTypeReader as s}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import{CodedValue as a}from"./CodedValue.js";import u from"./CodedValueDomain.js";import{queryAllJSON as c}from"./featureQueryAll.js";import{isStringField as l,isIntegerField as p}from"./fieldUtils.js";import{getOwningPortalUrl as d,isLayerWithFeatureCapabilities as f}from"./layerUtils.js";import y from"../../renderers/SimpleRenderer.js";import m from"../../renderers/UniqueValueRenderer.js";import h from"../../rest/support/AttachmentQuery.js";import{normalizationTypeJsonMap as w}from"../../rest/support/NormalizationBinParametersMixin.js";import b from"../../rest/support/Query.js";import g from"../../rest/support/RelationshipQuery.js";import{symbolTypesRenderer as I}from"../../symbols/support/typeUtils.js";const j=new n({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function F(e,t,n,o){const i=await Q(e);if(await x(e,t,o),!i.addAttachment)throw new r(o,"Layer source does not support addAttachment capability");return i.addAttachment(t,n)}function x(e,t,n){const{attributes:o}=t,{objectIdField:i}=e;return e.capabilities?.data?.supportsAttachment?t?o?i&&o[i]?Promise.resolve():Promise.reject(new r(n,`feature is missing the identifying attribute ${i}`)):Promise.reject(new r(n,"'attributes' are required on a feature to query attachments")):Promise.reject(new r(n,"A feature is required to add/delete/update attachments")):Promise.reject(new r(n,"this layer doesn't support attachments"))}async function P(e,t,n,o,i){const s=await Q(e);if(await x(e,t,i),!s.updateAttachment)throw new r(i,"Layer source does not support updateAttachment capability");return s.updateAttachment(t,n,o)}async function q(e,t,r){const{applyEdits:n}=await import("../graphics/editingSupport.js"),o=await e.load();let i=r;return"feature"===o.type&&o.infoFor3D&&null!=t.deleteFeatures&&null!=o.globalIdField&&(i={...i,globalIdToObjectId:await re(o,t.deleteFeatures,o.globalIdField)}),n(o,o.source,t,r)}async function S(e,t,r){const{uploadAssets:n}=await import("../graphics/editingSupport.js"),o=await e.load();return n(o,o.source,t,r)}async function v(e,t,n,o){const i=await Q(e);if(await x(e,t,o),!i.deleteAttachments)throw new r(o,"Layer source does not support deleteAttachments capability");return i.deleteAttachments(t,n)}async function A(e,t,n){const o=(await e.load({signal:t?.signal})).source;if(!o.fetchRecomputedExtents)throw new r(n,"Layer source does not support fetchUpdates capability");return o.fetchRecomputedExtents(t)}async function L(e,t,n,o){t=h.from(t),await e.load();const i=e.source,s=e.capabilities;if(!s?.data?.supportsAttachment)throw new r(o,"this layer doesn't support attachments");const{attachmentTypes:a,objectIds:u,globalIds:c,num:l,size:p,start:d,where:f}=t;if(!s?.operations?.supportsQueryAttachments){if(a?.length>0||c?.length>0||p?.length>0||l||d||f)throw new r(o,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t)}if(!(u?.length||c?.length||f))throw new r(o,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!i.queryAttachments)throw new r(o,"Layer source does not support queryAttachments capability",t);return i.queryAttachments(t)}async function O(e,t,n,o){const i=await Q(e);if(!i.queryObjectIds)throw new r(o,"Layer source does not support queryObjectIds capability");return i.queryObjectIds(b.from(t)??e.createQuery(),n)}async function E(e,t,n,o){const i=await Q(e);if(!i.queryFeatureCount)throw new r(o,"Layer source does not support queryFeatureCount capability");return i.queryFeatureCount(b.from(t)??e.createQuery(),n)}async function D(e,t,n,o){const i=await Q(e);if(!i.queryExtent)throw new r(o,"Layer source does not support queryExtent capability");return i.queryExtent(b.from(t)??e.createQuery(),n)}async function T(e,t,n,o){const i=await Q(e);if(!i.queryRelatedFeatures)throw new r(o,"Layer source does not support queryRelatedFeatures capability");return i.queryRelatedFeatures(g.from(t),n)}async function C(e,t,n,o){const i=await Q(e);if(!i.queryRelatedFeaturesCount)throw new r(o,"Layer source does not support queryRelatedFeaturesCount capability");return i.queryRelatedFeaturesCount(g.from(t),n)}async function R(e){const t=e.source;if(t?.refresh)try{const{dataChanged:r,updates:n}=await t.refresh();if(null!=n&&(e.sourceJSON={...e.sourceJSON,...n},e.read(n,{origin:"service",url:e.parsedUrl})),r)return!0}catch{}if(e.definitionExpression)try{return(await o(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function M(e){const t=new b,r=e.capabilities?.data,n=e.capabilities?.query;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,n&&(t.compactGeometryEnabled=n.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&null!=e.returnZ&&(t.returnZ=e.returnZ),r.supportsM&&null!=e.returnM&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:o,timeExtent:i}=e;return t.timeExtent=null!=o&&null!=i?i.offset(-o.value,o.unit):i||null,t.multipatchOption="multipatch"===e.geometryType?"xyFootprint":null,t}function k(e){const{globalIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeGlobalID"===n.type)return n.name}function z(e){const{objectIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeOID"===n.type)return n.name}function B(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}function N(e,t){const{subtypes:r,subtypeField:n}=e;if(!t?.attributes||!r?.length||!n)return null;const o=t.attributes[n];return null==o?null:r.find((e=>e.code===o))}function U(e,t){const{fieldsIndex:r,subtypeField:n}=e,{name:o,type:i}=r.get(t)??{};if(!o)return null;if((n&&r.get(n)?.name)===o&&e.subtypes?.length){const t=e.subtypes.map((e=>new a({code:G(e.code,i),name:e.name})));if(t?.length)return new u({codedValues:t})}return null}function V(e,t){const{fieldsIndex:r}=e,{name:n,type:o}=r.get(t)??{};if(!n)return null;if(("typeIdField"in e?r.get(e.typeIdField)?.name:null)===n&&"types"in e&&e.types?.length){const t=e.types.map((e=>new a({code:G(e.id,o),name:e.name})));return new u({codedValues:t})}return null}function G(e,t){return t?l({type:t})&&"number"==typeof e?`${e}`:p({type:t})&&"string"==typeof e?Number.parseInt(e,10):e:e}async function Q(e){return(await e.load()).source}async function $(t,r){if(!e)return;const n=e.findCredential(t);if(n)return n.userId;let o;try{const n=await d(t,r);n&&(o=await e.checkSignInStatus(`${n}/sharing`))}catch(i){}return o?o.userId:null}async function J(t,r){if(!e)return;if(e.findCredential(t))return;let n;try{const o=await d(t,r);o&&(n=await e.checkSignInStatus(`${o}/sharing`))}catch(o){}if(n)try{const n=null!=r?r.signal:null;await e.getCredential(t,{signal:n})}catch(o){}}async function Z(e,t,r){const n=e.parsedUrl?.path;n&&e.authenticationTriggerEvent===t&&await J(n,r)}async function H(e){const t=e.parsedUrl?.path;t&&W(e)&&await J(t)}function W(e){return _(e)&&("serviceDefinitionExpression"in e&&K(e.serviceDefinitionExpression)||"definitionExpression"in e&&K(e.definitionExpression))}function _(e){return!(!f(e)||!e.capabilities?.query.supportsCurrentUser)}function K(e){return!!e?.toLowerCase().includes("current_user")}function X(e){return!oe(e)&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const Y=s({types:I});function ee(e,t){if(e.defaultSymbol)return e.types?.length?new m({defaultSymbol:Y(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map((e=>({id:e.id,symbol:Y(e.symbol,e,t)})))}):new y({symbol:Y(e.defaultSymbol,e,t)})}function te(e){let t=e.sourceJSON?.cacheMaxAge;if(!t)return!1;const r=e.editingInfo?.lastEditDate?.getTime();return null==r||(t*=1e3,Date.now()-r<t)}async function re(e,r,n){if(null==r)return null;const o=[],{objectIdField:s}=e;if(r.forEach((e=>{let t=null;if("attributes"in e){const{attributes:r}=e;t={globalId:r[n],objectId:null!=r[s]&&-1!==r[s]?r[s]:null}}else t={globalId:e.globalId,objectId:null!=e.objectId&&-1!==e.objectId?e.objectId:null};null!=t.globalId&&(null!=t.objectId&&-1!==t.objectId||o.push(t.globalId))})),0===o.length)return null;const a=e.createQuery();a.where=o.map((e=>`${n}='${e}'`)).join(" OR "),a.returnGeometry=!1,a.outFields=[s,n],a.cacheHint=!1;const u=await t(c(e,a));if(!u.ok)return null;const l=new Map,p=u.value.features;for(const t of p){const e=t.attributes[n],r=t.attributes[s];null!=e&&null!=r&&-1!==r&&l.set(i(e),r)}return l}function ne(e,t,r){if(!t||!r||!e)return null;const n=r.getAttribute(t);return null==n?null:e.find((e=>{const{id:t}=e;return null!=t&&t.toString()===n.toString()}))??null}function oe(e){return e.sourceJSON?.isMultiServicesView||ie(e)}function ie(e){return!!e.sourceJSON?.capabilities?.toLowerCase().split(",").map((e=>e.trim())).includes("map")}function se(e,t,n){const o=t?.queryAttributeBins;if(!o)throw new r(n,"Layer source does not support binning");switch(e.binParameters.type){case"auto-interval":if(!o.supportsAutoInterval)throw new r(n,"Layer source does not support auto-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!ae(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new r(n,"Layer source does not support normalization binning");break;case"date":if(!o.supportsDate)throw new r(n,"Layer source does not support date binning");if(e.binParameters.snapToData&&!o.supportsSnapToData)throw new r(n,"Layer source does not support snapToData binning");if(e.binParameters.returnFullIntervalBin&&!o.supportsReturnFullIntervalBin)throw new r(n,"Layer source does not support returnFullIntervalBin binning");break;case"fixed-boundaries":if(!o.supportsFixedBoundaries)throw new r(n,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!o.supportsFixedInterval)throw new r(n,"Layer source does not support fixed-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!ae(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new r(n,"Layer source does not support normalization binning")}if(e.binParameters.stackBy&&!o.supportsStackBy)throw new r(n,"Layer source does not support stackBy binning");if(e.binParameters.splitBy&&!o.supportsSplitBy)throw new r(n,"Layer source does not support splitBy binning");if(e.binParameters.firstDayOfWeek&&!o.supportsFirstDayOfWeek)throw new r(n,"Layer source does not support firstDayOfWeek binning");const i=o?.supportedStatistics;if(e.outStatistics&&i){const t=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:o}of e.outStatistics){const e=t.get(o);if(e&&!i[e])throw new r(n,`Layer source does not support ${o} statistic type`)}}}function ae(e,t){return null!=e&&!!t?.[w.toJSON(e)]}export{F as addAttachment,q as applyEdits,H as checkServiceCurrentUserSupport,U as computeDomainFromSubtypes,V as computeDomainFromTypes,X as computeEffectiveEditingEnabled,ee as createDefaultRenderer,M as createQuery,v as deleteAttachments,J as ensureCredentialIfSignedIn,Z as ensureLayerCredential,A as fetchRecomputedExtents,j as geometryTypeKebabDict,N as getFeatureSubtype,ne as getFeatureType,re as getGlobalIdToObjectIdMap,$ as getSignedInUser,K as hasCurrentUser,R as hasDataChanged,te as isLayerCacheStale,L as queryAttachments,D as queryExtent,E as queryFeatureCount,O as queryObjectIds,T as queryRelatedFeatures,C as queryRelatedFeaturesCount,k as readGlobalIdField,z as readObjectIdField,B as readVersion,oe as supportsQueryOnly,P as updateAttachment,S as uploadAssets,se as validateBinsQuery};
5
+ import{id as e}from"../../kernel.js";import{resultOrAbort as t}from"../../core/asyncUtils.js";import r from"../../core/Error.js";import{JSONMap as n}from"../../core/jsonMap.js";import{parseWhereClause as o}from"../../core/sql.js";import{normalizeGlobalID as i}from"../../core/uuid.js";import{createTypeReader as s}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import{CodedValue as a}from"./CodedValue.js";import u from"./CodedValueDomain.js";import{queryAllJSON as l}from"./featureQueryAll.js";import{isStringField as c,isIntegerField as p}from"./fieldUtils.js";import{getOwningPortalUrl as d,isLayerWithFeatureCapabilities as f}from"./layerUtils.js";import y from"../../renderers/SimpleRenderer.js";import m from"../../renderers/UniqueValueRenderer.js";import h from"../../rest/support/AttachmentQuery.js";import{normalizationTypeJsonMap as w}from"../../rest/support/NormalizationBinParametersMixin.js";import b from"../../rest/support/Query.js";import g from"../../rest/support/RelationshipQuery.js";import{symbolTypesRenderer as I}from"../../symbols/support/typeUtils.js";const j=new n({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function F(e,t,n,o){const i=await Q(e);if(await x(e,t,o),!i.addAttachment)throw new r(o,"Layer source does not support addAttachment capability");return i.addAttachment(t,n)}function x(e,t,n){const{attributes:o}=t,{objectIdField:i}=e;return e.capabilities?.data?.supportsAttachment?t?o?i&&o[i]?Promise.resolve():Promise.reject(new r(n,`feature is missing the identifying attribute ${i}`)):Promise.reject(new r(n,"'attributes' are required on a feature to query attachments")):Promise.reject(new r(n,"A feature is required to add/delete/update attachments")):Promise.reject(new r(n,"this layer doesn't support attachments"))}async function P(e,t,n,o,i){const s=await Q(e);if(await x(e,t,i),!s.updateAttachment)throw new r(i,"Layer source does not support updateAttachment capability");return s.updateAttachment(t,n,o)}async function q(e,t,r){const{applyEdits:n}=await import("../graphics/editingSupport.js"),o=await e.load();let i=r;return"feature"===o.type&&o.infoFor3D&&null!=t.deleteFeatures&&null!=o.globalIdField&&(i={...i,globalIdToObjectId:await re(o,t.deleteFeatures,o.globalIdField)}),n(o,o.source,t,r)}async function S(e,t,r){const{uploadAssets:n}=await import("../graphics/editingSupport.js"),o=await e.load();return n(o,o.source,t,r)}async function v(e,t,n,o){const i=await Q(e);if(await x(e,t,o),!i.deleteAttachments)throw new r(o,"Layer source does not support deleteAttachments capability");return i.deleteAttachments(t,n)}async function O(e,t,n){const o=(await e.load({signal:t?.signal})).source;if(!o.fetchRecomputedExtents)throw new r(n,"Layer source does not support fetchUpdates capability");return o.fetchRecomputedExtents(t)}async function A(e,t,n,o){t=h.from(t),await e.load();const i=e.source,s=e.capabilities;if(!s?.data?.supportsAttachment)throw new r(o,"this layer doesn't support attachments");const{attachmentTypes:a,objectIds:u,globalIds:l,num:c,size:p,start:d,where:f}=t;if(!s?.operations?.supportsQueryAttachments){if(a?.length>0||l?.length>0||p?.length>0||c||d||f)throw new r(o,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t)}if(!(u?.length||l?.length||f))throw new r(o,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!i.queryAttachments)throw new r(o,"Layer source does not support queryAttachments capability",t);return!s?.attachment?.supportsOrderByFields&&t.orderByFields?.length&&((t=t.clone()).orderByFields=null),i.queryAttachments(t)}async function L(e,t,n,o){const i=await Q(e);if(!i.queryObjectIds)throw new r(o,"Layer source does not support queryObjectIds capability");return i.queryObjectIds(b.from(t)??e.createQuery(),n)}async function E(e,t,n,o){const i=await Q(e);if(!i.queryFeatureCount)throw new r(o,"Layer source does not support queryFeatureCount capability");return i.queryFeatureCount(b.from(t)??e.createQuery(),n)}async function D(e,t,n,o){const i=await Q(e);if(!i.queryExtent)throw new r(o,"Layer source does not support queryExtent capability");return i.queryExtent(b.from(t)??e.createQuery(),n)}async function T(e,t,n,o){const i=await Q(e);if(!i.queryRelatedFeatures)throw new r(o,"Layer source does not support queryRelatedFeatures capability");return i.queryRelatedFeatures(g.from(t),n)}async function C(e,t,n,o){const i=await Q(e);if(!i.queryRelatedFeaturesCount)throw new r(o,"Layer source does not support queryRelatedFeaturesCount capability");return i.queryRelatedFeaturesCount(g.from(t),n)}async function B(e){const t=e.source;if(t?.refresh)try{const{dataChanged:r,updates:n}=await t.refresh();if(null!=n&&(e.sourceJSON={...e.sourceJSON,...n},e.read(n,{origin:"service",url:e.parsedUrl})),r)return!0}catch{}if(e.definitionExpression)try{return(await o(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function R(e){const t=new b,r=e.capabilities?.data,n=e.capabilities?.query;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,n&&(t.compactGeometryEnabled=n.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&null!=e.returnZ&&(t.returnZ=e.returnZ),r.supportsM&&null!=e.returnM&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:o,timeExtent:i}=e;return t.timeExtent=null!=o&&null!=i?i.offset(-o.value,o.unit):i||null,t.multipatchOption="multipatch"===e.geometryType?"xyFootprint":null,t}function M(e){const{globalIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeGlobalID"===n.type)return n.name}function k(e){const{objectIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeOID"===n.type)return n.name}function z(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}function N(e,t){const{subtypes:r,subtypeField:n}=e;if(!t?.attributes||!r?.length||!n)return null;const o=t.attributes[n];return null==o?null:r.find((e=>e.code===o))}function U(e,t){const{fieldsIndex:r,subtypeField:n}=e,{name:o,type:i}=r.get(t)??{};if(!o)return null;if((n&&r.get(n)?.name)===o&&e.subtypes?.length){const t=e.subtypes.map((e=>new a({code:G(e.code,i),name:e.name})));if(t?.length)return new u({codedValues:t})}return null}function V(e,t){const{fieldsIndex:r}=e,{name:n,type:o}=r.get(t)??{};if(!n)return null;if(("typeIdField"in e?r.get(e.typeIdField)?.name:null)===n&&"types"in e&&e.types?.length){const t=e.types.map((e=>new a({code:G(e.id,o),name:e.name})));return new u({codedValues:t})}return null}function G(e,t){return t?c({type:t})&&"number"==typeof e?`${e}`:p({type:t})&&"string"==typeof e?Number.parseInt(e,10):e:e}async function Q(e){return(await e.load()).source}async function $(t,r){if(!e)return;const n=e.findCredential(t);if(n)return n.userId;let o;try{const n=await d(t,r);n&&(o=await e.checkSignInStatus(`${n}/sharing`))}catch(i){}return o?o.userId:null}async function J(t,r){if(!e)return;if(e.findCredential(t))return;let n;try{const o=await d(t,r);o&&(n=await e.checkSignInStatus(`${o}/sharing`))}catch(o){}if(n)try{const n=null!=r?r.signal:null;await e.getCredential(t,{signal:n})}catch(o){}}async function Z(e,t,r){const n=e.parsedUrl?.path;n&&e.authenticationTriggerEvent===t&&await J(n,r)}async function H(e){const t=e.parsedUrl?.path;t&&W(e)&&await J(t)}function W(e){return _(e)&&("serviceDefinitionExpression"in e&&K(e.serviceDefinitionExpression)||"definitionExpression"in e&&K(e.definitionExpression))}function _(e){return!(!f(e)||!e.capabilities?.query.supportsCurrentUser)}function K(e){return!!e?.toLowerCase().includes("current_user")}function X(e){return!oe(e)&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const Y=s({types:I});function ee(e,t){if(e.defaultSymbol)return e.types?.length?new m({defaultSymbol:Y(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map((e=>({id:e.id,symbol:Y(e.symbol,e,t)})))}):new y({symbol:Y(e.defaultSymbol,e,t)})}function te(e){let t=e.sourceJSON?.cacheMaxAge;if(!t)return!1;const r=e.editingInfo?.lastEditDate?.getTime();return null==r||(t*=1e3,Date.now()-r<t)}async function re(e,r,n){if(null==r)return null;const o=[],{objectIdField:s}=e;if(r.forEach((e=>{let t=null;if("attributes"in e){const{attributes:r}=e;t={globalId:r[n],objectId:null!=r[s]&&-1!==r[s]?r[s]:null}}else t={globalId:e.globalId,objectId:null!=e.objectId&&-1!==e.objectId?e.objectId:null};null!=t.globalId&&(null!=t.objectId&&-1!==t.objectId||o.push(t.globalId))})),0===o.length)return null;const a=e.createQuery();a.where=o.map((e=>`${n}='${e}'`)).join(" OR "),a.returnGeometry=!1,a.outFields=[s,n],a.cacheHint=!1;const u=await t(l(e,a));if(!u.ok)return null;const c=new Map,p=u.value.features;for(const t of p){const e=t.attributes[n],r=t.attributes[s];null!=e&&null!=r&&-1!==r&&c.set(i(e),r)}return c}function ne(e,t,r){if(!t||!r||!e)return null;const n=r.getAttribute(t);return null==n?null:e.find((e=>{const{id:t}=e;return null!=t&&t.toString()===n.toString()}))??null}function oe(e){return e.sourceJSON?.isMultiServicesView||ie(e)}function ie(e){return!!e.sourceJSON?.capabilities?.toLowerCase().split(",").map((e=>e.trim())).includes("map")}function se(e,t,n){const o=t?.queryAttributeBins;if(!o)throw new r(n,"Layer source does not support binning");switch(e.binParameters.type){case"auto-interval":if(!o.supportsAutoInterval)throw new r(n,"Layer source does not support auto-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!ae(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new r(n,"Layer source does not support normalization binning");break;case"date":if(!o.supportsDate)throw new r(n,"Layer source does not support date binning");if(e.binParameters.snapToData&&!o.supportsSnapToData)throw new r(n,"Layer source does not support snapToData binning");if(e.binParameters.returnFullIntervalBin&&!o.supportsReturnFullIntervalBin)throw new r(n,"Layer source does not support returnFullIntervalBin binning");break;case"fixed-boundaries":if(!o.supportsFixedBoundaries)throw new r(n,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!o.supportsFixedInterval)throw new r(n,"Layer source does not support fixed-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!ae(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new r(n,"Layer source does not support normalization binning")}if(e.binParameters.stackBy&&!o.supportsStackBy)throw new r(n,"Layer source does not support stackBy binning");if(e.binParameters.splitBy&&!o.supportsSplitBy)throw new r(n,"Layer source does not support splitBy binning");if(e.binParameters.firstDayOfWeek&&!o.supportsFirstDayOfWeek)throw new r(n,"Layer source does not support firstDayOfWeek binning");const i=o?.supportedStatistics;if(e.outStatistics&&i){const t=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:o}of e.outStatistics){const e=t.get(o);if(e&&!i[e])throw new r(n,`Layer source does not support ${o} statistic type`)}}}function ae(e,t){return null!=e&&!!t?.[w.toJSON(e)]}export{F as addAttachment,q as applyEdits,H as checkServiceCurrentUserSupport,U as computeDomainFromSubtypes,V as computeDomainFromTypes,X as computeEffectiveEditingEnabled,ee as createDefaultRenderer,R as createQuery,v as deleteAttachments,J as ensureCredentialIfSignedIn,Z as ensureLayerCredential,O as fetchRecomputedExtents,j as geometryTypeKebabDict,N as getFeatureSubtype,ne as getFeatureType,re as getGlobalIdToObjectIdMap,$ as getSignedInUser,K as hasCurrentUser,B as hasDataChanged,te as isLayerCacheStale,A as queryAttachments,D as queryExtent,E as queryFeatureCount,L as queryObjectIds,T as queryRelatedFeatures,C as queryRelatedFeaturesCount,M as readGlobalIdField,k as readObjectIdField,z as readVersion,oe as supportsQueryOnly,P as updateAttachment,S as uploadAssets,se as validateBinsQuery};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../geometry/Extent.js";import{isAxesOrderReversedForWkid as r}from"../../ogc/crsUtils.js";import{getCapabilities as a,describeCoverage as l}from"../../ogc/wcsUtils.js";import c from"../DimensionalDefinition.js";import d from"./BaseRaster.js";import{parse as f}from"./multipartParser.js";import{standardizeInterpolations as p,convertOleDateTimeToEpoch as u}from"./wcsCoverageParser.js";import{getFormat as h}from"../rasterFormats/RasterCodec.js";import{clip as m}from"../rasterFunctions/pixelUtils.js";const g=["nearest neighbor","bilinear","bicubic"],w=["nearest","linear","cubic"],v="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",y="response is not a supported multipart mediaType with inline tiff",x="response is base64 encoded which may impact layer display performance",I="server returns an exception",C=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let b=class extends d{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}async fetchRawTile(e,i,n,s={}){if(this.isBlockOutside(e,i,n))return null;const{nativePixelSize:o,spatialReference:r}=this.rasterInfo,a=2**e,l=o.x*a,c=o.y*a,{blockWidth:d,blockHeight:f}=this.getBlockWidthHeight(e),{origin:p}=this.rasterInfo.storageInfo.tileInfo,u=this.getTileExtent({x:l,y:c},i,n,p,r,[d,f]),h=this.rasterInfo.extent,g=u.xmax>h.xmax,w=u.ymin<h.ymin,v=g||w;let y=u,x=d,I=f;if(v&&(y=u.clone().intersection(h),null!=y&&(g&&(x=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*x),w&&(I=Math.floor((y.ymax-y.ymin)/c),y.ymin=y.ymax-c*I))),null==y||x<=1||I<=1)return null;const C=await this._getCoverage(y,x,I,a,s);if(!C)return null;const{coverageDescription:b}=this.coverageInfo,{noDataValue:$,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:j}=s;let T;if(null!=S&&null!=j&&j.length){const e=j[0].variableName;if("2.0"===b.version){const t=b.rangeType[0].find((t=>t.name===e));T=t?.nilValue}else if("1.1"===b.version){const t=b.range.find((t=>t.identifier===e));T=t?.nullValues}}const L=T??$,P=await this.decodePixelBlock(C,{width:x,height:I,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(L)?L[0]:L});if(null==P)return null;if(P&&(P.width!==x||P.height!==I))throw new t("wcsraster-fetch",`the response has unexpected dimension width: ${P.width}, height: {pixelBlock.height}`);return v?m(P,{x:0,y:0},{width:f,height:f}):P}async _open(e){const{customFetchParameters:i}=this.ioConfig,n=e?.signal,s=await a(this.url,{version:i?.version??this.version,customParameters:i,signal:n});if(this.capabilities=s,!this.version){let e=s.version.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=s.version:(e=s.supportedVersions.find((e=>"2.0.1"===e))||s.supportedVersions.find((e=>"2.0"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.1"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.0"===e.slice(0,3)))||"1.0.0",this.version=e)}const{version:o}=this;if(!C.has(o))throw new t("wcsraster-open",`unsupported WCS version ${o}`);const{gridCoverages:r}=s;if(!r.length)throw new t("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=r[0].id;const{coverageId:c}=this,d=r.find((e=>e.id===c));if(null==d)throw new t("wcsraster-open",`the coverageId ${c} does not exist in capabilities`);const f=await l(this.url,{coverageIds:[c],version:o,customParameters:i,signal:n});if(this.coverageInfo=f[0],"2.0"===o.slice(0,3)){const{coverageInfo:e}=this;e.lonLatEnvelope=d.lonLatEnvelope,e.supportedInterpolations=p(s.supportedInterpolations),this._patchDimensionValues201(c,n)}this.datasetName=this.coverageInfo.title;const{rasterInfo:u}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(u,512,512),this._set("rasterInfo",u),null==u.spatialReference)throw new t("wcsraster-open",`coverage without spatial reference is not supported: ${c}`);const{pixelType:h,bandCount:m}=await this._getPixelTypeAndBandCount(n);u.pixelType=h,1===u.bandCount&&m>1&&(u.bandCount=m),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:i}=this,n=i.rasterInfo.multidimensionalInfo?.variables,s=C.has("1.1.2")?"1.1.2":C.has("1.1.1")?"1.1.1":C.has("1.1.0")?"1.1.0":null,{customFetchParameters:o}=this.ioConfig;if(n&&s)try{const i=this.url.includes("/ImageServer/"),r=e.length>8&&e.startsWith("Coverage")&&i?e.slice(8):e,a=await l(this.url,{coverageIds:[r??e],version:s,customParameters:o,signal:t}).catch((()=>{if(r)return l(this.url,{coverageIds:[e],version:s,customParameters:o,signal:t})})),c=a?.[0].rasterInfo.multidimensionalInfo?.variables;if(c)for(const e of n){const t=c.find((({name:t})=>t===e.name));if(t?.dimensions?.length)for(let n=e.dimensions.length-1;n>=0;n--){const s=e.dimensions[n],o=t.dimensions.find((({name:e})=>e===s.name));o?o.values&&o.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[n]={...s,values:o.values}):i&&e.dimensions.splice(n,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:n,extent:s,multidimensionalInfo:r}=this.rasterInfo,a=s.center,l=new o({xmin:a.x-n.x,xmax:a.x+n.x,ymin:a.y-n.y,ymax:a.y+n.y,spatialReference:s.spatialReference});let d=[];if(null!=r){const e=r.variables[0];d=[],e.dimensions.forEach((t=>{d.push(new c({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))}))}const{coverageDescription:f}=this.coverageInfo,p={interpolation:"nearest",multidimensionalDefinition:d,signal:e},{version:u}=f,{ioConfig:h}=this,m="2.0"===u&&null==h.allowAnyMediaType||"1.1"===u&&null==h.use2GridOffsets;let g;try{g=await this._getCoverage(l,2,2,1,p,!0)}catch(y){if(!m)throw y;if("1.1"===u){if(!y.details?.isResolutionMismatch)throw y;h.use2GridOffsets=!0}}if(!g&&m&&("2.0"===u&&(h.allowAnyMediaType=!0),g=await this._getCoverage(l,2,2,1,p),g&&i.getLogger(this).warn("wcsraster:getcoverage",v)),!g)throw new t("wcsraster-open","unable to determine pixel type");const w=await this.decodePixelBlock(g,{width:2,height:2,planes:null,pixelType:null});if(null==w)throw new t("wcsraster-open","unable to determine pixel type");return{pixelType:w.pixelType,bandCount:w.getPlaneCount()??0}}async _getCoverage(e,n,s,o,r,a=!1){const{coverageDescription:l}=this.coverageInfo,{version:c}=l,d="2.0"===c?this._getCoverage201Parameters(e,n,s,o,r,l):"1.1"===c?this._getCoverage110Parameters(e,n,s,r,l):this._getCoverage100Parameters(e,n,s,r),p="2.0"===c?await this.request(this._constructWCS201Url(d),{signal:r.signal,responseType:"array-buffer"}):await this.request(this.url,{query:d,signal:r.signal,responseType:"array-buffer"});if("1.0"===c)return p.data;if("2.0"===c&&!1!==this.ioConfig.allowAnyMediaType){if("tiff"===h(p.data))return a&&(this.ioConfig.allowAnyMediaType=!0,i.getLogger(this).warn("wcsraster:getcoverage",v)),p.data}const u=f(p);if(u.isMultipart&&u.data){const e=u.data.find((e=>e.contentType?.toLowerCase().includes("image")&&null!=e.contentData));return a&&"base64"===e?.contentTransferEncoding&&i.getLogger(this).warn("wcsraster:getcoverage",x),e?.contentData}const m=new Uint8Array(p.data,0,Math.min(p.data.byteLength,2e3)),g=String.fromCharCode.apply(null,m).toLowerCase().includes("exception"),w=g&&String.fromCharCode.apply(null,m).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(g)throw new t("wcsraster:getcoverage",I,{isResolutionMismatch:w});throw new t("wcsraster:getcoverage",y)}_getInterpolationIndex(e){return e&&this.coverageInfo.supportedInterpolations?.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,i,n){const s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,o=e.spatialReference.wkid,r=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"GEOTIFF",{bandIds:a,interpolation:l}=n,c=this._getInterpolationIndex(l),d=a?a.map((e=>this.coverageInfo.bandNames[e])):null,f=g[c],{multidimensionalDefinition:p}=n;let u;if(null!=p&&null!=this.rasterInfo.multidimensionalInfo){const e=p.find((e=>"StdTime"===e.dimensionName));let t=e?.values;t&&t.length>0&&(Array.isArray(t[0])&&(t=t[0]),u=t.map((e=>$(e))).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:r,crs:`EPSG:${o}`,bbox:s,width:t,height:i,time:u,interpolation:f,band:d?.join(",")}}_getCoverage110Parameters(e,t,i,n,s){const{multidimensionalDefinition:o,bandIds:a,interpolation:l}=n,c=e.spatialReference.wkid,d=`urn:ogc:def:crs:EPSG::${c}`,f=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",p=this._getInterpolationIndex(l),u=w[p],h=null==l||0===this.coverageInfo.supportedInterpolations?.indexOf(l),m=s.domain.spatialDomain,g=m.origin.x<=m.envelope.xmin&&m.origin.y<=m.envelope.ymin,v=e.width/t,y=e.height/i*(g?1:-1),x=g?[e.xmin,e.ymin]:[e.xmin,e.ymax],I=m.useEPSGAxis&&r(c),C=I?`${x[1]},${x[0]}`:`${x[0]},${x[1]}`,b=this.ioConfig.use2GridOffsets,S=I?b?`${y},${v}`:`${y},0,0,${v}`:b?`${v},${y}`:`${v},0,0,${y}`,j=v/2,T=e.xmin+j,L=e.xmax-j,P=Math.abs(y)/2,R=e.ymin+P,_=e.ymax-P,D=I?`${R},${T},${_},${L},${d}`:`${T},${R},${L},${_},${d}`,E=s.range.find((e=>e.axis.some((e=>e.identifier.toLowerCase().includes("band")))));let A,G=E&&u&&a?h?`${E.identifier}[${E.axis[0].identifier}[${a.join(",")}]]`:`${E.identifier}:${u}[${E.axis[0].identifier}[${a.join(",")}]]`:null;if(null!=o&&o.length)for(let r=0;r<o.length;r++){let e=o[r].values;const t=o[r].dimensionName?.toLowerCase(),i=o[r].variableName?.toLowerCase(),n=s.range.find((e=>e.identifier.toLowerCase()===i));if(e.length>0)if(Array.isArray(e[0])&&(e=e[0]),"stdtime"===t)A=e.map((e=>$(e))).join(",");else if(n){const i=n.axis.find((e=>e.identifier.toLowerCase()===t));i&&(G=h?n.identifier+"["+i.identifier+"["+e.join(",")+"]]":n.identifier+":"+u+"["+i.identifier+"["+e.join(",")+"]]")}r===o.length-1&&n&&!G&&(G=h?n.identifier:n.identifier+":"+u)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:f,crs:`EPSG:${c}`,boundingbox:D,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:C,gridOffsets:S,gridBaseCRS:d,timeSequence:A,rangeSubset:G}}_getCoverage201Parameters(e,t,i,n,s,o){const{multidimensionalDefinition:r,interpolation:a}=s,l=this._getInterpolationIndex(a);let c=null;const{supportedInterpolations:d}=this.capabilities;if(d?.length)switch(l){case 0:c=d.find((e=>e.toLowerCase().includes("nearest")));break;case 1:c=d.find((e=>e.toLowerCase().includes("linear")));break;case 2:c=d.find((e=>e.toLowerCase().includes("cubic")||e.toLowerCase().includes("quadratic")))}const f=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",{bandNames:p}=this.coverageInfo,{boundedBy:u,domainSet:h,rangeType:m}=o,g=u.isEastFirst?0:1,w=1-g,{axisLabels:v}=u,y=v[g],x=v[w],I=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=I,b=[];b.push(`${y}(${e.xmin},${e.xmax})`),b.push(`${x}(${e.ymin},${e.ymax})`);const S=[];if(v.length>2)for(let _=2;_<v.length;_++){const e=h.origin[_];if(v[_].toLowerCase().includes("time")){let t=e.toString();u.uomLabels?.[_].toLowerCase().includes("ole")&&(S.push(v[_]),t=$(e,!0)),b.push(v[_]+",http://www.opengis.net("+t+")")}else b.push(v[_]+",http://www.opengis.net("+e+")")}let j=null;if(null!=r&&r.length){const e=[];m.forEach((t=>t.forEach((t=>e.push(t.name)))));const t=[];for(let i=0;i<r.length;i++){const n=v.find((e=>e===r[i].dimensionName)),s=e.find((e=>e===r[i].variableName));if(t.includes(s)||t.push(s),n){let e=r[i].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=n.toLowerCase().includes("time")?e.map((e=>$(e))).join(","):e.join(",");const i=b.findIndex((e=>0===e.indexOf(n+",http://www.opengis.net")));-1===i&&b.push(n+",http://www.opengis.net("+t+")"),-1===i||b[i].includes("("+t+")")||b.splice(i,1,n+",http://www.opengis.net("+t+")")}}}t.length&&(j=t.join(","))}else if(p?.length>=2){j=(s.bandIds?s.bandIds.map((e=>p[e])):p).join(",")}const T=b.join("&subset="),L=!o.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,P=L?null:`${y}(${t}),${x}(${i})`,R=L?1/n:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:j,interpolation:c,scaleSize:P,scaleFactor:R,subset:T,format:f,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:I,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},i=[];Object.keys(t).forEach((e=>{const n=t[e];null!=n&&("subset"===e?"string"==typeof n&&n.split("&subset=").forEach((e=>{e&&i.push(`subset=${encodeURIComponent(e)}`)})):i.push(`${e}=${encodeURIComponent(n)}`))}));return`${encodeURI(this.url)}?${i.join("&")}`}};function $(e,t=!1){return(t?new Date(u(e)):new Date(e)).toISOString()}e([n({type:String,json:{write:!0}})],b.prototype,"datasetFormat",void 0),e([n({readOnly:!0})],b.prototype,"tileType",void 0),e([n({type:String,json:{write:!0}})],b.prototype,"version",void 0),e([n({type:String,json:{write:!0}})],b.prototype,"coverageId",void 0),b=e([s("esri.layers.support.rasterDatasets.WCSRaster")],b);const S=b;export{S as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../geometry/Extent.js";import{isAxesOrderReversedForWkid as r}from"../../ogc/crsUtils.js";import{getCapabilities as a,describeCoverage as l}from"../../ogc/wcsUtils.js";import c from"../DimensionalDefinition.js";import d from"./BaseRaster.js";import{parse as f}from"./multipartParser.js";import{standardizeInterpolations as p,convertOleDateTimeToEpoch as u}from"./wcsCoverageParser.js";import{getFormat as h}from"../rasterFormats/RasterCodec.js";import{clip as m}from"../rasterFunctions/pixelUtils.js";const g=["nearest neighbor","bilinear","bicubic"],w=["nearest","linear","cubic"],v="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",y="response is not a supported multipart mediaType with inline tiff",x="response is base64 encoded which may impact layer display performance",I="server returns an exception",C=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let b=class extends d{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}async fetchRawTile(e,i,n,s={}){if(this.isBlockOutside(e,i,n))return null;const{nativePixelSize:o,spatialReference:r}=this.rasterInfo,a=2**e,l=o.x*a,c=o.y*a,{blockWidth:d,blockHeight:f}=this.getBlockWidthHeight(e),{origin:p}=this.rasterInfo.storageInfo.tileInfo,u=this.getTileExtent({x:l,y:c},i,n,p,r,[d,f]),h=this.rasterInfo.extent,g=u.xmax>h.xmax,w=u.ymin<h.ymin,v=g||w;let y=u,x=d,I=f;if(v&&(y=u.clone().intersection(h),null!=y&&(g&&(x=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*x),w&&(I=Math.floor((y.ymax-y.ymin)/c),y.ymin=y.ymax-c*I))),null==y||x<=1||I<=1)return null;const C=await this._getCoverage(y,x,I,a,s);if(!C)return null;const{coverageDescription:b}=this.coverageInfo,{noDataValue:$,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:j}=s;let T;if(null!=S&&null!=j&&j.length){const e=j[0].variableName;if("2.0"===b.version){const t=b.rangeType[0].find((t=>t.name===e));T=t?.nilValue}else if("1.1"===b.version){const t=b.range.find((t=>t.identifier===e));T=t?.nullValues}}const L=T??$,P=await this.decodePixelBlock(C,{width:x,height:I,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(L)?L[0]:L});if(null==P)return null;if(P&&(P.width!==x||P.height!==I))throw new t("wcsraster-fetch",`the response has unexpected dimension width: ${P.width}, height: {pixelBlock.height}`);return v?m(P,{x:0,y:0},{width:f,height:f}):P}async _open(e){const{customFetchParameters:i}=this.ioConfig,n=e?.signal,s=await a(this.url,{version:i?.version??this.version,customParameters:i,signal:n});if(this.capabilities=s,!this.version){let e=s.version.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=s.version:(e=s.supportedVersions.find((e=>"2.0.1"===e))||s.supportedVersions.find((e=>"2.0"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.1"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.0"===e.slice(0,3)))||"1.0.0",this.version=e)}const{version:o}=this;if(!C.has(o))throw new t("wcsraster-open",`unsupported WCS version ${o}`);const{gridCoverages:r}=s;if(!r.length)throw new t("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=r[0].id;const{coverageId:c}=this,d=r.find((e=>e.id===c));if(null==d)throw new t("wcsraster-open",`the coverageId ${c} does not exist in capabilities`);const f=await l(this.url,{coverageIds:[c],version:o,customParameters:i,signal:n});if(this.coverageInfo=f[0],"2.0"===o.slice(0,3)){const{coverageInfo:e}=this;e.lonLatEnvelope=d.lonLatEnvelope,e.supportedInterpolations=p(s.supportedInterpolations),this._patchDimensionValues201(c,n)}this.datasetName=this.coverageInfo.title;const{rasterInfo:u}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(u,512,512),this._set("rasterInfo",u),null==u.spatialReference)throw new t("wcsraster-open",`coverage without spatial reference is not supported: ${c}`);const{pixelType:h,bandCount:m}=await this._getPixelTypeAndBandCount(n);u.pixelType=h,1===u.bandCount&&m>1&&(u.bandCount=m),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:i}=this,n=i.rasterInfo.multidimensionalInfo?.variables,s=C.has("1.1.2")?"1.1.2":C.has("1.1.1")?"1.1.1":C.has("1.1.0")?"1.1.0":null,{customFetchParameters:o}=this.ioConfig;if(n&&s)try{const i=this.url.includes("/ImageServer/"),r=e.length>8&&e.startsWith("Coverage")&&i?e.slice(8):e,a=await l(this.url,{coverageIds:[r??e],version:s,customParameters:o,signal:t}).catch((()=>{if(r)return l(this.url,{coverageIds:[e],version:s,customParameters:o,signal:t})})),c=a?.[0].rasterInfo.multidimensionalInfo?.variables;if(c)for(const e of n){const t=c.find((({name:t})=>t===e.name));if(t?.dimensions?.length)for(let n=e.dimensions.length-1;n>=0;n--){const s=e.dimensions[n],o=t.dimensions.find((({name:e})=>e===s.name));o?o.values&&o.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[n]={...s,values:o.values}):i&&e.dimensions.splice(n,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:n,extent:s,multidimensionalInfo:r}=this.rasterInfo,a=s.center,l=new o({xmin:a.x-n.x,xmax:a.x+n.x,ymin:a.y-n.y,ymax:a.y+n.y,spatialReference:s.spatialReference});let d=[];if(null!=r){const e=r.variables[0];d=[],e.dimensions.forEach((t=>{d.push(new c({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))}))}const{coverageDescription:f}=this.coverageInfo,p={interpolation:"nearest",multidimensionalDefinition:d,signal:e},{version:u}=f,{ioConfig:h}=this,m="2.0"===u&&null==h.allowAnyMediaType||"1.1"===u&&null==h.use2GridOffsets;let g;try{g=await this._getCoverage(l,2,2,1,p,!0)}catch(y){if(!m)throw y;if("1.1"===u){if(!y.details?.isResolutionMismatch)throw y;h.use2GridOffsets=!0}}if(!g&&m&&("2.0"===u&&(h.allowAnyMediaType=!0),g=await this._getCoverage(l,2,2,1,p),g&&i.getLogger(this).warn("wcsraster:getcoverage",v)),!g)throw new t("wcsraster-open","unable to determine pixel type");const w=await this.decodePixelBlock(g,{width:2,height:2,planes:null,pixelType:null});if(null==w)throw new t("wcsraster-open","unable to determine pixel type");return{pixelType:w.pixelType,bandCount:w.getPlaneCount()??0}}async _getCoverage(e,n,s,o,r,a=!1){const{coverageDescription:l}=this.coverageInfo,{version:c}=l,d="2.0"===c?this._getCoverage201Parameters(e,n,s,o,r,l):"1.1"===c?this._getCoverage110Parameters(e,n,s,r,l):this._getCoverage100Parameters(e,n,s,r),p="2.0"===c?await this.request(this._constructWCS201Url(d),{signal:r.signal,responseType:"array-buffer"}):await this.request(this.url,{query:d,signal:r.signal,responseType:"array-buffer"});if("1.0"===c)return p.data;if("2.0"===c&&!1!==this.ioConfig.allowAnyMediaType){if("tiff"===h(p.data))return a&&(this.ioConfig.allowAnyMediaType=!0,i.getLogger(this).warn("wcsraster:getcoverage",v)),p.data}const u=f(p);if(u.isMultipart&&u.data){const e=u.data.find((e=>e.isValidImage));return a&&"base64"===e?.contentTransferEncoding&&i.getLogger(this).warn("wcsraster:getcoverage",x),e?.contentData}const m=new Uint8Array(p.data,0,Math.min(p.data.byteLength,2e3)),g=String.fromCharCode.apply(null,m).toLowerCase().includes("exception"),w=g&&String.fromCharCode.apply(null,m).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(g)throw new t("wcsraster:getcoverage",I,{isResolutionMismatch:w});throw new t("wcsraster:getcoverage",y)}_getInterpolationIndex(e){return e&&this.coverageInfo.supportedInterpolations?.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,i,n){const s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,o=e.spatialReference.wkid,r=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"GEOTIFF",{bandIds:a,interpolation:l}=n,c=this._getInterpolationIndex(l),d=a?a.map((e=>this.coverageInfo.bandNames[e])):null,f=g[c],{multidimensionalDefinition:p}=n;let u;if(null!=p&&null!=this.rasterInfo.multidimensionalInfo){const e=p.find((e=>"StdTime"===e.dimensionName));let t=e?.values;t&&t.length>0&&(Array.isArray(t[0])&&(t=t[0]),u=t.map((e=>$(e))).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:r,crs:`EPSG:${o}`,bbox:s,width:t,height:i,time:u,interpolation:f,band:d?.join(",")}}_getCoverage110Parameters(e,t,i,n,s){const{multidimensionalDefinition:o,bandIds:a,interpolation:l}=n,c=e.spatialReference.wkid,d=`urn:ogc:def:crs:EPSG::${c}`,f=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",p=this._getInterpolationIndex(l),u=w[p],h=null==l||0===this.coverageInfo.supportedInterpolations?.indexOf(l),m=s.domain.spatialDomain,g=m.origin.x<=m.envelope.xmin&&m.origin.y<=m.envelope.ymin,v=e.width/t,y=e.height/i*(g?1:-1),x=g?[e.xmin,e.ymin]:[e.xmin,e.ymax],I=m.useEPSGAxis&&r(c),C=I?`${x[1]},${x[0]}`:`${x[0]},${x[1]}`,b=this.ioConfig.use2GridOffsets,S=I?b?`${y},${v}`:`${y},0,0,${v}`:b?`${v},${y}`:`${v},0,0,${y}`,j=v/2,T=e.xmin+j,L=e.xmax-j,P=Math.abs(y)/2,R=e.ymin+P,_=e.ymax-P,D=I?`${R},${T},${_},${L},${d}`:`${T},${R},${L},${_},${d}`,E=s.range.find((e=>e.axis.some((e=>e.identifier.toLowerCase().includes("band")))));let A,G=E&&u&&a?h?`${E.identifier}[${E.axis[0].identifier}[${a.join(",")}]]`:`${E.identifier}:${u}[${E.axis[0].identifier}[${a.join(",")}]]`:null;if(null!=o&&o.length)for(let r=0;r<o.length;r++){let e=o[r].values;const t=o[r].dimensionName?.toLowerCase(),i=o[r].variableName?.toLowerCase(),n=s.range.find((e=>e.identifier.toLowerCase()===i));if(e.length>0)if(Array.isArray(e[0])&&(e=e[0]),"stdtime"===t)A=e.map((e=>$(e))).join(",");else if(n){const i=n.axis.find((e=>e.identifier.toLowerCase()===t));i&&(G=h?n.identifier+"["+i.identifier+"["+e.join(",")+"]]":n.identifier+":"+u+"["+i.identifier+"["+e.join(",")+"]]")}r===o.length-1&&n&&!G&&(G=h?n.identifier:n.identifier+":"+u)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:f,crs:`EPSG:${c}`,boundingbox:D,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:C,gridOffsets:S,gridBaseCRS:d,timeSequence:A,rangeSubset:G}}_getCoverage201Parameters(e,t,i,n,s,o){const{multidimensionalDefinition:r,interpolation:a}=s,l=this._getInterpolationIndex(a);let c=null;const{supportedInterpolations:d}=this.capabilities;if(d?.length)switch(l){case 0:c=d.find((e=>e.toLowerCase().includes("nearest")));break;case 1:c=d.find((e=>e.toLowerCase().includes("linear")));break;case 2:c=d.find((e=>e.toLowerCase().includes("cubic")||e.toLowerCase().includes("quadratic")))}const f=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",{bandNames:p}=this.coverageInfo,{boundedBy:u,domainSet:h,rangeType:m}=o,g=u.isEastFirst?0:1,w=1-g,{axisLabels:v}=u,y=v[g],x=v[w],I=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=I,b=[];b.push(`${y}(${e.xmin},${e.xmax})`),b.push(`${x}(${e.ymin},${e.ymax})`);const S=[];if(v.length>2)for(let _=2;_<v.length;_++){const e=h.origin[_];if(v[_].toLowerCase().includes("time")){let t=e.toString();u.uomLabels?.[_].toLowerCase().includes("ole")&&(S.push(v[_]),t=$(e,!0)),b.push(v[_]+",http://www.opengis.net("+t+")")}else b.push(v[_]+",http://www.opengis.net("+e+")")}let j=null;if(null!=r&&r.length){const e=[];m.forEach((t=>t.forEach((t=>e.push(t.name)))));const t=[];for(let i=0;i<r.length;i++){const n=v.find((e=>e===r[i].dimensionName)),s=e.find((e=>e===r[i].variableName));if(t.includes(s)||t.push(s),n){let e=r[i].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=n.toLowerCase().includes("time")?e.map((e=>$(e))).join(","):e.join(",");const i=b.findIndex((e=>0===e.indexOf(n+",http://www.opengis.net")));-1===i&&b.push(n+",http://www.opengis.net("+t+")"),-1===i||b[i].includes("("+t+")")||b.splice(i,1,n+",http://www.opengis.net("+t+")")}}}t.length&&(j=t.join(","))}else if(p?.length>=2){j=(s.bandIds?s.bandIds.map((e=>p[e])):p).join(",")}const T=b.join("&subset="),L=!o.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,P=L?null:`${y}(${t}),${x}(${i})`,R=L?1/n:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:j,interpolation:c,scaleSize:P,scaleFactor:R,subset:T,format:f,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:I,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},i=[];Object.keys(t).forEach((e=>{const n=t[e];null!=n&&("subset"===e?"string"==typeof n&&n.split("&subset=").forEach((e=>{e&&i.push(`subset=${encodeURIComponent(e)}`)})):i.push(`${e}=${encodeURIComponent(n)}`))}));return`${encodeURI(this.url)}?${i.join("&")}`}};function $(e,t=!1){return(t?new Date(u(e)):new Date(e)).toISOString()}e([n({type:String,json:{write:!0}})],b.prototype,"datasetFormat",void 0),e([n({readOnly:!0})],b.prototype,"tileType",void 0),e([n({type:String,json:{write:!0}})],b.prototype,"version",void 0),e([n({type:String,json:{write:!0}})],b.prototype,"coverageId",void 0),b=e([s("esri.layers.support.rasterDatasets.WCSRaster")],b);const S=b;export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const t=5e4;function n(t){const n=r(t);return n?{isMultipart:!0,data:n.boundary?e(t.data,n,0):null}:{isMultipart:!1,data:null}}function e(n,e,r=0){const a="--"+e.boundary,i=[];for(let t=0;t<a.length;t++)i.push(a.charCodeAt(t));const s=[],c="\n--"+e.boundary+"--";for(let t=0;t<c.length;t++)s.push(c.charCodeAt(t));const l=[10],f=[13,10],u=[],h=i.length,g=new Uint8Array(n,r),p=Math.min(t,g.length-h);let d=0,y=0;for(let t=0;t<p;t++){for(y=0;y<h&&g[t+y]===i[y];y++);y===h&&(d&&u.push(o(g.subarray(d,t),e)),t+=h-1,g[t+1]===l[0]?t+=1:g[t+1]===f[0]&&g[t+2]===f[1]&&(t+=2),d=t+1)}const b=s.length;for(let t=g.length-b-10;t<g.length-b;t++){for(y=0;y<b&&g[t+y]===s[y];y++);if(y===b){u.push(o(g.subarray(d,t),e));break}}return u}function r(t){const n=t.getHeader?.("Content-Type")?.split(";");if(!n)return null;if(!(n[0].trim()??"").startsWith("multipart/"))return null;const e={boundary:"",start:"",type:""};for(let r=1;r<n.length;r++){const t=n[r].indexOf("=");if(t>0){const o=n[r].slice(0,t).trim(),a=n[r].slice(t+1).trim();e[o]=a.startsWith('"')?a.slice(1,-1):a}}return e}function o(t,n){const e=String.fromCharCode.apply(null,t.subarray(0,Math.min(300,t.length))).split("\n"),r=Math.min(e.length,7),o={contentDisposition:"inline"};let a=0;for(let i=0;i<r;i++)if(e[i].length<4)a=a+e[i].length+1;else if("content"===e[i].slice(0,7).toLowerCase()){a=a+e[i].length+1;const t=e[i].indexOf(":");if(-1===t)continue;const n=e[i].slice(0,t).trim(),r=e[i].slice(t+1).trim();switch(n.toLowerCase()){case"content-type":o.contentType=r;break;case"content-description":o.contentDescription=r;break;case"content-transfer-encoding":o.contentTransferEncoding=r;break;case"content-id":o.contentID=r;break;case"content-disposition":o.contentDisposition=r;break;case"content-location":o.contentLocation=r}}else{if(o.contentDisposition.toLowerCase().includes("inline")&&e[i].length>=4&&o.contentType?.toLowerCase().indexOf("image")>-1){let n=!0,e=t.subarray(a,t.length);if(o.contentType.toLowerCase().indexOf("tif")>0){if("base64"===o.contentTransferEncoding){let t="";const n=e;for(let e=0;e<n.length;e+=65535){const r=n.subarray(e,e+65535>n.length-1?n.length-1:e+65535);t+=String.fromCharCode.apply(null,r)}const r=atob(t);e=new Uint8Array(r.length);for(let o=0;o<e.length;o++)e[o]=r.charCodeAt(o)}n=73===e[0]&&73===e[1]||77===e[0]&&77===e[1]}if(n){let n=e.buffer;"base64"!==o.contentTransferEncoding&&(n=new ArrayBuffer(t.length-a),e=new Uint8Array(n),e.set(t.subarray(a,t.length))),o.contentData=n}break}if((""===n.start||o.contentID===n.start)&&o.contentType){if(o.contentType.includes("text")||o.contentType.includes("xml")){o.contentData=String.fromCharCode.apply(null,t.subarray(a,t.length));break}o.contentData=t.subarray(a,t.length)}}return o}export{n as parse};
5
+ function t(t){const r=e(t);return r?{isMultipart:!0,data:r.boundary?n(t.data,r,0):null}:{isMultipart:!1,data:null}}function n(t,n,e=0){const o="--"+n.boundary,i=[];for(let r=0;r<o.length;r++)i.push(o.charCodeAt(r));const a=[],s="\n--"+n.boundary+"--";for(let r=0;r<s.length;r++)a.push(s.charCodeAt(r));const l=[10],c=[13,10],f=[],u=i.length,h=new Uint8Array(t,e),g=h.length-u;let p=0,d=0;for(let b=0;b<g;b++){for(d=0;d<u&&h[b+d]===i[d];d++);if(d!==u)continue;let t=!1;if(p){const e=r(h.subarray(p,b),n);f.push(e),t=!!e.isValidImage}if(b+=u-1,h[b+1]===l[0]?b+=1:h[b+1]===c[0]&&h[b+2]===c[1]&&(b+=2),p=b+1,t)break}const y=a.length;for(let b=h.length-y-10;b<h.length-y;b++){for(d=0;d<y&&h[b+d]===a[d];d++);if(d===y){f.push(r(h.subarray(p,b),n));break}}return f}function e(t){const n=t.getHeader?.("Content-Type")?.split(";");if(!n)return null;if(!(n[0].trim()??"").startsWith("multipart/"))return null;const e={boundary:"",start:"",type:""};for(let r=1;r<n.length;r++){const t=n[r].indexOf("=");if(t>0){const o=n[r].slice(0,t).trim(),i=n[r].slice(t+1).trim();e[o]=i.startsWith('"')?i.slice(1,-1):i}}return e}function r(t,n){const e=String.fromCharCode.apply(null,t.subarray(0,Math.min(300,t.length))).split("\n"),r=Math.min(e.length,7),o={contentDisposition:"inline"};let i=0;for(let a=0;a<r;a++)if(e[a].length<4)i=i+e[a].length+1;else if("content"===e[a].slice(0,7).toLowerCase()){i=i+e[a].length+1;const t=e[a].indexOf(":");if(-1===t)continue;const n=e[a].slice(0,t).trim(),r=e[a].slice(t+1).trim();switch(n.toLowerCase()){case"content-type":o.contentType=r;break;case"content-description":o.contentDescription=r;break;case"content-transfer-encoding":o.contentTransferEncoding=r;break;case"content-id":o.contentID=r;break;case"content-disposition":o.contentDisposition=r;break;case"content-location":o.contentLocation=r}}else{if(o.contentDisposition.toLowerCase().includes("inline")&&e[a].length>=4&&o.contentType?.toLowerCase().indexOf("image")>-1){let n=!0,e=t.subarray(i,t.length);if(o.contentType.toLowerCase().indexOf("tif")>0){if("base64"===o.contentTransferEncoding){let t="";const n=e;for(let e=0;e<n.length;e+=65535){const r=n.subarray(e,e+65535>n.length-1?n.length-1:e+65535);t+=String.fromCharCode.apply(null,r)}const r=atob(t);e=new Uint8Array(r.length);for(let o=0;o<e.length;o++)e[o]=r.charCodeAt(o)}n=73===e[0]&&73===e[1]||77===e[0]&&77===e[1]}if(n){let n=e.buffer;"base64"!==o.contentTransferEncoding&&(n=new ArrayBuffer(t.length-i),e=new Uint8Array(n),e.set(t.subarray(i,t.length))),o.contentData=n,o.isValidImage=!0}break}if((""===n.start||o.contentID===n.start)&&o.contentType){if(o.contentType.includes("text")||o.contentType.includes("xml")){o.contentData=String.fromCharCode.apply(null,t.subarray(i,t.length));break}o.contentData=t.subarray(i,t.length)}}return o}export{t as parse};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import t from"../../../geometry/Extent.js";import{getElementValue as r,getElement as o,getElements as i,getSpaceDelimitedNumericValues as n,getElementValues as a,isSameTagIgnoreNS as s,getNodeNameIgnoreNS as c}from"./xmlUtilities.js";function l(e){return e.endsWith("?")?e.slice(0,-1):e}function u(e){return e.filter((({coverageSubType:e})=>null==e||""===e||/^rectified(grid|dataset)/i.test(e)))}function p(e){const a=r(e,"Service/name"),s=o(e,"Capability"),c=o(s,"GetCapabilities/Get/OnlineResource")?.getAttribute("xlink:href")??"",p=o(s,"DescribeCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",m=o(s,"GetCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",g={getCapabilities:l(c),describeCoverage:l(p),getCoverage:l(m)},v=i(e,"CoverageOfferingBrief"),d=[];for(let o=0;o<v.length;o++){const e=v[o],a=r(e,"name"),s=i(e,"pos"),c=n(s[0]),l=n(s[1]),u=new t({xmin:c[0],ymin:c[1],xmax:l[0],ymax:l[1],spatialReference:{wkid:4326}});d.push({id:a,lonLatEnvelope:u})}return{name:a,onlineResources:g,coverages:d,gridCoverages:u(d),supportedVersions:["1.0.0"],version:"1.0.0"}}function m(e){const o={};for(let i=0;i<e.childNodes.length;i++){const a=e.childNodes[i];if(1!==a.nodeType)continue;const s=c(a).toLowerCase();switch(s){case"title":case"abstract":o[s]=r(a);break;case"identifier":o.id=r(a);break;case"wgs84boundingbox":{const e=n(a,"LowerCorner"),r=n(a,"UpperCorner");o.lonLatEnvelope=new t({xmin:e[0],ymin:e[1],xmax:r[0],ymax:r[1],spatialReference:{wkid:4326}})}break;case"coveragesummary":o.coverageSummaries=o.coverageSummaries||[],o.coverageSummaries.push(m(a))}}return o}function g(e,t){if(e.coverageSummaries)for(let r=0;r<e.coverageSummaries.length;r++)e.coverageSummaries[r].abstract=e.coverageSummaries[r].abstract||e.abstract,e.coverageSummaries[r].lonLatEnvelope=e.coverageSummaries[r].lonLatEnvelope||e.lonLatEnvelope,e.coverageSummaries[r].title=e.coverageSummaries[r].title||e.title,g(e.coverageSummaries[r],t);null!=e.id&&t.push(e)}function v(e){const t=o(e.querySelector("Operation[name=GetCapabilities]"),"Get")?.getAttribute("xlink:href")||"",r=o(e.querySelector("Operation[name=DescribeCoverage]"),"Get")?.getAttribute("xlink:href")||"",i=o(e.querySelector("Operation[name=GetCoverage]"),"Get")?.getAttribute("xlink:href")||"";return{getCapabilities:l(t),describeCoverage:l(r),getCoverage:l(i)}}function d(e){const t=r(e,"ServiceIdentification/Title"),i=a(e,"ServiceIdentification/ServiceTypeVersion"),n=v(o(e,"OperationsMetadata")),c=[],l=o(e,"Contents");for(let r=0;r<l.childNodes.length;r++){const e=l.childNodes[r];1===e.nodeType&&(s(e,"CoverageSummary")&&g(m(e),c))}const p=a(l,"SupportedFormat");return{name:t,onlineResources:n,coverages:c,gridCoverages:u(c),supportedVersions:i,supportedFormats:p,version:"1.1.0"}}function f(e){const s=o(e,"ServiceIdentification"),c=r(s,"Title"),l=a(s,"ServiceTypeVersion"),p=a(s,"Profile"),m=v(o(e,"OperationsMetadata")),g=i(e,"Contents/CoverageSummary"),d=[];for(let i=0;i<g.length;i++){const e=g[i],a=r(e,"CoverageId"),s=o(e,"WGS84BoundingBox");let c;if(s){const e=n(s,"LowerCorner"),r=n(s,"UpperCorner");c=new t({xmin:e[0],ymin:e[1],xmax:r[0],ymax:r[1],spatialReference:{wkid:4326}})}const l=r(e,"CoverageSubtype")||"RectifiedGridCoverage";d.push({id:a,lonLatEnvelope:c,coverageSubType:l})}const f=o(e,"ServiceMetadata");return{name:c,supportedVersions:l,supportedFormats:a(f,"formatSupported"),supportedInterpolations:a(f,"interpolationSupported").concat(a(f,"InterpolationSupported")),onlineResources:m,profiles:p,coverages:d,gridCoverages:u(d),version:"2.0.1"}}function S(t,r=null){let o=null;if("string"==typeof t){o=(new DOMParser).parseFromString(t,"text/xml")}else o=t;let i=o.documentElement.getAttribute("version");"1.0"===i?i="1.0.0":"1.1"===i&&(i="1.1.0");const n=i||r||"1.0.0",a=n.slice(0,3);let s;if("2.0"===a)s=f(o);else if("1.1"===a)s=d(o);else{if("1.0"!==a)throw new e("wcsraster:parsecapabilities","the capabilities version is not supported");s=p(o)}return s.version=n,s}export{S as parseCapabilities};
5
+ import e from"../../../core/Error.js";import t from"../../../geometry/Extent.js";import{getElementValue as r,getElement as o,getElements as i,getSpaceDelimitedNumericValues as n,getElementValues as a,isSameTagIgnoreNS as s,getNodeNameIgnoreNS as c}from"./xmlUtilities.js";function l(e){return e.endsWith("?")?e.slice(0,-1):e}function u(e){return e.filter((({coverageSubType:e})=>null==e||""===e||/^rectified(grid|dataset)/i.test(e)))}function p(e){const a=r(e,"Service/name"),s=o(e,"Capability"),c=o(s,"GetCapabilities/Get/OnlineResource")?.getAttribute("xlink:href")??"",p=o(s,"DescribeCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",m=o(s,"GetCoverage/Get/OnlineResource")?.getAttribute("xlink:href")??"",g={getCapabilities:l(c),describeCoverage:l(p),getCoverage:l(m)},v=i(e,"CoverageOfferingBrief"),d=[];for(let o=0;o<v.length;o++){const e=v[o],a=r(e,"name"),s=i(e,"pos"),c=n(s[0]),l=n(s[1]),u=new t({xmin:c[0],ymin:c[1],xmax:l[0],ymax:l[1],spatialReference:{wkid:4326}});d.push({id:a,lonLatEnvelope:u})}return{name:a,onlineResources:g,coverages:d,gridCoverages:u(d),supportedVersions:["1.0.0"],version:"1.0.0"}}function m(e){const o={};for(let i=0;i<e.childNodes.length;i++){const a=e.childNodes[i];if(1!==a.nodeType)continue;const s=c(a).toLowerCase();switch(s){case"title":case"abstract":o[s]=r(a);break;case"identifier":o.id=r(a);break;case"wgs84boundingbox":{const e=n(a,"LowerCorner"),r=n(a,"UpperCorner");o.lonLatEnvelope=new t({xmin:e[0],ymin:e[1],xmax:r[0],ymax:r[1],spatialReference:{wkid:4326}})}break;case"coveragesummary":o.coverageSummaries=o.coverageSummaries||[],o.coverageSummaries.push(m(a))}}return o}function g(e,t){if(e.coverageSummaries)for(let r=0;r<e.coverageSummaries.length;r++)e.coverageSummaries[r].abstract=e.coverageSummaries[r].abstract||e.abstract,e.coverageSummaries[r].lonLatEnvelope=e.coverageSummaries[r].lonLatEnvelope||e.lonLatEnvelope,e.coverageSummaries[r].title=e.coverageSummaries[r].title||e.title,g(e.coverageSummaries[r],t);null!=e.id&&t.push(e)}function v(e){const t=o(e.querySelector("Operation[name=GetCapabilities]"),"Get")?.getAttribute("xlink:href")||"",r=o(e.querySelector("Operation[name=DescribeCoverage]"),"Get")?.getAttribute("xlink:href")||"",i=o(e.querySelector("Operation[name=GetCoverage]"),"Get")?.getAttribute("xlink:href")||"";return{getCapabilities:l(t),describeCoverage:l(r),getCoverage:l(i)}}function d(e){const t=r(e,"ServiceIdentification/Title"),i=a(e,"ServiceIdentification/ServiceTypeVersion"),n=v(o(e,"OperationsMetadata")),c=[],l=o(e,"Contents");for(let r=0;r<l.childNodes.length;r++){const e=l.childNodes[r];1===e.nodeType&&(s(e,"CoverageSummary")&&g(m(e),c))}const p=a(l,"SupportedFormat");return{name:t,onlineResources:n,coverages:c,gridCoverages:u(c),supportedVersions:i,supportedFormats:p,version:"1.1.0"}}function f(e){const s=o(e,"ServiceIdentification"),c=r(s,"Title"),l=a(s,"ServiceTypeVersion"),p=a(s,"Profile"),m=v(o(e,"OperationsMetadata")),g=i(e,"Contents/CoverageSummary"),d=[];for(let i=0;i<g.length;i++){const e=g[i],a=r(e,"CoverageId"),s=o(e,"WGS84BoundingBox");let c;if(s){const e=n(s,"LowerCorner"),r=n(s,"UpperCorner");c=new t({xmin:e[0],ymin:e[1],xmax:r[0],ymax:r[1],spatialReference:{wkid:4326}})}const l=r(e,"CoverageSubtype")||"RectifiedGridCoverage";d.push({id:a,lonLatEnvelope:c,coverageSubType:l})}const f=o(e,"ServiceMetadata");return{name:c,supportedVersions:l,supportedFormats:a(f,"formatSupported"),supportedInterpolations:a(f,"interpolationSupported").concat(a(f,"InterpolationSupported")),onlineResources:m,profiles:p,coverages:d,gridCoverages:u(d),version:"2.0.1"}}function S(e){let t=null;if("string"==typeof e){t=(new DOMParser).parseFromString(e,"text/xml")}else t=e;const r=t.documentElement.getAttribute("version"),o=r?.slice(0,3);return null!=o&&o<"2.1"}function b(t,r=null){let o=null;if("string"==typeof t){o=(new DOMParser).parseFromString(t,"text/xml")}else o=t;let i=o.documentElement.getAttribute("version");"1.0"===i?i="1.0.0":"1.1"===i&&(i="1.1.0");const n=i||r||"1.0.0",a=n.slice(0,3);let s;if("2.0"===a)s=f(o);else if("1.1"===a)s=d(o);else{if("1.0"!==a)throw new e("wcsraster:parsecapabilities","the capabilities version is not supported");s=p(o)}return s.version=n,s}export{S as isSupportedVersion,b as parseCapabilities};
@@ -54,7 +54,7 @@ export const cellStatistics: __esri.rasterFunctionUtils["cellStatistics"];
54
54
  export const clip: __esri.rasterFunctionUtils["clip"];
55
55
  export const colormap: __esri.rasterFunctionUtils["colormap"];
56
56
  export const colormapToRGB: __esri.rasterFunctionUtils["colormapToRGB"];
57
- export const compositeBands: __esri.rasterFunctionUtils["compositeBands"];
57
+ export const compositeBand: __esri.rasterFunctionUtils["compositeBand"];
58
58
  export const conditional: __esri.rasterFunctionUtils["conditional"];
59
59
  export const contrastBrightness: __esri.rasterFunctionUtils["contrastBrightness"];
60
60
  export const convolution: __esri.rasterFunctionUtils["convolution"];
@@ -99,6 +99,7 @@ export const square: __esri.rasterFunctionUtils["square"];
99
99
  export const statistics: __esri.rasterFunctionUtils["statistics"];
100
100
  export const statisticsHistogram: __esri.rasterFunctionUtils["statisticsHistogram"];
101
101
  export const stretchMinMax: __esri.rasterFunctionUtils["stretchMinMax"];
102
+ export const stretchNone: __esri.rasterFunctionUtils["stretchNone"];
102
103
  export const stretchPercentClip: __esri.rasterFunctionUtils["stretchPercentClip"];
103
104
  export const stretchStandardDeviation: __esri.rasterFunctionUtils["stretchStandardDeviation"];
104
105
  export const table: __esri.rasterFunctionUtils["table"];
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- export{contrastBrightness,convolution,stretchHistogramEqualization,stretchMinMax,stretchNone,stretchPercentClip,stretchStandardDeviation}from"./rasterFunctions/creators/createAppearenceFunctions.js";export{bandArithmeticBAI,bandArithmeticCIg,bandArithmeticCIre,bandArithmeticClayMinerals,bandArithmeticCustom,bandArithmeticEVI,bandArithmeticFerrousMinerals,bandArithmeticGEMI,bandArithmeticGNDVI,bandArithmeticGVITM,bandArithmeticIronOxide,bandArithmeticMNDWI,bandArithmeticMSAVI,bandArithmeticMTVI2,bandArithmeticNBR,bandArithmeticNDBI,bandArithmeticNDMI,bandArithmeticNDSI,bandArithmeticNDVI,bandArithmeticNDVIre,bandArithmeticNDWI,bandArithmeticPVI,bandArithmeticRTVICore,bandArithmeticSAVI,bandArithmeticSR,bandArithmeticSRre,bandArithmeticSultan,bandArithmeticTSAVI,bandArithmeticVARI,bandArithmeticWNDWI}from"./rasterFunctions/creators/createBandIndexFunctions.js";export{computeChange,threshold}from"./rasterFunctions/creators/createChangeFunctions.js";export{colorspaceConversion,grayscale,spectralConversion,tasseledCap}from"./rasterFunctions/creators/createConversionFunctions.js";export{clip,colormap,colormapToRGB,compositeBands,createColorComposite,extractBand,mask,remap,statisticsHistogram,table,transposeBits}from"./rasterFunctions/creators/createDataManagementFunctions.js";export{abs,acos,acosh,asin,asinh,atan,atan2,atanh,bitwiseAnd,bitwiseLeftShift,bitwiseNot,bitwiseOr,bitwiseRightShift,bitwiseXor,booleanAnd,booleanNot,booleanOr,booleanXor,calculate,cellStatistics,conditional,cos,cosh,divide,equalTo,exp,exp10,exp2,float,greaterThan,greaterThanEqual,int,isNull,lessThan,lessThanEqual,log,log10,log2,minus,mod,negate,notEqual,plus,power,roundDown,roundUp,setNull,sin,sinh,sqrt,square,tan,tanh,times}from"./rasterFunctions/creators/createLocalFunctions.js";export{weightedOverlay,weightedSum}from"./rasterFunctions/creators/createMultiRasterAnalysisFunctions.js";export{aspect,curvature,hillshade,shadedRelief,slope}from"./rasterFunctions/creators/createSurfaceFunctions.js";export{argStatistics,statistics}from"./rasterFunctions/creators/createStatisticsFunctions.js";const t="$$";export{t as defaultRaster};
5
+ export{contrastBrightness,convolution,stretchHistogramEqualization,stretchMinMax,stretchNone,stretchPercentClip,stretchStandardDeviation}from"./rasterFunctions/creators/createAppearenceFunctions.js";export{bandArithmeticBAI,bandArithmeticCIg,bandArithmeticCIre,bandArithmeticClayMinerals,bandArithmeticCustom,bandArithmeticEVI,bandArithmeticFerrousMinerals,bandArithmeticGEMI,bandArithmeticGNDVI,bandArithmeticGVITM,bandArithmeticIronOxide,bandArithmeticMNDWI,bandArithmeticMSAVI,bandArithmeticMTVI2,bandArithmeticNBR,bandArithmeticNDBI,bandArithmeticNDMI,bandArithmeticNDSI,bandArithmeticNDVI,bandArithmeticNDVIre,bandArithmeticNDWI,bandArithmeticPVI,bandArithmeticRTVICore,bandArithmeticSAVI,bandArithmeticSR,bandArithmeticSRre,bandArithmeticSultan,bandArithmeticTSAVI,bandArithmeticVARI,bandArithmeticWNDWI}from"./rasterFunctions/creators/createBandIndexFunctions.js";export{computeChange,threshold}from"./rasterFunctions/creators/createChangeFunctions.js";export{colorspaceConversion,grayscale,spectralConversion,tasseledCap}from"./rasterFunctions/creators/createConversionFunctions.js";export{clip,colormap,colormapToRGB,compositeBand,createColorComposite,extractBand,mask,remap,statisticsHistogram,table,transposeBits}from"./rasterFunctions/creators/createDataManagementFunctions.js";export{abs,acos,acosh,asin,asinh,atan,atan2,atanh,bitwiseAnd,bitwiseLeftShift,bitwiseNot,bitwiseOr,bitwiseRightShift,bitwiseXor,booleanAnd,booleanNot,booleanOr,booleanXor,calculate,cellStatistics,conditional,cos,cosh,divide,equalTo,exp,exp10,exp2,float,greaterThan,greaterThanEqual,int,isNull,lessThan,lessThanEqual,log,log10,log2,minus,mod,negate,notEqual,plus,power,roundDown,roundUp,setNull,sin,sinh,sqrt,square,tan,tanh,times}from"./rasterFunctions/creators/createLocalFunctions.js";export{weightedOverlay,weightedSum}from"./rasterFunctions/creators/createMultiRasterAnalysisFunctions.js";export{aspect,curvature,hillshade,shadedRelief,slope}from"./rasterFunctions/creators/createSurfaceFunctions.js";export{argStatistics,statistics}from"./rasterFunctions/creators/createStatisticsFunctions.js";const t="$$";export{t as defaultRaster};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{getNamedColor as t,hex2rgba as n}from"../../../../colorUtils.js";import{colormapName as e}from"../../rasterFunctionConstants.js";import{createRasterFunction as o}from"./utils.js";import{colorRampDict as r}from"../../../../renderers/support/colorRampUtils.js";function a(t){return"colormap"in t?s(t):"colorRamp"in t?i(t):u(t)}function s(e){const r=e.colormap.map((e=>{if("value"in e){const o="string"==typeof e.color?t(e.color)??n(e.color):e.color;(e=[e.value,...o])[4]&&e[4]<=1&&(e[4]=Math.round(255*e[4]))}return e})),{raster:a,outputPixelType:s}=e;return o("Colormap",{colormap:r,raster:a},s)}function i(t){const{raster:n,colorRamp:e,outputPixelType:r}=t,a={colorRamp:"toJSON"in e?e.toJSON():e,raster:n};return o("Colormap",a,r)}function u(t){const{colorRampName:n}=t,a=Object.values(e).find((t=>t.toLowerCase()===n?.toLowerCase())),s=r.toJSON(n),{raster:i,outputPixelType:u="unknown"}=t;return o("Colormap",a?{colormapName:a,raster:i}:{colorRampName:s,raster:i},u)}function l(t){const{raster:n,outputPixelType:e="u8"}=t;return o("ColormapToRGB",{raster:n},e)}function p(t){const{raster:n,histograms:e,outputPixelType:r}=t,a=t.statistics?.map((t=>({min:t.min,max:t.max,mean:t.avg,standardDeviation:t.stddev})));return o("StatisticsHistograms",{raster:n,statistics:a,histograms:e},r)}function c(t){const{raster:n,attributeTable:e,outputPixelType:r="unknown"}=t,a="toJSON"in e?e.toJSON():e;return o("Table",{raster:n,attributeTableAsRecordSet:a},r)}function m(t){const{raster:n,outputPixelType:e="unknown"}=t,r={raster:n,missingBandAction:"fail"===t.missingBandAction?1:0};return"bandIds"in t?r.bandIds=t.bandIds:"bandNames"in t?r.bandNames=t.bandNames:"bandWavelengths"in t&&(r.bandWavelengths=t.bandWavelengths),o("ExtractBand",r,e)}function d(t){const{redBand:n,greenBand:e,blueBand:r,raster:a,outputPixelType:s}=t,i="name"===t.method?0:2;return o("CreateColorComposite",{raster:a,method:i,bandIndexesR:n,bandIndexesG:e,bandIndexesB:r},s)}function f(t){const{rasters:n,outputPixelType:e}=t;return o("CompositeBand",{rasters:n},e)}function g(t){const{allowUnmatched:n,raster:e,rangeMaps:r,outputPixelType:a}=t,s=r?.filter((({output:t})=>null!=t)),i=s?.flatMap((({range:t})=>t)),u=s?.map((({output:t})=>t)),l=r?.filter((t=>null==t.output))?.flatMap((({range:t})=>t));return o("Remap",{allowUnmatched:n,raster:e,inputRanges:i,outputValues:u,noDataRanges:l},a)}function b(t){const{inputBitPositions:n,raster:e,fillRaster:r,outputBitPositions:a,outputPixelType:s}=t,i={inputBitPositions:n,outputBitPositions:a,raster:e};return null!=r&&("number"==typeof r?(i.constantFillCheck=!0,i.constantFillValue=r):i.fillRaster=r),o("TransposeBits",i,s)}function x(t){const{raster:n,outputPixelType:e="unknown"}=t,r=t.includedRanges?.flatMap((t=>t)),a=t.noDataValues?.map((t=>t.join(" "))),s="match-all"===t.noDataInterpretation?1:0;return o("Mask",{raster:n,includedRanges:r,noDataInterpretation:s,noDataValues:a},e)}function T(t){const{geometry:n,keepOutside:e,outputPixelType:r="unknown",raster:a}=t,s="declaredClass"in n?n.toJSON():n;return o("Clip",{clippingGeometry:s,clippingType:e?2:1,raster:a},r)}export{T as clip,a as colormap,l as colormapToRGB,f as compositeBands,d as createColorComposite,m as extractBand,x as mask,g as remap,p as statisticsHistogram,c as table,b as transposeBits};
5
+ import{getNamedColor as t,hex2rgba as n}from"../../../../colorUtils.js";import{colormapName as e}from"../../rasterFunctionConstants.js";import{createRasterFunction as o}from"./utils.js";import{colorRampDict as r}from"../../../../renderers/support/colorRampUtils.js";function a(t){return"colormap"in t?s(t):"colorRamp"in t?i(t):u(t)}function s(e){const r=e.colormap.map((e=>{if("value"in e){const o="string"==typeof e.color?t(e.color)??n(e.color):e.color;(e=[e.value,...o])[4]&&e[4]<=1&&(e[4]=Math.round(255*e[4]))}return e})),{raster:a,outputPixelType:s}=e;return o("Colormap",{colormap:r,raster:a},s)}function i(t){const{raster:n,colorRamp:e,outputPixelType:r}=t,a={colorRamp:"toJSON"in e?e.toJSON():e,raster:n};return o("Colormap",a,r)}function u(t){const{colorRampName:n}=t,a=Object.values(e).find((t=>t.toLowerCase()===n?.toLowerCase())),s=r.toJSON(n),{raster:i,outputPixelType:u="unknown"}=t;return o("Colormap",a?{colormapName:a,raster:i}:{colorRampName:s,raster:i},u)}function l(t){const{raster:n,outputPixelType:e="u8"}=t;return o("ColormapToRGB",{raster:n},e)}function p(t){const{raster:n,histograms:e,outputPixelType:r}=t,a=t.statistics?.map((t=>({min:t.min,max:t.max,mean:t.avg,standardDeviation:t.stddev})));return o("StatisticsHistograms",{raster:n,statistics:a,histograms:e},r)}function c(t){const{raster:n,attributeTable:e,outputPixelType:r="unknown"}=t,a="toJSON"in e?e.toJSON():e;return o("Table",{raster:n,attributeTableAsRecordSet:a},r)}function m(t){const{raster:n,outputPixelType:e="unknown"}=t,r={raster:n,missingBandAction:"fail"===t.missingBandAction?1:0};return"bandIds"in t?r.bandIds=t.bandIds:"bandNames"in t?r.bandNames=t.bandNames:"bandWavelengths"in t&&(r.bandWavelengths=t.bandWavelengths),o("ExtractBand",r,e)}function d(t){const{redBand:n,greenBand:e,blueBand:r,raster:a,outputPixelType:s}=t,i="name"===t.method?0:2;return o("CreateColorComposite",{raster:a,method:i,bandIndexesR:n,bandIndexesG:e,bandIndexesB:r},s)}function f(t){const{rasters:n,outputPixelType:e}=t;return o("CompositeBand",{rasters:n},e)}function g(t){const{allowUnmatched:n,raster:e,rangeMaps:r,outputPixelType:a}=t,s=r?.filter((({output:t})=>null!=t)),i=s?.flatMap((({range:t})=>t)),u=s?.map((({output:t})=>t)),l=r?.filter((t=>null==t.output))?.flatMap((({range:t})=>t));return o("Remap",{allowUnmatched:n,raster:e,inputRanges:i,outputValues:u,noDataRanges:l},a)}function b(t){const{inputBitPositions:n,raster:e,fillRaster:r,outputBitPositions:a,outputPixelType:s}=t,i={inputBitPositions:n,outputBitPositions:a,raster:e};return null!=r&&("number"==typeof r?(i.constantFillCheck=!0,i.constantFillValue=r):i.fillRaster=r),o("TransposeBits",i,s)}function x(t){const{raster:n,outputPixelType:e="unknown"}=t,r=t.includedRanges?.flatMap((t=>t)),a=t.noDataValues?.map((t=>t.join(" "))),s="match-all"===t.noDataInterpretation?1:0;return o("Mask",{raster:n,includedRanges:r,noDataInterpretation:s,noDataValues:a},e)}function T(t){const{geometry:n,keepOutside:e,outputPixelType:r="unknown",raster:a}=t,s="declaredClass"in n?n.toJSON():n;return o("Clip",{clippingGeometry:s,clippingType:e?2:1,raster:a},r)}export{T as clip,a as colormap,l as colormapToRGB,f as compositeBand,d as createColorComposite,m as extractBand,x as mask,g as remap,p as statisticsHistogram,c as table,b as transposeBits};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../core/has.js";import{parse as t,isHostedAgolService as s}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as e}from"./infoFor3D.js";import{readBoolean as r,readNumber as p}from"../../rest/support/jsonUtils.js";const o={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function u(t){const s=t?.supportedSpatialAggregationStatistics?.map((t=>t.toLowerCase()));return{envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function n(t,s){const e=t?.supportedOperationsWithCacheHint?.map((t=>t.toLowerCase()));return!!e?.includes(s.toLowerCase())}function i(t){const s=t?.supportedStatisticTypes?.map((t=>t.toLowerCase()));return{count:!!s?.includes("count"),sum:!!s?.includes("sum"),min:!!s?.includes("min"),max:!!s?.includes("max"),avg:!!s?.includes("avg"),var:!!s?.includes("var"),stddev:!!s?.includes("stddev"),percentileContinuous:!!s?.includes("percentile_continuous"),percentileDiscrete:!!s?.includes("percentile_discrete"),envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function a(t){const s=t?.supportedNormalizationTypes?.map((t=>t.toLowerCase()));return{field:!!s?.includes("field"),log:!!s?.includes("log"),naturalLog:!!s?.includes("naturallog"),percentOfTotal:!!s?.includes("percentoftotal"),squareRoot:!!s?.includes("squareroot")}}function c(t,s){return{analytics:l(t),attachment:d(t),data:y(t),metadata:m(t),operations:g(t.capabilities,t,s),query:C(t,s),queryAttributeBins:S(t),queryRelated:v(t),queryTopFeatures:h(t),editing:f(t)}}function l(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryAnalytics")}}function d(t){const s=t.attachmentProperties,e={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:n(t.advancedQueryCapabilities,"queryAttachments"),supportsResize:r(t,"supportsAttachmentsResizing",!1)};return s&&Array.isArray(s)&&s.forEach((t=>{const s=o[t.name];s&&(e[s]=!!t.isEnabled)})),e}function y(t){return{isVersioned:r(t,"isDataVersioned",!1),isBranchVersioned:r(t,"isDataBranchVersioned",!1),supportsAttachment:r(t,"hasAttachments",!1),supportsM:r(t,"hasM",!1),supportsZ:r(t,"hasZ",!1)}}function m(t){return{supportsAdvancedFieldProperties:r(t,"supportsFieldDescriptionProperty",!1)}}function g(s,e,p){const o=s?s.toLowerCase().split(",").map((t=>t.trim())):[],u=p?t(p):null,n=o.includes(null!=u&&"MapServer"===u.serverType?"data":"query"),i=o.includes("editing")&&!e.datesInUnknownTimezone;let a=i&&o.includes("create"),c=i&&o.includes("delete"),l=i&&o.includes("update");const d=o.includes("changetracking"),y=e.advancedQueryCapabilities;return i&&!(a||c||l)&&(a=c=l=!0),{supportsCalculate:r(e,"supportsCalculate",!1),supportsTruncate:r(e,"supportsTruncate",!1),supportsValidateSql:r(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:c,supportsEditing:i,supportsChangeTracking:d,supportsQuery:n,supportsQueryAnalytics:r(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:r(y,"supportsQueryAttachments",!1),supportsQueryBins:r(y,"supportsQueryBins",!1),supportsQueryTopFeatures:r(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:r(e,"supportsAttachmentsResizing",!1),supportsSync:o.includes("sync"),supportsUpdate:l,supportsExceedsLimitStatistics:r(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:r(e,"supportsAsyncConvert3D",!1)}}function C(t,o){const i=t.advancedQueryCapabilities,a=t.ownershipBasedAccessControlForFeatures,c=t.archivingInfo,l=t.currentVersion,d=o?.includes("MapServer"),y=!d||l>=has("mapserver-pbf-version-support"),m=s(o),g=new Set((t.supportedQueryFormats??"").split(",").map((t=>t.toLowerCase().trim())));return{maxRecordCount:p(t,"maxRecordCount",void 0),maxRecordCountFactor:p(t,"maxRecordCountFactor",void 0),standardMaxRecordCount:p(t,"standardMaxRecordCount",void 0),supportedSpatialAggregationStatistics:u(i),supportsCacheHint:r(i,"supportsQueryWithCacheHint",!1)||n(i,"query"),supportsCentroid:r(i,"supportsReturningGeometryCentroid",!1),supportsCompactGeometry:m,supportsCurrentUser:r(i,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:r(i,"supportsDefaultSR",!1),supportsDisjointSpatialRelationship:r(i,"supportsDisjointSpatialRel",!1),supportsDistance:r(i,"supportsQueryWithDistance",!1),supportsDistinct:r(i,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:r(i,"supportsReturningQueryExtent",!1),supportsFormatPBF:y&&g.has("pbf"),supportsFullTextSearch:r(i,"supportsFullTextSearch",!1),supportsGeometryProperties:r(i,"supportsReturningGeometryProperties",!1),supportsHavingClause:r(i,"supportsHavingClause",!1),supportsHistoricMoment:r(c,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:r(i,"supportsMaxRecordCountFactor",!1),supportsOrderBy:r(i,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:r(i,"supportsPagination",!1),supportsPercentileStatistics:r(i,"supportsPercentileStatistics",!1),supportsQuantization:r(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:r(t,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:r(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:r(a,"allowOthersToQuery",!0),supportsQueryGeometry:r(t,"supportsReturningQueryGeometry",!1),supportsResultType:r(i,"supportsQueryWithResultType",!1),supportsReturnMesh:!!e(t.infoFor3D),supportsSpatialAggregationStatistics:r(i,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:r(i,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:r(t,"useStandardizedQueries",!1),supportsStatistics:r(i,"supportsStatistics",t.supportsStatistics),supportsTopFeaturesQuery:r(i,"supportsTopFeaturesQuery",!1),supportsTrueCurve:r(i,"supportsTrueCurve",!1),tileMaxRecordCount:p(t,"tileMaxRecordCount",void 0)}}function v(t){const s=t.advancedQueryCapabilities,e=r(s,"supportsAdvancedQueryRelated",!1);return{supportsPagination:r(s,"supportsQueryRelatedPagination",!1),supportsCount:e,supportsOrderBy:e,supportsCacheHint:n(s,"queryRelated")}}function h(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryTopFilter")}}function S(t){const s=t?t.queryBinsCapabilities:void 0;return{supportsDate:r(s,"supportsDateBin",!1),supportsFixedInterval:r(s,"supportsFixedIntervalBin",!1),supportsAutoInterval:r(s,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:r(s,"supportsFixedBoundariesBin",!1),supportsStackBy:r(s,"supportsStackBy",!1),supportsSplitBy:r(s,"supportsSplitBy",!1),supportsSnapToData:r(s,"supportsSnapToData",!1),supportsReturnFullIntervalBin:r(s,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:r(s,"supportsFirstDayOfWeek",!1),supportsNormalization:r(s,"supportsNormalization",!1),supportedStatistics:i(s),supportedNormalizationTypes:a(s)}}function f(t){const s=t.ownershipBasedAccessControlForFeatures,e=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:r(t,"allowGeometryUpdates",!0),supportsGlobalId:r(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:r(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:r(t,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:r(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:r(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:r(s,"allowAnonymousToDelete",!0),supportsDeleteByOthers:r(s,"allowOthersToDelete",!0),supportsUpdateByAnonymous:r(s,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:r(s,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:r(e,"supportsAsyncApplyEdits",!1),zDefault:p(t,"zDefault",void 0)}}function A(t){return{operations:{supportsAppend:r(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:r(t,"supportsExportClip",!1),supportsExportFrameset:r(t,"supportsExportFrameset",!1),supportsMensuration:r(t,"supportsMensuration",!1),supportsUpdate:r(t,"supportsUpdate",!1)}}}export{c as getFeatureLayerCapabilities,A as getVideoLayerCapabilities};
5
+ import has from"../../core/has.js";import{parse as t,isHostedAgolService as s}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as e}from"./infoFor3D.js";import{readBoolean as r,readNumber as p}from"../../rest/support/jsonUtils.js";const o={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function u(t){const s=t?.supportedSpatialAggregationStatistics?.map((t=>t.toLowerCase()));return{envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function n(t,s){const e=t?.supportedOperationsWithCacheHint?.map((t=>t.toLowerCase()));return!!e?.includes(s.toLowerCase())}function i(t){const s=t?.supportedStatisticTypes?.map((t=>t.toLowerCase()));return{count:!!s?.includes("count"),sum:!!s?.includes("sum"),min:!!s?.includes("min"),max:!!s?.includes("max"),avg:!!s?.includes("avg"),var:!!s?.includes("var"),stddev:!!s?.includes("stddev"),percentileContinuous:!!s?.includes("percentile_continuous"),percentileDiscrete:!!s?.includes("percentile_discrete"),envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function a(t){const s=t?.supportedNormalizationTypes?.map((t=>t.toLowerCase()));return{field:!!s?.includes("field"),log:!!s?.includes("log"),naturalLog:!!s?.includes("naturallog"),percentOfTotal:!!s?.includes("percentoftotal"),squareRoot:!!s?.includes("squareroot")}}function c(t,s){return{analytics:l(t),attachment:d(t),data:y(t),metadata:m(t),operations:g(t.capabilities,t,s),query:C(t,s),queryAttributeBins:S(t),queryRelated:v(t),queryTopFeatures:h(t),editing:f(t)}}function l(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryAnalytics")}}function d(t){const s=t.attachmentProperties,e={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:n(t.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:r(t.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:r(t,"supportsAttachmentsResizing",!1)};return s&&Array.isArray(s)&&s.forEach((t=>{const s=o[t.name];s&&(e[s]=!!t.isEnabled)})),e}function y(t){return{isVersioned:r(t,"isDataVersioned",!1),isBranchVersioned:r(t,"isDataBranchVersioned",!1),supportsAttachment:r(t,"hasAttachments",!1),supportsM:r(t,"hasM",!1),supportsZ:r(t,"hasZ",!1)}}function m(t){return{supportsAdvancedFieldProperties:r(t,"supportsFieldDescriptionProperty",!1)}}function g(s,e,p){const o=s?s.toLowerCase().split(",").map((t=>t.trim())):[],u=p?t(p):null,n=o.includes(null!=u&&"MapServer"===u.serverType?"data":"query"),i=o.includes("editing")&&!e.datesInUnknownTimezone;let a=i&&o.includes("create"),c=i&&o.includes("delete"),l=i&&o.includes("update");const d=o.includes("changetracking"),y=e.advancedQueryCapabilities;return i&&!(a||c||l)&&(a=c=l=!0),{supportsCalculate:r(e,"supportsCalculate",!1),supportsTruncate:r(e,"supportsTruncate",!1),supportsValidateSql:r(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:c,supportsEditing:i,supportsChangeTracking:d,supportsQuery:n,supportsQueryAnalytics:r(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:r(y,"supportsQueryAttachments",!1),supportsQueryBins:r(y,"supportsQueryBins",!1),supportsQueryTopFeatures:r(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:r(e,"supportsAttachmentsResizing",!1),supportsSync:o.includes("sync"),supportsUpdate:l,supportsExceedsLimitStatistics:r(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:r(e,"supportsAsyncConvert3D",!1)}}function C(t,o){const i=t.advancedQueryCapabilities,a=t.ownershipBasedAccessControlForFeatures,c=t.archivingInfo,l=t.currentVersion,d=o?.includes("MapServer"),y=!d||l>=has("mapserver-pbf-version-support"),m=s(o),g=new Set((t.supportedQueryFormats??"").split(",").map((t=>t.toLowerCase().trim())));return{maxRecordCount:p(t,"maxRecordCount",void 0),maxRecordCountFactor:p(t,"maxRecordCountFactor",void 0),standardMaxRecordCount:p(t,"standardMaxRecordCount",void 0),supportedSpatialAggregationStatistics:u(i),supportsCacheHint:r(i,"supportsQueryWithCacheHint",!1)||n(i,"query"),supportsCentroid:r(i,"supportsReturningGeometryCentroid",!1),supportsCompactGeometry:m,supportsCurrentUser:r(i,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:r(i,"supportsDefaultSR",!1),supportsDisjointSpatialRelationship:r(i,"supportsDisjointSpatialRel",!1),supportsDistance:r(i,"supportsQueryWithDistance",!1),supportsDistinct:r(i,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:r(i,"supportsReturningQueryExtent",!1),supportsFormatPBF:y&&g.has("pbf"),supportsFullTextSearch:r(i,"supportsFullTextSearch",!1),supportsGeometryProperties:r(i,"supportsReturningGeometryProperties",!1),supportsHavingClause:r(i,"supportsHavingClause",!1),supportsHistoricMoment:r(c,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:r(i,"supportsMaxRecordCountFactor",!1),supportsOrderBy:r(i,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:r(i,"supportsPagination",!1),supportsPercentileStatistics:r(i,"supportsPercentileStatistics",!1),supportsQuantization:r(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:r(t,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:r(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:r(a,"allowOthersToQuery",!0),supportsQueryGeometry:r(t,"supportsReturningQueryGeometry",!1),supportsResultType:r(i,"supportsQueryWithResultType",!1),supportsReturnMesh:!!e(t.infoFor3D),supportsSpatialAggregationStatistics:r(i,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:r(i,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:r(t,"useStandardizedQueries",!1),supportsStatistics:r(i,"supportsStatistics",t.supportsStatistics),supportsTopFeaturesQuery:r(i,"supportsTopFeaturesQuery",!1),supportsTrueCurve:r(i,"supportsTrueCurve",!1),tileMaxRecordCount:p(t,"tileMaxRecordCount",void 0)}}function v(t){const s=t.advancedQueryCapabilities,e=r(s,"supportsAdvancedQueryRelated",!1);return{supportsPagination:r(s,"supportsQueryRelatedPagination",!1),supportsCount:e,supportsOrderBy:e,supportsCacheHint:n(s,"queryRelated")}}function h(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryTopFilter")}}function S(t){const s=t?t.queryBinsCapabilities:void 0;return{supportsDate:r(s,"supportsDateBin",!1),supportsFixedInterval:r(s,"supportsFixedIntervalBin",!1),supportsAutoInterval:r(s,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:r(s,"supportsFixedBoundariesBin",!1),supportsStackBy:r(s,"supportsStackBy",!1),supportsSplitBy:r(s,"supportsSplitBy",!1),supportsSnapToData:r(s,"supportsSnapToData",!1),supportsReturnFullIntervalBin:r(s,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:r(s,"supportsFirstDayOfWeek",!1),supportsNormalization:r(s,"supportsNormalization",!1),supportedStatistics:i(s),supportedNormalizationTypes:a(s)}}function f(t){const s=t.ownershipBasedAccessControlForFeatures,e=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:r(t,"allowGeometryUpdates",!0),supportsGlobalId:r(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:r(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:r(t,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:r(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:r(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:r(s,"allowAnonymousToDelete",!0),supportsDeleteByOthers:r(s,"allowOthersToDelete",!0),supportsUpdateByAnonymous:r(s,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:r(s,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:r(e,"supportsAsyncApplyEdits",!1),zDefault:p(t,"zDefault",void 0)}}function A(t){return{operations:{supportsAppend:r(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:r(t,"supportsExportClip",!1),supportsExportFrameset:r(t,"supportsExportFrameset",!1),supportsMensuration:r(t,"supportsMensuration",!1),supportsUpdate:r(t,"supportsUpdate",!1)}}}export{c as getFeatureLayerCapabilities,A as getVideoLayerCapabilities};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.33.0-next.20250204",
3
+ "version": "4.33.0-next.20250206",
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": [
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@esri/arcgis-html-sanitizer": "~4.1.0",
29
- "@esri/calcite-components": "~3.0.0-next.124",
29
+ "@esri/calcite-components": "~3.0.0-next.128",
30
30
  "@vaadin/grid": "~24.6.3",
31
31
  "@zip.js/zip.js": "~2.7.57",
32
32
  "luxon": "~3.5.0",
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{addTokenParameter as t}from"../../../kernel.js";import o from"../../../request.js";import{addProxy as e}from"../../../core/urlUtils.js";import{mapParameters as n}from"../../operations/urlUtils.js";import r from"../support/AttachmentInfo.js";function s(t){const o=t.toJSON();return o.attachmentTypes&&(o.attachmentTypes=o.attachmentTypes.join(",")),o.keywords&&(o.keywords=o.keywords.join(",")),o.globalIds&&(o.globalIds=o.globalIds.join(",")),o.objectIds&&(o.objectIds=o.objectIds.join(",")),o.size&&(o.size=o.size.join(",")),o}function a(o,n){const s={};for(const a of n){const{parentObjectId:n,parentGlobalId:c,attachmentInfos:m}=a;for(const a of m){const{id:m}=a,p=e(t(`${o.path}/${n}/attachments/${m}`)),i=r.fromJSON(a);i.set({url:p,parentObjectId:n,parentGlobalId:c}),s[n]?s[n].push(i):s[n]=[i]}}return s}function c(t,e,r){let a={query:n({...t.query,f:"json",...s(e)})};return r&&(a={...r,...a,query:{...r.query,...a.query}}),o(t.path+"/queryAttachments",a).then((t=>t.data.attachmentGroups))}async function m(t,e,n){const{objectIds:r}=e,s=[];for(const a of r)s.push(o(t.path+"/"+a+"/attachments",n));return Promise.all(s).then((t=>r.map(((o,e)=>({parentObjectId:o,attachmentInfos:t[e].data.attachmentInfos})))))}export{c as executeAttachmentQuery,m as fetchAttachments,a as processAttachmentQueryResult};
5
+ import{addTokenParameter as t}from"../../../kernel.js";import o from"../../../request.js";import{addProxy as e}from"../../../core/urlUtils.js";import{mapParameters as r}from"../../operations/urlUtils.js";import n from"../support/AttachmentInfo.js";function s(t){const o=t.toJSON();return o.attachmentTypes&&(o.attachmentTypes=o.attachmentTypes.join(",")),o.keywords&&(o.keywords=o.keywords.join(",")),o.globalIds&&(o.globalIds=o.globalIds.join(",")),o.objectIds&&(o.objectIds=o.objectIds.join(",")),o.size&&(o.size=o.size.join(",")),o.orderByFields&&(o.orderByFields=o.orderByFields.join(",")),o}function a(o,r){const s={};for(const a of r){const{parentObjectId:r,parentGlobalId:c,attachmentInfos:i}=a;for(const a of i){const{id:i}=a,d=e(t(`${o.path}/${r}/attachments/${i}`)),m=n.fromJSON(a);m.set({url:d,parentObjectId:r,parentGlobalId:c}),s[r]?s[r].push(m):s[r]=[m]}}return s}function c(t,e,n){let a={query:r({...t.query,f:"json",...s(e)})};return n&&(a={...n,...a,query:{...n.query,...a.query}}),o(t.path+"/queryAttachments",a).then((t=>t.data.attachmentGroups))}async function i(t,e,r){const{objectIds:n}=e,s=[];for(const a of n)s.push(o(t.path+"/"+a+"/attachments",r));return Promise.all(s).then((t=>n.map(((o,e)=>({parentObjectId:o,attachmentInfos:t[e].data.attachmentInfos})))))}export{c as executeAttachmentQuery,i as fetchAttachments,a as processAttachmentQueryResult};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{ensureType as s}from"../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";var a;let p=a=class extends e{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.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,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: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([i("esri.rest.support.AttachmentQuery")],p),p.from=s(p);const c=p;export{c as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{ensureType as s}from"../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";var a;let p=a=class extends e{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([i("esri.rest.support.AttachmentQuery")],p),p.from=s(p);const c=p;export{c as default};