1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[898],{57716:function(e,t,n){n.d(t,{X:function(){return r}});let r=(0,n(80451).Ue)(e=>({addresses:[],setAddresses:t=>e({addresses:t}),updateAddress:t=>e(e=>({addresses:e.addresses.length>0?e.addresses.map(e=>e.id===t.id?t:e):[t]})),addAddress:t=>e(e=>e.addresses.some(e=>e.id===t.id)?e:{addresses:[...e.addresses,t]}),removeAddress:t=>e(e=>({addresses:e.addresses.filter(e=>e.id!==t)}))}))},18521:function(e,t,n){var r=n(11527),o=n(86106),a=n(5293),i=n(54298),l=n(75536),s=n(81772);let u={padding:"5px 8px",fontWeight:"600",width:"max-content!important"};t.Z=e=>{var t;let{baselinePrice:n,finalPrice:c,promotionDetails:d,currency:h}=e,{theme:m}=(0,o.u)();return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(a.S,{direction:"column",alignItems:"end",children:[d?(0,r.jsx)(i.B,{variant:"promo",sx:u,children:d}):null,(0,r.jsxs)(a.S,{direction:"row",justifyContent:"center",alignItems:"center",gap:1,children:[c<n&&(0,r.jsx)(l.T,{body:"small",sx:{textDecoration:"line-through"},children:(0,s.F)(n,{currency:h,maximumFractionDigits:0})}),(0,r.jsx)(l.T,{body:"medium",weight:700,variant:"secondary",sx:{color:null==m?void 0:null===(t=m.tertiary)||void 0===t?void 0:t[100]},children:(0,s.F)(c,{currency:h,maximumFractionDigits:0})})]})]})})}},49259:function(e,t,n){n.d(t,{Z:function(){return B}});var r=n(11527),o=n(50959),a=n(43990),i=n(86106),l=n(60355),s=n(43539),u=n(5293),c=n(71793),d=n(75028),h=n(45207),m=n(75536),v=n(95570),x=n(11663),p=n(81772),g=e=>{let{total:t,handleClick:n,variant:o,currency:a}=e,{t:i}=(0,h.$G)(["checkout","cart"]),s={showMore:{label:i("checkout:showMore"),containerIcon:{transform:"rotate(180deg)",height:"24px"}},showLess:{label:i("checkout:showLess"),containerIcon:{height:"24px"}}}[o];return(0,r.jsxs)(d.G,{container:!0,alignItems:"center",onClick:n,children:[(0,r.jsx)(d.G,{item:!0,xs:7,children:(0,r.jsxs)(m.T,{button:!0,children:[i("cart:totalToPay"),": ",(0,p.F)(t,{currency:a})]})}),(0,r.jsx)(d.G,{item:!0,xs:5,textAlign:"right",children:(0,r.jsx)(v.B,{mode:"text",size:"medium",onClick:n,sx:{textDecoration:"underline"},icon:(0,r.jsx)(l.B,{sx:s.containerIcon,children:(0,r.jsx)(x.I,{name:"arrowDown"})}),children:s.label})})]})},y=n(18032),f=n.n(y),b=n(49918),k=n(18521);let j={objectFit:"contain"},w={margin:"16px 0"};var C=e=>{let{name:t,image:n,path:o,quantity:a,existProductBottom:i,promotionDetails:s,totalBaselinePrice:u,totalPrice:d,currency:m}=e,{t:v}=(0,h.$G)("cart"),x="".concat("https://nooz-bucket.s3-us-west-2.amazonaws.com/assets","/img/product-default.svg");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.d,{title:t,href:"/comprar/".concat(o),description:v("quantity",{quantity:a}),badge:(0,r.jsx)(k.Z,{baselinePrice:u,finalPrice:d,promotionDetails:s,currency:m}),image:(0,r.jsx)(l.B,{height:"90px",children:(0,r.jsx)(f(),{src:n,alt:t,height:90,width:90,style:j,onError:e=>{e.target.srcset=x}})})}),i&&(0,r.jsx)(l.B,{style:w,children:(0,r.jsx)(b.D,{})})]})},E=n(55133),S=n(89175);let R={width:{xs:"100%"},objectFit:"contain",boxSizing:"border-box",position:"fixed",bottom:0,right:0,display:"flex",flexDirection:"column",background:"white",zIndex:"101",padding:"1em 1em",boxShadow:"rgba(0, 0, 0, 0.15) 0px 0px 4px"};var B=e=>{let{products:t,load:n,total:h,voucher:m,discount:v,itemsTotal:x,creditsUsed:p,creditsAmount:y,voucherDiscount:f,hideCoupon:b,hasMinimumAmount:k=!0,minimumAmount:j=null,applyCredits:w,removeCredits:B,applyCoupon:D,removeCoupon:I,goToHome:T,voucherThresholdMessage:A,voucherLabel:z,installmentOption:L,currency:U}=e,[Z,F,G]=(0,a.u)(),{theme:N}=(0,i.u)(),[q,_]=(0,o.useState)(!1),O=()=>_(!1),P={paddingTop:2,width:"100%",opacity:n?".6":"1",marginLeft:"0px"};if(Z||F){var Y,M,W;return(0,r.jsxs)(r.Fragment,{children:[!q&&(0,r.jsxs)(l.B,{sx:R,children:[(0,r.jsx)(g,{total:h,variant:"showMore",handleClick:()=>_(!0),currency:U}),k?null:(0,r.jsx)(l.B,{sx:{mt:"16px"},children:(0,r.jsx)(S.Z,{minimumAmount:j,onClickLink:T,currency:U})})]}),(0,r.jsx)(s.D,{anchor:"bottom",open:q,onClose:O,children:(0,r.jsxs)(u.S,{spacing:1,sx:{...P,background:null==N?void 0:null===(W=N.background)||void 0===W?void 0:null===(M=W.color)||void 0===M?void 0:null===(Y=M.primary)||void 0===Y?void 0:Y[100]},children:[(0,r.jsx)(l.B,{sx:{paddingX:"16px"},children:(0,r.jsx)(g,{total:h,variant:"showLess",handleClick:O,currency:U})}),(0,r.jsx)(l.B,{children:(0,r.jsx)(E.Z,{pt:0,showTotalPay:G,load:n,total:h,voucher:m,discount:v,itemsTotal:x,creditsUsed:p,creditsAmount:y,voucherDiscount:f,applyCredits:w,removeCredits:B,applyCoupon:D,removeCoupon:I,hideCoupon:b,voucherThresholdMessage:A,voucherLabel:z,currency:U})})]})})]})}return(0,r.jsxs)(c.C,{bordered:G,rounded:!0,sx:P,children:[(0,r.jsx)(d.G,{item:!0,pt:1,sx:{display:{xs:"none",md:"none",lg:"block"},paddingX:"16px"},children:t.map((e,n)=>(0,o.createElement)(C,{...e,existProductBottom:n!==t.length-1,key:e.itemCode,currency:U}))}),(0,r.jsx)(E.Z,{pt:3,showTotalPay:!1,load:n,total:h,voucher:m,discount:v,itemsTotal:x,creditsUsed:p,creditsAmount:y,voucherDiscount:f,hideCoupon:b,applyCredits:w,removeCredits:B,applyCoupon:D,removeCoupon:I,voucherThresholdMessage:A,voucherLabel:z,installmentOption:L,currency:U})]})}},89175:function(e,t,n){var r=n(11527),o=n(45207),a=n(86106),i=n(71793),l=n(5293),s=n(60355),u=n(75536),c=n(62810),d=n(81772);t.Z=e=>{var t,n,h;let{minimumAmount:m,onClickLink:v,currency:x}=e,{theme:p}=(0,a.u)(),{t:g}=(0,o.$G)("cart");return(0,r.jsx)(i.C,{bordered:!0,rounded:!0,sx:{borderColor:null==p?void 0:null===(h=p.fill)||void 0===h?void 0:null===(n=h.color)||void 0===n?void 0:null===(t=n.secondary)||void 0===t?void 0:t[50]},children:(0,r.jsxs)(l.S,{sx:{p:"16px"},spacing:"8px",children:[(0,r.jsx)(s.B,{children:(0,r.jsx)(u.T,{h6:!0,variant:"secondary",children:g("importantMessage")})}),(0,r.jsx)(s.B,{children:(0,r.jsxs)(u.T,{body:"medium",variant:"secondary",sx:{"& > button":{display:"contents"}},children:[g("minimumAmountRequired",{amount:(0,d.F)(null!=m?m:0,{currency:x})})," ",v?(0,r.jsx)(c.L,{underline:"none",onClick:v,children:(0,r.jsx)(u.T,{body:"medium",sx:{textDecoration:"underline !important"},variant:"secondary",component:"span",children:g("seePromotions")})}):null]})})]})})}},11896:function(e,t,n){var r=n(11527),o=n(45207),a=n(60355),i=n(5293),l=n(75536),s=n(95570);t.Z=e=>{let{onRetry:t,onGoHome:n}=e,{t:u}=(0,o.$G)(["checkout"]);return(0,r.jsx)(a.B,{"data-testid":"buyer-identity-unavailable",sx:{p:{xs:"16px",md:"24px"}},children:(0,r.jsxs)(i.S,{gap:"16px",children:[(0,r.jsx)(l.T,{h4:!0,children:u("checkout:identity.unavailableTitle")}),(0,r.jsx)(l.T,{body:"large",children:u("checkout:identity.unavailableBody")}),(0,r.jsxs)(i.S,{direction:"row",gap:"12px",sx:{"& > span":{flex:"1"}},children:[(0,r.jsx)(s.B,{fullWidth:!0,onClick:t,children:u("checkout:identity.retry")}),(0,r.jsx)(s.B,{fullWidth:!0,mode:"outlined",onClick:n,children:u("checkout:identity.goHome")})]})]})})}},51981:function(e,t,n){n.d(t,{_:function(){return b}});var r=n(50959),o=n(83542),a=n(80451),i=n(28868),l=n(91261),s=n(46941),u=n(15912),c=n(19550),d=n(57716),h=n(41044),m=n(74639),v=n(11073),x=n(40449),p=n(10701),g=n(77158);let y="useBuyerIdentityGuard";function f(e){let t=h.O.getState();return!!t.isReal&&!!t.buyerId&&(!e||!t.email||t.email===e)}function b(){var e,t,n,b,k;let j=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{sincronizeCart:w,quotation:C,user:E,enabled:S=!0}=j,R=(0,o.useRouter)(),{sessionStatus:B,session:D}=(0,g.k)(),{clearBuyerScopedSelections:I,updateStep:T}=(0,p.M)(),A=(0,a.oR)(h.O,e=>e.buyerId),z=(0,a.oR)(h.O,e=>e.isReal),[L,U]=(0,r.useState)("checking"),[Z,F]=(0,r.useState)(null),[G,N]=(0,r.useState)(0),q=(0,r.useRef)(0),_=(0,r.useRef)("checking"),O=(0,r.useRef)(A),P=(0,v.MZ)(null!==(t=null==R?void 0:R.pathname)&&void 0!==t?t:null==R?void 0:R.asPath),Y=(null==(k=null!==(b=null!==(n=null==B?void 0:B.email)&&void 0!==n?n:null==E?void 0:E.email)&&void 0!==b?b:null==D?void 0:null===(e=D.user)||void 0===e?void 0:e.email)?void 0:k.trim().toLowerCase())||null,M=(0,r.useCallback)((e,t)=>e===q.current&&(_.current=t,U(t),!0),[]),W=(0,r.useCallback)(()=>{let e=(0,v.x3)({router:R,quotation:C});return e||(_.current="unavailable",U("unavailable")),e},[R,C]),X=(0,r.useCallback)(async()=>
1{if(!P&&w)try{await w({silent:!0})}catch(e){l.Y.warn({module:y,action:"syncCartForBuyer failed",category:"oz-checkout",quotation:null!=C?C:void 0,data:{message:e instanceof Error?e.message:"unknown"}})}},[P,w,C]),$=(0,r.useCallback)(async()=>{let e=++q.current;if(M(e,"checking"),B&&!1===B.active&&!(null==D?void 0:D.isAuth)){if(P){R.replace("/summary?error=".concat(s.gR.SESSION_REQUIRED));return}W();return}if(await h.O.getState().whenPromotionSettled(),e!==q.current)return;if(f(Y)){await X(),M(e,"ready");return}if(!Y){l.Y.error({module:y,action:"buyerUnresolvable",category:"oz-checkout",quotation:null!=C?C:void 0,data:{attempts:0,reason:"no-session-email"}}),M(e,"unavailable");return}let t=v.KW.length;for(let r=1;r<=t;r+=1){var n;if(await (0,x.D)({...null!=E?E:{},email:Y}),e!==q.current)return;if(f(Y)){await X(),M(e,"ready");return}if(!(null==E?void 0:null===(n=E.firstName)||void 0===n?void 0:n.trim())){M(e,"collect-name");return}if(r<t&&(await (0,v.gw)(v.KW[r-1]),e!==q.current))return}l.Y.error({module:y,action:"buyerUnresolvable",category:"oz-checkout",quotation:null!=C?C:void 0,data:{attempts:t,reason:"promotion-returned-generic"}}),M(e,"unavailable")},[B,null==D?void 0:D.isAuth,Y,E,C,X,M,W,P,R]);(0,r.useEffect)(()=>{S&&void 0!==B&&$()},[S,B,G]),(0,r.useEffect)(()=>{let e=O.current;e!==A&&(O.current=A,null===e||(l.Y.warn({module:y,action:"buyerChangedInCheckout",category:"oz-checkout",quotation:null!=C?C:void 0,data:{from:e,to:A,verifyOnly:P}}),P||I(),z||"ready"!==_.current||N(e=>e+1)))},[A,z]);let Q=(0,r.useCallback)(()=>{N(e=>e+1)},[]),H=(0,r.useCallback)(()=>F(null),[]),K=(0,r.useCallback)(async()=>{I(),T(m.b.Address),F("address-not-owned");try{let[e,t]=await i.Z.get(u._.GetAddressesUseCase).execute();!e&&t&&d.X.getState().setAddresses(t)}catch(e){l.Y.warn({module:y,action:"addressNotOwned refetch failed",category:"oz-checkout",quotation:null!=C?C:void 0,data:{message:e instanceof Error?e.message:"unknown"}})}},[I,T,C]),V=(0,r.useCallback)(e=>{let t=(0,s.xH)(e);return!!t&&((l.Y.warn({module:y,action:"buyerIdentityError",category:"oz-checkout",quotation:null!=C?C:void 0,data:{code:t,verifyOnly:P}}),t!==s.gR.SESSION_REQUIRED||P)?P?R.replace("/summary?error=".concat(t)):t===s.gR.ADDRESS_NOT_OWNED?K():t===s.gR.BUYER_REQUIRED?(q.current+=1,_.current="collect-name",U("collect-name")):N(e=>e+1):W(),!0)},[C,P,W,R,K]);(0,r.useEffect)(()=>(0,v.Ih)(V),[V]);let J=(0,r.useCallback)(async e=>{let t=++q.current;if(M(t,"checking"),!Y){M(t,"unavailable");return}try{var n,r,o;let a=i.Z.resolve(c.r),s=await a.resolveRealBuyerId({email:Y,firstName:e.firstName.trim(),lastName:(null===(n=e.lastName)||void 0===n?void 0:n.trim())||void 0,phone:(null===(r=e.phone)||void 0===r?void 0:r.trim())||void 0,dialCode:(null===(o=e.dialCode)||void 0===o?void 0:o.trim())||void 0});if(t!==q.current)return;if(s){await X(),M(t,"ready");return}l.Y.error({module:y,action:"buyerUnresolvable",category:"oz-checkout",quotation:null!=C?C:void 0,data:{attempts:1,reason:"create-with-name-returned-null"}}),M(t,"unavailable")}catch(e){if(t!==q.current||V(e))return;l.Y.error({module:y,action:"buyerUnresolvable",category:"oz-checkout",quotation:null!=C?C:void 0,data:{attempts:1,reason:e instanceof Error?e.message:"unknown"}}),M(t,"unavailable")}},[Y,C,X,M,V]);return{status:L,retry:Q,onIdentityError:V,submitIdentity:J,isSessionExpiringSoon:(0,r.useCallback)(()=>(0,v.fZ)(B),[B]),redirectToLogin:W,verifyOnly:P,alert:Z,dismissAlert:H}}},22216:function(e,t,n){n.d(t,{B:function(){return i}});var r=n(50959),o=n(28868),a=n(6412);let i=e=>{let{quotation:t,customMessage:n="User is attempting to leave the checkout page.",pageIdentifier:i}=e,l=o.Z.get(a.T.ServerLogger),s=(0,r.useRef)(!1),u=(0,r.useRef)(null),c=(0,r.useCallback)(e=>(null==l||l.info({module:"useCheckoutExitGuard",action:"".concat(i," - leavePage - beforeunload"),data:{quotation:t,message:n}}),e.preventDefault(),e.returnValue="",""),[t,n,i]);return(0,r.useEffect)(()=>{if(!s.current)return u.current=c,window.addEventListener("beforeunload",c),()=>{window.removeEventListener("beforeunload",c),u.current=null}},[c]),{releaseExitGuard:(0,r.useCallback)(()=>{s.current=!0,u.current&&(window.removeEventListener("beforeunload",u.current),u.current=null)},[])}}}}]);
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.