/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{ClonableMixin as r}from"../../core/Clonable.js";import{cyclicalDegrees as t}from"../../core/Cyclical.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as i,subclass as s}from"../../core/accessorSupport/decorators.js";import{ensureNumber as l,Integer as n}from"../../core/accessorSupport/ensureType.js";import{persistable as p}from"../../core/accessorSupport/decorators/persistable.js";import{computeOrientationTiltFromNormal as a}from"./voxelPlaneUtils.js";import m from"./VoxelSlice.js";import{r as d}from"../../chunks/persistableUrlUtils.js";let u=class extends(r(o)){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,r]=a(this.normal);return t.normalize(l(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,r]=a(this.normal);return t.normalize(l(r),0,!0)}};e([i({type:Boolean,json:{default:!0,write:!0}})],u.prototype,"enabled",void 0),e([i({type:String,json:{origins:{service:{read:d},"web-scene":{write:{isRequired:!0}}},write:!0}}),p({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],u.prototype,"href",void 0),e([i({type:n,json:{write:{enabled:!0,isRequired:!0}}})],u.prototype,"id",void 0),e([i({type:String,json:{write:!0}})],u.prototype,"label",void 0),e([i({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],u.prototype,"orientation",null),e([i({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],u.prototype,"tilt",null),e([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],u.prototype,"normal",void 0),e([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],u.prototype,"point",void 0),e([i({type:[n],json:{write:{enabled:!0,isRequired:!0}}})],u.prototype,"sizeInPixel",void 0),e([i({type:[m],json:{write:!0}})],u.prototype,"slices",void 0),e([i({type:n,json:{default:0,write:!0}})],u.prototype,"timeId",void 0),e([i({type:n,json:{write:{enabled:!0,isRequired:!0}}})],u.prototype,"variableId",void 0),u=e([s("esri.layers.voxel.VoxelSection")],u);export{u as default};
