1import{b as X}from"./chunk-YWMLMUSK.js";import{k as W}from"./chunk-QB35ISUD.js";import"./chunk-U2I7XEXM.js";import{b as U}from"./chunk-HNV6OYQH.js";import"./chunk-TMBGVCK3.js";import"./chunk-777MRG75.js";import{g as J,i as Q}from"./chunk-3OIUX4OZ.js";import"./chunk-GP4FVJHT.js";import{a as R}from"./chunk-RO7UVPH2.js";import{a as O,h as G,o as K}from"./chunk-TPWBKR5T.js";import"./chunk-MAMG26DH.js";import"./chunk-NBFJBJJT.js";import"./chunk-DCTOVJU7.js";import"./chunk-HSI7U5KT.js";import"./chunk-U5WQGW6D.js";import"./chunk-PVDG46DZ.js";import{a as B}from"./chunk-N4QG5V37.js";import"./chunk-3KD22LSU.js";import"./chunk-XXAPIZ6S.js";import{e as $,h as z}from"./chunk-ZVFXBONE.js";import"./chunk-MSHU3ECL.js";import"./chunk-N22ZR5WE.js";import"./chunk-B5GJ42QH.js";import{K as q,h as H,n as P,s as j}from"./chunk-IRO2TKYC.js";import"./chunk-73UVCWLJ.js";import"./chunk-N2RGN4YQ.js";import"./chunk-3QEDGTE5.js";import"./chunk-NVY6DZ65.js";import{b as E,d as V,l as I}from"./chunk-ST3O4A2Y.js";import"./chunk-T5CHBPBL.js";import"./chunk-UCUZP7UP.js";import"./chunk-Y75ZLUWW.js";import"./chunk-VAND4FLG.js";import"./chunk-PG3N3OH3.js";import"./chunk-OH3XPIE7.js";import"./chunk-F52YO2KE.js";import{k as D,l as N}from"./chunk-WL2AKVEY.js";import"./chunk-VTC5CDGU.js";import"./chunk-4TCMQCZ6.js";import"./chunk-CGVZASLH.js";import"./chunk-KYKWM2QE.js";import{U as T,ua as A}from"./chunk-B2X2NDPJ.js";import"./chunk-FPPZ4BUR.js";import{$a as h,Ad as d,Bd as g,Cd as M,Mc as m,Ob as n,Oc as p,Qa as C,Qc as y,Ra as v,Rc as S,Sc as F,Tb as L,Tc as c,Uc as s,Vc as a,cd as _,fc as w,jd as f,ld as r,ne as k,te as x}from"./chunk-A2T27MTO.js";import"./chunk-DAZ3MHQI.js";import"./chunk-XFB3PWAV.js";function Y(i,l){if(i&1&&(s(0,"span",4),d(1),a()),i&2){let e=r(2);n(),M(" ",e.selectedPositions().length+e.selectedSkillLevels().length," ")}}function Z(i,l){if(i&1){let e=_();s(0,"div",0)(1,"button",2),f("click",function(){C(e);let o=r();return v(o.toggleFilters())}),s(2,"mat-icon"),d(3),a(),s(4,"span",3),d(5),m(6,Y,2,1,"span",4),a()()()}if(i&2){let e=r();n(),c("disabled",e.disabled()),n(2),g(e.showFilters()?"expand_less":"expand_more"),n(2),M(" ",e.showFilters()?"Hide":"Show"," Additional Filters "),n(),p(!e.showFilters()&&e.hasActiveFilters?6:-1)}}function ee(i,l){if(i&1&&(s(0,"mat-option",8),d(1),a()),i&2){let e=l.$implicit;c("value",e),n(),g(e)}}function te(i,l){if(i&1){let e=_();s(0,"button",10),f("click",function(o){return C(e),r(3).clearPositions(),v(o.stopPropagation())}),s(1,"mat-icon"),d(2,"clear"),a()()}if(i&2){let e=r(3);c("disabled",e.disabled())}}function ie(i,l){if(i&1&&(s(0,"mat-form-field",5)(1,"mat-label"),d(2,"Filter by Role or Play Style"),a(),s(3,"mat-select",7),S(4,ee,2,2,"mat-option",8,y),a(),m(6,te,3,1,"button",9),a()),i&2){let e=r(2);n(3),c("formControl",e.positionsControl)("disabled",e.disabled()),n(),F(e.availablePositions()),n(2),p(e.selectedPositions().length>0?6:-1)}}function oe(i,l){if(i&1&&(s(0,"mat-option",8),d(1),a()),i&2){let e=l.$implicit;c("value",e),n(),g(e)}}function ne(i,l){if(i&1){let e=_();s(0,"button",10),f("click",function(o){return C(e),r(2).clearSkillLevels(),v(o.stopPropagation())}),s(1,"mat-icon"),d(2,"clear"),a()()}if(i&2){let e=r(2);c("disabled",e.disabled())}}function le(i,l){if(i&1&&(s(0,"div",1),m(1,ie,7,3,"mat-form-field",5),s(2,"mat-form-field",6)(3,"mat-label"),d(4,"Filter by Skill Level"),a(),s(5,"mat-select",7),S(6,oe,2,2,"mat-option",8,y),a(),m(8,ne,3,1,"button",9),a()()),i&2){let e=r();n(),p(e.hasPositions()?1:-1),n(),c("ngClass",e.hasPositions()?"w-full md:w-1/2":"w-full"),n(3),c("formControl",e.skillLevelsControl)("disabled",e.disabled()),n(),F(e.SKILL_LEVELS),n(2),p(e.selectedSkillLevels().length>0?8:-1)}}var Le=(()=>{let l=class l{constructor(){this.gameTypes=x([]),this.selectedActivity=x(null),this.disabled=x(!1),this.filterChange=new L,this.positionsControl=new P([]),this.skillLevelsControl=new P([]),this.SKILL_LEVELS=["Beginner","Intermediate","Advanced","Expert"],this.currentGameType=k(()=>{let t=this.selectedActivity();return t&&this.gameTypes().find(o=>o.label.toLowerCase()===t.toLowerCase())||null}),this.availablePositions=k(()=>this.currentGameType()?.roles?.sort()||[]),this.selectedPositions=h([]),this.selectedSkillLevels=h([]),this.show
1Filters=h(!1)}ngOnInit(){this.positionsControl.valueChanges.subscribe(t=>{this.handlePositionsChange(t||[])}),this.skillLevelsControl.valueChanges.subscribe(t=>{this.handleSkillLevelsChange(t||[])})}handlePositionsChange(t){this.selectedPositions.set(t),this.emitFilterChange()}handleSkillLevelsChange(t){this.selectedSkillLevels.set(t),this.emitFilterChange()}emitFilterChange(){this.filterChange.emit({positions:this.selectedPositions(),skillLevels:this.selectedSkillLevels()})}togglePosition(t){let o=this.positionsControl.value||[];o.indexOf(t)===-1?this.positionsControl.setValue([...o,t]):this.positionsControl.setValue(o.filter(b=>b!==t))}toggleSkillLevel(t){let o=this.skillLevelsControl.value||[];o.indexOf(t)===-1?this.skillLevelsControl.setValue([...o,t]):this.skillLevelsControl.setValue(o.filter(b=>b!==t))}clearPositions(){this.positionsControl.setValue([])}clearSkillLevels(){this.skillLevelsControl.setValue([])}clearAll(){this.clearPositions(),this.clearSkillLevels()}hasPositions(){return this.availablePositions().length>0}isPositionSelected(t){return this.selectedPositions().includes(t)}isSkillLevelSelected(t){return this.selectedSkillLevels().includes(t)}toggleFilters(){this.showFilters.update(t=>!t)}get hasActiveFilters(){return this.selectedPositions().length>0||this.selectedSkillLevels().length>0}};l.\u0275fac=function(o){return new(o||l)},l.\u0275cmp=w({type:l,selectors:[["app-activity-position-filter"]],inputs:{gameTypes:[1,"gameTypes"],selectedActivity:[1,"selectedActivity"],disabled:[1,"disabled"]},outputs:{filterChange:"filterChange"},decls:2,vars:2,consts:[[1,"mb-4"],[1,"flex","flex-col","md:flex-row","gap-4","animate-slide-down"],["mat-stroked-button","",1,"w-full","md:w-auto",3,"click","disabled"],[1,"ml-2"],[1,"ml-2","px-2","py-1","bg-primary-100","text-primary-700","rounded-full","text-xs"],[1,"w-full","md:w-1/2"],[3,"ngClass"],["multiple","",3,"formControl","disabled"],[3,"value"],["matSuffix","","mat-icon-button","",3,"disabled"],["matSuffix","","mat-icon-button","",3,"click","disabled"]],template:function(o,u){o&1&&(m(0,Z,7,4,"div",0),m(1,le,9,5,"div",1)),o&2&&(p(u.selectedActivity()?0:-1),n(),p(u.showFilters()?1:-1))},dependencies:[A,T,q,H,j,R,K,O,G,Q,J,$,z,U,W,N,D,I,V,E,B,X],encapsulation:2,changeDetection:0});let i=l;return i})();export{Le as ActivityPositionFilterComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.