import{u as s,c as a,d as e,j as o,e as t,t as l,l as n,m as i,C as r,Z as c,K as d,U as p,E as u,V as h,ap as v}from"./index.1711290598880.js";import{a as f}from"./href.1711290598880.js";import"./dialog.1711290598880.js";const g={class:"user-control space-y-2"},m={key:0,class:"space-y-3 grid grid-cols-3 gap-x-3 grid-flow-dense"},b={class:"col-span-3"},x={class:"group before:hover:scale-95 before:hover:h-72 before:hover:w-full before:hover:h-full before:hover:rounded-b-2xl before:transition-all before:duration-500 before:content-[''] before:w-full before:h-24 before:rounded-t-2xl before:bg-gradient-to-bl from-sky-200 via-orange-200 to-orange-700 before:absolute before:top-0 w-full h-64 relative bg-white flex flex-col items-center justify-center gap-2 text-center rounded-xl overflow-hidden"},w={class:"w-28 h-28 bg-white mt-8 overflow-hidden rounded-full border-4 border-slate-50 z-10 group-hover:scale-150 group-hover:-translate-x-24 group-hover:-translate-y-20 transition-all duration-500"},y=["src"],k={class:"z-10 group-hover:text-white group-hover:-translate-y-4 transition-all duration-500"},C=t("span",{class:"text-2xl font-semibold"},"我的账号",-1),z={style:{height:"20px"}},B={style:{color:"#a686ba"}},V={class:"iconfont mt-2"},j={style:{width:"30px",height:"30px"},t:"1705845546796",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"21733",width:"32",height:"32"},M=[t("path",{d:"M512 0a512 512 0 1 0 512 512A512.606923 512.606923 0 0 0 512 0z m430.793741 512A430.793741 430.793741 0 1 1 512 81.327643a431.279279 431.279279 0 0 1 430.793741 430.672357z",fill:"#a686ba","p-id":"21734"},null,-1),t("path",{d:"M771.277383 471.336178h-218.492177v-218.492176a40.663822 40.663822 0 0 0-81.327643 0v218.492176h-218.492177a40.663822 40.663822 0 0 0 0 81.327644h218.492177v218.492176a40.663822 40.663822 0 0 0 81.327643 0v-218.492176h218.492177a40.663822 40.663822 0 0 0 0-81.327644z",fill:"#a686ba","p-id":"21735"},null,-1)],H=t("span",{style:{"margin-top":"7px"}},"添加标签",-1),L={userBox:"",class:"hover user-card relative"},A=t("div",{class:"text-green-500"},[t("span",{class:"iconfont icon-daoru"}),t("span",null,"导入标签")],-1),_=["onChange"],O=["onClick"],J=[t("div",{class:"text-blue-500"},[t("span",{class:"iconfont icon-daochu"}),t("span",null,"导出标签")],-1)],N=["onClick"],S=[t("div",{class:"text-yellow-500"},[t("span",{class:"iconfont icon-zhongzhi"}),t("span",null,"重置所有")],-1)],T=["onClick"],E=[t("div",{class:"text-cyan-500"},[t("span",{class:"iconfont icon-yanshengguanliyuan"}),t("span",null,"管理后台")],-1)],F=["onClick"],K={style:{color:"#4f68b0"}},R={class:"iconfont mt-1.5"},U={style:{width:"36px",height:"36px"},t:"1705918028651",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11853",width:"32",height:"32"},Z=[t("path",{d:"M874.666667 656.64V768a85.333333 85.333333 0 0 1-85.333334 85.333333h-128.256v-196.693333H874.666667z m-515.541334 0V853.333333H234.666667a85.333333 85.333333 0 0 1-85.333334-85.333333v-111.36h209.792z m247.594667 0V853.333333H412.501333v-196.693333h194.218667z m0-485.973333v435.456H149.333333V258.261333a85.333333 85.333333 0 0 1 84.821334-85.333333L606.72 170.666667z m265.514667 247.338666c1.365333 0 2.432 1.109333 2.432 2.474667v183.082667c0 1.408-1.066667 2.56-2.432 2.56h-211.2V418.005333h211.2zM487.68 284.330667L347.050667 423.125333 275.2 351.701333a29.354667 29.354667 0 0 0-41.941333 0 29.312 29.312 0 0 0 0 42.24l93.781333 92.202667a29.696 29.696 0 0 0 20.906667 8.789333 29.738667 29.738667 0 0 0 20.992-8.832l160.682666-159.573333a29.312 29.312 0 0 0 0-42.197333 29.354667 29.354667 0 0 0-41.941333 0zM789.333333 170.666667a85.333333 85.333333 0 0 1 85.333334 85.333333v101.888a2.389333 2.389333 0 0 1-2.432 2.474667h-211.2V170.666667H789.333333z",fill:"#4f68b0","p-id":"11854"},null,-1)],q=t("span",{style:{"margin-top":"4px"}},"设为全局新用户默认首页",-1),D=[t("div",{style:{color:"#000ebd"}},[t("span",{class:"iconfont icon-xiugaimima"}),t("span",null,"修改密码")],-1)],G=[t("div",{class:"text-slate-500"},[t("span",{class:"iconfont icon-tuichudenglu"}),t("span",null,"退出登录")],-1)],I={key:1,class:"space-y-2 grid grid-cols-3 gap-x-3"},P=t("div",{userBox:"",class:"col-span-3",style:{"align-items":"start"}},[t("span",{class:"text-blue-400"},[r(" 登录即可享更多功能和数据同步 "),t("br"),r(" 传输双重数据加密更加安全 ")])],-1),Q=["onClick"],W=[t("div",{class:"text-yellow-500"},[t("span",{class:"iconfont icon-zhongzhi"}),t("span",null,"重置图标")],-1)],X=["onClick"],Y=[t("div",{class:"text-blue-500"},[t("span",{class:"iconfont icon-daochu"}),t("span",null,"导出图标")],-1)],$=[t("div",{class:"ml-2 text-emerald-600"},[t("span",{class:"iconfont icon-dengluzhanghu"}),t("span",null,"立即登录")],-1)],ss={__name:"user",setup(r){const ss=s(),as=async()=>{try{await c.confirm("重置将会恢复到初始状态,是否重置图标和所有设置?","温馨提示"),await c.confirm("请再次确认是否重置?","二次确认")}catch(s){return}d.del("link").del("config").del("tabbar"),p({url:"/link/reset"}).then((s=>{1===s.code&&location.reload()}))},es=()=>{window.open("/Manager","__blank"),u.emit("openController",!1)},os=async()=>{try{await c.confirm("您确定要将您当前时间节点的标签布局和主题设置以及打开方式设为全局默认?设置后所有新用户则使用默认设置,请确保不包含您的私有内容,并点击确定来继续,","危险提示!"),await c.confirm("真的确定要设置为全局的默认配置吗?","危险操作呐!"),await c.confirm("请再次确认是否设置为全局默认配置!!!","最后一次询问!");const s=await p({url:"/Admin/export",method:"post",data:{link:{link:ss.state.link,tabbar:ss.state.tabbar,config:ss.state.config}}});1===s.code?h.success("操作成功"):h.error(s.msg)}catch(s){h.info("操作已取消")}},ts=s=>{u.emit("openController",!1),u.emit("openLogin",s)},ls=s=>{const[a=null]=s.target.files;if(a){const s=new FileReader;s.onload=s=>{const{result:a=""}=s.target;try{const s=JSON.parse(a),{link:e=!1,tabbar:o=!1}=s;e&&ss.commit("updateLink",e),o&&ss.commit("updateTabbar",o)}catch(e){h.error("导入失败,请检查文件内容")}},s.readAsText(a)}},ns=()=>{v("link",JSON.stringify({link:ss.state.link,tabbar:ss.state.tabbar}))};return(s,r)=>(a(),e("div",g,[o(ss).state.isLogin?(a(),e("div",m,[t("div",b,[t("div",x,[t("div",w,[t("img",{style:{width:"80%",margin:"auto"},src:o("/dist/assets/avatar.1711290598880.png"),alt:"头像"},null,8,y)]),t("div",k,[C,t("p",z,l(o(ss).state.user.mail),1)])])]),t("div",{userBox:"",onClick:r[0]||(r[0]=n((s=>(f("tab://addicon"),void u.emit("openController",!1))),["stop"])),class:"hover user-card"},[t("div",B,[t("span",V,[(a(),e("svg",j,M))]),H])]),t("div",L,[A,t("input",{class:"absolute top-0 left-0 w-full h-full opacity-0 text-sm",type:"file",accept:".json",onChange:n(ls,["stop"])},null,40,_)]),t("div",{userBox:"",onClick:n(ns,["stop"]),class:"hover user-card"},J,8,O),t("div",{userBox:"",onClick:n(as,["stop"]),class:"hover user-card"},S,8,N),1===o(ss).state.user.manager?(a(),e("div",{key:0,userBox:"",onClick:n(es,["stop"]),class:"hover user-card"},E,8,T)):i("",!0),1===o(ss).state.user.manager?(a(),e("div",{key:1,userBox:"",onClick:n(os,["stop"]),class:"hover user-card col-span-2"},[t("div",K,[t("span",R,[(a(),e("svg",U,Z))]),q])],8,F)):i("",!0),t("div",{userBox:"",onClick:r[1]||(r[1]=n((s=>ts(3)),["stop"])),class:"hover user-card"},D),t("div",{userBox:"",onClick:r[2]||(r[2]=n((s=>o(ss).commit("loginOut")),["stop"])),class:"hover user-card"},G)])):(a(),e("div",I,[P,t("div",{userBox:"",onClick:n(as,["stop"]),class:"hover"},W,8,Q),t("div",{userBox:"",onClick:n(ns,["stop"]),class:"hover user-card"},Y,8,X),t("div",{userBox:"",onClick:r[3]||(r[3]=n((s=>ts(1)),["stop"])),class:"hover"},$)]))]))}};export{ss as default};