@arcgis/core 4.34.0-next.46 → 4.34.0-next.48

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 (91) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{33f3e3d05429f845c139.js → 0b67b16d7e6c030bcfc7.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{17df0f766ee1e323d3fa.js → 46ab551bd19e52e73649.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{d70e1b8b8bee88a7a5b8.js → 574ea32d6c257e0d2079.js} +1 -1
  5. package/assets/esri/core/workers/chunks/5f7dc9657803ae3140a6.js +1 -0
  6. package/assets/esri/core/workers/chunks/6130bc641aa7c1bcaaa8.js +1 -0
  7. package/assets/esri/core/workers/chunks/{14d3039f92b0d96944f0.js → 71acded1b3c0057917a1.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{b3e2e826295620b1a9dd.js → 90a97ffba604c1c35532.js} +22 -11
  9. package/assets/esri/core/workers/chunks/a50026e567b1edff87c6.js +1 -0
  10. package/assets/esri/core/workers/chunks/ad93a2621f75270f06cb.js +1 -0
  11. package/assets/esri/core/workers/chunks/{8bab4c59c9b644224ecb.js → b87ed14fde381f79bc9f.js} +1 -1
  12. package/assets/esri/core/workers/chunks/cfa8b17cf1349f6ed355.js +33 -0
  13. package/assets/esri/core/workers/chunks/{b4304673696fc0774bff.js → f1de768b0a6d345f7e39.js} +1 -1
  14. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  15. package/chunks/BloomBlur.glsl.js +8 -8
  16. package/chunks/BloomComposition.glsl.js +15 -21
  17. package/chunks/bundle.js +1 -1
  18. package/config.js +1 -1
  19. package/editing/templateUtils.js +1 -1
  20. package/kernel.js +1 -1
  21. package/layers/VoxelWasmPerSceneView.js +1 -1
  22. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  23. package/layers/save/featureLayerUtils.js +1 -1
  24. package/layers/support/parquetUtils.js +1 -1
  25. package/package.json +1 -1
  26. package/rest/featureService/FeatureService.js +1 -1
  27. package/rest/networks/support/Subcircuit.js +5 -0
  28. package/rest/sharedTemplates/querySharedTemplates.js +1 -1
  29. package/support/revision.js +1 -1
  30. package/symbols/cim/cimAnalyzer.js +1 -1
  31. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  32. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  33. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  34. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  35. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  36. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  37. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  38. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
  39. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  40. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
  41. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  42. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
  43. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  44. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  45. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  46. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  47. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  48. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  49. package/views/3d/analysis/VolumeMeasurement/CutFillVolumeMeasurementComputation.js +1 -1
  50. package/views/3d/analysis/VolumeMeasurement/CutFillVolumeMeasurementController.js +1 -1
  51. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  52. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  53. package/views/3d/terrain/OverlayRenderer.js +1 -1
  54. package/views/3d/terrain/TerrainRenderer.js +1 -1
  55. package/views/3d/terrain/TerrainSurface.js +1 -1
  56. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  57. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  58. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  59. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
  60. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  61. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  62. package/views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js +1 -1
  63. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  64. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  65. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  66. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  67. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  68. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  69. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  70. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  71. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  72. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  73. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  74. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  75. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  76. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  77. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  78. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  79. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  80. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  81. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  82. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  83. package/widgets/FeatureTable/FieldColumn.js +1 -1
  84. package/widgets/FeatureTable/Grid/Column.js +1 -1
  85. package/widgets/FeatureTable.js +1 -1
  86. package/widgets/support/SelectionList.js +1 -1
  87. package/assets/esri/core/workers/chunks/53e166944a42af027345.js +0 -1
  88. package/assets/esri/core/workers/chunks/73140c5c0beda7ea3703.js +0 -1
  89. package/assets/esri/core/workers/chunks/b1b6300451cc4ccefd46.js +0 -1
  90. package/assets/esri/core/workers/chunks/c5a0976de958b3b01c70.js +0 -22
  91. package/assets/esri/core/workers/chunks/f0ccd7ac83d94cbf40a5.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{ShaderPrimitiveNode as e,cloneShaderNode as n,ShaderConditionNode as r,ShaderPropertyAccessNode as c,ShaderFunctionNode as i,ShaderBlockNode as s,ShaderPropertyAccess2DNode as u,ShaderScopeNode as o}from"./ShaderGraphNode.js";var h,l,a,f,p,d,w,y,m,v,b,x,I,g;function E(t){switch(t.type){case"uint":return C;case"uvec2":return X;case"uvec3":return Y;case"uvec4":return _;default:throw new Error("Found unexpected type")}}function $(t){switch(t.type){case"float":return G;case"vec2":return H;case"vec3":return A;case"vec4":return V;default:throw new Error("Found unexpected type")}}function z(t){switch(t.type){case"int":return C;case"ivec2":return X;case"ivec3":return Y;case"ivec4":return _;default:throw new Error("Found unexpected type")}}function T(t){switch(t.type){case"float":return W;case"vec2":return Z;case"vec3":return tt;case"vec4":return et;default:throw new Error("Found unexpected type")}}function N(t){switch(t.type){case"bool":case"float":case"int":case"uint":return J;case"bvec2":case"vec2":case"ivec2":case"uvec2":return K;case"bvec3":case"vec3":case"ivec3":case"uvec3":return L;case"bvec4":case"vec4":case"ivec4":case"uvec4":return Q;default:throw new Error("Unable to handle type")}}function D(t){switch(t.type){case"bool":case"bvec2":case"bvec3":case"bvec4":return J;case"float":case"vec2":case"vec3":case"vec4":return C;case"int":case"ivec2":case"ivec3":case"ivec4":return W;case"uint":case"uvec2":case"uvec3":case"uvec4":return G;default:throw new Error("Unable to handle type")}}function F(t){switch(t.type){case"float":case"int":case"uint":case"bool":case"sampler2D":return 1;case"vec2":case"ivec2":case"uvec2":case"bvec2":return 2;case"vec3":case"ivec3":case"uvec3":case"bvec3":return 3;case"vec4":case"ivec4":case"uvec4":case"bvec4":case"mat2":return 4;case"mat3":return 9;case"mat4":return 16;case"array":case"array-2d":return t.size*F(t.elementType)}}function k(t){const e=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const n of e)if(n.includes(t))return n.map(t=>it[t]);throw new Error("Unable to find type family")}function M(t){return new Proxy(t,{get(e,n){if("constructor"===n)return new Proxy(e.constructor,{construct:(t,e,n)=>M(new t(...e))});if(n in e)return e[n];if("string"==typeof n){const e=k(t.type);return dt(t,n,e[n.length-1])}}})}function S(t){return new Proxy(t,{construct:(t,e,n)=>M(new t(...e))})}function R(t){return new Proxy(t,{get(e,n){if(n in e)return e[n];if("string"==typeof n){const e=parseInt(n,10);if(!isNaN(e))return dt(t,`[${e}]`,t.elementType.constructor)}}})}function j(t){return new Proxy(t,{construct:(t,e,n)=>R(new t(...e))})}class P extends Error{}let B=class extends e{static{h=this}static{this.type="array"}constructor(t,e){super(),this.elementType=t,this.size=e,this.children=[],this.type="array"}clone(){const t=new h(this.elementType,this.size);return super.cloneInto(t),t}get(t,e){const n=new W(t),r=null!=e?new W(e):null;if(null!=r){return wt(this,n,r,D(this.elementType.constructor))}return dt(this,n,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(t,e,n){return Et(this,t,e,n)}glslFindIndex(t,e,n){return $t(this,t,e,n)}static ofType(t,e){const n={construct:(n,r)=>new h(new t,e)};return new Proxy(h,n)}};B=h=t([j],B);class q extends e{static{this.type="array-2d"}constructor(t,e,n,r=!1){super(),this.elementType=t,this.xSize=e,this.ySize=n,this.isRowMajor=r,this.children=[],this.type="array-2d"}clone(){const t=new q(this.elementType,this.xSize,this.ySize,this.isRowMajor);return super.cloneInto(t),t}get size(){return this.xSize*this.ySize}get(t,e){return this.isRowMajor?this._getRowMajor(t,e):this._getColumnMajor(t,e)}_getColumnMajor(t,e){const n=new W(t);return dt(this,new W(e).add(n.multiply(this.xSize)),this.elementType.constructor)}_getRowMajor(t,e){const n=new W(t),r=new W(e);return dt(this,n.add(r.multiply(this.ySize)),this.elementType.constructor)}static ofType(t,e,n,r=!1){return new Proxy(B,{construct:(c,i)=>new q(new t,e,n,r)})}}class U extends e{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}static{this.type="sampler2D"}clone(){const t=new U;return t.children=this.children.map(n),super.cloneInto(t),t}}class C extends e{static{this.type="float"}constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new C(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}}let X=class extends e{static{l=this}static{this.type="vec2"}constructor(t,e){super(),this.type="vec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new l(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){throw new P}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}};X=l=t([S],X);let Y=class extends e{static{a=this}static{this.type="vec3"}constructor(t,e,n){super(),this.type="vec3",this.children=[t,e,n].filter(t=>null!=t)}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){throw new P}clone(){const t=new a(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}};Y=a=t([S],Y);let _=class extends e{static{f=this}static{this.type="vec4"}constructor(t,e,n,r){super(),this.type="vec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new f(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){return dt(this,"[3]",C)}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}};_=f=t([S],_);let G=class extends e{static{p=this}static{this.type="uint"}constructor(t){super(),this.type="uint",this.children=[t]}clone(){const t=new p(n(this.children[0]));return super.cloneInto(t),t}};G=p=t([S],G);let H=class extends e{static{d=this}static{this.type="uvec2"}constructor(t,e){super(),this.type="uvec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new d(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};H=d=t([S],H);let A=class extends e{static{w=this}static{this.type="uvec3"}constructor(t,e,n){super(),this.type="uvec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new w(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};A=w=t([S],A);let V=class extends e{static{y=this}static{this.type="uvec4"}constructor(t,e,n,r){super(),this.type="uvec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new y(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};V=y=t([S],V);class J extends e{static{this.type="bool"}constructor(t){super(),this.type="bool",this.children=[t]}and(t){return Lt(this,t)}or(t){return At(this,t)}xor(t){return Jt(this,t)}clone(){const t=new J(n(this.children[0]));return super.cloneInto(t),t}}let K=class extends e{static{m=this}static{this.type="bvec2"}constructor(t,e){super(),this.type="bvec2",this.children=[t,e].filter(t=>null!=t)}all(){return te(this)}any(){return ee(this)}clone(){const t=new m(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};K=m=t([S],K);let L=class extends e{static{v=this}static{this.type="bvec3"}constructor(t,e,n){super(),this.type="bvec3",this.children=[t,e,n].filter(t=>null!=t)}all(){return te(this)}any(){return ee(this)}clone(){const t=new v(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};function O(t,e){if("number"==typeof t){return new e(t)}return t}L=v=t([S],L);let Q=class extends e{static{b=this}static{this.type="bvec4"}constructor(t,e,n,r){super(),this.type="bvec4",this.children=[t,e,n,r].filter(t=>null!=t)}all(){return te(this)}any(){return ee(this)}clone(){const t=new b(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};Q=b=t([S],Q);class W extends e{static{this.type="int"}constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Dt(this,O(t,W))}add(t){return kt(this,O(t,W))}subtract(t){return Mt(this,O(t,W))}divide(t){return Ft(this,O(t,W))}clone(){const t=new W(n(this.children[0]));return super.cloneInto(t),t}}let Z=class extends e{static{x=this}static{this.type="ivec2"}constructor(t,e){super(),this.type="ivec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new x(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};Z=x=t([S],Z);let tt=class extends e{static{I=this}static{this.type="ivec3"}constructor(t,e,n){super(),this.type="ivec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new I(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};tt=I=t([S],tt);let et=class extends e{static{g=this}static{this.type="ivec4"}constructor(t,e,n,r){super(),this.type="ivec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new g(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};et=g=t([S],et);class nt extends e{static{this.type="mat2"}constructor(t,e,n,r){super(),this.type="mat2",this.children=[t,e,n,r]}clone(){const t=new nt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get(t,e){return wt(this,new W(t),new W(e),C)}multiply(t){return Dt(this,t)}}class rt extends e{static{this.type="mat3"}static identity(){return new rt(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const e=sn(t),n=oe(t);return new rt(n,e,0,xt(e),n,0,0,0,1)}constructor(t,e,n,r,c,i,s,u,o){super(),this.type="mat3",this.children=[t,e,n,r,c,i,s,u,o]}add(t){return kt(this,t)}multiply(t){return Dt(this,t)}get(t,e){return wt(this,new W(t),new W(e),C)}clone(){const t=new rt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]));return super.cloneInto(t),t}}class ct extends e{static{this.type="mat4"}static identity(){return new ct(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,e,n,r,c,i,s,u,o,h,l,a,f,p,d,w){super(),this.type="mat4",this.children=[t,e,n,r,c,i,s,u,o,h,l,a,f,p,d,w]}static fromColumns(t,e,n,r){return new ct(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w)}multiply(t){return Dt(this,t)}get(t,e){return wt(this,new W(t),new W(e),C)}clone(){const t=new ct(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]),n(this.children[9]),n(this.children[10]),n(this.children[11]),n(this.children[12]),n(this.children[13]),n(this.children[14]),n(this.children[15]));return super.cloneInto(t),t}}const it={float:C,vec2:X,vec3:Y,vec4:_,int:W,ivec2:Z,ivec3:tt,ivec4:et,uint:G,uvec2:H,uvec3:A,uvec4:V,bool:J,bvec2:K,bvec3:L,bvec4:Q},st=(...t)=>new W(...t),ut=(...t)=>new C(...t),ot=(...t)=>new X(...t),ht=(...t)=>new Y(...t),lt=(...t)=>new _(...t),at=(...t)=>new nt(...t),ft=(...t)=>new rt(...t),pt=(...t)=>new ct(...t);function dt(t,e,n){const r=new n(new c(e,t,n));return r.isImplicit=!0,r}function wt(t,e,n,r){const c=new r(new u(e,n,t,r));return c.isImplicit=!0,c}function yt(t,e,n,r=null){if(r){const c=new r,s=new r(new i(t,[e,n],!0,!1,c));return s.isImplicit=!0,s}if("float"===e.type||"int"===e.type){const r=new n.constructor(new i(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}if(("mat2"===e.type||"mat3"===e.type||"mat4"===e.type)&&"float"!==n.type){const r=new n.constructor(new i(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}const c=new e.constructor(new i(t,[e,n],!0,!1,e.constructor));return c.isImplicit=!0,c}function mt(t,e,n=e.constructor){const r=new n(new i(t,[e],!1,!1,n));return r.isImplicit=!0,r}function vt(t,e,n,r=e.constructor){const c=new r(new i(t,[e,n],!1,!1,r));return c.isImplicit=!0,c}function bt(t,e,n,r,c=e.constructor){const s=new c(new i(t,[e,n,r],!1,!1,c));return s.isImplicit=!0,s}function xt(t){return Dt(t,ut(-1))}function It(t,e,n,r){return new e(new s(t,e,n,r))}function gt(t,e){const n="function"==typeof t?t():t,r=new n.constructor(new o(n).setDebugName(e));return r.isImplicit=!0,r}function Et(t,e,n=0,r=t.size){const c=new W(n).setMutable().setDebugName("FindIndexIterator"),i=e(t.get(c)).setDebugName("FindIndexPredicate"),s=It({iter:c},W,i,({out:t,iter:e,subgraph:n})=>`\n${t} = -1;\n\nfor (; ${e} < ${r}; ${e}++) {\n\n${n.body}\n\n if (${n.varName}) {\n ${t} = ${e};\n break;\n }\n\n}\n`).setDebugName("FindIndexBlock");return s}function $t(t,e,n=0,r=t.size){const c=It({array:t},W,null,({out:t,array:c})=>`\n${t} = -1;\nfor (int i = ${n}; i < ${r}; i++) {\n bool condition;\n ${e({array:c,i:"i",out:"condition"})}\n if (condition) {\n ${t} = i;\n break;\n }\n}\n`).setDebugName("GlslFindIndexBlock");return c}function zt(t,e,n){const c="function"==typeof e?e():e,i="function"==typeof n?n():n,s=new c.constructor(new r(t,c,i));return s.isImplicit=!0,s}function Tt(...t){const e=t.map(([t,e])=>"function"==typeof e?[t,e()]:[t,e]),n=e[0][1].constructor,r=e.findIndex(t=>!0===t[0]);if(-1===r)throw new Error("A cond must have a fallthrough case with `true`/; ");const c=e.slice(0,r),i=e[r][1],s=new n(c.reduceRight((t,e)=>zt(e[0],e[1],t),i));return s.isImplicit=!0,s}function Nt(t,e){const n=new e.constructor(new r(t,e,null));return n.isImplicit=!0,n}function Dt(t,e){return yt("*",t,e)}function Ft(t,e){return yt("/",t,e)}function kt(t,e){return yt("+",t,e)}function Mt(t,e){return yt("-",t,e)}function St(t,e){return yt("%",t,e)}function Rt(t,e){return yt("<<",t,e)}function jt(t,e){return yt(">>",t,e)}function Pt(t,e){return yt("&",t,e)}function Bt(t,e){return yt("|",t,e)}function qt(t,e){return yt("^",t,e)}function Ut(t){return mt("~",t)}function Ct(t,e){return yt("==",t,e,J)}function Xt(t,e){return yt("!=",t,e,J)}function Yt(t,e){return yt("<",t,e,J)}function _t(t,e){return yt("<=",t,e,J)}function Gt(t,e){return yt(">",t,e,J)}function Ht(t,e){return yt(">=",t,e,J)}function At(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Vt(t,e),t[0])}function Vt(t,e){return yt("||",t,e,J)}function Jt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Kt(t,e),t[0])}function Kt(t,e){return yt("^^",t,e,J)}function Lt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Ot(t,e),t[0])}function Ot(t,e){return yt("&&",t,e,J)}function Qt(t){return mt("abs",t)}function Wt(t){return mt("acos",t)}function Zt(t){return mt("acosh",t)}function te(t){return mt("all",t,J)}function ee(t){return mt("any",t,J)}function ne(t){return mt("asin",t)}function re(t){return mt("asinh",t)}function ce(t,e){return null==e?mt("atan",t):vt("atan",t,e,t.constructor)}function ie(t){return mt("atanh",t)}function se(t){return mt("ceil",t)}function ue(t,e,n){return bt("clamp",t,e,n,t.constructor)}function oe(t){return mt("cos",t)}function he(t){return mt("cosh",t)}function le(t,e){return vt("cross",t,e,t.constructor)}function ae(t){return mt("dFdX",t)}function fe(t){return mt("dFdY",t)}function pe(t){return mt("degrees",t)}function de(t){return mt("determinant",t,C)}function we(t,e){return vt("distance",t,e,C)}function ye(t,e){return vt("dot",t,e,C)}function me(t,e){return vt("equal",t,e,N(t))}function ve(t,e){return vt("greaterThan",t,e,N(t))}function be(t,e){return vt("greaterThanEqual",t,e,N(t))}function xe(t){return mt("exp",t)}function Ie(t){return mt("exp2",t)}function ge(t,e,n){return bt("faceforward",t,e,n)}function Ee(t){return mt("floatBitsToInt",t,T(t))}function $e(t){return mt("floatBitsToUint",t,$(t))}function ze(t){return mt("floor",t)}function Te(t){return mt("fract",t)}function Ne(t){return mt("fwidth",t)}function De(t){return mt("intBitsToFloat",t,z(t))}function Fe(t){return mt("uintBitsToFloat",t,E(t))}function ke(t){return mt("inverse",t,C)}function Me(t){return mt("inversesqrt",t)}function Se(t){return mt("isinf",t,N(t))}function Re(t){return mt("isnan",t,N(t))}function je(t){return mt("length",t,C)}function Pe(t,e){return vt("lessThan",t,e,N(t))}function Be(t,e){return vt("lessThanEqual",t,e,N(t))}function qe(t){return mt("log",t)}function Ue(t){return mt("log2",t)}function Ce(t,e){return vt("matrixCompMult",t,e)}function Xe(t,e){return vt("max",t,e)}function Ye(t,e){return vt("min",t,e)}function _e(t,e,n){return bt("mix",t,e,n)}function Ge(t,e){return vt("mod",t,e)}function He(t,e){throw new Error("modf not implemented")}function Ae(t){return mt("normalize",t)}function Ve(t){return"bool"===t.type?mt("!",t):mt("not",t)}function Je(t,e){return vt("notEqual",t,e,N(t))}function Ke(t,e){throw new Error("Impl type?")}function Le(t){return mt("packHalf2x16",t,G)}function Oe(t){return mt("packUnorm2x16",t,G)}function Qe(t){return mt("packSnorm2x16",t,G)}function We(t,e){return vt("pow",t,e)}function Ze(t){return mt("radians",t)}function tn(t,e){return vt("reflect",t,e)}function en(t,e,n){return bt("refract",t,e,n)}function nn(t){return mt("round",t)}function rn(t){return mt("roundEven",t)}function cn(t){return mt("sign",t)}function sn(t){return mt("sin",t)}function un(t){return mt("sinh",t)}function on(t,e,n){return bt("smoothstep",t,e,n)}function hn(t){return mt("sqrt",t)}function ln(t,e){return vt("step",t,e,e.constructor)}function an(t){return mt("tan",t)}function fn(t){return mt("tanh",t)}function pn(t,e,n){return bt("texelFetch",t,e,n,_)}function dn(t,e,n,r){throw new Error("Impl type")}function wn(t,e,n){throw new Error("Impl type")}function yn(t,e){return vt("texture",t,e,_)}function mn(t,e,n,r){throw new Error("Impl type")}function vn(t,e,n,r,c){throw new Error("Impl type")}function bn(t,e,n){throw new Error("Impl type")}function xn(t,e,n,r){throw new Error("Impl type")}function In(t,e,n,r){throw new Error("Impl type")}function gn(t,e,n){throw new Error("Impl type")}function En(t,e,n,r){throw new Error("Impl type")}function $n(t,e,n,r,c){throw new Error("Impl type")}function zn(t,e,n){throw new Error("Impl type")}function Tn(t,e,n,r){throw new Error("Impl type")}function Nn(t,e,n,r){throw new Error("Impl type")}function Dn(t,e){throw new Error("Impl type")}function Fn(t){return mt("transpose",t)}function kn(t){return mt("trunc",t)}function Mn(t){return mt("unpackHalf2x16",t,X)}function Sn(t){return mt("unpackUnorm2x16",t,X)}function Rn(t){return mt("unpackSnorm2x16",t,X)}function jn(t,e){const{initialValue:n,xRange:r,yRange:c,callback:i}=e,[s,u]=r,[o,h]=c,l=new W(0).setMutable().setDebugName("iterX"),a=new W(0).setMutable().setDebugName("iterY"),f=n.setMutable().setDebugName("accumulator"),p=i(f,t.get(l,a),l,a).setDebugName("callback"),d=It({iterX:l,iterY:a,accumulator:f},n.constructor,p,({out:t,iterX:e,iterY:n,accumulator:r,subgraph:c})=>`\nfor (${n} = ${o}; ${n} < ${h}; ${n}++) {\n for (${e} = ${s}; ${e} < ${u}; ${e}++) {\n\n ${c.body}\n\n ${r} = ${c.varName};\n }\n}\n${t} = ${r};\n`).setDebugName("reduce2DBody");return d}export{K as BVec2,L as BVec3,Q as BVec4,J as Bool,B as FixedArray,q as FixedArray2D,C as Float,Z as IVec2,tt as IVec3,et as IVec4,W as Int,nt as Mat2,rt as Mat3,ct as Mat4,U as Sampler2D,G as UInt,H as UVec2,A as UVec3,V as UVec4,X as Vec2,Y as Vec3,_ as Vec4,Vt as _or,Kt as _xor,Qt as abs,Wt as acos,Zt as acosh,kt as add,te as all,Lt as and,ee as any,ne as asin,re as asinh,ce as atan,ie as atanh,Pt as bitAnd,Ut as bitNot,Bt as bitOr,jt as bitRShift,Rt as bitShift,qt as bitXor,It as block,se as ceil,ue as clamp,Tt as cond,oe as cos,he as cosh,le as cross,ae as dFdx,fe as dFdy,dt as definePropertyAccess,wt as definePropertyAccess2D,pe as degrees,de as determinant,we as distance,Ft as divide,ye as dot,Ct as equal,me as equalComponent,xe as exp,Ie as exp2,ge as faceforward,Et as findIndex,ut as float,Ee as floatBitsToInt,$e as floatBitsToUint,ze as floor,Te as fract,Ne as fwidth,F as getTypeElementLengthForType,$t as glslFindIndex,Gt as greaterThan,ve as greaterThanComponent,Ht as greaterThanEqual,be as greaterThanEqualComponent,zt as ifElse,st as int,De as intBitsToFloat,St as intMod,ke as inverse,Me as inversesqrt,Se as isinf,Re as isnan,je as length,Yt as lessThan,Pe as lessThanComponent,_t as lessThanEqual,Be as lessThanEqualComponent,qe as log,Ue as log2,at as mat2,ft as mat3,pt as mat4,Ce as matrixCompMult,Xe as max,Ye as min,_e as mix,Ge as mod,He as modf,Dt as multiply,gt as namedScope,xt as negate,Ae as normalize,Ve as not,Xt as notEqual,Je as notEqualComponent,At as or,Ke as outerProduct,Le as packHalf2x16,Qe as packSnorm2x16,Oe as packUnorm2x16,We as pow,Ze as radians,jn as reduce2D,tn as reflect,en as refract,nn as round,rn as roundEven,cn as sign,sn as sin,un as sinh,on as smoothstep,hn as sqrt,ln as step,Mt as subtract,an as tan,fn as tanh,pn as texelFetch,dn as texelFetchOffset,wn as texture,yn as texture2D,mn as textureGrad,vn as textureGradOffset,bn as textureLod,xn as textureLodOffset,In as textureOffset,gn as textureProj,En as textureProjGrad,$n as textureProjGradOffset,zn as textureProjLod,Tn as textureProjLodOffset,Nn as textureProjOffset,Dn as textureSize,T as transformFloatToInt,$ as transformFloatToUInt,z as transformIntToFloat,N as transformTypeToBooleanType,E as transformUIntToFloat,Fn as transpose,kn as trunc,Fe as uintBitsToFloat,Mn as unpackHalf2x16,Rn as unpackSnorm2x16,Sn as unpackUnorm2x16,ot as vec2,ht as vec3,lt as vec4,Nt as when,Jt as xor};
5
+ import{__decorate as t}from"tslib";import{ShaderPrimitiveNode as e,cloneShaderNode as n,ShaderConditionNode as r,ShaderPropertyAccessNode as i,ShaderFunctionNode as c,ShaderBlockNode as u,ShaderPropertyAccess2DNode as s,ShaderScopeNode as o}from"./ShaderGraphNode.js";var h,l,a,f,p,d,y,w,m,v,b,g,x,I;function E(t){switch(t.type){case"uint":return C;case"uvec2":return X;case"uvec3":return Y;case"uvec4":return _;default:throw new Error("Found unexpected type")}}function $(t){switch(t.type){case"float":return G;case"vec2":return H;case"vec3":return A;case"vec4":return V;default:throw new Error("Found unexpected type")}}function z(t){switch(t.type){case"int":return C;case"ivec2":return X;case"ivec3":return Y;case"ivec4":return _;default:throw new Error("Found unexpected type")}}function T(t){switch(t.type){case"float":return W;case"vec2":return Z;case"vec3":return tt;case"vec4":return et;default:throw new Error("Found unexpected type")}}function N(t){switch(t.type){case"bool":case"float":case"int":case"uint":return J;case"bvec2":case"vec2":case"ivec2":case"uvec2":return K;case"bvec3":case"vec3":case"ivec3":case"uvec3":return L;case"bvec4":case"vec4":case"ivec4":case"uvec4":return Q;default:throw new Error("Unable to handle type")}}function D(t){switch(t.type){case"bool":case"bvec2":case"bvec3":case"bvec4":return J;case"float":case"vec2":case"vec3":case"vec4":return C;case"int":case"ivec2":case"ivec3":case"ivec4":return W;case"uint":case"uvec2":case"uvec3":case"uvec4":return G;default:throw new Error("Unable to handle type")}}function F(t){switch(t.type){case"float":case"int":case"uint":case"bool":case"sampler2D":return 1;case"vec2":case"ivec2":case"uvec2":case"bvec2":return 2;case"vec3":case"ivec3":case"uvec3":case"bvec3":return 3;case"vec4":case"ivec4":case"uvec4":case"bvec4":case"mat2":return 4;case"mat3":return 9;case"mat4":return 16;case"array":case"array-2d":return t.size*F(t.elementType)}}function k(t){const e=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const n of e)if(n.includes(t))return n.map(t=>ct[t]);throw new Error("Unable to find type family")}function M(t){return new Proxy(t,{get(e,n){if("constructor"===n)return new Proxy(e.constructor,{construct:(t,e,n)=>M(new t(...e))});if(n in e)return e[n];if("string"==typeof n){const e=k(t.type);return dt(t,n,e[n.length-1])}}})}function S(t){return new Proxy(t,{construct:(t,e,n)=>M(new t(...e))})}function R(t){return new Proxy(t,{get(e,n){if(n in e)return e[n];if("string"==typeof n){const e=parseInt(n,10);if(!isNaN(e))return dt(t,`[${e}]`,t.elementType.constructor)}}})}function j(t){return new Proxy(t,{construct:(t,e,n)=>R(new t(...e))})}class P extends Error{}let B=class extends e{static{h=this}static{this.type="array"}constructor(t,e){super(),this.elementType=t,this.size=e,this.children=[],this.type="array"}clone(){const t=new h(this.elementType,this.size);return super.cloneInto(t),t}get(t,e){const n=new W(t),r=null!=e?new W(e):null;if(null!=r){return yt(this,n,r,D(this.elementType.constructor))}return dt(this,n,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(t,e,n){return Et(this,t,e,n)}glslFindIndex(t,e,n){return $t(this,t,e,n)}static ofType(t,e){const n={construct:(n,r)=>new h(new t,e)};return new Proxy(h,n)}};B=h=t([j],B);class q extends e{static{this.type="array-2d"}constructor(t,e,n,r=!1){super(),this.elementType=t,this.xSize=e,this.ySize=n,this.isRowMajor=r,this.children=[],this.type="array-2d"}clone(){const t=new q(this.elementType,this.xSize,this.ySize,this.isRowMajor);return super.cloneInto(t),t}get size(){return this.xSize*this.ySize}get(t,e){return this.isRowMajor?this._getRowMajor(t,e):this._getColumnMajor(t,e)}_getColumnMajor(t,e){const n=new W(t);return dt(this,new W(e).add(n.multiply(this.xSize)),this.elementType.constructor)}_getRowMajor(t,e){const n=new W(t),r=new W(e);return dt(this,n.add(r.multiply(this.ySize)),this.elementType.constructor)}static ofType(t,e,n,r=!1){return new Proxy(B,{construct:(i,c)=>new q(new t,e,n,r)})}}class U extends e{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}static{this.type="sampler2D"}clone(){const t=new U;return t.children=this.children.map(n),super.cloneInto(t),t}}class C extends e{static{this.type="float"}constructor(t){super(),this.type="float",this.children=[t]}clone(){const t=new C(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}}let X=class extends e{static{l=this}static{this.type="vec2"}constructor(t,e){super(),this.type="vec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new l(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){throw new P}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}};X=l=t([S],X);let Y=class extends e{static{a=this}static{this.type="vec3"}constructor(t,e,n){super(),this.type="vec3",this.children=[t,e,n].filter(t=>null!=t)}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){throw new P}clone(){const t=new a(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}};Y=a=t([S],Y);let _=class extends e{static{f=this}static{this.type="vec4"}constructor(t,e,n,r){super(),this.type="vec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new f(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",C)}get 1(){return dt(this,"[1]",C)}get 2(){return dt(this,"[2]",C)}get 3(){return dt(this,"[3]",C)}multiply(t){return Dt(this,"number"==typeof t?O(t,C):t)}divide(t){return Ft(this,"number"==typeof t?O(t,C):t)}add(t){return kt(this,"number"==typeof t?O(t,C):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,C):t)}};_=f=t([S],_);let G=class extends e{static{p=this}static{this.type="uint"}constructor(t){super(),this.type="uint",this.children=[t]}clone(){const t=new p(n(this.children[0]));return super.cloneInto(t),t}multiply(t){return Dt(this,O(t,p))}add(t){return kt(this,O(t,p))}subtract(t){return Mt(this,O(t,p))}divide(t){return Ft(this,O(t,p))}};G=p=t([S],G);let H=class extends e{static{d=this}static{this.type="uvec2"}constructor(t,e){super(),this.type="uvec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new d(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){throw new P}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,G):t)}divide(t){return Ft(this,"number"==typeof t?O(t,G):t)}add(t){return kt(this,"number"==typeof t?O(t,G):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,G):t)}};H=d=t([S],H);let A=class extends e{static{y=this}static{this.type="uvec3"}constructor(t,e,n){super(),this.type="uvec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new y(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",G)}get 1(){return dt(this,"[1]",G)}get 2(){return dt(this,"[2]",G)}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,G):t)}divide(t){return Ft(this,"number"==typeof t?O(t,G):t)}add(t){return kt(this,"number"==typeof t?O(t,G):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,G):t)}};A=y=t([S],A);let V=class extends e{static{w=this}static{this.type="uvec4"}constructor(t,e,n,r){super(),this.type="uvec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new w(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",G)}get 1(){return dt(this,"[1]",G)}get 2(){return dt(this,"[2]",G)}get 3(){return dt(this,"[3]",G)}multiply(t){return Dt(this,"number"==typeof t?O(t,G):t)}divide(t){return Ft(this,"number"==typeof t?O(t,G):t)}add(t){return kt(this,"number"==typeof t?O(t,G):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,G):t)}};V=w=t([S],V);class J extends e{static{this.type="bool"}constructor(t){super(),this.type="bool",this.children=[t]}and(t){return Lt(this,t)}or(t){return At(this,t)}xor(t){return Jt(this,t)}clone(){const t=new J(n(this.children[0]));return super.cloneInto(t),t}}let K=class extends e{static{m=this}static{this.type="bvec2"}constructor(t,e){super(),this.type="bvec2",this.children=[t,e].filter(t=>null!=t)}all(){return te(this)}any(){return ee(this)}clone(){const t=new m(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}};K=m=t([S],K);let L=class extends e{static{v=this}static{this.type="bvec3"}constructor(t,e,n){super(),this.type="bvec3",this.children=[t,e,n].filter(t=>null!=t)}all(){return te(this)}any(){return ee(this)}clone(){const t=new v(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}};function O(t,e){if("number"==typeof t){return new e(t)}return t}L=v=t([S],L);let Q=class extends e{static{b=this}static{this.type="bvec4"}constructor(t,e,n,r){super(),this.type="bvec4",this.children=[t,e,n,r].filter(t=>null!=t)}all(){return te(this)}any(){return ee(this)}clone(){const t=new b(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}};Q=b=t([S],Q);class W extends e{static{this.type="int"}constructor(t){super(),this.type="int",this.children=[t]}multiply(t){return Dt(this,O(t,W))}add(t){return kt(this,O(t,W))}subtract(t){return Mt(this,O(t,W))}divide(t){return Ft(this,O(t,W))}clone(){const t=new W(n(this.children[0]));return super.cloneInto(t),t}}let Z=class extends e{static{g=this}static{this.type="ivec2"}constructor(t,e){super(),this.type="ivec2",this.children=[t,e].filter(t=>null!=t)}clone(){const t=new g(n(this.children[0]),n(this.children[1]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){throw new P}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,W):t)}divide(t){return Ft(this,"number"==typeof t?O(t,W):t)}add(t){return kt(this,"number"==typeof t?O(t,W):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,W):t)}};Z=g=t([S],Z);let tt=class extends e{static{x=this}static{this.type="ivec3"}constructor(t,e,n){super(),this.type="ivec3",this.children=[t,e,n].filter(t=>null!=t)}clone(){const t=new x(n(this.children[0]),n(this.children[1]),n(this.children[2]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){return dt(this,"[2]",W)}get 3(){throw new P}multiply(t){return Dt(this,"number"==typeof t?O(t,W):t)}divide(t){return Ft(this,"number"==typeof t?O(t,W):t)}add(t){return kt(this,"number"==typeof t?O(t,W):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,W):t)}};tt=x=t([S],tt);let et=class extends e{static{I=this}static{this.type="ivec4"}constructor(t,e,n,r){super(),this.type="ivec4",this.children=[t,e,n,r].filter(t=>null!=t)}clone(){const t=new I(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get 0(){return dt(this,"[0]",W)}get 1(){return dt(this,"[1]",W)}get 2(){return dt(this,"[2]",W)}get 3(){return dt(this,"[3]",W)}multiply(t){return Dt(this,"number"==typeof t?O(t,W):t)}divide(t){return Ft(this,"number"==typeof t?O(t,W):t)}add(t){return kt(this,"number"==typeof t?O(t,W):t)}subtract(t){return Mt(this,"number"==typeof t?O(t,W):t)}};et=I=t([S],et);class nt extends e{static{this.type="mat2"}constructor(t,e,n,r){super(),this.type="mat2",this.children=[t,e,n,r]}clone(){const t=new nt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]));return super.cloneInto(t),t}get(t,e){return yt(this,new W(t),new W(e),C)}multiply(t){return Dt(this,t)}}class rt extends e{static{this.type="mat3"}static identity(){return new rt(1,0,0,0,1,0,0,0,1)}static fromRotation(t){const e=un(t),n=oe(t);return new rt(n,e,0,gt(e),n,0,0,0,1)}constructor(t,e,n,r,i,c,u,s,o){super(),this.type="mat3",this.children=[t,e,n,r,i,c,u,s,o]}add(t){return kt(this,t)}multiply(t){return Dt(this,t)}get(t,e){return yt(this,new W(t),new W(e),C)}clone(){const t=new rt(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]));return super.cloneInto(t),t}}class it extends e{static{this.type="mat4"}static identity(){return new it(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(t,e,n,r,i,c,u,s,o,h,l,a,f,p,d,y){super(),this.type="mat4",this.children=[t,e,n,r,i,c,u,s,o,h,l,a,f,p,d,y]}static fromColumns(t,e,n,r){return new it(t.x,t.y,t.z,t.w,e.x,e.y,e.z,e.w,n.x,n.y,n.z,n.w,r.x,r.y,r.z,r.w)}multiply(t){return Dt(this,t)}get(t,e){return yt(this,new W(t),new W(e),C)}clone(){const t=new it(n(this.children[0]),n(this.children[1]),n(this.children[2]),n(this.children[3]),n(this.children[4]),n(this.children[5]),n(this.children[6]),n(this.children[7]),n(this.children[8]),n(this.children[9]),n(this.children[10]),n(this.children[11]),n(this.children[12]),n(this.children[13]),n(this.children[14]),n(this.children[15]));return super.cloneInto(t),t}}const ct={float:C,vec2:X,vec3:Y,vec4:_,int:W,ivec2:Z,ivec3:tt,ivec4:et,uint:G,uvec2:H,uvec3:A,uvec4:V,bool:J,bvec2:K,bvec3:L,bvec4:Q},ut=(...t)=>new W(...t),st=(...t)=>new C(...t),ot=(...t)=>new X(...t),ht=(...t)=>new Y(...t),lt=(...t)=>new _(...t),at=(...t)=>new nt(...t),ft=(...t)=>new rt(...t),pt=(...t)=>new it(...t);function dt(t,e,n){const r=new n(new i(e,t,n));return r.isImplicit=!0,r}function yt(t,e,n,r){const i=new r(new s(e,n,t,r));return i.isImplicit=!0,i}function wt(t,e,n,r=null){if(r){const i=new r,u=new r(new c(t,[e,n],!0,!1,i));return u.isImplicit=!0,u}if("float"===e.type||"int"===e.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}if(("mat2"===e.type||"mat3"===e.type||"mat4"===e.type)&&"float"!==n.type){const r=new n.constructor(new c(t,[e,n],!0,!1,n.constructor));return r.isImplicit=!0,r}const i=new e.constructor(new c(t,[e,n],!0,!1,e.constructor));return i.isImplicit=!0,i}function mt(t,e,n=e.constructor){const r=new n(new c(t,[e],!1,!1,n));return r.isImplicit=!0,r}function vt(t,e,n,r=e.constructor){const i=new r(new c(t,[e,n],!1,!1,r));return i.isImplicit=!0,i}function bt(t,e,n,r,i=e.constructor){const u=new i(new c(t,[e,n,r],!1,!1,i));return u.isImplicit=!0,u}function gt(t){return Dt(t,st(-1))}function xt(t,e,n,r){return new e(new u(t,e,n,r))}function It(t,e){const n="function"==typeof t?t():t,r=new n.constructor(new o(n).setDebugName(e));return r.isImplicit=!0,r}function Et(t,e,n=0,r=t.size){const i=new W(n).setMutable().setDebugName("FindIndexIterator"),c=e(t.get(i)).setDebugName("FindIndexPredicate"),u=xt({iter:i},W,c,({out:t,iter:e,subgraph:n})=>`\n${t} = -1;\n\nfor (; ${e} < ${r}; ${e}++) {\n\n${n.body}\n\n if (${n.varName}) {\n ${t} = ${e};\n break;\n }\n\n}\n`).setDebugName("FindIndexBlock");return u}function $t(t,e,n=0,r=t.size){const i=xt({array:t},W,null,({out:t,array:i})=>`\n${t} = -1;\nfor (int i = ${n}; i < ${r}; i++) {\n bool condition;\n ${e({array:i,i:"i",out:"condition"})}\n if (condition) {\n ${t} = i;\n break;\n }\n}\n`).setDebugName("GlslFindIndexBlock");return i}function zt(t,e,n){const i="function"==typeof e?e():e,c="function"==typeof n?n():n,u=new i.constructor(new r(t,i,c));return u.isImplicit=!0,u}function Tt(...t){const e=t.map(([t,e])=>"function"==typeof e?[t,e()]:[t,e]),n=e[0][1].constructor,r=e.findIndex(t=>!0===t[0]);if(-1===r)throw new Error("A cond must have a fallthrough case with `true`/; ");const i=e.slice(0,r),c=e[r][1],u=new n(i.reduceRight((t,e)=>zt(e[0],e[1],t),c));return u.isImplicit=!0,u}function Nt(t,e){const n=new e.constructor(new r(t,e,null));return n.isImplicit=!0,n}function Dt(t,e){return wt("*",t,e)}function Ft(t,e){return wt("/",t,e)}function kt(t,e){return wt("+",t,e)}function Mt(t,e){return wt("-",t,e)}function St(t,e){return wt("%",t,e)}function Rt(t,e){return wt("<<",t,e)}function jt(t,e){return wt(">>",t,e)}function Pt(t,e){return wt("&",t,e)}function Bt(t,e){return wt("|",t,e)}function qt(t,e){return wt("^",t,e)}function Ut(t){return mt("~",t)}function Ct(t,e){return wt("==",t,e,J)}function Xt(t,e){return wt("!=",t,e,J)}function Yt(t,e){return wt("<",t,e,J)}function _t(t,e){return wt("<=",t,e,J)}function Gt(t,e){return wt(">",t,e,J)}function Ht(t,e){return wt(">=",t,e,J)}function At(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Vt(t,e),t[0])}function Vt(t,e){return wt("||",t,e,J)}function Jt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Kt(t,e),t[0])}function Kt(t,e){return wt("^^",t,e,J)}function Lt(...t){return t.length<=1?t[0]:t.slice(1).reduce((t,e)=>Ot(t,e),t[0])}function Ot(t,e){return wt("&&",t,e,J)}function Qt(t){return mt("abs",t)}function Wt(t){return mt("acos",t)}function Zt(t){return mt("acosh",t)}function te(t){return mt("all",t,J)}function ee(t){return mt("any",t,J)}function ne(t){return mt("asin",t)}function re(t){return mt("asinh",t)}function ie(t,e){return null==e?mt("atan",t):vt("atan",t,e,t.constructor)}function ce(t){return mt("atanh",t)}function ue(t){return mt("ceil",t)}function se(t,e,n){return bt("clamp",t,e,n,t.constructor)}function oe(t){return mt("cos",t)}function he(t){return mt("cosh",t)}function le(t,e){return vt("cross",t,e,t.constructor)}function ae(t){return mt("dFdX",t)}function fe(t){return mt("dFdY",t)}function pe(t){return mt("degrees",t)}function de(t){return mt("determinant",t,C)}function ye(t,e){return vt("distance",t,e,C)}function we(t,e){return vt("dot",t,e,C)}function me(t,e){return vt("equal",t,e,N(t))}function ve(t,e){return vt("greaterThan",t,e,N(t))}function be(t,e){return vt("greaterThanEqual",t,e,N(t))}function ge(t){return mt("exp",t)}function xe(t){return mt("exp2",t)}function Ie(t,e,n){return bt("faceforward",t,e,n)}function Ee(t){return mt("floatBitsToInt",t,T(t))}function $e(t){return mt("floatBitsToUint",t,$(t))}function ze(t){return mt("floor",t)}function Te(t){return mt("fract",t)}function Ne(t){return mt("fwidth",t)}function De(t){return mt("intBitsToFloat",t,z(t))}function Fe(t){return mt("uintBitsToFloat",t,E(t))}function ke(t){return mt("inverse",t,C)}function Me(t){return mt("inversesqrt",t)}function Se(t){return mt("isinf",t,N(t))}function Re(t){return mt("isnan",t,N(t))}function je(t){return mt("length",t,C)}function Pe(t,e){return vt("lessThan",t,e,N(t))}function Be(t,e){return vt("lessThanEqual",t,e,N(t))}function qe(t){return mt("log",t)}function Ue(t){return mt("log2",t)}function Ce(t,e){return vt("matrixCompMult",t,e)}function Xe(t,e){return vt("max",t,e)}function Ye(t,e){return vt("min",t,e)}function _e(t,e,n){return bt("mix",t,e,n)}function Ge(t,e){return vt("mod",t,e)}function He(t,e){throw new Error("modf not implemented")}function Ae(t){return mt("normalize",t)}function Ve(t){return"bool"===t.type?mt("!",t):mt("not",t)}function Je(t,e){return vt("notEqual",t,e,N(t))}function Ke(t,e){throw new Error("Impl type?")}function Le(t){return mt("packHalf2x16",t,G)}function Oe(t){return mt("packUnorm2x16",t,G)}function Qe(t){return mt("packSnorm2x16",t,G)}function We(t,e){return vt("pow",t,e)}function Ze(t){return mt("radians",t)}function tn(t,e){return vt("reflect",t,e)}function en(t,e,n){return bt("refract",t,e,n)}function nn(t){return mt("round",t)}function rn(t){return mt("roundEven",t)}function cn(t){return mt("sign",t)}function un(t){return mt("sin",t)}function sn(t){return mt("sinh",t)}function on(t,e,n){return bt("smoothstep",t,e,n)}function hn(t){return mt("sqrt",t)}function ln(t,e){return vt("step",t,e,e.constructor)}function an(t){return mt("tan",t)}function fn(t){return mt("tanh",t)}function pn(t,e,n){return bt("texelFetch",t,e,n,_)}function dn(t,e,n,r){throw new Error("Impl type")}function yn(t,e,n){throw new Error("Impl type")}function wn(t,e){return vt("texture",t,e,_)}function mn(t,e,n,r){throw new Error("Impl type")}function vn(t,e,n,r,i){throw new Error("Impl type")}function bn(t,e,n){throw new Error("Impl type")}function gn(t,e,n,r){throw new Error("Impl type")}function xn(t,e,n,r){throw new Error("Impl type")}function In(t,e,n){throw new Error("Impl type")}function En(t,e,n,r){throw new Error("Impl type")}function $n(t,e,n,r,i){throw new Error("Impl type")}function zn(t,e,n){throw new Error("Impl type")}function Tn(t,e,n,r){throw new Error("Impl type")}function Nn(t,e,n,r){throw new Error("Impl type")}function Dn(t,e){throw new Error("Impl type")}function Fn(t){return mt("transpose",t)}function kn(t){return mt("trunc",t)}function Mn(t){return mt("unpackHalf2x16",t,X)}function Sn(t){return mt("unpackUnorm2x16",t,X)}function Rn(t){return mt("unpackSnorm2x16",t,X)}function jn(t,e){const{initialValue:n,xRange:r,yRange:i,callback:c}=e,[u,s]=r,[o,h]=i,l=new W(0).setMutable().setDebugName("iterX"),a=new W(0).setMutable().setDebugName("iterY"),f=n.setMutable().setDebugName("accumulator"),p=c(f,t.get(l,a),l,a).setDebugName("callback"),d=xt({iterX:l,iterY:a,accumulator:f},n.constructor,p,({out:t,iterX:e,iterY:n,accumulator:r,subgraph:i})=>`\nfor (${n} = ${o}; ${n} < ${h}; ${n}++) {\n for (${e} = ${u}; ${e} < ${s}; ${e}++) {\n\n ${i.body}\n\n ${r} = ${i.varName};\n }\n}\n${t} = ${r};\n`).setDebugName("reduce2DBody");return d}export{K as BVec2,L as BVec3,Q as BVec4,J as Bool,B as FixedArray,q as FixedArray2D,C as Float,Z as IVec2,tt as IVec3,et as IVec4,W as Int,nt as Mat2,rt as Mat3,it as Mat4,U as Sampler2D,G as UInt,H as UVec2,A as UVec3,V as UVec4,X as Vec2,Y as Vec3,_ as Vec4,Vt as _or,Kt as _xor,Qt as abs,Wt as acos,Zt as acosh,kt as add,te as all,Lt as and,ee as any,ne as asin,re as asinh,ie as atan,ce as atanh,Pt as bitAnd,Ut as bitNot,Bt as bitOr,jt as bitRShift,Rt as bitShift,qt as bitXor,xt as block,ue as ceil,se as clamp,Tt as cond,oe as cos,he as cosh,le as cross,ae as dFdx,fe as dFdy,dt as definePropertyAccess,yt as definePropertyAccess2D,pe as degrees,de as determinant,ye as distance,Ft as divide,we as dot,Ct as equal,me as equalComponent,ge as exp,xe as exp2,Ie as faceforward,Et as findIndex,st as float,Ee as floatBitsToInt,$e as floatBitsToUint,ze as floor,Te as fract,Ne as fwidth,F as getTypeElementLengthForType,$t as glslFindIndex,Gt as greaterThan,ve as greaterThanComponent,Ht as greaterThanEqual,be as greaterThanEqualComponent,zt as ifElse,ut as int,De as intBitsToFloat,St as intMod,ke as inverse,Me as inversesqrt,Se as isinf,Re as isnan,je as length,Yt as lessThan,Pe as lessThanComponent,_t as lessThanEqual,Be as lessThanEqualComponent,qe as log,Ue as log2,at as mat2,ft as mat3,pt as mat4,Ce as matrixCompMult,Xe as max,Ye as min,_e as mix,Ge as mod,He as modf,Dt as multiply,It as namedScope,gt as negate,Ae as normalize,Ve as not,Xt as notEqual,Je as notEqualComponent,At as or,Ke as outerProduct,Le as packHalf2x16,Qe as packSnorm2x16,Oe as packUnorm2x16,We as pow,Ze as radians,jn as reduce2D,tn as reflect,en as refract,nn as round,rn as roundEven,cn as sign,un as sin,sn as sinh,on as smoothstep,hn as sqrt,ln as step,Mt as subtract,an as tan,fn as tanh,pn as texelFetch,dn as texelFetchOffset,yn as texture,wn as texture2D,mn as textureGrad,vn as textureGradOffset,bn as textureLod,gn as textureLodOffset,xn as textureOffset,In as textureProj,En as textureProjGrad,$n as textureProjGradOffset,zn as textureProjLod,Tn as textureProjLodOffset,Nn as textureProjOffset,Dn as textureSize,T as transformFloatToInt,$ as transformFloatToUInt,z as transformIntToFloat,N as transformTypeToBooleanType,E as transformUIntToFloat,Fn as transpose,kn as trunc,Fe as uintBitsToFloat,Mn as unpackHalf2x16,Rn as unpackSnorm2x16,Sn as unpackUnorm2x16,ot as vec2,ht as vec3,lt as vec4,Nt as when,Jt as xor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"./FeatureTechnique.js";import{MeshWriter as t}from"./mesh/MeshWriter.js";import{TestShader as r}from"./shaders/TestShader.js";import{DataType as i}from"../../../../../webgl/enums.js";const o={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:{write:!1,test:{ref:e=>e.stencilRef,compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7681}}}};class s extends e{constructor(){super(...arguments),this.type=23,this.shaders={geometry:new r}}render(e,t){const{painter:r}=e,i=t.instance.getInput();r.setShader({shader:this.shaders.geometry,uniforms:{dataDrivenColor:i.uniforms.dataDrivenColor,view:{zoomLevel:1}},defines:{returnRed:!1},optionalAttributes:{},useComputeBuffer:!1}),r.setPipelineState(o),r.submitDraw(e,t)}}const n={createComputedParams:e=>e,optionalAttributes:{},attributes:{pos:{type:i.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:i.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:i.UNSIGNED_BYTE,count:1},size:{type:i.UNSIGNED_BYTE,count:1,packPrecisionFactor:10,pack:e=>.2},offset:{type:i.INT,count:2,packPrecisionFactor:10,packAlternating:{count:4,pack:()=>[[-1,1],[1,1],[-1,-1],[1,-1]]}},color:{type:i.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>e}}};class a extends t{constructor(){super(...arguments),this.vertexSpec=n}_write(e,t){e.recordStart(this.instanceId,this.attributeLayout);const r=655360,i=e.vertexCount(),o=t.readXForDisplay(),s=t.readYForDisplay();this._writeVertex(e,r,o,s),e.indexWrite(i+0),e.indexWrite(i+1),e.indexWrite(i+2),e.indexWrite(i+1),e.indexWrite(i+3),e.indexWrite(i+2),e.recordEnd()}}export{a as TestMeshWriter,s as TestTechnique};
5
+ import{FeatureTechnique as e}from"./FeatureTechnique.js";import{MeshWriter as t}from"./mesh/MeshWriter.js";import{TestShader as r}from"./shaders/TestShader.js";import{DataType as i}from"../../../../../webgl/enums.js";const o={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:{write:!1,test:{ref:e=>e.stencilRef,compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7681}}}};class s extends e{constructor(){super(...arguments),this.type=24,this.shaders={geometry:new r}}render(e,t){const{painter:r}=e,i=t.instance.getInput();r.setShader({shader:this.shaders.geometry,uniforms:{dataDrivenColor:i.uniforms.dataDrivenColor,view:{zoomLevel:1}},defines:{returnRed:!1},optionalAttributes:{},useComputeBuffer:!1}),r.setPipelineState(o),r.submitDraw(e,t)}}const n={createComputedParams:e=>e,optionalAttributes:{},attributes:{pos:{type:i.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:i.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:i.UNSIGNED_BYTE,count:1},size:{type:i.UNSIGNED_BYTE,count:1,packPrecisionFactor:10,pack:e=>.2},offset:{type:i.INT,count:2,packPrecisionFactor:10,packAlternating:{count:4,pack:()=>[[-1,1],[1,1],[-1,-1],[1,-1]]}},color:{type:i.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>e}}};class a extends t{constructor(){super(...arguments),this.vertexSpec=n}_write(e,t){e.recordStart(this.instanceId,this.attributeLayout);const r=655360,i=e.vertexCount(),o=t.readXForDisplay(),s=t.readYForDisplay();this._writeVertex(e,r,o,s),e.indexWrite(i+0),e.indexWrite(i+1),e.indexWrite(i+2),e.indexWrite(i+1),e.indexWrite(i+3),e.indexWrite(i+2),e.recordEnd()}}export{a as TestMeshWriter,s as TestTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getFeatureUniforms as s,resolveDynamicUniforms as i,getFeaturePipelineState as o}from"../featureTechniqueUtils.js";import{getAntialiasingControls as n}from"../line/utils.js";import{OutlineFillShader as a}from"../shaders/OutlineFillShader.js";class u extends e{constructor(){super(...arguments),this.type=18,this.shaders={geometry:new a}}render(e,a){const{painter:u,pixelRatio:m}=e,p=a.instance.getInput();u.setShader({shader:this.shaders.geometry,uniforms:{...i(e,a.target,p.uniforms),...s(e,a.target),antialiasingControls:n(m)},defines:{...r(e)},optionalAttributes:p.optionalAttributes,useComputeBuffer:t(e)}),u.setPipelineState(o(e)),u.submitDraw(e,a)}}export{u as OutlineFillTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getFeatureUniforms as s,resolveDynamicUniforms as i,getFeaturePipelineState as o}from"../featureTechniqueUtils.js";import{getAntialiasingControls as n}from"../line/utils.js";import{OutlineFillShader as a}from"../shaders/OutlineFillShader.js";class u extends e{constructor(){super(...arguments),this.type=19,this.shaders={geometry:new a}}render(e,a){const{painter:u,pixelRatio:m}=e,p=a.instance.getInput();u.setShader({shader:this.shaders.geometry,uniforms:{...i(e,a.target,p.uniforms),...s(e,a.target),antialiasingControls:n(m)},defines:{...r(e)},optionalAttributes:p.optionalAttributes,useComputeBuffer:t(e)}),u.setPipelineState(o(e)),u.submitDraw(e,a)}}export{u as OutlineFillTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as i,resolveDynamicUniforms as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{PatternFillShader as n}from"../shaders/PatternFillShader.js";class u extends e{constructor(){super(...arguments),this.type=20,this.shaders={geometry:new n}}render(e,n){const{context:u,painter:f}=e,m=n.instance.getInput();f.setShader({shader:this.shaders.geometry,uniforms:{...o(e,n.target,m.uniforms),...i(e,n.target),mosaicInfo:f.textureManager.getMosaicInfo(u,n.textureKey),localTileOffset:s(n.target)},defines:{...r(e)},optionalAttributes:m.optionalAttributes,useComputeBuffer:t(e)}),f.setPipelineState(a(e)),f.submitDraw(e,n)}}export{u as PatternFillTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as i,resolveDynamicUniforms as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{PatternFillShader as n}from"../shaders/PatternFillShader.js";class u extends e{constructor(){super(...arguments),this.type=21,this.shaders={geometry:new n}}render(e,n){const{context:u,painter:f}=e,m=n.instance.getInput();f.setShader({shader:this.shaders.geometry,uniforms:{...o(e,n.target,m.uniforms),...i(e,n.target),mosaicInfo:f.textureManager.getMosaicInfo(u,n.textureKey),localTileOffset:s(n.target)},defines:{...r(e)},optionalAttributes:m.optionalAttributes,useComputeBuffer:t(e)}),f.setPipelineState(a(e)),f.submitDraw(e,n)}}export{u as PatternFillTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as i,resolveDynamicUniforms as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{getAntialiasingControls as n}from"../line/utils.js";import{PatternOutlineFillShader as u}from"../shaders/PatternOutlineFillShader.js";class l extends e{constructor(){super(...arguments),this.type=21,this.shaders={geometry:new u}}render(e,u){const{context:l,painter:m,pixelRatio:f}=e,p=u.instance.getInput();m.setShader({shader:this.shaders.geometry,uniforms:{...o(e,u.target,p.uniforms),...i(e,u.target),antialiasingControls:n(f),mosaicInfo:m.textureManager.getMosaicInfo(l,u.textureKey),localTileOffset:s(u.target)},defines:{...r(e)},optionalAttributes:p.optionalAttributes,useComputeBuffer:t(e)}),m.setPipelineState(a(e)),m.submitDraw(e,u)}}export{l as PatternOutlineFillTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getLocalTileOffset as s,getFeatureUniforms as i,resolveDynamicUniforms as o,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{getAntialiasingControls as n}from"../line/utils.js";import{PatternOutlineFillShader as u}from"../shaders/PatternOutlineFillShader.js";class l extends e{constructor(){super(...arguments),this.type=22,this.shaders={geometry:new u}}render(e,u){const{context:l,painter:m,pixelRatio:f}=e,p=u.instance.getInput();m.setShader({shader:this.shaders.geometry,uniforms:{...o(e,u.target,p.uniforms),...i(e,u.target),antialiasingControls:n(f),mosaicInfo:m.textureManager.getMosaicInfo(l,u.textureKey),localTileOffset:s(u.target)},defines:{...r(e)},optionalAttributes:p.optionalAttributes,useComputeBuffer:t(e)}),m.setPipelineState(a(e)),m.submitDraw(e,u)}}export{l as PatternOutlineFillTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getFeatureUniforms as s,resolveDynamicUniforms as i,getFeaturePipelineState as o}from"../featureTechniqueUtils.js";import{getAntialiasingControls as a}from"./utils.js";import{TexturedLineShader as n}from"../shaders/TexturedLineShader.js";class u extends e{constructor(){super(...arguments),this.type=25,this.shaders={geometry:new n},this.symbologyPlane=1}render(e,n){const{context:u,painter:m,pixelRatio:p}=e,f=n.instance.getInput();m.setShader({shader:this.shaders.geometry,uniforms:{...i(e,n.target,f.uniforms),...s(e,n.target),antialiasingControls:a(p),mosaicInfo:m.textureManager.getMosaicInfo(u,n.textureKey)},defines:{...r(e)},optionalAttributes:f.optionalAttributes,useComputeBuffer:t(e)}),m.setPipelineState(o(e)),m.submitDraw(e,n)}}export{u as TexturedLineTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as r,getFeatureUniforms as s,resolveDynamicUniforms as i,getFeaturePipelineState as o}from"../featureTechniqueUtils.js";import{getAntialiasingControls as a}from"./utils.js";import{TexturedLineShader as n}from"../shaders/TexturedLineShader.js";class u extends e{constructor(){super(...arguments),this.type=26,this.shaders={geometry:new n},this.symbologyPlane=1}render(e,n){const{context:u,painter:m,pixelRatio:p}=e,f=n.instance.getInput();m.setShader({shader:this.shaders.geometry,uniforms:{...i(e,n.target,f.uniforms),...s(e,n.target),antialiasingControls:a(p),mosaicInfo:m.textureManager.getMosaicInfo(u,n.textureKey)},defines:{...r(e)},optionalAttributes:f.optionalAttributes,useComputeBuffer:t(e)}),m.setPipelineState(o(e)),m.submitDraw(e,n)}}export{u as TexturedLineTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{AnimatedMarkerShiftMeshWriter as r,AnimatedMarkerMeshWriter as e}from"../animated/AnimatedMarkerMeshWriter.js";import{AnimatedLineMeshWriter as t,AnimatedFillMeshWriter as i}from"../animated/AnimatedPolyMeshWriters.js";import{DotDensityMeshWriter as s}from"../dotDensity/DotDensityMeshWriter.js";import{ComplexFillMeshWriter as a}from"../fill/ComplexFillMeshWriter.js";import{ComplexOutlineFillMeshWriter as o}from"../fill/ComplexOutlineFillMeshWriter.js";import{FillMeshWriter as n}from"../fill/FillMeshWriter.js";import{GradientFillMeshWriter as m}from"../fill/GradientFillMeshWriter.js";import{OutlineFillMeshWriter as l}from"../fill/OutlineFillMeshWriter.js";import{PatternFillMeshWriter as h}from"../fill/PatternFillMeshWriter.js";import{PatternOutlineFillMeshWriter as u}from"../fill/PatternOutlineFillMeshWriter.js";import{HeatmapMeshWriter as p}from"../heatmap/HeatmapMeshWriter.js";import{LabelMeshWriter as c}from"../labels/LabelMeshWriter.js";import{GradientStrokeMeshWriter as f}from"../line/GradientStrokeMeshWriter.js";import{LineMeshWriter as M}from"../line/LineMeshWriter.js";import{TexturedLineMeshWriter as W}from"../line/TexturedLineMeshWriter.js";import{MarkerMeshWriter as j}from"../markers/MarkerMeshWriter.js";import{MeshWriterInputEvaluator as d}from"./MeshWriterInputEvaluator.js";import{PieChartMeshWriter as w}from"../pieChart/PieChartMeshWriter.js";import{TextMeshWriter as F}from"../text/TextMeshWriter.js";class x{async createMeshWriter(r,e,t,i,s){const a=this._getMeshWriter(i.techniqueType),o=await d.create(r,e,i.inputParams,s),n=new a(i.id,o,i.optionalAttributes,t);return await n.loadDependencies(),n}_getMeshWriter(d){switch(d){case 9:return n;case 8:return s;case 6:return a;case 20:return h;case 10:return m;case 18:return l;case 21:return u;case 7:return o;case 17:return j;case 22:return w;case 24:return F;case 15:return M;case 25:return W;case 11:return f;case 13:return p;case 14:return c;case 2:return e;case 3:return r;case 0:return i;case 1:return t;default:throw new Error("Internal Error: Mesh writer not in the registry")}}}export{x as MeshWriterRegistry};
5
+ import{AnimatedMarkerShiftMeshWriter as r,AnimatedMarkerMeshWriter as e}from"../animated/AnimatedMarkerMeshWriter.js";import{AnimatedLineMeshWriter as t,AnimatedFillMeshWriter as i}from"../animated/AnimatedPolyMeshWriters.js";import{DotDensityMeshWriter as s}from"../dotDensity/DotDensityMeshWriter.js";import{ComplexFillMeshWriter as a}from"../fill/ComplexFillMeshWriter.js";import{ComplexOutlineFillMeshWriter as o}from"../fill/ComplexOutlineFillMeshWriter.js";import{FillMeshWriter as n}from"../fill/FillMeshWriter.js";import{GradientFillMeshWriter as m}from"../fill/GradientFillMeshWriter.js";import{OutlineFillMeshWriter as l}from"../fill/OutlineFillMeshWriter.js";import{PatternFillMeshWriter as h}from"../fill/PatternFillMeshWriter.js";import{PatternOutlineFillMeshWriter as u}from"../fill/PatternOutlineFillMeshWriter.js";import{HeatmapMeshWriter as p}from"../heatmap/HeatmapMeshWriter.js";import{LabelMeshWriter as c}from"../labels/LabelMeshWriter.js";import{GradientStrokeMeshWriter as f}from"../line/GradientStrokeMeshWriter.js";import{LineMeshWriter as M}from"../line/LineMeshWriter.js";import{TexturedLineMeshWriter as W}from"../line/TexturedLineMeshWriter.js";import{MarkerMeshWriter as j}from"../markers/MarkerMeshWriter.js";import{MeshWriterInputEvaluator as d}from"./MeshWriterInputEvaluator.js";import{PieChartMeshWriter as w}from"../pieChart/PieChartMeshWriter.js";import{TextMeshWriter as F}from"../text/TextMeshWriter.js";class x{async createMeshWriter(r,e,t,i,s){const a=this._getMeshWriter(i.techniqueType),o=await d.create(r,e,i.inputParams,s),n=new a(i.id,o,i.optionalAttributes,t);return await n.loadDependencies(),n}_getMeshWriter(d){switch(d){case 9:return n;case 8:return s;case 6:return a;case 21:return h;case 10:return m;case 19:return l;case 22:return u;case 7:return o;case 17:return j;case 23:return w;case 25:return F;case 15:return M;case 26:return W;case 11:return f;case 13:return p;case 14:return c;case 2:return e;case 3:return r;case 0:return i;case 1:return t;default:throw new Error("Internal Error: Mesh writer not in the registry")}}}export{x as MeshWriterRegistry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as i}from"../Technique.js";import{OverlayShader as r}from"../shaders/OverlayShader.js";import{PrimitiveType as o,DataType as n}from"../../../../../../webgl/enums.js";import{VertexElementDescriptor as a}from"../../../../../../webgl/VertexElementDescriptor.js";class h extends i{constructor(){super(...arguments),this.type=19,this._mesh=null,this.shaders={overlay:new r}}render(e,t){const{context:i,painter:r}=e,o=this._getMesh(e,t);r.setPipelineState(s);const{isWrapAround:n,wrapAroundShift:a}=t.config,h={...t.config,wrapAroundShift:0},p={shader:this.shaders.overlay,uniforms:{transform:t.transform,config:h},defines:null,optionalAttributes:null,useComputeBuffer:!1};r.setPipelineState({...s,stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},ref:0,mask:255}}}),r.submitDrawMeshUntyped(i,p,o),n&&(h.wrapAroundShift=a,r.submitDrawMeshUntyped(i,p,o))}shutdown(){e(this._mesh)}_getMesh(e,s){const{context:i}=e;if(this._mesh){const e=this._mesh.vertexBuffers.get("positions");if(!e)throw new Error("Buffer not found");e.setData(s.position)}else{const e=null!=s.index?s.index.length:s.position.length/2;this._mesh=new t(i,{vertex:{positions:{data:s.position,layout:[new a("pos",2,n.FLOAT,0,8)]},uvs:{data:s.tex,layout:[new a("uv",2,n.UNSIGNED_SHORT,0,4)]}},index:null!=s.index?{index:{data:s.index}}:void 0,groups:[{index:null!=s.index?"index":void 0,primitive:o.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:e}]})}return this._mesh}}export{h as OverlayTechnique};
5
+ import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as i}from"../Technique.js";import{OverlayShader as r}from"../shaders/OverlayShader.js";import{PrimitiveType as o,DataType as n}from"../../../../../../webgl/enums.js";import{VertexElementDescriptor as a}from"../../../../../../webgl/VertexElementDescriptor.js";class h extends i{constructor(){super(...arguments),this.type=20,this._mesh=null,this.shaders={overlay:new r}}render(e,t){const{context:i,painter:r}=e,o=this._getMesh(e,t);r.setPipelineState(s);const{isWrapAround:n,wrapAroundShift:a}=t.config,h={...t.config,wrapAroundShift:0},p={shader:this.shaders.overlay,uniforms:{transform:t.transform,config:h},defines:null,optionalAttributes:null,useComputeBuffer:!1};r.setPipelineState({...s,stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},ref:0,mask:255}}}),r.submitDrawMeshUntyped(i,p,o),n&&(h.wrapAroundShift=a,r.submitDrawMeshUntyped(i,p,o))}shutdown(){e(this._mesh)}_getMesh(e,s){const{context:i}=e;if(this._mesh){const e=this._mesh.vertexBuffers.get("positions");if(!e)throw new Error("Buffer not found");e.setData(s.position)}else{const e=null!=s.index?s.index.length:s.position.length/2;this._mesh=new t(i,{vertex:{positions:{data:s.position,layout:[new a("pos",2,n.FLOAT,0,8)]},uvs:{data:s.tex,layout:[new a("uv",2,n.UNSIGNED_SHORT,0,4)]}},index:null!=s.index?{index:{data:s.index}}:void 0,groups:[{index:null!=s.index?"index":void 0,primitive:o.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:e}]})}return this._mesh}}export{h as OverlayTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{GLSLShaderModule as e}from"../../GLSLShaderModule.js";import{Float as i,Vec4 as t,FixedArray as a,Vec2 as o,Mat3 as s,Sampler2D as r,Vec3 as l}from"../../graph/glsl.js";import{resolveIncludes as n}from"../../../shaders/sources/resolver.js";const p={hittestDist:i,hittestPos:o},y={filterFlags:r,animation:r,visualVariableData:r,dataDriven0:r,dataDriven1:r,dataDriven2:r,gpgpu:r,size:i},d={displayViewScreenMat3:s,displayViewMat3:s,displayMat3:s,viewMat3:s,tileMat3:s,displayZoomFactor:i,requiredZoomFactor:i,tileOffset:o,currentScale:i,currentZoom:i,metersPerSRUnit:i};class u extends e{constructor(){super(...arguments),this.vertexShader=n("materials/pie/pie.vert"),this.fragmentShader=n("materials/pie/pie.frag"),this.required={...y,...d,outlineWidth:i,colors:a,defaultColor:t,othersColor:t,outlineColor:t,donutRatio:i,sectorThreshold:i},this.options={hittestUniforms:p,visualVariableSizeMinMaxValue:{minMaxValueAndSize:t},visualVariableSizeScaleStops:{sizes:{...a.ofType(i,8),type:"array",elementType:i,size:8},values:{...a.ofType(i,8),type:"array",elementType:i,size:8}},visualVariableSizeStops:{sizes:{...a.ofType(i,8),type:"array",elementType:i,size:8},values:{...a.ofType(i,8),type:"array",elementType:i,size:8}},visualVariableSizeUnitValue:{unitValueToPixelsRatio:i},visualVariableOpacity:{opacities:{...a.ofType(i,8),type:"array",elementType:i,size:8},opacityValues:{...a.ofType(i,8),type:"array",elementType:i,size:8}},highlightUniforms:{highlightAll:i,activeReasons:i}},this.locations={pos:{index:0,type:o},id:{index:1,type:l},bitset:{index:2,type:i},offset:{index:3,type:o},texCoords:{index:4,type:o},size:{index:5,type:o},referenceSize:{index:6,type:i},zoomRange:{index:7,type:o}},this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(e){this.required.colors={...a.ofType(t,e),type:"array",elementType:t,size:e}}}export{u as PieChartShader};
5
+ import{GLSLShaderModule as e}from"../../GLSLShaderModule.js";import{Float as i,Vec4 as t,FixedArray as a,Vec2 as s,Mat3 as r,Sampler2D as o,Vec3 as l}from"../../graph/glsl.js";import{resolveIncludes as n}from"../../../shaders/sources/resolver.js";const p={hittestDist:i,hittestPos:s},d={filterFlags:o,animation:o,visualVariableData:o,dataDriven0:o,dataDriven1:o,dataDriven2:o,gpgpu:o,size:i},y={displayViewScreenMat3:r,displayViewMat3:r,displayMat3:r,viewMat3:r,tileMat3:r,displayZoomFactor:i,requiredZoomFactor:i,tileOffset:s,currentScale:i,currentZoom:i,metersPerSRUnit:i};class u extends e{constructor(){super(...arguments),this.vertexShader=n("materials/pie/pie.vert"),this.fragmentShader=n("materials/pie/pie.frag"),this.required={...d,...y,outlineWidth:i,colors:a,defaultColor:t,othersColor:t,outlineColor:t,donutRatio:i,sectorThreshold:i},this.options={hittestUniforms:p,visualVariableSizeMinMaxValue:{minMaxValueAndSize:t},visualVariableSizeScaleStops:{sizes:{type:"array",elementType:i,size:8},values:{type:"array",elementType:i,size:8}},visualVariableSizeStops:{sizes:{type:"array",elementType:i,size:8},values:{type:"array",elementType:i,size:8}},visualVariableSizeUnitValue:{unitValueToPixelsRatio:i},visualVariableOpacity:{opacities:{type:"array",elementType:i,size:8},opacityValues:{type:"array",elementType:i,size:8}},highlightUniforms:{highlightAll:i,activeReasons:i}},this.locations={pos:{index:0,type:s},id:{index:1,type:l},bitset:{index:2,type:i},offset:{index:3,type:s},texCoords:{index:4,type:s},size:{index:5,type:s},referenceSize:{index:6,type:i},zoomRange:{index:7,type:s}},this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(e){this.required.colors={type:"array",elementType:t,size:e}}}export{u as PieChartShader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getFeatureUniforms as i,getSelectionDefines as s,resolveDynamicUniforms as r,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{PieChartShader as h}from"./PieChartShader.js";class u extends e{constructor(){super(...arguments),this.type=22,this.shaders={geometry:new h},this.symbologyPlane=2}render(e,h){const{painter:u}=e,{instance:o,target:n}=h,l=this.shaders.geometry,m=o.getInput(),f=m.uniforms.numberOfFields,S=t(e),V=i(e,n),d=s(e);l.setNumberOfFields(f),u.setShader({shader:l,uniforms:{...r(e,h.target,m.uniforms.shader),...V.storage,...V.view,...V.highlight,highlightUniforms:V.highlight,hittestUniforms:V.hittestRequest?{hittestDist:V.hittestRequest?.distance,hittestPos:V.hittestRequest?.position}:null},defines:{VV_SIZE_MIN_MAX_VALUE:!!m.uniforms.shader.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!m.uniforms.shader.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!m.uniforms.shader.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!m.uniforms.shader.visualVariableSizeUnitValue,VV_OPACITY:!!m.uniforms.shader.visualVariableOpacity,HITTEST:S,highlight:V.highlight?1:0,...d,numberOfFields:f},optionalAttributes:{},useComputeBuffer:S}),u.setPipelineState(a(e)),u.submitDraw(e,h)}}export{u as PieChartTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getFeatureUniforms as i,getSelectionDefines as s,resolveDynamicUniforms as r,getFeaturePipelineState as a}from"../featureTechniqueUtils.js";import{PieChartShader as h}from"./PieChartShader.js";class u extends e{constructor(){super(...arguments),this.type=23,this.shaders={geometry:new h},this.symbologyPlane=2}render(e,h){const{painter:u}=e,{instance:o,target:n}=h,l=this.shaders.geometry,m=o.getInput(),f=m.uniforms.numberOfFields,S=t(e),V=i(e,n),d=s(e);l.setNumberOfFields(f),u.setShader({shader:l,uniforms:{...r(e,h.target,m.uniforms.shader),...V.storage,...V.view,...V.highlight,highlightUniforms:V.highlight,hittestUniforms:V.hittestRequest?{hittestDist:V.hittestRequest?.distance,hittestPos:V.hittestRequest?.position}:null},defines:{VV_SIZE_MIN_MAX_VALUE:!!m.uniforms.shader.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!m.uniforms.shader.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!m.uniforms.shader.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!m.uniforms.shader.visualVariableSizeUnitValue,VV_OPACITY:!!m.uniforms.shader.visualVariableOpacity,HITTEST:S,highlight:V.highlight?1:0,...d,numberOfFields:f},optionalAttributes:{},useComputeBuffer:S}),u.setPipelineState(a(e)),u.submitDraw(e,h)}}export{u as PieChartTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t,__param as o}from"tslib";import{location as e,uniform as r,input as i}from"../../GraphShaderModule.js";import{greaterThan as s,Float as l,ifElse as p,Vec4 as a,Vec2 as n}from"../../graph/glsl.js";import{BaseHittestVertexInput as m,FeatureVertexInput as u}from"./AFeatureShader.js";import{getComplexFillVertexData as f,getComplexFillFragmentColor as h}from"./ComplexFillShader.js";import{signedToUnsignedByte as d,packPrecision as c}from"./constants.js";import{hittestFill as x,failHittest as y}from"./hittestUtils.js";import{getLineFragmentColor as v}from"./LineShader.js";import{LocalTileOffset as j}from"./LocalTileOffset.js";import{MosaicInfo as g}from"./MosaicInfo.js";import{AOutlineFillShader as O,getOutlineFillVertexData as S}from"./OutlineFillShader.js";import{PatternOutlineFillFragmentInput as F}from"./PatternOutlineFillShader.js";const b=1/c;class w extends u{}t([e(3,a)],w.prototype,"color",void 0),t([e(4,a)],w.prototype,"tlbr",void 0),t([e(5,l)],w.prototype,"angle",void 0),t([e(6,l)],w.prototype,"aux1",void 0),t([e(7,l)],w.prototype,"aux2",void 0),t([e(8,n)],w.prototype,"aux3",void 0),t([e(9,n)],w.prototype,"aux4",void 0),t([e(10,n)],w.prototype,"zoomRange",void 0);class C extends F{}class R extends O{constructor(){super(...arguments),this.type="ComplexOutlineFillShader"}vertex(t,o){const{aux1:e,aux2:r,aux3:i,aux4:p}=t,a={...t,width:e,height:r,offset:i,scale:p.multiply(b)},n={...t,halfWidth:e,referenceHalfWidth:r,offset:i,normal:p.subtract(d).multiply(b)},m=S(this,n),u=f(this,a),h=s(m.isOutline,new l(.5));return{...m,...u,...this.maybeRunHittest(t,o,h)}}fragment(t){const{isOutline:o}=t,e=s(o,new l(.5)),r=v(t,this.antialiasingControls.blur),i=h(this,t),a=p(e,r,i),n=p(e,new l(1/255),new l(0));return this.getFragmentOutput(a,t,n)}hittest(t,o,e){return p(e,y(this.hittestRequest),x(this,t,o))}}t([r(g)],R.prototype,"mosaicInfo",void 0),t([r(j)],R.prototype,"localTileOffset",void 0),t([o(0,i(w)),o(1,i(m))],R.prototype,"vertex",null),t([o(0,i(C))],R.prototype,"fragment",null);export{R as ComplexOutlineFillShader,w as ComplexOutlineFillVertexInput};
5
+ import{__decorate as t,__param as o}from"tslib";import{location as e,uniform as r,input as i}from"../../GraphShaderModule.js";import{greaterThan as s,Float as l,ifElse as p,Vec4 as a,Vec2 as n}from"../../graph/glsl.js";import{BaseHittestVertexInput as m,FeatureVertexInput as u}from"./AFeatureShader.js";import{getComplexFillVertexData as f,getComplexFillFragmentColor as h}from"./ComplexFillShader.js";import{signedToUnsignedByte as d,packPrecision as c}from"./constants.js";import{hittestFill as x,failHittest as y}from"./hittestUtils.js";import{getLineFragmentColor as j}from"./LineShader.js";import{LocalTileOffset as v}from"./LocalTileOffset.js";import{MosaicInfo as g}from"./MosaicInfo.js";import{AOutlineFillShader as O,getOutlineFillVertexData as S}from"./OutlineFillShader.js";import{PatternOutlineFillFragmentInput as b}from"./PatternOutlineFillShader.js";const F=1/c;class w extends u{}t([e(3,a)],w.prototype,"color",void 0),t([e(4,a)],w.prototype,"tlbr",void 0),t([e(5,l)],w.prototype,"angle",void 0),t([e(6,l)],w.prototype,"aux1",void 0),t([e(7,l)],w.prototype,"aux2",void 0),t([e(8,n)],w.prototype,"aux3",void 0),t([e(9,n)],w.prototype,"aux4",void 0),t([e(10,n)],w.prototype,"zoomRange",void 0);class C extends b{}class R extends O{constructor(){super(...arguments),this.type="ComplexOutlineFillShader"}vertex(t,o){const{aux1:e,aux2:r,aux3:i,aux4:p}=t,a={...t,width:e,height:r,offset:i,scale:p.multiply(F)},n={...t,halfWidth:e,referenceHalfWidth:r,offset:i,normal:p.subtract(d).multiply(F)},m=S(this,n),u=f(this,a),h=s(m.isOutline,new l(.5));return{...m,...u,...Object.assign({},this.maybeRunHittest(t,o,h))}}fragment(t){const{isOutline:o}=t,e=s(o,new l(.5)),r=j(t,this.antialiasingControls.blur),i=h(this,t),a=p(e,r,i),n=p(e,new l(1/255),new l(0));return this.getFragmentOutput(a,t,n)}hittest(t,o,e){return p(e,y(this.hittestRequest),x(this,t,o))}}t([r(g)],R.prototype,"mosaicInfo",void 0),t([r(v)],R.prototype,"localTileOffset",void 0),t([o(0,i(w)),o(1,i(m))],R.prototype,"vertex",null),t([o(0,i(C))],R.prototype,"fragment",null);export{R as ComplexOutlineFillShader,w as ComplexOutlineFillVertexInput};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureTechnique as e}from"../FeatureTechnique.js";import{getSelectionDefines as s,isHittest as t,getFeatureUniforms as r,resolveDynamicUniforms as a,getFeaturePipelineState as i}from"../featureTechniqueUtils.js";import{TextShader as n}from"./TextShader.js";class o extends e{constructor(){super(...arguments),this.type=24,this.shaders={geometry:new n},this.symbologyPlane=3}render(e,n){const{context:o,painter:u}=e,d=s(e),m=n.instance.getInput(),p={shader:this.shaders.geometry,uniforms:{...a(e,n.target,m.uniforms),...r(e,n.target),mosaicInfo:u.textureManager.getMosaicInfo(o,n.textureKey)},defines:{...d,isBackgroundPass:!0,isLabel:!1,textRenderPassType:0},optionalAttributes:m.optionalAttributes,useComputeBuffer:t(e)};u.setShader(p),u.setPipelineState(i(e)),u.submitDraw(e,n),u.setShader({...p,defines:{...d,isBackgroundPass:!1,isLabel:!1,textRenderPassType:2}}),u.submitDraw(e,n),u.setShader({...p,defines:{...d,isBackgroundPass:!1,isLabel:!1,textRenderPassType:1}}),u.submitDraw(e,n),u.setShader({...p,defines:{...d,isBackgroundPass:!1,isLabel:!1,textRenderPassType:0}}),u.submitDraw(e,n)}}export{o as TextTechnique};
5
+ import{FeatureTechnique as e}from"../FeatureTechnique.js";import{getSelectionDefines as s,isHittest as t,getFeatureUniforms as r,resolveDynamicUniforms as a,getFeaturePipelineState as i}from"../featureTechniqueUtils.js";import{TextShader as n}from"./TextShader.js";class o extends e{constructor(){super(...arguments),this.type=25,this.shaders={geometry:new n},this.symbologyPlane=3}render(e,n){const{context:o,painter:u}=e,d=s(e),m=n.instance.getInput(),p={shader:this.shaders.geometry,uniforms:{...a(e,n.target,m.uniforms),...r(e,n.target),mosaicInfo:u.textureManager.getMosaicInfo(o,n.textureKey)},defines:{...d,isBackgroundPass:!0,isLabel:!1,textRenderPassType:0},optionalAttributes:m.optionalAttributes,useComputeBuffer:t(e)};u.setShader(p),u.setPipelineState(i(e)),u.submitDraw(e,n),u.setShader({...p,defines:{...d,isBackgroundPass:!1,isLabel:!1,textRenderPassType:2}}),u.submitDraw(e,n),u.setShader({...p,defines:{...d,isBackgroundPass:!1,isLabel:!1,textRenderPassType:1}}),u.submitDraw(e,n),u.setShader({...p,defines:{...d,isBackgroundPass:!1,isLabel:!1,textRenderPassType:0}}),u.submitDraw(e,n)}}export{o as TextTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as r}from"../../utils.js";import{Technique as s}from"../Technique.js";import{VideoScreenShader as o}from"../shaders/VideoScreenShader.js";import{PrimitiveType as n,DataType as i}from"../../../../../../webgl/enums.js";import{VertexElementDescriptor as m}from"../../../../../../webgl/VertexElementDescriptor.js";class c extends s{constructor(){super(...arguments),this.type=26,this._mesh=null,this.shaders={geometry:new o}}render(e,t){const{context:s,painter:o}=e,{texture:n,textureCoords:i}=t,m=this._getMesh(e),c=t.ndcRect[2],a=t.ndcRect[3],h=t.ndcRect[0],u=t.ndcRect[1],d=new Float32Array(180);for(let r=0;r<6;r++){const e=a*r/5;for(let t=0;t<6;t++){const s=c*t/5,{u:o,v:n}=i[6*r+t];d[5*(6*r+t)]=h+s,d[5*(6*r+t)+1]=u-e,d[5*(6*r+t)+2]=o,d[5*(6*r+t)+3]=n,d[5*(6*r+t)+4]=1}}m.vertexBuffers.get("geometry")?.setData(d);const p={texture:{texture:n,unit:0},opacity:t.opacity},l={shader:this.shaders.geometry,uniforms:{config:p},defines:{},optionalAttributes:null,useComputeBuffer:!1};o.setPipelineState(r),o.submitDrawMeshUntyped(s,l,m)}shutdown(){e(this._mesh)}_getMesh(e){const{context:r}=e,s=new Uint32Array(150);for(let t=0;t<5;t++)for(let e=0;e<5;e++){const r=6*(5*t+e),o=6*(t+1)+e+1,n=o-1,i=o-6,m=o-7;s[r]=o,s[r+1]=n,s[r+2]=i,s[r+3]=n,s[r+4]=m,s[r+5]=i}return this._mesh||(this._mesh=new t(r,{vertex:{geometry:{data:new Float32Array(180),layout:[new m("position",2,i.FLOAT,0,20),new m("texcoord",2,i.FLOAT,8,20),new m("w",1,i.FLOAT,16,20)]}},index:{index:{data:s}},groups:[{primitive:n.TRIANGLES,index:"index"}],parts:[{group:0,start:0,count:s.length}]})),this._mesh}}export{c as VideoScreenTechnique};
5
+ import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as r}from"../../utils.js";import{Technique as s}from"../Technique.js";import{VideoScreenShader as o}from"../shaders/VideoScreenShader.js";import{PrimitiveType as n,DataType as i}from"../../../../../../webgl/enums.js";import{VertexElementDescriptor as m}from"../../../../../../webgl/VertexElementDescriptor.js";class c extends s{constructor(){super(...arguments),this.type=27,this._mesh=null,this.shaders={geometry:new o}}render(e,t){const{context:s,painter:o}=e,{texture:n,textureCoords:i}=t,m=this._getMesh(e),c=t.ndcRect[2],a=t.ndcRect[3],h=t.ndcRect[0],u=t.ndcRect[1],d=new Float32Array(180);for(let r=0;r<6;r++){const e=a*r/5;for(let t=0;t<6;t++){const s=c*t/5,{u:o,v:n}=i[6*r+t];d[5*(6*r+t)]=h+s,d[5*(6*r+t)+1]=u-e,d[5*(6*r+t)+2]=o,d[5*(6*r+t)+3]=n,d[5*(6*r+t)+4]=1}}m.vertexBuffers.get("geometry")?.setData(d);const p={texture:{texture:n,unit:0},opacity:t.opacity},l={shader:this.shaders.geometry,uniforms:{config:p},defines:{},optionalAttributes:null,useComputeBuffer:!1};o.setPipelineState(r),o.submitDrawMeshUntyped(s,l,m)}shutdown(){e(this._mesh)}_getMesh(e){const{context:r}=e,s=new Uint32Array(150);for(let t=0;t<5;t++)for(let e=0;e<5;e++){const r=6*(5*t+e),o=6*(t+1)+e+1,n=o-1,i=o-6,m=o-7;s[r]=o,s[r+1]=n,s[r+2]=i,s[r+3]=n,s[r+4]=m,s[r+5]=i}return this._mesh||(this._mesh=new t(r,{vertex:{geometry:{data:new Float32Array(180),layout:[new m("position",2,i.FLOAT,0,20),new m("texcoord",2,i.FLOAT,8,20),new m("w",1,i.FLOAT,16,20)]}},index:{index:{data:s}},groups:[{primitive:n.TRIANGLES,index:"index"}],parts:[{group:0,start:0,count:s.length}]})),this._mesh}}export{c as VideoScreenTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{throwIfAborted as e}from"../../../../../../core/promiseUtils.js";import{difference as t,union as s}from"../../../../../../core/SetUtils.js";import i from"../../../../../../layers/support/FieldsIndex.js";import{createParquetFile as r}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as a}from"./ALoadStrategy.js";import{FeatureSnapshotSourceChunk as o}from"./chunks/FeatureSnapshotSourceChunk.js";import{FeatureSetReaderJSON as l}from"../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderParquet as n}from"../../support/FeatureSetReaderParquet.js";class m extends a{constructor(e,t,s,i){super(i),this._service=e,this._metadata=t,this._schema=s,this._chunkId=0,this._files=[],this._availableFields=new Set(s.mutable.availableFields)}destroy(){super.destroy();for(const e of this._files)e.free()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}async updateFields(e){await this._promise;const i=new Set(e),r=t(i,this._availableFields);this._availableFields=s(r,this._availableFields);const a=this._fieldsIndex;if(null==a)return;const o=Array.from(r).map(e=>a.get(e)?.attributeId);if(r.size)for(const t of this._files)await t.ensureFields(new Uint16Array(o))}async load(e){return null==this._promise&&(this._promise=this._download()),this._promise}unload(e){}async addParquetFile(e){this._insert(e)}async _insert(t){const s=await r(t,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters});this._files.push(s),e(this._options);const a=s.fields().map(e=>({name:e.name,alias:e.name,type:e.type,attributeId:s.attributeIdFor(e.name)})),{timeZoneByFieldName:l}=this._service.metadata.fieldsIndex,m=i.fromJSON({fields:a,timeZoneByFieldName:l});this._fieldsIndex=m;const u=new Uint16Array(Array.from(this._availableFields.values()).map(e=>m.get(e)?.attributeId).filter(e=>null!=e));await s.readAllChunks(u,this._signal,e=>{if(this._signal.aborted)return;const t=this._chunkId++,s=new n(this._metadata,m,e,t),i=new o(s,null,t,!1);this._store.insert(i)})}async _download(){try{await Promise.all(this._service.source.urls.map(e=>this._insert(e)));const e=new o(l.empty(this._metadata),null,-1,!0);this._store.insert(e)}catch(e){throw console.error(e),e}}}export{m as ParquetSnapshotLoadStrategy};
5
+ import{throwIfAborted as e}from"../../../../../../core/promiseUtils.js";import{difference as t,union as s}from"../../../../../../core/SetUtils.js";import i from"../../../../../../layers/support/FieldsIndex.js";import{createParquetFile as r}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as a}from"./ALoadStrategy.js";import{FeatureSnapshotSourceChunk as o}from"./chunks/FeatureSnapshotSourceChunk.js";import{FeatureSetReaderJSON as l}from"../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderParquet as n}from"../../support/FeatureSetReaderParquet.js";class m extends a{constructor(e,t,s,i){super(i),this._service=e,this._metadata=t,this._schema=s,this._chunkId=0,this._files=[],this._availableFields=new Set(s.mutable.availableFields)}destroy(){super.destroy();for(const e of this._files)e.free()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}async updateFields(e){await this._promise;const i=new Set(e),r=t(i,this._availableFields);this._availableFields=s(r,this._availableFields);const a=this._fieldsIndex;if(null==a)return;const o=Array.from(r).map(e=>a.get(e)?.column);if(r.size)for(const t of this._files)await t.ensureFields(new Uint32Array(o))}async load(e){return null==this._promise&&(this._promise=this._download()),this._promise}unload(e){}async addParquetFile(e){this._insert(e)}async _insert(t){const s=await r(t,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters});this._files.push(s),e(this._options);const a=s.fields().map(e=>({name:e.name,alias:e.name,type:e.type,column:s.columnForFieldName(e.name)})),{timeZoneByFieldName:l}=this._service.metadata.fieldsIndex,m=i.fromJSON({fields:a,timeZoneByFieldName:l});this._fieldsIndex=m;const u=new Uint32Array(Array.from(this._availableFields.values()).map(e=>m.get(e)?.column).filter(e=>null!=e));await s.readAllChunks(u,this._signal,e=>{if(this._signal.aborted)return;const t=this._chunkId++,s=new n(this._metadata,m,e,t),i=new o(s,null,t,!1);this._store.insert(i)})}async _download(){try{await Promise.all(this._service.source.urls.map(e=>this._insert(e)));const e=new o(l.empty(this._metadata),null,-1,!0);this._store.insert(e)}catch(e){throw console.error(e),e}}}export{m as ParquetSnapshotLoadStrategy};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{QueueProcessor as e}from"../../../../../../core/QueueProcessor.js";import{difference as t,union as i}from"../../../../../../core/SetUtils.js";import s from"../../../../../../geometry/Polygon.js";import a from"../../../../../../geometry/SpatialReference.js";import{toExtent as r}from"../../../../../../geometry/support/aaBoundingRect.js";import{convertFromPolygon as n}from"../../../../../../layers/graphics/featureConversionUtils.js";import o from"../../../../../../layers/graphics/OptimizedGeometry.js";import{project as l}from"../../../../../../layers/graphics/data/projectionSupport.js";import d from"../../../../../../layers/support/FieldsIndex.js";import{createParquetFile as m}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as u}from"./ALoadStrategy.js";import{ParquetSourceChunk as h}from"./chunks/ParquetSourceChunk.js";import{FeatureSetReaderParquet as p}from"../../support/FeatureSetReaderParquet.js";class f extends u{constructor(e,t,i,s){super(s),this._metadata=t,this._schema=i,this._files=[];const a=new Set(i.mutable.availableFields);if(!e.geometryInfo.displayOptimization)throw new Error("InternalError: ParquetTileLoadStrategy only supports XZ-enabled parquet files");this._index=c.create(t,e,a,s,()=>this._schema.mutable.dataFilter.customParameters)}destroy(){super.destroy();for(const e of this._files)e.free()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}async load(e){const t=await this._index;await t.ensureLoaded(e)}unload(e){this._index.then(t=>t.unload(e.tile))}async updateFields(e){return(await this._index).updateFields(e)}async addParquetFile(e){throw new Error("Impl!")}}class c{static async create(e,t,i,s,a){const r=await Promise.all(t.source.urls.map(e=>m(e,{geometryInfo:t.geometryInfo,outSpatialReference:t.outSpatialReference,getCustomParameters:a}))),[n]=r,o=n.fields().map(e=>({name:e.name,alias:e.name,type:e.type,attributeId:n.attributeIdFor(e.name)})),{timeZoneByFieldName:l}=t.metadata.fieldsIndex,u=d.fromJSON({fields:o,timeZoneByFieldName:l}),h=new Uint16Array(Array.from(i.values()).map(e=>u.get(e)?.attributeId).filter(e=>null!=e)),p=t.geometryInfo.displayOptimization;if(!p)throw new Error("InternalError: tiled parquet load requires display optimization");return new c(e,await Promise.all(r),u,h,s,i,p)}constructor(t,i,s,a,r,n,o){this._metadata=t,this._files=i,this._fieldsIndex=s,this._fieldIndices=a,this._store=r,this._availableFields=n,this._displayOptimization=o,this._queue=new e({concurrency:1,process:e=>this._ensureLoaded(e)}),this._tileIdToChunkId=new Map}get file(){return this._files[0]}async ensureLoaded(e){return this._queue.push(e)}unload(e){const t=this._tileIdToChunkId.get(e.id);if(null!=t){for(const e of t)this._store.removeById(e);this._tileIdToChunkId.delete(e.id)}}async _ensureLoaded(e){const t=this._metadata.outSpatialReference,i=e.tile,{xmin:s,ymin:a,xmax:r,ymax:n}=y(i.extent,t);let o=0;const l={extent:i.extent,extent_lat_lng:{xmin:s,ymin:a,xmax:r,ymax:n},tile_level:i.level,attributes:this._fieldIndices};if("z"===this._displayOptimization.mode?await this.file.queryZChunks(l.extent_lat_lng,this._fieldIndices,e.signal,t=>{if(e.signal.aborted)return;const s=new p(this._metadata,this._fieldsIndex,t,o),a=new h(this._metadata,s,i,o++,!1);this._insertChunk(i,a)}):await this.file.queryXZChunks(l,e.signal,t=>{if(e.signal.aborted)return;const s=new p(this._metadata,this._fieldsIndex,t,o),a=new h(this._metadata,s,i,o++,!1);this._insertChunk(i,a)}),e.signal.aborted)return;const d=new h(this._metadata,null,i,o++,!0);this._insertChunk(i,d)}_insertChunk(e,t){let i=this._tileIdToChunkId.get(e.id);null==i&&(i=[],this._tileIdToChunkId.set(e.id,i)),i.push(t.chunkId),this._store.insert(t)}async updateFields(e){const s=new Set(e),a=t(s,this._availableFields);if(this._availableFields=i(a,this._availableFields),a.size)for(const t of this._files){const e=Array.from(a).map(e=>this._fieldsIndex.get(e)?.attributeId);await t.ensureFields(new Uint16Array(e))}}}function y(e,t){const i=[e.xmin,e.ymin,e.xmax,e.ymax],d=s.fromExtent(r(i,t)),m=l(d,t,a.WGS84);if(!m)return null;const u=n(new o,m,!1,!1),h=u.coords.filter((e,t)=>!(t%2)),p=u.coords.filter((e,t)=>t%2);return{xmin:Math.min(...h),ymin:Math.min(...p),xmax:Math.max(...h),ymax:Math.max(...p)}}export{f as ParquetTileLoadStrategy};
5
+ import{QueueProcessor as e}from"../../../../../../core/QueueProcessor.js";import{difference as t,union as i}from"../../../../../../core/SetUtils.js";import s from"../../../../../../geometry/Polygon.js";import a from"../../../../../../geometry/SpatialReference.js";import{toExtent as r}from"../../../../../../geometry/support/aaBoundingRect.js";import{convertFromPolygon as n}from"../../../../../../layers/graphics/featureConversionUtils.js";import o from"../../../../../../layers/graphics/OptimizedGeometry.js";import{project as l}from"../../../../../../layers/graphics/data/projectionSupport.js";import m from"../../../../../../layers/support/FieldsIndex.js";import{createParquetFile as d}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as u}from"./ALoadStrategy.js";import{ParquetSourceChunk as h}from"./chunks/ParquetSourceChunk.js";import{FeatureSetReaderParquet as p}from"../../support/FeatureSetReaderParquet.js";class c extends u{constructor(e,t,i,s){super(s),this._metadata=t,this._schema=i,this._files=[];const a=new Set(i.mutable.availableFields);if(!e.geometryInfo.displayOptimization)throw new Error("InternalError: ParquetTileLoadStrategy only supports XZ-enabled parquet files");this._index=f.create(t,e,a,s,()=>this._schema.mutable.dataFilter.customParameters)}destroy(){super.destroy();for(const e of this._files)e.free()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}async load(e){const t=await this._index;await t.ensureLoaded(e)}unload(e){this._index.then(t=>t.unload(e.tile))}async updateFields(e){return(await this._index).updateFields(e)}async addParquetFile(e){throw new Error("Impl!")}}class f{static async create(e,t,i,s,a){const r=await Promise.all(t.source.urls.map(e=>d(e,{geometryInfo:t.geometryInfo,outSpatialReference:t.outSpatialReference,getCustomParameters:a}))),[n]=r,o=n.fields().map(e=>({name:e.name,alias:e.name,type:e.type,column:n.columnForFieldName(e.name)})),{timeZoneByFieldName:l}=t.metadata.fieldsIndex,u=m.fromJSON({fields:o,timeZoneByFieldName:l}),h=new Uint32Array(Array.from(i.values()).map(e=>u.get(e)?.column).filter(e=>null!=e)),p=t.geometryInfo.displayOptimization;if(!p)throw new Error("InternalError: tiled parquet load requires display optimization");return new f(e,await Promise.all(r),u,h,s,i,p)}constructor(t,i,s,a,r,n,o){this._metadata=t,this._files=i,this._fieldsIndex=s,this._fieldIndices=a,this._store=r,this._availableFields=n,this._displayOptimization=o,this._queue=new e({concurrency:1,process:e=>this._ensureLoaded(e)}),this._tileIdToChunkId=new Map}get file(){return this._files[0]}async ensureLoaded(e){return this._queue.push(e)}unload(e){const t=this._tileIdToChunkId.get(e.id);if(null!=t){for(const e of t)this._store.removeById(e);this._tileIdToChunkId.delete(e.id)}}async _ensureLoaded(e){const t=this._metadata.outSpatialReference,i=e.tile,{xmin:s,ymin:a,xmax:r,ymax:n}=y(i.extent,t);let o=0;const l={extent:i.extent,extent_lat_lng:{xmin:s,ymin:a,xmax:r,ymax:n},tile_level:i.level,attributes:this._fieldIndices};if("z"===this._displayOptimization.mode?await this.file.queryZChunks(l.extent_lat_lng,this._fieldIndices,e.signal,t=>{if(e.signal.aborted)return;const s=new p(this._metadata,this._fieldsIndex,t,o),a=new h(this._metadata,s,i,o++,!1);this._insertChunk(i,a)}):await this.file.queryXZChunks(l,e.signal,t=>{if(e.signal.aborted)return;const s=new p(this._metadata,this._fieldsIndex,t,o),a=new h(this._metadata,s,i,o++,!1);this._insertChunk(i,a)}),e.signal.aborted)return;const m=new h(this._metadata,null,i,o++,!0);this._insertChunk(i,m)}_insertChunk(e,t){let i=this._tileIdToChunkId.get(e.id);null==i&&(i=[],this._tileIdToChunkId.set(e.id,i)),i.push(t.chunkId),this._store.insert(t)}async updateFields(e){const s=new Set(e),a=t(s,this._availableFields);if(this._availableFields=i(a,this._availableFields),a.size)for(const t of this._files){const e=Array.from(a).map(e=>this._fieldsIndex.get(e)?.column);await t.ensureFields(new Uint32Array(e))}}}function y(e,t){const i=[e.xmin,e.ymin,e.xmax,e.ymax],m=s.fromExtent(r(i,t)),d=l(m,t,a.WGS84);if(!d)return null;const u=n(new o,d,!1,!1),h=u.coords.filter((e,t)=>!(t%2)),p=u.coords.filter((e,t)=>t%2);return{xmin:Math.min(...h),ymin:Math.min(...p),xmax:Math.max(...h),ymax:Math.max(...p)}}export{c as ParquetTileLoadStrategy};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{assertIsSome as r}from"../../../../../core/maybe.js";import{baseObjectMemory as s}from"../../../../../core/memoryEstimations.js";import n from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as i}from"./FeatureSetCache.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";import{parseHeader as o}from"./FeatureSetReaderPBFHeader.js";const d=!0,u=268435455,c=128,l=128e3,g={small:{delta:new Int32Array(c),decoded:new Int32Array(c)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(l),decoded:new Int32Array(l)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function _(e,t){return t?e<=g.small64.delta.length?g.small64:(e<=g.large64.delta.length||(g.large64.delta=new Float64Array(Math.round(1.25*e)),g.large64.decoded=new Float64Array(Math.round(1.25*e))),g.large64):e<=g.small.delta.length?g.small:(e<=g.large.delta.length||(g.large.delta=new Int32Array(Math.round(1.25*e)),g.large.decoded=new Int32Array(Math.round(1.25*e))),g.large)}function f(r){try{const e=2,t=new n(new Uint8Array(r),new DataView(r));for(;t.next();){if(t.tag()===e)return I(t.getMessage());t.skip()}}catch(s){const r=new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:s});t.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(r)}return null}function I(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function y(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function m(e,t,r,s,n,a){return.5*Math.abs(e*s+r*a+n*t-e*a-r*t-n*s)}function p(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class x extends h{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=f(e),a=o(n,"esriGeometryPoint"===s,t.featureIdInfo,r);return new x(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new x(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return s+(this._cache.geometry?.usedMemory??0)}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===u?null:new a([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===u)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new a([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new i(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=y(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=_(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),n=s.getLength(),i=s.pos()+n,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new a(o,h)}_parseGeometryForDisplay(e){const t=2,s=3,n=e.asUnsafe(),i=n.getLength(),h=n.pos()+i,o=[],u=[];let c=0,l=0,g=null,f=0;const I="esriGeometryPolygon"===this.geometryType,y="esriGeometryPolyline"===this.geometryType,x=I||y;for(;n.pos()<h&&n.next();)switch(n.tag()){case t:{const e=n.getUInt32(),t=n.pos()+e;for(;n.pos()<t;){const e=n.getUInt32();o.push(e),c+=e}g=_(2*c,this._use64Bit).delta;break}case s:{n.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);r(g);for(const t of o)if(l+e*t>g.length)for(let e=0;e<t;e++)n.getSInt64(),n.getSInt64(),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();else if(I&&d){const e=this.getAreaSimplificationThreshold(t,this._header.vertexCount);let r=2,s=1;const a=!1;let i=n.getSInt64(),h=n.getSInt64();g[l++]=i,g[l++]=h,this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();let o=n.getSInt64(),d=n.getSInt64();for(this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();r<t;){let t=n.getSInt64(),a=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();const u=i+o,c=h+d;m(i,h,u,c,u+t,c+a)>=e?(f+=-.5*(u-i)*(c+h),s>1&&p(x,g[l-2],g[l-1],o,d)?(g[l-2]+=o,g[l-1]+=d):(g[l++]=o,g[l++]=d,s++),i=u,h=c):(t+=o,a+=d),o=t,d=a,r++}s<3||a?l-=2*s:(f+=-.5*(i+o-i)*(h+d+h),p(x,g[l-2],g[l-1],o,d)?(g[l-2]+=o,g[l-1]+=d,u.push(s)):(g[l++]=o,g[l++]=d,u.push(++s)))}else{let e=0,r=n.getSInt64(),s=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),g[l++]=r,g[l++]=s,e+=1;for(let a=1;a<t;a++){const t=n.getSInt64(),i=n.getSInt64(),h=r+t,o=s+i;f+=-.5*(h-r)*(o+s),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),a>2&&p(x,g[l-2],g[l-1],t,i)?(g[l-2]+=t,g[l-1]+=i):(g[l++]=t,g[l++]=i,e+=1),r=h,s=o}u.push(e)}break}default:n.skip()}return this._cache.area=f,u.length?new a(u,g):null!=g?this._createDeltaQuantizedExtrudedGeometry(g[0],g[1]):null}}export{x as FeatureSetReaderPBF};
5
+ import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{assertIsSome as r}from"../../../../../core/maybe.js";import{baseObjectMemory as s}from"../../../../../core/memoryEstimations.js";import n from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as i}from"./FeatureSetCache.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";import{parseHeader as o}from"./FeatureSetReaderPBFHeader.js";const d=268435455,u=128,c=128e3,l={small:{delta:new Int32Array(u),decoded:new Int32Array(u)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(c),decoded:new Int32Array(c)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function g(e,t){return t?e<=l.small64.delta.length?l.small64:(e<=l.large64.delta.length||(l.large64.delta=new Float64Array(Math.round(1.25*e)),l.large64.decoded=new Float64Array(Math.round(1.25*e))),l.large64):e<=l.small.delta.length?l.small:(e<=l.large.delta.length||(l.large.delta=new Int32Array(Math.round(1.25*e)),l.large.decoded=new Int32Array(Math.round(1.25*e))),l.large)}function _(r){try{const e=2,t=new n(new Uint8Array(r),new DataView(r));for(;t.next();){if(t.tag()===e)return f(t.getMessage());t.skip()}}catch(s){const r=new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:s});t.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(r)}return null}function f(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function y(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function m(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class I extends h{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=_(e),a=o(n,"esriGeometryPoint"===s,t.featureIdInfo,r);return new I(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map(e=>this._readAttributeAtIndex(e));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new I(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return s+(this._cache.geometry?.usedMemory??0)}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===d?null:new a([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===d)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new a([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new i(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=y(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=g(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),n=s.getLength(),i=s.pos()+n,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new a(o,h)}_parseGeometryForDisplay(e){const t=2,s=3,n=e.asUnsafe(),i=n.getLength(),h=n.pos()+i,o=[],d=[];let u=0,c=0,l=null,_=0;const f="esriGeometryPolygon"===this.geometryType,y="esriGeometryPolyline"===this.geometryType,I=f?3:y?2:1,p=f||y;for(;n.pos()<h&&n.next();)switch(n.tag()){case t:{const e=n.getUInt32(),t=n.pos()+e;for(;n.pos()<t;){const e=n.getUInt32();o.push(e),u+=e}l=g(2*u,this._use64Bit).delta;break}case s:{n.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);r(l);for(const t of o){if(c+e*t>l.length){for(let e=0;e<t;e++)n.getSInt64(),n.getSInt64(),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();continue}let r=0,s=n.getSInt64(),a=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),l[c++]=s,l[c++]=a,r+=1;for(let e=1;e<t;e++){const e=n.getSInt64(),t=n.getSInt64(),i=s+e,h=a+t;_+=-.5*(i-s)*(h+a),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),0===e&&0===t||m(p,l[c-2],l[c-1],e,t)?(l[c-2]+=e,l[c-1]+=t):(l[c++]=e,l[c++]=t,r+=1),s=i,a=h}r>=I?d.push(r):c-=r*e}break}default:n.skip()}return this._cache.area=_,d.length?new a(d,l):null!=l?this._createDeltaQuantizedExtrudedGeometry(l[0],l[1]):null}}export{I as FeatureSetReaderPBF};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import t from"../../../../../layers/graphics/OptimizedGeometry.js";import{QuantizedGeometryBuffer as r}from"../../../../../chunks/bundle.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";let s;class i extends n{constructor(t,r,n,s,i=new Uint32Array(n.size())){super(t),this._fields=r,this._inner=n,this._chunkId=s,this._displayIds=i,this._index=-1,this.usedMemory=e,this._size=this._inner.size();t.featureIdInfo.type,this._chunkId>65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return this.metadata.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._inner.rowId(this._index)}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}setBoundsXMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(e){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const e=new i(this.metadata,this._fields,this._inner,this._chunkId,this._displayIds);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._index=this._index}readGeometryForDisplayTransformed(e){const[n,i]=e.translate,[d,o]=e.scale;s||(s=r.new());return this._inner.transformGeometry(s,n,i,d,o,this._index)?new t(s.readLengthsUnsafe(),s.readCoordsUnsafe()):null}_readGeometry(e){const r=this._inner.readCoords(this._index),n=this._inner.readLengths(this._index);return r&&n?new t(n,r):null}_readX(){return this._inner.readX(this._index)}_readY(){return this._inner.readY(this._index)}_readServerCentroid(){return null}_readAttribute(e,t){const r=this.fields.get(e);if(!r)return;if(null==r.attributeId)return this.getObjectId();const n=this._inner.readAttribute(this._index,r.attributeId);if(null==n)return n;const s=this.fields.isDateField(r.name);return t?null==n?n:s?new Date(n):n:n}_readAttributes(){const e={};for(const t of this._fields.fields)null!=t.attributeId&&(this._inner.isEmpty(t.attributeId)||(e[t.name]=this._readAttribute(t.name,!1)));return e.__OBJECTID=this.getObjectId(),e}}export{i as FeatureSetReaderParquet};
5
+ import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import t from"../../../../../layers/graphics/OptimizedGeometry.js";import{QuantizedGeometryBuffer as r}from"../../../../../chunks/bundle.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";let s;class i extends n{constructor(t,r,n,s,i=new Uint32Array(n.size())){super(t),this._fields=r,this._inner=n,this._chunkId=s,this._displayIds=i,this._index=-1,this.usedMemory=e,this._size=this._inner.size();t.featureIdInfo.type,this._chunkId>65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return this.metadata.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._inner.rowId(this._index)}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}setBoundsXMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(e){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const e=new i(this.metadata,this._fields,this._inner,this._chunkId,this._displayIds);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._index=this._index}readGeometryForDisplayTransformed(e){const[n,i]=e.translate,[d,o]=e.scale;s||(s=r.new());return this._inner.transformGeometry(s,n,i,d,o,this._index)?new t(s.readLengthsUnsafe(),s.readCoordsUnsafe()):null}_readGeometry(e){const r=this._inner.readCoords(this._index),n=this._inner.readLengths(this._index);return r&&n?new t(n,r):null}_readX(){return this._inner.readX(this._index)}_readY(){return this._inner.readY(this._index)}_readServerCentroid(){return null}_readAttribute(e,t){const r=this.fields.get(e);if(!r)return;if(null==r.column)return this.getObjectId();const n=this._inner.readAttribute(this._index,r.column);if(null==n)return n;const s=this.fields.isDateField(r.name);return t?null==n?n:s?new Date(n):n:n}_readAttributes(){const e={};for(const t of this._fields.fields)null!=t.column&&(this._inner.isEmpty(t.column)||(e[t.name]=this._readAttribute(t.name,!1)));return e.__OBJECTID=this.getObjectId(),e}}export{i as FeatureSetReaderParquet};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as s}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i,width as a,height as c,expand as p}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as m}from"../../../../geometry/support/coordinateSystem.js";let d=class extends r{constructor(e){super(e)}get cameraPositionRenderSpace(){const{extent:e,renderCoordsHelper:r}=this,o=n();return r.toRenderCoords(e.center,o),r.setAltitude(o,h),o}get cameraDimensions(){const{extent:e}=this,r=i();this._expandBoundingRect(e.xmin,e.ymin,r),this._expandBoundingRect(e.xmax,e.ymin,r),this._expandBoundingRect(e.xmin,e.ymax,r),this._expandBoundingRect(e.xmax,e.ymax,r);return{width:a(r),height:c(r)}}get cameraNearFar(){return{near:x,far:g}}get upVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,2,n())}get northVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,1,n())}get eastVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,0,n())}_expandBoundingRect(e,r,o){const{extent:t,eastVector:n,northVector:i,upVector:a,renderCoordsHelper:c}=this,d=t.center.z??0;s(u,e,r,d),c.toRenderCoords(u,t.spatialReference,u),m(u,n,i,a,l),p(o,l,o)}};e([o()],d.prototype,"renderCoordsHelper",void 0),e([o()],d.prototype,"extent",void 0),e([o()],d.prototype,"cameraPositionRenderSpace",null),e([o()],d.prototype,"cameraDimensions",null),e([o()],d.prototype,"upVector",null),e([o()],d.prototype,"northVector",null),e([o()],d.prototype,"eastVector",null),d=e([t("esri.views.3d.analysis.VolumeMeasurement.CutFillVolumeMeasurementComputation")],d);const u=n(),l=n(),h=9e3,x=0,g=2e4;export{d as CutFillVolumeMeasurementComputation};
5
+ import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as n}from"../../../../chunks/vec32.js";import{fromValues as s,create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,width as c,height as p,expand as d}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as l}from"../../../../geometry/support/coordinateSystem.js";let m=class extends r{constructor(e){super(e)}get localOrigin(){const{extent:e}=this;return s(e.center.x,e.center.y,0)}get localOriginRenderSpace(){const{extent:e,localOrigin:r,renderCoordsHelper:t}=this,o=i();return t.toRenderCoords(r,e.spatialReference,o),o}get cameraPositionRenderSpace(){const{localOriginRenderSpace:e,renderCoordsHelper:r}=this,t=i();return r.setAltitude(t,h,e),t}get cameraDimensions(){const{extent:e,renderCoordsHelper:r}=this;if(2===r.viewingMode)return{width:e.width,height:e.height};const t=a();this._expandBoundingRect(e.xmin,e.ymin,t),this._expandBoundingRect(e.xmax,e.ymin,t),this._expandBoundingRect(e.xmin,e.ymax,t),this._expandBoundingRect(e.xmax,e.ymax,t);return{width:c(t),height:p(t)}}get cameraNearFar(){return{near:x,far:y}}get upVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,2,i())}get northVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,1,i())}get eastVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,0,i())}_expandBoundingRect(e,r,t){const{extent:o,eastVector:s,northVector:i,upVector:a,renderCoordsHelper:c}=this,p=o.center.z??0;n(u,e,r,p),c.toRenderCoords(u,o.spatialReference,u),l(u,s,i,a,g),d(t,g,t)}};e([t()],m.prototype,"renderCoordsHelper",void 0),e([t()],m.prototype,"extent",void 0),e([t()],m.prototype,"localOrigin",null),e([t()],m.prototype,"localOriginRenderSpace",null),e([t()],m.prototype,"cameraPositionRenderSpace",null),e([t()],m.prototype,"cameraDimensions",null),e([t()],m.prototype,"upVector",null),e([t()],m.prototype,"northVector",null),e([t()],m.prototype,"eastVector",null),m=e([o("esri.views.3d.analysis.VolumeMeasurement.CutFillVolumeMeasurementComputation")],m);const u=i(),g=i(),h=9e3,x=0,y=2e4;export{m as CutFillVolumeMeasurementComputation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{syncAndInitial as o,watch as n,initial as a}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as p}from"../../../../geometry/projectionUtils.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as d,fromExtent as u,intersects as c}from"../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as y}from"../support/projectionUtils.js";import{CutFillVolumeMeasurementComputation as g}from"./CutFillVolumeMeasurementComputation.js";import{getElevationAtPoint as h}from"../../support/ElevationProvider.js";let v=class extends t{constructor(e){super(e),this._updatingHandles=new l,this._computation=null}initialize(){this._updatingHandles.add(()=>({geometry:this.analysis.geometry,projectedGeometry:p(this.analysis.geometry,this.view.spatialReference)}),({geometry:e,projectedGeometry:t})=>{null==t.pending?this._onGeometryChange(e,t.geometry):this._updatingHandles.addPromise(t.pending)},o),this.addHandles([this._createElevationUpdateHandle(),n(()=>[this.analysis.measureType,this.analysisViewData.elevationAlignedGeometry,this.analysisViewData.effectiveTargetElevation],()=>this._updateTargetGeometry()),n(()=>this.analysisViewData.elevationAlignedGeometry?.extent,e=>{e?this._updateComputation(e):this._removeComputation()},a)])}destroy(){this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}_createComputation(e){const{renderCoordsHelper:t}=this.view;this._computation=new g({extent:e,renderCoordsHelper:t})}_updateComputation(e){this._computation?this._computation.extent=e:this._createComputation(e)}_removeComputation(){this._computation=null}_createElevationUpdateHandle(){const e=t=>{const i=this.analysis.geometry;if(null==i)return;const o=p(i,this.view.spatialReference);if(null!=o.pending)return this._updatingHandles.addPromise(o.pending),void o.pending.finally(()=>e(t));const n=o.geometry;null!=n&&null!=n.extent&&(m(t.extent,t.spatialReference,_,this.view.spatialReference),u(n.extent,w),c(_,w)&&this._onGeometryChange(i,n))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_onGeometryChange(e,t){const{elevationProvider:o}=this.view,{valid:n}=this.analysis;if(null==e||!n)return void(this.analysisViewData.elevationAlignedGeometry=null);if(null==t)return y(this.analysis,e.spatialReference,i.getLogger(this)),void(this.analysisViewData.elevationAlignedGeometry=null);const a=t.clone();f(o,a),this.analysisViewData.elevationAlignedGeometry=a}_updateTargetGeometry(){const{measureType:e}=this.analysis,{elevationAlignedGeometry:t,effectiveTargetElevation:i}=this.analysisViewData;if(!t)return void(this.analysisViewData.targetGeometry=null);if("stockpile"===e||!i)return void(this.analysisViewData.targetGeometry=t);const o=t.clone();o.rings[0].forEach(e=>{e[2]=i}),this.analysisViewData.targetGeometry=o}};function f(e,t){t.rings[0].forEach(t=>{t[2]=h(e,t,"ground")??0})}e([r({constructOnly:!0})],v.prototype,"analysis",void 0),e([r({constructOnly:!0})],v.prototype,"analysisViewData",void 0),e([r({constructOnly:!0})],v.prototype,"view",void 0),e([r()],v.prototype,"updating",null),e([r({readOnly:!0})],v.prototype,"_updatingHandles",void 0),e([r()],v.prototype,"_computation",void 0),v=e([s("esri.views.3d.analysis.VolumeMeasurement.CutFillVolumeMeasurementController")],v);const _=d(),w=d();export{v as CutFillVolumeMeasurementController};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import i from"../../../../core/Logger.js";import{syncAndInitial as o,watch as n,initial as a}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as p}from"../../../../geometry/projectionUtils.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as d,fromExtent as u,intersects as c}from"../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as y}from"../support/projectionUtils.js";import{CutFillVolumeMeasurementComputation as g}from"./CutFillVolumeMeasurementComputation.js";import{getElevationAtPoint as h}from"../../support/ElevationProvider.js";let v=class extends t{constructor(e){super(e),this._updatingHandles=new l,this._computation=null}initialize(){this._updatingHandles.add(()=>({geometry:this.analysis.geometry,projectedGeometry:p(this.analysis.geometry,this.view.spatialReference)}),({geometry:e,projectedGeometry:t})=>{null==t.pending?this._onGeometryChange(e,t.geometry):this._updatingHandles.addPromise(t.pending)},o),this.addHandles([this._createElevationUpdateHandle(),n(()=>[this.analysis.measureType,this.analysisViewData.elevationAlignedGeometry,this.analysisViewData.effectiveTargetElevation],()=>this._updateTargetGeometry()),n(()=>this.analysisViewData.elevationAlignedGeometry?.extent,e=>{e?this._updateComputation(e):this._removeComputation()},a)])}destroy(){this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}_createComputation(e){const{renderCoordsHelper:t}=this.view;this._computation=new g({extent:e,renderCoordsHelper:t})}_updateComputation(e){this._computation?this._computation.extent=e:this._createComputation(e)}_removeComputation(){this._computation=null}_createElevationUpdateHandle(){const e=t=>{const i=this.analysis.geometry;if(null==i)return;const o=p(i,this.view.spatialReference);if(null!=o.pending)return this._updatingHandles.addPromise(o.pending),void o.pending.finally(()=>e(t));const n=o.geometry;null!=n&&null!=n.extent&&(m(t.extent,t.spatialReference,_,this.view.spatialReference),u(n.extent,w),c(_,w)&&this._onGeometryChange(i,n))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_onGeometryChange(e,t){const{elevationProvider:o}=this.view,{valid:n}=this.analysis;if(null==e||!n)return void(this.analysisViewData.elevationAlignedGeometry=null);if(null==t)return y(this.analysis,e.spatialReference,i.getLogger(this)),void(this.analysisViewData.elevationAlignedGeometry=null);const a=t.clone();f(o,a),this.analysisViewData.elevationAlignedGeometry=a}_updateTargetGeometry(){const{measureType:e}=this.analysis,{elevationAlignedGeometry:t,effectiveTargetElevation:i}=this.analysisViewData;if(!t)return void(this.analysisViewData.targetGeometry=null);if("stockpile"===e||null==i)return void(this.analysisViewData.targetGeometry=t);const o=t.clone();o.rings[0].forEach(e=>{e[2]=i}),this.analysisViewData.targetGeometry=o}};function f(e,t){t.rings[0].forEach(t=>{t[2]=h(e,t,"ground")??0})}e([r({constructOnly:!0})],v.prototype,"analysis",void 0),e([r({constructOnly:!0})],v.prototype,"analysisViewData",void 0),e([r({constructOnly:!0})],v.prototype,"view",void 0),e([r()],v.prototype,"updating",null),e([r({readOnly:!0})],v.prototype,"_updatingHandles",void 0),e([r()],v.prototype,"_computation",void 0),v=e([s("esri.views.3d.analysis.VolumeMeasurement.CutFillVolumeMeasurementController")],v);const _=d(),w=d();export{v as CutFillVolumeMeasurementController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{initial as s,watch as r}from"../../../core/reactiveUtils.js";import{schedule as o}from"../../../core/scheduling.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as l,invert as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as d,IDENTITY as m}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{translate as h,getTranslation as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as g}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{f,o as b}from"../../../chunks/vec32.js";import{fromArray as y,create as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{SphericalECEFSpatialReferenceLike as v}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as x}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as C}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as j}from"../../../geometry/projection/projectVectorToVector.js";import{create as T}from"../../../geometry/support/aaBoundingRect.js";import{BufferViewVec2f as M,BufferViewVec4f as U,BufferViewVec4u8 as O,BufferViewVec4u16 as P,BufferViewVec3f as H,BufferViewVec3u8 as R,BufferViewVec3u16 as F,BufferViewInt16 as S,BufferViewUint32 as A,BufferViewUint16 as E}from"../../../geometry/support/buffer/BufferView.js";import k from"../../../layers/support/SceneModification.js";import{getElevationOffsetInMeters as V}from"../../../support/elevationInfoUtils.js";import{toWasmModification as I}from"./I3SMeshWorkerHandle.js";import{IntegratedMesh3DTilesViewPerformanceInfo as B}from"./IntegratedMesh3DTilesViewPerformanceInfo.js";import{LayerView3D as L}from"./LayerView3D.js";import{addLayerViewToWasm as D,removeLayerViewFromWasm as G,getLyr3DWasm as z}from"./Lyr3DWasm.js";import{LayerElevationProvider as N}from"./i3s/LayerElevationProvider.js";import{primTypeConversion as W,alphaModeConversion as $,faceCullingConversion as J,wrapModeConversion as q,lyr3DTypeToByteSize as K}from"./support/lyr3dTypeConversions.js";import{Tiles3DIntersectionHandler as Q}from"./support/Tiles3DIntersectionHandler.js";import{ElevationRange as X}from"../support/ElevationRange.js";import{toBoundingRect as Y}from"../support/extentUtils.js";import{Obb as Z,compute as ee}from"../support/orientedBoundingBox.js";import{ObjectParameters as te}from"../webgl-engine/collections/Component/ObjectParameters.js";import{GeometryParameters as ie,createVertexBufferLayout as se}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as re}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as oe}from"../webgl-engine/core/material/RenderTexture.js";import{getEllipsoidMode as ne}from"../webgl-engine/core/shaderLibrary/util/EllipsoidMode.js";import{Attribute as ae}from"../webgl-engine/lib/Attribute.js";import{compressAndTransformNormals as le}from"../webgl-engine/lib/Normals.js";import{Texture as ce}from"../webgl-engine/lib/Texture.js";import{writeAttribute as de,writeBufferVec2 as me}from"../webgl-engine/materials/internal/bufferWriterUtils.js";import he from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as ue,isInEffectiveScaleRange as pe}from"../../support/layerViewUtils.js";import{TextureCompressionTracker as ge}from"../../support/TextureCompressionTracker.js";import{alphaCutoff as fe}from"../../../webscene/support/AlphaCutoff.js";class be{constructor(){this.handle=0,this.isVisible=!1,this.components=[],this.textureMemoryUsage=0,this.vboMemoryUsage=0,this.cpuMemoryUsage=0,this.textures=[]}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get cachedMemory(){return this.usedMemory}}function ye(e){return Math.round(e/1048.576)/1e3}let _e=class extends(L(he)){constructor(){super(...arguments),this.type="integrated-mesh-3dtiles",this._compressionTracker=new ge,this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this.drapeTargetType=1,this._applySSAO=!has("disable-feature:im-ssao"),this._shadeNormals=!!has("enable-feature:im-shading"),this._lyrHandleToObjects=new Map,this._initialCullFace=new Map,this._suspendedHandle=null,this._dbgFlags=new Set}get hasModifications(){return this._modifications&&this._modifications.length>0}initialize(){if(this._dbgFlags.add(3),this._dbg(2,"Tiles3DLayerView3D initialize() called"),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),s),!this._canProjectWithoutEngine())throw ue("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=D(this).then(e=>{this._wasmLayerId=e,this._intersectionHandler=new Q(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),s),this._updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),s),this._elevationProvider=new N({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this.view.elevationProvider.register("im",this._elevationProvider),this.view.basemapTerrain.overlayManager.registerDrapeTarget(this);const t=this.view.resourceController.memoryController.newCache(`t3d-${this.uid}`,e=>this._onRemoveFromCache(e));this._memCache=t,this.addHandles([r(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e))]),this._suspendedHandle=r(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),s)});this.addResolvingPromise(e)}destroy(){this._dbg(2,"Tiles3DLayerView3D destroy() called"),G(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&(this._elevationProvider.objectsChanged(this._obbs),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this.view.basemapTerrain.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._initialCullFace.clear(),this._memCache=i(this._memCache),this._updatingHandles=i(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_modificationsChanged(){const e=this.layer.spatialReference,t=I(this._layerClippingArea,this._modifications,e);this._wasm?.setMeshModifications(this,t,e.wkid)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=T();this._layerClippingArea=Y(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=o(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),this.objects.forEach(t=>{const i=this._collection.getMaterial(t);i.commonMaterialParameters.hasSlicePlane=e,i.commonMaterialParameters.cullFace=e?0:this._initialCullFace.get(t)})}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,V(e))}get _obbs(){return this.objects.map(e=>this._collection.getComponentObb(e))}get _wasm(){return z(this.view)}get wasmLayerId(){return this._wasmLayerId}get usedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible&&(e+=t.usedMemory)}),e}get unloadedMemory(){return 0}get cachedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible||(e+=t.usedMemory)}),e}get visibleAtCurrentScale(){return pe(this.layer.effectiveScaleRange,this.view.scale)}get performanceInfo(){let e=0,t=0,i=0,s=0,r=0,o=0;return this._lyrHandleToObjects.forEach(n=>{n.isVisible?(e+=n.textureMemoryUsage,t+=n.vboMemoryUsage,r++):(i+=n.textureMemoryUsage,s+=n.vboMemoryUsage,o++)}),new B(this.usedMemory,r,o,ye(t),ye(e),ye(s),ye(i))}_canProjectWithoutEngine(){if(2===this.view.state.viewingMode){const e=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1;if(3857!==e&&32662!==e)return!1}return!0}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationOffset(){return V(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new X(e.zmin,e.zmax):null}getElevationRange(e){return null}get fullExtent(){return this.layer.fullExtent}get objects(){return Array.from(this._lyrHandleToObjects.values()).reduce((e,t)=>e.concat(t.components),new Array)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const i=y(t.desc.origin),s=new Array,r=new Map,o=new be;o.handle=e.handle,this._lyrHandleToObjects.set(e.handle,o);const n=this.view.basemapTerrain.spatialReference;let a,T;if("global"===this.view.viewingMode){const e=p();x(v,i,e,n),a=l(d(),e),T=c(d(),a)}else a=m,T=m;const U=p();h(U,U,i);const O=u(_(),U);let P=null;const H=_();if(t.desc.obb){const e=t.desc.obb.quaternion;P=new Z(t.desc.obb.center,t.desc.obb.halfSize,g(e[0],e[1],e[2],e[3]))}for(let l=0;l<t.desc.prims.length;l++){const e=t.desc.prims[l];this._dbg(2,JSON.stringify(e));if(null==W[e.ptype]||null==t.data){this._dbg(2,"[Unsupported Feature] Unsupported primitive mode ("+e.ptype+"). Skipping primitive.");continue}const c=t.desc?.materials&&null!=e.materialId?t.desc.materials[e.materialId]:null,d=null!=c?c.lightingModel:"Unlit",{positionView:h,positionAttr:u,normalsView:p,normalsAttr:g,colorAttr:y,texCoord0Attr:v,indicesView:x}=this.getBufferViews(e,t.data.buffer,a);if(null==u||null==h||null==x)continue;const U=new ie(null!=y,v?1:0,null!=p,this._shadeNormals,this._applySSAO),R=u.data.length/u.size,F=(e,t)=>!e||e.data.length/e.size===R||(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1);if(!F(v,"numTexcoord")||!F(y,"numColors")||!F(g,"normals"))continue;const S=se(U);if(null!=P?P=P.clone():(P=ee(u),f(H,P.center,i),P.center=H),a!==m)for(let t=0;t<h.count;t++)h.getVec(t,H),b(H,H,a),h.setVec(t,H);const A=S.createBuffer(u.data.length);if(de("position",u,null,null,A,0),null!=v){const e=A.getField("uv0",M);me(v,e,0)}null!=y&&de("color",u,null,null,A,0),null!=g&&de("normalCompressed",g,null,null,A,0);const E=new Uint32Array([0,x.typedBuffer.length]),k={vertices:{data:A.buffer,count:A.byteLength/S.stride,layoutParameters:U},positionData:{positions:h.typedBuffer,indices:x.typedBuffer},indices:x.typedBuffer,componentOffsets:E};o.cpuMemoryUsage+=h.count,o.cpuMemoryUsage+=x.count;const V=this.view.renderSpatialReference,I=_(),B=[1,1,1];C(O,V,B,n)||this._dbg(3,"Unsupported coordinate system for IM overlay"),j(O,V,I,n);const L=this._collection.createObject(new te(w(I[0],I[1],B[0],B[1]),new re(O,T),P,k));c&&this._collection.updateMaterial(L,e=>{e.baseColor=c.baseColorFactor,e.usePBR="Pbr"===d,e.hasParametersFromSource=!1,e.baseColorTexture=this._getTexture(c.baseColorTex,t,r,o),e.usePBR&&(e.mrrFactors=[c.metallicFactor,c.roughnessFactor,0],e.emissiveBaseColor=c.emissiveFactor??[0,0,0],e.metallicRoughnessTexture=this._getTexture(c.metalTex,t,r,o),e.emissionTexture=this._getTexture(c.emissiveTex,t,r,o),e.occlusionTexture=this._getTexture(c.occlusionTex,t,r,o),e.normalTexture=this._getTexture(c.normalTex,t,r,o)),e.objectOpacity=0,e.alphaDiscardMode=2;const i=[];e.baseColorTexture&&i.push(e.baseColorTexture.loadPromise),e.usePBR&&e.metallicRoughnessTexture&&i.push(e.metallicRoughnessTexture.loadPromise),e.usePBR&&e.emissionTexture&&i.push(e.emissionTexture.loadPromise),e.usePBR&&e.occlusionTexture&&i.push(e.occlusionTexture.loadPromise),e.usePBR&&e.normalTexture&&i.push(e.normalTexture.loadPromise);const n=Promise.all(i);s.push(n),n.then(()=>{e.alphaDiscardMode=$[c.alphaMode],e.objectOpacity=1,o.textureMemoryUsage+=e.baseColorTexture?.glTexture?.usedMemory||0,e.usePBR&&(o.textureMemoryUsage+=e.metallicRoughnessTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.emissionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.occlusionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.normalTexture?.glTexture?.usedMemory||0)}),e.commonMaterialParameters.doubleSided=c.isDoubleSided,e.commonMaterialParameters.cullFace=c.faceCulling?J[c.faceCulling]:2,this._initialCullFace.set(L,e.commonMaterialParameters.cullFace),e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.componentParameters.castShadows=0,e.textureAlphaCutoff=c.alphaCutoff??fe,e.alphaDiscardMode=$[c.alphaMode],e.isIntegratedMesh=!0,e.polygonOffsetEnabled=!1,e.hasOccludees=!1,e.ellipsoidMode=ne(this.view.spatialReference)}),o.components.push(L),o.vboMemoryUsage+=this._collection.getObjectGPUMemoryUsage(L)}if(await Promise.all(s),r.forEach(e=>{o.textures.push(e)}),!this._memCache)throw new Error("no memCache");return this._memCache.put(`${o.handle}`,o),{memUsageBytes:o.usedMemory}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t&&(this.freeObject(t),this._lyrHandleToObjects.delete(e))}freeObject(e){this._memCache&&this._memCache.pop(`${e.handle}`),e.components.forEach(t=>{e.textures.forEach(e=>{this._stage.removeTexture(e)}),this._collection.destroyObject(t),this._initialCullFace.delete(t)})}setRenderableVisibility(e,t,i){if(this._memCache){for(let s=0;s<i;++s){const i=e[s],r=t[s];if(!r)continue;const o=this._lyrHandleToObjects.get(i);o&&(this._visibleGeometryChanged(),o.isVisible=r,o.components.forEach(e=>{this._collection.setObjectVisibility(e,r),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.pop(`${i}`))}for(let s=0;s<i;++s){const i=e[s],r=t[s];if(r)continue;const o=this._lyrHandleToObjects.get(i);o&&(this._visibleGeometryChanged(),o.isVisible=r,o.components.forEach(e=>{this._collection.setObjectVisibility(e,r),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.put(`${i}`,o))}}}_getTexture(e,t,i,s){let r=null;if(e&&t.desc?.images&&t.data?.buffer){const o=t.desc.images[e?.imageId];if(r=i.get(o),!r&&o){const n=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,a=!!o.mipCount||n>1,l=q[e.wrapMode??"None"];let c=o.alpha?4:3;const d=new Uint8Array(t.data.buffer,o.data.byteOffset,o.data.byteCount);let m=null,h=null,u=null;switch(o.format){case"Raw":"R8"===o.pixelFormat?(m=d,c=1,h=""):"Rgb8"===o.pixelFormat?(m=d,c=3,h=""):"Rgba8"===o.pixelFormat&&(m=d,c=4,h="");break;case"Dxt1":m=d,c=3,h="image/vnd-ms.dds";break;case"Dxt5":m=d,c=4,h="image/vnd-ms.dds";break;case"Basis":m=d,c=3,h="image/ktx2";break;case"Png":h="image/png",u=document.createElement("img");break;case"Jpeg":h="image/jpeg",u=document.createElement("img");break;case"Etc2":h="image/ktx",u=document.createElement("img");break;case"Astc":this._dbg(3,"Astc texture not supported");break;case"Pvrtc":this._dbg(3,"Pvrtc texture not supported")}if(u&&h){const e=new Blob([d],{type:h});u.src=URL.createObjectURL(e),m=u}if(m&&null!=h){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker,compressionCallback:e=>{e&&e>0&&(s.textureMemoryUsage-=e)}}:void 0;r=new ce(m,{mipmap:a,maxAnisotropy:n,encoding:h,wrap:l,components:c,compressionOptions:e,noUnpackFlip:!0,width:o.mip0Width,height:o.mip0Height}),this._stage.addTexture(r),i.set(o,r)}}}return r?new oe(this.view.stage.renderView.textures,r.id):null}getBufferViews(e,t,i){let s,r,o,n,a,l,c,d=null;for(let h=0;h<e.atrbs.length;h++){const c=e.atrbs[h],u=c.view,p=void 0,g=u.byteOffset+u.byteCount,f=u.byteCount/K[u.type],b=[...Array(f).keys()].map(e=>e);try{switch(c.sem){case"Position":3!==u.ncomp||"F32"!==u.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Position ("+u+")"):(s=new H(t,u.byteOffset,p,g),r=new ae(s.typedBuffer,b,3));break;case"Normal":if(3!==u.ncomp||"F32"!==u.type)this._dbg(3,"[Unsupported Feature] Unsupported view for Normal ("+u+")");else{const e=new H(t,u.byteOffset,p,g),s=le(e.typedBuffer,i);a=new S(s),l=new ae(a.typedBuffer,b,2)}break;case"TexCoord":2!==u.ncomp||"F32"!==u.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Texcoord ("+u+")"):void 0===n&&(n=new ae(new M(t,u.byteOffset,p,g).typedBuffer,b,2));break;case"Color":4===u.ncomp?("F32"===u.type&&(d=new U(t,u.byteOffset,p,g)),"U8"===u.type&&(d=new O(t,u.byteOffset,p,g)),"U16"===u.type&&(d=new P(t,u.byteOffset,p,g))):3===u.ncomp&&("F32"===u.type&&(d=new H(t,u.byteOffset,p,g)),"U8"===u.type&&(d=new R(t,u.byteOffset,p,g)),"U16"===u.type&&(d=new F(t,u.byteOffset,p,g))),null==d?this._dbg(2,"[Unsupported Feature] Unsupported view for Color ("+u+")"):o=new ae(d.typedBuffer,b,u.ncomp);break;case"FeatureIndex":break;default:this._dbg(2,"[Unsupported Feature] Unsupported semantic ("+c.sem+"). Skipping vertex attribute.")}}catch(m){this._dbg(2,"Error Creating buffer ("+m+"). Skipping vertex attribute.")}}if(e.index){const i=e.index.view,s=void 0,r=i.byteOffset+i.byteCount;switch(e.index.view.type){case"U16":c=new E(t,i.byteOffset,s,r);break;case"U32":c=new A(t,i.byteOffset,s,r);break;default:this._dbg(3,"[Unsupported Feature] index type not supported ("+i.type+").")}}if(null==c&&null!=s){const e=s.count;if(e<65535){const t=new Uint16Array(e);c=new E(t)}else{const t=new Uint32Array(e);c=new A(t)}for(let t=0;t<e;t++)c.set(t,t)}return{positionView:s,positionAttr:r,colorAttr:o,texCoord0Attr:n,indicesView:c,normalsView:a,normalsAttr:l}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>this._modifications=e.toArray(),s),"modifications")}_onRemoveFromCache(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,i){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(i):t.getLogger(this).warn(i))}};e([n({type:[k]})],_e.prototype,"_modifications",void 0),e([n()],_e.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([n()],_e.prototype,"layer",void 0),e([n({readOnly:!0})],_e.prototype,"visibleAtCurrentScale",null),e([n()],_e.prototype,"elevationOffset",null),_e=e([a("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],_e);const we=_e;export{we as default};
5
+ import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{initial as s,watch as r}from"../../../core/reactiveUtils.js";import{schedule as o}from"../../../core/scheduling.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as l,invert as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as d,IDENTITY as m}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{translate as h,getTranslation as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as p}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as g}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{f,o as b}from"../../../chunks/vec32.js";import{fromArray as y,create as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{SphericalECEFSpatialReferenceLike as v}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as x}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as C}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as j}from"../../../geometry/projection/projectVectorToVector.js";import{create as T}from"../../../geometry/support/aaBoundingRect.js";import{BufferViewVec2f as M,BufferViewVec4f as O,BufferViewVec4u8 as U,BufferViewVec4u16 as P,BufferViewVec3f as H,BufferViewVec3u8 as R,BufferViewVec3u16 as F,BufferViewInt16 as S,BufferViewUint32 as E,BufferViewUint16 as A}from"../../../geometry/support/buffer/BufferView.js";import k from"../../../layers/support/SceneModification.js";import{getElevationOffsetInMeters as V}from"../../../support/elevationInfoUtils.js";import{toWasmModification as I}from"./I3SMeshWorkerHandle.js";import{IntegratedMesh3DTilesViewPerformanceInfo as B}from"./IntegratedMesh3DTilesViewPerformanceInfo.js";import{LayerView3D as L}from"./LayerView3D.js";import{addLayerViewToWasm as D,removeLayerViewFromWasm as G,getLyr3DWasm as z}from"./Lyr3DWasm.js";import{LayerElevationProvider as N}from"./i3s/LayerElevationProvider.js";import{primTypeConversion as W,alphaModeConversion as $,faceCullingConversion as J,wrapModeConversion as q,lyr3DTypeToByteSize as K}from"./support/lyr3dTypeConversions.js";import{Tiles3DIntersectionHandler as Q}from"./support/Tiles3DIntersectionHandler.js";import{ElevationRange as X}from"../support/ElevationRange.js";import{toBoundingRect as Y}from"../support/extentUtils.js";import{Obb as Z,compute as ee}from"../support/orientedBoundingBox.js";import{ObjectParameters as te}from"../webgl-engine/collections/Component/ObjectParameters.js";import{GeometryParameters as ie,createVertexBufferLayout as se}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as re}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as oe}from"../webgl-engine/core/material/RenderTexture.js";import{getEllipsoidMode as ae}from"../webgl-engine/core/shaderLibrary/util/EllipsoidMode.js";import{Attribute as ne}from"../webgl-engine/lib/Attribute.js";import{compressAndTransformNormals as le}from"../webgl-engine/lib/Normals.js";import{Texture as ce}from"../webgl-engine/lib/Texture.js";import{writeAttribute as de,writeBufferVec2 as me}from"../webgl-engine/materials/internal/bufferWriterUtils.js";import he from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as ue,isInEffectiveScaleRange as pe}from"../../support/layerViewUtils.js";import{TextureCompressionTracker as ge}from"../../support/TextureCompressionTracker.js";import{alphaCutoff as fe}from"../../../webscene/support/AlphaCutoff.js";class be{constructor(){this.handle=0,this.isVisible=!1,this.components=[],this.textureMemoryUsage=0,this.vboMemoryUsage=0,this.cpuMemoryUsage=0,this.textures=[]}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get cachedMemory(){return this.usedMemory}}function ye(e){return Math.round(e/1048.576)/1e3}let _e=class extends(L(he)){constructor(){super(...arguments),this.type="integrated-mesh-3dtiles",this._compressionTracker=new ge,this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this.drapeTargetType=1,this._applySSAO=!has("disable-feature:im-ssao"),this._shadeNormals=!!has("enable-feature:im-shading"),this._lyrHandleToObjects=new Map,this._initialCullFace=new Map,this._suspendedHandle=null,this._dbgFlags=new Set}get hasModifications(){return this._modifications&&this._modifications.length>0}initialize(){if(this._dbgFlags.add(3),this._dbg(2,"Tiles3DLayerView3D initialize() called"),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),s),!this._canProjectWithoutEngine())throw ue("layer",this.layer.spatialReference.wkid,this.view.renderSpatialReference?.wkid);const e=D(this).then(e=>{this._wasmLayerId=e,this._intersectionHandler=new Q(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),s),this._updatingHandles.add(()=>this.fullOpacity,e=>this._opacityChange(e)),this._updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),s),this._elevationProvider=new N({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this.view.elevationProvider.register("im",this._elevationProvider),this.view.basemapTerrain.overlayManager.registerDrapeTarget(this);const t=this.view.resourceController.memoryController.newCache(`t3d-${this.uid}`,e=>this._onRemoveFromCache(e));this._memCache=t,this.addHandles([r(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e))]),this._suspendedHandle=r(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),s)});this.addResolvingPromise(e)}_opacityChange(e){this.objects.forEach(t=>{this._collection.getMaterial(t).objectOpacity=e})}destroy(){this._dbg(2,"Tiles3DLayerView3D destroy() called"),G(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null),this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null),this._elevationProvider&&(this._elevationProvider.objectsChanged(this._obbs),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this.view.basemapTerrain.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._initialCullFace.clear(),this._memCache=i(this._memCache),this._updatingHandles=i(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null)}_modificationsChanged(){const e=this.layer.spatialReference,t=I(this._layerClippingArea,this._modifications,e);this._wasm?.setMeshModifications(this,t,e.wkid)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=T();this._layerClippingArea=Y(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=o(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),this.objects.forEach(t=>{const i=this._collection.getMaterial(t);i.commonMaterialParameters.hasSlicePlane=e,i.commonMaterialParameters.cullFace=e?0:this._initialCullFace.get(t)})}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,V(e))}get _obbs(){return this.objects.map(e=>this._collection.getComponentObb(e))}get _wasm(){return z(this.view)}get wasmLayerId(){return this._wasmLayerId}get usedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible&&(e+=t.usedMemory)}),e}get unloadedMemory(){return 0}get cachedMemory(){let e=0;return this._lyrHandleToObjects.forEach(t=>{t.isVisible||(e+=t.usedMemory)}),e}get visibleAtCurrentScale(){return pe(this.layer.effectiveScaleRange,this.view.scale)}get performanceInfo(){let e=0,t=0,i=0,s=0,r=0,o=0;return this._lyrHandleToObjects.forEach(a=>{a.isVisible?(e+=a.textureMemoryUsage,t+=a.vboMemoryUsage,r++):(i+=a.textureMemoryUsage,s+=a.vboMemoryUsage,o++)}),new B(this.usedMemory,r,o,ye(t),ye(e),ye(s),ye(i))}_canProjectWithoutEngine(){if(2===this.view.state.viewingMode){const e=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1;if(3857!==e&&32662!==e)return!1}return!0}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationOffset(){return V(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new X(e.zmin,e.zmax):null}getElevationRange(e){return null}get fullExtent(){return this.layer.fullExtent}get objects(){return Array.from(this._lyrHandleToObjects.values()).reduce((e,t)=>e.concat(t.components),new Array)}isUpdating(){const e=this._wasm;return!(this._wasmLayerId<0||null==e)&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){const t=e.meshData;if(null==t.data)throw new Error("meshData.data undefined");if(t.desc=JSON.parse(t.desc),null==t.desc)throw new Error("meshData.desc undefined");const i=y(t.desc.origin),s=new Array,r=new Map,o=new be;o.handle=e.handle,this._lyrHandleToObjects.set(e.handle,o);const a=this.view.basemapTerrain.spatialReference;let n,T;if("global"===this.view.viewingMode){const e=p();x(v,i,e,a),n=l(d(),e),T=c(d(),n)}else n=m,T=m;const O=p();h(O,O,i);const U=u(_(),O);let P=null;const H=_();if(t.desc.obb){const e=t.desc.obb.quaternion;P=new Z(t.desc.obb.center,t.desc.obb.halfSize,g(e[0],e[1],e[2],e[3]))}for(let l=0;l<t.desc.prims.length;l++){const e=t.desc.prims[l];this._dbg(2,JSON.stringify(e));if(null==W[e.ptype]||null==t.data){this._dbg(2,"[Unsupported Feature] Unsupported primitive mode ("+e.ptype+"). Skipping primitive.");continue}const c=t.desc?.materials&&null!=e.materialId?t.desc.materials[e.materialId]:null,d=null!=c?c.lightingModel:"Unlit",{positionView:h,positionAttr:u,normalsView:p,normalsAttr:g,colorAttr:y,texCoord0Attr:v,indicesView:x}=this.getBufferViews(e,t.data.buffer,n);if(null==u||null==h||null==x)continue;const O=new ie(null!=y,v?1:0,null!=p,this._shadeNormals,this._applySSAO),R=u.data.length/u.size,F=(e,t)=>!e||e.data.length/e.size===R||(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1);if(!F(v,"numTexcoord")||!F(y,"numColors")||!F(g,"normals"))continue;const S=se(O);if(null!=P?P=P.clone():(P=ee(u),f(H,P.center,i),P.center=H),n!==m)for(let t=0;t<h.count;t++)h.getVec(t,H),b(H,H,n),h.setVec(t,H);const E=S.createBuffer(u.data.length);if(de("position",u,null,null,E,0),null!=v){const e=E.getField("uv0",M);me(v,e,0)}null!=y&&de("color",u,null,null,E,0),null!=g&&de("normalCompressed",g,null,null,E,0);const A=new Uint32Array([0,x.typedBuffer.length]),k={vertices:{data:E.buffer,count:E.byteLength/S.stride,layoutParameters:O},positionData:{positions:h.typedBuffer,indices:x.typedBuffer},indices:x.typedBuffer,componentOffsets:A};o.cpuMemoryUsage+=h.count,o.cpuMemoryUsage+=x.count;const V=this.view.renderSpatialReference,I=_(),B=[1,1,1];C(U,V,B,a)||this._dbg(3,"Unsupported coordinate system for IM overlay"),j(U,V,I,a);const L=this._collection.createObject(new te(w(I[0],I[1],B[0],B[1]),new re(U,T),P,k));c&&this._collection.updateMaterial(L,e=>{e.baseColor=c.baseColorFactor,e.usePBR="Pbr"===d,e.hasParametersFromSource=!1,e.baseColorTexture=this._getTexture(c.baseColorTex,t,r,o),e.usePBR&&(e.mrrFactors=[c.metallicFactor,c.roughnessFactor,0],e.emissiveBaseColor=c.emissiveFactor??[0,0,0],e.metallicRoughnessTexture=this._getTexture(c.metalTex,t,r,o),e.emissionTexture=this._getTexture(c.emissiveTex,t,r,o),e.occlusionTexture=this._getTexture(c.occlusionTex,t,r,o),e.normalTexture=this._getTexture(c.normalTex,t,r,o)),e.objectOpacity=0,e.alphaDiscardMode=2;const i=[];e.baseColorTexture&&i.push(e.baseColorTexture.loadPromise),e.usePBR&&e.metallicRoughnessTexture&&i.push(e.metallicRoughnessTexture.loadPromise),e.usePBR&&e.emissionTexture&&i.push(e.emissionTexture.loadPromise),e.usePBR&&e.occlusionTexture&&i.push(e.occlusionTexture.loadPromise),e.usePBR&&e.normalTexture&&i.push(e.normalTexture.loadPromise);const a=Promise.all(i);s.push(a),a.then(()=>{e.alphaDiscardMode=$[c.alphaMode],e.objectOpacity=this.fullOpacity,o.textureMemoryUsage+=e.baseColorTexture?.glTexture?.usedMemory||0,e.usePBR&&(o.textureMemoryUsage+=e.metallicRoughnessTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.emissionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.occlusionTexture?.glTexture?.usedMemory||0,o.textureMemoryUsage+=e.normalTexture?.glTexture?.usedMemory||0)}),e.commonMaterialParameters.doubleSided=c.isDoubleSided,e.commonMaterialParameters.cullFace=c.faceCulling?J[c.faceCulling]:2,this._initialCullFace.set(L,e.commonMaterialParameters.cullFace),e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.componentParameters.castShadows=0,e.textureAlphaCutoff=c.alphaCutoff??fe,e.alphaDiscardMode=$[c.alphaMode],e.isIntegratedMesh=!0,e.polygonOffsetEnabled=!1,e.hasOccludees=!1,e.ellipsoidMode=ae(this.view.spatialReference)}),o.components.push(L),o.vboMemoryUsage+=this._collection.getObjectGPUMemoryUsage(L)}if(await Promise.all(s),r.forEach(e=>{o.textures.push(e)}),!this._memCache)throw new Error("no memCache");return this._memCache.put(`${o.handle}`,o),{memUsageBytes:o.usedMemory}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t&&(this.freeObject(t),this._lyrHandleToObjects.delete(e))}freeObject(e){this._memCache&&this._memCache.pop(`${e.handle}`),e.components.forEach(t=>{e.textures.forEach(e=>{this._stage.removeTexture(e)}),this._collection.destroyObject(t),this._initialCullFace.delete(t)})}setRenderableVisibility(e,t,i){if(this._memCache){for(let s=0;s<i;++s){const i=e[s],r=t[s];if(!r)continue;const o=this._lyrHandleToObjects.get(i);o&&(this._visibleGeometryChanged(),o.isVisible=r,o.components.forEach(e=>{this._collection.setObjectVisibility(e,r),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.pop(`${i}`))}for(let s=0;s<i;++s){const i=e[s],r=t[s];if(r)continue;const o=this._lyrHandleToObjects.get(i);o&&(this._visibleGeometryChanged(),o.isVisible=r,o.components.forEach(e=>{this._collection.setObjectVisibility(e,r),this._elevationProvider.objectChanged(this._collection.getComponentObb(e))}),this._memCache.put(`${i}`,o))}}}_getTexture(e,t,i,s){let r=null;if(e&&t.desc?.images&&t.data?.buffer){const o=t.desc.images[e?.imageId];if(r=i.get(o),!r&&o){const a=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,n=!!o.mipCount||a>1,l=q[e.wrapMode??"None"];let c=o.alpha?4:3;const d=new Uint8Array(t.data.buffer,o.data.byteOffset,o.data.byteCount);let m=null,h=null,u=null;switch(o.format){case"Raw":"R8"===o.pixelFormat?(m=d,c=1,h=""):"Rgb8"===o.pixelFormat?(m=d,c=3,h=""):"Rgba8"===o.pixelFormat&&(m=d,c=4,h="");break;case"Dxt1":m=d,c=3,h="image/vnd-ms.dds";break;case"Dxt5":m=d,c=4,h="image/vnd-ms.dds";break;case"Basis":m=d,c=3,h="image/ktx2";break;case"Png":h="image/png",u=document.createElement("img");break;case"Jpeg":h="image/jpeg",u=document.createElement("img");break;case"Etc2":h="image/ktx",u=document.createElement("img");break;case"Astc":this._dbg(3,"Astc texture not supported");break;case"Pvrtc":this._dbg(3,"Pvrtc texture not supported")}if(u&&h){const e=new Blob([d],{type:h});u.src=URL.createObjectURL(e),m=u}if(m&&null!=h){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker,compressionCallback:e=>{e&&e>0&&(s.textureMemoryUsage-=e)}}:void 0;r=new ce(m,{mipmap:n,maxAnisotropy:a,encoding:h,wrap:l,components:c,compressionOptions:e,noUnpackFlip:!0,width:o.mip0Width,height:o.mip0Height}),this._stage.addTexture(r),i.set(o,r)}}}return r?new oe(this.view.stage.renderView.textures,r.id):null}getBufferViews(e,t,i){let s,r,o,a,n,l,c,d=null;for(let h=0;h<e.atrbs.length;h++){const c=e.atrbs[h],u=c.view,p=void 0,g=u.byteOffset+u.byteCount,f=u.byteCount/K[u.type],b=[...Array(f).keys()].map(e=>e);try{switch(c.sem){case"Position":3!==u.ncomp||"F32"!==u.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Position ("+u+")"):(s=new H(t,u.byteOffset,p,g),r=new ne(s.typedBuffer,b,3));break;case"Normal":if(3!==u.ncomp||"F32"!==u.type)this._dbg(3,"[Unsupported Feature] Unsupported view for Normal ("+u+")");else{const e=new H(t,u.byteOffset,p,g),s=le(e.typedBuffer,i);n=new S(s),l=new ne(n.typedBuffer,b,2)}break;case"TexCoord":2!==u.ncomp||"F32"!==u.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Texcoord ("+u+")"):void 0===a&&(a=new ne(new M(t,u.byteOffset,p,g).typedBuffer,b,2));break;case"Color":4===u.ncomp?("F32"===u.type&&(d=new O(t,u.byteOffset,p,g)),"U8"===u.type&&(d=new U(t,u.byteOffset,p,g)),"U16"===u.type&&(d=new P(t,u.byteOffset,p,g))):3===u.ncomp&&("F32"===u.type&&(d=new H(t,u.byteOffset,p,g)),"U8"===u.type&&(d=new R(t,u.byteOffset,p,g)),"U16"===u.type&&(d=new F(t,u.byteOffset,p,g))),null==d?this._dbg(2,"[Unsupported Feature] Unsupported view for Color ("+u+")"):o=new ne(d.typedBuffer,b,u.ncomp);break;case"FeatureIndex":break;default:this._dbg(2,"[Unsupported Feature] Unsupported semantic ("+c.sem+"). Skipping vertex attribute.")}}catch(m){this._dbg(2,"Error Creating buffer ("+m+"). Skipping vertex attribute.")}}if(e.index){const i=e.index.view,s=void 0,r=i.byteOffset+i.byteCount;switch(e.index.view.type){case"U16":c=new A(t,i.byteOffset,s,r);break;case"U32":c=new E(t,i.byteOffset,s,r);break;default:this._dbg(3,"[Unsupported Feature] index type not supported ("+i.type+").")}}if(null==c&&null!=s){const e=s.count;if(e<65535){const t=new Uint16Array(e);c=new A(t)}else{const t=new Uint32Array(e);c=new E(t)}for(let t=0;t<e;t++)c.set(t,t)}return{positionView:s,positionAttr:r,colorAttr:o,texCoord0Attr:a,indicesView:c,normalsView:n,normalsAttr:l}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>this._modifications=e.toArray(),s),"modifications")}_onRemoveFromCache(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,i){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(i):t.getLogger(this).warn(i))}};e([a({type:[k]})],_e.prototype,"_modifications",void 0),e([a()],_e.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([a()],_e.prototype,"layer",void 0),e([a({readOnly:!0})],_e.prototype,"visibleAtCurrentScale",null),e([a()],_e.prototype,"elevationOffset",null),_e=e([n("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],_e);const we=_e;export{we as default};