import{d as _,s as b,T as f,c as v,o as g,a as s,t as i,u as e,f as o,b as u,l as d,v as r,B as p,x as h}from"./app-Do7K7VDV.js";import{_ as x}from"./AdminLayout-DeT_GLTC.js";import{_ as y}from"./SpinnerBtn-C-rqKjUt.js";import{_ as V}from"./ImageInput.vue_vue_type_script_setup_true_lang-BW1_X63E.js";import"./AssetModal-C18ToIEK.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./InputFieldError-0BmYlL24.js";import"./ToastrContainer-CtYDvNPN.js";const I={class:"mx-auto flex w-[650px] flex-col gap-5"},k={class:"card"},U={class:"card-header -mb-2"},w={class:"card-body"},B={class:"grid grid-cols-2 gap-3"},C={class:"label mb-1"},E={class:"label mb-1"},$={class:"label mb-1"},A={class:"card"},M={class:"card-header -mb-2"},N={class:"card-body"},S={class:"grid grid-cols-2 gap-3"},T={class:"col-span-2"},D={for:"toggle-checked-input0",class:"toggle label"},O={class:"label"},P={for:"toggle-checked-input1",class:"toggle label"},j={class:"label"},F={class:"label mb-1"},H={class:"mt-5 text-end"},q=_({layout:x}),Y=Object.assign(q,{__name:"Edit",props:["userInfo"],setup(m){b();const n=m,l=f({name:n.userInfo.name,avatar:"",credits:n.userInfo.credits,email:n.userInfo.email,password:"",status:!!n.userInfo.status,email_verified_at:n.userInfo.email_verified_at!=null,meta:n.userInfo.meta,_method:"PATCH"}),c=()=>{l.post(route("admin.users.update",n.userInfo.id),{preserveState:!1})};return(z,t)=>(g(),v("form",{onSubmit:t[7]||(t[7]=h(a=>c(),["prevent"]))},[s("div",I,[s("div",k,[s("h6",U,i(e(o)("Basic Information")),1),s("div",w,[s("div",B,[s("div",null,[s("label",C,i(e(o)("Name")),1),d(s("input",{type:"text",class:"input","onUpdate:modelValue":t[0]||(t[0]=a=>e(l).name=a)},null,512),[[r,e(l).name]])]),u(V,{modelValue:e(l).avatar,"onUpdate:modelValue":t[1]||(t[1]=a=>e(l).avatar=a),label:"Avatar"},null,8,["modelValue"]),s("div",null,[s("label",E,i(e(o)("Email")),1),d(s("input",{type:"email",class:"input","onUpdate:modelValue":t[2]||(t[2]=a=>e(l).email=a)},null,512),[[r,e(l).email]])]),s("div",null,[s("label",$,i(e(o)("Credits")),1),d(s("input",{type:"number",class:"input","onUpdate:modelValue":t[3]||(t[3]=a=>e(l).credits=a)},null,512),[[r,e(l).credits]])])])])]),s("div",A,[s("h6",M,i(e(o)("Others")),1),s("div",N,[s("div",S,[s("div",T,[s("div",null,[s("label",D,[d(s("input",{class:"toggle-input peer sr-only",id:"toggle-checked-input0",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=a=>e(l).status=a)},null,512),[[p,e(l).status]]),t[8]||(t[8]=s("div",{class:"toggle-body"},null,-1)),s("span",O,i(e(o)("Is Active?")),1)])]),s("div",null,[s("label",P,[d(s("input",{class:"toggle-input peer sr-only",id:"toggle-checked-input1",type:"checkbox","onUpdate:modelValue":t[5]||(t[5]=a=>e(l).email_verified_at=a)},null,512),[[p,e(l).email_verified_at]]),t[9]||(t[9]=s("div",{class:"toggle-body"},null,-1)),s("span",j,i(e(o)("Email Verified")),1)])])]),s("div",null,[s("label",F,i(e(o)("Password")),1),d(s("input",{type:"password",class:"input","onUpdate:modelValue":t[6]||(t[6]=a=>e(l).password=a)},null,512),[[r,e(l).password]])])]),s("div",H,[u(y,{classes:"btn btn-primary",processing:e(l).processing,"btn-text":e(o)("Update user")},null,8,["processing","btn-text"])])])])])],32))}});export{Y as default};
