PageSourceSearch

https://www.sarstedt.com/_next/static/chunks/pages/[country]/customer/profile-cdc19a7fdf1d772a.js

js sarstedt.com collected 2026-09-25 18:47:52 UTC 13,981 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9597],{30898:(e,r,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[country]/customer/profile",function(){return s(70172)}])},70172:(e,r,s)=>{"use strict";s.r(r),s.d(r,{__N_SSP:()=>W,default:()=>q});var o=s(37876),a=s(40575),i=s(77561),n=s(51960),l=s(5076),t=s(30647),d=s(43090),m=s(25407),c=s(36535),p=s(14169),u=s(39306),h=s(95068),f=s(77328),w=s.n(f),b=s(19581),x=s(14430),g=s(91717),v=s(75511),C=s(97389),y=s(6703),j=s(52913),P=s(89099),N=s(14232),L=s(99370),E=s(38842),S=s(75198),I=s(27343),$=s(3033),O=s(55063),F=s(37262),A=s(47497),T=s(87820),_=s(54498),D=s(27937),R=s(83388),k=s(81700),M=s(32266),V=s(15819),B=s(64802);let H=({customer:e,country:r})=>{let{t:s}=(0,j.A)(),c=(0,P.useRouter)(),{language:p}=(0,x.JK)(c),u=`/${p}/${(0,x.$9)(r)}`,{region:h}=(0,R.A)(),f=(0,k.WU)(h),w=(0,N.useMemo)(()=>(0,_.a)(r),[r]),T=(0,N.useMemo)(()=>(0,E.VD)(r),[r]),V=w.department.isVisible&&!(0,I.$1)(r),H=(0,N.useMemo)(()=>(0,E.uD)(r)?(0,E.VD)(r):{firstName:L.n.FIRST_NAME,lastName:L.n.LAST_NAME},[r]),U=w.taxID.isVisible||w.invoiceEmail.isVisible||w.invoiceOperatorCode.isVisible,W={headline:s("common:personalDataHeadline"),inputs:{name:{label:h.isNordic?s("forms:nordicNameLabel"):s("forms:firstNameLabel"),placeholder:h.isNordic?s("forms:nordicNameLabel"):s("forms:firstNamePlaceholder"),validation:h.isNordic?s("forms:errorNameEmpty"):s("forms:errorFirstNameEmpty")},surname:{label:s("forms:lastNameLabel"),placeholder:s("forms:lastNamePlaceholder"),validation:s("forms:errorLastNameEmpty")},companyName:{label:s("forms:companyLabel"),placeholder:s("forms:companyPlaceholder"),validation:s("forms:errorCompanyEmpty")},taxID:{label:h.isNordic?s("forms:nordicOrganizationNumberLabel"):s("forms:vatNumberLabel"),placeholder:s("forms:vatNumberPlaceholder")},invoiceEmail:{label:s("forms:invoiceEmailLabel"),placeholder:s("forms:invoiceEmailPlaceholder"),validation:s("forms:errorEmailInvalid"),description:s("forms:invoiceEmailDescription")},invoiceOperatorCode:{label:s("forms:invoiceOperatorCodeLabel"),placeholder:s("forms:invoiceOperatorCodePlaceholder"),description:s("forms:invoiceOperatorCodeDescription")},phone:{label:h.isNordic?s("forms:nordicMobilePhoneLabel"):s("forms:phoneLabel"),placeholder:s("forms:phonePlaceholder")},department:{label:s("forms:departmentLabel"),placeholder:s("forms:departmentPlaceholder")},privacy:{label:s("forms:newsletterCheckboxLabel")}},privacyInfo:{header:s("forms:privacyPolicyHeader"),label:s("forms:privacyInfoHeadline"),privacyPolicy:`${u}${s("forms:privacyPolicyLinkHref")}`,membersClubHeader:s("forms:membersClubHeader"),description:s("forms:membersClubCustomerProfileDescription")},saveButton:s("forms:saveModificationLabel")},[q,z]=(0,N.useState)(!1),J=(0,g.m)({initialValues:{salutation:e.salutation||"",name:e.firstName||"",surname:e.lastName||"",companyName:e.companyName||"",taxID:e.vatId||"",invoiceEmail:e.custom?.fields?.invoiceEmail||"",invoiceOperatorCode:e.custom?.fields?.invoiceOperatorCode||"",industry:e.custom?.fields?.industry||"",phone:e.custom?.fields?.phone||"",department:e.custom?.fields?.department||"",privacy:e.custom?.fields?.membersClubOptIn||!1},validate:{name:(0,v.h)(W.inputs.name.validation),surname:h.isNordic?void 0:(0,v.h)(W.inputs.surname.validation),companyName:(0,v.h)(W.inputs.companyName.validation),invoiceEmail:e=>e?(0,A.DT)(e,e=>s(`forms:${e}`)):null,phone:(0,$.Z1)({country:r,isRequired:!1,requiredMessage:s("forms:errorInputEmpty"),invalidMessage:s("forms:phoneMinLengthError"),tooLongMessage:s("forms:phoneMaxLengthError")})},validateInputOnChange:h.isNordic?["name","invoiceEmail"]:["name","surname","invoiceEmail"],validateInputOnBlur:h.isNordic?["name","invoiceEmail"]:["name","surname","invoiceEmail"]}),{focusedFields:K,handleFieldChange:Q,handleFocus:X,handleBlur:G}=(0,F.N)(J),Y=async e=>{z(!0);let r=(e=>{if(h.isNordic){let{salutation:r,surname:s,privacy:o,...a}=e;return a}return e})(e);(await fetch("/api/commercetools/customer/update-customer-fields",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})).ok?C.$e.show({title:s("common:profileUpdated"),message:s("common:profileUpdatedMessage"),...b.TF.SUCCESS}):C.$e.show({title:s("common:error"),message:s("common:profileUpdatedErrorMessage"),...b.TF.ERROR}),z(!1)};return(0,o.jsx)("form",{onSubmit:J.onSubmit(Y,e=>{(0,A.$w)(e)}),children:(0,o.jsxs)(a.x,{w:"100%",gutter:"lg",children:[(0,o.jsx)(a.x.Col,{span:12,"data-cy":"user-profile",children:(0,o.jsx)(i.h,{order:2,children:W.headline})}),!h.isNordic&&(0,o.jsx)(a.x.Col,{span:12,children:(0,o.jsx)(D.r,{namespace:"forms",valueMode:"code",country:r,name:"salutation",disabled:q,...J.getIn
1putProps("salutation")})}),(0,o.jsxs)(a.x.Col,{md:6,children:[(0,o.jsx)(n.k,{placeholder:W.inputs.name.placeholder,label:W.inputs.name.label,withAsterisk:!0,disabled:q,maxLength:H.firstName,...J.getInputProps("name"),error:!!J.errors.name,onChange:e=>Q("name",e.currentTarget.value),onFocus:()=>X("name"),onBlur:()=>G("name"),"aria-describedby":"profile-name-counter"}),(0,o.jsx)("div",{id:"profile-name-counter",children:(0,o.jsx)(O.$,{currentLength:J.values.name.length,maxLength:H.firstName,error:J.errors.name,showError:!0,isFocused:K.has("name")})})]}),!h.isNordic&&(0,o.jsxs)(a.x.Col,{md:6,children:[(0,o.jsx)(n.k,{placeholder:W.inputs.surname.placeholder,label:W.inputs.surname.label,withAsterisk:!0,disabled:q,maxLength:H.lastName,...J.getInputProps("surname"),error:!!J.errors.surname,onChange:e=>Q("surname",e.currentTarget.value),onFocus:()=>X("surname"),onBlur:()=>G("surname"),"aria-describedby":"profile-surname-counter"}),(0,o.jsx)("div",{id:"profile-surname-counter",children:(0,o.jsx)(O.$,{currentLength:J.values.surname.length,maxLength:H.lastName,error:J.errors.surname,showError:!0,isFocused:K.has("surname")})})]}),w.phone.isVisible&&(0,o.jsxs)(a.x.Col,{md:6,children:[(0,o.jsx)(n.k,{placeholder:W.inputs.phone.placeholder,label:W.inputs.phone.label,disabled:q,maxLength:T.phone,...J.getInputProps("phone"),error:!!J.errors.phone,onChange:e=>Q("phone",(0,S._)(e,r)),onFocus:()=>X("phone"),onBlur:()=>G("phone"),"data-cy":"profile-phone","aria-describedby":"profile-phone-counter"}),(0,o.jsx)("div",{id:"profile-phone-counter",children:(0,o.jsx)(O.$,{currentLength:J.values.phone.length,maxLength:T.phone,error:J.errors.phone,showError:!0,isFocused:K.has("phone")})})]}),V&&(0,o.jsxs)(a.x.Col,{md:6,children:[(0,o.jsx)(n.k,{placeholder:W.inputs.department.placeholder,label:W.inputs.department.label,withAsterisk:w.department.isRequired,disabled:q,maxLength:T.department,...J.getInputProps("department"),error:!!J.errors.department,onChange:e=>Q("department",e.currentTarget.value),onFocus:()=>X("department"),onBlur:()=>G("department"),"data-cy":"profile-department","aria-describedby":"profile-department-counter"}),(0,o.jsx)("div",{id:"profile-department-counter",children:(0,o.jsx)(O.$,{currentLength:J.values.department.length,maxLength:T.department,error:J.errors.department,showError:!0,isFocused:K.has("department")})})]}),U&&(0,o.jsx)(B.C,{form:J,fieldsVisibility:w,prefix:"",idPrefix:"profile",isNordic:h.isNordic,loading:q}),(0,o.jsx)(a.x.Col,{span:12,children:(0,o.jsxs)(l.t,{bg:"#F0F0F0",p:"lg",children:[(0,o.jsx)(t.E,{fw:700,size:"lg",children:W.privacyInfo.label}),(0,o.jsx)(t.E,{mb:"xs",mt:"xs",children:(0,o.jsx)(y.A,{i18nKey:"forms:privacyPolicyLabel",components:[(0,o.jsx)("a",{href:W.privacyInfo.privacyPolicy,target:"_blank",rel:"noreferrer",style:{color:"var(--mantine-color-sarred-5)",textDecoration:"underline"},children:""},"0")]})}),f&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.E,{fw:700,size:"lg",mb:"md",children:h.isUS?W.privacyInfo.membersClubHeader:s("forms:marketingCommunicationLabel")}),(0,o.jsx)(t.E,{children:(0,o.jsx)(d.S,{disabled:q,label:h.isUS?W.privacyInfo.description:s("forms:marketingCommunicationsDescription"),description:(0,o.jsx)(M.A,{id:"profile-marketing-consent-notice"}),"aria-describedby":"profile-marketing-consent-notice",color:"red",...J.getInputProps("privacy",{type:"checkbox"})})})]})]})}),(0,o.jsx)(a.x.Col,{span:12,display:"flex",children:(0,o.jsx)(m.$,{color:"red",ml:"auto",type:"submit",loading:q,children:W.saveButton})})]})})},U=()=>{let{t:e}=(0,j.A)(),r={headline:e("forms:passwordChangeHeadline"),inputs:{oldPassword:{label:e("forms:passwordOldLabel"),placeholder:e("forms:passwordOldPlaceholder"),validation:e("forms:errorPasswordOldEmpty")},password:{label:e("forms:passwordNewLabel"),placeholder:e("forms:passwordNewPlaceholder"),validation:e("forms:errorPasswordNewEmpty")},passwordConfirm:{label:e("forms:passwordNewConfirmLabel"),placeholder:e("forms:passwordNewConfirmPlaceholder"),validation:e("forms:errorPasswordDontMatch")}},saveButton:e("forms:saveModificationLabel")},[s,n]=(0,N.useState)(!1),l=(0,g.m)({initialValues:{oldPassword:"",password:"",passwordConfirm:""},validate:{oldPassword:(0,v.h)(r.inputs.oldPassword.validation),password:s=>s&&""!==s.trim()?(0,A.H9)(s,e):r.inputs.password.validation,passwordConfirm:(e,s)=>
1e!==s.password?r.inputs.passwordConfirm.validation:null},validateInputOnChange:["oldPassword","password","passwordConfirm"],validateInputOnBlur:["oldPassword","password","passwordConfirm"]}),{focusedFields:t,handleFieldChange:d,handleFocus:p,handleBlur:u}=(0,F.N)(l),h=async r=>{n(!0);let s=await fetch("/api/auth/change-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(s.ok)C.$e.show({title:e("forms:passwordChangedSuccessTitle"),message:e("forms:passwordChangedSuccessMessage"),...b.TF.SUCCESS}),l.reset();else{let r=await s.json().catch(()=>null),o=r?.errorCode,a=e("forms:passwordChangedFailMessage");o===T.R.INVALID_PASSWORD_POLICY?a=e("forms:passwordInvalid"):o===T.R.INVALID_REQUEST?a=e("forms:invalidRequest"):(401===s.status||o===T.R.INVALID_CREDENTIALS)&&(a=e("forms:passwordChangedFailMessagePassword")),C.$e.show({title:e("forms:passwordChangedFailTitle"),message:a,...b.TF.ERROR})}n(!1)};return(0,o.jsx)("form",{"data-testid":"password-change-form",onSubmit:l.onSubmit(h,e=>{(0,A.$w)(e)}),children:(0,o.jsxs)(a.x,{w:"100%",gutter:"lg",children:[(0,o.jsx)(a.x.Col,{span:12,children:(0,o.jsx)(i.h,{order:2,children:r.headline})}),(0,o.jsxs)(a.x.Col,{span:12,children:[(0,o.jsx)(c.y,{placeholder:r.inputs.oldPassword.placeholder,label:r.inputs.oldPassword.label,withAsterisk:!0,disabled:s,maxLength:L.n.PASSWORD,...l.getInputProps("oldPassword"),error:!!l.errors.oldPassword,onChange:e=>d("oldPassword",e.currentTarget.value),onFocus:()=>p("oldPassword"),onBlur:()=>u("oldPassword"),"aria-describedby":"profile-oldPassword-counter"}),(0,o.jsx)("div",{id:"profile-oldPassword-counter",children:(0,o.jsx)(O.$,{currentLength:l.values.oldPassword.length,maxLength:L.n.PASSWORD,error:l.errors.oldPassword,showError:!0,isFocused:t.has("oldPassword")})})]}),(0,o.jsxs)(a.x.Col,{md:6,children:[(0,o.jsx)(c.y,{placeholder:r.inputs.password.placeholder,label:r.inputs.password.label,withAsterisk:!0,disabled:s,maxLength:L.n.PASSWORD,...l.getInputProps("password"),error:!!l.errors.password,onChange:e=>d("password",e.currentTarget.value),onFocus:()=>p("password"),onBlur:()=>u("password"),"aria-describedby":"profile-password-counter"}),(0,o.jsx)("div",{id:"profile-password-counter",children:(0,o.jsx)(O.$,{currentLength:l.values.password.length,maxLength:L.n.PASSWORD,error:l.errors.password,showError:!0,isFocused:t.has("password")})})]}),(0,o.jsxs)(a.x.Col,{md:6,children:[(0,o.jsx)(c.y,{placeholder:r.inputs.passwordConfirm.placeholder,label:r.inputs.passwordConfirm.label,withAsterisk:!0,disabled:s,maxLength:L.n.PASSWORD,...l.getInputProps("passwordConfirm"),error:!!l.errors.passwordConfirm,onChange:e=>d("passwordConfirm",e.currentTarget.value),onFocus:()=>p("passwordConfirm"),onBlur:()=>u("passwordConfirm"),"aria-describedby":"profile-passwordConfirm-counter"}),(0,o.jsx)("div",{id:"profile-passwordConfirm-counter",children:(0,o.jsx)(O.$,{currentLength:l.values.passwordConfirm.length,maxLength:L.n.PASSWORD,error:l.errors.passwordConfirm,showError:!0,isFocused:t.has("passwordConfirm")})})]}),(0,o.jsx)(a.x.Col,{span:12,display:"flex",children:(0,o.jsx)(m.$,{color:"red",ml:"auto",type:"submit",loading:s,children:r.saveButton})})]})})};var W=!0;function q(e){let{t:r}=(0,j.A)(),s=(0,P.useRouter)(),{language:a,country:n}=(0,x.JK)(s),l={seo:{title:r("forms:customerProfilePageTitle"),description:r("forms:customerProfilePageTitle"),canonicalUrl:`${(0,h.$_)()}/${a}/${(0,x.$9)(n)}/customer/profile`,hreflang:{currentUrl:`${(0,h.$_)()}/${a}/${(0,x.$9)(n)}/customer/profile`,languageSlugs:{en:"/customer/profile",de:"/customer/profile",ru:"/customer/profile",ja:"/customer/profile",pt:"/customer/profile",fr:"/customer/profile",es:"/customer/profile"}},robots:{noFollow:!0,noIndex:!0}}},d=(0,h.cp)(l);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(w(),{children:(0,o.jsx)(o.Fragment,{children:d})}),(0,o.jsx)(b.Qp,{items:[{label:"Home",href:`/${a}/${(0,x.$9)(n)}`},{label:`${r("forms:customerProfileHeadline")}`}],baseUrl:(0,h.$_)()}),(0,o.jsxs)(p.s,{justify:"space-between",w:"100%",direction:{base:"column",xs:"row"},children:[(0,o.jsx)(b.lA,{}),(0,o.jsxs)(p.s,{gap:"24px",wrap:"wrap",maw:"952px",my:"lg",w:"100%",px:"sm",children:[(0,o.jsx)("h1",{className:"mb-[12px]",children:r("forms:customerProfileHeadline")}),(0,o.jsx)(H,{customer:e.customer,country:n}),"PL"===n&&e.customer.custom?.fields?.nip&&(0,o.jsxs)(p.s,{direction:"column",w:"100%",maw:"50%",children:[(0,o.jsx)(u.c,{my:"md"}),(0,o.jsx)(i.h,{order:3,mb:"sm",children:r("forms:companyRegistrationHeadline")}),(0,o.jsxs)(t.E,{size:"sm",fw:500,mb:"sm",children:["NIP: ",e.customer.custom.fields.nip]}),(0,o.jsx)(V.G,{nip:e.customer.custom.fields.nip,customerId:e.customer.id,initialEligibilityStatus:e.customer.custom.fields.eligibilityStatus||null,initialValidationTimestamp:e.customer.custom.fields.lastValidationTimestamp||null,variant:"compact"})]}),(0,o.jsx)(U,{})]})]})]})}}},e=>{e.O(0,[5819,636,6593,8792],()=>e(e.s=30898)),_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.