@arcgis/core 4.33.0-next.20250401 → 4.33.0-next.20250403

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 (116) hide show
  1. package/applications/SceneViewer/sceneViewerUtils.d.ts +1 -0
  2. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  3. package/arcade/functions/knowledgegraph.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/0cd5f15b8558b23e5fcd.js +1 -0
  6. package/assets/esri/core/workers/chunks/0cec53e6f1464c69448d.js +1 -0
  7. package/assets/esri/core/workers/chunks/48fbf887da6d19838bf0.js +1 -0
  8. package/assets/esri/core/workers/chunks/{ba4d91816f6a0bf0d812.js → 4dc135e0133d58a06d67.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{322cb1b1871d03b69f0a.js → 5beb525b4adde1d98532.js} +33 -33
  10. package/assets/esri/core/workers/chunks/{3577909b8e84959d415b.js → 6a8cf1f51cc4adc268d3.js} +1 -1
  11. package/assets/esri/core/workers/chunks/6b0a6469673417563616.js +1 -0
  12. package/assets/esri/core/workers/chunks/{bdeac9196f28aff93e68.js → 93d06a1a0b700ddb3807.js} +1 -1
  13. package/assets/esri/core/workers/chunks/b28b699de6deb7e9fa53.js +1 -0
  14. package/assets/esri/core/workers/chunks/{1a5f96b1b892ecceb36a.js → b4a1f3f3a036226d6810.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{738e4f46feb3758456e0.js → baa9fd23414f03ef90bc.js} +1 -1
  16. package/assets/esri/core/workers/chunks/c977a47cabc419610277.js +1 -0
  17. package/assets/esri/core/workers/chunks/{7e00122014d0a55363a8.js → ccb289911e7445b17763.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{e2029267cddb8e2effab.js → d58fae2fc9d148e015ae.js} +1 -1
  19. package/core/sql/WhereClause.js +1 -1
  20. package/core/typedArrayUtil.js +1 -1
  21. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  22. package/geometry/Polygon.js +1 -1
  23. package/geometry/support/buffer/BufferView.js +1 -1
  24. package/geometry/support/buffer/internals/Vec2.js +1 -1
  25. package/interfaces.d.ts +112 -27
  26. package/layers/graphics/data/QueryEngineResult.js +1 -1
  27. package/layers/support/VideoElement.js +1 -1
  28. package/package.json +1 -1
  29. package/support/revision.js +1 -1
  30. package/symbols/support/ElevationInfo.js +1 -1
  31. package/undoredo/support/Services.js +1 -1
  32. package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
  33. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  34. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  35. package/views/2d/layers/StreamLayerView2D.js +1 -1
  36. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  37. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  38. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  39. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  40. package/views/3d/layers/DrapedSubView3D.js +1 -1
  41. package/views/3d/layers/I3SMeshView3D.js +1 -1
  42. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  43. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  44. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  45. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  46. package/views/3d/layers/i3s/I3SQueryFeatureStore.js +1 -1
  47. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  48. package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
  49. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  50. package/views/3d/terrain/PatchGeometry.js +1 -1
  51. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  52. package/views/3d/terrain/TerrainAttributes.js +1 -1
  53. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +3 -3
  54. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  55. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  56. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  57. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  58. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  59. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  60. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  61. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  62. package/views/3d/webgl-engine/lib/ChangeSet.js +1 -1
  63. package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
  64. package/views/3d/webgl-engine/lib/ITexture.js +1 -1
  65. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  66. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  67. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  68. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  69. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  70. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  71. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  72. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  73. package/views/3d/webgl-engine/lib/TextureUpdater.js +5 -0
  74. package/views/3d/webgl-engine/lib/rendererUtils.js +1 -1
  75. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  76. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  77. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  78. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  79. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  80. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  81. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  82. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  83. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  84. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  85. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  86. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  87. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  88. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  89. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  90. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  91. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  92. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  93. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  94. package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
  95. package/views/interactive/snapping/FeatureSnappingSourceInfo.js +1 -1
  96. package/views/layers/PointCloudLayerView.d.ts +1 -1
  97. package/views/layers/PointCloudLayerView.js +5 -0
  98. package/views/webgl/renderState.js +1 -1
  99. package/views/webgl/testFloatBufferBlend.js +1 -1
  100. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  101. package/widgets/Editor/UpdateWorkflow.js +1 -1
  102. package/widgets/Editor/workflowUtils.js +1 -1
  103. package/widgets/Editor.js +1 -1
  104. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  105. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  106. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  107. package/widgets/FeatureForm.js +1 -1
  108. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  109. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  110. package/widgets/support/GridControls.js +1 -1
  111. package/assets/esri/core/workers/chunks/093421648cc61afdeb3c.js +0 -1
  112. package/assets/esri/core/workers/chunks/4816cf647eca2f4cecc2.js +0 -1
  113. package/assets/esri/core/workers/chunks/8725580f6d2a495051b5.js +0 -1
  114. package/assets/esri/core/workers/chunks/a56da688088404259481.js +0 -1
  115. package/assets/esri/core/workers/chunks/e6469173c65531d6524a.js +0 -1
  116. package/assets/esri/core/workers/chunks/e9e517a2141e504eec64.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{d as e,l as t,h 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,BufferViewVec4f16 as n,BufferViewVec4f as c,BufferViewFloat as l,BufferViewVec2i16 as d,BufferViewVec2f16 as u,BufferViewVec3f as a}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as p}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 g(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 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){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 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){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 O(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 h(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 S(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 I(e,t,f,r,i=1){if(!t)return void m(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],y=t[4],B=t[5],g=t[6],b=t[8],O=t[9],h=t[10],S=t[12],I=t[13],N=t[14];r*=l;let R=0,F=0,E=0;const v=o(t)?e=>{R=s[e]+S,F=s[e+1]+I,E=s[e+2]+N}:e=>{const t=s[e],f=s[e+1],r=s[e+2];R=u*t+y*f+b*r+S,F=a*t+B*f+O*r+I,E=p*t+g*f+h*r+N};if(1===i)for(let o=0;o<d;++o)v(3*n[o]),c[r]=R,c[r+1]=F,c[r+2]=E,r+=l;else for(let o=0;o<d;++o){v(3*n[o]);for(let e=0;e<i;++e)c[r]=R,c[r+1]=F,c[r+2]=E,r+=l}}function N(e,t,f,r,s=1){if(!t)return void m(e,f,r,s);const{data:n,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],y=l[1],B=l[2],g=l[4],b=l[5],O=l[6],h=l[8],S=l[9],I=l[10],N=!i(l),R=1e-6,F=1-R;r*=u;let E=0,v=0,z=0;const A=o(l)?e=>{E=n[e],v=n[e+1],z=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];E=p*t+g*f+h*r,v=y*t+b*f+S*r,z=B*t+O*f+I*r};if(1===s)if(N)for(let o=0;o<a;++o){A(3*c[o]);const e=E*E+v*v+z*z;if(e<F&&e>R){const t=1/Math.sqrt(e);d[r]=E*t,d[r+1]=v*t,d[r+2]=z*t}else d[r]=E,d[r+1]=v,d[r+2]=z;r+=u}else for(let o=0;o<a;++o)A(3*c[o]),d[r]=E,d[r+1]=v,d[r+2]=z,r+=u;else for(let o=0;o<a;++o){if(A(3*c[o]),N){const e=E*E+v*v+z*z;if(e<F&&e>R){const t=1/Math.sqrt(e);E*=t,v*=t,z*=t}}for(let e=0;e<s;++e)d[r]=E,d[r+1]=v,d[r+2]=z,r+=u}}function R(e,t,f,r,o=1){if(!t)return void b(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],y=c[2],B=c[4],g=c[5],m=c[6],O=c[8],h=c[9],S=c[10],I=!i(c),N=1e-6,R=1-N;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+O*o,b=p*t+g*f+h*o,F=y*t+m*f+S*o;if(I){const e=u*u+b*b+F*F;if(e<R&&e>N){const t=1/Math.sqrt(e);u*=t,b*=t,F*=t}}l[r]=u,l[r+1]=b,l[r+2]=F,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 b=a*t+B*f+O*c,F=p*t+g*f+h*c,E=y*t+m*f+S*c;if(I){const e=b*b+F*F+E*E;if(e<R&&e>N){const t=1/Math.sqrt(e);b*=t,F*=t,E*=t}}for(let i=0;i<o;++i)l[r]=b,l[r+1]=F,l[r+2]=E,l[r+3]=u,r+=d}}function F(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 E(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(z,r,o);const n=Math.sqrt(t(z));n>0&&f(z,z,1/n),i[s++]=z[0],i[s++]=z[1],i[s++]=z[2],i[s++]=n}const z=r();function A(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===y.POSITION&&(c={numItems:1,numVerticesPerItem:d.length}),T(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;A(t,i.getField(l,s),e,n)}}}return c}function T(e,t,f,r,o,i){switch(e){case y.POSITION:{p(3===t.size);const r=o.getField(e,a);p(!!r,`No buffer view for ${e}`),r&&I(t,f,r,i);break}case y.NORMAL:{p(3===t.size);const f=o.getField(e,a);p(!!f,`No buffer view for ${e}`),f&&N(t,r,f,i);break}case y.NORMALCOMPRESSED:case y.PROFILERIGHT:case y.PROFILEUP:{p(2===t.size);const f=o.getField(e,d);p(!!f,`No buffer view for ${e}`),f&&g(t,f,i);break}case y.UV0:case y.PROFILEAUXDATA:{p(2===t.size);const f=o.getField(e,u);p(!!f,`No buffer view for ${e}`),f&&g(t,f,i);break}case y.UVI:{p(2===t.size);const f=o.getField(e,d);p(!!f,`No buffer view for ${e}`),f&&g(t,f,i);break}case y.COLOR:case y.SYMBOLCOLOR:{const f=o.getField(e,s);p(!!f,`No buffer view for ${e}`),p(3===t.size||4===t.size),!f||3!==t.size&&4!==t.size||F(t,t.size,f,i);break}case y.COLORFEATUREATTRIBUTE:{const f=o.getField(e,l);p(!!f,`No buffer view for ${e}`),p(1===t.size),f&&1===t.size&&E(t,f,i);break}case y.TANGENT:{p(4===t.size);const r=o.getField(e,c);p(!!r,`No buffer view for ${e}`),r&&R(t,f,r,i);break}case y.PROFILEVERTEXANDNORMAL:case y.FEATUREVALUE:{p(4===t.size);const f=o.getField(e,n);p(!!f,`No buffer view for ${e}`),f&&b(t,f,i)}}}export{B as writeBufferFloat,h as writeBufferMat3f,S as writeBufferMat4f,g as writeBufferVec2,m as writeBufferVec3,b as writeBufferVec4,O as writeBufferVec4Zeros,F as writeColor,E as writeColorFeatureAttribute,T as writeDefaultAttribute,L as writeDefaultAttributes,v as writeDeltaF16Vector,N as writeNormal,A as writeOlidColor,I as writePosition,R as writeTangent};
5
+ import{isFloat16Array as e}from"@petamoriken/float16";import{d as t,l as f,h as r}from"../../../../../chunks/vec32.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasIdentityRotation as i,isOrthoNormal as n}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as s,BufferViewVec3f16 as c,BufferViewVec3f as l,BufferViewVec4f16 as d,BufferViewVec4f as u,BufferViewFloat as a,BufferViewVec2i16 as p,BufferViewVec2f16 as y}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as B}from"../../lib/Util.js";import{VertexAttribute as b}from"../../lib/VertexAttribute.js";function g(e,t,f,r=1){const{data:o,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===r)for(let l=0;l<c;++l)n[f]=o[i[l]],f+=s;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)n[f]=e,f+=s}}function m(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,n=t.typedBufferStride,s=o.length;f*=n;for(let c=0;c<s;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=n}}function h(t,f,r){const{data:o,indices:i}=t;if(!e(o))return m(t,f,r);const n=i.length,s=new Float32Array(f.typedBuffer.buffer,f.start),c=new Float32Array(o.buffer),l=f.typedBufferStride/2;r*=l;for(let e=0;e<n;++e){const t=2*i[e];s[r]=c[t],r+=l}}function O(e,t,f,r=1){const{data:o,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===r)for(let l=0;l<c;++l){const e=3*i[l];n[f]=o[e],n[f+1]=o[e+1],n[f+2]=o[e+2],f+=s}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)n[f]=o[e],n[f+1]=o[e+1],n[f+2]=o[e+2],f+=s}}function F(e,t,f,r=1){const{data:o,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===r)for(let l=0;l<c;++l){const e=4*i[l];n[f]=o[e],n[f+1]=o[e+1],n[f+2]=o[e+2],n[f+3]=o[e+3],f+=s}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)n[f]=o[e],n[f+1]=o[e+1],n[f+2]=o[e+2],n[f+3]=o[e+3],f+=s}}function S(t,f,r){const{data:o,indices:i}=t;if(!e(o))return F(t,f,r);const n=i.length,s=new Float32Array(f.typedBuffer.buffer,f.start),c=new Float32Array(o.buffer),l=f.typedBufferStride/2;r*=l;for(let e=0;e<n;++e){const t=2*i[e];s[r]=c[t],s[r+1]=c[t+1],r+=l}}function N(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 w(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,n=t.typedBufferStride,s=o.length;f*=n;for(let c=0;c<s;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=n}}function A(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,n=t.typedBufferStride,s=o.length;f*=n;for(let c=0;c<s;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=n}}function I(e,t,f,r,o=1){if(!t)return void O(e,f,r,o);const{data:n,indices:s}=e,c=f.typedBuffer,l=f.typedBufferStride,d=s.length,u=t[0],a=t[1],p=t[2],y=t[4],B=t[5],b=t[6],g=t[8],m=t[9],h=t[10],F=t[12],S=t[13],N=t[14];r*=l;let w=0,A=0,I=0;const R=i(t)?e=>{w=n[e]+F,A=n[e+1]+S,I=n[e+2]+N}:e=>{const t=n[e],f=n[e+1],r=n[e+2];w=u*t+y*f+g*r+F,A=a*t+B*f+m*r+S,I=p*t+b*f+h*r+N};if(1===o)for(let i=0;i<d;++i)R(3*s[i]),c[r]=w,c[r+1]=A,c[r+2]=I,r+=l;else for(let i=0;i<d;++i){R(3*s[i]);for(let e=0;e<o;++e)c[r]=w,c[r+1]=A,c[r+2]=I,r+=l}}function R(e,t,f,r,o=1){if(!t)return void O(e,f,r,o);const{data:s,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],y=l[1],B=l[2],b=l[4],g=l[5],m=l[6],h=l[8],F=l[9],S=l[10],N=!n(l),w=1e-6,A=1-w;r*=u;let I=0,R=0,v=0;const z=i(l)?e=>{I=s[e],R=s[e+1],v=s[e+2]}:e=>{const t=s[e],f=s[e+1],r=s[e+2];I=p*t+b*f+h*r,R=y*t+g*f+F*r,v=B*t+m*f+S*r};if(1===o)if(N)for(let i=0;i<a;++i){z(3*c[i]);const e=I*I+R*R+v*v;if(e<A&&e>w){const t=1/Math.sqrt(e);d[r]=I*t,d[r+1]=R*t,d[r+2]=v*t}else d[r]=I,d[r+1]=R,d[r+2]=v;r+=u}else for(let i=0;i<a;++i)z(3*c[i]),d[r]=I,d[r+1]=R,d[r+2]=v,r+=u;else for(let i=0;i<a;++i){if(z(3*c[i]),N){const e=I*I+R*R+v*v;if(e<A&&e>w){const t=1/Math.sqrt(e);I*=t,R*=t,v*=t}}for(let e=0;e<o;++e)d[r]=I,d[r+1]=R,d[r+2]=v,r+=u}}function v(e,t,f,r,o=1){if(!t)return void F(e,f,r,o);const{data:i,indices:s}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=s.length,a=c[0],p=c[1],y=c[2],B=c[4],b=c[5],g=c[6],m=c[8],h=c[9],O=c[10],S=!n(c),N=1e-6,w=1-N;if(r*=d,1===o)for(let n=0;n<u;++n){const e=4*s[n],t=i[e],f=i[e+1],o=i[e+2],c=i[e+3];let u=a*t+B*f+m*o,F=p*t+b*f+h*o,A=y*t+g*f+O*o;if(S){const e=u*u+F*F+A*A;if(e<w&&e>N){const t=1/Math.sqrt(e);u*=t,F*=t,A*=t}}l[r]=u,l[r+1]=F,l[r+2]=A,l[r+3]=c,r+=d}else for(let n=0;n<u;++n){const e=4*s[n],t=i[e],f=i[e+1],c=i[e+2],u=i[e+3];let F=a*t+B*f+m*c,A=p*t+b*f+h*c,I=y*t+g*f+O*c;if(S){const e=F*F+A*A+I*I;if(e<w&&e>N){const t=1/Math.sqrt(e);F*=t,A*=t,I*=t}}for(let i=0;i<o;++i)l[r]=F,l[r+1]=A,l[r+2]=I,l[r+3]=u,r+=d}}function z(e,t,f,r,o=1){const{data:i,indices:n}=e,s=f.typedBuffer,c=f.typedBufferStride,l=n.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*n[d];for(let t=0;t<o;++t)s[r]=i[e],s[r+1]=i[e+1],s[r+2]=i[e+2],s[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*n[d];for(let t=0;t<o;++t)s[r]=i[e],s[r+1]=i[e+1],s[r+2]=i[e+2],s[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*n[e];s[r]=i[t],s[r+1]=i[t+1],s[r+2]=i[t+2],s[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*n[e];s[r]=i[t],s[r+1]=i[t+1],s[r+2]=i[t+2],s[r+3]=255,r+=c}}else{s[r]=i[0],s[r+1]=i[1],s[r+2]=i[2],s[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,n=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=n,r+=t}}function E(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,n=t.typedBufferStride,s=o.length,c=r[0];f*=n;for(let l=0;l<s;++l)i[f]=c,f+=n}function k(e,o,i,n){t(L,e,o);const s=Math.sqrt(f(L));s>0&&r(L,L,1/s),i[n++]=L[0],i[n++]=L[1],i[n++]=L[2],i[n++]=s}const L=o();function T(e,t,f,r,o=1){const i=t.typedBuffer,n=t.typedBufferStride;if(r*=n,1===o)for(let s=0;s<f;++s)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=n;else for(let s=0;s<f;++s)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+=n}function P(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}),$(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;T(t,i.getField(l,s),e,n)}}}return c}function $(e,t,f,r,o,i){switch(e){case b.POSITION:{B(3===t.size);const r=o.getField(e,l);B(!!r,`No buffer view for ${e}`),r&&I(t,f,r,i);break}case b.NORMAL:{B(3===t.size);const f=o.getField(e,l);B(!!f,`No buffer view for ${e}`),f&&R(t,r,f,i);break}case b.NORMALCOMPRESSED:case b.PROFILERIGHT:case b.PROFILEUP:{B(2===t.size);const f=o.getField(e,p);B(!!f,`No buffer view for ${e}`),f&&m(t,f,i);break}case b.UV0:{B(2===t.size);const f=o.getField(e,y);B(!!f,`No buffer view for ${e}`),f&&h(t,f,i);break}case b.UVI:{B(2===t.size);const f=o.getField(e,p);B(!!f,`No buffer view for ${e}`),f&&m(t,f,i);break}case b.COLOR:case b.SYMBOLCOLOR:{const f=o.getField(e,s);B(!!f,`No buffer view for ${e}`),B(3===t.size||4===t.size),!f||3!==t.size&&4!==t.size||z(t,t.size,f,i);break}case b.COLORFEATUREATTRIBUTE:{const f=o.getField(e,a);B(!!f,`No buffer view for ${e}`),B(1===t.size),f&&1===t.size&&E(t,f,i);break}case b.TANGENT:{B(4===t.size);const r=o.getField(e,u);B(!!r,`No buffer view for ${e}`),r&&v(t,f,r,i);break}case b.PROFILEVERTEXANDNORMAL:{B(4===t.size);const f=o.getField(e,d);B(!!f,`No buffer view for ${e}`),f&&S(t,f,i);break}case b.FEATUREVALUE:{B(3===t.size);const f=o.getField(e,l);B(!!f,`No buffer view for ${e}`),f&&O(t,f,i);break}case b.PROFILEAUXDATA:{B(3===t.size);const f=o.getField(e,c);B(!!f,`No buffer view for ${e}`),f&&O(t,f,i);break}}}export{g as writeBufferFloat,w as writeBufferMat3f,A as writeBufferMat4f,m as writeBufferVec2,h as writeBufferVec2f16,O as writeBufferVec3,F as writeBufferVec4,N as writeBufferVec4Zeros,S as writeBufferVec4f16,z as writeColor,E as writeColorFeatureAttribute,$ as writeDefaultAttribute,P as writeDefaultAttributes,k as writeDeltaF16Vector,R as writeNormal,T as writeOlidColor,I as writePosition,v as writeTangent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{NestedMap as a}from"../../../../../core/NestedMap.js";import o from"../../../../../core/PooledArray.js";import{addMany as n}from"../../../../../core/SetUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as u,invert as f,transpose as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as d}from"../../../support/buffer/glUtil.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as p}from"../../effects/RenderPlugin.js";import{GLMaterials as y}from"../../lib/GLMaterials.js";import{DirtyState as _}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as b}from"../../lib/RenderSlot.js";import{assert as w}from"../../lib/Util.js";import{DrawParameters as v}from"../DrawParameters.js";import{BufferRange as C,mergeAdjacentRanges as O}from"./BufferRange.js";import{Instance as E}from"./Instance.js";import{PerBufferData as A,hasVao as M}from"./PerBufferData.js";import{PerOriginData as B}from"./PerOriginData.js";import{defaultHighlightName as x}from"../../../../support/HighlightDefaults.js";let S=class extends p{get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(e){return this._highlightNames.has(e)}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new v,this._highlightNames=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=s(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this._updateProduces()}_updateProduces(){this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!(0===this._dataByOrigin.size||!(t!==g.Highlight&&t!==g.ShadowHighlight||this._hasHighlights))&&e(t)))}))}initializeRenderContext(e,t){q??=e.renderContext.rctx.isAssumedMetalDriver,this._glMaterials=new y(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,d(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.vao.cachedMemory),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((({geometry:t})=>e(t)))))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}updateHighlights(e){this.highlightOrderMap=e,this._highlightNames.clear(),this._dataByOrigin.forEach((t=>{t.buffers.forEach((t=>{t.updateHighlights(e),t.highlightNames.forEach((e=>this._highlightNames.add(e)))}))})),this._updateProduces()}_updateGeometries(e){const t=this._bufferWriter;if(null==t)return;const r=t.vertexBufferLayout.stride/4;for(const i of e){const e=i.renderGeometry,s=this._dataByOrigin.get(e.localOrigin.id),a=s?.findBuffer(e.id);if(null==a)return;const o=a.instances.get(e.id);if(i.updateType&(_.GEOMETRY|_.TRANSFORMATION)){const i=z(t.elementCount(o.geometry.geometry.attributes)*r),s=t.vertexBufferLayout.createView(i.buffer);this._writeGeometry(e,s,0),a.vao.vertexBuffers.get("geometry").setSubData(i,o.from*r,0,o.numElements*r)}i.updateType&(_.HIGHLIGHT|_.OCCLUDEE|_.VISIBILITY)&&(a.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new a;for(const i of e){const e=i.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new D(e.vec3),r.set(e.id,null,t)),t.changes.push(i)}for(const i of t){const e=i.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),s=t?.findBuffer(i.id);if(null==s)continue;let a=r.get(e.id,s);null==a&&(a=new D(e.vec3),r.set(e.id,s,a)),a.changes.push(i)}return r}_addAndRemoveGeometries(e,r){if(null==this._bufferWriter||null==this._vaoCache)return;const{_bufferWriter:i,_dataByOrigin:s}=this,a=i.vertexBufferLayout.stride/4,o=this._computeDeltas(e,r);o.forEach(((e,r)=>{const n=e.get(null),l=n?.changes??[];o.delete(r,null);let h=s.get(r);if(e.forEach(((e,n)=>{if(o.delete(r,n),null==n)return void w(!1,"No VAO for removed geometries");if(n.instances.size===e.changes.length)return this._vaoCache.deleteVao(n.vao),t(h.buffers,n),void(0===h.buffers.length&&0===l.length&&s.delete(r));const u=n.numElements,f=n.vao.byteSize/4,c=l.reduce(((e,t)=>e+i.elementCount(t.geometry.attributes)),0),m=e.changes.reduce(((e,t)=>e+i.elementCount(t.geometry.attributes)),0),d=Math.min((u+c-m)*a,T),g=d>f;d>N&&d<f/2?(e.changes.forEach((({id:e})=>n.deleteInstance(e))),n.instances.forEach((({geometry:e})=>l.push(e))),this._vaoCache.deleteVao(n.vao),t(h.buffers,n)):g?this._applyAndRebuild(n,l,e):this._applyRemoves(n,e)})),l.length>0)for(null==h&&(h=new B(n.origin),s.set(r,h)),h.buffers.forEach((e=>this._applyAdds(e,l)));l.length>0;)h.buffers.push(this._applyAndRebuild(new A,l,null))}))}_updateDrawCommands(){this._highlightNames.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.updateIfDrawCommandsDirty(this.highlightOrderMap,this._bufferWriter.vertexBufferLayout.stride),e.hasHighlights&&n(this._highlightNames,e.highlightNames),this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(r)for(const m of r.changes)e.deleteInstance(m.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,a=s/4,o=Math.floor(T/a);let n=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry.attributes);if(n+s>o&&n>0){t.push(r);break}n+=s;const a=new E(r,0,0,this.highlightOrderMap);w(null==e.instances.get(r.id)),e.addInstance(r.id,a)}const l=n*a,h=z(l),u=i.vertexBufferLayout.createView(h.buffer);let f=0;e.resetInstanceSummary(),e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,u,f);const s=f;f+=i.elementCount(t.geometry.geometry.attributes),e.updateInstance(r,s,f),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(V(l)),e.vao.vertexBuffers.get("geometry").setSubData(h,0,0,f*a),e.holes.clear();const c=e.holes.pushNew();return c.from=f,c.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(this.highlightOrderMap,s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;let r=1/0,i=-1/0;for(const o of t.changes){const t=o.id,s=e.instances.get(t);if(!s)continue;e.deleteInstance(t),q&&(r=Math.min(r,s.from),i=Math.max(i,s.to));const a=L.back();if(a){if(a.to===s.from){a.to=s.to;continue}if(a.from===s.to){a.from=s.from;continue}}const n=L.pushNew();n.from=s.from,n.to=s.to}O(L);const s=this._bufferWriter.vertexBufferLayout.stride/4,a=e.vao.vertexBuffers.get("geometry");if(q){const t=(i-r)*s,o=z(t),n=this._bufferWriter.vertexBufferLayout.createView(o.buffer);o.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=r&&e.to<=i))return;const t=e.from-r;this._writeGeometry(e.geometry,n,t)})),a.setSubData(o,r*s,0,t)}else{const e=L.reduce(((e,t)=>Math.max(e,t.numElements)),0)*s,t=z(e);t.fill(0,0,e),L.forAll((e=>a.setSubData(t,e.from*s,0,e.numElements*s)))}e.holes.pushArray(L.data,L.length),L.forAll(((e,t)=>L.data[t]=null)),L.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!M(e))return void this._applyAndRebuild(e,t,null);const i=this._bufferWriter,s=i.vertexBufferLayout.stride/4,a=e.numElements,o=t.reduce(((e,t)=>e+i.elementCount(t.geometry.attributes)),0),n=Math.min((a+o)*s,T),l=4*n;if(e.vao.byteSize<V(T-N)&&l>e.vao.byteSize)return void this._applyAndRebuild(e,t,null);O(e.holes);const h=new Array;let u=1/0,f=-1/0;for(const r of t){const t=i.elementCount(r.geometry.attributes),s=H(e.holes,t);h.push(s),q&&null!=s&&(u=Math.min(s,u),f=Math.max(s+t,f))}const c=e.vao.vertexBuffers.get("geometry");let m=0,d=0,g=0;const p=z(q?(f-u)*s:n),y=i.vertexBufferLayout.createView(p.buffer);if(t.forEach(((t,r)=>{const a=h[r];if(null==a)return;const o=i.elementCount(t.geometry.attributes);if(!q){if(!(g===a)){const e=g-d;e>0&&c.setSubData(p,d*s,0,e*s),d=a,m=0}this._writeGeometry(t,y,m),m+=o,g=a+o}const n=new E(t,a,a+o,this.highlightOrderMap);w(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0})),q){const t=(f-u)*s;p.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=u&&e.to<=f))return;const t=e.from-u;this._writeGeometry(e.geometry,y,t)})),d=u,g=f}const _=g-d;_>0&&c.setSubData(p,d*s,0,_*s),r(t,((e,t)=>null==h[t]))}_writeGeometry(e,t,r){null!=this._bufferWriter&&(u(R,e.transformation),R[12]-=e.localOrigin.vec3[0],R[13]-=e.localOrigin.vec3[1],R[14]-=e.localOrigin.vec3[2],f(j,R),c(j,j),this._bufferWriter.write(R,j,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e,i=this.material.produces.get(r.slot);if(!i?.(t))return null;const{highlight:s,slot:a}=r,o=t===g.ShadowHighlight,n=t===g.Highlight,l=n||o,h=s?.name;if(l&&(0===this._highlightNames.size||n&&h&&!this._highlightNames.has(h)))return null;const u=e=>n&&!!h&&!e.has(h),f=t===g.ShadowExcludeHighlight,c=!(l||f);for(const{buffers:m}of this._dataByOrigin.values())for(const i of m){if(u(i.highlightNames))continue;const s=o?i.drawCommandsHighlights.get(x):l?h?i.drawCommandsHighlights.get(h):i.drawCommandsHighlights.size>0:((f&&i.needsMultipleCommands()?i.drawCommandsShadowHighlightRest:i.drawCommandsDefault)||null)?.length??!1,n=c&&i.drawCommandsOccludees||null;if(s||n?.length){const i=this._glMaterials.load(e.rctx,a,t),s=i?.beginSlot(r);if(s)return s}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlight:a}=i,n=r===g.Highlight,l=a?.name??"";if(n&&!a)return;const h=r===g.ShadowHighlight,u=n||h,f=r===g.ShadowExcludeHighlight,c=!(u||f),m=s===b.OCCLUDER_MATERIAL||s===b.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:d}=e;d.runAppleAmdDriverHelper();const p=d.bindTechnique(t,i,this.material.parameters);for(const g of this._dataByOrigin.values())for(const e of g.buffers){if(n&&(!e.hasHighlights||!e.drawCommandsHighlights.has(l)))continue;if(h&&(!e.hasHighlights||!e.drawCommandsHighlights.has(x)))continue;const r=()=>{const t=[],r=e.drawCommandsHighlights.get(x)??new o;return r&&t.push(r),t},s=u&&!h?e.drawCommandsHighlights.get(l)??null:null,a=h?r():u?s?[s]:U:f&&e.needsMultipleCommands()?[e.drawCommandsShadowHighlightRest]:[e.drawCommandsDefault],y=a.some((e=>e.length>0)),_=c&&e.drawCommandsOccludees||null;if(y||_?.length){if(this._drawParameters.origin=g.origin,p.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e.vao),d.bindVAO(e.vao),y)for(const e of a)d.setPipelineState(t.getPipeline(!1,m)),e.forAll((e=>d.drawArrays(t.primitiveType,e.first,e.count)));_?.length&&(d.setPipelineState(t.getPipeline(!0,m)),_.forAll((e=>d.drawArrays(t.primitiveType,e.first,e.count))))}}}static prune(){W=new Float32Array(N)}get test(){}};e([l({constructOnly:!0})],S.prototype,"material",void 0),e([l({})],S.prototype,"highlightOrderMap",void 0),S=e([h("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],S);class D{constructor(e){this.origin=e,this.changes=new Array}}function H(e,t){const r=e.find((e=>e.numElements>=t));if(null==r)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const R=m(),j=m(),L=new o({allocator:e=>e||new C,deallocator:null}),N=65536,I=4*N,G=1024,P=16777216,T=P/4;let W=new Float32Array(N);function z(e){return W.length<e&&(W=new Float32Array(e)),W}function V(e){const t=4*e;return t<=G?G:t<I?i(t):Math.max(Math.min(Math.ceil(1.5*t/I)*I,P),t)}const U=[];let q;export{S as MergedRenderer,V as sizeForVao};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{NestedMap as a}from"../../../../../core/NestedMap.js";import o from"../../../../../core/PooledArray.js";import{addMany as n}from"../../../../../core/SetUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as u,invert as f,transpose as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as m}from"../../../support/buffer/glUtil.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as p}from"../../effects/RenderPlugin.js";import{GLMaterials as y}from"../../lib/GLMaterials.js";import{DirtyState as _}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as b}from"../../lib/RenderSlot.js";import{assert as w}from"../../lib/Util.js";import{DrawParameters as v}from"../DrawParameters.js";import{BufferRange as C,mergeAdjacentRanges as O}from"./BufferRange.js";import{Instance as A}from"./Instance.js";import{PerBufferData as E,hasVao as M}from"./PerBufferData.js";import{PerOriginData as B}from"./PerOriginData.js";import{defaultHighlightName as x}from"../../../../support/HighlightDefaults.js";let S=class extends p{get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(e){return this._highlightNames.has(e)}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new v,this._highlightNames=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=s(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this._updateProduces()}_updateProduces(){this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!(0===this._dataByOrigin.size||!(t!==g.Highlight&&t!==g.ShadowHighlight||this._hasHighlights))&&e(t)))}))}initializeRenderContext(e,t){q??=e.renderContext.rctx.isAssumedMetalDriver,this._glMaterials=new y(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,m(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.vao.cachedMemory),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((({geometry:t})=>e(t)))))))}modify(e,t){this._applyUpdates(e,t),this._applyAddsAndRemoves(e),this._updateDrawCommands()}updateHighlights(e){this.highlightOrderMap=e,this._highlightNames.clear(),this._dataByOrigin.forEach((t=>{t.buffers.forEach((t=>{t.updateHighlights(e),t.highlightNames.forEach((e=>this._highlightNames.add(e)))}))})),this._updateProduces()}_applyUpdates(e,t){const r=this._bufferWriter;if(null==r)return void e.clearUpdates();const i=r.vertexBufferLayout.stride/4;for(const s of e.updates){if(t.done)return;const{renderGeometry:a,updateType:o}=s;e.pending.updates.removeUnordered(s),t.madeProgress();const n=this._dataByOrigin.get(a.localOrigin.id),l=n?.findBuffer(a.id);if(null==l)return;const h=l.instances.get(a.id);if(o&(_.GEOMETRY|_.TRANSFORMATION)){const e=G(r.elementCount(h.geometry.geometry.attributes)*i),t=r.vertexBufferLayout.createView(e.buffer);this._writeGeometry(a,t,0),l.vao.vertexBuffers.get("geometry").setSubData(e,h.from*i,0,h.numElements*i)}o&(_.HIGHLIGHT|_.OCCLUDEE|_.VISIBILITY)&&(l.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new a;for(const i of e){const e=i.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new D(e.vec3),r.set(e.id,null,t)),t.changes.push(i)}for(const i of t){const e=i.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),s=t?.findBuffer(i.id);if(null==s)continue;let a=r.get(e.id,s);null==a&&(a=new D(e.vec3),r.set(e.id,s,a)),a.changes.push(i)}return r}_applyAddsAndRemoves(e){const{_bufferWriter:r,_dataByOrigin:i,_vaoCache:s}=this;if(null==r||null==s)return void e.clearAddsAndRemoves();const a=r.vertexBufferLayout.stride/4,o=this._computeDeltas(e.adds,e.removes);o.forEach(((e,n)=>{const l=e.get(null),h=l?.changes??[];o.delete(n,null);let u=i.get(n);if(e.forEach(((e,l)=>{if(o.delete(n,l),null==l)return void w(!1,"No VAO for removed geometries");if(l.instances.size===e.changes.length)return s.deleteVao(l.vao),t(u.buffers,l),void(0===u.buffers.length&&0===h.length&&i.delete(n));const f=l.numElements,c=l.vao.byteSize/4,d=h.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),m=e.changes.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),g=Math.min((f+d-m)*a,W),p=g>c;g>N&&g<c/2?(e.changes.forEach((({id:e})=>l.deleteInstance(e))),l.instances.forEach((({geometry:e})=>h.push(e))),this._vaoCache.deleteVao(l.vao),t(u.buffers,l)):p?this._applyAndRebuild(l,h,e):this._applyRemoves(l,e)})),h.length>0)for(null==u&&(u=new B(l.origin),i.set(n,u)),u.buffers.forEach((e=>this._applyAdds(e,h)));h.length>0;)u.buffers.push(this._applyAndRebuild(new E,h,null))})),e.clearAddsAndRemoves()}_updateDrawCommands(){this._highlightNames.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.updateIfDrawCommandsDirty(this.highlightOrderMap,this._bufferWriter.vertexBufferLayout.stride),e.hasHighlights&&n(this._highlightNames,e.highlightNames),this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(r)for(const d of r.changes)e.deleteInstance(d.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,a=s/4,o=Math.floor(W/a);let n=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry.attributes);if(n+s>o&&n>0){t.push(r);break}n+=s;const a=new A(r,0,0,this.highlightOrderMap);w(null==e.instances.get(r.id)),e.addInstance(r.id,a)}const l=n*a,h=G(l),u=i.vertexBufferLayout.createView(h.buffer);let f=0;e.resetInstanceSummary(),e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,u,f);const s=f;f+=i.elementCount(t.geometry.geometry.attributes),e.updateInstance(r,s,f),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(U(l)),e.vao.vertexBuffers.get("geometry").setSubData(h,0,0,f*a),e.holes.clear();const c=e.holes.pushNew();return c.from=f,c.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(this.highlightOrderMap,s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;let r=1/0,i=-1/0;for(const o of t.changes){const t=o.id,s=e.instances.get(t);if(!s)continue;e.deleteInstance(t),q&&(r=Math.min(r,s.from),i=Math.max(i,s.to));const a=L.back();if(a){if(a.to===s.from){a.to=s.to;continue}if(a.from===s.to){a.from=s.from;continue}}const n=L.pushNew();n.from=s.from,n.to=s.to}O(L);const s=this._bufferWriter.vertexBufferLayout.stride/4,a=e.vao.vertexBuffers.get("geometry");if(q){const t=(i-r)*s,o=G(t),n=this._bufferWriter.vertexBufferLayout.createView(o.buffer);o.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=r&&e.to<=i))return;const t=e.from-r;this._writeGeometry(e.geometry,n,t)})),a.setSubData(o,r*s,0,t)}else{const e=L.reduce(((e,t)=>Math.max(e,t.numElements)),0)*s,t=G(e);t.fill(0,0,e),L.forAll((e=>a.setSubData(t,e.from*s,0,e.numElements*s)))}e.holes.pushArray(L.data,L.length),L.forAll(((e,t)=>L.data[t]=null)),L.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!M(e))return void this._applyAndRebuild(e,t,null);const i=this._bufferWriter,s=i.vertexBufferLayout.stride/4,a=e.numElements,o=t.reduce(((e,t)=>e+i.elementCount(t.geometry.attributes)),0),n=Math.min((a+o)*s,W),l=4*n;if(e.vao.byteSize<U(W-N)&&l>e.vao.byteSize)return void this._applyAndRebuild(e,t,null);O(e.holes);const h=new Array;let u=1/0,f=-1/0;for(const r of t){const t=i.elementCount(r.geometry.attributes),s=R(e.holes,t);h.push(s),q&&null!=s&&(u=Math.min(s,u),f=Math.max(s+t,f))}const c=e.vao.vertexBuffers.get("geometry");let d=0,m=0,g=0;const p=G(q?(f-u)*s:n),y=i.vertexBufferLayout.createView(p.buffer);if(t.forEach(((t,r)=>{const a=h[r];if(null==a)return;const o=i.elementCount(t.geometry.attributes);if(!q){if(!(g===a)){const e=g-m;e>0&&c.setSubData(p,m*s,0,e*s),m=a,d=0}this._writeGeometry(t,y,d),d+=o,g=a+o}const n=new A(t,a,a+o,this.highlightOrderMap);w(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0})),q){const t=(f-u)*s;p.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=u&&e.to<=f))return;const t=e.from-u;this._writeGeometry(e.geometry,y,t)})),m=u,g=f}const _=g-m;_>0&&c.setSubData(p,m*s,0,_*s),r(t,((e,t)=>null==h[t]))}_writeGeometry(e,t,r){null!=this._bufferWriter&&(u(H,e.transformation),H[12]-=e.localOrigin.vec3[0],H[13]-=e.localOrigin.vec3[1],H[14]-=e.localOrigin.vec3[2],f(j,H),c(j,j),this._bufferWriter.write(H,j,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e,i=this.material.produces.get(r.slot);if(!i?.(t))return null;const{highlight:s,slot:a}=r,o=t===g.ShadowHighlight,n=t===g.Highlight,l=n||o,h=s?.name;if(l&&(0===this._highlightNames.size||n&&h&&!this._highlightNames.has(h)))return null;const u=e=>n&&!!h&&!e.has(h),f=t===g.ShadowExcludeHighlight,c=!(l||f);for(const{buffers:d}of this._dataByOrigin.values())for(const i of d){if(u(i.highlightNames))continue;const s=o?i.drawCommandsHighlights.get(x):l?h?i.drawCommandsHighlights.get(h):i.drawCommandsHighlights.size>0:((f&&i.needsMultipleCommands()?i.drawCommandsShadowHighlightRest:i.drawCommandsDefault)||null)?.length??!1,n=c&&i.drawCommandsOccludees||null;if(s||n?.length){const i=this._glMaterials.load(e.rctx,a,t),s=i?.beginSlot(r);if(s)return s}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlight:a}=i,n=r===g.Highlight,l=a?.name??"";if(n&&!a)return;const h=r===g.ShadowHighlight,u=n||h,f=r===g.ShadowExcludeHighlight,c=!(u||f),d=s===b.OCCLUDER_MATERIAL||s===b.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:m}=e;m.runAppleAmdDriverHelper();const p=m.bindTechnique(t,i,this.material.parameters);for(const g of this._dataByOrigin.values())for(const e of g.buffers){if(n&&(!e.hasHighlights||!e.drawCommandsHighlights.has(l)))continue;if(h&&(!e.hasHighlights||!e.drawCommandsHighlights.has(x)))continue;const r=()=>{const t=[],r=e.drawCommandsHighlights.get(x)??new o;return r&&t.push(r),t},s=u&&!h?e.drawCommandsHighlights.get(l)??null:null,a=h?r():u?s?[s]:V:f&&e.needsMultipleCommands()?[e.drawCommandsShadowHighlightRest]:[e.drawCommandsDefault],y=a.some((e=>e.length>0)),_=c&&e.drawCommandsOccludees||null;if(y||_?.length){if(this._drawParameters.origin=g.origin,p.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e.vao),m.bindVAO(e.vao),y)for(const e of a)m.setPipelineState(t.getPipeline(!1,d)),e.forAll((e=>m.drawArrays(t.primitiveType,e.first,e.count)));_?.length&&(m.setPipelineState(t.getPipeline(!0,d)),_.forAll((e=>m.drawArrays(t.primitiveType,e.first,e.count))))}}}static prune(){z=new Float32Array(N)}get test(){}};e([l({constructOnly:!0})],S.prototype,"material",void 0),e([l({})],S.prototype,"highlightOrderMap",void 0),S=e([h("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],S);class D{constructor(e){this.origin=e,this.changes=new Array}}function R(e,t){const r=e.find((e=>e.numElements>=t));if(null==r)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const H=d(),j=d(),L=new o({allocator:e=>e||new C,deallocator:null}),N=65536,I=4*N,P=1024,T=16777216,W=T/4;let z=new Float32Array(N);function G(e){return z.length<e&&(z=new Float32Array(e)),z}function U(e){const t=4*e;return t<=P?P:t<I?i(t):Math.max(Math.min(Math.ceil(1.5*t/I)*I,T),t)}const V=[];let q;export{S as MergedRenderer,U as sizeForVao};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../core/compilerUtils.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../chunks/Compositing.glsl.js";import{BlitMode as t}from"./CompositingTechniqueConfiguration.js";import{makePipelineState as s,blendWithPremultipliedAlpha as l,defaultColorWrite as n,premultipliedAlphaToPremultipliedAlpha as c}from"../../../webgl/renderState.js";class a extends o{constructor(e,o){super(e,o,new r(i,(()=>import("./Compositing.glsl.js"))))}initializePipeline(r){switch(r.blitMode){case t.None:case t.Depth:return s({colorWrite:n});case t.Alpha:return s({blending:c,colorWrite:n});default:e(r.blitMode);case t.PremultipliedAlpha:case t.COUNT:return s({blending:l,colorWrite:n})}}}export{a as CompositingTechnique};
5
+ import{neverReached as e}from"../../../../core/compilerUtils.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../chunks/Compositing.glsl.js";import{BlitMode as t}from"./CompositingTechniqueConfiguration.js";import{makePipelineState as s,premultipliedAlpha as l,defaultColorWrite as n,unpremultipliedAlphaToPremultipliedAlpha as c}from"../../../webgl/renderState.js";class a extends o{constructor(e,o){super(e,o,new r(i,(()=>import("./Compositing.glsl.js"))))}initializePipeline(r){switch(r.blitMode){case t.None:case t.Depth:return s({colorWrite:n});case t.Alpha:return s({blending:c,colorWrite:n});default:e(r.blitMode);case t.PremultipliedAlpha:case t.COUNT:return s({blending:l,colorWrite:n})}}}export{a as CompositingTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ShaderOutput as e,isColorOrColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as s}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as t}from"../lib/OITPass.js";import{oitBlending as i,getDrawBuffers as l}from"../lib/OrderIndependentTransparency.js";import{H as n}from"../../../../chunks/HUDMaterial.glsl.js";import{PrimitiveType as a,CompareFunction as p}from"../../../webgl/enums.js";import{makePipelineState as u,blendWithPremultipliedAlpha as d,defaultDepthWrite as c,defaultColorWrite as m}from"../../../webgl/renderState.js";class h extends o{constructor(e,r){super(e,r,new s(n,(()=>import("./HUDMaterial.glsl.js")))),this.primitiveType=r.occlusionPass?a.POINTS:a.TRIANGLES}initializePipeline(s){const{oitPass:o,hasPolygonOffset:n,draped:a,output:h,depthTestEnabled:T,occlusionPass:g}=s,j=o===t.NONE,b=o===t.ColorAlpha,O=h===e.Highlight,P=T&&!a&&!b&&!g&&!O;return u({blending:r(h)?j?d:i(o):null,depthTest:T&&!a?{func:p.LEQUAL}:null,depthWrite:P?c:null,drawBuffers:l(o,h),colorWrite:m,polygonOffset:n?f:null})}}const f={factor:0,units:-4};export{h as HUDMaterialTechnique};
5
+ import{ShaderOutput as e,isColorOrColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as s}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as t}from"../lib/OITPass.js";import{oitBlending as i,getDrawBuffers as l}from"../lib/OrderIndependentTransparency.js";import{H as n}from"../../../../chunks/HUDMaterial.glsl.js";import{PrimitiveType as a,CompareFunction as p}from"../../../webgl/enums.js";import{makePipelineState as u,premultipliedAlpha as d,defaultDepthWrite as c,defaultColorWrite as m}from"../../../webgl/renderState.js";class h extends o{constructor(e,r){super(e,r,new s(n,(()=>import("./HUDMaterial.glsl.js")))),this.primitiveType=r.occlusionPass?a.POINTS:a.TRIANGLES}initializePipeline(s){const{oitPass:o,hasPolygonOffset:n,draped:a,output:h,depthTestEnabled:T,occlusionPass:g}=s,j=o===t.NONE,b=o===t.ColorAlpha,O=h===e.Highlight,P=T&&!a&&!b&&!g&&!O;return u({blending:r(h)?j?d:i(o):null,depthTest:T&&!a?{func:p.LEQUAL}:null,depthWrite:P?c:null,drawBuffers:l(o,h),colorWrite:m,polygonOffset:n?f:null})}}const f={factor:0,units:-4};export{h as HUDMaterialTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{MaterialParameters as s}from"../lib/Material.js";import{H as t}from"../../../../chunks/HeatmapDensity.glsl.js";import{makePipelineState as o,weightedAdd as i,defaultColorWrite as l}from"../../../webgl/renderState.js";class a extends s{constructor(){super(...arguments),this.searchRadius=128,this.resolutionForScale=0}}class n extends r{constructor(r,s){super(r,s,new e(t,(()=>import("./HeatmapDensity.glsl.js"))))}initializePipeline(){return o({blending:i,colorWrite:l,depthTest:null,depthWrite:null})}destroy(){super.destroy()}}export{a as HeatmapDensityPassParameters,n as HeatmapDensityTechnique};
5
+ import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{MaterialParameters as s}from"../lib/Material.js";import{H as t}from"../../../../chunks/HeatmapDensity.glsl.js";import{makePipelineState as o,add as i,defaultColorWrite as l}from"../../../webgl/renderState.js";class a extends s{constructor(){super(...arguments),this.searchRadius=128,this.resolutionForScale=0}}class n extends r{constructor(r,s){super(r,s,new e(t,(()=>import("./HeatmapDensity.glsl.js"))))}initializePipeline(){return o({blending:i,colorWrite:l,depthTest:null,depthWrite:null})}destroy(){super.destroy()}}export{a as HeatmapDensityPassParameters,n as HeatmapDensityTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{H as s}from"../../../../chunks/Heatmap.glsl.js";import{PrimitiveType as t}from"../../../webgl/enums.js";import{NoParameters as i}from"../../../webgl/NoParameters.js";import{makePipelineState as o,premultipliedAlphaToPremultipliedAlpha as l,defaultColorWrite as n}from"../../../webgl/renderState.js";class a extends i{constructor(){super(...arguments),this.colorRamp=null,this.densityMap=null,this.searchRadius=1,this.fieldTotal=0,this.minDensity=0,this.maxDensity=100}}class m extends r{constructor(r,i){super(r,i,new e(s,(()=>import("./Heatmap.glsl.js")))),this.primitiveType=t.TRIANGLE_STRIP}initializePipeline(){return o({blending:l,colorWrite:n,depthTest:null,depthWrite:null})}}export{a as HeatmapPassParameters,m as HeatmapTechnique};
5
+ import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{H as s}from"../../../../chunks/Heatmap.glsl.js";import{PrimitiveType as t}from"../../../webgl/enums.js";import{NoParameters as i}from"../../../webgl/NoParameters.js";import{makePipelineState as o,unpremultipliedAlphaToPremultipliedAlpha as l,defaultColorWrite as n}from"../../../webgl/renderState.js";class a extends i{constructor(){super(...arguments),this.colorRamp=null,this.densityMap=null,this.searchRadius=1,this.fieldTotal=0,this.minDensity=0,this.maxDensity=100}}class m extends r{constructor(r,i){super(r,i,new e(s,(()=>import("./Heatmap.glsl.js")))),this.primitiveType=t.TRIANGLE_STRIP}initializePipeline(){return o({blending:l,colorWrite:n,depthTest:null,depthWrite:null})}}export{a as HeatmapPassParameters,m as HeatmapTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as i}from"../lib/OITPass.js";import{oitBlending as l,oitDepthTest as s,depthWrite as n,getDrawBuffers as o,getOITPolygonOffset as a}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as p,stencilToolMaskBaseParams as c,stencilBaseAllZerosParams as u}from"../lib/StencilUtils.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{I as d}from"../../../../chunks/ImageMaterial.glsl.js";import{makePipelineState as h,blendWithPremultipliedAlpha as f,cullingParams as g,defaultColorWrite as P}from"../../../webgl/renderState.js";class b extends r{constructor(e,r){super(e,r,new t(d,(()=>import("./ImageMaterial.glsl.js"))),j)}_getPipelineState(t,r){const{oitPass:m,output:d,hasOccludees:b,enableOffset:j,cullFace:I}=t,S=m===i.NONE,O=m===i.FrontFace;return h({blending:e(d)?S?f:l(m):null,culling:g(I),depthTest:{func:s(m)},depthWrite:n(t),drawBuffers:o(m,d),colorWrite:P,stencilWrite:b?p:null,stencilTest:b?r?c:u:null,polygonOffset:S||O?null:a(j)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e){return e?this._occludeePipeline:super.getPipeline()}}const j=new Map([[m.POSITION,0],[m.UV0,2],[m.PERSPECTIVEDIVIDE,3]]);export{b as ImageMaterialTechnique,j as vertexAttributeLocations};
5
+ import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as i}from"../lib/OITPass.js";import{oitBlending as l,oitDepthTest as s,depthWrite as n,getDrawBuffers as o,getOITPolygonOffset as a}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as p,stencilToolMaskBaseParams as c,stencilBaseAllZerosParams as u}from"../lib/StencilUtils.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{I as d}from"../../../../chunks/ImageMaterial.glsl.js";import{makePipelineState as h,premultipliedAlpha as f,cullingParams as g,defaultColorWrite as P}from"../../../webgl/renderState.js";class b extends r{constructor(e,r){super(e,r,new t(d,(()=>import("./ImageMaterial.glsl.js"))),j)}_getPipelineState(t,r){const{oitPass:m,output:d,hasOccludees:b,enableOffset:j,cullFace:I}=t,S=m===i.NONE,O=m===i.FrontFace;return h({blending:e(d)?S?f:l(m):null,culling:g(I),depthTest:{func:s(m)},depthWrite:n(t),drawBuffers:o(m,d),colorWrite:P,stencilWrite:b?p:null,stencilTest:b?r?c:u:null,polygonOffset:S||O?null:a(j)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e){return e?this._occludeePipeline:super.getPipeline()}}const j=new Map([[m.POSITION,0],[m.UV0,2],[m.PERSPECTIVEDIVIDE,3]]);export{b as ImageMaterialTechnique,j 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{isColorOrColorEmission as e,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{blending as l,oitDepthTest as n,depthWrite as s,getDrawBuffers as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as c,stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as a,depthCompareAlways as d,stencilToolTransparentOccluderParams as T,stencilWriteMaskOff as h,stencilToolMaskOccluderParams as m,depthCompareLess as P}from"../lib/StencilUtils.js";import{VertexAttribute as f}from"../lib/VertexAttribute.js";import{L as E}from"../../../../chunks/LineMarker.glsl.js";import{LineMarkerSpace as O}from"./LineMarkerTechniqueConfiguration.js";import{SpecialDrawBuffers as R}from"../../../webgl/enums.js";import{makePipelineState as _,defaultColorWrite as A,premultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";class W extends r{constructor(e,i){super(e,i,new t(E,(()=>import("./LineMarker.glsl.js"))),b)}_makePipelineState(t,r){const{output:p,oitPass:d,space:T,hasOccludees:h}=t;return _({blending:e(p)?l(d):null,depthTest:T===O.Draped?null:{func:n(d)},depthWrite:s(t),drawBuffers:p===i.Depth?{buffers:[R.NONE]}:o(d,p),colorWrite:A,stencilWrite:h?c:null,stencilTest:h?r?u:a:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=_({blending:S,depthTest:d,depthWrite:null,colorWrite:A,stencilWrite:null,stencilTest:T}),this._occluderPipelineOpaque=_({blending:S,depthTest:d,depthWrite:null,colorWrite:A,stencilWrite:h,stencilTest:m}),this._occluderPipelineMaskWrite=_({blending:null,depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:c,stencilTest:u})):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 b=new Map([[f.POSITION,0],[f.PREVIOUSDELTA,1],[f.UV0,2],[f.NORMAL,3],[f.COLOR,4],[f.COLORFEATUREATTRIBUTE,4],[f.SIZE,5],[f.SIZEFEATUREATTRIBUTE,5],[f.OPACITYFEATUREATTRIBUTE,6]]);export{W as LineMarkerTechnique,b as vertexAttributeLocations};
5
+ import{isColorOrColorEmission as e,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as t}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{blending as l,oitDepthTest as n,depthWrite as s,getDrawBuffers as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as c,stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as a,depthCompareAlways as d,stencilToolTransparentOccluderParams as T,stencilWriteMaskOff as h,stencilToolMaskOccluderParams as m,depthCompareLess as P}from"../lib/StencilUtils.js";import{VertexAttribute as f}from"../lib/VertexAttribute.js";import{L as E}from"../../../../chunks/LineMarker.glsl.js";import{LineMarkerSpace as O}from"./LineMarkerTechniqueConfiguration.js";import{SpecialDrawBuffers as R}from"../../../webgl/enums.js";import{makePipelineState as _,defaultColorWrite as A,unpremultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";class W extends r{constructor(e,i){super(e,i,new t(E,(()=>import("./LineMarker.glsl.js"))),b)}_makePipelineState(t,r){const{output:p,oitPass:d,space:T,hasOccludees:h}=t;return _({blending:e(p)?l(d):null,depthTest:T===O.Draped?null:{func:n(d)},depthWrite:s(t),drawBuffers:p===i.Depth?{buffers:[R.NONE]}:o(d,p),colorWrite:A,stencilWrite:h?c:null,stencilTest:h?r?u:a:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=_({blending:S,depthTest:d,depthWrite:null,colorWrite:A,stencilWrite:null,stencilTest:T}),this._occluderPipelineOpaque=_({blending:S,depthTest:d,depthWrite:null,colorWrite:A,stencilWrite:h,stencilTest:m}),this._occluderPipelineMaskWrite=_({blending:null,depthTest:P,depthWrite:null,colorWrite:null,stencilWrite:c,stencilTest:u})):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 b=new Map([[f.POSITION,0],[f.PREVIOUSDELTA,1],[f.UV0,2],[f.NORMAL,3],[f.COLOR,4],[f.COLORFEATUREATTRIBUTE,4],[f.SIZE,5],[f.SIZEFEATUREATTRIBUTE,5],[f.OPACITYFEATUREATTRIBUTE,6]]);export{W as LineMarkerTechnique,b 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.33/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 r}from"../core/shaderTechnique/ShaderTechnique.js";import{depthCompareLess as t,stencilWriteMaskOn as l,stencilToolMaskBaseParams as s,stencilBaseAllZerosParams as n}from"../lib/StencilUtils.js";import{N as o}from"../../../../chunks/NativeLine.glsl.js";import{PrimitiveType as u}from"../../../webgl/enums.js";import{makePipelineState as p,defaultColorWrite as c,defaultDepthWrite as a,premultipliedAlphaToPremultipliedAlpha as m}from"../../../webgl/renderState.js";class d extends r{constructor(e,r){super(e,r,new i(o,(()=>import("./NativeLine.glsl.js")))),this.primitiveType=u.LINES}initializePipeline(i){const{hasOccludees:r,output:o,transparent:u}=i,d=(e,i=null,o=null)=>p({blending:i,depthTest:t,depthWrite:o,colorWrite:c,stencilWrite:r?l:null,stencilTest:r?e?s:n:null});return e(o)?(this._occludeePipeline=d(!0,u?m:null,a),d(!1,u?m:null,a)):d(!1)}getPipeline(e){return e?this._occludeePipeline:super.getPipeline()}}export{d as NativeLineTechnique};
5
+ import{isColorOrColorEmission as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{depthCompareLess as t,stencilWriteMaskOn as l,stencilToolMaskBaseParams as s,stencilBaseAllZerosParams as n}from"../lib/StencilUtils.js";import{N as o}from"../../../../chunks/NativeLine.glsl.js";import{PrimitiveType as u}from"../../../webgl/enums.js";import{makePipelineState as p,defaultColorWrite as c,defaultDepthWrite as a,unpremultipliedAlphaToPremultipliedAlpha as m}from"../../../webgl/renderState.js";class d extends r{constructor(e,r){super(e,r,new i(o,(()=>import("./NativeLine.glsl.js")))),this.primitiveType=u.LINES}initializePipeline(i){const{hasOccludees:r,output:o,transparent:u}=i,d=(e,i=null,o=null)=>p({blending:i,depthTest:t,depthWrite:o,colorWrite:c,stencilWrite:r?l:null,stencilTest:r?e?s:n:null});return e(o)?(this._occludeePipeline=d(!0,u?m:null,a),d(!1,u?m:null,a)):d(!1)}getPipeline(e){return e?this._occludeePipeline:super.getPipeline()}}export{d as NativeLineTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{isColorOrColorEmission as e,ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{blending as s,oitDepthTest as n,depthWrite as o,getDrawBuffers as u,OITPolygonOffset as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as a,stencilToolMaskBaseParams as f,stencilBaseAllZerosParams as d,depthCompareAlways as T,stencilToolTransparentOccluderParams as h,stencilWriteMaskOff as m,stencilToolMaskOccluderParams as E,depthCompareLess as O}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as b,SpecialDrawBuffers as A}from"../../../webgl/enums.js";import{makePipelineState as g,defaultColorWrite as I,premultipliedAlphaToPremultipliedAlpha as N}from"../../../webgl/renderState.js";class S extends r{constructor(e,t){super(e,t,new i(R,(()=>import("./RibbonLine.glsl.js"))),_),this.primitiveType=t.wireframe?b.LINES:b.TRIANGLE_STRIP}_makePipelineState(i,r){const{oitPass:c,output:T,hasOccludees:h,hasPolygonOffset:m}=i,E=c===l.NONE,O=c===l.FrontFace;return g({blending:e(T)?s(c):null,depthTest:{func:n(c)},depthWrite:o(i),drawBuffers:T===t.Depth?{buffers:[A.NONE]}:u(c,T),colorWrite:I,stencilWrite:h?a:null,stencilTest:h?r?f:d:null,polygonOffset:E||O?m?L:null:p})}initializePipeline(e){if(e.occluder){const i=e.hasPolygonOffset?L:null;this._occluderPipelineTransparent=g({blending:N,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:I,stencilWrite:null,stencilTest:h,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null}),this._occluderPipelineOpaque=g({blending:N,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:I,stencilWrite:m,stencilTest:E,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null}),this._occluderPipelineMaskWrite=g({blending:null,polygonOffset:i,depthTest:O,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:f,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null})}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};
5
+ import"../../../../core/has.js";import{isColorOrColorEmission as e,ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{blending as s,oitDepthTest as n,depthWrite as o,getDrawBuffers as u,OITPolygonOffset as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as a,stencilToolMaskBaseParams as f,stencilBaseAllZerosParams as d,depthCompareAlways as T,stencilToolTransparentOccluderParams as h,stencilWriteMaskOff as m,stencilToolMaskOccluderParams as E,depthCompareLess as O}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as b,SpecialDrawBuffers as A}from"../../../webgl/enums.js";import{makePipelineState as g,defaultColorWrite as I,unpremultipliedAlphaToPremultipliedAlpha as N}from"../../../webgl/renderState.js";class S extends r{constructor(e,t){super(e,t,new i(R,(()=>import("./RibbonLine.glsl.js"))),_),this.primitiveType=t.wireframe?b.LINES:b.TRIANGLE_STRIP}_makePipelineState(i,r){const{oitPass:c,output:T,hasOccludees:h,hasPolygonOffset:m}=i,E=c===l.NONE,O=c===l.FrontFace;return g({blending:e(T)?s(c):null,depthTest:{func:n(c)},depthWrite:o(i),drawBuffers:T===t.Depth?{buffers:[A.NONE]}:u(c,T),colorWrite:I,stencilWrite:h?a:null,stencilTest:h?r?f:d:null,polygonOffset:E||O?m?L:null:p})}initializePipeline(e){if(e.occluder){const i=e.hasPolygonOffset?L:null;this._occluderPipelineTransparent=g({blending:N,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:I,stencilWrite:null,stencilTest:h,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null}),this._occluderPipelineOpaque=g({blending:N,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:I,stencilWrite:m,stencilTest:E,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null}),this._occluderPipelineMaskWrite=g({blending:null,polygonOffset:i,depthTest:O,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:f,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null})}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};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{a as t}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{PrimitiveType as i}from"../../../webgl/enums.js";import{makePipelineState as o,weightedAdd as s,defaultColorWrite as l}from"../../../webgl/renderState.js";class a extends r{constructor(r,o){super(r,o,new e(t,(()=>import("./ShadowCastAccumulate.glsl.js")))),this.primitiveType=i.TRIANGLE_STRIP}initializePipeline(){return o({blending:s,colorWrite:l,depthTest:null,depthWrite:null})}}export{a as ShadowCastAccumulateTechnique};
5
+ import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{a as t}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{PrimitiveType as i}from"../../../webgl/enums.js";import{makePipelineState as o,add as s,defaultColorWrite as l}from"../../../webgl/renderState.js";class a extends r{constructor(r,o){super(r,o,new e(t,(()=>import("./ShadowCastAccumulate.glsl.js")))),this.primitiveType=i.TRIANGLE_STRIP}initializePipeline(){return o({blending:s,colorWrite:l,depthTest:null,depthWrite:null})}}export{a as ShadowCastAccumulateTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../chunks/ShadowCastVisualize.glsl.js";import{PrimitiveType as s}from"../../../webgl/enums.js";import{makePipelineState as t,premultipliedAlphaToPremultipliedAlpha as o,defaultColorWrite as l}from"../../../webgl/renderState.js";class a extends r{constructor(r,t){super(r,t,new e(i,(()=>import("./ShadowCastVisualize.glsl.js")))),this.primitiveType=s.TRIANGLE_STRIP}initializePipeline(){return t({blending:o,colorWrite:l,depthTest:null,depthWrite:null})}}export{a as ShadowCastVisualizeTechnique};
5
+ import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../chunks/ShadowCastVisualize.glsl.js";import{PrimitiveType as s}from"../../../webgl/enums.js";import{makePipelineState as t,unpremultipliedAlphaToPremultipliedAlpha as o,defaultColorWrite as l}from"../../../webgl/renderState.js";class a extends r{constructor(r,t){super(r,t,new e(i,(()=>import("./ShadowCastVisualize.glsl.js")))),this.primitiveType=s.TRIANGLE_STRIP}initializePipeline(){return t({blending:o,colorWrite:l,depthTest:null,depthWrite:null})}}export{a as ShadowCastVisualizeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{S as i}from"../../../../chunks/SlicePlaneMaterial.glsl.js";import{CompareFunction as s}from"../../../webgl/enums.js";import{NoParameters as t}from"../../../webgl/NoParameters.js";import{makePipelineState as l,blendWithPremultipliedAlpha as a,defaultColorWrite as c}from"../../../webgl/renderState.js";class n extends t{constructor(){super(...arguments),this.backgroundColor=e(1,0,0,.5),this.gridColor=e(0,1,0,.5),this.gridWidth=4}}class m extends o{constructor(e,o){super(e,o,new r(i,(()=>import("./SlicePlaneMaterial.glsl.js"))))}initializePipeline(){return l({blending:a,depthTest:{func:s.LESS},colorWrite:c})}}export{n as SlicePlaneMaterialPassParameters,m as SlicePlaneMaterialTechnique};
5
+ import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{S as i}from"../../../../chunks/SlicePlaneMaterial.glsl.js";import{CompareFunction as s}from"../../../webgl/enums.js";import{NoParameters as t}from"../../../webgl/NoParameters.js";import{makePipelineState as l,premultipliedAlpha as a,defaultColorWrite as c}from"../../../webgl/renderState.js";class n extends t{constructor(){super(...arguments),this.backgroundColor=e(1,0,0,.5),this.gridColor=e(0,1,0,.5),this.gridWidth=4}}class m extends o{constructor(e,o){super(e,o,new r(i,(()=>import("./SlicePlaneMaterial.glsl.js"))))}initializePipeline(){return l({blending:a,depthTest:{func:s.LESS},colorWrite:c})}}export{n as SlicePlaneMaterialPassParameters,m as SlicePlaneMaterialTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{StencilBits as i}from"../lib/basicInterfaces.js";import{renderWhenBitIsNotSet as l}from"../lib/StencilUtils.js";import{VertexAttribute as n}from"../lib/VertexAttribute.js";import{a as s}from"../../../../chunks/Terrain.glsl.js";import{CompareFunction as u,SpecialDrawBuffers as c}from"../../../webgl/enums.js";import{makePipelineState as o,blendWithPremultipliedAlpha as a,backFaceCullingParams as p,defaultDepthWrite as h,defaultColorWrite as d}from"../../../webgl/renderState.js";class m extends t{constructor(e,t){super(e,t,new r(s,(()=>import("./Terrain.glsl.js"))),f),this.type="TerrainTechnique",this.useStencil=!1}initializePipeline(e){return this._stencilPipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}_createPipeline(r,t){const{renderOccluded:n,output:s}=r,m=r.backfaceCullingEnabled&&!n;return o({blending:n?a:null,culling:m?p:null,depthTest:n?null:{func:u.LESS},depthWrite:n?null:h,colorWrite:d,stencilTest:t?l(i.IntegratedMeshMaskExcluded):null,drawBuffers:s===e.Depth?{buffers:[c.NONE]}:null})}getPipeline(){return this.useStencil?this._stencilPipelineState:super.getPipeline()}}const f=new Map([[n.POSITION,0],[n.UV0,1],[n.NORMALCOMPRESSED,2]]);export{m as TerrainTechnique,f as vertexAttributeLocations};
5
+ import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{StencilBits as i}from"../lib/basicInterfaces.js";import{renderWhenBitIsNotSet as l}from"../lib/StencilUtils.js";import{VertexAttribute as n}from"../lib/VertexAttribute.js";import{a as s}from"../../../../chunks/Terrain.glsl.js";import{CompareFunction as u,SpecialDrawBuffers as c}from"../../../webgl/enums.js";import{makePipelineState as o,premultipliedAlpha as a,backFaceCullingParams as p,defaultDepthWrite as h,defaultColorWrite as d}from"../../../webgl/renderState.js";class m extends t{constructor(e,t){super(e,t,new r(s,(()=>import("./Terrain.glsl.js"))),f),this.type="TerrainTechnique",this.useStencil=!1}initializePipeline(e){return this._stencilPipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}_createPipeline(r,t){const{renderOccluded:n,output:s}=r,m=r.backfaceCullingEnabled&&!n;return o({blending:n?a:null,culling:m?p:null,depthTest:n?null:{func:u.LESS},depthWrite:n?null:h,colorWrite:d,stencilTest:t?l(i.IntegratedMeshMaskExcluded):null,drawBuffers:s===e.Depth?{buffers:[c.NONE]}:null})}getPipeline(){return this.useStencil?this._stencilPipelineState:super.getPipeline()}}const f=new Map([[n.POSITION,0],[n.UV0,1],[n.NORMALCOMPRESSED,2]]);export{m as TerrainTechnique,f 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../chunks/Viewshed.glsl.js";import{makePipelineState as o,defaultColorWrite as s,premultipliedAlphaToPremultipliedAlpha as t}from"../../../webgl/renderState.js";class l extends r{constructor(r,o){super(r,o,new e(i,(()=>import("./Viewshed.glsl.js"))))}initializePipeline(){return o({colorWrite:s,blending:t})}}export{l as ViewshedTechnique};
5
+ import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../chunks/Viewshed.glsl.js";import{makePipelineState as o,defaultColorWrite as s,unpremultipliedAlphaToPremultipliedAlpha as t}from"../../../webgl/renderState.js";class l extends r{constructor(r,o){super(r,o,new e(i,(()=>import("./Viewshed.glsl.js"))))}initializePipeline(){return o({colorWrite:s,blending:t})}}export{l as ViewshedTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import r from"../../../core/Logger.js";import{watch as i,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{sqlAnd as s}from"../../../core/sql.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as u}from"../../../layers/support/floorFilterUtils.js";import{isSubtypeGroupLayer as p,isFeatureLayer as d}from"../../../layers/support/layerUtils.js";import{isUtilityNetworkWebMap as c}from"./snappingUtils.js";import{scaleBoundsPredicate as y}from"../../support/layerViewUtils.js";let f=class extends t{set attributeRulesEnabled(e){this._set("attributeRulesEnabled",e),e&&this.loadRules()}get layerView(){return this.view?.allLayerViews?.find((e=>e.layer===this.layer))}get valid(){const{_valid:e,snappingSource:t,layer:r}=this;return!(!t||!r)&&e}get subtypeFilter(){const{layer:e,snappingSource:t}=this;if(!p(e)||!e.subtypes?.length||!t)return{mode:"not-in-use",filter:null};const r=t.layerSource.sublayerSources.filter((e=>e.enabled&&e.layer.visible&&y(this.view?.scale,e.layer.effectiveScaleRange.minScale,e.layer.effectiveScaleRange.maxScale))).map((e=>e.layer.subtypeCode));if(!r.length)return{mode:"none-visible",filter:null};if(r.length===e.subtypes.length)return{mode:"all-visible",filter:null};const i=e.fieldsIndex.get(e.subtypeField)?.name??e.subtypeField;return 1===r.length?{mode:"in-use",filter:`${i} = ${r.getItemAt(0)}`}:{mode:"in-use",filter:`${i} IN (${r.join(", ")})`}}get floorFilter(){const{view:e,layer:t}=this;return e&&t?u({view:e,layer:t}):null}constructor(e){super(e),this.layer=null,this.snappingSource=null,this.rulesTable=null,this._valid=null}initialize(){if(!this.snappingSource||!this.layer)return void(this._valid=!1);const{layer:e,snappingSource:t}=this;if("refresh"in e){const r=e;this.addHandles(r.on("refresh",(()=>t.refresh())))}this.loadRules(),this.addHandles([i((()=>t.updating),(e=>t.layerSource.updating=e),l),i((()=>t.availability),(e=>t.layerSource.availability=e),l)])}getFetchCandidatesParameters(e,t,r){if(!this.valid)return[];const{layer:i,layerView:l,floorFilter:o,rulesTable:a,subtypeFilter:u}=this,y={distance:r,mode:this.view?.type??"2d",point:e,coordinateHelper:t.coordinateHelper,...h(),filter:l&&"filter"in l?l.filter:null};if(o&&(y.filter=m(y.filter,o)),"not-in-use"!==u.mode&&"all-visible"!==u.mode){if("none-visible"===u.mode)return[];y.filter?y.filter.where=s(y.filter.where,u.mode):y.filter=new n({where:u.filter})}if(!this.attributeRulesEnabled)return[y];const f=t.feature,v="subtype-sublayer"===f?.sourceLayer?.type?f.sourceLayer.parent:f?.sourceLayer;if(a&&f&&c(this.view?.map)&&(d(i)||p(i))&&i.layerId&&(d(v)||p(v))&&this.view.map.utilityNetworks?.find((e=>e.isUtilityLayer(v)))){if("loaded"!==a.loadStatus)return[];const e=[],t=i.layerId,r=a.getFeatureSQL(v,f)?.[t];if(!r)return[];const l=r.anyVertex;let s=r.endVertex;return s&&l&&s===l&&(s=""),s&&e.push({...y,returnEdge:!1,vertexMode:"ends",filter:m(y.filter,s)}),l&&e.push({...y,returnEdge:has("snapping-include-edges-when-applying-any-vertex-rule")??!1,vertexMode:"all",filter:m(y.filter,l)}),e}return[y]}async loadRules(){this._valid=null;const{layer:e,view:t,attributeRulesEnabled:i}=this;if(i&&e&&t&&c(t?.map)&&(d(e)||p(e)))try{await Promise.allSettled(t.map.utilityNetworks?.map((e=>e.load()))??[]);const r=t.map.utilityNetworks?.find((t=>t.isUtilityLayer(e)));r&&(this.rulesTable=await r.getRulesTable(),await(this.rulesTable?.load()))}catch(l){return this._valid=!1,void r.getLogger("esri.views.interactive.snapping.FeatureSnappingSourceInfo").error("Failed to load rules table for snapping source",e.title)}this._valid=!0}remove(){this.destroy()}destroy(){this.snappingSource?.destroy()}};function h(){return{returnEdge:!0,vertexMode:"all"}}function m(e,t){return null==e?new n({where:t}):e.where?new n({where:s(e.where,t)}):new n({where:t})}e([o({constructOnly:!0})],f.prototype,"layer",void 0),e([o({constructOnly:!0})],f.prototype,"snappingSource",void 0),e([o({constructOnly:!0})],f.prototype,"view",void 0),e([o({value:!1})],f.prototype,"attributeRulesEnabled",null),e([o()],f.prototype,"layerView",null),e([o()],f.prototype,"rulesTable",void 0),e([o()],f.prototype,"valid",null),e([o()],f.prototype,"subtypeFilter",null),e([o()],f.prototype,"floorFilter",null),e([o()],f.prototype,"_valid",void 0),f=e([a("esri.views.interactive.snapping.FeatureSnappingSourceInfo")],f);export{f as FeatureSnappingSourceInfo};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import r from"../../../core/Logger.js";import{watch as i,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{sqlAnd as s}from"../../../core/sql.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../../layers/support/FeatureFilter.js";import{getFloorFilterClause as u}from"../../../layers/support/floorFilterUtils.js";import{isSubtypeGroupLayer as p,isFeatureLayer as d}from"../../../layers/support/layerUtils.js";import{isUtilityNetworkWebMap as c}from"./snappingUtils.js";import{scaleBoundsPredicate as y}from"../../support/layerViewUtils.js";let f=class extends t{set attributeRulesEnabled(e){this._set("attributeRulesEnabled",e),e&&this.loadRules()}get layerView(){return this.view?.allLayerViews?.find((e=>e.layer===this.layer))}get valid(){const{_valid:e,snappingSource:t,layer:r}=this;return!(!t||!r)&&e}get subtypeFilter(){const{layer:e,snappingSource:t}=this;if(!p(e)||!e.subtypes?.length||!t)return{mode:"not-in-use",filter:null};const r=t.layerSource.sublayerSources.filter((e=>e.enabled&&e.layer.visible&&y(this.view?.scale,e.layer.effectiveScaleRange.minScale,e.layer.effectiveScaleRange.maxScale))).map((e=>e.layer.subtypeCode));if(!r.length)return{mode:"none-visible",filter:null};if(r.length===e.subtypes.length)return{mode:"all-visible",filter:null};const i=e.fieldsIndex.get(e.subtypeField)?.name??e.subtypeField;return 1===r.length?{mode:"in-use",filter:`${i} = ${r.getItemAt(0)}`}:{mode:"in-use",filter:`${i} IN (${r.join(", ")})`}}get floorFilter(){const{view:e,layer:t}=this;return e&&t?u({view:e,layer:t}):null}constructor(e){super(e),this.layer=null,this.snappingSource=null,this.rulesTable=null,this._valid=null}initialize(){if(!this.snappingSource||!this.layer)return void(this._valid=!1);const{layer:e,snappingSource:t}=this;if("refresh"in e){const r=e;this.addHandles(r.on("refresh",(()=>t.refresh())))}this.loadRules(),this.addHandles([i((()=>t.updating),(e=>t.layerSource.updating=e),l),i((()=>t.availability),(e=>t.layerSource.availability=e),l)])}getFetchCandidatesParameters(e,t,r){if(!this.valid)return[];const{layer:i,layerView:l,floorFilter:o,rulesTable:a,subtypeFilter:u}=this,y={distance:r,mode:this.view?.type??"2d",point:e,coordinateHelper:t.coordinateHelper,...h(),filter:l&&"filter"in l?l.filter:null};if(o&&(y.filter=m(y.filter,o)),"not-in-use"!==u.mode&&"all-visible"!==u.mode){if("none-visible"===u.mode)return[];y.filter?y.filter.where=s(y.filter.where,u.mode):y.filter=new n({where:u.filter})}if(!this.attributeRulesEnabled)return[y];const f=t.feature,v="subtype-sublayer"===f?.sourceLayer?.type?f.sourceLayer.parent:f?.sourceLayer;if(a&&f&&c(this.view?.map)&&(d(i)||p(i))&&(d(v)||p(v))&&this.view.map.utilityNetworks?.find((e=>e.isUtilityLayer(v)))){if("loaded"!==a.loadStatus)return[];const e=[],t=i.layerId,r=a.getFeatureSQL(v,f)?.[t];if(!r)return[];const l=r.anyVertex;let s=r.endVertex;return s&&l&&s===l&&(s=""),s&&e.push({...y,returnEdge:!1,vertexMode:"ends",filter:m(y.filter,s)}),l&&e.push({...y,returnEdge:has("snapping-include-edges-when-applying-any-vertex-rule")??!1,vertexMode:"all",filter:m(y.filter,l)}),e}return[y]}async loadRules(){this._valid=null;const{layer:e,view:t,attributeRulesEnabled:i}=this;if(i&&e&&t&&c(t?.map)&&(d(e)||p(e)))try{await Promise.allSettled(t.map.utilityNetworks?.map((e=>e.load()))??[]);const r=t.map.utilityNetworks?.find((t=>t.isUtilityLayer(e)));r&&(this.rulesTable=await r.getRulesTable(),await(this.rulesTable?.load()))}catch(l){return this._valid=!1,void r.getLogger("esri.views.interactive.snapping.FeatureSnappingSourceInfo").error("Failed to load rules table for snapping source",e.title)}this._valid=!0}remove(){this.destroy()}destroy(){this.snappingSource?.destroy()}};function h(){return{returnEdge:!0,vertexMode:"all"}}function m(e,t){return null==e?new n({where:t}):e.where?new n({where:s(e.where,t)}):new n({where:t})}e([o({constructOnly:!0})],f.prototype,"layer",void 0),e([o({constructOnly:!0})],f.prototype,"snappingSource",void 0),e([o({constructOnly:!0})],f.prototype,"view",void 0),e([o({value:!1})],f.prototype,"attributeRulesEnabled",null),e([o()],f.prototype,"layerView",null),e([o()],f.prototype,"rulesTable",void 0),e([o()],f.prototype,"valid",null),e([o()],f.prototype,"subtypeFilter",null),e([o()],f.prototype,"floorFilter",null),e([o()],f.prototype,"_valid",void 0),f=e([a("esri.views.interactive.snapping.FeatureSnappingSourceInfo")],f);export{f as FeatureSnappingSourceInfo};
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
- type PointCloudLayerView = __esri.PointCloudLayerView;
3
+ import PointCloudLayerView = __esri.PointCloudLayerView;
4
4
  export default PointCloudLayerView;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as r}from"../../chunks/tslib.es6.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";const t=t=>{let s=class extends t{constructor(){super(...arguments),this.layer=null}get availableFields(){return[]}highlight(){throw new Error("Not implemented")}queryFeatures(){throw new Error("Not implemented")}queryFeatureCount(){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(){throw new Error("Not implemented")}};return r([e()],s.prototype,"layer",void 0),r([e()],s.prototype,"availableFields",null),s=r([o("esri.views.layers.PointCloudLayerView")],s),s};export{t as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{CullFaceOptions as t}from"../3d/webgl-engine/lib/basicInterfaces.js";import{BlendFactor as e,Face as i,CullMode as n,BlendOperation as s}from"./enums.js";function l(t,e,i=s.ADD,n=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:n[0],g:n[1],b:n[2],a:n[3]}}}function r(t,e,i,n,l=s.ADD,r=s.ADD,a=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:n,opRgb:l,opAlpha:r,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}const a=l(e.ZERO,e.ONE_MINUS_SRC_ALPHA),_=l(e.ONE,e.ZERO),h=l(e.ONE,e.ONE),o=l(e.ONE,e.ONE_MINUS_SRC_ALPHA),c=r(e.SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),d={face:i.BACK,mode:n.CCW},u={face:i.FRONT,mode:n.CCW},f=e=>e===t.Back?d:e===t.Front?u:null,p={zNear:0,zFar:1},g={r:!0,g:!0,b:!0,a:!0};function v(t){return R.intern(t)}function I(t){return N.intern(t)}function S(t){return P.intern(t)}function W(t){return k.intern(t)}function b(t){return F.intern(t)}function T(t){return L.intern(t)}function w(t){return U.intern(t)}function O(t){return K.intern(t)}function A(t){return x.intern(t)}function B(t){return G.intern(t)}class D{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function C(t){return"["+t.join(",")+"]"}const R=new D(y,(t=>({__tag:"Blending",...t})));function y(t){return t?C([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const N=new D(m,(t=>({__tag:"Culling",...t})));function m(t){return t?C([t.face,t.mode]):null}const P=new D(E,(t=>({__tag:"PolygonOffset",...t})));function E(t){return t?C([t.factor,t.units]):null}const k=new D(z,(t=>({__tag:"DepthTest",...t})));function z(t){return t?C([t.func]):null}const F=new D(H,(t=>({__tag:"StencilTest",...t})));function H(t){return t?C([t.function.func,t.function.ref,t.function.mask,t.operation.fail,t.operation.zFail,t.operation.zPass]):null}const L=new D(M,(t=>({__tag:"DepthWrite",...t})));function M(t){return t?C([t.zNear,t.zFar]):null}const U=new D(j,(t=>({__tag:"ColorWrite",...t})));function j(t){return t?C([t.r,t.g,t.b,t.a]):null}const K=new D(Z,(t=>({__tag:"StencilWrite",...t})));function Z(t){return t?C([t.mask]):null}const x=new D(q,(t=>({__tag:"DrawBuffers",...t})));function q(t){return t?C(t.buffers):null}const G=new D(J,(t=>({blending:v(t.blending),culling:I(t.culling),polygonOffset:S(t.polygonOffset),depthTest:W(t.depthTest),stencilTest:b(t.stencilTest),depthWrite:T(t.depthWrite),colorWrite:w(t.colorWrite),stencilWrite:O(t.stencilWrite),drawBuffers:A(t.drawBuffers)})));function J(t){return t?C([y(t.blending),m(t.culling),E(t.polygonOffset),z(t.depthTest),H(t.stencilTest),M(t.depthWrite),j(t.colorWrite),Z(t.stencilWrite),q(t.drawBuffers)]):null}class Q{constructor(t){this._pipelineInvalid=!0,this._blendingInvalid=!0,this._cullingInvalid=!0,this._polygonOffsetInvalid=!0,this._depthTestInvalid=!0,this._stencilTestInvalid=!0,this._depthWriteInvalid=!0,this._colorWriteInvalid=!0,this._stencilWriteInvalid=!0,this._drawBuffersInvalid=!0,this._stateSetters=t}setPipeline(t){(this._pipelineInvalid||t!==this._pipeline)&&(this._setBlending(t.blending),this._setCulling(t.culling),this._setPolygonOffset(t.polygonOffset),this._setDepthTest(t.depthTest),this._setStencilTest(t.stencilTest),this._setDepthWrite(t.depthWrite),this._setColorWrite(t.colorWrite),this._setStencilWrite(t.stencilWrite),this._setDrawBuffers(t.drawBuffers),this._pipeline=t),this._pipelineInvalid=!1}invalidateBlending(){this._blendingInvalid=!0,this._pipelineInvalid=!0}invalidateCulling(){this._cullingInvalid=!0,this._pipelineInvalid=!0}invalidatePolygonOffset(){this._polygonOffsetInvalid=!0,this._pipelineInvalid=!0}invalidateDepthTest(){this._depthTestInvalid=!0,this._pipelineInvalid=!0}invalidateStencilTest(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDepthWrite(){this._depthWriteInvalid=!0,this._pipelineInvalid=!0}invalidateColorWrite(){this._colorWriteInvalid=!0,this._pipelineInvalid=!0}invalidateStencilWrite(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDrawBuffers(){this._drawBuffersInvalid=!0,this._pipelineInvalid=!0}_setBlending(t){this._blending=this._setSubState(t,this._blending,this._blendingInvalid,this._stateSetters.setBlending),this._blendingInvalid=!1}_setCulling(t){this._culling=this._setSubState(t,this._culling,this._cullingInvalid,this._stateSetters.setCulling),this._cullingInvalid=!1}_setPolygonOffset(t){this._polygonOffset=this._setSubState(t,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset),this._polygonOffsetInvalid=!1}_setDepthTest(t){this._depthTest=this._setSubState(t,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest),this._depthTestInvalid=!1}_setStencilTest(t){this._stencilTest=this._setSubState(t,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest),this._stencilTestInvalid=!1}_setDepthWrite(t){this._depthWrite=this._setSubState(t,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite),this._depthWriteInvalid=!1}_setColorWrite(t){this._colorWrite=this._setSubState(t,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite),this._colorWriteInvalid=!1}_setStencilWrite(t){this._stencilWrite=this._setSubState(t,this._stencilWrite,this._stencilWriteInvalid,this._stateSetters.setStencilWrite),this._stencilTestInvalid=!1}_setDrawBuffers(t){this._drawBuffers=this._setSubState(t,this._drawBuffers,this._drawBuffersInvalid,this._stateSetters.setDrawBuffers),this._drawBuffersInvalid=!1}_setSubState(t,e,i,n){return(i||t!==e)&&(n(t),this._pipelineInvalid=!0),t}}export{Q as StateTracker,d as backFaceCullingParams,o as blendWithPremultipliedAlpha,f as cullingParams,g as defaultColorWrite,p as defaultDepthWrite,u as frontFaceCullingParams,_ as keepSourceValues,v as makeBlending,w as makeColorWrite,I as makeCulling,W as makeDepthTest,T as makeDepthWrite,A as makeDrawBuffers,B as makePipelineState,S as makePolygonOffset,b as makeStencilTest,O as makeStencilWrite,c as premultipliedAlphaToPremultipliedAlpha,r as separateBlendingParams,l as simpleBlendingParams,h as weightedAdd,a as writeDestinationPremultipliedAlpha};
5
+ import{CullFaceOptions as t}from"../3d/webgl-engine/lib/basicInterfaces.js";import{BlendFactor as e,Face as i,CullMode as n,BlendOperation as s}from"./enums.js";function l(t,e,i=s.ADD,n=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:n[0],g:n[1],b:n[2],a:n[3]}}}function r(t,e,i,n,l=s.ADD,r=s.ADD,a=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:n,opRgb:l,opAlpha:r,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}const a=l(e.ZERO,e.ONE_MINUS_SRC_ALPHA),_=l(e.ONE,e.ZERO),h=l(e.ONE,e.ONE),o=l(e.ONE,e.ONE_MINUS_SRC_ALPHA),c=r(e.SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),d={face:i.BACK,mode:n.CCW},u={face:i.FRONT,mode:n.CCW},f=e=>e===t.Back?d:e===t.Front?u:null,p={zNear:0,zFar:1},g={r:!0,g:!0,b:!0,a:!0};function v(t){return R.intern(t)}function I(t){return N.intern(t)}function S(t){return P.intern(t)}function W(t){return k.intern(t)}function b(t){return F.intern(t)}function T(t){return L.intern(t)}function w(t){return U.intern(t)}function O(t){return K.intern(t)}function A(t){return x.intern(t)}function B(t){return G.intern(t)}class D{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function C(t){return"["+t.join(",")+"]"}const R=new D(y,(t=>({__tag:"Blending",...t})));function y(t){return t?C([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const N=new D(m,(t=>({__tag:"Culling",...t})));function m(t){return t?C([t.face,t.mode]):null}const P=new D(E,(t=>({__tag:"PolygonOffset",...t})));function E(t){return t?C([t.factor,t.units]):null}const k=new D(z,(t=>({__tag:"DepthTest",...t})));function z(t){return t?C([t.func]):null}const F=new D(H,(t=>({__tag:"StencilTest",...t})));function H(t){return t?C([t.function.func,t.function.ref,t.function.mask,t.operation.fail,t.operation.zFail,t.operation.zPass]):null}const L=new D(M,(t=>({__tag:"DepthWrite",...t})));function M(t){return t?C([t.zNear,t.zFar]):null}const U=new D(j,(t=>({__tag:"ColorWrite",...t})));function j(t){return t?C([t.r,t.g,t.b,t.a]):null}const K=new D(Z,(t=>({__tag:"StencilWrite",...t})));function Z(t){return t?C([t.mask]):null}const x=new D(q,(t=>({__tag:"DrawBuffers",...t})));function q(t){return t?C(t.buffers):null}const G=new D(J,(t=>({blending:v(t.blending),culling:I(t.culling),polygonOffset:S(t.polygonOffset),depthTest:W(t.depthTest),stencilTest:b(t.stencilTest),depthWrite:T(t.depthWrite),colorWrite:w(t.colorWrite),stencilWrite:O(t.stencilWrite),drawBuffers:A(t.drawBuffers)})));function J(t){return t?C([y(t.blending),m(t.culling),E(t.polygonOffset),z(t.depthTest),H(t.stencilTest),M(t.depthWrite),j(t.colorWrite),Z(t.stencilWrite),q(t.drawBuffers)]):null}class Q{constructor(t){this._pipelineInvalid=!0,this._blendingInvalid=!0,this._cullingInvalid=!0,this._polygonOffsetInvalid=!0,this._depthTestInvalid=!0,this._stencilTestInvalid=!0,this._depthWriteInvalid=!0,this._colorWriteInvalid=!0,this._stencilWriteInvalid=!0,this._drawBuffersInvalid=!0,this._stateSetters=t}setPipeline(t){(this._pipelineInvalid||t!==this._pipeline)&&(this._setBlending(t.blending),this._setCulling(t.culling),this._setPolygonOffset(t.polygonOffset),this._setDepthTest(t.depthTest),this._setStencilTest(t.stencilTest),this._setDepthWrite(t.depthWrite),this._setColorWrite(t.colorWrite),this._setStencilWrite(t.stencilWrite),this._setDrawBuffers(t.drawBuffers),this._pipeline=t),this._pipelineInvalid=!1}invalidateBlending(){this._blendingInvalid=!0,this._pipelineInvalid=!0}invalidateCulling(){this._cullingInvalid=!0,this._pipelineInvalid=!0}invalidatePolygonOffset(){this._polygonOffsetInvalid=!0,this._pipelineInvalid=!0}invalidateDepthTest(){this._depthTestInvalid=!0,this._pipelineInvalid=!0}invalidateStencilTest(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDepthWrite(){this._depthWriteInvalid=!0,this._pipelineInvalid=!0}invalidateColorWrite(){this._colorWriteInvalid=!0,this._pipelineInvalid=!0}invalidateStencilWrite(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDrawBuffers(){this._drawBuffersInvalid=!0,this._pipelineInvalid=!0}_setBlending(t){this._blending=this._setSubState(t,this._blending,this._blendingInvalid,this._stateSetters.setBlending),this._blendingInvalid=!1}_setCulling(t){this._culling=this._setSubState(t,this._culling,this._cullingInvalid,this._stateSetters.setCulling),this._cullingInvalid=!1}_setPolygonOffset(t){this._polygonOffset=this._setSubState(t,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset),this._polygonOffsetInvalid=!1}_setDepthTest(t){this._depthTest=this._setSubState(t,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest),this._depthTestInvalid=!1}_setStencilTest(t){this._stencilTest=this._setSubState(t,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest),this._stencilTestInvalid=!1}_setDepthWrite(t){this._depthWrite=this._setSubState(t,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite),this._depthWriteInvalid=!1}_setColorWrite(t){this._colorWrite=this._setSubState(t,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite),this._colorWriteInvalid=!1}_setStencilWrite(t){this._stencilWrite=this._setSubState(t,this._stencilWrite,this._stencilWriteInvalid,this._stateSetters.setStencilWrite),this._stencilTestInvalid=!1}_setDrawBuffers(t){this._drawBuffers=this._setSubState(t,this._drawBuffers,this._drawBuffersInvalid,this._stateSetters.setDrawBuffers),this._drawBuffersInvalid=!1}_setSubState(t,e,i,n){return(i||t!==e)&&(n(t),this._pipelineInvalid=!0),t}}export{Q as StateTracker,h as add,d as backFaceCullingParams,_ as copySource,f as cullingParams,g as defaultColorWrite,p as defaultDepthWrite,a as destinationTimesOneMinusSourceAlpha,u as frontFaceCullingParams,v as makeBlending,w as makeColorWrite,I as makeCulling,W as makeDepthTest,T as makeDepthWrite,A as makeDrawBuffers,B as makePipelineState,S as makePolygonOffset,b as makeStencilTest,O as makeStencilWrite,o as premultipliedAlpha,r as separateBlendingParams,l as simpleBlendingParams,c as unpremultipliedAlphaToPremultipliedAlpha};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{BufferObject as e}from"./BufferObject.js";import{TextureWrapMode as r,PixelType as t,SizedPixelFormat as o,TextureSamplingMode as n,Usage as i,DataType as s,PrimitiveType as a,ErrorConstant as p}from"./enums.js";import{FramebufferObject as c}from"./FramebufferObject.js";import{makePipelineState as m,writeDestinationPremultipliedAlpha as f}from"./renderState.js";import{TextureDescriptor as l}from"./TextureDescriptor.js";import{VertexArrayObject as u}from"./VertexArrayObject.js";import{VertexElementDescriptor as b}from"./VertexElementDescriptor.js";import{WebGLDriverTestModule as d}from"./WebGLDriverTestModule.js";class g extends d{constructor(e){if(super(),this._rctx=e,!e.gl)return;if(!(e.capabilities.colorBufferFloat?.textureFloat&&e.capabilities.colorBufferFloat?.floatBlend))return;const r="\n precision highp float;\n attribute vec2 a_pos;\n\n void main() {\n gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n }\n ",t="\n precision highp float;\n\n void main() {\n gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5);\n }\n ";this._program=e.programCache.acquire(r,t,new Map([["a_pos",0]]))}_test(d){const g=this._rctx,_=new l(1);_.wrapMode=r.CLAMP_TO_EDGE,_.dataType=t.FLOAT,_.internalFormat=o.RGBA32F,_.samplingMode=n.NEAREST;const w=new c(g,_),A=e.createVertex(g,i.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),T=new u(g,new Map([["a_pos",0]]),new Map([["geometry",[new b("a_pos",2,s.UNSIGNED_SHORT,0,4)]]]),new Map([["geometry",A]]));g.gl.getError(),g.useProgram(d);const j=g.getBoundFramebufferObject(),{x,y:E,width:h,height:F}=g.getViewport();g.bindFramebuffer(w),g.setViewport(0,0,1,1),g.bindVAO(T),g.drawArrays(a.TRIANGLE_STRIP,0,4);const O=m({blending:f});g.setPipelineState(O),g.drawArrays(a.TRIANGLE_STRIP,0,4);const y=g.gl.getError();return g.setViewport(x,E,h,F),g.bindFramebuffer(j),T.dispose(),w.dispose(),y!==p.INVALID_OPERATION||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}}export{g as FloatBufferBlend};
5
+ import{BufferObject as e}from"./BufferObject.js";import{TextureWrapMode as r,PixelType as t,SizedPixelFormat as o,TextureSamplingMode as n,Usage as i,DataType as s,PrimitiveType as a,ErrorConstant as p}from"./enums.js";import{FramebufferObject as c}from"./FramebufferObject.js";import{makePipelineState as m,destinationTimesOneMinusSourceAlpha as f}from"./renderState.js";import{TextureDescriptor as l}from"./TextureDescriptor.js";import{VertexArrayObject as u}from"./VertexArrayObject.js";import{VertexElementDescriptor as b}from"./VertexElementDescriptor.js";import{WebGLDriverTestModule as d}from"./WebGLDriverTestModule.js";class g extends d{constructor(e){if(super(),this._rctx=e,!e.gl)return;if(!(e.capabilities.colorBufferFloat?.textureFloat&&e.capabilities.colorBufferFloat?.floatBlend))return;const r="\n precision highp float;\n attribute vec2 a_pos;\n\n void main() {\n gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n }\n ",t="\n precision highp float;\n\n void main() {\n gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5);\n }\n ";this._program=e.programCache.acquire(r,t,new Map([["a_pos",0]]))}_test(d){const g=this._rctx,_=new l(1);_.wrapMode=r.CLAMP_TO_EDGE,_.dataType=t.FLOAT,_.internalFormat=o.RGBA32F,_.samplingMode=n.NEAREST;const w=new c(g,_),A=e.createVertex(g,i.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),T=new u(g,new Map([["a_pos",0]]),new Map([["geometry",[new b("a_pos",2,s.UNSIGNED_SHORT,0,4)]]]),new Map([["geometry",A]]));g.gl.getError(),g.useProgram(d);const j=g.getBoundFramebufferObject(),{x,y:E,width:h,height:F}=g.getViewport();g.bindFramebuffer(w),g.setViewport(0,0,1,1),g.bindVAO(T),g.drawArrays(a.TRIANGLE_STRIP,0,4);const O=m({blending:f});g.setPipelineState(O),g.drawArrays(a.TRIANGLE_STRIP,0,4);const y=g.gl.getError();return g.setViewport(x,E,h,F),g.bindFramebuffer(j),T.dispose(),w.dispose(),y!==p.INVALID_OPERATION||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}}export{g as FloatBufferBlend};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import a from"../../core/Error.js";import{makeHandle as i,handlesGroup as r,abortHandle as s}from"../../core/handleUtils.js";import"../../core/has.js";import o from"../../core/Logger.js";import{removeMaybe as n,destroyMaybe as l}from"../../core/maybe.js";import{isPromiseLike as d,debounce as c}from"../../core/promiseUtils.js";import{watch as u,when as h,initial as p,whenOnce as m,syncAndInitial as f}from"../../core/reactiveUtils.js";import{generateBracedUUID as w}from"../../core/uuid.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import{isSharedTemplateOrMetadata as v,isSharedTemplate as F,isStandardFeatureTemplate as _}from"../../editing/templateUtils.js";import{createTemplateExecutor as b}from"../../editing/sharedTemplates/executor/createTemplateExecutor.js";import M from"../../layers/GraphicsLayer.js";import{isTable as I}from"../../layers/support/layerUtils.js";import{getDisplayedSymbol as V}from"../../symbols/support/symbolUtils.js";import{getDrawHelpMessage as k}from"../../views/draw/support/helpMessageUtils.js";import S from"../../views/draw/support/HighlightHelper.js";import C from"../../views/interactive/sketch/SketchOptions.js";import A from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{temporaryHighlightName as E}from"../../views/support/HighlightDefaults.js";import P from"./CreateFeaturesWorkflowData.js";import{isModelUpload as T,handleModelUpload as H}from"./modelUploadUtils.js";import j from"./Workflow.js";import{createToolFromGeometryType as U,getServiceEditsFromWorkflowData as L,getServiceInfoForLayer as x,orderEditsByRelationshipDependencies as O,getFullTemplateForCreationInfo as W,getServiceLayersById as D,startCreatingNewFeature as R,findLayerInfo as z,updateGraphicSymbolWhenRequired as G,isTerminalUpdateEventType as N,getVisualVariableAttributes as K,startUpdatingFeatureGeometry as Z,createWorkflowSteps as q,avoidFeatureTemplateSelectionWithOnlyOneItem as B,getCreationAttributes as J,setRelationshipFields as Q,prepareAttachmentsForCreateFeaturesWorkflow as X,showProgressCursor as Y,setUpSketchCreateWatchers as $,setVisualVariablesAndElevationInfoForUpdate as ee,visualVariableInteractiveUpdate as te}from"./workflowUtils.js";import ae from"../FeatureForm/FeatureFormViewModel.js";import ie from"../Sketch/SketchViewModel.js";var re;const se=Symbol(),oe=Symbol(),ne=Symbol(),le=Symbol(),de={point:["point"],multipoint:["multipoint"],polygon:["polygon","freehandPolygon","rectangle","circle"],polyline:["polyline","freehandPolyline"],mesh:[],multipatch:[]};let ce=re=class extends j{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._webStyleCache=new Map,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._featureFormViewModel=new ae,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._isActive=!0}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get featureFormViewModel(){return this._featureFormViewModel}get hasPendingEdits(){if(this.pendingFeatures.some((e=>!!this.data.getEditsForPendingFeature(e)?.modified)))return!0;const{creationInfo:e,upload:t}=this.data,a=this._sketchViewModel,{activeComponent:i}=a,r=a.createGraphic?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==i?.type&&"draw-3d"!==i?.type)&&i.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get hasPreviousStep(){return this._stepIndex>0||"update-pending"===this.createFeatureState&&!!this.data.selectedPendingFeature&&!this.parent&&!T(this.data.creationInfo)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const a=e.layer.geometryType,i=this._sketchViewModel.createGraphic;if("mesh"===a){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then((e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage}));const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(i,e):void 0}const r=this._sketchViewModel.activeCreateToolDrawMode,s=this._sketchViewModel.activeTool;return k("rectangle"===s?"rectangle":"circle"===s?"circle":a,i?.geometry,r)}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get numPendingFeaturesExcludingHidden(){return this.pendingFeatures.filter((e=>this.data.isDisplayable(e))).length}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get shouldShowAttachments(){return(this.data.selectedPendingFeature&&this.data.editorItem?.capabilities.create.attachments.enabled)??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchViewModel(){return this._sketchViewModel}get test(){}get availableCreateTools(){const e=this.data.creationInfo?.layer.geometryType,t=this.data.viewModel.view;if(!e)return[];if(this.data.creationInfo?.maxFeatures&&this.data.creationInfo.maxFeatures<=this.numPendingFeatures)return[];if(v(this.data.fullTemplate)){const{tool:t}=U(e,this.data.fullTemplate);return[t]}return"2d"!==t?.type&&"multipoint"===e?[]:[...de[e]]}get _attachmentsActive(){const e=this.data.viewModel.attachmentsViewModel.mode,t=this.stepId;return this.shouldShowAttachments&&("add"===e||"edit"===e||"adding-attachment"===t||"editing-attachment"===t)}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&await this._updatingHandles.addPromise(this._setUpCreatingFeaturesStep())}exit(){this._isActive=!1,this.removeHandles([ne])}async updatePendingFeature(e){if(e!==this.data.selectedPendingFeature)return this._sketchViewModel.cancel(),this._startUpdating({feature:e})}async start(){return await super.start(),I(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}async save(){const{featureFormViewModel:e}=this;if(e.pendingSubtypeChoice)return;e.submit(),this._stashValidationState();const t=this.data.selectedPendingFeature,a=this._hasValidationErrors(t)?t:this.data.pendingFeatures.find((e=>this._hasValidationErrors(e)));return a?(await this._startUpdating({feature:a}),void e?.submit()):super.save()}back(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||T(this.data.creationInfo)||this._attachmentsActive||this.parent?super.back(e):this._clearSelectedFeature()}previous(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||T(this.data.creationInfo)||this._attachmentsActive?super.previous(e):this._clearSelectedFeature()}cancelFeature(e){this.data.isSharedTemplateWorkflow?o.getLogger(this).warn("Cannot cancel individual features created by shared templates."):(this.data.removePendingFeature(e),this.sketchViewModel.layer.graphics.remove(e))}static create(e){const{addAttachmentsCallback:t,applyEditsCallback:a,applyEditsFeatureServiceCallback:i,isNested:r,creationInfo:s,parent:o,snappingManager:n,startAt:l,viewModel:d}=e,c=e.sketchOptions??new C,u=s?.layer,h=u?d.findEditorItemForLayer(u):void 0,p=new re({data:new P({creationInfo:s,editorItem:h,parent:o,sketchOptions:c,snappingManager:n,viewModel:d}),isNested:r,onCommit:async e=>{const{creationInfo:r}=e;if(!r)return;p._sketchViewModel.cancel();const s=e.pendingFeatures.toArray(),{layer:o}=r,n=o.capabilities?.editing.supportsGlobalId&&"globalIdField"in o,l=p._attachmentFileInfos,{fullTemplate:c}=e,u=L(p.data),h=F(c)&&u;if(n){if(me(s),h){let t=we(u,l);const a=await x(o,d.view);a&&(t=O({edits:t,serviceInfo:a,view:d.view,findOriginalFeature:t=>e.getEditsForPendingFeature(t)?.initialFeature??t})),await i(c.featureService,t,{globalIdUsed:!0,gdbVersion:c.layer.gdbVersion??void 0})}else{const e=fe(s,l);await a(o,e,{globalIdUsed:!0})}return}const m=h?await i(c.featureService,u,{gdbVersion:c.layer.gdbVersion??void 0}):[await a(o,{addFeatures:s})];m&&l.size>0&&await Promise.all(m.map((e=>{if(e?.addFeatureResults)return t(o,pe(s,e.addFeatureResults,o,l))})))}});return p._set("steps",this._createWorkflowSteps(p,l)),p}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",i((()=>e.effect=t))}const t=e.opacity;return e.opacity=.7,i((()=>e.opacity=t))}async _initializeFullTemplateAndExecutorInfo(e){const{creationInfo:t}=e,{view:a}=e.viewModel;if(!t||!a)return null;const i=await W(t,a);if(e.fullTemplate=i,i&&F(i)){const r={completionResults:[],executor:await b(i),serviceLayersById:await D(t.layer,a)};e.templateExecutorInfo=r}return i}async _startCreating(){this.removeHandles(oe);const{data:e}=this;if(!e.creationInfo)return;const t=this.data.creationInfo?.maxFeatures;if(t&&this.numPendingFeatures>=t)return this.sketchViewModel.cancel(),void(this.numPendingFeatures&&await this._startUpdating({feature:this.pendingFeatures.at(-1)}));this.createFeatureState="create-new",await R(this._sketchViewModel,e,this._webStyleCache)}async _clearSelectedFeature(){const e=this._featureFormViewModel.pendingSubtypeChoice;e&&(e.resolve("undo"),await e.promise),this._stashValidationState(),this.sketchViewModel.cancel(),this.data.selectedPendingFeature=null,this._featureFormHandle=n(this._featureFormHandle),this._featureFormViewModel.feature=null;const t=this.data.viewModel.attachmentsViewModel;"add"!==t.mode&&"edit"!==t.mode||this.data.viewModel.activeWorkflow?.previous()}_stashValidationState(){const e=this._featureFormViewModel.feature,t=e&&this.data.getEditsForPendingFeature(e);t&&(t.submittable=this._featureFormViewModel.submittable)}async _selectFeatureForUpdate({feature:e,initialFeature:t=e}){this._stashValidationState();const{data:a,pendingFeatures:i,_webStyleCache:s}=this;i.includes(e)||a.addPendingFeature(e,t),a.selectedPendingFeature=e;const{_featureFormViewModel:o,_sketchViewModel:l}=this,{creationInfo:d,viewModel:c}=a,{attachmentsViewModel:h,layerInfos:p,view:m}=c;if(!m||!d)return;n(this._featureFormHandle);const f=e.sourceLayer,w=z(p,f),g=w?.formTemplate,y=m.spatialReference;o.set({arcadeEditType:"INSERT",feature:e,formTemplate:g,spatialReference:y,map:m.map}),"add"!==h.mode&&"edit"!==h.mode||c.activeWorkflow?.previous(),h.graphic=e,h.fileInfos.removeAll(),h.mode="view";(this._attachmentFileInfos.get(e)||[]).forEach((({file:e,form:t})=>h.addFile(e,t))),await G(e,s,"2d"===m.type?m.scale:null);const v=a.getEditsForPendingFeature(e);this._featureFormHandle=r([o.on("value-change",(async()=>{v?.updateAttributes(o.getValues()),await G(e,s,"2d"===m.type?m.scale:null)})),l.on(["update","undo","redo"],(e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&N(e.toolEventInfo.type))&&o.notifyFeatureGeometryChanged()})),u((()=>o.feature?.sourceLayer),(t=>e.sourceLayer=t)),u((()=>[o.feature,o.submittable]),(()=>this._stashValidationState()))]),this.createFeatureState="update-pending"}async _startUpdating({feature:e,initialFeature:t=e}){await this._selectFeatureForUpdate({feature:e,initialFeature:t});const{_sketchViewModel:a,data:i}=this,{creationInfo:r,viewModel:s}=i,{view:o}=s;if(!o||!r)return;const n=e.sourceLayer??r.layer;return I(n)?void 0:(this._visualVariableAttributes=K(e),Z({graphic:e,sketchViewModel:a,sourceLayer:n,visualVariables:this._visualVariableAttributes,webStyleCache:this._webStyleCache}))}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=q(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(T(t)?e.addHandles(await H({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&e.addHandles(i.restrictFeatureTemplatesViewModelToLayer(t.layer),this.id),e.addHandles(i.featureTemplatesViewModel.on("select",(({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())})),this.id)))},async tearDown(){e.removeHandles(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([ne,se,oe,le]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return B(a,i)}static _configureSketchViewModel(e){const{data:t}=e,a=e._webStyleCache,{creationInfo:s,viewModel:o}=t,{view:n}=o,l=e._sketchViewModel,d=[];if(!n)return i();if("2d"===n.type){s&&d.push(e._fadeExistingFeatures(s.layer));const t=c(((e,t)=>Promise.all(e.map((e=>G(e,a,t))))));d.push(u((()=>n.scale),(e=>t(l.layer.graphics,e))))}const p=J(t.fullTemplate,s?.attributeOverrides),m=u((()=>l.createGraphic),(i=>{i&&!e.hasHandles(oe)&&e._updatingHandles.addPromise($({creationAttributes:p,data:t,sketchViewModel:l,view:n,webStyleCache:a}).then((t=>e.addHandles(t,oe))))})),f=async t=>{if("cancel"!==t.state&&"complete"!==t.state||e.removeHandles(oe),"cancel"===t.state&&null!==n.activeTool&&n.activeTool!==e.sketchViewModel.activeComponent&&(await e._waitForActiveToolCleared(),await e._startCreating()),"complete"===t.state&&t.graphic){const a=await e._processEdits(t.graphic,{scale:"2d"===n.type?n.scale:null,useSourceLayer:!0,webStyleCache:e._webStyleCache});a&&(await e._waitForActiveToolCleared(),await e._startUpdating({feature:a}))}},w=async a=>{const{attachmentsViewModel:i}=o,{_featureFormViewModel:r}=e;if(a.graphics.length>1)return void await e._clearSelectedFeature();const d=a.graphics[0];if("complete"===a.state){const{submittable:t}=r;if(e.numPendingFeatures!==s?.maxFeatures&&t||r.submit(),await e._clearSelectedFeature(),"add"!==i.mode&&"edit"!==i.mode||o.activeWorkflow?.previous(),!a.aborted&&n.activeTool===e.sketchViewModel.activeComponent&&(await e.sketchViewModel.wait(),"ready"===e.sketchViewModel.state&&"mesh"!==e.data.creationInfo?.layer.geometryType))return e._startCreating()}else{if("start"===a.state)return d.sourceLayer??=t.creationInfo?.layer,await ee({sketchViewModel:l,graphic:d,visualVariables:e._visualVariableAttributes,webStyleCache:e._webStyleCache,sourceLayer:d.sourceLayer}),e._selectFeatureForUpdate({feature:d});if("active"===a.state){await e.updatePendingFeature(d);const t=e._visualVariableAttributes;await te(n,d,a,t,e._webStyleCache);const i=d.attributes,{rotation:s,size:o}=t;if(null!=s){const{field:e}=s;r.setValue(e,i[e])}if(null!=o){const{field:e}=o;r.setValue(e,i[e])}}}},g=async a=>{if(a.graphics.forEach((e=>{t.removePendingFeature(e)})),!T(t.creationInfo))return e._startCreating()},y=async()=>{if(T(t.creationInfo))try{await e.data.viewModel.back()}catch{}return e._startCreating()};d.push(m,l.on("create",(t=>e._updatingHandles.addPromise(f(t)))),l.on("update",(t=>e._updatingHandles.addPromise(w(t)))),l.on("delete",(t=>e._updatingHandles.addPromise(g(t)))),h((()=>!e.numPendingFeatures),(()=>e._updatingHandles.addPromise(y()))),i((()=>{l.cancel()})),ue(l,t),...he(t));const v=r(d);return l.addHandles(v),v}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new M({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide",title:"createFeaturesWorkflow-internal"}),r=new ie({layer:a,creationMode:"single",sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,defaultUpdateOptions:{multipleSelectionEnabled:!1},view:t});this._sketchViewModel=r,t?.map.add(a),this.addHandles([i((()=>{t?.destroyed||t?.map.remove(a),a.destroy()})),u((()=>this.numPendingFeatures>0),(e=>this._sketchViewModel.updateOnGraphicClick=e),p)])}_hasValidationErrors(e){return!!e&&(!this.data.isSubmittable(e)||!!this._featureFormViewModel.validateContingencyConstraints(e.attributes,{includeIncompleteViolations:!0})?.length)}async _processEdits(e,t){const{data:a,_featureFormViewModel:i}=this,{layerInfos:r,view:s}=a.viewModel;i.arcadeEditType="INSERT",i.map=s?.map,i.spatialReference=s?.spatialReference;const{templateExecutorInfo:o}=a;if(!o){const t=e.clone();return t.geometry=null,await this._addAndInitializeEdits(e,t),e}const n=this.sketchViewModel.layer;n.remove(e);const{executor:l}=o,c=l(e.geometry,"completion"),u=d(c)?await c:c;o.completionResults.push(u),Q(u.relationships),i.arcadeEditType="INSERT",i.map=s?.map,i.spatialReference=s?.spatialReference,u.primary&&a.creationInfo?.attributeOverrides&&(u.primary.graphic.attributes={...u.primary.graphic.attributes,...a.creationInfo.attributeOverrides});for(const d of u.edits){let e=null;if(d.addFeatures)for(const a of d.addFeatures){const i=a.clone();i.geometry=null,null!=a.geometry&&(a.symbol=await V(a,t),n.add(a)),a.sourceLayer!==e?.layer&&(e=z(r,a.sourceLayer));const s=!!u.associationGraphics?.has(a);await this._addAndInitializeEdits(a,i,e,s)}}i.feature=null,await m((()=>!i.updating));return u.edits.reduce(((e,t)=>e+(t.addFeatures?.length??0)),0)>1?null:u.primary?.graphic}async _addAndInitializeEdits(e,t,a,i=!1){const{data:r,_featureFormViewModel:s}=this,{layerInfos:o}=r.viewModel,n=r.addPendingFeature(e,t,{isAssociation:i});a??=z(o,e.sourceLayer),s.feature=e,s.formTemplate=a?.formTemplate,await m((()=>!s.updating)),n.submittable=s.submittable}async _setUpCreatingFeaturesStep(){if(this.hasHandles(ne))return;const{data:e,sketchViewModel:s}=this,{creationInfo:o,viewModel:l}=e,{attachmentsViewModel:d,view:c}=l;if(!c||!o?.layer)throw new a("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");const{initialFeature:h,layer:m}=o,f=[],w=[];this._featureFormHandle=n(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},e.editorItem=l.findEditorItemForLayer(o.layer),o.template&&(null==e.fullTemplate&&await this._initializeFullTemplateAndExecutorInfo(e),w.push(i((()=>{e.templateExecutorInfo&&(e.templateExecutorInfo.completionResults=[])})))),s.allowDeleteKey=!e.isSharedTemplateWorkflow,X(d),f.push(u((()=>d.mode),(e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}})));const g=Y(c);f.push(g);const y=I(o.layer),{template:F}=o,b=!F||_(F)||v(F)&&"feature"===F.type,M=y&&b;try{if(M){const a=h??new t({attributes:J(e.fullTemplate,o.attributeOverrides),sourceLayer:m}),i=await this._processEdits(a);i&&await this._startUpdating({feature:i})}else f.push(re._configureSketchViewModel(this)),h?(T(o)&&o.geometryToPlace&&(h.attributes=J(e.fullTemplate,o.attributeOverrides)),s.layer.add(h),await this._startUpdating({feature:h})):await this._startCreating()}finally{g.remove()}const V=i((()=>{for(const t of e.pendingFeatures)s.layer.remove(t),e.removePendingFeature(t)})),k=u((()=>c?.timeZone),(e=>{this._featureFormViewModel.timeZone=e,this.data.timeZone=e}),p),S=i((()=>{T(o)&&l.cancelWorkflow({warnIfNoWorkflow:!1})}));this._featureFormHandle&&f.push(this._featureFormHandle),this.addHandles(f,this._handleKeys.beforeCommit),this.addHandles(w,this._handleKeys.afterCommit),this.addHandles([i((()=>d.fileInfos.removeAll())),r(f),r(w),S,V,k],ne)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(s(t),le),await m((()=>null==e?.activeTool),t.signal),t.abort()}};function ue(e,t){let a=null;const s=()=>e.snappingOptions.featureSources,o=()=>(a=new A({layer:e.layer}),s().add(a),a),n=()=>{null!=a&&(s().remove(a),a=l(a))};return r([u((()=>{const e=t.creationInfo?.layer,a=s().find((t=>t.layer===e));return{hasFeatureLayerSource:!!a,enabled:a?.enabled??!1}}),(({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return n();a??=o(),a.enabled=t}),f),i(n)])}function he(e){const t=e.viewModel.view;if(!t)return[];const a=[];if("3d"===t.type){const r=new S({view:t});a.push(u((()=>e.selectedPendingFeature),((e,t)=>{r.remove(e),r.add(t)})),i((()=>r.destroy())))}const r=new S({view:t,highlightName:E});return a.push(u((()=>e.temporaryHighlightFeature),(e=>{r.removeAll(),r.add(e)})),i((()=>r.destroy()))),a}function pe(e,t,a,i){const r=[];return t.forEach(((t,s)=>{if(!t.error){const o=e[s],n=i.get(o)||[];o.attributes[a.objectIdField]=t.objectId,n.forEach((({form:e})=>r.push({feature:o,attachment:e})))}})),r}function me(e){for(const t of e){const{sourceLayer:e}=t;e&&"globalIdField"in e&&null!=e.globalIdField&&(t.attributes[e.globalIdField]??=w())}}function fe(e,t){const a=[];if(!t||0===t.size)return{addFeatures:e};for(const[i,r]of t)for(const{file:e}of r)a.push({feature:i,attachment:{globalId:w(),data:e}});return a.length?{addFeatures:e,addAttachments:a}:{addFeatures:e}}function we(e,t){return e.map((e=>{const{addFeatures:a}=e;if(!a||0===a.length)return e;const i=[];for(const r of a){const e=t.get(r);if(e)for(const{file:t}of e)i.push({feature:r,attachment:{globalId:w(),data:t}})}return i.length?{...e,addAttachments:i}:e}))}e([g()],ce.prototype,"createFeatureState",void 0),e([g()],ce.prototype,"data",void 0),e([g({constructOnly:!0})],ce.prototype,"isNested",void 0),e([g()],ce.prototype,"featureFormViewModel",null),e([g()],ce.prototype,"hasPendingEdits",null),e([g()],ce.prototype,"hasPreviousStep",null),e([g()],ce.prototype,"_getDrawMeshHelpMessage",void 0),e([g()],ce.prototype,"helpMessage",null),e([g()],ce.prototype,"layer",null),e([g()],ce.prototype,"parent",null),e([g()],ce.prototype,"parentLayer",null),e([g()],ce.prototype,"keyboardCancellationEnabled",null),e([g()],ce.prototype,"reliesOnOwnerAdminPrivileges",null),e([g()],ce.prototype,"shouldShowAttachments",null),e([g()],ce.prototype,"shouldAllowAttachmentEditing",null),e([g()],ce.prototype,"sketchViewModel",null),e([g()],ce.prototype,"availableCreateTools",null),e([g()],ce.prototype,"_attachmentsActive",null),ce=re=e([y("esri.widgets.Editor.CreateFeaturesWorkflow")],ce);const ge=ce;export{ge as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import a from"../../core/Error.js";import{makeHandle as i,handlesGroup as r,abortHandle as s}from"../../core/handleUtils.js";import"../../core/has.js";import o from"../../core/Logger.js";import{removeMaybe as n,destroyMaybe as l}from"../../core/maybe.js";import{isPromiseLike as d,debounce as c}from"../../core/promiseUtils.js";import{watch as u,when as h,initial as p,whenOnce as m,syncAndInitial as f}from"../../core/reactiveUtils.js";import{generateBracedUUID as w}from"../../core/uuid.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import{isSharedTemplateOrMetadata as v,isSharedTemplate as F,isStandardFeatureTemplate as _}from"../../editing/templateUtils.js";import b from"../../layers/GraphicsLayer.js";import{isTable as M}from"../../layers/support/layerUtils.js";import{getDisplayedSymbol as I}from"../../symbols/support/symbolUtils.js";import{getDrawHelpMessage as V}from"../../views/draw/support/helpMessageUtils.js";import k from"../../views/draw/support/HighlightHelper.js";import S from"../../views/interactive/sketch/SketchOptions.js";import C from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{temporaryHighlightName as A}from"../../views/support/HighlightDefaults.js";import E from"./CreateFeaturesWorkflowData.js";import{isModelUpload as P,handleModelUpload as T}from"./modelUploadUtils.js";import H from"./Workflow.js";import{createToolFromGeometryType as j,getServiceEditsFromWorkflowData as U,getServiceInfoForLayer as L,orderEditsByRelationshipDependencies as x,getFullTemplateForCreationInfo as O,getServiceLayersById as W,startCreatingNewFeature as D,findLayerInfo as R,updateGraphicSymbolWhenRequired as z,isTerminalUpdateEventType as G,getVisualVariableAttributes as N,startUpdatingFeatureGeometry as K,createWorkflowSteps as Z,avoidFeatureTemplateSelectionWithOnlyOneItem as q,getCreationAttributes as B,setRelationshipFields as J,prepareAttachmentsForCreateFeaturesWorkflow as Q,showProgressCursor as X,setUpSketchCreateWatchers as Y,setVisualVariablesAndElevationInfoForUpdate as $,visualVariableInteractiveUpdate as ee}from"./workflowUtils.js";import te from"../FeatureForm/FeatureFormViewModel.js";import ae from"../Sketch/SketchViewModel.js";var ie;const re=Symbol(),se=Symbol(),oe=Symbol(),ne=Symbol(),le={point:["point"],multipoint:["multipoint"],polygon:["polygon","freehandPolygon","rectangle","circle"],polyline:["polyline","freehandPolyline"],mesh:[],multipatch:[]};let de=ie=class extends H{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._webStyleCache=new Map,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._featureFormViewModel=new te,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._isActive=!0}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get featureFormViewModel(){return this._featureFormViewModel}get hasPendingEdits(){if(this.pendingFeatures.some((e=>!!this.data.getEditsForPendingFeature(e)?.modified)))return!0;const{creationInfo:e,upload:t}=this.data,a=this._sketchViewModel,{activeComponent:i}=a,r=a.createGraphic?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==i?.type&&"draw-3d"!==i?.type)&&i.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get hasPreviousStep(){return this._stepIndex>0||"update-pending"===this.createFeatureState&&!!this.data.selectedPendingFeature&&!this.parent&&!P(this.data.creationInfo)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const a=e.layer.geometryType,i=this._sketchViewModel.createGraphic;if("mesh"===a){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then((e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage}));const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(i,e):void 0}const r=this._sketchViewModel.activeCreateToolDrawMode,s=this._sketchViewModel.activeTool;return V("rectangle"===s?"rectangle":"circle"===s?"circle":a,i?.geometry,r)}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get numPendingFeaturesExcludingHidden(){return this.pendingFeatures.filter((e=>this.data.isDisplayable(e))).length}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get shouldShowAttachments(){return(this.data.selectedPendingFeature&&this.data.editorItem?.capabilities.create.attachments.enabled)??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchViewModel(){return this._sketchViewModel}get test(){}get availableCreateTools(){const e=this.data.creationInfo?.layer.geometryType,t=this.data.viewModel.view;if(!e)return[];if(this.data.creationInfo?.maxFeatures&&this.data.creationInfo.maxFeatures<=this.numPendingFeatures)return[];if(v(this.data.fullTemplate)){const{tool:t}=j(e,this.data.fullTemplate);return[t]}return"2d"!==t?.type&&"multipoint"===e?[]:[...le[e]]}get _attachmentsActive(){const e=this.data.viewModel.attachmentsViewModel.mode,t=this.stepId;return this.shouldShowAttachments&&("add"===e||"edit"===e||"adding-attachment"===t||"editing-attachment"===t)}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&await this._updatingHandles.addPromise(this._setUpCreatingFeaturesStep())}exit(){this._isActive=!1,this.removeHandles([oe])}async updatePendingFeature(e){if(e!==this.data.selectedPendingFeature)return this._sketchViewModel.cancel(),this._startUpdating({feature:e})}async start(){return await super.start(),M(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}async save(){const{featureFormViewModel:e}=this;if(e.pendingSubtypeChoice)return;e.submit(),this._stashValidationState();const t=this.data.selectedPendingFeature,a=this._hasValidationErrors(t)?t:this.data.pendingFeatures.find((e=>this._hasValidationErrors(e)));return a?(await this._startUpdating({feature:a}),void e?.submit()):super.save()}back(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||P(this.data.creationInfo)||this._attachmentsActive||this.parent?super.back(e):this._clearSelectedFeature()}previous(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||P(this.data.creationInfo)||this._attachmentsActive?super.previous(e):this._clearSelectedFeature()}cancelFeature(e){this.data.isSharedTemplateWorkflow?o.getLogger(this).warn("Cannot cancel individual features created by shared templates."):(this.data.removePendingFeature(e),this.sketchViewModel.layer.graphics.remove(e))}static create(e){const{addAttachmentsCallback:t,applyEditsCallback:a,applyEditsFeatureServiceCallback:i,isNested:r,creationInfo:s,parent:o,snappingManager:n,startAt:l,viewModel:d}=e,c=e.sketchOptions??new S,u=s?.layer,h=u?d.findEditorItemForLayer(u):void 0,p=new ie({data:new E({creationInfo:s,editorItem:h,parent:o,sketchOptions:c,snappingManager:n,viewModel:d}),isNested:r,onCommit:async e=>{const{creationInfo:r}=e;if(!r)return;p._sketchViewModel.cancel();const s=e.pendingFeatures.toArray(),{layer:o}=r,n=o.capabilities?.editing.supportsGlobalId&&"globalIdField"in o,l=p._attachmentFileInfos,{fullTemplate:c}=e,u=U(p.data),h=F(c)&&u;if(n){if(pe(s),h){let t=fe(u,l);const a=await L(o,d.view);a&&(t=x({edits:t,serviceInfo:a,view:d.view,findOriginalFeature:t=>e.getEditsForPendingFeature(t)?.initialFeature??t})),await i(c.featureService,t,{globalIdUsed:!0,gdbVersion:c.layer.gdbVersion??void 0})}else{const e=me(s,l);await a(o,e,{globalIdUsed:!0})}return}const m=h?await i(c.featureService,u,{gdbVersion:c.layer.gdbVersion??void 0}):[await a(o,{addFeatures:s})];m&&l.size>0&&await Promise.all(m.map((e=>{if(e?.addFeatureResults)return t(o,he(s,e.addFeatureResults,o,l))})))}});return p._set("steps",this._createWorkflowSteps(p,l)),p}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",i((()=>e.effect=t))}const t=e.opacity;return e.opacity=.7,i((()=>e.opacity=t))}async _initializeFullTemplateAndExecutorInfo(e){const{creationInfo:t}=e,{view:a}=e.viewModel;if(!t||!a)return null;const i=await O(t,a);if(e.fullTemplate=i,i&&F(i)){const{createTemplateExecutor:r}=await import("../../editing/sharedTemplates/executor/createTemplateExecutor.js"),s={completionResults:[],executor:await r(i),serviceLayersById:await W(t.layer,a)};e.templateExecutorInfo=s}return i}async _startCreating(){this.removeHandles(se);const{data:e}=this;if(!e.creationInfo)return;const t=this.data.creationInfo?.maxFeatures;if(t&&this.numPendingFeatures>=t)return this.sketchViewModel.cancel(),void(this.numPendingFeatures&&await this._startUpdating({feature:this.pendingFeatures.at(-1)}));this.createFeatureState="create-new",await D(this._sketchViewModel,e,this._webStyleCache)}async _clearSelectedFeature(){const e=this._featureFormViewModel.pendingSubtypeChoice;e&&(e.resolve("undo"),await e.promise),this._stashValidationState(),this.sketchViewModel.cancel(),this.data.selectedPendingFeature=null,this._featureFormHandle=n(this._featureFormHandle),this._featureFormViewModel.feature=null;const t=this.data.viewModel.attachmentsViewModel;"add"!==t.mode&&"edit"!==t.mode||this.data.viewModel.activeWorkflow?.previous()}_stashValidationState(){const e=this._featureFormViewModel.feature,t=e&&this.data.getEditsForPendingFeature(e);t&&(t.submittable=this._featureFormViewModel.submittable)}async _selectFeatureForUpdate({feature:e,initialFeature:t=e}){this._stashValidationState();const{data:a,pendingFeatures:i,_webStyleCache:s}=this;i.includes(e)||a.addPendingFeature(e,t),a.selectedPendingFeature=e;const{_featureFormViewModel:o,_sketchViewModel:l}=this,{creationInfo:d,viewModel:c}=a,{attachmentsViewModel:h,layerInfos:p,view:m}=c;if(!m||!d)return;n(this._featureFormHandle);const f=e.sourceLayer,w=R(p,f),g=w?.formTemplate,y=m.spatialReference;o.set({arcadeEditType:"INSERT",feature:e,formTemplate:g,spatialReference:y,map:m.map}),"add"!==h.mode&&"edit"!==h.mode||c.activeWorkflow?.previous(),h.graphic=e,h.fileInfos.removeAll(),h.mode="view";(this._attachmentFileInfos.get(e)||[]).forEach((({file:e,form:t})=>h.addFile(e,t))),await z(e,s,"2d"===m.type?m.scale:null);const v=a.getEditsForPendingFeature(e);this._featureFormHandle=r([o.on("value-change",(async()=>{v?.updateAttributes(o.getValues()),await z(e,s,"2d"===m.type?m.scale:null)})),l.on(["update","undo","redo"],(e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&G(e.toolEventInfo.type))&&o.notifyFeatureGeometryChanged()})),u((()=>o.feature?.sourceLayer),(t=>e.sourceLayer=t)),u((()=>[o.feature,o.submittable]),(()=>this._stashValidationState()))]),this.createFeatureState="update-pending"}async _startUpdating({feature:e,initialFeature:t=e}){await this._selectFeatureForUpdate({feature:e,initialFeature:t});const{_sketchViewModel:a,data:i}=this,{creationInfo:r,viewModel:s}=i,{view:o}=s;if(!o||!r)return;const n=e.sourceLayer??r.layer;return M(n)?void 0:(this._visualVariableAttributes=N(e),K({graphic:e,sketchViewModel:a,sourceLayer:n,visualVariables:this._visualVariableAttributes,webStyleCache:this._webStyleCache}))}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=Z(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(P(t)?e.addHandles(await T({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&e.addHandles(i.restrictFeatureTemplatesViewModelToLayer(t.layer),this.id),e.addHandles(i.featureTemplatesViewModel.on("select",(({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())})),this.id)))},async tearDown(){e.removeHandles(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([oe,re,se,ne]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return q(a,i)}static _configureSketchViewModel(e){const{data:t}=e,a=e._webStyleCache,{creationInfo:s,viewModel:o}=t,{view:n}=o,l=e._sketchViewModel,d=[];if(!n)return i();if("2d"===n.type){s&&d.push(e._fadeExistingFeatures(s.layer));const t=c(((e,t)=>Promise.all(e.map((e=>z(e,a,t))))));d.push(u((()=>n.scale),(e=>t(l.layer.graphics,e))))}const p=B(t.fullTemplate,s?.attributeOverrides),m=u((()=>l.createGraphic),(i=>{i&&!e.hasHandles(se)&&e._updatingHandles.addPromise(Y({creationAttributes:p,data:t,sketchViewModel:l,view:n,webStyleCache:a}).then((t=>e.addHandles(t,se))))})),f=async t=>{if("cancel"!==t.state&&"complete"!==t.state||e.removeHandles(se),"cancel"===t.state&&null!==n.activeTool&&n.activeTool!==e.sketchViewModel.activeComponent&&(await e._waitForActiveToolCleared(),await e._startCreating()),"complete"===t.state&&t.graphic){const a=await e._processEdits(t.graphic,{scale:"2d"===n.type?n.scale:null,useSourceLayer:!0,webStyleCache:e._webStyleCache});a&&(await e._waitForActiveToolCleared(),await e._startUpdating({feature:a}))}},w=async a=>{const{attachmentsViewModel:i}=o,{_featureFormViewModel:r}=e;if(a.graphics.length>1)return void await e._clearSelectedFeature();const d=a.graphics[0];if("complete"===a.state){const{submittable:t}=r;if(e.numPendingFeatures!==s?.maxFeatures&&t||r.submit(),await e._clearSelectedFeature(),"add"!==i.mode&&"edit"!==i.mode||o.activeWorkflow?.previous(),!a.aborted&&n.activeTool===e.sketchViewModel.activeComponent&&(await e.sketchViewModel.wait(),"ready"===e.sketchViewModel.state&&"mesh"!==e.data.creationInfo?.layer.geometryType))return e._startCreating()}else{if("start"===a.state)return d.sourceLayer??=t.creationInfo?.layer,await $({sketchViewModel:l,graphic:d,visualVariables:e._visualVariableAttributes,webStyleCache:e._webStyleCache,sourceLayer:d.sourceLayer}),e._selectFeatureForUpdate({feature:d});if("active"===a.state){await e.updatePendingFeature(d);const t=e._visualVariableAttributes;await ee(n,d,a,t,e._webStyleCache);const i=d.attributes,{rotation:s,size:o}=t;if(null!=s){const{field:e}=s;r.setValue(e,i[e])}if(null!=o){const{field:e}=o;r.setValue(e,i[e])}}}},g=async a=>{if(a.graphics.forEach((e=>{t.removePendingFeature(e)})),!P(t.creationInfo))return e._startCreating()},y=async()=>{if(P(t.creationInfo))try{await e.data.viewModel.back()}catch{}return e._startCreating()};d.push(m,l.on("create",(t=>e._updatingHandles.addPromise(f(t)))),l.on("update",(t=>e._updatingHandles.addPromise(w(t)))),l.on("delete",(t=>e._updatingHandles.addPromise(g(t)))),h((()=>!e.numPendingFeatures),(()=>e._updatingHandles.addPromise(y()))),i((()=>{l.cancel()})),ce(l,t),...ue(t));const v=r(d);return l.addHandles(v),v}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new b({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide",title:"createFeaturesWorkflow-internal"}),r=new ae({layer:a,creationMode:"single",sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,defaultUpdateOptions:{multipleSelectionEnabled:!1},view:t});this._sketchViewModel=r,t?.map.add(a),this.addHandles([i((()=>{t?.destroyed||t?.map.remove(a),a.destroy()})),u((()=>this.numPendingFeatures>0),(e=>this._sketchViewModel.updateOnGraphicClick=e),p)])}_hasValidationErrors(e){return!!e&&(!this.data.isSubmittable(e)||!!this._featureFormViewModel.validateContingencyConstraints(e.attributes,{includeIncompleteViolations:!0})?.length)}async _processEdits(e,t){const{data:a,_featureFormViewModel:i}=this,{layerInfos:r,view:s}=a.viewModel;i.arcadeEditType="INSERT",i.map=s?.map,i.spatialReference=s?.spatialReference;const{templateExecutorInfo:o}=a;if(!o){const t=e.clone();return t.geometry=null,await this._addAndInitializeEdits(e,t),e}const n=this.sketchViewModel.layer;n.remove(e);const{executor:l}=o,c=l(e.geometry,"completion"),u=d(c)?await c:c;o.completionResults.push(u),J(u.relationships),i.arcadeEditType="INSERT",i.map=s?.map,i.spatialReference=s?.spatialReference,u.primary&&a.creationInfo?.attributeOverrides&&(u.primary.graphic.attributes={...u.primary.graphic.attributes,...a.creationInfo.attributeOverrides});for(const d of u.edits){let e=null;if(d.addFeatures)for(const a of d.addFeatures){const i=a.clone();i.geometry=null,null!=a.geometry&&(a.symbol=await I(a,t),n.add(a)),a.sourceLayer!==e?.layer&&(e=R(r,a.sourceLayer));const s=!!u.associationGraphics?.has(a);await this._addAndInitializeEdits(a,i,e,s)}}i.feature=null,await m((()=>!i.updating));return u.edits.reduce(((e,t)=>e+(t.addFeatures?.length??0)),0)>1?null:u.primary?.graphic}async _addAndInitializeEdits(e,t,a,i=!1){const{data:r,_featureFormViewModel:s}=this,{layerInfos:o}=r.viewModel,n=r.addPendingFeature(e,t,{isAssociation:i});a??=R(o,e.sourceLayer),s.feature=e,s.formTemplate=a?.formTemplate,await m((()=>!s.updating)),n.submittable=s.submittable}async _setUpCreatingFeaturesStep(){if(this.hasHandles(oe))return;const{data:e,sketchViewModel:s}=this,{creationInfo:o,viewModel:l}=e,{attachmentsViewModel:d,view:c}=l;if(!c||!o?.layer)throw new a("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");const{initialFeature:h,layer:m}=o,f=[],w=[];this._featureFormHandle=n(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},e.editorItem=l.findEditorItemForLayer(o.layer),o.template&&(null==e.fullTemplate&&await this._initializeFullTemplateAndExecutorInfo(e),w.push(i((()=>{e.templateExecutorInfo&&(e.templateExecutorInfo.completionResults=[])})))),s.allowDeleteKey=!e.isSharedTemplateWorkflow,Q(d),f.push(u((()=>d.mode),(e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}})));const g=X(c);f.push(g);const y=M(o.layer),{template:F}=o,b=!F||_(F)||v(F)&&"feature"===F.type,I=y&&b;try{if(I){const a=h??new t({attributes:B(e.fullTemplate,o.attributeOverrides),sourceLayer:m}),i=await this._processEdits(a);i&&await this._startUpdating({feature:i})}else f.push(ie._configureSketchViewModel(this)),h?(P(o)&&o.geometryToPlace&&(h.attributes=B(e.fullTemplate,o.attributeOverrides)),s.layer.add(h),await this._startUpdating({feature:h})):await this._startCreating()}finally{g.remove()}const V=i((()=>{for(const t of e.pendingFeatures)s.layer.remove(t),e.removePendingFeature(t)})),k=u((()=>c?.timeZone),(e=>{this._featureFormViewModel.timeZone=e,this.data.timeZone=e}),p),S=i((()=>{P(o)&&l.cancelWorkflow({warnIfNoWorkflow:!1})}));this._featureFormHandle&&f.push(this._featureFormHandle),this.addHandles(f,this._handleKeys.beforeCommit),this.addHandles(w,this._handleKeys.afterCommit),this.addHandles([i((()=>d.fileInfos.removeAll())),r(f),r(w),S,V,k],oe)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(s(t),ne),await m((()=>null==e?.activeTool),t.signal),t.abort()}};function ce(e,t){let a=null;const s=()=>e.snappingOptions.featureSources,o=()=>(a=new C({layer:e.layer}),s().add(a),a),n=()=>{null!=a&&(s().remove(a),a=l(a))};return r([u((()=>{const e=t.creationInfo?.layer,a=s().find((t=>t.layer===e));return{hasFeatureLayerSource:!!a,enabled:a?.enabled??!1}}),(({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return n();a??=o(),a.enabled=t}),f),i(n)])}function ue(e){const t=e.viewModel.view;if(!t)return[];const a=[];if("3d"===t.type){const r=new k({view:t});a.push(u((()=>e.selectedPendingFeature),((e,t)=>{r.remove(e),r.add(t)})),i((()=>r.destroy())))}const r=new k({view:t,highlightName:A});return a.push(u((()=>e.temporaryHighlightFeature),(e=>{r.removeAll(),r.add(e)})),i((()=>r.destroy()))),a}function he(e,t,a,i){const r=[];return t.forEach(((t,s)=>{if(!t.error){const o=e[s],n=i.get(o)||[];o.attributes[a.objectIdField]=t.objectId,n.forEach((({form:e})=>r.push({feature:o,attachment:e})))}})),r}function pe(e){for(const t of e){const{sourceLayer:e}=t;e&&"globalIdField"in e&&null!=e.globalIdField&&(t.attributes[e.globalIdField]??=w())}}function me(e,t){const a=[];if(!t||0===t.size)return{addFeatures:e};for(const[i,r]of t)for(const{file:e}of r)a.push({feature:i,attachment:{globalId:w(),data:e}});return a.length?{addFeatures:e,addAttachments:a}:{addFeatures:e}}function fe(e,t){return e.map((e=>{const{addFeatures:a}=e;if(!a||0===a.length)return e;const i=[];for(const r of a){const e=t.get(r);if(e)for(const{file:t}of e)i.push({feature:r,attachment:{globalId:w(),data:t}})}return i.length?{...e,addAttachments:i}:e}))}e([g()],de.prototype,"createFeatureState",void 0),e([g()],de.prototype,"data",void 0),e([g({constructOnly:!0})],de.prototype,"isNested",void 0),e([g()],de.prototype,"featureFormViewModel",null),e([g()],de.prototype,"hasPendingEdits",null),e([g()],de.prototype,"hasPreviousStep",null),e([g()],de.prototype,"_getDrawMeshHelpMessage",void 0),e([g()],de.prototype,"helpMessage",null),e([g()],de.prototype,"layer",null),e([g()],de.prototype,"parent",null),e([g()],de.prototype,"parentLayer",null),e([g()],de.prototype,"keyboardCancellationEnabled",null),e([g()],de.prototype,"reliesOnOwnerAdminPrivileges",null),e([g()],de.prototype,"shouldShowAttachments",null),e([g()],de.prototype,"shouldAllowAttachmentEditing",null),e([g()],de.prototype,"sketchViewModel",null),e([g()],de.prototype,"availableCreateTools",null),e([g()],de.prototype,"_attachmentsActive",null),de=ie=e([y("esri.widgets.Editor.CreateFeaturesWorkflow")],de);const we=de;export{we as default};