1"use strict";(self.webpackChunklanding_page=self.webpackChunklanding_page||[]).push([[2308],{4561:(e,o,i)=>{i.d(o,{A:()=>se});var l=i(9379),n=i(446),d=i.n(n),t=i(5043),r=i(182),a=i(4117),s=i(8601),u=i(1577),v=i(2582),c=i(8222),m=i.n(c),h=i(2457),p=i(6851),f=i(6585),g=i(7574),x=i(8984),_=i(4849),y=i(5989),b=i(7821),j=i(5346),C=i(8532),N=i(8780),A=i(7368),S=i(3804);const I=function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{threshold:i=.5,triggerOnce:l=!0,enabled:n=!0}=o,d=(0,t.useRef)(null),[r,a]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{if(!n||!d.current||l&&r)return;if(!e||!e.content_ids||0===e.content_ids.length)return;const o=new IntersectionObserver(o=>{let[i]=o;if(i.isIntersecting&&(!l||!r))try{(0,j.newFBEvents)("ViewContent",e),l&&a(!0)}catch(n){console.error("Error tracking ViewContent:",n)}},{threshold:i,rootMargin:"0px"});return o.observe(d.current),()=>{o&&o.disconnect()}},[e,i,l,r,n]),d};var k=i(7343),w=i(1525),D=i.n(w),P=i(3976),R=i(7155),M=(i(5493),i(475)),E=i(579);const O=(0,r.Ay)(()=>Promise.all([i.e(3196),i.e(5349)]).then(i.bind(i,3196))),T=()=>(0,E.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,E.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,E.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),Y=()=>(0,E.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,E.jsx)("path",{d:"M21.41 11.58l-9-9A2 2 0 0 0 11 2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 .59 1.42l9 9A2 2 0 0 0 13 22a2 2 0 0 0 1.41-.59l7-7A2 2 0 0 0 21.41 11.58zM7 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"})}),B=e=>{let{isRatePlan:o,getMembershipDetails:i,getSecretMemberDealUrl:l,applyPromotion:n,promotionRes:d,price:r}=e;const[a,u]=(0,t.useState)({isOpen:!1}),v="true"===sessionStorage.getItem("isMembershipUnlocked"),[c,m]=(0,t.useState)(!1),[h,p]=(0,t.useState)({name:"Member-Only Rate",description:"Unlock and reveal the best price for your stay."}),[f,g]=(0,t.useState)(null),{hotelData:_}=(0,s.d4)(e=>e.hotelInfo),y=(0,s.wA)(),{id:b}=_;(0,t.useEffect)(()=>{if(200===(null===d||void 0===d?void 0:d.status)){var e;const o=(null===d||void 0===d||null===(e=d.data)||void 0===e?void 0:e.filter(N.UT))||[],n=o.find(e=>!(0,N.qB)(e))||o[0];if(n){if(p({name:(null===n||void 0===n?void 0:n.name)||"Member-Only Rate",description:(null===n||void 0===n?void 0:n.description)||"
1Unlock and reveal the best price for your stay."}),g(n),m(!0),i(null===n||void 0===n?void 0:n.name,null===n||void 0===n?void 0:n.description),v){const e=l();y((0,x.PR)(e,b))}}else m(!1),v&&sessionStorage.setItem("isMembershipUnlocked","false")}else m(!1)},[d,v,b,y]);const C=()=>{(0,j.fireGtmEvent)("member_deal_login_clicked",{hotelId:b,dealName:null===h||void 0===h?void 0:h.name,source:o?"rate_plan":"room_card"}),u({isOpen:!0})};if(!c||v)return null;const A=null===f||void 0===f?void 0:f.discount,S=null===f||void 0===f?void 0:f.discountType,I=parseFloat(r),k=(0,M.Gl)(null===_||void 0===_?void 0:_.currency);let w=null;return!isNaN(I)&&A&&("percentage"===S?w=Math.round(I*(1-A/100)):"fixed_amount"===S&&(w=Math.max(0,Math.round(I-A)))),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:o?"secretMemberDealReateplanBox":"secretMemberDealBox",children:(0,E.jsxs)("div",{className:"secretMemberInlineBanner",role:"region","aria-label":"Member rate available",children:[(0,E.jsxs)("div",{className:"secretMemberLeft",children:[(0,E.jsx)("span",{className:"secretMemberTag","aria-hidden":"true",children:(0,E.jsx)(Y,{})}),(0,E.jsx)("span",{className:"secretMemberLabel",children:"Member Rate"})]}),null!==w&&(0,E.jsxs)("div",{className:"secretMemberPriceTeaser","aria-label":"Login to see member price",children:[(0,E.jsx)("span",{className:"secretMemberPriceFrom",children:"from"}),(0,E.jsxs)("span",{className:"secretMemberPriceValue","aria-hidden":"true",children:[k,w.toLocaleString()]}),(0,E.jsx)("span",{className:"secretMemberPriceNight",children:"/night"})]}),(0,E.jsxs)("button",{className:"secretMemberLoginBtn",onClick:C,onKeyDown:e=>"Enter"===e.key&&C(),"aria-label":"Unlock member rate \u2014 opens login",children:[(0,E.jsx)(T,{}),(0,E.jsx)("span",{children:"Unlock"})]})]})}),(null===a||void 0===a?void 0:a.isOpen)&&(0,E.jsx)(t.Suspense,{fallback:null,children:(0,E.jsx)(O,{isOpen:null===a||void 0===a?void 0:a.isOpen,onClose:()=>u({isOpen:!1}),applyPromotion:n})})]})};var F=i(2938),G=i(7023),L=i(7478),H=i(3025),z=i(8242),W=i(863),U=i(6413),V=i(193),q=i(6177);const K=(0,r.Ay)(()=>i.e(2642).then(i.bind(i,2642))),$=e=>{let{currentRoom:o={name:"Standard Room",amenities:[]},upgradedRoom:i={name:"Classic Room",amenities:[]},onUpgradeClick:l,onDismiss:n,priceDifference:d=500}=e;const{t:r}=(0,a.Bd)(),{displayPrice:s}=(0,q.A)(),[u,v]=(0,t.useState)(!0),[c,m]=(0,t.useState)([]),[h,p]=(0,t.useState)(!1);(0,t.useEffect)(()=>{(()=>{var e,l,n,d;const t=(null===(e=o.HotelRoomAmenities)||void 0===e?void 0:e.map(e=>{var o;return null===(o=e.Amenity)||void 0===o?void 0:o.name}))||[],r=(null===(l=i.HotelRoomAmenities)||void 0===l?void 0:l.filter(e=>{var o;return![32,78].includes(null===(o=e.Amenity)||void 0===o?void 0:o.id)}).map(e=>{var o;return null===(o=e.Amenity)||void 0===o?void 0:o.name}))||[],a=(null===(n=o.CustomRoomAmenities)||void 0===n?void 0:n.filter(e=>1===e.isActive).map(e=>e.name))||[],s=(null===(d=i.CustomRoomAmenities)||void 0===d?void 0:d.filter(e=>1===e.isActive).map(e=>e.name))||[],u=[...a,...t],v=[...s,...r].filter(e=>!u.includes(e));m(v)})()},[o,i]),(0,t.useEffect)(()=>{(0,j.fireGtmEvent)("room_upsell_card_viewed",{current_room_id:null===o||void 0===o?void 0:o.id,current_room_name:(null===o||void 0===o?void 0:o.roomName)||(null===o||void 0===o?void 0:o.name),upgraded_room_id:null===i||void 0===i?void 0:i.id,upgraded_room_name:(null===i||void 0===i?void 0:i.roomName)||(null===i||void 0===i?void 0:i.name),price_difference:d,currency:null===o||void 0===o?void 0:o.currency,unique_amenities_count:(null===c||void 0===c?void 0:c.length)||0,event_category:"Room Upsell",event_label:"Card Viewed"})},[o,i,d,c]);const f=((null===i||void 0===i?void 0:i.RoomImages)||[]).map(e=>null===e||void 0===e?void 0:e.cdnImageUrl).filter(Boolean),g=f[0],x=[(null===i||void 0===i?void 0:i.view)||(null===i||void 0===i?void 0:i.roomView),(null===i||void 0===i?void 0:i.bedConfig)||(null===i||void 0===i?void 0:i.bedType)||(null===i||void 0===i?void 0:i.bedConfiguration),(null===i||void 0===i?void 0:i.area)||(null===i||void 0===i?void 0:i.roomSize)||(null===i||void 0===i?void 0:i.sizeInSqft)].filter(
1Boolean);return(0,E.jsxs)("div",{className:"upcard upcard-enter ".concat(u?"is-expanded":""),role:"region","aria-label":r("Upgrade to {{roomName}}",{roomName:i.roomName}),children:[(0,E.jsxs)("button",{type:"button",className:"upcard-toggle",onClick:()=>{const e=!u;(0,j.fireGtmEvent)("room_upsell_card_toggled",{current_room_id:null===o||void 0===o?void 0:o.id,current_room_name:(null===o||void 0===o?void 0:o.roomName)||(null===o||void 0===o?void 0:o.name),upgraded_room_id:null===i||void 0===i?void 0:i.id,upgraded_room_name:(null===i||void 0===i?void 0:i.roomName)||(null===i||void 0===i?void 0:i.name),price_difference:d,currency:null===o||void 0===o?void 0:o.currency,is_expanded:e,event_category:"Room Upsell",event_label:e?"Card Expanded":"Card Collapsed"}),v(e)},"aria-expanded":u,"aria-label":r(u?"Hide upgrade details":"Show upgrade details"),children:[(0,E.jsxs)("span",{className:"upcard-toggle-label",children:[(0,E.jsx)("span",{className:"upcard-toggle-icon","aria-hidden":"true",children:(0,E.jsx)(z.A,{size:11})}),r("Upgrade available")]}),(0,E.jsx)(W.A,{size:15,className:"upcard-toggle-chevron","aria-hidden":"true"})]}),(0,E.jsx)("div",{className:"upcard-body-wrap",children:(0,E.jsx)("div",{className:"upcard-collapsible",children:(0,E.jsxs)("div",{className:"upcard-body",children:[(0,E.jsxs)("div",{className:"upcard-top",children:[g&&(0,E.jsxs)("button",{type:"button",className:"upcard-thumb",onClick:e=>{e.stopPropagation(),(0,j.fireGtmEvent)("room_upsell_photo_expanded",{upgraded_room_id:null===i||void 0===i?void 0:i.id,upgraded_room_name:(null===i||void 0===i?void 0:i.roomName)||(null===i||void 0===i?void 0:i.name)}),p(!0)},"aria-label":r("View photos of {{roomName}}",{roomName:i.roomName}),children:[(0,E.jsx)("img",{src:g,alt:i.roomName,loading:"lazy"}),(0,E.jsx)("span",{className:"upcard-thumb-expand","aria-hidden":"true",children:(0,E.jsx)(U.A,{size:11})})]}),(0,E.jsxs)("div",{className:"upcard-top-info",children:[(0,E.jsx)("h3",{children:i.roomName}),x.length>0&&(0,E.jsx)("span",{className:"upcard-meta",children:x.join(" \xb7 ")}),c.length>0&&(0,E.jsx)("div",{className:"upcard-amenities",children:c.slice(0,4).map(e=>(0,E.jsxs)("span",{className:"upcard-amenity",children:[(0,E.jsx)(V.A,{size:11,"aria-hidden":"true"}),(0,E.jsx)("span",{children:e})]},e))})]}),(0,E.jsxs)("div",{className:"upcard-price-right",children:[(0,E.jsxs)("span",{className:"upcard-price-amount","aria-label":"".concat(r("Additional amount")," ").concat(s(d)),children:[r("+"),(0,E.jsx)(L.A,{amount:d})]}),(0,E.jsx)("span",{className:"upcard-price-nights",children:r("total stay")})]})]}),(0,E.jsxs)("div",{className:"upcard-actions",children:[(0,E.jsxs)("button",{type:"button",className:"upcard-dismiss-btn",onClick:()=>{(0,j.fireGtmEvent)("room_upsell_declined",{current_room_id:null===o||void 0===o?void 0:o.id,current_room_name:(null===o||void 0===o?void 0:o.roomName)||(null===o||void 0===o?void 0:o.name),upgraded_room_id:null===i||void 0===i?void 0:i.id,upgraded_room_name:(null===i||void 0===i?void 0:i.roomName)||(null===i||void 0===i?void 0:i.name),price_difference:d,currency:null===o||void 0===o?void 0:o.currency,source:"card",event_category:"Room Upsell",event_label:"No Thanks Clicked"}),n&&n()},children:[r("Keep my")," ",o.roomName]}),(0,E.jsxs)("button",{type:"button",className:"upcard-upgrade-btn",onClick:()=>{(0,j.fireGtmEvent)("room_upsell_accepted",{current_room_id:null===o||void 0===o?void 0:o.id,current_room_name:(null===o||void 0===o?void 0:o.roomName)||(null===o||void 0===o?void 0:o.name),upgraded_room_id:null===i||void 0===i?void 0:i.id,upgraded_room_name:(null===i||void 0===i?void 0:i.roomName)||(null===i||void 0===i?void 0:i.name),price_difference:d,currency:null===o||void 0===o?void 0:o.currency,unique_amenities_count:(null===c||void 0===c?void 0:c.length)||0,source:"card",event_category:"Room Upsell",event_label:"Upgrade Now Clicked"}),l&&l()},children:[r("Upgrade")," \xb7 ",s(d)]})]})]})})}),h&&f.length>0&&(0,E.jsx)(t.Suspense,{fallback:null,children:(0,E.jsx)(K,{images:f,altPrefix:i.roomName,onClose:()=>p(!1)})})]})},J="https://ik.imagekit.io/hotelzifyprod/assets/images/check.svg",Z="https://ik.imagekit.io/hotelzifyprod/assets/images/food.svg",X="https://ik.imagekit.io/hotelzifyprod/assets/images/user.svg";d().extend(D());const Q=(0,r.Ay)(()=>i.e(2642).then(i.bind(i,2642))),ee=(0,r.Ay)(()=>i.e(4683).then(i.bind(i,4683))),oe=[320,480,640,800],ie=(e,o)=>{const i=null===e||void 0===e?void 0:e.replace(/#/g,"%23").replace(/ /g,"%20");
1return"".concat(i).concat(null!==i&&void 0!==i&&i.includes("?")?"&":"?","tr=w-").concat(o,",h-").concat(Math.round(.75*o),",ar-4-3,q-50,f-auto,fo-auto")},le=e=>{var o;let{value:i,setValue:l,maxValue:n,room:t,price:r,isHourlyRoom:u}=e;const v=(0,s.wA)(),{RoomImages:c,maxGuestCount:m,defaultGuestCount:p,defaultPrice:f,availableRooms:g}=t,{promotions:_,roomSlots:b={},hourlyTime:C,selectedRooms:N,hotelData:A,dateRange:S,totalAdult:I,totalChild:w,totalInfant:D}=(0,s.d4)(e=>e.hotelInfo);let P=null===_||void 0===_?void 0:_.sort((e,o)=>o.discount-e.discount)[0];"bulk"!==(null===(o=P)||void 0===o?void 0:o.type)||u||(P=null,(null===_||void 0===_?void 0:_.length)>1&&(P=_[1]));const{t:R}=(0,a.Bd)(),M=()=>{if(i<n){var e;let n=Object.keys(b).length>0?Object.keys(b):[];if(u&&(null===n||void 0===n?void 0:n.length)>0&&n.includes(String(null===t||void 0===t?void 0:t.id))&&Object.keys(b[null===t||void 0===t?void 0:t.id]).length>0){var o,a;n.filter(e=>e===String(null===t||void 0===t?void 0:t.id));if(!((0,k.j6)((0,k.KA)(null===(o=b[null===t||void 0===t?void 0:t.id])||void 0===o?void 0:o.firstCheckInTime),C)&&(0,k.j6)(C,(0,k.KA)(null===(a=b[null===t||void 0===t?void 0:t.id])||void 0===a?void 0:a.lastCheckInTime))))return void h.A.error(R("not_available_selected_checkin_time"))}if(u&&!Object.keys(b).includes(String(null===t||void 0===t?void 0:t.id)))return void h.A.error(R("please_select_time_slot"));if(l(e=>e+1),v((0,x.TG)(t)),(0,j.pushRoomSelectedEvent)({room:t,hotelData:A,dateRange:S,price:r,numberOfRooms:i+1,totalAdult:I,totalChild:w,totalInfant:D,promotions:_}),(0,j.pushRoomAddedEvent)({room:t,hotelData:A,dateRange:S,price:r,numberOfRooms:i+1,totalAdult:I,totalChild:w,totalInfant:D,promotions:_}),(0,j.fireGtmEvent)("room_added",{room_name:null===t||void 0===t?void 0:t.roomName,roomId:null===t||void 0===t?void 0:t.id,totalPrice:r,pricePerNight:parseInt(f),photos:null===c||void 0===c?void 0:c.length,defaultGuestCount:p}),(0,j.trackCrawlerAction)("room_added",{room_name:null===t||void 0===t?void 0:t.roomName,roomId:null===t||void 0===t?void 0:t.id,totalPrice:r,pricePerNight:parseInt(f),maxGuestCount:m,oneRoomLeft:g<3,availableRooms:g}),window&&null!==(e=window)&&void 0!==e&&e.gtag){var s,N,P,M,E;const e=null!==(s=null!==(N=null===A||void 0===A?void 0:A.chainId)&&void 0!==N?N:y.A.get("chainId"))&&void 0!==s?s:"",o=null!==(P=null!==(M=null===A||void 0===A?void 0:A.name)&&void 0!==M?M:y.A.get("hotelName"))&&void 0!==P?P:"";null===(E=window)||void 0===E||E.gtag("event","add_to_cart",{chain_id:String(e||""),chainId:e?Number(e):null,hotel_id:String((null===A||void 0===A?void 0:A.id)||""),hotelId:null!==A&&void 0!==A&&A.id?Number(null===A||void 0===A?void 0:A.id):null,hotel_name:String(o||""),hotelName:String(o||""),booking_source:y.A.get("source")||"Direct",value:r,currency:(null===A||void 0===A?void 0:A.currency)||"INR",items:[{id:null===A||void 0===A?void 0:A.id,price:r,item_id:null===A||void 0===A?void 0:A.id,item_name:null===t||void 0===t?void 0:t.roomName,item_category:String(e||""),quantity:1,start_date:d()(null===S||void 0===S?void 0:S.startDate).format("YYYY-MM-DD"),end_date:d()(null===S||void 0===S?void 0:S.endDate).format("YYYY-MM-DD"),google_business_vertical:"hotel_rental"}]})}}};return i>0?(0,E.jsxs)("div",{className:"hAddonAdded",children:[(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/images/minus.svg",alt:"remove room",className:"hAddonIcon",onClick:()=>{var e,o;i>0&&(l(e=>e-1),v((0,x.$r)(t)),(0,j.fireGtmEvent)("room_removed",{roomName:null===t||void 0===t?void 0:t.roomName,roomId:null===t||void 0===t?void 0:t.id,totalPrice:r,pricePerNight:parseInt(f),photos:null===c||void 0===c?void 0:c.length}),(0,j.trackCrawlerAction)("room_removed",{roomName:null===t||void 0===t?void 0:t.roomName,roomId:null===t||void 0===t?void 0:t.id,totalPrice:r,defaultGuestCount:p,maxGuestCount:m,oneRoomLeft:g<3,availableRooms:g}),103376===(null===A||void 0===A?void 0:A.userId)&&window&&null!==(e=window)&&void 0!==e&&e.gtag&&(null===(o=window)||void 0===o||o.gtag("event","remove_from_cart",{value:r,currency:null===A||void 0===A?void 0:A.currency,items:[{id:null===A||void 0===A?void 0:A.id,price:r,item_id:null===A||void 0===A?void 0:A.id,item_name:null===t||void 0===t?void 0:t.roomName,start_date:d()(null===S||void 0===S?void 0:S.startDate).format("YYYY-MM-DD"),end_date:d()(null===S||void 0===S?void 0:S.endDate).format("YYYY-MM-DD"),google_business_vertical:"hotel_rental"}]})))}}),(0,E.jsx)("span",{children:i}),(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/images/plus.svg",alt:"add room",className:"hAddonIcon",onClick:M})]}):(!u||(null===N||void 0===N?void 0:N.length)>0)&&(0,E.jsxs)("div",{onClick:M,className:"hAddonAdd btnShadow",children:[(0,E.jsxs)("b",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"10px"},children:[" ",R("reserve")," ",u&&(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/f4ce4893-c0f4-4475-866b-c5dc54c7c760.svg",width:20,height:20,alt:"Hourly booking available"})," "]})," "]})},ne=e=>{let{name:o,extraChild:i,setExtraChild:l,extraAdult:n,setExtraAdult:d,maxGuestCount:t,addon:r,setPeople:u,defaultGuestCount:v,totalPeople:c,guestToDisplay:m,room:p,roomCount:f,extraInfant:g,setExtraInfant:_,adultAddons:y}=e;const b=(0,s.wA)(),{selectedAddons:C}=(0,s.d4)(e=>e.hotelInfo),{t:N}=(0,a.Bd)();return(0,E.jsxs)("div",{className:"incrementer roomCom",children:[(0,E.jsx)("div",{onClick:()=>{var e;if("Extra Adult"===o&&n>0)b((0,x.sd)(y[n-1])),d(e=>e-1),u(e=>e-1),(0,j.fireGtmEvent)("addon_removed",{addonName:null===r||void 0===r||null===(e=r.Addon)||void 0===e?void 0:e.name,addonPrice:null===r||void 0===r?void 0:r.price,addonId:null===r||void 0===r?void 0:r.id,hotelRoomId:null===r||void 0===r?void 0:r.hotel_room_id});else if("Extra Child"===o&&i>0&&"child"===(null===r||void 0===r?void 0:r.type)){var t;b((0,x.sd)(r)),l(e=>e-1),u(e=>e-1),(0,j.fireGtmEvent)("addon_removed",{addonName:null===r||void 0===r||null===(t=r.Addon)||void 0===t?void 0:t.name,addonPrice:null===r||void 0===r?void 0:r.price,addonId:null===r||void 0===r?void 0:r.id,hotelRoomId:null===r||void 0===r?void 0:r.hotel_room_id})}else if("Extra Child"===o&&g>0&&"infant"===(null===r||void 0===r?void 0:r.type)){var a;b((0,x.sd)(r)),_(e=>e-1),u(e=>e-1),(0,j.fireGtmEvent)("addon_removed",{addonName:null===r||void 0===r||null===(a=r.Addon)||void 0===a?void 0:a.name,addonPrice:null===r||void 0===r?void 0:r.price,addonId:null===r||void 0===r?void 0:r.id,hotelRoomId:null===r||void 0===r?void 0:r.hotel_room_id})}},className:"decrement roomInc",children:"-"}),(0,E.jsx)("div",{className:"incrementer__value roomVal",children:"Extra Adult"===o?n:"infant"===(null===r||void 0===r?void 0:r.type)?g:i}),(0,E.jsx)("div",{onClick:()=>{var e;let a=null===C||void 0===C||null===(e=C.filter(e=>{var o;return(null===e||void 0===e?void 0:e.hotel_room_id)===(null===p||void 0===p?void 0:p.id)&&"person"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.category)}))||void 0===e?void 0:e.length;var s;i+n+g<(t-v)*f&&null!==o&&void 0!==o&&o.startsWith("Extra")&&a+v<t*f?(b("Extra Adult"===o?(0,x.Oz)(y[n]):(0,x.Oz)(r)),"Extra Adult"===o?d(e=>e+1):"Extra Child"===o&&"infant"===(null===r||void 0===r?void 0:r.type)?_(e=>e+1):l(e=>e+1),u(e=>e+1),(0,j.fireGtmEvent)("addon_selected",{addon_name:null===r||void 0===r||null===(s=r.Addon)||void 0===s?void 0:s.name,addon_price:null===r||void 0===r?void 0:r.price,addon_id:null===r||void 0===r?void 0:r.id,hotel_room_id:null===r||void 0===r?void 0:r.hotel_room_id})):h.A.error(N("maximum_occupancy_reached"))},className:"increment roomInc",children:"+"})]})},de=e=>{var o,i;let{addon:l,name:n,addAddon:d,deselectAddon:t,room:r,breakfast:a,lunch:u,dinner:v,setBreakfast:c,setLunc
1h:m,setDinner:h,maxGuestCount:p}=e;const f=(0,s.wA)();return(0,E.jsxs)("div",{className:"incrementer roomCom",children:[(0,E.jsx)("div",{onClick:()=>{"Breakfast"===n&&a>0&&(c(e=>e-1),f(t(l))),"Lunch"===n&&u>0&&(m(e=>e-1),f(t(l))),"Dinner"===n&&v>0&&(h(e=>e-1),f(t(l)))},className:"decrement roomInc",children:"-"}),(0,E.jsx)("div",{className:"incrementer__value roomVal",children:"Breakfast"===(null===l||void 0===l||null===(o=l.Addon)||void 0===o?void 0:o.name)?a:"Lunch"===(null===l||void 0===l||null===(i=l.Addon)||void 0===i?void 0:i.name)?u:v}),(0,E.jsx)("div",{onClick:()=>{"Breakfast"===n&&a<p&&(c(e=>e+1),f(d(l))),"Lunch"===n&&u<p&&(m(e=>e+1),f(d(l))),"Dinner"===n&&v<p&&(h(e=>e+1),f(d(l)))},className:"increment roomInc",children:"+"})]})},te=e=>{let{id:o,defaultGuestCount:i,maxGuestCount:n,extraInfantPrice:d,extraChildPrice:r,room:u,childAgeSplit:v,childAgeLimit:c}=e;const{selectedRooms:h,isRatePlans:p,hotelData:f}=(0,s.d4)(e=>e.hotelInfo),g=(0,b.Hi)(null===f||void 0===f?void 0:f.id,null===f||void 0===f?void 0:f.chainId),x=(0,s.wA)(),[y,C]=(0,t.useState)(i),[N,S]=(0,t.useState)(0),[I,k]=(0,t.useState)(0),[w,D]=(0,t.useState)(),[P,R]=(0,t.useState)(!0),[M,O]=(0,t.useState)(!1);(0,t.useEffect)(()=>{if((null===h||void 0===h?void 0:h.length)>0){let e=(null===h||void 0===h?void 0:h.filter(e=>(null===e||void 0===e?void 0:e.id)===(null===u||void 0===u?void 0:u.id)&&Number(null===e||void 0===e?void 0:e.idx)===Number(o))[0])||{};D(e)}},[h]),(0,t.useEffect)(()=>{w?(C(null===w||void 0===w?void 0:w.sAdult),S(null===w||void 0===w?void 0:w.sChild),k(null===w||void 0===w?void 0:w.sInfant),R(!1)):R(!0)},[w]),(0,t.useEffect)(()=>{let e=(null===h||void 0===h?void 0:h.filter(e=>(null===e||void 0===e?void 0:e.id)===(null===u||void 0===u?void 0:u.id)&&Number(null===e||void 0===e?void 0:e.idx)===Number(o))[0])||{};(null===h||void 0===h?void 0:h.length)>0&&e&&!P&&(e=(0,l.A)((0,l.A)({},e),{},{sAdult:y,sChild:N,sInfant:I}),x({type:_.A.SET_ROOM,payload:e}))},[y,N,I]);const{width:T}=(0,A.A)(),{t:Y}=(0,a.Bd)();return(0,E.jsxs)("div",{className:"newSelectionType",style:{padding:p&&"10px 0"},children:[(0,E.jsx)("div",{className:"newSelectionRoom",children:(0,E.jsxs)("p",{children:[Y("room")," ",o]})}),(0,E.jsx)("div",{className:"newSelections",children:g&&T>900?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"guestStepper",children:[(0,E.jsx)("div",{className:"guestStepper__info",children:(0,E.jsxs)("span",{className:"guestStepper__label",children:[Y("adults")," ",(0,E.jsxs)("span",{className:"guestStepper__age",children:["(",">",c,Y("years"),")"]})]})}),(0,E.jsxs)("div",{className:"guestStepper__controls",children:[(0,E.jsx)("button",{className:"guestStepper__btn",disabled:y<=1,"aria-label":"Decrease adults",onClick:()=>{const e=y-1;C(e),(0,j.fireGtmEvent)("adult_dropdown_clicked",{count:e,roomIndex:o,room:u})},children:"\u2212"}),(0,E.jsx)("span",{className:"guestStepper__count",children:y}),(0,E.jsx)("button",{className:"guestStepper__btn",disabled:y>=n-N-I,"aria-label":"Increase adults",onClick:()=>{const e=y+1;C(e),(0,j.fireGtmEvent)("adult_dropdown_clicked",{count:e,roomIndex:o,room:u})},children:"+"})]})]}),r&&(0,E.jsxs)("div",{className:"guestStepper",children:[(0,E.jsx)("div",{className:"guestStepper__info",children:(0,E.jsxs)("span",{className:"guestStepper__label",children:[Y("children")," ",(0,E.jsxs)("span",{className:"guestStepper__age",children:["(",v,"-",c,Y("years"),")"]})]})}),(0,E.jsxs)("div",{className:"guestStepper__controls",children:[(0,E.jsx)("button",{className:"guestStepper__btn",disabled:N<=0,"aria-label":"Decrease children",onClick:()=>{const e=N-1;S(e),(0,j.fireGtmEvent)("child_dropdown_clicked",{count:e,roomIndex:o,room:u})},children:"\u2212"}),(0,E.jsx)("span",{className:"guestStepper__count",children:N}),(0,E.jsx)("button",{className:"guestStepper__btn",disabled:n-y-I===0||N>=n-y-I,"aria-label":"Increase children",onClick:()=>{const e=N+1;S(e),(0,j.fireGtmEvent)("child_dropdown_clicked",{count:e,roomIndex:o,room:u})},children:"+"})]})]}),d&&(0,E.jsxs)("div",{className:"guestStepper",children:[(0,E.jsx)("div",{className:"guestStepper__info",children:(0,E.jsxs)("span",{className:"guestStepper__label",children:[Y("infants")," ",(0,E.jsxs)("span",{className:"guestStepper__age",children:["(0-",v-1,Y("years"),")"]})]})}),(0,E.jsxs)("div",{className:"guestStepper__controls",children:[(0,E.jsx)("button",{className:"guestStepper__btn",disabled:I<=0,"aria-label":"Decrease infants",onClick:()=>{const e=I-1;k(e),(0,j.fireGtmEvent)("infant_dropdown_clicked",{count:e,roomIndex:o,room:u})},children:"\u2212"}),(0,E.jsx)("span",{className:"guestStepper__count",children:I}),(0,E.jsx)("button",{className:"guestStepper__btn",disabled:n-y-N===0||I>=n-y-N,"aria-label":"Increase infants",onClick:()=>{const e=I+1;k(e),(0,j.fireGtmEvent)("infant_dropdown_clicked",{count:e,roomIndex:o,room:u})},children:"+"})]})]})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"newSelection",style:{alignItems:T>901&&"center"},children:[(0,E.jsxs)("p",{style:{color:n-y-I===0&&"#dadada"},children:[Y("adults"),":"," ",(0,E.jsxs)("span",{children:["Above ",c,Y("years")]})," "]}),(0,E.jsx)("select",{value:y,className:"selectorDrop","aria-label":"Number of adults",onChange:e=>{C(Number(e.target.value)),(0,j.fireGtmEvent)("adult_dropdown_clicked",{count:e.target.value,roomIndex:o,room:u})},children:Array.from({length:n-N-I}).map((e,o)=>(0,E.jsx)("option",{value:o+1,children:o+1},m()()))})]}),r&&(0,E.jsxs)("div",{className:"newSelection",children:[(0,E.jsxs)("p",{style:{color:n-y-I===0&&"#dadada"},children:[Y("children"),":"," ",(0,E.jsxs)("span",{children:["(",v,Y("years")," - ",c,Y("years"),")"]})," "]}),(0,E.jsx)("select",{className:"selectorDrop",value:N,"aria-label":"Number of children",disabled:n-y-I===0,style:{color:n-y-I===0&&"#dadada"},onChange:e=>{S(Number(e.target.value)),(0,j.fireGtmEvent)("child_dropdown_clicked",{count:e.target.value,roomIndex:o,room:u})},children:Array.from({length:n-y-I+1}).map((e,o)=>(0,E.jsx)("option",{value:o,children:0===o?"Select":o},m()()))})]}),d&&(0,E.jsxs)("div",{className:"newSelection",children:[(0,E.jsxs)("p",{style:{color:n-y-N===0&&"#dadada"},children:[Y("infants"),":",(0,E.jsxs)("span",{children:["(0 - ",v-1,Y("years"),")"]})," "]}),(0,E.jsx)("select",{className:"selectorDrop",value:I,"aria-label":"Number of infants",disabled:n-y-N===0,style:{color:n-y-N===0&&"#dadada"},onChange:e=>{k(Number(e.target.value)),(0,j.fireGtmEvent)("infant_dropdown_clicked",{count:e.target.value,roomIndex:o,room:u})},children:Array.from({length:n-y-N+1}).map((e,o)=>(0,E.jsx)("option",{value:o,children:0===o?"Select":o},m()()))})]})]})})]})},re=e=>{let{id:o,thisPlan:i,maxAdultCount:n,maxGuestCount:d,extraChildPrice:r,extraInfantPrice:u,room:v,childAgeSplit:c,childAgeLimit:h}=e;const{selectedRooms:p,isRatePlans:f,hotelData:g}=(0,s.d4)(e=>e.hotelInfo),x=(0,b.Hi)(null===g||void 0===g?void 0:g.id,null===g||void 0===g?void 0:g.chainId),{maxChildCount:y,maxInfantCount:C}=v,N=(0,s.wA)(),[S,I]=(0,t.useState)(0),[k,w]=(0,t.useState)(0),[D,P]=(0,t.useState)(0),[R,M]=(0,t.useState)(),[O,T]=(0,t.useState)(!0);(0,t.useEffect)(()=>{i?(I(null===i||void 0===i?void 0:i.sAdult),w(null===i||void 0===i?void 0:i.sChild),P(null===i||void 0===i?void 0:i.sInfant),T(!1)):T(!0)},[i]),(0,t.useEffect)(()=>{let e=(null===p||void 0===p?void 0:p.filter(e=>(null===e||void 0===e?void 0:e.id)===(null===v||void 0===v?void 0:v.id)&&Number(null===e||void 0===e?void 0:e.idx)===Number(o))[0])||{};(null===p||void 0===p?void 0:p.length)>0&&e&&!O&&(e=(0,l.A)((0,l.A)({},e),{},{sAdult:S,sChild:k,sInfant:D}),N({type:_.A.SET_ROOM,payload:e}))},[S,k,D]);const{width:Y}=(0,A.A)(),{t:B}=(0,a.Bd)(),F=e=>{let o=Number(e.target.value),n=e.target.name,d=(0,l.A)((0,l.A)({},i),{},{[n]:o});N({type:_.A.EDIT_RP,payload:d})};return(0,E.jsxs)("div",{className:"newSelectionType",style:{padding:f&&"10px 0",borderTop:f&&"none"},children:[(0,E.jsx)("div",{className:"newSelectionRoom",children:(0,E.jsxs)("p",{children:[B("room")," ",o]})}),(0,E.jsx)("div",{className:"newSelections",children:x&&Y>900?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"guestStepper",children:[(0,E.jsx)("div",{className:"guestStepper__info",children:(0,E.jsxs)("span",{className:"guestStepper__label",children:[B("adults")," ",(0,E.jsxs)("span",{className:"guestStepper__age",children:["(",">",h,B("years"),")"]})]})}),(0,E.jsxs)("div",{className:"guestStepper__controls",children:[(0,E.jsx)("button",{className:"guestStepper__btn",disabled:S<=1,"aria-label":"Decrease adults",onClick:()=>{const e=S-1;I(e),(0,j.fireGtmEvent)("adult_dropdown_clicked",{count:e,roomIndex:o,room:v}),F({target:{name:"sAdult",value:e}})},children:"\u2212"}),(0,E.jsx)("span",{className:"guestStepper__count",children:S}),(0,E.jsx)("button",{className:"guestStepper__btn",disabled:S>=Math.min(n,d-k-D),"aria-label":"Increase adults",onClick:()=>{const e=S+1;I(e),(0,j.fireGtmEvent)("adult_dropdown_clicked",{count:e,roomIndex:o,room:v}),F({target:{name:"sAdult",value:e}})},children:"+"})]})]}),y>0&&(0,E.jsxs)("div",{className:"guestStepper",children:[(0,E.jsx)("div",{className:"guestStepper__info",children:(0,E.jsxs)("span",{className:"guestStepper__label",children:[B("children")," ",(0,E.jsxs)("span",{className:"guestStepper__age",children:["(",c,"-",h,B("years"),")"]})]})}),(0,E.jsxs)("div",{className:"guestStepper__controls",children:[(0,E.jsx)("button",{className:"guestStepper__btn",disabled:k<=0,"aria-label":"Decrease children",onClick:()=>{const e=k-1;w(e),(0,j.fireGtmEvent)("child_dropdown_clicked",{count:e,roomIndex:o,room:v}),F({target:{name:"sChild",value:e}})},children:"\u2212"}),(0,E.jsx)("span",{className:"guestStepper__count",children:k}),(0,E.jsx)("button",{className:"guestStepper__btn",disabled:d-S-D===0||k>=Math.min(y,d-S-D),"aria-label":"Increase children",onClick:()=>{const e=k+1;w(e),(0,j.fireGtmEvent)("child_dropdown_clicked",{count:e,roomIndex:o,room:v}),F({target:{name:"sChild",value:e}})},children:"+"})]})]}),C>0&&(0,E.jsxs)("div",{className:"guestStepper",children:[(0,E.jsx)("div",{className:"guestStepper__info",children:(0,E.jsxs)("span",{className:"guestStepper__label",children:[B("infants")," ",(0,E.jsxs)("span",{className:"guestStepper__age",children:["(0-",c-1,B("years"),")"]})]})}),(0,E.jsxs)("div",{className:"guestStepper__controls",children:[(0,E.jsx)("button",{className:"guestStepper__btn",disabled:D<=0,"aria-label":"Decrease infants",onClick:()=>{const e=D-1;P(e),(0,j.fireGtmEvent)("infant_dropdown_clicked",{count:e,roomIndex:o,room:v}),F({target:{name:"sInfant",value:e}})},children:"\u2212"}),(0,E.jsx)("span",{className:"guestStepper__count",children:D}),(0,E.jsx)("button",{className:"guestStepper__btn",disabled:d-S-k===0||D>=Math.min(C,d-S-k),"aria-label":"Increase infants",onClick:()=>{const e=D+1;P(e),(0,j.fireGtmEvent)("infant_dropdown_clicked",{count:e,roomIndex:o,room:v}),F({target:{name:"sInfant",value:e}})},children:"+"})]})]})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"newSelection",style:{alignItems:Y>901&&"center"},children:[(0,E.jsxs)("p",{children:[B("adults"),":"," ",(0,E.jsxs)("span",{children:["Above ",h,B("years")]})," "]}),(0,E.jsx)("select",{value:S,className:"selectorDrop",name:"sAdult","aria-label":"Number of adults",onChange:e=>{I(Number(e.target.value)),(0,j.fireGtmEvent)("adult_dropdown_clicked",{count:e.target.value,roomIndex:o,room:v}),F(e)},children:Array.from({length:d-D-k>n?n:d-D-k}).map((e,o)=>(0,E.jsx)("option",{value:o+1,children:o+1},m()()))})]}),y>0&&(0,E.jsxs)("div",{className:"newSelection",children:[(0,E.jsxs)("p",{style:{color:d-S-D===0&&"#dadada"},children:[B("children"),":"," ",(0,E.jsxs)("span",{children:["(",c,B("years")," - ",h,B("years"),")"]})," "]}),(0,E.jsx)("select",{className:"selectorDrop",value:k,"aria-label":"Number of children",disabled:d-S-D===0,style:{color:d-S-D===0&&"#dadada"},name:"sChild",onChange:e=>{w(Number(e.target.value)),(0,j.fireGtmEvent)("child_dropdown_clicked",{count:e.target.value,roomIndex:o,room:v}),F(e)},children:Array.from({length:Math.abs((d-S-D>y?y:d-S-D)+1)}).map((e,o)=>(0,E.jsx)("option",{value:o,children:0===o?"Select":o},m()()))})]}),C>0&&(0,E.jsxs)("div",{className:"newSelection",children:[(0,E.jsxs)("p",{style:{color:d-S-k===0&&"#dadada"},children:[B("infants"),":"," ",(0,E.jsxs)("span",{children:["(0 - ",c-1,B("years"),")"]})," "]}),(0,E.jsx)("select",{className:"selectorDrop",value:D,"aria-label":"Number of infants",disabled:d-S-k===0,style:{color:d-S-k===0&&"#dadada"}
1,name:"sInfant",onChange:e=>{P(Number(e.target.value)),(0,j.fireGtmEvent)("infant_dropdown_clicked",{count:e.target.value,roomIndex:o,room:v}),F(e)},children:Array.from({length:(d-S-k>C?C:d-S-k)+1}).map((e,o)=>(0,E.jsx)("option",{value:o,children:0===o?"Select":o},m()()))})]})]})})]})},ae=e=>{var o,i,n,r,u,v,c,m,g,b,C,A,S,I,w,D,M,O,T;let{room:Y,code:G,rateplan:H={},extraPrice:z=1,setAvailableRooms:W,availableRooms:U,maxRoomPerBooking:V,rpRoomCount:q,setRPRoomCount:K,selectedRPRoomCount:J,setSelectedRPRoomCount:Z,idx:X,notificationStyle:Q,handleRoomPrice:ee,pricingfornotifications:oe,getSecretMemberDealUrl:ie=()=>{},applyPromotion:le,promotionRes:ne,sortedRooms:de,autoSelect:te=!1}=e;const ae=(0,l.A)((0,l.A)({},JSON.parse(null===H||void 0===H?void 0:H.ratePlanConfig)),{},{ratePlanId:null===H||void 0===H?void 0:H.ratePlanId,id:null===H||void 0===H?void 0:H.id}),se=null===Y||void 0===Y||null===(o=Y.allPricingWithMlos)||void 0===o?void 0:o.find(e=>e.ratePlanCode===G),[ue,ve]=(0,t.useState)([]),[ce,me]=(0,t.useState)(!1),[he,pe]=(0,t.useState)(!1),[fe,ge]=(0,t.useState)([]),[xe,_e]=(0,t.useState)([]),[ye,be]=(0,t.useState)({name:"",description:""}),[je,Ce]=(0,t.useState)(null),Ne="true"===sessionStorage.getItem("isMembershipUnlocked"),Ae="google_vr"===y.A.get("source"),{hotelData:Se,totalAdult:Ie,totalChild:ke,totalInfant:we,dateRange:De,totalPeople:Pe,dateCount:Re,selectedRatePlans:Me=[],promotions:Ee=[],taxes:Oe,isHourlyRoom:Te,upsell:Ye,couponCode:Be,bookingEngineConfig:Fe}=(0,s.d4)(e=>e.hotelInfo),{policies:Ge=[]}=ae,Le=(e,o,i)=>{const l=d()(e).startOf("day"),n=d()(o).startOf("day"),t=d()(i).startOf("day");return l.isSameOrAfter(n)&&l.isSameOrBefore(t)},He=e=>{let o=0;const i=Array.isArray(null===e||void 0===e?void 0:e.result)?e.result:[];if(console.log("Calculating strictness for policy:",e,"with result:",i),0===i.length)return 0;return(null===i||void 0===i?void 0:i.some(e=>"100"===e.Penalty_Value&&parseInt(e.Days_Before)>=999))?1e3:(i.forEach(e=>{const i=parseInt(e.Penalty_Value)||0,l=e.Penalty_Type;"percent"!==l&&"percentage"!==l||(o+=2*i),"nights"===l&&(o+=100*i),"fixedAmount"===l&&(o+=50)}),o)},ze=(e,o,i)=>{if(!e||0===e.length)return null;const n=d()(o),t=d()(i),r=[];let a=n.clone();for(;a.isBefore(t);)r.push(a.clone()),a=a.add(1,"day");const s=e.filter(e=>{var o,i,l,n,t,a;const s=(null===(o=e.condition)||void 0===o?void 0:o.policyType)||e.type;if(!s||"cancellation"===s)return!0;switch(s){case"date_range":const o=null===(i=e.condition)||void 0===i?void 0:i.dateRange;if(o)return r.some(e=>Le(e,o.from,o.to));if(null!==(l=e.dates)&&void 0!==l&&l.start&&null!==(n=e.dates)&&void 0!==n&&n.end)return r.some(o=>Le(o,e.dates.start,e.dates.end));break;case"day_of_week":const s=null===(t=e.condition)||void 0===t?void 0:t.daysOfWeek;if(s)return r.some(e=>((e,o)=>{const i=d()(e).day();return o.includes(i)})(e,s));break;case"blackout":const u=null===(a=e.condition)||void 0===a?void 0:a.blackoutDates;if(u)return r.some(e=>((e,o)=>{const i=d()(e).format("YYYY-MM-DD");return o.some(e=>d()(e).format("YYYY-MM-DD")===i)})(e,u));break;default:return!0}return!1});if(console.log("Applicable policies after filtering:",s),0===s.length){const o=e.find(e=>{var o;return"default"===((null===(o=e.condition)||void 0===o?void 0:o.policyType)||e.type)});return console.log("No applicable policies. Default policy:",o),console.log("Returning:",o||null),o||null}const u=s.filter(e=>{var o;return"default"===((null===(o=e.condition)||void 0===o?void 0:o.policyType)||e.type)}),v=s.filter(e=>{var o;return"default"!==((null===(o=e.condition)||void 0===o?void 0:o.policyType)||e.type)});let c=null;if(v.length>0){if(v.some(e=>void 0!==e.priority&&null!==e.priority))v.sort((e,o)=>{const i=(e.priority||999)-(o.priority||999);if(0!==i)return i;const l=He(e);return He(o)-l}),c=v[0];else{const e=v.map(e=>(0,l.A)((0,l.A)({},e),{},{strictnessScore:He(e)}));e.sort((e,o)=>
1o.strictnessScore-e.strictnessScore),c=e[0]}}if(u.length>0){const e=u[0];if(c){const o=He(c),i=He(e);console.log("Comparing strictness - resolved:",o,"default:",i),i>o&&(c=e)}else c=e}return c},We=(0,t.useMemo)(()=>{let e=[];const o=ze(Ge,null===De||void 0===De?void 0:De.startDate,null===De||void 0===De?void 0:De.endDate);var i;Ge.length>0&&console.log("Cancellation Policy Resolution:",{totalPolicies:Ge.length,applicablePolicy:o,policyType:(null===o||void 0===o||null===(i=o.condition)||void 0===i?void 0:i.policyType)||(null===o||void 0===o?void 0:o.type),checkInDate:null===De||void 0===De?void 0:De.startDate,checkOutDate:null===De||void 0===De?void 0:De.endDate,result:null===o||void 0===o?void 0:o.result});return o&&(o.result&&Array.isArray(o.result)?e=o.result:Ge.length>0&&(Ge.forEach(o=>{o.result&&e.push(o)}),e=e.flatMap(e=>(null===e||void 0===e?void 0:e.result)||[]))),e=e.filter((e,o,i)=>e&&o===i.findIndex(o=>o.Days_Before===e.Days_Before)).sort((e,o)=>parseInt((null===e||void 0===e?void 0:e.Days_Before)||0)-parseInt((null===o||void 0===o?void 0:o.Days_Before)||0)),JSON.stringify(e)!==JSON.stringify(fe)&&ge(e),e},[Ge,De]),{pricing:Ue,allPricingWithMlos:Ve,maxAdultCount:qe,maxChildCount:Ke,maxGuestCount:$e,pricingAdditionalGuests:Je={},maxInfantCount:Ze}=Y,Xe=(Array.isArray(Ve)&&Ve.length>0?Ve:Ue)||[],Qe=(0,s.wA)();(0,t.useEffect)(()=>{te&&Co()},[te]),(0,t.useEffect)(()=>{if((null===oe||void 0===oe?void 0:oe.length)>0){let e=(e=>{const o=new Map;return null===e||void 0===e||e.forEach(e=>{const[[i,l]]=Object.entries(e);null!==i&&void 0!==i&&i.toLowerCase().includes("suite")&&(!o.has(i)||l<o.get(i))&&o.set(i,l)}),Array.from(o).map(e=>{let[o,i]=e;return{roomName:o,roomPrice:i}})})(oe),o=null===e||void 0===e?void 0:e.slice(0,2);setTimeout(()=>{(null===o||void 0===o?void 0:o.length)>0&&_e(o)},0)}},[oe]);const[eo,oo]=(0,t.useState)([]),[io,lo]=(0,t.useState)(!1),no=(0,t.useRef)(null),[to,ro]=(0,t.useState)(!1);(0,t.useEffect)(()=>{const e=no.current;if(!e)return;const o=()=>ro(e.scrollHeight>e.clientHeight);return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[null===ae||void 0===ae?void 0:ae.description]),(0,t.useEffect)(()=>{if((null===Ee||void 0===Ee?void 0:Ee.length)>0){let e=(0,N.hR)(Ee);ve(e)}else ve([])},[Ee,null===Se||void 0===Se?void 0:Se.id]);let ao=(null===Y||void 0===Y?void 0:Y.maxAdultCount)>(null===Xe||void 0===Xe||null===(i=Xe.filter(e=>(null===e||void 0===e?void 0:e.ratePlanCode)===G))||void 0===i?void 0:i.length)?null===Xe||void 0===Xe||null===(n=Xe.filter(e=>(null===e||void 0===e?void 0:e.ratePlanCode)===G))||void 0===n?void 0:n.length:null===Y||void 0===Y?void 0:Y.maxAdultCount,so=Ie<=ao?Ie:ao,uo=ke<=(null===Y||void 0===Y?void 0:Y.maxChildCount)?ke:(null===Y||void 0===Y?void 0:Y.maxChildCount)||0,vo=we<=(null===Y||void 0===Y?void 0:Y.maxInfantCount)?we:(null===Y||void 0===Y?void 0:Y.maxInfantCount)||0;null===Y||void 0===Y||Y.availableRooms;const co=(e,o,i,l,n)=>{var d,t,r,a,s,u,v,c;let m=null===(d=n=(0,N.ix)(n,l,i))||void 0===d||null===(t=d.filter(l=>(null===l||void 0===l?void 0:l.adultCount)===e&&(null===l||void 0===l?void 0:l.childCount)===o&&(null===l||void 0===l?void 0:l.infantCount)===i))||void 0===t||null===(r=t[0])||void 0===r?void 0:r.priceForPax,h=m||(null===(a=n)||void 0===a||null===(s=a.filter(o=>(null===o||void 0===o?void 0:o.adultCount)===e&&0===(null===o||void 0===o?void 0:o.childCount)&&0===(null===o||void 0===o?void 0:o.infantCount)))||void 0===s||null===(u=s[0])||void 0===u?void 0:u.priceForPax)||[];if((!h||0===h.length)&&(null===(v=n)||void 0===v?void 0:v.length)>0){var p,f,g,x,_;let o=(null===(p=n)||void 0===p||null===(f=p.filter(o=>(null===o||void 0===o?void 0:o.adultCount)>=e))||void 0===f||null===(g=f.sort((e,o)=>(null===e||void 0===e?void 0:e.adultCount)-(null===o||void 0===o?void 0:o.adultCount)))||void 0===g?void 0:g[0])||(null===(x=n)||void 0===x||null===(_=x.sort((e,o)=>(null===o||void 0===o?void 0:o.adultCount)-(null===e||void 0===e?void 0:e.adultCount)))||void 0===_?void 0:_[0]);h=(null===o||void 0===o?void 0:o.priceForPax)||[]}let y=null===l||void 0===l?void 0:l.children,b=null===l||void 0===l?void 0:l.infants,j=(null===(c=h)||void 0===c?void 0:c.map(e=>null===e||void 0===e?void 0:e.checkInDate))||[],C=[];
1return j.forEach(l=>{var d,t,r;let a=0;if(a+=null===(d=h)||void 0===d||null===(t=d.filter(e=>(null===e||void 0===e?void 0:e.checkInDate)===l))||void 0===t||null===(r=t[0])||void 0===r?void 0:r.priceBeforeTax,o>0&&!m){var s,u;let i=null===y||void 0===y||null===(s=y.filter(e=>(null===e||void 0===e?void 0:e.checkInDate)===l)[0])||void 0===s?void 0:s.priceBeforeTax,d=0;for(let e=0;e<o;e++)d+=i;if(null!==(u=n)&&void 0!==u&&u.some(i=>(null===i||void 0===i?void 0:i.adultCount)===e+o)){var v,c,p,f,g;let i=(null===(v=n)||void 0===v||null===(c=v.filter(i=>(null===i||void 0===i?void 0:i.adultCount)===e+o))||void 0===c||null===(p=c[0])||void 0===p?void 0:p.priceForPax)||[],t=null===i||void 0===i||null===(f=i.filter(e=>(null===e||void 0===e?void 0:e.checkInDate)===l))||void 0===f||null===(g=f[0])||void 0===g?void 0:g.priceBeforeTax;a=Math.min(t,a+d)}else a+=d}if(i>0&&!m){var x,_,j;let d=null===y||void 0===y||null===(x=y.filter(e=>(null===e||void 0===e?void 0:e.checkInDate)===l)[0])||void 0===x?void 0:x.priceBeforeTax,t=null===b||void 0===b||null===(_=b.filter(e=>(null===e||void 0===e?void 0:e.checkInDate)===l)[0])||void 0===_?void 0:_.priceBeforeTax,r=Math.min(d,t),s=0;for(let e=0;e<i;e++)s+=r;if(null!==(j=n)&&void 0!==j&&j.some(l=>(null===l||void 0===l?void 0:l.adultCount)===e+i+o)){var N,A,S,I,k;let d=(null===(N=n)||void 0===N||null===(A=N.filter(l=>(null===l||void 0===l?void 0:l.adultCount)===e+i+o))||void 0===A||null===(S=A[0])||void 0===S?void 0:S.priceForPax)||[],t=null===d||void 0===d||null===(I=d.filter(e=>(null===e||void 0===e?void 0:e.checkInDate)===l))||void 0===I||null===(k=I[0])||void 0===k?void 0:k.priceBeforeTax;a=Math.min(t,a+s)}else a+=s}let w={checkInDate:l,priceBeforeTax:a};C.push(w)}),C},{price:mo,taxAmount:ho,priceReduced:po}=(0,t.useMemo)(()=>{let e=0,o=0,i=[],l=0,n=!1;const d=null===Me||void 0===Me?void 0:Me.find(e=>(null===e||void 0===e?void 0:e.id)==="".concat(null===Y||void 0===Y?void 0:Y.id,"_").concat(G,"_").concat(X));let t=function(e,o,i,l,n,d,t,r){let a=e,s=o,u=i;const v=[];if(o>0&&!t||i>0&&!r)return[];let c=Math.ceil(e/d);if(c=Math.max(c,Math.ceil((e+o+i)/n)),(l=Math.min(l,(null===Se||void 0===Se?void 0:Se.maxRoomPerBooking)||1/0))<c)return[];if(o>0||i>0){for(let o=0;o<l;o++)a>0&&(v.push({adults:1,children:0,infants:0}),a--);for(;a>0;)v.push({adults:1,children:0,infants:0}),a--;for(const o of v){let e=n-o.adults;if(s>0&&e>0){const i=Math.min(s,t,e);o.children=i,s-=i,e-=i}if(u>0&&e>0){const i=Math.min(u,r,e);o.infants=i,u-=i}}if(a>0)for(let o=0;o<v.length&&a>0;o++){const e=v[o],i=n-(e.adults+e.children+e.infants),l=d-e.adults;if(i>0&&l>0){const o=Math.min(a,i,l);e.adults+=o,a-=o}}const e=0===a&&0===s&&0===u;for(let o=v.length-1;o>=0&&!(v.length<=c&&e);o--){const e=v[o];if(!(e.children>0||e.infants>0))for(let i=0;i<o;i++){const e=v[i],l=n-(e.adults+e.children+e.infants);if(e.adults<d&&l>=1){e.adults++,v.splice(o,1);break}}}}else{for(let e=0;e<l;e++)if(a>0){const e=Math.min(a,d);v.push({adults:e,children:0,infants:0}),a-=e}for(;a>0;){const e=Math.min(a,d);v.push({adults:e,children:0,infants:0}),a-=e}}return a>0||s>0||u>0?[]:v}(d?d.sAdult:Ie,d?d.sChild:ke,d?d.sInfant:we,U,null===Y||void 0===Y?void 0:Y.maxGuestCount,ao,null===Y||void 0===Y?void 0:Y.maxChildCount,null===Y||void 0===Y?void 0:Y.maxInfantCount);if(t.length>0){oo(t);for(let d=0;d<t.length;d++){var r,a,s,u;let m=co(null===(r=t[d])||void 0===r?void 0:r.adults,null===(a=t[d])||void 0===a?void 0:a.children,null===(s=t[d])||void 0===s?void 0:s.infants,Je[G],null===Xe||void 0===Xe?void 0:Xe.filter(e=>(null===e||void 0===e?void 0:e.ratePlanCode)===G));const h=(null===Xe||void 0===Xe?void 0:Xe.filter(e=>{var o,i,l;return(null===e||void 0===e?void 0:e.ratePlanCode)===G&&(null===e||void 0===e?void 0:e.adultCount)===(null===(o=t[d])||void 0===o?void 0:o.adults)&&(null===e||void 0===e?void 0:e.childCount)===(null===(i=t[d])||void 0===i?void 0:i.children)&&(null===e||void 0===e?void 0:e.infantCount)===(null===(l=t[d])||void 0===l?void 0:l.infants)}))||[];(null===h||void 0===h?void 0:h.length)>0&&(m=null===h||void 0===h?void 0:h.flatMap(e=>null===e||void 0===e?void 0:e.priceForPax));let p=new Set;if((null===Ee||void 0===Ee?void 0:Ee.some(e=>"nights"===(null===e||void 0===e?void 0:e.discountType)))&&m&&m.length>0){const e=m.map(e=>({price:null===e||void 0===e?void 0:e.priceBeforeTax,checkInDate:null===e||void 0===e?void 0:e.checkInDate}));if(e.sort((e,o)=>e.price-o.price),e.length>0&&e[0]){var v,c;const o=(0,N.O_)({arrangedPromos:Ee.filter(e=>"nights"===(null===e||void 0===e?void 0:e.discountType)),rp:{rpObject:ae,roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:null===(v=e[0])||void 0===v?void 0:v.price,checkInDate:null===(c=e[0])||void 0===c?void 0:c.checkInDate});if(o){const i=Math.min(o.discount,e.length);for(let o=0;o<i;o++)p.add(e[o].checkInDate)}}}null===(u=m)||void 0===u||u.forEach((d,t)=>{var r;let a=null===d||void 0===d?void 0:d.priceBeforeTax,s=null===d||void 0===d?void 0:d.checkInDate,u=(0,N.Kn)(Ee);u&&(u=(0,N.O_)({arrangedPromos:[u],rp:{rpObject:ae,roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:a,checkInDate:s}));let v=null,c=null;var m;if(u)if(null!==(m=u)&&void 0!==m&&m.isStack){let e=(null===Ee||void 0===Ee?void 0:Ee.filter(e=>!(0,N.UT)(e)))||[];v=(0,N.O_)({arrangedPromos:e,rp:{rpObject:ae,roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:a,checkInDate:s}),c=u}else v=u,c=null;else v=(0,N.O_)({arrangedPromos:Ee,rp:{rpObject:ae,roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:a,checkInDate:s});v&&i.push(v);let{finalValue:h,reducedPrice:f}=(0,N.um)({price:a,promo:v,idx:t,dateCount:Re,checkInDate:s,nightPromotionNights:p});if(c&&null!==(r=c)&&void 0!==r&&r.isStack){i.push(c);let e=(0,N.um)({price:h,promo:c,idx:t,dateCount:Re,checkInDate:s,nightPromotionNights:p});f+=e.reducedPrice,h=e.finalValue}let g=null;
1if(null!==Be&&void 0!==Be&&Be.id&&(g=(0,N.O_)({arrangedPromos:[Be],rp:{rpObject:ae,roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:null!==Be&&void 0!==Be&&Be.isStack?h:a,checkInDate:s}),g)){var x;let e=(0,N.um)({price:null!==Be&&void 0!==Be&&Be.isStack?h:a,promo:g,idx:t,dateCount:Re,checkInDate:s,nightPromotionNights:p});null!==(x=g)&&void 0!==x&&x.isStack?(f+=e.reducedPrice,h=e.finalValue,i.push(g)):(f=e.reducedPrice,h=e.finalValue,i=[g])}0===h&&(n=!0),l+=f;const _=(0,k.oT)({rooms:[{id:null===Y||void 0===Y?void 0:Y.id,amount:h}],isInclusive:null===Se||void 0===Se?void 0:Se.isTaxIncluded,taxes:Oe,noOfNights:1});e+=h,o+=null===_||void 0===_?void 0:_.totalRoomTax})}}else{var m;oo([]);let d=(null===Xe||void 0===Xe?void 0:Xe.filter(e=>(null===e||void 0===e?void 0:e.adultCount)===so&&(null===e||void 0===e?void 0:e.childCount)===uo&&(null===e||void 0===e?void 0:e.infantCount)===vo&&(null===e||void 0===e?void 0:e.ratePlanCode)===G))||[],t=co(so,uo,vo,Je[G],null===Xe||void 0===Xe?void 0:Xe.filter(e=>(null===e||void 0===e?void 0:e.ratePlanCode)===G));(null===d||void 0===d?void 0:d.length)>0&&(t=null===d||void 0===d?void 0:d.flatMap(e=>null===e||void 0===e?void 0:e.priceForPax));let r=new Set;if((null===Ee||void 0===Ee?void 0:Ee.some(e=>"nights"===(null===e||void 0===e?void 0:e.discountType)))&&t&&t.length>0){const e=t.map(e=>({price:null===e||void 0===e?void 0:e.priceBeforeTax,checkInDate:null===e||void 0===e?void 0:e.checkInDate}));if(e.sort((e,o)=>e.price-o.price),e.length>0&&e[0]){var h,p;const o=(0,N.O_)({arrangedPromos:Ee.filter(e=>"nights"===(null===e||void 0===e?void 0:e.discountType)),rp:{rpObject:ae,roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:null===(h=e[0])||void 0===h?void 0:h.price,checkInDate:null===(p=e[0])||void 0===p?void 0:p.checkInDate});if(o){const i=Math.min(o.discount,e.length);for(let o=0;o<i;o++)r.add(e[o].checkInDate)}}}null===(m=t)||void 0===m||m.forEach((d,t)=>{var a;let s=null===d||void 0===d?void 0:d.priceBeforeTax,u=null===d||void 0===d?void 0:d.checkInDate,v=(0,N.Kn)(Ee);v&&(v=(0,N.O_)({arrangedPromos:[v],rp:{rpObject:ae,roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:s,checkInDate:u}));let c=null,m=null;var h;if(v)if(null!==(h=v)&&void 0!==h&&h.isStack){let e=(null===Ee||void 0===Ee?void 0:Ee.filter(e=>!(0,N.UT)(e)))||[];c=(0,N.O_)({arrangedPromos:e,rp:{rpObject:ae,roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:s,checkInDate:u}),m=v}else c=v,m=null;else c=(0,N.O_)({arrangedPromos:Ee,rp:{rpObject:ae,roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:s,checkInDate:u});c&&i.push(c);let{finalValue:p,reducedPrice:f}=(0,N.um)({price:s,promo:c,idx:t,dateCount:Re,checkInDate:u,nightPromotionNights:r});if(m&&null!==(a=m)&&void 0!==a&&a.isStack){i.push(m);let e=(0,N.um)({price:p,promo:m,idx:t,dateCount:Re,checkInDate:u,nightPromotionNights:r});f+=e.reducedPrice,p=e.finalValue}let g=null;if(null!==Be&&void 0!==Be&&Be.id&&(g=(0,N.O_)({arrangedPromos:[Be],rp:{rpObject:ae,roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:null!==Be&&void 0!==Be&&Be.isStack?p:s,checkInDate:u}),g)){var x;let e=(0,N.um)({price:null!==Be&&void 0!==Be&&Be.isStack?p:s,promo:g,idx:t,dateCount:Re,checkInDate:u,nightPromotionNights:r});null!==(x=g)&&void 0!==x&&x.isStack?(f+=e.reducedPrice,p=e.finalValue,i.push(g)):(f=e.reducedPrice,p=e.finalValue,i=[g])}0===p&&localStorage.getItem("corporateAgentId")&&(n=!0),l+=f;const _=(0,k.oT)({rooms:[{id:null===Y||void 0===Y?void 0:Y.id,amount:p}],isInclusive:null===Se||void 0===Se?void 0:Se.isTaxIncluded,taxes:Oe,noOfNights:1});e+=p,o+=null===_||void 0===_?void 0:_.totalRoomTax})}if(n&&localStorage.getItem("corporateAgentId"))return{price:0,taxAmount:0,priceReduced:0};if(e>0){var f;const i=null!==(f=y.A.get("lowestPrice"))&&void 0!==f?f:1/0;y.A.set("lowestPrice",Math.min(i,e+o))}return{price:Number(e),taxAmount:Number(o),priceReduced:Number(l)}},[Xe,G,Ie,ke,we,Me,ue,Oe,De,Be]);(0,t.useEffect)(()=>{Y&&mo&&ee&&ee(null===Y||void 0===Y?void 0:Y.roomName,mo)},[Y,mo]),console.count("room",1);const fo=(0,t.useMemo)(()=>{var e;return null===Me||void 0===Me||null===(e=Me.filter(e=>(null===e||void 0===e?void 0:e.id)==="".concat(null===Y||void 0===Y?void 0:Y.id,"_").concat(G,"_").concat(X)))||void 0===e?void 0:e.length},[Me]),go=(0,t.useMemo)(()=>null===Me||void 0===Me?void 0:Me.filter(e=>(null===e||void 0===e?void 0:e.id)==="".concat(null===Y||void 0===Y?void 0:Y.id,"_").concat(G,"_").concat(X)),[Me]),xo=(0,t.useMemo)(()=>{var e;return null===Me||void 0===Me||null===(e=Me.filter(e=>(null===e||void 0===e?void 0:e.roomId)===(null===Y||void 0===Y?void 0:Y.id)))||void 0===e?void 0:e.length},[Me]),[_o]=(0,t.useMemo)(()=>{var e,o;return null===Me||void 0===Me||null===(e=Me.filter(e=>(null===e||void 0===e?void 0:e.roomId)===(null===Y||void 0===Y?void 0:Y.id)&&G===(null===e||void 0===e?void 0:e.code)))||void 0===e||null===(o=e.sort((e,o)=>(null===e||void 0===e?void 0:e.index)-(null===o||void 0===o?void 0:o.index)))||void 0===o?void 0:o.slice(-1)},[Me]),yo=async()=>
1{if(console.log("called?"),ce)return;if(me(!0),V&&(null===Me||void 0===Me?void 0:Me.length)>=V)return h.A.error("Hotel does not allow more than ".concat(V," rooms in a single reservation.")),void me(!1);const e=d()(null===De||void 0===De?void 0:De.startDate),o=d()(null===De||void 0===De?void 0:De.endDate).diff(e,"day");if(null!==Se&&void 0!==Se&&Se.minBookingNights&&o<Se.minBookingNights)return h.A.error("Minimum booking nights required: ".concat(Se.minBookingNights)),void me(!1);if(await jo(xo+1)){if(xo<U){try{(0,j.pushRoomSelectedEvent)({room:Y,hotelData:Se,dateRange:De,price:mo,numberOfRooms:xo+1,totalAdult:Ie,totalChild:ke,totalInfant:we,promotions:Ee})}catch(s){console.error("Analytics tracking error (room_selected):",s)}(0,j.pushRoomAddedEvent)({room:Y,hotelData:Se,dateRange:De,price:mo,numberOfRooms:xo+1,totalAdult:Ie,totalChild:ke,totalInfant:we,promotions:Ee})}try{if(xo<U){var i;const e=Math.max(Math.min(uo,$e-so,Ke),0),o=Math.max(Math.min(vo,$e-so-e,Ze),0);let s={sAdult:so,sChild:e,sInfant:o,code:G,roomId:null===Y||void 0===Y?void 0:Y.id,rpObject:ae,id:"".concat(null===Y||void 0===Y?void 0:Y.id,"_").concat(G,"_").concat(X),idx:((null===_o||void 0===_o?void 0:_o.idx)||0)+1,RoomImages:null===Y||void 0===Y?void 0:Y.RoomImages,roomName:null===Y||void 0===Y?void 0:Y.roomName};(0,j.fireGtmEvent)("room_added",s);const u={content_ids:[null===Y||void 0===Y?void 0:Y.id],content_type:"hotel_room",value:parseFloat(mo),currency:(null===Se||void 0===Se?void 0:Se.currency)||"INR",contents:[{id:null===Y||void 0===Y?void 0:Y.id,quantity:1}],num_items:1,num_adults:so,num_children:uo+vo,checkin_date:d()(null===De||void 0===De?void 0:De.startDate).format("YYYY-MM-DD"),checkout_date:d()(null===De||void 0===De?void 0:De.endDate).format("YYYY-MM-DD")};if((0,j.newFBEvents)("AddToCart",u),window&&null!==(i=window)&&void 0!==i&&i.gtag){var l,n,t,r,a;const e=null!==(l=null!==(n=null===Se||void 0===Se?void 0:Se.chainId)&&void 0!==n?n:y.A.get("chainId"))&&void 0!==l?l:"",o=null!==(t=null!==(r=null===Se||void 0===Se?void 0:Se.name)&&void 0!==r?r:y.A.get("hotelName"))&&void 0!==t?t:"";null===(a=window)||void 0===a||a.gtag("event","add_to_cart",{chain_id:String(e||""),chainId:e?Number(e):null,hotel_id:String((null===Se||void 0===Se?void 0:Se.id)||""),hotelId:null!==Se&&void 0!==Se&&Se.id?Number(null===Se||void 0===Se?void 0:Se.id):null,hotel_name:String(o||""),hotelName:String(o||""),booking_source:y.A.get("source")||"Direct",value:mo,currency:(null===Se||void 0===Se?void 0:Se.currency)||"INR",items:[{id:null===Se||void 0===Se?void 0:Se.id,price:mo,item_id:null===Se||void 0===Se?void 0:Se.id,item_name:null===Y||void 0===Y?void 0:Y.roomName,item_category:String(e||""),quantity:1,start_date:d()(null===De||void 0===De?void 0:De.startDate).format("YYYY-MM-DD"),end_date:d()(null===De||void 0===De?void 0:De.endDate).format("YYYY-MM-DD"),google_business_vertical:"hotel_rental"}]})}let v={hotelId:null===Se||void 0===Se?void 0:Se.id,roomIds:[null===s||void 0===s?void 0:s.roomId],checkInDate:d()(De.startDate).format("YYYY-MM-DD"),checkOutDate:d()(De.endDate).format("YYYY-MM-DD"),roomCount:xo+1};Qe((0,x.$l)(s,v,0,()=>me(!1))),!te&&No({ratePlanCode:G})}else h.A.error(So("Maximum room count reached!")),me(!1),(0,j.fireGtmEvent)("room_availability_error",{hotelId:null===Se||void 0===Se?void 0:Se.id,roomIds:[null===Y||void 0===Y?void 0:Y.id],checkInDate:d()(null===De||void 0===De?void 0:De.startDate).format("YYYY-MM-DD"),checkOutDate:d()(null===De||void 0===De?void 0:De.endDate).format("YYYY-MM-DD"),roomCount:xo})}catch(s){(0,j.fireGtmEvent)("add_rp_error",s),me(!1)}}else me(!1)};let bo=null===Se||void 0===Se||null===(r=Se.HotelRooms)||void 0===r?void 0:r.find(e=>e.id===(null===Y||void 0===Y?void 0:Y.id));const jo=async function(){var e,o;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const l=y.A.get("utmObj");if("verification"===(null===l||void 0===l?void 0:l.googleSource))return i;let n={hotelId:null===Se||void 0===Se?void 0:Se.id,roomIds:[null===Y||void 0===Y?void 0:Y.id],checkInDate:d()(De.startDate).format("YYYY-MM-DD"),checkOutDate:d()(De.endDate).format("YYYY-MM-DD"),roomCount:i,initialRoomCount:null!==(e=null===bo||void 0===bo?void 0:bo.availableRooms)&&void 0!==e?e:0,ratePlanCode:G};const t=await(0,P.N7)(n);var r;(Qe({type:_.A.SET_UPDATED_ROOM_COUNT,payload:{id:null===Y||void 0===Y?void 0:Y.id,value:"axisrooms"===(null===Se||void 0===Se||null===(o=Se.VendorHotelDataDistribution)||void 0===o?void 0:o.vendor)?null===bo||void 0===bo?void 0:bo.availableRooms:null===t||void 0===t?void 0:t.data}}),null!==t&&void 0!==t&&t.data)||(W("axisrooms"===((null===Se||void 0===Se||null===(r=Se.VendorHotelDataDistribution)||void 0===r?void 0:r.vendor)&&(null===t||void 0===t?void 0:t.data))?null===bo||void 0===bo?void 0:bo.availableRooms:null===t||void 0===t?void 0:t.data),(0,j.fireGtmEvent)("room_availability_error",n),h.A.error("Room sold out, please select other available room."));return null===t||void 0===t?void 0:t.data},Co=async()=>
1{if(ce)return;if(V&&(null===Me||void 0===Me?void 0:Me.length)>=V)return h.A.error("Hotel does not allow more than ".concat(V," rooms in a single reservation.")),void me(!1);me(!0);const e=d()(null===De||void 0===De?void 0:De.startDate),o=d()(null===De||void 0===De?void 0:De.endDate).diff(e,"day");if(null!==Se&&void 0!==Se&&Se.minBookingNights&&o<Se.minBookingNights)return h.A.error("Minimum booking nights required: ".concat(Se.minBookingNights)),void me(!1);if(await jo(xo+eo.length)){try{(0,j.pushRoomSelectedEvent)({room:Y,hotelData:Se,dateRange:De,price:mo,numberOfRooms:eo.length,totalAdult:Ie,totalChild:ke,totalInfant:we,promotions:Ee}),(0,j.pushRoomAddedEvent)({room:Y,hotelData:Se,dateRange:De,price:mo,numberOfRooms:eo.length,totalAdult:Ie,totalChild:ke,totalInfant:we,promotions:Ee})}catch(i){console.error("Analytics tracking error (room_selected):",i)}try{(0,j.fireGtmEvent)("searchRoom_added",{searchData:eo,room:Y});try{const e=eo.reduce((e,o)=>e+((null===o||void 0===o?void 0:o.adults)||0),0),o=eo.reduce((e,o)=>e+((null===o||void 0===o?void 0:o.children)||0)+((null===o||void 0===o?void 0:o.infants)||0),0),i={content_ids:[null===Y||void 0===Y?void 0:Y.id],content_type:"hotel_room",value:parseFloat(mo*eo.length),currency:(null===Se||void 0===Se?void 0:Se.currency)||"INR",contents:[{id:null===Y||void 0===Y?void 0:Y.id,quantity:eo.length}],num_items:eo.length,num_adults:e,num_children:o,checkin_date:d()(null===De||void 0===De?void 0:De.startDate).format("YYYY-MM-DD"),checkout_date:d()(null===De||void 0===De?void 0:De.endDate).format("YYYY-MM-DD")};(0,j.newFBEvents)("AddToCart",i)}catch(l){console.log("pixel failed")}eo.forEach((e,o)=>{if(xo>=U)return h.A.error(So("Maximum room count reached!")),void me(!1);let i={sAdult:e.adults,sChild:e.children,sInfant:e.infants,code:G,roomId:null===Y||void 0===Y?void 0:Y.id,rpObject:ae,id:"".concat(null===Y||void 0===Y?void 0:Y.id,"_").concat(G,"_").concat(X),idx:(o||0)+1,RoomImages:null===Y||void 0===Y?void 0:Y.RoomImages,roomName:null===Y||void 0===Y?void 0:Y.roomName},l={hotelId:null===Se||void 0===Se?void 0:Se.id,roomIds:[null===i||void 0===i?void 0:i.roomId],checkInDate:d()(De.startDate).format("YYYY-MM-DD"),checkOutDate:d()(De.endDate).format("YYYY-MM-DD"),roomCount:xo+eo.length};console.log("this called2",i,l,o),Qe((0,x.$l)(i,l,o,()=>me(!1))),!te&&No({ratePlanCode:G})})}catch(i){(0,j.fireGtmEvent)("add_rp_error",i),me(!1)}}else me(!1)},No=e=>{var o,i,l,n,d,t;let{ratePlanCode:r}=e;if(Ye)return;const a=null===Fe||void 0===Fe?void 0:Fe.roomUpgrade,s="manual"===(null===a||void 0===a?void 0:a.mode)?null===a||void 0===a||null===(o=a.mapping)||void 0===o?void 0:o[null===Y||void 0===Y?void 0:Y.id]:null,u=Boolean(s&&String(s)!==String(null===Y||void 0===Y?void 0:Y.id)),v=(null===(i=de[0])||void 0===i?void 0:i.id)===(null===Y||void 0===Y?void 0:Y.id);if(!u&&!v)return;if(u){var c,m,h,p;const e=null===de||void 0===de?void 0:de.find(e=>{var o;return String(e.id)===String(s)&&e.availableRooms>0&&(null===(o=e.pricing)||void 0===o?void 0:o.length)>0}),o=((e,o)=>{var i,l;if(!e)return null;const n=null===e||void 0===e||null===(i=e.pricing)||void 0===i?void 0:i.find(e=>(null===e||void 0===e?void 0:e.ratePlanCode)===o);if(null!==e&&void 0!==e&&null!==(l=e.ratePlans)&&void 0!==l&&l[o]&&n)return o;const d=new Set(((null===e||void 0===e?void 0:e.pricing)||[]).map(e=>null===e||void 0===e?void 0:e.ratePlanCode)),t=Object.keys((null===e||void 0===e?void 0:e.ratePlans)||{}).reduce((o,i)=>{var l,n,t,r,a,s;return d.has(i)&&(null!==(l=null===(n=e.ratePlans[i])||void 0===n||null===(t=n.prices)||void 0===t?void 0:t.priceAfterDiscount)&&void 0!==l?l:1/0)<(o&&null!==(r=null===(a=e.ratePlans[o])||void 0===a||null===(s=a.prices)||void 0===s?void 0:s.priceAfterDiscount)&&void 0!==r?r:1/0)?i:o},null);return t&&d.has(t)?t:null})(e,r),i=null!==(c=null===e||void 0===e||null===(m=e.ratePlans)||void 0===m||null===(h=m[o])||void 0===h||null===(p=h.prices)||void 0===p?void 0:p.priceAfterDiscount)&&void 0!==c?c:1/0;if(e&&o&&i>mo)return((e,o)=>{var i,l,n,d,t,r;const a=(null===e||void 0===e||null===(i=e.ratePlans)||void 0===i||null===(l=i[o])||void 0===l||null===(n=l.prices)||void 0===n?void 0:n.priceAfterDiscount)||1/0;return Qe({type:_.A.SET_UPSELL,payload:{room:e,ratePlanCode:o,price:null===e||void 0===e||null===(d=e.pricing)||void 0===d||null===(t=d.find(e=>(null===e||void 0===e?void 0:e.ratePlanCode)===o))||void 0===t||null===(r=t.priceForPax)||void 0===r?void 0:r.reduce((e,o)=>e+o.priceBeforeTax,0),currentRoom:Y,currentRatePlanCode:G,priceDiffrence:a-mo,selected:!1}}),e})(e,o);if(!v)return}let f=!1;const g=null===de||void 0===de?void 0:de.filter(e=>{var o;return e.id===Y.id&&(f=!0),e.availableRooms>0&&e.id!==Y.id&&(null===(o=e.pricing)||void 0===o?void 0:o.length)>0&&f});if(!g||0===g.length)return null;const x=mo;let y=null;console.log({availableRooms:g});const b=g.find(e=>{var o,i,l,n,d,t;let a=null===e||void 0===e||null===(o=e.ratePlans)||void 0===o?void 0:o[r],s=new Set;if(null===e||void 0===e||null===(i=e.pricing)||void 0===i||i.forEac
1h(e=>{s.add(null===e||void 0===e?void 0:e.ratePlanCode)}),!a||null===e||void 0===e||null===(l=e.pricing)||void 0===l||!l.find(e=>(null===e||void 0===e?void 0:e.ratePlanCode)===r)){var u,v,c;const o=null!==e&&void 0!==e&&e.ratePlans?Object.keys(null===e||void 0===e?void 0:e.ratePlans).reduce((o,i)=>{var l,n,d,t;return s.has(i)&&((null===e||void 0===e||null===(l=e.ratePlans[i])||void 0===l||null===(n=l.prices)||void 0===n?void 0:n.priceAfterDiscount)||1/0)<((null===e||void 0===e||null===(d=e.ratePlans[o])||void 0===d||null===(t=d.prices)||void 0===t?void 0:t.priceAfterDiscount)||1/0)?i:o},Object.keys(null===e||void 0===e?void 0:e.ratePlans)[0]):null;return r=o||r,a=o?null===e||void 0===e||null===(u=e.ratePlans)||void 0===u?void 0:u[o]:a,!((null===(v=a)||void 0===v||null===(c=v.prices)||void 0===c?void 0:c.priceAfterDiscount)<=mo)}const m=(null===e||void 0===e||null===(n=e.ratePlans)||void 0===n||null===(d=n[r])||void 0===d||null===(t=d.prices)||void 0===t?void 0:t.priceAfterDiscount)||1/0;return console.log({roomPrice:m,currentRoomPrice:x,name:null===e||void 0===e?void 0:e.roomName}),m>x});y=(null===b||void 0===b||null===(l=b.ratePlans)||void 0===l||null===(n=l[r])||void 0===n||null===(d=n.prices)||void 0===d?void 0:d.priceAfterDiscount)||1/0;const j=b&&(null===b||void 0===b?void 0:b.ratePlans[r])&&(null===b||void 0===b||null===(t=b.pricing)||void 0===t?void 0:t.find(e=>(null===e||void 0===e?void 0:e.ratePlanCode)===r));var C,N,A;return b&&j?(Qe({type:_.A.SET_UPSELL,payload:{room:b,ratePlanCode:r,price:null===b||void 0===b||null===(C=b.pricing)||void 0===C||null===(N=C.find(e=>(null===e||void 0===e?void 0:e.ratePlanCode)===r))||void 0===N||null===(A=N.priceForPax)||void 0===A?void 0:A.reduce((e,o)=>e+o.priceBeforeTax,0),currentRoom:Y,currentRatePlanCode:G,priceDiffrence:y-x,selected:!1}}),b):null},Ao=()=>{if(xo>0){var e,o,i;(0,j.fireGtmEvent)("room_removed",{roomId:null===Y||void 0===Y?void 0:Y.id});const n={content_ids:[null===Y||void 0===Y?void 0:Y.id],content_type:"hotel_room",value:parseFloat(mo),currency:(null===Se||void 0===Se?void 0:Se.currency)||"INR",contents:[{id:null===Y||void 0===Y?void 0:Y.id,quantity:1}],num_items:1,num_adults:so,num_children:uo+vo,checkin_date:d()(null===De||void 0===De?void 0:De.startDate).format("YYYY-MM-DD"),checkout_date:d()(null===De||void 0===De?void 0:De.endDate).format("YYYY-MM-DD")};var l;if((0,j.newFBEvents)("RemoveFromCart",n),103376===(null===Se||void 0===Se?void 0:Se.userId)&&window&&null!==(e=window)&&void 0!==e&&e.gtag)null===(l=window)||void 0===l||l.gtag("event","remove_from_cart",{value:mo,currency:null===Se||void 0===Se?void 0:Se.currency,items:[{id:null===Se||void 0===Se?void 0:Se.id,price:mo,item_id:null===Se||void 0===Se?void 0:Se.id,item_name:null===Y||void 0===Y?void 0:Y.roomName,start_date:d()(null===De||void 0===De?void 0:De.startDate).format("YYYY-MM-DD"),end_date:d()(null===De||void 0===De?void 0:De.endDate).format("YYYY-MM-DD"),google_business_vertical:"hotel_rental"}]});Qe({type:_.A.DESELECT_RP,payload:"".concat(null===Y||void 0===Y?void 0:Y.id,"_").concat(G,"_").concat(X)});1===(null===Me||void 0===Me||null===(o=Me.filter(e=>(null===e||void 0===e?void 0:e.roomId)===(null===Y||void 0===Y?void 0:Y.id)&&(null===e||void 0===e?void 0:e.code)===G))||void 0===o?void 0:o.length)&&(null===Ye||void 0===Ye||null===(i=Ye.currentRoom)||void 0===i?void 0:i.id)===(null===Y||void 0===Y?void 0:Y.id)&&(null===Ye||void 0===Ye?void 0:Ye.currentRatePlanCode)===G&&Qe({type:_.A.SET_UPSELL,payload:null})}},{t:So}=(0,a.Bd)();(0,t.useEffect)(()=>{var e;!Ye||(null===Ye||void 0===Ye||null===(e=Ye.currentRoom)||void 0===e?void 0:e.id)!==(null===Y||void 0===Y?void 0:Y.id)||(null===Ye||void 0===Ye?void 0:Ye.currentRatePlanCode)!==G||null!==Ye&&void 0!==Ye&&Ye.selected||(0,j.fireGtmEvent)("upsell_shown",(0,l.A)((0,l.A)({},Ye),{},{type:"card"}))},[G,null===Y||void 0===Y?void 0:Y.id,null===Ye||void 0===Ye||null===(u=Ye.currentRoom)||void 0===u?void 0:u.id,null===Ye||void 0===Ye?void 0:Ye.currentRatePlanCode,null===Ye||void 0===Ye?void 0:Ye.selected,Ye]);const[Io,ko]=(0,t.useState)(!1),wo=y.A.get("utmObj"),Do=!!localStorage.getItem("corporateAgentId");return(0,E.jsxs)(E.Fragment,{children:[(mo>0||!1===(null===se||void 0===se?void 0:se.meetsMLOS))&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"rateplanContainer",id:"rateplan-".concat(null===Y||void 0===Y?void 0:Y.id,"-").concat(G),children:[(0,E.jsxs)("div",{className:"ratePlanBox",children:[(0,E.jsxs)("div",{className:"ratePlanDetails",children:[(0,E.jsxs)("div",{className:"rpWrapper",children:[!(null!==Y&&void 0!==Y&&null!==(v=Y.roomName)&&void 0!==v&&null!==(c=v.toLowerCase())&&void 0!==c&&c.includes("suite"))&&(null===ae||void 0===ae||null===(m=ae.name)||void 0===m||null===(g=m.toLowerCase())||void 0===g?void 0:g.includes("room only"))&&!k.v.includes(null===Se||void 0===Se?void 0:Se.id)&&!k.iK.includes(null===Se||void 0===Se?void 0:Se.id)&&0===X&&(0,E.jsx)("p",{style:(0,l.A)((0,l.A)({},Q),{},{marginLeft:"-2px",color:"#5925DC",border:"1px solid #D9D6FE",backgroundColor:"#F4F3FF"}),className:"countWidget",children:"Only ".concat((null===Y||void 0===Y?void 0:Y.availableRooms)>3?Math.floor(2*Math.random())+2:null===Y||void 0===Y?void 0:Y.availableRooms," ").concat(1===(null===Y||void 0===Y?void 0:Y.availableRooms)?"room":"rooms"," left at this price!")}),(null===Y||void 0===Y||null===(b=Y.roomName)||void 0===b||null===(C=b.toLowerCase())||void 0===C?void 0:C.includes("suite"))&&(null===ae||void 0===ae||null===(A=ae.name)||void 0===A||null===(S=A.toLowerCase())||void 0===S?void 0:S.includes("room only"))&&0===X&&(null===xe||void 0===xe?void 0:xe.map(e=>(null===e||void 0===e?void 0:e.roomName)===(null===Y||void 0===Y?void 0:Y.roomName)?(0,E.jsx)("p",{style:(0,l.A)((0,l.A)({},Q),{},{marginLeft:"-2px",color:"#5925DC",border:"1px solid #D9D6FE",backgroundColor:"#F4F3FF"}),className:"countWidget",children:"Hurry! Only ".concat((null===Y||void 0===Y?void 0:Y.availableRooms)>3?Math.floor(2*Math.random())+2:null===Y||void 0===Y?void 0:Y.availableRooms," ").concat(1===(null===Y||void 0===Y?void 0:Y.availableRooms)?"suite":"suites"," remaining for your dates")}):null)),(null===ye||void 0===ye?void 0:ye.name)&&Ne&&(0,E.jsx)("div",{className:"secretMemberTitleBox",children:(0,E.jsx)("h3",{children:null===ye||void 0===ye?void 0:ye.name})}),(0,E.jsx)("p",{style:{fontWeight:"bold",fontSize:"1rem"},children:null===ae||void 0===ae?void 0:ae.name}),(null===ae||void 0===ae?void 0:ae.description)&&(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{style:{position:"relative"},children:[(0,E.jsx)("p",{className:"rateplanDescription",ref:no,style:{whiteSpace:"pre-line",maxHeight:"5.1em",overflow:"hidden",lineHeight:"1.7",margin:0},children:ae.description}),to&&(0,E.jsx)("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"1.8em",background:"linear-gradient(transparent, #fff)",pointerEvents:"none"}})]}),to&&(0,E.jsxs)("button",{type:"button",onClick:()=>lo(!0),style:{display:"inline-flex",alignItems:"center",gap:"3px",marginTop:"4px",background:"none",border:"none",padding:0,fontSize:"0.78rem",fontWeight:"600",color:"var(--blue)",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:"2px",position:"relative",zIndex:1},children:["View more",(0,E.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",style:{flexShrink:0,marginTop:"1px"},children:(0,E.jsx)("path",{d:"M2.5 4L5.5 7L8.5 4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),(null===ae||void 0===ae||null===(I=ae.inclusions)||void 0===I?void 0:I.length)&&(null===ae||void 0===ae||null===(w=ae.inclusions)||void 0===w||null===(D=w.slice(0,2))||void 0===D?void 0:D.map(e=>(0,E.jsx)("div",{className:"rpInclusionContainer",children:(0,E.jsxs)("div",{className:"rpInclusionBox",children:[(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/rp_inclusion_icon.svg",alt:"","aria-hidden":"true"}),(0,E.jsx)("p",{children:null===e||void 0===e?void 0:e.description})]})},null===e||void 0===e?void 0:e.id)))]}),(null===We||void 0===We?void 0:We.length)>0&&(0,E.jsxs)(E.Fragment,{children:[" ",(null===je||void 0===je?void 0:je.hasFreeCancellation)&&(0,E.jsx)("div",{style:{display:"flex",alignItems:"center",gap:"5px",color:"#006400",fontSize:"14px",fontWeight:"600"},children:(0,E.jsxs)("span",{children:["Book risk free, cancel for free anytime before"," ",null===(M=je.free
1CancellationDate)||void 0===M?void 0:M.format("MMM D, YYYY")]})})]}),(0,E.jsxs)("div",{className:"inclusionBox",children:[(null===ae||void 0===ae||null===(O=ae.inclusions)||void 0===O?void 0:O.length)>2&&(0,E.jsx)("p",{className:"showInclusionBtn",onClick:()=>lo(!0),children:"See all inclusions"}),We.length>0&&(0,E.jsx)(E.Fragment,{children:(0,E.jsx)("p",{onClick:()=>{ko(!Io),Io?(0,j.fireGtmEvent)("cancelClosedLandingPage"):(0,j.fireGtmEvent)("cancelViewedLandingPage")},className:"policyLabel",style:{cursor:"pointer"},children:So("cancellation_refund_policy")})})]})]}),(0,E.jsx)("div",{className:"rateplanInfo",children:(0,E.jsxs)("div",{className:"ratePlanPriceBox",children:[(0,E.jsxs)("div",{className:"rateplanName",children:[po>0?(0,E.jsxs)("div",{children:[(0,E.jsxs)("b",{style:{fontSize:"0.8rem",display:"flex",gap:"5px"},children:[(0,E.jsx)("p",{className:"discountedPrice",children:(0,E.jsx)(L.A,{amount:(mo+po)*z/Re})}),(0,E.jsxs)("p",{style:{textDecoration:"none",color:"var(--green)",whiteSpace:"nowrap"},children:[(0,E.jsx)(L.A,{amount:Number(po*z/Re)})," ",So("off")]})]}),(0,E.jsxs)("p",{style:{fontSize:"1.1rem",margin:0},children:[(0,E.jsx)(L.A,{amount:mo*z/Re})," ","/ ",(0,E.jsx)("span",{style:{fontSize:"0.8rem",fontWeight:400,color:"#4a4a4a"},children:So(1===Re?"night":"Night")}),ho>0&&(0,E.jsxs)("span",{style:{color:"#4a4a4a",fontSize:"0.8rem",fontWeight:400,marginLeft:"4px",textTransform:"lowercase"},children:[So("Plus")," ",So("taxes")]})]})]}):(0,E.jsxs)("p",{style:{fontSize:"1.1rem",margin:0},children:[(0,E.jsx)(L.A,{amount:Number(mo/Re)})," ","/ ",(0,E.jsx)("span",{style:{fontSize:"0.8rem",fontWeight:400,color:"#4a4a4a"},children:So("night")}),ho>0&&(0,E.jsxs)("span",{style:{color:"#4a4a4a",fontSize:"0.8rem",fontWeight:400,marginLeft:"4px",textTransform:"lowercase"},children:[So("plus")," ",So("taxes")]})]}),eo.length>0?(()=>{const e=null===Me||void 0===Me?void 0:Me.find(e=>(null===e||void 0===e?void 0:e.id)==="".concat(null===Y||void 0===Y?void 0:Y.id,"_").concat(G,"_").concat(X)),o=e?e.sAdult+e.sChild+e.sInfant:Pe;return(0,E.jsxs)("p",{children:[" ",So("price_for")," ",o," ",So((0,k.g3)(o,"guest"))]})})():(0,E.jsxs)("p",{children:[" ",So("price_for")," ",so," ",So((0,k.g3)(so,"Adult"))]}),Ae?(0,E.jsxs)("span",{children:["(This room can accommodate up to ",$e||1," ","guests)"]}):null]}),(0,E.jsx)("div",{className:"rateplanPrice",children:!1===(null===se||void 0===se?void 0:se.meetsMLOS)?(0,E.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",padding:"10px 16px",backgroundColor:"var(--blue-in-range)",border:"1px solid var(--blue-solid)",borderRadius:"8px",cursor:"not-allowed",width:"100%"},children:[(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"13px",color:"var(--blue-solid)",fontWeight:"600"},children:[(0,E.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0},children:(0,E.jsx)("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM11 15H9V13H11V15ZM11 11H9V5H11V11Z",fill:"var(--blue-solid)"})}),(0,E.jsxs)("span",{children:["Min ",se.minLOS," Nights Required"]})]}),(0,E.jsx)("div",{style:{fontSize:"11px",color:"var(--blue-solid)",textAlign:"center",lineHeight:"1.3"},children:"Extend your stay to unlock"})]}):0===fo?(0,E.jsx)("div",{className:"selectRoomRoom",onClick:()=>{Qe({type:_.A.SET_CONTINUE_BOOKING,payload:!1}),eo.length>0?Co():yo()},children:ce?(0,E.jsx)(p.A,{}):So("select")}):(0,E.jsxs)("div",{className:"incrementer roomCom",style:{width:"100%",justifyContent:"space-between"},children:[(0,E.jsx)("div",{onClick:Ao,className:"decrement roomInc",children:"-"}),(0,E.jsx)("div",{className:"incrementer__value roomVal",children:fo}),(0,E.jsx)("div",{onClick:yo,className:"increment roomInc",children:"+"})]})})]})})]}),Ye&&(null===Ye||void 0===Ye||null===(T=Ye.currentRoom)||void 0===T?void 0:T.id)===(null===Y||void 0===Y?void 0:Y.id)&&(null===Ye||void 0===Ye?void 0:Ye.currentRatePlanCode)===G&&!(null!==Ye&&void 0!==Ye&&Ye.selected)&&"verification"!==(null===wo||void 0===wo?void 0:wo.googleSource)&&Number.isFinite(null===Ye||void 0===Ye?void 0:Ye.priceDiffrence)&&(0,E.jsx)($,{currentRoom:null===Ye||void 0===Ye?void 0:Ye.currentRoom,upgradedRoom:null===Ye||void 0===Ye?void 0:Ye.room,priceDifference:null===Ye||void 0===Ye?void 0:Ye.priceDiffrence,onUpgradeClick:()=>{var e;Ao(),Qe({type:_.A.SET_UPSELL,payload:(0,l.A)((0,l.A)({},Ye),{},{selected:!0})});const o=document.getElementById("room-".concat(null===Ye||void 0===Ye||null===(e=Ye.room)||void 0===e?void 0:e.id));o&&o.scrollIntoView({behavior:"smooth",block:"start"}),(0,j.fireGtmEvent)("room_upsell_upgraded",(0,l.A)((0,l.A)({},Ye),{},{type:"card"}))},onDismiss:()=>{Qe({type:_.A.SET_UPSELL,payload:null}),(0,j.fireGtmEvent)("room_upsell_dismissed",(0,l.A)((0,l.A)({},Ye),{},{type:"card"}))}}),(0,E.jsx)("div",{className:"newSelectionContainer",children:Array.from({length:fo}).map((e,o)=>{var i,l,n,d;return(0,E.jsx)(re,{thisPlan:go[o],id:o+1,defaultGuestCount:null===Y||void 0===Y?void 0:Y.defaultGuestCount,maxAdultCount:ao,maxGuestCount:$e,childAgeSplit:(null===Y||void 0===Y?void 0:Y.childAgeSplit)||12,childAgeLimit:(null===Y||void 0===Y?void 0:Y.childAgeLimit)||18,extraChildPrice:null===Y||void 0===Y||null===(i=Y.pricingAdditionalGuests)||void 0===i||null===(l=i[G])||void 0===l?void 0:l.children,extraInfantPrice:null===Y||void 0===Y||null===(n=Y.pricingAdditionalGuests)||void 0===n||null===(d=n[G])||void 0===d?void 0:d.infants,room:Y},o)})}),U>0&&!Do&&(0,E.jsx)(B,{price:(Number(mo)/Math.max(Re,1)).toFixed((0,k.S2)(null===Se||void 0===Se?void 0:Se.currency)),isRatePlan:!0,getMembershipDetails:(e,o)=>be({name:e,description:o}),getSecretMemberDealUrl:ie,applyPromotion:le,promotionRes:ne,room:Y})]}),(0,E.jsxs)("div",{style:{width:"100%"},children:[We.length>0&&(0,E.jsx)("div",{className:"newSelectionContainer",style:{width:"fit-content",curs
1or:"pointer"},children:(0,E.jsx)(R.A,{cancellationPolicy:fe,setCancellationPolicy:ge,dateRange:De,noMargin:!0,rpObject:ae,cancelShown:We,room:Y,showCancellation:Io,onFreeCancellationData:Ce})}),he&&(0,E.jsx)(f.A,{isOpen:he,setIsOpen:pe,children:(0,E.jsxs)("div",{className:"rpCancelPolicyContainer",children:[(0,E.jsxs)("div",{className:"rpCancelClose",children:[(0,E.jsx)("p",{children:So("cancellation_policy")}),(0,E.jsx)("p",{style:{cursor:"pointer"},onClick:()=>pe(!1),children:"X"})]}),(0,E.jsx)("div",{className:"rpCancelPolicy",children:null!==We&&void 0!==We&&We.some(e=>999==(null===e||void 0===e?void 0:e.Days_Before))?(0,E.jsx)("p",{children:"Non Refundable - 100% of the money will be charged upon cancellation."}):We.map((e,o)=>{let i={nights:"nights",percent:"%",fixed:null===Se||void 0===Se?void 0:Se.currency};return(0,E.jsxs)("p",{children:["\u2022"," ",0===(null===e||void 0===e?void 0:e.Days_Before)?"".concat(So("Incase of No Show / Cancelling on day of Checkin will incur")," ").concat(null===e||void 0===e?void 0:e.Penalty_Value).concat(i[null===e||void 0===e?void 0:e.Penalty_Type]," ").concat(So("penalty"),"."):"nights"===(null===e||void 0===e?void 0:e.Penalty_Type)?"".concat(So("Cancelling")," ").concat(null===e||void 0===e?void 0:e.Days_Before," ").concat((0,k.g3)(null===e||void 0===e?void 0:e.Days_Before,"day")," ").
1concat(So("before arrival incurs a")," ").concat(null===e||void 0===e?void 0:e.Penalty_Value).concat((0,k.g3)(null===e||void 0===e?void 0:e.Penalty_Value,"night")," ").concat(So("penalty"),"."):"".concat(So("Cancelling")," ").concat(null===e||void 0===e?void 0:e.Days_Before," ").concat((0,k.g3)(null===e||void 0===e?void 0:e.Days_Before,"day")," ").concat(So("before arrival incurs a")," ").concat(null===e||void 0===e?void 0:e.Penalty_Value).concat(i[null===e||void 0===e?void 0:e.Penalty_Type]," ").concat(So("penalty"),".")]},o)})})]})})]})]}),io&&(0,E.jsx)(F.A,{onClose:()=>lo(!1),rpObject:ae,room:Y})]})},se=e=>{var o,i,n,r,c,m,p,w,D,P,R,M,O,T;let{room:Y,showFakePrice:F=!1,extraPrice:z=1,totalPeople:W,dateRange:U,lastDates:V,isFirst:q=!1,showLoyal:K,isModify:$=!1,isSelected:re=!1,handleRoomPrice:se,pricingfornotifications:ue,getSecretMemberDealUrl:ve=()=>{},applyPromotion:ce,promotionRes:me,adults:he,child:pe,sortedRooms:fe=[],activeRatePlanFilter:ge=null}=e;const{id:xe,roomName:_e="Single Room",defaultPrice:ye,defaultGuestCount:be,RoomImages:je,pricing:Ce,allPricingWithMlos:Ne,availableRooms:Ae,HotelRoomAddons:Se,HotelRoomAmenities:Ie,maxGuestCount:ke,hourly:we=[],priceConfig:De={},chosenPriceConfig:Pe,priceConfigDifference:Re={}}=Y,Me=(Array.isArray(Ne)&&Ne.length>0?Ne:Ce)||[],[Ee,Oe]=(0,t.useState)(ye),[Te,Ye]=(0,t.useState)(0),[Be,Fe]=(0,t.useState)(!1),[,Ge]=(0,t.useState)(0),[Le,He]=(0,t.useState)(0),[ze,We]=(0,t.useState)(0),[Ue,Ve]=(0,t.useState)(),[qe,Ke]=(0,t.useState)(300),[$e,Je]=(0,t.useState)(!1),[Ze,Xe]=(0,t.useState)(!0),[Qe,eo]=(0,t.useState)(),[oo,io]=(0,t.useState)(!1),[,lo]=(0,t.useState)(),[no,to]=(0,t.useState)(),[ro,ao]=(0,t.useState)(!1),[so,uo]=(0,t.useState)(),[vo,co]=(0,t.useState)([]),[mo,ho]=(0,t.useState)(0),[po,fo]=(0,t.useState)(0),[go,xo]=(0,t.useState)(0),[_o,yo]=(0,t.useState)(),[bo,jo]=(0,t.useState)(),[Co,No]=(0,t.useState)(),[Ao,So]=(0,t.useState)(0),[Io,ko]=(0,t.useState)(Se),[wo,Do]=(0,t.useState)([]),[Po,Ro]=(0,t.useState)([]),[Mo,Eo]=(0,t.useState)(0),[Oo,To]=(0,t.useState)(),[Yo,Bo]=(0,t.useState)(0),[Fo,Go]=(0,t.useState)(0),[Lo,Ho]=(0,t.useState)([]),[zo,Wo]=(0,t.useState)(!1),[Uo,Vo]=(0,t.useState)(2),[qo,Ko]=(0,t.useState)(0),[$o,Jo]=(0,t.useState)(!1),[Zo,Xo]=(0,t.useState)([]),[Qo,ei]=(0,t.useState)(!1),[oi,ii]=(0,t.useState)([]),[li,ni]=(0,t.useState)(!1),[di,ti]=(0,t.useState)([]),[ri,ai]=(0,t.useState)(7),[si,ui]=(0,t.useState)(2),[vi,ci]=(0,t.useState)(10),[mi,hi]=(0,t.useState)({name:"",description:""}),[pi,fi]=(0,t.useState)(!1),gi="true"===sessionStorage.getItem("isMembershipUnlocked"),[xi,_i]=(0,t.useState)(-1),[yi,bi]=(0,t.useState)(!1),[ji,Ci]=(0,t.useState)(),[Ni,Ai]=(0,t.useState)(!1);Se.sort((e,o)=>e.price-o.price);const Si="google_vr"===y.A.get("source"),{t:Ii}=(0,a.Bd)(),ki=(0,s.wA)(),wi=(0,A.A)(),Di=(0,t.useRef)(),{selectedRooms:Pi,hotelData:Ri,selectedAddons:Mi,totalAdult:Ei,totalChild:Oi,totalInfant:Ti,promotions:Yi=[],policies:Bi,payments:Fi,isHourlyRoom:Gi,isRatePlans:Li,roomSlots:Hi,hourlyTime:zi,dateCount:Wi,taxes:Ui,updatedRoomCount:Vi={},upsell:qi,hourlyDate:Ki,bookingEngineConfig:$i,couponCode:Ji}=(0,s.d4)(e=>e.hotelInfo),[Zi,Xi]=(0,t.useState)(!1);(0,t.useEffect)(()=>{if((null===ue||void 0===ue?void 0:ue.length)>0){let e=(e=>{const o=new Map;return null===e||void 0===e||e.forEach(e=>{const[[i,l]]=Object.entries(e);(!o.has(i)||l<o.get(i))&&o.set(i,l)}),Array.from(o).map(e=>{let[o,i]=e;return{[o]:i}})})(ue),o=null===e||void 0===e?void 0:e.slice(0,4);setTimeout(()=>{(null===o||void 0===o?void 0:o.length)>0&&ti(o)},0)}},[ue]);wi.width<=900||(null===wi||void 0===wi?void 0:wi.width)>900&&(null===wi||void 0===wi||wi.width);const Qi={fontWeight:"500",color:"#026AA2",backgroundColor:"#F0F9FF",border:"1px solid #B9E6FE",width:"fit-content",padding:"2px 8px 2px 8px",borderRadius:"18px",display:"flex",alignItems:"center",gap:"3px",marginLeft:"3px"};function el(e,o){return Math.floor(Math.random()*(o-e+1))+e}(0,t.useEffect)(()=>{const e=document.createElement("style");e.type="text/css",e.innerHTML="\n @keyframes blink-border {\n 0% { border-color: #B9E6FE; }\n 50% { border-color: transparent; }\n 100% { border-color: #B9E6FE; }\n }\n\n @keyframes blink-icon {\n 0% { opacity: 1; }\n 50% { opacity: 0.5; }\n 100% { opacity: 1; }\n }\n ",document.head.appendChild(e)},[]),(0,t.useEffect)(()=>{const e=function(){try{const o=localStorage.getItem("bookingNumber");if(o){const e=o.split("|");if(2===(null===e||void 0===e?void 0:e.length)){const o=parseInt(e[0],10),i=e[1],l=new Date;if(i==="".concat(l.getFullYear(),"-").concat(String(l.getMonth()+1).padStart(2,"0"),"-").concat(String(l.getDate()).padStart(2,"0")))return o}}const i=el(5,15),l=new Date,n="".concat(null===l||void 0===l?void 0:l.getFullYear(),"-").concat(String(l.getMonth()+1).padStart(2,"0"),"-").concat(String(null===l||void 0===l?void 0:l.getDate()).padStart(2,"0")),d="".concat(i,"|").concat(n);try{localStorage.setItem("bookingNumber",d)}catch(e){console.log(e)}return i}catch(o){return console.log(o),el(5,15)}}();e&&ai(e)},[]),(0,t.useEffect)(()=>{let e=Math.floor(9*Math.random()+2);e&&ui(e)},[]),(0,t.useEffect)(()=>{let e=Math.floor(21*Math.random()+10);e&&ci(e)},[]);const{truncatedLines:ol,isTruncated:il}=function(e){return{truncatedLines:(null===e||void 0===e?void 0:e.split("\n").filter(e=>e.trim()))||[],isTruncated:!0}}(null===Y||void 0===Y?void 0:Y.description);(0,t.useEffect)(()=>{Ae&&Ae>0?63809===(null===Ri||void 0===Ri?void 0:Ri.userId)?To(Ae>5?5:Ae):To(Ae):To(0)},[Ae]),(0,t.useEffect)(()=>{const e=null===Pi||void 0===Pi?void 0:Pi.filter(e=>(null===e||void 0===e?void 0:e.id)===(null===Y||void 0===Y?void 0:Y.id)),o=null===Mi||void 0===Mi?void 0:Mi.filter(e=>(null===e||void 0===e?void 0:e.hotelRoomId)===(null===Y||void 0===Y?void 0:Y.id));Ye(null===e||void 0===e?void 0:e.length),0===(null===e||void 0===e?void 0:e.length)&&0===(null===o||void 0===o?void 0:o.length)&&(He(0),We(0),Eo(0),ho(0),fo(0),xo(0))},[Te,Mi,Pi]),(0,t.useEffect)(()=>{const e=()=>{Di.current&&ei(Di.current.scrollHeight>Di.current.clientHeight)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[Di.current]),(0,t.useEffect)(()=>{null!==Ie&&void 0!==Ie&&Ie.some(e=>{var o,i;return"Bunk Beds"===(null===e||void 0===e||null===(o=e.Amenity)||void 0===o?void 0:o.name)&&"bed_type"===(null===e||void 0===e||null===(i=e.Amenity)||void 0===i?void 0:i.category)})&&Je(!0)},[Pi]),(0,t.useEffect)(()=>
1{if((null===Se||void 0===Se?void 0:Se.length)>0){let e=null===Se||void 0===Se?void 0:Se.filter(e=>{var o;return"0.00"===(null===e||void 0===e?void 0:e.price)&&"meal"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.category)});uo(e);let o=null===Se||void 0===Se?void 0:Se.filter(e=>{var o;return"0.00"===(null===e||void 0===e?void 0:e.price)&&"person"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.category)});co(o)}},[]),(0,t.useEffect)(()=>{if(Fi&&(null!==Fi&&void 0!==Fi&&Fi.some(e=>{var o;return"COD"===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)})&&ao(!0),null!==Fi&&void 0!==Fi&&Fi.some(e=>{var o;return"PartialPayment"===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)}))){var e,o;let i=null===Fi||void 0===Fi||null===(e=Fi.filter(e=>{var o;return"PartialPayment"===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)})[0])||void 0===e||null===(o=e.config)||void 0===o?void 0:o.minPercentage;i>0&&to(i)}},[Fi]),(0,t.useEffect)(()=>{if((null===Bi||void 0===Bi?void 0:Bi.length)>0){let l=(null===Bi||void 0===Bi?void 0:Bi.filter(e=>"cancellation_policy"===(null===e||void 0===e?void 0:e.type)))||[];var e,o,i;if((null===l||void 0===l?void 0:l.length)>0)null===(e=l[0])||void 0===e||null===(o=e.HotelPolicies)||void 0===o||o.sort((e,o)=>{var i,l;return(null===o||void 0===o||null===(i=o.variables)||void 0===i?void 0:i.daysBeforeArrival)-(null===e||void 0===e||null===(l=e.variables)||void 0===l?void 0:l.daysBeforeArrival)}),eo(null===(i=l[0])||void 0===i?void 0:i.HotelPolicies)}},[Bi]),(0,t.useEffect)(()=>{let e,o;if((null===Qe||void 0===Qe?void 0:Qe.length)>0){var i,l,n,t,r,a,s,u;if(0===(null===(i=Qe[0])||void 0===i||null===(l=i.variables)||void 0===l?void 0:l.chargedPercentage))e=d()(null===U||void 0===U?void 0:U.startDate).subtract(null===(r=Qe[0])||void 0===r||null===(a=r.variables)||void 0===a?void 0:a.daysBeforeArrival,"day");else e=d()(null===U||void 0===U?void 0:U.startDate).subtract((null===(s=Qe[0])||void 0===s||null===(u=s.variables)||void 0===u?void 0:u.daysBeforeArrival)+1,"day");o=null===(n=e)||void 0===n?void 0:n.diff(d()(),"day"),o>=0&&io(!0),lo(null===(t=e)||void 0===t?void 0:t.format("MMM DD"))}else{var v;if(o=d()(null===U||void 0===U?void 0:U.startDate).diff(d()(),"day"),o>=1)e=d()(null===U||void 0===U?void 0:U.startDate).subtract(1,"day"),io(!0),lo(null===(v=e)||void 0===v?void 0:v.format("MMM DD"))}},[Qe,null===Y||void 0===Y?void 0:Y.pricing,U]),(0,t.useEffect)(()=>{io(!1)},[null===U||void 0===U?void 0:U.startDate,null===U||void 0===U?void 0:U.endDate]),(0,t.useEffect)(()=>{var e,o,i,l,n,d;(null===Mi||void 0===Mi?void 0:Mi.length)>0&&(He(null===Mi||void 0===Mi||null===(e=Mi.filter(e=>{var o;return"Extra Adult"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.name)&&(null===e||void 0===e?void 0:e.hotelRoomId)===(null===Y||void 0===Y?void 0:Y.id)}))||void 0===e?void 0:e.length),We(null===Mi||void 0===Mi||null===(o=Mi.filter(e=>{var o;return"Extra Child"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.name)&&"child"===(null===e||void 0===e?void 0:e.type)&&(null===e||void 0===e?void 0:e.hotelRoomId)===(null===Y||void 0===Y?void 0:Y.id)}))||void 0===o?void 0:o.length),Eo(null===Mi||void 0===Mi||null===(i=Mi.filter(e=>{var o;return"Extra Child"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.name)&&"infant"===(null===e||void 0===e?void 0:e.type)&&(null===e||void 0===e?void 0:e.hotelRoomId)===(null===Y||void 0===Y?void 0:Y.id)}))||void 0===i?void 0:i.length),ho(null===Mi||void 0===Mi||null===(l=Mi.filter(e=>{var o;return"Dinner"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.name)&&(null===e||void 0===e?void 0:e.hotelRoomId)===(null===Y||void 0===Y?void 0:Y.id)}))||void 0===l?void 0:l.length),fo(null===Mi||void 0===Mi||null===(n=Mi.filter(e=>{var o;return"Lunch"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.name)&&(null===e||void 0===e?void 0:e.hotelRoomId)===(null===Y||void 0===Y?void 0:Y.id)}))||void 0===n?void 0:n.length),xo(null===Mi||void 0===Mi||null===(d=Mi.filter(e=>{var o;return"Breakfast"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.name)&&(null===e||void 0===e?void 0:e.hotelRoomId)===(null===Y||void 0===Y?void 0:Y.id)}))||void 0===d?void 0:d.length))},[Mi]),(0,t.useEffect)(()=>{var e;let o=null===Mi||void 0===Mi||null===(e=Mi.filter(e=>{var o;return(null===e||void 0===e?void 0:e.hotel_room_id)===(null===Y||void 0===Y?void 0:Y.id)&&"person"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.category)}))||void 0===e?void 0:e.length;bo&&bo===be+o&&(He(0),We(0))},[Le,ze]),(0,t.useEffect)(()=>{let e=0,o=Ei<=ke?Ei:ke;Re&&Object.keys(Re).length>0?Me.forEach(i=>
1{e=e+parseFloat(null===i||void 0===i?void 0:i.price)+parseFloat(Re[o])}):Me.forEach(i=>{e+=parseFloat(i.price)*(parseFloat(De[o])||1)});let i=0===(null===Me||void 0===Me?void 0:Me.length)?ye:e;63809===(null===Ri||void 0===Ri?void 0:Ri.userId)&&(i=i>8400?i/1.18:i/1.12),Oe(i),Ge(parseInt(be)),Ei<=ke?(yo(i),jo(Ei)):(yo(null),jo(ke)),Vi[null===Y||void 0===Y?void 0:Y.id]>=0?Ve(Vi[null===Y||void 0===Y?void 0:Y.id]):Ve(Ae)},[Ei,Y,z,Oo,Vi]),(0,t.useEffect)(()=>{$e&&ke!==be&&Ue>0&&Ve(1)},[$e,Y,Oo]),(0,t.useEffect)(()=>{let e=wi.width>901?600:800;Ke(e)},[wi]);const[ll,nl]=(0,t.useState)(0);(0,t.useEffect)(()=>{0===(null===Pi||void 0===Pi?void 0:Pi.length)&&ki({type:_.A.SET_SLOTS,payload:{}})},[null===Pi||void 0===Pi?void 0:Pi.length]);const dl=y.A.get("testId")||0;(0,t.useEffect)(()=>{const{priceConfig:e={},defaultGuestCount:o,maxGuestCount:i,HotelRoomAddons:l,pricing:n,extraChildPrice:d,childAgeSplit:t,extraInfantPrice:r}=Y;let a=Object.keys(e).map(Number).length-o,s=0;n.forEach(e=>{s+=parseFloat(e.price)}),s/=null===n||void 0===n?void 0:n.length;let u=[],v=[];if(i>o){for(let i=1;i<=a;i++){let l=(e[o+i]-e[o+i-1])*s,n={hotelRoomId:null===Y||void 0===Y?void 0:Y.id,hotel_room_id:null===Y||void 0===Y?void 0:Y.id,price:l.toFixed((0,k.S2)(null===Ri||void 0===Ri?void 0:Ri.currency)),Addon:{name:"Extra Adult",displayName:Ii("extra_adult"),category:"person"}};u.push(n)}if(d){let e={hotelRoomId:null===Y||void 0===Y?void 0:Y.id,hotel_room_id:null===Y||void 0===Y?void 0:Y.id,price:parseFloat(d).toFixed((0,k.S2)(null===Ri||void 0===Ri?void 0:Ri.currency)),type:"child",Addon:{name:"Extra Child",displayName:t?"".concat(Ii("extra_child")," (").concat(t,"-18"):"".concat(Ii("extra_child")," (12-18)"),category:"person"}};v.push(e)}if(r){let e={hotelRoomId:null===Y||void 0===Y?void 0:Y.id,hotel_room_id:null===Y||void 0===Y?void 0:Y.id,price:parseFloat(r).toFixed((0,k.S2)(null===Ri||void 0===Ri?void 0:Ri.currency)),type:"infant",Addon:{name:"Extra Child",displayName:t?"".concat(Ii("extra_child")," (0-").concat(t,")"):"".concat(Ii("extra_child")," (0-12)"),category:"person"}};v.push(e)}}let c=[...l,u[0]||[]];ko([...c,...v]),Do(u),Ro(u)},[Pi,Y]),(0,t.useEffect)(()=>{if(Te>1){let e=[...wo,...Po];Do(e)}},[Te]),(0,t.useEffect)(()=>{const e=()=>{const e=ol||[],o=Di.current;if(!o||null===e||void 0===e||!e.length)return;const i=document.createElement("ul");i.style.cssText=window.getComputedStyle(o.firstChild).cssText,i.style.position="absolute",i.style.visibility="hidden",i.style.height="auto",i.style.width="".concat(o.clientWidth,"px"),document.body.appendChild(i);let l=0,n=e.length,d=0;for(;l<=n;){const t=Math.floor((l+n)/2);i.innerHTML=e.slice(0,t).map(e=>"<li>".concat(e,"</li>")).join("")+"<li>...</li>",i.offsetHeight<=o.clientHeight?(d=t,l=t+1):n=t-1}document.body.removeChild(i),ii(e.slice(0,d)),ni(d<e.length)};if(Di.current){const o=new ResizeObserver(e);return o.observe(Di.current),()=>{o.disconnect()}}},[null===ol||void 0===ol?void 0:ol.truncatedLines]);(0,t.useEffect)(()=>{Li&&null!==Y&&void 0!==Y&&Y.availableRooms?Bo((null===Y||void 0===Y?void 0:Y.availableRooms)||0):Bo(0)},[null===Y||void 0===Y?void 0:Y.id]);(0,t.useMemo)(()=>{var e;return Li?null===Me||void 0===Me||null===(e=Me.filter((e,o,i)=>o===i.findIndex(o=>o.ratePlanCode===e.ratePlanCode)))||void 0===e?void 0:e.map(e=>null===e||void 0===e?void 0:e.ratePlanCode):[]},[Me]);(0,t.useEffect)(()=>{if((null===Yi||void 0===Yi?void 0:Yi.length)>0){let e=(0,N.hR)(Yi);Ho(e)}else Ho([])},[Yi,null===Ri||void 0===Ri?void 0:Ri.id]);const{rmPrice:tl,rmTax:rl,rmPriceReduced:al,noDiscPrice:sl,basePrice:ul}=(0,t.useMemo)(()=>{const e=null===Pi||void 0===Pi?void 0:Pi.find(e=>(null===e||void 0===e?void 0:e.id)===(null===Y||void 0===Y?void 0:Y.id)),o=e?Math.min(e.sAdult,null===Y||void 0===Y?void 0:Y.maxGuestCount):Ei,i=e?e.sChild:Oi,l=e?e.sInfant:Ti;let n=o<=(null===Y||void 0===Y?void 0:Y.maxGuestCount)?o:null===Y||void 0===Y?void 0:Y.maxGuestCount,d=0,t=0,r=0,a=0,s=0,u=[],v=0,c="priceConfigDifference"===Pe;const m=function(e,o,i){const l=void 0!==e?e:Ei,n=void 0!==o?o:Oi,d=void 0!==i?i:Ti;let t=[],r=l,a=n,s=d;if(n>0&&(null===Y||void 0===Y||!Y.extraChildPrice)||Gi)return[];for(let u=0;u<Ue&&(0!==r||0!==a||0!==s);u++){let e={adults:0,children:0,infants:0};if(!(r>0))break;e.adults=1,r-=1;let o=ke-e.adults;a>0&&(a>=o?(e.children=o,a-=o):(e.children=a,a=0)),o=ke-(e.adults+e.children),o>0&&s>0&&(s>=o?(e.infants=o,s-=o):(e.infants=s,s=0)),o=ke-(e.adults+e.children+e.infants),o>0&&r>0&&(r>=o?(e.adults+=o,r-=o):(e.adults+=r,r=0)),t.push(e)}if(r>0||a>0||s>0)return[];return t}(o,i,l);if(m.length>
10)Vo(o+i),Ko(m.length),Jo(!0),Xo(m),m.forEach(e=>{var o,i;n=e.adults,d=e.children;const l=(null===Y||void 0===Y||null===(o=Y.pricing)||void 0===o||null===(i=o.find(e=>(null===e||void 0===e?void 0:e.adultCount)===n))||void 0===i?void 0:i.priceForPax)||[];let v=new Set;if((null===Yi||void 0===Yi?void 0:Yi.some(e=>"nights"===(null===e||void 0===e?void 0:e.discountType)))&&Me.length>0){const e=Me.map(e=>{let o=0;const i=l.find(o=>(null===o||void 0===o?void 0:o.checkInDate)===(null===e||void 0===e?void 0:e.date));return o=i?i.priceBeforeTax:c&&null!==Y&&void 0!==Y&&Y.priceConfigDifference?(null===e||void 0===e?void 0:e.price)+parseFloat(Re[n]):(null===e||void 0===e?void 0:e.price)*(parseFloat(De[n])||1),d&&d>0&&(o+=(null===Y||void 0===Y?void 0:Y.extraChildPrice)*d),{price:o,checkInDate:null===e||void 0===e?void 0:e.date}});if(e.sort((e,o)=>e.price-o.price),e.length>0&&e[0]){var m,h;const o=(0,N.O_)({arrangedPromos:Yi.filter(e=>"nights"===(null===e||void 0===e?void 0:e.discountType)),rp:{roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:null===(m=e[0])||void 0===m?void 0:m.price,checkInDate:null===(h=e[0])||void 0===h?void 0:h.checkInDate});if(o){const i=Math.min(o.discount,e.length);for(let o=0;o<i;o++)v.add(e[o].checkInDate)}}}Me.forEach((e,o)=>{var i;let m=0;const h=l.find(o=>(null===o||void 0===o?void 0:o.checkInDate)===(null===e||void 0===e?void 0:e.date));h?m=h.priceBeforeTax:c&&null!==Y&&void 0!==Y&&Y.priceConfigDifference?m+=(null===e||void 0===e?void 0:e.price)+parseFloat(Re[n]):m+=(null===e||void 0===e?void 0:e.price)*(parseFloat(De[n])||1),d&&d>0&&(m+=(null===Y||void 0===Y?void 0:Y.extraChildPrice)*d),s+=m;let p=(0,N.Kn)(Yi);p&&(p=(0,N.O_)({arrangedPromos:[p],rp:{roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:m,checkInDate:null===e||void 0===e?void 0:e.date}));let f=null,g=null;var x;if(p)if(null!==(x=p)&&void 0!==x&&x.isStack){let o=(null===Yi||void 0===Yi?void 0:Yi.filter(e=>!(0,N.UT)(e)))||[];f=(0,N.O_)({arrangedPromos:o,rp:{roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:m,checkInDate:null===e||void 0===e?void 0:e.date}),g=p}else f=p,g=null;else f=(0,N.O_)({arrangedPromos:Yi,rp:{roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:m,checkInDate:null===e||void 0===e?void 0:e.date});f&&u.push(f);let{finalValue:_,reducedPrice:y}=(0,N.um)({price:m,promo:f,idx:o,dateCount:Wi,checkInDate:null===e||void 0===e?void 0:e.date,nightPromotionNights:v});if(g&&null!==(i=g)&&void 0!==i&&i.isStack){u.push(g);let i=(0,N.um)({price:_,promo:g,idx:o,dateCount:Wi,checkInDate:null===e||void 0===e?void 0:e.date,nightPromotionNights:v});y+=i.reducedPrice,_=i.finalValue}r+=y;const b=(0,k.oT)({taxes:Ui,rooms:[{id:null===Y||void 0===Y?void 0:Y.id,amount:_}],isInclusive:null===Ri||void 0===Ri?void 0:Ri.isTaxIncluded,noOfNights:1});if(t+=_+(null!==Ri&&void 0!==Ri&&Ri.isTaxIncluded?b.totalRoomTax:0),a+=Math.abs(b.totalRoomTax),Gi){let o=Hi[null===Y||void 0===Y?void 0:Y.id],i=0;i=c&&Re?Number(null===e||void 0===e?void 0:e.price)+parseFloat(Re[null===Y||void 0===Y?void 0:Y.defaultGuestCount]):Number(null===e||void 0===e?void 0:e.price)*parseFloat(De[null===Y||void 0===Y?void 0:Y.defaultGuestCount]),t=n<=(null===Y||void 0===Y?void 0:Y.defaultGuestCount)?i*(null===o||void 0===o?void 0:o.percentage):c&&Re?i*(null===o||void 0===o?void 0:o.percentage)+Re[null===Y||void 0===Y?void 0:Y.sAdult]:i*(null===o||void 0===o?void 0:o.percentage)+(De[null===Y||void 0===Y?void 0:Y.sAdult]*i-i),r=0,a=0}})});else{Xo([]),Vo(n),Ko(1),Jo(!1);let e=new Set;if((null===Yi||void 0===Yi?void 0:Yi.some(e=>"nights"===(null===e||void 0===e?void 0:e.discountType)))&&Me.length>0){const o=Me.map(e=>{let o=0;return o=c&&Re?(null===e||void 0===e?void 0:e.price)+parseFloat(Re[n]):(null===e||void 0===e?void 0:e.price)*parseFloat(De[n]),{price:o,checkInDate:null===e||void 0===e?void 0:e.date}});if(o.sort((e,o)=>e.price-o.price),o.length>0&&o[0]){var h,p;const i=(0,N.O_)({arrangedPromos:Yi.filter(e=>"nights"===(null===e||void 0===e?void 0:e.discountType)),rp:{roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:null===(h=o[0])||void 0===h?void 0:h.price,checkInDate:null===(p=o[0])||void 0===p?void 0:p.checkInDate});if(i){const l=Math.min(i.discount,o.length);for(let i=0;i<l;i++)e.add(o[i].checkInDate)}}}Me.forEach((o,i)=>{var l;let d=0;d+=c&&Re?(null===o||void 0===o?void 0:o.price)+parseFloat(Re[n]):(null===o||void 0===o?void 0:o.price)*parseFloat(De[n]),s+=d;let m=(0,N.Kn)(Yi);m&&(m=(0,N.O_)({arrangedPromos:[m],rp:{roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:d,checkInDate:null===o||void 0===o?void 0:o.date}));let h=null,p=null;var f;if(m)if(null!==(f=m)&&void 0!==f&&f.isStack){let e=(null===Yi||void 0===Yi?void 0:Yi.filter(e=>!(0,N.UT)(e)))||[];h=(0,N.O_)({arrangedPromos:e,rp:{roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:d,checkInDate:null===o||void 0===o?void 0:o.date}),p=m}else h=m,p=null;else h=(0,N.O_)({arrangedPromos:Yi,rp:{roomId:null===Y||void 0===Y?void 0:Y.id},tempPrice:d,checkInDate:null===o||void 0===o?void 0:o.date});h&&u.push(h);let{finalValue:g,reducedPrice:x}=(0,N.um)({price:d,promo:h,idx:i,dateCount:Wi,checkInDate:null===o||void 0===o?void 0:o.date,nightPromotionNights:e});if(p&&null!==(l=p)&&void 0!==l&&l.isStack){u.push(p);let l=(0,N.um)({price:g,promo:p,idx:i,dateCount:Wi,checkInDate:null===o||void 0===o?void 0:o.date,nightPromotionNights:e});x+=l.reducedPrice,g=l.finalValue}r+=x;const _=(0,k.oT)({taxes:Ui,rooms:[{id:null===Y||void 0===Y?void 0:Y.id,amount:g}],isInclusive:null===Ri||void 0===Ri?void 0:Ri.isTaxIncluded,noOfNights:1});if(t+=g+(null!==Ri&&void 0!==Ri&&Ri.isTaxIncluded?_.totalRoomTax:0),a+=Math.abs(_.totalRoomTax),Gi){var y,b,j;const e=null===Y||void 0===Y||null===(y=Y.pricing)||void 0===y||null===(b=y.find(e=>(null===e||void 0===e?void 0:e.adultCount)===(null===Y||void 0===Y?void 0:Y.defaultGuestCount)))||void 0===b||null===(j=b.priceForPax)||void 0===j?void 0:j[0];v=e?e.priceBeforeTax:c&&Re?Number(null===o||void 0===o?void 0:o.price)+parseFloat(Re[null===Y||void 0===Y?void 0:Y.defaultGuestCount]):Number(null===o||void 0===o?void 0:o.price)*parseFloat(De[null===Y||void 0===Y?void 0:Y.defaultGuestCount]),r=0,a=0}})}if(null!==Y&&void 0!==Y&&Y.availableRooms&&!Li){var f;const e=null!==(f=y.A.get("lowestPrice"))&&void 0!==f?f:1/0;y.A.set("lowestPrice",Math.min(e,t*z+a*z))}return{rmPrice:Number(t*z),rmTax:Number(a*z),rmPriceReduced:Number(r*z),noDiscPrice:Number(s*z),basePrice:v}}
1,[Me,Ei,Oi,Ti,Pi,Lo,Gi,U]);il||null===Y||void 0===Y||null===(o=Y.description)||void 0===o||o.split("\n").length;(0,t.useEffect)(()=>{const e=Math.floor(6*Math.random())+45;Ci(e)},[]);const vl=!!localStorage.getItem("corporateAgentId"),cl=!$&&(0,b.Hi)(null===Ri||void 0===Ri?void 0:Ri.id,null===Ri||void 0===Ri?void 0:Ri.chainId),ml=(0,t.useMemo)(()=>{if(!Li||Gi||null===Y||void 0===Y||!Y.ratePlans||null===Me||void 0===Me||!Me.length)return!1;return Object.values(Y.ratePlans).map(e=>null===e||void 0===e?void 0:e.ratePlanCode).some(e=>Me.some(o=>(null===o||void 0===o?void 0:o.ratePlanCode)===e))},[Li,Gi,null===Y||void 0===Y?void 0:Y.ratePlans,Me]),hl=(0,t.useMemo)(()=>{if(Li||!Me||0===Me.length)return null;const e=Me.some(e=>!1===(null===e||void 0===e?void 0:e.meetsMLOS));!Y.soldOut&&e&&(Y.availableRooms=4);return{meetsMLOS:!e,minLOS:Math.max(...Me.map(e=>(null===e||void 0===e?void 0:e.minLOS)||1))||1}},[Me,Li]),pl=I({content_ids:[(null===Y||void 0===Y?void 0:Y.id)||(null===Y||void 0===Y?void 0:Y.hotelRoomId)],content_type:"hotel_room",value:parseFloat(tl+rl),currency:(null===Ri||void 0===Ri?void 0:Ri.currency)||"INR",num_adults:Ei,num_children:Oi},{threshold:.5,triggerOnce:!0,enabled:Ue>0&&(null===Y||void 0===Y||null===(i=Y.pricing)||void 0===i?void 0:i.length)>0}),fl=y.A.get("utmObj");if("verification"===(null===fl||void 0===fl?void 0:fl.googleSource)&&!Li&&0===Zo.length)return null;if(null!==Y&&void 0!==Y&&Y.isDayUseOnly&&!Gi)return null;const gl=0===Ue||0===(null===Y||void 0===Y||null===(n=Y.pricing)||void 0===n?void 0:n.length)&&Array.isArray(null===Y||void 0===Y?void 0:Y.allPricingWithMlos)&&0===(null===Y||void 0===Y||null===(r=Y.allPricingWithMlos)||void 0===r?void 0:r.length),xl=gl?"article":"div";return(0,E.jsxs)(xl,{className:"room",id:"room-".concat(Y.id),ref:pl,children:[(0,E.jsxs)("div",{className:gl?"room__container disableRoom":"room__container".concat(cl&&Li&&Ue>0&&ml?" rp-twoCol":""),children:[(0,E.jsxs)("div",{className:cl&&Li&&Ue>0&&ml?"rp-twoCol__left":"rp-twoCol__passthrough",children:[(0,E.jsx)("div",{className:"room__topContainer",children:(0,E.jsxs)("div",{className:"room__imageWrapper",children:[gl&&(0,E.jsx)("span",{className:"soldOutTag",children:Ii("sold_out","Sold Out")}),0===(null===je||void 0===je?void 0:je.length)?(0,E.jsx)("img",{className:"room__topLeftContainer",src:"https://ik.imagekit.io/hotelzifyprod/logo.png?tr=w-auto-".concat(qe,",ar-1-1,h-auto-350,q-").concat(k.Y$),alt:"room img",height:"350px",style:{objectFit:"contain",maxWidth:"100%"},width:qe+"px",loading:"lazy",onClick:()=>{var e;return(null===(e=je[0])||void 0===e?void 0:e.cdnImageUrl)&&Fe(!0)}}):(0,E.jsx)(u.FN,{infiniteLoop:!0,showStatus:!Be,showThumbs:!1,preventMovementUntilSwipeScrollTolerance:!0,showArrows:!Be,showIndicators:!1,onClickItem:e=>{(e=>{Fe(!0),nl(e)})(e),(0,j.fireGtmEvent)("room_image_expanded")},className:"room__topLeftContainer",children:null===je||void 0===je?void 0:je.map((e,o)=>{return(0,E.jsx)("img",{loading:"lazy",fetchPriority:"low",decoding:"async",className:"room__image",width:"400",height:"300",src:ie(null===e||void 0===e?void 0:e.cdnImageUrl,480),srcSet:(i=null===e||void 0===e?void 0:e.cdnImageUrl,oe.map(e=>"".concat(ie(i,e)," ").concat(e,"w")).join(", ")),sizes:"(max-width: 900px) calc(100vw - 20px), 400px",alt:"".concat(_e," Room Image of ").concat(null===Ri||void 0===Ri?void 0:Ri.name),title:_e},o);var i})}),(0,b.DF)($i,S.i.HOME.SOCIAL_PROOF)&&(null===Y||void 0===Y?void 0:Y.availableRooms)>0&&!k.v.includes(null===Ri||void 0===Ri?void 0:Ri.id)&&!k.iK.includes(null===Ri||void 0===Ri?void 0:Ri.id)&&(null===di||void 0===di?void 0:di.some(e=>e&&"object"===typeof e&&Object.keys(e).length>0&&Object.keys(e)[0]===(null===Y||void 0===Y?void 0:Y.roomName)))&&(0,E.jsx)("div",{className:"socialProofOverlay",children:((e,o,i,n,d,t)=>{switch(null===e||void 0===e?void 0:e.findIndex(e=>Object.keys(e)[0]===(null===o||void 0===o?void 0:o.roomName))){case 0:return(0,E.jsxs)("p",{style:(0,l.A)((0,l.A)({},Qi),{},{animation:"blink-border 1.0s infinite"}),className:"countWidget",children:[(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/view icon (3).svg",alt:"View Icon",width:"14",height:"14",style:{animation:"blink-icon 1.0s infinite"}}),(0,E.jsxs)("span",{children:[i," people are viewing this room right now"]})]});case 1:return(0,E.jsxs)("p",{style:Qi,className:"countWidget",children:["Someone booked this room ",n," minutes ago"]});case 2:return(0,E.jsxs)("p",{style:Qi,className:"countWidget",children:["This room was booked ",d," times in last 7 days"]});case 3:return null!==t&&void 0!==t&&t.city?(0,E.jsxs)("p",{style:Qi,className:"countWidget",children:["Highly rated by travelers visiting ",t.city]}):(0,E.jsx)("p",{style:Qi,className:"countWidget",children:"Highly rated by travelers"});default:return null}})(di,Y,si,vi,ri,Ri)})]})}),(0,E.jsxs)("div",{className:"roomNewContainer",style:{maxHeight:"500px",minHeight:"fit-content"},children:[(0,E.jsxs)("div",{className:"room__topRightContainer",style:{height:"fit-content",minHeight:0,maxHeight:cl&&Li&&Ue>
10&&ml?"none":"250px",flexGrow:1,marginTop:wi.width<=900?"0px":"5px"},children:[(0,E.jsxs)("div",{className:"roomName",children:[(0,E.jsx)("h2",{children:_e}),!$&&q&&Ue>0&&!k.iK.includes(null===Ri||void 0===Ri?void 0:Ri.id)&&(0,E.jsxs)("div",{className:"recommendedWrap",style:{position:"relative",display:"inline-block"},children:[(0,E.jsx)("p",{className:"recommended",onMouseEnter:()=>bi(!0),onMouseLeave:()=>bi(!1),style:{cursor:"pointer"},children:1===(null===Ri||void 0===Ri||null===(c=Ri.HotelRooms)||void 0===c?void 0:c.length)?Ii((0,H.ZN)(null===Ri||void 0===Ri?void 0:Ri.userId,"lowest_price_ever")):Ii("recommended")}),yi?(0,E.jsxs)("div",{style:{visibility:yi?"visible":"hidden",position:"absolute",top:"100%",right:(null===wi||void 0===wi?void 0:wi.width)>900?"20px":"0px",marginTop:"8px",backgroundColor:"#333",color:"#fff",padding:"6px 10px",borderRadius:"6px",fontSize:(null===wi||void 0===wi?void 0:wi.width)>500?"12px":"11px",lineHeight:1.4,zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.2)",width:"max-content",maxWidth:"220px",whiteSpace:"normal"},children:[(0,E.jsx)("div",{style:{position:"absolute",top:"-6px",right:"10px",transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",borderBottom:"6px solid #333"}}),(0,E.jsxs)("p",{style:{margin:0},children:["Over ",ji||"30","% of our guests recommend our ",null===Y||void 0===Y?void 0:Y.roomName,"string"===typeof(null===Y||void 0===Y?void 0:Y.roomName)&&null!==Y&&void 0!==Y&&null!==(m=Y.roomName)&&void 0!==m&&null!==(p=m.toLowerCase())&&void 0!==p&&p.includes("room")?"":" Room"]})]}):null]}),re&&(0,E.jsx)("p",{className:"recommended",children:"Current Selection"})]}),cl&&(null===Ie||void 0===Ie?void 0:Ie.length)>0&&(0,E.jsxs)("div",{className:"roomAmenityContainer roomAmenityContainer--all".concat(gl?" roomAmenityContainer--soldOut":""),children:[null===(w=zo?Ie:null===Ie||void 0===Ie?void 0:Ie.slice(0,4))||void 0===w?void 0:w.map((e,o)=>{var i,l,n,d,t,r;return(0,E.jsxs)("p",{children:[(0,E.jsx)(g.A,{iconName:C.j[null===e||void 0===e||null===(i=e.Amenity)||void 0===i?void 0:i.name],tooltip:null===e||void 0===e||null===(l=e.Amenity)||void 0===l?void 0:l.name,style:{fontSize:"12px"}}),(null===e||void 0===e||null===(n=e.Amenity)||void 0===n||null===(d=n.Trasalations)||void 0===d||null===(t=d[0])||void 0===t?void 0:t.name)||(null===e||void 0===e||null===(r=e.Amenity)||void 0===r?void 0:r.name)]},o)}),(null===Ie||void 0===Ie?void 0:Ie.length)>4&&(0,E.jsx)("p",{className:"showMoreAmenities",onClick:()=>{(0,j.fireGtmEvent)("room_amenities_toggle",{action:zo?"show_less":"show_more",room_id:null===Y||void 0===Y?void 0:Y.id,room_name:null===Y||void 0===Y?void 0:Y.roomName,total_amenities:null===Ie||void 0===Ie?void 0:Ie.length,visible_amenities:zo?4:null===Ie||void 0===Ie?void 0:Ie.length}),Wo(!zo)},style:{cursor:"pointer",color:"var(--blue)",fontWeight:"500",background:"transparent",textDecoration:"underline"},children:zo?"Show Less":"+".concat(Ie.length-4," More")})]}),(null===Y||void 0===Y?void 0:Y.description)&&!gl&&(cl?(0,E.jsxs)("div",{style:{width:"100%",marginTop:"6px"},children:[(()=>{const e=Y.description.split("\n").find(e=>e.trim());return e?(0,E.jsx)("div",{className:"roomDescHighlight",children:e.trim()}):null})(),(0,E.jsx)("button",{type:"button",onClick:()=>Xi(!0),style:{background:"none",border:"none",padding:0,fontSize:"0.75rem",color:"var(--blue)",fontWeight:"600",cursor:"pointer",textDecoration:"underline",marginTop:"2px"},children:"View more"})]}):(0,E.jsxs)("div",{style:{width:"100%",overflow:"hidden",position:"relative",wordBreak:"break-word",overflowWrap:"break-word"},ref:Di,children:[Qo?(0,E.jsx)("div",{style:{position:"absolute",bottom:"30px",left:0,right:0,height:"60px",background:"linear-gradient(transparent, white)"}}):null,(0,E.jsx)("ul",{style:{listStyleType:"disc",paddingLeft:"20px"},children:ol.map((e,o)=>(0,E.jsx)("li",{children:e},o))}),Qo&&(0,E.jsx)("div",{style:{background:"white",position:"absolute",bottom:0,left:0,right:0,height:"30px"},children:(0,E.jsx)("button",{type:"button",onClick:()=>Xi(!Zi),className:"text-blue-700 ml-2",style:{background:"none",fontWeight:"800",textDecoration:"underline",cursor:"pointer",border:"none",padding:"0",color:"var(--blue)"},"aria-expanded":Zi,"aria-label":Zi?"Close room description":"View more room details",children:Zi?"Close":"View more"})})]})),(0,E.jsx)(f.A,{isOpen:Zi,setIsOpen:Xi,overflow:"hidden",children:(0,E.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",maxHeight:"500px"},children:[(0,E.jsxs)("div",{style:{position:"sticky",top:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"10px 14px",backgroundColor:"#fff",borderBottom:"1px solid #eee",zIndex:1e3},children:[(0,E.jsx)("h2",{style:{margin:0,fontSize:"15px",fontWeight:600},children:null===Y||void 0===Y?void 0:Y.roomName}),(0,E.jsx)("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",padding:"2px"},children:(0,E.jsx)("img",{alt:"close modal",src:"https://ik.imagekit.io/hotelzifyprod/cross_rgYPtv6N7.svg",width:18,height:18,onClick:()=>Xi(!Zi)})})]}),(0,E.jsx)("div",{style:{padding:"14px 16px",overflowY:"auto",flexGrow:1},children:(0,E.jsx)("ul",{style:{listStyleType:"disc",paddingLeft:"18px",margin:0},children:null===Y||void 0===Y||null===(D=Y.description)||void 0===D?void 0:D.split("\n").filter(e=>e.trim()).map((e,o)=>(0,E.jsx)("li",{style:{marginBottom:"7px",fontSize:"13px",lineHeight:"1.55",wordBreak:"break-word",overflowWrap:"break-word"},children:e.trim()},o))})})]})}),(0,E.jsx)("div",{className:"roomInfo",children:(0,E.jsxs)("div",{className:"room_texts",children:[(0,b.DF)($i,S.i.HOME.ROOMS.GUEST_INFO)?Li||0!==Zo.length?null:bo?(0,E.jsxs)("p",{children:[(0,E.jsx)(g.A,{iconName:(0,E.jsx)("img",{src:X,width:"25px",alt:"userpic",height:"100%"}),tooltip:Ii("min_pax")})," ",Ii("price_for_upto")," ",bo," ",Ii($e?"bed":"guests")]}):(0,E.jsxs)("p",{children:[(0,E.jsx)(g.A,{iconName:(0,E.jsx)("img",{src:X,width:"25px",alt:"userpic",height:"100%"}),tooltip:Ii("min_pax")})," ",Ii("price_for"),1===be?" ":" ".concat(Ii("upto"))," ",be," ",Ii($e?"bed":"guests")]}):null,$e?(0,E.jsxs)("p",{children:[(0,E.jsx)(g.A,{iconName:(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/images/bunk.svg",alt:"room bunk bed",height:"100%",width:"25px"}),tooltip:Ii("max_bed")}),Oo," ",Ii("bed_dorm")]}):ke-be>0&&!bo?(0,E.jsxs)("p",{children:[(0,E.jsx)(g.A,{iconName:(0,E.jsx)("img",{src:X,alt:"userpic",width:"25px",height:"100%"}),tooltip:Ii("max_pax")}),Ii("max")," ",ke-be," ",Ii("additional_guests")]}):(0,E.jsx)(E.Fragment,{}),!Li&&(0,E.jsxs)("div",{className:"freeRoomStuff",children:[null===so||void 0===so?void 0:so.map((e,o)=>{var i;return(0,E.jsxs)("p",{style:{color:"#1A7971",fontWeight:"bold"},children:[" ",(0,E.jsx)(g.A,{iconName:(0,E.jsx)("img",{src:Z,alt:"userpic",height:"100%",width:"25px"}),tooltip:Ii("free")})," ",null===e||void 0===e||null===(i=e.Addon)||void 0===i?void 0:i.name," ",Ii("included")]},o)}),null===vo||void 0===vo?void 0:vo.map((e,o)=>{var i;return(0,E.jsxs)("p",{style:{color:"#1A7971",fontWeight:"bold"},children:[" ",(0,E.jsx)(g.A,{iconName:(0,E.jsx)("img",{src:J,alt:"userpic",height:"100%",width:"25px"}),tooltip:Ii("verified")})," ",null===e||void 0===e||null===(i=e.Addon)||void 0===i?void 0:i.name," ",Ii("can_stay_for_free")]},o)}),oo&&!Li&&(0,E.jsxs)("p",{style:{color:"#1A7971",fontWeight:"bold"},children:[" ",(0,E.jsx)(g.A,{iconName:(0,E.jsx)("img",{src:J,alt:"userpic",height:"100%",width:"25px"}),tooltip:"Verified"})," ",Ii("free_cancellation_till")," ",V]}),ro&&(0,E.jsxs)("p",{style:{color:"#1A7971",fontWeight:"bold"},children:[" ",(0,E.jsx)(g.A,{iconName:(0,E.jsx)("img",{src:J,alt:"userpic",height:"100%",width:"25px"}),tooltip:Ii("verified")})," ",Ii("book_now_pay_later")]}),no&&!ro&&(0,E.jsxs)("p",{style:{color:"#1A7971",fontWeight:"bold"},children:[" ",(0,E.jsx)(g.A,{iconName:(0,E.jsx)("img",{src:J,alt:"userpic",height:"100%",width:"25px"}),tooltip:Ii("verified")})," ",Ii("reserve_at_just")," ",(0,E.jsx)(L.A,{amount:no/100*Ee}),"!"]})]})]})})]}),!cl&&(0,E.jsxs)("div",{className:"roomAmenityContainer".concat(gl?" roomAmenityContainer--soldOut":""),children:[null===(P=zo?Ie:null===Ie||void 0===Ie?void 0:Ie.slice(0,4))||void 0===P?void 0:P.map((e,o)=>{var i,l,n,d,t,r;return(0,E.jsxs)("p",{children:[(0,E.jsx)(g.A,{iconName:C.j[null===e||void 0===e||null===(i=e.Amenity)||void 0===i?void 0:i.name],tooltip:null===e||void 0===e||null===(l=e.Amenity)||void 0===l?void 0:l.name,style:{fontSize:"12px"}}),(null===e||void 0===e||null===(n=e.Amenity)||void 0===n||null===(d=n.Trasalations)||void 0===d||null===(t=d[0])||void 0===t?void 0:t.name)||(null===e||void 0===e||null===(r=e.Amenity)||void 0===r?void 0:r.name)]},o)}),(null===Ie||void 0===Ie?void 0:Ie.length)>4&&(0,E.jsx)("p",{className:"showMoreAmenities",onClick:()=>{(0,j.fireGtmEvent)("room_amenities_toggle",{action:zo?"show_less":"show_more",room_id:null===Y||void 0===Y?void 0:Y.id,room_name:null===Y||void 0===Y?void 0:Y.roomName,total_amenities:null===Ie||void 0===Ie?void 0:Ie.length,visible_amenities:zo?4:null===Ie||void 0===Ie?void 0:Ie.length}),Wo(!zo)},style:{cursor:"pointer",color:"var(--blue)",fontWeight:"500",background:"transparent",textDecoration:"underline"},children:zo?"Show Less":"+".concat(Ie.length-4," More")})]}),0===Ue||Li&&(null===Y||void 0===Y||!Y.ratePlans)||0===(null===Y||void 0===Y||null===(R=Y.allPricingWithMlos)||void 0===R?void 0:R.length)?(0,E.jsxs)("div",{className:"soldOutNotifyBox",children:[(0,E.jsx)("div",{className:"soldOutStatusText",children:Ii("sold_out_for_these_dates","Sold Out for these dates")}),(0,E.jsxs)("button",{className:Ni?"getNotifiedButtonHover":"getNotifiedButton",onMouseEnter:()=>Ai(!0),onMouseLeave:()=>Ai(!1),onClick:()=>fi(!0),children:[(0,E.jsx)(G.A,{size:24}),"Get Notified"]})]}):Ue<3&&!k.v.includes(null===Ri||void 0===Ri?void 0:Ri.id)&&!k.iK.includes(null===Ri||void 0===Ri?void 0:Ri.id)&&(0,E.jsx)("div",{className:"soldOut",children:Ue+" "+Ii("room_left_hurry_up")}),Gi&&0!==Ue&&(0,E.jsx)("div",{className:"room__hourlyContainer",children:null===we||void 0===we?void 0:we.map(e=>{var o;let i=!((0,k.j6)((0,k.KA)(null===e||void 0===e?void 0:e.firstCheckInTime),zi)&&(0,k.j6)(zi,(0,k.KA)(null===e||void 0===e?void 0:e.lastCheckInTime))),n="priceConfigDifference"===Pe,d=Ei<=ke?Ei:ke,t=Ei<=be;return(0,E.jsxs)("div",{className:"roomSlot ".concat((null===(o=Hi[null===Y||void 0===Y?void 0:Y.id])||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)&&"selectedSlot"," ").concat(i&&"slotDisable"," "),onClick:()=>((e,o)=>{if(o)return;(0,j.fireGtmEvent)("slot_selected",{slot:e}),ki({type:_.A.SET_SLOTS,payload:{}});let i={};const{HotelRooms:n=[]}=Ri;let d=(null===n||void 0===n?void 0:n.filter(o=>{var i;return null===o||void 0===o||null===(i=o.hourly)||void 0===i?void 0:i.some(o=>(null===o||void 0===o?void 0:o.hour)===(null===e||void 0===e?void 0:e.hour))}))||[],t=[];
1if(d.forEach(o=>{const{hourly:n=[]}=o;if((null===n||void 0===n?void 0:n.length)>0){var d={};let s=(null===n||void 0===n?void 0:n.filter(o=>(null===o||void 0===o?void 0:o.hour)===(null===e||void 0===e?void 0:e.hour)))||[];var r,a;(null===s||void 0===s?void 0:s.length)>0&&(d=s[0]),(null===s||void 0===s?void 0:s.length)>0&&(t=[...t,...(null===Pi||void 0===Pi||null===(r=Pi.filter(e=>(null===e||void 0===e?void 0:e.id)===(null===o||void 0===o?void 0:o.id)))||void 0===r?void 0:r.map(e=>null===e||void 0===e?void 0:e.id))||[]],i=(0,l.A)((0,l.A)({},i),{},{[null===(a=d)||void 0===a?void 0:a.roomId]:d}))}}),Object.keys(i).length>0){if([...Pi].forEach(e=>{t.includes(null===e||void 0===e?void 0:e.id)||ki({type:_.A.DESELECT_ROOM,payload:e})}),ki({type:_.A.SET_SLOTS,payload:i}),0===Te&&0===(null===Pi||void 0===Pi?void 0:Pi.length))if(0===dl){let e=Ei<=(null===Y||void 0===Y?void 0:Y.maxGuestCount)?Ei:ke;ki({type:_.A.SELECT_ROOM,payload:(0,l.A)({idx:1,sAdult:e,sChild:0,sInfant:0},Y)})}else ki({type:_.A.SET_ROOM,payload:Y});ki({type:_.A.SET_HOUR,payload:null===e||void 0===e?void 0:e.hour})}})(e,i),children:[(0,E.jsx)("span",{children:(()=>{const o=void 0!==(null===e||void 0===e?void 0:e.slotPrice)&&null!==(null===e||void 0===e?void 0:e.slotPrice)?e.slotPrice:ul*Number(null===e||void 0===e?void 0:e.percentage),i=t?o:n&&Re?o+Re[d]:o+(De[d]*ul-ul);return(0,E.jsx)(L.A,{amount:i})})()}),(0,E.jsxs)("p",{children:[null===e||void 0===e?void 0:e.hour," ",Ii("hour")]})]},null===e||void 0===e?void 0:e.id)})}),!Li&&(null===mi||void 0===mi?void 0:mi.name)&&gi&&(0,E.jsx)("div",{className:"secretMemberTitleBox",style:{padding:"0px 20px"},children:(0,E.jsx)("h3",{children:null===mi||void 0===mi?void 0:mi.name})}),(0,E.jsxs)("div",{className:"room__midContainer",children:[!Li&&(0,E.jsxs)("div",{className:"priceSection",children:[(0,E.jsx)("div",{className:"discountedPriceContainer",children:0!==Ue&&al>0&&(0,E.jsx)(E.Fragment,{children:al>0&&(0,E.jsxs)("b",{children:[(0,E.jsx)("span",{className:"discountedPrice",children:(0,E.jsx)(L.A,{amount:(Number(sl)||0)-(null!==Ri&&void 0!==Ri&&Ri.isTaxIncluded&&Number(rl)||0)/Math.max(Wi,1)})})," ",(0,E.jsxs)("span",{className:"discountedPrice",style:{textDecoration:"none",color:"var(--green)"},children:[" ",(0,E.jsx)(L.A,{amount:al})," ",Ii("off")]})]})})}),(null===Yi||void 0===Yi?void 0:Yi.length)<1&&y.A.get("subscribed")&&(0,E.jsx)("div",{className:"discountedPriceContainer",style:{marginTop:"10px"},"aria-label":"Special subscriber pricing",children:(0,E.jsx)("b",{children:(0,E.jsx)("span",{className:"discountedPrice",children:(0,E.jsx)(L.A,{amount:1.15*tl*z})})})}),Ue>0&&!Gi&&!Li&&(0,E.jsxs)("div",{className:"roomTaxPrice",children:[(0,E.jsxs)("p",{children:[(0,E.jsxs)("b",{children:[(0,E.jsx)(L.A,{amount:tl})," "]}),(0,E.jsxs)("b",{children:[(0,E.jsxs)("span",{children:["/ ",Wi>1?Wi:null]})," ",(0,E.jsx)("span",{children:Ii((0,k.g3)(Wi,"night"))})]})]}),rl>0?(0,E.jsxs)("p",{children:[(0,E.jsxs)("span",{children:[Ii("Plus")," "]}),"",Ii("taxes")]}):Ii("incl_of_taxes"),Zo.length>=1&&(0,E.jsxs)("p",{style:{color:"#000",fontSize:"0.9rem"},children:[Uo," ",Ii((0,k.g3)(Uo,"guest"))," ",qo," ",Ii((0,k.g3)(qo,$e?"bed":"room"))]}),Si?(0,E.jsxs)("span",{style:{maxWidth:"220px"},children:["(This room can accommodate up to ",ke||1," ","guests)"]}):null]})]}),!Gi&&!Li&&!$&&(0,E.jsx)(v.N_,{className:"viewMore",to:{pathname:"/room-view/"+xe,state:{room:Y}},children:(0,E.jsx)("p",{children:Ii("view_room")})}),0!==Ue&&(!Li||Gi)&&(0,E.jsx)(E.Fragment,{children:!1===(null===hl||void 0===hl?void 0:hl.meetsMLOS)?(0,E.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",padding:window.innerWidth<=768?"8px 12px":"10px 16px",backgroundColor:"var(--blue-in-range)",border:"1px solid var(--blue-solid)",borderRadius:"8px",cursor:"not-allowed",width:window.innerWidth<=768?"100%":"250px",maxWidth:window.innerWidth<=768?"180px":"250px"},children:[(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:window.innerWidth<=768?"4px":"6px",fontSize:window.innerWidth<=768?"11px":"13px",color:"var(--blue-solid)",fontWeight:"600"},children:[(0,E.jsx)("svg",{width:window.innerWidth<=768?"14":"16",height:window.innerWidth<=768?"14":"16",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0},children:(0,E.jsx)("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM11 15H9V13H11V15ZM11 11H9V5H11V11Z",fill:"var(--blue-solid)"})}),(0,E.jsxs)("span",{children:["Min ",hl.minLOS," Nights Required"]})]}),(0,E.jsx)("div",{style:{fontSize:window.innerWidth<=768?"9px":"11px",color:"var(--blue-solid)",textAlign:"center",lineHeight:"1.3"},children:"Extend your stay to unlock"})]}):(!Gi||(null===Pi||void 0===Pi?void 0:Pi.length)>0)&&(0===dl?!(Zo.length>0)||Gi||null!==Pi&&void 0!==Pi&&Pi.some(e=>(null===e||void 0===e?void 0:e.id)===(null===Y||void 0===Y?void 0:Y.id))?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("label",{htmlFor:"rmSelect".concat(null===Y||void 0===Y?void 0:Y.id),style:{color:"#fff",position:"absolute",zIndex:"-1"},children:Ii("select_rooms")}),(0,E.jsxs)("select",{id:"rmSelect".concat(null===Y||void 0===Y?void 0:Y.id),value:Te,className:"roomSelectDropdown","aria-label":"Select number of ".concat($e?"beds":(0,H.$7)(null===Ri||void 0===Ri?void 0:Ri.userId)?null===Ri||void 0===Ri||null===(O=Ri.HotelType)||void 0===O?void 0:O.name:"rooms"),style:{background:Te>0&&"#fff",color:Te>0?k.dF.includes(null===Ri||void 0===Ri?void 0:Ri.id)?"var(--primary-color)":"var(--blue)":"#fff",fontWeight:Te>0&&"bold"},onChange:e=>{let o=Number(e.target.value);(0,j.fireGtmEvent)("room_added",{selectedRooomCount:o,room:Y});let i=JSON.parse(localStorage.getItem("userHistory"))||{},n={id:null===Ri||void 0===Ri?void 0:Ri.id,checkInDate:d()(null===U||void 0===U?void 0:U.startDate).format("YYYY-MM-DD"),checkOutDate:d()(null===U||void 0===U?void 0:U.endDate).format("YYYY-MM-DD"),currenDate:d()().format("YYYY-MM-DD HH:mm"),event:"room_added"},t=i[null===Ri||void 0===Ri?void 0:Ri.id]||[];
1if(i=(0,l.A)((0,l.A)({},i),{},{[null===Ri||void 0===Ri?void 0:Ri.id]:[...t,n]}),localStorage.setItem("userHistory",JSON.stringify(i)),y.A.get("newHighEventCalled")||!1||((0,j.pixelHighIntent)("potential_guest"),y.A.set("newHighEventCalled",!0)),_i(o),o>=0){var r;if(ki({type:_.A.RESET_ROOM,payload:{id:null===Y||void 0===Y?void 0:Y.id,resetAdn:!1}}),o>0&&window&&null!==(r=window)&&void 0!==r&&r.gtag){var a,s,u,v,c,m,h,p,f;const e=null!==(a=null!==(s=null===Ri||void 0===Ri?void 0:Ri.chainId)&&void 0!==s?s:y.A.get("chainId"))&&void 0!==a?a:"",i=null!==(u=null!==(v=null===Ri||void 0===Ri?void 0:Ri.name)&&void 0!==v?v:y.A.get("hotelName"))&&void 0!==u?u:"";null===(c=window)||void 0===c||c.gtag("event","add_to_cart",{chain_id:String(e||""),chainId:e?Number(e):null,hotel_id:String((null===Ri||void 0===Ri?void 0:Ri.id)||""),hotelId:null!==Ri&&void 0!==Ri&&Ri.id?Number(null===Ri||void 0===Ri?void 0:Ri.id):null,hotel_name:String(i||""),hotelName:String(i||""),booking_source:y.A.get("source")||"Direct",value:((null===Y||void 0===Y||null===(m=Y.pricing)||void 0===m||null===(h=m[0])||void 0===h?void 0:h.price)||Ee)*o,currency:(null===Ri||void 0===Ri?void 0:Ri.currency)||"INR",items:[{id:null===Ri||void 0===Ri?void 0:Ri.id,price:(null===Y||void 0===Y||null===(p=Y.pricing)||void 0===p||null===(f=p[0])||void 0===f?void 0:f.price)||Ee,item_id:null===Ri||void 0===Ri?void 0:Ri.id,item_name:null===Y||void 0===Y?void 0:Y.roomName,item_category:String(e||""),quantity:o,start_date:d()(null===U||void 0===U?void 0:U.startDate).format("YYYY-MM-DD"),end_date:d()(null===U||void 0===U?void 0:U.endDate).format("YYYY-MM-DD"),google_business_vertical:"hotel_rental"}]})}let e=Ei+Oi<=ke?Ei:ke,i=null!==Y&&void 0!==Y&&Y.extraChildPrice&&Ei+Oi<=ke?Oi:0;for(let n=0;n<o;n++){let o=(0,l.A)({idx:n+1,sAdult:e,sChild:i,sInfant:0},Y);ki((0,x.TG)(o))}try{const e=qo>0?(tl+rl)/qo:tl+rl;if(o>Te){const i={content_ids:[(null===Y||void 0===Y?void 0:Y.id)||(null===Y||void 0===Y?void 0:Y.hotelRoomId)],content_type:"hotel_room",value:parseFloat(e*(o-Te)),currency:(null===Ri||void 0===Ri?void 0:Ri.currency)||"INR",contents:[{id:(null===Y||void 0===Y?void 0:Y.id)||(null===Y||void 0===Y?void 0:Y.hotelRoomId),quantity:o-Te}],num_items:o-Te,num_adults:Ei,num_children:Oi};(0,j.newFBEvents)("AddToCart",i)}else if(o<Te){const i={content_ids:[(null===Y||void 0===Y?void 0:Y.id)||(null===Y||void 0===Y?void 0:Y.hotelRoomId)],content_type:"hotel_room",value:parseFloat(e*(Te-o)),currency:(null===Ri||void 0===Ri?void 0:Ri.currency)||"INR",contents:[{id:(null===Y||void 0===Y?void 0:Y.id)||(null===Y||void 0===Y?void 0:Y.hotelRoomId),quantity:Te-o}],num_items:Te-o,num_adults:Ei,num_children:Oi};(0,j.newFBEvents)("RemoveFromCart",i)}}catch(C){console.log("Pixel failed")}if(o>Te){try{(0,j.pushRoomSelectedEvent)({room:Y,hotelData:Ri,dateRange:U,price:Ee,numberOfRooms:o,totalAdult:Ei,totalChild:Oi,totalInfant:Ti,promotions:Yi})}catch(N){console.error("Analytics tracking error (room_selected):",N)}(0,j.pushRoomAddedEvent)({room:Y,hotelData:Ri,dateRange:U,price:Ee,numberOfRooms:o,totalAdult:Ei,totalChild:Oi,totalInfant:Ti,promotions:Yi})}}else if(o<0&&Te>0){var g,b;ki({type:_.A.RESET_ROOM,payload:{id:null===Y||void 0===Y?void 0:Y.id,resetAdn:!0}}),(0,j.fireGtmEvent)("room_removed",{room:Y});try{const e=qo>0?(tl+rl)/qo:tl+rl,o={content_ids:[(null===Y||void 0===Y?void 0:Y.id)||(null===Y||void 0===Y?void 0:Y.hotelRoomId)],content_type:"hotel_room",value:parseFloat(e*Te),currency:(null===Ri||void 0===Ri?void 0:Ri.currency)||"INR",contents:[{id:(null===Y||void 0===Y?void 0:Y.id)||(null===Y||void 0===Y?void 0:Y.hotelRoomId),quantity:Te}],num_items:Te,num_adults:Ei,num_children:Oi};(0,j.newFBEvents)("RemoveFromCart",o)}catch(C){console.log("Pixel failed")}if(103376===(null===Ri||void 0===Ri?void 0:Ri.userId)&&window&&null!==(g=window)&&void 0!==g&&g.gtag)null===(b=window)||void 0===b||b.gtag("event","remove_from_cart",{value:Ee,currency:null===Ri||void 0===Ri?void 0:Ri.currency,items:[{id:null===Ri||void 0===Ri?void 0:Ri.id,price:Ee,item_id:null===Ri||void 0===Ri?void 0:Ri.id,item_name:null===Y||void 0===Y?void 0:Y.roomName,start_date:d()(null===U||void 0===U?void 0:U.startDate).format("YYYY-MM-DD"),end_date:d()(null===U||void 0===U?void 0:U.endDate).format("YYYY-MM-DD"),google_business_vertical:"hotel_rental"}]})}},children:[(0,E.jsxs)("option",{value:-1,children:[Ii("select")," ",$e?Ii("bed"):(0,H.$7)(null===Ri||void 0===Ri?void 0:Ri.userId)?null===Ri||void 0===Ri||null===(T=Ri.HotelType)||void 0===T?void 0:T.name:Ii("room")]}),Array.from({length:Ue}).map((e,o)=>{var i,l;return(0,E.jsxs)("option",{value:o+1,children:[o+1," ",o+1===1?$e?Ii("bed"):(0,H.$7)(null===Ri||void 0===Ri?void 0:Ri.userId)?null===Ri||void 0===Ri||null===(i=Ri.HotelType)||void 0===i?void 0:i.name:Ii("room"):$e?Ii("Beds"):(0,H.$7)(null===Ri||void 0===Ri?void 0:Ri.userId)?"".concat(null===Ri||void 0===Ri||null===(l=Ri.HotelType)||void 0===l?void 0:l.name,"s"):Ii("rooms")]},o)})]})]}):(0,E.jsxs)("button",{onClick:()=>
1{if(Zo.length<=0)return;const e=d()(null===U||void 0===U?void 0:U.startDate),o=d()(null===U||void 0===U?void 0:U.endDate).diff(e,"day");if(null!==Ri&&void 0!==Ri&&Ri.minBookingNights&&o<Ri.minBookingNights)h.A.error("Minimum booking nights required: ".concat(Ri.minBookingNights));else{for(let e=0;e<Zo.length;e++){var i,n,t;let o=(0,l.A)({idx:e+1,sAdult:null===(i=Zo[e])||void 0===i?void 0:i.adults,sChild:null===(n=Zo[e])||void 0===n?void 0:n.children,sInfant:null===(t=Zo[e])||void 0===t?void 0:t.infants},Y);ki((0,x.TG)(o))}(0,j.fireGtmEvent)("searchRoom_added",{searchData:Zo,room:Y}),(0,j.pushRoomSelectedEvent)({room:Y,hotelData:Ri,dateRange:U,price:Ee,numberOfRooms:Zo.length,totalAdult:Ei,totalChild:Oi,totalInfant:Ti,promotions:Yi}),(0,j.pushRoomAddedEvent)({room:Y,hotelData:Ri,dateRange:U,price:Ee,numberOfRooms:Zo.length,totalAdult:Ei,totalChild:Oi,totalInfant:Ti,promotions:Yi});try{const e=Zo.reduce((e,o)=>e+((null===o||void 0===o?void 0:o.adults)||0),0),o=Zo.reduce((e,o)=>e+((null===o||void 0===o?void 0:o.children)||0)+((null===o||void 0===o?void 0:o.infants)||0),0),i={content_ids:[(null===Y||void 0===Y?void 0:Y.id)||(null===Y||void 0===Y?void 0:Y.hotelRoomId)],content_type:"hotel_room",value:parseFloat(tl+rl),currency:(null===Ri||void 0===Ri?void 0:Ri.currency)||"INR",contents:[{id:(null===Y||void 0===Y?void 0:Y.id)||(null===Y||void 0===Y?void 0:Y.hotelRoomId),quantity:Zo.length}],num_items:Zo.length,num_adults:e,num_children:o};(0,j.newFBEvents)("AddToCart",i)}catch(r){console.log("Pixel failed")}}},className:"hAddonAdd btnShadow",style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"10px",padding:"10px 16px",
1width:"max-content",fontSize:"1rem"},children:[Ii("select")," ",$e?Ii("bed"):(0,H.$7)(null===Ri||void 0===Ri?void 0:Ri.userId)?null===Ri||void 0===Ri||null===(M=Ri.HotelType)||void 0===M?void 0:M.name:Ii("room")]}):(0,E.jsx)(le,{value:Te,setValue:Ye,maxValue:Ue,room:Y,price:Ee,isHourlyRoom:Gi}))})]}),!Li&&Ue>0&&!vl&&(0,E.jsx)(B,{price:(tl/Math.max(Wi,1)).toFixed((0,k.S2)(null===Ri||void 0===Ri?void 0:Ri.currency)),getMembershipDetails:(e,o)=>hi({name:e,description:o}),getSecretMemberDealUrl:ve,applyPromotion:ce,promotionRes:me,room:Y}),Gi&&Te>0&&(0,E.jsxs)("div",{style:{width:"100%",padding:"0 20px",textAlign:"right",fontSize:"0.8rem",color:"green"},children:[Te," ",Ii(Te>1?$e?"Beds":"rooms":$e?"bed":"room")," ",Ii("selected")]})]})]}),cl&&Li&&Ue>0&&ml&&(0,E.jsx)("div",{className:"rp-twoCol__right",children:(e=>{const o=Object.values(null!==(e=null===Y||void 0===Y?void 0:Y.ratePlans)&&void 0!==e?e:{}).sort((e,o)=>{var i,l;return((null===e||void 0===e||null===(i=e.prices)||void 0===i?void 0:i.priceAfterDiscount)||Number.MAX_VALUE)-((null===o||void 0===o||null===(l=o.prices)||void 0===l?void 0:l.priceAfterDiscount)||Number.MAX_VALUE)});return((null===ge||void 0===ge?void 0:ge.size)>0?o.filter(e=>ge.has((e=>{try{const o=null!==e&&void 0!==e&&e.ratePlanConfig?JSON.parse(e.ratePlanConfig):{};return(null===o||void 0===o?void 0:o.name)||(null===e||void 0===e?void 0:e.ratePlanCode)}catch(o){return null===e||void 0===e?void 0:e.ratePlanCode}})(e))):o).map((e,o)=>{var i;return(0,E.jsx)(ae,{idx:null===e||void 0===e?void 0:e.id,setAvailableRooms:Ve,maxRoomPerBooking:null===Ri||void 0===Ri?void 0:Ri.maxRoomPerBooking,rpRoomCount:Yo,availableRooms:Ue,setRPRoomCount:Bo,selectedRPRoomCount:Fo,setSelectedRPRoomCount:Go,room:Y,extraPrice:z,code:null===e||void 0===e?void 0:e.ratePlanCode,rateplan:e,notificationStyle:Qi,handleRoomPrice:se,pricingfornotifications:ue,getSecretMemberDealUrl:ve,applyPromotion:ce,promotionRes:me,sortedRooms:fe,autoSelect:(null===qi||void 0===qi||null===(i=qi.room)||void 0===i?void 0:i.id)===(null===Y||void 0===Y?void 0:Y.id)&&(null===qi||void 0===qi?void 0:qi.ratePlanCode)===(null===e||void 0===e?void 0:e.ratePlanCode)&&(null===qi||void 0===qi?void 0:qi.selected)},(null===e||void 0===e?void 0:e.ratePlanCode)||o)})})()})]}),!(cl&&Li&&Ue>0&&ml)&&(0,E.jsx)("div",{className:"room__bottomContainer",style:{flexDirection:"column",padding:"0 10px"},children:Li&&!Gi&&Ue>0&&(null===Y||void 0===Y?void 0:Y.ratePlans)&&((e,o)=>{const i=null===(e=Object.values(null!==(o=null===Y||void 0===Y?void 0:Y.ratePlans)&&void 0!==o?o:{}))||void 0===e?void 0:e.sort((e,o)=>{var i,l;return((null===e||void 0===e||null===(i=e.prices)||void 0===i?void 0:i.priceAfterDiscount)||Number.MAX_VALUE)-((null===o||void 0===o||null===(l=o.prices)||void 0===l?void 0:l.priceAfterDiscount)||Number.MAX_VALUE)}),l=e=>{try{const o=null!==e&&void 0!==e&&e.ratePlanConfig?JSON.parse(e.ratePlanConfig):{};return(null===o||void 0===o?void 0:o.name)||(null===e||void 0===e?void 0:e.ratePlanCode)}catch(o){return null===e||void 0===e?void 0:e.ratePlanCode}};(null===ge||void 0===ge?void 0:ge.size)>0&&(console.log("[rpFilter] room:",null===Y||void 0===Y?void 0:Y.roomName,"| activeFilter (names):",[...ge]),console.log("[rpFilter] allPlans names + prices:",i.map(e=>{var o;return{name:l(e),ratePlanCode:null===e||void 0===e?void 0:e.ratePlanCode,priceAfterDiscount:null===e||void 0===e||null===(o=e.prices)||void 0===o?void 0:o.priceAfterDiscount}})));const n=(null===ge||void 0===ge?void 0:ge.size)>0?i.filter(e=>{const o=l(e),i=ge.has(o);return console.log("[rpFilter] \u2192",o,i?"MATCH":"skip"),i}):i;return(null===ge||void 0===ge?void 0:ge.size)>0&&console.log("[rpFilter] filteredPlans:",n.map(e=>({name:l(e),ratePlanCode:null===e||void 0===e?void 0:e.ratePlanCode}))),0===n.length?null:n.map((e,o)=>{var i;return(0,E.jsx)(ae,{idx:null===e||void 0===e?void 0:e.id,setAvailableRooms:Ve,maxRoomPerBooking:null===Ri||void 0===Ri?void 0:Ri.maxRoomPerBooking,rpRoomCount:Yo,availableRooms:Ue,setRPRoomCount:Bo,selectedRPRoomCount:Fo,setSelectedRPRoomCount:Go,room:Y,extraPrice:z,code:null===e||void 0===e?void 0:e.ratePlanCode,rateplan:e,notificationStyle:Qi,handleRoomPrice
1:se,pricingfornotifications:ue,getSecretMemberDealUrl:ve,applyPromotion:ce,promotionRes:me,sortedRooms:fe,autoSelect:(null===qi||void 0===qi||null===(i=qi.room)||void 0===i?void 0:i.id)===(null===Y||void 0===Y?void 0:Y.id)&&(null===qi||void 0===qi?void 0:qi.ratePlanCode)===(null===e||void 0===e?void 0:e.ratePlanCode)&&(null===qi||void 0===qi?void 0:qi.selected)},(null===e||void 0===e?void 0:e.ratePlanCode)||o)})})()}),!$e&&0===dl&&(0,E.jsx)("div",{className:"room__bottomContainer",style:{borderBottom:"none",borderRadius:"0px"},children:(0,E.jsx)("div",{className:"newSelectionContainer",children:Array.from({length:Te}).map((e,o)=>(0,E.jsx)(te,{id:o+1,defaultGuestCount:be,maxGuestCount:ke,childAgeSplit:(null===Y||void 0===Y?void 0:Y.childAgeSplit)||12,childAgeLimit:(null===Y||void 0===Y?void 0:Y.childAgeLimit)||18,extraChildPrice:null===Y||void 0===Y?void 0:Y.extraChildPrice,extraInfantPrice:null===Y||void 0===Y?void 0:Y.extraInfantPrice,room:Y},o))})}),(0,E.jsx)("div",{className:"room__bottomContainer",style:{borderRadius:0===Te&&"8px"},children:(0,E.jsx)("div",{className:"room__amenities",style:{borderTop:0===dl&&(null===Io||void 0===Io?void 0:Io.some(e=>{var o;return"meal"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.category)}))&&"1px solid #dadada",borderRadius:0===dl&&"0 0 8px 8px"},children:null===Io||void 0===Io?void 0:Io.map((e,o)=>{var i,l,n,d,t,r,a,s,u,v,c,m;const h=null===e||void 0===e||null===(i=e.Addon)||void 0===i?void 0:i.name;return(0,E.jsx)("div",{className:"room__addons",children:Te>0&&"0.00"!==e.price?"person"===(null===e||void 0===e||null===(l=e.Addon)||void 0===l?void 0:l.category)?W>be&&be<ke&&0!==dl&&(0,E.jsxs)("div",{className:"room__addon peopleAddon",children:[(0,E.jsx)(ne,{name:null===e||void 0===e||null===(n=e.Addon)||void 0===n?void 0:n.name,extraChild:ze,setExtraChild:We,extraAdult:Le,setExtraAdult:He,room:Y,maxGuestCount:ke,addon:e,setPeople:Ge,defaultGuestCount:be,totalPeople:W,guestToDisplay:bo,roomCount:Te,adultAddons:wo,extraInfant:Mo,setExtraInfant:Eo})," ",(0,E.jsxs)("div",{className:"addonRearrange",children:[(0,E.jsxs)("b",{children:["Extra Adult"===(null===e||void 0===e||null===(d=e.Addon)||void 0===d?void 0:d.name)?(0,E.jsx)("img",{src:X,alt:"user",width:24}):(0,E.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/images/kid.svg",alt:"user",width:20})," ",Ii("add")," ",(null===e||void 0===e||null===(t=e.Addon)||void 0===t?void 0:t.displayName)||(null===e||void 0===e||null===(r=e.Addon)||void 0===r?void 0:r.name)," "]})," ",(0,E.jsxs)("p",{children:["(",(0,E.jsx)(L.A,{amount:"Extra Adult"===(null===e||void 0===e||null===(a=e.Addon)||void 0===a?void 0:a.name)?(null===(s=wo[Le])||void 0===s?void 0:s.price)||(null===(u=wo[(null===wo||void 0===wo?void 0:wo.length)-1])||void 0===u?void 0:u.price):null===e||void 0===e?void 0:e.price}),"/ ",Ii("room")," / ",Ii("day"),") (",Ii("incl_of_taxes"),")"]})]})]}):"meal"===(null===e||void 0===e||null===(v=e.Addon)||void 0===v?void 0:v.category)?(0,E.jsxs)("div",{className:"room__addon peopleAddon",children:[(0,E.jsx)(de,{room:Y,name:null===e||void 0===e||null===(c=e.Addon)||void 0===c?void 0:c.name,addon:e,breakfast:go,lunch:po,dinner:mo,setBreakfast:xo,setLunch:fo,setDinner:ho,addAddon:x.Oz,deselectAddon:x.sd,maxGuestCount:ke*(null===Pi||void 0===Pi||null===(m=Pi.filter(e=>(null===e||void 0===e?void 0:e.id)===(null===Y||void 0===Y?void 0:Y.id)))||void 0===m?void 0:m.length)}),(0,E.jsxs)("div",{className:"addonRearrange",children:[(0,E.jsxs)("b",{children:[(0,E.jsx)("img",{src:Z,alt:"food",width:20})," ",h," "]}),(0,E.jsxs)("p",{children:["( ",(0,E.jsx)(L.A,{amount:null===e||void 0===e?void 0:e.price})," /",Ii("person")," / ",Ii("day"),") (",Ii("incl_of_taxes"),")"]})]})]}):null:(0,E.jsx)(E.Fragment,{})},o)})})}),!y.A.get("subscribed")&&!k.Mn.includes(y.A.get("source"))&&!window.location.href.includes("/rooms/")&&F&&Ue>0&&(0,E.jsxs)("div",{className:"splPriceUnlock offerBar",children:[(0,E.jsx)("p",{className:"offerbarTxt",children:Ii("unlock_additional_discount")}),(0,E.jsxs)("button",{className:"offerBarBtn",onClick:()=>{(0,j.fireGtmEvent)("subscribe_popup_shown",{position:"room"}),K(!0)},style:{fontSize:"0.8rem"},children:[Ii("unlock")," \ud83d\udd13"]})]}),Be&&(0,E.jsx)(t.Suspense,{fallback:null,children:(0,E.jsx)(Q,{images:null===je||void 0===je?void 0:je.map(e=>"".concat(null===e||void 0===e?void 0:e.cdnImageUrl,"?tr=w-1200,q-80,f-auto")),currentIndex:ll,onClose:Fe,altPrefix:_e})}),pi&&(0,E.jsx)(t.Suspense,{fallback:null,children:(0,E.jsx)(ee,{onClose:()=>fi(!1),dateRange:U,adults:he,child:pe})})]})}},6585:(e,o,i)=>{i.d(o,{A:()=>t});i(5043);
1var l=i(7950),n=i(5346),d=i(579);const t=e=>{let{isOpen:o,setIsOpen:i,children:t,width:r,height:a,overflow:s,drawerName:u="drawer"}=e;return l.createPortal((0,d.jsx)("div",{className:"drawer-overlay ".concat(o?"open":""),onClick:()=>{const e=!o;(0,n.fireGtmEvent)(e?"drawer_opened":"drawer_closed",{drawer_name:u,drawer_width:r,drawer_height:a}),i(e)},children:(0,d.jsx)("div",{className:"drawer-content ".concat(o?"open":""),style:{width:r,height:a,overflow:s},onClick:e=>e.stopPropagation(),children:t})}),document.body)}},7459:()=>{}}]); 2//# sourceMappingURL=2308.0023906d.chunk.js.map
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.