/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import i from"../../../geometry/Point.js";import{clockwiseDirections as n}from"../constants.js";import{normalizeDegrees as s,getRelativeAngleBetweenPoints as l}from"./imageNavigationUtils.js";let u=class extends e{constructor(t){super(t),this.attributes=null,this.backwards=null,this.geometry=null,this.left=null,this.next=null,this.previous=null,this.right=null,this.towards=null}get currentHeading(){return this._get("currentHeading")??0}set currentHeading(t){const e=s(t);this._set("currentHeading",e)}get currentPitch(){return this._get("currentPitch")??0}set currentPitch(t){const e=s(t);this._set("currentPitch",e)}get heading(){return this.attributes.cameraHeading}get id(){return this.attributes.objectId}get pitch(){return this.attributes.cameraPitch}get roll(){return this.attributes.cameraRoll??0}getDistanceTo(t){return this.geometry.distance(t.geometry)}getDirectionTo(t){if(!t)return null;const{geometry:{x:e,y:r},currentHeading:o}=this,{geometry:{x:i,y:u}}=t,a=l(e,r,i,u),c=s(a-o),p=Math.floor((c+45)/90)%4;return n[p]}reset(){this.towards=null,this.backwards=null,this.left=null,this.right=null}};t([r()],u.prototype,"attributes",void 0),t([r()],u.prototype,"backwards",void 0),t([r()],u.prototype,"currentHeading",null),t([r()],u.prototype,"currentPitch",null),t([r({type:i})],u.prototype,"geometry",void 0),t([r({readOnly:!0})],u.prototype,"heading",null),t([r({readOnly:!0})],u.prototype,"id",null),t([r()],u.prototype,"left",void 0),t([r()],u.prototype,"next",void 0),t([r({readOnly:!0})],u.prototype,"pitch",null),t([r()],u.prototype,"previous",void 0),t([r()],u.prototype,"right",void 0),t([r({readOnly:!0})],u.prototype,"roll",null),t([r()],u.prototype,"towards",void 0),u=t([o("esri.widgets.OrientedImageryViewer.components.NavigationNode")],u);const a=u;export{a as default};
