@arcgis/core 4.33.0-next.20250226 → 4.33.0-next.20250228

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 (139) hide show
  1. package/WebLinkChart.js +1 -1
  2. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +2 -0
  3. package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{3170552a6310725d7730.js → 05b7c739115be0490583.js} +1 -1
  6. package/assets/esri/core/workers/chunks/2c227d97d00b3849f441.js +1 -0
  7. package/assets/esri/core/workers/chunks/2ce80c764cca9e6a20cd.js +1 -0
  8. package/assets/esri/core/workers/chunks/{2716394f121804d93b4e.js → 4253438dd3045566892d.js} +1 -1
  9. package/assets/esri/core/workers/chunks/6f9bfa6ed34ef6efcc6f.js +1 -0
  10. package/assets/esri/core/workers/chunks/8abd2235aa702d8b239f.js +1 -0
  11. package/assets/esri/core/workers/chunks/a288c2474ef193f9fbd3.js +1 -0
  12. package/assets/esri/core/workers/chunks/{e118245566be994a53da.js → a901c445d36f1a9e7df8.js} +1 -1
  13. package/assets/esri/core/workers/chunks/a91f2d1deb950f46ad09.js +1 -0
  14. package/assets/esri/core/workers/chunks/ae25c6108918d37e61bf.js +1 -0
  15. package/assets/esri/core/workers/chunks/{feb656f172ec9fe64752.js → af005704f23088db3ded.js} +1 -1
  16. package/assets/esri/core/workers/chunks/b8416f2560710258c239.js +1 -0
  17. package/assets/esri/core/workers/chunks/{dea40706ca4e37d5c6e2.js → d4d011eea16a89a5aad9.js} +1 -1
  18. package/assets/esri/core/workers/chunks/f45ef721d21388846101.js +1 -0
  19. package/assets/esri/core/workers/chunks/{2d4bfd747580ed3b6f4d.js → fdab6921d007929ab288.js} +1 -1
  20. package/assets/esri/themes/base/widgets/_Sketch.scss +4 -4
  21. package/assets/esri/themes/dark/main.css +1 -1
  22. package/assets/esri/themes/light/main.css +1 -1
  23. package/assets/esri/themes/light/view.css +1 -1
  24. package/chunks/chartUtilsAm5.js +1 -1
  25. package/core/sql/StandardizedFunctions.js +1 -1
  26. package/core/sql/WhereClause.js +1 -1
  27. package/core/sql/sqlCompareUtils.js +1 -1
  28. package/geometry/SpatialReference.js +1 -1
  29. package/interfaces.d.ts +17 -15
  30. package/intl/duration.js +1 -1
  31. package/intl/locale.js +1 -1
  32. package/intl/messages.js +1 -1
  33. package/layers/BingMapsLayer.js +1 -1
  34. package/layers/LinkChartLayer.js +1 -1
  35. package/layers/SubtypeGroupLayer.js +1 -1
  36. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  37. package/layers/mixins/SublayersOwner.js +1 -1
  38. package/layers/support/rasterDatasets/covJSONParser.js +1 -1
  39. package/package.json +1 -1
  40. package/support/popupUtils.js +1 -1
  41. package/support/revision.js +1 -1
  42. package/symbols/cim/animationUtils.js +1 -1
  43. package/symbols/support/previewSymbol2D.js +1 -1
  44. package/views/2d/engine/webgl/animations/utils.js +1 -1
  45. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  46. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  47. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
  48. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  49. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  50. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
  51. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
  52. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
  53. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
  54. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
  55. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
  56. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
  57. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js +1 -1
  58. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
  59. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapResolveShader.js +1 -1
  60. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  61. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js +1 -1
  62. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js +1 -1
  63. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  64. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OverlayShader.js +1 -1
  65. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
  66. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader.js +1 -1
  67. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TestShader.js +1 -1
  68. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
  69. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerLUTShader.js +1 -1
  70. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerShadedReliefShader.js +1 -1
  71. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerStretchShader.js +1 -1
  72. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
  73. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/BandArithmeticShader.js +1 -1
  74. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ColormapToRGBShader.js +1 -1
  75. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CompositeBandShader.js +1 -1
  76. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ComputeChangeShader.js +1 -1
  77. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ContrastBrightnessShader.js +1 -1
  78. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ConvolutionShader.js +1 -1
  79. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
  80. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ExtractBandShader.js +1 -1
  81. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/FocalStatisticsShader.js +1 -1
  82. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/GrayscaleShader.js +1 -1
  83. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/HillshadeShader.js +1 -1
  84. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/LocalShader.js +1 -1
  85. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
  86. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/NDVIShader.js +1 -1
  87. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  88. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ReprojectShader.js +1 -1
  89. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ShadedReliefShader.js +1 -1
  90. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
  91. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/StretchShader.js +1 -1
  92. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  93. package/views/3d/environment/CloudsRenderer.js +1 -1
  94. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  95. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  96. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  97. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +11 -11
  98. package/views/3d/webgl-engine/core/shaderLibrary/util/LookupCubemapFromTextureArray.glsl.js +39 -0
  99. package/views/3d/webgl-engine/core/shaderModules/Texture2DArrayBindUniform.js +5 -0
  100. package/views/3d/webgl-engine/lib/ComponentUtils.js +1 -1
  101. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  102. package/views/View.js +1 -1
  103. package/views/webgl/FramebufferObject.js +1 -1
  104. package/views/webgl/ShaderBuilder.js +1 -1
  105. package/views/webgl/capabilities.js +1 -1
  106. package/webdoc/support/webdocSaveUtils.js +1 -1
  107. package/webdoc/support/writeUtils.js +1 -1
  108. package/widgets/Feature/FeatureRelationship.js +1 -1
  109. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  110. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  111. package/widgets/Feature.js +1 -1
  112. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  113. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  114. package/widgets/FeatureTable.js +1 -1
  115. package/widgets/Features/FeaturesDrillIn.js +1 -1
  116. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  117. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  118. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  119. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  120. package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
  121. package/widgets/OrientedImageryViewer/symbols.js +1 -1
  122. package/widgets/OrientedImageryViewer.js +1 -1
  123. package/widgets/Print/PrintViewModel.js +1 -1
  124. package/widgets/ScaleRangeSlider/scalePreviewUtils.js +1 -1
  125. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  126. package/widgets/support/SelectionToolbar.js +1 -1
  127. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  128. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  129. package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
  130. package/widgets/support/chartUtilsAm5.js +1 -1
  131. package/assets/esri/core/workers/chunks/22e7db720724f2426d74.js +0 -1
  132. package/assets/esri/core/workers/chunks/2515ace848cf078c6263.js +0 -1
  133. package/assets/esri/core/workers/chunks/2c348d0e8131f08391cb.js +0 -1
  134. package/assets/esri/core/workers/chunks/380128e2cb74798478c1.js +0 -1
  135. package/assets/esri/core/workers/chunks/66338f008ff0992ffca2.js +0 -1
  136. package/assets/esri/core/workers/chunks/68ac336f7384bbca85ab.js +0 -1
  137. package/assets/esri/core/workers/chunks/84e50d3ff298b7b66070.js +0 -1
  138. package/assets/esri/core/workers/chunks/aa98a6c38e82d384403c.js +0 -1
  139. package/assets/esri/core/workers/chunks/d5ebe6b7cd9c8e40b386.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 t from"../core/Clonable.js";import r from"../core/Collection.js";import s from"../core/Error.js";import{loadAll as i}from"../core/loadAll.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as n,whenOrAbort as l}from"../core/promiseUtils.js";import{watch as u,sync as p}from"../core/reactiveUtils.js";import{sqlAnd as y}from"../core/sql.js";import{urlToObject as d,join as c}from"../core/urlUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import b from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as w}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as F}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as v}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as L}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as x}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{RefreshableLayer as I}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as E}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as _}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{id as O}from"./support/commonProperties.js";import{ensureLayerCredential as P,computeEffectiveEditingEnabled as G,addAttachment as A,updateAttachment as q,applyEdits as U,createQuery as D,deleteAttachments as M,fetchRecomputedExtents as R,computeDomainFromSubtypes as $,getFeatureSubtype as V,queryAttachments as k,queryObjectIds as N,queryFeatureCount as Q,queryExtent as H,queryRelatedFeatures as J,queryRelatedFeaturesCount as B,hasDataChanged as Z}from"./support/featureLayerUtils.js";import{defineFieldProperties as z}from"./support/fieldProperties.js";import{fixTimeInfoFields as K}from"./support/fieldUtils.js";import{getSymbolWithColorSupport as W,createSimpleRenderersWithUniqueColors as X}from"./support/subtypeGroupLayerUtils.js";import Y from"./support/SubtypeSublayer.js";import ee from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as te}from"./support/versionUtils.js";import re from"../rest/support/Query.js";import{isNumber as se}from"../support/guards.js";import{SaveOperationType as ie}from"../webdoc/interfaces.js";const oe="SubtypeGroupLayer",ae="esri.layers.SubtypeGroupLayer";function ne(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function le(e,t){const r=[];for(const s of e){const e=new Y;e.read(s,t),r.push(e)}return r}const ue=z();function pe(){return{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}let ye=class extends(L(F(v(w(_(E(I(S(x(T(o(j(g(t.ClonableMixin(b))))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(r.ofType(Y)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer","Table"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=a((async(e,t,r)=>{const{save:s,saveAs:i}=await import("./save/featureLayerUtils.js");switch(e){case ie.SAVE:return s(this,t);case ie.SAVE_AS:return i(this,r,t)}})),this.addHandles(u((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),p))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(n).then((async()=>{if(!this.url)throw new s("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(null==this.layerId)throw new s("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>P(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return G(this)}get operationalLayerType(){return this.isTable?"SubtypeGroupTable":"SubtypeGroupLayer"}get parsedUrl(){const e=d(this.url);return null!=e&&null!=this.layerId&&(e.path=c(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?C(this.url,t):t}async addAttachment(e,t){const r=await A(this,e,t,oe);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const s=await q(this,e,t,r,oe);return this.lastEditsEventDate=new Date,s}async applyEdits(e,t){return U(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await l(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=D(this),t=this.sublayers.map((e=>e.subtypeCode));return e.where=y(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await M(this,e,t,oe);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return R(this,e,oe)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const t=$(this,e);if(t)return t}const r=V(this,t?.feature);if(r){const t=r.domains?.[e];return"inherited"===t?.type?this._getLayerDomain(e):t}return this._getLayerDomain(e)}loadAll(){return i(this,(e=>{e(this.sublayers)}))}async queryAttachments(e,t){return k(this,e,t,oe)}async queryFeatures(e,t){const r=await this.load(),s=re.from(e)??r.createQuery(),i=s.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),s.outFields=i);const o=await r.source.queryFeatures(s,t);if(o?.features)for(const a of o.features)a.layer=a.sourceLayer=this.findSublayerForFeature(a);return o}async queryObjectIds(e,t){return(await N(this,e,t,oe)).filter(se)}async queryFeatureCount(e,t){return Q(this,e,t,oe)}async queryExtent(e,t){return H(this,e,t,oe)}async queryRelatedFeatures(e,t){return J(this,e,t,oe)}async queryRelatedFeaturesCount(e,t){return B(this,e,t,oe)}async save(e){return this._debouncedSaveOperations(ie.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ie.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:i,messages:o}=t;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==i)return o?.push(ne(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===i)return o?.push(ne(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(o?.push(new s("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&te(this,e)}async getFeatureTitle(e,t={timeZone:"system",fetchMissingFields:!1}){const r=this.findSublayerForFeature(e);return r?await r.getFeatureTitle(e,t):this.displayField&&this.fieldsIndex.has(this.displayField)?e.attributes[this.fieldsIndex.get(this.displayField).name]??"":this.objectIdField&&this.fieldsIndex.has(this.objectIdField)?e.attributes[this.fieldsIndex.get(this.objectIdField).name]??"":""}get requiredFeatureTitleFields(){const e=new Set;for(const t of this.sublayers){const r=t.featureTitleFields;for(const t of r)e.add(t)}return[...e]}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new s("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),K(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return Z(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach((e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),e.on("after-remove",(({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)}))],"sublayers-owner"))}};e([h({readOnly:!0})],ye.prototype,"createQueryVersion",null),e([h({readOnly:!0})],ye.prototype,"editingEnabled",null),e([h({readOnly:!0})],ye.prototype,"effectiveEditingEnabled",null),e([h({...ue.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],ye.prototype,"fields",void 0),e([h(ue.fieldsIndex)],ye.prototype,"fieldsIndex",void 0),e([h(O)],ye.prototype,"id",void 0),e([h({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],ye.prototype,"listMode",void 0),e([h({type:["SubtypeGroupLayer","SubtypeGroupTable"],json:{...pe(),origins:{"web-document":pe(),"portal-item":pe()}}})],ye.prototype,"operationalLayerType",null),e([h(ue.outFields)],ye.prototype,"outFields",void 0),e([h({readOnly:!0})],ye.prototype,"parsedUrl",null),e([h({clonable:!1})],ye.prototype,"source",null),e([h({type:r.ofType(Y),json:{origins:{service:{read:{source:"subtypes",reader(e,t,s){let i=null;if(this.useUniqueColorsForSublayers){const r=W(t,s);i=r?X(e.length,r):null}const o=e.map((({code:e},r)=>{const o=new Y({subtypeCode:e});o.read(t,s);const a=i?.[r];return a&&o.read({drawingInfo:{renderer:a.toJSON()}},s),o}));return new(r.ofType(Y))(o)}}}},read:{source:["layers","tables"],reader(e,t,s){let i;return"SubtypeGroupLayer"===t.layerType&&t.layers?.length?i=le(t.layers,s):"SubtypeGroupTable"===t.layerType&&t.tables?.length&&(i=le(t.tables,s)),new(r.ofType(Y))(i)}},write:{ignoreOrigin:!0,writer(e,t,r,s){const i=[];for(const o of e){const e=o.write({},s);i.push(e)}this.isTable?t.tables=i:t.layers=i}}}})],ye.prototype,"sublayers",void 0),e([h()],ye.prototype,"useUniqueColorsForSublayers",void 0),e([h({type:ee})],ye.prototype,"timeInfo",void 0),e([h({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],ye.prototype,"title",void 0),e([m("service","title",["name"])],ye.prototype,"readTitleFromService",null),e([h({json:{read:!1}})],ye.prototype,"type",void 0),e([h({clonable:!1,readOnly:!0})],ye.prototype,"requiredFeatureTitleFields",null),ye=e([f(ae)],ye);const de=ye;export{de as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Clonable.js";import r from"../core/Collection.js";import s from"../core/Error.js";import{loadAll as i}from"../core/loadAll.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as n,whenOrAbort as l}from"../core/promiseUtils.js";import{watch as u,sync as p}from"../core/reactiveUtils.js";import{sqlAnd as y}from"../core/sql.js";import{urlToObject as d,join as c}from"../core/urlUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import b from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as w}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as F}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as v}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as L}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as x}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{RefreshableLayer as I}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as E}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as _}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{id as O}from"./support/commonProperties.js";import{ensureLayerCredential as P,computeEffectiveEditingEnabled as G,addAttachment as A,updateAttachment as U,applyEdits as q,createQuery as D,deleteAttachments as M,fetchRecomputedExtents as R,computeDomainFromSubtypes as $,getFeatureSubtype as V,queryAttachments as k,queryObjectIds as N,queryFeatureCount as Q,queryExtent as H,queryRelatedFeatures as J,queryRelatedFeaturesCount as B,hasDataChanged as Z}from"./support/featureLayerUtils.js";import{defineFieldProperties as z}from"./support/fieldProperties.js";import{fixTimeInfoFields as K}from"./support/fieldUtils.js";import{getSymbolWithColorSupport as W,createSimpleRenderersWithUniqueColors as X}from"./support/subtypeGroupLayerUtils.js";import Y from"./support/SubtypeSublayer.js";import ee from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as te}from"./support/versionUtils.js";import re from"../rest/support/Query.js";import{isNumber as se}from"../support/guards.js";import{SaveOperationType as ie}from"../webdoc/interfaces.js";const oe="SubtypeGroupLayer",ae="esri.layers.SubtypeGroupLayer";function ne(e,t){return new s("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function le(e,t){const r=[];for(const s of e){const e=new Y;e.read(s,t),r.push(e)}return r}const ue=z();function pe(){return{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}let ye=class extends(L(F(v(w(_(E(I(S(x(T(o(j(g(t.ClonableMixin(b))))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(r.ofType(Y)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer","Table"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=a((async(e,t,r)=>{const{save:s,saveAs:i}=await import("./save/featureLayerUtils.js");switch(e){case ie.SAVE:return s(this,t);case ie.SAVE_AS:return i(this,r,t)}})),this.addHandles(u((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),p))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(n).then((async()=>{if(!this.url)throw new s("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(null==this.layerId)throw new s("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>P(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return G(this)}get operationalLayerType(){return this.isTable?"SubtypeGroupTable":"SubtypeGroupLayer"}get parsedUrl(){const e=d(this.url);return null!=e&&null!=this.layerId&&(e.path=c(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?C(this.url,t):t}async addAttachment(e,t){const r=await A(this,e,t,oe);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const s=await U(this,e,t,r,oe);return this.lastEditsEventDate=new Date,s}async applyEdits(e,t){return q(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await l(import("./graphics/sources/FeatureLayerSource.js"),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=D(this),t=this.sublayers.map((e=>e.subtypeCode));return e.where=y(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await M(this,e,t,oe);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return R(this,e,oe)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const t=$(this,e);if(t)return t}const r=V(this,t?.feature);if(r){const t=r.domains?.[e];return"inherited"===t?.type?this._getLayerDomain(e):t}return this._getLayerDomain(e)}loadAll(){return i(this,(e=>{e(this.sublayers)}))}async queryAttachments(e,t){return k(this,e,t,oe)}async queryFeatures(e,t){const r=await this.load(),s=re.from(e)??r.createQuery(),i=s.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),s.outFields=i);const o=await r.source.queryFeatures(s,t);if(o?.features)for(const a of o.features)a.layer=a.sourceLayer=this.findSublayerForFeature(a);return o}async queryObjectIds(e,t){return(await N(this,e,t,oe)).filter(se)}async queryFeatureCount(e,t){return Q(this,e,t,oe)}async queryExtent(e,t){return H(this,e,t,oe)}async queryRelatedFeatures(e,t){return J(this,e,t,oe)}async queryRelatedFeaturesCount(e,t){return B(this,e,t,oe)}async save(e){return this._debouncedSaveOperations(ie.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ie.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:i,messages:o}=t;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==i)return o?.push(ne(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===i)return o?.push(ne(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(o?.push(new s("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&te(this,e)}async getFeatureTitle(e,t={timeZone:"system",fetchMissingFields:!1}){const r=this.findSublayerForFeature(e);return r?await r.getFeatureTitle(e,t):this.displayField&&this.fieldsIndex.has(this.displayField)?e.attributes[this.fieldsIndex.get(this.displayField).name]??"":this.objectIdField&&this.fieldsIndex.has(this.objectIdField)?e.attributes[this.fieldsIndex.get(this.objectIdField).name]??"":""}get featureTitleFields(){const e=new Set;for(const t of this.sublayers){const r=t.featureTitleFields;for(const t of r)e.add(t)}return[...e]}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new s("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),K(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return Z(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach((e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),e.on("after-remove",(({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)}))],"sublayers-owner"))}};e([h({readOnly:!0})],ye.prototype,"createQueryVersion",null),e([h({readOnly:!0})],ye.prototype,"editingEnabled",null),e([h({readOnly:!0})],ye.prototype,"effectiveEditingEnabled",null),e([h({...ue.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],ye.prototype,"fields",void 0),e([h(ue.fieldsIndex)],ye.prototype,"fieldsIndex",void 0),e([h(O)],ye.prototype,"id",void 0),e([h({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],ye.prototype,"listMode",void 0),e([h({type:["SubtypeGroupLayer","SubtypeGroupTable"],json:{...pe(),origins:{"web-document":pe(),"portal-item":pe()}}})],ye.prototype,"operationalLayerType",null),e([h(ue.outFields)],ye.prototype,"outFields",void 0),e([h({readOnly:!0})],ye.prototype,"parsedUrl",null),e([h({clonable:!1})],ye.prototype,"source",null),e([h({type:r.ofType(Y),json:{origins:{service:{read:{source:"subtypes",reader(e,t,s){let i=null;if(this.useUniqueColorsForSublayers){const r=W(t,s);i=r?X(e.length,r):null}const o=e.map((({code:e},r)=>{const o=new Y({subtypeCode:e});o.read(t,s);const a=i?.[r];return a&&o.read({drawingInfo:{renderer:a.toJSON()}},s),o}));return new(r.ofType(Y))(o)}}}},read:{source:["layers","tables"],reader(e,t,s){let i;return"SubtypeGroupLayer"===t.layerType&&t.layers?.length?i=le(t.layers,s):"SubtypeGroupTable"===t.layerType&&t.tables?.length&&(i=le(t.tables,s)),new(r.ofType(Y))(i)}},write:{ignoreOrigin:!0,writer(e,t,r,s){const i=[];for(const o of e){const e=o.write({},s);i.push(e)}this.isTable?t.tables=i:t.layers=i}}}})],ye.prototype,"sublayers",void 0),e([h()],ye.prototype,"useUniqueColorsForSublayers",void 0),e([h({type:ee})],ye.prototype,"timeInfo",void 0),e([h({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],ye.prototype,"title",void 0),e([m("service","title",["name"])],ye.prototype,"readTitleFromService",null),e([h({json:{read:!1}})],ye.prototype,"type",void 0),e([h({clonable:!1,readOnly:!0})],ye.prototype,"featureTitleFields",null),ye=e([f(ae)],ye);const de=ye;export{de 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
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import o from"../../core/Logger.js";import{MultiOriginJSONMixin as i}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as p}from"../../core/accessorSupport/PropertyOrigin.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import m from"../../geometry/Polyline.js";import{initializeProjection as d,project as h}from"../../geometry/projection.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as g}from"../../geometry/support/typeUtils.js";import j from"../Layer.js";import b from"../graphics/data/FeatureStore.js";import{QueryEngine as w}from"../graphics/data/QueryEngine.js";import{createCapabilities as T,createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as S,systemAggregationCountFieldName as v,systemIsSpatialFieldName as O,systemLayoutGeometryFieldName as E,systemOriginIdFieldName as x,systemDestinationIdFieldName as N}from"./constants.js";import{KnowledgeGraphSublayerBase as L}from"./KnowledgeGraphSublayerBase.js";import{getDisplayLabelProperty as F,getLinkChartDefaultLabelingInfo as _,getMapDefaultLabelingInfo as R,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as C}from"./layerUtils.js";import{BlendLayer as M,blendModeProperty as k,effectProperty as J}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as D,displayFilterEnabledProperty as P,displayFilterInfoProperty as q}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as G,featureEffectProperty as U}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as A}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as Z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as K}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as W,useViewTimeProperty as Y}from"../mixins/TemporalLayer.js";import{legendEnabled as z,maxScale as H,minScale as X,opacity as $,popupEnabled as ee}from"../support/commonProperties.js";import{featureReductionProperty as te}from"../support/featureReductionUtils.js";import re from"../support/Field.js";import{fixRendererFields as oe,fixTimeInfoFields as ie}from"../support/fieldUtils.js";import ne from"../support/LabelClass.js";import{reader as se}from"../support/labelingInfo.js";import ae from"../support/TimeInfo.js";import pe from"../../renderers/SimpleRenderer.js";import{fromJSON as le}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ye}from"../../renderers/support/typeUtils.js";import ue from"../../rest/support/FeatureSet.js";import me from"../../rest/support/Query.js";import{createPopupTemplate as de}from"../../support/popupUtils.js";import{applyColorToSymbol as he}from"../../symbols/support/utils.js";import ce from"../../core/workers/RemoteClient.js";function fe(e){if(!e.json)return e;e.json.write=ge(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ge(e.write))}return e}function ge(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=je(e)),e):!0===e?be():e}function je(e){const{target:t,writer:r,overridePolicy:o,...i}=e;return function(e,t){const r=we.call(this,e,t);return r.enabled?{...i,...r}:r}}function be(){return{overridePolicy:we}}function we(e,t){const r=!!this.geometryType;let o={enabled:r};return r&&(o={...o,...Te.call(this,e,t)}),o}function Te(e,t){return{ignoreOrigin:this.originIdOf(t)>p.DEFAULTS}}let Ie=class extends(L(D(A(G(M(Z(W(K(V(i(j))))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=T(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=S,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new ce(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=me.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(re.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(re.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),re.fromJSON({name:v,type:"esriFieldTypeInteger",alias:v,editable:!1}),re.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return E;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");const e=this.objectType.properties?F(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?_(this.graphType,this.graphTypeName,e):R(this.graphTypeName,this.geometryType,e)}set renderer(e){oe(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map((e=>e.name)).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new pe({type:"simple",symbol:C(r)});const e=le(I(g.toJSON("point")).renderer);return he(e.symbol,r),e}const o=le(I(g.toJSON(this.geometryType)).renderer);return he(o.symbol,r),o}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return de(this,e)}createQuery(){return new me({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e),i=ue.fromJSON(await o.executeQuery(r.toJSON(),t?.signal));return i.features.forEach((e=>{e.sourceLayer=this})),i}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return await o.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return o.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:o,queryEngine:i}=await this._setupQueryObjects(r),n=await i.executeQueryForExtent(o.toJSON(),t?.signal);let s;return s=null!=n.extent?.xmin&&null!=n.extent?.xmax&&null!=n.extent?.ymin&&null!=n.extent?.ymax?new l(n.extent):new l,{count:n.count,extent:s}}async queryObjectIds(e,t){await this.load();const r=me.from(e);let o;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);o=this.loadQueryEngine(e)}return await o.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new b({geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new w({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new me({where:"1=1",outFields:[S]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then((()=>ie(this.timeInfo,this.fieldsIndex)))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=me.from(e),o=r.geometry;if(o&&!o.spatialReference?.isWGS84&&(await d(o.spatialReference,f),r.geometry=h(o instanceof u||o instanceof m||o instanceof y?o:o.extent,f)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const i=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(i)}}};e([n(fe(r(k)))],Ie.prototype,"blendMode",void 0),e([n()],Ie.prototype,"capabilities",void 0),e([n({json:{origins:{"web-scene":{write:!1}},write:be()}})],Ie.prototype,"charts",void 0),e([n({readOnly:!0})],Ie.prototype,"defaultPopupTemplate",null),e([n({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],Ie.prototype,"definitionExpression",void 0),e([n()],Ie.prototype,"displayField",void 0),e([n(fe(r(P)))],Ie.prototype,"displayFilterEnabled",void 0),e([n(fe(r(q)))],Ie.prototype,"displayFilterInfo",void 0),e([n(fe(r(J)))],Ie.prototype,"effect",void 0),e([n()],Ie.prototype,"elevationInfo",void 0),e([n(fe(r(U)))],Ie.prototype,"featureEffect",void 0),e([n(fe(r(te)))],Ie.prototype,"featureReduction",null),e([n()],Ie.prototype,"fields",null),e([n()],Ie.prototype,"geometryType",null),e([n()],Ie.prototype,"geometryFieldName",null),e([n({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphType",void 0),e([n({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphTypeName",null),e([n()],Ie.prototype,"hasM",null),e([n()],Ie.prototype,"hasZ",null),e([n({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],Ie.prototype,"id",void 0),e([n({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],Ie.prototype,"labelsVisible",void 0),e([n({type:[ne],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:ve,write:be()}})],Ie.prototype,"labelingInfo",null),e([n({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"layerType",void 0),e([n(fe(r(z)))],Ie.prototype,"legendEnabled",void 0),e([n(fe(r(H)))],Ie.prototype,"maxScale",void 0),e([n(fe(r(X)))],Ie.prototype,"minScale",void 0),e([n()],Ie.prototype,"objectIdField",void 0),e([n()],Ie.prototype,"objectType",void 0),e([n(fe(r($)))],Ie.prototype,"opacity",void 0),e([n(fe(r(B)))],Ie.prototype,"orderBy",void 0),e([n({clonable:!1})],Ie.prototype,"parent",void 0),e([n()],Ie.prototype,"parentCompositeLayer",void 0),e([n(fe(r(ee)))],Ie.prototype,"popupEnabled",void 0),e([n({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],Ie.prototype,"popupTemplate",void 0),e([n({type:Number,json:{write:{overridePolicy:Te}}})],Ie.prototype,"refreshInterval",void 0),e([n({types:ye,json:{name:"layerDefinition.drawingInfo.renderer",write:be()}})],Ie.prototype,"renderer",null),e([n()],Ie.prototype,"source",void 0),e([n()],Ie.prototype,"spatialReference",null),e([n({type:ae,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],Ie.prototype,"timeInfo",null),e([n({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"title",null),e([a("title")],Ie.prototype,"writeTitle",null),e([n({json:{read:!1}})],Ie.prototype,"type",void 0),e([n(fe(r(Y)))],Ie.prototype,"useViewTime",void 0),e([n({type:Boolean,json:{name:"visibility",write:be()}})],Ie.prototype,"visible",void 0),Ie=e([s("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Ie);const Se=Ie;function ve(e,t,r){const i=[["ESRI__AGGREGATION_COUNT",v],["ESRI__ORIGIN_ID",x],["ESRI__DESTINATION_ID",N],["ESRI__LAYOUT_GEOMETRY",E]];try{for(const t of e)for(const[e,r]of i)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(n){o.getLogger(this).warn("Error updating labelingInfo",n)}return se(e,t,r)}export{Se as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import o from"../../core/Logger.js";import{MultiOriginJSONMixin as i}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as p}from"../../core/accessorSupport/PropertyOrigin.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import m from"../../geometry/Polyline.js";import{initializeProjection as d,project as h}from"../../geometry/projection.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as g}from"../../geometry/support/typeUtils.js";import j from"../Layer.js";import b from"../graphics/data/FeatureStore.js";import{QueryEngine as w}from"../graphics/data/QueryEngine.js";import{createCapabilities as T,createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as S,systemAggregationCountFieldName as v,systemIsSpatialFieldName as O,systemLayoutGeometryFieldName as E,systemOriginIdFieldName as x,systemDestinationIdFieldName as N}from"./constants.js";import{KnowledgeGraphSublayerBase as L}from"./KnowledgeGraphSublayerBase.js";import{getDisplayLabelProperty as F,getLinkChartDefaultLabelingInfo as _,getMapDefaultLabelingInfo as R,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as C}from"./layerUtils.js";import{BlendLayer as M,blendModeProperty as k,effectProperty as J}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as D,displayFilterEnabledProperty as P,displayFilterInfoProperty as q}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as G,featureEffectProperty as U}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as A}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as Z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as K}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as W,useViewTimeProperty as Y}from"../mixins/TemporalLayer.js";import{legendEnabled as z,maxScale as H,minScale as X,opacity as $,popupEnabled as ee}from"../support/commonProperties.js";import{featureReductionProperty as te}from"../support/featureReductionUtils.js";import re from"../support/Field.js";import{fixRendererFields as oe,fixTimeInfoFields as ie}from"../support/fieldUtils.js";import ne from"../support/LabelClass.js";import{reader as se}from"../support/labelingInfo.js";import ae from"../support/TimeInfo.js";import pe from"../../renderers/SimpleRenderer.js";import{fromJSON as le}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ye}from"../../renderers/support/typeUtils.js";import ue from"../../rest/support/FeatureSet.js";import me from"../../rest/support/Query.js";import{createPopupTemplate as de}from"../../support/popupUtils.js";import{applyColorToSymbol as he}from"../../symbols/support/utils.js";import ce from"../../core/workers/RemoteClient.js";function fe(e){if(!e.json)return e;e.json.write=ge(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ge(e.write))}return e}function ge(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=je(e)),e):!0===e?be():e}function je(e){const{target:t,writer:r,overridePolicy:o,...i}=e;return function(e,t){const r=we.call(this,e,t);return r.enabled?{...i,...r}:r}}function be(){return{overridePolicy:we}}function we(e,t){const r=!!this.geometryType;let o={enabled:r};return r&&(o={...o,...Te.call(this,e,t)}),o}function Te(e,t){return{ignoreOrigin:this.originIdOf(t)>p.DEFAULTS}}let Ie=class extends(L(D(A(G(M(Z(W(K(V(i(j))))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=T(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=S,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new ce(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=me.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(re.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(re.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),re.fromJSON({name:v,type:"esriFieldTypeInteger",alias:v,editable:!1}),re.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return E;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");const e=this.objectType.properties?F(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?_(this.graphType,this.graphTypeName,e):R(this.graphTypeName,this.geometryType,e)}set renderer(e){oe(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map((e=>e.name)).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new pe({type:"simple",symbol:C(r)});const e=le(I(g.toJSON("point")).renderer);return he(e.symbol,r),e}const o=le(I(g.toJSON(this.geometryType)).renderer);return he(o.symbol,r),o}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return de(this,e)}createQuery(){return new me({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e),i=ue.fromJSON(await o.executeQuery(r.toJSON(),t?.signal));return i.features.forEach((e=>{e.sourceLayer=this})),i}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return await o.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:o}=await this._setupQueryObjects(e);return o.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:o,queryEngine:i}=await this._setupQueryObjects(r),n=await i.executeQueryForExtent(o.toJSON(),t?.signal);let s;return s=null!=n.extent?.xmin&&null!=n.extent?.xmax&&null!=n.extent?.ymin&&null!=n.extent?.ymax?new l(n.extent):new l,{count:n.count,extent:s}}async queryObjectIds(e,t){await this.load();const r=me.from(e);let o;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);o=this.loadQueryEngine(e)}return await o.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new b({geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new w({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new me({where:"1=1",outFields:[S]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then((()=>ie(this.timeInfo,this.fieldsIndex)))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=me.from(e),o=r.geometry;if(o&&!o.spatialReference?.isWGS84&&(await d(o.spatialReference,f),r.geometry=h(o instanceof u||o instanceof m||o instanceof y?o:o.extent,f)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const i=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(i)}}};e([n(fe(r(k)))],Ie.prototype,"blendMode",void 0),e([n()],Ie.prototype,"capabilities",void 0),e([n({json:{origins:{"web-scene":{write:!1}},write:be()}})],Ie.prototype,"charts",void 0),e([n({readOnly:!0})],Ie.prototype,"defaultPopupTemplate",null),e([n({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],Ie.prototype,"definitionExpression",void 0),e([n()],Ie.prototype,"displayField",void 0),e([n(fe(r(P)))],Ie.prototype,"displayFilterEnabled",void 0),e([n(fe(r(q)))],Ie.prototype,"displayFilterInfo",void 0),e([n(fe(r(J)))],Ie.prototype,"effect",void 0),e([n()],Ie.prototype,"elevationInfo",void 0),e([n(fe(r(U)))],Ie.prototype,"featureEffect",void 0),e([n(fe(r(te)))],Ie.prototype,"featureReduction",null),e([n()],Ie.prototype,"fields",null),e([n()],Ie.prototype,"geometryType",null),e([n()],Ie.prototype,"geometryFieldName",null),e([n({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphType",void 0),e([n({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphTypeName",null),e([n()],Ie.prototype,"hasM",null),e([n()],Ie.prototype,"hasZ",null),e([n({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],Ie.prototype,"id",void 0),e([n({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],Ie.prototype,"labelsVisible",void 0),e([n({type:[ne],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:ve,write:be()}})],Ie.prototype,"labelingInfo",null),e([n({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"layerType",void 0),e([n(fe(r(z)))],Ie.prototype,"legendEnabled",void 0),e([n(fe(r(H)))],Ie.prototype,"maxScale",void 0),e([n(fe(r(X)))],Ie.prototype,"minScale",void 0),e([n()],Ie.prototype,"objectIdField",void 0),e([n()],Ie.prototype,"objectType",void 0),e([n(fe(r($)))],Ie.prototype,"opacity",void 0),e([n(fe(r(B)))],Ie.prototype,"orderBy",void 0),e([n({clonable:!1})],Ie.prototype,"parent",void 0),e([n()],Ie.prototype,"parentCompositeLayer",void 0),e([n(fe(r(ee)))],Ie.prototype,"popupEnabled",void 0),e([n({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],Ie.prototype,"popupTemplate",void 0),e([n({type:Number,json:{write:{overridePolicy:Te}}})],Ie.prototype,"refreshInterval",void 0),e([n({types:ye,json:{name:"layerDefinition.drawingInfo.renderer",write:be()}})],Ie.prototype,"renderer",null),e([n()],Ie.prototype,"source",void 0),e([n()],Ie.prototype,"spatialReference",null),e([n({type:ae,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],Ie.prototype,"timeInfo",null),e([n({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"title",null),e([a("title")],Ie.prototype,"writeTitle",null),e([n({json:{read:!1}})],Ie.prototype,"type",void 0),e([n(fe(r(Y)))],Ie.prototype,"useViewTime",void 0),e([n({type:Boolean,json:{name:"visibility",write:be()}})],Ie.prototype,"visible",void 0),Ie=e([s("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Ie);const Se=Ie;function ve(e,t,r){const i=[["ESRI__AGGREGATION_COUNT",v],["ESRI__ORIGIN_ID",x],["ESRI__DESTINATION_ID",N],["ESRI__LAYOUT_GEOMETRY",E]];try{for(const t of e)for(const[e,r]of i)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(n){o.getLogger(this).warn("Error updating labelingInfo",n)}return se(e,t,r)}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
- import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Collection.js";import s from"../../core/CollectionFlattener.js";import t from"../../core/Error.js";import o from"../../core/Logger.js";import{watch as a,sync as l}from"../../core/reactiveUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{getProperties as n}from"../../core/accessorSupport/utils.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{OriginId as y,nameToId as c,idToName as b}from"../../core/accessorSupport/PropertyOrigin.js";import d from"../support/Sublayer.js";import{isSublayerOverhaul as p}from"../support/sublayerUtils.js";function h(e,r){const s=[],t={};return e?(e.forEach((e=>{const o=new d;if(o.read(e,r),t[o.id]=o,null!=e.parentLayerId&&-1!==e.parentLayerId){const r=t[e.parentLayerId];r.sublayers||(r.sublayers=[]),r.sublayers.unshift(o)}else s.unshift(o)})),s):s}const f=r.ofType(d);function S(e,r){e&&e.forEach((e=>{r(e),e.sublayers&&e.sublayers.length&&S(e.sublayers,r)}))}const m=m=>{let E=class extends m{constructor(...e){super(...e),this.allSublayers=new s({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{}},this.subtables=null,this.addHandles([a((()=>this.sublayers),((e,r)=>this._handleSublayersChange(e,r)),l),a((()=>this.subtables),((e,r)=>this._handleSublayersChange(e,r)),l)])}destroy(){this.allSublayers.destroy()}readSublayers(e,r){if(!r||!e)return;const{sublayersSourceJSON:s}=this,t=c(r.origin);if(t<y.SERVICE)return;if(s[t]={context:r,visibleLayers:e.visibleLayers||s[t].visibleLayers,layers:e.layers||s[t].layers},t>y.SERVICE)return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:o,origin:a}=this.createSublayersForOrigin("web-document"),l=n(this);l.setDefaultOrigin(a),this._set("sublayers",new f(o)),l.setDefaultOrigin("user")}findSublayerById(e){return this.allSublayers.find((r=>r.id===e))}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(e){const r=c("web-document"===e?"web-map":e);let s=y.SERVICE,t=this.sublayersSourceJSON[y.SERVICE].layers,o=this.sublayersSourceJSON[y.SERVICE].context,a=null;const l=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter((e=>e<=r));for(const y of l){const e=this.sublayersSourceJSON[y];p(e.layers)&&(s=y,t=e.layers,o=e.context,e.visibleLayers&&(a={visibleLayers:e.visibleLayers,context:e.context}))}const i=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter((e=>e>s&&e<=r));let n=null;for(const y of i){const{layers:e,visibleLayers:r,context:s}=this.sublayersSourceJSON[y];e&&(n={layers:e,context:s}),r&&(a={visibleLayers:r,context:s})}const u=h(t,o),d=new Map,m=new Set;if(n)for(const y of n.layers)d.set(y.id,y);if(a?.visibleLayers)for(const y of a.visibleLayers)m.add(y);return S(u,(e=>{n&&e.read(d.get(e.id),n.context),a&&e.read({defaultVisibility:m.has(e.id)},a.context)})),{origin:b(s),sublayers:new f({items:u})}}read(e,r){super.read(e,r),this.readSublayers(e,r)}_handleSublayersChange(e,r){r&&(r.forEach((e=>{e.parent=null,e.layer=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this,e.layer=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))],"sublayers-owner"),"tile"===this.type&&this.addHandles(e.on("before-changes",(e=>{o.getLogger("esri.layers.TileLayer").error(new t("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),e.preventDefault()})),"sublayers-owner"))}};return e([i({readOnly:!0})],E.prototype,"allSublayers",void 0),e([i({readOnly:!0,type:r.ofType(d)})],E.prototype,"serviceSublayers",void 0),e([i({value:null,type:f,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],E.prototype,"sublayers",void 0),e([i({readOnly:!0})],E.prototype,"sublayersSourceJSON",void 0),e([i({type:f,json:{read:{source:"tables"}}})],E.prototype,"subtables",void 0),E=e([u("esri.layers.mixins.SublayersOwner")],E),E};export{m as SublayersOwner,S as forEachSublayer};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Collection.js";import s from"../../core/CollectionFlattener.js";import t from"../../core/Error.js";import o from"../../core/Logger.js";import{watch as a,sync as l}from"../../core/reactiveUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{getProperties as n}from"../../core/accessorSupport/utils.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{OriginId as y,nameToId as c,idToName as b}from"../../core/accessorSupport/PropertyOrigin.js";import d from"../support/Sublayer.js";import{isSublayerOverhaul as p}from"../support/sublayerUtils.js";function h(e,r){const s=[],t={};return e?(e.forEach((e=>{const o=new d;if(o.read(e,r),t[o.id]=o,null!=e.parentLayerId&&-1!==e.parentLayerId){const r=t[e.parentLayerId];r.sublayers||(r.sublayers=[]),r.sublayers.unshift(o)}else s.unshift(o)})),s):s}const f=r.ofType(d);function S(e,r){e&&e.forEach((e=>{r(e),e.sublayers&&e.sublayers.length&&S(e.sublayers,r)}))}const m=m=>{let E=class extends m{constructor(...e){super(...e),this.allSublayers=new s({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{},[y.LINK_CHART]:{}},this.subtables=null,this.addHandles([a((()=>this.sublayers),((e,r)=>this._handleSublayersChange(e,r)),l),a((()=>this.subtables),((e,r)=>this._handleSublayersChange(e,r)),l)])}destroy(){this.allSublayers.destroy()}readSublayers(e,r){if(!r||!e)return;const{sublayersSourceJSON:s}=this,t=c(r.origin);if(t<y.SERVICE)return;if(s[t]={context:r,visibleLayers:e.visibleLayers||s[t].visibleLayers,layers:e.layers||s[t].layers},t>y.SERVICE)return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:o,origin:a}=this.createSublayersForOrigin("web-document"),l=n(this);l.setDefaultOrigin(a),this._set("sublayers",new f(o)),l.setDefaultOrigin("user")}findSublayerById(e){return this.allSublayers.find((r=>r.id===e))}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(e){const r=c("web-document"===e?"web-map":e);let s=y.SERVICE,t=this.sublayersSourceJSON[y.SERVICE].layers,o=this.sublayersSourceJSON[y.SERVICE].context,a=null;const l=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter((e=>e<=r));for(const y of l){const e=this.sublayersSourceJSON[y];p(e.layers)&&(s=y,t=e.layers,o=e.context,e.visibleLayers&&(a={visibleLayers:e.visibleLayers,context:e.context}))}const i=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter((e=>e>s&&e<=r));let n=null;for(const y of i){const{layers:e,visibleLayers:r,context:s}=this.sublayersSourceJSON[y];e&&(n={layers:e,context:s}),r&&(a={visibleLayers:r,context:s})}const u=h(t,o),d=new Map,m=new Set;if(n)for(const y of n.layers)d.set(y.id,y);if(a?.visibleLayers)for(const y of a.visibleLayers)m.add(y);return S(u,(e=>{n&&e.read(d.get(e.id),n.context),a&&e.read({defaultVisibility:m.has(e.id)},a.context)})),{origin:b(s),sublayers:new f({items:u})}}read(e,r){super.read(e,r),this.readSublayers(e,r)}_handleSublayersChange(e,r){r&&(r.forEach((e=>{e.parent=null,e.layer=null})),this.removeHandles("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this,e.layer=this})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))],"sublayers-owner"),"tile"===this.type&&this.addHandles(e.on("before-changes",(e=>{o.getLogger("esri.layers.TileLayer").error(new t("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),e.preventDefault()})),"sublayers-owner"))}};return e([i({readOnly:!0})],E.prototype,"allSublayers",void 0),e([i({readOnly:!0,type:r.ofType(d)})],E.prototype,"serviceSublayers",void 0),e([i({value:null,type:f,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],E.prototype,"sublayers",void 0),e([i({readOnly:!0})],E.prototype,"sublayersSourceJSON",void 0),e([i({type:f,json:{read:{source:"tables"}}})],E.prototype,"subtables",void 0),E=e([u("esri.layers.mixins.SublayersOwner")],E),E};export{m as SublayersOwner,S as forEachSublayer};
@@ -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"../../../Color.js";import t from"../../../geometry/Extent.js";import n from"../../../geometry/SpatialReference.js";import{getLanguage as l}from"../../../intl/locale.js";import s from"../PixelBlock.js";import{getIntegerPixelType as a}from"../rasterFormats/pixelRangeUtils.js";function i(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function r(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function o(e){const{axes:l}=e.domain,s=Object.keys(l),a=[],o=[];let u=-1,m=-1,c=[];for(let t=0;t<s.length;t++){const e=s[t];i(e)?u=t:r(e)&&(m=t);const n=l[e],d=[];if("values"in n){n.values.forEach((e=>d.push("string"==typeof e?new Date(e).getTime():e)));const e=d[1]-d[0];a.push([d[0]-.5*e,d[d.length-1]+.5*e]),o.push(e)}else{const{start:e,stop:t,num:l}=n,s=(t-e)/(l-1);a.push([e-.5*s,t+.5*s]),o.push(s);for(let n=0;n<l;n++)d.push(e+s*n)}c.push({name:e,values:d,extent:[d[0],d[d.length-1]]})}u>-1&&-1===m?m=0===u?1:0:m>-1&&-1===u?u=0===m?1:0:-1===m&&-1===u&&(u=0,m=1),c=c.filter(((e,t)=>!(t===u||t===m)));const{referencing:d}=e.domain,f=d.find((e=>e.coordinates.includes(s[u]))).system.id,p=f?.slice(f.lastIndexOf("/")+1),h=null==p||"CRS84"===p?4326:Number(p),g=new n({wkid:h}),[b,y]=a[u],[x,j]=a[m],v=new t({xmin:b,xmax:y,ymin:x,ymax:j,spatialReference:g});return{width:Math.round(v.width/o[u]),height:Math.round(v.height/o[m]),extent:v,dimensions:c}}function u(e){const t=l();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function m(){return Math.round(255*Math.random())}function c(t){const n={},{parameters:l}=t;if(!l)return n;for(const[s,a]of Object.entries(l)){const{type:t,description:l,unit:i,categoryEncoding:r,observedProperty:o}=a;if("Parameter"===t&&(n[s]={},l&&(n[s].description=u(l)),i&&(n[s].unit=i.label?u(i.label):null,n[s].symbol=i.symbol?.value),r)){const t=Object.entries(r).map(((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1})));let l=!1;o?.categories?.length&&(o.categories.forEach((n=>{if(!n.id)return;const s=n.id.slice(n.id.lastIndexOf("/")+1),a=t.find((e=>e.ClassName===s));if(!a)return;const i=n.label?u(n.label):null;if(a.Label=i,n.preferredColor){const t=e.fromHex(n.preferredColor);t&&(l=!0,a.Red=t.r,a.Green=t.g,a.Blue=t.b)}})),l&&t.forEach((e=>{null==e.Red&&(e.Red=m(),e.Green=m(),e.Blue=m())})));const a={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:t.map((e=>({attributes:e})))};l&&a.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),n[s].attributeTable=a}}return n}function d(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let l=0;l<e.length;l++){const s=e[l];null!=s&&(s<t&&(t=s),s>n&&(n=s))}return a(t,n)}function f(e,t,n){const l=e.map(((e,n)=>({name:e,count:t[n]}))).sort(((e,t)=>e.name>t.name?-1:1)),s=(a=1,e=>a*=e.count);var a;const i=[...l.slice(1),{name:"",count:1}].reverse().map(s).reverse();let r=0;for(let o=e.length-1;o>=0;o--){r+=i[l.findIndex((({name:t})=>t===e[o]))]*(n%t[o]),n=Math.floor(n/t[o])}return r}function p(e){const{width:t,height:n,extent:l,dimensions:a}=o(e),{ranges:i}=e,r=Object.keys(i).sort(((e,t)=>e<t?-1:1)),u=[];for(let s=0;s<r.length;s++){const e=r[s];a?.length&&u.push({name:e,dimensions:a})}const m=c(e);u.forEach((e=>m[e.name]&&Object.assign(e,m[e.name])));const p=u.length?{variables:u}:void 0,h=[];for(let o=0;o<r.length;o++){const e=r[o],{values:l,dataType:u,axisNames:m,shape:c}=i[e],p=c.length>2?o*c.slice(0,-2).reduce(((e,t)=>e*t)):0,g=m.slice(0,-2),b=c.slice(0,-2),y="float"===u?"f32":d(l),x=t*n,j=l.length/x;for(let i=0;i<j;i++){const e=s.createEmptyBand(y,x),r=new Uint8Array(x).fill(255);let u=!1;const m=i*x;for(let t=0;t<x;t++){const n=l[m+t];null==n?(r[t]=0,u=!0):e[t]=n}if(0===o||a?.length){const l=new s({width:t,height:n,mask:u?r:null,pixels:[e],pixelType:y});if(l.updateStatistics(),a?.length){h[f(g,b,i)+p]=l}else h.push(l)}else{const t=h[i];t.pixels.push(e),u?t.mask&&(t.mask=s.combineBandMasks([t.mask,r])):t.mask=u?r:null}}}const g=Object.values(m).find((e=>e.attributeTable))?.attributeTable;return{extent:l,pixelBlocks:h,multidimensionalInfo:p,attributeTable:g,bandNames:p?void 0:r}}export{i as isXAxis,r as isYAxis,p as parseGridCoverage};
5
+ import e from"../../../Color.js";import t from"../../../geometry/Extent.js";import n from"../../../geometry/SpatialReference.js";import{getLocaleParts as l}from"../../../intl/locale.js";import s from"../PixelBlock.js";import{getIntegerPixelType as a}from"../rasterFormats/pixelRangeUtils.js";function i(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function r(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function o(e){const{axes:l}=e.domain,s=Object.keys(l),a=[],o=[];let u=-1,m=-1,c=[];for(let t=0;t<s.length;t++){const e=s[t];i(e)?u=t:r(e)&&(m=t);const n=l[e],d=[];if("values"in n){n.values.forEach((e=>d.push("string"==typeof e?new Date(e).getTime():e)));const e=d[1]-d[0];a.push([d[0]-.5*e,d[d.length-1]+.5*e]),o.push(e)}else{const{start:e,stop:t,num:l}=n,s=(t-e)/(l-1);a.push([e-.5*s,t+.5*s]),o.push(s);for(let n=0;n<l;n++)d.push(e+s*n)}c.push({name:e,values:d,extent:[d[0],d[d.length-1]]})}u>-1&&-1===m?m=0===u?1:0:m>-1&&-1===u?u=0===m?1:0:-1===m&&-1===u&&(u=0,m=1),c=c.filter(((e,t)=>!(t===u||t===m)));const{referencing:d}=e.domain,f=d.find((e=>e.coordinates.includes(s[u]))).system.id,p=f?.slice(f.lastIndexOf("/")+1),h=null==p||"CRS84"===p?4326:Number(p),g=new n({wkid:h}),[b,y]=a[u],[x,j]=a[m],v=new t({xmin:b,xmax:y,ymin:x,ymax:j,spatialReference:g});return{width:Math.round(v.width/o[u]),height:Math.round(v.height/o[m]),extent:v,dimensions:c}}function u(e){const t=l()?.language;return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function m(){return Math.round(255*Math.random())}function c(t){const n={},{parameters:l}=t;if(!l)return n;for(const[s,a]of Object.entries(l)){const{type:t,description:l,unit:i,categoryEncoding:r,observedProperty:o}=a;if("Parameter"===t&&(n[s]={},l&&(n[s].description=u(l)),i&&(n[s].unit=i.label?u(i.label):null,n[s].symbol=i.symbol?.value),r)){const t=Object.entries(r).map(((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1})));let l=!1;o?.categories?.length&&(o.categories.forEach((n=>{if(!n.id)return;const s=n.id.slice(n.id.lastIndexOf("/")+1),a=t.find((e=>e.ClassName===s));if(!a)return;const i=n.label?u(n.label):null;if(a.Label=i,n.preferredColor){const t=e.fromHex(n.preferredColor);t&&(l=!0,a.Red=t.r,a.Green=t.g,a.Blue=t.b)}})),l&&t.forEach((e=>{null==e.Red&&(e.Red=m(),e.Green=m(),e.Blue=m())})));const a={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:t.map((e=>({attributes:e})))};l&&a.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),n[s].attributeTable=a}}return n}function d(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let l=0;l<e.length;l++){const s=e[l];null!=s&&(s<t&&(t=s),s>n&&(n=s))}return a(t,n)}function f(e,t,n){const l=e.map(((e,n)=>({name:e,count:t[n]}))).sort(((e,t)=>e.name>t.name?-1:1)),s=(a=1,e=>a*=e.count);var a;const i=[...l.slice(1),{name:"",count:1}].reverse().map(s).reverse();let r=0;for(let o=e.length-1;o>=0;o--){r+=i[l.findIndex((({name:t})=>t===e[o]))]*(n%t[o]),n=Math.floor(n/t[o])}return r}function p(e){const{width:t,height:n,extent:l,dimensions:a}=o(e),{ranges:i}=e,r=Object.keys(i).sort(((e,t)=>e<t?-1:1)),u=[];for(let s=0;s<r.length;s++){const e=r[s];a?.length&&u.push({name:e,dimensions:a})}const m=c(e);u.forEach((e=>m[e.name]&&Object.assign(e,m[e.name])));const p=u.length?{variables:u}:void 0,h=[];for(let o=0;o<r.length;o++){const e=r[o],{values:l,dataType:u,axisNames:m,shape:c}=i[e],p=c.length>2?o*c.slice(0,-2).reduce(((e,t)=>e*t)):0,g=m.slice(0,-2),b=c.slice(0,-2),y="float"===u?"f32":d(l),x=t*n,j=l.length/x;for(let i=0;i<j;i++){const e=s.createEmptyBand(y,x),r=new Uint8Array(x).fill(255);let u=!1;const m=i*x;for(let t=0;t<x;t++){const n=l[m+t];null==n?(r[t]=0,u=!0):e[t]=n}if(0===o||a?.length){const l=new s({width:t,height:n,mask:u?r:null,pixels:[e],pixelType:y});if(l.updateStatistics(),a?.length){h[f(g,b,i)+p]=l}else h.push(l)}else{const t=h[i];t.pixels.push(e),u?t.mask&&(t.mask=s.combineBandMasks([t.mask,r])):t.mask=u?r:null}}}const g=Object.values(m).find((e=>e.attributeTable))?.attributeTable;return{extent:l,pixelBlocks:h,multidimensionalInfo:p,attributeTable:g,bandNames:p?void 0:r}}export{i as isXAxis,r as isYAxis,p as parseGridCoverage};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.33.0-next.20250226",
3
+ "version": "4.33.0-next.20250228",
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": [
@@ -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"../PopupTemplate.js";import{isFieldEditable as t,isRasterPixelValueField as n,getDisplayFieldName as i,isFieldVisibleByDefault as o}from"../layers/support/fieldUtils.js";import s from"../popup/content/AttachmentsContent.js";import"../popup/content/Content.js";import"../popup/content/CustomContent.js";import"../popup/content/ExpressionContent.js";import r from"../popup/content/FieldsContent.js";import"../popup/content/MediaContent.js";import"../popup/content/RelationshipContent.js";import"../popup/content/TextContent.js";import"../popup/content/UtilityNetworkAssociationsContent.js";import l from"../popup/FieldInfo.js";import a from"../popup/support/FieldInfoFormat.js";function p({displayField:t,editFieldsInfo:n,fields:i,objectIdField:o,title:s},r){if(!i)return null;const l=F({editFieldsInfo:n,fields:i,objectIdField:o},r);if(!l.length)return null;const a=I({titleBase:s,fields:i,displayField:t}),p=j();return new e({title:a,content:p,fieldInfos:l})}function u(t){const{fields:n,featureReduction:i,title:o}=t,s=i.fields;if(!s)return null;const r=g(s,n??[]);if(!r.length)return null;const l=C();return new e({title:o,content:l,fieldInfos:r})}function c(e){const{title:t,graphic:n}=e??{},{attributes:i,sourceLayer:o}=n??{},s=o&&"displayField"in o?o.displayField:null,r=s?i?.[s]:null,l=n?.getObjectId()?.toString();return t||r||l||""}const d=(e,t)=>t.visibleFieldNames?t.visibleFieldNames.has(e.name):o(e,t);function f({fields:e,ignoreFieldTypes:t,sortDisabled:n}){const i=e;return t&&(e=e.filter((e=>!t.includes(e.type)))),e===i&&(e=e.slice()),!0!==n&&e.sort(m),e}function m(e,t){return"oid"===e.type?-1:"oid"===t.type?1:v(e)?-1:v(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function b(e,t){return new r({fieldInfos:F(e,t).filter((e=>e.visible))})}function F(e,n){const i=n?.visibleFieldNames;return f({fields:e.fields??[],ignoreFieldTypes:n?.ignoreFieldTypes||S,sortDisabled:n?.sortDisabled}).map((n=>new l({fieldName:n.name,isEditable:t(n,e),label:n.alias,format:y(n),visible:d(n,{...e,visibleFieldNames:i})})))}function g(e,t){return e.map((e=>new l({fieldName:e.name,isEditable:!1,label:e.alias,format:w(e,t),visible:!0})))}function w(e,t){const{onStatisticField:n,onStatisticExpression:i,statisticType:o}=e;if(n){const e=t.find((e=>n===e.name));if(e)return y(e)}return"number"===i?.returnType?new a({digitSeparator:!0,places:2}):"count"===o?new a({digitSeparator:!0,places:0}):void 0}function y(e){switch(e.type){case"small-integer":case"integer":case"single":return new a({digitSeparator:!0,places:0});case"double":return new a({digitSeparator:!0,places:2});case"string":return n(e.name)?new a({digitSeparator:!0,places:0}):void 0;default:return}}function j(){return[new r,new s]}function C(){return[new r]}function I(e){const t=i(e),{titleBase:n}=e;return t?`${n}: {${t.trim()}}`:n??""}function v(e){if("name"===(e.name&&e.name.toLowerCase()))return!0;const t=e.alias?.toLowerCase();return"name"===t}const S=["geometry","blob","raster","guid","xml"];export{F as createFieldInfos,b as createFieldsContent,p as createPopupTemplate,u as createPopupTemplateForFeatureReduction,c as getFeaturePopupTitle};
5
+ import e from"../PopupTemplate.js";import{isFieldEditable as t,isRasterPixelValueField as n,getDisplayFieldName as i,isFieldVisibleByDefault as o}from"../layers/support/fieldUtils.js";import s from"../popup/content/AttachmentsContent.js";import"../popup/content/Content.js";import"../popup/content/CustomContent.js";import"../popup/content/ExpressionContent.js";import r from"../popup/content/FieldsContent.js";import"../popup/content/MediaContent.js";import"../popup/content/RelationshipContent.js";import"../popup/content/TextContent.js";import"../popup/content/UtilityNetworkAssociationsContent.js";import l from"../popup/FieldInfo.js";import a from"../popup/support/FieldInfoFormat.js";function p({displayField:t,editFieldsInfo:n,fields:i,objectIdField:o,title:s},r){if(!i)return null;const l=g({editFieldsInfo:n,fields:i,objectIdField:o},r);if(!l.length)return null;const a=I({titleBase:s,fields:i,displayField:t}),p=j();return new e({title:a,content:p,fieldInfos:l})}function u(t){const{fields:n,featureReduction:i,title:o}=t,s=i.fields;if(!s)return null;const r=F(s,n??[]);if(!r.length)return null;const l=C();return new e({title:o,content:l,fieldInfos:r})}function c(e){const{title:t,graphic:n}=e??{},{attributes:i,sourceLayer:o}=n??{},s=o&&"displayField"in o?o.displayField:null,r=s?i?.[s]:null,l=null!=r?JSON.stringify(r):null,a=n?.getObjectId()?.toString();return t||l||a||""}const d=(e,t)=>t.visibleFieldNames?t.visibleFieldNames.has(e.name):o(e,t);function f({fields:e,ignoreFieldTypes:t,sortDisabled:n}){const i=e;return t&&(e=e.filter((e=>!t.includes(e.type)))),e===i&&(e=e.slice()),!0!==n&&e.sort(m),e}function m(e,t){return"oid"===e.type?-1:"oid"===t.type?1:v(e)?-1:v(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function b(e,t){return new r({fieldInfos:g(e,t).filter((e=>e.visible))})}function g(e,n){const i=n?.visibleFieldNames;return f({fields:e.fields??[],ignoreFieldTypes:n?.ignoreFieldTypes||S,sortDisabled:n?.sortDisabled}).map((n=>new l({fieldName:n.name,isEditable:t(n,e),label:n.alias,format:y(n),visible:d(n,{...e,visibleFieldNames:i})})))}function F(e,t){return e.map((e=>new l({fieldName:e.name,isEditable:!1,label:e.alias,format:w(e,t),visible:!0})))}function w(e,t){const{onStatisticField:n,onStatisticExpression:i,statisticType:o}=e;if(n){const e=t.find((e=>n===e.name));if(e)return y(e)}return"number"===i?.returnType?new a({digitSeparator:!0,places:2}):"count"===o?new a({digitSeparator:!0,places:0}):void 0}function y(e){switch(e.type){case"small-integer":case"integer":case"single":return new a({digitSeparator:!0,places:0});case"double":return new a({digitSeparator:!0,places:2});case"string":return n(e.name)?new a({digitSeparator:!0,places:0}):void 0;default:return}}function j(){return[new r,new s]}function C(){return[new r]}function I(e){const t=i(e),{titleBase:n}=e;return t?`${n}: {${t.trim()}}`:n??""}function v(e){if("name"===(e.name&&e.name.toLowerCase()))return!0;const t=e.alias?.toLowerCase();return"name"===t}const S=["geometry","blob","raster","guid","xml"];export{g as createFieldInfos,b as createFieldsContent,p as createPopupTemplate,u as createPopupTemplateForFeatureReduction,c as getFeaturePopupTitle};
@@ -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 c="20250226",e="5a2e5ab13ae71f5d09cc4bbf61c3e3f385379487";export{c as buildDate,e as commitHash};
5
+ const f="20250228",c="5f8df7426a174ca8fefcf3012c8fe069ec9a8f0d";export{f as buildDate,c as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Logger.js";import{animationDebugFlags as e}from"./animationDebugFlags.js";import{defaultCIMValues as r}from"./defaultCIMValues.js";import{AnimatedSymbolRepeatType as n,AnimatedSymbolEasingType as o}from"./enums.js";import{getExtent as i}from"./SDFHelper.js";import{getProcessParam as a,getValue as s,getSize as m}from"./utils.js";import{TimeOrigin as l}from"../../views/2d/engine/webgl/animations/instructions.js";function c(t,e,r){return{transform:P(t,e,r.transform),fromColor:b(t,e,r.fromColor),toColor:g(t,e,r.toColor),colorMix:T(t,e,r.colorMix),toOpacity:I(t,e,r.toOpacity),opacityMix:h(t,e,r.opacityMix),hasAnimations:r.hasAnimations||!!e.animations&&e.animations.length>0}}function f(t){return!e.forceStaticPath&&(e.forceAnimatedPath||t.hasAnimations)}function p(e,r,n){if("CIMCharacterMarker"===r.type)return t.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),n;const o=a(e,r,"OffsetX"),i=a(e,r,"OffsetY");if("CIMPictureMarker"===r.type)return{...n,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:R([o,i]),rotation:R(0),scale:R(a(e,r,"Size")),parent:n.transform}};const s=r.frame,m=s.ymax-s.ymin;return{...n,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:R([o,i]),rotation:R(0),scale:R({type:"Process",op:"Divide",left:a(e,r,"Size"),right:m}),parent:n.transform}}}function u(t,e){let r=0,n=0;const o="Absolute"!==t.anchorPointUnits;return t.anchorPoint&&(r=-t.anchorPoint.x,n=-t.anchorPoint.y),{...e,transform:{type:"AnimatedTransform",relativeTranslation:o,absoluteScale:!1,translation:R([r,n]),rotation:R(0),scale:R(1),parent:e.transform}}}function y(t,e){return"Absolute"===t.anchorPointUnits?e:u(t,e)}function C(t,e){return"Absolute"!==t.anchorPointUnits?e:u(t,e)}function M(t,e,r){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:R([e,r]),rotation:R(0),scale:R(1),parent:t.transform}}}function S(t,e){const r=e?.5*-(e.xmin+e.xmax):0,n=e?.5*-(e.ymin+e.ymax):0;let o=0,a=0;if("x"in t&&"y"in t)o=t.x+r,a=t.y+n;else{const e=i(t);if(e){o=(e[0]+e[2])/2+r,a=(e[1]+e[3])/2+n}}return[o,a]}function d(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return D(t,e,"Rotation")}return 0}function A(t,e){switch(e.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return a(t,e,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return a(t,e,"TintColor")}return[1,1,1,1]}function P(t,e,r){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:x(t,e),rotation:O(t,e),scale:v(t,e),parent:r}}function b(t,e,r){return{type:"AnimatedColor",color:R(A(t,e)),opacity:R(1),parent:r}}function g(t,e,r){const{animations:n}=e;let o=A(t,e);const i=n?.filter((t=>"CIMSymbolAnimationColor"===t.type))[0];return i&&(o=a(t,i,"ToColor")),{type:"AnimatedColor",color:R(o),opacity:R(1),parent:r}}function T(t,e,r){const{animations:n}=e,o=n?.filter((t=>"CIMSymbolAnimationColor"===t.type))[0];return o?{type:"AnimatedColor",color:R([1,1,1,1]),opacity:{from:0,to:1,timing:k(t,o?.animatedSymbolProperties)},parent:[1,1,1,1]}:r}function I(t,e,r){const{animations:n}=e;let o=R(1);const i=n?.filter((t=>"CIMSymbolAnimationTransparency"===t.type))[0];if(i){o=R({type:"Process",op:"Transparency",value:a(t,i,"ToTransparency")})}return{type:"AnimatedColor",color:R([1,1,1,1]),opacity:o,parent:r}}function h(t,e,r){const{animations:n}=e,o=n?.filter((t=>"CIMSymbolAnimationTransparency"===t.type))[0];return o?{type:"AnimatedColor",color:R([1,1,1,1]),opacity:{from:0,to:1,timing:k(t,o?.animatedSymbolProperties)},parent:[1,1,1,1]}:r}function k(t,e){if(!e)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:l.Local,repeatType:n.Loop,easing:o.Linear,playAnimation:1,reverseAnimation:0};const i=a(t,e,"Duration");let m;if(a(t,e,"RandomizeStartTime")){m={type:"Process",op:"Random",min:0,max:i,seed:a(t,e,"RandomizeStartSeed")}}else m=a(t,e,"StartTimeOffset");const c=a(t,e,"RepeatDelay"),f=a(t,e,"PlayAnimation"),p=a(t,e,"ReverseAnimation"),u=s(e.repeatType,r.CIMAnimatedSymbolProperties.repeattype);return{duration:i,startTimeOffset:m,repeatDelay:c,timeOriginSelector:u===n.None?l.Local:l.Global,repeatType:u,easing:s(e.easing,r.CIMAnimatedSymbolProperties.easing),playAnimation:f,reverseAnimation:p}}function v(t,e){const{animations:r}=e;if("CIMPictureMarker"!==e.type&&"CIMVectorMarker"!==e.type&&"CIMPointSymbol"!==e.type)return R(1);let n;n="CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type?a(t,e,"Size"):m(e)||10;const o=r?.filter((t=>"CIMSymbolAnimationScale"===t.type))[0];if(!o){const e=r?.filter((t=>"CIMSymbolAnimationSize"===t.type))[0];if(!e)return R(1);return{from:1,to:{type:"Process",op:"Divide",left:a(t,e,"ToSize"),right:n},timing:k(t,e.animatedSymbolProperties)}}return{from:1,to:a(t,o,"ScaleFactor"),timing:k(t,o.animatedSymbolProperties)}}function x(t,e){const{animations:r}=e,n=r?.filter((t=>"CIMSymbolAnimationOffset"===t.type))[0];if(!n)return R([0,0]);return{from:[0,0],to:[a(t,n,"OffsetX"),a(t,n,"OffsetY")],timing:k(t,n.animatedSymbolProperties)}}function O(t,e){const{animations:r}=e,n=d(t,e),o=r?.filter((t=>"CIMSymbolAnimationRotation"===t.type))[0];if(!o)return R(n);return{from:n,to:D(t,o,"ToRotation"),timing:k(t,o.animatedSymbolProperties)}}function D(t,e,r){const n=a(t,e,r);return{type:"Process",op:"Cond",condition:a(t,e,"RotateClockwise"),ifTrue:"ToRotation"===r?{type:"Process",op:"Add",left:-2*Math.PI,right:n}:{type:"Process",op:"Divide",left:n,right:-1},ifFalse:n}}function R(t){return{from:t,to:t,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:l.Local,repeatType:n.Loop,easing:o.Linear,playAnimation:1,reverseAnimation:0}}}function L(t){if(null==t)return!1;if("object"!=typeof t)return!1;if(t.animations&&Array.isArray(t.animations)&&t.animations.length>0)return!0;for(const e in t)if(L(t[e]))return!0;return!1}export{L as checkForAnimations,c as getAnimationParams,S as getFrameTranslation,R as getStaticParam,C as handleAbsoluteAnchor,u as handleAnchor,p as handleMarker,y as handleRelativeAnchor,f as shouldUseAnimatedPath,M as translate};
5
+ import t from"../../core/Logger.js";import{animationDebugFlags as e}from"./animationDebugFlags.js";import{defaultCIMValues as r}from"./defaultCIMValues.js";import{AnimatedSymbolRepeatType as o,AnimatedSymbolEasingType as n}from"./enums.js";import{getExtent as i}from"./SDFHelper.js";import{getProcessParam as a,getValue as s,getSize as c}from"./utils.js";import{TimeOrigin as m}from"../../views/2d/engine/webgl/animations/instructions.js";function l(t,e,r){return{transform:g(t,e,r.transform),fromColor:b(t,e,r.fromColor),toColor:I(t,e,r.toColor),colorMix:T(t,e,r.colorMix),toOpacity:h(t,e,r.toOpacity),opacityMix:k(t,e,r.opacityMix),hasAnimations:r.hasAnimations||!!e.animations&&e.animations.length>0}}function p(t){return!e.forceStaticPath&&(e.forceAnimatedPath||t.hasAnimations)}function f(e,r,o){if("CIMCharacterMarker"===r.type)return t.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),o;const n=a(e,r,"OffsetX"),i=a(e,r,"OffsetY");if("CIMPictureMarker"===r.type)return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:R([n,i]),rotation:R(0),scale:R(a(e,r,"Size")),parent:o.transform}};const s=r.frame,c=s.ymax-s.ymin;return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:R([n,i]),rotation:R(0),scale:R({type:"Process",op:"Divide",left:a(e,r,"Size"),right:c}),parent:o.transform}}}function u(t,e){let r=0,o=0;const n="Absolute"!==t.anchorPointUnits;return t.anchorPoint&&(r=-t.anchorPoint.x,o=-t.anchorPoint.y),{...e,transform:{type:"AnimatedTransform",relativeTranslation:n,absoluteScale:!1,translation:R([r,o]),rotation:R(0),scale:R(1),parent:e.transform}}}function y(t,e){return"Absolute"===t.anchorPointUnits?e:u(t,e)}function C(t,e){return"Absolute"!==t.anchorPointUnits?e:u(t,e)}function M(t,e,r){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:R([e,r]),rotation:R(0),scale:R(1),parent:t.transform}}}function d(t,e){const r=e?.5*-(e.xmin+e.xmax):0,o=e?.5*-(e.ymin+e.ymax):0;let n=0,a=0;if("x"in t&&"y"in t)n=t.x+r,a=t.y+o;else{const e=i(t);if(e){n=(e[0]+e[2])/2+r,a=(e[1]+e[3])/2+o}}return[n,a]}function S(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return a(t,e,"Rotation")}return 0}function A(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return a(t,e,"RotateClockwise")}return 0}function P(t,e){switch(e.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return a(t,e,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return a(t,e,"TintColor")}return[1,1,1,1]}function g(t,e,r){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:O(t,e),rotation:D(t,e),scale:x(t,e),parent:r}}function b(t,e,r){return{type:"AnimatedColor",color:R(P(t,e)),opacity:R(1),parent:r}}function I(t,e,r){const{animations:o}=e;let n=P(t,e);const i=o?.filter((t=>"CIMSymbolAnimationColor"===t.type))[0];return i&&(n=a(t,i,"ToColor")),{type:"AnimatedColor",color:R(n),opacity:R(1),parent:r}}function T(t,e,r){const{animations:o}=e,n=o?.filter((t=>"CIMSymbolAnimationColor"===t.type))[0];return n?{type:"AnimatedColor",color:R([1,1,1,1]),opacity:{from:0,to:1,timing:v(t,n?.animatedSymbolProperties)},parent:[1,1,1,1]}:r}function h(t,e,r){const{animations:o}=e;let n=R(1);const i=o?.filter((t=>"CIMSymbolAnimationTransparency"===t.type))[0];if(i){n=R({type:"Process",op:"Transparency",value:a(t,i,"ToTransparency")})}return{type:"AnimatedColor",color:R([1,1,1,1]),opacity:n,parent:r}}function k(t,e,r){const{animations:o}=e,n=o?.filter((t=>"CIMSymbolAnimationTransparency"===t.type))[0];return n?{type:"AnimatedColor",color:R([1,1,1,1]),opacity:{from:0,to:1,timing:v(t,n?.animatedSymbolProperties)},parent:[1,1,1,1]}:r}function v(t,e){if(!e)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:m.Local,repeatType:o.Loop,easing:n.Linear,playAnimation:1,reverseAnimation:0};const i=a(t,e,"Duration");let c;if(a(t,e,"RandomizeStartTime")){c={type:"Process",op:"Random",min:0,max:i,seed:a(t,e,"RandomizeStartSeed")}}else c=a(t,e,"StartTimeOffset");const l=a(t,e,"RepeatDelay"),p=a(t,e,"PlayAnimation"),f=a(t,e,"ReverseAnimation"),u=s(e.repeatType,r.CIMAnimatedSymbolProperties.repeattype);return{duration:i,startTimeOffset:c,repeatDelay:l,timeOriginSelector:u===o.None?m.Local:m.Global,repeatType:u,easing:s(e.easing,r.CIMAnimatedSymbolProperties.easing),playAnimation:p,reverseAnimation:f}}function x(t,e){const{animations:r}=e;if("CIMPictureMarker"!==e.type&&"CIMVectorMarker"!==e.type&&"CIMPointSymbol"!==e.type)return R(1);let o;o="CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type?a(t,e,"Size"):c(e)||10;const n=r?.filter((t=>"CIMSymbolAnimationScale"===t.type))[0];if(!n){const e=r?.filter((t=>"CIMSymbolAnimationSize"===t.type))[0];if(!e)return R(1);return{from:1,to:{type:"Process",op:"Divide",left:a(t,e,"ToSize"),right:o},timing:v(t,e.animatedSymbolProperties)}}return{from:1,to:a(t,n,"ScaleFactor"),timing:v(t,n.animatedSymbolProperties)}}function O(t,e){const{animations:r}=e,o=r?.filter((t=>"CIMSymbolAnimationOffset"===t.type))[0];if(!o)return R([0,0]);return{from:[0,0],to:[a(t,o,"OffsetX"),a(t,o,"OffsetY")],timing:v(t,o.animatedSymbolProperties)}}function D(t,e){const{animations:r}=e,o=A(t,e),n={type:"Process",op:"Divide",left:S(t,e),right:{type:"Process",op:"Cond",condition:o,ifTrue:-1,ifFalse:1}},i=r?.filter((t=>"CIMSymbolAnimationRotation"===t.type))[0];if(!i)return R(n);const s={type:"Process",op:"Add",left:a(t,i,"ToRotation"),right:{type:"Process",op:"Divide",left:n,right:-1}};return{from:n,to:{type:"Process",op:"Add",left:n,right:{type:"Process",op:"Cond",condition:a(t,i,"RotateClockwise"),ifTrue:{type:"Process",op:"MatchWinding",sign:-1,angle:s},ifFalse:{type:"Process",op:"MatchWinding",sign:1,angle:s}}},timing:v(t,i.animatedSymbolProperties)}}function R(t){return{from:t,to:t,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:m.Local,repeatType:o.Loop,easing:n.Linear,playAnimation:1,reverseAnimation:0}}}function L(t){if(null==t)return!1;if("object"!=typeof t)return!1;if(t.animations&&Array.isArray(t.animations)&&t.animations.length>0)return!0;for(const e in t)if(L(t[e]))return!0;return!1}export{L as checkForAnimations,l as getAnimationParams,d as getFrameTranslation,R as getStaticParam,C as handleAbsoluteAnchor,u as handleAnchor,f as handleMarker,y as handleRelativeAnchor,p as shouldUseAnimatedPath,M as translate};
@@ -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 t from"../../Color.js";import{getColorLuminance as e}from"../../core/colorUtils.js";import i from"../../core/Error.js";import{loadFont as o}from"../../core/fontUtils.js";import{pt2px as n}from"../../core/screenUtils.js";import{quantizePolygon as a,quantizePolyline as l}from"../../geometry/support/quantizationUtils.js";import{getFill as s,getStroke as r,getDashArray as h,getPatternUrlWithColor as c}from"./gfxUtils.js";import{SymbolSizeDefaults as m,shapes as u,adjustColorBrightness as p}from"./previewUtils.js";import{renderSymbol as d}from"./renderUtils.js";import{backgroundPadding as g}from"./textUtils.js";const f="picture-fill",y="picture-marker",w="simple-fill",x="simple-line",b="simple-marker",v="text",M="Aa",S=m.size,z=m.maxSize,k=m.maxOutlineSize,L=m.lineWidth,C=225,$=document.createElement("canvas");function j(t,e,i){if("polygon"===t.type){const o=t.extent,n=0===o.width?1:o.width,l=0===o.height?1:o.height;t=a({originPosition:"upperLeft",scale:[n/e,l/i],translate:[o.xmin,o.ymax]},{},t);let s="";for(let e=0;e<t.rings.length;e++){const i=t.rings[e];for(let t=0;t<i.length;t++){const e=i[t][0],o=i[t][1];let n="";0===t?(n=`M${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n):t===i.length-1?(n=`l${e.toString()} ${o.toString()} Z`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}if("polyline"===t.type){const o=t.extent,n=0===o.width?1:o.width,a=0===o.height?1:o.height;t=l({originPosition:"lowerLeft",scale:[n/e,a/i],translate:[o.xmin,o.ymax]},{},t);let s="";for(let e=0;e<t.paths.length;e++){const i=t.paths[e];for(let t=0;t<i.length;t++){const e=i[t][0],o=i[t][1];let n="";0===t?(n=`M${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}return""}function B(t,e){const i=$.getContext("2d"),o=[];e&&(e.weight&&o.push(e.weight),e.size&&o.push(e.size+"px"),e.family&&o.push(e.family)),i.font=o.join(" ");const{width:n,actualBoundingBoxLeft:a,actualBoundingBoxRight:l,actualBoundingBoxAscent:s,actualBoundingBoxDescent:r}=i.measureText(t);return{width:Math.ceil(Math.max(n,a+l)),height:Math.ceil(s+r),x:Math.floor(a),y:Math.floor((s-r)/2)}}function P(t){const e=t?.size;return{width:null!=e&&"object"==typeof e&&"width"in e?n(e.width):null,height:null!=e&&"object"==typeof e&&"height"in e?n(e.height):null}}async function U(t,e){const i=e.fill,o=t.color;if("pattern"===i?.type&&o&&t.type!==f){const t=await c(i.src,o.toCss(!0));i.src=t,e.fill=i}}async function A(t,e,i,n){if(!("font"in t)||!t.font||"text"!==e.shape.type)return;try{await o(t.font)}catch{}const{width:a,height:l}=P(n);if(!/[\uE600-\uE6FF]/.test(e.shape.text)){const{width:o,height:s,x:r,y:h}=B(e.shape.text,{weight:e.font?.weight,size:e.font?.size,family:e.font?.family});i[0]=a??o,i[1]=l??s,e.shape.x=r,e.shape.y=h;let c="angle"in t?t.angle:null;if(null!=n?.rotation&&(c=(c??0)+n.rotation),c){const t=c*(Math.PI/180),e=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t));i[1]=i[0]*e+i[1]*o}}}function E(t,e,i,o,a){if(null!=t.haloColor&&null!=t.haloSize){a.masking??=i.map((()=>[]));const l=n(t.haloSize);o[0]+=l,o[1]+=l,i.unshift([{...e,fill:null,stroke:{color:t.haloColor,width:2*l,join:"round",cap:"round"}}]),a.masking.unshift([{shape:{type:"rect",x:0,y:0,width:o[0]+2*g,height:o[1]+2*g},fill:[255,255,255],stroke:null},{...e,fill:[0,0,0,0],stroke:null}])}null==t.backgroundColor&&null==t.borderLineColor||(o[0]+=2*g,o[1]+=2*g,i.unshift([{shape:{type:"rect",x:0,y:0,width:o[0],height:o[1]},fill:t.backgroundColor,stroke:{color:t.borderLineColor,width:n(t.borderLineSize)}}]),a.masking?.unshift([]))}function F(t,e){return t>e?"dark":"light"}function Z(t,e){const i="number"==typeof e?.size?e?.size:null,o=null!=i?n(i):null,a=null!=e?.maxSize?n(e.maxSize):null;let l="angle"in t?t.angle:null;null!=e?.rotation&&(l=(l??0)+e.rotation);const c=s(t);let m=r(t);"dark"!==q(t,245)||e?.ignoreWhiteSymbols||(m={width:.75,...m,color:"#bdc3c7"});let p=null;const d={shape:null,fill:c,stroke:m,offset:[0,0]};m?.width&&(m.width=Math.min(m.width,k));const g=m?.width||0;let C=null!=e?.size&&(null==e?.scale||e?.scale),$=0,U=0,A=!1;switch(t.type){case b:{const i=t.style,{width:s,height:r}=P(e);let h=s===r&&null!=s?s:null!=o?o:Math.min(n(t.size),a||z);if(!0===e?.useMarkerSymbolSize&&null!==s&&null!==r){const e=Math.min(n(t.size),a||z);h=e>s&&e>r?Math.min(s,r):e}switch($=h,U=h,i){case"circle":d.shape={type:"circle",cx:0,cy:0,r:.5*h},C||($+=g,U+=g);break;case"cross":d.shape={type:"path",path:[{command:"M",values:[0,.5*U]},{command:"L",values:[$,.5*U]},{command:"M",values:[.5*$,0]},{command:"L",values:[.5*$,U]}]};break;case"diamond":d.shape={type:"path",path:[{command:"M",values:[0,.5*U]},{command:"L",values:[.5*$,0]},{command:"L",values:[$,.5*U]},{command:"L",values:[.5*$,U]},{command:"Z",values:[]}]},C||($+=g,U+=g);break;case"square":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"Z",values:[]}]},C||($+=g,U+=g),l&&(A=!0);break;case"triangle":d.shape={type:"path",path:[{command:"M",values:[.5*$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"Z",values:[]}]},C||($+=g,U+=g),l&&(A=!0);break;case"x":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,U]},{command:"M",values:[$,0]},{command:"L",values:[0,U]}]},l&&(A=!0);break;case"path":d.shape={type:"path",path:t.path||""},C||($+=g,U+=g),l&&(A=!0),C=!0}break}case x:{const{width:t,height:i}=P(e),n=h(m).reduce(((t,e)=>t+e),0),a=n&&Math.ceil(L/n),l=i??o??g,s=t??(n*a||L);if(C=!0,"polyline"===e?.geometry?.type&&e?.geometry?.extent){$=s,U=i??$;const t=1e3,o=.15*t;p=[$,U],U=p[0]>p[1]?t*p[1]/p[0]:t,$=p[0]>p[1]?t:t*p[0]/p[1],m?.width&&(m.width=m.width*t/(p[1]>p[0]?p[1]:p[0]),m.width>o&&(m.width=o)),d.shape={type:"path",path:j(e.geometry,$,U)}}else $=null!=e?.maxSize?Math.min(s,e.maxSize):s,U=l,m&&(m.width=l),d.shape={type:"path",path:[{command:"M",values:[l/2,U/2]},{command:"L",values:[$-l/2,U/2]}]};break}case f:case w:{const t="object"==typeof e?.symbolConfig&&!!e?.symbolConfig?.isSquareFill,{width:i,height:n}=P(e);$=!t&&i!==n||null==i?null!=o?o:S:i,U=!t&&i!==n||null==n?$:n,C||($+=g,U+=g),C=!0,e?.geometry?.extent&&"polygon"===e?.geometry?.type?(p=[$,U],U=p[0]>p[1]?1e3*p[1]/p[0]:1e3,$=p[0]>p[1]?1e3:1e3*p[0]/p[1],d.shape={type:"path",path:j(e.geometry,$,U)}):d.shape=t?{type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"L",values:[0,0]},{command:"Z",values:[]}]}:u.fill[0];break}case y:{const i=Math.min(n(t.width),a||z),s=Math.min(n(t.height),a||z),{width:r,height:h}=P(e),c=r===h&&null!=r?r:null!=o?o:Math.max(i,s),m=t.width/t.height;$=m<=1?Math.ceil(c*m):c,U=m<=1?c:Math.ceil(c/m),d.shape={type:"image",x:-Math.round($/2),y:-Math.round(U/2),width:$,height:U,src:t.url||""},l&&(A=!0);break}case v:{const i=t,l=e?.overrideText||i.text||M,s=i.font,{width:r,height:h}=P(e),c=null!=h?h:null!=o?o:Math.min(n(s.size),a||z),{width:m,height:u}=B(l,{weight:s.weight,size:c,family:s.family}),p=/[\uE600-\uE6FF]/.test(l);$=r??(p?c:m),U=p?c:u;let g=.5*(p?c:u);p&&(g+=5),d.shape={type:"text",text:l,x:i.xoffset||0,y:i.yoffset||g,align:"middle",alignBaseline:i.verticalAlignment,decoration:s&&s.decoration,rotated:i.rotated,kerning:i.kerning},d.font=s&&{size:c,style:s.style,decoration:s.decoration,weight:s.weight,family:s.family};break}}return{shapeDescriptor:d,size:[$,U],outputSize:p,renderOptions:{node:e?.node,scale:C,opacity:e?.opacity,rotations:[l],useRotationSize:A,effectView:e?.effectView,ariaLabel:e?.ariaLabel}}}async function D(t,e){const{shapeDescriptor:o,size:n,renderOptions:a,outputSize:l}=Z(t,e);if(!o.shape)throw new i("symbolPreview: renderPreviewHTML2D","symbol not supported.");await U(t,o),await A(t,o,n,e);const s=[[o]];if("object"==typeof e?.symbolConfig&&e?.symbolConfig?.applyColorModulation){const t=.6*n[0];s.unshift([{...o,offset:[-t,0],fill:p(o.fill,-.3)}]),s.push([{...o,offset:[t,0],fill:p(o.fill,.3)}]),n[0]+=2*t,a.scale=!1}"text"===t.type&&E(t,o,s,n,a);const r=d(s,n,a);if(l&&r){const t="img"===r.nodeName.toLowerCase()?r:r.firstChild;"svg"===t.nodeName.toLowerCase()&&t.setAttribute("viewBox",`0 0 ${n[0].toString()} ${n[1].toString()}`),t.setAttribute("width",l[0].toString()),t.setAttribute("height",l[1].toString()),l.length>2&&(t.style.setProperty("padding-left",l[2]?.toString()+"px"),t.style.setProperty("padding-right",l[2]?.toString()+"px"),t.style.setProperty("padding-top",l[3]?.toString()+"px"),t.style.setProperty("padding-bottom",l[3]?.toString()+"px"),t.style.setProperty("box-sizing","border-box"))}return r}function q(i,o=C){const n=s(i),a=r(i),l=!n||"type"in n?null:new t(n),h=a?.color?new t(a?.color):null,c=l?F(e(l),o):null,m=h?F(e(h),o):null;return m?c?c===m?c:o>=C?"light":"dark":m:c}export{q as getContrastingBackgroundTheme,Z as getRenderSymbolParameters,D as previewSymbol2D};
5
+ import t from"../../Color.js";import{getColorLuminance as e}from"../../core/colorUtils.js";import i from"../../core/Error.js";import{loadFont as o}from"../../core/fontUtils.js";import{pt2px as n}from"../../core/screenUtils.js";import{quantizePolygon as a,quantizePolyline as l}from"../../geometry/support/quantizationUtils.js";import{getFill as s,getStroke as r,getDashArray as h,getPatternUrlWithColor as c}from"./gfxUtils.js";import{SymbolSizeDefaults as m,shapes as u,adjustColorBrightness as p}from"./previewUtils.js";import{renderSymbol as d}from"./renderUtils.js";import{backgroundPadding as g}from"./textUtils.js";const f="picture-fill",y="picture-marker",w="simple-fill",x="simple-line",b="simple-marker",v="text",M="Aa",S=m.size,z=m.maxSize,k=m.maxOutlineSize,L=m.lineWidth,C=225,$=document.createElement("canvas");function j(t,e,i){if("polygon"===t.type){const o=t.extent,n=0===o.width?1:o.width,l=0===o.height?1:o.height;t=a({originPosition:"upperLeft",scale:[n/e,l/i],translate:[o.xmin,o.ymax]},{},t);let s="";for(let e=0;e<t.rings.length;e++){const i=t.rings[e];for(let t=0;t<i.length;t++){const e=i[t][0],o=i[t][1];let n="";0===t?(n=`M${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n):t===i.length-1?(n=`l${e.toString()} ${o.toString()} Z`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}if("polyline"===t.type){const o=t.extent,n=0===o.width?1:o.width,a=0===o.height?1:o.height;t=l({originPosition:"upperLeft",scale:[n/e,a/i],translate:[o.xmin,o.ymax]},{},t);let s="";for(let e=0;e<t.paths.length;e++){const i=t.paths[e];for(let t=0;t<i.length;t++){const e=i[t][0],o=i[t][1];let n="";0===t?(n=`M${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n):(n=`l${e.toString()} ${o.toString()}`,""!==s&&(n=` ${n}`),s+=n)}}return s}return""}function B(t,e){const i=$.getContext("2d"),o=[];e&&(e.weight&&o.push(e.weight),e.size&&o.push(e.size+"px"),e.family&&o.push(e.family)),i.font=o.join(" ");const{width:n,actualBoundingBoxLeft:a,actualBoundingBoxRight:l,actualBoundingBoxAscent:s,actualBoundingBoxDescent:r}=i.measureText(t);return{width:Math.ceil(Math.max(n,a+l)),height:Math.ceil(s+r),x:Math.floor(a),y:Math.floor((s-r)/2)}}function P(t){const e=t?.size;return{width:null!=e&&"object"==typeof e&&"width"in e?n(e.width):null,height:null!=e&&"object"==typeof e&&"height"in e?n(e.height):null}}async function U(t,e){const i=e.fill,o=t.color;if("pattern"===i?.type&&o&&t.type!==f){const t=await c(i.src,o.toCss(!0));i.src=t,e.fill=i}}async function A(t,e,i,n){if(!("font"in t)||!t.font||"text"!==e.shape.type)return;try{await o(t.font)}catch{}const{width:a,height:l}=P(n);if(!/[\uE600-\uE6FF]/.test(e.shape.text)){const{width:o,height:s,x:r,y:h}=B(e.shape.text,{weight:e.font?.weight,size:e.font?.size,family:e.font?.family});i[0]=a??o,i[1]=l??s,e.shape.x=r,e.shape.y=h;let c="angle"in t?t.angle:null;if(null!=n?.rotation&&(c=(c??0)+n.rotation),c){const t=c*(Math.PI/180),e=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t));i[1]=i[0]*e+i[1]*o}}}function E(t,e,i,o,a){if(null!=t.haloColor&&null!=t.haloSize){a.masking??=i.map((()=>[]));const l=n(t.haloSize);o[0]+=l,o[1]+=l,i.unshift([{...e,fill:null,stroke:{color:t.haloColor,width:2*l,join:"round",cap:"round"}}]),a.masking.unshift([{shape:{type:"rect",x:0,y:0,width:o[0]+2*g,height:o[1]+2*g},fill:[255,255,255],stroke:null},{...e,fill:[0,0,0,0],stroke:null}])}null==t.backgroundColor&&null==t.borderLineColor||(o[0]+=2*g,o[1]+=2*g,i.unshift([{shape:{type:"rect",x:0,y:0,width:o[0],height:o[1]},fill:t.backgroundColor,stroke:{color:t.borderLineColor,width:n(t.borderLineSize)}}]),a.masking?.unshift([]))}function F(t,e){return t>e?"dark":"light"}function Z(t,e){const i="number"==typeof e?.size?e?.size:null,o=null!=i?n(i):null,a=null!=e?.maxSize?n(e.maxSize):null;let l="angle"in t?t.angle:null;null!=e?.rotation&&(l=(l??0)+e.rotation);const c=s(t);let m=r(t);"dark"!==q(t,245)||e?.ignoreWhiteSymbols||(m={width:.75,...m,color:"#bdc3c7"});let p=null;const d={shape:null,fill:c,stroke:m,offset:[0,0]};m?.width&&(m.width=Math.min(m.width,k));const g=m?.width||0;let C=null!=e?.size&&(null==e?.scale||e?.scale),$=0,U=0,A=!1;switch(t.type){case b:{const i=t.style,{width:s,height:r}=P(e);let h=s===r&&null!=s?s:null!=o?o:Math.min(n(t.size),a||z);if(!0===e?.useMarkerSymbolSize&&null!==s&&null!==r){const e=Math.min(n(t.size),a||z);h=e>s&&e>r?Math.min(s,r):e}switch($=h,U=h,i){case"circle":d.shape={type:"circle",cx:0,cy:0,r:.5*h},C||($+=g,U+=g);break;case"cross":d.shape={type:"path",path:[{command:"M",values:[0,.5*U]},{command:"L",values:[$,.5*U]},{command:"M",values:[.5*$,0]},{command:"L",values:[.5*$,U]}]};break;case"diamond":d.shape={type:"path",path:[{command:"M",values:[0,.5*U]},{command:"L",values:[.5*$,0]},{command:"L",values:[$,.5*U]},{command:"L",values:[.5*$,U]},{command:"Z",values:[]}]},C||($+=g,U+=g);break;case"square":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"Z",values:[]}]},C||($+=g,U+=g),l&&(A=!0);break;case"triangle":d.shape={type:"path",path:[{command:"M",values:[.5*$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"Z",values:[]}]},C||($+=g,U+=g),l&&(A=!0);break;case"x":d.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,U]},{command:"M",values:[$,0]},{command:"L",values:[0,U]}]},l&&(A=!0);break;case"path":d.shape={type:"path",path:t.path||""},C||($+=g,U+=g),l&&(A=!0),C=!0}break}case x:{const{width:t,height:i}=P(e),n=h(m).reduce(((t,e)=>t+e),0),a=n&&Math.ceil(L/n),l=i??o??g,s=t??(n*a||L);if(C=!0,"polyline"===e?.geometry?.type&&e?.geometry?.extent){$=s,U=i??$;const t=1e3,o=.15*t;p=[$,U],U=p[0]>p[1]?t*p[1]/p[0]:t,$=p[0]>p[1]?t:t*p[0]/p[1],m?.width&&(m.width=m.width*t/(p[1]>p[0]?p[1]:p[0]),m.width>o&&(m.width=o)),d.shape={type:"path",path:j(e.geometry,$,U)}}else $=null!=e?.maxSize?Math.min(s,e.maxSize):s,U=l,m&&(m.width=l),d.shape={type:"path",path:[{command:"M",values:[l/2,U/2]},{command:"L",values:[$-l/2,U/2]}]};break}case f:case w:{const t="object"==typeof e?.symbolConfig&&!!e?.symbolConfig?.isSquareFill,{width:i,height:n}=P(e);$=!t&&i!==n||null==i?null!=o?o:S:i,U=!t&&i!==n||null==n?$:n,C||($+=g,U+=g),C=!0,e?.geometry?.extent&&"polygon"===e?.geometry?.type?(p=[$,U],U=p[0]>p[1]?1e3*p[1]/p[0]:1e3,$=p[0]>p[1]?1e3:1e3*p[0]/p[1],d.shape={type:"path",path:j(e.geometry,$,U)}):d.shape=t?{type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[$,0]},{command:"L",values:[$,U]},{command:"L",values:[0,U]},{command:"L",values:[0,0]},{command:"Z",values:[]}]}:u.fill[0];break}case y:{const i=Math.min(n(t.width),a||z),s=Math.min(n(t.height),a||z),{width:r,height:h}=P(e),c=r===h&&null!=r?r:null!=o?o:Math.max(i,s),m=t.width/t.height;$=m<=1?Math.ceil(c*m):c,U=m<=1?c:Math.ceil(c/m),d.shape={type:"image",x:-Math.round($/2),y:-Math.round(U/2),width:$,height:U,src:t.url||""},l&&(A=!0);break}case v:{const i=t,l=e?.overrideText||i.text||M,s=i.font,{width:r,height:h}=P(e),c=null!=h?h:null!=o?o:Math.min(n(s.size),a||z),{width:m,height:u}=B(l,{weight:s.weight,size:c,family:s.family}),p=/[\uE600-\uE6FF]/.test(l);$=r??(p?c:m),U=p?c:u;let g=.5*(p?c:u);p&&(g+=5),d.shape={type:"text",text:l,x:i.xoffset||0,y:i.yoffset||g,align:"middle",alignBaseline:i.verticalAlignment,decoration:s&&s.decoration,rotated:i.rotated,kerning:i.kerning},d.font=s&&{size:c,style:s.style,decoration:s.decoration,weight:s.weight,family:s.family};break}}return{shapeDescriptor:d,size:[$,U],outputSize:p,renderOptions:{node:e?.node,scale:C,opacity:e?.opacity,rotations:[l],useRotationSize:A,effectView:e?.effectView,ariaLabel:e?.ariaLabel}}}async function D(t,e){const{shapeDescriptor:o,size:n,renderOptions:a,outputSize:l}=Z(t,e);if(!o.shape)throw new i("symbolPreview: renderPreviewHTML2D","symbol not supported.");await U(t,o),await A(t,o,n,e);const s=[[o]];if("object"==typeof e?.symbolConfig&&e?.symbolConfig?.applyColorModulation){const t=.6*n[0];s.unshift([{...o,offset:[-t,0],fill:p(o.fill,-.3)}]),s.push([{...o,offset:[t,0],fill:p(o.fill,.3)}]),n[0]+=2*t,a.scale=!1}"text"===t.type&&E(t,o,s,n,a);const r=d(s,n,a);if(l&&r){const t="img"===r.nodeName.toLowerCase()?r:r.firstChild;"svg"===t.nodeName.toLowerCase()&&t.setAttribute("viewBox",`0 0 ${n[0].toString()} ${n[1].toString()}`),t.setAttribute("width",l[0].toString()),t.setAttribute("height",l[1].toString()),l.length>2&&(t.style.setProperty("padding-left",l[2]?.toString()+"px"),t.style.setProperty("padding-right",l[2]?.toString()+"px"),t.style.setProperty("padding-top",l[3]?.toString()+"px"),t.style.setProperty("padding-bottom",l[3]?.toString()+"px"),t.style.setProperty("box-sizing","border-box"))}return r}function q(i,o=C){const n=s(i),a=r(i),l=!n||"type"in n?null:new t(n),h=a?.color?new t(a?.color):null,c=l?F(e(l),o):null,m=h?F(e(h),o):null;return m?c?c===m?c:o>=C?"light":"dark":m:c}export{q as getContrastingBackgroundTheme,Z as getRenderSymbolParameters,D as previewSymbol2D};
@@ -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"../../../../../Color.js";import{getStartGroup as o,getRandomValue as t}from"../grouping.js";import{hydrate as i}from"./infos.js";import{instructions as r}from"./instructions.js";function n(e){return a(e.map((e=>f(e))).map((e=>i(e).simplify())))}function s(e){const o=[];return o.push(e.transform),o.push(e.fromColor),o.push(e.toColor),o.push(e.colorMix),o.push(e.toOpacity),o.push(e.opacityMix),o}function a(e){const o=[],t=[];let i=0;for(const n of e){const s=[...n.encode(),...r.ret.encode()];o.push([i+e.length,0,0,0]),t.push(...s),i+=s.length}return[...o,...t]}async function c(e,o){const t=e;let i;if("number"==typeof t||"string"==typeof t||"boolean"==typeof t)i=t;else if(Array.isArray(t))i=await Promise.all(t.map((e=>c(e,o))));else if("object"==typeof t)if("valueExpressionInfo"in t){const{valueExpressionInfo:e}=t,{expression:r}=e;i={...t,computed:await o.createComputedField({expression:r})}}else{i={};for(const e in t)i[e]=await c(t[e],o)}return i}function f(i,r,n){function s(o){if(!("computed"in o))return o;let t=o.computed.readWithDefault(r,n,[255*o.defaultValue[0],255*o.defaultValue[1],255*o.defaultValue[2],o.defaultValue[3]]);if("string"==typeof t){const o=e.fromString(t);o&&(t=[o.r,o.g,o.b,o.a])}return t}const a=i;let c;if("number"==typeof a||"string"==typeof a||"boolean"==typeof a)c=a;else if(Array.isArray(a))c=a.map((e=>f(e,r,n)));else if("object"==typeof a)if("type"in a&&null!=a.type&&"Process"===a.type)switch(a.op){case"ArcadeColor":{const e=f(a.value,r,n);p(Array.isArray(e)&&4===e.length);c=[e[0]/255,e[1]/255,e[2]/255,e[3]]}break;case"Transparency":{const e=f(a.value,r,n);p("number"==typeof e),c=1-e/100}break;case"Divide":case"Add":{const e=f(a.left,r,n);p("number"==typeof e);const o=f(a.right,r,n);switch(p("number"==typeof o),a.op){case"Divide":c=e/o;break;case"Add":c=e+o}}break;case"Random":{const e=f(a.seed,r,n),i=f(a.min,r,n),s=f(a.max,r,n),l=r.getObjectId(),p=o(l||0);c=i+t(p,e)*(s-i)}break;case"Cond":{const e=f(a.condition,r,n),o=f(a.ifTrue,r,n),t=f(a.ifFalse,r,n);c=e?o:t}}else if("computed"in a)c=s(a);else{c={};for(const e in a)c[e]=f(a[e],r,n)}return c}function*l(e){const o=e;if(Array.isArray(o))for(const t of o)yield*l(t);else if("object"==typeof o)if("type"in o&&null!=o.type&&"Process"===o.type)switch(o.op){case"ArcadeColor":case"Transparency":yield*l(o.value);break;case"Divide":case"Add":yield*l(o.left),yield*l(o.right);break;case"Random":yield*l(o.seed),yield*l(o.min),yield*l(o.max);break;case"Cond":yield*l(o.condition),yield*l(o.ifTrue),yield*l(o.ifFalse)}else if("computed"in o)yield o.computed;else for(const t in o)yield*l(o[t])}function p(e){if(!e)throw new Error("Assertion failed.")}export{p as assert,c as compileAnimationParam,s as createParamList,a as encodeParamList,n as fromJSON,l as getAnimationExpressions,f as resolveToAnimationInfo};
5
+ import e from"../../../../../Color.js";import{getStartGroup as o,getRandomValue as t}from"../grouping.js";import{hydrate as i}from"./infos.js";import{instructions as n}from"./instructions.js";function r(e){return a(e.map((e=>f(e))).map((e=>i(e).simplify())))}function s(e){const o=[];return o.push(e.transform),o.push(e.fromColor),o.push(e.toColor),o.push(e.colorMix),o.push(e.toOpacity),o.push(e.opacityMix),o}function a(e){const o=[],t=[];let i=0;for(const r of e){const s=[...r.encode(),...n.ret.encode()];o.push([i+e.length,0,0,0]),t.push(...s),i+=s.length}return[...o,...t]}async function c(e,o){const t=e;let i;if("number"==typeof t||"string"==typeof t||"boolean"==typeof t)i=t;else if(Array.isArray(t))i=await Promise.all(t.map((e=>c(e,o))));else if("object"==typeof t)if("valueExpressionInfo"in t){const{valueExpressionInfo:e}=t,{expression:n}=e;i={...t,computed:await o.createComputedField({expression:n})}}else{i={};for(const e in t)i[e]=await c(t[e],o)}return i}function f(i,n,r){function s(o){if(!("computed"in o))return o;let t=o.computed.readWithDefault(n,r,[255*o.defaultValue[0],255*o.defaultValue[1],255*o.defaultValue[2],o.defaultValue[3]]);if("string"==typeof t){const o=e.fromString(t);o&&(t=[o.r,o.g,o.b,o.a])}return t}const a=i;let c;if("number"==typeof a||"string"==typeof a||"boolean"==typeof a)c=a;else if(Array.isArray(a))c=a.map((e=>f(e,n,r)));else if("object"==typeof a)if("type"in a&&null!=a.type&&"Process"===a.type)switch(a.op){case"ArcadeColor":{const e=f(a.value,n,r);p(Array.isArray(e)&&4===e.length);c=[e[0]/255,e[1]/255,e[2]/255,e[3]]}break;case"Transparency":{const e=f(a.value,n,r);p("number"==typeof e),c=1-e/100}break;case"Divide":case"Add":{const e=f(a.left,n,r);p("number"==typeof e);const o=f(a.right,n,r);switch(p("number"==typeof o),a.op){case"Divide":c=e/o;break;case"Add":c=e+o}}break;case"Random":{const e=f(a.seed,n,r),i=f(a.min,n,r),s=f(a.max,n,r),l=n.getObjectId(),p=o(l||0);c=i+t(p,e)*(s-i)}break;case"Cond":{const e=f(a.condition,n,r),o=f(a.ifTrue,n,r),t=f(a.ifFalse,n,r);c=e?o:t}break;case"MatchWinding":{const e=f(a.sign,n,r);let o=f(a.angle,n,r);if(e>0)for(;o<0;)o+=2*Math.PI;else for(;o>0;)o-=2*Math.PI;c=o}}else if("computed"in a)c=s(a);else{c={};for(const e in a)c[e]=f(a[e],n,r)}return c}function*l(e){const o=e;if(Array.isArray(o))for(const t of o)yield*l(t);else if("object"==typeof o)if("type"in o&&null!=o.type&&"Process"===o.type)switch(o.op){case"ArcadeColor":case"Transparency":yield*l(o.value);break;case"Divide":case"Add":yield*l(o.left),yield*l(o.right);break;case"Random":yield*l(o.seed),yield*l(o.min),yield*l(o.max);break;case"Cond":yield*l(o.condition),yield*l(o.ifTrue),yield*l(o.ifFalse);break;case"MatchWinding":yield*l(o.sign),yield*l(o.angle)}else if("computed"in o)yield o.computed;else for(const t in o)yield*l(o[t])}function p(e){if(!e)throw new Error("Assertion failed.")}export{p as assert,c as compileAnimationParam,s as createParamList,a as encodeParamList,r as fromJSON,l as getAnimationExpressions,f as resolveToAnimationInfo};
@@ -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"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{numericHash as r}from"../../../../../core/string.js";import{Float as o,Int as n,Vec4 as s,Vec2 as i}from"./graph/glsl.js";import{GlslShaderWriter as p}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as a}from"./graph/ShaderGraphContext.js";import{setReachableUids as u}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as c}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as y}from"../../../../webgl/ShaderBuilder.js";function d(t){return new t}function h(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function f(t,e){return(r,o)=>{h(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const l=t=>(e,r)=>{h(e,"builtins",{builtin:t,propertyKey:r})},m=t=>(e,r,o)=>{h(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},g=t=>(e,r)=>{h(e,"uniforms",{typeCtor:t,propertyKey:r})},_=t=>(e,r)=>{h(e,"options",{typeCtor:t,propertyKey:r})},K=(t,e)=>{h(t,"defines",{propertyKey:e})};function x(t){return(e,r)=>{h(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const b=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class C{static{this.builtins=[]}}t([b("gl_VertexID",n)],C.prototype,"glVertexID",void 0);class I{}class v{static{this.builtins=[]}}t([b("gl_FragCoord",s)],v.prototype,"glFragCoord",void 0),t([b("gl_PointCoord",i)],v.prototype,"glPointCoord",void 0);class w{}t([l("gl_FragDepth")],w.prototype,"glFragDepth",void 0);class P{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class j{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&0===t.parameterIndex));if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&1===t.parameterIndex))}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"fragment"===t.propertyKey));if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map((([t,e])=>`${t}.${e}`)).join("."),o=r(e),n=this.computeAttributes;this._locationInfo={hash:o,stringHash:e,locations:t,computeAttributeMap:n}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new c(n,s,this.renamedLocationsMap,this.locationInfo,i,this.transformFeedbackBindings)}catch(n){return new c("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find((e=>e.propertyKey===t));if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find((e=>e.propertyKey===t));if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map((e=>`${e}.${t[e]}`)).join("."),s=Object.keys(r).map((t=>`${t}.${r[t]}`)).join("."),i=Object.keys(o).map((t=>`${t}.${o[t]}`)).join("."),p=Object.keys(e).filter((t=>this.optionPropertyKeys.has(t)&&e[t])).join(".");return`${this.constructor.name}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),i=this._injectPackPrecisionFactor(s,t),c=this._hydrateComputeInput(),y=c&&this._injectComputePackPrecisionFactor(c,t),d=this.vertex(i,y),h=this._hydrateFragmentInput(d),f=this.fragment(h),l=new Set;for(const p in f){const t=f[p];u(l,t)}const m=this._getVertexInputBuiltins(),g=a.createVertex({...s,...c},d,m,n,this.transformFeedbackBindings,l);(new p).write(g);const _=this._getFragmentInputBuiltins(f);_.set("glPointCoord","gl_PointCoord");const K=a.createFragment(h,f,_,n,g,this.transformFeedbackBindings);(new p).write(K);const x=this._createShaderBuilder(g,K),b=x.generate("vertex"),C=x.generate("fragment");return this.logShader&&(console.log(b),console.log(C)),{vertex:b,fragment:C,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=d(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce(((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:d(r.typeCtor)}),{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=d(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce(((t,e)=>({...t,[e.propertyKey]:d(e.typeCtor)})),{})}_injectPackPrecisionFactor(t,e){const r={};for(const n in t){const s=t[n],i=e[n];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[n]=s.divide(new o(i))}else r[n]=s}return r}_injectComputePackPrecisionFactor(t,e){const r={},n=new Map;for(const o in this.computeAttributes)for(const t of this.computeAttributes[o]??[])n.set(t,o);for(const s in t){const i=t[s],p=n.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[s]=i.divide(new o(a))}else r[s]=i}return r}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of v.builtins){const t=d(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new y;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{I as ComputeVertexInput,v as FragmentInput,w as FragmentOutput,j as GraphShaderModule,P as UniformGroup,C as VertexInput,l as builtin,K as define,m as input,f as location,_ as option,x as transformFeedback,g as uniform};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{numericHash as r}from"../../../../../core/string.js";import{Float as o,Int as n,Vec4 as s,Vec2 as i}from"./graph/glsl.js";import{GlslShaderWriter as p}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as a}from"./graph/ShaderGraphContext.js";import{setReachableUids as u}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as c}from"./typed/TypedShaderProgram.js";import{ShaderBuilder as y}from"../../../../webgl/ShaderBuilder.js";function d(t){return new t}function h(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function f(t,e){return(r,o)=>{h(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const l=t=>(e,r)=>{h(e,"builtins",{builtin:t,propertyKey:r})},m=t=>(e,r,o)=>{h(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},g=t=>(e,r)=>{h(e,"uniforms",{typeCtor:t,propertyKey:r})},_=t=>(e,r)=>{h(e,"options",{typeCtor:t,propertyKey:r})},K=(t,e)=>{h(t,"defines",{propertyKey:e})};function x(t){return(e,r)=>{h(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const b=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class C{static{this.builtins=[]}}t([b("gl_VertexID",n)],C.prototype,"glVertexID",void 0);class I{}class v{static{this.builtins=[]}}t([b("gl_FragCoord",s)],v.prototype,"glFragCoord",void 0),t([b("gl_PointCoord",i)],v.prototype,"glPointCoord",void 0);class w{}t([l("gl_FragDepth")],w.prototype,"glFragDepth",void 0);class P{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class j{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&0===t.parameterIndex));if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&1===t.parameterIndex))}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"fragment"===t.propertyKey));if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map((([t,e])=>`${t}.${e}`)).join("."),o=r(e),n=this.computeAttributes;this._locationInfo={hash:o,stringHash:e,locations:t,computeAttributeMap:n}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new c(n,s,this.renamedLocationsMap,this.locationInfo,i,this.transformFeedbackBindings)}catch(n){return new c("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find((e=>e.propertyKey===t));if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find((e=>e.propertyKey===t));if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map((e=>`${e}.${t[e]}`)).join("."),s=Object.keys(r).map((t=>`${t}.${r[t]}`)).join("."),i=Object.keys(o).map((t=>`${t}.${o[t]}`)).join("."),p=Object.keys(e).filter((t=>this.optionPropertyKeys.has(t)&&e[t])).join(".");return`${this.type}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),i=this._injectPackPrecisionFactor(s,t),c=this._hydrateComputeInput(),y=c&&this._injectComputePackPrecisionFactor(c,t),d=this.vertex(i,y),h=this._hydrateFragmentInput(d),f=this.fragment(h),l=new Set;for(const p in f){const t=f[p];u(l,t)}const m=this._getVertexInputBuiltins(),g=a.createVertex({...s,...c},d,m,n,this.transformFeedbackBindings,l);(new p).write(g);const _=this._getFragmentInputBuiltins(f);_.set("glPointCoord","gl_PointCoord");const K=a.createFragment(h,f,_,n,g,this.transformFeedbackBindings);(new p).write(K);const x=this._createShaderBuilder(g,K),b=x.generate("vertex"),C=x.generate("fragment");return this.logShader&&(console.log(b),console.log(C)),{vertex:b,fragment:C,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=d(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce(((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:d(r.typeCtor)}),{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=d(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce(((t,e)=>({...t,[e.propertyKey]:d(e.typeCtor)})),{})}_injectPackPrecisionFactor(t,e){const r={};for(const n in t){const s=t[n],i=e[n];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[n]=s.divide(new o(i))}else r[n]=s}return r}_injectComputePackPrecisionFactor(t,e){const r={},n=new Map;for(const o in this.computeAttributes)for(const t of this.computeAttributes[o]??[])n.set(t,o);for(const s in t){const i=t[s],p=n.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[s]=i.divide(new o(a))}else r[s]=i}return r}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of v.builtins){const t=d(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new y;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{I as ComputeVertexInput,v as FragmentInput,w as FragmentOutput,j as GraphShaderModule,P as UniformGroup,C as VertexInput,l as builtin,K as define,m as input,f as location,_ as option,x as transformFeedback,g as uniform};
@@ -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,a as e}from"../../../../../../../chunks/tslib.es6.js";import{animationDebugFlags as i}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{location as s,ComputeVertexInput as o,input as r}from"../../GraphShaderModule.js";import{cond as l,Float as a,equal as n,Mat2 as d,cos as m,sin as u,Vec4 as p,or as h,Bool as c,mix as x,Mat3 as y,ifElse as v,lessThan as f,Vec3 as w,distance as b,greaterThan as S,Vec2 as g,negate as z,step as P}from"../../graph/glsl.js";import{AAnimatedVertexInput as _,AAnimatedFragmentInput as V,AAnimatedShader as C,getValue as N}from"./AnimatedShader.js";import{AnimationParamIndex as M}from"./enums.js";import{MarkerConstants as k}from"../markers/markerConstants.js";import{c256ToRad as D}from"../shaders/constants.js";import{distPointTriangle as j,xyToBarycentric as F,inTriangle as R,failHittest as U}from"../shaders/hittestUtils.js";import{getBit as T,getBitBool as q}from"../shaders/utils.js";import{getVisualVariableSize as A,getVisualVariableColor as I,getVisualVariableOpacity as O}from"../shaders/vvUtils.js";class W extends _{}t([s(5,g)],W.prototype,"offset",void 0),t([s(6,g)],W.prototype,"uv",void 0),t([s(7,p)],W.prototype,"sizing",void 0),t([s(8,a)],W.prototype,"angle",void 0);class B extends o{}t([s(12,g)],B.prototype,"offsetNextVertex1",void 0),t([s(13,g)],B.prototype,"offsetNextVertex2",void 0),t([s(14,g)],B.prototype,"textureUVNextVertex1",void 0),t([s(15,g)],B.prototype,"textureUVNextVertex2",void 0);class E extends V{}function G(t,e,i,s){return e.multiply(t.x).add(i.multiply(t.y)).add(s.multiply(t.z))}class H extends C{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}_vertexPreamble(t){const{id:e,pos:i,offset:s,animationPointerAndBaseSizeAndReferenceSize:o,uv:r,sizing:p,angle:h}=t,c=o.xy,x=o.z,y=o.w,v=p.xy,f=p.z,w=T(t.bitset,k.bitset.isStroke),b=p.w,S=T(t.bitset,k.bitset.scaleSymbolsProportionally),g=this._getEvalParams(t,v),z=N(c,M.transform,g),P=l([n(T(t.bitset,k.bitset.isMapAligned),new a(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new a(0)]),_=new d(m(P),u(P.multiply(-1)),u(P),m(P)).multiply(z.xy),V=z.z.subtract(P).subtract(h.multiply(D)),C=z.w,j=T(t.bitset,k.bitset.isSDF),F=A(this,e,new a(y)).divide(new a(y));return{baseSize:x,animationPointer:c,strokeWidth:f,isOutline:w,unscaledDistanceToPx:b,scaleSymbolsProportionally:S,isSDF:j,position:this._getScreenPosition({id:e,pos:i,offset:s,referenceSize:y,translation:_,rotation:V,scale:C,vvScale:F}),uv:r,evalParams:g,vvScale:F,scale:C}}vertex(t,e){const{position:i,animationPointer:s,evalParams:o,isOutline:r,unscaledDistanceToPx:l,vvScale:n,uv:d,strokeWidth:m,scaleSymbolsProportionally:u,scale:v,isSDF:f,baseSize:w}=this._vertexPreamble(t),b=this._toNdc(i);let S=N(s,M.fromColor,o);S=new p(S.rgb.multiply(S.a),S.a);let g=N(s,M.toColor,o);g=new p(g.rgb.multiply(g.a),g.a);let z=N(s,M.colorMix,o);z=new p(z.rgb.multiply(z.a),z.a);const P=N(s,M.toOpacity,o).a,_=N(s,M.opacityMix,o).a,V=I(this,t.id,S,h(q(t.bitset,k.bitset.colorLocked),new c(r))),C=x(V,g,z),D=O(this,t.id),j=x(D,P,_),F=C.multiply(j),R=this.clip(t.id,t.zoomRange),U=l.multiply(n);return{glPosition:new p(b,R,1),uv:d.divide(this.mosaicInfo.size),color:F.multiply(new a(1).subtract(r)),outlineColor:F.multiply(r),distanceToPx:U,strokeWidth:m.multiply(x(new a(1),v,u)),isOutline:r,isSDF:f,...this.maybeRunHittest(t,e,{pos:t.pos,size:w,sizeCorrection:new a(1),isMapAligned:new a(1),vvRotationMat3:new y(1,0,0,0,1,0,0,0,1),placementMat3:new y(1,0,0,0,1,0,0,0,1),outlineSize:new a(1),distanceToPx:U,isSDF:f})}}fragment(t){let e=this._getColor(t.uv,{color:t.color,distanceToPx:t.distanceToPx,isSDF:t.isSDF,outlineColor:t.outlineColor,outlineSize:t.strokeWidth});return i.spotlightAnimatedSymbols&&(e=e.add(new p(0,.3,0,.3))),this.getFragmentOutput(e,t)}hittest(t,e,i){return v(f(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i))}_hittestSmallMarker(t,e,i){const{position:s,distance:o,smallSymbolDistance:r}=this.hittestRequest,l=o.subtract(r),{viewMat3:a,tileMat3:n}=this.view,d=a.multiply(n).multiply(new w(i.pos,1)).xy,m=i.size.multiply(.5);return b(d,s).subtract(m).add(l)}_hittestMarker(t,e,i){const s=this._vertexPreamble({...t}).position,o=this._vertexPreamble({...t,offset:e.offsetNextVertex1,uv:e.textureUVNextVertex1}).position,r=this._vertexPreamble({...t,offset:e.offsetNextVertex2,uv:e.textureUVNextVertex2}).position,l=this.hittestRequest.position,a=this.hittestRequest.distance,n=j(l,s,o,r);return v(S(n,a),n,this._hittestSamples(s,o,r,t,e,i))}_hittestSamples(t,e,i,s,o,r){const{outlineSize:l,isSDF:n,distanceToPx:d}=r,m=this.hittestRequest.position,u=this.hittestRequest.distance,h=F(m.add(new g(z(u),z(u))),t,e,i),c=F(m.add(new g(0,z(u))),t,e,i),x=F(m.add(new g(u,z(u))),t,e,i),y=F(m.add(new g(z(u),0)),t,e,i),v=F(m,t,e,i),f=F(m.add(new g(u,0)),t,e,i),w=F(m.add(new g(z(u),u)),t,e,i),b=F(m.add(new g(0,u)),t,e,i),S=F(m.add(new g(u,u)),t,e,i),_=s.uv.divide(this.mosaicInfo.size),V=o.textureUVNextVertex1.divide(this.mosaicInfo.size),C=o.textureUVNextVertex2.divide(this.mosaicInfo.size),N={color:new p(1,1,1,1),outlineSize:l,outlineColor:new p(1,1,1,1),isSDF:n,distanceToPx:d};let M=new a(0);return M=M.add(R(h).multiply(this._getColor(G(h,_,V,C),N).a)),M=M.add(R(c).multiply(this._getColor(G(c,_,V,C),N).a)),M=M.add(R(x).multiply(this._getColor(G(x,_,V,C),N).a)),M=M.add(R(y).multiply(this._getColor(G(y,_,V,C),N).a)),M=M.add(R(v).multiply(this._getColor(G(v,_,V,C),N).a)),M=M.add(R(f).multiply(this._getColor(G(f,_,V,C),N).a)),M=M.add(R(w).multiply(this._getColor(G(w,_,V,C),N).a)),M=M.add(R(b).multiply(this._getColor(G(b,_,V,C),N).a)),M=M.add(R(S).multiply(this._getColor(G(S,_,V,C),N).a)),P(M,new a(.05)).multiply(U(this.hittestRequest))}}t([e(0,r(W)),e(1,r(B))],H.prototype,"vertex",null),t([e(0,r(E))],H.prototype,"fragment",null);export{E as AnimatedMarkerFragmentInput,H as AnimatedMarkerShader,W as AnimatedMarkerVertexInput};
5
+ import{_ as t,a as e}from"../../../../../../../chunks/tslib.es6.js";import{animationDebugFlags as i}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{location as s,ComputeVertexInput as o,input as r}from"../../GraphShaderModule.js";import{cond as l,Float as a,equal as n,Mat2 as d,cos as m,sin as u,Vec4 as p,or as h,Bool as c,mix as x,Mat3 as y,ifElse as v,lessThan as f,Vec3 as w,distance as S,greaterThan as b,Vec2 as g,negate as z,step as P}from"../../graph/glsl.js";import{AAnimatedVertexInput as _,AAnimatedFragmentInput as V,AAnimatedShader as C,getValue as M}from"./AnimatedShader.js";import{AnimationParamIndex as N}from"./enums.js";import{MarkerConstants as k}from"../markers/markerConstants.js";import{c256ToRad as D}from"../shaders/constants.js";import{distPointTriangle as j,xyToBarycentric as F,inTriangle as R,failHittest as U}from"../shaders/hittestUtils.js";import{getBit as T,getBitBool as A}from"../shaders/utils.js";import{getVisualVariableSize as q,getVisualVariableColor as I,getVisualVariableOpacity as O}from"../shaders/vvUtils.js";class W extends _{}t([s(5,g)],W.prototype,"offset",void 0),t([s(6,g)],W.prototype,"uv",void 0),t([s(7,p)],W.prototype,"sizing",void 0),t([s(8,a)],W.prototype,"angle",void 0);class B extends o{}t([s(12,g)],B.prototype,"offsetNextVertex1",void 0),t([s(13,g)],B.prototype,"offsetNextVertex2",void 0),t([s(14,g)],B.prototype,"textureUVNextVertex1",void 0),t([s(15,g)],B.prototype,"textureUVNextVertex2",void 0);class E extends V{}function G(t,e,i,s){return e.multiply(t.x).add(i.multiply(t.y)).add(s.multiply(t.z))}class H extends C{constructor(){super(...arguments),this.type="AnimatedMarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}_vertexPreamble(t){const{id:e,pos:i,offset:s,animationPointerAndBaseSizeAndReferenceSize:o,uv:r,sizing:p,angle:h}=t,c=o.xy,x=o.z,y=o.w,v=p.xy,f=p.z,w=T(t.bitset,k.bitset.isStroke),S=p.w,b=T(t.bitset,k.bitset.scaleSymbolsProportionally),g=this._getEvalParams(t,v),z=M(c,N.transform,g),P=l([n(T(t.bitset,k.bitset.isMapAligned),new a(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new a(0)]),_=new d(m(P),u(P.multiply(-1)),u(P),m(P)).multiply(z.xy),V=z.z.subtract(P).subtract(h.multiply(D)),C=z.w,j=T(t.bitset,k.bitset.isSDF),F=q(this,e,new a(y)).divide(new a(y));return{baseSize:x,animationPointer:c,strokeWidth:f,isOutline:w,unscaledDistanceToPx:S,scaleSymbolsProportionally:b,isSDF:j,position:this._getScreenPosition({id:e,pos:i,offset:s,referenceSize:y,translation:_,rotation:V,scale:C,vvScale:F}),uv:r,evalParams:g,vvScale:F,scale:C}}vertex(t,e){const{position:i,animationPointer:s,evalParams:o,isOutline:r,unscaledDistanceToPx:l,vvScale:n,uv:d,strokeWidth:m,scaleSymbolsProportionally:u,scale:v,isSDF:f,baseSize:w}=this._vertexPreamble(t),S=this._toNdc(i);let b=M(s,N.fromColor,o);b=new p(b.rgb.multiply(b.a),b.a);let g=M(s,N.toColor,o);g=new p(g.rgb.multiply(g.a),g.a);let z=M(s,N.colorMix,o);z=new p(z.rgb.multiply(z.a),z.a);const P=M(s,N.toOpacity,o).a,_=M(s,N.opacityMix,o).a,V=I(this,t.id,b,h(A(t.bitset,k.bitset.colorLocked),new c(r))),C=x(V,g,z),D=O(this,t.id),j=x(D,P,_),F=C.multiply(j),R=this.clip(t.id,t.zoomRange),U=l.multiply(n);return{glPosition:new p(S,R,1),uv:d.divide(this.mosaicInfo.size),color:F.multiply(new a(1).subtract(r)),outlineColor:F.multiply(r),distanceToPx:U,strokeWidth:m.multiply(x(new a(1),v,u)),isOutline:r,isSDF:f,...this.maybeRunHittest(t,e,{pos:t.pos,size:w,sizeCorrection:new a(1),isMapAligned:new a(1),vvRotationMat3:new y(1,0,0,0,1,0,0,0,1),placementMat3:new y(1,0,0,0,1,0,0,0,1),outlineSize:new a(1),distanceToPx:U,isSDF:f})}}fragment(t){let e=this._getColor(t.uv,{color:t.color,distanceToPx:t.distanceToPx,isSDF:t.isSDF,outlineColor:t.outlineColor,outlineSize:t.strokeWidth});return i.spotlightAnimatedSymbols&&(e=e.add(new p(0,.3,0,.3))),this.getFragmentOutput(e,t)}hittest(t,e,i){return v(f(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i))}_hittestSmallMarker(t,e,i){const{position:s,distance:o,smallSymbolDistance:r}=this.hittestRequest,l=o.subtract(r),{viewMat3:a,tileMat3:n}=this.view,d=a.multiply(n).multiply(new w(i.pos,1)).xy,m=i.size.multiply(.5);return S(d,s).subtract(m).add(l)}_hittestMarker(t,e,i){const s=this._vertexPreamble({...t}).position,o=this._vertexPreamble({...t,offset:e.offsetNextVertex1,uv:e.textureUVNextVertex1}).position,r=this._vertexPreamble({...t,offset:e.offsetNextVertex2,uv:e.textureUVNextVertex2}).position,l=this.hittestRequest.position,a=this.hittestRequest.distance,n=j(l,s,o,r);return v(b(n,a),n,this._hittestSamples(s,o,r,t,e,i))}_hittestSamples(t,e,i,s,o,r){const{outlineSize:l,isSDF:n,distanceToPx:d}=r,m=this.hittestRequest.position,u=this.hittestRequest.distance,h=F(m.add(new g(z(u),z(u))),t,e,i),c=F(m.add(new g(0,z(u))),t,e,i),x=F(m.add(new g(u,z(u))),t,e,i),y=F(m.add(new g(z(u),0)),t,e,i),v=F(m,t,e,i),f=F(m.add(new g(u,0)),t,e,i),w=F(m.add(new g(z(u),u)),t,e,i),S=F(m.add(new g(0,u)),t,e,i),b=F(m.add(new g(u,u)),t,e,i),_=s.uv.divide(this.mosaicInfo.size),V=o.textureUVNextVertex1.divide(this.mosaicInfo.size),C=o.textureUVNextVertex2.divide(this.mosaicInfo.size),M={color:new p(1,1,1,1),outlineSize:l,outlineColor:new p(1,1,1,1),isSDF:n,distanceToPx:d};let N=new a(0);return N=N.add(R(h).multiply(this._getColor(G(h,_,V,C),M).a)),N=N.add(R(c).multiply(this._getColor(G(c,_,V,C),M).a)),N=N.add(R(x).multiply(this._getColor(G(x,_,V,C),M).a)),N=N.add(R(y).multiply(this._getColor(G(y,_,V,C),M).a)),N=N.add(R(v).multiply(this._getColor(G(v,_,V,C),M).a)),N=N.add(R(f).multiply(this._getColor(G(f,_,V,C),M).a)),N=N.add(R(w).multiply(this._getColor(G(w,_,V,C),M).a)),N=N.add(R(S).multiply(this._getColor(G(S,_,V,C),M).a)),N=N.add(R(b).multiply(this._getColor(G(b,_,V,C),M).a)),P(N,new a(.05)).multiply(U(this.hittestRequest))}}t([e(0,r(W)),e(1,r(B))],H.prototype,"vertex",null),t([e(0,r(E))],H.prototype,"fragment",null);export{E as AnimatedMarkerFragmentInput,H as AnimatedMarkerShader,W as AnimatedMarkerVertexInput};
@@ -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,a as o}from"../../../../../../../chunks/tslib.es6.js";import{tileSize as e}from"../../../definitions.js";import{VertexInput as i,location as s,UniformGroup as r,uniform as d,GraphShaderModule as n,FragmentOutput as a,input as l}from"../../GraphShaderModule.js";import{Mat3 as p,Vec3 as m,texture2D as c,max as y,Float as v,step as w,Vec4 as u,length as h,smoothstep as x,Vec2 as f,Sampler2D as g}from"../../graph/glsl.js";import{FeatureFragmentInput as S}from"../shaders/AFeatureShader.js";import{ViewInfo as j}from"../shaders/ViewInfo.js";class z extends i{}t([s(0,f)],z.prototype,"pos",void 0);class R extends S{}class b extends r{}t([d(v)],b.prototype,"dotSize",void 0);class F extends r{}t([d(g)],F.prototype,"locations",void 0),t([d(v)],F.prototype,"pixelRatio",void 0),t([d(v)],F.prototype,"tileZoomFactor",void 0);const P=1e-6;class C extends n{vertex(t){const o=new p(1,0,0,0,-1,0,0,1,1).multiply(new m(t.pos.xy.divide(e),1)),i=c(this.draw.locations,o.xy),s=y(this.instance.dotSize.divide(2),new v(1));let r=new v(0);r=r.add(w(i.a,new v(P)).multiply(2));let d=s.add(this.instance.dotSize);const n=this.view.displayViewScreenMat3.multiply(new m(t.pos.add(.5),1)),a=new u(n.xy,r,1),l=this.instance.dotSize.divide(d),h=new v(-1).divide(s.divide(d));return d=d.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:a,glPointSize:d,color:i,ratio:l,invEdgeRatio:h}}fragment(t){const o=h(t.glPointCoord.subtract(.5)).multiply(2),e=x(new v(0),new v(1),t.invEdgeRatio.multiply(o.subtract(t.ratio)).add(1)),i=new a;return i.fragColor=t.color.multiply(e),i}}t([d(b)],C.prototype,"instance",void 0),t([d(F)],C.prototype,"draw",void 0),t([d(j)],C.prototype,"view",void 0),t([o(0,l(z))],C.prototype,"vertex",null),t([o(0,l(R))],C.prototype,"fragment",null);export{F as DotDensityPointDrawUniforms,R as DotDensityPointFragmentInput,b as DotDensityPointInstanceUniforms,C as DotDensityPointShader,z as DotDensityPointVertexInput};
5
+ import{_ as t,a as o}from"../../../../../../../chunks/tslib.es6.js";import{tileSize as e}from"../../../definitions.js";import{VertexInput as i,location as s,UniformGroup as r,uniform as d,GraphShaderModule as n,FragmentOutput as a,input as p}from"../../GraphShaderModule.js";import{Mat3 as l,Vec3 as c,texture2D as m,max as y,Float as u,step as v,Vec4 as w,length as h,smoothstep as x,Vec2 as f,Sampler2D as g}from"../../graph/glsl.js";import{FeatureFragmentInput as S}from"../shaders/AFeatureShader.js";import{ViewInfo as j}from"../shaders/ViewInfo.js";class z extends i{}t([s(0,f)],z.prototype,"pos",void 0);class P extends S{}class R extends r{}t([d(u)],R.prototype,"dotSize",void 0);class b extends r{}t([d(g)],b.prototype,"locations",void 0),t([d(u)],b.prototype,"pixelRatio",void 0),t([d(u)],b.prototype,"tileZoomFactor",void 0);const F=1e-6;class C extends n{constructor(){super(...arguments),this.type="DotDensityPointShader"}vertex(t){const o=new l(1,0,0,0,-1,0,0,1,1).multiply(new c(t.pos.xy.divide(e),1)),i=m(this.draw.locations,o.xy),s=y(this.instance.dotSize.divide(2),new u(1));let r=new u(0);r=r.add(v(i.a,new u(F)).multiply(2));let d=s.add(this.instance.dotSize);const n=this.view.displayViewScreenMat3.multiply(new c(t.pos.add(.5),1)),a=new w(n.xy,r,1),p=this.instance.dotSize.divide(d),h=new u(-1).divide(s.divide(d));return d=d.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:a,glPointSize:d,color:i,ratio:p,invEdgeRatio:h}}fragment(t){const o=h(t.glPointCoord.subtract(.5)).multiply(2),e=x(new u(0),new u(1),t.invEdgeRatio.multiply(o.subtract(t.ratio)).add(1)),i=new a;return i.fragColor=t.color.multiply(e),i}}t([d(R)],C.prototype,"instance",void 0),t([d(b)],C.prototype,"draw",void 0),t([d(j)],C.prototype,"view",void 0),t([o(0,p(z))],C.prototype,"vertex",null),t([o(0,p(P))],C.prototype,"fragment",null);export{b as DotDensityPointDrawUniforms,P as DotDensityPointFragmentInput,R as DotDensityPointInstanceUniforms,C as DotDensityPointShader,z as DotDensityPointVertexInput};
@@ -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,a as e}from"../../../../../../../chunks/tslib.es6.js";import{tileSize as o}from"../../../definitions.js";import{uniform as s,location as i,UniformGroup as r,define as l,FragmentOutput as d,input as a}from"../../GraphShaderModule.js";import{FixedArray as n,Vec4 as p,Mat3 as h,Vec3 as c,texture2D as u,Mat4 as m,step as y,Float as v,dot as w,max as x,Sampler2D as f}from"../../graph/glsl.js";import{FeatureVertexInput as g,FeatureFragmentInput as A,AFeatureShader as T}from"../shaders/AFeatureShader.js";import{failHittest as b}from"../shaders/hittestUtils.js";import{max4 as j}from"../shaders/utils.js";class D extends g{}t([i(3,v)],D.prototype,"inverseArea",void 0);class C extends A{}class V extends r{}t([s(n.ofType(p,2))],V.prototype,"isActive",void 0),t([s(n.ofType(p,8))],V.prototype,"colors",void 0),t([s(v)],V.prototype,"dotValue",void 0);class _ extends r{}t([s(f)],_.prototype,"dotTexture0",void 0),t([s(f)],_.prototype,"dotTexture1",void 0),t([s(v)],_.prototype,"tileZoomFactor",void 0),t([s(v)],_.prototype,"pixelRatio",void 0),t([s(v)],_.prototype,"tileDotsOverArea",void 0);class F extends T{_dotThreshold(t,e,o){return t.divide(e).divide(o)}vertex(t){const e=new h(2/o,0,0,0,-2/o,0,-1,1,1).multiply(new c(t.pos,1)),s=this.clip(t.id),i=new p(e.xy,s,1),r=this.storage.getVVData(t.id).multiply(this.instance.isActive.get(0)).multiply(t.inverseArea),l=this.storage.getDataDrivenData0(t.id).multiply(this.instance.isActive.get(1)).multiply(t.inverseArea),d=this.draw.tileZoomFactor.multiply(o).divide(this.draw.pixelRatio),a=this._dotThreshold(r,this.instance.dotValue,this.draw.tileDotsOverArea),n=this._dotThreshold(l,this.instance.dotValue,this.draw.tileDotsOverArea),u=t.pos.add(.5).divide(d);return{glPosition:i,color:new p(0,0,0,0),textureCoords:u,thresholds0:a,thresholds1:n}}fragment(t){const e=new d,o=u(this.draw.dotTexture0,t.textureCoords),s=u(this.draw.dotTexture1,t.textureCoords),i=t.thresholds0.subtract(o),r=t.thresholds1.subtract(s);let l;const a=m.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),n=m.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const t=y(new v(0),i),e=y(new v(0),r),o=w(t,i).add(w(e,r)),s=y(o,new v(0)),d=new v(1).subtract(s),p=o.add(s),h=i.multiply(t).divide(p),c=r.multiply(e).divide(p),u=a.multiply(h).add(n.multiply(c));l=d.multiply(u)}else{const t=x(j(i),j(r)),e=y(t,new v(0)),o=new v(1).subtract(e),s=y(t,i),d=y(t,r),p=a.multiply(s).add(n.multiply(d));l=o.multiply(p)}return e.fragColor=l,e}hittest(t){return b(this.hittestRequest)}}t([l],F.prototype,"blending",void 0),t([s(V)],F.prototype,"instance",void 0),t([s(_)],F.prototype,"draw",void 0),t([e(0,a(D))],F.prototype,"vertex",null),t([e(0,a(A))],F.prototype,"fragment",null);export{_ as DotDensityPolygonDrawUniforms,C as DotDensityPolygonFragmentInput,V as DotDensityPolygonInstanceUniforms,F as DotDensityPolygonShader,D as DotDensityPolygonVertexInput};
5
+ import{_ as t,a as e}from"../../../../../../../chunks/tslib.es6.js";import{tileSize as o}from"../../../definitions.js";import{uniform as s,location as i,UniformGroup as r,define as l,FragmentOutput as d,input as n}from"../../GraphShaderModule.js";import{FixedArray as a,Vec4 as p,Mat3 as h,Vec3 as c,texture2D as u,Mat4 as m,step as y,Float as v,dot as w,max as x,Sampler2D as f}from"../../graph/glsl.js";import{FeatureVertexInput as g,FeatureFragmentInput as A,AFeatureShader as D}from"../shaders/AFeatureShader.js";import{failHittest as T}from"../shaders/hittestUtils.js";import{max4 as b}from"../shaders/utils.js";class j extends g{}t([i(3,v)],j.prototype,"inverseArea",void 0);class C extends A{}class V extends r{}t([s(a.ofType(p,2))],V.prototype,"isActive",void 0),t([s(a.ofType(p,8))],V.prototype,"colors",void 0),t([s(v)],V.prototype,"dotValue",void 0);class _ extends r{}t([s(f)],_.prototype,"dotTexture0",void 0),t([s(f)],_.prototype,"dotTexture1",void 0),t([s(v)],_.prototype,"tileZoomFactor",void 0),t([s(v)],_.prototype,"pixelRatio",void 0),t([s(v)],_.prototype,"tileDotsOverArea",void 0);class F extends D{constructor(){super(...arguments),this.type="DotDensityPolygonShader"}_dotThreshold(t,e,o){return t.divide(e).divide(o)}vertex(t){const e=new h(2/o,0,0,0,-2/o,0,-1,1,1).multiply(new c(t.pos,1)),s=this.clip(t.id),i=new p(e.xy,s,1),r=this.storage.getVVData(t.id).multiply(this.instance.isActive.get(0)).multiply(t.inverseArea),l=this.storage.getDataDrivenData0(t.id).multiply(this.instance.isActive.get(1)).multiply(t.inverseArea),d=this.draw.tileZoomFactor.multiply(o).divide(this.draw.pixelRatio),n=this._dotThreshold(r,this.instance.dotValue,this.draw.tileDotsOverArea),a=this._dotThreshold(l,this.instance.dotValue,this.draw.tileDotsOverArea),u=t.pos.add(.5).divide(d);return{glPosition:i,color:new p(0,0,0,0),textureCoords:u,thresholds0:n,thresholds1:a}}fragment(t){const e=new d,o=u(this.draw.dotTexture0,t.textureCoords),s=u(this.draw.dotTexture1,t.textureCoords),i=t.thresholds0.subtract(o),r=t.thresholds1.subtract(s);let l;const n=m.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),a=m.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const t=y(new v(0),i),e=y(new v(0),r),o=w(t,i).add(w(e,r)),s=y(o,new v(0)),d=new v(1).subtract(s),p=o.add(s),h=i.multiply(t).divide(p),c=r.multiply(e).divide(p),u=n.multiply(h).add(a.multiply(c));l=d.multiply(u)}else{const t=x(b(i),b(r)),e=y(t,new v(0)),o=new v(1).subtract(e),s=y(t,i),d=y(t,r),p=n.multiply(s).add(a.multiply(d));l=o.multiply(p)}return e.fragColor=l,e}hittest(t){return T(this.hittestRequest)}}t([l],F.prototype,"blending",void 0),t([s(V)],F.prototype,"instance",void 0),t([s(_)],F.prototype,"draw",void 0),t([e(0,n(j))],F.prototype,"vertex",null),t([e(0,n(A))],F.prototype,"fragment",null);export{_ as DotDensityPolygonDrawUniforms,C as DotDensityPolygonFragmentInput,V as DotDensityPolygonInstanceUniforms,F as DotDensityPolygonShader,j as DotDensityPolygonVertexInput};
@@ -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,a as e}from"../../../../../../../chunks/tslib.es6.js";import{location as i,option as o,uniform as s,ComputeVertexInput as l,input as r}from"../../GraphShaderModule.js";import{Vec3 as a,min as p,max as n,Float as u,Mat3 as d,Vec4 as m,ifElse as y,lessThan as h,equal as c,texture2D as x,clamp as v,abs as f,mix as V,distance as w,greaterThan as S,Vec2 as b,negate as g,step as C}from"../../graph/glsl.js";import{MarkerConstants as z}from"./markerConstants.js";import{FeatureVertexInput as M,FeatureFragmentInput as _,AFeatureShader as j}from"../shaders/AFeatureShader.js";import{c256ToRad as R,softEdgeRatio as U}from"../shaders/constants.js";import{distPointTriangle as N,xyToBarycentric as D,inTriangle as F,failHittest as I}from"../shaders/hittestUtils.js";import{MosaicInfo as O}from"../shaders/MosaicInfo.js";import{getBit as k,getBitBool as q,rgba2float as A}from"../shaders/utils.js";import{VisualVariableColor as P}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as T}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as G}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as H}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as L}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as B}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as E}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as J,getVisualVariableColor as K,getVisualVariableSize as Q,getVisualVariableRotation as W}from"../shaders/vvUtils.js";class X extends M{}t([i(3,m)],X.prototype,"color",void 0),t([i(4,m)],X.prototype,"outlineColor",void 0),t([i(5,b)],X.prototype,"offset",void 0),t([i(6,b)],X.prototype,"textureUV",void 0),t([i(7,m)],X.prototype,"sizing",void 0),t([i(8,u)],X.prototype,"placementAngle",void 0),t([i(9,u)],X.prototype,"sdfDecodeCoeff",void 0),t([i(10,b)],X.prototype,"zoomRange",void 0);class Y extends l{}t([i(12,b)],Y.prototype,"offsetNextVertex1",void 0),t([i(13,b)],Y.prototype,"offsetNextVertex2",void 0),t([i(14,b)],Y.prototype,"textureUVNextVertex1",void 0),t([i(15,b)],Y.prototype,"textureUVNextVertex2",void 0);class Z extends _{}function $(t,e,i,o){return e.multiply(t.x).add(i.multiply(t.y)).add(o.multiply(t.z))}function tt(t){return t.multiply(t).divide(128)}class et extends j{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=tt(t.sizing.x),o=tt(t.sizing.y),s=tt(t.sizing.z),l=t.placementAngle,r=k(t.bitset,z.bitset.isSDF),y=k(t.bitset,z.bitset.isMapAligned),h=k(t.bitset,z.bitset.scaleSymbolsProportionally),c=q(t.bitset,z.bitset.colorLocked),x=J(this,t.id),v=K(this,t.id,t.color,c).multiply(x),f=this.view.displayViewScreenMat3.multiply(new a(t.pos.xy,1)),V=Q(this,t.id,s).divide(s),w=i.multiply(V),S=t.offset.xy.multiply(V);let b=o.multiply(h.multiply(V.subtract(1)).add(1));b=p(b,n(w.subtract(.99),new u(0)));const g=n(b,new u(1)),C=p(b,new u(1)),M=d.fromRotation(l.multiply(R)),_=W(this,t.id),j=this._getViewRotationMatrix(y).multiply(_).multiply(M).multiply(new a(S.xy,0)),U=this.clip(t.id,t.zoomRange),N=new m(f.xy.add(j.xy),U,1),D=t.textureUV.divide(this.mosaicInfo.size),F=t.outlineColor.multiply(C),I=k(t.bitset,z.bitset.overrideOutlineColor),O=t.sdfDecodeCoeff.multiply(w);return{glPosition:N,color:v,textureUV:D,outlineColor:F,outlineSize:g,distanceToPx:O,isSDF:r,overrideOutlineColor:I,...this.maybeRunHittest(t,e,{pos:t.pos,size:w,sizeCorrection:V,isMapAligned:y,vvRotationMat3:_,placementMat3:M,outlineSize:g,distanceToPx:O,isSDF:r})}}fragment(t){const e=this._getColor(t.textureUV,t);return this.getFragmentOutput(e,t)}hittest(t,e,i){return y(h(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i))}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new u(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getViewScreenMatrix(t){const e=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,o=new u(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getColor(t,e){return y(c(e.isSDF,new u(1)),this._getSDFColor(t,e),this._getSpriteColor(t,e))}_getSpriteColor(t,e){return x(this.mosaicInfo.texture,t).multiply(e.color)}_getSDFColor(t,e){const i=x(this.mosaicInfo.texture,t),o=new u(.5).subtract(A(i)).multiply(e.distanceToPx).multiply(U),s=v(new u(.5).subtract(o),new u(0),new u(1)),l=e.color.multiply(s);let r=e.outlineSize;this.highlight&&(r=n(r,e.overrideOutlineColor.multiply(4)));const a=r.multiply(.5),p=f(o).subtract(a),d=v(new u(.5).subtract(p),new u(0),new u(1)),m=V(e.outlineColor,e.color,e.overrideOutlineColor).multiply(d);return new u(1).subtract(m.a).multiply(l).add(m)}_hittestSmallMarker(t,e,i){const{position:o,distance:s,smallSymbolDistance:l}=this.hittestRequest,r=s.subtract(l),{viewMat3:p,tileMat3:n}=this.view,u=p.multiply(n).multiply(new a(i.pos,1)).xy,d=i.size.multiply(.5);return w(u,o).subtract(d).add(r)}_hittestMarker(t,e,i){const{pos:o,sizeCorrection:s,isMapAligned:l}=i,r=new a(t.offset.multiply(s),0),p=new a(e.offsetNextVertex1.multiply(s),0),n=new a(e.offsetNextVertex2.multiply(s),0),{viewMat3:u,tileMat3:d}=this.view,m=u.multiply(d).multiply(new a(o,1)),h=this._getViewScreenMatrix(l).multiply(i.vvRotationMat3).multiply(i.placementMat3),c=m.add(h.multiply(r)).xy,x=m.add(h.multiply(p)).xy,v=m.add(h.multiply(n)).xy,f=this.hittestRequest.position,V=this.hittestRequest.distance,w=N(f,c,x,v);return y(S(w,V),w,this._hittestSamples(c,x,v,t,e,i))}_hittestSamples(t,e,i,o,s,l){const{outlineSize:r,isSDF:a,distanceToPx:p}=l,n=this.hittestRequest.position,d=this.hittestRequest.distance,y=D(n.add(new b(g(d),g(d))),t,e,i),h=D(n.add(new b(0,g(d))),t,e,i),c=D(n.add(new b(d,g(d))),t,e,i),x=D(n.add(new b(g(d),0)),t,e,i),v=D(n,t,e,i),f=D(n.add(new b(d,0)),t,e,i),V=D(n.add(new b(g(d),d)),t,e,i),w=D(n.add(new b(0,d)),t,e,i),S=D(n.add(new b(d,d)),t,e,i),z=o.textureUV.divide(this.mosaicInfo.size),M=s.textureUVNextVertex1.divide(this.mosaicInfo.size),_=s.textureUVNextVertex2.divide(this.mosaicInfo.size),j={color:new m(1),outlineColor:new m(1),overrideOutlineColor:new u(1),outlineSize:r,distanceToPx:p,isSDF:a};let R=new u(0);return R=R.add(F(y).multiply(this._getColor($(y,z,M,_),j).a)),R=R.add(F(h).multiply(this._getColor($(h,z,M,_),j).a)),R=R.add(F(c).multiply(this._getColor($(c,z,M,_),j).a)),R=R.add(F(x).multiply(this._getColor($(x,z,M,_),j).a)),R=R.add(F(v).multiply(this._getColor($(v,z,M,_),j).a)),R=R.add(F(f).multiply(this._getColor($(f,z,M,_),j).a)),R=R.add(F(V).multiply(this._getColor($(V,z,M,_),j).a)),R=R.add(F(w).multiply(this._getColor($(w,z,M,_),j).a)),R=R.add(F(S).multiply(this._getColor($(S,z,M,_),j).a)),C(R,new u(.05)).multiply(I(this.hittestRequest))}}t([o(P)],et.prototype,"visualVariableColor",void 0),t([o(T)],et.prototype,"visualVariableOpacity",void 0),t([o(G)],et.prototype,"visualVariableRotation",void 0),t([o(H)],et.prototype,"visualVariableSizeMinMaxValue",void 0),t([o(L)],et.prototype,"visualVariableSizeScaleStops",void 0),t([o(B)],et.prototype,"visualVariableSizeStops",void 0),t([o(E)],et.prototype,"visualVariableSizeUnitValue",void 0),t([s(O)],et.prototype,"mosaicInfo",void 0),t([e(0,r(X)),e(1,r(Y))],et.prototype,"vertex",null),t([e(0,r(Z))],et.prototype,"fragment",null);export{Z as MarkerFragmentInput,et as MarkerShader,X as MarkerVertexInput};
5
+ import{_ as t,a as e}from"../../../../../../../chunks/tslib.es6.js";import{location as i,option as o,uniform as s,ComputeVertexInput as l,input as r}from"../../GraphShaderModule.js";import{Vec3 as a,min as p,max as n,Float as u,Mat3 as d,Vec4 as m,ifElse as y,lessThan as h,equal as c,texture2D as x,clamp as v,abs as f,mix as V,distance as w,greaterThan as S,Vec2 as b,negate as g,step as C}from"../../graph/glsl.js";import{MarkerConstants as M}from"./markerConstants.js";import{FeatureVertexInput as z,FeatureFragmentInput as _,AFeatureShader as j}from"../shaders/AFeatureShader.js";import{c256ToRad as R,softEdgeRatio as U}from"../shaders/constants.js";import{distPointTriangle as N,xyToBarycentric as D,inTriangle as F,failHittest as k}from"../shaders/hittestUtils.js";import{MosaicInfo as I}from"../shaders/MosaicInfo.js";import{getBit as O,getBitBool as q,rgba2float as A}from"../shaders/utils.js";import{VisualVariableColor as P}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as T}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as G}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as H}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as L}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as B}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as E}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as J,getVisualVariableColor as K,getVisualVariableSize as Q,getVisualVariableRotation as W}from"../shaders/vvUtils.js";class X extends z{}t([i(3,m)],X.prototype,"color",void 0),t([i(4,m)],X.prototype,"outlineColor",void 0),t([i(5,b)],X.prototype,"offset",void 0),t([i(6,b)],X.prototype,"textureUV",void 0),t([i(7,m)],X.prototype,"sizing",void 0),t([i(8,u)],X.prototype,"placementAngle",void 0),t([i(9,u)],X.prototype,"sdfDecodeCoeff",void 0),t([i(10,b)],X.prototype,"zoomRange",void 0);class Y extends l{}t([i(12,b)],Y.prototype,"offsetNextVertex1",void 0),t([i(13,b)],Y.prototype,"offsetNextVertex2",void 0),t([i(14,b)],Y.prototype,"textureUVNextVertex1",void 0),t([i(15,b)],Y.prototype,"textureUVNextVertex2",void 0);class Z extends _{}function $(t,e,i,o){return e.multiply(t.x).add(i.multiply(t.y)).add(o.multiply(t.z))}function tt(t){return t.multiply(t).divide(128)}class et extends j{constructor(){super(...arguments),this.type="MarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=tt(t.sizing.x),o=tt(t.sizing.y),s=tt(t.sizing.z),l=t.placementAngle,r=O(t.bitset,M.bitset.isSDF),y=O(t.bitset,M.bitset.isMapAligned),h=O(t.bitset,M.bitset.scaleSymbolsProportionally),c=q(t.bitset,M.bitset.colorLocked),x=J(this,t.id),v=K(this,t.id,t.color,c).multiply(x),f=this.view.displayViewScreenMat3.multiply(new a(t.pos.xy,1)),V=Q(this,t.id,s).divide(s),w=i.multiply(V),S=t.offset.xy.multiply(V);let b=o.multiply(h.multiply(V.subtract(1)).add(1));b=p(b,n(w.subtract(.99),new u(0)));const g=n(b,new u(1)),C=p(b,new u(1)),z=d.fromRotation(l.multiply(R)),_=W(this,t.id),j=this._getViewRotationMatrix(y).multiply(_).multiply(z).multiply(new a(S.xy,0)),U=this.clip(t.id,t.zoomRange),N=new m(f.xy.add(j.xy),U,1),D=t.textureUV.divide(this.mosaicInfo.size),F=t.outlineColor.multiply(C),k=O(t.bitset,M.bitset.overrideOutlineColor),I=t.sdfDecodeCoeff.multiply(w);return{glPosition:N,color:v,textureUV:D,outlineColor:F,outlineSize:g,distanceToPx:I,isSDF:r,overrideOutlineColor:k,...this.maybeRunHittest(t,e,{pos:t.pos,size:w,sizeCorrection:V,isMapAligned:y,vvRotationMat3:_,placementMat3:z,outlineSize:g,distanceToPx:I,isSDF:r})}}fragment(t){const e=this._getColor(t.textureUV,t);return this.getFragmentOutput(e,t)}hittest(t,e,i){return y(h(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i))}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new u(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getViewScreenMatrix(t){const e=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,o=new u(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getColor(t,e){return y(c(e.isSDF,new u(1)),this._getSDFColor(t,e),this._getSpriteColor(t,e))}_getSpriteColor(t,e){return x(this.mosaicInfo.texture,t).multiply(e.color)}_getSDFColor(t,e){const i=x(this.mosaicInfo.texture,t),o=new u(.5).subtract(A(i)).multiply(e.distanceToPx).multiply(U),s=v(new u(.5).subtract(o),new u(0),new u(1)),l=e.color.multiply(s);let r=e.outlineSize;this.highlight&&(r=n(r,e.overrideOutlineColor.multiply(4)));const a=r.multiply(.5),p=f(o).subtract(a),d=v(new u(.5).subtract(p),new u(0),new u(1)),m=V(e.outlineColor,e.color,e.overrideOutlineColor).multiply(d);return new u(1).subtract(m.a).multiply(l).add(m)}_hittestSmallMarker(t,e,i){const{position:o,distance:s,smallSymbolDistance:l}=this.hittestRequest,r=s.subtract(l),{viewMat3:p,tileMat3:n}=this.view,u=p.multiply(n).multiply(new a(i.pos,1)).xy,d=i.size.multiply(.5);return w(u,o).subtract(d).add(r)}_hittestMarker(t,e,i){const{pos:o,sizeCorrection:s,isMapAligned:l}=i,r=new a(t.offset.multiply(s),0),p=new a(e.offsetNextVertex1.multiply(s),0),n=new a(e.offsetNextVertex2.multiply(s),0),{viewMat3:u,tileMat3:d}=this.view,m=u.multiply(d).multiply(new a(o,1)),h=this._getViewScreenMatrix(l).multiply(i.vvRotationMat3).multiply(i.placementMat3),c=m.add(h.multiply(r)).xy,x=m.add(h.multiply(p)).xy,v=m.add(h.multiply(n)).xy,f=this.hittestRequest.position,V=this.hittestRequest.distance,w=N(f,c,x,v);return y(S(w,V),w,this._hittestSamples(c,x,v,t,e,i))}_hittestSamples(t,e,i,o,s,l){const{outlineSize:r,isSDF:a,distanceToPx:p}=l,n=this.hittestRequest.position,d=this.hittestRequest.distance,y=D(n.add(new b(g(d),g(d))),t,e,i),h=D(n.add(new b(0,g(d))),t,e,i),c=D(n.add(new b(d,g(d))),t,e,i),x=D(n.add(new b(g(d),0)),t,e,i),v=D(n,t,e,i),f=D(n.add(new b(d,0)),t,e,i),V=D(n.add(new b(g(d),d)),t,e,i),w=D(n.add(new b(0,d)),t,e,i),S=D(n.add(new b(d,d)),t,e,i),M=o.textureUV.divide(this.mosaicInfo.size),z=s.textureUVNextVertex1.divide(this.mosaicInfo.size),_=s.textureUVNextVertex2.divide(this.mosaicInfo.size),j={color:new m(1),outlineColor:new m(1),overrideOutlineColor:new u(1),outlineSize:r,distanceToPx:p,isSDF:a};let R=new u(0);return R=R.add(F(y).multiply(this._getColor($(y,M,z,_),j).a)),R=R.add(F(h).multiply(this._getColor($(h,M,z,_),j).a)),R=R.add(F(c).multiply(this._getColor($(c,M,z,_),j).a)),R=R.add(F(x).multiply(this._getColor($(x,M,z,_),j).a)),R=R.add(F(v).multiply(this._getColor($(v,M,z,_),j).a)),R=R.add(F(f).multiply(this._getColor($(f,M,z,_),j).a)),R=R.add(F(V).multiply(this._getColor($(V,M,z,_),j).a)),R=R.add(F(w).multiply(this._getColor($(w,M,z,_),j).a)),R=R.add(F(S).multiply(this._getColor($(S,M,z,_),j).a)),C(R,new u(.05)).multiply(k(this.hittestRequest))}}t([o(P)],et.prototype,"visualVariableColor",void 0),t([o(T)],et.prototype,"visualVariableOpacity",void 0),t([o(G)],et.prototype,"visualVariableRotation",void 0),t([o(H)],et.prototype,"visualVariableSizeMinMaxValue",void 0),t([o(L)],et.prototype,"visualVariableSizeScaleStops",void 0),t([o(B)],et.prototype,"visualVariableSizeStops",void 0),t([o(E)],et.prototype,"visualVariableSizeUnitValue",void 0),t([s(I)],et.prototype,"mosaicInfo",void 0),t([e(0,r(X)),e(1,r(Y))],et.prototype,"vertex",null),t([e(0,r(Z))],et.prototype,"fragment",null);export{Z as MarkerFragmentInput,et as MarkerShader,X as MarkerVertexInput};
@@ -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 o,a as t}from"../../../../../../../chunks/tslib.es6.js";import{location as i,uniform as e,GraphShaderModule as r,define as s,VertexInput as p,UniformGroup as c,FragmentOutput as n,input as l,FragmentInput as a}from"../../GraphShaderModule.js";import{Vec3 as d,Vec4 as y,texture2D as f,Vec2 as g,Sampler2D as m,Mat3 as u,Float as x}from"../../graph/glsl.js";import{sampleBicubicBSpline as h}from"./bitmapUtils.js";class v extends p{}o([i(0,g)],v.prototype,"position",void 0);class b extends a{}class j extends c{}o([e(m)],j.prototype,"texture",void 0),o([e(u)],j.prototype,"dvsMat3",void 0),o([e(g)],j.prototype,"coordScale",void 0),o([e(x)],j.prototype,"opacity",void 0);class w extends r{vertex(o){const t=this.config.dvsMat3.multiply(new d(o.position.multiply(this.config.coordScale),1));return{glPosition:new y(t,1),texcoord:o.position}}fragment(o){const t=new n;let i;return i=this.bicubic?h(this.config.texture,o.texcoord,this.config.coordScale):f(this.config.texture,o.texcoord),t.fragColor=new y(i.rgb.multiply(this.config.opacity),i.a.multiply(this.config.opacity)),t}}o([e(j)],w.prototype,"config",void 0),o([s],w.prototype,"bicubic",void 0),o([t(0,l(v))],w.prototype,"vertex",null),o([t(0,l(b))],w.prototype,"fragment",null);export{w as BitmapShader};
5
+ import{_ as t,a as o}from"../../../../../../../chunks/tslib.es6.js";import{location as i,uniform as e,GraphShaderModule as r,define as s,VertexInput as p,UniformGroup as c,FragmentOutput as n,input as l,FragmentInput as a}from"../../GraphShaderModule.js";import{Vec3 as d,Vec4 as u,texture2D as y,Vec2 as m,Sampler2D as f,Mat3 as g,Float as h}from"../../graph/glsl.js";import{sampleBicubicBSpline as x}from"./bitmapUtils.js";class v extends p{}t([i(0,m)],v.prototype,"position",void 0);class b extends a{}class S extends c{}t([e(f)],S.prototype,"texture",void 0),t([e(g)],S.prototype,"dvsMat3",void 0),t([e(m)],S.prototype,"coordScale",void 0),t([e(h)],S.prototype,"opacity",void 0);class j extends r{constructor(){super(...arguments),this.type="BitmapShader"}vertex(t){const o=this.config.dvsMat3.multiply(new d(t.position.multiply(this.config.coordScale),1));return{glPosition:new u(o,1),texcoord:t.position}}fragment(t){const o=new n;let i;return i=this.bicubic?x(this.config.texture,t.texcoord,this.config.coordScale):y(this.config.texture,t.texcoord),o.fragColor=new u(i.rgb.multiply(this.config.opacity),i.a.multiply(this.config.opacity)),o}}t([e(S)],j.prototype,"config",void 0),t([s],j.prototype,"bicubic",void 0),t([o(0,l(v))],j.prototype,"vertex",null),t([o(0,l(b))],j.prototype,"fragment",null);export{j as BitmapShader};