"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4215],{75889:function(e,t,l){var n=l(85893);l(67294);var s=l(45373);t.Z=e=>{let{onClose:t,children:l}=e;return(0,n.jsxs)("div",{className:"fixed z-[999] top-0 left-0 w-full h-full bg-black",children:[(0,n.jsx)("button",{onClick:t,type:"button",className:"w-9 h-9 sm:h-11 sm:w-11 z-[999] absolute top-6 left-6 inline-flex justify-center bg-transparent p-0 text-sm font-semibold text-white shadow-sm hover:secondaryGrey focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600",children:(0,n.jsx)(s.GN,{className:"text-white w-5 h-5 sm:w-6 sm:h-6",icon:s.cb})}),l]})}},55838:function(e,t,l){var n=l(85893),s=l(67294),i=l(34426),a=l(75889),o=l(58723),r=l(70457),c=l(30719);l(74614);var d=l(45373),u=l(86812),m=l(59151);t.Z=e=>{let{images:t,open:l,handleClose:x,selectedImageIndex:h}=e,[p,f]=(0,i.n6)(h),v=(0,s.useRef)(null),g=1===t.length,j=t.length;return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(r.P,{open:l,modalName:"fullscreen-swiper",onClose:x,children:(0,n.jsx)(a.Z,{onClose:x,children:g?(0,n.jsx)("div",{className:"w-full h-full flex justify-center items-center",children:t.map((e,t)=>(0,n.jsx)(o.Z,{priority:!0,image:e,size:{default:100},className:"max-w-max h-full w-full object-contain"},t))}):(0,n.jsxs)(c.tq,{ref:v,slidesPerView:"auto",spaceBetween:8,centeredSlides:!0,loop:!0,initialSlide:h,onSlideChange:e=>{f(e.realIndex)},onSwiper:()=>{f(h)},style:{width:"100%",height:"100%"},children:[(0,n.jsx)(u.Z,{icon:d.ac,onClick:()=>{var e;null===(e=v.current)||void 0===e||e.swiper.slidePrev()},className:"rounded-none absolute top-[50%] ltr:left-[46px] rtl:right-[46px] ltr:-translate-x-[50%] rtl:translate-x-[50%] -translate-y-[50%] hidden sm:flex"}),t.map((e,t)=>(0,n.jsx)(c.o5,{style:{display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center"},children:(0,n.jsx)("div",{className:"w-full h-full max-w-max",children:(0,n.jsx)(o.Z,{priority:0===t,image:e,size:{default:100},className:"max-w-max h-full w-full object-contain"})})},"".concat(e.id,"-").concat(t))),(0,n.jsx)(u.Z,{icon:d.eF,onClick:()=>{var e;null===(e=v.current)||void 0===e||e.swiper.slideNext()},className:"rounded-none absolute top-[50%] ltr:right-[46px] rtl:left-[46px] ltr:translate-x-[50%] rtl:-translate-x-[50%] -translate-y-[50%] hidden sm:flex"}),(0,n.jsxs)("div",{className:"absolute flex items-center gap-2 bottom-6 left-6 z-[5] px-2 py-1 bg-light",children:[(0,n.jsx)(d.GN,{icon:d.fS,size:"lg",className:"text-primary"}),(0,n.jsxs)("p",{className:m.XP,children:[p+1,"/",j]})]})]})})})})}},577:function(e,t,l){l.d(t,{ZP:function(){return N},Q5:function(){return v},QO:function(){return b},OE:function(){return f},AV:function(){return g},Fx:function(){return j}});var n=l(85893),s=l(67294),i=l(11163),a=l(34426),o=l(57491),r=l(54682),c=l(14690),d=l(89608),u=l(58181),m=l(17113),x=l(68169),h=e=>{let[t,l]=(0,a.n6)(null);(0,a.Ng)(()=>{(async()=>{let t=await (0,x.o2)(e);l(t)})()},[]);let n=(()=>{if((null==t?void 0:t.days)&&t.days.length>1){let e=t.days.slice(1),l=e.reduce((e,t)=>t.price.amount<e.price.amount?t:e);return l.date}return null})(),s=n?(0,m.yf)(n):null,i=s?(0,m.ng)([s]):null,o=i?(0,m.hI)(i):null;return{lowestPriceDateObject:i,lowestPriceDate:o}};let p=(0,s.createContext)(null),f=()=>{let e=(0,s.useContext)(p);return e?{dates:e.dates,guests:e.guests,roomPlan:e.roomId&&e.planRateCode?{roomId:e.roomId,rateCode:e.planRateCode}:void 0}:null},v=()=>{let e=(0,s.useContext)(p);return e?e.dates:(0,m.c0)()},g=()=>{let{tHotels:e}=(0,r.EI)(),t=(0,s.useContext)(p),l=(0,i.useRouter)(),n=v(),a=b();if(!t)return{performAction:()=>{},comparePrices:()=>{},selectRoomPlan:()=>{},handleNextAction:()=>{},cartActionButton:e("checkAvailability")};let c=(e,n,s,i)=>{(0,u.b)(l,e,{guests:s,dates:n,destinationId:{id:t.hotelData.id,destinationType:o.NM.Hotel},roomPlan:i},{scrollToTop:!1})};return{performAction:(e,l)=>{t.availabilityMode?t.selectedPlan&&(0,r.LZ)(n,e)&&(0,r.yV)(a,l)?c(o.Gx.RoomBook,e,l,{roomId:t.selectedPlan.room.room.id,rateCode:t.selectedPlan.plan.rateCode}):c(o.Gx.HotelListingUpdateDates,e,l):c(o.Gx.HotelListingCheckAvailability,e,l)},comparePrices:(e,t)=>{c(o.Gx.RoomComparePrice,n,a,{roomId:e.room.id,rateCode:t.rateCode})},selectRoomPlan:(e,l)=>{t.setSelectedPlan({room:e,plan:l})},handleNextAction:c,cartActionButton:(()=>{if(t.availabilityMode){let e=t.selectedPlan;if(e)return"Reserve"}return e("checkAvailability")})(),customReserveAction:t.customReserveAction}},j=()=>{let e=(0,s.useContext)(p);return(null==e?void 0:e.availabilityMode)&&e.selectedPlan||null},b=()=>{let e=(0,s.useContext)(p);return e?e.guests:c.gq};var N=e=>{var t,l;let{children:i,availabilityRequest:o,hotelData:r,customReserveAction:u}=e,x=(0,a.f6)(d.As),[f,v]=(0,s.useState)(o?o.searchRequest:(0,d.Oc)(x)),[g,j]=(0,s.useState)(void 0),b=h(o?void 0:r.id);(0,a.Ng)(()=>{let e=(0,d.Oc)(x);console.log("Request",e),v(e),j(void 0)},[x]);let N={dates:(null==f?void 0:f.dates)||(null==b?void 0:b.lowestPriceDate)||(0,m.c0)(),guests:(null==f?void 0:f.guests)||c.gq,availabilityMode:!!o,roomId:null===(t=f.roomPlan)||void 0===t?void 0:t.roomId,planRateCode:null===(l=f.roomPlan)||void 0===l?void 0:l.rateCode,selectedPlan:g,setSelectedPlan:j,hotelData:r,customReserveAction:u};return(0,n.jsx)(p.Provider,{value:N,children:i})}},56671:function(e,t,l){l.d(t,{F:function(){return a},p:function(){return o}});var n=l(85893),s=l(67294);let i=(0,s.createContext)({}),a=()=>(0,s.useContext)(i),o=e=>(0,n.jsx)(i.Provider,{value:e,children:e.children})},7934:function(e,t,l){l.d(t,{I:function(){return A},Y:function(){return I}});var n=l(85893),s=l(67294),i=l(34426),a=l(58759),o=l(14452),r=l(75586),c=l(58723),d=l(51385),u=l(54682),m=l(14690),x=l(577),h=e=>{var t,l;let{cssProps:s}=e,o=(0,x.Fx)(),{tTravel:r}=(0,m.LF)(),h=(0,d.G)();if(!(null==o?void 0:o.plan))return(0,n.jsx)(n.Fragment,{});let p=null===(t=o.room.roomRate)||void 0===t?void 0:t.cancellationOptions.filter(e=>e.eligiblePlans[0]===o.plan.id)[0],f=null===(l=o.room.roomRate)||void 0===l?void 0:l.mealTypeOptions.filter(e=>e.eligiblePlans[0]===o.plan.id)[0],v=(0,a.lb)(h,o.plan.pricing.netPrice,a.hE.WithCents),g=(0,a.lb)(h,o.plan.pricing.netPrice,a.hE.WithCents),j=(0,a.lb)(h,{amount:o.plan.pricing.netPrice.amount+o.plan.pricing.excludedPrice.amount,currency:o.plan.pricing.netPrice.currency},a.hE.WithCents);return(0,n.jsxs)("div",{className:s,children:[(0,n.jsxs)("div",{className:"flex flex-col gap-2 pb-4",children:[(0,n.jsx)("p",{className:"".concat(a.l_),children:o.room.room.title}),(0,n.jsx)("div",{className:"flex flex-col gap-1",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[o.room.room.photos.length>0&&(0,n.jsx)(c.Z,{image:o.room.room.photos[0],size:{default:5},style:{height:50,width:50,objectFit:"cover",position:"relative",borderRadius:4}}),(0,n.jsxs)("div",{children:[(0,n.jsx)(u.PH,{beds:o.room.room.beds}),(0,n.jsx)("p",{className:a.XP,children:null==p?void 0:p.optionTitle}),(0,n.jsx)("p",{className:a.XP,children:null==f?void 0:f.optionTitle})]})]})})]}),(0,n.jsx)("hr",{className:(0,i.AK)(a.qE,"-mx-8")}),(0,n.jsxs)("div",{className:"grid gap-6 py-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("p",{className:a.YI,children:((e,t)=>{let l=t/e;return"".concat(l.toFixed(0)," ").concat(l>1?"rooms":"room")})(o.plan.perRoomPricing.netPrice.amount,o.plan.pricing.netPrice.amount)}),(0,n.jsx)("p",{className:a.XP,children:v})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("p",{className:a.YI,children:r("priceBreakdownTaxesAndFees")}),(0,n.jsx)("p",{className:a.XP,children:g})]})]}),(0,n.jsx)("hr",{className:a.qE}),(0,n.jsxs)("div",{className:"flex items-center justify-between pt-4",children:[(0,n.jsx)("p",{className:a.Nm,children:r("priceBreakdownTotal")}),(0,n.jsx)("p",{className:a.ht,children:j})]})]})},p=l(70457),f=l(76145),v=l(57491),g=l(66154),j=l(17113),b=l(74986),N=l(11163),y=l(56671),P=l(47475),C=e=>{let{open:t,onClose:l,hotelListing:s}=e,c=(0,N.useRouter)(),{tHotels:d}=(0,f.EI)(),u=(0,x.Q5)(),C=(0,x.QO)(),w=(0,y.F)(),A=s||w.hotelData,[I,R]=(0,i.n6)(C),[k,D]=(0,g.X)((0,j.Uj)(u)),Z=(0,b.LZ)((0,j.hI)(k),u)&&(0,b.yV)(I,C),F=P.Z2.noHotelSearch?v.Gx.HotelCheckoutCheckAvailability:v.Gx.HotelListingCheckAvailability;(0,i.Ng)(()=>{D((0,j.Uj)(u))},[u]),(0,i.Ng)(()=>{R(C)},[C]);let G=e=>{R(e)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(p.P,{open:t,onClose:l,modalName:"availability",className:"h-max m-auto max-h-[calc(100%_-_2_*_1.5rem)] max-w-[450px] w-[95%] md:max-w-[550px]",headerClassName:"flex gap-4 items-center",headerComponent:(0,n.jsx)("p",{className:"".concat(a.l_),children:d("chooseDatesToViewPrices")}),children:(0,n.jsxs)("form",{onSubmit:e=>{null==e||e.preventDefault();let t=(0,j.hI)(k);t&&(l(),(0,m.b)(c,F,{dates:t,guests:I,destinationId:A?{id:A.id,destinationType:v.NM.Hotel}:void 0},{scrollToTop:!1}))},className:"pt-[72px] pb-[88px] overflow-auto",children:[(0,n.jsx)("div",{className:"h-full",children:(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-2",children:[(0,n.jsx)(o.Z,{searchDate:k,handleSearchDate:e=>{D(e)},numberOfMonths:2}),(0,n.jsx)(r.Z,{searchGuests:I,handleChangeData:G,initialValue:I,onDetailsChange:G})]})}),Z&&(0,n.jsx)(h,{cssProps:"px-8 pb-6"}),(0,n.jsx)("div",{className:"flex items-center fixed bottom-0 left-0 right-0 z-[10] bg-white gap-4 p-4 border-t border-t-secondaryGrey rounded-bl-[10px] rounded-br-[10px]",children:(0,n.jsx)(a.wm,{type:"submit",className:"w-full",children:d("checkAvailability")})})]})})})};let w=(0,s.createContext)(null),A=e=>{let{children:t,initialOpen:l=!1,hotelData:s}=e,[a,o]=(0,i.n6)(!1),r=()=>o(!0),c=()=>o(!1);return(0,i.Ng)(()=>{l&&r()},[l]),(0,n.jsxs)(w.Provider,{value:{isOpen:a,open:r,close:c},children:[t,a&&(0,n.jsx)(C,{open:a,onClose:c,hotelListing:s})]})},I=()=>{let e=(0,s.useContext)(w);return e||console.error("useModalChooseDates must be used within a ModalChooseDatesProvider"),e}}}]);