(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{z4V5:function(e,t,o){"use strict";o.d(t,"a",(function(){return l}));var r=o("o3x0"),a=o("gIcY"),i=o("kHqD"),s=o("AytR"),n=o("BjKo"),l=function(){function e(e,t,o){this.hotelStateService=e,this.generalStateService=t,this.fb=o}return Object.defineProperty(e.prototype,"ContatctInfoFormGroup",{get:function(){return this.hotelStateService.HotelTravelItineraryFormGrp.get("ContactInfo")},enumerable:!0,configurable:!0}),e.prototype.createHotelTravelItineraryFormGroup=function(){var e=this;this.hotelStateService.HotelTravelItineraryFormGrp=this.fb.group(s.a.projectName==n.a.B2C?i.a.INDIA==s.a.AKBTTheme?{TUI:[this.hotelStateService.TUI],ServiceEnquiry:"",ContactInfo:this.fb.group({Title:"",FName:"",LName:"",Mobile:["",a.B.required],Phone:"",Email:["",a.B.compose([a.B.required,a.B.email,a.B.pattern("^[a-zA-Z0-9._%+-]{1,}@[a-zA-Z0-9.-]{1,}[.]{1}[a-zA-Z]{2,}$")])],Address:"",State:"",City:"",PIN:"",GSTCompanyName:"",GSTTIN:"",GSTMobile:"",GSTEmail:"",UpdateProfile:!1,IsGuest:!1,CountryCode:"IN",MobileCountryCode:["+91",a.B.compose([a.B.required,a.B.minLength(1),a.B.maxLength(4)])],NetAmount:""}),Auxiliaries:this.fb.array([this.fb.group({Code:"PROMO",Parameters:this.fb.array([this.fb.group({Type:"Code",Value:""}),this.fb.group({Type:"ID",Value:""}),this.fb.group({Type:"Amount",Value:""})])})]),Rooms:this.fb.group({Room:this.fb.array([this.fb.group({RoomId:"",RoomGroupId:"",Code:"",GuestCode:"",SupplierName:"",Guests:this.fb.array([this.fb.group({GuestID:"",Operation:"",Title:"",FirstName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MiddleName:"",LastName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MobileNo:"",PaxType:"",Age:"",Email:"",Pan:""})])})])})}:i.a.QATAR==s.a.AKBTTheme?{TUI:[this.hotelStateService.TUI],ServiceEnquiry:"",ContactInfo:this.fb.group({Title:"",FName:"",LName:"",Mobile:["",a.B.required],Phone:"",Email:["",a.B.compose([a.B.required,a.B.pattern("^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$")])],Address:"",State:"",City:"",PIN:"",GSTCompanyName:"",GSTTIN:"",GSTMobile:"",GSTEmail:"",UpdateProfile:!1,IsGuest:!1,CountryCode:"QAR",MobileCountryCode:["+974",a.B.compose([a.B.required,a.B.minLength(1),a.B.maxLength(4)])],NetAmount:""}),Auxiliaries:this.fb.array([this.fb.group({Code:"PROMO",Parameters:this.fb.array([this.fb.group({Type:"Code",Value:""}),this.fb.group({Type:"ID",Value:""}),this.fb.group({Type:"Amount",Value:""})])})]),Rooms:this.fb.group({Room:this.fb.array([this.fb.group({RoomId:"",RoomGroupId:"",Code:"",GuestCode:"",SupplierName:"",Guests:this.fb.array([this.fb.group({GuestID:"",Operation:"",Title:"",FirstName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MiddleName:"",LastName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MobileNo:"",PaxType:"",Age:"",Email:"",Pan:""})])})])})}:{TUI:[this.hotelStateService.TUI],ServiceEnquiry:"",ContactInfo:this.fb.group({Title:"",FName:"",LName:"",Mobile:["",a.B.required],Phone:"",Email:["",a.B.compose([a.B.required,a.B.pattern("^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$")])],Address:"",State:"",City:"",PIN:"",GSTCompanyName:"",GSTTIN:"",GSTMobile:"",GSTEmail:"",UpdateProfile:!1,IsGuest:!1,CountryCode:"UAE",MobileCountryCode:["+971",a.B.compose([a.B.required,a.B.minLength(1),a.B.maxLength(4)])],NetAmount:""}),Auxiliaries:this.fb.array([this.fb.group({Code:"PROMO",Parameters:this.fb.array([this.fb.group({Type:"Code",Value:""}),this.fb.group({Type:"ID",Value:""}),this.fb.group({Type:"Amount",Value:""})])})]),Rooms:this.fb.group({Room:this.fb.array([this.fb.group({RoomId:"",RoomGroupId:"",Code:"",GuestCode:"",SupplierName:"",Guests:this.fb.array([this.fb.group({GuestID:"",Operation:"",Title:"",FirstName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MiddleName:"",LastName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MobileNo:"",PaxType:"",Age:"",Email:"",Pan:""})])})])})}:i.a.GULF!=s.a.AKBTTheme?{TUI:[this.hotelStateService.TUI],ServiceEnquiry:"",ContactInfo:this.fb.group({Title:"",FName:"",LName:"",Mobile:["",a.B.compose([a.B.required,a.B.minLength(9),a.B.maxLength(12)])],Phone:"",Email:["",a.B.compose([a.B.required,a.B.email])],Address:"",State:"",City:"",PIN:"",GSTCompanyName:"",GSTTIN:"",GSTMobile:"",GSTEmail:"",UpdateProfile:!1,IsGuest:!1,CountryCode:"IN",MobileCountryCode:["+91",a.B.compose([a.B.required,a.B.minLength(1),a.B.maxLength(4)])],NetAmount:""}),Auxiliaries:this.fb.array([this.fb.group({Code:"PROMO",Parameters:this.fb.array([this.fb.group({Type:"Code",Value:""}),this.fb.group({Type:"ID",Value:""}),this.fb.group({Type:"Amount",Value:""})])})]),Rooms:this.fb.group({Room:this.fb.array([this.fb.group({RoomId:"",RoomGroupId:"",Code:"",GuestCode:"",SupplierName:"",Guests:this.fb.array([this.fb.group({GuestID:"",Operation:"",Title:"",FirstName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MiddleName:"",LastName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MobileNo:"",PaxType:"",Age:"",Email:"",Pan:""})])})])})}:{TUI:[this.hotelStateService.TUI],ServiceEnquiry:"",ContactInfo:this.fb.group({Title:"",FName:"",LName:"",Mobile:["",a.B.compose([a.B.required,a.B.pattern("^(?:971|[1-9] ?){7,10}[0-9]$")])],Phone:"",Email:["",a.B.compose([a.B.required,a.B.pattern("^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$")])],Address:"",State:"",City:"",PIN:"",GSTCompanyName:"",GSTTIN:"",GSTMobile:"",GSTEmail:"",UpdateProfile:!1,IsGuest:!1,CountryCode:"UAE",MobileCountryCode:["+971",a.B.compose([a.B.required,a.B.minLength(1),a.B.maxLength(4)])],NetAmount:""}),Auxiliaries:this.fb.array([this.fb.group({Code:"PROMO",Parameters:this.fb.array([this.fb.group({Type:"Code",Value:""}),this.fb.group({Type:"ID",Value:""}),this.fb.group({Type:"Amount",Value:""})])})]),Rooms:this.fb.group({Room:this.fb.array([this.fb.group({RoomId:"",RoomGroupId:"",Code:"",GuestCode:"",SupplierName:"",Guests:this.fb.array([this.fb.group({GuestID:"",Operation:"",Title:"",FirstName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MiddleName:"",LastName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MobileNo:"",PaxType:"",Age:"",Email:"",Pan:""})])})])})}),this.hotelStateService.HotelTravelItineraryFormGrp.removeControl("Rooms"),this.hotelStateService.HotelTravelItineraryFormGrp.get("Rooms")||this.hotelStateService.HotelTravelItineraryFormGrp.addControl("Rooms",new a.e([])),this.hotelStateService.HotelReviewDetails&&this.hotelStateService.HotelReviewDetails.hotelRoomReccomendations&&this.hotelStateService.HotelReviewDetails.hotelRoomReccomendations.length>0&&this.hotelStateService.HotelReviewDetails.hotelRoomReccomendations.forEach((function(t){t.roomsDetails&&t.roomsDetails.room.length>0&&t.roomsDetails.room.forEach((function(t,o){var r=e.fb.group({RoomId:t.roomId,GuestCode:t.guestCode,SupplierName:t.supplierName,RoomGroupId:t.roomTypeID});if(r.addControl("Guests",new a.e([])),1==t.allGuestsInfoRequired){for(var n=0;n<t.numOfAdults;n++)0!==n||0!==o||e.hotelStateService.noPanCard||i.a.INDIA!=s.a.AKBTTheme?r.get("Guests").push(e.createTravellersFormGroup("A","","")):r.get("Guests").push(e.createTravellersFormGroup("A","","pan"));for(var l=0;l<t.numOfChildren;l++)r.get("Guests").push(e.createTravellersFormGroup("C",t.childAgeArray[l],""))}else 0!=o||e.hotelStateService.noPanCard||i.a.INDIA!=s.a.AKBTTheme?r.get("Guests").push(e.createTravellersFormGroup("A","","")):r.get("Guests").push(e.createTravellersFormGroup("A","","pan"));e.hotelStateService.HotelTravelItineraryFormGrp.get("Rooms").push(r)}))}))},e.prototype.createTravellersFormGroup=function(e,t,o){return this.fb.group("A"===e&&"pan"===o?{GuestID:"0",Operation:"",Title:["",a.B.required],FirstName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MiddleName:"",LastName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MobileNo:[""],PaxType:e,Age:t,Email:"",Pan:["",[a.B.required,a.B.pattern("^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$")]]}:{GuestID:"0",Operation:"",Title:["",a.B.required],FirstName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MiddleName:"",LastName:["",[a.B.required,a.B.pattern("^([A-Z a-z]){2,}")]],MobileNo:[""],PaxType:e,Age:t,Email:"",Pan:""})},e.prototype.createRegisterGuestRequest=function(){var e={};e.ClientID=this.generalStateService.ClientID,e.IsGuest=!0;var t=JSON.parse(JSON.stringify(this.hotelStateService.HotelTravelItineraryFormGrp.value)),o=this.hotelStateService.HotelTravelItineraryFormGrp.get("ContactInfo"),r={};r.Email=this.generalStateService.ClientIDDecrypted,r.Mobile=o.controls.Mobile.value,r.FName=t.Rooms[0].Guests[0].FirstName,r.LName=t.Rooms[0].Guests[0].LastName,r.Title=t.Rooms[0].Guests[0].Title,e.Profile=r;var a={};return a.Email=this.generalStateService.ClientIDDecrypted,a.Phone=o.controls.Mobile.value,e.Contacts=a,e.Notification="",e},e.prototype.contactInfoValidation=function(){var e=this.hotelStateService.HotelTravelItineraryFormGrp.get("ContactInfo");1==this.generalStateService.GuestStatus&&""==e.controls.Mobile.value&&(e.controls.Mobile.setErrors({required:!0}),e.controls.Mobile.markAsTouched())},e.prototype.setFareChangeDialogData=function(e,t){var o=new r.g;return o.width="500px",o.data={response:e,amount:t},o},e.prototype.createTravelItineraryRequest=function(e,t){var o=JSON.parse(JSON.stringify(this.hotelStateService.HotelTravelItineraryFormGrp.value));return o.TUI=t,o.NetAmount=this.hotelStateService.NetAmount.toString(),o.ClientID=this.generalStateService.ClientID,o.DeviceID="",o.AppVersion="",o.SearchId=e,o.RecommendationId=this.hotelStateService.HotelReviewDetails.hotelRoomReccomendations[0].reccomendationsId,o.LocationName=this.hotelStateService.HotelReviewDetails.hotelSummary.locationName,o.HotelCode=this.hotelStateService.HotelReviewDetails.hotelSummary.hotelCode,o.CheckInDate=this.hotelStateService.SearchRequestFormGroup.get("checkIn").value,o.CheckOutDate=this.hotelStateService.SearchRequestFormGroup.get("checkOut").value,this.generalStateService.GuestStatus&&(o.ContactInfo.Email=this.generalStateService.ClientIDDecrypted,o.ContactInfo.IsGuest=!0,o.ContactInfo.UpdateProfile=!0),this.generalStateService.UserDetails&&(o.ContactInfo.FName=this.generalStateService.UserDetails.Fname,o.ContactInfo.LName=this.generalStateService.UserDetails.Lname,o.ContactInfo.Phone=this.generalStateService.UserDetails.MobNumber,o.ContactInfo.Title=this.generalStateService.UserDetails.Title),o.ContactInfo.Address="AKBAR ONLINE BOOKING COMPANY PVT LTD",o.ContactInfo.State="Maharashtra",o.ContactInfo.City="Near Crawford market Mumbai",o.ContactInfo.PIN="400003",this.generalStateService.LoginStatus?(o.ContactInfo.IsGuest=!1,o.ContactInfo.UpdateProfile=!0):(o.ContactInfo.IsGuest=!0,o.ContactInfo.UpdateProfile=!1),1==this.hotelStateService.SaveTravellers&&o.Rooms[0].Guests.forEach((function(e){e.Operation="0"==e.GuestID?"I":"U"})),o.TravelingFor="WRK"===this.hotelStateService.travellingFor?"Work":"LSR"===this.hotelStateService.travellingFor?"Leisure":this.hotelStateService.travellingFor,o.ContactInfo.Mobile=o.ContactInfo.Mobile,o.ContactInfo.Mobile=o.ContactInfo.Mobile.replace("+",""),o},e.prototype.createAgentAddon=function(e,t){var o={};return o.tui=e,o.transactionId=t,o.service="HTL",o.operation="B",o.markUp=this.hotelStateService.HotelReviewDetails.hotelRoomReccomendations[0].markup,o.discount=0,o},e.prototype.createhotelReviewRequest=function(e,t,o,r,a){try{var i={};return i.HotelCode=t,i.RecommendationId=e,i.SearchId=r,i.SearchTracingKey=a,i.PriceProvider=o,i}catch(s){}},e.prototype.createhotelReviewContentRequest=function(e,t,o,r){try{var a={};return a.hotelId=e,a.providerName=t,a.searchId=o,a.searchTracingKey=r,a}catch(i){}},e.prototype.removeGSTDateValidation=function(){this.ContatctInfoFormGroup.controls.GSTCompanyName.setErrors(null),this.ContatctInfoFormGroup.controls.GSTTIN.setErrors(null)},e.prototype.GSTDataValidation=function(){""==this.ContatctInfoFormGroup.controls.GSTCompanyName.value||""==this.ContatctInfoFormGroup.controls.GSTTIN.value?(""==this.ContatctInfoFormGroup.controls.GSTCompanyName.value&&(this.ContatctInfoFormGroup.controls.GSTCompanyName.setErrors({required:!0}),this.ContatctInfoFormGroup.controls.GSTCompanyName.markAsTouched()),""==this.ContatctInfoFormGroup.controls.GSTTIN.value&&(this.ContatctInfoFormGroup.controls.GSTTIN.setErrors({required:!0}),this.ContatctInfoFormGroup.controls.GSTTIN.markAsTouched())):(this.ContatctInfoFormGroup.controls.GSTCompanyName.setErrors(null),this.ContatctInfoFormGroup.controls.GSTTIN.setErrors(null))},e.prototype.createhotelPromoRequest=function(e,t,o,r){var a,i=JSON.parse("undefined"!=typeof sessionStorage&&sessionStorage.getItem("SEARCHFORMGROUP"));a="IN"==i.country?"D":"IN"!=i.country?"I":"";var s={};s.ClientID=this.generalStateService.ClientID,s.TUI=this.generalStateService.TUI,s.ServiceType="HTL",s.Parameters={},s.Parameters.CheckInDate=e.toString(),s.Parameters.CheckOutDate=e.toString();var n=0;return s.Parameters.GrossAmount=((n=o.totalFare+o.totalTax-o.totalDiscount)+o.totalDiscount).toString(),s.Parameters.NetAmount=n.toString(),s.Parameters.BaseFare=o.totalFare.toString(),s.Parameters.DefaultPromoAmt=o.totalDiscount,s.Parameters.SectorType=a,s.Parameters.DefaultPromo=null!=this.hotelStateService.HotelPricingResponse.roomGroup[0].otherRateComponents&&null!=this.hotelStateService.HotelPricingResponse.roomGroup[0].otherRateComponents&&this.hotelStateService.HotelPricingResponse.roomGroup[0].otherRateComponents.some((function(e){return"PromoCode"==e.type})),s},e}()}}]);