PageSourceSearch

https://www.xelha.com/_next/static/chunks/3185.d8517ee9aa661c98.js

js xelha.com collected 2026-09-24 22:24:01 UTC 32,634 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3185],{96146:function(e,a,t){var s=t(52676),l=t(30967),i=t(9353),n=t(13306);a.Z=e=>{let{actionButton:a,children:t,language:r,isShow:d,onOpen:c,onClose:o,withCloseButton:u,size:x,reference:f,zIndexClass:p}=e;return(0,n.N)()?(0,l.createPortal)((0,s.jsx)(i.Z,{actionButton:a,language:r,isShow:d,onOpen:c,onClose:o,withCloseButton:u,size:x,ref:f,zIndexClass:p,children:t}),document.getElementById("main-portal")):null}},3185:function(e,a,t){t.r(a),t.d(a,{default:function(){return L}});var s=t(52676),l=t(75271),i=t(51218),n=t.n(i),r=t(40507),d=t.n(r),c=t(93858),o=t(54932),u=t(32571),x=t(91873),f=t(55642),p=t(67703),h=t(17998),m=t(16015),g=t(33139),j=t.n(g),b=t(82172),v=t(80583),y=t(52661),N=t(96146);let S=e=>{let{itemLabels:a,product:t,pricePaxes:l,changePaxes:i,paxes:r,onClickSave:d,setDateSelected:o,canSelectSchedule:u,setScheduleSelected:x,availableSchedules:f,dateSelected:p,scheduleSelected:h,canSelectTransportation:m,transportationLoading:g,setTransportationSelected:S,transportationSelected:C,availableLocations:q,pickupLoading:P,setPickupSelected:R,pickupSelected:O,pickupPlaces:w,totalPrice:A,modalRef:k,errorValidation:D,isEdit:I,onClickEdit:L,allowedCustomers:Y,refModalCanvas:E,messagePromo:M,actionButton:T,currentPromotionApplied:B,tourOnly:G}=e,U=I?a.editPurchase:a.addPurchase,Z=t.hasUpgrade?t.nameUpgrade:t.name,F=!!Y&&Y.Adults,_=!!Y&&Y.Children,H=!!Y&&Y.Infants,z=n()(p).format("YYYY-MM-DD")===n()().format("YYYY-MM-DD")&&""!==C;return(0,s.jsxs)(s.Fragment,{children:[B&&(0,s.jsx)(N.Z,{size:"small",reference:E,actionButton:T,children:M}),(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 ancillaries-form",children:[(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex items-center px-4 justify-center",children:(0,s.jsx)("span",{className:"jsx-24a55fe671a91697 text-base text-center font-semibold",children:U})}),(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex items-center px-4 mb-2",children:(0,s.jsx)("h4",{className:"jsx-24a55fe671a91697 uppercase text-left font-semibold text-2xl my-2",children:Z})}),(0,s.jsxs)("form",{className:"jsx-24a55fe671a91697",children:[(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 flex",children:[F&&(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-1/3 flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"adult",className:"jsx-24a55fe671a91697 flex justify-start items-end text-sm text-shopping-theme mb-1",children:[a.adultPlural,": ",(0,s.jsx)(y.default,{amount:l.beforePrice.adult})]}),(0,s.jsx)(b.Z,{id:"adult",nameAttr:"adult",onChange:e=>i(1,Number(e.target.value)),className:"w-full bg-gray-200 text-gray-700 rounded h-10 px-2",maxPax:20,singular:a.adultSingular,plural:a.adultPlural,controlled:!0,value:r[0].quantity})]}),_&&(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-1/3 flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"children",className:"jsx-24a55fe671a91697 flex justify-start items-end text-sm text-shopping-theme mb-1",children:[a.childPlural,": ",(0,s.jsx)(y.default,{amount:l.beforePrice.young})]}),(0,s.jsx)(b.Z,{id:"children",nameAttr:"children",onChange:e=>i(2,Number(e.target.value)),className:"w-full bg-gray-200 text-gray-700 rounded h-10 px-2",maxPax:20,singular:a.childSingular,plural:a.childPlural,controlled:!0,value:r[1].quantity,children:(0,s.jsx)("option",{value:"",className:"jsx-24a55fe671a91697",children:a.childNot})})]}),H&&(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-1/3 flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"infants",className:"jsx-24a55fe671a91697 flex justify-start items-end text-sm text-shopping-theme mb-1",children:[a.infantPlural,": ",a.free]}),(0,s.jsx)(b.Z,{id:"infants",nameAttr:"infants",onChange:e=>i(3,Number(e.target.value)),className:"w-full bg-gray-200 text-gray-700 rounded h-10 px-2",maxPax:20,singular:a.infantSingular,plural:a.infantPlural,controlled:!0,value:r[2].quantity,children:(0,s.jsx)("option",{value:"",className:"jsx-24a55fe671a91697",children:a.infantNot})})]})]}),(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 flex mt-2",children:[(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-1/3 flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"text",className:"jsx-24a55fe671a91697 flex justify-start items-end text-sm text-shopping-theme mb-1",children:[a.calendarLabel,":"]}
1),(0,s.jsx)(v.Z,{nameAttr:"date",classIcon:"text-shopping-cart",className:"w-full bg-gray-200 text-gray-700 rounded h-10 px-2",productId:t.id,onChange:e=>{let a=n()(e).toISOString();o(a)},value:p,noCustomization:!0})]}),m&&(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 field w-1/3 flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"text",className:"jsx-24a55fe671a91697 flex justify-start items-end text-sm text-shopping-theme mb-1",children:[a.transportLabel,":",g&&(0,s.jsx)(c.G,{icon:"spinner",spin:!0})]}),(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 input-group relative",children:[(0,s.jsxs)("select",{id:"pickupName",onChange:e=>S(e.target.value),name:"pickupName",value:C,disabled:!1,className:"jsx-24a55fe671a91697 bg-gray-200 w-full text-gray-700 rounded h-10 px-2",children:[!G&&(0,s.jsx)("option",{value:"",className:"jsx-24a55fe671a91697",children:g?"":a.transportNot}),q.map(e=>(0,s.jsx)("option",{value:e.id,className:"jsx-24a55fe671a91697",children:e.name},e.id))]}),(0,s.jsx)(c.G,{className:"icon text-shopping-theme mr-3 absolute shopping-icon",icon:"bus"})]})]}),u&&C&&(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 field w-1/3 flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"schedule",className:"jsx-24a55fe671a91697 flex justify-start items-end text-sm text-shopping-theme mb-1",children:[a.scheduleLabel,":"]}),(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 input-group relative",children:[(0,s.jsx)("select",{id:"schedule",onChange:e=>x(e.target.value),name:"schedule",value:h,className:"jsx-24a55fe671a91697 bg-gray-200 w-full text-gray-700 rounded h-10 px-2",children:f.map(e=>(0,s.jsx)("option",{value:e.schedule,className:"jsx-24a55fe671a91697",children:e.schedule},e.schedule))}),(0,s.jsx)(c.G,{className:"icon text-shopping-theme mr-3 absolute shopping-icon",icon:"clock"})]})]})]}),(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex mt-2",children:C&&(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-1/3 flex flex-col px-4",children:[(0,s.jsxs)("label",{className:"jsx-24a55fe671a91697 flex justify-start items-end text-sm text-shopping-theme mb-1",children:[a.hotelLabel,":",P&&(0,s.jsx)(c.G,{icon:"spinner",spin:!0})]}),(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 input-group relative",children:[(0,s.jsxs)("select",{name:"hotelName",disabled:P,value:O,onChange:e=>{R(e.target.value)},className:"jsx-24a55fe671a91697 "+"w-full bg-gray-200 text-sm text-gray-700 rounded h-10 px-2 ".concat(D.hotelClassError),children:[(0,s.jsx)("option",{value:"",className:"jsx-24a55fe671a91697",children:a.hotelDefault}),Array.isArray(w)&&w.map((e,a)=>{let{PickUps:t}=e,l=t.find((e,a)=>0===a);return l?(0,s.jsxs)("option",{value:l.Id,className:"jsx-24a55fe671a91697",children:[e.Name," - ",l.Time]},a):null})]}),(0,s.jsx)(c.G,{className:"icon text-shopping-theme mr-3 absolute shopping-icon",icon:"hotel"})]})]})}),z&&(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex mt-4 justify-center",children:a.transportDisabledSameDay}),A&&A>0&&(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 flex mt-8 justify-center items-end text-2xl font-semibold uppercase",children:[(0,s.jsx)("span",{className:"jsx-24a55fe671a91697 mr-2",children:"TOTAL:"}),(0,s.jsx)(y.default,{amount:A})]}),(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 flex mt-8",children:[(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 w-1/2",children:(0,s.jsx)("button",{onClick:()=>k.current.closeModal(),type:"button",className:"jsx-24a55fe671a91697 mr-2 w-full text-sm rounded px-3 py-2 border focus:outline-none uppercase",children:a.cancel})}),(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 w-1/2",children:(0,s.jsx)("button",{onClick:()=>I?L():d(),type:"button",disabled:z,className:"jsx-24a55fe671a91697 "+"ml-2 w-full text-sm rounded px-3 py-2 focus:outline-none uppercase ".concat(z?"text-gray-700 bg-gray-200":"text-bg-theme bg-shopping-theme"),children:a.saveLabel})})]})]}),(0,s.jsx)(j(),{id:"24a55fe671a91697",children:".input-group.jsx-24a55fe671a91697 .shopping-icon{top:25%;right:0}"})]})]})};S.propTypes={itemLabels:d().instanceOf(Object).isRequired,product:d().instanceOf(Object).isRequired,pricePaxes:d().instanceOf(Object).isRequired,changePaxes:d().func.isRequired,paxes:d().instanceOf(Array).isRequired,onClickSave:d().func.isRequired,setDateSelected:d().func.isRequired,canSelectSchedule:d().bool.isRequired,setScheduleSelected:d().func.isRequired,availableSchedules:d().instanceOf(Array).isRequired,dateSelected:d().string.isRequired,scheduleSelected:d().string.isRequired,canSelectTrans
1portation:d().bool.isRequired,transportationLoading:d().bool.isRequired,setTransportationSelected:d().func.isRequired,transportationSelected:d().oneOfType([d().number,d().string]).isRequired,availableLocations:d().instanceOf(Array).isRequired,pickupLoading:d().bool.isRequired,setPickupSelected:d().func.isRequired,pickupSelected:d().string.isRequired,pickupPlaces:d().instanceOf(Array).isRequired,modalRef:d().instanceOf(Object).isRequired,errorValidation:d().instanceOf(Object).isRequired,totalPrice:d().number.isRequired,isEdit:d().bool.isRequired,onClickEdit:d().func.isRequired,allowedCustomers:d().instanceOf(Object),refModalCanvas:d().instanceOf(Object).isRequired,messagePromo:d().element.isRequired,actionButton:d().element.isRequired,currentPromotionApplied:d().bool.isRequired,tourOnly:d().bool},S.defaultProps={allowedCustomers:null,tourOnly:!1};let C=e=>{let{itemLabels:a,product:t,pricePaxes:l,changePaxes:i,paxes:r,onClickSave:d,setDateSelected:o,canSelectSchedule:u,setScheduleSelected:x,availableSchedules:f,dateSelected:p,scheduleSelected:h,canSelectTransportation:m,transportationLoading:g,setTransportationSelected:S,transportationSelected:C,availableLocations:q,pickupLoading:P,setPickupSelected:R,pickupSelected:O,pickupPlaces:w,totalPrice:A,offCanvasRef:k,errorValidation:D,isEdit:I,onClickEdit:L,allowedCustomers:Y,refModalCanvas:E,messagePromo:M,actionButton:T,currentPromotionApplied:B,tourOnly:G}=e,U=I?a.editPurchase:a.addPurchase,Z=t.hasUpgrade?t.nameUpgrade:t.name,F=!!Y&&Y.Adults,_=!!Y&&Y.Children,H=!!Y&&Y.Infants,z=n()(p).format("YYYY-MM-DD")===n()().format("YYYY-MM-DD")&&""!==C;return(0,s.jsxs)(s.Fragment,{children:[B&&(0,s.jsx)(N.Z,{size:"small",reference:E,actionButton:T,children:M}),(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 ancillarie-form-mobile",children:[(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex justify-center items-center w-full px-4 ",children:(0,s.jsx)("span",{className:"jsx-24a55fe671a91697 text-lg text-center font-semibold",children:U})}),(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex justify-start items-center px-4 mb-2",children:(0,s.jsx)("h4",{className:"jsx-24a55fe671a91697 uppercase text-left font-semibold text-2xl my-2",children:Z})}),F&&(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex mb-4",children:(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-full flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"adult",className:"jsx-24a55fe671a91697 text-left text-sm text-shopping-theme mb-1",children:[a.adultPlural,": ",(0,s.jsx)(y.default,{amount:l.salePrice.adult})]}),(0,s.jsx)(b.Z,{id:"adult",nameAttr:"adult",onChange:e=>i(1,Number(e.target.value)),className:"w-full bg-gray-200 text-gray-700 rounded h-10 px-2",maxPax:20,singular:a.adultSingular,plural:a.adultPlural,controlled:!0,value:r[0].quantity})]})}),_&&(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex mb-4",children:(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-full flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"children",className:"jsx-24a55fe671a91697 text-left text-sm text-shopping-theme mb-1",children:[a.childPlural,": ",(0,s.jsx)(y.default,{amount:l.salePrice.young})]}),(0,s.jsx)(b.Z,{id:"children",nameAttr:"children",onChange:e=>i(2,Number(e.target.value)),controlled:!0,value:r[1].quantity,className:"w-full bg-gray-200 text-gray-700 rounded h-10 px-2",maxPax:20,singular:a.childSingular,plural:a.childPlural,children:(0,s.jsx)("option",{value:"",className:"jsx-24a55fe671a91697",children:a.childNot})})]})}),H&&(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex mb-4",children:(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-full flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"infants",className:"jsx-24a55fe671a91697 text-left text-sm text-shopping-theme mb-1",children:[a.infantPlural,": ",a.free]}),(0,s.jsx)(b.Z,{id:"infants",nameAttr:"infants",onChange:e=>i(3,Number(e.target.value)),controlled:!0,value:r[2].quantity,className:"w-full bg-gray-200 text-gray-700 rounded h-10 px-2",maxPax:20,singular:a.infantSingular,plural:a.infantPlural,children:(0,s.jsx)("option",{value:"",className:"jsx-24a55fe671a91697",children:a.infantNot})})]})}),(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex mb-4",children:(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-full flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"text",className:"jsx-24a55fe671a91697 text-left text-sm text-shopping-theme mb-1",children:[a.calendarLabel,":"]}
1),(0,s.jsx)(v.Z,{nameAttr:"date",classIcon:"text-shopping-cart",className:"w-full bg-gray-200 text-gray-700 rounded h-10 px-2 w-full ",productId:t.id,onChange:e=>{let a=n()(e).toISOString();o(a)},value:p})]})}),u&&C&&(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex mb-4",children:(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-full flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"schedule",className:"jsx-24a55fe671a91697 text-left text-sm text-shopping-theme mb-1",children:[a.scheduleLabel,":"]}),(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 input-group relative",children:[(0,s.jsx)("select",{id:"schedule",onChange:e=>x(e.target.value),name:"schedule",value:h,className:"jsx-24a55fe671a91697 bg-gray-200 w-full text-gray-700 rounded h-10 px-2",children:f.map(e=>(0,s.jsx)("option",{value:e.schedule,className:"jsx-24a55fe671a91697",children:e.schedule},e.schedule))}),(0,s.jsx)(c.G,{className:"icon text-shopping-theme mr-3 absolute shopping-icon",icon:"clock"})]})]})}),m&&(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex mb-4",children:(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-full flex flex-col px-4",children:[(0,s.jsxs)("label",{htmlFor:"text",className:"jsx-24a55fe671a91697 text-left text-sm text-shopping-theme mb-1",children:[a.transportLabel,":",g&&(0,s.jsx)(c.G,{icon:"spinner",spin:!0})]}),(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 input-group relative",children:[(0,s.jsxs)("select",{id:"pickupName",onChange:e=>S(e.target.value),name:"pickupName",value:C,disabled:!1,className:"jsx-24a55fe671a91697 bg-gray-200 w-full text-gray-700 rounded h-10 px-2",children:[!G&&(0,s.jsx)("option",{value:"",className:"jsx-24a55fe671a91697",children:g?"":a.transportNot}),q.map(e=>(0,s.jsx)("option",{value:e.id,className:"jsx-24a55fe671a91697",children:e.name},e.id))]}),(0,s.jsx)(c.G,{className:"icon text-shopping-theme mr-3 absolute shopping-icon",icon:"bus"})]})]})}),(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex mt-2",children:C&&(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 w-full flex flex-col px-4",children:[(0,s.jsxs)("label",{className:"jsx-24a55fe671a91697 text-left text-sm text-shopping-theme mb-1",children:[a.hotelLabel,":",P&&(0,s.jsx)(c.G,{icon:"spinner",spin:!0})]}),(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 input-group relative",children:[(0,s.jsxs)("select",{name:"hotelName",disabled:P,value:O,onChange:e=>{R(e.target.value)},className:"jsx-24a55fe671a91697 "+"w-full bg-gray-200 text-sm w-full text-gray-700 rounded h-10 px-2 ".concat(D.hotelClassError),children:[(0,s.jsx)("option",{value:"",className:"jsx-24a55fe671a91697",children:a.hotelDefault}),Array.isArray(w)&&w.map((e,a)=>{let{PickUps:t}=e,l=t.find((e,a)=>0===a);return l?(0,s.jsxs)("option",{value:l.Id,className:"jsx-24a55fe671a91697",children:[e.Name," - ",l.Time]},a):null})]}),(0,s.jsx)(c.G,{className:"icon text-shopping-theme mr-3 absolute shopping-icon",icon:"hotel"})]})]})}),z&&(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex mt-4 justify-center",children:a.transportDisabledSameDay}),A&&A>0&&(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 flex mt-8 justify-center items-end text-2xl font-semibold uppercase",children:[(0,s.jsx)("span",{className:"jsx-24a55fe671a91697 mr-2",children:"TOTAL:"}),(0,s.jsx)(y.default,{amount:A})]}),(0,s.jsxs)("div",{className:"jsx-24a55fe671a91697 flex mt-8",children:[(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex-1 mb-2 mx-1",children:(0,s.jsx)("button",{onClick:()=>k.current.closeOffCanvas(),type:"button",className:"jsx-24a55fe671a91697 mr-2 w-full text-xs rounded px-3 py-2 border focus:outline-none uppercase",children:a.cancel})}),(0,s.jsx)("div",{className:"jsx-24a55fe671a91697 flex-1 mb-2 mx-1",children:(0,s.jsx)("button",{onClick:()=>I?L():d(),type:"button",disabled:z,className:"jsx-24a55fe671a91697 "+"w-full text-xs rounded px-3 py-2 focus:outline-none uppercase ".concat(z?"text-gray-700 bg-gray-200":"text-bg-theme bg-shopping-theme"),children:a.saveLabel})})]}),(0,s.jsx)(j(),{id:"24a55fe671a91697",children:".input-group.jsx-24a55fe671a91697 .shopping-icon{top:25%;right:0}"})]})]})};C.propTypes={itemLabels:d().instanceOf(Object).isRequired,product:d().instanceOf(Object).isRequired,pricePaxes:d().instanceOf(Object).isRequired,changePaxes:d().func.isRequired,paxes:d().instanceOf(Array).isRequired,onClickSave:d().func.isRequired,setDateSelected:d().func.isRequired,canSelectSchedule:d().bool.isRequired,setScheduleSelected:d().func.isRequired,availableSchedules:d().instanceOf(Array).isRequired,dateSelected:d().string.isRequired,scheduleSelected:d().string.isRequired,canSelectTrans
1portation:d().bool.isRequired,transportationLoading:d().bool.isRequired,setTransportationSelected:d().func.isRequired,transportationSelected:d().oneOfType([d().number,d().string]).isRequired,availableLocations:d().instanceOf(Array).isRequired,pickupLoading:d().bool.isRequired,setPickupSelected:d().func.isRequired,pickupSelected:d().string.isRequired,pickupPlaces:d().instanceOf(Array).isRequired,offCanvasRef:d().instanceOf(Object).isRequired,errorValidation:d().instanceOf(Object).isRequired,totalPrice:d().number.isRequired,isEdit:d().bool.isRequired,onClickEdit:d().func.isRequired,allowedCustomers:d().instanceOf(Object),refModalCanvas:d().instanceOf(Object).isRequired,messagePromo:d().element.isRequired,actionButton:d().element.isRequired,currentPromotionApplied:d().bool.isRequired,tourOnly:d().bool},C.defaultProps={allowedCustomers:null,tourOnly:!1};var q=t(93140),P=t(89257),R=t(39890),O=t(39012);let w=[{id:1,quantity:1},{id:2,quantity:0},{id:3,quantity:0}],A=e=>{let a=n()().add(7,"day"),t=!1;if(null==e?void 0:e.Cart){var s,l,i,r;let n=(null==e?void 0:null===(s=e.Cart)||void 0===s?void 0:null===(l=s.PackageProducts)||void 0===l?void 0:l.Products)||[],d=(null==e?void 0:null===(i=e.Cart)||void 0===i?void 0:null===(r=i.IndividualProducts)||void 0===r?void 0:r.Products)||[],c=[];for(let e=0;e<n.length;e+=1)-1===c.indexOf(n[e].BookingDate)&&c.push(n[e].BookingDate);for(let e=0;e<d.length;e+=1)-1===c.indexOf(d[e].BookingDate)&&c.push(d[e].BookingDate);for(;!t;){let e=a.format("YYYY-MM-DD");-1===c.indexOf(e)?t=!0:a=a.add(1,"day")}}return a.toISOString()},k=[],D=[],I=e=>{let{modalRef:a,offCanvasRef:t,setLoading:i,setShopping:r,language:d,currency:o,currency_id:g,product:j,shopping:b,showNotification:v,itemLabels:y,isMobile:N,validation:I,infoGA4:L,metricasGA4:Y,enableCroct:E}=e,{sendEventAddToCart:M}=(0,O.Z)({language:d,currency:o,isEnabled:E}),[T,B]=(0,l.useState)(!1),[G,U]=(0,l.useState)(!1),[Z,F]=(0,l.useState)(!1),[_,H]=(0,l.useState)(!1),[z,Q]=(0,l.useState)({}),[V,K]=(0,l.useState)({}),[J,W]=(0,l.useState)(!1),[$,X]=(0,l.useState)([]),[ee,ea]=(0,l.useState)(!1),[et,es]=(0,l.useState)({}),[el,ei]=(0,l.useState)(0),[en,er]=(0,l.useState)(!1),ed=(0,l.useRef)(),[ec,eo]=(0,l.useState)(A(b)),[,eu]=(0,l.useState)(!1),[ex,ef]=(0,l.useState)([]),[ep,eh]=(0,l.useState)(""),[em,eg]=(0,l.useState)(!1),[ej,eb]=(0,l.useState)(""),[ev,ey]=(0,l.useState)(!0),[eN,eS]=(0,l.useState)(k),[eC,eq]=(0,l.useState)(!1),[eP,eR]=(0,l.useState)(D),[eO,ew]=(0,l.useState)(""),[eA,ek]=(0,l.useState)(null),[eD,eI]=(0,l.useState)({hotelClassError:""}),[eL,eY]=(0,l.useState)([{id:1,quantity:1},{id:2,quantity:0},{id:3,quantity:0}]),[eE,eM]=(0,l.useState)({beforePrice:{adult:0,young:0,infant:0},salePrice:{adult:0,young:0,infant:0},currencyId:0}),[eT,eB]=(0,l.useState)({paxAdult:{pax:1,price:0},paxChildren:{pax:0,price:0}}),[eG,eU]=(0,l.useState)(NaN),eZ=(e,a,t)=>{if(!(0,q.xb)(b)){let s,l;let i="addToCart";if("save"===e)try{let e=new P.Z(a,d,o),n=e.findProductAdded(t),r=e.convertToProductListByPax(n);s=e.generateDataLayer(i,null,null,r),Y&&Object.keys(Y).length>0&&(l=e.generateDataLayer("add_to_cart",null,null,r,L,null==Y?void 0:Y.list_complements),M("add_to_cart",{...l})),dataLayer.push(s),dataLayer.push(l)}catch(e){console.error("dataLayer ".concat(i," failed"),e.message),console.info(l),console.info(s)}}},eF=(e,a)=>{let t=eL.map(t=>t.id===e?{id:t.id,quantity:a}:t);eY(t)},e_=(e,a)=>{let t=(0,p.Ux)(e,a).NormalAdults,s=(0,p.Ux)(e,a).NormalChildren,l=(0,p.Ux)(e,a).NormalInfant,i=(0,p.Ux)(e,a).Adults,n=(0,p.Ux)(e,a).Children,r=(0,p.Ux)(e,a).Infant;eB({paxAdult:{pax:1,price:t},paxChildren:{pax:0,price:s}}),eM({beforePrice:{adult:t,young:s,infant:l},salePrice:{adult:i,young:n,infant:r},currencyId:g})},eH=async()=>{let e={...eT.paxAdult},a={...eT.paxChildren};eL&&eL.length>2&&(e.pax=eL[0].quantity,a.pax=eL[1].quantity);let t=(0,f.tf)(e,a,$,ej,0,!1,0,!1,em);eU(t)},ez=()=>{ei(0),en&&ed.current.closeModal(),es({})},eQ=(e,a)=>{i({loading:!0});let{SessionId:t}=b;(0,x.ch)(d,N,t).then(t=>{let{data:s}=t;r({shopping:s}),v(y.updateSuccess,"success"),eZ(e,s,a)}).catch(e=>{console.error(e),v(y.updateError,"danger")}).finally(()=>{i({loading:!1})})},eV=(e,s)=>{i({loading:!0}),(0,x.yK)(e).then(()=>{U(!0),N?t.current.closeOffCanvas():a.current.closeModal(),ez(),es({}),ei(0),eQ("save",s)}).catch(e=>{var a,t;console.error(e);let s=null==e?void 0:null===(a=e.response)||void 0===a?void 0:null===(t=a.data)||void 0===t?void 0:t.errors,l=[],n=[];Array.isArray(s)&&s.length>0&&(l=s[0].productAlreadyExist||[],n=s[0].productNotAvailable||[]);let r="";l.length>0?(v(y.existsError,"danger"),r=y.existsError):n.length>0?(v(y.availError,"danger"),r=y.availError):(v(y.saveError,"danger"),r=y.saveError);let d="";s.length>0&&(d=Object.keys(s[0]).find(e=>s[0][e].length>0)),(0,R.Hk)("error_message",{message:r,messageLocation:d,pageType:"Cart"}),i({loading:!1})}).finally(()=>{})},eK=e=>{if(!(0,q.xb)(b)){let{PromotionalCoupon:a,SessionId:t,Language:s,PromotionalCouponApplied:l}=b,n={Currency:o,IsMobile:N,Language:s,WithDifference:!1,PromotionalCoupon:a,SessionId:t,ShoppingCart:{Indiv
1iduals:[{AvailabilityHold:"",LastDateHold:"",BookingDate:e,BuyDate:"",GeographicLocation:0,HasPhoto:!1,IdCart:0,IdProduct:j.id,Pax:{Adults:eL[0].quantity,Children:eL[1].quantity,Infants:eL[2].quantity},Pickup:"",RateKey:"",Schedule:""}]}};i({loading:!0}),(0,x.yR)(n).then(e=>{let{data:a}=e;if(a){let{newQuote:e}=a;if(e){let{PromotionalCouponApplied:a}=e;ea(a),er(l)}}}).catch(e=>{console.error(e)}).finally(()=>{i({loading:!1})})}},eJ=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex justify-center items-center py-2",children:(0,s.jsx)("p",{className:"uppercase",children:y.cartChanged})}),(0,s.jsx)("div",{className:"flex justify-center items-center py-2 fadeIn animated",children:(0,s.jsxs)("div",{className:"border-l-4 bg-red-100 border border-red-500 px-2 py-2 rounded text-red-700 text-sm",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)(c.G,{className:"font-bold",icon:"exclamation-triangle"}),"\xa0",y.messageMergeComplements]}),(0,s.jsx)("p",{className:"font-bold",children:y.confirmContinue})]})})]}),eW=e=>{e.preventDefault(),(0,q.xb)(et)||(0,q.xb)(el)||eV(et,el)},e$=(0,s.jsxs)("div",{className:"flex justify-center items-center py-2",children:[(0,s.jsx)("div",{className:"flex-1 mx-2",children:(0,s.jsx)("button",{onClick:()=>ez(),type:"button",className:"border w-full px-3 py-2 text-sm rounded uppercase focus:outline-none",children:y.reviewBtn})}),(0,s.jsx)("div",{className:" flex-1 mx-2",children:(0,s.jsx)("button",{onClick:e=>eW(e),type:"button",className:"w-full px-3 py-2 text-sm rounded uppercase text-bg-theme bg-shopping-theme focus:outline-none",children:y.continueBtn})})]}),eX=(e,a,t,s,l)=>{i({loading:!0}),(0,h.v2)(e,a,t,s,l).then(()=>{eQ()}).catch(()=>{v(y.saveError,"danger")}).finally(()=>{i({loading:!1})})},e0=(e,a,t,s)=>{eq(!0),(0,u.sJ)(e,a,t,s).then(e=>{let{data:a}=e;eR(a)}).catch(()=>{v("No se pudo obtener lista de pickup places","danger"),eR(D)}).finally(()=>{eq(!1)})},e1=e=>{i({loading:!0}),(0,x.nM)(e).then(()=>{N?t.current.closeOffCanvas():a.current.closeModal(),eQ()}).catch(()=>{v(y.saveError,"danger")}).finally(()=>{i({loading:!1})})},e7=()=>{let e=n()(ec).format("YYYY-MM-DD");if(ej){let t=ep,s=eN.find(e=>e.id===Number(ej));if((null==s?void 0:s.schedules)&&(null==s?void 0:s.schedules.length)>0&&eh(t=null==s?void 0:s.schedules[0].Time),J)e0(j.id,e,ej,t);else{var a;e0(null==V?void 0:null===(a=V.upgrades)||void 0===a?void 0:a.transport,e,ej,t)}i({loading:!1})}},e5=async()=>{let e;if(""!==ej){let a=n()(ec).format("YYYY-MM-DD");e=J?await new Promise((e,t)=>{(0,u.OA)([j.id],d,o,a,"",N).then(async a=>{let t;let{data:s}=a,l=s.Activities,i=l.find(e=>e.Id===j.id),n=i.GeographicLocation;if(n&&n.length>0&&(t=n[0].Schedule),t&&t.length>0){let e=(0,f.ao)(n,i.Rates),a=e.find((e,a)=>0===a);eh(a.schedule),ef(e),e.length>1&&eu(!0)}let r=(0,f.Cl)(j.id,l);e({locations:r,activities:l,paxes:eL})}).catch(e=>{t(e)})}):await new Promise((e,t)=>{(0,u.OA)([V.upgrades.transport],d,o,a,"",N).then(async a=>{let t;let{data:s}=a,l=s.Activities,i=l.find(e=>e.Id===V.upgrades.transport),n=i.GeographicLocation;if(n&&n.length>0&&(t=n[0].Schedule),t&&t.length>0){let e=(0,f.ao)(n,i.Rates),a=e.find((e,a)=>0===a);eh(a.schedule),ef(e),e.length>1&&eu(!0)}let r=await (0,f.fQ)(j.id,V.upgrades.transport,l,V.upgrades);e({locations:r,activities:l,paxes:eL})}).catch(e=>{t(e)})})}return e},e6=()=>{let e=!1,a={hotelClassError:""};return""!==ej&&""===eO&&(e=!0,a.hotelClassError="border border-red-500"),eI(e=>({...e,...a})),e},e9=()=>{var e;let a=e6(),t=n()(ec).format("YYYY-MM-DD"),s=j.hasUpgrade&&!J?null==V?void 0:null===(e=V.upgrades)||void 0===e?void 0:e.transport:j.id,l=""!==eO?eO:"",i=""!==ej?ej:0,r=""!==ep?ep:"00:00:00",c="put";if(j.hasUpgrade&&""===ej&&(c="dwg"),j.hasUpgrade||""===ej||(c="upg"),!a){let e=new m.Z(b,j),a=e.isAddedInShoppingCart(),n=e.getCartID(),u={Adults:eL[0].quantity,Children:eL[1].quantity,Infants:eL[2].quantity},{SessionId:x}=b;if(T&&a){let e={SessionId:x,Language:d.toUpperCase(),Currency:o.toUpperCase(),ShoppingCart:{IdCart:n,IdProduct:s,Action:c,GeographicLocation:Number(i),Schedule:r,Pickup:l,Pax:u,BookingDate:t,HasPhoto:!1}};e1(e)}}},e2=()=>{var e;let a=""===ej||J?j.id:null==V?void 0:null===(e=V.upgrades)||void 0===e?void 0:e.transport,t=""!==eO?Number(eO):"",s=""!==ep&&""!==ej?ep:"00:00:00",l=""!==ej?ej:0,i=n()(ec).format("YYYY-MM-DD"),r=e6(),{SessionId:c,PromotionalCouponApplied:u}=b,x={Adults:eL[0].quantity,Children:eL[1].quantity,Infants:eL[2].quantity};if(!r){let e={Currency:o.toUpperCase(),Language:d.toUpperCase(),PromotionalCoupon:"",SessionId:c,ShoppingCart:{Indiv
1iduals:[{AvailabilityHold:"",BookingDate:i,BuyDate:"",GeographicLocation:Number(l),HasPhoto:!1,IdCart:0,IdProduct:a,LastDateHold:"",Pax:x,Pickup:t,RateKey:"",Schedule:s}]}};u&&!ee?(ed.current.openModal(),es(e),ei(a)):eV(e,a)}},e4=()=>{let e=new m.Z(b,j),a=e.isAddedInShoppingCart();if(a){H(!0);let a=[{id:1,quantity:e.getQuantityPaxAdult()},{id:2,quantity:e.getQuantityPaxYoung()},{id:3,quantity:e.getQuantityPaxInfant()}];eY(a);let t=e.getServiceDate(),s=n()(t).toISOString();eo(s);let l=e.hasTransportation();if(l){let a=e.getGeographicId();eb(a)}let i=e.hasSchedule();if(i){let a=e.getSchedule();eh(a)}}};return(0,l.useEffect)(()=>{if(B(!1),H(!1),Object.values(j).length>0){i({loading:!0});let e=n()(ec).format("YYYY-MM-DD");(0,u.OA)([j.id],d,o,e,"",N).then(a=>{let t;eY(w),eo(A(b)),ew(""),eR(D),eb(""),eu(!1),ef([]),eh(""),W(!1),eg(!1),(0,u.HU)({id:j.id,eq:!1,lang:d}).then(e=>{let{data:a}=e;Array.isArray(a)&&a.length>0?K(a[0]):K({id:j.id})}).catch(()=>{K({id:j.id})}).finally(()=>{e4()});let{data:s}=a,l=s.Activities;if(Q(l),e_(l),Array.isArray(l)&&l.length>0){var i;ek(null===(i=l[0])||void 0===i?void 0:i.AllowedCustomer)}let n=(0,f.Cl)(j.id,l),r=l.find(e=>e.Id===j.id),c=r.GeographicLocation;if(c&&c.length>0&&(t=c[0].Schedule),t&&t.length>0){let e=(0,f.ao)(c,r.Rates);ef(e),eu(!0),eh(e[0].schedule)}n&&n.length>0&&(W(!0),eg(!0),e0(j.id,e,n[0].id),eb(n[0].id))}).catch(()=>{}).finally(()=>{i({loading:!1}),B(!0)}),eK(e),Promise.all([])}},[j]),(0,l.useEffect)(()=>{if(T&&V.id){var e,a;let t=V.id;(null==V?void 0:null===(e=V.upgrades)||void 0===e?void 0:e.transport)&&(t=null==V?void 0:null===(a=V.upgrades)||void 0===a?void 0:a.transport),(0,u.CO)(t).then(e=>{let{data:a}=e;if(Array.isArray(a)&&a.length>0){eg(!0);let e=a.map(e=>({id:e.Id,name:e.Name,schedules:e.Schedule}));eS(e);let{schedules:t}=e[0],s=e.find(e=>e.id===ej);s&&(t=s.schedules),t&&t.length>1?(ef(t),eu(!0)):(eh(""),ef([]),eu(!1))}else eg(!1),eu(!1),eS([]),ef([])}).catch(()=>{eg(!1),eu(!1),eS([]),ef([])}).finally(()=>{ey(!1)})}},[V]),(0,l.useEffect)(()=>{T&&(ew(""),e7())},[ec]),(0,l.useEffect)(()=>{T&&(""!==ej&&(ew(""),e5().then(e=>{e_(e.activities,ej),X(e.locations)}).catch(()=>{}).finally(()=>{""!==ej&&e7()})),""===ej&&(eR([]),ew(""),e_(z),X([])))},[ej]),(0,l.useEffect)(()=>{if(T){let e=new m.Z(b,j),a=e.isAddedInShoppingCart();if(a&&_&&eP.length>0){let a=e.hasTransportation();if(a){let a=e.hasPickupID();if(a){let a=e.getPickupID();ew(a)}}}}},[eP]),(0,l.useEffect)(()=>{let e=new m.Z(b,j),a=e.isAddedInShoppingCart();if(a&&""!==eO&&G){U(!1);let a=eP.find(e=>e.id===eO);if(a){let{id:t,name:s}=a,l=e.getDetailID();eX(l,t,s,d,ep)}}if(a&&""!==eO&&Z){F(!1);let a=eP.find(e=>e.id===eO);if(a){let{id:t,name:s}=a,l=e.getDetailID();eX(l,t,s,d,ep)}}},[b]),(0,l.useEffect)(()=>{if(T){let e={...eT};e.paxAdult={...e.paxAdult,pax:eL[0].quantity,price:eE.beforePrice.adult},e.paxChildren={...e.paxChildren,pax:eL[1].quantity,price:eE.beforePrice.young},eB(e)}},[eL]),(0,l.useEffect)(()=>{T&&eH()},[eT,T]),N?(0,s.jsx)(C,{itemLabels:y,product:j,pricePaxes:eE,changePaxes:eF,paxes:eL,onClickSave:e2,setDateSelected:eo,canSelectSchedule:!1,setScheduleSelected:eh,availableSchedules:ex,dateSelected:ec,scheduleSelected:ep,canSelectTransportation:em,transportationLoading:ev,setTransportationSelected:eb,transportationSelected:ej,availableLocations:eN,pickupLoading:eC,setPickupSelected:ew,pickupSelected:eO,pickupPlaces:eP,totalPrice:eG,offCanvasRef:t,errorValidation:eD,isEdit:_,onClickEdit:e9,allowedCustomers:eA,refModalCanvas:ed,messagePromo:eJ,actionButton:e$,currentPromotionApplied:en,validation:I,tourOnly:J}):(0,s.jsx)(S,{itemLabels:y,product:j,pricePaxes:eE,changePaxes:eF,paxes:eL,onClickSave:e2,setDateSelected:eo,canSelectSchedule:!1,setScheduleSelected:eh,availableSchedules:ex,dateSelected:ec,scheduleSelected:ep,canSelectTransportation:em,transportationLoading:ev,setTransportationSelected:eb,transportationSelected:ej,availableLocations:eN,pickupLoading:eC,setPickupSelected:ew,pickupSelected:eO,pickupPlaces:eP,totalPrice:eG,modalRef:a,errorValidation:eD,isEdit:_,onClickEdit:e9,allowedCustomers:eA,refModalCanvas:ed,messagePromo:eJ,actionButton:e$,currentPromotionApplied:en,val
1idation:I,tourOnly:J})};I.propTypes={offCanvasRef:d().instanceOf(Object),modalRef:d().instanceOf(Object),setLoading:d().func.isRequired,setShopping:d().func.isRequired,product:d().instanceOf(Object).isRequired,language:d().string.isRequired,currency:d().string.isRequired,currency_id:d().number.isRequired,showNotification:d().func.isRequired,itemLabels:d().instanceOf(Object).isRequired,isMobile:d().bool.isRequired,shopping:d().instanceOf(Object).isRequired,infoGA4:d().instanceOf(Object).isRequired,metricasGA4:d().instanceOf(Object).isRequired,enableCroct:d().bool},I.defaultProps={offCanvasRef:{},modalRef:{},enableCroct:!1};var L=(0,o.$j)(function(e){let{metricasGA4:a}=e;return{metricasGA4:a}},null)(I)},13306:function(e,a,t){t.d(a,{N:function(){return s}});let s=()=>!!window.document&&!!window.document.createElement}}]);

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.