1"use strict";(self.webpackChunkbaco_ecom_home=self.webpackChunkbaco_ecom_home||[]).push([["6677"],{1211(e,a,n){n.d(a,{A:()=>t});let t={screen:"Confirmation-module__screen___Tf7Wt",container:"Confirmation-module__container___KYGRd",topBar:"Confirmation-module__topBar___XAVa6",logo:"Confirmation-module__logo___Sufub",stack:"Confirmation-module__stack___VVqrb",card:"Confirmation-module__card___pQapn",hero:"Confirmation-module__hero___Ubul9",heroIcon:"Confirmation-module__heroIcon___yaaZr",heroTitle:"Confirmation-module__heroTitle___jOTrd",heroSubtitle:"Confirmation-module__heroSubtitle___tTCyR",heroTime:"Confirmation-module__heroTime___SFzTX",orderChip:"Confirmation-module__orderChip___cJBMm",paymentConfirmation:"Confirmation-module__paymentConfirmation___CQW1D",paymentConfirmationIcon:"Confirmation-module__paymentConfirmationIcon___q4Rko",paymentConfirmationCopy:"Confirmation-module__paymentConfirmationCopy___q_Ivj",paymentConfirmationTitle:"Confirmation-module__paymentConfirmationTitle___PuZuQ",paymentConfirmationText:"Confirmation-module__paymentConfirmationText___fGbA3",deliveryDelayNotice:"Confirmation-module__deliveryDelayNotice___iHqze",deliveryDelayIcon:"Confirmation-module__deliveryDelayIcon___ssAD5",deliveryDelayText:"Confirmation-module__deliveryDelayText___psKjb",sectionTitle:"Confirmation-module__sectionTitle___8YKJa",disclaimer:"Confirmation-module__disclaimer___FvaIF",hint:"Confirmation-module__hint___Bl_OJ",divider:"Confirmation-module__divider___aYgr2",infoRow:"Confirmation-module__infoRow___I1dAb",infoIcon:"Confirmation-module__infoIcon___R3d3l",infoText:"Confirmation-module__infoText___v4Fru",infoLabel:"Confirmation-module__infoLabel___TnM6p",infoValue:"Confirmation-module__infoValue___TFHaq",dataList:"Confirmation-module__dataList___TIkjb",dataRow:"Confirmation-module__dataRow___A5HZ4",dataValue:"Confirmation-module__dataValue___zvlLS",footer:"Confirmation-module__footer___FJnHa",pickupRow:"Confirmation-module__pickupRow___mzXpu",pickupImage:"Confirmation-module__pickupImage___NSEbm",linkAction:"Confirmation-module__linkAction___mO2zu",helpButton:"Confirmation-module__helpButton___p02Cw",linkButton:"Confirmation-module__linkButton___mNgeR"}},3359(e,a,n){n.d(a,{Ri:()=>c,Yq:()=>m});var t=n(9421),s=n(6230),o=n(6540),l=n(1042),i=n(166);let r=[1,2,5,10,30],d=-1;function m(e){let{orderID:a,status:n,onStatusChange:s,onCloseModal:o}=e,{data:m={},isLoading:c}=(0,t.I)(["productDetail",a],()=>(0,i.rA)({path:{orderID:a}}),{enabled:!!a,refetchOnWindowFocus:()=>[l.A.paymentStatus.PENDING,"LOADING"].includes(n),refetchInterval:e=>n!==l.A.paymentStatus.ERROR&&((null==e?void 0:e.transaction_status)?[l.A.paymentStatus.PENDING,l.A.paymentStatus.AWAITING_WEBHOOK].includes(null==e?void 0:e.transaction_status)?((d=Math.min(r.length-1,d+1))>l.A.maxRetriesBeforeError&&s((null==e?void 0:e.transaction_status)?l.A.paymentStatus.PENDING:l.A.paymentStatus.ERROR),1e3*r[d]):(s(null==e?void 0:e.transaction_status),(null==e?void 0:e.transaction_status)===l.A.paymentStatus.SUCCEEDED&&setTimeout(()=>{o()},d<2?0:2e3),!1):1e3*r[d]),retry:e=>!(e>l.A.maxRetriesBeforeError)||(s(l.A.paymentStatus.ERROR),!1)});return{isLoading:c,order:m}}function c(e){let{orderID:a}=e,[n,t]=(0,o.useState)(0),{mutate:l,isLoading:r}=(0,s.n)(e=>(0,i.Kg)({path:{orderId:a},body:{rating:e}}),{onSuccess:e=>{t(e.rating)}});return{isLoading:r,rate:n,setRating:l}}},3070(e,a,n){n.d(a,{P:()=>d});var t=n(4848),s=n(7712),o=n(3752),l=n(5342),i=n(6540),r=n(1829);function d(e){var a;let{items:n,totals:d,title:m,defaultExpanded:c=!1,className:u=""}=e,[_,p]=(0,i.useState)(c),h=null!=(a=d.find(e=>e.strong))?a:d[d.length-1],x=n.length;return(0,t.jsxs)("section",{className:"".concat("OrderSummaryCard-module__card___jKlVH"," ").concat(u),"data-open":_,children:[(0,t.jsxs)("button",{type:"button",className:"OrderSummaryCard-module__header___VRPEK",onClick:()=>p(e=>!e),"aria-expanded":_,"aria-controls":"order-summary-details",children:[(0,t.jsxs)("span",{className:"OrderSummaryCard-module__headerText___Wvwe0",children:[(0,t.jsx)("span",{className:"OrderSummaryCard-module__headerTitle___pVTtQ",children:null!=m?m:s.Ru._({id:"7p6HbH",message:"Detalle del pedido"})}),(0,t.jsx)("span",{className:"OrderSummaryCard-module__headerCount___iaJ2R",children:1===x?s.Ru._({id:"LrvydF",message:"1 producto"}):s.Ru._({id:"twZ8Tv",message:"{totalItems} productos",values:{totalItems:x}})})]}),h?(0,t.jsx)("span",{className:"OrderSummaryCard-module__headerTotal___eEhe
1y",children:h.value}):null,(0,t.jsx)(r.A,{className:"OrderSummaryCard-module__chevron___pYWU_",size:20})]}),(0,t.jsx)(o.N,{initial:!1,children:_?(0,t.jsx)(l.P.div,{id:"order-summary-details",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{overflow:"hidden"},children:(0,t.jsxs)("div",{className:"OrderSummaryCard-module__body___gLLI6",children:[(0,t.jsx)("ul",{className:"OrderSummaryCard-module__itemList___JohAw",children:n.map(e=>{var a;return(0,t.jsxs)("li",{className:"OrderSummaryCard-module__item___pdwd1",children:[(0,t.jsx)("span",{className:"OrderSummaryCard-module__quantity___SI2eq",children:"".concat(e.quantity,"\xd7")}),(0,t.jsxs)("span",{className:"OrderSummaryCard-module__itemText___WTO_z",children:[(0,t.jsx)("span",{className:"OrderSummaryCard-module__itemName___mZs14",children:e.name}),(null==(a=e.modifiers)?void 0:a.length)?(0,t.jsx)("span",{className:"OrderSummaryCard-module__itemModifiers___zr1cX",children:e.modifiers.map(e=>e.quantity&&e.quantity>1?"".concat(e.quantity,"\xd7 ").concat(e.name):e.name).join(" \xb7 ")}):null]})]},e.id)})}),(0,t.jsx)("ul",{className:"OrderSummaryCard-module__totalsBox___u7_qF",children:d.map(e=>(0,t.jsxs)("li",{className:"".concat("OrderSummaryCard-module__totalsRow____JvnJ"," ").concat(e.strong&&d.length>1?"OrderSummaryCard-module__totalsRowFinal___YB6iW":""),children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{children:e.value})]},e.label))})]})},"details"):null})]})}},6836(e,a,n){n.r(a),n.d(a,{default:()=>b});var t=n(4848),s=n(6414),o=n(7712),l=n(6185),i=n(6540),r=n(1468),d=n(8106),m=n(1935),c=n(3296),u=n(3070),_=n(5437),p=n(5145),h=n(6100),x=n(196),y=n(3366),f=n(1042),C=n(9551),j=n(7437),A=n(3359),v=n(7795),N=n(6447),g=n(8481),S=n(4528),E=n(3396),R=n(1211);let T=(0,i.lazy)(()=>Promise.all([n.e("112"),n.e("7522")]).then(n.bind(n,5129))),b=function(){var e,a,n,b,k,D,I,w,O,q,z,P,U,L,B,V,H,W,F;let[G,J]=(0,i.useState)(!0),[Y,K]=(0,i.useState)("LOADING"),{orderID:M}=(0,d.g)(),Q=(0,r.wA)(),Z=(0,r.d4)(e=>{var a,n;return null==(n=e.cart)||null==(a=n.checkout)?void 0:a.orderId}),{checkout:X}=(0,m.A)(),{trackPaymentFlowResult:$}=X,{refetchUserInfo:ee}=(0,c.vz)(),{order:ea}=(0,A.Yq)({orderID:M,status:Y,onStatusChange:K,onCloseModal:()=>J(!1)}),{deliveryData:en}=(0,j.U)(),et=en.isDelivery,es=(0,d.Zp)();(0,i.useEffect)(()=>{var e,a,n,t,s;let o=ea.transaction_status===f.A.paymentStatus.SUCCEEDED?"success":"failed",l=null==(a=ea.items)?void 0:a.map(e=>{var a;return{id:(null==(a=e.product)?void 0:a.id)||e.id||"",quantity:e.quantity||1}});$({orderId:M,transactionStatus:o,orderData:{total:null!=(e=null==(s=ea.paymentDetails)||null==(t=s.dataPayment)||null==(n=t.amount)?void 0:n.value)?e:0,items:l}})},[ea.transaction_status]),(0,i.useEffect)(()=>{Y===f.A.paymentStatus.SUCCEEDED&&ee()},[Y]),(0,i.useEffect)(()=>{ea.transaction_status===f.A.paymentStatus.SUCCEEDED&&Z===M&&Q((0,v.kZ)())},[Z,Q,ea.transaction_status,M]);let eo=ea.transaction_status===f.A.paymentStatus.SUCCEEDED;if(ea&&eo&&(et||ea.type===f.A.deliveryType.delivery))return(0,t.jsx)(i.Suspense,{fallback:null,children:(0,t.jsx)(T,{order:ea})});let el=(null==ea?void 0:ea.pickUpDate)?new Date(null==ea?void 0:ea.pickUpDate):new Date,ei=null==(b=ea.paymentDetails)||null==(n=b.dataPayment)?void 0:n.customer_payer,er=(null==(I=ea.paymentDetails)||null==(D=I.dataPayment)||null==(k=D.transactions)?void 0:k.id)||"",ed=(0,g.SE)(null==(z=ea.paymentDetails)||null==(q=z.dataPayment)||null==(O=q.transactions)||null==(w=O.payment_method)?void 0:w.type),em=(ea.items||[]).map((e,a)=>{var n,t,s,o,l,i;return{id:null!=(n=null!=(t=null==(l=e.product)?void 0:l.id)?t:e.id)?n:a,name:null!=(s=null==(i=e.product)?void 0:i.name)?s:"",quantity:null!=(o=e.quantity)?o:1,modifiers:(e.itemGroups||[]).flatMap(e=>e.modifiers||[]).map(e=>({id:e.id,name:e.name,quantity:e.quantity}))}});return(0,t.jsxs)("div",{className:R.A.screen,children:[(0,t.jsxs)("div",{className:R.A.container,children:[(0,t.jsx)("div",{className:R.A.topBar,children:(0,t.jsx)(h.LogoBacuIcon,{className:R.A.logo})}),(0,t.jsxs)("section",{className:"".concat(R.A.card," ").concat(R.A.hero),children:[(0,t.jsx)("span",{className:R.A.heroIcon,children:(0,t.jsx)(p.C,{size:28})}),(0,t.jsx)("h1",{className:R.A.heroTitle,children:(0,t.jsx)(s.x6,{id:"Q1fm8l",message:"\xa1Hemos recibido tu pedido!"})}),(0,t.jsx)("p",{className:R.A.heroSubtitle,children:(0,t.jsx)(s.x6,{id:"zuqE9U",message:"Estar\xe1 listo para recoger a las:"})}),(0,t.jsx)("p",{className:R.A.heroTime,children:(0,l.A)(el,"hh:mm a")}),er?(0,t.jsxs)("span",{className:R.A.orderChip,children:[(0,t.jsx)(s.x6,{id:"NqUkkO",message:"Orden"})," #".concat(er.substr(-4))]}):null,(0,t.jsx)(E.A,{})]}),(0,t.jsxs)("div",{className:R.A.stack,children:[(0,t.jsxs)("section",{className:R.A.card,children:[(0,t.jsx)("h2",{className:R.A.sectionTitle,children:(0,t.jsx)(s.x6,{id:"3u8nvg",message:"Punto de recogida"})}),(0,t.jsxs)("div",{className:R.A.pickupRow,children:[(null==ea||null==(P=ea.store)?void 0:P.pickup_imageUrl)?(0,t.jsx)("img",{className:R.A.pickupImage,src:ea.store.pickup_imageUrl,alt:ea.store.name,loading:"lazy"}):(0,t.jsx)("span",{className:R.A.infoIcon,children:(0,t.jsx)(x.A,{size:20})}),(0,t.jsxs)("span",{className:R.A.infoText,children:[(0,t.jsx)("span",{className:R.A.infoLabel,children:null==ea||null==(U=ea.store)?void 0:U.name}),(0,t.jsx)("span",{className:R.A.infoValue,children:null==ea||null==(L=ea.store)?void 0:L.address}),(0,t.jsx)("button",{type:"button",className:R.A.linkAction,onClick:()=>{var e,a;return(e=>{let{lat:a,lng:n}=e;return window.open("https://www.google.com/maps/search/?api=1&query=".concat(a,",").concat(n,"&zoom=20"),"_blank")})({lat:null==ea||null==(e=ea.store)?void 0:e.lat,lng:null==ea||null==(a=ea.store)?void 0:a.lng})},children:(0,t.jsx)(s.x6,{id:"Mg6/1A",message:"\xbfC\xf3mo llegar?"})})]})]})]}),(0,t.jsxs)("section",{className:R.A.card,children:[(0,t.jsx)("h2",{className:R.A.sectionTitle,children:(0,t.jsx)(s.x6,{id:"+5wLEG",message:"Datos registrados"})}),(0,t.jsxs)("ul",{className:R.A.dataList,children:[(0,t.jsxs)("li",{className:R.A.dataRow,children:[(0,t.jsx)("span",{children:(0,t.jsx)(s.x6,{id:"0E8/ah",message:"Nombre"})}),(0,t.jsx)("span",{className:"".concat(R.A.dataValue," capitalize"),children:"".concat(null!=(e=null==ei?void 0:ei.first_name)?e:""," ").concat(null!=(a=null==ei?void 0:ei.last_name)?a:"")})]}),(0,t.jsxs)("li",{className:R.A.dataRow,children:[(0,t.jsx)("span",{children:(0,t.jsx)(s.x6,{id:"Q9uHe5",message:"Correo"})}),(0,t.jsx)("span",{className:R.A.dataValue,children:null==ei?void 0:ei.email})]}),(0,t.jsxs)("li",{className:R.A.dataRow,children:[(0,t.jsx)("span",{children:(0,t.jsx)(s.x6,{id:"mnHTw6",message:"Celular"})}
1),(0,t.jsxs)("span",{className:R.A.dataValue,children:[null==ei||null==(B=ei.phone)?void 0:B.country_code,null==ei||null==(V=ei.phone)?void 0:V.number]})]}),(0,t.jsxs)("li",{className:R.A.dataRow,children:[(0,t.jsx)("span",{children:(0,t.jsx)(s.x6,{id:"kmx7dj",message:"M\xe9todo de pago"})}),(0,t.jsx)("span",{className:R.A.dataValue,children:ed})]})]})]}),(0,t.jsx)(u.P,{items:em,totals:[{label:o.Ru._({id:"72c5Qo",message:"Total"}),value:(0,N.v)((null==(F=ea.paymentDetails)||null==(W=F.dataPayment)||null==(H=W.amount)?void 0:H.value)||0),strong:!0}]}),(0,t.jsxs)("section",{className:"".concat(R.A.card," ").concat(R.A.disclaimer),children:[(0,t.jsx)("p",{className:R.A.hint,children:(0,t.jsx)(s.x6,{id:"OyHYrd",message:"Una vez que llegues al Punto de Recogida, ac\xe9rcate a la zona de Pick-Up, busca tu pedido, y \xa1listo!"})}),(0,t.jsx)("p",{className:R.A.hint,children:(0,t.jsx)(s.x6,{id:"lo89LS",message:"Tu pedido estar\xe1 listo a la hora indicada. Te recomendamos llegar m\xe1ximo 10 minutos despu\xe9s de esta hora para no perder la calidad de tus productos."})}),(0,t.jsx)("p",{className:R.A.hint,children:(0,t.jsx)(s.x6,{id:"1ed+rN",message:"Recuerda, Pick Up es para disfrutar fuera del punto: en tu casa, tu oficina, para el brunch o la cena."})})]})]}),(0,t.jsxs)("div",{className:R.A.footer,children:[(0,t.jsx)(_.A,{size:"lg",fullWidth:!0,onClick:()=>es("/order/".concat(ea.order_id,"/rating")),children:(0,t.jsx)(s.x6,{id:"2KeOYw",message:"Pedido recogido"})}),(0,t.jsx)(S.A,{className:R.A.helpButton})]})]}),G&&(0,t.jsx)(y.A,{status:Y,onClick:()=>{var e,a;switch(ea.transaction_status){case f.A.paymentStatus.SUCCEEDED:J(!1);break;case f.A.paymentStatus.ERROR:es("/store/".concat(null==(e=ea.store)?void 0:e.storeId,"/?checkout=order-detail"));break;case f.A.paymentStatus.DECLINED:case f.A.paymentStatus.REJECTED:es("/store/".concat(null==(a=ea.store)?void 0:a.storeId,"/?checkout=order-detail"));break;default:es(C.b.ORDER_SEARCH)}}})]})}},4528(e,a,n){n.d(a,{A:()=>u});var t=n(4848),s=n(6414),o=n(5556),l=n.n(o),i=n(1935),r=n(5437),d=n(6100),m=n(1042);function c(e){let{color:a,className:n}=e,{checkout:o}=(0,i.A)(),{trackSupportRedirectPickUp:l}=o;return(0,t.jsx)(r.A,{className:n,onClick:()=>{l({}),window.open(m.A.whatsAppSupport,"_blank")},color:a,fullWidth:!0,size:"lg",children:(0,t.jsxs)("span",{className:"flex justify-center items-center gap-2",children:[(0,t.jsx)(d.SupportAgentIcon,{className:"h-6 w-6"}),(0,t.jsx)(s.x6,{id:"tROf/c",message:"\xbfNecesitas ayuda?"})]})})}c.propTypes={color:l().oneOf(["primary","secondary"]),className:l().string},c.defaultProps={color:"secondary",className:""};let u=c},3396(e,a,n){n.d(a,{A:()=>i});var t=n(4848),s=n(6414),o=n(5145),l=n(1211);let i=function(){return(0,t.jsxs)("div",{className:l.A.paymentConfirmation,role:"status",children:[(0,t.jsx)("span",{className:l.A.paymentConfirmationIcon,"aria-hidden":"true",children:(0,t.jsx)(o.C,{size:20})}),(0,t.jsxs)("span",{className:l.A.paymentConfirmationCopy,children:[(0,t.jsx)("strong",{className:l.A.paymentConfirmationTitle,children:(0,t.jsx)(s.x6,{id:"SDn7sP",message:"Pago realizado"})}),(0,t.jsx)("span",{className:l.A.paymentConfirmationText,children:(0,t.jsx)(s.x6,{id:"zsvihX",message:"Tu pedido ya est\xe1 pagado. No debes pagar nada m\xe1s por este pedido."})})]})]})}}}]);
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.