1import{U as ke,X as we,j as e,ap as Ce,G as Ie,cx as X,A as P,p as Pe,_ as Ae,B as H,t as fe,cy as ye,r as d,cz as De,cA as Te,cB as h,cC as Fe,a1 as $,g as ee,cD as Be,P as u,a3 as Re,n as se,cE as Me,a6 as qe,cF as Oe,cG as Le,L as _e,l as Ve,b3 as $e,bd as ze,bQ as oe,aS as D,bk as He,bM as Ue,bL as Ye,k as J,f as ie,cH as Qe,cI as z,cJ as Ke,au as Ze,b$ as We}from"./index-CVUXbWDK.js";import{u as Ge,P as Je,g as Xe,E as es,a as ss,l as ts}from"./useStripeKlarnaPaymentForm-Dw7ohjZz.js";import{u as as,a as ns,s as rs,A as is,b as os,c as ls,d as ds,g as cs,m as us}from"./smartyStreetUtils-BdLgS9Pv.js";import{S as ms}from"./Select-BdXY5WkV.js";import{C as ps}from"./CoinIcon-DAYNj3XS.js";import{C as hs}from"./CustomizeAlertCopy-GumpxX0n.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="abe26f58-45e1-436c-a665-cda5a62c1d1a",a._sentryDebugIdIdentifier="sentry-dbid-abe26f58-45e1-436c-a665-cda5a62c1d1a")}catch{}})();(function(){var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a._sentryModuleMetadata=a._sentryModuleMetadata||{},(function(){var t,n=new a.Error().stack,s=a._sentryModuleMetadata[n]||{},r={"_sentryBundlerPluginAppKey:mm-sentry-boysenberry":!0},o={};for(t in s)s.hasOwnProperty(t)&&(o[t]=s[t]);for(t in r)r.hasOwnProperty(t)&&(o[t]=r[t]);a._sentryModuleMetadata[n]=o})()})();function xs({deleteCard:a,deleteError:t,ebtAmount:n,isDeleting:s,isEBTChargeAmountLoading:r,marketCloseDate:o,onClose:l,open:i}){var f;const m=ke(),x=we.useMediaQuery({maxWidth:(f=m==null?void 0:m.screens)==null?void 0:f.md}),c=async()=>{await a(),fe("SNAP card remove",{location:"account"}),ye({SNAP_enabled:!1}),l()},y=()=>r?e.jsx("div",{className:"flex h-[300px] items-center justify-center",children:e.jsx(X,{})}):e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"text-heading-xs",children:"Remove EBT Card?"}),n>0&&e.jsxs(P,{variant:"warning",children:[e.jsxs("span",{className:"block",children:["Your applied payment of $",Number(n).toFixed(2)," will be refunded if you remove your card prior to your window close"," ",o?`at ${Pe(o,!0)} ${Ae(o)}`:""]}),e.jsx("span",{className:"mt-10 block",children:"If your order meets your minimum when your shopping window closes, your default payment method will be charged for the full value of your order."})]}),e.jsx("p",{children:"Once deleted, you'll need to re-add it to use EBT for future purchases."}),e.jsx("p",{children:"Note: Only one EBT card can be linked to your account at a time."}),t&&e.jsx(P,{variant:"error",children:"There was an error deleting your card. Please try again."}),e.jsx(H,{onClick:c,disabled:s,children:s?e.jsxs("span",{className:"flex items-center gap-10",children:[e.jsx(X,{})," Deleting..."]}):"Delete EBT Card"}),e.jsx("p",{className:"text-center",children:e.jsx("button",{onClick:l,className:"link text-body-sm",type:"button",children:"Cancel"})})]});return x?e.jsx(Ce,{anchor:"bottom",open:i,toggleDrawer:l,children:e.jsx("div",{className:"space-y-15 p-20",children:y()})}):e.jsx(Ie,{open:i,onClose:l,children:e.jsx("div",{className:"mx-auto max-w-md space-y-20",children:y()})})}function fs({clearErrors:a,deleteCard:t,deleteError:n,ebtCard:s,isDeleting:r,marketCloseDate:o}){const[l,i]=d.useState(!1),{data:m,isLoading:x}=De(),c=m==null?void 0:m.ebtAmount;return s!=null&&s.last4?e.jsxs("div",{className:"mt-20 lg:mt-0",children:[e.jsx("h3",{className:"text-body-md mb-5 text-grey",children:"EBT CARD"}),e.jsxs("p",{className:"text-body-md text-grey",children:["Card: **** **** **** ",s==null?void 0:s.last4]}),e.jsx("button",{type:"button",className:"link text-body-sm mt-5 block",onClick:()=>i(!0),children:"Delete"}),l&&e.jsx(xs,{open:l,onClose:()=>i(!1),deleteCard:t,isDeleting:r,deleteError:n,clearErrors:a,ebtAmount:c,isEBTChargeAmountLoading:x,marketCloseDate:o})]}):null}function ys({clearErrors:a,customerID:t,isEdit:n=!1,isSaving:s,onSuccess:r,saveCardWithTokenization:o,saveError:l,setIsEditing:i}){const{clearForage:m,forage:x,initializeForage:c,isLoading:y}=Te(),f=d.useRef(!1);d.useEffect(()=>{!f.current&&t&&!x&&(f.current=!0,(async()=>{try{await c(t)}catch{f.current=!1}})())},[t,c,x]);const g=async S=>{try{await o(x,S),fe(n?"SNAP card update":"SNAP card add",{location:"account"}),ye({SNAP_enabled:!0}),m(),r==null||r()}catch(E){$(`Error saving EBT card: ${(E==null?void 0:E.message)||"Unknown error"} `,{elementID:"account-ebt-card-element-container"})}},N=()=>{i(!1),m()};return y?e.jsx("div",{className:h.editContainer,children:e.jsxs("p",{className:"mt-20 flex items-center gap-10 lg:mt-0",children:[e.jsx(X,{})," Loading..."]})}):e.jsx("div",{className:`${h.editContainer} mt-20 lg:mt-0`,children:e.jsxs("div",{children:[e.jsx(Fe,{elementID:"account-ebt-card-element-container",isSaving:s,onSave:g,saveError:l,clearErrors:a,submitButtonText:"Save"}),e.jsx("button",{type:"button",className:"link text-body-sm mx-auto mt-15 block",onClick:N,children:"Cancel"})]})})}function gs({ebtCard:a}){var N;const{data:t={}}
1=ee(),[n,s]=d.useState(!1),{clearErrors:r,deleteCard:o,deleteError:l,isDeleting:i,isSaving:m,saveCardWithTokenization:x,saveError:c}=Be(t==null?void 0:t.subID),y=()=>{s(!1),r()},f=()=>{s(!0),r()},g=S=>e.jsx("button",{type:"button",onClick:f,className:`text-body-sm link ${S}`,children:a!=null&&a.last4?"Edit":"Add"});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-body-lg shrink-0 font-grotesk-bold lg:w-[240px] lg:self-start",children:"EBT Payment Method"}),!n&&g("lg:hidden self-center")]}),n?e.jsx(ys,{customerID:t==null?void 0:t.customerID,clearErrors:r,saveCardWithTokenization:x,isSaving:m,saveError:c,setIsEditing:s,onSuccess:y,isEdit:!!(a!=null&&a.last4)}):e.jsx(fs,{ebtCard:a,onEdit:f,deleteCard:o,isDeleting:i,deleteError:l,clearErrors:r,marketCloseDate:(N=t==null?void 0:t.marketCloseDate)==null?void 0:N.date}),!n&&g("hidden lg:block lg:self-center lg:ml-auto mr-40")]})}function ge({clientSecret:a,email:t,paymentSetupSuccess:n,phone:s,setPaymentSetupSuccess:r,setPaymentTypeSelected:o,setSetupIntentID:l}){const{block:i,buttonDisabled:m,errorMessage:x,handleSubmit:c,showButton:y,stripe:f}=Ge({clientSecret:a,email:t,setPaymentSetupSuccess:r,setPaymentTypeSelected:o,setSetupIntentID:l});return e.jsxs("form",{onSubmit:c,children:[!n&&!i?e.jsx(Je,{options:Xe({email:t,phone:s})}):null,e.jsxs("div",{className:"mt-25",children:[y&&!n&&e.jsx(H,{type:"submit",disabled:!f||m||i,children:"Save"}),x&&e.jsx("p",{className:"mt-15 text-error",children:x}),i&&e.jsx("p",{className:"mt-15 text-error",children:"Temporarily blocked due to multiple attempted failures. Please try again after 24 hours."})]})]})}ge.propTypes={clientSecret:u.string.isRequired,email:u.string.isRequired,paymentSetupSuccess:u.bool.isRequired,phone:u.string.isRequired,setPaymentSetupSuccess:u.func.isRequired,setPaymentTypeSelected:u.func.isRequired,setSetupIntentID:u.func.isRequired};function je({clientSecret:a,email:t,paymentSetupSuccess:n,phone:s,setPaymentSetupSuccess:r,setPaymentTypeSelected:o,setSetupIntentID:l,stripePromise:i}){return n?e.jsx("div",{}):e.jsx(es,{stripe:i,options:{clientSecret:a},children:e.jsx(ge,{paymentSetupSuccess:n,setPaymentSetupSuccess:r,setSetupIntentID:l,clientSecret:a,setPaymentTypeSelected:o,email:t,phone:s})})}je.propTypes={clientSecret:u.string.isRequired,email:u.string.isRequired,paymentSetupSuccess:u.bool.isRequired,phone:u.string.isRequired,setPaymentSetupSuccess:u.func.isRequired,setPaymentTypeSelected:u.func.isRequired,setSetupIntentID:u.func.isRequired,stripePromise:u.instanceOf(Promise).isRequired};const he=e.jsx("h2",{className:"text-body-lg mb-20 font-grotesk-bold lg:hidden",children:"Payment Method"});function js({setPageAlert:a,stripePromise:t}){var K;const n=Re(),{data:s={}}=se(),{billing:r={},email:o,id:l}=s,i=(K=s==null?void 0:s.shippingAddr)==null?void 0:K.phone,{expMonth:m,expYear:x,last4:c,zip:y}=r,[f,g]=d.useState(!1),[N,S]=d.useState(!1),[E,R]=d.useState(null),[M,A]=d.useState(!1),[te,T]=d.useState(""),[w,q]=d.useState(null),[U,ae]=d.useState(!1),[Y,ne]=d.useState(""),{clearKlarnaParams:O,errorMessage:F,loading:L}=ss({setPaymentSetupSuccess:A,setSetupIntentID:q,setPaymentTypeSelected:T}),_=()=>{R(null),q(null),A(!1),T("")},Q=async()=>{var j,Z;g(!0);try{const v=await Oe(l,{email:o,klarnaEnabled:!0});(j=v==null?void 0:v.data)!=null&&j.block?(ae(!0),ne(v.data.block),_()):(Z=v==null?void 0:v.data)!=null&&Z.secret&&R(v.data.secret)}catch(v){$(v),console.error(v)}},re=async()=>{if(g(!1),E!==null&&w!==null){_();try{await Le(l,{stripeSetupIntentID:w})}catch(j){$(j),console.error(j)}}};d.useEffect(()=>{(L||F)&&g(!0)},[L,F]),d.useEffect(()=>{M&&w!==null&&(async()=>{try{S(!0);const j=await Me(l,{stripeSetupIntentID:w,paymentMethod:te});a((j==null?void 0:j.msg)==="Success"?"success.payment":"error.payment"),await n.invalidateQueries({queryKey:[qe]})}catch(j){$(j),console.error(j)}finally{g(!1),S(!1),window.scroll({top:0,behavior:"smooth"}),_(),O()}})()},[M,w,O]);let C;return N?C=e.jsxs("div",{className:"flex gap-10",children:[e.jsx(X,{}),e.jsx("p",{className:"text-body-sm",children:"Updating payment method..."})]}):F?C=e.jsx(P,{variant:"error",children:F}):E===null&&w===null&&!U?C=e.jsx("div",{className:"flex justify-center",children:e.jsx(_e,{})}):U?C=e.jsx(P,{variant:"error",children:Y}):C=e.jsx(je,{email:o,clientSecret:E,paymentSetupSuccess:M,phone:i,setPaymentSetupSuccess:A,setPaymentTypeSelected:T,setSetupIntentID:q,stripePromise:t}),f?e.jsxs("div",{className:h.editContainer,children:[he,e.jsxs("div",{children:[C,!N&&e.jsx("button",{type:"button",className:"link text-body-sm mx-auto mt-15 block",onClick:re,children:"Cancel"})]})]}):e.jsxs("div",{className:h.displayContainer,children:[e.jsxs("div",{className:"text-body-md",children:[he,e.jsx("p",{className:"text-grey",children:"CREDIT CARD"}),e.jsxs("p",{children:["Expires on ",m,"/",x]}),e.jsxs("p",{children:["Billing Zip: ",y]}),e.jsxs("p",{children:["Card: **** **** **** ",c]})]}),e.jsx("button",{type:"button",onClick:Q,className:`${h.edit}
1 self-start lg:self-center`,children:"Edit"})]})}function bs({email:a}){const{isMisfitsTheme:t}=Ve(),[n,s]=d.useState(!1);return e.jsxs("div",{className:h.displayContainer,children:[e.jsxs("div",{className:"w-0 flex-1",children:[e.jsx("h4",{className:"text-body-md font-grotesk-bold",children:"Email address"}),e.jsx("p",{className:"mt-10 truncate",children:a}),n&&e.jsxs("p",{className:"text-body-sm my-15 pr-80",children:["If you need to make changes to your email address, please contact"," ",e.jsx("a",{href:t?$e.customerCare:ze.customerCare,target:"_blank",className:"link",rel:"noopener noreferrer",children:"Customer Care."})]}),e.jsx("p",{className:"mt-10",children:e.jsx("a",{href:"/login/forgot-password",className:"link text-body-sm",children:"Reset my password"})})]}),!n&&e.jsx("button",{className:h.edit,type:"button",onClick:()=>s(!0),children:"Edit"})]})}function le({subscription:a}){const t=(a==null?void 0:a.shippingAddr)??{},[n,s]=d.useState(!1);return n?e.jsxs("div",{className:h.editContainer,children:[e.jsx(de,{subscriptionID:a==null?void 0:a.id,address:t,setIsEditing:s}),e.jsx("button",{type:"button",className:h.cancel,onClick:()=>s(!1),children:"Cancel"})]}):e.jsxs("div",{className:h.displayContainer,children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-grotesk-bold",children:"Name"}),(a==null?void 0:a.id)&&e.jsxs("p",{className:"mt-10",children:[t==null?void 0:t.firstName," ",t==null?void 0:t.lastName]})]}),e.jsx("button",{className:h.edit,type:"button",onClick:()=>s(!0),children:"Edit"})]})}le.propTypes={subscription:u.shape({})};le.defaultProps={subscription:{}};function de({address:a,setIsEditing:t,subscriptionID:n}){var m,x,c,y,f;const s=oe(),{firstName:r="",lastName:o="",...l}=a,i=s.state!=="idle"&&!((m=s.data)!=null&&m.error);return d.useEffect(()=>{var g;(g=s.data)!=null&&g.success&&s.state==="idle"&&t(!1)},[s]),e.jsx(s.Form,{action:".",method:"post",className:"block grow",children:e.jsxs("fieldset",{className:"flex flex-col gap-5",children:[e.jsx(D,{autoComplete:"off",autoCorrect:"off",defaultValue:r,error:(x=s==null?void 0:s.data)==null?void 0:x.error,errorMsg:(c=s==null?void 0:s.data)==null?void 0:c.message,label:"First name",name:"firstName",required:!0}),e.jsx(D,{autoComplete:"off",autoCorrect:"off",defaultValue:o,error:(y=s==null?void 0:s.data)==null?void 0:y.error,errorMsg:(f=s==null?void 0:s.data)==null?void 0:f.message,label:"Last name",name:"lastName",required:!0}),e.jsx("input",{type:"hidden",name:"subscriptionID",defaultValue:n}),Object.keys(l).map(g=>e.jsx("input",{type:"hidden",name:g,value:l[g]??""},g)),e.jsx(H,{type:"submit",disabled:i,name:"_action",value:"updateName",children:i?"Saving...":"Save"})]})})}de.propTypes={address:u.shape({}),subscriptionID:u.number};de.defaultProps={address:{},subscriptionID:null};function ce({subscription:a}){var l,i;const t=(l=a==null?void 0:a.shippingAddr)==null?void 0:l.phone,[n,s]=d.useState(!1),r=He(),o=(i=r==null?void 0:r.state)==null?void 0:i.from;return d.useEffect(()=>{o==="notifications"&&s(!0)},[o]),n?e.jsxs("div",{className:h.editContainer,children:[e.jsx(be,{subscriptionID:a==null?void 0:a.id,address:a==null?void 0:a.shippingAddr,setIsEditing:s}),e.jsx("button",{type:"button",className:h.cancel,onClick:()=>s(!1),children:"Cancel"})]}):e.jsxs("div",{className:h.displayContainer,children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-grotesk-bold",children:"Phone number"}),(a==null?void 0:a.id)&&e.jsx("p",{className:"mt-10",children:Ue(t)?Ye(t):"Add a phone number to receive updates"})]}),e.jsx("button",{className:h.edit,type:"button",onClick:()=>s(!0),children:"Edit"})]})}ce.propTypes={subscription:u.shape({})};ce.defaultProps={subscription:{}};function be({address:a,setIsEditing:t,subscriptionID:n}){var i,m,x;const s=oe(),{phoneFieldProps:r,phoneFieldValue:o}=as(a==null?void 0:a.phone),l=s.state!=="idle"&&!((i=s.data)!=null&&i.error);return d.useEffect(()=>{var c;(c=s.data)!=null&&c.success&&s.state==="idle"&&t(!1)},[s]),e.jsx(s.Form,{action:".",method:"post",className:"block grow",children:e.jsxs("fieldset",{children:[e.jsx(D,{name:"phone",id:"phone",value:o,...r,error:(m=s==null?void 0:s.data)==null?void 0:m.error,errorMsg:(x=s==null?void 0:s.data)==null?void 0:x.message}),e.jsx(J,{to:"/account/notifications#text-preferences",children:e.jsx("p",{className:"link text-body-sm mb-20",children:"Manage my text message preferences"})}),e.jsx("input",{type:"hidden",name:"subscriptionID",defaultValue:n}),Object.keys(a).filter(c=>c!=="phone").map(c=>e.jsx("input",{type:"hidden",name:c,value:a[c]??""},c)),e.jsx(H,{type:"submit",disabled:l,name:"_action",value:"updatePhone",children:l?"Saving...":"Save"})]})})}be.propTypes={address:u.shape({}).isRequired,setIsEditing:u.func.isRequired,subscriptionID:u.number.isRequired};function Ns(){const{data:a}=ee(),{data:t}=se();return e.jsxs("div",{className:"grow space-y-20",children:[e.jsx(le,{subscription:t}),e.jsx(ie,{}),e.jsx(bs,{email:t==null?void 0:t.email}),e.jsx(ie,{}),e.jsx(ce,{subscription:t}),e.jsx(ie,{}),e.jsx(Qe,{customerID:a==null?void 0:a.customerID,subscriptionID:t==null?void 0:t.id,birthday:t==null?void 0:t.dateOfBirth})]})}const xe=e.jsx("h2",{className:"text-body-lg mb-20 font-grotesk-bold lg:hidden",children:"Shipping Address"});function Ne({setPageAlert:a}){const{data:t}
1=ee(),{data:n}=se(),s=(n==null?void 0:n.shippingAddr)??{},{isDeliveredByImperfect:r}=t,{address1:o,address2:l,city:i,deliveryInstructions:m,province:x,zip:c}=s,[y,f]=d.useState(!1),g=()=>{f(!0),setTimeout(()=>{const N=document.getElementById("deliveryInstructions");N&&N.scrollIntoView({behavior:"smooth",block:"center"})},200)};return y?e.jsxs("div",{className:h.editContainer,children:[xe,e.jsx(ue,{address:s,ebtCard:n==null?void 0:n.ebtCard,isDeliveredByImperfect:r,marketplaceOpen:t.marketplaceOpen,setIsEditing:f,setPageAlert:a,subscriptionID:n.id})]}):e.jsxs("div",{className:h.displayContainer,children:[e.jsxs("div",{children:[xe,e.jsxs("p",{children:[z(o)," ",z(l)]}),e.jsxs("p",{children:[z(i),", ",x," ",c]}),r&&m&&e.jsxs(e.Fragment,{children:[e.jsx("h4",{className:"mt-20 text-grey uppercase",children:"Delivery Instructions"}),e.jsx("p",{children:m})]}),r&&!m&&e.jsx("button",{type:"button",onClick:g,className:"link text-body-sm mt-20 flex items-center",children:"+ Add delivery instructions"})]}),e.jsx("button",{type:"button",onClick:()=>f(!0),className:`${h.edit} self-start lg:self-center`,children:"Edit"})]})}Ne.propTypes={setPageAlert:u.func.isRequired};function ue({address:a,ebtCard:t,isDeliveredByImperfect:n,marketplaceOpen:s,setIsEditing:r,setPageAlert:o,subscriptionID:l}){var me;const i=oe(),{address1:m,address2:x,city:c,deliveryInstructions:y,province:f,zip:g,...N}=a,S=i.state!=="idle"&&i.formData!==void 0,[E,R]=d.useState(!1),[M,A]=d.useState(!1),[te,T]=d.useState(!1),[w,q]=d.useState(null),[U,ae]=d.useState(null),Y=d.useRef(null),[ne,O]=d.useState(m??""),[F,L]=d.useState(x??""),[_,Q]=d.useState(c??""),[re,C]=d.useState(f??""),[K,j]=d.useState(g??""),Z=ns(rs,re);d.useEffect(()=>{var p,b;i.state==="idle"&&((p=i.data)!=null&&p.success)&&(r(!1),o(s?"success.shipping.customize":"success.shipping"),window.scroll({top:0,behavior:"smooth"})),R(i.state==="idle"&&((b=i.data)==null?void 0:b.error))},[i]);async function v(p,b){const B=new Promise((W,G)=>{Y.current={resolve:W,reject:G}});return q(p),ae(us(b)),T(!0),B}const ve=p=>{const{value:b}=p.target;/^[0-9]*$/.test(b)&&b.length<=5&&j(b)},Se=async p=>{var W,G;p.preventDefault(),A(!1);const b=new FormData(p.currentTarget),B=Object.fromEntries(b);if(Ke({street:B.address1}))return b.append("addressError",!0),i.submit(b,{method:"POST",action:"/account/profile"});try{const I=await ls(B),[k]=((W=I==null?void 0:I.lookups[0])==null?void 0:W.result)??null;if(ds({smartyAddress:k,formAddress:B})){A(!0);return}const Ee=cs({footnotes:(G=k==null?void 0:k.analysis)==null?void 0:G.footnotes});if(k&&Ee){const V=await v(B,k);switch(V.choice){case"keepAddress":break;case"useSuggestedAddress":Object.keys(V==null?void 0:V.address).forEach(pe=>b.set(pe,V.address[pe]));break;case"cancel":return!1;default:throw new Error("Unknown customerResponse for AddressVerificationModal.")}}}catch(I){const k=(I==null?void 0:I.error)??I;$(k),console.error(k)}return i.submit(b,{method:"POST",action:"/account/profile"})};return e.jsxs(e.Fragment,{children:[e.jsx("form",{action:".",method:"POST",onSubmit:Se,children:e.jsxs("fieldset",{className:"flex flex-col gap-5",children:[e.jsx(is,{inputValue:ne,setInputValue:O,setAddressSelection:p=>{O((p==null?void 0:p.streetLine)??""),L(""),Q((p==null?void 0:p.city)??""),C((p==null?void 0:p.state)??""),j((p==null?void 0:p.zipcode)??"")}}),e.jsx(D,{value:z(F),onChange:p=>L(p.target.value),id:"address2",label:"Apt, Suite, etc",name:"address2"}),e.jsxs("div",{className:"grid gap-10 lg:grid-cols-2",children:[e.jsx(D,{id:"city",name:"city",value:z(_),onChange:p=>Q(p.target.value),label:"City",required:!0}),e.jsx(D,{id:"zip",name:"zip",value:K,maxLength:5,label:"Zip",type:"number",pattern:"[0-9]*",required:!0,onChange:ve})]}),e.jsx("div",{className:"my-10",children:e.jsx(ms,{...Z,required:!0})}),e.jsxs("div",{id:"deliveryInstructions",children:[n&&e.jsxs(e.Fragment,{children:[e.jsx(D,{multiline:!0,id:"delivery-instructions",rows:5,name:"deliveryInstructions",defaultValue:y,label:"Delivery Instructions",maxLength:300,placeholder:"For example: ring doorbell, leave package by the side door..."}),e.jsxs("p",{className:"text-body-desktop-xs text-grey",children:["Delivery instructions will be saved and associated with this shipping address. They will be applied to any future orders that are being delivered via a compatible carrier."," "]})]}),e.jsx("p",{className:"text-body-sm my-15 font-grotesk-bold",children:s?e.jsxs(e.Fragment,{children:["Heads up! Your cart will be cleared"," ",t!=null&&t.last4?"and any EBT payments made may be refunded":""," if you change your address during an open shopping window."]}):e.jsx(e.Fragment,{children:"Heads up! Any updates will apply to future orders only. Your past orders, where the shopping window has already ended, will not be affected."})}),e.jsx("input",{type:"hidden",defaultValue:l,name:"subscriptionID"}),e.jsx("input",{type:"hidden",defaultValue:"updateAddress",name:"_action"}),Object.keys(N).map(p=>e.jsx("input",{type:"hidden",name:p,value:N[p]??""},p)),E&&e.jsx("div",{className:"mt-15",children:e.jsx(P,{variant:"error",onClose:()=>R(!1),children:((me=i==null?void 0:i.data)==null?void 0:me.message)||"Unable to update shipping address."})}),M&&e.jsx("div",{className:"mt-15",children:e.jsx(P,{variant:"error",onClose:()=>A(!1),children:"We can't deliver to PO Boxes. Please enter another address."})}),e.jsx("div",{className:"mt-15",children:e.jsx(H,{size:"lg",type:"submit",disabled:S,children:S?"Saving...":"Save"})}),e.jsx("button",{type:"button",onClick:()=>r(),className:h.cancel,children:"Cancel"})]})]})}),te&&e.jsx(os,{headline:"Verify your address",onClose:()=>T(!1),providedAddress:w,suggestedAddress:U,handleVerification:Y.current.resolve})]})}ue.propTypes={address:u.shape({}).isRequired,ebtCard:u.shape({last4:u.string}),isDeliveredByImperfect:u.bool.isRequired,marketplaceOpen:u.bool.isRequired,setIsEditing:u.func.isRequired,setPageAlert:u.func.isRequired,subscriptionID:u.number.isRequired};ue.defaultProps={ebtCard:null};const vs=ts();function As(){var y;const{data:a={}}=ee(),{data:t={},isLoading:n}=se(),{data:s={}}=Ze(),[r,o]=d.useState(""),{status:l}=t,i=l==="CANCELLED",m={"success.shipping":{variant:"success",message:"Your shipping address has updated."},"success.shipping.customize":{variant:"success",message:e.jsxs(e.Fragment,{children:["Your shipping address has updated. ",e.jsx(hs,{})]})},"success.payment":{variant:"success",message:"Your payment information was successfully updated."},"error.payment":{variant:"error",message:"Unable to update billing information."}},x=r!=null&&r.message?r:m[r]??null;if(n||!t)return"Loading your profile...";const{sumCreditBalance:c}=s;return e.jsxs("div",{className:"space-y-20",children:[i&&e.jsx("div",{className:"mb-20",children:e.jsx(P,{variant:"error",children:"Your plan is currently canceled."})}),e.jsx("h1",{className:"text-heading-sm mb-20",children:"My Profile"}),x&&e.jsx(P,{variant:x.variant,onClose:()=>o(""),children:x.message}),e.jsxs("section",{className:h.section,children:[e.jsx("h2",{className:h.sectionHeading,children:"Personal Information"}),e.jsx(Ns,{})]}),e.jsxs("section",{className:h.section,children:[e.jsx("h2",{className:`${h.sectionHeading} hidden lg:block`,children:"Shipping Address"}),e.jsx(Ne,{setPageAlert:o})]}),e.jsxs("section",{className:h.section,children:[e.jsx("h2",{className:`${h.sectionHeading} hidden lg:block`,children:"Payment Method"}),e.jsx(js,{setPageAlert:o,stripePromise:vs})]}),((y=a==null?void 0:a.featureFlags)==null?void 0:y.featureSnapEnabled)&&e.jsx("section",{className:h.section,children:e.jsx(gs,{setPageAlert:o,ebtCard:t==null?void 0:t.ebtCard})}),e.jsxs("section",{className:h.section,children:[e.jsx("h2",{className:h.sectionHeading,children:"Promos & Credits"}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-body-md flex items-center gap-10",children:[e.jsx(ps,{width:26}),e.jsxs("p",{children:[e.jsx("span",{className:"font-grotesk-bold",children:`$${c>0?c.toFixed(2):"0.00"}`})," ","credits available. A max of $",We," in credits may be applied to any single order.",e.jsx(J,{to:"/account/promotions",className:"text-body-sm link ml-10",children:"View all"})]})]}),e.jsx("p",{className:"text-body-sm mt-25",children:e.jsx(J,{to:"/account/promotions",className:"link",children:"Have a discount code?"})})]})]}),e.jsxs("section",{className:h.section,children:[e.jsx("h2",{className:h.sectionHeading,children:"Email & Text Notifications"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-body-md mb-10 lg:mb-20",children:"Looking to make changes to your email and text notifications?"}),e.jsx(J,{to:"/account/notifications",className:"link text-body-sm",children:"Update my notification settings"})]})]})]})}export{As as Component}; 2//# sourceMappingURL=Profile-CLpRVpCu.js.map
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.