import{R as D}from"./chunk-JNANLRYG.js";import{E as u,Ib as l,Ob as v,Qb as I,Rb as P,Tb as r,Ub as c,V as f,Vb as M,Vc as S,Yd as k,_c as w,ab as o,ac as O,ae as F,cc as y,ea as d,ec as p,f as g,ka as _,la as C,nb as x,pc as T,qc as b,sc as m,tc as h}from"./chunk-PCDQIHDN.js";function L(n,i){if(n&1){let s=O();r(0,"div",3),y("click",function(){let e=_(s).$index,a=p();return C(a.onSelectionChanged(e))}),r(1,"span",4),m(2),c(),r(3,"span",5),m(4),c()()}if(n&2){let s=i.$implicit,t=i.$index,e=p();b("active",t===e.selectedIndex),l("id",e.getTabId(t)),o(),l("data-test",e.getDataTestId(t)),o(),h(s.count??0),o(2),h(s.title)}}var q=(()=>{let i=class i{constructor(){this.changeDetector=d(w),this.translationService=d(k),this._selectedIndex=null,this.selectionChanged=S(),this.disableAnimation=!0,this.indicatorWidth=0,this.indicatorLeft=0,this.destroyed=new g}set tabs(t){this._tabs=t,this.updateIndicatorPosition()}get tabs(){return this._tabs}set selectedIndex(t){this._selectedIndex!==null&&(this.disableAnimation=!1),this._selectedIndex=t,this.updateIndicatorPosition()}get selectedIndex(){return this._selectedIndex??0}ngOnInit(){this.translationService.onChange().pipe(u(0),f(this.destroyed)).subscribe(()=>this.updateIndicatorPosition())}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete()}onSelectionChanged(t){this.selectionChanged.emit(t)}getTabId(t){return`tab-item-${t}`}getDataTestId(t){return this.tabs[t].dataTest}updateIndicatorPosition(){setTimeout(()=>{let t=document.getElementById(this.getTabId(this.selectedIndex));this.indicatorLeft=t?.offsetLeft??0,this.indicatorWidth=t?.clientWidth??0,this.changeDetector.markForCheck()})}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=x({type:i,selectors:[["wv-tab-filter"]],inputs:{tabs:"tabs",selectedIndex:"selectedIndex"},outputs:{selectionChanged:"selectionChanged"},decls:4,vars:6,consts:[[1,"tab-filter-bar"],["matRipple","",1,"tab-item",3,"active"],[1,"tab-indicator"],["matRipple","",1,"tab-item",3,"click"],[1,"count"],["translate","",1,"tab-title"]],template:function(e,a){e&1&&(r(0,"div",0),I(1,L,5,6,"div",1,v),M(3,"div",2),c()),e&2&&(o(),P(a.tabs),o(2),T("left",a.indicatorLeft,"px")("width",a.indicatorWidth,"px"),b("no-transition",a.disableAnimation))},dependencies:[D,F],styles:[".tab-filter-bar[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:8px;position:relative}.tab-filter-bar[_ngcontent-%COMP%]   .tab-item[_ngcontent-%COMP%]{cursor:pointer;padding:8px 4px}.tab-filter-bar[_ngcontent-%COMP%]   .tab-item[_ngcontent-%COMP%]:first-of-type{margin-left:-4px}.tab-filter-bar[_ngcontent-%COMP%]   .tab-item[_ngcontent-%COMP%]:not(.active):hover{color:var(--wv-color-foreground)}.tab-filter-bar[_ngcontent-%COMP%]   .tab-item.active[_ngcontent-%COMP%]{color:var(--wv-color-primary)}.tab-filter-bar[_ngcontent-%COMP%]   .tab-item[_ngcontent-%COMP%]   .count[_ngcontent-%COMP%]{margin-right:4px}.tab-filter-bar[_ngcontent-%COMP%]   .tab-indicator[_ngcontent-%COMP%]{position:absolute;bottom:0;height:3px;background-color:var(--wv-color-primary)}.tab-filter-bar[_ngcontent-%COMP%]   .tab-indicator[_ngcontent-%COMP%]:not(.no-transition){transition:all .2s ease-in-out}"],changeDetection:0});let n=i;return n})();export{q as a};
