import{h as e}from"./p-083180bf.js";import{i as a}from"./p-f8a09b0f.js";import{c as l}from"./p-cef45012.js";import{T as t}from"./p-c813ec64.js";function s(s){var i,r,o,n,p;const{states:d,callbacks:m}=s,{text:u,formState:b}=d,{errors:c,error:v}=b,x=l({Container:{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-xxx-large)",padding:"var(--sl-spacing-xxx-large)"},FormStyle:{width:"100%",minWidth:"700px","& >*:not(:last-child)":{"margin-bottom":"32px"},"@media screen and (max-width: 1100px)":{minWidth:"100%"}},Error:{"&::part(erroralert-base)":{"margin-bottom":"32px"}},Success:{"&::part(successalert-base)":{"margin-bottom":"32px"}},NameInputStyle:{width:"50%","@media screen and (max-width: 860px)":{width:"100%","margin-right":"0"}},NameInputContainer:{display:"flex",gap:"32px",width:"100%","@media screen and (max-width: 860px)":{flexDirection:"column"}}}),f=x.toString(),g=(null===(i=d.user)||void 0===i?void 0:i.countryCode)?a.formatDisplayName(null===(r=d.user)||void 0===r?void 0:r.countryCode,{type:"region"}):"";return e("div",{class:x.classes.Container,part:"sqm-base"},e("style",{type:"text/css"},f),e(t,Object.assign({},{type:"h1"}),u.editProfileHeader),e(t,Object.assign({},{type:"h2"}),u.editProfileSubHeader),e("form",{class:x.classes.FormStyle,onSubmit:m.onSubmit},d.success&&e("sqm-form-message",{class:x.classes.Success,exportparts:"success-icon"},e("div",{part:"successalert-text"},u.submissionSuccessText)),v&&e("sqm-form-message",{class:x.classes.Error,type:"error",exportparts:"erroralert-icon"},e("div",{part:"erroralert-text"},v)),e("div",{class:x.classes.NameInputContainer},e("sl-input",Object.assign({class:x.classes.NameInputStyle,exportparts:"label: input-label, base: input-base",value:null===(o=d.user)||void 0===o?void 0:o.firstName,onInput:m.onChange,label:u.firstnametext,disabled:d.loading},(null==c?void 0:c.firstName)&&"valid"!==(null==c?void 0:c.firstName.status)?{class:"ErrorStyles",helpText:u.fieldEmptyText}:[],{id:"firstName",name:"firstName",error:(null==c?void 0:c.firstName)&&"valid"!==(null==c?void 0:c.firstName.status)?null==c?void 0:c.firstName.message:void 0})),e("sl-input",Object.assign({class:x.classes.NameInputStyle,exportparts:"label: input-label, base: input-base",value:null===(n=d.user)||void 0===n?void 0:n.lastName,onInput:m.onChange,label:u.lastnametext,disabled:d.loading,id:"lastName",name:"lastName"},(null==c?void 0:c.lastName)&&"valid"!==(null==c?void 0:c.lastName.status)?{class:"ErrorStyles",helpText:u.fieldEmptyText}:[],{error:(null==c?void 0:c.lastName)&&"valid"!==(null==c?void 0:c.lastName.status)?null==c?void 0:c.lastName.message:void 0}))),e("sl-input",{label:u.emailtext,value:null===(p=d.user)||void 0===p?void 0:p.email,exportparts:"label: input-label, base: input-base",disabled:!0}),d.showCountry&&e("sl-input",{label:u.countrytext,value:g,exportparts:"label: input-label, base: input-base",disabled:!0}),e("sl-button",{type:"primary",exportparts:"base: primarybutton-base",loading:d.loading,disabled:d.submitDisabled,onClick:e=>{m.onSubmit(e)},submit:!0},u.submitChangeButtonText)))}export{s as P}