/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../chunks/tslib.es6","../../../../geometry","../../../../core/maybe","../../../../core/accessorSupport/decorators/property","../../../../core/arrayUtils","../../../../core/has","../../../../core/accessorSupport/ensureType","../../../../core/accessorSupport/decorators/subclass","../../../../chunks/mat4","../../../../chunks/mat4f64","../../../../chunks/vec3","../../../../chunks/vec3f64","../../../../geometry/projection","../../../support/TileTreeDebugger","../../../../geometry/Polygon"],(function(e,r,o,t,s,c,u,n,p,a,i,l,f,h,g,y,b){"use strict";function S(e,r,o){const t=e.serviceObb;if(s.isNone(t)||s.isNone(r))return null;i.fromQuat(d,t.quaternion),f.copy(m,t.center),g.projectBuffer(m,o,0,m,r,0,1),d[12]=m[0],d[13]=m[1],d[14]=m[2];const c=[[],[],[]];f.copy(m,t.halfSize),f.transformMat4(m,m,d),g.projectBuffer(m,r,0,m,o,0,1),c[0].push([m[0],m[1]]),f.copy(m,t.halfSize),m[0]=-m[0],f.transformMat4(m,m,d),g.projectBuffer(m,r,0,m,o,0,1),c[0].push([m[0],m[1]]),f.copy(m,t.halfSize),m[0]=-m[0],m[1]=-m[1],f.transformMat4(m,m,d),g.projectBuffer(m,r,0,m,o,0,1),c[0].push([m[0],m[1]]),f.copy(m,t.halfSize),m[1]=-m[1],f.transformMat4(m,m,d),g.projectBuffer(m,r,0,m,o,0,1),c[0].push([m[0],m[1]]),c[1].push(c[0][0]),c[1].push(c[0][1]),f.copy(m,t.halfSize),m[0]=-m[0],m[2]=-m[2],f.transformMat4(m,m,d),g.projectBuffer(m,r,0,m,o,0,1),c[1].push([m[0],m[1]]),f.copy(m,t.halfSize),m[2]=-m[2],f.transformMat4(m,m,d),g.projectBuffer(m,r,0,m,o,0,1),c[1].push([m[0],m[1]]),c[2].push(c[0][0]),c[2].push(c[0][3]),f.copy(m,t.halfSize),m[1]=-m[1],m[2]=-m[2],f.transformMat4(m,m,d),g.projectBuffer(m,r,0,m,o,0,1),c[2].push([m[0],m[1]]),c[2].push(c[1][3]);const u=new b({rings:c,spatialReference:o});return{lij:[e.level,e.childCount,0],label:e.id,geometry:u}}e.I3STreeDebugger=function(e){function o(r){return e.call(this,r)||this}return r._inheritsLoose(o,e),o.prototype.getTiles=function(){const e=this.lv.getVisibleNodes(),r=this.view.renderSpatialReference,o=this.nodeSR;return e.map((e=>S(e,r,o))).sort(((e,r)=>e.lij[0]===r.lij[0]?e.label>r.label?-1:1:e.lij[0]-r.lij[0]))},o}(y.TileTreeDebugger),o.__decorate([c.property({constructOnly:!0})],e.I3STreeDebugger.prototype,"lv",void 0),o.__decorate([c.property({constructOnly:!0})],e.I3STreeDebugger.prototype,"nodeSR",void 0),e.I3STreeDebugger=o.__decorate([a.subclass("esri.views.3d.layers.support.I3STreeDebugger")],e.I3STreeDebugger);const d=l.create(),m=h.create();Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
