/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as e}from"tslib";import{isSome as r}from"../../../../core/arrayUtils.js";import{property as o,subclass as t}from"../../../../core/accessorSupport/decorators.js";import{fromQuat as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{d as l,p}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../../geometry/Polygon.js";import{projectBuffer as c}from"../../../../geometry/projection/projectBuffer.js";import{TileTreeDebugger as u}from"../../../support/TileTreeDebugger.js";let m=class extends u{constructor(e){super(e)}getTiles(){const e=this.lv.getVisibleNodes(),o=this.view.renderSpatialReference,t=this.nodeSR;return e.map(e=>f(e,o,t)).filter(r).sort((e,r)=>e.lij[0]===r.lij[0]?e.label>r.label?-1:1:e.lij[0]-r.lij[0])}};function f(e,r,o){const t=e.serviceObbInIndexSR;if(null==t||null==r)return null;s(h,t.quaternion),l(j,t.center),c(j,o,0,j,r,0),h[12]=j[0],h[13]=j[1],h[14]=j[2];const i=[[],[],[]];p(j,t.halfSize,h),c(j,r,0,j,o,0),i[0].push([j[0],j[1]]),l(j,t.halfSize),j[0]=-j[0],p(j,j,h),c(j,r,0,j,o,0),i[0].push([j[0],j[1]]),l(j,t.halfSize),j[0]=-j[0],j[1]=-j[1],p(j,j,h),c(j,r,0,j,o,0),i[0].push([j[0],j[1]]),l(j,t.halfSize),j[1]=-j[1],p(j,j,h),c(j,r,0,j,o,0),i[0].push([j[0],j[1]]),i[1].push(i[0][0]),i[1].push(i[0][1]),l(j,t.halfSize),j[0]=-j[0],j[2]=-j[2],p(j,j,h),c(j,r,0,j,o,0),i[1].push([j[0],j[1]]),l(j,t.halfSize),j[2]=-j[2],p(j,j,h),c(j,r,0,j,o,0),i[1].push([j[0],j[1]]),i[2].push(i[0][0]),i[2].push(i[0][3]),l(j,t.halfSize),j[1]=-j[1],j[2]=-j[2],p(j,j,h),c(j,r,0,j,o,0),i[2].push([j[0],j[1]]),i[2].push(i[1][3]);const n=new a({rings:i,spatialReference:o});return{lij:[e.level,e.childCount,0],level:e.level,label:e.id,geometry:n}}e([o({constructOnly:!0})],m.prototype,"lv",void 0),e([o({constructOnly:!0})],m.prototype,"nodeSR",void 0),m=e([t("esri.views.3d.layers.support.I3STreeDebugger")],m);const h=i(),j=n();export{m as I3STreeDebugger};
