/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../core/maybe","../support/networkEnums"],(function(e,t,r){"use strict";function i(e,i){if(t.isNone(e))return null;const o={},s=new RegExp(`^${i}`,"i");for(const t of Object.keys(e))if(s.test(t)){const s=t.substring(i.length);o[r.impedanceAttributeNameJsonMap.fromJSON(s)]=e[t]}return o}function o(e,i,o){if(!t.isNone(e)){i.attributes||(i.attributes={});for(const t in e){const s=r.impedanceAttributeNameJsonMap.toJSON(t);i.attributes[`${o}${s}`]=e[t]}}}function s(e){const t={};for(const i of Object.keys(e)){const o=i;t[r.impedanceAttributeNameJsonMap.fromJSON(o)]=e[i]}return t}function n(e){const t={};for(const i of Object.keys(e)){const o=i;t[r.impedanceAttributeNameJsonMap.toJSON(o)]=e[i]}return t}function a(e,r){return t.isNone(e)||t.isNone(r)?null:Math.round((e-r)/6e4)}function u(e){const t=e.toJSON(),r=t;return r.accumulateAttributeNames&&(r.accumulateAttributeNames=t.accumulateAttributeNames.join()),r.attributeParameterValues&&(r.attributeParameterValues=JSON.stringify(t.attributeParameterValues)),r.barriers&&(r.barriers=JSON.stringify(t.barriers)),r.outSR&&(r.outSR=t.outSR.wkid),r.overrides&&(r.overrides=JSON.stringify(t.overrides)),r.polygonBarriers&&(r.polygonBarriers=JSON.stringify(t.polygonBarriers)),r.polylineBarriers&&(r.polylineBarriers=JSON.stringify(t.polylineBarriers)),r.restrictionAttributeNames&&(r.restrictionAttributeNames=t.restrictionAttributeNames.join()),r.stops&&(r.stops=JSON.stringify(t.stops)),r.travelMode&&(r.travelMode=JSON.stringify(t.travelMode)),r}e.fromKebabImpedanceAttributes=n,e.getPrefixedProperties=i,e.getTimezoneOffset=a,e.routeParametersToQueryParameters=u,e.setPrefixedProperties=o,e.toKebabImpedanceAttributes=s,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
