1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1721],{46965:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/personal",function(){return n(7656)}])},51082:function(e,t,n){"use strict";var r=n(85893),s=n(45697),a=n.n(s),i=n(16330),l=n(39403);function o(e){let{imageType:t,src:n,size:s,sx:a}=e;return(0,r.jsx)(l.Z,{sx:{width:"".concat(s,"px"),height:"".concat(s,"px"),bg:"var(--accents-2)",borderRadius:"9999px",overflow:"hidden",flexShrink:0,border:"1px solid var(--accents-2)",...a},children:n?(0,r.jsx)(i.Z,{src:n,width:s,height:s,alt:"",imageType:t}):null})}o.propTypes={src:a().string},o.defaultProps={size:64},t.Z=o},37279:function(e,t,n){"use strict";var r=n(85893),s=n(39403);t.Z=function(e){let{children:t,...n}=e;return(0,r.jsx)(s.Z,{bg:"var(--color-base-2)",border:"1px solid var(--color-border-1)",borderRadius:"8px",p:"24px",pb:"16px",...n,children:t})}},34328:function(e,t,n){"use strict";var r=n(85893),s=n(45685);t.Z=function(e){let{label:t,error:n,caption:a,children:i,...l}=e;return(0,r.jsxs)(s.Z,{...l,children:[(0,r.jsx)(s.Z.Label,{children:t}),i,(0,r.jsx)(s.Z.Caption,{children:a}),(0,r.jsx)(s.Z.Validity,{children:n})]})}},73587:function(e,t,n){"use strict";var r=n(85893),s=n(11163),a=n(39403),i=n(91269),l=n(65746),o=n(21239),d=n(98694);let c=[{name:"Profile",href:"/settings/personal"},{name:"Appearance",href:"/settings/appearance"},{name:"Referrals",href:"/settings/referrals"}],x=e=>{let{name:t,href:n,exactPath:s,router:a}=e;return(0,r.jsx)(l.Z.LinkItem,{href:n,active:s?a.asPath===n:a.asPath.startsWith(n),children:t,"data-ga-click":JSON.stringify({category:"Settings Navigation",action:"Clicked ".concat(t),label:n})})};t.Z=function(e){let{children:t}=e,n=(0,s.useRouter)(),{user:u}=(0,o.Z)(),h=[{name:"Company Profile",href:"/settings",exactPath:!0,show:(0,d.GJ)(u)},{name:"Account Details",href:"/settings/account",exactPath:!0,show:(0,d.GJ)(u)},{name:"Teammates",href:"/settings/team",show:(0,d.Fs)(u,"team_user_actions")},{name:"Plans & Billing",href:"/settings/billing",exactPath:!0,show:(0,d.GJ)(u)},{name:"Locations",href:"/settings/locations",exactPath:!0,show:(0,d.GJ)(u)},{name:"Standards & Formats",href:"/settings/standards",exactPath:!0,show:(0,d.GJ)(u)},{name:"Integrations",href:"/settings/integrations",exactPath:!1,show:(0,d.GJ)(u)},{name:"Webhooks",href:"/settings/webhooks",exactPath:!0,show:(0,d.GJ)(u)},{name:"Defaults",href:"/settings/other",exactPath:!0,show:(0,d.GJ)(u)}],p=h.filter(e=>{let{show:t}=e;return t});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Z,{as:"h1",fontSize:"24px",mb:"24px",children:"Settings"}),(0,r.jsxs)(a.Z,{display:"grid",gridTemplateColumns:["1fr","1fr","1fr","20% 1fr"],gridGap:"24px",children:[(0,r.jsxs)(a.Z,{as:"nav",children:[p.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)(i.Z,{sx:{color:"var(--accents-5)",fontSize:"12px",fontWeight:"bold"},children:"Workspace"}),(0,r.jsx)(l.Z,{children:p.map(e=>(0,r.jsx)(x,{router:n,...e},e.name))})]}),(0,r.jsx)(i.Z,{sx:{color:"var(--accents-5)",fontSize:"12px",fontWeight:"bold"},children:"Personal"}),(0,r.jsx)(l.Z,{children:c.map(e=>(0,r.jsx)(x,{router:n,...e},e.name))})]}),(0,r.jsx)("div",{children:t})]})]})}},7656:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return _}});var r=n(85893),s=n(49062),a=n(1637),i=n(36309),l=n(73587),o=n(67294),d=n(61830),c=n(83657),x=n(80982),u=n(1815),h=n(39403),p=n(91269),f=n(32737),m=n(78833),g=n(80108),j=n(8663),Z=n(10230),v=n(34328),w=n(37279),b=n(21239),y=n(52978),C=n(45685),S=n(11575),P=n(51082),k=n(56726),E=n(39135),z=function(e){let{user:t,userMutate:s}=e,a=(0,j.pm)(),i=(0,o.useRef)(),l=(0,o.useRef)(),[d,c]=(0,o.useState)(),[x,u]=(0,o.useState)(),[g,Z]=(0,o.useState)(),v=(0,o.useCallback)(()=>{c(null),u(null),Z(!1)},[]),w=(0,o.useCallback)(e=>{let t=e.target.files[0],n=new FileReader;n.addEventListener("load",e=>{let{target:n}=e;c(t),u(n.result)}),n.readAsDataURL(t)},[i]),b=(0,o.useCallback)(e=>{let t=l.current,n=t.getContext("2d"),r=e.detail.x,s=e.detail.y,a=e.detail.width,i=e.detail.height,o=new Image;o.addEventListener("load",e=>{let{target:l}=e;t.width=a,t.height=i,n.drawImage(l,r,s,a,i,0,0,a,i)},{once:!0}),o.src=e.target.src},[l]),z=(0,o.useCallback)(async()=>{let e=l.current;Z(!0),e.toBlob(async e=>{try{let t=await y.M$(d),n=await y.cT(e,{uploadUrl:t});await y.Lj({avatar:n}),await s(),a({content:"Profile image updated successfully."})}catch(e){a({variant:"danger",content:"An unexpected error has occurred. Please try again."})}finally{v()}},d.type)},[l,d]);return(0,o.useEffect)(()=>{n.e(9613).then(n.bind(n,39613))},[]),(0,o.useEffect)(()=>{let e="image-crop-change";return document.addEventListener(e,b),()=>document.removeEventListener(e,b)},[b]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(C.Z,{children:[(0,r.jsxs)(C.Z.Label,{"data-ga-click":JSON.stringify({category:"User profile settings",action:"Clicked user profile picture"}),children:[(0,r.jsx)(h.Z,{display:"flex",mb:"4px"}),(0,r.jsx)(E.Z,{id:"avatar",as:"h2",sx:{fontSize:"20px",fontWeight:600,mb:"12px"},children:"Avatar"}),(0,r.jsx)(P.Z,{src:null==t?void 0:t.avatar,size:"200",sx:{cursor:"pointer"}})]}),(0,r.jsx)(m.Z,{type:"file",accept:"image/*",onChange:w,sx:{display:"none"}})]}),x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{onClick:v,sx:{background:"var(--color-base-1)",opacity:.25,position:"fixed",inset:0,cursor:"default",display:"block",zIndex:1}}),(0,r.jsxs)(h.Z,{sx:{borderRadius:"8px",boxShadow:"0 30px 60px var(--shadow-xl)",bg:"var(--color-base-2)",width:"460px",maxWidth:"calc(100% - 32px)",maxHeight:"80vh",margin:"10vh auto",position:"fixed",top:0,left:"50%",transform:"translateX(-50%)",display:"flex",flexDirection:"column",flexShrink:0,zIndex:1},children:[(0,r.jsx)(h.Z,{sx:{p:"16px",borderBottom:"1px solid var(--accents-2)"},children:(0,r.jsx)(p.Z,{as:"h3",fontSize:"14px",children:"Crop your new profile picture"})}),(0,r.jsx)(h.Z,{sx:{p:"16px",overflow:"auto"},children:(0,r.jsxs)(h.Z,{sx:{position:"relative"},children:[(0,r.jsx)("image-crop",{src:x,rounded:!0,children:(0,r.jsx)("div",{"data-loading-slot":!0,children:(0,r.jsx)(h.Z,{display:"flex",justifyContent:"center",children:(0,r.jsx)(S.Z,{})})})}),(0,r.jsx)(k.Z,{children:(0,r.jsx)("canvas",{ref:l})}),g&&(0,r.jsx)(h.Z,{sx:{backgroundColor:"var(--color-base-2)",display:"flex",alignItems:"center",justifyContent:"center",flex:1,position:"absolute",inset:0,zIndex:1},children:(0,r.jsx)(S.Z,{})})]})}),(0,r.jsx)(h.Z,{sx:{p:"16px",borderTop:"1px solid var(--accents-2)"},children:(0,r.jsx)(f.Z,{onClick:z,sx:{width:"100%"},disabled:g,children:g?"Uploading...":"Set new profile picture"})})]})]})]})},L=function(){let e=(0,j.pm)(),[t,n]=(0,o.useState)(),[s,i]=(0,o.useState)(!1),{user:l,mutate:C}=(0,b.Z)(),S=(0,o.useCallback)(async(t,r)=>{let{formData:s,isValid:a,actions:i}=t;if(!Object.keys(s).length||!a||s.newPassword!==s.passwordConfirmation){n("Password confirmation doesn't match the password");return}i.setSubmitting(!0),s.passwordConfirmation="";let l=c.Z.serializeVariables(s);try{await (0,x.Z)([d.Z.UPDATE_PASSWORD,l]),e({content:"Password updated successfully."}),n(null),r.target.reset()}catch(e){u.Z.error("updatePassword",e),u.Z.captureException(e,"updatePassword"),n(null==e?void 0:e.message)}finally{i.setSubmitting(!1)}},[e]),P=(0,o.useCallback)(async t=>{let{formData:n,isValid:r,actions:s}=t;if(!r)return;let a=c.Z.serializeVariables(n);s.setSubmitting(!0);try{await y.Lj(a),C(),e({content:"User profile updated."})}catch(t){e({variant:"danger",content:null==t?void 0:t.message})}finally{s.setSubmitting(!1)}},[e,C]),k=(0,o.useCallback)(async(t,n)=>{let{formData:r,isValid:s,actions:a}=t;if(!s)return;let l=c.Z.serializeVariables(r);a.setSubmitting(!0);try{await (0,x.Z)([d.Z.CHANGE_EMAIL,l]),i(!0),e({content:"Confirmation email sent."}),n.target.reset()}catch(t){u.Z.error("changeEmail",t),u.Z.captureException(t,"changeEmail"),e({variant:"danger",content:null==t?void 0:t.message})}finally{a.setSubmitting(!1)}},[e]);return(0,r.jsxs)(w.Z,{children:[(0,r.jsx)(E.Z,{id:"profile",as:"h2",sx:{fontSize:"20px",fontWeight:600,mb:"12px"},children:"Personal Profile"}),(0,r.jsx)(Z.Z,{onSubmit:P,children:e=>{var n,s,i,o;let{errors:d,isValid:c,isSubmitting:x}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.FA,{gap:"16px",children:[(0,r.jsx)(v.Z,{label:"First name",error:null==d?void 0:null===(s=d.updateUserProfile)||void 0===s?void 0:null===(n=s.firstName)||void 0===n?void 0:n.validationMessage,children:(0,r.jsx)(m.Z,{type:"text",name:"firstName",defaultValue:l.firstName,required:!0})}),(0,r.jsx)(v.Z,{label:"Last name",error:null==d?void 0:null===(o=d.updateUserProfile)||void 0===o?void 0:null===(i=o.lastName)||void 0===i?void 0:i.validationMessage,children:(0,r.jsx)(m.Z,{type:"text",name:"lastName",defaultValue:l.lastName,required:!0})}),(0,r.jsx)(p.Z,{color:"var(--error-text)",fontSize:"14px",children:t})]}),(0,r.jsx)(h.Z,{display:"flex",justifyContent:"flex-end",children:(0,r.jsx)(f.Z,{isLoading:x,disabled:!c,children:"Save"})})]})}}),(0,r.jsx)(g.Z,{sx:{mx:"-24px",mt:4,mb:3}}),(0,r.jsx)(z,{user:l,userMutate:C}),(0,r.jsx)(g.Z,{sx:{mx:"-24px",mt:4,mb:3}}),(0,r.jsx)(E.Z,{id:"change-email",as:"h2",sx:{fontSize:"20px",fontWeight:600,mb:"12px"},children:"Change email"}),(0,r.jsx)(Z.Z,{onSubmit:k,children:e=>{var t;let{errors:n,isValid:i,isSubmitting:o}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.FA,{gap:"16px",children:[(0,r.jsx)(v.Z,{label:"Current email",error:null,children:(0,r.jsx)(m.Z,{type:"email",defaultValue:l.email,disabled:!0})}),(0,r.jsx)(v.Z,{label:"New email",error:null==n?void 0:null===(t=n.newEmail)||void 0===t?void 0:t.validationMessage,children:(0,r.jsx)(m.Z,{type:"email",name:"newEmail",defaultValue:"",autoComplete:"email",required:!0})}),s&&(0,r.jsx)(p.Z,{color:"var(--color-success)",fontSize:"14px",children:"Check your new email address for a confirmation link."})]}),(0,r.jsx)(g.Z,{sx:{mx:"-24px",mt:4,mb:3}}),(0,r.jsx)(h.Z,{display:"flex",justifyContent:"flex-end",children:(0,r.jsx)(f.Z,{isLoading:o,disabled:!i,children:"Send confirmation"})})]})}}),(0,r.jsx)(g.Z,{sx:{mx:"-24px",mt:4,mb:3}}),(0,r.jsx)(E.Z,{id:"change-password",as:"h2",sx:{fontSize:"20px",fontWeight:600,mb:"12px"},children:"Change password"}),(0,r.jsx)(Z.Z,{onSubmit:S,children:e=>{var n,s;let{errors:i,isValid:l,isSubmitting:o}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.FA,{gap:"16px",children:[(0,r.jsx)(v.Z,{label:"Old password",error:null==i?void 0:null===(n=i.password)||void 0===n?void 0:n.validationMessage,children:(0,r.jsx)(m.Z,{type:"password",name:"password",defaultValue:null,autoComplete:"current-password",required:!0})}),(0,r.jsx)(v.Z,{label:"New password",error:null==i?void 0:null===(s=i.newPassword)||void 0===s?void 0:s.validationMessage,children:(0,r.jsx)(m.Z,{type:"password",name:"newPassword",defaultValue:null,autoComplete:"new-password",required:!0})}),(0,r.jsx)(v.Z,{label:"Confirm new password",error:null,children:(0,r.jsx)(m.Z,{type:"password",name:"passwordConfirmation",defaultValue:null,autoComplete:"new-password",required:!0})}),(0,r.jsx)(p.Z,{color:"var(--error-text)",fontSize:"14px",children:t})]}),(0,r.jsx)(g.Z,{sx:{mx:"-24px",mt:4,mb:3}}),(0,r.jsx)(h.Z,{display:"flex",justifyContent:"flex-end",children:(0,r.jsx)(f.Z,{isLoading:o,disabled:!l,children:"Update password"})})]})}})]})};function N(){return(0,r.jsx)(i.Z,{children:(0,r.jsx)(l.Z,{children:(0,r.jsx)(a.FA,{gap:"32px",children:(0,r.jsx)(L,{})})})})}N.requireAuth=!0,N.accountType=[s.Z.buyer,s.Z.seller],N.meta={title:"Personal settings"};var _=N},39135:function(e,t,n){"use strict";var r=n(82729),s=n(85893),a=n(45697),i=n.n(a),l=n(19521),o=n(91269),d=n(15857);function c(){let e=(0,r._)(["\n .anchor {\n color: currentColor;\n margin-left: 8px;\n }\n\n .anchor > svg {\n visibility: hidden;\n }\n\n &:hover .anchor > svg {\n visibility: visible;\n }\n"]);return c=function(){return e},e}let x=(0,l.ZP)(o.Z).withConfig({componentId:"sc-1a98774c-0"})(c());function u(e){let{id:t,children:n,...r}=e;return(0,s.jsxs)(x,{...r,children:[n,(0,s.jsx)("a",{href:"#".concat(t),id:t,"aria-hidden":"true",className:"anchor",children:(0,s.jsx)(d.Z,{fill:"currentColor"})})]})}
1u.propTypes={id:i().string.isRequired},t.Z=u},15857:function(e,t,n){"use strict";var r=n(85893);t.Z=function(e){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",width:16,height:16,...e,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",fill:"none",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})})}}},function(e){e.O(0,[2978,9774,2888,179],function(){return e(e.s=46965)}),_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.