import{k as D,p as U,u as b,an as N,v as O,X as P,bc as S,_ as x}from"./index.js";import{D as A}from"./siteSetting-efd6ab5b.js";import{c as v,u as E}from"./index-fb041426.js";import{u as R}from"./index-8a6826ba.js";import{h as V}from"./header-b90f4bbc.js";import{D as B,q as L}from"./antd-0679333d.js";import{d as T,c as F,Z as l,_ as q,k as t,a5 as g,F as z,a6 as n,a4 as k,a8 as _,$ as a,a1 as s,a0 as I}from"./vue-72a104e4.js";import"./index-263734bb.js";import"./index-0a75e8e4.js";import"./useContentViewHeight-1771cd5b.js";import"./useWindowSizeFn-1db11f4f.js";import"./lock-a170f962.js";const H=T({name:"UserDropdown",components:{Dropdown:B,Menu:L,MenuItem:v(()=>D(()=>import("./DropMenuItem-91227dd6.js"),["./DropMenuItem-91227dd6.js","./index.js","./vue-72a104e4.js","./antd-0679333d.js","./index-6d9b3862.css"],import.meta.url)),MenuDivider:L.Divider,LockAction:v(()=>D(()=>import("./LockModal-dca74201.js"),["./LockModal-dca74201.js","./index.js","./vue-72a104e4.js","./antd-0679333d.js","./index-6d9b3862.css","./index-8a6826ba.js","./useWindowSizeFn-1db11f4f.js","./index-7064e331.css","./useForm-baba730a.js","./copyTextToClipboard-3ca69a78.js","./useForm-01d9c31d.css","./lock-a170f962.js","./header-b90f4bbc.js","./LockModal-ca58db68.css"],import.meta.url))},props:{theme:U.oneOf(["dark","light"])},setup(){const{prefixCls:e}=b("header-user-dropdown"),{t:h}=O(),{getShowDoc:C,getUseLockPage:w}=E(),c=N(),y=F(()=>{const{realName:f="",avatar:M,tenant:$}=c.getUserInfo||{};return{realName:f,avatar:M||V,desc:"",tenant:$}}),[o,{openModal:p}]=R();function u(){p(!0)}function d(){c.confirmLoginOut()}function m(){P(A)}function r(){S.push("/change-password")}function i(f){switch(f.key){case"password":r();break;case"logout":d();break;case"doc":m();break;case"lock":u();break}}return{prefixCls:e,t:h,getUserInfo:y,handleMenuClick:i,getShowDoc:C,register:o,getUseLockPage:w}}});const W=["src"];function X(e,h,C,w,c,y){const o=n("MenuItem"),p=n("MenuDivider"),u=n("Menu"),d=n("Dropdown"),m=n("LockAction");return l(),q(z,null,[t(d,{placement:"bottomLeft",overlayClassName:`${e.prefixCls}-dropdown-overlay`},{overlay:g(()=>[t(u,{onClick:e.handleMenuClick},{default:g(()=>[e.getShowDoc?(l(),k(o,{key:"doc",text:e.t("layout.header.dropdownItemDoc"),icon:"ion:document-text-outline"},null,8,["text"])):_("",!0),e.getShowDoc?(l(),k(p,{key:1})):_("",!0),e.getUseLockPage?(l(),k(o,{key:"lock",text:e.t("layout.header.tooltipLock"),icon:"ion:lock-closed-outline"},null,8,["text"])):_("",!0),t(o,{key:"password",text:e.t("layout.header.tooltipChangePassword"),icon:"ion:document-lock-outline"},null,8,["text"]),t(o,{key:"logout",text:e.t("layout.header.dropdownItemLoginOut"),icon:"ion:power-outline"},null,8,["text"])]),_:1},8,["onClick"])]),default:g(()=>{var r,i;return[a("span",{class:s([[e.prefixCls,`${e.prefixCls}--${e.theme}`],"flex"])},[a("span",{style:{"margin-right":"10px"},class:s(`${e.prefixCls}__name`)},I((i=(r=e.getUserInfo.tenant)==null?void 0:r.productList)==null?void 0:i[0].name),3),a("img",{class:s(`${e.prefixCls}__header`),src:e.getUserInfo.avatar},null,10,W),a("span",{class:s(`${e.prefixCls}__info hidden md:block`)},[a("span",{class:s([`${e.prefixCls}__name`,"truncate"])},I(e.getUserInfo.realName),3)],2)],2)]}),_:1},8,["overlayClassName"]),t(m,{onRegister:e.register},null,8,["onRegister"])],64)}const se=x(H,[["render",X]]);export{se as default};
