@arcgis/core 4.34.0-next.78 → 4.34.0-next.79

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 (125) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{0668eee42b3169e1bf66.js → 03e5d1a00d85e4d16bff.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{e81386199a6db9a50fd3.js → 0914a52fb33af5d77fab.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{29a86d51407310bb7745.js → 09f1a27442bdd52cdeb7.js} +1 -1
  5. package/assets/esri/core/workers/chunks/0bae29ffcbb812d3ba0d.js +1 -0
  6. package/assets/esri/core/workers/chunks/0dfc2ca36014910457ef.js +1 -0
  7. package/assets/esri/core/workers/chunks/{a0edff37fd4a3f2cb2eb.js → 1c7fffb496af6f2540dd.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{7680d4d739f7aa3f7ae1.js → 20ae2316d927415f3df9.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{54b1a960bb8c3fe05976.js → 2266a8f2c2ec37c19bb4.js} +1 -1
  10. package/assets/esri/core/workers/chunks/22bd4255b6b511a43b66.js +1 -0
  11. package/assets/esri/core/workers/chunks/{9ce599dc1d385e6893c1.js → 22f196d173711ebd64c7.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{fc06014fb484fc8c697e.js → 23a13fbab9984953a7c6.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{3f7d7dc05e63fc50325e.js → 3c0990c4be06a2fd51e9.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{d69bd6b5d781a6c527d1.js → 486ea51306c619238e41.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{cc7423413747566f56e2.js → 49cb78c85de0102e5f02.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{b9e725d2b5a7d0132663.js → 5610dfde4e636e2333a9.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{5ed381a268855bcad072.js → 56edb55b53779e7fd31e.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{bccecd678faff927ac76.js → 5b35b30495145bf8dd5d.js} +1 -1
  19. package/assets/esri/core/workers/chunks/5c1cdc2ec06c4c6bd0b3.js +1 -0
  20. package/assets/esri/core/workers/chunks/{3452ba299f6ce0582f09.js → 5dee8c0c60ced791e57f.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{3f523bc8551e712c9bd4.js → 637a5293e36f4f7f2853.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{3505988ce3839cdbbc98.js → 651b9144abb1895cc510.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{9e3164bf8872d7b1b191.js → 66e0bc4acb18f00a433d.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{afa3ca2bd2648774f133.js → 6e2a3abc3dbc342212c4.js} +1 -1
  25. package/assets/esri/core/workers/chunks/6e4ec9fa931c69e4e4ba.js +1 -0
  26. package/assets/esri/core/workers/chunks/6e5175b43220d6692263.js +1 -0
  27. package/assets/esri/core/workers/chunks/{cac5732f9dfece4bf2c5.js → 7402c2853f6aed8d1bc7.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{49e6202da7a20f06c661.js → 76db75337044de8218c9.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{b97f224972f1b1abaee8.js → 79a9f47dfa9ebabb5dbd.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{d1657a29321adb259166.js → 86378d4f4d7f9a370c22.js} +1 -1
  31. package/assets/esri/core/workers/chunks/86832d94190150c70c11.js +1 -0
  32. package/assets/esri/core/workers/chunks/{d89832617bac4890893e.js → 885a398de8a33d36c59e.js} +1 -1
  33. package/assets/esri/core/workers/chunks/88d8ff0140f5ea97c6b7.js +1 -0
  34. package/assets/esri/core/workers/chunks/{5248581d23ada240c78d.js → 8cae725e631d922853c8.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{0b69d251961d8b46fe30.js → 9346437b152b20bdcf8a.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{a05a7df07b74e1957538.js → 9673e25114fc1897460d.js} +1 -1
  37. package/assets/esri/core/workers/chunks/96e483db7dd1f5dbb07a.js +1 -0
  38. package/assets/esri/core/workers/chunks/9789f178ece126c4006d.js +1 -0
  39. package/assets/esri/core/workers/chunks/9a0b9d931c1a29e81475.js +1 -0
  40. package/assets/esri/core/workers/chunks/{feed74ed275f21a68a1b.js → 9c5dcef2a75d4bb9b3d6.js} +1 -1
  41. package/assets/esri/core/workers/chunks/a7fcb60d5a9d2d9560e4.js +1 -0
  42. package/assets/esri/core/workers/chunks/aa84775399420e35c6a5.js +1 -0
  43. package/assets/esri/core/workers/chunks/{8b7f6f2d1692b6b6dbd5.js → ae6066ea6cb373dc6db3.js} +1 -1
  44. package/assets/esri/core/workers/chunks/ae8dce1a43ca7019f81d.js +1 -0
  45. package/assets/esri/core/workers/chunks/afb2770c4abbff9bab3d.js +1 -0
  46. package/assets/esri/core/workers/chunks/{a8a79a5c804ef715aa94.js → b4b26cc2ba3ff30e1d03.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{8a5e40f48a8265fd1b42.js → b78ea9cc4d5f2fd3d871.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{ce49ff6bf20cff349726.js → be8dd8e68c8805300ad1.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{b8d02f1b73c374767a5f.js → c78de6dd6c10280cee69.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{92d0e0155563c6355079.js → c90571063bd2bb57a5a7.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{930322c9790572bd0c49.js → d2fe403d6ab237bc89c2.js} +1 -1
  52. package/assets/esri/core/workers/chunks/d7adef4093ce19ad356d.js +1 -0
  53. package/assets/esri/core/workers/chunks/{b4ba7f8ea81522ad1e2e.js → da42cc4f6142846cb745.js} +1 -1
  54. package/assets/esri/core/workers/chunks/e080628ac6e1cf25dc72.js +1 -0
  55. package/assets/esri/core/workers/chunks/{8c94448a44fb27054a22.js → e760b8ca64d67c04d98a.js} +1 -1
  56. package/assets/esri/core/workers/chunks/edaf059c7ea18088c3dd.js +1 -0
  57. package/assets/esri/core/workers/chunks/{e7af5caab9aa9b6a12e3.js → ede479faa4e6920fe673.js} +3 -3
  58. package/assets/esri/core/workers/chunks/f9decc88561c03aca3c9.js +1 -0
  59. package/chunks/FocusAreaColor.glsl.js +5 -5
  60. package/config.js +1 -1
  61. package/core/NestedMap.js +1 -1
  62. package/interfaces.d.ts +57 -58
  63. package/intl/date.js +1 -1
  64. package/intl/number.js +1 -1
  65. package/kernel.js +1 -1
  66. package/layers/FeatureLayer.js +1 -1
  67. package/layers/support/DateTimeFieldFormat.js +5 -0
  68. package/layers/support/FieldConfiguration.js +5 -0
  69. package/layers/support/FieldFormat.js +5 -0
  70. package/layers/support/NumberFieldFormat.js +5 -0
  71. package/layers/support/fieldConfigUtils.js +5 -0
  72. package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +1 -1
  73. package/package.json +5 -5
  74. package/rest/print.js +1 -1
  75. package/rest/support/AttributeBinsQuery.js +1 -1
  76. package/rest/support/Query.js +1 -1
  77. package/rest/support/QueryMixin.d.ts +2 -2
  78. package/rest/support/QueryMixin.js +5 -0
  79. package/rest/support/TopFeaturesQuery.js +1 -1
  80. package/support/arcadeExpressionUtils.js +1 -1
  81. package/support/revision.js +1 -1
  82. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
  83. package/views/3d/FocusAreasView.js +1 -1
  84. package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
  85. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  86. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColor.glsl.js +1 -1
  87. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  88. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  89. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  90. package/views/3d/webgl-engine/lib/GeometryBaseInstance.js +5 -0
  91. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  92. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  93. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  94. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  95. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  96. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  97. package/views/3d/webgl-engine/materials/renderers/PerBaseInstanceData.js +5 -0
  98. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  99. package/views/3d/webgl-engine/materials/renderers/PerOriginData.js +1 -1
  100. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  101. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  102. package/widgets/FeatureTable/Grid/Column.js +1 -1
  103. package/widgets/Legend.js +1 -1
  104. package/widgets/Popup.js +1 -1
  105. package/widgets/Search/SearchViewModel.js +1 -1
  106. package/widgets/Sketch/SketchViewModel.js +1 -1
  107. package/assets/esri/core/workers/chunks/25118304c9a914194e90.js +0 -1
  108. package/assets/esri/core/workers/chunks/3d6f07e04f77cc0a7506.js +0 -1
  109. package/assets/esri/core/workers/chunks/4f22e5a7f81883e8e5b6.js +0 -1
  110. package/assets/esri/core/workers/chunks/5102c20645d9708c34b4.js +0 -1
  111. package/assets/esri/core/workers/chunks/79e965e8f7cf822b4f45.js +0 -1
  112. package/assets/esri/core/workers/chunks/7b1fc59822ac2d421a5a.js +0 -1
  113. package/assets/esri/core/workers/chunks/83589cfcc443b925c1aa.js +0 -1
  114. package/assets/esri/core/workers/chunks/8f02349602b072186a1f.js +0 -1
  115. package/assets/esri/core/workers/chunks/9835c579edfc08125d31.js +0 -1
  116. package/assets/esri/core/workers/chunks/a7e649b3b02e664ada80.js +0 -1
  117. package/assets/esri/core/workers/chunks/adc61d88c3c6936ad75a.js +0 -1
  118. package/assets/esri/core/workers/chunks/ae7b86bd08a44e26b339.js +0 -1
  119. package/assets/esri/core/workers/chunks/bbb3b32affde9ea78534.js +0 -1
  120. package/assets/esri/core/workers/chunks/c35dad3d5ceaac6ad5a4.js +0 -1
  121. package/assets/esri/core/workers/chunks/c4b2678dd46fa1e22f7e.js +0 -1
  122. package/assets/esri/core/workers/chunks/cafc19bf2caaf7a8c2e8.js +0 -1
  123. package/assets/esri/core/workers/chunks/d2b69f91eb85b561fe01.js +0 -1
  124. package/assets/esri/core/workers/chunks/f6107f844f4feed42828.js +0 -1
  125. package/assets/esri/core/workers/chunks/fac020b6886ff2d75015.js +0 -1
@@ -333,7 +333,7 @@ if (renderTransparentlyOccludedHUD > 0.5) {
333
333
  return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g * renderTransparentlyOccludedHUD < 1.0;
334
334
  }
335
335
  return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g == 1.0;
336
- }`)}},51624:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(44208),n=r(69397),s=r(93687);const o=4294967296,a=new TextDecoder("utf-8"),l=(0,i.A)("safari")||(0,i.A)("ios")?6:(0,i.A)("ff")?12:32;class c{constructor(e,t,r=0,i=(e?e.byteLength:0)){this._tag=0,this._dataType=99,this._init(e,t,r,i)}_init(e,t,r,i){this._data=e,this._dataView=t,this._pos=r,this._end=i}get usedMemory(){return 64+(0,n.Qf)(this._data)}asUnsafe(){return this}clone(){return new c(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;if(e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128)return e;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,r=e.getUint32(t,!0)+e.getUint32(t+4,!0)*o;return this._skip(8),r}getSFixed64(){const e=this._dataView,t=this._pos,r=e.getUint32(t,!0)+e.getInt32(t+4,!0)*o;return this._skip(8),r}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,r=this._toString(this._data,t,t+e);return this._skip(e),r}getBytes(){const e=this._getLength(),t=this._pos,r=this._toBytes(this._data,t,t+e);return this._skip(e),r}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,r,i){const n=this.getMessage(),s=e(n,t,r,i);return n.release(),s}processMessage(e){const t=this.getMessage(),r=e(t);return t.release(),r}getMessage(){const e=this._getLength(),t=c.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){c.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case 0:this._decodeVarint();break;case 1:this._skip(8);break;case 2:this._skip(this._getLength());break;case 5:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t=this._pos,r=0,i=0;if(this._end-t>=10)do{if(i=e[t++],r|=127&i,!(128&i))break;if(i=e[t++],r|=(127&i)<<7,!(128&i))break;if(i=e[t++],r|=(127&i)<<14,!(128&i))break;if(i=e[t++],r|=(127&i)<<21,!(128&i))break;if(i=e[t++],r+=268435456*(127&i),!(128&i))break;if(i=e[t++],r+=34359738368*(127&i),!(128&i))break;if(i=e[t++],r+=4398046511104*(127&i),!(128&i))break;if(i=e[t++],r+=562949953421312*(127&i),!(128&i))break;if(i=e[t++],r+=72057594037927940*(127&i),!(128&i))break;if(i=e[t++],r+=0x8000000000000000*(127&i),!(128&i))break;throw new Error("Varint too long!")}while(0);else{let n=1;for(;t!==this._end&&(i=e[t],128&i);)++t,r+=(127&i)*n,n*=128;if(t===this._end)throw new Error("Varint overrun!");++t,r+=i*n}return this._pos=t,r}_decodeSVarint(){const e=this._data;let t,r=0,i=0;const n=1&e[this._pos];if(i=e[this._pos++],r|=127&i,!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r|=(127&i)<<7,!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r|=(127&i)<<14,!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r|=(127&i)<<21,!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r+=268435456*(127&i),!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r+=34359738368*(127&i),!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r+=4398046511104*(127&i),!(128&i))return n?-(r+1)/2:r/2;if(t=BigInt(r),i=e[this._pos++],t+=0x2000000000000n*BigInt(127&i),!(128&i))return Number(n?-(t+1n)/2n:t/2n);if(i=e[this._pos++],t+=0x100000000000000n*BigInt(127&i),!(128&i))return Number(n?-(t+1n)/2n:t/2n);if(i=e[this._pos++],t+=0x8000000000000000n*BigInt(127&i),!(128&i))return Number(n?-(t+1n)/2n:t/2n);throw new Error("Varint too long!")}_getLength(){if(2!==this._dataType)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,r){if((r=Math.min(this._end,r))-t>l){const i=e.subarray(t,r);return a.decode(i)}let i="",n="";for(let s=t;s<r;++s){const t=e[s];128&t?n+="%"+t.toString(16):(i+=decodeURIComponent(n)+String.fromCharCode(t),n="")}return n.length&&(i+=decodeURIComponent(n)),i}_toBytes(e,t,r){return r=Math.min(this._end,r),new Uint8Array(e.buffer,t,r-t)}static{this.pool=new s.A(()=>new c(null,null),void 0,e=>{e._data=null,e._dataView=null})}}},52106:(e,t,r)=>{r.d(t,{A:()=>x});var i,n=r(31635),s=r(37838),o=r(69540),a=r(51447),l=r(25482),c=r(53966),u=r(36708),d=r(24326),h=r(10107),f=(r(44208),r(87811),r(40608)),p=r(12195),m=r(65864),y=r(50498),g=r(55156),b=r(60950),_=r(54339),v=r(33910);function w(e){if(null==e)return null;const t={};for(const r in e){const i=e[r];i&&(t[r]=i.toJSON())}return 0!==Object.keys(t).length?t:null}let x=class extends((0,o.OU)(l.o)){static{i=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,d.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,a.eF)(c.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new i({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,b.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const r=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[r,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=(0,g.I)(this.origin);if(e)return(0,_.r)(this,e);const t=this.sourceLayer??this.layer;return t?(0,_.r)(this,t):null}getGlobalId(){const e=(0,g.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);const t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){return{aggregateGeometries:w(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,p.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,i){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const n={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(n.action=i),"attributes"===e&&(n.attributeName=i),this.layer.graphicChanged(n)}_watchMeshGeometryChanges(){this.addHandles([(0,u.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,u.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,n.Cg)([(0,h.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const i=(0,m.rS)(e[r]);i&&(t[r]=i)}return 0!==Object.keys(t).length?t:null}}})],x.prototype,"aggregateGeometries",null),(0,n.Cg)([(0,h.MZ)({value:null})],x.prototype,"attributes",null),(0,n.Cg)([(0,h.MZ)({value:null,types:y.yR,json:{read:m.rS}})],x.prototype,"geometry",null),(0,n.Cg)([(0,h.MZ)({type:Boolean})],x.prototype,"isAggregate",void 0),(0,n.Cg)([(0,h.MZ)({clonable:!1})],x.prototype,"layer",void 0),(0,n.Cg)([(0,h.MZ)({clonable:"reference"})],x.prototype,"origin",void 0),(0,n.Cg)([(0,h.MZ)({type:s.A,value:null})],x.prototype,"popupTemplate",null),(0,n.Cg)([(0,h.MZ)({clonable:"reference"})],x.prototype,"sourceLayer",void 0),(0,n.Cg)([(0,h.MZ)({value:null,types:v.Es})],x.prototype,"symbol",null),(0,n.Cg)([(0,h.MZ)({clonable:!1,json:{read:!1,write:!1}})],x.prototype,"_version",void 0),(0,n.Cg)([(0,h.MZ)({type:Boolean,value:!0})],x.prototype,"visible",null),x=i=(0,n.Cg)([(0,f.$)("esri.Graphic")],x)},53177:(e,t,r)=>{r.d(t,{A:()=>d});var i,n=r(31635),s=r(4718),o=r(10107),a=(r(44208),r(53966),r(93223)),l=r(40608),c=r(39357),u=r(76357);let d=class extends u.A{static{i=this}constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const r=String(e);this.codedValues.some(e=>(String(e.code)===r&&(t=e.name),!!t))}return t}clone(){return new i({codedValues:(0,s.o8)(this.codedValues),name:this.name})}};(0,n.Cg)([(0,o.MZ)({type:[c.H],json:{write:{isRequired:!0}}})],d.prototype,"codedValues",void 0),(0,n.Cg)([(0,a.e)({codedValue:"coded-value"})],d.prototype,"type",void 0),d=i=(0,n.Cg)([(0,l.$)("esri.layers.support.CodedValueDomain")],d)},53655:(e,t,r)=>{r.d(t,{SH:()=>P,ae:()=>C,cn:()=>b});var i=r(49186),n=r(51624),s=r(92722),o=r(69418);const a=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],l=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],c=["upperLeft","lowerLeft"];function u(e){return e>=a.length?null:a[e]}function d(e){return e>=l.length?null:l[e]}function h(e){return e>=c.length?null:c[e]}function f(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function p(e,t,r){const i=e.asUnsafe(),n=t.createPointGeometry(r);for(;i.next();)switch(i.tag()){case 3:{const e=i.getUInt32(),r=i.pos()+e;let s=0;for(;i.pos()<r;)t.addCoordinatePoint(n,i.getSInt64(),s++);break}default:i.skip()}return n}function m(e,t,r){const i=e.asUnsafe(),n=t.createGeometry(r),s=2+(r.hasZ?1:0)+(r.hasM?1:0);for(;i.next();)switch(i.tag()){case 2:{const e=i.getUInt32(),r=i.pos()+e;let s=0;for(;i.pos()<r;)t.addLength(n,i.getUInt32(),s++);break}case 3:{const e=i.getUInt32(),r=i.pos()+e;let o=0;for(t.allocateCoordinates(n);i.pos()<r;)t.addCoordinate(n,i.getSInt64(),o),o++,o===s&&(o=0);break}default:i.skip()}return n}function y(e){const t=e.asUnsafe(),r=new s.A;let i="esriGeometryPoint";for(;t.next();)switch(t.tag()){case 2:{const e=t.getUInt32(),i=t.pos()+e;for(;t.pos()<i;)r.lengths.push(t.getUInt32());break}case 3:{const e=t.getUInt32(),i=t.pos()+e;for(;t.pos()<i;)r.coords.push(t.getSInt64());break}case 1:i=o.z[t.getEnum()];break;default:t.skip()}return{queryGeometry:r,queryGeometryType:i}}function g(e){const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:return t.getString();case 2:return t.getFloat();case 3:return t.getDouble();case 4:return t.getSInt32();case 5:return t.getUInt32();case 6:return t.getInt64();case 7:return t.getUInt64();case 8:return t.getSInt64();case 9:return t.getBool();default:return t.skip(),null}return null}function b(e){const t=e.asUnsafe(),r={type:u(0)};for(;t.next();)switch(t.tag()){case 1:r.name=t.getString();break;case 2:r.type=u(t.getEnum());break;case 3:r.alias=t.getString();break;case 4:r.sqlType=d(t.getEnum());break;case 5:default:t.skip();break;case 6:r.defaultValue=t.getString()}return r}function _(e){const t={},r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t.name=r.getString();break;case 2:t.isSystemMaintained=r.getBool();break;default:r.skip()}return t}function v(e,t,r,i){const n=t.createFeature(r);let s=0;for(;e.next();)switch(e.tag()){case 1:{const t=i[s++].name;n.attributes[t]=e.processMessage(g);break}case 2:n.geometry=e.processMessageWithArgs(m,t,r);break;case 4:n.centroid=e.processMessageWithArgs(p,t,r);break;default:e.skip()}return n}function w(e){const t=[1,1,1,1],r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t[0]=r.getDouble();break;case 2:t[1]=r.getDouble();break;case 4:t[2]=r.getDouble();break;case 3:t[3]=r.getDouble();break;default:r.skip()}return t}function x(e){const t=[0,0,0,0],r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t[0]=r.getDouble();break;case 2:t[1]=r.getDouble();break;case 4:t[2]=r.getDouble();break;case 3:t[3]=r.getDouble();break;default:r.skip()}return t}function C(e){const t={originPosition:h(0)},r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t.originPosition=h(r.getEnum());break;case 2:t.scale=r.processMessage(w);break;case 3:t.translate=r.processMessage(x);break;default:r.skip()}return t}function S(e){const t={},r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t.shapeAreaFieldName=r.getString();break;case 2:t.shapeLengthFieldName=r.getString();break;case 3:t.units=r.getString();break;default:r.skip()}return t}function T(e,t){const r=t.createSpatialReference();for(;e.next();)switch(e.tag()){case 1:r.wkid=e.getUInt32();break;case 5:r.wkt=e.getString();break;case 2:r.latestWkid=e.getUInt32();break;case 3:r.vcsWkid=e.getUInt32();break;case 4:r.latestVcsWkid=e.getUInt32();break;default:e.skip()}return r}function A(e,t){const r=t.createFeatureResult(),i=e.asUnsafe();r.geometryType=f(t,0);let n=!1;for(;i.next();)switch(i.tag()){case 1:r.objectIdFieldName=i.getString();break;case 3:r.globalIdFieldName=i.getString();break;case 4:r.geohashFieldName=i.getString();break;case 5:r.geometryProperties=i.processMessage(S);break;case 7:r.geometryType=f(t,i.getEnum());break;case 8:r.spatialReference=i.processMessageWithArgs(T,t);break;case 10:r.hasZ=i.getBool();break;case 11:r.hasM=i.getBool();break;case 12:r.transform=i.processMessage(C);break;case 9:r.exceededTransferLimit=i.getBool();break;case 13:t.addField(r,i.processMessage(b));break;case 15:n||(t.prepareFeatures(r),n=!0),t.addFeature(r,i.processMessageWithArgs(v,t,r,r.fields));break;case 2:r.uniqueIdField=i.processMessage(_);break;default:i.skip()}return t.finishFeatureResult(r),r}function I(e,t){const r={};let i=null;for(;e.next();)switch(e.tag()){case 4:i=e.processMessageWithArgs(y);break;case 1:r.featureResult=e.processMessageWithArgs(A,t);break;default:e.skip()}return null!=i&&r.featureResult&&t.addQueryGeometry(r,i),r}function P(e,t){try{const r=2,i=new n.A(new Uint8Array(e),new DataView(e)),s={};for(;i.next();)i.tag()===r?s.queryResult=i.processMessageWithArgs(I,t):i.skip();return s}catch(e){throw new i.A("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}}},55156:(e,t,r)=>{r.d(t,{I:()=>n,e:()=>i});const i=Symbol("idFieldsProviderSymbol");function n(e){return(t=e)&&i in t?e[i]:void 0;var t}},55674:(e,t,r)=>{r.d(t,{Ad:()=>f,Gj:()=>y,QY:()=>h,lL:()=>g,xR:()=>p});var i=r(66131),n=r(49186),s=(r(44208),r(44729)),o=r(15032),a=r(65864),l=r(95466),c=r(43668),u=r(98623);const d=["geometry","scale","timeProperties"];function h(e,t){if(null!=t)for(const r of d)t.hasArcadeDependency(r)&&e.add(r);return e}function f(e,t){return m.create(e,t,null,["$feature","$view"])}function p(e,t,r){return m.create(e,t,r,["$feature","$view","$config"])}class m{static async create(e,t,r,i){const{arcade:s,Dictionary:o}=await(0,c.l)();let a;try{a=s.parseScript(e)}catch(t){throw new n.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const l=s.scriptUsesGeometryEngine(a);l&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,a,null,!1,l);const u={vars:i.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},d=s.compileScript(a,u);let h=null;null!=r&&(h=new o(r),h.immutable=!0);const f=new o;return f.immutable=!1,f.setField("scale",0),new m(e,s,a,d,t,f,h,o)}constructor(e,t,r,i,n,s,o,a){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=i,this._spatialReference=n,this._viewDict=s,this._configDict=o,this._dictionaryCtor=a,this._dependencies=new Map,this._featureReader=new y,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const r=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:n,currentEnd:s}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=n?null!=r?i.lY.epochToArcadeDate(n,r):i.lY.unknownEpochToArcadeDate(n):void 0,currentEnd:null!=s?null!=r?i.lY.epochToArcadeDate(s,r):i.lY.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:r})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class y{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const i=t??new l.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,a.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===u.L5}field(e,t=!0){const r=this._getField(e);if(r){const t=this._boundTarget.attributes[r.name];if(null==t)return null;switch(r.type){case"date-only":case"esriFieldTypeDateOnly":return s.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return o.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return i.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?i.lY.unknownEpochToArcadeDate(t):i.lY.epochToArcadeDate(t,this.contextTimeZone??u.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},58501:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(62815);function n(e,t,r){if(!r?.features||!r.hasZ)return;const n=(0,i.N)(r.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of r.features)n(e.geometry)}},60271:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ii});var i=r(31635),n=r(65529),s=r(74887),o=r(36708),a=r(10107),l=r(44208),c=r(53966),u=(r(87811),r(40608)),d=r(5443),h=r(98988),f=r(16930),p=r(56390),m=r(61956),y=r(65494);class g{constructor(e,t,r){this.renderCommandContext=e,this.renderCommandBuffer=t,this.pipelineStateCommands=r}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const t of e)this.appendPipelineStateCommand(t)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}static create(e,t=[]){return new g(e,e.createRenderCommandBuffer(),t)}}var b=r(68197),_=r(18574),v=r(87403),w=r(28975);function x(){return new _.A({material:new w.N({color:new b.A("red")})})}var C=r(9093),S=r(51850),T=r(91829),A=r(6847),I=r(83047),P=r(58083),B=r(87317),E=r(70328),O=r(19419);r(12359),r(95108),r(27615),r(52106),r(4718),r(34275),r(65864);var M=r(37585),R=r(48163),F=r(34727),D=r(26857);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const j=[];{const e=16;for(let t=0;t<360;t+=360/e)j.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}Object.freeze({left:0,center:.5,right:1});const V=Object.freeze({"bottom-left":(0,R.fA)(0,0),bottom:(0,R.fA)(.5,0),"bottom-right":(0,R.fA)(1,0),left:(0,R.fA)(0,.5),center:(0,R.fA)(.5,.5),right:(0,R.fA)(1,.5),"top-left":(0,R.fA)(0,1),top:(0,R.fA)(.5,1),"top-right":(0,R.fA)(1,1)});var z=r(9762),k=r(27993);function L(e){const{featureCount:t}=e;if(0===t)return new Uint32Array;const r=new Uint32Array(t);return e.getObjectIdsArray(r),r}function U(e){const{featureCount:t}=e;if(0===t)return new Float64Array;const r=new Float64Array(3*t);return e.getCoordinatesArray(r),r}function q(e,t){const r=t.viewSpatialReference,i=t.renderSpatialReference,{extent:n}=e,s=(0,O.gX)(n),o=(0,S.vt)();return(0,k.F)([s[0],s[1],0],r,o,i),o}var N=r(97146);function G(e){const t=new Map;for(const[r,i]of e)t.set(r,{...i,indices:(0,N.Dg)(i.indices)});return t}var H=r(40804);r(48833);const $=(0,T.CN)(.25,.25,.75,.75);function Y(e){return"cross"===e||"x"===e}function Z(e,t=128,r=.5*t,i=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return K(e,J(r,r,t/2))}(t,r);case"square":return function(e,t){return X(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return W(e,t,!1,r)}(t,r,i);case"x":return function(e,t,r=0){return W(e,t,!0,r)}(t,r,i);case"kite":return function(e,t){return X(e,t,!0)}(t,r);case"triangle":return function(e,t){return K(e,Q(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,i=t/2,n=e/2,s=.8*r,o=J(n,(e-t)/2-s,Math.sqrt(s*s+i*i)),a=Q(n,r,i);return K(e,(e,t)=>Math.max(a(e,t),-o(e,t)))}(t,r)}}function X(e,t,r){return r&&(t/=Math.SQRT2),K(e,(i,n)=>{let s=i-.5*e+.25,o=.5*e-n-.75;if(r){const e=(s+o)/Math.SQRT2;o=(o-s)/Math.SQRT2,s=e}return Math.max(Math.abs(s),Math.abs(o))-.5*t})}function W(e,t,r,i=0){t-=i,r&&(t*=Math.SQRT2);const n=.5*t;return K(e,(t,s)=>{let o,a=t-.5*e,l=.5*e-s-1;if(r){const e=(a+l)/Math.SQRT2;l=(l-a)/Math.SQRT2,a=e}return a=Math.abs(a),l=Math.abs(l),o=a>l?a>n?Math.sqrt((a-n)*(a-n)+l*l):l:l>n?Math.sqrt(a*a+(l-n)*(l-n)):a,o-=i/2,o})}function J(e,t,r){return(i,n)=>{const s=i-e,o=n-t;return Math.sqrt(s*s+o*o)-r}}function Q(e,t,r){const i=Math.sqrt(t*t+r*r);return(n,s)=>{const o=Math.abs(n-e)-r,a=s-e+t/2+.75,l=(t*o+r*a)/i,c=-a;return Math.max(l,c)}}function K(e,t){const r=new Uint8Array(4*e*e);for(let i=0;i<e;i++)for(let n=0;n<e;n++){const s=n+e*i;let o=t(n,i);o=o/e+.5,(0,H.Un)(o,r,4*s)}return r}var ee=r(46610);class te{constructor(e,t){this._context=null,this._symbolLayer=null,this._draped=!1,this._loaded=!1,this._loadingPromise=null,this._iconTextureID=null,this._materialId=null,this._context=t,this._symbolLayer=e}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}_destroy(){this._iconTextureID=null}async _load(){const e=this._context.renderCommandContext,t=await e.createTexture(()=>function(e,t=128,r=.5*t,i=0){return{data:Z(e,t,r,i),parameters:{mipmap:!1,wrap:{s:33071,t:33071},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0}}}("circle"));this._iconTextureID=t;const r={anchorPosition:V.center,occlusionTest:!0,hasSlicePlane:!1,color:this._getFillColor(),outlineColor:this._getOutlineColor(),outlineSize:1,distanceFieldBoundingBox:$,textureId:t,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:Y("circle")};this._materialId=await e.createMaterial({type:"hud",parameters:r}),await e.createDirectRenderer(this._materialId),this._loaded=!0}async createAddCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:i}=r;if(null==t)throw new Error("expected material not to be null");const n=await this._createGeometry(e);if(null==n)return r.createPipelineCommand();const s=q(e,r);return r.createPipelineCommand(i.addDirectRendererGeometry(e.id,n,s))}async _createGeometry(e){const{_materialId:t,_context:r}=this,{mainThreadDelegate:i}=r,{featureCount:n}=e;if(0===n||null==t)return null;const s=L(e),o=U(e),a=function(e,t){const r=e.length/3,i=t.viewSpatialReference,n=t.renderSpatialReference,s=new Float64Array(3*r);if(!(0,z.projectBuffer)(e,i,0,s,n,0,r))throw new Error("Failed to project coordinates");return s}(await i.applyElevationAlignmentTo(o),r),l=new Float64Array([0,0,1]),c=new Float64Array([255,255,255,255]),u=new Float64Array([24,24]),d=new Float64Array([0,0,0,1]),h=new Float64Array([0,0]),f=new Float64Array([0]),p=new Uint32Array(n);for(let e=0;e<n;++e)p[e]=e;const m=new Uint32Array(n);for(let e=0;e<n;++e)m[e]=0;const y=[["position",new ee.n(a,p,3,!0)],["normal",new ee.n(l,m,3,!0)],["uv0",new ee.n(h,m,2,!0)],["color",new ee.n(c,m,4,!0)],["rotation",new ee.n(f,m,1,!0)],["size",new ee.n(u,m,2,!0)],["centerOffsetAndDistance",new ee.n(d,m,4,!0)]],g=new Uint8Array(n);return e.getVisibilityArray(g),{attributes:G(y),olidColor:void 0,transformation:(0,C.vt)(),materialId:t,objectIds:s,visibilities:g}}async createRemoveCommand(e){const{_materialId:t,_context:r}=this,i=r.renderCommandContext;return null==t?r.createPipelineCommand():r.createPipelineCommand(i.removeDirectRendererGeometryBuffer(t,e))}async createUpdateVisibilityCommand(e){const{_materialId:t,_context:r}=this,i=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const n=new Uint8Array(e.featureCount);return e.getVisibilityArray(n),r.createPipelineCommand(i.updateVisibility(t,e.id,n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_materialId:r}=this,i=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(i.updateMaterial({type:"hud",materialId:r,parameters:{color:this._getFillColor(),outlineColor:this._getOutlineColor()}}))}async createUpdateElevationCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:i}=r,{featureCount:n,id:s}=e;if(null==t||0===n)return r.createPipelineCommand();const o=await this._createGeometry(e);if(null==o)return r.createPipelineCommand();const a=q(e,r);return r.createPipelineCommand(i.updateDirectRendererGeometry(s,o,a))}async createDestroyCommand(){const{_iconTextureID:e,_context:t}=this,r=t.renderCommandContext;let i;return i=null!=e?await r.releaseTexture(e):g.create(r),i.appendPipelineStateCommand(()=>this._destroy()),i}_getOutlineColor(){const e=this._getLayerOpacity(),t=this._symbolLayer,r=t?.outline?.color;if(null!=r){const t=b.A.toUnitRGB(r),i=r.a*e;return[t[0],t[1],t[2],i]}return[0,0,0,0]}_getFillColor(){if(function(e){return null!=e&&("cross"===e||"x"===e)}(this._getPrimitive()))return ie;const e=null==this._getPrimitive(),t=this._symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}_getCombinedOpacity(e,t=re){const r=this._draped?1:this._getLayerOpacity();return e?r*e.a:t.hasIntrinsicColor?r:0}_getCombinedOpacityAndColor(e,t=re){const r=this._getCombinedOpacity(e,t);return function(e,t,r=null){const i=(0,T.o8)(T.Un);return null!=e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],e.length>3&&(i[3]=e[3])),null!=t&&(i[3]=t),r&&(0,B.c)(i,i,r),i}(null!=e?b.A.toUnitRGB(e):S.Un,r)}_getPrimitive(){return e=this._symbolLayer,e.resource?.href?null:e.resource?.primitive??A.r;var e}}const re={hasIntrinsicColor:!1},ie=T.uY;class ne{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._context=null,this._symbol=null,this._symbolLayerRenderers=[],this._context=t,this._symbol=e}_destroy(){}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_context:e,_symbol:t,_symbolLayerRenderers:r}=this,i=[];for(const n of t.symbolLayers){const t=e.symbolRendererFactory.createSymbolRendererFromSymbolLayer(n);null!=t&&(i.push(t.load()),r.push(t))}await Promise.all(i),this._loaded=!0}async createDestroyCommand(){const{_context:e,_symbolLayerRenderers:t}=this,r=[];for(const e of t)r.push(e.createDestroyCommand());const i=e.joinPipelineCommands(await Promise.all(r));return i.appendPipelineStateCommand(()=>this._destroy()),i}async createAddCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createAddCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createRemoveCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createRemoveCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateVisibilityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateVisibilityCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateLayerViewOpacityCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateElevationCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateElevationCommand(e));return t.joinPipelineCommands(await Promise.all(i))}}class se{constructor(e,t){this._symbol=null,this._featureData=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_renderer:e,_context:t}=this;this._symbol=t.symbolRendererFactory.createSymbolRendererFromSymbol(e.symbol),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=await this._provisionSymbol(),i=null==r?t.createPipelineCommand():await r.createAddCommand(e);return i.appendPipelineStateCommand(()=>this._featureData.set(e.id,e)),i}async createRemoveCommand(e){const t=this._context,r=await this._provisionSymbol(),i=null==r?t.createPipelineCommand():await r.createRemoveCommand(e);return i.appendPipelineStateCommand(()=>this._featureData.delete(e)),i}async createUpdateVisibilityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateVisibilityCommand(e)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateLayerViewOpacityCommand(e)}async createUpdateElevationCommand(){const{_featureData:e,_context:t}=this,r=await this._provisionSymbol();if(null==r)return t.createPipelineCommand();const i=[];for(const t of e.values())i.push(r.createUpdateElevationCommand(t));const n=await Promise.all(i);return t.joinPipelineCommands(n)}async createDestroyCommand(){const{_symbol:e,_context:t,_featureData:r}=this;if(!e)return t.createPipelineCommand();const i=[];for(const e of r.keys())i.push(this.createRemoveCommand(e));i.push(e.createDestroyCommand());const n=await Promise.all(i);return t.joinPipelineCommands(n)}async _provisionSymbol(){const e=this._symbol;return e?(e.loaded||await e.load(),e):null}}var oe=r(48353),ae=r(30809),le=r(8887),ce=r(38954),ue=r(72385),de=(r(4197),r(11868)),he=r(27921),fe=r(71351),pe=r(73941);function me(e,t){const r=e[t],i=e[t+1],n=e[t+2];return Math.sqrt(r*r+i*i+n*n)}function ye(e,t){const r=e[t],i=e[t+1],n=e[t+2],s=1/Math.sqrt(r*r+i*i+n*n);e[t]*=s,e[t+1]*=s,e[t+2]*=s}function ge(e,t,r){e[t]*=r,e[t+1]*=r,e[t+2]*=r}r(37539),r(20498),r(87170),(0,R.vt)(),(0,R.vt)();var be=r(620);const _e=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)_e[6*e+t]=e;const ve=new Array(36);for(let e=0;e<6;e++)ve[6*e]=0,ve[6*e+1]=1,ve[6*e+2]=2,ve[6*e+3]=2,ve[6*e+4]=3,ve[6*e+5]=0;const we=(0,ue.fA)(-.5,0,-.5),xe=(0,ue.fA)(.5,0,-.5),Ce=(0,ue.fA)(0,0,.5),Se=(0,ue.fA)(0,.5,0),Te=(0,ue.vt)(),Ae=(0,ue.vt)(),Ie=(0,ue.vt)(),Pe=(0,ue.vt)(),Be=(0,ue.vt)();(0,ce.d)(Te,we,Se),(0,ce.d)(Ae,we,xe),(0,ce.h)(Ie,Te,Ae),(0,ce.n)(Ie,Ie),(0,ce.d)(Te,xe,Se),(0,ce.d)(Ae,xe,Ce),(0,ce.h)(Pe,Te,Ae),(0,ce.n)(Pe,Pe),(0,ce.d)(Te,Ce,Se),(0,ce.d)(Ae,Ce,we),(0,ce.h)(Be,Te,Ae),(0,ce.n)(Be,Be),Ie[0],Ie[1],Ie[2],Pe[0],Pe[1],Pe[2],Be[0],Be[1],Be[2],(0,S.vt)();var Ee=r(4576),Oe=r(69397);r(6867),r(87582);var Me=r(57917);function Re(e,t){const r=(e,r,i=!1)=>({levels:e.map(e=>{const n=G(r(e.tesselation));return i&&function(e){const t=e,r=t.get("position").data,i=t.get("normal").data;if(i){const t=Fe(e,"normal").data;for(let e=0;e<i.length;e+=3){const r=i[e+1];t[e+1]=-i[e+2],t[e+2]=r}}if(r){const t=Fe(e,"position").data;for(let e=0;e<r.length;e+=3){const i=r[e+1];t[e+1]=-r[e+2],t[e+2]=i}}}(n),{components:[{attributes:n,olidColor:void 0,transformation:null,materialId:t,visibilities:new Uint8Array([1]),objectIds:new Uint32Array([-1])}],minScreenSpaceRadius:e.minScreenSpaceRadius}})});switch(e){case"cone":return r(De,e=>function(e,t,r,i,n=!0,s=!0){let o=0;const a=t,l=e;let c=(0,ue.fA)(0,o,0),u=(0,ue.fA)(0,o+l,0),d=(0,ue.fA)(0,-1,0),h=(0,ue.fA)(0,1,0);i&&(o=l,u=(0,ue.fA)(0,0,0),c=(0,ue.fA)(0,o,0),d=(0,ue.fA)(0,1,0),h=(0,ue.fA)(0,-1,0));const f=[u,c],p=[d,h],m=r+2,y=Math.sqrt(l*l+a*a);if(i)for(let e=r-1;e>=0;e--){const t=e*(2*Math.PI/r),i=(0,ue.fA)(Math.cos(t)*a,o,Math.sin(t)*a);f.push(i);const n=(0,ue.fA)(l*Math.cos(t)/y,-a/y,l*Math.sin(t)/y);p.push(n)}else for(let e=0;e<r;e++){const t=e*(2*Math.PI/r),i=(0,ue.fA)(Math.cos(t)*a,o,Math.sin(t)*a);f.push(i);const n=(0,ue.fA)(l*Math.cos(t)/y,a/y,l*Math.sin(t)/y);p.push(n)}const g=new Array,b=new Array;if(n){for(let e=3;e<f.length;e++)g.push(1),g.push(e-1),g.push(e),b.push(0),b.push(0),b.push(0);g.push(f.length-1),g.push(2),g.push(1),b.push(0),b.push(0),b.push(0)}if(s){for(let e=3;e<f.length;e++)g.push(e),g.push(e-1),g.push(0),b.push(e),b.push(e-1),b.push(1);g.push(0),g.push(2),g.push(f.length-1),b.push(1),b.push(2),b.push(p.length-1)}const _=(0,de.oe)(3*m);for(let e=0;e<m;e++)_[3*e]=f[e][0],_[3*e+1]=f[e][1],_[3*e+2]=f[e][2];const v=(0,de.oe)(3*m);for(let e=0;e<m;e++)v[3*e]=p[e][0],v[3*e+1]=p[e][1],v[3*e+2]=p[e][2];return[["position",new ee.n(_,g,3,!0)],["normal",new ee.n(v,b,3,!0)]]}(1,.5,e,!1),!0);case"sphere":return r([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],e=>function(e,t,r){const i=e;let n,s;if(r)n=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],s=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const e=i*(1+Math.sqrt(5))/2;n=[-i,e,0,i,e,0,-i,-e,0,i,-e,0,0,-i,e,0,i,e,0,-i,-e,0,i,-e,e,0,-i,e,0,i,-e,0,-i,-e,0,i],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let t=0;t<n.length;t+=3)ge(n,t,e/me(n,t));let o={};function a(t,r){t>r&&([t,r]=[r,t]);const i=t.toString()+"."+r.toString();if(o[i])return o[i];let s=n.length;return n.length+=3,function(e,t,r,i,n,s=t){(n=n||e)[s]=e[t]+r[i],n[s+1]=e[t+1]+r[i+1],n[s+2]=e[t+2]+r[i+2]}(n,3*t,n,3*r,n,s),ge(n,s,e/me(n,s)),s/=3,o[i]=s,s}for(let e=0;e<t;e++){const e=s.length,t=new Array(4*e);for(let r=0;r<e;r+=3){const e=s[r],i=s[r+1],n=s[r+2],o=a(e,i),l=a(i,n),c=a(n,e),u=4*r;t[u]=e,t[u+1]=o,t[u+2]=c,t[u+3]=i,t[u+4]=l,t[u+5]=o,t[u+6]=n,t[u+7]=c,t[u+8]=l,t[u+9]=o,t[u+10]=l,t[u+11]=c}s=t,o={}}const l=(0,de.Wz)(n);for(let e=0;e<l.length;e+=3)ye(l,e);return[["position",new ee.n((0,de.Wz)(n),s,3,!0)],["normal",new ee.n(l,s,3,!0)]]}(.5,e,!0));case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function Fe(e,t){let r=e.get(t);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:(0,Me.S)(r.data)},e.set(t,r)),r}const De=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];var je=r(2495),Ve=r(74810);class ze{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._primitiveMaterialId=null,this._lodRendererId=null,this._context=null,this._symbolLayer=null,this._primitive=null,this._context=t,this._symbolLayer=e}_destroy(){this._lodRendererId=null,this._primitiveMaterialId=null}get loaded(){return this._loaded}get _isPrimitive(){return null!=this._primitive}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const e=this._context.renderCommandContext,t=this._getLayerOpacity();let r={usePBR:!0,isSchematic:!0,mrrFactors:Ve.Bt,ambient:S.Un,diffuse:S.Un,hasSlicePlane:!1,castShadows:!0,layerOpacity:t,offsetTransparentBackfaces:!1,screenSizePerspective:{}};if(r.externalColor=T.Un,r.instanced=!0,this._isPrimitive){const e=new je.fs;e.layerOpacity=t,r={...r,cullFace:ke((0,je.ty)(e))}}const i=await e.createMaterial({type:"default",parameters:r}),n=this._symbolLayer.resource;this._primitive=n&&function(e){switch(e){case"sphere":case"cube":case"diamond":case"cylinder":case"cone":case"inverted-cone":case"tetrahedron":return!0}return!1}(n?.primitive)?n.primitive:ae.r;const s=Re(this._primitive,i);this._lodRendererId=await e.createLodRenderer(s),this._primitiveMaterialId=i,this._loaded=!0}async createDestroyCommand(){const{_lodRendererId:e,_primitiveMaterialId:t,_context:r}=this,i=r.renderCommandContext,n=[];return null!=e&&n.push(i.destroyLodRenderer(e)),null!=t&&n.push(i.destroyMaterial(t)),new g(i,i.mergeRenderCommandBuffers(n),[()=>this._destroy()])}async createAddCommand(e){const t=this._context,{renderCommandContext:r,mainThreadDelegate:i}=t;if(null==this._lodRendererId)throw new Error("expected lod renderer id to not be null");const{featureCount:n}=e;if(0===n)return t.createPipelineCommand();const s=this._isPrimitive,o=this._primitive||ae.r,a=(0,E.vt)((0,le.Fq)(o)),l=(0,S.ci)((0,E.Ej)(a)),c=(0,S.ci)((0,le.Bb)(l,{isPrimitive:s,width:100,depth:null,height:null})),u=new Float64Array(16*n),d=new Float64Array(16*n),h=U(e),f=await i.applyElevationAlignmentTo(h);for(let e=0;e<n;++e){const t=e,r=f[3*e+0],i=f[3*e+1],n=f[3*e+2],s=this._computeGlobalTransform(r,i,n,this._context.viewSpatialReference,qe),o=this._computeLocalTransform(c,l,Ue);this._writeMatrixToTypedBuffer(u,t,o),this._writeMatrixToTypedBuffer(d,t,s)}const p=L(e),m=new Uint8Array(n);e.getVisibilityArray(m);const y={featureIds:new Uint32Array(p),visibility:m,localTransforms:u,globalTransforms:d};return t.createPipelineCommand(r.addLodInstances(this._lodRendererId,e.id,y))}async createRemoveCommand(e){const{_context:t,_lodRendererId:r}=this,i=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(i.removeLodInstances(r,e))}async createUpdateVisibilityCommand(e){const{_lodRendererId:t,_context:r}=this,i=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const n=new Uint8Array(e.featureCount);return e.getVisibilityArray(n),r.createPipelineCommand(i.updateVisibility(t,e.id,n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t}=this,r=t.renderCommandContext,i=this._primitiveMaterialId;if(null==i)return t.createPipelineCommand();const n=this._getLayerOpacity();let s={layerOpacity:n};if(this._isPrimitive){const e=new je.fs;e.layerOpacity=n,s={...s,cullFace:ke((0,je.ty)(e))}}return t.createPipelineCommand(r.updateMaterial({type:"default",materialId:i,parameters:s}))}async createUpdateElevationCommand(e){const{_context:t,_lodRendererId:r}=this,{renderCommandContext:i,mainThreadDelegate:n}=t,{featureCount:s,id:o}=e;if(null==r||0===s)return t.createPipelineCommand();const a=new Float64Array(16*s),l=U(e),c=await n.applyElevationAlignmentTo(l);for(let e=0;e<s;++e){const t=e,r=c[3*e+0],i=c[3*e+1],n=c[3*e+2],s=this._computeGlobalTransform(r,i,n,this._context.viewSpatialReference,qe);this._writeMatrixToTypedBuffer(a,t,s)}return t.createPipelineCommand(i.updateLodInstancesData(r,o,a))}_writeMatrixToTypedBuffer(e,t,r){let i=16*t;for(let t=0;t<16;t++)e[i++]=r[t]}_computeGlobalTransform(e,t,r,i,n){return Le[0]=e,Le[1]=t,Le[2]=r,(0,oe.l)(i,Le,n,this._context.renderSpatialReference),n}_computeLocalTransform(e,t,r){return(0,P.D_)(r),this._applyObjectScale(e,t,r),r}_applyObjectScale(e,t,r){const i=function(e=S.Un,t,r,i=1){const n=new Array(3);if(null==t||null==r)n[0]=1,n[1]=1,n[2]=1;else{let i,s=0;for(let o=2;o>=0;o--){const a=e[o],l=null!=a,c=0===o&&!i&&!l,u=r[o];let d;"symbol-value"===a||c?d=0!==u?t[o]/u:1:l&&"proportional"!==a&&isFinite(a)&&(d=0!==u?a/u:1),null!=d&&(n[o]=d,i=d,s=Math.max(s,Math.abs(d)))}for(let e=2;e>=0;e--)null==n[e]?n[e]=i:0===n[e]&&(n[e]=.001*s)}for(let e=2;e>=0;e--)n[e]/=i;return(0,S.ci)(n)}(e,e,t,this._context.renderCoordsHelper.unitInMeters);1===i[0]&&1===i[1]&&1===i[2]||(0,P.hs)(r,r,i)}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}}function ke(e){return e?0:2}const Le=(0,S.vt)(),Ue=(0,C.vt)(),qe=(0,C.vt)();class Ne{constructor(e,t){this._symbols=new Array,this._featureDataPartitioning=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){this._symbols[0]=new te(x(),this._context),this._symbols[1]=new ze(new v.A,this._context),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=this._partition(e),i=await Promise.all(r.map(async({index:e,features:t})=>{const r=await this._provisionSymbol(e);return await(r?.createAddCommand(t))})),n=t.joinPipelineCommands(i);return n.appendPipelineStateCommand(()=>this._featureDataPartitioning.set(e.id,r)),n}async createRemoveCommand(e){const{_featureDataPartitioning:t,_context:r}=this,i=r.renderCommandContext,n=t.get(e);if(null==n)return new g(i,i.createRenderCommandBuffer(),[]);const s=await Promise.all(n.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createRemoveCommand(t.id))})),o=r.joinPipelineCommands(s);return o.appendPipelineStateCommand(()=>t.delete(e)),o}async createUpdateVisibilityCommand(e){const{_featureDataPartitioning:t,_context:r}=this,i=r.renderCommandContext,n=t.get(e.id);if(null==n)return new g(i,i.createRenderCommandBuffer(),[]);const s=await Promise.all(n.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateVisibilityCommand(t))}));return r.joinPipelineCommands(s)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=[];for(let t=0;t<this._symbols.length;++t){const i=this._symbols[t];null!=i&&i.loaded&&r.push(i.createUpdateLayerViewOpacityCommand(e))}const i=await Promise.all(r);return t.joinPipelineCommands(i)}async createUpdateElevationCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.values()){const e=t.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateElevationCommand(t))});r.push(...e)}const i=await Promise.all(r);return t.joinPipelineCommands(i)}async createDestroyCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.keys())r.push(this.createRemoveCommand(t));for(const e of this._symbols)r.push(e.createDestroyCommand());const i=await Promise.all(r);return t.joinPipelineCommands(i)}async _provisionSymbol(e){if(null==e)return null;const t=this._symbols[e];return t?(t.loaded||await t.load(),t):null}_getLoadedSymbol(e){if(null==e)return null;const t=this._symbols[e];return null!=t&&t.loaded?t:null}_partition(e){const t=L(e);if(null==t)throw new Error("unable to fetch objectIds");const{featureCount:r}=e,i=[[],[]];for(let e=0;e<r;++e)i[t[e]%2].push(e);return i.map((t,r)=>new Ge(r,e.subset(new Uint32Array(t)))).filter(e=>e.features.featureCount>0)}}class Ge{constructor(e,t){this.index=e,this.features=t}}class He{constructor(e,t,r,i,n,s,o){this.viewSpatialReference=e,this.renderSpatialReference=t,this.mainThreadDelegate=r,this.renderCoordsHelper=i,this.renderCommandContext=n,this.layerInfo=s,this.layerViewInfo=o,this.symbolRendererFactory=new $e(this)}createPipelineCommand(e=this.renderCommandContext.createRenderCommandBuffer(),t=[]){return new g(this.renderCommandContext,e,t)}joinPipelineCommands(e){return 0===e.length?this.createPipelineCommand():e.filter(e=>null!=e).reduce((e,t)=>(e.append(t),e))}}class $e{constructor(e){this.context=e}createSymbolRendererFromJSON(e){const t=(0,y.L)(e??Ye)??void 0;if(!t)throw new Error("Failed to create renderer");const r=t.type;switch(r){case"simple":return new se(t,this.context);case"unique-value":return new Ne(t,this.context);default:return console.warn(`Unable to create symbolrenderer for renderer of ${r}`),this.createSymbolRendererFromJSON(Ye)}}createSymbolRendererFromSymbol(e){const t=e?.type;switch(t){case"point-3d":return new ne(e,this.context);case"picture-marker":case"simple-marker":return new te(x(),this.context);default:return console.warn(`Unable to create symbolrenderer for symbol of ${t}`),null}}createSymbolRendererFromSymbolLayer(e){const t=e.type;return"icon"===t?new te(e,this.context):(console.warn(`Unable to create symbolrenderer for symbolLayer of ${t}`),null)}}const Ye={type:"simple"};var Ze=r(65008),Xe=r(60999),We=r(32587),Je=r(96211),Qe=r(24326);function Ke(e=""){return`${e}${(0,Qe.c)()}`}new Float64Array(3);class et{constructor(e,t){this._parent=e,this._subsetIndices=t,this.id=Ke(`featureDataSubset-${e.id}-`)}get tileId(){return this._parent.tileId}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+Oe.qK+this._subsetIndices.byteLength}get isFullyEnabled(){for(const e of this._subsetIndices)if(!this._parent.getEnabled(e))return!1;return!0}getObjectId(e){return this._parent.getObjectId(this._subsetIndices[e])}getAttribute(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributeAsTimestamp(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributes(e){return this._parent.getAttributes(this._subsetIndices[e])}getCoordinates(e,t,r){return this._parent.getCoordinates(this._subsetIndices[e],t,r)}getOptimizedGeometry(e){return this._parent.getOptimizedGeometry(this._subsetIndices[e])}getCentroid(e,t){return this._parent.getCentroid(this._subsetIndices[e],t)}getBounds(e){return this._parent.getBounds(this._subsetIndices[e])}getBoundingBox(e){return this._parent.getBoundingBox(this._subsetIndices[e])}getObjectIdsArray(e,t,r){return this._parent.getObjectIdsArray(e,this._translatedIndices(t),r)}getCoordinatesArray(e,t,r){return this._parent.getCoordinatesArray(e,this._translatedIndices(t),r)}objectIds(e){return this._parent.objectIds(this._translatedIndices(e))}subset(e){const{_subsetIndices:t}=this,r=new Uint32Array(e.length);for(let i=0;i<r.length;++i)r[i]=t[e[i]];return new et(this._parent,r)}disableObjectIds(e){if(0===e.size)return;const{featureCount:t}=this,r=new Array;for(let i=0;i<t;++i)this.getEnabled(i)&&e.has(this.getObjectId(i))&&r.push(i);if(0!==r.length)for(const e of r)this.setEnabled(e,!1)}setEnabled(e,t){this._parent.setEnabled(this._subsetIndices[e],t)}getEnabled(e){return this._parent.getEnabled(this._subsetIndices[e])}enableAll(){const{_subsetIndices:e,_parent:t}=this;for(const r of e)t.setEnabled(r,!0)}getVisibilityArray(e,t,r){return this._parent.getVisibilityArray(e,this._translatedIndices(t),r)}enabledObjectIds(e){return this._parent.enabledObjectIds(this._translatedIndices(e))}*_translatedIndices(e){const{_subsetIndices:t}=this;if(null!=e)for(const r of e)yield t[r];else yield*t}}class tt{constructor(e){this._tile=e,this.id=Ke(`featureData-${e.id}-`),this._enabled=new Array(e.featureCount).fill(!0)}get tileId(){return this._tile.id}get featureCount(){return this._tile.featureCount}get usedMemory(){return Oe.qK+(0,Oe.$B)(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every(e=>e)}getObjectId(e){return this._tile.getObjectId(e)}getAttribute(e,t){return this._tile.getAttribute(e,t)}getAttributeAsTimestamp(e,t){return this._tile.getAttribute(e,t)}getAttributes(e){return this._tile.getAttributes(e)}getCoordinates(e,t,r){return this._tile.getCoordinates(e,t,r)}getOptimizedGeometry(e){return this._tile.getOptimizedGeometry(e)}getCentroid(e,t){return this._tile.getCentroid(e,t)}getBounds(e){return this._tile.getBounds(e)}getBoundingBox(e){return this._tile.getBoundingBox(e)}getObjectIdsArray(e,t,r){return this._tile.getObjectIdsArray(e,t,r)}getCoordinatesArray(e,t,r){return this._tile.getCoordinatesArray(e,t,r)}objectIds(e){return this._tile.objectIds(e)}subset(e){return new et(this,e)}disableObjectIds(e){if(0===e.size)return;const{_enabled:t}=this,r=new Array;for(const i of this._allFeatureIndices())t[i]&&e.has(this.getObjectId(i))&&r.push(i);if(0!==r.length)for(const e of r)t[e]=!1}setEnabled(e,t){this._enabled[e]=t}getEnabled(e){return this._enabled[e]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(e,t=this._allFeatureIndices(),r=0){const{_enabled:i}=this;for(const n of t)e[r++]=Number(i[n]);return r}*enabledObjectIds(e=this._allFeatureIndices()){const{_enabled:t}=this;for(const r of e)t[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}}let rt=class extends Ze.A{constructor(e){super(e),this.extent=null,this._tileHandles=new We.A,this._wanted=new We.A,this._updateRequested=!1,this._synchronizationTask=null,this._requestedTiles=new Array}destroy(){this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updateRequested||!(this._synchronizationTask?.finished??1)}get _boundingRect(){const{extent:e}=this;return null==e?null:(0,O.VY)(e)}get _missingTiles(){const e=new Array,t=this._wanted,r=this._tileHandles;for(const i of t.values())null==r.get(i.id)?.featureData&&e.push(i);return e}onTileTreeChange({tiles:e}){this._requestedTiles=e,this._scheduleTilesSync()}_scheduleTilesSync(){if(this._updateRequested)return;this._updateRequested=!0;const e=this._synchronizationTask,t=(0,Xe.UT)(async()=>{try{await(0,o.C_)(()=>e?.finished??!0),await(0,Je.NO)(),this._updateRequested=!1,await this._synchronizeTiles()}finally{this._synchronizationTask===t&&(this._synchronizationTask=null)}});this._synchronizationTask=t}async _synchronizeTiles(){const e=this._requestedTiles,t=this._tileHandles,r=new Array;for(const i of e)t.has(i.id)||r.push(i);const i=new Array;for(const r of t.values()){const{id:t}=r;e.every(e=>e.id!==t)&&i.push(r.descriptor)}const n=this._tileHandles,{_boundingRect:s}=this,o=null!=s?r.filter(e=>!e.extent||(0,O.HY)(s,e.extent)):r,a=this._wanted,l=new Array;for(const{id:e}of i)a.delete(e);for(const e of o)a.set(e.id,e);const c=this._missingTiles;for(const e of i){const{id:t}=e;if(c.some(t=>it(t,e)||it(e,t)))continue;const r=n.get(t);null!=r&&l.push(this._removeTile(r))}for(const e of o)l.push(this._addTile(e));const u=await Promise.allSettled(l);for(const e of u)"rejected"===e.status&&console.error(e.reason)}forEachTile(e){for(const t of this._tileHandles.values()){const r=t.featureData;null!=r&&e(r)}}*loadedTiles(){for(const e of this._tileHandles.values()){const t=e.featureData;null!=t&&(yield t)}}async _removeTile(e){e.loadTask.abort(),this._tileHandles.delete(e.id),this._validate();const{featureData:t}=e;if(null!=t){const e={stack:[],error:void 0,hasError:!1};try{(0,i.mS)(e,await this.tileLocks.lock([t.tileId]),!1);const r=await this.createRemoveCommand(t.id);await(r?.execute())}catch(t){e.error=t,e.hasError=!0}finally{(0,i.hk)(e)}}}async _addTile(e){const{_tileHandles:t}=this,r=t.get(e.id);if(null!=r){if(!st(r)||r.featureData.isFullyEnabled)return;return r.featureData.enableAll(),void await this._onTileLoad(r)}const i=new nt(e,(0,Xe.UT)(async t=>{const r=await this.loadTile(e,t);return(0,s.Te)(t),new tt(r)}));this._tileHandles.set(i.id,i);try{await i.loadTask.promise}catch(e){return void(0,s.jH)(e)}(function(e){if(!st(e))throw new Error})(i),await this._onTileLoad(i)}async _onTileLoad(e){const t={stack:[],error:void 0,hasError:!1};try{const{_wanted:r,_tileHandles:n,_missingTiles:s}=this,o=e.descriptor,a=new Array,l=new Array,c=new Array,u=new Set;for(const t of n.values()){if(t===e)continue;const{descriptor:i,id:c}=t;if(!r.has(c)&&!s.some(e=>it(e,i)||it(i,e))){n.delete(c),t.loadTask.abort();const{featureData:e}=t;null!=e&&a.push(e);continue}if(st(t)){if(it(o,i)){const e=t.featureData;for(const t of e.objectIds())u.add(t)}if(it(i,o)){const{featureData:e}=t;l.push(e)}}}u.size>0&&(e.featureData.disableObjectIds(u),this._validateRemoval(e.featureData,u)),this._validate(),c.push(e.featureData);const d=[...c,...a,...l].map(e=>e.tileId);if((0,i.mS)(t,await this.tileLocks.lock(d),!1),0!==l.length){const t=e.featureData,r=new Set(t.objectIds());for(const e of l)e.disableObjectIds(r),this._validateRemoval(e,r)}const h=a.map(e=>this.createRemoveCommand(e.id)),f=c.map(e=>this.createAddCommand(e)),p=l.map(e=>this.createUpdateCommand(e)),m=function(e){return 0===e.length?null:e.reduce((e,t)=>(e.append(t),e))}((await Promise.all([...h,...f,...p])).filter(Ee.Ru));await(m?.execute())}catch(e){t.error=e,t.hasError=!0}finally{(0,i.hk)(t)}}_validate(){if(!(0,l.A)("feature-pipeline-3d-test-validation"))return;const e=new Array;for(const t of this._tileHandles.values()){if(!st(t))continue;const{featureData:r}=t;e.push({featureData:r,objectIds:new Set(r.enabledObjectIds())})}for(let t=0;t<e.length;++t){const{featureData:r,objectIds:i}=e[t];for(let n=t+1;n<e.length;++n){const{featureData:t,objectIds:s}=e[n];for(const e of s)if(i.has(e))throw new Error(`${r.id} and ${t.id} both contain ${e}.`)}}}_validateRemoval(e,t){if((0,l.A)("feature-pipeline-3d-test-validation"))for(const r of e.enabledObjectIds())if(t.has(r))throw new Error(`Failed to remove ${r} from ${e.id}!`)}};function it({lij:[e,t,r]},{lij:[i,n,s]}){const o=i-e;return o>=0&&t===n>>o&&r===s>>o}(0,i.Cg)([(0,a.MZ)()],rt.prototype,"updating",null),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"loadTile",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"createAddCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"createRemoveCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"createUpdateCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"tileLocks",void 0),(0,i.Cg)([(0,a.MZ)()],rt.prototype,"extent",void 0),(0,i.Cg)([(0,a.MZ)()],rt.prototype,"_boundingRect",null),(0,i.Cg)([(0,a.MZ)()],rt.prototype,"_missingTiles",null),(0,i.Cg)([(0,a.MZ)()],rt.prototype,"_updateRequested",void 0),(0,i.Cg)([(0,a.MZ)()],rt.prototype,"_synchronizationTask",void 0),rt=(0,i.Cg)([(0,u.$)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],rt);class nt{constructor(e,t){this.descriptor=e,this.loadTask=t}get id(){return this.descriptor.id}get featureData(){return this.loadTask.value}}function st(e){return null!=e.featureData}var ot=r(36563);class at{constructor(){this._previousActions=new Map}async lock(e){const{_previousActions:t}=this,r=e.map(e=>t.get(e)).filter(Ee.Ru),i=Promise.allSettled(r),n=(0,s.Tw)(),o=(0,ot.hA)(()=>n.resolve()),a=n.promise.finally(()=>{for(const r of e)t.get(r)===a&&t.delete(r)});for(const r of e)t.set(r,a);return await i,(0,ot.Bf)(o)}}var lt=r(75503),ct=r(27647),ut=r(92722);class dt{constructor(e,t){this._index=e,this._view=t}get usedMemory(){return Oe.qK+Oe.RS}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new ht(this._index,this._view,e)}}class ht extends dt{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,ct.Q)(new ut.A,this._geometryOverride,e.hasZ,e.hasM)}}class ft{constructor(e,t){this.featureData=e,this.bounds=t}}class pt{constructor(){this._tileBounds=new Map,this.events=new n.bk,this.featureAdapter=mt.shared}get usedMemory(){return Oe.qK+Oe.qK*this._tileBounds.size}addTile(e){const{featureCount:t}=e;if(0===t)return;const r=new lt.wq(9,t=>e.getBounds(t)),i=new Array;for(let e=0;e<t;++e)i[e]=e;r.load(i),this._tileBounds.set(e.id,new ft(e,r)),this.events.emit("changed")}removeTile(e){this._tileBounds.delete(e),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(e){for(const{featureData:t,bounds:r}of this._tileBounds.values())r.all(r=>{t.getEnabled(r)&&e(new dt(r,t))})}forEachInBounds(e,t){yt.minX=e[0],yt.minY=e[1],yt.maxX=e[2],yt.maxY=e[3];for(const{featureData:e,bounds:r}of this._tileBounds.values())r.search(yt,r=>{e.getEnabled(r)&&t(new dt(r,e))})}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(const{bounds:e}of this._tileBounds.values()){const{minX:s,minY:o,maxX:a,maxY:l}=e.toJSON();t=Math.min(t,s),r=Math.min(r,o),i=Math.min(i,a),n=Math.min(n,l)}return{xmin:t,ymin:r,xmax:i,ymax:n,spatialReference:e}}}class mt{static{this.shared=new mt}getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}}const yt=new lt.EC;var gt=r(80893);class bt{constructor(e,t,r){this.descriptor=e,this._pages=t,this._pageSize=r;const i=Oe.ez+t.reduce((e,{usedMemory:t})=>e+t,0),n=3*Oe.RS;this.usedMemory=Oe.qK+i+n,this.featureCount=t.reduce((e,t)=>e+t.featureCount,0)}get id(){return this.descriptor.id}getObjectId(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getObjectId(r)}getAttribute(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getAttribute(i,t)}getAttributeAsTimestamp(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getAttributeAsTimestamp(i,t)}getAttributes(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getAttributes(r)}getCoordinates(e,t,r){const{pageIndex:i,featurePageIndex:n}=this._translateIndex(e);this._pages[i].getCoordinates(n,t,r)}getOptimizedGeometry(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getOptimizedGeometry(r)}getCentroid(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getCentroid(i,t)}getBounds(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBounds(r)}getBoundingBox(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBoundingBox(r)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){let i=r;for(const{page:r,indices:n}of this._batchPageIndices(t))i=r.getObjectIdsArray(e,n,i);return i}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){let i=r;for(const{page:r,indices:n}of this._batchPageIndices(t))i=r.getCoordinatesArray(e,n,i);return i}*objectIds(e=this._allFeatureIndices()){for(const{page:t,indices:r}of this._batchPageIndices(e))for(const e of t.objectIds(r))yield e}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_translateIndex(e){const{_pageSize:t}=this;return{pageIndex:Math.floor(e/t),featurePageIndex:e%t}}*_batchPageIndices(e){const t=new Array;{let r=0,i=new Array;for(const n of e){const{pageIndex:e,featurePageIndex:s}=this._translateIndex(n);r!==e&&(0!==i.length&&t.push({pageIndex:r,indices:i}),r=e,i=[]),i.push(s)}0!==i.length&&t.push({pageIndex:r,indices:i})}const{_pages:r}=this;for(const{pageIndex:e,indices:i}of t)yield{page:r[e],indices:i}}}var _t=r(49186),vt=r(51624),wt=r(62577),xt=r(95466),Ct=r(53655);class St{constructor(e){this._reader=new vt.A(new Uint8Array(e),new DataView(e)),this._index=function(e){for(;e.next();){if(2===e.tag())return Tt(e.getMessage());e.skip()}It()}(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:i}}=this,n=r.get(t)?.index;if(null==n)return;const s=i[e*r.fields.length+n],o=this._reader;return o.move(s),Pt(o)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,i=e*t.fields.length,n=this._reader,s={};for(const e of t.fields){const t=r[i+e.index];n.move(t),s[e.name]=Pt(n)}return s}getCoordinates(e,t,r=0){const i=this._reader,{transform:n,featureIndices:s}=this._index,{scale:o,translate:a}=n;i.move(s[e]),this._readCoordinates(o,a,t,r)}getOptimizedGeometry(e){const t=(0,S.vt)();return this.getCoordinates(e,t),new ut.A([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,Bt);const[i,n,s]=Bt,o=[i,n];return t&&(o[3]=s),r&&(o[t?4:3]=0),new ut.A([],o)}getBounds(e){this.getCoordinates(e,Bt);const[t,r]=Bt,i=new lt.EC;return i.minX=t,i.minY=r,i.maxX=t,i.maxY=r,i}getBoundingBox(e){this.getCoordinates(e,Bt);const[t,r,i]=Bt;return(0,E.fA)(t,r,i,t,r,i)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const i=this._reader,{objectIdFieldName:n,attributeIndices:s,fieldsIndex:o}=this._index,a=o.get(n).index,l=o.fields.length;for(const n of t){const t=s[n*l+a];i.move(t),e[r++]=Pt(i)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const i=this._reader,{transform:n,featureIndices:s}=this._index,{scale:o,translate:a}=n;for(const n of t){const t=s[n];i.move(t),r=this._readCoordinates(o,a,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:i,fieldsIndex:n}=this._index,s=n.get(r).index,o=n.fields.length;for(const r of e){const e=i[r*o+s];t.move(e),yield Pt(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[i,n,s],o,a){const l=this._reader,c=l.getLength(),u=l.pos()+c;for(;l.pos()<u&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),u=l.pos()+c;for(;l.pos()<u&&l.next();)3===l.tag()?(l.getUInt32(),o[a++]=i+e*l.getSInt64(),o[a++]=n+t*l.getSInt64(),o[a++]=s+r*l.getSInt64()):l.skip();break}default:l.skip()}return a}}function Tt(e){for(;e.next();){if(1===e.tag())return At(e.getMessage());e.skip()}It()}function At(e){let t,r,i=!1,n=!1,s=0;const o=new Array,a=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&It();break;case 9:i=e.getBool()??!1;break;case 12:t=(0,wt.Q1)(e.processMessage(Ct.ae));break;case 13:{const t=e.processMessage(Ct.cn);t.index=s++,o.push(t);break}case 15:{a.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:n=e.getBool()??!1;break;default:e.skip()}const c=new xt.A(o);return null!=t&&n&&null!=r&&c.has(r)||It(),{transform:t,exceededTransferLimit:i,fieldsIndex:c,objectIdFieldName:r,featureIndices:a,attributeIndices:l}}function It(){const e=new _t.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function Pt(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}const Bt=(0,S.vt)();class Et{constructor(e,t,r,i,n){this.spatialReference=e,this.url=r,this.objectIdField=i,this.capabilities=n;const{supportsMaxRecordCountFactor:s,maxRecordCount:o}=this.capabilities.query,a=s?4:1,l=(o??8e3)*a;this._pageSize=Math.min(8e3,l);const c=t.clone();c.cacheHint=!0,c.resultType="tile",c.outSpatialReference=e,c.returnGeometry=!0,c.returnZ=!0,c.maxRecordCountFactor=a,c.num=this._pageSize,c.outFields=[i],this._baseQuery=c}async fetch(e,t){const{spatialReference:r,_pageSize:i}=this,n=(0,O.w1)(e.extent,r),o=this._baseQuery.clone();o.geometry=n;const a=new Array;let l=0,c=!1,u=1;for(;!c;){const e=[];for(let r=0;r<u;++r)e.push(this._fetchPage(o,l++,t));const r=await Promise.all(e);(0,s.Te)(t);for(const e of r){const t=0!==e.featureCount;c||=!e.exceededTransferLimit||!t,t&&a.push(e)}u=Math.min(u+1,4)}return new bt(e,a,i)}async _fetchPage(e,t,r){const i=e.clone();i.start=t*this._pageSize;const n=(await(0,gt.kS)(this.url,i,{signal:r})).data;return(0,s.Te)(r),new St(n)}}var Ot=r(29920),Mt=r(77690),Rt=r(29242);var Ft=r(13030),Dt=r(78662),jt=r(49255),Vt=r(40268),zt=r(16943),kt=r(25634),Lt=r(11725),Ut=r(77194),qt=r(59907),Nt=r(43616),Gt=r(13259),Ht=r(1843),$t=r(97220),Yt=r(98958),Zt=r(33524),Xt=r(63907),Wt=r(90644);class Jt extends Yt.w{constructor(e,t){super(e,t,new $t.$(Gt.H,()=>r.e(8241).then(r.bind(r,48241))),((0,zt.E)()?er:Kt).locations),this.primitiveType=t.occlusionPass?Xt.WR.POINTS:Xt.WR.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:i,output:n,depthTestEnabled:s,occlusionPass:o}=e,a=0===t,l=s&&!i&&!(1===t)&&!o&&!(9===n);return(0,Wt.Ey)({blending:(0,jt.RN)(n)?a?Wt.RC:(0,Zt.ez)(t):null,depthTest:s&&!i?{func:515}:null,depthWrite:l?Wt.Uy:null,drawBuffers:(0,Zt.m6)(t,n),colorWrite:Wt.kn,polygonOffset:r?Qt:null})}}const Qt={factor:0,units:-4},Kt=(0,Ht.BP)().vec3f("position").vec3f("normal").vec2i16("uvi").vec4u8("color").vec2f("size").f32("rotation").vec4f("centerOffsetAndDistance").vec4f("featureAttribute"),er=Kt.clone().vec4u8("olidColor");var tr=r(51976),rr=r(35256);class ir extends rr.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!0,this.isFocused=!0,this.olidColorInstanced=!1,this.textureCoordinateType=0,this.emissionSource=0,this.discardInvisibleFragments=!0,this.hasVVInstancing=!1,this.snowCover=!1}}(0,i.Cg)([(0,tr.W)()],ir.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"occlusionTestEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"signedDistanceFieldEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasVVSize",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasVVColor",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasVerticalOffset",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasScreenSizePerspective",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasRotation",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"debugDrawLabelBorder",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasPolygonOffset",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"depthTestEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"pixelSnappingEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"draped",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"terrainDepthTest",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"cullAboveTerrain",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"occlusionPass",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"occludedFragmentFade",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"horizonCullingEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"isFocused",void 0);var nr=r(49788);class sr extends Lt.i{constructor(e,t){super(e,Br),this.produces=new Map([[13,e=>(0,jt.Mb)(e)&&!this.parameters.drawAsLabel],[14,e=>(0,jt.Mb)(e)&&this.parameters.drawAsLabel],[12,()=>this.parameters.occlusionTest],[18,e=>this.parameters.draped&&(0,jt.Mb)(e)]]),this._visible=!0,this._configuration=new ir(t)}getConfiguration(e,t){const r=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=r,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.hasVVSize=!!this.parameters.vvSize,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.occlusionPass=12===t.slot,this._configuration.occludedFragmentFade=!r&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||12===t.slot,(0,jt.RN)(e)&&(this._configuration.debugDrawLabelBorder=!!D.b.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,r,i,n,s){const{options:{selectionMode:o,hud:a,excludeLabels:l},point:c,camera:u}=r,{parameters:d}=this;if(!o||!a||l&&d.isLabel||!e.visible||!c||!u)return;const h=e.attributes.get("featureAttribute"),f=null==h?null:(0,T.ci)(h.data,Cr),{scaleX:p,scaleY:m}=Or(f,d,u.pixelRatio);(0,Mt.z0)(gr,t),e.attributes.has("featureAttribute")&&function(e){const t=e[0],r=e[1],i=e[2],n=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=1/Math.sqrt(t*t+r*r+i*i),d=1/Math.sqrt(n*n+s*s+o*o),h=1/Math.sqrt(a*a+l*l+c*c);e[0]=t*u,e[1]=r*u,e[2]=i*u,e[3]=n*d,e[4]=s*d,e[5]=o*d,e[6]=a*h,e[7]=l*h,e[8]=c*h}(gr);const y=e.attributes.get("position"),g=e.attributes.get("size"),b=e.attributes.get("normal"),_=e.attributes.get("rotation"),v=e.attributes.get("centerOffsetAndDistance");(0,be.vA)(y.size>=3);const w=(0,Gt.c)(d),x="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<y.data.length/y.size;e++){const i=e*y.size;(0,ce.i)(ur,y.data[i],y.data[i+1],y.data[i+2]),(0,ce.t)(ur,ur,t),(0,ce.t)(ur,ur,u.viewMatrix);const n=e*v.size;if((0,ce.i)(wr,v.data[n],v.data[n+1],v.data[n+2]),!x&&(ur[0]+=wr[0],ur[1]+=wr[1],0!==wr[2])){const e=wr[2];(0,ce.n)(wr,ur),(0,ce.d)(ur,ur,(0,ce.g)(wr,wr,e))}const o=e*b.size;if((0,ce.i)(dr,b.data[o],b.data[o+1],b.data[o+2]),ar(dr,gr,u,Sr),Mr(this.parameters,ur,Sr,u,cr),u.applyProjection(ur,hr),hr[0]>-1){x&&(wr[0]||wr[1])&&(hr[0]+=wr[0]*u.pixelRatio,0!==wr[1]&&(hr[1]+=cr.alignmentEvaluator.apply(wr[1])*u.pixelRatio),u.unapplyProjection(hr,ur)),hr[0]+=this.parameters.screenOffset[0]*u.pixelRatio,hr[1]+=this.parameters.screenOffset[1]*u.pixelRatio,hr[0]=Math.floor(hr[0]),hr[1]=Math.floor(hr[1]);const t=e*g.size;Ir[0]=g.data[t],Ir[1]=g.data[t+1],cr.evaluator.applyVec2(Ir,Ir);const i=Tr*u.pixelRatio;let n=0;d.textureIsSignedDistanceField&&(n=Math.min(d.outlineSize,.5*Ir[0])*u.pixelRatio/2),Ir[0]*=p,Ir[1]*=m;const o=e*_.size,a=d.rotation+_.data[o];if(lr(c,hr[0],hr[1],Ir,i,n,a,d,w)){const e=r.ray;if((0,ce.t)(pr,ur,(0,P.B8)(_r,u.viewMatrix)),hr[0]=c[0],hr[1]=c[1],u.unprojectFromRenderScreen(hr,ur)){const t=(0,S.vt)();(0,ce.c)(t,e.direction);const r=1/(0,ce.l)(t);(0,ce.g)(t,t,r),s((0,ce.j)(e.origin,ur)*r,t,-1,pr)}}}}}intersectDraped(e,t,r,i,n){const s=e.attributes.get("position"),o=e.attributes.get("size"),a=e.attributes.get("rotation"),l=this.parameters,c=(0,Gt.c)(l),u=e.attributes.get("featureAttribute"),d=null==u?null:(0,T.ci)(u.data,Cr),{scaleX:h,scaleY:f}=Or(d,l,e.screenToWorldRatio),p=Ar*e.screenToWorldRatio;for(let t=0;t<s.data.length/s.size;t++){const u=t*s.size,d=s.data[u],m=s.data[u+1],y=t*o.size;Ir[0]=o.data[y],Ir[1]=o.data[y+1];let g=0;l.textureIsSignedDistanceField&&(g=Math.min(l.outlineSize,.5*Ir[0])*e.screenToWorldRatio/2),Ir[0]*=h,Ir[1]*=f;const b=t*a.size,_=l.rotation+a.data[b];lr(r,d,m,Ir,p,g,_,l,c)&&i(n.distance,n.normal,-1)}}createBufferWriter(){return new Er}applyShaderOffsetsView(e,t,r,i,n,s,o){const a=ar(t,r,n,Sr);return this._applyVerticalGroundOffsetView(e,a,n,o),Mr(this.parameters,o,a,n,s),this._applyPolygonOffsetView(o,a,i[3],n,o),this._applyCenterOffsetView(o,i,o),o}applyShaderOffsetsNDC(e,t,r,i,n){return this._applyCenterOffsetNDC(e,t,r,i),null!=n&&(0,ce.c)(n,i),this._applyPolygonOffsetNDC(i,t,r,i),i}_applyPolygonOffsetView(e,t,r,i,n){const s=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=s);const a=s*o;if(this.parameters.shaderPolygonOffset<=0)return(0,ce.c)(n,e);const l=(0,F.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/i.viewport[2];return(0,ce.g)(n,e,a>0?c:1/c),n}_applyVerticalGroundOffsetView(e,t,r,i){const n=(0,ce.l)(e),s=r.aboveGround?1:-1,o=r.computeRenderPixelSizeAtDist(n)*Vt.R,a=(0,ce.g)(ur,t.normal,s*o);return(0,ce.f)(i,e,a),i}_applyCenterOffsetView(e,t,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,ce.c)(r,e),i&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,ce.n)(dr,r),(0,ce.a)(r,r,(0,ce.g)(dr,dr,t[2])))),r}_applyCenterOffsetNDC(e,t,r,i){const n="screen"!==this.parameters.centerOffsetUnits;return i!==e&&(0,ce.c)(i,e),n||(i[0]+=t[0]/r.fullWidth*2,i[1]+=t[1]/r.fullHeight*2),i}_applyPolygonOffsetNDC(e,t,r,i){const n=this.parameters.shaderPolygonOffset;if(e!==i&&(0,ce.c)(i,e),n){const e=r.aboveGround?1:-1,s=e*Math.sign(t[3]);i[2]-=(s||e)*n}return i}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,i=e[3]>=nr.Q||t>=nr.Q&&r[3]>=nr.Q;return this._visible&&i}createGLMaterial(e){return new or(e)}calculateRelativeScreenBounds(e,t,r=(0,O.vt)()){return function(e,t,r,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class or extends kt.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(Jt,e)}}function ar(e,t,r,i){return function(e){return(t=e)instanceof Float32Array&&t.length>=16||function(e){return Array.isArray(e)&&e.length>=16}(e);var t}(t)&&(t=(0,Mt.z0)(br,t)),(0,ce.o)(i.normal,e,t),(0,ce.t)(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=(0,ce.e)(fr,Pr),i}function lr(e,t,r,i,n,s,o,a,l){let c=t-n-i[0]*l[0],u=c+i[0]+2*n,d=r-n-i[1]*l[1],h=d+i[1]+2*n;const f=a.distanceFieldBoundingBox;return a.textureIsSignedDistanceField&&null!=f&&(c+=i[0]*f[0],d+=i[1]*f[1],u-=i[0]*(1-f[2]),h-=i[1]*(1-f[3]),c-=s,u+=s,d-=s,h+=s),(0,M.hZ)(yr,t,r),(0,M.e$)(mr,e,yr,(0,F.kU)(o)),mr[0]>c&&mr[0]<u&&mr[1]>d&&mr[1]<h}const cr=new Ut.fc,ur=(0,S.vt)(),dr=(0,S.vt)(),hr=(0,T.vt)(),fr=(0,S.vt)(),pr=(0,S.vt)(),mr=(0,R.vt)(),yr=(0,R.vt)(),gr=(0,Rt.vt)(),br=(0,Rt.vt)(),_r=(0,C.vt)(),vr=(0,T.vt)(),wr=(0,S.vt)(),xr=(0,S.vt)(),Cr=(0,T.vt)(),Sr={normal:fr,cosAngle:0},Tr=1,Ar=2,Ir=(0,R.fA)(0,0),Pr=(0,S.fA)(0,0,1);class Br extends kt.NV{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1,this.color=(0,T.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,R.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,T.CN)(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=(0,T.vt)(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Er{constructor(){this.layout=(0,zt.E)()?er:Kt}elementCount(e){return 6*e.get("position").indices.length}write(e,t,r,i,n,s){const{position:o,normal:a,uvi:l,color:c,size:u,rotation:d,centerOffsetAndDistance:h,featureAttribute:f}=n;(0,qt.Hk)(r.get("position"),e,o,s,6),(0,qt.p1)(r.get("normal"),t,a,s,6);const p=r.get("uvi")?.data;let m=0,y=0,g=-1-Gt.f,b=-1-Gt.f;p&&p.length>=4&&(m=p[0],y=p[1],g=-1-p[2],b=-1-p[3]);let _=r.get("position").indices.length,v=s;for(let e=0;e<_;++e)l.set(v,0,m),l.set(v,1,y),v++,l.set(v,0,g),l.set(v,1,y),v++,l.set(v,0,g),l.set(v,1,b),v++,l.set(v,0,g),l.set(v,1,b),v++,l.set(v,0,m),l.set(v,1,b),v++,l.set(v,0,m),l.set(v,1,y),v++;(0,qt.tb)(r.get("color"),4,c,s,6);const{data:w,indices:x}=r.get("size");_=x.length,v=s;for(let e=0;e<_;++e){const t=w[2*x[e]],r=w[2*x[e]+1];for(let e=0;e<6;++e)u.set(v,0,t),u.set(v,1,r),v++}if((0,qt.uO)(r.get("rotation"),d,s,6),r.get("centerOffsetAndDistance")?(0,qt.Ut)(r.get("centerOffsetAndDistance"),h,s,6):(0,qt.Pq)(h,s,6*_),r.get("featureAttribute")?(0,qt.Ut)(r.get("featureAttribute"),f,s,6):(0,qt.Pq)(f,s,6*_),null!=i){const e=r.get("position")?.indices;if(e){const t=e.length,r=n.getField("olidColor",Ft.XP);(0,qt.vx)(i,r,t,s,6)}}return{numVerticesPerItem:6,numItems:_}}intersect(e,t,r,i,n,s,o){const{options:{selectionMode:a,hud:l,excludeLabels:c},point:u,camera:d}=i;if(!a||!l||c&&t.isLabel||!u)return;const h=this.layout.createView(e),f=h.getField("position",Ft.xs),p=h.getField("normal",Ft.xs),m=h.getField("rotation",Ft.Y$),y=h.getField("size",Ft.gH),g=h.getField("featureAttribute",Ft.Eq),b=h.getField("centerOffsetAndDistance",Ft.Eq),_="screen"===t.centerOffsetUnits,v=(0,Gt.c)(t);if(null==f||null==p||null==m||null==y||null==b||null==d)return;const w=null==g?null:g.getVec(0,Cr),{scaleX:x,scaleY:C}=Or(w,t,d.pixelRatio),T=f.count/6;for(let e=0;e<T;e++){const n=6*e;if(f.getVec(n,ur),null!=r&&(0,ce.f)(ur,ur,r),(0,ce.t)(ur,ur,d.viewMatrix),b.getVec(n,vr),(0,ce.i)(wr,vr[0],vr[1],vr[2]),!_&&(ur[0]+=wr[0],ur[1]+=wr[1],0!==wr[2])){const e=wr[2];(0,ce.n)(wr,ur),(0,ce.d)(ur,ur,(0,ce.g)(wr,wr,e))}if(p.getVec(n,dr),ar(dr,gr,d,Sr),Mr(t,ur,Sr,d,cr),d.applyProjection(ur,hr),hr[0]>-1){_&&(wr[0]||wr[1])&&(hr[0]+=wr[0]*d.pixelRatio,0!==wr[1]&&(hr[1]+=cr.alignmentEvaluator.apply(wr[1])*d.pixelRatio),d.unapplyProjection(hr,ur)),hr[0]+=t.screenOffset[0]*d.pixelRatio,hr[1]+=t.screenOffset[1]*d.pixelRatio,hr[0]=Math.floor(hr[0]),hr[1]=Math.floor(hr[1]),y.getVec(n,Ir),cr.evaluator.applyVec2(Ir,Ir);const r=Tr*d.pixelRatio;let s=0;t.textureIsSignedDistanceField&&(s=Math.min(t.outlineSize,.5*Ir[0])*d.pixelRatio/2),Ir[0]*=x,Ir[1]*=C;const a=m.get(n),l=t.rotation+a;if(lr(u,hr[0],hr[1],Ir,r,s,l,t,v)){const t=i.ray;if((0,ce.t)(pr,ur,(0,P.B8)(_r,d.viewMatrix)),hr[0]=u[0],hr[1]=u[1],d.unprojectFromRenderScreen(hr,ur)){const r=(0,S.vt)();(0,ce.c)(r,t.direction);const i=1/(0,ce.l)(r);(0,ce.g)(r,r,i),o((0,ce.j)(t.origin,ur)*i,r,e,pr)}}}}}}function Or(e,t,r){return null==e||null==t.vvSize?{scaleX:r,scaleY:r}:((0,Dt.VC)(xr,t,e),{scaleX:xr[0]*r,scaleY:xr[1]*r})}function Mr(e,t,r,i,n){if(!e.verticalOffset?.screenLength){const i=(0,ce.l)(t);return n.update(r.cosAngle,i,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),t}const s=(0,ce.l)(t),o=e.screenSizePerspectiveAlignment??e.screenSizePerspective,a=(0,Nt.kE)(i,s,e.verticalOffset,r.cosAngle,o,e.screenSizePerspectiveMinPixelReferenceSize);return n.update(r.cosAngle,s,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),(0,ce.g)(r.normal,r.normal,a),(0,ce.f)(t,t,r.normal)}class Rr{constructor(e,t){this._mainThreadDelegate=t,this._bufferWriters=new Map,this.globalViewingMode=1===e}createRenderCommandBuffer(e=[],t=[]){return{commands:e,transferList:t}}mergeRenderCommandBuffers(e){const t=this.createRenderCommandBuffer();for(const r of e)null!=r&&(t.commands.push(...r.commands),t.transferList.push(...r.transferList));return t}async createTexture(e){const{data:t,parameters:r}=e();return await this._mainThreadDelegate.createTexture(t,r)}async releaseTexture(e){const t=this._destroyTexture(e);return new g(this,t,[])}_destroyTexture(e){return{commands:[{id:"destroy-texture",textureId:e}],transferList:[]}}async createMaterial(e){const{type:t,parameters:r}=e,i=Ke("material");let n,s;switch(t){case"default":n=new je.$U(e.parameters,{spherical:this.globalViewingMode}),s={type:t,materialId:i,parameters:e.parameters};break;case"hud":n=new sr(r,this.globalViewingMode),s={type:t,materialId:i,parameters:e.parameters}}return this._bufferWriters.set(i,n.createBufferWriter()),await this._mainThreadDelegate.createMaterial(s),i}destroyMaterial(e){return{commands:[{id:"destroy-material",materialId:e}],transferList:[]}}updateMaterial(e){return{commands:[{...e,id:"update-material"}],transferList:[]}}async createDirectRenderer(e){return await this._mainThreadDelegate.createDirectRenderer(e),e}async destroyDirectRenderer(e){await this._mainThreadDelegate.destroyDirectRenderer(e)}addDirectRendererGeometry(e,t,r){const{materialId:i}=t;if(null==this._bufferWriters.get(i))throw new Error(`no bufferwriter found for material ${i}`);const{renderGeometryBuffer:n,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.addDirectRendererGeometryBuffer(i,e,n,s,r)}updateDirectRendererGeometry(e,t,r){const{materialId:i}=t;if(null==this._bufferWriters.get(i))throw new Error(`no bufferwriter found for material ${i}`);const{renderGeometryBuffer:n,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.updateDirectRendererGeometryBuffer(i,e,n,s,r)}addDirectRendererGeometryBuffer(e,t,r,i,n){const{objectIds:s,visibilities:o}=i;return{commands:[{id:"add-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:i,localOrigin:n}],transferList:[r.data,s.buffer,o.buffer]}}updateDirectRendererGeometryBuffer(e,t,r,i,n){const{objectIds:s,visibilities:o}=i;return{commands:[{id:"update-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:i,localOrigin:n}],transferList:[r.data,s.buffer,o.buffer]}}removeDirectRendererGeometryBuffer(e,t){return{commands:[{id:"remove-direct-renderer-geometry-buffer",rendererId:e,groupId:t}],transferList:[]}}async createLodRenderer(e){const t=Ke("lod-renderer"),r=new Set,i={levels:e.levels.map(e=>({components:e.components.map(e=>{const t=e.attributes.get("position");if(!t||0===t.indices.length)throw new Error("positions attribute expected");const i=(0,N.tM)(t.indices.length/3),n=new Ot.j(i,3,t);if(null==this._bufferWriters.get(e.materialId))throw new Error("writer not found");const{renderGeometryBuffer:s}=this.createRenderGeometryBuffer(e,null);return r.add(s.data),{materialId:e.materialId,renderGeometryBuffer:s,boundingInfo:{bbMax:n.bbMax,bbMin:n.bbMin}}}),minScreenSpaceRadius:e.minScreenSpaceRadius}))};return await this._mainThreadDelegate.createLodRenderer(t,i,Array.from(r)),t}destroyLodRenderer(e){return{commands:[{id:"destroy-lod-renderer",rendererId:e}],transferList:[]}}addLodInstances(e,t,r){return{commands:[{id:"add-lod-instances",rendererId:e,groupId:t,data:r}],transferList:[r.featureIds.buffer,r.globalTransforms.buffer,r.localTransforms.buffer,r.visibility.buffer]}}removeLodInstances(e,t){return{commands:[{id:"remove-lod-instances",rendererId:e,groupId:t}],transferList:[]}}updateLodInstancesData(e,t,r){return{commands:[{id:"update-lod-instance-data",rendererId:e,groupId:t,globalTransforms:r}],transferList:[r.buffer]}}updateVisibility(e,t,r){return{commands:[{id:"update-visibility",rendererId:e,groupId:t,visibility:r}],transferList:[r.buffer]}}async dispatchRenderCommands(e){0!==e.commands.length&&await this._mainThreadDelegate.executeRenderCommands(e)}createRenderGeometryBuffer(e,t){const{materialId:r,visibilities:i,objectIds:n}=e,s=this._bufferWriters.get(r);if(null==s)throw new Error("no registered bufferWriter for material found");let o=null;if(e.transformation&&t)(0,P.C)(Fr,e.transformation),Fr[12]-=t[0],Fr[13]-=t[1],Fr[14]-=t[2],o=Fr;else{if(t)throw new Error("not implemented");e.transformation&&(o=e.transformation)}let a=null;o&&((0,P.B8)(Dr,Fr),(0,P.mg)(Dr,Dr),a=Dr);const l=e.attributes,c=s.elementCount(l),u=s.layout.stride/4;c>Math.floor(jr/u)&&console.warn("geometry with very large number of elements encountered");const d=s.layout.createBuffer(c),h=s.write(o,a,l,e.olidColor,d,0);if(null==h)throw new Error("Bufferwriter.write does not provide item information.");if(i.length!==h.numItems||n.length!==h.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");return{renderGeometryBuffer:{data:d.buffer,elementCount:c},renderGeometryBufferItems:{objectIds:n,visibilities:i,ranges:{numVertices:h.numVerticesPerItem,numItems:h.numItems}}}}}const Fr=(0,C.vt)(),Dr=(0,C.vt)(),jr=4194304;var Vr=r(98764),zr=r(65806);const kr=(0,S.vt)();var Lr=r(4341),Ur=r(11964),qr=r(44280),Nr=r(32114);const Gr=()=>c.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function Hr(e=ci){return{plane:(0,he.vt)(e.plane),origin:(0,S.o8)(e.origin),basis1:(0,S.o8)(e.basis1),basis2:(0,S.o8)(e.basis2)}}function $r(e,t=Hr()){return Yr(e.origin,e.basis1,e.basis2,t)}function Yr(e,t,r,i=Hr()){return(0,ce.c)(i.origin,e),(0,ce.c)(i.basis1,t),(0,ce.c)(i.basis2,r),Zr(i),function(e,t){Math.abs((0,ce.e)(e.basis1,e.basis2)/((0,ce.l)(e.basis1)*(0,ce.l)(e.basis2)))>1e-6&&Gr().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,ce.e)(e.basis1,ni(e)))>1e-6&&Gr().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,ce.e)(ni(e),e.origin)-e.plane[3])>1e-6&&Gr().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function Zr(e){(0,he.mR)(e.basis2,e.basis1,e.origin,e.plane)}function Xr(e,t,r){e!==r&&$r(e,r);const i=(0,ce.g)(Nr.rq.get(),ni(e),t);return(0,ce.f)(r.origin,r.origin,i),r.plane[3]-=t,r}function Wr(e,t=Hr()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,ce.i)(t.origin,e[0]+r,e[1]+i,0),(0,ce.i)(t.basis1,r,0,0),(0,ce.i)(t.basis2,0,i,0),(0,he.fA)(0,0,1,0,t.plane),t}function Jr(e,t,r){return!!(0,he.Ui)(e.plane,t,r)&&si(e,r)}function Qr(e,t,r){const i=ui.get();li(e,t,i,ui.get());let n=Number.POSITIVE_INFINITY;for(const s of pi){const o=ai(e,s,di.get()),a=Nr.rq.get();if((0,he.T7)(i,o,a)){const e=(0,ce.E)(Nr.rq.get(),t.origin,a),i=Math.abs((0,F.XM)((0,ce.e)(t.direction,e)));i<n&&(n=i,(0,ce.c)(r,a))}}return n===Number.POSITIVE_INFINITY?Kr(e,t,r):r}function Kr(e,t,r){if(Jr(e,t,r))return r;const i=ui.get(),n=ui.get();li(e,t,i,n);let s=Number.POSITIVE_INFINITY;for(const o of pi){const a=ai(e,o,di.get()),l=Nr.rq.get();if((0,he.gv)(i,a,l)){const e=(0,fe.kb)(t,l);if(!(0,he.Tj)(n,l))continue;e<s&&(s=e,(0,ce.c)(r,l))}}return ri(e,t.origin)<s&&ei(e,t.origin,r),r}function ei(e,t,r){const i=(0,he._I)(e.plane,t,Nr.rq.get()),n=(0,Ur.H6)(oi(e,e.basis1),i,-1,1,Nr.rq.get()),s=(0,Ur.H6)(oi(e,e.basis2),i,-1,1,Nr.rq.get());return(0,ce.d)(r,(0,ce.f)(Nr.rq.get(),n,s),e.origin),r}function ti(e,t,r){const{origin:i,basis1:n,basis2:s}=e,o=(0,ce.d)(Nr.rq.get(),t,i),a=(0,qr.gr)(n,o),l=(0,qr.gr)(s,o),c=(0,qr.gr)(ni(e),o);return(0,ce.i)(r,a,l,c)}function ri(e,t){const r=ti(e,t,Nr.rq.get()),{basis1:i,basis2:n}=e,s=(0,ce.l)(i),o=(0,ce.l)(n),a=Math.max(Math.abs(r[0])-s,0),l=Math.max(Math.abs(r[1])-o,0),c=r[2];return a*a+l*l+c*c}function ii(e,t){const r=-e.plane[3];return(0,qr.gr)(ni(e),t)-r}function ni(e){return(0,he.Qj)(e.plane)}function si(e,t){const r=(0,ce.d)(Nr.rq.get(),t,e.origin),i=(0,ce.k)(e.basis1),n=(0,ce.k)(e.basis2),s=(0,ce.e)(e.basis1,r),o=(0,ce.e)(e.basis2,r);return-s-i<0&&s-i<0&&-o-n<0&&o-n<0}function oi(e,t){const r=di.get();return(0,ce.c)(r.origin,e.origin),(0,ce.c)(r.vector,t),r}function ai(e,t,r){const{basis1:i,basis2:n,origin:s}=e,o=(0,ce.g)(Nr.rq.get(),i,t.origin[0]),a=(0,ce.g)(Nr.rq.get(),n,t.origin[1]);(0,ce.f)(r.origin,o,a),(0,ce.f)(r.origin,r.origin,s);const l=(0,ce.g)(Nr.rq.get(),i,t.direction[0]),c=(0,ce.g)(Nr.rq.get(),n,t.direction[1]);return(0,ce.g)(r.vector,(0,ce.f)(l,l,c),2),r}function li(e,t,r,i){const n=ni(e);(0,he.mR)(n,t.direction,t.origin,r),(0,he.mR)((0,he.Qj)(r),n,t.origin,i)}const ci={plane:(0,he.vt)(),origin:(0,S.fA)(0,0,0),basis1:(0,S.fA)(1,0,0),basis2:(0,S.fA)(0,1,0)},ui=new Lr.I(he.vt),di=new Lr.I(Ur.vt),hi=(0,S.vt)(),fi=new Lr.I(()=>Hr()),pi=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],mi=(0,C.vt)(),yi=(0,C.vt)(),gi=Object.freeze(Object.defineProperty({__proto__:null,altitudeAt:ii,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case 0:(0,ce.c)(r,e.basis1),(0,ce.n)(r,r);break;case 1:(0,ce.c)(r,e.basis2),(0,ce.n)(r,r);break;case 2:(0,ce.c)(r,ni(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:Kr,closestPointOnSilhouette:Qr,copy:$r,copyWithoutVerify:function(e,t){(0,ce.c)(t.origin,e.origin),(0,ce.c)(t.basis1,e.basis1),(0,ce.c)(t.basis2,e.basis2),(0,he.C)(t.plane,e.plane)},create:Hr,distance:function(e,t){return Math.sqrt(ri(e,t))},distance2:ri,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of pi){const n=ai(e,i,di.get()),s=(0,Ur.kb)(n,t);s>r&&(r=s)}return Math.sqrt(r)},elevate:Xr,equals:function(e,t){return(0,ce.q)(e.basis1,t.basis1)&&(0,ce.q)(e.basis2,t.basis2)&&(0,ce.q)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,he.Tj)(e.plane,t)&&si(e,t)},fromAABoundingRect:Wr,fromValues:Yr,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[n,s]=e.origin;return(0,O.fA)(n-r,s-i,n+r,s+i,t)},intersectRay:Jr,intersectRayClosestSilhouette:function(e,t,r){if(Jr(e,t,r))return r;const i=Qr(e,t,Nr.rq.get());return(0,ce.f)(r,t.origin,(0,ce.g)(Nr.rq.get(),t.direction,(0,ce.j)(t.origin,i)/(0,ce.l)(t.direction))),r},normal:ni,projectPoint:ei,projectPointLocal:ti,rotate:function(e,t,r,i){return e!==i&&$r(e,i),(0,P.$0)(yi,t,r),(0,ce.t)(i.basis1,e.basis1,yi),(0,ce.t)(i.basis2,e.basis2,yi),Zr(i),i},setAltitudeAt:function(e,t,r,i){const n=ii(e,t),s=(0,ce.g)(hi,ni(e),r-n);return(0,ce.f)(i,t,s),i},setExtent:function(e,t,r){return Wr(t,r),Xr(r,ii(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&$r(e,r),(0,P.B8)(mi,t),(0,P.mg)(mi,mi),(0,ce.t)(r.basis1,e.basis1,mi),(0,ce.t)(r.basis2,e.basis2,mi),(0,ce.t)((0,he.Qj)(r.plane),(0,he.Qj)(e.plane),mi),(0,ce.t)(r.origin,e.origin,t),(0,he.mP)(r.plane,r.plane,r.origin),r},up:ci,updateUnboundedPlane:Zr,wrap:function(e,t,r){const i=fi.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,he.LV)(0,0,0,0),Zr(i),i}},Symbol.toStringTag,{value:"Module"}));var bi=r(97937);function _i(e,t,r=function(e){return{operations:e,value:e.create()}}(e)){return r.operations=e,e.copy(t,r.value),r}const vi=2**50;function wi(e,t,r,i){return e.operations.setAltitudeAt(e.value,t,r,i)}function xi(e,t,r){return e.operations.elevate(e.value,t,r.value)}const Ci=(0,S.vt)();function Si(e){return"point"===e.type}(0,S.vt)();class Ti{constructor(e,t,r,i){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=r,this._coordinateSystem=i,this._tmpCoordinateSystem=function(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}(i),this.referenceEllipsoid=(0,pe.tO)(t),this.sphericalPCPF=(0,Vr.lO)(t)}set extent(e){e&&function(e,t,r){e.operations.setExtent(e.value,t,r.value)}(this._coordinateSystem,e,this._coordinateSystem)}get extent(){return e=this._coordinateSystem,t=(0,O.vt)(),e.operations.getExtent(e.value,t),t;var e,t}getAltitude(e){return function(e,t){return e.operations.altitudeAt(e.value,t)}(this._coordinateSystem,e)}setAltitude(e,t,r=e){return wi(this._coordinateSystem,r,t,e)}setAltitudeOfTransformation(e,t){var r,i,n,s;r=this._coordinateSystem,n=e,(i=t)!==(s=t)&&(0,P.C)(s,i),(0,ce.i)(Ci,s[12],s[13],s[14]),wi(r,Ci,n,Ci),s[12]=Ci[0],s[13]=Ci[1],s[14]=Ci[2]}worldUpAtPosition(e,t){return function(e,t,r){return e.operations.axisAt(e.value,t,2,r)}(this._coordinateSystem,e,t)}worldBasisAtPosition(e,t,r){return function(e,t,r,i){return e.operations.axisAt(e.value,t,r,i)}(this._coordinateSystem,e,t,r)}basisMatrixAtPosition(e,t){const r=this.worldBasisAtPosition(e,0,Nr.rq.get()),i=this.worldBasisAtPosition(e,1,Nr.rq.get()),n=this.worldBasisAtPosition(e,2,Nr.rq.get());return(0,P.hZ)(t,r[0],r[1],r[2],0,i[0],i[1],i[2],0,n[0],n[1],n[2],0,0,0,0,1),t}headingAtPosition(e,t){const r=this.worldUpAtPosition(e,Nr.rq.get()),i=this.worldBasisAtPosition(e,1,Nr.rq.get()),n=(0,qr.EJ)(t,i,r);return(0,F.KJ)(n)}intersectManifoldClosestSilhouette(e,t,r){return xi(this._coordinateSystem,t,this._tmpCoordinateSystem),function(e,t,r){e.operations.intersectRayClosestSilhouette(e.value,t,r)}(this._tmpCoordinateSystem,e,r),r}intersectManifold(e,t,r){xi(this._coordinateSystem,t,this._tmpCoordinateSystem);const i=Nr.rq.get();return function(e,t,r){return e.operations.intersectRay(e.value,t,r)}(this._tmpCoordinateSystem,e,i)?(0,ce.c)(r,i):null}intersectInfiniteManifold(e,t,r){if(1===this.viewingMode)return this.intersectManifold(e,t,r);xi(this._coordinateSystem,t,this._tmpCoordinateSystem);const i=this._tmpCoordinateSystem.value,n=Nr.rq.get();return(0,he.Ui)(i.plane,e,n)?(0,ce.c)(r,n):null}toRenderCoords(e,t,r){return Si(e)?(0,zr.g)(e,t,this.spatialReference):(0,k.F)(e,t,r,this.spatialReference)}fromRenderCoords(e,t,r=null){return Si(t)?(null!=r&&(t.spatialReference=r),function(e,t,r){return!!(0,k.F)(e,t,kr,r.spatialReference)&&(r.x=kr[0],r.y=kr[1],r.z=kr[2],!0)}(e,this.spatialReference,t)?t:null):(0,k.F)(e,this.spatialReference,t,r)?t:null}static create(e,t){switch(e){case 2:return new Ti(2,t,(0,I.GA)(t),_i(gi,Yr([0,0,0],[vi,0,0],[0,vi,0])));case 1:return new Ti(1,t,1,function(e){return _i(bi.s,(0,bi.f)(0,0,0,(0,pe.tO)(e).radius))}(t))}}static renderUnitScaleFactor(e,t){return(0,I.KX)(e)/(0,I.KX)(t)}}let Ai=class extends n.nJ{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new pt,this._tileLocks=new at,this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,layerInfo:i,layerViewInfo:n}){const s=f.A.fromJSON(e);this._viewSpatialReference=s;const a=f.A.fromJSON(t);this._fetcher=new Et(this._viewSpatialReference,m.A.fromJSON(i.baseQuery),i.url,i.objectIdField,i.capabilities),this._queryEngine=new p.do({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:i.objectIdField},fieldsIndex:i.fieldIndex,availableFields:[i.objectIdField],spatialReference:e,featureStore:this._featureStore,timeInfo:i.timeInfo}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const i={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",i,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};const l=Ti.create(r,a),c=new Rr(r,this._mainThreadDelegate);this._renderCommandContext=c;const u=new He(s,a,this._mainThreadDelegate,l,c,i,n);this._context=u,this._renderer=u.symbolRendererFactory.createSymbolRendererFromJSON(i.renderer),this._defaultQueryJSON=new m.A({outSpatialReference:s}).toJSON();let y=null;if(null!=i.fullExtent){const e=d.A.fromJSON(i.fullExtent);await(0,h.initializeProjection)(e.spatialReference,s),y=(0,h.project)(e,s)}return this._tileManager=new rt({loadTile:(e,t)=>this._fetcher.fetch(e,t),createAddCommand:(e,t)=>this._createAddFeatureDataCommand(e,t),createRemoveCommand:e=>this._createRemoveFeatureDataCommand(e),createUpdateCommand:(e,t)=>this._createUpdateFeatureDataVisibilityCommand(e,t),tileLocks:this._tileLocks,extent:y}),this.addHandles((0,o.wB)(()=>this.updating,e=>{this.emit("notify-updating",{updating:e})}),o.Vh),null!=this._renderer&&await this._renderer.load(),Pi}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async executeAttributeBinsQuery(e,t){return{result:await this._queryEngine.executeAttributeBinsQuery(e,t)}}onTileTreeChange(e){return this._tileManager.onTileTreeChange(e),Promise.resolve(Pi)}async onElevationChange(e){return Pi}async onLayerViewOpacityChange(e){const{_context:t,_renderer:r}=this;if(t.layerViewInfo.fullOpacity=e,null==r)return Pi;const i=await r.createUpdateLayerViewOpacityCommand(e);return await i.execute(),Pi}async onRendererChange(e){const{_context:t}=this,r=t.symbolRendererFactory.createSymbolRendererFromJSON(e);await r.load();const n=this._renderer;this._renderer=r;const s=[...this._tileManager.loadedTiles()],o=s.map(e=>e.tileId);{const e={stack:[],error:void 0,hasError:!1};try{(0,i.mS)(e,await this._tileLocks.lock(o),!1);const a=s.flatMap(e=>[n.createRemoveCommand(e.id),r.createAddCommand(e)]),l=await Promise.all(a),c=t.joinPipelineCommands(l);await c.execute()}catch(t){e.error=t,e.hasError=!0}finally{(0,i.hk)(e)}}const a=await n.createDestroyCommand();return await a.execute(),Pi}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,i=this._renderer;let n;return n=null!=i?await i.createAddCommand(e):g.create(this._renderCommandContext),(0,s.Te)(t),n.appendPipelineStateCommand(()=>{r.addTile(e)}),n}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let i;return i=null!=r?await r.createRemoveCommand(e):g.create(this._renderCommandContext),i.appendPipelineStateCommand(()=>{t.removeTile(e)}),i}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer;let i;return i=null!=r?await r.createUpdateVisibilityCommand(e):g.create(this._renderCommandContext),(0,s.Te)(t),i}_ensureQuery(e){return e??this._defaultQueryJSON}};(0,i.Cg)([(0,a.MZ)()],Ai.prototype,"updating",null),Ai=(0,i.Cg)([(0,u.$)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],Ai);const Ii=Ai,Pi={result:void 0}},63578:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(47522),n=r(96598),s=r(31821);function o(e,t){const{vertex:r,fragment:o}=e;e.include(n.Z,t),r.include(i.K),r.main.add(s.H`vec4 posProjCenter;
336
+ }`)}},51624:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(44208),n=r(69397),s=r(93687);const o=4294967296,a=new TextDecoder("utf-8"),l=(0,i.A)("safari")||(0,i.A)("ios")?6:(0,i.A)("ff")?12:32;class c{constructor(e,t,r=0,i=(e?e.byteLength:0)){this._tag=0,this._dataType=99,this._init(e,t,r,i)}_init(e,t,r,i){this._data=e,this._dataView=t,this._pos=r,this._end=i}get usedMemory(){return 64+(0,n.Qf)(this._data)}asUnsafe(){return this}clone(){return new c(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;if(e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128)return e;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,r=e.getUint32(t,!0)+e.getUint32(t+4,!0)*o;return this._skip(8),r}getSFixed64(){const e=this._dataView,t=this._pos,r=e.getUint32(t,!0)+e.getInt32(t+4,!0)*o;return this._skip(8),r}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,r=this._toString(this._data,t,t+e);return this._skip(e),r}getBytes(){const e=this._getLength(),t=this._pos,r=this._toBytes(this._data,t,t+e);return this._skip(e),r}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,r,i){const n=this.getMessage(),s=e(n,t,r,i);return n.release(),s}processMessage(e){const t=this.getMessage(),r=e(t);return t.release(),r}getMessage(){const e=this._getLength(),t=c.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){c.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case 0:this._decodeVarint();break;case 1:this._skip(8);break;case 2:this._skip(this._getLength());break;case 5:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t=this._pos,r=0,i=0;if(this._end-t>=10)do{if(i=e[t++],r|=127&i,!(128&i))break;if(i=e[t++],r|=(127&i)<<7,!(128&i))break;if(i=e[t++],r|=(127&i)<<14,!(128&i))break;if(i=e[t++],r|=(127&i)<<21,!(128&i))break;if(i=e[t++],r+=268435456*(127&i),!(128&i))break;if(i=e[t++],r+=34359738368*(127&i),!(128&i))break;if(i=e[t++],r+=4398046511104*(127&i),!(128&i))break;if(i=e[t++],r+=562949953421312*(127&i),!(128&i))break;if(i=e[t++],r+=72057594037927940*(127&i),!(128&i))break;if(i=e[t++],r+=0x8000000000000000*(127&i),!(128&i))break;throw new Error("Varint too long!")}while(0);else{let n=1;for(;t!==this._end&&(i=e[t],128&i);)++t,r+=(127&i)*n,n*=128;if(t===this._end)throw new Error("Varint overrun!");++t,r+=i*n}return this._pos=t,r}_decodeSVarint(){const e=this._data;let t,r=0,i=0;const n=1&e[this._pos];if(i=e[this._pos++],r|=127&i,!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r|=(127&i)<<7,!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r|=(127&i)<<14,!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r|=(127&i)<<21,!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r+=268435456*(127&i),!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r+=34359738368*(127&i),!(128&i))return n?-(r+1)/2:r/2;if(i=e[this._pos++],r+=4398046511104*(127&i),!(128&i))return n?-(r+1)/2:r/2;if(t=BigInt(r),i=e[this._pos++],t+=0x2000000000000n*BigInt(127&i),!(128&i))return Number(n?-(t+1n)/2n:t/2n);if(i=e[this._pos++],t+=0x100000000000000n*BigInt(127&i),!(128&i))return Number(n?-(t+1n)/2n:t/2n);if(i=e[this._pos++],t+=0x8000000000000000n*BigInt(127&i),!(128&i))return Number(n?-(t+1n)/2n:t/2n);throw new Error("Varint too long!")}_getLength(){if(2!==this._dataType)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,r){if((r=Math.min(this._end,r))-t>l){const i=e.subarray(t,r);return a.decode(i)}let i="",n="";for(let s=t;s<r;++s){const t=e[s];128&t?n+="%"+t.toString(16):(i+=decodeURIComponent(n)+String.fromCharCode(t),n="")}return n.length&&(i+=decodeURIComponent(n)),i}_toBytes(e,t,r){return r=Math.min(this._end,r),new Uint8Array(e.buffer,t,r-t)}static{this.pool=new s.A(()=>new c(null,null),void 0,e=>{e._data=null,e._dataView=null})}}},52106:(e,t,r)=>{r.d(t,{A:()=>x});var i,n=r(31635),s=r(37838),o=r(69540),a=r(51447),l=r(25482),c=r(53966),u=r(36708),d=r(24326),h=r(10107),f=(r(44208),r(87811),r(40608)),p=r(12195),m=r(65864),y=r(50498),g=r(55156),b=r(60950),_=r(54339),v=r(33910);function w(e){if(null==e)return null;const t={};for(const r in e){const i=e[r];i&&(t[r]=i.toJSON())}return 0!==Object.keys(t).length?t:null}let x=class extends((0,o.OU)(l.o)){static{i=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,d.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,a.eF)(c.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new i({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,b.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const r=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[r,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=(0,g.I)(this.origin);if(e)return(0,_.r)(this,e);const t=this.sourceLayer??this.layer;return t?(0,_.r)(this,t):null}getGlobalId(){const e=(0,g.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);const t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){return{aggregateGeometries:w(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,p.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,i){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const n={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(n.action=i),"attributes"===e&&(n.attributeName=i),this.layer.graphicChanged(n)}_watchMeshGeometryChanges(){this.addHandles([(0,u.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,u.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,n.Cg)([(0,h.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const i=(0,m.rS)(e[r]);i&&(t[r]=i)}return 0!==Object.keys(t).length?t:null}}})],x.prototype,"aggregateGeometries",null),(0,n.Cg)([(0,h.MZ)({value:null})],x.prototype,"attributes",null),(0,n.Cg)([(0,h.MZ)({value:null,types:y.yR,json:{read:m.rS}})],x.prototype,"geometry",null),(0,n.Cg)([(0,h.MZ)({type:Boolean})],x.prototype,"isAggregate",void 0),(0,n.Cg)([(0,h.MZ)({clonable:!1})],x.prototype,"layer",void 0),(0,n.Cg)([(0,h.MZ)({clonable:"reference"})],x.prototype,"origin",void 0),(0,n.Cg)([(0,h.MZ)({type:s.A,value:null})],x.prototype,"popupTemplate",null),(0,n.Cg)([(0,h.MZ)({clonable:"reference"})],x.prototype,"sourceLayer",void 0),(0,n.Cg)([(0,h.MZ)({value:null,types:v.Es})],x.prototype,"symbol",null),(0,n.Cg)([(0,h.MZ)({clonable:!1,json:{read:!1,write:!1}})],x.prototype,"_version",void 0),(0,n.Cg)([(0,h.MZ)({type:Boolean,value:!0})],x.prototype,"visible",null),x=i=(0,n.Cg)([(0,f.$)("esri.Graphic")],x)},53177:(e,t,r)=>{r.d(t,{A:()=>d});var i,n=r(31635),s=r(4718),o=r(10107),a=(r(44208),r(53966),r(93223)),l=r(40608),c=r(39357),u=r(76357);let d=class extends u.A{static{i=this}constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const r=String(e);this.codedValues.some(e=>(String(e.code)===r&&(t=e.name),!!t))}return t}clone(){return new i({codedValues:(0,s.o8)(this.codedValues),name:this.name})}};(0,n.Cg)([(0,o.MZ)({type:[c.H],json:{write:{isRequired:!0}}})],d.prototype,"codedValues",void 0),(0,n.Cg)([(0,a.e)({codedValue:"coded-value"})],d.prototype,"type",void 0),d=i=(0,n.Cg)([(0,l.$)("esri.layers.support.CodedValueDomain")],d)},53655:(e,t,r)=>{r.d(t,{SH:()=>P,ae:()=>C,cn:()=>b});var i=r(49186),n=r(51624),s=r(92722),o=r(69418);const a=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],l=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],c=["upperLeft","lowerLeft"];function u(e){return e>=a.length?null:a[e]}function d(e){return e>=l.length?null:l[e]}function h(e){return e>=c.length?null:c[e]}function f(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function p(e,t,r){const i=e.asUnsafe(),n=t.createPointGeometry(r);for(;i.next();)switch(i.tag()){case 3:{const e=i.getUInt32(),r=i.pos()+e;let s=0;for(;i.pos()<r;)t.addCoordinatePoint(n,i.getSInt64(),s++);break}default:i.skip()}return n}function m(e,t,r){const i=e.asUnsafe(),n=t.createGeometry(r),s=2+(r.hasZ?1:0)+(r.hasM?1:0);for(;i.next();)switch(i.tag()){case 2:{const e=i.getUInt32(),r=i.pos()+e;let s=0;for(;i.pos()<r;)t.addLength(n,i.getUInt32(),s++);break}case 3:{const e=i.getUInt32(),r=i.pos()+e;let o=0;for(t.allocateCoordinates(n);i.pos()<r;)t.addCoordinate(n,i.getSInt64(),o),o++,o===s&&(o=0);break}default:i.skip()}return n}function y(e){const t=e.asUnsafe(),r=new s.A;let i="esriGeometryPoint";for(;t.next();)switch(t.tag()){case 2:{const e=t.getUInt32(),i=t.pos()+e;for(;t.pos()<i;)r.lengths.push(t.getUInt32());break}case 3:{const e=t.getUInt32(),i=t.pos()+e;for(;t.pos()<i;)r.coords.push(t.getSInt64());break}case 1:i=o.z[t.getEnum()];break;default:t.skip()}return{queryGeometry:r,queryGeometryType:i}}function g(e){const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:return t.getString();case 2:return t.getFloat();case 3:return t.getDouble();case 4:return t.getSInt32();case 5:return t.getUInt32();case 6:return t.getInt64();case 7:return t.getUInt64();case 8:return t.getSInt64();case 9:return t.getBool();default:return t.skip(),null}return null}function b(e){const t=e.asUnsafe(),r={type:u(0)};for(;t.next();)switch(t.tag()){case 1:r.name=t.getString();break;case 2:r.type=u(t.getEnum());break;case 3:r.alias=t.getString();break;case 4:r.sqlType=d(t.getEnum());break;case 5:default:t.skip();break;case 6:r.defaultValue=t.getString()}return r}function _(e){const t={},r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t.name=r.getString();break;case 2:t.isSystemMaintained=r.getBool();break;default:r.skip()}return t}function v(e,t,r,i){const n=t.createFeature(r);let s=0;for(;e.next();)switch(e.tag()){case 1:{const t=i[s++].name;n.attributes[t]=e.processMessage(g);break}case 2:n.geometry=e.processMessageWithArgs(m,t,r);break;case 4:n.centroid=e.processMessageWithArgs(p,t,r);break;default:e.skip()}return n}function w(e){const t=[1,1,1,1],r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t[0]=r.getDouble();break;case 2:t[1]=r.getDouble();break;case 4:t[2]=r.getDouble();break;case 3:t[3]=r.getDouble();break;default:r.skip()}return t}function x(e){const t=[0,0,0,0],r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t[0]=r.getDouble();break;case 2:t[1]=r.getDouble();break;case 4:t[2]=r.getDouble();break;case 3:t[3]=r.getDouble();break;default:r.skip()}return t}function C(e){const t={originPosition:h(0)},r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t.originPosition=h(r.getEnum());break;case 2:t.scale=r.processMessage(w);break;case 3:t.translate=r.processMessage(x);break;default:r.skip()}return t}function S(e){const t={},r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t.shapeAreaFieldName=r.getString();break;case 2:t.shapeLengthFieldName=r.getString();break;case 3:t.units=r.getString();break;default:r.skip()}return t}function T(e,t){const r=t.createSpatialReference();for(;e.next();)switch(e.tag()){case 1:r.wkid=e.getUInt32();break;case 5:r.wkt=e.getString();break;case 2:r.latestWkid=e.getUInt32();break;case 3:r.vcsWkid=e.getUInt32();break;case 4:r.latestVcsWkid=e.getUInt32();break;default:e.skip()}return r}function A(e,t){const r=t.createFeatureResult(),i=e.asUnsafe();r.geometryType=f(t,0);let n=!1;for(;i.next();)switch(i.tag()){case 1:r.objectIdFieldName=i.getString();break;case 3:r.globalIdFieldName=i.getString();break;case 4:r.geohashFieldName=i.getString();break;case 5:r.geometryProperties=i.processMessage(S);break;case 7:r.geometryType=f(t,i.getEnum());break;case 8:r.spatialReference=i.processMessageWithArgs(T,t);break;case 10:r.hasZ=i.getBool();break;case 11:r.hasM=i.getBool();break;case 12:r.transform=i.processMessage(C);break;case 9:r.exceededTransferLimit=i.getBool();break;case 13:t.addField(r,i.processMessage(b));break;case 15:n||(t.prepareFeatures(r),n=!0),t.addFeature(r,i.processMessageWithArgs(v,t,r,r.fields));break;case 2:r.uniqueIdField=i.processMessage(_);break;default:i.skip()}return t.finishFeatureResult(r),r}function I(e,t){const r={};let i=null;for(;e.next();)switch(e.tag()){case 4:i=e.processMessageWithArgs(y);break;case 1:r.featureResult=e.processMessageWithArgs(A,t);break;default:e.skip()}return null!=i&&r.featureResult&&t.addQueryGeometry(r,i),r}function P(e,t){try{const r=2,i=new n.A(new Uint8Array(e),new DataView(e)),s={};for(;i.next();)i.tag()===r?s.queryResult=i.processMessageWithArgs(I,t):i.skip();return s}catch(e){throw new i.A("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}}},55156:(e,t,r)=>{r.d(t,{I:()=>n,e:()=>i});const i=Symbol("idFieldsProviderSymbol");function n(e){return(t=e)&&i in t?e[i]:void 0;var t}},55674:(e,t,r)=>{r.d(t,{Ad:()=>f,Gj:()=>y,QY:()=>h,lL:()=>g,xR:()=>p});var i=r(66131),n=r(49186),s=(r(44208),r(44729)),o=r(15032),a=r(65864),l=r(95466),c=r(43668),u=r(98623);const d=["geometry","scale","timeProperties"];function h(e,t){if(null!=t)for(const r of d)t.hasArcadeDependency(r)&&e.add(r);return e}function f(e,t){return m.create(e,t,null,["$feature","$view"])}function p(e,t,r){return m.create(e,t,r,["$feature","$view","$config"])}class m{static async create(e,t,r,i){const{arcade:s,Dictionary:o}=await(0,c.l)();let a;try{a=s.parseScript(e)}catch(t){throw new n.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const l=s.scriptUsesGeometryEngine(a);l&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,a,null,!1,l);const u={vars:i.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},d=s.compileScript(a,u);let h=null;null!=r&&(h=new o(r),h.immutable=!0);const f=new o;return f.immutable=!1,f.setField("scale",0),new m(e,s,a,d,t,f,h,o)}constructor(e,t,r,i,n,s,o,a){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=i,this._spatialReference=n,this._viewDict=s,this._configDict=o,this._dictionaryCtor=a,this._dependencies=new Map,this._featureReader=new y,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const r=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:n,currentEnd:s}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=n?null!=r?i.lY.epochToArcadeDate(n,r):i.lY.unknownEpochToArcadeDate(n):void 0,currentEnd:null!=s?null!=r?i.lY.epochToArcadeDate(s,r):i.lY.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:r})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class y{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const i=t??new l.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,a.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===u.L5}field(e,t=!0){const r=this._getField(e);if(r){const t=this._boundTarget.attributes[r.name];if(null==t)return null;switch(r.type){case"date-only":case"esriFieldTypeDateOnly":return s.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return o.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return i.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?i.lY.unknownEpochToArcadeDate(t):i.lY.epochToArcadeDate(t,this.contextTimeZone??u.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},58501:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(62815);function n(e,t,r){if(!r?.features||!r.hasZ)return;const n=(0,i.N)(r.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of r.features)n(e.geometry)}},60271:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ii});var i=r(31635),n=r(65529),s=r(74887),o=r(36708),a=r(10107),l=r(44208),c=r(53966),u=(r(87811),r(40608)),d=r(5443),h=r(98988),f=r(16930),p=r(56390),m=r(61956),y=r(65494);class g{constructor(e,t,r){this.renderCommandContext=e,this.renderCommandBuffer=t,this.pipelineStateCommands=r}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const t of e)this.appendPipelineStateCommand(t)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}static create(e,t=[]){return new g(e,e.createRenderCommandBuffer(),t)}}var b=r(68197),_=r(18574),v=r(87403),w=r(28975);function x(){return new _.A({material:new w.N({color:new b.A("red")})})}var C=r(9093),S=r(51850),T=r(91829),A=r(6847),I=r(83047),P=r(58083),B=r(87317),E=r(70328),O=r(19419);r(12359),r(95108),r(27615),r(52106),r(4718),r(34275),r(65864);var M=r(37585),R=r(48163),F=r(34727),D=r(26857);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const j=[];{const e=16;for(let t=0;t<360;t+=360/e)j.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}Object.freeze({left:0,center:.5,right:1});const V=Object.freeze({"bottom-left":(0,R.fA)(0,0),bottom:(0,R.fA)(.5,0),"bottom-right":(0,R.fA)(1,0),left:(0,R.fA)(0,.5),center:(0,R.fA)(.5,.5),right:(0,R.fA)(1,.5),"top-left":(0,R.fA)(0,1),top:(0,R.fA)(.5,1),"top-right":(0,R.fA)(1,1)});var z=r(9762),k=r(27993);function L(e){const{featureCount:t}=e;if(0===t)return new Uint32Array;const r=new Uint32Array(t);return e.getObjectIdsArray(r),r}function U(e){const{featureCount:t}=e;if(0===t)return new Float64Array;const r=new Float64Array(3*t);return e.getCoordinatesArray(r),r}function q(e,t){const r=t.viewSpatialReference,i=t.renderSpatialReference,{extent:n}=e,s=(0,O.gX)(n),o=(0,S.vt)();return(0,k.F)([s[0],s[1],0],r,o,i),o}var N=r(97146);function G(e){const t=new Map;for(const[r,i]of e)t.set(r,{...i,indices:(0,N.Dg)(i.indices)});return t}var H=r(40804);r(48833);const $=(0,T.CN)(.25,.25,.75,.75);function Y(e){return"cross"===e||"x"===e}function Z(e,t=128,r=.5*t,i=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return K(e,J(r,r,t/2))}(t,r);case"square":return function(e,t){return X(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return W(e,t,!1,r)}(t,r,i);case"x":return function(e,t,r=0){return W(e,t,!0,r)}(t,r,i);case"kite":return function(e,t){return X(e,t,!0)}(t,r);case"triangle":return function(e,t){return K(e,Q(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,i=t/2,n=e/2,s=.8*r,o=J(n,(e-t)/2-s,Math.sqrt(s*s+i*i)),a=Q(n,r,i);return K(e,(e,t)=>Math.max(a(e,t),-o(e,t)))}(t,r)}}function X(e,t,r){return r&&(t/=Math.SQRT2),K(e,(i,n)=>{let s=i-.5*e+.25,o=.5*e-n-.75;if(r){const e=(s+o)/Math.SQRT2;o=(o-s)/Math.SQRT2,s=e}return Math.max(Math.abs(s),Math.abs(o))-.5*t})}function W(e,t,r,i=0){t-=i,r&&(t*=Math.SQRT2);const n=.5*t;return K(e,(t,s)=>{let o,a=t-.5*e,l=.5*e-s-1;if(r){const e=(a+l)/Math.SQRT2;l=(l-a)/Math.SQRT2,a=e}return a=Math.abs(a),l=Math.abs(l),o=a>l?a>n?Math.sqrt((a-n)*(a-n)+l*l):l:l>n?Math.sqrt(a*a+(l-n)*(l-n)):a,o-=i/2,o})}function J(e,t,r){return(i,n)=>{const s=i-e,o=n-t;return Math.sqrt(s*s+o*o)-r}}function Q(e,t,r){const i=Math.sqrt(t*t+r*r);return(n,s)=>{const o=Math.abs(n-e)-r,a=s-e+t/2+.75,l=(t*o+r*a)/i,c=-a;return Math.max(l,c)}}function K(e,t){const r=new Uint8Array(4*e*e);for(let i=0;i<e;i++)for(let n=0;n<e;n++){const s=n+e*i;let o=t(n,i);o=o/e+.5,(0,H.Un)(o,r,4*s)}return r}var ee=r(46610);class te{constructor(e,t){this._context=null,this._symbolLayer=null,this._draped=!1,this._loaded=!1,this._loadingPromise=null,this._iconTextureID=null,this._materialId=null,this._context=t,this._symbolLayer=e}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}_destroy(){this._iconTextureID=null}async _load(){const e=this._context.renderCommandContext,t=await e.createTexture(()=>function(e,t=128,r=.5*t,i=0){return{data:Z(e,t,r,i),parameters:{mipmap:!1,wrap:{s:33071,t:33071},width:t,height:t,components:4,noUnpackFlip:!0,reloadable:!0}}}("circle"));this._iconTextureID=t;const r={anchorPosition:V.center,occlusionTest:!0,hasSlicePlane:!1,color:this._getFillColor(),outlineColor:this._getOutlineColor(),outlineSize:1,distanceFieldBoundingBox:$,textureId:t,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:Y("circle")};this._materialId=await e.createMaterial({type:"hud",parameters:r}),await e.createDirectRenderer(this._materialId),this._loaded=!0}async createAddCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:i}=r;if(null==t)throw new Error("expected material not to be null");const n=await this._createGeometry(e);if(null==n)return r.createPipelineCommand();const s=q(e,r);return r.createPipelineCommand(i.addDirectRendererGeometry(e.id,n,s))}async _createGeometry(e){const{_materialId:t,_context:r}=this,{mainThreadDelegate:i}=r,{featureCount:n}=e;if(0===n||null==t)return null;const s=L(e),o=U(e),a=function(e,t){const r=e.length/3,i=t.viewSpatialReference,n=t.renderSpatialReference,s=new Float64Array(3*r);if(!(0,z.projectBuffer)(e,i,0,s,n,0,r))throw new Error("Failed to project coordinates");return s}(await i.applyElevationAlignmentTo(o),r),l=new Float64Array([0,0,1]),c=new Float64Array([255,255,255,255]),u=new Float64Array([24,24]),d=new Float64Array([0,0,0,1]),h=new Float64Array([0,0]),f=new Float64Array([0]),p=new Uint32Array(n);for(let e=0;e<n;++e)p[e]=e;const m=new Uint32Array(n);for(let e=0;e<n;++e)m[e]=0;const y=[["position",new ee.n(a,p,3,!0)],["normal",new ee.n(l,m,3,!0)],["uv0",new ee.n(h,m,2,!0)],["color",new ee.n(c,m,4,!0)],["rotation",new ee.n(f,m,1,!0)],["size",new ee.n(u,m,2,!0)],["centerOffsetAndDistance",new ee.n(d,m,4,!0)]],g=new Uint8Array(n);return e.getVisibilityArray(g),{attributes:G(y),olidColor:void 0,transformation:(0,C.vt)(),materialId:t,objectIds:s,visibilities:g}}async createRemoveCommand(e){const{_materialId:t,_context:r}=this,i=r.renderCommandContext;return null==t?r.createPipelineCommand():r.createPipelineCommand(i.removeDirectRendererGeometryBuffer(t,e))}async createUpdateVisibilityCommand(e){const{_materialId:t,_context:r}=this,i=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const n=new Uint8Array(e.featureCount);return e.getVisibilityArray(n),r.createPipelineCommand(i.updateVisibility(t,e.id,n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_materialId:r}=this,i=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(i.updateMaterial({type:"hud",materialId:r,parameters:{color:this._getFillColor(),outlineColor:this._getOutlineColor()}}))}async createUpdateElevationCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:i}=r,{featureCount:n,id:s}=e;if(null==t||0===n)return r.createPipelineCommand();const o=await this._createGeometry(e);if(null==o)return r.createPipelineCommand();const a=q(e,r);return r.createPipelineCommand(i.updateDirectRendererGeometry(s,o,a))}async createDestroyCommand(){const{_iconTextureID:e,_context:t}=this,r=t.renderCommandContext;let i;return i=null!=e?await r.releaseTexture(e):g.create(r),i.appendPipelineStateCommand(()=>this._destroy()),i}_getOutlineColor(){const e=this._getLayerOpacity(),t=this._symbolLayer,r=t?.outline?.color;if(null!=r){const t=b.A.toUnitRGB(r),i=r.a*e;return[t[0],t[1],t[2],i]}return[0,0,0,0]}_getFillColor(){if(function(e){return null!=e&&("cross"===e||"x"===e)}(this._getPrimitive()))return ie;const e=null==this._getPrimitive(),t=this._symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}_getCombinedOpacity(e,t=re){const r=this._draped?1:this._getLayerOpacity();return e?r*e.a:t.hasIntrinsicColor?r:0}_getCombinedOpacityAndColor(e,t=re){const r=this._getCombinedOpacity(e,t);return function(e,t,r=null){const i=(0,T.o8)(T.Un);return null!=e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],e.length>3&&(i[3]=e[3])),null!=t&&(i[3]=t),r&&(0,B.c)(i,i,r),i}(null!=e?b.A.toUnitRGB(e):S.Un,r)}_getPrimitive(){return e=this._symbolLayer,e.resource?.href?null:e.resource?.primitive??A.r;var e}}const re={hasIntrinsicColor:!1},ie=T.uY;class ne{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._context=null,this._symbol=null,this._symbolLayerRenderers=[],this._context=t,this._symbol=e}_destroy(){}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_context:e,_symbol:t,_symbolLayerRenderers:r}=this,i=[];for(const n of t.symbolLayers){const t=e.symbolRendererFactory.createSymbolRendererFromSymbolLayer(n);null!=t&&(i.push(t.load()),r.push(t))}await Promise.all(i),this._loaded=!0}async createDestroyCommand(){const{_context:e,_symbolLayerRenderers:t}=this,r=[];for(const e of t)r.push(e.createDestroyCommand());const i=e.joinPipelineCommands(await Promise.all(r));return i.appendPipelineStateCommand(()=>this._destroy()),i}async createAddCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createAddCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createRemoveCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createRemoveCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateVisibilityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateVisibilityCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateLayerViewOpacityCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateElevationCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateElevationCommand(e));return t.joinPipelineCommands(await Promise.all(i))}}class se{constructor(e,t){this._symbol=null,this._featureData=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_renderer:e,_context:t}=this;this._symbol=t.symbolRendererFactory.createSymbolRendererFromSymbol(e.symbol),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=await this._provisionSymbol(),i=null==r?t.createPipelineCommand():await r.createAddCommand(e);return i.appendPipelineStateCommand(()=>this._featureData.set(e.id,e)),i}async createRemoveCommand(e){const t=this._context,r=await this._provisionSymbol(),i=null==r?t.createPipelineCommand():await r.createRemoveCommand(e);return i.appendPipelineStateCommand(()=>this._featureData.delete(e)),i}async createUpdateVisibilityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateVisibilityCommand(e)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateLayerViewOpacityCommand(e)}async createUpdateElevationCommand(){const{_featureData:e,_context:t}=this,r=await this._provisionSymbol();if(null==r)return t.createPipelineCommand();const i=[];for(const t of e.values())i.push(r.createUpdateElevationCommand(t));const n=await Promise.all(i);return t.joinPipelineCommands(n)}async createDestroyCommand(){const{_symbol:e,_context:t,_featureData:r}=this;if(!e)return t.createPipelineCommand();const i=[];for(const e of r.keys())i.push(this.createRemoveCommand(e));i.push(e.createDestroyCommand());const n=await Promise.all(i);return t.joinPipelineCommands(n)}async _provisionSymbol(){const e=this._symbol;return e?(e.loaded||await e.load(),e):null}}var oe=r(48353),ae=r(30809),le=r(8887),ce=r(38954),ue=r(72385),de=(r(4197),r(11868)),he=r(27921),fe=r(71351),pe=r(73941);function me(e,t){const r=e[t],i=e[t+1],n=e[t+2];return Math.sqrt(r*r+i*i+n*n)}function ye(e,t){const r=e[t],i=e[t+1],n=e[t+2],s=1/Math.sqrt(r*r+i*i+n*n);e[t]*=s,e[t+1]*=s,e[t+2]*=s}function ge(e,t,r){e[t]*=r,e[t+1]*=r,e[t+2]*=r}r(37539),r(20498),r(49640),(0,R.vt)(),(0,R.vt)();var be=r(620);const _e=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)_e[6*e+t]=e;const ve=new Array(36);for(let e=0;e<6;e++)ve[6*e]=0,ve[6*e+1]=1,ve[6*e+2]=2,ve[6*e+3]=2,ve[6*e+4]=3,ve[6*e+5]=0;const we=(0,ue.fA)(-.5,0,-.5),xe=(0,ue.fA)(.5,0,-.5),Ce=(0,ue.fA)(0,0,.5),Se=(0,ue.fA)(0,.5,0),Te=(0,ue.vt)(),Ae=(0,ue.vt)(),Ie=(0,ue.vt)(),Pe=(0,ue.vt)(),Be=(0,ue.vt)();(0,ce.d)(Te,we,Se),(0,ce.d)(Ae,we,xe),(0,ce.h)(Ie,Te,Ae),(0,ce.n)(Ie,Ie),(0,ce.d)(Te,xe,Se),(0,ce.d)(Ae,xe,Ce),(0,ce.h)(Pe,Te,Ae),(0,ce.n)(Pe,Pe),(0,ce.d)(Te,Ce,Se),(0,ce.d)(Ae,Ce,we),(0,ce.h)(Be,Te,Ae),(0,ce.n)(Be,Be),Ie[0],Ie[1],Ie[2],Pe[0],Pe[1],Pe[2],Be[0],Be[1],Be[2],(0,S.vt)();var Ee=r(4576),Oe=r(69397);r(6867),r(87582);var Me=r(57917);function Re(e,t){const r=(e,r,i=!1)=>({levels:e.map(e=>{const n=G(r(e.tesselation));return i&&function(e){const t=e,r=t.get("position").data,i=t.get("normal").data;if(i){const t=Fe(e,"normal").data;for(let e=0;e<i.length;e+=3){const r=i[e+1];t[e+1]=-i[e+2],t[e+2]=r}}if(r){const t=Fe(e,"position").data;for(let e=0;e<r.length;e+=3){const i=r[e+1];t[e+1]=-r[e+2],t[e+2]=i}}}(n),{components:[{attributes:n,olidColor:void 0,transformation:null,materialId:t,visibilities:new Uint8Array([1]),objectIds:new Uint32Array([-1])}],minScreenSpaceRadius:e.minScreenSpaceRadius}})});switch(e){case"cone":return r(De,e=>function(e,t,r,i,n=!0,s=!0){let o=0;const a=t,l=e;let c=(0,ue.fA)(0,o,0),u=(0,ue.fA)(0,o+l,0),d=(0,ue.fA)(0,-1,0),h=(0,ue.fA)(0,1,0);i&&(o=l,u=(0,ue.fA)(0,0,0),c=(0,ue.fA)(0,o,0),d=(0,ue.fA)(0,1,0),h=(0,ue.fA)(0,-1,0));const f=[u,c],p=[d,h],m=r+2,y=Math.sqrt(l*l+a*a);if(i)for(let e=r-1;e>=0;e--){const t=e*(2*Math.PI/r),i=(0,ue.fA)(Math.cos(t)*a,o,Math.sin(t)*a);f.push(i);const n=(0,ue.fA)(l*Math.cos(t)/y,-a/y,l*Math.sin(t)/y);p.push(n)}else for(let e=0;e<r;e++){const t=e*(2*Math.PI/r),i=(0,ue.fA)(Math.cos(t)*a,o,Math.sin(t)*a);f.push(i);const n=(0,ue.fA)(l*Math.cos(t)/y,a/y,l*Math.sin(t)/y);p.push(n)}const g=new Array,b=new Array;if(n){for(let e=3;e<f.length;e++)g.push(1),g.push(e-1),g.push(e),b.push(0),b.push(0),b.push(0);g.push(f.length-1),g.push(2),g.push(1),b.push(0),b.push(0),b.push(0)}if(s){for(let e=3;e<f.length;e++)g.push(e),g.push(e-1),g.push(0),b.push(e),b.push(e-1),b.push(1);g.push(0),g.push(2),g.push(f.length-1),b.push(1),b.push(2),b.push(p.length-1)}const _=(0,de.oe)(3*m);for(let e=0;e<m;e++)_[3*e]=f[e][0],_[3*e+1]=f[e][1],_[3*e+2]=f[e][2];const v=(0,de.oe)(3*m);for(let e=0;e<m;e++)v[3*e]=p[e][0],v[3*e+1]=p[e][1],v[3*e+2]=p[e][2];return[["position",new ee.n(_,g,3,!0)],["normal",new ee.n(v,b,3,!0)]]}(1,.5,e,!1),!0);case"sphere":return r([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],e=>function(e,t,r){const i=e;let n,s;if(r)n=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],s=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const e=i*(1+Math.sqrt(5))/2;n=[-i,e,0,i,e,0,-i,-e,0,i,-e,0,0,-i,e,0,i,e,0,-i,-e,0,i,-e,e,0,-i,e,0,i,-e,0,-i,-e,0,i],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let t=0;t<n.length;t+=3)ge(n,t,e/me(n,t));let o={};function a(t,r){t>r&&([t,r]=[r,t]);const i=t.toString()+"."+r.toString();if(o[i])return o[i];let s=n.length;return n.length+=3,function(e,t,r,i,n,s=t){(n=n||e)[s]=e[t]+r[i],n[s+1]=e[t+1]+r[i+1],n[s+2]=e[t+2]+r[i+2]}(n,3*t,n,3*r,n,s),ge(n,s,e/me(n,s)),s/=3,o[i]=s,s}for(let e=0;e<t;e++){const e=s.length,t=new Array(4*e);for(let r=0;r<e;r+=3){const e=s[r],i=s[r+1],n=s[r+2],o=a(e,i),l=a(i,n),c=a(n,e),u=4*r;t[u]=e,t[u+1]=o,t[u+2]=c,t[u+3]=i,t[u+4]=l,t[u+5]=o,t[u+6]=n,t[u+7]=c,t[u+8]=l,t[u+9]=o,t[u+10]=l,t[u+11]=c}s=t,o={}}const l=(0,de.Wz)(n);for(let e=0;e<l.length;e+=3)ye(l,e);return[["position",new ee.n((0,de.Wz)(n),s,3,!0)],["normal",new ee.n(l,s,3,!0)]]}(.5,e,!0));case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function Fe(e,t){let r=e.get(t);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:(0,Me.S)(r.data)},e.set(t,r)),r}const De=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];var je=r(2495),Ve=r(74810);class ze{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._primitiveMaterialId=null,this._lodRendererId=null,this._context=null,this._symbolLayer=null,this._primitive=null,this._context=t,this._symbolLayer=e}_destroy(){this._lodRendererId=null,this._primitiveMaterialId=null}get loaded(){return this._loaded}get _isPrimitive(){return null!=this._primitive}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const e=this._context.renderCommandContext,t=this._getLayerOpacity();let r={usePBR:!0,isSchematic:!0,mrrFactors:Ve.Bt,ambient:S.Un,diffuse:S.Un,hasSlicePlane:!1,castShadows:!0,layerOpacity:t,offsetTransparentBackfaces:!1,screenSizePerspective:{}};if(r.externalColor=T.Un,r.instanced=!0,this._isPrimitive){const e=new je.fs;e.layerOpacity=t,r={...r,cullFace:ke((0,je.ty)(e))}}const i=await e.createMaterial({type:"default",parameters:r}),n=this._symbolLayer.resource;this._primitive=n&&function(e){switch(e){case"sphere":case"cube":case"diamond":case"cylinder":case"cone":case"inverted-cone":case"tetrahedron":return!0}return!1}(n?.primitive)?n.primitive:ae.r;const s=Re(this._primitive,i);this._lodRendererId=await e.createLodRenderer(s),this._primitiveMaterialId=i,this._loaded=!0}async createDestroyCommand(){const{_lodRendererId:e,_primitiveMaterialId:t,_context:r}=this,i=r.renderCommandContext,n=[];return null!=e&&n.push(i.destroyLodRenderer(e)),null!=t&&n.push(i.destroyMaterial(t)),new g(i,i.mergeRenderCommandBuffers(n),[()=>this._destroy()])}async createAddCommand(e){const t=this._context,{renderCommandContext:r,mainThreadDelegate:i}=t;if(null==this._lodRendererId)throw new Error("expected lod renderer id to not be null");const{featureCount:n}=e;if(0===n)return t.createPipelineCommand();const s=this._isPrimitive,o=this._primitive||ae.r,a=(0,E.vt)((0,le.Fq)(o)),l=(0,S.ci)((0,E.Ej)(a)),c=(0,S.ci)((0,le.Bb)(l,{isPrimitive:s,width:100,depth:null,height:null})),u=new Float64Array(16*n),d=new Float64Array(16*n),h=U(e),f=await i.applyElevationAlignmentTo(h);for(let e=0;e<n;++e){const t=e,r=f[3*e+0],i=f[3*e+1],n=f[3*e+2],s=this._computeGlobalTransform(r,i,n,this._context.viewSpatialReference,qe),o=this._computeLocalTransform(c,l,Ue);this._writeMatrixToTypedBuffer(u,t,o),this._writeMatrixToTypedBuffer(d,t,s)}const p=L(e),m=new Uint8Array(n);e.getVisibilityArray(m);const y={featureIds:new Uint32Array(p),visibility:m,localTransforms:u,globalTransforms:d};return t.createPipelineCommand(r.addLodInstances(this._lodRendererId,e.id,y))}async createRemoveCommand(e){const{_context:t,_lodRendererId:r}=this,i=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(i.removeLodInstances(r,e))}async createUpdateVisibilityCommand(e){const{_lodRendererId:t,_context:r}=this,i=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const n=new Uint8Array(e.featureCount);return e.getVisibilityArray(n),r.createPipelineCommand(i.updateVisibility(t,e.id,n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t}=this,r=t.renderCommandContext,i=this._primitiveMaterialId;if(null==i)return t.createPipelineCommand();const n=this._getLayerOpacity();let s={layerOpacity:n};if(this._isPrimitive){const e=new je.fs;e.layerOpacity=n,s={...s,cullFace:ke((0,je.ty)(e))}}return t.createPipelineCommand(r.updateMaterial({type:"default",materialId:i,parameters:s}))}async createUpdateElevationCommand(e){const{_context:t,_lodRendererId:r}=this,{renderCommandContext:i,mainThreadDelegate:n}=t,{featureCount:s,id:o}=e;if(null==r||0===s)return t.createPipelineCommand();const a=new Float64Array(16*s),l=U(e),c=await n.applyElevationAlignmentTo(l);for(let e=0;e<s;++e){const t=e,r=c[3*e+0],i=c[3*e+1],n=c[3*e+2],s=this._computeGlobalTransform(r,i,n,this._context.viewSpatialReference,qe);this._writeMatrixToTypedBuffer(a,t,s)}return t.createPipelineCommand(i.updateLodInstancesData(r,o,a))}_writeMatrixToTypedBuffer(e,t,r){let i=16*t;for(let t=0;t<16;t++)e[i++]=r[t]}_computeGlobalTransform(e,t,r,i,n){return Le[0]=e,Le[1]=t,Le[2]=r,(0,oe.l)(i,Le,n,this._context.renderSpatialReference),n}_computeLocalTransform(e,t,r){return(0,P.D_)(r),this._applyObjectScale(e,t,r),r}_applyObjectScale(e,t,r){const i=function(e=S.Un,t,r,i=1){const n=new Array(3);if(null==t||null==r)n[0]=1,n[1]=1,n[2]=1;else{let i,s=0;for(let o=2;o>=0;o--){const a=e[o],l=null!=a,c=0===o&&!i&&!l,u=r[o];let d;"symbol-value"===a||c?d=0!==u?t[o]/u:1:l&&"proportional"!==a&&isFinite(a)&&(d=0!==u?a/u:1),null!=d&&(n[o]=d,i=d,s=Math.max(s,Math.abs(d)))}for(let e=2;e>=0;e--)null==n[e]?n[e]=i:0===n[e]&&(n[e]=.001*s)}for(let e=2;e>=0;e--)n[e]/=i;return(0,S.ci)(n)}(e,e,t,this._context.renderCoordsHelper.unitInMeters);1===i[0]&&1===i[1]&&1===i[2]||(0,P.hs)(r,r,i)}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}}function ke(e){return e?0:2}const Le=(0,S.vt)(),Ue=(0,C.vt)(),qe=(0,C.vt)();class Ne{constructor(e,t){this._symbols=new Array,this._featureDataPartitioning=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){this._symbols[0]=new te(x(),this._context),this._symbols[1]=new ze(new v.A,this._context),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=this._partition(e),i=await Promise.all(r.map(async({index:e,features:t})=>{const r=await this._provisionSymbol(e);return await(r?.createAddCommand(t))})),n=t.joinPipelineCommands(i);return n.appendPipelineStateCommand(()=>this._featureDataPartitioning.set(e.id,r)),n}async createRemoveCommand(e){const{_featureDataPartitioning:t,_context:r}=this,i=r.renderCommandContext,n=t.get(e);if(null==n)return new g(i,i.createRenderCommandBuffer(),[]);const s=await Promise.all(n.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createRemoveCommand(t.id))})),o=r.joinPipelineCommands(s);return o.appendPipelineStateCommand(()=>t.delete(e)),o}async createUpdateVisibilityCommand(e){const{_featureDataPartitioning:t,_context:r}=this,i=r.renderCommandContext,n=t.get(e.id);if(null==n)return new g(i,i.createRenderCommandBuffer(),[]);const s=await Promise.all(n.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateVisibilityCommand(t))}));return r.joinPipelineCommands(s)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=[];for(let t=0;t<this._symbols.length;++t){const i=this._symbols[t];null!=i&&i.loaded&&r.push(i.createUpdateLayerViewOpacityCommand(e))}const i=await Promise.all(r);return t.joinPipelineCommands(i)}async createUpdateElevationCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.values()){const e=t.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateElevationCommand(t))});r.push(...e)}const i=await Promise.all(r);return t.joinPipelineCommands(i)}async createDestroyCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.keys())r.push(this.createRemoveCommand(t));for(const e of this._symbols)r.push(e.createDestroyCommand());const i=await Promise.all(r);return t.joinPipelineCommands(i)}async _provisionSymbol(e){if(null==e)return null;const t=this._symbols[e];return t?(t.loaded||await t.load(),t):null}_getLoadedSymbol(e){if(null==e)return null;const t=this._symbols[e];return null!=t&&t.loaded?t:null}_partition(e){const t=L(e);if(null==t)throw new Error("unable to fetch objectIds");const{featureCount:r}=e,i=[[],[]];for(let e=0;e<r;++e)i[t[e]%2].push(e);return i.map((t,r)=>new Ge(r,e.subset(new Uint32Array(t)))).filter(e=>e.features.featureCount>0)}}class Ge{constructor(e,t){this.index=e,this.features=t}}class He{constructor(e,t,r,i,n,s,o){this.viewSpatialReference=e,this.renderSpatialReference=t,this.mainThreadDelegate=r,this.renderCoordsHelper=i,this.renderCommandContext=n,this.layerInfo=s,this.layerViewInfo=o,this.symbolRendererFactory=new $e(this)}createPipelineCommand(e=this.renderCommandContext.createRenderCommandBuffer(),t=[]){return new g(this.renderCommandContext,e,t)}joinPipelineCommands(e){return 0===e.length?this.createPipelineCommand():e.filter(e=>null!=e).reduce((e,t)=>(e.append(t),e))}}class $e{constructor(e){this.context=e}createSymbolRendererFromJSON(e){const t=(0,y.L)(e??Ye)??void 0;if(!t)throw new Error("Failed to create renderer");const r=t.type;switch(r){case"simple":return new se(t,this.context);case"unique-value":return new Ne(t,this.context);default:return console.warn(`Unable to create symbolrenderer for renderer of ${r}`),this.createSymbolRendererFromJSON(Ye)}}createSymbolRendererFromSymbol(e){const t=e?.type;switch(t){case"point-3d":return new ne(e,this.context);case"picture-marker":case"simple-marker":return new te(x(),this.context);default:return console.warn(`Unable to create symbolrenderer for symbol of ${t}`),null}}createSymbolRendererFromSymbolLayer(e){const t=e.type;return"icon"===t?new te(e,this.context):(console.warn(`Unable to create symbolrenderer for symbolLayer of ${t}`),null)}}const Ye={type:"simple"};var Ze=r(65008),Xe=r(60999),We=r(32587),Je=r(96211),Qe=r(24326);function Ke(e=""){return`${e}${(0,Qe.c)()}`}new Float64Array(3);class et{constructor(e,t){this._parent=e,this._subsetIndices=t,this.id=Ke(`featureDataSubset-${e.id}-`)}get tileId(){return this._parent.tileId}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+Oe.qK+this._subsetIndices.byteLength}get isFullyEnabled(){for(const e of this._subsetIndices)if(!this._parent.getEnabled(e))return!1;return!0}getObjectId(e){return this._parent.getObjectId(this._subsetIndices[e])}getAttribute(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributeAsTimestamp(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributes(e){return this._parent.getAttributes(this._subsetIndices[e])}getCoordinates(e,t,r){return this._parent.getCoordinates(this._subsetIndices[e],t,r)}getOptimizedGeometry(e){return this._parent.getOptimizedGeometry(this._subsetIndices[e])}getCentroid(e,t){return this._parent.getCentroid(this._subsetIndices[e],t)}getBounds(e){return this._parent.getBounds(this._subsetIndices[e])}getBoundingBox(e){return this._parent.getBoundingBox(this._subsetIndices[e])}getObjectIdsArray(e,t,r){return this._parent.getObjectIdsArray(e,this._translatedIndices(t),r)}getCoordinatesArray(e,t,r){return this._parent.getCoordinatesArray(e,this._translatedIndices(t),r)}objectIds(e){return this._parent.objectIds(this._translatedIndices(e))}subset(e){const{_subsetIndices:t}=this,r=new Uint32Array(e.length);for(let i=0;i<r.length;++i)r[i]=t[e[i]];return new et(this._parent,r)}disableObjectIds(e){if(0===e.size)return;const{featureCount:t}=this,r=new Array;for(let i=0;i<t;++i)this.getEnabled(i)&&e.has(this.getObjectId(i))&&r.push(i);if(0!==r.length)for(const e of r)this.setEnabled(e,!1)}setEnabled(e,t){this._parent.setEnabled(this._subsetIndices[e],t)}getEnabled(e){return this._parent.getEnabled(this._subsetIndices[e])}enableAll(){const{_subsetIndices:e,_parent:t}=this;for(const r of e)t.setEnabled(r,!0)}getVisibilityArray(e,t,r){return this._parent.getVisibilityArray(e,this._translatedIndices(t),r)}enabledObjectIds(e){return this._parent.enabledObjectIds(this._translatedIndices(e))}*_translatedIndices(e){const{_subsetIndices:t}=this;if(null!=e)for(const r of e)yield t[r];else yield*t}}class tt{constructor(e){this._tile=e,this.id=Ke(`featureData-${e.id}-`),this._enabled=new Array(e.featureCount).fill(!0)}get tileId(){return this._tile.id}get featureCount(){return this._tile.featureCount}get usedMemory(){return Oe.qK+(0,Oe.$B)(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every(e=>e)}getObjectId(e){return this._tile.getObjectId(e)}getAttribute(e,t){return this._tile.getAttribute(e,t)}getAttributeAsTimestamp(e,t){return this._tile.getAttribute(e,t)}getAttributes(e){return this._tile.getAttributes(e)}getCoordinates(e,t,r){return this._tile.getCoordinates(e,t,r)}getOptimizedGeometry(e){return this._tile.getOptimizedGeometry(e)}getCentroid(e,t){return this._tile.getCentroid(e,t)}getBounds(e){return this._tile.getBounds(e)}getBoundingBox(e){return this._tile.getBoundingBox(e)}getObjectIdsArray(e,t,r){return this._tile.getObjectIdsArray(e,t,r)}getCoordinatesArray(e,t,r){return this._tile.getCoordinatesArray(e,t,r)}objectIds(e){return this._tile.objectIds(e)}subset(e){return new et(this,e)}disableObjectIds(e){if(0===e.size)return;const{_enabled:t}=this,r=new Array;for(const i of this._allFeatureIndices())t[i]&&e.has(this.getObjectId(i))&&r.push(i);if(0!==r.length)for(const e of r)t[e]=!1}setEnabled(e,t){this._enabled[e]=t}getEnabled(e){return this._enabled[e]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(e,t=this._allFeatureIndices(),r=0){const{_enabled:i}=this;for(const n of t)e[r++]=Number(i[n]);return r}*enabledObjectIds(e=this._allFeatureIndices()){const{_enabled:t}=this;for(const r of e)t[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}}let rt=class extends Ze.A{constructor(e){super(e),this.extent=null,this._tileHandles=new We.A,this._wanted=new We.A,this._updateRequested=!1,this._synchronizationTask=null,this._requestedTiles=new Array}destroy(){this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updateRequested||!(this._synchronizationTask?.finished??1)}get _boundingRect(){const{extent:e}=this;return null==e?null:(0,O.VY)(e)}get _missingTiles(){const e=new Array,t=this._wanted,r=this._tileHandles;for(const i of t.values())null==r.get(i.id)?.featureData&&e.push(i);return e}onTileTreeChange({tiles:e}){this._requestedTiles=e,this._scheduleTilesSync()}_scheduleTilesSync(){if(this._updateRequested)return;this._updateRequested=!0;const e=this._synchronizationTask,t=(0,Xe.UT)(async()=>{try{await(0,o.C_)(()=>e?.finished??!0),await(0,Je.NO)(),this._updateRequested=!1,await this._synchronizeTiles()}finally{this._synchronizationTask===t&&(this._synchronizationTask=null)}});this._synchronizationTask=t}async _synchronizeTiles(){const e=this._requestedTiles,t=this._tileHandles,r=new Array;for(const i of e)t.has(i.id)||r.push(i);const i=new Array;for(const r of t.values()){const{id:t}=r;e.every(e=>e.id!==t)&&i.push(r.descriptor)}const n=this._tileHandles,{_boundingRect:s}=this,o=null!=s?r.filter(e=>!e.extent||(0,O.HY)(s,e.extent)):r,a=this._wanted,l=new Array;for(const{id:e}of i)a.delete(e);for(const e of o)a.set(e.id,e);const c=this._missingTiles;for(const e of i){const{id:t}=e;if(c.some(t=>it(t,e)||it(e,t)))continue;const r=n.get(t);null!=r&&l.push(this._removeTile(r))}for(const e of o)l.push(this._addTile(e));const u=await Promise.allSettled(l);for(const e of u)"rejected"===e.status&&console.error(e.reason)}forEachTile(e){for(const t of this._tileHandles.values()){const r=t.featureData;null!=r&&e(r)}}*loadedTiles(){for(const e of this._tileHandles.values()){const t=e.featureData;null!=t&&(yield t)}}async _removeTile(e){e.loadTask.abort(),this._tileHandles.delete(e.id),this._validate();const{featureData:t}=e;if(null!=t){const e={stack:[],error:void 0,hasError:!1};try{(0,i.mS)(e,await this.tileLocks.lock([t.tileId]),!1);const r=await this.createRemoveCommand(t.id);await(r?.execute())}catch(t){e.error=t,e.hasError=!0}finally{(0,i.hk)(e)}}}async _addTile(e){const{_tileHandles:t}=this,r=t.get(e.id);if(null!=r){if(!st(r)||r.featureData.isFullyEnabled)return;return r.featureData.enableAll(),void await this._onTileLoad(r)}const i=new nt(e,(0,Xe.UT)(async t=>{const r=await this.loadTile(e,t);return(0,s.Te)(t),new tt(r)}));this._tileHandles.set(i.id,i);try{await i.loadTask.promise}catch(e){return void(0,s.jH)(e)}(function(e){if(!st(e))throw new Error})(i),await this._onTileLoad(i)}async _onTileLoad(e){const t={stack:[],error:void 0,hasError:!1};try{const{_wanted:r,_tileHandles:n,_missingTiles:s}=this,o=e.descriptor,a=new Array,l=new Array,c=new Array,u=new Set;for(const t of n.values()){if(t===e)continue;const{descriptor:i,id:c}=t;if(!r.has(c)&&!s.some(e=>it(e,i)||it(i,e))){n.delete(c),t.loadTask.abort();const{featureData:e}=t;null!=e&&a.push(e);continue}if(st(t)){if(it(o,i)){const e=t.featureData;for(const t of e.objectIds())u.add(t)}if(it(i,o)){const{featureData:e}=t;l.push(e)}}}u.size>0&&(e.featureData.disableObjectIds(u),this._validateRemoval(e.featureData,u)),this._validate(),c.push(e.featureData);const d=[...c,...a,...l].map(e=>e.tileId);if((0,i.mS)(t,await this.tileLocks.lock(d),!1),0!==l.length){const t=e.featureData,r=new Set(t.objectIds());for(const e of l)e.disableObjectIds(r),this._validateRemoval(e,r)}const h=a.map(e=>this.createRemoveCommand(e.id)),f=c.map(e=>this.createAddCommand(e)),p=l.map(e=>this.createUpdateCommand(e)),m=function(e){return 0===e.length?null:e.reduce((e,t)=>(e.append(t),e))}((await Promise.all([...h,...f,...p])).filter(Ee.Ru));await(m?.execute())}catch(e){t.error=e,t.hasError=!0}finally{(0,i.hk)(t)}}_validate(){if(!(0,l.A)("feature-pipeline-3d-test-validation"))return;const e=new Array;for(const t of this._tileHandles.values()){if(!st(t))continue;const{featureData:r}=t;e.push({featureData:r,objectIds:new Set(r.enabledObjectIds())})}for(let t=0;t<e.length;++t){const{featureData:r,objectIds:i}=e[t];for(let n=t+1;n<e.length;++n){const{featureData:t,objectIds:s}=e[n];for(const e of s)if(i.has(e))throw new Error(`${r.id} and ${t.id} both contain ${e}.`)}}}_validateRemoval(e,t){if((0,l.A)("feature-pipeline-3d-test-validation"))for(const r of e.enabledObjectIds())if(t.has(r))throw new Error(`Failed to remove ${r} from ${e.id}!`)}};function it({lij:[e,t,r]},{lij:[i,n,s]}){const o=i-e;return o>=0&&t===n>>o&&r===s>>o}(0,i.Cg)([(0,a.MZ)()],rt.prototype,"updating",null),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"loadTile",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"createAddCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"createRemoveCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"createUpdateCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],rt.prototype,"tileLocks",void 0),(0,i.Cg)([(0,a.MZ)()],rt.prototype,"extent",void 0),(0,i.Cg)([(0,a.MZ)()],rt.prototype,"_boundingRect",null),(0,i.Cg)([(0,a.MZ)()],rt.prototype,"_missingTiles",null),(0,i.Cg)([(0,a.MZ)()],rt.prototype,"_updateRequested",void 0),(0,i.Cg)([(0,a.MZ)()],rt.prototype,"_synchronizationTask",void 0),rt=(0,i.Cg)([(0,u.$)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],rt);class nt{constructor(e,t){this.descriptor=e,this.loadTask=t}get id(){return this.descriptor.id}get featureData(){return this.loadTask.value}}function st(e){return null!=e.featureData}var ot=r(36563);class at{constructor(){this._previousActions=new Map}async lock(e){const{_previousActions:t}=this,r=e.map(e=>t.get(e)).filter(Ee.Ru),i=Promise.allSettled(r),n=(0,s.Tw)(),o=(0,ot.hA)(()=>n.resolve()),a=n.promise.finally(()=>{for(const r of e)t.get(r)===a&&t.delete(r)});for(const r of e)t.set(r,a);return await i,(0,ot.Bf)(o)}}var lt=r(75503),ct=r(27647),ut=r(92722);class dt{constructor(e,t){this._index=e,this._view=t}get usedMemory(){return Oe.qK+Oe.RS}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new ht(this._index,this._view,e)}}class ht extends dt{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,ct.Q)(new ut.A,this._geometryOverride,e.hasZ,e.hasM)}}class ft{constructor(e,t){this.featureData=e,this.bounds=t}}class pt{constructor(){this._tileBounds=new Map,this.events=new n.bk,this.featureAdapter=mt.shared}get usedMemory(){return Oe.qK+Oe.qK*this._tileBounds.size}addTile(e){const{featureCount:t}=e;if(0===t)return;const r=new lt.wq(9,t=>e.getBounds(t)),i=new Array;for(let e=0;e<t;++e)i[e]=e;r.load(i),this._tileBounds.set(e.id,new ft(e,r)),this.events.emit("changed")}removeTile(e){this._tileBounds.delete(e),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(e){for(const{featureData:t,bounds:r}of this._tileBounds.values())r.all(r=>{t.getEnabled(r)&&e(new dt(r,t))})}forEachInBounds(e,t){yt.minX=e[0],yt.minY=e[1],yt.maxX=e[2],yt.maxY=e[3];for(const{featureData:e,bounds:r}of this._tileBounds.values())r.search(yt,r=>{e.getEnabled(r)&&t(new dt(r,e))})}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(const{bounds:e}of this._tileBounds.values()){const{minX:s,minY:o,maxX:a,maxY:l}=e.toJSON();t=Math.min(t,s),r=Math.min(r,o),i=Math.min(i,a),n=Math.min(n,l)}return{xmin:t,ymin:r,xmax:i,ymax:n,spatialReference:e}}}class mt{static{this.shared=new mt}getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t){return e.cloneWithGeometry(t)}}const yt=new lt.EC;var gt=r(80893);class bt{constructor(e,t,r){this.descriptor=e,this._pages=t,this._pageSize=r;const i=Oe.ez+t.reduce((e,{usedMemory:t})=>e+t,0),n=3*Oe.RS;this.usedMemory=Oe.qK+i+n,this.featureCount=t.reduce((e,t)=>e+t.featureCount,0)}get id(){return this.descriptor.id}getObjectId(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getObjectId(r)}getAttribute(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getAttribute(i,t)}getAttributeAsTimestamp(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getAttributeAsTimestamp(i,t)}getAttributes(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getAttributes(r)}getCoordinates(e,t,r){const{pageIndex:i,featurePageIndex:n}=this._translateIndex(e);this._pages[i].getCoordinates(n,t,r)}getOptimizedGeometry(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getOptimizedGeometry(r)}getCentroid(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getCentroid(i,t)}getBounds(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBounds(r)}getBoundingBox(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBoundingBox(r)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){let i=r;for(const{page:r,indices:n}of this._batchPageIndices(t))i=r.getObjectIdsArray(e,n,i);return i}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){let i=r;for(const{page:r,indices:n}of this._batchPageIndices(t))i=r.getCoordinatesArray(e,n,i);return i}*objectIds(e=this._allFeatureIndices()){for(const{page:t,indices:r}of this._batchPageIndices(e))for(const e of t.objectIds(r))yield e}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_translateIndex(e){const{_pageSize:t}=this;return{pageIndex:Math.floor(e/t),featurePageIndex:e%t}}*_batchPageIndices(e){const t=new Array;{let r=0,i=new Array;for(const n of e){const{pageIndex:e,featurePageIndex:s}=this._translateIndex(n);r!==e&&(0!==i.length&&t.push({pageIndex:r,indices:i}),r=e,i=[]),i.push(s)}0!==i.length&&t.push({pageIndex:r,indices:i})}const{_pages:r}=this;for(const{pageIndex:e,indices:i}of t)yield{page:r[e],indices:i}}}var _t=r(49186),vt=r(51624),wt=r(62577),xt=r(95466),Ct=r(53655);class St{constructor(e){this._reader=new vt.A(new Uint8Array(e),new DataView(e)),this._index=function(e){for(;e.next();){if(2===e.tag())return Tt(e.getMessage());e.skip()}It()}(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:i}}=this,n=r.get(t)?.index;if(null==n)return;const s=i[e*r.fields.length+n],o=this._reader;return o.move(s),Pt(o)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,i=e*t.fields.length,n=this._reader,s={};for(const e of t.fields){const t=r[i+e.index];n.move(t),s[e.name]=Pt(n)}return s}getCoordinates(e,t,r=0){const i=this._reader,{transform:n,featureIndices:s}=this._index,{scale:o,translate:a}=n;i.move(s[e]),this._readCoordinates(o,a,t,r)}getOptimizedGeometry(e){const t=(0,S.vt)();return this.getCoordinates(e,t),new ut.A([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,Bt);const[i,n,s]=Bt,o=[i,n];return t&&(o[3]=s),r&&(o[t?4:3]=0),new ut.A([],o)}getBounds(e){this.getCoordinates(e,Bt);const[t,r]=Bt,i=new lt.EC;return i.minX=t,i.minY=r,i.maxX=t,i.maxY=r,i}getBoundingBox(e){this.getCoordinates(e,Bt);const[t,r,i]=Bt;return(0,E.fA)(t,r,i,t,r,i)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const i=this._reader,{objectIdFieldName:n,attributeIndices:s,fieldsIndex:o}=this._index,a=o.get(n).index,l=o.fields.length;for(const n of t){const t=s[n*l+a];i.move(t),e[r++]=Pt(i)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const i=this._reader,{transform:n,featureIndices:s}=this._index,{scale:o,translate:a}=n;for(const n of t){const t=s[n];i.move(t),r=this._readCoordinates(o,a,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:i,fieldsIndex:n}=this._index,s=n.get(r).index,o=n.fields.length;for(const r of e){const e=i[r*o+s];t.move(e),yield Pt(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[i,n,s],o,a){const l=this._reader,c=l.getLength(),u=l.pos()+c;for(;l.pos()<u&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),u=l.pos()+c;for(;l.pos()<u&&l.next();)3===l.tag()?(l.getUInt32(),o[a++]=i+e*l.getSInt64(),o[a++]=n+t*l.getSInt64(),o[a++]=s+r*l.getSInt64()):l.skip();break}default:l.skip()}return a}}function Tt(e){for(;e.next();){if(1===e.tag())return At(e.getMessage());e.skip()}It()}function At(e){let t,r,i=!1,n=!1,s=0;const o=new Array,a=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&It();break;case 9:i=e.getBool()??!1;break;case 12:t=(0,wt.Q1)(e.processMessage(Ct.ae));break;case 13:{const t=e.processMessage(Ct.cn);t.index=s++,o.push(t);break}case 15:{a.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:n=e.getBool()??!1;break;default:e.skip()}const c=new xt.A(o);return null!=t&&n&&null!=r&&c.has(r)||It(),{transform:t,exceededTransferLimit:i,fieldsIndex:c,objectIdFieldName:r,featureIndices:a,attributeIndices:l}}function It(){const e=new _t.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function Pt(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}const Bt=(0,S.vt)();class Et{constructor(e,t,r,i,n){this.spatialReference=e,this.url=r,this.objectIdField=i,this.capabilities=n;const{supportsMaxRecordCountFactor:s,maxRecordCount:o}=this.capabilities.query,a=s?4:1,l=(o??8e3)*a;this._pageSize=Math.min(8e3,l);const c=t.clone();c.cacheHint=!0,c.resultType="tile",c.outSpatialReference=e,c.returnGeometry=!0,c.returnZ=!0,c.maxRecordCountFactor=a,c.num=this._pageSize,c.outFields=[i],this._baseQuery=c}async fetch(e,t){const{spatialReference:r,_pageSize:i}=this,n=(0,O.w1)(e.extent,r),o=this._baseQuery.clone();o.geometry=n;const a=new Array;let l=0,c=!1,u=1;for(;!c;){const e=[];for(let r=0;r<u;++r)e.push(this._fetchPage(o,l++,t));const r=await Promise.all(e);(0,s.Te)(t);for(const e of r){const t=0!==e.featureCount;c||=!e.exceededTransferLimit||!t,t&&a.push(e)}u=Math.min(u+1,4)}return new bt(e,a,i)}async _fetchPage(e,t,r){const i=e.clone();i.start=t*this._pageSize;const n=(await(0,gt.kS)(this.url,i,{signal:r})).data;return(0,s.Te)(r),new St(n)}}var Ot=r(29920),Mt=r(77690),Rt=r(29242);var Ft=r(13030),Dt=r(78662),jt=r(49255),Vt=r(40268),zt=r(16943),kt=r(25634),Lt=r(11725),Ut=r(77194),qt=r(59907),Nt=r(43616),Gt=r(13259),Ht=r(1843),$t=r(97220),Yt=r(98958),Zt=r(33524),Xt=r(63907),Wt=r(90644);class Jt extends Yt.w{constructor(e,t){super(e,t,new $t.$(Gt.H,()=>r.e(8241).then(r.bind(r,48241))),((0,zt.E)()?er:Kt).locations),this.primitiveType=t.occlusionPass?Xt.WR.POINTS:Xt.WR.TRIANGLES}initializePipeline(e){const{oitPass:t,hasPolygonOffset:r,draped:i,output:n,depthTestEnabled:s,occlusionPass:o}=e,a=0===t,l=s&&!i&&!(1===t)&&!o&&!(9===n);return(0,Wt.Ey)({blending:(0,jt.RN)(n)?a?Wt.RC:(0,Zt.ez)(t):null,depthTest:s&&!i?{func:515}:null,depthWrite:l?Wt.Uy:null,drawBuffers:(0,Zt.m6)(t,n),colorWrite:Wt.kn,polygonOffset:r?Qt:null})}}const Qt={factor:0,units:-4},Kt=(0,Ht.BP)().vec3f("position").vec3f("normal").vec2i16("uvi").vec4u8("color").vec2f("size").f32("rotation").vec4f("centerOffsetAndDistance").vec4f("featureAttribute"),er=Kt.clone().vec4u8("olidColor");var tr=r(51976),rr=r(35256);class ir extends rr.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!0,this.isFocused=!0,this.olidColorInstanced=!1,this.textureCoordinateType=0,this.emissionSource=0,this.discardInvisibleFragments=!0,this.hasVVInstancing=!1,this.snowCover=!1}}(0,i.Cg)([(0,tr.W)()],ir.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"occlusionTestEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"signedDistanceFieldEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasVVSize",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasVVColor",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasVerticalOffset",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasScreenSizePerspective",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasRotation",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"debugDrawLabelBorder",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"hasPolygonOffset",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"depthTestEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"pixelSnappingEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"draped",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"terrainDepthTest",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"cullAboveTerrain",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"occlusionPass",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"occludedFragmentFade",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"horizonCullingEnabled",void 0),(0,i.Cg)([(0,tr.W)()],ir.prototype,"isFocused",void 0);var nr=r(49788);class sr extends Lt.i{constructor(e,t){super(e,Br),this.produces=new Map([[13,e=>(0,jt.Mb)(e)&&!this.parameters.drawAsLabel],[14,e=>(0,jt.Mb)(e)&&this.parameters.drawAsLabel],[12,()=>this.parameters.occlusionTest],[18,e=>this.parameters.draped&&(0,jt.Mb)(e)]]),this._visible=!0,this._configuration=new ir(t)}getConfiguration(e,t){const r=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=r,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.hasVVSize=!!this.parameters.vvSize,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.occlusionPass=12===t.slot,this._configuration.occludedFragmentFade=!r&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||12===t.slot,(0,jt.RN)(e)&&(this._configuration.debugDrawLabelBorder=!!D.b.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,r,i,n,s){const{options:{selectionMode:o,hud:a,excludeLabels:l},point:c,camera:u}=r,{parameters:d}=this;if(!o||!a||l&&d.isLabel||!e.visible||!c||!u)return;const h=e.attributes.get("featureAttribute"),f=null==h?null:(0,T.ci)(h.data,Cr),{scaleX:p,scaleY:m}=Or(f,d,u.pixelRatio);(0,Mt.z0)(gr,t),e.attributes.has("featureAttribute")&&function(e){const t=e[0],r=e[1],i=e[2],n=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],u=1/Math.sqrt(t*t+r*r+i*i),d=1/Math.sqrt(n*n+s*s+o*o),h=1/Math.sqrt(a*a+l*l+c*c);e[0]=t*u,e[1]=r*u,e[2]=i*u,e[3]=n*d,e[4]=s*d,e[5]=o*d,e[6]=a*h,e[7]=l*h,e[8]=c*h}(gr);const y=e.attributes.get("position"),g=e.attributes.get("size"),b=e.attributes.get("normal"),_=e.attributes.get("rotation"),v=e.attributes.get("centerOffsetAndDistance");(0,be.vA)(y.size>=3);const w=(0,Gt.c)(d),x="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<y.data.length/y.size;e++){const i=e*y.size;(0,ce.i)(ur,y.data[i],y.data[i+1],y.data[i+2]),(0,ce.t)(ur,ur,t),(0,ce.t)(ur,ur,u.viewMatrix);const n=e*v.size;if((0,ce.i)(wr,v.data[n],v.data[n+1],v.data[n+2]),!x&&(ur[0]+=wr[0],ur[1]+=wr[1],0!==wr[2])){const e=wr[2];(0,ce.n)(wr,ur),(0,ce.d)(ur,ur,(0,ce.g)(wr,wr,e))}const o=e*b.size;if((0,ce.i)(dr,b.data[o],b.data[o+1],b.data[o+2]),ar(dr,gr,u,Sr),Mr(this.parameters,ur,Sr,u,cr),u.applyProjection(ur,hr),hr[0]>-1){x&&(wr[0]||wr[1])&&(hr[0]+=wr[0]*u.pixelRatio,0!==wr[1]&&(hr[1]+=cr.alignmentEvaluator.apply(wr[1])*u.pixelRatio),u.unapplyProjection(hr,ur)),hr[0]+=this.parameters.screenOffset[0]*u.pixelRatio,hr[1]+=this.parameters.screenOffset[1]*u.pixelRatio,hr[0]=Math.floor(hr[0]),hr[1]=Math.floor(hr[1]);const t=e*g.size;Ir[0]=g.data[t],Ir[1]=g.data[t+1],cr.evaluator.applyVec2(Ir,Ir);const i=Tr*u.pixelRatio;let n=0;d.textureIsSignedDistanceField&&(n=Math.min(d.outlineSize,.5*Ir[0])*u.pixelRatio/2),Ir[0]*=p,Ir[1]*=m;const o=e*_.size,a=d.rotation+_.data[o];if(lr(c,hr[0],hr[1],Ir,i,n,a,d,w)){const e=r.ray;if((0,ce.t)(pr,ur,(0,P.B8)(_r,u.viewMatrix)),hr[0]=c[0],hr[1]=c[1],u.unprojectFromRenderScreen(hr,ur)){const t=(0,S.vt)();(0,ce.c)(t,e.direction);const r=1/(0,ce.l)(t);(0,ce.g)(t,t,r),s((0,ce.j)(e.origin,ur)*r,t,-1,pr)}}}}}intersectDraped(e,t,r,i,n){const s=e.attributes.get("position"),o=e.attributes.get("size"),a=e.attributes.get("rotation"),l=this.parameters,c=(0,Gt.c)(l),u=e.attributes.get("featureAttribute"),d=null==u?null:(0,T.ci)(u.data,Cr),{scaleX:h,scaleY:f}=Or(d,l,e.screenToWorldRatio),p=Ar*e.screenToWorldRatio;for(let t=0;t<s.data.length/s.size;t++){const u=t*s.size,d=s.data[u],m=s.data[u+1],y=t*o.size;Ir[0]=o.data[y],Ir[1]=o.data[y+1];let g=0;l.textureIsSignedDistanceField&&(g=Math.min(l.outlineSize,.5*Ir[0])*e.screenToWorldRatio/2),Ir[0]*=h,Ir[1]*=f;const b=t*a.size,_=l.rotation+a.data[b];lr(r,d,m,Ir,p,g,_,l,c)&&i(n.distance,n.normal,-1)}}createBufferWriter(){return new Er}applyShaderOffsetsView(e,t,r,i,n,s,o){const a=ar(t,r,n,Sr);return this._applyVerticalGroundOffsetView(e,a,n,o),Mr(this.parameters,o,a,n,s),this._applyPolygonOffsetView(o,a,i[3],n,o),this._applyCenterOffsetView(o,i,o),o}applyShaderOffsetsNDC(e,t,r,i,n){return this._applyCenterOffsetNDC(e,t,r,i),null!=n&&(0,ce.c)(n,i),this._applyPolygonOffsetNDC(i,t,r,i),i}_applyPolygonOffsetView(e,t,r,i,n){const s=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=s);const a=s*o;if(this.parameters.shaderPolygonOffset<=0)return(0,ce.c)(n,e);const l=(0,F.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/i.viewport[2];return(0,ce.g)(n,e,a>0?c:1/c),n}_applyVerticalGroundOffsetView(e,t,r,i){const n=(0,ce.l)(e),s=r.aboveGround?1:-1,o=r.computeRenderPixelSizeAtDist(n)*Vt.R,a=(0,ce.g)(ur,t.normal,s*o);return(0,ce.f)(i,e,a),i}_applyCenterOffsetView(e,t,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,ce.c)(r,e),i&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,ce.n)(dr,r),(0,ce.a)(r,r,(0,ce.g)(dr,dr,t[2])))),r}_applyCenterOffsetNDC(e,t,r,i){const n="screen"!==this.parameters.centerOffsetUnits;return i!==e&&(0,ce.c)(i,e),n||(i[0]+=t[0]/r.fullWidth*2,i[1]+=t[1]/r.fullHeight*2),i}_applyPolygonOffsetNDC(e,t,r,i){const n=this.parameters.shaderPolygonOffset;if(e!==i&&(0,ce.c)(i,e),n){const e=r.aboveGround?1:-1,s=e*Math.sign(t[3]);i[2]-=(s||e)*n}return i}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,i=e[3]>=nr.Q||t>=nr.Q&&r[3]>=nr.Q;return this._visible&&i}createGLMaterial(e){return new or(e)}calculateRelativeScreenBounds(e,t,r=(0,O.vt)()){return function(e,t,r,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class or extends kt.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(Jt,e)}}function ar(e,t,r,i){return function(e){return(t=e)instanceof Float32Array&&t.length>=16||function(e){return Array.isArray(e)&&e.length>=16}(e);var t}(t)&&(t=(0,Mt.z0)(br,t)),(0,ce.o)(i.normal,e,t),(0,ce.t)(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=(0,ce.e)(fr,Pr),i}function lr(e,t,r,i,n,s,o,a,l){let c=t-n-i[0]*l[0],u=c+i[0]+2*n,d=r-n-i[1]*l[1],h=d+i[1]+2*n;const f=a.distanceFieldBoundingBox;return a.textureIsSignedDistanceField&&null!=f&&(c+=i[0]*f[0],d+=i[1]*f[1],u-=i[0]*(1-f[2]),h-=i[1]*(1-f[3]),c-=s,u+=s,d-=s,h+=s),(0,M.hZ)(yr,t,r),(0,M.e$)(mr,e,yr,(0,F.kU)(o)),mr[0]>c&&mr[0]<u&&mr[1]>d&&mr[1]<h}const cr=new Ut.fc,ur=(0,S.vt)(),dr=(0,S.vt)(),hr=(0,T.vt)(),fr=(0,S.vt)(),pr=(0,S.vt)(),mr=(0,R.vt)(),yr=(0,R.vt)(),gr=(0,Rt.vt)(),br=(0,Rt.vt)(),_r=(0,C.vt)(),vr=(0,T.vt)(),wr=(0,S.vt)(),xr=(0,S.vt)(),Cr=(0,T.vt)(),Sr={normal:fr,cosAngle:0},Tr=1,Ar=2,Ir=(0,R.fA)(0,0),Pr=(0,S.fA)(0,0,1);class Br extends kt.NV{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1,this.color=(0,T.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,R.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,T.CN)(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=(0,T.vt)(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Er{constructor(){this.layout=(0,zt.E)()?er:Kt}elementCount(e){return 6*e.get("position").indices.length}write(e,t,r,i,n,s){const{position:o,normal:a,uvi:l,color:c,size:u,rotation:d,centerOffsetAndDistance:h,featureAttribute:f}=n;(0,qt.Hk)(r.get("position"),e,o,s,6),(0,qt.p1)(r.get("normal"),t,a,s,6);const p=r.get("uvi")?.data;let m=0,y=0,g=-1-Gt.f,b=-1-Gt.f;p&&p.length>=4&&(m=p[0],y=p[1],g=-1-p[2],b=-1-p[3]);let _=r.get("position").indices.length,v=s;for(let e=0;e<_;++e)l.set(v,0,m),l.set(v,1,y),v++,l.set(v,0,g),l.set(v,1,y),v++,l.set(v,0,g),l.set(v,1,b),v++,l.set(v,0,g),l.set(v,1,b),v++,l.set(v,0,m),l.set(v,1,b),v++,l.set(v,0,m),l.set(v,1,y),v++;(0,qt.tb)(r.get("color"),4,c,s,6);const{data:w,indices:x}=r.get("size");_=x.length,v=s;for(let e=0;e<_;++e){const t=w[2*x[e]],r=w[2*x[e]+1];for(let e=0;e<6;++e)u.set(v,0,t),u.set(v,1,r),v++}if((0,qt.uO)(r.get("rotation"),d,s,6),r.get("centerOffsetAndDistance")?(0,qt.Ut)(r.get("centerOffsetAndDistance"),h,s,6):(0,qt.Pq)(h,s,6*_),r.get("featureAttribute")?(0,qt.Ut)(r.get("featureAttribute"),f,s,6):(0,qt.Pq)(f,s,6*_),null!=i){const e=r.get("position")?.indices;if(e){const t=e.length,r=n.getField("olidColor",Ft.XP);(0,qt.vx)(i,r,t,s,6)}}return{numVerticesPerItem:6,numItems:_}}intersect(e,t,r,i,n,s,o){const{options:{selectionMode:a,hud:l,excludeLabels:c},point:u,camera:d}=i;if(!a||!l||c&&t.isLabel||!u)return;const h=this.layout.createView(e),f=h.getField("position",Ft.xs),p=h.getField("normal",Ft.xs),m=h.getField("rotation",Ft.Y$),y=h.getField("size",Ft.gH),g=h.getField("featureAttribute",Ft.Eq),b=h.getField("centerOffsetAndDistance",Ft.Eq),_="screen"===t.centerOffsetUnits,v=(0,Gt.c)(t);if(null==f||null==p||null==m||null==y||null==b||null==d)return;const w=null==g?null:g.getVec(0,Cr),{scaleX:x,scaleY:C}=Or(w,t,d.pixelRatio),T=f.count/6;for(let e=0;e<T;e++){const n=6*e;if(f.getVec(n,ur),null!=r&&(0,ce.f)(ur,ur,r),(0,ce.t)(ur,ur,d.viewMatrix),b.getVec(n,vr),(0,ce.i)(wr,vr[0],vr[1],vr[2]),!_&&(ur[0]+=wr[0],ur[1]+=wr[1],0!==wr[2])){const e=wr[2];(0,ce.n)(wr,ur),(0,ce.d)(ur,ur,(0,ce.g)(wr,wr,e))}if(p.getVec(n,dr),ar(dr,gr,d,Sr),Mr(t,ur,Sr,d,cr),d.applyProjection(ur,hr),hr[0]>-1){_&&(wr[0]||wr[1])&&(hr[0]+=wr[0]*d.pixelRatio,0!==wr[1]&&(hr[1]+=cr.alignmentEvaluator.apply(wr[1])*d.pixelRatio),d.unapplyProjection(hr,ur)),hr[0]+=t.screenOffset[0]*d.pixelRatio,hr[1]+=t.screenOffset[1]*d.pixelRatio,hr[0]=Math.floor(hr[0]),hr[1]=Math.floor(hr[1]),y.getVec(n,Ir),cr.evaluator.applyVec2(Ir,Ir);const r=Tr*d.pixelRatio;let s=0;t.textureIsSignedDistanceField&&(s=Math.min(t.outlineSize,.5*Ir[0])*d.pixelRatio/2),Ir[0]*=x,Ir[1]*=C;const a=m.get(n),l=t.rotation+a;if(lr(u,hr[0],hr[1],Ir,r,s,l,t,v)){const t=i.ray;if((0,ce.t)(pr,ur,(0,P.B8)(_r,d.viewMatrix)),hr[0]=u[0],hr[1]=u[1],d.unprojectFromRenderScreen(hr,ur)){const r=(0,S.vt)();(0,ce.c)(r,t.direction);const i=1/(0,ce.l)(r);(0,ce.g)(r,r,i),o((0,ce.j)(t.origin,ur)*i,r,e,pr)}}}}}}function Or(e,t,r){return null==e||null==t.vvSize?{scaleX:r,scaleY:r}:((0,Dt.VC)(xr,t,e),{scaleX:xr[0]*r,scaleY:xr[1]*r})}function Mr(e,t,r,i,n){if(!e.verticalOffset?.screenLength){const i=(0,ce.l)(t);return n.update(r.cosAngle,i,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),t}const s=(0,ce.l)(t),o=e.screenSizePerspectiveAlignment??e.screenSizePerspective,a=(0,Nt.kE)(i,s,e.verticalOffset,r.cosAngle,o,e.screenSizePerspectiveMinPixelReferenceSize);return n.update(r.cosAngle,s,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),(0,ce.g)(r.normal,r.normal,a),(0,ce.f)(t,t,r.normal)}class Rr{constructor(e,t){this._mainThreadDelegate=t,this._bufferWriters=new Map,this.globalViewingMode=1===e}createRenderCommandBuffer(e=[],t=[]){return{commands:e,transferList:t}}mergeRenderCommandBuffers(e){const t=this.createRenderCommandBuffer();for(const r of e)null!=r&&(t.commands.push(...r.commands),t.transferList.push(...r.transferList));return t}async createTexture(e){const{data:t,parameters:r}=e();return await this._mainThreadDelegate.createTexture(t,r)}async releaseTexture(e){const t=this._destroyTexture(e);return new g(this,t,[])}_destroyTexture(e){return{commands:[{id:"destroy-texture",textureId:e}],transferList:[]}}async createMaterial(e){const{type:t,parameters:r}=e,i=Ke("material");let n,s;switch(t){case"default":n=new je.$U(e.parameters,{spherical:this.globalViewingMode}),s={type:t,materialId:i,parameters:e.parameters};break;case"hud":n=new sr(r,this.globalViewingMode),s={type:t,materialId:i,parameters:e.parameters}}return this._bufferWriters.set(i,n.createBufferWriter()),await this._mainThreadDelegate.createMaterial(s),i}destroyMaterial(e){return{commands:[{id:"destroy-material",materialId:e}],transferList:[]}}updateMaterial(e){return{commands:[{...e,id:"update-material"}],transferList:[]}}async createDirectRenderer(e){return await this._mainThreadDelegate.createDirectRenderer(e),e}async destroyDirectRenderer(e){await this._mainThreadDelegate.destroyDirectRenderer(e)}addDirectRendererGeometry(e,t,r){const{materialId:i}=t;if(null==this._bufferWriters.get(i))throw new Error(`no bufferwriter found for material ${i}`);const{renderGeometryBuffer:n,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.addDirectRendererGeometryBuffer(i,e,n,s,r)}updateDirectRendererGeometry(e,t,r){const{materialId:i}=t;if(null==this._bufferWriters.get(i))throw new Error(`no bufferwriter found for material ${i}`);const{renderGeometryBuffer:n,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.updateDirectRendererGeometryBuffer(i,e,n,s,r)}addDirectRendererGeometryBuffer(e,t,r,i,n){const{objectIds:s,visibilities:o}=i;return{commands:[{id:"add-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:i,localOrigin:n}],transferList:[r.data,s.buffer,o.buffer]}}updateDirectRendererGeometryBuffer(e,t,r,i,n){const{objectIds:s,visibilities:o}=i;return{commands:[{id:"update-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:i,localOrigin:n}],transferList:[r.data,s.buffer,o.buffer]}}removeDirectRendererGeometryBuffer(e,t){return{commands:[{id:"remove-direct-renderer-geometry-buffer",rendererId:e,groupId:t}],transferList:[]}}async createLodRenderer(e){const t=Ke("lod-renderer"),r=new Set,i={levels:e.levels.map(e=>({components:e.components.map(e=>{const t=e.attributes.get("position");if(!t||0===t.indices.length)throw new Error("positions attribute expected");const i=(0,N.tM)(t.indices.length/3),n=new Ot.j(i,3,t);if(null==this._bufferWriters.get(e.materialId))throw new Error("writer not found");const{renderGeometryBuffer:s}=this.createRenderGeometryBuffer(e,null);return r.add(s.data),{materialId:e.materialId,renderGeometryBuffer:s,boundingInfo:{bbMax:n.bbMax,bbMin:n.bbMin}}}),minScreenSpaceRadius:e.minScreenSpaceRadius}))};return await this._mainThreadDelegate.createLodRenderer(t,i,Array.from(r)),t}destroyLodRenderer(e){return{commands:[{id:"destroy-lod-renderer",rendererId:e}],transferList:[]}}addLodInstances(e,t,r){return{commands:[{id:"add-lod-instances",rendererId:e,groupId:t,data:r}],transferList:[r.featureIds.buffer,r.globalTransforms.buffer,r.localTransforms.buffer,r.visibility.buffer]}}removeLodInstances(e,t){return{commands:[{id:"remove-lod-instances",rendererId:e,groupId:t}],transferList:[]}}updateLodInstancesData(e,t,r){return{commands:[{id:"update-lod-instance-data",rendererId:e,groupId:t,globalTransforms:r}],transferList:[r.buffer]}}updateVisibility(e,t,r){return{commands:[{id:"update-visibility",rendererId:e,groupId:t,visibility:r}],transferList:[r.buffer]}}async dispatchRenderCommands(e){0!==e.commands.length&&await this._mainThreadDelegate.executeRenderCommands(e)}createRenderGeometryBuffer(e,t){const{materialId:r,visibilities:i,objectIds:n}=e,s=this._bufferWriters.get(r);if(null==s)throw new Error("no registered bufferWriter for material found");let o=null;if(e.transformation&&t)(0,P.C)(Fr,e.transformation),Fr[12]-=t[0],Fr[13]-=t[1],Fr[14]-=t[2],o=Fr;else{if(t)throw new Error("not implemented");e.transformation&&(o=e.transformation)}let a=null;o&&((0,P.B8)(Dr,Fr),(0,P.mg)(Dr,Dr),a=Dr);const l=e.attributes,c=s.elementCount(l),u=s.layout.stride/4;c>Math.floor(jr/u)&&console.warn("geometry with very large number of elements encountered");const d=s.layout.createBuffer(c),h=s.write(o,a,l,e.olidColor,d,0);if(null==h)throw new Error("Bufferwriter.write does not provide item information.");if(i.length!==h.numItems||n.length!==h.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");return{renderGeometryBuffer:{data:d.buffer,elementCount:c},renderGeometryBufferItems:{objectIds:n,visibilities:i,ranges:{numVertices:h.numVerticesPerItem,numItems:h.numItems}}}}}const Fr=(0,C.vt)(),Dr=(0,C.vt)(),jr=4194304;var Vr=r(98764),zr=r(65806);const kr=(0,S.vt)();var Lr=r(4341),Ur=r(11964),qr=r(44280),Nr=r(32114);const Gr=()=>c.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function Hr(e=ci){return{plane:(0,he.vt)(e.plane),origin:(0,S.o8)(e.origin),basis1:(0,S.o8)(e.basis1),basis2:(0,S.o8)(e.basis2)}}function $r(e,t=Hr()){return Yr(e.origin,e.basis1,e.basis2,t)}function Yr(e,t,r,i=Hr()){return(0,ce.c)(i.origin,e),(0,ce.c)(i.basis1,t),(0,ce.c)(i.basis2,r),Zr(i),function(e,t){Math.abs((0,ce.e)(e.basis1,e.basis2)/((0,ce.l)(e.basis1)*(0,ce.l)(e.basis2)))>1e-6&&Gr().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,ce.e)(e.basis1,ni(e)))>1e-6&&Gr().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,ce.e)(ni(e),e.origin)-e.plane[3])>1e-6&&Gr().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function Zr(e){(0,he.mR)(e.basis2,e.basis1,e.origin,e.plane)}function Xr(e,t,r){e!==r&&$r(e,r);const i=(0,ce.g)(Nr.rq.get(),ni(e),t);return(0,ce.f)(r.origin,r.origin,i),r.plane[3]-=t,r}function Wr(e,t=Hr()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,ce.i)(t.origin,e[0]+r,e[1]+i,0),(0,ce.i)(t.basis1,r,0,0),(0,ce.i)(t.basis2,0,i,0),(0,he.fA)(0,0,1,0,t.plane),t}function Jr(e,t,r){return!!(0,he.Ui)(e.plane,t,r)&&si(e,r)}function Qr(e,t,r){const i=ui.get();li(e,t,i,ui.get());let n=Number.POSITIVE_INFINITY;for(const s of pi){const o=ai(e,s,di.get()),a=Nr.rq.get();if((0,he.T7)(i,o,a)){const e=(0,ce.E)(Nr.rq.get(),t.origin,a),i=Math.abs((0,F.XM)((0,ce.e)(t.direction,e)));i<n&&(n=i,(0,ce.c)(r,a))}}return n===Number.POSITIVE_INFINITY?Kr(e,t,r):r}function Kr(e,t,r){if(Jr(e,t,r))return r;const i=ui.get(),n=ui.get();li(e,t,i,n);let s=Number.POSITIVE_INFINITY;for(const o of pi){const a=ai(e,o,di.get()),l=Nr.rq.get();if((0,he.gv)(i,a,l)){const e=(0,fe.kb)(t,l);if(!(0,he.Tj)(n,l))continue;e<s&&(s=e,(0,ce.c)(r,l))}}return ri(e,t.origin)<s&&ei(e,t.origin,r),r}function ei(e,t,r){const i=(0,he._I)(e.plane,t,Nr.rq.get()),n=(0,Ur.H6)(oi(e,e.basis1),i,-1,1,Nr.rq.get()),s=(0,Ur.H6)(oi(e,e.basis2),i,-1,1,Nr.rq.get());return(0,ce.d)(r,(0,ce.f)(Nr.rq.get(),n,s),e.origin),r}function ti(e,t,r){const{origin:i,basis1:n,basis2:s}=e,o=(0,ce.d)(Nr.rq.get(),t,i),a=(0,qr.gr)(n,o),l=(0,qr.gr)(s,o),c=(0,qr.gr)(ni(e),o);return(0,ce.i)(r,a,l,c)}function ri(e,t){const r=ti(e,t,Nr.rq.get()),{basis1:i,basis2:n}=e,s=(0,ce.l)(i),o=(0,ce.l)(n),a=Math.max(Math.abs(r[0])-s,0),l=Math.max(Math.abs(r[1])-o,0),c=r[2];return a*a+l*l+c*c}function ii(e,t){const r=-e.plane[3];return(0,qr.gr)(ni(e),t)-r}function ni(e){return(0,he.Qj)(e.plane)}function si(e,t){const r=(0,ce.d)(Nr.rq.get(),t,e.origin),i=(0,ce.k)(e.basis1),n=(0,ce.k)(e.basis2),s=(0,ce.e)(e.basis1,r),o=(0,ce.e)(e.basis2,r);return-s-i<0&&s-i<0&&-o-n<0&&o-n<0}function oi(e,t){const r=di.get();return(0,ce.c)(r.origin,e.origin),(0,ce.c)(r.vector,t),r}function ai(e,t,r){const{basis1:i,basis2:n,origin:s}=e,o=(0,ce.g)(Nr.rq.get(),i,t.origin[0]),a=(0,ce.g)(Nr.rq.get(),n,t.origin[1]);(0,ce.f)(r.origin,o,a),(0,ce.f)(r.origin,r.origin,s);const l=(0,ce.g)(Nr.rq.get(),i,t.direction[0]),c=(0,ce.g)(Nr.rq.get(),n,t.direction[1]);return(0,ce.g)(r.vector,(0,ce.f)(l,l,c),2),r}function li(e,t,r,i){const n=ni(e);(0,he.mR)(n,t.direction,t.origin,r),(0,he.mR)((0,he.Qj)(r),n,t.origin,i)}const ci={plane:(0,he.vt)(),origin:(0,S.fA)(0,0,0),basis1:(0,S.fA)(1,0,0),basis2:(0,S.fA)(0,1,0)},ui=new Lr.I(he.vt),di=new Lr.I(Ur.vt),hi=(0,S.vt)(),fi=new Lr.I(()=>Hr()),pi=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],mi=(0,C.vt)(),yi=(0,C.vt)(),gi=Object.freeze(Object.defineProperty({__proto__:null,altitudeAt:ii,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case 0:(0,ce.c)(r,e.basis1),(0,ce.n)(r,r);break;case 1:(0,ce.c)(r,e.basis2),(0,ce.n)(r,r);break;case 2:(0,ce.c)(r,ni(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:Kr,closestPointOnSilhouette:Qr,copy:$r,copyWithoutVerify:function(e,t){(0,ce.c)(t.origin,e.origin),(0,ce.c)(t.basis1,e.basis1),(0,ce.c)(t.basis2,e.basis2),(0,he.C)(t.plane,e.plane)},create:Hr,distance:function(e,t){return Math.sqrt(ri(e,t))},distance2:ri,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of pi){const n=ai(e,i,di.get()),s=(0,Ur.kb)(n,t);s>r&&(r=s)}return Math.sqrt(r)},elevate:Xr,equals:function(e,t){return(0,ce.q)(e.basis1,t.basis1)&&(0,ce.q)(e.basis2,t.basis2)&&(0,ce.q)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,he.Tj)(e.plane,t)&&si(e,t)},fromAABoundingRect:Wr,fromValues:Yr,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[n,s]=e.origin;return(0,O.fA)(n-r,s-i,n+r,s+i,t)},intersectRay:Jr,intersectRayClosestSilhouette:function(e,t,r){if(Jr(e,t,r))return r;const i=Qr(e,t,Nr.rq.get());return(0,ce.f)(r,t.origin,(0,ce.g)(Nr.rq.get(),t.direction,(0,ce.j)(t.origin,i)/(0,ce.l)(t.direction))),r},normal:ni,projectPoint:ei,projectPointLocal:ti,rotate:function(e,t,r,i){return e!==i&&$r(e,i),(0,P.$0)(yi,t,r),(0,ce.t)(i.basis1,e.basis1,yi),(0,ce.t)(i.basis2,e.basis2,yi),Zr(i),i},setAltitudeAt:function(e,t,r,i){const n=ii(e,t),s=(0,ce.g)(hi,ni(e),r-n);return(0,ce.f)(i,t,s),i},setExtent:function(e,t,r){return Wr(t,r),Xr(r,ii(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&$r(e,r),(0,P.B8)(mi,t),(0,P.mg)(mi,mi),(0,ce.t)(r.basis1,e.basis1,mi),(0,ce.t)(r.basis2,e.basis2,mi),(0,ce.t)((0,he.Qj)(r.plane),(0,he.Qj)(e.plane),mi),(0,ce.t)(r.origin,e.origin,t),(0,he.mP)(r.plane,r.plane,r.origin),r},up:ci,updateUnboundedPlane:Zr,wrap:function(e,t,r){const i=fi.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,he.LV)(0,0,0,0),Zr(i),i}},Symbol.toStringTag,{value:"Module"}));var bi=r(97937);function _i(e,t,r=function(e){return{operations:e,value:e.create()}}(e)){return r.operations=e,e.copy(t,r.value),r}const vi=2**50;function wi(e,t,r,i){return e.operations.setAltitudeAt(e.value,t,r,i)}function xi(e,t,r){return e.operations.elevate(e.value,t,r.value)}const Ci=(0,S.vt)();function Si(e){return"point"===e.type}(0,S.vt)();class Ti{constructor(e,t,r,i){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=r,this._coordinateSystem=i,this._tmpCoordinateSystem=function(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}(i),this.referenceEllipsoid=(0,pe.tO)(t),this.sphericalPCPF=(0,Vr.lO)(t)}set extent(e){e&&function(e,t,r){e.operations.setExtent(e.value,t,r.value)}(this._coordinateSystem,e,this._coordinateSystem)}get extent(){return e=this._coordinateSystem,t=(0,O.vt)(),e.operations.getExtent(e.value,t),t;var e,t}getAltitude(e){return function(e,t){return e.operations.altitudeAt(e.value,t)}(this._coordinateSystem,e)}setAltitude(e,t,r=e){return wi(this._coordinateSystem,r,t,e)}setAltitudeOfTransformation(e,t){var r,i,n,s;r=this._coordinateSystem,n=e,(i=t)!==(s=t)&&(0,P.C)(s,i),(0,ce.i)(Ci,s[12],s[13],s[14]),wi(r,Ci,n,Ci),s[12]=Ci[0],s[13]=Ci[1],s[14]=Ci[2]}worldUpAtPosition(e,t){return function(e,t,r){return e.operations.axisAt(e.value,t,2,r)}(this._coordinateSystem,e,t)}worldBasisAtPosition(e,t,r){return function(e,t,r,i){return e.operations.axisAt(e.value,t,r,i)}(this._coordinateSystem,e,t,r)}basisMatrixAtPosition(e,t){const r=this.worldBasisAtPosition(e,0,Nr.rq.get()),i=this.worldBasisAtPosition(e,1,Nr.rq.get()),n=this.worldBasisAtPosition(e,2,Nr.rq.get());return(0,P.hZ)(t,r[0],r[1],r[2],0,i[0],i[1],i[2],0,n[0],n[1],n[2],0,0,0,0,1),t}headingAtPosition(e,t){const r=this.worldUpAtPosition(e,Nr.rq.get()),i=this.worldBasisAtPosition(e,1,Nr.rq.get()),n=(0,qr.EJ)(t,i,r);return(0,F.KJ)(n)}intersectManifoldClosestSilhouette(e,t,r){return xi(this._coordinateSystem,t,this._tmpCoordinateSystem),function(e,t,r){e.operations.intersectRayClosestSilhouette(e.value,t,r)}(this._tmpCoordinateSystem,e,r),r}intersectManifold(e,t,r){xi(this._coordinateSystem,t,this._tmpCoordinateSystem);const i=Nr.rq.get();return function(e,t,r){return e.operations.intersectRay(e.value,t,r)}(this._tmpCoordinateSystem,e,i)?(0,ce.c)(r,i):null}intersectInfiniteManifold(e,t,r){if(1===this.viewingMode)return this.intersectManifold(e,t,r);xi(this._coordinateSystem,t,this._tmpCoordinateSystem);const i=this._tmpCoordinateSystem.value,n=Nr.rq.get();return(0,he.Ui)(i.plane,e,n)?(0,ce.c)(r,n):null}toRenderCoords(e,t,r){return Si(e)?(0,zr.g)(e,t,this.spatialReference):(0,k.F)(e,t,r,this.spatialReference)}fromRenderCoords(e,t,r=null){return Si(t)?(null!=r&&(t.spatialReference=r),function(e,t,r){return!!(0,k.F)(e,t,kr,r.spatialReference)&&(r.x=kr[0],r.y=kr[1],r.z=kr[2],!0)}(e,this.spatialReference,t)?t:null):(0,k.F)(e,this.spatialReference,t,r)?t:null}static create(e,t){switch(e){case 2:return new Ti(2,t,(0,I.GA)(t),_i(gi,Yr([0,0,0],[vi,0,0],[0,vi,0])));case 1:return new Ti(1,t,1,function(e){return _i(bi.s,(0,bi.f)(0,0,0,(0,pe.tO)(e).radius))}(t))}}static renderUnitScaleFactor(e,t){return(0,I.KX)(e)/(0,I.KX)(t)}}let Ai=class extends n.nJ{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new pt,this._tileLocks=new at,this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,layerInfo:i,layerViewInfo:n}){const s=f.A.fromJSON(e);this._viewSpatialReference=s;const a=f.A.fromJSON(t);this._fetcher=new Et(this._viewSpatialReference,m.A.fromJSON(i.baseQuery),i.url,i.objectIdField,i.capabilities),this._queryEngine=new p.do({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:i.objectIdField},fieldsIndex:i.fieldIndex,availableFields:[i.objectIdField],spatialReference:e,featureStore:this._featureStore,timeInfo:i.timeInfo}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const i={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",i,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})}};const l=Ti.create(r,a),c=new Rr(r,this._mainThreadDelegate);this._renderCommandContext=c;const u=new He(s,a,this._mainThreadDelegate,l,c,i,n);this._context=u,this._renderer=u.symbolRendererFactory.createSymbolRendererFromJSON(i.renderer),this._defaultQueryJSON=new m.A({outSpatialReference:s}).toJSON();let y=null;if(null!=i.fullExtent){const e=d.A.fromJSON(i.fullExtent);await(0,h.initializeProjection)(e.spatialReference,s),y=(0,h.project)(e,s)}return this._tileManager=new rt({loadTile:(e,t)=>this._fetcher.fetch(e,t),createAddCommand:(e,t)=>this._createAddFeatureDataCommand(e,t),createRemoveCommand:e=>this._createRemoveFeatureDataCommand(e),createUpdateCommand:(e,t)=>this._createUpdateFeatureDataVisibilityCommand(e,t),tileLocks:this._tileLocks,extent:y}),this.addHandles((0,o.wB)(()=>this.updating,e=>{this.emit("notify-updating",{updating:e})}),o.Vh),null!=this._renderer&&await this._renderer.load(),Pi}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async executeAttributeBinsQuery(e,t){return{result:await this._queryEngine.executeAttributeBinsQuery(e,t)}}onTileTreeChange(e){return this._tileManager.onTileTreeChange(e),Promise.resolve(Pi)}async onElevationChange(e){return Pi}async onLayerViewOpacityChange(e){const{_context:t,_renderer:r}=this;if(t.layerViewInfo.fullOpacity=e,null==r)return Pi;const i=await r.createUpdateLayerViewOpacityCommand(e);return await i.execute(),Pi}async onRendererChange(e){const{_context:t}=this,r=t.symbolRendererFactory.createSymbolRendererFromJSON(e);await r.load();const n=this._renderer;this._renderer=r;const s=[...this._tileManager.loadedTiles()],o=s.map(e=>e.tileId);{const e={stack:[],error:void 0,hasError:!1};try{(0,i.mS)(e,await this._tileLocks.lock(o),!1);const a=s.flatMap(e=>[n.createRemoveCommand(e.id),r.createAddCommand(e)]),l=await Promise.all(a),c=t.joinPipelineCommands(l);await c.execute()}catch(t){e.error=t,e.hasError=!0}finally{(0,i.hk)(e)}}const a=await n.createDestroyCommand();return await a.execute(),Pi}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,i=this._renderer;let n;return n=null!=i?await i.createAddCommand(e):g.create(this._renderCommandContext),(0,s.Te)(t),n.appendPipelineStateCommand(()=>{r.addTile(e)}),n}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let i;return i=null!=r?await r.createRemoveCommand(e):g.create(this._renderCommandContext),i.appendPipelineStateCommand(()=>{t.removeTile(e)}),i}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer;let i;return i=null!=r?await r.createUpdateVisibilityCommand(e):g.create(this._renderCommandContext),(0,s.Te)(t),i}_ensureQuery(e){return e??this._defaultQueryJSON}};(0,i.Cg)([(0,a.MZ)()],Ai.prototype,"updating",null),Ai=(0,i.Cg)([(0,u.$)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],Ai);const Ii=Ai,Pi={result:void 0}},63578:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(47522),n=r(96598),s=r(31821);function o(e,t){const{vertex:r,fragment:o}=e;e.include(n.Z,t),r.include(i.K),r.main.add(s.H`vec4 posProjCenter;
337
337
  if (dot(position, position) > 0.0) {
338
338
  ProjectHUDAux projectAux;
339
339
  vec4 posProj = projectPositionHUD(projectAux);