{"version":3,"sources":["utils/useInterval.jsx","utils/net.ts","redux/network/actions.ts","redux/network/sagas.ts","redux/settings/actions.ts","locale/available.js","redux/settings/reducers.ts","redux/settings/sagas.ts","redux/order/actions.ts","redux/order/reducers.ts","redux/order/sagas.ts","redux/graphHopper/actions.ts","redux/graphHopper/reducers.ts","redux/lists.ts","redux/init.ts","components/OrderMap/Markers.tsx","components/OrderMap/NewRouting.tsx","utils/CristiMarker.jsx","components/OrderMap/DriverMarker.tsx","components/OrderMap/index.tsx","components/BottomSheet/FirstSlide.tsx","components/BottomSheet/BottomSlide.tsx","components/BottomSheet/Content.tsx","components/BottomSheet/index.tsx","App.tsx","reportWebVitals.ts","index.tsx","utils/lrm-graphhopper-new.js"],"names":["defaultOptions","cancelOnUnmount","useInterval","fn","milliseconds","options","opts","timeout","useRef","callback","useState","isCleared","setIsCleared","clear","useCallback","current","clearInterval","useEffect","setInterval","toQueryString","params","nesting","Object","entries","filter","k","v","map","key","encodeURIComponent","value","join","api","method","token","url","headers","lang","store","get","newHeaders","Accept","Authorization","newOptions","newUrl","body","JSON","stringify","qs","indexOf","fetch","actionNetwork","request","action","extra","type","payload","REQUEST","rootSaga","args","put","race","response","call","delay","error","message","json","data","ok","e","all","takeEvery","actions","setSetting","availableLanguages","initialState","isMobileView","locale","navLocale","navigator","language","slice","includes","parseLocale","forEach","set","SETUP","load","currentState","window","innerWidth","currentStateString","prevState","ToLocalStorage","channel","eventChannel","emitter","onResize","addEventListener","removeEventListener","take","takeLatest","reducer","LOAD","SUCCESS","ERROR","RESET","order","undefined","loading","process","orderDetails","id","setGraphHopper","routes","lists","reducers","settings","state","graphHopper","sagas","network","settingsSagas","orderSagas","sagaMiddleware","createSagaMiddleware","middlewares","push","logger","initReducers","combineReducers","createStore","compose","applyMiddleware","run","pickupMarker","L","icon","iconUrl","iconAnchor","destinationMarker","Markers","waypoints","Marker","position","latLng","pickup","latitude","longitude","Popup","alias","isUndefined","stops","el","destination","useRoutingElement","createElementHook","props","context","color","instance","Routing","control","defaultErrorHandler","router","serviceUrl","uuid","show","fitSelectedRoutes","routeWhileDragging","addWaypoints","lineOptions","styles","opacity","weight","extendToWaypoints","missingRouteTolerance","missingRouteStyles","dashArray","createMarker","on","reduxStore","dispatch","prevProps","isEqual","setWaypoints","useLeafletContext","elementRef","React","container","addControl","removeControl","createLayerComponent","ctx","LeafletDriftMarker","overlayContainer","marker","rotationAngle","setRotationAngle","rotationOrigin","setRotationOrigin","duration","slideTo","keepAtCenter","fromLat","fromLng","toLat","toLng","from","point","to","distance","angle","source","toRadians","degrees","Math","PI","startLat","startLng","destLat","destLng","y","sin","cos","x","brng","atan2","getCarAngle","setIcon","zIndexOffset","setZIndexOffset","setOpacity","dragging","draggable","enable","disable","carMarker","DriverMarker","useSelector","render","setRender","orderForRender","status","CristiMarker","driver_location","isEmpty","tracking","length","getDriverCurrentPosition","driver","OrderMap","style","height","orderUUID","route_points","mapBounds","LatLngBounds","extend","currentPos","prevPos","MapContainer","bounds","boundsOptions","padding","zoomControl","scrollWheelZoom","className","TileLayer","attribution","tileSize","zoomOffset","accessToken","wpRoutes","NewRouting","Polyline","positions","beforeDriver","afterDriver","stopsAfterDriver","ended_at","generateRoutings","FirstSlide","timeleft","endTime","Date","now","parse","floor","started_at","summary","totalTime","name","car","brand","model","registration_nb","src","photo","onError","currentTarget","onerror","profile_picture","round","rating","alt","first_name","BottomSlide","Timeline","index","array","address_name","href","target","rel","BottomSheetContent","HightUpdater","onHeightChange","onWindowResize","heightTwo","innerHeight","BottomSheet","defaultOpen","fullScreen","marginTop","overflowHeight","overlay","shadowTip","topShadow","open","setHeight","stateOpen","setStateOpen","bodyRef","onChangeIndex","isOpen","hideShadows","maxHeight","root","width","bottom","right","left","zIndex","backgroundColor","swiper","overflowY","boxSizing","boxShadow","borderRadius","slide","overflow","marginBottom","bottomSlide","top","transition","pointerEvents","transform","onClick","axis","enableMouseEvents","containerStyle","slideStyle","ref","ShowSpinner","NoOrder","App","useDispatch","idHash","location","pathname","replace","loadOrder","parseInt","WrappedApp","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","translations","en","ro","navLang","ReactDOM","defaultLocale","messages","document","getElementById","require","corslite","polyline","GraphHopper","Class","urlParameters","initialize","apiKey","this","_apiKey","Util","setOptions","route","timer","wp","i","timedOut","wps","buildRouteUrl","setTimeout","bind","err","resp","clearTimeout","finalResponse","responseText","_routeDone","baseUrl","locs","lat","lng","getParamString","instructions","inputWaypoints","mappedWaypoints","coordinates","path","alts","info","errors","details","paths","_decodePolyline","points","points_order","tempWaypoints","_mapWaypointIndices","_convertInstructions","totalDistance","time","totalAscend","ascend","actualWaypoints","waypointIndices","geometry","coords","decode","latlngs","Array","LatLng","_toWaypoints","vias","instr","signToType","result","sign","modifier","text","interval","exit","exit_number","idx","wpIndices","Waypoint","module","exports"],"mappings":";8MAQMA,EAAiB,CACrBC,iBAAiB,GAqDJC,EA9CK,SAACC,EAAIC,GAA4C,IAA9BC,EAA6B,uDAAnBL,EACzCM,EAAI,2BAAQN,GAAoBK,GAAW,IAC3CE,EAAUC,mBACVC,EAAWD,iBAAOL,GACxB,EAAkCO,oBAAS,GAA3C,mBAAOC,EAAP,KAAkBC,EAAlB,KAGMC,EAAQC,uBAAY,WACpBP,EAAQQ,UACVH,GAAa,GACbI,cAAcT,EAAQQ,YAEvB,IA+BH,OA5BAE,qBAAU,WACU,oBAAPd,IACTM,EAASM,QAAUZ,KAEpB,CAACA,IAGJc,qBAAU,WAQR,MAP4B,kBAAjBb,IACTG,EAAQQ,QAAUG,aAAY,WAC5BT,EAASM,YACRX,IAIES,IACN,CAACT,IAGJa,qBACE,kBAAM,WACAX,EAAKL,iBACPY,OAGJ,IAGK,CAACF,EAAWE,I,0ECzDrB,SAASM,EAAcC,GAAuE,IAAvBC,EAAsB,uDAAZ,GAC/E,OAAOC,OAAOC,QAAQH,GACnBI,QAAO,mCAAEC,EAAF,KAAKC,EAAL,YAAYD,GAAW,OAANC,KACxBC,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B,K","file":"static/js/main.cde21580.chunk.js","sourcesContent":["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable react-hooks/exhaustive-deps */\nimport {\n useEffect, useState, useCallback, useRef,\n} from 'react';\n\nconst defaultOptions = {\n cancelOnUnmount: true,\n};\n\n/**\n * An async-utility hook that accepts a callback function and a delay time (in milliseconds), then repeats the\n * execution of the given function by the defined milliseconds.\n */\nconst useInterval = (fn, milliseconds, options = defaultOptions) => {\n const opts = { ...defaultOptions, ...(options || {}) };\n const timeout = useRef();\n const callback = useRef(fn);\n const [isCleared, setIsCleared] = useState(false);\n\n // the clear method\n const clear = useCallback(() => {\n if (timeout.current) {\n setIsCleared(true);\n clearInterval(timeout.current);\n }\n }, []);\n\n // if the provided function changes, change its reference\n useEffect(() => {\n if (typeof fn === 'function') {\n callback.current = fn;\n }\n }, [fn]);\n\n // when the milliseconds change, reset the timeout\n useEffect(() => {\n if (typeof milliseconds === 'number') {\n timeout.current = setInterval(() => {\n callback.current();\n }, milliseconds);\n }\n\n // cleanup previous interval\n return clear;\n }, [milliseconds]);\n\n // when component unmount clear the timeout\n useEffect(\n () => () => {\n if (opts.cancelOnUnmount) {\n clear();\n }\n },\n [],\n );\n\n return [isCleared, clear];\n};\n\nexport default useInterval;\n","import store from 'store';\n\nfunction toQueryString(params: NonNullable, nesting = ''): string {\n return Object.entries(params)\n .filter(([k, v]) => k && v !== null)\n .map(([k, v]) => {\n const key = encodeURIComponent(k);\n\n // check if there are nested objects\n if (typeof v === 'object') {\n return toQueryString(v, nesting ? `${nesting}[${key}]` : `${key}`);\n }\n\n const value = encodeURIComponent(v);\n\n return nesting ? `${nesting}[${key}]=${value}` : `${key}=${value}`;\n })\n .join('&');\n}\n\nexport function api(options: CR.FetchOptions): Promise {\n const {\n params,\n method = 'GET',\n token = '',\n url,\n headers,\n } = options;\n\n const lang = store.get('app.settings.locale') as string || 'en';\n\n const newHeaders: CR.FetchOptions['headers'] = {\n Accept: 'application/json',\n Authorization: `Bearer ${token}`,\n 'Accept-Language': lang,\n ...headers,\n };\n\n const newOptions: CR.FetchOptions = {\n headers: { ...newHeaders },\n method,\n params,\n url,\n };\n\n let newUrl = url;\n\n if (method === 'POST' || method === 'PUT') {\n newOptions.body = JSON.stringify(params);\n } else if (method === 'GET' && params) {\n // if params are sent as an object, try to serialize and then append to the provided url\n const qs = toQueryString(params);\n\n if (qs) {\n newUrl += url.indexOf('?') === -1 ? '?' : '&';\n newUrl += qs;\n }\n }\n\n return fetch(newUrl, newOptions);\n}\n\nexport function postJson(\n url: CR.FetchOptions['url'],\n params: CR.FetchOptions['params'],\n token: CR.FetchOptions['token'],\n headers: CR.FetchOptions['headers'],\n): CR.FetchOptions {\n return {\n url,\n method: 'POST',\n params,\n token,\n headers: {\n ...headers,\n 'Content-Type': 'application/json',\n },\n };\n}\n\nexport function putJson(\n url: CR.FetchOptions['url'],\n params: CR.FetchOptions['params'],\n token: CR.FetchOptions['token'],\n headers: CR.FetchOptions['headers'],\n): CR.FetchOptions {\n return {\n url,\n method: 'PUT',\n params,\n token,\n headers: {\n ...headers,\n 'Content-Type': 'application/json',\n },\n };\n}\n\nexport function get(\n url: CR.FetchOptions['url'],\n params?: CR.FetchOptions['params'],\n headers?: CR.FetchOptions['headers'],\n token?: CR.FetchOptions['token'],\n): CR.FetchOptions {\n return {\n url,\n method: 'GET',\n params,\n token,\n headers,\n };\n}\n\nexport function destroy(\n url: CR.FetchOptions['url'],\n params: CR.FetchOptions['params'],\n token: CR.FetchOptions['token'],\n headers: CR.FetchOptions['headers'],\n): CR.FetchOptions {\n return {\n url,\n method: 'DELETE',\n params,\n token,\n headers,\n };\n}\n\nexport default {\n api,\n postJson,\n putJson,\n get,\n destroy,\n};\n","export const actionNetwork = 'network/request';\n\nexport const request = (\n options: CR.NetworkReduxAction['payload']['options'],\n action: CR.NetworkReduxAction['payload']['action'],\n extra?: CR.NetworkReduxAction['payload']['extra'],\n): CR.NetworkReduxAction => ({\n type: actionNetwork,\n payload: {\n options,\n action,\n extra,\n },\n});\n\nexport default request;\n\nexport function networkActions(reducer: string): Record {\n return {\n LOAD: `${reducer}`,\n REQUEST: `${reducer}/request`,\n SUCCESS: `${reducer}/success`,\n ERROR: `${reducer}/error`,\n RESET: `${reducer}/reset`,\n };\n}\n\nfunction getPrefix(prefix: string, type?: string) {\n const prefixUp = prefix.toUpperCase();\n return type ? `${prefixUp}_${type}` : prefixUp;\n}\n\nexport function extraNetworkActions(prefix: string, reducer: string): Record {\n return {\n [getPrefix(prefix)]: `${reducer}`,\n [getPrefix(prefix, 'REQUEST')]: `${reducer}/request`,\n [getPrefix(prefix, 'SUCCESS')]: `${reducer}/success`,\n [getPrefix(prefix, 'ERROR')]: `${reducer}/error`,\n [getPrefix(prefix, 'RESET')]: `${reducer}/reset`,\n };\n}\n","import {\n all, takeEvery, put, call, race, delay,\n} from 'redux-saga/effects';\nimport { api } from '../../utils/net';\nimport { actionNetwork } from './actions';\n\nfunction* REQUEST(args: CR.NetworkReduxAction) {\n const { payload: { options, action = 'missingAction', extra } } = args;\n\n try {\n yield put({\n type: `${action}/request`,\n payload: {\n options,\n extra,\n },\n });\n\n type Race = {\n response: Response,\n timeout: boolean\n };\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const { response, timeout }: Race = yield race({\n response: call(api, options),\n timeout: delay(60 * 1000),\n });\n\n // handle timeouts\n\n if (timeout) {\n yield put({\n type: `${action}/error`,\n payload: {\n error: {\n message: 'Connection timeout!',\n },\n },\n });\n\n return;\n }\n\n // get json data\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const data: unknown = yield call([response, response.json]);\n\n if (response.ok) {\n yield put({\n type: `${action}/success`,\n payload: {\n data: { ...data as Record },\n },\n });\n\n return;\n }\n\n // oops, something happened\n\n yield put({\n type: `${action}/error`,\n payload: {\n error: { ...data as Record },\n },\n });\n } catch (error) {\n const e = error as Error;\n\n yield put({\n type: `${action}/error`,\n payload: {\n error: { ...e },\n },\n });\n }\n}\n\nexport default function* rootSaga(): Generator {\n yield all([\n takeEvery(actionNetwork, REQUEST),\n ]);\n}\n","export const actions = {\n SET: 'settings/set',\n};\n\nexport function setSetting(payload: CR.SettingsDispatchAction['payload']): CR.SettingsDispatchAction {\n return {\n type: actions.SET,\n payload,\n };\n}\n","const availableLanguages = ['en', 'ro'];\n\nexport default availableLanguages;\n","import store from 'store';\nimport { actions } from './actions';\nimport availableLanguages from '../../locale/available';\n\nconst parseLocale = () => {\n const navLocale = navigator.language.slice(0, 2);\n\n if (availableLanguages.includes(navLocale)) {\n return navLocale;\n }\n\n return 'en';\n};\n\nconst initialState: CR.Settings = {\n isMobileView: 'false',\n locale: parseLocale(),\n};\n\nObject.entries(initialState).forEach(([key, value]) => {\n store.set(`app.settings.${key}`, value);\n});\n\nexport default function reducer(state = initialState, action: CR.SettingsDispatchAction): CR.Settings {\n switch (action.type) {\n case actions.SET:\n return {\n ...state,\n ...action.payload,\n };\n default:\n return state;\n }\n}\n","import {\n all, take, put, takeLatest,\n} from 'redux-saga/effects';\nimport { eventChannel } from 'redux-saga';\nimport store from 'store';\nimport { setSetting, actions } from './actions';\n\nfunction* isMobileView(load = false) {\n const currentState = window.innerWidth < 768;\n const currentStateString = currentState ? 'true' : 'false';\n\n const prevState = store.get('app.settings.isMobileView') as string;\n\n if (currentStateString !== prevState || load) {\n const data: CR.SettingsDispatchAction['payload'] = {\n isMobileView: currentStateString,\n };\n\n yield put(setSetting(data));\n }\n}\n\nfunction ToLocalStorage(args: CR.SettingsDispatchAction) {\n const { payload } = args;\n\n Object.entries(payload).forEach(([key, value]) => {\n store.set(`app.settings.${key}`, value);\n });\n}\n\nfunction* SETUP() {\n const channel = eventChannel((emitter) => {\n const onResize = (e: unknown) => {\n // send the event to our saga\n emitter(e);\n };\n\n window.addEventListener('resize', onResize);\n\n // return an unsubscribe method\n return () => {\n window.removeEventListener('resize', onResize);\n };\n });\n\n // detect isMobileView setting on app load and window resize\n yield isMobileView(true);\n\n // process events until operation completes\n while (true) {\n yield take(channel);\n yield isMobileView();\n }\n}\n\nexport default function* rootSaga(): Generator {\n yield all([\n takeLatest(actions.SET, ToLocalStorage),\n SETUP(), // run once on app load to init listeners\n ]);\n}\n","import { networkActions } from '../network/actions';\n\nconst actions = {\n ...networkActions('order/details'),\n};\n\nexport default actions;\n\nexport function load(payload: CR.OrderDispatchAction['payload']): CR.OrderDispatchAction {\n return {\n type: actions.LOAD,\n payload,\n };\n}\n\nexport function reset(): CR.OrderDispatchAction {\n return {\n type: actions.RESET,\n };\n}\n","import actions from './actions';\n\nconst initialState: CR.Order = {\n order: undefined,\n loading: false,\n error: {},\n};\n\nexport default function reducer(state = initialState, action: CR.NetworkDispatchReduxAction): CR.Order {\n switch (action.type) {\n case actions.REQUEST:\n return {\n ...state,\n loading: true,\n };\n case actions.SUCCESS:\n return {\n ...state,\n order: { ...action.payload.data as CR.OrderCRUD },\n loading: false,\n };\n case actions.ERROR:\n return {\n ...initialState,\n error: { ...action.payload.error },\n };\n case actions.RESET:\n return {\n ...initialState,\n };\n default:\n return state;\n }\n}\n","import { all, takeLatest, put } from 'redux-saga/effects';\nimport actions from './actions';\nimport { get } from '../../utils/net';\nimport { request } from '../network/actions';\n\n// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\nconst url = `${process.env.REACT_APP_APP_CITYRIDE}${process.env.REACT_APP_API_VER}/orders`;\n\nconst orderDetails = (id: string) => get(`${url}/${id}`);\n\nfunction* LOAD(payload: Required) {\n const { payload: { id } } = payload;\n yield put(request(orderDetails(id), actions.LOAD));\n}\n\nexport default function* rootSaga(): Generator {\n yield all([\n takeLatest(actions.LOAD, LOAD),\n ]);\n}\n","export const actions = {\n SET: 'graphHopper/set',\n};\n\nexport function setGraphHopper(payload: CR.GraphHopperDispatchAction['payload']): CR.GraphHopperDispatchAction {\n return {\n type: actions.SET,\n payload,\n };\n}\n","import { actions } from './actions';\n\nconst initialState: CR.GraphHopper = {\n routes: [],\n error: {},\n};\n\nexport default function reducer(state = initialState, action: CR.GraphHopperDispatchAction): CR.GraphHopper {\n switch (action.type) {\n case actions.SET:\n return {\n ...state,\n ...action.payload,\n };\n default:\n return state;\n }\n}\n","import network from './network/sagas';\n\nimport settings from './settings/reducers';\nimport settingsSagas from './settings/sagas';\n\nimport order from './order/reducers';\nimport orderSagas from './order/sagas';\n\nimport graphHopper from './graphHopper/reducers';\n\nconst lists = {\n reducers: {\n settings,\n order,\n graphHopper,\n },\n sagas: [\n network(),\n settingsSagas(),\n orderSagas(),\n ],\n};\n\nexport default lists;\n","import createSagaMiddleware from 'redux-saga';\nimport { all } from 'redux-saga/effects';\nimport { logger } from 'redux-logger';\nimport {\n Middleware,\n createStore,\n applyMiddleware,\n compose,\n combineReducers,\n} from 'redux';\nimport lists from './lists';\n\nconst sagaMiddleware = createSagaMiddleware();\nconst middlewares: Middleware[] = [sagaMiddleware];\n\n// Redux Logger\nif (process.env.REACT_APP_REDUX_LOGGER === 'true') {\n middlewares.push(logger);\n}\n\nexport const initReducers = combineReducers({\n ...lists.reducers,\n});\n\nconst initSagas = () => function* rootSaga() {\n yield all([\n ...lists.sagas,\n ]);\n};\n\nconst store = createStore(\n initReducers,\n compose(applyMiddleware(...middlewares)),\n);\n\nsagaMiddleware.run(initSagas());\n\nexport default store;\n","import * as React from 'react';\nimport { Marker, Popup } from 'react-leaflet';\nimport L from 'leaflet';\nimport { isUndefined } from 'lodash';\n\ntype Props = {\n waypoints: CR.ParseWaypoints,\n};\n\nconst pickupMarker = L.icon({\n iconUrl: '/assets/pin_start.svg',\n iconAnchor: [15, 37],\n});\n\nconst destinationMarker = L.icon({\n iconUrl: '/assets/pin_stop.svg',\n iconAnchor: [15, 37],\n});\n\nconst Markers = ({ waypoints }: Props): JSX.Element => {\n const generateStopMarkers = () => {\n if (isUndefined(waypoints.stops)) {\n return null;\n }\n\n return waypoints.stops.map((el) => (\n \n \n {el.alias}\n \n \n ));\n };\n\n return (\n <>\n \n \n {waypoints.pickup.alias}\n \n \n\n {generateStopMarkers()}\n\n {!isUndefined(waypoints.destination) && (\n \n \n {waypoints.destination.alias}\n \n \n )}\n \n );\n};\n\nexport default Markers;\n","import * as React from 'react';\nimport L from 'leaflet';\nimport 'leaflet-routing-machine';\nimport { createElementHook, LeafletContextInterface, useLeafletContext } from '@react-leaflet/core';\nimport '../../utils/lrm-graphhopper-new';\nimport { isEqual } from 'lodash';\nimport { useSelector } from 'react-redux';\nimport reduxStore from '../../redux/init';\nimport { setGraphHopper } from '../../redux/graphHopper/actions';\n\ntype Props = {\n waypoints: L.LatLng[],\n uuid: string,\n};\n\nfunction createRouting(props: Props, context: LeafletContextInterface) {\n const { waypoints } = props;\n const color = '#005598';\n\n const leafletGraphHopper = L.Routing.control({\n defaultErrorHandler: () => false,\n waypoints,\n router: L.Routing.graphHopper(undefined /* no api key */, {\n serviceUrl: `https://app.prod.taxiapp.ro/api/v1/orders/${props.uuid}/route`,\n }),\n show: false,\n fitSelectedRoutes: false,\n routeWhileDragging: false,\n addWaypoints: false,\n lineOptions: {\n styles: [{ color, opacity: 1, weight: 3 }],\n extendToWaypoints: true,\n missingRouteTolerance: 0,\n missingRouteStyles: [\n { color: 'black', opacity: 0.15, weight: 7 },\n { color: 'white', opacity: 0.6, weight: 4 },\n {\n color, opacity: 0.8, weight: 2, dashArray: '7,12',\n },\n ],\n },\n // @ts-expect-error: No type definition for this property in leaflet\n createMarker: function cm() {\n return null;\n },\n })\n // .on('routingstart', (e) => {\n // console.log('routingstart', e);\n // })\n .on('routesfound', (e: L.Routing.RoutingResultEvent) => {\n const {\n // waypoints: wp,\n routes,\n } = e;\n\n // console.log('routesfound', wp, routes);\n\n reduxStore.dispatch(setGraphHopper({\n routes,\n }));\n })\n // .on('routeselected', (e: L.Routing.RouteSelectedEvent) => {\n // console.log('routeselected', e);\n // const r = e.route;\n // const line = L.Routing.line(r);\n // const bounds = line.getBounds();\n // map.fitBounds(bounds, { padding: [20, 20] });\n // })\n .on('routingerror', (e: L.Routing.RoutingErrorEvent) => {\n const { error } = e;\n\n // console.log('routingerror', error);\n\n reduxStore.dispatch(setGraphHopper({\n error,\n }));\n });\n\n return { instance: leafletGraphHopper, context };\n}\n\nfunction updateRouting(instance: L.Routing.Control, props: Props, prevProps: Props) {\n if (!isEqual(prevProps.waypoints, props.waypoints)) {\n instance.setWaypoints(props.waypoints);\n }\n}\n\nconst useRoutingElement = createElementHook(createRouting, updateRouting);\n\nfunction Routing(props: Props): null {\n const context = useLeafletContext();\n const elementRef = useRoutingElement(props, context);\n\n React.useEffect(() => {\n const container = context.map;\n container.addControl(elementRef.current.instance);\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n container.removeControl(elementRef.current.instance);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return null;\n}\n\nexport default Routing;\n","import { createLayerComponent } from '@react-leaflet/core';\nimport LeafletDriftMarker from 'leaflet-drift-marker';\nimport 'leaflet-rotatedmarker';\nimport { isEqual } from 'lodash';\nimport distance from '@turf/distance';\nimport { point } from '@turf/helpers';\n\nconst getCarAngle = (source, destination) => {\n // Converts from degrees to radians.\n const toRadians = (degrees) => {\n return (degrees * Math.PI) / 180;\n }\n\n // Converts from radians to degrees.\n const toDegrees = (radians) => {\n return (radians * 180) / Math.PI;\n }\n\n let startLat = toRadians(source[0]);\n let startLng = toRadians(source[1]);\n let destLat = toRadians(destination[0]);\n let destLng = toRadians(destination[1]);\n\n const y = Math.sin(destLng - startLng) * Math.cos(destLat);\n const x = Math.cos(startLat) * Math.sin(destLat)\n - Math.sin(startLat) * Math.cos(destLat) * Math.cos(destLng - startLng);\n let brng = Math.atan2(y, x);\n brng = toDegrees(brng);\n\n return (brng + 360) % 360;\n\n // const lngDifference = (destination[1] - source[1]);\n\n // const y = Math.sin(lngDifference) * Math.cos(destination[0]);\n // const x = Math.cos(source[0]) * Math.sin(destination[0]) - Math.sin(source[0]) * Math.cos(destination[0]) * Math.cos(lngDifference);\n\n // let bearing = Math.atan2(y, x);\n // bearing *= (180 / Math.PI);\n // bearing = (bearing + 360) % 360;\n\n // return bearing;\n};\n\nexport default createLayerComponent(\n function createMarker({ position, ...options }, ctx) {\n const instance = new LeafletDriftMarker(position, options);\n return { instance, context: { ...ctx, overlayContainer: instance } };\n },\n function updateMarker(marker, props, prevProps) {\n // Enhanced marker with Rotate Marker\n if (props.rotationAngle !== prevProps.rotationAngle) {\n marker.setRotationAngle(props.rotationAngle);\n }\n\n if (props.rotationOrigin !== prevProps.rotationOrigin) {\n marker.setRotationOrigin(props.rotationOrigin);\n }\n\n // Original code below\n if (!isEqual(prevProps.position, props.position) && typeof props.duration === 'number') {\n marker.slideTo(props.position, {\n duration: props.duration,\n keepAtCenter: props.keepAtCenter,\n });\n\n // Trigger angle setting\n const fromLat = prevProps.position[0];\n const fromLng = prevProps.position[1];\n \n const toLat = props.position[0];\n const toLng = props.position[1];\n \n\n const from = point([fromLng, fromLat]);\n const to = point([toLng, toLat]);\n const dist = distance(from, to);\n\n if (dist * 1000 > 5) {\n const angle = getCarAngle(prevProps.position, props.position)\n marker.setRotationAngle(angle);\n }\n }\n\n if (props.icon != null && props.icon !== prevProps.icon) {\n marker.setIcon(props.icon);\n }\n\n if (props.zIndexOffset != null && props.zIndexOffset !== prevProps.zIndexOffset) {\n marker.setZIndexOffset(props.zIndexOffset);\n }\n\n if (props.opacity != null && props.opacity !== prevProps.opacity) {\n marker.setOpacity(props.opacity);\n }\n\n if (marker.dragging != null && props.draggable !== prevProps.draggable) {\n if (props.draggable === true) {\n marker.dragging.enable();\n } else {\n marker.dragging.disable();\n }\n }\n },\n);\n","import * as React from 'react';\nimport L from 'leaflet';\nimport { useSelector } from 'react-redux';\nimport { isEmpty } from 'lodash';\nimport CristiMarker from '../../utils/CristiMarker';\n\nconst carMarker = L.icon({\n iconUrl: '/assets/carMarker.svg',\n iconAnchor: [9, 14],\n});\n\nconst DriverMarker = (): JSX.Element | null => {\n const order = useSelector((state: CR.RootState) => state.order);\n const [render, setRender] = React.useState(false);\n\n React.useEffect(() => {\n const orderForRender = ![80, 90].includes(order.order?.status.id as number);\n\n if (orderForRender !== render) {\n setRender(orderForRender);\n }\n }, [order.order?.status, render]);\n\n const getDriverCurrentPosition = () => {\n if (order.order?.driver_location && !isEmpty(order.order.driver_location)) {\n return [\n order.order.driver_location.latitude,\n order.order.driver_location.longitude,\n ];\n }\n\n if (order.order?.tracking && !isEmpty(order.order.tracking)) {\n return [\n order.order.tracking[order.order.tracking.length - 1].latitude,\n order.order.tracking[order.order.tracking.length - 1].longitude,\n ];\n }\n\n return [];\n };\n\n return !render ? null : (\n \n );\n};\n\nexport default DriverMarker;\n","import * as React from 'react';\nimport { MapContainer, Polyline, TileLayer } from 'react-leaflet';\nimport { useSelector } from 'react-redux';\nimport { isUndefined, isEmpty } from 'lodash';\nimport L from 'leaflet';\nimport Markers from './Markers';\nimport NewRouting from './NewRouting';\nimport DriverMarker from './DriverMarker';\n\nconst OrderMap = (): JSX.Element => {\n const { isMobileView } = useSelector((state: CR.RootState) => state.settings);\n\n let style;\n if (isMobileView === 'false') {\n style = {\n height: '100vh',\n };\n }\n\n const { order: orderState } = useSelector((state: CR.RootState) => state.order);\n const order = orderState as CR.OrderCRUD;\n\n const orderUUID = order.uuid;\n\n // Start markers creation\n const waypoints = {} as CR.ParseWaypoints;\n\n waypoints.pickup = order.route_points[0];\n const mapBounds = new L.LatLngBounds(\n [waypoints.pickup.latitude, waypoints.pickup.longitude],\n [waypoints.pickup.latitude, waypoints.pickup.longitude],\n );\n\n waypoints.destination = undefined;\n waypoints.stops = undefined;\n waypoints.driver = undefined;\n\n if (order.driver_location) {\n mapBounds.extend([order.driver_location.latitude, order.driver_location.longitude]);\n }\n\n if (order.route_points.length > 1) {\n waypoints.destination = order.route_points[order.route_points.length - 1];\n mapBounds.extend([waypoints.destination.latitude, waypoints.destination.longitude]);\n\n waypoints.stops = order.route_points.slice(1, -1);\n\n if (isEmpty(waypoints.stops)) {\n waypoints.stops = undefined;\n }\n\n if (!isUndefined(waypoints.stops)) {\n waypoints.stops.forEach((el) => {\n mapBounds.extend([el.latitude, el.longitude]);\n });\n }\n }\n\n // Set driver positions by tracking\n if (!isUndefined(order.tracking) && !isEmpty(order.tracking)) {\n waypoints.driver = {} as NonNullable;\n waypoints.driver.currentPos = order.tracking[order.tracking.length - 1];\n waypoints.tracking = order.tracking;\n\n if (order.tracking.length > 1) {\n waypoints.driver.prevPos = order.tracking[order.tracking.length - 2];\n } else {\n waypoints.driver.prevPos = order.route_points[0];\n }\n\n mapBounds.extend([waypoints.driver.prevPos.latitude, waypoints.driver.prevPos.longitude]);\n mapBounds.extend([waypoints.driver.currentPos.latitude, waypoints.driver.currentPos.longitude]);\n }\n\n // End markers creation\n\n // Start waypoints for graphhopper\n const generateRoutings = () => {\n const wpRoutes = [] as L.LatLng[];\n\n // Case 1: no driver => no routing split\n if (isUndefined(order.tracking) || isEmpty(order.tracking)) {\n wpRoutes.push(L.latLng(waypoints.pickup.latitude, waypoints.pickup.longitude));\n\n if (!isUndefined(waypoints.stops)) {\n waypoints.stops.forEach((el) => {\n wpRoutes.push(L.latLng(el.latitude, el.longitude));\n });\n }\n\n if (!isUndefined(waypoints.destination)) {\n wpRoutes.push(L.latLng(waypoints.destination.latitude, waypoints.destination.longitude));\n }\n\n return (\n \n );\n }\n\n // Order completed\n if (order.status.id === 80) {\n order.tracking.forEach((el) => {\n wpRoutes.push(L.latLng(el.latitude, el.longitude));\n });\n return (\n \n );\n }\n\n // Case 2: with driver => split route\n const beforeDriver = [] as L.LatLng[];\n const afterDriver = [] as L.LatLng[];\n\n order.tracking.forEach((el) => {\n beforeDriver.push(L.latLng(el.latitude, el.longitude));\n });\n\n let stopsAfterDriver = [] as CR.RoutePoint[];\n\n if (waypoints.stops) {\n stopsAfterDriver = waypoints.stops.filter((el) => el.ended_at === null);\n }\n\n if (!isUndefined(waypoints.driver)) {\n afterDriver.push(L.latLng(waypoints.driver.currentPos.latitude, waypoints.driver.currentPos.longitude));\n }\n\n stopsAfterDriver.forEach((el) => {\n afterDriver.push(L.latLng(el.latitude, el.longitude));\n });\n\n if (!isUndefined(waypoints.destination)) {\n afterDriver.push(L.latLng(waypoints.destination.latitude, waypoints.destination.longitude));\n }\n\n return (\n <>\n \n \n \n );\n };\n\n // End waypoints for graphhopper\n return (\n \n \n\n \n\n \n\n {generateRoutings()}\n \n );\n};\n\nexport default OrderMap;\n","import * as React from 'react';\nimport { useSelector } from 'react-redux';\n\nconst FirstSlide = (): JSX.Element => {\n const { order: orderState } = useSelector((state: CR.RootState) => state.order);\n const order = orderState as CR.OrderCRUD;\n\n const { routes } = useSelector((state: CR.RootState) => state.graphHopper);\n\n let timeleft = '';\n\n if (routes[0] === undefined) {\n if (order.route_points.length === 1) {\n let endTime = Date.now();\n\n if (order.route_points[0].ended_at) {\n endTime = Date.parse(order.route_points[0].ended_at);\n }\n\n timeleft = `${Math.floor((endTime - Date.parse(order.route_points[0].started_at)) / 60000)} min`;\n } else {\n // for 2 points\n }\n } else {\n timeleft = `${Math.floor(routes[0].summary?.totalTime as number / 60000)} min`;\n }\n\n return (\n
\n
\n
\n\n
\n
\n {order.status?.name}\n
\n\n
\n {order.status?.id === 80 ? null : timeleft}\n
\n
\n\n
\n\n
\n
\n
\n {order.car && `${order.car.brand.name} ${order.car.model.name} ${order.car.color.name}`}\n
\n
\n {order.car?.registration_nb}\n
\n
\n\n
\n
\n {\n e.currentTarget.onerror = null;\n e.currentTarget.className += ' hideImageOnError';\n }}\n />\n
\n\n
\n {\n e.currentTarget.onerror = null;\n e.currentTarget.src = '/assets/user.svg';\n e.currentTarget.className += ' border-circle';\n }}\n />\n\n
\n
\n {Math.round(order.driver.rating * 100) / 100}\n
\n \n
\n\n
\n
\n
\n
\n {order.driver && order.driver.first_name}\n
\n
\n
\n
\n );\n};\n\nexport default FirstSlide;\n","import * as React from 'react';\nimport { useSelector } from 'react-redux';\nimport { FormattedMessage } from 'react-intl';\n\nconst BottomSlide = (): JSX.Element => {\n const { order: orderState } = useSelector((state: CR.RootState) => state.order);\n\n const order = orderState as CR.OrderCRUD;\n\n const Timeline = (): JSX.Element => (\n <>\n { order.route_points?.map((point, index, array) => (\n // eslint-disable-next-line react/no-array-index-key\n
\n { index !== 0 &&
}\n\n
\n\n { index !== (array.length - 1) &&
}\n\n
\n
\n {point.name}\n
\n
\n {point.address_name}\n
\n
\n
\n )) }\n \n );\n\n return (\n
\n
\n \n
\n\n
\n\n \n\n
\n\n \n \n \n
\n );\n};\n\nexport default BottomSlide;\n","import * as React from 'react';\nimport FirstSlide from './FirstSlide';\nimport BottomSlide from './BottomSlide';\n\nconst BottomSheetContent = (): JSX.Element => (\n <>\n \n\n
\n\n \n \n);\n\nexport default BottomSheetContent;\n","import * as React from 'react';\nimport { useSelector } from 'react-redux';\nimport SwipeableViews from 'react-swipeable-views';\nimport BottomSheetContent from './Content';\n\ninterface BottomSheetProps {\n defaultOpen?: boolean,\n open?: boolean,\n fullScreen?: boolean,\n marginTop?: number,\n overflowHeight?: number,\n overlay?: boolean,\n scrollTopAtClose?: boolean,\n shadowTip?: boolean,\n swipeableViewsProps?: Record,\n topShadow?: boolean,\n}\n\ntype SwipeableCSS = {\n root: React.CSSProperties\n swiper: {\n root: React.CSSProperties,\n container: React.CSSProperties,\n slide: React.CSSProperties\n bottomSlide: React.CSSProperties\n body: React.CSSProperties\n },\n overlay: React.CSSProperties,\n shadowTip: React.CSSProperties\n};\n\ntype HightUpdaterProps = {\n height: number,\n onHeightChange: (height: number) => void\n};\n\n// This seems useless.\n// Does not properly listen events\n// Does not really update height\nconst HightUpdater = (props: HightUpdaterProps) => {\n const { height, onHeightChange } = props;\n\n const onWindowResize = () => {\n const heightTwo = window.innerHeight;\n\n if (heightTwo !== height) {\n onHeightChange(heightTwo);\n }\n };\n\n React.useEffect(() => {\n window.addEventListener('resize', onWindowResize);\n\n return () => {\n window.removeEventListener('resize', onWindowResize);\n };\n });\n\n return null;\n};\n\nconst BottomSheet = (\n {\n defaultOpen = false,\n fullScreen = false,\n marginTop = 0,\n overflowHeight = 160,\n overlay = true,\n // scrollTopAtClose = true,\n shadowTip = true,\n // swipeableViewsProps = {},\n topShadow = true,\n ...restProps\n }: BottomSheetProps,\n): JSX.Element => {\n const {\n open,\n } = restProps;\n\n const { isMobileView } = useSelector((state: CR.RootState) => state.settings);\n\n const [height, setHeight] = React.useState(window.innerHeight);\n const [stateOpen, setStateOpen] = React.useState(defaultOpen);\n\n const bodyRef = React.createRef();\n\n const onChangeIndex = (index: number) => {\n const shouldOpen = index === 1;\n if (open === undefined) {\n setStateOpen(shouldOpen);\n }\n };\n\n const hiddenWhenClosed = overflowHeight === 0;\n const isControlled = open !== undefined;\n const isOpen = isControlled ? open : stateOpen;\n const hideShadows = hiddenWhenClosed && !isOpen;\n const index = isOpen ? 1 : 0;\n const maxHeight = marginTop ? (height - marginTop) : height;\n\n const styles = {\n root: {\n height: overflowHeight,\n width: isMobileView === 'false' ? '375px' : '',\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n zIndex: 2000,\n backgroundColor: '#e6e4e0',\n // ...this.props.style,\n },\n swiper: {\n root: {\n overflowY: 'initial',\n boxSizing: 'border-box',\n // ...swipeableViewsProps.style,\n },\n container: {\n boxSizing: 'border-box',\n ...topShadow && !hideShadows && {\n boxShadow: 'rgba(0, 0, 0, 0.156863) 0px -6px 5px',\n },\n borderRadius: '16px 16px 0 0',\n // ...swipeableViewsProps.containerStyle\n },\n slide: {\n boxSizing: 'border-box',\n overflow: 'visible',\n marginBottom: overflowHeight ? -overflowHeight : 0,\n // ...swipeableViewsProps.slideStyle\n },\n bottomSlide: {\n marginBottom: overflowHeight,\n\n },\n body: {\n overflow: isOpen ? 'auto' : 'hidden',\n backgroundColor: 'white',\n height: fullScreen ? maxHeight : 'initial',\n maxHeight,\n borderRadius: '16px 16px 0 0',\n // ...this.props.bodyStyle\n },\n },\n overlay: {\n position: 'fixed',\n top: 0,\n right: 0,\n left: 0,\n height,\n transition: 'opacity 450ms',\n pointerEvents: 'none',\n backgroundColor: 'black',\n opacity: 0,\n ...isOpen && {\n opacity: 0.54,\n pointerEvents: 'auto',\n },\n // ...this.props.overlayStyle\n },\n shadowTip: {\n position: 'fixed',\n height: 60,\n width: '200%',\n bottom: -60,\n left: '-50%',\n boxShadow: 'rgba(0, 0, 0, 0.7) 0px 0px 30px',\n transition: 'transform 450ms',\n transform: isOpen ? 'translateY(50px)' : 'translateY(0)',\n },\n } as SwipeableCSS;\n\n return (\n
\n \n\n {overlay &&
onChangeIndex(0)} />}\n\n \n \n {/* {this.props.children} */}\n \n
\n\n
\n \n\n {shadowTip && !hideShadows &&
}\n
\n );\n};\n\nexport default BottomSheet;\n","import * as React from 'react';\nimport {\n Provider, useDispatch, useSelector,\n} from 'react-redux';\nimport { isUndefined, isEmpty } from 'lodash';\nimport useInterval from './utils/useInterval';\nimport store from './redux/init';\nimport OrderMap from './components/OrderMap';\nimport BottomSheet from './components/BottomSheet';\nimport { load as loadOrder } from './redux/order/actions';\n\nconst ShowSpinner = () => (\n
\n \n
Loading...
\n
\n);\n\nconst NoOrder = () => (\n
\n
\n No order details\n
\n \n Install Meridian app\n \n
\n);\n\nfunction App(): JSX.Element {\n const dispatch = useDispatch();\n const idHash = window.location.pathname.replace('/', '');\n\n const order = useSelector((state: CR.RootState) => state.order);\n\n React.useEffect(() => {\n if (idHash) {\n dispatch(loadOrder({ id: idHash }));\n }\n }, [dispatch, idHash]);\n\n useInterval(\n () => {\n dispatch(loadOrder({ id: idHash }));\n }, idHash && isEmpty(order.error) ? parseInt(process.env.REACT_APP_GETORDER as string, 10) : null,\n );\n\n return (\n <>\n {order.loading && isUndefined(order.order)\n ? \n : (\n <>\n {!isUndefined(order.order)\n ? (\n <>\n \n \n \n )\n : }\n \n )}\n \n );\n}\n\nconst WrappedApp = (): JSX.Element => (\n \n \n \n);\n\nexport default WrappedApp;\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-floating-promises */\nimport { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({\n getCLS, getFID, getFCP, getLCP, getTTFB,\n }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { IntlProvider } from 'react-intl';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\nimport en from './locale/en.json';\nimport ro from './locale/ro.json';\nimport availableLanguages from './locale/available';\n\ninterface TranslationType {\n [index: string]: Record,\n}\n\nconst translations: TranslationType = {\n en,\n ro,\n};\n\nconst parseLocale = () => {\n const navLocale = navigator.language.slice(0, 2);\n\n if (availableLanguages.includes(navLocale)) {\n return navLocale;\n }\n\n return 'en';\n};\n\nconst navLang = parseLocale();\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root'),\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n","(function() {\n\t'use strict';\n\n\tvar L = require('leaflet');\n\tvar corslite = require('@mapbox/corslite');\n\tvar polyline = require('@mapbox/polyline');\n\n L.Routing.GraphHopper = L.Class.extend({\n options: {\n\t\t\tserviceUrl: 'https://graphhopper.com/api/1/route',\n\t\t\ttimeout: 30 * 1000,\n\t\t\turlParameters: {}\n\t\t},\n\n\t\tinitialize: function(apiKey, options) {\n\t\t\tthis._apiKey = apiKey;\n\t\t\tL.Util.setOptions(this, options);\n\t\t},\n\n\t\troute: function(waypoints, callback, context, options) {\n\t\t\tvar timedOut = false,\n\t\t\t\twps = [],\n\t\t\t\turl,\n\t\t\t\ttimer,\n\t\t\t\twp,\n\t\t\t\ti;\n\n\t\t\toptions = options || {};\n\t\t\turl = this.buildRouteUrl(waypoints, options);\n\n\t\t\ttimer = setTimeout(function() {\n timedOut = true;\n callback.call(context || callback, {\n status: -1,\n message: 'GraphHopper request timed out.'\n });\n\t\t\t}, this.options.timeout);\n\n\t\t\t// Create a copy of the waypoints, since they\n\t\t\t// might otherwise be asynchronously modified while\n\t\t\t// the request is being processed.\n\t\t\tfor (i = 0; i < waypoints.length; i++) {\n\t\t\t\twp = waypoints[i];\n\t\t\t\twps.push({\n\t\t\t\t\tlatLng: wp.latLng,\n\t\t\t\t\tname: wp.name,\n\t\t\t\t\toptions: wp.options\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tcorslite(url, L.bind(function(err, resp) {\n\t\t\t\tvar data;\n\n\t\t\t\tclearTimeout(timer);\n\n\t\t\t\tif (!timedOut) {\n\t\t\t\t\tvar fired = err ? err : resp;\n\t\t\t\t\t// this.fire(\"response\", {\n\t\t\t\t\t// \tstatus: fired.status,\n\t\t\t\t\t// \tlimit: Number(fired.getResponseHeader(\"X-RateLimit-Limit\")),\n\t\t\t\t\t// \tremaining: Number(fired.getResponseHeader(\"X-RateLimit-Remaining\")),\n\t\t\t\t\t// \treset: Number(fired.getResponseHeader(\"X-RateLimit-Reset\")),\n\t\t\t\t\t// \tcredits: Number(fired.getResponseHeader(\"X-RateLimit-Credits\"))\n\t\t\t\t\t// });\n\t\t\t\t\tif (!err) {\n\t\t\t\t\t\tdata = JSON.parse(resp.responseText);\n\t\t\t\t\t\tthis._routeDone(data, wps, callback, context);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar finalResponse;\n\t\t\t\t\t\tvar responseText = err && err.responseText;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfinalResponse = JSON.parse(responseText);\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tfinalResponse = responseText;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcallback.call(context || callback, {\n\t\t\t\t\t\t\tstatus: -1,\n\t\t\t\t\t\t\tmessage: 'HTTP request failed: ' + err,\n\t\t\t\t\t\t\tresponse: finalResponse\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, this));\n\n\t\t\treturn this;\n\t\t},\n\n buildRouteUrl: function(waypoints, options) {\n\t\t\tvar computeInstructions =\n\t\t\t\t/* Instructions are always needed,\n\t\t\t\t since we do not have waypoint indices otherwise */\n\t\t\t\ttrue,\n\t\t\t\t//!(options && options.geometryOnly),\n\t\t\t\tlocs = [],\n\t\t\t\ti,\n\t\t\t\tbaseUrl;\n\n\t\t\tfor (i = 0; i < waypoints.length; i++) {\n\t\t\t\tlocs.push('point=' + waypoints[i].latLng.lat + ',' + waypoints[i].latLng.lng);\n\t\t\t}\n\n\t\t\tbaseUrl = this.options.serviceUrl + '?' +\n\t\t\t\tlocs.join('&');\n\n\t\t\treturn baseUrl + L.Util.getParamString(L.extend({\n\t\t\t\t\tinstructions: computeInstructions,\n\t\t\t\t\ttype: 'json',\n\t\t\t\t\tkey: this._apiKey\n\t\t\t\t}, this.options.urlParameters), baseUrl);\n\t\t},\n\n\t\t_routeDone: function(response, inputWaypoints, callback, context) {\n\t\t\tvar alts = [],\n\t\t\t mappedWaypoints,\n\t\t\t coordinates,\n\t\t\t i,\n\t\t\t path;\n\n\t\t\tcontext = context || callback;\n\t\t\tif (response.info && response.info.errors && response.info.errors.length) {\n\t\t\t\tcallback.call(context, {\n\t\t\t\t\t// TODO: include all errors\n\t\t\t\t\tstatus: response.info.errors[0].details,\n\t\t\t\t\tmessage: response.info.errors[0].message\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (i = 0; i < response.paths.length; i++) {\n\t\t\t\tpath = response.paths[i];\n\t\t\t\tcoordinates = this._decodePolyline(path.points);\n\t\t\t\tif (path.points_order) {\n\t\t\t\t\tvar tempWaypoints = [];\n\t\t\t\t\tfor (i = 0; i < path.points_order.length; i++) {\n\t\t\t\t\t\ttempWaypoints.push(inputWaypoints[path.points_order[i]]);\n\t\t\t\t\t}\n\t\t\t\t\tinputWaypoints = tempWaypoints;\n\t\t\t\t}\n\t\t\t\tmappedWaypoints =\n\t\t\t\t\tthis._mapWaypointIndices(inputWaypoints, path.instructions, coordinates);\n\n\t\t\t\talts.push({\n // initialResponse: response,\n\t\t\t\t\tname: '',\n\t\t\t\t\tcoordinates: coordinates,\n\t\t\t\t\tinstructions: this._convertInstructions(path.instructions),\n\t\t\t\t\tsummary: {\n\t\t\t\t\t\ttotalDistance: path.distance,\n\t\t\t\t\t\ttotalTime: path.time,\n\t\t\t\t\t\ttotalAscend: path.ascend,\n\t\t\t\t\t},\n\t\t\t\t\tinputWaypoints: inputWaypoints,\n\t\t\t\t\tactualWaypoints: mappedWaypoints.waypoints,\n\t\t\t\t\twaypointIndices: mappedWaypoints.waypointIndices\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tcallback.call(context, null, alts);\n\t\t},\n\n\t\t_decodePolyline: function(geometry) {\n\t\t\tvar coords = polyline.decode(geometry, 5),\n\t\t\t\tlatlngs = new Array(coords.length),\n\t\t\t\ti;\n\t\t\tfor (i = 0; i < coords.length; i++) {\n\t\t\t\tlatlngs[i] = new L.LatLng(coords[i][0], coords[i][1]);\n\t\t\t}\n\n\t\t\treturn latlngs;\n\t\t},\n\n\t\t_toWaypoints: function(inputWaypoints, vias) {\n\t\t\tvar wps = [],\n\t\t\t i;\n\t\t\tfor (i = 0; i < vias.length; i++) {\n\t\t\t\twps.push({\n\t\t\t\t\tlatLng: L.latLng(vias[i]),\n\t\t\t\t\tname: inputWaypoints[i].name,\n\t\t\t\t\toptions: inputWaypoints[i].options\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn wps;\n\t\t},\n\n\t\t_convertInstructions: function(instructions) {\n\t\t\tvar signToType = {\n\t\t\t\t\t'-7': 'SlightLeft',\n\t\t\t\t\t'-3': 'SharpLeft',\n\t\t\t\t\t'-2': 'Left',\n\t\t\t\t\t'-1': 'SlightLeft',\n\t\t\t\t\t0: 'Straight',\n\t\t\t\t\t1: 'SlightRight',\n\t\t\t\t\t2: 'Right',\n\t\t\t\t\t3: 'SharpRight',\n\t\t\t\t\t4: 'DestinationReached',\n\t\t\t\t\t5: 'WaypointReached',\n\t\t\t\t\t6: 'Roundabout',\n\t\t\t\t\t7: 'SlightRight'\n\t\t\t\t},\n\t\t\t\tresult = [],\n\t\t\t\ttype,\n\t\t\t\ti,\n\t\t\t\tinstr;\n\n\t\t\tfor (i = 0; instructions && i < instructions.length; i++) {\n\t\t\t\tinstr = instructions[i];\n\t\t\t\tif (i === 0) {\n\t\t\t\t\ttype = 'Head';\n\t\t\t\t} else {\n\t\t\t\t\ttype = signToType[instr.sign];\n\t\t\t\t}\n\t\t\t\tresult.push({\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmodifier: type,\n\t\t\t\t\ttext: instr.text,\n\t\t\t\t\tdistance: instr.distance,\n\t\t\t\t\ttime: instr.time / 1000,\n\t\t\t\t\tindex: instr.interval[0],\n\t\t\t\t\texit: instr.exit_number\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn result;\n\t\t},\n\n\t\t_mapWaypointIndices: function(waypoints, instructions, coordinates) {\n\t\t\tvar wps = [],\n\t\t\t\twpIndices = [],\n\t\t\t i,\n\t\t\t idx;\n\n\t\t\twpIndices.push(0);\n\t\t\twps.push(new L.Routing.Waypoint(coordinates[0], waypoints[0].name));\n\n\t\t\tfor (i = 0; instructions && i < instructions.length; i++) {\n\t\t\t\tif (instructions[i].sign === 5) { // VIA_REACHED\n\t\t\t\t\tidx = instructions[i].interval[0];\n\t\t\t\t\twpIndices.push(idx);\n\t\t\t\t\twps.push({\n\t\t\t\t\t\tlatLng: coordinates[idx],\n\t\t\t\t\t\tname: waypoints[wps.length + 1].name\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twpIndices.push(coordinates.length - 1);\n\t\t\twps.push({\n\t\t\t\tlatLng: coordinates[coordinates.length - 1],\n\t\t\t\tname: waypoints[waypoints.length - 1].name\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\twaypointIndices: wpIndices,\n\t\t\t\twaypoints: wps\n\t\t\t};\n\t\t}\n });\n\n L.Routing.graphHopper = function(apiKey, options) {\n\t\treturn new L.Routing.GraphHopper(apiKey, options);\n\t};\n\n module.exports = L.Routing.GraphHopper;\n})();"],"sourceRoot":""}