/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as t}from"tslib";import{ClonableMixin as o}from"../../core/Clonable.js";import{cyclicalDegrees as r}from"../../core/Cyclical.js";import{JSONSupport as e}from"../../core/JSONSupport.js";import{property as i,cast as n,subclass as s}from"../../core/accessorSupport/decorators.js";import{ensureNumber as l}from"../../core/accessorSupport/ensureType.js";import{computeOrientationTiltFromNormal as a,computeNormalFromOrientationTilt as m}from"./voxelPlaneUtils.js";let p=class extends(o(e)){constructor(t){super(t),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[t,o]=a(this.normal);return r.normalize(l(t),0,!0)}set orientation(t){const o=m(t,this.tilt);this._set("normal",o),this._set("orientation",t)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[t,o]=a(this.normal);return r.normalize(l(o),0,!0)}set tilt(t){const o=m(this.orientation,t);this._set("normal",o),this._set("tilt",t)}};t([i({type:Boolean,json:{default:!0,write:!0}})],p.prototype,"enabled",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"label",void 0),t([i({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),n(t=>r.normalize(l(t),0,!0))],p.prototype,"orientation",null),t([i({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),n(t=>r.normalize(l(t),0,!0))],p.prototype,"tilt",null),t([i({type:[Number],json:{write:{isRequired:!0}}})],p.prototype,"normal",void 0),t([i({type:[Number],json:{write:{isRequired:!0}}})],p.prototype,"point",void 0),p=t([s("esri.layers.voxel.VoxelDynamicSection")],p);export{p as default};
