{"version":3,"sources":["containers/home/Home.js"],"names":["Home","homeComponentName","state","onBooking","a","secondPage","store","getState","UISettings","flow","split","replace","clientBookingURL","props","$verifyPromo","then","_","jumpToSteps","URLSearchParams","window","location","search","get","err","ErrorTypes","NO_VEHICLE_AVAILABLE","Alert","error","console","log","onVehcicleMakeChange","$getMakeForVehtype","onLocationChangeSubLoc","$getSubLocations","NO_LOCATION_AVAILABLE","checkVehicleMake","$CheckVehicleMake","sendEmailAlert","$sendEmailAlert","urlParams","home","this","setState","$importHome","vehicleTypes","mapToInputPicker","vehicleMakes","googleTagContainerId","homeComponent","form","locations","primaryColor","secondaryColor","storeHours","storeHours_differentDropOff","storeHolidays","dateFormat","css","buttonColor","isAgeOnHome","isReservation","showClock","alwaysSamePickAndDrop","timeGap","showPickupDropoffAddress","hideOrDisableTimePicker","minimumBookingDays","maximumBookingDays","minimumBookingHours","earliestPickup","minimumDriverAge","$changeForm","$createCustomer","showLogoOnHome","homeScreenMessage","logo","$clearvehicleTypes","showPromoCode","showMonthYear","DropDownClock","cutOffTime","addDaysForCheckout","homeSettings","minimumBookingDaysFromConfig","sublocations","React","Component","connect","homeView","config","imports","homePage","dynamicStyle","trackingSettings","dispatch","componentName","importHomeComponent","key","value","changeForm","$fetchVehicleType","fetchVehicleType","verifyPromotion","createCustomer","clearvehicleTypes","getVehicleMakes","checkVehiclesMake","getSubLocations"],"mappings":"4QAsBMA,E,4MACJC,kBAAoB,G,EAEpBC,MAAQ,CACND,kBAAmB,I,EAGrBE,U,sBAAY,gCAAAC,EAAA,sDACV,IACMC,EAAaC,IACdC,WACAC,WAAWC,KAAKC,MAAM,KAAK,GAC3BC,QAAQ,SAAU,IAEjBC,EANF,UAMqBN,IAAMC,WAAWC,WAAWI,wBANjD,QAMqE,GAGvE,EAAKC,MAAMC,eAAeC,MAAK,SAACC,GAC9BC,YACE,IAAIC,gBAAgBC,OAAOC,SAASC,QAAQC,IAAI,YAChD,IAAIJ,gBAAgBC,OAAOC,SAASC,QAA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AME,WAAWuE,cAChCC,WAAY1E,EAAME,WAAWwE,WAC7BC,mBAAoB3E,EAAME,WAAWyE,mBACrCnC,aAAcxC,EAAMwC,aACpBqC,6BAA8B7E,EAAME,WAAW2E,6BAC/CpC,qBAAsBzC,EAAMuF,iBAAiB9C,qBAC7CqC,aAAc9E,EAAM8E,iBAIG,SAACU,GAC1B,MAAO,CACLnD,YAAa,SAACoD,GAAD,OACXD,EAASE,YAAoBD,KAC/BxB,YAAa,SAAC0B,EAAKC,GAAN,OAAgBJ,EAASK,YAAWF,EAAKC,KACtDE,kBAAmB,kBAAMN,EAASO,gBAClCvF,aAAc,kBAAMgF,EAASQ,gBAC7B9B,gBAAiB,kBAAMsB,EAASS,gBAChC3B,mBAAoB,kBAAMkB,EAASU,gBACnCzE,mBAAoB,kBAAM+D,EAASW,gBACnCrE,kBAAmB,kBAAM0D,EAASY,gBAClCzE,iBAAkB,kBAAM6D,EAASa,gBACjCrE,gBAAiB,kBAAMwD,EAASzD,mBAIrBkD,CAA6CvF","file":"static/js/370.62f39e73.chunk.js","sourcesContent":["import React from \"react\";\r\nimport { connect } from \"react-redux\";\r\n\r\nimport { importHomeComponent } from \"../../redux/actions/importActions\";\r\nimport { changeForm, clearvehicleTypes } from \"../../redux/actions/formActions\";\r\nimport {\r\n createCustomer,\r\n fetchVehicleType,\r\n verifyPromotion,\r\n getVehicleMakes,\r\n checkVehiclesMake,\r\n getSubLocations,\r\n sendEmailAlert,\r\n} from \"../../redux/actions/ApiActions\";\r\nimport { jumpToSteps, mapToInputPicker } from \"../../tools/utils\";\r\nimport { Alert } from \"rsuite\";\r\nimport ErrorTypes from \"../../tools/ErrorTypes\";\r\nimport { Helmet } from \"react-helmet\";\r\nimport store from \"../../redux/createStore\";\r\n\r\n// vehicleTypes\r\n\r\nclass Home extends React.Component {\r\n homeComponentName = \"\";\r\n\r\n state = {\r\n homeComponentName: \"\",\r\n };\r\n\r\n onBooking = async () => {\r\n try {\r\n let secondPage = store\r\n .getState()\r\n .UISettings.flow.split(\"/\")[1]\r\n .replace(/[_-].*/, \"\");\r\n\r\n let clientBookingURL = store.getState().UISettings.clientBookingURL ?? \"\";\r\n\r\n //await this.props.$fetchVehicleType();\r\n this.props.$verifyPromo().then((_) => {\r\n jumpToSteps(\r\n new URLSearchParams(window.location.search).get(\"clientid\"),\r\n new URLSearchParams(window.location.search).get(\"lang\"),\r\n secondPage,\r\n clientBookingURL\r\n );\r\n });\r\n } catch (err) {\r\n if (err === ErrorTypes.NO_VEHICLE_AVAILABLE) {\r\n Alert.error(\"No Vehicles available. Please Select different location.\");\r\n }\r\n console.log(err);\r\n }\r\n };\r\n\r\n onVehcicleMakeChange = async () => {\r\n try {\r\n await this.props.$getMakeForVehtype();\r\n } catch (err) {\r\n if (err === ErrorTypes.NO_VEHICLE_AVAILABLE) {\r\n Alert.error(\"No Vehicles available. Please Select different location.\");\r\n }\r\n console.log(err);\r\n }\r\n };\r\n\r\n onLocationChangeSubLoc = async () => {\r\n try {\r\n await this.props.$getSubLocations();\r\n } catch (err) {\r\n if (err === ErrorTypes.NO_LOCATION_AVAILABLE) {\r\n Alert.error(\r\n \"No SubLocation available. Please Select different location.\"\r\n );\r\n }\r\n console.log(err);\r\n }\r\n };\r\n\r\n checkVehicleMake = async () => {\r\n try {\r\n await this.props.$CheckVehicleMake();\r\n } catch (err) {\r\n if (err === ErrorTypes.NO_VEHICLE_AVAILABLE) {\r\n // Alert.error('No Vehicles available.');\r\n throw err;\r\n }\r\n console.log(err);\r\n }\r\n };\r\n\r\n sendEmailAlert = async () => {\r\n try {\r\n await this.props.$sendEmailAlert();\r\n } catch (err) {\r\n if (err === ErrorTypes.NO_VEHICLE_AVAILABLE) {\r\n // Alert.error('No Vehicles available.');\r\n throw err;\r\n }\r\n console.log(err);\r\n }\r\n };\r\n\r\n urlParams = new URLSearchParams(window.location.search);\r\n\r\n componentDidMount() {\r\n const home = this.urlParams.get(\"home\");\r\n\r\n this.setState({ homeComponentName: home });\r\n }\r\n\r\n render() {\r\n if (this.state.homeComponentName) {\r\n if (this.homeComponentName !== this.state.homeComponentName) {\r\n this.homeComponentName = this.state.homeComponentName;\r\n this.props.$importHome(this.homeComponentName);\r\n }\r\n } else if (this.homeComponentName !== this.props.homeComponentName) {\r\n this.homeComponentName = this.props.homeComponentName;\r\n this.props.$importHome();\r\n }\r\n const vehicleTypes = mapToInputPicker(\r\n this.props.vehicleTypes,\r\n \"value\",\r\n \"id\",\r\n \"id\"\r\n );\r\n const vehicleMakes = mapToInputPicker(\r\n this.props.vehicleMakes,\r\n \"value\",\r\n \"id\",\r\n \"value\"\r\n );\r\n\r\n //localStorage.removeItem('q');\r\n\r\n return (\r\n <>\r\n {this.props.googleTagContainerId && (\r\n \r\n \r\n \r\n )}\r\n \r\n >\r\n );\r\n }\r\n}\r\n\r\nconst mapStateToProps = (store) => {\r\n return {\r\n homeComponentName: store.UISettings.homeView,\r\n homeSettings: store.config.home,\r\n timeGap: store.UISettings.timeGap,\r\n dateFormat: store.UISettings.dateFormat,\r\n primaryColor: store.UISettings.primaryColor,\r\n secondaryColor: store.UISettings.secondaryColor,\r\n buttonColor: store.UISettings.buttonColor,\r\n isAgeOnHome: store.UISettings.isAgeOnHome,\r\n vehicleTypes: store.UISettings.vehicleTypes,\r\n showClock: store.UISettings.showClock,\r\n alwaysSamePickAndDrop: store.UISettings.alwaysSamePickAndDrop,\r\n homeComponent: store.imports.homePage,\r\n locations: store.locations,\r\n storeHours: store.storeHours,\r\n storeHours_differentDropOff: store.storeHours_differentDropOff,\r\n storeHolidays: store.storeHolidays,\r\n showPickupDropoffAddress: store.UISettings.showPickupDropoffAddress,\r\n hideOrDisableTimePicker: store.UISettings.hideOrDisableTimePicker,\r\n minimumBookingDays: store.UISettings.minimumBookingDays,\r\n maximumBookingDays: store.UISettings.maximumBookingDays,\r\n minimumBookingHours: store.UISettings.minimumBookingHours,\r\n earliestPickup: store.UISettings.earliestPickup,\r\n minimumDriverAge: store.UISettings.minimumDriverAge,\r\n form: store.form,\r\n css: store.imports.dynamicStyle,\r\n showLogoOnHome: store.UISettings.showLogoOnHome,\r\n homeScreenMessage: store.UISettings.homeScreenMessage,\r\n logo: store.UISettings.logo,\r\n showPromoCode: store.UISettings.showPromoCode,\r\n showMonthYear: store.UISettings.showMonthYear,\r\n DropDownClock: store.UISettings.DropDownClock,\r\n cutOffTime: store.UISettings.cutOffTime,\r\n addDaysForCheckout: store.UISettings.addDaysForCheckout,\r\n vehicleMakes: store.vehicleMakes,\r\n minimumBookingDaysFromConfig: store.UISettings.minimumBookingDaysFromConfig,\r\n googleTagContainerId: store.trackingSettings.googleTagContainerId,\r\n sublocations: store.sublocations,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = (dispatch) => {\r\n return {\r\n $importHome: (componentName) =>\r\n dispatch(importHomeComponent(componentName)),\r\n $changeForm: (key, value) => dispatch(changeForm(key, value)),\r\n $fetchVehicleType: () => dispatch(fetchVehicleType()),\r\n $verifyPromo: () => dispatch(verifyPromotion()),\r\n $createCustomer: () => dispatch(createCustomer()),\r\n $clearvehicleTypes: () => dispatch(clearvehicleTypes()),\r\n $getMakeForVehtype: () => dispatch(getVehicleMakes()),\r\n $CheckVehicleMake: () => dispatch(checkVehiclesMake()),\r\n $getSubLocations: () => dispatch(getSubLocations()),\r\n $sendEmailAlert: () => dispatch(sendEmailAlert()),\r\n };\r\n};\r\n\r\nexport default connect(mapStateToProps, mapDispatchToProps)(Home);\r\n"],"sourceRoot":""}