1var M=Object.defineProperty,O=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var y=(e,a,n)=>a in e?M(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,c=(e,a)=>{for(var n in a||(a={}))A.call(a,n)&&y(e,n,a[n]);if(h)for(var n of h(a))T.call(a,n)&&y(e,n,a[n]);return e},f=(e,a)=>O(e,N(a));var b=(e,a,n)=>new Promise((o,t)=>{var l=r=>{try{d(n.next(r))}catch(s){t(s)}},u=r=>{try{d(n.throw(r))}catch(s){t(s)}},d=r=>r.done?o(r.value):Promise.resolve(r.value).then(l,u);d((n=n.apply(e,a)).next())});import{j as i,a6 as I,c as U,n as k,i as v,B as W}from"./npm.sellpy-design-system.DdsWMDHW.bundle.js";import{c as P}from"./npm.react-hook-form.HNw-giVQ.bundle.js";import{D as R}from"./npm.luxon.3NOFZn7k.bundle.js";import{r as L,l as $}from"./npm.react-router.BDfxye5A.bundle.js";import{g as B}from"./npm.styled-components.CzYR6Qdp.bundle.js";import{u as g,b$ as Q,a9 as G,c0 as K,aa as x,ag as E,ah as C,aI as V}from"./index.DWkcZ-_z.bundle.js";import{q as z,i as H}from"./npm.apollo-client.CXJpJPbe.bundle.js";import"./npm.lodash.DxN61Y-S.bundle.js";import{u as m}from"./npm.react-i18next.BwOa93YU.bundle.js";try{let e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="8af960dd-4027-4bf0-a9f6-74ae1f2974b5",e._sentryDebugIdIdentifier="sentry-dbid-8af960dd-4027-4bf0-a9f6-74ae1f2974b5")}catch(e){}{let e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=Object.assign({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:sellpy-market":!0})}const Y=`query getEmailChangeDate { 2 completeAfter: getEmailChangeDate 3} 4`,p={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getEmailChangeDate"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"completeAfter"},name:{kind:"Name",value:"getEmailChangeDate"},arguments:[],directives:[]}]}}],loc:{start:0,end:103,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Y}}},Ee=p,J=`mutation initiateOwnEmailChange($email: String!) { 5 initiateOwnEmailChange(email: $email) 6} 7`,X={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"initiateOwnEmailChange"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"email"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"initiateOwnEmailChange"},arguments:[{kind:"Argument",name:{kind:"Name",value:"email"},value:{kind:"Variable",name:{kind:"Name",value:"email"}}}],directives:[]}]}}],loc:{start:0,end:131,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:J}}},Z=`query verifyFraudulentUser { 8 fraudulentUser: verifyFraudulentUser 9} 10`,ee={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"verifyFraudulentUser"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"fraudulentUser"},name:{kind:"Name",value:"verifyFraudulentUser"},arguments:[],directives:[]}]}}],loc:{start:0,end:109,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:Z}}},ae=ee,ne=a=>b(null,[a],function*({request:e}){yield Q({url:new URL(e.url)});const{data:n,error:o}=yield G().query({query:ae});if(n!=null&&n.fraudulentUser||o){const t=new URL(e.url);return t.pathname="/profile",L(t.toString())}return{scheduledEmailChangeRef:K(p)}}),w=B.div` 11 padding-left: 8px; 12`,ie=()=>{const{t:e}=m("profile"),{isMobile:a}=g();return i.jsxs(i.Fragment,{children:[i.jsx(w,{children:i.jsx(I,{variant:a?"collapsed":"full",options:[{link:"/home",label:e("emailChange.breadcrumbs.home")},{link:"/profile",label:e("emailChange.breadcrumbs.profile")},{label:e("headerChangeEmail")}]})}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",padding:"72px 16px",gap:"16px",width:"fit-content",margin:"0 auto"},"data-hj-suppress":!0,children:[i.jsx(U,{noMargin:!0,style:{width:"100%"},children:e("headerChangeEmail")}),i.jsx(te,{})]})]})},te=()=>{const{scheduledEmailChangeRef:e}=$(),{data:{completeAfter:a},error:n}=z(e);return i.jsx(i.Fragment,{children:a?i.jsx(_,{date:a}):n?i.jsx(re,{}):i.jsx(se,{})})},_=({date:e})=>{const{t:a}=m("profile"),{isMobile:n}=g(),t=x().email,l=R.fromISO(e).diffNow("days");return i.jsx(k,{title:a("emailChange.inProgress.header"),text:a("emailChange.inProgress.text",{email:t,numberOfDays:Math.round(l.days)}),fullWidth:n})},re=()=>{const{t:e}=m("profile");return i.jsx(k,{title:e("emailChangedError.defaultErrorHeader"),text:e("emailChangedError.
12somethingWentWrong")})},oe=e=>(a,{email:n})=>{if(a!==n)return e},le=(e,a)=>n=>{if(a===n)return e},se=()=>{const{t:e}=m(["profile","common"]),a="email",n="emailAgain",{register:o,handleSubmit:t,setError:l,formState:{errors:u}}=P(),{isMobile:d}=g(),[r,s]=H(X,{refetchQueries:[{query:p}],onCompleted:()=>{E({header:e("profile:emailChangeToast.success.header"),body:e("profile:emailChangeToast.success.body"),type:C.SUCCESS})},onError:()=>{l(a,{message:e("profile:emailChangedError.somethingWentWrong")}),l(n,{message:e("profile:emailChangedError.somethingWentWrong")}),E({header:e("profile:userForm.updateError.header"),body:e("profile:userForm.updateError.body"),type:C.ERROR})}}),D=x().email,S=t(({email:F})=>r({variables:{email:F}})),j=o(a,{required:e("common:genericErrors.required"),validate:le(e("emailChangedError.sameAsOld"),D)}),q=o(n,{required:e("common:genericErrors.required"),validate:oe(e("profile:emailForm.errorMustMatch"))});return i.jsxs(V,{onSubmit:S,style:{minWidth:"300px",width:d?"100%":"auto"},children:[i.jsx(v,f(c({},j),{errors:u,label:e("profile:emailChange.newEmail")})),i.jsx(v,f(c({},q),{errors:u,label:e("profile:emailChange.newEmailAgain")})),i.jsx("div",{style:{display:"flex",justifyContent:"center",textAlign:"center"},children:i.jsx(W,{size:"medium",type:"submit",fullWidth:!0,disabled:s.loading,label:s.loading?e("profile:userForm.button.submitting"):e("profile:userForm.button.save")})})]})},Ce=Object.freeze(Object.defineProperty({__proto__:null,BreadcrumbsContainer:w,ChangeAlreadyScheduled:_,EmailPage:ie,emailPageLoader:ne},Symbol.toStringTag,{value:"Module"}));export{w as B,_ as C,Ce as E,Ee as g,ae as v}; 13//# sourceMappingURL=EmailPage.BQ_oeGg_.bundle.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.