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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/applications/SceneViewer/sceneViewerUtils.d.ts +1 -0
  2. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  3. package/arcade/functions/knowledgegraph.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/0cd5f15b8558b23e5fcd.js +1 -0
  6. package/assets/esri/core/workers/chunks/0cec53e6f1464c69448d.js +1 -0
  7. package/assets/esri/core/workers/chunks/48fbf887da6d19838bf0.js +1 -0
  8. package/assets/esri/core/workers/chunks/{ba4d91816f6a0bf0d812.js → 4dc135e0133d58a06d67.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{322cb1b1871d03b69f0a.js → 5beb525b4adde1d98532.js} +33 -33
  10. package/assets/esri/core/workers/chunks/{3577909b8e84959d415b.js → 6a8cf1f51cc4adc268d3.js} +1 -1
  11. package/assets/esri/core/workers/chunks/6b0a6469673417563616.js +1 -0
  12. package/assets/esri/core/workers/chunks/{bdeac9196f28aff93e68.js → 93d06a1a0b700ddb3807.js} +1 -1
  13. package/assets/esri/core/workers/chunks/b28b699de6deb7e9fa53.js +1 -0
  14. package/assets/esri/core/workers/chunks/{1a5f96b1b892ecceb36a.js → b4a1f3f3a036226d6810.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{738e4f46feb3758456e0.js → baa9fd23414f03ef90bc.js} +1 -1
  16. package/assets/esri/core/workers/chunks/c977a47cabc419610277.js +1 -0
  17. package/assets/esri/core/workers/chunks/{7e00122014d0a55363a8.js → ccb289911e7445b17763.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{e2029267cddb8e2effab.js → d58fae2fc9d148e015ae.js} +1 -1
  19. package/core/sql/WhereClause.js +1 -1
  20. package/core/typedArrayUtil.js +1 -1
  21. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  22. package/geometry/Polygon.js +1 -1
  23. package/geometry/support/buffer/BufferView.js +1 -1
  24. package/geometry/support/buffer/internals/Vec2.js +1 -1
  25. package/interfaces.d.ts +112 -27
  26. package/layers/graphics/data/QueryEngineResult.js +1 -1
  27. package/layers/support/VideoElement.js +1 -1
  28. package/package.json +1 -1
  29. package/support/revision.js +1 -1
  30. package/symbols/support/ElevationInfo.js +1 -1
  31. package/undoredo/support/Services.js +1 -1
  32. package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
  33. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  34. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  35. package/views/2d/layers/StreamLayerView2D.js +1 -1
  36. package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
  37. package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
  38. package/views/3d/environment/PrecipitationTechnique.js +1 -1
  39. package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
  40. package/views/3d/layers/DrapedSubView3D.js +1 -1
  41. package/views/3d/layers/I3SMeshView3D.js +1 -1
  42. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  43. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  44. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  45. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  46. package/views/3d/layers/i3s/I3SQueryFeatureStore.js +1 -1
  47. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  48. package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
  49. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  50. package/views/3d/terrain/PatchGeometry.js +1 -1
  51. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  52. package/views/3d/terrain/TerrainAttributes.js +1 -1
  53. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +3 -3
  54. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  55. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  56. package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
  57. package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
  58. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
  59. package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
  60. package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
  61. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  62. package/views/3d/webgl-engine/lib/ChangeSet.js +1 -1
  63. package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
  64. package/views/3d/webgl-engine/lib/ITexture.js +1 -1
  65. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  66. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  67. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  68. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  69. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  70. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  71. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  72. package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
  73. package/views/3d/webgl-engine/lib/TextureUpdater.js +5 -0
  74. package/views/3d/webgl-engine/lib/rendererUtils.js +1 -1
  75. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  76. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  77. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  78. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  79. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  80. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  81. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  82. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  83. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  84. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  85. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  86. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  87. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  88. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  89. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  90. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  91. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  92. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
  93. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  94. package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
  95. package/views/interactive/snapping/FeatureSnappingSourceInfo.js +1 -1
  96. package/views/layers/PointCloudLayerView.d.ts +1 -1
  97. package/views/layers/PointCloudLayerView.js +5 -0
  98. package/views/webgl/renderState.js +1 -1
  99. package/views/webgl/testFloatBufferBlend.js +1 -1
  100. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  101. package/widgets/Editor/UpdateWorkflow.js +1 -1
  102. package/widgets/Editor/workflowUtils.js +1 -1
  103. package/widgets/Editor.js +1 -1
  104. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  105. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  106. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  107. package/widgets/FeatureForm.js +1 -1
  108. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  109. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  110. package/widgets/support/GridControls.js +1 -1
  111. package/assets/esri/core/workers/chunks/093421648cc61afdeb3c.js +0 -1
  112. package/assets/esri/core/workers/chunks/4816cf647eca2f4cecc2.js +0 -1
  113. package/assets/esri/core/workers/chunks/8725580f6d2a495051b5.js +0 -1
  114. package/assets/esri/core/workers/chunks/a56da688088404259481.js +0 -1
  115. package/assets/esri/core/workers/chunks/e6469173c65531d6524a.js +0 -1
  116. package/assets/esri/core/workers/chunks/e9e517a2141e504eec64.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{clone as t}from"../../../../core/lang.js";import n from"../../../../core/Logger.js";import{nativeArrayMaxSize as r}from"../../../../core/typedArrayUtil.js";import{compactUCharArray as o}from"../../../../geometry/support/UCharArray.js";import{compactUShortArray as i}from"../../../../geometry/support/UShortArray.js";import{decodeRGB as u,decodeIntensity as a}from"./LEPCC.js";import{VertexAttribute as s}from"../../webgl-engine/lib/VertexAttribute.js";const c=()=>n.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function f(t,n,r){let o="",i=0;for(;i<r;){const u=t[n+i];if(u<128)o+=String.fromCharCode(u),i++;else if(u>=192&&u<224){if(i+1>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const a=(31&u)<<6|63&t[n+i+1];o+=String.fromCharCode(a),i+=2}else if(u>=224&&u<240){if(i+2>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(15&u)<<12|(63&t[n+i+1])<<6|63&t[n+i+2];o+=String.fromCharCode(a),i+=3}else{if(!(u>=240&&u<248))throw new e("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(i+3>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(7&u)<<18|(63&t[n+i+1])<<12|(63&t[n+i+2])<<6|63&t[n+i+3];if(a>=65536){const e=55296+(a-65536>>10),t=56320+(1023&a);o+=String.fromCharCode(e,t)}else o+=String.fromCharCode(a);i+=4}}}return o}function l(e,t){const n={byteOffset:0,byteCount:0,fields:Object.create(null)};let r=0;for(let o=0;o<t.length;o++){const i=t[o],u=i.valueType||i.type,a=T[u];n.fields[i.property]=a(e,r),r+=E[u].BYTES_PER_ELEMENT}return n.byteCount=r,n}function d(e,t,n){return b(e,t,n).map((e=>{const t=e?Date.parse(e):null;return null==t||Number.isNaN(t)?null:t}))}function b(t,n,r){const o=[];let i,u,a=0;for(u=0;u<t;u+=1){if(i=n[u],i>0){if(o.push(f(r,a,i-1)),0!==r[a+i-1])throw new e("string-array-error","Invalid string array: missing null termination.")}else o.push(null);a+=i}return o}function y(e,t){return new(0,E[t.valueType])(e,t.byteOffset,t.count*t.valuesPerElement)}function g(e,t){const n=y(e,t);return n.length<r?Array.from(n):n}function p(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}function m(n,r,o){const i=null!=r.header?l(n,r.header):{byteOffset:0,byteCount:0,fields:{count:o}},u={header:i,byteOffset:i.byteCount,byteCount:0,entries:Object.create(null)};let a=i.byteCount;for(let s=0;s<r.ordering.length;s++){const n=r.ordering[s],o=t(r[n]);if(o.count=i.fields.count??0,"String"===o.valueType){if(o.byteOffset=a,o.byteCount=i.fields[n+"ByteCount"],"UTF-8"!==o.encoding)throw new e("unsupported-encoding","Unsupported String encoding.",{encoding:o.encoding});if(o.timeEncoding&&"ECMA_ISO8601"!==o.timeEncoding)throw new e("unsupported-time-encoding","Unsupported time encoding.",{timeEncoding:o.timeEncoding})}else{if(!S(o.valueType))throw new e("unsupported-value-type","Unsupported binary valueType",{valueType:o.valueType});{const e=x(o.valueType);a+=a%e!=0?e-a%e:0,o.byteOffset=a,o.byteCount=e*o.valuesPerElement*o.count}}a+=o.byteCount??0,u.entries[n]=o}return u.byteCount=a-u.byteOffset,u}function w(t,n,r){if(n!==t&&c().error(`Invalid ${r} buffer size\n expected: ${t}, actual: ${n})`),n<t)throw new e("buffer-too-small","Binary buffer is too small",{expectedSize:t,actualSize:n})}function v(e){return{isDraco:!1,isLegacy:!1,color:null!=e.color,normal:null!=e.normal,uv0:null!=e.uv0,uvRegion:null!=e.uvRegion,featureIndex:null!=e.faceRange&&null!=e.featureId}}function C(e,t){const n=l(e,t&&t.header);let r=n.byteCount;const o={isDraco:!1,header:n,byteOffset:n.byteCount,byteCount:0,vertexAttributes:{}},i=n.fields,u=null!=i.vertexCount?i.vertexCount:i.count;for(const c of t.ordering){if(!t.vertexAttributes[c])continue;const e={...t.vertexAttributes[c],byteOffset:r,count:u},n=O[c]||"_"+c;o.vertexAttributes[n]=e,r+=x(e.valueType)*e.valuesPerElement*u}const a=i.faceCount;if(t.faces&&a){o.faces={};for(const e of t.ordering){if(!t.faces[e])continue;const n={...t.faces[e],byteOffset:r,count:a};o.faces[e]=n,r+=x(n.valueType)*n.valuesPerElement*a}}const s=i.featureCount;if(t.featureAttributes&&t.featureAttributeOrder&&s){o.featureAttributes={};for(const e of t.featureAttributeOrder){if(!t.featureAttributes[e])continue;const n={...t.featureAttributes[e],byteOffset:r,count:s};o.featureAttributes[e]=n;r+=("UInt64"===n.valueType?8:x(n.valueType))*n.valuesPerElement*s}}return w(r,e.byteLength,"geometry"),o.byteCount=r-o.byteOffset,o}function I(e,t){return!(!e||!e.compressedAttributes||"draco"!==e.compressedAttributes.encoding)?A(e.compressedAttributes.attributes):e?v(e):h(t)}function h(e){const t={isDraco:!1,isLegacy:!0,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e.ordering)if(e.vertexAttributes[n])switch(n){case"position":break;case"normal":t.normal=!0;break;case"color":t.color=!0;break;case"uv0":t.uv0=!0;break;case"region":t.uvRegion=!0}return e.featureAttributes&&e.featureAttributeOrder&&(t.featureIndex=!0),t}function A(e){const t={isDraco:!0,isLegacy:!1,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e)switch(n){case"position":break;case"normal":t.normal=!0;break;case"uv0":t.uv0=!0;break;case"color":t.color=!0;break;case"uv-region":t.uvRegion=!0;break;case"feature-index":t.featureIndex=!0}return t}const O={position:s.POSITION,normal:s.NORMAL,color:s.COLOR,uv0:s.UV0,region:s.UVREGION};function U(t,n,r,s=!1){if("lepcc-rgb"===t.encoding)return s?u(n):o(u(n));if("lepcc-intensity"===t.encoding)return s?a(n):i(a(n));if(null!=t.encoding&&""!==t.encoding)throw new e("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");t["attributeByteCounts "]&&!t.attributeByteCounts&&(c().warn("Warning: Trailing space in 'attributeByteCounts '."),t.attributeByteCounts=t["attributeByteCounts "]),"ObjectIds"===t.ordering[0]&&t.hasOwnProperty("objectIds")&&(c().warn("Warning: Case error in objectIds"),t.ordering[0]="objectIds");const f=m(n,t,r);w(f.byteOffset+f.byteCount,n.byteLength,"attribute");const l=f.entries.attributeValues||f.entries.objectIds;if(l){if("String"===l.valueType){const e=f.entries.attributeByteCounts,t=y(n,e),r=p(n,l);return l.timeEncoding?d(e.count,t,r):b(e.count,t,r)}return s?y(n,l):g(n,l)}throw new e("bad-attribute-storage-info","Bad attributeStorageInfo specification.")}const E={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},T={Float32:(e,t)=>new DataView(e,0).getFloat32(t,!0),Float64:(e,t)=>new DataView(e,0).getFloat64(t,!0),UInt8:(e,t)=>new DataView(e,0).getUint8(t),Int8:(e,t)=>new DataView(e,0).getInt8(t),UInt16:(e,t)=>new DataView(e,0).getUint16(t,!0),Int16:(e,t)=>new DataView(e,0).getInt16(t,!0),UInt32:(e,t)=>new DataView(e,0).getUint32(t,!0),Int32:(e,t)=>new DataView(e,0).getInt32(t,!0)};function S(e){return E.hasOwnProperty(e)}function x(e){return S(e)?E[e].BYTES_PER_ELEMENT:0}export{m as createAttributeDataIndex,I as createGeometryDescriptor,A as createGeometryDescriptorForDraco,v as createGeometryDescriptorFromDefinition,h as createGeometryDescriptorFromSchema,C as createGeometryIndexFromSchema,p as createRawView,y as createTypedView,x as getBytesPerValue,S as isValueType,U as readBinaryAttribute,d as readDateStringArray,l as readHeader,b as readStringArray,T as valueType2ArrayBufferReader,E as valueType2TypedArrayClassMap};
5
+ import e from"../../../../core/Error.js";import{clone as t}from"../../../../core/lang.js";import n from"../../../../core/Logger.js";import{isInt16Array as r,minInt16 as o,isInt32Array as i,minInt32 as u,nativeArrayMaxSize as a}from"../../../../core/typedArrayUtil.js";import{compactUCharArray as s}from"../../../../geometry/support/UCharArray.js";import{compactUShortArray as c}from"../../../../geometry/support/UShortArray.js";import{decodeRGB as f,decodeIntensity as l}from"./LEPCC.js";import{VertexAttribute as d}from"../../webgl-engine/lib/VertexAttribute.js";const b=()=>n.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function y(t,n,r){let o="",i=0;for(;i<r;){const u=t[n+i];if(u<128)o+=String.fromCharCode(u),i++;else if(u>=192&&u<224){if(i+1>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const a=(31&u)<<6|63&t[n+i+1];o+=String.fromCharCode(a),i+=2}else if(u>=224&&u<240){if(i+2>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(15&u)<<12|(63&t[n+i+1])<<6|63&t[n+i+2];o+=String.fromCharCode(a),i+=3}else{if(!(u>=240&&u<248))throw new e("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(i+3>=r)throw new e("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(7&u)<<18|(63&t[n+i+1])<<12|(63&t[n+i+2])<<6|63&t[n+i+3];if(a>=65536){const e=55296+(a-65536>>10),t=56320+(1023&a);o+=String.fromCharCode(e,t)}else o+=String.fromCharCode(a);i+=4}}}return o}function g(e,t){const n={byteOffset:0,byteCount:0,fields:Object.create(null)};let r=0;for(let o=0;o<t.length;o++){const i=t[o],u=i.valueType||i.type,a=F[u];n.fields[i.property]=a(e,r),r+=j[u].BYTES_PER_ELEMENT}return n.byteCount=r,n}function p(e,t,n){return m(e,t,n).map((e=>{const t=e?Date.parse(e):null;return null==t||Number.isNaN(t)?null:t}))}function m(t,n,r){const o=[];let i,u,a=0;for(u=0;u<t;u+=1){if(i=n[u],i>0){if(o.push(y(r,a,i-1)),0!==r[a+i-1])throw new e("string-array-error","Invalid string array: missing null termination.")}else o.push(null);a+=i}return o}function w(e,t){return new(0,j[t.valueType])(e,t.byteOffset,t.count*t.valuesPerElement)}function v(e,t){const n=w(e,t);if(n.length>=a)return n;const r=new Array;return n.forEach(((e,t)=>r.push(C(n,t)))),r}function C(e,t){if(!e)return null;const n=e[t];if(r(e))return n===o?null:n;if(i(e))return n===u?null:n;return n!=n?null:n}function I(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}function h(n,r,o){const i=null!=r.header?g(n,r.header):{byteOffset:0,byteCount:0,fields:{count:o}},u={header:i,byteOffset:i.byteCount,byteCount:0,entries:Object.create(null)};let a=i.byteCount;for(let s=0;s<r.ordering.length;s++){const n=r.ordering[s],o=t(r[n]);if(o.count=i.fields.count??0,"String"===o.valueType){if(o.byteOffset=a,o.byteCount=i.fields[n+"ByteCount"],"UTF-8"!==o.encoding)throw new e("unsupported-encoding","Unsupported String encoding.",{encoding:o.encoding});if(o.timeEncoding&&"ECMA_ISO8601"!==o.timeEncoding)throw new e("unsupported-time-encoding","Unsupported time encoding.",{timeEncoding:o.timeEncoding})}else{if(!R(o.valueType))throw new e("unsupported-value-type","Unsupported binary valueType",{valueType:o.valueType});{const e=B(o.valueType);a+=a%e!=0?e-a%e:0,o.byteOffset=a,o.byteCount=e*o.valuesPerElement*o.count}}a+=o.byteCount??0,u.entries[n]=o}return u.byteCount=a-u.byteOffset,u}function A(t,n,r){if(n!==t&&b().error(`Invalid ${r} buffer size\n expected: ${t}, actual: ${n})`),n<t)throw new e("buffer-too-small","Binary buffer is too small",{expectedSize:t,actualSize:n})}function O(e){return{isDraco:!1,isLegacy:!1,color:null!=e.color,normal:null!=e.normal,uv0:null!=e.uv0,uvRegion:null!=e.uvRegion,featureIndex:null!=e.faceRange&&null!=e.featureId}}function U(e,t){const n=g(e,t&&t.header);let r=n.byteCount;const o={isDraco:!1,header:n,byteOffset:n.byteCount,byteCount:0,vertexAttributes:{}},i=n.fields,u=null!=i.vertexCount?i.vertexCount:i.count;for(const c of t.ordering){if(!t.vertexAttributes[c])continue;const e={...t.vertexAttributes[c],byteOffset:r,count:u},n=x[c]||"_"+c;o.vertexAttributes[n]=e,r+=B(e.valueType)*e.valuesPerElement*u}const a=i.faceCount;if(t.faces&&a){o.faces={};for(const e of t.ordering){if(!t.faces[e])continue;const n={...t.faces[e],byteOffset:r,count:a};o.faces[e]=n,r+=B(n.valueType)*n.valuesPerElement*a}}const s=i.featureCount;if(t.featureAttributes&&t.featureAttributeOrder&&s){o.featureAttributes={};for(const e of t.featureAttributeOrder){if(!t.featureAttributes[e])continue;const n={...t.featureAttributes[e],byteOffset:r,count:s};o.featureAttributes[e]=n;r+=("UInt64"===n.valueType?8:B(n.valueType))*n.valuesPerElement*s}}return A(r,e.byteLength,"geometry"),o.byteCount=r-o.byteOffset,o}function E(e,t){return!(!e||!e.compressedAttributes||"draco"!==e.compressedAttributes.encoding)?S(e.compressedAttributes.attributes):e?O(e):T(t)}function T(e){const t={isDraco:!1,isLegacy:!0,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e.ordering)if(e.vertexAttributes[n])switch(n){case"position":break;case"normal":t.normal=!0;break;case"color":t.color=!0;break;case"uv0":t.uv0=!0;break;case"region":t.uvRegion=!0}return e.featureAttributes&&e.featureAttributeOrder&&(t.featureIndex=!0),t}function S(e){const t={isDraco:!0,isLegacy:!1,color:!1,normal:!1,uv0:!1,uvRegion:!1,featureIndex:!1};for(const n of e)switch(n){case"position":break;case"normal":t.normal=!0;break;case"uv0":t.uv0=!0;break;case"color":t.color=!0;break;case"uv-region":t.uvRegion=!0;break;case"feature-index":t.featureIndex=!0}return t}const x={position:d.POSITION,normal:d.NORMAL,color:d.COLOR,uv0:d.UV0,region:d.UVREGION};function D(t,n,r,o=!1){if("lepcc-rgb"===t.encoding)return o?f(n):s(f(n));if("lepcc-intensity"===t.encoding)return o?l(n):c(l(n));if(null!=t.encoding&&""!==t.encoding)throw new e("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");t["attributeByteCounts "]&&!t.attributeByteCounts&&(b().warn("Warning: Trailing space in 'attributeByteCounts '."),t.attributeByteCounts=t["attributeByteCounts "]),"ObjectIds"===t.ordering[0]&&t.hasOwnProperty("objectIds")&&(b().warn("Warning: Case error in objectIds"),t.ordering[0]="objectIds");const i=h(n,t,r);A(i.byteOffset+i.byteCount,n.byteLength,"attribute");const u=i.entries.attributeValues||i.entries.objectIds;if(u){if("String"===u.valueType){const e=i.entries.attributeByteCounts,t=w(n,e),r=I(n,u);return u.timeEncoding?p(e.count,t,r):m(e.count,t,r)}return o?w(n,u):v(n,u)}throw new e("bad-attribute-storage-info","Bad attributeStorageInfo specification.")}const j={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},F={Float32:(e,t)=>new DataView(e,0).getFloat32(t,!0),Float64:(e,t)=>new DataView(e,0).getFloat64(t,!0),UInt8:(e,t)=>new DataView(e,0).getUint8(t),Int8:(e,t)=>new DataView(e,0).getInt8(t),UInt16:(e,t)=>new DataView(e,0).getUint16(t,!0),Int16:(e,t)=>new DataView(e,0).getInt16(t,!0),UInt32:(e,t)=>new DataView(e,0).getUint32(t,!0),Int32:(e,t)=>new DataView(e,0).getInt32(t,!0)};function R(e){return j.hasOwnProperty(e)}function B(e){return R(e)?j[e].BYTES_PER_ELEMENT:0}export{h as createAttributeDataIndex,E as createGeometryDescriptor,S as createGeometryDescriptorForDraco,O as createGeometryDescriptorFromDefinition,T as createGeometryDescriptorFromSchema,U as createGeometryIndexFromSchema,I as createRawView,w as createTypedView,B as getBytesPerValue,C as getCachedAttributeValue,R as isValueType,D as readBinaryAttribute,p as readDateStringArray,g as readHeader,m as readStringArray,F as valueType2ArrayBufferReader,j as valueType2TypedArrayClassMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../../../../geometry/support/aaBoundingBox.js";import{getCentroidOptimizedGeometry as e}from"../../../../layers/graphics/centroid.js";import r from"../../../../layers/graphics/OptimizedGeometry.js";import{getCachedAttributeValue as i}from"./I3SUtil.js";class o{constructor(t){this._objectIdField=t.objectIdField,this._getFeatureExtent=t.getFeatureExtent}getObjectId(t){return t.id}getAttributes(t){const{meta:e,index:r}=t,o={};this._objectIdField&&(o[this._objectIdField]=t.id);const n=e.attributeInfo?.attributeData;if(null!=n)for(const s of Object.keys(n))o[s]=i(n[s],r);return o}getAttribute(t,e){if(e===this._objectIdField)return t.id;const{meta:r,index:o}=t,n=r.attributeInfo?.attributeData;return null!=n?i(n[e],o):null}getGeometry(t){if(t.geometry)return t.geometry;const[e,i,o,n,u]=this._getFeatureExtent(t,s);return new r([5],[e,i,o,n,i,o,n,u,o,e,u,o,e,i,o])}getCentroid(t,i){if(t.geometry)return e(new r,t.geometry,i.hasZ,i.hasM);const[o,n,u,a,d,c]=this._getFeatureExtent(t,s);return new r([0],[(o+a)/2,(n+d)/2,(u+c)/2])}cloneWithGeometry(t,e){const{id:r,index:i,meta:o}=t;return new n(r,i,o,e)}}class n{constructor(t,e,r,i){this.id=t,this.index=e,this.meta=r,this.geometry=i}get usedMemory(){return 32+(this.geometry?.usedMemory??0)}}const s=t();export{n as I3SQueryFeature,o as I3SQueryFeatureAdapter};
5
+ import{create as t}from"../../../../geometry/support/aaBoundingBox.js";import{getCentroidOptimizedGeometry as e}from"../../../../layers/graphics/centroid.js";import r from"../../../../layers/graphics/OptimizedGeometry.js";import{getCachedAttributeValue as i}from"./I3SBinaryReader.js";class o{constructor(t){this._objectIdField=t.objectIdField,this._getFeatureExtent=t.getFeatureExtent}getObjectId(t){return t.id}getAttributes(t){const{meta:e,index:r}=t,o={};this._objectIdField&&(o[this._objectIdField]=t.id);const n=e.attributeInfo?.attributeData;if(null!=n)for(const s of Object.keys(n))o[s]=i(n[s],r);return o}getAttribute(t,e){if(e===this._objectIdField)return t.id;const{meta:r,index:o}=t,n=r.attributeInfo?.attributeData;return null!=n?i(n[e],o):null}getGeometry(t){if(t.geometry)return t.geometry;const[e,i,o,n,u]=this._getFeatureExtent(t,s);return new r([5],[e,i,o,n,i,o,n,u,o,e,u,o,e,i,o])}getCentroid(t,i){if(t.geometry)return e(new r,t.geometry,i.hasZ,i.hasM);const[o,n,u,a,d,c]=this._getFeatureExtent(t,s);return new r([0],[(o+a)/2,(n+d)/2,(u+c)/2])}cloneWithGeometry(t,e){const{id:r,index:i,meta:o}=t;return new n(r,i,o,e)}}class n{constructor(t,e,r,i){this.id=t,this.index=e,this.meta=r,this.geometry=i}get usedMemory(){return 32+(this.geometry?.usedMemory??0)}}const s=t();export{n as I3SQueryFeature,o as I3SQueryFeatureAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{toConst as o}from"../../../../core/compilerUtils.js";import t from"../../../../core/Evented.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingSphere as n}from"../../../../geometry/projection/projectBoundingSphere.js";import{create as i,toRect as p}from"../../../../geometry/support/aaBoundingBox.js";import{create as a,intersects as m}from"../../../../geometry/support/aaBoundingRect.js";import{f as u}from"../../../../chunks/sphere.js";import{ForAllFeaturesReturnType as f}from"../II3SMeshView3D.js";const l=i();let d=class extends r{constructor(e){super(e),this.events=new t}forEach(e){this.forAllFeatures((r=>(e(r),f.CONTINUE)))}forEachBounds(e,r){for(const o of e)r(this.getFeatureExtent(o,l))}forEachInBounds(e,r){this.forAllFeatures((t=>{const s=this.getFeatureExtent(o(t),y);return m(e,p(s,j))&&r(o(t)),f.CONTINUE}),(r=>{if(n(r.node.serviceMbsInIndexSR,this.sourceSpatialReference,h,this.viewSpatialReference),h[0]>=e[0]&&h[2]<=e[2]&&h[1]>=e[1]&&h[3]<=e[3])return f.CONTINUE;const o=Math.max(e[0],Math.min(h[0],e[2])),t=Math.max(e[1],Math.min(h[1],e[3])),s=h[0]-o,c=h[1]-t;return s*s+c*c<=h[3]*h[3]?f.CONTINUE:f.SKIP}))}};e([s({constructOnly:!0})],d.prototype,"featureAdapter",void 0),e([s({constructOnly:!0})],d.prototype,"forAllFeatures",void 0),e([s({constructOnly:!0})],d.prototype,"getFeatureExtent",void 0),e([s({constructOnly:!0})],d.prototype,"sourceSpatialReference",void 0),e([s({constructOnly:!0})],d.prototype,"viewSpatialReference",void 0),d=e([c("esri.views.3d.layers.i3s.I3SQueryFeatureStore")],d);const h=u(0,0,0,0),y=i(),j=a();export{d as I3SQueryFeatureStore};
5
+ import{_ as r}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import{toConst as t}from"../../../../core/compilerUtils.js";import o from"../../../../core/Evented.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{projectBoundingSphere as i}from"../../../../geometry/projection/projectBoundingSphere.js";import{create as n,toRect as p}from"../../../../geometry/support/aaBoundingBox.js";import{create as a,intersects as m}from"../../../../geometry/support/aaBoundingRect.js";import{f as u}from"../../../../chunks/sphere.js";import{ForAllFeaturesReturnType as f}from"../II3SMeshView3D.js";const l=n();let h=class extends e{constructor(r){super(r),this.events=new o}forEach(r){this.forAllFeatures((e=>(r(e),f.CONTINUE)))}forEachBounds(r,e){for(const t of r)e(this.getFeatureExtent(t,l))}forEachInBounds(r,e){this.forAllFeatures((o=>{const s=this.getFeatureExtent(t(o),y);return m(r,p(s,j))&&e(t(o)),f.CONTINUE}),(e=>{if(i(e,this.sourceSpatialReference,d,this.viewSpatialReference),d[0]>=r[0]&&d[2]<=r[2]&&d[1]>=r[1]&&d[3]<=r[3])return f.CONTINUE;const t=Math.max(r[0],Math.min(d[0],r[2])),o=Math.max(r[1],Math.min(d[1],r[3])),s=d[0]-t,c=d[1]-o;return s*s+c*c<=d[3]*d[3]?f.CONTINUE:f.SKIP}))}};r([s({constructOnly:!0})],h.prototype,"featureAdapter",void 0),r([s({constructOnly:!0})],h.prototype,"forAllFeatures",void 0),r([s({constructOnly:!0})],h.prototype,"getFeatureExtent",void 0),r([s({constructOnly:!0})],h.prototype,"sourceSpatialReference",void 0),r([s({constructOnly:!0})],h.prototype,"viewSpatialReference",void 0),h=r([c("esri.views.3d.layers.i3s.I3SQueryFeatureStore")],h);const d=u(0,0,0,0),y=n(),j=a();export{h as I3SQueryFeatureStore};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../request.js";import{binaryIndexOf as t,splitIntoChunks as r}from"../../../../core/arrayUtils.js";import o from"../../../../core/Error.js";import has from"../../../../core/has.js";import{isInt16Array as n,isInt32Array as a}from"../../../../core/typedArrayUtil.js";import{invert as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as l,t as c,c as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as p}from"../../../../geometry/projection.js";import d from"../../../../geometry/SpatialReference.js";import{projectVectorToVector as m}from"../../../../geometry/projection/projectVectorToVector.js";import{create as y,empty as h,expandPointInPlace as g,intersects as S}from"../../../../geometry/support/aaBoundingRect.js";import{a as b}from"../../../../chunks/sphere.js";import w from"../../../../rest/support/Query.js";import{readBinaryAttribute as I}from"./I3SBinaryReader.js";import{computeGlobalTransformation as T}from"./I3SProjectionUtil.js";import{createSolidEdgeMaterial as E,createMaterialFromEdges as R}from"../support/edgeUtils.js";import{parseColorMixMode as v,ColorMixModeEnum as x}from"../support/symbolColorUtils.js";import{Obb as M,compute as j}from"../../support/orientedBoundingBox.js";import{spatialReferenceIncompatibleError as C}from"../../../support/layerViewUtils.js";function U(e){return e?parseInt(e.slice(e.lastIndexOf("/")+1),10):void 0}function k(e){if(has("disable-feature:i3s-draco")||!e)return!1;for(const t of e)for(const e of t.geometryBuffers)if("draco"===e.compressedAttributes?.encoding)return!0;return!1}function N(e,t,r,o){r.traverse(t,(t=>{const r=t.serviceMbsInIndexSR;return(null!=r&&F(e,r))!==q.OUTSIDE&&(o(t),!0)}))}function D(e,t,r){let o=0,n=0;for(let a=0;a<t.length&&o<e.length;a++)e[o]===t[a]&&(r(a)&&(e[n]=e[o],n++),o++);e.length=n}function W(e,r,o){let n=0,a=0;for(;n<o.length;){t(e,o[n])>=0===r&&(o[a]=o[n],a++),n++}o.length=a}function _(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return O[0]=(e[0]-t.position[0])/t.rotationScale[0],O[1]=(e[1]-t.position[1])/t.rotationScale[4],O[2]=(e[2]-t.position[0])/t.rotationScale[0],O[3]=(e[3]-t.position[1])/t.rotationScale[4],O}const O=y();var q;function F(e,t){const r=t[0],o=t[1],n=t[3],a=e[0]-r,i=r-e[2],s=e[1]-o,l=o-e[3],c=Math.max(a,i,0),u=Math.max(s,l,0),f=c*c+u*u;if(f>n*n)return q.OUTSIDE;if(f>0)return q.INTERSECTS_CENTER_OUTSIDE;return-Math.max(a,i,s,l)>n?q.INSIDE:q.INTERSECTS_CENTER_INSIDE}function L(e,t,r){const o=[],n=r?.missingFields,a=r?.originalFields;for(const i of e){const e=i.toLowerCase();let r=!1;for(const n of t)if(e===n.name.toLowerCase()){o.push(n.name),r=!0,a&&a.push(i);break}!r&&n&&n.push(i)}return o}async function A(e,t,r,n,a,i){if(0===t.length)return[];const s=e.attributeStorageInfo;if(null!=e.associatedLayer)try{return await P(e.associatedLayer,t,r,n,i)}catch(l){if(e.associatedLayer.loaded)throw l}if(s){const l=K(t,r,a);if(null==l)throw new o("scenelayer:features-not-loaded","Tried to query attributes for unloaded features");const c=e.parsedUrl.path;return(await Promise.all(l.map((t=>G(c,s,t.node,t.indices,n,e.apiKey,e.customParameters,i).then((e=>{for(let r=0;r<t.graphics.length;r++){const o=t.graphics[r],n=e[r];if(o.attributes)for(const e in o.attributes)e in n||(n[e]=o.attributes[e]);o.attributes=n}return t.graphics})))))).flat()}throw new o("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available")}function K(e,t,r){const o=new Map,n=[],a=r();for(const i of e){const e=i.attributes[t];for(let t=0;t<a.length;t++){const r=a[t],s=r.featureIds.indexOf(e);if(s>=0){let e=o.get(r.node);e||(e={node:r.node,indices:[],graphics:[]},n.push(e),o.set(r.node,e)),e.indices.push(s),e.graphics.push(i);for(let r=t;r>0;r--)a[r]=a[r-1];a[0]=r;break}}}return n}async function P(e,t,r,o,n){t.sort(((e,t)=>e.attributes[r]-t.attributes[r]));const a=t.map((e=>e.attributes[r])),i=[],s=L(o,e.fields,{originalFields:i}),l=await B(e,a,s,n);for(let c=0;c<t.length;c++){const e=t[c],r=l[c],o={};if(e.attributes)for(const t in e.attributes)o[t]=e.attributes[t];for(let t=0;t<i.length;t++)o[i[t]]=r[s[t]];e.attributes=o}return t}function B(e,t,n,a){const i=e.capabilities.query.maxRecordCount;if(null!=i&&t.length>i){const o=r(t,i);return Promise.all(o.map((t=>B(e,t,n,a)))).then((e=>e.flat()))}const s=new w({objectIds:t,outFields:n,orderByFields:[e.objectIdField]});return e.queryFeatures(s,a).then((e=>{if(e&&e.features&&e.features.length===t.length)return e.features.map((e=>e.attributes));throw new o("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer")}))}function G(e,t,r,o,n,a,i,s){return V(e,t,r.resources.attributes,o,n,a,i,s)}async function V(t,r,o,n,a,i,s,l){const c=[];for(const e of r)if(e&&a.includes(e.name)){const r=`${t}/nodes/${o}/attributes/${e.key}/0`;c.push({url:r,storageInfo:e})}const u=await Promise.allSettled(c.map((t=>e(t.url,{responseType:"array-buffer",query:{...s,token:i},signal:l?.signal}).then((e=>I(t.storageInfo,e.data)))))),f=[];for(const e of n){const t={};for(let r=0;r<u.length;r++){const o=u[r];if("fulfilled"===o.status){const n=o.value;t[c[r].storageInfo.name]=Q(n,e)}}f.push(t)}return f}!function(e){e[e.OUTSIDE=0]="OUTSIDE",e[e.INTERSECTS_CENTER_OUTSIDE=1]="INTERSECTS_CENTER_OUTSIDE",e[e.INTERSECTS_CENTER_INSIDE=2]="INTERSECTS_CENTER_INSIDE",e[e.INSIDE=3]="INSIDE"}(q||(q={}));const $=-32768,z=-2147483648;function Q(e,t){if(!e)return null;const r=e[t];if(n(e))return r===$?null:r;if(a(e))return r===z?null:r;return r!=r?null:r}function Z(e){const t=e.store,r=t.indexCRS||t.geographicCRS,n=void 0===r?t.indexWKT:void 0;if(n){if(!e.spatialReference)throw new o("layerview:no-store-spatial-reference-wkt-index-and-no-layer-spatial-reference","Found indexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new o("layerview:store-spatial-reference-wkt-index-incompatible","The indexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const a=r?new d(U(r)):e.spatialReference;return a.equals(e.spatialReference)?e.spatialReference:a}function H(e){const t=e.store,r=t.vertexCRS||t.projectedCRS,n=void 0===r?t.vertexWKT:void 0;if(n){if(!e.spatialReference)throw new o("layerview:no-store-spatial-reference-wkt-vertex-and-no-layer-spatial-reference","Found vertexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new o("layerview:store-spatial-reference-wkt-vertex-incompatible","The vertexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const a=r?new d(U(r)):e.spatialReference;return a.equals(e.spatialReference)?e.spatialReference:a}function J(e,t,r){if(!p(e,t))throw C("scene layer",e?.wkid,t?.wkid);if("local"===r&&!Y(e,t))throw C("scene layer",e?.wkid,t?.wkid)}function X(e,t,r){if(e.serviceUpdateTimeStamp?.lastUpdate!==t.serviceUpdateTimeStamp?.lastUpdate||!r.isEmpty||e.associatedLayer?.url!==t.associatedLayer?.url)throw new o("layerview:recycle-failed","Could not recycle layerview")}function Y(e,t){return e.equals(t)||e.isWGS84&&t.isWebMercator||e.isWebMercator&&t.isWGS84}function ee(e,t,r){const o=Z(e),n=H(e);J(o,t,r),J(n,t,r)}function te(e){return(null==e.geometryType||"triangles"===e.geometryType)&&((null==e.topology||"PerAttributeArray"===e.topology)&&null!=e.vertexAttributes?.position)}function re(e){if(null==e.store?.defaultGeometrySchema||!te(e.store.defaultGeometrySchema))throw new o("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{url:e.parsedUrl.path})}function oe(e,t){ee(e,t.spatialReference,t.viewingMode)}function ne(e){return null!=e.geometryType&&"points"===e.geometryType&&((null==e.topology||"PerAttributeArray"===e.topology)&&((null==e.encoding||""===e.encoding||"lepcc-xyz"===e.encoding)&&null!=e.vertexAttributes?.position))}function ae(e){if(null==e.store?.defaultGeometrySchema||!ne(e.store.defaultGeometrySchema))throw new o("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{})}function ie(e,t){J(e.spatialReference,t.spatialReference,t.viewingMode)}function se(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type}function le(e){return"mesh-3d"===e.type}function ce(e){if(null==e||!se(e))return!0;if(("unique-value"===e.type||"class-breaks"===e.type)&&null==e.defaultSymbol)return!0;const t=e.symbols;if(0===t.length)return!0;for(const r of t){if(!le(r)||0===r.symbolLayers.length)return!0;for(const e of r.symbolLayers.items)if("fill"!==e.type||null==e.material?.color||"replace"!==e.material.colorMixMode)return!0}return!1}const ue=E({color:[0,0,0,0],opacity:0});class fe{constructor(){this.edgeMaterial=null,this.material=null,this.castShadows=!0}}function pe(e){const t=new fe;let r=!1,o=!1;for(const n of e.symbolLayers.items)if("fill"===n.type&&n.enabled){const e=n.material,a=n.edges;if(null!=e&&!r){const o=e.color,a=v(e.colorMixMode);t.material=null!=o?{color:[o.r/255,o.g/255,o.b/255],alpha:o.a,colorMixMode:a}:{color:[1,1,1],alpha:1,colorMixMode:x.Multiply},t.castShadows=n.castShadows,r=!0}null==a||o||(t.edgeMaterial=R(a,{}),o=!0)}return t.material||(t.material={color:[1,1,1],alpha:1,colorMixMode:x.Multiply}),t}function de(e,t){return(0|e)+(0|t)|0}function me(e,t,r,o,n,a,s){if(!a||0===a.length||null==t||!e.serviceMbsInIndexSR)return null;const f=T(e.serviceMbsInIndexSR,n,"none",r,t);i(Ee,f);let p=null;const d=()=>{if(!p)if(p=ge,h(be),null!=e.serviceObbInIndexSR){e.serviceObbInIndexSR.transform(we,r,t,n,s),we.getCorners(p);for(const e of p)c(e,e,Ee),g(be,e)}else{const o=e.serviceMbsInIndexSR;if(!o)return;const a=o[3];m(b(o),r,Ie,t),c(Ie,Ie,Ee),Ie[2]+=n;for(let e=0;e<8;++e){const t=1&e?a:-a,r=2&e?a:-a,o=4&e?a:-a,n=p[e];u(n,[Ie[0]+t,Ie[1]+r,Ie[2]+o]),g(be,n)}}};let y=1/0,w=-1/0;const I=e=>{if("replace"!==e.type)return;const r=e.geometry;if(!r?.hasZ)return;h(Se);const n=r.spatialReference||o,a=r.rings.reduce(((e,r)=>r.reduce(((e,r)=>(l(Ie,r[0],r[1],r[2]),m(Ie,n,Ie,t),c(Ie,Ie,Ee),g(Se,Ie),Math.min(Ie[2],e))),e)),1/0);d(),S(be,Se)&&(y=Math.min(y,a),w=Math.max(w,a))};if(a.forEach((e=>I(e))),y===1/0)return null;const E=(e,t,r)=>{c(Ie,r,f),e[t]=Ie[0],e[t+1]=Ie[1],e[t+2]=Ie[2],t+=24,r[2]=y,c(Ie,r,f),e[t]=Ie[0],e[t+1]=Ie[1],e[t+2]=Ie[2],t+=24,r[2]=w,c(Ie,r,f),e[t]=Ie[0],e[t+1]=Ie[1],e[t+2]=Ie[2]};for(let i=0;i<8;++i)E(Te.data,3*i,p[i]);return j(Te)}function ye(e){return e[3]>=0}function he(e){null!=e&&(e[3]=-1)}const ge=[f(),f(),f(),f(),f(),f(),f(),f()],Se=y(),be=y(),we=new M,Ie=f(),Te={data:new Array(72),size:3,exclusive:!0,stride:3},Ee=s();export{q as MbsIntersectResult,fe as SymbolInfo,de as addWraparound,ie as checkPointCloudLayerCompatibleWithView,ae as checkPointCloudLayerValid,X as checkRecyclable,oe as checkSceneLayerCompatibleWithView,re as checkSceneLayerValid,J as checkSpatialReference,ee as checkSpatialReferences,me as computeVisibilityObb,k as containsDraco,U as extractWkid,D as filterInPlace,L as findFieldsCaseInsensitive,N as findIntersectingNodes,Q as getCachedAttributeValue,_ as getClipRect,Z as getIndexCrs,pe as getSymbolInfo,H as getVertexCrs,F as intersectBoundingRectWithMbs,he as invalidateMbs,Y as isSupportedLocalModeProjection,ye as isValidMbs,W as objectIdFilter,V as queryAttributesFromCachedAttributesId,ce as rendererNeedsTextures,ue as transparentEdgeMaterial,A as whenGraphicAttributes};
5
+ import e from"../../../../request.js";import{binaryIndexOf as t,splitIntoChunks as r}from"../../../../core/arrayUtils.js";import o from"../../../../core/Error.js";import has from"../../../../core/has.js";import{invert as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as s,t as i,c as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as u}from"../../../../geometry/projection.js";import f from"../../../../geometry/SpatialReference.js";import{projectVectorToVector as p}from"../../../../geometry/projection/projectVectorToVector.js";import{create as d,empty as m,expandPointInPlace as y,intersects as h}from"../../../../geometry/support/aaBoundingRect.js";import{a as g}from"../../../../chunks/sphere.js";import S from"../../../../rest/support/Query.js";import{readBinaryAttribute as b,getCachedAttributeValue as w}from"./I3SBinaryReader.js";import{computeGlobalTransformation as I}from"./I3SProjectionUtil.js";import{createSolidEdgeMaterial as T,createMaterialFromEdges as E}from"../support/edgeUtils.js";import{parseColorMixMode as R,ColorMixModeEnum as v}from"../support/symbolColorUtils.js";import{Obb as x,compute as M}from"../../support/orientedBoundingBox.js";import{spatialReferenceIncompatibleError as j}from"../../../support/layerViewUtils.js";function C(e){return e?parseInt(e.slice(e.lastIndexOf("/")+1),10):void 0}function k(e){if(has("disable-feature:i3s-draco")||!e)return!1;for(const t of e)for(const e of t.geometryBuffers)if("draco"===e.compressedAttributes?.encoding)return!0;return!1}function N(e,t,r,o){r.traverse(t,(t=>{const r=t.serviceMbsInIndexSR;return(null!=r&&q(e,r))!==O.OUTSIDE&&(o(t),!0)}))}function U(e,t,r){let o=0,n=0;for(let a=0;a<t.length&&o<e.length;a++)e[o]===t[a]&&(r(a)&&(e[n]=e[o],n++),o++);e.length=n}function D(e,r,o){let n=0,a=0;for(;n<o.length;){t(e,o[n])>=0===r&&(o[a]=o[n],a++),n++}o.length=a}function W(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return _[0]=(e[0]-t.position[0])/t.rotationScale[0],_[1]=(e[1]-t.position[1])/t.rotationScale[4],_[2]=(e[2]-t.position[0])/t.rotationScale[0],_[3]=(e[3]-t.position[1])/t.rotationScale[4],_}const _=d();var O;function q(e,t){const r=t[0],o=t[1],n=t[3],a=e[0]-r,s=r-e[2],i=e[1]-o,l=o-e[3],c=Math.max(a,s,0),u=Math.max(i,l,0),f=c*c+u*u;if(f>n*n)return O.OUTSIDE;if(f>0)return O.INTERSECTS_CENTER_OUTSIDE;return-Math.max(a,s,i,l)>n?O.INSIDE:O.INTERSECTS_CENTER_INSIDE}function F(e,t,r){const o=[],n=r?.missingFields,a=r?.originalFields;for(const s of e){const e=s.toLowerCase();let r=!1;for(const n of t)if(e===n.name.toLowerCase()){o.push(n.name),r=!0,a&&a.push(s);break}!r&&n&&n.push(s)}return o}async function L(e,t,r,n,a,s){if(0===t.length)return[];const i=e.attributeStorageInfo;if(null!=e.associatedLayer)try{return await A(e.associatedLayer,t,r,n,s)}catch(l){if(e.associatedLayer.loaded)throw l}if(i){const l=K(t,r,a);if(null==l)throw new o("scenelayer:features-not-loaded","Tried to query attributes for unloaded features");const c=e.parsedUrl.path;return(await Promise.all(l.map((t=>B(c,i,t.node,t.indices,n,e.apiKey,e.customParameters,s).then((e=>{for(let r=0;r<t.graphics.length;r++){const o=t.graphics[r],n=e[r];if(o.attributes)for(const e in o.attributes)e in n||(n[e]=o.attributes[e]);o.attributes=n}return t.graphics})))))).flat()}throw new o("scenelayer:no-attribute-source","This scene layer does not have a source for attributes available")}function K(e,t,r){const o=new Map,n=[],a=r();for(const s of e){const e=s.attributes[t];for(let t=0;t<a.length;t++){const r=a[t],i=r.featureIds.indexOf(e);if(i>=0){let e=o.get(r.node);e||(e={node:r.node,indices:[],graphics:[]},n.push(e),o.set(r.node,e)),e.indices.push(i),e.graphics.push(s);for(let r=t;r>0;r--)a[r]=a[r-1];a[0]=r;break}}}return n}async function A(e,t,r,o,n){t.sort(((e,t)=>e.attributes[r]-t.attributes[r]));const a=t.map((e=>e.attributes[r])),s=[],i=F(o,e.fields,{originalFields:s}),l=await P(e,a,i,n);for(let c=0;c<t.length;c++){const e=t[c],r=l[c],o={};if(e.attributes)for(const t in e.attributes)o[t]=e.attributes[t];for(let t=0;t<s.length;t++)o[s[t]]=r[i[t]];e.attributes=o}return t}function P(e,t,n,a){const s=e.capabilities.query.maxRecordCount;if(null!=s&&t.length>s){const o=r(t,s);return Promise.all(o.map((t=>P(e,t,n,a)))).then((e=>e.flat()))}const i=new S({objectIds:t,outFields:n,orderByFields:[e.objectIdField]});return e.queryFeatures(i,a).then((e=>{if(e&&e.features&&e.features.length===t.length)return e.features.map((e=>e.attributes));throw new o("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer")}))}function B(e,t,r,o,n,a,s,i){return G(e,t,r.resources.attributes,o,n,a,s,i)}async function G(t,r,o,n,a,s,i,l){const c=[];for(const e of r)if(e&&a.includes(e.name)){const r=`${t}/nodes/${o}/attributes/${e.key}/0`;c.push({url:r,storageInfo:e})}const u=await Promise.allSettled(c.map((t=>e(t.url,{responseType:"array-buffer",query:{...i,token:s},signal:l?.signal}).then((e=>b(t.storageInfo,e.data)))))),f=[];for(const e of n){const t={};for(let r=0;r<u.length;r++){const o=u[r];if("fulfilled"===o.status){const n=o.value;t[c[r].storageInfo.name]=w(n,e)}}f.push(t)}return f}function V(e){const t=e.store,r=t.indexCRS||t.geographicCRS,n=void 0===r?t.indexWKT:void 0;if(n){if(!e.spatialReference)throw new o("layerview:no-store-spatial-reference-wkt-index-and-no-layer-spatial-reference","Found indexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new o("layerview:store-spatial-reference-wkt-index-incompatible","The indexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const a=r?new f(C(r)):e.spatialReference;return a.equals(e.spatialReference)?e.spatialReference:a}function $(e){const t=e.store,r=t.vertexCRS||t.projectedCRS,n=void 0===r?t.vertexWKT:void 0;if(n){if(!e.spatialReference)throw new o("layerview:no-store-spatial-reference-wkt-vertex-and-no-layer-spatial-reference","Found vertexWKT in the scene layer store but no layer spatial reference",{});if(n!==e.spatialReference.wkt)throw new o("layerview:store-spatial-reference-wkt-vertex-incompatible","The vertexWKT of the scene layer store does not match the WKT of the layer spatial reference",{})}const a=r?new f(C(r)):e.spatialReference;return a.equals(e.spatialReference)?e.spatialReference:a}function z(e,t,r){if(!u(e,t))throw j("scene layer",e?.wkid,t?.wkid);if("local"===r&&!Z(e,t))throw j("scene layer",e?.wkid,t?.wkid)}function Q(e,t,r){if(e.serviceUpdateTimeStamp?.lastUpdate!==t.serviceUpdateTimeStamp?.lastUpdate||!r.isEmpty||e.associatedLayer?.url!==t.associatedLayer?.url)throw new o("layerview:recycle-failed","Could not recycle layerview")}function Z(e,t){return e.equals(t)||e.isWGS84&&t.isWebMercator||e.isWebMercator&&t.isWGS84}function H(e,t,r){const o=V(e),n=$(e);z(o,t,r),z(n,t,r)}function J(e){return(null==e.geometryType||"triangles"===e.geometryType)&&((null==e.topology||"PerAttributeArray"===e.topology)&&null!=e.vertexAttributes?.position)}function X(e){if(null==e.store?.defaultGeometrySchema||!J(e.store.defaultGeometrySchema))throw new o("scenelayer:unsupported-geometry-schema","The geometry schema of this scene layer is not supported.",{url:e.parsedUrl.path})}function Y(e,t){H(e,t.spatialReference,t.viewingMode)}function ee(e){return null!=e.geometryType&&"points"===e.geometryType&&((null==e.topology||"PerAttributeArray"===e.topology)&&((null==e.encoding||""===e.encoding||"lepcc-xyz"===e.encoding)&&null!=e.vertexAttributes?.position))}function te(e){if(null==e.store?.defaultGeometrySchema||!ee(e.store.defaultGeometrySchema))throw new o("pointcloud:unsupported-geometry-schema","The geometry schema of this point cloud scene layer is not supported.",{})}function re(e,t){z(e.spatialReference,t.spatialReference,t.viewingMode)}function oe(e){return"simple"===e.type||"class-breaks"===e.type||"unique-value"===e.type}function ne(e){return"mesh-3d"===e.type}function ae(e){if(null==e||!oe(e))return!0;if(("unique-value"===e.type||"class-breaks"===e.type)&&null==e.defaultSymbol)return!0;const t=e.symbols;if(0===t.length)return!0;for(const r of t){if(!ne(r)||0===r.symbolLayers.length)return!0;for(const e of r.symbolLayers.items)if("fill"!==e.type||null==e.material?.color||"replace"!==e.material.colorMixMode)return!0}return!1}!function(e){e[e.OUTSIDE=0]="OUTSIDE",e[e.INTERSECTS_CENTER_OUTSIDE=1]="INTERSECTS_CENTER_OUTSIDE",e[e.INTERSECTS_CENTER_INSIDE=2]="INTERSECTS_CENTER_INSIDE",e[e.INSIDE=3]="INSIDE"}(O||(O={}));const se=T({color:[0,0,0,0],opacity:0});class ie{constructor(){this.edgeMaterial=null,this.material=null,this.castShadows=!0}}function le(e){const t=new ie;let r=!1,o=!1;for(const n of e.symbolLayers.items)if("fill"===n.type&&n.enabled){const e=n.material,a=n.edges;if(null!=e&&!r){const o=e.color,a=R(e.colorMixMode);t.material=null!=o?{color:[o.r/255,o.g/255,o.b/255],alpha:o.a,colorMixMode:a}:{color:[1,1,1],alpha:1,colorMixMode:v.Multiply},t.castShadows=n.castShadows,r=!0}null==a||o||(t.edgeMaterial=E(a,{}),o=!0)}return t.material||(t.material={color:[1,1,1],alpha:1,colorMixMode:v.Multiply}),t}function ce(e,t){return(0|e)+(0|t)|0}function ue(e,t,r,o,a,c,u){if(!c||0===c.length||null==t||!e.serviceMbsInIndexSR)return null;const f=I(e.serviceMbsInIndexSR,a,"none",r,t);n(be,f);let d=null;const S=()=>{if(!d)if(d=de,m(ye),null!=e.serviceObbInIndexSR){e.serviceObbInIndexSR.transform(he,r,t,a,u),he.getCorners(d);for(const e of d)i(e,e,be),y(ye,e)}else{const o=e.serviceMbsInIndexSR;if(!o)return;const n=o[3];p(g(o),r,ge,t),i(ge,ge,be),ge[2]+=a;for(let e=0;e<8;++e){const t=1&e?n:-n,r=2&e?n:-n,o=4&e?n:-n,a=d[e];l(a,[ge[0]+t,ge[1]+r,ge[2]+o]),y(ye,a)}}};let b=1/0,w=-1/0;const T=e=>{if("replace"!==e.type)return;const r=e.geometry;if(!r?.hasZ)return;m(me);const n=r.spatialReference||o,a=r.rings.reduce(((e,r)=>r.reduce(((e,r)=>(s(ge,r[0],r[1],r[2]),p(ge,n,ge,t),i(ge,ge,be),y(me,ge),Math.min(ge[2],e))),e)),1/0);S(),h(ye,me)&&(b=Math.min(b,a),w=Math.max(w,a))};if(c.forEach((e=>T(e))),b===1/0)return null;const E=(e,t,r)=>{i(ge,r,f),e[t]=ge[0],e[t+1]=ge[1],e[t+2]=ge[2],t+=24,r[2]=b,i(ge,r,f),e[t]=ge[0],e[t+1]=ge[1],e[t+2]=ge[2],t+=24,r[2]=w,i(ge,r,f),e[t]=ge[0],e[t+1]=ge[1],e[t+2]=ge[2]};for(let n=0;n<8;++n)E(Se.data,3*n,d[n]);return M(Se)}function fe(e){return e[3]>=0}function pe(e){null!=e&&(e[3]=-1)}const de=[c(),c(),c(),c(),c(),c(),c(),c()],me=d(),ye=d(),he=new x,ge=c(),Se={data:new Array(72),size:3,exclusive:!0,stride:3},be=a();export{O as MbsIntersectResult,ie as SymbolInfo,ce as addWraparound,re as checkPointCloudLayerCompatibleWithView,te as checkPointCloudLayerValid,Q as checkRecyclable,Y as checkSceneLayerCompatibleWithView,X as checkSceneLayerValid,z as checkSpatialReference,H as checkSpatialReferences,ue as computeVisibilityObb,k as containsDraco,C as extractWkid,U as filterInPlace,F as findFieldsCaseInsensitive,N as findIntersectingNodes,W as getClipRect,V as getIndexCrs,le as getSymbolInfo,$ as getVertexCrs,q as intersectBoundingRectWithMbs,pe as invalidateMbs,Z as isSupportedLocalModeProjection,fe as isValidMbs,D as objectIdFilter,G as queryAttributesFromCachedAttributesId,ae as rendererNeedsTextures,se as transparentEdgeMaterial,L as whenGraphicAttributes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{getTimeOperator as i}from"../../../../layers/graphics/data/timeSupport.js";import s from"../../../../layers/support/FeatureFilter.js";import{combineTimeExtent as n}from"../../../../layers/support/timeSupport.js";import{filterInPlace as o,getCachedAttributeValue as l}from"../i3s/I3SUtil.js";const u=i=>{let o=class extends i{get timeExtent(){return n(this.i3slayer,this.view?.timeExtent,this._get("timeExtent"))}get mergedFilter(){const{filter:t,timeExtent:e}=this;if(null==e)return t;const r=t?.clone()??new s;return null!=e&&(r.timeExtent=r.timeExtent?.intersection(e)??e),r}getTimeFilterDependencies(){const{timeInfo:t}=this.i3slayer;if(null==t)return[];const{startField:e,endField:r}=t;return[e,r]}addTimeFilter(t,e){if(null==e)return;const{timeInfo:r}=this.i3slayer;if(null==r)return;const{startField:i,endField:s,useTime:n}=r;if(!n||null==i&&null==s)return;const o=r.toJSON(),l=e.toJSON();t.push(((t,e)=>a(t,e,o,l)))}};return t([e({readOnly:!0})],o.prototype,"timeExtent",null),t([e()],o.prototype,"mergedFilter",null),o=t([r("esri.views.3d.layers.support.TemporalSceneLayerView")],o),o};function a(t,e,r,s){const n=e.attributeInfo?.attributeData;if(null==n)return;const{startTimeField:l,endTimeField:u}=r;if(!!(null!=l&&null==n[l]||null!=u&&null==n[u]))return;const a=i(r,s,new m(n));if(null==a)return;const{featureIds:p}=e;o(t,p,a)}class m{constructor(t){this.attributeData=t}getAttribute(t,e){return l(this.attributeData[e],t)}getAttributeAsTimestamp(t,e){const r=this.getAttribute(t,e);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}}export{u as TemporalSceneLayerView};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{property as e}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{getTimeOperator as i}from"../../../../layers/graphics/data/timeSupport.js";import s from"../../../../layers/support/FeatureFilter.js";import{combineTimeExtent as n}from"../../../../layers/support/timeSupport.js";import{getCachedAttributeValue as o}from"../i3s/I3SBinaryReader.js";import{filterInPlace as l}from"../i3s/I3SUtil.js";const u=i=>{let o=class extends i{get timeExtent(){return n(this.i3slayer,this.view?.timeExtent,this._get("timeExtent"))}get mergedFilter(){const{filter:t,timeExtent:e}=this;if(null==e)return t;const r=t?.clone()??new s;return null!=e&&(r.timeExtent=r.timeExtent?.intersection(e)??e),r}getTimeFilterDependencies(){const{timeInfo:t}=this.i3slayer;if(null==t)return[];const{startField:e,endField:r}=t;return[e,r]}addTimeFilter(t,e){if(null==e)return;const{timeInfo:r}=this.i3slayer;if(null==r)return;const{startField:i,endField:s,useTime:n}=r;if(!n||null==i&&null==s)return;const o=r.toJSON(),l=e.toJSON();t.push(((t,e)=>a(t,e,o,l)))}};return t([e({readOnly:!0})],o.prototype,"timeExtent",null),t([e()],o.prototype,"mergedFilter",null),o=t([r("esri.views.3d.layers.support.TemporalSceneLayerView")],o),o};function a(t,e,r,s){const n=e.attributeInfo?.attributeData;if(null==n)return;const{startTimeField:o,endTimeField:u}=r;if(!!(null!=o&&null==n[o]||null!=u&&null==n[u]))return;const a=i(r,s,new m(n));if(null==a)return;const{featureIds:p}=e;l(t,p,a)}class m{constructor(t){this.attributeData=t}getAttribute(t,e){return o(this.attributeData[e],t)}getAttributeAsTimestamp(t,e){const r=this.getAttribute(t,e);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}}export{u as TemporalSceneLayerView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{BufferViewVec2f16 as e,BufferViewVec2f as t,BufferViewVec2f64 as i,BufferViewVec3f16 as s,BufferViewVec3f as r,BufferViewVec3f64 as n,BufferViewVec4f16 as h,BufferViewVec4f as d,BufferViewVec4f64 as u,BufferViewMat3f as f,BufferViewMat3f64 as o,BufferViewMat4f as l,BufferViewMat4f64 as p,BufferViewVec4u8 as c,BufferViewFloat16 as a,BufferViewFloat as _,BufferViewFloat64 as F,BufferViewUint8 as y,BufferViewUint16 as m,BufferViewInt8 as b,BufferViewVec2i8 as g,BufferViewVec2i16 as w,BufferViewVec2u8 as v,BufferViewVec4u16 as E,BufferViewUint32 as M,BufferViewVec3u8 as T,BufferViewVec2u16 as A,BufferViewVec3u16 as B,BufferViewVec2u32 as U,BufferViewVec3u32 as C,BufferViewVec4u32 as L,BufferViewVec3i8 as j,BufferViewVec4i8 as x,BufferViewInt16 as z,BufferViewVec3i16 as $,BufferViewVec4i16 as V,BufferViewInt32 as k,BufferViewVec2i32 as q,BufferViewVec3i32 as D,BufferViewVec4i32 as G}from"../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as H}from"../../../../geometry/support/buffer/types.js";import{assert as I}from"../../webgl-engine/lib/Util.js";class J{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const i of e.fields.keys()){const t=e.fields.get(i);this[i]=new t.constructor(this.buffer,t.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const i=this[e];return i&&i.elementCount===t.ElementCount&&i.elementType===t.ElementType?i:null}slice(e,t){return new J(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,i=0,s=e.count){const r=this.stride;if(r%4==0){const n=new Uint32Array(e.buffer,t*r,s*r/4);new Uint32Array(this.buffer,i*r,s*r/4).set(n)}else{const n=new Uint8Array(e.buffer,t*r,s*r);new Uint8Array(this.buffer,i*r,s*r).set(n)}return this}get cachedMemory(){return this.byteLength}dispose(){}}class K{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach((e=>this._fields.set(e[0],{...e[1],constructor:R(e[1].constructor)}))))}freeze(){return this}vec2f16(t,i){return this._appendField(t,e,i),this}vec2f(e,i){return this._appendField(e,t,i),this}vec2f64(e,t){return this._appendField(e,i,t),this}vec3f16(e,t){return this._appendField(e,s,t),this}vec3f(e,t){return this._appendField(e,r,t),this}vec3f64(e,t){return this._appendField(e,n,t),this}vec4f16(e,t){return this._appendField(e,h,t),this}vec4f(e,t){return this._appendField(e,d,t),this}vec4f64(e,t){return this._appendField(e,u,t),this}mat3f(e,t){return this._appendField(e,f,t),this}mat3f64(e,t){return this._appendField(e,o,t),this}mat4f(e,t){return this._appendField(e,l,t),this}mat4f64(e,t){return this._appendField(e,p,t),this}vec4u8(e,t){return this._appendField(e,c,t),this}f16(e,t){return this._appendField(e,a,t),this}f32(e,t){return this._appendField(e,_,t),this}f64(e,t){return this._appendField(e,F,t),this}u8(e,t){return this._appendField(e,y,t),this}u16(e,t){return this._appendField(e,m,t),this}i8(e,t){return this._appendField(e,b,t),this}vec2i8(e,t){return this._appendField(e,g,t),this}vec2i16(e,t){return this._appendField(e,w,t),this}vec2u8(e,t){return this._appendField(e,v,t),this}vec4u16(e,t){return this._appendField(e,E,t),this}u32(e,t){return this._appendField(e,M,t),this}_appendField(e,t,i){if(this._fields.has(e))return void I(!1,`${e} already added to vertex buffer layout`);const s=t.ElementCount*H(t.ElementType),r=this._stride;this._fields.set(e,{constructor:t,size:s,offset:r,optional:i}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach((i=>{const s=H(i.constructor.ElementType);e=Math.floor((e+s-1)/s)*s,i.offset=e,e+=i.size,t=Math.max(t,s)})),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new J(this,e)}createView(e){return new J(this,e)}clone(){const e=new K;return e._stride=this._stride,e._fields=new Map,this._fields.forEach(((t,i)=>e._fields.set(i,t))),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function N(){return new K}class O{constructor(e){this.fields=new Array,e.fields.forEach(((e,t)=>{const i={...e,constructor:Q(e.constructor)};this.fields.push([t,i])})),this.stride=e.stride}}const P=[_,t,r,d,f,l,F,i,n,u,o,p,y,v,T,c,m,A,B,E,M,U,C,L,b,g,j,x,z,w,$,V,k,q,D,G];function Q(e){return`${e.ElementType}_${e.ElementCount}`}function R(e){return S.get(e)}const S=new Map;P.forEach((e=>S.set(Q(e),e)));export{J as InterleavedBuffer,K as InterleavedLayout,O as PackedLayout,N as newLayout};
5
+ import{BufferViewVec2f16 as e,BufferViewVec2f as t,BufferViewVec2f64 as i,BufferViewVec3f16 as s,BufferViewVec3f as r,BufferViewVec3f64 as n,BufferViewVec4f16 as h,BufferViewVec4f as d,BufferViewVec4f64 as u,BufferViewMat3f as f,BufferViewMat3f64 as o,BufferViewMat4f as l,BufferViewMat4f64 as p,BufferViewVec4u8 as c,BufferViewFloat16 as a,BufferViewFloat as _,BufferViewFloat64 as F,BufferViewUint8 as y,BufferViewUint16 as m,BufferViewInt8 as b,BufferViewVec2i8 as g,BufferViewVec2i16 as w,BufferViewVec2u8 as v,BufferViewVec2u16 as E,BufferViewVec4u16 as M,BufferViewUint32 as T,BufferViewVec3u8 as A,BufferViewVec3u16 as B,BufferViewVec2u32 as U,BufferViewVec3u32 as C,BufferViewVec4u32 as L,BufferViewVec3i8 as j,BufferViewVec4i8 as x,BufferViewInt16 as z,BufferViewVec3i16 as $,BufferViewVec4i16 as V,BufferViewInt32 as k,BufferViewVec2i32 as q,BufferViewVec3i32 as D,BufferViewVec4i32 as G}from"../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as H}from"../../../../geometry/support/buffer/types.js";import{assert as I}from"../../webgl-engine/lib/Util.js";class J{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const i of e.fields.keys()){const t=e.fields.get(i);this[i]=new t.constructor(this.buffer,t.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const i=this[e];return i&&i.elementCount===t.ElementCount&&i.elementType===t.ElementType?i:null}slice(e,t){return new J(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,i=0,s=e.count){const r=this.stride;if(r%4==0){const n=new Uint32Array(e.buffer,t*r,s*r/4);new Uint32Array(this.buffer,i*r,s*r/4).set(n)}else{const n=new Uint8Array(e.buffer,t*r,s*r);new Uint8Array(this.buffer,i*r,s*r).set(n)}return this}get cachedMemory(){return this.byteLength}dispose(){}}class K{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach((e=>this._fields.set(e[0],{...e[1],constructor:R(e[1].constructor)}))))}freeze(){return this}vec2f16(t,i){return this._appendField(t,e,i),this}vec2f(e,i){return this._appendField(e,t,i),this}vec2f64(e,t){return this._appendField(e,i,t),this}vec3f16(e,t){return this._appendField(e,s,t),this}vec3f(e,t){return this._appendField(e,r,t),this}vec3f64(e,t){return this._appendField(e,n,t),this}vec4f16(e,t){return this._appendField(e,h,t),this}vec4f(e,t){return this._appendField(e,d,t),this}vec4f64(e,t){return this._appendField(e,u,t),this}mat3f(e,t){return this._appendField(e,f,t),this}mat3f64(e,t){return this._appendField(e,o,t),this}mat4f(e,t){return this._appendField(e,l,t),this}mat4f64(e,t){return this._appendField(e,p,t),this}vec4u8(e,t){return this._appendField(e,c,t),this}f16(e,t){return this._appendField(e,a,t),this}f32(e,t){return this._appendField(e,_,t),this}f64(e,t){return this._appendField(e,F,t),this}u8(e,t){return this._appendField(e,y,t),this}u16(e,t){return this._appendField(e,m,t),this}i8(e,t){return this._appendField(e,b,t),this}vec2i8(e,t){return this._appendField(e,g,t),this}vec2i16(e,t){return this._appendField(e,w,t),this}vec2u8(e,t){return this._appendField(e,v,t),this}vec2u16(e,t){return this._appendField(e,E,t),this}vec4u16(e,t){return this._appendField(e,M,t),this}u32(e,t){return this._appendField(e,T,t),this}_appendField(e,t,i){if(this._fields.has(e))return void I(!1,`${e} already added to vertex buffer layout`);const s=t.ElementCount*H(t.ElementType),r=this._stride;this._fields.set(e,{constructor:t,size:s,offset:r,optional:i}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach((i=>{const s=H(i.constructor.ElementType);e=Math.floor((e+s-1)/s)*s,i.offset=e,e+=i.size,t=Math.max(t,s)})),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new J(this,e)}createView(e){return new J(this,e)}clone(){const e=new K;return e._stride=this._stride,e._fields=new Map,this._fields.forEach(((t,i)=>e._fields.set(i,t))),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function N(){return new K}class O{constructor(e){this.fields=new Array,e.fields.forEach(((e,t)=>{const i={...e,constructor:Q(e.constructor)};this.fields.push([t,i])})),this.stride=e.stride}}const P=[_,t,r,d,f,l,F,i,n,u,o,p,y,v,A,c,m,E,B,M,T,U,C,L,b,g,j,x,z,w,$,V,k,q,D,G];function Q(e){return`${e.ElementType}_${e.ElementCount}`}function R(e){return S.get(e)}const S=new Map;P.forEach((e=>S.set(Q(e),e)));export{J as InterleavedBuffer,K as InterleavedLayout,O as PackedLayout,N as newLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{releaseMaybe as t}from"../../../core/maybe.js";import{g as e}from"../../../chunks/vec32.js";import{empty as s}from"../../../geometry/support/aaBoundingBox.js";import{internalAssert as i}from"./terrainUtils.js";import{decompressNormal as r,compressNormal as n}from"../webgl-engine/lib/Normals.js";class d{constructor(){this.indices=null,this.indexCount=0,this.edgeIndicesStartIndex=0,this.poleIndicesStartIndex=0,this.vertexAttributes=null,this.edgeVerticesStartIndex=0,this.poleVerticesStartIndex=0,this.maxEdgeVertexCount=0,this.boundingBox=s(),this.numVerticesPerSide=0,this.minu=0,this.minv=0,this.maxu=1,this.maxv=1,this.outerEdgesOffsetAndLength=[0,0,0,0,0,0,0,0]}release(){this.vertexAttributes=t(this.vertexAttributes),this.indices=null}reset(){this.indices=null,this.vertexAttributes=null,s(this.boundingBox),this.numVerticesPerSide=0}getEdgeFirstVertexIndex(t){return this.outerEdgesOffsetAndLength[2*t]}getEdgeCount(t){return this.outerEdgesOffsetAndLength[2*t+1]}getEdgeVertexIndex(t,e){return this.getEdgeAttributeIndex(t,e)}getEdgeVertexPosition(t,s,i,r){this._getEdgeVertexRaw(this.getEdgeAttributeIndex(t,r),s),e(s,s,i)}getEdgeNormal(t,e,s){const{typedBuffer:i,typedBufferStride:n}=this.vertexAttributes.normalCompressed;r(e,i,this.getEdgeAttributeIndex(t,s),n)}setEdgeNormalFromValues(t,e,s,i,r){this._setNormal(this.getEdgeAttributeIndex(t,e),s,i,r)}setEdgeVertexFromValuesRawPositionUV(t,e,s,i,r,n,d){const o=this.getEdgeAttributeIndex(t,e);this.vertexAttributes.position.setValues(o,s,i,r),this._setUV(o,n,d)}setEdgeVertexFromValuesRawPositionUVNormal(t,e,s,i,r,n,d,o,u,g){const h=this.getEdgeAttributeIndex(t,e);this.vertexAttributes.position.setValues(h,s,i,r),this._setUV(h,n,d),this._setNormal(h,o,u,g)}_getEdgeVertexRaw(t,e){this.vertexAttributes.position.getVec(t,e)}_setNormal(t,e,s,i){const{typedBuffer:r,typedBufferStride:d}=this.vertexAttributes.normalCompressed;n(r,t,e,s,i,d)}_setUV(t,e,s){this.vertexAttributes.uv0.setValues(t,e,s)}getEdgeAttributeIndex(t,e){return i(0<=e&&e<this.getEdgeCount(t)),this.getEdgeFirstVertexIndex(t)+e}}export{d as PatchGeometry};
5
+ import{releaseMaybe as t}from"../../../core/maybe.js";import{maxUint16 as e}from"../../../core/typedArrayUtil.js";import{g as s}from"../../../chunks/vec32.js";import{empty as i}from"../../../geometry/support/aaBoundingBox.js";import{internalAssert as r}from"./terrainUtils.js";import{decompressNormal as n,compressNormal as o}from"../webgl-engine/lib/Normals.js";class d{constructor(){this.indices=null,this.indexCount=0,this.edgeIndicesStartIndex=0,this.poleIndicesStartIndex=0,this.vertexAttributes=null,this.edgeVerticesStartIndex=0,this.poleVerticesStartIndex=0,this.maxEdgeVertexCount=0,this.boundingBox=i(),this.numVerticesPerSide=0,this.minu=0,this.minv=0,this.maxu=1,this.maxv=1,this.outerEdgesOffsetAndLength=[0,0,0,0,0,0,0,0]}release(){this.vertexAttributes=t(this.vertexAttributes),this.indices=null}reset(){this.indices=null,this.vertexAttributes=null,i(this.boundingBox),this.numVerticesPerSide=0}getEdgeFirstVertexIndex(t){return this.outerEdgesOffsetAndLength[2*t]}getEdgeCount(t){return this.outerEdgesOffsetAndLength[2*t+1]}getEdgeVertexIndex(t,e){return this.getEdgeAttributeIndex(t,e)}getEdgeVertexPosition(t,e,i,r){this._getEdgeVertexRaw(this.getEdgeAttributeIndex(t,r),e),s(e,e,i)}getEdgeNormal(t,e,s){const{typedBuffer:i,typedBufferStride:r}=this.vertexAttributes.normalCompressed;n(e,i,this.getEdgeAttributeIndex(t,s),r)}setEdgeNormalFromValues(t,e,s,i,r){this._setNormal(this.getEdgeAttributeIndex(t,e),s,i,r)}setEdgeVertexFromValuesRawPositionUV(t,e,s,i,r,n,o){const d=this.getEdgeAttributeIndex(t,e);this.vertexAttributes.position.setValues(d,s,i,r),this._setUV(d,n,o)}setEdgeVertexFromValuesRawPositionUVNormal(t,e,s,i,r,n,o,d,u,g){const h=this.getEdgeAttributeIndex(t,e);this.vertexAttributes.position.setValues(h,s,i,r),this._setUV(h,n,o),this._setNormal(h,d,u,g)}_getEdgeVertexRaw(t,e){this.vertexAttributes.position.getVec(t,e)}_setNormal(t,e,s,i){const{typedBuffer:r,typedBufferStride:n}=this.vertexAttributes.normalCompressed;o(r,t,e,s,i,n)}_setUV(t,s,i){this.vertexAttributes.uv0.setValues(t,Math.round(s*e),Math.round(i*e))}getEdgeAttributeIndex(t,e){return r(0<=e&&e<this.getEdgeCount(t)),this.getEdgeFirstVertexIndex(t)+e}}export{d as PatchGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isPowerOfTwo as e,clamp as t}from"../../../core/mathUtils.js";import{empty as n}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as o}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as s}from"./ElevationData.js";import{PatchType as r}from"./interfaces.js";import{NeighborIndex as i}from"./NeighborIndex.js";import{PatchGeometryLUT as a}from"./PatchGeometryLUT.js";import{neighborTileIfLoadedOrSelf as c,zeroToFour as l}from"./PatchRenderData.js";import{internalAssert as u,enableTerrainInternalChecks as d,neighborEdgeIndices as f,almostEquals as m}from"./terrainUtils.js";import{isCornerNeighbor as g}from"./Tile.js";import{compareTilesByLij as p}from"./tileUtils.js";import{compressNormal as x}from"../webgl-engine/lib/Normals.js";const h=65536;function M(e,t){const{tile:o,geometry:s,geometryState:i}=e,{extentInRadians:a,surface:c}=o,{isWebMercator:l,renderer:u}=c,{numVerticesPerSide:d,wireframe:f}=i,m=d-1,g=(d-2)**2,p=l&&(t===r.HAS_SOUTH_POLE||t===r.HAS_BOTH_POLES),x=l&&(t===r.HAS_NORTH_POLE||t===r.HAS_BOTH_POLES),h=((p?1:0)+(x?1:0))*ge*d,M=de(i),v=g+h+4*M,V=u.tileGeometryCache.acquire(v);s.numVerticesPerSide=d,s.vertexAttributes=V,s.maxEdgeVertexCount=M;const{boundingBox:B}=s;n(B);const b=E(e);se.update(m,a,b),y(e),s.poleVerticesStartIndex=g;const L=S(e,p,x);s.edgeVerticesStartIndex=g+h,Q(e),I(e),_(s,L,f),e.intersectionData=null}function S(e,t,n){const{tile:o,localOrigin:s,geometry:r}=e,{extent:i,ellipsoid:a}=o,{boundingBox:c,numVerticesPerSide:l,vertexAttributes:u,poleVerticesStartIndex:d}=r,f=l-1,m=s[0],g=s[1],p=s[2],h=a.radius,M=i[1],S=i[3],y=[];let v=d;const V=(e,t)=>{const n=t*l;ue(-m,-g,e*h-p,c),y.push(new ne(1===e,n,1===e?0:2,v,ge));const o=C(-1===e?M:S,h),s=e*Math.PI/2-o,r=.99*(1===e?1:-1),i=h+0,{position:a,uv0:d}=u,{typedBuffer:V,typedBufferStride:B}=u.normalCompressed;for(let l=1;l<=ge;++l){const e=o+s*(l/ge),t=Math.cos(e),n=Math.sin(e);for(let o=0;o<=f;o++){const e=o/f,s=se.sinLonLUT[o],l=se.cosLonLUT[o]*t,u=s*t,h=n,M=l*i-m,S=u*i-g,y=h*i-p;ue(M,S,y,c),a.setValues(v,M,S,y),d.setValues(v,e,r),x(V,v,l,u,h,B),++v}}};return t&&V(-1,0),n&&V(1,f),y}function y(e){const{tile:t}=e;if(!t.intersectsClippingArea)return;const{geometry:n,geometryState:o,localOrigin:r}=e,{numVerticesPerSide:i,samplerData:a}=o,c=i-2,l=i-1,{vertexAttributes:u,boundingBox:d}=n,{position:f,uv0:m}=u,{typedBuffer:g,typedBufferStride:p}=u.normalCompressed,{extent:h}=t,M=h[0],S=h[2],y=h[1],v=h[3],V=t.ellipsoid.radius,B=r[0],I=r[1],b=r[2],L=f.typedBuffer,C=f.typedBufferStride,A=1/l;let P=0;if(1<=c){const e=A,t=y*(1-e)+v*e,n=se.sinLatLUT[1],o=se.cosLatLUT[1];for(let r=1;r<=c;r++){const i=r*A,c=M*(1-i)+S*i,l=se.sinLonLUT[r],u=se.cosLonLUT[r],f=V+s(c,t,a),g=f*u*o-B,p=f*l*o-I,x=f*n-b;ue(g,p,x,d);const h=(r-1)*C;L[h]=g,L[h+1]=p,L[h+2]=x,m.setValues(r-1,i,e)}}for(let E=1;E<=c;E++){const e=E*A,t=y*(1-e)+v*e,n=se.sinLatLUT[E],o=se.cosLatLUT[E],r=E+1,i=r*A,u=y*(1-i)+v*i,f=se.sinLatLUT[r],h=se.cosLatLUT[r],O=se.sinLonLUT[0],T=se.cosLonLUT[0],D=V+s(M,t,a);let R=T*o*D-B,U=O*o*D-I,N=n*D-b;const w=P*C;let j=L[w],F=L[w+1],H=L[w+2];for(let v=1;v<=c;v++){const e=v*A,r=M*(1-e)+S*e,O=se.sinLonLUT[v],T=se.cosLonLUT[v];let D=0,w=0,q=0;if(v<c){const e=(P+1)*C;D=L[e],w=L[e+1],q=L[e+2]}else{const e=se.sinLonLUT[l],r=se.cosLonLUT[l],i=V+s(S,t,a);D=r*o*i-B,w=e*o*i-I,q=n*i-b}const _=R,W=U,k=N;R=j,U=F,N=H,j=D,F=w,H=q;const z=D-_,G=w-W,J=q-k;let K=0,Q=0,X=0;if(E>1){const e=(P-c)*C;K=L[e],Q=L[e+1],X=L[e+2]}else{const e=se.sinLatLUT[0],t=se.cosLatLUT[0],n=V+s(r,y,a);K=T*t*n-B,Q=O*t*n-I,X=e*n-b}const Y=V+s(r,u,a),Z=T*h*Y-B,$=O*h*Y-I,ee=f*Y-b;if(E<c){const t=P+c,n=t*C;L[n]=Z,L[n+1]=$,L[n+2]=ee,ue(Z,$,ee,d),m.setValues(t,e,i)}const te=K-Z,ne=Q-$,oe=X-ee;let re=T*o,ie=O*o,ae=n;ae*ae<.999&&(re=J*ne-G*oe,ie=z*oe-J*te,ae=G*te-z*ne);const ce=1/Math.sqrt(re*re+ie*ie+ae*ae);x(g,P,re*ce,ie*ce,ae*ce,p),++P}}}function v(e){e.tile.intersectsClippingArea&&(I(e),ee(e),e.intersectionData=null)}function V(e){e.tile.intersectsClippingArea&&(X(e),I(e),ee(e),te(e),e.intersectionData=null)}function B(e){e.tile.intersectsClippingArea&&(L(e),b(e,!0),ee(e),e.intersectionData=null)}function I(e){e.tile.intersectsClippingArea&&(L(e),b(e))}function b(t,n=!1){const{geometry:o,geometryState:r,tile:i,localOrigin:a}=t,{level:l,extent:g,extentInRadians:x,ellipsoid:h}=i,M=h.radius,S=x[0],y=x[2],v=x[1],V=x[3],{samplerData:B}=r,I=g[0],b=g[2],L=g[1],C=g[3],A=E(t),{boundingBox:P,vertexAttributes:O}=o,T=a[0],D=a[1],R=a[2],{position:U,uv0:N}=O,w=U.typedBuffer,j=U.typedBufferStride;for(let E=0;E<4;++E){const a=1===E||3===E,x=r.edgeResolutions[E];u(e(x));const h=x+1,O=c(i,r.edgePeerNeighbors[E]);if(ae(i,O,E)){Y(t,E,O);continue}const U=null!=O;u(!U||O.level===i.level),u(!U||p(i,O)<=0);const F=O?.renderData,H=F?.geometryState;if(d){const e=i.surface;if(!O&&e&&!e.updatingRootTiles){const t=f[E],n=i.findNeighborTile(t,(e=>e.loaded||e.leaf||e.level===i.level));n?n.intersectsClippingArea&&(u(!n.loaded),u(!n.leaf),u(n.level===l)):u(null==e?.rootTiles||!i.shouldHaveNeighbor(t))}}const q=1===E?g[2]:g[0],_=O?.extent,W=_&&a?1===E?_[0]:_[2]:q,k=0===E?g[3]:g[1],z=1===E?1:0,G=0===E?1:0,J=1===E?y:S,K=0===E?V:v,Q=Math.sin(J),X=Math.cos(J),Z=Math.sin(K),$=Math.cos(K),ee=H?.samplerData,te=U?(e,t,n)=>.5*(s(e,t,B)+s(n,t,ee)):(e,t,n)=>s(e,t,B),ne=o.outerEdgesOffsetAndLength[2*E+0],oe=n&&h>3?h-3:1,se=null!=B&&B.some((e=>null!=e)),re=null!=ee&&ee.some((e=>null!=e)),ie=se||re,ce=1/x,le=ne;u(!_||m(_[2]-_[0],g[2]-g[0]));(()=>{const e=1===E?-1:3===E?1:0,t=0===E?-1:2===E?1:0,n=(g[2]-g[0])*ce,r=e*n,i=t*n,c=a?e*((y-S)*ce):0,l=a?0:t*ce,u=G,d=a?J+c:J,f=a?Math.sin(d):Q,m=a?Math.cos(d):X,p=a?J-c:J,x=a?Math.sin(p):Q,v=a?Math.cos(p):X,V=a?K:A(u+l),O=a?Z:Math.sin(V),F=a?$:Math.cos(V),H=a?K:A(u-l),_=a?Z:Math.sin(H),Y=a?$:Math.cos(H);let ne=0,se=0,re=0;{const e=0*ce,t=a?q:I*(1-e)+b*e,n=a?W:t,o=a?L*(1-e)+C*e:k,s=a?J:S*(1-e)+y*e,r=a?Q:Math.sin(s),i=a?X:Math.cos(s),c=a?A(e):K,l=a?Math.sin(c):Z,u=a?Math.cos(c):$,d=M+te(t,o,n);ne=i*u*d,se=r*u*d,re=l*d}let ae=0,de=0,fe=0;{const e=1*ce,t=a?q:I*(1-e)+b*e,n=a?W:t,o=a?L*(1-e)+C*e:k,s=a?J:S*(1-e)+y*e,r=a?Q:Math.sin(s),i=a?X:Math.cos(s),c=a?A(e):K,l=a?Math.sin(c):Z,u=a?Math.cos(c):$,d=M+te(t,o,n);ae=i*u*d,de=r*u*d,fe=l*d}for(let g=1;g<h-1;g+=oe){let e=0,t=0,n=0;{const o=(g+1)*ce,s=a?q:I*(1-o)+b*o,r=a?W:s,i=a?L*(1-o)+C*o:k,c=a?J:S*(1-o)+y*o,l=a?Q:Math.sin(c),u=a?X:Math.cos(c),d=a?A(o):K,f=a?Math.sin(d):Z,m=a?Math.cos(d):$,p=M+te(s,i,r);e=u*m*p,t=l*m*p,n=f*p}const c=e,l=t,u=n,d=ae,p=de,h=fe;ae=c,de=l,fe=u;{const e=le+g,t=e*j,n=d-T,o=p-D,s=h-R;w[t]=n,w[t+1]=o,w[t+2]=s,ue(n,o,s,P);const r=g*ce,i=a?z:r,c=a?r:G;N.setValues(e,i,c)}const V=ne,H=se,oe=re;ne=d,se=p,re=h;const me=d,ge=p,pe=h,xe=1/Math.sqrt(me*me+ge*ge+pe*pe),he=pe*xe;let Me=0,Se=0,ye=0;if(ie&&he*he<.999){let e=0,t=0,n=0;{const o=0===E?-1:1;e=o*(c-V),t=o*(l-H),n=o*(u-oe)}{const o=g*ce,c=a?q:I*(1-o)+b*o,l=a?W:c,u=a?L*(1-o)+C*o:k,d=a?J:S*(1-o)+y*o,p=a?Q:Math.sin(d),h=a?X:Math.cos(d),V=a?A(o):K,P=a?Math.sin(V):Z,T=a?Math.cos(V):$;let D=me,R=ge,N=pe;if(U){const e=M+s(l-r,u-i,ee),t=a?T:Y;D=(a?v:h)*t*e,R=(a?x:p)*t*e,N=(a?P:_)*e}{const o=M+s(c+r,u+i,B),l=a?T:F,d=(a?m:h)*l*o,g=(a?f:p)*l*o,x=(a?P:O)*o;U||(D=2*me-d,R=2*ge-g,N=2*pe-x);const S=3===E?-1:1,y=S*(D-d),v=S*(R-g),V=S*(N-x);Me=n*v-t*V,Se=e*V-n*y,ye=t*y-e*v;const I=1/Math.sqrt(Me*Me+Se*Se+ye*ye);Me*=I,Se*=I,ye*=I}}}else Me=me*xe,Se=ge*xe,ye=pe*xe;o.setEdgeNormalFromValues(E,g,Me,Se,ye)}})()}}function L(e){Z(e)}function C(e,t){return Math.PI/2-2*Math.atan(Math.exp(-e/t))}function A(e,t,n,o){return C(e*(1-o)+t*o,n)}function P(e,t,n){return e*(1-n)+t*n}function E(e){const{tile:t}=e;if(t.surface.isWebMercator){const e=t.extent,n=t.ellipsoid.radius;return t=>A(e[1],e[3],n,t)}const n=t.extentInRadians;return e=>P(n[1],n[3],e)}function O(e,t){const{tile:o,geometryState:s,geometry:r}=e,{extent:i,surface:a}=o,{wireframe:c}=s,l=i[0],u=i[1],d=i[2]-l,f=i[3]-u,{numVerticesPerSide:m,clippingArea:g}=s,p=null!=g?Math.max(0,(g[0]-l)/d):0,x=null!=g?Math.max(0,(g[1]-u)/f):0,h=null!=g?Math.min(1,(g[2]-l)/d):1,M=null!=g?Math.min(1,(g[3]-u)/f):1,S=(m-2)**2,y=de(s),v=S+4*y,V=a.renderer.tileGeometryCache.acquire(v),{boundingBox:B}=r;n(B),r.numVerticesPerSide=m,r.vertexAttributes=V,r.maxEdgeVertexCount=y,r.minu=p,r.minv=x,r.maxu=h,r.maxv=M,T(e),r.edgeVerticesStartIndex=S,Q(e),N(e),_(r,[],c),e.intersectionData=null}function T(e){const n=e.tile;if(!n.intersectsClippingArea)return;const{geometry:o,geometryState:r,localOrigin:i}=e,{samplerData:a,clippingArea:c,numVerticesPerSide:l}=r,{surface:u,extent:d,ellipsoid:f}=n,{isWebMercatorOnPlateCarree:m}=u,g=null!=c?c:re,p=d[0],h=d[1],M=d[2],S=d[3],y=Math.max(p,g[0]),v=Math.min(M,g[2]),V=Math.max(h,g[1]),B=Math.min(S,g[3]),I=f.radius,b=n.horizontalScale,L=l-1,C=l-2,{minu:A,minv:P,maxu:E,maxv:O,boundingBox:T,vertexAttributes:D}=o,{position:R,uv0:U}=D,{typedBuffer:N,typedBufferStride:w}=D.normalCompressed,j=i[0],F=i[1],H=i[2],q=R.typedBuffer,_=R.typedBufferStride;let W=0;const k=t(h,V,B),z=m?(Math.PI/2-2*Math.atan(Math.exp(-k/I)))*I:k*b,G=1/L,J=t(h*(1-G)+S*G,V,B);let K=z,Q=m?(Math.PI/2-2*Math.atan(Math.exp(-J/I)))*I:J*b;for(let X=1;X<=C;X++){const e=X/L,n=t(h*(1-e)+S*e,V,B),o=t(e,P,O),r=Q,i=(X-1)/L,c=t(h*(1-i)+S*i,V,B),l=K,u=(X+1)/L,d=t(h*(1-u)+S*u,V,B),f=m?(Math.PI/2-2*Math.atan(Math.exp(-d/I)))*I:d*b,g=t(u,P,O);K=Q,Q=f;const D=t(p,y,v);let R=D*b,k=s(D,n,a);const z=1/L,G=t(z,A,E),J=t(p*(1-G)+M*G,y,v);let Y=G,Z=J,$=J*b,ee=s(J,n,a);if(1===X){const e=$-j,n=K-F,s=ee-H,r=0*_;q[r]=e,q[r+1]=n,q[r+2]=s,ue(e,n,s,T);const i=t(z,A,E);U.setValues(W,i,o)}for(let m=1;m<=C;m++){const e=$,i=ee,u=(m+1)/L,h=t(u,A,E),S=t(p*(1-u)+M*u,y,v),V=Z;Z=S;{const e=W+1,t=e*_;if(1===X||m===C){const i=S*b,c=s(S,n,a);if(1===X&&m<C){const n=i-j,s=r-F,a=c-H;q[t]=n,q[t+1]=s,q[t+2]=a,ue(n,s,a,T),U.setValues(e,h,o)}$=i,ee=c}else $=q[t]+j,ee=q[t+2]+H}const B=$,I=ee,P=R,O=k;R=e,k=i;const D=(W-C)*_,z=1===X?s(V,c,a):q[D+2]+H,G=s(V,d,a);if(X<C){const t=W+C,n=t*_,o=e-j,s=f-F,r=G-H;q[n]=o,q[n+1]=s,q[n+2]=r,ue(o,s,r,T);const i=Y;Y=h,U.setValues(t,i,g)}{const e=B-P,t=l-f,n=t*(I-O),o=e*(z-G),s=-t*e,r=n*n+o*o+s*s;if(0===r)x(N,W,0,0,1,w);else{const e=1/Math.sqrt(r);x(N,W,n*e,o*e,s*e,w)}}++W}}}function D(e,t){e.tile.intersectsClippingArea&&(j(e),w(e,!0),ee(e),e.intersectionData=null)}function R(e,t){e.tile.intersectsClippingArea&&(X(e),N(e),ee(e),te(e),e.intersectionData=null)}function U(e,t){e.tile.intersectsClippingArea&&(N(e),ee(e),e.intersectionData=null)}function N(e,t){e.tile.intersectsClippingArea&&(j(e),w(e,!1))}function w(n,o){const{geometry:r,geometryState:i,localOrigin:a}=n,l=n.tile,{surface:m,extent:g}=l,{clippingArea:x,samplerData:h}=i,M=null!=x?x:re,S=g[0],y=g[2],v=g[1],V=g[3],B=[V>M[3],y>M[2],v<M[1],S<M[0]],I=l.horizontalScale,b=q(m.isWebMercatorOnPlateCarree,l.ellipsoid.radius,I),{minu:L,minv:C,maxu:A,maxv:P,boundingBox:E}=r,O=Math.max(S,M[0]),T=Math.min(y,M[2]),D=Math.max(v,M[1]),R=Math.min(V,M[3]),U=a[0],N=a[1],w=a[2];for(let j=0;j<4;++j){const a=1===j||3===j,g=i.edgeResolutions[j];u(e(g));const x=g+1,M=B[j],F=c(l,i.edgePeerNeighbors[j]);if(!M&&ae(l,F,j)){Y(n,j,F);continue}const H=null!=F&&!M,q=F?.renderData,_=q?.geometryState;if(d&&(u(!H||F.level===l.level),u(!H||p(l,F)<=0),l&&!F&&!m.updatingRootTiles)){const e=f[j],t=l.findNeighborTile(e,(e=>e.loaded||e.leaf||e.level===l.level));m.updatingRootTiles||(t?t.intersectsClippingArea&&(u(!t.loaded),u(!t.leaf),u(t.level===l.level)):u(null==m?.rootTiles||!l.shouldHaveNeighbor(e)))}const W=t(1===j?y:S,O,T),k=t(0===j?V:v,D,R),z=_?.samplerData,G=o&&x>3?x-3:1,J=t(1===j?1:0,L,A),K=t(0===j?1:0,C,P),Q=H?(e,t)=>.5*(s(e,t,z)+s(e,t,h)):(e,t)=>s(e,t,h),X=(y-S)/g,Z=a?1===j?X:-X:0,$=a?0:0===j?X:-X,ee=-Z,te=-$;let ne=0,oe=0,se=0;{const e=0/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,s=Q(n,o);ne=n*I,oe=b(o),se=s}let re=0,ie=0,ce=0;{const e=1/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,s=Q(n,o);re=n*I,ie=b(o),ce=s}for(let e=1;e<x-1;e+=G){const n=e/g,o=re,i=ie,c=ce;{const s=a?J:t(n,L,A),l=a?t(n,C,P):K,u=o-U,d=i-N,f=c-w;ue(o,d,f,E),r.setEdgeVertexFromValuesRawPositionUV(j,e,u,d,f,s,l)}{const n=(e+1)/g,o=a?W:t(S*(1-n)+y*n,O,T),s=a?t(v*(1-n)+V*n,D,R):k,r=Q(o,s);re=o*I,ie=b(s),ce=r}const l=re,u=ce,d=ne,f=oe,m=se;ne=o,oe=i,se=c;let p=0,x=0,M=0;if(a){const e=ie-i,r=u-c,a=f-i,l=m-c,d=t(v*(1-n)+V*n,D,R),g=W+ee,S=g*I-o,y=s(g,d,h)-c,B=3===j?-1:1;if(p=B*(-a+e)*y,x=B*S*(-l+r),M=-B*S*(-a+e),H){const t=W+Z,n=t*I-o;p=(-a+e)*(y-(s(t,d,z)-c)),x=(S-n)*(-l+r),M=-(S-n)*(-a+e)}}else{const e=l-o,r=u-c,a=d-o,f=m-c,g=t(S*(1-n)+y*n,O,T),v=k+te,V=s(g,v,h)-c,B=b(v)-i,I=2===j?-1:1;if(p=I*B*(-f+r),x=I*(-a+e)*V,M=-I*B*(-a+e),H){const t=g,n=k+$,o=b(n)-i;p=(-B+o)*(-f+r),x=(-a+e)*(-V+(s(t,n,z)-c)),M=-(-B+o)*(-a+e)}}const B=1/Math.sqrt(p*p+x*x+M*M);r.setEdgeNormalFromValues(j,e,p*B,x*B,M*B)}}}function j(e,t){Z(e)}function F(e,t){return(Math.PI/2-2*Math.atan(Math.exp(-e/t)))*t}function H(e,t){return e*t}function q(e,t,n){return e?e=>F(e,t):e=>H(e,n)}function _(e,t,n){const{numVerticesPerSide:o,vertexAttributes:s,maxEdgeVertexCount:r}=e,i=o-1,a=s.count,c=2*(o-3)*(o-3),u=4*(i+r-3),d=l.reduce(((t,n)=>t+(i+e.getEdgeCount(n)-3)),0),f=t.reduce(((e,t)=>e+i*(2*(t.latitudeResolution-1)+1)),0),m=3*(n?2:1),g=(c+u+f)*m,p=a>=h?new Uint32Array(g):new Uint16Array(g);for(let l=0;l<g;++l)p[l]=0;e.indices=p,e.indexCount=(c+d+f)*m,e.poleIndicesStartIndex=c*m,e.edgeIndicesStartIndex=(c+f)*m,n?(G(e),J(e,t),K(e)):(W(e),k(e,t),z(e))}function W(e){const{numVerticesPerSide:t,indices:n,vertexAttributes:o}=e,{position:s}=o,{typedBuffer:r,typedBufferStride:i}=s,a=t-2,c=t-3,l=0,u=t-3;let d=0;for(let f=0;f<c;++f){const e=f*a;for(let t=l;t<u;++t){const o=e+t,s=o+1,c=s+a,l=c-1;fe(o,s,c,l,i,r)?(n[d]=o,n[d+1]=s,n[d+2]=c,n[d+3]=c,n[d+4]=l,n[d+5]=o):(n[d]=o,n[d+1]=s,n[d+2]=l,n[d+3]=l,n[d+4]=s,n[d+5]=c),d+=6}}}function k(e,t){const{numVerticesPerSide:n,indices:o,poleIndicesStartIndex:s}=e,r=n-1;let i=s;for(const a of t){const t=a.isNorth?1:2,s=a.isNorth?2:1,c=a.isNorth?3:4,l=a.isNorth?4:3;let u=e.getEdgeVertexIndex(a.connectedOuterEdgeOffset,0),d=1;for(let e=0;e<a.latitudeResolution;++e){const f=0===e?a.rowOffset:u+n;for(let n=0;n<r;n++){const r=f+n;o[i]=u,o[i+t]=u+1,o[i+s]=r,e<a.latitudeResolution-1?(o[i+c]=u+1,o[i+l]=r+1,o[i+5]=r,i+=6):i+=3,u+=d}u=f,d=1}}}function z(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,s=n-1,r=s-2;let i=o;for(let a=0;a<4;++a){const n=le[a];let o=0,c=0;const l=e.getEdgeCount(a),d=n.count;u(d===s-1);const f=1===a||2===a,m=f?1:2,g=f?2:1,p=e.getEdgeFirstVertexIndex(a),x=1,h=n.vertex0Index,M=n.stride;for(;o<l-1||c<d-1;){const e=h+c*M,n=p+o*x,a=o<l-1,u=c<d-1,f=a&&(!u||(a?0+s*(o+.5)/(l-1):0)<=(u?1+r*(c+.5)/(d-1):0));f?++o:++c;const S=f?n+x:e+M;t[i]=e,t[i+m]=n,t[i+g]=S,i+=3}}e.indexCount=i}function G(e){const{indices:t,numVerticesPerSide:n,vertexAttributes:o}=e,{position:s}=o,{typedBuffer:r,typedBufferStride:i}=s,a=n-2;let c=0;for(let l=0;l<n-3;++l){const e=l*a;for(let o=0;o<n-3;++o){const n=l*a+o,s=n+1,u=s+a,d=u-1,f=e+o,m=f+1,g=m+a;fe(f,m,g,g-1,i,r)?(me(t,c,n,s,u),c+=6,me(t,c,u,d,n)):(me(t,c,n,s,d),c+=6,me(t,c,d,u,s)),c+=6}}}function J(e,t){const{indices:n,numVerticesPerSide:o,poleIndicesStartIndex:s}=e,r=o-1;let i=s;for(const a of t){const t=a.connectedOuterEdgeOffset;let s=e.getEdgeVertexIndex(t,0),c=1;for(let e=0;e<a.latitudeResolution;++e){const t=0===e?a.rowOffset:s+o;for(let o=0;o<r;o++)me(n,i,s,s+1,t+o),i+=6,e<a.latitudeResolution-1&&(me(n,i,s+1,t+o+1,t+o),i+=6),s+=c;s=t,c=1}}}function K(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,s=n-1,r=s-2;let i=o;for(let a=0;a<4;++a){const n=le[a];let o=0,c=0;const l=e.getEdgeCount(a),d=n.count;u(d===s-1);const f=1===a||2===a,m=f?1:3,g=f?3:1,p=e.getEdgeFirstVertexIndex(a),x=1,h=n.vertex0Index,M=n.stride;for(;o<l-1||c<d-1;){const e=h+c*M,n=p+o*x,a=o<l-1,u=c<d-1,f=a&&(!u||(a?0+s*(o+.5)/(l-1):0)<=(u?1+r*(c+.5)/(d-1):0));f?++o:++c;const S=f?n+x:e+M;t[i]=e,t[i+m]=n,t[i+m+1]=n,t[i+g]=S,t[i+g+1]=S,t[i+5]=e,i+=6}}e.indexCount=i}function Q(e){const{geometry:t,geometryState:n}=e,{edgeResolutions:o}=n,{numVerticesPerSide:s,edgeVerticesStartIndex:r}=t,i=s-2;let a=r;for(let c=0;c<4;++c){{const e=0===c||2===c,t=(0===c?i-1:0)*i+(1===c?i-1:0),n=(e?0:1)*i+(e?1:0),o=le[c];o.vertex0Index=t,o.stride=n,o.count=i}{const e=o[c]+1;t.outerEdgesOffsetAndLength[2*c+0]=a,t.outerEdgesOffsetAndLength[2*c+1]=e,a+=e}}}function X(e){Q(e),e.geometryState.wireframe?K(e.geometry):z(e.geometry)}function Y(n,o,s){const{geometryState:r,geometry:i,tile:a,localOrigin:c}=n,l=1===o||3===o,d=r.edgeResolutions[o];u(e(d));const f=d+1,{boundingBox:m,minu:g,minv:p,maxu:x,maxv:h,vertexAttributes:M}=i,S=t(1===o?1:0,g,x),y=t(0===o?1:0,p,h),v=s.renderData,V=v.geometryState,B=v.geometry,I=(o+2)%4,b=B.getEdgeCount(I),L=a.getNeighborEdgeStartVertexIndex(o,s)*d,C=d*2**(a.level-s.level);u(V.edgeResolutions[I]===C),u(b-1===C);const A=v.localOrigin[0]-c[0],P=v.localOrigin[1]-c[1],E=v.localOrigin[2]-c[2],O=i.getEdgeFirstVertexIndex(o),{position:T,uv0:D}=M,R=T.typedBuffer,U=T.typedBufferStride,N=M.normalCompressed,w=N.typedBuffer,j=N.typedBufferStride,F=B.vertexAttributes,H=B.getEdgeFirstVertexIndex(I),q=F.position.typedBuffer,_=F.position.typedBufferStride,W=F.normalCompressed.typedBuffer,k=F.normalCompressed.typedBufferStride;for(let e=1;e<f-1;++e){const n=O+e,o=H+(L+e),s=n*U,r=o*_,i=q[r]+A,a=q[r+1]+P,c=q[r+2]+E;R[s]=i,R[s+1]=a,R[s+2]=c,ue(i,a,c,m);const u=n*j,f=o*k;w[u]=W[f],w[u+1]=W[f+1];const M=e/d,v=l?S:t(M,g,x),V=l?t(M,p,h):y;D.setValues(n,v,V)}}function Z(e){const{geometry:n,geometryState:o,localOrigin:r}=e,{clippingArea:i,samplerData:a}=o,{minu:c,minv:l,maxu:d,maxv:f,boundingBox:m,vertexAttributes:g}=n,x=e.tile,{surface:h,ellipsoid:M,extent:S,extentInRadians:y,horizontalScale:v}=x,V="local"===h.view?.viewingMode,B=M.radius;let I=0,b=0,L=0;const C=(e,t,n)=>{const o=y[0===t?1:3],s=y[0===e?0:2],r=Math.cos(o),i=Math.sin(o),a=Math.sin(s),c=Math.cos(s),l=B+n;I=c*r*l,b=a*r*l,L=i*l},A=V?(()=>{const e=i,n=null!=e&&(S[3]>e[3]||S[2]>e[2]||S[1]<e[1]||S[0]<e[0]),o=q(h.isWebMercatorOnPlateCarree,B,v);return(s,r,i)=>{const a=0===s?S[0]:S[2],c=0===r?S[1]:S[3],l=n?t(a,e[0],e[2]):a,u=n?t(c,e[1],e[3]):c,d=i;I=l*v,b=o(u),L=d}})():C;let P=0,O=0,T=0,D=0,R=0,U=0,N=0,w=0,j=0;const F=V&&h.isWebMercatorOnPlateCarree,H=(e,t,n,o,s)=>{let r=0,i=0,a=0;if(V){const e=t*v,s=F?(Math.PI/2-2*Math.atan(Math.exp(-n/B)))*B:n*v;r=e-I,i=s-b,a=o-L}else{const s=E(e),c=e.tile,l=c.extent,u=c.extentInRadians,d=(t-l[0])/(l[2]-l[0]),f=(n-l[1])/(l[3]-l[1]),m=u[0]*(1-d)+u[2]*d,g=s(f),p=Math.cos(g),x=Math.sin(g),h=Math.sin(m),M=Math.cos(m),S=B+o;r=M*p*S-I,i=h*p*S-b,a=x*S-L}switch(s){case 0:N+=r,w+=i,j+=a;break;case 1:D-=r,R-=i,U-=a;break;case 2:N-=r,w-=i,j-=a;break;case 3:D+=r,R+=i,U+=a}},_=i??re,W=S[0],k=S[2],z=S[1],G=S[3],J=[G>_[3],k>_[2],z<_[1],W<_[0]],K=Math.max(W,_[0]),Q=Math.min(k,_[2]),X=Math.max(z,_[1]),Y=Math.min(G,_[3]),Z=e=>Math.max(_[0],Math.min(_[2],e)),ee=e=>Math.max(_[1],Math.min(_[3],e)),te=e=>{const t=o.cornerNeighborCornerTiles;P=0,O=0,T=1,D=0,R=0,U=0,N=0,w=0,j=0;let n=1/0;for(let o=0;o<4;++o){const s=t[4*e+o];n=Math.min(n,s?.level??1/0)}for(let o=0;o<4;++o){const s=t[4*e+o];ie[o]=s?.level===n?s:null}let r=1,i=0;for(let o=0;o<4;++o){const e=ie[o];e&&(r=Math.max(r,e?.renderData.geometryState.numVerticesPerSide),i=e.extent[2]-e.extent[0])}const a=i,c=r;u(c>1);const l=a/c;for(let o=0;o<4;++o){const e=ie[(o+3)%4],t=ie[o%4];if(!e&&!t)continue;const n=0===o?1:1===o?2:2===o?3:0,r=0===o?2:1===o?3:2===o?0:1;if(e&&t){const i=oe[o][0]*l,a=oe[o][1]*l,c=e.extent,u=Z(c[0===n||1===n?2:0]+i),d=ee(c[0===n||3===n?3:1]+a),f=t.extent,m=Z(f[0===r||1===r?2:0]+i),g=ee(f[0===r||3===r?3:1]+a),p=e.renderData,x=t.renderData,h=s(u,d,p.geometryState.samplerData),M=s(m,g,x.geometryState.samplerData);H(p,u,d,.5*(h+M),o)}else{const i=e??t,a=e?n:r,c=i.extent,u=oe[o],d=Z(c[0===a||1===a?2:0]+u[0]*l),f=ee(c[0===a||3===a?3:1]+u[1]*l),m=i.renderData,g=s(d,f,m.geometryState.samplerData);H(m,d,f,g,o)}}if(!V){const e=Math.sqrt(I*I+b*b+L*L);P=I/e,O=b/e,T=L/e}if(V||T*T<.999){const e=Math.sqrt(D*D+R*R+U*U);D/=e,R/=e,U/=e;const t=Math.sqrt(N*N+w*w+j*j);N/=t,w/=t,j/=t,P=U*w-R*j,O=D*j-U*N,T=R*N-D*w;const n=1/Math.sqrt(P*P+O*O+T*T);P*=n,O*=n,T*=n}},ne=o.cornerNeighborCornerTiles;for(let E=0;E<4;++E){const e=E,i=(E+1)%4,h=0===E||1===E?1:0,M=0===E||3===E?1:0,S=t(h,c,d),y=t(M,l,f),v=n.getEdgeFirstVertexIndex(e),V=n.getEdgeCount(e),B=0===E||3===E?V-1:0,C=n.getEdgeFirstVertexIndex(i),D=n.getEdgeCount(i),R=0===E||1===E?D-1:0;let U=-1;for(let t=0;t<4;++t){const e=ne[4*E+t],n=ne[4*E+U];e&&(-1===U||p(n,e)>0)&&(U=t)}const N=U,w=ne[4*E+N];if(w!==x){const e=x.level-w.level,t=2**e,n=[w.lij[0]+e,w.lij[1]*t,w.lij[2]*t],s=[n[1]+t===x.lij[1],0===E&&(1===N||0===N&&w!==ne[4*E+3])||1===E&&(0===N||1===N&&w!==ne[4*E+2]),n[1]===x.lij[1]+1,2===E&&(3===N||2===N&&w!==ne[4*E+1])||3===E&&(2===N||3===N&&w!==ne[4*E+0])],i=s.reduce(((e,t)=>e+(t?1:0)),0);u(1===i||2===i);let a=-1,c=-1;const l=w.renderData;if(1===i){const e=s.findIndex((e=>e));u(0<=e&&e<=3),a=(e+2)%4;const t=o.edgeResolutions[e];c=x.getNeighborEdgeStartVertexIndex(e,w)*t+t*(0===e&&0===E||1===e&&0===E||2===e&&1===E||3===e&&3===E?1:0)}else{u(s[1]||s[3]),a=s[1]?3:1;const e=l.geometryState.edgeResolutions[a];c=0===E||3===E?0:e}const d=l.geometry;{const e=v+B,t=C+R,n=d.getEdgeFirstVertexIndex(a)+c,o=d.vertexAttributes,s=l.localOrigin,i=o.position,u=i.typedBuffer,f=n*i.typedBufferStride,p=u[f]+s[0]-r[0],x=u[f+1]+s[1]-r[1],h=u[f+2]+s[2]-r[2];ue(p,x,h,m);const M=g.position,V=M.typedBuffer,I=e*M.typedBufferStride;V[I]=p,V[I+1]=x,V[I+2]=h;const b=t*M.typedBufferStride;V[b]=p,V[b+1]=x,V[b+2]=h;const L=g.uv0;L.setValues(e,S,y),L.setValues(t,S,y);{const s=o.normalCompressed.typedBuffer,r=n*o.normalCompressed.typedBufferStride,i=g.normalCompressed,a=i.typedBuffer;{const t=e*i.typedBufferStride;a[t]=s[r],a[t+1]=s[r+1]}{const e=t*i.typedBufferStride;a[e]=s[r],a[e+1]=s[r+1]}}}}else{const o=J[e],c=J[i];let l;if(o||c){const e=t(W*(1-h)+k*h,K,Q),n=t(z*(1-M)+G*M,X,Y);l=s(e,n,a)}else l=$(ne,E);A(h,M,l),te(E);const u=I-r[0],d=b-r[1],f=L-r[2];ue(u,d,f,m),n.setEdgeVertexFromValuesRawPositionUVNormal(e,B,u,d,f,S,y,P,O,T),n.setEdgeVertexFromValuesRawPositionUVNormal(i,R,u,d,f,S,y,P,O,T)}}for(let t=0;t<4;++t)ie[t]=null}function $(e,t){const n=4*t,o=l.reduce(((t,o)=>Math.min(t,e[n+o]?.level??1/0)),1/0);d&&(u(!e[n+0]||!e[n+2]||g(e[n+0],e[n+2],i.SOUTH_WEST)),u(!e[n+1]||!e[n+3]||g(e[n+1],e[n+3],i.NORTH_WEST)));let r=0,a=0;for(let i=0;i<4;++i){const t=e[n+i];if(t&&t.level===o){const e=0===i||1===i,n=0===i||3===i,o=t.extent,c=o[e?0:2],l=o[n?1:3],u=t.renderData?.geometryState?.samplerData;a+=s(c,l,u),r++}}const c=r?a/r:0;return u(null!=c),c}function ee(e){const{vao:t,geometry:n}=e,{vertexAttributes:o,edgeVerticesStartIndex:s}=n,r=o.position.typedBuffer;t.vertexBuffers.get("geometry").setSubData(r,s,s,r.length)}function te(e){const{vao:t,geometry:n}=e,{indices:o,indexCount:s,edgeIndicesStartIndex:r}=n;t.indexBuffer.setSubData(o,r,r,s)}class ne{constructor(e,t,n,o,s){this.isNorth=e,this.connectedRowOffset=t,this.connectedOuterEdgeOffset=n,this.rowOffset=o,this.latitudeResolution=s}}const oe=[[0,1],[1,0],[0,-1],[-1,0]],se=new a,re=o(-1/0,-1/0,1/0,1/0),ie=[null,null,null,null];function ae(e,t,n){if(!t)return!1;const o=p(e,t);return o>0||0===o&&n>=2}class ce{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(e){return u(0<=e&&e<this.count),this.vertex0Index+this.stride*e}}const le=[new ce,new ce,new ce,new ce];function ue(e,t,n,o){e<o[0]?o[0]=e:e>o[3]&&(o[3]=e),t<o[1]?o[1]=t:t>o[4]&&(o[4]=t),n<o[2]?o[2]=n:n>o[5]&&(o[5]=n)}function de(e){const{edgeResolutions:t,numVerticesPerSide:n}=e,o=1+Math.max(...t);return Math.max(n,o)}function fe(e,t,n,o,s,r){const i=e*s,a=r[i],c=r[i+1],l=r[i+2],u=t*s,d=r[u],f=r[u+1],m=r[u+2],g=n*s,p=r[g],x=r[g+1],h=r[g+2],M=o*s,S=r[M],y=r[M+1],v=r[M+2];return(d-S)*(d-S)+(f-y)*(f-y)+(m-v)*(m-v)>(a-p)*(a-p)+(c-x)*(c-x)+(l-h)*(l-h)}function me(e,t,n,o,s){e[t]=n,e[t+1]=o,e[t+2]=o,e[t+3]=s,e[t+4]=s,e[t+5]=n}const ge=6;export{O as createPlanarGlobePatch,M as createSphericalGlobePatch,B as updateCornerSpherical,D as updateCornersPlanar,R as updateEdgeElevationsAndResolutionsPlanar,V as updateEdgeElevationsAndResolutionsSpherical,U as updateEdgesAndCornersPlanar,v as updateEdgesAndCornersSpherical};
5
+ import{isPowerOfTwo as e,clamp as t}from"../../../core/mathUtils.js";import{maxUint16 as n}from"../../../core/typedArrayUtil.js";import{empty as o}from"../../../geometry/support/aaBoundingBox.js";import{fromValues as r}from"../../../geometry/support/aaBoundingRect.js";import{sampleElevation as s}from"./ElevationData.js";import{PatchType as i}from"./interfaces.js";import{NeighborIndex as a}from"./NeighborIndex.js";import{PatchGeometryLUT as c}from"./PatchGeometryLUT.js";import{neighborTileIfLoadedOrSelf as l,zeroToFour as u}from"./PatchRenderData.js";import{internalAssert as d,enableTerrainInternalChecks as f,neighborEdgeIndices as m,almostEquals as g}from"./terrainUtils.js";import{isCornerNeighbor as h}from"./Tile.js";import{compareTilesByLij as p}from"./tileUtils.js";import{compressNormal as x}from"../webgl-engine/lib/Normals.js";const M=65536;function S(e,t){const{tile:n,geometry:r,geometryState:s}=e,{extentInRadians:a,surface:c}=n,{isWebMercator:l,renderer:u}=c,{numVerticesPerSide:d,wireframe:f}=s,m=d-1,g=(d-2)**2,h=l&&(t===i.HAS_SOUTH_POLE||t===i.HAS_BOTH_POLES),p=l&&(t===i.HAS_NORTH_POLE||t===i.HAS_BOTH_POLES),x=((h?1:0)+(p?1:0))*he*d,M=fe(s),S=g+x+4*M,V=u.tileGeometryCache.acquire(S);r.numVerticesPerSide=d,r.vertexAttributes=V,r.maxEdgeVertexCount=M;const{boundingBox:B}=r;o(B);const I=O(e);se.update(m,a,I),v(e),r.poleVerticesStartIndex=g;const L=y(e,h,p);r.edgeVerticesStartIndex=g+x,X(e),b(e),W(r,L,f),e.intersectionData=null}function y(e,t,o){const{tile:r,localOrigin:s,geometry:i}=e,{extent:a,ellipsoid:c}=r,{boundingBox:l,numVerticesPerSide:u,vertexAttributes:d,poleVerticesStartIndex:f}=i,m=u-1,g=s[0],h=s[1],p=s[2],M=c.radius,S=a[1],y=a[3],v=[];let V=f;const B=(e,t)=>{const o=t*u;de(-g,-h,e*M-p,l),v.push(new oe(1===e,o,1===e?0:2,V,he));const r=A(-1===e?S:y,M),s=e*Math.PI/2-r,i=.99*(1===e?1:-1),a=M+0,{position:c,uv0:f}=d,{typedBuffer:B,typedBufferStride:I}=d.normalCompressed;for(let u=1;u<=he;++u){const e=r+s*(u/he),t=Math.cos(e),o=Math.sin(e);for(let r=0;r<=m;r++){const e=r/m,s=se.sinLonLUT[r],u=se.cosLonLUT[r]*t,d=s*t,M=o,S=u*a-g,y=d*a-h,v=M*a-p;de(S,y,v,l),c.setValues(V,S,y,v),f.setValues(V,Math.round(e*n),Math.round(i*n)),x(B,V,u,d,M,I),++V}}};return t&&B(-1,0),o&&B(1,m),v}function v(e){const{tile:t}=e;if(!t.intersectsClippingArea)return;const{geometry:o,geometryState:r,localOrigin:i}=e,{numVerticesPerSide:a,samplerData:c}=r,l=a-2,u=a-1,{vertexAttributes:d,boundingBox:f}=o,{position:m,uv0:g}=d,{typedBuffer:h,typedBufferStride:p}=d.normalCompressed,{extent:M}=t,S=M[0],y=M[2],v=M[1],V=M[3],B=t.ellipsoid.radius,I=i[0],b=i[1],L=i[2],C=m.typedBuffer,A=m.typedBufferStride,P=1/u;let E=0;if(1<=l){const e=P,t=v*(1-e)+V*e,o=se.sinLatLUT[1],r=se.cosLatLUT[1];for(let i=1;i<=l;i++){const a=i*P,l=S*(1-a)+y*a,u=se.sinLonLUT[i],d=se.cosLonLUT[i],m=B+s(l,t,c),h=m*d*r-I,p=m*u*r-b,x=m*o-L;de(h,p,x,f);const M=(i-1)*A;C[M]=h,C[M+1]=p,C[M+2]=x,g.setValues(i-1,Math.round(a*n),Math.round(e*n))}}for(let O=1;O<=l;O++){const e=O*P,t=v*(1-e)+V*e,o=se.sinLatLUT[O],r=se.cosLatLUT[O],i=O+1,a=i*P,d=v*(1-a)+V*a,m=se.sinLatLUT[i],M=se.cosLatLUT[i],T=se.sinLonLUT[0],D=se.cosLonLUT[0],R=B+s(S,t,c);let U=D*r*R-I,N=T*r*R-b,w=o*R-L;const j=E*A;let F=C[j],H=C[j+1],q=C[j+2];for(let V=1;V<=l;V++){const e=V*P,i=S*(1-e)+y*e,T=se.sinLonLUT[V],D=se.cosLonLUT[V];let R=0,j=0,_=0;if(V<l){const e=(E+1)*A;R=C[e],j=C[e+1],_=C[e+2]}else{const e=se.sinLonLUT[u],n=se.cosLonLUT[u],i=B+s(y,t,c);R=n*r*i-I,j=e*r*i-b,_=o*i-L}const W=U,k=N,z=w;U=F,N=H,w=q,F=R,H=j,q=_;const G=R-W,J=j-k,K=_-z;let Q=0,X=0,Y=0;if(O>1){const e=(E-l)*A;Q=C[e],X=C[e+1],Y=C[e+2]}else{const e=se.sinLatLUT[0],t=se.cosLatLUT[0],n=B+s(i,v,c);Q=D*t*n-I,X=T*t*n-b,Y=e*n-L}const Z=B+s(i,d,c),$=D*M*Z-I,ee=T*M*Z-b,te=m*Z-L;if(O<l){const t=E+l,o=t*A;C[o]=$,C[o+1]=ee,C[o+2]=te,de($,ee,te,f),g.setValues(t,Math.round(e*n),Math.round(a*n))}const ne=Q-$,oe=X-ee,re=Y-te;let ie=D*r,ae=T*r,ce=o;ce*ce<.999&&(ie=K*oe-J*re,ae=G*re-K*ne,ce=J*ne-G*oe);const le=1/Math.sqrt(ie*ie+ae*ae+ce*ce);x(h,E,ie*le,ae*le,ce*le,p),++E}}}function V(e){e.tile.intersectsClippingArea&&(b(e),te(e),e.intersectionData=null)}function B(e){e.tile.intersectsClippingArea&&(Y(e),b(e),te(e),ne(e),e.intersectionData=null)}function I(e){e.tile.intersectsClippingArea&&(C(e),L(e,!0),te(e),e.intersectionData=null)}function b(e){e.tile.intersectsClippingArea&&(C(e),L(e))}function L(t,o=!1){const{geometry:r,geometryState:i,tile:a,localOrigin:c}=t,{level:u,extent:h,extentInRadians:x,ellipsoid:M}=a,S=M.radius,y=x[0],v=x[2],V=x[1],B=x[3],{samplerData:I}=i,b=h[0],L=h[2],C=h[1],A=h[3],P=O(t),{boundingBox:E,vertexAttributes:T}=r,D=c[0],R=c[1],U=c[2],{position:N,uv0:w}=T,j=N.typedBuffer,F=N.typedBufferStride;for(let O=0;O<4;++O){const c=1===O||3===O,x=i.edgeResolutions[O];d(e(x));const M=x+1,T=l(a,i.edgePeerNeighbors[O]);if(ce(a,T,O)){Z(t,O,T);continue}const N=null!=T;d(!N||T.level===a.level),d(!N||p(a,T)<=0);const H=T?.renderData,q=H?.geometryState;if(f){const e=a.surface;if(!T&&e&&!e.updatingRootTiles){const t=m[O],n=a.findNeighborTile(t,(e=>e.loaded||e.leaf||e.level===a.level));n?n.intersectsClippingArea&&(d(!n.loaded),d(!n.leaf),d(n.level===u)):d(null==e?.rootTiles||!a.shouldHaveNeighbor(t))}}const _=1===O?h[2]:h[0],W=T?.extent,k=W&&c?1===O?W[0]:W[2]:_,z=0===O?h[3]:h[1],G=1===O?1:0,J=0===O?1:0,K=1===O?v:y,Q=0===O?B:V,X=Math.sin(K),Y=Math.cos(K),$=Math.sin(Q),ee=Math.cos(Q),te=q?.samplerData,ne=N?(e,t,n)=>.5*(s(e,t,I)+s(n,t,te)):(e,t,n)=>s(e,t,I),oe=r.outerEdgesOffsetAndLength[2*O+0],re=o&&M>3?M-3:1,se=null!=I&&I.some((e=>null!=e)),ie=null!=te&&te.some((e=>null!=e)),ae=se||ie,le=1/x,ue=oe;d(!W||g(W[2]-W[0],h[2]-h[0]));(()=>{const e=1===O?-1:3===O?1:0,t=0===O?-1:2===O?1:0,o=(h[2]-h[0])*le,i=e*o,a=t*o,l=c?e*((v-y)*le):0,u=c?0:t*le,d=J,f=c?K+l:K,m=c?Math.sin(f):X,g=c?Math.cos(f):Y,p=c?K-l:K,x=c?Math.sin(p):X,V=c?Math.cos(p):Y,B=c?Q:P(d+u),T=c?$:Math.sin(B),H=c?ee:Math.cos(B),q=c?Q:P(d-u),W=c?$:Math.sin(q),Z=c?ee:Math.cos(q);let oe=0,se=0,ie=0;{const e=0*le,t=c?_:b*(1-e)+L*e,n=c?k:t,o=c?C*(1-e)+A*e:z,r=c?K:y*(1-e)+v*e,s=c?X:Math.sin(r),i=c?Y:Math.cos(r),a=c?P(e):Q,l=c?Math.sin(a):$,u=c?Math.cos(a):ee,d=S+ne(t,o,n);oe=i*u*d,se=s*u*d,ie=l*d}let ce=0,fe=0,me=0;{const e=1*le,t=c?_:b*(1-e)+L*e,n=c?k:t,o=c?C*(1-e)+A*e:z,r=c?K:y*(1-e)+v*e,s=c?X:Math.sin(r),i=c?Y:Math.cos(r),a=c?P(e):Q,l=c?Math.sin(a):$,u=c?Math.cos(a):ee,d=S+ne(t,o,n);ce=i*u*d,fe=s*u*d,me=l*d}for(let h=1;h<M-1;h+=re){let e=0,t=0,o=0;{const n=(h+1)*le,r=c?_:b*(1-n)+L*n,s=c?k:r,i=c?C*(1-n)+A*n:z,a=c?K:y*(1-n)+v*n,l=c?X:Math.sin(a),u=c?Y:Math.cos(a),d=c?P(n):Q,f=c?Math.sin(d):$,m=c?Math.cos(d):ee,g=S+ne(r,i,s);e=u*m*g,t=l*m*g,o=f*g}const l=e,u=t,d=o,f=ce,p=fe,M=me;ce=l,fe=u,me=d;{const e=ue+h,t=e*F,o=f-D,r=p-R,s=M-U;j[t]=o,j[t+1]=r,j[t+2]=s,de(o,r,s,E);const i=h*le,a=c?G:i,l=c?i:J;w.setValues(e,Math.round(a*n),Math.round(l*n))}const B=oe,q=se,re=ie;oe=f,se=p,ie=M;const ge=f,he=p,pe=M,xe=1/Math.sqrt(ge*ge+he*he+pe*pe),Me=pe*xe;let Se=0,ye=0,ve=0;if(ae&&Me*Me<.999){let e=0,t=0,n=0;{const o=0===O?-1:1;e=o*(l-B),t=o*(u-q),n=o*(d-re)}{const o=h*le,r=c?_:b*(1-o)+L*o,l=c?k:r,u=c?C*(1-o)+A*o:z,d=c?K:y*(1-o)+v*o,f=c?X:Math.sin(d),p=c?Y:Math.cos(d),M=c?P(o):Q,B=c?Math.sin(M):$,E=c?Math.cos(M):ee;let D=ge,R=he,U=pe;if(N){const e=S+s(l-i,u-a,te),t=c?E:Z;D=(c?V:p)*t*e,R=(c?x:f)*t*e,U=(c?B:W)*e}{const o=S+s(r+i,u+a,I),l=c?E:H,d=(c?g:p)*l*o,h=(c?m:f)*l*o,x=(c?B:T)*o;N||(D=2*ge-d,R=2*he-h,U=2*pe-x);const M=3===O?-1:1,y=M*(D-d),v=M*(R-h),V=M*(U-x);Se=n*v-t*V,ye=e*V-n*y,ve=t*y-e*v;const b=1/Math.sqrt(Se*Se+ye*ye+ve*ve);Se*=b,ye*=b,ve*=b}}}else Se=ge*xe,ye=he*xe,ve=pe*xe;r.setEdgeNormalFromValues(O,h,Se,ye,ve)}})()}}function C(e){$(e)}function A(e,t){return Math.PI/2-2*Math.atan(Math.exp(-e/t))}function P(e,t,n,o){return A(e*(1-o)+t*o,n)}function E(e,t,n){return e*(1-n)+t*n}function O(e){const{tile:t}=e;if(t.surface.isWebMercator){const e=t.extent,n=t.ellipsoid.radius;return t=>P(e[1],e[3],n,t)}const n=t.extentInRadians;return e=>E(n[1],n[3],e)}function T(e,t){const{tile:n,geometryState:r,geometry:s}=e,{extent:i,surface:a}=n,{wireframe:c}=r,l=i[0],u=i[1],d=i[2]-l,f=i[3]-u,{numVerticesPerSide:m,clippingArea:g}=r,h=null!=g?Math.max(0,(g[0]-l)/d):0,p=null!=g?Math.max(0,(g[1]-u)/f):0,x=null!=g?Math.min(1,(g[2]-l)/d):1,M=null!=g?Math.min(1,(g[3]-u)/f):1,S=(m-2)**2,y=fe(r),v=S+4*y,V=a.renderer.tileGeometryCache.acquire(v),{boundingBox:B}=s;o(B),s.numVerticesPerSide=m,s.vertexAttributes=V,s.maxEdgeVertexCount=y,s.minu=h,s.minv=p,s.maxu=x,s.maxv=M,D(e),s.edgeVerticesStartIndex=S,X(e),w(e),W(s,[],c),e.intersectionData=null}function D(e){const o=e.tile;if(!o.intersectsClippingArea)return;const{geometry:r,geometryState:i,localOrigin:a}=e,{samplerData:c,clippingArea:l,numVerticesPerSide:u}=i,{surface:d,extent:f,ellipsoid:m}=o,{isWebMercatorOnPlateCarree:g}=d,h=null!=l?l:ie,p=f[0],M=f[1],S=f[2],y=f[3],v=Math.max(p,h[0]),V=Math.min(S,h[2]),B=Math.max(M,h[1]),I=Math.min(y,h[3]),b=m.radius,L=o.horizontalScale,C=u-1,A=u-2,{minu:P,minv:E,maxu:O,maxv:T,boundingBox:D,vertexAttributes:R}=r,{position:U,uv0:N}=R,{typedBuffer:w,typedBufferStride:j}=R.normalCompressed,F=a[0],H=a[1],q=a[2],_=U.typedBuffer,W=U.typedBufferStride;let k=0;const z=t(M,B,I),G=g?(Math.PI/2-2*Math.atan(Math.exp(-z/b)))*b:z*L,J=1/C,K=t(M*(1-J)+y*J,B,I);let Q=G,X=g?(Math.PI/2-2*Math.atan(Math.exp(-K/b)))*b:K*L;for(let Y=1;Y<=A;Y++){const e=Y/C,o=t(M*(1-e)+y*e,B,I),r=t(e,E,T),i=X,a=(Y-1)/C,l=t(M*(1-a)+y*a,B,I),u=Q,d=(Y+1)/C,f=t(M*(1-d)+y*d,B,I),m=g?(Math.PI/2-2*Math.atan(Math.exp(-f/b)))*b:f*L,h=t(d,E,T);Q=X,X=m;const R=t(p,v,V);let U=R*L,z=s(R,o,c);const G=1/C,J=t(G,P,O),K=t(p*(1-J)+S*J,v,V);let Z=J,$=K,ee=K*L,te=s(K,o,c);if(1===Y){const e=ee-F,o=Q-H,s=te-q,i=0*W;_[i]=e,_[i+1]=o,_[i+2]=s,de(e,o,s,D);const a=t(G,P,O);N.setValues(k,Math.round(a*n),Math.round(r*n))}for(let g=1;g<=A;g++){const e=ee,a=te,d=(g+1)/C,M=t(d,P,O),y=t(p*(1-d)+S*d,v,V),B=$;$=y;{const e=k+1,t=e*W;if(1===Y||g===A){const a=y*L,l=s(y,o,c);if(1===Y&&g<A){const o=a-F,s=i-H,c=l-q;_[t]=o,_[t+1]=s,_[t+2]=c,de(o,s,c,D),N.setValues(e,Math.round(M*n),Math.round(r*n))}ee=a,te=l}else ee=_[t]+F,te=_[t+2]+q}const I=ee,b=te,E=U,T=z;U=e,z=a;const R=(k-A)*W,G=1===Y?s(B,l,c):_[R+2]+q,J=s(B,f,c);if(Y<A){const t=k+A,o=t*W,r=e-F,s=m-H,i=J-q;_[o]=r,_[o+1]=s,_[o+2]=i,de(r,s,i,D);const a=Z;Z=M,N.setValues(t,Math.round(a*n),Math.round(h*n))}{const e=I-E,t=u-m,n=t*(b-T),o=e*(G-J),r=-t*e,s=n*n+o*o+r*r;if(0===s)x(w,k,0,0,1,j);else{const e=1/Math.sqrt(s);x(w,k,n*e,o*e,r*e,j)}}++k}}}function R(e,t){e.tile.intersectsClippingArea&&(F(e),j(e,!0),te(e),e.intersectionData=null)}function U(e,t){e.tile.intersectsClippingArea&&(Y(e),w(e),te(e),ne(e),e.intersectionData=null)}function N(e,t){e.tile.intersectsClippingArea&&(w(e),te(e),e.intersectionData=null)}function w(e,t){e.tile.intersectsClippingArea&&(F(e),j(e,!1))}function j(n,o){const{geometry:r,geometryState:i,localOrigin:a}=n,c=n.tile,{surface:u,extent:g}=c,{clippingArea:h,samplerData:x}=i,M=null!=h?h:ie,S=g[0],y=g[2],v=g[1],V=g[3],B=[V>M[3],y>M[2],v<M[1],S<M[0]],I=c.horizontalScale,b=_(u.isWebMercatorOnPlateCarree,c.ellipsoid.radius,I),{minu:L,minv:C,maxu:A,maxv:P,boundingBox:E}=r,O=Math.max(S,M[0]),T=Math.min(y,M[2]),D=Math.max(v,M[1]),R=Math.min(V,M[3]),U=a[0],N=a[1],w=a[2];for(let j=0;j<4;++j){const a=1===j||3===j,g=i.edgeResolutions[j];d(e(g));const h=g+1,M=B[j],F=l(c,i.edgePeerNeighbors[j]);if(!M&&ce(c,F,j)){Z(n,j,F);continue}const H=null!=F&&!M,q=F?.renderData,_=q?.geometryState;if(f&&(d(!H||F.level===c.level),d(!H||p(c,F)<=0),c&&!F&&!u.updatingRootTiles)){const e=m[j],t=c.findNeighborTile(e,(e=>e.loaded||e.leaf||e.level===c.level));u.updatingRootTiles||(t?t.intersectsClippingArea&&(d(!t.loaded),d(!t.leaf),d(t.level===c.level)):d(null==u?.rootTiles||!c.shouldHaveNeighbor(e)))}const W=t(1===j?y:S,O,T),k=t(0===j?V:v,D,R),z=_?.samplerData,G=o&&h>3?h-3:1,J=t(1===j?1:0,L,A),K=t(0===j?1:0,C,P),Q=H?(e,t)=>.5*(s(e,t,z)+s(e,t,x)):(e,t)=>s(e,t,x),X=(y-S)/g,Y=a?1===j?X:-X:0,$=a?0:0===j?X:-X,ee=-Y,te=-$;let ne=0,oe=0,re=0;{const e=0/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,r=Q(n,o);ne=n*I,oe=b(o),re=r}let se=0,ie=0,ae=0;{const e=1/g,n=a?W:t(S*(1-e)+y*e,O,T),o=a?t(v*(1-e)+V*e,D,R):k,r=Q(n,o);se=n*I,ie=b(o),ae=r}for(let e=1;e<h-1;e+=G){const n=e/g,o=se,i=ie,c=ae;{const s=a?J:t(n,L,A),l=a?t(n,C,P):K,u=o-U,d=i-N,f=c-w;de(o,d,f,E),r.setEdgeVertexFromValuesRawPositionUV(j,e,u,d,f,s,l)}{const n=(e+1)/g,o=a?W:t(S*(1-n)+y*n,O,T),r=a?t(v*(1-n)+V*n,D,R):k,s=Q(o,r);se=o*I,ie=b(r),ae=s}const l=se,u=ae,d=ne,f=oe,m=re;ne=o,oe=i,re=c;let h=0,p=0,M=0;if(a){const e=ie-i,r=u-c,a=f-i,l=m-c,d=t(v*(1-n)+V*n,D,R),g=W+ee,S=g*I-o,y=s(g,d,x)-c,B=3===j?-1:1;if(h=B*(-a+e)*y,p=B*S*(-l+r),M=-B*S*(-a+e),H){const t=W+Y,n=t*I-o;h=(-a+e)*(y-(s(t,d,z)-c)),p=(S-n)*(-l+r),M=-(S-n)*(-a+e)}}else{const e=l-o,r=u-c,a=d-o,f=m-c,g=t(S*(1-n)+y*n,O,T),v=k+te,V=s(g,v,x)-c,B=b(v)-i,I=2===j?-1:1;if(h=I*B*(-f+r),p=I*(-a+e)*V,M=-I*B*(-a+e),H){const t=g,n=k+$,o=b(n)-i;h=(-B+o)*(-f+r),p=(-a+e)*(-V+(s(t,n,z)-c)),M=-(-B+o)*(-a+e)}}const B=1/Math.sqrt(h*h+p*p+M*M);r.setEdgeNormalFromValues(j,e,h*B,p*B,M*B)}}}function F(e,t){$(e)}function H(e,t){return(Math.PI/2-2*Math.atan(Math.exp(-e/t)))*t}function q(e,t){return e*t}function _(e,t,n){return e?e=>H(e,t):e=>q(e,n)}function W(e,t,n){const{numVerticesPerSide:o,vertexAttributes:r,maxEdgeVertexCount:s}=e,i=o-1,a=r.count,c=2*(o-3)*(o-3),l=4*(i+s-3),d=u.reduce(((t,n)=>t+(i+e.getEdgeCount(n)-3)),0),f=t.reduce(((e,t)=>e+i*(2*(t.latitudeResolution-1)+1)),0),m=3*(n?2:1),g=(c+l+f)*m,h=a>=M?new Uint32Array(g):new Uint16Array(g);for(let u=0;u<g;++u)h[u]=0;e.indices=h,e.indexCount=(c+d+f)*m,e.poleIndicesStartIndex=c*m,e.edgeIndicesStartIndex=(c+f)*m,n?(J(e),K(e,t),Q(e)):(k(e),z(e,t),G(e))}function k(e){const{numVerticesPerSide:t,indices:n,vertexAttributes:o}=e,{position:r}=o,{typedBuffer:s,typedBufferStride:i}=r,a=t-2,c=t-3,l=0,u=t-3;let d=0;for(let f=0;f<c;++f){const e=f*a;for(let t=l;t<u;++t){const o=e+t,r=o+1,c=r+a,l=c-1;me(o,r,c,l,i,s)?(n[d]=o,n[d+1]=r,n[d+2]=c,n[d+3]=c,n[d+4]=l,n[d+5]=o):(n[d]=o,n[d+1]=r,n[d+2]=l,n[d+3]=l,n[d+4]=r,n[d+5]=c),d+=6}}}function z(e,t){const{numVerticesPerSide:n,indices:o,poleIndicesStartIndex:r}=e,s=n-1;let i=r;for(const a of t){const t=a.isNorth?1:2,r=a.isNorth?2:1,c=a.isNorth?3:4,l=a.isNorth?4:3;let u=e.getEdgeVertexIndex(a.connectedOuterEdgeOffset,0),d=1;for(let e=0;e<a.latitudeResolution;++e){const f=0===e?a.rowOffset:u+n;for(let n=0;n<s;n++){const s=f+n;o[i]=u,o[i+t]=u+1,o[i+r]=s,e<a.latitudeResolution-1?(o[i+c]=u+1,o[i+l]=s+1,o[i+5]=s,i+=6):i+=3,u+=d}u=f,d=1}}}function G(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,r=n-1,s=r-2;let i=o;for(let a=0;a<4;++a){const n=ue[a];let o=0,c=0;const l=e.getEdgeCount(a),u=n.count;d(u===r-1);const f=1===a||2===a,m=f?1:2,g=f?2:1,h=e.getEdgeFirstVertexIndex(a),p=1,x=n.vertex0Index,M=n.stride;for(;o<l-1||c<u-1;){const e=x+c*M,n=h+o*p,a=o<l-1,d=c<u-1,f=a&&(!d||(a?0+r*(o+.5)/(l-1):0)<=(d?1+s*(c+.5)/(u-1):0));f?++o:++c;const S=f?n+p:e+M;t[i]=e,t[i+m]=n,t[i+g]=S,i+=3}}e.indexCount=i}function J(e){const{indices:t,numVerticesPerSide:n,vertexAttributes:o}=e,{position:r}=o,{typedBuffer:s,typedBufferStride:i}=r,a=n-2;let c=0;for(let l=0;l<n-3;++l){const e=l*a;for(let o=0;o<n-3;++o){const n=l*a+o,r=n+1,u=r+a,d=u-1,f=e+o,m=f+1,g=m+a;me(f,m,g,g-1,i,s)?(ge(t,c,n,r,u),c+=6,ge(t,c,u,d,n)):(ge(t,c,n,r,d),c+=6,ge(t,c,d,u,r)),c+=6}}}function K(e,t){const{indices:n,numVerticesPerSide:o,poleIndicesStartIndex:r}=e,s=o-1;let i=r;for(const a of t){const t=a.connectedOuterEdgeOffset;let r=e.getEdgeVertexIndex(t,0),c=1;for(let e=0;e<a.latitudeResolution;++e){const t=0===e?a.rowOffset:r+o;for(let o=0;o<s;o++)ge(n,i,r,r+1,t+o),i+=6,e<a.latitudeResolution-1&&(ge(n,i,r+1,t+o+1,t+o),i+=6),r+=c;r=t,c=1}}}function Q(e){const{indices:t,numVerticesPerSide:n,edgeIndicesStartIndex:o}=e,r=n-1,s=r-2;let i=o;for(let a=0;a<4;++a){const n=ue[a];let o=0,c=0;const l=e.getEdgeCount(a),u=n.count;d(u===r-1);const f=1===a||2===a,m=f?1:3,g=f?3:1,h=e.getEdgeFirstVertexIndex(a),p=1,x=n.vertex0Index,M=n.stride;for(;o<l-1||c<u-1;){const e=x+c*M,n=h+o*p,a=o<l-1,d=c<u-1,f=a&&(!d||(a?0+r*(o+.5)/(l-1):0)<=(d?1+s*(c+.5)/(u-1):0));f?++o:++c;const S=f?n+p:e+M;t[i]=e,t[i+m]=n,t[i+m+1]=n,t[i+g]=S,t[i+g+1]=S,t[i+5]=e,i+=6}}e.indexCount=i}function X(e){const{geometry:t,geometryState:n}=e,{edgeResolutions:o}=n,{numVerticesPerSide:r,edgeVerticesStartIndex:s}=t,i=r-2;let a=s;for(let c=0;c<4;++c){{const e=0===c||2===c,t=(0===c?i-1:0)*i+(1===c?i-1:0),n=(e?0:1)*i+(e?1:0),o=ue[c];o.vertex0Index=t,o.stride=n,o.count=i}{const e=o[c]+1;t.outerEdgesOffsetAndLength[2*c+0]=a,t.outerEdgesOffsetAndLength[2*c+1]=e,a+=e}}}function Y(e){X(e),e.geometryState.wireframe?Q(e.geometry):G(e.geometry)}function Z(o,r,s){const{geometryState:i,geometry:a,tile:c,localOrigin:l}=o,u=1===r||3===r,f=i.edgeResolutions[r];d(e(f));const m=f+1,{boundingBox:g,minu:h,minv:p,maxu:x,maxv:M,vertexAttributes:S}=a,y=t(1===r?1:0,h,x),v=t(0===r?1:0,p,M),V=s.renderData,B=V.geometryState,I=V.geometry,b=(r+2)%4,L=I.getEdgeCount(b),C=c.getNeighborEdgeStartVertexIndex(r,s)*f,A=f*2**(c.level-s.level);d(B.edgeResolutions[b]===A),d(L-1===A);const P=V.localOrigin[0]-l[0],E=V.localOrigin[1]-l[1],O=V.localOrigin[2]-l[2],T=a.getEdgeFirstVertexIndex(r),{position:D,uv0:R}=S,U=D.typedBuffer,N=D.typedBufferStride,w=S.normalCompressed,j=w.typedBuffer,F=w.typedBufferStride,H=I.vertexAttributes,q=I.getEdgeFirstVertexIndex(b),_=H.position.typedBuffer,W=H.position.typedBufferStride,k=H.normalCompressed.typedBuffer,z=H.normalCompressed.typedBufferStride;for(let e=1;e<m-1;++e){const o=T+e,r=q+(C+e),s=o*N,i=r*W,a=_[i]+P,c=_[i+1]+E,l=_[i+2]+O;U[s]=a,U[s+1]=c,U[s+2]=l,de(a,c,l,g);const d=o*F,m=r*z;j[d]=k[m],j[d+1]=k[m+1];const S=e/f,V=u?y:t(S,h,x),B=u?t(S,p,M):v;R.setValues(o,Math.round(V*n),Math.round(B*n))}}function $(e){const{geometry:o,geometryState:r,localOrigin:i}=e,{clippingArea:a,samplerData:c}=r,{minu:l,minv:u,maxu:f,maxv:m,boundingBox:g,vertexAttributes:h}=o,x=e.tile,{surface:M,ellipsoid:S,extent:y,extentInRadians:v,horizontalScale:V}=x,B="local"===M.view?.viewingMode,I=S.radius;let b=0,L=0,C=0;const A=(e,t,n)=>{const o=v[0===t?1:3],r=v[0===e?0:2],s=Math.cos(o),i=Math.sin(o),a=Math.sin(r),c=Math.cos(r),l=I+n;b=c*s*l,L=a*s*l,C=i*l},P=B?(()=>{const e=a,n=null!=e&&(y[3]>e[3]||y[2]>e[2]||y[1]<e[1]||y[0]<e[0]),o=_(M.isWebMercatorOnPlateCarree,I,V);return(r,s,i)=>{const a=0===r?y[0]:y[2],c=0===s?y[1]:y[3],l=n?t(a,e[0],e[2]):a,u=n?t(c,e[1],e[3]):c,d=i;b=l*V,L=o(u),C=d}})():A;let E=0,T=0,D=0,R=0,U=0,N=0,w=0,j=0,F=0;const H=B&&M.isWebMercatorOnPlateCarree,q=(e,t,n,o,r)=>{let s=0,i=0,a=0;if(B){const e=t*V,r=H?(Math.PI/2-2*Math.atan(Math.exp(-n/I)))*I:n*V;s=e-b,i=r-L,a=o-C}else{const r=O(e),c=e.tile,l=c.extent,u=c.extentInRadians,d=(t-l[0])/(l[2]-l[0]),f=(n-l[1])/(l[3]-l[1]),m=u[0]*(1-d)+u[2]*d,g=r(f),h=Math.cos(g),p=Math.sin(g),x=Math.sin(m),M=Math.cos(m),S=I+o;s=M*h*S-b,i=x*h*S-L,a=p*S-C}switch(r){case 0:w+=s,j+=i,F+=a;break;case 1:R-=s,U-=i,N-=a;break;case 2:w-=s,j-=i,F-=a;break;case 3:R+=s,U+=i,N+=a}},W=a??ie,k=y[0],z=y[2],G=y[1],J=y[3],K=[J>W[3],z>W[2],G<W[1],k<W[0]],Q=Math.max(k,W[0]),X=Math.min(z,W[2]),Y=Math.max(G,W[1]),Z=Math.min(J,W[3]),$=e=>Math.max(W[0],Math.min(W[2],e)),te=e=>Math.max(W[1],Math.min(W[3],e)),ne=e=>{const t=r.cornerNeighborCornerTiles;E=0,T=0,D=1,R=0,U=0,N=0,w=0,j=0,F=0;let n=1/0;for(let r=0;r<4;++r){const o=t[4*e+r];n=Math.min(n,o?.level??1/0)}for(let r=0;r<4;++r){const o=t[4*e+r];ae[r]=o?.level===n?o:null}let o=1,i=0;for(let r=0;r<4;++r){const e=ae[r];e&&(o=Math.max(o,e?.renderData.geometryState.numVerticesPerSide),i=e.extent[2]-e.extent[0])}const a=i,c=o;d(c>1);const l=a/c;for(let r=0;r<4;++r){const e=ae[(r+3)%4],t=ae[r%4];if(!e&&!t)continue;const n=0===r?1:1===r?2:2===r?3:0,o=0===r?2:1===r?3:2===r?0:1;if(e&&t){const i=re[r][0]*l,a=re[r][1]*l,c=e.extent,u=$(c[0===n||1===n?2:0]+i),d=te(c[0===n||3===n?3:1]+a),f=t.extent,m=$(f[0===o||1===o?2:0]+i),g=te(f[0===o||3===o?3:1]+a),h=e.renderData,p=t.renderData,x=s(u,d,h.geometryState.samplerData),M=s(m,g,p.geometryState.samplerData);q(h,u,d,.5*(x+M),r)}else{const i=e??t,a=e?n:o,c=i.extent,u=re[r],d=$(c[0===a||1===a?2:0]+u[0]*l),f=te(c[0===a||3===a?3:1]+u[1]*l),m=i.renderData,g=s(d,f,m.geometryState.samplerData);q(m,d,f,g,r)}}if(!B){const e=Math.sqrt(b*b+L*L+C*C);E=b/e,T=L/e,D=C/e}if(B||D*D<.999){const e=Math.sqrt(R*R+U*U+N*N);R/=e,U/=e,N/=e;const t=Math.sqrt(w*w+j*j+F*F);w/=t,j/=t,F/=t,E=N*j-U*F,T=R*F-N*w,D=U*w-R*j;const n=1/Math.sqrt(E*E+T*T+D*D);E*=n,T*=n,D*=n}},oe=r.cornerNeighborCornerTiles;for(let O=0;O<4;++O){const e=O,a=(O+1)%4,M=0===O||1===O?1:0,S=0===O||3===O?1:0,y=t(M,l,f),v=t(S,u,m),V=o.getEdgeFirstVertexIndex(e),B=o.getEdgeCount(e),I=0===O||3===O?B-1:0,A=o.getEdgeFirstVertexIndex(a),R=o.getEdgeCount(a),U=0===O||1===O?R-1:0;let N=-1;for(let t=0;t<4;++t){const e=oe[4*O+t],n=oe[4*O+N];e&&(-1===N||p(n,e)>0)&&(N=t)}const w=N,j=oe[4*O+w];if(j!==x){const e=x.level-j.level,t=2**e,o=[j.lij[0]+e,j.lij[1]*t,j.lij[2]*t],s=[o[1]+t===x.lij[1],0===O&&(1===w||0===w&&j!==oe[4*O+3])||1===O&&(0===w||1===w&&j!==oe[4*O+2]),o[1]===x.lij[1]+1,2===O&&(3===w||2===w&&j!==oe[4*O+1])||3===O&&(2===w||3===w&&j!==oe[4*O+0])],a=s.reduce(((e,t)=>e+(t?1:0)),0);d(1===a||2===a);let c=-1,l=-1;const u=j.renderData;if(1===a){const e=s.findIndex((e=>e));d(0<=e&&e<=3),c=(e+2)%4;const t=r.edgeResolutions[e];l=x.getNeighborEdgeStartVertexIndex(e,j)*t+t*(0===e&&0===O||1===e&&0===O||2===e&&1===O||3===e&&3===O?1:0)}else{d(s[1]||s[3]),c=s[1]?3:1;const e=u.geometryState.edgeResolutions[c];l=0===O||3===O?0:e}const f=u.geometry;{const e=V+I,t=A+U,o=f.getEdgeFirstVertexIndex(c)+l,r=f.vertexAttributes,s=u.localOrigin,a=r.position,d=a.typedBuffer,m=o*a.typedBufferStride,p=d[m]+s[0]-i[0],x=d[m+1]+s[1]-i[1],M=d[m+2]+s[2]-i[2];de(p,x,M,g);const S=h.position,B=S.typedBuffer,b=e*S.typedBufferStride;B[b]=p,B[b+1]=x,B[b+2]=M;const L=t*S.typedBufferStride;B[L]=p,B[L+1]=x,B[L+2]=M;const C=h.uv0;C.setValues(e,Math.round(y*n),Math.round(v*n)),C.setValues(t,Math.round(y*n),Math.round(v*n));{const n=r.normalCompressed.typedBuffer,s=o*r.normalCompressed.typedBufferStride,i=h.normalCompressed,a=i.typedBuffer;{const t=e*i.typedBufferStride;a[t]=n[s],a[t+1]=n[s+1]}{const e=t*i.typedBufferStride;a[e]=n[s],a[e+1]=n[s+1]}}}}else{const n=K[e],r=K[a];let l;if(n||r){const e=t(k*(1-M)+z*M,Q,X),n=t(G*(1-S)+J*S,Y,Z);l=s(e,n,c)}else l=ee(oe,O);P(M,S,l),ne(O);const u=b-i[0],d=L-i[1],f=C-i[2];de(u,d,f,g),o.setEdgeVertexFromValuesRawPositionUVNormal(e,I,u,d,f,y,v,E,T,D),o.setEdgeVertexFromValuesRawPositionUVNormal(a,U,u,d,f,y,v,E,T,D)}}for(let t=0;t<4;++t)ae[t]=null}function ee(e,t){const n=4*t,o=u.reduce(((t,o)=>Math.min(t,e[n+o]?.level??1/0)),1/0);f&&(d(!e[n+0]||!e[n+2]||h(e[n+0],e[n+2],a.SOUTH_WEST)),d(!e[n+1]||!e[n+3]||h(e[n+1],e[n+3],a.NORTH_WEST)));let r=0,i=0;for(let a=0;a<4;++a){const t=e[n+a];if(t&&t.level===o){const e=0===a||1===a,n=0===a||3===a,o=t.extent,c=o[e?0:2],l=o[n?1:3],u=t.renderData?.geometryState?.samplerData;i+=s(c,l,u),r++}}const c=r?i/r:0;return d(null!=c),c}function te(e){const{vao:t,geometry:n}=e,{vertexAttributes:o,edgeVerticesStartIndex:r}=n,s=o.position.typedBuffer;t.vertexBuffers.get("geometry").setSubData(s,r,r,s.length)}function ne(e){const{vao:t,geometry:n}=e,{indices:o,indexCount:r,edgeIndicesStartIndex:s}=n;t.indexBuffer.setSubData(o,s,s,r)}class oe{constructor(e,t,n,o,r){this.isNorth=e,this.connectedRowOffset=t,this.connectedOuterEdgeOffset=n,this.rowOffset=o,this.latitudeResolution=r}}const re=[[0,1],[1,0],[0,-1],[-1,0]],se=new c,ie=r(-1/0,-1/0,1/0,1/0),ae=[null,null,null,null];function ce(e,t,n){if(!t)return!1;const o=p(e,t);return o>0||0===o&&n>=2}class le{constructor(){this.vertex0Index=0,this.stride=1,this.count=0}getVertexIndex(e){return d(0<=e&&e<this.count),this.vertex0Index+this.stride*e}}const ue=[new le,new le,new le,new le];function de(e,t,n,o){e<o[0]?o[0]=e:e>o[3]&&(o[3]=e),t<o[1]?o[1]=t:t>o[4]&&(o[4]=t),n<o[2]?o[2]=n:n>o[5]&&(o[5]=n)}function fe(e){const{edgeResolutions:t,numVerticesPerSide:n}=e,o=1+Math.max(...t);return Math.max(n,o)}function me(e,t,n,o,r,s){const i=e*r,a=s[i],c=s[i+1],l=s[i+2],u=t*r,d=s[u],f=s[u+1],m=s[u+2],g=n*r,h=s[g],p=s[g+1],x=s[g+2],M=o*r,S=s[M],y=s[M+1],v=s[M+2];return(d-S)*(d-S)+(f-y)*(f-y)+(m-v)*(m-v)>(a-h)*(a-h)+(c-p)*(c-p)+(l-x)*(l-x)}function ge(e,t,n,o,r){e[t]=n,e[t+1]=o,e[t+2]=o,e[t+3]=r,e[t+4]=r,e[t+5]=n}const he=6;export{T as createPlanarGlobePatch,S as createSphericalGlobePatch,I as updateCornerSpherical,R as updateCornersPlanar,U as updateEdgeElevationsAndResolutionsPlanar,B as updateEdgeElevationsAndResolutionsSpherical,N as updateEdgesAndCornersPlanar,V as updateEdgesAndCornersSpherical};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{newLayout as e}from"../support/buffer/InterleavedLayout.js";import{VertexAttribute as r}from"../webgl-engine/lib/VertexAttribute.js";const t=e().vec3f(r.POSITION).vec2f16(r.UV0).vec2i16(r.NORMALCOMPRESSED,{glNormalized:!0});export{t as terrainAttributesLayout};
5
+ import{newLayout as e}from"../support/buffer/InterleavedLayout.js";import{VertexAttribute as r}from"../webgl-engine/lib/VertexAttribute.js";const t=e().vec3f(r.POSITION).vec2u16(r.UV0,{glNormalized:!0}).vec2i16(r.NORMALCOMPRESSED,{glNormalized:!0});export{t as terrainAttributesLayout};
@@ -2,8 +2,8 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as r}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as i}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as v}from"../../shaderModules/FloatsPassUniform.js";import{glsl as l}from"../../shaderModules/glsl.js";import{VertexAttribute as s}from"../../../lib/VertexAttribute.js";import{vvColorNumber as c,VisualVariablePassParameters as p}from"../../../materials/VisualVariablePassParameters.js";const f=8;function n(e,p){e.attributes.add(s.POSITION,"vec3"),e.attributes.add(s.PROFILEVERTEXANDNORMAL,"vec4"),e.attributes.add(s.FEATUREVALUE,"vec4"),e.attributes.add(s.PROFILEAUXDATA,"vec2"),e.attributes.add(s.PROFILERIGHT,"vec2"),e.attributes.add(s.PROFILEUP,"vec2");const n=e.vertex;n.code.add(l`bool isCapVertex() {
6
- return featureValue.w == 1.0;
5
+ import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as i}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as r}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as v}from"../../shaderModules/FloatsPassUniform.js";import{glsl as l}from"../../shaderModules/glsl.js";import{VertexAttribute as s}from"../../../lib/VertexAttribute.js";import{vvColorNumber as c,VisualVariablePassParameters as p}from"../../../materials/VisualVariablePassParameters.js";const f=8;function n(e,p){e.attributes.add(s.POSITION,"vec3"),e.attributes.add(s.FEATUREVALUE,"vec3"),e.attributes.add(s.PROFILEVERTEXANDNORMAL,"vec4"),e.attributes.add(s.PROFILEAUXDATA,"vec3"),e.attributes.add(s.PROFILERIGHT,"vec2"),e.attributes.add(s.PROFILEUP,"vec2");const n=e.vertex;n.code.add(l`bool isCapVertex() {
6
+ return profileAuxData.z == 1.0;
7
7
  }`),n.uniforms.add(new o("size",(e=>e.size))),p.vvSize?(n.uniforms.add(new a("vvSizeMinSize",(e=>e.vvSize.minSize)),new a("vvSizeMaxSize",(e=>e.vvSize.maxSize)),new a("vvSizeOffset",(e=>e.vvSize.offset)),new a("vvSizeFactor",(e=>e.vvSize.factor)),new a("vvSizeFallback",(e=>e.vvSize.fallback))),n.code.add(l`vec2 getSize() {
8
8
  float value = featureValue.x;
9
9
  if (isnan(value)) {
@@ -29,7 +29,7 @@ return vec4( color.xyz, mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f));
29
29
  return vec4( color.xyz, vvOpacityOpacities[vvOpacityNumber - 1]);
30
30
  }`)):n.code.add(l`vec4 applyOpacity(vec4 color){
31
31
  return color;
32
- }`),p.vvColor?(n.constants.add("vvColorNumber","int",c),n.uniforms.add(new v("vvColorValues",(e=>e.vvColor.values),c),new i("vvColorColors",(e=>e.vvColor.colors),c),new r("vvColorFallback",(e=>e.vvColor.fallback))),n.code.add(l`vec4 getColor() {
32
+ }`),p.vvColor?(n.constants.add("vvColorNumber","int",c),n.uniforms.add(new v("vvColorValues",(e=>e.vvColor.values),c),new r("vvColorColors",(e=>e.vvColor.colors),c),new i("vvColorFallback",(e=>e.vvColor.fallback))),n.code.add(l`vec4 getColor() {
33
33
  float value = featureValue.y;
34
34
  if (isnan(value)) {
35
35
  return applyOpacity(vvColorFallback);
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Logger.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{Default3D as t}from"../../lib/DefaultVertexAttributeLocations.js";import{Program as r}from"../../lib/Program.js";import{PrimitiveType as o}from"../../../../webgl/enums.js";import{makePipelineState as s,blendWithPremultipliedAlpha as n,defaultColorWrite as a}from"../../../../webgl/renderState.js";const p=()=>e.getLogger("esri.views.3d.webgl.ShaderTechnique");class l{constructor(e,s,n,a=t){this.locations=a,this.primitiveType=o.TRIANGLES,this.key=s.key,this._program=new r(e.rctx,n.get().build(s),a),this._pipeline=this.initializePipeline(s),this.reload=async t=>{t&&await n.reload(),this.key.equals(s.key)||p().warn("Configuration was changed after construction, cannot reload shader.",n),i(this._program),this._program=new r(e.rctx,n.get().build(s),a),this._pipeline=this.initializePipeline(s)}}destroy(){this._program=i(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,i){return this._pipeline}initializePipeline(e){return s({blending:n,colorWrite:a})}}export{l as ShaderTechnique};
5
+ import e from"../../../../../core/Logger.js";import{disposeMaybe as i}from"../../../../../core/maybe.js";import{Default3D as t}from"../../lib/DefaultVertexAttributeLocations.js";import{Program as r}from"../../lib/Program.js";import{PrimitiveType as o}from"../../../../webgl/enums.js";import{makePipelineState as s,premultipliedAlpha as n,defaultColorWrite as a}from"../../../../webgl/renderState.js";const p=()=>e.getLogger("esri.views.3d.webgl.ShaderTechnique");class l{constructor(e,s,n,a=t){this.locations=a,this.primitiveType=o.TRIANGLES,this.key=s.key,this._program=new r(e.rctx,n.get().build(s),a),this._pipeline=this.initializePipeline(s),this.reload=async t=>{t&&await n.reload(),this.key.equals(s.key)||p().warn("Configuration was changed after construction, cannot reload shader.",n),i(this._program),this._program=new r(e.rctx,n.get().build(s),a),this._pipeline=this.initializePipeline(s)}}destroy(){this._program=i(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,i){return this._pipeline}initializePipeline(e){return s({blending:n,colorWrite:a})}}export{l as ShaderTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Accessor.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";const t={required:[]},s={required:[r.Depth]};class n extends e{precompile(e){return!!this.acquireTechniques(e)}consumes(){return t}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}modify(e){}get numGeometries(){return 0}get hasOccludees(){return!1}get hasEmissions(){return!1}forEachGeometry(e){}queryRenderOccludedState(e){return!1}}class u extends n{}class o extends n{}export{o as AsyncRenderPlugin,s as ConsumesDepth,t as ConsumesNone,u as SyncRenderPlugin};
5
+ import e from"../../../../core/Accessor.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";const t={required:[]},s={required:[r.Depth]};class n extends e{precompile(e){return!!this.acquireTechniques(e)}consumes(){return t}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}modify(e,r){}get numGeometries(){return 0}get hasOccludees(){return!1}get hasEmissions(){return!1}forEachGeometry(e){}queryRenderOccludedState(e){return!1}}class u extends n{}class o extends n{}export{o as AsyncRenderPlugin,s as ConsumesDepth,t as ConsumesNone,u as SyncRenderPlugin};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ChapmanApproximationParameters as e}from"../../../environment/ChapmanApproximation.glsl.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as s}from"../../../../../chunks/Haze.glsl.js";import{CompareFunction as t,BlendFactor as n}from"../../../../webgl/enums.js";import{makePipelineState as i,keepSourceValues as l,defaultColorWrite as a,separateBlendingParams as m}from"../../../../webgl/renderState.js";class c extends e{constructor(){super(...arguments),this.hazeStrength=1}}class p extends o{constructor(e,o){super(e,o,new r(s,(()=>import("./Haze.glsl.js"))))}initializePipeline(e){return e.reduced?i({blending:l,depthTest:{func:t.ALWAYS},colorWrite:a}):i({blending:m(n.ONE,n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ONE),colorWrite:a})}}export{c as HazePassParameters,p as HazeTechnique};
5
+ import{ChapmanApproximationParameters as e}from"../../../environment/ChapmanApproximation.glsl.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as s}from"../../../../../chunks/Haze.glsl.js";import{CompareFunction as t,BlendFactor as n}from"../../../../webgl/enums.js";import{makePipelineState as i,copySource as l,defaultColorWrite as a,separateBlendingParams as m}from"../../../../webgl/renderState.js";class c extends e{constructor(){super(...arguments),this.hazeStrength=1}}class p extends o{constructor(e,o){super(e,o,new r(s,(()=>import("./Haze.glsl.js"))))}initializePipeline(e){return e.reduced?i({blending:l,depthTest:{func:t.ALWAYS},colorWrite:a}):i({blending:m(n.ONE,n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ONE),colorWrite:a})}}export{c as HazePassParameters,p as HazeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as i}from"../../../../../chunks/HighlightApply.glsl.js";import{makePipelineState as o,premultipliedAlphaToPremultipliedAlpha as s,defaultColorWrite as l}from"../../../../webgl/renderState.js";class t extends r{constructor(r,o){super(r,o,new e(i,(()=>import("../../shaders/HighlightApply.glsl.js"))))}initializePipeline(){return o({blending:s,colorWrite:l})}}export{t as HighlightApplyTechnique};
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{H as i}from"../../../../../chunks/HighlightApply.glsl.js";import{makePipelineState as o,unpremultipliedAlphaToPremultipliedAlpha as s,defaultColorWrite as l}from"../../../../webgl/renderState.js";class t extends r{constructor(r,o){super(r,o,new e(i,(()=>import("../../shaders/HighlightApply.glsl.js"))))}initializePipeline(){return o({blending:s,colorWrite:l})}}export{t as HighlightApplyTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReadShadowMapPassParameters as r}from"../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{ReloadableShaderModule as i}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as s}from"../../../../../chunks/ShadowHighlight.glsl.js";import{PrimitiveType as t}from"../../../../webgl/enums.js";import{makePipelineState as a,premultipliedAlphaToPremultipliedAlpha as h,defaultColorWrite as l}from"../../../../webgl/renderState.js";class d extends r{constructor(){super(...arguments),this.shadowColor=e(1,0,1,1),this.shadowOpacity=.2,this.occludedShadowOpacity=.1,this.opacityElevation=1,this.dayNightTerminator=1}}class c extends o{constructor(e,r){super(e,r,new i(s,(()=>import("../../shaders/ShadowHighlight.glsl.js")))),this.primitiveType=t.TRIANGLE_STRIP}initializePipeline(){return a({blending:h,colorWrite:l,depthTest:null,depthWrite:null})}}export{d as ShadowHighlightPassParameters,c as ShadowHighlightTechnique};
5
+ import{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ReadShadowMapPassParameters as r}from"../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{ReloadableShaderModule as i}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as s}from"../../../../../chunks/ShadowHighlight.glsl.js";import{PrimitiveType as t}from"../../../../webgl/enums.js";import{makePipelineState as a,unpremultipliedAlphaToPremultipliedAlpha as h,defaultColorWrite as l}from"../../../../webgl/renderState.js";class d extends r{constructor(){super(...arguments),this.shadowColor=e(1,0,1,1),this.shadowOpacity=.2,this.occludedShadowOpacity=.1,this.opacityElevation=1,this.dayNightTerminator=1}}class c extends o{constructor(e,r){super(e,r,new i(s,(()=>import("../../shaders/ShadowHighlight.glsl.js")))),this.primitiveType=t.TRIANGLE_STRIP}initializePipeline(){return a({blending:h,colorWrite:l,depthTest:null,depthWrite:null})}}export{d as ShadowHighlightPassParameters,c as ShadowHighlightTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/Magnifier.glsl.js";import{makePipelineState as s,blendWithPremultipliedAlpha as o,defaultColorWrite as t}from"../../../../webgl/renderState.js";class l extends r{constructor(r,s){super(r,s,new e(i,(()=>import("../../shaders/Magnifier.glsl.js"))))}initializePipeline(){return s({blending:o,depthTest:null,depthWrite:null,colorWrite:t})}}export{l as MagnifierTechnique};
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as i}from"../../../../../chunks/Magnifier.glsl.js";import{makePipelineState as s,premultipliedAlpha as o,defaultColorWrite as t}from"../../../../webgl/renderState.js";class l extends r{constructor(r,s){super(r,s,new e(i,(()=>import("../../shaders/Magnifier.glsl.js"))))}initializePipeline(){return s({blending:o,depthTest:null,depthWrite:null,colorWrite:t})}}export{l as MagnifierTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{create as e}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as o}from"../../../../../chunks/Stars.glsl.js";import{CompareFunction as t}from"../../../../webgl/enums.js";import{NoParameters as i}from"../../../../webgl/NoParameters.js";import{makePipelineState as m,premultipliedAlphaToPremultipliedAlpha as a,defaultColorWrite as l}from"../../../../webgl/renderState.js";class n extends i{constructor(){super(...arguments),this.modelMatrix=e()}}class c extends s{constructor(e,s){super(e,s,new r(o,(()=>import("./Stars.glsl.js"))))}initializePipeline(){return m({blending:a,depthTest:{func:t.LEQUAL},colorWrite:l})}}export{n as StarPassParameters,c as StarsTechnique};
5
+ import{create as e}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ReloadableShaderModule as r}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as s}from"../../core/shaderTechnique/ShaderTechnique.js";import{S as o}from"../../../../../chunks/Stars.glsl.js";import{CompareFunction as t}from"../../../../webgl/enums.js";import{NoParameters as i}from"../../../../webgl/NoParameters.js";import{makePipelineState as m,unpremultipliedAlphaToPremultipliedAlpha as a,defaultColorWrite as l}from"../../../../webgl/renderState.js";class n extends i{constructor(){super(...arguments),this.modelMatrix=e()}}class c extends s{constructor(e,s){super(e,s,new r(o,(()=>import("./Stars.glsl.js"))))}initializePipeline(){return m({blending:a,depthTest:{func:t.LEQUAL},colorWrite:l})}}export{n as StarPassParameters,c as StarsTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../../chunks/OITBlend.glsl.js";import{ColorAttachment0 as o,ColorAttachment1 as i}from"../../../../webgl/enums.js";import{makePipelineState as n,premultipliedAlphaToPremultipliedAlpha as l,defaultColorWrite as t}from"../../../../webgl/renderState.js";class a extends r{constructor(r,o){super(r,o,new e(s,(()=>import("./OITBlend.glsl.js"))))}initializePipeline(e){return n({blending:l,colorWrite:t,drawBuffers:e.hasEmission?{buffers:[o,i]}:{buffers:[o]}})}}export{a as OITBlendTechnique};
5
+ import{ReloadableShaderModule as e}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../../chunks/OITBlend.glsl.js";import{ColorAttachment0 as o,ColorAttachment1 as i}from"../../../../webgl/enums.js";import{makePipelineState as n,unpremultipliedAlphaToPremultipliedAlpha as l,defaultColorWrite as t}from"../../../../webgl/renderState.js";class a extends r{constructor(r,o){super(r,o,new e(s,(()=>import("./OITBlend.glsl.js"))))}initializePipeline(e){return n({blending:l,colorWrite:t,drawBuffers:e.hasEmission?{buffers:[o,i]}:{buffers:[o]}})}}export{a as OITBlendTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/PooledArray.js";class s{constructor(){this.adds=new e,this.removes=new e,this.updates=new e({allocator:e=>e||new r,deallocator:e=>(e.renderGeometry=null,e)})}clear(){this.adds.clear(),this.removes.clear(),this.updates.clear()}prune(){this.adds.prune(),this.removes.prune(),this.updates.prune()}get empty(){return 0===this.adds.length&&0===this.removes.length&&0===this.updates.length}}class r{}class t{constructor(){this.adds=new Array,this.removes=new Array,this.updates=new Array}}export{s as ChangeSet,t as MaterialChangeSet,r as RenderGeometryUpdate};
5
+ import e from"../../../../core/PooledArray.js";class s{constructor(){this.adds=new e,this.removes=new e,this.updates=new e({allocator:e=>e||new r,deallocator:e=>(e.renderGeometry=null,e)})}clear(){this.adds.clear(),this.removes.clear(),this.updates.clear()}prune(){this.adds.prune(),this.removes.prune(),this.updates.prune()}get empty(){return 0===this.adds.length&&0===this.removes.length&&0===this.updates.length}}class r{}class t{constructor(e){this.pending=e,this.adds=new Array,this.removes=new Array,this.updates=new Array}clearAddsAndRemoves(){this.adds.forEach((e=>this.pending.adds.removeUnordered(e))),this.removes.forEach((e=>this.pending.removes.removeUnordered(e))),this.adds.length=0,this.removes.length=0}clearUpdates(){this.updates.forEach((e=>this.pending.updates.removeUnordered(e))),this.updates.length=0}clear(){this.clearUpdates(),this.clearAddsAndRemoves()}}export{s as ChangeSet,t as MaterialChangeSet,r as RenderGeometryUpdate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ResourceState as s}from"./basicInterfaces.js";class t{constructor(s,t){this._material=s,this._repository=t,this._map=new Map}dispose(){this._map.forEach(((s,t)=>{null!=s&&this._repository.release(this._material,t)}))}load(t,e,r){const i=this._material.produces.get(e);if(!i?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,e,r));const a=this._map.get(r);if(null!=a){if(a.ensureResources(t)===s.LOADED)return a;this._repository.requestRender()}return null}}export{t as GLMaterials};
5
+ import{ResourceState as s}from"./basicInterfaces.js";class t{constructor(s,t){this._material=s,this._repository=t,this._map=new Map}dispose(){this._map.forEach(((s,t)=>{null!=s&&this._repository.release(this._material,t)}))}load(t,e,r){const i=this._material.produces.get(e);if(!i?.(r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,e,r));const a=this._map.get(r);if(a){if(a.ensureResources(t)===s.LOADED)return a;this._repository.requestRender()}return null}}export{t as GLMaterials};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- function e(e){return!!e.frameUpdate}export{e as isFrameUpdateTexture};
5
+ function t(t){return!!t.update}export{t as isUpdatableTexture};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{OITPass as e}from"./OITPass.js";import{BlendFactor as n,CompareFunction as t,ColorAttachment0 as o,ColorAttachment1 as u,ColorAttachment2 as s}from"../../../webgl/enums.js";import{separateBlendingParams as c,premultipliedAlphaToPremultipliedAlpha as a,defaultDepthWrite as l}from"../../../webgl/renderState.js";const f=c(n.ONE,n.ZERO,n.ONE,n.ONE_MINUS_SRC_ALPHA);function i(r){return r===e.FrontFace?null:f}function N(r){switch(r){case e.NONE:return a;case e.ColorAlpha:return f;case e.FrontFace:case e.COUNT:return null}}function p(r){if(r.draped)return null;switch(r.oitPass){case e.NONE:case e.FrontFace:return r.writeDepth?l:null;case e.ColorAlpha:case e.COUNT:return null}}const O=5e5,m={factor:-1,units:-2};function E(r){return r?m:null}function h(r,n=t.LESS){return r===e.NONE||r===e.FrontFace?n:t.LEQUAL}function F(n,t){const c=r(t);return n===e.ColorAlpha?c?{buffers:[o,u,s]}:{buffers:[o,u]}:c?{buffers:[o,u]}:null}export{m as OITPolygonOffset,O as OITPolygonOffsetLimit,N as blending,f as blendingColorAlpha,p as depthWrite,F as getDrawBuffers,E as getOITPolygonOffset,i as oitBlending,h as oitDepthTest};
5
+ import{isColorEmission as r}from"../core/shaderLibrary/ShaderOutput.js";import{OITPass as e}from"./OITPass.js";import{BlendFactor as n,CompareFunction as t,ColorAttachment0 as o,ColorAttachment1 as u,ColorAttachment2 as s}from"../../../webgl/enums.js";import{separateBlendingParams as c,unpremultipliedAlphaToPremultipliedAlpha as a,defaultDepthWrite as l}from"../../../webgl/renderState.js";const f=c(n.ONE,n.ZERO,n.ONE,n.ONE_MINUS_SRC_ALPHA);function i(r){return r===e.FrontFace?null:f}function N(r){switch(r){case e.NONE:return a;case e.ColorAlpha:return f;case e.FrontFace:case e.COUNT:return null}}function p(r){if(r.draped)return null;switch(r.oitPass){case e.NONE:case e.FrontFace:return r.writeDepth?l:null;case e.ColorAlpha:case e.COUNT:return null}}const O=5e5,m={factor:-1,units:-2};function E(r){return r?m:null}function h(r,n=t.LESS){return r===e.NONE||r===e.FrontFace?n:t.LEQUAL}function F(n,t){const c=r(t);return n===e.ColorAlpha?c?{buffers:[o,u,s]}:{buffers:[o,u]}:c?{buffers:[o,u]}:null}export{m as OITPolygonOffset,O as OITPolygonOffsetLimit,N as blending,f as blendingColorAlpha,p as depthWrite,F as getDrawBuffers,E as getOITPolygonOffset,i as oitBlending,h as oitDepthTest};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as i}from"../../../../geometry/support/HalfFloatArray.js";import{newIntArray as s,compactIndices as r}from"../../../../geometry/support/Indices.js";import{newShortArray as o}from"../../../../geometry/support/ShortArray.js";import{compressNormal as h}from"./Normals.js";class n{constructor(t,r,h,n,a,p={}){this.path=t,this.profile=r,this.extruder=h,this.startCap=n,this.endCap=a,this.options=p,this._extrusionVertexCount=0;const l=this.path.vertices.length-2;this.numExtrusionProfiles=h.numProfilesPerJoin()*l+2,this.numVerticesTotal=r.vertices.length*this.numExtrusionProfiles,this.startCap.vertexBufferStart=this.numVerticesTotal;const u=this.startCap.numVertices;this.numVerticesTotal+=u,this.endCap.vertexBufferStart=this.numVerticesTotal;const x=this.endCap.numVertices;this.numVerticesTotal+=x,this.pathVertexData=s(1*this.numVerticesTotal),this.profileRightAxes=o(2*this.numVerticesTotal),this.profileUpAxes=o(2*this.numVerticesTotal),this.profileVertexAndNormals=i(4*this.numVerticesTotal),this.profileAuxData=i(2*this.numVerticesTotal),this.positions=e(t.positions,t.offset,3*t.vertices.length),this._rebuildGeometry(),this._buildTopology()}get usedMemory(){return t(this.pathVertexData,this.profileRightAxes,this.profileUpAxes,this.profileVertexAndNormals,this.profileAuxData)+this.path.usedMemory+this.profile.usedMemory}emitVertex(t,e,i,s,r){let o=4*this._extrusionVertexCount;if(this.profileVertexAndNormals[o]=i[0],this.profileVertexAndNormals[o+1]=i[1],this.profileVertexAndNormals[o+2]=s[0],this.profileVertexAndNormals[o+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,o=2*this._extrusionVertexCount,r){const e=this.path.vertices[t],i=e.maxStretchDistance;this.profileAuxData[o]=e.rotationRight[0]*i,this.profileAuxData[o+1]=e.rotationRight[1]*i}else this.profileAuxData[o]=this.profileAuxData[o+1]=0;h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){let n=4*this._extrusionVertexCount;this.profileVertexAndNormals[n]=i[0],this.profileVertexAndNormals[n+1]=i[1],this.profileVertexAndNormals[n+2]=s[0],this.profileVertexAndNormals[n+3]=s[1],n=2*this._extrusionVertexCount,this.profileAuxData[n]=r,this.profileAuxData[n+1]=o,h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),this.pathVertexData[this._extrusionVertexCount]=t,++this._extrusionVertexCount}_rebuildGeometry(){this._extrusionVertexCount=0;const{positions:t,offset:i,vertices:s}=this.path;this.positions=e(t,i,3*s.length);let r=0;const o=(t,e,i,s,o)=>this.emitCapVertex(r,t,e,i,s,o),h=(t,e,i,s)=>this.emitVertex(r,t,e,i,s);for(this.startCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=1;r<s.length-1;++r)this.extruder.extrude(s[r],this.profile,h);this.endCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=0,this.startCap.rebuildCapGeometry(s[r],o),r=s.length-1,this.endCap.rebuildCapGeometry(s[r],o)}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1;let s=3*(2*(e*i));this.startCap.indexBufferStart=s,this.startCap.firstProfileVertexIndex=0,s+=this.startCap.numIndices,this.endCap.indexBufferStart=s,this.endCap.firstProfileVertexIndex=t*(this.numExtrusionProfiles-1);const o=new Array,h=new Array,n=(t,e,i)=>{o.push(t),o.push(e),o.push(i),h.push(this.pathVertexData[t]),h.push(this.pathVertexData[e]),h.push(this.pathVertexData[i])};for(let r=0;r<e;++r){const e=this.profile.indices[2*r],s=this.profile.indices[2*r+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+s,h=r*t+s;n(i,(r+1)*t+e,o),n(i,o,h)}}this.startCap.buildTopology(this.path.vertices[0],n),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],n),this.vertexIndices=r(o),this.pathVertexIndices=r(h)}onPathChanged(){this._rebuildGeometry()}}export{n as PathBuilder};
5
+ import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{floatSubArray as e}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as i}from"../../../../geometry/support/HalfFloatArray.js";import{newIntArray as s,compactIndices as r}from"../../../../geometry/support/Indices.js";import{newShortArray as o}from"../../../../geometry/support/ShortArray.js";import{compressNormal as h}from"./Normals.js";class a{constructor(t,r,h,a,n,p={}){this.path=t,this.profile=r,this.extruder=h,this.startCap=a,this.endCap=n,this.options=p,this._extrusionVertexCount=0;const l=this.path.vertices.length-2;this.numExtrusionProfiles=h.numProfilesPerJoin()*l+2,this.numVerticesTotal=r.vertices.length*this.numExtrusionProfiles,this.startCap.vertexBufferStart=this.numVerticesTotal;const u=this.startCap.numVertices;this.numVerticesTotal+=u,this.endCap.vertexBufferStart=this.numVerticesTotal;const x=this.endCap.numVertices;this.numVerticesTotal+=x,this.pathVertexData=s(1*this.numVerticesTotal),this.profileRightAxes=o(2*this.numVerticesTotal),this.profileUpAxes=o(2*this.numVerticesTotal),this.profileVertexAndNormals=i(4*this.numVerticesTotal),this.profileAuxData=i(3*this.numVerticesTotal),this.positions=e(t.positions,t.offset,3*t.vertices.length),this._rebuildGeometry(),this._buildTopology()}get usedMemory(){return t(this.pathVertexData,this.profileRightAxes,this.profileUpAxes,this.profileVertexAndNormals,this.profileAuxData)+this.path.usedMemory+this.profile.usedMemory}emitVertex(t,e,i,s,r){let o=4*this._extrusionVertexCount;if(this.profileVertexAndNormals[o]=i[0],this.profileVertexAndNormals[o+1]=i[1],this.profileVertexAndNormals[o+2]=s[0],this.profileVertexAndNormals[o+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,o=3*this._extrusionVertexCount,r){const e=this.path.vertices[t],i=e.maxStretchDistance;this.profileAuxData[o]=e.rotationRight[0]*i,this.profileAuxData[o+1]=e.rotationRight[1]*i}else this.profileAuxData[o]=this.profileAuxData[o+1]=0;this.profileAuxData[o+2]=0,h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){let a=4*this._extrusionVertexCount;this.profileVertexAndNormals[a]=i[0],this.profileVertexAndNormals[a+1]=i[1],this.profileVertexAndNormals[a+2]=s[0],this.profileVertexAndNormals[a+3]=s[1],a=3*this._extrusionVertexCount,this.profileAuxData[a]=r,this.profileAuxData[a+1]=o,this.profileAuxData[a+2]=1,h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),this.pathVertexData[this._extrusionVertexCount]=t,++this._extrusionVertexCount}_rebuildGeometry(){this._extrusionVertexCount=0;const{positions:t,offset:i,vertices:s}=this.path;this.positions=e(t,i,3*s.length);let r=0;const o=(t,e,i,s,o)=>this.emitCapVertex(r,t,e,i,s,o),h=(t,e,i,s)=>this.emitVertex(r,t,e,i,s);for(this.startCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=1;r<s.length-1;++r)this.extruder.extrude(s[r],this.profile,h);this.endCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=0,this.startCap.rebuildCapGeometry(s[r],o),r=s.length-1,this.endCap.rebuildCapGeometry(s[r],o)}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1;let s=3*(2*(e*i));this.startCap.indexBufferStart=s,this.startCap.firstProfileVertexIndex=0,s+=this.startCap.numIndices,this.endCap.indexBufferStart=s,this.endCap.firstProfileVertexIndex=t*(this.numExtrusionProfiles-1);const o=new Array,h=new Array,a=(t,e,i)=>{o.push(t),o.push(e),o.push(i),h.push(this.pathVertexData[t]),h.push(this.pathVertexData[e]),h.push(this.pathVertexData[i])};for(let r=0;r<e;++r){const e=this.profile.indices[2*r],s=this.profile.indices[2*r+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+s,h=r*t+s;a(i,(r+1)*t+e,o),a(i,o,h)}}this.startCap.buildTopology(this.path.vertices[0],a),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],a),this.vertexIndices=r(o),this.pathVertexIndices=r(h)}onPathChanged(){this._rebuildGeometry()}}export{a as PathBuilder};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{copy as t,set as e,length as s,normalize as i,dot as r,scale as o,add as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as h,i as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as m}from"../../../../geometry/support/Indices.js";import{Attribute as d,Vertices as f}from"./Attribute.js";import{decompressNormal as b,compressNormal as v}from"./Normals.js";import{intersectTriangles as g}from"./RayIntersections.js";import{VertexAttribute as A}from"./VertexAttribute.js";class x{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class I extends x{constructor(t){super(t),this.color=p(255,255,255,255),this._size=n(),this.positions=u(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){this.color[0]=255*t[0],this.color[1]=255*t[1],this.color[2]=255*t[2],this.color[3]=255*(t.length>3?t[3]:1)}bake(n){t(this._size,n);const{numVerticesTotal:c,pathVertexData:p,path:u,positions:m,profileRightAxes:d,profileUpAxes:f,profileVertexAndNormals:g,profileAuxData:A}=this.builder;for(let t=0;t<c;++t){let c=p[t];const x=0===c||c===u.vertices.length-1;c*=3;const I=V;let D=0,E=0;const T=b(w,d,t),C=b(j,f,t),N=4*t,y=e(O,g[N]*n[0],g[N+1]*n[1]),L=2*t;if(x)h(I,C,T),D=A[L]*n[0],E=A[L+1];else{const t=P,n=R;e(t,A[L],A[L+1]);const h=s(t);i(t,t);const c=r(y,t);if(Math.abs(c)>h){e(n,-t[1],t[0]);const s=r(y,n);o(t,t,h*Math.sign(c)),o(n,n,s),a(y,t,n)}l(I,0,0,0)}const z=T[0]*y[0]+C[0]*y[1],F=T[1]*y[0]+C[1]*y[1],M=T[2]*y[0]+C[2]*y[1],U=3*t;this.positions[U]=m[c]+z+I[0]*D,this.positions[U+1]=m[c+1]+F+I[1]*D,this.positions[U+2]=m[c+2]+M+I[2]*D;const k=g[N+2],S=g[N+3];v(this.normals,t,T[0]*k+C[0]*S+I[0]*E,T[1]*k+C[1]*S+I[1]*E,T[2]*k+C[2]*S+I[2]*E)}}createGeometryData(){const t=this.builder.vertexIndices;return[[A.POSITION,new d(this.positions,t,3,!0)],[A.NORMALCOMPRESSED,new d(this.normals,t,2,!0)],[A.COLOR,new d(this.color,m(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,s,i){const r=this.builder.vertexIndices,o=new f(this.positions,3),a=r.length/3;g(t,e,0,a,r,o,void 0,s,((t,e,s)=>i(t,s,e,!1)))}get size(){return this._size}}class D extends x{constructor(t,e,s,i){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=s,this.opacityAttributeValue=i,this.vvData=null,this.baked=new I(t),this.vvData=u(4*this.builder.path.vertices.length);for(let r=0;r<this.builder.path.vertices.length;++r){this.vvData[4*r]=e,this.vvData[4*r+1]=s,this.vvData[4*r+2]=i;const t=0===r||r===this.builder.path.vertices.length-1;this.vvData[4*r+3]=t?1:0}}createGeometryData(){const t=this.builder,{pathVertexIndices:e,vertexIndices:s}=t;return[[A.POSITION,new d(t.positions,e,3,!0)],[A.PROFILEVERTEXANDNORMAL,new d(t.profileVertexAndNormals,s,4,!0)],[A.FEATUREVALUE,new d(this.vvData,e,4,!0)],[A.PROFILEAUXDATA,new d(t.profileAuxData,s,2,!0)],[A.PROFILERIGHT,new d(t.profileRightAxes,s,2,!0)],[A.PROFILEUP,new d(t.profileUpAxes,s,2,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute(A.POSITION);e&&(e.data=this.builder.positions)}}const O=n(),P=n(),R=n(),V=c(),w=c(),j=c();export{D as FastUpdatePathGeometry,x as PathGeometryData,I as StaticPathGeometry};
5
+ import{copy as t,set as e,length as s,normalize as i,dot as o,scale as r,add as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as h,i as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as m}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as u}from"../../../../geometry/support/Indices.js";import{Attribute as f,Vertices as d}from"./Attribute.js";import{decompressNormal as b,compressNormal as A}from"./Normals.js";import{intersectTriangles as g}from"./RayIntersections.js";import{VertexAttribute as v}from"./VertexAttribute.js";class x{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class I extends x{constructor(t){super(t),this.color=p(255,255,255,255),this._size=n(),this.positions=m(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){this.color[0]=255*t[0],this.color[1]=255*t[1],this.color[2]=255*t[2],this.color[3]=255*(t.length>3?t[3]:1)}bake(n){t(this._size,n);const{numVerticesTotal:c,pathVertexData:p,positions:m,profileRightAxes:u,profileUpAxes:f,profileVertexAndNormals:d,profileAuxData:g}=this.builder;for(let t=0;t<c;++t){let c=p[t];c*=3;const v=V;let x=0,I=0;const O=b(w,u,t),E=b(j,f,t),T=4*t,C=e(P,d[T]*n[0],d[T+1]*n[1]),N=3*t;if(1===g[N+2])h(v,E,O),x=g[N]*n[0],I=g[N+1];else{const t=D,n=R;e(t,g[N],g[N+1]);const h=s(t);i(t,t);const c=o(C,t);if(Math.abs(c)>h){e(n,-t[1],t[0]);const s=o(C,n);r(t,t,h*Math.sign(c)),r(n,n,s),a(C,t,n)}l(v,0,0,0)}const _=O[0]*C[0]+E[0]*C[1],y=O[1]*C[0]+E[1]*C[1],L=O[2]*C[0]+E[2]*C[1];this.positions[N]=m[c]+_+v[0]*x,this.positions[N+1]=m[c+1]+y+v[1]*x,this.positions[N+2]=m[c+2]+L+v[2]*x;const z=d[T+2],F=d[T+3];A(this.normals,t,O[0]*z+E[0]*F+v[0]*I,O[1]*z+E[1]*F+v[1]*I,O[2]*z+E[2]*F+v[2]*I)}}createGeometryData(){const t=this.builder.vertexIndices;return[[v.POSITION,new f(this.positions,t,3,!0)],[v.NORMALCOMPRESSED,new f(this.normals,t,2,!0)],[v.COLOR,new f(this.color,u(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,s,i){const o=this.builder.vertexIndices,r=new d(this.positions,3),a=o.length/3;g(t,e,0,a,o,r,void 0,s,((t,e,s)=>i(t,s,e,!1)))}get size(){return this._size}}class O extends x{constructor(t,e,s,i){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=s,this.opacityAttributeValue=i,this.baked=new I(t),this._vvData=m(3*this.builder.path.vertices.length);for(let o=0;o<this._vvData.length;o+=3)this._vvData[o]=e,this._vvData[o+1]=s,this._vvData[o+2]=i}createGeometryData(){const t=this.builder,{pathVertexIndices:e,vertexIndices:s}=t;return[[v.POSITION,new f(t.positions,e,3,!0)],[v.FEATUREVALUE,new f(this._vvData,e,3,!0)],[v.PROFILEVERTEXANDNORMAL,new f(t.profileVertexAndNormals,s,4,!0)],[v.PROFILEAUXDATA,new f(t.profileAuxData,s,3,!0)],[v.PROFILERIGHT,new f(t.profileRightAxes,s,2,!0)],[v.PROFILEUP,new f(t.profileUpAxes,s,2,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute(v.POSITION);e&&(e.data=this.builder.positions)}}const P=n(),D=n(),R=n(),V=c(),w=c(),j=c();export{O as FastUpdatePathGeometry,x as PathGeometryData,I as StaticPathGeometry};