PageSourceSearch

https://combatingracism.com/wp-content/themes/mappingblackca/js/mi…s_RouteLayer_js-3325ee12cc3a170e32ae.min.js

js combatingracism.com collected 2026-10-05 10:39:08 UTC 52,742 bytes, 2 lines download raw bytes

1"use strict";(globalThis.webpackChunkmbc_theme=globalThis.webpackChunkmbc_theme||[]).push([["vendors-node_modules_arcgis_core_layers_RouteLayer_js"],{29927:(e,t,r)=>{r.d(t,{aX:()=>S,or:()=>C});var o=r(51366),i=r(70375),s=r(13802),n=r(89542),l=r(90819),a=r(25266),u=r(35925),p=r(39536),c=(r(91957),r(66341)),y=r(53736),d=r(84238);var f=r(3466),m=r(5167);const h=s.Z.getLogger("esri.geometry.support.normalizeUtils");function v(e){return"polygon"===e[0].type}function w(e){return"polyline"===e[0].type}function g(e,t,r){if(t){const t=function(e,t){if(!(e instanceof l.Z||e instanceof n.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw h.error(e),new i.Z(e)}const r=(0,a.x3)(e),o=[];for(const e of r){const r=[];o.push(r),r.push([e[0][0],e[0][1]]);for(let o=0;o<e.length-1;o++){const i=e[o][0],s=e[o][1],n=e[o+1][0],l=e[o+1][1],a=Math.sqrt((n-i)*(n-i)+(l-s)*(l-s)),u=(l-s)/a,p=(n-i)/a,c=a/t;if(c>1){for(let e=1;e<=c-1;e++){const o=e*t,n=p*o+i,l=u*o+s;r.push([n,l])}const e=(a+Math.floor(c-1)*t)/2,o=p*e+i,n=u*e+s;r.push([o,n])}r.push([n,l])}}return function(e){return"polygon"===e.type}(e)?new n.Z({rings:o,spatialReference:e.spatialReference}):new l.Z({paths:o,spatialReference:e.spatialReference})}(e,1e6);e=(0,p.Sx)(t,!0)}return r&&(e=(0,a.Sy)(e,r)),e}function b(e,t,r){if(Array.isArray(e)){const o=e[0];if(o>t){const r=(0,a.XZ)(o,t);e[0]=o+r*(-2*t)}else if(o<r){const t=(0,a.XZ)(o,r);e[0]=o+t*(-2*r)}
1}else{const o=e.x;if(o>t){const r=(0,a.XZ)(o,t);e=e.clone().offset(r*(-2*t),0)}else if(o<r){const t=(0,a.XZ)(o,r);e=e.clone().offset(t*(-2*r),0)}}return e}function _(e,t){let r=-1;for(let o=0;o<t.cutIndexes.length;o++){const i=t.cutIndexes[o],s=t.geometries[o],n=(0,a.x3)(s);for(let e=0;e<n.length;e++){const t=n[e];t.some((r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const o=t[e][0];r=o>r?o:r}r=Number(r.toFixed(9));const o=-360*(0,a.XZ)(r,180);for(let r=0;r<t.length;r++){const t=s.getPoint(e,r);s.setPoint(e,r,t.clone().offset(o,0))}return!0}}))}if(i===r){if(v(e))for(const t of(0,a.x3)(s))e[i]=e[i].addRing(t);else if(w(e))for(const t of(0,a.x3)(s))e[i]=e[i].addPath(t)}else r=i,e[i]=s}return e}async function S(e,t,r){if(!Array.isArray(e))return S([e],t);t&&"string"!=typeof t&&h.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const i="string"==typeof t?t:t?.url??o.Z.geometryServiceUrl;let s,v,w,C,Z,B,T,N,R=0;const P=[],L=[];for(const t of e)if(null!=t)if(s||(s=t.spatialReference,v=(0,u.C5)(s),w=s.isWebMercator,B=w?102100:4326,C=a.UZ[B].maxX,Z=a.UZ[B].minX,T=a.UZ[B].plus180Line,N=a.UZ[B].minus180Line),v)if("mesh"===t.type)L.push(t);else if("point"===t.type)L.push(b(t.clone(),C,Z));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>b(e,C,Z))),L.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,v);L.push(e.rings?new n.Z(e):e)}else if(t.extent){const e=t.extent,r=(0,a.XZ)(e.xmin,Z)*(2*C);let o=0===r?t.clone():(0,a.Sy)(t.clone(),r);e.offset(r,0),e.intersects(T)&&e.xmax!==C?(R=e.xmax>R?e.xmax:R,o=g(o,w),P.push(o),L.push("cut")):e.intersects(N)&&e.xmin!==Z?(R=e.xmax*(2*C)>R?e.xmax*(2*C):R,o=g(o,w,360),P.push(o),L.push("cut")):L.push(o)}else L.push(t.clone());else L.push(t);else L.push(t);let j=(0,a.XZ)(R,C),I=-90;const A=j,J=new l.Z;for(;j>0;){const e=360*j-180;J.addPath([[e,I],[e,-1*I]]),I*=-1,j--}if(P.length>0&&A>0){const t=_(P,await async function(e,t,r,o){const i=(0,d.en)(e),s=t[0].spatialReference,n={...o,query:{...i.query,f:"json",sr:JSON.stringify(s),target:JSON.stringify({geometryType:(0,y.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},l=await(0,c.default)(i.path+"/cut",n),{cutIndexes:a,geometries:u=[]}=l.data;return{cutIndexes:a,geometries:u.map((e=>{const t=(0,y.im)(e);return t.spatialReference=s,t}))}}(i,P,J,r)),o=[],s=[];for(let r=0;r<L.length;r++){const i=L[r];if("cut"!==i)s.push(i);else{const i=t.shift(),n=e[r];null!=n&&"polygon"===n.type&&n.rings&&n.rings.length>1&&i.rings.length>=n.rings.length?(o.push(i),s.push("simplify")):s.push(w?(0,p.$)(i):i)}}if(!o.length)return s;const n=await async function(e,t,r){const o="string"==typeof e?(0,f.mN)(e):e,i=t[0].spatialReference,s=(0,y.Ji)(t[0]),n={...r,query:{...o.query,f:"json",sr:i.wkid??JSON.stringify(i),geometries:JSON.stringify((0,m.F)(t))}},{data:l}=await(0,c.default)(o.path+"/simplify",n);return(0,m.o)(l.geometries,s,i)}(i,o,r),l=[];for(let e=0;e<s.length;e++){const t=s[e];"simplify"!==t?l.push(t):l.push(w?(0,p.$)(n.shift()):n.shift())}return l}const O=[];for(let e=0;e<L.length;e++){const t=L[e];if("cut"!==t)O.push(t);else{const e=P.shift();O.push(!0===w?(0,p.$)(e):e)}}return O}function C(e,t){const r=(0,u.C5)(t);if(r){const[t,o]=r.valid,i=o-t;if(e<t)for(;e<t;)e+=i;if(e>o)for(;e>o;)e-=i}return e}},25266:(e,t,r)=>{r.d(t,{Sy:()=>a,UZ:()=>n,XZ:()=>l,x3:()=>u});var o=r(90819),i=r(14685),s=r(53736);const n={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new o.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.Z.WebMercator}),minus180Line:new o.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new o.Z({paths:[[[180,-180],[180,180]]],spatialReference:i.Z.WGS84}),minus180Line:new o.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:i.Z.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function a(e,t){const r=u(e);for(const e of r)for(const r of e)r[0]+=t;return e}function u(e){return(0,s.oU)(e)?e.rings:e.paths}}
1,15015:(e,t,r)=>{r.r(t),r.d(t,{default:()=>gt});var o=r(36663),i=r(51366),s=r(91957),n=r(80085),l=r(80020),a=(r(86004),r(45510),r(16192),r(71297),r(878),r(22836),r(50172),r(72043),r(72506)),u=r(6865),p=r(70375),c=r(53280),y=r(13802),d=r(15842),f=r(86745),m=r(78668),h=r(76868),v=r(17321),w=r(3466),g=r(81977),b=r(7283),_=r(7753),S=(r(39994),r(34248)),C=r(40266),Z=r(39835),B=r(50516),T=r(91772),N=r(92376),R=r(35925),P=r(38481),L=r(27668),j=r(43330),I=r(18241),A=r(95874),J=r(20692),O=r(4905),x=r(82064),D=r(1759);let M=class extends x.wq{constructor(e){super(e),this.break=new D.Z({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new D.Z({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new D.Z({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new D.Z({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new D.Z({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new D.Z({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};(0,o._)([(0,g.Cb)({types:O.LB})],M.prototype,"break",void 0),(0,o._)([(0,g.Cb)({types:O.LB})],M.prototype,"first",void 0),(0,o._)([(0,g.Cb)({types:O.LB})],M.prototype,"unlocated",void 0),(0,o._)([(0,g.Cb)({types:O.LB})],M.prototype,"last",void 0),(0,o._)([(0,g.Cb)({types:O.LB})],M.prototype,"middle",void 0),(0,o._)([(0,g.Cb)({types:O.LB})],M.prototype,"waypoint",void 0),M=(0,o._)([(0,C.j)("esri.layers.support.RouteStopSymbols")],M);const k=M;var U=r(15498),F=r(43411);let E=class extends x.wq{constructor(e){super(e),this.directionLines=new U.Z({color:[0,122,194],width:6}),this.directionPoints=new D.Z({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new D.Z({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new F.Z({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new U.Z({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new U.Z({width:8,color:[20,89,127]}),this.stops=new k}};(0,o._)([(0,g.Cb)({types:O.LB})],E.prototype,"directionLines",void 0),(0,o._)([(0,g.Cb)({types:O.LB})],E.prototype,"directionPoints",void 0),(0,o._)([(0,g.Cb)({types:O.LB})],E.prototype,"pointBarriers",void 0),(0,o._)([(0,g.Cb)({types:O.LB})],E.prototype,"polygonBarriers",void 0),(0,o._)([(0,g.Cb)({types:O.LB})],E.prototype,"polylineBarriers",void 0),(0,o._)([(0,g.Cb)({types:O.LB})],E.prototype,"routeInfo",void 0),(0,o._)([(0,g.Cb)({type:k})],E.prototype,"stops",void 0),E=(0,o._)([(0,C.j)("esri.layers.support.RouteSymbols")],E);const G=E;var q=r(93968),W=r(53110),X=r(31370),z=r(66341),V=r(84238),$=r(79438),K=r(55065);let Q=class extends x.wq{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._)([(0,g.Cb)({type:String})],Q.prototype,"dataType",void 0),(0,o._)([(0,$.J)(K.Ul,{ignoreUnknown:!1})],Q.prototype,"name",void 0),(0,o._)([(0,g.Cb)({type:[String]})],Q.prototype,"parameterNames",void 0),(0,o._)([(0,g.Cb)({type:String})],Q.prototype,"restrictionUsageParameterName",void 0),(0,o._)([(0,$.J)(K.ZI,{ignoreUnknown:!1})],Q.prototype,"timeNeutralAttributeName",void 0),(0,o._)([(0,g.Cb)({type:String})],Q.prototype,"trafficSupport",void 0),(0,o._)([(0,$.J)(K.dg)],Q.prototype,"units",void 0),(0,o._)([(0,$.J)(K.E2)],Q.prototype,"usageType",void 0),Q=(0,o._)([(0,C.j)("esri.rest.support.NetworkAttribute")],Q);const H=Q;let Y=class extends x.wq{constructor(e){super(e),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};(0,o._)([(0,g.Cb)({type:Number})],Y.prototype,"buildTime",void 0),(0,o._)([(0,g.Cb)({type:String})],Y.prototype,"name",void 0),(0,o._)([(0,g.Cb)({type:[H]})],Y.prototype,"networkAttributes",void 0),(0,o._)([(0,g.Cb)()],Y.prototype,"networkSources",void 0),(0,o._)([(0,g.Cb)({type:String})],Y.prototype,"state",void 0),Y=(0,o._)([(0,C.j)("esri.rest.support.NetworkDataset")],Y);const ee=Y;var te=r(23688);let re=class extends x.wq{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=>K.Ul.fromJSON(e)))}writeAccumulateAttributes(e,t,r){null!=e&&e.length&&(t[r]=e.map((e=>K.Ul.toJSON(e))))}
1readDefaultTravelMode(e,t){const r=t.supportedTravelModes?.find((({id:e})=>e===t.defaultTravelMode))??t.supportedTravelModes?.find((({itemId:e})=>e===t.defaultTravelMode));return r?te.Z.fromJSON(r):null}};(0,o._)([(0,g.Cb)()],re.prototype,"accumulateAttributeNames",void 0),(0,o._)([(0,S.r)("accumulateAttributeNames")],re.prototype,"readAccumulateAttributes",null),(0,o._)([(0,Z.c)("accumulateAttributeNames")],re.prototype,"writeAccumulateAttributes",null),(0,o._)([(0,g.Cb)()],re.prototype,"attributeParameterValues",void 0),(0,o._)([(0,g.Cb)()],re.prototype,"currentVersion",void 0),(0,o._)([(0,g.Cb)()],re.prototype,"defaultTravelMode",void 0),(0,o._)([(0,S.r)("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],re.prototype,"readDefaultTravelMode",null),(0,o._)([(0,g.Cb)()],re.prototype,"directionsLanguage",void 0),(0,o._)([(0,$.J)(K.GX)],re.prototype,"directionsLengthUnits",void 0),(0,o._)([(0,g.Cb)()],re.prototype,"directionsSupportedLanguages",void 0),(0,o._)([(0,$.J)(K.ZI,{ignoreUnknown:!1})],re.prototype,"directionsTimeAttribute",void 0),(0,o._)([(0,g.Cb)()],re.prototype,"hasZ",void 0),(0,o._)([(0,$.J)(K.Ul,{ignoreUnknown:!1})],re.prototype,"impedance",void 0),(0,o._)([(0,g.Cb)({type:ee})],re.prototype,"networkDataset",void 0),(0,o._)([(0,g.Cb)({type:[te.Z]})],re.prototype,"supportedTravelModes",void 0),re=(0,o._)([(0,C.j)("esri.rest.support.NetworkServiceDescription")],re);const oe=re,ie=y.Z.getLogger("esri.rest.networkService");function se(e,t,r,o){o[r]=[t.length,t.length+e.length],e.forEach((e=>{t.push(e.geometry)}))}async function ne(e,t,r){if(!e)throw new p.Z("network-service:missing-url","Url to Network service is missing");const o=(0,V.lA)({f:"json",token:t},r),{data:i}=await(0,z.default)(e,o),s=i.currentVersion>=10.4?async function(e,t,r){try{const o=(0,V.lA)({f:"json",token:t},r),i=(0,w.Qj)(e)+"/retrieveTravelModes",{data:{supportedTravelModes:s,defaultTravelMode:n}}=await(0,z.default)(i,o);return{supportedTravelModes:s,defaultTravelMode:n}}catch(e){throw new p.Z("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:e})}}(e,t,r):async function(e,t){const r=(0,V.lA)({f:"json"},t),{data:o}=await(0,z.default)(e.replace(/\/rest\/.*$/i,"/info"),r);if(!o||!o.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:i}=o,s=(0,w.Qj)(i)+"/sharing/rest/portals/self",{data:n}=await(0,z.default)(s,r),l=(0,f.hS)("helperServices.routingUtilities.url",n);if(!l)return{supportedTravelModes:[],defaultTravelMode:null};const a=(0,V.en)(i),u=/\/solve$/i.test(a.path)?"Route":/\/solveclosestfacility$/i.test(a.path)?"ClosestFacility":"ServiceAreas",p=(0,V.lA)({f:"json",serviceName:u},t),c=(0,w.Qj)(l)+"/GetTravelModes/execute",y=await(0,z.default)(c,p),d=[];let m=null;if(y?.data?.results?.length){const e=y.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);d.push(t)}}else"defaultTravelMode"===t.paramName&&(m=t.value)}return{supportedTravelModes:d,defaultTravelMode:m}}(e,r),{defaultTravelMode:n,supportedTravelModes:l}=await s;return i.defaultTravelMode=n,i.supportedTravelModes=l,oe.fromJSON(i)}var le=r(29927),ae=r(13295),ue=r(51211),pe=r(25709);const ce=new pe.X({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"});let ye=class extends x.wq{constructor(e){super(e),this.description=null,this.type=null}};(0,o._)([(0,g.Cb)({type:String,json:{write:!0}})],ye.prototype,"description",void 0),(0,o._)([(0,g.Cb)({type:String,json:{read:ce.read,write:ce.write}})],ye.prototype,"type",void 0),ye=(0,o._)([(0,C.j)("esri.rest.support.GPMessage")],ye);const de=ye,fe=new pe.X({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let me=class extends de{constructor(e){super(e),this.type=null}};(0,o._)([(0,g.Cb)({type:String,json:{read:fe.read,write:fe.write}})],me.prototype,"type",void 0),me=(0,o._)([(0,C.j)("esri.rest.support.NAMessage")],me);const he=me;let ve=class extends x.wq{constructor(e){super(e)}};(0,o._)([(0,g.Cb)({json:{read:{source:"string"}}})],ve.prototype,"text",void 0),(0,o._)([(0,$.J)(K.Ks,{name:"stringType"})],ve.prototype,"type",void 0),ve=(0,o._)([(0,C.j)("esri.rest.support.DirectionsString")],ve);const we=ve;var ge=r(67666);let be=class extends x.wq{constructor(e){super(e),this.arriveTime=null,this.arriveTimeOff
1set=null,this.geometry=null,this.strings=null}readArriveTimeOffset(e,t){return(0,ae.pQ)(t.ETA,t.arriveTimeUTC)}readGeometry(e,t){return ge.Z.fromJSON(t.point)}};(0,o._)([(0,g.Cb)({type:Date,json:{read:{source:"arriveTimeUTC"}}})],be.prototype,"arriveTime",void 0),(0,o._)([(0,g.Cb)()],be.prototype,"arriveTimeOffset",void 0),(0,o._)([(0,S.r)("arriveTimeOffset",["arriveTimeUTC","ETA"])],be.prototype,"readArriveTimeOffset",null),(0,o._)([(0,g.Cb)({type:ge.Z})],be.prototype,"geometry",void 0),(0,o._)([(0,S.r)("geometry",["point"])],be.prototype,"readGeometry",null),(0,o._)([(0,g.Cb)({type:[we]})],be.prototype,"strings",void 0),be=(0,o._)([(0,C.j)("esri.rest.support.DirectionsEvent")],be);const _e=be;var Se=r(90819);let Ce=class extends n.Z{constructor(e){super(e),this.events=null,this.strings=null}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,l,a,u,p,c,y,d,f=0,m=0,h=0;if(p=e.match(/((\+|\-)[^\+\-\|]+|\|)/g),p||(p=[]),0===parseInt(p[f],32)){f=2;const e=parseInt(p[f],32);f++,c=parseInt(p[f],32),f++,1&e&&(m=p.indexOf("|")+1,y=parseInt(p[m],32),m++),2&e&&(h=p.indexOf("|",m)+1,d=parseInt(p[h],32),h++)}else c=parseInt(p[f],32),f++;for(;f<p.length&&"|"!==p[f];){n=parseInt(p[f],32)+t,f++,t=n,l=parseInt(p[f],32)+r,f++,r=l;const e=[n/c,l/c];m&&(u=parseInt(p[m],32)+o,m++,o=u,e.push(u/y)),h&&(a=parseInt(p[h],32)+i,h++,i=a,e.push(a/d)),s.push(e)}return{paths:[s],hasZ:m>0,hasM:h>0}}(t.compressedGeometry);return null!=r?Se.Z.fromJSON(r):null}};(0,o._)([(0,g.Cb)({type:[_e]})],Ce.prototype,"events",void 0),(0,o._)([(0,S.r)("geometry",["compressedGeometry"])],Ce.prototype,"readGeometry",null),(0,o._)([(0,g.Cb)({type:[we]})],Ce.prototype,"strings",void 0),Ce=(0,o._)([(0,C.j)("esri.rest.support.DirectionsFeature")],Ce);const Ze=Ce;var Be=r(14685);let Te=class extends ue.Z{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&&Be.Z.fromJSON(r);return e.map((e=>{const t=Ze.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 Se.Z({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 Se.Z({hasM:i,hasZ:s,paths:[o],spatialReference:t})}(this.features.map((({geometry:e})=>e)),this.extent.spatialReference):null}get strings(){return this.features.map((({strings:e})=>e)).flat().filter(_.pC)}};(0,o._)([(0,g.Cb)({type:T.Z,json:{read:{source:"summary.envelope"}}})],Te.prototype,"extent",void 0),(0,o._)([(0,g.Cb)({nonNullable:!0})],Te.prototype,"features",void 0),(0,o._)([(0,S.r)("features")],Te.prototype,"readFeatures",null),(0,o._)([(0,g.Cb)()],Te.prototype,"geometryType",void 0),(0,o._)([(0,g.Cb)({readOnly:!0})],Te.prototype,"mergedGeometry",null),(0,o._)([(0,g.Cb)()],Te.prototype,"routeId",void 0),(0,o._)([(0,g.Cb)()],Te.prototype,"routeName",void 0),(0,o._)([(0,g.Cb)({value:null,readOnly:!0})],Te.prototype,"strings",null),(0,o._)([(0,g.Cb)({json:{read:{source:"summary.totalDriveTime"}}})],Te.prototype,"totalDriveTime",void 0),(0,o._)([(0,g.Cb)({json:{read:{source:"summary.totalLength"}}})],Te.prototype,"totalLength",void 0),(0,o._)([(0,g.Cb)({json:{read:{source:"summary.totalTime"}}})],Te.prototype,"totalTime",void 0),Te=(0,o._)([(0,C.j)("esri.rest.support.DirectionsFeatureSet")],Te);const Ne=Te;let Re=class extends x.wq{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._)([(0,g.Cb)({type:ue.Z,json:{write:!0}}
1)],Re.prototype,"directionLines",void 0),(0,o._)([(0,g.Cb)({type:ue.Z,json:{write:!0}})],Re.prototype,"directionPoints",void 0),(0,o._)([(0,g.Cb)({type:Ne,json:{write:!0}})],Re.prototype,"directions",void 0),(0,o._)([(0,g.Cb)({type:n.Z,json:{write:!0}})],Re.prototype,"route",void 0),(0,o._)([(0,g.Cb)({type:String,json:{write:!0}})],Re.prototype,"routeName",void 0),(0,o._)([(0,g.Cb)({type:[n.Z],json:{write:!0}})],Re.prototype,"stops",void 0),(0,o._)([(0,g.Cb)({type:ue.Z,json:{write:!0}})],Re.prototype,"traversedEdges",void 0),(0,o._)([(0,g.Cb)({type:ue.Z,json:{write:!0}})],Re.prototype,"traversedJunctions",void 0),(0,o._)([(0,g.Cb)({type:ue.Z,json:{write:!0}})],Re.prototype,"traversedTurns",void 0),Re=(0,o._)([(0,C.j)("esri.rest.support.RouteResult")],Re);const Pe=Re;function Le(e){return e?ue.Z.fromJSON(e).features.filter(_.pC):[]}let je=class extends x.wq{constructor(e){super(e),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(e,t){return Le(t.barriers)}readPolylineBarriers(e){return Le(e)}readPolygonBarriers(e){return Le(e)}};(0,o._)([(0,g.Cb)({type:[he]})],je.prototype,"messages",void 0),(0,o._)([(0,g.Cb)({type:[n.Z]})],je.prototype,"pointBarriers",void 0),(0,o._)([(0,S.r)("pointBarriers",["barriers"])],je.prototype,"readPointBarriers",null),(0,o._)([(0,g.Cb)({type:[n.Z]})],je.prototype,"polylineBarriers",void 0),(0,o._)([(0,S.r)("polylineBarriers")],je.prototype,"readPolylineBarriers",null),(0,o._)([(0,g.Cb)({type:[n.Z]})],je.prototype,"polygonBarriers",void 0),(0,o._)([(0,S.r)("polygonBarriers")],je.prototype,"readPolygonBarriers",null),(0,o._)([(0,g.Cb)({type:[Pe]})],je.prototype,"routeResults",void 0),je=(0,o._)([(0,C.j)("esri.rest.support.RouteSolveResult")],je);const Ie=je;function Ae(e){return e instanceof ue.Z}async function Je(e,t,r){const o=[],i=[],s={},n={},l=(0,V.en)(e),{path:a}=l;Ae(t.stops)&&se(t.stops.features,i,"stops.features",s),Ae(t.pointBarriers)&&se(t.pointBarriers.features,i,"pointBarriers.features",s),Ae(t.polylineBarriers)&&se(t.polylineBarriers.features,i,"polylineBarriers.features",s),Ae(t.polygonBarriers)&&se(t.polygonBarriers.features,i,"polygonBarriers.features",s);const u=await(0,le.aX)(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 ne(a,t.apiKey,r)}catch{}e&&!e.hasZ&&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)e.z=void 0}ie.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.")}(n,o)}for(const e in n)n[e].forEach(((r,o)=>{t.get(e)[o].geometry=r}));const p={...r,query:{...l.query,...(0,ae.Yc)(t),f:"json"}},c=a.endsWith("/solve")?a:`${a}/solve`,{data:y}=await(0,z.default)(c,p);return function(e){const{barriers:t,directionLines:r,directionPoints:o,directions:i,messages:s,polygonBarriers:n,polylineBarriers:l,routes:a,stops:u,traversedEdges:p,traversedJunctions:c,traversedTurns:y}=e,d=e=>{const t=m.find((t=>t.routeName===e));if(null!=t)return t;const r={routeId:m.length+1,routeName:e};return m.push(r),r},f=e=>{const t=m.find((t=>t.routeId===e));if(null!=t)return t;const r={routeId:e,routeName:null};return m.push(r),r},m=[];a?.features.forEach(((e,t)=>{e.geometry.spatialReference=a.spatialReference??void 0;const r=e.attributes.Name,o=t+1;m.push({routeId:o,routeName:r,route:e})})),i?.forEach((e=>{const{routeName:t}=e;d(t).directions=e}));const h=u?.features.every((e=>null==e.attributes.RouteName))&&m.length>0?m[0].routeName:null;return u?.features.forEach((e=>{e.geometry&&(e.geometry.spatialReference??=u.spatialReference??void 0);const t=h??e.attributes.RouteName,r=d(t);r.stops??=[],r.stops.push(e)})),r?.features.forEach((e=>{const t=e.attributes.RouteID,o=f(t),{geometryType:i,spatialReference:s}=r;o.directionLines??={features:[],geometryType:i,spatialReference:s},o.directionLines.features.push(e)}
1)),o?.features.forEach((e=>{const t=e.attributes.RouteID,r=f(t),{geometryType:i,spatialReference:s}=o;r.directionPoints??={features:[],geometryType:i,spatialReference:s},r.directionPoints.features.push(e)})),p?.features.forEach((e=>{const t=e.attributes.RouteID,r=f(t),{geometryType:o,spatialReference:i}=p;r.traversedEdges??={features:[],geometryType:o,spatialReference:i},r.traversedEdges.features.push(e)})),c?.features.forEach((e=>{const t=e.attributes.RouteID,r=f(t),{geometryType:o,spatialReference:i}=c;r.traversedJunctions??={features:[],geometryType:o,spatialReference:i},r.traversedJunctions.features.push(e)})),y?.features.forEach((e=>{const t=e.attributes.RouteID,r=f(t);r.traversedTurns??={features:[]},r.traversedTurns.features.push(e)})),Ie.fromJSON({routeResults:m,barriers:t,polygonBarriers:n,polylineBarriers:l,messages:s})}(y)}var Oe=r(51801),xe=r(45340),De=r(6199),Me=r(52182),ke=r(79259),Ue=r(92524),Fe=r(41151);const Ee={type:String,json:{read:{source:"token"},write:{target:"token"}}};var Ge=r(53736);let qe=class extends((0,Fe.J)(x.wq)){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._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],qe.prototype,"doNotLocateOnRestrictedElements",void 0),(0,o._)([(0,g.Cb)({types:s.qM,json:{read:Ge.im,write:!0}})],qe.prototype,"geometry",void 0),(0,o._)([(0,$.J)(K.KA)],qe.prototype,"geometryType",void 0),(0,o._)([(0,g.Cb)({type:String,json:{name:"layerName",write:!0}})],qe.prototype,"name",void 0),(0,o._)([(0,$.J)(K.S7,{name:"spatialRel"})],qe.prototype,"spatialRelationship",void 0),(0,o._)([(0,g.Cb)({type:String,json:{write:!0}})],qe.prototype,"type",void 0),(0,o._)([(0,g.Cb)({type:String,json:{write:!0}})],qe.prototype,"where",void 0),qe=(0,o._)([(0,C.j)("esri.rest.support.DataLayer")],qe);const We=qe;var Xe;let ze=Xe=class extends ue.Z{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new Xe({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],ze.prototype,"doNotLocateOnRestrictedElements",void 0),ze=Xe=(0,o._)([(0,C.j)("esri.rest.support.NetworkFeatureSet")],ze);const Ve=ze;let $e=class extends((0,Fe.J)(x.wq)){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],$e.prototype,"doNotLocateOnRestrictedElements",void 0),(0,o._)([(0,g.Cb)({type:String,json:{write:!0}})],$e.prototype,"url",void 0),$e=(0,o._)([(0,C.j)("esri.rest.support.NetworkUrl")],$e);const Ke=$e;var Qe;let He=Qe=class extends((0,Fe.J)(x.wq)){constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=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.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.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,b.TJ)(Qe,e)}readAccumulateAttributes(e){return null==e?null:e.map((e=>K.Ul.fromJSON(e)))}writeAccumulateAttributes(e,t,r){null!=e&&e.length&&(t[r]=e.map((e=>K.Ul.toJSON(e))))}writePointBarriers(e,t,r){et(e,t,r)}writePolygonBarrier(e,t,r){et(e,t,r)}writePolylineBarrier(e,t,r){et(e,t,r)}readRestrictionAttributes(e){return null==e?null:e.map((e=>K.kL.fromJSON(e)))}writeRestrictionAttributes(e,t,r){null!=e&&e.length&&(t[r]=e.map((e=>K.kL.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)?We.fromJSON(e):function(e){return e&&"url"in e}(e)?Ke.fromJSON(e):function(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}(e)?Ve.fromJSON(e):function(e){return e&&"features"in e}(e)?ue.Z.fromJSON(e):null}(t.stops)}writeStops(e,t,r){et(e,t,r)}};(0,o._)([(0,g.Cb)({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],He.prototype,"accumulateAttributes",void 0),(0,o._)([(0,S.r)("accumulateAttributes")],He.prototype,"readAccumulateAttributes",null),(0,o._)([(0,Z.c)("accumulateAttributes")],He.prototype,"writeAccumulateAttributes",null),(0,o._)([(0,g.Cb)(Ee)],He.prototype,"apiKey",void 0),(0,o._)([(0,g.Cb)({json:{write:!0}})],He.prototype,"attributeParameterValues",void 0),(0,o._)([(0,g.Cb)({type:String,json:{write:!0}})],He.prototype,"directionsLanguage",void 0),(0,o._)([(0,$.J)(K.GX)],He.prototype,"directionsLengthUnits",void 0),(0,o._)([(0,$.J)(K.$7)],He.prototype,"directionsOutputType",void 0),(0,o._)([(0,$.J)(K.WP)],He.prototype,"directionsStyleName",void 0),(0,o._)([(0,$.J)(K.ZI,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],He.prototype,"directionsTimeAttribute",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"findBestSequence",void 0),(0,o._)([(0,g.Cb)({type:Number,json:{write:!0}})],He.prototype,"geometryPrecision",void 0),(0,o._)([(0,g.Cb)({type:Number,json:{write:!0}})],He.prototype,"geometryPrecisionM",void 0),(0,o._)([(0,g.Cb)({type:Number,json:{write:!0}})],He.prototype,"geometryPrecisionZ",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"ignoreInvalidLocations",void 0),(0,o._)([(0,$.J)(K.Ul,{name:"impedanceAttributeName",ignoreUnknown:!1})],He.prototype,"impedanceAttribute",void 0),(0,o._)([(0,g.Cb)({type:Number,json:{write:!0}})],He.prototype,"outputGeometryPrecision",void 0),(0,o._)([(0,$.J)(K.q$)],He.prototype,"outputGeometryPrecisionUnits",void 0),(0,o._)([(0,$.J)(K.no)],He.prototype,"outputLines",void 0),(0,o._)([(0,g.Cb)({type:Be.Z,json:{name:"outSR",write:!0}})],He.prototype,"outSpatialReference",void 0),(0,o._)([(0,g.Cb)({json:{write:!0}})],He.prototype,"overrides",void 0),(0,o._)([(0,g.Cb)({json:{name:"barriers",write:!0}})],He.prototype,"pointBarriers",void 0),(0,o._)([(0,Z.c)("pointBarriers")],He.prototype,"writePointBarriers",null),(0,o._)([(0,g.Cb)({json:{write:!0}}
1)],He.prototype,"polygonBarriers",void 0),(0,o._)([(0,Z.c)("polygonBarriers")],He.prototype,"writePolygonBarrier",null),(0,o._)([(0,g.Cb)({json:{write:!0}})],He.prototype,"polylineBarriers",void 0),(0,o._)([(0,Z.c)("polylineBarriers")],He.prototype,"writePolylineBarrier",null),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"preserveFirstStop",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"preserveLastStop",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"preserveObjectID",void 0),(0,o._)([(0,g.Cb)({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],He.prototype,"restrictionAttributes",void 0),(0,o._)([(0,S.r)("restrictionAttributes")],He.prototype,"readRestrictionAttributes",null),(0,o._)([(0,Z.c)("restrictionAttributes")],He.prototype,"writeRestrictionAttributes",null),(0,o._)([(0,$.J)(K.ip)],He.prototype,"restrictUTurns",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"returnBarriers",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"returnDirections",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"returnPolygonBarriers",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"returnPolylineBarriers",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"returnRoutes",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"returnStops",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"returnTraversedEdges",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"returnTraversedJunctions",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"returnTraversedTurns",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"returnZ",void 0),(0,o._)([(0,g.Cb)({type:Date,json:{type:Number,write:!0}})],He.prototype,"startTime",void 0),(0,o._)([(0,S.r)("startTime")],He.prototype,"readStartTime",null),(0,o._)([(0,Z.c)("startTime")],He.prototype,"writeStartTime",null),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"startTimeIsUTC",void 0),(0,o._)([(0,g.Cb)({json:{write:!0}})],He.prototype,"stops",void 0),(0,o._)([(0,S.r)("stops")],He.prototype,"readStops",null),(0,o._)([(0,Z.c)("stops")],He.prototype,"writeStops",null),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"timeWindowsAreUTC",void 0),(0,o._)([(0,g.Cb)({type:te.Z,json:{write:!0}})],He.prototype,"travelMode",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"useHierarchy",void 0),(0,o._)([(0,g.Cb)({type:Boolean,json:{write:!0}})],He.prototype,"useTimeWindows",void 0),He=Qe=(0,o._)([(0,C.j)("esri.rest.support.RouteParameters")],He);const Ye=He;function et(e,t,r){null!=e&&(t[r]=u.Z.isCollection(e)?{features:e.toArray().map((e=>e.toJSON()))}:e.toJSON())}var tt=r(59700),rt=r(76045),ot=r(74304);function it(e){return e.length?e:null}function st(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:st("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:st("esriGeometryPolyline")}}}function nt(e){return"layers"in e}async function lt(e){const t=Be.Z.WGS84;return await(0,N.initializeProjection)(e.spatialReference,t),(0,N.project)(e,t)}function at(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function ut(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:(0,v.En)(e,t,"meters")}const pt=u.Z.ofType(Oe.Z),ct=u.Z.ofType(xe.Z),yt=u.Z.ofType(De.Z),dt=u.Z.ofType(Me.Z),ft=u.Z.ofType(ke.Z),mt=u.Z.ofType(rt.Z),ht="esri.layers.RouteLayer",vt=y.Z.getLogger(ht);let wt=class extends((0,L.h)((0,A.M)((0,j.q)((0,I.I)((0,d.R)((0,c.p)(P.Z))))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new G,this.directionLine
1s=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new yt,this.polygonBarriers=new dt,this.polylineBarriers=new ft,this.routeInfo=null,this.spatialReference=Be.Z.WGS84,this.stops=new mt,this.type="route";const t=()=>{this._setStopSymbol(this.stops)};this.addHandles((0,h.on)((()=>this.stops),"change",t,{sync:!0,onListenerAdd:t}))}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,f.RB)(n,i,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",(e=>Oe.Z.fromGraphic(e)))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",(e=>xe.Z.fromGraphic(e)))}get fullExtent(){const e=new T.Z({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:Be.Z.WGS84});if(null!=this.routeInfo&&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 ot.Z({points:o,spatialReference:r}).extent}readMaxScale(e,t){const r=nt(t)?t.layers:t.featureCollection?.layers,o=r?.find((e=>null!=e.layerDefinition.maxScale));return o?.layerDefinition.maxScale??0}readMinScale(e,t){const r=nt(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=>De.Z.fromGraphic(e)))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",(e=>Me.Z.fromGraphic(e)))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",(e=>ke.Z.fromGraphic(e)))}readRouteInfo(e,t){const r=this._getNetworkFeatures(t,"RouteInfo",(e=>Ue.Z.fromGraphic(e)));return r.length>0?r.at(0):null}readSpatialReference(e,t){const r=nt(t)?t.layers:t.featureCollection?.layers;if(!r?.length)return Be.Z.WGS84;const{layerDefinition:o,featureSet:i}=r[0],s=i.features[0],n=s?.geometry?.spatialReference??i.spatialReference??o.spatialReference??o.extent.spatialReference??R.Zn;return Be.Z.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",(e=>rt.Z.fromGraphic(e)),(e=>this._setStopSymbol(e)))}get title(){return null!=this.routeInfo&&null!=this.routeInfo.name?this.routeInfo.name:"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return i.Z.routeServiceUrl}set url(e){null!=e?this._set("url",(0,J.Nm)(e,vt)):this._set("url",i.Z.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()}removeResult(){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 p.Z("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new p.Z("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new p.Z("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(null==this.routeInfo)throw new p.Z("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 p.Z("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,w.mN)(o):void 0,writtenProperties:[]},n=this.write(void 0,s);return t.extent=await lt(e),t.title=this.title,await t.update({data:n}),t}async saveAs(e,t={}){if(await this.load(),null==this.routeInfo)throw new p.Z("routelayer:route-unsolved","saveAs() requires a solved route");const r=W.default.from(e).clone();r.extent??=await lt(this.fullExtent),r.id=null,r.portal??=q.Z.getDefault(),r.title??=this.title,r.type="Feature Collection",r.typeKeywords=["Data","Feature Collection",X.Kz.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);
1return await(o.user?.addItem({item:r,folder:s,data:n})),this.portalItem=r,(0,B.D)(i),i.portalItem=r,r}async solve(e,t){const r=e?.stops??this.stops,o=e?.pointBarriers??it(this.pointBarriers),i=e?.polylineBarriers??it(this.polylineBarriers),s=e?.polygonBarriers??it(this.polygonBarriers);if(null==r)throw new p.Z("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||u.Z.isCollection(r)&&r.length<2)throw new p.Z("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(u.Z.isCollection(r))for(const e of r)e.routeName=null;const n=e?.apiKey,l=this.url,a=await this._getServiceDescription(l,n,t),c=e?.travelMode??a.defaultTravelMode,y=e?.accumulateAttributes??[];null!=c&&(y.push(c.distanceAttributeName),c.timeAttributeName&&y.push(c.timeAttributeName));const d={startTime:new Date},f={accumulateAttributes:y,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:o,polylineBarriers:i,polygonBarriers:s,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!o,returnDirections:!0,returnPolygonBarriers:!!s,returnPolylineBarriers:!!i,returnRoutes:!0,returnStops:!0,stops:r},h=e?Ye.from(e):new Ye;for(const e in d)null==h[e]&&(h[e]=d[e]);let v;h.set(f);try{v=await Je(l,h,t)}catch(e){throw(0,m.D_)(e)?e:new p.Z("routelayer:failed-route-request","the routing request failed",{error:e})}const w=this._toRouteLayerSolution(v);return this._isOverridden("title")||(this.title=w.routeInfo.name??"Route"),function(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 vt.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:l}=s,a=i.find((({name:e})=>e===n)),u=i.find((({name:e})=>e===l)),c=r.travelMode?.impedanceAttributeName??r.impedanceAttribute??t.impedance,y=a?.units,d=u?.units;if(!y||!d)throw new p.Z("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const f=r.directionsLanguage??t.directionsLanguage,m=r.accumulateAttributes??t.accumulateAttributeNames??[],h=new Set(i.filter((({name:e})=>e===n||e===l||e===c||null!=e&&m.includes(e))).map((({name:e})=>e))),v=e=>{for(const t in e)h.has(t)||delete e[t]};for(const t of e.pointBarriers)null!=t.costs&&(t.addedCost=t.costs[c]??0,v(t.costs));for(const t of e.polygonBarriers)null!=t.costs&&(t.scaleFactor=t.costs[c]??1,v(t.costs));for(const t of e.polylineBarriers)null!=t.costs&&(t.scaleFactor=t.costs[c]??1,v(t.costs));const{routeInfo:w}=e,{findBestSequence:g,preserveFirstStop:b,preserveLastStop:_,startTimeIsUTC:S,timeWindowsAreUTC:C}=r;w.analysisSettings=new tt.Z({accumulateAttributes:m,directionsLanguage:f,findBestSequence:g,preserveFirstStop:b,preserveLastStop:_,startTimeIsUTC:S,timeWindowsAreUTC:C,travelMode:s}),w.totalDuration=at(w.totalCosts?.[n]??0,y),w.totalDistance=ut(w.totalCosts?.[l]??0,d),w.totalLateDuration=at(w.totalViolations?.[n]??0,y),w.totalWaitDuration=at(w.totalWait?.[n]??0,y),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=at(t.serviceCosts[n]??0,y),t.serviceDistance=ut(t.serviceCosts[l]??0,d),v(t.serviceCosts)),null!=t.cumulativeCosts&&(t.cumulativeDuration=at(t.cumulativeCosts[n]??0,y),t.cumulativeDistance=ut(t.cumulativeCosts[l]??0,d),v(t.cumulativeCosts)),null!=t.violations&&(t.lateDuration=at(t.violations[n]??0,y),v(t.violations)),null!=t.wait&&(t.waitDuration=at(t.wait[n]??0,y),v(t.wait))}(w,a,h),w}update(e){const{stops:t,directionLines:r,directionPoints:o,pointBarriers:i,polylineBarriers:s,polygonBarriers:n,routeInfo:l}=e;this.set({stops:t,pointBarriers:i,polylineBarriers:s,polygonBarriers:n}
1),this._set("directionLines",r),this._set("directionPoints",o),this._set("routeInfo",l),null!=l.geometry&&(this.spatialReference=l.geometry.spatialReference)}_getNetworkFeatures(e,t,r,o){const i=nt(e)?e.layers:e.featureCollection?.layers,s=i?.find((e=>e.layerDefinition.name===t));if(null==s)return new u.Z;const{layerDefinition:p,popupInfo:c,featureSet:y}=s,d=p.drawingInfo.renderer,{features:f}=y,m=y.spatialReference??p.spatialReference??p.extent.spatialReference??R.Zn,h=d&&(0,a.a)(d),v=Be.Z.fromJSON(m),w=f.map((e=>{const o=n.Z.fromJSON(e);null!=o.geometry&&null!=e.geometry&&null==e.geometry.spatialReference&&(o.geometry.spatialReference=v);const i=r(o);return i.symbol??=h?.getSymbol(o)??this._getNetworkSymbol(t),i.popupTemplate??=c&&l.Z.fromJSON(c),i}));return o&&w.some((e=>!e.symbol))&&o(w),new u.Z(w)}_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 ne(e,t,r);return this._cachedServiceDescription={serviceDescription:o,url:e},o}_setStopSymbol(e){if(!e||0===e.length)return;if(null==this.defaultSymbols.stops)return;if(e.every((({symbol:e})=>null!=e)))return;const{first:t,last:r,middle:o,unlocated:i,waypoint:s,break:n}=this.defaultSymbols.stops;if(null==this.routeInfo||1===e.length)return void e.forEach(((i,s)=>{switch(s){case 0:i.symbol=t;break;case e.length-1:i.symbol=r;break;default:i.symbol=o}}));const l=e.map((({sequence:e})=>e)).filter((e=>null!=e)),a=Math.min(...l),u=Math.max(...l);for(const l of e)l.sequence!==a?l.sequence!==u?"ok"===l.status||"not-located-on-closest"===l.status?"waypoint"!==l.locationType?"break"!==l.locationType?l.symbol=o:l.symbol=n:l.symbol=s:l.symbol=i:l.symbol=r:l.symbol=t}_toRouteLayerSolution(e){const t=e.routeResults[0].stops?.map((e=>rt.Z.fromJSON(e.toJSON())));this._setStopSymbol(t);const r=new mt(t),o=new dt(e.polygonBarriers?.map((e=>{const t=Me.Z.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t}))),i=new ft(e.polylineBarriers?.map((e=>{const t=ke.Z.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t}))),s=new yt(e.pointBarriers?.map((e=>{const t=De.Z.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t}))),n=e.routeResults[0].route?.toJSON(),l=Ue.Z.fromJSON(n);l.symbol=this.defaultSymbols.routeInfo;const a=new ct(e.routeResults[0].directionPoints?.features.map((e=>{const t=xe.Z.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t})));return{directionLines:new pt(e.routeResults[0].directionLines?.features.map((e=>{const t=Oe.Z.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t}))),directionPoints:a,pointBarriers:s,polygonBarriers:o,polylineBarriers:i,routeInfo:l,stops:r}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",Oe.Z.fields,Oe.Z.popupInfo,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",xe.Z.fields,xe.Z.popupInfo,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,r,o,i,s,n){if(null==e||!e.length)return null;const l=this.spatialReference.toJSON(),{fullExtent:a,maxScale:u,minScale:p}=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:l},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol
1:null!=t?t.toJSON():st(r)}},extent:a.toJSON(),fields:o,geometryType:r,hasM:!1,hasZ:!1,maxScale:u,minScale:p,name:s,objectIdField:"ObjectID",spatialReference:l,title:n,type:"Feature Layer",typeIdField:""},popupInfo:i}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",De.Z.fields,De.Z.popupInfo,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",Me.Z.fields,Me.Z.popupInfo,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",ke.Z.fields,ke.Z.popupInfo,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(null!=this.routeInfo?new u.Z([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",Ue.Z.fields,Ue.Z.popupInfo,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",rt.Z.fields,rt.Z.popupInfo,"Stops","Stops");if(null==e)return null;const{stops:t}=this.defaultSymbols,r=null!=t&&null!=t.first&&t.first.toJSON(),o=null!=t&&null!=t.middle&&t.middle.toJSON(),i=null!=t&&null!=t.last&&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}};(0,o._)([(0,g.Cb)({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],wt.prototype,"_featureCollection",void 0),(0,o._)([(0,Z.c)(["web-map","portal-item"],"_featureCollection")],wt.prototype,"writeFeatureCollectionWebmap",null),(0,o._)([(0,g.Cb)({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],wt.prototype,"_type",void 0),(0,o._)([(0,g.Cb)({nonNullable:!0,type:G})],wt.prototype,"defaultSymbols",void 0),(0,o._)([(0,g.Cb)({readOnly:!0})],wt.prototype,"directionLines",void 0),(0,o._)([(0,S.r)(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],wt.prototype,"readDirectionLines",null),(0,o._)([(0,g.Cb)({readOnly:!0})],wt.prototype,"directionPoints",void 0),(0,o._)([(0,S.r)(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],wt.prototype,"readDirectionPoints",null),(0,o._)([(0,g.Cb)({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],wt.prototype,"featureCollectionType",void 0),(0,o._)([(0,g.Cb)({readOnly:!0})],wt.prototype,"fullExtent",null),(0,o._)([(0,g.Cb)({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],wt.prototype,"legendEnabled",void 0),(0,o._)([(0,g.Cb)({type:["show","hide"]})],wt.prototype,"listMode",void 0),(0,o._)([(0,g.Cb)({type:Number,nonNullable:!0,json:{write:!1}})],wt.prototype,"maxScale",void 0),(0,o._)([(0,S.r)(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],wt.prototype,"readMaxScale",null),(0,o._)([(0,g.Cb)({type:Number,nonNullable:!0,json:{write:!1}})],wt.prototype,"minScale",void 0),(0,o._)([(0,S.r)(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],wt.prototype,"readMinScale",null),(0,o._)([(0,g.Cb)({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],wt.prototype,"operationalLayerType",void 0),(0,o._)([(0,g.Cb)({nonNullable:!0,type:u.Z.ofType(De.Z)})],wt.prototype,"pointBarriers",void 0),(0,o._)([(0,S.r)(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],wt.prototype,"readPointBarriers",null),(0,o._)([(0,g.Cb)({nonNullable:!0,type:u.Z.ofType(Me.Z)})],wt.prototype,"polygonBarriers",void 0),(0,o._)([(0,S.r)(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],wt.prototype,"readPolygonBarriers",null),(0,o._)([(0,g.Cb)({nonNullable:!0,type:u.Z.ofType(ke.Z)})],wt.prototype,"polylineBarriers",void 0),(0,o._)([(0,S.r)(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],wt.prototype,"readPolylineBarriers",null),(0,o._)([(0,g.Cb)({readOnly:!0})],wt.prototype,"routeInfo",void 0),(0,o._)([(0,S.r)(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],wt.prototype,"readRouteInfo",null),(0,o._)([(0,g.Cb)({type:Be.Z})],wt.prototype,"spatialReference",void 0),(0,o._)([(0,S.r)(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],wt.prototype,"readSpatialReference",null),(0,o._)([(0,g.Cb)({nonNullable:!0,type:u.Z.ofType(rt.Z)})],wt.prototype,"stops",void 0),(0,o._)([(0,S.r)(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],wt.prototype,"readStops",null),(0,o._)([(0,g.Cb)()],wt.prototype,"title",null),(0,o._)([(0,g.Cb)({readOnly:!0,json:{read:!1}})],wt.prototype,"type",void 0),(0,o._)([(0,g.Cb)()],wt.prototype,"url",null),wt=(0,o._)([(0,C.j)(ht)],wt);const gt=wt}}]);
2//# sourceMappingURL=maps/vendors-node_modules_arcgis_core_layers_RouteLayer_js-3325ee12cc3a170e32ae.min.js.map

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.