import{B as H,U as M,Z as O,m as g,az as k,q as S,a2 as N,aA as U,a3 as x,aB as Z,af as _,Q as W,y as K,k as j,x as l,R as q,C as z,o,g as u,a as I,d as D,c as f,n as R,E as A,h as c,t as w,A as E,w as b,b as J,T as Q,j as y,F as v,D as P,f as G,u as F,aC as X,_ as Y,r as $,J as ee,a8 as te,S as ne,ad as ie}from"./app-SC54XQDl.js";import{O as se}from"./app-CCkWSX4Q.js";var oe=function(e){var n=e.dt;return`
.p-menu {
    background: `.concat(n("menu.background"),`;
    color: `).concat(n("menu.color"),`;
    border: 1px solid `).concat(n("menu.border.color"),`;
    border-radius: `).concat(n("menu.border.radius"),`;
    min-width: 12.5rem;
}

.p-menu-list {
    margin: 0;
    padding: `).concat(n("menu.list.padding"),`;
    outline: 0 none;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: `).concat(n("menu.list.gap"),`;
}

.p-menu-item-content {
    transition: background `).concat(n("menu.transition.duration"),", color ").concat(n("menu.transition.duration"),`;
    border-radius: `).concat(n("menu.item.border.radius"),`;
    color: `).concat(n("menu.item.color"),`;
}

.p-menu-item-link {
    cursor: pointer;
    display: flex;
    align-items: center;
    text-decoration: none;
    overflow: hidden;
    position: relative;
    color: inherit;
    padding: `).concat(n("menu.item.padding"),`;
    gap: `).concat(n("menu.item.gap"),`;
    user-select: none;
    outline: 0 none;
}

.p-menu-item-label {
    line-height: 1;
}

.p-menu-item-icon {
    color: `).concat(n("menu.item.icon.color"),`;
}

.p-menu-item.p-focus .p-menu-item-content {
    color: `).concat(n("menu.item.focus.color"),`;
    background: `).concat(n("menu.item.focus.background"),`;
}

.p-menu-item.p-focus .p-menu-item-icon {
    color: `).concat(n("menu.item.icon.focus.color"),`;
}

.p-menu-item:not(.p-disabled) .p-menu-item-content:hover {
    color: `).concat(n("menu.item.focus.color"),`;
    background: `).concat(n("menu.item.focus.background"),`;
}

.p-menu-item:not(.p-disabled) .p-menu-item-content:hover .p-menu-item-icon {
    color: `).concat(n("menu.item.icon.focus.color"),`;
}

.p-menu-overlay {
    box-shadow: `).concat(n("menu.shadow"),`;
}

.p-menu-submenu-label {
    background: `).concat(n("menu.submenu.label.background"),`;
    padding: `).concat(n("menu.submenu.label.padding"),`;
    color: `).concat(n("menu.submenu.label.color"),`;
    font-weight: `).concat(n("menu.submenu.label.font.weight"),`;
}

.p-menu-separator {
    border-top: 1px solid `).concat(n("menu.separator.border.color"),`;
}
`)},ae={root:function(e){var n=e.props;return["p-menu p-component",{"p-menu-overlay":n.popup}]},start:"p-menu-start",list:"p-menu-list",submenuLabel:"p-menu-submenu-label",separator:"p-menu-separator",end:"p-menu-end",item:function(e){var n=e.instance;return["p-menu-item",{"p-focus":n.id===n.focusedOptionId,"p-disabled":n.disabled()}]},itemContent:"p-menu-item-content",itemLink:"p-menu-item-link",itemIcon:"p-menu-item-icon",itemLabel:"p-menu-item-label"},re=H.extend({name:"menu",theme:oe,classes:ae}),le={name:"BaseMenu",extends:K,props:{popup:{type:Boolean,default:!1},model:{type:Array,default:null},appendTo:{type:[String,Object],default:"body"},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:re,provide:function(){return{$pcMenu:this,$parentInstance:this}}},B={name:"Menuitem",hostName:"Menu",extends:K,inheritAttrs:!1,emits:["item-click","item-mousemove"],props:{item:null,templates:null,id:null,focusedOptionId:null,index:null},methods:{getItemProp:function(e,n){return e&&e.item?j(e.item[n]):void 0},getPTOptions:function(e){return this.ptm(e,{context:{item:this.item,index:this.index,focused:this.isItemFocused(),disabled:this.disabled()}})},isItemFocused:function(){return this.focusedOptionId===this.id},onItemClick:function(e){var n=this.getItemProp(this.item,"command");n&&n({originalEvent:e,item:this.item.item}),this.$emit("item-click",{originalEvent:e,item:this.item,id:this.id})},onItemMouseMove:function(e){this.$emit("item-mousemove",{originalEvent:e,item:this.item,id:this.id})},visible:function(){return typeof this.item.visible=="function"?this.item.visible():this.item.visible!==!1},disabled:function(){return typeof this.item.disabled=="function"?this.item.disabled():this.item.disabled},label:function(){return typeof this.item.label=="function"?this.item.label():this.item.label},getMenuItemProps:function(e){return{action:l({class:this.cx("itemLink"),tabindex:"-1","aria-hidden":!0},this.getPTOptions("itemLink")),icon:l({class:[this.cx("itemIcon"),e.icon]},this.getPTOptions("itemIcon")),label:l({class:this.cx("itemLabel")},this.getPTOptions("itemLabel"))}}},directives:{ripple:q}},ue=["id","aria-label","aria-disabled","data-p-focused","data-p-disabled"],de=["href","target"];function ce(t,e,n,a,r,i){var m=z("ripple");return i.visible()?(o(),u("li",l({key:0,id:n.id,class:[t.cx("item"),n.item.class],role:"menuitem",style:n.item.style,"aria-label":i.label(),"aria-disabled":i.disabled()},i.getPTOptions("item"),{"data-p-focused":i.isItemFocused(),"data-p-disabled":i.disabled()||!1}),[I("div",l({class:t.cx("itemContent"),onClick:e[0]||(e[0]=function(p){return i.onItemClick(p)}),onMousemove:e[1]||(e[1]=function(p){return i.onItemMouseMove(p)})},i.getPTOptions("itemContent")),[n.templates.item?n.templates.item?(o(),f(A(n.templates.item),{key:1,item:n.item,label:i.label(),props:i.getMenuItemProps(n.item)},null,8,["item","label","props"])):c("",!0):D((o(),u("a",l({key:0,href:n.item.url,class:t.cx("itemLink"),target:n.item.target,tabindex:"-1"},i.getPTOptions("itemLink")),[n.templates.itemicon?(o(),f(A(n.templates.itemicon),{key:0,item:n.item,class:R(t.cx("itemIcon"))},null,8,["item","class"])):n.item.icon?(o(),u("span",l({key:1,class:[t.cx("itemIcon"),n.item.icon]},i.getPTOptions("itemIcon")),null,16)):c("",!0),I("span",l({class:t.cx("itemLabel")},i.getPTOptions("itemLabel")),w(i.label()),17)],16,de)),[[m]])],16)],16,ue)):c("",!0)}B.render=ce;function T(t){return he(t)||pe(t)||fe(t)||me()}function me(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fe(t,e){if(t){if(typeof t=="string")return C(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(t,e):void 0}}function pe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function he(t){if(Array.isArray(t))return C(t)}function C(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,a=Array(e);n<e;n++)a[n]=t[n];return a}var V={name:"Menu",extends:le,inheritAttrs:!1,emits:["show","hide","focus","blur"],data:function(){return{id:this.$attrs.id,overlayVisible:!1,focused:!1,focusedOptionIndex:-1,selectedOptionIndex:-1}},watch:{"$attrs.id":function(e){this.id=e||M()}},target:null,outsideClickListener:null,scrollHandler:null,resizeListener:null,container:null,list:null,mounted:function(){this.id=this.id||M(),this.popup||(this.bindResizeListener(),this.bindOutsideClickListener())},beforeUnmount:function(){this.unbindResizeListener(),this.unbindOutsideClickListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.target=null,this.container&&this.autoZIndex&&O.clear(this.container),this.container=null},methods:{itemClick:function(e){var n=e.item;this.disabled(n)||(n.command&&n.command(e),this.overlayVisible&&this.hide(),!this.popup&&this.focusedOptionIndex!==e.id&&(this.focusedOptionIndex=e.id))},itemMouseMove:function(e){this.focused&&(this.focusedOptionIndex=e.id)},onListFocus:function(e){this.focused=!0,!this.popup&&this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":this.popup&&(g(this.target),this.hide());case"Tab":this.overlayVisible&&this.hide();break}},onArrowDownKey:function(e){var n=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(n),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey&&this.popup)g(this.target),this.hide(),e.preventDefault();else{var n=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(n),e.preventDefault()}},onHomeKey:function(e){this.changeFocusedOptionIndex(0),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(k(this.container,'li[data-pc-section="item"][data-p-disabled="false"]').length-1),e.preventDefault()},onEnterKey:function(e){var n=S(this.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),a=n&&S(n,'a[data-pc-section="itemlink"]');this.popup&&g(this.target),a?a.click():n&&n.click(),e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},findNextOptionIndex:function(e){var n=k(this.container,'li[data-pc-section="item"][data-p-disabled="false"]'),a=T(n).findIndex(function(r){return r.id===e});return a>-1?a+1:0},findPrevOptionIndex:function(e){var n=k(this.container,'li[data-pc-section="item"][data-p-disabled="false"]'),a=T(n).findIndex(function(r){return r.id===e});return a>-1?a-1:0},changeFocusedOptionIndex:function(e){var n=k(this.container,'li[data-pc-section="item"][data-p-disabled="false"]'),a=e>=n.length?n.length-1:e<0?0:e;a>-1&&(this.focusedOptionIndex=n[a].getAttribute("id"))},toggle:function(e){this.overlayVisible?this.hide():this.show(e)},show:function(e){this.overlayVisible=!0,this.target=e.currentTarget},hide:function(){this.overlayVisible=!1,this.target=null},onEnter:function(e){N(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.bindOutsideClickListener(),this.bindResizeListener(),this.bindScrollListener(),this.autoZIndex&&O.set("menu",e,this.baseZIndex+this.$primevue.config.zIndex.menu),this.popup&&g(this.list),this.$emit("show")},onLeave:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.$emit("hide")},onAfterLeave:function(e){this.autoZIndex&&O.clear(e)},alignOverlay:function(){U(this.container,this.target);var e=x(this.target);e>x(this.container)&&(this.container.style.minWidth=x(this.target)+"px")},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(n){var a=e.container&&!e.container.contains(n.target),r=!(e.target&&(e.target===n.target||e.target.contains(n.target)));e.overlayVisible&&a&&r?e.hide():!e.popup&&a&&r&&(e.focusedOptionIndex=-1)},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new Z(this.target,function(){e.overlayVisible&&e.hide()})),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!_()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},visible:function(e){return typeof e.visible=="function"?e.visible():e.visible!==!1},disabled:function(e){return typeof e.disabled=="function"?e.disabled():e.disabled},label:function(e){return typeof e.label=="function"?e.label():e.label},onOverlayClick:function(e){se.emit("overlay-click",{originalEvent:e,target:this.target})},containerRef:function(e){this.container=e},listRef:function(e){this.list=e}},computed:{focusedOptionId:function(){return this.focusedOptionIndex!==-1?this.focusedOptionIndex:null}},components:{PVMenuitem:B,Portal:W}},be=["id"],ye=["id","tabindex","aria-activedescendant","aria-label","aria-labelledby"],ve=["id"];function ge(t,e,n,a,r,i){var m=E("PVMenuitem"),p=E("Portal");return o(),f(p,{appendTo:t.appendTo,disabled:!t.popup},{default:b(function(){return[J(Q,l({name:"p-connected-overlay",onEnter:i.onEnter,onLeave:i.onLeave,onAfterLeave:i.onAfterLeave},t.ptm("transition")),{default:b(function(){return[!t.popup||r.overlayVisible?(o(),u("div",l({key:0,ref:i.containerRef,id:r.id,class:t.cx("root"),onClick:e[3]||(e[3]=function(){return i.onOverlayClick&&i.onOverlayClick.apply(i,arguments)})},t.ptmi("root")),[t.$slots.start?(o(),u("div",l({key:0,class:t.cx("start")},t.ptm("start")),[y(t.$slots,"start")],16)):c("",!0),I("ul",l({ref:i.listRef,id:r.id+"_list",class:t.cx("list"),role:"menu",tabindex:t.tabindex,"aria-activedescendant":r.focused?i.focusedOptionId:void 0,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,onFocus:e[0]||(e[0]=function(){return i.onListFocus&&i.onListFocus.apply(i,arguments)}),onBlur:e[1]||(e[1]=function(){return i.onListBlur&&i.onListBlur.apply(i,arguments)}),onKeydown:e[2]||(e[2]=function(){return i.onListKeyDown&&i.onListKeyDown.apply(i,arguments)})},t.ptm("list")),[(o(!0),u(v,null,P(t.model,function(s,d){return o(),u(v,{key:i.label(s)+d.toString()},[s.items&&i.visible(s)&&!s.separator?(o(),u(v,{key:0},[s.items?(o(),u("li",l({key:0,id:r.id+"_"+d,class:[t.cx("submenuLabel"),s.class],role:"none",ref_for:!0},t.ptm("submenuLabel")),[y(t.$slots,t.$slots.submenulabel?"submenulabel":"submenuheader",{item:s},function(){return[G(w(i.label(s)),1)]})],16,ve)):c("",!0),(o(!0),u(v,null,P(s.items,function(h,L){return o(),u(v,{key:h.label+d+"_"+L},[i.visible(h)&&!h.separator?(o(),f(m,{key:0,id:r.id+"_"+d+"_"+L,item:h,templates:t.$slots,focusedOptionId:i.focusedOptionId,unstyled:t.unstyled,onItemClick:i.itemClick,onItemMousemove:i.itemMouseMove,pt:t.pt},null,8,["id","item","templates","focusedOptionId","unstyled","onItemClick","onItemMousemove","pt"])):i.visible(h)&&h.separator?(o(),u("li",l({key:"separator"+d+L,class:[t.cx("separator"),s.class],style:h.style,role:"separator",ref_for:!0},t.ptm("separator")),null,16)):c("",!0)],64)}),128))],64)):i.visible(s)&&s.separator?(o(),u("li",l({key:"separator"+d.toString(),class:[t.cx("separator"),s.class],style:s.style,role:"separator",ref_for:!0},t.ptm("separator")),null,16)):(o(),f(m,{key:i.label(s)+d.toString(),id:r.id+"_"+d,item:s,index:d,templates:t.$slots,focusedOptionId:i.focusedOptionId,unstyled:t.unstyled,onItemClick:i.itemClick,onItemMousemove:i.itemMouseMove,pt:t.pt},null,8,["id","item","index","templates","focusedOptionId","unstyled","onItemClick","onItemMousemove","pt"]))],64)}),128))],16,ye),t.$slots.end?(o(),u("div",l({key:1,class:t.cx("end")},t.ptm("end")),[y(t.$slots,"end")],16)):c("",!0)],16,be)):c("",!0)]}),_:3},16,["onEnter","onLeave","onAfterLeave"])]}),_:3},8,["appendTo","disabled"])}V.render=ge;const ke={__name:"TBadge",setup(t){return(e,n)=>(o(),f(F(X)))}},Ie=["href"],Le={__name:"TMenu",props:["items"],setup(t,{expose:e}){const n=t,a=$(),r=()=>{n.items.forEach(i=>{typeof i.name=="string"&&(i.label=i.name),i.items instanceof Array&&i.items.forEach(m=>{typeof m.name=="string"&&(m.label=m.name)})})};return n.items instanceof Array&&r(),ee(()=>n.items,()=>{r()}),e({toggle:function(i){a.value.toggle(i)}}),(i,m)=>{const p=z("ripple");return o(),f(F(V),{model:t.items,ref_key:"menuRef",ref:a},te({start:b(()=>[y(i.$slots,"start",{},void 0,!0)]),end:b(()=>[y(i.$slots,"end",{},void 0,!0)]),_:2},[i.$slots.item?{name:"item",fn:b(s=>[y(i.$slots,"item",ne(ie(s)),void 0,!0)]),key:"1"}:{name:"item",fn:b(({item:s,props:d})=>[D((o(),u("a",l({class:["flex items-center",{active:s.active}],href:s.url},d.action),[s.icon?(o(),u("span",{key:0,class:R(s.icon)},null,2)):c("",!0),I("span",null,w(s.label),1),s.badge?(o(),f(ke,{key:1,class:"ml-auto",value:s.badge,severity:s.badgeSeverity},null,8,["value","severity"])):c("",!0)],16,Ie)),[[p]])]),key:"0"}]),1032,["model"])}}},Ce=Y(Le,[["__scopeId","data-v-3f9115f6"]]);export{Ce as T};
