@arcgis/core 5.0.0-next.31 → 5.0.0-next.32

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 (101) hide show
  1. package/applications/SceneViewer/sceneViewerUtils.d.ts +3 -0
  2. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/1dd867fa7c58c06b79ea.js +1 -0
  5. package/assets/esri/core/workers/chunks/22d66d1c8dfccdbbcf30.js +1 -0
  6. package/assets/esri/core/workers/chunks/27bd88e1101873d4ce12.js +1 -0
  7. package/assets/esri/core/workers/chunks/{5f2cf73fb2944f82661d.js → 433d249c35c56bf15806.js} +34 -34
  8. package/assets/esri/core/workers/chunks/{b2fbb44e219232e61cbd.js → 794960ec36e11f4416c2.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{0bfb7db0a151a5e85dd1.js → 8ad6595ad44c2d60c1ce.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{11bb437437272d8f3e2c.js → 9252854b512237b6a0ef.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{e615983fab688d515205.js → 944dfa9309da8f49a616.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{f2f4e34247882eceb50d.js → a2cee5ac0d4df0108425.js} +3 -3
  13. package/assets/esri/core/workers/chunks/a4b7ba8aec109beb5b4d.js +1 -0
  14. package/assets/esri/core/workers/chunks/da517b4b07d4d27ce94c.js +1 -0
  15. package/assets/esri/core/workers/chunks/defc6b50df5018bd9e86.js +1 -0
  16. package/assets/esri/core/workers/chunks/ed1dabed10ff9f4e0369.js +1 -0
  17. package/assets/esri/core/workers/chunks/{14dc21fe66c7b98fb456.js → f3127bdf28a1d9b8db27.js} +1 -1
  18. package/assets/esri/core/workers/chunks/fee942ef802a162e0248.js +1 -0
  19. package/assets/esri/themes/base/widgets/_Attribution.scss +8 -0
  20. package/assets/esri/themes/dark/main.css +1 -1
  21. package/assets/esri/themes/light/main.css +1 -1
  22. package/assets/esri/themes/light/view.css +1 -1
  23. package/chunks/BlendLayers.glsl.js +1 -1
  24. package/config.js +1 -1
  25. package/core/deprecate.js +1 -1
  26. package/core/keyboard.js +5 -0
  27. package/interfaces.d.ts +55 -3
  28. package/kernel.js +1 -1
  29. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  30. package/package.json +1 -1
  31. package/support/revision.js +1 -1
  32. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  33. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  34. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  35. package/views/3d/support/Attribution3D.js +5 -0
  36. package/views/3d/terrain/TileBlendTechniqueConfiguration.js +1 -1
  37. package/views/3d/terrain/TileCompositor.js +1 -1
  38. package/views/3d/terrain/TileRenderer.js +1 -1
  39. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  40. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  41. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  42. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  43. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  44. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +6 -6
  45. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +4 -4
  46. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  47. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  48. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  49. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  50. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  51. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  52. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  53. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  54. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  55. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  56. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  57. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  58. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  59. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  60. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  61. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +4 -4
  62. package/views/Attribution.js +5 -0
  63. package/views/DOMContainer.js +1 -1
  64. package/views/SceneView.js +1 -1
  65. package/views/View.js +1 -1
  66. package/views/draw/support/managers/DrawTooltipManager.js +5 -0
  67. package/views/interactive/tooltip/content/TooltipContentDynamic.js +5 -0
  68. package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
  69. package/views/interactive/tooltip/fields/TooltipField.js +1 -1
  70. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +5 -0
  71. package/views/layers/LayerView.js +1 -1
  72. package/views/support/AttributionItem.d.ts +4 -0
  73. package/views/support/AttributionItem.js +5 -0
  74. package/views/support/LayerViewManager.js +1 -1
  75. package/views/support/attributionUtils.js +5 -0
  76. package/views/support/geodesicAreaMeasurementUtils.js +1 -1
  77. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  78. package/views/ui/2d/DefaultUI2D.js +1 -1
  79. package/views/ui/3d/DefaultUI3D.js +1 -1
  80. package/widgets/Attribution/AttributionViewModel.js +1 -1
  81. package/widgets/Attribution.js +1 -1
  82. package/widgets/ElevationProfile/ElevationProfileLine.js +1 -1
  83. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  84. package/widgets/ElevationProfile.js +1 -1
  85. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  86. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  87. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  88. package/widgets/Widget.js +1 -1
  89. package/widgets/support/decorators/accessibleHandler.js +1 -1
  90. package/widgets/support/jsxWidgetSupport.js +1 -1
  91. package/widgets/support/widget.js +1 -1
  92. package/widgets/support/widgetUtils.js +1 -1
  93. package/assets/esri/core/workers/chunks/25143b919e75d5d2da05.js +0 -1
  94. package/assets/esri/core/workers/chunks/2d17ed5321ca05acb8e3.js +0 -1
  95. package/assets/esri/core/workers/chunks/447b53a9280b2b19b7a6.js +0 -1
  96. package/assets/esri/core/workers/chunks/6ce7ca6bebdc61d8eada.js +0 -1
  97. package/assets/esri/core/workers/chunks/8fbda0b85731ac77e1d8.js +0 -1
  98. package/assets/esri/core/workers/chunks/98c32d10a2344cd7a50b.js +0 -1
  99. package/assets/esri/core/workers/chunks/d5b464ff83ce29b51968.js +0 -1
  100. package/assets/esri/core/workers/chunks/d777d7cb8df3f21ac97e.js +0 -1
  101. package/layers/support/attributionUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{BackgroundGrid as e}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/BackgroundGrid.glsl.js";import{TileBackground as r}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js";import{TileComposite as o}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js";import{Float3PassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as s}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{ShaderBuilder as a}from"../views/webgl/ShaderBuilder.js";function l(l){const t=new a,g=t.fragment;if(t.include(o),1===l.background){const r=2===l.output;return r?g.uniforms.add(new i("backgroundColor",e=>e.backgroundColor)):g.include(e),g.main.add(s`fragColor = vec4(${r?s`backgroundColor`:s`gridColor(uv)`}, 1.0);`),t}return t.include(r,l),g.uniforms.add(new d("tex",e=>e.texture),new n("opacity",e=>e.opacity)),g.main.add(s`fragColor = blendLayers(uv, texture(tex, uv), opacity);`),t}const t=Object.freeze(Object.defineProperty({__proto__:null,build:l},Symbol.toStringTag,{value:"Module"}));export{t as B,l as b};
5
+ import{BackgroundGrid as e}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/BackgroundGrid.glsl.js";import{TileBackground as r}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js";import{TileComposite as o}from"../views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js";import{Float3PassUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as n}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as s}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Texture2DPassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{ShaderBuilder as a}from"../views/webgl/ShaderBuilder.js";function l(l){const t=new a,g=t.fragment;if(t.include(o),1===l.background){const r=2===l.output;return r?g.uniforms.add(new i("backgroundColor",e=>e.backgroundColor)):g.include(e),g.main.add(s`fragColor = vec4(${r?s`backgroundColor`:s`gridColor(uv)`}, 1.0);`),t}return t.include(r,l),g.uniforms.add(new d("tex",e=>e.texture),new n("opacity",e=>e.opacity)).main.add(s`fragColor = blendLayers(uv, texture(tex, uv), opacity);`),t}const t=Object.freeze(Object.defineProperty({__proto__:null,build:l},Symbol.toStringTag,{value:"Module"}));export{t as B,l as b};
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.31";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.32";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
package/core/deprecate.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"./has.js";const e=new WeakMap;function n(n,t,r=!1){const o=`🛑 DEPRECATED - ${t}`;if(!r)return void n.warn(o);let i=e.get(n);i||(i=new Set,e.set(n,i)),i.has(t)||(i.add(t),n.warn(o))}const t="https://www.esriurl.com/";function r(e,n,r,o={}){has("esri-deprecation-warnings")&&m(e,`This widget is deprecated. Use the ${n} component instead.`,{see:[`${n} component reference: ${t}${r}/`,`Esri's move to web components: ${t}components-transition-plan/`],replacement:`<${r}></${r}>`,warnOnce:!0,...o})}function o(e,n,r,o={}){has("esri-deprecation-warnings")&&m(e,`This view model is deprecated. Use the ${n} component directly instead.`,{see:[`${n} component reference: ${t}${r}/`,`Esri's move to web components: ${t}components-transition-plan/`],replacement:`<${r}></${r}>`,warnOnce:!0,...o})}function i(e,n,t={}){has("esri-deprecation-warnings")&&m(e,`Module: ${n}`,t)}function s(e,n,t={}){if(has("esri-deprecation-warnings")){const{moduleName:r}=t;m(e,`Function: ${(r?r+"::":"")+n+"()"}`,t)}}function c(e,n,t={}){if(has("esri-deprecation-warnings")){const{moduleName:r}=t;m(e,`Property: ${(r?r+"::":"")+n}`,t)}}function a(e,n,t,r={}){if(has("esri-deprecation-warnings")){const{moduleName:o}=r;m(e,`'${(o?o+"::":"")+n}' value: ${t}`,r)}}function p(e,n,t={}){has("esri-deprecation-warnings")&&m(e,`Multiple argument constructor: ${n}`,{warnOnce:!0,replacement:`new ${n}({ <your properties here> })`,...t})}function m(e,t,r={}){if(has("esri-deprecation-warnings")){const{replacement:o,version:i,see:s,warnOnce:c}=r;let a=t;if(o&&(a+=`\n\t🛠️ Replacement: ${o}`),i&&(a+=`\n\t⚙️ Version: ${i}`),s)if(Array.isArray(s)){a+="\n\t🔗 See for more details:";for(const e of s)a+=`\n\t\t${e}`}else a+=`\n\t🔗 See ${s} for more details.`;n(e,a,c)}}export{o as deprecateUnnecessaryViewModel,r as deprecateWidget,m as deprecated,p as deprecatedConstructorSignature,s as deprecatedFunction,i as deprecatedModule,c as deprecatedProperty,a as deprecatedPropertyValue};
5
+ import has from"./has.js";const e=new WeakMap;function n(n,t,r=!1){const o=`🛑 DEPRECATED - ${t}`;if(!r)return void n.warn(o);let i=e.get(n);i||(i=new Set,e.set(n,i)),i.has(t)||(i.add(t),n.warn(o))}const t="https://www.esriurl.com/";function r(e,n,r,o={}){has("esri-deprecation-warnings")&&m(e,`This widget is deprecated. Use the ${n} component instead.`,{see:[`${n} component reference: ${t}${r}/`,`Esri's move to web components: ${t}components-transition-plan/`],replacement:`<${r}></${r}>`,warnOnce:!0,...o})}function o(e,n,r,o={}){has("esri-deprecation-warnings")&&m(e,`This view model is deprecated. Use the ${n} component directly instead.`,{see:[`${n} component reference: ${t}${r}/`,`Esri's move to web components: ${t}components-transition-plan/`],replacement:`<${r}></${r}>`,warnOnce:!0,...o})}function i(e,n,t={}){has("esri-deprecation-warnings")&&m(e,`Module: ${n}`,t)}function s(e,n,t={}){if(has("esri-deprecation-warnings")){const{moduleName:r}=t;m(e,`Function: ${(r?r+"::":"")+n+"()"}`,t)}}function c(e,n,t={}){if(has("esri-deprecation-warnings")){const{moduleName:r}=t;m(e,`Property: ${(r?r+"::":"")+n}`,t)}}function a(e,n,t,r={}){if(has("esri-deprecation-warnings")){const{moduleName:o}=r;m(e,`'${(o?o+"::":"")+n}' value: ${t}`,r)}}function p(e,n,t={}){has("esri-deprecation-warnings")&&m(e,`Multiple argument constructor: ${n}`,{warnOnce:!0,replacement:`new ${n}({ <your properties here> })`,...t})}function m(e,t,r={}){if(has("esri-deprecation-warnings")){const{replacement:o,version:i,see:s,warnOnce:c}=r;let a=t;if(o&&(a+=`\n\t🛠️ Replacement: ${o}`),i&&(a+=`\n\t⚙️ Version: ${i}`),s)if(Array.isArray(s)){a+="\n\t🔗 See for more details:";for(const e of s)a+=`\n\t\t${e}`}else a+=`\n\t🔗 See ${s} for more details.`;n(e,a,c)}}export{o as deprecateUnnecessaryViewModel,r as deprecateWidget,m as deprecated,p as deprecatedConstructorSignature,s as deprecatedFunction,i as deprecatedModule,c as deprecatedProperty,a as deprecatedPropertyValue,t as esriurl};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ function n(n){return"Enter"===n||" "===n}export{n as isActivationKey};
package/interfaces.d.ts CHANGED
@@ -3984,6 +3984,12 @@ declare namespace __esri {
3984
3984
  * @param expectedTileSize the expected tile size.
3985
3985
  */
3986
3986
  getCompatibleTileInfoForVTL(tileInfo: TileInfo, expectedTileSize: number): any | nullish;
3987
+ /**
3988
+ * Note: reserved for internal use only, this is not part of the stable public API.
3989
+ *
3990
+ * Helper function to get the widgets rendered with JSX.
3991
+ */
3992
+ getJsxWidgetMap(): globalThis.Map<HTMLElement, any>;
3987
3993
  /**
3988
3994
  * Note: reserved for internal use only, this is not part of the stable public API.
3989
3995
  *
@@ -3992,6 +3998,12 @@ declare namespace __esri {
3992
3998
  * @param graphic
3993
3999
  */
3994
4000
  getSourceLayerFromBuildingComponentSublayerGraphic(graphic: Graphic): BuildingComponentSublayer | nullish;
4001
+ /**
4002
+ * Note: reserved for internal use only, this is not part of the stable public API.
4003
+ *
4004
+ * Helper function to get the symbol to access the projector on the JSX widget.
4005
+ */
4006
+ getWidgetTestDataSymbol(): any;
3995
4007
  /**
3996
4008
  * Note: reserved for internal use only, this is not part of the stable public API.
3997
4009
  *
@@ -4025,6 +4037,14 @@ declare namespace __esri {
4025
4037
  * @param tileInfo tileInfo to check
4026
4038
  */
4027
4039
  isSupportedTileInfo(tileInfo: TileInfo): boolean;
4040
+ /**
4041
+ * Note: reserved for internal use only, this is not part of the stable public API.
4042
+ *
4043
+ * Helper function to remove the html element (container) from a widget.
4044
+ *
4045
+ * @param widget
4046
+ */
4047
+ removeWidgetContainer(widget: any): void;
4028
4048
  /**
4029
4049
  * Note: reserved for internal use only, this is not part of the stable public API.
4030
4050
  *
@@ -105462,6 +105482,18 @@ declare namespace __esri {
105462
105482
  distance: number;
105463
105483
  }
105464
105484
 
105485
+ /**
105486
+ * Represents an attribution item for a specific layer in the view.
105487
+ *
105488
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-support-AttributionItem.html Read more...}
105489
+ */
105490
+ interface AttributionItem {
105491
+ readonly score: number;
105492
+ readonly text: string;
105493
+ }
105494
+
105495
+ export const AttributionItem: AttributionItem;
105496
+
105465
105497
  /**
105466
105498
  * Contains utilities for working with colors in the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html View}.
105467
105499
  *
@@ -105617,7 +105649,7 @@ declare namespace __esri {
105617
105649
 
105618
105650
  export class Theme extends Accessor {
105619
105651
  /**
105620
- * This class is used by the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html View} to define the base colors used by widgets and components
105652
+ * This class is used by the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html View} to define the base colors used by analyses and widgets
105621
105653
  * to render temporary graphics and labels.
105622
105654
  *
105623
105655
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-Theme.html Read more...}
@@ -106127,6 +106159,20 @@ declare namespace __esri {
106127
106159
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#animationsEnabled Read more...}
106128
106160
  */
106129
106161
  animationsEnabled: boolean;
106162
+ /**
106163
+ * The array of attribution items to be displayed in the view's attribution.
106164
+ *
106165
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#attributionItems Read more...}
106166
+ */
106167
+ readonly attributionItems: ReadonlyArray<AttributionItem>;
106168
+ /**
106169
+ * Indicates whether the attribution is visible in the view.
106170
+ *
106171
+ * @default true
106172
+ *
106173
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#attributionVisible Read more...}
106174
+ */
106175
+ attributionVisible: boolean;
106130
106176
  /**
106131
106177
  * Represents the view for a single basemap after it has been added to the map.
106132
106178
  *
@@ -106576,6 +106622,12 @@ declare namespace __esri {
106576
106622
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#animationsEnabled Read more...}
106577
106623
  */
106578
106624
  animationsEnabled?: boolean;
106625
+ /**
106626
+ * Indicates whether the attribution is visible in the view.
106627
+ *
106628
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#attributionVisible Read more...}
106629
+ */
106630
+ attributionVisible?: boolean;
106579
106631
  /**
106580
106632
  * Represents the view for a single basemap after it has been added to the map.
106581
106633
  *
@@ -112518,7 +112570,7 @@ declare namespace __esri {
112518
112570
  *
112519
112571
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#items Read more...}
112520
112572
  */
112521
- readonly items: Collection<AttributionItem>;
112573
+ readonly items: Collection<AttributionViewModelAttributionItem>;
112522
112574
  /**
112523
112575
  * The view model's state.
112524
112576
  *
@@ -112555,7 +112607,7 @@ declare namespace __esri {
112555
112607
  *
112556
112608
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Attribution-AttributionViewModel.html#AttributionItem Read more...}
112557
112609
  */
112558
- export interface AttributionItem {
112610
+ export interface AttributionViewModelAttributionItem {
112559
112611
  text: string;
112560
112612
  layerView: LayerView;
112561
112613
  }
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.31",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.32",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Error.js";import has from"../core/has.js";import o from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as a,sync as n}from"../core/reactiveUtils.js";import{property as l,subclass as p}from"../core/accessorSupport/decorators.js";import{persistable as m}from"../core/accessorSupport/decorators/persistable.js";import d from"../geometry/Extent.js";import u from"../geometry/SpatialReference.js";import c from"./Layer.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISService as f}from"./mixins/ArcGISService.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as j,url as T}from"./support/commonProperties.js";import v from"./support/SceneModifications.js";import{initFullExtent as w}from"./support/tiles3DUtils.js";import b from"../portal/Portal.js";import{logInvalidElevationInfoWarning as x,elevationModeRequiredMessage as L,featureExpressionUnsupportedMessage as P}from"../support/elevationInfoUtils.js";import{f as I}from"../chunks/persistableUrlUtils.js";import{isBasemap as k}from"../support/userTypeGuards/isBasemap.js";import{reader as R}from"../core/accessorSupport/decorators/reader.js";let U=class extends(f(g(_(S(i(y(h(c)))))))){readModifications(e,t,r){this._modificationsSource={url:I(e,r),context:r}}initialize(){this.addHandles(a(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,n))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new u({wkid:4326,vcsWkid:115700}),this.fullExtent=new d(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this._rootTilesetJSON=null,this._rootTileset=null,this._key=null,this._session=null,this._rootRequestPromise=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}get rootTilesetJSON(){return this._rootTilesetJSON}get rootTileset(){return this._rootTileset}get key(){return this._key}get session(){return this._session}_findSessionParameter(e){const t=[e];for(;t?.length>0;){const e=t.pop();if(!e)return;for(const[o,i]of Object.entries(e)){if("uri"===o)try{const e=new URL("https://tmp"+i).searchParams.get("session");if(e)return e}catch(r){}"object"==typeof i&&null!==i&&t.push(i)}}return null}async requestRootAndSession(e){const i=(e,t)=>new r("3dtiles-init:"+e,t);return this._rootRequestPromise||(this._rootRequestPromise=new Promise((r,a)=>{this.url||a(i("url-missing","Layer url missing")),this._key=this.customParameters?this.customParameters.key:null;new Promise((e,r)=>{if(this.replacesTerrain&&!this._key){const o=this.portalItem?.portal||this.parent?.portalItem?.portal||b.getDefault();o.signIn().then(()=>{o.g3dTilesEnabled?t(o.restUrl+"/portals/self/modules/g3dtiles",{responseType:"json",query:{f:"json"}}).then(t=>{this._key=t.data.keyString,e()},()=>r(i("g3dtiles-key-error","Error fetching Google 3D Tiles key from portal"))):r(i("g3dTilesEnabled-false","Google 3D Tiles are not enabled on Portal "+o.url))},()=>r(i("sign-in-failed","Error signing in to Portal")))}else e()}).then(()=>{t(this.url,{query:this._key?{key:this._key,token:this.apiKey}:{token:this.apiKey},responseType:"array-buffer",signal:e}).then(e=>{try{this._rootTilesetJSON=JSON.parse((new TextDecoder).decode(e.data))}catch(t){return void a(i("root-parse-failed","Error parsing root tile, details: "+t))}this._rootTilesetJSON?(this._session=this._findSessionParameter(this._rootTilesetJSON),this._rootTileset=e.data,this.fullExtent=w(this._rootTilesetJSON),r(),this._rootRequestPromise=null):a(i("root-is-null","Root tile is null."))},e=>{s(e),a(i("root-load-failed","Error loading root tile")),this._rootRequestPromise=null,o.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})},e=>a(e))})),this._rootRequestPromise}async _doLoad(e){const t=null!=e?e.signal:null;if(this._isUsedAsGroundLayer&&!has("enable-feature:basemap-groundlayers"))throw new r("3dtiles-init:not-supported-in-groundlayers","Layer is not supported in basemap.");try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new r("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(o){s(o)}if(null!=this._modificationsSource){const t=await v.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this.requestRootAndSession(t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}get hasAttributionData(){return!1}async fetchAttributionData(){return{}}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";x(o.getLogger(this),L(t,"absolute-height",e)),x(o.getLogger(this),P(t,e))}get replacesTerrain(){return!!has("enable-feature:basemap-groundlayers")&&this.hasGoogleUrl&&this._isUsedAsGroundLayer}get _isUsedAsGroundLayer(){return k(this.parent)}get hasGoogleUrl(){return!!this.url?.match(/.+\.googleapis.com/)}};e([l({type:["IntegratedMesh3DTilesLayer"]})],U.prototype,"operationalLayerType",void 0),e([l({type:v,clonable:e=>e.clone()}),m({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],U.prototype,"modifications",void 0),e([R(["web-scene","portal-item"],"modifications")],U.prototype,"readModifications",null),e([l({type:u})],U.prototype,"spatialReference",void 0),e([l({type:d})],U.prototype,"fullExtent",void 0),e([l(j)],U.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],U.prototype,"listMode",void 0),e([l(T)],U.prototype,"url",void 0),e([l({readOnly:!0})],U.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],U.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],U.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],U.prototype,"maxScale",void 0),e([l()],U.prototype,"replacesTerrain",null),e([l()],U.prototype,"_isUsedAsGroundLayer",null),e([l()],U.prototype,"hasGoogleUrl",null),U=e([p("esri.layers.IntegratedMesh3DTilesLayer")],U);const D=U;export{D as default};
5
+ import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Error.js";import has from"../core/has.js";import o from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as a,sync as n}from"../core/reactiveUtils.js";import{property as l,subclass as p}from"../core/accessorSupport/decorators.js";import{persistable as m}from"../core/accessorSupport/decorators/persistable.js";import d from"../geometry/Extent.js";import u from"../geometry/SpatialReference.js";import c from"./Layer.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISService as f}from"./mixins/ArcGISService.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as j,url as T}from"./support/commonProperties.js";import v from"./support/SceneModifications.js";import{initFullExtent as w}from"./support/tiles3DUtils.js";import b from"../portal/Portal.js";import{logInvalidElevationInfoWarning as x,elevationModeRequiredMessage as L,featureExpressionUnsupportedMessage as P}from"../support/elevationInfoUtils.js";import{f as I}from"../chunks/persistableUrlUtils.js";import{isBasemap as k}from"../support/userTypeGuards/isBasemap.js";import{reader as R}from"../core/accessorSupport/decorators/reader.js";let U=class extends(f(g(_(S(i(y(h(c)))))))){readModifications(e,t,r){this._modificationsSource={url:I(e,r),context:r}}initialize(){this.addHandles(a(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,n))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new u({wkid:4326,vcsWkid:115700}),this.fullExtent=new d(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this._rootTilesetJSON=null,this._rootTileset=null,this._key=null,this._session=null,this._rootRequestPromise=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}get rootTilesetJSON(){return this._rootTilesetJSON}get rootTileset(){return this._rootTileset}get key(){return this._key}get session(){return this._session}_findSessionParameter(e){const t=[e];for(;t?.length>0;){const e=t.pop();if(!e)return;for(const[o,i]of Object.entries(e)){if("uri"===o)try{const e=new URL("https://tmp"+i).searchParams.get("session");if(e)return e}catch(r){}"object"==typeof i&&null!==i&&t.push(i)}}return null}async requestRootAndSession(e){const i=(e,t)=>new r("3dtiles-init:"+e,t);return this._rootRequestPromise||(this._rootRequestPromise=new Promise((r,a)=>{this.url||a(i("url-missing","Layer url missing")),this._key=this.customParameters?this.customParameters.key:null;new Promise((e,r)=>{if(this.replacesTerrain&&!this._key){const o=this.portalItem?.portal||this.parent?.portalItem?.portal||b.getDefault();o.signIn().then(()=>{o.g3dTilesEnabled?t(o.restUrl+"/portals/self/modules/g3dtiles",{responseType:"json",query:{f:"json"}}).then(t=>{this._key=t.data.keyString,e()},()=>r(i("g3dtiles-key-error","Error fetching Google 3D Tiles key from portal"))):r(i("g3dTilesEnabled-false","Google 3D Tiles are not enabled on Portal "+o.url))},()=>r(i("sign-in-failed","Error signing in to Portal")))}else e()}).then(()=>{t(this.url,{query:this._key?{key:this._key,token:this.apiKey}:{token:this.apiKey},responseType:"array-buffer",signal:e}).then(e=>{try{this._rootTilesetJSON=JSON.parse((new TextDecoder).decode(e.data))}catch(t){return void a(i("root-parse-failed","Error parsing root tile, details: "+t))}this._rootTilesetJSON?(this._session=this._findSessionParameter(this._rootTilesetJSON),this._rootTileset=e.data,this.fullExtent=w(this._rootTilesetJSON),r(),this._rootRequestPromise=null):a(i("root-is-null","Root tile is null."))},e=>{s(e),a(i("root-load-failed","Error loading root tile")),this._rootRequestPromise=null,o.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})},e=>a(e))})),this._rootRequestPromise}async _doLoad(e){const t=null!=e?e.signal:null;if(this._isUsedAsGroundLayer&&!has("enable-feature:basemap-groundlayers"))throw new r("3dtiles-init:not-supported-in-groundlayers","Layer is not supported in basemap.");try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new r("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(o){s(o)}if(null!=this._modificationsSource){const t=await v.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this.requestRootAndSession(t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}get hasAttributionData(){return!1}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";x(o.getLogger(this),L(t,"absolute-height",e)),x(o.getLogger(this),P(t,e))}get replacesTerrain(){return!!has("enable-feature:basemap-groundlayers")&&this.hasGoogleUrl&&this._isUsedAsGroundLayer}get _isUsedAsGroundLayer(){return k(this.parent)}get hasGoogleUrl(){return!!this.url?.match(/.+\.googleapis.com/)}};e([l({type:["IntegratedMesh3DTilesLayer"]})],U.prototype,"operationalLayerType",void 0),e([l({type:v,clonable:e=>e.clone()}),m({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],U.prototype,"modifications",void 0),e([R(["web-scene","portal-item"],"modifications")],U.prototype,"readModifications",null),e([l({type:u})],U.prototype,"spatialReference",void 0),e([l({type:d})],U.prototype,"fullExtent",void 0),e([l(j)],U.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],U.prototype,"listMode",void 0),e([l(T)],U.prototype,"url",void 0),e([l({readOnly:!0})],U.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],U.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],U.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],U.prototype,"maxScale",void 0),e([l({readOnly:!0})],U.prototype,"hasAttributionData",null),e([l()],U.prototype,"replacesTerrain",null),e([l()],U.prototype,"_isUsedAsGroundLayer",null),e([l()],U.prototype,"hasGoogleUrl",null),U=e([p("esri.layers.IntegratedMesh3DTilesLayer")],U);const D=U;export{D as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.0.0-next.31",
3
+ "version": "5.0.0-next.32",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- const e="20251030",f="f91536cf17797de6f9dd58d0a402a161f5eaecef";export{e as buildDate,f as commitHash};
5
+ const c="20251031",a="5aa54521aacec1c08ce5db52ac3b9ac22e1fb97c";export{c as buildDate,a as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{UniqueSymbol as e}from"./core.js";import{isSearchCircleOverlapingSymbol as t,tileCoordChangeX as s,tileCoordChangeY as i,GridIndex as l}from"./util.js";class o{static fromSymbols(e,t){let s=e.length;if(s>=n){let i=t;do{i/=2,s/=4}while(s>r&&i>y);const n=new l(t,t,i);for(const t of e)n.getCell(t.xTile,t.yTile).push(t);return new o(t,e,n)}return new o(t,e,null)}constructor(e,t,s){this.tileCoordRange=e,this._symbols=t,this._index=s}addSymbols(e){for(const t of e)this._symbols.push(t);if(this._index)for(const t of e)this._index.getCell(t.xTile,t.yTile).push(t)}removeSymbols(e){const t=new Set(e);if(this._symbols=this._symbols.filter(e=>!t.has(e)),this._index)for(const s of this._index.cells)for(let e=0;e<s.length;e++)s[e]=s[e].filter(e=>!t.has(e))}getSymbols(){return this._symbols}getCandidate(e,t,s,i){if(!this._index){for(const l of this._symbols)if(s===l.hash&&Math.abs(e-l.xTile)<=i&&Math.abs(t-l.yTile)<=i)return l;return null}const l=this._index.getCellSpan(e-i,t-i,e+i,t+i),[o,n,r,y]=l;for(let a=n;a<=y;a++)for(let l=o;l<=r;l++){const o=this._index.cells[a][l];for(const l of o)if(s===l.hash&&Math.abs(e-l.xTile)<=i&&Math.abs(t-l.yTile)<=i)return l}return null}}const n=32,r=8,y=64,a=20;class u{constructor(e,t){this.tileCoordRange=e,this._visibleTiles=t,this._indexMapByTile=new Map,this._uniqueSymbolsByStyleLayerId=new Map}get uniqueSymbols(){return null==this._uniqueSymbolLayerArray&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}registerVectorTile(e,t){const s=this._ensureIndexMap(e),i=t?.values()??s.keys();for(const l of i){const e=s.get(l);e&&(this._removeSymbols(l,e.getSymbols()),s.delete(l))}this._addSymbols(e.key,s,e.symbols),this._invalidate()}unregisterVectorTile(e){this._removeTile(e),this._invalidate()}registerFeatureTile(e){this._ensureIndexMap(e),this._invalidate()}unregisterFeatureTile(e){this._removeTile(e),this._invalidate()}insertFeatureTileMetrics(e,t){const s=this._indexMapByTile.get(e);if(!s)throw new Error(`tile ${e.id} not registered!`);this._addSymbols(e.key,s,h(t)),this._invalidate()}removeFeatureTileMetrics(e,t){const s=this._indexMapByTile.get(e);if(!s)return;const i=h(t);for(const[l,o]of s.entries()){const e=i.get(l);e&&(o.removeSymbols(e),this._removeSymbols(l,e))}this._invalidate()}deleteStyleLayers(e){for(const t of this._indexMapByTile.values())for(const s of e){const e=t.get(s);e&&(this._removeSymbols(s,e.getSymbols()),t.delete(s))}this._invalidate()}querySymbols(e,s,i,l){const o=[];for(const[n,r]of this._uniqueSymbolsByStyleLayerId.entries())for(const l of r){const r=l.tileSymbols.find(e=>e.selectedForRendering);r&&t(r,e,s*(window.devicePixelRatio||1),i)&&o.push({vtlSymbol:r,styleLayerUID:n,tileKey:r.tile.key})}return o}_ensureIndexMap(e){let t=this._indexMapByTile.get(e);return t||(t=new Map,this._indexMapByTile.set(e,t)),t}_invalidate(){this._uniqueSymbolLayerArray=null}_addSymbols(e,t,s){for(const[i,l]of s){let e=t.get(i);e?e.addSymbols(l):(e=o.fromSymbols(l,this.tileCoordRange),t.set(i,e))}this._updateUniqueSymbols(e,s)}_removeTile(e){const t=this._indexMapByTile.get(e);if(t){for(const[e,s]of t.entries())this._removeSymbols(e,s.getSymbols());this._indexMapByTile.delete(e),this._invalidate()}}_removeSymbols(e,t){for(const s of t){const t=s.uniqueSymbol;if(t){if(t.tileSymbols=t.tileSymbols.filter(e=>e!==s),0===t.tileSymbols.length){const s=this._uniqueSymbolsByStyleLayerId.get(e);s.delete(t),0===s.size&&this._uniqueSymbolsByStyleLayerId.delete(e)}s.uniqueSymbol=null}}}_updateUniqueSymbols(t,s){if(0!==s.size){for(const e of this._visibleTiles)e.parentTile||e.key.world!==t.world||e.key.level===t.level&&!e.key.equals(t)||this._matchSymbols(e,t,s);for(const[t,i]of s)for(const s of i)if(!s.uniqueSymbol){s.uniqueSymbol=new e(s);let i=this._uniqueSymbolsByStyleLayerId.get(t);i||(i=new Set,this._uniqueSymbolsByStyleLayerId.set(t,i)),i.add(s.uniqueSymbol)}}}_matchSymbols(e,t,l){if(e.key.level>t.level){const s=e.key.level-t.level;if(e.key.row>>s!==t.row||e.key.col>>s!==t.col)return}if(t.level>e.key.level){const s=t.level-e.key.level;if(t.row>>s!==e.key.row||t.col>>s!==e.key.col)return}const o=new Map;for(const[n,r]of l){const l=[],y=(e.key.level<t.level?1:1<<e.key.level-t.level)+a,u=this._indexMapByTile.get(e),h=u?.get(n);if(h)for(const o of r){if(o.uniqueSymbol)continue;const n=s(this.tileCoordRange,o.xTile,t,e.key),r=i(this.tileCoordRange,o.yTile,t,e.key),u=-a,c=this.tileCoordRange+a;if(!(n>=u&&n<c&&r>=u&&r<c)){l.push(o);continue}const f=h.getCandidate(n,r,o.hash,y),m=f?.uniqueSymbol;m?(o.uniqueSymbol=m,m.tileSymbols.push(o)):l.push(o)}l.length>0&&o.set(n,l)}for(const s of e.childrenTiles||[])this._matchSymbols(s,t,o)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsByStyleLayerId,t=new Array(e.size);let s,i=0;for(const[l,o]of e){const e=new Array(o.size);s=0;for(const t of o)e[s++]=t;t[i]={styleLayerUID:l,uniqueSymbols:e},i++}return t}}function h(e){const t=new Map;for(const s of e){const e=s.labelClassId;let i=t.get(e);i||(i=[],t.set(e,i)),i.push(s)}return t}export{u as SymbolRepository};
5
+ import{UniqueSymbol as e}from"./core.js";import{isSearchCircleOverlapingSymbol as t,tileCoordChangeX as s,tileCoordChangeY as i,GridIndex as l}from"./util.js";class o{static fromSymbols(e,t){let s=e.length;if(s>=n){let i=t;do{i/=2,s/=4}while(s>r&&i>y);const n=new l(t,t,i);for(const t of e)n.getCell(t.xTile,t.yTile).push(t);return new o(t,e,n)}return new o(t,e,null)}constructor(e,t,s){this.tileCoordRange=e,this._symbols=t,this._index=s}addSymbols(e){for(const t of e)this._symbols.push(t);if(this._index)for(const t of e)this._index.getCell(t.xTile,t.yTile).push(t)}removeSymbols(e){const t=new Set(e);if(this._symbols=this._symbols.filter(e=>!t.has(e)),this._index)for(const s of this._index.cells)for(let e=0;e<s.length;e++)s[e]=s[e].filter(e=>!t.has(e))}getSymbols(){return this._symbols}getCandidate(e,t,s,i){if(!this._index){for(const l of this._symbols)if(s===l.hash&&Math.abs(e-l.xTile)<=i&&Math.abs(t-l.yTile)<=i)return l;return null}const l=this._index.getCellSpan(e-i,t-i,e+i,t+i),[o,n,r,y]=l;for(let a=n;a<=y;a++)for(let l=o;l<=r;l++){const o=this._index.cells[a][l];for(const l of o)if(s===l.hash&&Math.abs(e-l.xTile)<=i&&Math.abs(t-l.yTile)<=i)return l}return null}}const n=32,r=8,y=64,a=20;class u{constructor(e,t){this.tileCoordRange=e,this._visibleTiles=t,this._indexMapByTile=new Map,this._uniqueSymbolsByStyleLayerId=new Map}get uniqueSymbols(){return null==this._uniqueSymbolLayerArray&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}registerVectorTile(e,t){const s=this._ensureIndexMap(e),i=t?.values()??s.keys();for(const l of i){const e=s.get(l);e&&(this._removeSymbols(l,e.getSymbols()),s.delete(l))}this._addSymbols(e.key,s,e.symbols),this._invalidate()}unregisterVectorTile(e){this._removeTile(e),this._invalidate()}registerFeatureTile(e){this._ensureIndexMap(e),this._invalidate()}unregisterFeatureTile(e){this._removeTile(e),this._invalidate()}insertFeatureTileMetrics(e,t){const s=this._indexMapByTile.get(e);if(!s)throw new Error(`tile ${e.id} not registered!`);this._addSymbols(e.key,s,h(t)),this._invalidate()}removeFeatureTileMetrics(e,t){const s=this._indexMapByTile.get(e);if(!s)return;const i=h(t);for(const[l,o]of s.entries()){const e=i.get(l);e&&(o.removeSymbols(e),this._removeSymbols(l,e))}this._invalidate()}deleteStyleLayers(e){for(const t of this._indexMapByTile.values())for(const s of e){const e=t.get(s);e&&(this._removeSymbols(s,e.getSymbols()),t.delete(s))}this._invalidate()}querySymbols(e,s,i,l){const o=[];for(const[n,r]of this._uniqueSymbolsByStyleLayerId.entries())for(const l of r){const r=l.tileSymbols.find(e=>e.selectedForRendering);r&&t(r,e,s*(window.devicePixelRatio||1),i)&&o.push({vtlSymbol:r,styleLayerUID:n,tileKey:r.tile.key})}return o}_ensureIndexMap(e){let t=this._indexMapByTile.get(e);return t||(t=new Map,this._indexMapByTile.set(e,t)),t}_invalidate(){this._uniqueSymbolLayerArray=null}_addSymbols(e,t,s){for(const[i,l]of s){let e=t.get(i);e?e.addSymbols(l):(e=o.fromSymbols(l,this.tileCoordRange),t.set(i,e))}this._updateUniqueSymbols(e,s)}_removeTile(e){const t=this._indexMapByTile.get(e);if(t){for(const[e,s]of t.entries())this._removeSymbols(e,s.getSymbols());this._indexMapByTile.delete(e),this._invalidate()}}_removeSymbols(e,t){for(const s of t){const t=s.uniqueSymbol;if(t){if(t.tileSymbols=t.tileSymbols.filter(e=>e!==s),0===t.tileSymbols.length){const s=this._uniqueSymbolsByStyleLayerId.get(e);s.delete(t),0===s.size&&this._uniqueSymbolsByStyleLayerId.delete(e)}s.uniqueSymbol=null}}}_updateUniqueSymbols(t,s){if(0!==s.size){for(const e of this._visibleTiles)e.parentTile||e.key.world!==t.world||e.key.level===t.level&&!e.key.equals(t)||this._matchSymbols(e,t,s);for(const[t,i]of s)for(const s of i)if(!s.uniqueSymbol){s.uniqueSymbol=new e(s);let i=this._uniqueSymbolsByStyleLayerId.get(t);i||(i=new Set,this._uniqueSymbolsByStyleLayerId.set(t,i)),i.add(s.uniqueSymbol)}}}_matchSymbols(e,t,l){if(e.key.level>t.level){const s=e.key.level-t.level;if(e.key.row>>s!==t.row||e.key.col>>s!==t.col)return}if(t.level>e.key.level){const s=t.level-e.key.level;if(t.row>>s!==e.key.row||t.col>>s!==e.key.col)return}const o=new Map;for(const[n,r]of l){const l=[],y=e.key.level<t.level?1:1<<Math.abs(e.key.level-t.level),u=this._indexMapByTile.get(e),h=u?.get(n);if(h)for(const o of r){if(o.uniqueSymbol)continue;const n=s(this.tileCoordRange,o.xTile,t,e.key),r=i(this.tileCoordRange,o.yTile,t,e.key),u=-a,c=this.tileCoordRange+a;if(!(n>=u&&n<c&&r>=u&&r<c)){l.push(o);continue}const f=h.getCandidate(n,r,o.hash,y),m=f?.uniqueSymbol;m?(o.uniqueSymbol=m,m.tileSymbols.push(o)):l.push(o)}l.length>0&&o.set(n,l)}for(const s of e.childrenTiles||[])this._matchSymbols(s,t,o)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsByStyleLayerId,t=new Array(e.size);let s,i=0;for(const[l,o]of e){const e=new Array(o.size);s=0;for(const t of o)e[s++]=t;t[i]={styleLayerUID:l,uniqueSymbols:e},i++}return t}}function h(e){const t=new Map;for(const s of e){const e=s.labelClassId;let i=t.get(e);i||(i=[],t.set(e,i)),i.push(s)}return t}export{u as SymbolRepository};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- const e={background:{"background.frag":"#ifdef PATTERN\nuniform lowp float u_opacity;\nuniform lowp sampler2D u_texture;\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_tileTextureCoord;\n#else\nuniform lowp vec4 u_color;\n#endif\nvoid main() {\n#ifdef PATTERN\nmediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0);\nmediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\nlowp vec4 color = texture2D(u_texture, samplePos);\ngl_FragColor = u_opacity * color;\n#else\ngl_FragColor = u_color;\n#endif\n}","background.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform mediump float u_coord_range;\nuniform mediump float u_depth;\n#ifdef PATTERN\nuniform mediump mat3 u_pattern_matrix;\nvarying mediump vec2 v_tileTextureCoord;\nuniform mediump vec4 u_tlbr;\nuniform mediump vec2 u_mosaicSize;\nvarying mediump vec4 v_tlbr;\n#endif\nvoid main() {\ngl_Position = vec4((u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0)).xy, u_depth, 1.0);\n#ifdef PATTERN\nv_tileTextureCoord = (u_pattern_matrix * vec3(a_pos, 1.0)).xy;\nv_tlbr = u_tlbr / u_mosaicSize.xyxy;\n#endif\n}"},circle:{"circle.frag":"precision lowp float;\nvarying lowp vec4 v_color;\nvarying lowp vec4 v_stroke_color;\nvarying mediump float v_blur;\nvarying mediump float v_stroke_width;\nvarying mediump float v_radius;\nvarying mediump vec2 v_offset;\nvoid main()\n{\nmediump float dist = length(v_offset);\nmediump float alpha = smoothstep(0.0, -v_blur, dist - 1.0);\nlowp float color_mix_ratio = v_stroke_width < 0.01 ? 0.0 : smoothstep(-v_blur, 0.0, dist - v_radius / (v_radius + v_stroke_width));\ngl_FragColor = alpha * mix(v_color, v_stroke_color, color_mix_ratio);\n}","circle.vert":"precision mediump float;\nattribute vec2 a_pos;\n#pragma header\nvarying lowp vec4 v_color;\nvarying lowp vec4 v_stroke_color;\nvarying mediump float v_blur;\nvarying mediump float v_stroke_width;\nvarying mediump float v_radius;\nvarying mediump vec2 v_offset;\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump vec2 u_circleTranslation;\nuniform mediump float u_depth;\nuniform mediump float u_antialiasingWidth;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\nv_stroke_color = stroke_color * stroke_opacity;\nv_stroke_width = stroke_width;\nv_radius = radius;\nv_blur = max(blur, u_antialiasingWidth / (radius + stroke_width));\nmediump vec2 offset = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\nv_offset = offset;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos * 0.5, 1.0) + u_displayMat3 * vec3((v_radius + v_stroke_width) * offset + u_circleTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n}"},fill:{"fill.frag":"precision lowp float;\n#ifdef PATTERN\nuniform lowp sampler2D u_texture;\nvarying mediump vec2 v_tileTextureCoord;\nvarying mediump vec4 v_tlbr;\n#endif\nvarying lowp vec4 v_color;\nvec4 mixColors(vec4 color1, vec4 color2) {\nfloat compositeAlpha = color2.a + color1.a * (1.0 - color2.a);\nvec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a);\nreturn vec4(compositeColor, compositeAlpha);\n}\nvoid main()\n{\n#ifdef PATTERN\nmediump vec2 normalizedTextureCoord = fract(v_tileTextureCoord);\nmediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\nlowp vec4 color = texture2D(u_texture, samplePos);\ngl_FragColor = v_color[3] * color;\n#else\ngl_FragColor = v_color;\n#endif\n}","fill.vert":"precision mediump float;\nattribute vec2 a_pos;\n#pragma header\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump float u_depth;\nuniform mediump vec2 u_fillTranslation;\n#ifdef PATTERN\n#include <util/util.glsl>\nuniform mediump vec2 u_mosaicSize;\nuniform mediump float u_patternFactor;\nvarying mediump vec2 v_tileTextureCoord;\nvarying mediump vec4 v_tlbr;\n#endif\nvarying lowp vec4 v_color;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\n#ifdef PATTERN\nfloat patternWidth = nextPOT(tlbr.z - tlbr.x);\nfloat patternHeight = nextPOT(tlbr.w - tlbr.y);\nfloat scaleX = 1.0 / (patternWidth * u_patternFactor);\nfloat scaleY = 1.0 / (patternHeight * u_patternFactor);\nmat3 patterMat = mat3(scaleX, 0.0, 0.0,\n0.0, -scaleY, 0.0,\n0.0, 0.0, 1.0);\nv_tileTextureCoord = (patterMat * vec3(a_pos, 1.0)).xy;\nv_tlbr = tlbr / u_mosaicSize.xyxy;\n#endif\nvec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(u_fillTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n}"},icon:{"icon.frag":"precision mediump float;\nuniform lowp sampler2D u_texture;\n#ifdef SDF\nuniform lowp vec4 u_color;\nuniform lowp vec4 u_outlineColor;\n#endif\nuniform highp int u_isStencilPass;\nvarying mediump vec2 v_tex;\nvarying lowp float v_opacity;\nvarying mediump vec2 v_size;\nvarying lowp vec4 v_color;\n#ifdef SDF\nvarying mediump flaot v_halo_width;\n#endif\nconst float alphaCutoff = 1.0 / 255.5;\n#include <util/encoding.glsl>\nvec4 mixColors(vec4 color1, vec4 color2) {\nfloat compositeAlpha = color2.a + color1.a * (1.0 - color2.a);\nvec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a);\nreturn vec4(compositeColor, compositeAlpha);\n}\nvoid main()\n{\n#ifdef SDF\nlowp vec4 fillPixelColor = v_color;\nfloat d = rgba2float(texture2D(u_texture, v_tex)) - 0.5;\nconst float softEdgeRatio = 0.248062016;\nfloat size = max(v_size.x, v_size.y);\nfloat dist = d * softEdgeRatio * size;\nfillPixelColor *= clamp(0.5 - dist, 0.0, 1.0);\nif (v_halo_width > 0.25) {\nlowp vec4 outlinePixelColor = u_outlineColor;\nconst float outlineLimitRatio = (16.0 / 86.0);\nfloat clampedOutlineSize = softEdgeRatio * min(v_halo_width, outlineLimitRatio * max(v_size.x, v_size.y));\noutlinePixelColor *= clamp(0.5 - (abs(dist) - clampedOutlineSize), 0.0, 1.0);\ngl_FragColor = v_opacity * mixColors(fillPixelColor, outlinePixelColor);\n}\nelse {\ngl_FragColor = v_opacity * fillPixelColor;\n}\n#else\nlowp vec4 texColor = texture2D(u_texture, v_tex);\nif (u_isStencilPass == 1 && texColor.a < alphaCutoff) {\ndiscard;\n}\ngl_FragColor = v_opacity * texColor;\n#endif\n}","icon.vert":"attribute vec2 a_pos;\nattribute vec2 a_vertexOffset;\nattribute vec4 a_texAngleRange;\nattribute vec4 a_levelInfo;\nattribute float a_opacityInfo;\n#pragma header\nvarying lowp vec4 v_color;\n#ifdef SDF\nvarying mediump float v_halo_width;\n#endif\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump vec2 u_iconTranslation;\nuniform vec2 u_mosaicSize;\nuniform mediump float u_depth;\nuniform mediump float u_mapRotation;\nuniform mediump float u_level;\nuniform lowp float u_keepUpright;\nuniform mediump float u_fadeDuration;\nvarying mediump vec2 v_tex;\nvarying lowp float v_opacity;\nvarying mediump vec2 v_size;\nconst float C_OFFSET_PRECISION = 1.0 / 8.0;\nconst float C_256_TO_RAD = 3.14159265359 / 128.0;\nconst float C_DEG_TO_RAD = 3.14159265359 / 180.0;\nconst float tileCoordRatio = 1.0 / 8.0;\nuniform highp float u_time;\nvoid main()\n{\n#pragma main\nv_color = color;\nv_opacity = opacity;\n#ifdef SDF\nv_halo_width = halo_width;\n#endif\nfloat modded = mod(a_opacityInfo, 128.0);\nfloat targetOpacity = (a_opacityInfo - modded) / 128.0;\nfloat startOpacity = modded / 127.0;\nfloat interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0);\nv_opacity *= interpolatedOpacity;\nmediump float a_angle = a_levelInfo[1];\nmediump float a_minLevel = a_levelInfo[2];\nmediump float a_maxLevel = a_levelInfo[3];\nmediump vec2 a_tex = a_texAngleRange.xy;\nmediump float delta_z = 0.0;\nmediump float rotated = mod(a_angle + u_mapRotation, 256.0);\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * step(64.0, rotated) * (1.0 - step(192.0, rotated));\ndelta_z += 1.0 - step(a_minLevel, u_level);\ndelta_z += step(a_maxLevel, u_level);\ndelta_z += step(v_opacity, 0.0);\nvec2 offset = C_OFFSET_PRECISION * a_vertexOffset;\nv_size = abs(offset);\n#ifdef SDF\noffset = (120.0 / 86.0) * offset;\n#endif\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayViewMat3 * vec3(size * offset, 0.0) + u_displayMat3 * vec3(u_iconTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth + delta_z, 1.0);\nv_tex = a_tex.xy / u_mosaicSize;\n}"},line:{"line.frag":"precision lowp float;\nvarying mediump vec2 v_normal;\nvarying highp float v_accumulatedDistance;\nvarying mediump float v_lineHalfWidth;\nvarying lowp vec4 v_color;\nvarying mediump float v_blur;\n#if defined (PATTERN) || defined(SDF)\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\nvarying mediump float v_widthRatio;\nuniform sampler2D u_texture;\nuniform mediump float u_antialiasing;\n#endif\n#ifdef SDF\n#include <util/encoding.glsl>\n#endif\nvoid main()\n{\nmediump float fragDist = length(v_normal) * v_lineHalfWidth;\nlowp float alpha = clamp((v_lineHalfWidth - fragDist) / v_blur, 0.0, 1.0);\n#ifdef PATTERN\nmediump float relativeTexX = fract(v_accumulatedDistance / (v_patternSize.x * v_widthRatio));\nmediump float relativeTexY = 0.5 + v_normal.y * v_lineHalfWidth / (v_patternSize.y * v_widthRatio);\nmediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\nlowp vec4 color = texture2D(u_texture, texCoord);\ngl_FragColor = alpha * v_color[3] * color;\n#elif defined(SDF)\nmediump float relativeTexX = fract((v_accumulatedDistance * 0.5) / (v_patternSize.x * v_widthRatio));\nmediump float relativeTexY = 0.5 + 0.25 * v_normal.y;\nmediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\nmediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5;\nfloat dist = d * (v_lineHalfWidth + u_antialiasing / 2.0);\ngl_FragColor = alpha * clamp(0.5 - dist, 0.0, 1.0) * v_color;\n#else\ngl_FragColor = alpha * v_color;\n#endif\n}","line.vert":"precision mediump float;\nattribute vec2 a_pos;\nattribute vec4 a_extrude_offset;\nattribute vec4 a_dir_normal;\nattribute vec2 a_accumulatedDistance;\n#pragma header\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump float u_zoomFactor;\nuniform mediump vec2 u_lineTranslation;\nuniform mediump float u_antialiasing;\nuniform mediump float u_depth;\nvarying mediump vec2 v_normal;\nvarying highp float v_accumulatedDistance;\nconst float scale = 1.0 / 31.0;\nconst mediump float tileCoordRatio = 8.0;\n#if defined (SDF)\nconst mediump float sdfPatternHalfWidth = 15.5;\n#endif\n#if defined (PATTERN) || defined(SDF)\nuniform mediump vec2 u_mosaicSize;\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\nvarying mediump float v_widthRatio;\n#endif\nvarying lowp vec4 v_color;\nvarying mediump float v_lineHalfWidth;\nvarying mediump float v_blur;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\nv_blur = blur + u_antialiasing;\nv_normal = a_dir_normal.zw * scale;\n#if defined (PATTERN) || defined(SDF)\nv_tlbr = tlbr / u_mosaicSize.xyxy;\nv_patternSize = vec2(tlbr.z - tlbr.x, tlbr.y - tlbr.w);\n#if defined (PATTERN)\nv_widthRatio = width / v_patternSize.y;\n#else\nv_widthRatio = width / sdfPatternHalfWidth / 2.0;\n#endif\n#endif\nv_lineHalfWidth = (width + u_antialiasing) * 0.5;\nmediump vec2 dir = a_dir_normal.xy * scale;\nmediump vec2 offset_ = a_extrude_offset.zw * scale * offset;\nmediump vec2 dist = v_lineHalfWidth * scale * a_extrude_offset.xy;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos + offset_ * tileCoordRatio / u_zoomFactor, 1.0) + u_displayViewMat3 * vec3(dist, 0.0) + u_displayMat3 * vec3(u_lineTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n#if defined (PATTERN) || defined(SDF)\nv_accumulatedDistance = a_accumulatedDistance.x * u_zoomFactor / tileCoordRatio + dot(dir, dist + offset_);\n#endif\n}"},outline:{"outline.frag":"varying lowp vec4 v_color;\nvarying mediump vec2 v_normal;\nvoid main()\n{\nlowp float dist = abs(v_normal.y);\nlowp float alpha = smoothstep(1.0, 0.0, dist);\ngl_FragColor = alpha * v_color;\n}","outline.vert":"attribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_xnormal;\n#pragma header\nvarying lowp vec4 v_color;\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump vec2 u_fillTranslation;\nuniform mediump float u_depth;\nuniform mediump float u_outline_width;\nvarying lowp vec2 v_normal;\nconst float scale = 1.0 / 15.0;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\nv_normal = a_xnormal;\nmediump vec2 dist = u_outline_width * scale * a_offset;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(dist + u_fillTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n}"},text:{"text.frag":"uniform lowp sampler2D u_texture;\nvarying lowp vec2 v_tex;\nvarying lowp vec4 v_color;\nvarying mediump float v_edgeWidth;\nvarying mediump float v_edgeDistance;\nvoid main()\n{\nlowp float dist = texture2D(u_texture, v_tex).a;\nmediump float alpha = smoothstep(v_edgeDistance - v_edgeWidth, v_edgeDistance + v_edgeWidth, dist);\ngl_FragColor = alpha * v_color;\n}","text.vert":"attribute vec2 a_pos;\nattribute vec2 a_vertexOffset;\nattribute vec4 a_texAngleRange;\nattribute vec4 a_levelInfo;\nattribute float a_opacityInfo;\n#pragma header\nvarying lowp vec4 v_color;\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump vec2 u_textTranslation;\nuniform vec2 u_mosaicSize;\nuniform mediump float u_depth;\nuniform mediump float u_mapRotation;\nuniform mediump float u_level;\nuniform lowp float u_keepUpright;\nuniform mediump float u_fadeDuration;\nvarying lowp vec2 v_tex;\nconst float offsetPrecision = 1.0 / 8.0;\nconst mediump float edgePos = 0.75;\nuniform mediump float u_antialiasingWidth;\nvarying mediump float v_edgeDistance;\nvarying mediump float v_edgeWidth;\nuniform lowp float u_halo;\nconst float sdfFontScale = 1.0 / 24.0;\nconst float sdfPixel = 3.0;\nuniform highp float u_time;\nvoid main()\n{\n#pragma main\nif (u_halo > 0.5)\n{\nv_color = halo_color * opacity;\nhalo_width *= sdfPixel;\nhalo_blur *= sdfPixel;\n}\nelse\n{\nv_color = color * opacity;\nhalo_width = 0.0;\nhalo_blur = 0.0;\n}\nfloat modded = mod(a_opacityInfo, 128.0);\nfloat targetOpacity = (a_opacityInfo - modded) / 128.0;\nfloat startOpacity = modded / 127.0;\nfloat interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0);\nv_color *= interpolatedOpacity;\nmediump float a_angle = a_levelInfo[1];\nmediump float a_minLevel = a_levelInfo[2];\nmediump float a_maxLevel = a_levelInfo[3];\nmediump vec2 a_tex = a_texAngleRange.xy;\nmediump float a_visMinAngle = a_texAngleRange.z;\nmediump float a_visMaxAngle = a_texAngleRange.w;\nmediump float delta_z = 0.0;\nmediump float angle = mod(a_angle + u_mapRotation, 256.0);\nif (a_visMinAngle < a_visMaxAngle)\n{\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) + (1.0 - step(a_visMinAngle, angle)));\n}\nelse\n{\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) * (1.0 - step(a_visMinAngle, angle)));\n}\ndelta_z += 1.0 - step(a_minLevel, u_level);\ndelta_z += step(a_maxLevel, u_level);\ndelta_z += step(v_color[3], 0.0);\nv_tex = a_tex.xy / u_mosaicSize;\nv_edgeDistance = edgePos - halo_width / size;\nv_edgeWidth = (u_antialiasingWidth + halo_blur) / size;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + sdfFontScale * u_displayViewMat3 * vec3(offsetPrecision * size * a_vertexOffset, 0.0) + u_displayMat3 * vec3(u_textTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth + delta_z, 1.0);\n}"},util:{"encoding.glsl":"const vec4 rgba2float_factors = vec4(\n255.0 / (256.0),\n255.0 / (256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n);\nfloat rgba2float(vec4 rgba) {\nreturn dot(rgba, rgba2float_factors);\n}","util.glsl":"float nextPOT(in float x) {\nreturn pow(2.0, ceil(log2(abs(x))));\n}"}};export{e as default};
5
+ const e={background:{"background.frag":"#ifdef PATTERN\nuniform lowp float u_opacity;\nuniform lowp sampler2D u_texture;\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_tileTextureCoord;\n#else\nuniform lowp vec4 u_color;\n#endif\nvoid main() {\n#ifdef PATTERN\nmediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0);\nmediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\nlowp vec4 color = texture2D(u_texture, samplePos);\ngl_FragColor = u_opacity * color;\n#else\ngl_FragColor = u_color;\n#endif\n}","background.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform mediump float u_coord_range;\nuniform mediump float u_depth;\n#ifdef PATTERN\nuniform mediump mat3 u_pattern_matrix;\nvarying mediump vec2 v_tileTextureCoord;\nuniform mediump vec4 u_tlbr;\nuniform mediump vec2 u_mosaicSize;\nvarying mediump vec4 v_tlbr;\n#endif\nvoid main() {\ngl_Position = vec4((u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0)).xy, u_depth, 1.0);\n#ifdef PATTERN\nv_tileTextureCoord = (u_pattern_matrix * vec3(a_pos, 1.0)).xy;\nv_tlbr = u_tlbr / u_mosaicSize.xyxy;\n#endif\n}"},circle:{"circle.frag":"precision lowp float;\nvarying lowp vec4 v_color;\nvarying lowp vec4 v_stroke_color;\nvarying mediump float v_blur;\nvarying mediump float v_stroke_width;\nvarying mediump float v_radius;\nvarying mediump vec2 v_offset;\nvoid main()\n{\nmediump float dist = length(v_offset);\nmediump float alpha = smoothstep(0.0, -v_blur, dist - 1.0);\nlowp float color_mix_ratio = v_stroke_width < 0.01 ? 0.0 : smoothstep(-v_blur, 0.0, dist - v_radius / (v_radius + v_stroke_width));\ngl_FragColor = alpha * mix(v_color, v_stroke_color, color_mix_ratio);\n}","circle.vert":"precision mediump float;\nattribute vec2 a_pos;\n#pragma header\nvarying lowp vec4 v_color;\nvarying lowp vec4 v_stroke_color;\nvarying mediump float v_blur;\nvarying mediump float v_stroke_width;\nvarying mediump float v_radius;\nvarying mediump vec2 v_offset;\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump vec2 u_circleTranslation;\nuniform mediump float u_depth;\nuniform mediump float u_antialiasingWidth;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\nv_stroke_color = stroke_color * stroke_opacity;\nv_stroke_width = stroke_width;\nv_radius = radius;\nv_blur = max(blur, u_antialiasingWidth / (radius + stroke_width));\nmediump vec2 offset = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\nv_offset = offset;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos * 0.5, 1.0) + u_displayMat3 * vec3((v_radius + v_stroke_width) * offset + u_circleTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n}"},fill:{"fill.frag":"precision lowp float;\n#ifdef PATTERN\nuniform lowp sampler2D u_texture;\nvarying mediump vec2 v_tileTextureCoord;\nvarying mediump vec4 v_tlbr;\n#endif\nvarying lowp vec4 v_color;\nvec4 mixColors(vec4 color1, vec4 color2) {\nfloat compositeAlpha = color2.a + color1.a * (1.0 - color2.a);\nvec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a);\nreturn vec4(compositeColor, compositeAlpha);\n}\nvoid main()\n{\n#ifdef PATTERN\nmediump vec2 normalizedTextureCoord = fract(v_tileTextureCoord);\nmediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\nlowp vec4 color = texture2D(u_texture, samplePos);\ngl_FragColor = v_color[3] * color;\n#else\ngl_FragColor = v_color;\n#endif\n}","fill.vert":"precision mediump float;\nattribute vec2 a_pos;\n#pragma header\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump float u_depth;\nuniform mediump vec2 u_fillTranslation;\n#ifdef PATTERN\n#include <util/util.glsl>\nuniform mediump vec2 u_mosaicSize;\nuniform mediump float u_patternFactor;\nvarying mediump vec2 v_tileTextureCoord;\nvarying mediump vec4 v_tlbr;\n#endif\nvarying lowp vec4 v_color;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\n#ifdef PATTERN\nfloat patternWidth = nextPOT(tlbr.z - tlbr.x);\nfloat patternHeight = nextPOT(tlbr.w - tlbr.y);\nfloat scaleX = 1.0 / (patternWidth * u_patternFactor);\nfloat scaleY = 1.0 / (patternHeight * u_patternFactor);\nmat3 patterMat = mat3(scaleX, 0.0, 0.0,\n0.0, -scaleY, 0.0,\n0.0, 0.0, 1.0);\nv_tileTextureCoord = (patterMat * vec3(a_pos, 1.0)).xy;\nv_tlbr = tlbr / u_mosaicSize.xyxy;\n#endif\nvec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(u_fillTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n}"},icon:{"icon.frag":"precision mediump float;\nuniform lowp sampler2D u_texture;\n#ifdef SDF\nuniform lowp vec4 u_color;\nuniform lowp vec4 u_outlineColor;\n#endif\nuniform highp int u_isStencilPass;\nvarying mediump vec2 v_tex;\nvarying lowp float v_opacity;\nvarying mediump vec2 v_size;\nvarying lowp vec4 v_color;\n#ifdef SDF\nvarying mediump float v_halo_width;\n#endif\nconst float alphaCutoff = 1.0 / 255.5;\n#include <util/encoding.glsl>\nvec4 mixColors(vec4 color1, vec4 color2) {\nfloat compositeAlpha = color2.a + color1.a * (1.0 - color2.a);\nvec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a);\nreturn vec4(compositeColor, compositeAlpha);\n}\nvoid main()\n{\n#ifdef SDF\nlowp vec4 fillPixelColor = v_color;\nfloat d = rgba2float(texture2D(u_texture, v_tex)) - 0.5;\nconst float softEdgeRatio = 0.248062016;\nfloat size = max(v_size.x, v_size.y);\nfloat dist = d * softEdgeRatio * size;\nfillPixelColor *= clamp(0.5 - dist, 0.0, 1.0);\nif (v_halo_width > 0.25) {\nlowp vec4 outlinePixelColor = u_outlineColor;\nconst float outlineLimitRatio = (16.0 / 86.0);\nfloat clampedOutlineSize = softEdgeRatio * min(v_halo_width, outlineLimitRatio * max(v_size.x, v_size.y));\noutlinePixelColor *= clamp(0.5 - (abs(dist) - clampedOutlineSize), 0.0, 1.0);\ngl_FragColor = v_opacity * mixColors(fillPixelColor, outlinePixelColor);\n}\nelse {\ngl_FragColor = v_opacity * fillPixelColor;\n}\n#else\nlowp vec4 texColor = texture2D(u_texture, v_tex);\nif (u_isStencilPass == 1 && texColor.a < alphaCutoff) {\ndiscard;\n}\ngl_FragColor = v_opacity * texColor;\n#endif\n}","icon.vert":"attribute vec2 a_pos;\nattribute vec2 a_vertexOffset;\nattribute vec4 a_texAngleRange;\nattribute vec4 a_levelInfo;\nattribute float a_opacityInfo;\n#pragma header\nvarying lowp vec4 v_color;\n#ifdef SDF\nvarying mediump float v_halo_width;\n#endif\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump vec2 u_iconTranslation;\nuniform vec2 u_mosaicSize;\nuniform mediump float u_depth;\nuniform mediump float u_mapRotation;\nuniform mediump float u_level;\nuniform lowp float u_keepUpright;\nuniform mediump float u_fadeDuration;\nvarying mediump vec2 v_tex;\nvarying lowp float v_opacity;\nvarying mediump vec2 v_size;\nconst float C_OFFSET_PRECISION = 1.0 / 8.0;\nconst float C_256_TO_RAD = 3.14159265359 / 128.0;\nconst float C_DEG_TO_RAD = 3.14159265359 / 180.0;\nconst float tileCoordRatio = 1.0 / 8.0;\nuniform highp float u_time;\nvoid main()\n{\n#pragma main\nv_color = color;\nv_opacity = opacity;\n#ifdef SDF\nv_halo_width = halo_width;\n#endif\nfloat modded = mod(a_opacityInfo, 128.0);\nfloat targetOpacity = (a_opacityInfo - modded) / 128.0;\nfloat startOpacity = modded / 127.0;\nfloat interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0);\nv_opacity *= interpolatedOpacity;\nmediump float a_angle = a_levelInfo[1];\nmediump float a_minLevel = a_levelInfo[2];\nmediump float a_maxLevel = a_levelInfo[3];\nmediump vec2 a_tex = a_texAngleRange.xy;\nmediump float delta_z = 0.0;\nmediump float rotated = mod(a_angle + u_mapRotation, 256.0);\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * step(64.0, rotated) * (1.0 - step(192.0, rotated));\ndelta_z += 1.0 - step(a_minLevel, u_level);\ndelta_z += step(a_maxLevel, u_level);\ndelta_z += step(v_opacity, 0.0);\nvec2 offset = C_OFFSET_PRECISION * a_vertexOffset;\nv_size = abs(offset);\n#ifdef SDF\noffset = (120.0 / 86.0) * offset;\n#endif\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayViewMat3 * vec3(size * offset, 0.0) + u_displayMat3 * vec3(u_iconTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth + delta_z, 1.0);\nv_tex = a_tex.xy / u_mosaicSize;\n}"},line:{"line.frag":"precision lowp float;\nvarying mediump vec2 v_normal;\nvarying highp float v_accumulatedDistance;\nvarying mediump float v_lineHalfWidth;\nvarying lowp vec4 v_color;\nvarying mediump float v_blur;\n#if defined (PATTERN) || defined(SDF)\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\nvarying mediump float v_widthRatio;\nuniform sampler2D u_texture;\nuniform mediump float u_antialiasing;\n#endif\n#ifdef SDF\n#include <util/encoding.glsl>\n#endif\nvoid main()\n{\nmediump float fragDist = length(v_normal) * v_lineHalfWidth;\nlowp float alpha = clamp((v_lineHalfWidth - fragDist) / v_blur, 0.0, 1.0);\n#ifdef PATTERN\nmediump float relativeTexX = fract(v_accumulatedDistance / (v_patternSize.x * v_widthRatio));\nmediump float relativeTexY = 0.5 + v_normal.y * v_lineHalfWidth / (v_patternSize.y * v_widthRatio);\nmediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\nlowp vec4 color = texture2D(u_texture, texCoord);\ngl_FragColor = alpha * v_color[3] * color;\n#elif defined(SDF)\nmediump float relativeTexX = fract((v_accumulatedDistance * 0.5) / (v_patternSize.x * v_widthRatio));\nmediump float relativeTexY = 0.5 + 0.25 * v_normal.y;\nmediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY));\nmediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5;\nfloat dist = d * (v_lineHalfWidth + u_antialiasing / 2.0);\ngl_FragColor = alpha * clamp(0.5 - dist, 0.0, 1.0) * v_color;\n#else\ngl_FragColor = alpha * v_color;\n#endif\n}","line.vert":"precision mediump float;\nattribute vec2 a_pos;\nattribute vec4 a_extrude_offset;\nattribute vec4 a_dir_normal;\nattribute vec2 a_accumulatedDistance;\n#pragma header\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump float u_zoomFactor;\nuniform mediump vec2 u_lineTranslation;\nuniform mediump float u_antialiasing;\nuniform mediump float u_depth;\nvarying mediump vec2 v_normal;\nvarying highp float v_accumulatedDistance;\nconst float scale = 1.0 / 31.0;\nconst mediump float tileCoordRatio = 8.0;\n#if defined (SDF)\nconst mediump float sdfPatternHalfWidth = 15.5;\n#endif\n#if defined (PATTERN) || defined(SDF)\nuniform mediump vec2 u_mosaicSize;\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\nvarying mediump float v_widthRatio;\n#endif\nvarying lowp vec4 v_color;\nvarying mediump float v_lineHalfWidth;\nvarying mediump float v_blur;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\nv_blur = blur + u_antialiasing;\nv_normal = a_dir_normal.zw * scale;\n#if defined (PATTERN) || defined(SDF)\nv_tlbr = tlbr / u_mosaicSize.xyxy;\nv_patternSize = vec2(tlbr.z - tlbr.x, tlbr.y - tlbr.w);\n#if defined (PATTERN)\nv_widthRatio = width / v_patternSize.y;\n#else\nv_widthRatio = width / sdfPatternHalfWidth / 2.0;\n#endif\n#endif\nv_lineHalfWidth = (width + u_antialiasing) * 0.5;\nmediump vec2 dir = a_dir_normal.xy * scale;\nmediump vec2 offset_ = a_extrude_offset.zw * scale * offset;\nmediump vec2 dist = v_lineHalfWidth * scale * a_extrude_offset.xy;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos + offset_ * tileCoordRatio / u_zoomFactor, 1.0) + u_displayViewMat3 * vec3(dist, 0.0) + u_displayMat3 * vec3(u_lineTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n#if defined (PATTERN) || defined(SDF)\nv_accumulatedDistance = a_accumulatedDistance.x * u_zoomFactor / tileCoordRatio + dot(dir, dist + offset_);\n#endif\n}"},outline:{"outline.frag":"varying lowp vec4 v_color;\nvarying mediump vec2 v_normal;\nvoid main()\n{\nlowp float dist = abs(v_normal.y);\nlowp float alpha = smoothstep(1.0, 0.0, dist);\ngl_FragColor = alpha * v_color;\n}","outline.vert":"attribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_xnormal;\n#pragma header\nvarying lowp vec4 v_color;\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform mediump vec2 u_fillTranslation;\nuniform mediump float u_depth;\nuniform mediump float u_outline_width;\nvarying lowp vec2 v_normal;\nconst float scale = 1.0 / 15.0;\nvoid main()\n{\n#pragma main\nv_color = color * opacity;\nv_normal = a_xnormal;\nmediump vec2 dist = u_outline_width * scale * a_offset;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(dist + u_fillTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth, 1.0);\n}"},text:{"text.frag":"uniform lowp sampler2D u_texture;\nvarying lowp vec2 v_tex;\nvarying lowp vec4 v_color;\nvarying mediump float v_edgeWidth;\nvarying mediump float v_edgeDistance;\nvoid main()\n{\nlowp float dist = texture2D(u_texture, v_tex).a;\nmediump float alpha = smoothstep(v_edgeDistance - v_edgeWidth, v_edgeDistance + v_edgeWidth, dist);\ngl_FragColor = alpha * v_color;\n}","text.vert":"attribute vec2 a_pos;\nattribute vec2 a_vertexOffset;\nattribute vec4 a_texAngleRange;\nattribute vec4 a_levelInfo;\nattribute float a_opacityInfo;\n#pragma header\nvarying lowp vec4 v_color;\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform mediump vec2 u_textTranslation;\nuniform vec2 u_mosaicSize;\nuniform mediump float u_depth;\nuniform mediump float u_mapRotation;\nuniform mediump float u_level;\nuniform lowp float u_keepUpright;\nuniform mediump float u_fadeDuration;\nvarying lowp vec2 v_tex;\nconst float offsetPrecision = 1.0 / 8.0;\nconst mediump float edgePos = 0.75;\nuniform mediump float u_antialiasingWidth;\nvarying mediump float v_edgeDistance;\nvarying mediump float v_edgeWidth;\nuniform lowp float u_halo;\nconst float sdfFontScale = 1.0 / 24.0;\nconst float sdfPixel = 3.0;\nuniform highp float u_time;\nvoid main()\n{\n#pragma main\nif (u_halo > 0.5)\n{\nv_color = halo_color * opacity;\nhalo_width *= sdfPixel;\nhalo_blur *= sdfPixel;\n}\nelse\n{\nv_color = color * opacity;\nhalo_width = 0.0;\nhalo_blur = 0.0;\n}\nfloat modded = mod(a_opacityInfo, 128.0);\nfloat targetOpacity = (a_opacityInfo - modded) / 128.0;\nfloat startOpacity = modded / 127.0;\nfloat interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0);\nv_color *= interpolatedOpacity;\nmediump float a_angle = a_levelInfo[1];\nmediump float a_minLevel = a_levelInfo[2];\nmediump float a_maxLevel = a_levelInfo[3];\nmediump vec2 a_tex = a_texAngleRange.xy;\nmediump float a_visMinAngle = a_texAngleRange.z;\nmediump float a_visMaxAngle = a_texAngleRange.w;\nmediump float delta_z = 0.0;\nmediump float angle = mod(a_angle + u_mapRotation, 256.0);\nif (a_visMinAngle < a_visMaxAngle)\n{\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) + (1.0 - step(a_visMinAngle, angle)));\n}\nelse\n{\ndelta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) * (1.0 - step(a_visMinAngle, angle)));\n}\ndelta_z += 1.0 - step(a_minLevel, u_level);\ndelta_z += step(a_maxLevel, u_level);\ndelta_z += step(v_color[3], 0.0);\nv_tex = a_tex.xy / u_mosaicSize;\nv_edgeDistance = edgePos - halo_width / size;\nv_edgeWidth = (u_antialiasingWidth + halo_blur) / size;\nmediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + sdfFontScale * u_displayViewMat3 * vec3(offsetPrecision * size * a_vertexOffset, 0.0) + u_displayMat3 * vec3(u_textTranslation, 0.0);\ngl_Position = vec4(pos.xy, u_depth + delta_z, 1.0);\n}"},util:{"encoding.glsl":"const vec4 rgba2float_factors = vec4(\n255.0 / (256.0),\n255.0 / (256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n);\nfloat rgba2float(vec4 rgba) {\nreturn dot(rgba, rgba2float_factors);\n}","util.glsl":"float nextPOT(in float x) {\nreturn pow(2.0, ceil(log2(abs(x))));\n}"}};export{e as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as r,subclass as e}from"../../../../core/accessorSupport/decorators.js";import{Deconflictor as o}from"./Deconflictor.js";import{Yield as s}from"../../../support/Yield.js";const i=2e3;let n=class extends o{constructor(t){super(t),this.visibilityGroup=16,this.marginFactor=.05,this._lastDeconfliction=0}get viewState(){return this.parent.viewState}runTask(t){if(this.parent.readyToRun)return s;const r=performance.now();if(2!==this.view.state.mode&&r-this._lastDeconfliction<i)return s;const e=super.runTask(t);return 0===this.state&&(this._lastDeconfliction=r),e}};t([r({constructOnly:!0})],n.prototype,"parent",void 0),n=t([e("esri.views.3d.layers.graphics.LabelDeconflictor")],n);export{n as LabelDeconflictor};
5
+ import{__decorate as t}from"tslib";import"../../../../core/has.js";import{property as r,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{Deconflictor as e}from"./Deconflictor.js";import{Yield as s}from"../../../support/Yield.js";const i=2e3;let n=class extends e{constructor(t){super(t),this.visibilityGroup=16,this.marginFactor=.05,this._lastDeconfliction=0}get viewState(){return this.parent.viewState}runTask(t){if(this.parent.readyToRun)return s;const r=performance.now();if(2!==this.view.state.mode&&r-this._lastDeconfliction<i)return s;const o=super.runTask(t);return 0===this.state&&(this._lastDeconfliction=r),o}};t([r({constructOnly:!0})],n.prototype,"parent",void 0),n=t([o("esri.views.3d.layers.graphics.LabelDeconflictor")],n);export{n as LabelDeconflictor};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{equals as i}from"../../../core/arrayUtils.js";import{watch as s,when as o,on as r}from"../../../core/reactiveUtils.js";import{property as a,subclass as n}from"../../../core/accessorSupport/decorators.js";import{getLyr3DWasm as l}from"../layers/Lyr3DWasm.js";import m from"../../support/AttributionItem.js";const h=Symbol("attributions"),u=new m("Google Maps",1e3);let d=class extends e{constructor(t){super(t),this.attributionItems=[],this.view=null,this._allLayerViewsChange=()=>{this.removeHandles("items");const t=this.view?.allLayerViews;let e=!1;if(t)for(const i of t)"integrated-mesh-3dtiles"===i.type&&(e=!0,this.addHandles([s(()=>i.suspended,()=>this._updateAttributionItems()),i.on("visible-geometry-changed",()=>this._updateAttributionItems())],h));e&&this.addHandles(o(()=>!0===this.view?.stationary,()=>this._updateAttributionItems()),h),this._updateAttributionItems()}}initialize(){this.addHandles([r(()=>this.view?.allLayerViews,"change",this._allLayerViewsChange,{onListenerAdd:this._allLayerViewsChange,onListenerRemove:()=>{this.removeHandles(h),this.attributionItems=[]}})])}destroy(){this.view=null,this.attributionItems=[]}_updateAttributionItems(){const t=this.view,e=t?.allLayerViews;if(!t||!e)return void(this.attributionItems.length&&(this.attributionItems=[]));if(!t.stationary)return;const s=[];let o=u.score-1;for(const i of e)if(!i.suspended&&"integrated-mesh-3dtiles"===i.type){i.layer.hasGoogleUrl&&s.push(u);const e=l(t);if(e){const t=e.getAttributionText();for(const e of t)s.push(new m(e,o--))}break}i(this.attributionItems,s,(t,e)=>t.text===e.text)||(this.attributionItems=s)}};t([a()],d.prototype,"attributionItems",void 0),t([a()],d.prototype,"view",void 0),d=t([n("esri.views.3d.support.Attribution3D")],d);const p=d;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{BlendModeTechniqueConfiguration as e}from"./BlendModeTechniqueConfiguration.js";import{parameter as t}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";class i extends e{constructor(){super(...arguments),this.output=1,this.baseOpacityMode=0,this.premultipliedSource=0}}o([t({count:5})],i.prototype,"output",void 0),o([t({count:2})],i.prototype,"baseOpacityMode",void 0),o([t({count:2})],i.prototype,"premultipliedSource",void 0);export{i as TileBlendTechniqueConfiguration};
5
+ import{__decorate as e}from"tslib";import{BlendModeTechniqueConfiguration as o}from"./BlendModeTechniqueConfiguration.js";import{parameter as t}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";class p extends o{constructor(){super(...arguments),this.output=1,this.premultipliedAlphaSource=!1,this.applyBaseOpacity=!1}}e([t({count:5})],p.prototype,"output",void 0),e([t()],p.prototype,"premultipliedAlphaSource",void 0),e([t()],p.prototype,"applyBaseOpacity",void 0);export{p as TileBlendTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Logger.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{ZEROS as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{VectorTileRendererHelper3D as i}from"../../2d/engine/vectorTiles/VectorTileRendererHelper3D.js";import{BlendLayersTechnique as s}from"./BlendLayersTechnique.js";import{BlendLayersTechniqueConfiguration as o}from"./BlendLayersTechniqueConfiguration.js";import{RasterColorizerTechnique as n}from"./RasterColorizerTechnique.js";import{RasterColorizerTechniqueConfiguration as a}from"./RasterColorizerTechniqueConfiguration.js";import{MultiSizeFramebuffer as h}from"./support/MultiSizeFramebuffer.js";import{BindParameters as c}from"../webgl-engine/lib/BindParameters.js";import{createQuadVAO as l}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as u}from"../../webgl/enums.js";import{Texture as d}from"../../webgl/Texture.js";const _=()=>e.getLogger("esri.views.3d.terrain");class f{constructor(e,t){this._rctx=e,this._techniques=t,this._fbos=[],this._vectorTileHelper=new i,this._bindParameters=new c(null),this._blendConfiguration=new o,this._current=0,this._lastUsedIds=new Array,this._lastCreatedBufferId=0,this._onHoldIds=new Array,this._vao=l(this._rctx,1)}dispose(){this._fbos.forEach(t),this._fbos=null,this._vtFBO=t(this._vtFBO),this._vao=t(this._vao),this._vectorTileHelper=t(this._vectorTileHelper)}updateHeading(e){this._vectorTileHelper?.updateHeading(e)}_acquireBlendTechnique(e,t,r,i=0,o=0){return this._blendConfiguration.output=t,this._blendConfiguration.blendMode=e,this._blendConfiguration.baseOpacityMode=r,this._blendConfiguration.premultipliedSource=i,this._blendConfiguration.background=o,this._techniques.precompile(s,this._blendConfiguration),this._techniques.get(s,this._blendConfiguration)}drawBackground(e,t){const r=this._acquireBlendTechnique(0,t?2:3,0,0,1),i=this._rctx.bindTechnique(r,this._bindParameters,e);this._render(i)}_render(e){this._rctx.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),this._rctx.drawArrays(u.TRIANGLE_STRIP,0,this._vao.vertexCount("geometry"))}drawGroup(e,t,r,i,s=1){1===t&&(e.fboTexture=this._fbos[this.getLastOnHoldId()].get(r).colorTexture,null==e.fboTexture&&(e.fboTexture=this._rctx.emptyTexture)),e.texture=this.currentFBO(r).colorTexture,this.closeGroup(r);const o=e.baseOpacity<1?1:0,n=this._acquireBlendTechnique(i,t,o,s),a=this._rctx.bindTechnique(n,this._bindParameters,e);this._render(a)}drawImageData(e,t,r,i,s=0){if(null==e.texture)return;const o=e.baseOpacity<1?1:0;e.fboTexture=4===t||0===i&&0===o&&0===s?null:this.switch(r).colorTexture,null==e.fboTexture&&(e.fboTexture=this._rctx.emptyTexture);const n=this._acquireBlendTechnique(i,t,o,s),a=this._rctx.bindTechnique(n,this._bindParameters,e);this._render(a)}drawRasterData(e,t,r,i,s){const o=s.sourceLayerInfo.data;if(!o.source)return;if(s.tile.surface.layerViewByIndex(s.layerIndex,1).ensureSymbolizerParameters(o),!o.bind(this._rctx))return;const n=e.baseOpacity<1?1:0;e.fboTexture=0===i&&0===n?null:this.switch(r).colorTexture;const a=this._acquireRasterTechnique(o,t,i,n);if(!a)return;o.opacity=e.opacity;const h=o.getUniforms(this._rctx);h.scale=s.scale,h.offset=s.offset,h.backgroundColor=e.backgroundColor,h.fboTexture=e.fboTexture,h.baseOpacity=e.baseOpacity;const c=this._rctx.bindTechnique(a,this._bindParameters,h);this._render(c)}_acquireRasterTechnique(e,t,r,i){if(!this._rctx.capabilities.colorBufferFloat)return null;const s=e.symbolizerParameters,o=["stretch","lut","hillshade"].indexOf(s.type);return this._rasterConfiguration??=new a,this._rasterConfiguration.output=t,this._rasterConfiguration.blendMode=r,this._rasterConfiguration.baseOpacityMode=i,this._rasterConfiguration.colorizerType=o,this._rasterConfiguration.applyColormap=!!s.colormap,this._rasterConfiguration.requireBilinearWithNN=e.isBilinearWithStretchColorRamp,this._rasterConfiguration.stretchType=e.hasStretchTypeNone()?0:1,this._techniques.precompile(n,this._rasterConfiguration),this._techniques.get(n,this._rasterConfiguration)}drawVectorData(e,t,i,s,o,n,a,c){const l=this._rctx,u=o.sourceLayerInfo.data,d=o.tile.surface.layerViewByIndex(o.layerIndex,1),f=e.baseOpacity<1?1:0,p=1===f||e.opacity<1||0!==s||1!==t,b=p?1:0,g=this._acquireBlendTechnique(s,t,f,b);l.setPipelineState(g.getPipeline());let m=null,x=null;p?(x=this.currentFBO(i),null==this._vtFBO&&(this._vtFBO=new h(this._rctx)),m=this._vtFBO.get(i),l.bindFramebuffer(m),this._clearCurrentFBO()):c&&l.clear(256);try{this._vectorTileHelper.renderBackground(l,o.sourceLod,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/o.scale),o.offset,a,n,d.contentZoom),u&&this._vectorTileHelper.renderContent(l,o.sourceLod,u,o.vtlNeighborInfos,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/o.scale),o.offset,a,n,d.contentZoom)}catch(T){_().warnOnce("A render call containing vector tiles did not resolve correctly.",T)}return!m||(l.bindFramebuffer(x),e.texture=m.colorTexture,e.offset=r,e.scale=1,this.drawImageData(e,t,i,s,b),c)}copyFBOToTexture(e){const t=this._rctx,r=t.bindTexture(e.texture,d.TEXTURE_UNIT_FOR_UPDATES),i=e.descriptor;t.gl.copyTexImage2D(3553,0,i.pixelFormat,0,0,i.width,i.height,0),e.generateMipmap(),t.bindTexture(r,d.TEXTURE_UNIT_FOR_UPDATES)}_clearCurrentFBO(){this._rctx.setStencilWriteMask(255),this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.setClearStencil(0),this._rctx.clear(17664)}_initFBO(e,t,r){this._rctx.bindFramebuffer(e),r&&(this._rctx.setViewport(0,0,t,t),this._clearCurrentFBO())}ensureBuffer(e){this._lastUsedIds.length=0,this._lastUsedIds.push(1),this._lastCreatedBufferId=1,this._onHoldIds.length=0,this.bind(e)}bind(e,t=0,r=!0){if(this._current=t,t>=this._fbos.length)for(let i=this._fbos.length;i<=t;i++)this._fbos.push(new h(this._rctx));this._initFBO(this._fbos[t].get(e),e,r)}_bindNextFreeBuffer(e){this._lastUsedIds.length>0?this.bind(e,this._lastUsedIds.pop()):(this._lastCreatedBufferId++,this.bind(e,this._lastCreatedBufferId))}openGroup(e){this._onHoldIds.push(this._current),this._bindNextFreeBuffer(e)}switch(e){const t=this.currentFBO(e),r=this._current;return this._bindNextFreeBuffer(e),this._lastUsedIds.push(r),t}getLastOnHoldId(){return this._onHoldIds[this._onHoldIds.length-1]}closeGroup(e){const t=this._current;this._bindNextFreeBuffer(e),this._lastUsedIds.push(t),this._lastUsedIds.push(this._onHoldIds.pop())}unbind(){this._rctx.bindFramebuffer(null)}currentFBO(e){return this._fbos[this._current].get(e)}}export{f as TileCompositor};
5
+ import e from"../../../core/Logger.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{ZEROS as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{VectorTileRendererHelper3D as i}from"../../2d/engine/vectorTiles/VectorTileRendererHelper3D.js";import{BlendLayersTechnique as s}from"./BlendLayersTechnique.js";import{BlendLayersTechniqueConfiguration as o}from"./BlendLayersTechniqueConfiguration.js";import{RasterColorizerTechnique as n}from"./RasterColorizerTechnique.js";import{RasterColorizerTechniqueConfiguration as a}from"./RasterColorizerTechniqueConfiguration.js";import{MultiSizeFramebuffer as h}from"./support/MultiSizeFramebuffer.js";import{BindParameters as l}from"../webgl-engine/lib/BindParameters.js";import{createQuadVAO as c}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as u}from"../../webgl/enums.js";import{Texture as d}from"../../webgl/Texture.js";const _=()=>e.getLogger("esri.views.3d.terrain");class f{constructor(e,t){this._rctx=e,this._techniques=t,this._fbos=[],this._vectorTileHelper=new i,this._bindParameters=new l(null),this._blendConfiguration=new o,this._current=0,this._lastUsedIds=new Array,this._lastCreatedBufferId=0,this._onHoldIds=new Array,this._vao=c(this._rctx,1)}dispose(){this._fbos.forEach(t),this._fbos=null,this._vtFBO=t(this._vtFBO),this._vao=t(this._vao),this._vectorTileHelper=t(this._vectorTileHelper)}updateHeading(e){this._vectorTileHelper?.updateHeading(e)}_acquireBlendTechnique(e,t,r,i=!1,o=0){return this._blendConfiguration.output=t,this._blendConfiguration.blendMode=e,this._blendConfiguration.applyBaseOpacity=r,this._blendConfiguration.premultipliedAlphaSource=i,this._blendConfiguration.background=o,this._techniques.precompile(s,this._blendConfiguration),this._techniques.get(s,this._blendConfiguration)}drawBackground(e,t){const r=this._acquireBlendTechnique(0,t?2:3,!1,!1,1),i=this._rctx.bindTechnique(r,this._bindParameters,e);this._render(i)}_render(e){this._rctx.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),this._rctx.drawArrays(u.TRIANGLE_STRIP,0,this._vao.vertexCount("geometry"))}drawGroup(e,t,r,i,s=!0){1===t&&(e.fboTexture=this._fbos[this.getLastOnHoldId()].get(r).colorTexture,null==e.fboTexture&&(e.fboTexture=this._rctx.emptyTexture)),e.texture=this.currentFBO(r).colorTexture,this.closeGroup(r);const o=e.baseOpacity<1,n=this._acquireBlendTechnique(i,t,o,s),a=this._rctx.bindTechnique(n,this._bindParameters,e);this._render(a)}drawImageData(e,t,r,i,s=!1){if(null==e.texture)return;const o=e.baseOpacity<1;e.fboTexture=4===t||0===i&&!o&&!s?null:this.switch(r).colorTexture,null==e.fboTexture&&(e.fboTexture=this._rctx.emptyTexture);const n=this._acquireBlendTechnique(i,t,o,s),a=this._rctx.bindTechnique(n,this._bindParameters,e);this._render(a)}drawRasterData(e,t,r,i,s){const o=s.sourceLayerInfo.data;if(!o.source)return;if(s.tile.surface.layerViewByIndex(s.layerIndex,1).ensureSymbolizerParameters(o),!o.bind(this._rctx))return;const n=e.baseOpacity<1;e.fboTexture=0!==i||n?this.switch(r).colorTexture:null;const a=this._acquireRasterTechnique(o,t,i,n);if(!a)return;o.opacity=e.opacity;const h=o.getUniforms(this._rctx);h.scale=s.scale,h.offset=s.offset,h.backgroundColor=e.backgroundColor,h.fboTexture=e.fboTexture,h.baseOpacity=e.baseOpacity;const l=this._rctx.bindTechnique(a,this._bindParameters,h);this._render(l)}_acquireRasterTechnique(e,t,r,i){if(!this._rctx.capabilities.colorBufferFloat)return null;const s=e.symbolizerParameters,o=["stretch","lut","hillshade"].indexOf(s.type);return this._rasterConfiguration??=new a,this._rasterConfiguration.output=t,this._rasterConfiguration.blendMode=r,this._rasterConfiguration.applyBaseOpacity=i,this._rasterConfiguration.colorizerType=o,this._rasterConfiguration.applyColormap=!!s.colormap,this._rasterConfiguration.requireBilinearWithNN=e.isBilinearWithStretchColorRamp,this._rasterConfiguration.stretchType=e.hasStretchTypeNone()?0:1,this._techniques.precompile(n,this._rasterConfiguration),this._techniques.get(n,this._rasterConfiguration)}drawVectorData(e,t,i,s,o,n,a,l){const c=this._rctx,u=o.sourceLayerInfo.data,d=o.tile.surface.layerViewByIndex(o.layerIndex,1),f=e.baseOpacity<1,p=f||e.opacity<1||0!==s||1!==t,b=p,g=this._acquireBlendTechnique(s,t,f,b);c.setPipelineState(g.getPipeline());let m=null,x=null;p?(x=this.currentFBO(i),null==this._vtFBO&&(this._vtFBO=new h(this._rctx)),m=this._vtFBO.get(i),c.bindFramebuffer(m),this._clearCurrentFBO()):l&&c.clear(256);try{this._vectorTileHelper.renderBackground(c,o.sourceLod,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/o.scale),o.offset,a,n,d.contentZoom),u&&this._vectorTileHelper.renderContent(c,o.sourceLod,u,o.vtlNeighborInfos,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/o.scale),o.offset,a,n,d.contentZoom)}catch(T){_().warnOnce("A render call containing vector tiles did not resolve correctly.",T)}return!m||(c.bindFramebuffer(x),e.texture=m.colorTexture,e.offset=r,e.scale=1,this.drawImageData(e,t,i,s,b),l)}copyFBOToTexture(e){const t=this._rctx,r=t.bindTexture(e.texture,d.TEXTURE_UNIT_FOR_UPDATES),i=e.descriptor;t.gl.copyTexImage2D(3553,0,i.pixelFormat,0,0,i.width,i.height,0),e.generateMipmap(),t.bindTexture(r,d.TEXTURE_UNIT_FOR_UPDATES)}_clearCurrentFBO(){this._rctx.setStencilWriteMask(255),this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.setClearStencil(0),this._rctx.clear(17664)}_initFBO(e,t,r){this._rctx.bindFramebuffer(e),r&&(this._rctx.setViewport(0,0,t,t),this._clearCurrentFBO())}ensureBuffer(e){this._lastUsedIds.length=0,this._lastUsedIds.push(1),this._lastCreatedBufferId=1,this._onHoldIds.length=0,this.bind(e)}bind(e,t=0,r=!0){if(this._current=t,t>=this._fbos.length)for(let i=this._fbos.length;i<=t;i++)this._fbos.push(new h(this._rctx));this._initFBO(this._fbos[t].get(e),e,r)}_bindNextFreeBuffer(e){this._lastUsedIds.length>0?this.bind(e,this._lastUsedIds.pop()):(this._lastCreatedBufferId++,this.bind(e,this._lastCreatedBufferId))}openGroup(e){this._onHoldIds.push(this._current),this._bindNextFreeBuffer(e)}switch(e){const t=this.currentFBO(e),r=this._current;return this._bindNextFreeBuffer(e),this._lastUsedIds.push(r),t}getLastOnHoldId(){return this._onHoldIds[this._onHoldIds.length-1]}closeGroup(e){const t=this._current;this._bindNextFreeBuffer(e),this._lastUsedIds.push(t),this._lastUsedIds.push(this._onHoldIds.pop())}unbind(){this._rctx.bindFramebuffer(null)}currentFBO(e){return this._fbos[this._current].get(e)}}export{f as TileCompositor};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../core/has.js";import{disposeMaybe as e,releaseMaybe as t}from"../../../core/maybe.js";import{set as r,copy as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as o}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isBaseLayer as a,isGroupLayer as n,isReferenceLayer as c}from"../../../layers/support/layerUtils.js";import{isLayerViewWithFlowRenderer as u}from"../support/flowUtils.js";import{BlendLayersPassParameters as l}from"./BlendLayersTechnique.js";import{isImageWithType as p}from"./TerrainData.js";import{isBlendableLayerView as h,isVectorTileLayerView as d,isVectorTileRenderInfo as m,isImageryTileRenderInfo as f,isImageSourceRenderInfo as _,isTextureTileRenderInfo as x,isVectorTilePerLayerInfo as T}from"./terrainUtils.js";import{TextureReference as b}from"./TextureReference.js";import{TileCompositor as y}from"./TileCompositor.js";import{TileRenderInfo as g}from"./TileRenderInfo.js";import{TileTexture as w,getCacheKey as k}from"./TileTexture.js";import{fallsWithinLayerView as I}from"./tileUtils.js";import{blendModeFromString as j}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{createEmptyTexture as O}from"../webgl-engine/lib/glUtil3D.js";import{isCompressible as P}from"../../support/TextureCompressionWorkerHandle.js";import{Texture as L}from"../../webgl/Texture.js";import{TextureDescriptor as B}from"../../webgl/TextureDescriptor.js";class C{constructor(e,t,r,s,o,i){this.start=e,this.end=t,this.blendMode=r,this.opacity=s,this.output=o,this.baseOpacity=i}}class M{constructor(e,t,r,s,o){this._rctx=e,this.tileSize=t,this._techniques=r,this._cache=s,this._compressionTracker=o,this._passParameters=new l,this._backgroundColor=null,this._maxAnisotropy=this._rctx.parameters.maxMaxAnisotropy,this._compositor=new y(this._rctx,this._techniques)}dispose(){this._compositor=e(this._compositor),this._backgroundTexture=t(this._backgroundTexture)}get backgroundIsGrid(){return null==this._backgroundColor}get backgroundColor(){return this._backgroundColor}updateHeading(e){this._compositor?.updateHeading(e)}updateTileTexture(e,t){if(!e.renderData)return;const r=e.surface,s=r.baseOpacity;let o=0,i=0,l=this.tileSize,p=!1,m=!1;const f=r.view.state.contentPixelRatio;let _=!1;A.clear(),S.length=0;const x=e.layerInfo[1];let T=0,b=null;for(;T<x.length;T++){const t=r.layerViewByIndex(T,1),y=t.layer,g=!I(e,t),w=y.opacity,k=t.fullOpacity;if(m=m||a(y),u(t))continue;if(h(t)){let e="normal"!==t.layer.blendMode;if(n(y.parent)){const t=y.parent.uid;null!=t&&""!==t&&(e=U(y.parent)||e)}e&&(_=e,p=!1)}if((g||0===w)&&!_){x[T].pendingUpdates&=-1;continue}++i;const j=d(t),O=D(e,T,j);if(O){if(x[T].pendingUpdates&=-1,n(y.parent)){const e=y.parent.uid;null!=e&&""!==e&&v(y.parent,T)}j?l=Math.max(l,this.tileSize*f):1===s&&1===k&&(t.isOpaque||this._dataToTexture(O,c(y))&&O.sourceLayerInfo.data.descriptor.isOpaque)&&(p=!0),++o,null===b&&(b=T)}}const y=l/this.tileSize;0!==o&&null!==b?1===o&&!_&&this._useLayerTexture(e,b)||this._composeLayers(e,t,T-1,m,l,y,!p||_,A,_):this._useBackgroundTexture(e,i,0!==t)}setBackground(e){this._backgroundColor!==e&&(this._backgroundColor=e,this._backgroundTexture&&this._drawBackgroundTexture(this._backgroundTexture))}_ensureBackgroundTexture(){return null==this._backgroundTexture&&(this._backgroundTexture=this._buildTexture(this.tileSize,!1),this._drawBackgroundTexture(this._backgroundTexture)),this._backgroundTexture}_drawBackgroundTexture(e){this._compositor.bind(this.tileSize),this._passParameters.offset=o,this._passParameters.scale=1,this._passParameters.opacity=1,this.backgroundColor&&(this._passParameters.backgroundColor=this.backgroundColor),this._compositor.drawBackground(this._passParameters,null!=this.backgroundColor),this._compositor.copyFBOToTexture(e),this._compositor.unbind()}_useBackgroundTexture(e,t,r){const s=e.renderData,o=!r&&null!=s.textureReference&&(e.surface.view.layerViewManager.updating||t>0)?5e3:0,i=this._ensureBackgroundTexture();s.setTextureReference(new b(i,0,E,e.surface.baseOpacity,0,1),o)}_useLayerTexture(e,t){const r=e.surface.layerViewByIndex(t,1),s=a(r.layer),o=s?e.surface.baseOpacity:1,n=s?1:e.surface.baseOpacity,u=r.fullOpacity,l=D(e,t,!1);return!!this._dataToTexture(l,c(r.layer))&&(e.renderData.setTextureReference(new b(l.sourceLayerInfo.data,0,i(l.offset[0],l.offset[1],l.scale,l.scale),o,n,u)),!0)}_composeLayers(e,t,r,s,i,n,l,p,_){this._compositor.ensureBuffer(i);const x=e.surface.baseOpacity;let T=!1,y=9987,g=!1,w=0;for(let b=r;b>=0;b--){const t=e.surface.layerViewByIndex(b,1),r=t.layer,k=d(t),O=D(e,b,k),P=r.opacity,L=!I(e,t);if(!O||(0===P||L)&&!_)continue;if(u(t))continue;const B=!a(r)&&!T;B&&(T=!0);let C=!1;p.forEach(e=>{e.start===b&&(e.output=s?1:l&&B?this.backgroundIsGrid?3:2:1,e.baseOpacity=B?x:1,S.push(e),this._compositor.openGroup(i),C=!0)});const M=C?4:l&&0===w?this.backgroundIsGrid?3:2:1,U=j[h(t)?t.layer.blendMode:"normal"];for(this._passParameters.baseOpacity=B&&!C&&x<1?x:1,this._passParameters.opacity=P,m(O)?g=this._compositor.drawVectorData(this._passParameters,M,i,U,O,n,this.tileSize,g):f(O)?(this._compositor.drawRasterData(this._passParameters,M,i,U,O),R(O)&&(y=9728)):this._dataToTexture(O,c(r))&&(this._passParameters.texture=O.sourceLayerInfo.data.texture,this._passParameters.offset=O.offset,this._passParameters.scale=O.scale,this._compositor.drawImageData(this._passParameters,M,i,U));S.length>0&&S[S.length-1].end===b;){const e=S.pop();this._passParameters.baseOpacity=e.baseOpacity,this._passParameters.opacity=e.opacity,this._passParameters.offset=o,this._passParameters.scale=1,this._compositor.drawGroup(this._passParameters,e.output,i,j[e.blendMode])}w++}const k=e.renderData,O=_||T&&x<1,P=k.ensureTexture(i,O,t,()=>this._buildTexture(i,O,y));this._compositor.copyFBOToTexture(P),this._compositor.unbind(),k.setTextureReference(new b(P,t,E,T?1:x,0,1))}_dataToTexture(e,t){if(_(e)){const r=e.sourceLayerInfo,s=1===e.scale&&!t;r.data=this._buildTexture(r.data,!0,s,e.tile.onCompressionFinished),e.tile.setMemoryDirty()}return x(e)}_buildTexture(e,t,r=9987,s=()=>{}){if(null==e)return null;const o=new B;o.wrapMode=33071,o.samplingMode="boolean"==typeof r?9987:r,o.maxAnisotropy=this._maxAnisotropy,o.preMultiplyAlpha=!0,o.flipped=!0,o.hasMipmap=!0,t||(o.pixelFormat=6407);const i=this._rctx,a="boolean"==typeof r&&r;let n;if("number"==typeof e)o.width=o.height=e,n=this._buildTileTexture(o);else if(p(e))o.isOpaque=e.isOpaque,o.isOpaque&&(o.pixelFormat=6407),o.width=e.element.width,o.height=e.element.height,n=this._buildTileTexture(o,a,s,e.element);else try{o.width=e.width,o.height=e.height,n=this._buildTileTexture(o,a,s,e)}catch(u){n=new w(O(i)),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}const c=i.bindTexture(n.texture,L.TEXTURE_UNIT_FOR_UPDATES);return n.generateMipmap(),i.bindTexture(c,L.TEXTURE_UNIT_FOR_UPDATES),n}_buildTileTexture(e,t=!1,r=()=>{},s){const o=this._cache.pop(k(e,!1))??this._cache.pop(k(e,!0));if(t&&=P(s,e),o)return o.retain(),t?o.texture.enableCompression({compressionTracker:this._compressionTracker,compressionCallback:r}):o.texture.disableCompression(),o.texture.setData(s),o;e.compress=t?{compressionTracker:this._compressionTracker,compressionCallback:r}:void 0;const i=new L(this._rctx,e,s);return new w(i,this._cache)}get test(){}}function D(e,t,o){q.layerIndex=t,q.vtlNeighborInfos.clear();const i=e.layerInfo[1][t];if(r(q.offset,0,0),q.tile=e,q.scale=1,q.sourceLod=e.lij,q.sourceLayerInfo=i,q.isVTLBackground=o,i.data)return o&&e.forEachLoadedNeighbor((r,s)=>{if(r.level!==e.level)return;const o=r.layerInfo[1][t];if(!T(o)||i.data===o.data)return;const a=q.vtlNeighborInfos.pushNew();a.offset=z[s],a.sourceLod=r.lij,a.sourceLayerInfo=o}),q;const a=i.upsampleInfo,n=a?.tile?.layerInfo[1][t];return n&&a.tile?(q.tile=a.tile,s(q.offset,a.offset),q.scale=a.scale,q.sourceLod=a.tile.lij,q.sourceLayerInfo=n,q):o?q:null}function R(e){const t=e.sourceLayerInfo.data;return!!t.source&&"nearest"===t.interpolation}function U(e){let t="normal"!==e.blendMode;return n(e.parent)&&(t=U(e.parent)||t),t}function v(e,t){n(e.parent)&&v(e.parent,t);const r=e.uid;if(null!=r&&""!==r){const s=A.get(r);s?s.start=t:A.set(r,new C(t,t,e.blendMode,e.opacity,1,1))}}const A=new Map,S=new Array,q=new g,E=i(0,0,1,1),z=new Array;function F(){q.sourceLayerInfo=null,q.tile=null,q.vtlNeighborInfos.prune()}z[0]=[0,-1],z[1]=[-1,-1],z[2]=[-1,0],z[3]=[-1,1],z[4]=[0,1],z[5]=[1,1],z[6]=[1,0],z[7]=[1,-1];export{C as GroupInfo,M as TileRenderer,F as cleanupTileRenderer};
5
+ import"../../../core/has.js";import{disposeMaybe as e,releaseMaybe as t}from"../../../core/maybe.js";import{set as r,copy as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as o}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isBaseLayer as a,isGroupLayer as n,isReferenceLayer as c}from"../../../layers/support/layerUtils.js";import{isLayerViewWithFlowRenderer as u}from"../support/flowUtils.js";import{BlendLayersPassParameters as l}from"./BlendLayersTechnique.js";import{isImageWithType as p}from"./TerrainData.js";import{isBlendableLayerView as h,isVectorTileLayerView as d,isVectorTileRenderInfo as m,isImageryTileRenderInfo as f,isImageSourceRenderInfo as _,isTextureTileRenderInfo as x,isVectorTilePerLayerInfo as T}from"./terrainUtils.js";import{TextureReference as b}from"./TextureReference.js";import{TileCompositor as y}from"./TileCompositor.js";import{TileRenderInfo as g}from"./TileRenderInfo.js";import{TileTexture as w,getCacheKey as k}from"./TileTexture.js";import{fallsWithinLayerView as I}from"./tileUtils.js";import{blendModeFromString as j}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{createEmptyTexture as O}from"../webgl-engine/lib/glUtil3D.js";import{isCompressible as P}from"../../support/TextureCompressionWorkerHandle.js";import{Texture as L}from"../../webgl/Texture.js";import{TextureDescriptor as B}from"../../webgl/TextureDescriptor.js";class C{constructor(e,t,r,s,o,i){this.start=e,this.end=t,this.blendMode=r,this.opacity=s,this.output=o,this.baseOpacity=i}}class M{constructor(e,t,r,s,o){this._rctx=e,this.tileSize=t,this._techniques=r,this._cache=s,this._compressionTracker=o,this._passParameters=new l,this._backgroundColor=null,this._maxAnisotropy=this._rctx.parameters.maxMaxAnisotropy,this._compositor=new y(this._rctx,this._techniques)}dispose(){this._compositor=e(this._compositor),this._backgroundTexture=t(this._backgroundTexture)}get backgroundIsGrid(){return null==this._backgroundColor}get backgroundColor(){return this._backgroundColor}updateHeading(e){this._compositor?.updateHeading(e)}updateTileTexture(e,t){if(!e.renderData)return;const r=e.surface,s=r.baseOpacity;let o=0,i=0,l=this.tileSize,p=!1,m=!1;const f=r.view.state.contentPixelRatio;let _=!1;A.clear(),S.length=0;const x=e.layerInfo[1];let T=0,b=null;for(;T<x.length;T++){const t=r.layerViewByIndex(T,1),y=t.layer,g=!I(e,t),w=y.opacity,k=t.fullOpacity;if(m=m||a(y),u(t))continue;if(h(t)){let e="normal"!==t.layer.blendMode;if(n(y.parent)){const t=y.parent.uid;null!=t&&""!==t&&(e=U(y.parent)||e)}e&&(_=e,p=!1)}if((g||0===w)&&!_){x[T].pendingUpdates&=-1;continue}++i;const j=d(t),O=D(e,T,j);if(O){if(x[T].pendingUpdates&=-1,n(y.parent)){const e=y.parent.uid;null!=e&&""!==e&&v(y.parent,T)}j?l=Math.max(l,this.tileSize*f):1===s&&1===k&&(t.isOpaque||this._dataToTexture(O,c(y))&&O.sourceLayerInfo.data.descriptor.isOpaque)&&(p=!0),++o,null===b&&(b=T)}}const y=l/this.tileSize;0!==o&&null!==b?1===o&&!_&&this._useLayerTexture(e,b)||this._composeLayers(e,t,T-1,m,l,y,!p||_,A,_):this._useBackgroundTexture(e,i,0!==t)}setBackground(e){this._backgroundColor!==e&&(this._backgroundColor=e,this._backgroundTexture&&this._drawBackgroundTexture(this._backgroundTexture))}_ensureBackgroundTexture(){return null==this._backgroundTexture&&(this._backgroundTexture=this._buildTexture(this.tileSize,!1),this._drawBackgroundTexture(this._backgroundTexture)),this._backgroundTexture}_drawBackgroundTexture(e){this._compositor.bind(this.tileSize),this._passParameters.offset=o,this._passParameters.scale=1,this._passParameters.opacity=1,this.backgroundColor&&(this._passParameters.backgroundColor=this.backgroundColor),this._compositor.drawBackground(this._passParameters,null!=this.backgroundColor),this._compositor.copyFBOToTexture(e),this._compositor.unbind()}_useBackgroundTexture(e,t,r){const s=e.renderData,o=!r&&null!=s.textureReference&&(e.surface.view.layerViewManager.updating||t>0)?5e3:0,i=this._ensureBackgroundTexture();s.setTextureReference(new b(i,0,E,e.surface.baseOpacity,0,1),o)}_useLayerTexture(e,t){const r=e.surface.layerViewByIndex(t,1),s=a(r.layer),o=s?e.surface.baseOpacity:1,n=s?1:e.surface.baseOpacity,u=r.fullOpacity,l=D(e,t,!1);return!!this._dataToTexture(l,c(r.layer))&&(e.renderData.setTextureReference(new b(l.sourceLayerInfo.data,0,i(l.offset[0],l.offset[1],l.scale,l.scale),o,n,u)),!0)}_composeLayers(e,t,r,s,i,n,l,p,_){this._compositor.ensureBuffer(i);const x=e.surface.baseOpacity;let T=!1,y=9987,g=!1,w=0;for(let b=r;b>=0;b--){const t=e.surface.layerViewByIndex(b,1),r=t.layer,k=d(t),O=D(e,b,k),P=r.opacity,L=!I(e,t);if(!O||(0===P||L)&&!_)continue;if(u(t))continue;const B=!a(r)&&!T;T||=B;let C=!1;p.forEach(e=>{e.start===b&&(e.output=s?1:l&&B?this.backgroundIsGrid?3:2:1,e.baseOpacity=B?x:1,S.push(e),this._compositor.openGroup(i),C=!0)});const M=C?4:l&&0===w?this.backgroundIsGrid?3:2:1,U=j[h(t)?t.layer.blendMode:"normal"];for(this._passParameters.baseOpacity=B&&!C&&x<1?x:1,this._passParameters.opacity=P,m(O)?g=this._compositor.drawVectorData(this._passParameters,M,i,U,O,n,this.tileSize,g):f(O)?(this._compositor.drawRasterData(this._passParameters,M,i,U,O),R(O)&&(y=9728)):this._dataToTexture(O,c(r))&&(this._passParameters.texture=O.sourceLayerInfo.data.texture,this._passParameters.offset=O.offset,this._passParameters.scale=O.scale,this._compositor.drawImageData(this._passParameters,M,i,U));S.length>0&&S[S.length-1].end===b;){const e=S.pop();this._passParameters.baseOpacity=e.baseOpacity,this._passParameters.opacity=e.opacity,this._passParameters.offset=o,this._passParameters.scale=1,this._compositor.drawGroup(this._passParameters,e.output,i,j[e.blendMode])}w++}const k=e.renderData,O=_||T&&x<1,P=k.ensureTexture(i,O,t,()=>this._buildTexture(i,O,y));this._compositor.copyFBOToTexture(P),this._compositor.unbind(),k.setTextureReference(new b(P,t,E,T?1:x,0,1))}_dataToTexture(e,t){if(_(e)){const r=e.sourceLayerInfo,s=1===e.scale&&!t;r.data=this._buildTexture(r.data,!0,s,e.tile.onCompressionFinished),e.tile.setMemoryDirty()}return x(e)}_buildTexture(e,t,r=9987,s=()=>{}){if(null==e)return null;const o=new B;o.wrapMode=33071,o.samplingMode="boolean"==typeof r?9987:r,o.maxAnisotropy=this._maxAnisotropy,o.preMultiplyAlpha=!0,o.flipped=!0,o.hasMipmap=!0,t||(o.pixelFormat=6407);const i=this._rctx,a="boolean"==typeof r&&r;let n;if("number"==typeof e)o.width=o.height=e,n=this._buildTileTexture(o);else if(p(e))o.isOpaque=e.isOpaque,o.isOpaque&&(o.pixelFormat=6407),o.width=e.element.width,o.height=e.element.height,n=this._buildTileTexture(o,a,s,e.element);else try{o.width=e.width,o.height=e.height,n=this._buildTileTexture(o,a,s,e)}catch(u){n=new w(O(i)),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}const c=i.bindTexture(n.texture,L.TEXTURE_UNIT_FOR_UPDATES);return n.generateMipmap(),i.bindTexture(c,L.TEXTURE_UNIT_FOR_UPDATES),n}_buildTileTexture(e,t=!1,r=()=>{},s){const o=this._cache.pop(k(e,!1))??this._cache.pop(k(e,!0));if(t&&=P(s,e),o)return o.retain(),t?o.texture.enableCompression({compressionTracker:this._compressionTracker,compressionCallback:r}):o.texture.disableCompression(),o.texture.setData(s),o;e.compress=t?{compressionTracker:this._compressionTracker,compressionCallback:r}:void 0;const i=new L(this._rctx,e,s);return new w(i,this._cache)}get test(){}}function D(e,t,o){q.layerIndex=t,q.vtlNeighborInfos.clear();const i=e.layerInfo[1][t];if(r(q.offset,0,0),q.tile=e,q.scale=1,q.sourceLod=e.lij,q.sourceLayerInfo=i,q.isVTLBackground=o,i.data)return o&&e.forEachLoadedNeighbor((r,s)=>{if(r.level!==e.level)return;const o=r.layerInfo[1][t];if(!T(o)||i.data===o.data)return;const a=q.vtlNeighborInfos.pushNew();a.offset=z[s],a.sourceLod=r.lij,a.sourceLayerInfo=o}),q;const a=i.upsampleInfo,n=a?.tile?.layerInfo[1][t];return n&&a.tile?(q.tile=a.tile,s(q.offset,a.offset),q.scale=a.scale,q.sourceLod=a.tile.lij,q.sourceLayerInfo=n,q):o?q:null}function R(e){const t=e.sourceLayerInfo.data;return!!t.source&&"nearest"===t.interpolation}function U(e){let t="normal"!==e.blendMode;return n(e.parent)&&(t=U(e.parent)||t),t}function v(e,t){n(e.parent)&&v(e.parent,t);const r=e.uid;if(null!=r&&""!==r){const s=A.get(r);s?s.start=t:A.set(r,new C(t,t,e.blendMode,e.opacity,1,1))}}const A=new Map,S=new Array,q=new g,E=i(0,0,1,1),z=new Array;function F(){q.sourceLayerInfo=null,q.tile=null,q.vtlNeighborInfos.prune()}z[0]=[0,-1],z[1]=[-1,-1],z[2]=[-1,0],z[3]=[-1,1],z[4]=[0,1],z[5]=[1,1],z[6]=[1,0],z[7]=[1,-1];export{C as GroupInfo,M as TileRenderer,F as cleanupTileRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as s}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{I as o,m as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as n}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as l}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ComponentTechnique as p}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as c}from"./ComponentTechniqueConfiguration.js";import{parameter as d,parameterBlock as m,MaterialBase as v,MaterialParameterBlock as g}from"../../../core/material/MaterialBase.js";import{isColor as f}from"../../../core/shaderLibrary/ShaderOutput.js";import{TextureBackedBufferParameters as x}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{TwoVectorPosition as y}from"../../../core/util/TwoVectorPosition.js";import{advancedMRRFactors as M}from"../../../materials/pbrUtils.js";import{defaultHighlightName as b}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as T}from"../../../../../../webscene/support/AlphaCutoff.js";class S extends v{constructor(e,o,i,n){super(),this.toMapSpace=o,this.useENUForGlobalOverlayUV=i,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.sphereDepthInterpolate=!1,this.mrrFactors=M,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=0,this.commonMaterialParameters=new C,this.componentParameters=new O,this.textureBackedBufferParameters=new x,this.objectOpacity=1,this.textureAlphaCutoff=T,this.alphaDiscardMode=1,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=1,this.hasOccludees=!1;const l=s(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l;const u=new y(e.position);this.transformWorldFromModelTL=u.low,this.transformWorldFromModelTH=u.high,this.transformWorldFromModelRS=e.rotationScale,this._configuration=new c(n),this._updateMaterialConfiguration()}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get _hasEmissiveBase(){return null!=this.emissionTexture||!i(this.emissiveBaseColor,n)}get _hasEmissiveStrength(){return 2!==this.componentParameters.emissiveOverride}get hasEmissions(){return this._hasEmissiveStrength&&(this._hasEmissiveBase||2!==this.componentParameters.emissiveSourceOverride)}get texture(){return this.baseColorTexture?.texture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}update(e){e(this)}acquireTechnique(e,t,r,s){const o=this._updateConfiguration(t,r,s);return e.get(p,o)}_updateConfiguration(e,t,r){return this._updateMaterialConfiguration(),this._updateDrawConfiguration(e,t,r)}_updateMaterialConfiguration(){if(!this.dirty)return;const e=this._configuration;e.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,e.hasOcclusionTexture=null!=this.occlusionTexture,e.hasNormalTexture=null!=this.normalTexture,e.sphereDepthInterpolate=this.sphereDepthInterpolate&&e.spherical,e.ellipsoidMode=this.ellipsoidMode,e.componentData=this.componentParameters.type,e.textureBackedBufferLayout=this.textureBackedBufferParameters.textureBackedBuffer?.layout.hash??0,e.cullFace=this.commonMaterialParameters.cullFace,e.doubleSidedMode=this.commonMaterialParameters.doubleSided?1:0,e.hasColorTexture=null!=this.baseColorTexture;const t=this._computeWhichMaterialPass();e.blendingEnabled=1===t||2===t,e.alphaDiscardMode=this.alphaDiscardMode,e.hasPolygonOffset=this.polygonOffsetEnabled,this._setClean()}_updateDrawConfiguration(e,t,r){const s=this._configuration,o=e.identifier,i=0===o;s.hasEmission=t.hasEmission&&i,s.renderOccluded=9===t.slot,s.hasVertexColors=r.hasVertexColors,s.hasNormals=r.hasNormals,s.textureCoordinateType=r.textureCoordinateType,s.oitPass=i?t.oitPass:0,s.terrainDepthTest=i&&t.terrainDepthTest,s.cullAboveTerrain=!!i&&t.cullAboveTerrain,s.integratedMeshMode=this.isIntegratedMesh?B(t)?D(t)?3:2:1:0,s.pbrMode=3===s.integratedMeshMode?4:this.usePBR?this.hasParametersFromSource?r.shadeNormals&&this.isIntegratedMesh?0:2:1:0;const a=1===this.componentParameters.emissiveSourceOverride,n=2===this.componentParameters.emissiveSourceOverride,l=null!=this.emissionTexture;s.emissionSource=this.hasEmissions?this._hasEmissiveBase&&1===s.pbrMode?n?l?4:2:a?l?5:7:6:a?7:6:0,s.shadeNormals=r.shadeNormals,s.normalType=s.hasNormals?1:2,s.hasSlicePlane=null!=t.slicePlane&&this.commonMaterialParameters.hasSlicePlane,s.hasHighlightMixTexture=2===o&&null!=t.highlightMixTexture,s.output=1===o?3:3===o?6:2===o?8:e.output,s.snowCover=i&&t.snowCover>0;const h=this._computeWhichMaterialPass();s.vertexDiscardMode=i&&2===h?e.transparent?2:1:0,s.olidColor=i&&9===e.output;const u=i&&f(e.output);return s.receiveAmbientOcclusion=u&&r.applySSAO&&null!=t.ssao?.getTexture(),s.hasOccludees=u&&t.hasOccludees,s.receiveShadows=u&&t.shadowMap.ready,s.screenSpaceReflections=u&&null!=t.ssr.lastFrameColor,s.cloudReflections=u&&null!=t.clouds.data?.cubeMap?.colorTexture,s}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:s,renderable:o}=r,{geometry:i}=o,a=o.meta.cameraDepthSquared;s.updateHighlights(t.highlights);const{geometryRanges:n,highlightRangesMap:l,shadowmapRanges:h}=s,u=e=>e.submitDraw(this,i,n,a);switch(this._computeWhichMaterialPass()){case 0:u(e.opaque);break;case 1:u(e.transparent);break;case 2:u(e.opaque),u(e.transparent);break;case 3:u(e.integratedMesh),j(t)&&u(e.occludedGround),w(t)&&u(e.highlightIntegratedMesh);break;case 4:u(e.transparentIntegratedMesh)}if(2!==this.componentParameters.castShadows){if(null!=l)for(const t of l)t[0]===b&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=h&&e.defaultShadowMap.submitDraw(this,i,h,a),u(e.shadowMap)}if(null!=l)for(const p of l)e.highlight.submitDraw(this,i,p[1],a,p[0]);t.viewshedEnabled&&u(e.viewshedShadowMap)}_computeWhichMaterialPass(){if(this.isIntegratedMesh&&this.objectOpacity>=1)return 3;if(this.isIntegratedMesh&&this.objectOpacity<1)return 4;if(this.objectOpacity<1)return 1;if(0===this.componentParameters.opaqueOverride)return 0;if(this.baseColor[3]<1||0===this.alphaDiscardMode||3===this.alphaDiscardMode)return 1;switch(this.componentParameters.transparent){case 2:return 0;case 0:return 1;case 1:return 2}}}e([d({vectorOps:l})],S.prototype,"baseColor",void 0),e([d()],S.prototype,"usePBR",void 0),e([d()],S.prototype,"hasParametersFromSource",void 0),e([d()],S.prototype,"sphereDepthInterpolate",void 0),e([d({vectorOps:o})],S.prototype,"mrrFactors",void 0),e([d({dispose:!0})],S.prototype,"baseColorTexture",void 0),e([d({dispose:!0})],S.prototype,"metallicRoughnessTexture",void 0),e([d({dispose:!0})],S.prototype,"normalTexture",void 0),e([d({dispose:!0})],S.prototype,"occlusionTexture",void 0),e([d({dispose:!0})],S.prototype,"emissionTexture",void 0),e([d({vectorOps:o})],S.prototype,"emissiveBaseColor",void 0),e([d()],S.prototype,"emissiveStrength",void 0),e([m()],S.prototype,"commonMaterialParameters",void 0),e([m()],S.prototype,"componentParameters",void 0),e([m()],S.prototype,"textureBackedBufferParameters",void 0),e([d()],S.prototype,"objectOpacity",void 0),e([d()],S.prototype,"textureAlphaCutoff",void 0),e([d()],S.prototype,"alphaDiscardMode",void 0),e([d()],S.prototype,"isIntegratedMesh",void 0),e([d()],S.prototype,"polygonOffsetEnabled",void 0),e([d()],S.prototype,"ellipsoidMode",void 0),e([d()],S.prototype,"hasOccludees",void 0);class C extends g{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=2,this.hasSlicePlane=!0}}e([d()],C.prototype,"doubleSided",void 0),e([d()],C.prototype,"cullFace",void 0),e([d()],C.prototype,"hasSlicePlane",void 0);class O extends g{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=1,this.emissiveStrength=0,this.emissiveSource=0,this.castShadows=0}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}get visible(){return this.externalColor[3]>0?0:2}get type(){return 0}}e([d({vectorOps:l})],O.prototype,"externalColor",void 0),e([d()],O.prototype,"externalColorMixMode",void 0),e([d()],O.prototype,"emissiveStrength",void 0),e([d()],O.prototype,"emissiveSource",void 0),e([d()],O.prototype,"castShadows",void 0);class P extends g{constructor(){super(...arguments),this.transparent=2,this.opaqueOverride=2,this.emissiveOverride=2,this.emissiveSourceOverride=2,this.castShadows=2}get type(){return 1}}function w(e){return null!=e.overlay?.getTexture(2)}function D(e){return null!=e.overlay?.getTexture(3)}function B(e){return null!=e.overlay?.getTexture(1)}function j(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}e([d()],P.prototype,"transparent",void 0),e([d()],P.prototype,"opaqueOverride",void 0),e([d()],P.prototype,"emissiveOverride",void 0),e([d()],P.prototype,"emissiveSourceOverride",void 0),e([d()],P.prototype,"castShadows",void 0);export{C as CommonMaterialParameters,S as ComponentMaterial,O as ComponentParametersUniform,P as ComponentParametersVarying};
5
+ import{__decorate as e}from"tslib";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as s}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{I as o,m as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as n}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as l}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ComponentTechnique as p}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as c}from"./ComponentTechniqueConfiguration.js";import{parameter as d,parameterBlock as m,MaterialBase as v,MaterialParameterBlock as g}from"../../../core/material/MaterialBase.js";import{isColor as f}from"../../../core/shaderLibrary/ShaderOutput.js";import{TextureBackedBufferParameters as x}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{TwoVectorPosition as y}from"../../../core/util/TwoVectorPosition.js";import{advancedMRRFactors as M}from"../../../materials/pbrUtils.js";import{defaultHighlightName as b}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as T}from"../../../../../../webscene/support/AlphaCutoff.js";class S extends v{constructor(e,o,i,n){super(),this.toMapSpace=o,this.useENUForGlobalOverlayUV=i,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.sphereDepthInterpolate=!1,this.mrrFactors=M,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=0,this.commonMaterialParameters=new C,this.componentParameters=new O,this.textureBackedBufferParameters=new x,this.objectOpacity=1,this.textureAlphaCutoff=T,this.alphaDiscardMode=1,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=1,this.hasOccludees=!1;const l=s(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l;const u=new y(e.position);this.transformWorldFromModelTL=u.low,this.transformWorldFromModelTH=u.high,this.transformWorldFromModelRS=e.rotationScale,this._configuration=new c(n),this._updateMaterialConfiguration()}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get _hasEmissiveBase(){return null!=this.emissionTexture||!i(this.emissiveBaseColor,n)}get _hasEmissiveStrength(){return 2!==this.componentParameters.emissiveOverride}get hasEmissions(){return this._hasEmissiveStrength&&(this._hasEmissiveBase||2!==this.componentParameters.emissiveSourceOverride)}get texture(){return this.baseColorTexture?.texture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}update(e){e(this)}acquireTechnique(e,t,r,s){const o=this._updateConfiguration(t,r,s);return e.get(p,o)}_updateConfiguration(e,t,r){return this._updateMaterialConfiguration(),this._updateDrawConfiguration(e,t,r)}_updateMaterialConfiguration(){if(!this.dirty)return;const e=this._configuration;e.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,e.hasOcclusionTexture=null!=this.occlusionTexture,e.hasNormalTexture=null!=this.normalTexture,e.sphereDepthInterpolate=this.sphereDepthInterpolate&&e.spherical,e.ellipsoidMode=this.ellipsoidMode,e.componentData=this.componentParameters.type,e.textureBackedBufferLayout=this.textureBackedBufferParameters.textureBackedBuffer?.layout.hash??0,e.cullFace=this.commonMaterialParameters.cullFace,e.doubleSidedMode=this.commonMaterialParameters.doubleSided?1:0,e.hasColorTexture=null!=this.baseColorTexture;const t=this._computeWhichMaterialPass();e.blendingEnabled=1===t||2===t,e.alphaDiscardMode=this.alphaDiscardMode,e.hasPolygonOffset=this.polygonOffsetEnabled,this._setClean()}_updateDrawConfiguration(e,t,r){const s=this._configuration,o=e.identifier,i=0===o;s.hasEmission=t.hasEmission&&i,s.renderOccluded=9===t.slot,s.hasVertexColors=r.hasVertexColors,s.hasNormals=r.hasNormals,s.textureCoordinateType=r.textureCoordinateType,s.oitPass=i?t.oitPass:0,s.terrainDepthTest=i&&t.terrainDepthTest,s.cullAboveTerrain=!!i&&t.cullAboveTerrain,s.integratedMeshMode=this.isIntegratedMesh?B(t)?D(t)?3:2:1:0,s.pbrMode=3===s.integratedMeshMode?4:this.usePBR?this.hasParametersFromSource?r.shadeNormals&&this.isIntegratedMesh?0:2:1:0;const a=1===this.componentParameters.emissiveSourceOverride,n=2===this.componentParameters.emissiveSourceOverride,l=null!=this.emissionTexture;s.emissionSource=this.hasEmissions?this._hasEmissiveBase&&1===s.pbrMode?n?l?4:2:a?l?5:7:6:a?7:6:0,s.shadeNormals=r.shadeNormals,s.normalType=s.hasNormals?1:2,s.hasSlicePlane=null!=t.slicePlane&&this.commonMaterialParameters.hasSlicePlane,s.hasHighlightMixTexture=2===o&&null!=t.highlightMixTexture,s.output=e.output,s.snowCover=i&&t.snowCover>0;const h=this._computeWhichMaterialPass();s.vertexDiscardMode=i&&2===h?e.transparent?2:1:0,s.olidColor=i&&9===e.output;const u=i&&f(e.output);return s.receiveAmbientOcclusion=u&&r.applySSAO&&null!=t.ssao?.getTexture(),s.hasOccludees=u&&t.hasOccludees,s.receiveShadows=u&&t.shadowMap.ready,s.screenSpaceReflections=u&&null!=t.ssr.lastFrameColor,s.cloudReflections=u&&null!=t.clouds.data?.cubeMap?.colorTexture,s}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:s,renderable:o}=r,{geometry:i}=o,a=o.meta.cameraDepthSquared;s.updateHighlights(t.highlights);const{geometryRanges:n,highlightRangesMap:l,shadowmapRanges:h}=s,u=e=>e.submitDraw(this,i,n,a);switch(this._computeWhichMaterialPass()){case 0:u(e.opaque);break;case 1:u(e.transparent);break;case 2:u(e.opaque),u(e.transparent);break;case 3:u(e.integratedMesh),j(t)&&u(e.occludedGround),w(t)&&u(e.highlightIntegratedMesh);break;case 4:u(e.transparentIntegratedMesh)}if(2!==this.componentParameters.castShadows){if(null!=l)for(const t of l)t[0]===b&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=h&&e.defaultShadowMap.submitDraw(this,i,h,a),u(e.shadowMap)}if(null!=l)for(const p of l)e.highlight.submitDraw(this,i,p[1],a,p[0]);t.viewshedEnabled&&u(e.viewshedShadowMap)}_computeWhichMaterialPass(){if(this.isIntegratedMesh&&this.objectOpacity>=1)return 3;if(this.isIntegratedMesh&&this.objectOpacity<1)return 4;if(this.objectOpacity<1)return 1;if(0===this.componentParameters.opaqueOverride)return 0;if(this.baseColor[3]<1||0===this.alphaDiscardMode||3===this.alphaDiscardMode)return 1;switch(this.componentParameters.transparent){case 2:return 0;case 0:return 1;case 1:return 2}}}e([d({vectorOps:l})],S.prototype,"baseColor",void 0),e([d()],S.prototype,"usePBR",void 0),e([d()],S.prototype,"hasParametersFromSource",void 0),e([d()],S.prototype,"sphereDepthInterpolate",void 0),e([d({vectorOps:o})],S.prototype,"mrrFactors",void 0),e([d({dispose:!0})],S.prototype,"baseColorTexture",void 0),e([d({dispose:!0})],S.prototype,"metallicRoughnessTexture",void 0),e([d({dispose:!0})],S.prototype,"normalTexture",void 0),e([d({dispose:!0})],S.prototype,"occlusionTexture",void 0),e([d({dispose:!0})],S.prototype,"emissionTexture",void 0),e([d({vectorOps:o})],S.prototype,"emissiveBaseColor",void 0),e([d()],S.prototype,"emissiveStrength",void 0),e([m()],S.prototype,"commonMaterialParameters",void 0),e([m()],S.prototype,"componentParameters",void 0),e([m()],S.prototype,"textureBackedBufferParameters",void 0),e([d()],S.prototype,"objectOpacity",void 0),e([d()],S.prototype,"textureAlphaCutoff",void 0),e([d()],S.prototype,"alphaDiscardMode",void 0),e([d()],S.prototype,"isIntegratedMesh",void 0),e([d()],S.prototype,"polygonOffsetEnabled",void 0),e([d()],S.prototype,"ellipsoidMode",void 0),e([d()],S.prototype,"hasOccludees",void 0);class C extends g{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=2,this.hasSlicePlane=!0}}e([d()],C.prototype,"doubleSided",void 0),e([d()],C.prototype,"cullFace",void 0),e([d()],C.prototype,"hasSlicePlane",void 0);class O extends g{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=1,this.emissiveStrength=0,this.emissiveSource=0,this.castShadows=0}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}get visible(){return this.externalColor[3]>0?0:2}get type(){return 0}}e([d({vectorOps:l})],O.prototype,"externalColor",void 0),e([d()],O.prototype,"externalColorMixMode",void 0),e([d()],O.prototype,"emissiveStrength",void 0),e([d()],O.prototype,"emissiveSource",void 0),e([d()],O.prototype,"castShadows",void 0);class P extends g{constructor(){super(...arguments),this.transparent=2,this.opaqueOverride=2,this.emissiveOverride=2,this.emissiveSourceOverride=2,this.castShadows=2}get type(){return 1}}function w(e){return null!=e.overlay?.getTexture(2)}function D(e){return null!=e.overlay?.getTexture(3)}function B(e){return null!=e.overlay?.getTexture(1)}function j(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}e([d()],P.prototype,"transparent",void 0),e([d()],P.prototype,"opaqueOverride",void 0),e([d()],P.prototype,"emissiveOverride",void 0),e([d()],P.prototype,"emissiveSourceOverride",void 0),e([d()],P.prototype,"castShadows",void 0);export{C as CommonMaterialParameters,S as ComponentMaterial,O as ComponentParametersUniform,P as ComponentParametersVarying};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{glLayout as o}from"../../../../support/buffer/glUtil.js";import{newLayout as t}from"../../../../support/buffer/InterleavedLayout.js";import{createVertexBufferLayout as s}from"../SourceGeometry.js";import{C as n}from"../../../../../../chunks/ComponentShader.glsl.js";import{isColor as i}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as l}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as c,depthOnlyOutputBuffersOr as a}from"../../../core/shaderTechnique/ShaderTechnique.js";import{OITPolygonOffset as p,oitDepthTest as m,blending as u,getDrawBuffers as d}from"../../../lib/OrderIndependentTransparency.js";import{replaceBitWhenDepthTestPasses as f,stencilBaseAllZerosParams as h,stencilWriteMaskOn as b}from"../../../lib/StencilUtils.js";import{makePipelineState as g,defaultColorWrite as j,defaultDepthWrite as S,cullingParams as T,premultipliedAlpha as w}from"../../../../../webgl/renderState.js";import{fromLayouts as y}from"../../../../../webgl/VertexAttributeLocations.js";let O=class extends c{constructor(e,r){super(e,r,y([o(s(r)),C])),this.shader=new l(n,()=>import("./shader/ComponentShader.glsl.js"))}initializePipeline(e){const{integratedMeshMode:r,output:o,blendingEnabled:t,cullFace:s,hasEmission:n,hasOccludees:l,hasPolygonOffset:c,oitPass:y,renderOccluded:O}=e,C=0!==r,q=0===y,x=2===y;return g({blending:O?w:i(o)&&t?u(y):null,culling:T(s),depthTest:O?null:{func:m(y)},depthWrite:O||!q&&!x?null:S,drawBuffers:a(o,d(y,n)),colorWrite:j,stencilWrite:!O&&C||l?b:null,stencilTest:C?f(1):l?h:null,polygonOffset:q||x?c?{factor:2,units:2}:null:p})}};O=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],O);const C=o(t().u16("componentIndex"));export{O as ComponentTechnique,C as indexGlLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{glLayout as o}from"../../../../support/buffer/glUtil.js";import{newLayout as t}from"../../../../support/buffer/InterleavedLayout.js";import{createVertexBufferLayout as s}from"../SourceGeometry.js";import{C as n}from"../../../../../../chunks/ComponentShader.glsl.js";import{isColor as i}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as l}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as a,depthOnlyOutputBuffersOr as c}from"../../../core/shaderTechnique/ShaderTechnique.js";import{OITPolygonOffset as p,depthTest as m,blending as u,drawBuffers as d}from"../../../lib/OrderIndependentTransparency.js";import{replaceBitWhenDepthTestPasses as f,stencilBaseAllZerosParams as h,stencilWriteMaskOn as b}from"../../../lib/StencilUtils.js";import{makePipelineState as g,defaultColorWrite as j,defaultDepthWrite as S,cullingParams as T,premultipliedAlpha as w}from"../../../../../webgl/renderState.js";import{fromLayouts as y}from"../../../../../webgl/VertexAttributeLocations.js";let O=class extends a{constructor(e,r){super(e,r,y([o(s(r)),C])),this.shader=new l(n,()=>import("./shader/ComponentShader.glsl.js"))}initializePipeline(e){const{integratedMeshMode:r,output:o,blendingEnabled:t,cullFace:s,hasEmission:n,hasOccludees:l,hasPolygonOffset:a,oitPass:y,renderOccluded:O}=e,C=0!==r,q=0===y,x=2===y;return g({blending:O?w:i(o)&&t?u(y):null,culling:T(s),depthTest:O?null:m(y),depthWrite:O||!q&&!x?null:S,drawBuffers:c(o,d(y,n)),colorWrite:j,stencilWrite:!O&&C||l?b:null,stencilTest:C?f(1):l?h:null,polygonOffset:q||x?a?{factor:2,units:2}:null:p})}};O=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],O);const C=o(t().u16("componentIndex"));export{O as ComponentTechnique,C as indexGlLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderPass as s}from"./RenderPass.js";import{VertexNormalPassParameters as e,VertexNormalDrawParameters as i}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class r{constructor(t){const e=t.renderContext.rctx,i=t.techniques;this.opaque=new s(e,i),this.transparent=new s(e,i,1),this.integratedMesh=new s(e,i),this.transparentIntegratedMesh=new s(e,i),this.occludedGround=new s(e,i),this.shadowMap=new s(e,i),this.highlight=new s(e,i),this.highlightIntegratedMesh=new s(e,i),this.highlightShadowMap=new s(e,i),this.viewshedShadowMap=new s(e,i),this.defaultShadowMap=new s(e,i)}}class n extends e{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin}}class h extends i{}class a extends n{constructor(){super(...arguments),this.identifier=0,this.output=0,this.transparent=!1,this.occludedGround=!1}}class o extends n{constructor(){super(...arguments),this.identifier=1}}class c extends n{constructor(){super(...arguments),this.identifier=2}}class d extends n{constructor(){super(...arguments),this.identifier=3}}export{r as AllRenderPasses,h as DrawParameters,c as HighlightPassParameters,a as MaterialPassParameters,n as PassParameters,o as ShadowMapPassParameters,d as ViewshedShadowMapPassParameters};
5
+ import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderPass as s}from"./RenderPass.js";import{VertexNormalPassParameters as e,VertexNormalDrawParameters as i}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class r{constructor(t){const e=t.renderContext.rctx,i=t.techniques;this.opaque=new s(e,i),this.transparent=new s(e,i,1),this.integratedMesh=new s(e,i),this.transparentIntegratedMesh=new s(e,i),this.occludedGround=new s(e,i),this.shadowMap=new s(e,i),this.highlight=new s(e,i),this.highlightIntegratedMesh=new s(e,i),this.highlightShadowMap=new s(e,i),this.viewshedShadowMap=new s(e,i),this.defaultShadowMap=new s(e,i)}}class n extends e{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin}}class h extends i{}class o extends n{constructor(){super(...arguments),this.identifier=0,this.output=0,this.transparent=!1,this.occludedGround=!1}}class a extends n{constructor(){super(...arguments),this.identifier=1,this.output=3}}class c extends n{constructor(){super(...arguments),this.identifier=2,this.output=8}}class d extends n{constructor(){super(...arguments),this.identifier=3,this.output=6}}export{r as AllRenderPasses,h as DrawParameters,c as HighlightPassParameters,o as MaterialPassParameters,n as PassParameters,a as ShadowMapPassParameters,d as ViewshedShadowMapPassParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/PooledArray.js";import{DataType as t}from"../../../../webgl/enums.js";class r{constructor(t,r,i=0){this._rctx=t,this._techniques=r,this._sorting=i,this._draws=new e({allocator:e=>e??{material:null,geometry:null,geometryRanges:null,bindDrawParams:null,depthSquaredHint:0,indexType:0}}),this._previouslyBoundDraw=new Map}submitDraw(e,t,r,i,s){const n=this._draws.pushNew();n.geometry=t,n.geometryRanges=r,n.material=e,n.depthSquaredHint=i,n.indexType=(t.indexed?t.vao.indexBuffer.indexType:null)??0,n.highlightName=s}acquire(e,t){return this._draws.map(r=>r.material.acquireTechnique(this._techniques,e,t,r.geometry.parameters))}dispatch(e,t,r){const s=this._rctx;this._previouslyBoundDraw.clear();let n=null;const a=this._draws.length,o=t.highlight?.name;for(let h=0;h<a;h++){const a=this._draws.data[h];if(2===e.identifier){const e=a.highlightName;if(e){if(e!==o)continue}else if(!o||!t.overlay?.hasHighlight(o))continue}const l=r[h];l===n&&0===t.oitPass||(s.bindTechnique(l,t,e),n=l);const{geometryRanges:d,indexType:u,geometry:m,material:c}=a;s.bindVAO(m.vao),this._previouslyBoundDraw.get(l)!==c&&(l.program.bindDraw(t,e,c),this._previouslyBoundDraw.set(l,c));const g=d.length,{primitiveType:p}=m;for(let e=0;e<g;e+=2){const t=d[e],r=d[e+1];if(0!==u){const e=i.get(u);s.drawElements(p,r,u,t*e)}else s.drawArrays(p,t,r)}}}prepareSubmit(){this._draws.clear()}finishSubmit(){const e=0===this._sorting?1:-1;this._draws.sort((t,r)=>e*(t.depthSquaredHint-r.depthSquaredHint)||t.geometry.vao.usedMemory-r.geometry.vao.usedMemory)}get count(){return this._draws.length}}const i=new Map;i.set(t.UNSIGNED_BYTE,1),i.set(t.UNSIGNED_SHORT,2),i.set(t.UNSIGNED_INT,4);export{r as RenderPass};
5
+ import{DataType as e}from"../../../../webgl/enums.js";class t{constructor(e,t,s=0){this._rctx=e,this._techniques=t,this._sorting=s,this._draws=new Array,this._previouslyBoundDraw=new Map}submitDraw(e,t,i,r,n){const a=(t.indexed?t.vao.indexBuffer.indexType:null)??0,o=new s(e,t,i,r,a,n);this._draws.push(o)}acquire(e,t){return this._draws.map(s=>s.material.acquireTechnique(this._techniques,e,t,s.geometry.parameters))}dispatch(e,t,s){const r=this._rctx;this._previouslyBoundDraw.clear();let n=null;const a=this._draws.length,o=t.highlight?.name;for(let h=0;h<a;h++){const a=this._draws[h];if(2===e.identifier){const e=a.highlightName;if(e){if(e!==o)continue}else if(!o||!t.overlay?.hasHighlight(o))continue}const u=s[h];u===n&&0===t.oitPass||(r.bindTechnique(u,t,e),n=u);const{geometryRanges:d,indexType:c,geometry:l,material:g}=a;r.bindVAO(l.vao),this._previouslyBoundDraw.get(u)!==g&&(u.program.bindDraw(t,e,g),this._previouslyBoundDraw.set(u,g));const m=d.length,{primitiveType:p}=l;for(let e=0;e<m;e+=2){const t=d[e],s=d[e+1];if(0!==c){const e=i.get(c);r.drawElements(p,s,c,t*e)}else r.drawArrays(p,t,s)}}}prepareSubmit(){this._draws.length=0}finishSubmit(){const e=0===this._sorting?1:-1;this._draws.sort((t,s)=>e*(t.depthSquaredHint-s.depthSquaredHint)||t.geometry.vao.usedMemory-s.geometry.vao.usedMemory)}get count(){return this._draws.length}}class s{constructor(e,t,s,i,r,n){this.material=e,this.geometry=t,this.geometryRanges=s,this.depthSquaredHint=i,this.indexType=r,this.highlightName=n}}const i=new Map;i.set(e.UNSIGNED_BYTE,1),i.set(e.UNSIGNED_SHORT,2),i.set(e.UNSIGNED_INT,4);export{t as RenderPass};