PageSourceSearch

https://baladyfarms.co/_next/static/chunks/pages/shop/confirm-checkout-2fbebd5204da1a7d.js

js baladyfarms.co collected 2026-09-29 00:03:59 UTC 11,488 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[762],{20913:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/shop/confirm-checkout",function(){return r(27590)}])},27590:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>eu,default:()=>eh});var s=r(6029),a=r(55729),n=r(81278),i=r(71384),l=r(82203),c=r.n(l),o=r(8588),d=r.n(o),u=r(80817),h=r(38169),m=r(81247),x=r(54270),p=r(37948),g=r(84335),b=r(82562),j=r(70659),f=r(7006),A=r(43735),w=r(66242),C=r(94822),y=r(11471),k=r(99690),E=r(24565),v=r(74738),z=r(6386),N=r(93258),_=r(92887),B=r(18090),S=r(74812),T=r(8208),P=r(28638);let F=e=>{let{config:t}=e,{t:r}=(0,u.Bd)("zamfast"),s=new P.T(t),n=(0,N.jE)();return(0,_.n)(e=>s.updateFastCustomer(e),{onSuccess(){(0,B.Ds)({color:"green",icon:a.createElement(S.A,{size:20}),title:r("basic-info.title"),message:r("basic-info.update-success")}),n.invalidateQueries(["fastCustomer"])},onError(e){let t=e.response.data.error.message;(0,B.Ds)({color:"red",icon:a.createElement(T.A,{size:20}),title:r("basic-info.title"),message:t})}})},M=e=>{let{fastCustomer:t}=e,r=(0,n.useRouter)(),{t:a}=(0,u.Bd)(["checkout","zamfast"]),{isMobile:i}=(0,z.al)(),l=(0,v.m)({initialValues:{id:t.id,firstName:t.name.split(" ")[0],lastName:t.name.split(" ")[1],email:t.email}}),{mutate:c,isLoading:o}=F({config:{router:r}}),d=e=>{c({id:t.id,name:"".concat(e.firstName," ").concat(e.lastName),email:e.email})};return(0,s.jsxs)("form",{onSubmit:l.onSubmit(e=>d(e)),children:[(0,s.jsxs)(k.Y,{mt:i?15:30,children:[(0,s.jsx)(E.k,{style:{flexGrow:1},label:(0,s.jsx)(p.E,{children:a("contact-info.first-name")}),...l.getInputProps("firstName")}),(0,s.jsx)(E.k,{style:{flexGrow:1},label:(0,s.jsx)(p.E,{children:a("contact-info.last-name")}),...l.getInputProps("lastName")})]}),(0,s.jsxs)(k.Y,{mt:i?15:30,children:[(0,s.jsx)(E.k,{style:{flexGrow:1},label:(0,s.jsx)(p.E,{children:a("contact-info.phone-number")}),disabled:!0,value:(null==t?void 0:t.phoneNumber)||""}),(0,s.jsx)(E.k,{style:{flexGrow:1},label:(0,s.jsx)(p.E,{children:a("contact-info.email")}),...l.getInputProps("email")})]}),(0,s.jsx)(k.Y,{mt:i?25:40,position:"right",children:(0,s.jsx)(g.$,{variant:"filled",color:"black",w:i?"100%":220,h:40,p:"10px 20px",type:"submit",loading:o,children:a("save",{ns:"zamfast"})})})]})};var R=r(83751),U=r(56266),I=r(34449);let L=e=>{let{address:t}=e,{isMobile:r}=(0,z.al)();return(0,s.jsx)(x.a,{sx:e=>({border:"1px solid",borderColor:e.colors["low-gray"][0],borderRadius:"5px",padding:r?"10px 20px":"20px 30px"}),children:(0,s.jsx)(j.s,{justify:"space-between",align:"end",gap:20,children:(0,s.jsx)(I.A,{address:t})})},t.id)},D=e=>{var t,r;let{fastCustomer:a}=e,{t:n}=(0,u.Bd)(["zamfast"]);return(0,s.jsxs)(j.s,{direction:"column",gap:10,justify:"center",children:[null==a||null==(t=a.addresses)?void 0:t.map(e=>(0,s.jsx)(L,{address:e},e.id)),!(null==a||null==(r=a.addresses)?void 0:r.length)&&(0,s.jsx)(j.s,{justify:"center",children:(0,s.jsx)(p.E,{color:"gray",children:n("addresses.no-addresses")})})]})};var q=r(65018),W=r(18802),G=r(86627);let H=e=>{let{fastCustomer:t}=e,{t:r}=(0,u.Bd)(["zamfast"]),{isMobile:i}=(0,z.al)(),[l,c]=(0,a.useState)(!1),o=(0,n.useRouter)(),{data:d}=(0,G.P0)({config:{router:o}}),h=()=>c(!1);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(D,{fastCustomer:t}),l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(R.c,{my:i?20:30}),d?d.useNewLocations?(0,s.jsx)(W.A,{isFastCustomer:!0,phoneNumber:t.phoneNumber,onCancel:h}):(0,s.jsx)(q.A,{isFastCustomer:!0,phoneNumber:t.phoneNumber,onCancel:h}):(0,s.jsx)(j.s,{justify:"center",children:(0,s.jsx)(U.a,{color:"borders-and-lines",variant:"dots"})})]}):(0,s.jsx)(k.Y,{mt:i?25:40,position:"right",children:(0,s.jsx)(g.$,{variant:"filled",color:"black",w:i?"100%":220,h:40,p:"10px 20px",onClick:()=>c(!0),children:r("addresses.add-address")})})]})};var Q=r(56690),V=r(54705),Z=r(83914),Y=r(61162);let J={src:"/_next/static/media/debit_card.cdce7607.png",height:48,width:48,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAP1BMVEUtRsY/UbNlZYlre9Q0S8BLXcNqdb1MaXE9ULg1SLB3cX+LgIE/Ua18d49FVq2fiFxUZs5iZ6Jbb9p0dJl0eKzyoeNMAAAAEHRSTlOALPj9gPz6AICA+P0s+iz1WHpTPwAAAAlwSFlzAAALEwAACxMBAJqcGAAAADtJREFUeJw1y0ECgCAIAMFVgUArsfr/W7vU3IftwwkREQWeI1u7HMZUswxk9V7rEsTGrZrOLoi7F/7+AkcLAfIdM4lRAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8},O=e=>{let{creditCard:t}=e,{isMobile:r}=(0,z.al)();return(0,s.jsxs)(j.s,{direction:"row",gap:r?10:20,align:"center",children:[(0,s.jsx)(d(),{src:"Visa"===t.cardType?Q.A:"MasterCard"===t.cardType?V.A:"Meeza"===t.cardType?Z.A:"Maestro"===t.cardType?Y.A:J,alt:t.cardType,width:r?30:50,height:r?30:50}),(0,s.jsxs)(j.s,{direction:"column",gap:5,children:[(0,s.jsx)(p.E,{size:r?12:16,weight:900,lh:"20px",children:t.cardType}),(0,s.jsx)(p.E,{size:r?12:16,weight:500,color:"dark-gray",children:t.digits})]})]})};var X=r(28362),$=r(88988),K=r(1069);class ee extends $.n{async deleteCreditCard(e){return(await X.FH.delete("".concat(K.P,"/credit_cards/").concat(e))).data}constructor(e){super(e)}}let et=e=>{let{config:t}=e,{t:r}=(0,u.Bd)(["zamfast"]),s=new ee(t),n=(0,N.jE)();return(0,_.n)(e=>{let{id:t}=e;return s.deleteCreditCard(t)},{onSuccess(e){let{success:t,message:s}=e;t?n.invalidateQueries(["fastCustomer"]):(0,B.Ds)({color:"red",icon:a.createElement(T.A,{size:20}),title:r("credit-cards.title"),message:s})}})},er=e=>{let{creditCard:t}=e,r=(0,n.useRouter)(),{isMobile:a}=(0,z.al)(),{t:i}=(0,u.Bd)(["checkout"]),{mutate:l}=et({config:{router:r}});return(0,s.jsx)(x.a,{sx:e=>({border:"1px solid",borderColor:e.colors["low-gray"][0],borderRadius:"5px",padding:a?"10px 20px":"20px 30px"}),children:(0,s.jsxs)(j.s,{justify:"space-between",align:"end",gap:20,children:[(0,s.jsx)(O,{creditCard:t}),(0,s.jsx)(A.M,{onClick:()=>
1l({id:t.id}),component:"button",color:"red",children:(0,s.jsx)(p.E,{size:a?12:16,underline:!0,weight:300,children:i("remove")})})]})})},es=e=>{var t,r;let{fastCustomer:a}=e,{t:n}=(0,u.Bd)(["zamfast"]);return(0,s.jsxs)(j.s,{direction:"column",gap:10,justify:"center",children:[null==a||null==(t=a.creditCards)?void 0:t.map(e=>(0,s.jsx)(er,{creditCard:e},e.id)),!(null==a||null==(r=a.creditCards)?void 0:r.length)&&(0,s.jsx)(j.s,{justify:"center",children:(0,s.jsx)(p.E,{color:"gray",align:"center",children:n("credit-cards.no-cards")})})]})},ea=e=>{let{fastCustomer:t,opened:r,close:n}=e,{t:i}=(0,u.Bd)(["zamfast"]),{isMobile:l}=(0,z.al)(),[c,o]=(0,a.useState)("basic-info");return(0,s.jsx)(C.a,{opened:r,onClose:n,size:l?"md":"xl",centered:!0,padding:l?20:50,title:(0,s.jsx)(p.E,{weight:700,size:l?20:25,children:i("settings")}),children:(0,s.jsxs)(y.t,{color:"black",styles:{tab:{fontSize:l?14:18,padding:l?"10px":"15px 20px"}},value:c,onTabChange:o,children:[(0,s.jsxs)(y.t.List,{children:[(0,s.jsx)(y.t.Tab,{value:"basic-info",children:i("basic-info.title")}),(0,s.jsx)(y.t.Tab,{value:"addresses",children:i("addresses.title")}),(0,s.jsx)(y.t.Tab,{value:"credit-cards",children:i("credit-cards.title")})]}),(0,s.jsx)(y.t.Panel,{value:"basic-info",children:(0,s.jsx)(M,{fastCustomer:t})}),(0,s.jsx)(y.t.Panel,{value:"addresses",pt:l?15:30,children:(0,s.jsx)(H,{fastCustomer:t})}),(0,s.jsx)(y.t.Panel,{value:"credit-cards",pt:l?15:30,children:(0,s.jsx)(es,{fastCustomer:t})})]})})},en=e=>{let{config:t}=e,{t:r}=(0,u.Bd)("zamfast"),s=new P.T(t),n=(0,N.jE)();return(0,_.n)(e=>{let{id:t}=e;return s.unsubscribeFromZamFast(t)},{onSuccess(e){(0,B.Ds)({color:"green",icon:a.createElement(S.A,{size:20}),title:r("title"),message:r("unsubscribe-success")}),n.invalidateQueries(["fastCustomer"])},onError(e){let t=e.response.data.error.message;(0,B.Ds)({color:"red",icon:a.createElement(T.A,{size:20}),title:r("title"),message:t})}})},ei=e=>{let{fastCustomer:t}=e,r=(0,n.useRouter)(),{t:i}=(0,u.Bd)(["zamfast"]),{isMobile:l}=(0,z.al)(),[c,{open:o,close:d}]=(0,b.j)(!1),[h,m]=(0,a.useState)(!!t),{mutate:x}=en({config:{router:r}}),g=e=>{m(e),e||x({id:(null==t?void 0:t.id)||-1})};return(0,s.jsxs)(w.A,{mt:32,children:[t?(0,s.jsx)(ea,{opened:c,close:d,fastCustomer:t}):null,(0,s.jsxs)(j.s,{justify:"space-between",direction:l?"column":"row",align:"center",w:"100%",children:[(0,s.jsx)(f.d,{label:i("consent-toggle"),size:l?"xs":"sm",radius:"lg",color:"green",checked:h||!!t,onChange:e=>g(e.currentTarget.checked),mb:10*!!l,styles:{body:{alignItems:"center"},label:{margin:0}}}),(0,s.jsx)(A.M,{onClick:o,component:"button",color:"black",children:(0,s.jsx)(p.E,{underline:!0,size:l?"xs":"sm",sx:{textWrap:"nowrap"},children:i("manage")})})]})]})},el={src:"/_next/static/media/checkout_success.dbc2539f.svg",height:266,width:265,blurWidth:0,blurHeight:0};var ec=r(67887);let eo=(0,h.r)(e=>({outerContainer:{display:"flex",flexDirection:"column",alignItems:"center",height:"fit-content",margin:"auto",padding:30,backgroundColor:"transparent",borderColor:"".concat(e.colors["borders-and-lines"][0],"!important"),boxShadow:"none"},innerContainer:{display:"inherit",flexDirection:"inherit",alignItems:"inherit",padding:20,borderBottom:"1px solid ".concat(e.colors["borders-and-lines"][0])},linkBtn:{marginTop:32,color:"".concat(e.colors["btn-primary-label"][0]," !important"),backgroundColor:"".concat(e.colors["btn-primary"][0]," !important"),borderColor:"".concat(e.colors["btn-primary-border"][0]," !important"),"&:hover":{color:"".concat(e.colors["btn-primary-label"][0]," !important"),backgroundColor:"".concat(e.colors["btn-primary"][0]," !important"),borderColor:"".concat(e.colors["btn-primary-border"][0]," !important")}}})),ed=e=>{let{isZamshopPurchase:t,purchaseId:r,paymentMessage:a}=e,i=(0,n.useRouter)(),{classes:l}=eo(),{t:o}=(0,u.Bd)("checkout"),{isMobile:h}=(0,z.al)(),{data:b}=(0,G.gq)({config:{router:i}}),{data:j}=(0,G.P0)({config:{router:i}}),{data:f}=(0,G.N5)({config:{router:i},handle:"checkout-success"});return(0,s.jsxs)(m.t,{shadow:"lg",withBorder:!0,className:l.outerContainer,w:h?"100%":700,children:[(0,s.jsxs)(x.a,{className:l.innerContainer,children:[(0,s.jsx)(x.a,{mb:30,sx:{width:h?170:265,height:h?170:265,position:"relative"},children:(0,s.jsx)(d(),{src:(null==f?void 0:f.graphicUrl)||el,alt:"checkout success",fill:!0,priority:!0})}),(0,s.jsx)(p.E,{size:h?12:18,weight:500,color:"headings-and-links",transform:"uppercase",style:{textAlign:"center"},children:r?o("checkout-success.title-with-id",{id:r}):o("checkout-success.title")}),(0,s.jsx)(p.E,{mb:10,size:h?14:18,weight:600,color:"primary-green",sx:{textAlign:"center"},children:a}),(0,s.jsx)(p.E,{color:"body-text",mb:10,size:h?14:18,weight:600,sx:{textAlign:"center"},children:(0,ec.QW)(j)?null==j?void 0:j.checkoutMessage:o("checkout-success.desc")})]}),b?(0,s.jsx)(ei,{fastCustomer:b}):null,(0,s.jsx)(c(),{href:"/shop",passHref:!0,legacyBehavior:!0,children:(0,s.jsx)(g.$,{className:l.linkBtn,fullWidth:h,component:"a",children:o("checkout-success.btn")})})]})};var eu=!0;let eh=e=>{let{paymentMessage:t,isPayment:r}=e,[l,c]=(0,a.useState)(null),[o,d]=(0,a.useState)(!1),{removePurchaseId:u}=(0,z.gi)(),h=(0,n.useRouter)(),{data:m}=(0,G.P0)({config:{router:h}}),{data:x}=(0,G.zU)({router:h}),{purchaseData:p,removePurchaseData:g}=(0,z.bw)({company:m});return((0,a.useEffect)(()=>{p&&(c(p.id),r&&(h.query.purchase_id||h.query.merchant_order_id)&&(0,ec.vq)({purchase:p,company:m,removePurchaseId:u,fbclid:h.query.fbclid}),"marketplace"===p.channel&&(d(!0),g()),g())},[r,h,m,p,u,g]),m&&x)?(0,s.jsx)(i.A,{company:m,theme:x,children:(0,s.jsx)(ed,{isZamshopPurchase:o,purchaseId:l,paymentMessage:t})}):null}}},e=>{var t=t=>e(e.s=t);e.O(0,[480,381,384,110,636,593,792],()=>t(20913)),_N_E=e.O()}]);

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.