import{a as z,d as G,e as K,f as Q,g as W,h as X}from"./chunk-6GPZSJ3N.js";import{e as Y,j as q}from"./chunk-DFIFTGMN.js";import{c as B}from"./chunk-MAXNBAXR.js";import{b as J}from"./chunk-IDTJ2LL2.js";import{b as Z}from"./chunk-EWHWQZ72.js";import{f as H}from"./chunk-Z5PP2CRF.js";import{ad as F,bd as $,uc as l,zd as k}from"./chunk-CBXQYRPM.js";import{Bc as N,H as h,Jb as E,Ka as a,Kb as f,La as d,Lb as b,Vc as A,Wc as U,Xc as L,Yc as V,Z as S,Zc as P,ab as c,ac as j,cb as r,da as v,eb as O,k as _,ka as g,la as M,mb as o,nb as m,ob as u,qa as C,ra as x,sb as I,sc as w,tc as D,vb as T,xb as s,yb as R,zb as y}from"./chunk-LVXYIJUI.js";var it=[[["","prefixContent",""]]],nt=["[prefixContent]"];function ot(e,p){if(e&1&&(o(0,"mat-icon"),f(1),m()),e&2){let t=s().$implicit;a(),b(t.customIcon)}}function rt(e,p){if(e&1&&u(0,"mat-icon",11),e&2){let t=s(2).$implicit;r("svgIcon",t.customSvg)}}function at(e,p){if(e&1&&c(0,rt,1,1,"mat-icon",10),e&2){let t=s().$implicit;r("ngIf",t.customSvg)}}function mt(e,p){if(e&1){let t=I();o(0,"button",8),T("click",function(){let n=C(t).$implicit,tt=s();return x(tt.navigateTo(n))}),c(1,ot,2,1,"mat-icon",9)(2,at,1,1,"ng-template",null,0,j),o(4,"span"),f(5),m()()}if(e&2){let t=p.$implicit,i=E(3),n=s();O("selected",n.optionSelected(t)),r("disabled",t.disabled),a(),r("ngIf",t.customIcon)("ngIfElse",i),a(4),b(t.label)}}function st(e,p){e&1&&(o(0,"div",12),y(1),m())}var pt=(()=>{class e{constructor(t,i){this.router=t,this.route=i,this.menuOptions=[],this.destroySubject=new _}ngOnInit(){this.router.events.pipe(S(this.destroySubject),h(t=>t instanceof A)).subscribe(t=>{this.setSelectedOption(t.url)}),this.setSelectedOption(this.router.url)}setSelectedOption(t){let i=this.menuOptions.find(n=>t.match(new RegExp(`(^|/)${n.path}(/|$)`)));l.isNullOrUndefined(i)?this.firstOptionDefaultSelected&&this.menuOptions.length>0?this.selectedOption=this.menuOptions[0]:this.selectedOption=null:this.selectedOption=i}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete()}navigateTo(t){this.router.navigate([t.path],{relativeTo:this.route.parent}).then(i=>{i&&(this.selectedOption=t)}).catch(l.EMPTY_REJECTION_HANDLER)}optionSelected(t){return this.firstOptionDefaultSelected&&l.isNullOrUndefined(this.selectedOption)&&(this.selectedOption=this.menuOptions[0]),this.selectedOption?.path===t.path}static{this.\u0275fac=function(i){return new(i||e)(d(V),d(U))}}static{this.\u0275cmp=g({type:e,selectors:[["abs-side-ribbon-template"]],inputs:{showExtraContent:"showExtraContent",firstOptionDefaultSelected:"firstOptionDefaultSelected",menuOptions:"menuOptions"},ngContentSelectors:nt,decls:8,vars:2,consts:[["displaySvg",""],[1,"abs-ribbon-container"],["mode","side","opened","","disableClose","true",1,"ribbon-sidenav"],[1,"ribbon-action-list"],["mat-menu-item","","class","ribbon-menu-item",3,"selected","disabled","click",4,"ngFor","ngForOf"],[1,"ribbon-content"],["class","ribbon-main-card",4,"ngIf"],[1,"ribbon-dynamic-content-container"],["mat-menu-item","",1,"ribbon-menu-item",3,"click","disabled"],[4,"ngIf","ngIfElse"],[3,"svgIcon",4,"ngIf"],[3,"svgIcon"],[1,"ribbon-main-card"]],template:function(i,n){i&1&&(R(it),o(0,"mat-sidenav-container",1)(1,"mat-sidenav",2)(2,"mat-action-list",3),c(3,mt,6,6,"button",4),m()(),o(4,"mat-sidenav-content",5),c(5,st,2,0,"div",6),o(6,"div",7),u(7,"router-outlet"),m()()()),i&2&&(a(3),r("ngForOf",n.menuOptions),a(2),r("ngIf",n.showExtraContent))},dependencies:[w,D,z,F,Q,W,K,Y,L],encapsulation:2})}}return e})();var ct=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=M({type:e})}static{this.\u0275inj=v({imports:[N,Z,k,G,J,$,X,q,B,H,P]})}}return e})();export{pt as a,ct as b};
