import{c as Be,d as me,f as ce,h as de}from"./chunk-4O3FVBGX.js";import{a as je,b as he}from"./chunk-7RP244JU.js";import{a as Ke}from"./chunk-LHGSJXTX.js";import{H as Ve,Z as Ae,ca as Pe,fa as Re,ga as H,h as Fe,ia as Ne,k as He,la as $e,ma as ue,na as k,oa as _e,pa as ze,r as B,s as z,sa as Qe,t as F,wa as Q,ya as qe,za as fe}from"./chunk-ZKNPBXGB.js";import{C as Se,H as De,I as Ee,K as pe,d as we,e as re,h as Le,i as se,n as le,o as E}from"./chunk-I5MYHHJE.js";import{$a as I,$b as b,$c as oe,Ca as Ie,Fb as a,Fc as te,Gb as u,Gc as ie,Hb as _,Ib as x,Jc as N,Mb as V,Nb as A,Ob as T,Oc as ne,Pb as S,Ra as U,Sc as $,Ta as Te,Tb as C,Vb as s,Wa as p,Y as ge,Yb as v,Z as be,Zb as G,_ as xe,_b as g,aa as ve,ad as ae,ca as w,dc as D,gb as L,gc as P,ha as f,hc as d,ia as h,ic as J,jc as X,lb as W,mb as Ce,ob as ke,pb as Y,qa as Z,qb as Me,rb as m,vc as ee,wa as ye,wc as Oe,xc as y,yb as c,yc as R}from"./chunk-CKLXM6EG.js";var Ze=`
    .p-menu {
        background: dt('menu.background');
        color: dt('menu.color');
        border: 1px solid dt('menu.border.color');
        border-radius: dt('menu.border.radius');
        min-width: 12.5rem;
    }

    .p-menu-list {
        margin: 0;
        padding: dt('menu.list.padding');
        outline: 0 none;
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: dt('menu.list.gap');
    }

    .p-menu-item-content {
        transition:
            background dt('menu.transition.duration'),
            color dt('menu.transition.duration');
        border-radius: dt('menu.item.border.radius');
        color: dt('menu.item.color');
        overflow: hidden;
    }

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

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

    .p-menu-item-icon {
        color: dt('menu.item.icon.color');
    }

    .p-menu-item.p-focus .p-menu-item-content {
        color: dt('menu.item.focus.color');
        background: dt('menu.item.focus.background');
    }

    .p-menu-item.p-focus .p-menu-item-icon {
        color: dt('menu.item.icon.focus.color');
    }

    .p-menu-item:not(.p-disabled) .p-menu-item-content:hover {
        color: dt('menu.item.focus.color');
        background: dt('menu.item.focus.background');
    }

    .p-menu-item:not(.p-disabled) .p-menu-item-content:hover .p-menu-item-icon {
        color: dt('menu.item.icon.focus.color');
    }

    .p-menu-overlay {
        box-shadow: dt('menu.shadow');
    }

    .p-menu-submenu-label {
        background: dt('menu.submenu.label.background');
        padding: dt('menu.submenu.label.padding');
        color: dt('menu.submenu.label.color');
        font-weight: dt('menu.submenu.label.font.weight');
    }

    .p-menu-separator {
        border-block-start: 1px solid dt('menu.separator.border.color');
    }
`;var Je=["pMenuItemContent",""],q=t=>({$implicit:t}),Xe=()=>({exact:!1}),et=t=>({item:t});function tt(t,r){t&1&&T(0)}function it(t,r){if(t&1&&(u(0,"a",6),m(1,tt,1,0,"ng-container",7),_()),t&2){let e=s(2),i=D(4);d(e.cx("itemLink")),a("target",e.item.target)("pBind",e.getPTOptions("itemLink")),c("title",e.item.title)("href",e.item.url||null,Te)("data-automationid",e.item.automationId)("tabindex",-1),p(),a("ngTemplateOutlet",i)("ngTemplateOutletContext",y(10,q,e.item))}}function nt(t,r){t&1&&T(0)}function ot(t,r){if(t&1&&(u(0,"a",8),m(1,nt,1,0,"ng-container",7),_()),t&2){let e=s(2),i=D(4);d(e.cx("itemLink")),a("routerLink",e.item.routerLink)("queryParams",e.item.queryParams)("routerLinkActiveOptions",e.item.routerLinkActiveOptions||Oe(18,Xe))("target",e.item.target)("fragment",e.item.fragment)("queryParamsHandling",e.item.queryParamsHandling)("preserveFragment",e.item.preserveFragment)("skipLocationChange",e.item.skipLocationChange)("replaceUrl",e.item.replaceUrl)("state",e.item.state)("pBind",e.getPTOptions("itemLink")),c("data-automationid",e.item.automationId)("tabindex",-1)("title",e.item.title),p(),a("ngTemplateOutlet",i)("ngTemplateOutletContext",y(19,q,e.item))}}function at(t,r){if(t&1&&(V(0),m(1,it,2,12,"a",4)(2,ot,2,21,"a",5),A()),t&2){let e=s();p(),a("ngIf",!(e.item!=null&&e.item.routerLink)),p(),a("ngIf",e.item==null?null:e.item.routerLink)}}function rt(t,r){}function st(t,r){t&1&&m(0,rt,0,0,"ng-template")}function lt(t,r){if(t&1&&(V(0),m(1,st,1,0,null,7),A()),t&2){let e=s();p(),a("ngTemplateOutlet",e.itemTemplate)("ngTemplateOutletContext",y(2,q,e.item))}}function pt(t,r){if(t&1&&x(0,"span",12),t&2){let e=s(2);P(e.item.iconStyle),d(e.cn(e.cx("itemIcon",y(6,et,e.item)),e.item.iconClass)),a("pBind",e.getPTOptions("itemIcon")),c("data-pc-section","itemicon")}}function mt(t,r){if(t&1&&(u(0,"span",12),J(1),_()),t&2){let e=s(2);d(e.cx("itemLabel")),a("pBind",e.getPTOptions("itemLabel")),c("data-pc-section","itemlabel"),p(),X(e.item.label)}}function ct(t,r){if(t&1&&(x(0,"span",13),te(1,"safeHtml")),t&2){let e=s(2);a("innerHTML",ie(1,3,e.item.label),U)("pBind",e.getPTOptions("itemLabel")),c("data-pc-section","itemlabel")}}function dt(t,r){if(t&1&&x(0,"p-badge",14),t&2){let e=s(2);a("styleClass",e.item.badgeStyleClass)("value",e.item.badge)("pt",e.getPTOptions("pcBadge"))}}function ut(t,r){if(t&1&&m(0,pt,1,8,"span",9)(1,mt,2,5,"span",10)(2,ct,2,5,"ng-template",null,1,N)(4,dt,1,3,"p-badge",11),t&2){let e=D(3),i=s();a("ngIf",i.item.icon),p(),a("ngIf",i.item.escape!==!1)("ngIfElse",e),p(3),a("ngIf",i.item.badge)}}var _t=["start"],ft=["end"],ht=["header"],gt=["item"],bt=["submenuheader"],xt=["list"],vt=["container"],yt=(t,r)=>({showTransitionParams:t,hideTransitionParams:r}),It=t=>({value:"visible",params:t}),We=(t,r)=>({item:t,id:r});function Tt(t,r){t&1&&T(0)}function Ct(t,r){if(t&1&&(u(0,"div",8),m(1,Tt,1,0,"ng-container",9),_()),t&2){let e=s(2);d(e.cx("start")),a("pBind",e.ptm("start")),c("data-pc-section","start"),p(),a("ngTemplateOutlet",e.startTemplate??e._startTemplate)}}function kt(t,r){if(t&1&&x(0,"li",13),t&2){let e=s(4);d(e.cx("separator")),a("pBind",e.ptm("separator")),c("data-pc-section","separator")}}function Mt(t,r){if(t&1&&(u(0,"span"),J(1),_()),t&2){let e=s(3).$implicit;p(),X(e.label)}}function Ot(t,r){if(t&1&&(x(0,"span",17),te(1,"safeHtml")),t&2){let e=s(3).$implicit;a("innerHTML",ie(1,1,e.label),U)}}function wt(t,r){if(t&1&&(V(0),m(1,Mt,2,1,"span",16)(2,Ot,2,3,"ng-template",null,2,N),A()),t&2){let e=D(3),i=s(2).$implicit;p(),a("ngIf",i.escape!==!1)("ngIfElse",e)}}function Lt(t,r){t&1&&T(0)}function St(t,r){if(t&1&&(u(0,"li",14),m(1,wt,4,2,"ng-container",7)(2,Lt,1,0,"ng-container",15),_()),t&2){let e=s(),i=e.$implicit,o=e.index,n=s(3);d(n.cx("submenuLabel")),a("pBind",n.ptm("submenuLabel"))("tooltipOptions",i.tooltipOptions),c("data-automationid",i.automationId)("id",n.menuitemId(i,n.id,o))("data-pc-section","submenulabel"),p(),a("ngIf",!n.submenuHeaderTemplate&&!n._submenuHeaderTemplate),p(),a("ngTemplateOutlet",n.submenuHeaderTemplate??n._submenuHeaderTemplate)("ngTemplateOutletContext",y(10,q,i))}}function Dt(t,r){if(t&1&&x(0,"li",13),t&2){let e=s(5);d(e.cx("separator")),a("pBind",e.ptm("separator")),c("data-pc-section","separator")}}function Et(t,r){if(t&1){let e=S();u(0,"li",19),C("onMenuItemClick",function(o){f(e);let n=s(),l=n.$implicit,M=n.index,O=s().index,j=s(3);return h(j.itemClick(o,j.menuitemId(l,j.id,O,M)))}),_()}if(t&2){let e=s(),i=e.$implicit,o=e.index,n=s().index,l=s(3);P(i.style),d(l.cn(l.cx("item",R(15,We,i,l.menuitemId(i,l.id,n,o))),i==null?null:i.styleClass)),a("pMenuItemContent",i)("itemTemplate",l.itemTemplate??l._itemTemplate)("idx",o)("menuitemId",l.menuitemId(i,l.id,n,o))("tooltipOptions",i.tooltipOptions),c("data-pc-section","menuitem")("aria-label",l.label(i.label))("data-p-focused",l.isItemFocused(l.menuitemId(i,l.id,n,o)))("data-p-disabled",l.disabled(i.disabled))("aria-disabled",l.disabled(i.disabled))("id",l.menuitemId(i,l.id,n,o))}}function Bt(t,r){if(t&1&&m(0,Dt,1,4,"li",11)(1,Et,1,18,"li",18),t&2){let e=r.$implicit,i=s().$implicit;a("ngIf",e.separator&&(e.visible!==!1||i.visible!==!1)),p(),a("ngIf",!e.separator&&e.visible!==!1&&(e.visible!==void 0||i.visible!==!1))}}function Ft(t,r){if(t&1&&m(0,kt,1,4,"li",11)(1,St,3,12,"li",12)(2,Bt,2,2,"ng-template",10),t&2){let e=r.$implicit;a("ngIf",e.separator&&e.visible!==!1),p(),a("ngIf",!e.separator),p(),a("ngForOf",e.items)}}function Ht(t,r){if(t&1&&m(0,Ft,3,3,"ng-template",10),t&2){let e=s(2);a("ngForOf",e.model)}}function Vt(t,r){if(t&1&&x(0,"li",13),t&2){let e=s(4);d(e.cx("separator")),a("pBind",e.ptm("separator")),c("data-pc-section","separator")}}function At(t,r){if(t&1){let e=S();u(0,"li",21),C("onMenuItemClick",function(o){f(e);let n=s(),l=n.$implicit,M=n.index,O=s(3);return h(O.itemClick(o,O.menuitemId(l,O.id,M)))}),_()}if(t&2){let e=s(),i=e.$implicit,o=e.index,n=s(3);d(n.cn(n.cx("item",R(14,We,i,n.menuitemId(i,n.id,o))),i==null?null:i.styleClass)),a("pMenuItemContent",i)("itemTemplate",n.itemTemplate??n._itemTemplate)("idx",o)("menuitemId",n.menuitemId(i,n.id,o))("ngStyle",i.style)("tooltipOptions",i.tooltipOptions),c("data-pc-section","menuitem")("aria-label",n.label(i.label))("data-p-focused",n.isItemFocused(n.menuitemId(i,n.id,o)))("data-p-disabled",n.disabled(i.disabled))("aria-disabled",n.disabled(i.disabled))("id",n.menuitemId(i,n.id,o))}}function Pt(t,r){if(t&1&&m(0,Vt,1,4,"li",11)(1,At,1,17,"li",20),t&2){let e=r.$implicit;a("ngIf",e.separator&&e.visible!==!1),p(),a("ngIf",!e.separator&&e.visible!==!1)}}function Rt(t,r){if(t&1&&m(0,Pt,2,2,"ng-template",10),t&2){let e=s(2);a("ngForOf",e.model)}}function Nt(t,r){t&1&&T(0)}function $t(t,r){if(t&1&&(u(0,"div",8),m(1,Nt,1,0,"ng-container",9),_()),t&2){let e=s(2);d(e.cx("end")),a("pBind",e.ptm("end")),c("data-pc-section","end"),p(),a("ngTemplateOutlet",e.endTemplate??e._endTemplate)}}function zt(t,r){if(t&1){let e=S();u(0,"div",4,0),C("click",function(o){f(e);let n=s();return h(n.onOverlayClick(o))})("@overlayAnimation.start",function(o){f(e);let n=s();return h(n.onOverlayAnimationStart(o))})("@overlayAnimation.done",function(o){f(e);let n=s();return h(n.onOverlayAnimationEnd(o))}),m(2,Ct,2,5,"div",5),u(3,"ul",6,1),C("focus",function(o){f(e);let n=s();return h(n.onListFocus(o))})("blur",function(o){f(e);let n=s();return h(n.onListBlur(o))})("keydown",function(o){f(e);let n=s();return h(n.onListKeyDown(o))}),m(5,Ht,1,1,null,7)(6,Rt,1,1,null,7),_(),m(7,$t,2,5,"div",5),_()}if(t&2){let e=s();P(e.sx("root")),d(e.cn(e.cx("root"),e.styleClass)),a("ngStyle",e.style)("@overlayAnimation",y(26,It,R(23,yt,e.showTransitionOptions,e.hideTransitionOptions)))("@.disabled",e.popup!==!0)("pBind",e.ptm("root")),c("data-pc-name","menu")("id",e.id),p(2),a("ngIf",e.startTemplate??e._startTemplate),p(),d(e.cx("list")),a("pBind",e.ptm("list")),c("id",e.id+"_list")("tabindex",e.getTabIndexValue())("data-pc-section","menu")("aria-activedescendant",e.activedescendant())("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy),p(2),a("ngIf",e.hasSubMenu()),p(),a("ngIf",!e.hasSubMenu()),p(),a("ngIf",e.endTemplate??e._endTemplate)}}var Qt={root:({instance:t})=>({position:t.popup?"absolute":"relative"})},Kt={root:({instance:t})=>["p-menu p-component",{"p-menu-overlay":t.popup}],start:"p-menu-start",list:"p-menu-list",submenuLabel:"p-menu-submenu-label",separator:"p-menu-separator",end:"p-menu-end",item:({instance:t,item:r,id:e})=>["p-menu-item",{"p-focus":t.focusedOptionId()&&e===t.focusedOptionId(),"p-disabled":t.disabled(r.disabled)},r.styleClass],itemContent:"p-menu-item-content",itemLink:"p-menu-item-link",itemIcon:({item:t})=>["p-menu-item-icon",t.icon,t.iconClass],itemLabel:"p-menu-item-label"},K=(()=>{class t extends Ne{name="menu";style=Ze;classes=Kt;inlineStyles=Qt;static \u0275fac=(()=>{let e;return function(o){return(e||(e=ye(t)))(o||t)}})();static \u0275prov=be({token:t,factory:t.\u0275fac})}return t})();var Ue=new ve("MENU_INSTANCE"),Ye=(()=>{class t{platformId;sanitizer;constructor(e,i){this.platformId=e,this.sanitizer=i}transform(e){return!e||!E(this.platformId)?e:this.sanitizer.bypassSecurityTrustHtml(e)}static \u0275fac=function(i){return new(i||t)(L(Ie,16),L(Se,16))};static \u0275pipe=ke({name:"safeHtml",type:t,pure:!0})}return t})(),qt=(()=>{class t extends ue{item;itemTemplate;menuitemId=$("");idx=$(0);onMenuItemClick=new I;menu;_componentStyle=w(K);hostName="Menu";constructor(e){super(),this.menu=e}onItemClick(e,i){this.onMenuItemClick.emit({originalEvent:e,item:i})}getPTOptions(e){return this.menu.getPTOptions(e,this.item,this.idx(),this.menuitemId())}static \u0275fac=function(i){return new(i||t)(L(ge(()=>Ge)))};static \u0275cmp=W({type:t,selectors:[["","pMenuItemContent",""]],inputs:{item:[0,"pMenuItemContent","item"],itemTemplate:"itemTemplate",menuitemId:[1,"menuitemId"],idx:[1,"idx"]},outputs:{onMenuItemClick:"onMenuItemClick"},features:[ee([K]),Y],attrs:Je,decls:5,vars:6,consts:[["itemContent",""],["htmlLabel",""],[3,"click","pBind"],[4,"ngIf"],["pRipple","",3,"class","target","pBind",4,"ngIf"],["routerLinkActive","p-menu-item-link-active","pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","class","target","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state","pBind",4,"ngIf"],["pRipple","",3,"target","pBind"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["routerLinkActive","p-menu-item-link-active","pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state","pBind"],[3,"class","pBind","style",4,"ngIf"],[3,"class","pBind",4,"ngIf","ngIfElse"],[3,"styleClass","value","pt",4,"ngIf"],[3,"pBind"],[1,"p-menu-item-label",3,"innerHTML","pBind"],[3,"styleClass","value","pt"]],template:function(i,o){if(i&1){let n=S();u(0,"div",2),C("click",function(M){return f(n),h(o.onItemClick(M,o.item))}),m(1,at,3,2,"ng-container",3)(2,lt,2,4,"ng-container",3)(3,ut,5,4,"ng-template",null,0,N),_()}i&2&&(d(o.cx("itemContent")),a("pBind",o.getPTOptions("itemContent")),c("data-pc-section","content"),p(),a("ngIf",!o.itemTemplate),p(),a("ngIf",o.itemTemplate))},dependencies:[le,re,se,pe,De,Ee,Ke,fe,k,he,je,H,_e,Ye],encapsulation:2})}return t})(),Ge=(()=>{class t extends ue{overlayService;model;popup;style;styleClass;autoZIndex=!0;baseZIndex=0;showTransitionOptions=".12s cubic-bezier(0, 0, 0.2, 1)";hideTransitionOptions=".1s linear";ariaLabel;ariaLabelledBy;id;tabindex=0;appendTo=$(void 0);onShow=new I;onHide=new I;onBlur=new I;onFocus=new I;listViewChild;containerViewChild;$appendTo=ne(()=>this.appendTo()||this.config.overlayAppendTo());container;scrollHandler;documentClickListener;documentResizeListener;preventDocumentDefault;target;visible;focusedOptionId=ne(()=>this.focusedOptionIndex()!==-1?this.focusedOptionIndex():null);focusedOptionIndex=Z(-1);selectedOptionIndex=Z(-1);focused=!1;overlayVisible=!1;relativeAlign;$pcMenu=w(Ue,{optional:!0,skipSelf:!0})??void 0;_componentStyle=w(K);bindDirectiveInstance=w(k,{self:!0});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptm("host"))}constructor(e){super(),this.overlayService=e,this.id=this.id||Ae("pn_id_")}getPTOptions(e,i,o,n){return this.ptm(e,{context:{item:i,index:o,focused:this.isItemFocused(n),disabled:this.disabled(i.disabled)}})}toggle(e){this.visible?this.hide():this.show(e),this.preventDocumentDefault=!0}show(e){this.target=e.currentTarget,this.relativeAlign=e.relativeAlign,this.visible=!0,this.preventDocumentDefault=!0,this.overlayVisible=!0,this.cd.markForCheck()}onInit(){this.popup||this.bindDocumentClickListener()}startTemplate;_startTemplate;endTemplate;_endTemplate;headerTemplate;_headerTemplate;itemTemplate;_itemTemplate;submenuHeaderTemplate;_submenuHeaderTemplate;templates;onAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"start":this._startTemplate=e.template;break;case"end":this._endTemplate=e.template;break;case"item":this._itemTemplate=e.template;break;case"submenuheader":this._submenuHeaderTemplate=e.template;break;default:this._itemTemplate=e.template;break}})}getTabIndexValue(){return this.tabindex!==void 0?this.tabindex.toString():null}onOverlayAnimationStart(e){switch(e.toState){case"visible":this.popup&&(this.container=e.element,this.moveOnTop(),this.onShow.emit({}),this.$attrSelector&&this.container?.setAttribute(this.$attrSelector,""),this.appendOverlay(),this.alignOverlay(),this.bindDocumentClickListener(),this.bindDocumentResizeListener(),this.bindScrollListener(),F(this.listViewChild?.nativeElement));break;case"void":this.onOverlayHide(),this.onHide.emit({});break}}onOverlayAnimationEnd(e){switch(e.toState){case"void":this.autoZIndex&&Q.clear(e.element);break}}alignOverlay(){this.relativeAlign?He(this.container,this.target):Fe(this.container,this.target)}appendOverlay(){ze.appendOverlay(this.container,this.$appendTo()==="body"?this.document.body:this.$appendTo(),this.$appendTo())}restoreOverlayAppend(){this.container&&this.$appendTo()!=="self"&&this.renderer.appendChild(this.el.nativeElement,this.container)}moveOnTop(){this.autoZIndex&&Q.set("menu",this.container,this.baseZIndex+this.config.zIndex.menu)}hide(){this.visible=!1,this.relativeAlign=!1,this.cd.markForCheck()}onWindowResize(){this.visible&&!Ve()&&this.hide()}menuitemId(e,i,o,n){return e?.id??`${i}_${o}${n!==void 0?"_"+n:""}`}isItemFocused(e){return this.focusedOptionId()===e}label(e){return typeof e=="function"?e():e}disabled(e){return typeof e=="function"?e():typeof e>"u"?!1:e}activedescendant(){return this.focused?this.focusedOptionId():void 0}onListFocus(e){this.focused||(this.focused=!0,!this.popup&&this.changeFocusedOptionIndex(0),this.onFocus.emit(e))}onListBlur(e){this.focused&&(this.focused=!1,this.changeFocusedOptionIndex(-1),this.selectedOptionIndex.set(-1),this.focusedOptionIndex.set(-1),this.onBlur.emit(e))}onListKeyDown(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":this.onEnterKey(e);break;case"NumpadEnter":this.onEnterKey(e);break;case"Space":this.onSpaceKey(e);break;case"Escape":case"Tab":this.popup&&(F(this.target),this.hide()),this.overlayVisible&&this.hide();break;default:break}}onArrowDownKey(e){let i=this.findNextOptionIndex(this.focusedOptionIndex());this.changeFocusedOptionIndex(i),e.preventDefault()}onArrowUpKey(e){if(e.altKey&&this.popup)F(this.target),this.hide(),e.preventDefault();else{let i=this.findPrevOptionIndex(this.focusedOptionIndex());this.changeFocusedOptionIndex(i),e.preventDefault()}}onHomeKey(e){this.changeFocusedOptionIndex(0),e.preventDefault()}onEndKey(e){this.changeFocusedOptionIndex(B(this.containerViewChild?.nativeElement,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1),e.preventDefault()}onEnterKey(e){let i=z(this.containerViewChild?.nativeElement,`li[id="${`${this.focusedOptionIndex()}`}"]`),o=i&&(z(i,'[data-pc-section="itemlink"]')||z(i,"a,button"));this.popup&&F(this.target),o?o.click():i&&i.click(),e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}findNextOptionIndex(e){let o=[...B(this.containerViewChild?.nativeElement,'li[data-pc-section="menuitem"][data-p-disabled="false"]')].findIndex(n=>n.id===e);return o>-1?o+1:0}findPrevOptionIndex(e){let o=[...B(this.containerViewChild?.nativeElement,'li[data-pc-section="menuitem"][data-p-disabled="false"]')].findIndex(n=>n.id===e);return o>-1?o-1:0}changeFocusedOptionIndex(e){let i=B(this.containerViewChild?.nativeElement,'li[data-pc-section="menuitem"][data-p-disabled="false"]');if(i.length>0){let o=e>=i.length?i.length-1:e<0?0:e;o>-1&&this.focusedOptionIndex.set(i[o].getAttribute("id"))}}itemClick(e,i){let{originalEvent:o,item:n}=e;if(this.focused||(this.focused=!0,this.onFocus.emit()),n.disabled){o.preventDefault();return}!n.url&&!n.routerLink&&o.preventDefault(),n.command&&n.command({originalEvent:o,item:n}),this.popup&&this.hide(),!this.popup&&this.focusedOptionIndex()!==i&&this.focusedOptionIndex.set(i)}onOverlayClick(e){this.popup&&this.overlayService.add({originalEvent:e,target:this.el.nativeElement}),this.preventDocumentDefault=!0}bindDocumentClickListener(){if(!this.documentClickListener&&E(this.platformId)){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",i=>{let o=this.containerViewChild?.nativeElement&&!this.containerViewChild?.nativeElement.contains(i.target),n=!(this.target&&(this.target===i.target||this.target.contains(i.target)));!this.popup&&o&&n&&this.onListBlur(i),this.preventDocumentDefault&&this.overlayVisible&&o&&n&&(this.hide(),this.preventDocumentDefault=!1)})}}unbindDocumentClickListener(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null)}bindDocumentResizeListener(){if(!this.documentResizeListener&&E(this.platformId)){let e=this.document.defaultView;this.documentResizeListener=this.renderer.listen(e,"resize",this.onWindowResize.bind(this))}}unbindDocumentResizeListener(){this.documentResizeListener&&(this.documentResizeListener(),this.documentResizeListener=null)}bindScrollListener(){!this.scrollHandler&&E(this.platformId)&&(this.scrollHandler=new Qe(this.target,()=>{this.visible&&this.hide()})),this.scrollHandler?.bindScrollListener()}unbindScrollListener(){this.scrollHandler&&(this.scrollHandler.unbindScrollListener(),this.scrollHandler=null)}onOverlayHide(){this.unbindDocumentClickListener(),this.unbindDocumentResizeListener(),this.unbindScrollListener(),this.preventDocumentDefault=!1,this.cd.destroyed||(this.target=null)}onDestroy(){this.popup&&(this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.container&&this.autoZIndex&&Q.clear(this.container),this.restoreOverlayAppend(),this.onOverlayHide()),this.popup||this.unbindDocumentClickListener()}hasSubMenu(){return this.model?.some(e=>e.items)??!1}isItemHidden(e){return e.separator?e.visible===!1||e.items&&e.items.some(i=>i.visible!==!1):e.visible===!1}static \u0275fac=function(i){return new(i||t)(L(Pe))};static \u0275cmp=W({type:t,selectors:[["p-menu"]],contentQueries:function(i,o,n){if(i&1&&(v(n,_t,4),v(n,ft,4),v(n,ht,4),v(n,gt,4),v(n,bt,4),v(n,Re,4)),i&2){let l;g(l=b())&&(o.startTemplate=l.first),g(l=b())&&(o.endTemplate=l.first),g(l=b())&&(o.headerTemplate=l.first),g(l=b())&&(o.itemTemplate=l.first),g(l=b())&&(o.submenuHeaderTemplate=l.first),g(l=b())&&(o.templates=l)}},viewQuery:function(i,o){if(i&1&&(G(xt,5),G(vt,5)),i&2){let n;g(n=b())&&(o.listViewChild=n.first),g(n=b())&&(o.containerViewChild=n.first)}},inputs:{model:"model",popup:[2,"popup","popup",oe],style:"style",styleClass:"styleClass",autoZIndex:[2,"autoZIndex","autoZIndex",oe],baseZIndex:[2,"baseZIndex","baseZIndex",ae],showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",id:"id",tabindex:[2,"tabindex","tabindex",ae],appendTo:[1,"appendTo"]},outputs:{onShow:"onShow",onHide:"onHide",onBlur:"onBlur",onFocus:"onFocus"},features:[ee([K,{provide:Ue,useExisting:t},{provide:$e,useExisting:t}]),Me([k]),Y],decls:1,vars:1,consts:[["container",""],["list",""],["htmlSubmenuLabel",""],[3,"class","style","ngStyle","pBind","click",4,"ngIf"],[3,"click","ngStyle","pBind"],[3,"class","pBind",4,"ngIf"],["role","menu",3,"focus","blur","keydown","pBind"],[4,"ngIf"],[3,"pBind"],[4,"ngTemplateOutlet"],["ngFor","",3,"ngForOf"],["role","separator",3,"class","pBind",4,"ngIf"],["pTooltip","","role","none",3,"class","pBind","tooltipOptions",4,"ngIf"],["role","separator",3,"pBind"],["pTooltip","","role","none",3,"pBind","tooltipOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngIf","ngIfElse"],[3,"innerHTML"],["pTooltip","","role","menuitem",3,"class","pMenuItemContent","itemTemplate","idx","menuitemId","style","tooltipOptions","onMenuItemClick",4,"ngIf"],["pTooltip","","role","menuitem",3,"onMenuItemClick","pMenuItemContent","itemTemplate","idx","menuitemId","tooltipOptions"],["pTooltip","","role","menuitem",3,"class","pMenuItemContent","itemTemplate","idx","menuitemId","ngStyle","tooltipOptions","onMenuItemClick",4,"ngIf"],["pTooltip","","role","menuitem",3,"onMenuItemClick","pMenuItemContent","itemTemplate","idx","menuitemId","ngStyle","tooltipOptions"]],template:function(i,o){i&1&&m(0,zt,8,28,"div",3),i&2&&a("ngIf",!o.popup||o.visible)},dependencies:[le,we,re,se,Le,pe,qt,fe,qe,k,he,H,_e,Ye],encapsulation:2,data:{animation:[Be("overlayAnimation",[de(":enter",[ce({opacity:0,transform:"scaleY(0.8)"}),me("{{showTransitionParams}}")]),de(":leave",[me("{{hideTransitionParams}}",ce({opacity:0}))])])]},changeDetection:0})}return t})(),wi=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Ce({type:t});static \u0275inj=xe({imports:[Ge,H,H]})}return t})();export{Ge as a,wi as b};
