PageSourceSearch

https://www.trafikverket.se/Static/dist/12924.d64f33a92050bdd7bcab.js

js trafikverket.se collected 2026-10-01 10:33:50 UTC 52,721 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkknowit_seed_project=self.webpackChunkknowit_seed_project||[]).push([[12924],{2527(e,t,r){r.d(t,{v:()=>i});var o=r(47980);function i(e){e?.writtenProperties&&e.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{(0,o.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}},12924(e,t,r){r.r(t),r.d(t,{default:()=>St});var o=r(31635),i=r(32083),s=r(20857),n=r(25352),a=r(3223),l=r(40377),u=r(62991),p=r(80861),c=r(96057),y=r(21750),d=r(37623),m=r(61985),g=r(72906),h=r(19759),f=r(69636),v=r(2527),w=r(8e3),C=r(67709),b=r(81832),A=r(44153),S=r(67488),M=r(45449),B=r(20923),T=r(91538),Z=r(60368),N=r(22111),P=r(63457),j=r(84977),O=r(68231),R=r(4331);let I=class extends j.o{constructor(e){super(e),this.break=new O.A({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new O.A({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new O.A({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new O.A({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new O.A({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new O.A({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};(0,o.Cg)([(0,f.MZ)({types:R.wC})],I.prototype,"break",void 0),(0,o.Cg)([(0,f.MZ)({types:R.wC})],I.prototype,"first",void 0),(0,o.Cg)([(0,f.MZ)({types:R.wC})],I.prototype,"unlocated",void 0),(0,o.Cg)([(0,f.MZ)({types:R.wC})],I.prototype,"last",void 0),(0,o.Cg)([(0,f.MZ)({types:R.wC})],I.prototype,"middle",void 0),(0,o.Cg)([(0,f.MZ)({types:R.wC})],I.prototype,"waypoint",void 0),I=(0,o.Cg)([(0,f.$K)("esri.layers.support.RouteStopSymbols")],I);var L=r(55736),D=r(24826);let k=class extends j.o{constructor(e){super(e),this.directionLines=new D.A({color:[0,122,194],width:6}),this.directionPoints=new O.A({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new O.A({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new L.A({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new D.A({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new D.A({width:8,color:[20,89,127]}),this.stops=new I}};(0,o.Cg)([(0,f.MZ)({types:R.Y7})],k.prototype,"directionLines",void 0),(0,o.Cg)([(0,f.MZ)({types:R.wC})],k.prototype,"directionPoints",void 0),(0,o.Cg)([(0,f.MZ)({types:R.wC})],k.prototype,"pointBarriers",void 0),(0,o.Cg)([(0,f.MZ)({types:R.Ac})],k.prototype,"polygonBarriers",void 0),(0,o.Cg)([(0,f.MZ)({types:R.Y7})],k.prototype,"polylineBarriers",void 0),(0,o.Cg)([(0,f.MZ)({types:R.Y7})],k.prototype,"routeInfo",void 0),(0,o.Cg)([(0,f.MZ)({type:I})],k.prototype,"stops",void 0),k=(0,o.Cg)([(0,f.$K)("esri.layers.support.RouteSymbols")],k);var _=r(83382),J=r(43305),x=r(86074),E=r(29221),F=r(85575),U=r(36321),G=r(93122),K=r(85716);let $=class extends j.o{constructor(e){super(e),this.dataType=null,this.name=null,this.parameterNames=null,this.restrictionUsageParameterName=null,this.timeNeutralAttributeName=null,this.trafficSupport=null,this.units=null,this.usageType=null}};(0,o.Cg)([(0,f.MZ)({type:String})],$.prototype,"dataType",void 0),(0,o.Cg)([(0,K.e)(G.et,{ignoreUnknown:!1})],$.prototype,"name",void 0),(0,o.Cg)([(0,f.MZ)({type:[String]})],$.prototype,"parameterNames",void 0),(0,o.Cg)([(0,f.MZ)({type:String})],$.prototype,"restrictionUsageParameterName",void 0),(0,o.Cg)([(0,K.e)(G.Mm,{ignoreUnknown:!1})],$.prototype,"timeNeutralAttributeName",void 0),(0,o.Cg)([(0,f.MZ)({type:String})],$.prototype,"trafficSupport",void 0),(0,o.Cg)([(0,K.e)(G.dn)],$.prototype,"units",void 0),(0,o.Cg)([(0,K.e)(G.WU)],$.prototype,"usageType",void 0),$=(0,o.Cg)([(0,f.$K)("esri.rest.support.NetworkAttribute")],$);const W=$;let q=class extends j.o{constructor(e){super(e),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};(0,o.Cg)([(0,f.MZ)({type:Number})],q.prototype,"buildTime",void 0),(0,o.Cg)([(0,f.MZ)({type:String})],q.prototype,"name",void 0),(0,o.Cg)([(0,f.MZ)({type:[W]})],q.prototype,"networkAttributes",void 0),(0,o.Cg)([(0,f.MZ)()],q.prototype,"networkSources",void 0),(0,o.Cg)([(0,f.MZ)({type:String})],q.prototype,"state",void 0),q=(0,o.Cg)([(0,f.$K)("esri.rest.support.NetworkDataset")],q);const V=q;var z=r(25577),Y=r(25376),H=r(48524);let X=class extends j.o{constructor(e){super(e),this.accumulateAttributeNames=null,this.attributeParameterValues=null,this.currentVersion=null,this.defaultTravelMode=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsSupportedLanguages=null,this.directionsTimeAttribute=null,this.hasZ=null,this.impedance=null,this.networkDataset=null,this.supportedTravelModes=null}readAccumulateAttributes(e){return null==e?null:e.map(e=>G.et.fromJSON(e))}writeAccumulateAttributes(e,t,r){e?.length&&(t[r]=e.map(e=>G.et.toJSON(e)))}get capabilities(){return{supportsNow:(this.currentVersion??10)>=10.81}}
1readDefaultTravelMode(e,t){const r=t.supportedTravelModes?.find(({id:e})=>e===t.defaultTravelMode)??t.supportedTravelModes?.find(({itemId:e})=>e===t.defaultTravelMode);return r?z.A.fromJSON(r):null}};(0,o.Cg)([(0,f.MZ)()],X.prototype,"accumulateAttributeNames",void 0),(0,o.Cg)([(0,Y.w)("accumulateAttributeNames")],X.prototype,"readAccumulateAttributes",null),(0,o.Cg)([(0,H.K)("accumulateAttributeNames")],X.prototype,"writeAccumulateAttributes",null),(0,o.Cg)([(0,f.MZ)()],X.prototype,"attributeParameterValues",void 0),(0,o.Cg)([(0,f.MZ)()],X.prototype,"capabilities",null),(0,o.Cg)([(0,f.MZ)()],X.prototype,"currentVersion",void 0),(0,o.Cg)([(0,f.MZ)()],X.prototype,"defaultTravelMode",void 0),(0,o.Cg)([(0,Y.w)("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],X.prototype,"readDefaultTravelMode",null),(0,o.Cg)([(0,f.MZ)()],X.prototype,"directionsLanguage",void 0),(0,o.Cg)([(0,K.e)(G.Z7)],X.prototype,"directionsLengthUnits",void 0),(0,o.Cg)([(0,f.MZ)()],X.prototype,"directionsSupportedLanguages",void 0),(0,o.Cg)([(0,K.e)(G.Mm,{ignoreUnknown:!1})],X.prototype,"directionsTimeAttribute",void 0),(0,o.Cg)([(0,f.MZ)()],X.prototype,"hasZ",void 0),(0,o.Cg)([(0,K.e)(G.et,{ignoreUnknown:!1})],X.prototype,"impedance",void 0),(0,o.Cg)([(0,f.MZ)({type:V})],X.prototype,"networkDataset",void 0),(0,o.Cg)([(0,f.MZ)({type:[z.A]})],X.prototype,"supportedTravelModes",void 0),X=(0,o.Cg)([(0,f.$K)("esri.rest.support.NetworkServiceDescription")],X);function Q(e,t,r,o){o[r]=[t.length,t.length+e.length],e.forEach(e=>{t.push(e.geometry)})}function ee(e,t){for(let r=0;r<t.length;r++){const o=e[t[r]];if(o&&o.length)for(const e of o)e.z=void 0}p.A.getLogger("esri.rest.networkService").warnOnce("The remote Network Analysis service is powered by a network dataset which is not Z-aware.\nZ-coordinates of the input geometry are ignored.")}async function te(e,t,r){if(!e)throw new u.A("network-service:missing-url","Url to Network service is missing");const o=(0,U.jV)({f:"json",token:t},r),{data:i}=await(0,F.A)(e,o),s=i.currentVersion>=10.4?async function(e,t,r){try{const o=(0,U.jV)({f:"json",token:t},r),i=(0,h.UC)(e)+"/retrieveTravelModes",{data:{supportedTravelModes:s,defaultTravelMode:n}}=await(0,F.A)(i,o);return{supportedTravelModes:s,defaultTravelMode:n}}catch(e){throw new u.A("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:e})}}(e,t,r):async function(e,t){const r=(0,U.jV)({f:"json"},t),{data:o}=await(0,F.A)(e.replace(/\/rest\/.*$/i,"/info"),r);if(!o?.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:i}=o,s=(0,h.UC)(i)+"/sharing/rest/portals/self",{data:n}=await(0,F.A)(s,r),a=(0,y.wc)("helperServices.routingUtilities.url",n);if(!a)return{supportedTravelModes:[],defaultTravelMode:null};const l=(0,U.Dl)(i),u=/\/solve$/i.test(l.path)?"Route":/\/solveclosestfacility$/i.test(l.path)?"ClosestFacility":"ServiceAreas",p=(0,U.jV)({f:"json",serviceName:u},t),c=(0,h.UC)(a)+"/GetTravelModes/execute",d=await(0,F.A)(c,p),m=[];let g=null;if(d?.data?.results?.length){const e=d.data.results;for(const t of e)if("supportedTravelModes"===t.paramName){if(t.value?.features)for(const{attributes:e}of t.value.features)if(e){const t=JSON.parse(e.TravelMode);m.push(t)}}else"defaultTravelMode"===t.paramName&&(g=t.value)}return{supportedTravelModes:m,defaultTravelMode:g}}(e,r),{defaultTravelMode:n,supportedTravelModes:a}=await s;return i.defaultTravelMode=n,i.supportedTravelModes=a,X.fromJSON(i)}var re=r(44212),oe=r(472),ie=r(36979),se=r(74704),ne=r(1817),ae=r(71434);const le=new ne.J({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let ue=class extends ae.A{constructor(e){super(e),this.type=null}};(0,o.Cg)([(0,f.MZ)({type:String,json:{read:le.read,write:le.write}})],ue.prototype,"type",void 0),ue=(0,o.Cg)([(0,f.$K)("esri.rest.support.NAMessage")],ue);const pe=ue;var ce=r(38648),ye=r(1912);let de=class extends j.o{constructor(e){super(e)}};(0,o.Cg)([(0,f.MZ)({json:{read:{source:"string"}}})],de.prototype,"text",void 0),(0,o.Cg)([(0,K.e)(G.Ec,{name:"stringType"})],de.prototype,"type",void 0),de=(0,o.Cg)([(0,f.$K)("esri.rest.support.DirectionsString")],de);const me=de;let ge=class extends j.o{constructor(e){super(e),this.arriveTime=null,this.arriveTimeOff
1set=null,this.geometry=null,this.strings=null}readArriveTimeOffset(e,t){return(0,ie.Zn)(t.ETA,t.arriveTimeUTC)}readGeometry(e,t){return ye.A.fromJSON(t.point)}};(0,o.Cg)([(0,f.MZ)({type:Date,json:{read:{source:"arriveTimeUTC"}}})],ge.prototype,"arriveTime",void 0),(0,o.Cg)([(0,f.MZ)()],ge.prototype,"arriveTimeOffset",void 0),(0,o.Cg)([(0,Y.w)("arriveTimeOffset",["arriveTimeUTC","ETA"])],ge.prototype,"readArriveTimeOffset",null),(0,o.Cg)([(0,f.MZ)({type:ye.A})],ge.prototype,"geometry",void 0),(0,o.Cg)([(0,Y.w)("geometry",["point"])],ge.prototype,"readGeometry",null),(0,o.Cg)([(0,f.MZ)({type:[me]})],ge.prototype,"strings",void 0),ge=(0,o.Cg)([(0,f.$K)("esri.rest.support.DirectionsEvent")],ge);const he=ge;let fe=class extends s.A{constructor(e){super(e),this.events=null,this.geometry=null,this.strings=null}set attributes(e){super.attributes=e}readGeometry(e,t){const r=function(e){if(null==e||""===e)return null;let t=0,r=0,o=0,i=0;const s=[];let n,a,l,u,p,c,y,d,m=0,g=0,h=0;if(p=e.match(/((\+|-)[^+\-|]+|\|)/g),p||(p=[]),0===parseInt(p[m],32)){m=2;const e=parseInt(p[m],32);m++,c=parseInt(p[m],32),m++,1&e&&(g=p.indexOf("|")+1,y=parseInt(p[g],32),g++),2&e&&(h=p.indexOf("|",g)+1,d=parseInt(p[h],32),h++)}else c=parseInt(p[m],32),m++;for(;m<p.length&&"|"!==p[m];){n=parseInt(p[m],32)+t,m++,t=n,a=parseInt(p[m],32)+r,m++,r=a;const e=[n/c,a/c];g&&(u=parseInt(p[g],32)+o,g++,o=u,e.push(u/y)),h&&(l=parseInt(p[h],32)+i,h++,i=l,e.push(l/d)),s.push(e)}return{paths:[s],hasZ:g>0,hasM:h>0}}(t.compressedGeometry);return null!=r?ce.A.fromJSON(r):null}};(0,o.Cg)([(0,f.MZ)({type:[he]})],fe.prototype,"events",void 0),(0,o.Cg)([(0,f.MZ)({types:{base:null,key:"type",typeMap:{polygon:ce.A},defaultKeyValue:"polygon"}})],fe.prototype,"geometry",void 0),(0,o.Cg)([(0,Y.w)("geometry",["compressedGeometry"])],fe.prototype,"readGeometry",null),(0,o.Cg)([(0,f.MZ)({type:[me]})],fe.prototype,"strings",void 0),fe=(0,o.Cg)([(0,f.$K)("esri.rest.support.DirectionsFeature")],fe);const ve=fe;let we=class extends se.A{constructor(e){super(e),this.extent=null,this.features=[],this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,t){if(!e)return[];const r=t.summary.envelope.spatialReference??t.spatialReference,o=r&&A.A.fromJSON(r);return e.map(e=>{const t=ve.fromJSON(e);if(null!=t.geometry&&(t.geometry.spatialReference=o),null!=t.events)for(const e of t.events)null!=e.geometry&&(e.geometry.spatialReference=o);return t})}get mergedGeometry(){return this.features?function(e,t){if(0===e.length)return new ce.A({spatialReference:t});const r=[];for(const t of e)for(const e of t.paths)r.push(...e);const o=[];r.forEach((e,t)=>{0!==t&&e[0]===r[t-1][0]&&e[1]===r[t-1][1]||o.push(e)});const{hasM:i,hasZ:s}=e[0];return new ce.A({hasM:i,hasZ:s,paths:[o],spatialReference:t})}(this.features.map(({geometry:e})=>e),this.extent.spatialReference):null}get strings(){return this.features.flatMap(({strings:e})=>e).filter(a.Ru)}};(0,o.Cg)([(0,f.MZ)({type:w.A,json:{read:{source:"summary.envelope"}}})],we.prototype,"extent",void 0),(0,o.Cg)([(0,f.MZ)({nonNullable:!0})],we.prototype,"features",void 0),(0,o.Cg)([(0,Y.w)("features")],we.prototype,"readFeatures",null),(0,o.Cg)([(0,f.MZ)()],we.prototype,"geometryType",void 0),(0,o.Cg)([(0,f.MZ)({readOnly:!0})],we.prototype,"mergedGeometry",null),(0,o.Cg)([(0,f.MZ)()],we.prototype,"routeId",void 0),(0,o.Cg)([(0,f.MZ)()],we.prototype,"routeName",void 0),(0,o.Cg)([(0,f.MZ)({value:null,readOnly:!0})],we.prototype,"strings",null),(0,o.Cg)([(0,f.MZ)({json:{read:{source:"summary.totalDriveTime"}}})],we.prototype,"totalDriveTime",void 0),(0,o.Cg)([(0,f.MZ)({json:{read:{source:"summary.totalLength"}}})],we.prototype,"totalLength",void 0),(0,o.Cg)([(0,f.MZ)({json:{read:{source:"summary.totalTime"}}})],we.prototype,"totalTime",void 0),we=(0,o.Cg)([(0,f.$K)("esri.rest.support.DirectionsFeatureSet")],we);const Ce=we;let be=class extends j.o{constructor(e){super(e),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};(0,o.Cg)([(0,f.MZ)({type:se.A,json:{write:!0}}
1)],be.prototype,"directionLines",void 0),(0,o.Cg)([(0,f.MZ)({type:se.A,json:{write:!0}})],be.prototype,"directionPoints",void 0),(0,o.Cg)([(0,f.MZ)({type:Ce,json:{write:!0}})],be.prototype,"directions",void 0),(0,o.Cg)([(0,f.MZ)({type:s.A,json:{write:!0}})],be.prototype,"route",void 0),(0,o.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],be.prototype,"routeName",void 0),(0,o.Cg)([(0,f.MZ)({type:[s.A],json:{write:!0}})],be.prototype,"stops",void 0),(0,o.Cg)([(0,f.MZ)({type:se.A,json:{write:!0}})],be.prototype,"traversedEdges",void 0),(0,o.Cg)([(0,f.MZ)({type:se.A,json:{write:!0}})],be.prototype,"traversedJunctions",void 0),(0,o.Cg)([(0,f.MZ)({type:se.A,json:{write:!0}})],be.prototype,"traversedTurns",void 0),be=(0,o.Cg)([(0,f.$K)("esri.rest.support.RouteResult")],be);const Ae=be;function Se(e){return e?se.A.fromJSON(e).features.filter(a.Ru):[]}let Me=class extends j.o{constructor(e){super(e),this.checksum=null,this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(e,t){return Se(t.barriers)}readPolylineBarriers(e){return Se(e)}readPolygonBarriers(e){return Se(e)}};function Be(e){return e instanceof se.A}async function Te(e,t,r){const o=[],i=[],s={},n={},a=(0,U.Dl)(e),{path:l}=a;Be(t.stops)&&Q(t.stops.features,i,"stops.features",s),Be(t.pointBarriers)&&Q(t.pointBarriers.features,i,"pointBarriers.features",s),Be(t.polylineBarriers)&&Q(t.polylineBarriers.features,i,"polylineBarriers.features",s),Be(t.polygonBarriers)&&Q(t.polygonBarriers.features,i,"polygonBarriers.features",s);const u=await(0,oe.el)(i);for(const e in s){const t=s[e];o.push(e),n[e]=u.slice(t[0],t[1])}if(function(e,t){for(let r=0;r<t.length;r++){const o=e[t[r]];if(o&&o.length)for(const e of o)if(null!=e&&e.hasZ)return!0}return!1}(n,o)){let e=null;try{e=await te(l,t.apiKey,r)}catch{}e&&!e.hasZ&&ee(n,o)}for(const e in n)n[e].forEach((r,o)=>{(0,re.Jt)(t,e)[o].geometry=r});const p={...r,query:{...a.query,...(0,ie.r9)(t),f:"json"}},c=l.endsWith("/solve")?l:`${l}/solve`,{data:y}=await(0,F.A)(c,p);return function(e){const{barriers:t,checksum:r,directionLines:o,directionPoints:i,directions:s,messages:n,polygonBarriers:a,polylineBarriers:l,routes:u,stops:p,traversedEdges:c,traversedJunctions:y,traversedTurns:d}=e,m=e=>{const t=h.find(t=>t.routeName===e);if(null!=t)return t;const r={routeId:h.length+1,routeName:e};return h.push(r),r},g=e=>{const t=h.find(t=>t.routeId===e);if(null!=t)return t;const r={routeId:e,routeName:null};return h.push(r),r},h=[];u?.features.forEach((e,t)=>{e.geometry.spatialReference=u.spatialReference??void 0;const r=e.attributes.Name,o=t+1;h.push({routeId:o,routeName:r,route:e})}),s?.forEach(e=>{const{routeName:t}=e;m(t).directions=e});const f=p?.features.every(e=>null==e.attributes.RouteName)&&h.length>0?h[0].routeName:null;return p?.features.forEach(e=>{e.geometry&&(e.geometry.spatialReference??=p.spatialReference??void 0);const t=f??e.attributes.RouteName,r=m(t);r.stops??=[],r.stops.push(e)}),o?.features.forEach(e=>{const t=e.attributes.RouteID,r=g(t),{geometryType:i,spatialReference:s}=o;r.directionLines??={features:[],geometryType:i,spatialReference:s},r.directionLines.features.push(e)}),i?.features.forEach(e=>{const t=e.attributes.RouteID,r=g(t),{geometryType:o,spatialReference:s}=i;r.directionPoints??={features:[],geometryType:o,spatialReference:s},r.directionPoints.features.push(e)}),c?.features.forEach(e=>{const t=e.attributes.RouteID,r=g(t),{geometryType:o,spatialReference:i}=c;r.traversedEdges??={features:[],geometryType:o,spatialReference:i},r.traversedEdges.features.push(e)}),y?.features.forEach(e=>{const t=e.attributes.RouteID,r=g(t),{geometryType:o,spatialReference:i}=y;r.traversedJunctions??={features:[],geometryType:o,spatialReference:i},r.traversedJunctions.features.push(e)}),d?.features.forEach(e=>{const t=e.attributes.RouteID,r=g(t);r.traversedTurns??={features:[]},r.traversedTurns.features.push(e)}),Me.fromJSON({barriers:t,checksum:r,messages:n,polygonBarriers:a,polylineBarriers:l,routeResults:h})}(y)}(0,o.Cg)([(0,f.MZ)({type:String})],Me.prototype,"checksum",void 0),(0,o.Cg)([(0,f.MZ)({type:[pe]})],Me.prototype,"messages",void 0),(0,o.Cg)([(0,f.MZ)({type:[s.A]})],Me.prototype,"pointBarriers",void 0),(0,o.Cg)([(0,Y.w)("pointBarriers",["barriers"])],Me.prototype,"readPointBarriers",null),(0,o.Cg)([(0,f.MZ)({type:[s.A]})],Me.prototype,"polylineBarriers",void 0),(0,o.Cg)([(0,Y.w)("pol
1ylineBarriers")],Me.prototype,"readPolylineBarriers",null),(0,o.Cg)([(0,f.MZ)({type:[s.A]})],Me.prototype,"polygonBarriers",void 0),(0,o.Cg)([(0,Y.w)("polygonBarriers")],Me.prototype,"readPolygonBarriers",null),(0,o.Cg)([(0,f.MZ)({type:[Ae]})],Me.prototype,"routeResults",void 0),Me=(0,o.Cg)([(0,f.$K)("esri.rest.support.RouteSolveResult")],Me);var Ze=r(66439),Ne=r(79915),Pe=r(70091),je=r(20819),Oe=r(4991),Re=r(58881),Ie=r(14755),Le=r(8636);const De={type:String,json:{read:{source:"token"},write:{target:"token"}}};var ke=r(56053),_e=r(54483);let Je=class extends((0,Ie.OU)(j.o)){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type="layer",this.where=null}};(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],Je.prototype,"doNotLocateOnRestrictedElements",void 0),(0,o.Cg)([(0,f.MZ)({types:_e.yR,json:{read:ke.rS,write:!0}})],Je.prototype,"geometry",void 0),(0,o.Cg)([(0,K.e)(G.Vj)],Je.prototype,"geometryType",void 0),(0,o.Cg)([(0,f.MZ)({type:String,json:{name:"layerName",write:!0}})],Je.prototype,"name",void 0),(0,o.Cg)([(0,K.e)(G.vS,{name:"spatialRel"})],Je.prototype,"spatialRelationship",void 0),(0,o.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],Je.prototype,"type",void 0),(0,o.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],Je.prototype,"where",void 0),Je=(0,o.Cg)([(0,f.$K)("esri.rest.support.DataLayer")],Je);var xe=r(81482),Ee=r(39919);let Fe=class extends((0,Ie.OU)(j.o)){constructor(e){super(e),this.name=null,this.where=null}};(0,o.Cg)([(0,xe.MZ)({json:{write:!0}})],Fe.prototype,"name",void 0),(0,o.Cg)([(0,xe.MZ)({json:{write:!0}})],Fe.prototype,"where",void 0),Fe=(0,o.Cg)([(0,Ee.$)("esri.rest.support.LocateSettingSource")],Fe);const Ue=Fe;let Ge=class extends((0,Ie.OU)(j.o)){constructor(e){super(e),this.allowAutoRelocate=null,this.sources=null}};(0,o.Cg)([(0,xe.MZ)({type:Boolean,json:{write:!0}})],Ge.prototype,"allowAutoRelocate",void 0),(0,o.Cg)([(0,xe.MZ)({type:[Ue],json:{write:!0}})],Ge.prototype,"sources",void 0),Ge=(0,o.Cg)([(0,Ee.$)("esri.rest.support.LocateSettingBase")],Ge);const Ke=Ge;let $e=class extends Ke{constructor(e){super(e),this.tolerance=null,this.toleranceUnits=null}};(0,o.Cg)([(0,xe.MZ)({type:Number,json:{write:!0}})],$e.prototype,"tolerance",void 0),(0,o.Cg)([(0,K.e)(G.Y8)],$e.prototype,"toleranceUnits",void 0),$e=(0,o.Cg)([(0,Ee.$)("esri.rest.support.LocateSetting")],$e);const We=$e;let qe=class extends((0,Ie.OU)(j.o)){constructor(e){super(e),this.stops=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null}};(0,o.Cg)([(0,xe.MZ)({type:We,json:{write:!0}})],qe.prototype,"stops",void 0),(0,o.Cg)([(0,xe.MZ)({type:We,json:{name:"barriers",write:!0}})],qe.prototype,"pointBarriers",void 0),(0,o.Cg)([(0,xe.MZ)({type:Ke,json:{write:!0}})],qe.prototype,"polylineBarriers",void 0),(0,o.Cg)([(0,xe.MZ)({type:Ke,json:{write:!0}})],qe.prototype,"polygonBarriers",void 0),qe=(0,o.Cg)([(0,Ee.$)("esri.rest.support.LocateSettingsOverrides")],qe);const Ve=qe;let ze=class extends((0,Ie.OU)(j.o)){constructor(e){super(e),this.default=null,this.overrides=null}};(0,o.Cg)([(0,xe.MZ)({type:We,json:{write:!0}})],ze.prototype,"default",void 0),(0,o.Cg)([(0,xe.MZ)({type:Ve,json:{write:!0}})],ze.prototype,"overrides",void 0),ze=(0,o.Cg)([(0,Ee.$)("esri.rest.support.LocateSettings")],ze);const Ye=ze;var He;let Xe=class extends se.A{static{He=this}constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new He({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],Xe.prototype,"doNotLocateOnRestrictedElements",void 0),Xe=He=(0,o.Cg)([(0,f.$K)("esri.rest.support.NetworkFeatureSet")],Xe);let Qe=class extends((0,Ie.OU)(j.o)){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};var et;(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],Qe.prototype,"doNotLocateOnRestrictedElements",void 0),(0,o.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],Qe.prototype,"url",void 0),Qe=(0,o.Cg)([(0,f.$K)("esri.rest.support.NetworkUrl")],Qe);let tt=class extends((0,Ie.OU)(j.o)){static{et=this}constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.checksum=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.locateSettings=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnEmptyResults=null,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(e){return(0,Le.PZ)(et,e)}readAccumulateAttributes(e){return null==e?null:e.map(e=>G.et.fromJSON(e))}writeAccumulateAttributes(e,t,r){e?.length&&(t[r]=e.map(e=>G.et.toJSON(e)))}writePointBarriers(e,t,r){rt(e,t,r)}writePolygonBarrier(e,t,r){rt(e,t,r)}writePolylineBarrier(e,t,r){rt(e,t,r)}readRestrictionAttributes(e){return null==e?null:e.map(e=>G.OC.fromJSON(e))}writeRestrictionAttributes(e,t,r){e?.length&&(t[r]=e.map(e=>G.OC.toJSON(e)))}readStartTime(e,t){const{startTime:r}=t;return null==r?null:"now"===r?"now":new Date(r)}writeStartTime(e,t){null!=e&&(t.startTime="now"===e?"now":e.getTime())}readStops(e,t){return function(e){return function(e){return e&&"type"in e}(e)?Je.fromJSON(e):function(e){return e&&"url"in e}(e)?Qe.fromJSON(e):function(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}(e)?Xe.fromJSON(e):function(e){return e&&"features"in e}(e)?se.A.fromJSON(e):null}(t.stops)}writeStops(e,t,r){rt(e,t,r)}};function rt(e,t,r){null!=e&&(t[r]=l.A.isCollection(e)?{features:e.toArray().map(e=>e.toJSON())}:e.toJSON())}(0,o.Cg)([(0,f.MZ)({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],tt.prototype,"accumulateAttributes",void 0),(0,o.Cg)([(0,Y.w)("accumulateAttributes")],tt.prototype,"readAccumulateAttributes",null),(0,o.Cg)([(0,H.K)("accumulateAttributes")],tt.prototype,"writeAccumulateAttributes",null),(0,o.Cg)([(0,f.MZ)(De)],tt.prototype,"apiKey",void 0),(0,o.Cg)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"attributeParameterValues",void 0),(0,o.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],tt.prototype,"checksum",void 0),(0,o.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],tt.prototype,"directionsLanguage",void 0),(0,o.Cg)([(0,K.e)(G.Z7)],tt.prototype,"directionsLengthUnits",void 0),(0,o.Cg)([(0,K.e)(G.aJ)],tt.prototype,"directionsOutputType",void 0),(0,o.Cg)([(0,K.e)(G.$n)],tt.prototype,"directionsStyleName",void 0),(0,o.Cg)([(0,K.e)(G.Mm,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],tt.prototype,"directionsTimeAttribute",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"findBestSequence",void 0),(0,o.Cg)([(0,f.MZ)({type:Number,json:{write:!0}})],tt.prototype,"geometryPrecision",void 0),(0,o.Cg)([(0,f.MZ)({type:Number,json:{write:!0}})],tt.prototype,"geometryPrecisionM",void 0),(0,o.Cg)([(0,f.MZ)({type:Number,json:{write:!0}})],tt.prototype,"geometryPrecisionZ",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"ignoreInvalidLocations",void 0),(0,o.Cg)([(0,K.e)(G.et,{name:"impedanceAttributeName",ignoreUnknown:!1})],tt.prototype,"impedanceAttribute",void 0),(0,o.Cg)([(0,f.MZ)({type:Ye,json:{write:!0}})],tt.prototype,"locateSettings",void 0),(0,o.Cg)([(0,f.MZ)({type:Number,json:{write:!0}})],tt.prototype,"outputGeometryPrecision",void 0),(0,o.Cg)([(0,K.e)(G.hY)],tt.prototype,"outputGeometryPrecisionUnits",void 0),(0,o.Cg)([(0,K.e)(G.Sr)],tt.prototype,"outputLines",void 0),(0,o.Cg)([(0,f.MZ)({type:A.A,json:{name:"outSR",write:!0}})],tt.prototype,"outSpatialReference",void 0),(0,o.Cg)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"overrides",void 0),(0,o.Cg)([(0,f.MZ)({json:{name:"barriers",write:!0}})],tt.prototype,"pointBarriers",void 0),(0,o.Cg)([(0,H.K)("pointBarriers")],tt.prototype,"writePointBarriers",null),(0,o.Cg)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"polygonBarriers",void 0),(0,o.Cg)([(0,H.K)("polygonBarriers")],tt.prototype,"writePolygonBarrier",null),(0,o.Cg)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"polylineBarriers",void 0),(0,o.Cg)([(0,H.K)("polylineBarriers")],tt.prototype,"writePolylineBarrier",null),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"preserveFirstStop",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"preserveLastStop",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"preserveObjectID",void 0),(0,o.Cg)([(0,f.MZ)({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],tt.prototype,"restrictionAttributes",void 0),(0,o.Cg)([(0,Y.w)("restrictionAttributes")],tt.prototype,"readRestrictionAttributes",null),(0,o.Cg)([(0,H.K)("restrictionAttributes")],tt.prototype,"writeRestrictionAttributes",null),(0,o.Cg)([(0,K.e)(G.hE)],tt.prototype,"restrictUTurns",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"returnBarriers",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"returnDirections",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"returnEmptyResults",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"returnPolygonBarriers",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"returnPolylineBarriers",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"returnRoutes",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"returnStops",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"returnTraversedEdges",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"returnTraversedJunctions",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"returnTraversedTurns",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"returnZ",void 0),(0,o.Cg)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"startTime",void 0),(0,o.Cg)([(0,Y.w)("startTime")],tt.prototype,"readStartTime",null),(0,o.Cg)([(0,H.K)("startTime")],tt.prototype,"writeStartTime",null),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"startTimeIsUTC",void 0),(0,o.Cg)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"stops",void 0),(0,o.Cg)([(0,Y.w)("stops")],tt.prototype,"readStops",null),(0,o.Cg)([(0,H.K)("stops")],tt.prototype,"writeStops",null),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"timeWindowsAreUTC",void 0),(0,o.Cg)([(0,f.MZ)({type:z.A,json:{write:!0}})],tt.prototype,"travelMode",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"useHierarchy",void 0),(0,o.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],tt.prototype,"useTimeWindows",void 0),tt=et=(0,o.Cg)([(0,f.$K)("esri.rest.support.RouteParameters")],tt);var ot=r(56760),it=r(33294);function st(e){if(!e.length)return;const t=e.toArray(),r=t.map(({objectId:e})=>e).filter(e=>null!=e);let o=Math.max(...r,0);for(const e of t)e.objectId??=++o}function nt(e,t){return e.length===t.length&&at(e)&&at(t)}
1function at(e){return e.every(({objectId:e})=>null!=e)}function lt(e,t){return!!e.length||!!t.length}function ut(e){return e.length?e:null}function pt(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:pt("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:pt("esriGeometryPolyline")}}}function ct(e){return"layers"in e}async function yt(e){const t=A.A.WGS84;return await(0,b.initializeProjection)(e.spatialReference,t),(0,b.project)(e,t)}function dt(e,t){if(t&&e?.length&&!e.every(({symbol:e})=>!!e))for(const r of e)r.symbol=t}function mt(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function gt(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:(0,g.oU)(e,t,"meters")}const ht=l.A.ofType(Ze.A),ft=l.A.ofType(Ne.A),vt=l.A.ofType(Pe.A),wt=l.A.ofType(je.A),Ct=l.A.ofType(Oe.A),bt=l.A.ofType(it.A);let At=class extends((0,B.dM)((0,N.j)((0,T.q)((0,Z.A)((0,c.M)(M.A)))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.checksum=null,this.defaultSymbols=new k,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new vt,this.polygonBarriers=new wt,this.polylineBarriers=new Ct,this.routeInfo=null,this.spatialReference=A.A.WGS84,this.stops=new bt,this.type="route"}initialize(){const e=()=>{this._setStopSymbol(this.stops)},t=()=>{dt(this.pointBarriers,this.defaultSymbols.pointBarriers)},r=()=>{dt(this.polylineBarriers,this.defaultSymbols.polylineBarriers)},o=()=>{dt(this.polygonBarriers,this.defaultSymbols.polygonBarriers)};this.addHandles([(0,m.on)(()=>this.stops,"change",e,{sync:!0,onListenerAdd:e}),(0,m.on)(()=>this.pointBarriers,"change",t,{sync:!0,onListenerAdd:t}),(0,m.on)(()=>this.polylineBarriers,"change",r,{sync:!0,onListenerAdd:r}),(0,m.on)(()=>this.polygonBarriers,"change",o,{sync:!0,onListenerAdd:o})])}writeFeatureCollectionWebmap(e,t,r,o){const i=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(e=>!!e),s=i.map((e,t)=>t),n="web-map"===o.origin?"featureCollection.layers":"layers";(0,y.sM)(n,i,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",e=>Ze.A.fromGraphic(e))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",e=>Ne.A.fromGraphic(e))}get fullExtent(){const e=new w.A({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:A.A.WGS84});if(null!=this.routeInfo?.geometry)return this.routeInfo.geometry.extent??e;if(null==this.stops)return e;const t=this.stops.filter(e=>null!=e.geometry);if(t.length<2)return e;const{spatialReference:r}=t.at(0).geometry;if(null==r)return e;const o=t.toArray().map(e=>{const t=e.geometry;return[t.x,t.y]});return new C.A({points:o,spatialReference:r}).extent}readMaxScale(e,t){const r=ct(t)?t.layers:t.featureCollection?.layers,o=r?.find(e=>null!=e.layerDefinition.maxScale);return o?.layerDefinition.maxScale??0}readMinScale(e,t){const r=ct(t)?t.layers:t.featureCollection?.layers,o=r?.find(e=>null!=e.layerDefinition.minScale);return o?.layerDefinition.minScale??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",e=>Pe.A.fromGraphic(e))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",e=>je.A.fromGraphic(e))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",e=>Oe.A.fromGraphic(e))}readRouteInfo(e,t){return this._getNetworkFeatures(t,"RouteInfo",e=>Re.A.fromGraphic(e)).at(0)??null}readSpatialReference(e,t){const r=ct(t)?t.layers:t.featureCollection?.layers;if(!r?.length)return A.A.WGS84;const{layerDefinition:o,featureSet:i}=r[0],s=i.features[0],n=s?.geometry?.spatialReference??i.spatialReference??o.spatialReference??o.extent.spatialReference??S.KK;return A.A.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",e=>it.A.fromGraphic(e),e=>this._setStopSymbol(e))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return i.A.routeServiceUrl}set url(e){null!=e?this._set("url",(0,P.Jf)(e,p.A.getLogger(this))):this._set("url",i.A.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}
1removeResult(){null!=this.directionLines&&(this.directionLines.removeAll(),this._set("directionLines",null)),null!=this.directionPoints&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),null!=this.routeInfo&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new u.A("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new u.A("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new u.A("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(!this.routeInfo)throw new u.A("routelayer:route-unsolved","save() requires a solved route");const{portal:r}=t;await r.signIn(),r.user||await t.reload();const{itemUrl:o,itemControl:i}=t;if("admin"!==i&&"update"!==i)throw new u.A("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const s={messages:[],origin:"portal-item",portal:r,url:o?(0,h.An)(o):void 0,writtenProperties:[]},n=this.write(void 0,s);return t.extent=await yt(e),t.title=this.title,await t.update({data:n}),t}async saveAs(e,t={}){if(await this.load(),null==this.routeInfo)throw new u.A("routelayer:route-unsolved","saveAs() requires a solved route");const r=J.default.from(e).clone();r.extent??=await yt(this.fullExtent),r.id=null,r.portal??=_.A.getDefault(),r.title??=this.title,r.type="Feature Collection",r.typeKeywords=["Data","Feature Collection",x.mm.MULTI_LAYER,"Route Layer"];const{portal:o}=r,i={messages:[],origin:"portal-item",portal:o,url:null,writtenProperties:[]};await o.signIn();const s=t?.folder,n=this.write(void 0,i);return await o.user.addItem({item:r,folder:s,data:n}),this.portalItem=r,(0,v.v)(i),i.portalItem=r,r}async solve(e,t){st(this.stops),st(this.pointBarriers),st(this.polylineBarriers),st(this.polygonBarriers);const r=e?.stops??this.stops,o=e?.pointBarriers??ut(this.pointBarriers),i=e?.polylineBarriers??ut(this.polylineBarriers),s=e?.polygonBarriers??ut(this.polygonBarriers);if(null==r)throw new u.A("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((function(e){return"esri.rest.support.FeatureSet"===e.declaredClass}(r)||function(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}(r))&&r.features.length<2||l.A.isCollection(r)&&r.length<2)throw new u.A("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(l.A.isCollection(r))for(const e of r)e.routeName=null;const n=e?.apiKey,{checksum:a,url:p}=this,c=await this._getServiceDescription(p,n,t),y=e?.travelMode??c.defaultTravelMode,m=e?.accumulateAttributes??[];y&&(m.push(y.distanceAttributeName),y.timeAttributeName&&m.push(y.timeAttributeName));const g={accumulateAttributes:m,checksum:a,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:o,polylineBarriers:i,polygonBarriers:s,preserveObjectID:!0,returnBarriers:!!o,returnDirections:!0,returnPolygonBarriers:!!s,returnPolylineBarriers:!!i,returnRoutes:!0,returnStops:!0,stops:r},h=tt.from(e??{});let f;h.set(g);try{f=await Te(p,h,t)}catch(e){throw(0,d.zf)(e)?e:new u.A("routelayer:failed-route-request","the routing request failed",{error:e})}const v=this._toRouteLayerSolution(f);return this._isOverridden("title")||(this.title=v.routeInfo.name??"Route"),this._populatePortalFields(v,c,h),v}update(e){const{checksum:t,directionLines:r,directionPoints:o,pointBarriers:i,polygonBarriers:s,polylineBarriers:n,routeInfo:a,stops:l}=e;nt(l,this.stops)?function(e,t){for(const r of e){const e=t.find(e=>e.objectId===r.objectId);e&&(e.arriveCurbApproach=r.arriveCurbApproach,e.arriveTime=r.arriveTime,e.arriveTimeOffset=r.arriveTimeOffset,e.cumulativeCosts=r.cumulativeCosts,e.cumulativeDistance=r.cumulativeDistance,e.cumulativeDuration=r.cumulativeDuration,e.curbApproach=r.curbApproach,e.departCurbApproach=r.departCurbApproach,e.departTime=r.departTime,e.departTimeOffset=r.departTimeOffset,e.distanceToNetworkInMeters=r.distanceToNetworkInMeters,e.geometry=r.geometry,e.lateDuration=r.lateDuration,e.name=r.name,e.navLatency=r.navLatency,e.positionAlong=r.positionAlong,e.routeName=r.routeName,e.serviceCosts=r.serviceCosts,e.serviceDistance=r.serviceDistance,e.serviceDuration=r.serviceDuration,e.sequence=r.sequence,e.sideOfEdge=r.sideOfEdge,e.snapX=r.snapX,e.snapY=r.snapY,e.snapZ=r.snapZ,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol,e.timeWindowEnd=r.timeWindowEnd,e.timeWindowStart=r.timeWindowStart,e.violations=r.violations,e.waitDuration=r.waitDuration,e.wait=r.wait)}}(l,this.stops):this.set({stops:l}),lt(i,this.pointBarriers)&&(nt(i,this.pointBarriers)?function(e,t){for(const r of e){const e=t.find(e=>e.objectId===r.objectId);e&&(e.addedCost=r.addedCost,e.barrierType=r.barrierType,e.costs=r.costs,e.curbApproach=r.curbApproach,e.fullEdge=r.fullEdge,e.geometry=r.geometry,e.name=r.name,e.sideOfEdge=r.sideOfEdge,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol)}}(i,this.pointBarriers):this.set({pointBarriers:i})),lt(n,this.polylineBarriers)&&(nt(n,this.polylineBarriers)?function(e,t){for(const r of e){const e=t.find(e=>e.objectId===r.objectId);e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}(n,this.polylineBarriers):this.set({polylineBarriers:n})),lt(s,this.polygonBarriers)&&(nt(s,this.polygonBarriers)?function(e,t){for(const r of e){const e=t.find(e=>e.objectId===r.objectId);e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}(s,this.polygonBarriers):this.set({polygonBarriers:s})),this.set({checksum:t}
1),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",a),a.geometry&&(this.spatialReference=a.geometry.spatialReference)}_getNetworkFeatures(e,t,r,o){const i=ct(e)?e.layers:e.featureCollection?.layers,a=i?.find(e=>e.layerDefinition.name===t);if(null==a)return new l.A;const{layerDefinition:u,popupInfo:p,featureSet:c}=a,y=u.drawingInfo.renderer,{features:d}=c,m=c.spatialReference??u.spatialReference??u.extent.spatialReference??S.KK,g=y&&(0,E.L)(y),h=A.A.fromJSON(m),f=d.map(e=>{const o=s.A.fromJSON(e);o.geometry&&e.geometry&&null==e.geometry.spatialReference&&(o.geometry.spatialReference=h);const i=r(o);return i.symbol??=g?.getSymbol(o)??this._getNetworkSymbol(t),i.popupTemplate??=p&&n.A.fromJSON(p),i});return o&&f.some(({symbol:e})=>!e)&&o(f),new l.A(f)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,r){if(null!=this._cachedServiceDescription&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const o=await te(e,t,r);return this._cachedServiceDescription={serviceDescription:o,url:e},o}_setStopSymbol(e){const t=l.A.isCollection(e)?e.toArray():e;if(!t||!t.length||!this.defaultSymbols.stops||t.every(({symbol:e})=>!!e))return;const{first:r,last:o,middle:i,unlocated:s,waypoint:n,break:u}=this.defaultSymbols.stops,p=t.map(({sequence:e})=>e).filter(a.Ru),c=t.length===p.length;if(!this.routeInfo&&!c||1===t.length)return void t.forEach((e,s)=>{switch(s){case 0:e.symbol=r;break;case t.length-1:e.symbol=o;break;default:e.symbol=i}});const y=Math.min(...p),d=Math.max(...p);for(const e of t)e.sequence!==y?e.sequence!==d?this.routeInfo&&"ok"!==e.status&&"not-located-on-closest"!==e.status?e.symbol=s:"waypoint"!==e.locationType?"break"!==e.locationType?e.symbol=i:e.symbol=u:e.symbol=n:e.symbol=o:e.symbol=r}_toRouteLayerSolution(e){const{checksum:t,routeResults:r}=e,o=r[0].stops?.map(e=>it.A.fromJSON(e.toJSON()));this._setStopSymbol(o);const i=new bt(o),s=new wt(e.polygonBarriers?.map(e=>je.A.fromJSON(e.toJSON())));dt(s,this.defaultSymbols.polygonBarriers);const n=new Ct(e.polylineBarriers?.map(e=>Oe.A.fromJSON(e.toJSON())));dt(n,this.defaultSymbols.polylineBarriers);const a=new vt(e.pointBarriers?.map(e=>Pe.A.fromJSON(e.toJSON())));dt(a,this.defaultSymbols.pointBarriers);const l=r[0].route?.toJSON(),u=Re.A.fromJSON(l);u.symbol=this.defaultSymbols.routeInfo;const p=new ft(r[0].directionPoints?.features.map(e=>Ne.A.fromJSON(e.toJSON())));dt(p,this.defaultSymbols.directionPoints);const c=new ht(r[0].directionLines?.features.map(e=>Ze.A.fromJSON(e.toJSON())));return dt(c,this.defaultSymbols.directionLines),{checksum:t,directionLines:c,directionPoints:p,pointBarriers:a,polygonBarriers:s,polylineBarriers:n,routeInfo:u,stops:i}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",Ze.A.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",Ne.A.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,r,o,i,s){if(!e?.length)return null;const n=this.spatialReference.toJSON(),{fullExtent:a,maxScale:l,minScale:u}=this;return{featureSet:{features:e.toArray().map(e=>function(e){const{attributes:t,geometry:r,popupTemplate:o,symbol:i}=e.toGraphic().toJSON();return{attributes:t,geometry:r,popupInfo:o,symbol:i}}(e)),geometryType:r,spatialReference:n},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:t?.toJSON()??pt(r)}},extent:a.toJSON(),fields:o,geometryType:r,hasM:!1,hasZ:!1,maxScale:l,minScale:u,name:i,objectIdField:"ObjectID",spatialReference:n,title:s,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",Pe.A.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",je.A.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",Oe.A.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(null!=this.routeInfo?new l.A([this.routeInfo]
1):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",Re.A.fields,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",it.A.fields,"Stops","Stops");if(null==e)return null;const{stops:t}=this.defaultSymbols,r=t?.first?.toJSON(),o=t?.middle?.toJSON(),i=t?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:o,uniqueValueInfos:[{value:"1",symbol:r,label:"First Stop"},{value:`${this.stops.length}`,symbol:i,label:"Last Stop"}]},e}_populatePortalFields(e,t,r){const o=t.networkDataset?.networkAttributes,i=o?.filter(({usageType:e})=>"cost"===e)??[],s=r.travelMode??t.defaultTravelMode;if(null==s)return void p.A.getLogger(this).warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:n,distanceAttributeName:a}=s,l=i.find(({name:e})=>e===n),c=i.find(({name:e})=>e===a),y=r.travelMode?.impedanceAttributeName??r.impedanceAttribute??t.impedance,d=l?.units,m=c?.units;if(!d||!m)throw new u.A("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const g=r.directionsLanguage??t.directionsLanguage,h=r.accumulateAttributes??t.accumulateAttributeNames??[],f=new Set(i.filter(({name:e})=>e===n||e===a||e===y||null!=e&&h.includes(e)).map(({name:e})=>e)),v=e=>{for(const t in e)f.has(t)||delete e[t]};for(const t of e.pointBarriers)null!=t.costs&&(t.addedCost=t.costs[y]??0,v(t.costs));for(const t of e.polygonBarriers)null!=t.costs&&(t.scaleFactor=t.costs[y]??1,v(t.costs));for(const t of e.polylineBarriers)null!=t.costs&&(t.scaleFactor=t.costs[y]??1,v(t.costs));const{routeInfo:w}=e,{findBestSequence:C,preserveFirstStop:b,preserveLastStop:A,startTimeIsUTC:S,timeWindowsAreUTC:M}=r;w.analysisSettings=new ot.A({accumulateAttributes:h,directionsLanguage:g,findBestSequence:C,preserveFirstStop:b,preserveLastStop:A,startTimeIsUTC:S,timeWindowsAreUTC:M,travelMode:s}),w.totalDuration=mt(w.totalCosts?.[n]??0,d),w.totalDistance=gt(w.totalCosts?.[a]??0,m),w.totalLateDuration=mt(w.totalViolations?.[n]??0,d),w.totalWaitDuration=mt(w.totalWait?.[n]??0,d),null!=w.totalCosts&&v(w.totalCosts),null!=w.totalViolations&&v(w.totalViolations),null!=w.totalWait&&v(w.totalWait);for(const t of e.stops)null!=t.serviceCosts&&(t.serviceDuration=mt(t.serviceCosts[n]??0,d),t.serviceDistance=gt(t.serviceCosts[a]??0,m),v(t.serviceCosts)),null!=t.cumulativeCosts&&(t.cumulativeDuration=mt(t.cumulativeCosts[n]??0,d),t.cumulativeDistance=gt(t.cumulativeCosts[a]??0,m),v(t.cumulativeCosts)),null!=t.violations&&(t.lateDuration=mt(t.violations[n]??0,d),v(t.violations)),null!=t.wait&&(t.waitDuration=mt(t.wait[n]??0,d),v(t.wait))}};(0,o.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],At.prototype,"_featureCollection",void 0),(0,o.Cg)([(0,H.K)(["web-map","portal-item"],"_featureCollection")],At.prototype,"writeFeatureCollectionWebmap",null),(0,o.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],At.prototype,"_type",void 0),(0,o.Cg)([(0,f.MZ)({type:String})],At.prototype,"checksum",void 0),(0,o.Cg)([(0,f.MZ)({nonNullable:!0,type:k})],At.prototype,"defaultSymbols",void 0),(0,o.Cg)([(0,f.MZ)({readOnly:!0})],At.prototype,"directionLines",void 0),(0,o.Cg)([(0,Y.w)(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],At.prototype,"readDirectionLines",null),(0,o.Cg)([(0,f.MZ)({readOnly:!0})],At.prototype,"directionPoints",void 0),(0,o.Cg)([(0,Y.w)(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],At.prototype,"readDirectionPoints",null),(0,o.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],At.prototype,"featureCollectionType",void 0),(0,o.Cg)([(0,f.MZ)({readOnly:!0})],At.prototype,"fullExtent",null),(0,o.Cg)([(0,f.MZ)({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],At.prototype,"legendEnabled",void 0),(0,o.Cg)([(0,f.MZ)({type:["show","hide"]})],At.prototype,"listMode",void 0),(0,o.Cg)([(0,f.MZ)({type:Number,nonNullable:!0,json:{write:!1}})],At.prototype,"maxScale",void 0),(0,o.Cg)([(0,Y.w)(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],At.prototype,"readMaxScale",null),(0,o.Cg)([(0,f.MZ)({type:Number,nonNullable:!0,json:{write:!1}})],At.prototype,"minScale",void 0),(0,o.Cg)([(0,Y.w)(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],At.prototype,"readMinScale",null),(0,o.Cg)([(0,f.MZ)({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],At.prototype,"operationalLayerType",void 0),(0,o.Cg)([(0,f.MZ)({nonNullable:!0,type:l.A.ofType(Pe.A)})],At.prototype,"pointBarriers",void 0),(0,o.Cg)([(0,Y.w)(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],At.prototype,"readPointBarriers",null),(0,o.Cg)([(0,f.MZ)({nonNullable:!0,type:l.A.ofType(je.A)})],At.prototype,"polygonBarriers",void 0),(0,o.Cg)([(0,Y.w)(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],At.prototype,"readPolygonBarriers",null),(0,o.Cg)([(0,f.MZ)({nonNullable:!0,type:l.A.ofType(Oe.A)})],At.prototype,"polylineBarriers",void 0),(0,o.Cg)([(0,Y.w)(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],At.prototype,"readPolylineBarriers",null),(0,o.Cg)([(0,f.MZ)({readOnly:!0})],At.prototype,"routeInfo",void 0),(0,o.Cg)([(0,Y.w)(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],At.prototype,"readRouteInfo",null),(0,o.Cg)([(0,f.MZ)({type:A.A})],At.prototype,"spatialReference",void 0),(0,o.Cg)([(0,Y.w)(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],At.prototype,"readSpatialReference",null),(0,o.Cg)([(0,f.MZ)({nonNullable:!0,type:l.A.ofType(it.A)})],At.prototype,"stops",void 0),(0,o.Cg)([(0,Y.w)(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],At.prototype,"readStops",null),(0,o.Cg)([(0,f.MZ)()],At.prototype,"title",null),(0,o.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],At.prototype,"type",void 0),(0,o.Cg)([(0,f.MZ)()],At.prototype,"url",null),At=(0,o.Cg)([(0,f.$K)("esri.layers.RouteLayer")],At);const St=At},71434(e,t,r){var o=r(31635),i=r(1817),s=r(84977),n=r(69636);const a=new i.J({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"});let l=class extends s.o{constructor(e){super(e),this.description=null,this.type=null}};(0,o.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],l.prototype,"description",void 0),(0,o.Cg)([(0,n.MZ)({type:String,json:{read:a.read,write:a.write}})],l.prototype,"type",void 0),l=(0,o.Cg)([(0,n.$K)("esri.rest.support.GPMessage")],l);const u=l;r.d(t,["A",0,u])}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.