import{b7 as b,u as g,r as h,z as k,aY as c,aT as n,a$ as s,bg as y,bh as I,bd as C,bc as A,aS as B,b9 as $,a_ as w,c as x,b0 as z,ba as N,aX as S}from"./index-xnhGKCfe.js";import{g as U}from"./common-CGnrk9PK.js";const V={class:"avatar-wrapper"},j={class:"avatar-container"},D=["onClick"],E=["src","alt"],F={class:"handle"},L=b({__name:"avatar",emits:["submit"],setup(M,{emit:r}){const{t:i}=g(),l=x(()=>{const{imgMap:t}=U("avatar");return Object.values(t)}),u=r,{userInfo:m,setAvatar:_,getUserInfo:v}=k(),e=h(Number(m.value.userPhoto));function d(t){e.value=t}async function p(){await _(e.value+"",async()=>{u("submit"),await v()})}return(t,O)=>{const f=w;return n(),c("div",V,[s("div",j,[(n(!0),c(y,null,I(l.value,(o,a)=>(n(),c("div",{class:"item",key:o,onClick:()=>d(a)},[s("div",{class:A({img:!0,active:a===e.value}),style:C(`--delay:${a*.1+.2}s`)},[s("img",{src:o,alt:`avatar${a}`},null,8,E),a===e.value?(n(),B(f,{key:0,name:"check-icon",class:"check_img"})):$("",!0)],6)],8,D))),128))]),s("div",F,[s("button",{class:"btn",onClick:p},z(N(i)("t76")),1)])])}}}),X=S(L,[["__scopeId","data-v-2cf18466"]]);export{X as default};
