PageSourceSearch

https://hotelzify.com/static/js/6264.2d5acd1c.chunk.js

js hotelzify.com collected 2026-10-01 15:36:01 UTC 216,228 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunklanding_page=self.webpackChunklanding_page||[]).push([[6264],{1023:(e,o,l)=>{l.r(o),l.d(o,{default:()=>wl});var n=l(45),i=l(9379),t=l(446),a=l.n(t),d=l(5043),s=l(801),r=l(1591),c=l(7100),u=l(270),v=(l(4927),l(8601)),m=l(3751),p=l(3716),h=l.n(p),g=(l(1029),l(2895),l(1987),l(6713),l(5658),l(4117));const _="RetargetingPopup_overlay__1wqbV",x="RetargetingPopup_card__d8lMq",f="RetargetingPopup_magstripe__9BBzn",y="RetargetingPopup_closeButton__B-QD2",b="RetargetingPopup_body__3dhf4",j="RetargetingPopup_chipRow__5mW8A",k="RetargetingPopup_chip__OXsSl",C="RetargetingPopup_keyMeta__8Witm",A="RetargetingPopup_eyebrow__n440q",N="RetargetingPopup_headline__pPV1M",P="RetargetingPopup_message__FAaZj",I="RetargetingPopup_ctaButton__WwpdX",S="RetargetingPopup_ctaArrow__BfEtR",w="RetargetingPopup_feedbackPanel__Dkm7E",D="RetargetingPopup_textarea__YY9G0",M="RetargetingPopup_submitButton__GDm6c";var R=l(579);const B=e=>{var o,l;let{show:n,onClose:i,retargetingPopupConfig:t,feedbackText:a,onFeedbackTextChange:d,onFeedbackSubmit:s}=e;const{t:r}=(0,g.Bd)();if(!n)return null;const c=null===t||void 0===t||null===(o=t.header)||void 0===o?void 0:o.trim(),u=null===t||void 0===t||null===(l=t.content)||void 0===l?void 0:l.trim();return Boolean(c&&u)?(0,R.jsx)("div",{className:_,onClick:i,children:(0,R.jsxs)("div",{className:x,onClick:e=>e.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":c,children:[(0,R.jsx)("div",{className:f}),(0,R.jsx)("button",{type:"button",className:y,onClick:i,"aria-label":"Close and return to checkout",children:(0,R.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",children:(0,R.jsx)("path",{d:"M1 1L12 12M12 1L1 12",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}),(0,R.jsxs)("div",{className:b,children:[(0,R.jsxs)("div",{className:j,children:[(0,R.jsx)("div",{className:k}),(0,R.jsx)("div",{className:C,children:(0,R.jsx)("span",{className:A,children:"Your key \xb7 still active"})})]}),(0,R.jsx)("h2",{className:N,children:c}),(0,R.jsx)("p",{className:P,children:u}),(0,R.jsxs)("button",{type:"button",className:I,onClick:i,children:["Continue booking",(0,R.jsx)("svg",{className:S,width:"15",height:"11",viewBox:"0 0 15 11",fill:"none",children:(0,R.jsx)("path",{d:"M1 5.5H14M14 5.5L9.5 1M14 5.5L9.5 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),(0,R.jsxs)("div",{className:w,children:[(0,R.jsx)("textarea",{className:D,value:a,onChange:e=>d(e.target.value),name:"requests",placeholder:r("improvement_feedback")}),(0,R.jsx)("button",{type:"button",className:M,onClick:s,children:r("submit")})]})]})]})}):(0,R.jsx)("div",{className:"checkoutPageModal",children:(0,R.jsxs)("div",{className:"checkoutPageContainer",children:[(0,R.jsx)("div",{className:"checkoutPageClose",onClick:i,children:"X"}),(0,R.jsxs)("div",{className:"checkoutPageContainerHeader",children:[(0,R.jsx)("p",{style:{fontSize:"1.2rem"},children:r("what_went_wrong")}),(0,R.jsx)("img",{src:"https://hotelzify-dev-images-bucket.s3.ap-south-1.amazonaws.com/61165f76-efc4-4fbf-8aa6-9b34d7848a4b.gif",alt:"can we ask why?"}),(0,R.jsxs)("p",{children:[r("share_feedback")," "]}),(0,R.jsxs)("p",{style:{color:"#1A7971"},children:[r("win_voucher")," \ud83c\udf89"]})]}),(0,R.jsxs)("div",{className:"checkoutPageContainerBody",children:[(0,R.jsx)("textarea",{value:a,onChange:e=>d(e.target.value),name:"requests",placeholder:r("improvement_feedback"),cols:"20",rows:"5"}),(0,R.jsx)("div",{className:"checkoutPageContainerFooter",children:(0,R.jsx)("button",{onClick:s,children:r("submit")})})]})]})})};var E=l(8984),T=l(4849),O=l(3976),Y=l(5989);function F(e,o){const l=null!=(null===o||void 0===o?void 0:o.id)&&String(o.id)===String(e)?o.publicId:null;return"/bookings/confirmation/".concat(l||e)}var z=l(6471),G=l(475),H=l(7478),L=(l(9368),l(5346)),W=l(6491),V=l(1469),q=l(7368),U=l(7343);l(9280),l(5493);var J=l(2064);l(2015);l(8978);var K=l(8780),X=l(6099),Q=l(6851),Z=l(1683),$=l(8838);const ee=e=>{let{coupon:o,onComplete:l,isRetargeting:n}=e;const i=1e3,t=(0,d.useRef)(null);(0,d.useEffect)(()=>
1{(0,L.fireGtmEvent)("coupon_animation_shown",{coupon_code:(null===o||void 0===o?void 0:o.name)||(null===o||void 0===o?void 0:o.code),coupon_discount:null===o||void 0===o?void 0:o.discount,coupon_discount_type:null===o||void 0===o?void 0:o.discountType,is_retargeting:n,event_category:"Coupon",event_label:n?"Retargeting Coupon Animation":"Coupon Applied Animation"});const e=Date.now()+i,a=document.createElement("canvas");a.className="confetti-canvas",document.body.appendChild(a);const d=$.A.create(a,{resize:!0,useWorker:!0}),s=()=>{const o=Date.now(),t=Math.max(0,e-o),r=t/i*10;d({particleCount:Math.ceil(r/2),spread:200,origin:{y:.5},disableForReducedMotion:!0,colors:n?["#ffa726","#ff9800","#ff6f00"]:["#065af3","#0078d4"]}),t>0?requestAnimationFrame(s):(document.body.contains(a)&&document.body.removeChild(a),setTimeout(()=>{l&&!n&&l()},500))};s();const r=e=>{t.current&&!t.current.contains(e.target)&&l&&l()};return document.addEventListener("mousedown",r),()=>{document.body.contains(a)&&document.body.removeChild(a),document.removeEventListener("mousedown",r)}},[l,n,i]),console.log("Coupon Applied Animation",o);return(0,R.jsx)("div",{className:"coupon-applied-animation ".concat(n?"retargeting":""),children:(0,R.jsxs)("div",{className:"coupon-success-container",ref:t,children:[(0,R.jsx)("button",{className:"close-animation-btn",onClick:()=>{(0,L.fireGtmEvent)("coupon_animation_closed",{coupon_code:(null===o||void 0===o?void 0:o.name)||(null===o||void 0===o?void 0:o.code),coupon_discount:null===o||void 0===o?void 0:o.discount,coupon_discount_type:null===o||void 0===o?void 0:o.discountType,is_retargeting:n,event_category:"Coupon",event_label:"Close Button Clicked"}),l&&l()},"aria-label":"Close",children:"\xd7"}),(0,R.jsx)("div",{className:"coupon-success-icon",children:n?"\ud83c\udf81":"\u2713"}),(0,R.jsxs)("div",{className:"coupon-success-message",children:[(0,R.jsx)("h2",{children:n?"Special Offer!":"Congratulations!"}),(0,R.jsx)("h3",{children:n?"We've applied a special discount for you!":"".concat(null===o||void 0===o?void 0:o.name," applied successfully")}),(0,R.jsx)("div",{className:"discount-badge ".concat(n?"retargeting-badge":""),children:"percentage"===o.discountType?"".concat(o.discount,"% OFF"):"fixed_amount"===o.discountType?"\u20b9".concat(o.discount," OFF"):"nights"===o.discountType?"".concat(o.discount," ").concat(1===o.discount?"NIGHT":"NIGHTS"," FREE"):"".concat(o.discount,"% OFF")}),n&&(0,R.jsx)("p",{className:"retargeting-note",children:"This exclusive offer has been automatically applied to your booking."})]})]})})},oe=e=>{var o,l,n,i;let{coupon:t,onApply:s,isApplying:r,ineligibleReason:c}=e;const{t:u}=(0,g.Bd)(),[v,m]=(0,d.useState)(!1);return console.log("CouponCard",t),(0,R.jsxs)("div",{className:"coupon-card".concat(c?" coupon-card-ineligible":""),children:[(0,R.jsxs)("div",{className:"coupon-main",children:[(0,R.jsxs)("div",{className:"coupon-left",children:[(0,R.jsx)("div",{className:"coupon-discount",children:"percentage"===t.discountType?"".concat(t.discount,"% OFF"):"fixed_amount"===t.discountType?"\u20b9".concat(t.discount," OFF"):"nights"===t.discountType?"".concat(t.discount," ").concat(1===t.discount?"NIGHT":"NIGHTS"," FREE"):"".concat(t.discount,"% OFF")}),(0,R.jsx)("div",{className:"coupon-code",children:null!==(o=null===t||void 0===t||null===(l=t.PromotionsExtraConfigs)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.value)||void 0===i?void 0:i[0])&&void 0!==o?o:t.name})]}),(0,R.jsx)("div",{className:"coupon-right",children:r===t.id?(0,R.jsx)("div",{className:"coupon-applying",children:(0,R.jsx)(Q.A,{})}):c?(0,R.jsx)("button",{className:"coupon-apply-btn",disabled:!0,children:u("APPLY")}):(0,R.jsx)("button",{className:"coupon-apply-btn",onClick:()=>s(t),children:u("APPLY")})})]}),c&&(0,R.jsx)("div",{className:"coupon-ineligible-reason",children:c}),(0,R.jsxs)("div",{className:"coupon-details",children:[(0,R.jsx)("div",{className:"coupon-terms-toggle",onClick:()=>m(!v),children:u(v?"Hide Details":"View Details")}),v&&(0,R.jsxs)("div",{className:"coupon-terms",children:[(0,R.jsx)("div",{className:"coupon-description",children:t.name}),t.validUntil&&(0,R.jsxs)("div",{className:"coupon-validity",children:[u("Valid till"),":"," ",a()(t.validUntil).format("DD MMM YYYY")]}),t.termsAndConditions&&(0,R.jsxs)("div",{className:"coupon-tnc",children:[(0,R.jsxs)("div",{className:"coupon-tnc-title",children:[u("Terms & Conditions"),":"]}),(0,R.jsx)("ul",{children:t.termsAndConditions.split("\n").map((e,o)=>(0,R.jsx)("li",{children:e},o))})]})]})]})]})},le=e=>
1{let{totalPrice:o,bookingAmountBeforeCoupon:l=0}=e;const n=(0,v.wA)(),[t,r]=(0,d.useState)([]),{t:c}=(0,g.Bd)(),{hotelData:u,dateRange:{startDate:m,endDate:p},totalAdult:h,totalChild:_,selectedRooms:x,selectedRatePlans:f,couponCode:y}=(0,v.d4)(e=>e.hotelInfo),b=e=>null!==e&&void 0!==e&&e.id&&null!==y&&void 0!==y&&y.id&&e.id===y.id?l:o,{adultCount:j,childrenCount:k}=(0,s.VF)({selectedRooms:x,selectedRatePlans:f,totalAdult:h,totalChild:_});(0,d.useEffect)(()=>{null!==u&&void 0!==u&&u.id&&m&&p&&(async()=>{P(!0);try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;(0,U.Aq)(e)||(e=null);const o={hotelId:null===u||void 0===u?void 0:u.id,checkInDate:a()(m).format("DD/MM/YYYY"),checkOutDate:a()(p).format("DD/MM/YYYY"),shouldApplyFilter:!0,isMembership:!1};e&&(o.timezone=e);const l=await(0,O.DE)(o);null!==l&&void 0!==l&&l.data&&r(l.data)}catch(e){console.error("Error fetching promotions:",e)}finally{P(!1)}})()},[u,m,p]);const[C,A]=(0,d.useState)([]),[N,P]=(0,d.useState)(!1),[I,S]=(0,d.useState)(""),[w,D]=(0,d.useState)(null),[M,B]=(0,d.useState)(!1),[E,Y]=(0,d.useState)(null),[F,z]=(0,d.useState)(!1);(0,d.useEffect)(()=>{const e=[...t.filter(e=>"coupon"===e.type&&("percentage"===e.discountType||"fixed_amount"===e.discountType)&&!(0,s.ev)(e,j,k)).map(e=>(0,i.A)((0,i.A)({},e),{},{ineligibleReason:(0,Z.s)(e,b(e))}))].sort((e,l)=>{if(!e.ineligibleReason!==!l.ineligibleReason)return e.ineligibleReason?1:-1;if("nights"===e.discountType&&"nights"!==l.discountType)return-1;if("nights"!==e.discountType&&"nights"===l.discountType)return 1;if("nights"===e.discountType&&"nights"===l.discountType)return l.discount-e.discount;const n=e=>"percentage"===e.discountType?o*e.discount/100:(e.discountType,e.discount),i=n(e),t=n(l);if(i!==t)return t-i;const a=e.name||"",d=l.name||"";return a.localeCompare(d)});console.log("Sorted Promotions:",e),A(e)},[t,o,l,y,j,k]);const G=async e=>{D(e.id),B(!1);try{const o=t.find(o=>o.id===e.id),l=o?(0,s.ev)(o,j,k):null;if(l)return void S(l);const i=o?(0,Z.s)(o,b(o)):null;if(i)return void S(i);null!==o&&void 0!==o&&o.id?(n({type:T.A.SET_COUPON_CODE,payload:o}),Y(e),B(!0),S(c("Coupon applied successfully!")),(0,L.fireGtmEvent)("coupon_applied",{coupon:e}),setTimeout(()=>{z(!1)},1500)):S(c("This coupon cannot be applied"))}catch(o){(0,L.fireGtmEvent)("api_error",{api:"promocode_api"}),S(c("Failed to apply coupon"))}finally{D(null)}},H=()=>{z(!F),(0,L.fireGtmEvent)("view_coupons_clicked",{showDrawer:F,availableCoupons:C}),S("")};return null!==C&&void 0!==C&&C.length?(0,R.jsxs)("div",{className:"coupon-list-container",children:[(0,R.jsxs)("button",{className:"view-coupons-btn",onClick:H,children:[(0,R.jsx)("span",{className:"coupon-icon",children:"\ud83c\udff7\ufe0f"}),c("VIEW COUPONS & OFFERS")]}),F&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{className:"coupon-overlay",onClick:H}),(0,R.jsxs)("div",{className:"coupon-drawer",children:[(0,R.jsxs)("div",{className:"coupon-drawer-header",children:[(0,R.jsx)("h3",{children:c("Available Offers")}),(0,R.jsx)("button",{className:"coupon-close-btn",onClick:H,children:"\xd7"})]}),I&&(0,R.jsx)("div",{className:"coupon-message ".concat(M?"success":"error"),children:I}),(0,R.jsx)("div",{className:"coupon-list",children:N?(0,R.jsxs)("div",{className:"coupon-loading",children:[(0,R.jsx)(Q.A,{}),(0,R.jsx)("p",{children:c("Loading available coupons...")})]}):C.length>0?C.map(e=>(0,R.jsx)(oe,{coupon:e,onApply:G,isApplying:w===e.id,ineligibleReason:e.ineligibleReason},e.id)):(0,R.jsx)("div",{className:"no-coupons",children:(0,R.jsx)("p",{children:c("No coupons available at the moment")})})}),(0,R.jsx)("div",{className:"coupon-footer",children:(0,R.jsx)("small",{children:c("* Some coupons may have restrictions based on dates, minimum price, or room type")})})]})]}),M&&E&&(0,R.jsx)(ee,{coupon:E,onComplete:()=>B(!1)})]}):null},ne=()=>(0,R.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),(0,R.jsx)("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),ie=()=>(0,R.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),(0,R.jsx)("polyline",{points:"22 4 12 14.01 9 11.01"})]}),te=()=>(0,R.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,R.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,R.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),ae=()=>(0,R.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,R.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]}),de=e=>
1{let{totalPrice:o,bookingAmountBeforeCoupon:l=0,couponCutoffReason:n=null}=e;const i=(0,v.wA)(),{t:t}=(0,g.Bd)(),{hotelData:r,dateRange:{startDate:c,endDate:u},couponCode:m,couponName:p,Retargeting:_,totalAdult:x,totalChild:f,selectedRooms:y,selectedRatePlans:b}=(0,v.d4)(e=>e.hotelInfo),{adultCount:j,childrenCount:k}=(0,s.VF)({selectedRooms:y,selectedRatePlans:b,totalAdult:x,totalChild:f}),[C,A]=(0,d.useState)(""),[N,P]=(0,d.useState)(!1),[I,S]=(0,d.useState)(""),[w,D]=(0,d.useState)(!1);(0,d.useEffect)(()=>{p?(A(p),D(!(null===m||void 0===m||!m.id))):D(!1)},[p,m]),(0,d.useEffect)(()=>{if(null===m||void 0===m||!m.id)return;const e=(0,s.ev)(m,j,k);e&&(i({type:T.A.SET_COUPON_CODE,payload:{}}),D(!1),A(""),S(e))},[m,j,k,i]),(0,d.useEffect)(()=>{n&&(D(!1),A(""),S(n))},[n]);const M=async()=>{if(null!==m&&void 0!==m&&m.id)return A(""),D(!1),void i({type:T.A.SET_COUPON_CODE,payload:{}});if(C.trim().length){P(!0);try{let e={hotelId:null===r||void 0===r?void 0:r.id,couponCode:C,checkInDate:a()(c).format("DD/MM/YYYY"),checkOutDate:a()(u).format("DD/MM/YYYY"),isRetargeting:_,adultCount:j,childrenCount:k,bookingAmount:o};const l=await(0,O.uB)(e);if(200===(null===l||void 0===l?void 0:l.status))(0,L.fireGtmEvent)("promocode_applied",{response:l,obj:e}),D(!0),S("Coupon Code Applied Successfully!"),i({type:T.A.SET_COUPON_CODE,payload:null===l||void 0===l?void 0:l.data}),i({type:T.A.SET_RETARGETING,payload:!1});else{(0,L.fireGtmEvent)("promocode_failed",{response:l,obj:e}),D(!1),i({type:T.A.SET_COUPON_CODE,payload:{}}),i({type:T.A.SET_RETARGETING,payload:!1});const o=null===l||void 0===l?void 0:l.message;S("string"===typeof o&&o&&"failure"!==o?o:"Invalid Coupon!")}}catch(e){(0,L.fireGtmEvent)("api_error",{api:"promocode_api"}),S("Invalid Coupon!")}finally{P(!1)}}else h().error("Please enter valid promocode!")};(0,d.useEffect)(()=>{setTimeout(()=>{I.length>0&&S("")},4e3)},[w,I]);const B=!(null===m||void 0===m||!m.id);return(0,R.jsxs)("div",{className:"promocode_wrapper",children:[(0,R.jsx)(le,{totalPrice:o,bookingAmountBeforeCoupon:l}),(0,R.jsxs)("div",{className:"promocode_container ".concat(B?"applied":""),children:[(0,R.jsx)("div",{className:"promocode_icon",children:(0,R.jsx)(ne,{})}),(0,R.jsx)("input",{type:"text",placeholder:t("Enter Promocode"),value:C,disabled:B,onChange:e=>{S(""),A(e.target.value)},onKeyPress:e=>"Enter"===e.key&&!B&&M()}),(0,R.jsx)("button",{onClick:M,className:"promocode_action_btn ".concat(B?"remove":"apply"),"aria-label":B?"Remove coupon":"Apply coupon",children:N?(0,R.jsx)(Q.A,{}):B?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ae,{})," ",t("Remove")]}):t("Apply")})]}),I&&(0,R.jsxs)("div",{className:"coupon-message ".concat(w?"success":"error"),children:[w?(0,R.jsx)(ie,{}):(0,R.jsx)(te,{})," ",I]})]})};
1var se=l(6230),re=(l(7155),l(4392)),ce=l(6572),ue=l(4443),ve=l.n(ue),me=l(7950);const pe={modal_container:"CheckoutDetailsModal_modal_container__sP3Uw",headerBox:"CheckoutDetailsModal_headerBox__rXUC2",modal_header:"CheckoutDetailsModal_modal_header__BUfTP",carousel_container:"CheckoutDetailsModal_carousel_container__oQFwd",image_container:"CheckoutDetailsModal_image_container__9dMEp",slider_img_cont:"CheckoutDetailsModal_slider_img_cont__w7DBg",slider_image:"CheckoutDetailsModal_slider_image__f6wYC",description:"CheckoutDetailsModal_description__GmCV0",priceBox:"CheckoutDetailsModal_priceBox__JTWQk",price_wrapper:"CheckoutDetailsModal_price_wrapper__yQTWR",guestBasedPriceLabel:"CheckoutDetailsModal_guestBasedPriceLabel__EgiYq",price_amount:"CheckoutDetailsModal_price_amount__Wmmut",addButton:"CheckoutDetailsModal_addButton__2GTIe",addonActionBtn:"CheckoutDetailsModal_addonActionBtn__MvPS0",addonRemoveIconBtn:"CheckoutDetailsModal_addonRemoveIconBtn__6WKeo","carousel-btn":"CheckoutDetailsModal_carousel-btn__1vVmH",prev_styles:"CheckoutDetailsModal_prev_styles__EzfFF",next_styles:"CheckoutDetailsModal_next_styles__Qhd4R",carousel_wrapper:"CheckoutDetailsModal_carousel_wrapper__scty8"};var he=l(5945);const ge={emblaCarousel:"CarouselWrapper_emblaCarousel__dt-BW",emblaViewport:"CarouselWrapper_emblaViewport__9zBvB",emblaContainer:"CarouselWrapper_emblaContainer__6fhPp",emblaSlide:"CarouselWrapper_emblaSlide__qDQQR",emblaSlideInner:"CarouselWrapper_emblaSlideInner__55Jg0",emblaButton:"CarouselWrapper_emblaButton__oh2r1",emblaButtonPrev:"CarouselWrapper_emblaButtonPrev__-KJEl",emblaButtonNext:"CarouselWrapper_emblaButtonNext__3wSMI",emblaButtonOutside:"CarouselWrapper_emblaButtonOutside__YeV8E",emblaButtonDefault:"CarouselWrapper_emblaButtonDefault__QexJw",emblaButtonRounded:"CarouselWrapper_emblaButtonRounded__ENavG"};var _e=l(8438),xe=l(225);const fe=(0,d.forwardRef)((e,o)=>{let{children:l,slidesToShow:n=1,spacing:i=16,loop:t=!0,showArrows:a=!0,navPosition:s="inside",navStyle:r="rounded",hidePrevButton:c=!1,hideNextButton:u=!1,smallScreenSlidesToShow:v=1,mediumScreenSlidesToShow:m=2,mediumScreenSpacing:p=null,smallScreenSpacing:h=null}=e;const[g,_]=(0,he.A)({loop:t,align:"start",containScroll:"trimSnaps",dragFree:!1});(0,d.useImperativeHandle)(o,()=>({scrollPrev:()=>_&&_.scrollPrev(),scrollNext:()=>_&&_.scrollNext(),scrollTo:e=>_&&_.scrollTo(e)}));const[x,f]=(0,d.useState)("".concat(100/n,"%"));(0,d.useEffect)(()=>{const e=()=>{const e=window.innerWidth;let o=n;e<480?o=v:e<768&&(o=Math.min(m,n)),f("".concat(100/o,"%"))};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[n]);const y=(0,d.useCallback)(()=>_&&_.scrollPrev(),[_]),b=(0,d.useCallback)(()=>_&&_.scrollNext(),[_]);return(0,R.jsxs)("div",{className:"".concat(ge.emblaCarousel," ").concat("outside"===s?ge.withOutsideNav:""),children:[(0,R.jsx)("div",{className:ge.emblaViewport,ref:g,children:(0,R.jsx)("div",{className:ge.emblaContainer,children:d.Children.map(l,e=>(0,R.jsx)("div",{className:ge.emblaSlide,style:{flexBasis:x,marginRight:"".concat(h||(p||i),"px")},children:(0,R.jsx)("div",{className:ge.emblaSlideInner,children:e})}))})}),a&&(0,R.jsxs)(R.Fragment,{children:[!c&&(0,R.jsx)("button",{className:"".concat(ge.emblaButton," ").concat(ge.emblaButtonPrev," ").concat("outside"===s?ge.emblaButtonOutside:""," ").concat("rounded"===r?ge.emblaButtonRounded:ge.emblaButtonDefault),onClick:y,"aria-label":"Previous",children:(0,R.jsx)(_e.A,{})}),!u&&(0,R.jsx)("button",{className:"".concat(ge.emblaButton," ").concat(ge.emblaButtonNext," ").concat("outside"===s?ge.emblaButtonOutside:""," ").concat("rounded"===r?ge.emblaButtonRounded:ge.emblaButtonDefault),onClick:e=>{e.stopPropagation(),b()},"aria-label":"Next",children:(0,R.jsx)(xe.A,{})})]})]})}),ye="CheckOutModalWrapper_modal_container__8eq0c",be="CheckOutModalWrapper_modal__XnQhA",je="CheckOutModalWrapper_mob_modal__WBSbg",ke="CheckOutModalWrapper_mob_container__VqNjo",Ce="CheckOutModalWrapper_navBackBox__gG4wN",Ae="CheckOutModalWrapper_backIcon__s89O8",Ne="CheckOutModalWrapper_closing__vJiA2",Pe="CheckOutModalWrapper_mob_navBox__xMCrH";var Ie=l(3412);const Se=e=>{let{children:o,closeModal:l,mob_modal:n=!1}=e;const[i,t]=(0,d.useState)(!1),a=()=>{t(!0),setTimeout(()=>{l()},300),(0,L.fireGtmEvent)("checkout_go_back_clicked")};return(0,d.useEffect)(()=>{const e=e=>{e.target.classList.contains(n?ke:ye)&&a()};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[l]),me.createPortal((0,R.jsx)("div",{className:"".concat(n?ke:ye," ").concat(i?Ne:""),children:(0,R.jsx)("div",{className:"".concat(n?je:be," ").concat(i?Ne:""),children:(0,R.jsxs)(R.Fragment,{children:[o,(0,R.jsxs)("div",{className:n?Pe:Ce,onClick:a,children:[(0,R.jsx)(Ie.A,{className:Ae}),(0,R.jsx)("span",{children:"Go Back"})]})]})})}),document.getElementById("root"))};var we=l(1184),De=l(7125),Me=l(6637);const Re=e=>{var o,l,n,i,t,a,r,c,u,m;let{addon:p,closeModal:h}=e;const{selectedHotelAddons:g,selectedRooms:_,selectedRatePlans:x,totalAdult:f,totalChild:y}=(0,v.d4)(e=>e.hotelInfo),b=(0,v.wA)(),j="guest_based"===(null===p||void 0===p||null===(o=p.Addon)||void 0===o?void 0:o.multiplier),{childrenCount:k}=(0,s.VF)({selectedRooms:_,selectedRatePlans:x,totalAdult:f,totalChild:y}),[C,A]=(0,d.useState)(null===g||void 0===g?void 0:g.some(e=>(null===e||void 0===e?void 0:e.addonId)===(null===p||void 0===p?void 0:p.addonId)));(0,d.useEffect)(()=>{var e;(0,L.fireGtmEvent)("checkout_addon_modal_viewed",{addon_id:null===p||void 0===p?void 0:p.addonId,addon_name:(null===p||void 0===p||null===(e=p.Addon)||void 0===e?void 0:e.name)||(null===p||void 0===p?void 0:p.name),addon_price:null===p||void 0===p?void 0:p.price,addon_currency:null===p||void 0===p?void 0:p.currency})},[]);const N=()=>{var e;const o=j?1:10;var l;(null===(e=g.filter(e=>e.addonId===(null===p||void 0===p?void 0:p.addonId)))||void 0===e?void 0:e.length)<o&&(b((0,E.qO)(p)),(0,L.fireGtmEvent)("hotel_addon_selected",{addon_id:null===p||void 0===p?void 0:p.addonId,addon_name:null===p||void 0===p||null===(l=p.Addon)||void 0===l?void 0:l.name,value:null===p||void 0===p?void 0:p.price}),C||A(!0))},P=()=>{var e,o;(null===(e=g.filter(e=>e.addonId===(null===p||void 0===p?void 0:p.addonId)))||void 0===e?void 0:e.length)>0&&(b((0,E.xy)(p)),(0,L.fireGtmEvent)("hotel_addon_removed",{addon_id:null===p||void 0===p?void 0:p.addonId,addon_name:null===p||void 0===p||null===(o=p.Addon)||void 0===o?void 0:o.name,value:null===p||void 0===p?void 0:p.price}))};return me.createPortal((0,R.jsx)(Se,{closeModal:h,showBackNav:!1,mob_modal:!0,children:(0,R.jsxs)("div",{className:pe.modal_container,children:[(0,R.jsx)("h3",{className:pe.modal_header,children:null===p||void 0===p?void 0:p.name}),(0,R.jsxs)("div",{className:pe.carousel_container,children:[(0,R.jsxs)("div",{className:pe.carousel_wrapper,children:[(0,R.jsx)(fe,{slidesToShow:1,spacing:0,loop:!0,showArrows:(null===p||void 0===p||null===(l=p.HotelAddonImages)||void 0===l?void 0:l.length)>1,navPosition:"outside",navStyle:"rounded",hidePrevButton:!0,children:(0,R.jsx)("div",{className:pe.image_container,children:(null===p||void 0===p||null===(n=p.HotelAddonImages)||void 0===n?void 0:n.map((e,o)=>(0,R.jsx)("div",{className:pe.slider_img_cont,children:(0,R.jsx)("img",{src:null===e||void 0===e?void 0:e.cdnImageUrl,alt:null===e||void 0===e?void 0:e.name,className:pe.slider_image})},o)))||[]})}),(0,R.jsx)("p",{className:pe.description,children:null===p||void 0===p?void 0:p.description})]}),(0,R.jsx)("div",{className:pe.modal_content,children:(0,R.jsxs)("div",{className:pe.priceBox,children:[(0,R.jsxs)("div",{className:pe.price_wrapper,children:[j?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("p",{children:[(0,G.Gl)(null===p||void 0===p?void 0:p.currency)," ",null===(i=Number(null===p||void 0===p?void 0:p.price))||void 0===i?void 0:i.toFixed()," ",(0,R.jsx)("span",{className:pe.guestBasedPriceLabel,children:"Adult / Night"})]}),k>0&&(0,R.jsxs)("p",{children:[(0,G.Gl)(null===p||void 0===p?void 0:p.currency)," ",null===(t=Number(null===p||void 0===p?void 0:p.childPrice))||void 0===t?void 0:t.toFixed()," ",(0,R.jsx)("span",{className:pe.guestBasedPriceLabel,children:"Child / Night"})]})]}):(0,R.jsxs)("p",{children:[(0,G.Gl)(null===p||void 0===p?void 0:p.currency)," ",null===(a=Number(null===p||void 0===p?void 0:p.price))||void 0===a?void 0:a.toFixed()]}),(0,R.jsx)("span",{children:"Incl. of all taxes"})]}),j?(null===(r=g.filter(e=>e.addonId===(null===p||void 0===p?void 0:p.addonId)))||void 0===r?void 0:r.length)>0&&C?(0,R.jsx)("button",{type:"button",className:pe.addonRemoveIconBtn,onClick:()=>P(),"aria-label":"Remove ".concat(null===p||void 0===p?void 0:p.name," from booking"),children:(0,R.jsx)(we.A,{size:16})}):(0,R.jsx)("button",{type:"button",className:pe.addButton,onClick:()=>N(),"aria-label":"Add ".concat(null===p||void 0===p?void 0:p.name," to booking"),children:"Add"}):(null===(c=g.filter(e=>e.addonId===(null===p||void 0===p?void 0:p.addonId)))||void 0===c?void 0:c.length)>0&&C?(0,R.jsxs)("div",{className:pe.addonActionBtn,role:"group","aria-label":"Quantity controls for ".concat(null===p||void 0===p?void 0:p.name),children:[(0,R.jsx)("button",{type:"button",onClick:()=>P(),"aria-label":"Decrease ".concat(null===p||void 0===p?void 0:p.name," quantity"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,R.jsx)(De.A,{size:16,"aria-hidden":"true"})}),(0,R.jsx)("span",{"aria-live":"polite","aria-atomic":"true",children:null!==(u=null===(m=g.filter(e=>e.addonId===(null===p||void 0===p?void 0:p.addonId)))||void 0===m?void 0:m.length)&&void 0!==u?u:0}),(0,R.jsx)("button",{type:"button",onClick:()=>N(),"aria-label":"Increase ".concat(null===p||void 0===p?void 0:p.name," quantity"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,R.jsx)(Me.A,{size:16,"aria-hidden":"true"})})]}):(0,R.jsx)("button",{type:"button",className:pe.addButton,onClick:()=>N(),"aria-label":"Add ".concat(null===p||void 0===p?void 0:p.name," to booking"),children:"Add"})]})})]})]})}),document.getElementById("root"))},Be=e=>{var o,l,n,i,t,a,r,c,u;let{addon:m,key:p}=e;const[h,g]=(0,d.useState)({isOpen:!1,data:null}),{selectedHotelAddons:_,selectedRooms:x,selectedRatePlans:f,totalAdult:y,totalChild:b}=(0,v.d4)(e=>e.hotelInfo),j=(0,v.wA)(),k="guest_based"===(null===m||void 0===m||null===(o=m.Addon)||void 0===o?void 0:o.multiplier),{childrenCount:C}=(0,s.VF)({selectedRooms:x,selectedRatePlans:f,totalAdult:y,totalChild:b}),[A,N]=(0,d.useState)(null===_||void 0===_?void 0:_.some(e=>(null===e||void 0===e?void 0:e.id)===(null===m||void 0===m?void 0:m.id))),P=()=>{var e;const o=k?1:10;var l,n,i;(null===(e=_.filter(e=>e.id===(null===m||void 0===m?void 0:m.id)))||void 0===e?void 0:e.length)<o&&(j((0,E.qO)(m)),(0,L.fireGtmEvent)("hotel_addon_selected",{addon_id:null===m||void 0===m?void 0:m.addonId,addon_name:null===m||void 0===m||null===(l=m.Addon)||void 0===l?void 0:l.name,is_hotel_addon_images:(null===m||void 0===m||null===(n=m.HotelAddonImages)||void 0===n?void 0:n.length)>0,hotel_addon_images_count:null===m||void 0===m||null===(i=m.HotelAddonImages)||void 0===i?void 0:i.length,value:null===m||void 0===m?void 0:m.price}),A||N(!0))},I=()=>{var e,o;(null===(e=_.filter(e=>e.addonId===(null===m||void 0===m?void 0:m.addonId)))||void 0===e?void 0:e.length)>0&&(j((0,E.xy)(m)),(0,L.fireGtmEvent)("hotel_addon_removed",{addon_id:null===m||void 0===m?void 0:m.addonId,addon_name:null===m||void 0===m||null===(o=m.Addon)||void 0===o?void 0:o.name,value:null===m||void 0===m?void 0:m.price}))};return(0,R.jsxs)("div",{className:"addonCardContainer",children:[(0,R.jsxs)("div",{className:"addonImage",children:[(0,R.jsx)("img",{src:null===m||void 0===m||null===(l=m.HotelAddonImages)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.cdnImageUrl,alt:null===m||void 0===m?void 0:m.name}),(0,R.jsx)("span",{onClick:()=>g({isOpen:!0,data:m}),className:"addon_view_btn_mob",children:"View Details"})]}),(0,R.jsxs)("div",{className:"addonContentBox",children:[(0,R.jsxs)("div",{className:"addonContent",children:[(0,R.jsx)("h4",{className:"truncatedTitle",children:null===m||void 0===m?void 0:m.name}),(0,R.jsx)("p",{className:"truncatedDescription",children:null===m||void 0===m?void 0:m.description}),(0,R.jsx)("span",{onClick:()=>g({isOpen:!0,data:m}),className:"addon_view_btn",children:"View Details"})]}),k?(0,R.jsxs)("div",{className:"addonActionContainer",children:[(0,R.jsxs)("div",{className:"guestBasedPriceBox",children:[(0,R.jsxs)("span",{className:"guestBasedPriceRow",children:[(0,G.Gl)(null===m||void 0===m?void 0:m.currency),null===(i=Number(null===m||void 0===m?void 0:m.price))||void 0===i?void 0:i.toFixed(),(0,R.jsx)("span",{className:"guestBasedPriceLabel",children:"Adult / Night"})]}),C>0&&(0,R.jsxs)("span",{className:"guestBasedPriceRow",children:[(0,G.Gl)(null===m||void 0===m?void 0:m.currency),null===(t=Number(null===m||void 0===m?void 0:m.childPrice))||void 0===t?void 0:t.toFixed(),(0,R.jsx)("span",{className:"guestBasedPriceLabel",children:"Child / Night"})]})]}),(null===(a=_.filter(e=>e.id===(null===m||void 0===m?void 0:m.id)))||void 0===a?void 0:a.length)>0&&A?(0,R.jsx)("button",{type:"button",className:"addonRemoveIconBtn",onClick:()=>I(),"aria-label":"Remove ".concat(null===m||void 0===m?void 0:m.name),children:(0,R.jsx)(we.A,{size:16})}):(0,R.jsx)("button",{type:"button",className:"addAddonBtn",onClick:()=>P(),children:"Add"})]}):(0,R.jsxs)("div",{className:"addonActionContainer",children:[(0,R.jsxs)("span",{children:[(0,G.Gl)(null===m||void 0===m?void 0:m.currency),null===m||void 0===m?void 0:m.price]}),(null===(r=_.filter(e=>e.id===(null===m||void 0===m?void 0:m.id)))||void 0===r?void 0:r.length)>0&&A?(0,R.jsxs)("button",{type:"button",className:"addAddonActionBtn",children:[(0,R.jsx)(De.A,{size:16,onClick:()=>I()}),null!==(c=null===(u=_.filter(e=>e.id===(null===m||void 0===m?void 0:m.id)))||void 0===u?void 0:u.length)&&void 0!==c?c:0,(0,R.jsx)(Me.A,{size:16,onClick:()=>P()})]}):(0,R.jsx)("button",{type:"button",className:"addAddonBtn",onClick:()=>P(),children:"Add"})]})]}),(null===h||void 0===h?void 0:h.isOpen)&&(0,R.jsx)(Re,{addon:null===h||void 0===h?void 0:h.data,closeModal:()=>g({isOpen:!1,data:null})})]},p)},Ee={flashSaleContainer:"FlashSaleCard_flashSaleContainer__l2Bkv",flashSaleBanner:"FlashSaleCard_flashSaleBanner__Id5TU",flashSaleContent:"FlashSaleCard_flashSaleContent__DRZPH",flashSaleTitle:"FlashSaleCard_flashSaleTitle__PNKPY",flashCountContainer:"FlashSaleCard_flashCountContainer__voOOz",flashSaleTime:"FlashSaleCard_flashSaleTime__6e6T6",flashSaleTimer:"Flas
1hSaleCard_flashSaleTimer__luMst",falshSaleTime:"FlashSaleCard_falshSaleTime__jGL0G",hotelCarousel:"FlashSaleCard_hotelCarousel__fWT2F",hotelCarouselImg:"FlashSaleCard_hotelCarouselImg__8Ky5B",carouselNav:"FlashSaleCard_carouselNav__VH52A",carouselPrev:"FlashSaleCard_carouselPrev__BvIqW",carouselNext:"FlashSaleCard_carouselNext__G91Nc",carouselDots:"FlashSaleCard_carouselDots__ysTDz",carouselDot:"FlashSaleCard_carouselDot__Hlv52",carouselDotActive:"FlashSaleCard_carouselDotActive__vDh5s",checkinContainer:"FlashSaleCard_checkinContainer__rcCS8",checkInContent:"FlashSaleCard_checkInContent__X9vcV",hotelTitle:"FlashSaleCard_hotelTitle__dnxO-",checkInDateContainer:"FlashSaleCard_checkInDateContainer__ksWUQ",checkDateBox:"FlashSaleCard_checkDateBox__N0KFg",checkDateLabel:"FlashSaleCard_checkDateLabel__oSV2W",checkDateValue:"FlashSaleCard_checkDateValue__SJapT",nightCountContainer:"FlashSaleCard_nightCountContainer__JirAY",checkDateBoxTextAlign:"FlashSaleCard_checkDateBoxTextAlign__IDS7X",reviewsContainer:"FlashSaleCard_reviewsContainer__sR3DP"};var Te=l(9449);const Oe=e=>{var o;let{hotelData:l,isHourlyRoom:n,hourlyTime:i,hourlyDate:t,hourlyHour:s,dateRange:r,dateCount:c,addHoursToTime:u}=e;const[p,h]=(0,d.useState)(900),[g,_]=(0,d.useState)(0),x=(0,m.useHistory)(),f=(null===l||void 0===l||null===(o=l.HotelImages)||void 0===o?void 0:o.filter(e=>null===e||void 0===e?void 0:e.cdnImageUrl))||[],{reviews:y}=(0,v.d4)(e=>e.hotelInfo);(0,d.useEffect)(()=>{if(p<=0)return void x.goBack();const e=setInterval(()=>{h(e=>e-1)},1e3);return()=>clearInterval(e)},[p,x]);const b=Math.floor(p/60),j=p%60,k="".concat(b,":").concat(j.toString().padStart(2,"0"));return(0,R.jsxs)("div",{className:Ee.flashSaleContainer,children:[(0,R.jsxs)("div",{className:Ee.flashSaleContent,children:[(0,R.jsxs)("div",{className:Ee.flashSaleBanner,children:[(0,R.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/flash_sale.svg",alt:"flash sale"}),(0,R.jsx)("span",{className:Ee.flashSaleTitle,children:"Flash Sale"})]}),(0,R.jsxs)("div",{className:Ee.flashCountContainer,children:[(0,R.jsx)("p",{children:"We have saved your booking for "}),(0,R.jsxs)("div",{className:Ee.flashSaleTime,children:[(0,R.jsx)("span",{className:Ee.flashSaleTimer,children:k}),(0,R.jsx)("p",{children:"Mins"})]})]})]}),(0,R.jsxs)("div",{className:Ee.checkinContainer,children:[f.length>0&&(0,R.jsxs)("div",{className:Ee.hotelCarousel,children:[(0,R.jsx)("img",{src:"".concat(f[g].cdnImageUrl,"?tr=w-600,h-260,fo-auto,q-80"),alt:null===l||void 0===l?void 0:l.name,className:Ee.hotelCarouselImg,loading:"lazy"}),f.length>1&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("button",{className:"".concat(Ee.carouselNav," ").concat(Ee.carouselPrev),onClick:e=>{e.stopPropagation(),_(e=>(e-1+f.length)%f.length)},"aria-label":"Previous image",children:"\u2039"}),(0,R.jsx)("button",{className:"".concat(Ee.carouselNav," ").concat(Ee.carouselNext),onClick:e=>{e.stopPropagation(),_(e=>(e+1)%f.length)},"aria-label":"Next image",children:"\u203a"}),(0,R.jsx)("div",{className:Ee.carouselDots,children:f.slice(0,5).map((e,o)=>(0,R.jsx)("div",{className:"".concat(Ee.carouselDot," ").concat(o===g%5?Ee.carouselDotActive:""),onClick:e=>{e.stopPropagation(),_(o)}},o))})]})]}),(0,R.jsxs)("div",{className:Ee.checkInContent,children:[(null===y||void 0===y?void 0:y.rating)>0&&(0,R.jsxs)("div",{className:Ee.reviewsContainer,children:[(0,R.jsx)("p",{children:null===y||void 0===y?void 0:y.rating}),(0,R.jsx)("span",{className:Ee.reviewStar,children:Array.from({length:Math.round(Number(null===y||void 0===y?void 0:y.rating)||0)}).map((e,o)=>(0,R.jsx)(Te.A,{color:"#FCE340",fill:"#FCE340"},o))})]}),(0,R.jsx)("h2",{className:Ee.hotelTitle,children:null===l||void 0===l?void 0:l.name})]}),(0,R.jsxs)("div",{className:Ee.checkInDateContainer,children:[(0,R.jsxs)("div",{className:Ee.checkDateBox,children:[(0,R.jsx)("div",{className:Ee.checkDateLabel,role:"heading","aria-level":"3",children:"Check-In"}),(0,R.jsx)("div",{className:Ee.checkDateValue,children:n?a()(t).format("ddd, DD MMM'YY"):a()(null===r||void 0===r?void 0:r.startDate).format("ddd, DD MMM'YY")}),(0,R.jsx)("p",{children:n?i:Y.A.get("checkin")||"12PM"})]}),(0,R.jsx)("div",{className:Ee.nightCountContainer,children:(0,R.jsxs)("span",{children:[c," night"]})}),(0,R.jsxs)("div",{className:"".concat(Ee.checkDateBox," ").concat(Ee.checkDateBoxTextAlign),children:[(0,R.jsx)("div",{className:Ee.checkDateLabel,role:"heading","aria-level":"3",children:"Check-Out"}),(0,R.jsx)("div",{className:Ee.checkDateValue,children:n?u(t,i,s):a()(null===r||void 0===r?void 0:r.endDate).format("ddd, DD MMM'YY")}),(0,R.jsx)("p",{children:n?i:Y.A.get("checkout")||"12PM"})]})]})]})]})};var Ye=l(7821),Fe=l(3804),ze=l(4978);const Ge={flashSaleContainer:"PaymentSummary_flashSaleContainer__utXxU",flashSaleBanner:"PaymentSummary_flashSaleBanner__yrVes",flashSaleContent:"PaymentSummary_flashSaleContent__8Vnw1",flashSaleTitle:"PaymentSummary_flashSaleTitle__oDe3+",flashCountContainer:"PaymentSummary_flashCountContainer__hl3Q8",flashSaleTime:"PaymentSummary_flashSaleTime__cPBbV",flashSaleTimer:"PaymentSummary_flashSaleTimer__WGoL4",falshSaleTime:"PaymentSummary_falshSaleTime__6KPWz",checkinContainer:"PaymentSummary_checkinContainer__u9pfU",checkInContent:"PaymentSummary_checkInContent__2iyz5",reviewsContainer:"PaymentSummary_reviewsContainer__GPdom",hotelTitle:"PaymentSummary_hotelTitle__cXG+e",reviewStar:"PaymentSummary_reviewStar__ADtIp",checkInDateContainer:"PaymentSummary_checkInDateContainer__6a2Q5",checkDateBox:"PaymentSummary_checkDateBox__oTnQM",nightCountContainer:"PaymentSummary_nightCountContainer__1fUQl",checkDateBoxTextAlign:"PaymentSummary_checkDateBoxTextAlign__LLnZV",bookingActionsBox:"PaymentSummary_bookingActionsBox__IzrYI",roomBox:"PaymentSummary_roomBox__uhKul",roomThumbnail:"PaymentSummary_roomThumbnail__vxNTO",roomDetailContainer:"PaymentSummary_roomDetailContainer__94GD4",roomItemPrice:"PaymentSummary_roomItemPrice__VaAQz",discountContainer:"PaymentSummary_discountContainer__EMCSY",amountContainer:"PaymentSummary_amountContainer__lRkq1",amountBox:"PaymentSummary_amountBox__KFERY",totalAmountBox:"PaymentSummary_totalAmountBox__lkOu7",lowestPriceBox:"PaymentSummary_lowestPriceBox__YPnxT",promoContainer:"PaymentSummary_promoContainer__Dbuwx",addonLabel:"PaymentSummary_addonLabel__fvfAk",lowestPriceGuranteeBox:"PaymentSummary_lowestPriceGuranteeBox__5FzXs",lowestPriceItems:"PaymentSummary_lowestPriceItems__eMoFS",lowestPriceOtaBox:"PaymentSummary_lowestPriceOtaBox__DgfHV",otaPriceBox:"PaymentSummary_otaPriceBox__yRowx",lowestPriceOfficial:"PaymentSummary_lowestPriceOfficial__r7NaI",lowestPriceOfficialNameBox:"PaymentSummary_lowestPriceOfficialNameBox__Tsw3I",priceTaxBox:"PaymentSummary_priceTaxBox__J+g8s",displayNone:"PaymentSummary_displayNone__tHNjv",summarySkeleton:"PaymentSummary_summarySkeleton__QwIbF",skeletonRow:"PaymentSummary_skeletonRow__mp1Xt",skeletonBlock:"PaymentSummary_skeletonBlock__cVL34",skeletonShimmer:"PaymentSummary_skeletonShimmer__k4RN3"},He=()=>(0,R.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,R.jsx)("path",{d:"M2 4l3 12h14l3-12-6 7-4-7-4 7-6-7zm3 16h14"})}),Le=()=>(0,R.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,R.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]}),We=()=>(0,R.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),(0,R.jsx)("polyline",{points:"22 4 12 14.01 9 11.01"})]}),Ve=()=>(0,R.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,R.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,R.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),qe=e=>{let{totalPrice:o,hotelId:l}=e;const n=(0,v.wA)(),i=(0,v.d4)(e=>e.hotelInfo.maharajaId),t=(0,v.d4)(e=>e.hotelInfo.maharajaIdError),[a,s]=(0,d.useState)(""),[r,c]=(0,d.useState)(""),[u,m]=(0,d.useState)(!1),p=!!i,h=!p&&(!!r||!!t);(0,d.useEffect)(()=>{i&&s(i)},[i]);const g=async()=>{var e;const i=a.trim();if(!i)return void c("Please enter your Maharaja Club ID.");m(!0),c(""),t&&n({type:T.A.SET_MAHARAJA_ID_ERROR,payload:!1});const d=await(0,O.RU)("maharajaclub",i,o,l);var s;(m(!1),null!==d&&void 0!==d&&null!==(e=d.data)&&void 0!==e&&e.valid)?n({type:T.A.SET_MAHARAJA_ID,payload:i}):c((null===d||void 0===d||null===(s=d.data)||void 0===s?void 0:s.message)||"Invalid Maharaja Club ID.")};return(0,R.jsxs)("div",{className:"maharajaclub_wrapper",id:"maharaja-club-section",children:[(0,R.jsxs)("div",{className:"maharajaclub_container ".concat(p?"applied":""," ").concat(h?"has-error":""),children:[(0,R.jsx)("div",{className:"maharajaclub_icon",children:(0,R.jsx)(He,{})}),(0,R.jsx)("input",{type:"text",placeholder:"Enter Maharaja Club ID",value:a,disabled:p||u,maxLength:9,onChange:e=>{c(""),t&&n({type:T.A.SET_MAHARAJA_ID_ERROR,payload:!1}),s(e.target.value.replace(/\D/g,""))},onKeyPress:e=>"Enter"===e.key&&!p&&!u&&g()}),(0,R.jsx)("button",{onClick:p?()=>{s(""),c(""),n({type:T.A.SET_MAHARAJA_ID,payload:null})}:g,className:"maharajaclub_action_btn ".concat(p?"remove":"apply"),disabled:u,"aria-label":p?"Remove Maharaja Club ID":"Apply Maharaja Club ID",children:p?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Le,{})," ",(0,R.jsx)("span",{className:"maharajaclub_btn_text",children:"Remove"})]}):u?"...":"Apply"})]}),h&&(0,R.jsxs)("div",{className:"maharajaclub_message error",children:[(0,R.jsx)(Ve,{})," ",r||"Air India Maharaja Club ID is required"]}),!p&&(0,R.jsx)("div",{className:"maharajaclub_info",children:(0,R.jsx)("span",{children:"Please enter your Air India Maharaja Club ID to earn 10 Points on every INR 100 Spent."})}),p&&(0,R.jsxs)("div",{className:"maharajaclub_message success",children:[(0,R.jsx)(We,{})," Valid Air India Maharaja Club ID."]})]})},Ue="RoomDetailsModal_modal_container__X7ALz",Je="RoomDetailsModal_modal_header__u5Yj1",Ke="RoomDetailsModal_roomCardContainer__TelyQ",Xe="RoomDetailsModal_roomTitle__tDxr1",Qe="RoomDetailsModal_roomTitleBox__fGM5k",Ze="RoomDetailsModal_carouselContainer__qspja",$e="RoomDetailsModal_slider_img_cont__rhOfe",eo="RoomDetailsModal_slider_image__QMrvv",oo="ImageFullViewModal_modal_container__ioPI2",lo="ImageFullViewModal_carouselContainer__xSjhS",no="ImageFullViewModal_slider_img_cont__Wgug-",io="ImageFullViewModal_slider_image__zaX0w",to=e=>{let{data:o,closeModal:l}=e;return(0,L.fireGtmEvent)("checkout_full_image_viewed"),(0,R.jsx)(Se,{closeModal:l,children:(0,R.jsx)("div",{className:o
1o,children:(0,R.jsx)("div",{className:lo,children:(0,R.jsx)(fe,{slidesToShow:1,spacing:0,loop:!0,showArrows:(null===o||void 0===o?void 0:o.length)>1,navPosition:"outside",navStyle:"rounded",hidePrevButton:!0,children:(null===o||void 0===o?void 0:o.map((e,o)=>(0,R.jsx)("div",{className:no,children:(0,R.jsx)("img",{src:null===e||void 0===e?void 0:e.cdnImageUrl,alt:null===e||void 0===e?void 0:e.name,className:io})},o)))||[]})})})})},ao=e=>{var o,l;let{closeModal:n,oldPriceCalculator:i,priceCalculator:t}=e;const a=null!==i&&void 0!==i&&null!==(o=i.roomObjects)&&void 0!==o&&o.length?null===i||void 0===i?void 0:i.roomObjects:null===t||void 0===t?void 0:t.selectedRooms,[s,r]=(0,d.useState)({isOpen:!1,data:null});(0,L.fireGtmEvent)("checkout_opened_room_details_modal",{selectedRooms:a});const c=e=>{var o,l,n;let{roomDetails:i}=e;return(0,R.jsxs)("div",{className:Ke,children:[(0,R.jsx)("div",{className:Qe,children:(0,R.jsx)("h1",{className:Xe,children:null===i||void 0===i?void 0:i.roomName})}),(0,R.jsx)("span",{children:null===i||void 0===i||null===(o=i.rpObject)||void 0===o?void 0:o.name}),(0,R.jsx)("span",{children:[(null===i||void 0===i?void 0:i.sAdult)>0?"".concat(i.sAdult," ").concat((0,U.g3)(i.sAdult,(0,ze.t)("Adult"))):null,(null===i||void 0===i?void 0:i.sChild)>0?"".concat(i.sChild," ").concat((0,U.g3)(i.sChild,(0,ze.t)("Child"))):null,(null===i||void 0===i?void 0:i.sInfant)>0?"".concat(i.sInfant," ").concat((0,U.g3)(i.sInfant,(0,ze.t)("Infant"))):null].filter(Boolean).join(", ")}),(0,R.jsx)("button",{type:"button",className:Ze,onClick:e=>{e.stopPropagation(),r({isOpen:!0,data:null===i||void 0===i?void 0:i.RoomImages})},"aria-label":"View full screen images for ".concat(null===i||void 0===i?void 0:i.roomName),style:{border:"none",padding:0,background:"none",cursor:"pointer",width:"100%"},children:(0,R.jsx)(fe,{slidesToShow:1,spacing:0,loop:!0,showArrows:(null===i||void 0===i||null===(l=i.RoomImages)||void 0===l?void 0:l.length)>1,navPosition:"outside",navStyle:"rounded",hidePrevButton:!0,children:(null===i||void 0===i||null===(n=i.RoomImages)||void 0===n?void 0:n.map((e,o)=>(0,R.jsx)("div",{className:$e,children:(0,R.jsx)("img",{src:null===e||void 0===e?void 0:e.cdnImageUrl,alt:null===e||void 0===e?void 0:e.name,className:eo})},o)))||[]})})]})};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Se,{closeModal:n,children:(0,R.jsxs)("div",{className:Ue,children:[(0,R.jsx)("h3",{className:Je,children:"Room Photos"}),null===(l=(0,U.m9)(a))||void 0===l?void 0:l.map((e,o)=>(0,R.jsx)(c,{roomDetails:e},o))]})}),(null===s||void 0===s?void 0:s.isOpen)&&(0,R.jsx)(to,{data:null===s||void 0===s?void 0:s.data,closeModal:()=>r({isOpen:!1,data:null})})]})},so="ModifyBookingModal_modal_container__cRsHg",ro="ModifyBookingModal_modal_header__CJRK7",co="ModifyBookingModal_datePickerContainer__b1uIV",uo="ModifyBookingModal_selectedRoomsContainer__OkCuE",vo="ModifyBookingModal_selectedRoomsBox__6w+eh",mo="ModifyBookingModal_roomContainer__HksAl",po="ModifyBookingModal_roomBox__y0Jao",ho="ModifyBookingModal_roomImgBox__n2dUw",go="ModifyBookingModal_roomContentContainer__RCWER",_o="ModifyBookingModal_roomTitleBox__YgZNu",xo="ModifyBookingModal_actionBox__iT1J5",fo="ModifyBookingModal_actionBoxSep__7eHEm",yo="ModifyBookingModal_ratePlanName__ueABR",bo="ModifyBookingModal_guestCountBox__ZcTAo",jo="ModifyBookingModal_datePickerBox__5pszS",ko="ModifyBookingModal_actionButtonBox__kgKOR",Co="ModifyBookingModal_addMoreBtn__dV7WB",Ao="ModifyBookingModal_editRoomContainer__3zqA+",No="ModifyBookingModal_guestCountContainer__Po5so",Po="ModifyBookingModal_guestCountBtnBox__VPACL",Io="ModifyBookingModal_guestActionBtn__zTR9V",So="ModifyBookingModal_cancelChng__4pTyM",wo="ModifyBookingModal_countActnBtn__Jb4Xv",Do="ModifyBookingModal_saveBtn__ujE3E",Mo="ModifyBookingModal_dateLabelContainer__G0pxZ",Ro=e=>{let{style:o}=e;const l=(0,d.useRef)(),{dateRange:n,hotelData:i}=(0,v.d4)(e=>e.hotelInfo);(0,d.useEffect)(()=>{l.current&&(l.current.value="".concat(a()((null===i||void 0===i?void 0:i.checkInDate)||n.startDate).format("DD MMM YY")," - ").concat(a()((null===i||void 0===i?void 0:i.checkOutDate)||n.endDate).format("DD MMM YY")))},[i,n]);const{t:t}=(0,g.Bd)();return(0,R.jsx)("div",{className:"dates",style:o,children:(0,R.jsx)("div",{className:jo,children:(0,R.jsx)("input",{type:"text",id:"date-input",placeholder:t("checkin_checkout"),readOnly:!0,ref:l})})})};var Bo=l(863);const Eo={wrapper:{position:"relative",width:"100%",maxWidth:"400px"},button:{width:"100%",padding:"12px 16px",background:"white",border:"1px solid #ddd",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",textAlign:"left",fontSize:"13px",color:"#494545"},dropdown:{position:"absolute",top:"100%",left:"0",right:"0",background:"white",border:"1px solid #D7D2D2",borderRadius:"4px",marginTop:"4px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:"99"},option:{padding:"12px 14px",cursor:"pointer",color:"#494545",fontSize:"13px"}},To=e=>{let{options:o,onChange:l,selectedValue:n,additional:t}=e;const[a,s]=(0,d.useState)(!1),[r,c]=(0,d.useState)(n||{});return console.log({options:o},"==== options ==="),null!==o&&void 0!==o&&o.length?(0,R.jsxs)("div",{style:Eo.wrapper,children:[(0,R.jsxs)("button",{style:Eo.button,onClick:()=>{const e=!a;(0,L.fireGtmEvent)("custom_dropdown_toggle",{action:e?"open":"close",selected_value:(null===r||void 0===r?void 0:r.name)||"",dropdown_context:t||""}),s(e)},children:[(0,R.jsx)("span",{children:null===r||void 0===r?void 0:r.name}),(0,R.jsx)(Bo.A,{size:20,style:{transform:a?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s ease"}})]}),a&&(0,R.jsx)("div",{style:Eo.dropdown,children:null===o||void 0===o?void 0:o.map(e=>(0,R.jsx)("div",{style:(0,i.A)((0,i.A)({},Eo.option),{},{backgroundColor:e===r?"#f5f5f5":"white"}),onMouseEnter:e=>e.target.style.backgroundColor="#f5f5f5",onMouseLeave:o=>o.target.style.backgroundColor=e===r?"#f5f5f5":"white",onClick:()=>{(0,L.fireGtmEvent)("custom_dropdown_option_selected",{option_name:null===e||void 0===e?void 0:e.name,option_value:null===e||void 0===e?void 0:e.value,previous_selection:(null===r||void 0===r?void 0:r.name)||"",dropdown_context:t||""}),c((0,i.A)({name:null===e||void 0===e?void 0:e.name,value:null===e||void 0===e?void 0:e.value},e)),(e=>{l(e,t)})(e),s(!1)},children:null===e||void 0===e?void 0:e.name},null===e||void 0===e?void 0:e.value))})]}):(0,R.jsx)(R.Fragment,{})},Oo=e=>{var o;let{closeModal:l,priceCalculator:n,oldPriceCalculator:t}=e;const{hotelData:a,isHourlyRoom:s,isRatePlans:r}=(0,v.d4)(e=>e.hotelInfo),c=(0,v.wA)(),u=(0,m.useHistory)(),p=null!==t&&void 0!==t&&null!==(o=t.roomObjects)&&void 0!==o&&o.length?null===t||void 0===t?void 0:t.roomObjects:null===n||void 0===n?void 0:n.selectedRooms,[h]=(0,d.useState)({startDate:null===a||void 0===a?void 0:a.checkInDate,endD
1ate:null===a||void 0===a?void 0:a.checkOutDate}),[g,_]=(0,d.useState)([]),[x,f]=(0,d.useState)([]),[y,b]=(0,d.useState)([]),[j,k]=(0,d.useState)({isOpen:!1,data:null});let C=0;const A=(e,o)=>{f(r?l=>{var n,i,t,a;const d=[...l],s=d.findIndex(e=>(null===e||void 0===e?void 0:e.id)===o);if(-1===s)return l;const r=d[s],c=null===r||void 0===r||null===(n=r.room)||void 0===n?void 0:n.maxGuestCount,u=null===r||void 0===r||null===(i=r.room)||void 0===i?void 0:i.maxAdultCount,v=null===r||void 0===r||null===(t=r.room)||void 0===t?void 0:t.maxChildCount,m=null===r||void 0===r||null===(a=r.room)||void 0===a?void 0:a.maxInfantCount;if("sAdult"===e&&(null===r||void 0===r?void 0:r.sAdult)>=u)return l;if("sChild"===e&&(null===r||void 0===r?void 0:r.sChild)>=v)return l;if("sInfant"===e&&(null===r||void 0===r?void 0:r.sInfant)>=m)return l;return((null===r||void 0===r?void 0:r.sAdult)||1)+((null===r||void 0===r?void 0:r.sChild)||0)+((null===r||void 0===r?void 0:r.sInfant)||0)>=c?l:(r[e]=(r[e]||0)+1,d)}:l=>{const n=[...l],i=n.findIndex(e=>(null===e||void 0===e?void 0:e.idx)===o);if(-1===i)return l;const t=n[i],a=null===t||void 0===t?void 0:t.maxGuestCount;if(((null===t||void 0===t?void 0:t.sAdult)||1)+((null===t||void 0===t?void 0:t.sChild)||0)+((null===t||void 0===t?void 0:t.sInfant)||0)>=a)return l;if("sAdult"===e){const e=(null===t||void 0===t?void 0:t.maxAdultCount)||a;if((null===t||void 0===t?void 0:t.sAdult)>=e)return l}if("sChild"===e){const e=(null===t||void 0===t?void 0:t.maxChildCount)||a;if((null===t||void 0===t?void 0:t.sChild)>=e)return l}if("sInfant"===e){const e=(null===t||void 0===t?void 0:t.maxInfantCount)||a;if((null===t||void 0===t?void 0:t.sInfant)>=e)return l}return t[e]=(t[e]||0)+1,n}),(0,L.fireGtmEvent)("checkout_incremented_guest_count",{roomId:o,guest:"sAdult"===e?"Adult":"sChild"===e?"Child":"sInfant"===e?"Infant":""})},N=(e,o)=>{f(r?l=>{const n=[...l],i=n.findIndex(e=>(null===e||void 0===e?void 0:e.id)===o);if(-1===i)return l;const t=n[i];return"sAdult"===e&&1===(null===t||void 0===t?void 0:t.sAdult)||0===t[e]?l:(t[e]=t[e]-1,n)}:l=>{var n;const i=[...l],t=i.findIndex(e=>(null===e||void 0===e?void 0:e.idx)===o);if(-1===t)return l;const a=i[t];return("sAdult"!==e||1!==(null===a||void 0===a?void 0:a.sAdult)&&void 0!==(null===a||void 0===a?void 0:a.sAdult))&&("sChild"!==e&&"sInfant"!==e||0!==a[e]&&void 0!==a[e])?(a[e]=(null!==(n=a[e])&&void 0!==n?n:0)-1,i):l}),(0,L.fireGtmEvent)("checkout_decremented_guest_count",{roomId:o,guest:"sAdult"===e?"Adult":"sChild"===e?"Child":"sInfant"===e?"Infant":""})},P=(e,o)=>{b(l=>[...l,{selectedRoom:o,rp:e}]),(0,L.fireGtmEvent)("checkout_selected_rate_plan_changed",{selectedRoom:o,rp:e})};return(0,R.jsx)(Se,{closeModal:l,children:(0,R.jsxs)("div",{className:so,children:[(0,R.jsx)("h3",{className:ro,children:"Modify Booking"}),(0,R.jsxs)("div",{className:co,children:[(0,R.jsxs)("div",{className:Mo,children:[(0,R.jsx)("p",{children:"Selected Dates"}),(0,R.jsx)("button",{type:"button",onClick:()=>u.goBack(),style:{background:"none",border:"none",cursor:"pointer",textDecoration:"underline",color:"inherit"},"aria-label":"Go back to modify booking dates",children:"Modify Date"})]}),(0,R.jsx)(Ro,{style:{display:"flex",flexDirection:"column",padding:"20px !important"},dateRange:h})]}),(0,R.jsxs)("div",{className:uo,children:[(0,R.jsx)("h4",{children:"You have selected"}),(0,R.jsx)("div",{className:vo,children:null===p||void 0===p?void 0:p.map(e=>{var o,l,n,t,d,v,m,h,y,b,j,I,S,w,D,M,B,O,F,z,G;const{cost:W}=(e=>{var o;const l=null===e||void 0===e||null===(o=e.HotelRoomAmenities)||void 0===o?void 0:o.some(e=>{var o,l;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===(l=e.Amenity)||void 0===l?void 0:l.category)});let n=0,i=0;return p.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)).forEach(e=>{n+=(null===e||void 0===e?void 0:e.sum)+(null===e||void 0===e?void 0:e.priceReduced)}),s&&(C=0,i=0),n+=i,Y.A.set("tax",parseFloat(C.toFixed((0,U.S2)(null===a||void 0===a?void 0:a.currency)))),{isDorm:l,cost:(1*n).toFixed((0,U.S2)(null===a||void 0===a?void 0:a.currency))}})(e),V=r?(null===x||void 0===x?void 0:x.find(o=>o.id===e.id))||e:(null===x||void 0===x?void 0:x.find(o=>o.idx===e.idx))||e,q=["Adult"];return null!==e&&void 0!==e&&e.extraChildPrice&&q.push("Child"),null!==e&&void 0!==e&&e.extraInfantPrice&&q.push("Infant"),(0,R.jsxs)("div",{className:mo,children:[(0,R.jsxs)("div",{className:po,children:[(0,R.jsx)("button",{type:"button",className:ho,onClick:()=>{k({isOpen:!0,data:null===e||void 0===e?void 0:e.RoomImages}),(0,L.fireGtmEvent)("checkout_clicked_to_view_room_image",e)},"aria-label":"View full screen images for ".concat(null===e||void 0===e?void 0:e.roomName),style:{border:"none",padding:0,background:"none",cursor:"pointer"},children:(0,R.jsx)("img",{src:null===e||void 0===e||null===(o=e.RoomImages)||void 0===o||null===(l=o[0])||void 0===l?void 0:l.cdnImageUrl,alt:"".concat(null===e||void 0===e?void 0:e.roomName," preview")})}),(0,R.jsxs)("div",{className:go,children:[(0,R.jsxs)("div",{className:_o,children:[(0,R.jsx)("h3",{children:null===e||void 0===e?void 0:e.roomName}),(0,R.jsxs)("div",{className:xo,children:[!(null!==g&&void 0!==g&&g.includes(r?null===e||void 0===e?void 0:e.id:null===e||void 0===e?void 0:e.idx))&&
1(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("button",{type:"button",onClick:()=>(e=>{if(!r){_(o=>[...o,null===e||void 0===e?void 0:e.idx]);const o=JSON.parse(JSON.stringify(e));return f(e=>[...e,o]),void(0,L.fireGtmEvent)("checkout_clicked_edit_room",e)}const o=JSON.parse(JSON.stringify(e));f(e=>[...e,o]),_(o=>[...o,null===e||void 0===e?void 0:e.id]),(0,L.fireGtmEvent)("checkout_clicked_edit_room",e)})(e),"aria-label":"Edit ".concat(null===e||void 0===e?void 0:e.roomName," details"),style:{background:"none",border:"none",cursor:"pointer",padding:0,display:"inline-flex"},children:(0,R.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/edit_btn.svg",alt:"","aria-hidden":"true"})}),(0,R.jsx)("div",{className:fo})]}),(0,R.jsx)("button",{type:"button",onClick:()=>(e=>{if(1!==(null===p||void 0===p?void 0:p.length))if((0,L.fireGtmEvent)("checkout_removed_selected_room",e),r)c((0,E.A9)(null===e||void 0===e?void 0:e.id)),_(o=>o.filter(o=>o!==e.id)),f(o=>o.filter(o=>o.id!==e.id));else{const o=p.filter(o=>o.idx!==e.idx);c({type:T.A.DESET_ROOM,payload:o}),_(o=>o.filter(o=>o!==e.idx)),f(o=>o.filter(o=>o.idx!==e.idx))}else u.goBack()})(e),"aria-label":"Remove ".concat(null===e||void 0===e?void 0:e.roomName," from booking"),style:{background:"none",border:"none",cursor:"pointer",padding:0,display:"inline-flex"},children:(0,R.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/delete_btn.svg",alt:"","aria-hidden":"true"})})]})]}),(0,R.jsx)("p",{className:yo,children:null===e||void 0===e||null===(n=e.rpObject)||void 0===n?void 0:n.name}),(0,R.jsxs)("div",{className:bo,children:[(0,R.jsx)("p",{children:[(null===V||void 0===V?void 0:V.sAdult)>0?"".concat(V.sAdult," ").concat((0,U.g3)(V.sAdult,(0,ze.t)("Adult"))):null,(null===V||void 0===V?void 0:V.sChild)>0?"".concat(V.sChild," ").concat((0,U.g3)(V.sChild,(0,ze.t)("Child"))):null,(null===V||void 0===V?void 0:V.sInfant)>0?"".concat(V.sInfant," ").concat((0,U.g3)(V.sInfant,(0,ze.t)("Infant"))):null].filter(Boolean).join(", ")}),(0,R.jsx)("span",{children:(0,R.jsx)(H.A,{amount:Number(W)})})]})]})]}),r&&g.includes(null===e||void 0===e?void 0:e.id)?(0,R.jsxs)("div",{className:Ao,children:[(0,R.jsxs)("div",{className:No,children:[(0,R.jsx)("div",{className:bo,children:["Adult","Child","Infant"].map(o=>(0,R.jsxs)("div",{className:Po,role:"group","aria-labelledby":"".concat(o,"-").concat(null===e||void 0===e?void 0:e.id,"-label"),children:[(0,R.jsx)("label",{id:"".concat(o,"-").concat(null===e||void 0===e?void 0:e.id,"-label"),htmlFor:o.toLowerCase(),children:(0,ze.t)(o.toLowerCase()+"s")}),(0,R.jsxs)("div",{className:Io,children:[(0,R.jsx)("button",{type:"button",onClick:()=>N("s".concat(o),null===e||void 0===e?void 0:e.id),"aria-label":"Decrease ".concat(o," count"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,R.jsx)(De.A,{size:16,className:wo,"aria-hidden":"true"})}),(0,R.jsx)("span",{"aria-live":"polite",children:V["s".concat(o)]||0}),(0,R.jsx)("button",{type:"button",onClick:()=>A("s".concat(o),null===e||void 0===e?void 0:e.id),"aria-label":"Increase ".concat(o," count"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,R.jsx)(Me.A,{size:16,className:wo,"aria-hidden":"true"})})]})]},o))}),(0,R.jsx)(To,{options:null===a||void 0===a||null===(t=a.HotelRooms)||void 0===t||null===(d=t.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===d||null===(v=d.pricing)||void 0===v?void 0:v.map(o=>{var l,n,t;const d=null===a||void 0===a||null===(l=a.HotelRooms)||void 0===l||null===(n=l.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===n?void 0:n.ratePlans[o];return d?(0,i.A)({name:null===(t=JSON.parse(null===d||void 0===d?void 0:d.ratePlanConfig))||void 0===t?void 0:t.name,value:null===d||void 0===d?void 0:d.ratePlanCode},d):null}).filter(Boolean),onChange:P,selectedValue:(null===a||void 0===a||null===(m=a.HotelRooms)||void 0===m||null===(h=m.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===h?void 0:h.ratePlans)&&(null===(y=Object.entries(null===a||void 0===a||null===(j=a.HotelRooms)||void 0===j||null===(I=j.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===I?void 0:I.ratePlans))||void 0===y||null===(b=y.map(e=>{var o;let[,l]=e;return(0,i.A)({name:null===(o=JSON.parse(null===l||void 0===l?void 0:l.ratePlanConfig))||void 0===o?void 0:o.name,value:null===l||void 0===l?void 0:l.ratePlanCode},l)}))||void 0===b?void 0:b.find(o=>{var l;return o.id===(null===e||void 0===e||null===(l=e.rpObject)||void 0===l?void 0:l.id)}
1)),additional:e})]}),(0,R.jsx)("button",{type:"button",className:So,onClick:()=>{_(o=>o.filter(o=>o!==e.id)),f(o=>o.filter(o=>o.id!==e.id)),(0,L.fireGtmEvent)("checkout_cancel_editing_room",e)},"aria-label":"Cancel changes to ".concat(null===e||void 0===e?void 0:e.roomName),style:{cursor:"pointer"},children:"Cancel changes"})]}):!r&&g.includes(null===e||void 0===e?void 0:e.idx)?(0,R.jsxs)("div",{className:Ao,children:[(0,R.jsxs)("div",{className:No,children:[(0,R.jsx)("div",{className:bo,children:q.map(o=>(0,R.jsxs)("div",{className:Po,role:"group","aria-labelledby":"".concat(o,"-").concat(null===e||void 0===e?void 0:e.idx,"-label"),children:[(0,R.jsx)("label",{id:"".concat(o,"-").concat(null===e||void 0===e?void 0:e.idx,"-label"),htmlFor:o.toLowerCase(),children:(0,ze.t)(o.toLowerCase()+"s")}),(0,R.jsxs)("div",{className:Io,children:[(0,R.jsx)("button",{type:"button",onClick:()=>N("s".concat(o),null===e||void 0===e?void 0:e.idx),"aria-label":"Decrease ".concat(o," count"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,R.jsx)(De.A,{size:16,className:wo,"aria-hidden":"true"})}),(0,R.jsx)("span",{"aria-live":"polite",children:V["s".concat(o)]||0}),(0,R.jsx)("button",{type:"button",onClick:()=>A("s".concat(o),null===e||void 0===e?void 0:e.idx),"aria-label":"Increase ".concat(o," count"),style:{background:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center"},children:(0,R.jsx)(Me.A,{size:16,className:wo,"aria-hidden":"true"})})]})]},o))}),(0,R.jsx)(To,{options:null===a||void 0===a||null===(S=a.HotelRooms)||void 0===S||null===(w=S.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===w||null===(D=w.pricing)||void 0===D?void 0:D.map(o=>{var l,n,t;const d=null===a||void 0===a||null===(l=a.HotelRooms)||void 0===l||null===(n=l.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===n?void 0:n.ratePlans[o];return d?(0,i.A)({name:null===(t=JSON.parse(null===d||void 0===d?void 0:d.ratePlanConfig))||void 0===t?void 0:t.name,value:null===d||void 0===d?void 0:d.ratePlanCode},d):null}).filter(Boolean),onChange:P,selectedValue:(null===a||void 0===a||null===(M=a.HotelRooms)||void 0===M||null===(B=M.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===B?void 0:B.ratePlans)&&(null===(O=Object.entries(null===a||void 0===a||null===(z=a.HotelRooms)||void 0===z||null===(G=z.find(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.roomId)))||void 0===G?void 0:G.ratePlans))||void 0===O||null===(F=O.map(e=>{var o;let[,l]=e;return(0,i.A)({name:null===(o=JSON.parse(null===l||void 0===l?void 0:l.ratePlanConfig))||void 0===o?void 0:o.name,value:null===l||void 0===l?void 0:l.ratePlanCode},l)}))||void 0===F?void 0:F.find(o=>{var l;return o.id===(null===e||void 0===e||null===(l=e.rpObject)||void 0===l?void 0:l.id)})),additional:e})]}),(0,R.jsx)("span",{className:So,onClick:()=>{_(o=>o.filter(o=>o!==e.idx)),f(o=>o.filter(o=>o.idx!==e.idx))},children:"Cancel changes"})]}):null]},e.id)})})]}),(0,R.jsxs)("div",{className:ko,children:[(0,R.jsx)("button",{type:"button",className:Co,onClick:()=>{u.goBack(),(0,L.fireGtmEvent)("checkout_add_more_rooms")},children:"Add More Rooms"}),null!==g&&void 0!==g&&g.length?(0,R.jsx)("button",{type:"button",className:Do,onClick:()=>{r?c({type:T.A.EDIT_RP,payload:(0,i.A)({},null===x||void 0===x?void 0:x[0])}):x.forEach(e=>{const o=(0,i.A)((0,i.A)({},e),{},{sAdult:e.sAdult,sChild:e.sChild,sInfant:e.sInfant});c({type:T.A.SET_ROOM,payload:o})}),null!==y&&void 0!==y&&y.length&&(y.forEach(e=>{var o;const{rp:l,selectedRoom:n}=e,t=(0,i.A)((0,i.A)({},JSON.parse(null===l||void 0===l?void 0:l.ratePlanConfig)),{},{ratePlanId:null===l||void 0===l?void 0:l.ratePlanId,ratePlanCode:null===l||void 0===l?void 0:l.ratePlanCode,id:null===l||void 0===l?void 0:l.id}),a=null===p||void 0===p||null===(o=p.filter(e=>(null===e||void 0===e?void 0:e.roomId)===(null===n||void 0===n?void 0:n.roomId)))||void 0===o?void 0:o.length;let d={sAdult:null===n||void 0===n?void 0:n.sAdult,sChild:null===n||void 0===n?void 0:n.sChild,sInfant:null===n||void 0===n?void 0:n.sInfant,code:null===t||void 0===t?void 0:t.ratePlanCode,roomId:null===n||void 0===n?void 0:n.roomId,rpObject:t,id:"".concat(null===n||void 0===n?void 0:n.roomId,"_").concat(null===t||void 0===t?void 0:t.ratePlanCode,"_").concat(null===n||void 0===n?void 0:n.idx),idx:null===n||void 0===n?void 0:n.idx,RoomImages:null===n||void 0===n?void 0:n.RoomImages,roomName:null===n||void 0===n?void 0:n.roomName,roomCount:a};c((0,E.h)({obj:d,rmRpId:null===n||void 0===n?void 0:n.id}))}),b([])),_([]),f([]),(0,L.fireGtmEvent)("checkout_saved_room_edits",(0,i.A)({},null===x||void 0===x?void 0:x[0]))},children:"Save"}):null]}),(null===j||void 0===j?void 0:j.isOpen)&&(0,R.jsx)(to,{data:null===j||void 0===j?void 0:j.data,closeModal:()=>k({isOpen:!1,data:null})})]})})};var Yo=l(6177);const Fo=e=>{var o,l,n,i,t,r,c,u,m,p,h,g,_,x,f,y;let{priceCalculator:b,oldPriceCalculator:j,extraPrice:k,localExtraValue:C=1,giftCardApplied:A=!1,giftCard:N={}}=e;const{hotelData:P,selectedRooms:I,selectedRatePlans:S,selectedAddons:w,dateCount:D,selectedHotelAddons:M,isHourlyRoom:B,isRatePlans:E,couponName:T,couponCode:F,dateRange:z,totalAdult:W,totalChild:V}=(0,v.d4)(e=>e.hotelInfo),{hotelCurrency:q,displayCurrency:J}=(0,Yo.A)(),K=Y.A.get("promo")||{},X=Y.A.get("utmObj")||{},Q="maharajaclub"===(null===X||void 0===X?void 0:X.utmSource)||"maharaja"===(null===X||void 0===X?void 0:X.utmSource),Z=1===(null===P||void 0===P?void 0:P.chainId),[$,ee]=(0,d.useState)({isOpen:!1,data:null}),[oe,le]=(0,d.useState)({isOpen:!1,data:null}),[ne,ie]=(0,d.useState)(!1),[te,ae]=(0,d.useState)([]),[se,re]=(0,d.useState)({isActive:!1,name:""}),[ce,ue]=(0,d.useState)(null),ve=(e=>{const o=new Map;
1return null===(e=b.selectedRooms)||void 0===e||e.forEach(e=>{var l;null===e||void 0===e||null===(l=e.promosApplied)||void 0===l||l.forEach(e=>{let{promo:l}=e;null===l||void 0===l||l.forEach(e=>{if(null===e||void 0===e||!e.id)return;if(null!==F&&void 0!==F&&F.id&&e.id===F.id)return;const l=(null===e||void 0===e?void 0:e.name)||"Promotion";o.set(l,(o.get(l)||0)+(e._reducedPrice||0))})})}),Array.from(o.entries()).map(e=>{let[o,l]=e;return{name:o,discount:l}})})(),me=sessionStorage.getItem("searchParams"),pe=Y.A.get("lowestAmount");(0,d.useEffect)(()=>{var e;const o=JSON.parse(me||"null");var l;null!==o&&void 0!==o&&null!==(e=o.promotionSelected)&&void 0!==e&&e.isMembership&&re({isActive:!0,name:null===o||void 0===o||null===(l=o.promotionSelected)||void 0===l?void 0:l.name});return()=>{re({isActive:!1,name:""})}},[me]),(0,d.useEffect)(()=>{(async()=>{var e;if(null===pe||void 0===pe||!pe.lowestPrice)return ae([]);const o=await(0,O.uR)({hotelId:null===P||void 0===P?void 0:P.id,checkInDate:a()(null===z||void 0===z?void 0:z.startDate).format("YYYY-MM-DD"),checkOutDate:a()(null===z||void 0===z?void 0:z.endDate).format("YYYY-MM-DD")}),l=["_id","hotelId","hotelName","checkInDate","checkOutDate","isLowest","isActive","isExist","soldOut","officialExist","checkedDate","createdDt"],n=(null===o||void 0===o||null===(e=o.data)||void 0===e?void 0:e[0])||[];if(console.log(Object.keys(n)),!n.officialExist)return ae([]);if(ue(n.checkedDate),n["hotelzify.com"]||n["www.hotelzify.com"]||n.isLowest||n.officialExist){const e=Object.keys(n).filter(e=>!l.includes(e)).map(e=>n[e]>=(null===pe||void 0===pe?void 0:pe.lowestPrice)?{name:e,value:n[e]}:null).filter(Boolean).sort((e,o)=>o.value-e.value);ae(e)}})()},[]);let he=0;const ge=A?parseFloat(N.amount||0):0,_e=E&&!B?Math.max(0,b.appliedDiscount.discount>0?b.priceAfterDiscount+(null===b||void 0===b?void 0:b.totalAddonCost)+(null!==P&&void 0!==P&&P.isTaxIncluded?0:b.rpTax)+(null===(o=b.taxObj)||void 0===o?void 0:o.totalBookingTax):b.rpPrice+(null!==P&&void 0!==P&&P.isTaxIncluded?0:b.rpTax)+(null===(l=b.taxObj)||void 0===l?void 0:l.totalBookingTax)).toFixed(2):Math.max(0,j.totalPrice+Math.abs(j.totalTax+(null===(n=j.taxObj)||void 0===n?void 0:n.totalBookingTax))).toFixed(2),xe=E&&!B?b.appliedDiscount.discount>0?b.priceAfterDiscount:b.rpPrice:j.totalPrice,fe=e=>{var o;if(e)return E&&b.appliedDiscount.discount-b.couponValue>0&&(e-=(b.appliedDiscount.discount-b.couponValue)*k),j.couponValue>0&&(e-=j.couponValue*k),b.couponValue>0&&(e-=b.couponValue*k),null===(o=Number(e))||void 0===o?void 0:o.toFixed(2)},ye=()=>{(0,L.fireGtmEvent)("checkout_see_photos",{selectedRooms:I}),ee({isOpen:!0,data:I})};return(0,R.jsxs)("div",{className:Ge.flashSaleContainer,children:[(0,R.jsx)("div",{className:Ge.flashSaleContent,children:(0,R.jsxs)("div",{className:Ge.bookingActionsBox,children:[(0,R.jsx)("span",{onClick:()=>((0,L.fireGtmEvent)("checkout_modify_booking",{selectedRooms:I}),void le({isOpen:!0,data:I})),children:"Modify Booking"}),(0,R.jsx)("div",{}),(0,R.jsx)("span",{onClick:()=>ye(),children:"See Photos"})]})}),(0,R.jsx)("div",{className:Ge.checkinContainer,children:(0,R.jsxs)("div",{className:Ge.checkInContent,children:[(0,R.jsx)("div",{className:Ge.flashSaleBanner,children:(0,R.jsx)("span",{className:Ge.flashSaleTitle,children:(0,ze.t)("bill_details")})}),null===(i=b.selectedRooms)||void 0===i?void 0:i.map(e=>{var o,l,n,i,t,a,d,s;let r=0,c=0;return b.selectedRooms.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)&&(null===o||void 0===o?void 0:o.idx)===(null===e||void 0===e?void 0:e.idx)).forEach(e=>{r+=(null===e||void 0===e?void 0:e.sum)+(null===e||void 0===e?void 0:e.priceReduced)}),Y.A.set("tax",parseFloat(he.toFixed((0,U.S2)(null===P||void 0===P?void 0:P.currency)))),B&&(he=0,c=0),r+=c,(0,R.jsxs)("div",{className:Ge.roomBox,children:[(null===e||void 0===e||null===(o=e.room)||void 0===o||null===(l=o.RoomImages)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.cdnImageUrl)&&(0,R.jsx)("img",{src:"".concat(e.room.RoomImages[0].cdnImageUrl,"?tr=w-104,h-104,ar-1-1,fo-auto,q-80"),alt:null===e||void 0===e||null===(i=e.room)||void 0===i?void 0:i.roomName,className:Ge.roomThumbnail,loading:"lazy",onClick:ye,style:{cursor:"pointer"}}),(0,R.jsxs)("div",{className:Ge.roomDetailContainer,children:[(0,R.jsx)("h3",{onClick:ye,style:{cursor:"pointer"},children:null===e||void 0===e||null===(t=e.room)||void 0===t?void 0:t.roomName}),(null===e||void 0===e||null===(a=e.rpObject)||void 0===a?void 0:a.name)&&(0,R.jsx)("span",{className:!(null!==e&&void 0!==e&&null!==(d=e.rpObject)&&void 0!==d&&d.name)&&"displayNone",children:null===e||void 0===e||null===(s=e.rpObject)||void 0===s?void 0:s.name}),(0,R.jsx)("span",{children:[(null===e||void 0===e?void 0:e.sAdult)>0?"".concat(e.sAdult," ").concat((0,U.g3)(e.sAdult,(0,ze.t)("Adult"))):null,(null===e||void 0===e?void 0:e.sChild)>0?"".concat(e.sChild," ").concat((0,U.g3)(e.sChild,(0,ze.t)("Child"))):null,(null===e||void 0===e?void 0:e.sInfant)>0?"".concat(e.sInfant," ").concat((0,U.g3)(e.sInfant,(0,ze.t)("Infant"))):null].filter(
1Boolean).join(", ")})]}),(0,R.jsx)("div",{children:(0,R.jsx)("div",{children:(0,R.jsx)("span",{className:Ge.roomItemPrice,children:(0,R.jsx)(H.A,{amount:r*C})})})})]},null===e||void 0===e?void 0:e.id)}),null===(t=(0,U.m9)(j.roomObjects))||void 0===t?void 0:t.map(e=>{var o,l,n,i,t,a,d,s,r,c;let u=!1;null!==e&&void 0!==e&&null!==(o=e.HotelRoomAmenities)&&void 0!==o&&o.some(e=>{var o,l;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===(l=e.Amenity)||void 0===l?void 0:l.category)})&&(u=!0);let v=null===(l=j.roomObjects)||void 0===l||null===(n=l.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)))||void 0===n?void 0:n.length,m=D,p=0,h=0;return j.roomObjects.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)).forEach(e=>{p+=(null===e||void 0===e?void 0:e.sAdult)+(null===e||void 0===e?void 0:e.sChild)+(null===e||void 0===e?void 0:e.sInfant),h+=(null===e||void 0===e?void 0:e.sum)+(null===e||void 0===e?void 0:e.priceReduced)}),Y.A.set("tax",parseFloat(he.toFixed((0,U.S2)(null===P||void 0===P?void 0:P.currency)))),("INR"!==(null===P||void 0===P?void 0:P.currency)||B||null!==I&&void 0!==I&&I.some(e=>U.hm.includes(null===e||void 0===e?void 0:e.id)))&&(he=0),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:Ge.roomBox,children:[(null===e||void 0===e||null===(i=e.RoomImages)||void 0===i||null===(t=i[0])||void 0===t?void 0:t.cdnImageUrl)&&(0,R.jsx)("img",{src:"".concat(e.RoomImages[0].cdnImageUrl,"?tr=w-104,h-104,ar-1-1,fo-auto,q-80"),alt:null===e||void 0===e?void 0:e.roomName,className:Ge.roomThumbnail,loading:"lazy",onClick:ye,style:{cursor:"pointer"}}),(0,R.jsxs)("div",{className:Ge.roomDetailContainer,children:[(0,R.jsx)("h3",{onClick:ye,style:{cursor:"pointer"},children:null===e||void 0===e?void 0:e.roomName}),(null===e||void 0===e||null===(a=e.rpObject)||void 0===a?void 0:a.name)&&(0,R.jsx)("span",{className:!(null!==e&&void 0!==e&&null!==(d=e.rpObject)&&void 0!==d&&d.name)&&"displayNone",children:null===e||void 0===e||null===(s=e.rpObject)||void 0===s?void 0:s.name}),E?(0,R.jsx)("span",{children:[(null===e||void 0===e?void 0:e.sAdult)>0?"".concat(e.sAdult," ").concat((0,U.g3)(e.sAdult,(0,ze.t)("Adult"))):null,(null===e||void 0===e?void 0:e.sChild)>0?"".concat(e.sChild," ").concat((0,U.g3)(e.sChild,(0,ze.t)("Child"))):null,(null===e||void 0===e?void 0:e.sInfant)>0?"".concat(e.sInfant," ").concat((0,U.g3)(e.sInfant,(0,ze.t)("Infant"))):null].filter(Boolean).join(", ")}):(0,R.jsxs)("p",{children:[v," ",u?(0,ze.t)("bed"):(0,ze.t)("room")," x"," ","".concat(m," ").concat((0,ze.t)("night"))," (",p," ",p>1?(0,ze.t)("guests"):(0,ze.t)("guest"),")"]})]}),(0,R.jsx)("div",{children:(0,R.jsx)("span",{className:Ge.roomItemPrice,children:(0,R.jsx)(H.A,{amount:h*C})})})]},null===e||void 0===e?void 0:e.id),null===(r=[...new Set(w)])||void 0===r||null===(c=r.filter(o=>{var l;return(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"person"!==(null===o||void 0===o||null===(l=o.Addon)||void 0===l?void 0:l.category)}))||void 0===c?void 0:c.map(e=>{var o,l;let n=null===w||void 0===w||null===(o=w.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)))||void 0===o?void 0:o.length;return(0,R.jsx)("div",{className:Ge.addonContainer,children:(0,R.jsxs)("div",{className:Ge.roomDetailContainer,children:[(0,R.jsx)("h3",{children:(0,ze.t)("addons")}),(0,R.jsxs)("div",{className:Ge.roomBox,children:[(0,R.jsx)("div",{className:Ge.roomDetailContainer,children:(0,R.jsxs)("span",{className:Ge.addonLabel,children:[n," x ",null===e||void 0===e||null===(l=e.Addon)||void 0===l?void 0:l.name," x ",m," ",(0,ze.t)("night")]})}),(0,R.jsx)("span",{className:Ge.roomItemPrice,children:(0,R.jsx)(H.A,{amount:(null===e||void 0===e?void 0:e.price)*m*n*C})})]})]})},null===e||void 0===e?void 0:e.id)})]})}),(null===M||void 0===M?void 0:M.length)>0&&(0,R.jsx)("div",{className:Ge.roomDetailContainer,children:(0,R.jsx)("h3",{children:(0,ze.t)("addons")})}),null===(r=[...new Set(M)])||void 0===r?void 0:r.map(e=>{var o;let l=null===M||void 0===M||null===(o=M.filter(o=>(null===o||void 0===o?void 0:o.id)===(null===e||void 0===e?void 0:e.id)))||void 0===o?void 0:o.length;if("guest_based"===e.Addon.multiplier){const{adultCount:o,childrenCount:l}=(0,s.VF)({selectedRooms:I,selectedRatePlans:S,totalAdult:W,totalChild:V});return(0,R.jsxs)("div",{className:Ge.roomBox,children:[(0,R.jsxs)("div",{className:Ge.roomDetailContainer,children:[(0,R.jsx)("span",{className:Ge.addonLabel,children:null===e||void 0===e?void 0:e.name}),(0,R.jsxs)("div",{style:{fontSize:"0.8rem",color:"#767676"},children:[(0,R.jsxs)("p",{children:[o," ",(0,ze.t)("adult")," x"," ",(0,R.jsx)(H.A,{amount:Number((null===e||void 0===e?void 0:e.price)*k)})]}),l>0&&(0,R.jsxs)("p",{children:[l," ",(0,ze.t)("child")," x"," ",(0,R.jsx)(H.A,{amount:Number(((null===e||void 0===e?void 0:e.childPrice)||0)*k)})]})]})]}),(0,R.jsxs)("div",{style:{textAlign:"right"},children:[(0,R.jsx)("span",{className:Ge.roomItemPrice,children:(0,R.jsx)(H.A,{amount:Number((o*(null===e||void 0===e?void 0:e.price)+l*((null===e||void 0===e?void 0:e.childPrice)||0))*D*k)})}),(0,R.jsxs)("p",{style:{fontSize:"0.75rem",color:"#767676"},children:[(0,ze.t)("for")," ",D," ",D>1?(0,ze.t)("days"):(0,ze.t)("day")]})]})]},null===e||void 0===e?void 0:e.id)}return"per_day"===e.Addon.multiplier?(0,R.jsxs)("div",{className:Ge.roomBox,children:[(0,R.jsx)("div",{className:Ge.roomDetailContainer,children:(0,R.jsx)("span",{className:Ge.addonLabel,children:"".concat(null===e||void 0===e?void 0:e.name," (x ").concat(l,")")})},null===e||void 0===e?void 0:e.id),(0,R.jsx)("span",{className:Ge.roomItemPrice,children:(0,R.jsx)(H.A,{amount:Number((null===e||void 0===e?void 0:e.price)*l*D*k)})})]}):(0,R.jsxs)("div",{className:Ge.roomBox,children:[(0,R.jsx)("div",{className:Ge.roomDetailContainer,children:(0,R.jsx)("span",{className:Ge.addonLabel,children:"".concat(null===e||void 0===e?void 0:e.name," (x ").concat(l,")")})},null===e||void 0===e?void 0:e.id),(0,R.jsx)("span",{className:Ge.roomItemPrice,children:(0,R.jsx)(H.A,{amount:Number((null===e||void 0===e?void 0:e.price)*l*k)})})]})}),(0,R.jsxs)("div",{className:Ge.amountContainer,children:[(0,R.jsxs)("div",{className:Ge.rightBottomContainer,children:[j.appliedDiscount.discount-j.couponValue>0&&(0,R.jsxs)("div",{className:Ge.discountContainer,children:[(0,R.jsxs)("div",{style:{display:"block"},children:[(0,R.jsx)("span",{style:{color:"var(--green)"},children:U.GS.includes(null===P||void 0===P?void 0:P.id)&&"bulk"!==(null===K||void 0===K?void 0:K.type)?"code MOUNT applied":"Promotion Applied"}),se.isActive&&(0,R.jsx)("p",{children:null===se||void 0===se?void 0:se.name})]}),(0,R.jsxs)("span",{style:{color:"var(--green)"},children:["- ",(0,R.jsx)(H.A,{amount:(j.appliedDiscount.discount-j.couponValue)*k})]})]}),E&&ve.length>0&&ve.map(e=>{let{name:o,discount:l}=e;return(0,R.jsxs)("div",{className:Ge.discountContainer,children:[(0,R.jsxs)("span",{style:{color:"var(--green)"},children:[o," Applied"]}),(0,R.jsxs)("span",{style:{color:"var(--green)"},children:["- ",(0,R.jsx)(H.A,{amount:Number(l*k)})]})]},o)}),E&&0===ve.length&&b.appliedDiscount.discount-b.couponValue>0&&(0,R.jsxs)("div",{className:Ge.discountContainer,children:[(0,R.jsxs)("div",{style:{display:"block"},children:[(0,R.jsx)("span",{style:{color:"var(--green)"},children:U.GS.includes(null===P||void 0===P?void 0:P.id)?"code MOUNT applied":"Promotion Applied"}),se.isActive&&(0,R.jsx)("p",{children:null===se||void 0===se?void 0:se.name})]}),(0,R.jsxs)("span",{style:{color:"var(--green)"},children:["- ",(0,R.jsx)(H.A,{amount:Number((b.appliedDiscount.discount-b.couponValue)*k)})]})]}),j.couponValue>0&&(0,R.jsxs)("div",{className:Ge.discountContainer,children:[(0,R.jsxs)("span",{style:{color:"var(--green)"},children:["`","".concat(T),"` Applied"]}),(0,R.jsxs)("span",{style:{color:"var(--green)"},children:["- ",(0,R.jsx)(H.A,{amount:Number(j.couponValue*k)})]})]}),b.couponValue>0&&(0,R.jsxs)("div",{className:Ge.discountContainer,children:[(0,R.jsxs)("span",{style:{color:"var(--green)"},children:["`","".concat(T),"` Applied"]}),(0,R.jsxs)("span",{style:{color:"var(--green)"},children:["- ",(0,R.jsx)(H.A,{amount:Number(b.couponValue*k)})]})]}),A&&ge>0&&(0,R.jsxs)("div",{className:Ge.discountContainer,children:[(0,R.jsxs)("span",{style:{color:"var(--green)",display:"flex",alignItems:"center",gap:"6px"},children:[(0,R.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("rect",{x:"3",y:"8",width:"18",height:"12",rx:"2",ry:"2"}),(0,R.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"20"}),(0,R.jsx)("path",{d:"M19 8c-1.5-1.5-3.5-1.5-5-1.5s-2.5 1-2 2.5h7z"}),(0,R.jsx)("path",{d:"M5 8c1.5-1.5 3.5-1.5 5-1.5s2.5 1 2 2.5H5z"})]}),"Gift Card (****",null===(c=N.cardNumber)||void 0===c?void 0:c.slice(-4),")"]}),(0,R.jsx)("span",{style:{color:"var(--green)"},children:(0,R.jsx)(H.A,{amount:ge})})]})]}),(0,R.jsxs)("div",{style:{borderBottom:"1px dashed #D7D2D2",display:"flex",flexDirection:"column"},className:Ge.priceTaxBox,children:[(0,R.jsxs)("div",{className:Ge.amountBox,children:[(0,R.jsx)("span",{children:"Price"}),(0,R.jsx)("span",{children:(0,R.jsx)(H.A,{amount:Number(fe(E&&!B?null===(u=(Number(b.totalRoomCost)+Number(b.appliedDiscount.discount))
1*k+Number(null!==(m=null===b||void 0===b?void 0:b.totalAddonCost)&&void 0!==m?m:0))||void 0===u?void 0:u.toFixed(2):null===(p=(j.roomPriceNoDisc+j.totalFoodPrice+(null!==P&&void 0!==P&&P.isTaxIncluded?j.totalTax:0))*k+Number(null!==(h=null===b||void 0===b?void 0:b.totalAddonCost)&&void 0!==h?h:0))||void 0===p?void 0:p.toFixed(2)))})})]}),b.rpTax>0&&(0,R.jsxs)("div",{className:Ge.amountBox,children:[(0,R.jsx)("span",{children:(0,ze.t)("taxes")}),(0,R.jsx)("span",{children:(0,R.jsx)(H.A,{amount:Number(b.rpTax)})})]}),Math.abs(j.totalTax)>0&&(0,R.jsxs)("div",{className:Ge.amountBox,children:[(0,R.jsx)("span",{children:(0,ze.t)("taxes")}),(0,R.jsx)("span",{children:(0,R.jsx)(H.A,{amount:Number(Math.abs(j.totalTax))})})]}),null===(g=b.taxObj)||void 0===g||null===(_=g.taxes)||void 0===_?void 0:_.map((e,o)=>(null===e||void 0===e?void 0:e.totalTax)>0&&"booking"===(null===e||void 0===e?void 0:e.level)&&(0,R.jsxs)("div",{className:Ge.amountBox,children:[(0,R.jsx)("span",{children:null===e||void 0===e?void 0:e.name}),(0,R.jsx)("span",{children:(0,R.jsx)(H.A,{amount:Number(null===e||void 0===e?void 0:e.totalTax)})})]},"tax-".concat(o))),null===(x=j.taxObj)||void 0===x||null===(f=x.taxes)||void 0===f?void 0:f.map((e,o)=>(null===e||void 0===e?void 0:e.totalTax)>0&&"booking"===(null===e||void 0===e?void 0:e.level)&&(0,R.jsxs)("div",{className:Ge.amountBox,children:[(0,R.jsx)("span",{children:null===e||void 0===e?void 0:e.name}),(0,R.jsxs)("span",{children:["+ ",(0,R.jsx)(H.A,{amount:Number((null===e||void 0===e?void 0:e.totalTax)*k)})]})]},"old-tax-".concat(o)))]}),(0,R.jsx)("div",{className:Ge.totalAmountBox,children:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("span",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"20px"},children:[(0,ze.t)("final_price")," "]}),(0,R.jsx)(H.A,{amount:Number(_e)})]})}),q&&J&&J!==q&&(0,R.jsxs)("p",{style:{fontSize:"11px",color:"#888",margin:"6px 0 0",textAlign:"right"},children:["* Payment will be in ",q," (",(0,G.Gl)(q),")"]})]}),(null===te||void 0===te?void 0:te.length)>1&&(null===pe||void 0===pe?void 0:pe.lowestPrice)&&(0,R.jsx)("div",{className:Ge.lowestPriceBox,children:(0,R.jsxs)("div",{className:Ge.lowestPriceGuranteeBox,onMouseEnter:()=>{ie(!0),(0,L.fireGtmEvent)("checkout_lowest_price_viewed",{lowestPrices:te})},onMouseLeave:()=>ie(!1),children:[(0,R.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/lowest_price.svg",alt:"lowest_price_gurantee"}),(0,R.jsx)("span",{children:"Lowest Price Guarantee"}),ne&&(0,R.jsxs)("div",{className:Ge.lowestPriceItems,children:[(0,R.jsx)("div",{className:Ge.lowestPriceOtaBox,children:null===te||void 0===te||null===(y=te.filter(e=>"hotelzify.com"!==(null===e||void 0===e?void 0:e.name)&&"www.hotelzify.com"!==(null===e||void 0===e?void 0:e.name)))||void 0===y?void 0:y.map(e=>(0,R.jsxs)("div",{className:Ge.otaPriceBox,children:[(0,R.jsx)("p",{children:null===e||void 0===e?void 0:e.name}),(0,R.jsx)("span",{children:(0,R.jsx)(H.A,{amount:null===e||void 0===e?void 0:e.value})})]}))}),(0,R.jsxs)("div",{className:Ge.lowestPriceOfficial,children:[(0,R.jsxs)("div",{className:Ge.lowestPriceOfficialNameBox,children:[(0,R.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/official_blue_logo.svg",alt:"lowest_price"}),(0,R.jsx)("p",{children:"Official Website"})]}),(0,R.jsx)("span",{children:(0,R.jsx)(H.A,{amount:null===pe||void 0===pe?void 0:pe.lowestPrice})})]}),(null===pe||void 0===pe?void 0:pe.adultCount)&&(0,R.jsxs)("p",{style:{padding:"2px",color:"gray",fontSize:"12px",display:"flex",gap:"2px",justifyContent:"space-between",whiteSpace:"normal",wordBreak:"break-word"},children:["Price for ",null===pe||void 0===pe?void 0:pe.adultCount," ",(null===pe||void 0===pe?void 0:pe.adultCount)>1?"adults":"adult"," for room:"," ",null===pe||void 0===pe?void 0:pe.roomName]}),(0,R.jsx)("p",{style:{padding:"2px",color:"gray",fontSize:"12px",display:"flex",gap:"2px",justifyContent:"space-between"},children:(0,R.jsx)("span",{style:{textDecoration:"none"},children:(()=>{const e=a()(),o=a()(ce);return e.diff(o,"days")>2?"Last updated : Yesterday":"Last updated : ".concat(o.format("DD MMM YYYY"))})()})})]})]})}),(0,R.jsxs)("div",{className:Ge.promoContainer,children:[(0,R.jsx)("p",{className:Ge.promoTitle,children:"Have a promo code?"}),(0,R.jsx)(de,{totalPrice:_e})]}),Z&&Q?(0,R.jsxs)("div",{className:Ge.promoContainer,children:[(0,R.jsx)("p",{className:Ge.promoTitle,style:{lineHeight:0},children:(0,R.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/Maharaja Club_AI_RGB_Positive.svg",alt:"Maharaja Club",style:{height:"65px",width:"auto"}})}),(0,R.jsx)(qe,{totalPrice:xe,hotelId:null===P||void 0===P?void 0:P.id})]}):null]})}),(null===$||void 0===$?void 0:$.isOpen)&&(0,R.jsx)(ao,{closeModal:()=>ee({isOpen:!1,data:null}),priceCalculator:b,oldPriceCalculator:j}),(null===oe||void 0===oe?void 0:oe.isOpen)&&(0,R.jsx)(Oo,{closeModal:()=>le({isOpen:!1,data:null}),priceCalculator:b,oldPriceCalculator:j})]})};var zo=l(575);const Go="Addons_addonBox__vSTXq",Ho="Addons_addonHeaderContainer__JxPfz",Lo="Addons_headerRight__eJdA3",Wo="Addons_externalNavigation__2bV
1Iq",Vo="Addons_externalNavButton__dt+NK",qo="Addons_carouselContainer__tOs+s",Uo="Addons_cardWrapper__J9fui",Jo="Addons_addonRowBox__h14zn",Ko=e=>{let{HotelAddons:o=[]}=e;const l=(0,d.useRef)(null);if((0,d.useEffect)(()=>{(null===o||void 0===o?void 0:o.length)>0&&(0,L.fireGtmEvent)("addon_section_viewed",{addon_count:o.length,addon_names:o.map(e=>(null===e||void 0===e?void 0:e.name)||(null===e||void 0===e?void 0:e.title)||"").filter(Boolean)})},[o]),null===o||void 0===o||!o.length)return null;return(0,R.jsxs)("div",{className:Go,children:[(0,R.jsxs)("div",{className:Ho,children:[(0,R.jsx)("h2",{children:"Add-Ons"}),(0,R.jsxs)("div",{className:Lo,children:[(0,R.jsx)("p",{children:"*Prices include all taxes"}),(null===o||void 0===o?void 0:o.length)>3&&(0,R.jsx)("div",{className:Wo,children:(0,R.jsx)("button",{onClick:()=>{l.current&&l.current.scrollNext(),(0,L.fireGtmEvent)("addons_moved_right")},className:Vo,"aria-label":"Next slides",children:(0,R.jsx)(xe.A,{size:20})})})]})]}),(0,R.jsx)("div",{className:qo,children:(null===o||void 0===o?void 0:o.length)>0?(0,R.jsx)(fe,{ref:l,slidesToShow:3,spacing:11,loop:!0,showArrows:!1,navPosition:"outside",navStyle:"rounded",smallScreenSlidesToShow:2,mediumScreenSlidesToShow:3,smallScreenSpacing:20,children:null===o||void 0===o?void 0:o.map((e,o)=>(0,R.jsx)("div",{className:Uo,children:(0,R.jsx)(Be,{addon:e})},o))}):(0,R.jsx)(R.Fragment,{children:(0,R.jsx)("div",{className:Jo,children:null===o||void 0===o?void 0:o.map((e,o)=>(0,R.jsx)("div",{className:Uo,children:(0,R.jsx)(Be,{addon:e})},o))})})})]})};var Xo=l(9265);const Qo="CustomMessageDisplay_container__5BTDS",Zo="CustomMessageDisplay_wrapper__NSoQ6",$o="CustomMessageDisplay_globalHeader__ztC1v",el="CustomMessageDisplay_heading__qka96",ol="CustomMessageDisplay_subheading__EGUoV",ll="CustomMessageDisplay_messageCard__rrcGV",nl="CustomMessageDisplay_firstCard__60MeU",il="CustomMessageDisplay_cardContent__G3GOW",tl="CustomMessageDisplay_leftSection__8zS5g",al="CustomMessageDisplay_badge__20oxC",dl="CustomMessageDisplay_title__-o3MM",sl="CustomMessageDisplay_description__Lthw0",rl="CustomMessageDisplay_knowMore__6db-s",cl="CustomMessageDisplay_rightSection__t8BWf",ul="CustomMessageDisplay_priceGroup__Cida5",vl="CustomMessageDisplay_price__AjS7S",ml="CustomMessageDisplay_priceSubtext__p8dIv",pl="CustomMessageDisplay_taxInfo__3Y612",hl="CustomMessageDisplay_expandedContent__Ej7rv",gl="CustomMessageDisplay_fullContent__3tZuX",_l="CustomMessageDisplay_details__j-c9l",xl="CustomMessageDisplay_detailItem__5oDDW",fl="CustomMessageDisplay_detailLabel__M2qVN",yl="CustomMessageDisplay_detailValue__T0cGK",bl=e=>{let{messages:o,childCount:l}=e;const[n,t]=(0,d.useState)({}),a=(0,v.d4)(e=>e.hotelInfo);if(!o||0===o.length)return null;const s=o;if(0===s.length)return null;return(0,R.jsx)("div",{className:Qo,children:(0,R.jsxs)("div",{className:Zo,children:[(0,R.jsxs)("div",{className:$o,children:[(0,R.jsx)("h3",{className:el,children:"Important information"}),(0,R.jsx)("p",{className:ol,children:"Extra charges to be paid directly at the hotel"})]}),s.map((e,o)=>{var d,s,r,c,u,v,m,p,h,g,_,x,f,y,b,j,k,C,A,N,P,I,S,w,D,M,B,E,T;const O=(e=>{if(!e)return null;if(e.price_amount&&e.price_amount>0)return e.price_amount;const o=e.price_per_adult||0,l=e.price_per_child||0;return o>0?o:l})(e.config),Y=n[e.id];return(0,R.jsxs)("div",{className:"".concat(ll," ").concat(0===o?nl:""),children:[(0,R.jsxs)("div",{className:il,children:[(0,R.jsxs)("div",{className:tl,children:[(0,R.jsx)("span",{className:al,children:"mandatory"===e.type?"MANDATORY CHARGES":"OPTIONAL"}),(0,R.jsx)("h4",{className:dl,children:e.title}),(null===(d=e.config)||void 0===d?void 0:d.content)&&(0,R.jsxs)("div",{className:sl,children:[(null===(s=e.config)||void 0===s?void 0:s.price_applicable_for)&&(0,R.jsx)("span",{children:"Charges for "}),(0,R.jsx)("span",{children:(null===(r=e.config)||void 0===r?void 0:r.occasion)||(null===(c=e.config)||void 0===c?void 0:c.meal_service_type)||"special service"}),(0,R.jsx)("button",{className:rl,onClick:()=>((e,o)=>{const l=!n[e];(0,L.fireGtmEvent)("custom_message_toggle",{action:l?"expand":"collapse",message_id:e,message_title:o}),t(o=>(0,i.A)((0,i.A)({},o),{},{[e]:!o[e]}))})(e.id,e.title),children:Y?"Show less":"Know more"})]})]}),O>0&&(0,R.jsxs)("div",{className:cl,children:[null!==(u=e.config)&&void 0!==u&&null!==(v=u.price_applicable_for)&&void 0!==v&&v.includes("person")&&(null===(m=e.config)||void 0===m?void 0:m.price_per_adult)>0&&(null===(p=e.config)||void 0===p?void 0:p.price_per_child)>0?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:ul,children:[(0,R.jsxs)("div",{className:vl,children:[(0,G.Gl)(null!==(h=null===a||void 0===a||null===(g=a.hotelData)||void 0===g?void 0:g.currency)&&void 0!==h?h:"INR")," ",e.config.price_per_adult]}),(0,R.jsx)("div",{className:ml,children:"Per adult"})]}),l>0&&(0,R.jsxs)("div",{className:ul,children:[(0,R.jsxs)("div",{className:vl,children:[(0,G.Gl)(null!==(_=null===a||void 0===a||null===(x=a.hotelData)||void 0===x?void 0:x.currency)&&void 0!==_?_:"INR")," ",e.config.price_per_child]}),(0,R.jsx)("div",{className:ml,children:"Per child"})]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:vl,children:[" ",(0,G.Gl)(null!==(f=null===a||void 0===a||null===(y=a.hotelData)||void 0===y?void 0:y.currency)&&void 0!==f?f:"INR")," ",O]}),(0,R.jsx)("div",{className:ml,children:null!==(b=e.config)&&void 0!==b&&b.price_applicable_for?"".concat(e.config.price_applicable_for.replace("per_","Per ").replace("_"," ")):"Per person"})]}),void 0!==(null===(j=e.config)||void 0===j?void 0:j.is_tax_inclusive)&&(0,R.jsx)("div",{className:pl,children:e.config.is_tax_inclusive?"Tax inclusive":"Tax exclusive"})]})]}),Y&&(0,R.jsxs)("div",{className:hl,children:[(0,R.jsx)("p",{className:gl,style:{whiteSpace:"pre-line"},children:null===(k=e.config)||void 0===k?void 0:k.content}),((null===(C=e.config)||void 0===C?void 0:C.occasion)||(null===(A=e.config)||void 0===A?void 0:A.meal_service_type)||(null===(N=e.config)||void 0===N||null===(P=N.cuisine_options)||void 0===P?void 0:P.length)>0||(null===(I=e.config)||void 0===I?void 0:I.drinks_served))&&(0,R.jsxs)("div",{className:_l,children:[(null===(S=e.config)||void 0===S?void 0:S.occasion)&&(0,R.jsxs)("div",{className:xl,children:[(0,R.jsx)("span",{className:fl,children:"Occasion:"}),(0,R.jsx)("span",{className:yl,children:e.config.occasion})]}),(null===(w=e.config)||void 0===w?void 0:w.meal_service_type)&&(0,R.jsxs)("div",{className:xl,children:[(0,R.jsx)("span",{className:fl,children:"Service Type:"}),(0,R.jsx)("span",{className:yl,children:e.config.meal_service_type})]}),(null===(D=e.config)||void 0===D?void 0:D.cuisine_options)&&e.config.cuisine_options.length>0&&(0,R.jsxs)("div",{className:xl,children:[(0,R.jsx)("span",{className:fl,children:"Cuisine:"}),(0,R.jsx)("span",{className:yl,children:e.config.cuisine_options.join(", ")})]}),(null===(M=e.config)||void 0===M?void 0:M.drinks_served)&&(0,R.jsxs)("div",{className:xl,children:[(0,R.jsx)("span",{className:fl,children:"Drinks:"}),(0,R.jsx)("span",{className:yl,children:"alcoholic"===e.config.drinks_served?"Alcoholic":"non_alcoholic"===e.config.drinks_served?"N
1on-Alcoholic":"Alcoholic and Non-Alcoholic"})]}),(null===(B=e.config)||void 0===B?void 0:B.price_per_child)>0&&(null===(E=e.config)||void 0===E?void 0:E.price_per_adult)>0&&(0,R.jsxs)("div",{className:xl,children:[(0,R.jsx)("span",{className:fl,children:"Child Price:"}),(0,R.jsx)("span",{className:yl,children:e.config.price_per_child})]}),(null===(T=e.config)||void 0===T?void 0:T.price_applicable_for)&&"string"===typeof e.config.price_applicable_for&&(0,R.jsxs)("div",{className:xl,children:[(0,R.jsx)("span",{className:fl,children:"Pricing:"}),(0,R.jsx)("span",{className:yl,children:e.config.price_applicable_for.replace("per_","").replace("_"," ")})]})]})]})]},e.id)})]})})};var jl=l(7070),kl=l(3025),Cl=l(6804),Al=l(896);const Nl=["bookingAnalytics","name","email","gender","dialCode","mobile"],Pl="https://ik.imagekit.io/hotelzifyprod/assets/svg/Gift.svg",Il="https://ik.imagekit.io/hotelzifyprod/assets/images/ppimg.svg",Sl="https://ik.imagekit.io/hotelzifyprod/assets/images/tickselect.svg";a().extend(ve());const wl=(0,m.withRouter)(e=>{var o,l,t,p,_,x,f,y,b,j,k,C,A,N,P,I;const S=(0,v.wA)(),{hotelData:w,selectedRooms:D,selectedRatePlans:M,fetching:Z,selectedAddons:$,totalPeople:oe,dateRange:le,dateCount:ne,selectedHotelAddons:ie,policies:te,totalAdult:ae,totalChild:de,isHourlyRoom:ue,isRatePlans:ve,hourlyTime:me,hourlyDate:pe,hourlyHour:he,roomSlots:ge,couponName:_e,paymentProvider:xe,bnplConfig:fe,couponCode:ye,bookingEngineConfig:be,isReturningMember:je,selectedPaymentOffer:ke,maharajaId:Ce,gstin:Ae,promotions:Ne}=(0,v.d4)(e=>e.hotelInfo),{id:Pe,HotelAddons:Ie}=w,Se=[1,76].includes(null===w||void 0===w?void 0:w.chainId),we=Y.A.get("utmObj")||{},De="maharajaclub"===(null===we||void 0===we?void 0:we.utmSource)||"maharaja"===(null===we||void 0===we?void 0:we.utmSource),Me=1===(null===w||void 0===w?void 0:w.chainId)&&De,{width:Re}=(0,q.A)(),Be=(0,m.useHistory)(),Ee=(0,X.A)(),Te=(0,K.Ay)(),ze=Te.selectedRooms.map(e=>(0,i.A)((0,i.A)({},e),null===e||void 0===e?void 0:e.room)),Ge=(0,d.useRef)(),He=(0,d.useRef)(),Le=(0,d.useRef)(null);Le.current||(Le.current=function(){let e,o,l=!1;return{run(n){let{background:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i?l?Promise.resolve():e||(e=Promise.resolve().then(n).finally(()=>{e=void 0}),e):(l=!0,o||(o=Promise.resolve(e).catch(()=>{}).then(n).finally(()=>{o=void 0}),o))}}}());console.log("test");let We=Y.A.get("subscribed")||!1,Ve=1,qe=!0;Y.A.get("source");Ve=1;We=!1,qe=!1;const[Ue,Je]=(0,d.useState)(),[Ke,Xe]=(0,d.useState)(),[Qe,Ze]=(0,d.useState)(),[$e,eo]=(0,d.useState)(""),[oo,lo]=(0,d.useState)("Male"),[no,io]=(0,d.useState)(""),[to,ao]=(0,d.useState)(""),[so,ro]=(0,d.useState)([]),[co,uo]=(0,d.useState)(""),[vo,mo]=(0,d.useState)(""),[po,ho]=(0,d.useState)(""),[go,_o]=(0,d.useState)(),[xo,fo]=(0,d.useState)(),[yo,bo]=(0,d.useState)(),[jo,ko]=(0,d.useState)(),[Co,Ao]=(0,d.useState)(null),[No,Po]=(0,d.useState)(!1),[Io,So]=(0,d.useState)(),[wo,Do]=(0,d.useState)(!1),[Mo,Ro]=(0,d.useState)(0),[Bo,Eo]=(0,d.useState)(!1),[To,Oo]=(0,d.useState)(!1),[Yo,Go]=(0,d.useState)(""),[Ho,Lo]=(0,d.useState)(),[Wo,Vo]=(0,d.useState)(!1),[qo,Uo]=(0,d.useState)(!1),[Jo,Qo]=(0,d.useState)(!1),[Zo,$o]=(0,d.useState)(!1),[el,ol]=(0,d.useState)(),[ll,nl]=(0,d.useState)("12:00 PM"),[il,tl]=(0,d.useState)(!1),al=(0,u.N)(null===w||void 0===w?void 0:w.country),[dl,sl]=(0,d.useState)(!1),[rl,cl]=(0,d.useState)(),[ul,vl]=(0,d.useState)(!1),[ml,pl]=(0,d.useState)(!1),[hl,gl]=(0,d.useState)(!1),[_l,xl]=(0,d.useState)(!1),[fl,yl]=(0,d.useState)(!1),[wl,Dl]=(0,d.useState)(!1),[Ml,Rl]=(0,d.useState)(!1),[Bl,El]=(0,d.useState)({}),[Tl,Ol]=(0,d.useState)(!1),[Yl]=(0,d.useState)(null),[Fl,zl]=(0,d.useState)(!1),[Gl,Hl]=(0,d.useState)("rzp_live_1V5wz8nlIYcRkn"),[Ll,Wl]=(0,d.useState)(),[Vl,ql]=(0,d.useState)(),[Ul,Jl]=(0,d.useState)(""),[Kl,Xl]=(0,d.useState)(!1),[Ql,Zl]=(0,d.useState)({}),[$l,en]=(0,d.useState)(!1),[on,ln]=(0,d.useState)(!1),[nn,tn]=(0,d.useState)(!1),[an,dn]=(0,d.useState)({}),[sn,rn]=(0,d.useState)(!0),[cn,un]=(0,d.useState)(!1),[vn,mn]=(0,d.useState)([]),[pn,hn]=(0,d.useState)(1),[gn,_n]=(0,d.useState)({cardNumber:"",amount:""}),[xn,fn]=(0,d.useState)(""),[yn,bn]=(0,d.useState)(!1),[jn,kn]=(0,d.useState)(""),[Cn,An]=(0,d.useState)(!1),[Nn,Pn]=(0,d.useState)(""),[In,Sn]=(0,d.useState)(null),[wn,Dn]=(0,d.useState)(!1),[Mn,Rn]=(0,d.useState)(!1),[Bn,En]=(0,d.useState)(""),[Tn,On]=(0,d.useState)(!1),Yn=Y.A.get("testId")||0,{t:Fn,i18n:zn}=(0,g.Bd)();let Gn=(0,d.useRef)();const Hn=(0,d.useRef)(),Ln=(0,d.useRef)(),Wn=(0,d.useRef)(),Vn=((0,d.useRef)(),(0,d.useRef)(),(0,d.useRef)(),(0,d.useRef)(),(0,d.useRef)(null));let qn=Y.A.get("discount");const Un=Y.A.get("promo")||{};let Jn=0;"late"!==(null===Un||void 0===Un?void 0:Un.type)&&"early"!==(null===Un||void 0===Un?void 0:Un.type)||(Jn=Y.A.get("discountedValue"),qn=Ke-Jn);const Kn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const o=document.getElementById("rzp");o&&o.remove();const l=document.createElement("script");
1l.src="https://checkout.razorpay.com/v1/checkout.js",l.async=!0,l.id="rzp",l.onerror=o=>{const l=e+1;if(console.error("Razorpay script load failed (attempt ".concat(l,"/").concat(4,")"),o),(0,V.FA)("payment_script_load_retry",{attempt:l,maxAttempts:4,gateway:"razorpay",bookingId:Y.A.get("bookingId"),errorMessage:(null===o||void 0===o?void 0:o.message)||String(o),errorType:null===o||void 0===o?void 0:o.type},e<3?"high":"critical"),e<3)setTimeout(()=>Kn(e+1),2e3);else{const e=Y.A.get("bookingId"),o=Y.A.get("bookingObj")||{};(0,V.Zo)(e,null===o||void 0===o?void 0:o.totalAmount),h().error("Payment system failed to load. Please refresh the page."),(0,L.fireGtmEvent)("razorpay_script_load_failed",{bookingId:e,amount:null===o||void 0===o?void 0:o.totalAmount}),Dl(!1)}},document.body.appendChild(l)},Xn=e=>{ho(e),"Razorpay"!==e&&"PartialPayment"!==e&&S({type:T.A.SET_PAYMENT_METHOD_OFFER,payload:null}),(0,L.fireGtmEvent)("checkout_payment_selected",{selectedPaymentOption:e});const o=ve&&!ue?Te.selectedRooms:Ee.roomObjects||D;if(o&&o.length>0){const l=o.map(e=>"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||Pe)),n=o.map(e=>({id:"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||Pe),quantity:1})),i=ve&&!ue?Te.appliedDiscount.discount>0?Te.priceAfterDiscount:Te.rpPrice:Ee.totalPrice,t={content_ids:l,content_type:"hotel_room",value:parseFloat(i),currency:(null===w||void 0===w?void 0:w.currency)||"INR",contents:n,num_items:o.length,checkin_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),checkout_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD"),payment_method:e};(0,L.newFBEvents)("AddPaymentInfo",t)}},Qn="PartialPayment"===po?Ke*((null===jo||void 0===jo||null===(o=jo.config)||void 0===o?void 0:o.minPercentage)||100)/100:Ke||0,Zn=Mn&&parseFloat(gn.amount||0)>=Math.round(Qn),$n=Mn?parseFloat(gn.amount||0):0;(0,d.useEffect)(()=>{const e=document.createElement("script");return e.src="https://cdn.paidyet.com/paynowv3.js",e.async=!0,e.onload=()=>yl(!0),document.body.appendChild(e),()=>document.body.removeChild(e)},[]),(0,d.useEffect)(()=>{null!==w&&void 0!==w&&w.chainId&&(0,U.T3)(w.chainId)},[null===w||void 0===w?void 0:w.chainId]),(0,d.useEffect)(()=>{window.scrollTo({top:0,behavior:"instant"})},[]),(0,d.useEffect)(()=>{S((0,E.X$)(Pe))},[]);const ei=(0,d.useRef)(!1);(0,d.useEffect)(()=>{ei.current||"true"===sessionStorage.getItem("isMembershipUnlocked")&&Pe&&null!==le&&void 0!==le&&le.startDate&&null!==le&&void 0!==le&&le.endDate&&(null!==Ne&&void 0!==Ne&&Ne.some(K.UT)?ei.current=!0:(ei.current=!0,S((0,E.PR)((0,U.CE)({hotelId:Pe,startDate:le.startDate,endDate:le.endDate}),Pe))))},[Pe,null===le||void 0===le?void 0:le.startDate,null===le||void 0===le?void 0:le.endDate,Ne,S]);const oi=async e=>{if(!e)return rn(!1),{ok:!1,data:null};rn(!0),un(!1);try{var o,l,n;const i=await(0,O.yD)({hotelId:e});return(0,L.fireGtmEvent)("cod_payment_provider_check",{hotelId:e,responseStatus:null===i||void 0===i?void 0:i.status,vendor:null===i||void 0===i||null===(o=i.data)||void 0===o?void 0:o.vendor,superVendor:null===i||void 0===i||null===(l=i.data)||void 0===l?void 0:l.superVendor,isPciEnabled:"pcibooking"===(null===i||void 0===i||null===(n=i.data)||void 0===n?void 0:n.vendor),success:200===(null===i||void 0===i?void 0:i.status)}),200===(null===i||void 0===i?void 0:i.status)?(console.log("COD Payment Provider:",null===i||void 0===i?void 0:i.data),dn(null===i||void 0===i?void 0:i.data),rn(!1),{ok:!0,data:null===i||void 0===i?void 0:i.data}):(un(!0),rn(!1),{ok:!1,data:null})}catch(i){return(0,L.fireGtmEvent)("cod_payment_provider_error",{hotelId:e,error:null===i||void 0===i?void 0:i.message,errorCode:null===i||void 0===i?void 0:i.code}),un(!0),rn(!1),{ok:!1,data:null}}};(0,d.useEffect)(()=>{oi(Pe)},[Pe]),(0,d.useEffect)(()=>{let e=0,o=0;null===D||void 0===D||D.forEach(l=>{e+=null===l||void 0===l?void 0:l.sAdult,o+=(null===l||void 0===l?void 0:l.sChild)+(null===l||void 0===l?void 0:l.sInfant)}),Wl(e),ql(o)},[D]);const{checkoutAdultCount:li,checkoutChildCount:ni}=(0,d.useMemo)(()=>{const{adultCount:e,childrenCount:o}=(0,s.VF)({selectedRooms:D,selectedRatePlans:M,totalAdult:ae,totalChild:de});return{checkoutAdultCount:e,checkoutChildCount:o}},[D,M,ae,de]);(0,d.useEffect)(()=>{ve&&!ue&&(Wl(Te.adultCount),ql(Te.childCount+Te.infantCount))},[ve,ue,Te]),(0,d.useEffect)(()=>
1{xe&&"razorpay"===(null===xe||void 0===xe?void 0:xe.vendor)&&Hl(null===xe||void 0===xe?void 0:xe.vendorKey)},[xe]),(0,d.useEffect)(()=>{(async()=>{if(Pe&&null!==le&&void 0!==le&&le.startDate)try{const e=a()(le.startDate).format("YYYY-MM-DD"),o=await(0,O.iR)({hotelId:Pe,checkInDate:e});console.log("Custom Messages:",o),mn((null===o||void 0===o?void 0:o.data)||[])}catch(e){console.error("Failed to fetch custom messages:",e),mn([])}})()},[Pe,le]),(0,d.useEffect)(()=>{null!==go&&void 0!==go&&go.some(e=>{var o;return["Razorpay","PartialPayment"].includes(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)})&&Qo(!0),$o(null===go||void 0===go?void 0:go.some(e=>{var o;return["Razorpay","PartialPayment"].includes(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)}))},[go]),(0,d.useEffect)(()=>{Y.A.get("isBooked")&&window.history.back()},[]),(0,d.useEffect)(()=>{const e=setTimeout(()=>{(async()=>{try{var e;const o=null===Ql||void 0===Ql||null===(e=Ql.couponCodes)||void 0===e?void 0:e[0];if(null===Ql||void 0===Ql||!Ql.id||!o)return;const l={hotelId:null===w||void 0===w?void 0:w.id,couponCode:o,checkInDate:a()(null===le||void 0===le?void 0:le.startDate).format("DD/MM/YYYY"),checkOutDate:a()(null===le||void 0===le?void 0:le.endDate).format("DD/MM/YYYY"),isRetargeting:!0,adultCount:ae,childrenCount:de,bookingAmount:Te.rpPrice},n=await(0,O.uB)(l);200===(null===n||void 0===n?void 0:n.status)&&(S({type:T.A.SET_RETARGETING,payload:!0}),S({type:T.A.SET_COUPON_CODE,payload:null===n||void 0===n?void 0:n.data}),tn(!0),(0,L.fireGtmEvent)("retargeting_promotion_applied",{couponCode:o,retargetingDiscount:Ql}))}catch(o){console.error("Error applying retargeting promotions:",o)}})()},6e5);return()=>clearTimeout(e)},[Ql]),(0,d.useEffect)(()=>{const e=Y.A.get("utmObj");if("verification"===(null===e||void 0===e?void 0:e.googleSource)){var o;const e=JSON.parse(null!==(o=localStorage.getItem("bookingState"))&&void 0!==o?o:"null");S({type:T.A.SET_FULL_STATE,payload:e})}},[]),(0,d.useEffect)(()=>{var e,o;let l=D,n=M,i=Pe;const t=Y.A.get("utmObj");if("verification"===(null===t||void 0===t?void 0:t.googleSource)){var a,d;const e=JSON.parse(null!==(a=localStorage.getItem("bookingState"))&&void 0!==a?a:"null");l=(null===e||void 0===e?void 0:e.selectedRooms)||[],n=(null===e||void 0===e?void 0:e.selectedRatePlans)||[],i=(null===e||void 0===e||null===(d=e.hotelData)||void 0===d?void 0:d.id)||Pe}(0===(null===(e=l)||void 0===e?void 0:e.length)&&0===(null===(o=n)||void 0===o?void 0:o.length)||!i)&&(h().error("Please select atleast 1 room"),(0,L.fireGtmEvent)("checkout_no_rooms_selected",{selectedRooms:l,selectedRatePlans:n,hotelId:i}),Be.goBack())},[]),(0,d.useEffect)(()=>{(0,L.fireGtmEvent)("checkout_page_opened"),(0,L.trackCheckoutFunnel)("checkout_started"),Wn.current&&Wn.current.focus(),Y.A.remove("bookingId")},[]);const ii=(0,d.useRef)(!1);(0,d.useEffect)(()=>{if(ii.current)return;if(!(Ke>0))return;ii.current=!0;const e=ue?pe:null===le||void 0===le?void 0:le.startDate,o=ue?pe:null===le||void 0===le?void 0:le.endDate,l=ve?M.length:D.length;(0,W.$1)({checkInDate:e,checkOutDate:o,hotelId:(null===w||void 0===w?void 0:w.id)||Pe,hotelName:null===w||void 0===w?void 0:w.name,city:null===w||void 0===w?void 0:w.city,state:null===w||void 0===w?void 0:w.state,country:"IN",numberOfRooms:l,numberOfTravelers:oe,price:Ke,currency:(null===w||void 0===w?void 0:w.currency)||"INR"})},[Ke]),(0,d.useEffect)(()=>{const e=localStorage.getItem("corporateToken"),o=localStorage.getItem("corporateHotelId"),l=localStorage.getItem("corporateAgentId");e&&o&&(Po(!0),(0,O.P$)(l).then(e=>{console.log({response:e}),200===(null===e||void 0===e?void 0:e.status)&&null!==e&&void 0!==e&&e.data&&Ao(e.data)}))},[null===w||void 0===w?void 0:w.id]),(0,d.useEffect)(()=>{null!==w&&void 0!==w&&w.id&&(0,O.Jq)({hotelId:w.id}).then(e=>{var o;On(!(null===e||void 0===e||null===(o=e.data)||void 0===o||!o.enabled))})},[null===w||void 0===w?void 0:w.id]),(0,d.useEffect)(()=>{!async function(){var e,o,l,n;if(!Pe)return;let i=Intl.DateTimeFormat().resolvedOptions().timeZone;i="Etc/Unknown"===i?null:encodeURIComponent(i);const t={hotelId:Pe,timezone:i,vendorCampaignId:we.hotel_campaign,currency:null===w||void 0===w?void 0:w.currency};i||delete t.timezone;const a=localStorage.getItem("corporateToken"),d=localStorage.getItem("corporateAgentId"),s=(null===(e=Y.A.get("utmObj"))||void 0===e?void 0:e.utmSource)||null,r=a&&d?"agent":s?"utm_source":null,c=a&&d?d:s||null,u=(r&&c?await(0,O.Qo)(t,r,c):await(0,O.Zf)(t)).data;_o(u);const v=null===u||void 0===u?void 0:u.find(e=>{var o;return"PartialPayment"===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)});ko(v);const m=null===u||void 0===u?void 0:u.find(e=>{var o;return 4===(null===e||void 0===e?void 0:e.gatewayId)||"BookNowPayLater"===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)});null!==m&&void 0!==m&&null!==(o=m.config)&&void 0!==o&&o.cutoff&&S({type:T.A.BNPL_CONFIG,payload:{cutoff:m.config.cutoff}}),0===(null===u||void 0===u?void 0:u.length)&&Xn("COD"),1===(null===u||void 0===u?void 0:u.length)&&Xn(null===(l=u[0])||void 0===l||null===(n=l.Gateway)||void 0===n?void 0:n.name),(0===(null===u||void 0===u?void 0:u.length)||1===(null===u||void 0===u?void 0:u.length)&&null!==u&&void 0!==u&&u.some(e=>{var o;return"COD"===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.name)}))&&zl(!0);const p=Y.A.get("source");
1null!==u&&void 0!==u&&u.some(e=>"PartialPayment"===e.Gateway.name)&&Xn("PartialPayment"),null!==u&&void 0!==u&&u.some(e=>"COD"===e.Gateway.name)&&"g_ads"!==p&&Xn("COD")}()},[Pe,Co,No]),(0,d.useEffect)(()=>{var e;go&&(0,L.fireGtmEvent)("payment_config",{onlinePayment:null===go||void 0===go?void 0:go.some(e=>{var o;return 1===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.id)}),cod:null===go||void 0===go?void 0:go.some(e=>{var o;return 2===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.id)}),partialPayment:null===go||void 0===go?void 0:go.some(e=>{var o;return 3===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.id)}),partialPercentage:(null===jo||void 0===jo||null===(e=jo.config)||void 0===e?void 0:e.minPercentage)||0})},[go]),(0,d.useEffect)(()=>{let e=[...D,...ze],o=new Map;e.forEach(e=>{if(o.has(e.id)){let l=o.get(e.id);l++,o.set(e.id,l)}else o.set(e.id,1)}),fo(o);let l=[...ie],n=new Map;l.forEach(e=>{if(n.has(e.id)){let o=n.get(e.id);o++,n.set(e.id,o)}else n.set(e.id,1)}),bo(n)},[ie]),(0,d.useEffect)(()=>{var e,o,l,n,i;let t;var d,s,r,c;if(null===D||void 0===D||D.forEach(e=>{let o=ae<=(null===e||void 0===e?void 0:e.defaultGuestCount)?ae:null===e||void 0===e?void 0:e.defaultGuestCount;0===Yn?(null===e||void 0===e?void 0:e.sAdult)+(null===e||void 0===e?void 0:e.sChild)+(null===e||void 0===e?void 0:e.sInfant):o}),null===(e=[...new Set(D)])||void 0===e||e.forEach(e=>{null===$||void 0===$||$.forEach(o=>{var l;"person"===(null===o||void 0===o||null===(l=o.Addon)||void 0===l?void 0:l.category)&&(null===e||void 0===e?void 0:e.id)===(null===o||void 0===o?void 0:o.hotelRoomId)&&0})}),1===(null===(o=D[0])||void 0===o||null===(l=o.pricing)||void 0===l?void 0:l.length))t={startDate:null===(d=D[0])||void 0===d||null===(s=d.pricing[0])||void 0===s?void 0:s.date,endDate:a()(null===(r=D[0])||void 0===r||null===(c=r.pricing[0])||void 0===c?void 0:c.date).add(1,"days")};else if((null===(n=D[0])||void 0===n||null===(i=n.pricing)||void 0===i?void 0:i.length)>1){var u,v,m,p,g,_;t={startDate:null===(u=D[0])||void 0===u||null===(v=u.pricing[0])||void 0===v?void 0:v.date,endDate:a()(null===(m=D[0])||void 0===m||null===(p=m.pricing[(null===(g=D[0])||void 0===g||null===(_=g.pricing)||void 0===_?void 0:_.length)-1])||void 0===p?void 0:p.date).add(1,"days")}}else t=Y.A.get("dates")||le;const{startDate:x,endDate:f}=t;null!==x&&null!==f||(h().error("Please select proper dates"),Be.goBack()),Ze(t);let y=0;null===ie||void 0===ie||ie.forEach(e=>{"per_day"===e.Addon.multiplier?y+=parseFloat(e.price)*ne:y+=parseFloat(e.price)}),Ro(y.toFixed(0))},[ie]),(0,d.useEffect)(()=>{if(ve&&!ue){let e=Te.appliedDiscount.discount>0?Te.priceAfterDiscount+Te.rpTax+Te.taxObj.totalBookingTax:Te.rpPrice+Te.rpTax+Te.taxObj.totalBookingTax;Xe(e),Je(Te.rpTotalGuest)}else{let e=Ee.totalPrice+Math.abs(Ee.totalTax);Xe(e),Je(Ee.totalGuests)}},[ve,ue,Ee,Te]),(0,d.useEffect)(()=>{0===(null===ie||void 0===ie?void 0:ie.length)&&(null===Ie||void 0===Ie?void 0:Ie.length)>0&&ol(!0)},[]),(0,d.useEffect)(()=>{if((null===te||void 0===te?void 0:te.length)>0){let n=(null===te||void 0===te?void 0:te.filter(e=>"cancellation_policy"===(null===e||void 0===e?void 0:e.type)))||[];var e,o,l;if((null===n||void 0===n?void 0:n.length)>0)null===(e=n[0])||void 0===e||null===(o=e.HotelPolicies)||void 0===o||o.sort((e,o)=>{var l,n;return(null===o||void 0===o||null===(l=o.variables)||void 0===l?void 0:l.daysBeforeArrival)-(null===e||void 0===e||null===(n=e.variables)||void 0===n?void 0:n.daysBeforeArrival)}),Lo(null===(l=n[0])||void 0===l?void 0:l.HotelPolicies)}},[te]);(0,d.useEffect)(()=>{var e;if(null!==Bl&&void 0!==Bl&&Bl.closed||null!==(e=Gn.current)&&void 0!==e&&e.closed){let e=Y.A.get("bookingId");if(e){Y.A.get("isBooked")?si(Ke,null===w||void 0===w?void 0:w.currency,e,e):(0,O.aO)({id:e}).then(o=>{var l;const n=null===o||void 0===o||null===(l=o.data)||void 0===l?void 0:l[0];["booked","confirmed_by_owner"].includes(null===n||void 0===n?void 0:n.status)&&si((null===n||void 0===n?void 0:n.totalAmount)||Ke,null===w||void 0===w?void 0:w.currency,e,e)}).catch(e=>{console.log("Error checking booking confirmation on window close",e)})}}},[Bl,null===Bl||void 0===Bl?void 0:Bl.closed,Gn,null===(l=Gn.current)||void 0===l?void 0:l.closed]),(0,d.useEffect)(()=>{let e;return Tl&&(e=setInterval(()=>ti(),500)),()=>{clearInterval(e)}},[Tl]);const ti=async()=>{var e;if((null!==Bl&&void 0!==Bl&&Bl.closed||null!==(e=Gn.current)&&void 0!==e&&e.closed)&&Tl){var o,l;Ol(!1),clearInterval(Yl);let e=Y.A.get("bookingId"),n=Intl.DateTimeFormat().resolvedOptions().timeZone;n="Etc/Unknown"===n?null:encodeURIComponent(n);const i={id:e,timezone:n};n||delete i.timezone;const t=await(0,O.aO)(i);let a=Y.A.get("callback")||"";const d=null===t||void 0===t||null===(o=t.data)||void 0===o?void 0:o[0],s=["booked","confirmed_by_owner"].includes(null===d||void 0===d?void 0:d.status);d&&s&&null!==d&&void 0!==d&&null!==(l=d.payments)&&void 0!==l&&l.some(e=>"razorpay"===(null===e||void 0===e?void 0:e.gateway))&&(null===a||void 0===a?void 0:a.length)>2&&"true"!==a&&(si(null===d||void 0===d?void 0:d.totalAmount,null===w||void 0===w?void 0:w.currency,e,e),Y.A.set("callback","true"))}},ai=function(e,o){var l,n,i,t;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const d=null===be||void 0===be||null===(l=be.pages)||void 0===l||null===(n=l.checkout)||void 0===n||null===(i=n.paymentOptions)||void 0===i||null===(t=i.names)||void 0===t?void 0:t[e];if(d&&"object"===typeof d&&!Array.isArray(d)){let e=d[zn.language||"en"]||d.en||o;
1return Object.keys(a).forEach(o=>{e=e.replace(new RegExp("{".concat(o,"}"),"g"),a[o])}),e}return o};(0,d.useEffect)(()=>{if((null===te||void 0===te?void 0:te.length)>0){var e,o,l;let n=(null===te||void 0===te?void 0:te.filter(e=>{var o;return"house_rules"===(null===e||void 0===e?void 0:e.type)&&(null===e||void 0===e||null===(o=e.category)||void 0===o?void 0:o.includes("Flexi CheckIn allowed,"))})[0])||{},i=(null===n||void 0===n||null===(e=n.HotelPolicies)||void 0===e||null===(o=e[0])||void 0===o||null===(l=o.variables)||void 0===l?void 0:l.isAllowed)||!1;tl(i)}},[te]),(0,d.useEffect)(()=>{if(te&&(null===te||void 0===te?void 0:te.length)>0){let o=null===te||void 0===te?void 0:te.filter(e=>"house_rules"===(null===e||void 0===e?void 0:e.type)&&"boolean"===(null===e||void 0===e?void 0:e.uiType));if("USD"===(null===w||void 0===w?void 0:w.currency)||26999===(null===w||void 0===w?void 0:w.id)){var e;const l=26999===(null===w||void 0===w?void 0:w.id)?["Unmarried"]:["Unmarried","Foreigners","Visitors","Local"];o=null===(e=o)||void 0===e?void 0:e.filter(e=>!l.some(o=>{var l;return null===e||void 0===e||null===(l=e.category)||void 0===l?void 0:l.includes(o)}))}cl(o)}},[te]);const di=Y.A.get("source")||"Hotelzify_Fallback",si=(o,l,n,i)=>{Uo(!1);const t=[i,n].filter(Boolean),a=t.some(e=>{try{return!!localStorage.getItem("ga4_purchase_tracked_".concat(e))}catch(o){return!1}}),d=F(i,Y.A.get("bookingResp"));a?e.history.push(d):(t.forEach(e=>{try{localStorage.setItem("ga4_purchase_tracked_".concat(e),"1")}catch(o){console.error("Error setting purchase tracked key in localStorage",o)}}),function(e){let{track:o,navigate:l}=e,n=!1;const i=()=>{n||(n=!0,l())};try{o(i)}catch(t){console.warn("Purchase tracking failed after booking completion")}finally{i()}}({track:e=>ri(o,l,n,i,e),navigate:()=>e.history.push(d)}))},ri=(e,o,l,n,i)=>{var t,d,s,r,u,v,m;window.dataLayer=window.dataLayer||[];let p,h=0;ve&&!ue?(p=Te.selectedRooms,p.forEach(e=>{var o;null===e||void 0===e||null===(o=e.onedayObj)||void 0===o||o.forEach(e=>{h+=parseFloat((null===e||void 0===e?void 0:e.tax)||0)})})):(p=Ee.roomObjects||[],p.forEach(e=>{h+=parseFloat((null===e||void 0===e?void 0:e.tax)||0)}));const g=p.map((e,o)=>{let l=0;return l=ve&&!ue?parseFloat((null===e||void 0===e?void 0:e.sum)||0):parseFloat((null===e||void 0===e?void 0:e.finalValue)||(null===e||void 0===e?void 0:e.sum)||0),{roomId:"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||Pe),roomName:(null===e||void 0===e?void 0:e.roomName)||(null===e||void 0===e?void 0:e.name)||"Room",roomPrice:parseFloat(l.toFixed(2)),index:o}}),_=null!==(t=null!==(d=null===w||void 0===w?void 0:w.chainId)&&void 0!==d?d:Y.A.get("chainId"))&&void 0!==t?t:"",x=null!==(s=null!==(r=null===w||void 0===w?void 0:w.name)&&void 0!==r?r:Y.A.get("hotelName"))&&void 0!==s?s:"",f=null!==(u=null!==(v=null===w||void 0===w?void 0:w.id)&&void 0!==v?v:Y.A.get("hotelId"))&&void 0!==u?u:Pe,y=g.map(e=>({item_id:e.roomId,item_name:e.roomName,item_category:String(_||""),price:e.roomPrice,quantity:1,index:e.index,start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD"),google_business_vertical:"hotel_rental"}));if(window){var b,j,k,C,A,N;const i={chain_id:String(_||""),chainId:_?Number(_):null,hotel_id:String(f||""),hotelId:f?Number(f):null,hotel_name:String(x||""),hotelName:String(x||""),booking_source:di,transaction_id:"".concat(l),value:e,currency:o,items:y};h>0&&(i.tax=h),(_e||ye)&&(i.coupon=_e||ye),null===(b=window)||void 0===b||b.gtag("event","purchase",i);const t=g.map(e=>({id:e.roomId,quantity:1,item_price:e.roomPrice})),d=g.map(e=>e.roomId),s=g.map(e=>e.roomName).join(", ");try{let e;if(ve&&!ue){var P;e=((null===Te||void 0===Te||null===(P=Te.appliedDiscount)||void 0===P?void 0:P.discount)>0?(null===Te||void 0===Te?void 0:Te.priceAfterDiscount)||0:(null===Te||void 0===Te?void 0:Te.rpPrice)||0)+Math.abs(null!==w&&void 0!==w&&w.isTaxIncluded?0:Te.taxObj.totalTax)}else{const o=(null===Ee||void 0===Ee?void 0:Ee.totalPrice)||0;e=o+Math.abs((null===Ee||void 0===Ee?void 0:Ee.totalTax)||0)}const i={value:parseFloat(e),currency:o,content_ids:d,content_type:"hotel_room",content_name:s,contents:t,num_items:p.length,checkin_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),checkout_date:a()(null===le||void 0===le?void 0:le.endD
1ate).format("YYYY-MM-DD"),num_adults:Ll,num_children:Vl,order_id:l,booking_id:n,hotel_id:(null===w||void 0===w?void 0:w.id)||Pe,hotel_name:null===w||void 0===w?void 0:w.name,city:null===w||void 0===w?void 0:w.city,country:null===w||void 0===w?void 0:w.country};(0,L.newFBEvents)("Purchase",i)}catch(q){console.log("Meta Pixel failed")}(0,W.DC)({checkInDate:null===le||void 0===le?void 0:le.startDate,checkOutDate:null===le||void 0===le?void 0:le.endDate,hotelId:(null===w||void 0===w?void 0:w.id)||Pe,hotelName:null===w||void 0===w?void 0:w.name,city:null===w||void 0===w?void 0:w.city,state:null===w||void 0===w?void 0:w.state,country:"IN",numberOfRooms:null===(j=p)||void 0===j?void 0:j.length,numberOfTravelers:oe,discountCode:_e||ye||"",price:e,confirmationNumber:n,currency:o}),(0,L.pushDataLayerEvent)({event:"conversionAnalytics",chain_id:String(_||""),chainId:_?Number(_):null,hotel_id:String(f||""),hotelId:f?Number(f):null,hotel_name:String(x||""),hotelName:String(x||""),booking_source:di,value:parseFloat(e||0),currency:o,transaction_id:"".concat(l),source:di,utm_source:(null===(k=Y.A.get("utmObj"))||void 0===k?void 0:k.utmSource)||null,utm_campaign:(null===(C=Y.A.get("utmObj"))||void 0===C?void 0:C.utmCampaign)||null,items:null!==y&&void 0!==y&&y.length?y:[{item_id:"".concat(Pe),id:"".concat(Pe),item_category:String(_||""),start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD")}],item:[{id:"".concat(Pe),item_id:"".concat(Pe),item_category:String(_||""),start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD")}],id:"".concat(Pe),item_id:"".concat(Pe),start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD")}),(0,L.pushDataLayerEvent)({event:"purchase",chain_id:String(_||""),chainId:_?Number(_):null,hotel_id:String(f||""),hotelId:f?Number(f):null,hotel_name:String(x||""),hotelName:String(x||""),booking_source:di,value:parseFloat(e||0),currency:o,transaction_id:"".concat(l),source:di,utm_source:(null===(A=Y.A.get("utmObj"))||void 0===A?void 0:A.utmSource)||null,utm_campaign:(null===(N=Y.A.get("utmObj"))||void 0===N?void 0:N.utmCampaign)||null,items:null!==y&&void 0!==y&&y.length?y:[{item_id:"".concat(Pe),id:"".concat(Pe),item_category:String(_||""),start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD")}]});try{var I,S,D,M,R,B,E,T,O,F,z;let n=no||"";try{const e=(0,c.parsePhoneNumber)(String(no));n=e.countryCallingCode+e.nationalNumber.replace(/\s+/g,"")}catch(U){n=String(no||"").replace(/[^0-9]/g,"")}(0,L.pushDataLayerEvent)({event:"product_purchase",chain_id:String(_||""),chainId:_?Number(_):null,hotel_id:String(f||""),hotelId:f?Number(f):null,hotel_name:String(x||""),hotelName:String(x||""),booking_source:di,value:parseFloat(e||0),currency:o,transaction_id:"".concat(l),source:di,utm_source:(null===(I=Y.A.get("utmObj"))||void 0===I?void 0:I.utmSource)||null,utm_campaign:(null===(S=Y.A.get("utmObj"))||void 0===S?void 0:S.utmCampaign)||null,items:null!==y&&void 0!==y&&y.length?y:[{item_id:"".concat(Pe),id:"".concat(Pe),item_category:String(_||""),start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD HH:mm:ss"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD HH:mm:ss")}],resort:(null===w||void 0===w?void 0:w.name)||"",checkin:null!==le&&void 0!==le&&le.startDate?a()(le.startDate).format("YYYY-MM-DD HH:mm:ss"):"",checkout:null!==le&&void 0!==le&&le.endDate?a()(le.endDate).format("YYYY-MM-DD HH:mm:ss"):"",adult_guests:null!==(D=null!==(M=null===Te||void 0===Te?void 0:Te.adultCount)&&void 0!==M?M:Ll)&&void 0!==D?D:0,children_guests:null!==(R=null!==(B=null===Te||void 0===Te?void 0:Te.childCount)&&void 0!==B?B:Vl)&&void 0!==R?R:0,infant_guests:null!==(E=null===Te||void 0===Te?void 0:Te.infantCount)&&void 0!==E?E:0,number_of_nights:null!==le&&void 0!==le&&le.startDate&&null!==le&&void 0!==le&&le.endDate?a()(le.endD
1ate).diff(a()(le.startDate),"day"):0,number_of_rooms:null!==(T=null===g||void 0===g?void 0:g.length)&&void 0!==T?T:0,promotion_applied:_e||ye||"",totalprice:parseFloat(e||0),page_url:"undefined"!==typeof window?null===(O=window.location)||void 0===O?void 0:O.href:"",resort_banner:(null===w||void 0===w||null===(F=w.HotelImages)||void 0===F||null===(z=F[0])||void 0===z?void 0:z.cdnImageUrl)||"",mobile:n||"",email:to||"",salutation:"Male"===oo?"Mr":"Female"===oo?"Ms":oo||"",name:$e||"",special_requests:Io||"",gst_invoice:Ae||0,mode_of_payment:po||""})}catch(J){console.error("Analytics tracking error (product_purchase):",J)}(0,L.mixpanelConversion)({value:e,currency:o,transaction_id:"".concat(l),items:[{id:"".concat(Pe),item_id:"".concat(Pe),start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD")}],item:[{id:"".concat(Pe),item_id:"".concat(Pe),start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD")}],id:"".concat(Pe),item_id:"".concat(Pe),start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD")}),(0,L.pixelConversion)({value:e,currency:o,transaction_id:"".concat(l),content_ids:"".concat(l),items:[{id:"".concat(Pe),item_id:"".concat(Pe),start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD")}],item:[{id:"".concat(Pe),item_id:"".concat(Pe),start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD")}],id:"".concat(Pe),item_id:"".concat(Pe),start_date:a()(null===le||void 0===le?void 0:le.startDate).format("YYYY-MM-DD"),end_date:a()(null===le||void 0===le?void 0:le.endDate).format("YYYY-MM-DD")})}const G={transaction_id:"".concat(l),value:parseFloat(e),currency:o,items:y};(0,L.fireGtmEvent)("conversion",G),"undefined"!==typeof window&&window.gtag&&window.gtag("event","conversion",{send_to:"AW-11452557213/v1YoCOmjnvcbEJ3PgNUq",value:parseFloat(e),currency:o,transaction_id:"".concat(l)});if([1,76].includes(null===w||void 0===w?void 0:w.chainId)&&"undefined"!==typeof window&&window.gtag("event","conversion",{send_to:"AW-11024745253/aKXnCOnr-ZkYEKWGgYkp",value:e,currency:o,transaction_id:"".concat(l),items:y,event_callback:i}),23===(null===w||void 0===w?void 0:w.chainId)&&"undefined"!==typeof window&&window.gtag("event","conversion",{send_to:"AW-10888201272",value:e,currency:o,transaction_id:"".concat(l),items:y,event_callback:i}),"undefined"!==typeof window&&window.gtag("event","conversion",{send_to:"AW-11159414012/Lg_hCIfgh4EZEPzJnMkp",value:parseFloat(e),currency:o,transaction_id:"".concat(l),items:y,event_callback:i}),null!==be&&void 0!==be&&null!==(m=be.googlePixel)&&void 0!==m&&m.googleAdsId){var H,V;const n=null===be||void 0===be||null===(H=be.googlePixel)||void 0===H||null===(V=H.googleAdsConversions)||void 0===V?void 0:V.purchase,i=n?"".concat(be.googlePixel.googleAdsId,"/").concat(n):"".concat(be.googlePixel.googleAdsId);"undefined"!==typeof window&&window.gtag&&window.gtag("event","conversion",{send_to:i,value:parseFloat(e),currency:o,transaction_id:"".concat(l),items:y})}},ci=e=>{let{gateway:o,amount:l,errorCode:n,errorMessage:i,bookingId:t}=e;try{var d,s,r,u,v,m,p,h,g,_,x;let e=no||"";try{const o=(0,c.parsePhoneNumber)(String(no));e=o.countryCallingCode+o.nationalNumber.replace(/\s+/g,"")}catch(f){e=String(no||"").replace(/[^0-9]/g,"")}(0,L.pushDataLayerEvent)({event:"payment_failed",failure_type:"payment_failed",failure_stage:"payment_processing",error_code:n||null,error_message:i||null,booking_id:t||Y.A.get("bookingId")||null,hotel_id:(null===w||void 0===w?void 0:w.id)||null,total_amount:parseFloat(l||0),currency:(null===w||void 0===w?void 0:w.currency)||"INR",payment_gateway:o||null,source:Y.A.get("source")||"Direct",resort:(null===w||void 0===w?void 0:w.name)||null,checkin:null!==le&&void 0!==le&&le.startDate?a()(le.startDate).format("YYYY-MM-DD HH:mm:ss"):null,checkout:null!==le&&void 0!==le&&le.endDate?a()(le.endD
1ate).format("YYYY-MM-DD HH:mm:ss"):null,adult_guests:null!==(d=null!==(s=null===Te||void 0===Te?void 0:Te.adultCount)&&void 0!==s?s:Ll)&&void 0!==d?d:null,children_guests:null!==(r=null!==(u=null===Te||void 0===Te?void 0:Te.childCount)&&void 0!==u?u:Vl)&&void 0!==r?r:null,infant_guests:null!==(v=null===Te||void 0===Te?void 0:Te.infantCount)&&void 0!==v?v:null,number_of_nights:null!==le&&void 0!==le&&le.startDate&&null!==le&&void 0!==le&&le.endDate?a()(le.endDate).diff(a()(le.startDate),"day"):null,number_of_rooms:ve?null!==(m=null===Te||void 0===Te||null===(p=Te.selectedRooms)||void 0===p?void 0:p.length)&&void 0!==m?m:null:null!==(h=null===D||void 0===D?void 0:D.length)&&void 0!==h?h:null,promotion_applied:_e||ye||null,page_url:"undefined"!==typeof window?null===(g=window.location)||void 0===g?void 0:g.href:null,resort_banner:(null===w||void 0===w||null===(_=w.HotelImages)||void 0===_||null===(x=_[0])||void 0===x?void 0:x.cdnImageUrl)||null,mobile:e||null,email:to||null,salutation:"Male"===oo?"Mr":"Female"===oo?"Ms":oo||null,name:$e||null,special_requests:Io||"",gst_invoice:Ae||0,mode_of_payment:o||null})}catch(y){console.error("Analytics tracking error (payment_failed):",y)}};(0,d.useEffect)(()=>{let e=Y.A.get("isApiCalled")||!1;const o="pcibooking"===(null===an||void 0===an?void 0:an.vendor),l=!Fl||!sn&&o;return(null===$e||void 0===$e?void 0:$e.length)>=4&&/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(to)&&(null===no||void 0===no?void 0:no.length)>0&&(0,c.g0)(no)&&!e&&!wl&&187479!==(null===w||void 0===w?void 0:w.userId)&&26296!==(null===w||void 0===w?void 0:w.id)&&l?(Vn.current&&clearTimeout(Vn.current),Vn.current=setTimeout(()=>{Vn.current=null,xi(!0)},2e3),sl(!0)):(Vn.current&&(clearTimeout(Vn.current),Vn.current=null),sl(!1)),()=>{Vn.current&&(clearTimeout(Vn.current),Vn.current=null)}},[$e,to,no,oo,ie,Fl,sn,null===an||void 0===an?void 0:an.vendor]),(0,d.useEffect)(()=>{console.log("checkoutpg");(0,c.g0)(String(no))&&0===(null===to||void 0===to?void 0:to.length)&&0===(null===$e||void 0===$e?void 0:$e.length)&&(async()=>{var e,o,l,n;Rl(!0);const t=(0,c.parsePhoneNumber)(String(no));let a="%2b"+t.countryCallingCode;const d=await(0,O.Vz)(a,t.nationalNumber);eo(null===d||void 0===d||null===(e=d.data)||void 0===e?void 0:e.name),ao(null===d||void 0===d||null===(o=d.data)||void 0===o?void 0:o.email),lo((null===d||void 0===d||null===(l=d.data)||void 0===l?void 0:l.gender)||"Male"),mo((0,U.ns)(null===d||void 0===d||null===(n=d.data)||void 0===n?void 0:n.dob)),Rl(!1);const s=(e=>{let{isRatePlans:o,priceCalculator:l,oldPriceCalculator:n,selectedRooms:i,hotelData:t,dateRange:a,totalAdult:d,totalChild:s}=e;try{var r,c;const e=o?null===l||void 0===l?void 0:l.selectedRooms:(null===n||void 0===n?void 0:n.roomObjects)||i;if(!e||0===e.length)return null;const u=e.map(e=>"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||(null===t||void 0===t?void 0:t.id))),v=e.map(e=>({id:"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||(null===t||void 0===t?void 0:t.id)),quantity:1})),m=o?((null===(r=l.appliedDiscount)||void 0===r?void 0:r.discount)>0?l.priceAfterDiscount:l.rpPrice)+Math.abs(null!==t&&void 0!==t&&t.isTaxIncluded?0:(null===(c=l.taxObj)||void 0===c?void 0:c.totalTax)||0):n.totalPrice+Math.abs(n.totalTax||0),p=e.map(e=>({item_id:"".concat((null===e||void 0===e?void 0:e.id)||(null===e||void 0===e?void 0:e.hotelRoomId)||(null===e||void 0===e?void 0:e.roomId)||(null===t||void 0===t?void 0:t.id)),item_name:(null===e||void 0===e?void 0:e.roomName)||(null===e||void 0===e?void 0:e.name)||"Room",price:parseFloat((null===e||void 0===e?void 0:e.sum)||(null===e||void 0===e?void 0:e.finalValue)||0),quantity:1,google_business_vertical:"hotel_rental"})),h=(null===a||void 0===a?void 0:a.startDate)||(null===a||void 0===a?void 0:a[0])||"",g=(null===a||void 0===a?void 0:a.endDate)||(null===a||void 0===a?void 0:a[1])||"",_=(null===a||void 0===a?void 0:a.numNights)||1;return{rooms:e,contentIds:u,contents:v,items:p,totalValue:parseFloat(m),currency:(null===t||void 0===t?void 0:t.currency)||"INR",numNights:_,checkinDate:h,checkoutDate:g,totalAdult:d||0,totalChild:s||0}}catch(u){return console.error("Error building analytics room data:",u),null}})({isRatePlans:ve,priceCalculator:Te,oldPriceCalculator:Ee,selectedRooms:D,hotelData:w,dateRange:le,totalAdult:ae,totalChild:de});if(s){const e=function(e,o){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{return o?(0,i.A)({value:o.totalValue,currency:o.currency,items:o.items},l):null}catch(n){return console.error("Error building GA4 event:",n),null}}("add_payment_info",s);(0,L.fireGtmEvent)("add_payment_info",e)}})()},[no]),(0,d.useEffect)(()=>{null!==w&&void 0!==w&&w.id&&null!==le&&void 0!==le&&le.startDate&&null!==le&&void 0!==le&&le.endDate&&(async()=>
1{if(!(0,c.g0)(String(no)))return S({type:T.A.SET_RETURNING_MEMBER,payload:!1}),void(null!==ye&&void 0!==ye&&ye.isReturningMember&&S({type:T.A.SET_COUPON_CODE,payload:{}}));try{var e;const o=(0,c.parsePhoneNumber)(String(no)),l="+"+o.countryCallingCode,n=o.nationalNumber,i=await(0,O.RT)({hotelId:null===w||void 0===w?void 0:w.id,dialCode:l,mobile:n,checkInDate:a()(null===le||void 0===le?void 0:le.startDate).format("DD/MM/YYYY"),checkOutDate:a()(null===le||void 0===le?void 0:le.endDate).format("DD/MM/YYYY")});200===(null===i||void 0===i?void 0:i.status)&&null!==i&&void 0!==i&&null!==(e=i.data)&&void 0!==e&&e.eligible?(S({type:T.A.SET_RETURNING_MEMBER,payload:!0}),null!==ye&&void 0!==ye&&ye.id||(S({type:T.A.SET_COUPON_CODE,payload:i.data.promotion}),Oo(!0))):(S({type:T.A.SET_RETURNING_MEMBER,payload:!1}),null!==ye&&void 0!==ye&&ye.isReturningMember&&S({type:T.A.SET_COUPON_CODE,payload:{}}))}catch(o){}})()},[no,null===w||void 0===w?void 0:w.id]);const ui=async(e,o)=>{console.log("called6");try{S({type:T.A.FETCHING,payload:!0});const a=await(0,O.C8)(o);var l,n,i,t;if(200===(null===a||void 0===a?void 0:a.status))si(null===e||void 0===e||null===(l=e.payment)||void 0===l?void 0:l.amount,null===w||void 0===w?void 0:w.currency,null===e||void 0===e?void 0:e.bookingId,null===e||void 0===e?void 0:e.bookingId),(0,L.trackCheckoutFunnel)("payment_completed",{payment_gateway:null===o||void 0===o?void 0:o.gateway,amount:null===e||void 0===e||null===(n=e.payment)||void 0===n?void 0:n.amount});else yl(!0),h().error(null===a||void 0===a?void 0:a.error),(0,L.trackCheckoutFunnel)("payment_failed",{payment_gateway:null===o||void 0===o?void 0:o.gateway,amount:null===e||void 0===e||null===(i=e.payment)||void 0===i?void 0:i.amount,error_reason:null===a||void 0===a?void 0:a.error}),ci({gateway:null===o||void 0===o?void 0:o.gateway,amount:null===e||void 0===e||null===(t=e.payment)||void 0===t?void 0:t.amount,errorMessage:null===a||void 0===a?void 0:a.error,bookingId:null===e||void 0===e?void 0:e.bookingId})}catch(a){}finally{S({type:T.A.FETCHING,payload:!1})}},vi=null===U.hq||void 0===U.hq?void 0:U.hq.includes(null===w||void 0===w?void 0:w.id),[mi,pi]=(0,d.useState)(!1),[hi,gi]=(0,d.useState)(""),_i=()=>{pi(!1),gi("")},xi=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return!e&&Vn.current&&(clearTimeout(Vn.current),Vn.current=null),Le.current.run(async()=>{try{return await fi(e)}finally{S({type:T.A.FETCHING,payload:!1}),Dl(!1)}},{background:e})},fi=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(Dl(!0),a()(null===le||void 0===le?void 0:le.endDate).isBefore(null===le||void 0===le?void 0:le.startDate)||!ue&&a()(null===le||void 0===le?void 0:le.endDate).isSame(null===le||void 0===le?void 0:le.startDate))h().error("Invalid Checkin Checkout Dates");else{if(""===no||!(0,c.g0)(String(no)))return Wn.current&&Wn.current.focus(),Wn.current&&Wn.current.scrollIntoView(),xl(!0),(0,L.fireGtmEvent)("submit_without_phone"),h().error(Fn("enter_valid_phone_number")),void Dl(!1);if((null===Io||void 0===Io?void 0:Io.length)>255)h().error("Special requests can not have more than 255 characters");else{if(""===to)return(0,L.fireGtmEvent)("submit_without_email"),h().error(Fn("enter_email_address")),Ln.current&&Ln.current.scrollIntoView(),Dl(!1),void(Ln.current&&Ln.current.focus());if(!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(to))return Ln.current&&Ln.current.focus(),Ln.current&&Ln.current.scrollIntoView(),(0,L.fireGtmEvent)("submit_incorrect_email"),gl(!0),Dl(!1),void h().error(Fn("enter_valid_email_address"));if(""===(null===$e||void 0===$e?void 0:$e.trim()))return Dl(!1),Hn.current&&Hn.current.focus(),(0,L.fireGtmEvent)("submit_without_name"),pl(!0),void h().error(Fn("enter_name"));if((0,U.e3)($e))return Dl(!1),Hn.current&&Hn.current.focus(),pl(!0),void h().error("Please enter a name without special characters");if((0,U.SA)($e))return Dl(!1),Hn.current&&Hn.current.focus(),pl(!0),void h().error("Please enter a valid name");if(""===$e.trim()||""===to.trim()||!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(to)||""===no.trim()||!(0,c.g0)(String(no)))return Dl(!1),void h().error(Fn("enter_all_details"));if(""===po)return h().error(Fn("select_payment_method")),void Dl(!1);if(!Me||Ce){!e&&S({type:T.A.FETCHING,payload:!0}),(0,L.fireGtmEvent)("user_details_added",{userName:$e,email:to,phone:no,paymentOption:po}),(0,L.trackCheckoutFunnel)("guest_details_entered",{payment_method:po});try{var o,l,t,d,s,r;let e=no||"";try{const o=(0,c.parsePhoneNumber)(String(no));e=o.countryCallingCode+o.nationalNumber.replace(/\s+/g,"")}catch(Ye){e=String(no||"").replace(/[^0-9]/g,"")}const n=parseInt(null!==(o=null===Te||void 0===Te?void 0:Te.adultCount)&&void 0!==o?o:j,10)||0,i=parseInt(null!==(l=null===Te||void 0===Te?void 0:Te.childCount)&&void 0!==l?l:Vl,10)||0,u=parseInt(null===Te||void 0===Te?void 0:Te.infantCount,10)||0;(0,L.pushDataLayerEvent)({event:"guest_details_submitted",booking_id:Y.A.get("bookingId")||null,guest_name:$e||null,guest_email:to||null,guest_mobile:e||null,total_guests:n+i,adult_guests:n,children_guests:i,infant_guests:u,hotel_id:(null===w||void 0===w?void 0:w.id)||Pe||null,hotel_name:(null===w||void 0===w?void 0:w.name)||null,check_in_date:null!==le&&void 0!==le&&le.startDate?a()(le.startDate).format("YYYY-MM-DD HH:mm:ss"):Y.A.get("checkInDate")?a()(Y.A.get("checkInDate")).format("YYYY-MM-DD HH:mm:ss"):null,check_out_date:null!==le&&void 0!==le&&le.endDate?a()(le.endD
1ate).format("YYYY-MM-DD HH:mm:ss"):Y.A.get("checkOutDate")?a()(Y.A.get("checkOutDate")).format("YYYY-MM-DD HH:mm:ss"):null,number_of_nights:null!==le&&void 0!==le&&le.startDate&&null!==le&&void 0!==le&&le.endDate?a()(le.endDate).diff(a()(le.startDate),"day"):0,number_of_rooms:ve?(null===Te||void 0===Te||null===(t=Te.selectedRooms)||void 0===t?void 0:t.length)||0:(null===D||void 0===D?void 0:D.length)||0,promotion_applied:_e||ye||null,totalprice:null!=Ke?parseFloat(Ke):0,source:Y.A.get("source")||"Direct",salutation:"Male"===oo?"Mr":"Female"===oo?"Ms":oo||null,special_requests:Io||"",gst_invoice:Ae||0,mode_of_payment:po||null,page_url:"undefined"!==typeof window?null===(d=window.location)||void 0===d?void 0:d.href:null,resort_banner:(null===w||void 0===w||null===(s=w.HotelImages)||void 0===s||null===(r=s[0])||void 0===r?void 0:r.cdnImageUrl)||null})}catch(Fe){console.error("Analytics tracking error (guest_details_submitted):",Fe)}if((null===w||void 0===w?void 0:w.chainId)===U.CV)try{"undefined"!==typeof window&&"function"===typeof window.createPushLapEmail?(window.createPushLapEmail(to.trim(),$e.trim()),console.log("[PushLap] createPushLapEmail called:",{email:to.trim(),name:$e.trim()})):console.log("[PushLap] createPushLapEmail function not available")}catch(ze){console.error("[PushLap] Error calling createPushLapEmail:",ze)}try{var u,v,m,p,g,_,x,f;const o=(0,c.parsePhoneNumber)(String(no)),l={dialCode:"+"+o.countryCallingCode,mobile:o.nationalNumber.replace(/\s+/g,""),regMedium:"webapp",email:to.trim().replace(/\s+/g,""),name:null===$e||void 0===$e?void 0:$e.trim(),dob:(null===(u=String(vo))||void 0===u?void 0:u.length)>0?(0,U.Nl)(vo):"",gender:oo},t=z.A.isCorporateBooking();if(t){const e=localStorage.getItem("corporateToken");e&&Y.A.set("token",e)}else{const e=(await(0,O.nC)(l)).data.token;Y.A.set("token",e)}!e&&S((0,E.z2)());const d=[...D];let s=new Map;d.forEach(e=>{if(s.has(e.id)){let o=s.get(e.id);o++,s.set(e.id,o)}else s.set(e.id,1)});let r=[];var y=0,b=0,j=0,k=0;Ee.roomObjects.forEach((e,o)=>{var l,n;let t=s.get(null===e||void 0===e?void 0:e.id),d=[];var c;(null===e||void 0===e||null===(l=e.HotelRoomAddons)||void 0===l?void 0:l.length)>0&&(d=null===e||void 0===e||null===(c=e.HotelRoomAddons)||void 0===c?void 0:c.filter(e=>{var o;return Number(null===e||void 0===e?void 0:e.price)<=0&&"meal"===(null===e||void 0===e||null===(o=e.Addon)||void 0===o?void 0:o.category)}));const u=null===$||void 0===$?void 0:$.filter(o=>{var l;return(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"meal"===(null===o||void 0===o||null===(l=o.Addon)||void 0===l?void 0:l.category)}),v=(null===$||void 0===$||$.filter(o=>{var l;return(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"Extra Adult"===(null===o||void 0===o||null===(l=o.Addon)||void 0===l?void 0:l.name)}),null===$||void 0===$||$.filter(o=>(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"child"===(null===o||void 0===o?void 0:o.type)),null===$||void 0===$||$.filter(o=>(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"infant"===(null===o||void 0===o?void 0:o.type)),null===$||void 0===$?void 0:$.filter(o=>{var l;return(null===o||void 0===o?void 0:o.hotelRoomId)===(null===e||void 0===e?void 0:e.id)&&"person"===(null===o||void 0===o||null===(l=o.Addon)||void 0===l?void 0:l.category)}));let m=t*(null===e||void 0===e?void 0:e.defaultGuestCount)+(null===v||void 0===v?void 0:v.length),p=[];null===(n=d)||void 0===n||n.forEach(o=>{o.hotelRoomId===e.id&&p.push({id:o.addonId,quantity:m})}),null===u||void 0===u||u.forEach(o=>{var l;o.hotelRoomId===e.id&&p.push({id:o.addonId,quantity:null===u||void 0===u||null===(l=u.filter(e=>(null===e||void 0===e?void 0:e.addonId)===(null===o||void 0===o?void 0:o.addonId)))||void 0===l?void 0:l.length})});let h={};if(null===e||void 0===e||e.promosApplied.forEach(e=>{var o,l;h=(0,i.A)((0,i.A)({},h),{},{[a()(null===e||void 0===e?void 0:e.checkInDate).format("YYYY-MM-DD")]:null===e||void 0===e||null===(o=e.promo)||void 0===o||null===(l=o.map(e=>null===e||void 0===e?void 0:e.id))||void 0===l?void 0:l.filter(e=>!(null!==ke&&void 0!==ke&&ke.id)||String(e)!==String(ke.id))})}),0===Yn){var g,_,x;let o={};o=1===(null===e||void 0===e?void 0:e.idx)?(0,i.A)((0,i.A)({},o),{},{addons:[...new Map(p.map(e=>[e.id,e])).values()]}):(0,i.A)((0,i.A)({},o),{},{addons:[]}),o=(0,i.A)((0,i.A)({},o),{},{quantity:1,guests:(null===e||void 0===e?void 0:e.sAdult)<(null===e||void 0===e?void 0:e.defaultGuestCount)?null===e||void 0===e?void 0:e.sAdult:null===e||void 0===e?void 0:e.defaultGuestCount,id:e.id,extraAdults:(null===e||void 0===e?void 0:e.sAdult)-(null===e||void 0===e?void 0:e.defaultGuestCount)>0?(null===e||void 0===e?void 0:e.sAdult)-(null===e||void 0===e?void 0:e.defaultGuestCount):0,extraChildren:null===e||void 0===e?void 0:e.sChild,extraInfant:null===e||void 0===e?void 0:e.sInfant,slotId:(null===(g=ge[null===e||void 0===e?void 0:e.id])||void 0===g?void 0:g.id)||null,promotionData:null!==(_=Ee.bulkDiscount)&&void 0!==_&&_.id?null:(null===e||void 0===e||null===(x=e.promosApplied)||void 0===x?void 0:x.length)>0?h:null}),y+=(null===e||void 0===e?void 0:e.sAdult)+(null===e||void 0===e?void 0:e.sChild)+(null===e||void 0===e?void 0:e.sInfant),b+=null===e||void 0===e?void 0:e.sChild,j+=null===e||void 0===e?void 0:e.sAdult,k+=null===e||void 0===e?void 0:e.sInfant,r.push(o)}}
1),0!==Yn&&(r.forEach(e=>{const{extraAdults:o,extraChildren:l,guests:n,extraInfant:i}=e;j=j+o+n,b+=l,k+=i}),y=y+b+j+k);const _e=String(Y.A.get("source"))||"Hotelzify_Fallback";let Me={};if(ue&&(Me=(0,U.D4)(pe,me,he,!0)),ve&&!ue){let e=[];Te.selectedRooms.forEach(o=>{var l,n,t,d,s;let r=0,c=0;var u,v;(null===o||void 0===o?void 0:o.sAdult)>(null===o||void 0===o||null===(l=o.room)||void 0===l?void 0:l.defaultGuestCount)?(r=null===o||void 0===o||null===(u=o.room)||void 0===u?void 0:u.defaultGuestCount,c=(null===o||void 0===o?void 0:o.sAdult)-(null===o||void 0===o||null===(v=o.room)||void 0===v?void 0:v.defaultGuestCount)):(r=null===o||void 0===o?void 0:o.sAdult,c=0);let m={};null===o||void 0===o||o.promosApplied.forEach(e=>{var o,l;m=(0,i.A)((0,i.A)({},m),{},{[a()(null===e||void 0===e?void 0:e.checkInDate).format("YYYY-MM-DD")]:null===e||void 0===e||null===(o=e.promo)||void 0===o||null===(l=o.map(e=>null===e||void 0===e?void 0:e.id))||void 0===l?void 0:l.filter(e=>!(null!==ke&&void 0!==ke&&ke.id)||String(e)!==String(ke.id))})});let p={addons:[],quantity:1,id:null===o||void 0===o?void 0:o.roomId,slotId:null,guests:r,extraAdults:c,promotionData:null!==(n=Te.bulkDiscount)&&void 0!==n&&n.id?null:(null===o||void 0===o||null===(t=o.promosApplied)||void 0===t?void 0:t.length)>0?m:null,extraChildren:null===o||void 0===o?void 0:o.sChild,extraInfant:null===o||void 0===o?void 0:o.sInfant,ratePlanId:null===o||void 0===o||null===(d=o.rpObject)||void 0===d?void 0:d.id,ratePlanInfo:{ratePlanCode:null===o||void 0===o||null===(s=o.rpObject)||void 0===s?void 0:s.pmsCode}};e.push(p)}),r=e}const Re=[...ie],Oe=new Map;null===Re||void 0===Re||Re.forEach(e=>{if(Oe.has(e.id)){let o=Oe.get(e.id);
1o++,Oe.set(e.id,o)}else Oe.set(e.id,1)});const Ye=[];for(let[e,n]of Oe){let o={id:e,count:n};Ye.push(o)}const ze=(0,i.A)((0,i.A)((0,i.A)((0,i.A)({hotelId:Pe,hotelRooms:r,totalGuests:ve&&!ue?Te.rpTotalGuest:y,childrenCount:ve&&!ue?Te.childCount:b,adultCount:ve&&!ue?Te.adultCount:j,infantCount:ve&&!ue?Te.infantCount:k,arrivalTime:il&&!ue?ll:null,name:null===$e||void 0===$e?void 0:$e.trim(),addons:Ye,gender:oo,type:ue?"hourly":"normal",checkInTime:ue?(0,U.Ij)(me):null,checkOutTime:ue?(0,U.Ij)((0,U.D4)(pe,me,he)):null,dob:(null===vo||void 0===vo?void 0:vo.length)>0?(0,U.Nl)(vo):null,email:null===to||void 0===to?void 0:to.trim().replace(/\s+/g,""),requests:Io,source:t?"ABT":["bot9chatbot","ai_internal_voice"].includes(localStorage.getItem("source"))?localStorage.getItem("source"):(null===_e||void 0===_e?void 0:_e.length)>0&&"null"!==_e?_e:"Hotelzify"},localStorage.getItem("displaySource")&&{displaySource:localStorage.getItem("displaySource")}),{},{dialCode:"+"+o.countryCallingCode,mobile:o.nationalNumber.replace(/\s+/g,""),checkInDate:ue?a()(pe).format("YYYY/MM/DD"):a()(null===le||void 0===le?void 0:le.startDate).format("YYYY/MM/DD"),checkOutDate:ue?(null===(v=Me)||void 0===v?void 0:v.date)||a()(null===le||void 0===le?void 0:le.startDate).format("YYYY/MM/DD"):a()(null===le||void 0===le?void 0:le.endDate).format("YYYY/MM/DD"),promotionId:ve?null===(m=Te.bulkDiscount)||void 0===m?void 0:m.id:null===Ee||void 0===Ee||null===(p=Ee.bulkDiscount)||void 0===p?void 0:p.id,coupon:null===ye||void 0===ye?void 0:ye.couponCodeId},t&&{taxDetails:(null===co||void 0===co?void 0:co.trim())||null,emails:(null===so||void 0===so?void 0:so.length)>0?JSON.stringify(so):null,corporateAgentId:(null===Co||void 0===Co?void 0:Co.id)||null}),(null===ke||void 0===ke?void 0:ke.id)&&{paymentOffer:{id:ke.id,discount:ke.discount,discountType:ke.discountType}}),Ae&&{taxDetails:Ae});let Le,We,Ve=Y.A.get("utmObj")||{},qe=(0,U.nP)(Ve),Ue=Y.A.get("locationDetails")||{},Je=JSON.parse(localStorage.getItem("visited"))||[],Xe=localStorage.getItem("uuid")||"",Qe=(0,i.A)((0,i.A)((0,i.A)({},ze),{},{utmData:qe},Ce&&{loyalty:{programName:"maharajaclub",memberId:Ce}}),{},{bookingAnalytics:(0,i.A)((0,i.A)({},ze),{},{oldSource:Y.A.get("old_source"),locationDetails:Ue,showBanner:Y.A.get("showBanner")||null,networkSpeed:(null===(g=window)||void 0===g||null===(_=g.navigator)||void 0===_||null===(x=_.connection)||void 0===x?void 0:x.effectiveType)||"not-set",deviceType:U.RX,utmObj:Ve,testId:Yn,isGHC:null===w||void 0===w?void 0:w.ghcEnabled,isDev:U.Cu,themeId:2,uuid:Xe,sourceTrack:Je,hotelName:Y.A.get("hotelName"),userId:Y.A.get("userId"),hotelId:Y.A.get("hotelId"),slug:Y.A.get("slug"),domain:Y.A.get("domain"),end_date:Y.A.get("checkOutDate"),start_date:Y.A.get("checkInDate")})}),Ze=ve&&!ue?Te.appliedDiscount.discount>0?Te.priceAfterDiscount+Te.rpTax+Te.taxObj.totalBookingTax:Te.rpPrice+Te.rpTax+Te.taxObj.totalBookingTax:Ee.totalPrice+Math.abs(Ee.totalTax),eo=Y.A.get("bookingId")||null,lo=Y.A.get("bookingObj")||{};const io=Y.A.get("bookingResp"),ao=e=>{if(!e||"object"!==typeof e)return{};const{bookingAnalytics:o,name:l,email:i,gender:t,dialCode:a,mobile:d}=e;return(0,n.A)(e,Nl)};if(eo&&null!=(null===io||void 0===io?void 0:io.id)&&String(io.id)===String(eo)&&JSON.stringify(ao(lo))===JSON.stringify(ao(Qe)))Le=io.id,We={status:200,data:io},Y.A.set("bookingObj",Qe);else{var C,A,N,P,I,M,R,B,F,G,H,W,q;if(Dl(!0),We=await(0,O.mI)(Qe),200!==(null===(C=We)||void 0===C?void 0:C.status)){let e={data:Qe,error:We,reason:"booking_api_failed"};(0,L.fireGtmEvent)("booking_error",e),(0,V.Jd)(Qe,We)}if(200===(null===(A=We)||void 0===A?void 0:A.status)&&null!==(N=We)&&void 0!==N&&null!==(P=N.data)&&void 0!==P&&P.id){var J,K;const e=null===(J=We)||void 0===J||null===(K=J.data)||void 0===K?void 0:K.id;try{var X,Q;localStorage.setItem("bookingId",JSON.stringify({bookingId:e,date:null===(X=We)||void 0===X||null===(Q=X.data)||void 0===Q?void 0:Q.checkInDate}))}catch(Fe){console.error("Failed to save booking ID:",Fe)}}Le=null===(I=We)||void 0===I||null===(M=I.data)||void 0===M||null===(R=M.BookingItems[0])||void 0===R?void 0:R.bookingId,Y.A.set("bookingObj",Qe),Y.A.set("bookingId",null===(B=We)||void 0===B||null===(F=B.data)||void 0===F||null===(G=F.BookingItems[0])||void 0===G?void 0:G.bookingId),Y.A.set("publicId",(null===(H=We)||void 0===H||null===(W=H.data)||void 0===W?void 0:W.publicId)||null),Y.A.set("bookingResp",null===(q=We)||void 0===q?void 0:q.data)}var Z,ee;if("COD"!==po&&Kn(),400===(null===(f=We)||void 0===f?void 0:f.status))return Dl(!1),void h().error((null===(Z=We)||void 0===Z?void 0:Z.error)||(null===(ee=We)||void 0===ee?void 0:ee.message));if(e)return Dl(!1),void Y.A.set("isApiCalled",!0);Y.A.get("isDomain");if(!window.location.href.includes("bookmystay.io")&&!window.location.href.includes("dev.hotelzify.com")&&!window.location.href.includes("theme.dev-hotelzify.com")&&!window.location.href.includes("localhost")&&!window.location.href.includes("booking.sterlingholidays.com")&&!window.location.href.includes("bookings.mhohotels.com")&&!window.location.href.includes("bookings.thealtruisthotels.com")&&!window.location.href.includes("bookings.fernhotels.com")&&!window.location.href.includes("bookings.thealtitudehotels.com")&&!window.location.href.includes("bookings.oliveliving.com")&&!window.location.href.includes("booking.o
1penhotels.in")&&!window.location.href.includes("bookings.subahotels.com")&&!window.location.href.includes("bookings.burgbnb.com")&&!window.location.href.includes("booking.envihotel.com")&&!window.location.href.includes("owniacollection.com")&&!window.location.href.includes("bookings.rocklandhotels.com")&&!window.location.href.includes("stay.clubmahindra.com")&&Le&&("Razorpay"===po||"PartialPayment"===po)&&("hotelzify"===(null===xe||void 0===xe?void 0:xe.superVendor)||"hotelzify"===(null===xe||void 0===xe?void 0:xe.subVendor))){if(U.un||U.nr)window.open("https://hotelzify.com/checkout/".concat(Le,"?").concat(po),"_self");else{let e=window.open("https://hotelzify.com/checkout/".concat(Le,"?").concat(po));Gn.current=e,El(e),Ol(!0)}return}if(Le){var oe,ne,te,ae,de,se,re,ce,fe,be,je,Ne,Ie;let e=an;if("COD"===po&&(sn||cn)){const{ok:o,data:l}=await oi(Pe);if(!o)return Dl(!1),void h().error(Fn("payment_setup_check_failed")||"Couldn't verify payment setup for this hotel. Please try again.");e=l}const o="pcibooking"===(null===(oe=e)||void 0===oe?void 0:oe.vendor)&&"COD"===po;if("COD"===po&&!o&&(null===xe||void 0===xe||!xe.vendor))return Dl(!1),void h().error(Fn("payment_setup_check_failed")||"Couldn't verify payment setup for this hotel. Please try again.");const l=localStorage.getItem("corporateToken"),n=localStorage.getItem("corporateAgentId"),t=(null===(ne=Y.A.get("utmObj"))||void 0===ne?void 0:ne.utmSource)||null,a=l&&n?"agent":t?"utm_source":null,d=l&&n?n:t||null,s=!$e||"string"!==typeof $e||$e.toLowerCase().includes("guest")||$e.includes("*")?null:$e.trim(),r=to&&"string"===typeof to&&!to.includes("*")&&to.includes("@")?to.trim():null,c=(0,i.A)((0,i.A)((0,i.A)({bookingId:Le,gateway:po,vendor:o?null===(te=e)||void 0===te?void 0:te.vendor:null===xe||void 0===xe?void 0:xe.vendor,superVendor:o?null===(ae=e)||void 0===ae?void 0:ae.superVendor:null===xe||void 0===xe?void 0:xe.superVendor,partialAmount:Number(null===(de=We)||void 0===de||null===(se=de.data)||void 0===se?void 0:se.totalAmount)>0?parseFloat(Number(null===(re=We)||void 0===re||null===(ce=re.data)||void 0===ce?void 0:ce.totalAmount)*(null===jo||void 0===jo?void 0:jo.config.minPercentage)/100).toFixed(2):parseFloat(Ze*(null===jo||void 0===jo?void 0:jo.config.minPercentage)/100).toFixed(2)||0,frontendDomain:window.location.origin},s&&{name:s}),r&&{email:r}),a&&{contextType:a,contextValue:d});let u={bookingId:Le,frontEndPrice:Ze,backEndPrice:null===(fe=We)||void 0===fe||null===(be=fe.data)||void 0===be?void 0:be.totalAmount,hotelId:null===w||void 0===w?void 0:w.id};if(await(0,O.dP)(u),Mn){if(!xn.trim())return Dl(!1),void bn(!0);const e=parseFloat(gn.amount),o=e===Math.round(Qn)?Qn:e;c.voucher={superVendor:"sterling",vendor:"qwikcilver",cardNumber:gn.cardNumber,cardPin:xn,amount:o.toFixed(2)}}const v=await(0,O.zr)(c);if(Mn&&200===(null===v||void 0===v?void 0:v.status)&&(null===v||void 0===v||null===(je=v.data)||void 0===je||!je.order)&&"completed"===(null===v||void 0===v||null===(Ne=v.data)||void 0===Ne||null===(Ie=Ne.payment)||void 0===Ie?void 0:Ie.status)){try{si(Ke,(null===w||void 0===w?void 0:w.currency)||"INR",Le,Le),Y.A.set("isBooked",!0)}catch(Ge){console.log("erere",Ge)}return}if(200===(null===v||void 0===v?void 0:v.status))if("paidyet"===(null===xe||void 0===xe?void 0:xe.vendor)&&window.PaidYET)(e=>{window.PaidYET.processPayment(function(o){var l,n;if(null!==o&&void 0!==o&&o.success){var i;const l={gateway:"razorpay",paymentId:null===e||void 0===e||null===(i=e.payment)||void 0===i?void 0:i.id,paidyetToken:null===o||void 0===o?void 0:o.token,vendor:"paidyet",hotelId:null===w||void 0===w?void 0:w.id};ui(e,l)}else((null===o||void 0===o||null===(l=o.error)||void 0===l?void 0:l.length)>0||(null===o||void 0===o||null===(n=o.message)||void 0===n?void 0:n.length)>0)&&h().error((null===o||void 0===o?void 0:o.error)||(null===o||void 0===o?void 0:o.message))})})(null===v||void 0===v?void 0:v.data);else if(o){var Se,we;console.log({orderResp:v}),(e=>{let{script:o,orderResp:l}=e;He.current=l,gi(o),pi(!0)})({script:null===v||void 0===v||null===(Se=v.data)||void 0===Se||null===(we=Se.order)||void 0===we?void 0:we.iframeUrl,orderResp:null===v||void 0===v?void 0:v.data})}else if("Razorpay"===po||"PartialPayment"===po)o?((0,L.fireGtmEvent)("pcibooking_opened",{amount:Ke,currency:null===w||void 0===w?void 0:w.currency}),(0,L.trackCheckoutFunnel)("payment_initiated",{payment_gateway:"pcibooking",amount:Ke}),(0,U.Sp)(null===v||void 0===v?void 0:v.data,null===w||void 0===w?void 0:w.id,xe,ui)):((0,L.fireGtmEvent)("razorpay_opened",{amount:Ke,currency:null===w||void 0===w?void 0:w.currency}),(0,L.trackCheckoutFunnel)("payment_initiated",{payment_gateway:"razorpay",amount:Ke}),"paytring"===(null===xe||void 0===xe?void 0:xe.superVendor)?(0,U.dc)(null===v||void 0===v?void 0:v.data,null===w||void 0===w?void 0:w.id,xe,ui):((e,o)=>{const{order:l,payment:n,voucherPayment:t}=e,a=(0,Al.V)(ke);var d=(0,i.A)((0,i.A)({key:Gl,amount:l.amount,currency:l.currency,name:null===w||void 0===w?void 0:w.name,description:"Paying ".concat(null===w||void 0===w?void 0:w.name),image:"".concat(null===w||void 0===w?void 0:w.logo,"?tr=w-1080,h-920")||0,order_id:l.id},a?{config:a}:{}),{},{handler:async function(e){console.log("Entering handler");const i={gateway:"razorpay",paymentId:n.id,razorpayOrderId:e.razorpay_order_id,razorpayPaymentId:e.razorpay_payment_id,razorpaySignature:e.razorpay_signature,hotelId:null===w||void 0===w?void 0:w.id};Dl(!1);const t=await(0,O.C8)(i);Y.A.set("isBooked",!0);try{200===(null===t||void 0===t?void 0:t.status)&&(si(Ke,null===l||void 0===l?void 0:l.currency,o,o),(0,L.trackCheckoutFunnel)("payment_completed",{payment_gateway:"razorpay",amount:Ke}))}catch(a){console.log("tagM eror",a)}},prefill:{name:$e,email:to,contact:no},notes:{address:"Hotelzify Corporate Office"},theme:{color:"#e73c00"},modal:{ondismiss:function(){var e,o,l,n,i;if(Dl(!1),Mn&&null!==t&&void 0!==t&&t.id&&(0,O.GO)({publicId:Y.A.get("publicId"),voucherPaymentId:t.id}).catch(e=>{console.log("Gift card reversal on dismiss failed",e)}),ke){const e=ke.selectedInstrument,o=e?((o,l,n,i,t,a)=>{const d=[];null!==(o=e.apps)&&void 0!==o&&o.length&&d.push(e.apps[0].replace(/_/g," ")),null!==(l=e.issuers)&&void 0!==l&&l.length&&d.push(e.issuers[0]),null!==(n=e.banks)&&void 0!==n&&n.length&&d.push(e.banks[0]),null!==(i=e.networks)&&void 0!==i&&i.length&&d.push(e.networks[0]),null!==(t=e.wallets)&&void 0!==t&&t.length&&d.push(e.wallets[0]),null!==(a=e.providers)&&void 0!==a&&a.length&&d.push(e.providers[0]);const s=e.method?"upi"===e.method?"UPI":"card"===e.method?"Card":"netbanking"===e.method?"Net Banking":e.method:"";return d.length>0?"".concat(d.join(" ")," ").concat(s).trim():s})():ke.name;S({type:T.A.SET_PAYMENT_METHOD_OFFER,payload:null}),h().info("This offer is valid only for ".concat(o,". Please use the correct payment method to avail it."))}null!==Ql&&void 0!==Ql&&Ql.couponCodes&&0!==(null===Ql||void 0===Ql||null===(e=Ql.couponCodes)||void 0===e?void 0:e.length)?(en(!0),S({type:T.A.SET_RETARGETING,payload:!0})):Eo(!0);let a={bookingObj:Y.A.get("bookingObj")||{},bookingId:Y.A.get("bookingId")||0,reason:"modal_closed"};
1document.querySelectorAll("#rzp").forEach(e=>e.remove()),document.querySelectorAll(".razorpay-container").forEach(e=>e.remove()),(0,L.fireGtmEvent)("payment_closed",{data:a}),(0,L.trackPaymentCancelled)({reason:"user_dismissed_modal",booking_id:a.bookingId,total_amount:(null===(o=a.bookingObj)||void 0===o?void 0:o.totalAmount)||(null===(l=a.bookingObj)||void 0===l?void 0:l.grandTotal)}),ci({gateway:"razorpay",amount:(null===(n=a.bookingObj)||void 0===n?void 0:n.totalAmount)||(null===(i=a.bookingObj)||void 0===i?void 0:i.grandTotal),errorCode:null,errorMessage:"Payment popup closed by user",bookingId:a.bookingId})}}}),s=new window.Razorpay(d);s.open(),s.on("payment.failed",function(e){var o,l,n,i,t,a,d,s,r;let c={bookingObj:Y.A.get("bookingObj")||{},bookingId:Y.A.get("bookingId")||0,reason:"payment_failed",error:e};(0,L.fireGtmEvent)("payment_error",{data:c}),(0,L.trackCheckoutFunnel)("payment_failed",{payment_gateway:"razorpay",amount:null===(o=c.bookingObj)||void 0===o?void 0:o.totalAmount,error_reason:null===(l=e.error)||void 0===l?void 0:l.reason}),ci({gateway:"razorpay",amount:null===(n=c.bookingObj)||void 0===n?void 0:n.totalAmount,errorCode:null===(i=e.error)||void 0===i?void 0:i.code,errorMessage:(null===(t=e.error)||void 0===t?void 0:t.description)||(null===(a=e.error)||void 0===a?void 0:a.reason),bookingId:c.bookingId}),(0,V.gp)({bookingId:Y.A.get("bookingId"),amount:null===(d=c.bookingObj)||void 0===d?void 0:d.totalAmount,gateway:"razorpay",orderId:null===(s=e.error)||void 0===s||null===(r=s.metadata)||void 0===r?void 0:r.order_id},e.error),(0,L.trackBookingFailureAnalytics)({bookingData:c.bookingObj,error:e.error,failureType:"payment_failed",failureStage:"payment_processing"}),h().error(e.error.description),console.log(e.error.reason),console.log(e.error.metadata.order_id),console.log(e.error.metadata.payment_id)})})(v.data,Le));else try{si(Ke,(null===w||void 0===w?void 0:w.currency)||"INR",Le,Le),Y.A.set("isBooked",!0)}catch(Fe){console.log("erere",Fe)}else if(400===(null===v||void 0===v?void 0:v.status)){const e=(null===v||void 0===v?void 0:v.message)||(null===v||void 0===v?void 0:v.error)||"Something went wrong. Please try again.";if(Mn)Dl(!1),h().error(e),fn(""),En(e);else{Y.A.remove("bookingId");let o=Y.A.get("err")||!1;Y.A.set("err",!0),Dl(!1),o?h().error(e):await fi()}}else{let e={bookingId:Y.A.get("bookingId")||0,bookingObj:Y.A.get("bookingObj")||{},error:v,name:$e,email:to,phone:no};(0,L.fireGtmEvent)("booking_error",e)}}else{var De,Be;let e={bookingId:Y.A.get("bookingId")||0,bookingObj:Y.A.get("bookingObj")||{},error:{name:"Order API Failed",bookingId:Le,gateway:po,partialAmount:parseFloat((Number(null===(De=We)||void 0===De||null===(Be=De.data)||void 0===Be?void 0:Be.totalAmount)*(null===jo||void 0===jo?void 0:jo.config.minPercentage)/100).toFixed(2))||0},name:$e,email:to,phone:no};(0,L.fireGtmEvent)("booking_error",e)}}catch(Fe){let e={bookingId:Y.A.get("bookingId")||0,bookingObj:Y.A.get("bookingObj")||{},error:Fe,reason:"catch_error",name:$e,email:to,phone:no};(0,L.fireGtmEvent)("booking_error",e),console.log("err",Fe,Fe.message),h().error(Fn("try_again_later")),Eo(!0)}}else{var Oe;S({type:T.A.SET_MAHARAJA_ID_ERROR,payload:!0}),Dl(!1),Re<=768&&(null===(Oe=document.getElementById("maharaja-club-section"))||void 0===Oe||Oe.scrollIntoView({behavior:"smooth",block:"center"}))}}}},[,yi]=(0,d.useState)([]),bi=e=>{"Enter"===e.code&&("name"===e.target.name?Ln.current.focus():"email"===e.target.name&&Wn.current.focus())};let ji=parseFloat(Y.A.get("tax"));"INR"!==(null===w||void 0===w?void 0:w.currency)&&(ji=0),(0,d.useEffect)(()=>{let e=JSON.parse(localStorage.getItem("phone")),o=JSON.parse(localStorage.getItem("email"));var l;((null===o||void 0===o?void 0:o.length)>0&&ao(o),(null===e||void 0===e?void 0:e.length)>0)&&(io(e),Hn.current&&(null===(l=Hn.current)||void 0===l||l.focus()))},[]),(0,d.useEffect)(()=>{const e=async e=>{console.log({event:e}),console.log("Payment callback received:",e.data);try{let n=e.data;if("string"===typeof n&&n.startsWith("{")&&(n=JSON.parse(n)),console.log("Parsed data:",n),console.log("Message type:",n.messageType),"CardSubmitSuccess"===n.messageType){var o,l;const e=He.current;if(!e)return console.error("PCIBooking order response not found"),h().error("Payment c
1onfirmation failed"),void _i();const i=null===(o=n)||void 0===o?void 0:o.cardToken,t=/\/api\/payments\/paycard\/([a-f0-9]{32})/,a=i.match(t),d=a?a[1]:null,s={gateway:"pcibooking",paymentId:null===e||void 0===e||null===(l=e.payment)||void 0===l?void 0:l.id,pciBookingData:n,pciBookingToken:d,vendor:"pcibooking",superVendor:null===an||void 0===an?void 0:an.superVendor,hotelId:null===w||void 0===w?void 0:w.id};_i(),ui(e,s)}else"CardSubmitFailed"===n.messageType||"CardSubmitCancelled"===n.messageType?(_i(),"CardSubmitFailed"===n.messageType?(console.error("Payment failed:",n.message||"Payment processing failed"),h().error(n.message||"Payment failed. Please try again."),(0,L.trackCheckoutFunnel)("payment_failed",{payment_gateway:"pcibooking",error_reason:n.message}),ci({gateway:"pcibooking",errorMessage:n.message})):(console.log("Payment cancelled by user"),h().info("Payment cancelled")),yl(!0),Dl(!1)):"payment_failed"===n.type&&(_i(),console.error("Payment failed:",n.message),h().error("Payment failed. Please try again."),yl(!0),Dl(!1),(0,L.trackCheckoutFunnel)("payment_failed",{payment_gateway:"pcibooking",error_reason:n.message}),ci({gateway:"pcibooking",errorMessage:n.message}))}catch(n){console.error("Error handling payment callback:",n)}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[null===an||void 0===an?void 0:an.superVendor,null===w||void 0===w?void 0:w.id]);const ki=null===(t=a()(null===le||void 0===le?void 0:le.startDate))||void 0===t?void 0:t.subtract(null!==(p=null===fe||void 0===fe?void 0:fe.cutoff)&&void 0!==p?p:0,"days").isSameOrAfter(a()());(0,d.useEffect)(()=>{(async()=>{try{if(null!==w&&void 0!==w&&w.id){var e,o,l;const n=await(0,O.yJ)(null===w||void 0===w?void 0:w.id);200===(null===n||void 0===n?void 0:n.status)&&null!==(null===n||void 0===n?void 0:n.data)&&Array.isArray(null===n||void 0===n||null===(e=n.data)||void 0===e?void 0:e.couponCodes)&&(null===n||void 0===n||null===(o=n.data)||void 0===o||null===(l=o.couponCodes)||void 0===l?void 0:l.length)>0&&Zl(null===n||void 0===n?void 0:n.data)}}catch(n){console.error("Error fetching discount:",n)}})()},[null===w||void 0===w?void 0:w.id]),(0,d.useEffect)(()=>{const e=Ge.current;if(!e)return;const o=new IntersectionObserver(e=>{let[o]=e;hn(e=>o.isIntersecting?2:e)},{threshold:.15});return o.observe(e),()=>o.disconnect()},[]),(0,d.useEffect)(()=>{null!==$e&&void 0!==$e&&$e.trim()&&no&&null!==to&&void 0!==to&&to.trim()?hn(2):hn(e=>2===e?1:e)},[$e,no,to]);const Ci=(0,d.useMemo)(()=>{var e,o,l,n,i;const t="PartialPayment"===po?(null!==(e=+(null===jo||void 0===jo||null===(o=jo.config)||void 0===o?void 0:o.minPercentage))&&void 0!==e?e:100)/100:1,a=ve&&!ue?(Te.appliedDiscount.discount>0?Te.priceAfterDiscount+(null===Te||void 0===Te?void 0:Te.totalAddonCost)+(null!==w&&void 0!==w&&w.isTaxIncluded?0:Te.rpTax)+(null===(l=Te.taxObj)||void 0===l?void 0:l.totalBookingTax):Te.rpPrice+(null!==w&&void 0!==w&&w.isTaxIncluded?0:Te.rpTax)+(null===(n=Te.taxObj)||void 0===n?void 0:n.totalBookingTax))*t:(Ee.totalPrice+Math.abs(Ee.totalTax+(null===(i=Ee.taxObj)||void 0===i?void 0:i.totalBookingTax)))*t,d=Mn?parseFloat(gn.amount||0):0;return Math.max(0,a-d).toFixed(2)},[ve,ue,null===(_=Ee.taxObj)||void 0===_?void 0:_.totalBookingTax,Ee.totalPrice,Ee.totalTax,null===jo||void 0===jo||null===(x=jo.config)||void 0===x?void 0:x.minPercentage,po,Te.appliedDiscount.discount,Te.priceAfterDiscount,Te.rpPrice,Te.rpTax,null===(f=Te.taxObj)||void 0===f?void 0:f.totalBookingTax,null===Te||void 0===Te?void 0:Te.totalAddonCost,Mn,gn.amount]);return(0,R.jsxs)("div",{className:re.A.checkoutPage,children:[(0,R.jsxs)(r.m,{children:[(0,R.jsx)("meta",{name:"robots",content:"noindex,nofollow"}),(0,R.jsx)("meta",{name:"googlebot",content:"noindex,nofollow"}),(0,R.jsxs)("title",{children:["Checkout - ",(null===w||void 0===w?void 0:w.name)||"Hotel Booking"]})]}),(0,R.jsxs)("div",{className:re.A.rowContainer,children:[(0,R.jsx)("div",{className:re.A.checkoutProgress,children:[{label:"Your Selection",step:0},{label:"Your Details",step:1},{label:"Finish Booking",step:2}].map((e,o,l)=>{let{label:n,step:i}=e;const t=!!(null!==$e&&void 0!==$e&&$e.trim()&&no&&null!==to&&void 0!==to&&to.trim()),a=0===i||1===i&&t,s=1===i&&!t||2===i&&t;return(0,R.jsxs)(d.Fragment,{children:[(0,R.jsxs)("div",{className:"".concat(re.A.progressStep," ").concat(a?re.A.progressStep__done:""," ").concat(s?re.A.progressStep__active:""),children:[(0,R.jsx)("div",{className:re.A.progressStep__circle,children:a?(0,R.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",children:(0,R.jsx)("path",{d:"M2.5 7L5.5 10L11.5 4",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})}):(0,R.jsx)("span",{children:i+1})}),(0,R.jsx)("span",{className:re.A.progressStep__label,children:n})]}),o<l.length-1&&(0,R.jsx)("div",{className:"".concat(re.A.progressConnector," ").concat(0===i||1===i&&t?re.A.progressConnector__filled:"")})]},i)})}),(0,R.jsxs)("div",{className:re.A.boxContainer,children:[(0,R.jsxs)("div",{className:re.A.leftBoxContainer,children:[null!==Ie&&void 0!==Ie&&Ie.length?(0,R.jsx)("div",{className:re.A.addons_section,children:(0,R.jsx)(Ko,{HotelAddons:Ie})}):null,vn.length>0&&(0,R.jsx)(bl,{messages:vn,childCount:Vl}),(0,R.jsxs)("div",{className:re.A.guestFormBox,children:[(0,R.jsxs)("div",{className:re.A.formInputContainer,children:[(0,R.jsx)("h3",{children:"Contact Details"}),(0,R.jsxs)("div",{className:re.A.formRowBox,children:[(0,R.jsxs)("div",{className:re.A.formFieldCol,children:[(0,R.jsxs)("label",{htmlFor:"checkout-phone",style:{fontSize:"0.875rem",fontWeight:500,color:"#171719"},children:["Phone Number ",(0,R.jsx)("span",{style:{color:"red"},children:"*"})]}),(0,R.jsx)(c.Ay,{id:"checkout-phone",defaultCountry:al,className:re.A.guestPhoneInput,style:{width:"100%"},placeholder:"Phone Number",value:no,ref:Wn,name:"phone",onChange:e=>{io(e),xl(!1)},onKeyPress:bi,"aria-required":"true","aria-invalid":_l||Boolean(no&&!(0,c.g0)(String(no)))?"true":"false",autoComplete:"tel"})]}),(0,R.jsxs)("div",{className:re.A.formFieldCol,children:[(0,R.jsxs)("label",{htmlFor:"checkout-email",style:{fontSize:"0.875rem",fontWeight:500,color:"#171719"},children:["Email Address ",(0,R.jsx)("span",{style:{color:"red"},children:"*"})]}),(0,R.jsx)("input",{id:"checkout-email",type:"email",ref:Ln,value:to,onChange:e=>{var o;ao(null===(o=e.target.value)||void 0===o?void 0:o.trim()),gl(!1)},name:"email",placeholder:"Email Address",onKeyPress:bi,className:re.A.guestEmailInput,style:{width:"100%"},"aria-required":"true","aria-invalid":hl?"true":"false",autoComplete:"email"})]})]})]}),(0,R.jsxs)("div",{className:re.A.formInputContainer,children:[(0,R.jsxs)("h3",{children:["Guest Details"," ",(0,R.jsx)("span",{style:{color:"red",verticalAlign:"middle"},children:"*"})]}),(0,R.jsxs)("div",{className:re.A.customerInput,children:[(0,R.jsx)("label",{htmlFor:"checkout-title",className:"visually-hidden",children:"Title (Mr/Ms/Mrs)"}),(0,R.jsxs)("select",{id:"checkout-title",name:"title",value:oo,onChange:e=>lo(e.target.value),style:{border:"none",padding:"0"},"aria-label":"Select title",children:[(0,R.jsx)("option",{value:"Male",children:"Mr"}),(0,R.jsx)("option",{value:"Female",children:"Ms"}),(0,R.jsx)("option",{value:"Female",children:"Mrs"})]}),(0,R.jsx)("label",{htmlFor:"checkout-name",className:"visually-hidden",children:"Full Name (required)"}),(0,R.jsx)("input",{id:"checkout-name",ref:Hn,type:"text",value:$e,onChange:e=>{eo(e.target.value),pl(!1)},name:"name",placeholder:"Full Name",onKeyPress:bi,"aria-required":"true","aria-invalid":ml?"true":"false",autoComplete:"name"})]})]}),No&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:re.A.formInputContainer,children:[(0,R.jsx)("h3",{children:"Tax Details (GST/VAT/Tax ID)"}),(0,R.jsx)("label",{htmlFor:"checkout-tax-details",className:"visually-hidden",children:"Tax ID (GST/VAT/etc.)"}),(0,R.jsx)("input",{id:"checkout-tax-details",type:"text",value:co,onChange:e=>
1uo(e.target.value),name:"taxDetails",placeholder:"Enter your Tax ID (GST/VAT/etc.)",className:re.A.guestEmailInput})]}),(0,R.jsxs)("div",{className:re.A.formInputContainer,children:[(0,R.jsx)("h3",{children:"Additional Email Recipients"}),(0,R.jsxs)("div",{className:re.A.emailChipsContainer,children:[(0,R.jsx)("div",{className:re.A.emailChips,children:so.filter(e=>e.trim()).map((e,o)=>(0,R.jsxs)("div",{className:re.A.emailChip,children:[(0,R.jsx)("span",{children:e}),(0,R.jsx)("button",{type:"button",onClick:()=>{const e=so.filter((e,l)=>l!==o);ro(e)},className:re.A.chipRemove,"aria-label":"Remove",children:"\xd7"})]},o))}),(0,R.jsx)("label",{htmlFor:"additional-emails-input",className:"visually-hidden",children:"Additional Email Recipients"}),(0,R.jsx)("input",{id:"additional-emails-input",type:"email",placeholder:"Type email and press Enter",className:re.A.emailChipInput,onKeyDown:e=>{if("Enter"===e.key&&e.target.value.trim()){e.preventDefault();const o=e.target.value.trim();o&&!so.includes(o)&&(ro([...so,o]),e.target.value="")}},onBlur:e=>{const o=e.target.value.trim();o&&!so.includes(o)&&(ro([...so,o]),e.target.value="")},"aria-describedby":"additional-emails-help"}),(0,R.jsx)("span",{id:"additional-emails-help",className:"visually-hidden",children:"Press Enter to add multiple email addresses"})]})]})]}),(0,R.jsxs)("div",{className:re.A.formInputContainer,children:[(0,R.jsx)("h3",{children:"Special Requests (if any)"}),(0,R.jsx)("label",{htmlFor:"checkout-special-requests",className:"visually-hidden",children:"Special Requests (optional)"}),(0,R.jsx)("textarea",{id:"checkout-special-requests",name:"requests",placeholder:"Write Here",cols:"20",rows:"5",value:Io,className:re.A.guestRequestBox,onClick:()=>(0,L.fireGtmEvent)("checkout_special_request"),onChange:e=>So(e.target.value),style:{resize:"vertical"}})]}),Se?(0,R.jsxs)("div",{className:re.A.formInputContainer,children:[(0,R.jsx)("h3",{children:"GST Invoice (optional)"}),(0,R.jsx)(J.A,{})]}):null]}),!Fl&&!ve&&(0,R.jsx)("div",{className:re.A.cancellationPolicyBox,children:(0,R.jsx)(jl.A,{cancellationPolicy:Ho,setCancellationPolicy:Lo,dateRange:le,isMiniVersion:!0,paymentProvider:xe})}),(0,R.jsxs)("div",{className:re.A.paymentsMethodBox,ref:Ge,children:[(0,R.jsx)("div",{className:re.A.paymentHeaderBox,children:(0,R.jsxs)("p",{className:re.A.paymentTitle,children:[Fn("payment_methods"),No&&Co&&(0,R.jsxs)("span",{style:{fontSize:"0.75rem",color:"#6366f1",marginLeft:"10px",fontWeight:"normal",fontStyle:"italic"},children:["(",Co.name,")"]})]})}),(0,R.jsxs)("div",{className:re.A.totalSummaryBox,children:[(0,R.jsx)("p",{children:"Amount to be paid"}),(0,R.jsx)("span",{children:ve&&!ue?(0,R.jsx)("span",{style:{color:"#000000",fontWeight:"700",fontSize:"1.1rem"},children:(0,R.jsx)(H.A,{amount:Math.max(0,(Te.appliedDiscount.discount>0?Te.priceAfterDiscount+(null===Te||void 0===Te?void 0:Te.totalAddonCost)+(null!==w&&void 0!==w&&w.isTaxIncluded?0:Te.rpTax)+(null===(y=Te.taxObj)||void 0===y?void 0:y.totalBookingTax):Te.rpPrice+(null!==w&&void 0!==w&&w.isTaxIncluded?0:Te.rpTax)+(null===(b=Te.taxObj)||void 0===b?void 0:b.totalBookingTax))-$n)})}):(0,R.jsx)("span",{style:{color:"#494545",fontWeight:"700",fontSize:"1.1rem"},children:(0,R.jsx)(H.A,{amount:Math.max(0,Ee.totalPrice+Math.abs(Ee.totalTax+(null===(j=Ee.taxObj)||void 0===j?void 0:j.totalBookingTax))-$n)})})})]}),Tn&&(0,R.jsxs)("div",{style:{margin:"16px 0",padding:"20px",background:"#ffffff",borderRadius:"16px",boxShadow:"0 4px 20px rgba(0,0,0,0.04)",border:"1px solid rgba(0,0,0,0.05)",width:"100%",boxSizing:"border-box"},children:[(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},children:[(0,R.jsx)("div",{style:{background:"linear-gradient(135deg, #e3f2fd, #bbdefb)",padding:"8px",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,R.jsx)("img",{src:Pl,alt:"gift card",width:22,height:22})}),(0,R.jsx)("p",{style:{fontWeight:700,fontSize:"1.05rem",color:"#1c1c1e",margin:0},children:"Have a Gift Card, Redeem Here"})]}),Mn?(0,R.jsxs)("div",{style:{background:"linear-gradient(135deg, #f1f8e9, #dcedc8)",borderRadius:"12px",padding:"16px 18px",border:"1px solid rgba(104, 159, 56, 0.2)"},children:[(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,R.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[(0,R.jsx)("span",{style:{fontWeight:700,color:"#33691e",fontSize:"0.95rem"},children:"Gift Card Applied"}),(0,R.jsxs)("div",{style:{fontSize:"0.85rem",color:"#558b2f",fontWeight:500},children:["****",gn.cardNumber.slice(-4)," \u2022 Applied amount: ",(0,G.Gl)(null===w||void 0===w?void 0:w.currency),gn.amount]}),In&&(0,R.jsxs)("div",{style:{fontSize:"0.8rem",color:"#558b2f"},children:["Available balance: ",(0,G.Gl)(null===w||void 0===w?void 0:w.currency),In.balance,(0,R.jsx)("div",{children:"Enter Gift Card amount to be used for this booking."})]})]}),(0,R.jsxs)("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[!Cn&&(0,R.jsx)("button",{onClick:()=>{An(!0),Pn(gn.amount),En("")},style:{background:"rgba(26, 115, 232, 0.12)",color:"#1a73e8",border:"none",borderRadius:"8px",padding:"7px 14px",cursor:"pointer",fontSize:"0.85rem",fontWeight:600,transition:"background 0.2s"},children:"Edit"}),(0,R.jsx)("button",{onClick:()=>{Rn(!1),Sn(null),fn(""),An(!1),Pn(""),_n({cardNumber:"",amount:""})},style:{background:"rgba(198, 40, 40, 0.1)",color:"#c62828",border:"none",borderRadius:"8px",padding:"8px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"background 0.2s"},title:"Remove","aria-label":"Remove Gift Card",children:(0,R.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,R.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),Cn&&(0,R.jsxs)("div",{style:{marginTop:"14px"},children:[(0,R.jsx)("input",{type:"text",inputMode:"decimal",value:Nn,onChange:e=>{/^\d*\.?\d*$/.test(e.target.value)&&(Pn(e.target.value),En(""))},autoFocus:!0,style:{width:"100%",padding:"11px 14px",background:"#fff",border:"1px solid rgba(0,0,0,0.12)",borderRadius:"10px",fontSize:"0.95rem",color:"#1c1c1e",outlineColor:"#1a73e8",boxSizing:"border-box",marginBottom:"10px"}}),(0,R.jsxs)("div",{style:{display:"flex",gap:"10px"},children:[(0,R.jsx)("button",{onClick:()=>{const e=parseFloat(Nn);if(!e||e<=0)return void En("Please enter a valid amount");if(e>parseFloat((null===In||void 0===In?void 0:In.balance)||0))return void En("Amount exceeds available balance");if(e>Math.round(Qn))return void En("Amount exceeds booking total");const o=Qn-e;o>0&&o<1?En("Please redeem the full amount, or leave at least \u20b91 to pay separately"):(_n(o=>(0,i.A)((0,i.A)({},o),{},{amount:e.toFixed(2)})),An(!1),En(""))},style:{flex:1,padding:"11px 14px",background:"linear-gradient(135deg, #1a73e8, #0056b3)",color:"#fff",border:"none",borderRadius:"10px",cursor:"pointer",fontSize:"0.9rem",fontWeight:600,boxShadow:"0 4px 12px rgba(26,115,232,0.3)"},children:"Redeem"}),(0,R.jsx)("button",{onClick:()=>{An(!1),En("")},style:{flex:1,padding:"11px 14px",background:"rgba(0,0,0,0.06)",color:"#48484a",border:"none",borderRadius:"10px",cursor:"pointer",fontSize:"0.9rem",fontWeight:600},children:"Cancel"})]}),Bn&&(0,R.jsx)("div",{style:{color:"#c62828",fontSize:"0.82rem",marginTop:"8px",fontWeight:500},children:Bn})]})]}):(0,R.jsxs)("div",{children:[(0,R.jsxs)("div",{style:{display:"flex",gap:"10px",marginBottom:"12px"},children:[(0,R.jsx)("input",{type:"text",placeholder:"Enter Gift Card Number",value:gn.cardNumber,onChange:e=>{_n(o=>(0,i.A)((0,i.A)({},o),{},{cardNumber:e.target.value.trim()})),Sn(null),En("")},style:{flex:1,minWidth:0,padding:"12px 14px",background:"#f4f5f7",border:"1px solid rgba(0,0,0,0.06)",borderRadius:"10px",fontSize:"0.95rem",color:"#1c1c1e",outlineColor:"#1a73e8"}}),(0,R.jsx)("button",{onClick:()=>
1{gn.cardNumber.trim()?(En(""),bn(!0)):En("Please enter a card number")},disabled:wn||!gn.cardNumber.trim(),style:{flexShrink:0,padding:"12px 16px",background:wn||!gn.cardNumber.trim()?"#e0e0e0":"linear-gradient(135deg, #1a73e8, #0056b3)",color:wn||!gn.cardNumber.trim()?"#9e9e9e":"#ffffff",border:"none",borderRadius:"10px",cursor:wn||!gn.cardNumber.trim()?"not-allowed":"pointer",fontSize:"0.9rem",fontWeight:600,whiteSpace:"nowrap",boxShadow:wn||!gn.cardNumber.trim()?"none":"0 4px 12px rgba(26,115,232,0.3)"},children:wn?"Checking...":"Apply"})]}),Bn&&(0,R.jsxs)("div",{style:{background:"#ffebee",color:"#c62828",padding:"10px 14px",borderRadius:"8px",fontSize:"0.85rem",fontWeight:500,marginTop:"4px",display:"flex",alignItems:"center",gap:"6px"},children:[(0,R.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,R.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,R.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),Bn]})]})]}),!Zn&&(0,R.jsxs)(R.Fragment,{children:["razorpay"===(null===xe||void 0===xe?void 0:xe.vendor)&&Jo&&(0,R.jsxs)("div",{className:re.A.securePaymentBox,children:[(0,R.jsx)("span",{children:"Payments secured by"}),(0,R.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/razorpay_logo.svg.svg",alt:"razorpay"})]}),(0,R.jsxs)("div",{className:re.A.paymentContainer,children:["paidyet"===(null===xe||void 0===xe?void 0:xe.vendor)?(0,R.jsx)("div",{children:(0,R.jsx)(se.A,{email:to,isScriptLoaded:fl,amount:ve&&!ue?(Te.appliedDiscount.discount>0?Te.priceAfterDiscount+(null!==w&&void 0!==w&&w.isTaxIncluded?0:Te.rpTax)+Te.taxObj.totalBookingTax:Te.rpPrice+(null!==w&&void 0!==w&&w.isTaxIncluded?0:Te.rpTax)+Te.taxObj.totalBookingTax).toFixed((0,U.S2)(null===w||void 0===w?void 0:w.currency)):(Ee.totalPrice+Math.abs(Ee.totalTax)).toFixed((0,U.S2)(null===w||void 0===w?void 0:w.currency))})}):sn?(0,R.jsxs)("div",{className:re.A.paymentOptions,children:[[1,2].map(e=>(0,R.jsxs)("div",{className:re.A.paymentOption,style:{opacity:.6,pointerEvents:"none",position:"relative",overflow:"hidden"},children:[(0,R.jsx)("div",{style:{width:"40px",height:"40px",backgroundColor:"#e0e0e0",borderRadius:"8px",animation:"pulse 1.5s ease-in-out infinite"}}),(0,R.jsx)("div",{style:{flex:1},children:(0,R.jsx)("div",{style:{width:"120px",height:"16px",backgroundColor:"#e0e0e0",borderRadius:"4px",animation:"pulse 1.5s ease-in-out infinite"}})})]},e)),(0,R.jsx)("style",{children:"\n                        @keyframes pulse {\n                          0%, 100% { opacity: 1; }\n                          50% { opacity: 0.5; }\n                        }\n                      "})]}):(0,R.jsxs)("div",{className:re.A.paymentOptions,role:"radiogroup","aria-label":"Payment methods",children:[(0===(null===go||void 0===go?void 0:go.length)||(null===go||void 0===go?void 0:go.some(e=>2===(null===e||void 0===e?void 0:e.gatewayId))))&&(0,R.jsxs)("div",{role:"radio","aria-checked":"COD"===po,tabIndex:"0",onClick:()=>Xn("COD"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Xn("COD"))},className:"COD"===po?re.A.selectedPaymentOption:re.A.paymentOption,children:["COD"===po&&(0,R.jsx)("img",{src:Sl,alt:"selected payment option",className:re.A.selectedPay}),(0,R.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/images/cod.svg",alt:"pay at property"}),(0,R.jsxs)("p",{children:[ai("2",Fn("pay_at_property")),"pcibooking"===(null===an||void 0===an?void 0:an.vendor)&&(0,R.jsx)("span",{style:{display:"block",color:"#000",fontSize:"12px",fontWeight:"normal"},children:"Credit card information required"})]})]}),(null===go||void 0===go?void 0:go.some(e=>1===(null===e||void 0===e?void 0:e.gatewayId)))&&(0,R.jsxs)("div",{role:"radio","aria-checked":"Razorpay"===po,tabIndex:"0",onClick:()=>Xn("Razorpay"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Xn("Razorpay"))},className:"Razorpay"===po?re.A.selectedPaymentOption:re.A.paymentOption,children:["Razorpay"===po&&(0,R.jsx)("img",{src:Sl,alt:"selected payment option",className:re.A.selectedPay}),(0,R.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/images/rzpimg.svg",alt:"pay now"}),null!==go&&void 0!==go&&go.some(e=>2===(null===e||void 0===e?void 0:e.gatewayId))||null!==go&&void 0!==go&&go.some(e=>3===(null===e||void 0===e?void 0:e.gatewayId))||null!==go&&void 0!==go&&go.some(e=>4===e.gatewayId)&&ki?(0,R.jsx)("p",{children:Fn("pay_full_amount")}):(0,R.jsx)("p",{children:"Pay Now"})]}),(null===go||void 0===go?void 0:go.some(e=>3===(null===e||void 0===e?void 0:e.gatewayId)))&&(0,R.jsxs)("div",{role:"radio","aria-checked":"PartialPayment"===po,tabIndex:"0",onClick:()=>Xn("PartialPayment"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Xn("PartialPayment"))},className:"PartialPayment"===po?re.A.selectedPaymentOption:re.A.paymentOption,children:["PartialPayment"===po&&
1(0,R.jsx)("img",{src:Sl,alt:"selected payment option",className:re.A.selectedPay}),(0,R.jsx)("img",{src:Il,alt:"pay partial",width:30,height:30}),(0,R.jsxs)("p",{children:[Fn("pay_just")," ",null===jo||void 0===jo||null===(k=jo.config)||void 0===k?void 0:k.minPercentage,"%"," ",Fn("now_to_reserve")]})]}),(null===go||void 0===go?void 0:go.some(e=>4===e.gatewayId))&&ki&&(0,R.jsxs)("div",{onClick:()=>Xn("BNPL"),className:"BNPL"===po?re.A.selectedPaymentOption:re.A.paymentOption,children:["BNPL"===po&&(0,R.jsx)("img",{src:Sl,alt:"selected payment option",className:re.A.selectedPay}),(0,R.jsx)("img",{src:Il,alt:"pay partial",width:30,height:30}),(0,R.jsx)("p",{children:"Book Now Pay Later"})]})]}),"BNPL"===po&&(0,R.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",margin:"16px 0",lineHeight:"32px"},className:re.A.bnplMessageContainer,children:[(0,R.jsx)("img",{width:50,height:50,className:re.A.bnplSuccessIcon,src:"https://ik.imagekit.io/hotelzifyprod/assets/images/success.svg",alt:"success icon"}),(0,R.jsxs)("h6",{className:re.A.bnplMessage,children:["Settle your payment anytime before"," ",(0,R.jsxs)("span",{style:{fontWeight:600},children:[null===(C=a()(null===le||void 0===le?void 0:le.startDate))||void 0===C?void 0:C.subtract(null!==(A=null===fe||void 0===fe?void 0:fe.cutoff)&&void 0!==A?A:0,"days").format("LLL")," "]}),(0,R.jsx)("br",{className:re.A.bnplLineBreak})," to secure your booking. No rush, we've got you covered!"]})]})]})]})]})]}),(0,R.jsxs)("div",{className:re.A.rightBoxContainer,children:[(0,Ye.DF)(be,Fe.i.CHECKOUT.FLASH_SALE_CARD)&&(0,R.jsx)("div",{className:re.A.flash_sale,children:(0,R.jsx)(Oe,{hotelData:w,isHourlyRoom:ue,hourlyTime:me,hourlyDate:pe,hourlyHour:he,dateRange:le,dateCount:ne,addHoursToTime:U.D4})}),(0,R.jsxs)("div",{className:re.A.paymentSummary_section,children:[(0,R.jsx)(Cl.A,{paymentOption:po,hasOnlinePayment:null===go||void 0===go?void 0:go.some(e=>{var o;return 1===(null===e||void 0===e||null===(o=e.Gateway)||void 0===o?void 0:o.id)}),onSelectOnlinePayment:()=>Xn("Razorpay"),totalAmount:(Te.appliedDiscount.discount>0?Te.priceAfterDiscount:Te.rpPrice)+Te.rpTax+(Te.taxObj.totalBookingTax||0),stayNights:ne}),(0,R.jsx)(Fo,{isRatePlans:ve,priceCalculator:Te,oldPriceCalculator:Ee,extraPrice:1,giftCardApplied:Mn,giftCard:gn})]}),vi?null:(0,R.jsx)(ce.A,{})]})]})]}),(0,R.jsxs)("div",{className:"checkoutPage__button fixed",children:[(0,R.jsxs)("div",{className:"checkout__button_pyment",children:[(0,R.jsx)("span",{children:(0,R.jsx)("span",{style:{color:"#494545",fontWeight:"700",fontSize:"1.1rem"},children:(0,R.jsx)(H.A,{amount:Number(Ci)})})}),(0,R.jsxs)("div",{className:"checkOutPage_paymentMethodContainer",children:[(0,R.jsx)("p",{children:"Razorpay"===po?"Pay now":"COD"===po?ai("2","Pay at Property"):"BNPL"===po?"Book Now Pay Later":"PartialPayment"===po?(0,R.jsxs)(R.Fragment,{children:[Fn("pay_just")," ",null===jo||void 0===jo||null===(N=jo.config)||void 0===N?void 0:N.minPercentage,"%"," ",Fn("now_to_reserve")]}):""}),(0,R.jsxs)("div",{className:"checkOutPage_paymentMethods_box",onClick:()=>{(0,L.fireGtmEvent)("clicked_checkout_edit_payment_method"),Ge.current.scrollIntoView({behavior:"smooth",block:"start"})},children:[(0,R.jsx)("img",{src:"https://ik.imagekit.io/hotelzifyprod/assets/svg/edit_btn_chkout.svg",alt:"edit_payment_method"}),(0,R.jsx)("span",{className:"checkOutPage_paymentMethod_desk",children:"Edit Payment Mode"}),(0,R.jsx)("span",{className:"checkOutPage_paymentMethod_chng",children:"Change"})]})]})]}),(0,R.jsx)("button",{className:dl?" checkoutPage__bookNow reduceWidth newBG":" checkoutPage__bookNow reduceWidth",style:{display:"flex",justifyContent:"center",alignItems:"center"},disabled:wl||Z||Ml||sn,onClick:()=>{xi()},children:(0,R.jsxs)("div",{className:"checkout_bookNow_content",children:[Z?(0,R.jsx)(Q.A,{}):(0,kl.ZN)(null===w||void 0===w?void 0:w.userId,"Complete Booking"),(0,R.jsx)(zo.A,{className:"checkoutPage_bokNow_arrow"})]})})]}),(0,R.jsx)(Xo.A,{isOpen:mi,onClose:_i,paymentUrl:hi,onPaymentSuccess:e=>{console.log("Payment success",e)},onPaymentFailure:e=>{console.log("Payment failure",e)}}),Wo&&(0,R.jsx)("div",{className:"checkoutPageShowWhy",children:(0,R.jsxs)("div",{className:"checkoutPageShowWhyContainer",children:[(0,R.jsxs)("ul",{children:[(0,R.jsx)("div",{className:"showWhyHeader",children:Fn("why_book_direct")}),(0,R.jsxs)("li",{children:[Fn("book_directly_message")," \ud83d\udc51"]}),(0,R.jsxs)("li",{children:[Fn("booking_directly_message")," \ud83d\ude42"]}),(0,R.jsxs)("li",{children:[Fn("payment_options_message")," \ud83d\ude42"]})]}),(0,R.jsx)("div",{className:"showWhyClose",onClick:()=>{Vo(!Wo),Wo?(0,L.fireGtmEvent)("book_why_closed"):(0,L.fireGtmEvent)("book_why_opened")},children:"X"})]})}),ul&&(0,R.jsx)("div",{className:"checkoutPageShowWhy",children:(0,R.jsxs)("div",{className:"checkoutPageShowWhyContainer",children:[(0,R.jsxs)("ul",{children:[(0,R.jsx)("div",{className:"showWhyHeader",children:Fn("disclaimer")}),(0,R.jsx)("p",{style:{fontSize:"14px"},children:Fn("disclaimer_text")})]}),(0,R.jsx)("div",{className:"showWhyClose",onClick:()=>vl(!1),children:"X"})]})}),(0,R.jsx)(B,{show:Bo,onClose:()=>Eo(!1),retargetingPopupConfig:null===be||void 0===be||null===(P=be.pages)||void 0===P||null===(I=P.checkout)||void 0===I?void 0:I.retargetingPopup,feedbackText:Yo,onFeedbackTextChange:Go,onFeedbackSubmit:async()=>
1{if(0===(null===Yo||void 0===Yo?void 0:Yo.length))return void h().info(Fn("add_reason_suggestions"));const e={bookingId:(null===Y.A||void 0===Y.A?void 0:Y.A.get("bookingId"))||205,reasons:[{id:14,reason:"others "+Yo}]};200===(await(0,O.aK)(e)).status&&(h().success(Fn("thank_you_response")),yi([]),Go("")),Eo(!1)}}),nn&&Ql&&(0,R.jsx)(ee,{coupon:Ql,onComplete:()=>{tn(!1)},isRetargeting:!0,duration:1e4}),$l&&(0,R.jsx)("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100dvh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"3000"},children:(0,R.jsxs)("div",{style:{backgroundColor:"#fff",padding:"17px",borderRadius:"10px",textAlign:"center",boxShadow:"0px 4px 10px rgba(0, 0, 0, 0.2)",width:Re<540?"80vw":"500px",marginBottom:"20px"},children:[(0,R.jsx)("img",{style:{marginLeft:"97%",marginTop:"-20px",cursor:"pointer"},src:"https://ik.imagekit.io/hotelzifyprod/assets/images/close.svg",onClick:()=>{ln(!1),en(!1)},alt:"close"}),(0,R.jsxs)("h2",{style:{marginTop:"-10px",fontSize:Re>=540?"23px":"20px"},children:["Wait a Second!",(0,R.jsx)("br",{})," We have"," ",(0,R.jsx)("span",{style:{color:"var(--blue)"},children:"something special"})," ","for you"]}),(0,R.jsxs)("p",{style:{marginTop:"5px"},children:[" ","Here's an extra"," ","string"===typeof(null===Ql||void 0===Ql?void 0:Ql.discountType)&&null!==Ql&&void 0!==Ql&&Ql.discountType.includes("fixed")?(0,R.jsxs)("b",{children:[(0,R.jsx)("strong",{style:{color:"var(--blue)"},children:(0,R.jsx)(H.A,{amount:Math.floor((Number(null===Ql||void 0===Ql?void 0:Ql.discount)||0)*(Number(ne)||0)*(Array.isArray(D)&&(null===D||void 0===D?void 0:D.length)>0?null===D||void 0===D?void 0:D.length:Array.isArray(M)&&(null===M||void 0===M?void 0:M.length)>0?null===M||void 0===M?void 0:M.length:0))})})," "]}):(0,R.jsxs)("b",{children:[(0,R.jsxs)("strong",{style:{color:"var(--blue)"},children:[Math.floor(Number(null===Ql||void 0===Ql?void 0:Ql.discount)||0),"% discount"]})," "]}),"to complete your booking."]}),(0,R.jsx)("img",{src:Pl,alt:"Gift box"}),(0,R.jsx)("div",{style:{width:"fit-content",height:"fit-content",margin:"auto",marginBottom:"20px",marginTop:"20px",alignContent:"center",padding:"5px 20px 5px 20px",border:"2px dotted var(--blue)"},className:"testBluecolor",children:(0,R.jsxs)("p",{style:{margin:"auto"},children:[" ",null===Ql||void 0===Ql?void 0:Ql.couponCodes]})}),(0,R.jsxs)("button",{style:{background:on?"#4caf50":"var(--blue)",color:"white",padding:"10px 20px",border:"none",borderRadius:"5px",cursor:"pointer",transition:"background-color 0.3s"},onClick:()=>{var e;S({type:T.A.SET_RETARGETING,payload:!0});const o=Array.isArray(null===Ql||void 0===Ql?void 0:Ql.couponCodes)?null===Ql||void 0===Ql||null===(e=Ql.couponCodes)||void 0===e?void 0:e.join(", "):"";navigator.clipboard.writeText(o).then(()=>{ln(!0)}).catch(e=>console.error("Failed to copy: ",e))},children:[on?(0,R.jsxs)("div",{style:{display:"flex"},children:[(0,R.jsx)("svg",{style:{marginRight:"8px",width:"20px",height:"20px"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,R.jsx)("polyline",{points:"20 6 9 17 4 12"})}),(0,R.jsx)("span",{children:"Copied"})]}):(0,R.jsx)("span",{children:"Copy promo code"})," "]}),(0,R.jsx)("p",{style:{fontSize:"13px",marginTop:"10px",textDecoration:"underline",color:"var(--blue)",cursor:"pointer"},onClick:()=>{en(!1),Eo(!0)},children:"Share your feedback and win an Amazon voucher worth Rs 500"})]})}),To&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("style",{children:"\n            @keyframes rm2-overlay-in {\n              from { opacity: 0; }\n              to   { opacity: 1; }\n            }\n            @keyframes rm2-card-in {\n              0%   { opacity: 0; transform: translateY(28px) scale(0.97); }\n              100% { opacity: 1; transform: translateY(0) scale(1); }\n            }\n            @keyframes rm2-line-expand {\n              from { transform: scaleX(0); }\n              to   { transform: scaleX(1); }\n            }\n            @keyframes rm2-num-in {\n              0%   { opacity: 0; transform: translateY(16px); }\n              100% { opacity: 1; transform: translateY(0); }\n            }\n            @keyframes rm2-fade-up {\n              from { opacity: 0; transform: translateY(8px); }\n              to   { opacity: 1; transform: translateY(0); }\n            }\n            @keyframes rm2-ripple {\n              0%   { transform: scale(0.6); opacity: 0.5; }\n              100% { transform: scale(2.4); opacity: 0; }\n            }\n            @keyframes rm2-shimmer {\n              0%   { background-position: -200% center; }\n              100% { background-position: 200% center; }\n            }\n            @keyframes rm2-pulse-ring {\n              0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue-solid, #0078d4) 35%, transparent); }\n              70%  { box-shadow: 0 0 0 14px color-mix(in srgb, var(--blue-solid, #0078d4) 0%, transparent); }\n              100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue-solid, #0078d4) 0%, transparent); }\n            }\n            .rm2-overlay { animation: rm2-overlay-in 0.28s ease forwards; }\n            .rm2-card    { animation: rm2-card-in 0.48s cubic-bezier(0.22,1,0.36,1) forwards; }\n            .rm2-divider { transform-origin: left; animation: rm2-line-expand 0.55s cubic-bezier(0.22,1,0.36,1) 0.2s both; }\n            .rm2-num     { animation: rm2-num-in 0.5s cubic-bezier(0.22,1,0.36,1) 0.12s both; }\n            .rm2-t1 { animation: rm2-fade-up 0.38s ease 0.28s both; }\n            .rm2-t2 { animation: rm2-fade-up 0.38s ease 0.38s both; }\n            .rm2-t3 { animation: rm2-fade-up 0.38s ease 0.48s both; }\n            .rm2-cta{ animation: rm2-fade-up 0.38s ease 0.56s both; }\n            .rm2-icon-ring { animation: rm2-pulse-ring 1.8s ease 0.6s infinite; }\n            .rm2-shimmer-num {\n              background: linear-gradient(\n                90deg,\n                var(--blue-solid, #0078d4) 0%,\n                color-mix(in srgb, var(--blue-solid, #0078d4) 55%, #fff) 30%,\n                color-mix(in srgb, var(--blue-solid, #0078d4) 20%, #fff) 50%,\n                color-mix(in srgb, var(--blue-solid, #0078d4) 55%, #fff) 70%,\n                var(--blue-solid, #0078d4) 100%\n              );\n              background-size: 200% auto;\n              -webkit-background-clip: text;\n              -webkit-text-fill-color: transparent;\n              background-clip: text;\n              animation: rm2-shimmer 2.6s linear 0.5s infinite;\n            }\n            .rm2-ripple-circle {\n              position: absolute;\n              inset: 0;\n              border-radius: 50%;\n              background: color-mix(in srgb, var(--blue-solid, #0078d4) 18%, transparent);\n              animation: rm2-ripple 1.5s ease-out 0.5s forwards;\n            }\n            .rm2-cta-btn {\n              transition: opacity 0.18s, transform 0.15s;\n            }\n            .rm2-cta-btn:hover  { opacity: 0.88; transform: translateY(-1px); }\n            .rm2-cta-btn:active { transform: translateY(0); }\n            .rm2-close-btn { transition: background 0.15s, color 0.15s; }\n            .rm2-close-btn:hover {\n              background: color-mix(in srgb, var(--blue-solid, #0078d4) 12%, transparent) !important;\n              color: var(--blue-solid, #0078d4) !important;\n            }\n          "}),(0,R.jsx)("div",{className:"rm2-overlay",style:{position:"fixed",inset:0,backgroundColor:"rgba(0,10,26,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:3e3,padding:"16px",boxSizing:"border-box",backdropFilter:"blur(8px)"},onClick:()=>Oo(!1),children:(0,R.jsxs)("div",{className:"rm2-card",style:{backgroundColor:"#fff",borderRadius:"24px",width:"100%",maxWidth:"400px",position:"relative",overflow:"hidden",boxShadow:"0 32px 80px rgba(0,30,80,0.22)"},onClick:e=>e.stopPropagation(),children:[(0,R.jsx)("div",{style:{height:"4px",background:"var(--blue)"}}),(0,R.jsx)("div",{style:{position:"absolute",top:"-60px",right:"-60px",width:"220px",height:"220px",borderRadius:"50%",background:"radial-gradient(circle, color-mix(in srgb, var(--blue-solid, #0078d4) 10%, transparent) 0%, transparent 70%)",pointerEvents:"none"}}),(0,R.jsx)("button",{className:"rm2-close-btn",onClick:()=>Oo(!1),style:{position:"absolute",top:"18px",right:"18px",background:"#f4f4f4",border:"none",cursor:"pointer",color:"var(--blue-solid, #0078d4)",lineHeight:0,padding:"8px",borderRadius:"50%"},children:(0,R.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,R.jsx)("path",{d:"M1 1L9 9M9 1L1 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}),(0,R.jsxs)("div",{style:{padding:"40px 36px 36px",textAlign:"center"},children:[(0,R.jsx)("div",{className:"rm2-t1",style:{marginBottom:"24px"},children:(0,R.jsxs)("div",{className:"rm2-icon-ring",style:{width:"72px",height:"72px",borderRadius:"50%",background:"color-mix(in srgb, var(--blue-solid, #0078d4) 10%, #fff)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto",position:"relative"},children:[(0,R.jsx)("div",{className:"rm2-ripple-circle"}),(0,R.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:[(0,R.jsx)("circle",{cx:"16",cy:"16",r:"15",stroke:"var(--blue-solid, #0078d4)",strokeWidth:"1.5",fill:"none"}),(0,R.jsx)("path",{d:"M9 16L14 21L23 11",stroke:"var(--blue-solid, #0078d4)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})]})}),(0,R.jsx)("div",{className:"rm2-t1",style:{fontFamily:"var(--volte, 'Jakarta', sans-serif)",fontSize:"10px",fontWeight:600,letterSpacing:"0.18em",textTransform:"uppercase",color:"var(--blue-solid, #0078d4)",marginBottom:"12px"},children:"Returning Guest Reward"}),(0,R.jsx)("div",{className:"rm2-num",style:{lineHeight:1,marginBottom:"4px"},children:(0,R.jsx)("span",{className:"rm2-shimmer-num",style:{fontFamily:"var(--volte, 'Jakarta', sans-serif)",fontSize:"percentage"===(null===ye||void 0===ye?void 0:ye.discountType)?"80px":"60px",fontWeight:700,display:"inline-block",letterSpacing:"-3px"},children:"percentage"===(null===ye||void 0===ye?void 0:ye.discountType)?"".concat(null===ye||void 0===ye?void 0:ye.discount,"%"):"\u20b9".concat(null===ye||void 0===ye?void 0:ye.discount)})}),(0,R.jsx)("div",{className:"rm2-t1",style:{fontFamily:"var(--volte, 'Jakarta', sans-serif)",fontSize:"12px",fontWeight:500,letterSpacing:"0.22em",textTransform:"uppercase",color:"#aaa",marginBottom:"24px"},children:"OFF \u2014 Applied automatically"}),(0,R.jsx)("div",{className:"rm2-divider",style:{height:"1px",background:"linear-gradient(90deg, transparent, color-mix(in srgb, var(--blue-solid, #0078d4) 20%, transparent), transparent)",marginBottom:"24px"}}),(0,R.jsx)("h3",{className:"rm2-t2",style:{fontFamily:"var(--volte, 'Jakarta', sans-serif)",margin:"0 0 10px",fontSize:"20px",fontWeight:700,color:"#0a0a0a",letterSpacing:"-0.4px",lineHeight:1.25},children:"Welcome back!"}),(0,R.jsxs)("p",{className:"rm2-t3",style:{fontFamily:"var(--volte, 'Jakarta', sans-serif)",margin:"0 0 30px",fontSize:"14px",fontWeight:400,color:"#777",lineHeight:1.65},children:["We recognised you as a returning guest.",(0,R.jsx)("br",{}),"Your loyalty discount has been applied."]}),(0,R.jsx)("button",{className:"rm2-cta rm2-cta-btn",onClick:()=>Oo(!1),style:{width:"100%",padding:"15px",background:"var(--blue)",color:"#fff",border:"none",borderRadius:"12px",fontSize:"14px",fontWeight:600,fontFamily:"var(--volte, 'Jakarta', sans-serif)",letterSpacing:"0.02em",cursor:"pointer",display:"block",boxShadow:"0 6px 20px color-mix(in srgb, var(--blue-solid, #0078d4) 32%, transparent)"},children:"Continue to checkout"})]})]})})]}),yn&&(0,R.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,R.jsxs)("div",{style:{position:"relative",background:"#ffffff",borderRadius:"24px",padding:"32px 28px",width:"90%",maxWidth:"360px",boxShadow:"0 24px 48px rgba(0,0,0,0.2)",transform:"translateY(0)"},children:[(0,R.jsx)("button",{onClick:()=>{bn(!1),fn(""),kn("")},style:{position:"absolute",top:"20px",right:"20px",background:"#f4f5f7",border:"none",cursor:"pointer",color:"#6e6e73",padding:"8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%"},"aria-label":"Close",children:(0,R.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,R.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,R.jsx)("div",{style:{display:"flex",justifyContent:"center",marginBottom:"16
1px"},children:(0,R.jsx)("div",{style:{background:"linear-gradient(135deg, #e3f2fd, #bbdefb)",padding:"12px",borderRadius:"16px"},children:(0,R.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#1a73e8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,R.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,R.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})})}),(0,R.jsx)("h3",{style:{fontWeight:800,fontSize:"1.25rem",margin:"0 0 8px 0",textAlign:"center",color:"#1c1c1e"},children:"Enter Security PIN"}),(0,R.jsx)("p",{style:{color:"#6e6e73",fontSize:"0.9rem",margin:"0 0 24px 0",textAlign:"center",lineHeight:"1.5"},children:Mn?(0,R.jsxs)(R.Fragment,{children:["Please enter the PIN for gift card ending in ",(0,R.jsx)("strong",{style:{color:"#1c1c1e"},children:gn.cardNumber.slice(-4)})," to redeem ",(0,R.jsxs)("strong",{style:{color:"#2e7d32"},children:[(0,G.Gl)(null===w||void 0===w?void 0:w.currency),gn.amount]}),"."]}):(0,R.jsxs)(R.Fragment,{children:["Please enter the PIN for gift card ending in ",(0,R.jsx)("strong",{style:{color:"#1c1c1e"},children:gn.cardNumber.slice(-4)})," to continue."]})}),(0,R.jsx)("input",{type:"password",placeholder:"\u2022\u2022\u2022\u2022",value:xn,onChange:e=>{fn(e.target.value.trim()),kn("")},maxLength:10,autoFocus:!0,style:{width:"100%",padding:"14px 16px",background:"#f4f5f7",border:"1px solid ".concat(jn?"#d32f2f":"#e0e0e0"),borderRadius:"12px",fontSize:"1.2rem",textAlign:"center",letterSpacing:"6px",fontWeight:700,color:"#1c1c1e",marginBottom:jn?"8px":"24px",boxSizing:"border-box",outlineColor:"#1a73e8"}}),jn&&(0,R.jsx)("p",{style:{color:"#d32f2f",fontSize:"0.85rem",textAlign:"center",margin:"0 0 16px 0"},children:jn}),(0,R.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[(0,R.jsx)("button",{onClick:()=>{bn(!1),fn(""),kn("")},style:{flex:1,padding:"14px",background:"#f4f5f7",color:"#48484a",border:"none",borderRadius:"12px",cursor:"pointer",fontSize:"0.95rem",fontWeight:600,transition:"background 0.2s"},children:"Cancel"}),(0,R.jsx)("button",{onClick:()=>{xn.trim()&&(bn(!1),Mn?(Dl(!0),xi()):(async()=>{if(gn.cardNumber.trim()){Dn(!0),En("");try{const e=await(0,O.be)({cardNumber:gn.cardNumber,hotelId:null===w||void 0===w?void 0:w.id,cardPin:xn});null!==e&&void 0!==e&&e.data?(Sn(e.data),_n(e=>(0,i.A)((0,i.A)({},e),{},{amount:"0"})),Rn(!0),An(!0),Pn("0")):(En((null===e||void 0===e?void 0:e.error)||"Invalid gift card number or PIN. Please try again."),fn(""))}catch(t){var e,o,l,n;fn(""),En((null===t||void 0===t||null===(e=t.response)||void 0===e||null===(o=e.data)||void 0===o?void 0:o.error)||(null===t||void 0===t||null===(l=t.response)||void 0===l||null===(n=l.data)||void 0===n?void 0:n.message)||"Card not found or unavailable")}finally{Dn(!1)}}else En("Please enter a card number")})())},disabled:!xn.trim(),style:{flex:1,padding:"14px",background:xn.trim()?"linear-gradient(135deg, #1a73e8, #0056b3)":"#e0e0e0",color:xn.trim()?"#ffffff":"#9e9e9e",border:"none",borderRadius:"12px",cursor:xn.trim()?"pointer":"not-allowed",fontSize:"0.95rem",fontWeight:600,boxShadow:xn.trim()?"0 4px 12px rgba(26,115,232,0.3)":"none",transition:"all 0.2s"},children:Mn?"Verify & Pay":"Continue"})]})]})})]})})},1987:()=>{},2404:()=>{},2895:(e,o,l)=>{l.r(o),l.d(o,{default:()=>w});var n=l(5043),i=l(8601),t=l(8241),a=l(8984),d=l(7478),s=l(5346),r=l(7368),c=l(7950),u=l(7669),v=l(4117);const m="HotelAddonDetailsModal_overlay__Wg9uv",p="HotelAddonDetailsModal_modal_container__8vHaw",h="HotelAddonDetailsModal_closeButton__vdVwb",g="HotelAddonDetailsModal_image_container__+2o1N",_="HotelAddonDetailsModal_image__-9V4r",x="HotelAddonDetailsModal_modal_body__Yt8hs",f="HotelAddonDetailsModal_modal_header__3U3Ar",y="HotelAddonDetailsModal_description__5UE+m",b="HotelAddonDetailsModal_priceBox__Igf51",j="HotelAddonDetailsModal_price_wrapper__mx9O5",k="HotelAddonDetailsModal_addButton__8vLWH",C="HotelAddonDetailsModal_addonActionBtn__ECSRs",A="HotelAddonDetailsModal_addonIcon__oHWET";var N=l(579);const P=e=>{var o,l,i,t;let{addon:a,selected:s,count:r,selectAddon:P,deSelectAddon:I,closeModal:S}=e;const w=(0,n.useRef)(null),{t:D}=(0,v.Bd)(),M=null===(o=(null===a||void 0===a?void 0:a.HotelAddonImages)||(null===a||void 0===a||null===(i=a.Addon)||void 0===i?void 0:i.url))||void 0===o||null===(l=o[0])||void 0===l?void 0:l.cdnImageUrl,R=(0,n.useCallback)(()=>{S()},[S]);(0,n.useEffect)(()=>{const e=e=>{"Escape"===e.key&&R()};document.addEventListener("keydown",e);const o=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=o}},[R]);return c.createPortal((0,N.jsx)("div",{className:m,ref:w,onClick:e=>{e.target===w.current&&R()},children:(0,N.jsxs)("div",{className:p,role:"dialog","aria-modal":"true","aria-label":null===a||void 0===a?void 0:a.name,children:[(0,N.jsx)("button",{type:"button",className:h,onClick:R,"aria-label":"Close",children:(0,N.jsx)(u.A,{size:20,"aria-hidden":"true"})}),M&&(0,N.jsx)("div",{className:g,children:(0,N.jsx)("img",{src:M,alt:null===a||void 0===a?void 0:a.name,className:_})}),(0,N.jsxs)("div",{className:x,children:[(0,N.jsx)("h3",{className:f,children:null===a||void 0===a?void 0:a.name}),(0,N.jsx)("div",{className:y,dangerouslySetInnerHTML:{__html:null===a||void 0===a?void 0:a.description}}),(0,N.jsxs)("div",{className:b,children:[(0,N.jsxs)("div",{className:j,children:[(0,N.jsxs)("p",{children:[(0,N.jsx)(d.A,{amount:null===a||void 0===a?void 0:a.price})," ","per_day"===(null===a||void 0===a||null===(t=a.Addon)||void 0===t?void 0:t.multiplier)?"/ day":""]}),(0,N.jsx)("span",{children:D("incl_of_taxes")})]}),s?(0,N.jsxs)("div",{className:C,role:"group","aria-label":"Quantity controls for ".concat(null===a||void 0===a?void 0:a.name),children:[(0,N.jsx)("span",{className:A,onClick:I,"aria-label":"Decrease ".concat(null===a||void 0===a?void 0:a.name," quantity"),children:"-"}),(0,N.jsx)("span",{"aria-live":"polite","aria-atomic":"true",children:r}),(0,N.jsx)("span",{className:A,onClick:P,"aria-label":"Increase ".concat(null===a||void 0===a?void 0:a.name," quantity"),children:"+"})]}):(0,N.jsx)("button",{type:"button",className:k,onClick:P,"aria-label":"Add ".concat(null===a||void 0===a?void 0:a.name),children:D("add")})]})]})]})}),document.getElementById("root"))};l(2404);var I=l(801),S=l(1184);const w=e=>{var o,l;let{addon:c,isCheckout:u=!1}=e;
1const[m,p]=(0,n.useState)(!1),[h,g]=(0,n.useState)(0),[_,x]=(0,n.useState)(!1),[f,y]=(0,n.useState)(!1),b=(0,n.useRef)(null),{hotelData:j,selectedHotelAddons:k,selectedRooms:C,selectedRatePlans:A,totalAdult:w,totalChild:D,dateCount:M}=(0,i.d4)(e=>e.hotelInfo),{width:R}=(0,r.A)(),B=!u,E="guest_based"===(null===c||void 0===c||null===(o=c.Addon)||void 0===o?void 0:o.multiplier),{childrenCount:T}=(0,I.VF)({selectedRooms:C,selectedRatePlans:A,totalAdult:w,totalChild:D});(0,n.useEffect)(()=>{var e;g(null===k||void 0===k?void 0:k.filter(e=>(null===e||void 0===e?void 0:e.id)===(null===c||void 0===c?void 0:c.id)).length),(null===k||void 0===k||null===(e=k.filter(e=>(null===e||void 0===e?void 0:e.id)===(null===c||void 0===c?void 0:c.id))[0])||void 0===e?void 0:e.id)===(null===c||void 0===c?void 0:c.id)?p(!0):p(!1)},[k]),(0,n.useLayoutEffect)(()=>{if(!B)return;const e=b.current;e&&x(e.scrollHeight>e.clientHeight+1)},[null===c||void 0===c?void 0:c.description,B]);const O=(0,i.wA)(),Y=()=>{var e,o,l;h<(E?1:10)&&(O((0,a.qO)(c)),(0,s.fireGtmEvent)("hotel_addon_selected",{addon_id:null===c||void 0===c?void 0:c.addonId,addon_name:null===c||void 0===c||null===(e=c.Addon)||void 0===e?void 0:e.name,is_hotel_addon_images:(null===c||void 0===c||null===(o=c.HotelAddonImages)||void 0===o?void 0:o.length)>0,hotel_addon_images_count:null===c||void 0===c||null===(l=c.HotelAddonImages)||void 0===l?void 0:l.length,value:null===c||void 0===c?void 0:c.price}))},F=()=>{var e,o,l;h>0&&(O((0,a.xy)(c)),(0,s.fireGtmEvent)("hotel_addon_removed",{addon_id:null===c||void 0===c?void 0:c.addonId,addon_name:null===c||void 0===c||null===(e=c.Addon)||void 0===e?void 0:e.name,is_hotel_addon_images:(null===c||void 0===c||null===(o=c.HotelAddonImages)||void 0===o?void 0:o.length)>0,hotel_addon_images_count:null===c||void 0===c||null===(l=c.HotelAddonImages)||void 0===l?void 0:l.length,value:null===c||void 0===c?void 0:c.price}))},{t:z}=(0,v.Bd)();return(0,N.jsxs)("div",{className:u&&R>900?"checkoutAddon":B?"hotelAddonCard":"hAddon",id:"hAddon",children:[(0,N.jsx)("div",{className:"hAddonImage",children:(0,N.jsx)(t.A,{name:c.Addon.name,hotelImages:(null===c||void 0===c?void 0:c.HotelAddonImages)||(null===c||void 0===c||null===(l=c.Addon)||void 0===l?void 0:l.url),isAddon:!0})}),(0,N.jsxs)("div",{className:u&&R>900?"newCheckoutAdon":B?"hotelAddonCardBody":"",children:[(0,N.jsx)("h3",{className:"hAddonName",children:null===c||void 0===c?void 0:c.name}),(0,N.jsx)("div",{className:"hAddonDescription",ref:b,style:{border:u&&R>900&&"none"},dangerouslySetInnerHTML:{__html:c.description}}),B&&_&&(0,N.jsx)("span",{className:"hAddonViewMore",onClick:()=>y(!0),children:z("view_more")}),(0,N.jsxs)("div",{className:"hAddonPrice",children:[(0,N.jsxs)("div",{className:B?"hAddonPriceBox":"",children:[E?(0,N.jsxs)("div",{className:"hAddonGuestPrice",children:[(0,N.jsxs)("p",{className:"hAddonGuestPriceRow",children:[(0,N.jsx)(d.A,{amount:null===c||void 0===c?void 0:c.price}),(0,N.jsxs)("span",{className:"hAddonGuestPriceLabel",children:[z("adult")," / ",z("night")]})]}),T>0&&(0,N.jsxs)("p",{className:"hAddonGuestPriceRow",children:[(0,N.jsx)(d.A,{amount:null===c||void 0===c?void 0:c.childPrice}),(0,N.jsxs)("span",{className:"hAddonGuestPriceLabel",children:[z("child")," / ",z("night")]})]})]}):(0,N.jsxs)("p",{children:[(0,N.jsx)(d.A,{amount:null===c||void 0===c?void 0:c.price})," ","per_day"===c.Addon.multiplier?"/ day":"",!B&&(0,N.jsxs)("span",{style:{fontWeight:"400",fontSize:"0.7rem"},children:[" ","(",z("incl_of_taxes"),")"]})]}),B&&(0,N.jsx)("span",{className:"hAddonUnit",children:z("incl_of_taxes")})]}),E?m?(0,N.jsx)("button",{type:"button",className:"addonRemoveIconBtn",onClick:F,"aria-label":"Remove ".concat(null===c||void 0===c?void 0:c.name),children:(0,N.jsx)(S.A,{size:16})}):(0,N.jsx)("div",{className:B?"hotelAddonAddBtn":"hAddonAdd hAddonAddHotel",onClick:()=>Y(),children:z("add")}):m?(0,N.jsxs)("div",{className:B?"hotelAddonAddedBtn":"hAddonAdded",children:[(0,N.jsx)("span",{className:B?"hotelAddonQtyIcon":"hAddonIcon",onClick:F,children:"-"}),h,(0,N.jsx)("span",{className:B?"hotelAddonQtyIcon":"hAddonIcon",onClick:Y,children:"+"})]}):(0,N.jsx)("div",{className:B?"hotelAddonAddBtn":"hAddonAdd hAddonAddHotel",onClick:()=>Y(),children:z("add")})]}),h>0&&"per_day"===c.Addon.multiplier&&!u&&(0,N.jsxs)("div",{className:"hAddonNote",children:[h," ",null===c||void 0===c?void 0:c.name," ",z("is_selected_for")," ",(0,N.jsxs)("b",{children:[M," ",z("days")]})]})]}),B&&f&&(0,N.jsx)(P,{addon:c,selected:m,count:h,selectAddon:Y,deSelectAddon:F,closeModal:()=>y(!1)})]})}},4392:(e,o,l)=>{l.d(o,{A:()=>n});const n={checkoutPage:"CheckoutPage_checkoutPage__-O5PY",boxContainer:"CheckoutPage_boxContainer__TIkOP",leftBoxContainer:"CheckoutPage_leftBoxContainer__dd8n1",rightBoxContainer:"CheckoutPage_rightBoxContainer__Z0XqB",roomPreviewCard:"CheckoutPage_roomPreviewCard__gA3uY",roomPreviewImage:"CheckoutPage_roomPreviewImage__yl2uo",roomPreviewInfo:"CheckoutPage_roomPreviewInfo__Ehw8P",roomPreviewHotelName:"CheckoutPage_roomPreviewHotelName__Xvygi",roomPreviewAddress:"CheckoutPage_roomPreviewAddress__SVRec",roomPreviewRooms:"CheckoutPage_roomPreviewRooms__V7KgJ",roomPreviewChip:"CheckoutPage_roomPreviewChip__R99of",roomPreviewChipImage:"CheckoutPage_roomPreviewChipImage__2eS9W",roomPreviewChipText:"CheckoutPage_roomPreviewChipText__AGNlJ",leftTopBox:"CheckoutPage_leftTopBox__cxIwJ",timeContainer:"CheckoutPage_timeContainer__xRKPi",time:"CheckoutPage_time__2UL3S",dateCount:"CheckoutPage_dateCount__95UVP",previewRoomContainer:"CheckoutPage_previewRoomContainer__GuD6e",previewRoom:"CheckoutPage_previewRoom__4iI0C",previewRoomName:"CheckoutPage_previewRoomName__7PfC4",previewRoomimage:"CheckoutPage_previewRoomimage__9BZIf",previewRoomInfo:"CheckoutPage_previewRoomInfo__tWSNt",leftBottomBox:"CheckoutPage_leftBottomBox__uCt2n",guestFormBox:"CheckoutPage_guestFormBox__lZFQ8",cancellationPolicyBox:"CheckoutPage_c
1ancellationPolicyBox__UuYPh",paymentsMethodBox:"CheckoutPage_paymentsMethodBox__xHXM5",guestInfoContainer:"CheckoutPage_guestInfoContainer__fqsCK",customerInput:"CheckoutPage_customerInput__lT2eO",rightBottomContainer:"CheckoutPage_rightBottomContainer__dsRX6",checkoutPage__selectedRoomsHeading:"CheckoutPage_checkoutPage__selectedRoomsHeading__jGrXK",checkoutPage__bill:"CheckoutPage_checkoutPage__bill__6VWjq",finalBill:"CheckoutPage_finalBill__9+aUX",checkoutPage__warningContainer:"CheckoutPage_checkoutPage__warningContainer__wDYIJ",paymentMethods:"CheckoutPage_paymentMethods__-QWHn",paymentTitle:"CheckoutPage_paymentTitle__OEjsW",paymentOptions:"CheckoutPage_paymentOptions__jVxfG",bnplMessageContainer:"CheckoutPage_bnplMessageContainer__0ukfI","blur-in":"CheckoutPage_blur-in__MNdWM",paymentOption:"CheckoutPage_paymentOption__YpvBa",selectedPaymentOption:"CheckoutPage_selectedPaymentOption__npqLc",selectedPay:"CheckoutPage_selectedPay__r7hDv",paymentContainer:"CheckoutPage_paymentContainer__E6ld7",paymentBtn:"CheckoutPage_paymentBtn__5nul9",displayPromo:"CheckoutPage_displayPromo__Blu6K",bnplMessage:"CheckoutPage_bnplMessage__VzfLj",summaryHeadingContainer:"CheckoutPage_summaryHeadingContainer__pxEVI",summaryWrapper:"CheckoutPage_summaryWrapper__3uHga",summaryHeading:"CheckoutPage_summaryHeading__6XXrH",formInputContainer:"CheckoutPage_formInputContainer__aAvud",formRowBox:"CheckoutPage_formRowBox__0et4A",formFieldCol:"CheckoutPage_formFieldCol__Tvcph",guestPhoneInput:"CheckoutPage_guestPhoneInput__PUKw9",guestRequestBox:"CheckoutPage_guestRequestBox__j63kw",guestEmailInput:"CheckoutPage_guestEmailInput__d1UWR",emailChipsContainer:"CheckoutPage_emailChipsContainer__Z4Ffu",emailChips:"CheckoutPage_emailChips__Yu3EY",emailChip:"CheckoutPage_emailChip__Gw1PZ",chipFadeIn:"CheckoutPage_chipFadeIn__BPCep",chipRemove:"CheckoutPage_chipRemove__jGgrj",emailChipInput:"CheckoutPage_emailChipInput__2GqDs",paymentHeaderBox:"CheckoutPage_paymentHeaderBox__yzwWA",securePaymentBox:"CheckoutPage_securePaymentBox__opIT2",totalSummaryBox:"CheckoutPage_totalSummaryBox__w8IAm",rowContainer:"CheckoutPage_rowContainer__sD1jK",flash_sale:"CheckoutPage_flash_sale__9VoVi",addons_section:"CheckoutPage_addons_section__gSYgZ",paymentSummary_section:"CheckoutPage_paymentSummary_section__9aTWb",AddonSection:"CheckoutPage_AddonSection__CpQXs",customerRow:"CheckoutPage_customerRow__7E4en",bnplSuccessIcon:"CheckoutPage_bnplSuccessIcon__uqExN",b
1nplLineBreak:"CheckoutPage_bnplLineBreak__Mnl5d",checkoutProgress:"CheckoutPage_checkoutProgress__Ukp7D",progressStep:"CheckoutPage_progressStep__KmN8q",progressStep__circle:"CheckoutPage_progressStep__circle__gekrp",progressStep__label:"CheckoutPage_progressStep__label__32vnn",progressStep__done:"CheckoutPage_progressStep__done__Kks+j",progressStep__active:"CheckoutPage_progressStep__active__JIQKr",progressConnector:"CheckoutPage_progressConnector__Jxc1r",progressConnector__filled:"CheckoutPage_progressConnector__filled__N8PjE",verticalProgress:"CheckoutPage_verticalProgress__40i9b",vProgressStep:"CheckoutPage_vProgressStep__YhgFG",vProgressStep__circle:"CheckoutPage_vProgressStep__circle__JX1G1",vProgressStep__label:"CheckoutPage_vProgressStep__label__Cyl5w",vProgressStep__done:"CheckoutPage_vProgressStep__done__P5fnk",vProgressStep__active:"CheckoutPage_vProgressStep__active__Hur7h",vProgressConnector:"CheckoutPage_vProgressConnector__Vjgvc",vProgressConnector__filled:"CheckoutPage_vProgressConnector__filled__BIX9t",petTnc:"CheckoutPage_petTnc__+WoJ7",petTncTitle:"CheckoutPage_petTncTitle__p+95X",petTncText:"CheckoutPage_petTncText__-JB2M"}},9368:(e,o,l)=>{l.d(o,{A:()=>a});var n=l(6177),i=l(475),t=l(579);const a=()=>{const{isConverted:e,effectiveCurrency:o,hotelCurrency:l}=(0,n.A)();return e?(0,t.jsxs)("div",{style:{background:"#FFF8E1",border:"1px solid #FFE082",borderRadius:"8px",padding:"10px 14px",margin:"10px 0",fontSize:"13px",color:"#5D4037",display:"flex",alignItems:"center",gap:"8px"},children:[(0,t.jsx)("span",{style:{fontSize:"16px"},children:"\u24d8"}),(0,t.jsxs)("span",{children:["Prices shown in ",o," (",(0,i.Gl)(o),"). You will be charged in"," ",l," (",(0,i.Gl)(l),")."]})]}):null}}}]);
2//# sourceMappingURL=6264.2d5acd1c.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.