{"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
\r\n {!this.state.componentLoading &&\r\n
\r\n
\r\n
\r\n
logo
\r\n
\r\n
w {parseInt(this.state.weather)}
\r\n
{this.state.dateTime.format('HH:mm')}
\r\n
date {this.state.dateTime.format('Do MMMM YYYY')}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n {/* */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n sortedData.map((item, index) => {\r\n const kalkmis = date > moment(item.departureTime, 'YYYY-MM-DD hh:mm:ss');\r\n let isNext = false;\r\n\r\n if (nextJourney && nextJourney.id === item.id) {\r\n var duration = moment.duration(moment(nextJourney.departureTime, 'YYYY-MM-DD hh:mm:ss').diff(date));\r\n var minutesDiff = duration.asMinutes();\r\n isNext = (nextJourney.id === item.id) && (minutesDiff < 30);\r\n }\r\n\r\n let dynClassName = kalkmis ? 'kalkmis' : '';\r\n dynClassName = dynClassName += isNext ? ' nextJourney' : '';\r\n\r\n //03.06.2020 metinle konuşuldu otobüs düzenleri geçici olarak sadece 1+1 olacak şekilde güncellendi.\r\n //\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n })\r\n }\r\n \r\n
S.NOPLAKAOTOBÜSKALKIŞŞEHİRVARIŞ
{item.busType}
{item.licensePlate}1+1{moment(item.departureTime, 'YYYY-MM-DD HH:mm:ss').format('HH:mm')}{item.destination}{moment(item.arrivalTime, 'YYYY-MM-DD HH:mm:ss').format('HH:mm')}
\r\n
\r\n
\r\n
\r\n \r\n
\r\n\r\n
}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default App;\r\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}