@arcgis/core 4.33.0-next.20250526 → 4.33.0-next.20250528

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 (109) hide show
  1. package/Map.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0716b21b1cfb8df066fa.js +1 -0
  4. package/assets/esri/core/workers/chunks/{b70f65ccee01d48a610e.js → 08583c74b8c538aef4d5.js} +2 -2
  5. package/assets/esri/core/workers/chunks/3027eb0c20e996ad374a.js +1 -0
  6. package/assets/esri/core/workers/chunks/{28e31ac00dc95a1318e9.js → 3916879b9ca8c6979011.js} +1 -1
  7. package/assets/esri/core/workers/chunks/6408b7845858cf18102f.js +1 -0
  8. package/assets/esri/core/workers/chunks/87623ebe32c6ae9cb223.js +1 -0
  9. package/assets/esri/core/workers/chunks/adf6982e2d8102669cdf.js +1 -0
  10. package/assets/esri/core/workers/chunks/cc9dd8924bfeb8bcd278.js +1 -0
  11. package/assets/esri/core/workers/chunks/cdb022ffffc6554de83a.js +1 -0
  12. package/assets/esri/core/workers/chunks/f5741d09fd4e1809f580.js +1 -0
  13. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  14. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  15. package/core/workers/Connection.js +1 -1
  16. package/core/workers/RemoteClient.js +1 -1
  17. package/core/workers/WorkerHandle.js +1 -1
  18. package/effects/FocusArea.d.ts +4 -0
  19. package/effects/FocusArea.js +1 -1
  20. package/effects/FocusAreaOutline.d.ts +4 -0
  21. package/effects/FocusAreaOutline.js +1 -1
  22. package/effects/FocusAreas.d.ts +4 -0
  23. package/effects/FocusAreas.js +1 -1
  24. package/interfaces.d.ts +231 -3
  25. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  26. package/layers/support/PromiseQueue.js +1 -1
  27. package/networks/support/UNTraceConfiguration.js +1 -1
  28. package/networks/support/typeUtils.js +1 -1
  29. package/package.json +1 -1
  30. package/rest/networks/support/CircuitTraceResult.js +5 -0
  31. package/rest/networks/support/TraceResult.js +1 -1
  32. package/support/revision.js +1 -1
  33. package/symbols/cim/animationUtils.js +1 -1
  34. package/symbols/cim/cimAnalyzer.js +1 -1
  35. package/symbols/cim/defaultCIMValues.js +1 -1
  36. package/symbols/cim/utils.js +1 -1
  37. package/views/2d/engine/webgl/animations/infos.js +1 -1
  38. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  39. package/views/2d/engine/webgl/animations/utils.js +1 -1
  40. package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
  41. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js +1 -1
  42. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueType.js +1 -1
  43. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +5 -0
  44. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +5 -0
  45. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +5 -0
  46. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +5 -0
  47. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  48. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  49. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +5 -0
  50. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  51. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechniques.js +5 -0
  52. package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +5 -0
  53. package/views/2d/engine/webgl/shaderGraph/techniques/animated/attributes.js +5 -0
  54. package/views/2d/engine/webgl/shaderGraph/techniques/animated/enums.js +1 -1
  55. package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
  56. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  57. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  58. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
  59. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.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/hittestUtils.js +1 -1
  62. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  63. package/views/2d/layers/MediaLayerView2D.js +1 -1
  64. package/views/2d/layers/TileLayerView2D.js +1 -1
  65. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  66. package/views/2d/layers/features/schema/processor/symbols/utils.js +1 -1
  67. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  68. package/views/3d/layers/I3SMeshView3D.js +1 -1
  69. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  70. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  71. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  72. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  73. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  74. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  75. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  76. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  77. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  78. package/views/3d/terrain/TerrainRenderer.js +1 -1
  79. package/views/3d/terrain/TerrainSurface.js +1 -1
  80. package/views/3d/terrain/TileRenderer.js +1 -1
  81. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  82. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  83. package/views/VideoView.js +1 -1
  84. package/views/draw/support/GraphicMover.js +1 -1
  85. package/views/support/TextureCompressionTracker.js +5 -0
  86. package/views/webgl/Texture.js +1 -1
  87. package/widgets/Directions/DirectionsVisibleElements.js +1 -1
  88. package/widgets/Directions.js +1 -1
  89. package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
  90. package/widgets/Editor/EditorViewModel.js +1 -1
  91. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  92. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  93. package/widgets/Editor/workflowUtils.js +1 -1
  94. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  95. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  96. package/widgets/FeatureForm.js +1 -1
  97. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  98. package/widgets/Features/FeaturesViewModel.js +1 -1
  99. package/assets/esri/core/workers/chunks/003ddb190a5cc56f7925.js +0 -1
  100. package/assets/esri/core/workers/chunks/0fb5de3f8a4d69b2d514.js +0 -1
  101. package/assets/esri/core/workers/chunks/377a7f0f7d304ff9fe5b.js +0 -1
  102. package/assets/esri/core/workers/chunks/5200be8bce60fa831026.js +0 -1
  103. package/assets/esri/core/workers/chunks/c9ab067b07d1eab974d1.js +0 -1
  104. package/assets/esri/core/workers/chunks/e89345c7af9d3d4d8452.js +0 -1
  105. package/assets/esri/core/workers/chunks/ef7955a2509be0f03ca2.js +0 -1
  106. package/assets/esri/core/workers/chunks/fd4c020297badcb81947.js +0 -1
  107. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerTechnique.js +0 -5
  108. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedShader.js +0 -5
  109. package/views/support/TextureCompressionHandle.js +0 -5
