import{h as e}from"./p-083180bf.js";import{c as o}from"./p-cef45012.js";import{A as l,a as i,H as r,b as t,E as s}from"./p-49b20dae.js";import{T as a}from"./p-c813ec64.js";const d=o({Wrapper:l,Column:i,HostBlock:r,":host":{margin:"0 auto",width:"100%"},ButtonsContainer:t,ErrorStyle:s}),n=d.toString();function v(o){var l,i,r,t,s,v,p,u,m,b,c,x,f,y,h,q,T,w,E,g;const{states:j,refs:k,callbacks:R,content:B}=o;return j.error&&window.scrollTo({top:0,left:0,behavior:"smooth"}),e("div",{class:d.classes.Wrapper,part:"sqm-base"},e("style",{type:"text/css"},"\nsqm-portal-register {\n  margin: 0 auto;\n  width: 100%;\n  display: block;\n}\n\n:host{\n  display: block;\n}\n\n:host([hidden]) {\n  display: none;\n}\n",n),e(a,{type:"h3"},B.pageLabel),e("sl-form",{class:d.classes.Column,"onSl-submit":R.submit,ref:e=>k.formRef.current=e,novalidate:!0},(null===(l=j.registrationFormState)||void 0===l?void 0:l.disabled)?e("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},e("div",{part:"erroralert-text"},j.registrationFormState.disabledMessage)):j.error&&e("sqm-form-message",{type:"error",exportparts:"erroralert-icon"},e("div",{part:"erroralert-text"},o.states.error)),B.formData,!j.hideInputs&&e("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",type:"email",name:"/email",label:B.emailLabel||"Email",disabled:j.loading||(null===(i=j.registrationFormState)||void 0===i?void 0:i.disabled)||j.emailDisabled,required:!0,validationError:({value:e})=>e?e.includes("@")?void 0:B.invalidEmailErrorMessage:B.requiredFieldErrorMessage},(null===(t=null===(r=j.registrationFormState)||void 0===r?void 0:r.initialData)||void 0===t?void 0:t.email)?{value:null===(v=null===(s=j.registrationFormState)||void 0===s?void 0:s.initialData)||void 0===v?void 0:v.email}:{},(null===(u=null===(p=j.registrationFormState)||void 0===p?void 0:p.validationErrors)||void 0===u?void 0:u.email)?{class:d.classes.ErrorStyle,helpText:(null===(b=null===(m=j.registrationFormState)||void 0===m?void 0:m.validationErrors)||void 0===b?void 0:b.email)||B.requiredFieldErrorMessage}:[])),!(j.hideInputs||j.hidePasswords)&&e("sqm-password-field",{fieldLabel:B.passwordLabel,"disable-validation":!j.enablePasswordValidation,meetsRequirementsText:B.meetsRequirementsText,doesNotMeetRequirementsText:B.doesNotMeetRequirementsText,minErrorText:B.minErrorText,uppercaseErrorText:B.uppercaseErrorText,lowercaseErrorText:B.lowercaseErrorText,hasErrorText:B.hasErrorText}),B.passwordField,!(j.hideInputs||j.hidePasswords)&&j.confirmPassword&&e("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",type:"password",name:"/confirmPassword",label:B.confirmPasswordLabel,disabled:j.loading||(null===(c=j.registrationFormState)||void 0===c?void 0:c.disabled),required:!0},(null===(f=null===(x=j.registrationFormState)||void 0===x?void 0:x.initialData)||void 0===f?void 0:f.confirmPassword)?{value:null===(h=null===(y=j.registrationFormState)||void 0===y?void 0:y.initialData)||void 0===h?void 0:h.confirmPassword}:{},(null===(T=null===(q=j.registrationFormState)||void 0===q?void 0:q.validationErrors)||void 0===T?void 0:T.confirmPassword)?{class:d.classes.ErrorStyle,helpText:(null===(E=null===(w=j.registrationFormState)||void 0===w?void 0:w.validationErrors)||void 0===E?void 0:E.confirmPassword)||B.requiredFieldErrorMessage}:[])),B.emailOptIn,B.terms,e("div",{class:d.classes.ButtonsContainer},e("sl-button",{submit:!0,loading:j.loading,disabled:null===(g=j.registrationFormState)||void 0===g?void 0:g.disabled,exportparts:"base: primarybutton-base",type:"primary"},B.submitLabel||"Register"),B.secondaryButton)))}export{v as P}