import{c as e,u as t}from"./logo-sunshine-45-B0-ae2pw.js";import{t as n}from"./Navbar-chCsCvbA.js";import{t as r}from"./save-CBAHODg6.js";import{t as i}from"./fetch_utils-4pUjSOEQ.js";var a=t({components:{Navbar:n,Save:r},data(){return{error:null,success:!1,passwordData:{currentUsername:``,currentPassword:``,newUsername:``,newPassword:``,confirmNewPassword:``}}},methods:{save(){this.error=null,i(`./api/password`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(this.passwordData)}).then(e=>{e.status===200?e.json().then(e=>{this.success=e.status,this.success===!0?setTimeout(()=>{document.location.reload()},5e3):this.error=e.error}):this.error=`Internal Server Error`})}}});e(a);