@arcgis/core 4.30.0-next.20240212 → 4.30.0-next.20240213

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 (69) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/05ebb9cec0e1826b283f.js +1 -0
  3. package/assets/esri/core/workers/chunks/0d54451c740f54a59f49.js +1 -0
  4. package/assets/esri/core/workers/chunks/18551a7eb5a9b88aa0dc.js +1 -0
  5. package/assets/esri/core/workers/chunks/24d19abc680b341d13bb.js +1 -0
  6. package/assets/esri/core/workers/chunks/{3f4d63436c3de04a6ebb.js → 254b4ee3621bbe345bb1.js} +1 -1
  7. package/assets/esri/core/workers/chunks/2d682ee6e5d66f2ea5cd.js +1 -0
  8. package/assets/esri/core/workers/chunks/{d5484d470121de2b403b.js → 36d091be859bbb1a149b.js} +1 -1
  9. package/assets/esri/core/workers/chunks/50b41f91be903a0977f9.js +1 -0
  10. package/assets/esri/core/workers/chunks/50bb67f2eeace5d50673.js +1 -0
  11. package/assets/esri/core/workers/chunks/784b6a8216b97440b180.js +1 -0
  12. package/assets/esri/core/workers/chunks/{7f7a4de2cd4ab71b9aee.js → 8d119dc0a92ad3612daa.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{0014635097a32ad38895.js → a854611d1a86b838c6ad.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{50a5abd75fa7dbb571a5.js → ccd53b81c2688dd11584.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{b2b8e6a0b3f70ada2799.js → e4da908079417cc2f495.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{af0314c2b5b7dc4f5bbd.js → e6dbf0a7b7b1cf64f23f.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{eba72ff1726ff6998204.js → f03d62ab7806b68d0b62.js} +1 -1
  18. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  19. package/geometry/Mesh.js +1 -1
  20. package/geometry/support/meshVertexSpaceUtils.js +1 -1
  21. package/interfaces.d.ts +172 -14
  22. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  23. package/layers/SceneLayer.js +1 -1
  24. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  25. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  26. package/package.json +2 -2
  27. package/portal/support/resourceUtils.js +1 -1
  28. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  29. package/rest/support/meshFeatureSet.js +1 -1
  30. package/support/revision.js +1 -1
  31. package/symbols/cim/constants.js +1 -1
  32. package/symbols/support/previewSymbol2D.js +1 -1
  33. package/versionManagement/support/versionManagementUtils.js +1 -1
  34. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  35. package/views/2d/engine/webgl/collisions/CollisionGrid.js +1 -1
  36. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  37. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  38. package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +1 -1
  39. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  40. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  41. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js +1 -1
  42. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  43. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  44. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  45. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  46. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  47. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  48. package/views/3d/interactive/editingTools/transformGraphic/ExtentScale.js +1 -1
  49. package/views/3d/interactive/editingTools/transformGraphic/extentUtils.js +1 -1
  50. package/views/3d/layers/I3SMeshView3D.js +1 -1
  51. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  52. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  53. package/views/draw/DrawOperation.js +1 -1
  54. package/views/draw/support/Box.js +1 -1
  55. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  56. package/views/support/automaticLengthMeasurementUtils.js +1 -1
  57. package/views/support/extentUtils.js +5 -0
  58. package/widgets/BasemapLayerList.js +1 -1
  59. package/widgets/FeatureForm.js +1 -1
  60. package/widgets/LayerList.js +1 -1
  61. package/widgets/TableList.js +1 -1
  62. package/assets/esri/core/workers/chunks/062629a9b4695dea8bf8.js +0 -1
  63. package/assets/esri/core/workers/chunks/37803888bd9a537481a7.js +0 -1
  64. package/assets/esri/core/workers/chunks/5bfc5ffad705aaaafcd4.js +0 -1
  65. package/assets/esri/core/workers/chunks/655f4560fb36a0d9ff0b.js +0 -1
  66. package/assets/esri/core/workers/chunks/b927b655e955abe00d48.js +0 -1
  67. package/assets/esri/core/workers/chunks/bd2d64a5cd8e7a39c235.js +0 -1
  68. package/assets/esri/core/workers/chunks/d2417d179d015f1193a1.js +0 -1
  69. package/assets/esri/core/workers/chunks/f75ec599f53c66cab194.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{getMinMaxZoom as t}from"../fill/meshWriterUtils.js";import{MeshWriter as r}from"../mesh/MeshWriter.js";import{DataType as i}from"../../../../../../webgl/enums.js";const o={createComputedParams:e=>e,attributes:{pos:{type:i.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:i.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:i.UNSIGNED_BYTE,count:1,pack:e=>0},offset:{type:i.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:t,outlineWidth:r})=>{const i=Math.round(e(t+2*r)),o=-i/2,s=-i/2;return[[o,s],[o+i,s],[o,s+i],[o+i,s+i]]}}},texCoords:{type:i.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:i.UNSIGNED_BYTE,count:2,pack:({size:e})=>[e,e]},referenceSize:{type:i.UNSIGNED_BYTE,count:1,pack:({size:t})=>e(t)},zoomRange:{type:i.UNSIGNED_BYTE,count:2,pack:({scaleInfo:e},{tileInfo:r})=>t(e,r)}}};class s extends r{constructor(){super(...arguments),this.vertexSpec=o}_write(t,r){const i=r.getDisplayId(),o=this.evaluatedMeshParams.minPixelBuffer,s=Math.max(e(this.evaluatedMeshParams.size),o);let c,n;if("esriGeometryPoint"===r.geometryType)c=r.readXForDisplay(),n=r.readYForDisplay();else{const e=r.readCentroidForDisplay();if(!e)return;c=e?.coords[0],n=e?.coords[1]}t.recordStart(this.instanceId,this.attributeLayout),t.recordBounds(c,n,s,s);const a=t.vertexCount();this._writeVertex(t,i,c,n),t.indexWrite(a+0),t.indexWrite(a+1),t.indexWrite(a+2),t.indexWrite(a+1),t.indexWrite(a+3),t.indexWrite(a+2),t.recordEnd()}}export{s as PieChartMeshWriter};
5
+ import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{getMinMaxZoom as t}from"../fill/meshWriterUtils.js";import{MeshWriter as r}from"../mesh/MeshWriter.js";import{DataType as i}from"../../../../../../webgl/enums.js";const o={createComputedParams:e=>e,attributes:{pos:{type:i.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:i.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:i.UNSIGNED_BYTE,count:1,pack:e=>0},offset:{type:i.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:t})=>{const r=e(t),i=-r/2,o=-r/2;return[[i,o],[i+r,o],[i,o+r],[i+r,o+r]]}}},texCoords:{type:i.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:i.UNSIGNED_BYTE,count:2,pack:({size:e})=>[e,e]},referenceSize:{type:i.UNSIGNED_BYTE,count:1,pack:({size:t})=>e(t)},zoomRange:{type:i.UNSIGNED_BYTE,count:2,pack:({scaleInfo:e},{tileInfo:r})=>t(e,r)}}};class s extends r{constructor(){super(...arguments),this.vertexSpec=o}_write(t,r){const i=r.getDisplayId(),o=this.evaluatedMeshParams.minPixelBuffer,s=Math.max(e(this.evaluatedMeshParams.size),o);let c,n;if("esriGeometryPoint"===r.geometryType)c=r.readXForDisplay(),n=r.readYForDisplay();else{const e=r.readCentroidForDisplay();if(!e)return;c=e?.coords[0],n=e?.coords[1]}t.recordStart(this.instanceId,this.attributeLayout),t.recordBounds(c,n,s,s);const a=t.vertexCount();this._writeVertex(t,i,c,n),t.indexWrite(a+0),t.indexWrite(a+1),t.indexWrite(a+2),t.indexWrite(a+1),t.indexWrite(a+3),t.indexWrite(a+2),t.recordEnd()}}export{s as PieChartMeshWriter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- var i;!function(i){i[i.Geographic=0]="Geographic",i[i.Arithmatic=1]="Arithmatic"}(i||(i={}));const t=3.14159265359/180,c=3.14159265359/128,r=180/3.141592654,a=1/8,e=1,o=1,h=1.1,n=1,p=1/4,g=1/8,m=.2,A=24,G=8,f=8,s=1e-5,u=.05,v=2,x=0,b=1,d=2,j=3,k=1e-30,l=1,q=4,w=0,y=2,z=3,B=0,C=2,D=5,E=6,F=2,H=3,I=0,J=3,K=4,L=16777216;export{i as RotationType,b as attrVvColor,d as attrVvOpacity,j as attrVvRotation,x as attrVvSize,D as bitsetFillPatternHeightIsCompressed,E as bitsetFillPatternWidthIsCompressed,C as bitsetFillRandomPatternOffset,q as bitsetGenericConsiderAlphaOnly,l as bitsetGenericLockColor,H as bitsetLineIsSdf,F as bitsetLineScaleDash,w as bitsetMarkerAlignmentMap,y as bitsetMarkerOutlineAllowColorOverride,z as bitsetMarkerScaleSymbolsProportionally,I as bitsetTextIsBackground,K as bitsetTextIsLineLabel,J as bitsetTextIsMapAligned,B as bitsetTypeFillOutline,c as c256ToRad,t as cDegToRad,r as cRadToDeg,s as epsilon,u as epsilonHitTest,p as extrudeScalePlacementPadding,e as fillPositionPrecision,v as maxFilterCount,L as maxRepresentableInt,G as maxSdfDistance,k as nanMagicNumber,g as offsetPrecision,m as outlineScale,f as placementPadding,a as positionPrecision,A as sdfFontSize,o as softEdgeRatio,n as thinLineHalfWidth,h as thinLineWidthFactor};
5
+ var i;!function(i){i[i.Geographic=0]="Geographic",i[i.Arithmatic=1]="Arithmatic"}(i||(i={}));const t=3.14159265359/180,c=3.14159265359/128,r=180/3.141592654,a=1/8,e=1,o=1,h=1.1,n=1,p=1/4,g=1/8,m=.2,A=24,G=8,f=8,s=1e-5,u=.05,v=2,x=0,b=1,d=2,j=3,k=1e-30,l=1,q=4,w=0,y=2,z=3,B=0,C=2,D=5,E=6,F=2,H=3,I=0,J=3,K=16777216;export{i as RotationType,b as attrVvColor,d as attrVvOpacity,j as attrVvRotation,x as attrVvSize,D as bitsetFillPatternHeightIsCompressed,E as bitsetFillPatternWidthIsCompressed,C as bitsetFillRandomPatternOffset,q as bitsetGenericConsiderAlphaOnly,l as bitsetGenericLockColor,H as bitsetLineIsSdf,F as bitsetLineScaleDash,w as bitsetMarkerAlignmentMap,y as bitsetMarkerOutlineAllowColorOverride,z as bitsetMarkerScaleSymbolsProportionally,I as bitsetTextIsBackground,J as bitsetTextIsMapAligned,B as bitsetTypeFillOutline,c as c256ToRad,t as cDegToRad,r as cRadToDeg,s as epsilon,u as epsilonHitTest,p as extrudeScalePlacementPadding,e as fillPositionPrecision,v as maxFilterCount,K as maxRepresentableInt,G as maxSdfDistance,k as nanMagicNumber,g as offsetPrecision,m as outlineScale,f as placementPadding,a as positionPrecision,A as sdfFontSize,o as softEdgeRatio,n as thinLineHalfWidth,h as thinLineWidthFactor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../../../../../core/mathUtils.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as o}from"../../../../../../../geometry/GeometryCursor.js";import{CIMMarkerPlacementHelper as r}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{getXDirection as i,getYDirection as s}from"../../../alignmentUtils.js";import{minMaxZoomPrecisionFactor as n,magicLabelLineHeight as a,glyphSize as c}from"../../../definitions.js";import{shapeGlyphs as l}from"../../../mesh/templates/shapingUtils.js";import{packBitset as h,processColorInput as p}from"../fill/meshWriterUtils.js";import{getGeometryEngine as f}from"../mesh/loadGeometryEngine.js";import{MeshWriter as m}from"../mesh/MeshWriter.js";import{bitsetTextIsBackground as d,bitsetTextIsMapAligned as u,bitsetTextIsLineLabel as g}from"../shaders/constants.js";import{TextMeshTransformProps as x}from"./TextParams.js";import{DataType as y}from"../../../../../../webgl/enums.js";const _=[4,4],P=[16,4],S={topLeft:P,topRight:P,bottomLeft:P,bottomRight:P},b=[4,2],k=[4,6],T={topLeft:b,topRight:b,bottomLeft:k,bottomRight:k},B={topLeft:b,topRight:k,bottomLeft:b,bottomRight:k},R={topLeft:k,topRight:k,bottomLeft:_,bottomRight:_},w={topLeft:_,topRight:_,bottomLeft:k,bottomRight:k},L={topLeft:k,topRight:_,bottomLeft:k,bottomRight:_},M={topLeft:_,topRight:k,bottomLeft:_,bottomRight:k},z={createComputedParams:t=>t,attributes:{pos:{type:y.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:y.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:y.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e,isLineLabel:o})=>h([[d,t],[u,!!e],[g,!!o]])},zoomRange:{type:y.UNSIGNED_BYTE,count:2,packPrecisionFactor:n,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||100]},offset:{type:y.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:r,topRight:i}=t;return[r,i,e,o]}}},textureUV:{type:y.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:r,topRight:i}=t;return[r,i,e,o]}}},color:{type:y.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontSize:{type:y.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t})=>e(t)},referenceSize:{type:y.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:o})=>e(o??t)},haloColor:{type:y.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>p(t)},haloFontSize:{type:y.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,pack:({haloFontSize:t})=>e(t)},clipAngle:{type:y.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>G(t||0)},referenceSymbol:{type:y.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,o)=>{if(!t.referenceBounds)return[0,0,0,0];const r=i(o.horizontalAlignment),n=s(o.verticalAlignment),{offsetX:a,offsetY:c,size:l}=t.referenceBounds;return[e(a),-e(c),e(l),r+1<<2|n+1]}}}};class E extends m{constructor(){super(...arguments),this.vertexSpec=z,this._textMeshParamsPropsInitialized=!1}ensurePacked(t,e,o){super.ensurePacked(t,e,o),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new x(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(t,e,o){const r=this._getShaping();if(!r)return;const i=e.getDisplayId();if(null!=this.evaluatedMeshParams.placement)return this._writePlacedTextMarkers(t,e,r,o);if(o&&o.nextPath())return o.nextPoint(),this._writeGlyphs(t,i,o.x,o.y,r,0);if("esriGeometryPolygon"===e.geometryType){const o=e.readCentroidForDisplay();if(!o)return;const[s,n]=o.coords;return this._writeGlyphs(t,i,s,n,r,0)}if("esriGeometryMultipoint"===e.geometryType){const o=e.readGeometryForDisplay();return void o?.forEachVertex(((e,o)=>this._writeGlyphs(t,i,e,o,r,0)))}const s=e.readXForDisplay(),n=e.readYForDisplay();return this._writeGlyphs(t,i,s,n,r,0)}_writePlacedTextMarkers(t,i,s,n){const a=n??o.fromFeatureSetReaderCIM(i);if(!a)return;const c=-1,l=r.getPlacement(a,c,this.evaluatedMeshParams.placement,e(1),t.id,f());if(!l)return;const h=i.getDisplayId();let p=l.next();for(;null!=p;){const e=p.tx,o=-p.ty,r=-p.getAngle();this._writeGlyphs(t,h,e,o,s,r),p=l.next()}}_getShaping(){const o=this._textMeshTransformProps,r=this.evaluatedMeshParams;if(!r.glyphs?.glyphs.length)return null;const i=Math.round(e(o.fontSize)),s=e(o.offsetX),n=e(o.offsetY),h=t(e(r.lineWidth),32,512),p=a*t(r.lineHeightRatio,.25,4);return l(r.glyphs,{scale:i/c,angle:o.postAngle,xOffset:s,yOffset:n,horizontalAlignment:r.horizontalAlignment,verticalAlignment:r.verticalAlignment,maxLineWidth:h,lineHeight:p,decoration:r.decoration,borderLineSizePx:e(r.boxBorderLineSize),hasBackground:!!r.boxBackgroundColor,useCIMAngleBehavior:r.useCIMAngleBehavior})}_writeGlyphs(t,o,r,i,s,n,a){const c=this.evaluatedMeshParams,l=this._textMeshTransformProps,h=l.fontSize,f=e(l.offsetX),m=e(l.offsetY);0!==n&&s.setRotation(n);const d=s.bounds,u=r+d.x+f,g=i+d.y-m,x=2*(c.minPixelBuffer?c.minPixelBuffer/h:1),y=Math.max(d.width,d.height)*x;s.textBox&&(t.recordStart(this.instanceId,this.attributeLayout,s.glyphs[0].textureBinding),t.recordBounds(u,g,y,y),this._writeTextBox(t,o,r,i,s.textBox,a),t.recordEnd());for(const e of s.glyphs){t.recordStart(this.instanceId,this.attributeLayout,e.textureBinding),t.recordBounds(u,g,y,y);const{texcoords:s,offsets:n}=e;this._writeQuad(t,o,r,i,{texcoords:s,offsets:n,fontSize:h,color:p(c.color),isBackground:!1,referenceBounds:a}),t.recordEnd()}0!==n&&s.setRotation(-n)}_writeTextBox(t,e,o,r,i,s,n){const a=this.evaluatedMeshParams,{fontSize:c}=this._textMeshTransformProps,{boxBackgroundColor:l,boxBorderLineColor:h}=a,f={isBackground:!0,fontSize:c,referenceBounds:s,...n};l&&(this._writeQuad(t,e,o,r,{texcoords:S,offsets:i.main,color:p(l),...f}),h||(this._writeQuad(t,e,o,r,{texcoords:R,offsets:i.top,color:p(l),...f}),this._writeQuad(t,e,o,r,{texcoords:w,offsets:i.bot,color:p(l),...f}),this._writeQuad(t,e,o,r,{texcoords:L,offsets:i.left,color:p(l),...f}),this._writeQuad(t,e,o,r,{texcoords:M,offsets:i.right,color:p(l),...f}))),h&&(this._writeQuad(t,e,o,r,{texcoords:T,offsets:i.top,color:p(h),...f}),this._writeQuad(t,e,o,r,{texcoords:T,offsets:i.bot,color:p(h),...f}),this._writeQuad(t,e,o,r,{texcoords:B,offsets:i.left,color:p(h),...f}),this._writeQuad(t,e,o,r,{texcoords:B,offsets:i.right,color:p(h),...f}))}_writeQuad(t,e,o,r,i){const s=t.vertexCount();this._writeVertex(t,e,o,r,i),t.indexWrite(s+0),t.indexWrite(s+1),t.indexWrite(s+2),t.indexWrite(s+1),t.indexWrite(s+3),t.indexWrite(s+2)}}const G=t=>Math.round(t*(254/360));export{E as TextMeshWriter,z as TextVertexSpec};
5
+ import{clamp as t}from"../../../../../../../core/mathUtils.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as o}from"../../../../../../../geometry/GeometryCursor.js";import{CIMMarkerPlacementHelper as r}from"../../../../../../../symbols/cim/placements/CIMMarkerPlacementHelper.js";import{getXDirection as i,getYDirection as s}from"../../../alignmentUtils.js";import{minMaxZoomPrecisionFactor as n,magicLabelLineHeight as a,glyphSize as c}from"../../../definitions.js";import{shapeGlyphs as l}from"../../../mesh/templates/shapingUtils.js";import{packBitset as h,processColorInput as p}from"../fill/meshWriterUtils.js";import{getGeometryEngine as f}from"../mesh/loadGeometryEngine.js";import{MeshWriter as m}from"../mesh/MeshWriter.js";import{bitsetTextIsBackground as d,bitsetTextIsMapAligned as u}from"../shaders/constants.js";import{TextMeshTransformProps as g}from"./TextParams.js";import{DataType as x}from"../../../../../../webgl/enums.js";const y=[4,4],_=[16,4],P={topLeft:_,topRight:_,bottomLeft:_,bottomRight:_},S=[4,2],k=[4,6],b={topLeft:S,topRight:S,bottomLeft:k,bottomRight:k},T={topLeft:S,topRight:k,bottomLeft:S,bottomRight:k},B={topLeft:k,topRight:k,bottomLeft:y,bottomRight:y},R={topLeft:y,topRight:y,bottomLeft:k,bottomRight:k},w={topLeft:k,topRight:y,bottomLeft:k,bottomRight:y},M={topLeft:y,topRight:k,bottomLeft:y,bottomRight:k},z={createComputedParams:t=>t,attributes:{pos:{type:x.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:x.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:x.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>h([[d,t],[u,!!e]])},zoomRange:{type:x.UNSIGNED_SHORT,count:2,packPrecisionFactor:n,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||100]},offset:{type:x.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:r,topRight:i}=t;return[r,i,e,o]}}},textureUV:{type:x.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:o,topLeft:r,topRight:i}=t;return[r,i,e,o]}}},color:{type:x.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontSize:{type:x.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t})=>e(t)},referenceSize:{type:x.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:o})=>e(o??t)},haloColor:{type:x.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>p(t)},haloFontSize:{type:x.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,pack:({haloFontSize:t})=>e(t)},clipAngle:{type:x.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>E(t||0)},referenceSymbol:{type:x.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,o)=>{if(!t.referenceBounds)return[0,0,0,0];const r=i(o.horizontalAlignment),n=s(o.verticalAlignment),{offsetX:a,offsetY:c,size:l}=t.referenceBounds;return[e(a),-e(c),e(l),r+1<<2|n+1]}}}};class L extends m{constructor(){super(...arguments),this.vertexSpec=z,this._textMeshParamsPropsInitialized=!1}ensurePacked(t,e,o){super.ensurePacked(t,e,o),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new g(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(t,e,o){const r=this._getShaping();if(!r)return;const i=e.getDisplayId();if(null!=this.evaluatedMeshParams.placement)return this._writePlacedTextMarkers(t,e,r,o);if(o&&o.nextPath())return o.nextPoint(),this._writeGlyphs(t,i,o.x,o.y,r,0);if("esriGeometryPolygon"===e.geometryType){const o=e.readCentroidForDisplay();if(!o)return;const[s,n]=o.coords;return this._writeGlyphs(t,i,s,n,r,0)}if("esriGeometryMultipoint"===e.geometryType){const o=e.readGeometryForDisplay();return void o?.forEachVertex(((e,o)=>this._writeGlyphs(t,i,e,o,r,0)))}const s=e.readXForDisplay(),n=e.readYForDisplay();return this._writeGlyphs(t,i,s,n,r,0)}_writePlacedTextMarkers(t,i,s,n){const a=n??o.fromFeatureSetReaderCIM(i);if(!a)return;const c=-1,l=r.getPlacement(a,c,this.evaluatedMeshParams.placement,e(1),t.id,f());if(!l)return;const h=i.getDisplayId();let p=l.next();for(;null!=p;){const e=p.tx,o=-p.ty,r=-p.getAngle();this._writeGlyphs(t,h,e,o,s,r),p=l.next()}}_getShaping(){const o=this._textMeshTransformProps,r=this.evaluatedMeshParams;if(!r.glyphs?.glyphs.length)return null;const i=Math.round(e(o.fontSize)),s=e(o.offsetX),n=e(o.offsetY),h=t(e(r.lineWidth),32,512),p=a*t(r.lineHeightRatio,.25,4);return l(r.glyphs,{scale:i/c,angle:o.postAngle,xOffset:s,yOffset:n,horizontalAlignment:r.horizontalAlignment,verticalAlignment:r.verticalAlignment,maxLineWidth:h,lineHeight:p,decoration:r.decoration,borderLineSizePx:e(r.boxBorderLineSize),hasBackground:!!r.boxBackgroundColor,useCIMAngleBehavior:r.useCIMAngleBehavior})}_writeGlyphs(t,o,r,i,s,n,a){const c=this.evaluatedMeshParams,l=this._textMeshTransformProps,h=l.fontSize,f=e(l.offsetX),m=e(l.offsetY);0!==n&&s.setRotation(n);const d=s.bounds,u=r+d.x+f,g=i+d.y-m,x=2*(c.minPixelBuffer?c.minPixelBuffer/h:1),y=Math.max(d.width,d.height)*x;s.textBox&&(t.recordStart(this.instanceId,this.attributeLayout,s.glyphs[0].textureBinding),t.recordBounds(u,g,y,y),this._writeTextBox(t,o,r,i,s.textBox,a),t.recordEnd());for(const e of s.glyphs){t.recordStart(this.instanceId,this.attributeLayout,e.textureBinding),t.recordBounds(u,g,y,y);const{texcoords:s,offsets:n}=e;this._writeQuad(t,o,r,i,{texcoords:s,offsets:n,fontSize:h,color:p(c.color),isBackground:!1,referenceBounds:a}),t.recordEnd()}0!==n&&s.setRotation(-n)}_writeTextBox(t,e,o,r,i,s,n){const a=this.evaluatedMeshParams,{fontSize:c}=this._textMeshTransformProps,{boxBackgroundColor:l,boxBorderLineColor:h}=a,f={isBackground:!0,fontSize:c,referenceBounds:s,...n};l&&(this._writeQuad(t,e,o,r,{texcoords:P,offsets:i.main,color:p(l),...f}),h||(this._writeQuad(t,e,o,r,{texcoords:B,offsets:i.top,color:p(l),...f}),this._writeQuad(t,e,o,r,{texcoords:R,offsets:i.bot,color:p(l),...f}),this._writeQuad(t,e,o,r,{texcoords:w,offsets:i.left,color:p(l),...f}),this._writeQuad(t,e,o,r,{texcoords:M,offsets:i.right,color:p(l),...f}))),h&&(this._writeQuad(t,e,o,r,{texcoords:b,offsets:i.top,color:p(h),...f}),this._writeQuad(t,e,o,r,{texcoords:b,offsets:i.bot,color:p(h),...f}),this._writeQuad(t,e,o,r,{texcoords:T,offsets:i.left,color:p(h),...f}),this._writeQuad(t,e,o,r,{texcoords:T,offsets:i.right,color:p(h),...f}))}_writeQuad(t,e,o,r,i){const s=t.vertexCount();this._writeVertex(t,e,o,r,i),t.indexWrite(s+0),t.indexWrite(s+1),t.indexWrite(s+2),t.indexWrite(s+1),t.indexWrite(s+3),t.indexWrite(s+2)}}const E=t=>Math.round(t*(254/360));export{L as TextMeshWriter,z as TextVertexSpec};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t,a as e}from"../../../../../../../chunks/tslib.es6.js";import{minMaxZoomPrecisionFactor as i,labelPlacementOffsetPadding as o}from"../../../definitions.js";import{location as s,option as a,uniform as r,define as l,ComputeVertexInput as p,input as n}from"../../GraphShaderModule.js";import{abs as d,min as u,Float as m,floor as y,step as c,max as h,Vec3 as v,Mat3 as f,Vec4 as b,texture2D as V,smoothstep as w,Int as x,bitRShift as g,bitAnd as S,Vec2 as z,Bool as j}from"../../graph/glsl.js";import{FeatureVertexInput as M,FeatureFragmentInput as R,AFeatureShader as C}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as O,sdfFontSize as P,bitsetTextIsLineLabel as U,bitsetTextIsMapAligned as A,maxSdfDistance as L}from"../shaders/constants.js";import{distPointTriangle as _}from"../shaders/hittestUtils.js";import{MosaicInfo as k}from"../shaders/MosaicInfo.js";import{getBit as N}from"../shaders/utils.js";import{VisualVariableColor as H}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as I}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as D}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as F}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as B}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as E}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as W}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as q,getVisualVariableRotation as G}from"../shaders/vvUtils.js";const Z=360/254;class J extends M{}t([s(3,b)],J.prototype,"color",void 0),t([s(4,z)],J.prototype,"offset",void 0),t([s(5,z)],J.prototype,"textureUV",void 0),t([s(6,m)],J.prototype,"fontSize",void 0),t([s(7,m)],J.prototype,"referenceSize",void 0),t([s(8,m)],J.prototype,"haloFontSize",void 0),t([s(9,b)],J.prototype,"haloColor",void 0),t([s(10,z)],J.prototype,"zoomRange",void 0),t([s(11,m)],J.prototype,"clipAngle",void 0),t([s(12,b)],J.prototype,"referenceSymbol",void 0);class K extends p{}t([s(13,z)],K.prototype,"offsetNextVertex1",void 0),t([s(14,z)],K.prototype,"offsetNextVertex2",void 0);class Q extends R{}class T extends C{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.isHaloPass=!1,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(t,e,o){const s=e.multiply(Z),a=d(this.view.rotation.subtract(s)),r=u(new m(360).subtract(a),a);let l=new m(0);const p=y(this.view.currentZoom.multiply(i)).divide(i),n=t.x,h=t.y,v=new m(1).subtract(c(n,p)).multiply(2),f=c(new m(90),r).multiply(2),b=new m(2).multiply(new m(1).subtract(c(p,h)));return l=l.add(o.multiply(v)),l=l.add(o.multiply(f)),l=l.add(b),l}vertex(t,e){const i=N(t.bitset,O),s=new m(1).subtract(i);let a=t.fontSize,r=a.divide(P);const l=this.isHaloPass?t.haloColor:this._getVertexColor(t),p=N(t.bitset,U),n=this.isLabel?l.multiply(h(this.storage.getAnimationValue(t.id),p)):l,d=this.view.displayViewScreenMat3.multiply(new v(t.pos,1));let u=t.offset,y=new m(1),c=f.identity();if(this.isLabel){if(!t.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const e=t.referenceSymbol,i=e.xy,s=e.z,a=this._unpackDirection(e.w),r=q(this,t.id,s).divide(2),l=a.multiply(r.add(o));u=u.add(i).add(l)}else{y=q(this,t.id,t.referenceSize).divide(t.referenceSize),a=a.multiply(y),r=r.multiply(y),u=u.multiply(y),c=G(this,t.id),u=c.multiply(new v(u,0)).xy}const V=N(t.bitset,A),w=this._getViewRotationMatrix(V).multiply(new v(u,0));let x=this.isLabel?this.clipLabel(t.zoomRange,t.clipAngle,V):this.clip(t.id,t.zoomRange);x=this.isBackgroundPass?x.add(s.multiply(2)):x.add(i.multiply(2));const g=new b(d.xy.add(w.xy),x,1),S=t.textureUV.divide(this.mosaicInfo.size);let z=new m(0);if(this.isHaloPass){z=t.haloFontSize.divide(r).divide(L)}return{glPosition:g,color:n,size:r,textureUV:S,antialiasingWidth:new m(.105*P).divide(a).divide(this.view.pixelRatio),haloDistanceOffset:z,...this.maybeRunHittest(t,e,{vvSizeAdjustment:y,vvRotation:c})}}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new m(1).subtract(t);return e.multiply(t).add(i.multiply(o))}fragment(t){const e=new m(2/8),i=new m(1).subtract(e),o=V(this.mosaicInfo.texture,t.textureUV).a;let s=i.subtract(t.haloDistanceOffset);this.highlight&&(s=s.divide(2));const a=t.antialiasingWidth,r=w(s.subtract(a),s.add(a),o);return this.getFragmentOutput(t.color.multiply(r),t)}hittest(t,e,{vvSizeAdjustment:i,vvRotation:o}){const s=o.multiply(new v(t.offset.multiply(i),0)),a=o.multiply(new v(e.offsetNextVertex1.multiply(i),0)),r=o.multiply(new v(e.offsetNextVertex2.multiply(i),0)),{viewMat3:l,tileMat3:p}=this.view,n=l.multiply(p).multiply(new v(t.pos,1)),d=n.add(p.multiply(s)).xy,u=n.add(p.multiply(a)).xy,m=n.add(p.multiply(r)).xy;return _(this.hittestRequest.position,d.xy,u.xy,m.xy)}_unpackDirection(t){const e=new x(t),i=g(e,new x(2)),o=S(e,new x(3));return new z(new m(i).subtract(1),new m(o).subtract(1))}_getVertexColor(t){let e=t.color;if(this.visualVariableColor){const i=this.storage.getColorValue(t.id);e=this.visualVariableColor.getColor(i,t.color,new j(!1))}if(this.visualVariableOpacity){const i=this.storage.getOpacityValue(t.id),o=this.visualVariableOpacity.getOpacity(i);e=e.multiply(o)}return e}}t([a(H)],T.prototype,"visualVariableColor",void 0),t([a(I)],T.prototype,"visualVariableOpacity",void 0),t([a(D)],T.prototype,"visualVariableRotation",void 0),t([a(F)],T.prototype,"visualVariableSizeMinMaxValue",void 0),t([a(B)],T.prototype,"visualVariableSizeScaleStops",void 0),t([a(E)],T.prototype,"visualVariableSizeStops",void 0),t([a(W)],T.prototype,"visualVariableSizeUnitValue",void 0),t([r(k)],T.prototype,"mosaicInfo",void 0),t([l],T.prototype,"isHaloPass",void 0),t([l],T.prototype,"isBackgroundPass",void 0),t([l],T.prototype,"isLabel",void 0),t([e(0,n(J)),e(1,n(K))],T.prototype,"vertex",null),t([e(0,n(Q))],T.prototype,"fragment",null);export{Q as TextFragmentInput,T as TextShader,J as TextVertexInput};
5
+ import{_ as t,a as e}from"../../../../../../../chunks/tslib.es6.js";import{minMaxZoomPrecisionFactor as i,labelPlacementOffsetPadding as o}from"../../../definitions.js";import{location as s,option as a,uniform as r,define as l,ComputeVertexInput as p,input as n}from"../../GraphShaderModule.js";import{abs as d,min as u,Float as m,floor as y,step as c,Vec3 as h,Mat3 as v,Vec4 as f,texture2D as V,smoothstep as b,Int as w,bitRShift as x,bitAnd as g,Vec2 as S,Bool as z}from"../../graph/glsl.js";import{FeatureVertexInput as j,FeatureFragmentInput as M,AFeatureShader as R}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as C,sdfFontSize as O,bitsetTextIsMapAligned as P,maxSdfDistance as U}from"../shaders/constants.js";import{distPointTriangle as A}from"../shaders/hittestUtils.js";import{MosaicInfo as L}from"../shaders/MosaicInfo.js";import{getBit as _}from"../shaders/utils.js";import{VisualVariableColor as k}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as N}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as H}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as I}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as D}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as F}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as B}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as E,getVisualVariableRotation as W}from"../shaders/vvUtils.js";const q=360/254;class G extends j{}t([s(3,f)],G.prototype,"color",void 0),t([s(4,S)],G.prototype,"offset",void 0),t([s(5,S)],G.prototype,"textureUV",void 0),t([s(6,m)],G.prototype,"fontSize",void 0),t([s(7,m)],G.prototype,"referenceSize",void 0),t([s(8,m)],G.prototype,"haloFontSize",void 0),t([s(9,f)],G.prototype,"haloColor",void 0),t([s(10,S)],G.prototype,"zoomRange",void 0),t([s(11,m)],G.prototype,"clipAngle",void 0),t([s(12,f)],G.prototype,"referenceSymbol",void 0);class Z extends p{}t([s(13,S)],Z.prototype,"offsetNextVertex1",void 0),t([s(14,S)],Z.prototype,"offsetNextVertex2",void 0);class J extends M{}class K extends R{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.isHaloPass=!1,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(t,e,o){const s=e.multiply(q),a=d(this.view.rotation.subtract(s)),r=u(new m(360).subtract(a),a);let l=new m(0);const p=y(this.view.currentZoom.multiply(i)).divide(i),n=t.x,h=t.y,v=new m(1).subtract(c(n,p)).multiply(2),f=c(new m(90),r).multiply(2),V=new m(2).multiply(new m(1).subtract(c(p,h)));return l=l.add(o.multiply(v)),l=l.add(o.multiply(f)),l=l.add(V),l}vertex(t,e){const i=_(t.bitset,C),s=new m(1).subtract(i);let a=t.fontSize,r=a.divide(O);const l=this.isHaloPass?t.haloColor:this._getVertexColor(t),p=this.isLabel?l.multiply(this.storage.getAnimationValue(t.id)):l,n=this.view.displayViewScreenMat3.multiply(new h(t.pos,1));let d=t.offset,u=new m(1),y=v.identity();if(this.isLabel){if(!t.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const e=t.referenceSymbol,i=e.xy,s=e.z,a=this._unpackDirection(e.w),r=E(this,t.id,s).divide(2),l=a.multiply(r.add(o));d=d.add(i).add(l)}else{u=E(this,t.id,t.referenceSize).divide(t.referenceSize),a=a.multiply(u),r=r.multiply(u),d=d.multiply(u),y=W(this,t.id),d=y.multiply(new h(d,0)).xy}const c=_(t.bitset,P),V=this._getViewRotationMatrix(c).multiply(new h(d,0));let b=this.isLabel?this.clipLabel(t.zoomRange,t.clipAngle,c):this.clip(t.id,t.zoomRange);b=this.isBackgroundPass?b.add(s.multiply(2)):b.add(i.multiply(2));const w=new f(n.xy.add(V.xy),b,1),x=t.textureUV.divide(this.mosaicInfo.size);let g=new m(0);if(this.isHaloPass){g=t.haloFontSize.divide(r).divide(U)}return{glPosition:w,color:p,size:r,textureUV:x,antialiasingWidth:new m(.105*O).divide(a).divide(this.view.pixelRatio),haloDistanceOffset:g,...this.maybeRunHittest(t,e,{vvSizeAdjustment:u,vvRotation:y})}}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new m(1).subtract(t);return e.multiply(t).add(i.multiply(o))}fragment(t){const e=new m(2/8),i=new m(1).subtract(e),o=V(this.mosaicInfo.texture,t.textureUV).a;let s=i.subtract(t.haloDistanceOffset);this.highlight&&(s=s.divide(2));const a=t.antialiasingWidth,r=b(s.subtract(a),s.add(a),o);return this.getFragmentOutput(t.color.multiply(r),t)}hittest(t,e,{vvSizeAdjustment:i,vvRotation:o}){const s=o.multiply(new h(t.offset.multiply(i),0)),a=o.multiply(new h(e.offsetNextVertex1.multiply(i),0)),r=o.multiply(new h(e.offsetNextVertex2.multiply(i),0)),{viewMat3:l,tileMat3:p}=this.view,n=l.multiply(p).multiply(new h(t.pos,1)),d=n.add(p.multiply(s)).xy,u=n.add(p.multiply(a)).xy,m=n.add(p.multiply(r)).xy;return A(this.hittestRequest.position,d.xy,u.xy,m.xy)}_unpackDirection(t){const e=new w(t),i=x(e,new w(2)),o=g(e,new w(3));return new S(new m(i).subtract(1),new m(o).subtract(1))}_getVertexColor(t){let e=t.color;if(this.visualVariableColor){const i=this.storage.getColorValue(t.id);e=this.visualVariableColor.getColor(i,t.color,new z(!1))}if(this.visualVariableOpacity){const i=this.storage.getOpacityValue(t.id),o=this.visualVariableOpacity.getOpacity(i);e=e.multiply(o)}return e}}t([a(k)],K.prototype,"visualVariableColor",void 0),t([a(N)],K.prototype,"visualVariableOpacity",void 0),t([a(H)],K.prototype,"visualVariableRotation",void 0),t([a(I)],K.prototype,"visualVariableSizeMinMaxValue",void 0),t([a(D)],K.prototype,"visualVariableSizeScaleStops",void 0),t([a(F)],K.prototype,"visualVariableSizeStops",void 0),t([a(B)],K.prototype,"visualVariableSizeUnitValue",void 0),t([r(L)],K.prototype,"mosaicInfo",void 0),t([l],K.prototype,"isHaloPass",void 0),t([l],K.prototype,"isBackgroundPass",void 0),t([l],K.prototype,"isLabel",void 0),t([e(0,n(G)),e(1,n(Z))],K.prototype,"vertex",null),t([e(0,n(J))],K.prototype,"fragment",null);export{J as TextFragmentInput,K as TextShader,G as TextVertexInput};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import{getGeohashBounds as e}from"../../../../../geohash/geohashUtils.js";import{unquantizeOptimizedGeometry as t,convertToFeature as s}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as r}from"../../../../../layers/graphics/OptimizedFeature.js";import{ComputedAggregateField as a}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as o}from"./AAggregateStrategy.js";import{ASendState as i}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as n}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as l}from"../support/ComputedAttributeStorage.js";import d from"../support/FeatureFilter.js";import{FeatureMetadata as c}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as u}from"../support/FeatureSetReaderJSON.js";import f from"../../../tiling/TileKey.js";class p extends i{constructor(e,t){super(e),this.bins=new Map,this.done=!1,this._store=t}reset(){this.destroy(),this.bins.clear(),this.done=!1,this.handledChunks.clear()}destroy(){for(const e of this.bins.values()){const t=e.cachedFeature?.objectId;null!=t&&this._store.releaseDisplayIdForObjectId(t)}}*featuresWorldSpace(){for(const e of this.bins.values()){const s=e.cachedFeature;if(s){const e=s.clone();t(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}}getGeohashBounds(t,s){const r=this.subscription.tile;return e(r.extent,r.resolution,s,t)}}class h extends o{static async create(e,t,s,r){const o=new l({spatialReference:t}),i=e.fixedBinLevel,n=await Promise.all(e.fields.map((async e=>a.create(o,e)))),c=e.featureFilter?await d.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return new h({fields:n,geohashLevel:i,spatialReference:t,featureFilter:c},s,r)}constructor(e,t,s){super(t,s,e.spatialReference,e.fields),this._indexOptions=e,this._metadata=new c({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fields:this._indexOptions.fields,globalIdField:null,spatialReference:t.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new p(e,this._attributeStore)}async*applyOverride(e){for(const t of this._sendStates.values())t.reset()}displayMap(e,t,s){const r=new Map(e.map((e=>[t(e),e]))),a=[];for(const o of this._sendStates.values())for(const e of o.featuresWorldSpace()){const{objectId:t,displayId:o}=e,i=r.get(t);if(null!=i){const e=s(o,i,t);a.push(e),r.delete(t)}}return a}getDisplayFeatures(e){const t=new Set(e),r=new Set,a=[];for(const o of this._sendStates.values())for(const e of o.featuresWorldSpace())t.has(e.displayId)&&!r.has(e.objectId)&&(e.geometry&&a.push({...s(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),r.add(e.objectId));return{features:[],aggregates:a}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.objectIds);return[]}async*updateChunks(){if(this._source.chunks().length)for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){for(const t of this._sendStates.values())for(const s of t.featuresWorldSpace())e(s)}async*_update(e,t){const{handledChunks:s,subscription:a,bins:o}=e,{spatialReference:i,geohashLevel:l}=this._indexOptions,d=a.tile;if(e.done)return;for(const r of t.chunks()){if(s.has(r))continue;s.add(r);const t=r.queryInfo;if("tileId"in t){const e=new f(t.tileId);if(e.level!==d.level||e.world!==d.key.world)continue}const a=r.getGeohashIndex(this._indexOptions),n=e.getGeohashBounds(i,l);a.putBins(o,n)}const c=[],p=a.tile.transform;for(const n of o.values()){if(n.cachedFeature)n.cachedFeature.attributes=n.getAttributes();else{const e=n.getGeometry(this.spatialReference,p),t=new r(e,n.getAttributes(),null);e||(t.centroid=n.getGeometryCentroid(this.spatialReference,p)),t.objectId=n.id,t.displayId=this._attributeStore.createDisplayIdForObjectId(n.id),n.cachedFeature=t}c.push(n.cachedFeature)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const h=u.fromOptimizedFeatures(c,this._metadata,p),g=h.getCursor(),m=e.subscription.tile.arcadeEvaluationOptions;for(;g.next();)this._attributeStore.setAttributeData(g.getDisplayId(),g,m);const y=new n(e.subscription,h,!0,e.done,{});yield y}}export{p as BinningState,h as BinningStrategy};
5
+ import{getGeohashBounds as e}from"../../../../../geohash/geohashUtils.js";import{unquantizeOptimizedGeometry as t,convertToFeature as s}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as r}from"../../../../../layers/graphics/OptimizedFeature.js";import{ComputedAggregateField as a}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as o}from"./AAggregateStrategy.js";import{ASendState as i}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as n}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as l}from"../support/ComputedAttributeStorage.js";import d from"../support/FeatureFilter.js";import{FeatureMetadata as c}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as u}from"../support/FeatureSetReaderJSON.js";import f from"../../../tiling/TileKey.js";class p extends i{constructor(e,t){super(e),this.bins=new Map,this.done=!1,this._store=t}reset(){this.destroy(),this.bins.clear(),this.done=!1,this.handledChunks.clear()}destroy(){for(const e of this.bins.values()){const t=e.cachedFeature?.objectId;null!=t&&this._store.releaseDisplayIdForObjectId(t)}}*featuresWorldSpace(){for(const e of this.bins.values()){const s=e.cachedFeature;if(s){const e=s.clone();t(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}}getGeohashBounds(t,s){const r=this.subscription.tile;return e(r.extent,r.resolution,s,t)}}class h extends o{static async create(e,t,s,r){const o=new l({spatialReference:t}),i=e.fixedBinLevel,n=await Promise.all(e.fields.map((async e=>a.create(o,e)))),c=e.featureFilter?await d.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return new h({fields:n,geohashLevel:i,spatialReference:t,featureFilter:c},s,r)}constructor(e,t,s){super(t,s,e.spatialReference,e.fields),this._indexOptions=e,this._metadata=new c({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fields:this._indexOptions.fields,globalIdField:null,spatialReference:t.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new p(e,this._attributeStore)}async*applyOverride(e){for(const t of this._sendStates.values())t.reset()}displayMap(e,t,s){const r=new Map(e.map((e=>[t(e),e]))),a=[];for(const o of this._sendStates.values())for(const e of o.featuresWorldSpace()){const{objectId:t,displayId:o}=e,i=r.get(t);if(null!=i){const e=s(o,i,t);a.push(e),r.delete(t)}}return a}getDisplayFeatures(e){const t=new Set(e),r=new Set,a=[];for(const o of this._sendStates.values())for(const e of o.featuresWorldSpace())t.has(e.displayId)&&!r.has(e.objectId)&&(e.geometry&&a.push({...s(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),r.add(e.objectId));return{features:[],aggregates:a}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.objectIds);return[]}async*updateChunks(){if(this._source.chunks().length)for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){for(const t of this._sendStates.values())for(const s of t.featuresWorldSpace())e(s)}async*_update(e,t){const{handledChunks:s,subscription:a,bins:o}=e,{spatialReference:i,geohashLevel:l}=this._indexOptions,d=a.tile;if(e.done)return;for(const r of t.chunks()){if(s.has(r))continue;s.add(r);const t=r.queryInfo;if("tileId"in t){const e=new f(t.tileId);if(e.level!==d.level||e.world!==d.key.world)continue}const a=r.getGeohashIndex(this._indexOptions),n=e.getGeohashBounds(i,l);a.putBins(o,n)}const c=[],p=a.tile.transform;for(const n of o.values()){if(n.cachedFeature)n.cachedFeature.attributes=n.getAttributes();else{const e=n.getGeometry(this.spatialReference,p),t=new r(e,n.getAttributes(),null);e||(t.centroid=n.getGeometryCentroid(this.spatialReference,p)),t.objectId=n.id,t.displayId=this._attributeStore.createDisplayIdForObjectId(n.id),n.cachedFeature=t}c.push(n.cachedFeature)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const h=u.fromOptimizedFeatures(c,this._metadata,p),g=h.getCursor(),m=e.subscription.tile.arcadeEvaluationOptions;for(;g.next();)this._attributeStore.setAttributeData(g.getDisplayId(),g,m);const y=new n(e.subscription,h,[],e.done,{});yield y}}export{p as BinningState,h as BinningStrategy};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../../../symbols.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{generateGradient as a}from"../../../../../../../renderers/support/heatmapUtils.js";import{CIMSymbolHelper as l,slsDashToTemplateArray as i,capTypeToEnum as r}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{ExtremityPlacement as t}from"../../../../../../../symbols/cim/enums.js";import{getSDFInfo as o}from"../../../../../../../symbols/cim/SDFHelper.js";import{getAlignmentFromPlacement as s}from"../../../../../engine/webgl/alignmentUtils.js";import{writeColor as n}from"../../../../../engine/webgl/color.js";import{dotDensityMaxFields as u}from"../../../../../engine/webgl/definitions.js";import{Techniques as c}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{premultiplyColor as p}from"../schemaUtils.js";import{createVisualVariableUniforms as f,getMaxSizeVVSize as m,noVisualVariables as b}from"../VisualVariablesSchema.js";import{createComplexSymbolInstances as S,hasSizeVVUniform as V}from"./ComplexSymbolSchema.js";import y from"../../../../../../../symbols/SimpleFillSymbol.js";async function v(e,a){if(!e)return[];switch(e.type){case"simple-fill":return R(e,a);case"picture-fill":return k(e,a);case"simple-marker":return x(e,a);case"picture-marker":return M(e,a);case"simple-line":return U(e,a,!1);case"text":return I(e,a);case"label":return O(e,a);case"cim":return S(e.data,a);case"web-style":{const l=await e.fetchCIMSymbol();return S(l.data,a)}default:throw new Error(`symbol not supported ${e.type}`)}}async function h(e,a){const{schemaOptions:l}=a,{store:i}=l,r=new Array(u),t=new Array(u/4);for(let c=0;c<u;c++){const a=c<e.attributes.length?e.attributes[c].color:null;r[c]=[0,0,0,0],n(r[c],a)}for(let n=0;n<u/4;n++)t[n]=[0,0,0,0],t[n][0]=4*n<e.attributes.length?1:0,t[n][1]=4*n+1<e.attributes.length?1:0,t[n][2]=4*n+2<e.attributes.length?1:0,t[n][3]=4*n+3<e.attributes.length?1:0;const o={isActive:t,colors:r,dotValue:e.dotValue,dotScale:e.referenceScale,blending:e.dotBlendingEnabled,dotSize:e.dotSize,seed:e.seed},s=i.ensureInstance(c.dotDensity,o,{}).createMeshInfo({params:{effects:null}}),p=[];if(e.backgroundColor){const l=new y({color:e.backgroundColor,outline:null}),i=await v(l,a);p.push(...i)}if(p.push(s),e.outline){const l=U(e.outline,a,!0);p.push(...l)}return p}async function z(l,i){const{store:r}=i,{radius:t,minDensity:o,maxDensity:s,referenceScale:n,field:u,valueExpression:p,colorStops:f}=l,m=a(f);return[r.ensureInstance(c.heatmap,{radius:e(t),minDensity:o,maxDensity:s,referenceScale:n,isFieldActive:!(!u&&!p),gradient:m,gradientHash:m.join(",")},{}).createMeshInfo({params:{effects:null}})]}function d(a,l){const{store:i}=l,r=a.outline?.width||1,t=f(a),o=i.ensureInstance(c.pieChart,{geometry:{outlineWidth:Math.round(e(r)),defaultColor:p(a.defaultColor),outlineColor:p(a.outline?.color),othersColor:p(a.othersCategory?.color),donutRatio:a.holePercentage,sectorThreshold:a.othersCategory?.threshold||0,colors:a.attributes.map((e=>p(e.color))),visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:a.attributes.length},{}).createMeshInfo({params:{size:a.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:m(t)}});return[...a.backgroundFillSymbol?R(a.backgroundFillSymbol,{schemaOptions:l,path:"",uniforms:b}):[],o]}function g(e){if("path"===e.style){if(null==e.path)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const a=l.fromSimpleMarker(e);if("outline"in e&&e.outline&&"none"!==e.outline.style){if("solid"!==e.outline.style){if(!a||!a.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:a.symbolLayers[0],overrides:[]}}}return{type:"sprite-rasterization-param",resource:o(a),overrides:[]}}async function x(e,a){const{uniforms:i,schemaOptions:r}=a,{store:t}=r;if("path"===e.style||e.outline&&"solid"!==e.outline.style&&"none"!==e.outline.style){const i=l.fromSimpleMarker(e);if(!i||!i.symbolLayers)throw new Error("Error handling marker! ");if("path"!==e.style){const e=i.symbolLayers[0];if(V(a.uniforms)){const l=m(a.uniforms,0,1);if(l>e.size){const a=l/e.size;e.size=l;const i=e.markerGraphics?.[0].symbol;(i.symbolLayers&&i.symbolLayers[0]).width*=a}}}return S({type:"CIMSymbolReference",symbol:i},a)}const o=t.ensureInstance(c.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),s=g(e);let n=e.color?.toArray()??[0,0,0,0];"CIMVectorMarker"===s.resource.type&&(n=[255,255,255,255]);const u="triangle"===e.style?124/116:1,p=e.size,f=p*u,b=null!=i.visualVariableColor&&("cross"===e.style||"x"===e.style);return[o.createMeshInfo({params:{type:"simple",color:n,height:p,width:f,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:p,sprite:s,overrideOutlineColor:b,hasSizeVV:V(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:m(i)}})]}function M(e,a){const{uniforms:i,schemaOptions:r}=a,{store:t}=r,o=t.ensureInstance(c.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),s=l.createPictureMarkerRasterizationParam(e);if(!s)return[];return[o.createMeshInfo({params:{type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:s,overrideOutlineColor:!1,hasSizeVV:V(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:m(i)}})]}function C(e,a,l){const{uniforms:i,schemaOptions:r}=l,{store:o}=r,s=o.ensureInstance(c.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),n=g(e),u=6,p=u*a.width,f=p,b=e.color?.toArray()??a.color?.toArray()??[0,0,0,0],S="cross"===e.style||"x"===e.style;let y;switch(e.placement){case"begin-end":y=t.Both;break;case"begin":y=t.JustBegin;break;case"end":y=t.JustEnd;break;default:y=t.None}const v={type:"cim-marker-placement-info",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:y,offsetAlongLine:0},overrides:[]};return[s.createMeshInfo({params:{type:"simple",color:b,height:f,width:p,offsetX:0,offsetY:0,angle:0,outlineColor:b,outlineSize:S?a.width:0,referenceSize:f/u,sprite:n,overrideOutlineColor:S&&null!=i.visualVariableColor,hasSizeVV:V(i),placement:v,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:m(i)}})]}function I(e,a){const{uniforms:i,schemaOptions:r}=a,{store:t}=r;return[t.ensureInstance(c.text,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableRotation:i.visualVariableRotation,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue}},{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}).createMeshInfo({params:{boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloFontSize:e.haloSize??0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:l.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:m(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}function O(a,i){const{schemaOptions:r,uniforms:t}=i,{store:o}=r,n=a.symbol,{allowOverrun:u,repeatLabel:p,repeatLabelDistance:f}=a,b={maxScale:a.maxScale??0,minScale:a.minScale??0},S=o.ensureInstance(c.label,{geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue}},{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}),V=a.labelPlacement,[y,v]=s(V);return[S.createMeshInfo({params:{boxBackgroundColor:n.backgroundColor?.toArray(),boxBorderLineColor:n.borderLineColor?.toArray(),boxBorderLineSize:n.borderLineSize??0,color:n.color?.toArray()??[0,0,0,0],offsetX:n.xoffset,offsetY:n.yoffset,postAngle:n.angle,fontSize:n.font.size,decoration:n.font.decoration,haloColor:n.haloColor?.toArray()??[0,0,0,0],haloFontSize:n.haloSize??0,lineWidth:n.lineWidth,lineHeightRatio:n.lineHeight,horizontalAlignment:y,verticalAlignment:v,repeatLabel:p,repeatLabelDistance:e(f),allowOverrun:u,labelPosition:a.labelPosition,scaleInfo:b,minPixelBuffer:m(t),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:n.font.toJSON(),textString:n.text,symbol:l.createCIMTextSymbolfromTextSymbol(n),primitiveName:"label-override"},useLegacyLabelEvaluationRules:null==a.labelExpressionInfo?.expression,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:a.labelExpressionInfo?.expression??a.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,isLineLabel:!1}})]}function w(e,a){const l=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:l,referenceWidth:l,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:a}}function A(e,a){const{uniforms:l,schemaOptions:i}=a,{store:r}=i,t=e.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if("solid"===e.outline?.style){return[r.ensureInstance(c.patternOutlineFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:t,...w(e.outline,!!l.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null}})]}const s=[],n=r.ensureInstance(c.patternFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:e.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null}});return s.push(n),e.outline&&s.push(...U(e.outline,a,!0)),s}function L(e,a){const{uniforms:l,schemaOptions:i}=a,{store:r}=i,t=e.color?.toArray()??[0,0,0,0];if("none"!==e.style&&"solid"===e.outline?.style){return[r.ensureInstance(c.outlineFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:t,...w(e.outline,!!l.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null}})]}const o=[];if("none"!==e.style){const e=r.ensureInstance(c.fill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:t,scaleInfo:null,effects:null}});o.push(e)}return e.outline&&o.push(...U(e.outline,a,!0)),o}function R(e,a){const{style:l}=e;return l&&"none"!==l&&"solid"!==l?A(e,a):L(e,a)}function k(e,a){const{outline:i}=e,{uniforms:r,schemaOptions:t}=a,{store:o}=t,s=[],n=l.createPictureFillRasterizationParam(e);if(!n)return[];const{width:u,height:p,xoffset:f,yoffset:m,xscale:b,yscale:S}=e,V={color:[255,255,255,255],sprite:n,height:p,aspectRatio:u/p,offsetX:f,offsetY:m,scaleX:b,scaleY:S,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if("solid"===i?.style){return[o.ensureInstance(c.complexOutlineFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{...V,...w(i,!!r.visualVariableSizeOutlineScaleStops)}})]}const y=o.ensureInstance(c.complexFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!1});return s.push(y.createMeshInfo({params:V})),i&&s.push(...U(i,a,!0)),s}function U(e,a,l){const{color:t,style:o,width:s,cap:n,join:u}=e,{schemaOptions:p}=a,{store:f}=p,m=[],S=l?{...b,visualVariableSizeScaleStops:a.uniforms.visualVariableSizeOutlineScaleStops}:a.uniforms,y={geometry:{visualVariableColor:S.visualVariableColor,visualVariableOpacity:S.visualVariableOpacity,visualVariableSizeMinMaxValue:S.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:S.visualVariableSizeScaleStops,visualVariableSizeStops:S.visualVariableSizeStops,visualVariableSizeUnitValue:S.visualVariableSizeUnitValue}},v={color:t?.toArray()??[0,0,0,0],width:s,referenceWidth:s,capType:n,joinType:u,miterLimit:e.miterLimit,hasSizeVV:V(S),effects:null,scaleInfo:null};if(null==o||"solid"===o){const e=f.ensureInstance(c.line,y,{zoomRange:!1}).createMeshInfo({params:v});m.push(e)}else if("none"!==o){const e=f.ensureInstance(c.texturedLine,y,{zoomRange:!1}).createMeshInfo({params:{...v,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:i(o,n),capStyle:r(n)},overrides:[]}}});m.push(e)}return null!=e.marker&&m.push(...C(e.marker,e,a)),m}export{h as createDotDensityMeshSchemas,z as createHeatmapMeshSchemas,U as createLineInstance,d as createPieChartMeshSchemas,v as createSymbolMeshSchemas};
5
+ import"../../../../../../../symbols.js";import{pt2px as e}from"../../../../../../../core/screenUtils.js";import{generateGradient as a}from"../../../../../../../renderers/support/heatmapUtils.js";import{CIMSymbolHelper as l,slsDashToTemplateArray as i,capTypeToEnum as r}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{ExtremityPlacement as t}from"../../../../../../../symbols/cim/enums.js";import{getSDFInfo as o}from"../../../../../../../symbols/cim/SDFHelper.js";import{getAlignmentFromPlacement as s}from"../../../../../engine/webgl/alignmentUtils.js";import{writeColor as n}from"../../../../../engine/webgl/color.js";import{dotDensityMaxFields as u}from"../../../../../engine/webgl/definitions.js";import{Techniques as c}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{premultiplyColor as p}from"../schemaUtils.js";import{createVisualVariableUniforms as f,getMaxSizeVVSize as m,noVisualVariables as b}from"../VisualVariablesSchema.js";import{createComplexSymbolInstances as S,hasSizeVVUniform as V}from"./ComplexSymbolSchema.js";import y from"../../../../../../../symbols/SimpleFillSymbol.js";async function v(e,a){if(!e)return[];switch(e.type){case"simple-fill":return R(e,a);case"picture-fill":return k(e,a);case"simple-marker":return x(e,a);case"picture-marker":return M(e,a);case"simple-line":return U(e,a,!1);case"text":return I(e,a);case"label":return O(e,a);case"cim":return S(e.data,a);case"web-style":{const l=await e.fetchCIMSymbol();return S(l.data,a)}default:throw new Error(`symbol not supported ${e.type}`)}}async function h(e,a){const{schemaOptions:l}=a,{store:i}=l,r=new Array(u),t=new Array(u/4);for(let c=0;c<u;c++){const a=c<e.attributes.length?e.attributes[c].color:null;r[c]=[0,0,0,0],n(r[c],a)}for(let n=0;n<u/4;n++)t[n]=[0,0,0,0],t[n][0]=4*n<e.attributes.length?1:0,t[n][1]=4*n+1<e.attributes.length?1:0,t[n][2]=4*n+2<e.attributes.length?1:0,t[n][3]=4*n+3<e.attributes.length?1:0;const o={isActive:t,colors:r,dotValue:e.dotValue,dotScale:e.referenceScale,blending:e.dotBlendingEnabled,dotSize:e.dotSize,seed:e.seed},s=i.ensureInstance(c.dotDensity,o,{}).createMeshInfo({params:{effects:null}}),p=[];if(e.backgroundColor){const l=new y({color:e.backgroundColor,outline:null}),i=await v(l,a);p.push(...i)}if(p.push(s),e.outline){const l=U(e.outline,a,!0);p.push(...l)}return p}async function z(l,i){const{store:r}=i,{radius:t,minDensity:o,maxDensity:s,referenceScale:n,field:u,valueExpression:p,colorStops:f}=l,m=a(f);return[r.ensureInstance(c.heatmap,{radius:e(t),minDensity:o,maxDensity:s,referenceScale:n,isFieldActive:!(!u&&!p),gradient:m,gradientHash:m.join(",")},{}).createMeshInfo({params:{effects:null}})]}function d(a,l){const{store:i}=l,r=a.outline?.width||0,t=f(a),o=i.ensureInstance(c.pieChart,{geometry:{outlineWidth:Math.round(e(r)),defaultColor:p(a.defaultColor),outlineColor:p(a.outline?.color),othersColor:p(a.othersCategory?.color),donutRatio:a.holePercentage,sectorThreshold:a.othersCategory?.threshold||0,colors:a.attributes.map((e=>p(e.color))),visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:a.attributes.length},{}).createMeshInfo({params:{size:a.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:m(t)}});return[...a.backgroundFillSymbol?R(a.backgroundFillSymbol,{schemaOptions:l,path:"",uniforms:b}):[],o]}function g(e){if("path"===e.style){if(null==e.path)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const a=l.fromSimpleMarker(e);if("outline"in e&&e.outline&&"none"!==e.outline.style){if("solid"!==e.outline.style){if(!a||!a.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:a.symbolLayers[0],overrides:[]}}}return{type:"sprite-rasterization-param",resource:o(a),overrides:[]}}async function x(e,a){const{uniforms:i,schemaOptions:r}=a,{store:t}=r;if("path"===e.style||e.outline&&"solid"!==e.outline.style&&"none"!==e.outline.style){const i=l.fromSimpleMarker(e);if(!i||!i.symbolLayers)throw new Error("Error handling marker! ");if("path"!==e.style){const e=i.symbolLayers[0];if(V(a.uniforms)){const l=m(a.uniforms,0,1);if(l>e.size){const a=l/e.size;e.size=l;const i=e.markerGraphics?.[0].symbol;(i.symbolLayers&&i.symbolLayers[0]).width*=a}}}return S({type:"CIMSymbolReference",symbol:i},a)}const o=t.ensureInstance(c.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),s=g(e);let n=e.color?.toArray()??[0,0,0,0];"CIMVectorMarker"===s.resource.type&&(n=[255,255,255,255]);const u="triangle"===e.style?124/116:1,p=e.size,f=p*u,b=null!=i.visualVariableColor&&("cross"===e.style||"x"===e.style);return[o.createMeshInfo({params:{type:"simple",color:n,height:p,width:f,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:p,sprite:s,overrideOutlineColor:b,hasSizeVV:V(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:m(i)}})]}function M(e,a){const{uniforms:i,schemaOptions:r}=a,{store:t}=r,o=t.ensureInstance(c.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),s=l.createPictureMarkerRasterizationParam(e);if(!s)return[];return[o.createMeshInfo({params:{type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:s,overrideOutlineColor:!1,hasSizeVV:V(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:m(i)}})]}function C(e,a,l){const{uniforms:i,schemaOptions:r}=l,{store:o}=r,s=o.ensureInstance(c.marker,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation}},{zoomRange:!1}),n=g(e),u=6,p=u*a.width,f=p,b=e.color?.toArray()??a.color?.toArray()??[0,0,0,0],S="cross"===e.style||"x"===e.style;let y;switch(e.placement){case"begin-end":y=t.Both;break;case"begin":y=t.JustBegin;break;case"end":y=t.JustEnd;break;default:y=t.None}const v={type:"cim-marker-placement-info",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:y,offsetAlongLine:0},overrides:[]};return[s.createMeshInfo({params:{type:"simple",color:b,height:f,width:p,offsetX:0,offsetY:0,angle:0,outlineColor:b,outlineSize:S?a.width:0,referenceSize:f/u,sprite:n,overrideOutlineColor:S&&null!=i.visualVariableColor,hasSizeVV:V(i),placement:v,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:m(i)}})]}function I(e,a){const{uniforms:i,schemaOptions:r}=a,{store:t}=r;return[t.ensureInstance(c.text,{geometry:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableRotation:i.visualVariableRotation,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue}},{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}).createMeshInfo({params:{boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloFontSize:e.haloSize??0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:l.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:m(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}function O(a,i){const{schemaOptions:r,uniforms:t}=i,{store:o}=r,n=a.symbol,{allowOverrun:u,repeatLabel:p,repeatLabelDistance:f}=a,b={maxScale:a.maxScale??0,minScale:a.minScale??0},S=o.ensureInstance(c.label,{geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue}},{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}),V=a.labelPlacement,[y,v]=s(V);return[S.createMeshInfo({params:{boxBackgroundColor:n.backgroundColor?.toArray(),boxBorderLineColor:n.borderLineColor?.toArray(),boxBorderLineSize:n.borderLineSize??0,color:n.color?.toArray()??[0,0,0,0],offsetX:n.xoffset,offsetY:n.yoffset,postAngle:n.angle,fontSize:n.font.size,decoration:n.font.decoration,haloColor:n.haloColor?.toArray()??[0,0,0,0],haloFontSize:n.haloSize??0,lineWidth:n.lineWidth,lineHeightRatio:n.lineHeight,horizontalAlignment:y,verticalAlignment:v,repeatLabel:p,repeatLabelDistance:e(f),allowOverrun:u,labelPosition:a.labelPosition,scaleInfo:b,minPixelBuffer:m(t),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:n.font.toJSON(),textString:n.text,symbol:l.createCIMTextSymbolfromTextSymbol(n),primitiveName:"label-override"},useLegacyLabelEvaluationRules:null==a.labelExpressionInfo?.expression,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:a.labelExpressionInfo?.expression??a.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,isLineLabel:!1}})]}function w(e,a){const l=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:l,referenceWidth:l,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:a}}function A(e,a){const{uniforms:l,schemaOptions:i}=a,{store:r}=i,t=e.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if("solid"===e.outline?.style){return[r.ensureInstance(c.patternOutlineFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:t,...w(e.outline,!!l.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null}})]}const s=[],n=r.ensureInstance(c.patternFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:e.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null}});return s.push(n),e.outline&&s.push(...U(e.outline,a,!0)),s}function L(e,a){const{uniforms:l,schemaOptions:i}=a,{store:r}=i,t=e.color?.toArray()??[0,0,0,0];if("none"!==e.style&&"solid"===e.outline?.style){return[r.ensureInstance(c.outlineFill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity,visualVariableSizeScaleStops:l.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:t,...w(e.outline,!!l.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null}})]}const o=[];if("none"!==e.style){const e=r.ensureInstance(c.fill,{geometry:{visualVariableColor:l.visualVariableColor,visualVariableOpacity:l.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:t,scaleInfo:null,effects:null}});o.push(e)}return e.outline&&o.push(...U(e.outline,a,!0)),o}function R(e,a){const{style:l}=e;return l&&"none"!==l&&"solid"!==l?A(e,a):L(e,a)}function k(e,a){const{outline:i}=e,{uniforms:r,schemaOptions:t}=a,{store:o}=t,s=[],n=l.createPictureFillRasterizationParam(e);if(!n)return[];const{width:u,height:p,xoffset:f,yoffset:m,xscale:b,yscale:S}=e,V={color:[255,255,255,255],sprite:n,height:p,aspectRatio:u/p,offsetX:f,offsetY:m,scaleX:b,scaleY:S,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if("solid"===i?.style){return[o.ensureInstance(c.complexOutlineFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{...V,...w(i,!!r.visualVariableSizeOutlineScaleStops)}})]}const y=o.ensureInstance(c.complexFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!1});return s.push(y.createMeshInfo({params:V})),i&&s.push(...U(i,a,!0)),s}function U(e,a,l){const{color:t,style:o,width:s,cap:n,join:u}=e,{schemaOptions:p}=a,{store:f}=p,m=[],S=l?{...b,visualVariableSizeScaleStops:a.uniforms.visualVariableSizeOutlineScaleStops}:a.uniforms,y={geometry:{visualVariableColor:S.visualVariableColor,visualVariableOpacity:S.visualVariableOpacity,visualVariableSizeMinMaxValue:S.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:S.visualVariableSizeScaleStops,visualVariableSizeStops:S.visualVariableSizeStops,visualVariableSizeUnitValue:S.visualVariableSizeUnitValue}},v={color:t?.toArray()??[0,0,0,0],width:s,referenceWidth:s,capType:n,joinType:u,miterLimit:e.miterLimit,hasSizeVV:V(S),effects:null,scaleInfo:null};if(null==o||"solid"===o){const e=f.ensureInstance(c.line,y,{zoomRange:!1}).createMeshInfo({params:v});m.push(e)}else if("none"!==o){const e=f.ensureInstance(c.texturedLine,y,{zoomRange:!1}).createMeshInfo({params:{...v,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:i(o,n),capStyle:r(n)},overrides:[]}}});m.push(e)}return null!=e.marker&&m.push(...C(e.marker,e,a)),m}export{h as createDotDensityMeshSchemas,z as createHeatmapMeshSchemas,U as createLineInstance,d as createPieChartMeshSchemas,v as createSymbolMeshSchemas};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../geometry.js";import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{convertToGeometry as a,unquantizeOptimizedGeometry as d}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as u}from"../../../../../layers/graphics/OptimizedFeature.js";import l from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as h,unknown as c}from"../../../../../time/timeZoneUtils.js";import{StaticBitSet as m}from"./StaticBitSet.js";import{fromJSON as f}from"../../../../../geometry/support/jsonUtils.js";const y=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],p=y[0],g=y[1],_=y[2],b=y[3],x=has("featurelayer-simplify-payload-size-factors")??[1,2,4],T=x[0],I=x[1],A=x[2],D=has("featurelayer-simplify-mobile-factor")??2,F=has("esri-mobile"),S=4294967295;function B(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class j{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}get isEmpty(){return null!=this._deleted&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=F?D:1;t>4e6?r=A*s:t>1e6?r=I*s:t>5e5?r=T*s:t>1e5&&(r=s);let i=0;return e>4e3?i=b*r:e>2e3?i=_*r:e>100?i=g:e>15&&(i=p),i}parseTimestampOffset(e){return e}getBounds(e){if(B(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===S)return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(!t)return this.setBoundsXMin(S),!1;let r=1/0,s=1/0,i=-1/0,n=-1/0;return t.forEachVertex(((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),n=Math.max(n,t)})),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(n),o(e,r,s,i,n),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),i=this.getBoundsYMax();return o(e,t,r,s,i),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(null==this._objectIdToIndex){const e=new Map,r=this.getCursor();for(;r.next();){const s=r.getObjectId();t(s),e.set(s,r.getIndex())}this._objectIdToIndex=e}const r=this._objectIdToIndex;for(const t of e.values())r.has(t)&&this._removeAtIndex(r.get(t))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new u(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return a(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&d(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&d(r,r,this.hasZ,this.hasM,s),r}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)}geometry(){const e=this.readGeometryWorldSpace(),t=a(e,this.geometryType,this.hasZ,this.hasM),r=f(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??h):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===c}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return null==this._deleted||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?(r[1]*=-1,new l([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return a(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new l([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new l([2],[e-1,t+1,1,-1])}_removeAtIndex(e){null==this._deleted&&(this._deleted=m.create(this.getSize())),this._deleted.set(e)}}export{j as FeatureSetReader};
5
+ import"../../../../../geometry.js";import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{getLabelPoint as n}from"../../../../../geometry/support/labelPoint.js";import{convertToGeometry as a,unquantizeOptimizedGeometry as d}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as u}from"../../../../../layers/graphics/OptimizedFeature.js";import l from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as h,unknown as c}from"../../../../../time/timeZoneUtils.js";import{StaticBitSet as m}from"./StaticBitSet.js";import{fromJSON as f}from"../../../../../geometry/support/jsonUtils.js";const y=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],p=y[0],g=y[1],_=y[2],b=y[3],x=has("featurelayer-simplify-payload-size-factors")??[1,2,4],T=x[0],I=x[1],A=x[2],D=has("featurelayer-simplify-mobile-factor")??2,F=has("esri-mobile"),S=4294967295;function j(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class B{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}get isEmpty(){return null!=this._deleted&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=F?D:1;t>4e6?r=A*s:t>1e6?r=I*s:t>5e5?r=T*s:t>1e5&&(r=s);let i=0;return e>4e3?i=b*r:e>2e3?i=_*r:e>100?i=g:e>15&&(i=p),i}parseTimestampOffset(e){return e}getBounds(e){if(j(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===S)return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(!t)return this.setBoundsXMin(S),!1;let r=1/0,s=1/0,i=-1/0,n=-1/0;return t.forEachVertex(((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),n=Math.max(n,t)})),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(n),o(e,r,s,i,n),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),i=this.getBoundsYMax();return o(e,t,r,s,i),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(null==this._objectIdToIndex){const e=new Map,r=this.getCursor();for(;r.next();){const s=r.getObjectId();t(s),e.set(s,r.getIndex())}this._objectIdToIndex=e}const r=this._objectIdToIndex;for(const t of e.values())r.has(t)&&this._removeAtIndex(r.get(t))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new u(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return a(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&d(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&d(r,r,this.hasZ,this.hasM,s),r}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some((t=>t.hasField(e)))}geometry(){const e=this.readGeometryWorldSpace(),t=a(e,this.geometryType,this.hasZ,this.hasM),r=f(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??h):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===c}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return null==this._deleted||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=n(t);return r?(r[1]*=-1,new l([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return a(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new l([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new l([2],[e-1,t+1,1,-1])}_removeAtIndex(e){null==this._deleted&&(this._deleted=m.create(this.getSize())),this._deleted.set(e)}}export{B as FeatureSetReader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import{set as t,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{c as a,q as i,f as r,l as o,j as n}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as l,c as p}from"../../../../../chunks/boundedPlane.js";import{intersectRay as h}from"../../../../../geometry/support/plane.js";import{sv3d as d}from"../../../../../geometry/support/vectorStacks.js";import{ResizeManipulator as u}from"../../../analysis/Slice/ResizeManipulator.js";import{updateResizeHandle as m,isDiagonalResizeHandle as _,calculateDiagonalResizeHandleScale as S}from"../../../analysis/Slice/sliceToolUtils.js";import{screenToRenderPlane as g}from"../dragEventPipeline3D.js";import{ManipulatorType as f}from"../ManipulatorType.js";import{mapPlaneAutoSize2D as y}from"./extentUtils.js";import{fromScreenNormalized as z}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as x}from"../../../../interactive/dragEventPipeline.js";import{AccumulationBehavior as M}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as v}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{apply as b}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import{ExtentScaleTooltipInfo as B}from"../../../../interactive/tooltip/ExtentTooltipInfos.js";class j{get zMax(){if(!this._zMaxDirty)return this._zMax;const t=this._editGeometryOperations.data;if(t.geometry.hasZ){const e=t.coordinateHelper;this._zMax=Number.NEGATIVE_INFINITY;for(const s of t.components)for(const t of s.vertices){const s=e.getZ(t.pos)??0;this._zMax=Math.max(s,this._zMax)}}else this._zMax=0;return this._zMaxDirty=!1,this._zMax}constructor(e,a,i,r,o){this._tool=e,this._graphicState=a,this._editGeometryOperations=i,this._bounds=r,this._preserveAspectRatioStep=o,this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._scaleTooltipInfo=null,this._displayBoundsStart=l(),this._displayBoundsMarginStart=0,this._startScale=s(),this._endScale=s(),this._sizeStart=null,this._zMax=0,this._zMaxDirty=!0;const n=this._tool,c=n.view;this.resizeManipulators=this._resizeHandles.map((t=>{const e=new u(c,t);return n.addHandles([e.events.on("grab-changed",(t=>this._onResizeGrab(t))),this._createResizeDragPipeline(e,t)]),e})),n.manipulators.addMany(this.resizeManipulators),n.addHandles([n.on("graphic-scale-start",(e=>{t(this._startScale,e.xScale,e.yScale),t(this._endScale,e.xScale,e.yScale)})),n.on("graphic-scale",(e=>{t(this._endScale,e.xScale,e.yScale)})),n.on("graphic-scale-stop",(()=>{t(this._startScale,0,0),t(this._endScale,0,0)})),this._graphicState.on("changed",(()=>{"resize"!==n.inputState?.type&&(this._zMaxDirty=!0)}))])}destroy(){this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()}))}forEachManipulator(t){this.resizeManipulators.forEach((e=>t(e,f.SCALE)))}updateManipulators(t,e){this.resizeManipulators.forEach(((s,a)=>{m(s,this._resizeHandles[a],t,e)}))}getUpdatedTooltipInfo(){return this.resizeManipulators.some((t=>t.focused))?this._computeScaleTooltipInfo():null}_computeScaleTooltipInfo(){const t=this._tool,e=this._scaleTooltipInfo??=new B({sketchOptions:t.sketchOptions}),s=t.graphic.geometry;if(null==s)return null;const a=y(this._bounds.mapBounds,this.zMax,s.spatialReference);return null==a?null:(e.xSize=a[0],e.ySize=a[1],null!=this._sizeStart&&this.resizeManipulators.some((t=>t.dragging))?(e.xScale=a[0].value/this._sizeStart[0].value,e.yScale=a[1].value/this._sizeStart[1].value):(e.xScale=1,e.yScale=1),e)}_onResizeGrab({action:t,screenPoint:e}){const s=this._tool,a=this._bounds;if("start"!==t||!e||!s.graphic.geometry)return;const i=z(s.view.state.camera,e);h(a.displayBounds.plane,i,d.get())&&(a.backupMapBounds(),p(a.displayBounds,this._displayBoundsStart),this._displayBoundsMarginStart=a.displayBoundsMargin,this._sizeStart=y(a.mapBoundsStart,this.zMax,s.graphic.geometry.spatialReference),s.inputState={type:"resize"})}_createResizeDragPipeline(t,e){const s=this._tool,a=s.graphic;return x(t,((t,i,r)=>{null!=s.inputState&&(i.next((t=>("start"===t.action&&s.emit("graphic-scale-start",{graphic:a,xScale:1,yScale:1}),t))).next(g(s.view,this._displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this._resizeDragRenderPlaneToFactors()).next(...this._preserveAspectRatioStep()).next(this._resizeDragUpdateGeometry()).next((t=>{const e={graphic:a,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":s.emit("graphic-scale",e);break;case"end":s.inputState=null,s.emit("graphic-scale-stop",e)}return t})),r.next((()=>{null!=s.inputState&&s.emit("graphic-scale-stop",{graphic:a,xScale:1,yScale:1}),s.cancel()})))}))}_resizeDragRenderPlaneToFactors(){const t=this._bounds;return e=>{const s=this._displayBoundsStart,c=e.handle.direction,l=t.displayBoundsMargin,p=this._displayBoundsMarginStart,h=a(d.get(),s.origin);i(h,h,s.basis1,-c[0]),i(h,h,s.basis2,-c[1]);const u=r(d.get(),e.renderEnd,h),m=r(d.get(),e.renderStart,h),g=_(e.handle),f=S(s),y=S(t.displayBounds)/f,z=(t,e)=>{if(0===t)return 1;let s=o(e),a=.5*t*n(e,u)/s;const i=a<0?-1:1;if(g){a+=(s-.5*t*n(e,m)/s)*i*y}const r=s<1.5*p?1:E;return s=Math.max(s-p,E),i>0&&(a-=l),i*Math.max(i*(a/s),r)};return{...e,factor1:z(c[0],s.basis1),factor2:z(c[1],s.basis2)}}}_resizeDragUpdateGeometry(){const r=this._tool,o=this._bounds;return n=>{const l=a(c(),o.mapBoundsStart.origin);i(l,l,o.mapBoundsStart.basis1,-n.handle.direction[0]),i(l,l,o.mapBoundsStart.basis2,-n.handle.direction[1]);const h=t(s(),o.mapBoundsStart.basis1[0],o.mapBoundsStart.basis1[1]);e(h,h);const d=[];for(const t of this._editGeometryOperations.data.components)d.push(...t.vertices);const u="start"===n.action?M.NEW_STEP:M.ACCUMULATE_STEPS,m=this._editGeometryOperations.scaleVertices(d,l,h,n.factor1,n.factor2,u,v.REPLACE);return p(o.mapBoundsStart,o.mapBounds),b(m,o.mapBounds),r.graphic.geometry=this._editGeometryOperations.data.geometry,n}}}const E=1e-6;export{j as ExtentScale,E as scaleEpsilon};
5
+ import{set as t,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{c as i,q as a,f as r,l as o,j as n}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as l,c as p}from"../../../../../chunks/boundedPlane.js";import{intersectRay as h}from"../../../../../geometry/support/plane.js";import{sv3d as d}from"../../../../../geometry/support/vectorStacks.js";import{ResizeManipulator as u}from"../../../analysis/Slice/ResizeManipulator.js";import{updateResizeHandle as m,isDiagonalResizeHandle as S,calculateDiagonalResizeHandleScale as _}from"../../../analysis/Slice/sliceToolUtils.js";import{screenToRenderPlane as g}from"../dragEventPipeline3D.js";import{ManipulatorType as y}from"../ManipulatorType.js";import{mapPlaneAutoSize2D as f}from"./extentUtils.js";import{fromScreenNormalized as z}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as x}from"../../../../interactive/dragEventPipeline.js";import{AccumulationBehavior as M}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as v}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{apply as b}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import{ExtentScaleTooltipInfo as B}from"../../../../interactive/tooltip/ExtentTooltipInfos.js";class j{get zMax(){if(!this._zMaxDirty)return this._zMax;const t=this._editGeometryOperations.data;if(t.geometry.hasZ){const e=t.coordinateHelper;this._zMax=Number.NEGATIVE_INFINITY;for(const s of t.components)for(const t of s.vertices){const s=e.getZ(t.pos)??0;this._zMax=Math.max(s,this._zMax)}}else this._zMax=0;return this._zMaxDirty=!1,this._zMax}constructor(e,i,a,r,o){this._tool=e,this._graphicState=i,this._editGeometryOperations=a,this._bounds=r,this._preserveAspectRatioStep=o,this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._scaleTooltipInfo=null,this._displayBoundsStart=l(),this._displayBoundsMarginStart=0,this._startScale=s(),this._endScale=s(),this._sizeStart=null,this._zMax=0,this._zMaxDirty=!0;const n=this._tool,c=n.view;this.resizeManipulators=this._resizeHandles.map((t=>{const e=new u(c,t);return n.addHandles([e.events.on("grab-changed",(t=>this._onResizeGrab(t))),this._createResizeDragPipeline(e,t)]),e})),n.manipulators.addMany(this.resizeManipulators),n.addHandles([n.on("graphic-scale-start",(e=>{t(this._startScale,e.xScale,e.yScale),t(this._endScale,e.xScale,e.yScale)})),n.on("graphic-scale",(e=>{t(this._endScale,e.xScale,e.yScale)})),n.on("graphic-scale-stop",(()=>{t(this._startScale,0,0),t(this._endScale,0,0)})),this._graphicState.on("changed",(()=>{"resize"!==n.inputState?.type&&(this._zMaxDirty=!0)}))])}destroy(){this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()}))}forEachManipulator(t){this.resizeManipulators.forEach((e=>t(e,y.SCALE)))}updateManipulators(t,e){this.resizeManipulators.forEach(((s,i)=>{m(s,this._resizeHandles[i],t,e)}))}getUpdatedTooltipInfo(){return this.resizeManipulators.some((t=>t.focused))?this._computeScaleTooltipInfo():null}_computeScaleTooltipInfo(){const t=this._tool,e=this._scaleTooltipInfo??=new B({sketchOptions:t.sketchOptions}),s=t.graphic.geometry;if(null==s)return null;const i=f(this._bounds.mapBounds,this.zMax,s.spatialReference);return null==i?null:(e.xSize=i.xSize,e.ySize=i.ySize,null!=this._sizeStart&&this.resizeManipulators.some((t=>t.dragging))?(e.xScale=i.xSize.value/this._sizeStart.xSize.value,e.yScale=i.ySize.value/this._sizeStart.ySize.value):(e.xScale=1,e.yScale=1),e)}_onResizeGrab({action:t,screenPoint:e}){const s=this._tool,i=this._bounds;if("start"!==t||!e||!s.graphic.geometry)return;const a=z(s.view.state.camera,e);h(i.displayBounds.plane,a,d.get())&&(i.backupMapBounds(),p(i.displayBounds,this._displayBoundsStart),this._displayBoundsMarginStart=i.displayBoundsMargin,this._sizeStart=f(i.mapBoundsStart,this.zMax,s.graphic.geometry.spatialReference),s.inputState={type:"resize"})}_createResizeDragPipeline(t,e){const s=this._tool,i=s.graphic;return x(t,((t,a,r)=>{null!=s.inputState&&(a.next((t=>("start"===t.action&&s.emit("graphic-scale-start",{graphic:i,xScale:1,yScale:1}),t))).next(g(s.view,this._displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this._resizeDragRenderPlaneToFactors()).next(...this._preserveAspectRatioStep()).next(this._resizeDragUpdateGeometry()).next((t=>{const e={graphic:i,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":s.emit("graphic-scale",e);break;case"end":s.inputState=null,s.emit("graphic-scale-stop",e)}return t})),r.next((()=>{null!=s.inputState&&s.emit("graphic-scale-stop",{graphic:i,xScale:1,yScale:1}),s.cancel()})))}))}_resizeDragRenderPlaneToFactors(){const t=this._bounds;return e=>{const s=this._displayBoundsStart,c=e.handle.direction,l=t.displayBoundsMargin,p=this._displayBoundsMarginStart,h=i(d.get(),s.origin);a(h,h,s.basis1,-c[0]),a(h,h,s.basis2,-c[1]);const u=r(d.get(),e.renderEnd,h),m=r(d.get(),e.renderStart,h),g=S(e.handle),y=_(s),f=_(t.displayBounds)/y,z=(t,e)=>{if(0===t)return 1;let s=o(e),i=.5*t*n(e,u)/s;const a=i<0?-1:1;if(g){i+=(s-.5*t*n(e,m)/s)*a*f}const r=s<1.5*p?1:E;return s=Math.max(s-p,E),a>0&&(i-=l),a*Math.max(a*(i/s),r)};return{...e,factor1:z(c[0],s.basis1),factor2:z(c[1],s.basis2)}}}_resizeDragUpdateGeometry(){const r=this._tool,o=this._bounds;return n=>{const l=i(c(),o.mapBoundsStart.origin);a(l,l,o.mapBoundsStart.basis1,-n.handle.direction[0]),a(l,l,o.mapBoundsStart.basis2,-n.handle.direction[1]);const h=t(s(),o.mapBoundsStart.basis1[0],o.mapBoundsStart.basis1[1]);e(h,h);const d=[];for(const t of this._editGeometryOperations.data.components)d.push(...t.vertices);const u="start"===n.action?M.NEW_STEP:M.ACCUMULATE_STEPS,m=this._editGeometryOperations.scaleVertices(d,l,h,n.factor1,n.factor2,u,v.REPLACE);return p(o.mapBoundsStart,o.mapBounds),b(m,o.mapBounds),r.graphic.geometry=this._editGeometryOperations.data.geometry,n}}}const E=1e-6;export{j as ExtentScale,E as scaleEpsilon};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.30/esri/copyright.txt for details.
4
4
  */
5
- import{max as s}from"../../../../../core/quantityUtils.js";import{getMetersPerCartesianUnitForSR as t,getMetersPerUnitForSR as i}from"../../../../../core/unitUtils.js";import{scale as o}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as e,f as n,k as a,b as r,n as c,i as l,j as p,l as u,q as g}from"../../../../../chunks/vec32.js";import{a as m,c as d,u as b}from"../../../../../chunks/boundedPlane.js";import{sv3d as h}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as f}from"../../../../../support/elevationInfoUtils.js";import{mainAxis as y}from"../geometryUtils.js";import{evaluateElevationAlignmentAtPoint as B}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as j}from"../../../layers/graphics/ElevationContext.js";import{calculateOrientedBounds as v}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import{autoDistance2D as C}from"../../../../support/automaticLengthMeasurementUtils.js";class _{constructor(s,t,i){this._tool=s,this._onDisplayBoundsChanged=t,this.mapBounds=m(),this.mapBoundsStart=m(),this.displayBounds=m(),this._calculateMapBounds(i)}get displayBoundsMargin(){const{view:s,graphic:t}=this._tool,i=s.pointsOfInterest?.centerOnSurfaceFrequent.location??t.geometry?.extent?.center;return i?R*s.pixelSizeAt(i):0}backupMapBounds(){d(this.mapBounds,this.mapBoundsStart)}updateDisplayBounds(){this._calculateDisplayBounds(),this._onDisplayBoundsChanged()}_calculateMapBounds(s){const{view:e,attachmentOrigin:n}=this._tool,a=s.geometry,r=y(a);o(r,r,-1);const c=e.spatialReference,l=a.spatialReference,p=n?e.pixelSizeAt(n)*t(c)/i(l):0;v(r,s,U*p,this.mapBounds)}_calculateDisplayBounds(){const{view:s,attachmentOrigin:t,graphic:i}=this._tool;if(!i.geometry)return;const o=t?.z??B(this.mapBounds.origin,s.elevationProvider,j.fromElevationInfo(f(i)),s.renderCoordsHelper),e=d(this.mapBounds);e.origin[2]=o??0,x(e,s.renderCoordsHelper,i.geometry.spatialReference,this.displayBoundsMargin,this.displayBounds)}}const R=10,U=80;function x(s,t,i,o=0,g){g||(g=m()),t.toRenderCoords(s.origin,i,g.origin);const d=h.get();e(d,s.origin,s.basis1),e(d,d,s.basis2),t.toRenderCoords(d,i,d);const f=h.get();e(f,s.origin,s.basis1),n(f,f,s.basis2),t.toRenderCoords(f,i,f);const y=h.get();n(y,s.origin,s.basis1),n(y,y,s.basis2),t.toRenderCoords(y,i,y);const B=h.get();n(B,s.origin,s.basis1),e(B,B,s.basis2),t.toRenderCoords(B,i,B);const j=a(h.get(),d,f,.5);n(j,j,g.origin);const v=a(h.get(),y,B,.5);n(v,g.origin,v),a(g.basis1,j,v,.5);const C=a(h.get(),B,d,.5);n(C,C,g.origin);const _=a(h.get(),f,y,.5);n(_,g.origin,_),a(g.basis2,C,_,.5);const R=r(h.get(),g.basis1,g.basis2),U=r(R,R,g.basis1);return c(U,U),l(g.basis2,U,p(g.basis2,U)),l(g.basis1,g.basis1,1+o/u(g.basis1)),l(g.basis2,g.basis2,1+o/u(g.basis2)),b(g),g}function M(t,i,o){const e=h.get();n(e,n(e,t.origin,t.basis1),t.basis2);const a=h.get();g(a,e,t.basis1,2);const r=h.get();g(r,a,t.basis2,2);const c=h.get();g(c,e,t.basis2,2),e[2]=a[2]=r[2]=c[2]=i;const l=s(C(e,a,o),C(c,r,o)),p=s(C(a,r,o),C(e,c,o));return null==p||null==l?null:[l,p]}export{_ as TransformBounds,M as mapPlaneAutoSize2D};
5
+ import{getMetersPerCartesianUnitForSR as s,getMetersPerUnitForSR as t}from"../../../../../core/unitUtils.js";import{scale as i}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as o,f as e,k as a,b as r,n,i as c,j as p,l,q as m}from"../../../../../chunks/vec32.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as g,c as u,u as b}from"../../../../../chunks/boundedPlane.js";import{sv3d as h}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as f}from"../../../../../support/elevationInfoUtils.js";import{mainAxis as B}from"../geometryUtils.js";import{evaluateElevationAlignmentAtPoint as y}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as v}from"../../../layers/graphics/ElevationContext.js";import{calculateOrientedBounds as j}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import{autoSize2D as R}from"../../../../support/extentUtils.js";class C{constructor(s,t,i){this._tool=s,this._onDisplayBoundsChanged=t,this.mapBounds=g(),this.mapBoundsStart=g(),this.displayBounds=g(),this._calculateMapBounds(i)}get displayBoundsMargin(){const{view:s,graphic:t}=this._tool,i=s.pointsOfInterest?.centerOnSurfaceFrequent.location??t.geometry?.extent?.center;return i?_*s.pixelSizeAt(i):0}backupMapBounds(){u(this.mapBounds,this.mapBoundsStart)}updateDisplayBounds(){this._calculateDisplayBounds(),this._onDisplayBoundsChanged()}_calculateMapBounds(o){const{view:e,attachmentOrigin:a}=this._tool,r=o.geometry,n=B(r);i(n,n,-1);const c=e.spatialReference,p=r.spatialReference,l=a?e.pixelSizeAt(a)*s(c)/t(p):0;j(n,o,x*l,this.mapBounds)}_calculateDisplayBounds(){const{view:s,attachmentOrigin:t,graphic:i}=this._tool;if(!i.geometry)return;const o=t?.z??y(this.mapBounds.origin,s.elevationProvider,v.fromElevationInfo(f(i)),s.renderCoordsHelper),e=u(this.mapBounds);e.origin[2]=o??0,S(e,s.renderCoordsHelper,i.geometry.spatialReference,this.displayBoundsMargin,this.displayBounds)}}const _=10,x=80;function S(s,t,i,m=0,d){d||(d=g()),t.toRenderCoords(s.origin,i,d.origin);const u=h.get();o(u,s.origin,s.basis1),o(u,u,s.basis2),t.toRenderCoords(u,i,u);const f=h.get();o(f,s.origin,s.basis1),e(f,f,s.basis2),t.toRenderCoords(f,i,f);const B=h.get();e(B,s.origin,s.basis1),e(B,B,s.basis2),t.toRenderCoords(B,i,B);const y=h.get();e(y,s.origin,s.basis1),o(y,y,s.basis2),t.toRenderCoords(y,i,y);const v=a(h.get(),u,f,.5);e(v,v,d.origin);const j=a(h.get(),B,y,.5);e(j,d.origin,j),a(d.basis1,v,j,.5);const R=a(h.get(),y,u,.5);e(R,R,d.origin);const C=a(h.get(),f,B,.5);e(C,d.origin,C),a(d.basis2,R,C,.5);const _=r(h.get(),d.basis1,d.basis2),x=r(_,_,d.basis1);return n(x,x),c(d.basis2,x,p(d.basis2,x)),c(d.basis1,d.basis1,1+m/l(d.basis1)),c(d.basis2,d.basis2,1+m/l(d.basis2)),b(d),d}function U(s,t,i){return e(O,e(O,s.origin,s.basis1),s.basis2),m(M,O,s.basis1,2),m(D,M,s.basis2,2),m(k,O,s.basis2,2),O[2]=M[2]=D[2]=k[2]=t,R({topLeft:k,topRight:D,bottomRight:M,bottomLeft:O,spatialReference:i})}const k=d(),D=d(),M=d(),O=d();export{C as TransformBounds,U as mapPlaneAutoSize2D};