/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as t}from"tslib";import{initial as e}from"../../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as o}from"../../../../core/support/UpdatingHandles.js";import s from"../../../../geometry/Polygon.js";import{TileTreeDebugger as a}from"../../../support/TileTreeDebugger.js";let n=class extends a{get updating(){return this._watchUpdatingTracking?.updating??!1}constructor(t){super(t),this._watchUpdatingTracking=new o}initialize(){this.addHandles(this.view.enableFeatureTiles()),this._watchUpdatingTracking.addOnCollectionChange(()=>this.view.featureTiles?.tiles,()=>this.update(),e)}destroy(){this._watchUpdatingTracking.destroy()}getTiles(){const t=this.view.featureTiles;if(!t)return[];const e=e=>{const[r,i,o]=e.lij;return s.fromExtent(t.tilingScheme.getExtentGeometry(r,i,o))};return t.tiles.toArray().sort((t,e)=>t.loadPriority-e.loadPriority).map(t=>({...t,level:t.level,geometry:e(t)}))}};t([r()],n.prototype,"_watchUpdatingTracking",void 0),t([r()],n.prototype,"updating",null),t([r()],n.prototype,"view",void 0),n=t([i("esri.views.3d.layers.support.FeatureTileTree3DDebugger")],n);export{n as FeatureTileTree3DDebugger};
