import{i as e,l as t}from"./preact.module-CNakwbc9.js";import{d as n,s as r,t as i}from"./hooks.module-BrXTvcfS.js";import{a,i as o}from"./i18n-BaLR3UdQ.js";import{t as s}from"./jsxRuntime.module-Cao1NCKs.js";import{t as c}from"./Icon-BEnt7704.js";import{t as l}from"./Button-Du0dYm4Z.js";import{r as u,t as d}from"./Card-DHxlpCRf.js";import{t as f}from"./FormTextBox-BLQGoABI.js";import{t as p}from"./OptionsRow-CcGZJWUG.js";import{t as m}from"./SetupPage-BAdY9JLT.js";t(),n();var h=4;async function g(){await o(window.glob.currentLocale?.id??`en`);let t=document.createElement(`div`);t.classList.add(`setup-outer-wrapper`),document.body.classList.add(`setup`),e(s(_,{}),t),document.body.replaceChildren(t)}function _(){let e=i(null),[t,n]=r(``),[o,g]=r(``),_=t!==``&&t.length<h,v=o!==``&&t!==o,y=t.length>=h&&t===o;return s(`div`,{class:`setup-container set-password-container`,children:s(`form`,{method:`POST`,action:`set-password`,onSubmit:e=>{y||e.preventDefault()},children:s(m,{className:`set-password`,title:a(`set_password.heading`),description:a(`set_password.description`),illustration:s(c,{icon:`bx bx-lock-alt`,className:`illustration-icon`}),footer:s(l,{text:a(`set_password.button`),kind:`primary`,disabled:!y}),children:s(d,{children:s(u,{children:[s(p,{name:`password1`,label:a(`set_password.password`),description:_?s(`span`,{className:`text-danger`,children:a(`set_password.password-too-short`,{length:h})}):void 0,stacked:!0,children:s(f,{className:_?`is-invalid`:void 0,inputRef:e,autoFocus:!0,type:`password`,name:`password1`,currentValue:t,onChange:n,autocomplete:`new-password`,required:!0})}),s(p,{name:`password2`,label:a(`set_password.password-confirmation`),description:v?s(`span`,{className:`text-danger`,children:a(`set_password.passwords-dont-match`)}):void 0,stacked:!0,children:s(f,{className:v?`is-invalid`:void 0,type:`password`,name:`password2`,currentValue:o,onChange:g,autocomplete:`new-password`,required:!0})})]})})})})})}g();export{_ as App};