@@ -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{isRGB as e}from"../../core/colorUtils.js";import{getFontFamily as t}from"../../core/fontUtils.js";import"../../core/has.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{pt2px as o,px2pt as a}from"../../core/screenUtils.js";import{numericHash as s}from"../../core/string.js";import{checkForAnimations as l,getAnimationParams as n,handleAbsoluteAnchor as p,handleMarker as c,handleRelativeAnchor as m,getFrameTranslation as y,translate as d,getStaticParam as f,shouldUseAnimatedPath as h}from"./animationUtils.js";import{CIMSymbolHelper as u}from"./CIMSymbolHelper.js";import{antialiasingOutlineFillSettings as v}from"./constants.js";import{defaultCIMValues as O}from"./defaultCIMValues.js";import{Alignment as g,SymbolUnits as S}from"./enums.js";import{fitVectorMarker as _}from"./fitVectorMarker.js";import{OverrideHelper as M}from"./OverrideHelper.js";import{getExtent as k,getSDFMetrics as C,getSDFDimensions as b}from"./SDFHelper.js";import{colorToArray as x,normalizeAlpha as P,getSize as z,isCIMMarkerStrokePlacement as E,hasStrokeLayer as I,getTintColor as L,getNumericValue as V,normalizePrimitiveOverrideProps as N,getDefaultCIMValue as R,getEnum as A,getStrokeWidth as w,getFillColor as G,getStrokeColor as T,fromCIMFontDecoration as F,fromCIMFontStyle as X,fromCIMVerticalAlignment as j,fromCIMHorizontalAlignment as Y,getTextCasing as W,isValidCIMValue as D,uncapitalize as U}from"./utils.js";import{CIMEffectHelper as H}from"./effects/CIMEffectHelper.js";import{rasterizedVectorMarkerMinSize as J,randomInsidePolygonTextureSize as B}from"../../views/2d/engine/webgl/definitions.js";const q=()=>i.getLogger("esri.symbols.cim.cimAnalyzer");function K(e){const t=e.markerPlacement;return t&&t.angleToLine?g.MAP:g.SCREEN}class Q{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._hasTextStringTemplates=!1,e&&(this._resourceManager=e)}analyzeSymbolReference(t,r,i){if(this._cimLayers=i??[],!t)return this._cimLayers;if(this._reset(),this._hasTextStringTemplates=t.hasTextStringTemplates??!1,t.primitiveOverrides){this._primitiveOverrides=t.primitiveOverrides;for(const t of this._primitiveOverrides){const r=t.valueExpressionInfo;if(r)this._setPoMap(t.primitiveName,t.propertyName,r);else if(null!=t.value){let r=t.value;t.propertyName.includes("Color")&&(e(r)&&(r=x(r)),r=P(r)),this._setPoMap(t.primitiveName,t.propertyName,r)}}}return this._analyzeSymbol(t.symbol,r),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const r=e?.symbolLayers;if(!r)return;for(let l=0;l<r.length;l++){const e=r[l];"CIMVectorMarker"===e.type&&(r[l]=_(e,this._resourceManager.geometryEngine))}const i=e.effects;let o=g.SCREEN;const a=z(e)??0;if("CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(o=g.MAP),oe(r,i))return this._analyzeCompositeOutlineFill(r,i,a);let s={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],hasAnimations:l(e)};s=n(this._poMap,e,s);const p="CIMPolygonSymbol"===e.type;let c=r.length;for(;c--;){const l=r[c];if(!l||!1===l.enable)continue;let n;i?.length&&(n=[...i]);const m=l.effects;m?.length&&(i?n.push(...m):n=[...m]);let y=null;if(n){y=[];for(const e of n){const t=M.findEffectOverrides(e,this._primitiveOverrides);t&&y.push(t)}}const d=[];switch(M.findApplicableOverrides(l,this._primitiveOverrides,d),l.type){case"CIMSolidFill":this._analyzeSolidFill(l,y,I(r));break;case"CIMPictureFill":this._analyzePictureFill(l,y);break;case"CIMHatchFill":this._analyzeHatchFill(l,y);break;case"CIMGradientFill":this._analyzeGradientFill(l,y);break;case"CIMSolidStroke":this._analyzeSolidStroke(l,y,p,a);break;case"CIMPictureStroke":this._analyzePictureStroke(l,y,p,a);break;case"CIMGradientStroke":this._analyzeGradientStroke(l,y,p,a);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{"CIMLineSymbol"!==e.type&&"CIMPolygonSymbol"!==e.type||(o=K(l));const r=[],i=l.primitiveName;i&&r.push(i);const n=p&&E(l.markerPlacement);this._analyzeMarker(l,y,null,r,o,a,t,[],s,!1,n);break}default:q().error("Cannot analyze CIM layer",l.type)}}}_analyzeSolidFill(e,t,r){const{primitiveName:i,type:o}=e,a=P(e.color);if(r||!t?.some((e=>"CIMGeometricEffectTaperedPolygon"===e.effect.type)))this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(o,i,"Color",a),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1});else{const r=this._getValueOrOverrideExpression(o,i,"Color",a);this._cimLayers.push({type:"outlineFill",colorLocked:!!e.colorLocked,color:r,effects:t,outlineColor:r,outlineColorLocked:!!e.colorLocked,...v,outlineEffects:t})}}_analyzePictureFill(e,t){const{primitiveName:r,type:i}=e,o=L(e),a=V(e.height,O.CIMPictureFill.height);let s=V(e.scaleX,1);if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height),s/=r*(a/t)}const l={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(r,i)};this._cimLayers.push({type:"fill",spriteRasterizationParam:l,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(i,r,"TintColor",o),height:this._getValueOrOverrideExpression(i,r,"Height",a),scaleX:this._getValueOrOverrideExpression(i,r,"ScaleX",s),angle:this._getValueOrOverrideExpression(i,r,"Rotation",V(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,r,"OffsetX",V(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,r,"OffsetY",V(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(e,t){const{primitiveName:r,type:i}=e,o=this._analyzeMaterialOverrides(r,["Rotation","OffsetX","OffsetY"]),a=N(o);let s=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const p of e.lineSymbol.symbolLayers){if("CIMSolidStroke"!==p.type)continue;const e=p.primitiveName??r;l||!e||p.colorLocked||null==this._poMap[e]?.Color&&null==this._poMap[e]?.StrokeColor||(s=P(p.color),s=this._maybeGetValueOrOverrideExpression(e,"StrokeColor")??this._getValueOrOverrideExpression(i,e,"Color",s),l=!0);const t=this._maybeGetValueOrOverrideExpression(e,"StrokeWidth");if(t){let r=null,o=null;"number"==typeof t?r=t:o=t.valueExpressionInfo;let s=a.find((e=>"strokeWidth"===e.propertyName));s?s.propertyName="width":(s={type:"CIMPrimitiveOverride",primitiveName:e,propertyName:"width",valueExpressionInfo:o,value:r,defaultValue:R(i,"width")},a.push(s))}}const n={type:"sprite-rasterization-param",resource:e,overrides:a};this._cimLayers.push({type:"fill",spriteRasterizationParam:n,colorLocked:!!e.colorLocked,effects:t,color:s,height:this._getValueOrOverrideExpression(i,r,"Separation",V(e.separation,O.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,r,"Rotation",V(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,r,"OffsetX",V(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,r,"OffsetY",V(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,t){const{angle:r,gradientMethod:i,gradientSize:o,gradientSizeUnits:a,gradientType:s,interval:l,primitiveName:n,type:p}=e,c=O.CIMGradientFill,m=e.colorRamp;this._cimLayers.push({type:"gradientFill",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(n,p)},colorLocked:!1,effects:t,color:[255,255,255,1],gradientMethod:this._getValueOrOverrideExpression(p,n,"GradientMethod",i??"Linear"),angle:this._getValueOrOverrideExpression(p,n,"Angle",V(r,c.angle)),gradientType:this._getValueOrOverrideExpression(p,n,"GradientType",s??c.gradientType),interval:this._getValueOrOverrideExpression(p,n,"Interval",V(l,"CIMFixedColorRamp"===m.type?m.colors.length:c.interval)),gradientSize:this._getValueOrOverrideExpression(p,n,"GradientSize",V(o,c.gradientSize)),gradientSizeUnits:"Absolute"===a?S.Absolute:"Relative"===a?S.Relative:c.gradientSizeUnits})}_analyzeCompositeOutlineFill(e,t,r){const i=e.find((e=>"CIMSolidFill"===e.type)),o=e.find((e=>"CIMSolidStroke"===e.type));if(null==i||null==o)return;const a=[...t??[],...i.effects??[]].map((e=>M.findEffectOverrides(e,this._primitiveOverrides))).filter((e=>null!=e)),s=[...t??[],...o.effects??[]].map((e=>M.findEffectOverrides(e,this._primitiveOverrides))).filter((e=>null!=e)),l=V(o.width,O.CIMSolidStroke.width),n=A(o.capStyle,O.CIMSolidStroke.capstyle),p=A(o.joinStyle,O.CIMSolidStroke.joinstyle),c=o.miterLimit;this._cimLayers.push({type:"outlineFill",colorLocked:!!i.colorLocked,color:this._getValueOrOverrideExpression(i.type,i.primitiveName,"Color",P(i.color)),effects:a,outlineColorLocked:!!o.colorLocked,outlineColor:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Color",P(o.color)),outlineWidth:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Width",l),cap:this._getValueOrOverrideExpression(o.type,o.primitiveName,"CapStyle",n),join:this._getValueOrOverrideExpression(o.type,o.primitiveName,"JoinStyle",p),miterLimit:c&&this._getValueOrOverrideExpression(o.type,o.primitiveName,"MiterLimit",c),referenceWidth:r,outlineEffects:s})}_analyzeSolidStroke(e,t,r,i){const{primitiveName:o,type:a}=e,s=P(e.color),l=V(e.width,O.CIMSolidStroke.width),n=A(e.capStyle,O.CIMSolidStroke.capstyle),p=A(e.joinStyle,O.CIMSolidStroke.joinstyle),c=e.miterLimit;let m,y,d,f,h=[];if(this._analyzePrimitiveOverrides(o,t,null,null)&&(h=this._getPrimitiveMaterialOverrides(o,a)),t&&Array.isArray(t)&&t.length>0){const e=t[t.length-1].effect;e&&"CIMGeometricEffectDashes"===e.type&&"NoConstraint"===e.lineDashEnding&&(m=e.dashTemplate,y=e.scaleDash,d=e.offsetAlongLine,f=e.primitiveName,(t=[...t]).pop())}null!=f&&h.push(...this._getPrimitiveMaterialOverrides(f,a).filter((e=>"dashTemplate"===e.propertyName)));const u=void 0!==m?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:m,primitiveName:f},overrides:h}:null;this._cimLayers.push({type:"line",spriteRasterizationParam:u,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(a,o,"Color",s),width:this._getValueOrOverrideExpression(a,o,"Width",l),cap:this._getValueOrOverrideExpression(a,o,"CapStyle",n),join:this._getValueOrOverrideExpression(a,o,"JoinStyle",p),miterLimit:c&&this._getValueOrOverrideExpression(a,o,"MiterLimit",c),referenceWidth:i,zOrder:$(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(f,"DashTemplate")??m,offsetAlongLine:this._getValueOrOverrideExpression(a,f,"OffsetAlongLine",d??0),scaleDash:y,sampleAlphaOnly:!0})}_analyzePictureStroke(e,t,r,i){const{primitiveName:o,type:a}=e,s=L(e),l=V(e.width,O.CIMPictureStroke.width),n=A(e.capStyle,O.CIMPictureStroke.capstyle),p=A(e.joinStyle,O.CIMPictureStroke.joinstyle),c=e.miterLimit,m={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(o,a)};this._cimLayers.push({type:"line",spriteRasterizationParam:m,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(a,o,"TintColor",s),width:this._getValueOrOverrideExpression(a,o,"Width",l),cap:this._getValueOrOverrideExpression(a,o,"CapStyle",n),join:this._getValueOrOverrideExpression(a,o,"JoinStyle",p),miterLimit:c&&this._getValueOrOverrideExpression(a,o,"MiterLimit",c),referenceWidth:i,zOrder:$(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,t,r,i){const{gradientMethod:o,gradientSize:a,gradientSizeUnits:s,gradientType:l,interval:n,primitiveName:p,type:c}=e,m=O.CIMGradientStroke,y=V(e.width,m.width),d=A(e.capStyle,m.capstyle),f=A(e.joinStyle,m.joinstyle),h=e.miterLimit,u=e.colorRamp;this._cimLayers.push({type:"gradientStroke",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(p,c)},colorLocked:!!e.colorLocked,effects:t,color:[255,255,255,1],width:this._getValueOrOverrideExpression(c,p,"Width",y),cap:this._getValueOrOverrideExpression(c,p,"CapStyle",d),join:this._getValueOrOverrideExpression(c,p,"JoinStyle",f),miterLimit:h&&this._getValueOrOverrideExpression(c,p,"MiterLimit",h),referenceWidth:i,isOutline:r,gradientMethod:this._getValueOrOverrideExpression(c,p,"GradientMethod",o??m.gradientMethod),gradientType:this._getValueOrOverrideExpression(c,p,"GradientType",l??m.gradientType),interval:this._getValueOrOverrideExpression(c,p,"Interval",V(n,"CIMFixedColorRamp"===u.type?u.colors.length:m.interval)),gradientSize:this._getValueOrOverrideExpression(c,p,"GradientSize",V(a,m.gradientSize)),gradientSizeUnits:"Absolute"===s?S.Absolute:"Relative"===s?S.Relative:m.gradientSizeUnits})}_analyzeMarker(e,t,r,i,o,a,s,l,y,d=!1,f=!1){if(d||=!!e.colorLocked,this._analyzeMarkerInsidePolygon(e,t,d))return;const h=V(e.size,O.CIMVectorMarker.size),u=V(e.rotation),v=V(e.offsetX),g=V(e.offsetY),{primitiveName:S,type:_}=e,M=this._getValueOrOverrideExpression(_,S,"Size",h),k=this._getValueOrOverrideExpression(_,S,"Rotation",u),C=this._getValueOrOverrideExpression(_,S,"OffsetX",v),b=this._getValueOrOverrideExpression(_,S,"OffsetY",g);let x=y;switch(x=n(this._poMap,e,x),x=p(e,x),x=c(this._poMap,e,x),x=m(e,x),e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,r,i,o,a,M,k,C,b,l,x,d,f);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,r,i,o,a,M,k,C,b,l,x,s,d,f)}}_analyzeMarkerInsidePolygon(e,t,r){const{markerPlacement:i,type:o}=e;if(!i||"CIMMarkerPlacementInsidePolygon"!==i.type)return!1;if("CIMVectorMarker"===o||"CIMPictureMarker"===o){const r=e.primitiveName;if(r&&this._analyzePrimitiveOverrides([r],t,null,null))return!1;const a=i.primitiveName;if(a&&this._analyzePrimitiveOverrides([a],t,null,null))return!1;if("CIMVectorMarker"===o){const{markerGraphics:t}=e;if(t)for(const e of t){const{symbol:t}=e;if("CIMPolygonSymbol"===t?.type&&t.symbolLayers){const{symbolLayers:e}=t;for(const t of e)if("CIMSolidStroke"===t.type)return!1}}}else{const{animatedSymbolProperties:t}=e;if(t)return!1}}const s=Math.abs(i.stepX),l=Math.abs(i.stepY);if(0===s||0===l)return!0;let n,p;if("Random"===i.gridType){const e=a(B),t=Math.max(Math.floor(e/s),1);n=l*Math.max(Math.floor(e/l),1);p=t*s/n}else i.shiftOddRows?(n=2*l,p=s/l*.5):(n=l,p=s/l);const c=L(e),m="CIMCharacterMarker"===e.type?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:m,colorLocked:r,effects:t,color:c,height:n,scaleX:p,angle:i.gridAngle,offsetX:V(i.offsetX),offsetY:V(i.offsetY),applyRandomOffset:"Random"===i.gridType,sampleAlphaOnly:"CIMPictureMarker"!==e.type,hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,i,o,a,l,n,p,c,m,y,d,f,h){const{animatedSymbolProperties:u,primitiveName:v,type:O}=e;let g=V(e.scaleX,1);const S=L(e);i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const _=this._createGIFAnimatedSymbolPropertiesOverrideExpression(u),M=e.anchorPoint??{x:0,y:0};if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height);g/=r*(V(e.size)/t)}const k=[...o];let C;e.primitiveName&&k.push(e.primitiveName),u||_?C={type:"animated",url:e.url,urlHash:"H"+s(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(C=r(e),C.markerPlacement=null);const b={type:"sprite-rasterization-param",resource:C,overrides:this._getMaterialOverrides(k,O)};_&&b.overrides.push(..._.overrides);const x=n;this._cimLayers.push({type:"marker",spriteRasterizationParam:b,colorLocked:f,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(O,v,"ScaleX",g),rotation:p,offsetX:c,offsetY:m,transform:{type:"cim-marker-transform-param",params:y},color:this._getValueOrOverrideExpression(O,v,"TintColor",S),anchorPoint:{x:M.x,y:M.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:1,isOutline:h,markerPlacement:i,animationParams:se(d),baseSize:x})}_analyzeVectorMarker(e,t,r,i,o,a,s,l,p,c,m,h,u,v,O){const g=e.markerGraphics;if(!g)return;const S=e.frame;let _=0;_=S?S.ymax-S.ymin:a;const M=!!e.scaleSymbolsProportionally;if(_){const t={offsetX:p,offsetY:c,rotation:l,size:s,frameHeight:_,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:M};m=[...m,t]}r||(r=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const k of g)if(k){const s=k.symbol;if(!s)continue;const l=k.primitiveName;l&&i.push(l);let p,c=h;if(("CIMPointSymbol"===s.type||"CIMTextSymbol"===s.type)&&S){let t=0,r=0;const i=k.geometry;"x"in i&&"y"in i&&(t+=i.x-.5*(S.xmin+S.xmax),r+=i.y-.5*(S.ymin+S.ymax));const o=e.anchorPoint;let a=!1;o&&("Absolute"===e.anchorPointUnits?(t-=o.x,r-=o.y,a=!0):S&&(t-=(S.xmax-S.xmin)*o.x,r-=(S.ymax-S.ymin)*o.y));const s={offsetX:t,offsetY:r,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:a,scaleSymbolsProportionally:M};p=[...m,s]}const g=k.geometry,[C,b]=y(g,S);switch(0===C&&0===b||(c=d(c,C,b)),"CIMPointSymbol"===s.type&&(c=n(this._poMap,s,c)),s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":u||re(s)?(c={...c,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:f([0,0]),rotation:f(0),scale:f(_),parent:h.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,r,k,i,o,a,p??m,c,_,v,O)):this._analyzeMultiLayerGraphic(e,t,r,k,i,o,a,p??m,c,_,v,O);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,r,k,i,o,a,p??m,v)}l&&i.pop()}}_analyzeMultiLayerGraphic(e,t,r,i,o,a,s,l,n,p,c,m){const y=i.symbol.symbolLayers;y&&(!te(y)||h(n)?ie(y)?this._analyzeMultiLayerGraphicNonSDF(e,t,r,i,o,a,s,l,n,p,!!c,m):this._analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,n,p,c,m):this._analyzeCompositeMarkerGraphic(e,t,r,i,y,a,s,l,p,c,m))}_analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,p,c,m,y){const d=i.symbol,f=d.symbolLayers;if(!f)return;const h=this._resourceManager.geometryEngine,u=H.applyEffects(d.effects,i.geometry,h);if(!u)return;let v=f.length;for(;v--;){const d=f[v];if(!d||!1===d.enable)continue;const g=d.primitiveName;switch(g&&o.push(g),d.type){case"CIMSolidFill":case"CIMSolidStroke":{const o=H.applyEffects(d.effects,u,h),f=k(o);if(!f)continue;const v="Relative"!==e.anchorPointUnits,S=w(d)??0,{frameSizeRatio:_,anchorX:M,anchorY:x,widthRatio:z,sdfPaddingRatio:E}=C(f,e.frame,e.size,e.anchorPoint,v,S,e.scaleSymbolsProportionally),I="CIMSolidFill"===d.type,L={type:"sdf",geom:o,sdfPaddingRatio:E,asFill:I},{path:N}=d,R=I?P(G(d)):null==N?P(T(d)):[0,0,0,0],A=I?[0,0,0,0]:P(T(d));if(!I&&!S)break;const F=i.primitiveName;let X=null;I&&!d.colorLocked&&(X=this._maybeGetValueOrOverrideExpression(F,"FillColor"));let j=null;I||d.colorLocked||(j=this._maybeGetValueOrOverrideExpression(F,"StrokeColor"));const Y=X??this._getValueOrOverrideExpression(d.type,g,"Color",R),W=j??this._getValueOrOverrideExpression(d.type,g,"Color",A),D=this._maybeGetValueOrOverrideExpression(F,"StrokeWidth")??this._getValueOrOverrideExpression(d.type,g,"Width",S),U=N?{type:"sprite-rasterization-param",resource:{type:"path",path:N,asFill:I},overrides:[]}:{type:"sprite-rasterization-param",resource:L,overrides:[]},J=n(this._poMap,d,p),B=V(e.size,O.CIMVectorMarker.size),q=this._getValueOrOverrideExpression(e.type,e.primitiveName,"Size",B);this._cimLayers.push({type:"marker",spriteRasterizationParam:U,colorLocked:!!d.colorLocked||!!m,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:M,y:x},isAbsoluteAnchorPoint:v,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:c,widthRatio:z,rotateClockwise:!1,referenceSize:s,sizeRatio:_,color:Y,outlineColor:W,outlineWidth:D,isOutline:y,markerPlacement:r,animationParams:se(J),isStroke:"CIMSolidFill"!==d.type,baseSize:q,...b(o,E)});break}case"CIMPictureMarker":case"CIMVectorMarker":if(d.markerPlacement){q().error("Error analyzing CIM, got unexpected marker placement");break}this._analyzeMarker(d,t,r,o,a,s,!1,l,p,m,y)}g&&o.pop()}}_analyzeTextGraphic(e,r,i,o,a,s,l,n){const p=[];M.findApplicableOverrides(i,this._primitiveOverrides,p);const c=i.geometry;if(!("x"in c)||!("y"in c))return;const m=i.symbol,y=F(m),d=X(m.fontStyleName),f=t(m.fontFamilyName);m.font={family:f,decoration:y,...d};const h=V(m.height,O.CIMTextSymbol.height),u=V(m.angle),v=V(m.offsetX),g=V(m.offsetY),{haloSymbol:S}=m,_=V(m.haloSize,0);let k=[0,0,0,0];if(S?.symbolLayers?.length){const e=S.symbolLayers;for(const t of e)if(t.color){k=this._getValueOrOverrideExpression(m?.haloSymbol?.type??"CIMPolygonSymbol",t.primitiveName,"Color",P(t.color));break}}const C=i.primitiveName;let b=[0,0,0,1],x=[0,0,0,0],z=0,E=!1;if(m.symbol?.symbolLayers)for(const t of m.symbol.symbolLayers){const e=t.primitiveName;if("CIMSolidStroke"===t.type)x=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Color",P(t.color)),z=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Width",w(t)??0);else if("CIMSolidFill"===t.type){const r=P(t.color);E=E??!!t.colorLocked,b=this._getValueOrOverrideExpression("CIMSolidFill",e??C,"Color",r)}}let I=null,L=null,N=null,R=null,A=null;C&&(I=this._maybeGetValueOrOverrideExpression(C,"TextSize"),L=this._maybeGetValueOrOverrideExpression(C,"TextAngle"),N=this._maybeGetValueOrOverrideExpression(C,"TextOffsetX"),R=this._maybeGetValueOrOverrideExpression(C,"TextOffsetY"),E||(A=this._maybeGetValueOrOverrideExpression(C,"FillColor")));const G=A??b;let T=null,W=null,D=0;if(m.callout&&"CIMBackgroundCallout"===m.callout.type){const e=m.callout;if(e.backgroundSymbol){const t=e.backgroundSymbol.symbolLayers;if(t)for(const e of t)"CIMSolidFill"===e.type?T=P(e.color):"CIMSolidStroke"===e.type&&(W=P(e.color),D=V(e.width,O.CIMSolidStroke.width))}}const U=this._getValueOrOverrideExpression(m.type,i.primitiveName,"TextString",i.textString??"");if(null==U)return;const{fontStyleName:H}=m,J=f+(H?"-"+H.toLowerCase():"-regular"),B=this._getMaterialOverrides(o,m.type);B.push(...this._getPrimitiveMaterialOverrides(i.primitiveName,m.type)),this._collectDictionaryTemplateOverrides(B,i);const q={type:"text-rasterization-param",resource:{type:"text",textString:i.textString??"",font:m.font,symbol:m,primitiveName:i.primitiveName},overrides:B};this._cimLayers.push({type:"text",lineWidth:m.lineWidth,textRasterizationParam:q,colorLocked:!!n||!!E,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:J,decoration:y,haloSize:_,haloColor:k,weight:d.weight,style:d.style,size:I??h,angle:L??u,offsetX:N??v,offsetY:R??g,transform:{type:"cim-marker-transform-param",params:l},horizontalAlignment:Y(m.horizontalAlignment),verticalAlignment:j(m.verticalAlignment),text:U,color:G,outlineColor:x,outlineSize:z,backgroundColor:T,borderLineColor:W,borderLineWidth:D,referenceSize:s,sizeRatio:1,markerPlacement:r})}_collectDictionaryTemplateOverrides(e,t){if(t.textString&&this._hasTextStringTemplates){const r=W(t.symbol);e.push({propertyName:"textString",defaultValue:"",valueExpressionInfo:{type:"dictionary-template",textCase:r,template:t.textString},primitiveName:t.primitiveName})}}_analyzeMultiLayerGraphicNonSDF(e,t,r,i,a,s,l,n,p,c,m,y){const d=Z(e,i),f=e.primitiveName,h=this._analyzeMaterialOverrides(f,["Rotation","OffsetX","OffsetY"]),v=N(h),[g,S,_]=u.getTextureAnchor(d,this._resourceManager,J),M=this._getMaterialOverrides(a,e.type);M.push(...v);const k={type:"sprite-rasterization-param",resource:{...d,avoidSDFRasterization:!0},overrides:M},C=V(e.size,O.CIMVectorMarker.size),b=this._getValueOrOverrideExpression(e.type,f,"Size",C);this._cimLayers.push({type:"marker",spriteRasterizationParam:k,colorLocked:m,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:g,y:S},isAbsoluteAnchorPoint:!1,size:c,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:n},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:c,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:_/o(e.size),isOutline:y,markerPlacement:r,animationParams:se(p),baseSize:b})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return M.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-param",placement:e,overrides:ae(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return M.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-gif-animation-params",animation:e,overrides:ae(t)}}_analyzeCompositeMarkerGraphic(e,t,r,i,o,a,s,l,n,p,c){const m=i.geometry,y=o[0],d=o[1],f=k(m);if(!f)return;const h="Relative"!==e.anchorPointUnits,u=V(y.width,O.CIMSolidStroke.width),{frameSizeRatio:v,anchorX:g,anchorY:S,widthRatio:_,sdfPaddingRatio:M}=C(f,e.frame,e.size,e.anchorPoint,h,u,e.scaleSymbolsProportionally),{path:b}=d,x=d.primitiveName,z=y.primitiveName,E=i.primitiveName;let I=null;d.colorLocked||p||(I=this._maybeGetValueOrOverrideExpression(E,"FillColor"));const L=I??this._getValueOrOverrideExpression(d.type,x,"Color",P(d.color));let N=null;y.colorLocked||p||(N=this._maybeGetValueOrOverrideExpression(E,"StrokeColor"));const R=N??this._getValueOrOverrideExpression(y.type,z,"Color",P(y.color)),A=this._maybeGetValueOrOverrideExpression(E,"StrokeWidth")??this._getValueOrOverrideExpression(y.type,z,"Width",u),w={type:"sprite-rasterization-param",resource:b?{type:"path",path:b,asFill:!0}:{type:"sdf",geom:m,sdfPaddingRatio:M,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:w,colorLocked:p,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:g,y:S},isAbsoluteAnchorPoint:h,size:n,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:n,widthRatio:_,rotateClockwise:!1,referenceSize:s,sizeRatio:v,color:L,outlineColor:R,outlineWidth:A,isOutline:c,markerPlacement:r})}_setPoMap(e,t,r){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[t]=r}_maybeGetValueOrOverrideExpression(e,t,r){return this._getValueOrOverrideExpression("",e,t,r,!1)}_getValueOrOverrideExpression(e,t,r,i,o=!0){if(o&&!D(i)&&(i=R(e,r.toLowerCase())),null==t)return i;const a=this._poMap[t];if(null==a)return i;const s=a[r];return"string"==typeof s||"number"==typeof s||Array.isArray(s)?s:s?{valueExpressionInfo:s,defaultValue:i}:i}_analyzePrimitiveOverrides(e,t,r,i){if(null==e)return!1;"string"==typeof e&&(e=[e]);for(const o of this._primitiveOverrides)if(e.includes(o.primitiveName)&&o.valueExpressionInfo)return!0;if(null!=t)for(const o of t)if(o?.overrides.length>0)return!0;if(null!=r)for(const o of r)if(o?.overrides.length>0)return!0;if(null!=i)for(const o of i)if(o?.overrides.length>0)return!0;return!1}_getMaterialOverrides(e,t){if(!e)return[];const r=[];for(const i of e)r.push(...this._getPrimitiveMaterialOverrides(i,t));return r}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const r=N(this._primitiveOverrides.filter((t=>t.primitiveName===e)));return r.forEach((e=>e.defaultValue=R(t,e.propertyName.toLowerCase()))),r}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter((r=>r.primitiveName!==e||!t.includes(r.propertyName)))}}function Z(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}function $(e){if(e&&0===e.indexOf("Level_")){const t=parseInt(e.slice(6),10);if(!isNaN(t))return t}return 0}function ee(e,t){if(!t||0===t.length)return e;const i=r(e);return M.applyOverrides(i,t),i}const te=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&null==e[0].path&&null==e[1].path&&!e[0].effects&&!e[1].effects&&!e[0].animations&&!e[1].animations;function re(e){const t=e.symbolLayers;if(!t)return!1;const r=t.find((e=>e.effects?.find((e=>"CIMGeometricEffectDashes"===e.type&&null!=e.dashTemplate)))),i=t.find((e=>e.effects?.find((e=>"CIMGeometricEffectAddControlPoints"===e.type))));return!!r||!!i}function ie(e){return e.some((e=>"CIMSolidFill"!==e.type&&"CIMSolidStroke"!==e.type&&("CIMVectorMarker"!==e.type&&"CIMPictureMarker"!==e.type||null!=e.markerPlacement)))}function oe(e,t){if(t?.some((e=>"CIMGeometricEffectRadial"===e.type))&&t?.some((e=>"CIMGeometricEffectTaperedPolygon"===e.type))&&2===e.length){const t=e.find((e=>"CIMSolidFill"===e.type)),r=e.find((e=>"CIMSolidStroke"===e.type)),i=r?.effects?.some((e=>"CIMGeometricEffectDashes"===e.type));if(null!=t&&null!=r&&!i)return!0}return!1}function ae(e){return r(e).map((e=>({...e,propertyName:U(e.propertyName)})))}function se(e){return h(e)?{type:"animation-params",params:e}:null}export{Q as CIMAnalyzer,ee as analyzeCIMResource};
5
+ import{isRGB as e}from"../../core/colorUtils.js";import{getFontFamily as t}from"../../core/fontUtils.js";import"../../core/has.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{pt2px as o,px2pt as a}from"../../core/screenUtils.js";import{numericHash as s}from"../../core/string.js";import{checkForAnimations as l,getAnimationParams as n,handleAbsoluteAnchor as p,handleMarker as c,handleRelativeAnchor as m,getFrameTranslation as y,translate as d,getStaticParam as h,shouldUseAnimatedPath as f}from"./animationUtils.js";import{CIMSymbolHelper as u}from"./CIMSymbolHelper.js";import{antialiasingOutlineFillSettings as v}from"./constants.js";import{defaultCIMValues as O}from"./defaultCIMValues.js";import{Alignment as g,SymbolUnits as _}from"./enums.js";import{fitVectorMarker as S}from"./fitVectorMarker.js";import{OverrideHelper as M}from"./OverrideHelper.js";import{getExtent as k,getSDFMetrics as C,getSDFDimensions as b}from"./SDFHelper.js";import{colorToArray as x,normalizeAlpha as P,getSize as z,isCIMMarkerStrokePlacement as E,hasStrokeLayer as I,getTintColor as L,getNumericValue as V,normalizePrimitiveOverrideProps as N,getDefaultCIMValue as R,getEnum as A,getStrokeWidth as w,getFillColor as G,getStrokeColor as T,fromCIMFontDecoration as F,fromCIMFontStyle as X,fromCIMVerticalAlignment as j,fromCIMHorizontalAlignment as Y,getTextCasing as W,isValidCIMValue as D,uncapitalize as U}from"./utils.js";import{CIMEffectHelper as H}from"./effects/CIMEffectHelper.js";import{rasterizedVectorMarkerMinSize as J,randomInsidePolygonTextureSize as B}from"../../views/2d/engine/webgl/definitions.js";const q=()=>i.getLogger("esri.symbols.cim.cimAnalyzer");function K(e){const t=e.markerPlacement;return t&&t.angleToLine?g.MAP:g.SCREEN}class Q{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._hasTextStringTemplates=!1,e&&(this._resourceManager=e)}analyzeSymbolReference(t,r,i){if(this._cimLayers=i??[],!t)return this._cimLayers;if(this._reset(),this._hasTextStringTemplates=t.hasTextStringTemplates??!1,t.primitiveOverrides){this._primitiveOverrides=t.primitiveOverrides;for(const t of this._primitiveOverrides){const r=t.valueExpressionInfo;if(r)this._setPoMap(t.primitiveName,t.propertyName,r);else if(null!=t.value){let r=t.value;t.propertyName.includes("Color")&&(e(r)&&(r=x(r)),r=P(r)),this._setPoMap(t.primitiveName,t.propertyName,r)}}}return this._analyzeSymbol(t.symbol,r),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const r=e?.symbolLayers;if(!r)return;for(let l=0;l<r.length;l++){const e=r[l];"CIMVectorMarker"===e.type&&(r[l]=S(e,this._resourceManager.geometryEngine))}const i=e.effects;let o=g.SCREEN;const a=z(e)??0;if("CIMPointSymbol"===e.type&&"Map"===e.angleAlignment&&(o=g.MAP),oe(r,i))return this._analyzeCompositeOutlineFill(r,i,a);let s={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],shift:[1,1,1,1],hasAnimations:l(e),hasShiftAnimation:!1};s=n(this._poMap,e,s);const p="CIMPolygonSymbol"===e.type;let c=r.length;for(;c--;){const l=r[c];if(!l||!1===l.enable)continue;let n;i?.length&&(n=[...i]);const m=l.effects;m?.length&&(i?n.push(...m):n=[...m]);let y=null;if(n){y=[];for(const e of n){const t=M.findEffectOverrides(e,this._primitiveOverrides);t&&y.push(t)}}const d=[];switch(M.findApplicableOverrides(l,this._primitiveOverrides,d),l.type){case"CIMSolidFill":this._analyzeSolidFill(l,y,s,I(r));break;case"CIMPictureFill":this._analyzePictureFill(l,y,s);break;case"CIMHatchFill":this._analyzeHatchFill(l,y);break;case"CIMGradientFill":this._analyzeGradientFill(l,y);break;case"CIMSolidStroke":this._analyzeSolidStroke(l,y,p,a,s);break;case"CIMPictureStroke":this._analyzePictureStroke(l,y,p,a,s);break;case"CIMGradientStroke":this._analyzeGradientStroke(l,y,p,a);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{"CIMLineSymbol"!==e.type&&"CIMPolygonSymbol"!==e.type||(o=K(l));const r=[],i=l.primitiveName;i&&r.push(i);const n=p&&E(l.markerPlacement);this._analyzeMarker(l,y,null,r,o,a,t,[],s,!1,n);break}default:q().error("Cannot analyze CIM layer",l.type)}}}_analyzeSolidFill(e,t,r,i){const{primitiveName:o,type:a}=e,s=P(e.color),l=n(this._poMap,e,r);if(i||!t?.some((e=>"CIMGeometricEffectTaperedPolygon"===e.effect.type)))this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(a,o,"Color",s),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1,animationParams:se(l)});else{const r=this._getValueOrOverrideExpression(a,o,"Color",s);this._cimLayers.push({type:"outlineFill",colorLocked:!!e.colorLocked,color:r,effects:t,outlineColor:r,outlineColorLocked:!!e.colorLocked,...v,outlineEffects:t})}}_analyzePictureFill(e,t,r){const{primitiveName:i,type:o}=e,a=L(e),s=V(e.height,O.CIMPictureFill.height);let l=V(e.scaleX,1);if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height),l/=r*(s/t)}const p={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(i,o)},c=n(this._poMap,e,r);this._cimLayers.push({type:"fill",spriteRasterizationParam:p,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,i,"TintColor",a),height:this._getValueOrOverrideExpression(o,i,"Height",s),scaleX:this._getValueOrOverrideExpression(o,i,"ScaleX",l),angle:this._getValueOrOverrideExpression(o,i,"Rotation",V(e.rotation)),offsetX:this._getValueOrOverrideExpression(o,i,"OffsetX",V(e.offsetX)),offsetY:this._getValueOrOverrideExpression(o,i,"OffsetY",V(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1,animationParams:se(c)})}_analyzeHatchFill(e,t){const{primitiveName:r,type:i}=e,o=this._analyzeMaterialOverrides(r,["Rotation","OffsetX","OffsetY"]),a=N(o);let s=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const p of e.lineSymbol.symbolLayers){if("CIMSolidStroke"!==p.type)continue;const e=p.primitiveName??r;l||!e||p.colorLocked||null==this._poMap[e]?.Color&&null==this._poMap[e]?.StrokeColor||(s=P(p.color),s=this._maybeGetValueOrOverrideExpression(e,"StrokeColor")??this._getValueOrOverrideExpression(i,e,"Color",s),l=!0);const t=this._maybeGetValueOrOverrideExpression(e,"StrokeWidth");if(t){let r=null,o=null;"number"==typeof t?r=t:o=t.valueExpressionInfo;let s=a.find((e=>"strokeWidth"===e.propertyName));s?s.propertyName="width":(s={type:"CIMPrimitiveOverride",primitiveName:e,propertyName:"width",valueExpressionInfo:o,value:r,defaultValue:R(i,"width")},a.push(s))}}const n={type:"sprite-rasterization-param",resource:e,overrides:a};this._cimLayers.push({type:"fill",spriteRasterizationParam:n,colorLocked:!!e.colorLocked,effects:t,color:s,height:this._getValueOrOverrideExpression(i,r,"Separation",V(e.separation,O.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,r,"Rotation",V(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,r,"OffsetX",V(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,r,"OffsetY",V(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,t){const{angle:r,gradientMethod:i,gradientSize:o,gradientSizeUnits:a,gradientType:s,interval:l,primitiveName:n,type:p}=e,c=O.CIMGradientFill,m=e.colorRamp;this._cimLayers.push({type:"gradientFill",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(n,p)},colorLocked:!1,effects:t,color:[255,255,255,1],gradientMethod:this._getValueOrOverrideExpression(p,n,"GradientMethod",i??"Linear"),angle:this._getValueOrOverrideExpression(p,n,"Angle",V(r,c.angle)),gradientType:this._getValueOrOverrideExpression(p,n,"GradientType",s??c.gradientType),interval:this._getValueOrOverrideExpression(p,n,"Interval",V(l,"CIMFixedColorRamp"===m.type?m.colors.length:c.interval)),gradientSize:this._getValueOrOverrideExpression(p,n,"GradientSize",V(o,c.gradientSize)),gradientSizeUnits:"Absolute"===a?_.Absolute:"Relative"===a?_.Relative:c.gradientSizeUnits})}_analyzeCompositeOutlineFill(e,t,r){const i=e.find((e=>"CIMSolidFill"===e.type)),o=e.find((e=>"CIMSolidStroke"===e.type));if(null==i||null==o)return;const a=[...t??[],...i.effects??[]].map((e=>M.findEffectOverrides(e,this._primitiveOverrides))).filter((e=>null!=e)),s=[...t??[],...o.effects??[]].map((e=>M.findEffectOverrides(e,this._primitiveOverrides))).filter((e=>null!=e)),l=V(o.width,O.CIMSolidStroke.width),n=A(o.capStyle,O.CIMSolidStroke.capstyle),p=A(o.joinStyle,O.CIMSolidStroke.joinstyle),c=o.miterLimit;this._cimLayers.push({type:"outlineFill",colorLocked:!!i.colorLocked,color:this._getValueOrOverrideExpression(i.type,i.primitiveName,"Color",P(i.color)),effects:a,outlineColorLocked:!!o.colorLocked,outlineColor:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Color",P(o.color)),outlineWidth:this._getValueOrOverrideExpression(o.type,o.primitiveName,"Width",l),cap:this._getValueOrOverrideExpression(o.type,o.primitiveName,"CapStyle",n),join:this._getValueOrOverrideExpression(o.type,o.primitiveName,"JoinStyle",p),miterLimit:c&&this._getValueOrOverrideExpression(o.type,o.primitiveName,"MiterLimit",c),referenceWidth:r,outlineEffects:s})}_analyzeSolidStroke(e,t,r,i,o){const{primitiveName:a,type:s}=e,l=P(e.color),p=V(e.width,O.CIMSolidStroke.width),c=A(e.capStyle,O.CIMSolidStroke.capstyle),m=A(e.joinStyle,O.CIMSolidStroke.joinstyle),y=e.miterLimit;let d,h,f,u,v=[];if(this._analyzePrimitiveOverrides(a,t,null,null)&&(v=this._getPrimitiveMaterialOverrides(a,s)),t&&Array.isArray(t)&&t.length>0){const e=t[t.length-1].effect;e&&"CIMGeometricEffectDashes"===e.type&&"NoConstraint"===e.lineDashEnding&&(d=e.dashTemplate,h=e.scaleDash,f=e.offsetAlongLine,u=e.primitiveName,(t=[...t]).pop())}null!=u&&v.push(...this._getPrimitiveMaterialOverrides(u,s).filter((e=>"dashTemplate"===e.propertyName)));const g=void 0!==d?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:d,primitiveName:u},overrides:v}:null,_=n(this._poMap,e,o);this._cimLayers.push({type:"line",spriteRasterizationParam:g,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"Color",l),width:this._getValueOrOverrideExpression(s,a,"Width",p),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",c),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",m),miterLimit:y&&this._getValueOrOverrideExpression(s,a,"MiterLimit",y),referenceWidth:i,zOrder:$(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(u,"DashTemplate")??d,offsetAlongLine:this._getValueOrOverrideExpression(s,u,"OffsetAlongLine",f??0),scaleDash:h,sampleAlphaOnly:!0,animationParams:se(_)})}_analyzePictureStroke(e,t,r,i,o){const{primitiveName:a,type:s}=e,l=L(e),p=V(e.width,O.CIMPictureStroke.width),c=A(e.capStyle,O.CIMPictureStroke.capstyle),m=A(e.joinStyle,O.CIMPictureStroke.joinstyle),y=e.miterLimit,d={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(a,s)},h=n(this._poMap,e,o);this._cimLayers.push({type:"line",spriteRasterizationParam:d,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"TintColor",l),width:this._getValueOrOverrideExpression(s,a,"Width",p),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",c),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",m),miterLimit:y&&this._getValueOrOverrideExpression(s,a,"MiterLimit",y),referenceWidth:i,zOrder:$(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1,animationParams:se(h)})}_analyzeGradientStroke(e,t,r,i){const{gradientMethod:o,gradientSize:a,gradientSizeUnits:s,gradientType:l,interval:n,primitiveName:p,type:c}=e,m=O.CIMGradientStroke,y=V(e.width,m.width),d=A(e.capStyle,m.capstyle),h=A(e.joinStyle,m.joinstyle),f=e.miterLimit,u=e.colorRamp;this._cimLayers.push({type:"gradientStroke",spriteRasterizationParam:{type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(p,c)},colorLocked:!!e.colorLocked,effects:t,color:[255,255,255,1],width:this._getValueOrOverrideExpression(c,p,"Width",y),cap:this._getValueOrOverrideExpression(c,p,"CapStyle",d),join:this._getValueOrOverrideExpression(c,p,"JoinStyle",h),miterLimit:f&&this._getValueOrOverrideExpression(c,p,"MiterLimit",f),referenceWidth:i,isOutline:r,gradientMethod:this._getValueOrOverrideExpression(c,p,"GradientMethod",o??m.gradientMethod),gradientType:this._getValueOrOverrideExpression(c,p,"GradientType",l??m.gradientType),interval:this._getValueOrOverrideExpression(c,p,"Interval",V(n,"CIMFixedColorRamp"===u.type?u.colors.length:m.interval)),gradientSize:this._getValueOrOverrideExpression(c,p,"GradientSize",V(a,m.gradientSize)),gradientSizeUnits:"Absolute"===s?_.Absolute:"Relative"===s?_.Relative:m.gradientSizeUnits})}_analyzeMarker(e,t,r,i,o,a,s,l,y,d=!1,h=!1){d||=!!e.colorLocked;let f=y;if(f=p(e,f),f=c(this._poMap,e,f),f=m(e,f),f=n(this._poMap,e,f),this._analyzeMarkerInsidePolygon(e,t,d,f))return;const u=V(e.size,O.CIMVectorMarker.size),v=V(e.rotation),g=V(e.offsetX),_=V(e.offsetY),{primitiveName:S,type:M}=e,k=this._getValueOrOverrideExpression(M,S,"Size",u),C=this._getValueOrOverrideExpression(M,S,"Rotation",v),b=this._getValueOrOverrideExpression(M,S,"OffsetX",g),x=this._getValueOrOverrideExpression(M,S,"OffsetY",_);switch(e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,r,i,o,a,k,C,b,x,l,f,d,h);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,r,i,o,a,k,C,b,x,l,f,s,d,h)}}_analyzeMarkerInsidePolygon(e,t,r,i){const{markerPlacement:o,type:s}=e;if(!o||"CIMMarkerPlacementInsidePolygon"!==o.type||i.hasAnimations)return!1;if("CIMVectorMarker"===s||"CIMPictureMarker"===s){const r=e.primitiveName;if(r&&this._analyzePrimitiveOverrides([r],t,null,null))return!1;const i=o.primitiveName;if(i&&this._analyzePrimitiveOverrides([i],t,null,null))return!1;if("CIMVectorMarker"===s){const{markerGraphics:t}=e;if(t)for(const e of t){const{symbol:t}=e;if("CIMPolygonSymbol"===t?.type&&t.symbolLayers){const{symbolLayers:e}=t;for(const t of e)if("CIMSolidStroke"===t.type)return!1}}}else{const{animatedSymbolProperties:t}=e;if(t)return!1}}const l=Math.abs(o.stepX),n=Math.abs(o.stepY);if(0===l||0===n)return!0;let p,c;if("Random"===o.gridType){const e=a(B),t=Math.max(Math.floor(e/l),1);p=n*Math.max(Math.floor(e/n),1);c=t*l/p}else o.shiftOddRows?(p=2*n,c=l/n*.5):(p=n,c=l/n);const m=L(e),y="CIMCharacterMarker"===e.type?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:y,colorLocked:r,effects:t,color:m,height:p,scaleX:c,angle:o.gridAngle,offsetX:V(o.offsetX),offsetY:V(o.offsetY),applyRandomOffset:"Random"===o.gridType,sampleAlphaOnly:"CIMPictureMarker"!==e.type,hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,i,o,a,l,n,p,c,m,y,d,h,f){const{animatedSymbolProperties:u,primitiveName:v,type:O}=e;let g=V(e.scaleX,1);const _=L(e);i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const S=this._createGIFAnimatedSymbolPropertiesOverrideExpression(u),M=e.anchorPoint??{x:0,y:0};if("width"in e&&"number"==typeof e.width){const t=e.width;let r=1;const i=this._resourceManager.getResource(e.url);null!=i&&(r=i.width/i.height);g/=r*(V(e.size)/t)}const k=[...o];let C;e.primitiveName&&k.push(e.primitiveName),u||S?C={type:"animated",url:e.url,urlHash:"H"+s(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(C=r(e),C.markerPlacement=null);const b={type:"sprite-rasterization-param",resource:C,overrides:this._getMaterialOverrides(k,O)};S&&b.overrides.push(...S.overrides);const x=n;this._cimLayers.push({type:"marker",spriteRasterizationParam:b,colorLocked:h,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(O,v,"ScaleX",g),rotation:p,offsetX:c,offsetY:m,transform:{type:"cim-marker-transform-param",params:y},color:this._getValueOrOverrideExpression(O,v,"TintColor",_),anchorPoint:{x:M.x,y:M.y},isAbsoluteAnchorPoint:"Relative"!==e.anchorPointUnits,outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:1,isOutline:f,markerPlacement:i,animationParams:se(d),baseSize:x})}_analyzeVectorMarker(e,t,r,i,o,a,s,l,p,c,m,f,u,v,O){const g=e.markerGraphics;if(!g)return;const _=e.frame;let S=0;S=_?_.ymax-_.ymin:a;const M=!!e.scaleSymbolsProportionally;if(S){const t={offsetX:p,offsetY:c,rotation:l,size:s,frameHeight:S,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:M};m=[...m,t]}r||(r=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const k of g)if(k){const s=k.symbol;if(!s)continue;const l=k.primitiveName;l&&i.push(l);let p,c=f;if(("CIMPointSymbol"===s.type||"CIMTextSymbol"===s.type)&&_){let t=0,r=0;const i=k.geometry;"x"in i&&"y"in i&&(t+=i.x-.5*(_.xmin+_.xmax),r+=i.y-.5*(_.ymin+_.ymax));const o=e.anchorPoint;let a=!1;o&&("Absolute"===e.anchorPointUnits?(t-=o.x,r-=o.y,a=!0):_&&(t-=(_.xmax-_.xmin)*o.x,r-=(_.ymax-_.ymin)*o.y));const s={offsetX:t,offsetY:r,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:a,scaleSymbolsProportionally:M};p=[...m,s]}const g=k.geometry,[C,b]=y(g,_);switch(0===C&&0===b||(c=d(c,C,b)),"CIMPointSymbol"===s.type&&(c=n(this._poMap,s,c)),s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":u||re(s)?(c={...c,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:h([0,0]),rotation:h(0),scale:h(S),parent:f.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,r,k,i,o,a,p??m,c,S,v,O)):this._analyzeMultiLayerGraphic(e,t,r,k,i,o,a,p??m,c,S,v,O);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,r,k,i,o,a,p??m,v)}l&&i.pop()}}_analyzeMultiLayerGraphic(e,t,r,i,o,a,s,l,n,p,c,m){const y=i.symbol.symbolLayers;y&&(!te(y)||f(n)?ie(y)?this._analyzeMultiLayerGraphicNonSDF(e,t,r,i,o,a,s,l,n,p,!!c,m):this._analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,n,p,c,m):this._analyzeCompositeMarkerGraphic(e,t,r,i,y,a,s,l,p,c,m))}_analyzeMarkerGraphicSymbolLayers(e,t,r,i,o,a,s,l,p,c,m,y){const d=i.symbol,h=d.symbolLayers;if(!h)return;const f=this._resourceManager.geometryEngine,u=H.applyEffects(d.effects,i.geometry,f);if(!u)return;let v=h.length;for(;v--;){const d=h[v];if(!d||!1===d.enable)continue;const g=d.primitiveName;switch(g&&o.push(g),d.type){case"CIMSolidFill":case"CIMSolidStroke":{const o=H.applyEffects(d.effects,u,f),h=k(o);if(!h)continue;const v="Relative"!==e.anchorPointUnits,_=w(d)??0,{frameSizeRatio:S,anchorX:M,anchorY:x,widthRatio:z,sdfPaddingRatio:E}=C(h,e.frame,e.size,e.anchorPoint,v,_,e.scaleSymbolsProportionally),I="CIMSolidFill"===d.type,L={type:"sdf",geom:o,sdfPaddingRatio:E,asFill:I},{path:N}=d,R=I?P(G(d)):null==N?P(T(d)):[0,0,0,0],A=I?[0,0,0,0]:P(T(d));if(!I&&!_)break;const F=i.primitiveName;let X=null;I&&!d.colorLocked&&(X=this._maybeGetValueOrOverrideExpression(F,"FillColor"));let j=null;I||d.colorLocked||(j=this._maybeGetValueOrOverrideExpression(F,"StrokeColor"));const Y=X??this._getValueOrOverrideExpression(d.type,g,"Color",R),W=j??this._getValueOrOverrideExpression(d.type,g,"Color",A),D=this._maybeGetValueOrOverrideExpression(F,"StrokeWidth")??this._getValueOrOverrideExpression(d.type,g,"Width",_),U=N?{type:"sprite-rasterization-param",resource:{type:"path",path:N,asFill:I},overrides:[]}:{type:"sprite-rasterization-param",resource:L,overrides:[]},J=n(this._poMap,d,p),B=V(e.size,O.CIMVectorMarker.size),q=this._getValueOrOverrideExpression(e.type,e.primitiveName,"Size",B);this._cimLayers.push({type:"marker",spriteRasterizationParam:U,colorLocked:!!d.colorLocked||!!m,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:M,y:x},isAbsoluteAnchorPoint:v,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:c,widthRatio:z,rotateClockwise:!1,referenceSize:s,sizeRatio:S,color:Y,outlineColor:W,outlineWidth:D,isOutline:y,markerPlacement:r,animationParams:se(J),isStroke:"CIMSolidFill"!==d.type,baseSize:q,...b(o,E)});break}case"CIMPictureMarker":case"CIMVectorMarker":if(d.markerPlacement){q().error("Error analyzing CIM, got unexpected marker placement");break}this._analyzeMarker(d,t,r,o,a,s,!1,l,p,m,y)}g&&o.pop()}}_analyzeTextGraphic(e,r,i,o,a,s,l,n){const p=[];M.findApplicableOverrides(i,this._primitiveOverrides,p);const c=i.geometry;if(!("x"in c)||!("y"in c))return;const m=i.symbol,y=F(m),d=X(m.fontStyleName),h=t(m.fontFamilyName);m.font={family:h,decoration:y,...d};const f=V(m.height,O.CIMTextSymbol.height),u=V(m.angle),v=V(m.offsetX),g=V(m.offsetY),{haloSymbol:_}=m,S=V(m.haloSize,0);let k=[0,0,0,0];if(_?.symbolLayers?.length){const e=_.symbolLayers;for(const t of e)if(t.color){k=this._getValueOrOverrideExpression(m?.haloSymbol?.type??"CIMPolygonSymbol",t.primitiveName,"Color",P(t.color));break}}const C=i.primitiveName;let b=[0,0,0,1],x=[0,0,0,0],z=0,E=!1;if(m.symbol?.symbolLayers)for(const t of m.symbol.symbolLayers){const e=t.primitiveName;if("CIMSolidStroke"===t.type)x=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Color",P(t.color)),z=this._getValueOrOverrideExpression("CIMSolidStroke",e,"Width",w(t)??0);else if("CIMSolidFill"===t.type){const r=P(t.color);E=E??!!t.colorLocked,b=this._getValueOrOverrideExpression("CIMSolidFill",e??C,"Color",r)}}let I=null,L=null,N=null,R=null,A=null;C&&(I=this._maybeGetValueOrOverrideExpression(C,"TextSize"),L=this._maybeGetValueOrOverrideExpression(C,"TextAngle"),N=this._maybeGetValueOrOverrideExpression(C,"TextOffsetX"),R=this._maybeGetValueOrOverrideExpression(C,"TextOffsetY"),E||(A=this._maybeGetValueOrOverrideExpression(C,"FillColor")));const G=A??b;let T=null,W=null,D=0;if(m.callout&&"CIMBackgroundCallout"===m.callout.type){const e=m.callout;if(e.backgroundSymbol){const t=e.backgroundSymbol.symbolLayers;if(t)for(const e of t)"CIMSolidFill"===e.type?T=P(e.color):"CIMSolidStroke"===e.type&&(W=P(e.color),D=V(e.width,O.CIMSolidStroke.width))}}const U=this._getValueOrOverrideExpression(m.type,i.primitiveName,"TextString",i.textString??"");if(null==U)return;const{fontStyleName:H}=m,J=h+(H?"-"+H.toLowerCase():"-regular"),B=this._getMaterialOverrides(o,m.type);B.push(...this._getPrimitiveMaterialOverrides(i.primitiveName,m.type)),this._collectDictionaryTemplateOverrides(B,i);const q={type:"text-rasterization-param",resource:{type:"text",textString:i.textString??"",font:m.font,symbol:m,primitiveName:i.primitiveName},overrides:B};this._cimLayers.push({type:"text",lineWidth:m.lineWidth,textRasterizationParam:q,colorLocked:!!n||!!E,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:J,decoration:y,haloSize:S,haloColor:k,weight:d.weight,style:d.style,size:I??f,angle:L??u,offsetX:N??v,offsetY:R??g,transform:{type:"cim-marker-transform-param",params:l},horizontalAlignment:Y(m.horizontalAlignment),verticalAlignment:j(m.verticalAlignment),text:U,color:G,outlineColor:x,outlineSize:z,backgroundColor:T,borderLineColor:W,borderLineWidth:D,referenceSize:s,sizeRatio:1,markerPlacement:r})}_collectDictionaryTemplateOverrides(e,t){if(t.textString&&this._hasTextStringTemplates){const r=W(t.symbol);e.push({propertyName:"textString",defaultValue:"",valueExpressionInfo:{type:"dictionary-template",textCase:r,template:t.textString},primitiveName:t.primitiveName})}}_analyzeMultiLayerGraphicNonSDF(e,t,r,i,a,s,l,n,p,c,m,y){const d=Z(e,i),h=e.primitiveName,f=this._analyzeMaterialOverrides(h,["Rotation","OffsetX","OffsetY"]),v=N(f),[g,_,S]=u.getTextureAnchor(d,this._resourceManager,J),M=this._getMaterialOverrides(a,e.type);M.push(...v);const k={type:"sprite-rasterization-param",resource:{...d,avoidSDFRasterization:!0},overrides:M},C=V(e.size,O.CIMVectorMarker.size),b=this._getValueOrOverrideExpression(e.type,h,"Size",C);this._cimLayers.push({type:"marker",spriteRasterizationParam:k,colorLocked:m,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:s,anchorPoint:{x:g,y:_},isAbsoluteAnchorPoint:!1,size:c,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:n},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:c,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:S/o(e.size),isOutline:y,markerPlacement:r,animationParams:se(p),baseSize:b})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return M.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-param",placement:e,overrides:ae(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return M.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-gif-animation-params",animation:e,overrides:ae(t)}}_analyzeCompositeMarkerGraphic(e,t,r,i,o,a,s,l,n,p,c){const m=i.geometry,y=o[0],d=o[1],h=k(m);if(!h)return;const f="Relative"!==e.anchorPointUnits,u=V(y.width,O.CIMSolidStroke.width),{frameSizeRatio:v,anchorX:g,anchorY:_,widthRatio:S,sdfPaddingRatio:M}=C(h,e.frame,e.size,e.anchorPoint,f,u,e.scaleSymbolsProportionally),{path:b}=d,x=d.primitiveName,z=y.primitiveName,E=i.primitiveName;let I=null;d.colorLocked||p||(I=this._maybeGetValueOrOverrideExpression(E,"FillColor"));const L=I??this._getValueOrOverrideExpression(d.type,x,"Color",P(d.color));let N=null;y.colorLocked||p||(N=this._maybeGetValueOrOverrideExpression(E,"StrokeColor"));const R=N??this._getValueOrOverrideExpression(y.type,z,"Color",P(y.color)),A=this._maybeGetValueOrOverrideExpression(E,"StrokeWidth")??this._getValueOrOverrideExpression(y.type,z,"Width",u),w={type:"sprite-rasterization-param",resource:b?{type:"path",path:b,asFill:!0}:{type:"sdf",geom:m,sdfPaddingRatio:M,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:w,colorLocked:p,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:g,y:_},isAbsoluteAnchorPoint:f,size:n,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:n,widthRatio:S,rotateClockwise:!1,referenceSize:s,sizeRatio:v,color:L,outlineColor:R,outlineWidth:A,isOutline:c,markerPlacement:r})}_setPoMap(e,t,r){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[t]=r}_maybeGetValueOrOverrideExpression(e,t,r){return this._getValueOrOverrideExpression("",e,t,r,!1)}_getValueOrOverrideExpression(e,t,r,i,o=!0){if(o&&!D(i)&&(i=R(e,r.toLowerCase())),null==t)return i;const a=this._poMap[t];if(null==a)return i;const s=a[r];return"string"==typeof s||"number"==typeof s||Array.isArray(s)?s:s?{valueExpressionInfo:s,defaultValue:i}:i}_analyzePrimitiveOverrides(e,t,r,i){if(null==e)return!1;"string"==typeof e&&(e=[e]);for(const o of this._primitiveOverrides)if(e.includes(o.primitiveName)&&o.valueExpressionInfo)return!0;if(null!=t)for(const o of t)if(o?.overrides.length>0)return!0;if(null!=r)for(const o of r)if(o?.overrides.length>0)return!0;if(null!=i)for(const o of i)if(o?.overrides.length>0)return!0;return!1}_getMaterialOverrides(e,t){if(!e)return[];const r=[];for(const i of e)r.push(...this._getPrimitiveMaterialOverrides(i,t));return r}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const r=N(this._primitiveOverrides.filter((t=>t.primitiveName===e)));return r.forEach((e=>e.defaultValue=R(t,e.propertyName.toLowerCase()))),r}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter((r=>r.primitiveName!==e||!t.includes(r.propertyName)))}}function Z(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}function $(e){if(e&&0===e.indexOf("Level_")){const t=parseInt(e.slice(6),10);if(!isNaN(t))return t}return 0}function ee(e,t){if(!t||0===t.length)return e;const i=r(e);return M.applyOverrides(i,t),i}const te=e=>e&&2===e.length&&e[0].enable&&e[1].enable&&"CIMSolidStroke"===e[0].type&&"CIMSolidFill"===e[1].type&&null==e[0].path&&null==e[1].path&&!e[0].effects&&!e[1].effects&&!e[0].animations&&!e[1].animations;function re(e){const t=e.symbolLayers;if(!t)return!1;const r=t.find((e=>e.effects?.find((e=>"CIMGeometricEffectDashes"===e.type&&null!=e.dashTemplate)))),i=t.find((e=>e.effects?.find((e=>"CIMGeometricEffectAddControlPoints"===e.type))));return!!r||!!i}function ie(e){return e.some((e=>"CIMSolidFill"!==e.type&&"CIMSolidStroke"!==e.type&&("CIMVectorMarker"!==e.type&&"CIMPictureMarker"!==e.type||null!=e.markerPlacement)))}function oe(e,t){if(t?.some((e=>"CIMGeometricEffectRadial"===e.type))&&t?.some((e=>"CIMGeometricEffectTaperedPolygon"===e.type))&&2===e.length){const t=e.find((e=>"CIMSolidFill"===e.type)),r=e.find((e=>"CIMSolidStroke"===e.type)),i=r?.effects?.some((e=>"CIMGeometricEffectDashes"===e.type));if(null!=t&&null!=r&&!i)return!0}return!1}function ae(e){return r(e).map((e=>({...e,propertyName:U(e.propertyName)})))}function se(e){return f(e)?{type:"animation-params",params:e}:null}export{Q as CIMAnalyzer,ee as analyzeCIMResource};
@@ -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{AnimatedSymbolEasingType as e,AnimatedSymbolRepeatType as t,SymbolUnits as o}from"./enums.js";const i={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderlinecolor:[0,0,0,1],tintcolor:[255,255,255,1]},n={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1,gradientMethod:"AcrossLine",gradientSize:75,gradientSizeUnits:o.Relative,gradientType:"Discrete",interval:5},CIMSolidFill:{enable:!0,colorlocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGradientFill:{enable:!0,angle:90,gradientMethod:"Linear",gradientSize:75,gradientSizeUnits:o.Relative,gradientType:"Discrete",interval:5},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry"},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRadial:{angle:0,length:5},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:t.Loop,repeatdelay:0,easing:e.Linear},CIMSymbolAnimationSize:{tosize:10},CIMSymbolAnimationScale:{scalefactor:1},CIMSymbolAnimationColor:{tocolor:[255,255,255,1]},CIMSymbolAnimationTransparency:{totransparency:0},CIMSymbolAnimationRotation:{torotation:0,rotateclockwise:!1},CIMSymbolAnimationOffset:{offsetx:0,offsety:0}};export{i as defaultCIMColor,n as defaultCIMValues};
5
+ import{AnimatedSymbolEasingType as e,AnimatedSymbolRepeatType as t,SymbolUnits as o}from"./enums.js";const i={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderlinecolor:[0,0,0,1],tintcolor:[255,255,255,1]},n={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1,gradientMethod:"AcrossLine",gradientSize:75,gradientSizeUnits:o.Relative,gradientType:"Discrete",interval:5},CIMSolidFill:{enable:!0,colorlocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGradientFill:{enable:!0,angle:90,gradientMethod:"Linear",gradientSize:75,gradientSizeUnits:o.Relative,gradientType:"Discrete",interval:5},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry"},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRadial:{angle:0,length:5},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:t.Loop,repeatdelay:0,easing:e.Linear},CIMSymbolAnimationSize:{tosize:10},CIMSymbolAnimationScale:{scalefactor:1},CIMSymbolAnimationColor:{tocolor:[255,255,255,1]},CIMSymbolAnimationTransparency:{totransparency:0},CIMSymbolAnimationRotation:{torotation:0,rotateclockwise:!1},CIMSymbolAnimationOffset:{offsetx:0,offsety:0},CIMSymbolAnimationMoveAlongLine:{speed:30,distanceAlong:100}};export{i as defaultCIMColor,n as defaultCIMValues};
@@ -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{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const l=" /-,\n";function i(e){let t=e.length;for(;t--;)if(!l.includes(e.charAt(t)))return!1;return!0}function a(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,i(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const l=t[e.slice(n,o)];l&&r.push([null,l,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,i(t)])}return r}function c(e,t,r){let n="",o=null;for(const l of t){const[t,r,i]=l;if(t)i?o=t:(o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);t&&(o&&(n+=o,o=null),n+=t)}}return u(n,r)}function s(e,t,r,n){let o="",l=null;for(const i of t){const[t,n,a]=i;if(t)a?l=t:(l&&(o+=l,l=null),o+=t);else{let t=n;null!=r&&(t=W(n,r));const i=e.attributes[t];i&&(l&&(o+=l,l=null),o+=i)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,l,i=!0){const a=t/o,c=r/l,s=Math.ceil(a/2),u=Math.ceil(c/2);for(let f=0;f<l;f++)for(let r=0;r<o;r++){const y=4*(r+(i?l-f-1:f)*o);let M=0,m=0,C=0,I=0,p=0,h=0,b=0;const d=(f+.5)*c;for(let n=Math.floor(f*c);n<(f+1)*c;n++){const o=Math.abs(d-(n+.5))/u,l=(r+.5)*a,i=o*o;for(let c=Math.floor(r*a);c<(r+1)*a;c++){let r=Math.abs(l-(c+.5))/s;const o=Math.sqrt(i+r*r);o>=-1&&o<=1&&(M=2*o*o*o-3*o*o+1,M>0&&(r=4*(c+n*t),b+=M*e[r+3],C+=M,e[r+3]<255&&(M=M*e[r+3]/250),I+=M*e[r],p+=M*e[r+1],h+=M*e[r+2],m+=M))}}n[y]=I/m,n[y+1]=p/m,n[y+2]=h/m,n[y+3]=b/C}}function y(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function M(e){return e.data?.symbol??null}function m(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function I(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function p(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const h=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?y(e.tintColor):[255,255,255,1],S=e=>{if(!e)return!1;for(const t of e)switch(t.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectDonut":case"CIMGeometricEffectOffset":case"CIMGeometricEffectTaperedPolygon":case"CIMGeometricEffectEnclosingPolygon":return!0}return!1};function P(){return import("../../geometry/geometryEngineJSON.js")}function g(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function L(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function T(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function A(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=A(t);if(null!=e)return e}break;case"CIMTextSymbol":return A(e.symbol);case"CIMSolidFill":return e.color}return null}function G(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=G(e);if(null!=t)return t}break}case"CIMTextSymbol":return G(e.symbol);case"CIMSolidStroke":return e.color}}function x(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function N(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=N(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return N(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function E(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function F(e){switch(e){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function v(e){return(e?Object.keys(e):[]).map((t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"})))}const V=e=>e.includes("data:image/svg+xml");function z(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":return null!=e.symbolLayers&&e.symbolLayers.some((e=>e.effects?.some((e=>"CIMGeometricEffectRadial"===e.type))))?"esriGeometryPolyline":"esriGeometryPoint";case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function O(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function D(e,t,r,n,o,l,i=!0){const{infos:a}=l;let c=1,s=0,u=0,f=0,y=1;for(const{absoluteAnchorPoint:C,offsetX:I,offsetY:p,rotation:h,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:S}of a){y=C?1:c;u=K(I,p,s,y,u),f=$(I,p,s,y,f),d&&(S||i)&&(c*=b/d),s=Q(h,k,s)}const M=K(n,o,s,y,u),m=$(n,o,s,y,f);return{size:e*c,rotation:Q(t,r,s),offsetX:M,offsetY:m}}function R(e){if(null==e)return!1;if(Array.isArray(e))return e.every((e=>R(e)));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function j(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function q(e){return e.split(" ").map((e=>Number(e)))}function B(e){return"string"==typeof e?q(e):e}function H(e){return e?.dashTemplate&&(e.dashTemplate=B(e.dashTemplate)),e}function J(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return J(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return J(e.symbol)}}return"Normal"}function U(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&p(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function W(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function X(e){return e.map((e=>({...e,propertyName:O(e.propertyName)})))}function Y(e){const t={};for(const r in e){const n=e[r];t[O(r)]=n}return t}function $(e,t,r,n,o){const l=r*Math.PI/180;if(l){const r=Math.cos(l);return(Math.sin(l)*e+r*t)*n+o}return t*n+o}function K(e,t,r,n,o){const l=r*Math.PI/180;if(l){return(Math.cos(l)*e-Math.sin(l)*t)*n+o}return e*n+o}function Q(e,t,r){return t?r-e:r+e}function Z(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let l=t[O(r)];if(null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]/255]:o&&(l*=Math.PI/180)),null==l&&(l=j(t.type,r.toLowerCase()),null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]]:o&&(l*=Math.PI/180))),null!=t.primitiveName){const i=e[t.primitiveName];if(null!=i){const e=i[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(l=e,null!=l&&(n?l=[l[0]/255,l[1]/255,l[2]/255,l[3]/255]:o&&(l*=Math.PI/180))):(l={valueExpressionInfo:e,defaultValue:l},null!=l&&(n?l={type:"Process",op:"ArcadeColor",value:l}:o&&(l={type:"Process",op:"Divide",left:l,right:180/Math.PI}))))}}if(null==l)throw new Error(`Failed to derive a value or an expression for "${r}".`);return l}function _(e,t){return Math.max(Math.min((e??t)/100,1),0)}export{u as adjustTextCase,a as analyzeTextParts,D as applyParentTransform,s as assignTextValuesFromFeature,v as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,T as fromCIMFontDecoration,L as fromCIMFontStyle,E as fromCIMHorizontalAlignment,F as fromCIMVerticalAlignment,j as getDefaultCIMValue,d as getEnum,W as getFieldName,A as getFillColor,g as getFontStyle,w as getFontWeight,h as getNumericValue,Z as getProcessParam,_ as getRelativeGradientSize,U as getSize,G as getStrokeColor,N as getStrokeWidth,J as getTextCasing,c as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,x as hasStrokeLayer,P as importGeometryEngine,I as isCIMFill,m as isCIMMarker,p as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,S as isGeometryEngineRequired,V as isSVGImage,R as isValidCIMValue,z as mapCIMSymbolToGeometryType,y as normalizeAlpha,H as normalizeDashEffectTemplate,B as normalizeDashTemplate,X as normalizePrimitiveOverrideProps,q as parseDashTemplate,f as resampleHermite,M as toCIMSymbolJSON,Y as toLowerCaseProps,O as uncapitalize};
5
+ import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const i=" /-,\n";function l(e){let t=e.length;for(;t--;)if(!i.includes(e.charAt(t)))return!1;return!0}function a(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,l(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const i=t[e.slice(n,o)];i&&r.push([null,i,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,l(t)])}return r}function c(e,t,r){let n="",o=null;for(const i of t){const[t,r,l]=i;if(t)l?o=t:(o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);t&&(o&&(n+=o,o=null),n+=t)}}return u(n,r)}function s(e,t,r,n){let o="",i=null;for(const l of t){const[t,n,a]=l;if(t)a?i=t:(i&&(o+=i,i=null),o+=t);else{let t=n;null!=r&&(t=W(n,r));const l=e.attributes[t];l&&(i&&(o+=i,i=null),o+=l)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,i,l=!0){const a=t/o,c=r/i,s=Math.ceil(a/2),u=Math.ceil(c/2);for(let f=0;f<i;f++)for(let r=0;r<o;r++){const y=4*(r+(l?i-f-1:f)*o);let M=0,m=0,C=0,I=0,p=0,h=0,b=0;const d=(f+.5)*c;for(let n=Math.floor(f*c);n<(f+1)*c;n++){const o=Math.abs(d-(n+.5))/u,i=(r+.5)*a,l=o*o;for(let c=Math.floor(r*a);c<(r+1)*a;c++){let r=Math.abs(i-(c+.5))/s;const o=Math.sqrt(l+r*r);o>=-1&&o<=1&&(M=2*o*o*o-3*o*o+1,M>0&&(r=4*(c+n*t),b+=M*e[r+3],C+=M,e[r+3]<255&&(M=M*e[r+3]/250),I+=M*e[r],p+=M*e[r+1],h+=M*e[r+2],m+=M))}}n[y]=I/m,n[y+1]=p/m,n[y+2]=h/m,n[y+3]=b/C}}function y(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function M(e){return e.data?.symbol??null}function m(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function I(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function p(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const h=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?y(e.tintColor):[255,255,255,1],S=e=>{if(!e)return!1;for(const t of e)switch(t.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectDonut":case"CIMGeometricEffectOffset":case"CIMGeometricEffectTaperedPolygon":case"CIMGeometricEffectEnclosingPolygon":return!0}return!1};function P(){return import("../../geometry/geometryEngineJSON.js")}function g(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function L(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function T(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function A(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=A(t);if(null!=e)return e}break;case"CIMTextSymbol":return A(e.symbol);case"CIMSolidFill":return e.color}return null}function G(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=G(e);if(null!=t)return t}break}case"CIMTextSymbol":return G(e.symbol);case"CIMSolidStroke":return e.color}}function N(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function x(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=x(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return x(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function v(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function E(e){switch(e){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function F(e){return(e?Object.keys(e):[]).map((t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"})))}const V=e=>e.includes("data:image/svg+xml");function z(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":return null!=e.symbolLayers&&e.symbolLayers.some((e=>e.effects?.some((e=>"CIMGeometricEffectRadial"===e.type))))?"esriGeometryPolyline":"esriGeometryPoint";case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function O(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function D(e,t,r,n,o,i,l=!0){const{infos:a}=i;let c=1,s=0,u=0,f=0,y=1;for(const{absoluteAnchorPoint:C,offsetX:I,offsetY:p,rotation:h,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:S}of a){y=C?1:c;u=K(I,p,s,y,u),f=$(I,p,s,y,f),d&&(S||l)&&(c*=b/d),s=Q(h,k,s)}const M=K(n,o,s,y,u),m=$(n,o,s,y,f);return{size:e*c,rotation:Q(t,r,s),offsetX:M,offsetY:m}}function R(e){if(null==e)return!1;if(Array.isArray(e))return e.every((e=>R(e)));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function j(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function q(e){return e.split(" ").map((e=>Number(e)))}function B(e){return"string"==typeof e?q(e):e}function H(e){return e?.dashTemplate&&(e.dashTemplate=B(e.dashTemplate)),e}function J(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return J(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return J(e.symbol)}}return"Normal"}function U(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&p(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function W(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function X(e){return e.map((e=>({...e,propertyName:O(e.propertyName)})))}function Y(e){const t={};for(const r in e){const n=e[r];t[O(r)]=n}return t}function $(e,t,r,n,o){const i=r*Math.PI/180;if(i){const r=Math.cos(i);return(Math.sin(i)*e+r*t)*n+o}return t*n+o}function K(e,t,r,n,o){const i=r*Math.PI/180;if(i){return(Math.cos(i)*e-Math.sin(i)*t)*n+o}return e*n+o}function Q(e,t,r){return t?r-e:r+e}function Z(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let i=t[O(r)];if(null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180)),null==i&&(i=j(t.type,r.toLowerCase()),null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]]:o&&(i*=Math.PI/180))),null!=t.primitiveName){const l=e[t.primitiveName];if(null!=l){const e=l[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(i=e,null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180))):(i={valueExpressionInfo:e,defaultValue:i},null!=i&&(n?i={type:"Process",op:"ArcadeColor",value:i}:o&&(i={type:"Process",op:"Divide",left:i,right:180/Math.PI}))))}}if(null==i)throw new Error(`Failed to derive a value or an expression for "${r}".`);return i}function _(e,t,r){if(null!=t[O(r)])return!0;if(null!=t.primitiveName){const n=e[t.primitiveName];if(null!=n){if(null!=n[r])return!0}}return!1}function ee(e,t){return Math.max(Math.min((e??t)/100,1),0)}export{u as adjustTextCase,a as analyzeTextParts,D as applyParentTransform,s as assignTextValuesFromFeature,F as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,T as fromCIMFontDecoration,L as fromCIMFontStyle,v as fromCIMHorizontalAlignment,E as fromCIMVerticalAlignment,j as getDefaultCIMValue,d as getEnum,W as getFieldName,A as getFillColor,g as getFontStyle,w as getFontWeight,h as getNumericValue,Z as getProcessParam,ee as getRelativeGradientSize,U as getSize,G as getStrokeColor,x as getStrokeWidth,J as getTextCasing,c as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,_ as hasProcessParam,N as hasStrokeLayer,P as importGeometryEngine,I as isCIMFill,m as isCIMMarker,p as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,S as isGeometryEngineRequired,V as isSVGImage,R as isValidCIMValue,z as mapCIMSymbolToGeometryType,y as normalizeAlpha,H as normalizeDashEffectTemplate,B as normalizeDashTemplate,X as normalizePrimitiveOverrideProps,q as parseDashTemplate,f as resampleHermite,M as toCIMSymbolJSON,Y as toLowerCaseProps,O as uncapitalize};
@@ -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{instructions as t}from"./instructions.js";function o(t){return t instanceof n?t:"object"==typeof t&&"type"in t?c[t.type].hydrate(t):new i(t)}class n{constructor(t){this.inputs=t}encode(){const t=[];for(const o of this.inputs)t.push(...o.encode());return t.push(...this.instructions),t}}class i extends n{constructor(t){super([]),this.value=t}simplify(){return this}get instructions(){if(Array.isArray(this.value)){const[o,n,i,s]=this.value;return null!=s?t.vector4.encode([o,n||0,i||0,s]):t.vector3.encode([o,n||0,i||0])}return t.scalar.encode(this.value)}}class s extends n{constructor(t,o){super([o]),this._config=t,this._parent=o}static hydrate(t){return new s(t,o(t.parent))}simplify(){if(this._config.relativeTranslation||this._config.absoluteScale)return this;const t=this._parent.simplify();if(!(t instanceof i))return this;const[o,n,r,c]=t.value,e=this._config.translation.from[0],a=this._config.translation.from[1],f=this._config.rotation.from,h=this._config.scale.from;if(e===this._config.translation.to[0]&&a===this._config.translation.to[1]&&f===this._config.rotation.to&&h===this._config.scale.to){const t=r+f,s=c*h,u=Math.sin(r),l=Math.cos(r);return new i([l*c*e-u*c*a+o,u*c*e+l*c*a+n,t,s])}return new s(this._config,t)}get instructions(){return t.animatedTransform.encode(this._config)}}class r extends n{constructor(t,o){super([o]),this._config=t,this._parent=o}static hydrate(t){return new r(t,o(t.parent))}simplify(){const t=this._parent.simplify();if(!(t instanceof i))return this;const[o,n,s,c]=t.value,e=this._config.color.from[0],a=this._config.color.from[1],f=this._config.color.from[2];let h=this._config.color.from[3];const u=this._config.opacity.from;return e===this._config.color.to[0]&&a===this._config.color.to[1]&&f===this._config.color.to[2]&&h===this._config.color.to[3]&&u===this._config.opacity.to?(h*=u,new i([o*e,n*a,s*f,c*h])):new r(this._config,t)}get instructions(){return t.animatedColor.encode(this._config)}}const c={AnimatedTransform:s,AnimatedColor:r};export{n as AAnimationInfo,r as AnimatedColor,s as AnimatedTransform,i as Constant,o as hydrate};
5
+ import{instructions as t}from"./instructions.js";function n(t){return t instanceof i?t:"object"==typeof t&&"type"in t?c[t.type].hydrate(t):new o(t)}class i{constructor(t){this.inputs=t}encode(){const t=[];for(const n of this.inputs)t.push(...n.encode());return t.push(...this.instructions),t}}class o extends i{constructor(t){super([]),this.value=t}simplify(){return this}get instructions(){if(Array.isArray(this.value)){const[n,i,o,s]=this.value;return null!=s?t.vector4.encode([n,i||0,o||0,s]):t.vector3.encode([n,i||0,o||0])}return t.scalar.encode(this.value)}}class s extends i{constructor(t,n){super([n]),this._config=t,this._parent=n}static hydrate(t){return new s(t,n(t.parent))}simplify(){if(this._config.relativeTranslation||this._config.absoluteScale)return this;const t=this._parent.simplify();if(!(t instanceof o))return this;const[n,i,r,e]=t.value,c=this._config.translation.from[0],a=this._config.translation.from[1],f=this._config.rotation.from,h=this._config.scale.from;if(c===this._config.translation.to[0]&&a===this._config.translation.to[1]&&f===this._config.rotation.to&&h===this._config.scale.to){const t=r+f,s=e*h,u=Math.sin(r),l=Math.cos(r);return new o([l*e*c-u*e*a+n,u*e*c+l*e*a+i,t,s])}return new s(this._config,t)}get instructions(){return t.animatedTransform.encode(this._config)}}class r extends i{constructor(t,n){super([n]),this._config=t,this._parent=n}static hydrate(t){return new r(t,n(t.parent))}simplify(){const t=this._parent.simplify();if(!(t instanceof o))return this;const[n,i,s,e]=t.value,c=this._config.color.from[0],a=this._config.color.from[1],f=this._config.color.from[2];let h=this._config.color.from[3];const u=this._config.opacity.from;return c===this._config.color.to[0]&&a===this._config.color.to[1]&&f===this._config.color.to[2]&&h===this._config.color.to[3]&&u===this._config.opacity.to?(h*=u,new o([n*c,i*a,s*f,e*h])):new r(this._config,t)}get instructions(){return t.animatedColor.encode(this._config)}}class e extends i{constructor(t,n){super([n]),this._config=t,this._parent=n}static hydrate(t){return new e(t,n(t.parent))}simplify(){const t=this._parent.simplify();return t instanceof o?new e(this._config,t):this}get instructions(){return t.animatedShift.encode(this._config)}}const c={AnimatedTransform:s,AnimatedColor:r,AnimatedShift:e};export{i as AAnimationInfo,r as AnimatedColor,e as AnimatedShift,s as AnimatedTransform,o as Constant,n as hydrate};
@@ -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
- var t;!function(t){t.Local="Local",t.Global="Global"}(t||(t={}));class o{generateSource(t){const o=[];for(let a=1;a<this.length;a++)o.push(`vec4 atom${a} = texture(${t.animationTexture}, (pointer + 0.5) / size);`),o.push("pointer.x += 1.0;");for(let a=0;a<this.ins;a++)o.push("top--;"),o.push(`vec4 in${this.ins-a-1} = stack[top];`);for(let a=0;a<this.outs;a++)o.push(`vec4 out${a};`);const{microcode:e}=this;for(const a of e)o.push(a);for(let a=0;a<this.outs;a++)o.push(`stack[top] = out${a};`),o.push("top++;"),o.push(`if (top >= ${d}) { top = ${d-1}; }`);return o}}let e=128;class a extends o{constructor(){super(...arguments),this.opcode=++e,this.length=1,this.ins=0,this.outs=0,this.microcode=["break;"]}encode(){return[[this.opcode,0,0,0]]}}class i extends o{constructor(){super(...arguments),this.opcode=++e,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.y, atom0.y, atom0.y, atom0.y);"]}encode(t){return[[this.opcode,t,0,0]]}}class n extends o{constructor(){super(...arguments),this.opcode=++e,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.yzw, 0.0);"]}encode(t){return[[this.opcode,t[0]||0,t[1]||0,t[2]||0]]}}class r extends o{constructor(){super(...arguments),this.opcode=++e,this.length=2,this.ins=0,this.outs=1,this.microcode=["out0 = atom1;"]}encode(t){return[[this.opcode,0,0,0],t]}}function s(t){return[`float duration = clamp(${t.duration}, 0.05, 3600.0);`,`float startTimeOffset = ${t.startTimeOffset};`,`float repeatDelay = ${t.repeatDelay};`,`float timeOriginSelector = ${t.timeOriginSelector};`,`float repeatType = ${t.repeatType};`,`float easing = ${t.easing};`,`float playAnimation = ${t.playAnimation} * (1.0 - step(0.0, -${t.duration}));`,`float reverseAnimation = ${t.reverseAnimation};`,"float time = globalTime - (timeOriginSelector == 1.0 ? localTimeOrigin : 0.0);","time *= playAnimation;","time *= 1.0 - reverseAnimation * 2.0;","float period = duration + repeatDelay;","time += reverseAnimation == 1.0 ? (period - startTimeOffset - 0.001) : startTimeOffset + 0.001;","float omega = time / period;","float oi = floor(omega);","omega = repeatType == 1.0 || repeatType == 3.0 ? omega - oi : omega;","float of = omega * period;","of = (clamp(of, reverseAnimation * repeatDelay, period - (1.0 - reverseAnimation) * repeatDelay) - reverseAnimation * repeatDelay) / duration;","of = easing == 2.0 ? pow(of, 3.0) : of;","of = easing == 3.0 ? 1.0 - pow(1.0 - of, 3.0) : of;","of = easing == 4.0 ? of < 0.5 ? 4.0 * pow(of, 3.0) : 1.0 - pow(-2.0 * of + 2.0, 3.0) / 2.0 : of;","bool oscillate = repeatType == 3.0 && mod(oi, 2.0) == 1.0;",`${t.out} = oscillate ? 1.0 - of : of;`]}const l={Linear:1,EaseIn:2,EaseOut:3,EaseInOut:4},m={Loop:1,None:2,Oscillate:3},c={Local:1,Global:2};function p(t){const o=l[t.easing],e=m[t.repeatType],a=c[t.timeOriginSelector];return[[t.duration,t.startTimeOffset,t.repeatDelay,a],[e,o,t.playAnimation,t.reverseAnimation]]}class f extends o{constructor(){super(...arguments),this.opcode=++e,this.length=10,this.ins=1,this.outs=1,this.microcode=["vec2 fromTranslation = atom1.xy;","vec2 toTranslation = atom1.zw;","float fromRotation = atom2.x;","float toRotation = atom2.y;","float fromScale = atom2.z;","float toScale = atom2.w;","bool relativeTranslation = atom9.x == 1.0;","bool absoluteScale = atom9.y == 1.0;","vec2 translationMultiplier = relativeTranslation ? pixelDimensions : vec2(1.0, 1.0);","float scaleDivisor = absoluteScale ? pixelDimensions.y : 1.0;","float fTranslation;","{",...s({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fTranslation"}),"}","float fRotation;","{",...s({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fRotation"}),"}","float fScale;","{",...s({duration:"atom7.x",startTimeOffset:"atom7.y",repeatDelay:"atom7.z",timeOriginSelector:"atom7.w",repeatType:"atom8.x",easing:"atom8.y",playAnimation:"atom8.z",reverseAnimation:"atom8.w",out:"fScale"}),"}","vec2 aTranslation = mix(fromTranslation, toTranslation, fTranslation);","float aRotation = mix(fromRotation, toRotation, fRotation);","float aScale = mix(fromScale, toScale, fScale);","vec2 pTranslation = in0.xy;","float pRotation = in0.z;","float pScale = in0.w;","aTranslation *= translationMultiplier;","aScale /= scaleDivisor;","float rotation = pRotation + aRotation;","float scale = pScale * aScale;","float sin1 = sin(pRotation);","float cos1 = cos(pRotation);","float s1 = pScale;","float x1 = pTranslation.x;","float y1 = pTranslation.y;","float x2 = aTranslation.x;","float y2 = aTranslation.y;","\n vec2 translation = vec2(\n cos1 * s1 * x2 - sin1 * s1 * y2 + x1,\n sin1 * s1 * x2 + cos1 * s1 * y2 + y1\n );\n ","out0 = vec4(translation, rotation, scale);"]}encode(t){return[[this.opcode,0,0,0],[t.translation.from[0],t.translation.from[1],t.translation.to[0],t.translation.to[1]],[t.rotation.from,t.rotation.to,t.scale.from,t.scale.to],...p(t.translation.timing),...p(t.rotation.timing),...p(t.scale.timing),[t.relativeTranslation?1:0,t.absoluteScale?1:0,0,0]]}}class u extends o{constructor(){super(...arguments),this.opcode=++e,this.length=7,this.ins=1,this.outs=1,this.microcode=["float fromOpacity = atom0.y;","float toOpacity = atom0.z;","vec4 fromColor = atom1;","vec4 toColor = atom2;","float fColor;","{",...s({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fColor"}),"}","float fOpacity;","{",...s({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fOpacity"}),"}","vec4 aColor = mix(fromColor, toColor, fColor);","aColor.a *= mix(fromOpacity, toOpacity, fOpacity);","vec4 pColor = in0;","out0 = aColor * pColor;"]}encode(t){return[[this.opcode,t.opacity.from,t.opacity.to,0],[t.color.from[0],t.color.from[1],t.color.from[2],t.color.from[3]],[t.color.to[0],t.color.to[1],t.color.to[2],t.color.to[3]],...p(t.color.timing),...p(t.opacity.timing)]}}const h={scalar:new i,vector3:new n,vector4:new r,animatedTransform:new f,animatedColor:new u,ret:new a},y=40,d=4;function x(t){const o=[];o.push(`float globalTime = ${t.globalTime};`),o.push(`float localTimeOrigin = ${t.localTimeOrigin};`),o.push(`vec2 pointer = ${t.animationPointer};`),o.push(`vec2 size = ${t.animationTextureSize};`),o.push("int top = 0;"),o.push(`vec4 stack[${d}];`),o.push(`for (int counter = 0; counter < ${y}; counter++) {`),o.push(`vec4 atom0 = texture(${t.animationTexture}, (pointer + 0.5) / size);`),o.push("pointer.x += 1.0;"),o.push(`vec2 pixelDimensions = ${t.pixelDimensions};`),o.push("if (false) {");for(const e in h){const a=h[e];o.push(`} else if (int(atom0.x) == ${a.opcode}) {`);for(const e of a.generateSource(t))o.push(e)}return o.push("} // End if-else."),o.push("} // End for."),o.push(`${t.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),o.join("\n")}function v(t,o){return`\n vec4 ${t}(int valueIndex) {\n vec2 thePointer = ${o.animationPointer};\n float jump = texture(${o.animationTexture}, (0.5 + vec2(thePointer.x + float(valueIndex), thePointer.y)) / ${o.animationTextureSize}).x;\n thePointer = vec2(thePointer.x + jump, thePointer.y);\n vec4 theResult;\n ${x({...o,out:"theResult",animationPointer:"thePointer"})}\n return theResult;\n }\n `}export{o as AAnimationInstruction,u as AnimatedColorInstruction,f as AnimatedTransformInstruction,a as RetInstruction,i as ScalarInstruction,t as TimeOrigin,n as Vector3Instruction,r as Vector4Instruction,l as easingCodes,v as generateGetValueSource,x as generateVirtualMachineSource,s as getTweenFactor,h as instructions,m as repeatTypeCodes,c as timeOriginSelectorCodes};
5
+ var t;!function(t){t.Local="Local",t.Global="Global"}(t||(t={}));class o{generateSource(t){const o=[];for(let a=1;a<this.length;a++)o.push(`vec4 atom${a} = texture(${t.animationTexture}, (pointer + 0.5) / size);`),o.push("pointer.x += 1.0;");for(let a=0;a<this.ins;a++)o.push("top--;"),o.push(`vec4 in${this.ins-a-1} = stack[top];`);for(let a=0;a<this.outs;a++)o.push(`vec4 out${a};`);const{microcode:e}=this;for(const a of e)o.push(a);for(let a=0;a<this.outs;a++)o.push(`stack[top] = out${a};`),o.push("top++;"),o.push(`if (top >= ${x}) { top = ${x-1}; }`);return o}}let e=128;class a extends o{constructor(){super(...arguments),this.opcode=++e,this.length=1,this.ins=0,this.outs=0,this.microcode=["break;"]}encode(){return[[this.opcode,0,0,0]]}}class i extends o{constructor(){super(...arguments),this.opcode=++e,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.y, atom0.y, atom0.y, atom0.y);"]}encode(t){return[[this.opcode,t,0,0]]}}class n extends o{constructor(){super(...arguments),this.opcode=++e,this.length=1,this.ins=0,this.outs=1,this.microcode=["out0 = vec4(atom0.yzw, 0.0);"]}encode(t){return[[this.opcode,t[0]||0,t[1]||0,t[2]||0]]}}class r extends o{constructor(){super(...arguments),this.opcode=++e,this.length=2,this.ins=0,this.outs=1,this.microcode=["out0 = atom1;"]}encode(t){return[[this.opcode,0,0,0],t]}}function s(t){return[`float duration = clamp(${t.duration}, 0.05, 3600.0);`,`float startTimeOffset = ${t.startTimeOffset};`,`float repeatDelay = ${t.repeatDelay};`,`float timeOriginSelector = ${t.timeOriginSelector};`,`float repeatType = ${t.repeatType};`,`float easing = ${t.easing};`,`float playAnimation = ${t.playAnimation} * (1.0 - step(0.0, -${t.duration}));`,`float reverseAnimation = ${t.reverseAnimation};`,"float time = globalTime - (timeOriginSelector == 1.0 ? localTimeOrigin : 0.0);","time *= playAnimation;","time *= 1.0 - reverseAnimation * 2.0;","float period = duration + repeatDelay;","time += reverseAnimation == 1.0 ? (period - startTimeOffset - 0.001) : startTimeOffset + 0.001;","float omega = time / period;","float oi = floor(omega);","omega = repeatType == 1.0 || repeatType == 3.0 ? omega - oi : omega;","float of = omega * period;","of = (clamp(of, reverseAnimation * repeatDelay, period - (1.0 - reverseAnimation) * repeatDelay) - reverseAnimation * repeatDelay) / duration;","of = easing == 2.0 ? pow(of, 3.0) : of;","of = easing == 3.0 ? 1.0 - pow(1.0 - of, 3.0) : of;","of = easing == 4.0 ? of < 0.5 ? 4.0 * pow(of, 3.0) : 1.0 - pow(-2.0 * of + 2.0, 3.0) / 2.0 : of;","bool oscillate = repeatType == 3.0 && mod(oi, 2.0) == 1.0;",`${t.out} = oscillate ? 1.0 - of : of;`]}const l={Linear:1,EaseIn:2,EaseOut:3,EaseInOut:4},m={Loop:1,None:2,Oscillate:3},c={Local:1,Global:2};function f(t){const o=l[t.easing],e=m[t.repeatType],a=c[t.timeOriginSelector];return[[t.duration,t.startTimeOffset,t.repeatDelay,a],[e,o,t.playAnimation,t.reverseAnimation]]}class p extends o{constructor(){super(...arguments),this.opcode=++e,this.length=10,this.ins=1,this.outs=1,this.microcode=["vec2 fromTranslation = atom1.xy;","vec2 toTranslation = atom1.zw;","float fromRotation = atom2.x;","float toRotation = atom2.y;","float fromScale = atom2.z;","float toScale = atom2.w;","bool relativeTranslation = atom9.x == 1.0;","bool absoluteScale = atom9.y == 1.0;","vec2 translationMultiplier = relativeTranslation ? pixelDimensions : vec2(1.0, 1.0);","float scaleDivisor = absoluteScale ? pixelDimensions.y : 1.0;","float fTranslation;","{",...s({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fTranslation"}),"}","float fRotation;","{",...s({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fRotation"}),"}","float fScale;","{",...s({duration:"atom7.x",startTimeOffset:"atom7.y",repeatDelay:"atom7.z",timeOriginSelector:"atom7.w",repeatType:"atom8.x",easing:"atom8.y",playAnimation:"atom8.z",reverseAnimation:"atom8.w",out:"fScale"}),"}","vec2 aTranslation = mix(fromTranslation, toTranslation, fTranslation);","float aRotation = mix(fromRotation, toRotation, fRotation);","float aScale = mix(fromScale, toScale, fScale);","vec2 pTranslation = in0.xy;","float pRotation = in0.z;","float pScale = in0.w;","aTranslation *= translationMultiplier;","aScale /= scaleDivisor;","float rotation = pRotation + aRotation;","float scale = pScale * aScale;","float sin1 = sin(pRotation);","float cos1 = cos(pRotation);","float s1 = pScale;","float x1 = pTranslation.x;","float y1 = pTranslation.y;","float x2 = aTranslation.x;","float y2 = aTranslation.y;","\n vec2 translation = vec2(\n cos1 * s1 * x2 - sin1 * s1 * y2 + x1,\n sin1 * s1 * x2 + cos1 * s1 * y2 + y1\n );\n ","out0 = vec4(translation, rotation, scale);"]}encode(t){return[[this.opcode,0,0,0],[t.translation.from[0],t.translation.from[1],t.translation.to[0],t.translation.to[1]],[t.rotation.from,t.rotation.to,t.scale.from,t.scale.to],...f(t.translation.timing),...f(t.rotation.timing),...f(t.scale.timing),[t.relativeTranslation?1:0,t.absoluteScale?1:0,0,0]]}}class u extends o{constructor(){super(...arguments),this.opcode=++e,this.length=7,this.ins=1,this.outs=1,this.microcode=["float fromOpacity = atom0.y;","float toOpacity = atom0.z;","vec4 fromColor = atom1;","vec4 toColor = atom2;","float fColor;","{",...s({duration:"atom3.x",startTimeOffset:"atom3.y",repeatDelay:"atom3.z",timeOriginSelector:"atom3.w",repeatType:"atom4.x",easing:"atom4.y",playAnimation:"atom4.z",reverseAnimation:"atom4.w",out:"fColor"}),"}","float fOpacity;","{",...s({duration:"atom5.x",startTimeOffset:"atom5.y",repeatDelay:"atom5.z",timeOriginSelector:"atom5.w",repeatType:"atom6.x",easing:"atom6.y",playAnimation:"atom6.z",reverseAnimation:"atom6.w",out:"fOpacity"}),"}","vec4 aColor = mix(fromColor, toColor, fColor);","aColor.a *= mix(fromOpacity, toOpacity, fOpacity);","vec4 pColor = in0;","out0 = aColor * pColor;"]}encode(t){return[[this.opcode,t.opacity.from,t.opacity.to,0],[t.color.from[0],t.color.from[1],t.color.from[2],t.color.from[3]],[t.color.to[0],t.color.to[1],t.color.to[2],t.color.to[3]],...f(t.color.timing),...f(t.opacity.timing)]}}class h extends o{constructor(){super(...arguments),this.opcode=++e,this.length=4,this.ins=1,this.outs=1,this.microcode=["float fromShift = atom0.y;","float toShift = atom0.z;","float duration = atom1.x;","bool multiplyByLineLength = atom3.x == 1.0;","float fShift;","{",...s({duration:"duration",startTimeOffset:"atom1.y",repeatDelay:"atom1.z",timeOriginSelector:"atom1.w",repeatType:"atom2.x",easing:"atom2.y",playAnimation:"atom2.z",reverseAnimation:"atom2.w",out:"fShift"}),"}","toShift *= multiplyByLineLength ? lineLength : 1.0;","float aShift = mix(fromShift, toShift, fShift);","vec4 pShift = in0;","out0 = mod(aShift + pShift, lineLength);"]}encode(t){return[[this.opcode,t.shift.from,t.shift.to,0],...f(t.shift.timing),[t.multiplyByLineLength?1:0,0,0,0]]}}const y={scalar:new i,vector3:new n,vector4:new r,animatedTransform:new p,animatedColor:new u,animatedShift:new h,ret:new a},d=40,x=4;function g(t){const o=[];o.push(`float globalTime = ${t.globalTime};`),o.push(`float localTimeOrigin = ${t.localTimeOrigin};`),o.push(`float lineLength = ${t.lineLength};`),o.push(`vec2 pointer = ${t.animationPointer};`),o.push(`vec2 size = ${t.animationTextureSize};`),o.push("int top = 0;"),o.push(`vec4 stack[${x}];`),o.push(`for (int counter = 0; counter < ${d}; counter++) {`),o.push(`vec4 atom0 = texture(${t.animationTexture}, (pointer + 0.5) / size);`),o.push("pointer.x += 1.0;"),o.push(`vec2 pixelDimensions = ${t.pixelDimensions};`),o.push("if (false) {");for(const e in y){const a=y[e];o.push(`} else if (int(atom0.x) == ${a.opcode}) {`);for(const e of a.generateSource(t))o.push(e)}return o.push("} // End if-else."),o.push("} // End for."),o.push(`${t.out} = top > 0 ? stack[top - 1] : vec4(0.0);`),o.join("\n")}function v(t,o){return`\n vec4 ${t}(int valueIndex) {\n vec2 thePointer = ${o.animationPointer};\n float jump = texture(${o.animationTexture}, (0.5 + vec2(thePointer.x + float(valueIndex), thePointer.y)) / ${o.animationTextureSize}).x;\n thePointer = vec2(thePointer.x + jump, thePointer.y);\n vec4 theResult;\n ${g({...o,out:"theResult",animationPointer:"thePointer"})}\n return theResult;\n }\n `}export{o as AAnimationInstruction,u as AnimatedColorInstruction,h as AnimatedShiftInstruction,p as AnimatedTransformInstruction,a as RetInstruction,i as ScalarInstruction,t as TimeOrigin,n as Vector3Instruction,r as Vector4Instruction,l as easingCodes,v as generateGetValueSource,g as generateVirtualMachineSource,s as getTweenFactor,y as instructions,m as repeatTypeCodes,c as timeOriginSelectorCodes};
@@ -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 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};
5
+ import e from"../../../../../Color.js";import{getStartGroup as t,getRandomValue as o}from"../grouping.js";import{hydrate as i}from"./infos.js";import{instructions as n}from"./instructions.js";function s(e){return a(e.map((e=>l(e))).map((e=>i(e).simplify())))}function r(e){const t=[];return t.push(e.transform),t.push(e.fromColor),t.push(e.toColor),t.push(e.colorMix),t.push(e.toOpacity),t.push(e.opacityMix),e?.shift?t.push(e?.shift):t.push([1,1,1,1]),t}function a(e){const t=[],o=[];let i=0;for(const s of e){const r=[...s.encode(),...n.ret.encode()];t.push([i+e.length,0,0,0]),o.push(...r),i+=r.length}return[...t,...o]}async function c(e,t){const o=e;let i;if("number"==typeof o||"string"==typeof o||"boolean"==typeof o)i=o;else if(Array.isArray(o))i=await Promise.all(o.map((e=>c(e,t))));else if("object"==typeof o)if("valueExpressionInfo"in o){const{valueExpressionInfo:e}=o,{expression:n}=e;i={...o,computed:await t.createComputedField({expression:n})}}else{i={};for(const e in o)i[e]=await c(o[e],t)}return i}function l(i,n,s){function r(t){if(!("computed"in t))return t;let o=t.computed.readWithDefault(n,s,[255*t.defaultValue[0],255*t.defaultValue[1],255*t.defaultValue[2],t.defaultValue[3]]);if("string"==typeof o){const t=e.fromString(o);t&&(o=[t.r,t.g,t.b,t.a])}return o}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=>l(e,n,s)));else if("object"==typeof a)if("type"in a&&null!=a.type&&"Process"===a.type)switch(a.op){case"ArcadeColor":{const e=l(a.value,n,s);p(Array.isArray(e)&&4===e.length);c=[e[0]/255,e[1]/255,e[2]/255,e[3]]}break;case"Transparency":{const e=l(a.value,n,s);p("number"==typeof e),c=1-e/100}break;case"Divide":case"Multiply":case"Add":{const e=l(a.left,n,s);p("number"==typeof e);const t=l(a.right,n,s);switch(p("number"==typeof t),a.op){case"Divide":c=e/t;break;case"Multiply":c=e*t;break;case"Add":c=e+t}}break;case"Random":{const e=l(a.seed,n,s),i=l(a.min,n,s),r=l(a.max,n,s),f=n.getObjectId(),p=t(f||0);c=i+o(p,e)*(r-i)}break;case"Cond":{const e=l(a.condition,n,s),t=l(a.ifTrue,n,s),o=l(a.ifFalse,n,s);c=e?t:o}break;case"MatchWinding":{const e=l(a.sign,n,s);let t=l(a.angle,n,s);if(e>0)for(;t<0;)t+=2*Math.PI;else for(;t>0;)t-=2*Math.PI;c=t}}else if("computed"in a)c=r(a);else{c={};for(const e in a)c[e]=l(a[e],n,s)}return c}function*f(e){const t=e;if(Array.isArray(t))for(const o of t)yield*f(o);else if("object"==typeof t)if("type"in t&&null!=t.type&&"Process"===t.type)switch(t.op){case"ArcadeColor":case"Transparency":yield*f(t.value);break;case"Divide":case"Multiply":case"Add":yield*f(t.left),yield*f(t.right);break;case"Random":yield*f(t.seed),yield*f(t.min),yield*f(t.max);break;case"Cond":yield*f(t.condition),yield*f(t.ifTrue),yield*f(t.ifFalse);break;case"MatchWinding":yield*f(t.sign),yield*f(t.angle)}else if("computed"in t)yield t.computed;else for(const o in t)yield*f(t[o])}function p(e){if(!e)throw new Error("Assertion failed.")}export{p as assert,c as compileAnimationParam,r as createParamList,a as encodeParamList,s as fromJSON,f as getAnimationExpressions,l 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{FeatureTechniqueInstance as i}from"./TechniqueInstance.js";import{Techniques as e}from"./TechniqueRegistry.js";import{castInstanceId as t}from"./mesh/instanceIdUtils.js";let n=0;function l(e,l){return new i(t(n++),e,l)}const o={visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null,visualVariableSizeOutlineScaleStops:null};class a{constructor(){this.instances={fill:l(e.fill,{uniforms:o,optionalAttributes:{zoomRange:!0}}),marker:l(e.marker,{uniforms:o,optionalAttributes:{zoomRange:!0}}),line:l(e.line,{uniforms:o,optionalAttributes:{zoomRange:!0}}),text:l(e.text,{uniforms:o,optionalAttributes:{zoomRange:!0,referenceSymbol:!1,clipAngle:!1,visibility:!1}}),outlineFill:l(e.outlineFill,{uniforms:o,optionalAttributes:{zoomRange:!0}}),complexFill:l(e.complexFill,{uniforms:o,optionalAttributes:{zoomRange:!0}}),gradientFill:l(e.gradientFill,{uniforms:o,optionalAttributes:{zoomRange:!0}}),texturedLine:l(e.texturedLine,{uniforms:o,optionalAttributes:{zoomRange:!0}}),gradientStroke:l(e.gradientStroke,{uniforms:o,optionalAttributes:{zoomRange:!0}}),animatedMarker:l(e.animatedMarker,{uniforms:o,optionalAttributes:{zoomRange:!0}})},this._instancesById=Object.values(this.instances).reduce(((i,e)=>(i.set(e.instanceId,e),i)),new Map)}getInstance(i){return this._instancesById.get(i)}}export{a as GraphicInstanceStore};
5
+ import{FeatureTechniqueInstance as e}from"./TechniqueInstance.js";import{Techniques as i}from"./TechniqueRegistry.js";import{castInstanceId as t}from"./mesh/instanceIdUtils.js";let n=0;function a(i,a){return new e(t(n++),i,a)}const o={visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null,visualVariableSizeOutlineScaleStops:null};class l{constructor(){this.instances={fill:a(i.fill,{uniforms:o,optionalAttributes:{zoomRange:!0}}),marker:a(i.marker,{uniforms:o,optionalAttributes:{zoomRange:!0}}),line:a(i.line,{uniforms:o,optionalAttributes:{zoomRange:!0}}),text:a(i.text,{uniforms:o,optionalAttributes:{zoomRange:!0,referenceSymbol:!1,clipAngle:!1,visibility:!1}}),outlineFill:a(i.outlineFill,{uniforms:o,optionalAttributes:{zoomRange:!0}}),complexFill:a(i.complexFill,{uniforms:o,optionalAttributes:{zoomRange:!0}}),gradientFill:a(i.gradientFill,{uniforms:o,optionalAttributes:{zoomRange:!0}}),texturedLine:a(i.texturedLine,{uniforms:o,optionalAttributes:{zoomRange:!0}}),gradientStroke:a(i.gradientStroke,{uniforms:o,optionalAttributes:{zoomRange:!0}}),animatedMarker:a(i.animatedMarker,{uniforms:o,optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}}),animatedMarkerShift:a(i.animatedMarkerShift,{uniforms:o,optionalAttributes:{zoomRange:!0,value1Position2Value2:!0,lineLength:!0}}),animatedPolygon:a(i.animatedFill,{uniforms:o,optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}}),animatedPolyline:a(i.animatedLine,{uniforms:o,optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:!1}}),animatedPolylineShift:a(i.animatedLine,{uniforms:o,optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:!0}})},this._instancesById=Object.values(this.instances).reduce(((e,i)=>(e.set(i.instanceId,i),e)),new Map)}getInstance(e){return this._instancesById.get(e)}}export{l as GraphicInstanceStore};
@@ -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{AnimatedMarkerTechnique as e}from"./animated/AnimatedMarkerTechnique.js";import{DotDensityTechnique as i}from"./dotDensity/DotDensityTechnique.js";import{ComplexFillTechnique as n}from"./fill/ComplexFillTechnique.js";import{ComplexOutlineFillTechnique as t}from"./fill/ComplexOutlineFillTechnique.js";import{FillTechnique as r}from"./fill/FillTechnique.js";import{GradientFillTechnique as l}from"./fill/GradientFillTechnique.js";import{OutlineFillTechnique as o}from"./fill/OutlineFillTechnique.js";import{PatternFillTechnique as m}from"./fill/PatternFillTechnique.js";import{PatternOutlineFillTechnique as a}from"./fill/PatternOutlineFillTechnique.js";import{HeatmapTechnique as p}from"./heatmap/HeatmapTechnique.js";import{LabelTechnique as f}from"./labels/LabelTechnique.js";import{GradientStrokeTechnique as u}from"./line/GradientStrokeTechnique.js";import{LineTechnique as s}from"./line/LineTechnique.js";import{TexturedLineTechnique as c}from"./line/TexturedLineTechnique.js";import{MarkerTechnique as h}from"./markers/MarkerTechnique.js";import{PieChartTechnique as T}from"./pieChart/PieChartTechnique.js";import{TextTechnique as w}from"./text/TextTechnique.js";const j={fill:new r,patternFill:new m,complexFill:new n,gradientFill:new l,outlineFill:new o,patternOutlineFill:new a,complexOutlineFill:new t,marker:new h,pieChart:new T,line:new s,texturedLine:new c,gradientStroke:new u,text:new w,label:new f,heatmap:new p,dotDensity:new i,animatedMarker:new e};function q(){for(const e in j){j[e].startup()}}function F(e){for(const i in j){j[i].shutdown(e)}}export{j as Techniques,F as shutdown,q as startup};
5
+ import{AnimatedLineTechnique as e,AnimatedFillTechnique as i,AnimatedMarkerShiftTechnique as n,AnimatedMarkerTechnique as t}from"./animated/AnimatedTechniques.js";import{DotDensityTechnique as l}from"./dotDensity/DotDensityTechnique.js";import{ComplexFillTechnique as r}from"./fill/ComplexFillTechnique.js";import{ComplexOutlineFillTechnique as o}from"./fill/ComplexOutlineFillTechnique.js";import{FillTechnique as m}from"./fill/FillTechnique.js";import{GradientFillTechnique as a}from"./fill/GradientFillTechnique.js";import{OutlineFillTechnique as f}from"./fill/OutlineFillTechnique.js";import{PatternFillTechnique as p}from"./fill/PatternFillTechnique.js";import{PatternOutlineFillTechnique as u}from"./fill/PatternOutlineFillTechnique.js";import{HeatmapTechnique as s}from"./heatmap/HeatmapTechnique.js";import{LabelTechnique as c}from"./labels/LabelTechnique.js";import{GradientStrokeTechnique as h}from"./line/GradientStrokeTechnique.js";import{LineTechnique as w}from"./line/LineTechnique.js";import{TexturedLineTechnique as T}from"./line/TexturedLineTechnique.js";import{MarkerTechnique as j}from"./markers/MarkerTechnique.js";import{PieChartTechnique as q}from"./pieChart/PieChartTechnique.js";import{TextTechnique as d}from"./text/TextTechnique.js";const F={fill:new m,patternFill:new p,complexFill:new r,gradientFill:new a,outlineFill:new f,patternOutlineFill:new u,complexOutlineFill:new o,marker:new j,pieChart:new q,line:new w,texturedLine:new T,gradientStroke:new h,text:new d,label:new c,heatmap:new s,dotDensity:new l,animatedMarker:new t,animatedMarkerShift:new n,animatedFill:new i,animatedLine:new e};function x(){for(const e in F){F[e].startup()}}function k(e){for(const i in F){F[i].shutdown(e)}}export{F as Techniques,k as shutdown,x as startup};
@@ -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
- var e,t;!function(e){e[e.AnimatedMarker=0]="AnimatedMarker",e[e.Blend=1]="Blend",e[e.ComplexFill=2]="ComplexFill",e[e.ComplexOutlineFill=3]="ComplexOutlineFill",e[e.DotDensity=4]="DotDensity",e[e.Fill=5]="Fill",e[e.GradientFill=6]="GradientFill",e[e.GradientStroke=7]="GradientStroke",e[e.Grid=8]="Grid",e[e.Heatmap=9]="Heatmap",e[e.Label=10]="Label",e[e.Line=11]="Line",e[e.Magnifier=12]="Magnifier",e[e.Marker=13]="Marker",e[e.OutlineFill=14]="OutlineFill",e[e.Overlay=15]="Overlay",e[e.PatternFill=16]="PatternFill",e[e.PatternOutlineFill=17]="PatternOutlineFill",e[e.PieChart=18]="PieChart",e[e.Test=19]="Test",e[e.Text=20]="Text",e[e.TexturedLine=21]="TexturedLine",e[e.Bitmap=22]="Bitmap"}(e||(e={})),function(e){e[e.RasterColorizer=0]="RasterColorizer",e[e.RasterProcessor=1]="RasterProcessor",e[e.Aspect=2]="Aspect",e[e.BandArithmetic=3]="BandArithmetic",e[e.ColormapToRGB=4]="ColormapToRGB",e[e.CompositeBand=5]="CompositeBand",e[e.ComputeChange=6]="ComputeChange",e[e.ContrastBrightness=7]="ContrastBrightness",e[e.Convolution=8]="Convolution",e[e.Curvature=9]="Curvature",e[e.ExtractBand=10]="ExtractBand",e[e.Grayscale=11]="Grayscale",e[e.Hillshade=12]="Hillshade",e[e.Local=13]="Local",e[e.Mask=14]="Mask",e[e.NDVI=15]="NDVI",e[e.Remap=16]="Remap",e[e.Reproject=17]="Reproject",e[e.ShadedRelief=18]="ShadedRelief",e[e.Slope=19]="Slope",e[e.Statistics=20]="Statistics",e[e.Stretch=21]="Stretch"}(t||(t={}));export{t as RasterTechniqueType,e as TechniqueType};
5
+ var e,t;!function(e){e[e.AnimatedMarker=0]="AnimatedMarker",e[e.AnimatedMarkerShift=1]="AnimatedMarkerShift",e[e.AnimatedFill=2]="AnimatedFill",e[e.AnimatedLine=3]="AnimatedLine",e[e.Blend=4]="Blend",e[e.ComplexFill=5]="ComplexFill",e[e.ComplexOutlineFill=6]="ComplexOutlineFill",e[e.DotDensity=7]="DotDensity",e[e.Fill=8]="Fill",e[e.GradientFill=9]="GradientFill",e[e.GradientStroke=10]="GradientStroke",e[e.Grid=11]="Grid",e[e.Heatmap=12]="Heatmap",e[e.Label=13]="Label",e[e.Line=14]="Line",e[e.Magnifier=15]="Magnifier",e[e.Marker=16]="Marker",e[e.OutlineFill=17]="OutlineFill",e[e.Overlay=18]="Overlay",e[e.PatternFill=19]="PatternFill",e[e.PatternOutlineFill=20]="PatternOutlineFill",e[e.PieChart=21]="PieChart",e[e.Test=22]="Test",e[e.Text=23]="Text",e[e.TexturedLine=24]="TexturedLine",e[e.Bitmap=25]="Bitmap"}(e||(e={})),function(e){e[e.RasterColorizer=0]="RasterColorizer",e[e.RasterProcessor=1]="RasterProcessor",e[e.Aspect=2]="Aspect",e[e.BandArithmetic=3]="BandArithmetic",e[e.ColormapToRGB=4]="ColormapToRGB",e[e.CompositeBand=5]="CompositeBand",e[e.ComputeChange=6]="ComputeChange",e[e.ContrastBrightness=7]="ContrastBrightness",e[e.Convolution=8]="Convolution",e[e.Curvature=9]="Curvature",e[e.ExtractBand=10]="ExtractBand",e[e.Grayscale=11]="Grayscale",e[e.Hillshade=12]="Hillshade",e[e.Local=13]="Local",e[e.Mask=14]="Mask",e[e.NDVI=15]="NDVI",e[e.Remap=16]="Remap",e[e.Reproject=17]="Reproject",e[e.ShadedRelief=18]="ShadedRelief",e[e.Slope=19]="Slope",e[e.Statistics=20]="Statistics",e[e.Stretch=21]="Stretch"}(t||(t={}));export{t as RasterTechniqueType,e as TechniqueType};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as o}from"../../../../../../../chunks/tslib.es6.js";import{location as t,ComputeVertexInput as e}from"../../GraphShaderModule.js";import{mod as s,Float as i,mix as l,Vec4 as r,or as a,Bool as n,Vec2 as m}from"../../graph/glsl.js";import{AAnimatedShader as c,getValue as p,AAnimatedVertexInput as d,AAnimatedFragmentInput as u}from"./AAnimatedShader.js";import{AnimationParamIndex as y}from"./enums.js";import{MarkerConstants as h}from"../markers/markerConstants.js";import{getBitBool as x}from"../shaders/utils.js";import{getVisualVariableColor as P,getVisualVariableOpacity as b}from"../shaders/vvUtils.js";class v extends d{}o([t(9,r)],v.prototype,"tlbr",void 0);class S extends e{}o([t(13,m)],S.prototype,"nextPos1",void 0),o([t(14,m)],S.prototype,"nextPos2",void 0);class f extends u{}class g extends c{_fragmentPoly(o){const t=s(o.uv,new i(1)),e=l(o.tlbr.xy,o.tlbr.zw,t);return this._getColor(e,{color:o.color,distanceToPx:o.distanceToPx,isSDF:o.isSDF,outlineColor:o.outlineColor,outlineSize:o.strokeWidth})}_vertexPoly(o){const{position:t,animationPointer:e,evalParams:s,isOutline:m,unscaledDistanceToPx:c,vvScale:d,strokeWidth:u,scaleSymbolsProportionally:v,scale:S,isSDF:f,baseSize:g,clip:j}=this._vertexPreamble(o,new i(0),o.lineLength||new i(0)),w=this._toNdc(t);let k=p(e,y.fromColor,s);k=new r(k.rgb.multiply(k.a),k.a);let z=p(e,y.toColor,s);z=new r(z.rgb.multiply(z.a),z.a);let C=p(e,y.colorMix,s);C=new r(C.rgb.multiply(C.a),C.a);const D=p(e,y.toOpacity,s).a,_=p(e,y.opacityMix,s).a,T=P(this,o.id,k,a(x(o.bitset,h.bitset.colorLocked),new n(m))),F=l(T,z,C),M=b(this,o.id),O=l(M,D,_),W=F.multiply(O),A=this.clip(o.id,o.zoomRange).add(j.multiply(2)),L=c.multiply(d);return{unscaledDistanceToPx:c,vvScale:d,strokeWidth:u,scaleSymbolsProportionally:v,scale:S,isSDF:f,baseSize:g,ndc:w,color:W,z:A,isOutline:m,evalParams:s,distanceToPx:L}}}export{g as AAnimatedPolyShader,f as PolyFragmentInput,S as PolyHittestVertexInput,v as PolyVertexInput};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as i}from"../../../../../../../chunks/tslib.es6.js";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as e}from"../../../animations/instructions.js";import{location as o,uniform as a,option as s}from"../../GraphShaderModule.js";import{Vec2 as r,texture2D as l,block as n,Float as m,step as p,negate as u,cond as d,equal as c,Mat2 as y,cos as f,sin as v,Mat3 as b,Vec3 as S,lessThanEqual as h,ifElse as w,clamp as g,abs as V,Vec4 as x}from"../../graph/glsl.js";import{AnimationUniformInfo as z}from"./AnimationUniformInfo.js";import{AnimationParamIndex as j}from"./enums.js";import{MarkerConstants as P}from"../markers/markerConstants.js";import{AFeatureShader as T,FeatureVertexInput as _,FeatureFragmentInput as I}from"../shaders/AFeatureShader.js";import{c256ToRad as O,softEdgeRatio as C}from"../shaders/constants.js";import{LocalTileOffset as M}from"../shaders/LocalTileOffset.js";import{MosaicInfo as D}from"../shaders/MosaicInfo.js";import{getBit as A,rgba2float as F}from"../shaders/utils.js";import{VisualVariableColor as L}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as R}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as k}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as U}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as E}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as B}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as G}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as N,getVisualVariableAngle as W}from"../shaders/vvUtils.js";class q extends _{}i([o(3,r)],q.prototype,"offset",void 0),i([o(4,x)],q.prototype,"sizing",void 0),i([o(5,x)],q.prototype,"value1Position2Value2",void 0),i([o(6,x)],q.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),i([o(7,r)],q.prototype,"zoomRange",void 0),i([o(8,m)],q.prototype,"lineLength",void 0);class H extends I{}class J extends T{_vertexPreamble(i,t,e){const{id:o,offset:a,animationPointerAndBaseSizeAndReferenceSize:s,sizing:r}=i,l=s.xy,n=s.z,b=s.w,S=r.xy,h=this._getEvalParams(i,S,e);let w,g;if(i.value1Position2Value2){const t=K(l,j.shift,h).a,e=i.pos,o=i.value1Position2Value2.yz,a=i.value1Position2Value2.x,s=i.value1Position2Value2.w,r=t.subtract(a).divide(s.subtract(a));g=e.add(o.subtract(e).multiply(r)),w=p(new m(1),r).add(p(new m(0),u(r)))}else g=i.pos,w=new m(0);const V=r.z,x=A(i.bitset,P.bitset.isStroke),z=r.w,T=A(i.bitset,P.bitset.scaleSymbolsProportionally),_=K(l,j.transform,h),I=d([c(A(i.bitset,P.bitset.isMapAligned),new m(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new m(0)]),C=new y(f(I),v(I.multiply(-1)),v(I),f(I)).multiply(_.xy),M=_.z.subtract(I).subtract(t.multiply(O)),D=_.w,F=A(i.bitset,P.bitset.isSDF),L=N(this,o,new m(b)).divide(new m(b));return{baseSize:n,animationPointer:l,strokeWidth:V,isOutline:x,unscaledDistanceToPx:z,scaleSymbolsProportionally:T,isSDF:F,position:this._getScreenPosition({id:o,pos:g,offset:a,referenceSize:b,translation:C,rotation:M,scale:D,vvScale:L}),evalParams:h,vvScale:L,scale:D,clip:w}}_getScreenPosition(i){const{pos:t,translation:e,rotation:o,scale:a,offset:s,id:r,vvScale:l}=i,n=W(this,r).multiply(Math.PI/180),p=e.x.multiply(4/3),d=e.y.multiply(-1).multiply(4/3),c=v(n),y=f(n),h=y.multiply(p).add(u(c).multiply(d)),w=c.multiply(p).add(y.multiply(d)),g=v(o.subtract(n)),V=f(o.subtract(n)),x=new m(0),z=new m(1),{pixelRatio:j}=this.animationInfo,P=new b(z,x,x,x,z,x,h.multiply(j),w.multiply(j),z),T=new b(V,g.multiply(-1),x,g,V,x,0,0,z),_=a.multiply(l).multiply(j).multiply(4/3),I=T.multiply(_),O=this.animationInfo.toScreen.multiply(new S(t,1)),C=P.multiply(O).xy,M=I.multiply(new S(s,0)).xy;return C.add(M)}_clip(i,e){let o=super.clip(i,e);const a=h(this._getLocalTimeOrigin(i),new m(0));return t.forceGlobalTimeOrigin||(o=o.add(d([a,()=>new m(2)],[!0,()=>new m(0)]))),o}_getLocalTimeOrigin(i){return this.storage.getLocalTimeOrigin(i)}_toNdc(i){return this.animationInfo.toNdc.multiply(new S(i,1)).xy}_getEvalParams(i,t,e){const{globalTime:o,animationTextureSize:a,animationTexture:s}=this.animationInfo;return{globalTime:o,localTimeOrigin:this._getLocalTimeOrigin(i.id),animationTextureSize:a,animationTexture:s,pixelDimensions:t,lineLength:e}}_getColor(i,t){return w(c(t.isSDF,new m(1)),this._getSDFColor(i,t),this._getSpriteColor(i,t))}_getSpriteColor(i,t){return l(this.mosaicInfo.texture,i).multiply(t.color)}_getSDFColor(i,t){const e=l(this.mosaicInfo.texture,i),o=new m(.5).subtract(F(e)).multiply(t.distanceToPx).multiply(C),a=g(new m(.5).subtract(o),new m(0),new m(1)),s=t.color.multiply(a),r=t.outlineSize.multiply(.5),n=V(o).subtract(r),p=g(new m(.5).subtract(n),new m(0),new m(1)),u=t.outlineColor.multiply(p);return new m(1).subtract(u.a).multiply(s).add(u)}}function K(i,t,o){const a=i.add(new r(t,0)),s=l(o.animationTexture,a.add(.5).divide(o.animationTextureSize)).xy;return i=i.add(s),n({animationPointer:i,...o},x,null,(i=>{const{out:t}=i;if(!t)throw new Error("out is null");return e({...i,out:t})}))}i([a(D)],J.prototype,"mosaicInfo",void 0),i([a(z)],J.prototype,"animationInfo",void 0),i([a(M)],J.prototype,"localTileOffset",void 0),i([s(L)],J.prototype,"visualVariableColor",void 0),i([s(R)],J.prototype,"visualVariableOpacity",void 0),i([s(U)],J.prototype,"visualVariableSizeMinMaxValue",void 0),i([s(E)],J.prototype,"visualVariableSizeScaleStops",void 0),i([s(B)],J.prototype,"visualVariableSizeStops",void 0),i([s(G)],J.prototype,"visualVariableSizeUnitValue",void 0),i([s(k)],J.prototype,"visualVariableRotation",void 0);export{H as AAnimatedFragmentInput,J as AAnimatedShader,q as AAnimatedVertexInput,K as getValue};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as t,a as e}from"../../../../../../../chunks/tslib.es6.js";import{input as i}from"../../GraphShaderModule.js";import{Float as s,sin as o,cos as r,Vec3 as l,Vec4 as n,Mat3 as a,mix as m}from"../../graph/glsl.js";import{AAnimatedPolyShader as p,PolyVertexInput as u,PolyHittestVertexInput as c,PolyFragmentInput as d}from"./AAnimatedPolyShader.js";import{getPatternMatrix as h}from"../shaders/ComplexFillShader.js";import{hittestFill as y}from"../shaders/hittestUtils.js";class f extends p{constructor(){super(...arguments),this.type="AnimatedFillShader",this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,e){const{distanceToPx:i,ndc:p,z:u,color:c,isOutline:d,strokeWidth:y,isSDF:f,baseSize:x,scale:g,scaleSymbolsProportionally:b}=this._vertexPoly(t),w=this.view.requiredZoomFactor,P=t.sizing.xy,S=P.multiply(w),v=new s(0),z=o(v),F=r(v),j=h(t.id,S,z,F,t.bitset),A=this.localTileOffset.getPatternOffsetAtTileOrigin(P,z,F),O=w.multiply(t.offset.subtract(A)).divide(S),T=new l(t.pos,1),M=j.multiply(T).xy.subtract(O),k=t.tlbr.divide(this.mosaicInfo.size.xyxy);return{glPosition:new n(p,u,1),tlbr:k,uv:M,color:c.multiply(new s(1).subtract(d)),outlineColor:c.multiply(d),distanceToPx:i,strokeWidth:y.multiply(m(new s(1),g,b)),isOutline:d,isSDF:f,...this.maybeRunHittest(t,e,{pos:t.pos,size:x,sizeCorrection:new s(1),isMapAligned:new s(1),vvRotationMat3:new a(1,0,0,0,1,0,0,0,1),placementMat3:new a(1,0,0,0,1,0,0,0,1),outlineSize:new s(1),distanceToPx:i,isSDF:f})}}fragment(t){const e=this._fragmentPoly(t);return this.getFragmentOutput(e,t)}hittest(t,e,i){return y(this,t,e)}}t([e(0,i(u)),e(1,i(c))],f.prototype,"vertex",null),t([e(0,i(d))],f.prototype,"fragment",null);export{f as AnimatedFillShader};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as t,a as e}from"../../../../../../../chunks/tslib.es6.js";import{location as i,input as s}from"../../GraphShaderModule.js";import{dot as o,Vec2 as n,Vec4 as l,Float as r,Mat3 as a,mix as m,length as d,clamp as p,Vec3 as u,step as c,min as y}from"../../graph/glsl.js";import{AAnimatedPolyShader as h,PolyHittestVertexInput as x,PolyVertexInput as v,PolyFragmentInput as f}from"./AAnimatedPolyShader.js";import{getValue as w}from"./AAnimatedShader.js";import{AnimationParamIndex as S}from"./enums.js";import{distPointSegment as b}from"../shaders/hittestUtils.js";import{getLineThinFactor as P}from"../shaders/LineShader.js";class g extends v{}t([i(10,r)],g.prototype,"accumulatedDistance",void 0),t([i(11,n)],g.prototype,"normal",void 0),t([i(12,n)],g.prototype,"segmentDirection",void 0);class z extends f{}class A extends h{constructor(){super(...arguments),this.type="AnimatedLineShader",this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,e){const{animationPointerAndBaseSizeAndReferenceSize:i}=t,s=i.xy,{distanceToPx:d,ndc:p,z:u,color:c,isOutline:y,strokeWidth:h,isSDF:x,baseSize:v,scale:f,scaleSymbolsProportionally:b,evalParams:P}=this._vertexPoly(t),g=t.sizing.xy,z=g.x.multiply(v).divide(g.y),A=w(s,S.shift,P).a,j=t.accumulatedDistance.subtract(A),{normal:D}=t,M=t.normal.y,F=j.divide(this.view.displayZoomFactor).add(o(t.segmentDirection,t.offset)).divide(z),R=M.add(1).divide(2),T=new n(F,R),W=t.tlbr.divide(this.mosaicInfo.size.xyxy);return{glPosition:new l(p,u,1),tlbr:W,uv:T,color:c.multiply(new r(1).subtract(y)),outlineColor:c.multiply(y),distanceToPx:d,strokeWidth:h.multiply(m(new r(1),f,b)),isOutline:y,isSDF:x,halfWidth:v.divide(2),normal:D,...this.maybeRunHittest(t,e,{pos:t.pos,size:v,sizeCorrection:new r(1),isMapAligned:new r(1),vvRotationMat3:new a(1,0,0,0,1,0,0,0,1),placementMat3:new a(1,0,0,0,1,0,0,0,1),outlineSize:new r(1),distanceToPx:d,isSDF:x})}}fragment(t){const e=this._fragmentPoly(t),{halfWidth:i,normal:s}=t,o=P(i),n=d(s).multiply(i),l=p(o.multiply(i.subtract(n)).divide(o.subtract(new r(1))),new r(0),new r(1));return this.getFragmentOutput(e.multiply(l),t)}hittest(t,e,i){const{viewMat3:s,tileMat3:o}=this.view,n=s.multiply(o),l=n.multiply(new u(t.pos,1)),r=n.multiply(new u(e.nextPos1,1)),a=n.multiply(new u(e.nextPos2,1)),{distance:m,smallSymbolDistance:d,smallSymbolSizeThreshold:p}=this.hittestRequest,h=c(i,p.multiply(.5)).multiply(m.subtract(d)),x=this.hittestRequest.position;return y(b(x,l.xy,r.xy),b(x,l.xy,a.xy)).subtract(i).add(h)}}t([e(0,s(g)),e(1,s(x))],A.prototype,"vertex",null),t([e(0,s(z))],A.prototype,"fragment",null);export{A as AnimatedLineShader};
@@ -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{pt2px as e}from"../../../../../../../core/screenUtils.js";import{minMaxZoomPrecisionFactor as t,spritePadding as i}from"../../../definitions.js";import{AAnimatedMeshWriter as r,packAnimatedBitset as s}from"./AnimatedMeshWriter.js";import{getMinMaxZoom as n}from"../fill/meshWriterUtils.js";import{c256ToRad as o}from"../shaders/constants.js";import{DataType as a}from"../../../../../../webgl/enums.js";class c extends r{get vertexSpec(){return{createComputedParams:t=>{let{pixelDimensions:i,texelDimensions:r,baseSize:s,referenceSize:n,strokeWidth:o,sizeRatio:a}=t;i||(i=t.sprite.sdf?[0,0]:[t.sprite.width,t.sprite.height]),r||(r=t.sprite.sdf?[0,0]:i),s=e(s),n=e(n),o=e(o);const c=(t.sprite.sdfDecodeCoeff??1)*a;return{...t,pixelDimensions:i,texelDimensions:r,baseSize:s,referenceSize:n,strokeWidth:o,sdfDecodeCoeff:c}},optionalAttributes:{zoomRange:{type:a.SHORT,count:2,packPrecisionFactor:t,pack:({scaleInfo:e},{tileInfo:t})=>n(e,t)}},attributes:{id:{type:a.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:a.UNSIGNED_BYTE,count:1,pack:s},pos:{type:a.SHORT,count:2,pack:"position",packPrecisionFactor:1},offset:{type:a.FLOAT,count:2,packAlternating:{count:4,pack:e=>{const t=e.texelDimensions;return[[-.5*t[0],-.5*t[1]],[.5*t[0],-.5*t[1]],[-.5*t[0],.5*t[1]],[.5*t[0],.5*t[1]]]}}},uv:{type:a.SHORT,count:2,packPrecisionFactor:1,packAlternating:{count:4,packTessellation:({texXmax:e,texXmin:t,texYmax:i,texYmin:r})=>[[t,r],[e,r],[t,i],[e,i]]}},animationPointerAndBaseSizeAndReferenceSize:{type:a.UNSIGNED_SHORT,count:4,packPrecisionFactor:1,pack:({animations:e,baseSize:t,referenceSize:i})=>[e.dataColumn,e.dataRow,t,i]},sizing:{type:a.UNSIGNED_SHORT,count:4,packPrecisionFactor:8,pack:({strokeWidth:e,pixelDimensions:t,baseSize:i,sprite:r,sizeRatio:s})=>{const n=Math.max(i*r.width/r.height,i),o=r.sdfDecodeCoeff*n*s;return[t[0],t[1],e,o]}},angle:{type:a.BYTE,count:1,packTessellation:({angle:e})=>e}}}}_write(e,t){const i=this.evaluatedMeshParams.sprite,{textureBinding:r}=i;e.recordStart(this.instanceId,this.attributeLayout,r);const s=t.getDisplayId();if("esriGeometryPolygon"===t.geometryType){const i=t.readCentroidForDisplay();if(!i)return;const[r,n]=i.coords;this._writeQuad(e,s,r,n)}else if("esriGeometryPoint"===t.geometryType){const i=t.readXForDisplay(),r=t.readYForDisplay();this._writeQuad(e,s,i,r)}else{const i=t.readGeometryForDisplay();if(i){const{angleToLine:t}=this.evaluatedMeshParams;if(t){let t=!0,r=null,n=null;i.forEachVertex(((i,a)=>{if(null!=r&&null!=n){const c=Math.atan2(a-n,i-r)/o;t&&(this._writeQuad(e,s,r,n,c),t=!1),this._writeQuad(e,s,i,a,c)}r=i,n=a}))}else i.forEachVertex(((t,i)=>{this._writeQuad(e,s,t,i)}))}}e.recordEnd()}_writeQuad(e,t,r,s,n=0){const o=this.evaluatedMeshParams.sprite,{rect:a}=o,c=a.x+i,d=a.y+i,p=a.x+a.width-i,l=a.y+a.height-i,m=e.vertexCount();e.recordBounds(r,s,64,64);const u={texXmin:c,texYmin:d,texXmax:p,texYmax:l,angle:n};for(let i=0;i<4;i++)this._writeVertex(e,t,r,s,u);e.indexEnsureSize(6),e.indexWrite(m),e.indexWrite(m+1),e.indexWrite(m+2),e.indexWrite(m+1),e.indexWrite(m+3),e.indexWrite(m+2)}}export{c as AnimatedMarkerMeshWriter};
5
+ import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as t}from"../../../../../../../geometry/GeometryCursor.js";import{maxTileCoordValue as i}from"../../../../../../../symbols/cim/constants.js";import{ExtremityPlacement as r}from"../../../../../../../symbols/cim/enums.js";import{CIMMarkerPlacementHelper as s}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{spritePadding as o}from"../../../definitions.js";import{AAnimatedMeshWriter as n}from"./AnimatedMeshWriter.js";import{angle as a,sizing as c,animationPointerAndBaseSizeAndReferenceSize as m,uv as l,offset as d,pos as p,bitset as h,id as u,lineLength as f,value1Position2Value2 as y,zoomRange as x}from"./attributes.js";import{createComputedAnimatedMeshParams as P}from"./ComputedAnimatedParams.js";import{getGeometryEngine as M}from"../mesh/loadGeometryEngine.js";import{c256ToRad as g}from"../shaders/constants.js";const w=64,b=64,v=2;class _ extends n{get vertexSpec(){return{createComputedParams:P,optionalAttributes:{zoomRange:x,value1Position2Value2:y,lineLength:f},attributes:{id:u,bitset:h,pos:p,offset:d.marker,uv:l.marker,animationPointerAndBaseSizeAndReferenceSize:m,sizing:c,angle:a}}}_write(e,t){const i=this.evaluatedMeshParams.sprite,{textureBinding:r}=i;e.recordStart(this.instanceId,this.attributeLayout,r);const s=t.getDisplayId();if(this.shift&&"esriGeometryPolyline"===t.geometryType)this._writeParticles(e,t);else if(null!=this.evaluatedMeshParams.placement)this._writePlacedMarkers(e,t);else if("esriGeometryPolygon"===t.geometryType){const i=t.readCentroidForDisplay();if(!i)return;const[r,o]=i.coords;this._writeQuad(e,s,r,o)}else if("esriGeometryPoint"===t.geometryType){const i=t.readXForDisplay(),r=t.readYForDisplay();this._writeQuad(e,s,i,r)}else{const i=t.readGeometryForDisplay();i&&i.forEachVertex(((t,i)=>{this._writeQuad(e,s,t,i)}))}e.recordEnd()}_writePlacedMarkers(r,o){const n=t.fromFeatureSetReaderCIM(o)?.clone();if(!n)return;const a=-1,c=s.getPlacement(n,a,this.evaluatedMeshParams.placement,e(1),r.id,M());if(!c)return;const m=o.getDisplayId();let l=c.next(),d=null;for(;null!=l;){const e=l.tx,t=-l.ty;if(Math.abs(e)>i||Math.abs(t)>i){l=c.next();continue}const s=-l.getAngle();r.recordBounds(e,t,w,b),this.shift?d&&this._writeQuad(r,m,d[0],d[1],void 0,s):this._writeQuad(r,m,e,t,void 0,s),d=[e,t],l=c.next()}}_writeParticles(e,t){const i=t.getDisplayId(),s=t.readGeometryForDisplay();if(!s)return;const o=[];s.forEachVertex(((e,t)=>{o.push([e,t])}));const n=j(o);let a=0;for(let r=1;r<o.length;r++){const e=o[r][0]-o[r-1][0],t=o[r][1]-o[r-1][1],i=Math.sqrt(e*e+t*t);a+=i}const c=t=>{for(const r of n){const{a:s,b:o}=r;this._writeQuad(e,i,s.position[0],s.position[1],[s.distance-t,o.position[0],o.position[1],o.distance-t],this.evaluatedMeshParams.angleToLine?Math.atan2(s.direction[1],s.direction[0]):0,a,!0)}},{placement:m}=this.evaluatedMeshParams;if(!m||"placementTemplate"in m||"CIMMarkerPlacementOnVertices"===m.type){let e;if(m&&"CIMMarkerPlacementOnVertices"!==m.type)e=m.placementTemplate;else{e=[0];for(const t of n){const{a:i,b:r}=t,s=i.position[0]-r.position[0],o=i.position[1]-r.position[1],n=Math.sqrt(s*s+o*o);e.push(n)}}let t=-1*a;for(;t<(1+v/2)*a;)for(const i of e)t+=i,c(t)}else"CIMMarkerPlacementAtExtremities"===m.type?m.extremityPlacement===r.JustBegin?c(1):m.extremityPlacement===r.JustEnd?(c(a-1),c(-1)):m.extremityPlacement===r.Both&&(c(1),c(a-1)):"CIMMarkerPlacementOnLine"===m.type&&c(a/2)}_writeQuad(e,t,i,r,s,n=0,a=0,c=!1){const m=this.evaluatedMeshParams.sprite,{rect:l}=m,d=l.x+o,p=l.y+o,h=l.x+l.width-o,u=l.y+l.height-o,f=e.vertexCount();c||e.recordBounds(i,r,w,w);const y={texXmin:d,texYmin:p,texXmax:h,texYmax:u,value1Position2Value2:s,angle:n/g,lineLength:a};for(let o=0;o<4;o++)this._writeVertex(e,t,i,r,y);e.indexEnsureSize(6),e.indexWrite(f),e.indexWrite(f+1),e.indexWrite(f+2),e.indexWrite(f+1),e.indexWrite(f+3),e.indexWrite(f+2)}}function j(e){const t=[];let i=0;for(let r=1;r<e.length;r++){const s=e[r-1],o=e[r],n=o[0]-s[0],a=o[1]-s[1],c=Math.sqrt(n*n+a*a),m=n/c,l=a/c;t.push({a:{position:s,distance:i,direction:[m,l]},b:{position:o,distance:i+c,direction:[m,l]}}),i+=c}return t}class C extends _{constructor(){super(...arguments),this.shift=!1}}class I extends _{constructor(){super(...arguments),this.shift=!0}}export{C as AnimatedMarkerMeshWriter,I as AnimatedMarkerShiftMeshWriter};
@@ -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,input as o,ComputeVertexInput 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{AAnimatedShader as _,getValue as V,AAnimatedVertexInput as C,AAnimatedFragmentInput 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 C{}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 r{}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 M{}function G(t,e,i,s){return e.multiply(t.x).add(i.multiply(t.y)).add(s.multiply(t.z))}class H extends _{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=V(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),C=z.z.subtract(P).subtract(h.multiply(D)),M=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:C,scale:M,vvScale:F}),uv:r,evalParams:g,vvScale:F,scale:M}}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=V(s,N.fromColor,o);b=new p(b.rgb.multiply(b.a),b.a);let g=V(s,N.toColor,o);g=new p(g.rgb.multiply(g.a),g.a);let z=V(s,N.colorMix,o);z=new p(z.rgb.multiply(z.a),z.a);const P=V(s,N.toOpacity,o).a,_=V(s,N.opacityMix,o).a,C=I(this,t.id,b,h(A(t.bitset,k.bitset.colorLocked),new c(r))),M=x(C,g,z),D=O(this,t.id),j=x(D,P,_),F=M.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,o(W)),e(1,o(B))],H.prototype,"vertex",null),t([e(0,o(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,input as o,ComputeVertexInput as l}from"../../GraphShaderModule.js";import{Float as r,Vec4 as a,or as n,Bool as d,mix as m,Mat3 as u,ifElse as p,lessThan as h,Vec3 as x,distance as c,greaterThan as y,Vec2 as f,negate as w,step as g}from"../../graph/glsl.js";import{AAnimatedShader as v,getValue as S,AAnimatedVertexInput as b,AAnimatedFragmentInput as _}from"./AAnimatedShader.js";import{AnimationParamIndex as C}from"./enums.js";import{MarkerConstants as V}from"../markers/markerConstants.js";import{distPointTriangle as z,xyToBarycentric as P,inTriangle as M,failHittest as N}from"../shaders/hittestUtils.js";import{getBitBool as k}from"../shaders/utils.js";import{getVisualVariableColor as j,getVisualVariableOpacity as D}from"../shaders/vvUtils.js";class R extends b{}t([s(9,f)],R.prototype,"uv",void 0),t([s(10,r)],R.prototype,"angle",void 0);class F extends l{}t([s(11,f)],F.prototype,"offsetNextVertex1",void 0),t([s(12,f)],F.prototype,"offsetNextVertex2",void 0),t([s(13,f)],F.prototype,"textureUVNextVertex1",void 0),t([s(14,f)],F.prototype,"textureUVNextVertex2",void 0);class T extends _{}function U(t,e,i,s){return e.multiply(t.x).add(i.multiply(t.y)).add(s.multiply(t.z))}class q extends v{constructor(){super(...arguments),this.type="AnimatedMarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=t.uv.divide(this.mosaicInfo.size),{position:s,animationPointer:o,evalParams:l,isOutline:p,unscaledDistanceToPx:h,vvScale:x,strokeWidth:c,scaleSymbolsProportionally:y,scale:f,isSDF:w,baseSize:g,clip:v}=this._vertexPreamble(t,t.angle,t.lineLength||new r(0)),b=this._toNdc(s);let _=S(o,C.fromColor,l);_=new a(_.rgb.multiply(_.a),_.a);let z=S(o,C.toColor,l);z=new a(z.rgb.multiply(z.a),z.a);let P=S(o,C.colorMix,l);P=new a(P.rgb.multiply(P.a),P.a);const M=S(o,C.toOpacity,l).a,N=S(o,C.opacityMix,l).a,R=j(this,t.id,_,n(k(t.bitset,V.bitset.colorLocked),new d(p))),F=m(R,z,P),T=D(this,t.id),U=m(T,M,N),q=F.multiply(U),A=this.clip(t.id,t.zoomRange).add(v.multiply(2)),I=h.multiply(x);return{glPosition:new a(b,A,1),uv:i,color:q.multiply(new r(1).subtract(p)),outlineColor:q.multiply(p),distanceToPx:I,strokeWidth:c.multiply(m(new r(1),f,y)),isOutline:p,isSDF:w,...this.maybeRunHittest(t,e,{pos:t.pos,size:g,sizeCorrection:new r(1),isMapAligned:new r(1),vvRotationMat3:new u(1,0,0,0,1,0,0,0,1),placementMat3:new u(1,0,0,0,1,0,0,0,1),outlineSize:new r(1),distanceToPx:I,isSDF:w})}}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 a(0,.3,0,.3))),this.getFragmentOutput(e,t)}hittest(t,e,i){return p(h(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:l}=this.hittestRequest,r=o.subtract(l),{viewMat3:a,tileMat3:n}=this.view,d=a.multiply(n).multiply(new x(i.pos,1)).xy,m=i.size.multiply(.5);return c(d,s).subtract(m).add(r)}_hittestMarker(t,e,i){const s=this._vertexPreamble({...t},t.angle,new r(0)).position,o=this._vertexPreamble({...t,offset:e.offsetNextVertex1},t.angle,new r(0)).position,l=this._vertexPreamble({...t,offset:e.offsetNextVertex2},t.angle,new r(0)).position,a=this.hittestRequest.position,n=this.hittestRequest.distance,d=z(a,s,o,l);return p(y(d,n),d,this._hittestSamples(s,o,l,t,e,i))}_hittestSamples(t,e,i,s,o,l){const{outlineSize:n,isSDF:d,distanceToPx:m}=l,u=this.hittestRequest.position,p=this.hittestRequest.distance,h=P(u.add(new f(w(p),w(p))),t,e,i),x=P(u.add(new f(0,w(p))),t,e,i),c=P(u.add(new f(p,w(p))),t,e,i),y=P(u.add(new f(w(p),0)),t,e,i),v=P(u,t,e,i),S=P(u.add(new f(p,0)),t,e,i),b=P(u.add(new f(w(p),p)),t,e,i),_=P(u.add(new f(0,p)),t,e,i),C=P(u.add(new f(p,p)),t,e,i),V=s.uv.divide(this.mosaicInfo.size),z=o.textureUVNextVertex1.divide(this.mosaicInfo.size),k=o.textureUVNextVertex2.divide(this.mosaicInfo.size),j={color:new a(1,1,1,1),outlineSize:n,outlineColor:new a(1,1,1,1),isSDF:d,distanceToPx:m};let D=new r(0);return D=D.add(M(h).multiply(this._getColor(U(h,V,z,k),j).a)),D=D.add(M(x).multiply(this._getColor(U(x,V,z,k),j).a)),D=D.add(M(c).multiply(this._getColor(U(c,V,z,k),j).a)),D=D.add(M(y).multiply(this._getColor(U(y,V,z,k),j).a)),D=D.add(M(v).multiply(this._getColor(U(v,V,z,k),j).a)),D=D.add(M(S).multiply(this._getColor(U(S,V,z,k),j).a)),D=D.add(M(b).multiply(this._getColor(U(b,V,z,k),j).a)),D=D.add(M(_).multiply(this._getColor(U(_,V,z,k),j).a)),D=D.add(M(C).multiply(this._getColor(U(C,V,z,k),j).a)),g(D,new r(.05)).multiply(N(this.hittestRequest))}}t([e(0,o(R)),e(1,o(F))],q.prototype,"vertex",null),t([e(0,o(T))],q.prototype,"fragment",null);export{T as AnimatedMarkerFragmentInput,q as AnimatedMarkerShader,R as AnimatedMarkerVertexInput};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{LineCapStyle as s,LineJoinStyle as i}from"../../../../../../../symbols/cim/enums.js";import"../../../definitions.js";import{LineTessellation as r}from"../../../TurboLine.js";import{clipLinesMarshall as n,triangulate as o}from"../../../mesh/templates/templateUtils.js";import{AAnimatedMeshWriter as a}from"./AnimatedMeshWriter.js";import{lineLength as h,noTiming as m,zoomRange as l,segmentDirection as u,normal as c,accumulatedDistance as d,sizing as p,animationPointerAndBaseSizeAndReferenceSize as f,tlbr as x,offset as _,pos as g,bitset as P,id as y,noLineLength as v}from"./attributes.js";import{createComputedAnimatedMeshParams as L}from"./ComputedAnimatedParams.js";import{processLineCapInput as W,processLineJoinInput as b}from"../fill/meshWriterUtils.js";import{LineTessellationParams as w}from"../line/LineMeshWriter.js";class j extends a{_write(t,e){const s=e.readGeometryForDisplay();if(!s)return;const i=this.evaluatedMeshParams.sprite,{textureBinding:r}=i;t.recordStart(this.instanceId,this.attributeLayout,r);const n=e.getDisplayId();this._writePoly(t,n,s),t.recordEnd()}}class C extends j{constructor(){super(...arguments),this.vertexSpec={createComputedParams:L,attributes:{id:y,bitset:P,pos:g,offset:_.fill,tlbr:x,animationPointerAndBaseSizeAndReferenceSize:f,sizing:p},optionalAttributes:{zoomRange:l,value1Position2Value2:m,lineLength:v}}}_writePoly(t,e,s){const i=[];if(!o(i,s))return;const r=t.vertexCount();s.forEachVertex(((s,i)=>{this._writeVertex(t,e,s,i)})),t.indexEnsureSize(i.length);for(const n of i)t.indexWrite(r+n)}}class z{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0,this.pathLength=0}}const T=65535;class S extends j{constructor(){super(...arguments),this.vertexSpec={createComputedParams:L,attributes:{id:y,bitset:P,pos:g,offset:_.line,tlbr:x,animationPointerAndBaseSizeAndReferenceSize:f,sizing:p,accumulatedDistance:d,normal:c,segmentDirection:u},optionalAttributes:{zoomRange:l,value1Position2Value2:m,lineLength:h}},this._tessParams=new w,this._currentWrite=new z,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:T,textured:!1},this._lineLength=0,this._lineTessellator=new r(((t,e,s,i,r,n,o,a,h,m,l)=>this._writeTesselatedVertex(t,e,s,i,r,n,o,a,h,m,l,this._lineLength)),this._writeTriangle.bind(this),!1)}_writePoly(r,o,a){const h=64,m=!1,l=n(e.fromOptimized(a,"esriGeometryPolyline"),h);if(null==l)return;const{_currentWrite:u,_tessellationOptions:c}=this,{baseSize:d,capType:p,joinType:f,miterLimit:x}=this.evaluatedMeshParams,_=t(.5*d);c.halfWidth=_,c.capType=W(p||s.Round),c.joinType=b(f||i.Round),c.miterLimit=x||2,u.out=r,u.id=o,u.vertexCount=0,u.indexCount=0,u.vertexFrom=r.vertexCount(),u.vertexBounds=1;for(const{line:t,start:e,pathLength:s}of l){c.initialDistance=e%T,u.pathLength=s,this._lineLength=0;for(let e=1;e<t.length;e++){const s=t[e].x-t[e-1].x,i=t[e].y-t[e-1].y;this._lineLength+=Math.sqrt(s*s+i*i)}this._lineTessellator.tessellate(t,c,m)}}_writeTesselatedVertex(t,e,s,i,r,n,o,a,h,m,l,u){const{out:c,id:d,vertexBounds:p,pathLength:f}=this._currentWrite;return this.hasEffects&&c.recordBounds(t,e,p,p),this._tessParams.extrusionOffsetX=o,this._tessParams.extrusionOffsetY=a,this._tessParams.normalX=h,this._tessParams.normalY=m,this._tessParams.directionX=r,this._tessParams.directionY=n,this._tessParams.distance=l,this._tessParams.pathLength=f,this._tessParams.lineLength=u,this._writeVertex(c,d,t,e,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(t,e,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(t),i.indexWrite(e),i.indexWrite(s),this._currentWrite.indexCount+=3}}export{j as AAnimatedPolyMeshWriter,C as AnimatedFillMeshWriter,S as AnimatedLineMeshWriter};
@@ -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{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{animationDebugFlags as i}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{FeatureTechnique as a}from"../FeatureTechnique.js";import{getSelectionDefines as o,getFeatureUniforms as s,resolveDynamicUniforms as n,getFeaturePipelineState as m}from"../featureTechniqueUtils.js";class u extends a{render(a,u){const{context:f,painter:c}=a,{target:l}=u,{freezeGlobalTime:p}=i,g=0,x=c.textureManager.animationStore.getTexture(f,g),d=[2/a.state.size[0],0,0,0,-2/a.state.size[1],0,-1,1,1],h=Array.from(e(r(),d)),b=Array.from(t(r(),h,l.transforms.displayViewScreenMat3)),T=u.instance.getInput();c.setShader({shader:this.shaders.geometry,uniforms:{...n(a,u.target,T.uniforms),...s(a,u.target),mosaicInfo:c.textureManager.getMosaicInfo(f,u.textureKey,!0),animationInfo:{globalTime:!1===p?a.time/1e3:p,animationTextureSize:[x.descriptor.width,x.descriptor.height],animationTexture:{unit:6,texture:x},toScreen:b,toNdc:d,mapRotation:a.state.rotation,pixelRatio:a.state.pixelRatio}},defines:{...o(a)},optionalAttributes:{zoomRange:!0},useComputeBuffer:!0}),c.setPipelineState({...m(a)}),c.submitDraw(a,u),!1===p&&l.requestRender()}}export{u as AnimatedTechnique};
5
+ import{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{animationDebugFlags as a}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{FeatureTechnique as r}from"../FeatureTechnique.js";import{getSelectionDefines as o,getLocalTileOffset as n,getFeatureUniforms as s,resolveDynamicUniforms as m,getFeaturePipelineState as u}from"../featureTechniqueUtils.js";class l extends r{render(r,l){const{context:c,painter:f}=r,{target:g}=l,{freezeGlobalTime:p}=a,d=0,x=f.textureManager.animationStore.getTexture(c,d),h=[2/r.state.size[0],0,0,0,-2/r.state.size[1],0,-1,1,1],b=Array.from(e(i(),h)),D=Array.from(t(i(),b,g.transforms.displayViewScreenMat3)),T=l.instance.getInput(),y=f.textureManager.getMosaicInfo(c,l.textureKey,!1),{optionalAttributes:z}=T,R=z.zoomRange,S=z.value1Position2Value2,j="accumulatedDistance"in z&&z.accumulatedDistance,A="segmentDirection"in z&&z.segmentDirection,I="normal"in z&&z.normal;f.setShader({shader:this.shaders.geometry,uniforms:{...m(r,l.target,T.uniforms),...s(r,l.target),mosaicInfo:y,animationInfo:{globalTime:!1===p?r.time/1e3:p,animationTextureSize:[x.descriptor.width,x.descriptor.height],animationTexture:{unit:6,texture:x},toScreen:D,toNdc:h,mapRotation:r.state.rotation,pixelRatio:r.state.pixelRatio},localTileOffset:n(l.target)},defines:{...o(r)},optionalAttributes:{zoomRange:R,value1Position2Value2:S,accumulatedDistance:j,segmentDirection:A,normal:I},useComputeBuffer:!0}),f.setPipelineState({...u(r)}),f.submitDraw(r,l),!1===p&&g.requestRender()}}export{l as AnimatedTechnique};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{FeatureSymbologyDrawOrder as e}from"../../../enums.js";import{TechniqueType as s}from"../TechniqueType.js";import{AnimatedFillShader as t}from"./AnimatedFillShader.js";import{AnimatedLineShader as r}from"./AnimatedLineShader.js";import{AnimatedMarkerShader as i}from"./AnimatedMarkerShader.js";import{AnimatedTechnique as o}from"./AnimatedTechnique.js";class m extends o{constructor(){super(...arguments),this.type=s.AnimatedMarker,this.symbologyPlane=e.MARKER,this.shaders={geometry:new i}}}class n extends o{constructor(){super(...arguments),this.type=s.AnimatedMarkerShift,this.symbologyPlane=e.MARKER,this.shaders={geometry:new i}}}class a extends o{constructor(){super(...arguments),this.type=s.AnimatedFill,this.symbologyPlane=e.FILL,this.shaders={geometry:new t}}}class h extends o{constructor(){super(...arguments),this.type=s.AnimatedLine,this.symbologyPlane=e.LINE,this.shaders={geometry:new r}}}export{a as AnimatedFillTechnique,h as AnimatedLineTechnique,n as AnimatedMarkerShiftTechnique,m as AnimatedMarkerTechnique};