1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[6670],{53098(e,r,s){s.r(r),s.d(r,{ManageAccountPageComponent:()=>Y,default:()=>$});var t=s(89379),n=s(65043),a=s(23923),o=s(83003),c=s(63775),i=s(76732),l=s(92174),d=(s(44356),s(41233)),u=s(26297),m=s(84539),g=s(44104),p=s(64109),A=s(71702),P=s(37614),_=s(77775),h=s(98139),f=s.n(h),x=s(23526),j=s(16882);const b={root:"DeleteAccountForm_root__SGnDi",confirmChangesSection:"DeleteAccountForm_confirmChangesSection__kTfQW",confirmChangesSectionVisible:"DeleteAccountForm_confirmChangesSectionVisible__opRjO",emailStyle:"DeleteAccountForm_emailStyle__QoaKf",helperLink:"DeleteAccountForm_helperLink__b5CR5 a",confirmChangesTitle:"DeleteAccountForm_confirmChangesTitle__LOk1B",confirmChangesInfo:"DeleteAccountForm_confirmChangesInfo__9c6D8",bottomWrapper:"DeleteAccountForm_bottomWrapper__M5u1C",submitButton:"DeleteAccountForm_submitButton__3Ihkj",error:"DeleteAccountForm_error__dBOQ0"};var D=s(70579);const k=e=>{const{error:r}=e,s=(0,j.M8)(r),t=(0,j.tC)(r),n=(0,j.UJ)(r);return r&&!t?(0,D.jsx)("p",{className:b.error,children:s?(0,D.jsx)(l.sA,{id:"DeleteAccountForm.ongoingTransactionsError"}):n?(0,D.jsx)(l.sA,{id:"DeleteAccountForm.stripeDeletionFailedError"}):(0,D.jsx)(l.sA,{id:"DeleteAccountForm.deleteAccountError"})}):null},T=e=>{const{onSubmitDeleteAccount:r,intl:s,marketplaceName:a,onResetPassword:o}=e,[c,i]=(0,n.useState)({}
1),[d,u]=(0,n.useState)(!1),m=()=>{u(!0),o(e.currentUser.attributes.email)};return(0,D.jsx)(_.lV,(0,t.A)((0,t.A)({},e),{},{initialValues:c,onSubmit:e=>(i(e),r(e)),render:e=>{const{rootClassName:r,className:t,deleteAccountError:n,formId:o,handleSubmit:c,currentUser:i,inProgress:u=!1,invalid:g,values:A,resetPasswordInProgress:P=!1}=e,{confirmDeleteAccount:_,currentPassword:h}=A,{email:T}=i.attributes,w=Array.isArray(_)&&_.length>0,N=s.formatMessage({id:"DeleteAccountForm.passwordRequired"}),v=x.kO(N),F=s.formatMessage({id:"DeleteAccountForm.passwordTooShort"},{minLength:x.wz}),S=x.Bp(F,x.wz),C=w?x.k3(v,S):null,y=s.formatMessage({id:"DeleteAccountForm.passwordFailed"}),I=(0,j.tC)(n)?y:null,L=d||P?(0,D.jsx)(l.sA,{id:"DeleteAccountForm.resetPasswordLinkSent",values:{email:(0,D.jsx)("span",{className:b.emailStyle,children:i.attributes.email}),resendPasswordLink:(0,D.jsx)("span",{className:b.helperLink,onClick:m,role:"button",children:(0,D.jsx)(l.sA,{id:"DeleteAccountForm.resendPasswordLinkText"})})}}):(0,D.jsx)("span",{className:b.helperLink,onClick:m,role:"button",children:(0,D.jsx)(l.sA,{id:"DeleteAccountForm.resetPasswordLinkText"})}),E=f()(b.confirmChangesSection,{[b.confirmChangesSectionVisible]:w}),M=f()(r||b.root,t),U=g||u||!(w&&h);return(0,D.jsxs)(p.lV,{className:M,onSubmit:e=>{c(e)},children:[(0,D.jsx)(p.Gt,{id:"confirmDeleteAccount",name:"confirmDeleteAccount",label:s.formatMessage({id:"DeleteAccountForm.checkboxLabel"}),value:"deleteAccountSelected",useSuccessColor:!0}),(0,D.jsx)("br",{}),(0,D.jsxs)("p",{className:b.confirmChangesInfo,children:[(0,D.jsx)(l.sA,{id:"DeleteAccountForm.confirmDeleteInfo",values:{marketplaceName:a}}),(0,D.jsx)("br",{})]}),(0,D.jsxs)("div",{className:E,"aria-hidden":!w,children:[(0,D.jsx)(p.H4,{as:"h3",className:b.confirmChangesTitle,children:(0,D.jsx)(l.sA,{id:"DeleteAccountForm.confirmDeleteTitle"})}),(0,D.jsxs)("p",{className:b.confirmChangesInfo,children:[(0,D.jsx)(l.sA,{id:"DeleteAccountForm.deleteAccountInfo",values:{email:T}}),(0,D.jsx)("br",{}),(0,D.jsx)(l.sA,{id:"DeleteAccountForm.resetPasswordInfo",values:{resetPasswordLink:L}})]}),(0,D.jsx)(p.k7,{className:b.password,type:"password",name:"currentPassword",id:o?"".concat(o,".currentPassword"):"currentPassword",disabled:!w,autoComplete:"current-password",label:s.formatMessage({id:"DeleteAccountForm.passwordLabel"}),placeholder:s.formatMessage({id:"DeleteAccountForm.passwordPlaceholder"}),validate:C,customErrorText:I})]}),(0,D.jsxs)("div",{className:b.bottomWrapper,children:[(0,D.jsx)(k,{error:n}),(0,D.jsx)(p.jn,{className:b.submitButton,type:"submit",inProgress:u,disabled:U,children:(0,D.jsx)(l.sA,{id:"DeleteAccountForm.deleteAccount"})})]})]})}}))};var w=s(92537),N=s(50994);const v="TrackingPreferences_root__u50+6",F="TrackingPreferences_placeholder__-v-af",S="TrackingPreferences_title__nPO2o",C="TrackingPreferences_description__EHPQb",y="TrackingPreferences_row__FhOTX",I="TrackingPreferences_label__S4+CG",L="TrackingPreferences_switchWrapper__IfaWv",E="TrackingPreferences_switchInput__sTmy4",M="TrackingPreferences_switchTrack__TOelS",U="TrackingPreferences_switchThumb__KFxa6",O="TrackingPreferences_status__4g6EZ",V=()=>{const[e,r]=(0,n.useState)(!1),[s,t]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t("accepted"===(0,w.hr)()),r(!0);return(0,w.hp)(e=>{t("accepted"===e)})},[]);return e?(0,D.jsxs)("section",{className:v,"aria-labelledby":"TrackingPreferences.title",children:[(0,D.jsx)("h3",{id:"TrackingPreferences.title",className:S,children:(0,D.jsx)(l.sA,{id:"TrackingPreferences.title"})}),(0,D.jsx)("p",{className:C,children:(0,D.jsx)(l.sA,{id:"TrackingPreferences.description"})}),(0,D.jsxs)("label",{className:y,htmlFor:"tracking-toggle",children:[(0,D.jsx)("span",{className:I,children:(0,D.jsx)(l.sA,{id:"TrackingPreferences.toggleLabel"})}),(0,D.jsxs)("span",{className:L,children:[(0,D.jsx)("input",{id:"tracking-toggle",type:"checkbox",className:E,checked:s,onChange:e=>{const r=e.target.checked;t(r),r?((0,w.bi)("accepted"),(0,N.CZ)()):((0,w.bi)("declined"),(0,N.hE)())},"aria-describedby":"TrackingPreferences.status"}),(0,D.jsx)("span",{className:M,"aria-hidden":"true",children:(0,D.jsx)("span",{className:U})})]})]}),(0,D.jsx)("p",{id:"TrackingPreferences.status",className:O,children:(0,D.jsx)(l.sA,{id:s?"TrackingPreferences.statusOn":"TrackingPreferences.statusOff"})})]}):(0,D.jsx)("div",{className:F,"aria-hidden":"true"})};var B=s(30183);const z={content:"ManageAccountPage_content__q66Qr",desktopTopbar:"ManageAccountPage_desktopTopbar__6T-8x",mobileTopbar:"ManageAccountPage_mobileTopbar__A6LlL",accountPageDivider:"ManageAccountPage_accountPageDivider__T71NL",deleteAccountSubtitle:"ManageAccountPage_deleteAccountSubtitle__ViOv+"};var R=s(80045),W=s(19853),H=s.n(W),Q=s(1863);const K="PrivateDetailsForm_root__NoVxz",Z="PrivateDetailsForm_sectionContainer__2lVbo",q="PrivateDetailsForm_error__hmhw4 h4",G="PrivateDetailsForm_submitButton__zormo",J=["key"],X=e=>
1{const[r,s]=(0,n.useState)({});return(0,D.jsx)(_.lV,(0,t.A)((0,t.A)({},e),{},{mutators:(0,t.A)({},Q.A),render:e=>{const{className:n,currentUser:a,handleSubmit:o,intl:c,invalid:i,pristine:d,rootClassName:m,updateInProgress:g,updateProfileError:A,formId:P,values:_,userFields:h,userTypeConfig:x}=e,j=A?(0,D.jsx)("div",{className:q,children:(0,D.jsx)(l.sA,{id:"PrivateDetailsForm.updateProfileFailed"})}):null,b=f()(m||K,n),k=g,T=Object.keys(r).length>0&&H()(_,r),w=i||d||T||k,N=(0,u.lz)(h,c,null===x||void 0===x?void 0:x.userType,!1);return(0,D.jsxs)(p.lV,{className:b,onSubmit:e=>{s(_),o(e)},children:[(0,D.jsx)("div",{className:f()(Z),children:N.map(e=>{let{key:r}=e,s=(0,R.A)(e,J);return(0,D.jsx)(p.hu,(0,t.A)((0,t.A)({},s),{},{formId:P}),r)})}),j,(0,D.jsx)(p.$n,{className:G,type:"submit",inProgress:k,disabled:w,ready:T,children:(0,D.jsx)(l.sA,{id:"PrivateDetailsForm.saveChanges"})})]})}}))},Y=e=>{const r=(0,c._r)(),s=(0,i.Z6)(),n=(0,l.tz)(),{deleteAccountError:a,deleteAccountInProgress:o,currentUser:g,scrollingDisabled:_,onSubmitDeleteAccount:h,onResetPassword:f,onUpdateProfile:x,resetPasswordInProgress:j=!1,resetPasswordError:b,updateProfileInProgress:k=!1,updateProfileError:w}=e,N=(0,d.vs)(g),{publicData:v,protectedData:F,privateData:S}=null===N||void 0===N?void 0:N.attributes.profile,{userType:C}=v||{},{userFields:y,userTypes:I=[]}=r.user,L=y.filter(e=>["private","protected"].includes(e.scope)),E=I.find(e=>e.userType===C),M=L.length>0&&!!L.find(e=>!e.userTypeConfig.limitToUserTypeIds||e.userTypeConfig.limitToUserTypeIds&&e.userTypeConfig.userTypeIds.includes(null===E||void 0===E?void 0:E.userType)),U=n.formatMessage({id:"ManageAccountPage.title"}
1),O=(0,u.yw)(r,g),{showPayoutDetails:B,showPaymentMethods:R}=(0,u.qo)(r,g),W={currentPage:"ManageAccountPage",showPaymentMethods:R,showPayoutDetails:B};return(0,D.jsx)(p.YW,{title:U,scrollingDisabled:_,children:(0,D.jsx)(p.oM,{topbar:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(A.A,{desktopClassName:z.desktopTopbar,mobileClassName:z.mobileTopbar}),(0,D.jsx)(p.pJ,{currentPage:"ManageAccountPage",showManageListingsLink:O})]}),sideNav:null,useAccountSettingsNav:!0,accountSettingsNavProps:W,footer:(0,D.jsx)(P.A,{}),intl:n,children:(0,D.jsxs)("div",{className:z.content,children:[(0,D.jsx)(p.H3,{as:"h1",children:(0,D.jsx)(l.sA,{id:"ManageAccountPage.heading"})}),M?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(X,{className:z.form,currentUser:g,initialValues:(0,t.A)((0,t.A)({},(0,u.AS)(F,"protected",C,y)),(0,u.AS)(S,"private",C,y)),updateProfileError:w,updateInProgress:k,onSubmit:e=>((e,r)=>{const s={protectedData:(0,t.A)({},(0,u.sU)(e,"protected",r,y)),privateData:(0,t.A)({},(0,u.sU)(e,"private",r,y))};x(s)})(e,C),marketplaceName:r.marketplaceName,userFields:L,userTypeConfig:E,intl:n}),(0,D.jsx)("hr",{className:z.accountPageDivider})]}):null,(0,D.jsx)(V,{}),(0,D.jsx)("hr",{className:z.accountPageDivider}),N.id?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(p.H4,{as:"h3",className:z.deleteAccountSubtitle,children:(0,D.jsx)(l.sA,{id:"ManageAccountPage.deleteAccountSubtitle"})}),(0,D.jsx)(T,{intl:n,deleteAccountError:a,onSubmitDeleteAccount:e=>{const{currentPassword:r}=e;return h(r).then(()=>{const e=(0,m.pL)("LandingPage",s);"undefined"!==typeof window&&(window.location=e),console.log("logged out")})},marketplaceName:r.marketplaceName,currentUser:g,deleteAccountInProgress:o,onResetPassword:f,resetPasswordInProgress:j,resetPasswordError:b})]}):null]})})})},$=(0,a.Zz)((0,o.Ng)(e=>{const{currentUser:r}=e.user,{deleteAccountError:s,deleteAccountInProgress:t,accountDeletionConfirmed:n,resetPasswordInProgress:a,resetPasswordError:o,updateProfileInProgress:c,updateProfileError:i}=e.ManageAccountPage;return{deleteAccountError:s,deleteAccountInProgress:t,currentUser:r,accountDeletionConfirmed:n,scrollingDisabled:(0,g.kl)(e),resetPasswordInProgress:a,resetPasswordError:o,updateProfileInProgress:c,updateProfileError:i}},e=>({onSubmitDeleteAccount:r=>e((0,B.lw)(r)),onResetPassword:r=>e((0,B.xw)(r)),onUpdateProfile:r=>e((0,B.r7)(r))})))(Y)}}]); 2//# sourceMappingURL=ManageAccountPage.d3650349.chunk.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.