/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import i from"../../PopupTemplate.js";import{ClonableMixin as o}from"../../core/Clonable.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as s,subclass as l}from"../../core/accessorSupport/decorators.js";import n from"../../geometry/Polyline.js";import{directionLineTypeJsonMap as p}from"./networkEnums.js";import{symbolTypes as a}from"../../symbols/support/typeUtils.js";var u;let d=class extends(o(r)){static{u=this}constructor(e){super(e),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null,this.type="direction-line"}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"FromLevel",alias:"From Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0},{name:"Meters",alias:"Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0},{name:"Minutes",alias:"Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0},{name:"ToLevel",alias:"To Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0}]}static fromGraphic(e){return new u({directionLineType:p.fromJSON(e.attributes.DirectionLineType),directionPointId:e.attributes.DirectionPointID,distance:e.attributes.Meters,duration:e.attributes.Minutes,fromLevel:e.attributes.FromLevel??null,geometry:e.geometry,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,symbol:e.symbol,toLevel:e.attributes.ToLevel??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionLineType:this.directionLineType?p.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return null!=this.fromLevel&&(e.FromLevel=this.fromLevel),null!=this.toLevel&&(e.ToLevel=this.toLevel),new t({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};e([s({type:p.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:p.read}}})],d.prototype,"directionLineType",void 0),e([s({json:{read:{source:"attributes.DirectionPointID"}}})],d.prototype,"directionPointId",void 0),e([s({json:{read:{source:"attributes.Meters"}}})],d.prototype,"distance",void 0),e([s({json:{read:{source:"attributes.Minutes"}}})],d.prototype,"duration",void 0),e([s({json:{read:{source:"attributes.FromLevel"}}})],d.prototype,"fromLevel",void 0),e([s({type:n})],d.prototype,"geometry",void 0),e([s({json:{read:{source:"attributes.ObjectID"}}})],d.prototype,"objectId",void 0),e([s({type:i})],d.prototype,"popupTemplate",void 0),e([s({types:a})],d.prototype,"symbol",void 0),e([s({json:{read:{source:"attributes.ToLevel"}}})],d.prototype,"toLevel",void 0),e([s({readOnly:!0,json:{read:!1}})],d.prototype,"type",void 0),d=u=e([l("esri.rest.support.DirectionLine")],d);export{d as default};
