/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../../core/JSONSupport.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import s from"../../../networks/support/CircuitPath.js";import n from"../circuits/support/CircuitTraceResult.js";import i from"./AggregatedGeometry.js";import l from"./FunctionResult.js";import p from"./NetworkElement.js";import a from"./TelecomNetworkElement.js";import{reader as m}from"../../../core/accessorSupport/decorators/reader.js";import{writer as u}from"../../../core/accessorSupport/decorators/writer.js";let c=class extends t{constructor(e){super(e),this.aggregatedGeometry=null,this.circuits=null,this.elements=null,this.globalFunctionResults=null,this.kFeaturesForKNNFound=!1,this.paths=null,this.startingPointsIgnored=!1,this.warnings=null}readNetworkElements(e,t){return null!=t.elements&&Array.isArray(t.elements)?t.elements.map(e=>{const r=t.telecomSourceSet;if(r?.has(e.networkSourceId)){const{terminalId:t,...r}=e;return new a({...r})}const{firstUnit:o,lastUnit:s,...n}=e;return new p({...n})}):[]}writeNetworkElements(e,t){t.elements=e.map(e=>e.toJSON())}};e([r({type:i,json:{write:!0},readOnly:!0})],c.prototype,"aggregatedGeometry",void 0),e([r({type:[n],json:{write:!0},readOnly:!0})],c.prototype,"circuits",void 0),e([r({type:[p],json:{write:!0},readOnly:!0})],c.prototype,"elements",void 0),e([m("elements")],c.prototype,"readNetworkElements",null),e([u("elements")],c.prototype,"writeNetworkElements",null),e([r({type:[l],json:{write:!0},readOnly:!0})],c.prototype,"globalFunctionResults",void 0),e([r({type:Boolean,json:{write:!0},readOnly:!0})],c.prototype,"kFeaturesForKNNFound",void 0),e([r({type:[s],json:{write:!0},readOnly:!0})],c.prototype,"paths",void 0),e([r({type:Boolean,json:{write:!0},readOnly:!0})],c.prototype,"startingPointsIgnored",void 0),e([r({type:[String],json:{write:!0},readOnly:!0})],c.prototype,"warnings",void 0),c=e([o("esri.rest.networks.support.TraceResult")],c);export{c as default};
