1"use strict";(globalThis.webpackChunkzoomcar_com=globalThis.webpackChunkzoomcar_com||[]).push([[4389],{94389(t,e,i){i.r(e),i.d(e,{default:()=>S});var s=i(16289),a=i(28652),o=i(10834),n=i(26298),c=i(46190),r=i(49612),h=i(9124),l=i(62061),m=i(52652),d=i(67077),u=i(67052),p=i(31616);const _=window.zcDB,C=[{label:"Round Trip",icon:"z-swap",type:"round_trip"},{label:"Airport",icon:"z-airplane",type:"airport"}],g={components:{CheckBox:s.A,SlidePopUp:h.default,CalendarPopup:d.default,SubscriptionPopup:u.default,CalendarV3:()=>i.e(6171).then(i.bind(i,66674)),LocationList:()=>i.e(9303).then(i.bind(i,49627))},props:{preTitle:{type:String,default:"Looking for Best Car Rentals?"},title:{type:String,default:"Book Self-Drive Cars in"},isLongTitle:{type:Boolean,default:!1},cityChangeCallback:{type:Function,default:()=>{}}},data:()=>({showCalendar:!1,showLocation:!1,showCitySelection:!1,showSubscriptionPopup:!1,list:[],places:[],searchInput:"",recentPlaces:[],defaultLoc:{airport:null,round_trip:null},currentLocationFetching:!1,inputOrigin:"",dateStarts:void 0,dateEnds:void 0,inputValue:"",isFocused:!1,isHDChecked:!1,cityData:null,citySearch:"",filteredCities:[],homeProducts:[{title:"Daily Drives",sub_title:"Upto 7 days",type:"NORMAL"},{title:"Subscription",sub_title:"7 day+ rides",type:"ZOOMCAR_SUBSCRIPTION",new_tag:!0,min_duration:10080,enabled:!0,default_start_time:480}],mapplsSession:(0,p.A)()}),created(){const t=this.$store.getters["App/city"];t&&_.history.where({city:t}).sortBy("last_used").then(t=>{this.allHistory=t.length>5?t.slice(t.length-5):t,this.recentPlaces=t.map(t=>({lat:t.coords.lat,lng:t.coords.lng,title:t.name}))}).catch(t=>{})},mounted(){this.fetchSuggested(),this.dateStarts=this.starts,this.dateEnds=this.ends;let t=null;this.countries.find(t=>"India"===t.name)?.cities&&(t=this.countries.find(t=>"India"===t.name)?.cities?.find(t=>t.city_link_name===this.city||this.userCityLinkName),this.$store.commit("Search/updateOrigin",t)),this.setCustomHomeProducts(this.homeProductsTabs),!this.origin.name||this.origin.name&&!this.origin.lat||this.origin.city!==this.$route.params.city_link&&t?(this.inputOrigin=this.setAddressFromCoords({lat:t?.lat,lng:t?.lng}),this.setDefaultLocations(),this.setAndUpdateOrigin(this.defaultLoc[this.product],t)):this.inputOrigin=this.origin.name},computed:{...(0,o.mapGetters)({countries:"Location/countries",city:"App/city",origin:"Search/origin",product:"Search/product",minDate:"Search/minStarts",suggested:"Search/suggested",starts:"Search/starts",ends:"Search/ends",cities:"Location/cities",country:"App/country",countryCode:"App
1/countryCode",isCitiesLoaded:"Location/isCitiesLoaded",cityDetail:"Location/cityDetail",selectedCar:"HomeNew/selectedCar",userCityLinkName:"User/userCityLinkName",isSubscription:"Search/isSubscription",user:"User/user",homeProductsTabs:"Search/homeProductsTabs",selectedProductType:"Search/selectedProductType"}),activeProductIndex(){if(!this.homeProducts?.length)return 0;const t=this.homeProducts.findIndex(t=>t.type==this.selectedProductType);return-1!==t?t:0},segment(){return l.A.call(this)},searchedPlaces(){return this.places},recentPlacesList(){return this.recentPlaces},countryData(){return this.countries?.[0]||{}},isWeekdayCalendar(){return"WEEKDAY_COMMUTE"==this.selectedProductType}},methods:{...(0,o.mapActions)({fetchSuggested:"Search/fetchSuggested",fetchSearched:"Search/fetchSearched",fetchPlaceDetails:"Search/fetchPlaceDetails",fetchGeoAddress:"Search/fetchGeoAddress",setProductData:"Search/setProductData",setSubscription:"Search/setSubscription",setAddressFromCoords:"Search/setAddressFromCoords"}),handleProductClick(t,e){"BIKE_RENTAL"!=t.type?(this.$emit("segment",this.segment.onClickEvent("product_selected")),this.setProductData(t)):this.$router.push({name:"BikeRental"})},HDClicked(){this.isHDChecked=!this.isHDChecked,this.$emit("segment",this.segment.onClickEvent("hd_clicked"))},setDefaultLocations(){C.forEach(t=>{this.defaultLoc[t.type]=this.getselectedProductLocation(this.countries.find(t=>"India"===t.name)?.cities,this.city,t.type)})},handleHover(t,e){t||"date"!==e||(this.dateStarts=this.starts,this.dateEnds=this.ends),t||"location"!==e||(this.inputOrigin=this.origin.name)},handleDateSubmit(t){this.$emit("segment",this.segment.onClickEvent("date_continue_click"));const e=new Date(t.start);new Date(t.end);this.$store.commit("Search/setDateTime",{point:"starts",date:t.start}),this.$store.commit("Search/setDateTime",{point:"ends",date:t.end}),this.showCalendar=!1,this.handleGetCarClick()},handleCityClick(t,e,i,s,o){this.$emit("segment",this.segment.onClickEvent("city_selected")),this.cityData=o,this.showCitySelection=!1;let n="in";this.$store.commit("Search/updateOrigin",o),this.cityChangeCallback(),a.Ay.create("city",i),this.setAddressFromCoords({lat:o?.lat,lng:o?.lng}),this.$store.commit("App/setCity",e),this.$store.commit("App/setCountryCode",n);let c="undefined"!=s&&s?s:"IND";this.$store.commit("App/setCountryApiCode",c),this.$store.commit("App/setIsCitySelected",!0),this.$store.commit("Search/setOriginCity",e),this.$store.commit("User/setCityData",o),this.$store.commit("User/setUserCityLinkName",e),this.$store.commit("App/setLocale","en"),this.$i18n.locale="en",this.showCitySelection=!1,this.$route.params.city_link!==e&&this.$router.replace({name:"HomePage",params:{country_code:n,city_link:e}})},handleDateUpdate(t){this.$emit("segment",this.segment.onClickEvent("date_updated_click")),this.$store.commit("Search/setDateTime",{point:"starts",date:t.start}),this.$store.commit("Search/setDateTime",{point:"ends",date:t.end})},autocompleteApiCall:(0,n.sg)(function(t){!t||t.length<4?this.places=[]:this.fetchSearched({text:t}).then(t=>{this.places=t||[]})},300),handleLocationChange(t){const{value:e}=t.target;this.autocompleteApiCall(e)},handleLocationSelect(t){this.$emit("segment",this.segment.onClickEvent("location_selected_click")),t.lng||t.lat?(this.$store.commit("Search/setOrigin",{name:t.title,lat:t.lat,lng:t.lng}),this.inputOrigin=t.title):this.fetchPlaceDetails({place_id:t.place_id}).then(e=>{if(e){if(e.zc_city!==this.userCityLinkName){let t={};if(this.cityDetail[e.zc_city])t=this.cityDetail[e.zc_city];else{const i=(0,m.X)(e,this.countries.find(t=>"India"===t.name)?.cities||[]);i?(t={...e,country_code:"IND",countryCode:"in",countryApiCode:"IND",link_name:i.link_name},e.zc_city=i.link_name):(t={...e,country_code:"IND",countryCode:"in",countryApiCode:"IND",link_name:this.userCityLinkName},e.zc_city=this.userCityLinkName)}this.$store.commit("App/setCountry",t.country),this.$store.commit("App/setCountryCode",t.countryCode),this.$store.commit("App/setCountryApiCode",t.countryApiCode),this.$store.commit("App/setCity",e.zc_city),this.$store.commit("User/setUserCityLinkName",e.zc_city),this.$store.commit("Search/setOriginCity",e.zc_city),this.$store.commit("User/setCityData",t),this.$store.commit("App/setIsCitySelected",!0),this.$store.commit("App/setCityNotFound",!1),this.$store.commit("HomeNew/setCarSelectionToSearchFlow",!1),this.$store.commit("HomeNew/setAvailableDates",[]),this.$store.commit("HomeNew/clearSelectedCar"),this.userCityLinkName!=e.zc_city&&this.$router.replace({name:"HomePage",params:{country_code:t.countryCode,city_link:t.link_name}})}this.$store.commit("Search/setOrigin",{name:t.title,lat:e.lat,lng:e.lng}),this.inputOrigin=t.title}}
1),this.showLocation=!1},handleGetCarClick(){this.$emit("segment",this.segment.onClickEvent("search_car_click")),sessionStorage.setItem("search_session_id",(0,r.A)()),sessionStorage.setItem("location",JSON.stringify(this.origin)),this.$store.commit("HomeNew/setCarSelectionToSearchFlow",!1);let t={lat:this.origin.lat,lng:this.origin.lng,type:this.product,starts:this.starts?.getTime(),ends:this.ends?.getTime(),car_id:this.selectedCar.car_id,delivery_type:this.isHDChecked?"home%2Cairport":"",subscription:this.isSubscription,product_type:this.selectedProductType};this.$router.push({name:"SearchPage",query:t,params:{city_link:this.city||this.userCityLinkName,country_code:this.countryCode}}),sessionStorage.setItem("selectedCar",JSON.stringify(this.selectedCar))},handleCurrentLocationClick(){this.$emit("segment",this.segment.onClickEvent("current_location_click"));let t=null;this.currentLocationFetching=!0,c.Ay.getCurrentPosition().then(e=>{t=e;const i=(0,n.ol)(e,this.countries.find(t=>"India"===t.name)?.cities);let s;i&&i.length&&(s=i[0]),this.fetchGeoAddress({coords:{lat:e.latitude,lng:e.longitude}}).then(e=>{if(e&&e[0]&&(this.inputOrigin=e[0]?.display_name,this.$store.commit("Search/setOrigin",{name:e[0]?.display_name,lat:t.latitude,lng:t.longitude}),this.userCityLinkName!==s?.link_name))if(this.$store.commit("App/setCountry",s.country),this.$store.commit("App/setCountryCode",s.countryCode),this.$store.commit("App/setCountryApiCode",s.countryApiCode),this.$store.commit("App/setCity",s.link_name),this.$store.commit("User/setUserCityLinkName",s.link_name),this.$store.commit("Search/setOriginCity",s.link_name),this.$store.commit("User/setCityData",s),this.$store.commit("App/setIsCitySelected",!0),this.$store.commit("App/setCityNotFound",!1),this.$store.commit("HomeNew/setCarSelectionToSearchFlow",!1),this.$store.commit("HomeNew/setAvailableDates",[]),this.$store.commit("HomeNew/clearSelectedCar"),this.isSearchflow){const e=JSON.parse(sessionStorage.getItem("route"));if("SearchPage"===e.name){const i={city_link:s.link_name,country_code:s.countryCode},a={...e?.query,lat:t.latitude,lng:t.longitude,delivery_type:this.isHDChecked?"home%2Cairport":""};this.$router.push({name:"SearchPage",query:a,params:i})}}else this.$router.replace({name:"HomePage",params:{country_code:s.countryCode,city_link:s.link_name}})})}).catch(()=>{}).finally(()=>{this.currentLocationFetching=!1}),this.showLocation=!1},getselectedProductLocation(t,e,i){const s=t?.find(t=>t.city_link_name===e);this.setCustomHomeProducts(this.homeProductsTabs);const a=s?.home_ingress?.find(t=>t?.type?.toLowerCase()===i?.toLowerCase());return"round_trip"==i&&(this.inputOrigin=a?.location.name,this.$store.commit("Search/setOrigin",{name:a?.location?.name,lat:a?.location?.lat,lng:a?.location?.lng})),a?.location},getCityInfo(){const t=this.countries.find(t=>"India"===t.name)?.cities?.find(t=>t.city_link_name===this.userCityLinkName);return t},setAndUpdateOrigin(t,e){this.$store.commit("Search/setOrigin",{name:t?.name,lat:t?.lat,lng:t?.lng}),this.$store.commit("Search/updateOrigin",e),this.$store.commit("Search/resetEndDateTime"),this.inputOrigin=this.origin.name},handleMapClick(){this.$router.push({name:"HomePage",params:{city_link:this.userCityLinkName,country_code:this.countryCode},query:{q:"address",loc:this.product,map:!0,search:this.isSearchflow}})},textTrim:t=>t&&t.length>30?t.slice(0,30)+"...":t,onFocus(){this.isFocused=!0,this.showLocation=!0},onBlur(){this.isFocused=!1,this.inputOrigin=this.origin.name},handleSlidePopupClose(){this.$store.commit("App/setAppPopupState",!1),this.showCitySelection=!1,this.showCalendar=!1,this.showLocation=!1},showCitySelectionPopup(){this.$store.commit("App/setAppPopupState",!0),this.filteredCities=this.countries.find(t=>"India"===t.name)?.cities,this.citySearch="",this.showCitySelection=!0,this.$emit("segment",this.segment.onClickEvent("change_city_click"))},showLocationSelectionPopup(){this.$store.commit("App/setAppPopupState",!0),this.showLocation=!0,this.$emit("segment",this.segment.onClickEvent("change_location_click"))},showDateSelectionPopup(){this.$store.commit("App/setAppPopupState",!0),this.showCalendar=!0,this.$emit("segment",this.segment.onClickEvent("change_date_click"))},filterCities(){let t=this.countries.find(t=>"India"===t.name)?.cities;this.filteredCities=t.filter(t=>t.city_link_name.toLowerCase().indexOf(this.citySearch?.toLowerCase())>-1)},switchToSubscription(){const t=new Date(this.starts),e=new Date(this.ends);e.setHours(t.getHours()),e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),this.$store.commit("Search/setDateTime",{point:"starts",date:t}),this.$store.commit("Search/setDateTime",{point:"ends",date:e}),this.setSubscription(!0),this.handleGetCarClick()},setCustomHomeProducts(t=[]){this.homeProducts=[...t,{title:"Bike Rentals",sub_title:"Meet Bikes by Zoomcar",type:"BIKE_RENTAL",new_tag:!0,min_duration:0,enabled:!0,default_start_time:0}]}},watch:{city(){this.fetchSuggested()},countries(){if(this.countries&&!this.origin.name||this.origin.name&&!this.origin.lat){const t=this.countries.find(t=>"India"===t.name)?.cities?.find(t=>t.city_link_name===this.city);this.setCustomHomeProducts(this.homeProductsTabs),this.inputOrigin=this.setAddressFromCoords({lat:t?.lat,lng:t?.lng})}},origin(){this.inputOrigin=this.origin.name},homeProductsTabs(t){this.setCustomHomeProducts(t)}}};var y=(0,i(14486).A)(g,function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",{staticClass:"home-mweb-search"},[e("header",{staticClass:"home-mweb-search__header"},[e("div",{staticClass:"home-mweb-search__header--left"},[e("button",{staticClass:"home-mweb-search__button--hamburger",attrs:{"aria-label":"Toggle Sidebar"},on:{click:function(e){return t.$emit("toggleSidebar")}}},[e("i",{staticClass:"z-hamburger",attrs:{"aria-hidden":"true"}})]),t._v(" "),t._m(0),t._v(" "),t.mapplsSession?[t._v("\n on\n "),e("img",{staticClass:"home-mweb-search__image--partner-logo",attrs:{src:"/img/mappls-logo.png",alt:"Zoomcar on Mappls"}})]:t._e()],2),t._v(" "),e("div",{staticClass:"home-mweb-search__header--right",on:{click:t.showCitySelectionPopup}},[e("i",{staticClass:"z-location",attrs:{"aria-hidden":"true"}}),t._v(" "),e("span",{staticClass:"home-mweb-search__text",attrs:{"aria-label":"Selected City"}},[t._v("\n "+t._s(t.city)+"\n ")]),t._v(" "),t._m(1)])]),t._v(" "),e("form",{staticClass:"home-mweb-search__form"},[e("div",{staticClass:"home-mweb-search__search-type"},t._l(t.homeProducts,function(i,s){return e("div",{key:s,class:["home-mweb-search__search-type--button",{active:s==t.activeProductIndex}],on:{click:function(e){return t.handleProductClick(i,s)}}},[e("div",{class:["home-mweb-search__search-type--button-heading",{"active-heading":s===t.activeProductIndex}]},[t._v("\n "+t._s(i.title.toLowerCase())+"\n "),i?.new_tag?e("div",{staticClass:"home-mweb-search__search-type--new-tag"},[t._v("\n New\n ")]):t._e()]),t._v(" "),e("div",{staticClass:"home-mweb-search__search-type--subtext"},[t._v("\n "+t._s(i.sub_title)+"\n ")])])}),0),t._v(" "),e("div",{staticClass:"home-mweb-search__main"},[e("span",{staticClass:"home-mweb-search__text--pretitle"},[t._v(t._s(t.preTitle))]),t._v(" "),"LandingPageNew"==t.$route.name?e("h1",{staticClass:"home-mweb-search__text--title",style:{marginTop:0}},[t._v("\n Book Self-Drive Car Rentals Across India\n ")]):e("h1",{staticClass:"home-mweb-search__text--title",style:t.isLongTitle?{fontSize:"14px"}:{}},[t._v(t._s(t.title))]),t._v(" "),e("div",{staticClass:"home-mweb-search__input-group",attrs:{"aria-label":"Change Selected location"},on:{click:t.showLocationSelectionPopup}},[e("i",{staticClass:"z-search",attrs:{"aria-hidden":"true"}}),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.inputOrigin,expression:"inputOrigin"}],staticClass:"home-mweb-search__input",attrs:{type:"text",placeholder:"Search for the car location","aria-label":"Selected location",readonly:""},domProps:{value:t.inputOrigin},on:{input:[function(e){e.target.composing||(t.inputOrigin=e.target.value)},t.handleLocationChange]}}),t._v(" "),e("button",{staticClass:"home-mweb-search__button--icon",attrs:{"aria-label":"Select Current Location"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.handleCurrentLocationClick.apply(null,arguments)}}},[e("i",{staticClass:"z-my_location",attrs:{"aria-hidden":"true"}})])]),t._v(" "),e("div",{staticClass:"home-mweb-search__dates-container",on:{click:t.showDateSelectionPopup}},[e("div",{staticClass:"home-mweb-search__date"},[e("label",{staticClass:"home-mweb-search__text--date-label"},[t._v(" Trip Starts ")]),t._v(" "),e("time",{staticClass:"home-mweb-search__text--date-value"},[t._v("\n "+t._s(t._f("formatDate")(t.starts,"d MMM'yy, h:mm aa"))+"\n ")])]),t._v(" "),e("div",{staticClass:"home-mweb-search__date"},[e("label",{staticClass:"home-mweb-search__text--date-label"},[t._v(" Trip Ends ")]),t._v(" "),e("time",{staticClass:"home-mweb-search__text--date-value"},[t._v("\n "+t._s(t._f("formatDate")(t.ends,"d MMM'yy, h:mm aa"))+"\n ")])])]),t._v(" "),e("div",{staticClass:"home-mweb-search__text--timezone-note"},[t._v("\n All times are shown in IST (UTC+5:30).\n ")]),t._v(" "),e("div",{staticClass:"home-mweb-search__hd-container"},[e("check-box",{attrs:{checked:!1}
1,on:{CheckboxClick:t.HDClicked}}),t._v(" "),e("div",{staticClass:"home-mweb-search__text--hd"},[t._v("\n Delivery & Pick-up, from anywhere\n ")])],1),t._v(" "),e("button",{staticClass:"home-mweb-search__button--submit",attrs:{type:"submit"},on:{click:function(e){return e.preventDefault(),t.handleGetCarClick.apply(null,arguments)}}},[t._v("\n Search Cars\n ")])])]),t._v(" "),e("calendar-popup",{attrs:{showCalendar:t.showCalendar,autoSwitch:!0,isWeekdayCalendar:t.isWeekdayCalendar},on:{update:t.handleDateUpdate,submit:t.handleDateSubmit,close:function(e){t.showCalendar=!1}}}),t._v(" "),e("subscription-popup",{attrs:{showPopup:t.showSubscriptionPopup},on:{close:function(e){t.showSubscriptionPopup=!1},ctaClick:function(e){return t.switchToSubscription()}}}),t._v(" "),e("SlidePopUp",{staticClass:"home-mweb-search__popup",attrs:{isCustomLayout:!0,showPopUp:t.showLocation||t.showCitySelection,showTopBorder:!1},on:{modalClosed:t.handleSlidePopupClose}},[t.showLocation?e("section",{staticClass:"home-mweb-search__popup-content"},[e("div",{staticClass:"home-mweb-search__input-group"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.inputOrigin,expression:"inputOrigin"}],staticClass:"home-mweb-search__input",attrs:{type:"text",placeholder:"Search for the car location","aria-label":"Search location"},domProps:{value:t.inputOrigin},on:{input:[function(e){e.target.composing||(t.inputOrigin=e.target.value)},t.handleLocationChange],focus:t.onFocus,blur:t.onBlur}}),t._v(" "),e("i",{staticClass:"z-search",attrs:{"aria-hidden":"true"}})]),t._v(" "),e("button",{staticClass:"home-mweb-search__button--current-location",on:{click:t.handleCurrentLocationClick}},[e("i",{staticClass:"z-my_location"}),t._v(" "),e("p",{staticClass:"home-mweb-search__text--current-location"},[t._v("\n "+t._s(t.currentLocationFetching?"Fetching location...":"Current Location")+"\n ")])]),t._v(" "),t.searchedPlaces.length?t._e():e("location-list",{attrs:{list:t.suggested.suggested_pickup_locations,title:"Suggested Locations"},on:{update:t.handleLocationSelect}}),t._v(" "),t.searchedPlaces.length?t._e():e("location-list",{attrs:{list:t.recentPlacesList,title:"Recently searched locations"},on:{update:t.handleLocationSelect}}),t._v(" "),e("location-list",{attrs:{list:t.searchedPlaces,title:"Search Results"},on:{update:t.handleLocationSelect}})],1):t._e(),t._v(" "),t.countries&&t.showCitySelection?e("section",{staticClass:"home-mweb-search__popup-content"},[e("span",{staticClass:"home-mweb-search__text--city-search"},[t._v("Select City")]),t._v(" "),e("div",{staticClass:"home-mweb-search__input-group"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.citySearch,expression:"citySearch"}],staticClass:"home-mweb-search__input",attrs:{type:"text",placeholder:"Search ","aria-label":"Search City"},domProps:{value:t.citySearch},on:{input:[function(e){e.target.composing||(t.citySearch=e.target.value)},t.filterCities]}}),t._v(" "),e("i",{staticClass:"z-search",attrs:{"aria-hidden":"true"}})]),t._v(" "),e("section",{staticClass:"home-mweb-search__city-results"},t._l(t.filteredCities,function(i){return e("button",{key:i.id,class:{"home-mweb-search__button--city-item":!0,"home-mweb-search__button--city-item-selected":t.city==i.link_name},on:{click:function(e){return t.handleCityClick(t.country[0].name,i.link_name,i.name,t.country[0].iso_alpha_3,i)}}},[t._v("\n "+t._s(i.name||"bangalore")+"\n ")])}),0)]):t._e()])],1)},[function(){var t=this._self._c;this._self._setupProxy;return t("a",{attrs:{"aria-label":"Zoomcar Logo",href:"/"}},[t("img",{staticClass:"home-mweb-search__image--logo",attrs:{src:"/img/zoomcar-logo-new.png",alt:"Zoomcar Logo"}})])},function(){var t=this._self._c;this._self._setupProxy;return t("button",{staticClass:"home-mweb-search__button--icon",attrs:{"aria-label":"Change City"}},[t("i",{staticClass:"z-chevron_down",attrs:{"aria-hidden":"true"}})])}],!1,null,null,null);const S=y.exports}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.