// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("../../chunks/tslib.es6 ../../Graphic ../../PopupTemplate ../../symbols ../../core/Clonable ../../core/JSONSupport ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/reader ../../core/accessorSupport/decorators/subclass ../../geometry/Polyline ../route/utils ./RouteSettings".split(" "),function(c,k,l,m,a,n,d,t,u,v,f,p,q,g,r){var h;a=h=class extends a.ClonableMixin(n.JSONSupport){constructor(b){super(b); this.totalWaitDuration=this.totalWait=this.totalViolations=this.totalLateDuration=this.totalDuration=this.totalDistance=this.totalCosts=this.symbol=this.stopCount=this.startTimeOffset=this.startTime=this.popupTemplate=this.objectId=this.name=this.messages=this.lastStopId=this.geometry=this.firstStopId=this.endTimeOffset=this.endTime=this.analysisSettings=null;this.type="route-info";this.version="1.0.0"}readEndTime(b,e){return null!=e.attributes.EndTimeUTC?new Date(e.attributes.EndTimeUTC):null}readEndTimeOffset(b, e){return g.getTimezoneOffset(e.attributes.EndTime,e.attributes.EndTimeUTC)}readStartTime(b,e){return null!=e.attributes.StartTimeUTC?new Date(e.attributes.StartTimeUTC):null}readStartTimeOffset(b,e){return g.getTimezoneOffset(e.attributes.StartTime,e.attributes.StartTimeUTC)}readTotalCosts(b,e){return g.getPrefixedProperties(e.attributes,"Total_")}readTotalViolations(b,e){return g.getPrefixedProperties(e.attributes,"TotalViolation_")}readTotalWait(b,e){return g.getPrefixedProperties(e.attributes, "TotalWait_")}static fromGraphic(b){return new h({analysisSettings:null!=b.attributes.AnalysisSettings?r.fromJSON(JSON.parse(b.attributes.AnalysisSettings)):null,endTime:null!=b.attributes.EndTime?new Date(b.attributes.EndTime):null,endTimeOffset:b.attributes.EndUTCOffset??null,geometry:b.geometry,messages:null!=b.attributes.Messages?JSON.parse(b.attributes.Messages):null,name:b.attributes.RouteName,objectId:b.attributes.ObjectID??b.attributes.__OBJECTID,popupTemplate:b.popupTemplate,startTime:null!= b.attributes.StartTime?new Date(b.attributes.StartTime):null,startTimeOffset:b.attributes.StartUTCOffset??null,symbol:b.symbol,totalCosts:null!=b.attributes.TotalCosts?g.toKebabImpedanceAttributes(JSON.parse(b.attributes.TotalCosts)):null,totalDistance:b.attributes.TotalMeters??null,totalDuration:b.attributes.TotalMinutes??null,totalLateDuration:b.attributes.TotalLateMinutes??null,totalWaitDuration:b.attributes.TotalWaitMinutes??null,version:b.attributes.Version})}toGraphic(){const b={ObjectID:this.objectId, AnalysisSettings:null!=this.analysisSettings?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:null!=this.endTime?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:null!=this.messages?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:null!=this.startTime?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:null!=this.totalCosts?JSON.stringify(g.fromKebabImpedanceAttributes(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration, TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new k({geometry:this.geometry,attributes:b,symbol:this.symbol,popupTemplate:this.popupTemplate})}};a.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString"},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate"},{name:"EndUTCOffset",alias:"End Time Offset",type:"esriFieldTypeInteger"}, {name:"Messages",alias:"Messages",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate"},{name:"StartUTCOffset",alias:"Start Time Offset",type:"esriFieldTypeInteger"},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString"},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble"},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble"},{name:"TotalMinutes", alias:"Total Minutes",type:"esriFieldTypeDouble"},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble"},{name:"Version",alias:"Version",type:"esriFieldTypeString"}];c.__decorate([d.property()],a.prototype,"analysisSettings",void 0);c.__decorate([d.property()],a.prototype,"endTime",void 0);c.__decorate([f.reader("endTime",["attributes.EndTimeUTC"])],a.prototype,"readEndTime",null);c.__decorate([d.property()],a.prototype,"endTimeOffset",void 0);c.__decorate([f.reader("endTimeOffset", ["attributes.EndTime","attributes.EndTimeUTC"])],a.prototype,"readEndTimeOffset",null);c.__decorate([d.property({json:{read:{source:"attributes.FirstStopID"}}})],a.prototype,"firstStopId",void 0);c.__decorate([d.property({type:q})],a.prototype,"geometry",void 0);c.__decorate([d.property({json:{read:{source:"attributes.LastStopID"}}})],a.prototype,"lastStopId",void 0);c.__decorate([d.property()],a.prototype,"messages",void 0);c.__decorate([d.property({json:{read:{source:"attributes.Name"}}})],a.prototype, "name",void 0);c.__decorate([d.property({json:{read:{source:"attributes.ObjectID"}}})],a.prototype,"objectId",void 0);c.__decorate([d.property({type:l})],a.prototype,"popupTemplate",void 0);c.__decorate([d.property()],a.prototype,"startTime",void 0);c.__decorate([f.reader("startTime",["attributes.StartTimeUTC"])],a.prototype,"readStartTime",null);c.__decorate([d.property()],a.prototype,"startTimeOffset",void 0);c.__decorate([f.reader("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])], a.prototype,"readStartTimeOffset",null);c.__decorate([d.property({json:{read:{source:"attributes.StopCount"}}})],a.prototype,"stopCount",void 0);c.__decorate([d.property({types:m.symbolTypes})],a.prototype,"symbol",void 0);c.__decorate([d.property()],a.prototype,"totalCosts",void 0);c.__decorate([f.reader("totalCosts",["attributes"])],a.prototype,"readTotalCosts",null);c.__decorate([d.property()],a.prototype,"totalDistance",void 0);c.__decorate([d.property()],a.prototype,"totalDuration",void 0);c.__decorate([d.property()], a.prototype,"totalLateDuration",void 0);c.__decorate([d.property()],a.prototype,"totalViolations",void 0);c.__decorate([f.reader("totalViolations",["attributes"])],a.prototype,"readTotalViolations",null);c.__decorate([d.property()],a.prototype,"totalWait",void 0);c.__decorate([f.reader("totalWait",["attributes"])],a.prototype,"readTotalWait",null);c.__decorate([d.property()],a.prototype,"totalWaitDuration",void 0);c.__decorate([d.property({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0); c.__decorate([d.property()],a.prototype,"version",void 0);return a=h=c.__decorate([p.subclass("esri.rest.support.RouteInfo")],a)});