@arcgis/core 4.34.0-next.18 → 4.34.0-next.19

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 (90) hide show
  1. package/EULA.pdf +0 -0
  2. package/applications/MapViewer/templateUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{fa894be8cfb6ed485df9.js → 025891f445869e33252b.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{827919fe23e06e40a330.js → 1a82f903b442a3856bfa.js} +1 -1
  6. package/assets/esri/core/workers/chunks/22206d13a75d61d77023.js +1 -0
  7. package/assets/esri/core/workers/chunks/227d25fcbb5f590c4581.js +1 -0
  8. package/assets/esri/core/workers/chunks/{2ad538440cfb3ab94787.js → 2c0c97acb7714b1e0e01.js} +1 -1
  9. package/assets/esri/core/workers/chunks/3e07de009d5febd62b19.js +1 -0
  10. package/assets/esri/core/workers/chunks/{4325fdd96d9ea344132e.js → 4072ab8378c235a268ca.js} +1 -1
  11. package/assets/esri/core/workers/chunks/52410198c4b2eccfeadd.js +1 -0
  12. package/assets/esri/core/workers/chunks/{04e558a970c6a77f243e.js → 5cbaf4ff688aafa6643e.js} +1 -1
  13. package/assets/esri/core/workers/chunks/5e53c7e29bb6d43d08be.js +1 -0
  14. package/assets/esri/core/workers/chunks/606782a94adcce6975af.js +1 -0
  15. package/assets/esri/core/workers/chunks/{53e43798d08ad2075c1f.js → 758776e841fd370e3353.js} +1 -1
  16. package/assets/esri/core/workers/chunks/764e505f2bafdf5afaf9.js +1 -0
  17. package/assets/esri/core/workers/chunks/{68374cf42a069436830d.js → 8656c145ff0ca2e51ea6.js} +1 -1
  18. package/assets/esri/core/workers/chunks/903c7a0a47c14442d3c1.js +1 -0
  19. package/assets/esri/core/workers/chunks/933d4a3b0cee82cc80fe.js +1 -0
  20. package/assets/esri/core/workers/chunks/{66c8816e91e3f9e214d4.js → a92a344763fbc3cec71e.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{2d89e354eeadadca4f7f.js → b421986cb4e45c632f7c.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{872f151a3a2bc9052be0.js → c1822b03302c3db71b1f.js} +1 -1
  23. package/assets/esri/core/workers/chunks/d568070513f2b98fd9b5.js +1 -0
  24. package/assets/esri/core/workers/chunks/{5bfccd5dffda74740aa4.js → df811b31e0446de5d322.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{85753105268aeff84e69.js → ec339075bb4faeec1413.js} +1 -1
  26. package/assets/esri/themes/base/widgets/_Legend.scss +2 -2
  27. package/assets/esri/themes/dark/main.css +1 -1
  28. package/assets/esri/themes/light/main.css +1 -1
  29. package/config.js +1 -1
  30. package/geometry/support/coordsUtils.js +1 -1
  31. package/interfaces.d.ts +63 -16
  32. package/kernel.js +1 -1
  33. package/layers/OrientedImageryLayer.js +1 -1
  34. package/layers/graphics/data/QueryEngineResult.js +1 -1
  35. package/layers/mixins/FeatureLayerBase.js +1 -1
  36. package/layers/orientedImagery/core/utils.js +1 -1
  37. package/layers/support/arcgisLayers.js +1 -1
  38. package/layers/support/fetchService.js +1 -1
  39. package/layers/support/layerUtils.js +1 -1
  40. package/package.json +1 -1
  41. package/portal/support/layersLoader.js +1 -1
  42. package/portal/support/loadUtils.js +1 -1
  43. package/portal/support/portalLayers.js +1 -1
  44. package/request.js +1 -1
  45. package/rest/support/DateBinParameters.js +1 -1
  46. package/smartMapping/renderers/size.js +1 -1
  47. package/support/requestUtils.js +1 -1
  48. package/support/revision.js +1 -1
  49. package/symbols/cim/effects/EffectRadial.js +1 -1
  50. package/symbols/cim/utils.js +1 -1
  51. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  52. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  53. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  54. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  55. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  56. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  57. package/views/3d/layers/I3SMeshView3D.js +1 -1
  58. package/views/3d/support/popupHitTest.js +1 -1
  59. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  60. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  61. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  62. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  63. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  64. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  65. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  66. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  67. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  68. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  69. package/views/analysis/analysisViewUtils.js +1 -1
  70. package/views/layers/DimensionLayerView.js +1 -1
  71. package/views/layers/LineOfSightLayerView.js +1 -1
  72. package/views/layers/ViewshedLayerView.js +1 -1
  73. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  74. package/widgets/FeatureTable/support/templateUtils.js +1 -1
  75. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  76. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  77. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  78. package/widgets/OrientedImageryViewer.js +1 -1
  79. package/widgets/Print/PrintViewModel.js +1 -1
  80. package/widgets/Print.js +1 -1
  81. package/assets/esri/core/workers/chunks/1443520c9fb23381f8d5.js +0 -1
  82. package/assets/esri/core/workers/chunks/3f8cc157b65a9d570921.js +0 -1
  83. package/assets/esri/core/workers/chunks/513dc2467e9b8b8c6df4.js +0 -1
  84. package/assets/esri/core/workers/chunks/5ef1095842e21090f1f4.js +0 -1
  85. package/assets/esri/core/workers/chunks/7716a9fb380d66ba7292.js +0 -1
  86. package/assets/esri/core/workers/chunks/7c56740cac444419e5b4.js +0 -1
  87. package/assets/esri/core/workers/chunks/8855f1a6224ffbd0bb66.js +0 -1
  88. package/assets/esri/core/workers/chunks/885e8e90dfe5dbd5053d.js +0 -1
  89. package/assets/esri/core/workers/chunks/cc1328cacc4ac07eb548.js +0 -1
  90. package/assets/esri/core/workers/chunks/f3e179b48bca50c94538.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.34/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as a,isColorOrColorEmission as n,isColorEmission as h,ShaderOutput as c}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as p}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as u}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as m}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as _}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as T}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as A,PathPassParameters as O,PathTechnique as R}from"./PathTechnique.js";import{PathTechniqueConfiguration as y}from"./PathTechniqueConfiguration.js";import{alphaCutoff as E}from"../../../../webscene/support/AlphaCutoff.js";class P extends d{constructor(t,e){super(t,I),this.vertexAttributeLocations=A,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[S.OPAQUE_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&!this.transparent],[S.TRANSPARENT_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&this.transparent]]),this._configuration=new y(e.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=e.hasOccludees,n(t)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?u.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?u.WindingOrder:u.None,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=e.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?m.Schematic:m.Disabled,this._configuration.emissionSource=this.parameters.usePBR?p.SymbolColor:p.None,this._configuration.hasBloom=h(t),this._configuration.oitPass=e.oitPass,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.snowCover=e.snowCover,this._configuration}isVisibleForOutput(t){return t!==c.Shadow&&t!==c.ShadowExcludeHighlight&&t!==c.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=E}intersect(t,e,i,r,s,o){this._intersect(t,i,r,s,o)}intersectDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(t,e,this._pp0,this._pp1,r)}_intersect(i,s,o,a,n){const h=i;if(!b(h))return;const c=h.path,p=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:i,minSize:r,maxSize:s,fallback:o}=this.parameters.vvSize,a=c.sizeAttributeValue;Number.isNaN(a)?(p[0]*=o[0],p[1]*=o[2]):(p[0]*=t(e[0]+a*i[0],r[0],s[0]),p[1]*=t(e[2]+a*i[2],r[2],s[2]))}const u=new g(!1,s.options.normalRequired),m=Math.max(p[0],p[1]),l=i.boundingInfo;if(null==l)return void w(c,p,o,a,u,n);const f=r(l.bbMin[0]-m,l.bbMin[1]-m,l.bbMin[2]-m,l.bbMax[0]+m,l.bbMax[1]+m,l.bbMax[2]+m),d=[a[0]-o[0],a[1]-o[1],a[2]-o[2]],S=Math.sqrt(d[0]*d[0]+d[1]*d[1]+d[2]*d[2]),_=[S/d[0],S/d[1],S/d[2]];v(f,o,_,s.tolerance)&&w(c,p,o,a,u,n)}createBufferWriter(){return new T(this._layout)}get _layout(){const t=s().vec3f(_.POSITION).vec4f16(_.PROFILEVERTEXANDNORMAL).vec2i16(_.PROFILERIGHT,{glNormalized:!0}).vec2i16(_.PROFILEUP,{glNormalized:!0});return this.parameters.vvSize&&t.f32(_.SIZEFEATUREATTRIBUTE),t.vec3f16(_.PROFILEAUXDATA),this.parameters.vvColor&&t.f16(_.COLORFEATUREATTRIBUTE),this.parameters.vvOpacity&&t.f16(_.OPACITYFEATUREATTRIBUTE),l()&&t.vec4u8(_.OLIDCOLOR),t}createGLMaterial(t){return new j(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class j extends f{beginSlot(t){return this.getTechnique(R,t)}}function w(t,e,i,r,s,o){t.baked.size&&t.baked.size[0]===e[0]&&t.baked.size[1]===e[1]||t.baked.bake(e),t.baked.intersect(i,r,s,o)}class I extends O{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{I as Parameters,P as PathMaterial};
5
+ import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as a,isColorOrColorEmission as n,isColorEmission as h,ShaderOutput as c}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as p}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as u}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as m}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as _}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as T}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as A,PathPassParameters as O,PathTechnique as R}from"./PathTechnique.js";import{PathTechniqueConfiguration as y}from"./PathTechniqueConfiguration.js";import{alphaCutoff as E}from"../../../../webscene/support/AlphaCutoff.js";class P extends d{constructor(t,e){super(t,I),this.vertexAttributeLocations=A,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[S.OPAQUE_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&!this.transparent],[S.TRANSPARENT_MATERIAL,t=>(this.parameters.castShadows&&o(t)||a(t))&&this.transparent]]),this._configuration=new y(e.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=e.hasOccludees,n(t)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?u.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?u.WindingOrder:u.None,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=e.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?m.Schematic:m.Disabled,this._configuration.emissionSource=this.parameters.usePBR?p.SymbolColor:p.None,this._configuration.hasBloom=h(t),this._configuration.oitPass=e.oitPass,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.snowCover=e.snowCover,this._configuration}isVisibleForOutput(t){return t!==c.Shadow&&t!==c.ShadowExcludeHighlight&&t!==c.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=E}intersect(t,e,i,r,s,o){this._intersect(t,i,r,s,o)}intersectDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(t,e,this._pp0,this._pp1,r)}_intersect(i,s,o,a,n){const h=i;if(!b(h))return;const c=h.path,p=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:i,minSize:r,maxSize:s,fallback:o}=this.parameters.vvSize,a=c.sizeAttributeValue;Number.isNaN(a)?(p[0]*=o[0],p[1]*=o[2]):(p[0]*=t(e[0]+a*i[0],r[0],s[0]),p[1]*=t(e[2]+a*i[2],r[2],s[2]))}const u=new g(!1,s.options.normalRequired),m=Math.max(p[0],p[1]),l=i.boundingInfo;if(null==l)return void w(c,p,o,a,u,n);const f=r(l.bbMin[0]-m,l.bbMin[1]-m,l.bbMin[2]-m,l.bbMax[0]+m,l.bbMax[1]+m,l.bbMax[2]+m),d=[a[0]-o[0],a[1]-o[1],a[2]-o[2]],S=Math.sqrt(d[0]*d[0]+d[1]*d[1]+d[2]*d[2]),_=[S/d[0],S/d[1],S/d[2]];v(f,o,_,s.tolerance)&&w(c,p,o,a,u,n)}createBufferWriter(){return new T(this._layout)}get _layout(){const t=s().vec3f(_.POSITION).vec4f16(_.PROFILEVERTEXANDNORMAL).vec2i16(_.PROFILERIGHT,{glNormalized:!0}).vec2i16(_.PROFILEUP,{glNormalized:!0});return this.parameters.vvSize&&t.f32(_.SIZEFEATUREATTRIBUTE),this.parameters.vvColor&&t.f32(_.COLORFEATUREATTRIBUTE),this.parameters.vvOpacity&&t.f32(_.OPACITYFEATUREATTRIBUTE),l()&&t.vec4u8(_.OLIDCOLOR),t.vec3f16(_.PROFILEAUXDATA),t}createGLMaterial(t){return new j(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class j extends f{beginSlot(t){return this.getTechnique(R,t)}}function w(t,e,i,r,s,o){t.baked.size&&t.baked.size[0]===e[0]&&t.baked.size[1]===e[1]||t.baked.bake(e),t.baked.intersect(i,r,s,o)}class I extends O{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{I as Parameters,P as PathMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{freeze as r,create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{EmissiveSourceMode as t}from"../../../../symbols/support/materialUtils.js";import{isColorOrColorEmission as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as o}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as l}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a,depthOnlyOutputBuffersOr as m}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as c}from"../lib/OITPass.js";import{OITPolygonOffset as p,oitDepthTest as h,blending as u,getDrawBuffers as d}from"../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as T,stencilWriteMaskOn as f}from"../lib/StencilUtils.js";import{VertexAttribute as O}from"../lib/VertexAttribute.js";import{advancedMRRFactors as b}from"./pbrUtils.js";import{P as E}from"../../../../chunks/Path.glsl.js";import{makePipelineState as P,defaultColorWrite as R,defaultDepthWrite as j,frontFaceCullingParams as I}from"../../../webgl/renderState.js";class A extends o{constructor(){super(...arguments),this.ambient=r(.2,.2,.2),this.diffuse=r(.8,.8,.8),this.opacity=1,this.origin=e(),this.modelTransformation=null,this.mrrFactors=b,this.emissiveStrength=0,this.emissiveSource=t.Color,this.emissiveBaseColor=s}}class g extends a{constructor(r,e){super(r,e,new n(E,(()=>import("../shaders/Path.glsl.js"))),L)}initializePipeline(r){const{output:e,transparent:s,hasSlicePlane:t,doubleSidedMode:o,hasOccludees:n,oitPass:a}=r,O=a===c.NONE,b=a===c.FrontFace;return P({blending:i(e)&&s?u(a):null,culling:t&&!s&&o!==l.None?I:null,depthTest:{func:h(a)},depthWrite:O||b?j:null,drawBuffers:m(e,d(a,e)),colorWrite:R,stencilWrite:n?f:null,stencilTest:n?T:null,polygonOffset:O||b?null:p})}}const L=new Map([[O.POSITION,0],[O.PROFILEVERTEXANDNORMAL,1],[O.PROFILEAUXDATA,2],[O.PROFILERIGHT,3],[O.PROFILEUP,4],[O.SIZEFEATUREATTRIBUTE,5],[O.COLORFEATUREATTRIBUTE,6],[O.OPACITYFEATUREATTRIBUTE,7],[O.OLIDCOLOR,8]]);export{A as PathPassParameters,g as PathTechnique,L as vertexAttributeLocations};
5
+ import{freeze as r,create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{EmissiveSourceMode as t}from"../../../../symbols/support/materialUtils.js";import{isColorOrColorEmission as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as o}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as l}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a,depthOnlyOutputBuffersOr as m}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as c}from"../lib/OITPass.js";import{OITPolygonOffset as p,oitDepthTest as h,blending as u,getDrawBuffers as d}from"../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as T,stencilWriteMaskOn as f}from"../lib/StencilUtils.js";import{VertexAttribute as O}from"../lib/VertexAttribute.js";import{advancedMRRFactors as b}from"./pbrUtils.js";import{P as E}from"../../../../chunks/Path.glsl.js";import{makePipelineState as P,defaultColorWrite as R,defaultDepthWrite as j,frontFaceCullingParams as I}from"../../../webgl/renderState.js";class A extends o{constructor(){super(...arguments),this.ambient=r(.2,.2,.2),this.diffuse=r(.8,.8,.8),this.opacity=1,this.origin=e(),this.modelTransformation=null,this.mrrFactors=b,this.emissiveStrength=0,this.emissiveSource=t.Color,this.emissiveBaseColor=s}}class g extends a{constructor(r,e){super(r,e,new n(E,(()=>import("../shaders/Path.glsl.js"))),L)}initializePipeline(r){const{output:e,transparent:s,hasSlicePlane:t,doubleSidedMode:o,hasOccludees:n,oitPass:a}=r,O=a===c.NONE,b=a===c.FrontFace;return P({blending:i(e)&&s?u(a):null,culling:t&&!s&&o!==l.None?I:null,depthTest:{func:h(a)},depthWrite:O||b?j:null,drawBuffers:m(e,d(a,e)),colorWrite:R,stencilWrite:n?f:null,stencilTest:n?T:null,polygonOffset:O||b?null:p})}}const L=new Map([[O.POSITION,0],[O.PROFILEVERTEXANDNORMAL,1],[O.PROFILERIGHT,2],[O.PROFILEUP,3],[O.SIZEFEATUREATTRIBUTE,4],[O.COLORFEATUREATTRIBUTE,5],[O.OPACITYFEATUREATTRIBUTE,6],[O.OLIDCOLOR,7],[O.PROFILEAUXDATA,8]]);export{A as PathPassParameters,g as PathTechnique,L as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewMat3f as t,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as i,isColorOrColorEmission as o,isDepth as a,isColorEmissionHighlightOrOID as n}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as f}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as c}from"../lib/basicInterfaces.js";import l from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{assert as h}from"../lib/Util.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as d}from"./DefaultBufferWriter.js";import{Style as g}from"./PatternStyle.js";import{TriangleMaterial as A}from"./TriangleMaterial.js";import{VisualVariablePassParameters as T}from"./VisualVariablePassParameters.js";import{writeDefaultAttributes as b,writeBufferVec4 as v}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocationsOID as O,vertexAttributeLocations as _,PatternTechnique as j}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as C}from"../shaders/PatternTechniqueConfiguration.js";import{alphaCutoff as P}from"../../../../webscene/support/AlphaCutoff.js";class R extends A{constructor(e){super(e,I),this._configuration=new C,this.vertexAttributeLocations=f()?O:_,this.supportsEdges=!0,this.produces=new Map([[p.OPAQUE_MATERIAL,e=>i(e)],[p.TRANSPARENT_MATERIAL,e=>o(e)],[p.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,e=>a(e)],[p.DRAPED_MATERIAL,e=>this.parameters.draped&&n(e)]])}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.style=this.parameters.style,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<u,this._configuration.terrainDepthTest=t.terrainDepthTest&&o(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration}get visible(){return this.parameters.color[3]>=P}createGLMaterial(e){return new y(e)}createBufferWriter(){const e=s().vec3f(m.POSITION).vec4f(m.UVMAPSPACE);return this.parameters.draped||e.mat3f(m.BOUNDINGRECT),this.parameters.vvColor?e.f16(m.COLORFEATUREATTRIBUTE):e.vec4u8(m.COLOR),f()&&e.vec4u8(m.OLIDCOLOR),new E(e)}}class y extends l{beginSlot(e){return this.getTechnique(j,e)}}class E extends d{write(e,s,i,o,a,n){const f=b(i,o,this.vertexBufferLayout,e,s,a,n);for(const c of this.vertexBufferLayout.fields.keys()){const s=i.get(c),o=s?.indices;if(s&&o)switch(c){case m.UVMAPSPACE:{h(4===s.size);const e=a.getField(c,r);e&&v(s,e,n);break}case m.BOUNDINGRECT:{h(9===s.size);const r=a.getField(c,t);r&&L(s,e,r,n);break}}}return f}}function L(e,t,r,s){const{data:i,indices:o}=e,a=t,n=r.typedBuffer,f=r.typedBufferStride,c=o.length;s*=f;for(let l=0;l<c;++l){const e=9*o[l],t=i[e],r=i[e+1],c=i[e+2];n[s]=a[0]*t+a[4]*r+a[8]*c+a[12],n[s+1]=a[1]*t+a[5]*r+a[9]*c+a[13],n[s+2]=a[2]*t+a[6]*r+a[10]*c+a[14];for(let o=3;o<9;++o)n[s+o]=i[e+o];s+=f}}class I extends T{constructor(){super(...arguments),this.color=e(1,1,1,1),this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=c.None,this.hasOccludees=!1,this.style=g.Cross,this.draped=!0}}export{I as Parameters,R as PatternMaterial};
5
+ import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewMat3f as t,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as i,isColorOrColorEmission as o,isDepth as a,isColorEmissionHighlightOrOID as n}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as f}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as c}from"../lib/basicInterfaces.js";import l from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{assert as h}from"../lib/Util.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as d}from"./DefaultBufferWriter.js";import{Style as g}from"./PatternStyle.js";import{TriangleMaterial as A}from"./TriangleMaterial.js";import{VisualVariablePassParameters as T}from"./VisualVariablePassParameters.js";import{writeDefaultAttributes as b,writeBufferVec4 as v}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocationsOID as O,vertexAttributeLocations as _,PatternTechnique as j}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as C}from"../shaders/PatternTechniqueConfiguration.js";import{alphaCutoff as P}from"../../../../webscene/support/AlphaCutoff.js";class R extends A{constructor(e){super(e,I),this._configuration=new C,this.vertexAttributeLocations=f()?O:_,this.supportsEdges=!0,this.produces=new Map([[p.OPAQUE_MATERIAL,e=>i(e)],[p.TRANSPARENT_MATERIAL,e=>o(e)],[p.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,e=>a(e)],[p.DRAPED_MATERIAL,e=>this.parameters.draped&&n(e)]])}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.style=this.parameters.style,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<u,this._configuration.terrainDepthTest=t.terrainDepthTest&&o(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration}get visible(){return this.parameters.color[3]>=P}createGLMaterial(e){return new y(e)}createBufferWriter(){const e=s().vec3f(m.POSITION).vec4f(m.UVMAPSPACE);return this.parameters.draped||e.mat3f(m.BOUNDINGRECT),this.parameters.vvColor?e.f32(m.COLORFEATUREATTRIBUTE):e.vec4u8(m.COLOR),f()&&e.vec4u8(m.OLIDCOLOR),new E(e)}}class y extends l{beginSlot(e){return this.getTechnique(j,e)}}class E extends d{write(e,s,i,o,a,n){const f=b(i,o,this.vertexBufferLayout,e,s,a,n);for(const c of this.vertexBufferLayout.fields.keys()){const s=i.get(c),o=s?.indices;if(s&&o)switch(c){case m.UVMAPSPACE:{h(4===s.size);const e=a.getField(c,r);e&&v(s,e,n);break}case m.BOUNDINGRECT:{h(9===s.size);const r=a.getField(c,t);r&&L(s,e,r,n);break}}}return f}}function L(e,t,r,s){const{data:i,indices:o}=e,a=t,n=r.typedBuffer,f=r.typedBufferStride,c=o.length;s*=f;for(let l=0;l<c;++l){const e=9*o[l],t=i[e],r=i[e+1],c=i[e+2];n[s]=a[0]*t+a[4]*r+a[8]*c+a[12],n[s+1]=a[1]*t+a[5]*r+a[9]*c+a[13],n[s+2]=a[2]*t+a[6]*r+a[10]*c+a[14];for(let o=3;o<9;++o)n[s+o]=i[e+o];s+=f}}class I extends T{constructor(){super(...arguments),this.color=e(1,1,1,1),this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=c.None,this.hasOccludees=!1,this.style=g.Cross,this.draped=!0}}export{I as Parameters,R as PatternMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,e as n,g as o,f as l,c,l as p,j as h,t as f}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{distance2 as E,fromPoints as _,create as A,closestLineSegmentPoint as R}from"../../../../geometry/support/lineSegment.js";import{fromPoints as g,create as S,signedDistance as O,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as P,isColorOrColorEmission as N,isDepth as L,isColorEmissionHighlightOIDOrDepth as b,is2DGeometryOutput as C,ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as J}from"./internal/bufferWriterUtils.js";import{LineMarkerAnchor as z}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as H}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Z,CapType as V}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";var Y;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Y||(Y={}));class q extends D{constructor(e){super(e,Q),this._configuration=new Z,this.vertexAttributeLocations=G,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>P(e)||N(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>L(e)],[w.OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==U.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&te(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(B.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],p=s[1],h=(l/2+4)*r;let f=Number.MAX_VALUE,m=0;const u=e.get(B.POSITION).data,T=ee(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=p-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),h=n*l-s,T=o*l-a,E=h*h+T*T;E<f&&(f=E,m=d/3)}f<h*h&&a(n.distance,n.normal,m)}intersect(r,f,m,u,T,A){const{options:S,camera:v,rayBegin:P,rayEnd:N}=m;if(!S.selectionMode||!r.visible||!v)return;if(!M(f))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(B.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(B.SIZE)&&(C*=L.get(B.SIZE).data[0]);const U=ne;i(U,m.point);const y=C*v.pixelRatio/2+4*v.pixelRatio;s(de[0],U[0]-y,U[1]+y,0),s(de[1],U[0]+y,U[1]+y,0),s(de[2],U[0]+y,U[1]-y,0),s(de[3],U[0]-y,U[1]-y,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(de[e],Ee[e]))return;g(v.eye,Ee[0],Ee[1],_e),g(v.eye,Ee[1],Ee[2],Ae),g(v.eye,Ee[2],Ee[3],Re),g(v.eye,Ee[3],Ee[0],ge);let j=Number.MAX_VALUE,D=0;const F=ee(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<F;e+=3){re[0]=b[e]+f[12],re[1]=b[e+1]+f[13],re[2]=b[e+2]+f[14];const t=(e+3)%b.length;if(ie[0]=b[t]+f[12],ie[1]=b[t+1]+f[13],ie[2]=b[t+2]+f[14],O(_e,re)<0&&O(_e,ie)<0||O(Ae,re)<0&&O(Ae,ie)<0||O(Re,re)<0&&O(Re,ie)<0||O(ge,re)<0&&O(ge,ie)<0)continue;if(v.projectToRenderScreen(re,oe),v.projectToRenderScreen(ie,le),oe[2]<0&&le[2]>0){a(se,re,ie);const e=v.frustum,t=-O(e[d.NEAR],re)/n(se,I(e[d.NEAR]));o(se,se,t),l(re,re,se),v.projectToRenderScreen(re,oe)}else if(oe[2]>0&&le[2]<0){a(se,ie,re);const e=v.frustum,t=-O(e[d.NEAR],ie)/n(se,I(e[d.NEAR]));o(se,se,t),l(ie,ie,se),v.projectToRenderScreen(ie,le)}else if(oe[2]<0&&le[2]<0)continue;oe[2]=0,le[2]=0;const r=E(_(oe,le,he),U);r<j&&(j=r,c(ce,re),c(pe,ie),D=e/3)}if(j<y*y){let e=Number.MAX_VALUE;if(R(_(ce,pe,he),_(P,N,fe),ae)){a(ae,ae,P);const t=p(ae);o(ae,ae,1/t),e=t/h(P,N)}A(e,ae,D)}}get _layout(){const e=v().vec3f(B.POSITION).vec4f16(B.PREVIOUSDELTA).vec4f16(B.NEXTDELTA).f32(B.U0).vec2f16(B.LINEPARAMETERS);return this.parameters.vvSize&&e.f32(B.SIZEFEATUREATTRIBUTE),this.parameters.vvColor?e.f16(B.COLORFEATUREATTRIBUTE):e.vec4u8(B.COLOR,{glNormalized:!0}),this.parameters.vvSize||e.f16(B.SIZE),this.parameters.vvOpacity&&e.f16(B.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(B.OLIDCOLOR),e}createBufferWriter(){return new K(this._layout,this.parameters)}createGLMaterial(e){return new X(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class X extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(k,e)}}class Q extends x{constructor(){super(...arguments),this.width=0,this.color=u,this.join="miter",this.cap=V.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class K{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=H+r}}_isClosed(e){return ee(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=r.get(B.POSITION),l=o.indices,p=o.data.length/3,m=r.get(B.DISTANCETOSTART)?.data;l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=this.vertexBufferLayout.fields.has(B.SIZEFEATUREATTRIBUTE),d=(u?r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(B.SIZE)?.data[0])??1;let E=[1,1,1,1],_=0;const A=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);A?_=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(E=r.get(B.COLOR).data);const R=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),g=R?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,S=new Float32Array(a.buffer),O=T(a.buffer),I=new Uint8Array(a.buffer),v=this.vertexBufferLayout.stride/4;let P=n*v;const N=P;let L=0;const b=m?(e,t,r)=>L=m[r]:(e,t,r)=>L+=h(e,t),C=S.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,U=4/C,j=(e,t,r,s,a,n,o)=>{S[P++]=t[0],S[P++]=t[1],S[P++]=t[2],J(e,t,O,P*C),P+=U,J(r,t,O,P*C),P+=U,S[P++]=o;let l=P*C;if(O[l++]=s,O[l++]=a,u&&(P=Math.ceil(l/C),S[P]=d,l+=C),A)O[l++]=_;else{const e=Math.min(4*n,E.length-4),t=l/C*4;l+=C,I[t]=255*E[e],I[t+1]=255*E[e+1],I[t+2]=255*E[e+2],I[t+3]=255*E[e+3]}u||(O[l++]=d),R&&(O[l++]=g);let c=l/C*4;y()&&(i?(I[c++]=i[0],I[c++]=i[1],I[c++]=i[2],I[c++]=i[3]):(I[c++]=0,I[c++]=0,I[c++]=0,I[c++]=0)),P=Math.ceil(.25*c)};P+=v,s(ue,o.data[0],o.data[1],o.data[2]),e&&f(ue,ue,e);const D=this._isClosed(r);if(D){const t=o.data.length-3;s(me,o.data[t],o.data[t+1],o.data[t+2]),e&&f(me,me,e)}else s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),j(ue,ue,Te,1,Y.LEFT_CAP_START,0,0),j(ue,ue,Te,1,Y.RIGHT_CAP_START,0,0),c(me,ue),c(ue,Te);const F=D?0:1,w=D?p:p-1;for(let h=F;h<w;h++){const t=(h+1)%p*3;s(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e),b(me,ue,h),j(me,ue,Te,0,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,h,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);j(me,ue,Te,t,Y.LEFT_JOIN_END,h,L),j(me,ue,Te,t,Y.RIGHT_JOIN_END,h,L)}j(me,ue,Te,1,Y.LEFT_JOIN_START,h,L),j(me,ue,Te,1,Y.RIGHT_JOIN_START,h,L),c(me,ue),c(ue,Te)}D?(s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),L=b(me,ue,w),j(me,ue,Te,0,Y.LEFT_JOIN_END,F,L),j(me,ue,Te,0,Y.RIGHT_JOIN_END,F,L)):(L=b(me,ue,w),j(me,ue,ue,0,Y.LEFT_CAP_END,w,L),j(me,ue,ue,0,Y.RIGHT_CAP_END,w,L)),$(S,N+v,S,N,v);return P=$(S,P-v,S,P,v),this._parameters.wireframe&&this._addWireframeVertices(a,N,P,v),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=$(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function $(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function ee(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function te(e){return e.anchor===z.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const re=m(),ie=m(),se=m(),ae=m(),ne=m(),oe=r(),le=r(),ce=m(),pe=m(),he=A(),fe=A(),me=m(),ue=m(),Te=m(),de=[r(),r(),r(),r()],Ee=[m(),m(),m(),m()],_e=S(),Ae=S(),Re=S(),ge=S();export{Q as Parameters,q as RibbonLineMaterial};
5
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,e as n,g as o,f as l,c,l as p,j as h,t as f}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{PlaneIndex as d}from"../../../../geometry/support/frustum.js";import{distance2 as E,fromPoints as _,create as A,closestLineSegmentPoint as R}from"../../../../geometry/support/lineSegment.js";import{fromPoints as g,create as S,signedDistance as O,getNormal as I}from"../../../../geometry/support/plane.js";import{newLayout as v}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as P,isColorOrColorEmission as N,isDepth as L,isColorEmissionHighlightOIDOrDepth as b,is2DGeometryOutput as C,ShaderOutput as U}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as y}from"../effects/geometry/olidUtils.js";import j from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as F}from"../lib/Material.js";import{RenderSlot as w}from"../lib/RenderSlot.js";import{isTranslationMatrix as M}from"../lib/Util.js";import{VertexAttribute as B}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as J}from"./internal/bufferWriterUtils.js";import{LineMarkerAnchor as z}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as H}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as G,RibbonLineTechnique as k}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Z,CapType as V}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";var Y;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Y||(Y={}));class q extends D{constructor(e){super(e,Q),this._configuration=new Z,this.vertexAttributeLocations=G,this.produces=new Map([[w.OPAQUE_MATERIAL,e=>P(e)||N(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>L(e)],[w.OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_OCCLUDER_MATERIAL,e=>b(e)&&this.parameters.renderOccluded===F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==F.OccludeAndTransparentStencil],[w.DRAPED_MATERIAL,e=>C(e)]])}getConfiguration(e,t){super.getConfiguration(e,t,this._configuration),this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===w.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==U.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&te(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===F.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=e.get(B.SIZE);let l=this.parameters.width;if(this.parameters.vvSize){const r=e.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const c=s[0],p=s[1],h=(l/2+4)*r;let f=Number.MAX_VALUE,m=0;const u=e.get(B.POSITION).data,T=ee(this.parameters,e)?u.length-2:u.length-5;for(let d=0;d<T;d+=3){const e=u[d],r=u[d+1],i=(d+3)%u.length,s=c-e,a=p-r,n=u[i]-e,o=u[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),h=n*l-s,T=o*l-a,E=h*h+T*T;E<f&&(f=E,m=d/3)}f<h*h&&a(n.distance,n.normal,m)}intersect(r,f,m,u,T,A){const{options:S,camera:v,rayBegin:P,rayEnd:N}=m;if(!S.selectionMode||!r.visible||!v)return;if(!M(f))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const L=r.attributes,b=L.get(B.POSITION).data;let C=this.parameters.width;if(this.parameters.vvSize){const e=L.get(B.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(C*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else L.has(B.SIZE)&&(C*=L.get(B.SIZE).data[0]);const U=ne;i(U,m.point);const y=C*v.pixelRatio/2+4*v.pixelRatio;s(de[0],U[0]-y,U[1]+y,0),s(de[1],U[0]+y,U[1]+y,0),s(de[2],U[0]+y,U[1]-y,0),s(de[3],U[0]-y,U[1]-y,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(de[e],Ee[e]))return;g(v.eye,Ee[0],Ee[1],_e),g(v.eye,Ee[1],Ee[2],Ae),g(v.eye,Ee[2],Ee[3],Re),g(v.eye,Ee[3],Ee[0],ge);let j=Number.MAX_VALUE,D=0;const F=ee(this.parameters,L)?b.length-2:b.length-5;for(let e=0;e<F;e+=3){re[0]=b[e]+f[12],re[1]=b[e+1]+f[13],re[2]=b[e+2]+f[14];const t=(e+3)%b.length;if(ie[0]=b[t]+f[12],ie[1]=b[t+1]+f[13],ie[2]=b[t+2]+f[14],O(_e,re)<0&&O(_e,ie)<0||O(Ae,re)<0&&O(Ae,ie)<0||O(Re,re)<0&&O(Re,ie)<0||O(ge,re)<0&&O(ge,ie)<0)continue;if(v.projectToRenderScreen(re,oe),v.projectToRenderScreen(ie,le),oe[2]<0&&le[2]>0){a(se,re,ie);const e=v.frustum,t=-O(e[d.NEAR],re)/n(se,I(e[d.NEAR]));o(se,se,t),l(re,re,se),v.projectToRenderScreen(re,oe)}else if(oe[2]>0&&le[2]<0){a(se,ie,re);const e=v.frustum,t=-O(e[d.NEAR],ie)/n(se,I(e[d.NEAR]));o(se,se,t),l(ie,ie,se),v.projectToRenderScreen(ie,le)}else if(oe[2]<0&&le[2]<0)continue;oe[2]=0,le[2]=0;const r=E(_(oe,le,he),U);r<j&&(j=r,c(ce,re),c(pe,ie),D=e/3)}if(j<y*y){let e=Number.MAX_VALUE;if(R(_(ce,pe,he),_(P,N,fe),ae)){a(ae,ae,P);const t=p(ae);o(ae,ae,1/t),e=t/h(P,N)}A(e,ae,D)}}get _layout(){const e=v().vec3f(B.POSITION).vec4f16(B.PREVIOUSDELTA).vec4f16(B.NEXTDELTA).f32(B.U0).vec2f16(B.LINEPARAMETERS);return this.parameters.vvColor?e.f32(B.COLORFEATUREATTRIBUTE):e.vec4u8(B.COLOR,{glNormalized:!0}),this.parameters.vvSize?e.f32(B.SIZEFEATUREATTRIBUTE):e.f32(B.SIZE),this.parameters.vvOpacity&&e.f32(B.OPACITYFEATUREATTRIBUTE),y()&&e.vec4u8(B.OLIDCOLOR),e}createBufferWriter(){return new K(this._layout,this.parameters)}createGLMaterial(e){return new X(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class X extends j{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(k,e)}}class Q extends x{constructor(){super(...arguments),this.width=0,this.color=u,this.join="miter",this.cap=V.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class K{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=H+r}}_isClosed(e){return ee(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(B.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=r.get(B.POSITION),l=o.indices,p=o.data.length/3,m=r.get(B.DISTANCETOSTART)?.data;l&&l.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=(this.vertexBufferLayout.fields.has(B.SIZEFEATUREATTRIBUTE)?r.get(B.SIZEFEATUREATTRIBUTE)?.data[0]:r.get(B.SIZE)?.data[0])??1;let d=[1,1,1,1],E=0;const _=this.vertexBufferLayout.fields.has(B.COLORFEATUREATTRIBUTE);_?E=r.get(B.COLORFEATUREATTRIBUTE).data[0]:r.has(B.COLOR)&&(d=r.get(B.COLOR).data);const A=this.vertexBufferLayout.fields.has(B.OPACITYFEATUREATTRIBUTE),R=A?r.get(B.OPACITYFEATUREATTRIBUTE).data[0]:0,g=new Float32Array(a.buffer),S=T(a.buffer),O=new Uint8Array(a.buffer),I=this.vertexBufferLayout.stride/4;let v=n*I;const P=v;let N=0;const L=m?(e,t,r)=>N=m[r]:(e,t,r)=>N+=h(e,t),b=g.BYTES_PER_ELEMENT/S.BYTES_PER_ELEMENT,C=4/b,U=(e,t,r,s,a,n,o)=>{g[v++]=t[0],g[v++]=t[1],g[v++]=t[2],J(e,t,S,v*b),v+=C,J(r,t,S,v*b),v+=C,g[v++]=o;let l=v*b;if(S[l++]=s,S[l++]=a,v++,_)g[v]=E;else{const e=Math.min(4*n,d.length-4),t=4*v;O[t]=255*d[e],O[t+1]=255*d[e+1],O[t+2]=255*d[e+2],O[t+3]=255*d[e+3]}if(v++,g[v++]=u,A&&(g[v++]=R),y()){let e=4*v;i?(O[e++]=i[0],O[e++]=i[1],O[e++]=i[2],O[e++]=i[3]):(O[e++]=0,O[e++]=0,O[e++]=0,O[e++]=0),v=Math.ceil(.25*e)}};v+=I,s(ue,o.data[0],o.data[1],o.data[2]),e&&f(ue,ue,e);const j=this._isClosed(r);if(j){const t=o.data.length-3;s(me,o.data[t],o.data[t+1],o.data[t+2]),e&&f(me,me,e)}else s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),U(ue,ue,Te,1,Y.LEFT_CAP_START,0,0),U(ue,ue,Te,1,Y.RIGHT_CAP_START,0,0),c(me,ue),c(ue,Te);const D=j?0:1,F=j?p:p-1;for(let h=D;h<F;h++){const t=(h+1)%p*3;s(Te,o.data[t],o.data[t+1],o.data[t+2]),e&&f(Te,Te,e),L(me,ue,h),U(me,ue,Te,0,Y.LEFT_JOIN_END,h,N),U(me,ue,Te,0,Y.RIGHT_JOIN_END,h,N);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);U(me,ue,Te,t,Y.LEFT_JOIN_END,h,N),U(me,ue,Te,t,Y.RIGHT_JOIN_END,h,N)}U(me,ue,Te,1,Y.LEFT_JOIN_START,h,N),U(me,ue,Te,1,Y.RIGHT_JOIN_START,h,N),c(me,ue),c(ue,Te)}j?(s(Te,o.data[3],o.data[4],o.data[5]),e&&f(Te,Te,e),N=L(me,ue,F),U(me,ue,Te,0,Y.LEFT_JOIN_END,D,N),U(me,ue,Te,0,Y.RIGHT_JOIN_END,D,N)):(N=L(me,ue,F),U(me,ue,ue,0,Y.LEFT_CAP_END,F,N),U(me,ue,ue,0,Y.RIGHT_CAP_END,F,N)),$(g,P+I,g,P,I);return v=$(g,v-I,g,v,I),this._parameters.wireframe&&this._addWireframeVertices(a,P,v,I),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=$(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function $(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function ee(e,t){if(!e.isClosed)return!1;return t.get(B.POSITION).indices.length>2}function te(e){return e.anchor===z.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const re=m(),ie=m(),se=m(),ae=m(),ne=m(),oe=r(),le=r(),ce=m(),pe=m(),he=A(),fe=A(),me=m(),ue=m(),Te=m(),de=[r(),r(),r(),r()],Ee=[m(),m(),m(),m()],_e=S(),Ae=S(),Re=S(),ge=S();export{Q as Parameters,q as RibbonLineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{d as e,l as t,g as f}from"../../../../../chunks/vec32.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasIdentityRotation as o,isOrthoNormal as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as s,BufferViewVec3f16 as n,BufferViewVec3f as c,BufferViewVec4f16 as l,BufferViewVec4f as d,BufferViewFloat16 as u,BufferViewFloat as a,BufferViewVec2i16 as g,BufferViewVec2f16 as p,BufferViewVec2f as B}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as y}from"../../lib/Util.js";import{VertexAttribute as b}from"../../lib/VertexAttribute.js";function m(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l)s[f]=o[i[l]],f+=n;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)s[f]=e,f+=n}}function O(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=s}}function h(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=3*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}}function F(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=4*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}}function I(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function T(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=s}}function N(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=s}}function R(e,t,f,r,i=1){if(!t)return void h(e,f,r,i);const{data:s,indices:n}=e,c=f.typedBuffer,l=f.typedBufferStride,d=n.length,u=t[0],a=t[1],g=t[2],p=t[4],B=t[5],y=t[6],b=t[8],m=t[9],O=t[10],F=t[12],I=t[13],T=t[14];r*=l;let N=0,R=0,S=0;const E=o(t)?e=>{N=s[e]+F,R=s[e+1]+I,S=s[e+2]+T}:e=>{const t=s[e],f=s[e+1],r=s[e+2];N=u*t+p*f+b*r+F,R=a*t+B*f+m*r+I,S=g*t+y*f+O*r+T};if(1===i)for(let o=0;o<d;++o)E(3*n[o]),c[r]=N,c[r+1]=R,c[r+2]=S,r+=l;else for(let o=0;o<d;++o){E(3*n[o]);for(let e=0;e<i;++e)c[r]=N,c[r+1]=R,c[r+2]=S,r+=l}}function S(e,t,f,r,s=1){if(!t)return void h(e,f,r,s);const{data:n,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,g=l[0],p=l[1],B=l[2],y=l[4],b=l[5],m=l[6],O=l[8],F=l[9],I=l[10],T=!i(l),N=1e-6,R=1-N;r*=u;let S=0,E=0,A=0;const v=o(l)?e=>{S=n[e],E=n[e+1],A=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];S=g*t+y*f+O*r,E=p*t+b*f+F*r,A=B*t+m*f+I*r};if(1===s)if(T)for(let o=0;o<a;++o){v(3*c[o]);const e=S*S+E*E+A*A;if(e<R&&e>N){const t=1/Math.sqrt(e);d[r]=S*t,d[r+1]=E*t,d[r+2]=A*t}else d[r]=S,d[r+1]=E,d[r+2]=A;r+=u}else for(let o=0;o<a;++o)v(3*c[o]),d[r]=S,d[r+1]=E,d[r+2]=A,r+=u;else for(let o=0;o<a;++o){if(v(3*c[o]),T){const e=S*S+E*E+A*A;if(e<R&&e>N){const t=1/Math.sqrt(e);S*=t,E*=t,A*=t}}for(let e=0;e<s;++e)d[r]=S,d[r+1]=E,d[r+2]=A,r+=u}}function E(e,t,f,r,o=1){if(!t)return void F(e,f,r,o);const{data:s,indices:n}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=n.length,a=c[0],g=c[1],p=c[2],B=c[4],y=c[5],b=c[6],m=c[8],O=c[9],h=c[10],I=!i(c),T=1e-6,N=1-T;if(r*=d,1===o)for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],o=s[e+2],c=s[e+3];let u=a*t+B*f+m*o,F=g*t+y*f+O*o,R=p*t+b*f+h*o;if(I){const e=u*u+F*F+R*R;if(e<N&&e>T){const t=1/Math.sqrt(e);u*=t,F*=t,R*=t}}l[r]=u,l[r+1]=F,l[r+2]=R,l[r+3]=c,r+=d}else for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],c=s[e+2],u=s[e+3];let F=a*t+B*f+m*c,R=g*t+y*f+O*c,S=p*t+b*f+h*c;if(I){const e=F*F+R*R+S*S;if(e<N&&e>T){const t=1/Math.sqrt(e);F*=t,R*=t,S*=t}}for(let i=0;i<o;++i)l[r]=F,l[r+1]=R,l[r+2]=S,l[r+3]=u,r+=d}}function A(e,t,f,r,o=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(r*=c,t!==i.length||4!==t)if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=255,r+=c}}else{n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=s,r+=t}}function v(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length,c=r[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function w(r,o,i,s){e(k,r,o);const n=Math.max(Math.sqrt(t(k)),1e-4);f(k,k,1/n),i[s++]=k[0],i[s++]=k[1],i[s++]=k[2],i[s++]=n}const k=r();function z(e,t,f,r,o=1){const i=t.typedBuffer,s=t.typedBufferStride;if(r*=s,1===o)for(let n=0;n<f;++n)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s;else for(let n=0;n<f;++n)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s}function L(e,t,f,r,o,i,n){let c={numItems:0,numVerticesPerItem:0};for(const l of f.fields.keys()){const f=e.get(l),d=f?.indices;if(f&&d)l===b.POSITION&&(c={numItems:1,numVerticesPerItem:d.length}),P(l,f,r,o,i,n);else if(l===b.OLIDCOLOR&&null!=t){const f=e.get(b.POSITION)?.indices;if(f){const e=f.length;z(t,i.getField(l,s),e,n)}}}return c}function P(e,t,f,r,o,i){switch(e){case b.POSITION:{y(3===t.size);const r=o.getField(e,c);y(!!r,`No buffer view for ${e}`),R(t,f,r,i);break}case b.NORMAL:{y(3===t.size);const f=o.getField(e,c);y(!!f,`No buffer view for ${e}`),S(t,r,f,i);break}case b.NORMALCOMPRESSED:case b.PROFILERIGHT:case b.PROFILEUP:{y(2===t.size);const f=o.getField(e,g);y(!!f,`No buffer view for ${e}`),O(t,f,i);break}case b.UV0:{y(2===t.size);const f=o.getField(e,p)??o.getField(e,B);y(!!f,`No buffer view for ${e}`),O(t,f,i);break}case b.UVI:{y(2===t.size);const f=o.getField(e,g);y(!!f,`No buffer view for ${e}`),O(t,f,i);break}case b.COLOR:case b.SYMBOLCOLOR:{const f=o.getField(e,s);y(!!f,`No buffer view for ${e}`),y(3===t.size||4===t.size),A(t,t.size,f,i);break}case b.SIZEFEATUREATTRIBUTE:{const f=o.getField(e,a);y(!!f,`No buffer view for ${e}`),y(1===t.size),v(t,f,i);break}case b.COLORFEATUREATTRIBUTE:case b.OPACITYFEATUREATTRIBUTE:{const f=o.getField(e,u)??o.getField(e,a);y(!!f,`No buffer view for ${e}`),y(1===t.size),v(t,f,i);break}case b.TANGENT:{y(4===t.size);const r=o.getField(e,d);y(!!r,`No buffer view for ${e}`),E(t,f,r,i);break}case b.PROFILEVERTEXANDNORMAL:{y(4===t.size);const f=o.getField(e,l)??o.getField(e,d);y(!!f,`No buffer view for ${e}`),F(t,f,i);break}case b.PROFILEAUXDATA:{y(3===t.size);const f=o.getField(e,n)??o.getField(e,c);y(!!f,`No buffer view for ${e}`),h(t,f,i);break}}}export{m as writeBufferFloat,T as writeBufferMat3f,N as writeBufferMat4f,O as writeBufferVec2,h as writeBufferVec3,F as writeBufferVec4,I as writeBufferVec4Zeros,A as writeColor,v as writeColorFeatureAttribute,P as writeDefaultAttribute,L as writeDefaultAttributes,w as writeDeltaF16Vector,S as writeNormal,z as writeOlidColor,R as writePosition,E as writeTangent};
5
+ import{d as e,l as t,g as f}from"../../../../../chunks/vec32.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasIdentityRotation as o,isOrthoNormal as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as s,BufferViewVec3f16 as n,BufferViewVec3f as c,BufferViewVec4f16 as l,BufferViewVec4f as d,BufferViewFloat as u,BufferViewVec2i16 as a,BufferViewVec2f16 as p,BufferViewVec2f as g}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as B}from"../../lib/Util.js";import{VertexAttribute as y}from"../../lib/VertexAttribute.js";function b(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l)s[f]=o[i[l]],f+=n;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)s[f]=e,f+=n}}function m(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=s}}function O(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=3*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}}function h(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=4*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}}function F(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function I(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=s}}function T(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=s}}function R(e,t,f,r,i=1){if(!t)return void O(e,f,r,i);const{data:s,indices:n}=e,c=f.typedBuffer,l=f.typedBufferStride,d=n.length,u=t[0],a=t[1],p=t[2],g=t[4],B=t[5],y=t[6],b=t[8],m=t[9],h=t[10],F=t[12],I=t[13],T=t[14];r*=l;let R=0,S=0,E=0;const N=o(t)?e=>{R=s[e]+F,S=s[e+1]+I,E=s[e+2]+T}:e=>{const t=s[e],f=s[e+1],r=s[e+2];R=u*t+g*f+b*r+F,S=a*t+B*f+m*r+I,E=p*t+y*f+h*r+T};if(1===i)for(let o=0;o<d;++o)N(3*n[o]),c[r]=R,c[r+1]=S,c[r+2]=E,r+=l;else for(let o=0;o<d;++o){N(3*n[o]);for(let e=0;e<i;++e)c[r]=R,c[r+1]=S,c[r+2]=E,r+=l}}function S(e,t,f,r,s=1){if(!t)return void O(e,f,r,s);const{data:n,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],g=l[1],B=l[2],y=l[4],b=l[5],m=l[6],h=l[8],F=l[9],I=l[10],T=!i(l),R=1e-6,S=1-R;r*=u;let E=0,N=0,A=0;const v=o(l)?e=>{E=n[e],N=n[e+1],A=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];E=p*t+y*f+h*r,N=g*t+b*f+F*r,A=B*t+m*f+I*r};if(1===s)if(T)for(let o=0;o<a;++o){v(3*c[o]);const e=E*E+N*N+A*A;if(e<S&&e>R){const t=1/Math.sqrt(e);d[r]=E*t,d[r+1]=N*t,d[r+2]=A*t}else d[r]=E,d[r+1]=N,d[r+2]=A;r+=u}else for(let o=0;o<a;++o)v(3*c[o]),d[r]=E,d[r+1]=N,d[r+2]=A,r+=u;else for(let o=0;o<a;++o){if(v(3*c[o]),T){const e=E*E+N*N+A*A;if(e<S&&e>R){const t=1/Math.sqrt(e);E*=t,N*=t,A*=t}}for(let e=0;e<s;++e)d[r]=E,d[r+1]=N,d[r+2]=A,r+=u}}function E(e,t,f,r,o=1){if(!t)return void h(e,f,r,o);const{data:s,indices:n}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=n.length,a=c[0],p=c[1],g=c[2],B=c[4],y=c[5],b=c[6],m=c[8],O=c[9],F=c[10],I=!i(c),T=1e-6,R=1-T;if(r*=d,1===o)for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],o=s[e+2],c=s[e+3];let u=a*t+B*f+m*o,h=p*t+y*f+O*o,S=g*t+b*f+F*o;if(I){const e=u*u+h*h+S*S;if(e<R&&e>T){const t=1/Math.sqrt(e);u*=t,h*=t,S*=t}}l[r]=u,l[r+1]=h,l[r+2]=S,l[r+3]=c,r+=d}else for(let i=0;i<u;++i){const e=4*n[i],t=s[e],f=s[e+1],c=s[e+2],u=s[e+3];let h=a*t+B*f+m*c,S=p*t+y*f+O*c,E=g*t+b*f+F*c;if(I){const e=h*h+S*S+E*E;if(e<R&&e>T){const t=1/Math.sqrt(e);h*=t,S*=t,E*=t}}for(let i=0;i<o;++i)l[r]=h,l[r+1]=S,l[r+2]=E,l[r+3]=u,r+=d}}function N(e,t,f,r,o=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(r*=c,t!==i.length||4!==t)if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=255,r+=c}}else{n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=s,r+=t}}function A(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length,c=r[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function v(r,o,i,s){e(w,r,o);const n=Math.max(Math.sqrt(t(w)),1e-4);f(w,w,1/n),i[s++]=w[0],i[s++]=w[1],i[s++]=w[2],i[s++]=n}const w=r();function L(e,t,f,r,o=1){const i=t.typedBuffer,s=t.typedBufferStride;if(r*=s,1===o)for(let n=0;n<f;++n)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s;else for(let n=0;n<f;++n)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s}function k(e,t,f,r,o,i,n){let c={numItems:0,numVerticesPerItem:0};for(const l of f.fields.keys()){const f=e.get(l),d=f?.indices;if(f&&d)l===y.POSITION&&(c={numItems:1,numVerticesPerItem:d.length}),z(l,f,r,o,i,n);else if(l===y.OLIDCOLOR&&null!=t){const f=e.get(y.POSITION)?.indices;if(f){const e=f.length;L(t,i.getField(l,s),e,n)}}}return c}function z(e,t,f,r,o,i){switch(e){case y.POSITION:{B(3===t.size);const r=o.getField(e,c);B(!!r,`No buffer view for ${e}`),R(t,f,r,i);break}case y.NORMAL:{B(3===t.size);const f=o.getField(e,c);B(!!f,`No buffer view for ${e}`),S(t,r,f,i);break}case y.NORMALCOMPRESSED:case y.PROFILERIGHT:case y.PROFILEUP:{B(2===t.size);const f=o.getField(e,a);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.UV0:{B(2===t.size);const f=o.getField(e,p)??o.getField(e,g);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.UVI:{B(2===t.size);const f=o.getField(e,a);B(!!f,`No buffer view for ${e}`),m(t,f,i);break}case y.COLOR:case y.SYMBOLCOLOR:{const f=o.getField(e,s);B(!!f,`No buffer view for ${e}`),B(3===t.size||4===t.size),N(t,t.size,f,i);break}case y.COLORFEATUREATTRIBUTE:case y.OPACITYFEATUREATTRIBUTE:case y.SIZEFEATUREATTRIBUTE:{const f=o.getField(e,u)??o.getField(e,u);B(!!f,`No buffer view for ${e}`),B(1===t.size),A(t,f,i);break}case y.TANGENT:{B(4===t.size);const r=o.getField(e,d);B(!!r,`No buffer view for ${e}`),E(t,f,r,i);break}case y.PROFILEVERTEXANDNORMAL:{B(4===t.size);const f=o.getField(e,l)??o.getField(e,d);B(!!f,`No buffer view for ${e}`),h(t,f,i);break}case y.PROFILEAUXDATA:{B(3===t.size);const f=o.getField(e,n)??o.getField(e,c);B(!!f,`No buffer view for ${e}`),O(t,f,i);break}}}export{b as writeBufferFloat,I as writeBufferMat3f,T as writeBufferMat4f,m as writeBufferVec2,O as writeBufferVec3,h as writeBufferVec4,F as writeBufferVec4Zeros,N as writeColor,z as writeDefaultAttribute,k as writeDefaultAttributes,v as writeDeltaF16Vector,S as writeNormal,L as writeOlidColor,R as writePosition,E as writeTangent,A as writeVVFeatureAttribute};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as l,oitDepthTest as n,blending as s,getDrawBuffers as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{stencilToolMaskBaseParams as c,stencilBaseAllZerosParams as u,stencilWriteMaskOn as a,stencilToolTransparentOccluderParams as d,depthCompareAlways as T,stencilToolMaskOccluderParams as h,stencilWriteMaskOff as m,depthCompareLess as P}from"../lib/StencilUtils.js";import{VertexAttribute as E}from"../lib/VertexAttribute.js";import{L as O}from"../../../../chunks/LineMarker.glsl.js";import{LineMarkerSpace as R}from"./LineMarkerTechniqueConfiguration.js";import{makePipelineState as f,defaultColorWrite as _,unpremultipliedAlphaToPremultipliedAlpha as A}from"../../../webgl/renderState.js";class S extends t{constructor(e,t){super(e,t,new i(O,(()=>import("./LineMarker.glsl.js"))),W)}_makePipelineState(i,t){const{output:p,oitPass:d,space:T,hasOccludees:h}=i;return f({blending:e(p)?s(d):null,depthTest:T===R.Draped?null:{func:n(d)},depthWrite:l(i),drawBuffers:r(p,o(d,p)),colorWrite:_,stencilWrite:h?a:null,stencilTest:h?t?c:u:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=f({blending:A,depthTest:T,depthWrite:null,colorWrite:_,stencilWrite:null,stencilTest:d}),this._occluderPipelineOpaque=f({blending:A,depthTest:T,depthWrite:null,colorWrite:_,stencilWrite:m,stencilTest:h}),this._occluderPipelineMaskWrite=f({blending:null,depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:c})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,i){return e?this._occludeePipelineState:i===p.TRANSPARENT_OCCLUDER_MATERIAL?this._occluderPipelineTransparent??super.getPipeline():i===p.OCCLUDER_MATERIAL?this._occluderPipelineOpaque??super.getPipeline():this._occluderPipelineMaskWrite??super.getPipeline()}}const W=new Map([[E.POSITION,0],[E.PREVIOUSDELTA,1],[E.UV0,2],[E.NORMAL,3],[E.COLOR,4],[E.COLORFEATUREATTRIBUTE,4],[E.SIZE,5],[E.SIZEFEATUREATTRIBUTE,5],[E.OPACITYFEATUREATTRIBUTE,6]]);export{S as LineMarkerTechnique,W as vertexAttributeLocations};
5
+ import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as l,oitDepthTest as n,blending as s,getDrawBuffers as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{stencilToolMaskBaseParams as c,stencilBaseAllZerosParams as u,stencilWriteMaskOn as a,stencilToolTransparentOccluderParams as d,depthCompareAlways as T,stencilToolMaskOccluderParams as h,stencilWriteMaskOff as m,depthCompareLess as P}from"../lib/StencilUtils.js";import{VertexAttribute as E}from"../lib/VertexAttribute.js";import{L as O}from"../../../../chunks/LineMarker.glsl.js";import{LineMarkerSpace as R}from"./LineMarkerTechniqueConfiguration.js";import{makePipelineState as f,defaultColorWrite as _,unpremultipliedAlphaToPremultipliedAlpha as A}from"../../../webgl/renderState.js";class S extends t{constructor(e,t){super(e,t,new i(O,(()=>import("./LineMarker.glsl.js"))),W)}_makePipelineState(i,t){const{output:p,oitPass:d,space:T,hasOccludees:h}=i;return f({blending:e(p)?s(d):null,depthTest:T===R.Draped?null:{func:n(d)},depthWrite:l(i),drawBuffers:r(p,o(d,p)),colorWrite:_,stencilWrite:h?a:null,stencilTest:h?t?c:u:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=f({blending:A,depthTest:T,depthWrite:null,colorWrite:_,stencilWrite:null,stencilTest:d}),this._occluderPipelineOpaque=f({blending:A,depthTest:T,depthWrite:null,colorWrite:_,stencilWrite:m,stencilTest:h}),this._occluderPipelineMaskWrite=f({blending:null,depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:c})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,i){return e?this._occludeePipelineState:i===p.TRANSPARENT_OCCLUDER_MATERIAL?this._occluderPipelineTransparent??super.getPipeline():i===p.OCCLUDER_MATERIAL?this._occluderPipelineOpaque??super.getPipeline():this._occluderPipelineMaskWrite??super.getPipeline()}}const W=new Map([[E.POSITION,0],[E.PREVIOUSDELTA,1],[E.UV0,2],[E.COLOR,3],[E.COLORFEATUREATTRIBUTE,3],[E.OPACITYFEATUREATTRIBUTE,4],[E.SIZE,5],[E.SIZEFEATUREATTRIBUTE,5],[E.NORMAL,6]]);export{S as LineMarkerTechnique,W as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{OITPolygonOffset as n,depthWrite as s,oitDepthTest as o,blending as u,getDrawBuffers as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilToolMaskBaseParams as a,stencilBaseAllZerosParams as d,stencilWriteMaskOn as T,stencilToolTransparentOccluderParams as f,depthCompareAlways as h,stencilToolMaskOccluderParams as m,stencilWriteMaskOff as O,depthCompareLess as E}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as A}from"../../../webgl/enums.js";import{makePipelineState as b,defaultColorWrite as g,unpremultipliedAlphaToPremultipliedAlpha as I}from"../../../webgl/renderState.js";class S extends i{constructor(e,i){super(e,i,new t(R,(()=>import("./RibbonLine.glsl.js"))),_),this.primitiveType=i.wireframe?A.LINES:A.TRIANGLE_STRIP}_makePipelineState(t,i){const{oitPass:c,output:f,hasOccludees:h,hasPolygonOffset:m}=t,O=c===l.NONE,E=c===l.FrontFace;return b({blending:e(f)?u(c):null,depthTest:{func:o(c)},depthWrite:s(t),drawBuffers:r(f,p(c,f)),colorWrite:g,stencilWrite:h?T:null,stencilTest:h?i?a:d:null,polygonOffset:O||E?m?L:null:n})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?L:null,{output:i,hasOccludees:l}=e;this._occluderPipelineTransparent=b({blending:I,polygonOffset:t,depthTest:h,depthWrite:null,colorWrite:g,stencilWrite:null,stencilTest:l?f:null,drawBuffers:r(i)}),this._occluderPipelineOpaque=b({blending:I,polygonOffset:t,depthTest:l?h:E,depthWrite:null,colorWrite:g,stencilWrite:l?O:null,stencilTest:l?m:null,drawBuffers:r(i)}),this._occluderPipelineMaskWrite=b({blending:null,polygonOffset:t,depthTest:E,depthWrite:null,colorWrite:null,stencilWrite:l?T:null,stencilTest:l?a:null,drawBuffers:r(i)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case c.TRANSPARENT_OCCLUDER_MATERIAL:return this._occluderPipelineTransparent??super.getPipeline();case c.OCCLUDER_MATERIAL:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const L={factor:0,units:-4},_=new Map([[P.POSITION,0],[P.PREVIOUSDELTA,1],[P.NEXTDELTA,2],[P.U0,3],[P.LINEPARAMETERS,4],[P.SIZE,5],[P.SIZEFEATUREATTRIBUTE,5],[P.COLOR,6],[P.COLORFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OLIDCOLOR,8]]);export{S as RibbonLineTechnique,_ as vertexAttributeLocations};
5
+ import"../../../../core/has.js";import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i,depthOnlyOutputBuffersOr as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{OITPolygonOffset as n,depthWrite as s,oitDepthTest as o,blending as u,getDrawBuffers as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilToolMaskBaseParams as a,stencilBaseAllZerosParams as d,stencilWriteMaskOn as T,stencilToolTransparentOccluderParams as f,depthCompareAlways as h,stencilToolMaskOccluderParams as m,stencilWriteMaskOff as O,depthCompareLess as E}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as A}from"../../../webgl/enums.js";import{makePipelineState as b,defaultColorWrite as g,unpremultipliedAlphaToPremultipliedAlpha as I}from"../../../webgl/renderState.js";class S extends i{constructor(e,i){super(e,i,new t(R,(()=>import("./RibbonLine.glsl.js"))),_),this.primitiveType=i.wireframe?A.LINES:A.TRIANGLE_STRIP}_makePipelineState(t,i){const{oitPass:c,output:f,hasOccludees:h,hasPolygonOffset:m}=t,O=c===l.NONE,E=c===l.FrontFace;return b({blending:e(f)?u(c):null,depthTest:{func:o(c)},depthWrite:s(t),drawBuffers:r(f,p(c,f)),colorWrite:g,stencilWrite:h?T:null,stencilTest:h?i?a:d:null,polygonOffset:O||E?m?L:null:n})}initializePipeline(e){if(e.occluder){const t=e.hasPolygonOffset?L:null,{output:i,hasOccludees:l}=e;this._occluderPipelineTransparent=b({blending:I,polygonOffset:t,depthTest:h,depthWrite:null,colorWrite:g,stencilWrite:null,stencilTest:l?f:null,drawBuffers:r(i)}),this._occluderPipelineOpaque=b({blending:I,polygonOffset:t,depthTest:l?h:E,depthWrite:null,colorWrite:g,stencilWrite:l?O:null,stencilTest:l?m:null,drawBuffers:r(i)}),this._occluderPipelineMaskWrite=b({blending:null,polygonOffset:t,depthTest:E,depthWrite:null,colorWrite:null,stencilWrite:l?T:null,stencilTest:l?a:null,drawBuffers:r(i)})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case c.TRANSPARENT_OCCLUDER_MATERIAL:return this._occluderPipelineTransparent??super.getPipeline();case c.OCCLUDER_MATERIAL:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const L={factor:0,units:-4},_=new Map([[P.POSITION,0],[P.PREVIOUSDELTA,1],[P.NEXTDELTA,2],[P.U0,3],[P.LINEPARAMETERS,4],[P.COLOR,5],[P.COLORFEATUREATTRIBUTE,5],[P.SIZE,6],[P.SIZEFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OLIDCOLOR,8]]);export{S as RibbonLineTechnique,_ as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{createTask as o}from"../../core/asyncUtils.js";import{handlesGroup as t}from"../../core/handleUtils.js";import{removeMaybe as e}from"../../core/maybe.js";import{throwIfAborted as n,isAbortError as i,onAbort as a}from"../../core/promiseUtils.js";import{watch as r,syncAndInitial as l,on as s,whenOnce as c}from"../../core/reactiveUtils.js";function u(t,n){t.interactive=!0;const{tool:i,view:r}=t;r.activeTool=i;let l=a(n,(()=>{r.activeTool===i&&(r.activeTool=null)}));return o((async o=>{await c((()=>!t.tool?.active),o),l=e(l)}),n)}function m(o,t){return r((()=>o.interactive),(()=>p(o,t)),l)}function p(o,t){o.interactive?v(o,t):f(o)}function v(o,t){f(o);const{view:e,analysis:n}=o,i=new t({view:e,analysis:n,analysisViewData:o});return o.tool=i,e.tools.add(i),i}function f(o){const{view:t,tool:e}=o;null!=e&&(t.tools.remove(e),o.tool=null)}function y(e,a){const r=e.userOperation,l=o((async o=>{if(r){const t=r.promise.catch((()=>{}));r?.abort(),await t,n(o)}const l=u(e,{signal:o}),c=a?.shouldRejectOnCancel??(()=>!0),m=t([s((()=>e.tool),"cancel",(()=>{c()&&l.abort()}))]),{tool:p}=e;try{p&&(p.resetCreated(),a?.onToolActivated?.(p)),await l.promise,n(o)}catch(v){if(o.aborted||!i(v)||c())throw v}finally{m?.remove()}}),{signal:a?.abortOptions?.signal});return e.userOperation=l,l.promise.finally((()=>{e.userOperation===l&&(e.userOperation=null)}))}function d(o,t){const e=o.analysis.clone();return y(o,{abortOptions:t?.placementOptions,onToolActivated:t?.onToolActivated,shouldRejectOnCancel:()=>{const{analysis:t}=o;return!t.valid||t.equals(e)}})}export{u as activateAnalysisViewTool,m as connectAnalysisViewToTool,f as removeAnalysisViewTool,y as startExclusiveInteractiveOperation,d as startPlaceOperation};
5
+ import{createTask as o}from"../../core/asyncUtils.js";import{handlesGroup as t}from"../../core/handleUtils.js";import{removeMaybe as e}from"../../core/maybe.js";import{throwIfAborted as n,isAbortError as i,onAbort as a}from"../../core/promiseUtils.js";import{watch as r,syncAndInitial as s,on as l,whenOnce as c}from"../../core/reactiveUtils.js";function u(t,n){t.interactive=!0;const{tool:i,view:r}=t;r.activeTool=i;let s=a(n,(()=>{r.activeTool===i&&(r.activeTool=null)}));return o((async o=>{await c((()=>!t.tool?.active),o),s=e(s)}),n)}function m(o,t){return r((()=>o.interactive),(()=>p(o,t)),s)}function p(o,t){o.interactive?v(o,t):f(o)}function v(o,t){f(o);const{view:e,analysis:n}=o,i=new t({view:e,analysis:n,analysisViewData:o});return o.tool=i,e.tools.add(i),i}function f(o){const{view:t,tool:e}=o;null!=e&&(t.tools.remove(e),o.tool=null)}function y(e,a){const r=e.userOperation,s=o((async o=>{if(r){const t=r.promise.catch((()=>{}));r?.abort(),await t,n(o)}const s=u(e,{signal:o}),c=a?.shouldRejectOnCancel??(()=>!0),m=t([l((()=>e.tool),"cancel",(()=>{c()&&s.abort()}))]),{tool:p}=e;try{p&&(p.resetCreated(),a?.onToolActivated?.(p)),await s.promise,n(o)}catch(v){if(o.aborted||!i(v)||c())throw v}finally{m?.remove()}}),{signal:a?.abortOptions?.signal});return e.userOperation=s,s.promise.finally((()=>{e.userOperation===s&&(e.userOperation=null)}))}async function d(o,t){const e=o.analysis.clone();return await y(o,{abortOptions:t?.placementOptions,onToolActivated:t?.onToolActivated,shouldRejectOnCancel:()=>{const{analysis:t}=o;return!t.valid||t.equals(e)}}),{}}export{u as activateAnalysisViewTool,m as connectAnalysisViewToTool,f as removeAnalysisViewTool,y as startExclusiveInteractiveOperation,d as startPlaceOperation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../core/Collection.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";const r=r=>{let n=class extends r{constructor(...e){super(...e),this.layer=null}get interactive(){return null!=this.analysisView&&this.analysisView.interactive}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get results(){return this.analysisView?.results??new s}get selectedDimension(){return null!=this.analysisView?this.analysisView.selectedDimension:null}set selectedDimension(e){null!=this.analysisView&&(this.analysisView.selectedDimension=e)}async createLengthDimensions(e){await(this.analysisView?.createLengthDimensions(e))}async place(e){await(this.analysisView?.place(e))}};return e([i()],n.prototype,"layer",void 0),e([i()],n.prototype,"interactive",null),e([i({readOnly:!0})],n.prototype,"results",null),e([i()],n.prototype,"selectedDimension",null),n=e([t("esri.views.layers.DimensionLayerView")],n),n};export{r as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../core/Collection.js";import{createAbortError as i}from"../../core/promiseUtils.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";const n=n=>{let o=class extends n{constructor(...e){super(...e),this.layer=null}get interactive(){return null!=this.analysisView&&this.analysisView.interactive}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get results(){return this.analysisView?.results??new s}get selectedDimension(){return null!=this.analysisView?this.analysisView.selectedDimension:null}set selectedDimension(e){null!=this.analysisView&&(this.analysisView.selectedDimension=e)}async createLengthDimensions(e){await(this.analysisView?.createLengthDimensions(e))}place(e){if(null!=this.analysisView)return this.analysisView?.place(e);throw i()}};return e([t()],o.prototype,"layer",void 0),e([t()],o.prototype,"interactive",null),e([t({readOnly:!0})],o.prototype,"results",null),e([t()],o.prototype,"selectedDimension",null),o=e([r("esri.views.layers.DimensionLayerView")],o),o};export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Collection.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";const o=o=>{let a=class extends o{constructor(...e){super(...e),this.layer=null}get interactive(){return this.analysisView?.interactive??!1}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get results(){return this.analysisView?.results??new r}async place(e){if(null!=this.analysisView)return await this.analysisView.place(e);throw s()}};return e([t()],a.prototype,"layer",void 0),e([t()],a.prototype,"interactive",null),e([t({readOnly:!0})],a.prototype,"results",null),a=e([i("esri.views.layers.LineOfSightLayerView")],a),a};export{o as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Collection.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";const o=o=>{let a=class extends o{constructor(...e){super(...e),this.layer=null}get interactive(){return this.analysisView?.interactive??!1}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get results(){return this.analysisView?.results??new r}place(e){if(null!=this.analysisView)return this.analysisView.place(e);throw s()}};return e([t()],a.prototype,"layer",void 0),e([t()],a.prototype,"interactive",null),e([t({readOnly:!0})],a.prototype,"results",null),a=e([i("esri.views.layers.LineOfSightLayerView")],a),a};export{o as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";const t=t=>{let a=class extends t{constructor(...e){super(...e),this.layer=null}get interactive(){return null!=this.analysisView&&this.analysisView.interactive}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get selectedViewshed(){return null!=this.analysisView?this.analysisView.selectedViewshed:null}set selectedViewshed(e){null!=this.analysisView&&(this.analysisView.selectedViewshed=e)}async createViewsheds(e){await(this.analysisView?.createViewsheds(e))}async place(e){await(this.analysisView?.place(e))}};return e([s()],a.prototype,"layer",void 0),e([s()],a.prototype,"interactive",null),e([s()],a.prototype,"selectedViewshed",null),a=e([i("esri.views.layers.ViewshedLayerView")],a),a};export{t as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";const r=r=>{let a=class extends r{constructor(...e){super(...e),this.layer=null}get interactive(){return null!=this.analysisView&&this.analysisView.interactive}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get selectedViewshed(){return null!=this.analysisView?this.analysisView.selectedViewshed:null}set selectedViewshed(e){null!=this.analysisView&&(this.analysisView.selectedViewshed=e)}async createViewsheds(e){await(this.analysisView?.createViewsheds(e))}place(e){if(null!=this.analysisView)return this.analysisView.place(e);throw s()}};return e([i()],a.prototype,"layer",void 0),e([i()],a.prototype,"interactive",null),e([i()],a.prototype,"selectedViewshed",null),a=e([t("esri.views.layers.ViewshedLayerView")],a),a};export{r as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{substitute as e}from"../../../intl/substitute.js";import{isUpdateFeaturesWorkflow as t,isBatchAttributeFormViewModel as o}from"../workflowUtils.js";import{loadFooterActionsComponents as i,FooterActions as a}from"./FooterActions.js";import{loadNoticesComponents as n,Notices as s}from"./Notices.js";import{loadPanelContentComponents as l,PanelContentSection as r,PanelContentSectionGroup as u,PanelContent as d}from"./PanelContent.js";import c from"./PendingFeatureList.js";import{Heading as p,incrementHeadingLevel as m}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{tsx as f,tsxFragment as h}from"../../support/jsxFactory.js";const v=()=>Promise.all([i(),n(),l()]);function w({editorViewModel:i,headingLevel:n,messages:l,messagesCommon:v,onDelete:w,onDeleteAssociation:b,onSave:g,renderAttachments:y,renderFeatureForm:k,renderBatchAttributeForm:F,renderSketchToolbar:A}){const{activeFeatureCount:j,activeLeafWorkflow:C,activeWorkflow:S,formViewModel:L,syncing:D}=i;if(!C||!S||!L)return null;const I=C.type.includes("update"),P=o(L),B=j>1?l.multiFeature:l.singleFeature,H=I&&!C.hasPendingEdits||D||L.updating||L.disabled,T=e(I?B.update:B.create,{count:j}),x="create-features"!==C?.type||!!C.data.selectedPendingFeature,M="shouldShowAttachments"in C&&C.shouldShowAttachments&&!P&&!L.activeRelationshipInput&&!L.activeAssociationInput,V=(P?L.activeForm.inputs:L.inputs).every((e=>!e.visible))&&!M,U=t(C)?F:k,W=V?f(r,null,"create-features"===C.type?f(c,{headingLevel:n,key:"pending-feature-list",workflow:C}):void 0):f(r,{key:"panel-content-section"},f(s,{activeFeatureCount:j,messages:l,workflow:S}),f(u,null,x||"create-features"!==C.type?U():f(c,{headingLevel:n,key:"pending-feature-list",workflow:C}),M?f("div",{key:"attachments"},f(p,{level:m(n)},l.attachments),y()):null)),E=()=>{const{featureFormViewModel:e}=i;null!=e?.associationId&&(e.associationId=null)},N={appearance:"solid",onClick:g,disabled:H,label:T,type:"button"},R={appearance:"outline",onClick:w,disabled:D,kind:"danger",label:e(B.delete,{count:j}),type:"button"},q={...R,onClick:b,label:l.deleteAssociationTitle,type:"button"},z={...R,primaryLabel:v.delete,primaryText:v.delete,dropdownItems:[{onClick:b,label:l.deleteAssociationTitle}],type:"split-button"},G={appearance:"outline",onClick:E,disabled:D,label:v.cancel,type:"button"},J="viewing-associated-features"===i.page||"viewing-associated-layers"===i.page?[G]:[N,i.shouldShowDeleteButton&&!i.featureFormHasAssociation?R:void 0,i.shouldShowDeleteButton&&i.featureFormHasAssociation?z:void 0,!i.shouldShowDeleteButton&&i.featureFormHasAssociation?q:void 0];return f(h,null,V?A?.():void 0,f(d,{key:"attribute-panel-content"},W),f(a,{buttons:J}))}export{w as UpdateFeaturePanelContent,v as loadUpdateFeaturePanelContentComponents};
5
+ import{substitute as e}from"../../../intl/substitute.js";import{isCreateFeaturesWorkflow as t,isUpdateFeaturesWorkflow as o,isBatchAttributeFormViewModel as i}from"../workflowUtils.js";import{loadFooterActionsComponents as n,FooterActions as a}from"./FooterActions.js";import{loadNoticesComponents as s,Notices as l}from"./Notices.js";import{loadPanelContentComponents as r,PanelContentSection as u,PanelContentSectionGroup as d,PanelContent as c}from"./PanelContent.js";import p from"./PendingFeatureList.js";import{Heading as m,incrementHeadingLevel as f}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{tsx as h,tsxFragment as w}from"../../support/jsxFactory.js";const b=()=>Promise.all([n(),s(),r()]);function g({editorViewModel:n,headingLevel:s,messages:r,messagesCommon:b,onDelete:g,onDeleteAssociation:v,onSave:y,renderAttachments:k,renderFeatureForm:F,renderBatchAttributeForm:A,renderSketchToolbar:j}){const{activeFeatureCount:C,activeLeafWorkflow:S,activeWorkflow:L,formViewModel:D,syncing:I}=n;if(!S||!L||!D)return null;const P=S.type.includes("update"),B=i(D),H=C>1?r.multiFeature:r.singleFeature,T=P&&!S.hasPendingEdits||I||D.updating||D.disabled,x=e(P?H.update:H.create,{count:C}),M="create-features"!==S?.type||!!S.data.selectedPendingFeature,V="shouldShowAttachments"in S&&S.shouldShowAttachments&&!B&&!D.activeRelationshipInput&&!D.activeAssociationInput,U=B?D.activeForm.inputs:D.inputs,W=t(S)&&U.every((e=>!e.visible))&&!V,E=o(S)?A:F,N=W?h(u,null,h(p,{headingLevel:s,key:"pending-feature-list",workflow:S})):h(u,{key:"panel-content-section"},h(l,{activeFeatureCount:C,messages:r,workflow:L}),h(d,null,M||"create-features"!==S.type?E():h(p,{headingLevel:s,key:"pending-feature-list",workflow:S}),V?h("div",{key:"attachments"},h(m,{level:f(s)},r.attachments),k()):null)),R=()=>{const{featureFormViewModel:e}=n;null!=e?.associationId&&(e.associationId=null)},q={appearance:"solid",onClick:y,disabled:T,label:x,type:"button"},z={appearance:"outline",onClick:g,disabled:I,kind:"danger",label:e(H.delete,{count:C}),type:"button"},G={...z,onClick:v,label:r.deleteAssociationTitle,type:"button"},J={...z,primaryLabel:b.delete,primaryText:b.delete,dropdownItems:[{onClick:v,label:r.deleteAssociationTitle}],type:"split-button"},K={appearance:"outline",onClick:R,disabled:I,label:b.cancel,type:"button"},O="viewing-associated-features"===n.page||"viewing-associated-layers"===n.page?[K]:[q,n.shouldShowDeleteButton&&!n.featureFormHasAssociation?z:void 0,n.shouldShowDeleteButton&&n.featureFormHasAssociation?J:void 0,!n.shouldShowDeleteButton&&n.featureFormHasAssociation?G:void 0];return h(w,null,W?j?.():void 0,h(c,{key:"attribute-panel-content"},N),h(a,{buttons:O}))}export{g as UpdateFeaturePanelContent,b as loadUpdateFeaturePanelContentComponents};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../tables/elements/AttributeTableAttachmentElement.js";import i from"../../../tables/elements/AttributeTableFieldElement.js";import n from"../../../tables/elements/AttributeTableGroupElement.js";import r from"../../../tables/elements/AttributeTableRelationshipElement.js";import l from"./AttachmentsColumnTemplate.js";import{isGroupColumn as o,isFieldColumn as s,isRelationshipColumn as m,isAttachmentsColumn as a}from"./columnUtils.js";import p from"./FieldColumnTemplate.js";import f from"./GroupColumnTemplate.js";import c from"./RelationshipColumnTemplate.js";function d(t,i){const n=[];return t?.forEach((t=>{const{description:r,label:l,type:o}=t;if("group"===o){const o=t.elements.map((e=>u(e,i))).filter(e);if(!o?.length)return;n.push(new f({description:r,columnTemplates:o,label:l}))}else{const e=u(t,i);if(!e)return;n.push(e)}})),n}function u(e,t){const{description:i,label:n,type:r}=e;if("field"===r){const r=e.fieldName??void 0,l=t.findIndex((e=>e.field&&e.field===r)),o=l>-1?t.at(l)?.order:void 0;return new p({description:i,direction:o,fieldName:r,initialSortPriority:l,label:n})}return"attachment"===r?new l({description:i,label:n}):"relationship"===r?new c({description:i,label:n,relationshipId:e.relationshipId}):void 0}function b(t){const i=[];return t.forEach((t=>{const{description:r,label:l,hidden:s}=t;if(o(t)){if(s)return;const o=t.columns?.map((e=>h(e))).filter(e);if(!o?.length)return;i.push(new n({description:r,elements:o,label:l}))}else{const e=h(t);if(!e)return;i.push(e)}})),i}function h(e){const{fieldName:n,description:l,hidden:o,label:p}=e;if(s(e)){if(!o)return new i({description:l,fieldName:n,label:p})}else if(m(e)){if(!o)return new r({description:l,label:p,relationshipId:e.relationshipId})}else if(a(e)&&!o)return new t({description:l,label:p})}export{b as createAttributeTableElements,d as createColumnTemplates,h as createNestedAttributeTableElement,u as createNestedColumnTemplate};
5
+ import{isSome as e}from"../../../core/arrayUtils.js";import{createFieldInfos as i}from"../../../support/popupUtils.js";import t from"../../../tables/AttributeTableTemplate.js";import l from"../../../tables/elements/AttributeTableAttachmentElement.js";import r from"../../../tables/elements/AttributeTableFieldElement.js";import n from"../../../tables/elements/AttributeTableGroupElement.js";import o from"../../../tables/elements/AttributeTableRelationshipElement.js";import s from"../../../tables/support/FieldOrder.js";import a from"./AttachmentsColumnTemplate.js";import{isGroupColumn as d,isFieldColumn as m,isRelationshipColumn as p,isAttachmentsColumn as f}from"./columnUtils.js";import c from"./FieldColumnTemplate.js";import u from"./GroupColumnTemplate.js";import h from"./RelationshipColumnTemplate.js";import b from"./TableTemplate.js";import{isIFeatureTableSupportedLayer as w,isIFeatureTableSupportedLayerWithAttachments as y,isIFeatureTableSupportedLayerWithRelationships as T,hasTemplateForField as j}from"./tableUtils.js";function v(i,t){const l=[];return i?.forEach((i=>{const{description:r,label:n,type:o}=i;if("group"===o){const o=i.elements.map((e=>E(e,t))).filter(e);if(!o?.length)return;l.push(new u({description:r,columnTemplates:o,label:n}))}else{const e=E(i,t);if(!e)return;l.push(e)}})),l}function E(e,i){const{description:t,label:l,type:r}=e;if("field"===r){const r=e.fieldName??void 0,n=i.findIndex((e=>e.field&&e.field===r)),o=n>-1?i.at(n)?.order:void 0;return new c({description:t,direction:o,fieldName:r,initialSortPriority:n,label:l})}return"attachment"===r?new a({description:t,label:l}):"relationship"===r?new h({description:t,label:l,relationshipId:e.relationshipId}):void 0}function F(i){const t=[];return i.forEach((i=>{const{hidden:l}=i;if(d(i)){if(l)return;const r=i.columns?.map((e=>N(e))).filter(e);if(!r?.length)return;t.push(new n({elements:r}))}else{const e=N(i);if(!e)return;t.push(e)}})),t}function N(e){const{fieldName:i,hidden:t}=e;if(m(e)){if(!t)return new r({fieldName:i})}else if(p(e)){if(!t)return new o({relationshipId:e.relationshipId})}else if(f(e)&&!t)return new l}async function x({layer:e,excludeAttachments:n,excludeRelationships:s,excludedFieldTypesOverride:a}){const d=[],m=[];if(!e||!w(e))return new t;await e.load();const p=i(e,{...a&&{ignoreFieldTypes:a},sortDisabled:!0});for(const{visible:i,fieldName:t}of p)i&&d.push(new r({fieldName:t}));return y(e)&&!0!==n&&d.push(new l),T(e)&&!0!==s&&e.relationships?.forEach((e=>{d.push(new o({relationshipId:e.id}))})),new t({elements:d,orderByFields:m})}async function A(e){const{excludeAttachments:t,excludeRelationships:l,layer:r,excludedFieldTypesOverride:n}=e,o=[];await r.load();return i(r,{...n&&{ignoreFieldTypes:n},sortDisabled:!0}).forEach((({fieldName:e,format:i,label:t,visible:l})=>{null!=e&&o.push(new c({fieldName:e,format:i,label:t,visible:l}))})),y(r)&&!0!==t&&o.push(new a),T(r)&&!0!==l&&r.relationships?.forEach((({id:e})=>{o.push(new h({relationshipId:e}))})),new b({columnTemplates:o})}async function I(e){const{layer:t,template:l,includeHiddenFields:r,excludedFieldTypesOverride:n}=e,o=l.orderByFields??[],s=v(l.elements,o);if(r){await t.load();i(t,{...n&&{ignoreFieldTypes:n},sortDisabled:!0}).forEach((e=>{if(!e.fieldName)return;const{fieldName:i,label:t}=e;if(!j(i,s)){const e=o.findIndex((e=>e.field&&e.field===i)),l=e>-1?o.at(e)?.order:void 0;s.push(new c({direction:l,fieldName:i,initialSortPriority:e,label:t,visible:!1}))}})),y(t)&&!s.some((e=>"attachment"===e.type))&&s.push(new a({visible:!1})),T(t)&&t.relationships?.forEach((({id:e})=>{s.some((i=>"relationship"===i.type&&i.relationshipId===e))||s.push(new h({relationshipId:e,visible:!1}))}))}return new b({columnTemplates:s})}function g(e,i,t=!0){const{allColumns:l,columns:r}=e,n=[],o=F(r.toArray());e.activeSortOrders.forEach((({fieldName:e,direction:i})=>{e&&i&&n.push(new s({field:e,order:i}))}));return l.filter((e=>null!=e.direction&&(!e.hidden||t))).forEach((({fieldName:e,direction:i})=>{const t=n.find((i=>i.field===e));i&&!t&&n.push(new s({field:e,order:i}))})),i.elements=o,i.orderByFields=n,i}export{F as createAttributeTableElements,x as createAttributeTableTemplateFromLayer,v as createColumnTemplates,N as createNestedAttributeTableElement,E as createNestedColumnTemplate,I as createTableTemplateFromAttributeTableTemplate,A as createTableTemplateFromLayer,g as syncAttributeTableTemplateWithTable};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Color.js";import{getColorLuminance as t}from"../../../core/colorUtils.js";import{round as l,numDigits as o,percentChange as i}from"../../../renderers/support/numberUtils.js";import{updateReferenceSizeSymbol as n}from"../../../smartMapping/renderers/support/referenceSizeUtils.js";import{updateSpikeSymbol as r}from"../../../smartMapping/renderers/support/spikeUtils.js";import s from"../../../symbols/SimpleLineSymbol.js";import a from"../../../symbols/SimpleMarkerSymbol.js";import{applyCIMSymbolColor as u}from"../../../symbols/support/cimSymbolUtils.js";import{getCIMSymbolPreviewSize as c}from"../../../symbols/support/previewCIMSymbol.js";import{isSymbol3D as m}from"../../../symbols/support/typeUtils.js";import{isVolumetricSymbol as p,getSymbolOutlineSize as f}from"../../../symbols/support/utils.js";import{getAuthoringInfoVisualVariableByTheme as y,getSymbolForFlowRenderer as b,createStopLabel as d}from"./utils.js";import"../../support/widgetUtils.js";import{isDarkMode as h}from"../../../support/modeUtils.js";const w=30,S=12,g=24,v=[255,255,255],z=[200,200,200],k=[128,128,128],j=20,I=5;function V(e){return"esri.symbols.SimpleMarkerSymbol"===e.declaredClass}function x(e){return"esri.symbols.PictureMarkerSymbol"===e.declaredClass}function M(e){return"esri.symbols.SimpleLineSymbol"===e.declaredClass}function U(e){return"esri.symbols.TextSymbol"===e.declaredClass}function C(e,t){const l=e.length-1;return e.map(((e,o)=>d(e,o,l,t)))}async function L(e,t,o,i,n,r,s){const a=t.legendOptions,u=a?.customValues,m=s||await B(e,o),b=t.stops,d=!!m,h=!!u,w=null!=t.minSize&&null!=t.maxSize,S=b&&b.length>1,v=!!t.target;if(!d||!h&&!(w||S&&!v))return;const z=p(m);let k=!1,j=null,I=null;j=z&&!S?l([t.minDataValue,t.maxDataValue]):u??await H(t,m,i,n?.type);const V=e?.authoringInfo,x="univariate-color-size"===V?.type,M=x&&"above-and-below"===V?.univariateTheme,U=!!y(e,"reference-size"),L=!!y(e,"spike");if(!j&&S&&(j=b.map((e=>e.value)),k=b.some((e=>!!e.label)),"flow"===e.type&&(j=l(j)),k&&(I=b.map((e=>e.label)))),z&&null!=j&&j?.length>2&&!M&&(j=[j[0],j[j.length-1]]),!j)return null;x&&5!==j?.length&&(j=O({minSize:j[0],maxSize:j[j.length-1]}));const T=z?D(e,j):null,q=f(m),E=k?null:C(j,r),P=await Promise.all(j.map((async(l,o)=>{let r=z?T[o]:await G(t,m,l,i,n?.type),s=r;const a=J(m,r,e,o);U&&(r*=g/t.maxSize||1,s=g),L&&"cim"===a.type&&(s=await c(a));return{value:l,symbol:a,label:k?I[o]:E[o],size:s,outlineSize:q}})));return P.reverse()}function D(e,t){const l=e?.authoringInfo,o="univariate-color-size"===l?.type;let i=[S,w];if(o){const e=t[0],l=t[t.length-1],o=S,n=w;i=t.map((t=>o+(t-e)/(l-e)*(n-o)))}return o&&"below"===l?.univariateTheme&&i.reverse(),i}function T(t,l,o,i){const r="class-breaks"===t.type,s=r?t.classBreakInfos?.[0]?.symbol?.clone():t.uniqueValueInfos?.[0]?.symbol?.clone();return s&&"type"in s&&"cim"===s.type?(n(s,{color:i??(r?null:new e(z)),innerDotSize:l*(g/o)||1,outerRingSize:g}),s):null}function q(e,t){const l=e.classBreakInfos,o=l.length,i=o<2||!(t>=2)?l[0].symbol.clone():l[o-1].symbol.clone(),n=e.visualVariables?.some((e=>"color"===e.type));return n&&(i.type.includes("3d")?P(i):R(i)),i}async function B(l,o){if("flow"===l.type)return b(l,o);if("pie-chart"===l.type)return new a({color:null,outline:l.outline?.width?l.outline:new s});let i=null,u=null;if("simple"===l.type)i=l.symbol;else if("class-breaks"===l.type){const e=l.classBreakInfos;i=e&&e[0]&&e[0].symbol,u=e.length>1}else if("unique-value"===l.type){const e=l.uniqueValueInfos;i=e?.[0]?.symbol,u=null!=e&&e.length>1}if(!i||E(i))return null;if(i=i.clone(),o||u)if(i.type.includes("3d"))P(i);else if(y(l,"reference-size")&&"cim"===i.type)n(i,{color:o??("class-breaks"!==l.type?new e(z):null)});else if(y(l,"spike")&&"cim"===i.type){const l=new e(z),n=new e(k),s="CIMPointSymbol"===i.data.symbol?.type?i.data.symbol:null,a=!!s?.symbolLayers?.find((({type:e})=>"CIMSolidStroke"===e))?.colorLocked;let u,c=o??void 0;if(c){const e=t(c),o=h();(!o&&e>225||o&&e<25)&&(c=l,u=a?n:l)}else c=l,u=a?n:l;r(i,{color:c,strokeColor:u})}else R(i);return i}function E(e){return m(e)?e.symbolLayers?.some((e=>"fill"===e?.type))??!1:e?.type.includes("fill")??!1}function P(e){"line-3d"===e.type?e.symbolLayers.forEach((e=>{e.material={color:k}})):e.symbolLayers.forEach((e=>{"icon"!==e.type||e.resource?.href?e.material={color:z}:(e.material={color:v},e.outline={color:k,size:1.5})}))}function R(t){const l=h();if("cim"===t.type)u(t,new e(z));else if(t.type.includes("line"))t.color=k;else if(t.color=l?k:v,"simple-marker"===t.type)if(t.outline){const e=t.outline?.color?.toHex();"#ffffff"===e&&(t.outline.color=k)}else t.outline={color:k,width:1.5}}async function H(e,t,o,i){const n=(await import("../../../renderers/visualVariables/support/visualVariableUtils.js")).getSizeRangeAtScale(e,o,i),r=n&&O(n);if(!n||!r)return;let s=r.map((t=>A(t,e,n)));s=l(s);for(let l=1;l<s.length-1;l++){const n=await F(e,t,s[l],s[l-1],o,i);n&&(s[l]=n[0],r[l]=n[1])}return s}function O(e){const t=e.minSize,l=e.maxSize,o=I,i=(l-t)/(o-1),n=[];for(let r=0;r<o;r++)n.push(t+i*r);return n}function A(e,t,l){const o=l.minSize,i=l.maxSize,n=t.minDataValue,r=t.maxDataValue;let s;if(e<=o)s=n;else if(e>=i)s=r;else{s=(e-o)/(i-o)*(r-n)+n}return s}async function F(e,t,n,r,s,a){const u=await G(e,t,n,s,a),c=await G(e,t,r,s,a),m=o(n),p=m.fractional,f=j;let y=m.integer,b=null,d=null;n>0&&n<1&&(b=10**p,y=o(n*=b).integer);for(let o=y-1;o>=0;o--){const r=10**o;let m=Math.floor(n/r)*r,p=Math.ceil(n/r)*r;null!=b&&(m/=b,p/=b);let y=(m+p)/2;[,y]=l([m,y,p],{indexes:[1]});const h=await G(e,t,m,s,a),w=await G(e,t,p,s,a),S=await G(e,t,y,s,a),g=i(u,h,c,null),v=i(u,w,c,null),z=i(u,S,c,null);let k=g.previous<=f,j=v.previous<=f;if(k&&j&&(g.previous<=v.previous?(k=!0,j=!1):(j=!0,k=!1)),k?d=[m,h]:j?d=[p,w]:z.previous<=f&&(d=[y,S]),d)break}return d}async function G(e,t,l,o,i){const{getSize:n}=await import("../../../renderers/visualVariables/support/visualVariableUtils.js");return n(e,l,{scale:o,view:i,shape:"simple-marker"===t.type?t.style:null})}function J(e,t,l,o){"univariate-color-size"===l?.authoringInfo?.type&&"above-and-below"===l?.authoringInfo?.univariateTheme&&"class-breaks"===l.type&&(e=q(l,o));const i=e.clone();if(m(i))p(i)||i.symbolLayers.forEach((e=>{"fill"!==e.type&&(e.size=t)}));else if(V(i))i.size=t;else if(x(i)){const e=i.width,l=i.height;i.height=t,i.width=t*(e/l)}else M(i)?i.width=t:U(i)?i.font&&(i.font.size=t):"cim"===i.type&&y(l,"reference-size")?n(i,{innerDotSize:t,outerRingSize:g}):"cim"===i.type&&y(l,"spike")&&r(i,{defaultHeight:t,primitiveOverrides:null});return i}export{L as getRampStops,T as getReferenceSizeSymbol,w as realWorldMaxSize,S as realWorldMinSize};
5
+ import e from"../../../Color.js";import{getColorLuminance as t}from"../../../core/colorUtils.js";import{round as l,numDigits as o,percentChange as i}from"../../../renderers/support/numberUtils.js";import{updateReferenceSizeSymbol as n}from"../../../smartMapping/renderers/support/referenceSizeUtils.js";import{updateSpikeSymbol as r}from"../../../smartMapping/renderers/support/spikeUtils.js";import s from"../../../symbols/SimpleLineSymbol.js";import a from"../../../symbols/SimpleMarkerSymbol.js";import{applyCIMSymbolColor as u}from"../../../symbols/support/cimSymbolUtils.js";import{getCIMSymbolPreviewSize as c}from"../../../symbols/support/previewCIMSymbol.js";import{isSymbol3D as m}from"../../../symbols/support/typeUtils.js";import{isVolumetricSymbol as p,getSymbolOutlineSize as f}from"../../../symbols/support/utils.js";import{getAuthoringInfoVisualVariableByTheme as y,getSymbolForFlowRenderer as b,createStopLabel as d}from"./utils.js";import"../../support/widgetUtils.js";import{isDarkMode as h}from"../../../support/modeUtils.js";const w=30,S=12,g=24,v=[255,255,255],z=[200,200,200],k=[128,128,128],j=20,I=5;function V(e){return"esri.symbols.SimpleMarkerSymbol"===e.declaredClass}function x(e){return"esri.symbols.PictureMarkerSymbol"===e.declaredClass}function M(e){return"esri.symbols.SimpleLineSymbol"===e.declaredClass}function U(e){return"esri.symbols.TextSymbol"===e.declaredClass}function C(e,t){const l=e.length-1;return e.map(((e,o)=>d(e,o,l,t)))}async function L(e,t,o,i,n,r,s){const a=t.legendOptions,u=a?.customValues,m=s||await B(e,o),b=t.stops,d=!!m,h=!!u,w=null!=t.minSize&&null!=t.maxSize,S=b&&b.length>1,v=!!t.target;if(!d||!h&&!(w||S&&!v))return;const z=p(m);let k=!1,j=null,I=null;j=z&&!S?l([t.minDataValue,t.maxDataValue]):u??await H(t,m,i,n?.type);const V=e?.authoringInfo,x="univariate-color-size"===V?.type,M=x&&"above-and-below"===V?.univariateTheme,U=!!y(e,"reference-size"),L=!!y(e,"spike");if(!j&&S&&(j=b.map((e=>e.value)),k=b.some((e=>!!e.label)),"flow"===e.type&&(j=l(j)),k&&(I=b.map((e=>e.label)))),z&&null!=j&&j?.length>2&&!M&&(j=[j[0],j[j.length-1]]),!j)return null;x&&5!==j?.length&&(j=O({minSize:j[0],maxSize:j[j.length-1]}));const T=z?D(e,j):null,q=f(m),E=k?null:C(j,r),P=await Promise.all(j.map((async(l,o)=>{let r=z?T[o]:await G(t,m,l,i,n?.type),s=r;U&&(r*=g/t.maxSize||1,s=g);const a=J(m,r,e,o);L&&"cim"===a.type&&(s=await c(a));return{value:l,symbol:a,label:k?I[o]:E[o],size:s,outlineSize:q}})));return P.reverse()}function D(e,t){const l=e?.authoringInfo,o="univariate-color-size"===l?.type;let i=[S,w];if(o){const e=t[0],l=t[t.length-1],o=S,n=w;i=t.map((t=>o+(t-e)/(l-e)*(n-o)))}return o&&"below"===l?.univariateTheme&&i.reverse(),i}function T(t,l,o,i){const r="class-breaks"===t.type,s=r?t.classBreakInfos?.[0]?.symbol?.clone():t.uniqueValueInfos?.[0]?.symbol?.clone();return s&&"type"in s&&"cim"===s.type?(n(s,{color:i??(r?null:new e(z)),innerDotSize:l*(g/o)||1,outerRingSize:g}),s):null}function q(e,t){const l=e.classBreakInfos,o=l.length,i=o<2||!(t>=2)?l[0].symbol.clone():l[o-1].symbol.clone(),n=e.visualVariables?.some((e=>"color"===e.type));return n&&(i.type.includes("3d")?P(i):R(i)),i}async function B(l,o){if("flow"===l.type)return b(l,o);if("pie-chart"===l.type)return new a({color:null,outline:l.outline?.width?l.outline:new s});let i=null,u=null;if("simple"===l.type)i=l.symbol;else if("class-breaks"===l.type){const e=l.classBreakInfos;i=e&&e[0]&&e[0].symbol,u=e.length>1}else if("unique-value"===l.type){const e=l.uniqueValueInfos;i=e?.[0]?.symbol,u=null!=e&&e.length>1}if(!i||E(i))return null;if(i=i.clone(),o||u)if(i.type.includes("3d"))P(i);else if(y(l,"reference-size")&&"cim"===i.type)n(i,{color:o??("class-breaks"!==l.type?new e(z):null)});else if(y(l,"spike")&&"cim"===i.type){const l=new e(z),n=new e(k),s="CIMPointSymbol"===i.data.symbol?.type?i.data.symbol:null,a=!!s?.symbolLayers?.find((({type:e})=>"CIMSolidStroke"===e))?.colorLocked;let u,c=o??void 0;if(c){const e=t(c),o=h();(!o&&e>225||o&&e<25)&&(c=l,u=a?n:l)}else c=l,u=a?n:l;r(i,{color:c,strokeColor:u})}else R(i);return i}function E(e){return m(e)?e.symbolLayers?.some((e=>"fill"===e?.type))??!1:e?.type.includes("fill")??!1}function P(e){"line-3d"===e.type?e.symbolLayers.forEach((e=>{e.material={color:k}})):e.symbolLayers.forEach((e=>{"icon"!==e.type||e.resource?.href?e.material={color:z}:(e.material={color:v},e.outline={color:k,size:1.5})}))}function R(t){const l=h();if("cim"===t.type)u(t,new e(z));else if(t.type.includes("line"))t.color=k;else if(t.color=l?k:v,"simple-marker"===t.type)if(t.outline){const e=t.outline?.color?.toHex();"#ffffff"===e&&(t.outline.color=k)}else t.outline={color:k,width:1.5}}async function H(e,t,o,i){const n=(await import("../../../renderers/visualVariables/support/visualVariableUtils.js")).getSizeRangeAtScale(e,o,i),r=n&&O(n);if(!n||!r)return;let s=r.map((t=>A(t,e,n)));s=l(s);for(let l=1;l<s.length-1;l++){const n=await F(e,t,s[l],s[l-1],o,i);n&&(s[l]=n[0],r[l]=n[1])}return s}function O(e){const t=e.minSize,l=e.maxSize,o=I,i=(l-t)/(o-1),n=[];for(let r=0;r<o;r++)n.push(t+i*r);return n}function A(e,t,l){const o=l.minSize,i=l.maxSize,n=t.minDataValue,r=t.maxDataValue;let s;if(e<=o)s=n;else if(e>=i)s=r;else{s=(e-o)/(i-o)*(r-n)+n}return s}async function F(e,t,n,r,s,a){const u=await G(e,t,n,s,a),c=await G(e,t,r,s,a),m=o(n),p=m.fractional,f=j;let y=m.integer,b=null,d=null;n>0&&n<1&&(b=10**p,y=o(n*=b).integer);for(let o=y-1;o>=0;o--){const r=10**o;let m=Math.floor(n/r)*r,p=Math.ceil(n/r)*r;null!=b&&(m/=b,p/=b);let y=(m+p)/2;[,y]=l([m,y,p],{indexes:[1]});const h=await G(e,t,m,s,a),w=await G(e,t,p,s,a),S=await G(e,t,y,s,a),g=i(u,h,c,null),v=i(u,w,c,null),z=i(u,S,c,null);let k=g.previous<=f,j=v.previous<=f;if(k&&j&&(g.previous<=v.previous?(k=!0,j=!1):(j=!0,k=!1)),k?d=[m,h]:j?d=[p,w]:z.previous<=f&&(d=[y,S]),d)break}return d}async function G(e,t,l,o,i){const{getSize:n}=await import("../../../renderers/visualVariables/support/visualVariableUtils.js");return n(e,l,{scale:o,view:i,shape:"simple-marker"===t.type?t.style:null})}function J(e,t,l,o){"univariate-color-size"===l?.authoringInfo?.type&&"above-and-below"===l?.authoringInfo?.univariateTheme&&"class-breaks"===l.type&&(e=q(l,o));const i=e.clone();if(m(i))p(i)||i.symbolLayers.forEach((e=>{"fill"!==e.type&&(e.size=t)}));else if(V(i))i.size=t;else if(x(i)){const e=i.width,l=i.height;i.height=t,i.width=t*(e/l)}else M(i)?i.width=t:U(i)?i.font&&(i.font.size=t):"cim"===i.type&&y(l,"reference-size")?n(i,{innerDotSize:t,outerRingSize:g}):"cim"===i.type&&y(l,"spike")&&r(i,{defaultHeight:t,primitiveOverrides:null});return i}export{L as getRampStops,T as getReferenceSizeSymbol,w as realWorldMaxSize,S as realWorldMinSize};