1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[97],{97087:function(e,n,t){var i,r=t(67294);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},o.apply(null,arguments)}n.Z=function(e){return r.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:8.323,height:8.323},e),i||(i=r.createElement("path",{d:"M1.334 4.97L3.322 7.05l3.629-3.8",fill:"none",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8})))}},70433:function(e,n,t){var i,r=t(67294);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},o.apply(null,arguments)}n.Z=function(e){return r.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:8.538,height:2.5},e),i||(i=r.createElement("g",{"data-name":"Icon feather-plus"},r.createElement("path",{"data-name":"Caminho 415",d:"M1.25 1.25h6.038",fill:"none",stroke:"currentColor",strokeLinecap:"square",strokeLinejoin:"round",strokeWidth:2.5}))))}},55657:function(e,n,t){var i,r=t(67294);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)({}).hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},o.apply(null,arguments)}n.Z=function(e){return r.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:8.538,height:8.538},e),i||(i=r.createElement("g",{"data-name":"Icon feather-plus",fill:"none",stroke:"currentColor",strokeLinecap:"square",strokeLinejoin:"round",strokeWidth:2.5},r.createElement("path",{"data-name":"Caminho 414",d:"M4.269 1.25v6.038"}),r.createElement("path",{"data-name":"Caminho 415",d:"M1.25 4.269h6.038"}))))}},61297:function(e,n,t){t.d(n,{Z:function(){return i.Z}});var i=t(55122)},44786:function(e,n,t){t.d(n,{ZP:function(){return L},lS:function(){return C.lS}});var i=t(47568),r=t(29815),o=t(34051),a=t.n(o),l=t(85893),c=t(79752),s=t(14314),d=t(16829),u=t(42298),p=t(69119),h=t(23855),f=t(17681),v=t(95595),g=t(39509),m=t(26858),x=t(67294),S=t(625),b=t(61297),j=t(13211),k=t(44458),C=t(2382),y=t(16234),Z=(0,d.Z)("div",{shouldForwardProp:function(e){return"isSelected"!==e}})((function(e){var n=e.isSelected;return{backgroundColor:n?"#f7fdf7":"#fff",border:"1px solid ".concat(n?"#26a534":"rgba(35, 35, 35, 0.2)"),borderRadius:"6px",display:"flex",alignItems:"center",padding:"15px 25px",gap:"10px",cursor:"pointer",transition:"0.2s ease-in-out",marginTop:"10px","&:hover":{borderColor:n?"#26a534":"rgba(35, 35, 35, 0.5)"}}})),w=(0,d.Z)("div")({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",marginRight:"5px"}),P=(0,d.Z)("div")({display:"flex",flex:1,alignItems:"center",justifyContent:"space-between"}),E=(0,d.Z)("div")({display:"flex",flexDirection:"column",gap:2}),I=(0,d.Z)("p")({fontSize:"14px",fontWeight:500,color:"rgba(35, 35, 35, 0.9)",lineHeight:"20px",margin:0}),A=(0,d.Z)("div")({display:"flex",alignItems:"center",gap:8}),D=(0,d.Z)("p")({fontSize:"12px",fontWeight:400,color:"rgba(35, 35, 35, 0.7)",lineHeight:"16px",margin:0}),N=(0,d.Z)("button")({fontSize:"12px",fontWeight:500,color:"#004ba2",textDecoration:"underline",cursor:"pointer",background:"none",border:"none",padding:0,flexShrink:0,"&:hover":{textDecoration:"none"}}),_=(0,d.Z)("p")({fontSize:"16px",fontWeight:700,lineHeight:"24px",textAlign:"right",margin:0,whiteSpace:"nowrap"});function L(e){var n,t,o=e.method,d=e.shippingId,L=e.hasFreeShipping,O=e.isSelected,M=e.scheduledSelection,R=e.onScheduledSelect,T=e.onSelectStart,W=e.onSave,q=(0,m.Z)(),H=q.customerRedacted,z=q.updateProcess,G=q.updateStep,F=(0,s.useGetCart)(),Y=(F.data,F.refetch),B=(0,b.Z)(),V=(0,k.useSiteContext)().site.configs.scripts.googleAnalyticsId,J=(0,S.S)().openSideModal,K=(0,x.useState)(null),Q=K[0],U=K[1],X=(0,c.Z)().mutateAsync,$=(0,x.useCallback)(function(){var e=(0,i.Z)(a().mark((function e(n,t,i){var r,l,c,s,p;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return U(i),T(o.id),e.prev=2,e.next=6,X({customer:H?{id:H.id}:void 0,shippings:[{id:d,method:{id:o.id,scheduledDate:(0,u.Z)(n,"yyyy-MM-dd"),scheduledShift:t}}]});case 6:return l=e.sent,c=!!(null===l||void 0===l||null===(r=l.shippings)||void 0===r?void 0:r.length)&&l.shippings.every((function(e){var n;return!!(null===(n=e.method)||void 0===n?void 0:n.id)})),z({shipping:{allSelected:c,display:c?"selected":"edit"}}),G(c?g.C.PAYMENT:g.C.SHIPPING),V&&(p=null===l||void 0===l||null===(s=l.shippings)||void 0===s?void 0:s.map((function(e){var n;return null===(n=e.method)||void 0===n?void 0:n.carrierName}
1)).filter(Boolean).join(" / "),B(j.D.ADD_SHIPPING_INFO,{debug_mode:!0,currency:"BRL",value:(null===l||void 0===l?void 0:l.amounts.items)-(null===l||void 0===l?void 0:l.amounts.discounts),items:null===l||void 0===l?void 0:l.items.map((function(e){var n,t,i;return{item_id:e.variationSku,item_name:e.description,price:e.price,quantity:e.quantity,item_category:null===(n=e.category)||void 0===n?void 0:n.label,item_brand:e.brand.label,item_variant:null===(t=e.specifications)||void 0===t||null===(i=t[0])||void 0===i?void 0:i.value}})),coupon:null===l||void 0===l?void 0:l.coupon.code,shipping_tier:p})),R({date:n,shift:t,mode:i}),e.next=14,Y();case 14:W(),e.next=19;break;case 17:e.prev=17,e.t0=e.catch(2);case 19:return e.prev=19,U(null),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[2,17,19,22]])})));return function(n,t,i){return e.apply(this,arguments)}}(),[X,H,z,G,d,o.id,V,B,R,Y,W,T]),ee=(0,x.useCallback)((function(){var e=(0,p.Z)((0,h.Z)(o.nextAvailableDate.split("T")[0]));J((0,l.jsx)(y.Z,{method:o,initialDate:e,onConfirm:function(e,n){return $(e,n,"quick")}}))}),[J,o,$]),ne=(0,x.useCallback)((function(){J((0,l.jsx)(y.Z,{method:o,onConfirm:function(e,n){return $(e,n,"full")}}))}),[J,o,$]),te=L||0===o.price?"Gr\xe1tis":null===(n=o.price)||void 0===n?void 0:n.toLocaleString("pt-br",{style:"currency",currency:"BRL"}),ie=L||0===o.price?"#26A534":"#232323",re=O&&"quick"===(null===M||void 0===M?void 0:M.mode),oe=O&&"full"===(null===M||void 0===M?void 0:M.mode),ae="quick"===Q,le="full"===Q;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(Z,{isSelected:re,onClick:function(){return!Q&&ee()},children:[(0,l.jsx)(w,{children:ae?(0,l.jsx)(v.Z,{color:"#000",size:16}):(0,l.jsx)(f.Y,{isChecked:re,onChange:ee})}),(0,l.jsxs)(P,{children:[(0,l.jsxs)(E,{children:[(0,l.jsx)(I,{children:(0,C.Sp)(o)}),re&&M?(0,l.jsxs)(A,{children:[(0,l.jsxs)(D,{children:["Entrega prevista: ",(0,C.WF)(o)," (",(0,C.lS)(M.shift),")"]}),(0,l.jsx)(N,{type:"button",onClick:function(e){e.stopPropagation(),ee()},children:"Alterar turno"})]}):(0,l.jsxs)(D,{children:["V\xe1lido para pedidos at\xe9"," ",(null===(t=o.availableShifts)||void 0===t?void 0:t.length)?(0,r.Z)(o.availableShifts).sort((function(e,n){return e.cutoffTime.localeCompare(n.cutoffTime)})).at(-1).cutoffTime:o.cutoffTime]})]}),(0,l.jsx)(_,{style:{color:ie},children:te})]})]}),(0,l.jsxs)(Z,{isSelected:oe,onClick:function(){return!Q&&ne()},children:[(0,l.jsx)(w,{children:le?(0,l.jsx)(v.Z,{color:"#000",size:16}):(0,l.jsx)(f.Y,{isChecked:oe,onChange:ne})}),(0,l.jsxs)(P,{children:[(0,l.jsxs)(E,{children:[(0,l.jsx)(I,{children:"Agendar Entrega"}),oe&&M?(0,l.jsxs)(A,{children:[(0,l.jsxs)(D,{children:["Entrega prevista: ",(0,C.jm)(M.date)," (",(0,C.lS)(M.shift),")"]}),(0,l.jsx)(N,{type:"button",onClick:function(e){e.stopPropagation(),ne()},children:"Alterar data"})]}):(0,l.jsx)(N,{type:"button",onClick:function(e){e.stopPropagation(),ne()},children:"Escolha a data de entrega"})]}),(0,l.jsx)(_,{style:{color:ie},children:te})]})]})]})}},66498:function(e,n,t){t.d(n,{C:function(){return i}});var i,r=t(67294);!function(e){e[e.PERSONAL=0]="PERSONAL",e[e.ADDRESS=1]="ADDRESS",e[e.SHIPPING=2]="SHIPPING",e[e.PAYMENT=3]="PAYMENT"}(i||(i={}));var o=(0,r.createContext)(void 0);n.Z=o},39509:function(e,n,t){t.d(n,{C:function(){return i.C},Z:function(){return i.Z}});var i=t(66498)},26858:function(e,n,t){var i=t(66498),r=t(67294);n.Z=function(){var e=(0,r.useContext)(i.Z);if(!e)throw new Error("useProcessContext hook must be used inside ProcessProvider.");return e}}}]);
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.