import{r as o,h as e}from"./p-d55626d1.js";import{c as r}from"./p-2fd22ed9.js";import"./p-0bc4f624.js";import"./p-9bfc48ee.js";import"./p-097729d8.js";import{a}from"./p-c1c5b589.js";import"./p-62c3d279.js";import{a as m}from"./p-c7f96882.js";const t=class{constructor(e){o(this,e),this.profileFormId="profile"}async formEventHandler({detail:o}){if(o.formId==this.profileFormId)return this.updateProfile(o)}async updateProfile(o){const e={};Object.keys(o).map((r=>{o[r].key&&(e[o[r].key]=o[r].value)})),await r.client.mutate(m,{userInput:e})}render(){var o,r;return(null===(o=a.identity)||void 0===o?void 0:o.user)?e("corejam-box",{max:"xl",mx:"auto",mt:12,px:4,lgPx:0},e("corejam-box",{mb:16},e("corejam-type",{as:"h2",size:"3xl",align:"center",weight:"bold"},"My Account")),e("corejam-box",{flex:!0},e("corejam-box",{w:"3",pt:8,bWidthTop:1,bColor:"gray-500",mr:24},e("corejam-box",{flex:!0,direction:"col"},e("corejam-box",{mb:4},e("corejam-base-link",{href:"#",class:"py-4 mb-1"},"Account details")),e("corejam-box",{mb:4},e("corejam-base-link",{href:"#",class:"py-4 mb-1"},"Settings")))),e("corejam-box",{w:"9",pt:8,bWidthTop:1,bColor:"gray-500"},e("corejam-form-container",{name:this.profileFormId},e("corejam-box",{flex:!0,mb:8},e("corejam-box",{w:"6",pl:4},e("corejam-form-input",{name:"email",type:"email",formId:this.profileFormId,required:!0,label:"Email Address",value:null===(r=a.identity)||void 0===r?void 0:r.user.email,placeholder:"Email"}))),e("corejam-form-submit",{formId:this.profileFormId},e("corejam-type",{size:"sm",weight:"bold",transform:"uppercase",decoration:"underline"},"Save"))),e("auth-reset-password-form",null)))):e("div",null,"Login")}};export{t as auth_account}