{"version":3,"sources":["assets/logo.PNG","assets/dateicon.PNG","assets/hdicon.PNG","assets/bottomVideo.mp4","responseModel.js","App.js","serviceWorker.js","index.js"],"names":["module","exports","responseModel","App","props","clockupdate","GateDate","state","timezone","bindData","destinationIds","setState","componentLoading","finalData","finalJourneyList","forEach","destionationId","GetDataFromAPI","GetWeather","city","data","journeyList","apiCount","dateTime","moment","beforeDate","weather","pageItemCount","this","setInterval","self","axios","get","then","response","datetime","add","catch","error","console","log","params","q","APPID","units","main","temp","originId","destinationId","callback","post","apiVersion","id","method","origin","destination","departure","from","format","to","headers","items","element","index","firstElement","isOk","route","routeElement","lastElement","length","model","GetLicensePlateFromAPI","licensePlate","departureTime","time","orderTime","name","arrivalTime","busType","bus","type","toString","push","journeyId","contact","date","sortedData","$select","groupBy","p","select","firstOrDefault","orderBy","toArray","where","nextJourney","x","className","src","logo","alt","width","hdIcon","parseInt","dateIcon","map","item","kalkmis","isNext","minutesDiff","duration","diff","asMinutes","dynClassName","key","loop","height","autoPlay","muted","bottomVideo","React","Component","Boolean","window","location","hostname","match","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"wGAAAA,EAAOC,QAAU,IAA0B,kC,mBCA3CD,EAAOC,QAAU,IAA0B,sC,mBCA3CD,EAAOC,QAAU,IAA0B,oC,mBCA3CD,EAAOC,QAAU,IAA0B,yC,iOCW5BC,E,8ICyPAC,E,YAtPb,WAAYC,GAAQ,IAAD,8BACjB,4CAAMA,KAuBRC,YAAc,WACZ,EAAKC,SAAS,EAAKC,MAAMC,WAzBR,EA4BnBC,SAAW,WACT,IAAIC,EAAiB,CAAC,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,MAEjE,EAAKC,SAAS,CAAEC,kBAAkB,EAAMC,UAAW,GAAIC,iBAAkB,KAAM,WAC7EJ,EAAeK,SAAQ,SAAAC,GACrB,EAAKC,eAHM,GAGmBD,GAAgB,SAACF,GAC7C,E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AKA,UAAU,SACb,2BAAOA,UAAU,+BACf,+BACE,4BAEE,qCACA,yCACA,2CACA,+CACA,4CAGJ,+BAEIX,EAAWmB,KAAI,SAACC,EAAM3C,GAClB,IAAM4C,EAAUtB,EAAO7D,IAAOkF,EAAKjC,cAAe,uBAC9CmC,GAAS,EAEb,GAAIb,GAAeA,EAAY3C,KAAOsD,EAAKtD,GAAI,CAC7C,IACIyD,EADWrF,IAAOsF,SAAStF,IAAOuE,EAAYtB,cAAe,uBAAuBsC,KAAK1B,IAClE2B,YAC3BJ,EAAUb,EAAY3C,KAAOsD,EAAKtD,IAAQyD,EAAc,GAG1D,IAAII,EAAeN,EAAU,UAAY,GAKzC,OAJAM,EAAeA,GAAgBL,EAAS,eAAiB,GAKvD,wBAAIM,IAAK,aAAenD,GACtB,wBAAIkC,UAAWgB,EAAe,4BAA6BP,EAAKlC,cAChE,wBAAIyB,UAAWgB,EAAe,kBAA9B,OACA,wBAAIhB,UAAWgB,GAAezF,IAAOkF,EAAKjC,cAAe,uBAAuBf,OAAO,UACvF,wBAAIuC,UAAWgB,EAAe,SAAUP,EAAKnD,aAC7C,wBAAI0C,UAAWgB,GAAezF,IAAOkF,EAAK7B,YAAa,uBAAuBnB,OAAO,kBASvG,yBAAKuC,UAAU,aACb,2BAAOkB,MAAI,EAACC,OAAO,MAAMf,MAAM,OAAOgB,UAAQ,EAACC,OAAK,GAAC,4BAAQpB,IAAMqB,IAAcvC,KAAK,sB,GA9OlFwC,IAAMC,WCDJC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCZNC,IAASC,OAAO,kBAAC,EAAD,MAASC,SAASC,eAAe,SD2H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMpG,MAAK,SAAAqG,GACjCA,EAAaC,kB","file":"static/js/main.8196e93d.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/logo.f2d7eb95.PNG\";","module.exports = __webpack_public_path__ + \"static/media/dateicon.e49d6d0d.PNG\";","module.exports = __webpack_public_path__ + \"static/media/hdicon.acc5dc5f.PNG\";","module.exports = __webpack_public_path__ + \"static/media/bottomVideo.0c800c31.mp4\";","\r\nclass responseModel {\r\n id;\r\n licensePlate;\r\n departureTime;\r\n destination;\r\n arrivalTime;\r\n State;\r\n busType;\r\n}\r\n\r\nexport default responseModel;","import React, { useDebugValue } from 'react';\r\nimport './App.css';\r\nimport axios from \"../node_modules/axios\"\r\nimport responseModel from \"./responseModel\"\r\nimport logo from './assets/logo.PNG';\r\nimport moment, { now } from 'moment';\r\nimport 'moment/locale/tr';\r\nimport dateIcon from './assets/dateicon.PNG';\r\nimport hdIcon from './assets/hdicon.PNG';\r\nimport $select from 'linq';\r\nimport bottomVideo from './assets/bottomVideo.mp4';\r\n\r\n\r\nclass App extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n data: [],\r\n journeyList: [],\r\n finalData: [],\r\n componentLoading: false,\r\n apiCount: 0,\r\n dateTime: moment(),\r\n beforeDate: moment(),\r\n weather: 0,\r\n city: 'Şanlıurfa',\r\n timezone: 'Asia/Istanbul',\r\n pageItemCount: 10\r\n }\r\n }\r\n\r\n componentWillMount() {\r\n this.GateDate(this.state.timezone);\r\n this.bindData();\r\n setInterval(() => this.bindData(), 300000);\r\n setInterval(this.clockupdate, 10000);\r\n }\r\n\r\n clockupdate = () => {\r\n this.GateDate(this.state.timezone);\r\n }\r\n\r\n bindData = () => {\r\n var destinationIds = [4, 11, 12, 26, 27, 45, 46, 51, 60, 61, 88, 1360];\r\n var originId = 81;\r\n this.setState({ componentLoading: true, finalData: [], finalJourneyList: [] }, () => {\r\n destinationIds.forEach(destionationId => {\r\n this.GetDataFromAPI(originId, destionationId, (finalJourneyList) => {\r\n this.setState({ componentLoading: true, finalData: finalJourneyList }, () => {\r\n this.setState({ componentLoading: false });\r\n })\r\n });\r\n });\r\n this.GetWeather(this.state.city);\r\n });\r\n }\r\n\r\n GateDate(timezone) {\r\n const self = this;\r\n axios.get('http://worldtimeapi.org/api/timezone/' + timezone)\r\n .then(function (response) {\r\n if (response) {\r\n self.setState({ dateTime: moment(response.data.datetime, 'YYYY-MM-DD hh:mm:ss'), beforeDate: moment(response.data.datetime, 'YYYY-MM-DD hh:mm:ss').add(-2, 'h') });\r\n } else {\r\n self.setState({ dateTime: moment() });\r\n }\r\n })\r\n .catch(function (error) {\r\n console.log(error);\r\n self.setState({ dateTime: moment() });\r\n\r\n });\r\n }\r\n\r\n GetWeather(city) {\r\n const self = this;\r\n axios.get('http://api.openweathermap.org/data/2.5/weather', {\r\n params: {\r\n q: city,\r\n APPID: '39ab257f42049249550e1ac459c9b8bd',\r\n units: 'metric'\r\n }\r\n }).then(function (response) {\r\n if (response) {\r\n self.setState({ weather: response.data.main.temp });\r\n } else {\r\n self.setState({ weather: 0 });\r\n }\r\n })\r\n .catch(function (error) {\r\n console.log(error);\r\n self.setState({ weather: 0 });\r\n });\r\n }\r\n\r\n GetDataFromAPI(originId, destinationId, callback) {\r\n const { journeyList } = this.state;\r\n const self = this;\r\n const url = \"http://astorws.accordors.com/api\";\r\n\r\n axios.post(url, {\r\n apiVersion: \"0.1.0\",\r\n id: '507220',\r\n method: 'journeys.list',\r\n params: {\r\n origin: originId,\r\n destination: destinationId,\r\n departure: {\r\n from: this.state.dateTime.format('YYYY-MM-DDT00:01+02:00'),\r\n to: this.state.dateTime.format('YYYY-MM-DDT23:59+02:00')\r\n }\r\n },\r\n headers: { 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Response-Type': 'application/json' }\r\n })\r\n .then(function (response) {\r\n if (response) {\r\n var items = response.data.data.items;\r\n items.forEach((element, index) => {\r\n var firstElement = [];\r\n var isOk = false;\r\n element.route.forEach((routeElement, index) => {\r\n if (routeElement.id == originId)\r\n firstElement = routeElement;\r\n })\r\n\r\n var lastElement = element.route[element.route.length - 1];\r\n var model = new responseModel();\r\n\r\n self.GetLicensePlateFromAPI(element.id, index, (licensePlate) => {\r\n model.licensePlate = licensePlate;\r\n self.setState({ apiCount: self.apiCount + 1 });\r\n });\r\n\r\n model.id = element.id;\r\n model.departureTime = firstElement.time;\r\n model.orderTime = moment(firstElement.time, 'YYYY-MM-DD HH:mm:ss');\r\n model.destination = lastElement.name;\r\n model.arrivalTime = lastElement.time;\r\n model.busType = element.bus.type;\r\n\r\n if (lastElement.id === destinationId.toString()) {\r\n isOk = true;\r\n }\r\n if (isOk) {\r\n journeyList.push(model);\r\n }\r\n });\r\n callback(journeyList);\r\n }\r\n })\r\n .catch(function (error) {\r\n console.log(error);\r\n callback([]);\r\n });\r\n }\r\n\r\n GetLicensePlateFromAPI(journeyId, index, callback) {\r\n const url = \"http://astorws.accordors.com/api\";\r\n axios.post(url, {\r\n apiVersion: \"0.1.0\",\r\n id: '507220',\r\n method: \"journeys.seats\",\r\n params: {\r\n journeyId: journeyId\r\n },\r\n headers: { 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Response-Type': 'application/json' }\r\n })\r\n .then(function (response) {\r\n if (response) {\r\n callback(response.data.data.contact.licensePlate);\r\n }\r\n })\r\n .catch(function (error) {\r\n console.log(error);\r\n // callback(\"GetLicensePlateFromAPI: Hatalı Response\");\r\n });\r\n }\r\n\r\n render() {\r\n const date = this.state.dateTime; //moment().locale('tr');\r\n const { finalData, apiCount } = this.state;\r\n var sortedData = $select.from(finalData).groupBy(p => p.id).select(p => p.firstOrDefault()).orderBy(p => p.departureTime).toArray();\r\n if (sortedData.length > this.state.pageItemCount) {\r\n sortedData.forEach((element, index) => {\r\n if (moment(element.departureTime, 'YYYY-MM-DD hh:mm:ss') < this.state.beforeDate && sortedData.length > this.state.pageItemCount) {\r\n sortedData = $select.from(sortedData).where(p => moment(p.departureTime, 'YYYY-MM-DD hh:mm:ss') > this.state.beforeDate).toArray();\r\n }\r\n });\r\n }\r\n const nextJourney = $select.from(sortedData).where(x => moment(x.departureTime, 'YYYY-MM-DD hh:mm:ss') > date).firstOrDefault();\r\n\r\n return (\r\n
S.NO | */}\r\nPLAKA | \r\nOTOBÜS | \r\nKALKIŞ | \r\nŞEHİR | \r\nVARIŞ | \r\n{item.busType} | \r\n return (\r\n
---|---|---|---|---|---|
{item.licensePlate} | \r\n1+1 | \r\n{moment(item.departureTime, 'YYYY-MM-DD HH:mm:ss').format('HH:mm')} | \r\n{item.destination} | \r\n{moment(item.arrivalTime, 'YYYY-MM-DD HH:mm:ss').format('HH:mm')} | \r\n